@keboola/api-client 48.0.0 → 50.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 +109 -95
- package/API-SURFACE.md +14 -32
- package/CHANGELOG.md +78 -0
- package/README.md +33 -29
- package/dist/{ManagementSessionMintError-Cu9beG7j.cjs → ManagementSessionMintError-ByOulHQH.cjs} +4 -6
- package/dist/{ManagementSessionMintError-Cu9beG7j.cjs.map → ManagementSessionMintError-ByOulHQH.cjs.map} +1 -1
- package/dist/{ManagementSessionMintError-4Pkn5Oob.js → ManagementSessionMintError-DNMbYauw.js} +4 -6
- package/dist/{ManagementSessionMintError-4Pkn5Oob.js.map → ManagementSessionMintError-DNMbYauw.js.map} +1 -1
- package/dist/{QueryJobError-ZZZ043Nm.js → QueryJobError-Iq9O90Uh.js} +2 -3
- package/dist/{QueryJobError-ZZZ043Nm.js.map → QueryJobError-Iq9O90Uh.js.map} +1 -1
- package/dist/{QueryJobError-irGiP5zh.cjs → QueryJobError-Oy0fl4aw.cjs} +2 -3
- package/dist/{QueryJobError-irGiP5zh.cjs.map → QueryJobError-Oy0fl4aw.cjs.map} +1 -1
- package/dist/{QueueJobError-8bThS_Mc.js → QueueJobError-BJNUINXW.js} +2 -3
- package/dist/{QueueJobError-8bThS_Mc.js.map → QueueJobError-BJNUINXW.js.map} +1 -1
- package/dist/{QueueJobError-6qSEizWo.cjs → QueueJobError-DruZK3tc.cjs} +2 -3
- package/dist/{QueueJobError-6qSEizWo.cjs.map → QueueJobError-DruZK3tc.cjs.map} +1 -1
- package/dist/{SyncActionError-CoZFsdUk.js → SyncActionError-DuGcDbkd.js} +2 -3
- package/dist/{SyncActionError-CoZFsdUk.js.map → SyncActionError-DuGcDbkd.js.map} +1 -1
- package/dist/{SyncActionError-BG0zwchi.cjs → SyncActionError-mbpVg63X.cjs} +2 -3
- package/dist/{SyncActionError-BG0zwchi.cjs.map → SyncActionError-mbpVg63X.cjs.map} +1 -1
- package/dist/{UserError-By_Zckmc.js → UserError-BxoOJJ_u.js} +2 -3
- package/dist/{UserError-By_Zckmc.js.map → UserError-BxoOJJ_u.js.map} +1 -1
- package/dist/{UserError-CSGO1qII.cjs → UserError-D4P9Tbhf.cjs} +2 -3
- package/dist/{UserError-CSGO1qII.cjs.map → UserError-D4P9Tbhf.cjs.map} +1 -1
- package/dist/{ValidationError-D65QU0uq.cjs → ValidationError-BXcFX4nD.cjs} +2 -3
- package/dist/{ValidationError-D65QU0uq.cjs.map → ValidationError-BXcFX4nD.cjs.map} +1 -1
- package/dist/{ValidationError-DjhtNMfZ.js → ValidationError-BsdFDGY2.js} +2 -3
- package/dist/{ValidationError-DjhtNMfZ.js.map → ValidationError-BsdFDGY2.js.map} +1 -1
- package/dist/{configurations-CL0ouUMa.js → admin-CbMOsfgs.js} +5 -53
- package/dist/admin-CbMOsfgs.js.map +1 -0
- package/dist/{configurations-D9J3jh3g.cjs → admin-Di-MmGFP.cjs} +4 -124
- package/dist/admin-Di-MmGFP.cjs.map +1 -0
- package/dist/{adminRoles-DsoGQipO.d.ts → adminRoles-DAwl657q.d.ts} +2 -4
- package/dist/{adminRoles-CO7J5qAy.cjs → adminRoles-DnFpO_2W.cjs} +2 -3
- package/dist/{adminRoles-CO7J5qAy.cjs.map → adminRoles-DnFpO_2W.cjs.map} +1 -1
- package/dist/{adminRoles-BgpaBE7h.d.cts → adminRoles-FFyl7Dyx.d.cts} +2 -4
- package/dist/{adminRoles-B40yBcmq.js → adminRoles-asa-MhDD.js} +2 -3
- package/dist/{adminRoles-B40yBcmq.js.map → adminRoles-asa-MhDD.js.map} +1 -1
- package/dist/ai/index.cjs +3 -4
- package/dist/ai/index.d.cts +2 -4
- package/dist/ai/index.d.ts +2 -4
- package/dist/ai/index.js +3 -4
- package/dist/ai/types.d.cts +1 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/{appLogs-DpcqeOe5.d.ts → appLogs-CTvZAihm.d.ts} +2 -4
- package/dist/{appLogs-SjrflOHk.d.cts → appLogs-CnLNMH7M.d.cts} +2 -4
- package/dist/{appLogs-Cix2KWra.cjs → appLogs-CoAWQGxs.cjs} +5 -6
- package/dist/{appLogs-Cix2KWra.cjs.map → appLogs-CoAWQGxs.cjs.map} +1 -1
- package/dist/{appLogs-KslK7qHr.js → appLogs-DFcPwVk8.js} +4 -5
- package/dist/{appLogs-KslK7qHr.js.map → appLogs-DFcPwVk8.js.map} +1 -1
- package/dist/apps/index.cjs +29 -6
- package/dist/apps/index.cjs.map +1 -1
- package/dist/apps/index.d.cts +16 -5
- package/dist/apps/index.d.ts +16 -5
- package/dist/apps/index.js +29 -6
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/types.d.cts +3 -3
- package/dist/apps/types.d.ts +3 -3
- package/dist/assets/index.cjs +2 -3
- package/dist/assets/index.d.cts +1 -3
- package/dist/assets/index.d.ts +1 -3
- package/dist/assets/index.js +2 -3
- package/dist/assets/schema.cjs +2 -3
- package/dist/assets/schema.d.cts +0 -2
- package/dist/assets/schema.d.ts +0 -2
- package/dist/assets/schema.js +1 -2
- 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 -2
- package/dist/auth/types.d.cts +1 -1
- package/dist/auth/types.d.ts +1 -1
- package/dist/{auth-C8Pjl0Mu.cjs → auth-CvB4MukT.cjs} +3 -4
- package/dist/{auth-C8Pjl0Mu.cjs.map → auth-CvB4MukT.cjs.map} +1 -1
- package/dist/{auth-4coY1uwo.js → auth-DYfQMQCs.js} +3 -4
- package/dist/{auth-4coY1uwo.js.map → auth-DYfQMQCs.js.map} +1 -1
- package/dist/{authClient-DfkKlc-2.cjs → authClient-DcKBpMcU.cjs} +66 -85
- package/dist/{authClient-DfkKlc-2.cjs.map → authClient-DcKBpMcU.cjs.map} +1 -1
- package/dist/{authClient-BYIGzL_u.d.ts → authClient-Df3U4q_6.d.cts} +4 -16
- package/dist/{authClient-D06srBQE.d.cts → authClient-JtMVJWXY.d.ts} +4 -16
- package/dist/{authClient-2e8ZmzSP.js → authClient-oB5ydxWp.js} +66 -85
- package/dist/{authClient-2e8ZmzSP.js.map → authClient-oB5ydxWp.js.map} +1 -1
- package/dist/{backends-DKBz5OxE.d.ts → backends-BHotIdL0.d.cts} +1 -3
- package/dist/{backends-DKBz5OxE.d.cts → backends-BHotIdL0.d.ts} +1 -3
- package/dist/billing/index.cjs +3 -5
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.d.cts +27 -29
- package/dist/billing/index.d.ts +27 -29
- package/dist/billing/index.js +3 -5
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/types.d.cts +26 -26
- package/dist/billing/types.d.ts +26 -26
- package/dist/chat/index.cjs +4 -5
- package/dist/chat/index.d.cts +3 -5
- package/dist/chat/index.d.ts +3 -5
- package/dist/chat/index.js +4 -5
- package/dist/chat/suggestions.cjs +1 -2
- package/dist/chat/suggestions.d.cts +1 -1
- package/dist/chat/suggestions.d.ts +1 -1
- package/dist/chat/suggestions.js +1 -2
- package/dist/chat/types.cjs +1 -2
- package/dist/chat/types.d.cts +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/chat/types.js +1 -2
- package/dist/{collectByOffset-DQsqtmJg.cjs → collectByOffset-DgxJ3zT9.cjs} +3 -4
- package/dist/{collectByOffset-DQsqtmJg.cjs.map → collectByOffset-DgxJ3zT9.cjs.map} +1 -1
- package/dist/{collectByOffset-2XzJqmvr.js → collectByOffset-i8Tdoze7.js} +3 -4
- package/dist/{collectByOffset-2XzJqmvr.js.map → collectByOffset-i8Tdoze7.js.map} +1 -1
- package/dist/{componentId-D4jp6a13.cjs → componentId-C8ZTXXDo.cjs} +2 -3
- package/dist/{componentId-D4jp6a13.cjs.map → componentId-C8ZTXXDo.cjs.map} +1 -1
- package/dist/{componentId-DmHwHG5V.js → componentId-b_qBbJEM.js} +2 -3
- package/dist/{componentId-DmHwHG5V.js.map → componentId-b_qBbJEM.js.map} +1 -1
- package/dist/componentsMcp/index.cjs +1 -1
- package/dist/componentsMcp/index.d.cts +1 -1
- package/dist/componentsMcp/index.d.ts +1 -1
- package/dist/componentsMcp/index.js +1 -2
- package/dist/componentsMcp/types.d.cts +1 -1
- package/dist/componentsMcp/types.d.ts +1 -1
- package/dist/{componentsMcp-pG-PcQrg.cjs → componentsMcp-BaHy5iLr.cjs} +5 -7
- package/dist/{componentsMcp-pG-PcQrg.cjs.map → componentsMcp-BaHy5iLr.cjs.map} +1 -1
- package/dist/{componentsMcp-CHobIsuU.js → componentsMcp-BrB4js6b.js} +5 -7
- package/dist/{componentsMcp-CHobIsuU.js.map → componentsMcp-BrB4js6b.js.map} +1 -1
- package/dist/{concurrent-BacWxPwi.js → concurrent-BtsT10Xe.js} +2 -3
- package/dist/{concurrent-BacWxPwi.js.map → concurrent-BtsT10Xe.js.map} +1 -1
- package/dist/{concurrent-CdVfR1N5.cjs → concurrent-DnTV_ppY.cjs} +2 -3
- package/dist/{concurrent-CdVfR1N5.cjs.map → concurrent-DnTV_ppY.cjs.map} +1 -1
- package/dist/configurations-Cd6Nsox-.js +49 -0
- package/dist/configurations-Cd6Nsox-.js.map +1 -0
- package/dist/configurations-WI8H4zLk.cjs +120 -0
- package/dist/configurations-WI8H4zLk.cjs.map +1 -0
- package/dist/constants/index.cjs +6 -3
- package/dist/constants/index.d.cts +5 -4
- package/dist/constants/index.d.ts +5 -4
- package/dist/constants/index.js +4 -4
- package/dist/{constants-CA4UN2Xv.js → constants-BMSHGwOR.js} +86 -17
- package/dist/constants-BMSHGwOR.js.map +1 -0
- package/dist/{constants-a0jswUeK.cjs → constants-DhFQWQgy.cjs} +103 -16
- package/dist/constants-DhFQWQgy.cjs.map +1 -0
- package/dist/{createAbortError-RendOpo7.cjs → createAbortError-Dzc9yObN.cjs} +2 -3
- package/dist/{createAbortError-RendOpo7.cjs.map → createAbortError-Dzc9yObN.cjs.map} +1 -1
- package/dist/{createAbortError-BxupOt-6.js → createAbortError-c6ekCpRy.js} +2 -3
- package/dist/{createAbortError-BxupOt-6.js.map → createAbortError-c6ekCpRy.js.map} +1 -1
- package/dist/{createFetchClient-lZ_93Yrb.cjs → createFetchClient-DEkUH662.cjs} +6 -10
- package/dist/{createFetchClient-lZ_93Yrb.cjs.map → createFetchClient-DEkUH662.cjs.map} +1 -1
- package/dist/{createFetchClient-CkHdS_IG.js → createFetchClient-DlGCbltR.js} +5 -9
- package/dist/{createFetchClient-CkHdS_IG.js.map → createFetchClient-DlGCbltR.js.map} +1 -1
- package/dist/{createGenericFetchClient-MOx97wi-.cjs → createGenericFetchClient-2oU-PXVo.cjs} +3 -4
- package/dist/{createGenericFetchClient-MOx97wi-.cjs.map → createGenericFetchClient-2oU-PXVo.cjs.map} +1 -1
- package/dist/createGenericFetchClient-wGxemBwR.js +6 -0
- package/dist/{createGenericFetchClient-CQdNcPC3.js.map → createGenericFetchClient-wGxemBwR.js.map} +1 -1
- package/dist/createOpenapiFetchClient-Bhz62MUE.js +6 -0
- package/dist/{createOpenapiFetchClient-DXiMv9WL.js.map → createOpenapiFetchClient-Bhz62MUE.js.map} +1 -1
- package/dist/{createOpenapiFetchClient-DHYo_k3t.cjs → createOpenapiFetchClient-DL9w7vU-.cjs} +3 -4
- package/dist/{createOpenapiFetchClient-DHYo_k3t.cjs.map → createOpenapiFetchClient-DL9w7vU-.cjs.map} +1 -1
- package/dist/dataScience/index.cjs +2 -2
- package/dist/dataScience/index.d.cts +2 -2
- package/dist/dataScience/index.d.ts +2 -2
- package/dist/dataScience/index.js +2 -2
- package/dist/dataScience/types.d.cts +2 -2
- package/dist/dataScience/types.d.ts +2 -2
- package/dist/{dataScience-AwPMeGfz.js → dataScience-CXmkEOAi.js} +7 -9
- package/dist/{dataScience-AwPMeGfz.js.map → dataScience-CXmkEOAi.js.map} +1 -1
- package/dist/{dataScience-BjS1p8WO.cjs → dataScience-CufjHPSd.cjs} +7 -9
- package/dist/{dataScience-BjS1p8WO.cjs.map → dataScience-CufjHPSd.cjs.map} +1 -1
- package/dist/{dedupe-OSnnst2u.cjs → dedupe-Bf0gl9TJ.cjs} +2 -3
- package/dist/{dedupe-OSnnst2u.cjs.map → dedupe-Bf0gl9TJ.cjs.map} +1 -1
- package/dist/{dedupe-Cky1gSUu.js → dedupe-Bu0d2i_w.js} +2 -3
- package/dist/{dedupe-Cky1gSUu.js.map → dedupe-Bu0d2i_w.js.map} +1 -1
- package/dist/developerPortal/index.cjs +1 -1
- package/dist/developerPortal/index.d.cts +2 -2
- package/dist/developerPortal/index.d.ts +2 -2
- package/dist/developerPortal/index.js +1 -2
- package/dist/developerPortal/types.d.cts +1 -1
- package/dist/developerPortal/types.d.ts +1 -1
- package/dist/{developerPortalClient-DUerKw-7.cjs → developerPortalClient-BfRxYrWj.cjs} +9 -15
- package/dist/{developerPortalClient-DUerKw-7.cjs.map → developerPortalClient-BfRxYrWj.cjs.map} +1 -1
- package/dist/{developerPortalClient-Bb2suezr.js → developerPortalClient-D9XOYwWF.js} +9 -15
- package/dist/{developerPortalClient-Bb2suezr.js.map → developerPortalClient-D9XOYwWF.js.map} +1 -1
- package/dist/domain/permissions/index.cjs +24 -58
- package/dist/domain/permissions/index.d.cts +4 -10
- package/dist/domain/permissions/index.d.ts +4 -10
- package/dist/domain/permissions/index.js +4 -39
- package/dist/domain/storageTable/index.cjs +403 -9
- package/dist/domain/storageTable/index.cjs.map +1 -0
- package/dist/domain/storageTable/index.d.cts +189 -2
- package/dist/domain/storageTable/index.d.ts +189 -2
- package/dist/domain/storageTable/index.js +395 -1
- package/dist/domain/storageTable/index.js.map +1 -0
- package/dist/editor/index.cjs +3 -4
- package/dist/editor/index.d.cts +2 -4
- package/dist/editor/index.d.ts +2 -4
- package/dist/editor/index.js +3 -4
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/{emitter-dLF1Fyfg.d.ts → emitter-raKkIqRp.d.cts} +1 -3
- package/dist/{emitter-dLF1Fyfg.d.cts → emitter-raKkIqRp.d.ts} +1 -3
- package/dist/encryption/index.cjs +2 -3
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/index.js +2 -3
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/generateUUID-DE9sNyJF.js +5 -0
- package/dist/{generateUUID-Dr8l-aoc.js.map → generateUUID-DE9sNyJF.js.map} +1 -1
- package/dist/{generateUUID-C6qKBPIv.cjs → generateUUID-DbSTmvVP.cjs} +2 -3
- package/dist/{generateUUID-C6qKBPIv.cjs.map → generateUUID-DbSTmvVP.cjs.map} +1 -1
- package/dist/import/index.cjs +1 -1
- package/dist/import/index.d.cts +3 -5
- package/dist/import/index.d.ts +3 -5
- package/dist/import/index.js +1 -2
- package/dist/{import-BahNYv91.cjs → import-CABlFMQX.cjs} +6 -9
- package/dist/{import-BahNYv91.cjs.map → import-CABlFMQX.cjs.map} +1 -1
- package/dist/{import-FWy_wQZ1.js → import-CT1Ce5Rp.js} +6 -9
- package/dist/{import-FWy_wQZ1.js.map → import-CT1Ce5Rp.js.map} +1 -1
- package/dist/index-24GpnYhn.d.cts +150 -0
- package/dist/{index-VlzlOBkc.d.cts → index-AA3MRfRn.d.cts} +71 -13
- package/dist/{index-BLvmyehw.d.ts → index-BDPxm9qu.d.ts} +3 -7
- package/dist/index-BUZ-vTRt.d.ts +150 -0
- package/dist/{index-DzLXtE4Q.d.ts → index-BZDxWvZW.d.ts} +5 -7
- package/dist/index-C9iNazAc.d.ts +15103 -0
- package/dist/{index-avzO5sLa.d.ts → index-CCcdySOC.d.cts} +5 -7
- package/dist/{index-D91RxB_S.d.cts → index-CN0--VsY.d.ts} +5 -7
- package/dist/index-CTMnmISl.d.cts +15103 -0
- package/dist/{index-m7fX76x3.d.ts → index-CbSh3KFw.d.cts} +4 -12
- package/dist/{index-Cc5wSIRJ.d.cts → index-ClIV2Lch.d.cts} +5 -7
- package/dist/{index-BIldED4N.d.ts → index-CuI8OI9E.d.ts} +4 -13
- package/dist/{index-ChDl6ig5.d.cts → index-D1mduJne.d.cts} +11 -48
- package/dist/{index-sDHBkJhU.d.ts → index-D1mduJne.d.ts} +12 -49
- package/dist/{index-DlZiWfQb.d.ts → index-DIPMzH--.d.ts} +17 -10
- package/dist/{index-Co2Cd-nw.d.cts → index-DQagqTVa.d.cts} +3 -7
- package/dist/{index-CIqWOEWD.d.ts → index-DVBQgFg0.d.ts} +4 -6
- package/dist/index-DXoN8VwV.d.cts +10 -0
- package/dist/{index-BHiJu8LF.d.cts → index-Db266tLz.d.cts} +17 -10
- package/dist/{index-ByLCYBaw.d.cts → index-DgGpQsAT.d.cts} +4 -6
- package/dist/{index-CzHrIfZS.d.ts → index-DjSthn8d.d.ts} +71 -13
- package/dist/index-Xpu7qIZk.d.ts +10 -0
- package/dist/{index-BTrxCk90.d.ts → index-lTrNMlj6.d.ts} +3 -5
- package/dist/{index-CpGmmJbt.d.cts → index-m9-mN8Gg.d.ts} +4 -12
- package/dist/{index-CpUYVB-d.d.cts → index-xX8-Stoq.d.cts} +4 -13
- package/dist/{index-BCjU-g9t.d.cts → index-z-2okomN.d.cts} +3 -5
- package/dist/index.cjs +434 -1053
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +427 -1050
- package/dist/index.js.map +1 -1
- package/dist/{isLoginPageRedirect-r0Opgc1n.cjs → isLoginPageRedirect-CoUxJi2x.cjs} +3 -4
- package/dist/{isLoginPageRedirect-r0Opgc1n.cjs.map → isLoginPageRedirect-CoUxJi2x.cjs.map} +1 -1
- package/dist/{isLoginPageRedirect-B4QKSiSa.js → isLoginPageRedirect-D-lqF_kZ.js} +3 -4
- package/dist/{isLoginPageRedirect-B4QKSiSa.js.map → isLoginPageRedirect-D-lqF_kZ.js.map} +1 -1
- package/dist/{isPlainObject-LYW-03uB.js → isPlainObject-BxsT8_t2.js} +2 -3
- package/dist/{isPlainObject-LYW-03uB.js.map → isPlainObject-BxsT8_t2.js.map} +1 -1
- package/dist/{isPlainObject-BB3iy87C.cjs → isPlainObject-CcvQt0qB.cjs} +2 -3
- package/dist/{isPlainObject-BB3iy87C.cjs.map → isPlainObject-CcvQt0qB.cjs.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 -2
- package/dist/kaiAgent/types.d.cts +1 -1
- package/dist/kaiAgent/types.d.ts +1 -1
- package/dist/{kaiAgent-CYvrS8oZ.js → kaiAgent-D2TiMDjW.js} +6 -7
- package/dist/{kaiAgent-CYvrS8oZ.js.map → kaiAgent-D2TiMDjW.js.map} +1 -1
- package/dist/{kaiAgent-N2qbUFZm.cjs → kaiAgent-gaA7dqki.cjs} +6 -7
- package/dist/{kaiAgent-N2qbUFZm.cjs.map → kaiAgent-gaA7dqki.cjs.map} +1 -1
- package/dist/{kaiMemory-Qch09f-m.cjs → kaiMemory-CkLQfJXD.cjs} +6 -9
- package/dist/{kaiMemory-Qch09f-m.cjs.map → kaiMemory-CkLQfJXD.cjs.map} +1 -1
- package/dist/{kaiMemory-C9di17bd.js → kaiMemory-oir_qCo_.js} +6 -9
- package/dist/{kaiMemory-C9di17bd.js.map → kaiMemory-oir_qCo_.js.map} +1 -1
- 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 -2
- package/dist/management/types.cjs +13 -0
- package/dist/management/types.cjs.map +1 -0
- package/dist/management/types.d.cts +2 -2
- package/dist/management/types.d.ts +2 -2
- package/dist/management/types.js +11 -1
- package/dist/management/types.js.map +1 -0
- package/dist/{management-CXHnxVaZ.cjs → management-BEGOEQxM.cjs} +34 -59
- package/dist/management-BEGOEQxM.cjs.map +1 -0
- package/dist/{management-NYAD6ej4.js → management-BcGHyxAP.js} +34 -59
- package/dist/management-BcGHyxAP.js.map +1 -0
- package/dist/metastore/index.cjs +1 -1
- package/dist/metastore/index.d.cts +1 -1
- package/dist/metastore/index.d.ts +1 -1
- package/dist/metastore/index.js +1 -2
- package/dist/metastore/types.d.cts +1 -1
- package/dist/metastore/types.d.ts +1 -1
- package/dist/{metastore-Ywq08DBz.js → metastore-CGsgxjng.js} +7 -10
- package/dist/{metastore-Ywq08DBz.js.map → metastore-CGsgxjng.js.map} +1 -1
- package/dist/{metastore-BXHg33ku.cjs → metastore-DeRQ2VIv.cjs} +7 -10
- package/dist/{metastore-BXHg33ku.cjs.map → metastore-DeRQ2VIv.cjs.map} +1 -1
- package/dist/microsoftGraph/index.cjs +5 -8
- package/dist/microsoftGraph/index.cjs.map +1 -1
- package/dist/microsoftGraph/index.d.cts +3 -7
- package/dist/microsoftGraph/index.d.ts +3 -7
- package/dist/microsoftGraph/index.js +5 -8
- package/dist/microsoftGraph/index.js.map +1 -1
- package/dist/microsoftGraph/types.d.cts +2 -4
- package/dist/microsoftGraph/types.d.ts +2 -4
- package/dist/{middleware-GOfx8Apu.js → middleware-8zaJWcyU.js} +3 -5
- package/dist/middleware-8zaJWcyU.js.map +1 -0
- package/dist/{middleware-CEP6uu_D.cjs → middleware-B9RNuLfD.cjs} +3 -5
- package/dist/middleware-B9RNuLfD.cjs.map +1 -0
- package/dist/notifications/index.cjs +5 -6
- package/dist/notifications/index.d.cts +2 -4
- package/dist/notifications/index.d.ts +2 -4
- package/dist/notifications/index.js +5 -6
- package/dist/notifications/types.d.cts +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/oauth/index.cjs +1 -1
- package/dist/oauth/index.d.cts +2 -4
- package/dist/oauth/index.d.ts +2 -4
- package/dist/oauth/index.js +1 -2
- package/dist/oauth/types.d.cts +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/{oauth-DKZPuUlt.cjs → oauth-B5Biqz21.cjs} +7 -9
- package/dist/{oauth-DKZPuUlt.cjs.map → oauth-B5Biqz21.cjs.map} +1 -1
- package/dist/{oauth-GXmZ9agP.js → oauth-ByCdISsV.js} +7 -9
- package/dist/{oauth-GXmZ9agP.js.map → oauth-ByCdISsV.js.map} +1 -1
- package/dist/omnisearch/index.cjs +3 -4
- package/dist/omnisearch/index.d.cts +2 -4
- package/dist/omnisearch/index.d.ts +2 -4
- package/dist/omnisearch/index.js +3 -4
- package/dist/omnisearch/types.d.cts +1 -1
- package/dist/omnisearch/types.d.ts +1 -1
- package/dist/project-DmuC0bMK.js +83 -0
- package/dist/project-DmuC0bMK.js.map +1 -0
- package/dist/project-Onf-IcPW.cjs +136 -0
- package/dist/project-Onf-IcPW.cjs.map +1 -0
- package/dist/{project-nbv9yjpl.d.ts → project-UHZGFmmG.d.cts} +6 -9
- package/dist/{project-Dzu85cqr.d.cts → project-iBm4cIIR.d.ts} +6 -9
- 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 -2
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/{queryService-CzK53q94.cjs → queryService-Cg-eMysa.cjs} +9 -11
- package/dist/{queryService-CzK53q94.cjs.map → queryService-Cg-eMysa.cjs.map} +1 -1
- package/dist/{queryService-C-pZha5p.js → queryService-x8kq8Z2-.js} +9 -11
- package/dist/{queryService-C-pZha5p.js.map → queryService-x8kq8Z2-.js.map} +1 -1
- package/dist/queue/index.cjs +1 -1
- package/dist/queue/index.d.cts +4 -5
- package/dist/queue/index.d.ts +4 -5
- package/dist/queue/index.js +1 -2
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/{queue-D6-x4OGF.js → queue-BiIs9fX4.js} +9 -11
- package/dist/{queue-D6-x4OGF.js.map → queue-BiIs9fX4.js.map} +1 -1
- package/dist/{queue-BJvDWriM.cjs → queue-CBi9Q8vp.cjs} +9 -11
- package/dist/{queue-BJvDWriM.cjs.map → queue-CBi9Q8vp.cjs.map} +1 -1
- package/dist/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
- package/dist/scheduler/index.cjs +5 -6
- package/dist/scheduler/index.d.cts +2 -4
- package/dist/scheduler/index.d.ts +2 -4
- package/dist/scheduler/index.js +5 -6
- package/dist/scheduler/types.d.cts +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/{schema-BUyMwQnM.d.cts → schema-DLmBEgPM.d.cts} +1 -3
- package/dist/{schema-BUyMwQnM.d.ts → schema-DLmBEgPM.d.ts} +1 -3
- package/dist/schemaGuidedMerge-C8CqrNGe.cjs +55 -0
- package/dist/schemaGuidedMerge-C8CqrNGe.cjs.map +1 -0
- package/dist/schemaGuidedMerge-DFNqj9Nz.js +44 -0
- package/dist/schemaGuidedMerge-DFNqj9Nz.js.map +1 -0
- package/dist/sdk/configurations/index.cjs +634 -2
- package/dist/sdk/configurations/index.cjs.map +1 -0
- package/dist/sdk/configurations/index.d.cts +1030 -4
- package/dist/sdk/configurations/index.d.ts +1030 -4
- package/dist/sdk/configurations/index.js +633 -1
- package/dist/sdk/configurations/index.js.map +1 -0
- package/dist/sdk/developerPortal/index.cjs +9 -13
- package/dist/sdk/developerPortal/index.cjs.map +1 -1
- package/dist/sdk/developerPortal/index.d.cts +4 -6
- package/dist/sdk/developerPortal/index.d.ts +4 -6
- package/dist/sdk/developerPortal/index.js +9 -13
- package/dist/sdk/developerPortal/index.js.map +1 -1
- package/dist/sdk/kaiMemory/index.cjs +1 -1
- package/dist/sdk/kaiMemory/index.d.cts +1 -3
- package/dist/sdk/kaiMemory/index.d.ts +1 -3
- package/dist/sdk/kaiMemory/index.js +1 -2
- package/dist/sdk/kaiMemory/types.d.cts +1 -1
- package/dist/sdk/kaiMemory/types.d.ts +1 -1
- package/dist/sdk/queryService/index.cjs +3 -4
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/queryService/index.js +3 -4
- package/dist/sdk/semanticLayer/index.cjs +1 -1
- package/dist/sdk/semanticLayer/index.d.cts +1 -7
- package/dist/sdk/semanticLayer/index.d.ts +1 -7
- package/dist/sdk/semanticLayer/index.js +1 -2
- package/dist/sdk/semanticLayer/types.d.cts +1 -1
- package/dist/sdk/semanticLayer/types.d.ts +1 -1
- package/dist/sdk/storage/index.cjs +3 -6
- package/dist/sdk/storage/index.cjs.map +1 -1
- package/dist/sdk/storage/index.d.cts +0 -6
- package/dist/sdk/storage/index.d.ts +0 -6
- package/dist/sdk/storage/index.js +3 -6
- package/dist/sdk/storage/index.js.map +1 -1
- package/dist/sdk/tag/index.cjs +1 -1
- package/dist/sdk/tag/index.d.cts +3 -5
- package/dist/sdk/tag/index.d.ts +3 -5
- package/dist/sdk/tag/index.js +1 -2
- package/dist/sdk/tag/types.d.cts +1 -1
- package/dist/sdk/tag/types.d.ts +1 -1
- package/dist/sdk/vault/index.cjs +3 -5
- package/dist/sdk/vault/index.cjs.map +1 -1
- package/dist/sdk/vault/index.d.cts +1 -1
- package/dist/sdk/vault/index.d.ts +1 -1
- package/dist/sdk/vault/index.js +3 -5
- package/dist/sdk/vault/index.js.map +1 -1
- package/dist/{semanticLayer-DvjS_nzo.js → semanticLayer-BdPW_wLo.js} +9 -14
- package/dist/{semanticLayer-DvjS_nzo.js.map → semanticLayer-BdPW_wLo.js.map} +1 -1
- package/dist/{semanticLayer-7BejcMj_.cjs → semanticLayer-djom-J78.cjs} +9 -14
- package/dist/{semanticLayer-7BejcMj_.cjs.map → semanticLayer-djom-J78.cjs.map} +1 -1
- package/dist/status/index.cjs +2 -3
- package/dist/status/index.d.cts +1 -3
- package/dist/status/index.d.ts +1 -3
- package/dist/status/index.js +2 -3
- package/dist/status/types.d.cts +0 -2
- package/dist/status/types.d.ts +0 -2
- package/dist/storage/index.cjs +12 -9
- package/dist/storage/index.d.cts +4 -3
- package/dist/storage/index.d.ts +4 -3
- package/dist/storage/index.js +10 -10
- package/dist/storage/types.d.cts +6 -6
- package/dist/storage/types.d.ts +6 -6
- package/dist/{storage-BR-Kgi-6.js → storage-BpOLWT6h.js} +73 -85
- package/dist/{storage-CVBXivpB.cjs.map → storage-BpOLWT6h.js.map} +1 -1
- package/dist/{storage-CVBXivpB.cjs → storage-KJ5Ki_ma.cjs} +90 -84
- package/dist/storage-KJ5Ki_ma.cjs.map +1 -0
- package/dist/{store-xS-Cu_VS.cjs → store-2OyH1XOP.cjs} +3 -5
- package/dist/{store-xS-Cu_VS.cjs.map → store-2OyH1XOP.cjs.map} +1 -1
- package/dist/{store-C9FQCHGe.js → store-HP0zRcLz.js} +3 -5
- package/dist/{store-C9FQCHGe.js.map → store-HP0zRcLz.js.map} +1 -1
- package/dist/stream/index.cjs +4 -5
- package/dist/stream/index.d.cts +2 -4
- package/dist/stream/index.d.ts +2 -4
- package/dist/stream/index.js +4 -5
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/{suggestions-BH3x7xU7.d.ts → suggestions-xhIjrlvi.d.cts} +1 -3
- package/dist/{suggestions-BH3x7xU7.d.cts → suggestions-xhIjrlvi.d.ts} +1 -3
- package/dist/syncActions/index.cjs +1 -1
- package/dist/syncActions/index.d.cts +2 -2
- package/dist/syncActions/index.d.ts +2 -2
- package/dist/syncActions/index.js +1 -2
- package/dist/syncActions/types.d.cts +2 -2
- package/dist/syncActions/types.d.ts +2 -2
- package/dist/{syncActions-C1rE4R3f.cjs → syncActions-BcX3jm2E.cjs} +74 -187
- package/dist/syncActions-BcX3jm2E.cjs.map +1 -0
- package/dist/{syncActions-DM8vP7p3.js → syncActions-giPLTfje.js} +73 -186
- package/dist/syncActions-giPLTfje.js.map +1 -0
- package/dist/{tag-DHS_soa7.cjs → tag-A5z4tJn1.cjs} +5 -7
- package/dist/{tag-DHS_soa7.cjs.map → tag-A5z4tJn1.cjs.map} +1 -1
- package/dist/{tag-hh-1nhNr.js → tag-BwjbG3tT.js} +5 -7
- package/dist/{tag-hh-1nhNr.js.map → tag-BwjbG3tT.js.map} +1 -1
- package/dist/telemetry/index.cjs +4 -5
- package/dist/telemetry/index.d.cts +2 -4
- package/dist/telemetry/index.d.ts +2 -4
- package/dist/telemetry/index.js +4 -5
- package/dist/telemetry/types.d.cts +1 -1
- package/dist/telemetry/types.d.ts +1 -1
- package/dist/{transientRetries-B4iusp69.js → transientRetries-BKqmb85B.js} +13 -22
- package/dist/{transientRetries-B4iusp69.js.map → transientRetries-BKqmb85B.js.map} +1 -1
- package/dist/{transientRetries-DdJfH9QK.cjs → transientRetries-CM7rAEXQ.cjs} +13 -22
- package/dist/{transientRetries-DdJfH9QK.cjs.map → transientRetries-CM7rAEXQ.cjs.map} +1 -1
- package/dist/{types-DfJP6Dti.d.ts → types--Rp5wvaz.d.ts} +2 -6
- package/dist/{types-DlgqPU_4.d.cts → types-1IBnjBVJ.d.cts} +2 -6
- package/dist/{types-BXHZQvGy.d.ts → types-37vwxse4.d.cts} +2 -6
- package/dist/{types-QPW-7dPm.d.ts → types-6T04_qUf.d.ts} +2 -6
- package/dist/{types-CwQ8_n8q.d.ts → types-B0e-no6u.d.ts} +41 -62
- package/dist/{types-C_raqbl-.d.cts → types-B1qe1etN.d.cts} +3 -7
- package/dist/{types-Cc4yTEdK.d.ts → types-B3ri-iiC.d.ts} +2 -26
- package/dist/{types-0ZAMQhva.d.cts → types-BB49alHP.d.cts} +245 -9
- package/dist/{types-NSxpnYW5.d.cts → types-BCGrKW1K.d.cts} +6 -10
- package/dist/{types-BaqdM92a.d.ts → types-BE8abIig.d.cts} +2 -6
- package/dist/{types-c4h2YDMC.d.ts → types-BWMOK6eL.d.cts} +2 -6
- package/dist/{types-VehpPOQX.d.ts → types-Bat0SIZA.d.cts} +16 -97
- package/dist/{types-CpWE6Yg2.d.ts → types-Bdl7EFMc.d.ts} +2 -6
- package/dist/{types-DgOLSRiy.d.ts → types-BfB-XXLF.d.ts} +245 -9
- package/dist/{types-C9VaQSqV.d.ts → types-BiDdBXSm.d.ts} +2 -8
- package/dist/{types-EkyQ0_10.d.cts → types-BuclMPeY.d.cts} +2 -26
- package/dist/{types-CfZLdfAL.d.ts → types-C9okze_R.d.ts} +3 -7
- package/dist/{types-Dn1G-qv4.d.cts → types-CPWjRdnj.d.cts} +41 -62
- package/dist/{types-D3mj56iq.d.cts → types-CRubbBcU.d.cts} +2 -6
- package/dist/{types-BTy_FFSu.d.ts → types-CWcdaq-K.d.ts} +2 -6
- package/dist/{types-Bt8CEZ6K.d.ts → types-CcGp6O3B.d.cts} +3 -7
- package/dist/{types-BWYtQkHu.d.ts → types-Cr5lyI99.d.ts} +2 -6
- package/dist/{types-CNkQuWnO.d.cts → types-CxEJ77m3.d.cts} +3 -7
- package/dist/{types-CrJIILXf.d.cts → types-D-tJt0hQ.d.cts} +2 -6
- package/dist/{types-BYFU_6Iz.d.ts → types-D6lre27s.d.ts} +2 -8
- package/dist/{types-Cn8I0vcr.d.ts → types-DHMxPJZq.d.cts} +2 -6
- package/dist/{types-BtS3DhGu.d.cts → types-DJzTVMu1.d.ts} +2 -6
- package/dist/{types-DXF6faow.d.cts → types-DNgazFnF.d.cts} +2 -8
- package/dist/{types-UySfduQo.d.ts → types-DRCttnIN.d.ts} +2 -6
- package/dist/{types-D3H3EAre.d.ts → types-DUpVIuk7.d.ts} +2 -6
- package/dist/{types-Ce5Blzhg.d.ts → types-DeyXJzWz.d.cts} +2 -6
- package/dist/{types-sOM2_KPc.d.cts → types-Dryq2GGE.d.cts} +2 -6
- package/dist/{types-CwGbiMF-.d.cts → types-DschSZHf.d.cts} +3 -5
- package/dist/{types-C-GSYDTN.d.ts → types-DtOfhDzz.d.ts} +3 -5
- package/dist/{types-C4eQ-Zcx.d.cts → types-Du5o-tud.d.ts} +16 -97
- package/dist/{types-BbwrMl0Q.d.cts → types-DwbTiyhZ.d.cts} +2 -6
- package/dist/{types-B7L6uSYb.d.ts → types-Dz9vyloX.d.ts} +6 -10
- package/dist/{types-6KabdIyO.d.cts → types-E8tzafsk.d.cts} +3 -7
- package/dist/{types-EmIcG-8K.d.cts → types-LconaX98.d.cts} +2 -6
- package/dist/{types-Cfc-fYbq.d.cts → types-YpOm4yXE.d.cts} +2 -8
- package/dist/{types-CXv_e6xC.d.cts → types-ZZwdKCBl.d.ts} +2 -6
- package/dist/{types-D8d5tyGi.d.cts → types-eFi8xJIM.d.cts} +2 -6
- package/dist/{types-wNuJUhco.d.cts → types-inG9y3dP.d.ts} +2 -6
- package/dist/{types-Vu09EUZs.d.ts → types-ir7T2a9a.d.ts} +3 -7
- package/dist/{types-DMpiG2q4.d.cts → types-jjOulnni.d.ts} +2 -6
- package/dist/{types-DSBrhK_K.d.cts → types-wYrC2boT.d.ts} +3 -7
- package/dist/{types-1LENlL5h.d.ts → types-xzt_2H63.d.ts} +3 -7
- package/dist/{types-9d8ihjZh.d.cts → types-zPY-XGnM.d.ts} +2 -6
- package/dist/{validateConnectionStatus-BalWEyRk.cjs → validateConnectionStatus-BjemGI1e.cjs} +5 -7
- package/dist/{validateConnectionStatus-BalWEyRk.cjs.map → validateConnectionStatus-BjemGI1e.cjs.map} +1 -1
- package/dist/{validateConnectionStatus-DyrYpn0G.js → validateConnectionStatus-DYwWeWVo.js} +5 -7
- package/dist/{validateConnectionStatus-DyrYpn0G.js.map → validateConnectionStatus-DYwWeWVo.js.map} +1 -1
- package/dist/vault/index.cjs +7 -8
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/index.js +7 -8
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/package.json +7 -7
- package/surface/apps.md +12 -10
- package/surface/billing.md +2 -2
- package/surface/chat.md +1 -1
- package/surface/dataScience.md +1 -1
- package/surface/editor.md +5 -5
- package/surface/kaiAgent.md +4 -4
- package/surface/management.md +3 -2
- package/surface/queue.md +3 -3
- package/surface/sdk.md +0 -6
- package/surface/stack.md +11 -0
- package/surface/storage.md +2 -2
- package/surface/stream.md +6 -6
- package/surface/syncActions.md +1 -2
- package/dist/configurations-B2O8AAy0.cjs +0 -735
- package/dist/configurations-B2O8AAy0.cjs.map +0 -1
- package/dist/configurations-CL0ouUMa.js.map +0 -1
- package/dist/configurations-D9J3jh3g.cjs.map +0 -1
- package/dist/configurations-DKINmjA3.js +0 -718
- package/dist/configurations-DKINmjA3.js.map +0 -1
- package/dist/constants-CA4UN2Xv.js.map +0 -1
- package/dist/constants-a0jswUeK.cjs.map +0 -1
- package/dist/createGenericFetchClient-CQdNcPC3.js +0 -7
- package/dist/createOpenapiFetchClient-DXiMv9WL.js +0 -7
- package/dist/domain/permissions/index.cjs.map +0 -1
- package/dist/domain/permissions/index.js.map +0 -1
- package/dist/generateUUID-Dr8l-aoc.js +0 -6
- package/dist/index-B3QTeqfL.d.ts +0 -23575
- package/dist/index-BfqkgPGI.d.cts +0 -34
- package/dist/index-BfqkgPGI.d.ts +0 -34
- package/dist/index-C40Fbj-6.d.cts +0 -23575
- package/dist/index-P1vR966i.d.cts +0 -199
- package/dist/index-P1vR966i.d.ts +0 -199
- package/dist/management-CXHnxVaZ.cjs.map +0 -1
- package/dist/management-NYAD6ej4.js.map +0 -1
- package/dist/middleware-CEP6uu_D.cjs.map +0 -1
- package/dist/middleware-GOfx8Apu.js.map +0 -1
- package/dist/project-BXLFrWJ6.js +0 -45
- package/dist/project-BXLFrWJ6.js.map +0 -1
- package/dist/project-CpgplgCr.cjs +0 -62
- package/dist/project-CpgplgCr.cjs.map +0 -1
- package/dist/storage-BR-Kgi-6.js.map +0 -1
- package/dist/storageTable-BNOR2FCh.cjs +0 -442
- package/dist/storageTable-BNOR2FCh.cjs.map +0 -1
- package/dist/storageTable-BldTNyEk.js +0 -395
- package/dist/storageTable-BldTNyEk.js.map +0 -1
- package/dist/syncActions-C1rE4R3f.cjs.map +0 -1
- package/dist/syncActions-DM8vP7p3.js.map +0 -1
- package/surface/context.md +0 -40
package/dist/index.cjs
CHANGED
|
@@ -1,64 +1,105 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const require_kaiMemory = require("./kaiMemory-Qch09f-m.cjs");
|
|
29
|
-
const require_semanticLayer = require("./semanticLayer-7BejcMj_.cjs");
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
|
|
3
|
+
const require_UserError = require("./UserError-D4P9Tbhf.cjs");
|
|
4
|
+
const require_createFetchClient = require("./createFetchClient-DEkUH662.cjs");
|
|
5
|
+
const require_validateConnectionStatus = require("./validateConnectionStatus-BjemGI1e.cjs");
|
|
6
|
+
const require_storage = require("./storage-KJ5Ki_ma.cjs");
|
|
7
|
+
const require_ManagementSessionMintError = require("./ManagementSessionMintError-ByOulHQH.cjs");
|
|
8
|
+
const require_QueryJobError = require("./QueryJobError-Oy0fl4aw.cjs");
|
|
9
|
+
const require_QueueJobError = require("./QueueJobError-DruZK3tc.cjs");
|
|
10
|
+
const require_SyncActionError = require("./SyncActionError-mbpVg63X.cjs");
|
|
11
|
+
const require_ValidationError = require("./ValidationError-BXcFX4nD.cjs");
|
|
12
|
+
const require_createGenericFetchClient = require("./createGenericFetchClient-2oU-PXVo.cjs");
|
|
13
|
+
const require_import = require("./import-CABlFMQX.cjs");
|
|
14
|
+
const require_authClient = require("./authClient-DcKBpMcU.cjs");
|
|
15
|
+
const require_collectByOffset = require("./collectByOffset-DgxJ3zT9.cjs");
|
|
16
|
+
const require_concurrent = require("./concurrent-DnTV_ppY.cjs");
|
|
17
|
+
const require_dedupe = require("./dedupe-Bf0gl9TJ.cjs");
|
|
18
|
+
const require_transientRetries = require("./transientRetries-CM7rAEXQ.cjs");
|
|
19
|
+
const require_store = require("./store-2OyH1XOP.cjs");
|
|
20
|
+
const require_tag = require("./tag-A5z4tJn1.cjs");
|
|
21
|
+
const require_generateUUID = require("./generateUUID-DbSTmvVP.cjs");
|
|
22
|
+
const require_isPlainObject = require("./isPlainObject-CcvQt0qB.cjs");
|
|
23
|
+
const require_schemaGuidedMerge = require("./schemaGuidedMerge-C8CqrNGe.cjs");
|
|
24
|
+
const require_management = require("./management-BEGOEQxM.cjs");
|
|
25
|
+
const require_constants = require("./constants-DhFQWQgy.cjs");
|
|
26
|
+
const require_kaiMemory = require("./kaiMemory-CkLQfJXD.cjs");
|
|
27
|
+
const require_semanticLayer = require("./semanticLayer-djom-J78.cjs");
|
|
30
28
|
const require_sdk_vault_index = require("./sdk/vault/index.cjs");
|
|
31
29
|
const require_ai_index = require("./ai/index.cjs");
|
|
32
|
-
const require_appLogs = require("./appLogs-
|
|
30
|
+
const require_appLogs = require("./appLogs-CoAWQGxs.cjs");
|
|
33
31
|
const require_apps_index = require("./apps/index.cjs");
|
|
34
32
|
const require_billing_index = require("./billing/index.cjs");
|
|
35
33
|
const require_chat_index = require("./chat/index.cjs");
|
|
36
|
-
const require_componentsMcp = require("./componentsMcp-
|
|
37
|
-
const require_dataScience = require("./dataScience-
|
|
34
|
+
const require_componentsMcp = require("./componentsMcp-BaHy5iLr.cjs");
|
|
35
|
+
const require_dataScience = require("./dataScience-CufjHPSd.cjs");
|
|
38
36
|
const require_editor_index = require("./editor/index.cjs");
|
|
39
37
|
const require_encryption_index = require("./encryption/index.cjs");
|
|
40
|
-
const require_kaiAgent = require("./kaiAgent-
|
|
41
|
-
const require_metastore = require("./metastore-
|
|
38
|
+
const require_kaiAgent = require("./kaiAgent-gaA7dqki.cjs");
|
|
39
|
+
const require_metastore = require("./metastore-DeRQ2VIv.cjs");
|
|
42
40
|
const require_notifications_index = require("./notifications/index.cjs");
|
|
43
|
-
const require_oauth = require("./oauth-
|
|
41
|
+
const require_oauth = require("./oauth-B5Biqz21.cjs");
|
|
44
42
|
const require_omnisearch_index = require("./omnisearch/index.cjs");
|
|
45
|
-
const require_queryService = require("./queryService-
|
|
46
|
-
const require_queue = require("./queue-
|
|
43
|
+
const require_queryService = require("./queryService-Cg-eMysa.cjs");
|
|
44
|
+
const require_queue = require("./queue-CBi9Q8vp.cjs");
|
|
47
45
|
const require_scheduler_index = require("./scheduler/index.cjs");
|
|
48
46
|
const require_stream_index = require("./stream/index.cjs");
|
|
49
|
-
const require_syncActions = require("./syncActions-
|
|
47
|
+
const require_syncActions = require("./syncActions-BcX3jm2E.cjs");
|
|
50
48
|
const require_telemetry_index = require("./telemetry/index.cjs");
|
|
51
49
|
const require_vault_index = require("./vault/index.cjs");
|
|
52
|
-
const require_middleware = require("./middleware-
|
|
50
|
+
const require_middleware = require("./middleware-B9RNuLfD.cjs");
|
|
51
|
+
const require_project = require("./project-Onf-IcPW.cjs");
|
|
53
52
|
const require_sdk_queryService_index = require("./sdk/queryService/index.cjs");
|
|
54
53
|
let zod = require("zod");
|
|
55
54
|
zod = require_rolldown_runtime.__toESM(zod, 1);
|
|
56
|
-
|
|
55
|
+
// src/keboola/errors.ts
|
|
56
|
+
/**
|
|
57
|
+
* The single error the keboola client / session throws. It carries a stable `type` (the switchable
|
|
58
|
+
* contract) and a human-readable message derived from that type — no per-call message strings.
|
|
59
|
+
*/
|
|
60
|
+
const KeboolaErrorType = {
|
|
61
|
+
Unconfigured: "unconfigured",
|
|
62
|
+
NotAuthenticated: "not-authenticated",
|
|
63
|
+
SignInEnded: "sign-in-ended",
|
|
64
|
+
AlreadyAuthenticated: "already-authenticated",
|
|
65
|
+
NoStorageToken: "no-storage-token",
|
|
66
|
+
NoManagementToken: "no-management-token",
|
|
67
|
+
MissingProject: "missing-project",
|
|
68
|
+
NotBearer: "not-bearer",
|
|
69
|
+
NotReady: "not-ready",
|
|
70
|
+
InvalidBuildTransition: "invalid-build-transition"
|
|
71
|
+
};
|
|
72
|
+
const MESSAGES = {
|
|
73
|
+
[KeboolaErrorType.Unconfigured]: "The session is not configured — set a baseUrl first.",
|
|
74
|
+
[KeboolaErrorType.NotAuthenticated]: "The session is not authenticated — sign in first.",
|
|
75
|
+
[KeboolaErrorType.SignInEnded]: "The sign-in this operation started under has ended — its result belongs to nobody.",
|
|
76
|
+
[KeboolaErrorType.AlreadyAuthenticated]: "The session is already authenticated — reset before authenticating again.",
|
|
77
|
+
[KeboolaErrorType.NoStorageToken]: "No storage token — authenticate the storage realm first.",
|
|
78
|
+
[KeboolaErrorType.NoManagementToken]: "No management token — authenticate the management realm first.",
|
|
79
|
+
[KeboolaErrorType.MissingProject]: "A bearer storage session requires a project — call setProject(projectId) first.",
|
|
80
|
+
[KeboolaErrorType.NotBearer]: "This operation requires a bearer (OAuth) session.",
|
|
81
|
+
[KeboolaErrorType.NotReady]: "The client is not ready — authenticate the storage realm first.",
|
|
82
|
+
[KeboolaErrorType.InvalidBuildTransition]: "Invalid storage build transition — the build goes idle → initializing → ready | failed."
|
|
83
|
+
};
|
|
84
|
+
var KeboolaError = class KeboolaError extends Error {
|
|
85
|
+
type;
|
|
86
|
+
constructor(type) {
|
|
87
|
+
super(MESSAGES[type]);
|
|
88
|
+
this.type = type;
|
|
89
|
+
this.name = "KeboolaError";
|
|
90
|
+
Object.setPrototypeOf(this, KeboolaError.prototype);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const isKeboolaError = (error) => error instanceof KeboolaError;
|
|
94
|
+
/** Throw a {@link KeboolaError} of `type` when `value` is null/undefined; otherwise narrow it. */
|
|
95
|
+
function assert$1(value, type) {
|
|
96
|
+
if (value == null) throw new KeboolaError(type);
|
|
97
|
+
}
|
|
98
|
+
// src/utils/assert.ts
|
|
57
99
|
function assert(value, message) {
|
|
58
100
|
if (value == null) throw new Error(message);
|
|
59
101
|
}
|
|
60
|
-
|
|
61
|
-
//#region src/utils/ensure.ts
|
|
102
|
+
// src/utils/ensure.ts
|
|
62
103
|
/**
|
|
63
104
|
* Read a key, or build its value and keep it.
|
|
64
105
|
*
|
|
@@ -73,8 +114,7 @@ const ensure = (map, key, build) => {
|
|
|
73
114
|
map.set(key, created);
|
|
74
115
|
return created;
|
|
75
116
|
};
|
|
76
|
-
|
|
77
|
-
//#region src/utils/async/coalesce.ts
|
|
117
|
+
// src/utils/async/coalesce.ts
|
|
78
118
|
/**
|
|
79
119
|
* Coalesces concurrent triggers onto a single, never-parallel run of `task`.
|
|
80
120
|
*
|
|
@@ -104,8 +144,7 @@ const coalesce = (task) => {
|
|
|
104
144
|
return waiter.promise;
|
|
105
145
|
};
|
|
106
146
|
};
|
|
107
|
-
|
|
108
|
-
//#region src/utils/store/derivedStore.ts
|
|
147
|
+
// src/utils/store/derivedStore.ts
|
|
109
148
|
const isPlainObjectOrArray = (value) => {
|
|
110
149
|
if (Array.isArray(value)) return true;
|
|
111
150
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -140,8 +179,7 @@ const createDerivedStore = ({ source, dependsOn, build, keyEquals = shallowEqual
|
|
|
140
179
|
dispose
|
|
141
180
|
};
|
|
142
181
|
};
|
|
143
|
-
|
|
144
|
-
//#region src/utils/store/derivedAsyncStore.ts
|
|
182
|
+
// src/utils/store/derivedAsyncStore.ts
|
|
145
183
|
const createDerivedAsyncStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
|
|
146
184
|
const store = require_store.createStore({ state: "idle" });
|
|
147
185
|
let currentKey = null;
|
|
@@ -209,8 +247,7 @@ const createDerivedAsyncStore = ({ source, dependsOn, build, keyEquals = shallow
|
|
|
209
247
|
settled
|
|
210
248
|
};
|
|
211
249
|
};
|
|
212
|
-
|
|
213
|
-
//#region src/utils/async/poll/registry.ts
|
|
250
|
+
// src/utils/async/poll/registry.ts
|
|
214
251
|
const DEFAULT_LIMIT = 50;
|
|
215
252
|
const isFinished = ({ snapshot }) => snapshot.state !== "idle" && snapshot.state !== "requesting" && snapshot.state !== "polling";
|
|
216
253
|
const createPollRegistry = ({ limit = DEFAULT_LIMIT } = {}) => {
|
|
@@ -262,8 +299,7 @@ const createPollRegistry = ({ limit = DEFAULT_LIMIT } = {}) => {
|
|
|
262
299
|
stopAll: (reason) => entries.get().forEach((entry) => entry.stop(reason))
|
|
263
300
|
};
|
|
264
301
|
};
|
|
265
|
-
|
|
266
|
-
//#region src/utils/async/queueSeries.ts
|
|
302
|
+
// src/utils/async/queueSeries.ts
|
|
267
303
|
const isPromiseLike = (value) => (typeof value === "object" && value !== null || typeof value === "function") && "then" in value && typeof value.then === "function";
|
|
268
304
|
/**
|
|
269
305
|
* Queues tasks added over time so a slower earlier task cannot finish after and overwrite a later one.
|
|
@@ -303,8 +339,7 @@ const queueSeries = () => {
|
|
|
303
339
|
onIdle
|
|
304
340
|
};
|
|
305
341
|
};
|
|
306
|
-
|
|
307
|
-
//#region src/utils/deepMerge.ts
|
|
342
|
+
// src/utils/deepMerge.ts
|
|
308
343
|
/**
|
|
309
344
|
* Recursively merge `patch` into `base`. Plain-object values are merged key-by-key; every
|
|
310
345
|
* other value (primitives, arrays, or a type mismatch between the two sides) replaces the
|
|
@@ -320,8 +355,7 @@ const deepMerge = (base, patch) => {
|
|
|
320
355
|
}
|
|
321
356
|
return out;
|
|
322
357
|
};
|
|
323
|
-
|
|
324
|
-
//#region src/utils/persistor/adapters.ts
|
|
358
|
+
// src/utils/persistor/adapters.ts
|
|
325
359
|
const createNullStorage = () => ({
|
|
326
360
|
getItem: () => null,
|
|
327
361
|
setItem: () => {},
|
|
@@ -370,8 +404,7 @@ const createWebStorage = (pick) => {
|
|
|
370
404
|
};
|
|
371
405
|
const createLocalStorage = () => createWebStorage(() => "localStorage" in globalThis ? globalThis.localStorage : null);
|
|
372
406
|
const createSessionStorage = () => createWebStorage(() => "sessionStorage" in globalThis ? globalThis.sessionStorage : null);
|
|
373
|
-
|
|
374
|
-
//#region src/utils/persistor/persistor.ts
|
|
407
|
+
// src/utils/persistor/persistor.ts
|
|
375
408
|
const createPersistor = ({ storage = createNullStorage(), key, schema, defaultValue, encode = JSON.stringify, decode = JSON.parse }) => {
|
|
376
409
|
const writes = queueSeries();
|
|
377
410
|
const _load = async () => {
|
|
@@ -425,82 +458,7 @@ const createPersistor = ({ storage = createNullStorage(), key, schema, defaultVa
|
|
|
425
458
|
locked
|
|
426
459
|
};
|
|
427
460
|
};
|
|
428
|
-
|
|
429
|
-
//#region src/keboola/createLiveProject.ts
|
|
430
|
-
const STORAGE_TOKEN_MUTATING_PATTERNS = [/\/buckets(\/[^/]+)?$/, /\/projects\/[^/]+\/features(\/[^/]+)?$/];
|
|
431
|
-
const isStorageTokenMutatingRequest = (request) => {
|
|
432
|
-
if (request.method === "GET") return false;
|
|
433
|
-
const { pathname } = new URL(request.url);
|
|
434
|
-
return STORAGE_TOKEN_MUTATING_PATTERNS.some((pattern) => pattern.test(pathname));
|
|
435
|
-
};
|
|
436
|
-
const createProjectRefreshMiddleware = (shouldRefresh, requestRefresh) => (next) => async (request) => {
|
|
437
|
-
const response = await next(request);
|
|
438
|
-
if (shouldRefresh(request.request)) await requestRefresh();
|
|
439
|
-
return response;
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* The live project store, re-verified (coalesced) after a token-mutating request or a re-scope.
|
|
443
|
-
*/
|
|
444
|
-
const createLiveProject = ({ initialToken, verify }) => {
|
|
445
|
-
const store = require_store.createStore(require_project.createProject({ sapiToken: initialToken }));
|
|
446
|
-
const refresh = coalesce(async () => store.set(require_project.createProject({ sapiToken: await verify() })));
|
|
447
|
-
const middleware = createProjectRefreshMiddleware(isStorageTokenMutatingRequest, refresh);
|
|
448
|
-
return {
|
|
449
|
-
store,
|
|
450
|
-
getProject: () => store.get(),
|
|
451
|
-
subscribe: store.subscribe,
|
|
452
|
-
middleware,
|
|
453
|
-
refresh
|
|
454
|
-
};
|
|
455
|
-
};
|
|
456
|
-
//#endregion
|
|
457
|
-
//#region src/keboola/errors.ts
|
|
458
|
-
/**
|
|
459
|
-
* The single error the keboola client / session throws. It carries a stable `type` (the switchable
|
|
460
|
-
* contract) and a human-readable message derived from that type — no per-call message strings.
|
|
461
|
-
*/
|
|
462
|
-
const KeboolaErrorType = {
|
|
463
|
-
Unconfigured: "unconfigured",
|
|
464
|
-
NotAuthenticated: "not-authenticated",
|
|
465
|
-
SignInEnded: "sign-in-ended",
|
|
466
|
-
AlreadyAuthenticated: "already-authenticated",
|
|
467
|
-
NoStorageToken: "no-storage-token",
|
|
468
|
-
NoManagementToken: "no-management-token",
|
|
469
|
-
MissingProject: "missing-project",
|
|
470
|
-
NotBearer: "not-bearer",
|
|
471
|
-
NotReady: "not-ready",
|
|
472
|
-
InvalidBuildTransition: "invalid-build-transition",
|
|
473
|
-
StackActive: "stack-active"
|
|
474
|
-
};
|
|
475
|
-
const MESSAGES = {
|
|
476
|
-
[KeboolaErrorType.Unconfigured]: "The session is not configured — set a baseUrl first.",
|
|
477
|
-
[KeboolaErrorType.NotAuthenticated]: "The session is not authenticated — sign in first.",
|
|
478
|
-
[KeboolaErrorType.SignInEnded]: "The sign-in this operation started under has ended — its result belongs to nobody.",
|
|
479
|
-
[KeboolaErrorType.AlreadyAuthenticated]: "The session is already authenticated — reset before authenticating again.",
|
|
480
|
-
[KeboolaErrorType.NoStorageToken]: "No storage token — authenticate the storage realm first.",
|
|
481
|
-
[KeboolaErrorType.NoManagementToken]: "No management token — authenticate the management realm first.",
|
|
482
|
-
[KeboolaErrorType.MissingProject]: "A bearer storage session requires a project — call setProject(projectId) first.",
|
|
483
|
-
[KeboolaErrorType.NotBearer]: "This operation requires a bearer (OAuth) session.",
|
|
484
|
-
[KeboolaErrorType.NotReady]: "The client is not ready — authenticate the storage realm first.",
|
|
485
|
-
[KeboolaErrorType.InvalidBuildTransition]: "Invalid storage build transition — the build goes idle → initializing → ready | failed.",
|
|
486
|
-
[KeboolaErrorType.StackActive]: "The active stack cannot be closed — select another first."
|
|
487
|
-
};
|
|
488
|
-
var KeboolaError = class KeboolaError extends Error {
|
|
489
|
-
type;
|
|
490
|
-
constructor(type) {
|
|
491
|
-
super(MESSAGES[type]);
|
|
492
|
-
this.type = type;
|
|
493
|
-
this.name = "KeboolaError";
|
|
494
|
-
Object.setPrototypeOf(this, KeboolaError.prototype);
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
|
-
const isKeboolaError = (error) => error instanceof KeboolaError;
|
|
498
|
-
/** Throw a {@link KeboolaError} of `type` when `value` is null/undefined; otherwise narrow it. */
|
|
499
|
-
function assert$1(value, type) {
|
|
500
|
-
if (value == null) throw new KeboolaError(type);
|
|
501
|
-
}
|
|
502
|
-
//#endregion
|
|
503
|
-
//#region src/serviceClientRegistry/utils.ts
|
|
461
|
+
// src/serviceClientRegistry/utils.ts
|
|
504
462
|
const isBuiltInProperty = (property) => typeof property === "symbol" || property === "then" || property === "constructor" || property === "toString" || property === "valueOf";
|
|
505
463
|
/**
|
|
506
464
|
* Creates a dummy client that intercepts method calls and invokes the provided onCall callback.
|
|
@@ -515,8 +473,7 @@ const createDummyClient = ({ onCall }) => {
|
|
|
515
473
|
});
|
|
516
474
|
return createProxy();
|
|
517
475
|
};
|
|
518
|
-
|
|
519
|
-
//#region src/serviceClientRegistry/createServiceClientRegistry.ts
|
|
476
|
+
// src/serviceClientRegistry/createServiceClientRegistry.ts
|
|
520
477
|
const createServiceClientRegistry = () => ({ getServiceBaseUrl, onUnavailable }) => {
|
|
521
478
|
const dummy = (serviceId, clientName) => createDummyClient({ onCall: (path, args) => {
|
|
522
479
|
onUnavailable?.({
|
|
@@ -555,8 +512,7 @@ const createServiceClientRegistry = () => ({ getServiceBaseUrl, onUnavailable })
|
|
|
555
512
|
};
|
|
556
513
|
return registry;
|
|
557
514
|
};
|
|
558
|
-
|
|
559
|
-
//#region src/keboola/createApi.ts
|
|
515
|
+
// src/keboola/createApi.ts
|
|
560
516
|
const createApi = (state) => new Proxy({}, { get(_target, property) {
|
|
561
517
|
if (isBuiltInProperty(property)) return void 0;
|
|
562
518
|
if (property === "auth") {
|
|
@@ -573,8 +529,7 @@ const createApi = (state) => new Proxy({}, { get(_target, property) {
|
|
|
573
529
|
assert$1(clients, KeboolaErrorType.NotReady);
|
|
574
530
|
return clients[property];
|
|
575
531
|
} });
|
|
576
|
-
|
|
577
|
-
//#region src/keboola/createMiddlewareFor.ts
|
|
532
|
+
// src/keboola/createMiddlewareFor.ts
|
|
578
533
|
const createMiddlewareFor = (middlewares) => {
|
|
579
534
|
return (target, baseline = []) => {
|
|
580
535
|
if (Array.isArray(middlewares)) return [...baseline, ...middlewares];
|
|
@@ -587,8 +542,7 @@ const createMiddlewareFor = (middlewares) => {
|
|
|
587
542
|
];
|
|
588
543
|
};
|
|
589
544
|
};
|
|
590
|
-
|
|
591
|
-
//#region src/keboola/legacy/createConfig.ts
|
|
545
|
+
// src/keboola/legacy/createConfig.ts
|
|
592
546
|
const createConfig = () => {
|
|
593
547
|
const store = require_store.createStore({
|
|
594
548
|
baseUrl: null,
|
|
@@ -625,25 +579,7 @@ const createConfig = () => {
|
|
|
625
579
|
debug
|
|
626
580
|
};
|
|
627
581
|
};
|
|
628
|
-
|
|
629
|
-
//#region src/domain/defaultBranch.ts
|
|
630
|
-
const createDefaultBranch = ({ devBranches }) => {
|
|
631
|
-
const defaultBranch = devBranches.find((branch) => branch.isDefault);
|
|
632
|
-
assert(defaultBranch, "No default branch found for the project.");
|
|
633
|
-
const getType = (branchId) => {
|
|
634
|
-
if (branchId == null || branchId === "default") return "default";
|
|
635
|
-
return Number(branchId) === defaultBranch.id ? "default" : "dev";
|
|
636
|
-
};
|
|
637
|
-
return {
|
|
638
|
-
id: defaultBranch.id,
|
|
639
|
-
name: defaultBranch.name,
|
|
640
|
-
getType,
|
|
641
|
-
isDev: (branchId) => getType(branchId) === "dev",
|
|
642
|
-
isDefault: (branchId) => getType(branchId) === "default"
|
|
643
|
-
};
|
|
644
|
-
};
|
|
645
|
-
//#endregion
|
|
646
|
-
//#region src/domain/stack.ts
|
|
582
|
+
// src/domain/stack.ts
|
|
647
583
|
const isServiceId = (id) => Object.values(require_constants.ServiceId).includes(id);
|
|
648
584
|
const SERVICE_URL_OVERRIDES = { "kai-assistant": (url) => `${url}/api` };
|
|
649
585
|
const createStack = ({ stackInfo, clientServiceUrls }) => {
|
|
@@ -680,8 +616,7 @@ const createStack = ({ stackInfo, clientServiceUrls }) => {
|
|
|
680
616
|
hasComponent
|
|
681
617
|
};
|
|
682
618
|
};
|
|
683
|
-
|
|
684
|
-
//#region src/sdks/variables/variablesSdk.ts
|
|
619
|
+
// src/sdks/variables/variablesSdk.ts
|
|
685
620
|
const VARIABLES_COMPONENT_ID = "keboola.variables";
|
|
686
621
|
/** Union the definitions by name; on a name conflict the target's definition is kept. */
|
|
687
622
|
const mergeVariableDefinitions = (target, source) => {
|
|
@@ -762,14 +697,8 @@ const createVariablesSdk = ({ storageClient }) => {
|
|
|
762
697
|
}
|
|
763
698
|
};
|
|
764
699
|
};
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
const createSdk = ({ storage, services, context }) => ({
|
|
768
|
-
configuration: require_configurations.createConfigurationSdk({
|
|
769
|
-
storageClient: storage,
|
|
770
|
-
encryptionClient: services.encryption,
|
|
771
|
-
context
|
|
772
|
-
}),
|
|
700
|
+
// src/keboola/createSdk.ts
|
|
701
|
+
const createSdk = ({ storage, services }) => ({
|
|
773
702
|
tag: require_tag.createTagSdk({ metastoreClient: services.metastore }),
|
|
774
703
|
semanticLayer: require_semanticLayer.createSemanticLayerSdk({ metastoreClient: services.metastore }),
|
|
775
704
|
kaiMemory: require_kaiMemory.createKaiMemorySdk({ metastoreClient: services.metastore }),
|
|
@@ -779,8 +708,7 @@ const createSdk = ({ storage, services, context }) => ({
|
|
|
779
708
|
}),
|
|
780
709
|
variables: createVariablesSdk({ storageClient: storage })
|
|
781
710
|
});
|
|
782
|
-
|
|
783
|
-
//#region src/keboola/createServiceClients.ts
|
|
711
|
+
// src/keboola/createServiceClients.ts
|
|
784
712
|
const withPath = (serviceBaseUrl, path) => typeof serviceBaseUrl === "string" ? `${serviceBaseUrl}${path}` : async () => `${await serviceBaseUrl()}${path}`;
|
|
785
713
|
const createServiceClients = ({ baseUrl, auth, getServiceBaseUrl, middlewareFor, attachTokenMiddleware }) => createServiceClientRegistry()({
|
|
786
714
|
getServiceBaseUrl,
|
|
@@ -956,8 +884,7 @@ const createServiceClients = ({ baseUrl, auth, getServiceBaseUrl, middlewareFor,
|
|
|
956
884
|
auth
|
|
957
885
|
})
|
|
958
886
|
}).build();
|
|
959
|
-
|
|
960
|
-
//#region src/keboola/legacy/createProjectClients.ts
|
|
887
|
+
// src/keboola/legacy/createProjectClients.ts
|
|
961
888
|
const createAttachStorageToken = (getToken) => (next) => (request) => {
|
|
962
889
|
request.request.headers.set(require_createFetchClient.KeboolaHttpHeader.STORAGE_API_TOKEN, getToken());
|
|
963
890
|
return next(request);
|
|
@@ -968,72 +895,41 @@ const createProjectClients = async ({ baseUrl, getStorageToken, onStorageTokenRe
|
|
|
968
895
|
token: getStorageToken()
|
|
969
896
|
};
|
|
970
897
|
const attach = createAttachStorageToken(getStorageToken);
|
|
971
|
-
const
|
|
898
|
+
const stackInfo = await require_storage.createStorageClient({
|
|
972
899
|
baseUrl,
|
|
973
900
|
auth,
|
|
974
901
|
middlewares: [attach]
|
|
975
|
-
});
|
|
976
|
-
const [stackInfo, sapiToken, devBranches] = await Promise.all([
|
|
977
|
-
_storage.getStackInfo({ exclude: "componentDetails" }),
|
|
978
|
-
_storage.tokens.verify(),
|
|
979
|
-
_storage.branches.getDevBranches()
|
|
980
|
-
]);
|
|
902
|
+
}).getStackInfo({ exclude: "componentDetails" });
|
|
981
903
|
const stack = createStack({
|
|
982
904
|
stackInfo,
|
|
983
905
|
clientServiceUrls
|
|
984
906
|
});
|
|
985
|
-
const defaultBranch = createDefaultBranch({ devBranches });
|
|
986
|
-
const liveProject = createLiveProject({
|
|
987
|
-
initialToken: sapiToken,
|
|
988
|
-
verify: () => _storage.tokens.verify()
|
|
989
|
-
});
|
|
990
|
-
const storageTableStore = createDerivedStore({
|
|
991
|
-
source: liveProject.store,
|
|
992
|
-
build: require_storageTable.createStorageTable,
|
|
993
|
-
dependsOn: (project) => ({
|
|
994
|
-
useLegacyBucketPrefix: !project.hasFeature(require_constants.ProjectFeature.DisableLegacyBucketPrefix),
|
|
995
|
-
hasProtectedDefaultBranch: project.hasFeature(require_constants.ProjectFeature.SoxProtectedDefaultBranch),
|
|
996
|
-
hasStorageBranches: project.hasFeature(require_constants.ProjectFeature.StorageBranches)
|
|
997
|
-
})
|
|
998
|
-
});
|
|
999
|
-
const context = {
|
|
1000
|
-
baseUrl: require_createFetchClient.normalizeBaseUrl(baseUrl),
|
|
1001
|
-
stack,
|
|
1002
|
-
defaultBranch,
|
|
1003
|
-
get project() {
|
|
1004
|
-
return liveProject.getProject();
|
|
1005
|
-
},
|
|
1006
|
-
get st() {
|
|
1007
|
-
return storageTableStore.get();
|
|
1008
|
-
}
|
|
1009
|
-
};
|
|
1010
907
|
const storage = require_storage.createStorageClient({
|
|
1011
908
|
baseUrl,
|
|
1012
909
|
auth,
|
|
1013
|
-
middlewares: middlewareFor("storage", [
|
|
910
|
+
middlewares: middlewareFor("storage", []),
|
|
1014
911
|
onRefreshToken: onStorageTokenRefreshed
|
|
1015
912
|
});
|
|
1016
913
|
const { client: services, meta: serviceMeta } = createServiceClients({
|
|
1017
914
|
baseUrl,
|
|
1018
915
|
auth,
|
|
1019
|
-
getServiceBaseUrl:
|
|
916
|
+
getServiceBaseUrl: stack.getServiceUrl,
|
|
1020
917
|
middlewareFor,
|
|
1021
918
|
attachTokenMiddleware: attach
|
|
1022
919
|
});
|
|
1023
920
|
return {
|
|
1024
|
-
|
|
921
|
+
baseUrl: require_createFetchClient.normalizeBaseUrl(baseUrl),
|
|
922
|
+
stack,
|
|
1025
923
|
serviceMeta,
|
|
1026
924
|
storage,
|
|
1027
925
|
...services,
|
|
1028
926
|
sdk: createSdk({
|
|
1029
927
|
storage,
|
|
1030
|
-
services
|
|
1031
|
-
context
|
|
928
|
+
services
|
|
1032
929
|
})
|
|
1033
930
|
};
|
|
1034
931
|
};
|
|
1035
|
-
|
|
1036
|
-
//#region src/keboola/legacy/keboola.ts
|
|
932
|
+
// src/keboola/legacy/keboola.ts
|
|
1037
933
|
const createLegacyKeboola = (options = {}) => {
|
|
1038
934
|
const config = createConfig();
|
|
1039
935
|
const middlewareFor = createMiddlewareFor(options.middlewares);
|
|
@@ -1113,160 +1009,74 @@ const createLegacyKeboola = (options = {}) => {
|
|
|
1113
1009
|
session
|
|
1114
1010
|
};
|
|
1115
1011
|
};
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
/**
|
|
1119
|
-
* Everything the table constructs: the entries themselves, and the failures reading them produces.
|
|
1120
|
-
*
|
|
1121
|
-
* Nothing here touches the store — a factory takes what it is told and returns a value, so the
|
|
1122
|
-
* namespaces the tables build on can be read without following a dependency.
|
|
1123
|
-
*/
|
|
1124
|
-
const projectEntryId = (baseUrl, projectId) => `${baseUrl}#${projectId}`;
|
|
1125
|
-
/** What every project entry of one stack shares — the one thing a per-stack teardown matches on. */
|
|
1126
|
-
const projectEntryPrefix = (baseUrl) => `${baseUrl}#`;
|
|
1127
|
-
const isUnderStack = (baseUrl) => (id) => id.startsWith(projectEntryPrefix(baseUrl));
|
|
1128
|
-
const anonymousAuth = () => ({ status: "anonymous" });
|
|
1129
|
-
const restoringAuth = () => ({ status: "restoring" });
|
|
1130
|
-
const authenticatedAuth = (credential) => ({
|
|
1131
|
-
status: "authenticated",
|
|
1132
|
-
credential
|
|
1133
|
-
});
|
|
1134
|
-
const credential = (input) => ({
|
|
1135
|
-
...input,
|
|
1136
|
-
issuedAt: Date.now()
|
|
1137
|
-
});
|
|
1138
|
-
const grant = (credential) => credential.type === "token" ? {
|
|
1012
|
+
// src/keboola/bearer/state/auth.ts
|
|
1013
|
+
const grantOf = (credential) => credential.type === "token" ? {
|
|
1139
1014
|
type: "token",
|
|
1140
1015
|
refreshToken: credential.refreshToken
|
|
1141
1016
|
} : {
|
|
1142
1017
|
type: "cookie",
|
|
1143
1018
|
sessionId: credential.sessionId
|
|
1144
1019
|
};
|
|
1145
|
-
const
|
|
1146
|
-
...
|
|
1147
|
-
issuedAt: Date.now()
|
|
1148
|
-
});
|
|
1149
|
-
const stack = (baseUrl) => ({
|
|
1150
|
-
baseUrl,
|
|
1151
|
-
context: "idle",
|
|
1152
|
-
epoch: 0,
|
|
1153
|
-
auth: anonymousAuth(),
|
|
1154
|
-
retained: null
|
|
1155
|
-
});
|
|
1156
|
-
const project = (baseUrl, projectId) => ({
|
|
1157
|
-
id: projectEntryId(baseUrl, projectId),
|
|
1158
|
-
baseUrl,
|
|
1159
|
-
projectId,
|
|
1160
|
-
context: "idle"
|
|
1161
|
-
});
|
|
1162
|
-
const stackAddress = (baseUrl) => ({
|
|
1163
|
-
baseUrl,
|
|
1164
|
-
projectId: null
|
|
1165
|
-
});
|
|
1166
|
-
const projectAddress = (baseUrl, projectId) => ({
|
|
1167
|
-
baseUrl,
|
|
1168
|
-
projectId
|
|
1169
|
-
});
|
|
1170
|
-
const table = (defaultBaseUrl) => ({
|
|
1171
|
-
active: stackAddress(defaultBaseUrl),
|
|
1172
|
-
stacks: { [defaultBaseUrl]: stack(defaultBaseUrl) },
|
|
1173
|
-
projects: {}
|
|
1020
|
+
const stamped = (input) => ({
|
|
1021
|
+
...input,
|
|
1022
|
+
issuedAt: Date.now()
|
|
1174
1023
|
});
|
|
1175
|
-
const
|
|
1176
|
-
projectEntryId,
|
|
1177
|
-
isUnderStack,
|
|
1178
|
-
stack,
|
|
1179
|
-
project,
|
|
1180
|
-
stackAddress,
|
|
1181
|
-
projectAddress,
|
|
1182
|
-
table,
|
|
1183
|
-
anonymousAuth,
|
|
1184
|
-
restoringAuth,
|
|
1185
|
-
authenticatedAuth,
|
|
1186
|
-
credential,
|
|
1187
|
-
grant,
|
|
1188
|
-
expiredCredential
|
|
1189
|
-
};
|
|
1190
|
-
/**
|
|
1191
|
-
* Every failure the table can produce.
|
|
1192
|
-
*
|
|
1193
|
-
* - The typed ones carry a `KeboolaErrorType` a consumer branches on; the rest are plain `Error`s
|
|
1194
|
-
* whose message names the entry, because nothing branches on them.
|
|
1195
|
-
*/
|
|
1196
|
-
const Errors = {
|
|
1197
|
-
notAuthenticated: () => new KeboolaError(KeboolaErrorType.NotAuthenticated),
|
|
1198
|
-
stackActive: () => new KeboolaError(KeboolaErrorType.StackActive),
|
|
1199
|
-
/** A stack that was never opened — nothing has been configured for it. */
|
|
1200
|
-
unconfigured: () => new KeboolaError(KeboolaErrorType.Unconfigured),
|
|
1201
|
-
alreadyAuthenticated: () => new KeboolaError(KeboolaErrorType.AlreadyAuthenticated),
|
|
1202
|
-
notReady: () => new KeboolaError(KeboolaErrorType.NotReady),
|
|
1203
|
-
alreadyRestoring: (baseUrl) => /* @__PURE__ */ new Error(`Stack "${baseUrl}" is already being restored`),
|
|
1204
|
-
notRestoring: (baseUrl) => /* @__PURE__ */ new Error(`Stack "${baseUrl}" is not being restored`),
|
|
1205
|
-
grantTypeChanged: (from, to) => /* @__PURE__ */ new Error(`A ${from} grant cannot become ${to}`),
|
|
1206
|
-
nothingRetained: (baseUrl) => /* @__PURE__ */ new Error(`Stack "${baseUrl}" retains no credential`),
|
|
1207
|
-
missingProject: (id) => /* @__PURE__ */ new Error(`No project "${id}"`)
|
|
1208
|
-
};
|
|
1209
|
-
const authenticated = (auth) => auth.status === "authenticated" ? require_transientRetries.Result.success(auth.credential) : require_transientRetries.Result.failure(Errors.notAuthenticated());
|
|
1210
|
-
//#endregion
|
|
1211
|
-
//#region src/keboola/bearer/state/auth.ts
|
|
1212
|
-
/**
|
|
1213
|
-
* Fire-once per sign-in: the first report of a dead credential returns `true`, the rest `false`,
|
|
1214
|
-
* and `authenticate` re-arms it. Held beside the table because it is not state anyone restores.
|
|
1215
|
-
*/
|
|
1216
|
-
const createExpiryLatch = () => {
|
|
1217
|
-
const notified = /* @__PURE__ */ new Map();
|
|
1218
|
-
return {
|
|
1219
|
-
arm: (baseUrl) => notified.set(baseUrl, false),
|
|
1220
|
-
forget: (baseUrl) => notified.delete(baseUrl),
|
|
1221
|
-
report: (baseUrl) => {
|
|
1222
|
-
if (notified.get(baseUrl)) return false;
|
|
1223
|
-
notified.set(baseUrl, true);
|
|
1224
|
-
return true;
|
|
1225
|
-
}
|
|
1226
|
-
};
|
|
1227
|
-
};
|
|
1024
|
+
const credentialOf = (auth) => auth.status === "authenticated" ? require_transientRetries.Result.success(auth.credential) : require_transientRetries.Result.failure(new KeboolaError(KeboolaErrorType.NotAuthenticated));
|
|
1228
1025
|
/**
|
|
1229
1026
|
* The stack's credential and its sign-in pin.
|
|
1230
1027
|
*
|
|
1231
1028
|
* - `epoch` moves on `authenticate` and `signOut` and never on a rotation, so it is exactly "which
|
|
1232
1029
|
* sign-in is this" — what an in-flight exchange compares itself against.
|
|
1233
1030
|
*/
|
|
1234
|
-
const createAuth = (
|
|
1235
|
-
const
|
|
1236
|
-
const
|
|
1237
|
-
const
|
|
1031
|
+
const createAuth = (stacks) => {
|
|
1032
|
+
const expired = /* @__PURE__ */ new Set();
|
|
1033
|
+
const requireCredential = (baseUrl) => require_transientRetries.Result.andThen(stacks.get(baseUrl), (stack) => credentialOf(stack.auth));
|
|
1034
|
+
const requireUnauthenticated = (baseUrl) => require_transientRetries.Result.andThen(stacks.get(baseUrl), (stack) => stack.auth.status === "authenticated" ? require_transientRetries.Result.failure(new KeboolaError(KeboolaErrorType.AlreadyAuthenticated)) : require_transientRetries.Result.success(stack));
|
|
1035
|
+
const requireAnonymous = (baseUrl) => require_transientRetries.Result.andThen(requireUnauthenticated(baseUrl), (stack) => stack.auth.status === "restoring" ? require_transientRetries.Result.failure(/* @__PURE__ */ new Error(`Stack "${baseUrl}" is already being restored`)) : require_transientRetries.Result.success(stack));
|
|
1036
|
+
const requireRestoring = (baseUrl) => require_transientRetries.Result.andThen(stacks.get(baseUrl), (stack) => stack.auth.status === "restoring" ? require_transientRetries.Result.success(stack) : require_transientRetries.Result.failure(/* @__PURE__ */ new Error(`Stack "${baseUrl}" is not being restored`)));
|
|
1238
1037
|
const startRestore = (baseUrl) => require_transientRetries.Result.map(requireAnonymous(baseUrl), (stack) => stacks.set({
|
|
1239
1038
|
...stack,
|
|
1240
|
-
auth:
|
|
1039
|
+
auth: { status: "restoring" }
|
|
1241
1040
|
}));
|
|
1242
1041
|
const cancelRestore = (baseUrl) => require_transientRetries.Result.map(requireRestoring(baseUrl), (stack) => stacks.set({
|
|
1243
1042
|
...stack,
|
|
1244
|
-
auth:
|
|
1043
|
+
auth: { status: "anonymous" }
|
|
1245
1044
|
}));
|
|
1246
1045
|
const authenticate = (baseUrl, input) => require_transientRetries.Result.map(requireUnauthenticated(baseUrl), (stack) => {
|
|
1247
|
-
|
|
1046
|
+
expired.delete(baseUrl);
|
|
1248
1047
|
return stacks.set({
|
|
1249
1048
|
...stack,
|
|
1250
1049
|
epoch: stack.epoch + 1,
|
|
1251
|
-
auth:
|
|
1050
|
+
auth: {
|
|
1051
|
+
status: "authenticated",
|
|
1052
|
+
credential: stamped(input)
|
|
1053
|
+
},
|
|
1252
1054
|
retained: null
|
|
1253
1055
|
});
|
|
1254
1056
|
});
|
|
1255
|
-
const applyRefresh = (baseUrl, input) => require_transientRetries.Result.andThen(
|
|
1057
|
+
const applyRefresh = (baseUrl, input) => require_transientRetries.Result.andThen(requireCredential(baseUrl), (credential) => credential.type !== input.type ? require_transientRetries.Result.failure(/* @__PURE__ */ new Error(`A ${credential.type} grant cannot become ${input.type}`)) : require_transientRetries.Result.map(stacks.get(baseUrl), (stack) => stacks.set({
|
|
1256
1058
|
...stack,
|
|
1257
|
-
auth:
|
|
1059
|
+
auth: {
|
|
1060
|
+
status: "authenticated",
|
|
1061
|
+
credential: stamped(input)
|
|
1062
|
+
}
|
|
1258
1063
|
})));
|
|
1259
|
-
const forceExpire = (baseUrl) => require_transientRetries.Result.andThen(
|
|
1064
|
+
const forceExpire = (baseUrl) => require_transientRetries.Result.andThen(requireCredential(baseUrl), (credential) => require_transientRetries.Result.map(stacks.get(baseUrl), (stack) => stacks.set({
|
|
1260
1065
|
...stack,
|
|
1261
|
-
auth:
|
|
1066
|
+
auth: {
|
|
1067
|
+
status: "authenticated",
|
|
1068
|
+
credential: {
|
|
1069
|
+
...credential,
|
|
1070
|
+
issuedAt: Date.now() - credential.expiresIn * 1e3
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1262
1073
|
})));
|
|
1263
1074
|
const signOut = (baseUrl, { retain = false } = {}) => require_transientRetries.Result.map(stacks.get(baseUrl), (stack) => {
|
|
1264
|
-
|
|
1265
|
-
const retained = retain ? require_transientRetries.Result.unwrapOr(require_transientRetries.Result.map(authenticated(stack.auth), (credential) => ({ grant: Entry.grant(credential) })), stack.retained) : null;
|
|
1075
|
+
const retained = retain ? require_transientRetries.Result.unwrapOr(require_transientRetries.Result.map(credentialOf(stack.auth), (credential) => ({ grant: grantOf(credential) })), stack.retained) : null;
|
|
1266
1076
|
return stacks.set({
|
|
1267
1077
|
...stack,
|
|
1268
1078
|
epoch: stack.epoch + 1,
|
|
1269
|
-
auth:
|
|
1079
|
+
auth: { status: "anonymous" },
|
|
1270
1080
|
retained
|
|
1271
1081
|
});
|
|
1272
1082
|
});
|
|
@@ -1278,9 +1088,14 @@ const createAuth = ({ stacks, projects, expiry }) => {
|
|
|
1278
1088
|
...stack,
|
|
1279
1089
|
retained: null
|
|
1280
1090
|
}));
|
|
1281
|
-
const requireRetained = (baseUrl) => require_transientRetries.Result.andThen(stacks.get(baseUrl), (stack) => stack.retained ? require_transientRetries.Result.success(stack.retained) : require_transientRetries.Result.failure(
|
|
1091
|
+
const requireRetained = (baseUrl) => require_transientRetries.Result.andThen(stacks.get(baseUrl), (stack) => stack.retained ? require_transientRetries.Result.success(stack.retained) : require_transientRetries.Result.failure(/* @__PURE__ */ new Error(`Stack "${baseUrl}" retains no credential`)));
|
|
1092
|
+
const notifyExpired = (baseUrl) => {
|
|
1093
|
+
if (expired.has(baseUrl)) return false;
|
|
1094
|
+
expired.add(baseUrl);
|
|
1095
|
+
return true;
|
|
1096
|
+
};
|
|
1282
1097
|
const getEpoch = (baseUrl) => require_transientRetries.Result.map(stacks.get(baseUrl), (stack) => stack.epoch);
|
|
1283
|
-
const getAccessToken = (baseUrl) => require_transientRetries.Result.unwrapOr(require_transientRetries.Result.map(
|
|
1098
|
+
const getAccessToken = (baseUrl) => require_transientRetries.Result.unwrapOr(require_transientRetries.Result.map(requireCredential(baseUrl), ({ accessToken }) => accessToken), null);
|
|
1284
1099
|
return {
|
|
1285
1100
|
startRestore,
|
|
1286
1101
|
cancelRestore,
|
|
@@ -1291,171 +1106,26 @@ const createAuth = ({ stacks, projects, expiry }) => {
|
|
|
1291
1106
|
retain,
|
|
1292
1107
|
dropRetained,
|
|
1293
1108
|
requireRetained,
|
|
1294
|
-
notifyExpired
|
|
1295
|
-
requireCredential
|
|
1109
|
+
notifyExpired,
|
|
1110
|
+
requireCredential,
|
|
1296
1111
|
getEpoch,
|
|
1297
1112
|
getAccessToken
|
|
1298
1113
|
};
|
|
1299
1114
|
};
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
/** Every open project with this id, whatever stack it sits on — a project number is not unique. */
|
|
1311
|
-
const findAll = (projectId) => Object.values(store.get().projects).filter((project) => project.projectId === projectId);
|
|
1312
|
-
const set = (project) => {
|
|
1313
|
-
const state = store.get();
|
|
1314
|
-
store.set({
|
|
1315
|
-
...state,
|
|
1316
|
-
projects: {
|
|
1317
|
-
...state.projects,
|
|
1318
|
-
[project.id]: project
|
|
1319
|
-
}
|
|
1320
|
-
});
|
|
1321
|
-
return project;
|
|
1322
|
-
};
|
|
1323
|
-
const update = (id, updater) => require_transientRetries.Result.map(get(id), (project) => set(updater(project)));
|
|
1324
|
-
const removeMany = (ids, nextActive) => {
|
|
1325
|
-
const state = store.get();
|
|
1326
|
-
const projects = { ...state.projects };
|
|
1327
|
-
for (const id of ids) delete projects[id];
|
|
1328
|
-
store.set({
|
|
1329
|
-
...state,
|
|
1330
|
-
active: nextActive,
|
|
1331
|
-
projects
|
|
1332
|
-
});
|
|
1333
|
-
};
|
|
1334
|
-
const requireCredential = (id) => require_transientRetries.Result.andThen(get(id), (project) => stacks.requireCredential(project.baseUrl));
|
|
1335
|
-
const open = (baseUrl, projectId) => {
|
|
1336
|
-
const id = Entry.projectEntryId(baseUrl, projectId);
|
|
1337
|
-
if (has(id)) return get(id);
|
|
1338
|
-
return require_transientRetries.Result.map(stacks.requireCredential(baseUrl), () => set(Entry.project(baseUrl, projectId)));
|
|
1339
|
-
};
|
|
1340
|
-
const close = (id) => require_transientRetries.Result.tap(get(id), ({ baseUrl, projectId }) => {
|
|
1341
|
-
const { active } = store.get();
|
|
1342
|
-
const isScoped = active.baseUrl === baseUrl && active.projectId === projectId;
|
|
1343
|
-
removeMany([id], isScoped ? Entry.stackAddress(baseUrl) : active);
|
|
1344
|
-
});
|
|
1345
|
-
/** Every project under a stack, with the scope falling back to the stack itself. */
|
|
1346
|
-
const closeAll = (baseUrl) => {
|
|
1347
|
-
const ids = list(baseUrl).map((project) => project.id);
|
|
1348
|
-
const { active } = store.get();
|
|
1349
|
-
removeMany(ids, active.baseUrl === baseUrl ? Entry.stackAddress(baseUrl) : active);
|
|
1350
|
-
};
|
|
1351
|
-
const updateContext = (id, context) => update(id, (project) => ({
|
|
1352
|
-
...project,
|
|
1353
|
-
context
|
|
1354
|
-
}));
|
|
1355
|
-
return {
|
|
1356
|
-
has,
|
|
1357
|
-
get,
|
|
1358
|
-
list,
|
|
1359
|
-
findAll,
|
|
1360
|
-
set,
|
|
1361
|
-
update,
|
|
1362
|
-
open,
|
|
1363
|
-
close,
|
|
1364
|
-
closeAll,
|
|
1365
|
-
updateContext,
|
|
1366
|
-
requireCredential
|
|
1367
|
-
};
|
|
1368
|
-
};
|
|
1369
|
-
//#endregion
|
|
1370
|
-
//#region src/keboola/bearer/state/scope.ts
|
|
1371
|
-
/**
|
|
1372
|
-
* What `api.*` addresses: the `active` slot, and the address in it resolved against the tables it
|
|
1373
|
-
* points into.
|
|
1374
|
-
*
|
|
1375
|
-
* The tables never write here — they read `active` through the pure helpers in `address.ts`, so
|
|
1376
|
-
* that this can depend on them rather than the other way round.
|
|
1377
|
-
*/
|
|
1378
|
-
const createScope = ({ store, stacks, projects }) => {
|
|
1379
|
-
const get = () => store.get().active;
|
|
1380
|
-
const isSame = (a, b) => a === b || a.baseUrl === b.baseUrl && a.projectId === b.projectId;
|
|
1381
|
-
const set = (active) => {
|
|
1382
|
-
if (isSame(store.get().active, active)) return;
|
|
1383
|
-
store.set({
|
|
1384
|
-
...store.get(),
|
|
1385
|
-
active
|
|
1386
|
-
});
|
|
1387
|
-
};
|
|
1388
|
-
const locate = (active) => {
|
|
1389
|
-
const stack = stacks.get(active.baseUrl);
|
|
1390
|
-
if (!stack.success) return null;
|
|
1391
|
-
if (active.projectId === null) return {
|
|
1392
|
-
stack: stack.data,
|
|
1393
|
-
project: null
|
|
1394
|
-
};
|
|
1395
|
-
const project = projects.get(Entry.projectEntryId(active.baseUrl, active.projectId));
|
|
1396
|
-
if (!project.success) return null;
|
|
1397
|
-
return {
|
|
1398
|
-
stack: stack.data,
|
|
1399
|
-
project: project.data
|
|
1400
|
-
};
|
|
1401
|
-
};
|
|
1402
|
-
const getActive = () => {
|
|
1403
|
-
const location = locate(get());
|
|
1404
|
-
if (!location) throw new Error(`The scope names no row: ${JSON.stringify(get())}`);
|
|
1405
|
-
return location;
|
|
1406
|
-
};
|
|
1407
|
-
const getActiveStack = () => getActive().stack;
|
|
1408
|
-
const activateStack = (baseUrl) => require_transientRetries.Result.map(stacks.get(baseUrl), (stack) => {
|
|
1409
|
-
const next = Entry.stackAddress(stack.baseUrl);
|
|
1410
|
-
set(next);
|
|
1411
|
-
return next;
|
|
1412
|
-
});
|
|
1413
|
-
const activateProject = (baseUrl, projectId) => require_transientRetries.Result.map(projects.requireCredential(Entry.projectEntryId(baseUrl, projectId)), () => {
|
|
1414
|
-
const next = Entry.projectAddress(baseUrl, projectId);
|
|
1415
|
-
set(next);
|
|
1416
|
-
return next;
|
|
1417
|
-
});
|
|
1418
|
-
const selectStack = (baseUrl) => {
|
|
1419
|
-
const stack = stacks.ensure(baseUrl);
|
|
1420
|
-
return require_transientRetries.Result.map(activateStack(stack.baseUrl), () => stack);
|
|
1421
|
-
};
|
|
1422
|
-
const selectProject = (projectId) => {
|
|
1423
|
-
const { baseUrl } = getActiveStack();
|
|
1424
|
-
const project = projects.open(baseUrl, projectId);
|
|
1425
|
-
if (!project.success) return project;
|
|
1426
|
-
return require_transientRetries.Result.map(activateProject(baseUrl, projectId), () => project.data);
|
|
1427
|
-
};
|
|
1428
|
-
const deactivate = () => {
|
|
1429
|
-
const active = get();
|
|
1430
|
-
if (active.projectId === null) return;
|
|
1431
|
-
set(Entry.stackAddress(active.baseUrl));
|
|
1432
|
-
};
|
|
1433
|
-
const requireActiveProject = () => {
|
|
1434
|
-
const { project } = getActive();
|
|
1435
|
-
return project ? require_transientRetries.Result.success(project) : require_transientRetries.Result.failure(Errors.notReady());
|
|
1436
|
-
};
|
|
1437
|
-
return {
|
|
1438
|
-
get,
|
|
1439
|
-
getActive,
|
|
1440
|
-
activateStack,
|
|
1441
|
-
activateProject,
|
|
1442
|
-
selectStack,
|
|
1443
|
-
selectProject,
|
|
1444
|
-
deactivate,
|
|
1445
|
-
getActiveStack,
|
|
1446
|
-
requireActiveProject
|
|
1447
|
-
};
|
|
1448
|
-
};
|
|
1449
|
-
//#endregion
|
|
1450
|
-
//#region src/keboola/bearer/state/stacks.ts
|
|
1451
|
-
/** One entry per stack: the entries, and the verbs that open and close them. */
|
|
1452
|
-
const createStacks = ({ store, forgetExpiry }) => {
|
|
1453
|
-
const has = (baseUrl) => baseUrl in store.get().stacks;
|
|
1115
|
+
// src/keboola/bearer/state/stacks.ts
|
|
1116
|
+
const newStack = (baseUrl) => ({
|
|
1117
|
+
baseUrl,
|
|
1118
|
+
context: "idle",
|
|
1119
|
+
epoch: 0,
|
|
1120
|
+
auth: { status: "anonymous" },
|
|
1121
|
+
retained: null
|
|
1122
|
+
});
|
|
1123
|
+
/** One entry per stack, and the verbs that open and select them. */
|
|
1124
|
+
const createStacks = (store) => {
|
|
1454
1125
|
const get = (baseUrl) => {
|
|
1455
1126
|
const stack = store.get().stacks[baseUrl];
|
|
1456
|
-
return stack ? require_transientRetries.Result.success(stack) : require_transientRetries.Result.failure(
|
|
1127
|
+
return stack ? require_transientRetries.Result.success(stack) : require_transientRetries.Result.failure(new KeboolaError(KeboolaErrorType.Unconfigured));
|
|
1457
1128
|
};
|
|
1458
|
-
const list = () => Object.values(store.get().stacks);
|
|
1459
1129
|
const set = (stack) => {
|
|
1460
1130
|
const state = store.get();
|
|
1461
1131
|
store.set({
|
|
@@ -1468,26 +1138,24 @@ const createStacks = ({ store, forgetExpiry }) => {
|
|
|
1468
1138
|
return stack;
|
|
1469
1139
|
};
|
|
1470
1140
|
const update = (baseUrl, updater) => require_transientRetries.Result.map(get(baseUrl), (stack) => set(updater(stack)));
|
|
1471
|
-
const requireCredential = (baseUrl) => require_transientRetries.Result.andThen(get(baseUrl), (stack) => authenticated(stack.auth));
|
|
1472
1141
|
const ensure = (baseUrl) => {
|
|
1473
1142
|
const existing = get(baseUrl);
|
|
1474
1143
|
if (existing.success) return existing.data;
|
|
1475
|
-
return set(
|
|
1144
|
+
return set(newStack(baseUrl));
|
|
1145
|
+
};
|
|
1146
|
+
const getActive = () => {
|
|
1147
|
+
const { active } = store.get();
|
|
1148
|
+
const stack = get(active);
|
|
1149
|
+
if (!stack.success) throw new Error(`The active stack has no row: ${active}`);
|
|
1150
|
+
return stack.data;
|
|
1476
1151
|
};
|
|
1477
|
-
const
|
|
1478
|
-
const stack =
|
|
1479
|
-
if (!stack.success) return stack;
|
|
1152
|
+
const select = (baseUrl) => {
|
|
1153
|
+
const stack = ensure(baseUrl);
|
|
1480
1154
|
const state = store.get();
|
|
1481
|
-
if (state.active
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
const projects = Object.fromEntries(Object.entries(state.projects).filter(([, project]) => project.baseUrl !== baseUrl));
|
|
1485
|
-
store.set({
|
|
1486
|
-
active: state.active,
|
|
1487
|
-
stacks,
|
|
1488
|
-
projects
|
|
1155
|
+
if (state.active !== baseUrl) store.set({
|
|
1156
|
+
...state,
|
|
1157
|
+
active: baseUrl
|
|
1489
1158
|
});
|
|
1490
|
-
forgetExpiry(baseUrl);
|
|
1491
1159
|
return stack;
|
|
1492
1160
|
};
|
|
1493
1161
|
const updateContext = (baseUrl, context) => update(baseUrl, (stack) => ({
|
|
@@ -1495,56 +1163,42 @@ const createStacks = ({ store, forgetExpiry }) => {
|
|
|
1495
1163
|
context
|
|
1496
1164
|
}));
|
|
1497
1165
|
return {
|
|
1498
|
-
has,
|
|
1499
1166
|
get,
|
|
1500
|
-
list,
|
|
1501
1167
|
set,
|
|
1502
1168
|
update,
|
|
1503
1169
|
ensure,
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1170
|
+
getActive,
|
|
1171
|
+
select,
|
|
1172
|
+
updateContext
|
|
1507
1173
|
};
|
|
1508
1174
|
};
|
|
1509
|
-
|
|
1510
|
-
//#region src/keboola/bearer/state/state.ts
|
|
1175
|
+
// src/keboola/bearer/state/state.ts
|
|
1511
1176
|
/**
|
|
1512
1177
|
* The stack table and the rules over it, one namespace per concern.
|
|
1513
1178
|
*
|
|
1514
|
-
* -
|
|
1515
|
-
* the active address against both tables.
|
|
1179
|
+
* - Starts active on its default stack, which is its one row.
|
|
1516
1180
|
*/
|
|
1517
1181
|
const createState = (defaultBaseUrl) => {
|
|
1518
|
-
const store = require_store.createStore(
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
store,
|
|
1522
|
-
forgetExpiry: expiry.forget
|
|
1523
|
-
});
|
|
1524
|
-
const projects = createProjects({
|
|
1525
|
-
store,
|
|
1526
|
-
stacks
|
|
1527
|
-
});
|
|
1528
|
-
const scope = createScope({
|
|
1529
|
-
store,
|
|
1530
|
-
stacks,
|
|
1531
|
-
projects
|
|
1532
|
-
});
|
|
1533
|
-
const auth = createAuth({
|
|
1534
|
-
stacks,
|
|
1535
|
-
projects,
|
|
1536
|
-
expiry
|
|
1182
|
+
const store = require_store.createStore({
|
|
1183
|
+
active: defaultBaseUrl,
|
|
1184
|
+
stacks: { [defaultBaseUrl]: newStack(defaultBaseUrl) }
|
|
1537
1185
|
});
|
|
1186
|
+
const stacks = createStacks(store);
|
|
1187
|
+
const auth = createAuth(stacks);
|
|
1538
1188
|
return {
|
|
1539
1189
|
store: store.asReadable(),
|
|
1540
1190
|
stacks,
|
|
1541
|
-
|
|
1542
|
-
auth,
|
|
1543
|
-
scope
|
|
1191
|
+
auth
|
|
1544
1192
|
};
|
|
1545
1193
|
};
|
|
1546
|
-
|
|
1547
|
-
|
|
1194
|
+
// src/keboola/bearer/credentials/credentials.ts
|
|
1195
|
+
const DEFAULT_REFRESH_THRESHOLD = .9;
|
|
1196
|
+
const signInEnded = () => new KeboolaError(KeboolaErrorType.SignInEnded);
|
|
1197
|
+
const toRestoreStatus = (outcome) => {
|
|
1198
|
+
if (outcome === void 0 || outcome === "skipped") return "empty";
|
|
1199
|
+
if (outcome === "refused") return "expired";
|
|
1200
|
+
return outcome;
|
|
1201
|
+
};
|
|
1548
1202
|
const renew = async (client, grant) => {
|
|
1549
1203
|
if (grant.type === "cookie") {
|
|
1550
1204
|
const { accessToken, expiresIn, sessionId } = await client.token.refreshWithSession({ sessionId: grant.sessionId });
|
|
@@ -1564,55 +1218,29 @@ const renew = async (client, grant) => {
|
|
|
1564
1218
|
refreshToken
|
|
1565
1219
|
};
|
|
1566
1220
|
};
|
|
1567
|
-
//#endregion
|
|
1568
|
-
//#region src/keboola/bearer/credentials/credentials.ts
|
|
1569
|
-
const DEFAULT_REFRESH_THRESHOLD = .9;
|
|
1570
|
-
const signInEnded = () => new KeboolaError(KeboolaErrorType.SignInEnded);
|
|
1571
|
-
const toRestoreStatus = (outcome) => {
|
|
1572
|
-
if (outcome === void 0 || outcome === "skipped") return "empty";
|
|
1573
|
-
if (outcome === "refused") return "expired";
|
|
1574
|
-
return outcome;
|
|
1575
|
-
};
|
|
1576
1221
|
const createCredentials = ({ state, persistor, middlewares, refreshThreshold = DEFAULT_REFRESH_THRESHOLD, onSignedOut, onExpired }) => {
|
|
1577
1222
|
const rotationMap = /* @__PURE__ */ new Map();
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1223
|
+
const markSignIn = (baseUrl) => {
|
|
1224
|
+
const epoch = require_transientRetries.Result.unwrap(state.auth.getEpoch(baseUrl));
|
|
1225
|
+
return () => require_transientRetries.Result.unwrapOr(state.auth.getEpoch(baseUrl), -1) === epoch;
|
|
1226
|
+
};
|
|
1580
1227
|
const refresh = async (baseUrl, grant) => {
|
|
1581
1228
|
const client = require_authClient.createAuthClient({
|
|
1582
1229
|
baseUrl,
|
|
1583
1230
|
middlewares
|
|
1584
1231
|
});
|
|
1585
|
-
const
|
|
1586
|
-
const generationBefore = generationOf(baseUrl);
|
|
1232
|
+
const isSameSignIn = markSignIn(baseUrl);
|
|
1587
1233
|
const refreshed = await require_transientRetries.Result.tryCatchAsync(() => renew(client, grant));
|
|
1588
|
-
return
|
|
1589
|
-
};
|
|
1590
|
-
/**
|
|
1591
|
-
* A stack's teardown, from the credential's side.
|
|
1592
|
-
*
|
|
1593
|
-
* - Bumps the generation, so an in-flight rotation can no longer write.
|
|
1594
|
-
* - Drops the deduped entry, so nothing joins that rotation.
|
|
1595
|
-
*/
|
|
1596
|
-
const forget = (baseUrl) => {
|
|
1597
|
-
generations.set(baseUrl, generationOf(baseUrl) + 1);
|
|
1598
|
-
rotationMap.delete(baseUrl);
|
|
1234
|
+
return isSameSignIn() ? refreshed : require_transientRetries.Result.failure(signInEnded());
|
|
1599
1235
|
};
|
|
1600
|
-
/**
|
|
1601
|
-
* The rotation, and the one place a credential is declared dead.
|
|
1602
|
-
*
|
|
1603
|
-
* - Renews by the credential's grant: the refresh token, or the session id with the cookie.
|
|
1604
|
-
* - A refused refresh token or session is unambiguous.
|
|
1605
|
-
* - The triggering 401 is not (an unreachable project answers the same), so never sign out on a replay.
|
|
1606
|
-
*/
|
|
1607
1236
|
const getGrantForRotation = async (store, baseUrl, credential) => {
|
|
1608
|
-
const
|
|
1609
|
-
const generationBefore = generationOf(baseUrl);
|
|
1237
|
+
const isSameSignIn = markSignIn(baseUrl);
|
|
1610
1238
|
const hydrated = await require_transientRetries.Result.tryCatchAsync(() => store.read());
|
|
1611
1239
|
if (!hydrated.success) return hydrated;
|
|
1612
|
-
if (
|
|
1240
|
+
if (!isSameSignIn()) return require_transientRetries.Result.failure(signInEnded());
|
|
1613
1241
|
const persistedStack = hydrated.data.stacks.find((stack) => stack.baseUrl === baseUrl);
|
|
1614
1242
|
if (persistedStack && persistedStack.credential === null) return require_transientRetries.Result.failure(signInEnded());
|
|
1615
|
-
return require_transientRetries.Result.success(persistedStack?.credential ??
|
|
1243
|
+
return require_transientRetries.Result.success(persistedStack?.credential ?? grantOf(credential));
|
|
1616
1244
|
};
|
|
1617
1245
|
const rotateOnce = async (baseUrl) => persistor.locked(async (store) => {
|
|
1618
1246
|
const credential = state.auth.requireCredential(baseUrl);
|
|
@@ -1650,17 +1278,6 @@ const createCredentials = ({ state, persistor, middlewares, refreshThreshold = D
|
|
|
1650
1278
|
await store.persistStack(baseUrl, state.store.get());
|
|
1651
1279
|
return "restored";
|
|
1652
1280
|
});
|
|
1653
|
-
const restoreProjects = (baseUrl, projects) => {
|
|
1654
|
-
for (const { projectId } of projects) state.projects.open(baseUrl, projectId);
|
|
1655
|
-
};
|
|
1656
|
-
/**
|
|
1657
|
-
* Every persisted stack back into the table, with whatever credential it can hand back.
|
|
1658
|
-
*
|
|
1659
|
-
* - Never writes the scope. `lastActive` is what was scoped when the session was stored, for the
|
|
1660
|
-
* caller to select.
|
|
1661
|
-
* - `status` reports what became of `lastActive`'s credential; the client reads it to decide
|
|
1662
|
-
* when persistence may start.
|
|
1663
|
-
*/
|
|
1664
1281
|
const restore = async () => {
|
|
1665
1282
|
const hydrated = await persistor.locked((store) => store.read()).catch((error) => {
|
|
1666
1283
|
console.warn("createCredentials: the stored session could not be read", error);
|
|
@@ -1672,15 +1289,13 @@ const createCredentials = ({ state, persistor, middlewares, refreshThreshold = D
|
|
|
1672
1289
|
};
|
|
1673
1290
|
const { stacks, current } = hydrated;
|
|
1674
1291
|
const scoped = stacks.find(({ baseUrl }) => baseUrl === current?.baseUrl);
|
|
1675
|
-
const restored = stacks.map(async ({ baseUrl, credential, retained
|
|
1292
|
+
const restored = stacks.map(async ({ baseUrl, credential, retained }) => {
|
|
1676
1293
|
state.stacks.ensure(baseUrl);
|
|
1677
1294
|
if (!credential && !retained) return "unreachable";
|
|
1678
1295
|
if (require_transientRetries.Result.unwrapOr(state.auth.getEpoch(baseUrl), 0) > 0) return "skipped";
|
|
1679
1296
|
if (retained) state.auth.retain(baseUrl, retained);
|
|
1680
1297
|
if (!credential) return "unreachable";
|
|
1681
|
-
|
|
1682
|
-
if (outcome === "restored") restoreProjects(baseUrl, projects);
|
|
1683
|
-
return outcome;
|
|
1298
|
+
return restoreStack(baseUrl, credential);
|
|
1684
1299
|
});
|
|
1685
1300
|
const results = await Promise.all(restored);
|
|
1686
1301
|
const scopedOutcome = scoped?.credential ? results[stacks.indexOf(scoped)] : void 0;
|
|
@@ -1689,23 +1304,12 @@ const createCredentials = ({ state, persistor, middlewares, refreshThreshold = D
|
|
|
1689
1304
|
status: toRestoreStatus(scopedOutcome)
|
|
1690
1305
|
};
|
|
1691
1306
|
};
|
|
1692
|
-
/**
|
|
1693
|
-
* Signs a retained stack back in from the grant it kept.
|
|
1694
|
-
*
|
|
1695
|
-
* - `restored` and `refused` empty the slot; `unreachable` keeps it for another try.
|
|
1696
|
-
* - Throws when the stack retains nothing.
|
|
1697
|
-
*/
|
|
1698
1307
|
const restoreRetained = async (baseUrl) => {
|
|
1699
1308
|
const { grant } = require_transientRetries.Result.unwrap(state.auth.requireRetained(baseUrl));
|
|
1700
1309
|
return restoreStack(baseUrl, grant, true);
|
|
1701
1310
|
};
|
|
1702
|
-
const isStale = (baseUrl) => {
|
|
1703
|
-
const ageing = require_transientRetries.Result.map(state.auth.requireCredential(baseUrl), ({ issuedAt, expiresIn }) => Date.now() >= issuedAt + expiresIn * 1e3 * refreshThreshold);
|
|
1704
|
-
return require_transientRetries.Result.unwrapOr(ageing, false);
|
|
1705
|
-
};
|
|
1706
1311
|
/**
|
|
1707
|
-
* Drops the
|
|
1708
|
-
*
|
|
1312
|
+
* - Drops the rotation, so the next sign-in's requests don't join the dying one.
|
|
1709
1313
|
* - Writes nothing: the caller persists the stack, under the lock it holds or takes.
|
|
1710
1314
|
*/
|
|
1711
1315
|
const signOut = (baseUrl, options) => {
|
|
@@ -1721,7 +1325,8 @@ const createCredentials = ({ state, persistor, middlewares, refreshThreshold = D
|
|
|
1721
1325
|
onExpired?.(baseUrl);
|
|
1722
1326
|
};
|
|
1723
1327
|
const renewIfStale = async (baseUrl) => {
|
|
1724
|
-
|
|
1328
|
+
const isStale = require_transientRetries.Result.map(state.auth.requireCredential(baseUrl), ({ issuedAt, expiresIn }) => Date.now() >= issuedAt + expiresIn * 1e3 * refreshThreshold);
|
|
1329
|
+
if (require_transientRetries.Result.unwrapOr(isStale, false)) await rotate(baseUrl);
|
|
1725
1330
|
};
|
|
1726
1331
|
const middleware = (baseUrl) => require_middleware.createBearerAuthMiddleware({ getAccessToken: async ({ forceRefresh = false } = {}) => {
|
|
1727
1332
|
if (forceRefresh) {
|
|
@@ -1737,186 +1342,18 @@ const createCredentials = ({ state, persistor, middlewares, refreshThreshold = D
|
|
|
1737
1342
|
renewIfStale,
|
|
1738
1343
|
restore,
|
|
1739
1344
|
restoreRetained,
|
|
1740
|
-
signOut
|
|
1741
|
-
forget
|
|
1345
|
+
signOut
|
|
1742
1346
|
};
|
|
1743
1347
|
};
|
|
1744
|
-
|
|
1745
|
-
|
|
1348
|
+
// src/keboola/bearer/perProject.ts
|
|
1349
|
+
const projectKey = ({ baseUrl, projectId }) => `${baseUrl}#${projectId}`;
|
|
1746
1350
|
/**
|
|
1747
|
-
*
|
|
1748
|
-
* request. Backs the stack and project contexts.
|
|
1351
|
+
* One handle per project, and the one call that drops it.
|
|
1749
1352
|
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1752
|
-
* - Status lives here and nowhere else; a consumer that has to mirror it subscribes.
|
|
1353
|
+
* Every client belongs to the credential that built it — a client set carries its middleware
|
|
1354
|
+
* chain — so the handle dies with the sign-in, and `forgetUnder` is the only thing that ends one.
|
|
1753
1355
|
*/
|
|
1754
|
-
const
|
|
1755
|
-
const entries = /* @__PURE__ */ new Map();
|
|
1756
|
-
const changes = require_store.createEmitter();
|
|
1757
|
-
const set = (id, entry) => {
|
|
1758
|
-
entries.set(id, entry);
|
|
1759
|
-
changes.emit({
|
|
1760
|
-
key: id,
|
|
1761
|
-
status: entry.status
|
|
1762
|
-
});
|
|
1763
|
-
};
|
|
1764
|
-
const run = (id, input) => {
|
|
1765
|
-
const settle = (next) => {
|
|
1766
|
-
if (entries.get(id) === entry) set(id, {
|
|
1767
|
-
input,
|
|
1768
|
-
...next
|
|
1769
|
-
});
|
|
1770
|
-
return next;
|
|
1771
|
-
};
|
|
1772
|
-
const attempt = async () => await fetch(input);
|
|
1773
|
-
const entry = {
|
|
1774
|
-
input,
|
|
1775
|
-
status: "pending",
|
|
1776
|
-
settled: attempt().then((value) => settle({
|
|
1777
|
-
status: "ready",
|
|
1778
|
-
value
|
|
1779
|
-
}), (error) => settle({
|
|
1780
|
-
status: "errored",
|
|
1781
|
-
error
|
|
1782
|
-
}))
|
|
1783
|
-
};
|
|
1784
|
-
set(id, entry);
|
|
1785
|
-
return entry;
|
|
1786
|
-
};
|
|
1787
|
-
const get = (id) => {
|
|
1788
|
-
const entry = entries.get(id);
|
|
1789
|
-
return entry?.status === "ready" ? entry.value : null;
|
|
1790
|
-
};
|
|
1791
|
-
const getAsync = async (input) => {
|
|
1792
|
-
const id = key(input);
|
|
1793
|
-
const cached = entries.get(id);
|
|
1794
|
-
const entry = cached === void 0 || cached.status === "errored" ? run(id, input) : cached;
|
|
1795
|
-
const settled = entry.status === "pending" ? await entry.settled : entry;
|
|
1796
|
-
if (settled.status === "errored") throw settled.error;
|
|
1797
|
-
return settled.value;
|
|
1798
|
-
};
|
|
1799
|
-
const forget = (matches) => {
|
|
1800
|
-
for (const id of entries.keys()) if (matches(id)) entries.delete(id);
|
|
1801
|
-
};
|
|
1802
|
-
const prefetch = (input) => {
|
|
1803
|
-
const id = key(input);
|
|
1804
|
-
if (!entries.has(id)) run(id, input);
|
|
1805
|
-
};
|
|
1806
|
-
const retry = (id) => {
|
|
1807
|
-
const entry = entries.get(id);
|
|
1808
|
-
if (entry !== void 0) run(id, entry.input);
|
|
1809
|
-
};
|
|
1810
|
-
return {
|
|
1811
|
-
get,
|
|
1812
|
-
getAsync,
|
|
1813
|
-
prefetch,
|
|
1814
|
-
retry,
|
|
1815
|
-
forget,
|
|
1816
|
-
subscribe: changes.subscribe
|
|
1817
|
-
};
|
|
1818
|
-
};
|
|
1819
|
-
//#endregion
|
|
1820
|
-
//#region src/keboola/bearer/context/project.ts
|
|
1821
|
-
const createProjectContext = ({ state, credentials, stackContext }) => {
|
|
1822
|
-
const resource = createResource({
|
|
1823
|
-
key: (project) => project.id,
|
|
1824
|
-
fetch: async ({ baseUrl, projectId }) => {
|
|
1825
|
-
const withProjectId = (next) => (request) => {
|
|
1826
|
-
request.request.headers.set(require_createFetchClient.KeboolaHttpHeader.PROJECT_ID, String(projectId));
|
|
1827
|
-
return next(request);
|
|
1828
|
-
};
|
|
1829
|
-
const client = require_storage.createStorageClient({
|
|
1830
|
-
baseUrl,
|
|
1831
|
-
auth: {
|
|
1832
|
-
type: "bearer",
|
|
1833
|
-
token: "",
|
|
1834
|
-
projectId
|
|
1835
|
-
},
|
|
1836
|
-
middlewares: [(next) => withProjectId(credentials.middleware(baseUrl)(next))]
|
|
1837
|
-
});
|
|
1838
|
-
const [token, devBranches] = await Promise.all([
|
|
1839
|
-
client.tokens.verify(),
|
|
1840
|
-
client.branches.getDevBranches(),
|
|
1841
|
-
stackContext.getAsync(baseUrl)
|
|
1842
|
-
]);
|
|
1843
|
-
return {
|
|
1844
|
-
token,
|
|
1845
|
-
defaultBranch: createDefaultBranch({ devBranches })
|
|
1846
|
-
};
|
|
1847
|
-
}
|
|
1848
|
-
});
|
|
1849
|
-
resource.subscribe(({ key, status }) => {
|
|
1850
|
-
state.projects.updateContext(key, status);
|
|
1851
|
-
});
|
|
1852
|
-
const subscriber = ({ projects }) => {
|
|
1853
|
-
for (const project of Object.values(projects)) resource.prefetch(project);
|
|
1854
|
-
};
|
|
1855
|
-
/**
|
|
1856
|
-
* Dropped with the sign-in that fetched them: a verified token is what a credential answered
|
|
1857
|
-
* for, so it belongs to that credential and not to the project id it was keyed by.
|
|
1858
|
-
*/
|
|
1859
|
-
const forgetUnder = (baseUrl) => resource.forget(Entry.isUnderStack(baseUrl));
|
|
1860
|
-
/** One project, closed on purpose. */
|
|
1861
|
-
const forget = (id) => resource.forget((key) => key === id);
|
|
1862
|
-
return {
|
|
1863
|
-
subscriber,
|
|
1864
|
-
get: resource.get,
|
|
1865
|
-
getAsync: resource.getAsync,
|
|
1866
|
-
retry: resource.retry,
|
|
1867
|
-
forget,
|
|
1868
|
-
forgetUnder
|
|
1869
|
-
};
|
|
1870
|
-
};
|
|
1871
|
-
//#endregion
|
|
1872
|
-
//#region src/keboola/bearer/context/stack.ts
|
|
1873
|
-
const createStackContext = (state) => {
|
|
1874
|
-
const resource = createResource({
|
|
1875
|
-
key: (baseUrl) => baseUrl,
|
|
1876
|
-
fetch: (baseUrl) => require_storage.createStorageClient({
|
|
1877
|
-
baseUrl,
|
|
1878
|
-
auth: {
|
|
1879
|
-
type: "sapi-token",
|
|
1880
|
-
token: ""
|
|
1881
|
-
}
|
|
1882
|
-
}).getStackInfo({ exclude: "componentDetails" })
|
|
1883
|
-
});
|
|
1884
|
-
resource.subscribe(({ key, status }) => {
|
|
1885
|
-
state.stacks.updateContext(key, status);
|
|
1886
|
-
});
|
|
1887
|
-
const subscriber = ({ stacks }) => {
|
|
1888
|
-
for (const { baseUrl } of Object.values(stacks)) resource.prefetch(baseUrl);
|
|
1889
|
-
};
|
|
1890
|
-
/** Dropped with the stack itself — a stack that comes back re-reads its index. */
|
|
1891
|
-
const forget = (baseUrl) => resource.forget((key) => key === baseUrl);
|
|
1892
|
-
return {
|
|
1893
|
-
subscriber,
|
|
1894
|
-
get: resource.get,
|
|
1895
|
-
getAsync: resource.getAsync,
|
|
1896
|
-
retry: resource.retry,
|
|
1897
|
-
forget
|
|
1898
|
-
};
|
|
1899
|
-
};
|
|
1900
|
-
//#endregion
|
|
1901
|
-
//#region src/keboola/bearer/perProject.ts
|
|
1902
|
-
const once = (build) => {
|
|
1903
|
-
let value = null;
|
|
1904
|
-
return () => value ??= build();
|
|
1905
|
-
};
|
|
1906
|
-
/**
|
|
1907
|
-
* Everything one project derives, and the one call that drops it.
|
|
1908
|
-
*
|
|
1909
|
-
* Every field belongs to the credential that built it — a client set carries its middleware chain,
|
|
1910
|
-
* the storage client holds a `liveProject` seeded with its token, a fetched context *is* what it
|
|
1911
|
-
* answered for `tokens.verify` — so the record dies with the sign-in, and `forgetUnder` is the
|
|
1912
|
-
* only thing that ends one.
|
|
1913
|
-
*/
|
|
1914
|
-
const createPerProject = ({ state, credentials, middlewareFor, stack, clientServiceUrls, buildApi }) => {
|
|
1915
|
-
const context = createProjectContext({
|
|
1916
|
-
state,
|
|
1917
|
-
credentials,
|
|
1918
|
-
stackContext: stack.context
|
|
1919
|
-
});
|
|
1356
|
+
const createPerProject = ({ state, credentials, middlewareFor, stack }) => {
|
|
1920
1357
|
const attachFor = ({ baseUrl, projectId }) => {
|
|
1921
1358
|
const withProjectId = (next) => (request) => {
|
|
1922
1359
|
request.request.headers.set(require_createFetchClient.KeboolaHttpHeader.PROJECT_ID, String(projectId));
|
|
@@ -1924,131 +1361,72 @@ const createPerProject = ({ state, credentials, middlewareFor, stack, clientServ
|
|
|
1924
1361
|
};
|
|
1925
1362
|
return (next) => withProjectId(credentials.middleware(baseUrl)(next));
|
|
1926
1363
|
};
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
token: "",
|
|
1932
|
-
projectId
|
|
1933
|
-
},
|
|
1934
|
-
getServiceBaseUrl: (serviceId) => async () => {
|
|
1935
|
-
const stackInfo = await stack.context.getAsync(baseUrl);
|
|
1936
|
-
const serviceUrl = createStack({
|
|
1937
|
-
stackInfo,
|
|
1938
|
-
clientServiceUrls
|
|
1939
|
-
}).getServiceUrl(serviceId);
|
|
1940
|
-
assert$1(serviceUrl, KeboolaErrorType.NotReady);
|
|
1941
|
-
return serviceUrl;
|
|
1942
|
-
},
|
|
1943
|
-
middlewareFor,
|
|
1944
|
-
attachTokenMiddleware: attach
|
|
1364
|
+
const authFor = ({ projectId }) => ({
|
|
1365
|
+
type: "bearer",
|
|
1366
|
+
token: "",
|
|
1367
|
+
projectId
|
|
1945
1368
|
});
|
|
1946
1369
|
/**
|
|
1947
|
-
*
|
|
1948
|
-
* carries its re-verify middleware, the context reports the project it re-verifies.
|
|
1370
|
+
* One project's surface: the stack's fields from `perStack`, the rest built for the project.
|
|
1949
1371
|
*
|
|
1950
|
-
* -
|
|
1951
|
-
*
|
|
1952
|
-
* - `storage` is gated on the stack index too, though it addresses the project's own `baseUrl`
|
|
1953
|
-
* and does not need it — that is the gate as it stands, not a requirement.
|
|
1372
|
+
* - Checked per property read but `baseUrl`: `SignInEnded` once the sign-in it was built under
|
|
1373
|
+
* ends, and `NotAuthenticated` before one lands.
|
|
1954
1374
|
*/
|
|
1955
|
-
const
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
type: "bearer",
|
|
1963
|
-
token: "",
|
|
1964
|
-
projectId
|
|
1965
|
-
};
|
|
1966
|
-
const reader = require_storage.createStorageClient({
|
|
1967
|
-
baseUrl,
|
|
1968
|
-
auth,
|
|
1969
|
-
middlewares: [attach]
|
|
1375
|
+
const build = (project) => {
|
|
1376
|
+
let isLive = true;
|
|
1377
|
+
const attach = attachFor(project);
|
|
1378
|
+
const storage = require_storage.createStorageClient({
|
|
1379
|
+
baseUrl: project.baseUrl,
|
|
1380
|
+
auth: authFor(project),
|
|
1381
|
+
middlewares: middlewareFor("storage", [attach])
|
|
1970
1382
|
});
|
|
1971
|
-
const
|
|
1972
|
-
|
|
1973
|
-
|
|
1383
|
+
const { client, meta } = createServiceClients({
|
|
1384
|
+
baseUrl: project.baseUrl,
|
|
1385
|
+
auth: authFor(project),
|
|
1386
|
+
getServiceBaseUrl: (serviceId) => async () => {
|
|
1387
|
+
const serviceUrl = (await stack.context.getAsync(project.baseUrl)).getServiceUrl(serviceId);
|
|
1388
|
+
assert$1(serviceUrl, KeboolaErrorType.NotReady);
|
|
1389
|
+
return serviceUrl;
|
|
1390
|
+
},
|
|
1391
|
+
middlewareFor,
|
|
1392
|
+
attachTokenMiddleware: attach
|
|
1974
1393
|
});
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
dependsOn: (live) => ({
|
|
1979
|
-
useLegacyBucketPrefix: !live.hasFeature(require_constants.ProjectFeature.DisableLegacyBucketPrefix),
|
|
1980
|
-
hasProtectedDefaultBranch: live.hasFeature(require_constants.ProjectFeature.SoxProtectedDefaultBranch),
|
|
1981
|
-
hasStorageBranches: live.hasFeature(require_constants.ProjectFeature.StorageBranches)
|
|
1982
|
-
})
|
|
1394
|
+
const sdk = createSdk({
|
|
1395
|
+
storage,
|
|
1396
|
+
services: client
|
|
1983
1397
|
});
|
|
1984
1398
|
return {
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
return liveProject.getProject();
|
|
1999
|
-
},
|
|
2000
|
-
get st() {
|
|
2001
|
-
return storageTableStore.get();
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
};
|
|
2005
|
-
};
|
|
2006
|
-
const build = (project) => {
|
|
2007
|
-
const attach = attachFor(project);
|
|
2008
|
-
const live = once(() => buildLive(project, attach));
|
|
2009
|
-
const clients = once(() => buildClients(project, attach));
|
|
2010
|
-
const sdk = once(() => createSdk({
|
|
2011
|
-
storage: live().storage,
|
|
2012
|
-
services: clients().client,
|
|
2013
|
-
context: live().context
|
|
2014
|
-
}));
|
|
2015
|
-
return {
|
|
2016
|
-
api: buildApi(project),
|
|
2017
|
-
get clients() {
|
|
2018
|
-
return clients();
|
|
2019
|
-
},
|
|
2020
|
-
get storage() {
|
|
2021
|
-
return live().storage;
|
|
2022
|
-
},
|
|
2023
|
-
get context() {
|
|
2024
|
-
return live().context;
|
|
2025
|
-
},
|
|
2026
|
-
get sdk() {
|
|
2027
|
-
return sdk();
|
|
1399
|
+
api: new Proxy({}, { get: (_target, property) => {
|
|
1400
|
+
if (isBuiltInProperty(property)) return void 0;
|
|
1401
|
+
if (property === "baseUrl") return project.baseUrl;
|
|
1402
|
+
if (!isLive) throw new KeboolaError(KeboolaErrorType.SignInEnded);
|
|
1403
|
+
require_transientRetries.Result.unwrap(state.auth.requireCredential(project.baseUrl));
|
|
1404
|
+
if (property === "stack" || property === "auth" || property === "management") return stack.get(project.baseUrl)[property];
|
|
1405
|
+
if (property === "storage") return storage;
|
|
1406
|
+
if (property === "sdk") return sdk;
|
|
1407
|
+
if (property === "serviceMeta") return meta;
|
|
1408
|
+
return client[property];
|
|
1409
|
+
} }),
|
|
1410
|
+
end: () => {
|
|
1411
|
+
isLive = false;
|
|
2028
1412
|
}
|
|
2029
1413
|
};
|
|
2030
1414
|
};
|
|
2031
1415
|
const derived = /* @__PURE__ */ new Map();
|
|
2032
|
-
const get = (project) => ensure(derived, project
|
|
2033
|
-
/** One project, closed on purpose — a handle for it stops answering from the next read. */
|
|
2034
|
-
const forget = (id) => {
|
|
2035
|
-
derived.delete(id);
|
|
2036
|
-
context.forget(id);
|
|
2037
|
-
};
|
|
1416
|
+
const get = (project) => ensure(derived, projectKey(project), () => build(project)).api;
|
|
2038
1417
|
const forgetUnder = (baseUrl) => {
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2041
|
-
|
|
1418
|
+
for (const [key, record] of derived) {
|
|
1419
|
+
if (!key.startsWith(`${baseUrl}#`)) continue;
|
|
1420
|
+
record.end();
|
|
1421
|
+
derived.delete(key);
|
|
1422
|
+
}
|
|
2042
1423
|
};
|
|
2043
1424
|
return {
|
|
2044
|
-
context,
|
|
2045
1425
|
get,
|
|
2046
|
-
forget,
|
|
2047
1426
|
forgetUnder
|
|
2048
1427
|
};
|
|
2049
1428
|
};
|
|
2050
|
-
|
|
2051
|
-
//#region src/keboola/bearer/persistor.ts
|
|
1429
|
+
// src/keboola/bearer/persistor.ts
|
|
2052
1430
|
/**
|
|
2053
1431
|
* Where a bearer session is persisted, under whichever adapter the client was given.
|
|
2054
1432
|
*
|
|
@@ -2074,17 +1452,23 @@ const persistedGrantSchema = zod.discriminatedUnion("type", [zod.object({
|
|
|
2074
1452
|
type: zod.literal("cookie"),
|
|
2075
1453
|
sessionId: zod.string()
|
|
2076
1454
|
})]);
|
|
2077
|
-
/** A record per project rather than a bare id, so a project can grow a field without a migration. */
|
|
2078
|
-
const persistedProjectSchema = zod.object({ projectId: zod.number() });
|
|
2079
1455
|
const persistedStackSchema = zod.object({
|
|
2080
1456
|
baseUrl: zod.string(),
|
|
2081
1457
|
credential: persistedGrantSchema.nullable().catch(null),
|
|
2082
1458
|
retained: zod.object({ grant: persistedGrantSchema }).nullable().default(null).catch(null),
|
|
2083
|
-
|
|
1459
|
+
/**
|
|
1460
|
+
* Written empty, never read.
|
|
1461
|
+
* - An older build parses a stack without it as corrupt, and signs out.
|
|
1462
|
+
*/
|
|
1463
|
+
projects: zod.array(zod.unknown())
|
|
2084
1464
|
});
|
|
2085
1465
|
const persistedSessionSchema = zod.object({
|
|
2086
1466
|
current: zod.object({
|
|
2087
1467
|
baseUrl: zod.string(),
|
|
1468
|
+
/**
|
|
1469
|
+
* Written `null`, never read: the project is the app's to keep.
|
|
1470
|
+
* - An older build parses a `current` without it as corrupt, and signs out.
|
|
1471
|
+
*/
|
|
2088
1472
|
projectId: zod.number().nullable()
|
|
2089
1473
|
}).nullable(),
|
|
2090
1474
|
stacks: zod.array(persistedStackSchema)
|
|
@@ -2093,22 +1477,21 @@ const EMPTY_PERSISTED_SESSION = {
|
|
|
2093
1477
|
current: null,
|
|
2094
1478
|
stacks: []
|
|
2095
1479
|
};
|
|
2096
|
-
const projectsOf = (projects, baseUrl) => Object.values(projects).filter((project) => project.baseUrl === baseUrl).map(({ projectId }) => ({ projectId }));
|
|
2097
1480
|
const grantsOf = (stack) => ({
|
|
2098
|
-
credential: stack.auth.status === "authenticated" ?
|
|
1481
|
+
credential: stack.auth.status === "authenticated" ? grantOf(stack.auth.credential) : null,
|
|
2099
1482
|
retained: stack.retained
|
|
2100
1483
|
});
|
|
2101
1484
|
/**
|
|
2102
1485
|
* The stored session, rewritten from the table except for the grants.
|
|
2103
1486
|
*
|
|
2104
|
-
* - Scope
|
|
1487
|
+
* - Scope and stack list come from memory.
|
|
2105
1488
|
* - `credential` and `retained` stay as stored: a grant another document rotated must not be put
|
|
2106
1489
|
* back by a snapshot of this one's older table.
|
|
2107
1490
|
*/
|
|
2108
|
-
const mergeSnapshot = (stored, { active, stacks
|
|
1491
|
+
const mergeSnapshot = (stored, { active, stacks }) => ({
|
|
2109
1492
|
current: {
|
|
2110
|
-
baseUrl: active
|
|
2111
|
-
projectId:
|
|
1493
|
+
baseUrl: active,
|
|
1494
|
+
projectId: null
|
|
2112
1495
|
},
|
|
2113
1496
|
stacks: Object.values(stacks).map(({ baseUrl }) => {
|
|
2114
1497
|
const kept = stored.stacks.find((stack) => stack.baseUrl === baseUrl);
|
|
@@ -2116,15 +1499,15 @@ const mergeSnapshot = (stored, { active, stacks, projects }) => ({
|
|
|
2116
1499
|
baseUrl,
|
|
2117
1500
|
credential: kept?.credential ?? null,
|
|
2118
1501
|
retained: kept?.retained ?? null,
|
|
2119
|
-
projects:
|
|
1502
|
+
projects: []
|
|
2120
1503
|
};
|
|
2121
1504
|
})
|
|
2122
1505
|
});
|
|
2123
|
-
const upsertStack = (stored,
|
|
2124
|
-
const index = stored.stacks.findIndex((stack) => stack.baseUrl === baseUrl);
|
|
1506
|
+
const upsertStack = (stored, row) => {
|
|
1507
|
+
const index = stored.stacks.findIndex((stack) => stack.baseUrl === row.baseUrl);
|
|
2125
1508
|
const stacks = [...stored.stacks];
|
|
2126
|
-
if (index < 0) stacks.push(
|
|
2127
|
-
else stacks[index] =
|
|
1509
|
+
if (index < 0) stacks.push(row);
|
|
1510
|
+
else stacks[index] = row;
|
|
2128
1511
|
return {
|
|
2129
1512
|
...stored,
|
|
2130
1513
|
stacks
|
|
@@ -2145,14 +1528,14 @@ const createSessionPersistor = (storage) => {
|
|
|
2145
1528
|
schema: persistedSessionSchema,
|
|
2146
1529
|
defaultValue: EMPTY_PERSISTED_SESSION
|
|
2147
1530
|
});
|
|
2148
|
-
const persistStack = (cell, baseUrl, { stacks
|
|
1531
|
+
const persistStack = (cell, baseUrl, { stacks }) => {
|
|
2149
1532
|
const stack = stacks[baseUrl];
|
|
2150
1533
|
if (stack === void 0) return Promise.resolve();
|
|
2151
|
-
return cell.modify((stored) => upsertStack(stored,
|
|
1534
|
+
return cell.modify((stored) => upsertStack(stored, {
|
|
2152
1535
|
baseUrl,
|
|
2153
1536
|
...grantsOf(stack),
|
|
2154
|
-
projects:
|
|
2155
|
-
}))
|
|
1537
|
+
projects: []
|
|
1538
|
+
}));
|
|
2156
1539
|
};
|
|
2157
1540
|
const locked = (task) => persistor.locked((cell) => task({
|
|
2158
1541
|
read: cell.read,
|
|
@@ -2176,18 +1559,92 @@ const createSessionPersistor = (storage) => {
|
|
|
2176
1559
|
snapshot
|
|
2177
1560
|
};
|
|
2178
1561
|
};
|
|
2179
|
-
|
|
2180
|
-
|
|
1562
|
+
// src/keboola/bearer/context.ts
|
|
1563
|
+
const STACK_INDEX_TIMEOUT_MS = 3e4;
|
|
1564
|
+
/**
|
|
1565
|
+
* One parsed stack index per stack; `createStack` applies the dev and production overrides.
|
|
1566
|
+
*
|
|
1567
|
+
* - One fetch per stack: concurrent askers share it, a landed index is never refetched.
|
|
1568
|
+
* - A failure is held until a retry; nothing here needs a rejection handler.
|
|
1569
|
+
* - Every status change is copied onto the stack's row, for the consumers that render it.
|
|
1570
|
+
*/
|
|
1571
|
+
const createStackContext = ({ state, clientServiceUrls }) => {
|
|
1572
|
+
const entries = /* @__PURE__ */ new Map();
|
|
1573
|
+
const set = (baseUrl, entry) => {
|
|
1574
|
+
entries.set(baseUrl, entry);
|
|
1575
|
+
state.stacks.updateContext(baseUrl, entry.status);
|
|
1576
|
+
};
|
|
1577
|
+
const fetchStack = async (baseUrl) => {
|
|
1578
|
+
const stackInfo = await require_storage.createStorageClient({
|
|
1579
|
+
baseUrl,
|
|
1580
|
+
auth: {
|
|
1581
|
+
type: "sapi-token",
|
|
1582
|
+
token: ""
|
|
1583
|
+
}
|
|
1584
|
+
}).getStackInfo({ exclude: "componentDetails" }, AbortSignal.timeout(STACK_INDEX_TIMEOUT_MS));
|
|
1585
|
+
return createStack({
|
|
1586
|
+
stackInfo,
|
|
1587
|
+
clientServiceUrls
|
|
1588
|
+
});
|
|
1589
|
+
};
|
|
1590
|
+
const run = (baseUrl) => {
|
|
1591
|
+
const settle = (next) => {
|
|
1592
|
+
set(baseUrl, next);
|
|
1593
|
+
return next;
|
|
1594
|
+
};
|
|
1595
|
+
const entry = {
|
|
1596
|
+
status: "pending",
|
|
1597
|
+
settled: fetchStack(baseUrl).then((value) => settle({
|
|
1598
|
+
status: "ready",
|
|
1599
|
+
value
|
|
1600
|
+
}), (error) => settle({
|
|
1601
|
+
status: "errored",
|
|
1602
|
+
error
|
|
1603
|
+
}))
|
|
1604
|
+
};
|
|
1605
|
+
set(baseUrl, entry);
|
|
1606
|
+
return entry;
|
|
1607
|
+
};
|
|
1608
|
+
const get = (baseUrl) => {
|
|
1609
|
+
const entry = entries.get(baseUrl);
|
|
1610
|
+
return entry?.status === "ready" ? entry.value : null;
|
|
1611
|
+
};
|
|
1612
|
+
const getAsync = async (baseUrl) => {
|
|
1613
|
+
const cached = entries.get(baseUrl);
|
|
1614
|
+
const entry = cached === void 0 || cached.status === "errored" ? run(baseUrl) : cached;
|
|
1615
|
+
const settled = entry.status === "pending" ? await entry.settled : entry;
|
|
1616
|
+
if (settled.status === "errored") throw settled.error;
|
|
1617
|
+
return settled.value;
|
|
1618
|
+
};
|
|
1619
|
+
const subscriber = ({ stacks }) => {
|
|
1620
|
+
for (const { baseUrl } of Object.values(stacks)) if (!entries.has(baseUrl)) run(baseUrl);
|
|
1621
|
+
};
|
|
1622
|
+
return {
|
|
1623
|
+
subscriber,
|
|
1624
|
+
get,
|
|
1625
|
+
getAsync
|
|
1626
|
+
};
|
|
1627
|
+
};
|
|
1628
|
+
// src/keboola/bearer/perStack.ts
|
|
2181
1629
|
/**
|
|
2182
|
-
* Everything one stack derives
|
|
1630
|
+
* Everything one stack derives.
|
|
2183
1631
|
*
|
|
2184
1632
|
* Outlives a sign-out, unlike anything in `perProject`: both clients read the credential live per
|
|
2185
1633
|
* request, so neither belongs to one sign-in, and the stack index is public.
|
|
2186
1634
|
*/
|
|
2187
|
-
const createPerStack = ({ state, credentials, middlewareFor }) => {
|
|
2188
|
-
const context = createStackContext(
|
|
1635
|
+
const createPerStack = ({ state, credentials, middlewareFor, clientServiceUrls }) => {
|
|
1636
|
+
const context = createStackContext({
|
|
1637
|
+
state,
|
|
1638
|
+
clientServiceUrls
|
|
1639
|
+
});
|
|
2189
1640
|
const derived = /* @__PURE__ */ new Map();
|
|
2190
1641
|
const get = (baseUrl) => ensure(derived, baseUrl, () => ({
|
|
1642
|
+
baseUrl,
|
|
1643
|
+
get stack() {
|
|
1644
|
+
const parsed = context.get(baseUrl);
|
|
1645
|
+
assert$1(parsed, KeboolaErrorType.NotReady);
|
|
1646
|
+
return parsed;
|
|
1647
|
+
},
|
|
2191
1648
|
auth: require_authClient.createAuthClient({
|
|
2192
1649
|
baseUrl,
|
|
2193
1650
|
middlewares: middlewareFor("auth", [credentials.middleware(baseUrl)])
|
|
@@ -2201,18 +1658,12 @@ const createPerStack = ({ state, credentials, middlewareFor }) => {
|
|
|
2201
1658
|
middlewares: middlewareFor("management", [credentials.middleware(baseUrl)])
|
|
2202
1659
|
})
|
|
2203
1660
|
}));
|
|
2204
|
-
const forget = (baseUrl) => {
|
|
2205
|
-
derived.delete(baseUrl);
|
|
2206
|
-
context.forget(baseUrl);
|
|
2207
|
-
};
|
|
2208
1661
|
return {
|
|
2209
1662
|
context,
|
|
2210
|
-
get
|
|
2211
|
-
forget
|
|
1663
|
+
get
|
|
2212
1664
|
};
|
|
2213
1665
|
};
|
|
2214
|
-
|
|
2215
|
-
//#region src/keboola/bearer/keboola.ts
|
|
1666
|
+
// src/keboola/bearer/keboola.ts
|
|
2216
1667
|
/**
|
|
2217
1668
|
* The bearer client: the session table, its two scopes, and the surface they back.
|
|
2218
1669
|
*
|
|
@@ -2232,65 +1683,41 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2232
1683
|
const perStack = createPerStack({
|
|
2233
1684
|
state,
|
|
2234
1685
|
credentials,
|
|
2235
|
-
middlewareFor
|
|
1686
|
+
middlewareFor,
|
|
1687
|
+
clientServiceUrls
|
|
2236
1688
|
});
|
|
2237
1689
|
const perProject = createPerProject({
|
|
2238
1690
|
state,
|
|
2239
1691
|
credentials,
|
|
2240
1692
|
middlewareFor,
|
|
2241
|
-
stack: perStack
|
|
2242
|
-
clientServiceUrls,
|
|
2243
|
-
buildApi: (project) => createApiFor({
|
|
2244
|
-
stackUrl: () => project.baseUrl,
|
|
2245
|
-
project: () => require_transientRetries.Result.unwrap(state.projects.get(project.id)),
|
|
2246
|
-
pinned: true
|
|
2247
|
-
})
|
|
1693
|
+
stack: perStack
|
|
2248
1694
|
});
|
|
2249
1695
|
state.store.subscribe(perStack.context.subscriber);
|
|
2250
1696
|
perStack.context.subscriber(state.store.get());
|
|
2251
|
-
state.
|
|
2252
|
-
|
|
2253
|
-
const
|
|
2254
|
-
/**
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2257
|
-
|
|
1697
|
+
const selectStack = (baseUrl) => state.stacks.select(require_createFetchClient.normalizeBaseUrl(baseUrl));
|
|
1698
|
+
/** The active stack, or a named one — normalised to key like `select`. */
|
|
1699
|
+
const requireStackUrl = (baseUrl) => baseUrl === void 0 ? state.stacks.getActive().baseUrl : require_createFetchClient.normalizeBaseUrl(baseUrl);
|
|
1700
|
+
/** A project id is unique only within its stack: it always names one on the active stack. */
|
|
1701
|
+
const onActiveStack = (projectId) => ({
|
|
1702
|
+
baseUrl: requireStackUrl(),
|
|
1703
|
+
projectId
|
|
1704
|
+
});
|
|
2258
1705
|
/**
|
|
2259
|
-
*
|
|
1706
|
+
* Auth headers for a non-fetch transport (the chat stream), renewed first once near expiry.
|
|
2260
1707
|
*
|
|
2261
|
-
* -
|
|
1708
|
+
* - No middleware recovers a 401 there.
|
|
1709
|
+
* - Pinned to the stack active at the call: a stack switch mid-renewal does not re-point it.
|
|
1710
|
+
* - Throws `NotAuthenticated` if that stack signed out meanwhile.
|
|
2262
1711
|
*/
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
const [only, ...rest] = state.projects.findAll(projectId);
|
|
2268
|
-
return only !== void 0 && rest.length === 0 ? only : require_transientRetries.Result.unwrap(scoped);
|
|
2269
|
-
};
|
|
2270
|
-
const headersFor = (project) => {
|
|
2271
|
-
const credential = require_transientRetries.Result.unwrap(state.auth.requireCredential(project.baseUrl));
|
|
1712
|
+
const getAuthHeadersAsync = async (projectId) => {
|
|
1713
|
+
const { baseUrl } = onActiveStack(projectId);
|
|
1714
|
+
await credentials.renewIfStale(baseUrl);
|
|
1715
|
+
const credential = require_transientRetries.Result.unwrap(state.auth.requireCredential(baseUrl));
|
|
2272
1716
|
return {
|
|
2273
1717
|
[require_createFetchClient.HttpHeader.AUTHORIZATION]: `Bearer ${credential.accessToken}`,
|
|
2274
|
-
[require_createFetchClient.KeboolaHttpHeader.PROJECT_ID]: String(
|
|
1718
|
+
[require_createFetchClient.KeboolaHttpHeader.PROJECT_ID]: String(projectId)
|
|
2275
1719
|
};
|
|
2276
1720
|
};
|
|
2277
|
-
/**
|
|
2278
|
-
* Auth headers for a non-fetch transport (the chat stream).
|
|
2279
|
-
*
|
|
2280
|
-
* - A read, not a rotation: no middleware recovers a 401 there; the fetch clients keep it fresh.
|
|
2281
|
-
*/
|
|
2282
|
-
const getAuthHeaders = (projectId) => headersFor(requireProject(projectId));
|
|
2283
|
-
/**
|
|
2284
|
-
* `getAuthHeaders`, with the token renewed first once it nears expiry.
|
|
2285
|
-
*
|
|
2286
|
-
* - Pinned to the project resolved at the call: a scope move during the renewal does not re-point it.
|
|
2287
|
-
* - Throws like the read if that project closed, or its stack signed out, meanwhile.
|
|
2288
|
-
*/
|
|
2289
|
-
const getAuthHeadersAsync = async (projectId) => {
|
|
2290
|
-
const project = requireProject(projectId);
|
|
2291
|
-
await credentials.renewIfStale(project.baseUrl);
|
|
2292
|
-
return headersFor(require_transientRetries.Result.unwrap(state.projects.get(project.id)));
|
|
2293
|
-
};
|
|
2294
1721
|
const toCredential = (input) => {
|
|
2295
1722
|
if (input.type !== "token") return input;
|
|
2296
1723
|
const { refreshToken } = input;
|
|
@@ -2301,51 +1728,30 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2301
1728
|
};
|
|
2302
1729
|
};
|
|
2303
1730
|
const authenticate = (input) => {
|
|
2304
|
-
const { baseUrl } = state.
|
|
1731
|
+
const { baseUrl } = state.stacks.getActive();
|
|
2305
1732
|
const signedIn = require_transientRetries.Result.unwrap(state.auth.authenticate(baseUrl, toCredential(input)));
|
|
2306
1733
|
persistor.locked((store) => store.persistStack(baseUrl, state.store.get())).catch((error) => {
|
|
2307
1734
|
console.warn("createKeboola: the sign-in could not be stored", error);
|
|
2308
1735
|
});
|
|
2309
1736
|
return signedIn;
|
|
2310
1737
|
};
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
1738
|
+
const active = () => perStack.get(state.stacks.getActive().baseUrl);
|
|
1739
|
+
const stackApi = {
|
|
1740
|
+
get baseUrl() {
|
|
1741
|
+
return active().baseUrl;
|
|
1742
|
+
},
|
|
1743
|
+
get stack() {
|
|
1744
|
+
return active().stack;
|
|
1745
|
+
},
|
|
1746
|
+
get auth() {
|
|
1747
|
+
return active().auth;
|
|
1748
|
+
},
|
|
1749
|
+
get management() {
|
|
1750
|
+
return active().management;
|
|
2322
1751
|
}
|
|
2323
|
-
const derived = perProject.get(resolve.project());
|
|
2324
|
-
if (property === "context") return derived.context;
|
|
2325
|
-
if (property === "storage") return derived.storage;
|
|
2326
|
-
if (property === "sdk") return derived.sdk;
|
|
2327
|
-
const { client, meta } = derived.clients;
|
|
2328
|
-
if (property === "serviceMeta") return meta;
|
|
2329
|
-
return client[property];
|
|
2330
|
-
} });
|
|
2331
|
-
const activeApi = createApiFor({
|
|
2332
|
-
stackUrl: () => state.scope.getActiveStack().baseUrl,
|
|
2333
|
-
project: () => require_transientRetries.Result.unwrap(state.scope.requireActiveProject())
|
|
2334
|
-
});
|
|
2335
|
-
/** The scoped project's surface. Re-points when the scope moves. */
|
|
2336
|
-
const getActiveApi = () => activeApi;
|
|
2337
|
-
/**
|
|
2338
|
-
* One project's surface, on the active stack — one credential serves all of them.
|
|
2339
|
-
*
|
|
2340
|
-
* - Pinned: never re-points; stops once the project closes (`session.project.close`, sign-out).
|
|
2341
|
-
* - Memoised per project: a React `key` or a hook dep compares handles by identity.
|
|
2342
|
-
*/
|
|
2343
|
-
const getApi = (projectId) => {
|
|
2344
|
-
const { baseUrl } = state.scope.getActiveStack();
|
|
2345
|
-
const project = Entry.project(baseUrl, projectId);
|
|
2346
|
-
require_transientRetries.Result.unwrapOr(state.projects.open(baseUrl, projectId), null);
|
|
2347
|
-
return perProject.get(project).api;
|
|
2348
1752
|
};
|
|
1753
|
+
const getStackApi = () => stackApi;
|
|
1754
|
+
const getProjectApi = (projectId) => perProject.get(onActiveStack(projectId));
|
|
2349
1755
|
/**
|
|
2350
1756
|
* The scope's sign-in, or a named stack's — and everything that sign-in derived.
|
|
2351
1757
|
*
|
|
@@ -2371,28 +1777,6 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2371
1777
|
signOut();
|
|
2372
1778
|
return authenticate(input);
|
|
2373
1779
|
};
|
|
2374
|
-
/**
|
|
2375
|
-
* Leave one project: its row and everything built for it; its handles stop answering.
|
|
2376
|
-
*
|
|
2377
|
-
* - Counterpart of `getApi(projectId)`; without it the project is held and persisted until sign-out.
|
|
2378
|
-
*/
|
|
2379
|
-
const closeProject = (projectId) => {
|
|
2380
|
-
const id = Entry.projectEntryId(requireStackUrl(), projectId);
|
|
2381
|
-
const closed = require_transientRetries.Result.unwrapOr(state.projects.close(id), null);
|
|
2382
|
-
if (closed === null) return null;
|
|
2383
|
-
perProject.forget(id);
|
|
2384
|
-
return closed;
|
|
2385
|
-
};
|
|
2386
|
-
const closeStack = (baseUrl) => {
|
|
2387
|
-
const target = require_createFetchClient.normalizeBaseUrl(baseUrl);
|
|
2388
|
-
if (state.scope.get().baseUrl === target) throw new KeboolaError(KeboolaErrorType.StackActive);
|
|
2389
|
-
const closed = require_transientRetries.Result.unwrapOr(state.stacks.close(target), null);
|
|
2390
|
-
if (closed === null) return null;
|
|
2391
|
-
perProject.forgetUnder(target);
|
|
2392
|
-
perStack.forget(target);
|
|
2393
|
-
credentials.forget(target);
|
|
2394
|
-
return closed;
|
|
2395
|
-
};
|
|
2396
1780
|
let persisting = false;
|
|
2397
1781
|
/**
|
|
2398
1782
|
* Persistence starts only once the restore has settled.
|
|
@@ -2434,12 +1818,12 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2434
1818
|
enablePersistenceOnSignIn();
|
|
2435
1819
|
throw error;
|
|
2436
1820
|
}));
|
|
2437
|
-
const getActiveStack = state.
|
|
1821
|
+
const getActiveStack = state.stacks.getActive;
|
|
2438
1822
|
const isAuthenticated = () => getActiveStack().auth.status === "authenticated";
|
|
2439
1823
|
/**
|
|
2440
1824
|
* Picks up where the stored session left off, once.
|
|
2441
1825
|
*
|
|
2442
|
-
* 1.
|
|
1826
|
+
* 1. The stored stack becomes active again.
|
|
2443
1827
|
* 2. Nothing stored, or the restore failed: `defaultBaseUrl` stays active; a failure rethrows.
|
|
2444
1828
|
* 3. The caller got there first (a select, sign-in or sign-out): its scope and sign-ins stand.
|
|
2445
1829
|
*
|
|
@@ -2447,9 +1831,7 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2447
1831
|
* - Other stacks still come back, persistence still starts; repeat calls share one promise.
|
|
2448
1832
|
*/
|
|
2449
1833
|
const resume = require_transientRetries.lazy(() => restore().then(({ lastActive, status }) => {
|
|
2450
|
-
if (
|
|
2451
|
-
const stack = selectStack(lastActive.baseUrl);
|
|
2452
|
-
if (lastActive.projectId !== null && stack.auth.status === "authenticated") selectProject(lastActive.projectId);
|
|
1834
|
+
if (lastActive && !callerScoped) selectStack(lastActive.baseUrl);
|
|
2453
1835
|
return status;
|
|
2454
1836
|
}));
|
|
2455
1837
|
let callerScoped = false;
|
|
@@ -2458,8 +1840,8 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2458
1840
|
return verb(...args);
|
|
2459
1841
|
};
|
|
2460
1842
|
return {
|
|
2461
|
-
|
|
2462
|
-
|
|
1843
|
+
getStackApi,
|
|
1844
|
+
getProjectApi,
|
|
2463
1845
|
session: {
|
|
2464
1846
|
getState: state.store.get,
|
|
2465
1847
|
subscribe: state.store.subscribe,
|
|
@@ -2471,23 +1853,9 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2471
1853
|
const stack = selectStack(baseUrl);
|
|
2472
1854
|
return persistScope().then(() => stack);
|
|
2473
1855
|
}),
|
|
2474
|
-
close: closeStack,
|
|
2475
|
-
retryContext: perStack.context.retry,
|
|
2476
1856
|
getContext: (baseUrl) => perStack.context.get(requireStackUrl(baseUrl)),
|
|
2477
1857
|
getContextAsync: (baseUrl) => perStack.context.getAsync(requireStackUrl(baseUrl))
|
|
2478
1858
|
},
|
|
2479
|
-
project: {
|
|
2480
|
-
/** Scoped on return; resolves once that is stored, for a caller leaving the document. */
|
|
2481
|
-
select: byCaller((projectId) => {
|
|
2482
|
-
const project = selectProject(projectId);
|
|
2483
|
-
return persistScope().then(() => project);
|
|
2484
|
-
}),
|
|
2485
|
-
close: closeProject,
|
|
2486
|
-
deactivate: state.scope.deactivate,
|
|
2487
|
-
retryContext: perProject.context.retry,
|
|
2488
|
-
getContext: (id) => perProject.context.get(id ?? requireProjectEntry().id),
|
|
2489
|
-
getContextAsync: (id) => perProject.context.getAsync(requireProjectEntry(id))
|
|
2490
|
-
},
|
|
2491
1859
|
auth: {
|
|
2492
1860
|
authenticate: byCaller(authenticate),
|
|
2493
1861
|
replace: byCaller(replace),
|
|
@@ -2496,15 +1864,12 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
2496
1864
|
/** Whether the active stack holds a credential — `restoring` is not one yet. */
|
|
2497
1865
|
isAuthenticated,
|
|
2498
1866
|
isAuthenticatedAsync: () => resume().then(isAuthenticated),
|
|
2499
|
-
rotate: (baseUrl) => credentials.rotate(baseUrl).then(require_transientRetries.Result.unwrap),
|
|
2500
|
-
getHeaders: getAuthHeaders,
|
|
2501
1867
|
getHeadersAsync: getAuthHeadersAsync
|
|
2502
1868
|
}
|
|
2503
1869
|
}
|
|
2504
1870
|
};
|
|
2505
1871
|
};
|
|
2506
|
-
|
|
2507
|
-
//#region src/middlewares/loggingMiddleware.ts
|
|
1872
|
+
// src/middlewares/loggingMiddleware.ts
|
|
2508
1873
|
const CORRELATION_ID_HEADER = "X-Correlation-ID";
|
|
2509
1874
|
const ALWAYS_REDACTED_HEADERS = [...require_createFetchClient.CREDENTIAL_HEADERS, "set-cookie"];
|
|
2510
1875
|
const ALWAYS_REDACTED_QUERY_PARAMS = /* @__PURE__ */ new Set([
|
|
@@ -2622,8 +1987,7 @@ const createLoggingMiddleware = (options = {}) => {
|
|
|
2622
1987
|
}
|
|
2623
1988
|
};
|
|
2624
1989
|
};
|
|
2625
|
-
|
|
2626
|
-
//#region src/middlewares/retryMiddleware.ts
|
|
1990
|
+
// src/middlewares/retryMiddleware.ts
|
|
2627
1991
|
const DEFAULT_MAX_RETRIES = 5;
|
|
2628
1992
|
const DEFAULT_RETRYABLE_STATUSES = [
|
|
2629
1993
|
require_createFetchClient.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
@@ -2651,8 +2015,7 @@ const createRetryMiddleware = (options) => {
|
|
|
2651
2015
|
throw new Error("unreachable");
|
|
2652
2016
|
};
|
|
2653
2017
|
};
|
|
2654
|
-
|
|
2655
|
-
//#region src/middlewares/uiVersionMiddleware.ts
|
|
2018
|
+
// src/middlewares/uiVersionMiddleware.ts
|
|
2656
2019
|
/** Stamps `X-KBC-Ui-Version`; an empty `uiVersion` sends no header. */
|
|
2657
2020
|
const createUiVersionMiddleware = (uiVersion) => {
|
|
2658
2021
|
if (!uiVersion) return (next) => next;
|
|
@@ -2661,8 +2024,7 @@ const createUiVersionMiddleware = (uiVersion) => {
|
|
|
2661
2024
|
return next(request);
|
|
2662
2025
|
};
|
|
2663
2026
|
};
|
|
2664
|
-
|
|
2665
|
-
//#region src/domain/adminAccount.ts
|
|
2027
|
+
// src/domain/adminAccount.ts
|
|
2666
2028
|
/**
|
|
2667
2029
|
* The admin behind a Manage token: `GET /manage/tokens/verify`, with the admin-level helpers.
|
|
2668
2030
|
*
|
|
@@ -2685,7 +2047,22 @@ const createAdminAccount = ({ managementToken }) => {
|
|
|
2685
2047
|
managementToken
|
|
2686
2048
|
};
|
|
2687
2049
|
};
|
|
2688
|
-
|
|
2050
|
+
// src/domain/defaultBranch.ts
|
|
2051
|
+
const createDefaultBranch = ({ devBranches }) => {
|
|
2052
|
+
const defaultBranch = devBranches.find((branch) => branch.isDefault);
|
|
2053
|
+
assert(defaultBranch, "No default branch found for the project.");
|
|
2054
|
+
const getType = (branchId) => {
|
|
2055
|
+
if (branchId == null || branchId === "default") return "default";
|
|
2056
|
+
return Number(branchId) === defaultBranch.id ? "default" : "dev";
|
|
2057
|
+
};
|
|
2058
|
+
return {
|
|
2059
|
+
id: defaultBranch.id,
|
|
2060
|
+
name: defaultBranch.name,
|
|
2061
|
+
getType,
|
|
2062
|
+
isDev: (branchId) => getType(branchId) === "dev",
|
|
2063
|
+
isDefault: (branchId) => getType(branchId) === "default"
|
|
2064
|
+
};
|
|
2065
|
+
};
|
|
2689
2066
|
exports.ApiError = require_createFetchClient.ApiError;
|
|
2690
2067
|
exports.HtmlResponseError = require_validateConnectionStatus.HtmlResponseError;
|
|
2691
2068
|
exports.HttpContentType = require_createFetchClient.HttpContentType;
|
|
@@ -2711,6 +2088,7 @@ exports.collectByCursor = require_authClient.collectByCursor;
|
|
|
2711
2088
|
exports.collectByOffset = require_collectByOffset.collectByOffset;
|
|
2712
2089
|
exports.concurrent = require_concurrent.concurrent;
|
|
2713
2090
|
exports.createAdminAccount = createAdminAccount;
|
|
2091
|
+
exports.createDefaultBranch = createDefaultBranch;
|
|
2714
2092
|
exports.createDerivedAsyncStore = createDerivedAsyncStore;
|
|
2715
2093
|
exports.createDerivedStore = createDerivedStore;
|
|
2716
2094
|
exports.createEmitter = require_store.createEmitter;
|
|
@@ -2723,6 +2101,7 @@ exports.createMemoryStorage = createMemoryStorage;
|
|
|
2723
2101
|
exports.createNullStorage = createNullStorage;
|
|
2724
2102
|
exports.createPersistor = createPersistor;
|
|
2725
2103
|
exports.createPollRegistry = createPollRegistry;
|
|
2104
|
+
exports.createProject = require_project.createProject;
|
|
2726
2105
|
exports.createQueryServiceSdk = require_sdk_queryService_index.createQueryServiceSdk;
|
|
2727
2106
|
exports.createRetryMiddleware = createRetryMiddleware;
|
|
2728
2107
|
exports.createSessionStorage = createSessionStorage;
|
|
@@ -2738,30 +2117,32 @@ exports.formatValidationIssues = require_ValidationError.formatValidationIssues;
|
|
|
2738
2117
|
exports.generateUUID = require_generateUUID.generateUUID;
|
|
2739
2118
|
exports.isAbortError = require_createFetchClient.isAbortError;
|
|
2740
2119
|
exports.isApiError = require_createFetchClient.isApiError;
|
|
2741
|
-
exports.isEmptyDeep =
|
|
2120
|
+
exports.isEmptyDeep = require_schemaGuidedMerge.isEmptyDeep;
|
|
2742
2121
|
exports.isFetchClientError = require_createFetchClient.isFetchClientError;
|
|
2743
2122
|
exports.isHtmlResponseError = require_validateConnectionStatus.isHtmlResponseError;
|
|
2744
2123
|
exports.isKeboolaError = isKeboolaError;
|
|
2124
|
+
exports.isManageError = require_storage.isManageError;
|
|
2745
2125
|
exports.isManagementClientAuthError = require_management.isManagementClientAuthError;
|
|
2746
2126
|
exports.isManagementSessionMintError = require_management.isManagementSessionMintError;
|
|
2747
2127
|
exports.isPlainObject = require_isPlainObject.isPlainObject;
|
|
2748
2128
|
exports.isQueryJobError = require_QueryJobError.isQueryJobError;
|
|
2749
2129
|
exports.isQueueJobError = require_QueueJobError.isQueueJobError;
|
|
2750
2130
|
exports.isStorageJobError = require_storage.isStorageJobError;
|
|
2751
|
-
exports.isStorageTokenMutatingRequest = isStorageTokenMutatingRequest;
|
|
2752
2131
|
exports.isSyncActionError = require_SyncActionError.isSyncActionError;
|
|
2753
2132
|
exports.isTimeoutError = require_createFetchClient.isTimeoutError;
|
|
2754
2133
|
exports.isValidationError = require_ValidationError.isValidationError;
|
|
2755
2134
|
exports.jobStatus = require_transientRetries.jobStatus;
|
|
2756
2135
|
exports.keboolaUID = require_tag.keboolaUID;
|
|
2757
2136
|
exports.lazy = require_transientRetries.lazy;
|
|
2137
|
+
exports.manageErrorCode = require_storage.manageErrorCode;
|
|
2758
2138
|
exports.nextCursorOf = require_authClient.nextCursorOf;
|
|
2759
2139
|
exports.parseLogLines = require_appLogs.parseLogLines;
|
|
2760
2140
|
exports.parseOrThrow = require_ValidationError.parseOrThrow;
|
|
2761
2141
|
exports.poller = require_transientRetries.poller;
|
|
2762
2142
|
exports.queueSeries = queueSeries;
|
|
2763
2143
|
exports.readableReason = require_storage.readableReason;
|
|
2764
|
-
exports.
|
|
2144
|
+
exports.retryAfterSeconds = require_storage.retryAfterSeconds;
|
|
2145
|
+
exports.schemaGuidedMerge = require_schemaGuidedMerge.schemaGuidedMerge;
|
|
2765
2146
|
exports.series = require_storage.series;
|
|
2766
2147
|
exports.shallowEqual = shallowEqual;
|
|
2767
2148
|
|