@keboola/api-client 27.0.0 → 31.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +145 -11
- package/API-SURFACE.md +13 -1
- package/CHANGELOG.md +1785 -0
- package/README.md +53 -18
- package/dist/ManagementClientAuthError-90pvsej0.js +15 -0
- package/dist/ManagementClientAuthError-90pvsej0.js.map +1 -0
- package/dist/ManagementClientAuthError-DFhi5yxe.cjs +20 -0
- package/dist/ManagementClientAuthError-DFhi5yxe.cjs.map +1 -0
- package/dist/QueryJobTimeoutError-C7JbNGOM.js +38 -0
- package/dist/QueryJobTimeoutError-C7JbNGOM.js.map +1 -0
- package/dist/QueryJobTimeoutError-CVNPdCWX.cjs +61 -0
- package/dist/QueryJobTimeoutError-CVNPdCWX.cjs.map +1 -0
- package/dist/SyncActionError-BG0zwchi.cjs +35 -0
- package/dist/SyncActionError-BG0zwchi.cjs.map +1 -0
- package/dist/SyncActionError-CoZFsdUk.js +24 -0
- package/dist/SyncActionError-CoZFsdUk.js.map +1 -0
- package/dist/UserError-By_Zckmc.js +10 -0
- package/dist/UserError-By_Zckmc.js.map +1 -0
- package/dist/UserError-CSGO1qII.cjs +15 -0
- package/dist/UserError-CSGO1qII.cjs.map +1 -0
- package/dist/ValidationError-CzPWydEb.js +44 -0
- package/dist/ValidationError-CzPWydEb.js.map +1 -0
- package/dist/ValidationError-h5qvwahi.cjs +61 -0
- package/dist/ValidationError-h5qvwahi.cjs.map +1 -0
- package/dist/adminRoles-B40yBcmq.js +14 -0
- package/dist/adminRoles-B40yBcmq.js.map +1 -0
- package/dist/adminRoles-C696kD_U.d.cts +14 -0
- package/dist/adminRoles-C696kD_U.d.ts +14 -0
- package/dist/adminRoles-CO7J5qAy.cjs +19 -0
- package/dist/adminRoles-CO7J5qAy.cjs.map +1 -0
- package/dist/ai/index.cjs +62 -12
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +52 -53
- package/dist/ai/index.d.ts +52 -53
- package/dist/ai/index.js +62 -4
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/types.cjs +0 -4
- package/dist/ai/types.d.cts +2 -2
- package/dist/ai/types.d.ts +2 -2
- package/dist/ai/types.js +1 -3
- package/dist/appLogs-BCCi02w6.cjs +153 -0
- package/dist/appLogs-BCCi02w6.cjs.map +1 -0
- package/dist/appLogs-BdMG6Cvn.d.ts +10 -0
- package/dist/appLogs-CLHhkQJn.js +132 -0
- package/dist/appLogs-CLHhkQJn.js.map +1 -0
- package/dist/appLogs-hQdKt_8J.d.cts +10 -0
- package/dist/apps/index.cjs +229 -14
- package/dist/apps/index.cjs.map +1 -1
- package/dist/apps/index.d.cts +219 -220
- package/dist/apps/index.d.ts +219 -220
- package/dist/apps/index.js +229 -6
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/types.cjs +0 -4
- package/dist/apps/types.d.cts +3 -3
- package/dist/apps/types.d.ts +3 -3
- package/dist/apps/types.js +1 -3
- package/dist/assets/index.cjs +33 -38
- package/dist/assets/index.cjs.map +1 -1
- package/dist/assets/index.d.cts +22 -22
- package/dist/assets/index.d.ts +22 -22
- package/dist/assets/index.js +32 -36
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/schema.cjs +23 -13
- package/dist/assets/schema.cjs.map +1 -1
- package/dist/assets/schema.d.cts +29 -28
- package/dist/assets/schema.d.ts +29 -28
- package/dist/assets/schema.js +21 -2
- package/dist/assets/schema.js.map +1 -1
- package/dist/auth/index.cjs +15 -57
- package/dist/auth/index.d.cts +2 -318
- package/dist/auth/index.d.ts +2 -318
- package/dist/auth/index.js +2 -4
- package/dist/auth/types.cjs +0 -4
- package/dist/auth/types.d.cts +2 -7
- package/dist/auth/types.d.ts +2 -7
- package/dist/auth/types.js +1 -3
- package/dist/auth-CE6Hlc9W.js +13 -0
- package/dist/{chunk-5A3AQIXR.js.map → auth-CE6Hlc9W.js.map} +1 -1
- package/dist/auth-DmgTH0uY.cjs +18 -0
- package/dist/auth-DmgTH0uY.cjs.map +1 -0
- package/dist/authClient-BL6h78Q1.d.cts +367 -0
- package/dist/authClient-Bc_bDisO.d.ts +367 -0
- package/dist/authClient-Cixa8_L1.cjs +476 -0
- package/dist/authClient-Cixa8_L1.cjs.map +1 -0
- package/dist/authClient-XBAUz9g-.js +397 -0
- package/dist/authClient-XBAUz9g-.js.map +1 -0
- package/dist/backends-DKBz5OxE.d.cts +9 -0
- package/dist/backends-DKBz5OxE.d.ts +9 -0
- package/dist/chat/index.cjs +134 -13
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +49 -51
- package/dist/chat/index.d.ts +49 -51
- package/dist/chat/index.js +134 -5
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/suggestions.cjs +152 -74
- package/dist/chat/suggestions.cjs.map +1 -1
- package/dist/chat/suggestions.d.cts +2 -437
- package/dist/chat/suggestions.d.ts +2 -437
- package/dist/chat/suggestions.js +136 -2
- package/dist/chat/suggestions.js.map +1 -1
- package/dist/chat/types.cjs +6 -8
- package/dist/chat/types.cjs.map +1 -1
- package/dist/chat/types.d.cts +2 -3
- package/dist/chat/types.d.ts +2 -3
- package/dist/chat/types.js +5 -6
- package/dist/chat/types.js.map +1 -1
- package/dist/componentId-DkyQ8PM0.cjs +73 -0
- package/dist/componentId-DkyQ8PM0.cjs.map +1 -0
- package/dist/componentId-vJz-kWs6.js +68 -0
- package/dist/componentId-vJz-kWs6.js.map +1 -0
- package/dist/concurrent-CH9fbNr3.js +34 -0
- package/dist/concurrent-CH9fbNr3.js.map +1 -0
- package/dist/concurrent-tbiIa0UL.cjs +39 -0
- package/dist/concurrent-tbiIa0UL.cjs.map +1 -0
- package/dist/configurations-Byt59bIa.js +726 -0
- package/dist/configurations-Byt59bIa.js.map +1 -0
- package/dist/configurations-CujCwDcB.cjs +743 -0
- package/dist/configurations-CujCwDcB.cjs.map +1 -0
- package/dist/configurations-DCOJONZZ.cjs +313 -0
- package/dist/configurations-DCOJONZZ.cjs.map +1 -0
- package/dist/configurations-iCbhe0tb.js +158 -0
- package/dist/configurations-iCbhe0tb.js.map +1 -0
- package/dist/constants/index.cjs +12 -34
- package/dist/constants/index.d.cts +4 -104
- package/dist/constants/index.d.ts +4 -104
- package/dist/constants/index.js +4 -5
- package/dist/constants-CkAVvuUq.cjs +219 -0
- package/dist/constants-CkAVvuUq.cjs.map +1 -0
- package/dist/constants-qeWGfk_7.js +184 -0
- package/dist/constants-qeWGfk_7.js.map +1 -0
- package/dist/createFetchClient-B1h3-p65.js +192 -0
- package/dist/createFetchClient-B1h3-p65.js.map +1 -0
- package/dist/createFetchClient-B9Cv0W9f.cjs +277 -0
- package/dist/createFetchClient-B9Cv0W9f.cjs.map +1 -0
- package/dist/createGenericFetchClient-BWoSkTki.cjs +12 -0
- package/dist/createGenericFetchClient-BWoSkTki.cjs.map +1 -0
- package/dist/createGenericFetchClient-DhpvUSlX.js +7 -0
- package/dist/createGenericFetchClient-DhpvUSlX.js.map +1 -0
- package/dist/createOpenapiFetchClient-0_oqhdPv.js +7 -0
- package/dist/createOpenapiFetchClient-0_oqhdPv.js.map +1 -0
- package/dist/createOpenapiFetchClient-yirrW6Tg.cjs +12 -0
- package/dist/createOpenapiFetchClient-yirrW6Tg.cjs.map +1 -0
- package/dist/createStore-BNiCRQXa.js +148 -0
- package/dist/createStore-BNiCRQXa.js.map +1 -0
- package/dist/createStore-MQbboXcB.cjs +177 -0
- package/dist/createStore-MQbboXcB.cjs.map +1 -0
- package/dist/credential-D-tX9gP4.cjs +44 -0
- package/dist/credential-D-tX9gP4.cjs.map +1 -0
- package/dist/credential-dKxArMic.js +33 -0
- package/dist/credential-dKxArMic.js.map +1 -0
- package/dist/dataScience/index.cjs +5 -20
- package/dist/dataScience/index.d.cts +3 -209
- package/dist/dataScience/index.d.ts +3 -209
- package/dist/dataScience/index.js +3 -7
- package/dist/dataScience/types.cjs +0 -4
- package/dist/dataScience/types.d.cts +3 -2172
- package/dist/dataScience/types.d.ts +3 -2172
- package/dist/dataScience/types.js +1 -3
- package/dist/dataScience-BqNWX-Gr.cjs +114 -0
- package/dist/dataScience-BqNWX-Gr.cjs.map +1 -0
- package/dist/dataScience-jdbSSPYF.js +109 -0
- package/dist/dataScience-jdbSSPYF.js.map +1 -0
- package/dist/dedupe-CiskLkGR.cjs +30 -0
- package/dist/dedupe-CiskLkGR.cjs.map +1 -0
- package/dist/dedupe-DYIHgZoG.js +25 -0
- package/dist/dedupe-DYIHgZoG.js.map +1 -0
- package/dist/developerPortal/index.cjs +6 -0
- package/dist/developerPortal/index.d.cts +3 -0
- package/dist/developerPortal/index.d.ts +3 -0
- package/dist/developerPortal/index.js +2 -0
- package/dist/developerPortal/types.cjs +0 -0
- package/dist/developerPortal/types.d.cts +2 -0
- package/dist/developerPortal/types.d.ts +2 -0
- package/dist/developerPortal/types.js +1 -0
- package/dist/developerPortalClient-5ABcxz1U.js +485 -0
- package/dist/developerPortalClient-5ABcxz1U.js.map +1 -0
- package/dist/developerPortalClient-B7lNR5q0.cjs +508 -0
- package/dist/developerPortalClient-B7lNR5q0.cjs.map +1 -0
- package/dist/domain/permissions/index.cjs +31 -122
- package/dist/domain/permissions/index.d.cts +19 -52
- package/dist/domain/permissions/index.d.ts +19 -52
- package/dist/domain/permissions/index.js +3 -5
- package/dist/domain/storageTable/index.cjs +4 -16
- package/dist/domain/storageTable/index.d.cts +2 -131
- package/dist/domain/storageTable/index.d.ts +2 -131
- package/dist/domain/storageTable/index.js +2 -3
- package/dist/editor/index.cjs +96 -12
- package/dist/editor/index.cjs.map +1 -1
- package/dist/editor/index.d.cts +163 -164
- package/dist/editor/index.d.ts +163 -164
- package/dist/editor/index.js +96 -4
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/types.cjs +0 -4
- package/dist/editor/types.d.cts +2 -2
- package/dist/editor/types.d.ts +2 -2
- package/dist/editor/types.js +1 -3
- package/dist/encryption/index.cjs +58 -11
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +2 -20
- package/dist/encryption/index.d.ts +2 -20
- package/dist/encryption/index.js +58 -3
- package/dist/encryption/index.js.map +1 -1
- package/dist/encryption/types.cjs +0 -4
- package/dist/encryption/types.d.cts +2 -69
- package/dist/encryption/types.d.ts +2 -69
- package/dist/encryption/types.js +1 -3
- package/dist/generateUUID-C6qKBPIv.cjs +11 -0
- package/dist/generateUUID-C6qKBPIv.cjs.map +1 -0
- package/dist/generateUUID-Dr8l-aoc.js +6 -0
- package/dist/generateUUID-Dr8l-aoc.js.map +1 -0
- package/dist/import/index.cjs +3 -14
- package/dist/import/index.d.cts +41 -41
- package/dist/import/index.d.ts +41 -41
- package/dist/import/index.js +2 -5
- package/dist/import-CExRbskw.js +116 -0
- package/dist/import-CExRbskw.js.map +1 -0
- package/dist/import-CXHppAxd.cjs +121 -0
- package/dist/import-CXHppAxd.cjs.map +1 -0
- package/dist/index--pxLseaw.d.cts +125 -0
- package/dist/index--pxLseaw.d.ts +125 -0
- package/dist/index-7RvXnXmd.d.ts +77 -0
- package/dist/index-B-frWtGW.d.cts +235 -0
- package/dist/index-B6q7HxKJ.d.cts +1075 -0
- package/dist/index-BMqLPS6S.d.cts +135 -0
- package/dist/index-BMqLPS6S.d.ts +135 -0
- package/dist/index-BR2Fu-Wo.d.ts +19883 -0
- package/dist/index-BSjfVDTr.d.cts +208 -0
- package/dist/index-BfVv8isU.d.cts +1388 -0
- package/dist/index-C9mAoXF6.d.cts +77 -0
- package/dist/index-CMb0ygwb.d.ts +26 -0
- package/dist/index-CR9LsDaG.d.cts +65 -0
- package/dist/index-CW4VC9oN.d.ts +65 -0
- package/dist/index-CYMAwD3E.d.ts +1388 -0
- package/dist/index-Cpjh05sx.d.cts +31 -0
- package/dist/index-CwJE18PJ.d.cts +26 -0
- package/dist/index-D_TnbEtp.d.cts +16 -0
- package/dist/index-Daks5CeX.d.ts +31 -0
- package/dist/index-DeMDxHTz.d.ts +1075 -0
- package/dist/index-Ds8e0l7-.d.ts +235 -0
- package/dist/index-J1I2HlSm.d.ts +208 -0
- package/dist/index-NC1dXRTD.d.cts +40 -0
- package/dist/index-NC1dXRTD.d.ts +40 -0
- package/dist/index-NicJZIzu.d.ts +16 -0
- package/dist/index-cu8THqZV.d.cts +19883 -0
- package/dist/index.cjs +1735 -1884
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -15778
- package/dist/index.d.ts +7 -15778
- package/dist/index.js +1683 -1724
- package/dist/index.js.map +1 -1
- package/dist/isPlainObject-BB3iy87C.cjs +16 -0
- package/dist/isPlainObject-BB3iy87C.cjs.map +1 -0
- package/dist/isPlainObject-LYW-03uB.js +11 -0
- package/dist/isPlainObject-LYW-03uB.js.map +1 -0
- package/dist/jobStatus-DbMupQEK.js +423 -0
- package/dist/jobStatus-DbMupQEK.js.map +1 -0
- package/dist/jobStatus-kQ9JqF8t.cjs +494 -0
- package/dist/jobStatus-kQ9JqF8t.cjs.map +1 -0
- package/dist/management/index.cjs +4 -18
- package/dist/management/index.d.cts +2 -1076
- package/dist/management/index.d.ts +2 -1076
- package/dist/management/index.js +2 -5
- package/dist/management/types.cjs +0 -4
- package/dist/management/types.d.cts +2 -12
- package/dist/management/types.d.ts +2 -12
- package/dist/management/types.js +1 -3
- package/dist/management-Cc8mKfnf.js +1064 -0
- package/dist/management-Cc8mKfnf.js.map +1 -0
- package/dist/management-DlVdxzPw.cjs +1075 -0
- package/dist/management-DlVdxzPw.cjs.map +1 -0
- package/dist/metastore/index.cjs +3 -14
- package/dist/metastore/index.d.cts +2 -32
- package/dist/metastore/index.d.ts +2 -32
- package/dist/metastore/index.js +2 -5
- package/dist/metastore/types.cjs +0 -4
- package/dist/metastore/types.d.cts +2 -2
- package/dist/metastore/types.d.ts +2 -2
- package/dist/metastore/types.js +1 -3
- package/dist/metastore-CNf1412Z.js +134 -0
- package/dist/metastore-CNf1412Z.js.map +1 -0
- package/dist/metastore-DbsxqjhS.cjs +139 -0
- package/dist/metastore-DbsxqjhS.cjs.map +1 -0
- package/dist/notifications/index.cjs +67 -13
- package/dist/notifications/index.cjs.map +1 -1
- package/dist/notifications/index.d.cts +56 -57
- package/dist/notifications/index.d.ts +56 -57
- package/dist/notifications/index.js +67 -5
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/types.cjs +0 -4
- package/dist/notifications/types.d.cts +2 -2
- package/dist/notifications/types.d.ts +2 -2
- package/dist/notifications/types.js +1 -3
- package/dist/oauth/index.cjs +3 -14
- package/dist/oauth/index.d.cts +49 -50
- package/dist/oauth/index.d.ts +49 -50
- package/dist/oauth/index.js +2 -5
- package/dist/oauth/types.cjs +0 -4
- package/dist/oauth/types.d.cts +2 -725
- package/dist/oauth/types.d.ts +2 -725
- package/dist/oauth/types.js +1 -3
- package/dist/oauth-ClksaYRY.js +83 -0
- package/dist/oauth-ClksaYRY.js.map +1 -0
- package/dist/oauth-DsZgmtPj.cjs +88 -0
- package/dist/oauth-DsZgmtPj.cjs.map +1 -0
- package/dist/omnisearch/index.cjs +47 -12
- package/dist/omnisearch/index.cjs.map +1 -1
- package/dist/omnisearch/index.d.cts +12 -14
- package/dist/omnisearch/index.d.ts +12 -14
- package/dist/omnisearch/index.js +47 -4
- package/dist/omnisearch/index.js.map +1 -1
- package/dist/omnisearch/types.cjs +0 -4
- package/dist/omnisearch/types.d.cts +2 -3
- package/dist/omnisearch/types.d.ts +2 -3
- package/dist/omnisearch/types.js +1 -3
- package/dist/project-5SLw86eZ.d.ts +18 -0
- package/dist/project-BvFi19K_.cjs +56 -0
- package/dist/project-BvFi19K_.cjs.map +1 -0
- package/dist/project-CRrsxSAK.d.cts +18 -0
- package/dist/project-DWwZv66D.js +39 -0
- package/dist/project-DWwZv66D.js.map +1 -0
- package/dist/queryService/index.cjs +3 -14
- package/dist/queryService/index.d.cts +2 -40
- package/dist/queryService/index.d.ts +2 -40
- package/dist/queryService/index.js +2 -5
- package/dist/queryService/types.cjs +0 -4
- package/dist/queryService/types.d.cts +2 -2
- package/dist/queryService/types.d.ts +2 -2
- package/dist/queryService/types.js +1 -3
- package/dist/queryService-BlyAcBxP.js +114 -0
- package/dist/queryService-BlyAcBxP.js.map +1 -0
- package/dist/queryService-DxUUkTcy.cjs +119 -0
- package/dist/queryService-DxUUkTcy.cjs.map +1 -0
- package/dist/queue/index.cjs +3 -15
- package/dist/queue/index.d.cts +411 -340
- package/dist/queue/index.d.ts +411 -340
- package/dist/queue/index.js +2 -6
- package/dist/queue/types.cjs +0 -4
- package/dist/queue/types.d.cts +2 -2
- package/dist/queue/types.d.ts +2 -2
- package/dist/queue/types.js +1 -3
- package/dist/queue-CpcqeMPz.cjs +137 -0
- package/dist/queue-CpcqeMPz.cjs.map +1 -0
- package/dist/queue-DpZTm7U7.js +126 -0
- package/dist/queue-DpZTm7U7.js.map +1 -0
- package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
- package/dist/scheduler/index.cjs +61 -13
- package/dist/scheduler/index.cjs.map +1 -1
- package/dist/scheduler/index.d.cts +73 -74
- package/dist/scheduler/index.d.ts +73 -74
- package/dist/scheduler/index.js +61 -5
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/types.cjs +0 -4
- package/dist/scheduler/types.d.cts +2 -372
- package/dist/scheduler/types.d.ts +2 -372
- package/dist/scheduler/types.js +1 -3
- package/dist/sdk/configurations/index.cjs +3 -16
- package/dist/sdk/configurations/index.d.cts +3066 -3078
- package/dist/sdk/configurations/index.d.ts +3066 -3078
- package/dist/sdk/configurations/index.js +2 -7
- package/dist/sdk/developerPortal/index.cjs +203 -0
- package/dist/sdk/developerPortal/index.cjs.map +1 -0
- package/dist/sdk/developerPortal/index.d.cts +1371 -0
- package/dist/sdk/developerPortal/index.d.ts +1371 -0
- package/dist/sdk/developerPortal/index.js +202 -0
- package/dist/sdk/developerPortal/index.js.map +1 -0
- package/dist/sdk/queryService/index.cjs +91 -14
- package/dist/sdk/queryService/index.cjs.map +1 -1
- package/dist/sdk/queryService/index.d.cts +2 -35
- package/dist/sdk/queryService/index.d.ts +2 -35
- package/dist/sdk/queryService/index.js +91 -6
- package/dist/sdk/queryService/index.js.map +1 -1
- package/dist/sdk/semanticLayer/index.cjs +352 -54
- package/dist/sdk/semanticLayer/index.cjs.map +1 -1
- package/dist/sdk/semanticLayer/index.d.cts +95 -99
- package/dist/sdk/semanticLayer/index.d.ts +95 -99
- package/dist/sdk/semanticLayer/index.js +346 -4
- package/dist/sdk/semanticLayer/index.js.map +1 -1
- package/dist/sdk/semanticLayer/types.cjs +0 -4
- package/dist/sdk/semanticLayer/types.d.cts +2 -152
- package/dist/sdk/semanticLayer/types.d.ts +2 -152
- package/dist/sdk/semanticLayer/types.js +1 -3
- package/dist/sdk/storage/index.cjs +267 -48
- package/dist/sdk/storage/index.cjs.map +1 -1
- package/dist/sdk/storage/index.d.cts +2 -120
- package/dist/sdk/storage/index.d.ts +2 -120
- package/dist/sdk/storage/index.js +258 -4
- package/dist/sdk/storage/index.js.map +1 -1
- package/dist/sdk/tag/index.cjs +3 -14
- package/dist/sdk/tag/index.d.cts +16 -20
- package/dist/sdk/tag/index.d.ts +16 -20
- package/dist/sdk/tag/index.js +2 -5
- package/dist/sdk/tag/types.cjs +0 -4
- package/dist/sdk/tag/types.d.cts +2 -36
- package/dist/sdk/tag/types.d.ts +2 -36
- package/dist/sdk/tag/types.js +1 -3
- package/dist/sdk/vault/index.cjs +93 -31
- package/dist/sdk/vault/index.cjs.map +1 -1
- package/dist/sdk/vault/index.d.cts +2 -73
- package/dist/sdk/vault/index.d.ts +2 -73
- package/dist/sdk/vault/index.js +88 -3
- package/dist/sdk/vault/index.js.map +1 -1
- package/dist/status/index.cjs +16 -20
- package/dist/status/index.cjs.map +1 -1
- package/dist/status/index.d.cts +8 -9
- package/dist/status/index.d.ts +8 -9
- package/dist/status/index.js +15 -18
- package/dist/status/index.js.map +1 -1
- package/dist/status/types.cjs +0 -6
- package/dist/status/types.d.cts +17 -15
- package/dist/status/types.d.ts +17 -15
- package/dist/status/types.js +1 -3
- package/dist/storage/index.cjs +30 -92
- package/dist/storage/index.d.cts +3 -24
- package/dist/storage/index.d.ts +3 -24
- package/dist/storage/index.js +9 -11
- package/dist/storage/types.cjs +0 -4
- package/dist/storage/types.d.cts +5 -1949
- package/dist/storage/types.d.ts +5 -1949
- package/dist/storage/types.js +1 -3
- package/dist/storage-CQxu0EY3.js +2432 -0
- package/dist/storage-CQxu0EY3.js.map +1 -0
- package/dist/storage-vnH64B_Q.cjs +2461 -0
- package/dist/storage-vnH64B_Q.cjs.map +1 -0
- package/dist/storageTable-C9crh4Ef.cjs +310 -0
- package/dist/storageTable-C9crh4Ef.cjs.map +1 -0
- package/dist/storageTable-DslXtqNL.js +299 -0
- package/dist/storageTable-DslXtqNL.js.map +1 -0
- package/dist/stream/index.cjs +363 -12
- package/dist/stream/index.cjs.map +1 -1
- package/dist/stream/index.d.cts +345 -346
- package/dist/stream/index.d.ts +345 -346
- package/dist/stream/index.js +363 -4
- package/dist/stream/index.js.map +1 -1
- package/dist/stream/types.cjs +0 -4
- package/dist/stream/types.d.cts +2 -2
- package/dist/stream/types.d.ts +2 -2
- package/dist/stream/types.js +1 -3
- package/dist/suggestions-BH3x7xU7.d.cts +438 -0
- package/dist/suggestions-BH3x7xU7.d.ts +438 -0
- package/dist/syncActions/index.cjs +3 -19
- package/dist/syncActions/index.d.cts +2 -67
- package/dist/syncActions/index.d.ts +2 -67
- package/dist/syncActions/index.js +2 -10
- package/dist/syncActions/types.cjs +0 -4
- package/dist/syncActions/types.d.cts +2 -614
- package/dist/syncActions/types.d.ts +2 -614
- package/dist/syncActions/types.js +1 -3
- package/dist/syncActions-AgFiMjRS.js +497 -0
- package/dist/syncActions-AgFiMjRS.js.map +1 -0
- package/dist/syncActions-DPcAPYgJ.cjs +504 -0
- package/dist/syncActions-DPcAPYgJ.cjs.map +1 -0
- package/dist/tag-CsoOZWB_.cjs +175 -0
- package/dist/tag-CsoOZWB_.cjs.map +1 -0
- package/dist/tag-DCsoewjL.js +164 -0
- package/dist/{chunk-WUFODWZV.js.map → tag-DCsoewjL.js.map} +1 -1
- package/dist/telemetry/index.cjs +3 -14
- package/dist/telemetry/index.d.cts +10 -10
- package/dist/telemetry/index.d.ts +10 -10
- package/dist/telemetry/index.js +2 -5
- package/dist/telemetry/types.cjs +0 -4
- package/dist/telemetry/types.d.cts +2 -12
- package/dist/telemetry/types.d.ts +2 -12
- package/dist/telemetry/types.js +1 -3
- package/dist/telemetry-BLgaYEvi.cjs +29 -0
- package/dist/telemetry-BLgaYEvi.cjs.map +1 -0
- package/dist/telemetry-CPiGWpLi.js +24 -0
- package/dist/telemetry-CPiGWpLi.js.map +1 -0
- package/dist/{types-DM1glEQI.d.ts → types-056giLrn.d.cts} +8 -10
- package/dist/types-B1S60aS2.d.ts +373 -0
- package/dist/{types-Dpwb4dD0.d.ts → types-B2Al1BNh.d.ts} +8 -13
- package/dist/types-B2El99VY.d.cts +2835 -0
- package/dist/types-BHCigZFc.d.ts +32 -0
- package/dist/{types-ebolWqn1.d.ts → types-BIAP4CYp.d.cts} +27 -16
- package/dist/types-BJLRgXw0.d.ts +726 -0
- package/dist/types-BMsK6T5k.d.ts +2835 -0
- package/dist/types-BV74LS5r.d.ts +148 -0
- package/dist/types-BXnUqdBB.d.cts +621 -0
- package/dist/{types-nt7I4XNc.d.cts → types-Bc3-a3DT.d.cts} +7 -6
- package/dist/types-BdKtW2Ml.d.cts +23 -0
- package/dist/types-Bv5vw2dc.d.cts +726 -0
- package/dist/{types-BALUbGA5.d.ts → types-BvXODdf5.d.ts} +48 -80
- package/dist/types-By47HWwB.d.cts +386 -0
- package/dist/{types-DOc5_aYZ.d.ts → types-C0bGZqFI.d.cts} +16 -21
- package/dist/types-C2p7JYQ3.d.cts +373 -0
- package/dist/types-CFhAduFK.d.cts +2162 -0
- package/dist/{types-EZBBpiFU.d.ts → types-CIJAtX8q.d.cts} +238 -349
- package/dist/types-CIybfUJ9.d.cts +66 -0
- package/dist/{types-CFeOCzzg.d.cts → types-COFrOmuO.d.ts} +27 -16
- package/dist/{types-D2qGShlS.d.ts → types-CQd9PuKY.d.cts} +31 -106
- package/dist/{types-COti0FGo.d.ts → types-CgF9R0Na.d.ts} +9 -12
- package/dist/types-Co8WobOo.d.ts +2162 -0
- package/dist/{types-D6dnnju2.d.ts → types-CuAoZH8w.d.cts} +32 -30
- package/dist/{types-BsejtGjZ.d.ts → types-Culr5v8R.d.ts} +9 -15
- package/dist/{types-Y1ynT2PH.d.cts → types-D5VvEdOv.d.ts} +31 -106
- package/dist/{types-BuEkMmKT.d.ts → types-D7YGPUsm.d.ts} +219 -234
- package/dist/types-DG_FlLJt.d.cts +2088 -0
- package/dist/{types-BcaALDYY.d.cts → types-DLazCdFR.d.cts} +9 -15
- package/dist/types-DMMMQuNt.d.ts +2088 -0
- package/dist/{types-Bp8d9PJf.d.cts → types-DN7RWWBw.d.ts} +16 -21
- package/dist/{types-DNyZ0z3L.d.cts → types-DQOOWgLt.d.cts} +219 -234
- package/dist/{types-DrGnvgkB.d.ts → types-DSBNqF1J.d.cts} +9 -14
- package/dist/{types-BCBF_5cU.d.cts → types-DWUd__fe.d.ts} +32 -30
- package/dist/types-DdeZK3BO.d.ts +386 -0
- package/dist/types-Dirp9mni.d.ts +66 -0
- package/dist/{types-CfzHhZVG.d.ts → types-DkoyCUqv.d.ts} +7 -6
- package/dist/{types-Cffam0Nw.d.ts → types-DnOGCb-p.d.cts} +105 -80
- package/dist/{types-CniF_D1P.d.cts → types-Drk7PEhk.d.ts} +8 -10
- package/dist/types-DyIKgbGB.d.ts +621 -0
- package/dist/{types-qvle4Ydu.d.cts → types-RmbvQimP.d.ts} +105 -80
- package/dist/types-SX78XZZ0.d.ts +23 -0
- package/dist/{types-cxk-0ftN.d.cts → types-X-gQF8F8.d.ts} +238 -349
- package/dist/types-ca-YNg1r.d.cts +148 -0
- package/dist/{types-CwAYn1EJ.d.cts → types-eP06LqcE.d.cts} +48 -80
- package/dist/types-lFsTSkhe.d.cts +14 -0
- package/dist/types-lFsTSkhe.d.ts +14 -0
- package/dist/{types-Bom93Zx2.d.cts → types-lVXf05pr.d.ts} +9 -14
- package/dist/types-mXM8MrYS.d.cts +32 -0
- package/dist/{types-BPKQRahf.d.cts → types-sTH4KiPc.d.cts} +8 -13
- package/dist/{types-CxAH36ip.d.cts → types-uP64XthM.d.cts} +9 -12
- package/dist/validateConnectionStatus-CBhXmvWC.js +38 -0
- package/dist/validateConnectionStatus-CBhXmvWC.js.map +1 -0
- package/dist/validateConnectionStatus-DVHXGTdi.cjs +55 -0
- package/dist/validateConnectionStatus-DVHXGTdi.cjs.map +1 -0
- package/dist/vault/index.cjs +49 -13
- package/dist/vault/index.cjs.map +1 -1
- package/dist/vault/index.d.cts +2 -27
- package/dist/vault/index.d.ts +2 -27
- package/dist/vault/index.js +49 -5
- package/dist/vault/index.js.map +1 -1
- package/dist/vault/types.cjs +0 -4
- package/dist/vault/types.d.cts +2 -385
- package/dist/vault/types.d.ts +2 -385
- package/dist/vault/types.js +1 -3
- package/package.json +46 -7
- package/surface/apps.md +2 -2
- package/surface/auth.md +9 -2
- package/surface/chat.md +2 -2
- package/surface/dataScience.md +2 -2
- package/surface/kaiAgent.md +2 -1
- package/surface/queryService.md +4 -3
- package/surface/queue.md +2 -1
- package/surface/sdk.md +8 -8
- package/surface/storage.md +40 -35
- package/surface/syncActions.md +2 -2
- package/dist/ManagementClientAuthError-4J0S5tV-.d.ts +0 -9
- package/dist/ManagementClientAuthError-CyDpa4NS.d.cts +0 -9
- package/dist/adminRoles-BSUPLfNf.d.cts +0 -12
- package/dist/adminRoles-BSUPLfNf.d.ts +0 -12
- package/dist/ai/types.cjs.map +0 -1
- package/dist/ai/types.js.map +0 -1
- package/dist/appLogs-BbgAJ5I8.d.cts +0 -7
- package/dist/appLogs-BbgAJ5I8.d.ts +0 -7
- package/dist/apps/types.cjs.map +0 -1
- package/dist/apps/types.js.map +0 -1
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/types.cjs.map +0 -1
- package/dist/auth/types.js.map +0 -1
- package/dist/backends-UNp_e5y9.d.cts +0 -7
- package/dist/backends-UNp_e5y9.d.ts +0 -7
- package/dist/chunk-22E6IGXR.js +0 -6
- package/dist/chunk-22E6IGXR.js.map +0 -1
- package/dist/chunk-24YVNNAG.js +0 -83
- package/dist/chunk-24YVNNAG.js.map +0 -1
- package/dist/chunk-255CHZ3U.js +0 -200
- package/dist/chunk-255CHZ3U.js.map +0 -1
- package/dist/chunk-2BCH2U57.js +0 -67
- package/dist/chunk-2BCH2U57.js.map +0 -1
- package/dist/chunk-2BQBKU6E.js +0 -270
- package/dist/chunk-2BQBKU6E.js.map +0 -1
- package/dist/chunk-2JKTV7UG.cjs +0 -35
- package/dist/chunk-2JKTV7UG.cjs.map +0 -1
- package/dist/chunk-3UBGQFBU.js +0 -29
- package/dist/chunk-3UBGQFBU.js.map +0 -1
- package/dist/chunk-4RC5E3SL.js +0 -140
- package/dist/chunk-4RC5E3SL.js.map +0 -1
- package/dist/chunk-552FC4ZV.js +0 -14
- package/dist/chunk-552FC4ZV.js.map +0 -1
- package/dist/chunk-57Q4CY4H.js +0 -190
- package/dist/chunk-57Q4CY4H.js.map +0 -1
- package/dist/chunk-5A3AQIXR.js +0 -14
- package/dist/chunk-5HEIR4DC.js +0 -39
- package/dist/chunk-5HEIR4DC.js.map +0 -1
- package/dist/chunk-5SR2L35Y.cjs +0 -1828
- package/dist/chunk-5SR2L35Y.cjs.map +0 -1
- package/dist/chunk-62LG5KPI.js +0 -285
- package/dist/chunk-62LG5KPI.js.map +0 -1
- package/dist/chunk-67P5UI6H.js +0 -58
- package/dist/chunk-67P5UI6H.js.map +0 -1
- package/dist/chunk-6PVEHUJL.cjs +0 -1308
- package/dist/chunk-6PVEHUJL.cjs.map +0 -1
- package/dist/chunk-6XFXU5N4.js +0 -119
- package/dist/chunk-6XFXU5N4.js.map +0 -1
- package/dist/chunk-6YZQIMML.cjs +0 -163
- package/dist/chunk-6YZQIMML.cjs.map +0 -1
- package/dist/chunk-6ZQBFK2Y.js +0 -24
- package/dist/chunk-6ZQBFK2Y.js.map +0 -1
- package/dist/chunk-7J2R6XHB.js +0 -3
- package/dist/chunk-7J2R6XHB.js.map +0 -1
- package/dist/chunk-AJ3SCWUB.cjs +0 -69
- package/dist/chunk-AJ3SCWUB.cjs.map +0 -1
- package/dist/chunk-AXYNFDUI.cjs +0 -43
- package/dist/chunk-AXYNFDUI.cjs.map +0 -1
- package/dist/chunk-B45B4AYG.js +0 -272
- package/dist/chunk-B45B4AYG.js.map +0 -1
- package/dist/chunk-B4T4QCLB.js +0 -116
- package/dist/chunk-B4T4QCLB.js.map +0 -1
- package/dist/chunk-BCZPCMGL.cjs +0 -49
- package/dist/chunk-BCZPCMGL.cjs.map +0 -1
- package/dist/chunk-BGJWHTBJ.js +0 -66
- package/dist/chunk-BGJWHTBJ.js.map +0 -1
- package/dist/chunk-BVRPZKRE.cjs +0 -147
- package/dist/chunk-BVRPZKRE.cjs.map +0 -1
- package/dist/chunk-BZB4UVQA.cjs +0 -192
- package/dist/chunk-BZB4UVQA.cjs.map +0 -1
- package/dist/chunk-CHRBWCL7.cjs +0 -472
- package/dist/chunk-CHRBWCL7.cjs.map +0 -1
- package/dist/chunk-CPZME73I.js +0 -16
- package/dist/chunk-CPZME73I.js.map +0 -1
- package/dist/chunk-DVV35AIS.js +0 -468
- package/dist/chunk-DVV35AIS.js.map +0 -1
- package/dist/chunk-E7GGDLAH.cjs +0 -202
- package/dist/chunk-E7GGDLAH.cjs.map +0 -1
- package/dist/chunk-EQPBR3BE.cjs +0 -85
- package/dist/chunk-EQPBR3BE.cjs.map +0 -1
- package/dist/chunk-ERZEQ5JR.js +0 -40
- package/dist/chunk-ERZEQ5JR.js.map +0 -1
- package/dist/chunk-ES3ADC2G.cjs +0 -18
- package/dist/chunk-ES3ADC2G.cjs.map +0 -1
- package/dist/chunk-EWMXK3EI.cjs +0 -8
- package/dist/chunk-EWMXK3EI.cjs.map +0 -1
- package/dist/chunk-FEAE6L3K.cjs +0 -60
- package/dist/chunk-FEAE6L3K.cjs.map +0 -1
- package/dist/chunk-FPB6OGTV.js +0 -26
- package/dist/chunk-FPB6OGTV.js.map +0 -1
- package/dist/chunk-FVU7WU2H.cjs +0 -66
- package/dist/chunk-FVU7WU2H.cjs.map +0 -1
- package/dist/chunk-FW5GBBKL.js +0 -67
- package/dist/chunk-FW5GBBKL.js.map +0 -1
- package/dist/chunk-G2SWCC3X.js +0 -90
- package/dist/chunk-G2SWCC3X.js.map +0 -1
- package/dist/chunk-G3JHVIDZ.cjs +0 -286
- package/dist/chunk-G3JHVIDZ.cjs.map +0 -1
- package/dist/chunk-G3N5KDEY.js +0 -10
- package/dist/chunk-G3N5KDEY.js.map +0 -1
- package/dist/chunk-HGKDXF35.js +0 -301
- package/dist/chunk-HGKDXF35.js.map +0 -1
- package/dist/chunk-HITKHHWN.cjs +0 -174
- package/dist/chunk-HITKHHWN.cjs.map +0 -1
- package/dist/chunk-HQO572JW.cjs +0 -34
- package/dist/chunk-HQO572JW.cjs.map +0 -1
- package/dist/chunk-HUQ5ATIL.cjs +0 -290
- package/dist/chunk-HUQ5ATIL.cjs.map +0 -1
- package/dist/chunk-HZDVMHU6.js +0 -344
- package/dist/chunk-HZDVMHU6.js.map +0 -1
- package/dist/chunk-ICWUR5WA.cjs +0 -68
- package/dist/chunk-ICWUR5WA.cjs.map +0 -1
- package/dist/chunk-IQFNHQWP.cjs +0 -47
- package/dist/chunk-IQFNHQWP.cjs.map +0 -1
- package/dist/chunk-IZ4QM7O4.js +0 -1304
- package/dist/chunk-IZ4QM7O4.js.map +0 -1
- package/dist/chunk-J5JCXSAS.cjs +0 -117
- package/dist/chunk-J5JCXSAS.cjs.map +0 -1
- package/dist/chunk-JI7HLIDL.cjs +0 -119
- package/dist/chunk-JI7HLIDL.cjs.map +0 -1
- package/dist/chunk-JWISA775.cjs +0 -92
- package/dist/chunk-JWISA775.cjs.map +0 -1
- package/dist/chunk-K3BLXPLA.cjs +0 -16
- package/dist/chunk-K3BLXPLA.cjs.map +0 -1
- package/dist/chunk-KATUDT3E.js +0 -45
- package/dist/chunk-KATUDT3E.js.map +0 -1
- package/dist/chunk-KGBWWS6I.js +0 -32
- package/dist/chunk-KGBWWS6I.js.map +0 -1
- package/dist/chunk-KQENBXPS.cjs +0 -34
- package/dist/chunk-KQENBXPS.cjs.map +0 -1
- package/dist/chunk-KTKJD4DM.js +0 -60
- package/dist/chunk-KTKJD4DM.js.map +0 -1
- package/dist/chunk-LNZP2O4P.js +0 -169
- package/dist/chunk-LNZP2O4P.js.map +0 -1
- package/dist/chunk-LWQP7OWA.js +0 -75
- package/dist/chunk-LWQP7OWA.js.map +0 -1
- package/dist/chunk-MRHQJNWF.cjs +0 -8
- package/dist/chunk-MRHQJNWF.cjs.map +0 -1
- package/dist/chunk-MSI6FVGG.js +0 -6
- package/dist/chunk-MSI6FVGG.js.map +0 -1
- package/dist/chunk-N4COL54U.cjs +0 -22
- package/dist/chunk-N4COL54U.cjs.map +0 -1
- package/dist/chunk-NFJKJGXR.js +0 -397
- package/dist/chunk-NFJKJGXR.js.map +0 -1
- package/dist/chunk-NH2TQGRL.cjs +0 -28
- package/dist/chunk-NH2TQGRL.cjs.map +0 -1
- package/dist/chunk-NHYL5QPM.js +0 -74
- package/dist/chunk-NHYL5QPM.js.map +0 -1
- package/dist/chunk-ON4ILCHP.js +0 -1822
- package/dist/chunk-ON4ILCHP.js.map +0 -1
- package/dist/chunk-PLF4JX5B.cjs +0 -155
- package/dist/chunk-PLF4JX5B.cjs.map +0 -1
- package/dist/chunk-PSR3N4NC.js +0 -136
- package/dist/chunk-PSR3N4NC.js.map +0 -1
- package/dist/chunk-QHD4LPAQ.cjs +0 -8
- package/dist/chunk-QHD4LPAQ.cjs.map +0 -1
- package/dist/chunk-QNF3L4B7.js +0 -115
- package/dist/chunk-QNF3L4B7.js.map +0 -1
- package/dist/chunk-RBN3ITTM.js +0 -153
- package/dist/chunk-RBN3ITTM.js.map +0 -1
- package/dist/chunk-RRC5RKF7.cjs +0 -12
- package/dist/chunk-RRC5RKF7.cjs.map +0 -1
- package/dist/chunk-RXYT7EMN.cjs +0 -318
- package/dist/chunk-RXYT7EMN.cjs.map +0 -1
- package/dist/chunk-S46FMY4G.cjs +0 -64
- package/dist/chunk-S46FMY4G.cjs.map +0 -1
- package/dist/chunk-S6BWQKHJ.cjs +0 -116
- package/dist/chunk-S6BWQKHJ.cjs.map +0 -1
- package/dist/chunk-SFTI6QFB.cjs +0 -85
- package/dist/chunk-SFTI6QFB.cjs.map +0 -1
- package/dist/chunk-SNP577FA.cjs +0 -346
- package/dist/chunk-SNP577FA.cjs.map +0 -1
- package/dist/chunk-SUVM3S2T.cjs +0 -69
- package/dist/chunk-SUVM3S2T.cjs.map +0 -1
- package/dist/chunk-SYZ5OFNT.js +0 -114
- package/dist/chunk-SYZ5OFNT.js.map +0 -1
- package/dist/chunk-SZBW4EE2.cjs +0 -180
- package/dist/chunk-SZBW4EE2.cjs.map +0 -1
- package/dist/chunk-T526LPBK.js +0 -6
- package/dist/chunk-T526LPBK.js.map +0 -1
- package/dist/chunk-TBHJQCAE.js +0 -64
- package/dist/chunk-TBHJQCAE.js.map +0 -1
- package/dist/chunk-U3E5YMLO.cjs +0 -82
- package/dist/chunk-U3E5YMLO.cjs.map +0 -1
- package/dist/chunk-U5SE6W5M.cjs +0 -158
- package/dist/chunk-U5SE6W5M.cjs.map +0 -1
- package/dist/chunk-UUY6LQT6.cjs +0 -267
- package/dist/chunk-UUY6LQT6.cjs.map +0 -1
- package/dist/chunk-UVX733BX.js +0 -83
- package/dist/chunk-UVX733BX.js.map +0 -1
- package/dist/chunk-V6FT3RTU.cjs +0 -42
- package/dist/chunk-V6FT3RTU.cjs.map +0 -1
- package/dist/chunk-VB56OVFM.cjs +0 -312
- package/dist/chunk-VB56OVFM.cjs.map +0 -1
- package/dist/chunk-WQ7NNIJ3.js +0 -33
- package/dist/chunk-WQ7NNIJ3.js.map +0 -1
- package/dist/chunk-WUFODWZV.js +0 -177
- package/dist/chunk-WUJ53PP7.cjs +0 -76
- package/dist/chunk-WUJ53PP7.cjs.map +0 -1
- package/dist/chunk-XPDEQND7.cjs +0 -4
- package/dist/chunk-XPDEQND7.cjs.map +0 -1
- package/dist/chunk-YDOSWWE4.cjs +0 -419
- package/dist/chunk-YDOSWWE4.cjs.map +0 -1
- package/dist/chunk-YGEJDWGG.js +0 -19
- package/dist/chunk-YGEJDWGG.js.map +0 -1
- package/dist/chunk-YXGBD4WP.cjs +0 -16
- package/dist/chunk-YXGBD4WP.cjs.map +0 -1
- package/dist/chunk-ZOREOLGE.js +0 -264
- package/dist/chunk-ZOREOLGE.js.map +0 -1
- package/dist/constants/index.cjs.map +0 -1
- package/dist/constants/index.js.map +0 -1
- package/dist/createFetchClient-BHAsPDgF.d.cts +0 -86
- package/dist/createFetchClient-CFIwc6Lh.d.ts +0 -86
- package/dist/createGenericFetchClient-JcbIIqwF.d.cts +0 -18
- package/dist/createGenericFetchClient-ZGG5wbAC.d.ts +0 -18
- package/dist/createOpenapiFetchClient-CduEua6F.d.cts +0 -24
- package/dist/createOpenapiFetchClient-wLlVgp3k.d.ts +0 -24
- package/dist/dataScience/index.cjs.map +0 -1
- package/dist/dataScience/index.js.map +0 -1
- package/dist/dataScience/types.cjs.map +0 -1
- package/dist/dataScience/types.js.map +0 -1
- package/dist/domain/permissions/index.cjs.map +0 -1
- package/dist/domain/permissions/index.js.map +0 -1
- package/dist/domain/storageTable/index.cjs.map +0 -1
- package/dist/domain/storageTable/index.js.map +0 -1
- package/dist/editor/types.cjs.map +0 -1
- package/dist/editor/types.js.map +0 -1
- package/dist/encryption/types.cjs.map +0 -1
- package/dist/encryption/types.js.map +0 -1
- package/dist/import/index.cjs.map +0 -1
- package/dist/import/index.js.map +0 -1
- package/dist/keboolaUID-D1DGSbge.d.cts +0 -19
- package/dist/keboolaUID-D1DGSbge.d.ts +0 -19
- package/dist/management/index.cjs.map +0 -1
- package/dist/management/index.js.map +0 -1
- package/dist/management/types.cjs.map +0 -1
- package/dist/management/types.js.map +0 -1
- package/dist/metastore/index.cjs.map +0 -1
- package/dist/metastore/index.js.map +0 -1
- package/dist/metastore/types.cjs.map +0 -1
- package/dist/metastore/types.js.map +0 -1
- package/dist/notifications/types.cjs.map +0 -1
- package/dist/notifications/types.js.map +0 -1
- package/dist/oauth/index.cjs.map +0 -1
- package/dist/oauth/index.js.map +0 -1
- package/dist/oauth/types.cjs.map +0 -1
- package/dist/oauth/types.js.map +0 -1
- package/dist/omnisearch/types.cjs.map +0 -1
- package/dist/omnisearch/types.js.map +0 -1
- package/dist/project-Dmr-zrQG.d.ts +0 -17
- package/dist/project-DstzWVMN.d.cts +0 -17
- package/dist/queryService/index.cjs.map +0 -1
- package/dist/queryService/index.js.map +0 -1
- package/dist/queryService/types.cjs.map +0 -1
- package/dist/queryService/types.js.map +0 -1
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.js.map +0 -1
- package/dist/queue/types.cjs.map +0 -1
- package/dist/queue/types.js.map +0 -1
- package/dist/registry-CcKlB-yY.d.ts +0 -1046
- package/dist/registry-Cg0Yng1z.d.cts +0 -1046
- package/dist/scheduler/types.cjs.map +0 -1
- package/dist/scheduler/types.js.map +0 -1
- package/dist/sdk/configurations/index.cjs.map +0 -1
- package/dist/sdk/configurations/index.js.map +0 -1
- package/dist/sdk/semanticLayer/types.cjs.map +0 -1
- package/dist/sdk/semanticLayer/types.js.map +0 -1
- package/dist/sdk/tag/index.cjs.map +0 -1
- package/dist/sdk/tag/index.js.map +0 -1
- package/dist/sdk/tag/types.cjs.map +0 -1
- package/dist/sdk/tag/types.js.map +0 -1
- package/dist/status/types.cjs.map +0 -1
- package/dist/status/types.js.map +0 -1
- package/dist/storage/index.cjs.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/types.cjs.map +0 -1
- package/dist/storage/types.js.map +0 -1
- package/dist/storageClient-BAid0vi2.d.cts +0 -1750
- package/dist/storageClient-BX50Attd.d.ts +0 -1750
- package/dist/storageSdk-BS5982c_.d.cts +0 -753
- package/dist/storageSdk-BeJcnEIO.d.ts +0 -753
- package/dist/stream/types.cjs.map +0 -1
- package/dist/stream/types.js.map +0 -1
- package/dist/syncActions/index.cjs.map +0 -1
- package/dist/syncActions/index.js.map +0 -1
- package/dist/syncActions/types.cjs.map +0 -1
- package/dist/syncActions/types.js.map +0 -1
- package/dist/telemetry/index.cjs.map +0 -1
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/types.cjs.map +0 -1
- package/dist/telemetry/types.js.map +0 -1
- package/dist/types-C5DdOzx8.d.cts +0 -12
- package/dist/types-C_jxWM7A.d.ts +0 -12
- package/dist/types-UwuKN9Kx.d.cts +0 -60
- package/dist/types-UwuKN9Kx.d.ts +0 -60
- package/dist/types-f8dUjMX4.d.cts +0 -90
- package/dist/types-f8dUjMX4.d.ts +0 -90
- package/dist/vault/types.cjs.map +0 -1
- package/dist/vault/types.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,1965 +1,1789 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
require(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
require(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
require(
|
|
23
|
-
require(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
require(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var n = Object.create(null);
|
|
55
|
-
if (e) {
|
|
56
|
-
Object.keys(e).forEach(function (k) {
|
|
57
|
-
if (k !== 'default') {
|
|
58
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
59
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function () { return e[k]; }
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
n.default = e;
|
|
67
|
-
return Object.freeze(n);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var z2__namespace = /*#__PURE__*/_interopNamespace(z2);
|
|
71
|
-
|
|
72
|
-
// src/utils/assert.ts
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
3
|
+
const require_project = require("./project-BvFi19K_.cjs");
|
|
4
|
+
const require_jobStatus = require("./jobStatus-kQ9JqF8t.cjs");
|
|
5
|
+
const require_queue = require("./queue-CpcqeMPz.cjs");
|
|
6
|
+
const require_concurrent = require("./concurrent-tbiIa0UL.cjs");
|
|
7
|
+
const require_dedupe = require("./dedupe-CiskLkGR.cjs");
|
|
8
|
+
const require_createStore = require("./createStore-MQbboXcB.cjs");
|
|
9
|
+
const require_storage = require("./storage-vnH64B_Q.cjs");
|
|
10
|
+
const require_tag = require("./tag-CsoOZWB_.cjs");
|
|
11
|
+
const require_generateUUID = require("./generateUUID-C6qKBPIv.cjs");
|
|
12
|
+
const require_isPlainObject = require("./isPlainObject-BB3iy87C.cjs");
|
|
13
|
+
const require_configurations = require("./configurations-CujCwDcB.cjs");
|
|
14
|
+
const require_UserError = require("./UserError-CSGO1qII.cjs");
|
|
15
|
+
const require_createFetchClient = require("./createFetchClient-B9Cv0W9f.cjs");
|
|
16
|
+
const require_validateConnectionStatus = require("./validateConnectionStatus-DVHXGTdi.cjs");
|
|
17
|
+
const require_ManagementClientAuthError = require("./ManagementClientAuthError-DFhi5yxe.cjs");
|
|
18
|
+
const require_QueryJobTimeoutError = require("./QueryJobTimeoutError-CVNPdCWX.cjs");
|
|
19
|
+
const require_SyncActionError = require("./SyncActionError-BG0zwchi.cjs");
|
|
20
|
+
const require_ValidationError = require("./ValidationError-h5qvwahi.cjs");
|
|
21
|
+
const require_createGenericFetchClient = require("./createGenericFetchClient-BWoSkTki.cjs");
|
|
22
|
+
const require_import = require("./import-CXHppAxd.cjs");
|
|
23
|
+
const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-yirrW6Tg.cjs");
|
|
24
|
+
const require_authClient = require("./authClient-Cixa8_L1.cjs");
|
|
25
|
+
const require_management = require("./management-DlVdxzPw.cjs");
|
|
26
|
+
const require_auth = require("./auth-DmgTH0uY.cjs");
|
|
27
|
+
const require_constants = require("./constants-CkAVvuUq.cjs");
|
|
28
|
+
const require_storageTable = require("./storageTable-C9crh4Ef.cjs");
|
|
29
|
+
const require_sdk_semanticLayer_index = require("./sdk/semanticLayer/index.cjs");
|
|
30
|
+
const require_sdk_storage_index = require("./sdk/storage/index.cjs");
|
|
31
|
+
const require_sdk_vault_index = require("./sdk/vault/index.cjs");
|
|
32
|
+
const require_ai_index = require("./ai/index.cjs");
|
|
33
|
+
const require_appLogs = require("./appLogs-BCCi02w6.cjs");
|
|
34
|
+
const require_apps_index = require("./apps/index.cjs");
|
|
35
|
+
const require_chat_index = require("./chat/index.cjs");
|
|
36
|
+
const require_dataScience = require("./dataScience-BqNWX-Gr.cjs");
|
|
37
|
+
const require_editor_index = require("./editor/index.cjs");
|
|
38
|
+
const require_encryption_index = require("./encryption/index.cjs");
|
|
39
|
+
const require_metastore = require("./metastore-DbsxqjhS.cjs");
|
|
40
|
+
const require_notifications_index = require("./notifications/index.cjs");
|
|
41
|
+
const require_oauth = require("./oauth-DsZgmtPj.cjs");
|
|
42
|
+
const require_omnisearch_index = require("./omnisearch/index.cjs");
|
|
43
|
+
const require_queryService = require("./queryService-DxUUkTcy.cjs");
|
|
44
|
+
const require_scheduler_index = require("./scheduler/index.cjs");
|
|
45
|
+
const require_stream_index = require("./stream/index.cjs");
|
|
46
|
+
const require_syncActions = require("./syncActions-DPcAPYgJ.cjs");
|
|
47
|
+
const require_telemetry = require("./telemetry-BLgaYEvi.cjs");
|
|
48
|
+
const require_vault_index = require("./vault/index.cjs");
|
|
49
|
+
const require_credential = require("./credential-D-tX9gP4.cjs");
|
|
50
|
+
const require_sdk_queryService_index = require("./sdk/queryService/index.cjs");
|
|
51
|
+
let zod = require("zod");
|
|
52
|
+
zod = require_rolldown_runtime.__toESM(zod, 1);
|
|
53
|
+
//#region src/utils/assert.ts
|
|
73
54
|
function assert(value, message) {
|
|
74
|
-
|
|
75
|
-
throw new Error(message);
|
|
76
|
-
}
|
|
55
|
+
if (value == null) throw new Error(message);
|
|
77
56
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var createStore = (initial) => {
|
|
118
|
-
let value = initial;
|
|
119
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
120
|
-
return {
|
|
121
|
-
get: () => value,
|
|
122
|
-
set: (next) => {
|
|
123
|
-
if (Object.is(next, value)) return;
|
|
124
|
-
value = next;
|
|
125
|
-
listeners.forEach((listener) => listener(value));
|
|
126
|
-
},
|
|
127
|
-
subscribe: (listener) => {
|
|
128
|
-
listeners.add(listener);
|
|
129
|
-
return () => {
|
|
130
|
-
listeners.delete(listener);
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
dispose: () => {
|
|
134
|
-
value = initial;
|
|
135
|
-
listeners.clear();
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
var isPlainObjectOrArray = (value) => {
|
|
140
|
-
if (Array.isArray(value)) return true;
|
|
141
|
-
const proto = Object.getPrototypeOf(value);
|
|
142
|
-
return proto === Object.prototype || proto === null;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/utils/async/coalesce.ts
|
|
59
|
+
/**
|
|
60
|
+
* Coalesces concurrent triggers onto a single, never-parallel run of `task`.
|
|
61
|
+
* Triggers fired while a run is busy collapse into one trailing run, and each
|
|
62
|
+
* resolves with the first run that started after it — so it never sees stale state.
|
|
63
|
+
*
|
|
64
|
+
* Example — A triggers, then B and C trigger while A's run is still going:
|
|
65
|
+
* 1. trigger A → run #1 starts
|
|
66
|
+
* 2. trigger B, C → run #1 busy, so they wait
|
|
67
|
+
* 3. run #1 done → A resolves
|
|
68
|
+
* 4. run #2 starts → covers B and C together (one trailing run, not two)
|
|
69
|
+
* 5. run #2 done → B and C resolve
|
|
70
|
+
*
|
|
71
|
+
* @returns a trigger; each call returns a promise of the task result.
|
|
72
|
+
* @throws The returned promise rejects with whatever `task` throws or rejects
|
|
73
|
+
* with — the caller handles it (try/catch, or `.catch` on `void trigger()`).
|
|
74
|
+
*/
|
|
75
|
+
const coalesce = (task) => {
|
|
76
|
+
let running = false;
|
|
77
|
+
const waiters = [];
|
|
78
|
+
const drain = async () => {
|
|
79
|
+
running = true;
|
|
80
|
+
const batch = waiters.splice(0);
|
|
81
|
+
try {
|
|
82
|
+
const result = await task();
|
|
83
|
+
batch.forEach((waiter) => waiter.resolve(result));
|
|
84
|
+
} catch (error) {
|
|
85
|
+
batch.forEach((waiter) => waiter.reject(error));
|
|
86
|
+
}
|
|
87
|
+
if (waiters.length > 0) return drain();
|
|
88
|
+
running = false;
|
|
89
|
+
};
|
|
90
|
+
return () => {
|
|
91
|
+
const waiter = Promise.withResolvers();
|
|
92
|
+
waiters.push(waiter);
|
|
93
|
+
if (!running) drain();
|
|
94
|
+
return waiter.promise;
|
|
95
|
+
};
|
|
143
96
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/utils/async/poll/registry.ts
|
|
99
|
+
const DEFAULT_LIMIT = 50;
|
|
100
|
+
const isFinished = ({ snapshot }) => snapshot.state !== "idle" && snapshot.state !== "polling";
|
|
101
|
+
const createPollRegistry = ({ limit = DEFAULT_LIMIT } = {}) => {
|
|
102
|
+
const entries = require_createStore.createStore([]);
|
|
103
|
+
const unsubscribes = /* @__PURE__ */ new Map();
|
|
104
|
+
const maxEntries = require_jobStatus.clamp(require_jobStatus.finiteOr(limit, DEFAULT_LIMIT), 1);
|
|
105
|
+
let nextKey = 1;
|
|
106
|
+
const forget = (key) => {
|
|
107
|
+
unsubscribes.get(key)?.();
|
|
108
|
+
unsubscribes.delete(key);
|
|
109
|
+
};
|
|
110
|
+
const trim = (list) => {
|
|
111
|
+
let kept = list;
|
|
112
|
+
while (kept.length > maxEntries) {
|
|
113
|
+
const dropped = kept.findLast(isFinished) ?? kept.at(-1);
|
|
114
|
+
if (!dropped) break;
|
|
115
|
+
forget(dropped.key);
|
|
116
|
+
kept = kept.filter((entry) => entry !== dropped);
|
|
117
|
+
}
|
|
118
|
+
return kept;
|
|
119
|
+
};
|
|
120
|
+
const replace = (key, snapshot) => entries.set(entries.get().map((entry) => entry.key === key ? {
|
|
121
|
+
...entry,
|
|
122
|
+
snapshot
|
|
123
|
+
} : entry));
|
|
124
|
+
const register = (poller) => {
|
|
125
|
+
const key = nextKey++;
|
|
126
|
+
const entry = {
|
|
127
|
+
key,
|
|
128
|
+
startedAt: Date.now(),
|
|
129
|
+
snapshot: poller.debug(),
|
|
130
|
+
stop: poller.stop,
|
|
131
|
+
start: poller.start
|
|
132
|
+
};
|
|
133
|
+
unsubscribes.set(key, poller.subscribe((snapshot) => replace(key, snapshot)));
|
|
134
|
+
entries.set(trim([entry, ...entries.get()]));
|
|
135
|
+
};
|
|
136
|
+
const collect = () => {
|
|
137
|
+
require_jobStatus.emitter.subscribe(register);
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
list: entries.get,
|
|
141
|
+
collect,
|
|
142
|
+
subscribe: (listener) => entries.subscribe(() => listener()),
|
|
143
|
+
clear: () => {
|
|
144
|
+
entries.get().forEach(({ key }) => forget(key));
|
|
145
|
+
entries.set([]);
|
|
146
|
+
},
|
|
147
|
+
stopAll: (reason) => entries.get().forEach((entry) => entry.stop(reason))
|
|
148
|
+
};
|
|
151
149
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
subscribe: store.subscribe,
|
|
169
|
-
dispose: () => {
|
|
170
|
-
unsubscribe();
|
|
171
|
-
store.dispose();
|
|
172
|
-
}
|
|
173
|
-
};
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/utils/deepMerge.ts
|
|
152
|
+
/**
|
|
153
|
+
* Recursively merge `patch` into `base`. Plain-object values are merged key-by-key; every
|
|
154
|
+
* other value (primitives, arrays, or a type mismatch between the two sides) replaces the
|
|
155
|
+
* base value. `undefined` patch values are skipped, so a partial patch leaves untouched
|
|
156
|
+
* fields alone. Pure — neither argument is mutated; the result preserves `base`'s type.
|
|
157
|
+
*/
|
|
158
|
+
const deepMerge = (base, patch) => {
|
|
159
|
+
const out = { ...base };
|
|
160
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
161
|
+
if (value === void 0) continue;
|
|
162
|
+
const current = out[key];
|
|
163
|
+
out[key] = require_isPlainObject.isPlainObject(current) && require_isPlainObject.isPlainObject(value) ? deepMerge(current, value) : value;
|
|
164
|
+
}
|
|
165
|
+
return out;
|
|
174
166
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const store = createStore({ state: "idle" });
|
|
182
|
-
let currentKey = null;
|
|
183
|
-
let generation = 0;
|
|
184
|
-
let controller = null;
|
|
185
|
-
const run = (key) => {
|
|
186
|
-
controller?.abort();
|
|
187
|
-
controller = new AbortController();
|
|
188
|
-
const runGeneration = ++generation;
|
|
189
|
-
store.set({ state: "pending" });
|
|
190
|
-
build(key, controller.signal).then(
|
|
191
|
-
(value) => {
|
|
192
|
-
if (runGeneration === generation) store.set({ state: "ready", value });
|
|
193
|
-
},
|
|
194
|
-
(error) => {
|
|
195
|
-
if (runGeneration === generation) store.set({ state: "errored", error });
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
};
|
|
199
|
-
const sync = (state) => {
|
|
200
|
-
const next = dependsOn(state);
|
|
201
|
-
if (next === null) {
|
|
202
|
-
if (currentKey === null) return;
|
|
203
|
-
controller?.abort();
|
|
204
|
-
controller = null;
|
|
205
|
-
generation += 1;
|
|
206
|
-
currentKey = null;
|
|
207
|
-
store.set({ state: "idle" });
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (currentKey !== null && keyEquals(currentKey, next)) return;
|
|
211
|
-
currentKey = next;
|
|
212
|
-
run(next);
|
|
213
|
-
};
|
|
214
|
-
sync(source.get());
|
|
215
|
-
const unsubscribe = source.subscribe(sync);
|
|
216
|
-
const readable = {
|
|
217
|
-
get: store.get,
|
|
218
|
-
subscribe: store.subscribe,
|
|
219
|
-
dispose: () => {
|
|
220
|
-
controller?.abort();
|
|
221
|
-
unsubscribe();
|
|
222
|
-
store.dispose();
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
const settled = () => new Promise((resolve) => {
|
|
226
|
-
let unsubscribeSettled = () => {
|
|
227
|
-
};
|
|
228
|
-
const check = (state) => {
|
|
229
|
-
if (state.state === "ready" || state.state === "errored") {
|
|
230
|
-
unsubscribeSettled();
|
|
231
|
-
resolve(state);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
unsubscribeSettled = store.subscribe(check);
|
|
235
|
-
check(store.get());
|
|
236
|
-
});
|
|
237
|
-
return { store: readable, settled };
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
// src/utils/deepMerge.ts
|
|
241
|
-
var deepMerge = (base, patch) => {
|
|
242
|
-
const out = { ...base };
|
|
243
|
-
for (const [key, value] of Object.entries(patch)) {
|
|
244
|
-
if (value === void 0) continue;
|
|
245
|
-
const current = out[key];
|
|
246
|
-
out[key] = chunkMRHQJNWF_cjs.isPlainObject(current) && chunkMRHQJNWF_cjs.isPlainObject(value) ? deepMerge(current, value) : value;
|
|
247
|
-
}
|
|
248
|
-
return out;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
// src/utils/persistor/adapters.ts
|
|
252
|
-
var createNullStorage = () => ({
|
|
253
|
-
getItem: () => null,
|
|
254
|
-
setItem: () => {
|
|
255
|
-
},
|
|
256
|
-
removeItem: () => {
|
|
257
|
-
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/utils/persistor/adapters.ts
|
|
169
|
+
const createNullStorage = () => ({
|
|
170
|
+
getItem: () => null,
|
|
171
|
+
setItem: () => {},
|
|
172
|
+
removeItem: () => {}
|
|
258
173
|
});
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
174
|
+
const createMemoryStorage = () => {
|
|
175
|
+
const store = /* @__PURE__ */ new Map();
|
|
176
|
+
return {
|
|
177
|
+
getItem: (key) => store.get(key) ?? null,
|
|
178
|
+
setItem: (key, value) => {
|
|
179
|
+
store.set(key, value);
|
|
180
|
+
},
|
|
181
|
+
removeItem: (key) => {
|
|
182
|
+
store.delete(key);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
270
185
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
186
|
+
const createWebStorage = (pick) => {
|
|
187
|
+
let web = null;
|
|
188
|
+
try {
|
|
189
|
+
web = pick();
|
|
190
|
+
if (web) {
|
|
191
|
+
const probe = "__keboola_storage_probe__";
|
|
192
|
+
web.setItem(probe, probe);
|
|
193
|
+
web.removeItem(probe);
|
|
194
|
+
}
|
|
195
|
+
} catch (err) {
|
|
196
|
+
console.warn("createWebStorage: web storage unavailable, falling back to memory", err);
|
|
197
|
+
web = null;
|
|
198
|
+
}
|
|
199
|
+
if (!web) return createMemoryStorage();
|
|
200
|
+
const storage = web;
|
|
201
|
+
return {
|
|
202
|
+
getItem: (key) => storage.getItem(key),
|
|
203
|
+
setItem: (key, value) => {
|
|
204
|
+
storage.setItem(key, value);
|
|
205
|
+
},
|
|
206
|
+
removeItem: (key) => {
|
|
207
|
+
storage.removeItem(key);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
295
210
|
};
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
};
|
|
359
|
-
return { hydrate, persist, clear, hasPersistedValue };
|
|
211
|
+
const createLocalStorage = () => createWebStorage(() => "localStorage" in globalThis ? globalThis.localStorage : null);
|
|
212
|
+
const createSessionStorage = () => createWebStorage(() => "sessionStorage" in globalThis ? globalThis.sessionStorage : null);
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/utils/persistor/persistor.ts
|
|
215
|
+
const createPersistor = ({ storage = createNullStorage(), key, schema, defaultValue, encode = JSON.stringify, decode = JSON.parse }) => {
|
|
216
|
+
const clear = () => {
|
|
217
|
+
try {
|
|
218
|
+
storage.removeItem(key);
|
|
219
|
+
} catch (err) {
|
|
220
|
+
console.warn(`createPersistor: failed to clear "${key}"`, err);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const hasPersistedValue = () => {
|
|
224
|
+
try {
|
|
225
|
+
return !!storage.getItem(key);
|
|
226
|
+
} catch (err) {
|
|
227
|
+
console.warn(`createPersistor: failed to read "${key}", assuming empty`, err);
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const hydrate = () => {
|
|
232
|
+
let raw;
|
|
233
|
+
try {
|
|
234
|
+
raw = storage.getItem(key);
|
|
235
|
+
} catch (err) {
|
|
236
|
+
console.warn(`createPersistor: failed to read "${key}", using default`, err);
|
|
237
|
+
return defaultValue;
|
|
238
|
+
}
|
|
239
|
+
if (raw === null) return defaultValue;
|
|
240
|
+
let decoded;
|
|
241
|
+
try {
|
|
242
|
+
decoded = decode(raw);
|
|
243
|
+
} catch (err) {
|
|
244
|
+
console.warn(`createPersistor: failed to decode "${key}", resetting`, err);
|
|
245
|
+
clear();
|
|
246
|
+
return defaultValue;
|
|
247
|
+
}
|
|
248
|
+
const parsed = schema.safeParse(decoded);
|
|
249
|
+
if (parsed.success) return parsed.data;
|
|
250
|
+
clear();
|
|
251
|
+
return defaultValue;
|
|
252
|
+
};
|
|
253
|
+
const persist = (value) => {
|
|
254
|
+
let raw;
|
|
255
|
+
try {
|
|
256
|
+
raw = encode(value);
|
|
257
|
+
} catch (err) {
|
|
258
|
+
console.warn(`createPersistor: failed to encode "${key}", not persisting`, err);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
storage.setItem(key, raw);
|
|
263
|
+
} catch (err) {
|
|
264
|
+
console.warn(`createPersistor: failed to write "${key}"`, err);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
return {
|
|
268
|
+
hydrate,
|
|
269
|
+
persist,
|
|
270
|
+
clear,
|
|
271
|
+
hasPersistedValue
|
|
272
|
+
};
|
|
360
273
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
// Project feature toggles — changes token.owner.features. Anchored to
|
|
369
|
-
// /projects/{id}/features so /manage/features and /users/{id}/features don't match.
|
|
370
|
-
/\/projects\/[^/]+\/features(\/[^/]+)?$/
|
|
371
|
-
];
|
|
372
|
-
var isStorageTokenMutatingRequest = (request) => {
|
|
373
|
-
if (request.method === "GET") return false;
|
|
374
|
-
const { pathname } = new URL(request.url);
|
|
375
|
-
return STORAGE_TOKEN_MUTATING_PATTERNS.some((pattern) => pattern.test(pathname));
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/keboola/createLiveProject.ts
|
|
276
|
+
const STORAGE_TOKEN_MUTATING_PATTERNS = [/\/buckets(\/[^/]+)?$/, /\/projects\/[^/]+\/features(\/[^/]+)?$/];
|
|
277
|
+
const isStorageTokenMutatingRequest = (request) => {
|
|
278
|
+
if (request.method === "GET") return false;
|
|
279
|
+
const { pathname } = new URL(request.url);
|
|
280
|
+
return STORAGE_TOKEN_MUTATING_PATTERNS.some((pattern) => pattern.test(pathname));
|
|
376
281
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
282
|
+
const createProjectRefreshMiddleware = (shouldRefresh, requestRefresh) => (next) => async (request) => {
|
|
283
|
+
const response = await next(request);
|
|
284
|
+
if (shouldRefresh(request.request)) await requestRefresh();
|
|
285
|
+
return response;
|
|
381
286
|
};
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
287
|
+
/**
|
|
288
|
+
* The live project store: seeded from the verified token, re-verified (coalesced) after a
|
|
289
|
+
* token-mutating request or an explicit re-scope. Its `middleware` drives the auto re-verify.
|
|
290
|
+
*/
|
|
291
|
+
const createLiveProject = ({ initialToken, verify }) => {
|
|
292
|
+
const store = require_createStore.createStore(require_project.createProject({ sapiToken: initialToken }));
|
|
293
|
+
const refresh = coalesce(async () => store.set(require_project.createProject({ sapiToken: await verify() })));
|
|
294
|
+
const middleware = createProjectRefreshMiddleware(isStorageTokenMutatingRequest, refresh);
|
|
295
|
+
return {
|
|
296
|
+
store,
|
|
297
|
+
getProject: () => store.get(),
|
|
298
|
+
subscribe: store.subscribe,
|
|
299
|
+
middleware,
|
|
300
|
+
refresh
|
|
301
|
+
};
|
|
390
302
|
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/keboola/errors.ts
|
|
305
|
+
/**
|
|
306
|
+
* The single error the keboola client / session throws. It carries a stable `type` (the switchable
|
|
307
|
+
* contract) and a human-readable message derived from that type — no per-call message strings.
|
|
308
|
+
*/
|
|
309
|
+
const KeboolaErrorType = {
|
|
310
|
+
Unconfigured: "unconfigured",
|
|
311
|
+
NotAuthenticated: "not-authenticated",
|
|
312
|
+
AlreadyAuthenticated: "already-authenticated",
|
|
313
|
+
NoStorageToken: "no-storage-token",
|
|
314
|
+
NoManagementToken: "no-management-token",
|
|
315
|
+
MissingProject: "missing-project",
|
|
316
|
+
NotBearer: "not-bearer",
|
|
317
|
+
NotReady: "not-ready",
|
|
318
|
+
InvalidBuildTransition: "invalid-build-transition"
|
|
403
319
|
};
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
320
|
+
const MESSAGES = {
|
|
321
|
+
[KeboolaErrorType.Unconfigured]: "The session is not configured — set a baseUrl first.",
|
|
322
|
+
[KeboolaErrorType.NotAuthenticated]: "The session is not authenticated — sign in first.",
|
|
323
|
+
[KeboolaErrorType.AlreadyAuthenticated]: "The session is already authenticated — reset before authenticating again.",
|
|
324
|
+
[KeboolaErrorType.NoStorageToken]: "No storage token — authenticate the storage realm first.",
|
|
325
|
+
[KeboolaErrorType.NoManagementToken]: "No management token — authenticate the management realm first.",
|
|
326
|
+
[KeboolaErrorType.MissingProject]: "A bearer storage session requires a project — call setProject(projectId) first.",
|
|
327
|
+
[KeboolaErrorType.NotBearer]: "This operation requires a bearer (OAuth) session.",
|
|
328
|
+
[KeboolaErrorType.NotReady]: "The client is not ready — authenticate the storage realm first.",
|
|
329
|
+
[KeboolaErrorType.InvalidBuildTransition]: "Invalid storage build transition — the build goes idle → initializing → ready | failed."
|
|
414
330
|
};
|
|
415
|
-
var KeboolaError = class
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
331
|
+
var KeboolaError = class KeboolaError extends Error {
|
|
332
|
+
type;
|
|
333
|
+
constructor(type) {
|
|
334
|
+
super(MESSAGES[type]);
|
|
335
|
+
this.type = type;
|
|
336
|
+
this.name = "KeboolaError";
|
|
337
|
+
Object.setPrototypeOf(this, KeboolaError.prototype);
|
|
338
|
+
}
|
|
423
339
|
};
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
340
|
+
const isKeboolaError = (error) => error instanceof KeboolaError;
|
|
341
|
+
/** Throw a {@link KeboolaError} of `type` when `value` is null/undefined; otherwise narrow it. */
|
|
342
|
+
function assert$1(value, type) {
|
|
343
|
+
if (value == null) throw new KeboolaError(type);
|
|
427
344
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/middlewares/loggingMiddleware.ts
|
|
347
|
+
const CORRELATION_ID_HEADER = "X-Correlation-ID";
|
|
348
|
+
const ALWAYS_REDACTED_HEADERS = [
|
|
349
|
+
require_createFetchClient.KeboolaHttpHeader.MANAGEMENT_API_TOKEN,
|
|
350
|
+
require_createFetchClient.KeboolaHttpHeader.STORAGE_API_TOKEN,
|
|
351
|
+
"authorization",
|
|
352
|
+
"cookie",
|
|
353
|
+
"set-cookie"
|
|
437
354
|
];
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
355
|
+
const ALWAYS_REDACTED_QUERY_PARAMS = /* @__PURE__ */ new Set([
|
|
356
|
+
"token",
|
|
357
|
+
"apikey",
|
|
358
|
+
"api_key",
|
|
359
|
+
"access_token",
|
|
360
|
+
"refresh_token",
|
|
361
|
+
"code",
|
|
362
|
+
"state",
|
|
363
|
+
"signature",
|
|
364
|
+
"sig",
|
|
365
|
+
"x-amz-signature",
|
|
366
|
+
"x-amz-credential",
|
|
367
|
+
"x-amz-security-token",
|
|
368
|
+
"password",
|
|
369
|
+
"secret"
|
|
453
370
|
]);
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
});
|
|
464
|
-
return url.toString();
|
|
371
|
+
const REDACTED = "[REDACTED]";
|
|
372
|
+
const getRedactedUrl = (rawUrl) => {
|
|
373
|
+
const url = new URL(rawUrl);
|
|
374
|
+
if (url.username) url.username = REDACTED;
|
|
375
|
+
if (url.password) url.password = REDACTED;
|
|
376
|
+
url.searchParams.forEach((_value, key) => {
|
|
377
|
+
if (ALWAYS_REDACTED_QUERY_PARAMS.has(key.toLowerCase())) url.searchParams.set(key, REDACTED);
|
|
378
|
+
});
|
|
379
|
+
return url.toString();
|
|
465
380
|
};
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
381
|
+
const ensureCorrelationId = (request) => {
|
|
382
|
+
const correlationId = request.headers.get(CORRELATION_ID_HEADER) ?? require_generateUUID.generateUUID();
|
|
383
|
+
request.headers.set(CORRELATION_ID_HEADER, correlationId);
|
|
384
|
+
return correlationId;
|
|
470
385
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
});
|
|
479
|
-
return result;
|
|
386
|
+
const getRedactedHeaders = (headers, redacted) => {
|
|
387
|
+
const redactedSet = new Set([...ALWAYS_REDACTED_HEADERS, ...redacted].map((h) => h.toLowerCase()));
|
|
388
|
+
const result = {};
|
|
389
|
+
headers.forEach((value, name) => {
|
|
390
|
+
result[name] = redactedSet.has(name.toLowerCase()) ? REDACTED : value;
|
|
391
|
+
});
|
|
392
|
+
return result;
|
|
480
393
|
};
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
394
|
+
const getRequestLog = (request, redactedHeaders) => ({
|
|
395
|
+
url: getRedactedUrl(request.url),
|
|
396
|
+
headers: getRedactedHeaders(request.headers, redactedHeaders)
|
|
484
397
|
});
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
398
|
+
const getResponseLog = (response, redactedHeaders) => ({
|
|
399
|
+
status: response.status,
|
|
400
|
+
statusText: response.statusText,
|
|
401
|
+
headers: getRedactedHeaders(response.headers, redactedHeaders)
|
|
489
402
|
});
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
403
|
+
const redactApiError = (error, redactedHeaders) => new require_createFetchClient.ApiError({
|
|
404
|
+
request: new Request(getRedactedUrl(error.request.url), {
|
|
405
|
+
method: error.request.method,
|
|
406
|
+
headers: getRedactedHeaders(error.request.headers, redactedHeaders)
|
|
407
|
+
}),
|
|
408
|
+
response: new Response(null, {
|
|
409
|
+
status: error.response.status,
|
|
410
|
+
statusText: error.response.statusText,
|
|
411
|
+
headers: getRedactedHeaders(error.response.headers, redactedHeaders)
|
|
412
|
+
}),
|
|
413
|
+
data: error.data
|
|
501
414
|
});
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
415
|
+
const formatLog = (level, log) => {
|
|
416
|
+
const parts = [
|
|
417
|
+
`[${level.toUpperCase()}]`,
|
|
418
|
+
`${Math.round(log.durationMs)}ms`,
|
|
419
|
+
log.method
|
|
420
|
+
];
|
|
421
|
+
parts.push(log.request.url);
|
|
422
|
+
if ("response" in log) parts.push(String(log.response.status));
|
|
423
|
+
return parts.join(" ");
|
|
507
424
|
};
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
};
|
|
425
|
+
const createSafeLogger = (logger, level = "error-only") => {
|
|
426
|
+
return {
|
|
427
|
+
info: (log) => {
|
|
428
|
+
if (level !== "all") return;
|
|
429
|
+
try {
|
|
430
|
+
if (logger?.info) {
|
|
431
|
+
logger.info(log);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
console.info(formatLog("info", log));
|
|
435
|
+
} catch {}
|
|
436
|
+
},
|
|
437
|
+
error: (log) => {
|
|
438
|
+
try {
|
|
439
|
+
if (logger?.error) {
|
|
440
|
+
logger.error(log);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
console.error(formatLog("error", log));
|
|
444
|
+
} catch {}
|
|
445
|
+
}
|
|
446
|
+
};
|
|
532
447
|
};
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
};
|
|
448
|
+
const createLoggingMiddleware = (options = {}) => {
|
|
449
|
+
const safeLogger = createSafeLogger(options.logger, options.level);
|
|
450
|
+
const redactHeaders = options.redactHeaders ?? [];
|
|
451
|
+
return (next) => async (fetchRequest) => {
|
|
452
|
+
const correlationId = ensureCorrelationId(fetchRequest.request);
|
|
453
|
+
const start = performance.now();
|
|
454
|
+
const method = fetchRequest.request.method.toLowerCase();
|
|
455
|
+
const requestLog = getRequestLog(fetchRequest.request, redactHeaders);
|
|
456
|
+
try {
|
|
457
|
+
const result = await next(fetchRequest);
|
|
458
|
+
safeLogger.info({
|
|
459
|
+
correlationId,
|
|
460
|
+
method,
|
|
461
|
+
durationMs: performance.now() - start,
|
|
462
|
+
request: requestLog,
|
|
463
|
+
response: getResponseLog(result.response, redactHeaders)
|
|
464
|
+
});
|
|
465
|
+
return result;
|
|
466
|
+
} catch (error) {
|
|
467
|
+
if (error instanceof Error) safeLogger.error({
|
|
468
|
+
correlationId,
|
|
469
|
+
method,
|
|
470
|
+
durationMs: performance.now() - start,
|
|
471
|
+
request: requestLog,
|
|
472
|
+
error: require_createFetchClient.isApiError(error) ? redactApiError(error, redactHeaders) : error
|
|
473
|
+
});
|
|
474
|
+
throw error;
|
|
475
|
+
}
|
|
476
|
+
};
|
|
563
477
|
};
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/middlewares/retryMiddleware.ts
|
|
480
|
+
const DEFAULT_MAX_RETRIES = 5;
|
|
481
|
+
const DEFAULT_RETRYABLE_STATUSES = [
|
|
482
|
+
require_createFetchClient.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
483
|
+
require_createFetchClient.HttpStatus.BAD_GATEWAY,
|
|
484
|
+
require_createFetchClient.HttpStatus.SERVICE_UNAVAILABLE,
|
|
485
|
+
require_createFetchClient.HttpStatus.GATEWAY_TIMEOUT
|
|
572
486
|
];
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
if (attempt === maxRetries || !shouldRetry(error, attempt)) {
|
|
593
|
-
throw error;
|
|
594
|
-
}
|
|
595
|
-
const delayMs = backoffFactor * 1e3 * Math.pow(2, attempt);
|
|
596
|
-
await chunkS46FMY4G_cjs.delay(delayMs, request.request.signal ?? void 0);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
throw new Error("unreachable");
|
|
600
|
-
};
|
|
487
|
+
const DEFAULT_BACKOFF_FACTOR = .3;
|
|
488
|
+
const defaultShouldRetry = (error) => error instanceof require_createFetchClient.ApiError && DEFAULT_RETRYABLE_STATUSES.includes(error.response.status);
|
|
489
|
+
const createRetryMiddleware = (options) => {
|
|
490
|
+
const { maxRetries = DEFAULT_MAX_RETRIES, backoffFactor = DEFAULT_BACKOFF_FACTOR, shouldRetry = defaultShouldRetry } = options ?? {};
|
|
491
|
+
if (!Number.isInteger(maxRetries) || maxRetries < 0) throw new RangeError("maxRetries must be a non-negative integer");
|
|
492
|
+
if (!Number.isFinite(backoffFactor) || backoffFactor < 0) throw new RangeError("backoffFactor must be a finite non-negative number");
|
|
493
|
+
return (next) => async (request) => {
|
|
494
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) try {
|
|
495
|
+
return await next({
|
|
496
|
+
...request,
|
|
497
|
+
request: request.request.clone()
|
|
498
|
+
});
|
|
499
|
+
} catch (error) {
|
|
500
|
+
if (attempt === maxRetries || !shouldRetry(error, attempt)) throw error;
|
|
501
|
+
const delayMs = backoffFactor * 1e3 * Math.pow(2, attempt);
|
|
502
|
+
await require_jobStatus.delay(delayMs, request.request.signal ?? void 0);
|
|
503
|
+
}
|
|
504
|
+
throw new Error("unreachable");
|
|
505
|
+
};
|
|
601
506
|
};
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
});
|
|
618
|
-
return createProxy();
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/serviceClientRegistry/utils.ts
|
|
509
|
+
const isBuiltInProperty = (property) => typeof property === "symbol" || property === "then" || property === "constructor" || property === "toString" || property === "valueOf";
|
|
510
|
+
/**
|
|
511
|
+
* Creates a dummy client that intercepts method calls and invokes the provided onCall callback.
|
|
512
|
+
*/
|
|
513
|
+
const createDummyClient = ({ onCall }) => {
|
|
514
|
+
const createProxy = (path = []) => new Proxy(() => {}, {
|
|
515
|
+
get: (_target, prop) => {
|
|
516
|
+
if (isBuiltInProperty(prop)) return void 0;
|
|
517
|
+
return createProxy([...path, prop]);
|
|
518
|
+
},
|
|
519
|
+
apply: (_target, _thisArgs, args) => onCall(path, args)
|
|
520
|
+
});
|
|
521
|
+
return createProxy();
|
|
619
522
|
};
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
return {
|
|
662
|
-
client: clientMap,
|
|
663
|
-
meta: clientMeta
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
return registry;
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/serviceClientRegistry/createServiceClientRegistry.ts
|
|
525
|
+
const createServiceClientRegistry = () => ({ getServiceBaseUrl, onUnavailable }) => {
|
|
526
|
+
const dummy = (serviceId, clientName) => createDummyClient({ onCall: (path, args) => {
|
|
527
|
+
onUnavailable?.({
|
|
528
|
+
serviceId,
|
|
529
|
+
path,
|
|
530
|
+
args,
|
|
531
|
+
clientName
|
|
532
|
+
});
|
|
533
|
+
} });
|
|
534
|
+
const configs = [];
|
|
535
|
+
const resolveClient = ({ serviceId, clientFn, clientName }) => {
|
|
536
|
+
const serviceBaseUrl = getServiceBaseUrl(serviceId);
|
|
537
|
+
return serviceBaseUrl ? clientFn(serviceBaseUrl) : dummy(serviceId, clientName);
|
|
538
|
+
};
|
|
539
|
+
const registry = {
|
|
540
|
+
add: (config) => {
|
|
541
|
+
configs.push(config);
|
|
542
|
+
return registry;
|
|
543
|
+
},
|
|
544
|
+
build: () => {
|
|
545
|
+
const clientMap = {};
|
|
546
|
+
const clientMeta = [];
|
|
547
|
+
configs.forEach((config) => {
|
|
548
|
+
clientMap[config.clientName] = resolveClient(config);
|
|
549
|
+
clientMeta.push({
|
|
550
|
+
clientName: config.clientName,
|
|
551
|
+
serviceId: config.serviceId,
|
|
552
|
+
isAvailable: !!getServiceBaseUrl(config.serviceId)
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
return {
|
|
556
|
+
client: clientMap,
|
|
557
|
+
meta: clientMeta
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
return registry;
|
|
668
562
|
};
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/keboola/createApi.ts
|
|
565
|
+
const createApi = (state) => new Proxy({}, { get(_target, property) {
|
|
566
|
+
if (isBuiltInProperty(property)) return void 0;
|
|
567
|
+
if (property === "auth") {
|
|
568
|
+
const authClient = state.getAuthClient();
|
|
569
|
+
assert$1(authClient, KeboolaErrorType.Unconfigured);
|
|
570
|
+
return authClient;
|
|
571
|
+
}
|
|
572
|
+
if (property === "management") {
|
|
573
|
+
const management = state.getManagementClient();
|
|
574
|
+
assert$1(management, KeboolaErrorType.NoManagementToken);
|
|
575
|
+
return management;
|
|
576
|
+
}
|
|
577
|
+
const clients = state.getProjectClients();
|
|
578
|
+
assert$1(clients, KeboolaErrorType.NotReady);
|
|
579
|
+
return clients[property];
|
|
580
|
+
} });
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region src/keboola/createMiddlewareFor.ts
|
|
583
|
+
const createMiddlewareFor = (middlewares) => {
|
|
584
|
+
return (target, baseline = []) => {
|
|
585
|
+
if (Array.isArray(middlewares)) return [...baseline, ...middlewares];
|
|
586
|
+
const all = middlewares?.all ?? [];
|
|
587
|
+
const targeted = middlewares?.[target] ?? [];
|
|
588
|
+
return [
|
|
589
|
+
...baseline,
|
|
590
|
+
...all,
|
|
591
|
+
...targeted
|
|
592
|
+
];
|
|
593
|
+
};
|
|
698
594
|
};
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
const store = createStore(initial);
|
|
705
|
-
let expiredNotified = false;
|
|
706
|
-
const setBaseUrl = (baseUrl) => {
|
|
707
|
-
if (store.get().status !== "anonymous")
|
|
708
|
-
throw new KeboolaError(KeboolaErrorType.AlreadyAuthenticated);
|
|
709
|
-
store.set({ status: "anonymous", baseUrl });
|
|
710
|
-
};
|
|
711
|
-
const authenticate = (tokens) => {
|
|
712
|
-
const state = store.get();
|
|
713
|
-
if (state.status !== "anonymous") throw new KeboolaError(KeboolaErrorType.AlreadyAuthenticated);
|
|
714
|
-
if (!state.baseUrl) throw new KeboolaError(KeboolaErrorType.Unconfigured);
|
|
715
|
-
expiredNotified = false;
|
|
716
|
-
store.set({ status: "authenticated", baseUrl: state.baseUrl, credential: stamp(tokens) });
|
|
717
|
-
};
|
|
718
|
-
const setProjectId = (projectId) => {
|
|
719
|
-
const state = store.get();
|
|
720
|
-
if (state.status === "anonymous") throw new KeboolaError(KeboolaErrorType.NotAuthenticated);
|
|
721
|
-
store.set({
|
|
722
|
-
status: "scoped",
|
|
723
|
-
baseUrl: state.baseUrl,
|
|
724
|
-
credential: state.credential,
|
|
725
|
-
projectId
|
|
726
|
-
});
|
|
727
|
-
};
|
|
728
|
-
const clearProjectId = () => {
|
|
729
|
-
const state = store.get();
|
|
730
|
-
if (state.status !== "scoped") return;
|
|
731
|
-
store.set({ status: "authenticated", baseUrl: state.baseUrl, credential: state.credential });
|
|
732
|
-
};
|
|
733
|
-
const reset = () => {
|
|
734
|
-
store.set({ status: "anonymous", baseUrl: store.get().baseUrl });
|
|
735
|
-
};
|
|
736
|
-
const applyRefresh = (tokens) => {
|
|
737
|
-
const state = store.get();
|
|
738
|
-
if (state.status === "anonymous") return;
|
|
739
|
-
store.set({ ...state, credential: stamp(tokens) });
|
|
740
|
-
};
|
|
741
|
-
const forceExpire = () => {
|
|
742
|
-
const state = store.get();
|
|
743
|
-
if (state.status === "anonymous") return;
|
|
744
|
-
const issuedAt = Date.now() - state.credential.expiresIn * 1e3;
|
|
745
|
-
store.set({ ...state, credential: { ...state.credential, issuedAt } });
|
|
746
|
-
};
|
|
747
|
-
const requireCredential = () => {
|
|
748
|
-
const state = store.get();
|
|
749
|
-
if (state.status === "anonymous") throw new KeboolaError(KeboolaErrorType.NotAuthenticated);
|
|
750
|
-
return state.credential;
|
|
751
|
-
};
|
|
752
|
-
const getBaseUrl = () => store.get().baseUrl;
|
|
753
|
-
const notifyExpired = () => {
|
|
754
|
-
if (expiredNotified) return false;
|
|
755
|
-
expiredNotified = true;
|
|
756
|
-
return true;
|
|
757
|
-
};
|
|
758
|
-
const debug = () => store.get();
|
|
759
|
-
const readable = {
|
|
760
|
-
get: store.get,
|
|
761
|
-
subscribe: store.subscribe,
|
|
762
|
-
dispose: store.dispose
|
|
763
|
-
};
|
|
764
|
-
return {
|
|
765
|
-
store: readable,
|
|
766
|
-
setBaseUrl,
|
|
767
|
-
authenticate,
|
|
768
|
-
setProjectId,
|
|
769
|
-
clearProjectId,
|
|
770
|
-
reset,
|
|
771
|
-
applyRefresh,
|
|
772
|
-
forceExpire,
|
|
773
|
-
requireCredential,
|
|
774
|
-
getBaseUrl,
|
|
775
|
-
notifyExpired,
|
|
776
|
-
debug
|
|
777
|
-
};
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region src/keboola/bearer/createConfig.ts
|
|
597
|
+
const INITIAL = {
|
|
598
|
+
status: "anonymous",
|
|
599
|
+
baseUrl: null
|
|
778
600
|
};
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
601
|
+
const stamp = (tokens) => ({
|
|
602
|
+
...tokens,
|
|
603
|
+
issuedAt: Date.now()
|
|
604
|
+
});
|
|
605
|
+
const createConfig$1 = (initial = INITIAL) => {
|
|
606
|
+
const store = require_createStore.createStore(initial);
|
|
607
|
+
let expiredNotified = false;
|
|
608
|
+
const setBaseUrl = (baseUrl) => {
|
|
609
|
+
if (store.get().status !== "anonymous") throw new KeboolaError(KeboolaErrorType.AlreadyAuthenticated);
|
|
610
|
+
store.set({
|
|
611
|
+
status: "anonymous",
|
|
612
|
+
baseUrl
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
const authenticate = (tokens) => {
|
|
616
|
+
const state = store.get();
|
|
617
|
+
if (state.status !== "anonymous") throw new KeboolaError(KeboolaErrorType.AlreadyAuthenticated);
|
|
618
|
+
if (!state.baseUrl) throw new KeboolaError(KeboolaErrorType.Unconfigured);
|
|
619
|
+
expiredNotified = false;
|
|
620
|
+
store.set({
|
|
621
|
+
status: "authenticated",
|
|
622
|
+
baseUrl: state.baseUrl,
|
|
623
|
+
credential: stamp(tokens)
|
|
624
|
+
});
|
|
625
|
+
};
|
|
626
|
+
const setProjectId = (projectId) => {
|
|
627
|
+
const state = store.get();
|
|
628
|
+
if (state.status === "anonymous") throw new KeboolaError(KeboolaErrorType.NotAuthenticated);
|
|
629
|
+
store.set({
|
|
630
|
+
status: "scoped",
|
|
631
|
+
baseUrl: state.baseUrl,
|
|
632
|
+
credential: state.credential,
|
|
633
|
+
projectId
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* Drop the project scope, keeping the credential — the inverse of `setProjectId`, for leaving a
|
|
638
|
+
* project without signing out. The project clients are keyed on the scope, so they tear down and
|
|
639
|
+
* the storage build returns to `idle`; the session stays usable for `auth` and `management`.
|
|
640
|
+
* No-op unless currently scoped.
|
|
641
|
+
*/
|
|
642
|
+
const clearProjectId = () => {
|
|
643
|
+
const state = store.get();
|
|
644
|
+
if (state.status !== "scoped") return;
|
|
645
|
+
store.set({
|
|
646
|
+
status: "authenticated",
|
|
647
|
+
baseUrl: state.baseUrl,
|
|
648
|
+
credential: state.credential
|
|
649
|
+
});
|
|
650
|
+
};
|
|
651
|
+
/** Drop the credential (sign out); keeps the configured baseUrl. */
|
|
652
|
+
const reset = () => {
|
|
653
|
+
store.set({
|
|
654
|
+
status: "anonymous",
|
|
655
|
+
baseUrl: store.get().baseUrl
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
/** Apply a token refresh: replace the credential (fresh tokens, new issue time); no-op before auth. */
|
|
659
|
+
const applyRefresh = (tokens) => {
|
|
660
|
+
const state = store.get();
|
|
661
|
+
if (state.status === "anonymous") return;
|
|
662
|
+
store.set({
|
|
663
|
+
...state,
|
|
664
|
+
credential: stamp(tokens)
|
|
665
|
+
});
|
|
666
|
+
};
|
|
667
|
+
/**
|
|
668
|
+
* Dev/test lever: backdate the current token's issue time by a full lifetime so it reads as
|
|
669
|
+
* expired, making the refresh policy rotate it on the next request. No-op before auth.
|
|
670
|
+
*/
|
|
671
|
+
const forceExpire = () => {
|
|
672
|
+
const state = store.get();
|
|
673
|
+
if (state.status === "anonymous") return;
|
|
674
|
+
const issuedAt = Date.now() - state.credential.expiresIn * 1e3;
|
|
675
|
+
store.set({
|
|
676
|
+
...state,
|
|
677
|
+
credential: {
|
|
678
|
+
...state.credential,
|
|
679
|
+
issuedAt
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
/**
|
|
684
|
+
* The current credential, asserting the session is authenticated (or scoped). Single point for that
|
|
685
|
+
* check so callers (token attach, refresh) don't each re-narrow the state.
|
|
686
|
+
*/
|
|
687
|
+
const requireCredential = () => {
|
|
688
|
+
const state = store.get();
|
|
689
|
+
if (state.status === "anonymous") throw new KeboolaError(KeboolaErrorType.NotAuthenticated);
|
|
690
|
+
return state.credential;
|
|
691
|
+
};
|
|
692
|
+
const getBaseUrl = () => store.get().baseUrl;
|
|
693
|
+
/**
|
|
694
|
+
* Session-expiry latch (fire-once):
|
|
695
|
+
* - why: concurrent 401s all report expiry, but the app must sign out once; and the credential /
|
|
696
|
+
* auth middleware are long-lived singletons, so the latch can't live in them — it must reset
|
|
697
|
+
* per session.
|
|
698
|
+
* - how: returns `true` only for the first call since the last `authenticate` (which re-arms it),
|
|
699
|
+
* so the caller runs its sign-out exactly once per session death.
|
|
700
|
+
*/
|
|
701
|
+
const notifyExpired = () => {
|
|
702
|
+
if (expiredNotified) return false;
|
|
703
|
+
expiredNotified = true;
|
|
704
|
+
return true;
|
|
705
|
+
};
|
|
706
|
+
const debug = () => store.get();
|
|
707
|
+
return {
|
|
708
|
+
store: {
|
|
709
|
+
get: store.get,
|
|
710
|
+
subscribe: store.subscribe,
|
|
711
|
+
dispose: store.dispose
|
|
712
|
+
},
|
|
713
|
+
setBaseUrl,
|
|
714
|
+
authenticate,
|
|
715
|
+
setProjectId,
|
|
716
|
+
clearProjectId,
|
|
717
|
+
reset,
|
|
718
|
+
applyRefresh,
|
|
719
|
+
forceExpire,
|
|
720
|
+
requireCredential,
|
|
721
|
+
getBaseUrl,
|
|
722
|
+
notifyExpired,
|
|
723
|
+
debug
|
|
724
|
+
};
|
|
795
725
|
};
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
726
|
+
//#endregion
|
|
727
|
+
//#region src/domain/defaultBranch.ts
|
|
728
|
+
const createDefaultBranch = ({ devBranches }) => {
|
|
729
|
+
const defaultBranch = devBranches.find((branch) => branch.isDefault);
|
|
730
|
+
assert(defaultBranch, "No default branch found for the project.");
|
|
731
|
+
const getType = (branchId) => {
|
|
732
|
+
if (branchId == null || branchId === "default") return "default";
|
|
733
|
+
return Number(branchId) === defaultBranch.id ? "default" : "dev";
|
|
734
|
+
};
|
|
735
|
+
return {
|
|
736
|
+
id: defaultBranch.id,
|
|
737
|
+
name: defaultBranch.name,
|
|
738
|
+
getType,
|
|
739
|
+
isDev: (branchId) => getType(branchId) === "dev",
|
|
740
|
+
isDefault: (branchId) => getType(branchId) === "default"
|
|
741
|
+
};
|
|
802
742
|
};
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
743
|
+
//#endregion
|
|
744
|
+
//#region src/domain/stack.ts
|
|
745
|
+
const SERVICE_URL_OVERRIDES = { "kai-assistant": (url) => `${url}/api` };
|
|
746
|
+
const createStack = ({ stackInfo, clientServiceUrls }) => {
|
|
747
|
+
const { services, components, features, ...infoRest } = stackInfo;
|
|
748
|
+
const serviceMap = new Map(services.map((service) => {
|
|
749
|
+
const devOverride = clientServiceUrls?.[service.id]?.(service.url);
|
|
750
|
+
const prodOverride = SERVICE_URL_OVERRIDES[service.id]?.(service.url);
|
|
751
|
+
const url = devOverride ?? prodOverride ?? service.url;
|
|
752
|
+
return [service.id, url];
|
|
753
|
+
}));
|
|
754
|
+
const componentMap = new Map(components.map((component) => [component.id, component]));
|
|
755
|
+
const featureSet = new Set(features);
|
|
756
|
+
const hasFeature = (...feature) => {
|
|
757
|
+
if (feature.length === 0) return false;
|
|
758
|
+
return feature.every((x) => featureSet.has(x));
|
|
759
|
+
};
|
|
760
|
+
const hasComponent = (...componentId) => {
|
|
761
|
+
if (componentId.length === 0) return false;
|
|
762
|
+
return componentId.every((x) => componentMap.has(x));
|
|
763
|
+
};
|
|
764
|
+
const getComponent = (componentId) => componentMap.get(componentId) ?? null;
|
|
765
|
+
const hasService = (serviceId) => serviceMap.has(serviceId);
|
|
766
|
+
const getServiceUrl = (serviceId) => serviceMap.get(serviceId) ?? null;
|
|
767
|
+
return {
|
|
768
|
+
...infoRest,
|
|
769
|
+
services,
|
|
770
|
+
features,
|
|
771
|
+
components,
|
|
772
|
+
hasFeature,
|
|
773
|
+
getServiceUrl,
|
|
774
|
+
hasService,
|
|
775
|
+
getComponent,
|
|
776
|
+
hasComponent
|
|
777
|
+
};
|
|
837
778
|
};
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/sdks/variables/variablesSdk.ts
|
|
781
|
+
const VARIABLES_COMPONENT_ID = "keboola.variables";
|
|
782
|
+
/** Union the definitions by name; on a name conflict the target's definition is kept. */
|
|
783
|
+
const mergeVariableDefinitions = (target, source) => {
|
|
784
|
+
const targetNames = new Set(target.map((definition) => definition.name));
|
|
785
|
+
return [...target, ...source.filter((definition) => !targetNames.has(definition.name))];
|
|
844
786
|
};
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
];
|
|
787
|
+
/** Add values missing in the target; on a name conflict the value is updated to the source's. */
|
|
788
|
+
const mergeVariableValues = (target, source) => {
|
|
789
|
+
const sourceByName = new Map(source.map((value) => [value.name, value.value]));
|
|
790
|
+
const targetNames = new Set(target.map((value) => value.name));
|
|
791
|
+
return [...target.map((value) => sourceByName.has(value.name) ? {
|
|
792
|
+
...value,
|
|
793
|
+
value: sourceByName.get(value.name)
|
|
794
|
+
} : value), ...source.filter((value) => !targetNames.has(value.name))];
|
|
854
795
|
};
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
const [target, source] = await Promise.all([
|
|
920
|
-
readVariables(targetVariablesId, targetValuesId, branchId),
|
|
921
|
-
readVariables(sourceVariablesId, sourceValuesId, branchId)
|
|
922
|
-
]);
|
|
923
|
-
return createVariables(
|
|
924
|
-
mergeVariableDefinitions(target.definitions, source.definitions),
|
|
925
|
-
mergeVariableValues(target.values, source.values),
|
|
926
|
-
branchId
|
|
927
|
-
);
|
|
928
|
-
}
|
|
929
|
-
};
|
|
796
|
+
/**
|
|
797
|
+
* Orchestration for `keboola.variables` configs: copy a config, or merge two configs into a fresh
|
|
798
|
+
* one (union definitions, upsert values — source wins on a name conflict). Each result is a brand
|
|
799
|
+
* new config + values row, so the caller can reference it without sharing lineage with the source.
|
|
800
|
+
*/
|
|
801
|
+
const createVariablesSdk = ({ storageClient }) => {
|
|
802
|
+
const configs = storageClient.configurations;
|
|
803
|
+
const rows = storageClient.configurationRows;
|
|
804
|
+
const readVariables = async (configId, valuesRowId, branchId) => {
|
|
805
|
+
const config = await configs.getConfiguration({
|
|
806
|
+
componentId: VARIABLES_COMPONENT_ID,
|
|
807
|
+
configId,
|
|
808
|
+
branchId
|
|
809
|
+
});
|
|
810
|
+
const row = config.rows.find((candidate) => candidate.id === valuesRowId) ?? config.rows[0];
|
|
811
|
+
const rawDefinitions = config.configuration?.variables;
|
|
812
|
+
const rawValues = row?.configuration?.values;
|
|
813
|
+
return {
|
|
814
|
+
definitions: Array.isArray(rawDefinitions) ? rawDefinitions : [],
|
|
815
|
+
values: Array.isArray(rawValues) ? rawValues : []
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
const createVariables = async (definitions, values, branchId) => {
|
|
819
|
+
const config = await configs.createConfiguration({
|
|
820
|
+
branchId,
|
|
821
|
+
componentId: VARIABLES_COMPONENT_ID,
|
|
822
|
+
name: "Variables definition",
|
|
823
|
+
configuration: { variables: definitions }
|
|
824
|
+
});
|
|
825
|
+
try {
|
|
826
|
+
const row = await rows.createConfigurationRow({
|
|
827
|
+
branchId: String(branchId),
|
|
828
|
+
componentId: VARIABLES_COMPONENT_ID,
|
|
829
|
+
configurationId: config.id,
|
|
830
|
+
name: "Default values",
|
|
831
|
+
configuration: { values }
|
|
832
|
+
});
|
|
833
|
+
return {
|
|
834
|
+
variablesId: config.id,
|
|
835
|
+
variablesValuesId: row.id
|
|
836
|
+
};
|
|
837
|
+
} catch (error) {
|
|
838
|
+
await configs.deleteConfiguration({
|
|
839
|
+
branchId,
|
|
840
|
+
componentId: VARIABLES_COMPONENT_ID,
|
|
841
|
+
configId: config.id
|
|
842
|
+
}).catch((cleanupError) => {
|
|
843
|
+
if (error instanceof Error && error.cause === void 0) error.cause = cleanupError;
|
|
844
|
+
});
|
|
845
|
+
throw error;
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
return {
|
|
849
|
+
/** Copy a variables config into a fresh, independent config + values row. */
|
|
850
|
+
copy: async ({ variablesId, variablesValuesId, branchId = "default" }) => {
|
|
851
|
+
const { definitions, values } = await readVariables(variablesId, variablesValuesId, branchId);
|
|
852
|
+
return createVariables(definitions, values, branchId);
|
|
853
|
+
},
|
|
854
|
+
/** Merge the source's variables into the target's and create a fresh merged config + values row. */
|
|
855
|
+
merge: async ({ targetVariablesId, targetValuesId, sourceVariablesId, sourceValuesId, branchId = "default" }) => {
|
|
856
|
+
const [target, source] = await Promise.all([readVariables(targetVariablesId, targetValuesId, branchId), readVariables(sourceVariablesId, sourceValuesId, branchId)]);
|
|
857
|
+
return createVariables(mergeVariableDefinitions(target.definitions, source.definitions), mergeVariableValues(target.values, source.values), branchId);
|
|
858
|
+
}
|
|
859
|
+
};
|
|
930
860
|
};
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
861
|
+
//#endregion
|
|
862
|
+
//#region src/clients/kaiAgent/kaiAgentClient.ts
|
|
863
|
+
const agentSettingsSchema = zod.z.object({
|
|
864
|
+
projectId: zod.z.string(),
|
|
865
|
+
customInstructions: zod.z.string().nullable(),
|
|
866
|
+
createdAt: zod.z.string(),
|
|
867
|
+
updatedAt: zod.z.string()
|
|
936
868
|
});
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
readOnly: z2.z.boolean()
|
|
950
|
-
});
|
|
951
|
-
var toolsListResponseSchema = z2.z.object({
|
|
952
|
-
tools: z2.z.array(toolInfoSchema)
|
|
953
|
-
});
|
|
954
|
-
var skillInfoSchema = z2.z.object({
|
|
955
|
-
name: z2.z.string(),
|
|
956
|
-
description: z2.z.string().nullable(),
|
|
957
|
-
source: z2.z.enum(["first-party", "vendored", "project"])
|
|
869
|
+
const toolPermissionValueSchema = zod.z.enum([
|
|
870
|
+
"always_allow",
|
|
871
|
+
"always_ask",
|
|
872
|
+
"blocked"
|
|
873
|
+
]);
|
|
874
|
+
const userAgentSettingsSchema = zod.z.object({
|
|
875
|
+
projectId: zod.z.string(),
|
|
876
|
+
userId: zod.z.string(),
|
|
877
|
+
customInstructions: zod.z.string().nullable(),
|
|
878
|
+
toolPermissions: zod.z.record(zod.z.string(), toolPermissionValueSchema).nullable(),
|
|
879
|
+
createdAt: zod.z.string(),
|
|
880
|
+
updatedAt: zod.z.string()
|
|
958
881
|
});
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
882
|
+
const toolInfoSchema = zod.z.object({
|
|
883
|
+
name: zod.z.string(),
|
|
884
|
+
description: zod.z.string(),
|
|
885
|
+
readOnly: zod.z.boolean()
|
|
962
886
|
});
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
887
|
+
const toolsListResponseSchema = zod.z.object({ tools: zod.z.array(toolInfoSchema) });
|
|
888
|
+
const skillInfoSchema = zod.z.object({
|
|
889
|
+
name: zod.z.string(),
|
|
890
|
+
description: zod.z.string().nullable(),
|
|
891
|
+
source: zod.z.enum([
|
|
892
|
+
"first-party",
|
|
893
|
+
"vendored",
|
|
894
|
+
"project"
|
|
895
|
+
])
|
|
966
896
|
});
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
type: z2.z.enum(["file", "dir"]),
|
|
971
|
-
size: z2.z.number().int().nonnegative().optional()
|
|
897
|
+
const builtInCommandSchema = zod.z.object({
|
|
898
|
+
name: zod.z.string(),
|
|
899
|
+
description: zod.z.string()
|
|
972
900
|
});
|
|
973
|
-
|
|
974
|
-
|
|
901
|
+
const skillsListResponseSchema = zod.z.object({
|
|
902
|
+
skills: zod.z.array(skillInfoSchema),
|
|
903
|
+
commands: zod.z.array(builtInCommandSchema)
|
|
975
904
|
});
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
905
|
+
const sandboxFileEntrySchema = zod.z.object({
|
|
906
|
+
name: zod.z.string(),
|
|
907
|
+
path: zod.z.string(),
|
|
908
|
+
type: zod.z.enum(["file", "dir"]),
|
|
909
|
+
size: zod.z.number().int().nonnegative().optional()
|
|
981
910
|
});
|
|
982
|
-
|
|
983
|
-
|
|
911
|
+
const sandboxFileListingSchema = zod.z.object({ entries: zod.z.array(sandboxFileEntrySchema) });
|
|
912
|
+
const sandboxFileContentSchema = zod.z.object({
|
|
913
|
+
content: zod.z.string(),
|
|
914
|
+
encoding: zod.z.enum(["utf-8", "binary"]),
|
|
915
|
+
truncated: zod.z.boolean(),
|
|
916
|
+
size: zod.z.number().int().nonnegative()
|
|
984
917
|
});
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
)
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
{ signal }
|
|
1138
|
-
);
|
|
1139
|
-
const result = sandboxGitBranchSchema.safeParse(data);
|
|
1140
|
-
if (!result.success) {
|
|
1141
|
-
throw new Error("Invalid sandbox git-branch response format");
|
|
1142
|
-
}
|
|
1143
|
-
return result.data;
|
|
1144
|
-
};
|
|
1145
|
-
const chatStreamUrl = clientOptions.baseUrl + "/api/chat";
|
|
1146
|
-
const healthCheck = async (signal) => {
|
|
1147
|
-
const { data } = await genericClient.get("/health", {}, { signal });
|
|
1148
|
-
return data;
|
|
1149
|
-
};
|
|
1150
|
-
return {
|
|
1151
|
-
healthCheck,
|
|
1152
|
-
getHistory,
|
|
1153
|
-
getChat,
|
|
1154
|
-
deleteChat,
|
|
1155
|
-
createChat,
|
|
1156
|
-
getVotes,
|
|
1157
|
-
submitVote,
|
|
1158
|
-
getUsage,
|
|
1159
|
-
approveToolCall,
|
|
1160
|
-
submitToolOutput,
|
|
1161
|
-
stopChat,
|
|
1162
|
-
getSuggestions,
|
|
1163
|
-
getAgentSettings,
|
|
1164
|
-
updateAgentSettings,
|
|
1165
|
-
getUserAgentSettings,
|
|
1166
|
-
updateUserAgentSettings,
|
|
1167
|
-
getToolsList,
|
|
1168
|
-
getSkillsList,
|
|
1169
|
-
listSandboxFiles,
|
|
1170
|
-
readSandboxFile,
|
|
1171
|
-
getSandboxGitBranch,
|
|
1172
|
-
chatStreamUrl
|
|
1173
|
-
};
|
|
918
|
+
const sandboxGitBranchSchema = zod.z.object({ branch: zod.z.string().nullable() });
|
|
919
|
+
const votesResponseSchema = zod.z.array(zod.z.object({
|
|
920
|
+
chatId: zod.z.string(),
|
|
921
|
+
messageId: zod.z.string(),
|
|
922
|
+
isUpvoted: zod.z.boolean()
|
|
923
|
+
}));
|
|
924
|
+
const createKaiAgentClient = ({ baseUrl, middlewares, auth }) => {
|
|
925
|
+
const clientOptions = {
|
|
926
|
+
baseUrl,
|
|
927
|
+
middlewares,
|
|
928
|
+
headers: require_auth.createAuthHeaders(auth)
|
|
929
|
+
};
|
|
930
|
+
const client = require_createOpenapiFetchClient.createOpenapiFetchClient(clientOptions);
|
|
931
|
+
const genericClient = require_createGenericFetchClient.createGenericFetchClient(clientOptions);
|
|
932
|
+
const getHistory = async (params) => {
|
|
933
|
+
const { data } = await client.get("/api/history", { query: params });
|
|
934
|
+
return data;
|
|
935
|
+
};
|
|
936
|
+
const getChat = async (chatId, signal) => {
|
|
937
|
+
const { data } = await client.get("/api/chat/{id}", { path: { id: chatId } }, { signal });
|
|
938
|
+
return data;
|
|
939
|
+
};
|
|
940
|
+
const deleteChat = async (chatId) => {
|
|
941
|
+
const { data } = await client.delete("/api/chat", { query: { id: chatId } });
|
|
942
|
+
return data;
|
|
943
|
+
};
|
|
944
|
+
const createChat = async (request) => {
|
|
945
|
+
const { response } = await client.post("/api/chat", { body: request });
|
|
946
|
+
return response;
|
|
947
|
+
};
|
|
948
|
+
const getVotes = async (chatId) => {
|
|
949
|
+
const { data } = await client.get("/api/vote", { query: { chatId } });
|
|
950
|
+
const result = votesResponseSchema.safeParse(data);
|
|
951
|
+
if (!result.success) throw new Error("Invalid votes response format");
|
|
952
|
+
return result.data;
|
|
953
|
+
};
|
|
954
|
+
const submitVote = async (params) => {
|
|
955
|
+
await client.patch("/api/vote", { body: params });
|
|
956
|
+
};
|
|
957
|
+
const getUsage = async (signal) => {
|
|
958
|
+
const { data } = await client.get("/api/usage", {}, { signal });
|
|
959
|
+
return data;
|
|
960
|
+
};
|
|
961
|
+
const approveToolCall = async (chatId, body) => {
|
|
962
|
+
await client.post("/api/chat/{id}/approval", {
|
|
963
|
+
path: { id: chatId },
|
|
964
|
+
body
|
|
965
|
+
});
|
|
966
|
+
};
|
|
967
|
+
const submitToolOutput = async (chatId, body) => {
|
|
968
|
+
await client.post("/api/chat/{id}/ui-tool-result", {
|
|
969
|
+
path: { id: chatId },
|
|
970
|
+
body
|
|
971
|
+
});
|
|
972
|
+
};
|
|
973
|
+
const stopChat = async (chatId) => {
|
|
974
|
+
const { data } = await client.post("/api/chat/{id}/stop", { path: { id: chatId } });
|
|
975
|
+
return data;
|
|
976
|
+
};
|
|
977
|
+
const getSuggestions = async (request, signal) => {
|
|
978
|
+
const { data } = await client.post("/api/suggestions", { body: request }, { signal });
|
|
979
|
+
return data;
|
|
980
|
+
};
|
|
981
|
+
const getAgentSettings = async (signal) => {
|
|
982
|
+
const { data } = await genericClient.get("/api/settings", {}, { signal });
|
|
983
|
+
const result = agentSettingsSchema.safeParse(data);
|
|
984
|
+
if (!result.success) throw new Error("Invalid agent settings response format");
|
|
985
|
+
return result.data;
|
|
986
|
+
};
|
|
987
|
+
const updateAgentSettings = async (request, signal) => {
|
|
988
|
+
const { data } = await genericClient.patch("/api/settings", { body: request }, { signal });
|
|
989
|
+
const result = agentSettingsSchema.safeParse(data);
|
|
990
|
+
if (!result.success) throw new Error("Invalid agent settings response format");
|
|
991
|
+
return result.data;
|
|
992
|
+
};
|
|
993
|
+
const getUserAgentSettings = async (signal) => {
|
|
994
|
+
const { data } = await genericClient.get("/api/settings/user", {}, { signal });
|
|
995
|
+
const result = userAgentSettingsSchema.safeParse(data);
|
|
996
|
+
if (!result.success) throw new Error("Invalid user agent settings response format");
|
|
997
|
+
return result.data;
|
|
998
|
+
};
|
|
999
|
+
const updateUserAgentSettings = async (request, signal) => {
|
|
1000
|
+
const { data } = await genericClient.patch("/api/settings/user", { body: request }, { signal });
|
|
1001
|
+
const result = userAgentSettingsSchema.safeParse(data);
|
|
1002
|
+
if (!result.success) throw new Error("Invalid user agent settings response format");
|
|
1003
|
+
return result.data;
|
|
1004
|
+
};
|
|
1005
|
+
const getToolsList = async (signal) => {
|
|
1006
|
+
const { data } = await genericClient.get("/api/settings/tools", {}, { signal });
|
|
1007
|
+
const result = toolsListResponseSchema.safeParse(data);
|
|
1008
|
+
if (!result.success) throw new Error("Invalid tools list response format");
|
|
1009
|
+
return result.data;
|
|
1010
|
+
};
|
|
1011
|
+
const getSkillsList = async (signal) => {
|
|
1012
|
+
const { data } = await genericClient.get("/api/skills", {}, { signal });
|
|
1013
|
+
const result = skillsListResponseSchema.safeParse(data);
|
|
1014
|
+
if (!result.success) throw new Error("Invalid skills list response format");
|
|
1015
|
+
return result.data;
|
|
1016
|
+
};
|
|
1017
|
+
const listSandboxFiles = async (chatId, path, signal) => {
|
|
1018
|
+
const { data } = await genericClient.get(`/api/chat/${encodeURIComponent(chatId)}/sandbox/files`, { query: path ? { path } : void 0 }, { signal });
|
|
1019
|
+
const result = sandboxFileListingSchema.safeParse(data);
|
|
1020
|
+
if (!result.success) throw new Error("Invalid sandbox files response format");
|
|
1021
|
+
return result.data;
|
|
1022
|
+
};
|
|
1023
|
+
const readSandboxFile = async (chatId, path, signal) => {
|
|
1024
|
+
const { data } = await genericClient.get(`/api/chat/${encodeURIComponent(chatId)}/sandbox/file`, { query: { path } }, { signal });
|
|
1025
|
+
const result = sandboxFileContentSchema.safeParse(data);
|
|
1026
|
+
if (!result.success) throw new Error("Invalid sandbox file response format");
|
|
1027
|
+
return result.data;
|
|
1028
|
+
};
|
|
1029
|
+
const downloadSandboxFile = async (chatId, path, signal) => {
|
|
1030
|
+
const { data } = await genericClient.get(`/api/chat/${encodeURIComponent(chatId)}/sandbox/file/download`, { query: { path } }, { signal });
|
|
1031
|
+
if (!(data instanceof Blob)) throw new Error("Invalid sandbox file download response format");
|
|
1032
|
+
return data;
|
|
1033
|
+
};
|
|
1034
|
+
const getSandboxGitBranch = async (chatId, signal) => {
|
|
1035
|
+
const { data } = await genericClient.get(`/api/chat/${encodeURIComponent(chatId)}/sandbox/git-branch`, {}, { signal });
|
|
1036
|
+
const result = sandboxGitBranchSchema.safeParse(data);
|
|
1037
|
+
if (!result.success) throw new Error("Invalid sandbox git-branch response format");
|
|
1038
|
+
return result.data;
|
|
1039
|
+
};
|
|
1040
|
+
const chatStreamUrl = clientOptions.baseUrl + "/api/chat";
|
|
1041
|
+
const healthCheck = async (signal) => {
|
|
1042
|
+
const { data } = await genericClient.get("/health", {}, { signal });
|
|
1043
|
+
return data;
|
|
1044
|
+
};
|
|
1045
|
+
return {
|
|
1046
|
+
healthCheck,
|
|
1047
|
+
getHistory,
|
|
1048
|
+
getChat,
|
|
1049
|
+
deleteChat,
|
|
1050
|
+
createChat,
|
|
1051
|
+
getVotes,
|
|
1052
|
+
submitVote,
|
|
1053
|
+
getUsage,
|
|
1054
|
+
approveToolCall,
|
|
1055
|
+
submitToolOutput,
|
|
1056
|
+
stopChat,
|
|
1057
|
+
getSuggestions,
|
|
1058
|
+
getAgentSettings,
|
|
1059
|
+
updateAgentSettings,
|
|
1060
|
+
getUserAgentSettings,
|
|
1061
|
+
updateUserAgentSettings,
|
|
1062
|
+
getToolsList,
|
|
1063
|
+
getSkillsList,
|
|
1064
|
+
listSandboxFiles,
|
|
1065
|
+
readSandboxFile,
|
|
1066
|
+
downloadSandboxFile,
|
|
1067
|
+
getSandboxGitBranch,
|
|
1068
|
+
chatStreamUrl
|
|
1069
|
+
};
|
|
1174
1070
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
attachTokenMiddleware
|
|
1183
|
-
}) => createServiceClientRegistry()({
|
|
1184
|
-
getServiceBaseUrl,
|
|
1185
|
-
onUnavailable: ({ serviceId, path, clientName }) => {
|
|
1186
|
-
throw new chunk5SR2L35Y_cjs.ServiceUnavailableError(serviceId, path, clientName);
|
|
1187
|
-
}
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region src/keboola/createServiceClients.ts
|
|
1073
|
+
const createServiceClients = ({ baseUrl, auth, getServiceBaseUrl, middlewareFor, attachTokenMiddleware }) => createServiceClientRegistry()({
|
|
1074
|
+
getServiceBaseUrl,
|
|
1075
|
+
onUnavailable: ({ serviceId, path, clientName }) => {
|
|
1076
|
+
throw new require_storage.ServiceUnavailableError(serviceId, path, clientName);
|
|
1077
|
+
}
|
|
1188
1078
|
}).add({
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1079
|
+
serviceId: "vault",
|
|
1080
|
+
clientName: "vault",
|
|
1081
|
+
clientFn: (serviceBaseUrl) => require_vault_index.createVaultClient({
|
|
1082
|
+
baseUrl: serviceBaseUrl,
|
|
1083
|
+
middlewares: middlewareFor("vault", [attachTokenMiddleware]),
|
|
1084
|
+
auth
|
|
1085
|
+
})
|
|
1196
1086
|
}).add({
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1087
|
+
serviceId: "data-science",
|
|
1088
|
+
clientName: "dataScience",
|
|
1089
|
+
clientFn: (serviceBaseUrl) => require_dataScience.createDataScienceClient({
|
|
1090
|
+
baseUrl: serviceBaseUrl,
|
|
1091
|
+
middlewares: middlewareFor("dataScience", [attachTokenMiddleware]),
|
|
1092
|
+
auth
|
|
1093
|
+
})
|
|
1204
1094
|
}).add({
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
clientName: "apps",
|
|
1213
|
-
clientFn: (serviceBaseUrl) => chunkBZB4UVQA_cjs.createAppsClient({
|
|
1214
|
-
baseUrl: `${serviceBaseUrl}/v2`,
|
|
1215
|
-
middlewares: middlewareFor("apps", [attachTokenMiddleware]),
|
|
1216
|
-
auth
|
|
1217
|
-
})
|
|
1095
|
+
serviceId: "data-science",
|
|
1096
|
+
clientName: "apps",
|
|
1097
|
+
clientFn: (serviceBaseUrl) => require_apps_index.createAppsClient({
|
|
1098
|
+
baseUrl: `${serviceBaseUrl}/v2`,
|
|
1099
|
+
middlewares: middlewareFor("apps", [attachTokenMiddleware]),
|
|
1100
|
+
auth
|
|
1101
|
+
})
|
|
1218
1102
|
}).add({
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1103
|
+
serviceId: "encryption",
|
|
1104
|
+
clientName: "encryption",
|
|
1105
|
+
clientFn: (serviceBaseUrl) => require_encryption_index.createEncryptionClient({
|
|
1106
|
+
baseUrl: serviceBaseUrl,
|
|
1107
|
+
middlewares: middlewareFor("encryption")
|
|
1108
|
+
})
|
|
1225
1109
|
}).add({
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1110
|
+
serviceId: "editor",
|
|
1111
|
+
clientName: "editor",
|
|
1112
|
+
clientFn: (serviceBaseUrl) => require_editor_index.createEditorClient({
|
|
1113
|
+
baseUrl: serviceBaseUrl,
|
|
1114
|
+
middlewares: middlewareFor("editor", [attachTokenMiddleware]),
|
|
1115
|
+
auth
|
|
1116
|
+
})
|
|
1233
1117
|
}).add({
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1118
|
+
serviceId: "sync-actions",
|
|
1119
|
+
clientName: "syncActions",
|
|
1120
|
+
clientFn: (serviceBaseUrl) => require_syncActions.createSyncActionsClient({
|
|
1121
|
+
baseUrl: serviceBaseUrl,
|
|
1122
|
+
middlewares: middlewareFor("syncActions", [attachTokenMiddleware]),
|
|
1123
|
+
auth
|
|
1124
|
+
})
|
|
1241
1125
|
}).add({
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1126
|
+
serviceId: "telemetry",
|
|
1127
|
+
clientName: "telemetry",
|
|
1128
|
+
clientFn: (serviceBaseUrl) => require_telemetry.createTelemetryClient({
|
|
1129
|
+
baseUrl: serviceBaseUrl,
|
|
1130
|
+
middlewares: middlewareFor("telemetry", [attachTokenMiddleware]),
|
|
1131
|
+
auth
|
|
1132
|
+
})
|
|
1249
1133
|
}).add({
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1134
|
+
serviceId: "query",
|
|
1135
|
+
clientName: "queryService",
|
|
1136
|
+
clientFn: (serviceBaseUrl) => require_queryService.createQueryServiceClient({
|
|
1137
|
+
baseUrl: serviceBaseUrl,
|
|
1138
|
+
middlewares: middlewareFor("queryService", [attachTokenMiddleware]),
|
|
1139
|
+
auth
|
|
1140
|
+
})
|
|
1257
1141
|
}).add({
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1142
|
+
serviceId: "queue",
|
|
1143
|
+
clientName: "queue",
|
|
1144
|
+
clientFn: (serviceBaseUrl) => require_queue.createQueueClient({
|
|
1145
|
+
baseUrl: serviceBaseUrl,
|
|
1146
|
+
middlewares: middlewareFor("queue", [attachTokenMiddleware]),
|
|
1147
|
+
auth
|
|
1148
|
+
})
|
|
1265
1149
|
}).add({
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1150
|
+
serviceId: "kai-assistant",
|
|
1151
|
+
clientName: "chat",
|
|
1152
|
+
clientFn: (serviceBaseUrl) => require_chat_index.createChatClient({
|
|
1153
|
+
storageApiUrl: baseUrl,
|
|
1154
|
+
baseUrl: serviceBaseUrl,
|
|
1155
|
+
middlewares: middlewareFor("chat", [attachTokenMiddleware]),
|
|
1156
|
+
auth
|
|
1157
|
+
})
|
|
1274
1158
|
}).add({
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1159
|
+
serviceId: "ai",
|
|
1160
|
+
clientName: "ai",
|
|
1161
|
+
clientFn: (serviceBaseUrl) => require_ai_index.createAiClient({
|
|
1162
|
+
baseUrl: serviceBaseUrl,
|
|
1163
|
+
middlewares: middlewareFor("ai", [attachTokenMiddleware]),
|
|
1164
|
+
auth
|
|
1165
|
+
})
|
|
1282
1166
|
}).add({
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
middlewares: middlewareFor("omnisearch", [attachTokenMiddleware]),
|
|
1291
|
-
auth
|
|
1292
|
-
})
|
|
1167
|
+
serviceId: "ai",
|
|
1168
|
+
clientName: "omnisearch",
|
|
1169
|
+
clientFn: (serviceBaseUrl) => require_omnisearch_index.createOmnisearchClient({
|
|
1170
|
+
baseUrl: `${serviceBaseUrl}/omnisearch`,
|
|
1171
|
+
middlewares: middlewareFor("omnisearch", [attachTokenMiddleware]),
|
|
1172
|
+
auth
|
|
1173
|
+
})
|
|
1293
1174
|
}).add({
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1175
|
+
serviceId: "import",
|
|
1176
|
+
clientName: "import",
|
|
1177
|
+
clientFn: (serviceBaseUrl) => require_import.createImportClient({
|
|
1178
|
+
baseUrl: serviceBaseUrl,
|
|
1179
|
+
middlewares: middlewareFor("import", [attachTokenMiddleware]),
|
|
1180
|
+
auth
|
|
1181
|
+
})
|
|
1301
1182
|
}).add({
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1183
|
+
serviceId: "kai-agent",
|
|
1184
|
+
clientName: "kaiAgent",
|
|
1185
|
+
clientFn: (serviceBaseUrl) => createKaiAgentClient({
|
|
1186
|
+
baseUrl: serviceBaseUrl,
|
|
1187
|
+
middlewares: middlewareFor("kaiAgent", [attachTokenMiddleware]),
|
|
1188
|
+
auth
|
|
1189
|
+
})
|
|
1309
1190
|
}).add({
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1191
|
+
serviceId: "oauth",
|
|
1192
|
+
clientName: "oauth",
|
|
1193
|
+
clientFn: (serviceBaseUrl) => require_oauth.createOauthClient({
|
|
1194
|
+
baseUrl: serviceBaseUrl,
|
|
1195
|
+
middlewares: middlewareFor("oauth", [attachTokenMiddleware]),
|
|
1196
|
+
auth
|
|
1197
|
+
})
|
|
1317
1198
|
}).add({
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1199
|
+
serviceId: "scheduler",
|
|
1200
|
+
clientName: "scheduler",
|
|
1201
|
+
clientFn: (serviceBaseUrl) => require_scheduler_index.createSchedulerClient({
|
|
1202
|
+
baseUrl: serviceBaseUrl,
|
|
1203
|
+
middlewares: middlewareFor("scheduler", [attachTokenMiddleware]),
|
|
1204
|
+
auth
|
|
1205
|
+
})
|
|
1325
1206
|
}).add({
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1207
|
+
serviceId: "stream",
|
|
1208
|
+
clientName: "stream",
|
|
1209
|
+
clientFn: (serviceBaseUrl) => require_stream_index.createStreamClient({
|
|
1210
|
+
baseUrl: serviceBaseUrl,
|
|
1211
|
+
middlewares: middlewareFor("stream", [attachTokenMiddleware]),
|
|
1212
|
+
auth
|
|
1213
|
+
})
|
|
1333
1214
|
}).add({
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1215
|
+
serviceId: "notification",
|
|
1216
|
+
clientName: "notifications",
|
|
1217
|
+
clientFn: (serviceBaseUrl) => require_notifications_index.createNotificationsClient({
|
|
1218
|
+
baseUrl: serviceBaseUrl,
|
|
1219
|
+
middlewares: middlewareFor("notifications", [attachTokenMiddleware]),
|
|
1220
|
+
auth
|
|
1221
|
+
})
|
|
1341
1222
|
}).add({
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1223
|
+
serviceId: "metastore",
|
|
1224
|
+
clientName: "metastore",
|
|
1225
|
+
clientFn: (serviceBaseUrl) => require_metastore.createMetastoreClient({
|
|
1226
|
+
baseUrl: serviceBaseUrl,
|
|
1227
|
+
middlewares: middlewareFor("metastore", [attachTokenMiddleware]),
|
|
1228
|
+
auth
|
|
1229
|
+
})
|
|
1349
1230
|
}).build();
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1231
|
+
//#endregion
|
|
1232
|
+
//#region src/keboola/bearer/createProjectClients.ts
|
|
1233
|
+
/**
|
|
1234
|
+
* Bearer (OAuth) project surface. Same handshake + assembly as the legacy build. The
|
|
1235
|
+
* `Authorization: Bearer` header + transparent refresh come from the engine-shared `authMiddleware`
|
|
1236
|
+
* (one instance for management + every project client). This build only adds the project-scoped
|
|
1237
|
+
* `X-KBC-ProjectId` header, composed *outside* the auth middleware so the header is present
|
|
1238
|
+
* before it clones the request for the 401 replay. Bearer has no static token header, so this
|
|
1239
|
+
* combined `attach` rides on every client — including the operational storage and the bootstrap reader.
|
|
1240
|
+
*/
|
|
1241
|
+
const createProjectClients$1 = async ({ baseUrl, projectId, authMiddleware, middlewareFor, clientServiceUrls }) => {
|
|
1242
|
+
const auth = {
|
|
1243
|
+
type: "bearer",
|
|
1244
|
+
token: "",
|
|
1245
|
+
projectId
|
|
1246
|
+
};
|
|
1247
|
+
const projectIdMiddleware = (next) => (request) => {
|
|
1248
|
+
request.request.headers.set(require_createFetchClient.KeboolaHttpHeader.PROJECT_ID, String(projectId));
|
|
1249
|
+
return next(request);
|
|
1250
|
+
};
|
|
1251
|
+
const attach = (next) => projectIdMiddleware(authMiddleware(next));
|
|
1252
|
+
const reader = require_storage.createStorageClient({
|
|
1253
|
+
baseUrl,
|
|
1254
|
+
auth,
|
|
1255
|
+
middlewares: [attach]
|
|
1256
|
+
});
|
|
1257
|
+
const [stackInfo, sapiToken, devBranches] = await Promise.all([
|
|
1258
|
+
reader.getStackInfo({ exclude: "componentDetails" }),
|
|
1259
|
+
reader.tokens.verify(),
|
|
1260
|
+
reader.branches.getDevBranches()
|
|
1261
|
+
]);
|
|
1262
|
+
const stack = createStack({
|
|
1263
|
+
stackInfo,
|
|
1264
|
+
clientServiceUrls
|
|
1265
|
+
});
|
|
1266
|
+
const defaultBranch = createDefaultBranch({ devBranches });
|
|
1267
|
+
const liveProject = createLiveProject({
|
|
1268
|
+
initialToken: sapiToken,
|
|
1269
|
+
verify: () => reader.tokens.verify()
|
|
1270
|
+
});
|
|
1271
|
+
const storageTableStore = require_createStore.createDerivedStore({
|
|
1272
|
+
source: liveProject.store,
|
|
1273
|
+
build: require_storageTable.createStorageTable,
|
|
1274
|
+
dependsOn: (project) => ({
|
|
1275
|
+
useLegacyBucketPrefix: !project.hasFeature(require_constants.ProjectFeature.DisableLegacyBucketPrefix),
|
|
1276
|
+
hasProtectedDefaultBranch: project.hasFeature(require_constants.ProjectFeature.SoxProtectedDefaultBranch),
|
|
1277
|
+
hasStorageBranches: project.hasFeature(require_constants.ProjectFeature.StorageBranches)
|
|
1278
|
+
})
|
|
1279
|
+
});
|
|
1280
|
+
const context = {
|
|
1281
|
+
baseUrl: require_createFetchClient.normalizeBaseUrl(baseUrl),
|
|
1282
|
+
stack,
|
|
1283
|
+
defaultBranch,
|
|
1284
|
+
get project() {
|
|
1285
|
+
return liveProject.getProject();
|
|
1286
|
+
},
|
|
1287
|
+
get st() {
|
|
1288
|
+
return storageTableStore.get();
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
const storage = require_storage.createStorageClient({
|
|
1292
|
+
baseUrl,
|
|
1293
|
+
auth,
|
|
1294
|
+
middlewares: middlewareFor("storage", [attach, liveProject.middleware])
|
|
1295
|
+
});
|
|
1296
|
+
const { client: services, meta: serviceMeta } = createServiceClients({
|
|
1297
|
+
baseUrl,
|
|
1298
|
+
auth,
|
|
1299
|
+
getServiceBaseUrl: context.stack.getServiceUrl,
|
|
1300
|
+
middlewareFor,
|
|
1301
|
+
attachTokenMiddleware: attach
|
|
1302
|
+
});
|
|
1303
|
+
const sdk = {
|
|
1304
|
+
configuration: require_configurations.createConfigurationSdk({
|
|
1305
|
+
storageClient: storage,
|
|
1306
|
+
encryptionClient: services.encryption,
|
|
1307
|
+
context
|
|
1308
|
+
}),
|
|
1309
|
+
tag: require_tag.createTagSdk({ metastoreClient: services.metastore }),
|
|
1310
|
+
semanticLayer: require_sdk_semanticLayer_index.createSemanticLayerSdk({ metastoreClient: services.metastore }),
|
|
1311
|
+
storage: require_sdk_storage_index.createStorageSdk({ storageClient: storage }),
|
|
1312
|
+
vault: require_sdk_vault_index.createVaultSdk({
|
|
1313
|
+
vaultClient: services.vault,
|
|
1314
|
+
encryptionClient: services.encryption
|
|
1315
|
+
}),
|
|
1316
|
+
variables: createVariablesSdk({ storageClient: storage })
|
|
1317
|
+
};
|
|
1318
|
+
return {
|
|
1319
|
+
context,
|
|
1320
|
+
serviceMeta,
|
|
1321
|
+
storage,
|
|
1322
|
+
...services,
|
|
1323
|
+
sdk
|
|
1324
|
+
};
|
|
1422
1325
|
};
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1326
|
+
//#endregion
|
|
1327
|
+
//#region src/keboola/bearer/middleware.ts
|
|
1328
|
+
/**
|
|
1329
|
+
* Bearer auth for every outgoing request:
|
|
1330
|
+
* - Stamps the current access token (from the credential) as the `Authorization` header.
|
|
1331
|
+
* - On a 401, force-refreshes the token and replays the request once.
|
|
1332
|
+
* - If the replay still 401s, the fresh token is rejected → marks the session expired.
|
|
1333
|
+
*
|
|
1334
|
+
* When the session is anonymous (`getAccessToken` → `null`) the request is passed through untouched
|
|
1335
|
+
* with no 401 dance — so pre-auth calls on the auth client (`login`, `refresh`) work and a failed
|
|
1336
|
+
* login is never mistaken for session expiry.
|
|
1337
|
+
*
|
|
1338
|
+
* Holds no token and never touches config — all token and refresh state lives in the credential.
|
|
1339
|
+
*/
|
|
1340
|
+
const createBearerAuthMiddleware = (credential) => {
|
|
1341
|
+
return (next) => async (request) => {
|
|
1342
|
+
const token = await credential.getAccessToken({ forceRefresh: false });
|
|
1343
|
+
if (token === null) return next(request);
|
|
1344
|
+
const retryRequest = request.request.clone();
|
|
1345
|
+
request.request.headers.set(require_createFetchClient.HttpHeader.AUTHORIZATION, `Bearer ${token}`);
|
|
1346
|
+
try {
|
|
1347
|
+
return await next(request);
|
|
1348
|
+
} catch (error) {
|
|
1349
|
+
if (!require_credential.isUnauthorized(error)) throw error;
|
|
1350
|
+
const refreshed = await credential.getAccessToken({ forceRefresh: true });
|
|
1351
|
+
if (refreshed === null) throw error;
|
|
1352
|
+
retryRequest.headers.set(require_createFetchClient.HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);
|
|
1353
|
+
try {
|
|
1354
|
+
return await next({
|
|
1355
|
+
...request,
|
|
1356
|
+
request: retryRequest
|
|
1357
|
+
});
|
|
1358
|
+
} catch (retryError) {
|
|
1359
|
+
if (require_credential.isUnauthorized(retryError)) credential.notifyExpired();
|
|
1360
|
+
throw retryError;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1452
1364
|
};
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
request.request.headers.set(chunkHUQ5ATIL_cjs.HttpHeader.AUTHORIZATION, `Bearer ${token}`);
|
|
1461
|
-
try {
|
|
1462
|
-
return await next(request);
|
|
1463
|
-
} catch (error) {
|
|
1464
|
-
if (!isUnauthorized(error)) throw error;
|
|
1465
|
-
const refreshed = await credential.getAccessToken({ forceRefresh: true });
|
|
1466
|
-
if (refreshed === null) throw error;
|
|
1467
|
-
retryRequest.headers.set(chunkHUQ5ATIL_cjs.HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);
|
|
1468
|
-
try {
|
|
1469
|
-
return await next({ ...request, request: retryRequest });
|
|
1470
|
-
} catch (retryError) {
|
|
1471
|
-
if (isUnauthorized(retryError)) credential.notifyExpired();
|
|
1472
|
-
throw retryError;
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
};
|
|
1476
|
-
};
|
|
1477
|
-
var SESSION_KEY = "keboola:bearer-session";
|
|
1478
|
-
var persistedSessionSchema = z2__namespace.object({
|
|
1479
|
-
baseUrl: z2__namespace.string().nullable(),
|
|
1480
|
-
projectId: z2__namespace.number().nullable(),
|
|
1481
|
-
refreshToken: z2__namespace.string().nullable()
|
|
1365
|
+
//#endregion
|
|
1366
|
+
//#region src/keboola/bearer/persistor.ts
|
|
1367
|
+
const SESSION_KEY = "keboola:bearer-session";
|
|
1368
|
+
const persistedSessionSchema = zod.object({
|
|
1369
|
+
baseUrl: zod.string().nullable(),
|
|
1370
|
+
projectId: zod.number().nullable(),
|
|
1371
|
+
refreshToken: zod.string().nullable()
|
|
1482
1372
|
});
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1373
|
+
const EMPTY_PERSISTED_SESSION = {
|
|
1374
|
+
baseUrl: null,
|
|
1375
|
+
projectId: null,
|
|
1376
|
+
refreshToken: null
|
|
1487
1377
|
};
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1378
|
+
const createSessionPersistor = (storage) => createPersistor({
|
|
1379
|
+
storage,
|
|
1380
|
+
key: SESSION_KEY,
|
|
1381
|
+
schema: persistedSessionSchema,
|
|
1382
|
+
defaultValue: EMPTY_PERSISTED_SESSION
|
|
1493
1383
|
});
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region src/keboola/bearer/keboola.ts
|
|
1386
|
+
const createKeboola = (options = {}) => {
|
|
1387
|
+
const persistor = createSessionPersistor(options.storage);
|
|
1388
|
+
const config = createConfig$1();
|
|
1389
|
+
const middlewareFor = createMiddlewareFor(options.middlewares);
|
|
1390
|
+
const retryContention = createRetryMiddleware({ shouldRetry: (error) => error instanceof require_createFetchClient.ApiError && error.response.status === require_createFetchClient.HttpStatus.SERVICE_UNAVAILABLE });
|
|
1391
|
+
const authClientBare = require_createStore.createDerivedStore({
|
|
1392
|
+
source: config.store,
|
|
1393
|
+
dependsOn: (state) => state.baseUrl,
|
|
1394
|
+
build: (baseUrl) => baseUrl ? require_authClient.createAuthClient({
|
|
1395
|
+
baseUrl,
|
|
1396
|
+
middlewares: middlewareFor("auth", [retryContention])
|
|
1397
|
+
}) : null
|
|
1398
|
+
});
|
|
1399
|
+
const refresh = async () => {
|
|
1400
|
+
const client = authClientBare.get();
|
|
1401
|
+
assert$1(client, KeboolaErrorType.NotReady);
|
|
1402
|
+
const refreshed = await client.token.refresh(config.requireCredential().refreshToken);
|
|
1403
|
+
config.applyRefresh(refreshed);
|
|
1404
|
+
return refreshed.accessToken;
|
|
1405
|
+
};
|
|
1406
|
+
const getToken = () => {
|
|
1407
|
+
const state = config.store.get();
|
|
1408
|
+
if (state.status === "anonymous") return null;
|
|
1409
|
+
const { accessToken, issuedAt, expiresIn } = state.credential;
|
|
1410
|
+
return {
|
|
1411
|
+
accessToken,
|
|
1412
|
+
timing: {
|
|
1413
|
+
issuedAt,
|
|
1414
|
+
expiresIn
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
const signOut = () => {
|
|
1419
|
+
config.reset();
|
|
1420
|
+
persistor.clear();
|
|
1421
|
+
};
|
|
1422
|
+
const onSessionExpired = () => {
|
|
1423
|
+
if (config.notifyExpired()) signOut();
|
|
1424
|
+
};
|
|
1425
|
+
const credential = require_credential.createBearerCredential({
|
|
1426
|
+
refresh,
|
|
1427
|
+
getToken,
|
|
1428
|
+
onSessionExpired
|
|
1429
|
+
});
|
|
1430
|
+
const authMiddleware = createBearerAuthMiddleware(credential);
|
|
1431
|
+
const authClient = require_createStore.createDerivedStore({
|
|
1432
|
+
source: config.store,
|
|
1433
|
+
dependsOn: (state) => state.baseUrl,
|
|
1434
|
+
build: (baseUrl) => baseUrl ? require_authClient.createAuthClient({
|
|
1435
|
+
baseUrl,
|
|
1436
|
+
middlewares: middlewareFor("auth", [retryContention, authMiddleware])
|
|
1437
|
+
}) : null
|
|
1438
|
+
});
|
|
1439
|
+
const management = require_createStore.createDerivedStore({
|
|
1440
|
+
source: config.store,
|
|
1441
|
+
dependsOn: (state) => state.status === "anonymous" ? null : state.baseUrl,
|
|
1442
|
+
build: (baseUrl) => baseUrl ? require_management.createManagementClient({
|
|
1443
|
+
baseUrl,
|
|
1444
|
+
auth: {
|
|
1445
|
+
type: "bearer",
|
|
1446
|
+
token: ""
|
|
1447
|
+
},
|
|
1448
|
+
middlewares: middlewareFor("management", [authMiddleware])
|
|
1449
|
+
}) : null
|
|
1450
|
+
});
|
|
1451
|
+
const projectClientsAsync = require_createStore.createDerivedAsyncStore({
|
|
1452
|
+
source: config.store,
|
|
1453
|
+
dependsOn: (state) => state.status === "scoped" ? {
|
|
1454
|
+
baseUrl: state.baseUrl,
|
|
1455
|
+
projectId: state.projectId
|
|
1456
|
+
} : null,
|
|
1457
|
+
build: ({ baseUrl, projectId }) => {
|
|
1458
|
+
return createProjectClients$1({
|
|
1459
|
+
baseUrl,
|
|
1460
|
+
authMiddleware,
|
|
1461
|
+
projectId,
|
|
1462
|
+
middlewareFor,
|
|
1463
|
+
clientServiceUrls: options.clientServiceUrls
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
});
|
|
1467
|
+
if (options.baseUrl) config.setBaseUrl(options.baseUrl);
|
|
1468
|
+
config.store.subscribe((state) => {
|
|
1469
|
+
if (state.status === "anonymous") return;
|
|
1470
|
+
persistor.persist({
|
|
1471
|
+
baseUrl: state.baseUrl,
|
|
1472
|
+
projectId: state.status === "scoped" ? state.projectId : null,
|
|
1473
|
+
refreshToken: state.credential.refreshToken
|
|
1474
|
+
});
|
|
1475
|
+
});
|
|
1476
|
+
const debug = () => ({
|
|
1477
|
+
type: "Bearer",
|
|
1478
|
+
config: config.debug(),
|
|
1479
|
+
authReady: authClient.get() !== null,
|
|
1480
|
+
managementReady: management.get() !== null,
|
|
1481
|
+
storage: projectClientsAsync.store.get().state
|
|
1482
|
+
});
|
|
1483
|
+
const session = {
|
|
1484
|
+
hasPersistedValue: persistor.hasPersistedValue,
|
|
1485
|
+
setBaseUrl: config.setBaseUrl,
|
|
1486
|
+
isStorageReady: () => projectClientsAsync.store.get().state === "ready",
|
|
1487
|
+
authenticate: (tokens) => config.authenticate(tokens),
|
|
1488
|
+
setProject: config.setProjectId,
|
|
1489
|
+
setProjectAsync: async (projectId) => {
|
|
1490
|
+
config.setProjectId(projectId);
|
|
1491
|
+
await projectClientsAsync.settled();
|
|
1492
|
+
},
|
|
1493
|
+
/**
|
|
1494
|
+
* Leave the current project but stay signed in — the storage build returns to `idle`, so a
|
|
1495
|
+
* consumer gating on it falls back to its project picker. The persisted session is rewritten with
|
|
1496
|
+
* `projectId: null` by the subscription above, so a reload lands on the picker rather than
|
|
1497
|
+
* re-entering the project. Use `reset` to sign out instead.
|
|
1498
|
+
*/
|
|
1499
|
+
clearProject: config.clearProjectId,
|
|
1500
|
+
reset: signOut,
|
|
1501
|
+
/**
|
|
1502
|
+
* Dev/test only: mark the current access token as expired so the bearer credential rotates it on
|
|
1503
|
+
* the next request. Pair with any authenticated call (e.g. `api.storage.tokens.verify()`) to force
|
|
1504
|
+
* the rotation immediately and observe the new credential.
|
|
1505
|
+
*/
|
|
1506
|
+
debugForceRefresh: config.forceExpire,
|
|
1507
|
+
restore: async () => {
|
|
1508
|
+
const persisted = persistor.hydrate();
|
|
1509
|
+
if (!persisted.refreshToken || !persisted.baseUrl) return { status: "empty" };
|
|
1510
|
+
const configured = config.getBaseUrl();
|
|
1511
|
+
if (configured && configured !== persisted.baseUrl) {
|
|
1512
|
+
persistor.clear();
|
|
1513
|
+
return { status: "empty" };
|
|
1514
|
+
}
|
|
1515
|
+
if (!configured) config.setBaseUrl(persisted.baseUrl);
|
|
1516
|
+
const client = authClientBare.get();
|
|
1517
|
+
assert$1(client, KeboolaErrorType.NotReady);
|
|
1518
|
+
try {
|
|
1519
|
+
const refreshed = await client.token.refresh(persisted.refreshToken);
|
|
1520
|
+
config.authenticate(refreshed);
|
|
1521
|
+
if (persisted.projectId !== null) {
|
|
1522
|
+
config.setProjectId(persisted.projectId);
|
|
1523
|
+
await projectClientsAsync.settled();
|
|
1524
|
+
}
|
|
1525
|
+
return { status: "restored" };
|
|
1526
|
+
} catch (err) {
|
|
1527
|
+
if (require_credential.isUnauthorized(err)) {
|
|
1528
|
+
persistor.clear();
|
|
1529
|
+
return { status: "expired" };
|
|
1530
|
+
}
|
|
1531
|
+
throw err;
|
|
1532
|
+
}
|
|
1533
|
+
},
|
|
1534
|
+
subscribe: (listener) => {
|
|
1535
|
+
const unsubscribeConfig = config.store.subscribe(() => listener(debug()));
|
|
1536
|
+
const unsubscribeBuild = projectClientsAsync.store.subscribe(() => listener(debug()));
|
|
1537
|
+
return () => {
|
|
1538
|
+
unsubscribeConfig();
|
|
1539
|
+
unsubscribeBuild();
|
|
1540
|
+
};
|
|
1541
|
+
},
|
|
1542
|
+
debug
|
|
1543
|
+
};
|
|
1544
|
+
return {
|
|
1545
|
+
api: createApi({
|
|
1546
|
+
getAuthClient: () => authClient.get(),
|
|
1547
|
+
getManagementClient: () => management.get(),
|
|
1548
|
+
getProjectClients: () => {
|
|
1549
|
+
const state = projectClientsAsync.store.get();
|
|
1550
|
+
return state.state === "ready" ? state.value : null;
|
|
1551
|
+
}
|
|
1552
|
+
}),
|
|
1553
|
+
session
|
|
1554
|
+
};
|
|
1647
1555
|
};
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1556
|
+
//#endregion
|
|
1557
|
+
//#region src/keboola/legacy/createConfig.ts
|
|
1558
|
+
const createConfig = () => {
|
|
1559
|
+
const store = require_createStore.createStore({
|
|
1560
|
+
baseUrl: null,
|
|
1561
|
+
sapiToken: null,
|
|
1562
|
+
managementToken: null
|
|
1563
|
+
});
|
|
1564
|
+
const setBaseUrl = (baseUrl) => {
|
|
1565
|
+
store.set({
|
|
1566
|
+
...store.get(),
|
|
1567
|
+
baseUrl
|
|
1568
|
+
});
|
|
1569
|
+
};
|
|
1570
|
+
const authenticate = (tokens) => {
|
|
1571
|
+
const current = store.get();
|
|
1572
|
+
store.set({
|
|
1573
|
+
...current,
|
|
1574
|
+
sapiToken: tokens.sapiToken ?? current.sapiToken,
|
|
1575
|
+
managementToken: tokens.managementToken ?? current.managementToken
|
|
1576
|
+
});
|
|
1577
|
+
};
|
|
1578
|
+
const getStorageToken = () => store.get().sapiToken ?? "";
|
|
1579
|
+
const setStorageToken = (sapiToken) => store.set({
|
|
1580
|
+
...store.get(),
|
|
1581
|
+
sapiToken
|
|
1582
|
+
});
|
|
1583
|
+
/** Current state, for diagnostics. */
|
|
1584
|
+
const debug = () => store.get();
|
|
1585
|
+
return {
|
|
1586
|
+
store,
|
|
1587
|
+
setBaseUrl,
|
|
1588
|
+
authenticate,
|
|
1589
|
+
getStorageToken,
|
|
1590
|
+
setStorageToken,
|
|
1591
|
+
debug
|
|
1592
|
+
};
|
|
1667
1593
|
};
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region src/keboola/legacy/createProjectClients.ts
|
|
1596
|
+
const createAttachStorageToken = (getToken) => (next) => (request) => {
|
|
1597
|
+
request.request.headers.set(require_createFetchClient.KeboolaHttpHeader.STORAGE_API_TOKEN, getToken());
|
|
1598
|
+
return next(request);
|
|
1673
1599
|
};
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1600
|
+
const createProjectClients = async ({ baseUrl, getStorageToken, onStorageTokenRefreshed, middlewareFor, clientServiceUrls }) => {
|
|
1601
|
+
const auth = {
|
|
1602
|
+
type: "sapi-token",
|
|
1603
|
+
token: getStorageToken()
|
|
1604
|
+
};
|
|
1605
|
+
const attach = createAttachStorageToken(getStorageToken);
|
|
1606
|
+
const _storage = require_storage.createStorageClient({
|
|
1607
|
+
baseUrl,
|
|
1608
|
+
auth,
|
|
1609
|
+
middlewares: [attach]
|
|
1610
|
+
});
|
|
1611
|
+
const [stackInfo, sapiToken, devBranches] = await Promise.all([
|
|
1612
|
+
_storage.getStackInfo({ exclude: "componentDetails" }),
|
|
1613
|
+
_storage.tokens.verify(),
|
|
1614
|
+
_storage.branches.getDevBranches()
|
|
1615
|
+
]);
|
|
1616
|
+
const stack = createStack({
|
|
1617
|
+
stackInfo,
|
|
1618
|
+
clientServiceUrls
|
|
1619
|
+
});
|
|
1620
|
+
const defaultBranch = createDefaultBranch({ devBranches });
|
|
1621
|
+
const liveProject = createLiveProject({
|
|
1622
|
+
initialToken: sapiToken,
|
|
1623
|
+
verify: () => _storage.tokens.verify()
|
|
1624
|
+
});
|
|
1625
|
+
const storageTableStore = require_createStore.createDerivedStore({
|
|
1626
|
+
source: liveProject.store,
|
|
1627
|
+
build: require_storageTable.createStorageTable,
|
|
1628
|
+
dependsOn: (project) => ({
|
|
1629
|
+
useLegacyBucketPrefix: !project.hasFeature(require_constants.ProjectFeature.DisableLegacyBucketPrefix),
|
|
1630
|
+
hasProtectedDefaultBranch: project.hasFeature(require_constants.ProjectFeature.SoxProtectedDefaultBranch),
|
|
1631
|
+
hasStorageBranches: project.hasFeature(require_constants.ProjectFeature.StorageBranches)
|
|
1632
|
+
})
|
|
1633
|
+
});
|
|
1634
|
+
const context = {
|
|
1635
|
+
baseUrl: require_createFetchClient.normalizeBaseUrl(baseUrl),
|
|
1636
|
+
stack,
|
|
1637
|
+
defaultBranch,
|
|
1638
|
+
get project() {
|
|
1639
|
+
return liveProject.getProject();
|
|
1640
|
+
},
|
|
1641
|
+
get st() {
|
|
1642
|
+
return storageTableStore.get();
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
const storage = require_storage.createStorageClient({
|
|
1646
|
+
baseUrl,
|
|
1647
|
+
auth,
|
|
1648
|
+
middlewares: middlewareFor("storage", [liveProject.middleware]),
|
|
1649
|
+
onRefreshToken: onStorageTokenRefreshed
|
|
1650
|
+
});
|
|
1651
|
+
const { client: services, meta: serviceMeta } = createServiceClients({
|
|
1652
|
+
baseUrl,
|
|
1653
|
+
auth,
|
|
1654
|
+
getServiceBaseUrl: context.stack.getServiceUrl,
|
|
1655
|
+
middlewareFor,
|
|
1656
|
+
attachTokenMiddleware: attach
|
|
1657
|
+
});
|
|
1658
|
+
const sdk = {
|
|
1659
|
+
configuration: require_configurations.createConfigurationSdk({
|
|
1660
|
+
storageClient: storage,
|
|
1661
|
+
encryptionClient: services.encryption,
|
|
1662
|
+
context
|
|
1663
|
+
}),
|
|
1664
|
+
tag: require_tag.createTagSdk({ metastoreClient: services.metastore }),
|
|
1665
|
+
semanticLayer: require_sdk_semanticLayer_index.createSemanticLayerSdk({ metastoreClient: services.metastore }),
|
|
1666
|
+
storage: require_sdk_storage_index.createStorageSdk({ storageClient: storage }),
|
|
1667
|
+
vault: require_sdk_vault_index.createVaultSdk({
|
|
1668
|
+
vaultClient: services.vault,
|
|
1669
|
+
encryptionClient: services.encryption
|
|
1670
|
+
}),
|
|
1671
|
+
variables: createVariablesSdk({ storageClient: storage })
|
|
1672
|
+
};
|
|
1673
|
+
return {
|
|
1674
|
+
context,
|
|
1675
|
+
serviceMeta,
|
|
1676
|
+
storage,
|
|
1677
|
+
...services,
|
|
1678
|
+
sdk
|
|
1679
|
+
};
|
|
1741
1680
|
};
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region src/keboola/legacy/keboola.ts
|
|
1683
|
+
const createLegacyKeboola = (options = {}) => {
|
|
1684
|
+
const config = createConfig();
|
|
1685
|
+
const middlewareFor = createMiddlewareFor(options.middlewares);
|
|
1686
|
+
const authClient = require_createStore.createDerivedStore({
|
|
1687
|
+
source: config.store,
|
|
1688
|
+
dependsOn: (state) => state.baseUrl,
|
|
1689
|
+
build: (baseUrl) => baseUrl ? require_authClient.createAuthClient({
|
|
1690
|
+
baseUrl,
|
|
1691
|
+
middlewares: middlewareFor("auth", [])
|
|
1692
|
+
}) : null
|
|
1693
|
+
});
|
|
1694
|
+
const management = require_createStore.createDerivedStore({
|
|
1695
|
+
source: config.store,
|
|
1696
|
+
dependsOn: (state) => ({
|
|
1697
|
+
baseUrl: state.baseUrl,
|
|
1698
|
+
token: state.managementToken
|
|
1699
|
+
}),
|
|
1700
|
+
build: ({ baseUrl, token }) => baseUrl ? require_management.createManagementClient({
|
|
1701
|
+
baseUrl,
|
|
1702
|
+
auth: token ? {
|
|
1703
|
+
type: "management-token",
|
|
1704
|
+
token
|
|
1705
|
+
} : { type: "management-token" },
|
|
1706
|
+
middlewares: middlewareFor("management", [])
|
|
1707
|
+
}) : null
|
|
1708
|
+
});
|
|
1709
|
+
const build = require_createStore.createDerivedAsyncStore({
|
|
1710
|
+
source: config.store,
|
|
1711
|
+
dependsOn: (state) => state.sapiToken && state.baseUrl ? state.baseUrl : null,
|
|
1712
|
+
build: (baseUrl) => createProjectClients({
|
|
1713
|
+
baseUrl,
|
|
1714
|
+
getStorageToken: config.getStorageToken,
|
|
1715
|
+
onStorageTokenRefreshed: config.setStorageToken,
|
|
1716
|
+
middlewareFor,
|
|
1717
|
+
clientServiceUrls: options.clientServiceUrls
|
|
1718
|
+
})
|
|
1719
|
+
});
|
|
1720
|
+
if (options.baseUrl) config.setBaseUrl(options.baseUrl);
|
|
1721
|
+
const debug = () => {
|
|
1722
|
+
const info = config.debug();
|
|
1723
|
+
return {
|
|
1724
|
+
type: "Sapi",
|
|
1725
|
+
config: info,
|
|
1726
|
+
authReady: authClient.get() !== null,
|
|
1727
|
+
managementReady: !!info.managementToken,
|
|
1728
|
+
storage: build.store.get().state
|
|
1729
|
+
};
|
|
1730
|
+
};
|
|
1731
|
+
const session = {
|
|
1732
|
+
setBaseUrl: config.setBaseUrl,
|
|
1733
|
+
isStorageReady: () => build.store.get().state === "ready",
|
|
1734
|
+
authenticateStorage: (sapiToken) => config.authenticate({ sapiToken }),
|
|
1735
|
+
authenticateStorageAsync: async (sapiToken) => {
|
|
1736
|
+
config.authenticate({ sapiToken });
|
|
1737
|
+
await build.settled();
|
|
1738
|
+
},
|
|
1739
|
+
authenticateManagement: (managementToken) => config.authenticate({ managementToken }),
|
|
1740
|
+
subscribe: (listener) => {
|
|
1741
|
+
const unsubscribeConfig = config.store.subscribe(() => listener(debug()));
|
|
1742
|
+
const unsubscribeBuild = build.store.subscribe(() => listener(debug()));
|
|
1743
|
+
return () => {
|
|
1744
|
+
unsubscribeConfig();
|
|
1745
|
+
unsubscribeBuild();
|
|
1746
|
+
};
|
|
1747
|
+
},
|
|
1748
|
+
debug
|
|
1749
|
+
};
|
|
1750
|
+
return {
|
|
1751
|
+
api: createApi({
|
|
1752
|
+
getAuthClient: () => authClient.get(),
|
|
1753
|
+
getManagementClient: () => management.get(),
|
|
1754
|
+
getProjectClients: () => {
|
|
1755
|
+
const state = build.store.get();
|
|
1756
|
+
return state.state === "ready" ? state.value : null;
|
|
1757
|
+
}
|
|
1758
|
+
}),
|
|
1759
|
+
session
|
|
1760
|
+
};
|
|
1811
1761
|
};
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
Object.defineProperty(exports, "createQueryServiceSdk", {
|
|
1818
|
-
enumerable: true,
|
|
1819
|
-
get: function () { return chunkJWISA775_cjs.createQueryServiceSdk; }
|
|
1820
|
-
});
|
|
1821
|
-
Object.defineProperty(exports, "PollException", {
|
|
1822
|
-
enumerable: true,
|
|
1823
|
-
get: function () { return chunkS46FMY4G_cjs.PollException; }
|
|
1824
|
-
});
|
|
1825
|
-
Object.defineProperty(exports, "delay", {
|
|
1826
|
-
enumerable: true,
|
|
1827
|
-
get: function () { return chunkS46FMY4G_cjs.delay; }
|
|
1828
|
-
});
|
|
1829
|
-
Object.defineProperty(exports, "poll", {
|
|
1830
|
-
enumerable: true,
|
|
1831
|
-
get: function () { return chunkS46FMY4G_cjs.poll; }
|
|
1832
|
-
});
|
|
1833
|
-
Object.defineProperty(exports, "isEmptyDeep", {
|
|
1834
|
-
enumerable: true,
|
|
1835
|
-
get: function () { return chunkCHRBWCL7_cjs.isEmptyDeep; }
|
|
1836
|
-
});
|
|
1837
|
-
Object.defineProperty(exports, "schemaGuidedMerge", {
|
|
1838
|
-
enumerable: true,
|
|
1839
|
-
get: function () { return chunkCHRBWCL7_cjs.schemaGuidedMerge; }
|
|
1840
|
-
});
|
|
1841
|
-
Object.defineProperty(exports, "keboolaUID", {
|
|
1842
|
-
enumerable: true,
|
|
1843
|
-
get: function () { return chunkSZBW4EE2_cjs.keboolaUID; }
|
|
1844
|
-
});
|
|
1845
|
-
Object.defineProperty(exports, "generateUUID", {
|
|
1846
|
-
enumerable: true,
|
|
1847
|
-
get: function () { return chunkEWMXK3EI_cjs.generateUUID; }
|
|
1848
|
-
});
|
|
1849
|
-
Object.defineProperty(exports, "collect", {
|
|
1850
|
-
enumerable: true,
|
|
1851
|
-
get: function () { return chunkJI7HLIDL_cjs.collect; }
|
|
1852
|
-
});
|
|
1853
|
-
Object.defineProperty(exports, "ServiceUnavailableError", {
|
|
1854
|
-
enumerable: true,
|
|
1855
|
-
get: function () { return chunk5SR2L35Y_cjs.ServiceUnavailableError; }
|
|
1856
|
-
});
|
|
1857
|
-
Object.defineProperty(exports, "series", {
|
|
1858
|
-
enumerable: true,
|
|
1859
|
-
get: function () { return chunk5SR2L35Y_cjs.series; }
|
|
1860
|
-
});
|
|
1861
|
-
Object.defineProperty(exports, "QueryJobError", {
|
|
1862
|
-
enumerable: true,
|
|
1863
|
-
get: function () { return chunkKQENBXPS_cjs.QueryJobError; }
|
|
1864
|
-
});
|
|
1865
|
-
Object.defineProperty(exports, "QueryJobTimeoutError", {
|
|
1866
|
-
enumerable: true,
|
|
1867
|
-
get: function () { return chunkKQENBXPS_cjs.QueryJobTimeoutError; }
|
|
1868
|
-
});
|
|
1869
|
-
Object.defineProperty(exports, "isQueryJobError", {
|
|
1870
|
-
enumerable: true,
|
|
1871
|
-
get: function () { return chunkKQENBXPS_cjs.isQueryJobError; }
|
|
1872
|
-
});
|
|
1873
|
-
Object.defineProperty(exports, "isQueryJobTimeoutError", {
|
|
1874
|
-
enumerable: true,
|
|
1875
|
-
get: function () { return chunkKQENBXPS_cjs.isQueryJobTimeoutError; }
|
|
1876
|
-
});
|
|
1877
|
-
Object.defineProperty(exports, "SyncActionError", {
|
|
1878
|
-
enumerable: true,
|
|
1879
|
-
get: function () { return chunkN4COL54U_cjs.SyncActionError; }
|
|
1880
|
-
});
|
|
1881
|
-
Object.defineProperty(exports, "isSyncActionError", {
|
|
1882
|
-
enumerable: true,
|
|
1883
|
-
get: function () { return chunkN4COL54U_cjs.isSyncActionError; }
|
|
1884
|
-
});
|
|
1885
|
-
Object.defineProperty(exports, "ValidationError", {
|
|
1886
|
-
enumerable: true,
|
|
1887
|
-
get: function () { return chunkNH2TQGRL_cjs.ValidationError; }
|
|
1888
|
-
});
|
|
1889
|
-
Object.defineProperty(exports, "isValidationError", {
|
|
1890
|
-
enumerable: true,
|
|
1891
|
-
get: function () { return chunkNH2TQGRL_cjs.isValidationError; }
|
|
1892
|
-
});
|
|
1893
|
-
Object.defineProperty(exports, "parseOrThrow", {
|
|
1894
|
-
enumerable: true,
|
|
1895
|
-
get: function () { return chunkNH2TQGRL_cjs.parseOrThrow; }
|
|
1896
|
-
});
|
|
1897
|
-
Object.defineProperty(exports, "UserError", {
|
|
1898
|
-
enumerable: true,
|
|
1899
|
-
get: function () { return chunkRRC5RKF7_cjs.UserError; }
|
|
1900
|
-
});
|
|
1901
|
-
Object.defineProperty(exports, "dedupe", {
|
|
1902
|
-
enumerable: true,
|
|
1903
|
-
get: function () { return chunk6PVEHUJL_cjs.dedupe; }
|
|
1904
|
-
});
|
|
1905
|
-
Object.defineProperty(exports, "isManagementClientAuthError", {
|
|
1906
|
-
enumerable: true,
|
|
1907
|
-
get: function () { return chunk6PVEHUJL_cjs.isManagementClientAuthError; }
|
|
1908
|
-
});
|
|
1909
|
-
Object.defineProperty(exports, "ManagementClientAuthError", {
|
|
1910
|
-
enumerable: true,
|
|
1911
|
-
get: function () { return chunkES3ADC2G_cjs.ManagementClientAuthError; }
|
|
1912
|
-
});
|
|
1913
|
-
Object.defineProperty(exports, "concurrent", {
|
|
1914
|
-
enumerable: true,
|
|
1915
|
-
get: function () { return chunkV6FT3RTU_cjs.concurrent; }
|
|
1916
|
-
});
|
|
1917
|
-
Object.defineProperty(exports, "parseLogLines", {
|
|
1918
|
-
enumerable: true,
|
|
1919
|
-
get: function () { return chunkBVRPZKRE_cjs.parseLogLines; }
|
|
1920
|
-
});
|
|
1921
|
-
Object.defineProperty(exports, "isPlainObject", {
|
|
1922
|
-
enumerable: true,
|
|
1923
|
-
get: function () { return chunkMRHQJNWF_cjs.isPlainObject; }
|
|
1924
|
-
});
|
|
1925
|
-
Object.defineProperty(exports, "ApiError", {
|
|
1926
|
-
enumerable: true,
|
|
1927
|
-
get: function () { return chunkHUQ5ATIL_cjs.ApiError; }
|
|
1928
|
-
});
|
|
1929
|
-
Object.defineProperty(exports, "HttpContentType", {
|
|
1930
|
-
enumerable: true,
|
|
1931
|
-
get: function () { return chunkHUQ5ATIL_cjs.HttpContentType; }
|
|
1932
|
-
});
|
|
1933
|
-
Object.defineProperty(exports, "HttpHeader", {
|
|
1934
|
-
enumerable: true,
|
|
1935
|
-
get: function () { return chunkHUQ5ATIL_cjs.HttpHeader; }
|
|
1936
|
-
});
|
|
1937
|
-
Object.defineProperty(exports, "KeboolaHttpHeader", {
|
|
1938
|
-
enumerable: true,
|
|
1939
|
-
get: function () { return chunkHUQ5ATIL_cjs.KeboolaHttpHeader; }
|
|
1940
|
-
});
|
|
1941
|
-
Object.defineProperty(exports, "createGenericFetchClient", {
|
|
1942
|
-
enumerable: true,
|
|
1943
|
-
get: function () { return chunkHUQ5ATIL_cjs.createGenericFetchClient; }
|
|
1944
|
-
});
|
|
1945
|
-
Object.defineProperty(exports, "isAbortError", {
|
|
1946
|
-
enumerable: true,
|
|
1947
|
-
get: function () { return chunkHUQ5ATIL_cjs.isAbortError; }
|
|
1948
|
-
});
|
|
1949
|
-
Object.defineProperty(exports, "isApiError", {
|
|
1950
|
-
enumerable: true,
|
|
1951
|
-
get: function () { return chunkHUQ5ATIL_cjs.isApiError; }
|
|
1952
|
-
});
|
|
1953
|
-
Object.defineProperty(exports, "isFetchClientError", {
|
|
1954
|
-
enumerable: true,
|
|
1955
|
-
get: function () { return chunkHUQ5ATIL_cjs.isFetchClientError; }
|
|
1956
|
-
});
|
|
1762
|
+
//#endregion
|
|
1763
|
+
exports.ApiError = require_createFetchClient.ApiError;
|
|
1764
|
+
exports.HtmlResponseError = require_validateConnectionStatus.HtmlResponseError;
|
|
1765
|
+
exports.HttpContentType = require_createFetchClient.HttpContentType;
|
|
1766
|
+
exports.HttpHeader = require_createFetchClient.HttpHeader;
|
|
1957
1767
|
exports.KeboolaError = KeboolaError;
|
|
1958
1768
|
exports.KeboolaErrorType = KeboolaErrorType;
|
|
1769
|
+
exports.KeboolaHttpHeader = require_createFetchClient.KeboolaHttpHeader;
|
|
1770
|
+
exports.ManagementClientAuthError = require_ManagementClientAuthError.ManagementClientAuthError;
|
|
1771
|
+
exports.QueryJobError = require_QueryJobTimeoutError.QueryJobError;
|
|
1772
|
+
exports.QueryJobTimeoutError = require_QueryJobTimeoutError.QueryJobTimeoutError;
|
|
1773
|
+
exports.Result = require_jobStatus.Result;
|
|
1774
|
+
exports.ServiceUnavailableError = require_storage.ServiceUnavailableError;
|
|
1775
|
+
exports.SyncActionError = require_SyncActionError.SyncActionError;
|
|
1776
|
+
exports.UserError = require_UserError.UserError;
|
|
1777
|
+
exports.ValidationError = require_ValidationError.ValidationError;
|
|
1778
|
+
exports.asError = require_jobStatus.asError;
|
|
1959
1779
|
exports.assert = assert;
|
|
1960
1780
|
exports.coalesce = coalesce;
|
|
1961
|
-
exports.
|
|
1962
|
-
exports.
|
|
1781
|
+
exports.collect = require_queue.collect;
|
|
1782
|
+
exports.concurrent = require_concurrent.concurrent;
|
|
1783
|
+
exports.createDerivedAsyncStore = require_createStore.createDerivedAsyncStore;
|
|
1784
|
+
exports.createDerivedStore = require_createStore.createDerivedStore;
|
|
1785
|
+
exports.createEmitter = require_createStore.createEmitter;
|
|
1786
|
+
exports.createGenericFetchClient = require_createGenericFetchClient.createGenericFetchClient;
|
|
1963
1787
|
exports.createKeboola = createKeboola;
|
|
1964
1788
|
exports.createLegacyKeboola = createLegacyKeboola;
|
|
1965
1789
|
exports.createLocalStorage = createLocalStorage;
|
|
@@ -1967,13 +1791,40 @@ exports.createLoggingMiddleware = createLoggingMiddleware;
|
|
|
1967
1791
|
exports.createMemoryStorage = createMemoryStorage;
|
|
1968
1792
|
exports.createNullStorage = createNullStorage;
|
|
1969
1793
|
exports.createPersistor = createPersistor;
|
|
1794
|
+
exports.createPollRegistry = createPollRegistry;
|
|
1795
|
+
exports.createQueryServiceSdk = require_sdk_queryService_index.createQueryServiceSdk;
|
|
1970
1796
|
exports.createRetryMiddleware = createRetryMiddleware;
|
|
1971
1797
|
exports.createSessionStorage = createSessionStorage;
|
|
1972
|
-
exports.
|
|
1798
|
+
exports.createStorageSdk = require_sdk_storage_index.createStorageSdk;
|
|
1799
|
+
exports.createStore = require_createStore.createStore;
|
|
1800
|
+
exports.dedupe = require_dedupe.dedupe;
|
|
1973
1801
|
exports.deepMerge = deepMerge;
|
|
1802
|
+
exports.delay = require_jobStatus.delay;
|
|
1803
|
+
exports.emitter = require_jobStatus.emitter;
|
|
1804
|
+
exports.failureOf = require_jobStatus.failureOf;
|
|
1805
|
+
exports.generateUUID = require_generateUUID.generateUUID;
|
|
1806
|
+
exports.isAbortError = require_createFetchClient.isAbortError;
|
|
1807
|
+
exports.isApiError = require_createFetchClient.isApiError;
|
|
1808
|
+
exports.isEmptyDeep = require_configurations.isEmptyDeep;
|
|
1809
|
+
exports.isFetchClientError = require_createFetchClient.isFetchClientError;
|
|
1810
|
+
exports.isHtmlResponseError = require_validateConnectionStatus.isHtmlResponseError;
|
|
1974
1811
|
exports.isKeboolaError = isKeboolaError;
|
|
1812
|
+
exports.isManagementClientAuthError = require_management.isManagementClientAuthError;
|
|
1813
|
+
exports.isPlainObject = require_isPlainObject.isPlainObject;
|
|
1814
|
+
exports.isQueryJobError = require_QueryJobTimeoutError.isQueryJobError;
|
|
1815
|
+
exports.isQueryJobTimeoutError = require_QueryJobTimeoutError.isQueryJobTimeoutError;
|
|
1975
1816
|
exports.isStorageTokenMutatingRequest = isStorageTokenMutatingRequest;
|
|
1976
|
-
exports.
|
|
1977
|
-
exports.
|
|
1978
|
-
|
|
1817
|
+
exports.isSyncActionError = require_SyncActionError.isSyncActionError;
|
|
1818
|
+
exports.isValidationError = require_ValidationError.isValidationError;
|
|
1819
|
+
exports.jobStatus = require_jobStatus.jobStatus;
|
|
1820
|
+
exports.keboolaUID = require_tag.keboolaUID;
|
|
1821
|
+
exports.lazy = require_jobStatus.lazy;
|
|
1822
|
+
exports.parseLogLines = require_appLogs.parseLogLines;
|
|
1823
|
+
exports.parseOrThrow = require_ValidationError.parseOrThrow;
|
|
1824
|
+
exports.poll = require_jobStatus.poll;
|
|
1825
|
+
exports.poller = require_jobStatus.poller;
|
|
1826
|
+
exports.schemaGuidedMerge = require_configurations.schemaGuidedMerge;
|
|
1827
|
+
exports.series = require_storage.series;
|
|
1828
|
+
exports.shallowEqual = require_createStore.shallowEqual;
|
|
1829
|
+
|
|
1979
1830
|
//# sourceMappingURL=index.cjs.map
|