@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,2458 @@
|
|
|
1
|
+
const require_jobStatus = require("./jobStatus-kQ9JqF8t.cjs");
|
|
2
|
+
const require_concurrent = require("./concurrent-tbiIa0UL.cjs");
|
|
3
|
+
const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
|
|
4
|
+
const require_createGenericFetchClient = require("./createGenericFetchClient-DLbjX0eM.cjs");
|
|
5
|
+
const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-Cr90VXY4.cjs");
|
|
6
|
+
const require_auth = require("./auth-5HCvCsZO.cjs");
|
|
7
|
+
//#region src/utils/async/series.ts
|
|
8
|
+
/**
|
|
9
|
+
* Executes a callback function on an array of items in series (one at a time).
|
|
10
|
+
* It behaves similarly to Promise.all(), failing on the first rejected promise.
|
|
11
|
+
* The order of the results matches the order of the promises.
|
|
12
|
+
* Resolves with the mapped results, not with the original items.
|
|
13
|
+
*/
|
|
14
|
+
const series = async (options) => require_concurrent.concurrent({
|
|
15
|
+
...options,
|
|
16
|
+
concurrency: 1
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/errors/ServiceUnavailableError.ts
|
|
20
|
+
var ServiceUnavailableError = class ServiceUnavailableError extends Error {
|
|
21
|
+
constructor(serviceId, path, clientName) {
|
|
22
|
+
super(`Service "${serviceId}" is not available in this stack. Caused by: ${clientName}.${path.join(".")}()`);
|
|
23
|
+
this.name = "ServiceUnavailableError";
|
|
24
|
+
Object.setPrototypeOf(this, ServiceUnavailableError.prototype);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/clients/storage/mergeRequests/mergeRequests.ts
|
|
29
|
+
/**
|
|
30
|
+
* Both write bodies are asserted in: the spec declares every field of them required and nullable,
|
|
31
|
+
* while the API defaults the ones a caller omits — and an explicit `null` is not the same request as
|
|
32
|
+
* an absent key. `./types` narrows each body to what a caller really has to send.
|
|
33
|
+
*/
|
|
34
|
+
const createMergeRequests = (client) => {
|
|
35
|
+
const getMergeRequests = async (signal) => {
|
|
36
|
+
const { data } = await client.get("/v2/storage/merge-request", {}, { signal });
|
|
37
|
+
return data;
|
|
38
|
+
};
|
|
39
|
+
const getMergeRequest = async (id, signal) => {
|
|
40
|
+
const { data } = await client.get("/v2/storage/merge-request/{id}", { path: { id } }, { signal });
|
|
41
|
+
return data;
|
|
42
|
+
};
|
|
43
|
+
const getMergeRequestWithActivityLog = async (id, signal) => {
|
|
44
|
+
const { data } = await client.get("/v2/storage/merge-request/{id}", {
|
|
45
|
+
path: { id },
|
|
46
|
+
query: { include: "activityLog" }
|
|
47
|
+
}, { signal });
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
const createMergeRequest = async (body) => {
|
|
51
|
+
const { data } = await client.post("/v2/storage/merge-request", { body });
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
const updateMergeRequest = async ({ id, ...body }) => {
|
|
55
|
+
const { data } = await client.put("/v2/storage/merge-request/{id}", {
|
|
56
|
+
path: { id },
|
|
57
|
+
body
|
|
58
|
+
});
|
|
59
|
+
return data;
|
|
60
|
+
};
|
|
61
|
+
const requestReview = async (id) => {
|
|
62
|
+
const { data } = await client.put("/v2/storage/merge-request/{id}/request-review", { path: { id } });
|
|
63
|
+
return data;
|
|
64
|
+
};
|
|
65
|
+
const approveMergeRequest = async (id) => {
|
|
66
|
+
const { data } = await client.put("/v2/storage/merge-request/{id}/approve", { path: { id } });
|
|
67
|
+
return data;
|
|
68
|
+
};
|
|
69
|
+
const requestChangesMergeRequest = async (id, reason) => {
|
|
70
|
+
const { data } = await client.put("/v2/storage/merge-request/{id}/request-changes", {
|
|
71
|
+
path: { id },
|
|
72
|
+
body: reason ? { reason } : void 0
|
|
73
|
+
});
|
|
74
|
+
return data;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Merges an approved merge request. The endpoint is async — it returns the created merge job.
|
|
78
|
+
*
|
|
79
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/merge-requests/PUT/v2/storage/merge-request/{id}/merge
|
|
80
|
+
*/
|
|
81
|
+
const mergeMergeRequest = async (id) => {
|
|
82
|
+
const { data } = await client.put("/v2/storage/merge-request/{id}/merge", { path: { id } });
|
|
83
|
+
return data;
|
|
84
|
+
};
|
|
85
|
+
const getMergeRequestConflicts = async (id, signal) => {
|
|
86
|
+
const { data } = await client.get("/v2/storage/merge-request/{id}/conflicts", { path: { id } }, { signal });
|
|
87
|
+
return data;
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
getMergeRequests,
|
|
91
|
+
getMergeRequest,
|
|
92
|
+
getMergeRequestWithActivityLog,
|
|
93
|
+
createMergeRequest,
|
|
94
|
+
updateMergeRequest,
|
|
95
|
+
requestReview,
|
|
96
|
+
approveMergeRequest,
|
|
97
|
+
requestChangesMergeRequest,
|
|
98
|
+
mergeMergeRequest,
|
|
99
|
+
getMergeRequestConflicts
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/clients/storage/branches/branches.ts
|
|
104
|
+
/**
|
|
105
|
+
* Every `/v2/storage/dev-branches` type below is asserted in, because the spec models none of this
|
|
106
|
+
* contract. What it needs, per operation:
|
|
107
|
+
*
|
|
108
|
+
* - `GET /dev-branches` (`DevBranchesListAction`)
|
|
109
|
+
* - response: contentless `default` → really `DevBranch[]`
|
|
110
|
+
* - `POST /dev-branches` (`DevBranchCreateAction`)
|
|
111
|
+
* - body: `CreateDevBranchRequest` is `Record<string, never>` → really `{ name, description? }`
|
|
112
|
+
* - response: contentless `default` → really a `devBranchCreate` job
|
|
113
|
+
* - duplicate: also declared on `/dev-branches/` (trailing slash); drop it
|
|
114
|
+
* - `PUT /dev-branches/{id}` (`DevBranchUpdateAction`)
|
|
115
|
+
* - body: `UpdateDevBranchRequest` is `Record<string, never>` → really `{ name, description? }`
|
|
116
|
+
* - response: contentless `default` → really a `DevBranch`
|
|
117
|
+
* - path: `id` is a `string` → really a number
|
|
118
|
+
* - `DELETE /dev-branches/{id}` (`DevBranchDeleteAction`)
|
|
119
|
+
* - response: contentless `default` → really a `devBranchDelete` job
|
|
120
|
+
* - path: `id` is a `string` → really a number
|
|
121
|
+
*
|
|
122
|
+
* A contentless `default` response makes the generated return type the response envelope
|
|
123
|
+
* (`{ headers, content?: never }`) instead of a payload, which is why all four returns are asserted.
|
|
124
|
+
* The `{id}` deviation is the one that needs no assertion — the id goes into the URL, so `String`
|
|
125
|
+
* converts it and the wire is identical.
|
|
126
|
+
*/
|
|
127
|
+
const createBranches = (client, poller) => {
|
|
128
|
+
/**
|
|
129
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/dev-branches/GET/v2/storage/dev-branches
|
|
130
|
+
*/
|
|
131
|
+
const getDevBranches = async (signal) => {
|
|
132
|
+
const { data } = await client.get("/v2/storage/dev-branches", {}, { signal });
|
|
133
|
+
return data;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Creates a development branch. Async — returns a job to poll.
|
|
137
|
+
*
|
|
138
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/dev-branches/POST/v2/storage/dev-branches
|
|
139
|
+
*/
|
|
140
|
+
const createDevBranchAsync = async (body) => {
|
|
141
|
+
const { data } = await client.post("/v2/storage/dev-branches", { body });
|
|
142
|
+
return data;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Creates a development branch and waits for the job to finish.
|
|
146
|
+
*
|
|
147
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/dev-branches/POST/v2/storage/dev-branches
|
|
148
|
+
*/
|
|
149
|
+
const createDevBranchAndWait = async (body, options) => {
|
|
150
|
+
return poller(await createDevBranchAsync(body), options).start();
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Renames a development branch or changes its description.
|
|
154
|
+
*
|
|
155
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/dev-branches/PUT/v2/storage/dev-branches/{id}
|
|
156
|
+
*/
|
|
157
|
+
const updateDevBranch = async ({ id, name, description }) => {
|
|
158
|
+
const { data } = await client.put("/v2/storage/dev-branches/{id}", {
|
|
159
|
+
path: { id: String(id) },
|
|
160
|
+
body: {
|
|
161
|
+
name,
|
|
162
|
+
description
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return data;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Deletes a development branch. Async — returns a job to poll.
|
|
169
|
+
*
|
|
170
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/dev-branches/DELETE/v2/storage/dev-branches/{id}
|
|
171
|
+
*/
|
|
172
|
+
const deleteDevBranchAsync = async (id) => {
|
|
173
|
+
const { data } = await client.delete("/v2/storage/dev-branches/{id}", { path: { id: String(id) } });
|
|
174
|
+
return data;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Deletes a development branch and waits for the job to finish.
|
|
178
|
+
*
|
|
179
|
+
* - Resolves with how the wait ended, so nothing throws: `done` carries the finished
|
|
180
|
+
* `devBranchDelete` job.
|
|
181
|
+
* - A job that ended as `error` is a `done` wait carrying a failed job — it finished. `timedOut`,
|
|
182
|
+
* `exhausted`, `aborted` and `errored` are the endings with no job to read.
|
|
183
|
+
*
|
|
184
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/dev-branches/DELETE/v2/storage/dev-branches/{id}
|
|
185
|
+
*/
|
|
186
|
+
const deleteDevBranchAndWait = async (id, options) => {
|
|
187
|
+
return poller(await deleteDevBranchAsync(id), options).start();
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Returns every metadata record on a branch. The branch is the object here, so `branchId` is the
|
|
191
|
+
* thing being addressed rather than the branch a request is scoped to.
|
|
192
|
+
*
|
|
193
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/metadata/GET/v2/storage/branch/{branchId}/metadata
|
|
194
|
+
*/
|
|
195
|
+
const getDevBranchMetadata = async (branchId, signal) => {
|
|
196
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/metadata", { path: { branchId } }, { signal });
|
|
197
|
+
return data;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Adds or updates metadata on a branch.
|
|
201
|
+
*
|
|
202
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/metadata/POST/v2/storage/branch/{branchId}/metadata
|
|
203
|
+
*/
|
|
204
|
+
const saveDevBranchMetadata = async ({ branchId, metadata }, signal) => {
|
|
205
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/metadata", {
|
|
206
|
+
path: { branchId },
|
|
207
|
+
body: { metadata }
|
|
208
|
+
}, { signal });
|
|
209
|
+
return data;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Deletes a single metadata entry from a branch.
|
|
213
|
+
*
|
|
214
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/metadata/DELETE/v2/storage/branch/{branchId}/metadata/{metadataId}
|
|
215
|
+
*/
|
|
216
|
+
const deleteDevBranchMetadata = async ({ branchId, metadataId }, signal) => {
|
|
217
|
+
await client.delete("/v2/storage/branch/{branchId}/metadata/{metadataId}", { path: {
|
|
218
|
+
branchId,
|
|
219
|
+
metadataId
|
|
220
|
+
} }, { signal });
|
|
221
|
+
};
|
|
222
|
+
return {
|
|
223
|
+
getDevBranches,
|
|
224
|
+
updateDevBranch,
|
|
225
|
+
createDevBranchAsync,
|
|
226
|
+
createDevBranchAndWait,
|
|
227
|
+
deleteDevBranchAsync,
|
|
228
|
+
deleteDevBranchAndWait,
|
|
229
|
+
getDevBranchMetadata,
|
|
230
|
+
saveDevBranchMetadata,
|
|
231
|
+
deleteDevBranchMetadata
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/clients/storage/bucketExternal/bucketExternal.ts
|
|
236
|
+
/**
|
|
237
|
+
* An external bucket wraps a schema that already exists in the project's backend (Snowflake or
|
|
238
|
+
* BigQuery) rather than one Keboola created. Registering it is what makes the rest of this namespace
|
|
239
|
+
* apply: only an external bucket needs its table metadata refreshed, manually or on a cron.
|
|
240
|
+
*
|
|
241
|
+
* Two spec mismatches recur and account for the assertions below:
|
|
242
|
+
* - **jobs** — the spec's `JobResponse` is a flat shape with `status: string`, while `Job<T>` is a
|
|
243
|
+
* discriminated union over `status` carrying typed `results`. Every job return is asserted, whether
|
|
244
|
+
* the operation declares a `JobResponse` or no body at all.
|
|
245
|
+
* - **`async` query** — `registerBucketAsync` is invoked with `async: true` but declares
|
|
246
|
+
* `query: never`.
|
|
247
|
+
*
|
|
248
|
+
* What the Storage spec needs, per operation:
|
|
249
|
+
*
|
|
250
|
+
* - `POST /buckets/register` (`BucketRegisterAction`)
|
|
251
|
+
* - body: `RegisterExistingBucketRequest` is stubbed → really `RegisterBucketBody`
|
|
252
|
+
* - query: `never` → really accepts `async`
|
|
253
|
+
* - response: contentless `default` → really a `bucketRegister` job
|
|
254
|
+
* - `PUT /buckets/{bucketId}/refresh` (`BucketRefreshAction`)
|
|
255
|
+
* - response: 202 `JobResponse` → really a `bucketRefresh` job
|
|
256
|
+
* - `POST /branch/{branchId}/buckets/{bucketId}/scheduled-tasks/refresh` (`ScheduleRefreshAction`)
|
|
257
|
+
* - response: contentless `default` → really a `ScheduledTask`
|
|
258
|
+
*
|
|
259
|
+
* `GET /buckets/register-guide` is the one operation whose spec is already right — its query and
|
|
260
|
+
* response types are generated, not asserted.
|
|
261
|
+
*/
|
|
262
|
+
const createBucketExternal = (openApiClient) => {
|
|
263
|
+
/**
|
|
264
|
+
* Registers an external bucket. Async — returns a job to poll.
|
|
265
|
+
*
|
|
266
|
+
* @link https://api.keboola.com/?service=storage#storage/POST/v2/storage/buckets/register
|
|
267
|
+
*/
|
|
268
|
+
const registerBucketAsync = async (body, signal) => {
|
|
269
|
+
const { data } = await openApiClient.post("/v2/storage/buckets/register", {
|
|
270
|
+
query: { async: true },
|
|
271
|
+
body
|
|
272
|
+
}, { signal });
|
|
273
|
+
return data;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Returns a markdown guide for registering an external bucket.
|
|
277
|
+
*
|
|
278
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/GET/v2/storage/buckets/register-guide
|
|
279
|
+
*/
|
|
280
|
+
const getBucketRegistrationGuide = async (query, signal) => {
|
|
281
|
+
const { data } = await openApiClient.get("/v2/storage/buckets/register-guide", { query }, {
|
|
282
|
+
signal,
|
|
283
|
+
queryArrayFormat: "brackets"
|
|
284
|
+
});
|
|
285
|
+
return data;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Refreshes an external bucket's table metadata. Async — returns a job to poll.
|
|
289
|
+
*
|
|
290
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/PUT/v2/storage/buckets/{bucketId}/refresh
|
|
291
|
+
*/
|
|
292
|
+
const refreshExternalBucketAsync = async ({ bucketId, ...query }, signal) => {
|
|
293
|
+
const { data } = await openApiClient.put("/v2/storage/buckets/{bucketId}/refresh", {
|
|
294
|
+
path: { bucketId },
|
|
295
|
+
query
|
|
296
|
+
}, { signal });
|
|
297
|
+
return data;
|
|
298
|
+
};
|
|
299
|
+
const createScheduledRefresh = async ({ branchId, bucketId, ...body }) => {
|
|
300
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/scheduled-tasks/refresh", {
|
|
301
|
+
path: {
|
|
302
|
+
branchId,
|
|
303
|
+
bucketId
|
|
304
|
+
},
|
|
305
|
+
body
|
|
306
|
+
});
|
|
307
|
+
return data;
|
|
308
|
+
};
|
|
309
|
+
const deleteScheduledTask = async (taskId) => {
|
|
310
|
+
await openApiClient.delete("/v2/storage/scheduled-tasks/{taskId}", { path: { taskId } });
|
|
311
|
+
};
|
|
312
|
+
return {
|
|
313
|
+
registerBucketAsync,
|
|
314
|
+
getBucketRegistrationGuide,
|
|
315
|
+
refreshExternalBucketAsync,
|
|
316
|
+
createScheduledRefresh,
|
|
317
|
+
deleteScheduledTask
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/clients/storage/bucketListings/utils.ts
|
|
322
|
+
/**
|
|
323
|
+
* The two halves of the `bigquery.subscribers` wire format: a GCP IAM principal, which the Storage
|
|
324
|
+
* spec documents as "prefixed with `user:` or `group:`". The write path uses `toBackendSubscribers`;
|
|
325
|
+
* reads hand back the raw `string[]`, so a consumer that renders or edits subscribers decodes with
|
|
326
|
+
* `fromBackendSubscribers` rather than re-deriving the prefix rule.
|
|
327
|
+
*/
|
|
328
|
+
const toBackendSubscribers = (subscribers) => subscribers.map((s) => `${s.type}:${s.email}`);
|
|
329
|
+
const fromBackendSubscribers = (raw) => {
|
|
330
|
+
const result = [];
|
|
331
|
+
for (const entry of raw) {
|
|
332
|
+
const colon = entry.indexOf(":");
|
|
333
|
+
if (colon === -1) continue;
|
|
334
|
+
const prefix = entry.slice(0, colon);
|
|
335
|
+
const email = entry.slice(colon + 1);
|
|
336
|
+
if (prefix !== "user" && prefix !== "group") continue;
|
|
337
|
+
if (email.length === 0) continue;
|
|
338
|
+
result.push({
|
|
339
|
+
type: prefix,
|
|
340
|
+
email
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
return result;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Builds the PATCH body for a listing update.
|
|
347
|
+
*
|
|
348
|
+
* Every field is copied only when the caller actually supplied it, because `description` carries
|
|
349
|
+
* three distinct meanings: absent means "leave it alone", `null` means "clear it", and a string
|
|
350
|
+
* means "set it". Evaluating the coercion unconditionally would turn an omitted description into a
|
|
351
|
+
* `null` and silently clear it.
|
|
352
|
+
*
|
|
353
|
+
* Throws when nothing was supplied: the backend answers an empty PATCH with a job that lands in
|
|
354
|
+
* `success` without changing anything, so a caller would poll it and report a save that never
|
|
355
|
+
* happened. Gate the call on the form's "dirty" state rather than relying on this.
|
|
356
|
+
*
|
|
357
|
+
* Do not "normalize" the `exposure*` names without coordinating with the bucket-listing backend
|
|
358
|
+
* owner.
|
|
359
|
+
*/
|
|
360
|
+
const toUpdateListingBody = (input) => {
|
|
361
|
+
const body = {};
|
|
362
|
+
if (input.name !== void 0) body.exposureName = input.name;
|
|
363
|
+
if (input.description !== void 0) body.exposureDescription = input.description?.trim() || null;
|
|
364
|
+
if (input.subscribers !== void 0) body.bigquery = { subscribers: toBackendSubscribers(input.subscribers) };
|
|
365
|
+
if (Object.keys(body).length === 0) throw new Error("updateListingAsync requires at least one field");
|
|
366
|
+
return body;
|
|
367
|
+
};
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/clients/storage/bucketListings/bucketListings.ts
|
|
370
|
+
/**
|
|
371
|
+
* A bucket listing (exposure) publishes a bucket to a marketplace — BigQuery Analytics Hub is the
|
|
372
|
+
* only backend today, which is why every write carries a `bigquery` key.
|
|
373
|
+
*
|
|
374
|
+
* What the Storage spec needs, per operation:
|
|
375
|
+
*
|
|
376
|
+
* - `POST` / `PATCH` / `DELETE /buckets/{bucketId}/listing`
|
|
377
|
+
* - response: 202 `JobResponse` → really `bucketListingCreate` / `bucketListingUpdate` /
|
|
378
|
+
* `bucketListingDelete` jobs. The spec's `JobResponse` is a flat shape with `status: string`,
|
|
379
|
+
* while `Job<T>` is a discriminated union over `status` carrying typed `results`, so each is
|
|
380
|
+
* asserted.
|
|
381
|
+
*
|
|
382
|
+
* `GET /buckets/{bucketId}/listing` and `GET /listings` are the operations whose specs are already
|
|
383
|
+
* right — their query and response types are generated, not asserted.
|
|
384
|
+
*/
|
|
385
|
+
const createBucketListings = (openApiClient) => {
|
|
386
|
+
/**
|
|
387
|
+
* Reads a bucket's listing, or `null` when the bucket has none (the endpoint 404s for both "no
|
|
388
|
+
* bucket" and "no listing"). The response is the spec shape: `bigquery` is optional there — it is
|
|
389
|
+
* present only for a BigQuery bucket, the only backend today — and `subscribers` inside it are the
|
|
390
|
+
* raw `user:`/`group:`-prefixed principals, which `fromBackendSubscribers` decodes.
|
|
391
|
+
*/
|
|
392
|
+
const getListing = async (bucketId, signal) => {
|
|
393
|
+
try {
|
|
394
|
+
const { data } = await openApiClient.get("/v2/storage/buckets/{bucketId}/listing", { path: { bucketId } }, { signal });
|
|
395
|
+
return data;
|
|
396
|
+
} catch (error) {
|
|
397
|
+
if (require_createFetchClient.isApiError(error) && error.response.status === 404) return null;
|
|
398
|
+
throw error;
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
const createListingAsync = async ({ bucketId, ...input }, signal) => {
|
|
402
|
+
const { data } = await openApiClient.post("/v2/storage/buckets/{bucketId}/listing", {
|
|
403
|
+
path: { bucketId },
|
|
404
|
+
body: {
|
|
405
|
+
listingName: input.name,
|
|
406
|
+
listingDescription: input.description?.trim() || null,
|
|
407
|
+
bigquery: {
|
|
408
|
+
listingId: input.listingId,
|
|
409
|
+
subscribers: toBackendSubscribers(input.subscribers)
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}, { signal });
|
|
413
|
+
return data;
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* Update a bucket exposure. At least one of `name`, `description`, or
|
|
417
|
+
* `subscribers` must be provided — the SDK throws synchronously if all three
|
|
418
|
+
* are absent, since the backend would otherwise no-op a PATCH with an empty
|
|
419
|
+
* body and we'd return a job that's already in `success` with no actual
|
|
420
|
+
* change. Callers should gate the call against the form's "dirty" state.
|
|
421
|
+
*/
|
|
422
|
+
const updateListingAsync = async ({ bucketId, ...input }, signal) => {
|
|
423
|
+
const { data } = await openApiClient.patch("/v2/storage/buckets/{bucketId}/listing", {
|
|
424
|
+
path: { bucketId },
|
|
425
|
+
body: toUpdateListingBody(input)
|
|
426
|
+
}, { signal });
|
|
427
|
+
return data;
|
|
428
|
+
};
|
|
429
|
+
const deleteListingAsync = async (bucketId, signal) => {
|
|
430
|
+
const { data } = await openApiClient.delete("/v2/storage/buckets/{bucketId}/listing", { path: { bucketId } }, { signal });
|
|
431
|
+
return data;
|
|
432
|
+
};
|
|
433
|
+
/** Every listing the token can manage. Rows carry `bucketId`, unlike the detail response. */
|
|
434
|
+
const getListings = async (signal) => {
|
|
435
|
+
const { data } = await openApiClient.get("/v2/storage/listings", {}, { signal });
|
|
436
|
+
return data;
|
|
437
|
+
};
|
|
438
|
+
return {
|
|
439
|
+
getListing,
|
|
440
|
+
createListingAsync,
|
|
441
|
+
updateListingAsync,
|
|
442
|
+
deleteListingAsync,
|
|
443
|
+
getListings
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/clients/storage/buckets/buckets.ts
|
|
448
|
+
/**
|
|
449
|
+
* Everything here runs through the OpenAPI client except `updateBucket`, which cannot: the spec
|
|
450
|
+
* declares no `put` on `/v2/storage/buckets/{bucketId}` (nor on the branch variant), so the operation
|
|
451
|
+
* is missing outright rather than mistyped. That one keeps the generic client, which is why this
|
|
452
|
+
* factory still takes both.
|
|
453
|
+
*
|
|
454
|
+
* One mismatch recurs: the spec's `JobResponse` is a flat shape with `status: string`, while `Job<T>`
|
|
455
|
+
* is a discriminated union over `status` carrying typed `results`, so every job return is asserted.
|
|
456
|
+
*
|
|
457
|
+
* What the Storage spec needs, per operation:
|
|
458
|
+
*
|
|
459
|
+
* - `PUT /buckets/{bucketId}` — **operation missing entirely**; really takes `UpdateBucketBody`
|
|
460
|
+
* (`displayName` / `description` / `color`) and answers a bucket detail
|
|
461
|
+
* - `GET /branch/{branchId}/buckets` (`BucketsListAction`)
|
|
462
|
+
* - query: `include` is a `string` → really a repeatable list, sent comma-joined
|
|
463
|
+
* - response: `BucketCreateResponse[]` → really `Bucket[]` (a listing row, not a create result)
|
|
464
|
+
* - `POST /buckets` (`BucketCreateAction`)
|
|
465
|
+
* - response: 201 `BucketCreateResponse` → really a bucket detail
|
|
466
|
+
* - `DELETE /buckets/{bucketId}` (`BucketDeleteAction`)
|
|
467
|
+
* - response: 204 wins over the 202 `JobResponse` in success-code precedence, so the async variant's
|
|
468
|
+
* job is asserted
|
|
469
|
+
* - `POST /buckets/{bucketId}/owner` (`BucketOwnerUpdateAction`)
|
|
470
|
+
* - body: `BucketOwnerUpdateRequest` is stubbed → really `{ email } | { id }`
|
|
471
|
+
* */
|
|
472
|
+
const createBuckets = (openApiClient, client) => {
|
|
473
|
+
const getBuckets = async ({ branchId, ...query }, signal) => {
|
|
474
|
+
const { data } = await openApiClient.get("/v2/storage/branch/{branchId}/buckets", {
|
|
475
|
+
path: { branchId },
|
|
476
|
+
query
|
|
477
|
+
}, {
|
|
478
|
+
signal,
|
|
479
|
+
queryArrayFormat: "comma"
|
|
480
|
+
});
|
|
481
|
+
return data;
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* Returns a bucket from the given branch. A dev branch only contains the buckets created or
|
|
485
|
+
* pulled into it, so a production bucket must be read with the default branch id.
|
|
486
|
+
*
|
|
487
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/GET/v2/storage/branch/{branchId}/buckets/{bucketId}
|
|
488
|
+
*/
|
|
489
|
+
const getBucket = async ({ branchId, bucketId, include }, signal) => {
|
|
490
|
+
const { data } = await openApiClient.get("/v2/storage/branch/{branchId}/buckets/{bucketId}", {
|
|
491
|
+
path: {
|
|
492
|
+
branchId,
|
|
493
|
+
bucketId
|
|
494
|
+
},
|
|
495
|
+
query: { include: include?.join(",") }
|
|
496
|
+
}, { signal });
|
|
497
|
+
return data;
|
|
498
|
+
};
|
|
499
|
+
const createBucket = async (body) => {
|
|
500
|
+
const { data } = await openApiClient.post("/v2/storage/buckets", { body });
|
|
501
|
+
return data;
|
|
502
|
+
};
|
|
503
|
+
const updateBucket = async ({ bucketId, ...body }) => {
|
|
504
|
+
const { data } = await client.put(`/v2/storage/buckets/{id}`, {
|
|
505
|
+
path: { id: bucketId },
|
|
506
|
+
body
|
|
507
|
+
});
|
|
508
|
+
return data;
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* Deletes a bucket synchronously.
|
|
512
|
+
*
|
|
513
|
+
* Refused outright on the stacks we test against (`400 storage.buckets.syncDeleteDisabled`,
|
|
514
|
+
* "Synchronous drop is not supported, use async call") — prefer `deleteBucketAsync` below.
|
|
515
|
+
*
|
|
516
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/DELETE/v2/storage/buckets/{bucketId}
|
|
517
|
+
*/
|
|
518
|
+
const deleteBucket = async (id) => {
|
|
519
|
+
await openApiClient.delete("/v2/storage/buckets/{bucketId}", { path: { bucketId: id } });
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* Deletes a bucket asynchronously and returns a job to poll.
|
|
523
|
+
* Required on GCP stacks where synchronous bucket deletion is not supported.
|
|
524
|
+
*
|
|
525
|
+
* `force` deletes all tables inside the bucket before removing it.
|
|
526
|
+
*
|
|
527
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/DELETE/v2/storage/buckets/{bucketId}
|
|
528
|
+
*/
|
|
529
|
+
const deleteBucketAsync = async ({ bucketId, ...query }) => {
|
|
530
|
+
const { data } = await openApiClient.delete("/v2/storage/buckets/{bucketId}", {
|
|
531
|
+
path: { bucketId },
|
|
532
|
+
query: {
|
|
533
|
+
async: true,
|
|
534
|
+
...query
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
return data;
|
|
538
|
+
};
|
|
539
|
+
/**
|
|
540
|
+
* Returns the owner of a bucket in the given branch.
|
|
541
|
+
*
|
|
542
|
+
* A bucket has no owner until one is assigned — reading it on a fresh bucket answers
|
|
543
|
+
* `404 storage.bucket.ownerNotFound`, so call `updateBucketOwner` first (or handle the 404 as
|
|
544
|
+
* "unassigned" rather than as a missing bucket).
|
|
545
|
+
*
|
|
546
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/GET/v2/storage/branch/{branchId}/buckets/{bucketId}/owner
|
|
547
|
+
*/
|
|
548
|
+
const getBucketOwner = async ({ branchId, bucketId }, signal) => {
|
|
549
|
+
const { data } = await openApiClient.get("/v2/storage/branch/{branchId}/buckets/{bucketId}/owner", { path: {
|
|
550
|
+
branchId,
|
|
551
|
+
bucketId
|
|
552
|
+
} }, { signal });
|
|
553
|
+
return data;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Changes the owner of a bucket (by `id` or `email`).
|
|
557
|
+
*
|
|
558
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/POST/v2/storage/buckets/{bucketId}/owner
|
|
559
|
+
*/
|
|
560
|
+
const updateBucketOwner = async ({ bucketId, ...body }, signal) => {
|
|
561
|
+
await openApiClient.post("/v2/storage/buckets/{bucketId}/owner", {
|
|
562
|
+
path: { bucketId },
|
|
563
|
+
body
|
|
564
|
+
}, { signal });
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* Adds or updates metadata on a bucket in the given branch.
|
|
568
|
+
*
|
|
569
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/POST/v2/storage/branch/{branchId}/buckets/{bucketId}/metadata
|
|
570
|
+
*/
|
|
571
|
+
const saveBucketMetadata = async ({ branchId, bucketId, ...body }, signal) => {
|
|
572
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/metadata", {
|
|
573
|
+
path: {
|
|
574
|
+
branchId,
|
|
575
|
+
bucketId
|
|
576
|
+
},
|
|
577
|
+
body
|
|
578
|
+
}, { signal });
|
|
579
|
+
return data;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Deletes a single metadata entry from a bucket in the given branch.
|
|
583
|
+
*
|
|
584
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/DELETE/v2/storage/branch/{branchId}/buckets/{bucketId}/metadata/{metadataId}
|
|
585
|
+
*/
|
|
586
|
+
const deleteBucketMetadata = async ({ branchId, bucketId, metadataId }, signal) => {
|
|
587
|
+
await openApiClient.delete("/v2/storage/branch/{branchId}/buckets/{bucketId}/metadata/{metadataId}", { path: {
|
|
588
|
+
branchId,
|
|
589
|
+
bucketId,
|
|
590
|
+
metadataId
|
|
591
|
+
} }, { signal });
|
|
592
|
+
};
|
|
593
|
+
return {
|
|
594
|
+
getBuckets,
|
|
595
|
+
getBucket,
|
|
596
|
+
createBucket,
|
|
597
|
+
updateBucket,
|
|
598
|
+
deleteBucket,
|
|
599
|
+
deleteBucketAsync,
|
|
600
|
+
getBucketOwner,
|
|
601
|
+
updateBucketOwner,
|
|
602
|
+
saveBucketMetadata,
|
|
603
|
+
deleteBucketMetadata
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/clients/storage/bucketSharing/bucketSharing.ts
|
|
608
|
+
/**
|
|
609
|
+
* Two spec mismatches recur here and account for every assertion below:
|
|
610
|
+
* - **jobs** — the spec's `JobResponse` is a flat shape with `status: string`, while `Job<T>` is a
|
|
611
|
+
* discriminated union over `status` carrying typed `results`. Every job return is asserted, whether
|
|
612
|
+
* the operation declares a `JobResponse` or no body at all.
|
|
613
|
+
* - **`async` query** — all six share/unshare operations are invoked with `async: true` but declare
|
|
614
|
+
* `query: never`.
|
|
615
|
+
*
|
|
616
|
+
* What the Storage spec needs, per operation:
|
|
617
|
+
*
|
|
618
|
+
* - `POST /branch/{branchId}/buckets/{bucketId}/share-organization` / `-organization-project`
|
|
619
|
+
* - query: `never` → really accepts `async`
|
|
620
|
+
* - response: `BucketShareOrganizationResponse` / `…ProjectResponse` → really share jobs
|
|
621
|
+
* - `POST /branch/{branchId}/buckets/{bucketId}/share-to-projects` / `-to-users`
|
|
622
|
+
* - query: `never` → really accepts `async`
|
|
623
|
+
* - body: `CreateBucketSharingToProjectsRequest` / `…ToUsersRequest` are stubbed
|
|
624
|
+
* (`Record<string, never>`) → really `{ targetProjectIds }` / `{ targetUsers }`
|
|
625
|
+
* - response: contentless `default` → really `bucketShareToProjects` / `bucketShareToAdmins` jobs
|
|
626
|
+
* - `DELETE /branch/{branchId}/buckets/{bucketId}/share` (`BucketShareDeleteAction`)
|
|
627
|
+
* - query: `never` → really accepts `async`
|
|
628
|
+
* - response: `BucketShareDeleteResponse` → really a `bucketRemoveShare` job
|
|
629
|
+
* - `DELETE /branch/{branchId}/buckets/{bucketId}/links/{linkedProjectId}` (`BucketForceUnlinkAction`)
|
|
630
|
+
* - query: `never` → really accepts `async`
|
|
631
|
+
* - path: `linkedProjectId` is a `number` → really a string
|
|
632
|
+
* - response: 202 `JobResponse` → really a `bucketForceUnlink` job
|
|
633
|
+
* - `POST /buckets` (`BucketCreateAction`) — the link half of a create-or-link endpoint
|
|
634
|
+
* - response: the 201 "created or linked synchronously" wins over the 202 in success-code
|
|
635
|
+
* precedence, so the async variant's `bucketLink` job is asserted
|
|
636
|
+
* - `GET /shared-buckets` (`SharedBucketsListAction`)
|
|
637
|
+
* - response: `Record<string, never>[]` → really a shared-bucket listing. This one is *not*
|
|
638
|
+
* asserted, so `SharedBuckets` is currently an empty-object array and callers get nothing useful.
|
|
639
|
+
*/
|
|
640
|
+
const createBucketSharing = (openApiClient) => {
|
|
641
|
+
/**
|
|
642
|
+
* Shares a bucket with everyone in the organization. Async — returns a job to poll.
|
|
643
|
+
*
|
|
644
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/POST/v2/storage/branch/{branchId}/buckets/{bucketId}/share-organization
|
|
645
|
+
*/
|
|
646
|
+
const shareBucketToOrganizationAsync = async ({ branchId, bucketId }, signal) => {
|
|
647
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/share-organization", {
|
|
648
|
+
path: {
|
|
649
|
+
branchId,
|
|
650
|
+
bucketId
|
|
651
|
+
},
|
|
652
|
+
query: { async: true }
|
|
653
|
+
}, { signal });
|
|
654
|
+
return data;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Shares a bucket with every project in the organization. Async — returns a job to poll.
|
|
658
|
+
*
|
|
659
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/POST/v2/storage/branch/{branchId}/buckets/{bucketId}/share-organization-project
|
|
660
|
+
*/
|
|
661
|
+
const shareBucketToOrganizationProjectAsync = async ({ branchId, bucketId }, signal) => {
|
|
662
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/share-organization-project", {
|
|
663
|
+
path: {
|
|
664
|
+
branchId,
|
|
665
|
+
bucketId
|
|
666
|
+
},
|
|
667
|
+
query: { async: true }
|
|
668
|
+
}, { signal });
|
|
669
|
+
return data;
|
|
670
|
+
};
|
|
671
|
+
/**
|
|
672
|
+
* Shares a bucket with specific projects. Async — returns a job to poll.
|
|
673
|
+
*
|
|
674
|
+
* @link https://api.keboola.com/?service=storage#storage/POST/v2/storage/branch/{branchId}/buckets/{bucketId}/share-to-projects
|
|
675
|
+
*/
|
|
676
|
+
const shareBucketToProjectsAsync = async ({ branchId, bucketId, ...body }, signal) => {
|
|
677
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/share-to-projects", {
|
|
678
|
+
path: {
|
|
679
|
+
branchId,
|
|
680
|
+
bucketId
|
|
681
|
+
},
|
|
682
|
+
query: { async: true },
|
|
683
|
+
body
|
|
684
|
+
}, { signal });
|
|
685
|
+
return data;
|
|
686
|
+
};
|
|
687
|
+
/**
|
|
688
|
+
* Shares a bucket with specific users (by ID or e-mail). Async — returns a job to poll.
|
|
689
|
+
*
|
|
690
|
+
* @link https://api.keboola.com/?service=storage#storage/POST/v2/storage/branch/{branchId}/buckets/{bucketId}/share-to-users
|
|
691
|
+
*/
|
|
692
|
+
const shareBucketToUsersAsync = async ({ branchId, bucketId, ...body }, signal) => {
|
|
693
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/share-to-users", {
|
|
694
|
+
path: {
|
|
695
|
+
branchId,
|
|
696
|
+
bucketId
|
|
697
|
+
},
|
|
698
|
+
query: { async: true },
|
|
699
|
+
body
|
|
700
|
+
}, { signal });
|
|
701
|
+
return data;
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* Stops sharing a bucket. Async — returns a job to poll.
|
|
705
|
+
*
|
|
706
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/DELETE/v2/storage/branch/{branchId}/buckets/{bucketId}/share
|
|
707
|
+
*/
|
|
708
|
+
const unshareBucketAsync = async ({ branchId, bucketId }, signal) => {
|
|
709
|
+
const { data } = await openApiClient.delete("/v2/storage/branch/{branchId}/buckets/{bucketId}/share", {
|
|
710
|
+
path: {
|
|
711
|
+
branchId,
|
|
712
|
+
bucketId
|
|
713
|
+
},
|
|
714
|
+
query: { async: true }
|
|
715
|
+
}, { signal });
|
|
716
|
+
return data;
|
|
717
|
+
};
|
|
718
|
+
/**
|
|
719
|
+
* Force-unlinks a bucket from a linked project. Async — returns a job to poll.
|
|
720
|
+
*
|
|
721
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/DELETE/v2/storage/branch/{branchId}/buckets/{bucketId}/links/{linkedProjectId}
|
|
722
|
+
*/
|
|
723
|
+
const forceUnlinkBucketAsync = async ({ branchId, bucketId, linkedProjectId }, signal) => {
|
|
724
|
+
const { data } = await openApiClient.delete("/v2/storage/branch/{branchId}/buckets/{bucketId}/links/{linkedProjectId}", {
|
|
725
|
+
path: {
|
|
726
|
+
branchId,
|
|
727
|
+
bucketId,
|
|
728
|
+
linkedProjectId
|
|
729
|
+
},
|
|
730
|
+
query: { async: true }
|
|
731
|
+
}, { signal });
|
|
732
|
+
return data;
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
735
|
+
* Links a bucket shared with this project into it. Async — returns a job to poll, whose `results`
|
|
736
|
+
* is the new bucket.
|
|
737
|
+
*
|
|
738
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/POST/v2/storage/buckets
|
|
739
|
+
*/
|
|
740
|
+
const linkBucketAsync = async (body, signal) => {
|
|
741
|
+
const { data } = await openApiClient.post("/v2/storage/buckets", {
|
|
742
|
+
query: { async: true },
|
|
743
|
+
body
|
|
744
|
+
}, { signal });
|
|
745
|
+
return data;
|
|
746
|
+
};
|
|
747
|
+
/**
|
|
748
|
+
* Lists buckets shared with the current project.
|
|
749
|
+
*
|
|
750
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/shared-buckets/GET/v2/storage/shared-buckets
|
|
751
|
+
*/
|
|
752
|
+
const sharedBuckets = async (query, signal) => {
|
|
753
|
+
const { data } = await openApiClient.get("/v2/storage/shared-buckets", { query }, { signal });
|
|
754
|
+
return data;
|
|
755
|
+
};
|
|
756
|
+
return {
|
|
757
|
+
shareBucketToOrganizationAsync,
|
|
758
|
+
shareBucketToOrganizationProjectAsync,
|
|
759
|
+
shareBucketToProjectsAsync,
|
|
760
|
+
shareBucketToUsersAsync,
|
|
761
|
+
unshareBucketAsync,
|
|
762
|
+
forceUnlinkBucketAsync,
|
|
763
|
+
linkBucketAsync,
|
|
764
|
+
sharedBuckets
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/clients/storage/columns/columns.ts
|
|
769
|
+
/**
|
|
770
|
+
* Every job return below is asserted in: the spec's `JobResponse` is a flat shape with
|
|
771
|
+
* `status: string`, while `Job<T>` is a discriminated union over `status` carrying typed `results`.
|
|
772
|
+
* That mismatch applies to both operations that declare a `JobResponse` and those that declare no
|
|
773
|
+
* response body at all. What the Storage spec needs, per operation:
|
|
774
|
+
*
|
|
775
|
+
* - `POST /branch/{branchId}/tables/{id}/columns` (`ColumnCreateAction`)
|
|
776
|
+
* - body: none of `ColumnCreateRequest` / `SnowflakeAddColumnToTableRequest` /
|
|
777
|
+
* `BigqueryAddColumnToTableRequest` declares `basetype`, and they type `definition.length` as a
|
|
778
|
+
* `number` → really a string (a decimal length is sent as `'38,0'`)
|
|
779
|
+
* - response: 202 is contentless → really a `tableColumnAdd` job
|
|
780
|
+
* - `DELETE /branch/{branchId}/tables/{tableId}/columns/{columnName}` (`ColumnDeleteAction`)
|
|
781
|
+
* - response: 202 declares `JobResponse` → really a `tableColumnDelete` job
|
|
782
|
+
* - `POST /branch/{branchId}/tables/{tableId}/primary-key` (`PrimaryKeyCreateAction`)
|
|
783
|
+
* - body: `CreatePrimaryKeyRequest.skipDuplicatesCheck` is required → really optional (it has a
|
|
784
|
+
* documented `@default false`, so a caller omitting it is valid)
|
|
785
|
+
* - response: 202 is contentless → really a `tablePrimaryKeyAdd` job
|
|
786
|
+
* - `DELETE /branch/{branchId}/tables/{tableId}/primary-key` (`PrimaryKeyDeleteAction`)
|
|
787
|
+
* - response: 202 declares `JobResponse` → really a `tablePrimaryKeyDelete` job
|
|
788
|
+
*/
|
|
789
|
+
const createColumns = (client) => {
|
|
790
|
+
/**
|
|
791
|
+
* Adds a column to a table. Async — returns a job.
|
|
792
|
+
*
|
|
793
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/columns/POST/v2/storage/branch/{branchId}/tables/{id}/columns
|
|
794
|
+
*/
|
|
795
|
+
const addTableColumnAsync = async ({ branchId, id, ...body }, signal) => {
|
|
796
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/tables/{id}/columns", {
|
|
797
|
+
path: {
|
|
798
|
+
branchId,
|
|
799
|
+
id
|
|
800
|
+
},
|
|
801
|
+
body
|
|
802
|
+
}, { signal });
|
|
803
|
+
return data;
|
|
804
|
+
};
|
|
805
|
+
/**
|
|
806
|
+
* Drops a column from a table. Async — returns a job.
|
|
807
|
+
*
|
|
808
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/columns/DELETE/v2/storage/branch/{branchId}/tables/{tableId}/columns/{columnName}
|
|
809
|
+
*/
|
|
810
|
+
const deleteTableColumnAsync = async ({ branchId, tableId, columnName, ...query }, signal) => {
|
|
811
|
+
const { data } = await client.delete("/v2/storage/branch/{branchId}/tables/{tableId}/columns/{columnName}", {
|
|
812
|
+
path: {
|
|
813
|
+
branchId,
|
|
814
|
+
tableId,
|
|
815
|
+
columnName
|
|
816
|
+
},
|
|
817
|
+
query
|
|
818
|
+
}, { signal });
|
|
819
|
+
return data;
|
|
820
|
+
};
|
|
821
|
+
/**
|
|
822
|
+
* Sets the primary key of a table. Async — returns a job.
|
|
823
|
+
*
|
|
824
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/POST/v2/storage/branch/{branchId}/tables/{tableId}/primary-key
|
|
825
|
+
*/
|
|
826
|
+
const createTablePrimaryKeyAsync = async ({ branchId, tableId, ...body }, signal) => {
|
|
827
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/tables/{tableId}/primary-key", {
|
|
828
|
+
path: {
|
|
829
|
+
branchId,
|
|
830
|
+
tableId
|
|
831
|
+
},
|
|
832
|
+
body
|
|
833
|
+
}, { signal });
|
|
834
|
+
return data;
|
|
835
|
+
};
|
|
836
|
+
/**
|
|
837
|
+
* Removes the primary key of a table. Async — returns a job.
|
|
838
|
+
*
|
|
839
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/DELETE/v2/storage/branch/{branchId}/tables/{tableId}/primary-key
|
|
840
|
+
*/
|
|
841
|
+
const removeTablePrimaryKeyAsync = async ({ branchId, tableId }, signal) => {
|
|
842
|
+
const { data } = await client.delete("/v2/storage/branch/{branchId}/tables/{tableId}/primary-key", { path: {
|
|
843
|
+
branchId,
|
|
844
|
+
tableId
|
|
845
|
+
} }, { signal });
|
|
846
|
+
return data;
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* Adds or updates metadata on a column in the given branch.
|
|
850
|
+
*
|
|
851
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/columns/POST/v2/storage/branch/{branchId}/columns/{id}/metadata
|
|
852
|
+
*/
|
|
853
|
+
const saveColumnMetadata = async ({ branchId, columnId, ...body }, signal) => {
|
|
854
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/columns/{id}/metadata", {
|
|
855
|
+
path: {
|
|
856
|
+
branchId,
|
|
857
|
+
id: columnId
|
|
858
|
+
},
|
|
859
|
+
body
|
|
860
|
+
}, { signal });
|
|
861
|
+
return data;
|
|
862
|
+
};
|
|
863
|
+
/**
|
|
864
|
+
* Deletes a single metadata entry from a column in the given branch.
|
|
865
|
+
*
|
|
866
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/columns/DELETE/v2/storage/branch/{branchId}/columns/{id}/metadata/{metadataId}
|
|
867
|
+
*/
|
|
868
|
+
const deleteColumnMetadata = async ({ branchId, columnId, metadataId }, signal) => {
|
|
869
|
+
await client.delete("/v2/storage/branch/{branchId}/columns/{id}/metadata/{metadataId}", { path: {
|
|
870
|
+
branchId,
|
|
871
|
+
id: columnId,
|
|
872
|
+
metadataId
|
|
873
|
+
} }, { signal });
|
|
874
|
+
};
|
|
875
|
+
return {
|
|
876
|
+
addTableColumnAsync,
|
|
877
|
+
deleteTableColumnAsync,
|
|
878
|
+
createTablePrimaryKeyAsync,
|
|
879
|
+
removeTablePrimaryKeyAsync,
|
|
880
|
+
saveColumnMetadata,
|
|
881
|
+
deleteColumnMetadata
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
//#endregion
|
|
885
|
+
//#region src/clients/storage/components/components.ts
|
|
886
|
+
const createComponents = (client) => {
|
|
887
|
+
const getComponent = async ({ componentId, branchId = "default" }, signal) => {
|
|
888
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}", { path: {
|
|
889
|
+
componentId,
|
|
890
|
+
branchId
|
|
891
|
+
} }, { signal });
|
|
892
|
+
return data;
|
|
893
|
+
};
|
|
894
|
+
const getComponents = async ({ branchId = "default", ...query } = {}, signal) => {
|
|
895
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components", {
|
|
896
|
+
path: { branchId: String(branchId) },
|
|
897
|
+
query
|
|
898
|
+
}, {
|
|
899
|
+
signal,
|
|
900
|
+
queryArrayFormat: "comma"
|
|
901
|
+
});
|
|
902
|
+
return data;
|
|
903
|
+
};
|
|
904
|
+
return {
|
|
905
|
+
getComponent,
|
|
906
|
+
getComponents
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/clients/storage/configurationMetadata/configurationMetadata.ts
|
|
911
|
+
const createConfigurationMetadata = (client) => {
|
|
912
|
+
const getConfigurationMetadata = async ({ branchId = "default", componentId, configurationId }, signal) => {
|
|
913
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/metadata", { path: {
|
|
914
|
+
branchId,
|
|
915
|
+
componentId,
|
|
916
|
+
configurationId
|
|
917
|
+
} }, { signal });
|
|
918
|
+
return data;
|
|
919
|
+
};
|
|
920
|
+
/** Create or update configuration metadata (e.g. `KBC.configuration.folderName`). */
|
|
921
|
+
const saveConfigurationMetadata = async ({ branchId = "default", componentId, configurationId, ...body }) => {
|
|
922
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/metadata", {
|
|
923
|
+
path: {
|
|
924
|
+
branchId,
|
|
925
|
+
componentId,
|
|
926
|
+
configurationId
|
|
927
|
+
},
|
|
928
|
+
body
|
|
929
|
+
});
|
|
930
|
+
return data;
|
|
931
|
+
};
|
|
932
|
+
/** Only available on the default branch — a dev branch answers 501. */
|
|
933
|
+
const deleteConfigurationMetadata = async ({ branchId = "default", componentId, configurationId, metadataId }, signal) => {
|
|
934
|
+
await client.delete("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/metadata/{metadataId}", { path: {
|
|
935
|
+
branchId,
|
|
936
|
+
componentId,
|
|
937
|
+
configurationId,
|
|
938
|
+
metadataId
|
|
939
|
+
} }, { signal });
|
|
940
|
+
};
|
|
941
|
+
return {
|
|
942
|
+
getConfigurationMetadata,
|
|
943
|
+
saveConfigurationMetadata,
|
|
944
|
+
deleteConfigurationMetadata
|
|
945
|
+
};
|
|
946
|
+
};
|
|
947
|
+
//#endregion
|
|
948
|
+
//#region src/clients/storage/configurationRows/configurationRows.ts
|
|
949
|
+
const createConfigurationRows = (client) => {
|
|
950
|
+
/**
|
|
951
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/POST/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows
|
|
952
|
+
*/
|
|
953
|
+
const createConfigurationRow = async ({ branchId = "default", componentId, configurationId, ...body }) => {
|
|
954
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows", {
|
|
955
|
+
path: {
|
|
956
|
+
branchId,
|
|
957
|
+
componentId,
|
|
958
|
+
configurationId
|
|
959
|
+
},
|
|
960
|
+
body
|
|
961
|
+
});
|
|
962
|
+
return data;
|
|
963
|
+
};
|
|
964
|
+
/**
|
|
965
|
+
* NOTE: Do not run this method concurrently; BE will return 500 server errors under load due to a BE bottleneck with IDs allocation.
|
|
966
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/POST/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows
|
|
967
|
+
*/
|
|
968
|
+
const createConfigurationRows = async ({ branchId = "default", componentId, configurationId, data }, options) => {
|
|
969
|
+
return series({
|
|
970
|
+
items: data,
|
|
971
|
+
process: (rowBody) => {
|
|
972
|
+
return createConfigurationRow({
|
|
973
|
+
branchId,
|
|
974
|
+
componentId,
|
|
975
|
+
configurationId,
|
|
976
|
+
...rowBody
|
|
977
|
+
});
|
|
978
|
+
},
|
|
979
|
+
middlewares: options?.middlewares
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
/**
|
|
983
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/GET/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}
|
|
984
|
+
*/
|
|
985
|
+
const getConfigurationRow = async ({ branchId = "default", ...path }, signal) => {
|
|
986
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}", { path: {
|
|
987
|
+
branchId,
|
|
988
|
+
...path
|
|
989
|
+
} }, { signal });
|
|
990
|
+
return data;
|
|
991
|
+
};
|
|
992
|
+
/**
|
|
993
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/PUT/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}
|
|
994
|
+
*/
|
|
995
|
+
const updateConfigurationRow = async ({ branchId = "default", componentId, configurationId, rowId, ...body }, signal) => {
|
|
996
|
+
const { data } = await client.put("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}", {
|
|
997
|
+
path: {
|
|
998
|
+
branchId,
|
|
999
|
+
componentId,
|
|
1000
|
+
configurationId,
|
|
1001
|
+
rowId
|
|
1002
|
+
},
|
|
1003
|
+
body
|
|
1004
|
+
}, { signal });
|
|
1005
|
+
return data;
|
|
1006
|
+
};
|
|
1007
|
+
/**
|
|
1008
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/PUT/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}/state
|
|
1009
|
+
*/
|
|
1010
|
+
const updateConfigurationRowState = async ({ branchId = "default", componentId, configurationId, rowId, ...body }, signal) => {
|
|
1011
|
+
const { data } = await client.put("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}/state", {
|
|
1012
|
+
path: {
|
|
1013
|
+
branchId,
|
|
1014
|
+
componentId,
|
|
1015
|
+
configurationId,
|
|
1016
|
+
rowId
|
|
1017
|
+
},
|
|
1018
|
+
body
|
|
1019
|
+
}, { signal });
|
|
1020
|
+
return data;
|
|
1021
|
+
};
|
|
1022
|
+
/**
|
|
1023
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/DELETE/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}
|
|
1024
|
+
*/
|
|
1025
|
+
const deleteConfigurationRow = async ({ changeDescription, ...path }) => {
|
|
1026
|
+
await client.delete("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}", {
|
|
1027
|
+
path,
|
|
1028
|
+
body: { changeDescription }
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configuration-rows/DELETE/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}
|
|
1033
|
+
*/
|
|
1034
|
+
const deleteConfigurationRows = async ({ rowIds, changeDescription, ...input }, options) => {
|
|
1035
|
+
await require_concurrent.concurrent({
|
|
1036
|
+
items: rowIds,
|
|
1037
|
+
process: (rowId) => {
|
|
1038
|
+
const resolvedDescription = typeof changeDescription === "string" ? changeDescription : changeDescription?.(rowId);
|
|
1039
|
+
return deleteConfigurationRow({
|
|
1040
|
+
rowId,
|
|
1041
|
+
changeDescription: resolvedDescription,
|
|
1042
|
+
...input
|
|
1043
|
+
});
|
|
1044
|
+
},
|
|
1045
|
+
concurrency: 5,
|
|
1046
|
+
middlewares: options?.middlewares
|
|
1047
|
+
});
|
|
1048
|
+
};
|
|
1049
|
+
return {
|
|
1050
|
+
createConfigurationRow,
|
|
1051
|
+
createConfigurationRows,
|
|
1052
|
+
getConfigurationRow,
|
|
1053
|
+
updateConfigurationRow,
|
|
1054
|
+
updateConfigurationRowState,
|
|
1055
|
+
deleteConfigurationRow,
|
|
1056
|
+
deleteConfigurationRows
|
|
1057
|
+
};
|
|
1058
|
+
};
|
|
1059
|
+
//#endregion
|
|
1060
|
+
//#region src/clients/storage/configurations/utils.ts
|
|
1061
|
+
/**
|
|
1062
|
+
* `expectedVersion` is the `version` field of the configuration the caller read, sent back as the
|
|
1063
|
+
* `If-Match` header so the write is conditional on nothing having changed since. What Storage does
|
|
1064
|
+
* with it:
|
|
1065
|
+
*
|
|
1066
|
+
* 1. Header omitted (`{}`) — no precondition, the write applies whatever the current version is.
|
|
1067
|
+
* `purgeConfiguration` is the exception and answers 428, which is why its `expectedVersion` is
|
|
1068
|
+
* required rather than optional.
|
|
1069
|
+
* 2. Version still current — the write applies.
|
|
1070
|
+
* 3. Version moved on since it was read — 412, and nothing is written.
|
|
1071
|
+
* 4. Value unusable — 400. Storage wants a strong entity tag, so the quotes are part of the value;
|
|
1072
|
+
* a bare number, a weak validator or a tag list are all rejected.
|
|
1073
|
+
*/
|
|
1074
|
+
const createVersionPrecondition = (expectedVersion) => expectedVersion === void 0 ? {} : { [require_createFetchClient.HttpHeader.IF_MATCH]: `"${expectedVersion}"` };
|
|
1075
|
+
/**
|
|
1076
|
+
* The `workspaceOutputMappingSync` job a configuration update enqueued.
|
|
1077
|
+
*
|
|
1078
|
+
* - Storage reports it in a header, not in the response body.
|
|
1079
|
+
* - `null` means there is no job to wait for, not that the write failed.
|
|
1080
|
+
* - Components outside Storage's allow-list get no job — `workspaceId` is ignored for them.
|
|
1081
|
+
*/
|
|
1082
|
+
const parseSyncJobId = (headers) => {
|
|
1083
|
+
const jobId = Number(headers.get(require_createFetchClient.KeboolaHttpHeader.STORAGE_API_JOB_ID));
|
|
1084
|
+
return Number.isInteger(jobId) && jobId > 0 ? jobId : null;
|
|
1085
|
+
};
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region src/clients/storage/configurations/configurations.ts
|
|
1088
|
+
const createConfigurations = (client) => {
|
|
1089
|
+
const getConfiguration = async ({ componentId, configId, branchId = "default" }, signal) => {
|
|
1090
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}", { path: {
|
|
1091
|
+
componentId,
|
|
1092
|
+
configurationId: configId,
|
|
1093
|
+
branchId: String(branchId)
|
|
1094
|
+
} }, { signal });
|
|
1095
|
+
return data;
|
|
1096
|
+
};
|
|
1097
|
+
const getConfigurationDiff = async ({ componentId, configId, branchId }, signal) => {
|
|
1098
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/diff", { path: {
|
|
1099
|
+
componentId,
|
|
1100
|
+
configurationId: configId,
|
|
1101
|
+
branchId: String(branchId)
|
|
1102
|
+
} }, { signal });
|
|
1103
|
+
return data;
|
|
1104
|
+
};
|
|
1105
|
+
const rebaseConfiguration = async ({ branchId, componentId, configId, ...body }) => {
|
|
1106
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rebase", {
|
|
1107
|
+
path: {
|
|
1108
|
+
branchId: String(branchId),
|
|
1109
|
+
componentId,
|
|
1110
|
+
configurationId: configId
|
|
1111
|
+
},
|
|
1112
|
+
body
|
|
1113
|
+
});
|
|
1114
|
+
return data;
|
|
1115
|
+
};
|
|
1116
|
+
/**
|
|
1117
|
+
* Resolve a merge conflict by deleting the configuration — the same rebase
|
|
1118
|
+
* endpoint as `rebaseConfiguration`, but with an empty `diff` envelope. The
|
|
1119
|
+
* dev-branch configuration is re-anchored onto the given default-branch
|
|
1120
|
+
* `version` and its head version becomes a tombstone (soft delete). Returns
|
|
1121
|
+
* the deleted configuration.
|
|
1122
|
+
*/
|
|
1123
|
+
const rebaseConfigurationToDeleted = async ({ branchId, componentId, configId, version }) => {
|
|
1124
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rebase", {
|
|
1125
|
+
path: {
|
|
1126
|
+
branchId: String(branchId),
|
|
1127
|
+
componentId,
|
|
1128
|
+
configurationId: configId
|
|
1129
|
+
},
|
|
1130
|
+
body: {
|
|
1131
|
+
version,
|
|
1132
|
+
diff: {}
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
return data;
|
|
1136
|
+
};
|
|
1137
|
+
const createConfiguration = async ({ branchId = "default", componentId, ...body }) => {
|
|
1138
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs", {
|
|
1139
|
+
path: {
|
|
1140
|
+
branchId: String(branchId),
|
|
1141
|
+
componentId
|
|
1142
|
+
},
|
|
1143
|
+
body
|
|
1144
|
+
});
|
|
1145
|
+
return data;
|
|
1146
|
+
};
|
|
1147
|
+
/**
|
|
1148
|
+
* Updates an existing configuration. Only the fields provided are sent.
|
|
1149
|
+
*
|
|
1150
|
+
* - Resolves once the configuration is written.
|
|
1151
|
+
* - Sending `workspaceId` also asks Storage to sync that workspace's output mapping against the
|
|
1152
|
+
* saved configuration. That part runs as a job: poll `syncJobId` through `jobs.getJob` when it
|
|
1153
|
+
* has to land before the caller reports success.
|
|
1154
|
+
* - A `workspaceId` not linked to this component and configuration is rejected with 400, before
|
|
1155
|
+
* the configuration is written.
|
|
1156
|
+
*
|
|
1157
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configurations/PUT/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}
|
|
1158
|
+
*/
|
|
1159
|
+
const updateConfiguration = async ({ branchId = "default", componentId, configId, configuration, workspaceId, ...rest }, signal) => {
|
|
1160
|
+
const body = {
|
|
1161
|
+
...rest,
|
|
1162
|
+
configuration
|
|
1163
|
+
};
|
|
1164
|
+
const { data, response } = await client.put("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}", {
|
|
1165
|
+
path: {
|
|
1166
|
+
branchId: String(branchId),
|
|
1167
|
+
componentId,
|
|
1168
|
+
configurationId: configId
|
|
1169
|
+
},
|
|
1170
|
+
query: { workspaceId },
|
|
1171
|
+
body
|
|
1172
|
+
}, { signal });
|
|
1173
|
+
return {
|
|
1174
|
+
configuration: data,
|
|
1175
|
+
syncJobId: parseSyncJobId(response.headers)
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
/**
|
|
1179
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configurations/PUT/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/state
|
|
1180
|
+
*/
|
|
1181
|
+
const updateConfigurationState = async ({ branchId = "default", componentId, configId, ...body }, signal) => {
|
|
1182
|
+
const { data } = await client.put("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/state", {
|
|
1183
|
+
path: {
|
|
1184
|
+
branchId: String(branchId),
|
|
1185
|
+
componentId,
|
|
1186
|
+
configurationId: configId
|
|
1187
|
+
},
|
|
1188
|
+
body
|
|
1189
|
+
}, { signal });
|
|
1190
|
+
return data;
|
|
1191
|
+
};
|
|
1192
|
+
/**
|
|
1193
|
+
* Move a configuration to the trash — or, when it is in the trash already, purge it
|
|
1194
|
+
* permanently. Pass `expectedVersion` to pin the version the delete was decided on;
|
|
1195
|
+
* prefer `purgeConfiguration` when the permanent removal is the intent.
|
|
1196
|
+
*/
|
|
1197
|
+
const deleteConfiguration = async ({ branchId, componentId, configId, expectedVersion }) => {
|
|
1198
|
+
await client.delete("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}", { path: {
|
|
1199
|
+
branchId: String(branchId),
|
|
1200
|
+
componentId,
|
|
1201
|
+
configurationId: configId
|
|
1202
|
+
} }, { headers: { ...createVersionPrecondition(expectedVersion) } });
|
|
1203
|
+
};
|
|
1204
|
+
/**
|
|
1205
|
+
* Permanently remove a trashed configuration, including its versions, rows and metadata.
|
|
1206
|
+
* Unlike a second `deleteConfiguration`, this never falls back to a soft delete: purging a
|
|
1207
|
+
* live configuration is rejected (400 `notInTrash`) rather than trashing it. Default branch
|
|
1208
|
+
* only, and the token needs `canPurgeTrash`.
|
|
1209
|
+
*/
|
|
1210
|
+
const purgeConfiguration = async ({ branchId = "default", componentId, configId, expectedVersion }) => {
|
|
1211
|
+
await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/purge", { path: {
|
|
1212
|
+
branchId: String(branchId),
|
|
1213
|
+
componentId,
|
|
1214
|
+
configurationId: configId
|
|
1215
|
+
} }, { headers: { ...createVersionPrecondition(expectedVersion) } });
|
|
1216
|
+
};
|
|
1217
|
+
/**
|
|
1218
|
+
* Purge configurations across components in one bounded fan-out. Like every `concurrent` caller
|
|
1219
|
+
* it stops at the first rejection, and here that is a case to plan for rather than an edge: a
|
|
1220
|
+
* stale `expectedVersion` (412) abandons the rest of the queue, so re-read the trash before
|
|
1221
|
+
* offering another attempt.
|
|
1222
|
+
*
|
|
1223
|
+
* Emptying a trash is the whole-collection case this exists for, which `concurrent`'s default of
|
|
1224
|
+
* 2 would walk through two configurations at a time.
|
|
1225
|
+
*/
|
|
1226
|
+
const purgeConfigurations = async ({ branchId, configs }) => {
|
|
1227
|
+
await require_concurrent.concurrent({
|
|
1228
|
+
items: configs,
|
|
1229
|
+
concurrency: 10,
|
|
1230
|
+
process: (config) => purgeConfiguration({
|
|
1231
|
+
branchId,
|
|
1232
|
+
...config
|
|
1233
|
+
})
|
|
1234
|
+
});
|
|
1235
|
+
};
|
|
1236
|
+
/** Restore a trashed configuration. */
|
|
1237
|
+
const restoreConfiguration = async ({ branchId = "default", componentId, configId }) => {
|
|
1238
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/restore", { path: {
|
|
1239
|
+
branchId: String(branchId),
|
|
1240
|
+
componentId,
|
|
1241
|
+
configurationId: configId
|
|
1242
|
+
} });
|
|
1243
|
+
return data;
|
|
1244
|
+
};
|
|
1245
|
+
/**
|
|
1246
|
+
* Reset a dev-branch configuration back to its default-branch (production) version.
|
|
1247
|
+
*
|
|
1248
|
+
* The spec is right: the endpoint answers with an empty body, confirmed against the live API by
|
|
1249
|
+
* the nightly smoke (`integration/storageConfigurationLifecycle.smoke.ts`). It used to be typed as
|
|
1250
|
+
* resolving to the configuration, so every caller reading a field off the result was reading
|
|
1251
|
+
* `undefined`. Re-read the configuration to observe the reset.
|
|
1252
|
+
*
|
|
1253
|
+
* Dev-branch only — the API answers 501 on `default`.
|
|
1254
|
+
*/
|
|
1255
|
+
const resetConfigurationToDefault = async ({ branchId = "default", componentId, configId }) => {
|
|
1256
|
+
await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/reset-to-default", { path: {
|
|
1257
|
+
branchId: String(branchId),
|
|
1258
|
+
componentId,
|
|
1259
|
+
configurationId: configId
|
|
1260
|
+
} });
|
|
1261
|
+
};
|
|
1262
|
+
const deleteConfigurations = async ({ configIds, ...rest }) => {
|
|
1263
|
+
await require_concurrent.concurrent({
|
|
1264
|
+
items: configIds,
|
|
1265
|
+
process: async (configId) => deleteConfiguration({
|
|
1266
|
+
...rest,
|
|
1267
|
+
configId
|
|
1268
|
+
})
|
|
1269
|
+
});
|
|
1270
|
+
};
|
|
1271
|
+
const getConfigurations = async ({ componentId, branchId = "default" }, signal) => {
|
|
1272
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs", { path: {
|
|
1273
|
+
componentId,
|
|
1274
|
+
branchId: String(branchId)
|
|
1275
|
+
} }, { signal });
|
|
1276
|
+
return data;
|
|
1277
|
+
};
|
|
1278
|
+
const searchComponentConfigurations = async ({ branchId = "default", include, ...query } = {}, signal) => {
|
|
1279
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/search/component-configurations", {
|
|
1280
|
+
path: { branchId: String(branchId) },
|
|
1281
|
+
query: {
|
|
1282
|
+
...query,
|
|
1283
|
+
...include?.length && { include: include.join(",") }
|
|
1284
|
+
}
|
|
1285
|
+
}, { signal });
|
|
1286
|
+
return data;
|
|
1287
|
+
};
|
|
1288
|
+
return {
|
|
1289
|
+
createConfiguration,
|
|
1290
|
+
updateConfiguration,
|
|
1291
|
+
updateConfigurationState,
|
|
1292
|
+
getConfiguration,
|
|
1293
|
+
getConfigurationDiff,
|
|
1294
|
+
rebaseConfiguration,
|
|
1295
|
+
rebaseConfigurationToDeleted,
|
|
1296
|
+
deleteConfiguration,
|
|
1297
|
+
deleteConfigurations,
|
|
1298
|
+
purgeConfiguration,
|
|
1299
|
+
purgeConfigurations,
|
|
1300
|
+
getConfigurations,
|
|
1301
|
+
restoreConfiguration,
|
|
1302
|
+
resetConfigurationToDefault,
|
|
1303
|
+
searchComponentConfigurations
|
|
1304
|
+
};
|
|
1305
|
+
};
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region src/clients/storage/configurationVersions/configurationVersions.ts
|
|
1308
|
+
const createConfigurationVersions = (client) => {
|
|
1309
|
+
const getConfigurationVersions = async ({ branchId, componentId, configurationId }, signal) => {
|
|
1310
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/versions", { path: {
|
|
1311
|
+
branchId: String(branchId),
|
|
1312
|
+
componentId,
|
|
1313
|
+
configurationId
|
|
1314
|
+
} }, { signal });
|
|
1315
|
+
return data;
|
|
1316
|
+
};
|
|
1317
|
+
const getConfigurationVersion = async ({ branchId, componentId, configurationId, versionId }, signal) => {
|
|
1318
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/versions/{versionId}", { path: {
|
|
1319
|
+
branchId: String(branchId),
|
|
1320
|
+
componentId,
|
|
1321
|
+
configurationId,
|
|
1322
|
+
versionId: String(versionId)
|
|
1323
|
+
} }, { signal });
|
|
1324
|
+
return data;
|
|
1325
|
+
};
|
|
1326
|
+
/**
|
|
1327
|
+
* Roll a configuration back to one of its versions.
|
|
1328
|
+
*
|
|
1329
|
+
* A rollback is itself a new version, not a rewind of the history, and the endpoint answers with
|
|
1330
|
+
* only that number — no configuration body. Re-read the configuration to observe the result.
|
|
1331
|
+
*/
|
|
1332
|
+
const rollbackConfigurationToVersion = async ({ branchId = "default", componentId, configurationId, versionId }) => {
|
|
1333
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/versions/{versionId}/rollback", {
|
|
1334
|
+
path: {
|
|
1335
|
+
branchId: String(branchId),
|
|
1336
|
+
componentId,
|
|
1337
|
+
configurationId,
|
|
1338
|
+
versionId: String(versionId)
|
|
1339
|
+
},
|
|
1340
|
+
body: {}
|
|
1341
|
+
});
|
|
1342
|
+
return data;
|
|
1343
|
+
};
|
|
1344
|
+
/**
|
|
1345
|
+
* Server-side copy of a configuration from one of its versions. Preserves the
|
|
1346
|
+
* full configuration including rows — unlike a read-then-create, which would
|
|
1347
|
+
* only carry the top-level config body.
|
|
1348
|
+
*
|
|
1349
|
+
* The endpoint answers with only the new configuration's id; read it back for the body.
|
|
1350
|
+
*/
|
|
1351
|
+
const copyConfigurationFromVersion = async ({ branchId = "default", componentId, configurationId, versionId, ...body }) => {
|
|
1352
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/versions/{versionId}/create", {
|
|
1353
|
+
path: {
|
|
1354
|
+
branchId: String(branchId),
|
|
1355
|
+
componentId,
|
|
1356
|
+
configurationId,
|
|
1357
|
+
versionId: String(versionId)
|
|
1358
|
+
},
|
|
1359
|
+
body
|
|
1360
|
+
});
|
|
1361
|
+
return data;
|
|
1362
|
+
};
|
|
1363
|
+
const getConfigurationRowVersions = async ({ branchId, componentId, configurationId, rowId }, signal) => {
|
|
1364
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}/versions", { path: {
|
|
1365
|
+
branchId: String(branchId),
|
|
1366
|
+
componentId,
|
|
1367
|
+
configurationId,
|
|
1368
|
+
rowId
|
|
1369
|
+
} }, { signal });
|
|
1370
|
+
return data;
|
|
1371
|
+
};
|
|
1372
|
+
const getConfigurationRowVersion = async ({ branchId, componentId, configurationId, rowId, versionId }, signal) => {
|
|
1373
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}/versions/{versionId}", { path: {
|
|
1374
|
+
branchId: String(branchId),
|
|
1375
|
+
componentId,
|
|
1376
|
+
configurationId,
|
|
1377
|
+
rowId,
|
|
1378
|
+
versionId: String(versionId)
|
|
1379
|
+
} }, { signal });
|
|
1380
|
+
return data;
|
|
1381
|
+
};
|
|
1382
|
+
/** Roll a configuration row back to one of its versions. */
|
|
1383
|
+
const rollbackConfigurationRowToVersion = async ({ branchId = "default", componentId, configurationId, rowId, versionId }) => {
|
|
1384
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}/versions/{versionId}/rollback", {
|
|
1385
|
+
path: {
|
|
1386
|
+
branchId: String(branchId),
|
|
1387
|
+
componentId,
|
|
1388
|
+
configurationId,
|
|
1389
|
+
rowId,
|
|
1390
|
+
versionId: String(versionId)
|
|
1391
|
+
},
|
|
1392
|
+
body: {}
|
|
1393
|
+
});
|
|
1394
|
+
return data;
|
|
1395
|
+
};
|
|
1396
|
+
/**
|
|
1397
|
+
* Server-side copy of a row from one of its versions into the same configuration.
|
|
1398
|
+
* The endpoint takes no body, so the copy's name is the backend's to choose — a
|
|
1399
|
+
* caller that wants a specific one follows up with a row update.
|
|
1400
|
+
*/
|
|
1401
|
+
const copyConfigurationRowFromVersion = async ({ branchId = "default", componentId, configurationId, rowId, versionId }) => {
|
|
1402
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/rows/{rowId}/versions/{versionId}/create", {
|
|
1403
|
+
path: {
|
|
1404
|
+
branchId: String(branchId),
|
|
1405
|
+
componentId,
|
|
1406
|
+
configurationId,
|
|
1407
|
+
rowId,
|
|
1408
|
+
versionId: String(versionId)
|
|
1409
|
+
},
|
|
1410
|
+
body: {}
|
|
1411
|
+
});
|
|
1412
|
+
return data;
|
|
1413
|
+
};
|
|
1414
|
+
return {
|
|
1415
|
+
getConfigurationVersions,
|
|
1416
|
+
getConfigurationVersion,
|
|
1417
|
+
rollbackConfigurationToVersion,
|
|
1418
|
+
copyConfigurationFromVersion,
|
|
1419
|
+
getConfigurationRowVersions,
|
|
1420
|
+
getConfigurationRowVersion,
|
|
1421
|
+
rollbackConfigurationRowToVersion,
|
|
1422
|
+
copyConfigurationRowFromVersion
|
|
1423
|
+
};
|
|
1424
|
+
};
|
|
1425
|
+
//#endregion
|
|
1426
|
+
//#region src/clients/storage/configurationWorkspaces/configurationWorkspaces.ts
|
|
1427
|
+
const createConfigurationWorkspaces = (client) => {
|
|
1428
|
+
/**
|
|
1429
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/component-configurations/GET/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/workspaces
|
|
1430
|
+
*/
|
|
1431
|
+
const getConfigurationWorkspaces = async ({ componentId, branchId, configurationId }) => {
|
|
1432
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/workspaces", { path: {
|
|
1433
|
+
componentId,
|
|
1434
|
+
branchId,
|
|
1435
|
+
configurationId
|
|
1436
|
+
} });
|
|
1437
|
+
return data;
|
|
1438
|
+
};
|
|
1439
|
+
const createConfigurationWorkspace = async ({ componentId, branchId, configurationId, ...body }) => {
|
|
1440
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/workspaces", {
|
|
1441
|
+
path: {
|
|
1442
|
+
componentId,
|
|
1443
|
+
branchId,
|
|
1444
|
+
configurationId
|
|
1445
|
+
},
|
|
1446
|
+
body
|
|
1447
|
+
});
|
|
1448
|
+
return data;
|
|
1449
|
+
};
|
|
1450
|
+
const createConfigurationWorkspaceJob = async ({ componentId, branchId, configurationId, ...body }) => {
|
|
1451
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/components/{componentId}/configs/{configurationId}/workspaces", {
|
|
1452
|
+
path: {
|
|
1453
|
+
componentId,
|
|
1454
|
+
branchId,
|
|
1455
|
+
configurationId
|
|
1456
|
+
},
|
|
1457
|
+
body,
|
|
1458
|
+
query: { async: true }
|
|
1459
|
+
});
|
|
1460
|
+
return data;
|
|
1461
|
+
};
|
|
1462
|
+
return {
|
|
1463
|
+
createConfigurationWorkspace,
|
|
1464
|
+
createConfigurationWorkspaceJob,
|
|
1465
|
+
getConfigurationWorkspaces
|
|
1466
|
+
};
|
|
1467
|
+
};
|
|
1468
|
+
//#endregion
|
|
1469
|
+
//#region src/clients/storage/events/events.ts
|
|
1470
|
+
/**
|
|
1471
|
+
* Every endpoint here is the branched variant, and `branchId` falls back to `default`.
|
|
1472
|
+
*
|
|
1473
|
+
* - The unbranched twins (`/v2/storage/events`, `/v2/storage/events/{eventId}`) answer the same
|
|
1474
|
+
* payloads; addressing one branch is the narrower request and the one every caller wants.
|
|
1475
|
+
* - Each response is asserted in: the spec declares `content?: never` on all four event operations,
|
|
1476
|
+
* and types `params`, `results` and `performance` as bare `Record<string, never>` where it does not.
|
|
1477
|
+
*/
|
|
1478
|
+
const createEvents = (client) => {
|
|
1479
|
+
/**
|
|
1480
|
+
* Event feed of a branch.
|
|
1481
|
+
*
|
|
1482
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/events/GET/v2/storage/branch/{branchId}/events
|
|
1483
|
+
*/
|
|
1484
|
+
const getEvents = async ({ branchId, ...query }, signal) => {
|
|
1485
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/events", {
|
|
1486
|
+
path: { branchId },
|
|
1487
|
+
query
|
|
1488
|
+
}, { signal });
|
|
1489
|
+
return data;
|
|
1490
|
+
};
|
|
1491
|
+
/**
|
|
1492
|
+
* A single event. Ids are `uuid`s — the `id` a create answers with does not resolve here.
|
|
1493
|
+
*
|
|
1494
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/events/GET/v2/storage/branch/{branchId}/events/{eventId}
|
|
1495
|
+
*/
|
|
1496
|
+
const getEvent = async ({ branchId, eventId }, signal) => {
|
|
1497
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/events/{eventId}", { path: {
|
|
1498
|
+
branchId,
|
|
1499
|
+
eventId
|
|
1500
|
+
} }, { signal });
|
|
1501
|
+
return data;
|
|
1502
|
+
};
|
|
1503
|
+
/**
|
|
1504
|
+
* Event feed of a table in the given branch. A dev branch only contains the tables created or
|
|
1505
|
+
* pulled into it, so a production table's events must be read with the default branch id.
|
|
1506
|
+
*
|
|
1507
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/events/GET/v2/storage/branch/{branchId}/tables/{tableId}/events
|
|
1508
|
+
*/
|
|
1509
|
+
const getTableEvents = async ({ branchId, tableId, ...query }, signal) => {
|
|
1510
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/tables/{tableId}/events", {
|
|
1511
|
+
path: {
|
|
1512
|
+
branchId,
|
|
1513
|
+
tableId
|
|
1514
|
+
},
|
|
1515
|
+
query
|
|
1516
|
+
}, { signal });
|
|
1517
|
+
return data;
|
|
1518
|
+
};
|
|
1519
|
+
/**
|
|
1520
|
+
* Event feed of a bucket in the given branch. Same payload as the table feed.
|
|
1521
|
+
*
|
|
1522
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/events/GET/v2/storage/branch/{branchId}/buckets/{bucketId}/events
|
|
1523
|
+
*/
|
|
1524
|
+
const getBucketEvents = async ({ branchId, bucketId, ...query }, signal) => {
|
|
1525
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/buckets/{bucketId}/events", {
|
|
1526
|
+
path: {
|
|
1527
|
+
branchId,
|
|
1528
|
+
bucketId
|
|
1529
|
+
},
|
|
1530
|
+
query
|
|
1531
|
+
}, { signal });
|
|
1532
|
+
return data;
|
|
1533
|
+
};
|
|
1534
|
+
/**
|
|
1535
|
+
* Writes an event into a branch's feed.
|
|
1536
|
+
*
|
|
1537
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/events/POST/v2/storage/branch/{branchId}/events
|
|
1538
|
+
*/
|
|
1539
|
+
const createEvent = async ({ branchId = "default", ...body }, signal) => {
|
|
1540
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/events", {
|
|
1541
|
+
path: { branchId },
|
|
1542
|
+
body
|
|
1543
|
+
}, { signal });
|
|
1544
|
+
return data;
|
|
1545
|
+
};
|
|
1546
|
+
return {
|
|
1547
|
+
getEvents,
|
|
1548
|
+
getEvent,
|
|
1549
|
+
getTableEvents,
|
|
1550
|
+
getBucketEvents,
|
|
1551
|
+
createEvent
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
//#endregion
|
|
1555
|
+
//#region src/clients/storage/files/files.ts
|
|
1556
|
+
/**
|
|
1557
|
+
* Two spec defects account for every assertion below:
|
|
1558
|
+
*
|
|
1559
|
+
* - Only the delete declares a response body; the other six answer a contentless `default`, so each
|
|
1560
|
+
* return is asserted in from `./types`.
|
|
1561
|
+
* - `fileId` is a `number` on the delete and the content read, a `string` on the other four — one id,
|
|
1562
|
+
* typed both ways, so the string arms take `String(fileId)`.
|
|
1563
|
+
*/
|
|
1564
|
+
const createFiles = (openApiClient) => {
|
|
1565
|
+
const getFile = async (fileId, signal) => {
|
|
1566
|
+
const { data } = await openApiClient.get("/v2/storage/files/{fileId}", { path: { fileId: String(fileId) } }, { signal });
|
|
1567
|
+
return data;
|
|
1568
|
+
};
|
|
1569
|
+
const getFiles = async (query, signal) => {
|
|
1570
|
+
const { data } = await openApiClient.get("/v2/storage/files", { query }, {
|
|
1571
|
+
signal,
|
|
1572
|
+
queryArrayFormat: "brackets"
|
|
1573
|
+
});
|
|
1574
|
+
return data;
|
|
1575
|
+
};
|
|
1576
|
+
const deleteFile = async (fileId) => {
|
|
1577
|
+
await openApiClient.delete("/v2/storage/files/{fileId}", { path: { fileId } });
|
|
1578
|
+
};
|
|
1579
|
+
const addFileTag = async (fileId, tag) => {
|
|
1580
|
+
await openApiClient.post("/v2/storage/files/{fileId}/tags", {
|
|
1581
|
+
path: { fileId: String(fileId) },
|
|
1582
|
+
body: { tag }
|
|
1583
|
+
});
|
|
1584
|
+
};
|
|
1585
|
+
const getFileContent = async (fileId, signal) => {
|
|
1586
|
+
const { data } = await openApiClient.get("/v2/storage/files/{fileId}/content", { path: { fileId } }, { signal });
|
|
1587
|
+
const content = data;
|
|
1588
|
+
return typeof content === "string" ? content : JSON.stringify(content, null, 2);
|
|
1589
|
+
};
|
|
1590
|
+
const deleteFileTag = async (fileId, tagName) => {
|
|
1591
|
+
await openApiClient.delete("/v2/storage/files/{fileId}/tags/{tagName}", { path: {
|
|
1592
|
+
fileId: String(fileId),
|
|
1593
|
+
tagName
|
|
1594
|
+
} });
|
|
1595
|
+
};
|
|
1596
|
+
const prepareFile = async (body, signal) => {
|
|
1597
|
+
const { data } = await openApiClient.post("/v2/storage/files/prepare", { body }, { signal });
|
|
1598
|
+
return data;
|
|
1599
|
+
};
|
|
1600
|
+
return {
|
|
1601
|
+
getFile,
|
|
1602
|
+
getFileContent,
|
|
1603
|
+
getFiles,
|
|
1604
|
+
deleteFile,
|
|
1605
|
+
addFileTag,
|
|
1606
|
+
deleteFileTag,
|
|
1607
|
+
prepareFile
|
|
1608
|
+
};
|
|
1609
|
+
};
|
|
1610
|
+
//#endregion
|
|
1611
|
+
//#region src/clients/storage/jobs/jobs.ts
|
|
1612
|
+
/**
|
|
1613
|
+
* Both returns are asserted in, and `Job<T>` is the contract to trust.
|
|
1614
|
+
*
|
|
1615
|
+
* - The spec's `JobResponse` is a flat shape with `status: string`; `Job<T>` is a discriminated union
|
|
1616
|
+
* over `status` whose `results` is typed per operation.
|
|
1617
|
+
* - The detail operation declares a contentless `default` response, so its `data` is not a job at all
|
|
1618
|
+
* as far as the schema is concerned.
|
|
1619
|
+
*/
|
|
1620
|
+
const createJobs = (openApiClient) => {
|
|
1621
|
+
const getJob = async (jobId, signal) => {
|
|
1622
|
+
const { data } = await openApiClient.get("/v2/storage/jobs/{jobId}", { path: { jobId: String(jobId) } }, { signal });
|
|
1623
|
+
return data;
|
|
1624
|
+
};
|
|
1625
|
+
const getJobs = async (query, signal) => {
|
|
1626
|
+
const { data } = await openApiClient.get("/v2/storage/jobs", { query }, {
|
|
1627
|
+
signal,
|
|
1628
|
+
queryArrayFormat: "brackets"
|
|
1629
|
+
});
|
|
1630
|
+
return data;
|
|
1631
|
+
};
|
|
1632
|
+
return {
|
|
1633
|
+
getJob,
|
|
1634
|
+
getJobs
|
|
1635
|
+
};
|
|
1636
|
+
};
|
|
1637
|
+
//#endregion
|
|
1638
|
+
//#region src/clients/storage/poller.ts
|
|
1639
|
+
const DEFAULT_POLL_INTERVAL = 2e3;
|
|
1640
|
+
const createJobPoller = ({ getJob }) => ({ id, operationName }, { interval, maxAttempts, timeout, signal } = {}) => require_jobStatus.poller({
|
|
1641
|
+
pollKey: ["storage.job", {
|
|
1642
|
+
jobId: id,
|
|
1643
|
+
operation: operationName
|
|
1644
|
+
}],
|
|
1645
|
+
pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),
|
|
1646
|
+
until: ({ data }) => require_jobStatus.jobStatus.storage.isTerminal(data.status),
|
|
1647
|
+
backoff: {
|
|
1648
|
+
type: "constant",
|
|
1649
|
+
interval: interval ?? DEFAULT_POLL_INTERVAL
|
|
1650
|
+
},
|
|
1651
|
+
maxAttempts,
|
|
1652
|
+
timeout,
|
|
1653
|
+
signal
|
|
1654
|
+
});
|
|
1655
|
+
//#endregion
|
|
1656
|
+
//#region src/clients/storage/refreshTokenMiddleware.ts
|
|
1657
|
+
const isTokenRefreshEndpoint = (request) => {
|
|
1658
|
+
const url = new URL(request.url);
|
|
1659
|
+
return request.method === "POST" && /\/tokens\/[^/]+\/refresh$/.test(url.pathname);
|
|
1660
|
+
};
|
|
1661
|
+
const tryParseNewToken = (data) => {
|
|
1662
|
+
if (data === null || typeof data !== "object") return null;
|
|
1663
|
+
const token = data.token;
|
|
1664
|
+
return typeof token === "string" ? token : null;
|
|
1665
|
+
};
|
|
1666
|
+
const createRefreshTokenMiddlware = ({ accessToken, onRefresh }) => {
|
|
1667
|
+
let current = accessToken;
|
|
1668
|
+
return (next) => async (request) => {
|
|
1669
|
+
request.request.headers.set(require_createFetchClient.KeboolaHttpHeader.STORAGE_API_TOKEN, current);
|
|
1670
|
+
if (!isTokenRefreshEndpoint(request.request)) return next(request);
|
|
1671
|
+
const response = await next(request);
|
|
1672
|
+
const newToken = tryParseNewToken(response.data);
|
|
1673
|
+
if (newToken === null) return response;
|
|
1674
|
+
current = newToken;
|
|
1675
|
+
onRefresh?.(current);
|
|
1676
|
+
return response;
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
//#endregion
|
|
1680
|
+
//#region src/clients/storage/search/search.ts
|
|
1681
|
+
/**
|
|
1682
|
+
* Both responses are asserted in, because the spec stubs them:
|
|
1683
|
+
*
|
|
1684
|
+
* - `GET /v2/storage/global-search` (`SearchAction`) declares its 200 as `Record<string, never>` →
|
|
1685
|
+
* really `{ all, items, byType, byProject }`
|
|
1686
|
+
* - `GET /v2/storage/search/tables` (`SearchTablesAction`) declares a contentless 200 → really
|
|
1687
|
+
* `Table[]`
|
|
1688
|
+
*
|
|
1689
|
+
* Both query casts are type-only, so each query object reaches the wire exactly as the caller wrote
|
|
1690
|
+
* it. That matters for `global-search`: the spec names its repeatable filters `types[]` / `projectIds[]`
|
|
1691
|
+
* / `branchTypes[]` / `branchIds[]`, but this endpoint has always been called with the bare names,
|
|
1692
|
+
* which `qs` serializes as `types[0]=bucket&types[1]=table` — also an array to the backend. Renaming
|
|
1693
|
+
* the fields to satisfy the document would change what Storage receives, and no test would catch it.
|
|
1694
|
+
*/
|
|
1695
|
+
const createSearch = (client) => {
|
|
1696
|
+
/**
|
|
1697
|
+
* Project- and organization-wide search across buckets, tables, configurations, flows, ….
|
|
1698
|
+
*
|
|
1699
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/global-search/GET/v2/storage/global-search
|
|
1700
|
+
*/
|
|
1701
|
+
const globalSearch = async (query, signal) => {
|
|
1702
|
+
const { data } = await client.get("/v2/storage/global-search", { query }, { signal });
|
|
1703
|
+
return data;
|
|
1704
|
+
};
|
|
1705
|
+
/**
|
|
1706
|
+
* Finds tables by a metadata key, value or provider, across the whole project.
|
|
1707
|
+
*
|
|
1708
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/search/GET/v2/storage/search/tables
|
|
1709
|
+
*/
|
|
1710
|
+
const searchTables = async (query, signal) => {
|
|
1711
|
+
const { data } = await client.get("/v2/storage/search/tables", { query }, {
|
|
1712
|
+
signal,
|
|
1713
|
+
queryArrayFormat: "comma"
|
|
1714
|
+
});
|
|
1715
|
+
return data;
|
|
1716
|
+
};
|
|
1717
|
+
return {
|
|
1718
|
+
globalSearch,
|
|
1719
|
+
searchTables
|
|
1720
|
+
};
|
|
1721
|
+
};
|
|
1722
|
+
//#endregion
|
|
1723
|
+
//#region src/clients/storage/snapshots/snapshots.ts
|
|
1724
|
+
const createSnapshots = (client) => {
|
|
1725
|
+
/**
|
|
1726
|
+
* Creates a snapshot of a table in the given branch. Async — returns a job.
|
|
1727
|
+
*
|
|
1728
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/POST/v2/storage/branch/{branchId}/tables/{id}/snapshots
|
|
1729
|
+
*/
|
|
1730
|
+
const createSnapshotAsync = async ({ branchId, tableId, ...body }, signal) => {
|
|
1731
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/tables/{id}/snapshots", {
|
|
1732
|
+
path: {
|
|
1733
|
+
branchId,
|
|
1734
|
+
id: tableId
|
|
1735
|
+
},
|
|
1736
|
+
body
|
|
1737
|
+
}, { signal });
|
|
1738
|
+
return data;
|
|
1739
|
+
};
|
|
1740
|
+
/**
|
|
1741
|
+
* Reads a single snapshot. Not branch-scoped — a snapshot id is unique across branches.
|
|
1742
|
+
*
|
|
1743
|
+
* The swagger stubs the operation (a single `default` response with no body), so the shape is
|
|
1744
|
+
* asserted in; it is the same `Snapshot` the table listing returns.
|
|
1745
|
+
*
|
|
1746
|
+
* @link https://api.keboola.com/?service=storage#storage/GET/v2/storage/snapshots/{snapshotId}
|
|
1747
|
+
*/
|
|
1748
|
+
const getSnapshot = async (snapshotId, signal) => {
|
|
1749
|
+
const { data } = await client.get("/v2/storage/snapshots/{snapshotId}", { path: { snapshotId } }, { signal });
|
|
1750
|
+
return data;
|
|
1751
|
+
};
|
|
1752
|
+
/**
|
|
1753
|
+
* Deletes a snapshot, returning the storage job that performs it (`null` when the backend answers
|
|
1754
|
+
* with no content). The endpoint is not branch-scoped — a snapshot id is unique across branches, so
|
|
1755
|
+
* there is no `/branch/{branchId}/snapshots/{snapshotId}` variant.
|
|
1756
|
+
*
|
|
1757
|
+
* The swagger documents a single bodyless `default` response, so the job is asserted in.
|
|
1758
|
+
*
|
|
1759
|
+
* @link https://api.keboola.com/?service=storage#storage/DELETE/v2/storage/snapshots/{snapshotId}
|
|
1760
|
+
*/
|
|
1761
|
+
const deleteSnapshotAsync = async (snapshotId, signal) => {
|
|
1762
|
+
const { data } = await client.delete("/v2/storage/snapshots/{snapshotId}", { path: { snapshotId } }, { signal });
|
|
1763
|
+
return data;
|
|
1764
|
+
};
|
|
1765
|
+
/**
|
|
1766
|
+
* Lists the snapshots of a table in the given branch.
|
|
1767
|
+
*
|
|
1768
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/GET/v2/storage/branch/{branchId}/tables/{id}/snapshots
|
|
1769
|
+
*/
|
|
1770
|
+
const getTableSnapshots = async ({ branchId, tableId, ...query }, signal) => {
|
|
1771
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/tables/{id}/snapshots", {
|
|
1772
|
+
path: {
|
|
1773
|
+
branchId,
|
|
1774
|
+
id: tableId
|
|
1775
|
+
},
|
|
1776
|
+
query
|
|
1777
|
+
}, { signal });
|
|
1778
|
+
return data;
|
|
1779
|
+
};
|
|
1780
|
+
return {
|
|
1781
|
+
createSnapshotAsync,
|
|
1782
|
+
deleteSnapshotAsync,
|
|
1783
|
+
getSnapshot,
|
|
1784
|
+
getTableSnapshots
|
|
1785
|
+
};
|
|
1786
|
+
};
|
|
1787
|
+
//#endregion
|
|
1788
|
+
//#region src/clients/storage/stats/stats.ts
|
|
1789
|
+
/**
|
|
1790
|
+
* `GET /v2/storage/stats` (`StatsListAction`) declares a single contentless `default` response, so the
|
|
1791
|
+
* generated return type is the response envelope (`{ headers, content?: never }`) rather than a
|
|
1792
|
+
* payload — hence the assertion to the hand-authored `RunIdStats`. The `runId` query is spec-derived.
|
|
1793
|
+
*/
|
|
1794
|
+
const createStats = (client) => {
|
|
1795
|
+
/**
|
|
1796
|
+
* Returns import/export table stats for a job run, identified by its runId.
|
|
1797
|
+
*
|
|
1798
|
+
* @link https://api.keboola.com/?service=storage#storage/GET/v2/storage/stats
|
|
1799
|
+
*/
|
|
1800
|
+
const getRunIdStats = async (runId, signal) => {
|
|
1801
|
+
const { data } = await client.get("/v2/storage/stats", { query: { runId } }, { signal });
|
|
1802
|
+
return data;
|
|
1803
|
+
};
|
|
1804
|
+
return { getRunIdStats };
|
|
1805
|
+
};
|
|
1806
|
+
//#endregion
|
|
1807
|
+
//#region src/clients/storage/tables/tables.ts
|
|
1808
|
+
const createTables = (openApiClient, client) => {
|
|
1809
|
+
/**
|
|
1810
|
+
* Returns every table in the given branch. Filter client-side by
|
|
1811
|
+
* `table.bucket?.id` (requires `include: ['buckets']`) or by the
|
|
1812
|
+
* `{bucketId}.` prefix in `table.id` (IDs use `{bucketId}.{tableName}`,
|
|
1813
|
+
* e.g. `in.c-main.users`).
|
|
1814
|
+
*
|
|
1815
|
+
* @link https://api.keboola.com/?service=storage#storage/GET/v2/storage/branch/{branchId}/tables
|
|
1816
|
+
*/
|
|
1817
|
+
const getTables = async ({ branchId, include = [], ...query }, signal) => {
|
|
1818
|
+
const { data } = await openApiClient.get("/v2/storage/branch/{branchId}/tables", {
|
|
1819
|
+
path: { branchId },
|
|
1820
|
+
query: {
|
|
1821
|
+
include,
|
|
1822
|
+
...query
|
|
1823
|
+
}
|
|
1824
|
+
}, {
|
|
1825
|
+
signal,
|
|
1826
|
+
queryArrayFormat: "comma"
|
|
1827
|
+
});
|
|
1828
|
+
return data;
|
|
1829
|
+
};
|
|
1830
|
+
/**
|
|
1831
|
+
* Returns a table from the given branch. A dev branch only contains the tables created or pulled
|
|
1832
|
+
* into it, so a production table must be read with the default branch id.
|
|
1833
|
+
*
|
|
1834
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/GET/v2/storage/branch/{branchId}/tables/{id}
|
|
1835
|
+
*/
|
|
1836
|
+
const getTable = async ({ branchId, id }, signal) => {
|
|
1837
|
+
const { data } = await openApiClient.get("/v2/storage/branch/{branchId}/tables/{id}", { path: {
|
|
1838
|
+
branchId,
|
|
1839
|
+
id
|
|
1840
|
+
} }, { signal });
|
|
1841
|
+
return data;
|
|
1842
|
+
};
|
|
1843
|
+
/**
|
|
1844
|
+
* Deletes a table (synchronous). `force` also drops the aliases and links pointing at it, which
|
|
1845
|
+
* the API otherwise refuses.
|
|
1846
|
+
*
|
|
1847
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/DELETE/v2/storage/branch/{branchId}/tables/{id}
|
|
1848
|
+
*/
|
|
1849
|
+
const deleteTable = async ({ branchId, id, ...query }, signal) => {
|
|
1850
|
+
await openApiClient.delete("/v2/storage/branch/{branchId}/tables/{id}", {
|
|
1851
|
+
path: {
|
|
1852
|
+
branchId,
|
|
1853
|
+
id
|
|
1854
|
+
},
|
|
1855
|
+
query
|
|
1856
|
+
}, { signal });
|
|
1857
|
+
};
|
|
1858
|
+
const deleteTables = async ({ branchId, ids, force }) => {
|
|
1859
|
+
await require_concurrent.concurrent({
|
|
1860
|
+
items: ids,
|
|
1861
|
+
process: (id) => deleteTable({
|
|
1862
|
+
branchId,
|
|
1863
|
+
id,
|
|
1864
|
+
force
|
|
1865
|
+
})
|
|
1866
|
+
});
|
|
1867
|
+
};
|
|
1868
|
+
const deleteTableRows = async ({ branchId, id, ...query }, signal) => {
|
|
1869
|
+
const { data } = await openApiClient.delete("/v2/storage/branch/{branchId}/tables/{id}/rows", {
|
|
1870
|
+
path: {
|
|
1871
|
+
branchId,
|
|
1872
|
+
id
|
|
1873
|
+
},
|
|
1874
|
+
query
|
|
1875
|
+
}, { signal });
|
|
1876
|
+
return data;
|
|
1877
|
+
};
|
|
1878
|
+
/**
|
|
1879
|
+
* Returns the first rows of a table in the given branch.
|
|
1880
|
+
*
|
|
1881
|
+
* The swagger declares `query?: never` here, so it cannot express `limit` / `whereFilters` /
|
|
1882
|
+
* `orderBy` / `fulltextSearch`, all of which the endpoint accepts — hence the hand-authored
|
|
1883
|
+
* `GetDataPreviewQuery` and the asserted query.
|
|
1884
|
+
*
|
|
1885
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/GET/v2/storage/branch/{branchId}/tables/{tableId}/data-preview
|
|
1886
|
+
*/
|
|
1887
|
+
const getDataPreview = async ({ branchId, tableId, ...query }, signal) => {
|
|
1888
|
+
const { data } = await openApiClient.get("/v2/storage/branch/{branchId}/tables/{tableId}/data-preview", {
|
|
1889
|
+
path: {
|
|
1890
|
+
branchId,
|
|
1891
|
+
tableId
|
|
1892
|
+
},
|
|
1893
|
+
query: {
|
|
1894
|
+
format: "json",
|
|
1895
|
+
...query
|
|
1896
|
+
}
|
|
1897
|
+
}, { signal });
|
|
1898
|
+
return data;
|
|
1899
|
+
};
|
|
1900
|
+
/**
|
|
1901
|
+
* Exports a table to a file. Async — returns a job.
|
|
1902
|
+
*
|
|
1903
|
+
* Unbranched, though the document also declares
|
|
1904
|
+
* `/v2/storage/branch/{branchId}/tables/{tableId}/export-async`: export was outside the scope of
|
|
1905
|
+
* the table migration (UT-4785), so switching it would change behaviour for a flow that migration
|
|
1906
|
+
* did not touch. It is the one remaining branch-capable method here that does not take a
|
|
1907
|
+
* `branchId`, and moving it is a clean follow-up.
|
|
1908
|
+
*
|
|
1909
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/POST/v2/storage/tables/{tableId}/export-async
|
|
1910
|
+
*/
|
|
1911
|
+
const exportAsync = async ({ tableId, ...body }, signal) => {
|
|
1912
|
+
const { data } = await openApiClient.post("/v2/storage/tables/{tableId}/export-async", {
|
|
1913
|
+
path: { tableId },
|
|
1914
|
+
body
|
|
1915
|
+
}, { signal });
|
|
1916
|
+
return data;
|
|
1917
|
+
};
|
|
1918
|
+
const createTableAsync = async ({ branchId, id, ...body }, signal) => {
|
|
1919
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{id}/tables-async", {
|
|
1920
|
+
path: {
|
|
1921
|
+
branchId,
|
|
1922
|
+
id
|
|
1923
|
+
},
|
|
1924
|
+
body
|
|
1925
|
+
}, { signal });
|
|
1926
|
+
return data;
|
|
1927
|
+
};
|
|
1928
|
+
/**
|
|
1929
|
+
* Creates a typed table from an explicit column definition (no data) in the given bucket.
|
|
1930
|
+
* The endpoint is async: it returns a `tableDefinitionCreate` storage job the caller can poll.
|
|
1931
|
+
*
|
|
1932
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/buckets/POST/v2/storage/branch/{branchId}/buckets/{bucketId}/tables-definition
|
|
1933
|
+
*/
|
|
1934
|
+
const createTableDefinitionAsync = async ({ branchId, bucketId, ...body }, signal) => {
|
|
1935
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/buckets/{bucketId}/tables-definition", {
|
|
1936
|
+
path: {
|
|
1937
|
+
branchId,
|
|
1938
|
+
bucketId
|
|
1939
|
+
},
|
|
1940
|
+
body
|
|
1941
|
+
}, { signal });
|
|
1942
|
+
return data;
|
|
1943
|
+
};
|
|
1944
|
+
const importAsync = async ({ branchId, id, ...body }, signal) => {
|
|
1945
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/tables/{id}/import-async", {
|
|
1946
|
+
path: {
|
|
1947
|
+
branchId,
|
|
1948
|
+
id
|
|
1949
|
+
},
|
|
1950
|
+
body
|
|
1951
|
+
}, { signal });
|
|
1952
|
+
return data;
|
|
1953
|
+
};
|
|
1954
|
+
/**
|
|
1955
|
+
* Updates a table's definition in place — `displayName`, `description`,
|
|
1956
|
+
* `isDescriptionSystemManaged`, and per-column
|
|
1957
|
+
* `length`/`nullable`/`default`/`description`. The endpoint is async: it
|
|
1958
|
+
* returns a `tableDefinitionUpdate` storage job that the caller can poll.
|
|
1959
|
+
*
|
|
1960
|
+
* Send only the fields being changed; at least one is required. Description
|
|
1961
|
+
* patches apply to non-typed tables too, so a description-only edit needs
|
|
1962
|
+
* neither `displayName` nor `columns`.
|
|
1963
|
+
*
|
|
1964
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/PUT/v2/storage/branch/{branchId}/tables/{tableId}/definition
|
|
1965
|
+
*/
|
|
1966
|
+
const updateTableDefinition = async ({ branchId, tableId, ...body }, signal) => {
|
|
1967
|
+
const { data } = await openApiClient.put("/v2/storage/branch/{branchId}/tables/{tableId}/definition", {
|
|
1968
|
+
path: {
|
|
1969
|
+
branchId,
|
|
1970
|
+
tableId
|
|
1971
|
+
},
|
|
1972
|
+
body
|
|
1973
|
+
}, { signal });
|
|
1974
|
+
return data;
|
|
1975
|
+
};
|
|
1976
|
+
/**
|
|
1977
|
+
* Updates a table's display name (synchronous). For typed-table column/definition changes use
|
|
1978
|
+
* `updateTableDefinition` instead.
|
|
1979
|
+
*
|
|
1980
|
+
* On the generic client and unbranched, unlike its siblings — but only because of where the
|
|
1981
|
+
* endpoint lives, not because of what it supports. It is still `Storage_TablesController::putAction`
|
|
1982
|
+
* in connection's legacy Zend app, and the Storage document is generated from the `#[OA\...]`
|
|
1983
|
+
* attributes on the migrated Symfony controllers, so no annotation fix closes this gap; the
|
|
1984
|
+
* controller has to move first. The action does take a `DevBranch`, and `put` is in the
|
|
1985
|
+
* branch-implemented route list, so `/branch/{branchId}/tables/{id}` works — there is simply no
|
|
1986
|
+
* `paths` entry to derive it from, and the branch prefix is left to the caller's middleware.
|
|
1987
|
+
*
|
|
1988
|
+
* The synchronous form this calls is deprecated backend-side (`DEPRECATION_SYNC_UPDATE_TABLE` is
|
|
1989
|
+
* logged per request); `?async=true` returns a `tableUpdate` job instead. Switching means polling,
|
|
1990
|
+
* so it belongs with the caller that renames tables, not here.
|
|
1991
|
+
*
|
|
1992
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables
|
|
1993
|
+
*/
|
|
1994
|
+
const updateTable = async ({ tableId, ...body }, signal) => {
|
|
1995
|
+
const { data } = await client.put("/v2/storage/tables/{id}", {
|
|
1996
|
+
path: { id: tableId },
|
|
1997
|
+
body
|
|
1998
|
+
}, { signal });
|
|
1999
|
+
return data;
|
|
2000
|
+
};
|
|
2001
|
+
/**
|
|
2002
|
+
* Pulls a table from the default branch into the given dev branch.
|
|
2003
|
+
*
|
|
2004
|
+
* The path is branch-scoped: the unbranched `/v2/storage/tables/{id}/pull` this used to call is
|
|
2005
|
+
* absent from the Storage document and 404s for every table (the live nightly caught it), because
|
|
2006
|
+
* nothing in it says which branch to pull into.
|
|
2007
|
+
*
|
|
2008
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables
|
|
2009
|
+
*/
|
|
2010
|
+
const pullTableAsync = async ({ branchId, id }, signal) => {
|
|
2011
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/tables/{id}/pull", { path: {
|
|
2012
|
+
branchId,
|
|
2013
|
+
id
|
|
2014
|
+
} }, { signal });
|
|
2015
|
+
return data;
|
|
2016
|
+
};
|
|
2017
|
+
/**
|
|
2018
|
+
* Creates an alias table in the given bucket. Usually returns the created alias `Table`
|
|
2019
|
+
* synchronously; for BigQuery VIEW-persisted aliases the API instead returns an `aliasCreate`
|
|
2020
|
+
* storage job, so the response is typed as a union — narrow on `operationName` before use.
|
|
2021
|
+
*
|
|
2022
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables
|
|
2023
|
+
*/
|
|
2024
|
+
const createAliasTable = async ({ bucketId, ...body }, signal) => {
|
|
2025
|
+
const { data } = await client.post("/v2/storage/buckets/{bucketId}/table-aliases", {
|
|
2026
|
+
path: { bucketId },
|
|
2027
|
+
body
|
|
2028
|
+
}, { signal });
|
|
2029
|
+
return data;
|
|
2030
|
+
};
|
|
2031
|
+
/**
|
|
2032
|
+
* Sets (replaces) the filter of an alias table (synchronous).
|
|
2033
|
+
*
|
|
2034
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables
|
|
2035
|
+
*/
|
|
2036
|
+
const setAliasTableFilter = async ({ tableId, ...body }, signal) => {
|
|
2037
|
+
const { data } = await openApiClient.post("/v2/storage/tables/{tableId}/alias-filter", {
|
|
2038
|
+
path: { tableId },
|
|
2039
|
+
body
|
|
2040
|
+
}, { signal });
|
|
2041
|
+
return data;
|
|
2042
|
+
};
|
|
2043
|
+
/**
|
|
2044
|
+
* Removes the filter of an alias table (synchronous).
|
|
2045
|
+
*
|
|
2046
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables
|
|
2047
|
+
*/
|
|
2048
|
+
const removeAliasTableFilter = async (tableId, signal) => {
|
|
2049
|
+
await openApiClient.delete("/v2/storage/tables/{tableId}/alias-filter", { path: { tableId } }, { signal });
|
|
2050
|
+
};
|
|
2051
|
+
/**
|
|
2052
|
+
* Adds or updates metadata on a table in the given branch, and on its columns when the payload
|
|
2053
|
+
* names any — which is why the response carries `columnsMetadata` alongside `metadata`.
|
|
2054
|
+
*
|
|
2055
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/POST/v2/storage/branch/{branchId}/tables/{id}/metadata
|
|
2056
|
+
*/
|
|
2057
|
+
const saveTableMetadata = async ({ branchId, id, ...body }, signal) => {
|
|
2058
|
+
const { data } = await openApiClient.post("/v2/storage/branch/{branchId}/tables/{id}/metadata", {
|
|
2059
|
+
path: {
|
|
2060
|
+
branchId,
|
|
2061
|
+
id
|
|
2062
|
+
},
|
|
2063
|
+
body
|
|
2064
|
+
}, { signal });
|
|
2065
|
+
return data;
|
|
2066
|
+
};
|
|
2067
|
+
/**
|
|
2068
|
+
* Deletes a single metadata entry from a table in the given branch.
|
|
2069
|
+
*
|
|
2070
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tables/DELETE/v2/storage/branch/{branchId}/tables/{id}/metadata/{metadataId}
|
|
2071
|
+
*/
|
|
2072
|
+
const deleteTableMetadata = async ({ branchId, id, metadataId }, signal) => {
|
|
2073
|
+
await openApiClient.delete("/v2/storage/branch/{branchId}/tables/{id}/metadata/{metadataId}", { path: {
|
|
2074
|
+
branchId,
|
|
2075
|
+
id,
|
|
2076
|
+
metadataId
|
|
2077
|
+
} }, { signal });
|
|
2078
|
+
};
|
|
2079
|
+
return {
|
|
2080
|
+
getTables,
|
|
2081
|
+
getTable,
|
|
2082
|
+
getDataPreview,
|
|
2083
|
+
deleteTable,
|
|
2084
|
+
deleteTables,
|
|
2085
|
+
deleteTableRows,
|
|
2086
|
+
exportAsync,
|
|
2087
|
+
createTableAsync,
|
|
2088
|
+
createTableDefinitionAsync,
|
|
2089
|
+
importAsync,
|
|
2090
|
+
updateTableDefinition,
|
|
2091
|
+
updateTable,
|
|
2092
|
+
pullTableAsync,
|
|
2093
|
+
createAliasTable,
|
|
2094
|
+
setAliasTableFilter,
|
|
2095
|
+
removeAliasTableFilter,
|
|
2096
|
+
saveTableMetadata,
|
|
2097
|
+
deleteTableMetadata
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
//#endregion
|
|
2101
|
+
//#region src/clients/storage/tokens/tokens.ts
|
|
2102
|
+
/**
|
|
2103
|
+
* The `as` casts below work around a broken generated schema, not our own types:
|
|
2104
|
+
*
|
|
2105
|
+
* - id path params typed `number`; every id the API returns is a `string`
|
|
2106
|
+
* - `UpdateTokenRequest` / `ShareTokenRequest` modelled as empty objects
|
|
2107
|
+
* - update `200` declares no body, but returns the updated token
|
|
2108
|
+
* - create body marks fields required that the API defaults
|
|
2109
|
+
*
|
|
2110
|
+
* `./types` holds the real contracts. Drop each cast as the backend fixes the schema.
|
|
2111
|
+
*/
|
|
2112
|
+
const createTokens = (client) => {
|
|
2113
|
+
const verify = async (signal) => {
|
|
2114
|
+
const { data } = await client.get("/v2/storage/tokens/verify", {}, { signal });
|
|
2115
|
+
return data;
|
|
2116
|
+
};
|
|
2117
|
+
const refresh = async (id, signal) => {
|
|
2118
|
+
const { data } = await client.post("/v2/storage/tokens/{id}/refresh", { path: { id } }, { signal });
|
|
2119
|
+
return data;
|
|
2120
|
+
};
|
|
2121
|
+
/**
|
|
2122
|
+
* Lists storage tokens accessible by the current token.
|
|
2123
|
+
*
|
|
2124
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tokens/GET/v2/storage/tokens
|
|
2125
|
+
*/
|
|
2126
|
+
const getTokens = async (signal) => {
|
|
2127
|
+
const { data } = await client.get("/v2/storage/tokens", {}, { signal });
|
|
2128
|
+
return data;
|
|
2129
|
+
};
|
|
2130
|
+
/**
|
|
2131
|
+
* Creates a new storage token. The response includes the freshly issued `token` secret.
|
|
2132
|
+
*
|
|
2133
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tokens/POST/v2/storage/tokens
|
|
2134
|
+
*/
|
|
2135
|
+
const createToken = async (body, signal) => {
|
|
2136
|
+
const { data } = await client.post("/v2/storage/tokens", { body }, { signal });
|
|
2137
|
+
return data;
|
|
2138
|
+
};
|
|
2139
|
+
/**
|
|
2140
|
+
* Updates an existing storage token (description, permissions, expiration, …).
|
|
2141
|
+
*
|
|
2142
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tokens/PUT/v2/storage/tokens/{id}
|
|
2143
|
+
*/
|
|
2144
|
+
const updateToken = async ({ id, ...body }, signal) => {
|
|
2145
|
+
const { data } = await client.put("/v2/storage/tokens/{id}", {
|
|
2146
|
+
path: { id },
|
|
2147
|
+
body
|
|
2148
|
+
}, { signal });
|
|
2149
|
+
return data;
|
|
2150
|
+
};
|
|
2151
|
+
/**
|
|
2152
|
+
* Deletes a storage token.
|
|
2153
|
+
*
|
|
2154
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tokens/DELETE/v2/storage/tokens/{id}
|
|
2155
|
+
*/
|
|
2156
|
+
const deleteToken = async (id, signal) => {
|
|
2157
|
+
await client.delete("/v2/storage/tokens/{id}", { path: { id } }, { signal });
|
|
2158
|
+
};
|
|
2159
|
+
/**
|
|
2160
|
+
* Shares a storage token with another user by email.
|
|
2161
|
+
*
|
|
2162
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tokens/POST/v2/storage/tokens/{id}/share
|
|
2163
|
+
*/
|
|
2164
|
+
const shareToken = async ({ id, ...body }, signal) => {
|
|
2165
|
+
await client.post("/v2/storage/tokens/{id}/share", {
|
|
2166
|
+
path: { id },
|
|
2167
|
+
body
|
|
2168
|
+
}, { signal });
|
|
2169
|
+
};
|
|
2170
|
+
/**
|
|
2171
|
+
* Event feed of a single token — what that token did, not what happened to it.
|
|
2172
|
+
*
|
|
2173
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/tokens/GET/v2/storage/tokens/{id}/events
|
|
2174
|
+
*/
|
|
2175
|
+
const getTokenEvents = async ({ id, ...query }, signal) => {
|
|
2176
|
+
const { data } = await client.get("/v2/storage/tokens/{id}/events", {
|
|
2177
|
+
path: { id },
|
|
2178
|
+
query
|
|
2179
|
+
}, { signal });
|
|
2180
|
+
return data;
|
|
2181
|
+
};
|
|
2182
|
+
return {
|
|
2183
|
+
verify,
|
|
2184
|
+
refresh,
|
|
2185
|
+
getTokens,
|
|
2186
|
+
createToken,
|
|
2187
|
+
updateToken,
|
|
2188
|
+
deleteToken,
|
|
2189
|
+
shareToken,
|
|
2190
|
+
getTokenEvents
|
|
2191
|
+
};
|
|
2192
|
+
};
|
|
2193
|
+
//#endregion
|
|
2194
|
+
//#region src/clients/storage/triggers/triggers.ts
|
|
2195
|
+
const createTriggers = (client) => {
|
|
2196
|
+
/**
|
|
2197
|
+
* Lists triggers in the project, optionally filtered by component / configuration.
|
|
2198
|
+
*
|
|
2199
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/triggers/GET/v2/storage/triggers
|
|
2200
|
+
*/
|
|
2201
|
+
const getTriggers = async (query, signal) => {
|
|
2202
|
+
const { data } = await client.get("/v2/storage/triggers", { query }, { signal });
|
|
2203
|
+
return data;
|
|
2204
|
+
};
|
|
2205
|
+
/**
|
|
2206
|
+
* Creates a new trigger for a component configuration.
|
|
2207
|
+
*
|
|
2208
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/triggers/POST/v2/storage/triggers
|
|
2209
|
+
*/
|
|
2210
|
+
const createTrigger = async (body, signal) => {
|
|
2211
|
+
const { data } = await client.post("/v2/storage/triggers", { body }, { signal });
|
|
2212
|
+
return data;
|
|
2213
|
+
};
|
|
2214
|
+
/**
|
|
2215
|
+
* Updates an existing trigger, patching only the fields the input carries.
|
|
2216
|
+
*
|
|
2217
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/triggers/PUT/v2/storage/triggers/{triggerId}
|
|
2218
|
+
*/
|
|
2219
|
+
const updateTrigger = async ({ triggerId, ...body }, signal) => {
|
|
2220
|
+
const { data } = await client.put("/v2/storage/triggers/{triggerId}", {
|
|
2221
|
+
path: { triggerId },
|
|
2222
|
+
body
|
|
2223
|
+
}, { signal });
|
|
2224
|
+
return data;
|
|
2225
|
+
};
|
|
2226
|
+
/**
|
|
2227
|
+
* Deletes a trigger.
|
|
2228
|
+
*
|
|
2229
|
+
* @link https://api.keboola.com/?service=storage#storage/tag/triggers/DELETE/v2/storage/triggers/{triggerId}
|
|
2230
|
+
*/
|
|
2231
|
+
const deleteTrigger = async (triggerId, signal) => {
|
|
2232
|
+
await client.delete("/v2/storage/triggers/{triggerId}", { path: { triggerId } }, { signal });
|
|
2233
|
+
};
|
|
2234
|
+
return {
|
|
2235
|
+
getTriggers,
|
|
2236
|
+
createTrigger,
|
|
2237
|
+
updateTrigger,
|
|
2238
|
+
deleteTrigger
|
|
2239
|
+
};
|
|
2240
|
+
};
|
|
2241
|
+
//#endregion
|
|
2242
|
+
//#region src/clients/storage/workspaces/workspaces.ts
|
|
2243
|
+
/**
|
|
2244
|
+
* Paths, queries and bodies come from the spec; only the returns are asserted in.
|
|
2245
|
+
*
|
|
2246
|
+
* - `WorkspaceDetailResponse` describes a narrower connection than callers get, so `Workspace` is
|
|
2247
|
+
* hand-authored (see `./types`) — that covers the list, detail and public-key returns.
|
|
2248
|
+
* - The password, SSO and delete operations answer a contentless `default`.
|
|
2249
|
+
* - `JobResponse` is a flat shape with `status: string`, while `Job<T>` is a discriminated union over
|
|
2250
|
+
* `status` carrying typed `results`.
|
|
2251
|
+
*
|
|
2252
|
+
* `workspaceId` is a `number` in every input; the operations whose spec segment is a `string` take
|
|
2253
|
+
* `String(workspaceId)` here rather than pushing the spec's inconsistency onto callers.
|
|
2254
|
+
*/
|
|
2255
|
+
const createWorkspaces = (client) => {
|
|
2256
|
+
const getWorkspaces = async (path, signal) => {
|
|
2257
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/workspaces", { path }, { signal });
|
|
2258
|
+
return data;
|
|
2259
|
+
};
|
|
2260
|
+
const getWorkspace = async (path, signal) => {
|
|
2261
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/workspaces/{workspaceId}", { path }, { signal });
|
|
2262
|
+
return data;
|
|
2263
|
+
};
|
|
2264
|
+
const deleteWorkspace = async ({ branchId, workspaceId }) => {
|
|
2265
|
+
await client.delete("/v2/storage/branch/{branchId}/workspaces/{workspaceId}", { path: {
|
|
2266
|
+
branchId,
|
|
2267
|
+
workspaceId: String(workspaceId)
|
|
2268
|
+
} });
|
|
2269
|
+
};
|
|
2270
|
+
const deleteWorkspaces = async ({ workspaceIds, branchId }) => {
|
|
2271
|
+
await require_concurrent.concurrent({
|
|
2272
|
+
items: workspaceIds,
|
|
2273
|
+
process: async (workspaceId) => deleteWorkspace({
|
|
2274
|
+
branchId,
|
|
2275
|
+
workspaceId
|
|
2276
|
+
}),
|
|
2277
|
+
concurrency: 5
|
|
2278
|
+
});
|
|
2279
|
+
};
|
|
2280
|
+
const deleteWorkspaceJob = async ({ branchId, workspaceId }) => {
|
|
2281
|
+
const { data } = await client.delete("/v2/storage/branch/{branchId}/workspaces/{workspaceId}", {
|
|
2282
|
+
path: {
|
|
2283
|
+
branchId,
|
|
2284
|
+
workspaceId: String(workspaceId)
|
|
2285
|
+
},
|
|
2286
|
+
query: { async: true }
|
|
2287
|
+
});
|
|
2288
|
+
return data;
|
|
2289
|
+
};
|
|
2290
|
+
const resetWorkspacePassword = async ({ branchId, workspaceId }) => {
|
|
2291
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/workspaces/{workspaceId}/password", { path: {
|
|
2292
|
+
branchId,
|
|
2293
|
+
workspaceId: String(workspaceId)
|
|
2294
|
+
} });
|
|
2295
|
+
return data;
|
|
2296
|
+
};
|
|
2297
|
+
const getWorkspaceSaml2Login = async (path, signal) => {
|
|
2298
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/workspaces/{workspaceId}/saml2-login", { path }, { signal });
|
|
2299
|
+
return data;
|
|
2300
|
+
};
|
|
2301
|
+
/**
|
|
2302
|
+
* Set the public key for the workspace user, or migrate workspace from password to key auth.
|
|
2303
|
+
* Supported only on Snowflake.
|
|
2304
|
+
* When called, either a new key is created, or the older one is replaced.
|
|
2305
|
+
*/
|
|
2306
|
+
const setWorkspacePublicKey = async ({ branchId, workspaceId, ...body }) => {
|
|
2307
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/workspaces/{workspaceId}/public-key", {
|
|
2308
|
+
path: {
|
|
2309
|
+
branchId,
|
|
2310
|
+
workspaceId: String(workspaceId)
|
|
2311
|
+
},
|
|
2312
|
+
body
|
|
2313
|
+
});
|
|
2314
|
+
return data;
|
|
2315
|
+
};
|
|
2316
|
+
const getWorkspaceObjects = async (path, signal) => {
|
|
2317
|
+
const { data } = await client.get("/v2/storage/branch/{branchId}/workspaces/{workspaceId}/objects", { path }, { signal });
|
|
2318
|
+
return data;
|
|
2319
|
+
};
|
|
2320
|
+
const deleteWorkspaceObjectsAsync = async ({ branchId, workspaceId, ...body }) => {
|
|
2321
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/workspaces/{workspaceId}/objects/batch-delete", {
|
|
2322
|
+
path: {
|
|
2323
|
+
branchId,
|
|
2324
|
+
workspaceId
|
|
2325
|
+
},
|
|
2326
|
+
body
|
|
2327
|
+
});
|
|
2328
|
+
return data;
|
|
2329
|
+
};
|
|
2330
|
+
const unloadWorkspace = async ({ branchId, workspaceId, ...query }) => {
|
|
2331
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/workspaces/{workspaceId}/unload", {
|
|
2332
|
+
path: {
|
|
2333
|
+
branchId,
|
|
2334
|
+
workspaceId
|
|
2335
|
+
},
|
|
2336
|
+
query
|
|
2337
|
+
});
|
|
2338
|
+
return data;
|
|
2339
|
+
};
|
|
2340
|
+
/**
|
|
2341
|
+
* Preview the resolved load types for a component-style input-mapping config without a workspace.
|
|
2342
|
+
* Returns the preferred load type plus the possible load types per table for the resolved backend,
|
|
2343
|
+
* without creating a job. The backend is resolved per item from the item `backend` field, then the
|
|
2344
|
+
* `backend` argument, then the project default.
|
|
2345
|
+
*/
|
|
2346
|
+
const inputMappingLoadPreview = async ({ branchId, body, backend }, signal) => {
|
|
2347
|
+
const { data } = await client.post("/v2/storage/branch/{branchId}/input-mapping-load/preview", {
|
|
2348
|
+
path: { branchId },
|
|
2349
|
+
query: backend ? { backend } : void 0,
|
|
2350
|
+
body
|
|
2351
|
+
}, { signal });
|
|
2352
|
+
return data;
|
|
2353
|
+
};
|
|
2354
|
+
return {
|
|
2355
|
+
getWorkspace,
|
|
2356
|
+
getWorkspaces,
|
|
2357
|
+
deleteWorkspace,
|
|
2358
|
+
resetWorkspacePassword,
|
|
2359
|
+
deleteWorkspaces,
|
|
2360
|
+
deleteWorkspaceJob,
|
|
2361
|
+
setWorkspacePublicKey,
|
|
2362
|
+
getWorkspaceSaml2Login,
|
|
2363
|
+
getWorkspaceObjects,
|
|
2364
|
+
deleteWorkspaceObjectsAsync,
|
|
2365
|
+
unloadWorkspace,
|
|
2366
|
+
inputMappingLoadPreview
|
|
2367
|
+
};
|
|
2368
|
+
};
|
|
2369
|
+
//#endregion
|
|
2370
|
+
//#region src/clients/storage/storageClient.ts
|
|
2371
|
+
const createStorageClient = ({ baseUrl, auth, middlewares = [], onRefreshToken }) => {
|
|
2372
|
+
const headers = require_auth.createAuthHeaders(auth);
|
|
2373
|
+
const allMiddlewares = onRefreshToken && auth.type === "sapi-token" ? [...middlewares, createRefreshTokenMiddlware({
|
|
2374
|
+
accessToken: auth.token,
|
|
2375
|
+
onRefresh: onRefreshToken
|
|
2376
|
+
})] : middlewares;
|
|
2377
|
+
const genericClient = require_createGenericFetchClient.createGenericFetchClient({
|
|
2378
|
+
baseUrl,
|
|
2379
|
+
middlewares: allMiddlewares,
|
|
2380
|
+
headers
|
|
2381
|
+
});
|
|
2382
|
+
const client = require_createOpenapiFetchClient.createOpenapiFetchClient({
|
|
2383
|
+
baseUrl,
|
|
2384
|
+
middlewares: allMiddlewares,
|
|
2385
|
+
headers
|
|
2386
|
+
});
|
|
2387
|
+
const getStackInfo = async (query, signal) => {
|
|
2388
|
+
const { data } = await client.get("/v2/storage", { query }, { signal });
|
|
2389
|
+
return data;
|
|
2390
|
+
};
|
|
2391
|
+
const healthCheck = async (signal) => {
|
|
2392
|
+
const { data } = await genericClient.get("/health-check", {}, { signal });
|
|
2393
|
+
return data;
|
|
2394
|
+
};
|
|
2395
|
+
const jobs = createJobs(client);
|
|
2396
|
+
const poller = createJobPoller({ getJob: jobs.getJob });
|
|
2397
|
+
return {
|
|
2398
|
+
poller,
|
|
2399
|
+
healthCheck,
|
|
2400
|
+
getStackInfo,
|
|
2401
|
+
jobs,
|
|
2402
|
+
buckets: createBuckets(client, genericClient),
|
|
2403
|
+
bucketSharing: createBucketSharing(client),
|
|
2404
|
+
bucketListings: createBucketListings(client),
|
|
2405
|
+
bucketExternal: createBucketExternal(client),
|
|
2406
|
+
tables: createTables(client, genericClient),
|
|
2407
|
+
columns: createColumns(client),
|
|
2408
|
+
snapshots: createSnapshots(client),
|
|
2409
|
+
branches: createBranches(client, poller),
|
|
2410
|
+
mergeRequests: createMergeRequests(client),
|
|
2411
|
+
events: createEvents(client),
|
|
2412
|
+
files: createFiles(client),
|
|
2413
|
+
workspaces: createWorkspaces(client),
|
|
2414
|
+
tokens: createTokens(client),
|
|
2415
|
+
triggers: createTriggers(client),
|
|
2416
|
+
search: createSearch(client),
|
|
2417
|
+
stats: createStats(client),
|
|
2418
|
+
components: createComponents(client),
|
|
2419
|
+
configurations: createConfigurations(client),
|
|
2420
|
+
configurationRows: createConfigurationRows(client),
|
|
2421
|
+
configurationWorkspaces: createConfigurationWorkspaces(client),
|
|
2422
|
+
configurationMetadata: createConfigurationMetadata(client),
|
|
2423
|
+
configurationVersions: createConfigurationVersions(client)
|
|
2424
|
+
};
|
|
2425
|
+
};
|
|
2426
|
+
//#endregion
|
|
2427
|
+
Object.defineProperty(exports, "ServiceUnavailableError", {
|
|
2428
|
+
enumerable: true,
|
|
2429
|
+
get: function() {
|
|
2430
|
+
return ServiceUnavailableError;
|
|
2431
|
+
}
|
|
2432
|
+
});
|
|
2433
|
+
Object.defineProperty(exports, "createStorageClient", {
|
|
2434
|
+
enumerable: true,
|
|
2435
|
+
get: function() {
|
|
2436
|
+
return createStorageClient;
|
|
2437
|
+
}
|
|
2438
|
+
});
|
|
2439
|
+
Object.defineProperty(exports, "fromBackendSubscribers", {
|
|
2440
|
+
enumerable: true,
|
|
2441
|
+
get: function() {
|
|
2442
|
+
return fromBackendSubscribers;
|
|
2443
|
+
}
|
|
2444
|
+
});
|
|
2445
|
+
Object.defineProperty(exports, "series", {
|
|
2446
|
+
enumerable: true,
|
|
2447
|
+
get: function() {
|
|
2448
|
+
return series;
|
|
2449
|
+
}
|
|
2450
|
+
});
|
|
2451
|
+
Object.defineProperty(exports, "toBackendSubscribers", {
|
|
2452
|
+
enumerable: true,
|
|
2453
|
+
get: function() {
|
|
2454
|
+
return toBackendSubscribers;
|
|
2455
|
+
}
|
|
2456
|
+
});
|
|
2457
|
+
|
|
2458
|
+
//# sourceMappingURL=storage-DbyNnkIJ.cjs.map
|