keboola-cli 0.63.4__py3-none-any.whl
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.
- keboola_agent_cli/__init__.py +34 -0
- keboola_agent_cli/__main__.py +5 -0
- keboola_agent_cli/_ui_dist/assets/arc-DhFYIddx.js +2 -0
- keboola_agent_cli/_ui_dist/assets/arc-DhFYIddx.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/architecture-7EHR7CIX-hNCijx_H.js +1 -0
- keboola_agent_cli/_ui_dist/assets/architectureDiagram-3BPJPVTR-C6hUlprM.js +37 -0
- keboola_agent_cli/_ui_dist/assets/architectureDiagram-3BPJPVTR-C6hUlprM.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/array-BifhSqXX.js +2 -0
- keboola_agent_cli/_ui_dist/assets/array-BifhSqXX.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/blockDiagram-GPEHLZMM-DC7qY9i4.js +133 -0
- keboola_agent_cli/_ui_dist/assets/blockDiagram-GPEHLZMM-DC7qY9i4.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/c4Diagram-AAUBKEIU-5Lh44evt.js +11 -0
- keboola_agent_cli/_ui_dist/assets/c4Diagram-AAUBKEIU-5Lh44evt.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/channel-DBMrXlxx.js +2 -0
- keboola_agent_cli/_ui_dist/assets/channel-DBMrXlxx.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-2J33WTMH-Coy82EBh.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-2J33WTMH-Coy82EBh.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-3OPIFGDE-BQC5CRHI.js +63 -0
- keboola_agent_cli/_ui_dist/assets/chunk-3OPIFGDE-BQC5CRHI.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-4BX2VUAB-DUuEt70o.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-4BX2VUAB-DUuEt70o.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-55IACEB6-BvR-6chF.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-55IACEB6-BvR-6chF.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-5ZQYHXKU-BjcTN7ul.js +3 -0
- keboola_agent_cli/_ui_dist/assets/chunk-5ZQYHXKU-BjcTN7ul.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-727SXJPM-C0zxqqRN.js +207 -0
- keboola_agent_cli/_ui_dist/assets/chunk-727SXJPM-C0zxqqRN.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-AQP2D5EJ-CXf7rIlZ.js +232 -0
- keboola_agent_cli/_ui_dist/assets/chunk-AQP2D5EJ-CXf7rIlZ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-BSJP7CBP-Oj_FO9Q7.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-BSJP7CBP-Oj_FO9Q7.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-CSCIHK7Q-CcTsLrFc.js +124 -0
- keboola_agent_cli/_ui_dist/assets/chunk-CSCIHK7Q-CcTsLrFc.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-FMBD7UC4-FH-zLkkW.js +16 -0
- keboola_agent_cli/_ui_dist/assets/chunk-FMBD7UC4-FH-zLkkW.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-L5ZTLDWV-B1Ky_e7O.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-L5ZTLDWV-B1Ky_e7O.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-ND2GUHAM-BHz1rpbm.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-ND2GUHAM-BHz1rpbm.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NNHCCRGN-DlpIbxXb.js +160 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NNHCCRGN-DlpIbxXb.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NZK2D7GU-tnrSoegS.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NZK2D7GU-tnrSoegS.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-O5CBEL6O-DxxqDH0l.js +71 -0
- keboola_agent_cli/_ui_dist/assets/chunk-O5CBEL6O-DxxqDH0l.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-QZHKN3VN-CSjc2gjj.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-QZHKN3VN-CSjc2gjj.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-4FO5ZUOK-BuZcZu85.js +2 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-4FO5ZUOK-BuZcZu85.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-v2-Q7XG4LA2-BuZcZu85.js +2 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-v2-Q7XG4LA2-BuZcZu85.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/cose-bilkent-S5V4N54A-Y0L8LDMa.js +2 -0
- keboola_agent_cli/_ui_dist/assets/cose-bilkent-S5V4N54A-Y0L8LDMa.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/cytoscape.esm-C8YCVR3_.js +322 -0
- keboola_agent_cli/_ui_dist/assets/cytoscape.esm-C8YCVR3_.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/dagre-BM42HDAG-UZ-9BTqF.js +5 -0
- keboola_agent_cli/_ui_dist/assets/dagre-BM42HDAG-UZ-9BTqF.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/dagre-Bx709z4p.js +2 -0
- keboola_agent_cli/_ui_dist/assets/dagre-Bx709z4p.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/defaultLocale-C8Fc0cco.js +2 -0
- keboola_agent_cli/_ui_dist/assets/defaultLocale-C8Fc0cco.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-2AECGRRQ-DoDQ60wi.js +44 -0
- keboola_agent_cli/_ui_dist/assets/diagram-2AECGRRQ-DoDQ60wi.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-5GNKFQAL-CMGFxpUs.js +11 -0
- keboola_agent_cli/_ui_dist/assets/diagram-5GNKFQAL-CMGFxpUs.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-KO2AKTUF-1uGDa-Iu.js +4 -0
- keboola_agent_cli/_ui_dist/assets/diagram-KO2AKTUF-1uGDa-Iu.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-LMA3HP47-XtFH7B51.js +25 -0
- keboola_agent_cli/_ui_dist/assets/diagram-LMA3HP47-XtFH7B51.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-OG6HWLK6-B4_Te1T5.js +25 -0
- keboola_agent_cli/_ui_dist/assets/diagram-OG6HWLK6-B4_Te1T5.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/dist-Di6zmlv0.js +2 -0
- keboola_agent_cli/_ui_dist/assets/dist-Di6zmlv0.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/erDiagram-TEJ5UH35-NjQkrdFt.js +86 -0
- keboola_agent_cli/_ui_dist/assets/erDiagram-TEJ5UH35-NjQkrdFt.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/eventmodeling-FCH6USID-BrJMIks8.js +1 -0
- keboola_agent_cli/_ui_dist/assets/flowDiagram-I6XJVG4X-CIr8DWl7.js +163 -0
- keboola_agent_cli/_ui_dist/assets/flowDiagram-I6XJVG4X-CIr8DWl7.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/ganttDiagram-6RSMTGT7-C1VY_xbQ.js +293 -0
- keboola_agent_cli/_ui_dist/assets/ganttDiagram-6RSMTGT7-C1VY_xbQ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/gitGraph-WXDBUCRP-COacYjo-.js +1 -0
- keboola_agent_cli/_ui_dist/assets/gitGraphDiagram-PVQCEYII-DQT8-kg2.js +107 -0
- keboola_agent_cli/_ui_dist/assets/gitGraphDiagram-PVQCEYII-DQT8-kg2.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/graphlib-B8gBHxth.js +2 -0
- keboola_agent_cli/_ui_dist/assets/graphlib-B8gBHxth.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/index-CMq50kkV.css +1 -0
- keboola_agent_cli/_ui_dist/assets/index-D8W97DAz.js +118 -0
- keboola_agent_cli/_ui_dist/assets/index-D8W97DAz.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/info-J43DQDTF-DdCTRIzU.js +1 -0
- keboola_agent_cli/_ui_dist/assets/infoDiagram-5YYISTIA-C77rsoTp.js +3 -0
- keboola_agent_cli/_ui_dist/assets/infoDiagram-5YYISTIA-C77rsoTp.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/init-D6jRqBbL.js +2 -0
- keboola_agent_cli/_ui_dist/assets/init-D6jRqBbL.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/ishikawaDiagram-YF4QCWOH-BcTbXaLy.js +71 -0
- keboola_agent_cli/_ui_dist/assets/ishikawaDiagram-YF4QCWOH-BcTbXaLy.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/journeyDiagram-JHISSGLW-BejeAJQ_.js +140 -0
- keboola_agent_cli/_ui_dist/assets/journeyDiagram-JHISSGLW-BejeAJQ_.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/kanban-definition-UN3LZRKU-BRNz_UrH.js +90 -0
- keboola_agent_cli/_ui_dist/assets/kanban-definition-UN3LZRKU-BRNz_UrH.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/katex-C4eR7coU.js +258 -0
- keboola_agent_cli/_ui_dist/assets/katex-C4eR7coU.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/line-CzAQKFbJ.js +2 -0
- keboola_agent_cli/_ui_dist/assets/line-CzAQKFbJ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/linear-DUNFFdck.js +2 -0
- keboola_agent_cli/_ui_dist/assets/linear-DUNFFdck.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/mermaid-parser.core-CpuBOkFa.js +5 -0
- keboola_agent_cli/_ui_dist/assets/mermaid-parser.core-CpuBOkFa.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/mindmap-definition-RKZ34NQL-9EJQNjH0.js +97 -0
- keboola_agent_cli/_ui_dist/assets/mindmap-definition-RKZ34NQL-9EJQNjH0.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/ordinal-hYBb2elL.js +2 -0
- keboola_agent_cli/_ui_dist/assets/ordinal-hYBb2elL.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/packet-YPE3B663-DLiiw_B2.js +1 -0
- keboola_agent_cli/_ui_dist/assets/path-BWPyau1x.js +2 -0
- keboola_agent_cli/_ui_dist/assets/path-BWPyau1x.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/pie-LRSECV5Y-CRoO8G1g.js +1 -0
- keboola_agent_cli/_ui_dist/assets/pieDiagram-4H26LBE5-XH4cy6Cb.js +31 -0
- keboola_agent_cli/_ui_dist/assets/pieDiagram-4H26LBE5-XH4cy6Cb.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/quadrantDiagram-W4KKPZXB-fdhc93U8.js +8 -0
- keboola_agent_cli/_ui_dist/assets/quadrantDiagram-W4KKPZXB-fdhc93U8.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/radar-GUYGQ44K-DAlLVJHm.js +1 -0
- keboola_agent_cli/_ui_dist/assets/requirementDiagram-4Y6WPE33-a94eP3R9.js +85 -0
- keboola_agent_cli/_ui_dist/assets/requirementDiagram-4Y6WPE33-a94eP3R9.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/rough.esm-CSKSodPl.js +2 -0
- keboola_agent_cli/_ui_dist/assets/rough.esm-CSKSodPl.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/sankeyDiagram-5OEKKPKP-jcBa02sp.js +41 -0
- keboola_agent_cli/_ui_dist/assets/sankeyDiagram-5OEKKPKP-jcBa02sp.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/sequenceDiagram-3UESZ5HK-A5-GGM-e.js +163 -0
- keboola_agent_cli/_ui_dist/assets/sequenceDiagram-3UESZ5HK-A5-GGM-e.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/src-ZI-V_AF0.js +2 -0
- keboola_agent_cli/_ui_dist/assets/src-ZI-V_AF0.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-AJRCARHV-BKAA5rqE.js +2 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-AJRCARHV-BKAA5rqE.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-v2-BHNVJYJU-DnJwJBsE.js +2 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-v2-BHNVJYJU-DnJwJBsE.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/timeline-definition-PNZ67QCA-Cy39jp8b.js +121 -0
- keboola_agent_cli/_ui_dist/assets/timeline-definition-PNZ67QCA-Cy39jp8b.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/treeView-BLDUP644-DbLYl23-.js +1 -0
- keboola_agent_cli/_ui_dist/assets/treemap-LRROVOQU-Bp0eGlOt.js +1 -0
- keboola_agent_cli/_ui_dist/assets/vennDiagram-CIIHVFJN-BGECKubd.js +35 -0
- keboola_agent_cli/_ui_dist/assets/vennDiagram-CIIHVFJN-BGECKubd.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/wardley-L42UT6IY-D4yH4jqS.js +1 -0
- keboola_agent_cli/_ui_dist/assets/wardleyDiagram-YWT4CUSO-D6XRG3cZ.js +79 -0
- keboola_agent_cli/_ui_dist/assets/wardleyDiagram-YWT4CUSO-D6XRG3cZ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/xychartDiagram-2RQKCTM6-DRre-pfZ.js +8 -0
- keboola_agent_cli/_ui_dist/assets/xychartDiagram-2RQKCTM6-DRre-pfZ.js.map +1 -0
- keboola_agent_cli/_ui_dist/index.html +50 -0
- keboola_agent_cli/ai_client.py +83 -0
- keboola_agent_cli/auto_update.py +550 -0
- keboola_agent_cli/changelog.py +1198 -0
- keboola_agent_cli/cli.py +448 -0
- keboola_agent_cli/client.py +3422 -0
- keboola_agent_cli/commands/__init__.py +0 -0
- keboola_agent_cli/commands/_data_app_git.py +343 -0
- keboola_agent_cli/commands/_helpers.py +377 -0
- keboola_agent_cli/commands/_metadata_input.py +49 -0
- keboola_agent_cli/commands/_semantic_layer_crud.py +632 -0
- keboola_agent_cli/commands/_semantic_layer_helpers.py +44 -0
- keboola_agent_cli/commands/_semantic_layer_reference_data.py +247 -0
- keboola_agent_cli/commands/agent.py +968 -0
- keboola_agent_cli/commands/branch.py +423 -0
- keboola_agent_cli/commands/changelog.py +168 -0
- keboola_agent_cli/commands/component.py +216 -0
- keboola_agent_cli/commands/config.py +2442 -0
- keboola_agent_cli/commands/context.py +1481 -0
- keboola_agent_cli/commands/data_app.py +1279 -0
- keboola_agent_cli/commands/dev_portal.py +584 -0
- keboola_agent_cli/commands/doctor.py +37 -0
- keboola_agent_cli/commands/encrypt.py +145 -0
- keboola_agent_cli/commands/feature.py +311 -0
- keboola_agent_cli/commands/flow.py +948 -0
- keboola_agent_cli/commands/http_client.py +157 -0
- keboola_agent_cli/commands/init.py +279 -0
- keboola_agent_cli/commands/job.py +661 -0
- keboola_agent_cli/commands/kai.py +301 -0
- keboola_agent_cli/commands/lineage.py +1464 -0
- keboola_agent_cli/commands/org.py +292 -0
- keboola_agent_cli/commands/permissions.py +360 -0
- keboola_agent_cli/commands/project.py +1192 -0
- keboola_agent_cli/commands/repl.py +243 -0
- keboola_agent_cli/commands/schedule.py +340 -0
- keboola_agent_cli/commands/search.py +178 -0
- keboola_agent_cli/commands/semantic_layer.py +939 -0
- keboola_agent_cli/commands/serve.py +272 -0
- keboola_agent_cli/commands/sharing.py +340 -0
- keboola_agent_cli/commands/storage.py +2630 -0
- keboola_agent_cli/commands/stream.py +266 -0
- keboola_agent_cli/commands/sync.py +1277 -0
- keboola_agent_cli/commands/tool.py +206 -0
- keboola_agent_cli/commands/version.py +186 -0
- keboola_agent_cli/commands/workspace.py +635 -0
- keboola_agent_cli/config_store.py +582 -0
- keboola_agent_cli/constants.py +528 -0
- keboola_agent_cli/data_science_client.py +342 -0
- keboola_agent_cli/dev_portal_client.py +323 -0
- keboola_agent_cli/errors.py +248 -0
- keboola_agent_cli/http_base.py +315 -0
- keboola_agent_cli/json_utils.py +126 -0
- keboola_agent_cli/lib.py +536 -0
- keboola_agent_cli/manage_client.py +324 -0
- keboola_agent_cli/metastore_client.py +214 -0
- keboola_agent_cli/models.py +427 -0
- keboola_agent_cli/output.py +1084 -0
- keboola_agent_cli/permissions.py +469 -0
- keboola_agent_cli/py.typed +3 -0
- keboola_agent_cli/result_models.py +271 -0
- keboola_agent_cli/server/__init__.py +34 -0
- keboola_agent_cli/server/agent_runner.py +1289 -0
- keboola_agent_cli/server/agents_store.py +325 -0
- keboola_agent_cli/server/app.py +764 -0
- keboola_agent_cli/server/auth.py +117 -0
- keboola_agent_cli/server/dependencies.py +149 -0
- keboola_agent_cli/server/pricing.py +303 -0
- keboola_agent_cli/server/routers/__init__.py +1 -0
- keboola_agent_cli/server/routers/agents.py +616 -0
- keboola_agent_cli/server/routers/ai_chat.py +129 -0
- keboola_agent_cli/server/routers/branches.py +133 -0
- keboola_agent_cli/server/routers/components.py +48 -0
- keboola_agent_cli/server/routers/configs.py +507 -0
- keboola_agent_cli/server/routers/data_apps.py +384 -0
- keboola_agent_cli/server/routers/dev_portal.py +67 -0
- keboola_agent_cli/server/routers/encrypt.py +35 -0
- keboola_agent_cli/server/routers/feature.py +179 -0
- keboola_agent_cli/server/routers/flows.py +204 -0
- keboola_agent_cli/server/routers/health.py +53 -0
- keboola_agent_cli/server/routers/jobs.py +175 -0
- keboola_agent_cli/server/routers/kai.py +80 -0
- keboola_agent_cli/server/routers/lineage.py +226 -0
- keboola_agent_cli/server/routers/mcp.py +70 -0
- keboola_agent_cli/server/routers/members.py +170 -0
- keboola_agent_cli/server/routers/org.py +96 -0
- keboola_agent_cli/server/routers/projects.py +106 -0
- keboola_agent_cli/server/routers/schedules.py +54 -0
- keboola_agent_cli/server/routers/search.py +30 -0
- keboola_agent_cli/server/routers/semantic_layer.py +650 -0
- keboola_agent_cli/server/routers/sharing.py +86 -0
- keboola_agent_cli/server/routers/storage.py +574 -0
- keboola_agent_cli/server/routers/stream.py +100 -0
- keboola_agent_cli/server/routers/workspaces.py +302 -0
- keboola_agent_cli/server/run_broadcaster.py +329 -0
- keboola_agent_cli/server/sse.py +25 -0
- keboola_agent_cli/services/__init__.py +0 -0
- keboola_agent_cli/services/_encryption.py +217 -0
- keboola_agent_cli/services/_semantic_layer_cascade.py +147 -0
- keboola_agent_cli/services/_semantic_layer_crud.py +382 -0
- keboola_agent_cli/services/_semantic_layer_internals.py +1078 -0
- keboola_agent_cli/services/_semantic_layer_lookup.py +181 -0
- keboola_agent_cli/services/_semantic_layer_reference_data.py +217 -0
- keboola_agent_cli/services/_sync_bindings.py +456 -0
- keboola_agent_cli/services/_sync_branch.py +191 -0
- keboola_agent_cli/services/_sync_bulk.py +228 -0
- keboola_agent_cli/services/_sync_clone.py +163 -0
- keboola_agent_cli/services/_sync_models.py +97 -0
- keboola_agent_cli/services/_sync_push_ops.py +369 -0
- keboola_agent_cli/services/_sync_storage.py +376 -0
- keboola_agent_cli/services/_sync_writeback.py +167 -0
- keboola_agent_cli/services/agent_service.py +458 -0
- keboola_agent_cli/services/base.py +175 -0
- keboola_agent_cli/services/branch_service.py +588 -0
- keboola_agent_cli/services/component_service.py +694 -0
- keboola_agent_cli/services/config_service.py +2099 -0
- keboola_agent_cli/services/data_app_git_service.py +224 -0
- keboola_agent_cli/services/data_app_service.py +2082 -0
- keboola_agent_cli/services/deep_lineage_service.py +1322 -0
- keboola_agent_cli/services/dev_portal_service.py +345 -0
- keboola_agent_cli/services/doctor_service.py +445 -0
- keboola_agent_cli/services/encrypt_service.py +87 -0
- keboola_agent_cli/services/feature_service.py +268 -0
- keboola_agent_cli/services/flow_service.py +769 -0
- keboola_agent_cli/services/flow_validation.py +188 -0
- keboola_agent_cli/services/http_forwarder_service.py +236 -0
- keboola_agent_cli/services/job_idempotency_store.py +285 -0
- keboola_agent_cli/services/job_service.py +797 -0
- keboola_agent_cli/services/kai_service.py +367 -0
- keboola_agent_cli/services/lineage_service.py +274 -0
- keboola_agent_cli/services/mcp_service.py +1498 -0
- keboola_agent_cli/services/mcp_transport.py +259 -0
- keboola_agent_cli/services/member_service.py +593 -0
- keboola_agent_cli/services/org_service.py +619 -0
- keboola_agent_cli/services/project_service.py +947 -0
- keboola_agent_cli/services/repo_validate_service.py +767 -0
- keboola_agent_cli/services/schedule_service.py +731 -0
- keboola_agent_cli/services/search_service.py +331 -0
- keboola_agent_cli/services/semantic_layer_service.py +1497 -0
- keboola_agent_cli/services/sharing_service.py +307 -0
- keboola_agent_cli/services/storage_service.py +2524 -0
- keboola_agent_cli/services/stream_service.py +395 -0
- keboola_agent_cli/services/sync_service.py +2244 -0
- keboola_agent_cli/services/variables_service.py +447 -0
- keboola_agent_cli/services/version_service.py +1038 -0
- keboola_agent_cli/services/workspace_service.py +1103 -0
- keboola_agent_cli/stream_client.py +217 -0
- keboola_agent_cli/sync/__init__.py +1 -0
- keboola_agent_cli/sync/branch_mapping.py +174 -0
- keboola_agent_cli/sync/clone.py +211 -0
- keboola_agent_cli/sync/code_extraction.py +655 -0
- keboola_agent_cli/sync/config_format.py +290 -0
- keboola_agent_cli/sync/diff_engine.py +566 -0
- keboola_agent_cli/sync/git_utils.py +93 -0
- keboola_agent_cli/sync/manifest.py +162 -0
- keboola_agent_cli/sync/naming.py +90 -0
- keboola_agent_cli/sync/secrets.py +62 -0
- keboola_agent_cli/sync/sql_split.py +134 -0
- keboola_cli-0.63.4.dist-info/METADATA +308 -0
- keboola_cli-0.63.4.dist-info/RECORD +306 -0
- keboola_cli-0.63.4.dist-info/WHEEL +4 -0
- keboola_cli-0.63.4.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
"""Variables service -- high-level abstraction over keboola.variables configs.
|
|
2
|
+
|
|
3
|
+
Presents variables as a property you assign to any Keboola config, hiding the
|
|
4
|
+
fact that Keboola stores them server-side as separate ``keboola.variables``
|
|
5
|
+
configurations with rows. Agents and users call:
|
|
6
|
+
|
|
7
|
+
set_variables(parent_component, parent_config, {key: value, ...})
|
|
8
|
+
|
|
9
|
+
and the service handles create-if-missing, row update, parent linking, and
|
|
10
|
+
encryption of ``#``-prefixed secrets. No YAML authoring, no linking dance, no
|
|
11
|
+
keboola.variables-as-resource bookkeeping.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import copy
|
|
17
|
+
import logging
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
from ..errors import ConfigError, KeboolaApiError
|
|
21
|
+
from ._encryption import encrypt_secrets_in_config
|
|
22
|
+
from .base import BaseService
|
|
23
|
+
|
|
24
|
+
logger = logging.getLogger(__name__)
|
|
25
|
+
|
|
26
|
+
VARIABLES_COMPONENT_ID = "keboola.variables"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class VariablesService(BaseService):
|
|
30
|
+
"""Assign, read, and detach variables on any Keboola config.
|
|
31
|
+
|
|
32
|
+
The backing ``keboola.variables`` configuration is an implementation detail
|
|
33
|
+
that callers shouldn't need to know about. On first set, a sibling config
|
|
34
|
+
named ``{parent_name}-vars`` is created; subsequent sets update the same
|
|
35
|
+
default row. ``clear`` unlinks the parent but does NOT delete the backing
|
|
36
|
+
config (it might be shared across configs).
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def get_variables(
|
|
40
|
+
self,
|
|
41
|
+
alias: str,
|
|
42
|
+
component_id: str,
|
|
43
|
+
config_id: str,
|
|
44
|
+
branch_id: int | None = None,
|
|
45
|
+
) -> dict[str, Any]:
|
|
46
|
+
"""Return the current variable values assigned to ``{component_id}/{config_id}``.
|
|
47
|
+
|
|
48
|
+
Returns a flat ``{name: value}`` dict (the ``keboola.variables`` row
|
|
49
|
+
structure is flattened). ``linked=False`` means the parent config has no
|
|
50
|
+
``variables_id`` set -- no variables to report.
|
|
51
|
+
"""
|
|
52
|
+
projects = self.resolve_projects([alias])
|
|
53
|
+
project = projects[alias]
|
|
54
|
+
client = self._client_factory(project.stack_url, project.token)
|
|
55
|
+
try:
|
|
56
|
+
parent = client.get_config_detail(component_id, config_id, branch_id=branch_id)
|
|
57
|
+
parent_configuration = parent.get("configuration") or {}
|
|
58
|
+
variables_id = parent_configuration.get("variables_id")
|
|
59
|
+
values_id = parent_configuration.get("variables_values_id")
|
|
60
|
+
|
|
61
|
+
if not variables_id:
|
|
62
|
+
return {
|
|
63
|
+
"project_alias": alias,
|
|
64
|
+
"parent_component_id": component_id,
|
|
65
|
+
"parent_config_id": config_id,
|
|
66
|
+
"variables_id": None,
|
|
67
|
+
"values_id": None,
|
|
68
|
+
"values": {},
|
|
69
|
+
"linked": False,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
vars_cfg = client.get_config_detail(
|
|
73
|
+
VARIABLES_COMPONENT_ID, variables_id, branch_id=branch_id
|
|
74
|
+
)
|
|
75
|
+
target_row = self._resolve_values_row(vars_cfg, values_id)
|
|
76
|
+
values_dict: dict[str, str] = {}
|
|
77
|
+
if target_row:
|
|
78
|
+
for item in target_row.get("configuration", {}).get("values", []):
|
|
79
|
+
values_dict[item["name"]] = item["value"]
|
|
80
|
+
if not values_id:
|
|
81
|
+
values_id = target_row["id"]
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
"project_alias": alias,
|
|
85
|
+
"parent_component_id": component_id,
|
|
86
|
+
"parent_config_id": config_id,
|
|
87
|
+
"variables_id": variables_id,
|
|
88
|
+
"values_id": values_id,
|
|
89
|
+
"values": values_dict,
|
|
90
|
+
"linked": True,
|
|
91
|
+
}
|
|
92
|
+
finally:
|
|
93
|
+
client.close()
|
|
94
|
+
|
|
95
|
+
def set_variables(
|
|
96
|
+
self,
|
|
97
|
+
alias: str,
|
|
98
|
+
component_id: str,
|
|
99
|
+
config_id: str,
|
|
100
|
+
variables: dict[str, str],
|
|
101
|
+
*,
|
|
102
|
+
replace: bool = False,
|
|
103
|
+
variables_id: str | None = None,
|
|
104
|
+
values_id: str | None = None,
|
|
105
|
+
branch_id: int | None = None,
|
|
106
|
+
allow_plaintext_fallback: bool = False,
|
|
107
|
+
) -> dict[str, Any]:
|
|
108
|
+
"""Assign variable values to ``{component_id}/{config_id}``.
|
|
109
|
+
|
|
110
|
+
Creates a backing ``keboola.variables`` config + default row if the
|
|
111
|
+
parent has no ``variables_id`` set. Otherwise updates the already-linked
|
|
112
|
+
values row. With ``replace=False`` (default), values are merged with the
|
|
113
|
+
existing set; with ``replace=True``, the values array is overwritten
|
|
114
|
+
with exactly the provided dict.
|
|
115
|
+
|
|
116
|
+
``#``-prefixed keys are encrypted via the Encryption API before reaching
|
|
117
|
+
Storage (fail-closed unless ``allow_plaintext_fallback=True``).
|
|
118
|
+
|
|
119
|
+
``variables_id`` / ``values_id`` override the auto-discovery path and
|
|
120
|
+
can be used to attach the parent to a pre-existing variables config.
|
|
121
|
+
"""
|
|
122
|
+
if not variables:
|
|
123
|
+
raise ConfigError(
|
|
124
|
+
"set_variables requires at least one variable. Use --var KEY=VALUE (repeatable)."
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
projects = self.resolve_projects([alias])
|
|
128
|
+
project = projects[alias]
|
|
129
|
+
client = self._client_factory(project.stack_url, project.token)
|
|
130
|
+
try:
|
|
131
|
+
parent = client.get_config_detail(component_id, config_id, branch_id=branch_id)
|
|
132
|
+
parent_name = parent.get("name", "")
|
|
133
|
+
parent_configuration = copy.deepcopy(parent.get("configuration") or {})
|
|
134
|
+
|
|
135
|
+
# project_id is needed for the Encryption API scope; not present on
|
|
136
|
+
# the config response, so fetch from verify_token.
|
|
137
|
+
project_id = client.verify_token().project_id
|
|
138
|
+
# A valid storage token always has a project_id; None only on
|
|
139
|
+
# master tokens which cannot be used here.
|
|
140
|
+
assert project_id is not None
|
|
141
|
+
|
|
142
|
+
linked_vars_id = variables_id or parent_configuration.get("variables_id")
|
|
143
|
+
linked_values_id = values_id or parent_configuration.get("variables_values_id")
|
|
144
|
+
action = "updated"
|
|
145
|
+
|
|
146
|
+
if not linked_vars_id:
|
|
147
|
+
(
|
|
148
|
+
linked_vars_id,
|
|
149
|
+
linked_values_id,
|
|
150
|
+
final_values,
|
|
151
|
+
) = self._create_linked_variables(
|
|
152
|
+
client=client,
|
|
153
|
+
project_id=project_id,
|
|
154
|
+
parent_name=parent_name,
|
|
155
|
+
parent_component_id=component_id,
|
|
156
|
+
parent_config_id=config_id,
|
|
157
|
+
variables=variables,
|
|
158
|
+
branch_id=branch_id,
|
|
159
|
+
allow_plaintext_fallback=allow_plaintext_fallback,
|
|
160
|
+
)
|
|
161
|
+
action = "created"
|
|
162
|
+
else:
|
|
163
|
+
linked_values_id, final_values = self._update_linked_variables(
|
|
164
|
+
client=client,
|
|
165
|
+
project_id=project_id,
|
|
166
|
+
variables_id=linked_vars_id,
|
|
167
|
+
values_id=linked_values_id,
|
|
168
|
+
variables=variables,
|
|
169
|
+
replace=replace,
|
|
170
|
+
branch_id=branch_id,
|
|
171
|
+
allow_plaintext_fallback=allow_plaintext_fallback,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# Ensure the parent config carries the link. Existing-linked path
|
|
175
|
+
# may no-op; auto-create path always writes.
|
|
176
|
+
parent_variables_id = parent_configuration.get("variables_id")
|
|
177
|
+
parent_values_id = parent_configuration.get("variables_values_id")
|
|
178
|
+
if parent_variables_id != linked_vars_id or parent_values_id != linked_values_id:
|
|
179
|
+
parent_configuration["variables_id"] = linked_vars_id
|
|
180
|
+
parent_configuration["variables_values_id"] = linked_values_id
|
|
181
|
+
client.update_config(
|
|
182
|
+
component_id=component_id,
|
|
183
|
+
config_id=config_id,
|
|
184
|
+
configuration=parent_configuration,
|
|
185
|
+
change_description="Linked variables via kbagent",
|
|
186
|
+
branch_id=branch_id,
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
encrypted_keys = sorted(k for k in variables if k.startswith("#"))
|
|
190
|
+
return {
|
|
191
|
+
"project_alias": alias,
|
|
192
|
+
"parent_component_id": component_id,
|
|
193
|
+
"parent_config_id": config_id,
|
|
194
|
+
"variables_id": linked_vars_id,
|
|
195
|
+
"values_id": linked_values_id,
|
|
196
|
+
"action": action,
|
|
197
|
+
"values": final_values,
|
|
198
|
+
"encrypted_keys": encrypted_keys,
|
|
199
|
+
}
|
|
200
|
+
finally:
|
|
201
|
+
client.close()
|
|
202
|
+
|
|
203
|
+
def clear_variables(
|
|
204
|
+
self,
|
|
205
|
+
alias: str,
|
|
206
|
+
component_id: str,
|
|
207
|
+
config_id: str,
|
|
208
|
+
branch_id: int | None = None,
|
|
209
|
+
) -> dict[str, Any]:
|
|
210
|
+
"""Unlink variables from ``{component_id}/{config_id}``.
|
|
211
|
+
|
|
212
|
+
Strips ``variables_id`` + ``variables_values_id`` from the parent config
|
|
213
|
+
and PUTs it. Does NOT delete the underlying ``keboola.variables`` config
|
|
214
|
+
-- it may be shared across configs, and deletion is a destructive op
|
|
215
|
+
the user should do explicitly via ``config delete``.
|
|
216
|
+
"""
|
|
217
|
+
projects = self.resolve_projects([alias])
|
|
218
|
+
project = projects[alias]
|
|
219
|
+
client = self._client_factory(project.stack_url, project.token)
|
|
220
|
+
try:
|
|
221
|
+
parent = client.get_config_detail(component_id, config_id, branch_id=branch_id)
|
|
222
|
+
parent_configuration = copy.deepcopy(parent.get("configuration") or {})
|
|
223
|
+
was_vars_id = parent_configuration.pop("variables_id", None)
|
|
224
|
+
was_values_id = parent_configuration.pop("variables_values_id", None)
|
|
225
|
+
|
|
226
|
+
if was_vars_id or was_values_id:
|
|
227
|
+
client.update_config(
|
|
228
|
+
component_id=component_id,
|
|
229
|
+
config_id=config_id,
|
|
230
|
+
configuration=parent_configuration,
|
|
231
|
+
change_description="Unlinked variables via kbagent",
|
|
232
|
+
branch_id=branch_id,
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
"project_alias": alias,
|
|
237
|
+
"parent_component_id": component_id,
|
|
238
|
+
"parent_config_id": config_id,
|
|
239
|
+
"was_linked": bool(was_vars_id),
|
|
240
|
+
"unlinked_variables_id": was_vars_id,
|
|
241
|
+
"unlinked_values_id": was_values_id,
|
|
242
|
+
}
|
|
243
|
+
finally:
|
|
244
|
+
client.close()
|
|
245
|
+
|
|
246
|
+
# ------------------------------------------------------------------
|
|
247
|
+
# internal helpers
|
|
248
|
+
# ------------------------------------------------------------------
|
|
249
|
+
|
|
250
|
+
def _create_linked_variables(
|
|
251
|
+
self,
|
|
252
|
+
*,
|
|
253
|
+
client: Any,
|
|
254
|
+
project_id: int,
|
|
255
|
+
parent_name: str,
|
|
256
|
+
parent_component_id: str,
|
|
257
|
+
parent_config_id: str,
|
|
258
|
+
variables: dict[str, str],
|
|
259
|
+
branch_id: int | None,
|
|
260
|
+
allow_plaintext_fallback: bool,
|
|
261
|
+
) -> tuple[str, str, dict[str, str]]:
|
|
262
|
+
"""Auto-create path: new variables config + default row, parent not yet linked."""
|
|
263
|
+
var_name = (parent_name or parent_config_id) + "-vars"
|
|
264
|
+
schema = [{"name": k, "type": "string"} for k in variables]
|
|
265
|
+
|
|
266
|
+
new_var_cfg = client.create_config(
|
|
267
|
+
component_id=VARIABLES_COMPONENT_ID,
|
|
268
|
+
name=var_name,
|
|
269
|
+
description=(f"Auto-created by kbagent for {parent_component_id}/{parent_config_id}"),
|
|
270
|
+
configuration={"variables": schema},
|
|
271
|
+
branch_id=branch_id,
|
|
272
|
+
)
|
|
273
|
+
variables_id = new_var_cfg["id"]
|
|
274
|
+
|
|
275
|
+
row_config = self._build_encrypted_row_configuration(
|
|
276
|
+
client=client,
|
|
277
|
+
project_id=project_id,
|
|
278
|
+
variables=variables,
|
|
279
|
+
allow_plaintext_fallback=allow_plaintext_fallback,
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
new_row = client.create_config_row(
|
|
283
|
+
component_id=VARIABLES_COMPONENT_ID,
|
|
284
|
+
config_id=variables_id,
|
|
285
|
+
name="default",
|
|
286
|
+
configuration=row_config,
|
|
287
|
+
description="Auto-created default row by kbagent",
|
|
288
|
+
branch_id=branch_id,
|
|
289
|
+
)
|
|
290
|
+
return variables_id, new_row["id"], dict(variables)
|
|
291
|
+
|
|
292
|
+
def _update_linked_variables(
|
|
293
|
+
self,
|
|
294
|
+
*,
|
|
295
|
+
client: Any,
|
|
296
|
+
project_id: int,
|
|
297
|
+
variables_id: str,
|
|
298
|
+
values_id: str | None,
|
|
299
|
+
variables: dict[str, str],
|
|
300
|
+
replace: bool,
|
|
301
|
+
branch_id: int | None,
|
|
302
|
+
allow_plaintext_fallback: bool,
|
|
303
|
+
) -> tuple[str, dict[str, str]]:
|
|
304
|
+
"""Update path: parent already linked (or explicit --variables-id). Merge or replace."""
|
|
305
|
+
vars_cfg = client.get_config_detail(
|
|
306
|
+
VARIABLES_COMPONENT_ID, variables_id, branch_id=branch_id
|
|
307
|
+
)
|
|
308
|
+
target_row = self._resolve_values_row(vars_cfg, values_id)
|
|
309
|
+
|
|
310
|
+
if target_row is None:
|
|
311
|
+
# Linked variables_id exists but no values row -- create the default.
|
|
312
|
+
row_config = self._build_encrypted_row_configuration(
|
|
313
|
+
client=client,
|
|
314
|
+
project_id=project_id,
|
|
315
|
+
variables=variables,
|
|
316
|
+
allow_plaintext_fallback=allow_plaintext_fallback,
|
|
317
|
+
)
|
|
318
|
+
new_row = client.create_config_row(
|
|
319
|
+
component_id=VARIABLES_COMPONENT_ID,
|
|
320
|
+
config_id=variables_id,
|
|
321
|
+
name="default",
|
|
322
|
+
configuration=row_config,
|
|
323
|
+
description="Auto-created default row by kbagent",
|
|
324
|
+
branch_id=branch_id,
|
|
325
|
+
)
|
|
326
|
+
self._extend_schema_if_new_keys(
|
|
327
|
+
client=client,
|
|
328
|
+
vars_cfg=vars_cfg,
|
|
329
|
+
variables=variables,
|
|
330
|
+
branch_id=branch_id,
|
|
331
|
+
)
|
|
332
|
+
return new_row["id"], dict(variables)
|
|
333
|
+
|
|
334
|
+
existing_values = target_row.get("configuration", {}).get("values", [])
|
|
335
|
+
existing_dict = {v["name"]: v["value"] for v in existing_values}
|
|
336
|
+
|
|
337
|
+
if replace:
|
|
338
|
+
final_values = dict(variables)
|
|
339
|
+
else:
|
|
340
|
+
final_values = dict(existing_dict)
|
|
341
|
+
final_values.update(variables)
|
|
342
|
+
|
|
343
|
+
# Encrypt only the NEW values -- existing #-keys are already KBC::-
|
|
344
|
+
# prefixed and collect_secrets skips already-encrypted entries.
|
|
345
|
+
row_config = self._build_encrypted_row_configuration(
|
|
346
|
+
client=client,
|
|
347
|
+
project_id=project_id,
|
|
348
|
+
variables=final_values,
|
|
349
|
+
allow_plaintext_fallback=allow_plaintext_fallback,
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
client.update_config_row(
|
|
353
|
+
component_id=VARIABLES_COMPONENT_ID,
|
|
354
|
+
config_id=variables_id,
|
|
355
|
+
row_id=target_row["id"],
|
|
356
|
+
configuration=row_config,
|
|
357
|
+
change_description="Updated via kbagent config variables-set",
|
|
358
|
+
branch_id=branch_id,
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
self._extend_schema_if_new_keys(
|
|
362
|
+
client=client,
|
|
363
|
+
vars_cfg=vars_cfg,
|
|
364
|
+
variables=final_values,
|
|
365
|
+
branch_id=branch_id,
|
|
366
|
+
)
|
|
367
|
+
return target_row["id"], final_values
|
|
368
|
+
|
|
369
|
+
@staticmethod
|
|
370
|
+
def _build_encrypted_row_configuration(
|
|
371
|
+
*,
|
|
372
|
+
client: Any,
|
|
373
|
+
project_id: int,
|
|
374
|
+
variables: dict[str, str],
|
|
375
|
+
allow_plaintext_fallback: bool,
|
|
376
|
+
) -> dict[str, Any]:
|
|
377
|
+
"""Shape a ``{values: [...]}`` row config and encrypt ``#``-prefixed entries.
|
|
378
|
+
|
|
379
|
+
``#``-prefixed names keep the prefix (the Encryption API and the
|
|
380
|
+
transformation runner both key off it). :func:`encrypt_secrets_in_config`
|
|
381
|
+
recognizes the ``{name, value}`` list shape directly, so no pre-flatten
|
|
382
|
+
dance is needed.
|
|
383
|
+
"""
|
|
384
|
+
row_config: dict[str, Any] = {
|
|
385
|
+
"values": [{"name": k, "value": v} for k, v in variables.items()],
|
|
386
|
+
}
|
|
387
|
+
encrypt_secrets_in_config(
|
|
388
|
+
client,
|
|
389
|
+
project_id,
|
|
390
|
+
VARIABLES_COMPONENT_ID,
|
|
391
|
+
row_config,
|
|
392
|
+
allow_plaintext_fallback=allow_plaintext_fallback,
|
|
393
|
+
)
|
|
394
|
+
return row_config
|
|
395
|
+
|
|
396
|
+
@staticmethod
|
|
397
|
+
def _resolve_values_row(
|
|
398
|
+
vars_cfg: dict[str, Any], values_id: str | None
|
|
399
|
+
) -> dict[str, Any] | None:
|
|
400
|
+
"""Return the row matching ``values_id``, or the first row (default)."""
|
|
401
|
+
rows = vars_cfg.get("rows", [])
|
|
402
|
+
if not rows:
|
|
403
|
+
return None
|
|
404
|
+
if values_id:
|
|
405
|
+
return next((r for r in rows if r["id"] == values_id), None)
|
|
406
|
+
return rows[0]
|
|
407
|
+
|
|
408
|
+
def _extend_schema_if_new_keys(
|
|
409
|
+
self,
|
|
410
|
+
*,
|
|
411
|
+
client: Any,
|
|
412
|
+
vars_cfg: dict[str, Any],
|
|
413
|
+
variables: dict[str, str],
|
|
414
|
+
branch_id: int | None,
|
|
415
|
+
) -> None:
|
|
416
|
+
"""Add any brand-new keys to the variables config's schema.
|
|
417
|
+
|
|
418
|
+
Keboola renders variables whose names appear in
|
|
419
|
+
``configuration.variables`` (the schema) differently from stray keys in
|
|
420
|
+
the row ``values`` array. Keeping the schema in sync makes new vars
|
|
421
|
+
visible in the UI without a second round-trip.
|
|
422
|
+
"""
|
|
423
|
+
existing_schema = vars_cfg.get("configuration", {}).get("variables", [])
|
|
424
|
+
existing_names = {v["name"] for v in existing_schema}
|
|
425
|
+
new_names = {k.lstrip("#") for k in variables} - existing_names
|
|
426
|
+
if not new_names:
|
|
427
|
+
return
|
|
428
|
+
|
|
429
|
+
updated_schema = list(existing_schema) + [
|
|
430
|
+
{"name": n, "type": "string"} for n in sorted(new_names)
|
|
431
|
+
]
|
|
432
|
+
new_configuration = copy.deepcopy(vars_cfg.get("configuration") or {})
|
|
433
|
+
new_configuration["variables"] = updated_schema
|
|
434
|
+
|
|
435
|
+
variables_id = vars_cfg["id"]
|
|
436
|
+
try:
|
|
437
|
+
client.update_config(
|
|
438
|
+
component_id=VARIABLES_COMPONENT_ID,
|
|
439
|
+
config_id=variables_id,
|
|
440
|
+
configuration=new_configuration,
|
|
441
|
+
change_description="Schema extended by kbagent",
|
|
442
|
+
branch_id=branch_id,
|
|
443
|
+
)
|
|
444
|
+
except KeboolaApiError as exc:
|
|
445
|
+
# Schema sync is cosmetic (values still work without it). Log and
|
|
446
|
+
# continue rather than fail the whole operation.
|
|
447
|
+
logger.warning("Schema sync failed for variables config %s: %s", variables_id, exc)
|