@keboola/api-client 39.0.0 → 41.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 +121 -100
- package/API-SURFACE.md +27 -2
- package/CHANGELOG.md +129 -0
- package/README.md +3 -3
- package/dist/{ManagementClientAuthError-FcfMJNhr.cjs → ManagementClientAuthError-DE7lNGZQ.cjs} +2 -2
- package/dist/{ManagementClientAuthError-FcfMJNhr.cjs.map → ManagementClientAuthError-DE7lNGZQ.cjs.map} +1 -1
- package/dist/{ManagementClientAuthError-Cr9IOsnJ.js → ManagementClientAuthError-H30lti_Q.js} +2 -2
- package/dist/{ManagementClientAuthError-Cr9IOsnJ.js.map → ManagementClientAuthError-H30lti_Q.js.map} +1 -1
- package/dist/{ValidationError-CLVJCCwH.cjs → ValidationError-D65QU0uq.cjs} +10 -16
- package/dist/ValidationError-D65QU0uq.cjs.map +1 -0
- package/dist/ValidationError-DjhtNMfZ.js +42 -0
- package/dist/ValidationError-DjhtNMfZ.js.map +1 -0
- package/dist/ai/index.cjs +2 -2
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.js +2 -2
- package/dist/ai/types.d.cts +1 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/{appLogs-C_zP0lpv.cjs → appLogs-B9zFJIuy.cjs} +2 -2
- package/dist/{appLogs-C_zP0lpv.cjs.map → appLogs-B9zFJIuy.cjs.map} +1 -1
- package/dist/{appLogs-Cl7Q_MR9.js → appLogs-BBkkUOW1.js} +2 -2
- package/dist/{appLogs-Cl7Q_MR9.js.map → appLogs-BBkkUOW1.js.map} +1 -1
- package/dist/{appLogs-Ch7DYpzx.d.ts → appLogs-BS6ViVGR.d.ts} +2 -2
- package/dist/{appLogs-D5A13Y0y.d.cts → appLogs-C9YlJ2g8.d.cts} +2 -2
- package/dist/apps/index.cjs +30 -56
- package/dist/apps/index.cjs.map +1 -1
- package/dist/apps/index.d.cts +8 -13
- package/dist/apps/index.d.ts +8 -13
- package/dist/apps/index.js +30 -56
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/types.d.cts +2 -2
- package/dist/apps/types.d.ts +2 -2
- package/dist/assets/index.cjs +1 -1
- package/dist/assets/index.d.cts +1 -1
- package/dist/assets/index.d.ts +1 -1
- package/dist/assets/index.js +1 -1
- package/dist/auth/index.cjs +8 -4
- package/dist/auth/index.d.cts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/auth/types.d.cts +2 -2
- package/dist/auth/types.d.ts +2 -2
- package/dist/{auth-DLWnl18b.cjs → auth-Dm0F2rOh.cjs} +2 -2
- package/dist/{auth-DLWnl18b.cjs.map → auth-Dm0F2rOh.cjs.map} +1 -1
- package/dist/{auth-BjmkFOgd.js → auth-DworfoPy.js} +2 -2
- package/dist/{auth-BjmkFOgd.js.map → auth-DworfoPy.js.map} +1 -1
- package/dist/{authClient-8yU1last.cjs → authClient-BmuUo0J4.cjs} +141 -48
- package/dist/authClient-BmuUo0J4.cjs.map +1 -0
- package/dist/{authClient-CTHNs6Tq.d.cts → authClient-CHXWJ9x3.d.ts} +109 -76
- package/dist/{authClient-BTo4Afm6.js → authClient-CgcDGd30.js} +108 -39
- package/dist/authClient-CgcDGd30.js.map +1 -0
- package/dist/{authClient-D8i3JTM-.d.ts → authClient-vEt_7_uk.d.cts} +109 -76
- package/dist/billing/index.cjs +2 -2
- package/dist/billing/index.d.cts +1 -1
- package/dist/billing/index.d.ts +1 -1
- package/dist/billing/index.js +2 -2
- package/dist/billing/types.d.cts +1 -1
- package/dist/billing/types.d.ts +1 -1
- package/dist/businessWorkspaceApi/index.cjs +1 -1
- package/dist/businessWorkspaceApi/index.d.cts +1 -1
- package/dist/businessWorkspaceApi/index.d.ts +1 -1
- package/dist/businessWorkspaceApi/index.js +1 -1
- package/dist/businessWorkspaceApi/types.d.cts +1 -1
- package/dist/businessWorkspaceApi/types.d.ts +1 -1
- package/dist/{businessWorkspaceApi-wyBdbpIJ.cjs → businessWorkspaceApi-6tCDdpnY.cjs} +3 -3
- package/dist/{businessWorkspaceApi-wyBdbpIJ.cjs.map → businessWorkspaceApi-6tCDdpnY.cjs.map} +1 -1
- package/dist/{businessWorkspaceApi-BD-iUj07.js → businessWorkspaceApi-BLUdefRF.js} +3 -3
- package/dist/{businessWorkspaceApi-BD-iUj07.js.map → businessWorkspaceApi-BLUdefRF.js.map} +1 -1
- package/dist/{businessWorkspaceApiClient-CRM1U8b-.d.cts → businessWorkspaceApiClient-BHDJlHFo.d.cts} +3 -3
- package/dist/{businessWorkspaceApiClient-C2WyWN3b.d.ts → businessWorkspaceApiClient-DI-z1VIH.d.ts} +3 -3
- package/dist/chat/index.cjs +7 -3
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +2 -2
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +7 -3
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/types.cjs +1 -3
- package/dist/chat/types.cjs.map +1 -1
- package/dist/chat/types.d.cts +2 -2
- package/dist/chat/types.d.ts +2 -2
- package/dist/chat/types.js +1 -3
- package/dist/chat/types.js.map +1 -1
- package/dist/{componentId-vJz-kWs6.js → componentId-BJLfnaGc.js} +6 -2
- package/dist/componentId-BJLfnaGc.js.map +1 -0
- package/dist/{componentId-DkyQ8PM0.cjs → componentId-_IKXxICq.cjs} +6 -2
- package/dist/componentId-_IKXxICq.cjs.map +1 -0
- package/dist/{concurrent-CH9fbNr3.js → concurrent-BacWxPwi.js} +5 -7
- package/dist/concurrent-BacWxPwi.js.map +1 -0
- package/dist/{concurrent-tbiIa0UL.cjs → concurrent-CdVfR1N5.cjs} +5 -7
- package/dist/concurrent-CdVfR1N5.cjs.map +1 -0
- package/dist/{configurations-CyFF9Dtu.cjs → configurations-BTRHVSRq.cjs} +20 -53
- package/dist/configurations-BTRHVSRq.cjs.map +1 -0
- package/dist/{configurations-VtNE0nrT.js → configurations-CF3xz7RB.js} +14 -22
- package/dist/configurations-CF3xz7RB.js.map +1 -0
- package/dist/{configurations-BVvcimzo.js → configurations-Chg_JwJ1.js} +20 -53
- package/dist/configurations-Chg_JwJ1.js.map +1 -0
- package/dist/{configurations-zkNjr73Q.cjs → configurations-VlfQ_37Y.cjs} +14 -22
- package/dist/configurations-VlfQ_37Y.cjs.map +1 -0
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/{createFetchClient-BlgPbjFj.cjs → createFetchClient-Cwp8max9.cjs} +11 -4
- package/dist/createFetchClient-Cwp8max9.cjs.map +1 -0
- package/dist/{createFetchClient-C-cadpBx.js → createFetchClient-DXHQK63w.js} +11 -4
- package/dist/createFetchClient-DXHQK63w.js.map +1 -0
- package/dist/{createGenericFetchClient-Bnf1QK9W.js → createGenericFetchClient-Dg1rgzmG.js} +2 -2
- package/dist/{createGenericFetchClient-Bnf1QK9W.js.map → createGenericFetchClient-Dg1rgzmG.js.map} +1 -1
- package/dist/{createGenericFetchClient-lcozzwk2.cjs → createGenericFetchClient-Dl9cqTvR.cjs} +2 -2
- package/dist/{createGenericFetchClient-lcozzwk2.cjs.map → createGenericFetchClient-Dl9cqTvR.cjs.map} +1 -1
- package/dist/{createOpenapiFetchClient-C3UmDXpe.cjs → createOpenapiFetchClient-BYqW-9tm.cjs} +2 -2
- package/dist/{createOpenapiFetchClient-C3UmDXpe.cjs.map → createOpenapiFetchClient-BYqW-9tm.cjs.map} +1 -1
- package/dist/{createOpenapiFetchClient-COaPeeQ0.js → createOpenapiFetchClient-DZUOVupy.js} +2 -2
- package/dist/{createOpenapiFetchClient-COaPeeQ0.js.map → createOpenapiFetchClient-DZUOVupy.js.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-D-hyc4GY.cjs → dataScience-B5QxZnvW.cjs} +5 -5
- package/dist/{dataScience-D-hyc4GY.cjs.map → dataScience-B5QxZnvW.cjs.map} +1 -1
- package/dist/{dataScience-B_BmnB1m.js → dataScience-OXcwdk1p.js} +5 -5
- package/dist/{dataScience-B_BmnB1m.js.map → dataScience-OXcwdk1p.js.map} +1 -1
- package/dist/dedupe-Cky1gSUu.js +21 -0
- package/dist/dedupe-Cky1gSUu.js.map +1 -0
- package/dist/dedupe-OSnnst2u.cjs +26 -0
- package/dist/dedupe-OSnnst2u.cjs.map +1 -0
- 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 -1
- package/dist/developerPortal/types.d.cts +1 -1
- package/dist/developerPortal/types.d.ts +1 -1
- package/dist/{developerPortalClient-yHFTkKPb.js → developerPortalClient-B1QZ1rYi.js} +6 -8
- package/dist/{developerPortalClient-yHFTkKPb.js.map → developerPortalClient-B1QZ1rYi.js.map} +1 -1
- package/dist/{developerPortalClient-CutPqoAa.cjs → developerPortalClient-CLPpBksD.cjs} +6 -8
- package/dist/{developerPortalClient-CutPqoAa.cjs.map → developerPortalClient-CLPpBksD.cjs.map} +1 -1
- package/dist/domain/permissions/index.cjs +9 -30
- package/dist/domain/permissions/index.cjs.map +1 -1
- package/dist/domain/permissions/index.d.cts +29 -102
- package/dist/domain/permissions/index.d.ts +29 -102
- package/dist/domain/permissions/index.js +9 -30
- package/dist/domain/permissions/index.js.map +1 -1
- package/dist/domain/storageTable/index.d.cts +1 -1
- package/dist/domain/storageTable/index.d.ts +1 -1
- package/dist/editor/index.cjs +2 -2
- package/dist/editor/index.cjs.map +1 -1
- package/dist/editor/index.d.cts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +2 -2
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/encryption/index.cjs +2 -22
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/index.js +2 -22
- package/dist/encryption/index.js.map +1 -1
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/import/index.cjs +1 -1
- package/dist/import/index.d.cts +3 -3
- package/dist/import/index.d.ts +3 -3
- package/dist/import/index.js +1 -1
- package/dist/{import-7YyyD_U_.cjs → import-CNk89mqy.cjs} +3 -3
- package/dist/{import-7YyyD_U_.cjs.map → import-CNk89mqy.cjs.map} +1 -1
- package/dist/{import-xliONVib.js → import-DiMQCzLa.js} +3 -3
- package/dist/{import-xliONVib.js.map → import-DiMQCzLa.js.map} +1 -1
- package/dist/{index-1r_CskjU.d.ts → index--ZpnE3YT.d.cts} +3 -3
- package/dist/{index-DBklbaTp.d.cts → index-B5w7WlaU.d.cts} +5 -1
- package/dist/{index-DBklbaTp.d.ts → index-B5w7WlaU.d.ts} +5 -1
- package/dist/{index-C77vTm2K.d.ts → index-BDZvaRud.d.ts} +6 -6
- package/dist/{index-KuQ79Mnz.d.ts → index-BVhHt5lx.d.cts} +18 -26
- package/dist/{index-NC1dXRTD.d.ts → index-BfqkgPGI.d.cts} +7 -13
- package/dist/{index-NC1dXRTD.d.cts → index-BfqkgPGI.d.ts} +7 -13
- package/dist/{index-V7XKUQm9.d.cts → index-BgR5zcjJ.d.ts} +18 -26
- package/dist/{index-BK-qHT39.d.ts → index-ByRpNVcs.d.cts} +83 -17
- package/dist/{index-pXN4LWUX.d.ts → index-C11JSxBY.d.ts} +8 -11
- package/dist/{index-GjcJTCbz.d.cts → index-C4TNAA8-.d.cts} +8 -11
- package/dist/{index-BMqLPS6S.d.ts → index-CXcWpZQ2.d.cts} +4 -12
- package/dist/{index-BMqLPS6S.d.cts → index-CXcWpZQ2.d.ts} +4 -12
- package/dist/{index-GfKzh267.d.ts → index-CaaTOANF.d.ts} +395 -297
- package/dist/{index-Dx52hNLP.d.cts → index-CcMHJcuP.d.cts} +3 -3
- package/dist/{index-DVw4Av4b.d.cts → index-Cvbjp3jx.d.cts} +6 -6
- package/dist/{index-DppA4k3b.d.cts → index-Cz0MXhzs.d.cts} +5 -5
- package/dist/{index-6Xe81qN3.d.ts → index-D-VMgpGc.d.ts} +5 -5
- package/dist/{index-DWf6FXOr.d.cts → index-D7-o-oGa.d.ts} +3 -3
- package/dist/{index-CWoEnDJ_.d.cts → index-DCRKjihs.d.ts} +83 -17
- package/dist/{kaiAgentClient-CHpULyeG.d.cts → index-DNThyEej.d.cts} +14 -5
- package/dist/{index-DXSmFkol.d.cts → index-DOAZmWvh.d.cts} +6 -6
- package/dist/{index-BuegqrS1.d.ts → index-D_-4uQF8.d.ts} +3 -3
- package/dist/index-DbLFwXgb.d.cts +116 -0
- package/dist/{index-De5qUWhp.d.ts → index-DnQTuc6t.d.ts} +6 -6
- package/dist/{kaiAgentClient-B5L4gbQ1.d.ts → index-Qb7X6-ph.d.ts} +14 -5
- package/dist/{index-CHXnJQ9s.d.cts → index-cWp_V6K5.d.cts} +395 -297
- package/dist/index-rwK7GcB2.d.ts +116 -0
- package/dist/index.cjs +1498 -901
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1497 -902
- package/dist/index.js.map +1 -1
- package/dist/isLoginPageRedirect-XPwAOKK3.js +14 -0
- package/dist/isLoginPageRedirect-XPwAOKK3.js.map +1 -0
- package/dist/isLoginPageRedirect-jQHiLrG7.cjs +19 -0
- package/dist/isLoginPageRedirect-jQHiLrG7.cjs.map +1 -0
- package/dist/{jobStatus-0_Y3Sr4i.cjs → jobStatus-BMlsyXWI.cjs} +19 -45
- package/dist/jobStatus-BMlsyXWI.cjs.map +1 -0
- package/dist/{jobStatus-PSZJMTiA.js → jobStatus-CfRtsIpv.js} +19 -45
- package/dist/jobStatus-CfRtsIpv.js.map +1 -0
- package/dist/kaiAgent/index.cjs +1 -1
- package/dist/kaiAgent/index.d.cts +3 -2
- package/dist/kaiAgent/index.d.ts +3 -2
- package/dist/kaiAgent/index.js +1 -1
- package/dist/kaiAgent/types.d.cts +2 -2
- package/dist/kaiAgent/types.d.ts +2 -2
- package/dist/{kaiAgent-CcT2oNip.js → kaiAgent-Dp20HLTh.js} +32 -11
- package/dist/kaiAgent-Dp20HLTh.js.map +1 -0
- package/dist/{kaiAgent-DaB6UCsh.cjs → kaiAgent-QNoeVKPs.cjs} +32 -11
- package/dist/kaiAgent-QNoeVKPs.cjs.map +1 -0
- package/dist/kaiMemory-CClSPInt.cjs +289 -0
- package/dist/kaiMemory-CClSPInt.cjs.map +1 -0
- package/dist/kaiMemory-D0Y_16U4.js +260 -0
- package/dist/kaiMemory-D0Y_16U4.js.map +1 -0
- package/dist/management/index.cjs +1 -1
- package/dist/management/index.d.cts +1 -1
- package/dist/management/index.d.ts +1 -1
- package/dist/management/index.js +1 -1
- package/dist/management/types.d.cts +2 -2
- package/dist/management/types.d.ts +2 -2
- package/dist/{management-DeZiQSlw.cjs → management-CCY0IYnq.cjs} +59 -24
- package/dist/management-CCY0IYnq.cjs.map +1 -0
- package/dist/{management-ckdnu1dA.js → management-DvmPiG64.js} +59 -24
- package/dist/management-DvmPiG64.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 -1
- package/dist/metastore/types.d.cts +2 -2
- package/dist/metastore/types.d.ts +2 -2
- package/dist/{metastore-B0PolCjQ.js → metastore-BycJxe7A.js} +14 -8
- package/dist/metastore-BycJxe7A.js.map +1 -0
- package/dist/{metastore-9AGrwjmN.cjs → metastore-XtWciCZT.cjs} +14 -8
- package/dist/metastore-XtWciCZT.cjs.map +1 -0
- package/dist/microsoftGraph/index.cjs +2 -2
- package/dist/microsoftGraph/index.d.cts +2 -2
- package/dist/microsoftGraph/index.d.ts +2 -2
- package/dist/microsoftGraph/index.js +2 -2
- package/dist/microsoftGraph/types.d.cts +1 -1
- package/dist/microsoftGraph/types.d.ts +1 -1
- package/dist/middleware-CBwrtgQd.js +34 -0
- package/dist/middleware-CBwrtgQd.js.map +1 -0
- package/dist/middleware-IjYx3d5u.cjs +45 -0
- package/dist/middleware-IjYx3d5u.cjs.map +1 -0
- package/dist/notifications/index.cjs +4 -4
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +4 -4
- 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 -2
- package/dist/oauth/index.d.ts +2 -2
- package/dist/oauth/index.js +1 -1
- package/dist/oauth/types.d.cts +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/{oauth-DNtv4Ihb.cjs → oauth--2p8jkJf.cjs} +5 -5
- package/dist/{oauth-DNtv4Ihb.cjs.map → oauth--2p8jkJf.cjs.map} +1 -1
- package/dist/{oauth-BnHVf4cB.js → oauth-l5zE39cD.js} +5 -5
- package/dist/{oauth-BnHVf4cB.js.map → oauth-l5zE39cD.js.map} +1 -1
- package/dist/omnisearch/index.cjs +6 -14
- package/dist/omnisearch/index.cjs.map +1 -1
- package/dist/omnisearch/index.d.cts +6 -14
- package/dist/omnisearch/index.d.ts +6 -14
- package/dist/omnisearch/index.js +6 -14
- package/dist/omnisearch/index.js.map +1 -1
- package/dist/omnisearch/types.d.cts +1 -1
- package/dist/omnisearch/types.d.ts +1 -1
- package/dist/{project-DCHOxRWd.d.ts → project-B15gStbM.d.ts} +2 -2
- package/dist/{project-BRpzv3yE.d.cts → project-cHKuGvqJ.d.cts} +2 -2
- package/dist/queryService/index.cjs +1 -1
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/index.js +1 -1
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/{queryService-j3XZ2mX6.js → queryService-CCOYbRbw.js} +6 -6
- package/dist/{queryService-j3XZ2mX6.js.map → queryService-CCOYbRbw.js.map} +1 -1
- package/dist/{queryService-BVwD6Vmc.cjs → queryService-CQzclHdL.cjs} +6 -6
- package/dist/{queryService-BVwD6Vmc.cjs.map → queryService-CQzclHdL.cjs.map} +1 -1
- package/dist/queue/index.cjs +1 -1
- package/dist/queue/index.d.cts +3 -3
- package/dist/queue/index.d.ts +3 -3
- package/dist/queue/index.js +1 -1
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/{queue-Dagl0sdP.js → queue-Cowbg6bR.js} +8 -11
- package/dist/queue-Cowbg6bR.js.map +1 -0
- package/dist/{queue-e3rMWbmK.cjs → queue-UG_BWKIC.cjs} +8 -11
- package/dist/queue-UG_BWKIC.cjs.map +1 -0
- package/dist/scheduler/index.cjs +4 -4
- package/dist/scheduler/index.d.cts +2 -2
- package/dist/scheduler/index.d.ts +2 -2
- package/dist/scheduler/index.js +4 -4
- package/dist/scheduler/types.d.cts +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/sdk/configurations/index.cjs +1 -1
- package/dist/sdk/configurations/index.d.cts +11 -11
- package/dist/sdk/configurations/index.d.ts +11 -11
- package/dist/sdk/configurations/index.js +1 -1
- package/dist/sdk/developerPortal/index.cjs +10 -18
- package/dist/sdk/developerPortal/index.cjs.map +1 -1
- package/dist/sdk/developerPortal/index.d.cts +7 -15
- package/dist/sdk/developerPortal/index.d.ts +7 -15
- package/dist/sdk/developerPortal/index.js +7 -15
- package/dist/sdk/developerPortal/index.js.map +1 -1
- package/dist/sdk/kaiMemory/index.cjs +7 -0
- package/dist/sdk/kaiMemory/index.d.cts +41 -0
- package/dist/sdk/kaiMemory/index.d.ts +41 -0
- package/dist/sdk/kaiMemory/index.js +2 -0
- package/dist/sdk/kaiMemory/types.cjs +0 -0
- package/dist/sdk/kaiMemory/types.d.cts +2 -0
- package/dist/sdk/kaiMemory/types.d.ts +2 -0
- package/dist/sdk/kaiMemory/types.js +1 -0
- package/dist/sdk/queryService/index.cjs +2 -2
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/queryService/index.js +2 -2
- package/dist/sdk/semanticLayer/index.cjs +1 -1
- package/dist/sdk/semanticLayer/index.d.cts +16 -40
- package/dist/sdk/semanticLayer/index.d.ts +16 -40
- package/dist/sdk/semanticLayer/index.js +1 -1
- package/dist/sdk/semanticLayer/types.d.cts +1 -1
- package/dist/sdk/semanticLayer/types.d.ts +1 -1
- package/dist/sdk/storage/index.cjs +0 -5
- package/dist/sdk/storage/index.cjs.map +1 -1
- package/dist/sdk/storage/index.d.cts +2 -2
- package/dist/sdk/storage/index.d.ts +2 -2
- package/dist/sdk/storage/index.js +1 -5
- 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 -3
- package/dist/sdk/tag/index.d.ts +3 -3
- package/dist/sdk/tag/index.js +1 -1
- package/dist/sdk/tag/types.d.cts +1 -1
- package/dist/sdk/tag/types.d.ts +1 -1
- package/dist/sdk/vault/index.cjs +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 +1 -1
- package/dist/{semanticLayer-9uTaU7UT.cjs → semanticLayer-CKDVkU56.cjs} +62 -183
- package/dist/semanticLayer-CKDVkU56.cjs.map +1 -0
- package/dist/{semanticLayer-6_gtFxDu.js → semanticLayer-pYy082Ju.js} +62 -183
- package/dist/semanticLayer-pYy082Ju.js.map +1 -0
- package/dist/status/index.cjs +1 -1
- package/dist/status/index.d.cts +1 -1
- package/dist/status/index.d.ts +1 -1
- package/dist/status/index.js +1 -1
- package/dist/storage/index.cjs +5 -5
- package/dist/storage/index.d.cts +2 -2
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.js +5 -5
- package/dist/storage/types.d.cts +2 -2
- package/dist/storage/types.d.ts +2 -2
- package/dist/{storage-Ob1LUIDq.js → storage-CZQHZcXG.js} +109 -302
- package/dist/storage-CZQHZcXG.js.map +1 -0
- package/dist/{storage-HFUdEy7P.cjs → storage-JinL1y1s.cjs} +109 -302
- package/dist/storage-JinL1y1s.cjs.map +1 -0
- package/dist/stream/index.cjs +3 -3
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/index.js +3 -3
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/syncActions/index.cjs +1 -1
- package/dist/syncActions/index.d.cts +1 -1
- package/dist/syncActions/index.d.ts +1 -1
- package/dist/syncActions/index.js +1 -1
- package/dist/syncActions/types.d.cts +2 -2
- package/dist/syncActions/types.d.ts +2 -2
- package/dist/{syncActions-B3NS5a0g.js → syncActions-ChNWuhYA.js} +260 -111
- package/dist/syncActions-ChNWuhYA.js.map +1 -0
- package/dist/{syncActions-D2DhY6pP.cjs → syncActions-mFlF16cl.cjs} +260 -111
- package/dist/syncActions-mFlF16cl.cjs.map +1 -0
- package/dist/{tag-CsoOZWB_.cjs → tag-DHS_soa7.cjs} +2 -2
- package/dist/{tag-CsoOZWB_.cjs.map → tag-DHS_soa7.cjs.map} +1 -1
- package/dist/{tag-DCsoewjL.js → tag-hh-1nhNr.js} +2 -2
- package/dist/{tag-DCsoewjL.js.map → tag-hh-1nhNr.js.map} +1 -1
- package/dist/telemetry/index.cjs +7 -11
- package/dist/telemetry/index.cjs.map +1 -1
- package/dist/telemetry/index.d.cts +5 -9
- package/dist/telemetry/index.d.ts +5 -9
- package/dist/telemetry/index.js +7 -11
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/types.d.cts +1 -1
- package/dist/telemetry/types.d.ts +1 -1
- package/dist/{types-DqxIx9Pi.d.cts → types-6kuMW4JW.d.cts} +2 -2
- package/dist/{types-Ct0YPy2w.d.ts → types-B2w2TtSA.d.ts} +3 -3
- package/dist/{types-M46WuBSm.d.cts → types-B61aCifg.d.cts} +2 -2
- package/dist/{types-COL1kVEB.d.cts → types-B8N_k79M.d.cts} +2 -2
- package/dist/{types-Jw10xuOW.d.cts → types-BIECJYun.d.ts} +171 -44
- package/dist/{types-DZk3XHiN.d.cts → types-BLNB882w.d.cts} +3 -3
- package/dist/{types-BEe50G2r.d.cts → types-BPy5Ozee.d.cts} +2 -2
- package/dist/{types-gi4Eay19.d.ts → types-BS4jwuMi.d.ts} +7 -15
- package/dist/{types-BrYkBQo4.d.ts → types-BTK7Bv3n.d.cts} +171 -44
- package/dist/{types-D6UmMa6E.d.ts → types-BZDV8DZk.d.ts} +3 -3
- package/dist/{types-Cz83RiVu.d.cts → types-B_iLJlp4.d.ts} +255 -12
- package/dist/{types-CmF3pR2n.d.cts → types-BiMahEK8.d.cts} +91 -237
- package/dist/{types-BH5LLeJy.d.ts → types-Bl03Cg2n.d.cts} +255 -12
- package/dist/{types-bGQb4Jtl.d.cts → types-ByLH46Dt.d.cts} +13 -8
- package/dist/{types-g3vU7hcg.d.cts → types-Bydx6ga_.d.cts} +2 -2
- package/dist/{types-B95uNQ9o.d.ts → types-CKmTZSPG.d.ts} +91 -237
- package/dist/{types-D_j2Uq5X.d.cts → types-CMzQSHAQ.d.cts} +3 -3
- package/dist/{types-N3EChotg.d.cts → types-CP_LBmw3.d.cts} +2 -2
- package/dist/{types-CW6lCqrC.d.cts → types-CQFOCQzk.d.ts} +230 -43
- package/dist/{types-zZBxJ0P-.d.ts → types-CWyXTMwy.d.ts} +2 -2
- package/dist/{types-CPB-eF82.d.ts → types-CZJlLCbA.d.ts} +2 -2
- package/dist/{types-l9o4gFsI.d.ts → types-CZXPu3gn.d.ts} +2 -2
- package/dist/{types-BztF4HeB.d.ts → types-CaOtNjSZ.d.ts} +6 -13
- package/dist/{types-BTWIPEiU.d.ts → types-CfwqVkEA.d.ts} +2 -2
- package/dist/types-Cg14ncdV.d.ts +63 -0
- package/dist/{types-BsxLGDoC.d.cts → types-CoJVrRAD.d.ts} +2 -2
- package/dist/{types-DYzJ6K2e.d.ts → types-CqwHP7mN.d.cts} +230 -43
- package/dist/{types-CKiW3n6v.d.ts → types-D3wcs4tp.d.ts} +2 -2
- package/dist/{types-DOyNe7oe.d.cts → types-DDOa07rU.d.cts} +7 -15
- package/dist/{types-BW2BXUB4.d.cts → types-DE9hgr7i.d.cts} +2 -2
- package/dist/{types-BOqD3Hqy.d.cts → types-DEzW1CfI.d.cts} +3 -3
- package/dist/{types-OaD-cbbl.d.ts → types-DIiOMV-t.d.ts} +3 -3
- package/dist/{types-B-P4vQe0.d.cts → types-DKc1gmd9.d.ts} +857 -131
- package/dist/{types-BrPlv-NS.d.ts → types-DRCMBt89.d.ts} +3 -3
- package/dist/{types-BQvv4RaI.d.cts → types-DUMal2E-.d.cts} +5 -8
- package/dist/types-DWiLcrxt.d.cts +63 -0
- package/dist/{types-DNxOHnZI.d.cts → types-Dd31Lw4S.d.cts} +2 -2
- package/dist/{types-Dmu-8g4O.d.ts → types-DekYAlA-.d.ts} +3 -3
- package/dist/{types-B2U9cFcx.d.ts → types-DgJeO9Nd.d.ts} +2 -2
- package/dist/{types-nrviNdzZ.d.ts → types-DicSaNwq.d.ts} +2 -2
- package/dist/{types-Crhy0c9m.d.cts → types-DinIJ1D_.d.cts} +40 -11
- package/dist/{types-DhDNS-5B.d.ts → types-DlQw6FCi.d.ts} +13 -8
- package/dist/{types-_RhBCj4_.d.cts → types-DoZtE9tz.d.cts} +3 -3
- package/dist/{types-Bxhh2SJr.d.ts → types-DrvKfXXd.d.cts} +2 -2
- package/dist/{types-DPl8pZsY.d.ts → types-Dtuvhm3K.d.cts} +857 -131
- package/dist/{types-CcrvrAJX.d.ts → types-DwVSj-Da.d.ts} +5 -8
- package/dist/{types-C2vefB4D.d.ts → types-FwRmjsNN.d.ts} +10 -34
- package/dist/{types-C0_2KZ-A.d.ts → types-RbrfiY8T.d.ts} +2 -2
- package/dist/{types-DfvdbRPL.d.ts → types-WZBztugL.d.ts} +2 -2
- package/dist/{types-52irAt99.d.cts → types-YHUEArkR.d.cts} +2 -2
- package/dist/{types-fX4gbxfV.d.cts → types-bc-4z_gc.d.cts} +10 -34
- package/dist/{types-3eUgOA7I.d.cts → types-ePSqbXRr.d.cts} +6 -13
- package/dist/{types-DrqKICcK.d.ts → types-n4PTnLii.d.ts} +40 -11
- package/dist/{types-DXskkNp8.d.cts → types-pvQzbgNE.d.cts} +3 -3
- package/dist/{types-DajzGOKB.d.ts → types-q-1r_9d1.d.ts} +2 -2
- package/dist/{types-D8Rrz51O.d.cts → types-tKkeLa2B.d.cts} +2 -2
- package/dist/{validateConnectionStatus-828HV8WL.js → validateConnectionStatus-BEGu8wXT.js} +6 -10
- package/dist/validateConnectionStatus-BEGu8wXT.js.map +1 -0
- package/dist/{validateConnectionStatus-CvBKyeDO.cjs → validateConnectionStatus-BEYkQpu9.cjs} +6 -10
- package/dist/validateConnectionStatus-BEYkQpu9.cjs.map +1 -0
- package/dist/vault/index.cjs +4 -4
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/index.js +4 -4
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/package.json +32 -4
- package/surface/apps.md +3 -3
- package/surface/auth.md +13 -6
- package/surface/chat.md +6 -6
- package/surface/kaiAgent.md +9 -8
- package/surface/management.md +14 -5
- package/surface/metastore.md +2 -2
- package/surface/queue.md +3 -3
- package/surface/sdk.md +13 -3
- package/surface/storage.md +6 -6
- package/surface/syncActions.md +16 -0
- package/dist/ValidationError-BekhphAq.js +0 -48
- package/dist/ValidationError-BekhphAq.js.map +0 -1
- package/dist/ValidationError-CLVJCCwH.cjs.map +0 -1
- package/dist/authClient-8yU1last.cjs.map +0 -1
- package/dist/authClient-BTo4Afm6.js.map +0 -1
- package/dist/componentId-DkyQ8PM0.cjs.map +0 -1
- package/dist/componentId-vJz-kWs6.js.map +0 -1
- package/dist/concurrent-CH9fbNr3.js.map +0 -1
- package/dist/concurrent-tbiIa0UL.cjs.map +0 -1
- package/dist/configurations-BVvcimzo.js.map +0 -1
- package/dist/configurations-CyFF9Dtu.cjs.map +0 -1
- package/dist/configurations-VtNE0nrT.js.map +0 -1
- package/dist/configurations-zkNjr73Q.cjs.map +0 -1
- package/dist/createFetchClient-BlgPbjFj.cjs.map +0 -1
- package/dist/createFetchClient-C-cadpBx.js.map +0 -1
- package/dist/credential-CAulvfZ-.cjs +0 -47
- package/dist/credential-CAulvfZ-.cjs.map +0 -1
- package/dist/credential-DWXbo4IX.js +0 -36
- package/dist/credential-DWXbo4IX.js.map +0 -1
- package/dist/dedupe-CiskLkGR.cjs +0 -30
- package/dist/dedupe-CiskLkGR.cjs.map +0 -1
- package/dist/dedupe-DYIHgZoG.js +0 -25
- package/dist/dedupe-DYIHgZoG.js.map +0 -1
- package/dist/index-3LUk2rpD.d.ts +0 -65
- package/dist/index-CW3Pj7DY.d.cts +0 -65
- package/dist/isLoginPageRedirect-Cm6Pn8Pj.cjs +0 -25
- package/dist/isLoginPageRedirect-Cm6Pn8Pj.cjs.map +0 -1
- package/dist/isLoginPageRedirect-hyPqyWNX.js +0 -20
- package/dist/isLoginPageRedirect-hyPqyWNX.js.map +0 -1
- package/dist/jobStatus-0_Y3Sr4i.cjs.map +0 -1
- package/dist/jobStatus-PSZJMTiA.js.map +0 -1
- package/dist/kaiAgent-CcT2oNip.js.map +0 -1
- package/dist/kaiAgent-DaB6UCsh.cjs.map +0 -1
- package/dist/management-DeZiQSlw.cjs.map +0 -1
- package/dist/management-ckdnu1dA.js.map +0 -1
- package/dist/metastore-9AGrwjmN.cjs.map +0 -1
- package/dist/metastore-B0PolCjQ.js.map +0 -1
- package/dist/queue-Dagl0sdP.js.map +0 -1
- package/dist/queue-e3rMWbmK.cjs.map +0 -1
- package/dist/semanticLayer-6_gtFxDu.js.map +0 -1
- package/dist/semanticLayer-9uTaU7UT.cjs.map +0 -1
- package/dist/storage-HFUdEy7P.cjs.map +0 -1
- package/dist/storage-Ob1LUIDq.js.map +0 -1
- package/dist/syncActions-B3NS5a0g.js.map +0 -1
- package/dist/syncActions-D2DhY6pP.cjs.map +0 -1
- package/dist/validateConnectionStatus-828HV8WL.js.map +0 -1
- package/dist/validateConnectionStatus-CvBKyeDO.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dn as UpdateConfigurationInput, Xt as BaseComponentConfig, an as ConfigurationPath, sn as CreateConfigurationInput } from "../../types-
|
|
3
|
-
import { t as createEncryptionClient } from "../../index-
|
|
4
|
-
import { t as Project } from "../../project-
|
|
1
|
+
import { H as createStorageClient, I as RegisteredComponentId, L as registry, tn as createDefaultBranch } from "../../index-CaaTOANF.js";
|
|
2
|
+
import { Dn as UpdateConfigurationInput, Xt as BaseComponentConfig, an as ConfigurationPath, sn as CreateConfigurationInput } from "../../types-CKmTZSPG.js";
|
|
3
|
+
import { t as createEncryptionClient } from "../../index-D7-o-oGa.js";
|
|
4
|
+
import { t as Project } from "../../project-B15gStbM.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/sdks/configurations/configurationsSdk.d.ts
|
|
7
7
|
type ConfigurationSdkContext = {
|
|
@@ -21,13 +21,10 @@ type TypedConfiguration<ComponentId extends RegisteredComponentId> = {
|
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* How an update writes the patch against the stored configuration:
|
|
24
|
-
* - `'merge'` (default) —
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* - `'replace'` — store exactly what the caller sends (after validation + encryption); no read,
|
|
29
|
-
* no merge. Completeness is on the caller — any field or sibling key (e.g. `storage`) it omits
|
|
30
|
-
* is gone.
|
|
24
|
+
* - `'merge'` (default) — reads the config, deep-merges by schema; credential unions and arrays are
|
|
25
|
+
* replaced wholesale (dropping an abandoned secret), out-of-schema keys kept.
|
|
26
|
+
* - `'replace'` — stores exactly what is sent (validated + encrypted); anything omitted,
|
|
27
|
+
* e.g. `storage`, is gone.
|
|
31
28
|
*/
|
|
32
29
|
type UpdateMode = 'merge' | 'replace';
|
|
33
30
|
declare const createConfigurationSdk: ({ storageClient, encryptionClient, context }: Options) => {
|
|
@@ -906,6 +903,7 @@ declare const createConfigurationSdk: ({ storageClient, encryptionClient, contex
|
|
|
906
903
|
parameters: z.ZodObject<{
|
|
907
904
|
customerId: z.ZodArray<z.ZodString>;
|
|
908
905
|
onlyEnabledCustomers: z.ZodOptional<z.ZodBoolean>;
|
|
906
|
+
continueOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
909
907
|
getAccountChildren: z.ZodOptional<z.ZodBoolean>;
|
|
910
908
|
}, z.core.$strip>;
|
|
911
909
|
}, z.core.$strip>> & Record<"keboola.ex-http", z.ZodObject<{
|
|
@@ -1922,6 +1920,7 @@ declare const createConfigurationSdk: ({ storageClient, encryptionClient, contex
|
|
|
1922
1920
|
parameters: z.ZodObject<{
|
|
1923
1921
|
customerId: z.ZodArray<z.ZodString>;
|
|
1924
1922
|
onlyEnabledCustomers: z.ZodOptional<z.ZodBoolean>;
|
|
1923
|
+
continueOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
1925
1924
|
getAccountChildren: z.ZodOptional<z.ZodBoolean>;
|
|
1926
1925
|
}, z.core.$strip>;
|
|
1927
1926
|
}, z.core.$strip>> & Record<"keboola.ex-http", z.ZodObject<{
|
|
@@ -2940,6 +2939,7 @@ declare const createConfigurationSdk: ({ storageClient, encryptionClient, contex
|
|
|
2940
2939
|
parameters: z.ZodObject<{
|
|
2941
2940
|
customerId: z.ZodArray<z.ZodString>;
|
|
2942
2941
|
onlyEnabledCustomers: z.ZodOptional<z.ZodBoolean>;
|
|
2942
|
+
continueOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
2943
2943
|
getAccountChildren: z.ZodOptional<z.ZodBoolean>;
|
|
2944
2944
|
}, z.core.$strip>;
|
|
2945
2945
|
}, z.core.$strip>> & Record<"keboola.ex-http", z.ZodObject<{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createConfigurationSdk } from "../../configurations-
|
|
1
|
+
import { t as createConfigurationSdk } from "../../configurations-CF3xz7RB.js";
|
|
2
2
|
export { createConfigurationSdk };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dedupe = require("../../dedupe-
|
|
2
|
+
const require_dedupe = require("../../dedupe-OSnnst2u.cjs");
|
|
3
3
|
const require_store = require("../../store-xS-Cu_VS.cjs");
|
|
4
|
-
const require_createFetchClient = require("../../createFetchClient-
|
|
5
|
-
const
|
|
6
|
-
const require_developerPortalClient = require("../../developerPortalClient-
|
|
4
|
+
const require_createFetchClient = require("../../createFetchClient-Cwp8max9.cjs");
|
|
5
|
+
const require_middleware = require("../../middleware-IjYx3d5u.cjs");
|
|
6
|
+
const require_developerPortalClient = require("../../developerPortalClient-CLPpBksD.cjs");
|
|
7
7
|
//#region src/sdks/developerPortal/tokenExpiry.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable ("expiry unknown", which the
|
|
@@ -38,7 +38,7 @@ const createDeveloperPortalCredential = ({ refresh, getTokens, onSessionExpired,
|
|
|
38
38
|
try {
|
|
39
39
|
return await refresh();
|
|
40
40
|
} catch (error) {
|
|
41
|
-
if (
|
|
41
|
+
if (require_middleware.isUnauthorized(error)) onSessionExpired?.();
|
|
42
42
|
throw error;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
@@ -75,7 +75,7 @@ const createDeveloperPortalAuthMiddleware = (credential) => {
|
|
|
75
75
|
try {
|
|
76
76
|
return await next(request);
|
|
77
77
|
} catch (error) {
|
|
78
|
-
if (!
|
|
78
|
+
if (!require_middleware.isUnauthorized(error)) throw error;
|
|
79
79
|
const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);
|
|
80
80
|
if (refreshed === null) throw error;
|
|
81
81
|
retryRequest.headers.set(require_createFetchClient.HttpHeader.AUTHORIZATION, refreshed);
|
|
@@ -85,7 +85,7 @@ const createDeveloperPortalAuthMiddleware = (credential) => {
|
|
|
85
85
|
request: retryRequest
|
|
86
86
|
});
|
|
87
87
|
} catch (retryError) {
|
|
88
|
-
if (
|
|
88
|
+
if (require_middleware.isUnauthorized(retryError)) credential.notifyExpired();
|
|
89
89
|
throw retryError;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -94,13 +94,9 @@ const createDeveloperPortalAuthMiddleware = (credential) => {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/sdks/developerPortal/developerPortalSdk.ts
|
|
96
96
|
/**
|
|
97
|
-
* `createDeveloperPortalClient` plus the session that keeps it authenticated
|
|
98
|
-
* credential, the auth middleware, and the tokens the four self-authenticating endpoints need.
|
|
97
|
+
* `createDeveloperPortalClient` plus the session that keeps it authenticated.
|
|
99
98
|
*
|
|
100
|
-
*
|
|
101
|
-
* needs the credential, the credential needs the session, and the session needs a client to rotate
|
|
102
|
-
* with. `createKeboola` closes the same cycle the same way, and stays separate from this one because
|
|
103
|
-
* apps-api is its own identity domain.
|
|
99
|
+
* - Builds its own client: middleware, credential and session depend on each other in a cycle.
|
|
104
100
|
*/
|
|
105
101
|
const createDeveloperPortalSdk = ({ baseUrl, tokens: initialTokens = null, onTokensChange, onSessionExpired, refreshLeadTimeMs, middlewares = [] }) => {
|
|
106
102
|
const store = require_store.createStore(initialTokens);
|
|
@@ -185,11 +181,7 @@ const createDeveloperPortalSdk = ({ baseUrl, tokens: initialTokens = null, onTok
|
|
|
185
181
|
ensureFresh: async () => {
|
|
186
182
|
await credential.getIdToken();
|
|
187
183
|
},
|
|
188
|
-
/**
|
|
189
|
-
* Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that
|
|
190
|
-
* matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.
|
|
191
|
-
* Propagates failure: a caller forcing this needs to know whether the claims actually changed.
|
|
192
|
-
*/
|
|
184
|
+
/** Rotates now, for a change of claims (e.g. leaving a vendor). Propagates failure. */
|
|
193
185
|
refresh: async () => {
|
|
194
186
|
await credential.getIdToken({ forceRefresh: true });
|
|
195
187
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["isUnauthorized","dedupe","HttpHeader","isUnauthorized","createStore","createDeveloperPortalClient"],"sources":["../../../src/sdks/developerPortal/tokenExpiry.ts","../../../src/sdks/developerPortal/credential.ts","../../../src/sdks/developerPortal/middleware.ts","../../../src/sdks/developerPortal/developerPortalSdk.ts"],"sourcesContent":["/**\n * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable (\"expiry unknown\", which the\n * caller leaves to the 401 path). A read, not a verification.\n *\n * Needed because apps-api reports `expiresIn` on login but never on refresh, so it cannot keep a\n * proactive-refresh clock honest past the first rotation. The token always carries its own expiry.\n */\nexport const readTokenExpiry = (token: string): number | null => {\n const segments = token.split('.');\n if (segments.length !== 3) return null;\n\n const payload = segments[1];\n if (payload === undefined || payload === '') return null;\n\n try {\n // base64url -> base64, and re-pad: `atob` requires padding, base64url omits it.\n const base64 = payload.replaceAll('-', '+').replaceAll('_', '/');\n const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');\n const claims: unknown = JSON.parse(atob(padded));\n if (typeof claims !== 'object' || claims === null || !('exp' in claims)) return null;\n const { exp } = claims as { exp: unknown };\n if (typeof exp !== 'number' || !Number.isFinite(exp)) return null;\n return exp * 1000;\n } catch {\n return null;\n }\n};\n","import type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\nimport { dedupe } from '../../utils';\n\nimport { readTokenExpiry } from './tokenExpiry';\n\ntype Options = {\n refresh: () => Promise<DeveloperPortalTokens>;\n /** Live read from the session, so this holds no token of its own. `null` when signed out. */\n getTokens: () => DeveloperPortalTokens | null;\n /** May fire more than once; the caller owns any fire-once latch. */\n onSessionExpired?: () => void;\n /**\n * An absolute lead time rather than `createBearerCredential`'s fractional threshold: that needs the\n * token's full lifetime, and apps-api reports `expiresIn` on login only, never on refresh.\n */\n refreshLeadTimeMs?: number;\n};\n\nconst DEFAULT_REFRESH_LEAD_TIME_MS = 5 * 60 * 1000;\n\nexport type DeveloperPortalCredential = {\n getIdToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n getTokens: () => DeveloperPortalTokens | null;\n notifyExpired: () => void;\n};\n\n/** Mirrors `createBearerCredential`, over the id token of the trio. */\nexport const createDeveloperPortalCredential = ({\n refresh,\n getTokens,\n onSessionExpired,\n refreshLeadTimeMs = DEFAULT_REFRESH_LEAD_TIME_MS,\n}: Options): DeveloperPortalCredential => {\n const doRefresh = async (): Promise<DeveloperPortalTokens> => {\n try {\n return await refresh();\n } catch (error) {\n // Only a 401 means the refresh token is dead. Signing out over a 5xx would be a self-inflicted\n // logout, so anything else propagates without expiring the session.\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n // N concurrent 401s must cause one rotation: each extra one invalidates the tokens the others got.\n const refreshShared = dedupe(doRefresh);\n\n const getIdToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const tokens = getTokens();\n if (tokens === null) return null;\n if (forceRefresh) return (await refreshShared()).token;\n\n const expiresAt = readTokenExpiry(tokens.token);\n // Unknown expiry is left to the 401 path; a `0` here would rotate on every request.\n if (expiresAt === null) return tokens.token;\n if (Date.now() < expiresAt - refreshLeadTimeMs) return tokens.token;\n\n // Proactive rotation is best-effort — a real 401 drives the mandatory one.\n return refreshShared()\n .then((fresh) => fresh.token)\n .catch(() => tokens.token);\n };\n\n return { getIdToken, getTokens, notifyExpired: () => onSessionExpired?.() };\n};\n","import { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\n\nimport type { DeveloperPortalCredential } from './credential';\n\n/**\n * Stamps the id token, and on a 401 force-refreshes and replays once. Mirrors\n * `createBearerAuthMiddleware`, minus the `Bearer ` prefix apps-api does not use.\n *\n * An anonymous session passes through unstamped, so a failed login is never read as session expiry.\n */\nexport const createDeveloperPortalAuthMiddleware = (\n credential: DeveloperPortalCredential,\n): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await credential.getIdToken();\n if (token === null) return next(request);\n\n // Cloned before the first attempt consumes the body. Cloning the `Request` carries a binary or\n // FormData payload through byte-for-byte.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, token);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);\n // Nothing to replay with, because a concurrent sign-out landed or the rotation failed. The\n // caller's request failed with a 401, so that is what they see.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, refreshed);\n\n try {\n return await next({ ...request, request: retryRequest });\n } catch (retryError) {\n if (isUnauthorized(retryError)) credential.notifyExpired();\n throw retryError;\n }\n }\n };\n};\n","import { createDeveloperPortalClient } from '../../clients/developerPortal/developerPortalClient';\nimport type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport type { LoginSuccess } from '../../clients/developerPortal/types';\nimport type { MiddlewareFn } from '../../fetchClient';\nimport { createStore } from '../../utils';\n\nimport { createDeveloperPortalCredential } from './credential';\nimport { createDeveloperPortalAuthMiddleware } from './middleware';\n\nexport type DeveloperPortalSdkOptions = {\n baseUrl: string;\n /** Session to restore on construction — e.g. a trio read back out of `localStorage`. */\n tokens?: DeveloperPortalTokens | null;\n /** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */\n onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;\n /** The session is dead; tokens are already cleared. The consumer redirects to sign-in. */\n onSessionExpired?: () => void;\n refreshLeadTimeMs?: number;\n middlewares?: MiddlewareFn[];\n};\n\n/**\n * `createDeveloperPortalClient` plus the session that keeps it authenticated: the token store, the\n * credential, the auth middleware, and the tokens the four self-authenticating endpoints need.\n *\n * It constructs its client rather than receiving one like `createTagSdk` does, because the middleware\n * needs the credential, the credential needs the session, and the session needs a client to rotate\n * with. `createKeboola` closes the same cycle the same way, and stays separate from this one because\n * apps-api is its own identity domain.\n */\nexport const createDeveloperPortalSdk = ({\n baseUrl,\n tokens: initialTokens = null,\n onTokensChange,\n onSessionExpired,\n refreshLeadTimeMs,\n middlewares = [],\n}: DeveloperPortalSdkOptions) => {\n const store = createStore<DeveloperPortalTokens | null>(initialTokens);\n store.subscribe((value) => onTokensChange?.(value));\n\n const getTokens = () => store.get();\n\n const requireTokens = (action: string): DeveloperPortalTokens => {\n const tokens = store.get();\n if (tokens === null) {\n throw new Error(`Developer Portal: ${action} requires a signed-in session.`);\n }\n return tokens;\n };\n\n // No auth middleware: `refreshTokens` sets its own header, so a rotation cannot recurse into the\n // middleware that triggered it.\n const refreshClient = createDeveloperPortalClient({ baseUrl, middlewares });\n\n const refresh = async (): Promise<DeveloperPortalTokens> => {\n const before = store.get();\n if (before === null) {\n throw new Error('Cannot refresh the Developer Portal session: signed out.');\n }\n\n const { token, accessToken } = await refreshClient.auth.refreshTokens(before.refreshToken);\n const next: DeveloperPortalTokens = { token, accessToken, refreshToken: before.refreshToken };\n\n // Sign-out wins over an in-flight rotation: without this, a `clear()` that lands while the request\n // is on the wire is undone by the response, silently signing the user back in.\n const after = store.get();\n if (after === null || after.refreshToken !== before.refreshToken) {\n throw new Error('Developer Portal session changed while refreshing; discarding the result.');\n }\n\n store.set(next);\n return next;\n };\n\n const clear = () => store.set(null);\n\n const credential = createDeveloperPortalCredential({\n refresh,\n getTokens,\n refreshLeadTimeMs,\n onSessionExpired: () => {\n clear();\n onSessionExpired?.();\n },\n });\n\n const client = createDeveloperPortalClient({\n baseUrl,\n middlewares,\n authMiddleware: createDeveloperPortalAuthMiddleware(credential),\n });\n\n // `refreshTokens` is not re-exposed: rotating outside the store would leave the session holding\n // tokens the server has moved past. `session.refresh()` is the supported way.\n const { refreshTokens: _storeBypassingRotation, ...auth } = client.auth;\n\n const api = {\n ...client,\n auth: {\n ...auth,\n logout: async (signal?: AbortSignal) =>\n client.auth.logout(requireTokens('sign-out').accessToken, signal),\n // Both MFA calls bypass the reactive 401 path, so rotate proactively first.\n setupMfa: async (signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA enrolment');\n return client.auth.setupMfa({ idToken: token, accessToken }, signal);\n },\n confirmMfa: async (code: string, signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA confirmation');\n return client.auth.confirmMfa({ idToken: token, accessToken, code }, signal);\n },\n },\n };\n\n const session = {\n set: (result: LoginSuccess) => {\n store.set({\n token: result.token,\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n });\n },\n get: getTokens,\n subscribe: store.subscribe,\n clear,\n /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */\n ensureFresh: async (): Promise<void> => {\n await credential.getIdToken();\n },\n /**\n * Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that\n * matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.\n * Propagates failure: a caller forcing this needs to know whether the claims actually changed.\n */\n refresh: async (): Promise<void> => {\n await credential.getIdToken({ forceRefresh: true });\n },\n isAuthenticated: () => store.get() !== null,\n };\n\n return { api, session };\n};\n\nexport type DeveloperPortalSdk = ReturnType<typeof createDeveloperPortalSdk>;\nexport type DeveloperPortalSession = DeveloperPortalSdk['session'];\n"],"mappings":";;;;;;;;;;;;;;AAOA,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,WAAW,MAAM,MAAM,GAAG;CAChC,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,UAAU,SAAS;CACzB,IAAI,YAAY,KAAA,KAAa,YAAY,IAAI,OA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,cAAc,KAAK,CAAC;GACpD;GACA,uBAAuB,MAAM,IAAI,MAAM;EAGrB;CAAE;AACxB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["isUnauthorized","dedupe","HttpHeader","isUnauthorized","createStore","createDeveloperPortalClient"],"sources":["../../../src/sdks/developerPortal/tokenExpiry.ts","../../../src/sdks/developerPortal/credential.ts","../../../src/sdks/developerPortal/middleware.ts","../../../src/sdks/developerPortal/developerPortalSdk.ts"],"sourcesContent":["/**\n * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable (\"expiry unknown\", which the\n * caller leaves to the 401 path). A read, not a verification.\n *\n * Needed because apps-api reports `expiresIn` on login but never on refresh, so it cannot keep a\n * proactive-refresh clock honest past the first rotation. The token always carries its own expiry.\n */\nexport const readTokenExpiry = (token: string): number | null => {\n const segments = token.split('.');\n if (segments.length !== 3) return null;\n\n const payload = segments[1];\n if (payload === undefined || payload === '') return null;\n\n try {\n // base64url -> base64, and re-pad: `atob` requires padding, base64url omits it.\n const base64 = payload.replaceAll('-', '+').replaceAll('_', '/');\n const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');\n const claims: unknown = JSON.parse(atob(padded));\n if (typeof claims !== 'object' || claims === null || !('exp' in claims)) return null;\n const { exp } = claims as { exp: unknown };\n if (typeof exp !== 'number' || !Number.isFinite(exp)) return null;\n return exp * 1000;\n } catch {\n return null;\n }\n};\n","import type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport { isUnauthorized } from '../../keboola/bearer/credentials';\nimport { dedupe } from '../../utils';\n\nimport { readTokenExpiry } from './tokenExpiry';\n\ntype Options = {\n refresh: () => Promise<DeveloperPortalTokens>;\n /** Live read from the session, so this holds no token of its own. `null` when signed out. */\n getTokens: () => DeveloperPortalTokens | null;\n /** May fire more than once; the caller owns any fire-once latch. */\n onSessionExpired?: () => void;\n /**\n * An absolute lead time rather than `createBearerCredential`'s fractional threshold: that needs the\n * token's full lifetime, and apps-api reports `expiresIn` on login only, never on refresh.\n */\n refreshLeadTimeMs?: number;\n};\n\nconst DEFAULT_REFRESH_LEAD_TIME_MS = 5 * 60 * 1000;\n\nexport type DeveloperPortalCredential = {\n getIdToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n getTokens: () => DeveloperPortalTokens | null;\n notifyExpired: () => void;\n};\n\n/** Mirrors `createBearerCredential`, over the id token of the trio. */\nexport const createDeveloperPortalCredential = ({\n refresh,\n getTokens,\n onSessionExpired,\n refreshLeadTimeMs = DEFAULT_REFRESH_LEAD_TIME_MS,\n}: Options): DeveloperPortalCredential => {\n const doRefresh = async (): Promise<DeveloperPortalTokens> => {\n try {\n return await refresh();\n } catch (error) {\n // Only a 401 means the refresh token is dead. Signing out over a 5xx would be a self-inflicted\n // logout, so anything else propagates without expiring the session.\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n // N concurrent 401s must cause one rotation: each extra one invalidates the tokens the others got.\n const refreshShared = dedupe(doRefresh);\n\n const getIdToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const tokens = getTokens();\n if (tokens === null) return null;\n if (forceRefresh) return (await refreshShared()).token;\n\n const expiresAt = readTokenExpiry(tokens.token);\n // Unknown expiry is left to the 401 path; a `0` here would rotate on every request.\n if (expiresAt === null) return tokens.token;\n if (Date.now() < expiresAt - refreshLeadTimeMs) return tokens.token;\n\n // Proactive rotation is best-effort — a real 401 drives the mandatory one.\n return refreshShared()\n .then((fresh) => fresh.token)\n .catch(() => tokens.token);\n };\n\n return { getIdToken, getTokens, notifyExpired: () => onSessionExpired?.() };\n};\n","import { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { isUnauthorized } from '../../keboola/bearer/credentials';\n\nimport type { DeveloperPortalCredential } from './credential';\n\n/**\n * Stamps the id token, and on a 401 force-refreshes and replays once. Mirrors\n * `createBearerAuthMiddleware`, minus the `Bearer ` prefix apps-api does not use.\n *\n * An anonymous session passes through unstamped, so a failed login is never read as session expiry.\n */\nexport const createDeveloperPortalAuthMiddleware = (\n credential: DeveloperPortalCredential,\n): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await credential.getIdToken();\n if (token === null) return next(request);\n\n // Cloned before the first attempt consumes the body. Cloning the `Request` carries a binary or\n // FormData payload through byte-for-byte.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, token);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);\n // Nothing to replay with, because a concurrent sign-out landed or the rotation failed. The\n // caller's request failed with a 401, so that is what they see.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, refreshed);\n\n try {\n return await next({ ...request, request: retryRequest });\n } catch (retryError) {\n if (isUnauthorized(retryError)) credential.notifyExpired();\n throw retryError;\n }\n }\n };\n};\n","import { createDeveloperPortalClient } from '../../clients/developerPortal/developerPortalClient';\nimport type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport type { LoginSuccess } from '../../clients/developerPortal/types';\nimport type { MiddlewareFn } from '../../fetchClient';\nimport { createStore } from '../../utils';\n\nimport { createDeveloperPortalCredential } from './credential';\nimport { createDeveloperPortalAuthMiddleware } from './middleware';\n\nexport type DeveloperPortalSdkOptions = {\n baseUrl: string;\n /** Session to restore on construction. */\n tokens?: DeveloperPortalTokens | null;\n /** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */\n onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;\n /** The session is dead; tokens are already cleared. The consumer redirects to sign-in. */\n onSessionExpired?: () => void;\n refreshLeadTimeMs?: number;\n middlewares?: MiddlewareFn[];\n};\n\n/**\n * `createDeveloperPortalClient` plus the session that keeps it authenticated.\n *\n * - Builds its own client: middleware, credential and session depend on each other in a cycle.\n */\nexport const createDeveloperPortalSdk = ({\n baseUrl,\n tokens: initialTokens = null,\n onTokensChange,\n onSessionExpired,\n refreshLeadTimeMs,\n middlewares = [],\n}: DeveloperPortalSdkOptions) => {\n const store = createStore<DeveloperPortalTokens | null>(initialTokens);\n store.subscribe((value) => onTokensChange?.(value));\n\n const getTokens = () => store.get();\n\n const requireTokens = (action: string): DeveloperPortalTokens => {\n const tokens = store.get();\n if (tokens === null) {\n throw new Error(`Developer Portal: ${action} requires a signed-in session.`);\n }\n return tokens;\n };\n\n // No auth middleware, so a rotation cannot recurse into the middleware that triggered it.\n const refreshClient = createDeveloperPortalClient({ baseUrl, middlewares });\n\n const refresh = async (): Promise<DeveloperPortalTokens> => {\n const before = store.get();\n if (before === null) {\n throw new Error('Cannot refresh the Developer Portal session: signed out.');\n }\n\n const { token, accessToken } = await refreshClient.auth.refreshTokens(before.refreshToken);\n const next: DeveloperPortalTokens = { token, accessToken, refreshToken: before.refreshToken };\n\n // Sign-out wins over an in-flight rotation; otherwise the response signs the user back in.\n const after = store.get();\n if (after === null || after.refreshToken !== before.refreshToken) {\n throw new Error('Developer Portal session changed while refreshing; discarding the result.');\n }\n\n store.set(next);\n return next;\n };\n\n const clear = () => store.set(null);\n\n const credential = createDeveloperPortalCredential({\n refresh,\n getTokens,\n refreshLeadTimeMs,\n onSessionExpired: () => {\n clear();\n onSessionExpired?.();\n },\n });\n\n const client = createDeveloperPortalClient({\n baseUrl,\n middlewares,\n authMiddleware: createDeveloperPortalAuthMiddleware(credential),\n });\n\n // `refreshTokens` is not re-exposed: rotating outside the store leaves stale tokens.\n const { refreshTokens: _storeBypassingRotation, ...auth } = client.auth;\n\n const api = {\n ...client,\n auth: {\n ...auth,\n logout: async (signal?: AbortSignal) =>\n client.auth.logout(requireTokens('sign-out').accessToken, signal),\n // Both MFA calls bypass the reactive 401 path, so rotate proactively first.\n setupMfa: async (signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA enrolment');\n return client.auth.setupMfa({ idToken: token, accessToken }, signal);\n },\n confirmMfa: async (code: string, signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA confirmation');\n return client.auth.confirmMfa({ idToken: token, accessToken, code }, signal);\n },\n },\n };\n\n const session = {\n set: (result: LoginSuccess) => {\n store.set({\n token: result.token,\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n });\n },\n get: getTokens,\n subscribe: store.subscribe,\n clear,\n /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */\n ensureFresh: async (): Promise<void> => {\n await credential.getIdToken();\n },\n /** Rotates now, for a change of claims (e.g. leaving a vendor). Propagates failure. */\n refresh: async (): Promise<void> => {\n await credential.getIdToken({ forceRefresh: true });\n },\n isAuthenticated: () => store.get() !== null,\n };\n\n return { api, session };\n};\n\nexport type DeveloperPortalSdk = ReturnType<typeof createDeveloperPortalSdk>;\nexport type DeveloperPortalSession = DeveloperPortalSdk['session'];\n"],"mappings":";;;;;;;;;;;;;;AAOA,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,WAAW,MAAM,MAAM,GAAG;CAChC,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,UAAU,SAAS;CACzB,IAAI,YAAY,KAAA,KAAa,YAAY,IAAI,OAAO;CAEpD,IAAI;EAEF,MAAM,SAAS,QAAQ,WAAW,KAAK,GAAG,CAAC,CAAC,WAAW,KAAK,GAAG;EAC/D,MAAM,SAAS,OAAO,OAAO,OAAO,UAAW,IAAK,OAAO,SAAS,KAAM,GAAI,GAAG;EACjF,MAAM,SAAkB,KAAK,MAAM,KAAK,MAAM,CAAC;EAC/C,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,EAAE,SAAS,SAAS,OAAO;EAChF,MAAM,EAAE,QAAQ;EAChB,IAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,SAAS,GAAG,GAAG,OAAO;EAC7D,OAAO,MAAM;CACf,QAAQ;EACN,OAAO;CACT;AACF;;;ACPA,MAAM,+BAA+B;;AASrC,MAAa,mCAAmC,EAC9C,SACA,WACA,kBACA,oBAAoB,mCACoB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;IACJ,GAAG;IACH,QAAQ,OAAO,WACb,OAAO,KAAK,OAAO,cAAc,UAAU,CAAC,CAAC,aAAa,MAAM;IAElE,UAAU,OAAO,WAAyB;KACxC,MAAM,WAAW,WAAW;KAC5B,MAAM,EAAE,OAAO,gBAAgB,cAAc,eAAe;KAC5D,OAAO,OAAO,KAAK,SAAS;MAAE,SAAS;MAAO;KAAY,GAAG,MAAM;IACrE;IACA,YAAY,OAAO,MAAc,WAAyB;KACxD,MAAM,WAAW,WAAW;KAC5B,MAAM,EAAE,OAAO,gBAAgB,cAAc,kBAAkB;KAC/D,OAAO,OAAO,KAAK,WAAW;MAAE,SAAS;MAAO;MAAa;KAAK,GAAG,MAAM;IAC7E;GACF;EAyBS;EAAG,SAAA;GArBZ,MAAM,WAAyB;IAC7B,MAAM,IAAI;KACR,OAAO,OAAO;KACd,aAAa,OAAO;KACpB,cAAc,OAAO;IACvB,CAAC;GACH;GACA,KAAK;GACL,WAAW,MAAM;GACjB;;GAEA,aAAa,YAA2B;IACtC,MAAM,WAAW,WAAW;GAC9B;;GAEA,SAAS,YAA2B;IAClC,MAAM,WAAW,WAAW,EAAE,cAAc,KAAK,CAAC;GACpD;GACA,uBAAuB,MAAM,IAAI,MAAM;EAGrB;CAAE;AACxB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-
|
|
3
|
-
import { t as DeveloperPortalTokens } from "../../index-
|
|
1
|
+
import { O as MiddlewareFn } from "../../index-BVhHt5lx.cjs";
|
|
2
|
+
import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-tKkeLa2B.cjs";
|
|
3
|
+
import { t as DeveloperPortalTokens } from "../../index-C4TNAA8-.cjs";
|
|
4
4
|
import { n as Listener } from "../../emitter-dLF1Fyfg.cjs";
|
|
5
5
|
//#region src/sdks/developerPortal/developerPortalSdk.d.ts
|
|
6
6
|
type DeveloperPortalSdkOptions = {
|
|
7
7
|
baseUrl: string;
|
|
8
|
-
/** Session to restore on construction
|
|
8
|
+
/** Session to restore on construction. */
|
|
9
9
|
tokens?: DeveloperPortalTokens | null;
|
|
10
10
|
/** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */
|
|
11
11
|
onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;
|
|
@@ -15,13 +15,9 @@ type DeveloperPortalSdkOptions = {
|
|
|
15
15
|
middlewares?: MiddlewareFn[];
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* `createDeveloperPortalClient` plus the session that keeps it authenticated
|
|
19
|
-
* credential, the auth middleware, and the tokens the four self-authenticating endpoints need.
|
|
18
|
+
* `createDeveloperPortalClient` plus the session that keeps it authenticated.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
* needs the credential, the credential needs the session, and the session needs a client to rotate
|
|
23
|
-
* with. `createKeboola` closes the same cycle the same way, and stays separate from this one because
|
|
24
|
-
* apps-api is its own identity domain.
|
|
20
|
+
* - Builds its own client: middleware, credential and session depend on each other in a cycle.
|
|
25
21
|
*/
|
|
26
22
|
declare const createDeveloperPortalSdk: ({ baseUrl, tokens: initialTokens, onTokensChange, onSessionExpired, refreshLeadTimeMs, middlewares }: DeveloperPortalSdkOptions) => {
|
|
27
23
|
api: {
|
|
@@ -1356,11 +1352,7 @@ declare const createDeveloperPortalSdk: ({ baseUrl, tokens: initialTokens, onTok
|
|
|
1356
1352
|
clear: () => void;
|
|
1357
1353
|
/** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */
|
|
1358
1354
|
ensureFresh: () => Promise<void>;
|
|
1359
|
-
/**
|
|
1360
|
-
* Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that
|
|
1361
|
-
* matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.
|
|
1362
|
-
* Propagates failure: a caller forcing this needs to know whether the claims actually changed.
|
|
1363
|
-
*/
|
|
1355
|
+
/** Rotates now, for a change of claims (e.g. leaving a vendor). Propagates failure. */
|
|
1364
1356
|
refresh: () => Promise<void>;
|
|
1365
1357
|
isAuthenticated: () => boolean;
|
|
1366
1358
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-
|
|
3
|
-
import { t as DeveloperPortalTokens } from "../../index-
|
|
1
|
+
import { O as MiddlewareFn } from "../../index-BgR5zcjJ.js";
|
|
2
|
+
import { A as ResetPasswordConfirmInput, E as PaginationQuery, F as UpdateAppAsAdminInput, I as UpdateAppInput, L as UpdateVendorAsAdminInput, N as SignUpInput, R as UpdateVendorInput, S as LoginSuccess, W as components, _ as GetVendorUsersQuery, b as LoginInput, c as ConfirmAccountInput, d as CreateVendorAsAdminInput, f as CreateVendorInput, g as GetChangesQuery, h as GetAppsQuery, k as RejectAppInput, l as CreateAppInput, p as DeprecateAppInput, s as ApproveVendorInput, t as AdminPaginationQuery, u as CreateServiceAccountInput } from "../../types-q-1r_9d1.js";
|
|
3
|
+
import { t as DeveloperPortalTokens } from "../../index-C11JSxBY.js";
|
|
4
4
|
import { n as Listener } from "../../emitter-dLF1Fyfg.js";
|
|
5
5
|
//#region src/sdks/developerPortal/developerPortalSdk.d.ts
|
|
6
6
|
type DeveloperPortalSdkOptions = {
|
|
7
7
|
baseUrl: string;
|
|
8
|
-
/** Session to restore on construction
|
|
8
|
+
/** Session to restore on construction. */
|
|
9
9
|
tokens?: DeveloperPortalTokens | null;
|
|
10
10
|
/** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */
|
|
11
11
|
onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;
|
|
@@ -15,13 +15,9 @@ type DeveloperPortalSdkOptions = {
|
|
|
15
15
|
middlewares?: MiddlewareFn[];
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* `createDeveloperPortalClient` plus the session that keeps it authenticated
|
|
19
|
-
* credential, the auth middleware, and the tokens the four self-authenticating endpoints need.
|
|
18
|
+
* `createDeveloperPortalClient` plus the session that keeps it authenticated.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
* needs the credential, the credential needs the session, and the session needs a client to rotate
|
|
23
|
-
* with. `createKeboola` closes the same cycle the same way, and stays separate from this one because
|
|
24
|
-
* apps-api is its own identity domain.
|
|
20
|
+
* - Builds its own client: middleware, credential and session depend on each other in a cycle.
|
|
25
21
|
*/
|
|
26
22
|
declare const createDeveloperPortalSdk: ({ baseUrl, tokens: initialTokens, onTokensChange, onSessionExpired, refreshLeadTimeMs, middlewares }: DeveloperPortalSdkOptions) => {
|
|
27
23
|
api: {
|
|
@@ -1356,11 +1352,7 @@ declare const createDeveloperPortalSdk: ({ baseUrl, tokens: initialTokens, onTok
|
|
|
1356
1352
|
clear: () => void;
|
|
1357
1353
|
/** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */
|
|
1358
1354
|
ensureFresh: () => Promise<void>;
|
|
1359
|
-
/**
|
|
1360
|
-
* Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that
|
|
1361
|
-
* matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.
|
|
1362
|
-
* Propagates failure: a caller forcing this needs to know whether the claims actually changed.
|
|
1363
|
-
*/
|
|
1355
|
+
/** Rotates now, for a change of claims (e.g. leaving a vendor). Propagates failure. */
|
|
1364
1356
|
refresh: () => Promise<void>;
|
|
1365
1357
|
isAuthenticated: () => boolean;
|
|
1366
1358
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as dedupe } from "../../dedupe-
|
|
1
|
+
import { t as dedupe } from "../../dedupe-Cky1gSUu.js";
|
|
2
2
|
import { t as createStore } from "../../store-C9FQCHGe.js";
|
|
3
|
-
import { s as HttpHeader } from "../../createFetchClient-
|
|
4
|
-
import { n as isUnauthorized } from "../../
|
|
5
|
-
import { t as createDeveloperPortalClient } from "../../developerPortalClient-
|
|
3
|
+
import { s as HttpHeader } from "../../createFetchClient-DXHQK63w.js";
|
|
4
|
+
import { n as isUnauthorized } from "../../middleware-CBwrtgQd.js";
|
|
5
|
+
import { t as createDeveloperPortalClient } from "../../developerPortalClient-B1QZ1rYi.js";
|
|
6
6
|
//#region src/sdks/developerPortal/tokenExpiry.ts
|
|
7
7
|
/**
|
|
8
8
|
* Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable ("expiry unknown", which the
|
|
@@ -93,13 +93,9 @@ const createDeveloperPortalAuthMiddleware = (credential) => {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/sdks/developerPortal/developerPortalSdk.ts
|
|
95
95
|
/**
|
|
96
|
-
* `createDeveloperPortalClient` plus the session that keeps it authenticated
|
|
97
|
-
* credential, the auth middleware, and the tokens the four self-authenticating endpoints need.
|
|
96
|
+
* `createDeveloperPortalClient` plus the session that keeps it authenticated.
|
|
98
97
|
*
|
|
99
|
-
*
|
|
100
|
-
* needs the credential, the credential needs the session, and the session needs a client to rotate
|
|
101
|
-
* with. `createKeboola` closes the same cycle the same way, and stays separate from this one because
|
|
102
|
-
* apps-api is its own identity domain.
|
|
98
|
+
* - Builds its own client: middleware, credential and session depend on each other in a cycle.
|
|
103
99
|
*/
|
|
104
100
|
const createDeveloperPortalSdk = ({ baseUrl, tokens: initialTokens = null, onTokensChange, onSessionExpired, refreshLeadTimeMs, middlewares = [] }) => {
|
|
105
101
|
const store = createStore(initialTokens);
|
|
@@ -184,11 +180,7 @@ const createDeveloperPortalSdk = ({ baseUrl, tokens: initialTokens = null, onTok
|
|
|
184
180
|
ensureFresh: async () => {
|
|
185
181
|
await credential.getIdToken();
|
|
186
182
|
},
|
|
187
|
-
/**
|
|
188
|
-
* Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that
|
|
189
|
-
* matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.
|
|
190
|
-
* Propagates failure: a caller forcing this needs to know whether the claims actually changed.
|
|
191
|
-
*/
|
|
183
|
+
/** Rotates now, for a change of claims (e.g. leaving a vendor). Propagates failure. */
|
|
192
184
|
refresh: async () => {
|
|
193
185
|
await credential.getIdToken({ forceRefresh: true });
|
|
194
186
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/sdks/developerPortal/tokenExpiry.ts","../../../src/sdks/developerPortal/credential.ts","../../../src/sdks/developerPortal/middleware.ts","../../../src/sdks/developerPortal/developerPortalSdk.ts"],"sourcesContent":["/**\n * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable (\"expiry unknown\", which the\n * caller leaves to the 401 path). A read, not a verification.\n *\n * Needed because apps-api reports `expiresIn` on login but never on refresh, so it cannot keep a\n * proactive-refresh clock honest past the first rotation. The token always carries its own expiry.\n */\nexport const readTokenExpiry = (token: string): number | null => {\n const segments = token.split('.');\n if (segments.length !== 3) return null;\n\n const payload = segments[1];\n if (payload === undefined || payload === '') return null;\n\n try {\n // base64url -> base64, and re-pad: `atob` requires padding, base64url omits it.\n const base64 = payload.replaceAll('-', '+').replaceAll('_', '/');\n const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');\n const claims: unknown = JSON.parse(atob(padded));\n if (typeof claims !== 'object' || claims === null || !('exp' in claims)) return null;\n const { exp } = claims as { exp: unknown };\n if (typeof exp !== 'number' || !Number.isFinite(exp)) return null;\n return exp * 1000;\n } catch {\n return null;\n }\n};\n","import type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\nimport { dedupe } from '../../utils';\n\nimport { readTokenExpiry } from './tokenExpiry';\n\ntype Options = {\n refresh: () => Promise<DeveloperPortalTokens>;\n /** Live read from the session, so this holds no token of its own. `null` when signed out. */\n getTokens: () => DeveloperPortalTokens | null;\n /** May fire more than once; the caller owns any fire-once latch. */\n onSessionExpired?: () => void;\n /**\n * An absolute lead time rather than `createBearerCredential`'s fractional threshold: that needs the\n * token's full lifetime, and apps-api reports `expiresIn` on login only, never on refresh.\n */\n refreshLeadTimeMs?: number;\n};\n\nconst DEFAULT_REFRESH_LEAD_TIME_MS = 5 * 60 * 1000;\n\nexport type DeveloperPortalCredential = {\n getIdToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n getTokens: () => DeveloperPortalTokens | null;\n notifyExpired: () => void;\n};\n\n/** Mirrors `createBearerCredential`, over the id token of the trio. */\nexport const createDeveloperPortalCredential = ({\n refresh,\n getTokens,\n onSessionExpired,\n refreshLeadTimeMs = DEFAULT_REFRESH_LEAD_TIME_MS,\n}: Options): DeveloperPortalCredential => {\n const doRefresh = async (): Promise<DeveloperPortalTokens> => {\n try {\n return await refresh();\n } catch (error) {\n // Only a 401 means the refresh token is dead. Signing out over a 5xx would be a self-inflicted\n // logout, so anything else propagates without expiring the session.\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n // N concurrent 401s must cause one rotation: each extra one invalidates the tokens the others got.\n const refreshShared = dedupe(doRefresh);\n\n const getIdToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const tokens = getTokens();\n if (tokens === null) return null;\n if (forceRefresh) return (await refreshShared()).token;\n\n const expiresAt = readTokenExpiry(tokens.token);\n // Unknown expiry is left to the 401 path; a `0` here would rotate on every request.\n if (expiresAt === null) return tokens.token;\n if (Date.now() < expiresAt - refreshLeadTimeMs) return tokens.token;\n\n // Proactive rotation is best-effort — a real 401 drives the mandatory one.\n return refreshShared()\n .then((fresh) => fresh.token)\n .catch(() => tokens.token);\n };\n\n return { getIdToken, getTokens, notifyExpired: () => onSessionExpired?.() };\n};\n","import { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { isUnauthorized } from '../../keboola/bearer/credential';\n\nimport type { DeveloperPortalCredential } from './credential';\n\n/**\n * Stamps the id token, and on a 401 force-refreshes and replays once. Mirrors\n * `createBearerAuthMiddleware`, minus the `Bearer ` prefix apps-api does not use.\n *\n * An anonymous session passes through unstamped, so a failed login is never read as session expiry.\n */\nexport const createDeveloperPortalAuthMiddleware = (\n credential: DeveloperPortalCredential,\n): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await credential.getIdToken();\n if (token === null) return next(request);\n\n // Cloned before the first attempt consumes the body. Cloning the `Request` carries a binary or\n // FormData payload through byte-for-byte.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, token);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);\n // Nothing to replay with, because a concurrent sign-out landed or the rotation failed. The\n // caller's request failed with a 401, so that is what they see.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, refreshed);\n\n try {\n return await next({ ...request, request: retryRequest });\n } catch (retryError) {\n if (isUnauthorized(retryError)) credential.notifyExpired();\n throw retryError;\n }\n }\n };\n};\n","import { createDeveloperPortalClient } from '../../clients/developerPortal/developerPortalClient';\nimport type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport type { LoginSuccess } from '../../clients/developerPortal/types';\nimport type { MiddlewareFn } from '../../fetchClient';\nimport { createStore } from '../../utils';\n\nimport { createDeveloperPortalCredential } from './credential';\nimport { createDeveloperPortalAuthMiddleware } from './middleware';\n\nexport type DeveloperPortalSdkOptions = {\n baseUrl: string;\n /** Session to restore on construction — e.g. a trio read back out of `localStorage`. */\n tokens?: DeveloperPortalTokens | null;\n /** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */\n onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;\n /** The session is dead; tokens are already cleared. The consumer redirects to sign-in. */\n onSessionExpired?: () => void;\n refreshLeadTimeMs?: number;\n middlewares?: MiddlewareFn[];\n};\n\n/**\n * `createDeveloperPortalClient` plus the session that keeps it authenticated: the token store, the\n * credential, the auth middleware, and the tokens the four self-authenticating endpoints need.\n *\n * It constructs its client rather than receiving one like `createTagSdk` does, because the middleware\n * needs the credential, the credential needs the session, and the session needs a client to rotate\n * with. `createKeboola` closes the same cycle the same way, and stays separate from this one because\n * apps-api is its own identity domain.\n */\nexport const createDeveloperPortalSdk = ({\n baseUrl,\n tokens: initialTokens = null,\n onTokensChange,\n onSessionExpired,\n refreshLeadTimeMs,\n middlewares = [],\n}: DeveloperPortalSdkOptions) => {\n const store = createStore<DeveloperPortalTokens | null>(initialTokens);\n store.subscribe((value) => onTokensChange?.(value));\n\n const getTokens = () => store.get();\n\n const requireTokens = (action: string): DeveloperPortalTokens => {\n const tokens = store.get();\n if (tokens === null) {\n throw new Error(`Developer Portal: ${action} requires a signed-in session.`);\n }\n return tokens;\n };\n\n // No auth middleware: `refreshTokens` sets its own header, so a rotation cannot recurse into the\n // middleware that triggered it.\n const refreshClient = createDeveloperPortalClient({ baseUrl, middlewares });\n\n const refresh = async (): Promise<DeveloperPortalTokens> => {\n const before = store.get();\n if (before === null) {\n throw new Error('Cannot refresh the Developer Portal session: signed out.');\n }\n\n const { token, accessToken } = await refreshClient.auth.refreshTokens(before.refreshToken);\n const next: DeveloperPortalTokens = { token, accessToken, refreshToken: before.refreshToken };\n\n // Sign-out wins over an in-flight rotation: without this, a `clear()` that lands while the request\n // is on the wire is undone by the response, silently signing the user back in.\n const after = store.get();\n if (after === null || after.refreshToken !== before.refreshToken) {\n throw new Error('Developer Portal session changed while refreshing; discarding the result.');\n }\n\n store.set(next);\n return next;\n };\n\n const clear = () => store.set(null);\n\n const credential = createDeveloperPortalCredential({\n refresh,\n getTokens,\n refreshLeadTimeMs,\n onSessionExpired: () => {\n clear();\n onSessionExpired?.();\n },\n });\n\n const client = createDeveloperPortalClient({\n baseUrl,\n middlewares,\n authMiddleware: createDeveloperPortalAuthMiddleware(credential),\n });\n\n // `refreshTokens` is not re-exposed: rotating outside the store would leave the session holding\n // tokens the server has moved past. `session.refresh()` is the supported way.\n const { refreshTokens: _storeBypassingRotation, ...auth } = client.auth;\n\n const api = {\n ...client,\n auth: {\n ...auth,\n logout: async (signal?: AbortSignal) =>\n client.auth.logout(requireTokens('sign-out').accessToken, signal),\n // Both MFA calls bypass the reactive 401 path, so rotate proactively first.\n setupMfa: async (signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA enrolment');\n return client.auth.setupMfa({ idToken: token, accessToken }, signal);\n },\n confirmMfa: async (code: string, signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA confirmation');\n return client.auth.confirmMfa({ idToken: token, accessToken, code }, signal);\n },\n },\n };\n\n const session = {\n set: (result: LoginSuccess) => {\n store.set({\n token: result.token,\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n });\n },\n get: getTokens,\n subscribe: store.subscribe,\n clear,\n /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */\n ensureFresh: async (): Promise<void> => {\n await credential.getIdToken();\n },\n /**\n * Rotates now, for a change of *claims* rather than age — leaving a vendor is the case that\n * matters, since the stale `profile` claim keeps scoping requests to a vendor the user just left.\n * Propagates failure: a caller forcing this needs to know whether the claims actually changed.\n */\n refresh: async (): Promise<void> => {\n await credential.getIdToken({ forceRefresh: true });\n },\n isAuthenticated: () => store.get() !== null,\n };\n\n return { api, session };\n};\n\nexport type DeveloperPortalSdk = ReturnType<typeof createDeveloperPortalSdk>;\nexport type DeveloperPortalSession = DeveloperPortalSdk['session'];\n"],"mappings":";;;;;;;;;;;;;AAOA,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,WAAW,MAAM,MAAM,GAAG;CAChC,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,UAAU,SAAS;CACzB,IAAI,YAAY,KAAA,KAAa,YAAY,IAAI,OAAO;CAEpD,IAAI;EAEF,MAAM,SAAS,QAAQ,WAAW,KAAK,GAAG,CAAC,CAAC,WAAW,KAAK,GAAG;EAC/D,MAAM,SAAS,OAAO,OAAO,OAAO,UAAW,IAAK,OAAO,SAAS,KAAM,GAAI,GAAG;EACjF,MAAM,SAAkB,KAAK,MAAM,KAAK,MAAM,CAAC;EAC/C,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,EAAE,SAAS,SAAS,OAAO;EAChF,MAAM,EAAE,QAAQ;EAChB,IAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,SAAS,GAAG,GAAG,OAAO;EAC7D,OAAO,MAAM;CACf,QAAQ;EACN,OAAO;CACT;AACF;;;ACPA,MAAM,+BAA+B;;AASrC,MAAa,mCAAmC,EAC9C,SACA,WACA,kBACA,oBAAoB,mCACoB;CACxC,MAAM,YAAY,YAA4C;EAC5D,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO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E,OAAO,gBAAgB,cAAc,eAAe;KAC5D,OAAO,OAAO,KAAK,SAAS;MAAE,SAAS;MAAO;KAAY,GAAG,MAAM;IACrE;IACA,YAAY,OAAO,MAAc,WAAyB;KACxD,MAAM,WAAW,WAAW;KAC5B,MAAM,EAAE,OAAO,gBAAgB,cAAc,kBAAkB;KAC/D,OAAO,OAAO,KAAK,WAAW;MAAE,SAAS;MAAO;MAAa;KAAK,GAAG,MAAM;IAC7E;GACF;EA6BS;EAAG,SAAA;GAzBZ,MAAM,WAAyB;IAC7B,MAAM,IAAI;KACR,OAAO,OAAO;KACd,aAAa,OAAO;KACpB,cAAc,OAAO;IACvB,CAAC;GACH;GACA,KAAK;GACL,WAAW,MAAM;GACjB;;GAEA,aAAa,YAA2B;IACtC,MAAM,WAAW,WAAW;GAC9B;;;;;;GAMA,SAAS,YAA2B;IAClC,MAAM,WAAW,WAAW,EAAE,cAAc,KAAK,CAAC;GACpD;GACA,uBAAuB,MAAM,IAAI,MAAM;EAGrB;CAAE;AACxB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/sdks/developerPortal/tokenExpiry.ts","../../../src/sdks/developerPortal/credential.ts","../../../src/sdks/developerPortal/middleware.ts","../../../src/sdks/developerPortal/developerPortalSdk.ts"],"sourcesContent":["/**\n * Reads a JWT's `exp` claim as milliseconds, or `null` when unparseable (\"expiry unknown\", which the\n * caller leaves to the 401 path). A read, not a verification.\n *\n * Needed because apps-api reports `expiresIn` on login but never on refresh, so it cannot keep a\n * proactive-refresh clock honest past the first rotation. The token always carries its own expiry.\n */\nexport const readTokenExpiry = (token: string): number | null => {\n const segments = token.split('.');\n if (segments.length !== 3) return null;\n\n const payload = segments[1];\n if (payload === undefined || payload === '') return null;\n\n try {\n // base64url -> base64, and re-pad: `atob` requires padding, base64url omits it.\n const base64 = payload.replaceAll('-', '+').replaceAll('_', '/');\n const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');\n const claims: unknown = JSON.parse(atob(padded));\n if (typeof claims !== 'object' || claims === null || !('exp' in claims)) return null;\n const { exp } = claims as { exp: unknown };\n if (typeof exp !== 'number' || !Number.isFinite(exp)) return null;\n return exp * 1000;\n } catch {\n return null;\n }\n};\n","import type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport { isUnauthorized } from '../../keboola/bearer/credentials';\nimport { dedupe } from '../../utils';\n\nimport { readTokenExpiry } from './tokenExpiry';\n\ntype Options = {\n refresh: () => Promise<DeveloperPortalTokens>;\n /** Live read from the session, so this holds no token of its own. `null` when signed out. */\n getTokens: () => DeveloperPortalTokens | null;\n /** May fire more than once; the caller owns any fire-once latch. */\n onSessionExpired?: () => void;\n /**\n * An absolute lead time rather than `createBearerCredential`'s fractional threshold: that needs the\n * token's full lifetime, and apps-api reports `expiresIn` on login only, never on refresh.\n */\n refreshLeadTimeMs?: number;\n};\n\nconst DEFAULT_REFRESH_LEAD_TIME_MS = 5 * 60 * 1000;\n\nexport type DeveloperPortalCredential = {\n getIdToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n getTokens: () => DeveloperPortalTokens | null;\n notifyExpired: () => void;\n};\n\n/** Mirrors `createBearerCredential`, over the id token of the trio. */\nexport const createDeveloperPortalCredential = ({\n refresh,\n getTokens,\n onSessionExpired,\n refreshLeadTimeMs = DEFAULT_REFRESH_LEAD_TIME_MS,\n}: Options): DeveloperPortalCredential => {\n const doRefresh = async (): Promise<DeveloperPortalTokens> => {\n try {\n return await refresh();\n } catch (error) {\n // Only a 401 means the refresh token is dead. Signing out over a 5xx would be a self-inflicted\n // logout, so anything else propagates without expiring the session.\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n // N concurrent 401s must cause one rotation: each extra one invalidates the tokens the others got.\n const refreshShared = dedupe(doRefresh);\n\n const getIdToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const tokens = getTokens();\n if (tokens === null) return null;\n if (forceRefresh) return (await refreshShared()).token;\n\n const expiresAt = readTokenExpiry(tokens.token);\n // Unknown expiry is left to the 401 path; a `0` here would rotate on every request.\n if (expiresAt === null) return tokens.token;\n if (Date.now() < expiresAt - refreshLeadTimeMs) return tokens.token;\n\n // Proactive rotation is best-effort — a real 401 drives the mandatory one.\n return refreshShared()\n .then((fresh) => fresh.token)\n .catch(() => tokens.token);\n };\n\n return { getIdToken, getTokens, notifyExpired: () => onSessionExpired?.() };\n};\n","import { HttpHeader, type MiddlewareFn } from '../../fetchClient';\nimport { isUnauthorized } from '../../keboola/bearer/credentials';\n\nimport type { DeveloperPortalCredential } from './credential';\n\n/**\n * Stamps the id token, and on a 401 force-refreshes and replays once. Mirrors\n * `createBearerAuthMiddleware`, minus the `Bearer ` prefix apps-api does not use.\n *\n * An anonymous session passes through unstamped, so a failed login is never read as session expiry.\n */\nexport const createDeveloperPortalAuthMiddleware = (\n credential: DeveloperPortalCredential,\n): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await credential.getIdToken();\n if (token === null) return next(request);\n\n // Cloned before the first attempt consumes the body. Cloning the `Request` carries a binary or\n // FormData payload through byte-for-byte.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, token);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await credential.getIdToken({ forceRefresh: true }).catch(() => null);\n // Nothing to replay with, because a concurrent sign-out landed or the rotation failed. The\n // caller's request failed with a 401, so that is what they see.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, refreshed);\n\n try {\n return await next({ ...request, request: retryRequest });\n } catch (retryError) {\n if (isUnauthorized(retryError)) credential.notifyExpired();\n throw retryError;\n }\n }\n };\n};\n","import { createDeveloperPortalClient } from '../../clients/developerPortal/developerPortalClient';\nimport type { DeveloperPortalTokens } from '../../clients/developerPortal/tokens';\nimport type { LoginSuccess } from '../../clients/developerPortal/types';\nimport type { MiddlewareFn } from '../../fetchClient';\nimport { createStore } from '../../utils';\n\nimport { createDeveloperPortalCredential } from './credential';\nimport { createDeveloperPortalAuthMiddleware } from './middleware';\n\nexport type DeveloperPortalSdkOptions = {\n baseUrl: string;\n /** Session to restore on construction. */\n tokens?: DeveloperPortalTokens | null;\n /** Persistence hook, fired on sign-in, every rotation, and with `null` on sign-out or expiry. */\n onTokensChange?: (tokens: DeveloperPortalTokens | null) => void;\n /** The session is dead; tokens are already cleared. The consumer redirects to sign-in. */\n onSessionExpired?: () => void;\n refreshLeadTimeMs?: number;\n middlewares?: MiddlewareFn[];\n};\n\n/**\n * `createDeveloperPortalClient` plus the session that keeps it authenticated.\n *\n * - Builds its own client: middleware, credential and session depend on each other in a cycle.\n */\nexport const createDeveloperPortalSdk = ({\n baseUrl,\n tokens: initialTokens = null,\n onTokensChange,\n onSessionExpired,\n refreshLeadTimeMs,\n middlewares = [],\n}: DeveloperPortalSdkOptions) => {\n const store = createStore<DeveloperPortalTokens | null>(initialTokens);\n store.subscribe((value) => onTokensChange?.(value));\n\n const getTokens = () => store.get();\n\n const requireTokens = (action: string): DeveloperPortalTokens => {\n const tokens = store.get();\n if (tokens === null) {\n throw new Error(`Developer Portal: ${action} requires a signed-in session.`);\n }\n return tokens;\n };\n\n // No auth middleware, so a rotation cannot recurse into the middleware that triggered it.\n const refreshClient = createDeveloperPortalClient({ baseUrl, middlewares });\n\n const refresh = async (): Promise<DeveloperPortalTokens> => {\n const before = store.get();\n if (before === null) {\n throw new Error('Cannot refresh the Developer Portal session: signed out.');\n }\n\n const { token, accessToken } = await refreshClient.auth.refreshTokens(before.refreshToken);\n const next: DeveloperPortalTokens = { token, accessToken, refreshToken: before.refreshToken };\n\n // Sign-out wins over an in-flight rotation; otherwise the response signs the user back in.\n const after = store.get();\n if (after === null || after.refreshToken !== before.refreshToken) {\n throw new Error('Developer Portal session changed while refreshing; discarding the result.');\n }\n\n store.set(next);\n return next;\n };\n\n const clear = () => store.set(null);\n\n const credential = createDeveloperPortalCredential({\n refresh,\n getTokens,\n refreshLeadTimeMs,\n onSessionExpired: () => {\n clear();\n onSessionExpired?.();\n },\n });\n\n const client = createDeveloperPortalClient({\n baseUrl,\n middlewares,\n authMiddleware: createDeveloperPortalAuthMiddleware(credential),\n });\n\n // `refreshTokens` is not re-exposed: rotating outside the store leaves stale tokens.\n const { refreshTokens: _storeBypassingRotation, ...auth } = client.auth;\n\n const api = {\n ...client,\n auth: {\n ...auth,\n logout: async (signal?: AbortSignal) =>\n client.auth.logout(requireTokens('sign-out').accessToken, signal),\n // Both MFA calls bypass the reactive 401 path, so rotate proactively first.\n setupMfa: async (signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA enrolment');\n return client.auth.setupMfa({ idToken: token, accessToken }, signal);\n },\n confirmMfa: async (code: string, signal?: AbortSignal) => {\n await credential.getIdToken();\n const { token, accessToken } = requireTokens('MFA confirmation');\n return client.auth.confirmMfa({ idToken: token, accessToken, code }, signal);\n },\n },\n };\n\n const session = {\n set: (result: LoginSuccess) => {\n store.set({\n token: result.token,\n accessToken: result.accessToken,\n refreshToken: result.refreshToken,\n });\n },\n get: getTokens,\n subscribe: store.subscribe,\n clear,\n /** Rotates if the id token is inside the lead time. Best-effort; the 401 path is the guarantee. */\n ensureFresh: async (): Promise<void> => {\n await credential.getIdToken();\n },\n /** Rotates now, for a change of claims (e.g. leaving a vendor). Propagates failure. */\n refresh: async (): Promise<void> => {\n await credential.getIdToken({ forceRefresh: true });\n },\n isAuthenticated: () => store.get() !== null,\n };\n\n return { api, session };\n};\n\nexport type DeveloperPortalSdk = ReturnType<typeof createDeveloperPortalSdk>;\nexport type DeveloperPortalSession = DeveloperPortalSdk['session'];\n"],"mappings":";;;;;;;;;;;;;AAOA,MAAa,mBAAmB,UAAiC;CAC/D,MAAM,WAAW,MAAM,MAAM,GAAG;CAChC,IAAI,SAAS,WAAW,GAAG,OAAO;CAElC,MAAM,UAAU,SAAS;CACzB,IAAI,YAAY,KAAA,KAAa,YAAY,IAAI,OAAO;CAEpD,I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
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_kaiMemory = require("../../kaiMemory-CClSPInt.cjs");
|
|
3
|
+
exports.KAI_MEMORY_OBJECT_TYPE = require_kaiMemory.KAI_MEMORY_OBJECT_TYPE;
|
|
4
|
+
exports.KAI_MEMORY_STATUSES = require_kaiMemory.KAI_MEMORY_STATUSES;
|
|
5
|
+
exports.KaiMemoryReviewConflictError = require_kaiMemory.KaiMemoryReviewConflictError;
|
|
6
|
+
exports.KaiMemoryUnreadableItemsError = require_kaiMemory.KaiMemoryUnreadableItemsError;
|
|
7
|
+
exports.createKaiMemorySdk = require_kaiMemory.createKaiMemorySdk;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { a as KaiMemoryStatus, c as KAI_MEMORY_STATUSES, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-DWiLcrxt.cjs";
|
|
2
|
+
//#region src/sdks/kaiMemory/kaiMemorySdk.d.ts
|
|
3
|
+
/** The metastore object type this SDK addresses — see `SEMANTIC_OBJECT_TYPE` for the convention. */
|
|
4
|
+
declare const KAI_MEMORY_OBJECT_TYPE = "kai-memory";
|
|
5
|
+
/**
|
|
6
|
+
* Thrown by `getItemsByStatusStrict` when any `kai-memory` item — of any status, not only the
|
|
7
|
+
* one asked for — could not be parsed. See that function's docstring for why an unreadable item
|
|
8
|
+
* anywhere in the collection fails the whole read rather than being dropped.
|
|
9
|
+
*/
|
|
10
|
+
declare class KaiMemoryUnreadableItemsError extends Error {
|
|
11
|
+
readonly unreadableIds: string[];
|
|
12
|
+
constructor(unreadableIds: string[]);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Thrown by `updateStatus` when the item is no longer `pending` at write time — see that
|
|
16
|
+
* function's docstring for the race it closes.
|
|
17
|
+
*/
|
|
18
|
+
declare class KaiMemoryReviewConflictError extends Error {
|
|
19
|
+
readonly uuid: string;
|
|
20
|
+
readonly currentStatus: KaiMemoryStatus;
|
|
21
|
+
constructor(uuid: string, currentStatus: KaiMemoryStatus);
|
|
22
|
+
}
|
|
23
|
+
type Options = {
|
|
24
|
+
metastoreClient: MetastoreClient;
|
|
25
|
+
};
|
|
26
|
+
declare const createKaiMemorySdk: ({ metastoreClient }: Options) => {
|
|
27
|
+
getItems: (signal?: AbortSignal) => Promise<KaiMemoryItem[]>;
|
|
28
|
+
getItemsByStatus: (status: KaiMemoryStatus, signal?: AbortSignal) => Promise<KaiMemoryItem[]>;
|
|
29
|
+
getItemsByStatusStrict: (status: KaiMemoryStatus, signal?: AbortSignal) => Promise<KaiMemoryItem[]>;
|
|
30
|
+
getUnreadableItemIds: (signal?: AbortSignal) => Promise<string[]>;
|
|
31
|
+
deleteUnreadableItem: (uuid: string) => Promise<void>;
|
|
32
|
+
createItem: ({ content, chatId, createdBy }: {
|
|
33
|
+
content: string;
|
|
34
|
+
chatId: string;
|
|
35
|
+
createdBy?: string;
|
|
36
|
+
}, meta?: CreateKaiMemoryMeta) => Promise<KaiMemoryItem>;
|
|
37
|
+
updateStatus: (uuid: string, status: KaiMemoryStatus, meta?: UpdateKaiMemoryMeta) => Promise<KaiMemoryItem>;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { KAI_MEMORY_OBJECT_TYPE, KAI_MEMORY_STATUSES, KaiMemoryReviewConflictError, KaiMemoryUnreadableItemsError, createKaiMemorySdk };
|
|
41
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { a as KaiMemoryStatus, c as KAI_MEMORY_STATUSES, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-Cg14ncdV.js";
|
|
2
|
+
//#region src/sdks/kaiMemory/kaiMemorySdk.d.ts
|
|
3
|
+
/** The metastore object type this SDK addresses — see `SEMANTIC_OBJECT_TYPE` for the convention. */
|
|
4
|
+
declare const KAI_MEMORY_OBJECT_TYPE = "kai-memory";
|
|
5
|
+
/**
|
|
6
|
+
* Thrown by `getItemsByStatusStrict` when any `kai-memory` item — of any status, not only the
|
|
7
|
+
* one asked for — could not be parsed. See that function's docstring for why an unreadable item
|
|
8
|
+
* anywhere in the collection fails the whole read rather than being dropped.
|
|
9
|
+
*/
|
|
10
|
+
declare class KaiMemoryUnreadableItemsError extends Error {
|
|
11
|
+
readonly unreadableIds: string[];
|
|
12
|
+
constructor(unreadableIds: string[]);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Thrown by `updateStatus` when the item is no longer `pending` at write time — see that
|
|
16
|
+
* function's docstring for the race it closes.
|
|
17
|
+
*/
|
|
18
|
+
declare class KaiMemoryReviewConflictError extends Error {
|
|
19
|
+
readonly uuid: string;
|
|
20
|
+
readonly currentStatus: KaiMemoryStatus;
|
|
21
|
+
constructor(uuid: string, currentStatus: KaiMemoryStatus);
|
|
22
|
+
}
|
|
23
|
+
type Options = {
|
|
24
|
+
metastoreClient: MetastoreClient;
|
|
25
|
+
};
|
|
26
|
+
declare const createKaiMemorySdk: ({ metastoreClient }: Options) => {
|
|
27
|
+
getItems: (signal?: AbortSignal) => Promise<KaiMemoryItem[]>;
|
|
28
|
+
getItemsByStatus: (status: KaiMemoryStatus, signal?: AbortSignal) => Promise<KaiMemoryItem[]>;
|
|
29
|
+
getItemsByStatusStrict: (status: KaiMemoryStatus, signal?: AbortSignal) => Promise<KaiMemoryItem[]>;
|
|
30
|
+
getUnreadableItemIds: (signal?: AbortSignal) => Promise<string[]>;
|
|
31
|
+
deleteUnreadableItem: (uuid: string) => Promise<void>;
|
|
32
|
+
createItem: ({ content, chatId, createdBy }: {
|
|
33
|
+
content: string;
|
|
34
|
+
chatId: string;
|
|
35
|
+
createdBy?: string;
|
|
36
|
+
}, meta?: CreateKaiMemoryMeta) => Promise<KaiMemoryItem>;
|
|
37
|
+
updateStatus: (uuid: string, status: KaiMemoryStatus, meta?: UpdateKaiMemoryMeta) => Promise<KaiMemoryItem>;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { KAI_MEMORY_OBJECT_TYPE, KAI_MEMORY_STATUSES, KaiMemoryReviewConflictError, KaiMemoryUnreadableItemsError, createKaiMemorySdk };
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as KAI_MEMORY_STATUSES, i as createKaiMemorySdk, n as KaiMemoryReviewConflictError, r as KaiMemoryUnreadableItemsError, t as KAI_MEMORY_OBJECT_TYPE } from "../../kaiMemory-D0Y_16U4.js";
|
|
2
|
+
export { KAI_MEMORY_OBJECT_TYPE, KAI_MEMORY_STATUSES, KaiMemoryReviewConflictError, KaiMemoryUnreadableItemsError, createKaiMemorySdk };
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as KaiMemoryStatus, i as KaiMemoryMeta, n as KaiMemoryData, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-DWiLcrxt.cjs";
|
|
2
|
+
export { CreateKaiMemoryMeta, KaiMemoryData, KaiMemoryItem, KaiMemoryMeta, KaiMemoryStatus, MetastoreClient, UpdateKaiMemoryMeta };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as KaiMemoryStatus, i as KaiMemoryMeta, n as KaiMemoryData, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-Cg14ncdV.js";
|
|
2
|
+
export { CreateKaiMemoryMeta, KaiMemoryData, KaiMemoryItem, KaiMemoryMeta, KaiMemoryStatus, MetastoreClient, UpdateKaiMemoryMeta };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_jobStatus = require("../../jobStatus-
|
|
2
|
+
const require_jobStatus = require("../../jobStatus-BMlsyXWI.cjs");
|
|
3
3
|
const require_QueryJobTimeoutError = require("../../QueryJobTimeoutError-CVNPdCWX.cjs");
|
|
4
|
-
const require_ValidationError = require("../../ValidationError-
|
|
4
|
+
const require_ValidationError = require("../../ValidationError-D65QU0uq.cjs");
|
|
5
5
|
//#region src/sdks/queryService/queryServiceSdk.ts
|
|
6
6
|
const DEFAULT_WAIT_FOR_JOB_INTERVAL = 500;
|
|
7
7
|
const DEFAULT_MAX_WAIT_TIME = 3e5;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-
|
|
1
|
+
import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-cWp_V6K5.cjs";
|
|
2
2
|
export { ExecuteQueryOptions, WaitForJobOptions, createQueryServiceSdk };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-
|
|
1
|
+
import { i as createQueryServiceSdk, n as ExecuteQueryOptions, r as WaitForJobOptions } from "../../index-CaaTOANF.js";
|
|
2
2
|
export { ExecuteQueryOptions, WaitForJobOptions, createQueryServiceSdk };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as poll, t as jobStatus } from "../../jobStatus-
|
|
1
|
+
import { i as poll, t as jobStatus } from "../../jobStatus-CfRtsIpv.js";
|
|
2
2
|
import { r as QueryJobError, t as QueryJobTimeoutError } from "../../QueryJobTimeoutError-C7JbNGOM.js";
|
|
3
|
-
import { t as ValidationError } from "../../ValidationError-
|
|
3
|
+
import { t as ValidationError } from "../../ValidationError-DjhtNMfZ.js";
|
|
4
4
|
//#region src/sdks/queryService/queryServiceSdk.ts
|
|
5
5
|
const DEFAULT_WAIT_FOR_JOB_INTERVAL = 500;
|
|
6
6
|
const DEFAULT_MAX_WAIT_TIME = 3e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_semanticLayer = require("../../semanticLayer-
|
|
2
|
+
const require_semanticLayer = require("../../semanticLayer-CKDVkU56.cjs");
|
|
3
3
|
exports.CONSTRAINT_SCOPES = require_semanticLayer.CONSTRAINT_SCOPES;
|
|
4
4
|
exports.CONSTRAINT_SEVERITIES = require_semanticLayer.CONSTRAINT_SEVERITIES;
|
|
5
5
|
exports.CONSTRAINT_TYPES = require_semanticLayer.CONSTRAINT_TYPES;
|