zenml-nightly 0.84.0.dev20250728__py3-none-any.whl → 0.84.0.dev20250730__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.
- zenml/VERSION +1 -1
- zenml/client.py +6 -1
- zenml/code_repositories/git/local_git_repository_context.py +3 -4
- zenml/constants.py +28 -0
- zenml/integrations/azure/service_connectors/azure_service_connector.py +20 -9
- zenml/integrations/gcp/__init__.py +4 -1
- zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +20 -1
- zenml/integrations/kubernetes/orchestrators/kube_utils.py +80 -3
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +18 -14
- zenml/logging/__init__.py +0 -11
- zenml/logging/step_logging.py +255 -149
- zenml/models/__init__.py +6 -0
- zenml/models/v2/core/service_account.py +87 -1
- zenml/models/v2/core/step_run.py +13 -0
- zenml/models/v2/core/user.py +20 -6
- zenml/models/v2/misc/exception_info.py +30 -0
- zenml/models/v2/misc/external_user.py +4 -1
- zenml/orchestrators/publish_utils.py +10 -0
- zenml/orchestrators/step_launcher.py +11 -6
- zenml/orchestrators/step_runner.py +26 -1
- zenml/utils/exception_utils.py +90 -0
- zenml/zen_server/auth.py +138 -27
- zenml/zen_server/dashboard/assets/{404-B5cfnwZ1.js → 404-CMbwR10f.js} +1 -1
- zenml/zen_server/dashboard/assets/{@radix-C_LirfyT.js → @radix-B1sy0Lhr.js} +1 -1
- zenml/zen_server/dashboard/assets/{@react-router-BSsrkPOd.js → @react-router-CHjLNlgw.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-D9hglKLF.js → @reactflow-gbyyU3kq.js} +2 -2
- zenml/zen_server/dashboard/assets/{@tanstack-C0SeHZng.js → @tanstack-Dwlisomv.js} +1 -1
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-BpLj419i.js +1 -0
- zenml/zen_server/dashboard/assets/ButtonGroup-DVhzbQxV.js +1 -0
- zenml/zen_server/dashboard/assets/{CodeSnippet-D8iBqOVv.js → CodeSnippet-B7Wd4R8u.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-D0-pQi1n.js → CollapsibleCard-DSZzbjx5.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-mw2Ja_ON.js → ComponentBadge-MVT08kBV.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-BXgpt-jw.js → ComponentIcon-C9AY8usJ.js} +1 -1
- zenml/zen_server/dashboard/assets/DeleteAlertDialog-CzhTVQaC.js +1 -0
- zenml/zen_server/dashboard/assets/{DialogItem-DeME0oSt.js → DialogItem-DD_7v3UY.js} +1 -1
- zenml/zen_server/dashboard/assets/{DisplayDate-v3KW7oez.js → DisplayDate-57lUNS79.js} +1 -1
- zenml/zen_server/dashboard/assets/{EmptyState-DG0m-CGv.js → EmptyState-BMA34iVR.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-DcVLcrLs.js → Error-Cakgjexo.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-C4tlFnlh.js → ExecutionStatus-CQbWovhV.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-C-RGHz3S.js → Helpbox-7FZpmsHB.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-DFCWPbMb.js → Infobox-DnduZjNU.js} +1 -1
- zenml/zen_server/dashboard/assets/{LeftSideMenu-Czev0KCA.js → LeftSideMenu-D5UEs4vB.js} +1 -1
- zenml/zen_server/dashboard/assets/{Lock-CRP5J_su.js → Lock-u8WOoTTd.js} +1 -1
- zenml/zen_server/dashboard/assets/NestedCollapsible-0yviIfaA.js +1 -0
- zenml/zen_server/dashboard/assets/{NumberBox-CoQjQYDJ.js → NumberBox-C2Pju4PR.js} +1 -1
- zenml/zen_server/dashboard/assets/{Pagination-CcDD5yHh.js → Pagination-C1sE5Nzn.js} +1 -1
- zenml/zen_server/dashboard/assets/{Partials-DlMzfKgs.js → Partials-DosysQMU.js} +1 -1
- zenml/zen_server/dashboard/assets/{PasswordChecker-BZwoeQIm.js → PasswordChecker-DOPLfvg7.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-CU2ycJDo.js → ProCta-CUkpV3PJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-BMAn9Jld.js → ProviderIcon-aQjTuTRX.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-D_q9tE3G.js → ProviderRadio-C6pLVNxC.js} +1 -1
- zenml/zen_server/dashboard/assets/RunsBody-CZAiSxYK.js +1 -0
- zenml/zen_server/dashboard/assets/{SearchField-D_0-uAPj.js → SearchField-Byv1PtST.js} +1 -1
- zenml/zen_server/dashboard/assets/{SecretTooltip-BcWMKb9f.js → SecretTooltip-CErfhVgF.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-CaKVSqAL.js → SetPassword-C4OH-cn1.js} +1 -1
- zenml/zen_server/dashboard/assets/{SheetHeader-7vwlsY_i.js → SheetHeader-Bb3v9rha.js} +1 -1
- zenml/zen_server/dashboard/assets/StackComponentList-D85oab98.js +1 -0
- zenml/zen_server/dashboard/assets/StackList-DSAjbVb5.js +1 -0
- zenml/zen_server/dashboard/assets/Tabs-2uwqXsdL.js +1 -0
- zenml/zen_server/dashboard/assets/Tick-BQ7_xDBl.js +1 -0
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-Da5RndbV.js → UpdatePasswordSchemas-DNkYgzN6.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-8aJzxUjb.js → Wizard-2FIi8JNY.js} +1 -1
- zenml/zen_server/dashboard/assets/WizardFooter-DQEnlDmZ.js +1 -0
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-gorNNEaT.js → all-pipeline-runs-query-CdvWtiAY.js} +1 -1
- zenml/zen_server/dashboard/assets/{arrow-left-hcj2H8HY.js → arrow-left-BFB2mgJo.js} +1 -1
- zenml/zen_server/dashboard/assets/{bar-chart-square-check-9siI9icm.js → bar-chart-square-check-_m-oYysN.js} +1 -1
- zenml/zen_server/dashboard/assets/{bulk-delete-B5RTlnD_.js → bulk-delete-wdObjfps.js} +2 -2
- zenml/zen_server/dashboard/assets/{check-D1bHMJkL.js → check-C9Nye5lR.js} +1 -1
- zenml/zen_server/dashboard/assets/{check-circle-mnEgPhPF.js → check-circle-CG6XAdk-.js} +1 -1
- zenml/zen_server/dashboard/assets/{chevron-down-Z3nUe-0U.js → chevron-down-Bl7WwQAL.js} +1 -1
- zenml/zen_server/dashboard/assets/{chevron-right-double-CbRQKN4Q.js → chevron-right-double-CbMG1dOM.js} +1 -1
- zenml/zen_server/dashboard/assets/{clock-BMjHXT3f.js → clock-BnPvxp3D.js} +1 -1
- zenml/zen_server/dashboard/assets/{code-browser-DftoiCIg.js → code-browser-CzWvJ4S6.js} +1 -1
- zenml/zen_server/dashboard/assets/configuration-form-BbcNBQTO.js +1 -0
- zenml/zen_server/dashboard/assets/constants-DfvsDtcH.js +1 -0
- zenml/zen_server/dashboard/assets/{create-stack-BruqH_6X.js → create-stack-D4Sf7QpF.js} +1 -1
- zenml/zen_server/dashboard/assets/{credit-card-CH1BHrXY.js → credit-card-DfBA6dBb.js} +1 -1
- zenml/zen_server/dashboard/assets/{dataflow-2-qHjWt7zp.js → dataflow-2-BLkaTH0Q.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-ibBtciMR.js → delete-run-XSre8ru-.js} +1 -1
- zenml/zen_server/dashboard/assets/{expand-full-CD4fFvM-.js → expand-full-C8p_0jQv.js} +1 -1
- zenml/zen_server/dashboard/assets/{eye-CLNgIh_K.js → eye-BXcQevds.js} +1 -1
- zenml/zen_server/dashboard/assets/{file-text-CltVhgwZ.js → file-text-TdPXNd7s.js} +1 -1
- zenml/zen_server/dashboard/assets/form-C1jJgRy1.js +1 -0
- zenml/zen_server/dashboard/assets/{form-schemas-B9XgTS1V.js → form-schemas-BjWDRvGd.js} +1 -1
- zenml/zen_server/dashboard/assets/{help-B0CvBhCm.js → help-CRPfbPTO.js} +1 -1
- zenml/zen_server/dashboard/assets/{icon-hDriJUXY.js → icon--Tp6obFZ.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-mA8kL088.js → index-B4ZeIaPd.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-dCcVgFNl.js → index-BYHxFvoG.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BQWlHo1Y.js → index-BYzR7YrM.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BacoJBEQ.js → index-CO6UN3UX.js} +11 -11
- zenml/zen_server/dashboard/assets/{index-B7CRNU8l.js → index-d_QrPL-8.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BRhKF2z-.js → index-g7wOyc86.js} +1 -1
- zenml/zen_server/dashboard/assets/index-n_sn2ITN.css +1 -0
- zenml/zen_server/dashboard/assets/{index.es-DcVFDpJU.js → index.es-CZMSrR6z.js} +1 -1
- zenml/zen_server/dashboard/assets/{index.esm-COnaHLSh.js → index.esm-SBF9nn_P.js} +1 -1
- zenml/zen_server/dashboard/assets/{info-CyMih3vQ.js → info-CI2szPUG.js} +1 -1
- zenml/zen_server/dashboard/assets/{key-icon-HOx2gazv.js → key-icon-BiV171aI.js} +1 -1
- zenml/zen_server/dashboard/assets/layout-Cyc-V16c.js +1 -0
- zenml/zen_server/dashboard/assets/{layout-C5dgIReC.js → layout-GIiNvS10.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-CidpsqyH.js → login-mutation-CDgTlQBD.js} +1 -1
- zenml/zen_server/dashboard/assets/{logs-DoLoTEfj.js → logs-lNLbZqHL.js} +1 -1
- zenml/zen_server/dashboard/assets/{mail-C160gvB0.js → mail-DBJRSzyu.js} +1 -1
- zenml/zen_server/dashboard/assets/{message-chat-square-DLz6XmPS.js → message-chat-square-C3CRCQvD.js} +1 -1
- zenml/zen_server/dashboard/assets/{package-BhYXGPxF.js → package-pR4bbXJp.js} +1 -1
- zenml/zen_server/dashboard/assets/page-1DXG7hp8.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BCRXJXC9.js → page-43SWdz4k.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-YdWnx9MX.js → page-AOVMuHDc.js} +1 -1
- zenml/zen_server/dashboard/assets/page-B4QBxV0B.js +22 -0
- zenml/zen_server/dashboard/assets/{page-CvllZMBF.js → page-B8ict_cR.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BDre_qCO.js +1 -0
- zenml/zen_server/dashboard/assets/page-BbsvGfyi.js +18 -0
- zenml/zen_server/dashboard/assets/page-Bi4I23Hs.js +1 -0
- zenml/zen_server/dashboard/assets/page-BnAMyQZb.js +1 -0
- zenml/zen_server/dashboard/assets/{page-D6cvOG8w.js → page-BnZEAhNn.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Bncp08FW.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BTDi81N3.js → page-C4Jnp1qP.js} +1 -1
- zenml/zen_server/dashboard/assets/page-C7Z2sDHE.js +1 -0
- zenml/zen_server/dashboard/assets/page-C8t9qLdV.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BByayrO-.js → page-C9IsnFid.js} +2 -2
- zenml/zen_server/dashboard/assets/page-CEHZzQ1Q.js +1 -0
- zenml/zen_server/dashboard/assets/page-CGtll3Jk.js +1 -0
- zenml/zen_server/dashboard/assets/{page-q41JNDWO.js → page-CKPkbOoE.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DF4FVxxW.js → page-CMvcoaSZ.js} +2 -2
- zenml/zen_server/dashboard/assets/page-CVwTAlzd.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DSZfclXt.js → page-ClqRvz_V.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-7CJ4Wq3O.js → page-CzDjN1wE.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BK59rZvf.js → page-D654xHWd.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DcXrWWWh.js → page-DLrYW-Dn.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DOnAInjC.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Cc8owYXQ.js → page-DQncGJeH.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DQzNmXk3.js +1 -0
- zenml/zen_server/dashboard/assets/{page-FQxi1Otg.js → page-DSn1Jcvs.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DZ5hcS1o.js +1 -0
- zenml/zen_server/dashboard/assets/page-DerIbaqa.js +1 -0
- zenml/zen_server/dashboard/assets/{page-8U20Tu_8.js → page-DgOEl3Bc.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DgldL5UB.js → page-DgSu4pTE.js} +2 -2
- zenml/zen_server/dashboard/assets/page-DgblJuXC.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CY0LPcAJ.js → page-Dpw-xP4q.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DsFXol8x.js +1 -0
- zenml/zen_server/dashboard/assets/page-Du6bFZTS.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CeGBDh1Q.js → page-DznxxpKA.js} +1 -1
- zenml/zen_server/dashboard/assets/page-E9Mx9_rn.js +1 -0
- zenml/zen_server/dashboard/assets/page-HrebZOAM.js +1 -0
- zenml/zen_server/dashboard/assets/{page-BX67x4iL.js → page-O5xnz_nW.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DDWW21kl.js → page-hX7NkNdA.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-BKKcL1Kp.js → persist-B3Hb8HDW.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-DxiyfAax.js → persist-Dkbp9MFP.js} +1 -1
- zenml/zen_server/dashboard/assets/{pipeline-BJ8liDnl.js → pipeline-CDJSAXrb.js} +1 -1
- zenml/zen_server/dashboard/assets/{plus-cI8zD2xh.js → plus-DOrkJCmy.js} +1 -1
- zenml/zen_server/dashboard/assets/primary-role-CjkpP9fL.js +1 -0
- zenml/zen_server/dashboard/assets/{react-error-boundary.esm-DoXxY4pT.js → react-error-boundary.esm-DgOYA0wh.js} +1 -1
- zenml/zen_server/dashboard/assets/{refresh-3EF2R7ja.js → refresh-C8BXS3Fb.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-tyes-list-B5rkZcbc.js → resource-tyes-list-CugyWUAE.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-type-tooltip-E97WGqfk.js → resource-type-tooltip-V-zdiLKz.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-B9aVzfAF.js → service-FjqYTmBw.js} +2 -2
- zenml/zen_server/dashboard/assets/{service-connectors-DL2-k_E2.js → service-connectors-nF4-OXB9.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-DyUO09BR.js → sharedSchema-Br1JPr8d.js} +1 -1
- zenml/zen_server/dashboard/assets/{slash-circle-D2Lb2FyR.js → slash-circle-B0xMh8q6.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-Bc4QKlWg.js → stack-detail-query-DnyMCdVE.js} +1 -1
- zenml/zen_server/dashboard/assets/{terminal-BObrvDlO.js → terminal-C2tAF2XG.js} +1 -1
- zenml/zen_server/dashboard/assets/{terminal-square-BObrvDlO.js → terminal-square-C2tAF2XG.js} +1 -1
- zenml/zen_server/dashboard/assets/{transform-DFpKTKgF.js → transform-S7omcvTm.js} +1 -1
- zenml/zen_server/dashboard/assets/{trash-HKxXWbSG.js → trash-D9LA4VFD.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-current-user-mutation-DSyUyHVj.js → update-current-user-mutation-B3Dpv3u6.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CdM-Sdds.js → update-server-settings-mutation-s7tlHN8s.js} +1 -1
- zenml/zen_server/dashboard/assets/{zod-DgEcN9jD.js → zod-D48zuELD.js} +1 -1
- zenml/zen_server/dashboard/index.html +7 -7
- zenml/zen_server/rbac/zenml_cloud_rbac.py +8 -4
- zenml/zen_server/routers/service_accounts_endpoints.py +71 -12
- zenml/zen_stores/base_zen_store.py +0 -19
- zenml/zen_stores/migrations/versions/8d4b9ba22c1f_add_user_avatar.py +39 -0
- zenml/zen_stores/migrations/versions/d4591f95ac07_step_exception_info.py +43 -0
- zenml/zen_stores/schemas/step_run_schemas.py +19 -0
- zenml/zen_stores/schemas/user_schemas.py +16 -5
- zenml/zen_stores/sql_zen_store.py +5 -1
- {zenml_nightly-0.84.0.dev20250728.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/METADATA +1 -1
- {zenml_nightly-0.84.0.dev20250728.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/RECORD +180 -176
- zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-druRNuO2.js +0 -1
- zenml/zen_server/dashboard/assets/ButtonGroup-SF2DlzHV.js +0 -1
- zenml/zen_server/dashboard/assets/DeleteAlertDialog-BbyFVnVI.js +0 -1
- zenml/zen_server/dashboard/assets/NestedCollapsible-CN9scBUn.js +0 -1
- zenml/zen_server/dashboard/assets/RunsBody-BToytB8e.js +0 -1
- zenml/zen_server/dashboard/assets/StackComponentList-s7eSfm8o.js +0 -1
- zenml/zen_server/dashboard/assets/StackList-Dt0FrIkM.js +0 -1
- zenml/zen_server/dashboard/assets/Tabs-B27AHUfo.js +0 -1
- zenml/zen_server/dashboard/assets/Tick-DDeDgTuT.js +0 -1
- zenml/zen_server/dashboard/assets/WizardFooter-Bt7_UE14.js +0 -1
- zenml/zen_server/dashboard/assets/configuration-form-Yz8m0QIG.js +0 -1
- zenml/zen_server/dashboard/assets/constants-DeV48DuZ.js +0 -1
- zenml/zen_server/dashboard/assets/form-6aSt3tIl.js +0 -1
- zenml/zen_server/dashboard/assets/index-eggipFZS.css +0 -1
- zenml/zen_server/dashboard/assets/layout-CFLL6-CM.js +0 -1
- zenml/zen_server/dashboard/assets/page-6huxSHEu.js +0 -1
- zenml/zen_server/dashboard/assets/page-BMpXak4U.js +0 -1
- zenml/zen_server/dashboard/assets/page-Bjmcdg64.js +0 -1
- zenml/zen_server/dashboard/assets/page-BsAn8p4m.js +0 -1
- zenml/zen_server/dashboard/assets/page-BwjPRuaY.js +0 -1
- zenml/zen_server/dashboard/assets/page-CDtSVkNc.js +0 -1
- zenml/zen_server/dashboard/assets/page-CEDU0L2T.js +0 -1
- zenml/zen_server/dashboard/assets/page-COJK90rG.js +0 -1
- zenml/zen_server/dashboard/assets/page-C_XMn4GU.js +0 -1
- zenml/zen_server/dashboard/assets/page-Cb3KGsPK.js +0 -22
- zenml/zen_server/dashboard/assets/page-CiGOVsj3.js +0 -1
- zenml/zen_server/dashboard/assets/page-CmLSFMkW.js +0 -1
- zenml/zen_server/dashboard/assets/page-CnfCptXq.js +0 -1
- zenml/zen_server/dashboard/assets/page-CxzglV3-.js +0 -1
- zenml/zen_server/dashboard/assets/page-DVLez4R1.js +0 -1
- zenml/zen_server/dashboard/assets/page-Dg7-H_9i.js +0 -1
- zenml/zen_server/dashboard/assets/page-Dw7XuiSo.js +0 -18
- zenml/zen_server/dashboard/assets/page-XrmOHHg7.js +0 -1
- zenml/zen_server/dashboard/assets/page-oRm7D4TC.js +0 -1
- zenml/zen_server/dashboard/assets/page-x2GXC8sI.js +0 -1
- zenml/zen_server/dashboard/assets/page-z2FXP4GY.js +0 -1
- zenml/zen_server/dashboard/assets/primary-role-CPGHymjN.js +0 -1
- {zenml_nightly-0.84.0.dev20250728.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.84.0.dev20250728.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.84.0.dev20250728.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/entry_points.txt +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
import{j as e,r as l}from"./@radix-C_LirfyT.js";import{c as k,L as S,f as z}from"./@react-router-BSsrkPOd.js";import{S as y}from"./check-circle-mnEgPhPF.js";import{S as L,a as M,c as C,B as m,T as E,r as P,b as V,u as B,d as o,g as Z,A as G,e as I,z as d,f as O,h as F,i as D,j as f,k as R,P as w,D as H,l as T,m as J,C as Q,n as Y,o as g,p as K}from"./index-BacoJBEQ.js";import{S as X}from"./file-text-CltVhgwZ.js";import{S as q}from"./mail-C160gvB0.js";import{S as W}from"./chevron-down-Z3nUe-0U.js";import{b as p}from"./@tanstack-C0SeHZng.js";import{p as N}from"./index-BQWlHo1Y.js";import{T as v}from"./Tick-DDeDgTuT.js";import{S as U,M as $,a as _}from"./index-mA8kL088.js";import{C as j}from"./CodeSnippet-D8iBqOVv.js";import{H as ee}from"./Helpbox-C-RGHz3S.js";import{F as se}from"./icon-hDriJUXY.js";import{S as te}from"./SheetHeader-7vwlsY_i.js";import"./@reactflow-D9hglKLF.js";import"./check-D1bHMJkL.js";import"./help-B0CvBhCm.js";import"./chevron-right-double-CbRQKN4Q.js";function re(){const s=k();return e.jsxs("div",{className:"flex w-full items-center justify-between gap-2 rounded-md border border-success-300 bg-success-50 px-4 py-3 text-success-900",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{className:"size-5 shrink-0 fill-current"}),e.jsx("p",{className:"font-semibold",children:"Great job! You've mastered the ZenML basics."}),e.jsx("p",{className:"text-text-sm",children:"Time to level up with production workflows."})]}),e.jsxs("button",{onClick:()=>s(window.location.pathname),children:[e.jsx("span",{className:"sr-only",children:"Close"}),e.jsx(L,{className:"size-5 fill-current"})]})]})}const ne=[{icon:e.jsx(q,{className:"size-5 shrink-0 fill-warning-500"}),backgroundColor:"bg-warning-50",title:"Send us a message",href:"mailto:cloud@zenml.io"},{icon:e.jsx(X,{className:"size-5 shrink-0 fill-blue-400"}),backgroundColor:"bg-blue-25",title:"Browse our docs",href:"https://docs.zenml.io"},{icon:e.jsx(M,{className:"size-5 shrink-0 fill-primary-400"}),backgroundColor:"bg-primary-25",title:"Read our blog",href:"https://zenml.io/blog"}];function ae(){return e.jsxs("section",{className:"space-y-5",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Support Resources"}),e.jsx("ul",{className:"grid grid-cols-2 gap-3 xl:grid-cols-3",children:ne.map((s,t)=>e.jsx("li",{children:e.jsx(ie,{...s})},t))})]})}function ie({icon:s,backgroundColor:t,title:r,href:a}){return e.jsxs("a",{href:a,target:"_blank",rel:"noreferrer noopener",className:"flex items-center gap-3 overflow-hidden rounded-md border border-theme-border-moderate bg-theme-surface-primary p-1 transition-shadow duration-200 hover:shadow-sm",children:[e.jsx("div",{className:C("flex aspect-square size-8 items-center justify-center rounded-md",t),children:s}),e.jsx("div",{className:"space-y-0.5",children:e.jsx("span",{className:"font-semibold",children:r})})]})}const le=[{title:"ZenCoder",description:"Your own MLOps Engineer",href:"https://github.com/zenml-io/zenml-projects/tree/main/zencoder",tag:"LLM",image:{src:"https://public-flavor-logos.s3.eu-central-1.amazonaws.com/projects/1.jpg",alt:"ZenCoder"}},{title:"Night Watch",description:"AI Database Summaries While You Sleep",href:"https://github.com/zenml-io/zenml-projects/tree/main/nightwatch-ai",tag:"Text Summarization",image:{src:"https://public-flavor-logos.s3.eu-central-1.amazonaws.com/projects/2.jpg",alt:"Night Watch"}},{title:"Magic Photobooth",description:"A personalized AI image generation product that can create your avatars from a selfie.",href:"https://github.com/zenml-io/zenml-projects/tree/main/magic-photobooth",tag:"Image Generation",image:{src:"https://public-flavor-logos.s3.eu-central-1.amazonaws.com/projects/3.jpg",alt:"Magic Photobooth"}},{title:"GameSense",description:"The LLM That Understands Gamers",href:"https://github.com/zenml-io/zenml-projects/tree/main/gamesense",tag:"LLM",image:{src:"https://public-flavor-logos.s3.eu-central-1.amazonaws.com/projects/4.jpg",alt:"GameSense"}}];function oe(){return e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Start with a project template"}),e.jsx(m,{className:"bg-theme-surface-primary",intent:"secondary",emphasis:"subtle",asChild:!0,children:e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/user-guides",children:"See more"})})]}),e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-4",children:le.map((s,t)=>e.jsx("li",{children:e.jsx(ce,{...s})},t))})]})}function ce({title:s,description:t,href:r,tag:a,image:n}){return e.jsxs("a",{href:r,target:"_blank",rel:"noreferrer noopener",className:"block overflow-hidden rounded-md border border-theme-border-moderate transition-shadow duration-200 hover:shadow-sm",children:[e.jsx("img",{className:"h-[110px] w-full object-cover",src:n.src,alt:n.alt}),e.jsxs("div",{className:"flex h-[150px] flex-col justify-between bg-theme-surface-primary p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-text-lg font-semibold",children:s}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:t})]}),e.jsx(E,{emphasis:"subtle",rounded:!1,size:"xs",className:"w-fit",color:"purple",children:a})]})]})}const de=s=>l.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1C8.55229 1 9 1.44772 9 2V3H15V2C15 1.44772 15.4477 1 16 1C16.5523 1 17 1.44772 17 2V3.00163C17.4755 3.00489 17.891 3.01471 18.2518 3.04419C18.8139 3.09012 19.3306 3.18868 19.816 3.43597C20.5686 3.81947 21.1805 4.43139 21.564 5.18404C21.8113 5.66937 21.9099 6.18608 21.9558 6.74817C22 7.28936 22 7.95372 22 8.75868V17.2413C22 18.0463 22 18.7106 21.9558 19.2518C21.9099 19.8139 21.8113 20.3306 21.564 20.816C21.1805 21.5686 20.5686 22.1805 19.816 22.564C19.3306 22.8113 18.8139 22.9099 18.2518 22.9558C17.7106 23 17.0463 23 16.2413 23H7.75868C6.95372 23 6.28936 23 5.74817 22.9558C5.18608 22.9099 4.66937 22.8113 4.18404 22.564C3.43139 22.1805 2.81947 21.5686 2.43597 20.816C2.18868 20.3306 2.09012 19.8139 2.04419 19.2518C1.99998 18.7106 1.99999 18.0463 2 17.2413V8.7587C1.99999 7.95373 1.99998 7.28937 2.04419 6.74817C2.09012 6.18608 2.18868 5.66937 2.43597 5.18404C2.81947 4.43139 3.43139 3.81947 4.18404 3.43597C4.66937 3.18868 5.18608 3.09012 5.74818 3.04419C6.10898 3.01471 6.52454 3.00489 7 3.00163V2C7 1.44772 7.44772 1 8 1ZM7 5.00176C6.55447 5.00489 6.20463 5.01356 5.91104 5.03755C5.47262 5.07337 5.24842 5.1383 5.09202 5.21799C4.7157 5.40973 4.40973 5.71569 4.21799 6.09202C4.1383 6.24842 4.07337 6.47262 4.03755 6.91104C4.00078 7.36113 4 7.94342 4 8.8V9H20V8.8C20 7.94342 19.9992 7.36113 19.9624 6.91104C19.9266 6.47262 19.8617 6.24842 19.782 6.09202C19.5903 5.7157 19.2843 5.40973 18.908 5.21799C18.7516 5.1383 18.5274 5.07337 18.089 5.03755C17.7954 5.01356 17.4455 5.00489 17 5.00176V6C17 6.55228 16.5523 7 16 7C15.4477 7 15 6.55228 15 6V5H9V6C9 6.55228 8.55229 7 8 7C7.44772 7 7 6.55228 7 6V5.00176ZM20 11H4V17.2C4 18.0566 4.00078 18.6389 4.03755 19.089C4.07337 19.5274 4.1383 19.7516 4.21799 19.908C4.40973 20.2843 4.7157 20.5903 5.09202 20.782C5.24842 20.8617 5.47262 20.9266 5.91104 20.9624C6.36113 20.9992 6.94342 21 7.8 21H16.2C17.0566 21 17.6389 20.9992 18.089 20.9624C18.5274 20.9266 18.7516 20.8617 18.908 20.782C19.2843 20.5903 19.5903 20.2843 19.782 19.908C19.8617 19.7516 19.9266 19.5274 19.9624 19.089C19.9992 18.6389 20 18.0566 20 17.2V11Z"})),me=s=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},l.createElement("path",{d:"M6.20195 14.6383C6.20195 15.7947 5.25733 16.7393 4.10098 16.7393C2.94463 16.7393 2 15.7947 2 14.6383C2 13.482 2.94463 12.5374 4.10098 12.5374H6.20195V14.6383Z",fill:"#E01E5A"}),l.createElement("path",{d:"M7.26056 14.6383C7.26056 13.482 8.20518 12.5374 9.36154 12.5374C10.5179 12.5374 11.4625 13.482 11.4625 14.6383V19.8989C11.4625 21.0553 10.5179 21.9999 9.36154 21.9999C8.20518 21.9999 7.26056 21.0553 7.26056 19.8989V14.6383Z",fill:"#E01E5A"}),l.createElement("path",{d:"M9.36154 6.20195C8.20518 6.20195 7.26056 5.25733 7.26056 4.10098C7.26056 2.94463 8.20518 2 9.36154 2C10.5179 2 11.4625 2.94463 11.4625 4.10098V6.20195H9.36154Z",fill:"#36C5F0"}),l.createElement("path",{d:"M9.36156 7.26062C10.5179 7.26062 11.4625 8.20525 11.4625 9.3616C11.4625 10.5179 10.5179 11.4626 9.36156 11.4626H4.10098C2.94463 11.4626 2 10.5179 2 9.3616C2 8.20525 2.94463 7.26062 4.10098 7.26062H9.36156Z",fill:"#36C5F0"}),l.createElement("path",{d:"M17.798 9.3616C17.798 8.20525 18.7426 7.26062 19.8989 7.26062C21.0553 7.26062 21.9999 8.20525 21.9999 9.3616C21.9999 10.5179 21.0553 11.4626 19.8989 11.4626H17.798V9.3616Z",fill:"#2EB67D"}),l.createElement("path",{d:"M16.7394 9.36156C16.7394 10.5179 15.7948 11.4625 14.6385 11.4625C13.4821 11.4625 12.5375 10.5179 12.5375 9.36156V4.10098C12.5375 2.94463 13.4821 2 14.6385 2C15.7948 2 16.7394 2.94463 16.7394 4.10098V9.36156Z",fill:"#2EB67D"}),l.createElement("path",{d:"M14.6384 17.7981C15.7947 17.7981 16.7394 18.7427 16.7394 19.8991C16.7394 21.0554 15.7947 22 14.6384 22C13.482 22 12.5374 21.0554 12.5374 19.8991V17.7981H14.6384Z",fill:"#ECB22E"}),l.createElement("path",{d:"M14.6385 16.7393C13.4821 16.7393 12.5375 15.7947 12.5375 14.6383C12.5375 13.482 13.4821 12.5374 14.6385 12.5374H19.899C21.0554 12.5374 22 13.482 22 14.6383C22 15.7947 21.0554 16.7393 19.899 16.7393H14.6385Z",fill:"#ECB22E"}));function pe(){return e.jsxs("section",{className:"space-y-5",children:[e.jsx("h2",{className:"text-text-xl font-semibold",children:"Your next steps with ZenML"}),e.jsxs("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:[e.jsx(x,{href:P.stacks.create.index,icon:e.jsx(V,{className:"size-5 shrink-0 fill-primary-400"}),backgroundColor:"bg-primary-25",title:"Add your stack",description:"Connect cloud infrastructure and ML tools to your workspace."}),e.jsx(x,{href:"https://zenml.io/slack",icon:e.jsx(me,{className:"size-5 shrink-0"}),backgroundColor:"bg-neutral-100",title:"Join our Community",description:"Join our Slack community with thousands of members like you."}),e.jsx(x,{href:"https://zenml.io/book-your-demo",icon:e.jsx(de,{className:"size-5 shrink-0 fill-success-400"}),backgroundColor:"bg-success-50",title:"Try ZenML Pro",description:"Book a demo and discover advanced features with our managed solution."})]})]})}function x({href:s,icon:t,backgroundColor:r,title:a,description:n}){const i=s.startsWith("http://")||s.startsWith("https://"),c=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:C("flex aspect-square size-8 items-center justify-center rounded-md",r),children:t}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("h3",{className:"text-text-lg font-semibold",children:a}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:n})]})]}),h="space-y-5 rounded-md border border-theme-border-moderate bg-theme-surface-primary p-5 transition-shadow duration-200 hover:shadow-sm";return i?e.jsx("a",{className:h,href:s,target:"_blank",rel:"noopener noreferrer",children:c}):e.jsx(S,{className:h,to:s,children:c})}function he(){const s=B();if(s.isPending)return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{className:"size-9 shrink-0 rounded-rounded"}),e.jsx(o,{className:"h-6 w-[200px]"})]});if(s.isError)return e.jsx("div",{children:"Error loading user"});const t=Z(s.data);return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(G,{size:"xl",children:e.jsx(I,{size:"xl",children:(t==null?void 0:t.charAt(0))||"U"})}),e.jsxs("span",{className:"text-display-xs font-semibold",children:["Welcome back",t?`, ${t}`:""]})]})}const ue=d.object({index:d.number(),directory:d.string(),name:d.string()}),xe=d.object({pipelineOrder:d.array(ue)});async function fe(){const s=await fetch("https://raw.githubusercontent.com/zenml-io/vscode-tutorial-extension/HEAD/pipelines/metadata.json");if(!s.ok)throw new Error("Failed to fetch pipelines from Github");const t=await s.json();return xe.parse(t)}function ge(s){return p({queryKey:["github","vscode-tutorial-extension","pipelines"],queryFn:async()=>fe(),...s})}async function je(s){const t=`https://raw.githubusercontent.com/zenml-io/vscode-tutorial-extension/HEAD/pipelines/${s}/${s}.py`,r=await fetch(t);if(!r.ok)throw new Error("Failed to fetch pipeline content");return await r.text()}function be(s,t){return p({queryKey:["github","vscode-tutorial-extension","pipeline-content",s],queryFn:async()=>je(s),...t})}async function ye(s){const t=`https://raw.githubusercontent.com/zenml-io/vscode-tutorial-extension/HEAD/pipelines/${s}/summary.md`,r=await fetch(t);if(!r.ok)throw new Error("Failed to fetch pipeline summary");return await r.text()}function Ce(s,t){return p({queryKey:["github","vscode-tutorial-extension","pipeline-summary",s],queryFn:async()=>ye(s),...t})}function we({children:s,onOpenChange:t,pipelineContent:r,open:a,name:n,displayName:i}){return e.jsxs(O,{open:a,onOpenChange:t,children:[e.jsx(F,{className:"w-full",children:s}),e.jsxs(D,{"aria-describedby":void 0,className:"w-[1000px] overflow-y-auto",children:[e.jsx(te,{}),e.jsx(ve,{displayName:i,pipelineContent:r,isDone:!1,name:n}),e.jsx("div",{className:"p-5",children:r?e.jsxs(f,{className:"space-y-5 p-5",children:[e.jsx(Ae,{pipelineName:n}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Create a"," ",e.jsxs("code",{className:"rounded-sm bg-primary-25 px-[4px] py-[2px] text-theme-text-brand",children:[n,".py"]})," ","file that defines your workflow using our Python SDK:"]}),e.jsx(j,{className:"w-full max-w-full",code:r,highlightCode:!0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Run the pipeline."}),e.jsx(j,{code:`python ${n}.py`})]}),e.jsx(ee,{link:"https://docs.zenml.io/user-guides/starter-guide/create-an-ml-pipeline"})]}):e.jsx(Ne,{})})]})]})}function Ne(){return e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-5 text-center",children:[e.jsx(se,{icon:e.jsx(_,{className:"h-[36px] w-[36px] fill-primary-400"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"We couldn't fetch the pipeline data"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Please try again later or check the code in our GitHub Repo."})]}),e.jsx(m,{size:"md",asChild:!0,className:"mx-auto w-fit",children:e.jsx("a",{href:"https://github.com/zenml-io/vscode-tutorial-extension/tree/develop/pipelines",target:"_blank",rel:"noreferrer",children:"Open in Github"})})]})}function ve({isDone:s,name:t,pipelineContent:r,displayName:a}){const{copied:n,copyToClipboard:i}=R();function c(){if(!r)return;const h=new Blob([r],{type:"text/x-python"}),A=URL.createObjectURL(h),u=document.createElement("a");u.href=A,u.download=`${t}.py`,u.click()}return e.jsxs("section",{className:"flex items-center justify-between border-b border-theme-border-moderate bg-theme-surface-primary p-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s?e.jsx(v,{}):e.jsx(w,{}),e.jsx(H,{className:"text-display-xs font-semibold",children:a})]}),r&&e.jsxs("div",{className:"flex items-center",children:[e.jsxs(m,{intent:"secondary",emphasis:"minimal",onClick:c,className:"flex aspect-square size-7 shrink-0 items-center justify-center p-0",children:[e.jsx(U,{className:"size-5 shrink-0 fill-theme-text-secondary"}),e.jsx("span",{className:"sr-only",children:"Download Pipeline"})]}),e.jsx(m,{intent:"secondary",emphasis:"minimal",className:"flex aspect-square size-7 shrink-0 items-center justify-center p-0",onClick:()=>i(r),children:n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sr-only",children:"Copied"}),e.jsx(y,{className:"size-5 shrink-0 fill-theme-text-secondary"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sr-only",children:"Copy Pipeline"}),e.jsx(T,{className:"size-5 shrink-0 fill-theme-text-secondary"})]})})]})]})}function Ae({pipelineName:s}){const t=Ce(s);return t.isPending?e.jsx(o,{className:"h-[60px] w-full"}):t.isError?null:e.jsx($,{className:"prose max-w-none rounded-md border border-primary-50 bg-primary-25 px-5 py-3 text-text-sm prose-pre:bg-primary-50",children:t.data})}function ke({displayName:s,pipelineName:t,isDone:r}){const[a,n]=l.useState(!1),i=be(t,{refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1});return i.isPending?e.jsx(o,{className:"h-[130px] w-full"}):e.jsx(we,{displayName:s,isDone:r,name:t,pipelineContent:i.data,open:a,onOpenChange:n,children:e.jsxs(f,{className:"space-y-5 p-5 text-start transition-shadow duration-200 hover:shadow-sm",children:[r?e.jsx(v,{}):e.jsx(w,{}),e.jsx("p",{className:"text-text-lg font-semibold",children:s})]})})}function Se({githubPipelines:s}){const t=p({...N.pipelineList({name:`oneof:${JSON.stringify(s)}`})});if(t.isPending)return e.jsx(o,{className:"h-1 w-full"});if(t.isError)return null;const r=t.data.items.length,a=r/s.length*100;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"whitespace-nowrap text-text-sm",children:[r,"/",s.length]}),e.jsx(J,{className:"h-1 w-full rounded-rounded",value:a})]})}const ze="data:image/webp;base64,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",Le="data:image/webp;base64,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";function Me(){const s=ge({refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1}),[t,r]=l.useState(!0);if(s.isPending)return e.jsx(o,{className:"h-[400px] w-full"});if(s.isError)return null;const a=s.data.pipelineOrder.sort((i,c)=>i.index-c.index),n=a.map(i=>i.directory);return e.jsxs(Q,{open:t,onOpenChange:r,children:[e.jsx(Y,{className:"flex items-center gap-[10px] p-0",children:e.jsxs("div",{className:"flex w-full flex-col items-center justify-between gap-5 p-5 lg:flex-row",children:[e.jsxs(g,{className:"flex-1 space-y-5",children:[e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsx("p",{className:"text-text-xl font-semibold",children:"Learn the core concepts of ZenML"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Click on a pipeline and follow the instructions to run it locally or run the tutorials with our VSCode Extension."})]}),e.jsx(Se,{githubPipelines:n})]}),e.jsx(Pe,{}),e.jsx(g,{children:e.jsx(W,{className:` ${t?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`})})]})}),e.jsx(K,{className:"border-t border-theme-border-moderate bg-theme-surface-primary p-5",children:e.jsx(Ee,{pipelines:a})})]})}function Ee({pipelines:s}){const t=s.map(n=>n.directory),r=p({...N.pipelineList({name:`oneof:${JSON.stringify(t)}`}),refetchInterval:3e4});if(r.isPending)return e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-3 xl:grid-cols-5",children:Array.from({length:s.length}).map((n,i)=>e.jsx("li",{children:e.jsx(o,{className:"h-[130px] w-full"})},i))});if(r.isError)return e.jsx("p",{children:"Error loading pipelines"});const a=r.data.items;return e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-3 xl:grid-cols-5",children:s.map(n=>e.jsx("li",{children:e.jsx(ke,{isDone:a.some(i=>i.name===n.directory),pipelineName:n.directory,displayName:n.name})},n.index))})}const b="zenml-io.zenml-tutorial";function Pe(){return e.jsxs(f,{className:"flex items-center justify-between gap-5 p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Install the extension"}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Available for VsCode or Cursor"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(m,{intent:"secondary",emphasis:"minimal",className:"aspect-square size-8 shrink-0 overflow-hidden border border-theme-border-moderate bg-theme-surface-primary p-0",asChild:!0,children:e.jsx("a",{href:`vscode:extension/${b}`,children:e.jsx("img",{src:Le,alt:"VsCode",className:"h-full w-full"})})}),e.jsx(m,{intent:"secondary",emphasis:"minimal",className:"aspect-square size-8 shrink-0 overflow-hidden bg-theme-surface-primary p-0",asChild:!0,children:e.jsx("a",{href:`cursor:extension/${b}`,children:e.jsx("img",{src:ze,alt:"Cursor",className:"h-full w-full"})})})]})]})}function $e(){const[s]=z(),t=s.get("success")==="true";return e.jsxs("div",{className:"layout-container space-y-8 py-5",children:[t&&e.jsx(re,{}),e.jsx(he,{}),e.jsx(Me,{}),e.jsx(pe,{}),e.jsx(oe,{}),e.jsx(ae,{})]})}export{$e as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as p,j as e}from"./@radix-C_LirfyT.js";import{v as D,y as C,Y as K,F as k,E,aC as T,aD as P,D as F,I as j,aG as O,aH as V,B as u,J as $,K as H,L as G,M as J,b7 as U,r as S,V as v,a0 as W,z as f,u as Y,d as N,aA as X,aB as Z,s as ee,aI as se,W as te,j as ae}from"./index-BacoJBEQ.js";import{P as re}from"./Pagination-CcDD5yHh.js";import{S as ne}from"./SearchField-D_0-uAPj.js";import{E as ie,S as le,s as ce,a as oe}from"./SecretTooltip-BcWMKb9f.js";import{c as A,h as I,b as me}from"./@tanstack-C0SeHZng.js";import{S as de}from"./Lock-CRP5J_su.js";import{D as ue}from"./DisplayDate-v3KW7oez.js";import{c as xe}from"./code-snippets-CqONne41.js";import{L as w,f as he}from"./@react-router-BSsrkPOd.js";import{S as L}from"./trash-HKxXWbSG.js";import{D as b}from"./DialogItem-DeME0oSt.js";import{S as pe}from"./eye-CLNgIh_K.js";import{S as q}from"./plus-cI8zD2xh.js";import{t as fe}from"./zod-DgEcN9jD.js";import{u as je,b as ge,C as g}from"./index.esm-COnaHLSh.js";import"./@reactflow-D9hglKLF.js";import"./chevron-right-double-CbRQKN4Q.js";import"./index-BRhKF2z-.js";import"./CodeSnippet-D8iBqOVv.js";import"./info-CyMih3vQ.js";async function ye(t){const s=C(E.secrets.detail(t)),a=await D(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(a.status===404&&K(),!a.ok)throw new k({message:"Error deleting secret",status:a.status,statusText:a.statusText});return a.json()}function Ne(t){return A({mutationFn:async s=>ye(s),...t})}function Se({secretId:t}){const s=I(),{mutate:a}=Ne({onSuccess(){s.invalidateQueries({queryKey:["secrets"]})}}),[r,n]=p.useState("");function o(){a(t)}function m(x){n(x.target.value)}return e.jsxs(T,{children:[e.jsx(P,{children:e.jsx(F,{children:"Delete secret"})}),e.jsxs("div",{className:"gap-5 p-5",children:[e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Are you sure you want to delete this secret?"}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"This action cannot be undone."}),e.jsx("h3",{className:"font-inter text-sm mb-1 mt-4 text-left font-medium leading-5",children:"Please type DELETE to confirm"}),e.jsx(j,{name:"key",onChange:m,className:"w-full",required:!0,value:r})]}),e.jsxs(O,{className:"gap-[10px]",children:[e.jsx(V,{asChild:!0,children:e.jsx(u,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(u,{intent:"danger",type:"submit",form:"edit-secret-form",onClick:o,disabled:r!=="DELETE",children:"Delete"})]})]})}function ve({secretId:t}){const[s,a]=p.useState(!1),[r,n]=p.useState(!1),o=p.useRef(null),m=p.useRef(null);function x(){m.current=o.current}function h(d){if(d===!1){a(!1),setTimeout(()=>{n(d)},200);return}n(d)}return e.jsxs($,{onOpenChange:a,open:s,children:[e.jsx(H,{ref:o,children:e.jsx(G,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsxs(J,{hidden:r,onCloseAutoFocus:d=>{m.current&&(m.current.focus(),m.current=null,d.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(b,{onSelect:x,onOpenChange:h,triggerChildren:"Edit ",icon:e.jsx(U,{}),children:e.jsx(ie,{secretId:t,isSecretNameEditable:!0,dialogTitle:"Edit secret"})}),e.jsx(b,{onSelect:x,onOpenChange:h,triggerChildren:"Delete ",icon:e.jsx(L,{}),children:e.jsx(Se,{secretId:t})})]})]})}const we=[{id:"secret",header:"Secret",accessorFn:t=>t.name,cell:({getValue:t,row:s})=>{const a=xe(s.original.name);return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(de,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsxs("div",{className:"flex flex-row items-center space-x-1",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(w,{className:"text-text-md font-semibold text-theme-text-primary",to:S.settings.secrets.detail(s.original.id),children:s.original.name}),e.jsx(le,{code:a})]}),e.jsx(v,{copyText:t()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{to:S.settings.secrets.detail(s.original.id),className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",children:s.original.id.slice(0,8)}),e.jsx(v,{copyText:s.original.id})]})]})]})}},{id:"author",header:"Author",accessorFn:t=>{var s,a;return(a=(s=t.resources)==null?void 0:s.user)==null?void 0:a.name},cell:({getValue:t})=>{const s=t();return s?e.jsx(W,{username:s}):null}},{id:"created_at",header:"Created At",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.created},cell:({getValue:t})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(ue,{dateString:t()})})},{id:"admin_actions",header:"",accessorFn:t=>String(t.id),cell:({row:t,getValue:s})=>{var r,n,o;const a=s();return(o=(n=(r=t.original.resources)==null?void 0:r.user)==null?void 0:n.body)!=null&&o.is_admin?e.jsx(ve,{secretId:a}):e.jsx("p",{className:"text-sm text-theme-text-secondary",children:"No Actions"})}}],y=1,be=f.object({page:f.coerce.number().min(y).optional().default(y).catch(y),name:f.string().optional(),operator:f.enum(["and","or"]).optional()});function De(){const[t]=he(),{page:s,name:a,operator:r}=be.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,operator:t.get("operator")||void 0});return{page:s,name:a,logical_operator:r}}async function Ce(t){const s=C(E.secrets.all),a=await D(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){const r=await a.json().then(n=>n.detail).catch(()=>"Failed to create Secret");throw new k({status:a.status,statusText:a.statusText,message:r})}return a.json()}function ke(t){return A({mutationFn:async s=>Ce(s),...t})}function Ee(){const[t,s]=p.useState(!1),a=Y();if(a.isPending)return e.jsx(N,{className:"h-7 w-full"});if(a.isError)return e.jsx("div",{children:"Error loading user"});const r=a.data.id;return e.jsxs(X,{open:t,onOpenChange:s,children:[e.jsx(Z,{asChild:!0,children:e.jsxs(u,{size:"md",className:"shrink-0",intent:"primary",children:[e.jsx(q,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Secret"})]})}),e.jsxs(T,{className:"mx-auto w-[90vw] max-w-[744px]",children:[e.jsx(P,{children:e.jsx(F,{children:"Register New Secret"})}),e.jsx(Te,{userId:r,setOpen:s})]})]})}function Te({userId:t,setOpen:s}){const{handleSubmit:a,control:r,watch:n,setValue:o,formState:{isValid:m},reset:x}=je({resolver:fe(ce),defaultValues:{secretName:"",keysValues:[{key:"",value:""}]}}),{fields:h,append:d,remove:_}=ge({control:r,name:"keysValues"}),{toast:M}=ee(),R=I(),{mutate:z}=ke({onError(i){se(i)&&M({status:"error",emphasis:"subtle",description:i.message,rounded:!0})},onSuccess(){R.invalidateQueries({queryKey:["secrets"]}),s(!1),x()}}),Q=i=>{z({user:t,name:i.secretName,values:i.keysValues.reduce((l,c)=>(c.key&&c.value&&(l[c.key]=c.value),l),{})})},B=i=>{Q(i)};return e.jsxs(e.Fragment,{children:[e.jsx("form",{id:"create-secret-form",className:"gap-5 p-5",onSubmit:a(B),children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("label",{className:"font-inter text-sm text-left font-medium leading-5",children:["Secret Name",e.jsx("span",{className:"ml-1 text-theme-text-error",children:"*"})]}),e.jsx(g,{name:"secretName",control:r,render:({field:i})=>e.jsx(j,{...i,className:"mb-3 w-full",required:!0})})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("div",{children:e.jsx("h1",{className:"font-inter text-lg text-left font-semibold",children:"Keys"})}),e.jsxs("div",{className:"mt-5 flex flex-row",children:[e.jsx("div",{className:"flex-grow",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Key"})}),e.jsx("div",{className:"flex-grow pr-12",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Value"})})]})]}),h.map((i,l)=>e.jsxs("div",{className:"flex flex-row items-center space-x-1",children:[e.jsx("div",{className:"relative flex-grow",children:e.jsx(g,{name:`keysValues.${l}.key`,control:r,render:({field:c})=>e.jsx(j,{...c,className:"mb-2 w-full",required:!0,placeholder:"key"})})}),e.jsx("div",{className:"relative flex-grow",children:e.jsxs("div",{className:"relative",children:[e.jsx(g,{name:`keysValues.${l}.value`,control:r,render:({field:c})=>e.jsx(j,{...c,className:"mb-2 w-full pr-10",required:!0,placeholder:"•••••••••",type:n(`keysValues.${l}.showPassword`)?"text":"password"})}),e.jsx("button",{type:"button",onClick:()=>{const c=n(`keysValues.${l}.showPassword`);o(`keysValues.${l}.showPassword`,!c)},className:"absolute inset-y-1 right-0 flex items-center pb-1 pr-3",children:e.jsx(pe,{className:"h-4 w-4 flex-shrink-0"})})]})}),e.jsxs("div",{className:"flex items-center",children:[l===h.length-1&&e.jsx(u,{intent:"primary",emphasis:"subtle",onClick:()=>d({key:"",value:""}),className:"mb-2 flex h-7 w-7 items-center justify-center",children:e.jsx(q,{className:"flex-shrink-0 fill-primary-600"})}),l!==h.length-1&&e.jsx(u,{intent:"secondary",emphasis:"minimal",onClick:()=>_(l),className:"mb-2 h-7 w-7 items-center justify-center",children:e.jsx(L,{className:"flex-shrink-0 fill-theme-text-secondary"})})]})]},i.id))]})}),e.jsxs(O,{className:"gap-[10px]",children:[e.jsx(V,{asChild:!0,children:e.jsx(u,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(u,{intent:"primary",disabled:!m,type:"submit",form:"create-secret-form",children:"Register Secret"})]})]})}function Pe(){const t=De(),{data:s}=me({...oe.secretList({...t,sort_by:"desc:created"}),throwOnError:!0});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(ne,{searchParams:t}),e.jsx(Ee,{})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:s?e.jsx(te,{columns:we,data:s.items}):e.jsx(N,{className:"h-[250px] w-full"})}),s?s.total_pages>1&&e.jsx(re,{searchParams:t,paginate:s}):e.jsx(N,{className:"h-[36px] w-[300px]"})]})]})}function Xe(){return e.jsxs(ae,{className:"space-y-4 p-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Secrets"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your pipeline secrets and configurations."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/interact-with-secrets",className:"link text-primary-400",children:"Learn More"})]})]}),e.jsx(Pe,{})]})}export{Xe as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as p,j as t}from"./@radix-C_LirfyT.js";import{u as F,W as Ze,L as Ue}from"./LeftSideMenu-Czev0KCA.js";import{W as D,H as O,B as E}from"./Wizard-8aJzxUjb.js";import{t as q}from"./zod-DgEcN9jD.js";import{z as y,d as Y,a5 as Ke,I as ge,B as M,aV as Ie,a_ as Qe,a$ as Ge,b0 as Ye,b1 as Je,az as Xe,b2 as et,aA as tt,aC as rt,D as st,aT as nt,L as ot,ac as it,v as at,y as ct,F as lt,E as ut,s as De,t as dt,A as ft,e as mt,at as ht,r as xt}from"./index-BacoJBEQ.js";import{a as v,C as k,u as W,F as $}from"./index.esm-COnaHLSh.js";import{S as R}from"./WizardFooter-Bt7_UE14.js";import{C as je}from"./ComponentIcon-BXgpt-jw.js";import{R as Z,a as U,s as pt,u as yt}from"./create-stack-BruqH_6X.js";import{f as gt}from"./index-B7CRNU8l.js";import{b as J,c as jt,k as Oe,h as _t}from"./@tanstack-C0SeHZng.js";import{g as vt,S as St,C as oe,P as ie}from"./ProviderRadio-D_q9tE3G.js";import{S as Ct}from"./transform-DFpKTKgF.js";import{C as L}from"./ProviderIcon-BMAn9Jld.js";import{g as bt,a as wt,D as Nt,b as Pt,z as Ft}from"./form-6aSt3tIl.js";import{s as kt}from"./sharedSchema-DyUO09BR.js";import{S as zt}from"./Lock-CRP5J_su.js";import{T as _e}from"./Tick-DDeDgTuT.js";import{s as Ee}from"./index-dCcVgFNl.js";import{C as At}from"./ComponentBadge-mw2Ja_ON.js";import{e as It}from"./components-Br2ezRib.js";import{L as Dt}from"./@react-router-BSsrkPOd.js";import"./@reactflow-D9hglKLF.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";import"./persist-DxiyfAax.js";import"./plus-cI8zD2xh.js";import"./trash-HKxXWbSG.js";import"./info-CyMih3vQ.js";import"./index.es-DcVFDpJU.js";import"./check-D1bHMJkL.js";import"./stack-detail-query-Bc4QKlWg.js";const Me=p.createContext(null);function Ot({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Me.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Me);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const Re=p.createContext(null);function be({children:e,initialSchema:r}){const[s,n]=p.useState(r),[o,a]=p.useState({});return t.jsx(Re.Provider,{value:{schema:s,setSchema:n,defaultValues:o,setDefaultValues:a},children:e})}function X(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Et=y.object({resourceId:y.string().min(1),flavor:y.string()});function Mt(){return t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"artifact_store",className:"h-5 w-5 fill-primary-400"}),"Select your Artifact Store"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Choose one of the storages for the new Artifact Store."})]})}var Le=Symbol.for("immer-nothing"),we=Symbol.for("immer-draftable"),g=Symbol.for("immer-state");function _(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function A(e){return!!e&&!!e[g]}function N(e){var r;return e?Te(e)||Array.isArray(e)||!!e[we]||!!((r=e.constructor)!=null&&r[we])||te(e)||re(e):!1}var Rt=Object.prototype.constructor.toString();function Te(e){if(!e||typeof e!="object")return!1;const r=z(e);if(r===null)return!0;const s=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Rt}function K(e,r){ee(e)===0?Reflect.ownKeys(e).forEach(s=>{r(s,e[s],e)}):e.forEach((s,n)=>r(n,s,e))}function ee(e){const r=e[g];return r?r.type_:Array.isArray(e)?1:te(e)?2:re(e)?3:0}function de(e,r){return ee(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function Be(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Lt(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}function te(e){return e instanceof Map}function re(e){return e instanceof Set}function w(e){return e.copy_||e.base_}function fe(e,r){if(te(e))return new Map(e);if(re(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const s=Te(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[g];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const l=o[a],u=n[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(z(e),n)}else{const n=z(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ve(e,r=!1){return se(e)||A(e)||!N(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Tt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>ve(n,!0))),e}function Tt(){_(2)}function se(e){return Object.isFrozen(e)}var Bt={};function P(e){const r=Bt[e];return r||_(0,e),r}var T;function Ve(){return T}function Vt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ne(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(qt),e.drafts_=null}function he(e){e===T&&(T=e.parent_)}function Pe(e){return T=Vt(T,e)}function qt(e){const r=e[g];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Fe(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[g].modified_&&(me(r),_(4)),N(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[g].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==Le?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[g];if(!n)return K(r,(o,a)=>ke(e,n,r,o,a,s)),r;if(n.scope_!==e)return r;if(!n.modified_)return G(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const o=n.copy_;let a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),K(a,(u,f)=>ke(e,n,o,u,f,s,l)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function ke(e,r,s,n,o,a,l){if(A(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Be(s,n,f),A(f))e.canAutoFreeze_=!1;else return}else l&&s.add(o);if(N(o)&&!se(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),(!r||!r.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,n)&&G(e,o)}}function G(e,r,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ve(r,s)}function Wt(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:Ve(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=Se;s&&(o=[n],a=B);const{revoke:l,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=l,u}var Se={get(e,r){if(r===g)return e;const s=w(e);if(!de(s,r))return $t(e,s,r);const n=s[r];return e.finalized_||!N(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in w(e)},ownKeys(e){return Reflect.ownKeys(w(e))},set(e,r,s){const n=qe(w(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(w(e),r),a=o==null?void 0:o[g];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Lt(s,o)&&(s!==void 0||de(e.base_,r)))return!0;ce(e),xe(e)}return e.copy_[r]===s&&(s!==void 0||r in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=s,e.assigned_[r]=!0),!0},deleteProperty(e,r){return ae(e.base_,r)!==void 0||r in e.base_?(e.assigned_[r]=!1,ce(e),xe(e)):delete e.assigned_[r],e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const s=w(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){_(11)},getPrototypeOf(e){return z(e.base_)},setPrototypeOf(){_(12)}},B={};K(Se,(e,r)=>{B[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});B.deleteProperty=function(e,r){return B.set.call(this,e,r,void 0)};B.set=function(e,r,s){return Se.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[g];return(s?w(s):e)[r]}function $t(e,r,s){var o;const n=qe(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function qe(e,r){if(!(r in e))return;let s=z(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=z(s)}}function xe(e){e.modified_||(e.modified_=!0,e.parent_&&xe(e.parent_))}function ce(e){e.copy_||(e.copy_=fe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ht=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,s,n)=>{if(typeof r=="function"&&typeof s!="function"){const a=s;s=r;const l=this;return function(f=a,...d){return l.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&_(6),n!==void 0&&typeof n!="function"&&_(7);let o;if(N(r)){const a=Pe(this),l=pe(r,void 0);let u=!0;try{o=s(l),u=!1}finally{u?me(a):he(a)}return Ne(a,n),Fe(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===Le&&(o=void 0),this.autoFreeze_&&ve(o,!0),n){const a=[],l=[];P("Patches").generateReplacementPatches_(r,o,a,l),n(a,l)}return o}else _(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(l,...u)=>this.produceWithPatches(l,f=>r(f,...u));let n,o;return[this.produce(r,s,(l,u)=>{n=l,o=u}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){N(e)||_(8),A(e)&&(e=Zt(e));const r=Pe(this),s=pe(e,void 0);return s[g].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[g];(!s||!s.isManual_)&&_(9);const{scope_:n}=s;return Ne(n,r),Fe(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,r){let s;for(s=r.length-1;s>=0;s--){const o=r[s];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}s>-1&&(r=r.slice(s+1));const n=P("Patches").applyPatches_;return A(e)?n(e,r):this.produce(e,o=>n(o,r))}};function pe(e,r){const s=te(e)?P("MapSet").proxyMap_(e,r):re(e)?P("MapSet").proxySet_(e,r):Wt(e,r);return(r?r.scope_:Ve()).drafts_.push(s),s}function Zt(e){return A(e)||_(10,e),We(e)}function We(e){if(!N(e)||se(e))return e;const r=e[g];let s;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,s=fe(e,r.scope_.immer_.useStrictShallowCopy_)}else s=fe(e,!0);return K(s,(n,o)=>{Be(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new Ht,I=j.produce;j.produceWithPatches.bind(j);j.setAutoFreeze.bind(j);j.setUseStrictShallowCopy.bind(j);j.applyPatches.bind(j);j.createDraft.bind(j);j.finishDraft.bind(j);function Ut(){const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(l=>l.accessible_by_service_connector.map(u=>({...l,value:u})));function a({flavor:l,resourceId:u}){const f=n.find(d=>d.flavor===l);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:l,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(h=>[h,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}function V({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=J({...gt.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(Y,{style:{height:`${n}px`,width:`${s}px`}}):t.jsx("img",{width:s,height:n,alt:`${e} logo`,...o,src:Ke(((l=a.data.items[0].body)==null?void 0:l.logo_url)??"")})}const Kt="artifact_store";function Qt(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=Ut(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Gt(){const e=W({resolver:q(Et),shouldUnregister:!0});return t.jsx($,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Artifact Store"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Mt,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Yt,{})})]})})}function Yt(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const $e=y.object({authMethod:y.string().min(1),stackName:kt});function Jt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=X(),u=J({...Ie.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const f=u.data.auth_methods.filter(m=>m.auth_method!=="implicit").map(m=>({name:m.name,auth_method:m.auth_method}));if(!((i=e.connectorConfig)!=null&&i.type)){r(1);return}function d(){var Ce;const m=n("authMethod"),x=(Ce=u.data)==null?void 0:Ce.auth_methods.find(ne=>ne.auth_method===m);if(!x)return;const C=x.config_schema,b=bt(C),He=wt(C);a($e.merge(b)),l(He),Object.keys(b.shape).forEach(ne=>o(ne))}const c=e.connectorConfig.type||"";return t.jsx(k,{control:s,name:"authMethod",render:({field:{onChange:m,ref:x,...C}})=>t.jsxs(Qe,{...C,onValueChange:b=>{m(b),d()},children:[t.jsx(Ge,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Ye,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(Je,{children:t.jsx(Xe,{viewportClassName:"max-h-[300px]",children:f.map(b=>t.jsx(et,{className:"space-x-2",value:b.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(L,{provider:c}),t.jsx("div",{children:b.name})]})},b.auth_method))})})]})})}function Xt(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(Ct,{className:"h-5 w-5 fill-primary-400"}),"Select an Authentication Method"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Connect ZenML to your resources for seamless integration of cloud services into your ML pipelines."})]}),t.jsx(Jt,{})]})}function er(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(zt,{className:"h-5 w-5 fill-primary-400"}),"Add your Configuration"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Your credentials are securely stored and encrypted. ZenML uses these credentials to interact with your resources."})]}),t.jsx(tr,{})]})}function tr(){var c,h;const{data:e}=S(),{watch:r}=v(),s=J({...Ie.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")}),n=r("authMethod"),o=(h=s.data)==null?void 0:h.auth_methods.find(i=>i.auth_method===n);if(s.isError)return null;if(s.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});if(!o)return null;const a=o.config_schema,l=a.properties||{},u=a.required||[],f=a.$defs,d=Object.entries(l).sort(([i],[m])=>u.includes(i)&&!u.includes(m)?-1:!u.includes(i)&&u.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:d.map(([i,m])=>t.jsx(Nt,{definitions:f,isOptional:Pt(i,u),name:i,schema:m},i))})}function rr({open:e,loadingComponents:r}){var n,o;const{data:s}=S();return(n=s.connectorConfig)!=null&&n.type?t.jsx(tt,{open:e,children:t.jsxs(rt,{onPointerDownOutside:a=>a.preventDefault(),onEscapeKeyDown:a=>a.preventDefault(),className:"max-w-[600px]",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-theme-border-moderate py-2 pl-5 pr-3",children:t.jsx(st,{className:"text-text-lg",children:"Connecting and loading your components..."})}),t.jsxs("div",{className:"flex h-[200px] items-center justify-center gap-5 bg-primary-50",children:[t.jsx(nt,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(ot,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(L,{className:"h-[60px] w-[60px]",provider:s.connectorConfig.type})]}),t.jsxs("div",{className:"flex flex-col gap-1 px-7 pb-6 pt-5",children:[t.jsxs("p",{className:"text-theme-text-secondary",children:["We're securely connecting to ",vt(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(sr,{loadingComponents:r})]})]})}):null}function sr({loadingComponents:e}){const[r,s]=p.useState(!0),[n,o]=p.useState(!0);return p.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),l=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(l)}},[]),t.jsxs("ul",{className:"mt-3 space-y-3 text-theme-text-secondary",children:[t.jsxs(ue,{children:[t.jsx(le,{loading:r}),"Establishing a secure connection"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:n}),"Authenticating your account"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:e}),"Fetching your existing components"]})]})}function le({loading:e}){return e?t.jsx(it,{className:"h-5 w-5 border-2"}):t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"})}function ue({children:e}){return t.jsx("li",{className:"flex items-center gap-1",children:e})}async function nr({payload:e}){const r=ct(ut.serviceConnectors.fullStackResources),s=await at(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching service connector type");throw new lt({status:s.status,statusText:s.statusText,message:n})}return s.json()}function or(e){return jt({...e,mutationFn:async({payload:r})=>nr({payload:r})})}function ir(){const{setCurrentStep:e}=F(),[r,s]=p.useState(!0),{toast:n}=De(),{setData:o,data:a}=S(),l=or({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await pt(200),e(d=>d+1)},onError:f=>{n({status:"error",emphasis:"subtle",description:f.message,rounded:!0})}});return{handleFormSubmit:({authMethod:f,stackName:d,...c})=>{Object.keys(c).forEach(i=>{(c[i]===""||c[i]===null||c[i]===void 0||Array.isArray(c[i])&&c[i].length===0)&&delete c[i]});const h=I(a,i=>{i.stackName=d,i.connectorConfig&&(i.connectorConfig.auth_method=f,i.connectorConfig.configuration={...c})});o(h),h.connectorConfig&&l.mutate({payload:h.connectorConfig})},fullStackResources:l,loadingComponents:r}}function ar(){const{handleSubmit:e,formState:{isSubmitting:r}}=v(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=ir();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(rr,{loadingComponents:o,open:r||n.isPending}),t.jsx(Xt,{}),t.jsx(St,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=X(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx($,{...s,children:t.jsxs(D,{children:[t.jsx(O,{children:"Connect to your Cloud"}),t.jsx(E,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!Oe();return t.jsx(M,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function ur(){const{data:e,setData:r}=S(),s=_t(),{toast:n}=De(),{setCurrentStep:o}=F(),{mutate:a}=yt({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(dt,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,h=>{h.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Ee.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const l=e.fullstackResources.components_resources_info.container_registry,u=l.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const h=l.find(m=>m.flavor===d);if(!h)return;const i=I(e,m=>{m.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(h.required_configuration||{}).map(x=>[x,c])),service_connector_resource_id:c}});r(i),a({payload:{name:i.stackName||Math.random().toString(36).substring(7),service_connectors:i.connectorConfig?[i.connectorConfig]:[],components:{orchestrator:[{...i.orchestratorConfig,service_connector_index:0}],artifact_store:[{...i.artifactStoreConfig,service_connector_index:0}],container_registry:[{...i.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const dr="container_registry";function fr(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=ur(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{width:24,height:24,type:dr,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function mr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"container_registry",className:"h-5 w-5 fill-primary-400"}),"Select your Container Registry"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the Container Registries for your new stack"})]})})}const hr=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)});function xr(){const e=W({resolver:q(hr),shouldUnregister:!0});return t.jsx($,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Container Registry"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(mr,{}),t.jsx(fr,{})]})}),t.jsx(R,{children:t.jsx(pr,{})})]})})}function pr(){const e=v(),r=!!Oe();return t.jsxs(M,{className:"justify-center gap-2",disabled:!e.formState.isValid||r,form:"artifact-store-form",size:"md",children:[r&&t.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),r?"Loading...":"Next"]})}function yr(){var a;const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:l,resourceId:u,...f}){const d=n.find(c=>c.flavor===l);d&&(r(c=>{const h=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(i=>[i,u])):{...f};return I(c,i=>{i.orchestratorConfig={flavor:l,configuration:h,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)}),H="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:l,reset:u,handleSubmit:f}=v(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==H&&t.jsx("input",{...l("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,h)=>t.jsxs("li",{children:[t.jsx(k,{control:n,name:"flavor",render:({field:{onChange:i,...m}})=>t.jsxs(Z,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(U,{onChange:x=>{u({flavor:c.flavor}),c.use_resource_value_as_fixed_config===!0&&s(ye),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&s(ye.merge(Ft(c.required_configuration))),c.flavor!==H&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),i(x)},...m,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(V,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===H||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===H&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(i=>t.jsx("li",{children:t.jsx(k,{control:n,name:"resourceId",render:({field:m})=>t.jsxs(Z,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(U,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(V,{type:ze,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:i})]})})},i))}),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&Object.keys(c.required_configuration).length>=1&&t.jsx("div",{children:Object.entries(c.required_configuration).map(([i,m])=>t.jsx("div",{children:t.jsx(k,{defaultValue:"",name:i,control:n,render:({field:x})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:i,className:"text-text-sm",children:m}),t.jsx(ge,{...x,inputSize:"md",required:!0,className:"w-full",id:i})]})})},i))})]})]},h))})]})}function jr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"orchestrator",className:"h-5 w-5 fill-primary-400"}),"Select your Orchestrator"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the connected orchestrators for your new stack"})]})})}function _r(){const{schema:e}=X(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx($,{...r,children:t.jsxs(D,{children:[t.jsx(O,{children:"Orchestrator"}),t.jsxs(E,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const Sr=y.object({provider:y.string().min(1)});function Cr(){var a;const{setData:e,data:r}=S(),{setCurrentStep:s}=F(),n=W({resolver:q(Sr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(l){e(u=>({...u,connectorConfig:{type:l.provider,auth_method:""}})),s(u=>u+1)}return t.jsx($,{...n,children:t.jsxs(D,{children:[t.jsx(O,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where you have existing infrastructure to connect with ZenML. This will allow you to integrate your current cloud resources with ZenML for model deployment and management."})]}),t.jsxs("form",{id:"provider-form",onSubmit:n.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[t.jsx(oe,{id:"aws-provider",...n.register("provider"),value:"aws",children:t.jsx(ie,{icon:t.jsx(L,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),t.jsx(oe,{id:"gcp-provider",...n.register("provider"),value:"gcp",children:t.jsx(ie,{icon:t.jsx(L,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),t.jsx(oe,{id:"azure-provider",...n.register("provider"),value:"azure",children:t.jsx(ie,{icon:t.jsx(L,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),t.jsx(R,{children:t.jsx(br,{})})]})})}function br(){const{formState:{isValid:e}}=v();return t.jsx(M,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=J({...Ee.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(D,{children:[t.jsx(O,{children:"Your stack"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),t.jsxs("div",{className:"divide-y divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[t.jsx(Pr,{stack:s}),n.map(a=>t.jsx(Fr,{component:a},a.id))]})]})}),t.jsx(R,{displayCancel:!1,children:t.jsx(Nr,{})})]})}function Nr(){return t.jsx(M,{size:"md",asChild:!0,children:t.jsx(Dt,{to:xt.stacks.overview,children:"Finish"})})}function Pr({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(ft,{type:"square",size:"lg",children:t.jsx(mt,{size:"lg",children:e.name[0]})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]})}function Fr({component:e}){var r,s,n,o;return t.jsxs("div",{className:"flex items-center justify-between py-3 pl-9 pr-5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(V,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor_name)||"",type:((s=e.body)==null?void 0:s.type)||"orchestrator"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg font-semibold",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]}),t.jsx(At,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:ht((o=e.body)==null?void 0:o.type)})]},e.id)}function kr(){const{currentStep:e}=F();if(e===1)return t.jsx(Cr,{});if(e===2)return t.jsx(be,{initialSchema:$e,children:t.jsx(cr,{})});if(e===3)return t.jsx(Gt,{});if(e===4)return t.jsx(be,{initialSchema:ye,children:t.jsx(_r,{})});if(e===5)return t.jsx(xr,{});if(e===6)return t.jsx(wr,{})}const Ae=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function ls(){return t.jsx(Ze,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Ot,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Ue,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{ls as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{j as o}from"./@radix-C_LirfyT.js";import{C as r,S as m}from"./StackComponentList-s7eSfm8o.js";import{a as i}from"./@react-router-BSsrkPOd.js";import"./plus-cI8zD2xh.js";import"./refresh-3EF2R7ja.js";import"./Pagination-CcDD5yHh.js";import"./index-BacoJBEQ.js";import"./@tanstack-C0SeHZng.js";import"./@reactflow-D9hglKLF.js";import"./chevron-right-double-CbRQKN4Q.js";import"./SearchField-D_0-uAPj.js";import"./index-BRhKF2z-.js";import"./DisplayDate-v3KW7oez.js";import"./expand-full-CD4fFvM-.js";import"./SheetHeader-7vwlsY_i.js";import"./Tabs-B27AHUfo.js";import"./terminal-BObrvDlO.js";import"./chevron-down-Z3nUe-0U.js";import"./transform-DFpKTKgF.js";import"./NestedCollapsible-CN9scBUn.js";import"./eye-CLNgIh_K.js";import"./CollapsibleCard-D0-pQi1n.js";import"./check-circle-mnEgPhPF.js";import"./CodeSnippet-D8iBqOVv.js";import"./all-pipeline-runs-query-gorNNEaT.js";import"./ExecutionStatus-C4tlFnlh.js";import"./help-B0CvBhCm.js";import"./index-dCcVgFNl.js";import"./stack-detail-query-Bc4QKlWg.js";import"./ComponentBadge-mw2Ja_ON.js";import"./ComponentIcon-BXgpt-jw.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";import"./trash-HKxXWbSG.js";import"./DeleteAlertDialog-BbyFVnVI.js";import"./zod-DgEcN9jD.js";import"./index.esm-COnaHLSh.js";import"./Infobox-DFCWPbMb.js";import"./info-CyMih3vQ.js";import"./bulk-delete-B5RTlnD_.js";function O(){const{connectorId:t}=i();return o.jsx(r,{children:o.jsx(m,{fixedQueryParams:{connector_id:t},displayCreateComponent:!1})})}export{O as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,j as s}from"./@radix-C_LirfyT.js";import{aA as D,aB as k,B as f,aC as z,aD as E,D as A,ax as T,s as v,aI as b,t as C,I as o,aG as B,aH as q,z as a,u as M,j as Q,d as P,A as V,e as _}from"./index-BacoJBEQ.js";import{u as S}from"./update-current-user-mutation-DSyUyHVj.js";import{h as H}from"./@tanstack-C0SeHZng.js";import{u as F}from"./index.esm-COnaHLSh.js";import{t as I}from"./zod-DgEcN9jD.js";import{P as K}from"./PasswordChecker-BZwoeQIm.js";import{u as O}from"./UpdatePasswordSchemas-Da5RndbV.js";import{D as G}from"./DisplayDate-v3KW7oez.js";import"./@react-router-BSsrkPOd.js";import"./@reactflow-D9hglKLF.js";function R(){const[e,l]=i.useState(!1);return s.jsxs(D,{onOpenChange:()=>{l(!1)},children:[s.jsx(k,{asChild:!0,children:s.jsx(f,{size:"md",className:"shrink-0",intent:"primary",emphasis:"subtle",children:"Change Password"})}),s.jsxs(z,{children:[s.jsx(E,{children:s.jsx(A,{children:" Update Credentials"})}),e?s.jsx(L,{}):s.jsx(J,{setSuccess:l})]})]})}function J({setSuccess:e}){var u;const l=i.useId(),d=i.useId(),n=i.useId(),{toast:x}=v(),{mutate:p,isPending:j}=S({onSuccess(){e(!0)},onError(t){b(t)&&x({status:"error",emphasis:"subtle",icon:s.jsx(C,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:t.message,rounded:!0})}}),{register:c,handleSubmit:m,watch:w,formState:{isValid:N,errors:y}}=F({resolver:I(O),mode:"onChange",criteriaMode:"all"});function g(t){p({old_password:t.oldPassword,password:t.newPassword})}const h=(u=y.newPassword)==null?void 0:u.types;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-5 p-7",children:[s.jsx("form",{id:"update-password-form",onSubmit:m(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:l,className:"text-text-sm",children:"Old Password"}),s.jsx(o,{...c("oldPassword"),type:"password",id:l,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:d,className:"text-text-sm",children:"New Password"}),s.jsx(o,{...c("newPassword"),type:"password",id:d,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Confirm Password"}),s.jsx(o,{...c("confirmPassword"),type:"password",id:n,className:"w-full"})]})]})}),s.jsx(K,{val:w("newPassword"),errors:h||[]})]}),s.jsxs(B,{className:"gap-[10px]",children:[s.jsx(q,{asChild:!0,children:s.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),s.jsx(f,{disabled:!N||j,form:"update-password-form",size:"sm",children:"Update Password"})]})]})}function L(){return s.jsxs("div",{className:"space-y-5 p-7 text-center",children:[s.jsx(T,{className:"mx-auto h-[110px] w-[110px] fill-success-500"}),s.jsx("p",{className:"text-text-lg font-semibold text-theme-text-primary",children:"The password was updated successfully!"})]})}const W=a.object({fullName:a.union([a.string(),a.literal("")]),username:a.union([a.string(),a.literal("")]),email:a.union([a.string().email(),a.literal("")])}).refine(e=>e.fullName!==""||e.username!==""||e.email!=="");function X({user:e}){var h,u,t;const l=H(),{toast:d}=v(),n=i.useId(),x=i.useId(),p=i.useId(),{isPending:j,mutate:c}=S({onError(r){b(r)&&d({status:"error",emphasis:"subtle",icon:s.jsx(C,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:r.message,rounded:!0})},onSuccess:()=>{l.invalidateQueries({queryKey:["current-user"]}),l.invalidateQueries({queryKey:["users"]}),w(),d({status:"success",emphasis:"subtle",rounded:!0,description:"User updated successfully"})}}),{register:m,reset:w,handleSubmit:N,formState:{isValid:y}}=F({resolver:I(W),defaultValues:{email:void 0,fullName:void 0,username:void 0}});function g(r){const U={...r.fullName&&{full_name:r.fullName},...r.username&&{name:r.username},...r.email&&{email:r.email}};c(U)}return s.jsxs("div",{className:"w-full max-w-[600px]",children:[s.jsx("form",{onSubmit:N(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Full Name"}),s.jsx(o,{placeholder:(h=e.body)==null?void 0:h.full_name,...m("fullName"),id:n,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:x,className:"text-text-sm",children:"Username"}),s.jsx(o,{...m("username"),placeholder:e.name,id:x,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:p,className:"text-text-sm",children:"Email"}),s.jsx(o,{placeholder:((u=e.metadata)==null?void 0:u.email)??void 0,...m("email"),id:p,className:"w-full"})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(f,{disabled:j||!y,size:"md",intent:"primary",children:"Update"})})]})}),s.jsx(R,{}),s.jsxs("p",{className:"mt-5 text-text-sm text-theme-text-secondary",children:["Created on ",s.jsx(G,{dateString:((t=e.body)==null?void 0:t.created)||""})]})]})}function ds(){const{data:e}=M();return s.jsxs(Q,{className:"flex flex-col gap-5 p-5",children:[s.jsx("h1",{className:"text-text-xl font-semibold",children:"Profile"}),s.jsxs("div",{className:"flex justify-between",children:[e?s.jsx(X,{user:e}):s.jsx(P,{className:"h-[350px] w-full"}),e?s.jsx(V,{size:"xxl",className:"ml-5 h-[140px] w-[140px]",type:"rounded",children:s.jsx(_,{className:"text-display-lg",size:"xxl",children:e.name[0]})}):s.jsx(P,{className:"h-[140px] w-[140px] rounded-rounded"})]})]})}export{ds as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as m,j as e}from"./@radix-C_LirfyT.js";import{v as S,y as D,F as C,E as w,aA as Q,aB as $,B as h,aC as _,aD as J,D as V,s as O,I as k,N as g,aG as G,aH as U,aI as A,G as P,H as Y,Y as W,aJ as Z,b8 as X,aK as ee,b9 as te,aM as se,aF as ne,J as ae,K as re,L as ce,M as ie,r as T,j as I,W as oe,d as F}from"./index-BacoJBEQ.js";import{P as le}from"./Pagination-CcDD5yHh.js";import{S as ue}from"./SearchField-D_0-uAPj.js";import{s as f,c as de,A as me,u as xe,a as R,b as he}from"./service-B9aVzfAF.js";import{c as b,h as N,b as pe}from"./@tanstack-C0SeHZng.js";import{t as fe}from"./zod-DgEcN9jD.js";import{u as je,F as ye,a as ve,C as v}from"./index.esm-COnaHLSh.js";import{S as q}from"./trash-HKxXWbSG.js";import{D as E,a as H}from"./DeleteAlertDialog-BbyFVnVI.js";import{c as ge,u as Ae}from"./bulk-delete-B5RTlnD_.js";import{S as Se}from"./Lock-CRP5J_su.js";import{L as K}from"./@react-router-BSsrkPOd.js";import{A as De}from"./AlertDialogDropdownItem-druRNuO2.js";import"./@reactflow-D9hglKLF.js";import"./chevron-right-double-CbRQKN4Q.js";import"./index-BRhKF2z-.js";import"./CodeSnippet-D8iBqOVv.js";import"./Infobox-DFCWPbMb.js";import"./info-CyMih3vQ.js";import"./Tick-DDeDgTuT.js";import"./check-D1bHMJkL.js";async function Ce({body:t}){const s=D(w.serviceAccounts.all),n=await S(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Failed to create service account");throw new C({status:n.status,statusText:n.statusText,message:r})}return n.json()}function we(t){return b({...t,mutationFn:async s=>Ce({body:s})})}function M({isFallback:t}){const[s,n]=m.useState(!1),[r,a]=m.useState(""),i=N(),u=je({resolver:fe(de),defaultValues:{name:"",description:"",createDefault:!1}}),l=!!r&&u.watch("createDefault");function d(){return l?e.jsx(me,{value:r}):e.jsx(be,{isFallback:t,setApiKeyValue:a,setOpen:n})}return e.jsx(ye,{...u,children:e.jsxs(Q,{open:s,onOpenChange:o=>{t&&!o&&i.invalidateQueries({queryKey:f.serviceAccountsKey()}),n(o),a(""),u.reset()},children:[e.jsx($,{asChild:!0,children:e.jsx(h,{className:"shrink-0",size:"sm",intent:"primary",children:"Add service account"})}),e.jsxs(_,{"data-success":l,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(J,{children:e.jsx(V,{children:"Add service account"})}),d()]})]})})}function be({setApiKeyValue:t,setOpen:s,isFallback:n}){const{watch:r,handleSubmit:a,control:i,formState:{isValid:u}}=ve(),{toast:l}=O(),d=N(),{mutate:o}=we({onError(c){A(c)&&l({status:"error",emphasis:"subtle",description:c.message,rounded:!0})},async onSuccess(c){if(l({description:"The service account has been added successfully.",status:"success",emphasis:"subtle",rounded:!0}),r("createDefault")){x(c.id);return}d.invalidateQueries({queryKey:f.serviceAccountsKey()}),s(!1)}}),{mutate:p}=xe({onSuccess(c){var y;n||d.invalidateQueries({queryKey:f.serviceAccountsKey()}),t(((y=c.body)==null?void 0:y.key)||"")},onError(c){A(c)&&l({status:"error",emphasis:"subtle",description:c.message,rounded:!0})}}),x=c=>{p({serviceAccountId:c,body:{name:"default",description:"Default api key"}})},B=c=>{o({name:c.name,description:c.description,active:!0})};return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:a(B),children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Name:"}),e.jsx(v,{name:"name",control:i,render:({field:c})=>e.jsx(k,{...c,className:"w-full",required:!0,placeholder:"Add name"})})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Description:"}),e.jsx(v,{name:"description",control:i,render:({field:c})=>e.jsx(k,{...c,className:"w-full",placeholder:"Add description"})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{control:i,name:"createDefault",render:({field:{onChange:c,value:y}})=>e.jsx(g,{checked:y,id:"default-key",onCheckedChange:L=>c(!!L)})}),e.jsx("label",{htmlFor:"default-key",children:"Create a default API Key"})]}),e.jsx("p",{className:"pl-[30px] text-text-xs text-theme-text-secondary",children:"This will include a default API Key for your service account."})]})]}),e.jsxs(G,{className:"gap-[10px]",children:[e.jsx(U,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"primary",size:"sm",disabled:!u,type:"submit",form:"create-secret-form",children:"Add service account"})]})]})}async function Ne(t){const s=D(w.serviceAccounts.detail(t)),n=await S(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!n.ok){const r=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>`Failed to delete service account ${t}`);throw new C({status:n.status,statusText:n.statusText,message:r})}return n.json()}function ke(t){return b({...t,mutationFn:async s=>{await Ne(s)}})}const{ContextProvider:Te,useContext:j}=ge();function z(){const{setRowSelection:t}=j(),{mutateAsync:s}=ke();async function n(r){await s(r)}return Ae({deleteFn:n,queryKeyToInvalidate:f.serviceAccountsKey(),setRowSelection:t})}function Fe(){const[t,s]=m.useState(!1),{selectedRowCount:n,selectedRowIDs:r}=j(),{bulkDelete:a}=z();async function i(){await a(r),s(!1)}return e.jsxs(P,{open:t,onOpenChange:s,children:[e.jsx(Y,{asChild:!0,children:e.jsxs(h,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(q,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(E,{title:`Delete Service Account${n>=2?"s":""}`,handleDelete:i,children:e.jsxs(H,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function Ke(){const{selectedRowCount:t}=j();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${t} Service Account${t>1?"s":""} selected`}),e.jsx(Fe,{})]})}async function Oe({body:t,serviceAccountId:s}){const n=D(w.serviceAccounts.detail(s)),r=await S(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status===404&&W(),!r.ok){const a=await r.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Failed to update service account ${s}`);throw new C({status:r.status,statusText:r.statusText,message:a})}return r.json()}function Pe(t){return b({...t,mutationFn:async({serviceAccountId:s,body:n})=>Oe({serviceAccountId:s,body:n})})}function Ie({isActive:t,serviceAccountId:s}){const{toast:n}=O(),r=N(),[a,i]=m.useState(!1),{mutate:u}=Pe({onError(o){A(o)&&n({status:"error",emphasis:"subtle",description:o.message,rounded:!0})},onSuccess(){r.invalidateQueries({queryKey:f.serviceAccountsKey()})}});function l(o){o?d(o):i(!0)}async function d(o){u({serviceAccountId:s,body:{active:o}})}return e.jsxs(e.Fragment,{children:[e.jsx(P,{open:a,onOpenChange:i,children:e.jsxs(Z,{children:[e.jsx(X,{children:e.jsx(ee,{children:"Deactivate Service Account"})}),e.jsxs("div",{className:"p-5 text-text-md text-theme-text-secondary",children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"You won't be able to use any API keys of this service account to authenticate with the server anymore."})]}),e.jsxs(te,{className:"gap-[10px]",children:[e.jsx(se,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{onClick:()=>d(!1).then(o=>i(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx(ne,{checked:t,onCheckedChange:l})]})}function Re({serviceAccountId:t}){const[s,n]=m.useState(!1),[r,a]=m.useState(!1),{bulkDelete:i}=z(),u=m.useRef(null),l=m.useRef(null);function d(){l.current=u.current}async function o(){await i([t]),p(!1)}function p(x){if(x===!1){n(!1),setTimeout(()=>{a(x)},200);return}a(x)}return e.jsxs(ae,{onOpenChange:n,open:s,children:[e.jsx(re,{ref:u,children:e.jsx(ce,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsx(ie,{hidden:r,onCloseAutoFocus:x=>{l.current&&(l.current.focus(),l.current=null,x.preventDefault())},align:"end",sideOffset:7,children:e.jsx(De,{onSelect:d,open:r,onOpenChange:p,triggerChildren:"Delete",icon:e.jsx(q,{fill:"red"}),children:e.jsx(E,{title:"Delete Service Account",handleDelete:o,children:e.jsxs(H,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}function qe(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(g,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(g,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"service-account",header:"Service Account",accessorFn:t=>t.name,cell:({row:t})=>{var s;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Se,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center space-x-1",children:e.jsx("div",{className:"flex items-center space-x-1",children:e.jsx(K,{className:"text-text-md font-semibold text-theme-text-primary",to:T.settings.service_accounts.detail(t.original.id),children:t.original.name})})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(K,{className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",to:T.settings.service_accounts.detail(t.original.id),children:(s=t.original.metadata)==null?void 0:s.description})})]})]})}},{id:"active",header:"Active",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.active},cell:({row:t})=>{var s;return e.jsx(Ie,{isActive:!!((s=t.original.body)!=null&&s.active),serviceAccountId:t.original.id})}},{id:"actions",meta:{width:"5%"},header:"",cell:({row:t})=>e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Re,{serviceAccountId:t.original.id})})}]}function Ee(){return e.jsxs(I,{className:"flex flex-col items-center justify-center space-y-4 p-9",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold text-theme-text-primary",children:"There are no service accounts yet."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Create your first one now to automate your processes securely with ZenML."})]}),e.jsx(M,{isFallback:!0})]})}function He(){const t=R(),{rowSelection:s,setRowSelection:n}=j(),r=m.useMemo(()=>qe(),[]),{data:a}=pe({...he.serviceAccountList({...t,sort_by:"desc:created",hydrate:!0})});return a&&a.items.length<1&&!t.name?e.jsx(Ee,{}):e.jsxs(e.Fragment,{children:[e.jsx(Me,{}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:a?e.jsx(oe,{getRowId:i=>i.id,rowSelection:s,onRowSelectionChange:n,columns:r,data:a.items}):e.jsx(F,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(le,{searchParams:t,paginate:a}):e.jsx(F,{className:"h-[36px] w-[300px]"})]})]})}function Me(){const t=R(),{selectedRowCount:s}=j();return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s?e.jsx(Ke,{}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ue,{searchParams:t})}),e.jsx(M,{isFallback:!1})]})}function lt(){return e.jsxs(I,{className:"space-y-4 p-5",children:[e.jsx(ze,{}),e.jsx(Te,{children:e.jsx(He,{})})]})}function ze(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Accounts"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Configure automated access for background tasks and integrations."}),e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/project-setup-and-management/connecting-to-zenml/connect-with-a-service-account",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}export{lt as default};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import{j as e,r as o}from"./@radix-C_LirfyT.js";import{S as b}from"./file-text-CltVhgwZ.js";import{B as h,a as w,u as S,d as m,g as C,c as u,C as _,P as z,o as x,p as k,x as d,bB as P,j as f,b5 as p,bC as g,ay as j,bD as N,r as E,bq as I,m as R,bv as D}from"./index-BacoJBEQ.js";import{S as L}from"./mail-C160gvB0.js";import{S as O}from"./message-chat-square-DLz6XmPS.js";import{S as M}from"./package-BhYXGPxF.js";import{S as B}from"./terminal-BObrvDlO.js";import{S as T}from"./help-B0CvBhCm.js";import{C as c}from"./CodeSnippet-D8iBqOVv.js";import{H}from"./Helpbox-C-RGHz3S.js";import{S as F}from"./chevron-down-Z3nUe-0U.js";import{T as Z}from"./Tick-DDeDgTuT.js";import{S as A}from"./chevron-right-double-CbRQKN4Q.js";import{c as $}from"./@react-router-BSsrkPOd.js";import"./@tanstack-C0SeHZng.js";import"./@reactflow-D9hglKLF.js";import"./check-D1bHMJkL.js";function q(){const s=[{text:"Send us a message",href:"mailto:cloud@zenml.io",icon:e.jsx(L,{className:"h-5 w-5 fill-neutral-500"})},{text:"Join our Slack Community",href:"https://zenml.io/slack",icon:e.jsx(O,{className:"h-5 w-5 fill-neutral-500"})}];return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Support"}),e.jsx("ul",{className:"space-y-1",children:s.map((t,r)=>e.jsx("li",{children:e.jsx(h,{size:"md",className:"w-fit px-2 text-theme-text-secondary",intent:"secondary",emphasis:"minimal",asChild:!0,children:e.jsxs("a",{target:"_blank",rel:"noopener noreferrer",className:"flex gap-1",href:t.href,children:[t.icon,e.jsx("div",{children:t.text})]})})},r))})]})}function U(){const s=[{text:"Browse our docs",href:"https://docs.zenml.io",icon:e.jsx(b,{className:"h-5 w-5 fill-neutral-500"})},{text:"Discover projects",href:"https://github.com/zenml-io/zenml-projects",icon:e.jsx(M,{className:"h-5 w-5 fill-neutral-500"})},{text:"Navigate our examples",href:"https://github.com/zenml-io/zenml/tree/main/examples/",icon:e.jsx(B,{className:"h-5 w-5 fill-neutral-500"})},{text:"Read our blog",href:"https://zenml.io/blog",icon:e.jsx(w,{className:"h-5 w-5 fill-neutral-500"})}];return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"mb-0.5 text-text-lg font-semibold",children:"Resources"}),e.jsx("ul",{className:"space-y-1",children:s.map((t,r)=>e.jsx("li",{children:e.jsx(h,{size:"md",className:"w-fit px-2 text-theme-text-secondary",intent:"secondary",emphasis:"minimal",asChild:!0,children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",className:"flex gap-1",href:t.href,children:[t.icon,e.jsx("div",{children:t.text})]})})},r))})]})}function J(){return e.jsx("div",{className:"w-full space-y-1 overflow-x-hidden",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-display-xs font-semibold",children:["Hi",e.jsx(W,{})]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Welcome to ZenML. This is the beginning to get the most advantage of all the Pro features of ZenML."})]})})}function W(){const s=S();if(s.isError)return null;if(s.isPending)return e.jsx(m,{className:"h-6 w-[70px]"});const t=C(s.data);return e.jsx(e.Fragment,{children:t?`, ${t}`:""})}function G({className:s,...t}){return e.jsx("div",{className:u("flex h-[28px] w-[28px] shrink-0 items-center justify-center rounded-rounded border-2 border-warning-300 bg-warning-50",s),...t,children:e.jsx(A,{className:"h-3 w-3 fill-warning-300"})})}function y({completed:s,title:t,children:r,hasDownstream:n,active:l=!1}){const[a,i]=o.useState(l);return o.useEffect(()=>{i(l)},[l]),e.jsxs(_,{disabled:!(n||l||s),open:a,onOpenChange:i,children:[e.jsx("div",{className:"flex w-full flex-col gap-3 bg-theme-surface-primary px-5 py-3",children:e.jsxs("div",{className:"flex w-full justify-between gap-2",children:[s?e.jsx(Z,{className:"shrink-0"}):n?e.jsx(G,{}):e.jsx(z,{className:"shrink-0"}),e.jsx(x,{className:"w-full",children:e.jsx(K,{active:l,skipped:n,title:t,completed:s})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(x,{children:e.jsx(F,{className:` ${a?"":"-rotate-90"} h-5 w-5 shrink-0 rounded-md fill-neutral-500`})})})]})}),r&&e.jsx(k,{className:"border-t border-theme-border-moderate",children:e.jsxs("div",{className:"flex w-full items-center gap-2 bg-theme-surface-primary p-5",children:[e.jsx("div",{className:"w-[28px] shrink-0"}),e.jsx("div",{className:"w-full min-w-0 flex-1",children:r})]})})]})}function K({completed:s,title:t,skipped:r,active:n}){return e.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("div",{className:"flex w-full items-center",children:e.jsx("div",{className:u("text-text-xl",{"text-theme-text-tertiary line-through decoration-theme-text-tertiary":s||r,"font-semibold":n,"text-theme-text-secondary":!n&&!s}),children:t})})})}function V(){return e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Create a"," ",e.jsx("code",{className:"rounded-sm bg-primary-25 px-[4px] py-[2px] text-theme-text-brand",children:"run.py"})," ","file that defines your workflow using our Python SDK:"]}),e.jsx(c,{className:"w-full max-w-full",highlightCode:!0,code:Q})]})}const Q=`from zenml import pipeline, step
|
2
|
-
from zenml.logger import get_logger
|
3
|
-
|
4
|
-
logger = get_logger(__name__)
|
5
|
-
|
6
|
-
|
7
|
-
@step
|
8
|
-
def say_hello() -> str:
|
9
|
-
logger.info("Executing say_hello step")
|
10
|
-
return "Hello World!"
|
11
|
-
|
12
|
-
|
13
|
-
@pipeline
|
14
|
-
def hello_pipeline():
|
15
|
-
say_hello()
|
16
|
-
|
17
|
-
|
18
|
-
if __name__ == "__main__":
|
19
|
-
run = hello_pipeline()
|
20
|
-
out = run.steps["say_hello"].outputs["output"][0].load()
|
21
|
-
logger.info(f"▶︎ Step returned: {out}")
|
22
|
-
`;function X({projectName:s}){return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Set your project"}),e.jsx(c,{highlightCode:!0,code:`zenml init && zenml project set ${s||"<PROJECT-NAME>"}`})]})}function Y({completed:s,hasDownstreamStep:t,active:r}){const{data:n}=d({throwOnError:!0});return e.jsx(y,{active:r,hasDownstream:t,completed:s,title:"Install and log in to ZenML (5 min)",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Install ZenML"}),e.jsx(c,{code:`pip install "zenml==${n?n.version:e.jsx(m,{className:"w-7"})}"`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Log in to your ZenML Server"}),e.jsx(c,{code:P((n==null?void 0:n.deployment_type)||"other")})]}),e.jsx(H,{link:"https://docs.zenml.io/user-guides/production-guide/deploying-zenml#connecting-to-a-deployed-zenml"})]})})}function ee({active:s,completed:t,hasDownstreamStep:r}){return e.jsx(y,{active:s,hasDownstream:r,completed:t,title:"Run a pipeline (2 min)",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(X,{projectName:"default"}),e.jsx(V,{}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Run the training pipeline."}),e.jsx(c,{code:"python run.py"})]}),e.jsxs(f,{className:"flex w-full flex-wrap items-center justify-between gap-y-1 p-2",children:[e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-sm bg-teal-25",children:e.jsx(T,{className:"h-5 w-5 fill-teal-400"})}),e.jsx("p",{children:"Do you need help?"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:p({intent:"secondary",emphasis:"subtle",size:"md"}),href:"https://github.com/zenml-io/zenml/blob/main/examples/quickstart/README.md",children:"Open the Readme"}),e.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:p({intent:"primary",emphasis:"subtle",size:"md"}),href:"https://docs.zenml.io/user-guides/starter-guide/create-an-ml-pipeline",children:"Browse our docs"})]})]})]})})}function se(){const s=g({refetchInterval:5e3}),t=d();if(s.isPending||t.isPending)return e.jsx(m,{className:"h-[200px] w-full"});if(s.isError||t.isError)return null;const r=j(t.data.deployment_type||"other");return e.jsx(te,{onboarding:s.data,isLocalServer:r})}function te({onboarding:s,isLocalServer:t}){const r=$(),{getItem:n,isFinished:l}=N(s,t),a=n("device_verified"),i=n("pipeline_run"),v=o.useRef(l);return o.useEffect(()=>{l===!0&&v.current===!1&&r(E.home+"?success=true")},[l,r]),e.jsxs("ul",{className:"space-y-5",children:[!t&&e.jsx("li",{children:e.jsx(Y,{active:a.isActive,completed:a.isCompleted,hasDownstreamStep:a.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(ee,{active:i.isActive,completed:i.isCompleted,hasDownstreamStep:i.hasDownStreamStep})})]})}function re(){const s=g(),t=d();if(s.isPending||t.isPending)return e.jsx(m,{className:"h-[80px] w-full"});if(s.isError||t.isError)return null;const r=j(t.data.deployment_type||"other"),n=N(s.data,r),l=n.itemsDone,a=n.totalItems,i=n.progress;return e.jsxs(f,{className:"flex w-full max-w-full items-center gap-3 px-3 py-2",children:[e.jsx(I,{width:24,height:24,className:"shrink-0 fill-primary-400"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("div",{className:"text-text-xl font-semibold",children:"Get started"}),e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsxs("span",{className:"text-text-sm",children:[l,"/",a]}),e.jsx(R,{className:"h-1 w-full rounded-rounded",value:i})]})]})]})}function ve(){const{setTourState:s,tourState:{tourActive:t}}=D();return o.useEffect(()=>{t&&s(r=>({...r,run:!0,stepIndex:r.stepIndex}))},[t]),e.jsxs("div",{className:"layout-container space-y-5 py-5",children:[e.jsx(J,{}),e.jsxs("div",{className:"grid grid-cols-4 gap-5",children:[e.jsxs("div",{className:"col-span-4 space-y-5 lg:col-span-3",children:[e.jsx(re,{}),e.jsx(se,{})]}),e.jsxs("div",{className:"col-span-4 w-full space-y-8 lg:col-span-1",children:[e.jsx(q,{}),e.jsx(U,{})]})]})]})}export{ve as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{j as o}from"./@radix-C_LirfyT.js";import{S as r}from"./Tabs-B27AHUfo.js";import{R as m}from"./RunsBody-BToytB8e.js";import{b as i}from"./ButtonGroup-SF2DlzHV.js";import{S as p}from"./StackList-Dt0FrIkM.js";import{a as s}from"./@react-router-BSsrkPOd.js";import"./index-BacoJBEQ.js";import"./@tanstack-C0SeHZng.js";import"./@reactflow-D9hglKLF.js";import"./terminal-BObrvDlO.js";import"./chevron-down-Z3nUe-0U.js";import"./transform-DFpKTKgF.js";import"./DisplayDate-v3KW7oez.js";import"./NestedCollapsible-CN9scBUn.js";import"./eye-CLNgIh_K.js";import"./CollapsibleCard-D0-pQi1n.js";import"./check-circle-mnEgPhPF.js";import"./CodeSnippet-D8iBqOVv.js";import"./refresh-3EF2R7ja.js";import"./Pagination-CcDD5yHh.js";import"./chevron-right-double-CbRQKN4Q.js";import"./SearchField-D_0-uAPj.js";import"./index-BRhKF2z-.js";import"./all-pipeline-runs-query-gorNNEaT.js";import"./ExecutionStatus-C4tlFnlh.js";import"./help-B0CvBhCm.js";import"./trash-HKxXWbSG.js";import"./AlertDialogDropdownItem-druRNuO2.js";import"./DeleteAlertDialog-BbyFVnVI.js";import"./zod-DgEcN9jD.js";import"./index.esm-COnaHLSh.js";import"./bulk-delete-B5RTlnD_.js";import"./delete-run-ibBtciMR.js";import"./plus-cI8zD2xh.js";import"./index-dCcVgFNl.js";import"./stack-detail-query-Bc4QKlWg.js";import"./SheetHeader-7vwlsY_i.js";import"./components-Br2ezRib.js";import"./NumberBox-CoQjQYDJ.js";import"./ComponentBadge-mw2Ja_ON.js";import"./ComponentIcon-BXgpt-jw.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";import"./Infobox-DFCWPbMb.js";import"./info-CyMih3vQ.js";import"./DialogItem-DeME0oSt.js";function $(){const{componentId:t}=s();return o.jsx("div",{className:"@container",children:o.jsx(r,{isPanel:!1,stacksTabContent:o.jsx(p,{fixedQueryParams:{component_id:t}}),runsTabContent:o.jsx(i,{children:o.jsx(m,{fixedQueryParams:{stack_component:t}})}),componentId:t})})}export{$ as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as p,j as e}from"./@radix-C_LirfyT.js";import{S as j}from"./chevron-down-Z3nUe-0U.js";import{D as i}from"./DisplayDate-v3KW7oez.js";import{aV as l,d as c,C as h,n as f,o as g,p as y,T as u,a0 as b,g as N}from"./index-BacoJBEQ.js";import{K as n,a as v,V as C,N as E}from"./NestedCollapsible-CN9scBUn.js";import{a as d,e as T,R as w,E as R}from"./service-connectors-DL2-k_E2.js";import{R as P}from"./resource-tyes-list-B5rkZcbc.js";import{b as m}from"./@tanstack-C0SeHZng.js";import{a as x}from"./@react-router-BSsrkPOd.js";import"./@reactflow-D9hglKLF.js";import"./eye-CLNgIh_K.js";import"./CollapsibleCard-D0-pQi1n.js";import"./check-circle-mnEgPhPF.js";import"./CodeSnippet-D8iBqOVv.js";function D(){const[a,r]=p.useState(!0),{connectorId:s}=x(),o=m({...l.serviceConnectorDetail(s),throwOnError:!0});if(o.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(o.isError)return e.jsx("div",{children:"Error"});const t=o.data;return e.jsxs(h,{open:a,onOpenChange:r,children:[e.jsx(f,{className:"flex items-center gap-[10px]",children:e.jsxs(g,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(j,{className:` ${a?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),"Basic Parameters"]})}),e.jsx(y,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary p-5",children:e.jsxs("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:gap-y-4 lg:grid-cols-3",children:[e.jsx(n,{label:"Name",value:t.name}),e.jsx(A,{connector:t}),e.jsx(S,{connector:t}),e.jsx(O,{connector:t}),e.jsx(_,{connector:t}),e.jsx(I,{connector:t}),e.jsx(Q,{connector:t}),e.jsx(V,{connector:t}),e.jsx(K,{connector:t})]})})]})}function A({connector:a}){var s;const r=(s=a.body)==null?void 0:s.connector_type;return!r||typeof r=="string"?null:e.jsx(n,{label:"Type",value:e.jsxs(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit gap-0.5 text-theme-text-primary",color:"grey",children:[e.jsx("img",{src:r.logo_url??"",className:"h-4 w-4 shrink-0",alt:r.name}),e.jsx("span",{children:r.name})]})})}function S({connector:a}){var s;const r=d(a);return e.jsx(n,{label:"Auth Method",value:r===void 0?null:e.jsx(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit text-theme-text-primary",color:"grey",children:e.jsx("span",{children:r.name||((s=a.body)==null?void 0:s.auth_method)})})})}function O({connector:a}){const r=T(a);return e.jsxs(e.Fragment,{children:[e.jsx(v,{children:"Resrouce Types"}),e.jsx(C,{className:"h-auto",children:e.jsx(P,{resourceTypes:r})})]})}function _({connector:a}){return e.jsx(n,{label:"Resource Name",value:e.jsx(w,{connector:a})})}function I({connector:a}){var s;const r=(s=a.resources)==null?void 0:s.user;return e.jsx(n,{label:"Author",value:r?e.jsx(b,{username:N(r)}):null})}function Q({connector:a}){var s;const r=(s=a.body)==null?void 0:s.expires_at;return e.jsx(n,{label:"Expires in",value:r?e.jsx(R,{expires:r}):"Never"})}function V({connector:a}){var s;const r=(s=a.body)==null?void 0:s.created;return e.jsx(n,{label:"Created",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function K({connector:a}){var s;const r=(s=a.body)==null?void 0:s.updated;return e.jsx(n,{label:"Updated",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function M(){var t;const{connectorId:a}=x(),r=m({...l.serviceConnectorDetail(a),throwOnError:!0});if(r.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(r.isError)return e.jsx("div",{children:"Error"});const s=r.data,o=d(s);return e.jsx(E,{schema:o==null?void 0:o.config_schema,title:e.jsx("p",{className:"text-text-xl",children:"Configuration"}),data:(t=s.metadata)==null?void 0:t.configuration,isInitialOpen:!0})}function Z(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5",children:[e.jsx("div",{children:e.jsx(D,{})}),e.jsx("div",{className:"space-y-5",children:e.jsx(M,{})})]})}export{Z as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as j,j as s}from"./@radix-C_LirfyT.js";import{R as g,u as b,a as y,b as N}from"./ButtonGroup-SF2DlzHV.js";import{Z as v,_ as P,r as c,$ as S,z as i,N as p,O as R,Q as k,R as C,U as T,V as u,T as x,a0 as _,B as w,W as E,d as h}from"./index-BacoJBEQ.js";import{S as B}from"./pipeline-BJ8liDnl.js";import{f as D,L as l,a as f}from"./@react-router-BSsrkPOd.js";import{S as A}from"./refresh-3EF2R7ja.js";import{u as F}from"./all-pipeline-runs-query-gorNNEaT.js";import{S as I}from"./SearchField-D_0-uAPj.js";import{P as z}from"./Pagination-CcDD5yHh.js";import{S as U}from"./terminal-BObrvDlO.js";import{D as H}from"./DisplayDate-v3KW7oez.js";import{g as L,E as $}from"./ExecutionStatus-C4tlFnlh.js";import"./trash-HKxXWbSG.js";import"./AlertDialogDropdownItem-druRNuO2.js";import"./DeleteAlertDialog-BbyFVnVI.js";import"./zod-DgEcN9jD.js";import"./index.esm-COnaHLSh.js";import"./bulk-delete-B5RTlnD_.js";import"./@tanstack-C0SeHZng.js";import"./delete-run-ibBtciMR.js";import"./@reactflow-D9hglKLF.js";import"./index-BRhKF2z-.js";import"./chevron-right-double-CbRQKN4Q.js";import"./check-circle-mnEgPhPF.js";import"./help-B0CvBhCm.js";function G(e){const{setBreadcrumbs:t}=v();j.useEffect(()=>{e&&t([P,{label:e,href:c.projects.pipelines.namespace(e)}])},[t,e])}function O({namespace:e}){return s.jsx(S,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(B,{className:"h-5 w-5 fill-neutral-400"}),s.jsx("h1",{className:"text-display-xs font-semibold",children:decodeURIComponent(e)})]})})}const d=1,q=i.object({page:i.coerce.number().min(d).optional().default(d).catch(d),name:i.string().optional(),operator:i.enum(["and","or"]).optional()});function Q(){const[e]=D(),{page:t,name:a,operator:r}=q.parse({page:e.get("page")||void 0,name:e.get("name")||void 0});return{page:t,name:a,logical_operator:r}}function V(){return[{id:"select",meta:{width:"1%"},header:({table:e})=>s.jsx(p,{id:"check-all",checked:e.getIsAllRowsSelected(),onCheckedChange:t=>e.toggleAllRowsSelected(t==="indeterminate"?!0:t)}),cell:({row:e})=>s.jsx(p,{id:`check-${e.id}`,checked:e.getIsSelected(),onCheckedChange:e.getToggleSelectedHandler()})},{id:"run",header:"Run",accessorFn:e=>{var t;return{name:e.name,id:e.id,status:(t=e.body)==null?void 0:t.status}},cell:({getValue:e})=>{const{name:t,status:a,id:r}=e();return s.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[s.jsx(U,{className:`h-5 w-5 shrink-0 ${L(a)}`}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(l,{to:c.projects.runs.detail(r),className:"flex items-center gap-1",children:s.jsx("h2",{className:"text-text-md font-semibold",children:t})}),s.jsx(R,{children:s.jsxs(k,{children:[s.jsx(C,{className:"hover:text-theme-text-brand hover:underline",children:s.jsx($,{status:a})}),s.jsx(T,{className:"z-20 capitalize",children:a})]})}),s.jsx(u,{copyText:t})]}),s.jsxs(l,{to:c.projects.runs.detail(r),className:"flex items-center gap-1",children:[s.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:r.split("-")[0]}),s.jsx(u,{copyText:r})]})]})]})}},{id:"stack",header:"Stack",accessorFn:e=>{var t,a,r,o;return{name:(a=(t=e.body)==null?void 0:t.stack)==null?void 0:a.name,id:(o=(r=e.body)==null?void 0:r.stack)==null?void 0:o.id}},cell:({getValue:e})=>{const{name:t,id:a}=e();return!t||!a?null:s.jsx(l,{to:c.stacks.overview,children:s.jsx(x,{rounded:!1,className:"inline-block",color:"turquoise",emphasis:"subtle",children:t})})}},{id:"repository",header:"Repository",accessorFn:e=>{var t,a,r,o,n,m;return{name:(r=(a=(t=e.body)==null?void 0:t.code_reference)==null?void 0:a.body)==null?void 0:r.code_repository.name,id:(m=(n=(o=e.body)==null?void 0:o.code_reference)==null?void 0:n.body)==null?void 0:m.code_repository.id}},cell:({getValue:e})=>{const{name:t,id:a}=e();return!t||!a?null:s.jsx("div",{children:s.jsx(x,{rounded:!1,className:"inline-block",color:"grey",emphasis:"subtle",children:t})})}},{id:"created",header:"Created at",accessorFn:e=>{var t;return(t=e.body)==null?void 0:t.created},cell:({getValue:e})=>s.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:s.jsx(H,{dateString:e()})})},{id:"author",header:"Author",accessorFn:e=>{var t;return{author:(t=e.resources)==null?void 0:t.user}},cell:({getValue:e})=>{const{author:t}=e();return s.jsx(_,{username:t.name})}},{id:"admin_actions",header:"",meta:{width:"5%"},cell:({row:e})=>s.jsx(g,{id:e.original.id})}]}function W(){const{namespace:e}=f(),t=Q(),a=V(),{selectedRowCount:r}=b(),{data:o,refetch:n}=F({params:{pipeline_name:decodeURIComponent(e),...t,sort_by:"desc:updated"}},{throwOnError:!0});return s.jsxs("div",{className:"flex flex-col gap-5 p-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[r?s.jsx(y,{}):s.jsx(I,{searchParams:t}),s.jsxs(w,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>n(),children:[s.jsx(A,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})]}),s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsx("div",{className:"w-full",children:o?s.jsx(E,{columns:a,data:o.items}):s.jsx(h,{className:"h-[500px] w-full"})}),o?o.total_pages>1&&s.jsx(z,{searchParams:t,paginate:o}):s.jsx(h,{className:"h-[36px] w-[300px]"})]})]})}function be(){const{namespace:e}=f();return G(e),s.jsx("div",{children:s.jsxs(N,{children:[s.jsx(O,{namespace:e}),s.jsx(W,{})]})})}export{be as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{j as e,r as j}from"./@radix-C_LirfyT.js";import{B as i,r as u,v as D,y as S,F as b,E as T,aV as x,G as g,H as k,z as c,J as R,K as A,L as P,M as B,av as E,N as h,V as p,a0 as L,g as F,d as f,W as _,j as M}from"./index-BacoJBEQ.js";import{S as I}from"./SearchField-D_0-uAPj.js";import{c as z,b as y}from"./@tanstack-C0SeHZng.js";import{S as H}from"./refresh-3EF2R7ja.js";import{S as O}from"./plus-cI8zD2xh.js";import{L as m,f as $}from"./@react-router-BSsrkPOd.js";import{c as G,u as K}from"./bulk-delete-B5RTlnD_.js";import{S as C}from"./trash-HKxXWbSG.js";import{D as Q,a as U}from"./DeleteAlertDialog-BbyFVnVI.js";import{P as V}from"./Pagination-CcDD5yHh.js";import{C as q,R as J}from"./resource-type-tooltip-E97WGqfk.js";import{e as W,R as X,E as Y}from"./service-connectors-DL2-k_E2.js";import"./@reactflow-D9hglKLF.js";import"./index-BRhKF2z-.js";import"./zod-DgEcN9jD.js";import"./index.esm-COnaHLSh.js";import"./chevron-right-double-CbRQKN4Q.js";function Z(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Connectors"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your service connectors."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/infrastructure-deployment/auth-management",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}function ee(){return e.jsx(i,{size:"md",asChild:!0,children:e.jsxs(m,{to:u.settings.connectors.create,children:[e.jsx(O,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Connector"})]})})}async function te({connectorId:t}){const s=S(T.serviceConnectors.detail(t)),r=await D(s,{method:"DELETE"});if(!r.ok){const n=await r.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Error while deleting connector ${t}`);throw new b({status:r.status,statusText:r.statusText,message:n})}return r.json()}function se(t){return z({...t,mutationFn:async({connectorId:s})=>te({connectorId:s})})}const{ContextProvider:re,useContext:l}=G();function w(){const{setRowSelection:t}=l(),{mutateAsync:s}=se();async function r(n){await s({connectorId:n})}return K({deleteFn:r,queryKeyToInvalidate:[...x.connectors],setRowSelection:t})}function v({deleteHandler:t}){return e.jsx(Q,{title:"Delete Connectors",handleDelete:t,children:e.jsxs(U,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})}function ne({deleteHandler:t,open:s,setOpen:r}){return e.jsx(g,{open:s,onOpenChange:r,children:e.jsx(v,{deleteHandler:t})})}function oe(){const{selectedRowCount:t,selectedRowIDs:s}=l(),{bulkDelete:r}=w();async function n(){await r(s)}const o=t>1?"s":"",a=`${t} Service connector${o} selected`;return e.jsxs("div",{className:"flex h-7 items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:a}),e.jsxs(g,{children:[e.jsx(k,{asChild:!0,children:e.jsxs(i,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(C,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(v,{deleteHandler:n})]})]})}function ae({queryParams:t}){const{selectedRowCount:s}=l();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s>0?e.jsx(oe,{}):e.jsx(I,{searchParams:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{queryParams:t}),e.jsx(ee,{})]})]})})}function ce({queryParams:t}){const{refetch:s}=y(x.serviceConnectorList(t));return e.jsxs(i,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>s(),children:[e.jsx(H,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})}const d=1,ie=c.object({page:c.coerce.number().min(d).optional().default(d).catch(d),name:c.string().optional(),operator:c.enum(["and","or"]).optional()});function le(){const[t]=$(),{page:s,name:r,operator:n}=ie.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,sortBy:t.get("sort_by")||void 0});return{page:s,name:r,logical_operator:n}}function de({id:t}){const[s,r]=j.useState(!1),{bulkDelete:n}=w();async function o(){await n([t]),r(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(ne,{deleteHandler:o,open:s,setOpen:r}),e.jsxs(R,{children:[e.jsx(A,{asChild:!0,children:e.jsx(i,{intent:"secondary",emphasis:"minimal",className:"flex aspect-square items-center justify-center p-0",children:e.jsx(P,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"})})}),e.jsx(B,{align:"end",sideOffset:7,children:e.jsxs(E,{onSelect:()=>r(!0),className:"cursor-pointer space-x-2",children:[e.jsx(C,{className:"h-3 w-3 fill-neutral-400"}),e.jsx("p",{children:"Delete"})]})})]})]})}function ue(){return j.useMemo(()=>[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(h,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(h,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Service Connector",accessorKey:"name",cell:({row:t})=>{var o;const s=t.original.id,r=t.original.name,n=(o=t.original.body)==null?void 0:o.connector_type;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[!!n&&typeof n!="string"&&e.jsx(q,{connectorType:n}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),className:"block max-w-[200px] truncate text-text-md font-semibold",children:r}),e.jsx(p,{copyText:r})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),children:s.split("-")[0]}),e.jsx(p,{copyText:s})]})]})]})}},{id:"resource_types",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Types"})},cell:({row:t})=>{const s=W(t.original);return e.jsx("div",{className:"flex items-center gap-0.5",children:s.map((r,n)=>e.jsx(J,{resourceType:r},n))})}},{id:"resource-name",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Name"})},cell:({row:t})=>e.jsx("div",{className:"max-w-[100px]",children:e.jsx(X,{connector:t.original})})},{id:"user",header:"Author",accessorFn:t=>{var s,r;return(r=(s=t.resources)==null?void 0:s.user)==null?void 0:r.name},cell:({row:t})=>{var r;const s=(r=t.original.resources)==null?void 0:r.user;return s?e.jsx(L,{className:"max-w-[200px] truncate",username:F(s)}):null}},{id:"expires",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Expires in"})},accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.expires_at},cell:({row:t})=>{var r;const s=(r=t.original.body)==null?void 0:r.expires_at;return s?e.jsx(Y,{expires:s}):e.jsx("p",{children:"Never"})}},{id:"admin_actions",header:"",cell:({row:t})=>e.jsx(de,{id:t.original.id})}],[])}function me({queryParams:t}){const{rowSelection:s,setRowSelection:r}=l(),n=y({...x.serviceConnectorList(t)}),o=ue();if(n.isPending)return e.jsxs("div",{className:"space-y-5",children:[e.jsx(f,{className:"h-[300px] w-full"}),e.jsx(f,{className:"mx-auto h-[36px] w-[300px]"})]});if(n.isError)return null;const a=n.data;return e.jsx("section",{className:"flex flex-col gap-5",children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:e.jsx(_,{columns:o,data:a.items,rowSelection:s,getRowId:N=>N.id,onRowSelectionChange:r})}),a.total_pages>1&&e.jsx(V,{searchParams:t,paginate:a})]})})}function xe(){const s={...le(),sort_by:"desc:updated"};return e.jsxs(e.Fragment,{children:[e.jsx(ae,{queryParams:s}),e.jsx(me,{queryParams:s})]})}function Be(){return e.jsxs(M,{className:"space-y-4 p-5",children:[e.jsx(Z,{}),e.jsx(re,{children:e.jsx(xe,{})})]})}export{Be as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as x,j as e}from"./@radix-C_LirfyT.js";import{s as j,A as E,d as ae,u as re,b as N,a as B}from"./service-B9aVzfAF.js";import{h as v,c as C,b as S}from"./@tanstack-C0SeHZng.js";import{aA as _,aB as ie,B as f,aC as q,aD as z,D as H,s as K,I as D,aG as $,aH as Q,aI as k,v as T,y as F,F as R,E as P,G as V,H as oe,Y as G,z as A,aF as L,O as ce,Q as le,R as de,U as ue,d as b,J as me,K as xe,L as he,M as pe,av as fe,aJ as ye,b8 as je,aK as ge,b9 as be,aM as ve,N as I,j as J,W as Ae,Z as De,bd as we,r as Ne,am as Ce}from"./index-BacoJBEQ.js";import{P as Se}from"./Pagination-CcDD5yHh.js";import{S as Ke}from"./SearchField-D_0-uAPj.js";import{t as U}from"./zod-DgEcN9jD.js";import{u as Y,C as w}from"./index.esm-COnaHLSh.js";import{S as Z}from"./trash-HKxXWbSG.js";import{c as ke,u as Te}from"./bulk-delete-B5RTlnD_.js";import{D as W,a as X}from"./DeleteAlertDialog-BbyFVnVI.js";import{S as ee}from"./key-icon-HOx2gazv.js";import{D as M}from"./DisplayDate-v3KW7oez.js";import{i as Fe,a as Re}from"./dates-Buh6SMo7.js";import{S as Pe}from"./refresh-3EF2R7ja.js";import{A as Oe}from"./AlertDialogDropdownItem-druRNuO2.js";import{S as Ie}from"./info-CyMih3vQ.js";import{I as Me}from"./Infobox-DFCWPbMb.js";import{a as O}from"./@react-router-BSsrkPOd.js";import"./CodeSnippet-D8iBqOVv.js";import"./Tick-DDeDgTuT.js";import"./check-D1bHMJkL.js";import"./@reactflow-D9hglKLF.js";import"./chevron-right-double-CbRQKN4Q.js";import"./index-BRhKF2z-.js";function te({serviceAccountId:t,isFallback:s}){const n=v(),[i,a]=x.useState(!1),[r,o]=x.useState(""),u=!!r;function m(){return u?e.jsx(E,{value:r}):e.jsx(Ee,{isFallback:s,serviceAccountId:t,setApikeyValue:o})}return e.jsx(e.Fragment,{children:e.jsxs(_,{open:i,onOpenChange:l=>{s&&!l&&n.invalidateQueries({queryKey:j.apiKeysKey(t)}),a(l),o("")},children:[e.jsx(ie,{asChild:!0,children:e.jsx(f,{className:"shrink-0",intent:"primary",size:"sm",children:"Generate API Key"})}),e.jsxs(q,{"data-success":u,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(z,{children:e.jsx(H,{children:u?"API Key Created Successfully":"Generate API Key"})}),m()]})]})})}function Ee({serviceAccountId:t,setApikeyValue:s,isFallback:n}){const{toast:i}=K(),a=v(),{handleSubmit:r,control:o,formState:{isValid:u},reset:m}=Y({resolver:U(ae),defaultValues:{name:"",description:""}}),{mutate:l}=re({onError(c){k(c)&&i({status:"error",emphasis:"subtle",description:c.message,rounded:!0})},onSuccess(c){var y;n||a.invalidateQueries({queryKey:j.apiKeysKey(t)}),s(((y=c.body)==null?void 0:y.key)||""),m()}});function d(c){l({serviceAccountId:t,body:{name:c.name,description:c.description}})}return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:r(d),children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Name:"}),e.jsx(w,{name:"name",control:o,render:({field:c})=>e.jsx(D,{...c,className:"w-full",required:!0,placeholder:"Add name"})})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Description:"}),e.jsx(w,{name:"description",control:o,render:({field:c})=>e.jsx(D,{...c,className:"w-full",placeholder:"Add description"})})]})]}),e.jsxs($,{className:"gap-[10px]",children:[e.jsx(Q,{asChild:!0,children:e.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(f,{intent:"primary",disabled:!u,type:"submit",form:"create-secret-form",children:"Generate Key"})]})]})}async function Be(t,s){const n=F(P.serviceAccounts.apiKeys.detail(t,s)),i=await T(n,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!i.ok){const a=await i.json().then(r=>Array.isArray(r.detail)?r.detail[1]:r.detail).catch(()=>`Failed to delete api key ${s}`);throw new R({status:i.status,statusText:i.statusText,message:a})}return i.json()}function _e(t){return C({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n})=>{await Be(s,n)}})}const{ContextProvider:qe,useContext:g}=ke();function se(t){const{setRowSelection:s}=g(),{mutateAsync:n}=_e();async function i(a){await n({serviceAccountId:t,apiKeyId:a})}return Te({deleteFn:i,queryKeyToInvalidate:j.serviceAccountsKey(),setRowSelection:s})}function ze({serviceAccountId:t}){const[s,n]=x.useState(!1),{bulkDelete:i}=se(t),{selectedRowIDs:a,selectedRowCount:r}=g();async function o(){await i(a),n(!1)}return e.jsxs(V,{open:s,onOpenChange:n,children:[e.jsx(oe,{asChild:!0,children:e.jsxs(f,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(Z,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(W,{title:`Delete Api Key${r>=2?"s":""}`,handleDelete:o,children:e.jsxs(X,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function He({serviceAccountId:t}){const{selectedRowCount:s}=g();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${s} Api Key${s>1?"s":""} selected`}),e.jsx(ze,{serviceAccountId:t})]})}async function $e({apiKeyId:t,body:s,serviceAccountId:n}){const i=F(P.serviceAccounts.apiKeys.rotate(n,t)),a=await T(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(a.status===404&&G(),!a.ok){const r=await a.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Failed to rotate key ${t}`);throw new R({status:a.status,statusText:a.statusText,message:r})}return a.json()}function Qe(t){return C({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:i})=>$e({serviceAccountId:s,apiKeyId:n,body:i})})}const Ve=A.object({enableRetention:A.boolean(),rotateMinutes:A.coerce.number().int().min(1).optional()}).refine(t=>!(t.enableRetention&&!t.rotateMinutes));function Ge({serviceAccountId:t,apiKeyId:s,open:n,setOpen:i}){const[a,r]=x.useState(""),o=!!a;function u(){return o?e.jsx(E,{value:a}):e.jsx(Le,{setApiKeyValue:r,apiKeyId:s,serviceAccountId:t})}return e.jsx(_,{open:n,onOpenChange:m=>{i(m),r("")},children:e.jsxs(q,{className:"mx-auto max-w-[800px] overflow-x-auto",children:[e.jsx(z,{children:e.jsx(H,{children:"Rotate API Key"})}),u()]})})}function Le({apiKeyId:t,serviceAccountId:s,setApiKeyValue:n}){const{toast:i}=K(),a=v(),{control:r,watch:o,register:u,handleSubmit:m,formState:{errors:l,isValid:d}}=Y({resolver:U(Ve),defaultValues:{enableRetention:!1,rotateMinutes:void 0}});function c(p){const h={retain_period_minutes:p.rotateMinutes};y({serviceAccountId:s,apiKeyId:t,body:h})}const{mutate:y}=Qe({onError(p){k(p)&&i({status:"error",emphasis:"subtle",description:p.message,rounded:!0})},onSuccess(p){var h;i({description:"The API key has been rotated successfully.",status:"success",emphasis:"subtle",rounded:!0}),n(((h=p.body)==null?void 0:h.key)||""),a.invalidateQueries({queryKey:[...j.apiKeysKey(s)]})}});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx(Je,{apiKeyId:t,serviceAccountId:s}),e.jsx(Ue,{}),e.jsxs("form",{onSubmit:m(c),id:"retention-form",children:[e.jsxs("div",{className:"flex items-center gap-1 rounded-t-md border bg-theme-surface-secondary p-1",children:[e.jsx(w,{control:r,name:"enableRetention",render:({field:{onChange:p,value:h}})=>e.jsx(L,{className:"data-[state=unchecked]:bg-neutral-200",checked:h,id:"enable-retention",onCheckedChange:ne=>p(!!ne)})}),"Include Retention Period",e.jsx(ce,{children:e.jsxs(le,{children:[e.jsx(de,{asChild:!0,children:e.jsxs("button",{type:"button",children:[e.jsx(Ie,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsx("div",{className:"sr-only",children:"Info tooltip"})]})}),e.jsx(ue,{className:"z-50 flex max-w-[480px] bg-black",children:e.jsx("p",{className:"text-text-xs text-white",children:"To minimize disruption, you can set a retention period for your current key. Enter the duration(in minutes) you'd like the old key to remain active alongside the new one."})})]})})]}),e.jsxs("fieldset",{disabled:!o("enableRetention"),className:"space-y-5 rounded-b-md border-x border-b p-5 text-text-md text-theme-text-primary",children:[e.jsx("p",{className:"text-text-md text-theme-text-primary",children:"Keep the current key working for the next"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-text-sm text-theme-text-primary",htmlFor:"retention-minutes",children:"Minutes"}),e.jsx(D,{id:"retention-minutes",...u("rotateMinutes"),disabled:!o("enableRetention"),placeholder:"0"}),l.rotateMinutes&&e.jsx("p",{className:"text-text-sm text-theme-text-error",children:l.rotateMinutes.message})]})]})]})]}),e.jsxs($,{className:"gap-[10px]",children:[e.jsx(Q,{asChild:!0,children:e.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(f,{intent:"primary",disabled:!d,size:"sm",form:"retention-form",children:"Rotate Key"})]})]})}function Je({apiKeyId:t,serviceAccountId:s}){var r;const{data:n,isPending:i,isError:a}=S({...N.ApiKeysDetail(s,t),throwOnError:!0});return i?e.jsx(b,{className:"h-8 w-full"}):a?null:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ee,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{children:n&&n.name}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:n&&((r=n.metadata)==null?void 0:r.description)})]})]})}function Ue(){return e.jsxs(Me,{children:[e.jsx("strong",{children:"Your current API Key will be deactivated."})," This means any processes or integrations using the old key will no longer function once the new key is generated."]})}function Ye({serviceAccountId:t,apiKeyId:s}){const[n,i]=x.useState(!1),[a,r]=x.useState(!1),[o,u]=x.useState(!1),m=x.useRef(null),l=x.useRef(null),{bulkDelete:d}=se(t);function c(){l.current=m.current}function y(h){u(h),h||i(!1)}async function p(){await d([s]),y(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(Ge,{setOpen:r,open:a,serviceAccountId:t,apiKeyId:s}),e.jsxs(me,{onOpenChange:i,open:n,children:[e.jsx(xe,{ref:m,children:e.jsx(he,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(pe,{hidden:o,onCloseAutoFocus:h=>{l.current&&(l.current.focus(),l.current=null,h.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(fe,{className:"px-3",onClick:()=>r(!0),icon:e.jsx(Pe,{}),children:e.jsx("span",{children:"Rotate"})}),e.jsx(Oe,{onSelect:c,open:o,onOpenChange:y,triggerChildren:"Delete",icon:e.jsx(Z,{fill:"red"}),children:e.jsx(W,{title:"Delete API Key",handleDelete:p,children:e.jsxs(X,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})]})]})]})}async function Ze({apiKeyId:t,body:s,serviceAccountId:n}){const i=F(P.serviceAccounts.apiKeys.detail(n,t)),a=await T(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(a.status===404&&G(),!a.ok){const r=await a.json().then(o=>Array.isArray(o.detail)?o.detail[0]:o.detail||"An error occurred").catch(()=>`Failed to update key ${t}`);throw new R({status:a.status,statusText:a.statusText,message:r})}return a.json()}function We(t){return C({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:i})=>{await Ze({serviceAccountId:s,apiKeyId:n,body:i})}})}function Xe({isActive:t,serviceAccountId:s,apiKeyId:n}){const{toast:i}=K(),a=v(),[r,o]=x.useState(!1),{mutate:u}=We({onError(d){k(d)&&i({status:"error",emphasis:"subtle",description:d.message,rounded:!0})},onSuccess(){a.invalidateQueries({queryKey:j.apiKeysKey(s)})}});function m(d){d?l(d):o(!0)}async function l(d){u({serviceAccountId:s,apiKeyId:n,body:{active:d}})}return e.jsxs(e.Fragment,{children:[e.jsx(V,{open:r,onOpenChange:o,children:e.jsxs(ye,{children:[e.jsx(je,{children:e.jsx(ge,{children:"Deactivate API Key"})}),e.jsxs("div",{className:"p-5 text-text-md text-theme-text-secondary",children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"You won't be able to use this API Key to authenticate with the server anymore."})]}),e.jsxs(be,{className:"gap-[10px]",children:[e.jsx(ve,{asChild:!0,children:e.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(f,{onClick:()=>l(!1).then(d=>o(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx(L,{checked:t,onCheckedChange:m})]})}function et(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(I,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(I,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Name",accessorFn:t=>({name:t.name}),cell:({row:t})=>{var s;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ee,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center space-x-1",children:e.jsx("div",{className:"flex items-center space-x-1 text-text-md font-semibold text-theme-text-primary",children:t.original.name})}),e.jsx("div",{className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",children:(s=t.original.metadata)==null?void 0:s.description})]})]})}},{id:"last-login",header:"Last Login",accessorFn:t=>{var s;return(s=t.metadata)==null?void 0:s.last_login},cell:({row:t})=>{var s,n;return(s=t.original.metadata)!=null&&s.last_login?e.jsx("p",{children:e.jsx(M,{short:!0,dateString:(n=t.original.metadata)==null?void 0:n.last_login})}):e.jsx("p",{children:"Never"})}},{id:"last-rotated",header:"Last Rotated",accessorFn:t=>{var s;return(s=t.metadata)==null?void 0:s.last_rotated},cell:({row:t})=>{var r;const s=(r=t.original.metadata)==null?void 0:r.last_rotated;if(!s)return e.jsx("p",{children:"Never"});const n=new Date(`${s}Z`),i=Fe(n),a=Re(n);return e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(M,{short:!0,dateString:s})}),(i||a)&&e.jsx("p",{className:`${a?"text-theme-text-error":"text-theme-text-warning"} text-text-xs`,children:a?"More than 1 year old":"More than 6 months old"})]})}},{id:"active",header:"Active",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.active},cell:({row:t})=>{var s,n;return e.jsx(Xe,{isActive:!!((s=t.original.body)!=null&&s.active),serviceAccountId:((n=t.original.body)==null?void 0:n.service_account.id)||"",apiKeyId:t.original.id})}},{id:"actions",header:"",meta:{width:"5%"},cell:({row:t})=>{var n;const s=(n=t.original.body)==null?void 0:n.service_account.id;return s?e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Ye,{serviceAccountId:s,apiKeyId:t.original.id})}):null}}]}function tt(){const{serviceAccountId:t}=O();return e.jsxs(J,{className:"flex flex-col items-center justify-center space-y-4 p-9",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold text-theme-text-primary",children:"This service account doesn't have any API Keys yet"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Generate your first API Key to enable secure interactions with the ZenML Server."})]}),e.jsx(te,{isFallback:!0,serviceAccountId:t})]})}function st(){const{serviceAccountId:t}=O(),s=B(),{rowSelection:n,setRowSelection:i}=g(),a=x.useMemo(()=>et(),[]),{data:r}=S({...N.serviceAccountApiKeys(t,{...s,sort_by:"desc:created",hydrate:!0})});return r&&(r==null?void 0:r.items.length)<1&&!s.name?e.jsx(tt,{}):e.jsxs(e.Fragment,{children:[e.jsx(nt,{serviceAccountId:t}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:r?e.jsx(Ae,{getRowId:o=>o.id,rowSelection:n,onRowSelectionChange:i,columns:a,data:r.items}):e.jsx(b,{className:"h-[500px] w-full"})}),r?r.total_pages>1&&e.jsx(Se,{searchParams:s,paginate:r}):e.jsx(b,{className:"h-[36px] w-[300px]"})]})]})}function nt({serviceAccountId:t}){const s=B(),{selectedRowCount:n}=g();return e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[n?e.jsx(He,{serviceAccountId:t}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(Ke,{searchParams:s})}),e.jsx(te,{isFallback:!1,serviceAccountId:t})]})}function at(t){const{setBreadcrumbs:s}=De();x.useEffect(()=>{t&&s([...we,{label:t.name,href:Ne.settings.service_accounts.detail(t.id)}])},[s,t])}function Ft(){return e.jsxs(J,{className:"space-y-5 p-5",children:[e.jsxs("div",{children:[e.jsx(rt,{}),e.jsx("h1",{className:"my-5 text-text-lg font-semibold",children:"API Keys"})]}),e.jsx(qe,{children:e.jsx(st,{})})]})}function rt(){var i,a,r;const{serviceAccountId:t}=O(),s=S({...N.serviceAccountDetail(t),throwOnError:!0});if(at(s.data),s.isPending)return e.jsx(b,{className:"h-9 w-full"});if(s.isError)return null;const n=s.data;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-text-xl font-semibold",children:n.name}),e.jsx(Ce,{size:"sm",color:(i=n.body)!=null&&i.active?"light-purple":"light-grey",className:"text-text-xs font-semibold uppercase",children:(a=n.body)!=null&&a.active?"active":"inactive"})]}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:(r=n.metadata)==null?void 0:r.description})]})}export{rt as APIKeyHeader,Ft as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as a,j as e}from"./@radix-C_LirfyT.js";import{Z as g,bl as C,r as p,$ as b,b3 as y,B as i,at as c}from"./index-BacoJBEQ.js";import{H as u,B as x,F as v,W as N}from"./Wizard-8aJzxUjb.js";import{S as f}from"./arrow-left-hcj2H8HY.js";import{C as S}from"./configuration-form-Yz8m0QIG.js";import{c as k,L as F}from"./@react-router-BSsrkPOd.js";import{S as B,s as w}from"./constants-DeV48DuZ.js";import{C as T}from"./ComponentIcon-BXgpt-jw.js";import"./@tanstack-C0SeHZng.js";import"./@reactflow-D9hglKLF.js";import"./index-B7CRNU8l.js";import"./form-6aSt3tIl.js";import"./plus-cI8zD2xh.js";import"./trash-HKxXWbSG.js";import"./index.esm-COnaHLSh.js";import"./info-CyMih3vQ.js";import"./zod-DgEcN9jD.js";import"./transform-DFpKTKgF.js";import"./check-D1bHMJkL.js";import"./CodeSnippet-D8iBqOVv.js";import"./file-text-CltVhgwZ.js";import"./terminal-square-BObrvDlO.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";function z(){const{setBreadcrumbs:s}=g();a.useEffect(()=>{s([C,{label:"Create",href:p.components.create}])},[s])}function H(){return z(),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{className:"h-5 w-5 fill-turquoise-400"}),e.jsx("h1",{className:"text-display-xs font-semibold",children:"Register new Component"})]})})}function I({flavor:s,type:t,handleBack:r}){const l=a.useId(),o=k();function m(d){o(p.components.detail(d))}return e.jsxs(e.Fragment,{children:[e.jsxs(u,{className:"flex items-center gap-2",children:[e.jsxs(i,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(f,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs("span",{children:["Configure your ",c(s.name)," ",c(t)]})]}),e.jsx(x,{className:"p-0",children:e.jsx(S,{flavorId:s.id,formId:l,successHandler:m,FooterComponent:L})})]})}function L({formId:s,isPending:t}){return e.jsxs(v,{children:[e.jsx(i,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(F,{to:p.components.overview,children:"Cancel"})}),e.jsxs(i,{size:"md",disabled:t,type:"submit",form:s,children:[t&&e.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Register Component"]})]})}function R({type:s,handleFlavorSelect:t,handleBack:r}){return e.jsxs(e.Fragment,{children:[e.jsxs(u,{className:"flex items-center gap-2",children:[e.jsxs(i,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(f,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs("span",{children:["Select your ",c(s)," Flavor"]})," "]}),e.jsx(x,{children:e.jsx(B,{type:s,setSelectedFlavor:t})})]})}function q({selectTypeHandler:s}){return e.jsxs(e.Fragment,{children:[e.jsx(u,{children:"Select your Component Type"}),e.jsx(x,{children:e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:w.map(t=>e.jsx(E,{type:t,selectTypeHandler:s},t))})})]})}function E({type:s,selectTypeHandler:t}){return e.jsxs("button",{onClick:()=>t(s),className:"flex h-[110px] flex-col items-center justify-center space-y-2 truncate whitespace-nowrap rounded-md border border-theme-border-moderate bg-theme-surface-secondary py-5 text-center text-text-sm text-theme-text-secondary transition-all duration-150 hover:bg-theme-surface-primary hover:shadow-sm",children:[e.jsx(T,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:s}),e.jsx("span",{children:c(s)})]})}function W(){const[s,t]=a.useState(0),[r,l]=a.useState(null),[o,m]=a.useState();function d(n){l(n),t(1)}function j(n){m(n),t(2)}function h(){t(n=>n-1)}return e.jsxs(N,{children:[s===0&&e.jsx(q,{selectTypeHandler:d}),s===1&&r&&e.jsx(R,{type:r,handleFlavorSelect:j,handleBack:h}),s===2&&o&&r&&e.jsx(I,{flavor:o,type:r,handleBack:h})]})}function ce(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx(H,{}),e.jsx("section",{className:"layout-container pb-5",children:e.jsx(W,{})})]})}export{ce as default};
|