@keboola/api-client 55.0.0 → 57.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +110 -229
- package/API-SURFACE.md +12 -2
- package/CHANGELOG.md +61 -0
- package/README.md +20 -133
- package/dist/{ManagementSessionMintError-Bc9bc7Ai.cjs → ManagementSessionMintError-BCOLLaJi.cjs} +3 -2
- package/dist/ManagementSessionMintError-BCOLLaJi.cjs.map +1 -0
- package/dist/{ManagementSessionMintError-BMHDcEqV.js → ManagementSessionMintError-KUX3utTV.js} +3 -2
- package/dist/ManagementSessionMintError-KUX3utTV.js.map +1 -0
- package/dist/{adminRoles-Cm513r1G.d.ts → adminRoles-CnfGDvjN.d.ts} +2 -2
- package/dist/{adminRoles-BTKVwEy8.d.cts → adminRoles-D6AS9Bzx.d.cts} +2 -2
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/types.d.cts +1 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/apps/index.cjs +1 -1
- package/dist/apps/index.d.cts +2 -2
- package/dist/apps/index.d.ts +2 -2
- package/dist/apps/index.js +1 -1
- package/dist/apps/types.d.cts +2 -2
- package/dist/apps/types.d.ts +2 -2
- package/dist/{apps-C1x5IKNQ.cjs → apps-BA9JRLAZ.cjs} +55 -1
- package/dist/apps-BA9JRLAZ.cjs.map +1 -0
- package/dist/{apps-BN7fWtSm.js → apps-DDcguJ1i.js} +55 -1
- package/dist/apps-DDcguJ1i.js.map +1 -0
- package/dist/assets/index.d.cts +1 -1
- package/dist/assets/index.d.ts +1 -1
- package/dist/auth/index.cjs +1 -1
- package/dist/auth/index.d.cts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/types.d.cts +2 -2
- package/dist/auth/types.d.ts +2 -2
- package/dist/{authClient-BM4L8XEN.js → authClient-BKGpJI5L.js} +14 -45
- package/dist/authClient-BKGpJI5L.js.map +1 -0
- package/dist/{authClient-DspK50e7.cjs → authClient-C3KG9hXw.cjs} +15 -58
- package/dist/authClient-C3KG9hXw.cjs.map +1 -0
- package/dist/{authClient-ij_Rm2Yn.d.ts → authClient-CbWpMmdX.d.ts} +7 -4
- package/dist/{authClient-NBi0pqD5.d.cts → authClient-UKeopxZZ.d.cts} +7 -4
- package/dist/billing/index.d.cts +1 -1
- package/dist/billing/index.d.ts +1 -1
- package/dist/billing/types.d.cts +1 -1
- package/dist/billing/types.d.ts +1 -1
- package/dist/chat/index.d.cts +2 -2
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/types.d.cts +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/componentsMcp/index.d.cts +1 -1
- package/dist/componentsMcp/index.d.ts +1 -1
- package/dist/componentsMcp/types.d.cts +1 -1
- package/dist/componentsMcp/types.d.ts +1 -1
- package/dist/constants/index.cjs +2 -2
- package/dist/constants/index.d.cts +3 -3
- package/dist/constants/index.d.ts +3 -3
- package/dist/constants/index.js +2 -2
- package/dist/{constants-HccvU5kx.js → constants-CxEaHCyt.js} +4 -3
- package/dist/constants-CxEaHCyt.js.map +1 -0
- package/dist/{constants-V9hAyPTo.cjs → constants-fiyOLyZE.cjs} +4 -3
- package/dist/constants-fiyOLyZE.cjs.map +1 -0
- package/dist/dataScience/index.d.cts +3 -3
- package/dist/dataScience/index.d.ts +3 -3
- package/dist/dataScience/types.d.cts +1 -1
- package/dist/dataScience/types.d.ts +1 -1
- package/dist/developerPortal/index.cjs +1 -1
- package/dist/developerPortal/index.d.cts +3 -3
- package/dist/developerPortal/index.d.ts +3 -3
- package/dist/developerPortal/index.js +1 -1
- package/dist/developerPortal/types.d.cts +2 -2
- package/dist/developerPortal/types.d.ts +2 -2
- package/dist/{developerPortalClient-CzCJ5sE3.js → developerPortalClient-3Q7049-4.js} +19 -1
- package/dist/developerPortalClient-3Q7049-4.js.map +1 -0
- package/dist/{developerPortalClient-BcK9F-Fs.cjs → developerPortalClient-Cj9bStCS.cjs} +19 -1
- package/dist/developerPortalClient-Cj9bStCS.cjs.map +1 -0
- package/dist/domain/permissions/index.d.cts +1 -1
- package/dist/domain/permissions/index.d.ts +1 -1
- package/dist/editor/index.d.cts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/{emitter-raKkIqRp.d.ts → emitter-yaYzJOdh.d.cts} +1 -2
- package/dist/{emitter-raKkIqRp.d.cts → emitter-yaYzJOdh.d.ts} +1 -2
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/import/index.d.cts +3 -3
- package/dist/import/index.d.ts +3 -3
- package/dist/{index-FrsEkDvX.d.cts → index-9p4O-clX.d.cts} +2035 -73
- package/dist/{index-FrsEkDvX.d.ts → index-9p4O-clX.d.ts} +2035 -73
- package/dist/{index-BGE3eZfd.d.cts → index-B-HCh7LL.d.cts} +3 -3
- package/dist/{index-D3hWR_e4.d.ts → index-B0e42GnK.d.cts} +4 -3
- package/dist/{index-DeWeUUfE.d.ts → index-BbXGsspe.d.ts} +4 -4
- package/dist/{index-CYk7Aa8u.d.cts → index-Bg9BWpIY.d.ts} +4 -3
- package/dist/{index-CmyFWQXn.d.cts → index-BgEu7wGk.d.cts} +2671 -7325
- package/dist/{index-B8K-Bbdq.d.cts → index-Btft3BFn.d.ts} +29 -3
- package/dist/{index-CNJBmCHM.d.cts → index-ByaAn_lm.d.cts} +4 -4
- package/dist/{index-DLWMm1-T.d.ts → index-C92Ct6K5.d.ts} +178 -4
- package/dist/{index-CEDjFidH.d.ts → index-CBq59Aif.d.ts} +3 -3
- package/dist/{index-CQNwp6wX.d.ts → index-CGUPsu_R.d.cts} +29 -3
- package/dist/{index-CZvBjQvl.d.ts → index-CIA6-x2Q.d.ts} +4 -4
- package/dist/{index-BVe4S2CK.d.ts → index-CeWVf3d1.d.ts} +4 -4
- package/dist/{index-CQPs3hrp.d.ts → index-Cj0l_DL_.d.ts} +2671 -7325
- package/dist/{index-BUZ-vTRt.d.ts → index-Ck0UPKMM.d.ts} +2 -2
- package/dist/{index-d9zxFmNI.d.cts → index-D0ACg_Pp.d.cts} +7 -4
- package/dist/{index-8QhOqFLY.d.cts → index-D8nMnVp1.d.cts} +4 -4
- package/dist/{index-24GpnYhn.d.cts → index-DENUPo51.d.cts} +2 -2
- package/dist/{index-iFCann29.d.cts → index-DGjxLWZ-.d.cts} +3 -3
- package/dist/{index-CdeWTy8t.d.ts → index-Dse6Psvc.d.ts} +7 -4
- package/dist/{index-DTGOEke4.d.ts → index-DxcaEIhU.d.ts} +3 -3
- package/dist/{index-BE6qM0vu.d.cts → index-OCEoQ1Y-.d.cts} +4 -4
- package/dist/{index-BXgjPlZN.d.cts → index-jR69kGUZ.d.cts} +178 -4
- package/dist/index.cjs +613 -865
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +611 -860
- package/dist/index.js.map +1 -1
- package/dist/kaiAgent/index.cjs +1 -1
- package/dist/kaiAgent/index.d.cts +2 -2
- package/dist/kaiAgent/index.d.ts +2 -2
- package/dist/kaiAgent/index.js +1 -1
- package/dist/kaiAgent/types.d.cts +2 -2
- package/dist/kaiAgent/types.d.ts +2 -2
- package/dist/{kaiAgent-De2T6G4G.cjs → kaiAgent-Q00g6S1v.cjs} +16 -1
- package/dist/kaiAgent-Q00g6S1v.cjs.map +1 -0
- package/dist/{kaiAgent-D0MoKqXe.js → kaiAgent-aqylPZHY.js} +16 -1
- package/dist/kaiAgent-aqylPZHY.js.map +1 -0
- package/dist/management/index.cjs +1 -1
- package/dist/management/index.d.cts +1 -1
- package/dist/management/index.d.ts +1 -1
- package/dist/management/index.js +1 -1
- package/dist/management/types.d.cts +1 -1
- package/dist/management/types.d.ts +1 -1
- package/dist/{management-BlMQnPNS.js → management-CIK5-Aq5.js} +14 -7
- package/dist/management-CIK5-Aq5.js.map +1 -0
- package/dist/{management-dIMrTTpI.cjs → management-Dqrc516s.cjs} +14 -7
- package/dist/management-Dqrc516s.cjs.map +1 -0
- package/dist/{metaObject-ClvW342q.d.ts → metaObject-AQ7wKDOu.d.ts} +2 -2
- package/dist/{metaObject-D7oudegV.d.cts → metaObject-I35_krxf.d.cts} +2 -2
- package/dist/metastore/index.d.cts +1 -1
- package/dist/metastore/index.d.ts +1 -1
- package/dist/metastore/types.d.cts +1 -1
- package/dist/metastore/types.d.ts +1 -1
- package/dist/microsoftGraph/index.d.cts +3 -3
- package/dist/microsoftGraph/index.d.ts +3 -3
- package/dist/microsoftGraph/types.d.cts +2 -2
- package/dist/microsoftGraph/types.d.ts +2 -2
- package/dist/{middleware-DxGv7DG8.js → middleware-DWmhthX0.js} +2 -2
- package/dist/middleware-DWmhthX0.js.map +1 -0
- package/dist/{middleware-vIaPDtQI.cjs → middleware-DYdDD4O6.cjs} +2 -2
- package/dist/middleware-DYdDD4O6.cjs.map +1 -0
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/types.d.cts +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/oauth/index.d.cts +2 -2
- package/dist/oauth/index.d.ts +2 -2
- package/dist/oauth/types.d.cts +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/omnisearch/index.d.cts +2 -2
- package/dist/omnisearch/index.d.ts +2 -2
- package/dist/omnisearch/types.d.cts +1 -1
- package/dist/omnisearch/types.d.ts +1 -1
- package/dist/{project-DS0HOV3M.d.ts → project-DwRvx_zN.d.ts} +3 -3
- package/dist/{project-BGk9CtOq.d.cts → project-ERH0FTGW.d.cts} +3 -3
- package/dist/queryService/index.cjs +1 -1
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/index.js +1 -1
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/{queryService-C3BQ6GKW.cjs → queryService-CECWubS0.cjs} +2 -2
- package/dist/{queryService-C3BQ6GKW.cjs.map → queryService-CECWubS0.cjs.map} +1 -1
- package/dist/{queryService-DQHtHy2-.js → queryService-CIxb_mcP.js} +2 -2
- package/dist/{queryService-DQHtHy2-.js.map → queryService-CIxb_mcP.js.map} +1 -1
- package/dist/queue/index.cjs +1 -1
- package/dist/queue/index.d.cts +11 -4
- package/dist/queue/index.d.ts +11 -4
- package/dist/queue/index.js +1 -1
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/{queue-6cywDnA-.js → queue-BBihD5qQ.js} +2 -2
- package/dist/{queue-6cywDnA-.js.map → queue-BBihD5qQ.js.map} +1 -1
- package/dist/{queue-J2uXzXR9.cjs → queue-PmTfoniJ.cjs} +2 -2
- package/dist/{queue-J2uXzXR9.cjs.map → queue-PmTfoniJ.cjs.map} +1 -1
- package/dist/scheduler/index.d.cts +2 -2
- package/dist/scheduler/index.d.ts +2 -2
- package/dist/scheduler/types.d.cts +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/{schema-DLmBEgPM.d.cts → schema-CqzWi5cO.d.cts} +14 -4
- package/dist/{schema-DLmBEgPM.d.ts → schema-CqzWi5cO.d.ts} +14 -4
- package/dist/sdk/configurations/index.d.cts +2 -3
- package/dist/sdk/configurations/index.d.ts +2 -3
- package/dist/sdk/dataAppServer/index.cjs +3 -3
- package/dist/sdk/dataAppServer/index.d.cts +1 -1
- package/dist/sdk/dataAppServer/index.d.ts +1 -1
- package/dist/sdk/dataAppServer/index.js +3 -3
- package/dist/sdk/developerPortal/index.cjs +3 -3
- package/dist/sdk/developerPortal/index.cjs.map +1 -1
- package/dist/sdk/developerPortal/index.d.cts +178 -4
- package/dist/sdk/developerPortal/index.d.ts +178 -4
- package/dist/sdk/developerPortal/index.js +3 -3
- package/dist/sdk/developerPortal/index.js.map +1 -1
- package/dist/sdk/kaiMemory/index.d.cts +1 -1
- package/dist/sdk/kaiMemory/index.d.ts +1 -1
- package/dist/sdk/kaiMemory/types.d.cts +1 -1
- package/dist/sdk/kaiMemory/types.d.ts +1 -1
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/securityPolicy/index.d.cts +2 -2
- package/dist/sdk/securityPolicy/index.d.ts +2 -2
- package/dist/sdk/securityPolicy/types.d.cts +1 -1
- package/dist/sdk/securityPolicy/types.d.ts +1 -1
- package/dist/sdk/semanticLayer/index.d.cts +1 -1
- package/dist/sdk/semanticLayer/index.d.ts +1 -1
- package/dist/sdk/semanticLayer/types.d.cts +1 -1
- package/dist/sdk/semanticLayer/types.d.ts +1 -1
- package/dist/sdk/tag/index.d.cts +3 -3
- package/dist/sdk/tag/index.d.ts +3 -3
- package/dist/sdk/tag/types.d.cts +1 -1
- package/dist/sdk/tag/types.d.ts +1 -1
- package/dist/sdk/vault/index.d.cts +1 -1
- package/dist/sdk/vault/index.d.ts +1 -1
- package/dist/status/index.d.cts +1 -1
- package/dist/status/index.d.ts +1 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.d.cts +2 -3
- package/dist/storage/index.d.ts +2 -3
- package/dist/storage/index.js +3 -3
- package/dist/storage/types.d.cts +6 -6
- package/dist/storage/types.d.ts +6 -6
- package/dist/{storage-BL-TfHp8.cjs → storage-chxoWtAL.cjs} +83 -42
- package/dist/storage-chxoWtAL.cjs.map +1 -0
- package/dist/{storage-DEJN8sw-.js → storage-o9teEKl_.js} +83 -42
- package/dist/storage-o9teEKl_.js.map +1 -0
- package/dist/{store-2OyH1XOP.cjs → store-7xlVu4qF.cjs} +3 -14
- package/dist/store-7xlVu4qF.cjs.map +1 -0
- package/dist/{store-HP0zRcLz.js → store-DDUzPeCm.js} +3 -14
- package/dist/store-DDUzPeCm.js.map +1 -0
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/syncActions/index.d.cts +2 -2
- package/dist/syncActions/index.d.ts +2 -2
- package/dist/syncActions/types.d.cts +1 -1
- package/dist/syncActions/types.d.ts +1 -1
- package/dist/telemetry/index.d.cts +2 -2
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/types.d.cts +1 -1
- package/dist/telemetry/types.d.ts +1 -1
- package/dist/{transientRetries-BORv47mH.js → transientRetries-dssygpwU.js} +2 -2
- package/dist/{transientRetries-BORv47mH.js.map → transientRetries-dssygpwU.js.map} +1 -1
- package/dist/{transientRetries-CBorl4Ue.cjs → transientRetries-yVaQgKqP.cjs} +2 -2
- package/dist/{transientRetries-CBorl4Ue.cjs.map → transientRetries-yVaQgKqP.cjs.map} +1 -1
- package/dist/{types-BEw98Dd2.d.cts → types-B1kernzE.d.cts} +2 -2
- package/dist/{types-DjSjUKUl.d.ts → types-BBmS7-IS.d.ts} +151 -4
- package/dist/{types-DbthI3r-.d.ts → types-BJyWTgXX.d.ts} +2 -2
- package/dist/{types-DNwIMEuB.d.cts → types-BPNFTA63.d.cts} +21 -7
- package/dist/{types-Bv2Ds1hL.d.cts → types-BPSExpye.d.cts} +244 -4
- package/dist/{types-Dsf7CYmm.d.ts → types-BiXonOK6.d.ts} +2 -2
- package/dist/{types-BXKL0wTI.d.cts → types-BimRBONo.d.cts} +3 -3
- package/dist/{types-D2hhEGem.d.cts → types-BuEC58u3.d.cts} +2 -2
- package/dist/{types-dU3EA8gk.d.ts → types-BzHyi99r.d.cts} +5 -3
- package/dist/{types-J_dgwMjP.d.ts → types-C4T_2JdN.d.cts} +40 -27
- package/dist/{types-OHt0D_f2.d.ts → types-C53aKnWt.d.ts} +2 -2
- package/dist/{types-Do3__S4Q.d.cts → types-CEjgqmr2.d.cts} +2 -2
- package/dist/{types-CQYyULrw.d.ts → types-CGtpwTJk.d.ts} +2 -2
- package/dist/{types-D5bxXqEU.d.ts → types-CH1uguug.d.cts} +2 -163
- package/dist/{types-Tg3euEN_.d.ts → types-CP8-CssY.d.ts} +2 -2
- package/dist/{types-DX1Dz0xK.d.ts → types-CPQ6RkiZ.d.ts} +244 -4
- package/dist/{types-DSWIIMdv.d.ts → types-CPwofeyq.d.ts} +3 -3
- package/dist/{types-ChOJ-Az7.d.cts → types-CQAEOq-K.d.cts} +2 -2
- package/dist/{types-CKdNf_2k.d.cts → types-CVWoP_PC.d.cts} +3 -3
- package/dist/{types-B4ezB18r.d.cts → types-CbM2MApW.d.cts} +2 -2
- package/dist/{types-BD0B1KQ6.d.ts → types-CbOfT6lb.d.ts} +21 -7
- package/dist/{types-DMhgKHCP.d.cts → types-CcPpqVhm.d.cts} +2 -2
- package/dist/{types-d5Bt8Mr3.d.ts → types-CeqpzbBH.d.ts} +2 -2
- package/dist/{types-DU8aPTFW.d.cts → types-CjJYZaMO.d.cts} +2 -2
- package/dist/{types-B4Vwz45w.d.cts → types-CjP8RcFN.d.cts} +2 -2
- package/dist/{types-Rrcx-8LM.d.ts → types-CjfsPtwk.d.ts} +2 -2
- package/dist/{types-B6f6LpZ_.d.cts → types-CnSBLcZB.d.ts} +163 -3
- package/dist/{types-Bp8G9yta.d.ts → types-CsXLdnfV.d.ts} +2 -2
- package/dist/{types-Y4e8GGa3.d.cts → types-CzAh5-0z.d.cts} +2 -2
- package/dist/{types-BDgOF2WN.d.ts → types-D0F_c5KI.d.ts} +4 -4
- package/dist/{types-C5B3Pfob.d.cts → types-D3L3CqKl.d.cts} +151 -4
- package/dist/{types-CTYTMXXj.d.ts → types-D4oIei5M.d.cts} +163 -3
- package/dist/{types-CSE8bHiq.d.cts → types-D6ilG8sC.d.cts} +3 -3
- package/dist/{types-Cf0WE6qK.d.cts → types-DEGkXcw2.d.ts} +5 -3
- package/dist/{types-BynQKst1.d.cts → types-DEhAcO1Z.d.cts} +2 -2
- package/dist/{types-DCARsJWs.d.cts → types-DaIfg9Mb.d.cts} +4 -4
- package/dist/{types-p_lWvuQJ.d.ts → types-DhofEmWy.d.ts} +2 -2
- package/dist/{types-zlYUn0oi.d.ts → types-Dp61pYgP.d.ts} +3 -3
- package/dist/{types-CRC4lbPw.d.cts → types-Dteot3tT.d.ts} +757 -112
- package/dist/{types-DoSZQ1Bi.d.ts → types-K-JISUUI.d.cts} +757 -112
- package/dist/{types-Bwvss_gW.d.cts → types-TywAc1ow.d.ts} +40 -27
- package/dist/{types-B6JcEPEu.d.ts → types-UBpth6_9.d.ts} +2 -2
- package/dist/{types-DKKHKj19.d.cts → types-Vw-tduOH.d.ts} +2 -163
- package/dist/{types-CIlBSV99.d.cts → types-ZyLTqgpa.d.cts} +2 -2
- package/dist/{types-D-ufoskb.d.cts → types-aylD1zQz.d.cts} +17 -2
- package/dist/{types-BVJmcoqA.d.cts → types-fYY4q7dC.d.cts} +2 -2
- package/dist/{types-DK1bSUNr.d.ts → types-jYn3e3Du.d.ts} +3 -3
- package/dist/{types-CepTvkfm.d.ts → types-qXqJRPHj.d.ts} +2 -2
- package/dist/{types-kGZQQcIK.d.ts → types-r-Qa3y8e.d.ts} +2 -2
- package/dist/{types-Cr6WA6CN.d.ts → types-z82j5aNW.d.ts} +17 -2
- package/dist/validateConnectionStatus-DgJwuEy9.js +86 -0
- package/dist/validateConnectionStatus-DgJwuEy9.js.map +1 -0
- package/dist/validateConnectionStatus-DpYRsU-e.cjs +121 -0
- package/dist/validateConnectionStatus-DpYRsU-e.cjs.map +1 -0
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/package.json +2 -2
- package/surface/apps.md +8 -3
- package/surface/auth.md +3 -2
- package/surface/chat.md +3 -3
- package/surface/dataScience.md +2 -2
- package/surface/kaiAgent.md +4 -3
- package/surface/management.md +4 -4
- package/surface/queue.md +7 -7
- package/surface/storage.md +32 -26
- package/dist/ManagementSessionMintError-BMHDcEqV.js.map +0 -1
- package/dist/ManagementSessionMintError-Bc9bc7Ai.cjs.map +0 -1
- package/dist/apps-BN7fWtSm.js.map +0 -1
- package/dist/apps-C1x5IKNQ.cjs.map +0 -1
- package/dist/authClient-BM4L8XEN.js.map +0 -1
- package/dist/authClient-DspK50e7.cjs.map +0 -1
- package/dist/constants-HccvU5kx.js.map +0 -1
- package/dist/constants-V9hAyPTo.cjs.map +0 -1
- package/dist/developerPortalClient-BcK9F-Fs.cjs.map +0 -1
- package/dist/developerPortalClient-CzCJ5sE3.js.map +0 -1
- package/dist/index-BGsP2QBc.d.ts +0 -10
- package/dist/index-CWowDl63.d.cts +0 -10
- package/dist/kaiAgent-D0MoKqXe.js.map +0 -1
- package/dist/kaiAgent-De2T6G4G.cjs.map +0 -1
- package/dist/management-BlMQnPNS.js.map +0 -1
- package/dist/management-dIMrTTpI.cjs.map +0 -1
- package/dist/middleware-DxGv7DG8.js.map +0 -1
- package/dist/middleware-vIaPDtQI.cjs.map +0 -1
- package/dist/storage-BL-TfHp8.cjs.map +0 -1
- package/dist/storage-DEJN8sw-.js.map +0 -1
- package/dist/store-2OyH1XOP.cjs.map +0 -1
- package/dist/store-HP0zRcLz.js.map +0 -1
- package/dist/validateConnectionStatus-DV00sDmu.js +0 -34
- package/dist/validateConnectionStatus-DV00sDmu.js.map +0 -1
- package/dist/validateConnectionStatus-ckaHcRx8.cjs +0 -51
- package/dist/validateConnectionStatus-ckaHcRx8.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-
|
|
1
|
+
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-ZyLTqgpa.cjs";
|
|
2
2
|
export type { CreateMetaObjectBody, CreateMetaObjectInput, CreateMetaObjectPath, CreateMetaObjectReturn, DeleteMetaObjectPath, DeleteMetaObjectRevisionPath, GetMetaObjectPath, GetMetaObjectRevisionPath, GetMetaObjectRevisionsInput, GetMetaObjectRevisionsPath, GetMetaObjectRevisionsQuery, GetMetaObjectRevisionsSchemaQuery, GetMetaObjectsInput, GetMetaObjectsPath, GetMetaObjectsQuery, GetMetaObjectsSchemaQuery, GetOrganizationMetaObjectsPath, GetOrganizationMetaObjectsQuery, GetOrganizationMetaObjectsSchemaQuery, GetSchemaPath, GetVersionedSchemaPath, MetaObject, MetaObjectMeta, MetaObjectScope, MetaStoreListResponse, MetaStoreObjectResponse, RawMetaObject, ReplaceMetaObjectBody, ReplaceMetaObjectInput, ReplaceMetaObjectPath, ReplaceTargetProjectsBody, ReplaceTargetProjectsInput, ReplaceTargetProjectsPath, ScopeElevationRequestPath, UpdateMetaObjectBody, UpdateMetaObjectInput, UpdateMetaObjectPath };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-
|
|
1
|
+
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-CsXLdnfV.js";
|
|
2
2
|
export type { CreateMetaObjectBody, CreateMetaObjectInput, CreateMetaObjectPath, CreateMetaObjectReturn, DeleteMetaObjectPath, DeleteMetaObjectRevisionPath, GetMetaObjectPath, GetMetaObjectRevisionPath, GetMetaObjectRevisionsInput, GetMetaObjectRevisionsPath, GetMetaObjectRevisionsQuery, GetMetaObjectRevisionsSchemaQuery, GetMetaObjectsInput, GetMetaObjectsPath, GetMetaObjectsQuery, GetMetaObjectsSchemaQuery, GetOrganizationMetaObjectsPath, GetOrganizationMetaObjectsQuery, GetOrganizationMetaObjectsSchemaQuery, GetSchemaPath, GetVersionedSchemaPath, MetaObject, MetaObjectMeta, MetaObjectScope, MetaStoreListResponse, MetaStoreObjectResponse, RawMetaObject, ReplaceMetaObjectBody, ReplaceMetaObjectInput, ReplaceMetaObjectPath, ReplaceTargetProjectsBody, ReplaceTargetProjectsInput, ReplaceTargetProjectsPath, ScopeElevationRequestPath, UpdateMetaObjectBody, UpdateMetaObjectInput, UpdateMetaObjectPath };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ClientInitOptions } from "../types-
|
|
3
|
-
import { t as components } from "../schema-
|
|
1
|
+
import { fi as MiddlewareFn } from "../index-9p4O-clX.cjs";
|
|
2
|
+
import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
|
|
3
|
+
import { t as components } from "../schema-CqzWi5cO.cjs";
|
|
4
4
|
/**
|
|
5
5
|
* Auth arrives as a middleware, never as a token: a client here holds no credential. Pair it with
|
|
6
6
|
* `createMicrosoftGraphAuthMiddleware`, which the consumer builds from the token its OAuth flow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ClientInitOptions } from "../types-
|
|
3
|
-
import { t as components } from "../schema-
|
|
1
|
+
import { fi as MiddlewareFn } from "../index-9p4O-clX.js";
|
|
2
|
+
import { n as ClientInitOptions } from "../types-CP8-CssY.js";
|
|
3
|
+
import { t as components } from "../schema-CqzWi5cO.js";
|
|
4
4
|
/**
|
|
5
5
|
* Auth arrives as a middleware, never as a token: a client here holds no credential. Pair it with
|
|
6
6
|
* `createMicrosoftGraphAuthMiddleware`, which the consumer builds from the token its OAuth flow
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as OpenapiReturnType } from "../index-
|
|
2
|
-
import { n as paths } from "../schema-
|
|
1
|
+
import { l as OpenapiReturnType } from "../index-9p4O-clX.cjs";
|
|
2
|
+
import { n as paths } from "../schema-CqzWi5cO.cjs";
|
|
3
3
|
type User = OpenapiReturnType<paths['/me']['get']>;
|
|
4
4
|
type Drive = OpenapiReturnType<paths['/me/drive']['get']>;
|
|
5
5
|
type DriveItem = OpenapiReturnType<paths['/drives/{drive-id}/items/{driveItem-id}']['get']>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as OpenapiReturnType } from "../index-
|
|
2
|
-
import { n as paths } from "../schema-
|
|
1
|
+
import { l as OpenapiReturnType } from "../index-9p4O-clX.js";
|
|
2
|
+
import { n as paths } from "../schema-CqzWi5cO.js";
|
|
3
3
|
type User = OpenapiReturnType<paths['/me']['get']>;
|
|
4
4
|
type Drive = OpenapiReturnType<paths['/me/drive']['get']>;
|
|
5
5
|
type DriveItem = OpenapiReturnType<paths['/drives/{drive-id}/items/{driveItem-id}']['get']>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as HttpStatus, p as ApiError, s as HttpHeader } from "./createFetchClient-Dc_ZMuq7.js";
|
|
2
|
-
// src/keboola/
|
|
2
|
+
// src/keboola/credentials/middleware.ts
|
|
3
3
|
const isUnauthorized = (error) => error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;
|
|
4
4
|
/**
|
|
5
5
|
* Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.
|
|
@@ -29,4 +29,4 @@ const createBearerAuthMiddleware = (source) => {
|
|
|
29
29
|
};
|
|
30
30
|
export { isUnauthorized as n, createBearerAuthMiddleware as t };
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=middleware-
|
|
32
|
+
//# sourceMappingURL=middleware-DWmhthX0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-DWmhthX0.js","names":[],"sources":["../src/keboola/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;;;;;;;AAapE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAI,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAI,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_createFetchClient = require("./createFetchClient-CDKSkd7i.cjs");
|
|
2
|
-
// src/keboola/
|
|
2
|
+
// src/keboola/credentials/middleware.ts
|
|
3
3
|
const isUnauthorized = (error) => error instanceof require_createFetchClient.ApiError && error.response.status === require_createFetchClient.HttpStatus.UNAUTHORIZED;
|
|
4
4
|
/**
|
|
5
5
|
* Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.
|
|
@@ -40,4 +40,4 @@ Object.defineProperty(exports, "isUnauthorized", {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
//# sourceMappingURL=middleware-
|
|
43
|
+
//# sourceMappingURL=middleware-DYdDD4O6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-DYdDD4O6.cjs","names":["ApiError","HttpStatus","HttpHeader"],"sources":["../src/keboola/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { HttpStatus } from '../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;;;;;;;AAapE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAIC,0BAAAA,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAIA,0BAAAA,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
|
|
2
|
+
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-DEhAcO1Z.cjs";
|
|
3
3
|
declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
4
4
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
5
5
|
getSubscriptions: (query?: ListSubscriptionsQuery, signal?: AbortSignal) => Promise<({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CP8-CssY.js";
|
|
2
|
+
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-BiXonOK6.js";
|
|
3
3
|
declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
4
4
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
5
5
|
getSubscriptions: (query?: ListSubscriptionsQuery, signal?: AbortSignal) => Promise<({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-DEhAcO1Z.cjs";
|
|
2
2
|
export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-BiXonOK6.js";
|
|
2
2
|
export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
|
package/dist/oauth/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
|
|
2
|
+
import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-CcPpqVhm.cjs";
|
|
3
3
|
declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
4
4
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
5
5
|
getCredentials: (scope: GetCredentialsInput, signal?: AbortSignal) => Promise<{
|
package/dist/oauth/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CP8-CssY.js";
|
|
2
|
+
import { a as CredentialInput, c as GetOrganizationConnectFormInput, h as GetCredentialsInput, l as GetOrganizationCredentialsInput, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, u as GetOrganizationGitHubAppsInput } from "../types-DhofEmWy.js";
|
|
3
3
|
declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
4
4
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
5
5
|
getCredentials: (scope: GetCredentialsInput, signal?: AbortSignal) => Promise<{
|
package/dist/oauth/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-
|
|
1
|
+
import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-CcPpqVhm.cjs";
|
|
2
2
|
export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, DeleteOrganizationCredentialsInput, type GetCredentialsInput, GetOrganizationConnectFormInput, GetOrganizationCredentialsInput, GetOrganizationGitHubAppsInput, OrganizationConnectErrorCode, OrganizationConnection, OrganizationCredentials, OrganizationGitHubApp };
|
package/dist/oauth/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-
|
|
1
|
+
import { a as CredentialInput, c as GetOrganizationConnectFormInput, d as OrganizationConnectErrorCode, f as OrganizationConnection, h as GetCredentialsInput, i as Credential, l as GetOrganizationCredentialsInput, m as OrganizationGitHubApp, n as CreateCredentialBody, o as CredentialPath, p as OrganizationCredentials, r as CreateCredentialInput, s as DeleteOrganizationCredentialsInput, t as ComponentPath, u as GetOrganizationGitHubAppsInput } from "../types-DhofEmWy.js";
|
|
2
2
|
export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, DeleteOrganizationCredentialsInput, type GetCredentialsInput, GetOrganizationConnectFormInput, GetOrganizationCredentialsInput, GetOrganizationGitHubAppsInput, OrganizationConnectErrorCode, OrganizationConnection, OrganizationCredentials, OrganizationGitHubApp };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
|
|
2
|
+
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-aylD1zQz.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Omnisearch — data lineage.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CP8-CssY.js";
|
|
2
|
+
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-z82j5aNW.js";
|
|
3
3
|
/**
|
|
4
4
|
* Omnisearch — data lineage.
|
|
5
5
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-
|
|
1
|
+
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-aylD1zQz.cjs";
|
|
2
2
|
export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-
|
|
1
|
+
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-z82j5aNW.js";
|
|
2
2
|
export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./adminRoles-
|
|
1
|
+
import { Rr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-9p4O-clX.js";
|
|
2
|
+
import "./adminRoles-CnfGDvjN.js";
|
|
3
3
|
import { t as Backend } from "./backends-BHotIdL0.js";
|
|
4
4
|
type ProjectId = number;
|
|
5
5
|
type CreateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens']['post']>;
|
|
@@ -68,4 +68,4 @@ declare const createProject: ({ sapiToken }: Options) => {
|
|
|
68
68
|
};
|
|
69
69
|
type Project = ReturnType<typeof createProject>;
|
|
70
70
|
export { UpdateTokenBody as _, CreateTokenBody as a, UpdateTokenSchemaBody as b, GetTokenEventsInput as c, ShareTokenBody as d, ShareTokenInput as f, TokenListItem as g, StorageTokenRaw as h, hasFeature as i, GetTokenEventsPath as l, StorageToken as m, createProject as n, CreateTokenResponse as o, ShareTokenPath as p, hasAdminFeature as r, CreateTokenSchemaBody as s, Project as t, ProjectId as u, UpdateTokenInput as v, UpdateTokenPath as y };
|
|
71
|
-
//# sourceMappingURL=project-
|
|
71
|
+
//# sourceMappingURL=project-DwRvx_zN.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./adminRoles-
|
|
1
|
+
import { Rr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-9p4O-clX.cjs";
|
|
2
|
+
import "./adminRoles-D6AS9Bzx.cjs";
|
|
3
3
|
import { t as Backend } from "./backends-BHotIdL0.cjs";
|
|
4
4
|
type ProjectId = number;
|
|
5
5
|
type CreateTokenSchemaBody = OpenapiBodyType<paths['/v2/storage/tokens']['post']>;
|
|
@@ -68,4 +68,4 @@ declare const createProject: ({ sapiToken }: Options) => {
|
|
|
68
68
|
};
|
|
69
69
|
type Project = ReturnType<typeof createProject>;
|
|
70
70
|
export { UpdateTokenBody as _, CreateTokenBody as a, UpdateTokenSchemaBody as b, GetTokenEventsInput as c, ShareTokenBody as d, ShareTokenInput as f, TokenListItem as g, StorageTokenRaw as h, hasFeature as i, GetTokenEventsPath as l, StorageToken as m, createProject as n, CreateTokenResponse as o, ShareTokenPath as p, hasAdminFeature as r, CreateTokenSchemaBody as s, Project as t, ProjectId as u, UpdateTokenInput as v, UpdateTokenPath as y };
|
|
71
|
-
//# sourceMappingURL=project-
|
|
71
|
+
//# sourceMappingURL=project-ERH0FTGW.d.cts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_queryService = require("../queryService-
|
|
2
|
+
const require_queryService = require("../queryService-CECWubS0.cjs");
|
|
3
3
|
exports.createQueryServiceClient = require_queryService.createQueryServiceClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-
|
|
1
|
+
import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-BgEu7wGk.cjs";
|
|
2
2
|
export { type AppUserTokenAuth, QueryServiceClientInitOptions, type QueryServiceCredential, type QueryServiceCredentialProvider, type TokenSource, createQueryServiceClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-
|
|
1
|
+
import { C as QueryServiceClientInitOptions, D as QueryServiceCredentialProvider, E as QueryServiceCredential, O as TokenSource, T as AppUserTokenAuth, w as createQueryServiceClient } from "../index-Cj0l_DL_.js";
|
|
2
2
|
export { type AppUserTokenAuth, QueryServiceClientInitOptions, type QueryServiceCredential, type QueryServiceCredentialProvider, type TokenSource, createQueryServiceClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createQueryServiceClient } from "../queryService-
|
|
1
|
+
export { t as createQueryServiceClient } from "../queryService-CIxb_mcP.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as GetQueryJobPath, ct as JobStatusResponse, dt as PostQueryPath, et as QueryJobPollOptions, ft as QueryJobStatus, it as GetQueriesPath, lt as PostCancelQueryJobPath, mt as Statements, nt as GetExportResultsQuery, ot as GetQueryResultsPath, pt as QueryResult, rt as GetQueriesHistoryQuery, st as GetQueryResutsQuery, tt as ExportResultsResponse, ut as PostQueryBody } from "../index-BgEu7wGk.cjs";
|
|
2
2
|
export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as GetQueryJobPath, ct as JobStatusResponse, dt as PostQueryPath, et as QueryJobPollOptions, ft as QueryJobStatus, it as GetQueriesPath, lt as PostCancelQueryJobPath, mt as Statements, nt as GetExportResultsQuery, ot as GetQueryResultsPath, pt as QueryResult, rt as GetQueriesHistoryQuery, st as GetQueryResutsQuery, tt as ExportResultsResponse, ut as PostQueryBody } from "../index-Cj0l_DL_.js";
|
|
2
2
|
export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
|
|
@@ -3,7 +3,7 @@ const require_RowLevelSecurityError = require("./RowLevelSecurityError-RK_NhhAx.
|
|
|
3
3
|
const require_ValidationError = require("./ValidationError-BXcFX4nD.cjs");
|
|
4
4
|
const require_createGenericFetchClient = require("./createGenericFetchClient-BuYzzV_D.cjs");
|
|
5
5
|
const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-dkssExkU.cjs");
|
|
6
|
-
const require_transientRetries = require("./transientRetries-
|
|
6
|
+
const require_transientRetries = require("./transientRetries-yVaQgKqP.cjs");
|
|
7
7
|
const require_auth = require("./auth-AehUDNRK.cjs");
|
|
8
8
|
// src/clients/queryService/auth.ts
|
|
9
9
|
const PRINTABLE_ASCII_WITHOUT_SPACES = /^[\x21-\x7E]+$/;
|
|
@@ -211,4 +211,4 @@ Object.defineProperty(exports, "createQueryServiceClient", {
|
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
//# sourceMappingURL=queryService-
|
|
214
|
+
//# sourceMappingURL=queryService-CECWubS0.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryService-C3BQ6GKW.cjs","names":["ValidationError","KeboolaHttpHeader","APP_USER_TOKEN_HEADER","createAuthHeaders","HttpHeader","transientRetries","poller","jobStatus","QueryJobError","HttpStatus","RowLevelSecurityError","defaultValidateStatus","createOpenapiFetchClient","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;;;AA0BA,MAAM,iCAAiC;AAEvC,MAAM,gBAAgB,UAA2B;CAC/C,IAAI,OAAO,UAAU,YAAY,CAAC,+BAA+B,KAAK,KAAK,GACzE,MAAM,IAAIA,wBAAAA,gBAAgB,wDAAwD;CAEpF,OAAO;AACT;AAEA,MAAM,YAAY,OAAO,WACvB,aAAa,OAAO,WAAW,aAAa,MAAM,OAAO,IAAI,MAAM;AAErE,MAAM,eAAe,eACnB,OAAO,WAAW,UAAU,cAC3B,WAAW,SAAS,oBAAoB,OAAO,WAAW,iBAAiB;;;;;;;;AAS9E,MAAM,iBAAiB,eAA+D;CACpF,MAAM,EAAE,UAAU;CAClB,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC;CACv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E,SAAS;GACT,UAPyBC,0BAAAA,8BACzB,SAAS,QAAQ,IAAID,0BAAAA,WAAW,mBAAmB,CAMxB,CAAC,EAAE,YAAY;EAC5C;CACF;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"queryService-CECWubS0.cjs","names":["ValidationError","KeboolaHttpHeader","APP_USER_TOKEN_HEADER","createAuthHeaders","HttpHeader","transientRetries","poller","jobStatus","QueryJobError","HttpStatus","RowLevelSecurityError","defaultValidateStatus","createOpenapiFetchClient","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;;;AA0BA,MAAM,iCAAiC;AAEvC,MAAM,gBAAgB,UAA2B;CAC/C,IAAI,OAAO,UAAU,YAAY,CAAC,+BAA+B,KAAK,KAAK,GACzE,MAAM,IAAIA,wBAAAA,gBAAgB,wDAAwD;CAEpF,OAAO;AACT;AAEA,MAAM,YAAY,OAAO,WACvB,aAAa,OAAO,WAAW,aAAa,MAAM,OAAO,IAAI,MAAM;AAErE,MAAM,eAAe,eACnB,OAAO,WAAW,UAAU,cAC3B,WAAW,SAAS,oBAAoB,OAAO,WAAW,iBAAiB;;;;;;;;AAS9E,MAAM,iBAAiB,eAA+D;CACpF,MAAM,EAAE,UAAU;CAClB,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC;CACvC,IAAI,WAAW,SAAS,kBACtB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AA,8BACzB,SAAS,QAAQ,IAAID,0BAAAA,WAAW,mBAAmB,CAMxB,CAAC,EAAE,YAAY;EAC5C;CACF;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -3,7 +3,7 @@ import { r as QueryJobError, t as RowLevelSecurityError } from "./RowLevelSecuri
|
|
|
3
3
|
import { t as ValidationError } from "./ValidationError-BsdFDGY2.js";
|
|
4
4
|
import { t as createGenericFetchClient } from "./createGenericFetchClient-Ba4E4T-Y.js";
|
|
5
5
|
import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-DSk29o_s.js";
|
|
6
|
-
import { a as poller, n as jobStatus, t as transientRetries } from "./transientRetries-
|
|
6
|
+
import { a as poller, n as jobStatus, t as transientRetries } from "./transientRetries-dssygpwU.js";
|
|
7
7
|
import { t as createAuthHeaders } from "./auth-ZBQWCJPM.js";
|
|
8
8
|
// src/clients/queryService/auth.ts
|
|
9
9
|
const PRINTABLE_ASCII_WITHOUT_SPACES = /^[\x21-\x7E]+$/;
|
|
@@ -206,4 +206,4 @@ const createQueryServiceClient = ({ baseUrl, middlewares = [], auth }) => {
|
|
|
206
206
|
};
|
|
207
207
|
export { createQueryServiceClient as t };
|
|
208
208
|
|
|
209
|
-
//# sourceMappingURL=queryService-
|
|
209
|
+
//# sourceMappingURL=queryService-CIxb_mcP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryService-DQHtHy2-.js","names":[],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n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E,MAAM;IAAE;IAAU;GAAY;GAC9B;EACF,CACF;EAEA,OAAO;CACT;CAEA,MAAM,gBAAgB,OACpB,YACA,aACA,OACA,WACmC;EACnC,MAAM,EAAE,MAAM,aAAa,MAAM,OAAO,IACtC,qDACA;GACE,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,GACA,EAAE,OAAO,CACX;EAOA,OAAO;GACL,UANe,SAAS,QAAQ,IAAI,WAAW,YAAY,KAAK;GAOhE,SAAS;GACT,UAPyB,8BACzB,SAAS,QAAQ,IAAI,WAAW,mBAAmB,CAMxB,CAAC,EAAE,YAAY;EAC5C;CACF;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"queryService-CIxb_mcP.js","names":[],"sources":["../src/clients/queryService/auth.ts","../src/clients/queryService/poller.ts","../src/clients/queryService/validateStatus.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { ValidationError } from '../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { APP_USER_TOKEN_HEADER, KeboolaHttpHeader } from '../../internal';\nimport { createAuthHeaders } from '../auth';\n\n/** A token value, or a callback that returns the current one (read before every request). */\nexport type TokenSource = string | (() => string | Promise<string>);\n\n/** A data app user's token, sent as `X-Kbc-App-User-Token` together with the app's Storage token. */\nexport type AppUserTokenAuth = {\n type: 'app-user-token';\n token: TokenSource;\n storageToken: TokenSource;\n};\n\n/** One credential; a request carries exactly that credential's headers. */\nexport type QueryServiceCredential =\n | { type: 'sapi-token'; token: TokenSource }\n | { type: 'bearer'; token: TokenSource; projectId: number }\n | AppUserTokenAuth;\n\n/** Resolved before every request, retries included. */\nexport type QueryServiceCredentialProvider = () =>\n | QueryServiceCredential\n | Promise<QueryServiceCredential>;\n\nconst PRINTABLE_ASCII_WITHOUT_SPACES = /^[\\x21-\\x7E]+$/;\n\nconst requireToken = (token: unknown): string => {\n if (typeof token !== 'string' || !PRINTABLE_ASCII_WITHOUT_SPACES.test(token)) {\n throw new ValidationError('token must be non-empty printable ASCII without spaces');\n }\n return token;\n};\n\nconst readToken = async (source: TokenSource) =>\n requireToken(typeof source === 'function' ? await source() : source);\n\nconst hasCallback = (credential: QueryServiceCredential) =>\n typeof credential.token === 'function' ||\n (credential.type === 'app-user-token' && typeof credential.storageToken === 'function');\n\n/**\n * Fixed headers for a credential with only string tokens.\n *\n * - `app-user-token` tokens are checked here, so an empty user token throws at client creation.\n * - `sapi-token` / `bearer` strings go out unchecked: service clients send an empty `bearer` token\n * that their own middleware replaces.\n */\nconst staticHeaders = (credential: QueryServiceCredential): Record<string, string> => {\n const { token } = credential;\n if (typeof token !== 'string') return {};\n if (credential.type === 'app-user-token') {\n return typeof credential.storageToken === 'string'\n ? {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: requireToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: requireToken(token),\n }\n : {};\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst resolvedHeaders = async (\n credential: QueryServiceCredential,\n): Promise<Record<string, string>> => {\n const token = await readToken(credential.token);\n if (credential.type === 'app-user-token') {\n return {\n [KeboolaHttpHeader.STORAGE_API_TOKEN]: await readToken(credential.storageToken),\n [APP_USER_TOKEN_HEADER]: token,\n };\n }\n if (\n credential.type === 'bearer' &&\n (!Number.isInteger(credential.projectId) || credential.projectId <= 0)\n ) {\n throw new ValidationError('projectId must be a positive integer');\n }\n return createAuthHeaders({ ...credential, token });\n};\n\nconst CREDENTIAL_HEADER_NAMES = [\n KeboolaHttpHeader.STORAGE_API_TOKEN,\n KeboolaHttpHeader.MANAGEMENT_API_TOKEN,\n KeboolaHttpHeader.PROJECT_ID,\n HttpHeader.AUTHORIZATION,\n APP_USER_TOKEN_HEADER,\n];\n\nconst createCredentialMiddleware =\n (provider: QueryServiceCredentialProvider): MiddlewareFn =>\n (next) =>\n async (request) => {\n const credentialHeaders = await resolvedHeaders(await provider());\n const { headers } = request.request;\n for (const name of CREDENTIAL_HEADER_NAMES) headers.delete(name);\n for (const [name, value] of Object.entries(credentialHeaders)) headers.set(name, value);\n return next(request);\n };\n\n/**\n * The Query Service client's credential setup for its `auth`.\n *\n * 1. A credential with only string tokens: default headers, set once (as `createAuthHeaders`).\n * 2. A credential with a token callback, or a provider: no default headers; the innermost\n * middleware resolves and checks every token on every attempt.\n */\nexport const resolveAuth = (\n auth: QueryServiceCredential | QueryServiceCredentialProvider,\n middlewares: MiddlewareFn[],\n) => {\n if (typeof auth === 'function') {\n return { headers: undefined, middlewares: [...middlewares, createCredentialMiddleware(auth)] };\n }\n if (hasCallback(auth)) {\n return {\n headers: undefined,\n middlewares: [...middlewares, createCredentialMiddleware(() => auth)],\n };\n }\n return { headers: staticHeaders(auth), middlewares };\n};\n","import { jobStatus } from '../../domain/jobStatus';\nimport { QueryJobError } from '../../errors';\nimport { poller } from '../../utils/async';\nimport { transientRetries } from '../transientRetries';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\nexport type QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - `init` is the job, or the request that yields it, so a caller hands over what `createQueryJob` gave it.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\ntype JobRef = { id: GetQueryJobPath['queryJobId'] };\n\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n ({\n init,\n interval,\n maxAttempts,\n timeout,\n signal,\n }: QueryJobPollOptions & { init: JobRef | ((signal: AbortSignal) => Promise<JobRef>) }) => {\n const retries = transientRetries();\n\n return poller({\n pollKey: ({ id }) => ['queryService.job', { id }] as const,\n init,\n pollFn: async ({ init: { id }, signal: pollSignal }) => {\n const job = await getQueryJob(id, pollSignal);\n retries.reset();\n return job;\n },\n isRetryable: retries.isRetryable,\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n failed: (job) => {\n if (job.status !== 'failed') return undefined;\n const failedStatements = job.statements\n .filter((statement) => statement.status === 'failed')\n .map((statement) => ({ id: statement.id, error: statement.error }));\n\n return new QueryJobError(failedStatements[0]?.error ?? 'Job failed', job.queryJobId, {\n failedStatements,\n });\n },\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n };\n","import { RowLevelSecurityError } from '../../errors';\nimport { defaultValidateStatus, type ValidateStatusFn } from '../../fetchClient';\nimport { HttpStatus, ROW_LEVEL_SECURITY_DENIED_MESSAGE } from '../../internal';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\n/**\n * Status validation for Query Service, which reads a row-level security refusal as `RowLevelSecurityError`.\n *\n * - The fixed `exception` text is the only signal: `X-KBC-RLS-Mode` is not exposed through CORS,\n * and a credentials 403 on a governed workspace carries that header too.\n */\nexport const validateQueryServiceStatus: ValidateStatusFn = (apiResponse) => {\n const { response, data } = apiResponse;\n\n if (\n response.status === HttpStatus.FORBIDDEN &&\n isRecord(data) &&\n data.exception === ROW_LEVEL_SECURITY_DENIED_MESSAGE\n ) {\n return new RowLevelSecurityError(apiResponse);\n }\n\n return defaultValidateStatus(apiResponse);\n};\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n type MiddlewareFn,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport {\n type QueryServiceCredential,\n type QueryServiceCredentialProvider,\n resolveAuth,\n} from './auth';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\nimport { validateQueryServiceStatus } from './validateStatus';\n\nexport type QueryServiceClientInitOptions = Omit<ClientInitOptions, 'auth' | 'middlewares'> & {\n auth: QueryServiceCredential | QueryServiceCredentialProvider;\n middlewares?: MiddlewareFn[];\n};\n\nexport const createQueryServiceClient = ({\n baseUrl,\n middlewares = [],\n auth,\n}: QueryServiceClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n ...resolveAuth(auth, middlewares),\n validateStatus: validateQueryServiceStatus,\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;;;AA0BA,MAAM,iCAAiC;AAEvC,MAAM,gBAAgB,UAA2B;CAC/C,IAAI,OAAO,UAAU,YAAY,CAAC,+BAA+B,KAAK,KAAK,GACzE,MAAM,IAAI,gBAAgB,wDAAwD;CAEpF,OAAO;AACT;AAEA,MAAM,YAAY,OAAO,WACvB,aAAa,OAAO,WAAW,aAAa,MAAM,OAAO,IAAI,MAAM;AAErE,MAAM,eAAe,eACnB,OAAO,WAAW,UAAU,cAC3B,WAAW,SAAS,oBAAoB,OAAO,WAAW,iBAAiB;;;;;;;;AAS9E,MAAM,iBAAiB,eAA+D;CACpF,MA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E,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/queue/index.cjs
CHANGED
package/dist/queue/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-
|
|
3
|
-
import { n as ClientInitOptions } from "../types-
|
|
4
|
-
import { c as Poller } from "../index-
|
|
1
|
+
import { $r as SearchJobsQuery, Gr as KillJobPath, Ur as CreateJobBody, Wr as GetQueueJobPath, Xr as SearchAllJobsQuery, Zr as SearchGroupedJobsQuery, qr as OrchestrationRerunPlanPath, ti as components } from "../index-9p4O-clX.cjs";
|
|
2
|
+
import "../index-BgEu7wGk.cjs";
|
|
3
|
+
import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
|
|
4
|
+
import { c as Poller } from "../index-DENUPo51.cjs";
|
|
5
5
|
declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
6
6
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
7
7
|
poller: ({ init, interval, maxAttempts, timeout, signal }: {
|
|
@@ -78,6 +78,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
78
78
|
type?: components['schemas']['JobType'];
|
|
79
79
|
orchestrationTaskId?: string | null;
|
|
80
80
|
previousJobId?: string | null;
|
|
81
|
+
runtimeTimezone?: string | null;
|
|
81
82
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
82
83
|
onlyFlowTaskIds?: string[] | null;
|
|
83
84
|
}, {
|
|
@@ -141,6 +142,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
141
142
|
type?: components['schemas']['JobType'];
|
|
142
143
|
orchestrationTaskId?: string | null;
|
|
143
144
|
previousJobId?: string | null;
|
|
145
|
+
runtimeTimezone?: string | null;
|
|
144
146
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
145
147
|
onlyFlowTaskIds?: string[] | null;
|
|
146
148
|
}>;
|
|
@@ -205,6 +207,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
205
207
|
type?: components['schemas']['JobType'];
|
|
206
208
|
orchestrationTaskId?: string | null;
|
|
207
209
|
previousJobId?: string | null;
|
|
210
|
+
runtimeTimezone?: string | null;
|
|
208
211
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
209
212
|
onlyFlowTaskIds?: string[] | null;
|
|
210
213
|
}>;
|
|
@@ -269,6 +272,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
269
272
|
type?: components['schemas']['JobType'];
|
|
270
273
|
orchestrationTaskId?: string | null;
|
|
271
274
|
previousJobId?: string | null;
|
|
275
|
+
runtimeTimezone?: string | null;
|
|
272
276
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
273
277
|
onlyFlowTaskIds?: string[] | null;
|
|
274
278
|
}[]>;
|
|
@@ -333,6 +337,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
333
337
|
type?: components['schemas']['JobType'];
|
|
334
338
|
orchestrationTaskId?: string | null;
|
|
335
339
|
previousJobId?: string | null;
|
|
340
|
+
runtimeTimezone?: string | null;
|
|
336
341
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
337
342
|
onlyFlowTaskIds?: string[] | null;
|
|
338
343
|
}[]>;
|
|
@@ -397,6 +402,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
397
402
|
type?: components['schemas']['JobType'];
|
|
398
403
|
orchestrationTaskId?: string | null;
|
|
399
404
|
previousJobId?: string | null;
|
|
405
|
+
runtimeTimezone?: string | null;
|
|
400
406
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
401
407
|
onlyFlowTaskIds?: string[] | null;
|
|
402
408
|
}>;
|
|
@@ -461,6 +467,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
461
467
|
type?: components['schemas']['JobType'];
|
|
462
468
|
orchestrationTaskId?: string | null;
|
|
463
469
|
previousJobId?: string | null;
|
|
470
|
+
runtimeTimezone?: string | null;
|
|
464
471
|
onlyOrchestrationTaskIds?: string[] | null;
|
|
465
472
|
onlyFlowTaskIds?: string[] | null;
|
|
466
473
|
}>;
|