@keboola/api-client 27.0.0 → 29.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 +8 -1
- package/README.md +53 -18
- package/dist/ManagementClientAuthError-B97OtOQ7.js +15 -0
- package/dist/ManagementClientAuthError-B97OtOQ7.js.map +1 -0
- package/dist/ManagementClientAuthError-ZJ2-RoKT.cjs +20 -0
- package/dist/ManagementClientAuthError-ZJ2-RoKT.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-CNG3yby-.cjs +153 -0
- package/dist/appLogs-CNG3yby-.cjs.map +1 -0
- package/dist/appLogs-Dl5BcCSD.d.cts +10 -0
- package/dist/appLogs-VdgP08aX.d.ts +10 -0
- package/dist/appLogs-enL9XR9r.js +132 -0
- package/dist/appLogs-enL9XR9r.js.map +1 -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 +14 -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-5HCvCsZO.cjs +18 -0
- package/dist/auth-5HCvCsZO.cjs.map +1 -0
- package/dist/auth-D2jfNlpX.js +13 -0
- package/dist/{chunk-5A3AQIXR.js.map → auth-D2jfNlpX.js.map} +1 -1
- package/dist/authClient-Bgj2Ay7h.d.cts +320 -0
- package/dist/authClient-DOk6VKdV.js +332 -0
- package/dist/authClient-DOk6VKdV.js.map +1 -0
- package/dist/authClient-Dsd7W99W.d.ts +320 -0
- package/dist/authClient-Z8Eg8rlN.cjs +405 -0
- package/dist/authClient-Z8Eg8rlN.cjs.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 +10 -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-CqyyBkXW.cjs +197 -0
- package/dist/constants-CqyyBkXW.cjs.map +1 -0
- package/dist/constants-_HhqKvBg.js +174 -0
- package/dist/constants-_HhqKvBg.js.map +1 -0
- package/dist/createFetchClient-BK0TZK-U.js +184 -0
- package/dist/createFetchClient-BK0TZK-U.js.map +1 -0
- package/dist/createFetchClient-BsG719K1.cjs +263 -0
- package/dist/createFetchClient-BsG719K1.cjs.map +1 -0
- package/dist/createGenericFetchClient-CVZYekDk.js +7 -0
- package/dist/createGenericFetchClient-CVZYekDk.js.map +1 -0
- package/dist/createGenericFetchClient-DLbjX0eM.cjs +12 -0
- package/dist/createGenericFetchClient-DLbjX0eM.cjs.map +1 -0
- package/dist/createOpenapiFetchClient-B5U1fCHS.js +7 -0
- package/dist/createOpenapiFetchClient-B5U1fCHS.js.map +1 -0
- package/dist/createOpenapiFetchClient-Cr90VXY4.cjs +12 -0
- package/dist/createOpenapiFetchClient-Cr90VXY4.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-0c6yFwtp.cjs +44 -0
- package/dist/credential-0c6yFwtp.cjs.map +1 -0
- package/dist/credential-kEGLnVez.js +33 -0
- package/dist/credential-kEGLnVez.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-C-JrA0Uk.cjs +114 -0
- package/dist/dataScience-C-JrA0Uk.cjs.map +1 -0
- package/dist/dataScience-CE0pSWbl.js +109 -0
- package/dist/dataScience-CE0pSWbl.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-BPPEAdJW.js +485 -0
- package/dist/developerPortalClient-BPPEAdJW.js.map +1 -0
- package/dist/developerPortalClient-C8oq48xW.cjs +508 -0
- package/dist/developerPortalClient-C8oq48xW.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-Cf0W-7YD.js +116 -0
- package/dist/import-Cf0W-7YD.js.map +1 -0
- package/dist/import-KLH1uRtx.cjs +121 -0
- package/dist/import-KLH1uRtx.cjs.map +1 -0
- package/dist/index-8pN6Emos.d.ts +218 -0
- package/dist/index-BEKaJ7Cc.d.cts +1388 -0
- package/dist/index-BMqLPS6S.d.cts +135 -0
- package/dist/index-BMqLPS6S.d.ts +135 -0
- package/dist/index-BWBScAYc.d.cts +16 -0
- package/dist/index-BmjeNd9u.d.ts +1075 -0
- package/dist/index-BthgbVdd.d.ts +31 -0
- package/dist/index-CLPrlyIz.d.cts +218 -0
- package/dist/index-CXQRvZ-f.d.cts +31 -0
- package/dist/index-CeistZnj.d.ts +1388 -0
- package/dist/index-Cfrl7sd5.d.ts +65 -0
- package/dist/index-DIM8KZly.d.ts +16 -0
- package/dist/index-DNlX-H1V.d.ts +208 -0
- package/dist/index-DVsnxZap.d.cts +65 -0
- package/dist/index-DXi6wsr5.d.cts +77 -0
- package/dist/index-DYQt4zxC.d.ts +77 -0
- package/dist/index-DplMbm9E.d.cts +19882 -0
- package/dist/index-Dwp8tF6O.d.ts +19882 -0
- package/dist/index-IN0qzs52.d.cts +208 -0
- package/dist/index-KKJkrxjx.d.ts +26 -0
- package/dist/index-NC1dXRTD.d.cts +40 -0
- package/dist/index-NC1dXRTD.d.ts +40 -0
- package/dist/index-WQkVzx5e.d.cts +1075 -0
- package/dist/index-eEBVG5s3.d.cts +26 -0
- package/dist/index-vb9Rfqca.d.cts +115 -0
- package/dist/index-vb9Rfqca.d.ts +115 -0
- package/dist/index.cjs +1726 -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 +1676 -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-DqwQcDCx.js +1065 -0
- package/dist/management-DqwQcDCx.js.map +1 -0
- package/dist/management-WOmlBt6H.cjs +1076 -0
- package/dist/management-WOmlBt6H.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-CNEhL66f.js +134 -0
- package/dist/metastore-CNEhL66f.js.map +1 -0
- package/dist/metastore-CkQluyX1.cjs +139 -0
- package/dist/metastore-CkQluyX1.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-DTvrqe6P.cjs +88 -0
- package/dist/oauth-DTvrqe6P.cjs.map +1 -0
- package/dist/oauth-DYDObUX9.js +83 -0
- package/dist/oauth-DYDObUX9.js.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-BvFi19K_.cjs +56 -0
- package/dist/project-BvFi19K_.cjs.map +1 -0
- package/dist/project-CcGxXIW_.d.cts +18 -0
- package/dist/project-DWwZv66D.js +39 -0
- package/dist/project-DWwZv66D.js.map +1 -0
- package/dist/project-io1pY-hW.d.ts +18 -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-BHV_OZI2.js +114 -0
- package/dist/queryService-BHV_OZI2.js.map +1 -0
- package/dist/queryService-CvqDqigW.cjs +119 -0
- package/dist/queryService-CvqDqigW.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-CUHKupTA.cjs +137 -0
- package/dist/queue-CUHKupTA.cjs.map +1 -0
- package/dist/queue-uofE4Eu6.js +126 -0
- package/dist/queue-uofE4Eu6.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 +27 -92
- package/dist/storage/index.d.cts +3 -24
- package/dist/storage/index.d.ts +3 -24
- package/dist/storage/index.js +8 -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-DbyNnkIJ.cjs +2458 -0
- package/dist/storage-DbyNnkIJ.cjs.map +1 -0
- package/dist/storage-luq7YBZF.js +2429 -0
- package/dist/storage-luq7YBZF.js.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-DKWeJ8GH.cjs +504 -0
- package/dist/syncActions-DKWeJ8GH.cjs.map +1 -0
- package/dist/syncActions-ssWWVN_4.js +497 -0
- package/dist/syncActions-ssWWVN_4.js.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-2IrE8HaZ.cjs +29 -0
- package/dist/telemetry-2IrE8HaZ.cjs.map +1 -0
- package/dist/telemetry-yQfQxBBI.js +24 -0
- package/dist/telemetry-yQfQxBBI.js.map +1 -0
- package/dist/types--T-vBqdd.d.cts +2835 -0
- package/dist/{types-Cffam0Nw.d.ts → types-2mHlPakp.d.cts} +84 -80
- package/dist/types-7H6Dnz0Y.d.ts +23 -0
- package/dist/{types-BcaALDYY.d.cts → types-B06L4-WE.d.cts} +9 -15
- package/dist/types-B1S2H7q1.d.ts +373 -0
- package/dist/types-B1glyy_Q.d.ts +726 -0
- package/dist/types-BCt0EMiO.d.ts +2162 -0
- package/dist/{types-Y1ynT2PH.d.cts → types-BD6czYPH.d.ts} +29 -106
- package/dist/{types-CwAYn1EJ.d.cts → types-BO-mTxKb.d.cts} +48 -80
- package/dist/{types-nt7I4XNc.d.cts → types-BREBK0xX.d.ts} +7 -6
- package/dist/types-BRQAKEC1.d.cts +32 -0
- package/dist/types-BXK6Ebtm.d.ts +32 -0
- package/dist/types-BefwoXik.d.cts +373 -0
- package/dist/{types-BuEkMmKT.d.ts → types-BhBvnvqe.d.ts} +219 -234
- package/dist/{types-qvle4Ydu.d.cts → types-BmFyDKe6.d.ts} +84 -80
- package/dist/types-BpWqpMkL.d.ts +66 -0
- package/dist/types-C8XiTXxi.d.cts +23 -0
- package/dist/{types-DrGnvgkB.d.ts → types-CAOvDtMC.d.cts} +9 -14
- package/dist/types-CC0wymfG.d.ts +2088 -0
- package/dist/{types-Bom93Zx2.d.cts → types-CI1mW2lA.d.ts} +9 -14
- package/dist/{types-EZBBpiFU.d.ts → types-CRYtdj5w.d.ts} +238 -349
- package/dist/{types-CniF_D1P.d.cts → types-CSmttcZ_.d.ts} +8 -10
- package/dist/{types-CxAH36ip.d.cts → types-CbZ8aMKW.d.cts} +9 -12
- package/dist/{types-D2qGShlS.d.ts → types-CexuN7Mw.d.cts} +29 -106
- package/dist/types-CjAia48k.d.ts +386 -0
- package/dist/{types-ebolWqn1.d.ts → types-CtdyAkzI.d.cts} +27 -16
- package/dist/{types-COti0FGo.d.ts → types-CvADp-x-.d.ts} +9 -12
- package/dist/types-CwvOcTOm.d.cts +2088 -0
- package/dist/types-CyRK5z-E.d.cts +386 -0
- package/dist/{types-BALUbGA5.d.ts → types-D2n3h1gp.d.ts} +48 -80
- package/dist/types-DBOEA7l0.d.cts +148 -0
- package/dist/{types-DM1glEQI.d.ts → types-DCBKso0t.d.cts} +8 -10
- package/dist/{types-DNyZ0z3L.d.cts → types-DEKF5pbg.d.cts} +219 -234
- package/dist/{types-D6dnnju2.d.ts → types-DMvU4kZ2.d.cts} +32 -30
- package/dist/{types-BPKQRahf.d.cts → types-DS8uFAeq.d.cts} +8 -13
- package/dist/{types-DOc5_aYZ.d.ts → types-DeApSCzx.d.cts} +16 -21
- package/dist/types-DebL68-g.d.ts +148 -0
- package/dist/types-DgaYUtu_.d.cts +726 -0
- package/dist/{types-CfzHhZVG.d.ts → types-DkbfBOBr.d.cts} +7 -6
- package/dist/types-DvsGS8By.d.cts +66 -0
- package/dist/{types-Dpwb4dD0.d.ts → types-DwX1uxp_.d.ts} +8 -13
- package/dist/{types-cxk-0ftN.d.cts → types-ISUNM_BR.d.cts} +238 -349
- package/dist/types-QOIQ-dZU.d.cts +2162 -0
- package/dist/{types-BsejtGjZ.d.ts → types-SGuvOEV8.d.ts} +9 -15
- package/dist/types-V8rC5if7.d.cts +621 -0
- package/dist/{types-BCBF_5cU.d.cts → types-Z-vUwgym.d.ts} +32 -30
- package/dist/{types-Bp8d9PJf.d.cts → types-bws2RtKq.d.ts} +16 -21
- package/dist/types-h9TTimS_.d.ts +2835 -0
- package/dist/types-lFsTSkhe.d.cts +14 -0
- package/dist/types-lFsTSkhe.d.ts +14 -0
- package/dist/types-n4FFKqa4.d.ts +621 -0
- package/dist/{types-CFeOCzzg.d.cts → types-x4xPlrr0.d.ts} +27 -16
- 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 +43 -5
- package/surface/apps.md +2 -2
- package/surface/chat.md +2 -2
- package/surface/dataScience.md +2 -2
- package/surface/kaiAgent.md +1 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFetchClient-BsG719K1.cjs","names":[],"sources":["../src/errors/ApiError.ts","../src/internal.ts","../src/fetchClient/createFetchClient/utils.ts","../src/fetchClient/createFetchClient/createFetchClient.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nexport class ApiError extends Error {\n response: Response;\n request: Request;\n data: unknown;\n\n constructor({ response, request, data }: ApiResponse) {\n super(response.statusText);\n this.response = response;\n this.request = request;\n this.data = data;\n }\n}\n","// Package-internal constants. Not part of the public\n// `@keboola/api-client/constants` sub-path (that is the `constants/` directory).\n\nexport const KeboolaHttpHeader = {\n STORAGE_API_TOKEN: 'X-StorageApi-Token',\n MANAGEMENT_API_TOKEN: 'X-Kbc-Manageapitoken',\n STORAGE_API_URL: 'x-storageapi-url',\n PROJECT_ID: 'X-KBC-ProjectId',\n /** Storage job a request enqueued, reported on the response rather than in its body. */\n STORAGE_API_JOB_ID: 'X-StorageApi-Job-Id',\n} as const;\n\nexport const HttpStatus = {\n NO_CONTENT: 204,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n UNPROCESSABLE_ENTITY: 422,\n INTERNAL_SERVER_ERROR: 500,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n} as const;\n\nexport const ENCRYPTED_VALUE_PREFIX = 'KBC::';\n","import type { IStringifyOptions } from 'qs';\nimport qs from 'qs';\n\nimport { HttpStatus } from '../../internal';\n\nimport type { BodyParam, CreateFetchRequestFn, PathParam, ValidateStatusFn } from './types';\n\n/**\n * Strips trailing slashes from a base URL so concatenating a leading-slash\n * path (e.g. `/v2/storage`) never produces a double slash.\n *\n * Without this, callers that pass `https://connection.keboola.com/` end up\n * issuing requests to `https://connection.keboola.com//v2/storage/...`, which\n * the Storage API rejects with a 404.\n */\nexport const normalizeBaseUrl = (baseUrl: string): string => baseUrl.replace(/\\/+$/, '');\n\nexport const HttpHeader = {\n CONTENT_TYPE: 'content-type',\n CONTENT_DISPOSITION: 'content-disposition',\n AUTHORIZATION: 'Authorization',\n IDEMPOTENCY_KEY: 'Idempotency-Key',\n IF_MATCH: 'If-Match',\n};\n\nexport const HttpContentType = {\n JSON: 'application/json',\n TEXT_PLAIN: 'text/plain',\n FORM_DATA: 'multipart/form-data',\n TEXT_HTML: 'text/html',\n};\n\nexport const defaultValidateStatus: ValidateStatusFn = ({ response }) =>\n response.status >= 200 && response.status <= 299;\n\nfunction removeUndefined(obj: Record<string, string>) {\n const objCopy = { ...obj };\n for (const [key, value] of Object.entries(objCopy)) {\n if (value == null) delete objCopy[key];\n }\n return objCopy;\n}\n\n// `application/json`, but also `application/json; charset=utf-8` and the `+json` suffix family.\n// Comparing the raw header for equality misses every response that carries a charset.\nconst JSON_MEDIA_TYPE = /^application\\/([\\w.-]+\\+)?json$/;\n\nconst getMediaType = (response: Response) =>\n response.headers.get(HttpHeader.CONTENT_TYPE)?.split(';')[0]?.trim().toLowerCase() ?? '';\n\nexport const parseData = async (response: Response) => {\n if (response.status === HttpStatus.NO_CONTENT) return null;\n\n const mediaType = getMediaType(response);\n\n // Declared JSON is parsed strictly: a body that doesn't parse is a broken response, not a text\n // payload, and `JSON.parse` throwing is the right answer. Read it as text first only so an empty\n // body can resolve to `null` like a 204 — matching the charset form brings `application/json;\n // charset=utf-8` onto this path, where `response.json()` would turn a 200-with-no-body into a\n // `SyntaxError` it never used to be.\n if (JSON_MEDIA_TYPE.test(mediaType)) {\n const text = await response.text();\n\n return text.trim() === '' ? null : JSON.parse(text);\n }\n\n // Any other declared type describes its own payload — the query-service CSV export, the\n // data-science `text/plain` endpoints — so hand back the exact bytes instead of sniffing them.\n return response.text();\n};\n\n// Header instance serialize undefined value as `undefined`, we do not want that\nconst cleanHeadersInit = (headersInit: HeadersInit | undefined) => {\n if (Array.isArray(headersInit)) return headersInit;\n if (headersInit instanceof Headers) return headersInit;\n if (headersInit == null) return headersInit;\n\n return removeUndefined(headersInit);\n};\n\nconst createHeaders = (\n headersInitA: HeadersInit | undefined,\n headersInitB: HeadersInit | undefined,\n) => {\n const headersA = new Headers(cleanHeadersInit(headersInitA));\n const headersB = new Headers(cleanHeadersInit(headersInitB));\n\n headersB.forEach((value, key) => {\n headersA.set(key, value);\n });\n\n return headersA;\n};\n\nexport const createPath = (path: string, pathParam: PathParam = {}) =>\n path.replace(/\\{([^}]+)}/g, (_, key) => {\n if (!(key in pathParam))\n throw new Error(`Path parameter \"${key}\" is missing in the path \"${path}\"`);\n\n return encodeURIComponent(pathParam[key]!);\n });\n\nexport const createSearch = (\n query: Record<string, unknown>,\n options: Pick<IStringifyOptions, 'arrayFormat'> = {},\n) => {\n return qs.stringify(query, {\n encodeValuesOnly: true,\n skipNulls: true,\n ...options,\n });\n};\n\nexport const createBody = (body: BodyParam, headers: Headers) => {\n if (body == null) return null;\n if (body instanceof FormData) return body; // fetch automatically sets content-type header\n if (typeof body === 'string') return body; // fetch automatically sets content-type header\n\n const stringifyBody = JSON.stringify(body);\n const stringBody = stringifyBody === '{}' ? null : stringifyBody;\n if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);\n\n return stringBody;\n};\n\nexport const parseContentDispositionHeader = (contentDisposition?: string | null) => {\n // extract the type ('inline' or 'attachment'), default the type to 'unknown'\n const type = (() => {\n const typeMatch = contentDisposition?.match(/^\\s*(inline|attachment)\\s*;/i);\n return (typeMatch?.[1]?.toLowerCase() ?? 'unknown') as 'inline' | 'attachment' | 'unknown';\n })();\n\n // extract the filename, default the type to null\n const filename = (() => {\n const filenameMatch = contentDisposition?.match(/filename=\"([^\"]+)\"/i);\n if (filenameMatch) return filenameMatch[1];\n\n // If no filename=\"...\", check for encoded filename*=UTF-8''\n const encodedFilenameMatch = contentDisposition?.match(/filename\\*=(?:UTF-8'')?([^;]+)/i);\n if (encodedFilenameMatch?.[1]) return decodeURIComponent(encodedFilenameMatch[1]);\n\n // Check for unquoted filenames (rare but possible)\n const unquotedFilenameMatch = contentDisposition?.match(/filename=([^;]+)/i);\n return unquotedFilenameMatch?.[1] ?? null;\n })();\n\n // Return the parsed result\n return { type, filename };\n};\n\nexport const createFetchRequest: CreateFetchRequestFn = ({\n url,\n method,\n params,\n options = {},\n defaultOptions,\n}) => {\n const {\n baseUrl,\n validateStatus: defValidateStatus = defaultValidateStatus,\n headers: defaultHeaders,\n fetchFn: defaultFetchFn,\n ...restDefaultOptions\n } = defaultOptions;\n const {\n validateStatus,\n queryArrayFormat,\n headers: endpointHeaders,\n fetchFn,\n ...restOptions\n } = options;\n\n const headers = createHeaders(defaultHeaders, endpointHeaders);\n const path = createPath(url, params.path);\n const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });\n const body = createBody(params.body, headers);\n\n const urlInstance = new URL(normalizeBaseUrl(baseUrl) + path);\n urlInstance.search = search;\n\n const request = new Request(urlInstance, {\n ...restDefaultOptions,\n ...restOptions,\n headers,\n method: method.toUpperCase(),\n body,\n });\n\n return {\n request,\n validateStatus: validateStatus ?? defValidateStatus,\n fetchFn: fetchFn ?? defaultFetchFn,\n };\n};\n","import { ApiError } from '../../errors';\n\nimport type {\n BaseFetchParams,\n CoreFetchFn,\n CreateFetchClientOptions,\n FetchClientOptions,\n HttpMethod,\n} from './types';\nimport { createFetchRequest, parseData } from './utils';\n\nexport type FetchClientError = TypeError | ApiError | SyntaxError | DOMException;\n\nexport const isApiError = (error: unknown): error is ApiError => error instanceof ApiError;\n\nexport const isAbortError = (error: unknown): error is DOMException =>\n error instanceof DOMException && error.name === 'AbortError';\n\nexport const isFetchClientError = (error: unknown): error is FetchClientError =>\n error instanceof TypeError || error instanceof SyntaxError || isApiError(error);\n\n// `fetchFn` is resolved per request by `createFetchRequest` (endpoint option beats client option),\n// so a single request can swap the transport without rebuilding the client.\nconst coreFetch: CoreFetchFn = async ({ request, validateStatus, fetchFn = fetch }) => {\n const response = await fetchFn(request);\n const data = await parseData(response);\n\n const apiResponse = {\n request,\n response,\n data,\n };\n\n const boolOrError = validateStatus(apiResponse);\n if (isApiError(boolOrError)) throw boolOrError;\n if (!boolOrError) throw new ApiError(apiResponse);\n\n return apiResponse;\n};\n\nexport const createFetchClient = ({\n middlewares = [],\n ...defaultOptions\n}: CreateFetchClientOptions) => {\n const fetchWithMiddlewares = middlewares.reduceRight(\n (next, middleware) => middleware(next),\n coreFetch,\n );\n\n const createFetchMethod =\n (method: HttpMethod) =>\n async (url: string, params: BaseFetchParams, options: FetchClientOptions = {}) => {\n const request = createFetchRequest({\n url,\n method,\n params,\n defaultOptions,\n options,\n });\n\n const methodMiddlewares = options?.middlewares ?? [];\n\n return methodMiddlewares.reduceRight(\n (next, middleware) => middleware(next),\n fetchWithMiddlewares,\n )(request);\n };\n\n return {\n get: createFetchMethod('get'),\n post: createFetchMethod('post'),\n put: createFetchMethod('put'),\n patch: createFetchMethod('patch'),\n delete: createFetchMethod('delete'),\n };\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { t as createFetchClient } from "./createFetchClient-BK0TZK-U.js";
|
|
2
|
+
//#region src/fetchClient/createGenericFetchClient.ts
|
|
3
|
+
const createGenericFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { createGenericFetchClient as t };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=createGenericFetchClient-CVZYekDk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGenericFetchClient-CVZYekDk.js","names":[],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvC,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
|
|
2
|
+
//#region src/fetchClient/createGenericFetchClient.ts
|
|
3
|
+
const createGenericFetchClient = (defaultOptions) => require_createFetchClient.createFetchClient(defaultOptions);
|
|
4
|
+
//#endregion
|
|
5
|
+
Object.defineProperty(exports, "createGenericFetchClient", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return createGenericFetchClient;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=createGenericFetchClient-DLbjX0eM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGenericFetchClient-DLbjX0eM.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvCA,0BAAAA,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { t as createFetchClient } from "./createFetchClient-BK0TZK-U.js";
|
|
2
|
+
//#region src/fetchClient/createOpenapiFetchClient.ts
|
|
3
|
+
const createOpenapiFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { createOpenapiFetchClient as t };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=createOpenapiFetchClient-B5U1fCHS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOpenapiFetchClient-B5U1fCHS.js","names":[],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACG,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
|
|
2
|
+
//#region src/fetchClient/createOpenapiFetchClient.ts
|
|
3
|
+
const createOpenapiFetchClient = (defaultOptions) => require_createFetchClient.createFetchClient(defaultOptions);
|
|
4
|
+
//#endregion
|
|
5
|
+
Object.defineProperty(exports, "createOpenapiFetchClient", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return createOpenapiFetchClient;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=createOpenapiFetchClient-Cr90VXY4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOpenapiFetchClient-Cr90VXY4.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACGA,0BAAAA,kBAAkB,cAAc"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
//#region src/utils/createStore.ts
|
|
2
|
+
/**
|
|
3
|
+
* An occurrence, announced to whoever is listening.
|
|
4
|
+
*
|
|
5
|
+
* - For what happened rather than what is: nothing is held, so a listener that arrives later hears
|
|
6
|
+
* the next event and never the last one. A store is this plus a value it keeps.
|
|
7
|
+
* - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the
|
|
8
|
+
* emitting code must not be left waiting.
|
|
9
|
+
* - A listener that throws is logged and stepped over. Emitting happens on someone else's call
|
|
10
|
+
* stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's
|
|
11
|
+
* failure must not become theirs.
|
|
12
|
+
*/
|
|
13
|
+
const createEmitter = () => {
|
|
14
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
15
|
+
return {
|
|
16
|
+
emit: (event) => listeners.forEach((listener) => {
|
|
17
|
+
try {
|
|
18
|
+
listener(event);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error("A subscriber threw while handling an event", error);
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
subscribe: (listener) => {
|
|
24
|
+
listeners.add(listener);
|
|
25
|
+
return () => {
|
|
26
|
+
listeners.delete(listener);
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
clear: () => listeners.clear()
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** A value that is kept, and announced when it changes: an emitter with the value in front of it. */
|
|
33
|
+
const createStore = (initial) => {
|
|
34
|
+
const changes = createEmitter();
|
|
35
|
+
let value = initial;
|
|
36
|
+
return {
|
|
37
|
+
get: () => value,
|
|
38
|
+
set: (next) => {
|
|
39
|
+
if (Object.is(next, value)) return;
|
|
40
|
+
value = next;
|
|
41
|
+
changes.emit(value);
|
|
42
|
+
},
|
|
43
|
+
subscribe: changes.subscribe,
|
|
44
|
+
dispose: () => {
|
|
45
|
+
value = initial;
|
|
46
|
+
changes.clear();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const isPlainObjectOrArray = (value) => {
|
|
51
|
+
if (Array.isArray(value)) return true;
|
|
52
|
+
const proto = Object.getPrototypeOf(value);
|
|
53
|
+
return proto === Object.prototype || proto === null;
|
|
54
|
+
};
|
|
55
|
+
const shallowEqual = (a, b) => {
|
|
56
|
+
if (Object.is(a, b)) return true;
|
|
57
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
|
|
58
|
+
if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;
|
|
59
|
+
const aKeys = Object.keys(a);
|
|
60
|
+
const bKeys = Object.keys(b);
|
|
61
|
+
return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));
|
|
62
|
+
};
|
|
63
|
+
const createDerivedStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
|
|
64
|
+
let key = dependsOn(source.get());
|
|
65
|
+
const store = createStore(build(key));
|
|
66
|
+
const unsubscribe = source.subscribe((state) => {
|
|
67
|
+
const next = dependsOn(state);
|
|
68
|
+
if (keyEquals(key, next)) return;
|
|
69
|
+
key = next;
|
|
70
|
+
store.set(build(next));
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
get: store.get,
|
|
74
|
+
subscribe: store.subscribe,
|
|
75
|
+
dispose: () => {
|
|
76
|
+
unsubscribe();
|
|
77
|
+
store.dispose();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const createDerivedAsyncStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
|
|
82
|
+
const store = createStore({ state: "idle" });
|
|
83
|
+
let currentKey = null;
|
|
84
|
+
let generation = 0;
|
|
85
|
+
let controller = null;
|
|
86
|
+
const run = (key) => {
|
|
87
|
+
controller?.abort();
|
|
88
|
+
controller = new AbortController();
|
|
89
|
+
const runGeneration = ++generation;
|
|
90
|
+
store.set({ state: "pending" });
|
|
91
|
+
build(key, controller.signal).then((value) => {
|
|
92
|
+
if (runGeneration === generation) store.set({
|
|
93
|
+
state: "ready",
|
|
94
|
+
value
|
|
95
|
+
});
|
|
96
|
+
}, (error) => {
|
|
97
|
+
if (runGeneration === generation) store.set({
|
|
98
|
+
state: "errored",
|
|
99
|
+
error
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
const sync = (state) => {
|
|
104
|
+
const next = dependsOn(state);
|
|
105
|
+
if (next === null) {
|
|
106
|
+
if (currentKey === null) return;
|
|
107
|
+
controller?.abort();
|
|
108
|
+
controller = null;
|
|
109
|
+
generation += 1;
|
|
110
|
+
currentKey = null;
|
|
111
|
+
store.set({ state: "idle" });
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (currentKey !== null && keyEquals(currentKey, next)) return;
|
|
115
|
+
currentKey = next;
|
|
116
|
+
run(next);
|
|
117
|
+
};
|
|
118
|
+
sync(source.get());
|
|
119
|
+
const unsubscribe = source.subscribe(sync);
|
|
120
|
+
const readable = {
|
|
121
|
+
get: store.get,
|
|
122
|
+
subscribe: store.subscribe,
|
|
123
|
+
dispose: () => {
|
|
124
|
+
controller?.abort();
|
|
125
|
+
unsubscribe();
|
|
126
|
+
store.dispose();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const settled = () => new Promise((resolve) => {
|
|
130
|
+
let unsubscribeSettled = () => {};
|
|
131
|
+
const check = (state) => {
|
|
132
|
+
if (state.state === "ready" || state.state === "errored") {
|
|
133
|
+
unsubscribeSettled();
|
|
134
|
+
resolve(state);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
unsubscribeSettled = store.subscribe(check);
|
|
138
|
+
check(store.get());
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
store: readable,
|
|
142
|
+
settled
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
export { shallowEqual as a, createStore as i, createDerivedStore as n, createEmitter as r, createDerivedAsyncStore as t };
|
|
147
|
+
|
|
148
|
+
//# sourceMappingURL=createStore-BNiCRQXa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStore-BNiCRQXa.js","names":[],"sources":["../src/utils/createStore.ts"],"sourcesContent":["type Listener<T> = (value: T) => void;\n\nexport type Emitter<T> = {\n emit: (event: T) => void;\n subscribe: (listener: Listener<T>) => () => void;\n /** Drops every listener. A store's `dispose` is the reason this exists. */\n clear: () => void;\n};\n\n/**\n * An occurrence, announced to whoever is listening.\n *\n * - For what happened rather than what is: nothing is held, so a listener that arrives later hears\n * the next event and never the last one. A store is this plus a value it keeps.\n * - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the\n * emitting code must not be left waiting.\n * - A listener that throws is logged and stepped over. Emitting happens on someone else's call\n * stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's\n * failure must not become theirs.\n */\nexport const createEmitter = <T>(): Emitter<T> => {\n const listeners = new Set<Listener<T>>();\n\n return {\n emit: (event) =>\n listeners.forEach((listener) => {\n try {\n listener(event);\n } catch (error) {\n console.error('A subscriber threw while handling an event', error);\n }\n }),\n subscribe: (listener) => {\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n };\n },\n clear: () => listeners.clear(),\n };\n};\n\nexport type ReadableStore<T> = {\n get: () => T;\n subscribe: (listener: Listener<T>) => () => void;\n dispose: () => void;\n};\n\nexport type Store<T> = ReadableStore<T> & {\n set: (value: T) => void;\n};\n\n/** A value that is kept, and announced when it changes: an emitter with the value in front of it. */\nexport const createStore = <T>(initial: T): Store<T> => {\n const changes = createEmitter<T>();\n let value = initial;\n\n return {\n get: () => value,\n set: (next) => {\n if (Object.is(next, value)) return;\n\n value = next;\n changes.emit(value);\n },\n subscribe: changes.subscribe,\n dispose: () => {\n value = initial;\n changes.clear();\n },\n };\n};\n\nconst isPlainObjectOrArray = (value: object): boolean => {\n if (Array.isArray(value)) return true;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n\nexport const shallowEqual = <T>(a: T, b: T): boolean => {\n if (Object.is(a, b)) return true;\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false;\n if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;\n const aKeys = Object.keys(a) as (keyof T)[];\n const bKeys = Object.keys(b) as (keyof T)[];\n return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));\n};\n\ntype DerivedStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K;\n build: (key: K) => T;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\nexport const createDerivedStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedStoreOptions<S, K, T>): ReadableStore<T> => {\n let key = dependsOn(source.get());\n const store = createStore(build(key));\n\n // The source subscription lives for the derived store's lifetime (both normally live as long as\n // the client). `dispose()` tears down both it and the derived store, so a short-lived derived\n // store can be cleaned up without leaking the source subscription or taking stale updates.\n const unsubscribe = source.subscribe((state) => {\n const next = dependsOn(state);\n if (keyEquals(key, next)) return;\n key = next;\n store.set(build(next));\n });\n\n return {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n unsubscribe();\n store.dispose();\n },\n };\n};\n\nexport type AsyncState<T> =\n | { state: 'idle' }\n | { state: 'pending' }\n | { state: 'ready'; value: T }\n | { state: 'errored'; error: unknown };\n\n// The terminal states `settled()` resolves with.\ntype SettledState<T> = Extract<AsyncState<T>, { state: 'ready' } | { state: 'errored' }>;\n\ntype DerivedAsyncStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K | null;\n build: (key: K, signal: AbortSignal) => Promise<T>;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\n// The async sibling of `createDerivedStore`: it derives a value that arrives later, exposed as an\n// `AsyncState<T>` cell. Two switchMap-style guarantees keep concurrent rebuilds honest:\n// - generation guard: only the latest run may write state, so a stale build resolving after a\n// newer key can never clobber the fresh result;\n// - AbortController: a re-key (or a null key) aborts the previous run's `signal` so in-flight work\n// can actually stop.\n// `dependsOn` returning `null` means \"nothing to build\" → the store goes `idle` and any in-flight run\n// is aborted. Like `createDerivedStore`, the subscription is permanent for the store's lifetime.\n//\n// Returns `{ store, settled }`: `store` is the reactive `AsyncState<T>` cell; `settled()` resolves\n// on the next terminal state with that state (`ready` or `errored`) — the awaitable bridge for\n// callers that need to `await` the build rather than react to it. It never rejects: a failed build\n// is data (`{ state: 'errored', error }`), so callers handle it the same way whether they await or\n// subscribe. Settles immediately if the store is already terminal; while `idle`/`pending` it waits.\nexport const createDerivedAsyncStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedAsyncStoreOptions<S, K, T>): {\n store: ReadableStore<AsyncState<T>>;\n settled: () => Promise<SettledState<T>>;\n} => {\n const store = createStore<AsyncState<T>>({ state: 'idle' });\n let currentKey: K | null = null;\n let generation = 0;\n let controller: AbortController | null = null;\n\n const run = (key: K) => {\n controller?.abort();\n controller = new AbortController();\n const runGeneration = ++generation;\n store.set({ state: 'pending' });\n // `.then(onFulfilled, onRejected)` — the reject handler consumes every rejection (including the\n // AbortError from a superseded run), so nothing goes unhandled; the generation guard drops the\n // stale write either way.\n build(key, controller.signal).then(\n (value) => {\n if (runGeneration === generation) store.set({ state: 'ready', value });\n },\n (error) => {\n if (runGeneration === generation) store.set({ state: 'errored', error });\n },\n );\n };\n\n const sync = (state: S) => {\n const next = dependsOn(state);\n if (next === null) {\n if (currentKey === null) return;\n controller?.abort();\n controller = null;\n generation += 1;\n currentKey = null;\n store.set({ state: 'idle' });\n return;\n }\n if (currentKey !== null && keyEquals(currentKey, next)) return;\n currentKey = next;\n run(next);\n };\n sync(source.get());\n\n const unsubscribe = source.subscribe(sync);\n\n const readable: ReadableStore<AsyncState<T>> = {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n controller?.abort();\n unsubscribe();\n store.dispose();\n },\n };\n\n const settled = (): Promise<SettledState<T>> =>\n new Promise<SettledState<T>>((resolve) => {\n let unsubscribeSettled = () => {};\n const check = (state: AsyncState<T>) => {\n if (state.state === 'ready' || state.state === 'errored') {\n unsubscribeSettled();\n resolve(state);\n }\n };\n unsubscribeSettled = store.subscribe(check);\n check(store.get());\n });\n\n return { store: readable, settled };\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
//#region src/utils/createStore.ts
|
|
2
|
+
/**
|
|
3
|
+
* An occurrence, announced to whoever is listening.
|
|
4
|
+
*
|
|
5
|
+
* - For what happened rather than what is: nothing is held, so a listener that arrives later hears
|
|
6
|
+
* the next event and never the last one. A store is this plus a value it keeps.
|
|
7
|
+
* - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the
|
|
8
|
+
* emitting code must not be left waiting.
|
|
9
|
+
* - A listener that throws is logged and stepped over. Emitting happens on someone else's call
|
|
10
|
+
* stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's
|
|
11
|
+
* failure must not become theirs.
|
|
12
|
+
*/
|
|
13
|
+
const createEmitter = () => {
|
|
14
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
15
|
+
return {
|
|
16
|
+
emit: (event) => listeners.forEach((listener) => {
|
|
17
|
+
try {
|
|
18
|
+
listener(event);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error("A subscriber threw while handling an event", error);
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
subscribe: (listener) => {
|
|
24
|
+
listeners.add(listener);
|
|
25
|
+
return () => {
|
|
26
|
+
listeners.delete(listener);
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
clear: () => listeners.clear()
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** A value that is kept, and announced when it changes: an emitter with the value in front of it. */
|
|
33
|
+
const createStore = (initial) => {
|
|
34
|
+
const changes = createEmitter();
|
|
35
|
+
let value = initial;
|
|
36
|
+
return {
|
|
37
|
+
get: () => value,
|
|
38
|
+
set: (next) => {
|
|
39
|
+
if (Object.is(next, value)) return;
|
|
40
|
+
value = next;
|
|
41
|
+
changes.emit(value);
|
|
42
|
+
},
|
|
43
|
+
subscribe: changes.subscribe,
|
|
44
|
+
dispose: () => {
|
|
45
|
+
value = initial;
|
|
46
|
+
changes.clear();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const isPlainObjectOrArray = (value) => {
|
|
51
|
+
if (Array.isArray(value)) return true;
|
|
52
|
+
const proto = Object.getPrototypeOf(value);
|
|
53
|
+
return proto === Object.prototype || proto === null;
|
|
54
|
+
};
|
|
55
|
+
const shallowEqual = (a, b) => {
|
|
56
|
+
if (Object.is(a, b)) return true;
|
|
57
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
|
|
58
|
+
if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;
|
|
59
|
+
const aKeys = Object.keys(a);
|
|
60
|
+
const bKeys = Object.keys(b);
|
|
61
|
+
return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));
|
|
62
|
+
};
|
|
63
|
+
const createDerivedStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
|
|
64
|
+
let key = dependsOn(source.get());
|
|
65
|
+
const store = createStore(build(key));
|
|
66
|
+
const unsubscribe = source.subscribe((state) => {
|
|
67
|
+
const next = dependsOn(state);
|
|
68
|
+
if (keyEquals(key, next)) return;
|
|
69
|
+
key = next;
|
|
70
|
+
store.set(build(next));
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
get: store.get,
|
|
74
|
+
subscribe: store.subscribe,
|
|
75
|
+
dispose: () => {
|
|
76
|
+
unsubscribe();
|
|
77
|
+
store.dispose();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const createDerivedAsyncStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
|
|
82
|
+
const store = createStore({ state: "idle" });
|
|
83
|
+
let currentKey = null;
|
|
84
|
+
let generation = 0;
|
|
85
|
+
let controller = null;
|
|
86
|
+
const run = (key) => {
|
|
87
|
+
controller?.abort();
|
|
88
|
+
controller = new AbortController();
|
|
89
|
+
const runGeneration = ++generation;
|
|
90
|
+
store.set({ state: "pending" });
|
|
91
|
+
build(key, controller.signal).then((value) => {
|
|
92
|
+
if (runGeneration === generation) store.set({
|
|
93
|
+
state: "ready",
|
|
94
|
+
value
|
|
95
|
+
});
|
|
96
|
+
}, (error) => {
|
|
97
|
+
if (runGeneration === generation) store.set({
|
|
98
|
+
state: "errored",
|
|
99
|
+
error
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
const sync = (state) => {
|
|
104
|
+
const next = dependsOn(state);
|
|
105
|
+
if (next === null) {
|
|
106
|
+
if (currentKey === null) return;
|
|
107
|
+
controller?.abort();
|
|
108
|
+
controller = null;
|
|
109
|
+
generation += 1;
|
|
110
|
+
currentKey = null;
|
|
111
|
+
store.set({ state: "idle" });
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (currentKey !== null && keyEquals(currentKey, next)) return;
|
|
115
|
+
currentKey = next;
|
|
116
|
+
run(next);
|
|
117
|
+
};
|
|
118
|
+
sync(source.get());
|
|
119
|
+
const unsubscribe = source.subscribe(sync);
|
|
120
|
+
const readable = {
|
|
121
|
+
get: store.get,
|
|
122
|
+
subscribe: store.subscribe,
|
|
123
|
+
dispose: () => {
|
|
124
|
+
controller?.abort();
|
|
125
|
+
unsubscribe();
|
|
126
|
+
store.dispose();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const settled = () => new Promise((resolve) => {
|
|
130
|
+
let unsubscribeSettled = () => {};
|
|
131
|
+
const check = (state) => {
|
|
132
|
+
if (state.state === "ready" || state.state === "errored") {
|
|
133
|
+
unsubscribeSettled();
|
|
134
|
+
resolve(state);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
unsubscribeSettled = store.subscribe(check);
|
|
138
|
+
check(store.get());
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
store: readable,
|
|
142
|
+
settled
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
Object.defineProperty(exports, "createDerivedAsyncStore", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function() {
|
|
149
|
+
return createDerivedAsyncStore;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(exports, "createDerivedStore", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function() {
|
|
155
|
+
return createDerivedStore;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "createEmitter", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function() {
|
|
161
|
+
return createEmitter;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(exports, "createStore", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function() {
|
|
167
|
+
return createStore;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, "shallowEqual", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function() {
|
|
173
|
+
return shallowEqual;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
//# sourceMappingURL=createStore-MQbboXcB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStore-MQbboXcB.cjs","names":[],"sources":["../src/utils/createStore.ts"],"sourcesContent":["type Listener<T> = (value: T) => void;\n\nexport type Emitter<T> = {\n emit: (event: T) => void;\n subscribe: (listener: Listener<T>) => () => void;\n /** Drops every listener. A store's `dispose` is the reason this exists. */\n clear: () => void;\n};\n\n/**\n * An occurrence, announced to whoever is listening.\n *\n * - For what happened rather than what is: nothing is held, so a listener that arrives later hears\n * the next event and never the last one. A store is this plus a value it keeps.\n * - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the\n * emitting code must not be left waiting.\n * - A listener that throws is logged and stepped over. Emitting happens on someone else's call\n * stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's\n * failure must not become theirs.\n */\nexport const createEmitter = <T>(): Emitter<T> => {\n const listeners = new Set<Listener<T>>();\n\n return {\n emit: (event) =>\n listeners.forEach((listener) => {\n try {\n listener(event);\n } catch (error) {\n console.error('A subscriber threw while handling an event', error);\n }\n }),\n subscribe: (listener) => {\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n };\n },\n clear: () => listeners.clear(),\n };\n};\n\nexport type ReadableStore<T> = {\n get: () => T;\n subscribe: (listener: Listener<T>) => () => void;\n dispose: () => void;\n};\n\nexport type Store<T> = ReadableStore<T> & {\n set: (value: T) => void;\n};\n\n/** A value that is kept, and announced when it changes: an emitter with the value in front of it. */\nexport const createStore = <T>(initial: T): Store<T> => {\n const changes = createEmitter<T>();\n let value = initial;\n\n return {\n get: () => value,\n set: (next) => {\n if (Object.is(next, value)) return;\n\n value = next;\n changes.emit(value);\n },\n subscribe: changes.subscribe,\n dispose: () => {\n value = initial;\n changes.clear();\n },\n };\n};\n\nconst isPlainObjectOrArray = (value: object): boolean => {\n if (Array.isArray(value)) return true;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n\nexport const shallowEqual = <T>(a: T, b: T): boolean => {\n if (Object.is(a, b)) return true;\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false;\n if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;\n const aKeys = Object.keys(a) as (keyof T)[];\n const bKeys = Object.keys(b) as (keyof T)[];\n return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));\n};\n\ntype DerivedStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K;\n build: (key: K) => T;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\nexport const createDerivedStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedStoreOptions<S, K, T>): ReadableStore<T> => {\n let key = dependsOn(source.get());\n const store = createStore(build(key));\n\n // The source subscription lives for the derived store's lifetime (both normally live as long as\n // the client). `dispose()` tears down both it and the derived store, so a short-lived derived\n // store can be cleaned up without leaking the source subscription or taking stale updates.\n const unsubscribe = source.subscribe((state) => {\n const next = dependsOn(state);\n if (keyEquals(key, next)) return;\n key = next;\n store.set(build(next));\n });\n\n return {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n unsubscribe();\n store.dispose();\n },\n };\n};\n\nexport type AsyncState<T> =\n | { state: 'idle' }\n | { state: 'pending' }\n | { state: 'ready'; value: T }\n | { state: 'errored'; error: unknown };\n\n// The terminal states `settled()` resolves with.\ntype SettledState<T> = Extract<AsyncState<T>, { state: 'ready' } | { state: 'errored' }>;\n\ntype DerivedAsyncStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K | null;\n build: (key: K, signal: AbortSignal) => Promise<T>;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\n// The async sibling of `createDerivedStore`: it derives a value that arrives later, exposed as an\n// `AsyncState<T>` cell. Two switchMap-style guarantees keep concurrent rebuilds honest:\n// - generation guard: only the latest run may write state, so a stale build resolving after a\n// newer key can never clobber the fresh result;\n// - AbortController: a re-key (or a null key) aborts the previous run's `signal` so in-flight work\n// can actually stop.\n// `dependsOn` returning `null` means \"nothing to build\" → the store goes `idle` and any in-flight run\n// is aborted. Like `createDerivedStore`, the subscription is permanent for the store's lifetime.\n//\n// Returns `{ store, settled }`: `store` is the reactive `AsyncState<T>` cell; `settled()` resolves\n// on the next terminal state with that state (`ready` or `errored`) — the awaitable bridge for\n// callers that need to `await` the build rather than react to it. It never rejects: a failed build\n// is data (`{ state: 'errored', error }`), so callers handle it the same way whether they await or\n// subscribe. Settles immediately if the store is already terminal; while `idle`/`pending` it waits.\nexport const createDerivedAsyncStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedAsyncStoreOptions<S, K, T>): {\n store: ReadableStore<AsyncState<T>>;\n settled: () => Promise<SettledState<T>>;\n} => {\n const store = createStore<AsyncState<T>>({ state: 'idle' });\n let currentKey: K | null = null;\n let generation = 0;\n let controller: AbortController | null = null;\n\n const run = (key: K) => {\n controller?.abort();\n controller = new AbortController();\n const runGeneration = ++generation;\n store.set({ state: 'pending' });\n // `.then(onFulfilled, onRejected)` — the reject handler consumes every rejection (including the\n // AbortError from a superseded run), so nothing goes unhandled; the generation guard drops the\n // stale write either way.\n build(key, controller.signal).then(\n (value) => {\n if (runGeneration === generation) store.set({ state: 'ready', value });\n },\n (error) => {\n if (runGeneration === generation) store.set({ state: 'errored', error });\n },\n );\n };\n\n const sync = (state: S) => {\n const next = dependsOn(state);\n if (next === null) {\n if (currentKey === null) return;\n controller?.abort();\n controller = null;\n generation += 1;\n currentKey = null;\n store.set({ state: 'idle' });\n return;\n }\n if (currentKey !== null && keyEquals(currentKey, next)) return;\n currentKey = next;\n run(next);\n };\n sync(source.get());\n\n const unsubscribe = source.subscribe(sync);\n\n const readable: ReadableStore<AsyncState<T>> = {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n controller?.abort();\n unsubscribe();\n store.dispose();\n },\n };\n\n const settled = (): Promise<SettledState<T>> =>\n new Promise<SettledState<T>>((resolve) => {\n let unsubscribeSettled = () => {};\n const check = (state: AsyncState<T>) => {\n if (state.state === 'ready' || state.state === 'errored') {\n unsubscribeSettled();\n resolve(state);\n }\n };\n unsubscribeSettled = store.subscribe(check);\n check(store.get());\n });\n\n return { store: readable, settled };\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const require_dedupe = require("./dedupe-CiskLkGR.cjs");
|
|
2
|
+
const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
|
|
3
|
+
//#region src/keboola/bearer/credential.ts
|
|
4
|
+
const DEFAULT_REFRESH_THRESHOLD = .9;
|
|
5
|
+
const isUnauthorized = (error) => error instanceof require_createFetchClient.ApiError && error.response.status === require_createFetchClient.HttpStatus.UNAUTHORIZED;
|
|
6
|
+
const createBearerCredential = ({ refresh, getToken, onSessionExpired, refreshThreshold = DEFAULT_REFRESH_THRESHOLD }) => {
|
|
7
|
+
const doRefresh = async () => {
|
|
8
|
+
try {
|
|
9
|
+
return await refresh();
|
|
10
|
+
} catch (error) {
|
|
11
|
+
if (isUnauthorized(error)) onSessionExpired?.();
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const refreshShared = require_dedupe.dedupe(doRefresh);
|
|
16
|
+
const refreshAt = (timing) => timing.issuedAt + timing.expiresIn * 1e3 * refreshThreshold;
|
|
17
|
+
const getAccessToken = async ({ forceRefresh = false } = {}) => {
|
|
18
|
+
const snapshot = getToken();
|
|
19
|
+
if (snapshot === null) return null;
|
|
20
|
+
const { accessToken, timing } = snapshot;
|
|
21
|
+
if (forceRefresh) return refreshShared();
|
|
22
|
+
if (Date.now() < refreshAt(timing)) return accessToken;
|
|
23
|
+
return refreshShared().catch(() => accessToken);
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
getAccessToken,
|
|
27
|
+
notifyExpired: () => onSessionExpired?.()
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
Object.defineProperty(exports, "createBearerCredential", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function() {
|
|
34
|
+
return createBearerCredential;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "isUnauthorized", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function() {
|
|
40
|
+
return isUnauthorized;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=credential-0c6yFwtp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-0c6yFwtp.cjs","names":["ApiError","HttpStatus","dedupe"],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgBC,eAAAA,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as dedupe } from "./dedupe-DYIHgZoG.js";
|
|
2
|
+
import { d as HttpStatus, p as ApiError } from "./createFetchClient-BK0TZK-U.js";
|
|
3
|
+
//#region src/keboola/bearer/credential.ts
|
|
4
|
+
const DEFAULT_REFRESH_THRESHOLD = .9;
|
|
5
|
+
const isUnauthorized = (error) => error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;
|
|
6
|
+
const createBearerCredential = ({ refresh, getToken, onSessionExpired, refreshThreshold = DEFAULT_REFRESH_THRESHOLD }) => {
|
|
7
|
+
const doRefresh = async () => {
|
|
8
|
+
try {
|
|
9
|
+
return await refresh();
|
|
10
|
+
} catch (error) {
|
|
11
|
+
if (isUnauthorized(error)) onSessionExpired?.();
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const refreshShared = dedupe(doRefresh);
|
|
16
|
+
const refreshAt = (timing) => timing.issuedAt + timing.expiresIn * 1e3 * refreshThreshold;
|
|
17
|
+
const getAccessToken = async ({ forceRefresh = false } = {}) => {
|
|
18
|
+
const snapshot = getToken();
|
|
19
|
+
if (snapshot === null) return null;
|
|
20
|
+
const { accessToken, timing } = snapshot;
|
|
21
|
+
if (forceRefresh) return refreshShared();
|
|
22
|
+
if (Date.now() < refreshAt(timing)) return accessToken;
|
|
23
|
+
return refreshShared().catch(() => accessToken);
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
getAccessToken,
|
|
27
|
+
notifyExpired: () => onSessionExpired?.()
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { isUnauthorized as n, createBearerCredential as t };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=credential-kEGLnVez.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-kEGLnVez.js","names":[],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgB,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require('../chunk-K3BLXPLA.cjs');
|
|
7
|
-
require('../chunk-HUQ5ATIL.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "createDataScienceClient", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkS6BWQKHJ_cjs.createDataScienceClient; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "parseLogLines", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkBVRPZKRE_cjs.parseLogLines; }
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=index.cjs.map
|
|
20
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_appLogs = require("../appLogs-CNG3yby-.cjs");
|
|
3
|
+
const require_dataScience = require("../dataScience-C-JrA0Uk.cjs");
|
|
4
|
+
exports.createDataScienceClient = require_dataScience.createDataScienceClient;
|
|
5
|
+
exports.parseLogLines = require_appLogs.parseLogLines;
|