@langwatch/server 3.1.0-beta.21 → 3.1.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/__init__.py +36 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/_logger.py +165 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/batch_clustering.py +153 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/build_response.py +77 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/constants.py +7 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/incremental_clustering.py +325 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/topic_naming.py +432 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/types.py +42 -0
- package/langevals/evaluators/topic_clustering/langevals_topic_clustering/utils.py +191 -0
- package/langevals/evaluators/topic_clustering/pyproject.toml +52 -0
- package/langevals/evaluators/topic_clustering/tests/test_topic_clustering.py +239 -0
- package/langevals/evaluators/topic_clustering/tests/test_topic_clustering_integration.py +97 -0
- package/langevals/evaluators/topic_clustering/tests/test_topic_naming.py +72 -0
- package/langevals/langevals/pytest_plugins/pass_rate_plugin.py +7 -1
- package/langevals/langevals/server.py +28 -0
- package/langevals/pyproject.toml +3 -0
- package/langevals/uv.lock +119 -20
- package/langwatch/dist/client/assets/{AnnotationsTable-BDAkYaz6.js → AnnotationsTable-uS_9SQ-g.js} +2 -2
- package/langwatch/dist/client/assets/{BatchEvaluationSummary-DMaQM_VB.js → BatchEvaluationSummary-DtFd8yKJ.js} +2 -2
- package/langwatch/dist/client/assets/{BudgetEditDrawer-CHaqmdIl.js → BudgetEditDrawer-CHEPz0hH.js} +2 -2
- package/langwatch/dist/client/assets/{ChartCard-D14PUg_d.js → ChartCard-s5fMPo7b.js} +2 -2
- package/langwatch/dist/client/assets/{ChatWindow-CRDnlP-Q.js → ChatWindow-C0XSteVJ.js} +2 -2
- package/langwatch/dist/client/assets/ChatWindow-DFEmNXQL.js +1 -0
- package/langwatch/dist/client/assets/{ConfirmDialog-CXIhncvW.js → ConfirmDialog-M94yLNvP.js} +2 -2
- package/langwatch/dist/client/assets/{ContactSalesBlock-CijLBwRC.js → ContactSalesBlock-CnnuZ8iI.js} +2 -2
- package/langwatch/dist/client/assets/{DSPyExperiment-B1YOL2m8.js → DSPyExperiment-CMA6lrlx.js} +2 -2
- package/langwatch/dist/client/assets/{FilterDisplay-BB0xWrLn.js → FilterDisplay-0S3NqCkq.js} +2 -2
- package/langwatch/dist/client/assets/{FormatMoney-w9vr_h0X.js → FormatMoney-CCygtAHg.js} +2 -2
- package/langwatch/dist/client/assets/{FoundryDrawer-CdJDXtpz.js → FoundryDrawer-B35xZ26C.js} +2 -2
- package/langwatch/dist/client/assets/{GatewayErrorPanel-DvE9U2dS.js → GatewayErrorPanel-BsaYQEie.js} +2 -2
- package/langwatch/dist/client/assets/{GatewayLayout-lv1p_6B5.js → GatewayLayout-LvwwrwMf.js} +2 -2
- package/langwatch/dist/client/assets/{GraphsLayout-BJ68J9e-.js → GraphsLayout-DJ-HI9N1.js} +2 -2
- package/langwatch/dist/client/assets/{GroupBindingInputRow-DebZBCnD.js → GroupBindingInputRow-CV-fBkX9.js} +2 -2
- package/langwatch/dist/client/assets/{MessagesTable-B6lYde-x.js → MessagesTable-9taaKCOZ.js} +2 -2
- package/langwatch/dist/client/assets/{NavigationFooter-CiOVzDUh.js → NavigationFooter-Dzvauw3l.js} +2 -2
- package/langwatch/dist/client/assets/{NoDataInfoBlock-quSW_MRm.js → NoDataInfoBlock-CLKl_wlX.js} +2 -2
- package/langwatch/dist/client/assets/{OpsPageShell-DJ1WlI6-.js → OpsPageShell-C_mTziRS.js} +2 -2
- package/langwatch/dist/client/assets/{OptimizationStudio-BlozXjcN.js → OptimizationStudio-D2zpsmJj.js} +8 -12
- package/langwatch/dist/client/assets/{PreconditionsField-BOfcWvmZ.js → PreconditionsField-WXB8kcTK.js} +2 -2
- package/langwatch/dist/client/assets/{SettingsLayout-CLCGxMAe.js → SettingsLayout--1gdEuhv.js} +2 -2
- package/langwatch/dist/client/assets/{SubscriptionPage-J8b2Zaj6.js → SubscriptionPage-B0ox_4kM.js} +2 -2
- package/langwatch/dist/client/assets/{VirtualKeySecretReveal-DR1VDLy7.js → VirtualKeySecretReveal-CRbI1dKQ.js} +2 -2
- package/langwatch/dist/client/assets/{WithPermissionGuard-DD8uo3UK.js → WithPermissionGuard-B4Jo8E5-.js} +2 -2
- package/langwatch/dist/client/assets/{__...path__-BZVaIayJ.js → __...path__-BF2zkD84.js} +2 -2
- package/langwatch/dist/client/assets/{_experiment_-B1aT-wS3.js → _experiment_-D02aoVQk.js} +2 -2
- package/langwatch/dist/client/assets/{_id_-oI_eq-I_.js → _id_-Ch8YmTiM.js} +2 -2
- package/langwatch/dist/client/assets/{_id_-DAqPuO73.js → _id_-D6ZvwHpH.js} +2 -2
- package/langwatch/dist/client/assets/{_id_-DUngklVb.js → _id_-DOC1ZkBm.js} +2 -2
- package/langwatch/dist/client/assets/{_id_-jFDAfbob.js → _id_-DfWwW6_N.js} +2 -2
- package/langwatch/dist/client/assets/{_id_-BKBrWGG0.js → _id_-DxUo4W7J.js} +2 -2
- package/langwatch/dist/client/assets/_not-found-COI3ShsR.js +1 -0
- package/langwatch/dist/client/assets/{_project_-Bt1tayHB.js → _project_-_UUt5Ar9.js} +2 -2
- package/langwatch/dist/client/assets/{_runId_-CfvnDt5H.js → _runId_-Dimwzp48.js} +2 -2
- package/langwatch/dist/client/assets/_slug_-BMvKBwS_.js +2 -0
- package/langwatch/dist/client/assets/{_slug_-DZAdl0QS.js → _slug_-CE6VoDSC.js} +2 -2
- package/langwatch/dist/client/assets/{_slug_-DmoWXjKT.js → _slug_-OiOLG1Mv.js} +2 -2
- package/langwatch/dist/client/assets/{_team_-DL_wKSWK.js → _team_-DKvmwO_5.js} +2 -2
- package/langwatch/dist/client/assets/{_workflow_-DcMXLPUe.js → _workflow_-FkilKiB-.js} +3 -3
- package/langwatch/dist/client/assets/{_workflow_-NI9bac7d.js → _workflow_-gJZppg3h.js} +2 -2
- package/langwatch/dist/client/assets/{access-audit-CFwNwusI.js → access-audit-xcUVYMMT.js} +2 -2
- package/langwatch/dist/client/assets/{agents-Di4XRwcn.js → agents-D32g91cu.js} +2 -2
- package/langwatch/dist/client/assets/{all-C273mlDB.js → all-vnREzDZj.js} +2 -2
- package/langwatch/dist/client/assets/{analytics-CEAcSf6B.js → analytics-DP6Y4Feh.js} +2 -2
- package/langwatch/dist/client/assets/{annotation-scores-CHfn4LQp.js → annotation-scores-CjD4CEB6.js} +2 -2
- package/langwatch/dist/client/assets/{annotations-CHZQrha6.js → annotations-1rVXiDRQ.js} +2 -2
- package/langwatch/dist/client/assets/{api-keys-BT7HExHM.js → api-keys-BJpKyuaz.js} +2 -2
- package/langwatch/dist/client/assets/{audit-log-BGk-51Dt.js → audit-log-BdUdZjxp.js} +2 -2
- package/langwatch/dist/client/assets/{authentication-DvwXfkp-.js → authentication-8mQB00CC.js} +2 -2
- package/langwatch/dist/client/assets/{authorize-tXpHrWyw.js → authorize-BpUueMNW.js} +2 -2
- package/langwatch/dist/client/assets/{authorize-CRu9xlpU.js → authorize-CbNBtmxW.js} +2 -2
- package/langwatch/dist/client/assets/{automations-CjDvz9Ak.js → automations-34KMkRxd.js} +2 -2
- package/langwatch/dist/client/assets/{billing-plans-FUqEPN62.js → billing-plans-BUQp08MI.js} +2 -2
- package/langwatch/dist/client/assets/{budgets-BV6_RHrs.js → budgets-CdelE8Hv.js} +2 -2
- package/langwatch/dist/client/assets/{cache-rules-CtYA79E_.js → cache-rules-D2m1QlNJ.js} +2 -2
- package/langwatch/dist/client/assets/choose-C0LdeUiH.js +2 -0
- package/langwatch/dist/client/assets/{command-bar-CaJygoez.js → command-bar-DUK45yin.js} +7 -9
- package/langwatch/dist/client/assets/custom-hBq2K4FJ.js +1 -0
- package/langwatch/dist/client/assets/{datasets-vLWpH84_.js → datasets-ErNNhmjg.js} +2 -2
- package/langwatch/dist/client/assets/{dejaview-DwVR3RGg.js → dejaview-BaD4_v90.js} +2 -2
- package/langwatch/dist/client/assets/{dist-SwV3YZv3.js → dist-Cds4Mqhj.js} +4 -6
- package/langwatch/dist/client/assets/{edit-CyxsmQmW.js → edit-DpT8ejBV.js} +2 -2
- package/langwatch/dist/client/assets/{evaluations-BfgeZMph.js → evaluations-BdQ2Dm2r.js} +2 -2
- package/langwatch/dist/client/assets/{evaluations-HSQIMvbX.js → evaluations-C90I4VAr.js} +2 -2
- package/langwatch/dist/client/assets/{evaluators-DLHVvnrh.js → evaluators-ig_ugRLt.js} +2 -2
- package/langwatch/dist/client/assets/{foundry-Ckq0WjPU.js → foundry-B-X_80pD.js} +2 -2
- package/langwatch/dist/client/assets/{gateway-CDSYPZ6w.js → gateway-CS_mtJx-.js} +2 -2
- package/langwatch/dist/client/assets/{groups-CCCRUqPj.js → groups-Bp90ChP3.js} +2 -2
- package/langwatch/dist/client/assets/{index-Bm6z2fM9.js → index-BEjGS0kI.js} +5 -5
- package/langwatch/dist/client/assets/{license-CHOarGWr.js → license-CgnlvyuI.js} +2 -2
- package/langwatch/dist/client/assets/{me-CBya_vXs.js → me-DEqhm_KC.js} +2 -2
- package/langwatch/dist/client/assets/{members-lIFLh-rh.js → members-CUJANDtH.js} +2 -2
- package/langwatch/dist/client/assets/{messages-CG9j8Dz8.js → messages-fQBfCjvp.js} +2 -2
- package/langwatch/dist/client/assets/{metrics-C9pzeaI6.js → metrics-DeIxebpD.js} +2 -2
- package/langwatch/dist/client/assets/{model-costs-Bc5uqjkl.js → model-costs-C1RbgK--.js} +2 -2
- package/langwatch/dist/client/assets/{model-providers-B5UjRgS_.js → model-providers-Pv3ML_-t.js} +2 -2
- package/langwatch/dist/client/assets/{my-queue-BkEfiWyR.js → my-queue-BLre2NMr.js} +2 -2
- package/langwatch/dist/client/assets/{ops-Cc-g-CMn.js → ops-CCw-FJaT.js} +2 -2
- package/langwatch/dist/client/assets/{organization-features-CoIKKHkQ.js → organization-features-rqg-75mI.js} +2 -2
- package/langwatch/dist/client/assets/{organizations-DWcQUTzi.js → organizations-DjCzIHVx.js} +2 -2
- package/langwatch/dist/client/assets/{persistence-CTQ44vGL.js → persistence-BPvHS0F6.js} +2 -2
- package/langwatch/dist/client/assets/{plans-Dq3eFg5K.js → plans-Ch2Ol-Fd.js} +2 -2
- package/langwatch/dist/client/assets/{projections-CTNj1QBM.js → projections-it4FOVjm.js} +2 -2
- package/langwatch/dist/client/assets/{projects-BxM7C87h.js → projects-CjWZFLfn.js} +2 -2
- package/langwatch/dist/client/assets/{prompts-DhXnJT6e.js → prompts-DilmFH_s.js} +2 -2
- package/langwatch/dist/client/assets/{providers-DW7VWdqq.js → providers-tlLT_lTF.js} +2 -2
- package/langwatch/dist/client/assets/{reports-D3QFKhNP.js → reports-vlrcTrLs.js} +2 -2
- package/langwatch/dist/client/assets/{roles-B_0t5DWA.js → roles-DNgi-NQ9.js} +2 -2
- package/langwatch/dist/client/assets/{scenarios-BX3XslU0.js → scenarios-BmG_wDkR.js} +2 -2
- package/langwatch/dist/client/assets/{scim-DDsLO39r.js → scim-BKr1_FHt.js} +2 -2
- package/langwatch/dist/client/assets/{secrets-BvEGwDCy.js → secrets-CU8ocTGv.js} +2 -2
- package/langwatch/dist/client/assets/{settings-9giNiAQQ.js → settings-CDzdoYVK.js} +2 -2
- package/langwatch/dist/client/assets/{setup-HxXKoVKG.js → setup-nEvn2rjN.js} +2 -2
- package/langwatch/dist/client/assets/{subscription-DhyswDze.js → subscription-BPNl_6jF.js} +3 -3
- package/langwatch/dist/client/assets/{subscriptions-Dyyau22a.js → subscriptions-D0G-OE5C.js} +2 -2
- package/langwatch/dist/client/assets/{teams-DRmeAxzf.js → teams-DThgDQvB.js} +2 -2
- package/langwatch/dist/client/assets/{textOverflowHeuristic-JibhpzDV.js → textOverflowHeuristic-DTC8-Ffx.js} +2 -2
- package/langwatch/dist/client/assets/{topic-clustering-Bllfw5rZ.js → topic-clustering-BR2Mbpao.js} +2 -2
- package/langwatch/dist/client/assets/{topics-CpiGYxqb.js → topics-CI8GoNqp.js} +2 -2
- package/langwatch/dist/client/assets/{traceExecutor-CiHXJB0V.js → traceExecutor-CDUGyUaw.js} +2 -2
- package/langwatch/dist/client/assets/{usage-BnsstwBY.js → usage-B4mR7ut_.js} +2 -2
- package/langwatch/dist/client/assets/{usage-CoyGtJoI.js → usage-C8fbffYi.js} +2 -2
- package/langwatch/dist/client/assets/{useAdminResource-SPC5iBHM.js → useAdminResource-SmnnHro6.js} +2 -2
- package/langwatch/dist/client/assets/{useAnnotationQueues-2DKZTC7r.js → useAnnotationQueues-CA6Vk--V.js} +2 -2
- package/langwatch/dist/client/assets/{useAvailableEvaluators-HndTl2LV.js → useAvailableEvaluators-hmbmcRQr.js} +2 -2
- package/langwatch/dist/client/assets/{useDeleteDatasetConfirmation-BgWN6Qqb.js → useDeleteDatasetConfirmation-BCK_zUUe.js} +2 -2
- package/langwatch/dist/client/assets/{useWorkflowStore-e1wFCvo2.js → useWorkflowStore-QUJ3J8X9.js} +2 -2
- package/langwatch/dist/client/assets/{users-C6wjliCC.js → users-CfhanCfR.js} +2 -2
- package/langwatch/dist/client/assets/{users-tF6ZKeV1.js → users-HjuN3o6k.js} +2 -2
- package/langwatch/dist/client/assets/{virtual-keys-BL-65S0B.js → virtual-keys-Bj-MhW66.js} +2 -2
- package/langwatch/dist/client/assets/{wizard-faGkpZDT.js → wizard-dRWCVVx6.js} +2 -2
- package/langwatch/dist/client/assets/{workbench-Oj0s_YR-.js → workbench-CuixH3G1.js} +2 -2
- package/langwatch/dist/client/assets/{workflows-Cu9k-Twu.js → workflows-BT6m4Yu9.js} +2 -2
- package/langwatch/dist/client/index.html +3 -3
- package/langwatch/dist/scenario-child-process.js +20 -10
- package/langwatch/package.json +2 -2
- package/langwatch/pnpm-lock.yaml +329 -328
- package/langwatch/scripts/seed-dogfood-password.ts +163 -0
- package/langwatch/src/app/api/workflows/post_event/__tests__/post-event-evaluator.integration.test.ts +458 -0
- package/langwatch/src/app/api/workflows/post_event/__tests__/post-event-routing.test.ts +188 -0
- package/langwatch/src/app/api/workflows/post_event/__tests__/post-event.integration.test.ts +274 -0
- package/langwatch/src/app/api/workflows/post_event/post-event.ts +29 -1
- package/langwatch/src/components/agents/AgentCodeEditorDrawer.tsx +4 -5
- package/langwatch/src/components/agents/__tests__/AgentCodeEditorDrawer.integration.test.tsx +40 -0
- package/langwatch/src/components/evaluations/wizard/hooks/evaluation-wizard-store/slices/factories/__tests__/code-execution-node.factory.unit.test.ts +47 -0
- package/langwatch/src/components/evaluations/wizard/hooks/evaluation-wizard-store/slices/factories/code-execution-node.factory.ts +2 -4
- package/langwatch/src/components/experiments/BatchEvaluationV2/BatchEvaluationV2EvaluationResults.tsx +6 -1
- package/langwatch/src/hooks/usePostHog.ts +11 -0
- package/langwatch/src/optimization_studio/__tests__/registry.test.ts +29 -1
- package/langwatch/src/optimization_studio/components/Optimize.tsx +17 -3
- package/langwatch/src/optimization_studio/components/properties/AgentPropertiesPanel.tsx +4 -5
- package/langwatch/src/optimization_studio/hooks/workflowStoreCore.ts +17 -6
- package/langwatch/src/optimization_studio/hooks/workflowStoreCore.unit.test.ts +42 -0
- package/langwatch/src/optimization_studio/registry.ts +2 -4
- package/langwatch/src/optimization_studio/server/lambda/index.ts +12 -2
- package/langwatch/src/server/api/routers/workflows.ts +18 -0
- package/langwatch/src/server/evaluations-v3/execution/workflowBuilder.ts +3 -2
- package/langwatch/src/server/evaluations-v3/services/__tests__/experiment-run.service.getRun-null.unit.test.ts +71 -0
- package/langwatch/src/server/evaluations-v3/services/experiment-run.service.ts +18 -9
- package/langwatch/src/server/modelProviders/utils.ts +11 -1
- package/langwatch/src/server/nlpgo/__tests__/nlpgoFetch.integration.test.ts +248 -0
- package/langwatch/src/server/nlpgo/nlpgoFetch.ts +155 -0
- package/langwatch/src/server/routes/__tests__/playground-proxy.integration.test.ts +242 -0
- package/langwatch/src/server/routes/playground.ts +11 -1
- package/langwatch/src/server/routes/workflows.ts +17 -0
- package/langwatch/src/server/topicClustering/topicClustering.ts +33 -8
- package/langwatch/src/server/workflows/runWorkflow.ts +10 -13
- package/langwatch_nlp/langwatch_nlp/studio/execute/execute_component.py +25 -1
- package/langwatch_nlp/langwatch_nlp/studio/parser.py +121 -16
- package/langwatch_nlp/langwatch_nlp/topic_clustering/topic_naming.py +39 -32
- package/langwatch_nlp/scripts/entrypoint.sh +67 -0
- package/langwatch_nlp/tests/studio/test_parse.py +198 -0
- package/mcp-server/pnpm-lock.yaml +15 -21
- package/package.json +1 -1
- package/packages/server/dist/cli.cjs +78 -94
- package/langwatch/dist/client/assets/ChatWindow-DzB-tNlQ.js +0 -1
- package/langwatch/dist/client/assets/_not-found-PEUaWdF3.js +0 -1
- package/langwatch/dist/client/assets/_slug_-C-8AjsjC.js +0 -2
- package/langwatch/dist/client/assets/choose--PBky27o.js +0 -2
- package/langwatch/dist/client/assets/custom-CSiS1liN.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-C7JcuhbW.js";import{$o as n,Hi as r,Un as i,fa as a,hn as o,na as s,sc as c}from"./command-bar-CaJygoez.js";import{j as l,n as u,r as d}from"./stack-oJ9iWdbl.js";import{t as f}from"./tooltip-AEm0YeiF.js";import{n as p}from"./toaster-C_DYALhL.js";import{an as m,f as h}from"./dist-SwV3YZv3.js";import{t as g}from"./heading-D90dlSnH.js";import{t as _}from"./text-CwTrMF8x.js";import{t as v}from"./field-CnUiixMS.js";import{t as y}from"./input-C7emsUCL.js";import{t as b}from"./h-stack-BKLDJ2vg.js";import{t as x}from"./spacer-2LJJGbo8.js";import{t as S}from"./v-stack-EOPQ57OZ.js";import{s as C}from"./auth-client-D3UhxhQi.js";import{t as ee}from"./usePublicEnv-1QvVAhAk.js";import{c as w,t as T}from"./useOrganizationTeamProject-DC0iozx2.js";import{s as E,t as D}from"./index.esm-X7lxUoP1.js";import{t as O}from"./HorizontalFormControl-BCD7-fcT.js";import{n as k,t as A}from"./SettingsLayout-CLCGxMAe.js";import{t as j}from"./WithPermissionGuard-DD8uo3UK.js";import{i as M,r as N}from"./project-zSxGdatx.js";var P=w(),F=e(t()),I=l();function L(){let{organization:e,project:t}=T();return!e||!t?null:(0,I.jsx)(z,{organization:e,project:t})}var R=j(`organization:view`,{layoutComponent:A})(L);function z({organization:e,project:t}){let{hasPermission:n}=T(),{isLiteMember:a}=i(),[o,s]=(0,F.useState)({name:e.name,s3Endpoint:e.s3Endpoint??``,s3AccessKeyId:e.s3AccessKeyId??``,s3SecretAccessKey:e.s3SecretAccessKey??``,elasticsearchNodeUrl:e.elasticsearchNodeUrl??``,elasticsearchApiKey:e.elasticsearchApiKey??``,s3Bucket:e.s3Bucket??``}),{register:c,handleSubmit:l,getFieldState:f}=E({defaultValues:o}),m=C.organization.update.useMutation(),h=C.useContext();return(0,I.jsx)(A,{children:(0,I.jsxs)(S,{gap:6,width:`full`,align:`start`,children:[(0,I.jsxs)(b,{width:`full`,children:[(0,I.jsx)(g,{as:`h2`,children:`Organization Settings`}),(0,I.jsx)(x,{}),m.isLoading&&(0,I.jsx)(d,{})]}),(0,I.jsx)(`form`,{onSubmit:l(t=>{r(t,o)||(s(t),m.mutate({organizationId:e.id,name:t.name,s3Endpoint:t.s3Endpoint,s3AccessKeyId:t.s3AccessKeyId,s3SecretAccessKey:t.s3SecretAccessKey,elasticsearchNodeUrl:t.elasticsearchNodeUrl,elasticsearchApiKey:t.elasticsearchApiKey,s3Bucket:t.s3Bucket},{onSuccess:()=>{h.organization.getAll.refetch(),p.create({title:`Organization updated`,description:`Your organization settings have been saved`,type:`success`,meta:{closable:!0}})},onError:()=>{p.create({title:`Failed to update organization`,description:`Please make sure you have filled out all fields related to either S3 or Elasticsearch`,type:`error`,meta:{closable:!0}})}}))}),style:{width:`100%`},children:(0,I.jsxs)(S,{gap:0,children:[(0,I.jsxs)(S,{gap:0,width:`full`,children:[(0,I.jsx)(O,{label:`Name`,helper:`The name of your organization`,invalid:!!f(`name`).error,children:n(`organization:manage`)?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{width:`full`,type:`text`,...c(`name`,{required:!0,validate:e=>{if(!e.trim())return!1}})}),(0,I.jsx)(v,{children:`Name is required`})]}):(0,I.jsx)(_,{children:e.name})}),(0,I.jsx)(O,{label:`Slug`,helper:`The unique ID of your organization`,children:n(`organization:manage`)?(0,I.jsx)(y,{width:`full`,disabled:!0,type:`text`,value:e.slug}):(0,I.jsx)(_,{children:e.slug})}),(0,I.jsx)(O,{label:`Project ID`,helper:`Use this ID when authenticating with Personal Access Tokens`,children:(0,I.jsx)(y,{width:`full`,disabled:!0,type:`text`,value:t.id})}),e.useCustomS3&&(0,I.jsx)(O,{label:`S3 Storage`,helper:`Configure S3 storage to host data on your own infrastructure. Leave empty to use LangWatch's managed storage.`,children:n(`organization:manage`)?(0,I.jsxs)(S,{width:`full`,align:`start`,gap:3,children:[(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Endpoint`,...c(`s3Endpoint`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`Access Key ID`,...c(`s3AccessKeyId`)}),(0,I.jsx)(y,{width:`full`,type:`password`,placeholder:`Secret Access Key`,...c(`s3SecretAccessKey`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Bucket Name`,...c(`s3Bucket`)})]}):(0,I.jsx)(_,{children:`S3 storage configuration is only visible to organization managers`})}),e.useCustomElasticsearch&&(0,I.jsx)(O,{label:`Elasticsearch`,helper:`Configure your Elasticsearch instance for advanced search capabilities`,children:n(`organization:manage`)?(0,I.jsxs)(S,{width:`full`,align:`start`,gap:3,children:[(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`Elasticsearch Node URL`,...c(`elasticsearchNodeUrl`)}),(0,I.jsx)(y,{width:`full`,type:`password`,placeholder:`Elasticsearch API Key`,...c(`elasticsearchApiKey`)})]}):(0,I.jsx)(_,{children:`Elasticsearch configuration is only visible to organization managers`})})]}),!a&&(0,I.jsx)(b,{width:`full`,justify:`flex-end`,paddingTop:4,children:(0,I.jsx)(u,{type:`submit`,colorPalette:`blue`,loading:m.isLoading,children:`Save Changes`})})]})}),n(`project:update`)&&(0,I.jsx)(B,{project:t})]})})}function B({project:e}){let{organization:t,organizations:i}=T(),l=ee(),{isFree:w}=k(),A=c({items:[{label:`Strict`,value:P.PIIRedactionLevel.STRICT,description:`Redacts all PII data including names and addresses`},{label:`Essential`,value:P.PIIRedactionLevel.ESSENTIAL,description:`Redacts only essential PII data like email addresses, phone numbers, credit card numbers and IP addresses`},...t?.signedDPA||!l.data?.IS_SAAS||l.data?.NODE_ENV===`development`?[{label:`Disabled`,value:P.PIIRedactionLevel.DISABLED,description:`PII data will not be redacted`}]:[]]}),j=c({items:[{label:`Redacted to All`,value:P.ProjectSensitiveDataVisibilityLevel.REDACTED_TO_ALL,description:`Redacts captured input for all users`,isPaidOnly:!0},{label:`Visible to Admin`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ADMIN,description:`Redacts captured input for all users except admins`,isPaidOnly:!0},{label:`Visible to All`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ALL,description:`Does not redact any captured input`,isPaidOnly:!1}]}),L=c({items:[{label:`Redacted to All`,value:P.ProjectSensitiveDataVisibilityLevel.REDACTED_TO_ALL,description:`Redacts captured output for all users`,isPaidOnly:!0},{label:`Visible to Admin`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ADMIN,description:`Redacts captured output for all users except admins`,isPaidOnly:!0},{label:`Visible to All`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ALL,description:`Does not redact any captured output`,isPaidOnly:!1}]}),{hasPermission:R}=T({redirectToOnboarding:!1}),z=R(`project:manage`),B={name:e.name,language:e.language,framework:e.framework,userLinkTemplate:e.userLinkTemplate??``,s3Endpoint:e.s3Endpoint??``,s3AccessKeyId:e.s3AccessKeyId??``,s3SecretAccessKey:e.s3SecretAccessKey??``,s3Bucket:e.s3Bucket??``,piiRedactionLevel:e.piiRedactionLevel,capturedInputVisibility:e.capturedInputVisibility,capturedOutputVisibility:e.capturedOutputVisibility,traceSharingEnabled:e.traceSharingEnabled},[V,H]=(0,F.useState)(B),U=E({defaultValues:B}),{register:W,handleSubmit:G,control:K,formState:q}=U,J=C.project.update.useMutation(),Y=C.useContext(),[X,Z]=(0,F.useState)(!1),[te,Q]=(0,F.useState)(!1),ne=e=>{U.setValue(`traceSharingEnabled`,e)},re=()=>{Q(!1),G($)()},ie=()=>{Q(!1)},$=t=>{if(!r(t,V)){if(t.traceSharingEnabled===!1&&e.traceSharingEnabled===!0){Q(!0);return}H(t),J.mutate({projectId:e.id,...t,userLinkTemplate:t.userLinkTemplate??``,s3Endpoint:t.s3Endpoint??``,s3AccessKeyId:t.s3AccessKeyId??``,s3SecretAccessKey:t.s3SecretAccessKey??``,s3Bucket:t.s3Bucket??``,capturedInputVisibility:z?t.capturedInputVisibility:void 0,capturedOutputVisibility:z?t.capturedOutputVisibility:void 0,traceSharingEnabled:z?t.traceSharingEnabled:void 0},{onSuccess:()=>{Y.organization.getAll.refetch(),p.create({title:`Project updated`,description:`Your project settings have been saved`,type:`success`,meta:{closable:!0}})},onError:()=>{p.create({title:`Failed to update project`,description:`Please make sure you have filled out all fields related to S3`,type:`error`,meta:{closable:!0}})}})}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(b,{width:`full`,marginTop:6,children:[(0,I.jsx)(g,{as:`h2`,children:`Project-level Settings`}),(0,I.jsx)(x,{}),J.isLoading&&(0,I.jsx)(d,{}),i&&(0,I.jsx)(o,{organizations:i,project:e})]}),(0,I.jsxs)(`form`,{onSubmit:G($),style:{width:`100%`},children:[(0,I.jsxs)(S,{gap:0,width:`full`,children:[(0,I.jsxs)(O,{label:`Name`,helper:`The name of the project`,invalid:!!q.errors.name,children:[(0,I.jsx)(y,{width:`full`,type:`text`,...W(`name`,{required:!0,validate:e=>{if(!e.trim())return!1}})}),(0,I.jsx)(v,{children:`Name is required`})]}),(0,I.jsx)(O,{label:`Tech Stack`,helper:`The project language and framework`,invalid:!!q.errors.language||!!q.errors.framework,children:X?(0,I.jsx)(M,{form:U}):(0,I.jsxs)(b,{children:[(0,I.jsx)(N,{project:e}),(0,I.jsxs)(_,{children:[e.language,` / `,e.framework]}),(0,I.jsx)(u,{variant:`ghost`,textDecoration:`underline`,onClick:()=>Z(!0),children:`(change)`})]})}),(0,I.jsx)(O,{label:`PII Redaction Level`,helper:`The level of redaction for PII`,invalid:!!q.errors.piiRedactionLevel,children:(0,I.jsx)(D,{control:K,name:`piiRedactionLevel`,rules:{required:`PII Redaction Level is required`},render:({field:e})=>(0,I.jsxs)(s.Root,{collection:A,...e,onChange:void 0,value:[e.value],onValueChange:t=>{e.onChange(t.value[0])},children:[(0,I.jsx)(s.Trigger,{width:`full`,children:(0,I.jsx)(s.ValueText,{placeholder:`Select PII redaction level`})}),(0,I.jsx)(s.Content,{width:`300px`,paddingY:2,children:A.items.map(e=>(0,I.jsx)(s.Item,{item:e,children:(0,I.jsxs)(S,{align:`start`,gap:0,children:[(0,I.jsx)(_,{children:e.label}),(0,I.jsx)(_,{fontSize:`13px`,color:`fg.muted`,children:e.description})]})},e.value))})]})})}),(0,I.jsx)(O,{label:`Show Captured Input Data`,helper:(0,I.jsxs)(S,{align:`start`,gap:1,children:[(0,I.jsx)(_,{children:`Manage who can see input data on traces and spans`}),!z&&(0,I.jsx)(m,{colorPalette:`blue`,variant:`surface`,size:`xs`,children:(0,I.jsx)(f,{content:`Contact your admin to change this setting`,children:(0,I.jsxs)(b,{children:[(0,I.jsx)(n,{size:10}),(0,I.jsx)(_,{children:`Admin only`})]})})})]}),invalid:!!q.errors.capturedInputVisibility,children:(0,I.jsx)(D,{control:K,name:`capturedInputVisibility`,rules:{required:z?`Captured input visibility is required`:void 0},render:({field:e})=>(0,I.jsxs)(s.Root,{collection:j,...e,onChange:void 0,value:[e.value],onValueChange:t=>{j.items.find(e=>e.value===t.value[0])?.isPaidOnly&&w||e.onChange(t.value[0])},disabled:!z,children:[(0,I.jsx)(s.Trigger,{width:`full`,children:(0,I.jsx)(s.ValueText,{placeholder:`Select captured input visibility`})}),(0,I.jsx)(s.Content,{width:`300px`,paddingY:2,children:j.items.map(e=>{let t=e.isPaidOnly&&w;return(0,I.jsx)(s.Item,{item:e,opacity:t?.5:1,cursor:t?`not-allowed`:`pointer`,children:(0,I.jsxs)(S,{align:`start`,gap:0,children:[(0,I.jsxs)(b,{children:[(0,I.jsx)(_,{children:e.label}),e.isPaidOnly&&w&&(0,I.jsx)(m,{colorPalette:`orange`,size:`xs`,children:`Paid`})]}),(0,I.jsx)(_,{fontSize:`13px`,color:`fg.muted`,children:e.description})]})},e.value)})})]})})}),(0,I.jsx)(O,{label:`Show Captured Output Data`,helper:(0,I.jsxs)(S,{align:`start`,gap:1,children:[(0,I.jsx)(_,{children:`Manage who can see output data on traces and spans`}),!z&&(0,I.jsx)(m,{colorPalette:`blue`,variant:`surface`,size:`xs`,children:(0,I.jsx)(f,{content:`Contact your admin to change this setting`,children:(0,I.jsxs)(b,{children:[(0,I.jsx)(n,{size:10}),(0,I.jsx)(_,{children:`Admin only`})]})})})]}),invalid:!!q.errors.capturedOutputVisibility,children:(0,I.jsx)(D,{control:K,name:`capturedOutputVisibility`,rules:{required:z?`Captured output visibility is required`:void 0},render:({field:e})=>(0,I.jsxs)(s.Root,{collection:L,...e,onChange:void 0,value:[e.value],onValueChange:t=>{L.items.find(e=>e.value===t.value[0])?.isPaidOnly&&w||e.onChange(t.value[0])},disabled:!z,children:[(0,I.jsx)(s.Trigger,{width:`full`,children:(0,I.jsx)(s.ValueText,{placeholder:`Select captured output visibility`})}),(0,I.jsx)(s.Content,{width:`300px`,paddingY:2,children:L.items.map(e=>{let t=e.isPaidOnly&&w;return(0,I.jsx)(s.Item,{item:e,opacity:t?.5:1,cursor:t?`not-allowed`:`pointer`,children:(0,I.jsxs)(S,{align:`start`,gap:0,children:[(0,I.jsxs)(b,{children:[(0,I.jsx)(_,{children:e.label}),e.isPaidOnly&&w&&(0,I.jsx)(m,{colorPalette:`orange`,size:`xs`,children:`Paid`})]}),(0,I.jsx)(_,{fontSize:`13px`,color:`fg.muted`,children:e.description})]})},e.value)})})]})})}),(0,I.jsx)(O,{label:`Trace Sharing`,helper:(0,I.jsxs)(S,{align:`start`,gap:1,children:[(0,I.jsx)(_,{children:`Allow users to share traces with public links`}),!z&&(0,I.jsx)(m,{colorPalette:`blue`,variant:`surface`,size:`xs`,children:(0,I.jsx)(f,{content:`Contact your admin to change this setting`,children:(0,I.jsxs)(b,{children:[(0,I.jsx)(n,{size:10}),(0,I.jsx)(_,{children:`Admin only`})]})})})]}),invalid:!!q.errors.traceSharingEnabled,children:(0,I.jsx)(D,{control:K,name:`traceSharingEnabled`,render:({field:e})=>(0,I.jsx)(a,{checked:e.value,onChange:e=>ne(e.target.checked),disabled:!z})})}),t?.useCustomS3&&(0,I.jsx)(O,{label:`S3 Storage`,helper:`Configure project-specific S3 storage settings for datasets. If left empty, organization-level settings will be used.`,children:(0,I.jsxs)(S,{width:`full`,align:`start`,gap:3,children:[(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Endpoint`,...W(`s3Endpoint`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`Access Key ID`,...W(`s3AccessKeyId`)}),(0,I.jsx)(y,{width:`full`,type:`password`,placeholder:`Secret Access Key`,...W(`s3SecretAccessKey`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Bucket Name`,...W(`s3Bucket`)})]})})]}),(0,I.jsx)(b,{width:`full`,justify:`flex-end`,paddingTop:4,children:(0,I.jsx)(u,{type:`submit`,colorPalette:`blue`,loading:J.isLoading,children:`Save Changes`})})]}),(0,I.jsx)(h.Root,{open:te,onOpenChange:({open:e})=>Q(e),children:(0,I.jsxs)(h.Content,{children:[(0,I.jsx)(h.Header,{children:(0,I.jsx)(h.Title,{children:`Disable Trace Sharing?`})}),(0,I.jsx)(h.Body,{children:(0,I.jsxs)(S,{align:`start`,gap:4,children:[(0,I.jsx)(_,{children:`Are you sure you want to save these changes and disable trace sharing for this project?`}),(0,I.jsxs)(S,{align:`start`,gap:2,padding:4,backgroundColor:`orange.subtle`,borderWidth:`1px`,borderColor:`orange.muted`,borderRadius:`md`,children:[(0,I.jsx)(b,{gap:2,children:(0,I.jsx)(_,{fontWeight:`semibold`,color:`orange.fg`,children:`⚠️ Warning`})}),(0,I.jsxs)(_,{fontSize:`sm`,color:`orange.fg`,children:[`This action will `,(0,I.jsx)(`b`,{children:`immediately revoke`}),` all existing shared trace links. Anyone with previously shared trace URLs will`,` `,(0,I.jsx)(`b`,{children:`no longer be able to access them`}),`.`]})]})]})}),(0,I.jsx)(h.Footer,{children:(0,I.jsxs)(b,{gap:2,children:[(0,I.jsx)(u,{variant:`outline`,onClick:ie,children:`Cancel`}),(0,I.jsx)(u,{colorPalette:`red`,onClick:re,children:`Save & Disable Trace Sharing`})]})})]})})]})}export{R as default};
|
|
2
|
-
//# sourceMappingURL=settings-
|
|
1
|
+
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-C7JcuhbW.js";import{$o as n,Hi as r,Un as i,fa as a,hn as o,na as s,sc as c}from"./command-bar-DUK45yin.js";import{j as l,n as u,r as d}from"./stack-oJ9iWdbl.js";import{t as f}from"./tooltip-AEm0YeiF.js";import{n as p}from"./toaster-C_DYALhL.js";import{an as m,f as h}from"./dist-Cds4Mqhj.js";import{t as g}from"./heading-D90dlSnH.js";import{t as _}from"./text-CwTrMF8x.js";import{t as v}from"./field-CnUiixMS.js";import{t as y}from"./input-C7emsUCL.js";import{t as b}from"./h-stack-BKLDJ2vg.js";import{t as x}from"./spacer-2LJJGbo8.js";import{t as S}from"./v-stack-EOPQ57OZ.js";import{s as C}from"./auth-client-D3UhxhQi.js";import{t as ee}from"./usePublicEnv-1QvVAhAk.js";import{c as w,t as T}from"./useOrganizationTeamProject-DC0iozx2.js";import{s as E,t as D}from"./index.esm-X7lxUoP1.js";import{t as O}from"./HorizontalFormControl-BCD7-fcT.js";import{n as k,t as A}from"./SettingsLayout--1gdEuhv.js";import{t as j}from"./WithPermissionGuard-B4Jo8E5-.js";import{i as M,r as N}from"./project-zSxGdatx.js";var P=w(),F=e(t()),I=l();function L(){let{organization:e,project:t}=T();return!e||!t?null:(0,I.jsx)(z,{organization:e,project:t})}var R=j(`organization:view`,{layoutComponent:A})(L);function z({organization:e,project:t}){let{hasPermission:n}=T(),{isLiteMember:a}=i(),[o,s]=(0,F.useState)({name:e.name,s3Endpoint:e.s3Endpoint??``,s3AccessKeyId:e.s3AccessKeyId??``,s3SecretAccessKey:e.s3SecretAccessKey??``,elasticsearchNodeUrl:e.elasticsearchNodeUrl??``,elasticsearchApiKey:e.elasticsearchApiKey??``,s3Bucket:e.s3Bucket??``}),{register:c,handleSubmit:l,getFieldState:f}=E({defaultValues:o}),m=C.organization.update.useMutation(),h=C.useContext();return(0,I.jsx)(A,{children:(0,I.jsxs)(S,{gap:6,width:`full`,align:`start`,children:[(0,I.jsxs)(b,{width:`full`,children:[(0,I.jsx)(g,{as:`h2`,children:`Organization Settings`}),(0,I.jsx)(x,{}),m.isLoading&&(0,I.jsx)(d,{})]}),(0,I.jsx)(`form`,{onSubmit:l(t=>{r(t,o)||(s(t),m.mutate({organizationId:e.id,name:t.name,s3Endpoint:t.s3Endpoint,s3AccessKeyId:t.s3AccessKeyId,s3SecretAccessKey:t.s3SecretAccessKey,elasticsearchNodeUrl:t.elasticsearchNodeUrl,elasticsearchApiKey:t.elasticsearchApiKey,s3Bucket:t.s3Bucket},{onSuccess:()=>{h.organization.getAll.refetch(),p.create({title:`Organization updated`,description:`Your organization settings have been saved`,type:`success`,meta:{closable:!0}})},onError:()=>{p.create({title:`Failed to update organization`,description:`Please make sure you have filled out all fields related to either S3 or Elasticsearch`,type:`error`,meta:{closable:!0}})}}))}),style:{width:`100%`},children:(0,I.jsxs)(S,{gap:0,children:[(0,I.jsxs)(S,{gap:0,width:`full`,children:[(0,I.jsx)(O,{label:`Name`,helper:`The name of your organization`,invalid:!!f(`name`).error,children:n(`organization:manage`)?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{width:`full`,type:`text`,...c(`name`,{required:!0,validate:e=>{if(!e.trim())return!1}})}),(0,I.jsx)(v,{children:`Name is required`})]}):(0,I.jsx)(_,{children:e.name})}),(0,I.jsx)(O,{label:`Slug`,helper:`The unique ID of your organization`,children:n(`organization:manage`)?(0,I.jsx)(y,{width:`full`,disabled:!0,type:`text`,value:e.slug}):(0,I.jsx)(_,{children:e.slug})}),(0,I.jsx)(O,{label:`Project ID`,helper:`Use this ID when authenticating with Personal Access Tokens`,children:(0,I.jsx)(y,{width:`full`,disabled:!0,type:`text`,value:t.id})}),e.useCustomS3&&(0,I.jsx)(O,{label:`S3 Storage`,helper:`Configure S3 storage to host data on your own infrastructure. Leave empty to use LangWatch's managed storage.`,children:n(`organization:manage`)?(0,I.jsxs)(S,{width:`full`,align:`start`,gap:3,children:[(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Endpoint`,...c(`s3Endpoint`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`Access Key ID`,...c(`s3AccessKeyId`)}),(0,I.jsx)(y,{width:`full`,type:`password`,placeholder:`Secret Access Key`,...c(`s3SecretAccessKey`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Bucket Name`,...c(`s3Bucket`)})]}):(0,I.jsx)(_,{children:`S3 storage configuration is only visible to organization managers`})}),e.useCustomElasticsearch&&(0,I.jsx)(O,{label:`Elasticsearch`,helper:`Configure your Elasticsearch instance for advanced search capabilities`,children:n(`organization:manage`)?(0,I.jsxs)(S,{width:`full`,align:`start`,gap:3,children:[(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`Elasticsearch Node URL`,...c(`elasticsearchNodeUrl`)}),(0,I.jsx)(y,{width:`full`,type:`password`,placeholder:`Elasticsearch API Key`,...c(`elasticsearchApiKey`)})]}):(0,I.jsx)(_,{children:`Elasticsearch configuration is only visible to organization managers`})})]}),!a&&(0,I.jsx)(b,{width:`full`,justify:`flex-end`,paddingTop:4,children:(0,I.jsx)(u,{type:`submit`,colorPalette:`blue`,loading:m.isLoading,children:`Save Changes`})})]})}),n(`project:update`)&&(0,I.jsx)(B,{project:t})]})})}function B({project:e}){let{organization:t,organizations:i}=T(),l=ee(),{isFree:w}=k(),A=c({items:[{label:`Strict`,value:P.PIIRedactionLevel.STRICT,description:`Redacts all PII data including names and addresses`},{label:`Essential`,value:P.PIIRedactionLevel.ESSENTIAL,description:`Redacts only essential PII data like email addresses, phone numbers, credit card numbers and IP addresses`},...t?.signedDPA||!l.data?.IS_SAAS||l.data?.NODE_ENV===`development`?[{label:`Disabled`,value:P.PIIRedactionLevel.DISABLED,description:`PII data will not be redacted`}]:[]]}),j=c({items:[{label:`Redacted to All`,value:P.ProjectSensitiveDataVisibilityLevel.REDACTED_TO_ALL,description:`Redacts captured input for all users`,isPaidOnly:!0},{label:`Visible to Admin`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ADMIN,description:`Redacts captured input for all users except admins`,isPaidOnly:!0},{label:`Visible to All`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ALL,description:`Does not redact any captured input`,isPaidOnly:!1}]}),L=c({items:[{label:`Redacted to All`,value:P.ProjectSensitiveDataVisibilityLevel.REDACTED_TO_ALL,description:`Redacts captured output for all users`,isPaidOnly:!0},{label:`Visible to Admin`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ADMIN,description:`Redacts captured output for all users except admins`,isPaidOnly:!0},{label:`Visible to All`,value:P.ProjectSensitiveDataVisibilityLevel.VISIBLE_TO_ALL,description:`Does not redact any captured output`,isPaidOnly:!1}]}),{hasPermission:R}=T({redirectToOnboarding:!1}),z=R(`project:manage`),B={name:e.name,language:e.language,framework:e.framework,userLinkTemplate:e.userLinkTemplate??``,s3Endpoint:e.s3Endpoint??``,s3AccessKeyId:e.s3AccessKeyId??``,s3SecretAccessKey:e.s3SecretAccessKey??``,s3Bucket:e.s3Bucket??``,piiRedactionLevel:e.piiRedactionLevel,capturedInputVisibility:e.capturedInputVisibility,capturedOutputVisibility:e.capturedOutputVisibility,traceSharingEnabled:e.traceSharingEnabled},[V,H]=(0,F.useState)(B),U=E({defaultValues:B}),{register:W,handleSubmit:G,control:K,formState:q}=U,J=C.project.update.useMutation(),Y=C.useContext(),[X,Z]=(0,F.useState)(!1),[te,Q]=(0,F.useState)(!1),ne=e=>{U.setValue(`traceSharingEnabled`,e)},re=()=>{Q(!1),G($)()},ie=()=>{Q(!1)},$=t=>{if(!r(t,V)){if(t.traceSharingEnabled===!1&&e.traceSharingEnabled===!0){Q(!0);return}H(t),J.mutate({projectId:e.id,...t,userLinkTemplate:t.userLinkTemplate??``,s3Endpoint:t.s3Endpoint??``,s3AccessKeyId:t.s3AccessKeyId??``,s3SecretAccessKey:t.s3SecretAccessKey??``,s3Bucket:t.s3Bucket??``,capturedInputVisibility:z?t.capturedInputVisibility:void 0,capturedOutputVisibility:z?t.capturedOutputVisibility:void 0,traceSharingEnabled:z?t.traceSharingEnabled:void 0},{onSuccess:()=>{Y.organization.getAll.refetch(),p.create({title:`Project updated`,description:`Your project settings have been saved`,type:`success`,meta:{closable:!0}})},onError:()=>{p.create({title:`Failed to update project`,description:`Please make sure you have filled out all fields related to S3`,type:`error`,meta:{closable:!0}})}})}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(b,{width:`full`,marginTop:6,children:[(0,I.jsx)(g,{as:`h2`,children:`Project-level Settings`}),(0,I.jsx)(x,{}),J.isLoading&&(0,I.jsx)(d,{}),i&&(0,I.jsx)(o,{organizations:i,project:e})]}),(0,I.jsxs)(`form`,{onSubmit:G($),style:{width:`100%`},children:[(0,I.jsxs)(S,{gap:0,width:`full`,children:[(0,I.jsxs)(O,{label:`Name`,helper:`The name of the project`,invalid:!!q.errors.name,children:[(0,I.jsx)(y,{width:`full`,type:`text`,...W(`name`,{required:!0,validate:e=>{if(!e.trim())return!1}})}),(0,I.jsx)(v,{children:`Name is required`})]}),(0,I.jsx)(O,{label:`Tech Stack`,helper:`The project language and framework`,invalid:!!q.errors.language||!!q.errors.framework,children:X?(0,I.jsx)(M,{form:U}):(0,I.jsxs)(b,{children:[(0,I.jsx)(N,{project:e}),(0,I.jsxs)(_,{children:[e.language,` / `,e.framework]}),(0,I.jsx)(u,{variant:`ghost`,textDecoration:`underline`,onClick:()=>Z(!0),children:`(change)`})]})}),(0,I.jsx)(O,{label:`PII Redaction Level`,helper:`The level of redaction for PII`,invalid:!!q.errors.piiRedactionLevel,children:(0,I.jsx)(D,{control:K,name:`piiRedactionLevel`,rules:{required:`PII Redaction Level is required`},render:({field:e})=>(0,I.jsxs)(s.Root,{collection:A,...e,onChange:void 0,value:[e.value],onValueChange:t=>{e.onChange(t.value[0])},children:[(0,I.jsx)(s.Trigger,{width:`full`,children:(0,I.jsx)(s.ValueText,{placeholder:`Select PII redaction level`})}),(0,I.jsx)(s.Content,{width:`300px`,paddingY:2,children:A.items.map(e=>(0,I.jsx)(s.Item,{item:e,children:(0,I.jsxs)(S,{align:`start`,gap:0,children:[(0,I.jsx)(_,{children:e.label}),(0,I.jsx)(_,{fontSize:`13px`,color:`fg.muted`,children:e.description})]})},e.value))})]})})}),(0,I.jsx)(O,{label:`Show Captured Input Data`,helper:(0,I.jsxs)(S,{align:`start`,gap:1,children:[(0,I.jsx)(_,{children:`Manage who can see input data on traces and spans`}),!z&&(0,I.jsx)(m,{colorPalette:`blue`,variant:`surface`,size:`xs`,children:(0,I.jsx)(f,{content:`Contact your admin to change this setting`,children:(0,I.jsxs)(b,{children:[(0,I.jsx)(n,{size:10}),(0,I.jsx)(_,{children:`Admin only`})]})})})]}),invalid:!!q.errors.capturedInputVisibility,children:(0,I.jsx)(D,{control:K,name:`capturedInputVisibility`,rules:{required:z?`Captured input visibility is required`:void 0},render:({field:e})=>(0,I.jsxs)(s.Root,{collection:j,...e,onChange:void 0,value:[e.value],onValueChange:t=>{j.items.find(e=>e.value===t.value[0])?.isPaidOnly&&w||e.onChange(t.value[0])},disabled:!z,children:[(0,I.jsx)(s.Trigger,{width:`full`,children:(0,I.jsx)(s.ValueText,{placeholder:`Select captured input visibility`})}),(0,I.jsx)(s.Content,{width:`300px`,paddingY:2,children:j.items.map(e=>{let t=e.isPaidOnly&&w;return(0,I.jsx)(s.Item,{item:e,opacity:t?.5:1,cursor:t?`not-allowed`:`pointer`,children:(0,I.jsxs)(S,{align:`start`,gap:0,children:[(0,I.jsxs)(b,{children:[(0,I.jsx)(_,{children:e.label}),e.isPaidOnly&&w&&(0,I.jsx)(m,{colorPalette:`orange`,size:`xs`,children:`Paid`})]}),(0,I.jsx)(_,{fontSize:`13px`,color:`fg.muted`,children:e.description})]})},e.value)})})]})})}),(0,I.jsx)(O,{label:`Show Captured Output Data`,helper:(0,I.jsxs)(S,{align:`start`,gap:1,children:[(0,I.jsx)(_,{children:`Manage who can see output data on traces and spans`}),!z&&(0,I.jsx)(m,{colorPalette:`blue`,variant:`surface`,size:`xs`,children:(0,I.jsx)(f,{content:`Contact your admin to change this setting`,children:(0,I.jsxs)(b,{children:[(0,I.jsx)(n,{size:10}),(0,I.jsx)(_,{children:`Admin only`})]})})})]}),invalid:!!q.errors.capturedOutputVisibility,children:(0,I.jsx)(D,{control:K,name:`capturedOutputVisibility`,rules:{required:z?`Captured output visibility is required`:void 0},render:({field:e})=>(0,I.jsxs)(s.Root,{collection:L,...e,onChange:void 0,value:[e.value],onValueChange:t=>{L.items.find(e=>e.value===t.value[0])?.isPaidOnly&&w||e.onChange(t.value[0])},disabled:!z,children:[(0,I.jsx)(s.Trigger,{width:`full`,children:(0,I.jsx)(s.ValueText,{placeholder:`Select captured output visibility`})}),(0,I.jsx)(s.Content,{width:`300px`,paddingY:2,children:L.items.map(e=>{let t=e.isPaidOnly&&w;return(0,I.jsx)(s.Item,{item:e,opacity:t?.5:1,cursor:t?`not-allowed`:`pointer`,children:(0,I.jsxs)(S,{align:`start`,gap:0,children:[(0,I.jsxs)(b,{children:[(0,I.jsx)(_,{children:e.label}),e.isPaidOnly&&w&&(0,I.jsx)(m,{colorPalette:`orange`,size:`xs`,children:`Paid`})]}),(0,I.jsx)(_,{fontSize:`13px`,color:`fg.muted`,children:e.description})]})},e.value)})})]})})}),(0,I.jsx)(O,{label:`Trace Sharing`,helper:(0,I.jsxs)(S,{align:`start`,gap:1,children:[(0,I.jsx)(_,{children:`Allow users to share traces with public links`}),!z&&(0,I.jsx)(m,{colorPalette:`blue`,variant:`surface`,size:`xs`,children:(0,I.jsx)(f,{content:`Contact your admin to change this setting`,children:(0,I.jsxs)(b,{children:[(0,I.jsx)(n,{size:10}),(0,I.jsx)(_,{children:`Admin only`})]})})})]}),invalid:!!q.errors.traceSharingEnabled,children:(0,I.jsx)(D,{control:K,name:`traceSharingEnabled`,render:({field:e})=>(0,I.jsx)(a,{checked:e.value,onChange:e=>ne(e.target.checked),disabled:!z})})}),t?.useCustomS3&&(0,I.jsx)(O,{label:`S3 Storage`,helper:`Configure project-specific S3 storage settings for datasets. If left empty, organization-level settings will be used.`,children:(0,I.jsxs)(S,{width:`full`,align:`start`,gap:3,children:[(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Endpoint`,...W(`s3Endpoint`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`Access Key ID`,...W(`s3AccessKeyId`)}),(0,I.jsx)(y,{width:`full`,type:`password`,placeholder:`Secret Access Key`,...W(`s3SecretAccessKey`)}),(0,I.jsx)(y,{width:`full`,type:`text`,placeholder:`S3 Bucket Name`,...W(`s3Bucket`)})]})})]}),(0,I.jsx)(b,{width:`full`,justify:`flex-end`,paddingTop:4,children:(0,I.jsx)(u,{type:`submit`,colorPalette:`blue`,loading:J.isLoading,children:`Save Changes`})})]}),(0,I.jsx)(h.Root,{open:te,onOpenChange:({open:e})=>Q(e),children:(0,I.jsxs)(h.Content,{children:[(0,I.jsx)(h.Header,{children:(0,I.jsx)(h.Title,{children:`Disable Trace Sharing?`})}),(0,I.jsx)(h.Body,{children:(0,I.jsxs)(S,{align:`start`,gap:4,children:[(0,I.jsx)(_,{children:`Are you sure you want to save these changes and disable trace sharing for this project?`}),(0,I.jsxs)(S,{align:`start`,gap:2,padding:4,backgroundColor:`orange.subtle`,borderWidth:`1px`,borderColor:`orange.muted`,borderRadius:`md`,children:[(0,I.jsx)(b,{gap:2,children:(0,I.jsx)(_,{fontWeight:`semibold`,color:`orange.fg`,children:`⚠️ Warning`})}),(0,I.jsxs)(_,{fontSize:`sm`,color:`orange.fg`,children:[`This action will `,(0,I.jsx)(`b`,{children:`immediately revoke`}),` all existing shared trace links. Anyone with previously shared trace URLs will`,` `,(0,I.jsx)(`b`,{children:`no longer be able to access them`}),`.`]})]})]})}),(0,I.jsx)(h.Footer,{children:(0,I.jsxs)(b,{gap:2,children:[(0,I.jsx)(u,{variant:`outline`,onClick:ie,children:`Cancel`}),(0,I.jsx)(u,{colorPalette:`red`,onClick:re,children:`Save & Disable Trace Sharing`})]})})]})})]})}export{R as default};
|
|
2
|
+
//# sourceMappingURL=settings-CDzdoYVK.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{mn as e}from"./command-bar-
|
|
2
|
-
//# sourceMappingURL=setup-
|
|
1
|
+
import{mn as e}from"./command-bar-DUK45yin.js";import{j as t}from"./stack-oJ9iWdbl.js";import{t as n}from"./WithPermissionGuard-B4Jo8E5-.js";import{t as r}from"./WelcomeLayout-C-NpTCD2.js";var i=t();function a(){return(0,i.jsx)(e,{children:(0,i.jsx)(r,{})})}var o=n(`project:view`,{layoutComponent:e})(a);export{o as default};
|
|
2
|
+
//# sourceMappingURL=setup-nEvn2rjN.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SubscriptionPage-
|
|
2
|
-
import{t as e}from"./preload-helper-rov5CBGT.js";import{j as t}from"./stack-oJ9iWdbl.js";import{t as n}from"./heading-D90dlSnH.js";import{t as r}from"./text-CwTrMF8x.js";import{t as i}from"./h-stack-BKLDJ2vg.js";import{t as a}from"./link-CwZhwOLq.js";import{t as o}from"./v-stack-EOPQ57OZ.js";import{t as s}from"./usePublicEnv-1QvVAhAk.js";import{t as c}from"./next-dynamic-CldmZdeI.js";import{t as l}from"./SettingsLayout
|
|
3
|
-
//# sourceMappingURL=subscription-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SubscriptionPage-B0ox_4kM.js","assets/chunk-Bj-mKKzh.js","assets/command-bar-DUK45yin.js","assets/preload-helper-rov5CBGT.js","assets/terminal-CfM0q99k.js","assets/code-FF_ibTVI.js","assets/prop-types-DifpXm68.js","assets/react-C7JcuhbW.js","assets/stack-oJ9iWdbl.js","assets/createLucideIcon-BJKFyRLS.js","assets/toaster-C_DYALhL.js","assets/h-stack-BKLDJ2vg.js","assets/create-slot-recipe-context-B6DU0msX.js","assets/tooltip-AEm0YeiF.js","assets/dist-frWhjLir.js","assets/text-CwTrMF8x.js","assets/tabs-DwV1cIZB.js","assets/resize-observer-DYemxxJj.js","assets/radio-group.anatomy-1s_fCJ3y.js","assets/tracking-DbhAKeey.js","assets/field-CnUiixMS.js","assets/input-C7emsUCL.js","assets/icon-BwEPrfAc.js","assets/native-select-B51i56CE.js","assets/dist-Cds4Mqhj.js","assets/auth-client-D3UhxhQi.js","assets/box-BsM8YLGl.js","assets/lu-Bf6j_N19.js","assets/dialog.anatomy-hrluUh9u.js","assets/group-Bwj__Orb.js","assets/heading-D90dlSnH.js","assets/link-CwZhwOLq.js","assets/next-link-DuYeiiEe.js","assets/chunk-OE4NN4TA-VhKiHPk0.js","assets/v-stack-EOPQ57OZ.js","assets/useOrganizationTeamProject-DC0iozx2.js","assets/types-B5pOLKPA.js","assets/usePublicEnv-1QvVAhAk.js","assets/useRequiredSession-DE4JSglk.js","assets/next-router-C6sliiV7.js","assets/src-COIGcvxD.js","assets/value-BjB45jgo.js","assets/isObjectLike-Bu248tFs.js","assets/now-DJRfNbvM.js","assets/isSymbol-j0dCIlP_.js","assets/__vite-browser-external-BYi-AMuK.js","assets/OpenAI-D5IXT9Yw.js","assets/alert-SnQmACl1.js","assets/card-CMtKVPVl.js","assets/LoadingScreen--vgXk5-2.js","assets/container-Ccm3vB5X.js","assets/spacer-2LJJGbo8.js","assets/HorizontalFormControl-BCD7-fcT.js","assets/index.esm-X7lxUoP1.js","assets/html-void-elements-BETCRsX6.js","assets/linear-C6bd9xc7.js","assets/defaultLocale-W5QLRj7w.js","assets/init-DZrHjWil.js","assets/time-D9KKpbLy.js","assets/band-CYOoy1UR.js","assets/ordinal-CVb2xJha.js","assets/path-D1IpFPna.js","assets/array-D0DyKZdT.js","assets/step-e0O7qByF.js","assets/memoize-jcS02u9d.js","assets/line-CNmjiw8d.js","assets/math-BkUaofPe.js","assets/emoji-picker-react.esm-Bobloulg.js","assets/_baseEach-DkU-DtFA.js","assets/_getTag-CZgI7cQJ.js","assets/cloneDeep-BExNqdAC.js","assets/_baseClone-Bo1ONtKZ.js","assets/posthogErrorCapture-50j08Hs1.js","assets/next-navigation-CufL4Tjj.js","assets/next-dynamic-CldmZdeI.js","assets/next-head-CO-qV_vi.js","assets/command-bar-D2UBHeGQ.css","assets/billing-plans-BUQp08MI.js","assets/planTypes-Cig7WlCp.js","assets/constants-BT2q4NNM.js","assets/simple-grid-C3IW90zo.js","assets/arrow-right-B3ZN8yal.js","assets/download-X34ozaiD.js","assets/SettingsLayout--1gdEuhv.js","assets/MenuLink-b_JZtGfc.js","assets/ContactSalesBlock-CnnuZ8iI.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-rov5CBGT.js";import{j as t}from"./stack-oJ9iWdbl.js";import{t as n}from"./heading-D90dlSnH.js";import{t as r}from"./text-CwTrMF8x.js";import{t as i}from"./h-stack-BKLDJ2vg.js";import{t as a}from"./link-CwZhwOLq.js";import{t as o}from"./v-stack-EOPQ57OZ.js";import{t as s}from"./usePublicEnv-1QvVAhAk.js";import{t as c}from"./next-dynamic-CldmZdeI.js";import{t as l}from"./SettingsLayout--1gdEuhv.js";var u=t(),d=c(()=>e(()=>import(`./SubscriptionPage-B0ox_4kM.js`).then(e=>e.SubscriptionPage),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85])),{ssr:!1});function f(){return s().data?.IS_SAAS?(0,u.jsx)(d,{}):(0,u.jsx)(l,{children:(0,u.jsxs)(o,{gap:6,width:`full`,align:`start`,children:[(0,u.jsx)(i,{width:`full`,marginTop:2,children:(0,u.jsx)(n,{as:`h2`,children:`Change Subscription`})}),(0,u.jsx)(o,{width:`full`,gap:4,align:`start`,children:(0,u.jsxs)(r,{children:[`This is the self-hosted version of LangWatch and all the costs and maintenance are managed by yourself. If you want to use the cloud version, please visit`,` `,(0,u.jsx)(a,{href:`https://langwatch.ai`,isExternal:!0,children:`langwatch.ai`})]})})]})})}export{f as default};
|
|
3
|
+
//# sourceMappingURL=subscription-BPNl_6jF.js.map
|
package/langwatch/dist/client/assets/{subscriptions-Dyyau22a.js → subscriptions-D0G-OE5C.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-C7JcuhbW.js";import{Do as n,Ra as r,Ss as i,Xa as a,_s as o,bs as s,ga as c,qi as l,vs as u,xs as d,ys as f}from"./command-bar-
|
|
2
|
-
//# sourceMappingURL=subscriptions-
|
|
1
|
+
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-C7JcuhbW.js";import{Do as n,Ra as r,Ss as i,Xa as a,_s as o,bs as s,ga as c,qi as l,vs as u,xs as d,ys as f}from"./command-bar-DUK45yin.js";import{j as p,n as m}from"./stack-oJ9iWdbl.js";import{t as h}from"./box-BsM8YLGl.js";import{n as g}from"./toaster-C_DYALhL.js";import{an as _}from"./dist-Cds4Mqhj.js";import{n as v,r as y,t as b}from"./native-select-B51i56CE.js";import{t as x}from"./heading-D90dlSnH.js";import{t as S}from"./text-CwTrMF8x.js";import{a as C,r as w}from"./field-CnUiixMS.js";import{t as T}from"./input-C7emsUCL.js";import{t as E}from"./h-stack-BKLDJ2vg.js";import{t as D}from"./simple-grid-C3IW90zo.js";import{t as O}from"./spacer-2LJJGbo8.js";import{t as k}from"./v-stack-EOPQ57OZ.js";import{c as A}from"./useOrganizationTeamProject-DC0iozx2.js";import{a as j,c as M,n as N,o as P,r as F,s as I,t as L,u as R}from"./useAdminResource-SmnnHro6.js";var z=A(),B=e(t()),V=p(),H=25,U={ACTIVE:`green`,PENDING:`yellow`,FAILED:`red`,CANCELLED:`gray`},W=[{key:`maxMembers`,label:`Max members`,group:`Members`},{key:`maxMembersLite`,label:`Max lite members`,group:`Members`},{key:`maxTeams`,label:`Max teams`,group:`Members`},{key:`maxProjects`,label:`Max projects`,group:`Resources`},{key:`maxWorkflows`,label:`Max workflows`,group:`Resources`},{key:`maxPrompts`,label:`Max prompts`,group:`Resources`},{key:`maxAgents`,label:`Max agents`,group:`Resources`},{key:`maxScenarios`,label:`Max scenarios`,group:`Resources`},{key:`maxEvaluators`,label:`Max evaluators`,group:`Evaluation`},{key:`maxExperiments`,label:`Max experiments`,group:`Evaluation`},{key:`maxOnlineEvaluations`,label:`Max online evaluations`,group:`Evaluation`},{key:`maxMessagesPerMonth`,label:`Max traces per month`,group:`Observability`},{key:`maxRetentionDays`,label:`Max retention days`,group:`Observability`},{key:`maxDatasets`,label:`Max datasets`,group:`Observability`},{key:`maxDashboards`,label:`Max dashboards`,group:`Analytics`},{key:`maxCustomGraphs`,label:`Max custom graphs`,group:`Analytics`},{key:`maxAutomations`,label:`Max automations`,group:`Analytics`}];function G(){let[e,t]=(0,B.useState)(1),[n,p]=(0,B.useState)(``),[m]=c(n,300),[g,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(!1),x=N(`subscription`,{pagination:{page:e,perPage:H},sort:{field:`createdAt`,order:`DESC`},filter:m?{query:m}:{}});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j,{title:`Subscriptions`,searchValue:n,onSearchChange:e=>{p(e),t(1)},searchPlaceholder:`Search by ID, Stripe ID, org, plan, or status`,isLoading:x.isLoading,isFetching:x.isFetching,error:x.error,pagination:{page:e,perPage:H,total:x.data?.total??0,onPageChange:t},onCreate:()=>b(!0),createLabel:`New subscription`,children:(0,V.jsxs)(d,{variant:`line`,size:`md`,width:`full`,children:[(0,V.jsx)(s,{children:(0,V.jsxs)(i,{children:[(0,V.jsx)(f,{children:`Organization`}),(0,V.jsx)(f,{children:`Plan`}),(0,V.jsx)(f,{children:`Status`}),(0,V.jsx)(f,{children:`Stripe ID`}),(0,V.jsx)(f,{children:`Start`}),(0,V.jsx)(f,{children:`End`}),(0,V.jsx)(f,{width:`60px`,textAlign:`right`})]})}),(0,V.jsxs)(o,{children:[x.data?.data.length===0&&(0,V.jsx)(i,{children:(0,V.jsx)(u,{colSpan:7,children:(0,V.jsx)(S,{color:`fg.muted`,textAlign:`center`,paddingY:6,children:`No subscriptions match your search.`})})}),x.data?.data.map(e=>(0,V.jsxs)(i,{children:[(0,V.jsx)(u,{children:e.organization?.name??(0,V.jsx)(S,{fontSize:`xs`,color:`fg.muted`,children:e.organizationId})}),(0,V.jsx)(u,{children:(0,V.jsx)(_,{size:`sm`,variant:`subtle`,children:e.plan})}),(0,V.jsx)(u,{children:(0,V.jsx)(_,{size:`sm`,colorPalette:U[e.status],children:e.status})}),(0,V.jsx)(u,{children:e.stripeSubscriptionId??(0,V.jsx)(P,{})}),(0,V.jsx)(u,{children:M(e.startDate)}),(0,V.jsx)(u,{children:M(e.endDate)}),(0,V.jsx)(u,{textAlign:`right`,children:(0,V.jsx)(h,{width:`full`,height:`full`,display:`flex`,justifyContent:`end`,children:(0,V.jsxs)(l.Root,{children:[(0,V.jsx)(l.Trigger,{children:(0,V.jsx)(a,{size:16})}),(0,V.jsx)(l.Content,{children:(0,V.jsxs)(l.Item,{value:`edit`,onClick:()=>v(e),children:[(0,V.jsx)(r,{size:16}),`Edit`]})})]})})})]},e.id))]})]})}),(0,V.jsx)(Y,{mode:`edit`,subscription:g,onClose:()=>v(null)}),(0,V.jsx)(Y,{mode:`create`,subscription:y?null:void 0,onClose:()=>b(!1)})]})}var K={organizationId:``,plan:`FREE`,status:`PENDING`,stripeSubscriptionId:``,startDate:``,endDate:``,...W.reduce((e,t)=>(e[t.key]=``,e),{})};function q(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toISOString().slice(0,10)}function J(e){if(e===``)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Y({mode:e,subscription:t,onClose:r}){let i=F(`subscription`),a=L(`subscription`),o=e===`edit`?i:a,[s,c]=(0,B.useState)(K),l=e===`edit`?!!t:t!==void 0;(0,B.useEffect)(()=>{if(l)if(e===`edit`&&t){let e=W.reduce((e,n)=>{let r=t[n.key];return e[n.key]=typeof r==`number`?r.toString():``,e},{});c({organizationId:t.organizationId,plan:t.plan,status:t.status,stripeSubscriptionId:t.stripeSubscriptionId??``,startDate:q(t.startDate),endDate:q(t.endDate),...e})}else e===`create`&&c(K)},[l,e,t]);let u=(e,t)=>c(n=>({...n,[e]:t})),d=e===`edit`?`Edit Subscription`:`New Subscription`,f=()=>{if(!s.organizationId){g.create({title:`Organization is required`,type:`error`,duration:3e3,meta:{closable:!0}});return}let n={organizationId:s.organizationId,plan:s.plan,status:s.status,stripeSubscriptionId:s.stripeSubscriptionId||null,startDate:I(s.startDate),endDate:I(s.endDate)};for(let e of W)n[e.key]=J(s[e.key]);let o=()=>{g.create({title:e===`edit`?`Subscription updated`:`Subscription created`,type:`success`,duration:3e3,meta:{closable:!0}}),r()},c=t=>g.create({title:e===`edit`?`Update failed`:`Create failed`,description:t.message,type:`error`,duration:5e3,meta:{closable:!0}});e===`edit`&&t?i.mutate({id:t.id,data:n},{onSuccess:o,onError:c}):a.mutate(n,{onSuccess:o,onError:c})},p=(0,B.useMemo)(()=>{let e=new Map;for(let t of W){let n=e.get(t.group)??[];n.push(t),e.set(t.group,n)}return Array.from(e.entries())},[]);return(0,V.jsx)(n.Root,{open:l,onOpenChange:({open:e})=>{e||r()},size:`lg`,children:(0,V.jsxs)(n.Content,{children:[(0,V.jsx)(n.Header,{children:(0,V.jsx)(n.Title,{children:d})}),(0,V.jsx)(n.CloseTrigger,{}),(0,V.jsx)(n.Body,{children:(0,V.jsxs)(k,{gap:4,align:`stretch`,children:[(0,V.jsx)(X,{children:`Subscription`}),(0,V.jsx)(Q,{value:s.organizationId,onChange:e=>u(`organizationId`,e),currentName:t?.organization?.name}),(0,V.jsxs)(E,{gap:3,align:`start`,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(w,{children:`Plan`}),(0,V.jsx)(Z,{value:s.plan,options:Object.values(z.PlanTypes),onChange:e=>u(`plan`,e)})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(w,{children:`Status`}),(0,V.jsx)(Z,{value:s.status,options:Object.values(z.SubscriptionStatus),onChange:e=>u(`status`,e)})]})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(w,{children:`Stripe subscription ID`}),(0,V.jsx)(T,{value:s.stripeSubscriptionId,onChange:e=>u(`stripeSubscriptionId`,e.target.value)})]}),(0,V.jsxs)(E,{gap:3,children:[(0,V.jsxs)(C,{children:[(0,V.jsx)(w,{children:`Start date`}),(0,V.jsx)(T,{type:`date`,value:s.startDate,onChange:e=>u(`startDate`,e.target.value)})]}),(0,V.jsxs)(C,{children:[(0,V.jsx)(w,{children:`End date`}),(0,V.jsx)(T,{type:`date`,value:s.endDate,onChange:e=>u(`endDate`,e.target.value)})]})]}),p.map(([e,t])=>(0,V.jsxs)(k,{gap:3,align:`stretch`,children:[(0,V.jsxs)(X,{children:[e,` limits`]}),(0,V.jsx)(D,{columns:2,gap:3,children:t.map(e=>(0,V.jsxs)(C,{children:[(0,V.jsx)(w,{children:e.label}),(0,V.jsx)(T,{type:`number`,value:s[e.key],onChange:t=>u(e.key,t.target.value),placeholder:`—`})]},e.key))})]},e)),e===`edit`&&t&&(0,V.jsxs)(k,{align:`start`,gap:0,pt:2,children:[(0,V.jsxs)(S,{fontSize:`xs`,color:`fg.muted`,children:[`Subscription ID: `,t.id]}),t.lastPaymentFailedDate&&(0,V.jsxs)(S,{fontSize:`xs`,color:`red.500`,children:[`Last payment failed:`,` `,M(t.lastPaymentFailedDate)]})]})]})}),(0,V.jsx)(n.Footer,{children:(0,V.jsxs)(E,{width:`full`,children:[(0,V.jsx)(O,{}),(0,V.jsx)(m,{variant:`ghost`,onClick:r,children:`Cancel`}),(0,V.jsx)(m,{loading:o.isPending,onClick:f,children:e===`edit`?`Save`:`Create`})]})})]})})}function X({children:e}){return(0,V.jsx)(x,{as:`h3`,size:`xs`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wider`,pt:2,children:e})}function Z({value:e,options:t,onChange:n}){return(0,V.jsxs)(y,{size:`sm`,width:`full`,children:[(0,V.jsx)(b,{value:e,onChange:e=>n(e.target.value),children:t.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))}),(0,V.jsx)(v,{})]})}function Q({value:e,onChange:t,currentName:n}){let[r,i]=(0,B.useState)(``),[a]=c(r,250),o=N(`organization`,{pagination:{page:1,perPage:50},sort:{field:`name`,order:`ASC`},filter:a?{query:a}:{}}),s=(0,B.useMemo)(()=>o.data?.data??[],[o.data]);return(0,V.jsxs)(C,{required:!0,children:[(0,V.jsx)(w,{children:`Organization`}),e&&!r&&n&&(0,V.jsxs)(S,{fontSize:`xs`,color:`fg.muted`,children:[`Currently: `,n]}),(0,V.jsx)(T,{placeholder:`Type to search organizations`,value:r,onChange:e=>i(e.target.value)}),(0,V.jsxs)(y,{size:`sm`,width:`full`,mt:1,children:[(0,V.jsxs)(b,{value:e,onChange:e=>t(e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:`Select organization…`}),s.map(e=>(0,V.jsxs)(`option`,{value:e.id,children:[e.name,` (`,e.slug,`)`]},e.id))]}),(0,V.jsx)(v,{})]})]})}function $(){return(0,V.jsx)(R,{children:(0,V.jsx)(G,{})})}export{$ as default};
|
|
2
|
+
//# sourceMappingURL=subscriptions-D0G-OE5C.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-C7JcuhbW.js";import{Fa as n,Ma as r,Ra as i,Xr as a,ao as o,ho as s,io as c,na as l,r as u,sc as d,ya as f}from"./command-bar-CaJygoez.js";import{j as p,n as m,r as h}from"./stack-oJ9iWdbl.js";import{t as g}from"./box-BsM8YLGl.js";import{n as _}from"./toaster-C_DYALhL.js";import{an as v,f as y}from"./dist-SwV3YZv3.js";import{t as b}from"./heading-D90dlSnH.js";import{t as x}from"./text-CwTrMF8x.js";import{a as S,r as C}from"./field-CnUiixMS.js";import{t as w}from"./h-stack-BKLDJ2vg.js";import{r as T,t as E}from"./card-CMtKVPVl.js";import{t as D}from"./link-CwZhwOLq.js";import{t as O}from"./spacer-2LJJGbo8.js";import{t as k}from"./v-stack-EOPQ57OZ.js";import{s as A}from"./auth-client-D3UhxhQi.js";import{t as j}from"./useOrganizationTeamProject-DC0iozx2.js";import{t as M}from"./SettingsLayout-CLCGxMAe.js";import{t as N}from"./WithPermissionGuard-DD8uo3UK.js";var P=e(t()),F=p(),I=[{label:`Admin`,value:`ADMIN`},{label:`Member`,value:`MEMBER`},{label:`Viewer`,value:`VIEWER`}];function L(e){return e===`ADMIN`?`red`:e===`MEMBER`?`blue`:`gray`}function R({value:e,customRoleId:t,organizationId:n,onChange:r,size:i=`sm`}){let a=A.role.getAll.useQuery({organizationId:n}),o=[...I,...(a.data??[]).map(e=>({label:e.name,value:`CUSTOM:${e.id}`}))],s=d({items:o}),c=e===`CUSTOM`&&t?`CUSTOM:${t}`:e;return(0,F.jsxs)(l.Root,{collection:s,value:[c],onValueChange:t=>{let n=t.value[0]??e;n.startsWith(`CUSTOM:`)?r(`CUSTOM`,n.slice(7)):r(n,void 0)},disabled:a.isLoading,size:i,width:`140px`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{})}),(0,F.jsx)(l.Content,{paddingY:2,children:o.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})}function z({teamId:e,teamName:t,organizationId:n,existingMemberIds:r,open:i,onClose:a}){let[o,s]=(0,P.useState)(``),[c,u]=(0,P.useState)(`MEMBER`),[f,p]=(0,P.useState)(void 0),h=A.useContext(),g=A.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:n,includeDeactivated:!1},{enabled:i}),v=A.role.getAll.useQuery({organizationId:n},{enabled:i}),b=A.roleBinding.create.useMutation({onSuccess:()=>{_.create({title:`Member added`,type:`success`}),h.team.getTeamsWithRoleBindings.invalidate(),a()},onError:e=>{_.create({title:e.message,type:`error`})}}),w=(0,P.useMemo)(()=>(g.data?.members??[]).filter(e=>!r.includes(e.userId)).map(e=>({label:`${e.user.name??e.user.email} (${e.user.email})`,value:e.userId})),[g.data,r]),T=(0,P.useMemo)(()=>d({items:w}),[w]),E=(0,P.useMemo)(()=>[...I,...(v.data??[]).map(e=>({label:e.name,value:`CUSTOM:${e.id}`}))],[v.data]),D=(0,P.useMemo)(()=>d({items:E}),[E]);return(0,F.jsx)(y.Root,{open:i,onOpenChange:e=>!e.open&&a(),children:(0,F.jsxs)(y.Content,{maxWidth:`440px`,children:[(0,F.jsx)(y.Header,{children:(0,F.jsxs)(y.Title,{children:[`Add member to `,t]})}),(0,F.jsx)(y.CloseTrigger,{}),(0,F.jsx)(y.Body,{children:(0,F.jsxs)(k,{gap:4,align:`stretch`,children:[(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Person`}),(0,F.jsxs)(l.Root,{collection:T,value:o?[o]:[],onValueChange:e=>s(e.value[0]??``),size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{placeholder:`Select person...`})}),(0,F.jsx)(l.Content,{children:w.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Role on this team`}),(0,F.jsxs)(l.Root,{collection:D,value:[f?`CUSTOM:${f}`:c],onValueChange:e=>{let t=e.value[0]??`MEMBER`;t.startsWith(`CUSTOM:`)?(u(`CUSTOM`),p(t.slice(7))):(u(t),p(void 0))},size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{})}),(0,F.jsx)(l.Content,{children:E.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsx)(x,{fontSize:`sm`,color:`gray.500`,children:`This gives them access to all projects in the team at this role level.`})]})}),(0,F.jsxs)(y.Footer,{children:[(0,F.jsx)(m,{variant:`ghost`,onClick:a,children:`Cancel`}),(0,F.jsx)(m,{disabled:!o,loading:b.isPending,onClick:()=>b.mutate({organizationId:n,userId:o,role:f?`CUSTOM`:c,customRoleId:f,scopeType:`TEAM`,scopeId:e}),children:`Add member`})]})]})})}function B({projectId:e,projectName:t,organizationId:n,open:r,onClose:i}){let[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)(`VIEWER`),[u,f]=(0,P.useState)(void 0),p=A.useContext(),h=A.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:n,includeDeactivated:!1},{enabled:r}),g=A.role.getAll.useQuery({organizationId:n},{enabled:r}),v=A.roleBinding.create.useMutation({onSuccess:()=>{_.create({title:`Access added`,type:`success`}),p.team.getTeamsWithRoleBindings.invalidate(),i()},onError:e=>{_.create({title:e.message,type:`error`})}}),b=(h.data?.members??[]).map(e=>({label:`${e.user.name??e.user.email} (${e.user.email})`,value:e.userId})),w=d({items:b}),T=[...I,...(g.data??[]).map(e=>({label:e.name,value:`CUSTOM:${e.id}`}))],E=d({items:T});return(0,F.jsx)(y.Root,{open:r,onOpenChange:e=>!e.open&&i(),children:(0,F.jsxs)(y.Content,{maxWidth:`440px`,children:[(0,F.jsx)(y.Header,{children:(0,F.jsxs)(y.Title,{children:[`Add access to `,t]})}),(0,F.jsx)(y.CloseTrigger,{}),(0,F.jsx)(y.Body,{children:(0,F.jsxs)(k,{gap:4,align:`stretch`,children:[(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Person`}),(0,F.jsxs)(l.Root,{collection:w,value:a?[a]:[],onValueChange:e=>o(e.value[0]??``),size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{placeholder:`Select person...`})}),(0,F.jsx)(l.Content,{children:b.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Role on this project`}),(0,F.jsxs)(l.Root,{collection:E,value:[u?`CUSTOM:${u}`:s],onValueChange:e=>{let t=e.value[0]??`VIEWER`;t.startsWith(`CUSTOM:`)?(c(`CUSTOM`),f(t.slice(7))):(c(t),f(void 0))},size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{})}),(0,F.jsx)(l.Content,{children:T.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsx)(x,{fontSize:`sm`,color:`gray.500`,children:`If they're already on the team, this overrides their team role for this project only.`})]})}),(0,F.jsxs)(y.Footer,{children:[(0,F.jsx)(m,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,F.jsx)(m,{disabled:!a,loading:v.isPending,onClick:()=>v.mutate({organizationId:n,userId:a,role:u?`CUSTOM`:s,customRoleId:u,scopeType:`PROJECT`,scopeId:e}),children:`Add access`})]})]})})}function V({project:e,access:t,organizationId:i,canManage:a}){let[l,u]=(0,P.useState)(!1),[d,p]=(0,P.useState)(!1),h=A.useContext(),y=A.roleBinding.delete.useMutation({onSuccess:()=>{h.team.getTeamsWithRoleBindings.invalidate()},onError:e=>_.create({title:e.message,type:`error`})}),b=t.filter(e=>e.source===`team`),S=t.filter(e=>e.source!==`team`),C=S.length>0;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g,{borderWidth:`1px`,borderRadius:`md`,mb:2,overflow:`hidden`,children:[(0,F.jsxs)(w,{px:3,py:2,cursor:`pointer`,onClick:()=>u(e=>!e),_hover:{bg:`gray.50`,_dark:{bg:`gray.800`}},children:[l?(0,F.jsx)(o,{size:14}):(0,F.jsx)(c,{size:14}),(0,F.jsxs)(x,{fontSize:`sm`,fontWeight:`medium`,children:[`📁 `,e.name]}),C&&(0,F.jsx)(v,{colorPalette:`orange`,size:`sm`,children:`has overrides`}),(0,F.jsx)(O,{}),(0,F.jsxs)(x,{fontSize:`xs`,color:`gray.500`,children:[t.length,` with access`]})]}),l&&(0,F.jsxs)(g,{px:3,pb:3,borderTopWidth:`1px`,children:[b.length>0&&(0,F.jsxs)(g,{mt:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,mb:2,children:`Inherited from team`}),b.map((e,t)=>(0,F.jsxs)(w,{py:1,opacity:.5,fontSize:`sm`,children:[(0,F.jsx)(s,{name:e.name,size:`xs`}),(0,F.jsx)(x,{flex:1,children:e.name}),(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.customRoleName??e.role}),e.viaGroupName?(0,F.jsxs)(D,{href:`/settings/groups`,fontSize:`xs`,color:`purple.400`,children:[`via `,e.viaGroupName]}):(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,children:`from team`})]},t))]}),S.length>0&&(0,F.jsxs)(g,{mt:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,mb:2,children:`Project-level access`}),S.map((e,t)=>(0,F.jsxs)(w,{py:1,fontSize:`sm`,children:[(0,F.jsx)(s,{name:e.name,size:`xs`}),(0,F.jsxs)(g,{flex:1,children:[(0,F.jsx)(x,{display:`inline`,children:e.name}),e.source===`override`&&e.teamRole&&(0,F.jsxs)(x,{as:`span`,fontSize:`xs`,color:`gray.400`,ml:2,children:[`team role: `,e.teamRole]})]}),e.source===`override`&&(0,F.jsx)(v,{colorPalette:`orange`,size:`sm`,children:`override`}),(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.role}),a&&e.bindingId&&(0,F.jsx)(m,{size:`xs`,variant:`ghost`,color:e.source===`override`?`orange.400`:`gray.400`,title:e.source===`override`?`Remove override, revert to team role`:`Remove project access`,loading:y.isPending,onClick:()=>y.mutate({organizationId:i,bindingId:e.bindingId}),children:e.source===`override`?(0,F.jsxs)(w,{gap:1,children:[(0,F.jsx)(r,{size:12}),(0,F.jsx)(x,{children:`revert`})]}):(0,F.jsx)(f,{size:14})})]},t))]}),S.length===0&&b.length>0&&(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,fontStyle:`italic`,mt:2,children:`No project-level overrides. Everyone uses their team role.`}),a&&(0,F.jsx)(w,{mt:3,gap:2,flexWrap:`wrap`,children:(0,F.jsxs)(m,{size:`xs`,variant:`outline`,onClick:()=>p(!0),children:[(0,F.jsx)(n,{size:12}),`Add person to this project`]})})]})]}),d&&(0,F.jsx)(B,{projectId:e.id,projectName:e.name,organizationId:i,open:d,onClose:()=>p(!1)})]})}function H({team:e,organizationId:t,canManage:r}){let[a,l]=(0,P.useState)(!1),[d,p]=(0,P.useState)(!1),{openDrawer:h}=u(),{hasPermission:y}=j(),b=A.useContext(),S=A.roleBinding.delete.useMutation({onSuccess:()=>{b.team.getTeamsWithRoleBindings.invalidate()},onError:e=>_.create({title:e.message,type:`error`})}),C=A.roleBinding.update.useMutation({onSuccess:()=>{b.team.getTeamsWithRoleBindings.invalidate()},onError:e=>_.create({title:e.message,type:`error`})}),k=e.directMembers.flatMap(e=>e.userId?[e.userId]:[]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(T,{overflow:`hidden`,children:[(0,F.jsxs)(w,{px:4,py:3,cursor:`pointer`,onClick:()=>l(e=>!e),_hover:{bg:`gray.50`,_dark:{bg:`gray.800`}},children:[a?(0,F.jsx)(o,{size:16}):(0,F.jsx)(c,{size:16}),(0,F.jsx)(x,{fontWeight:`semibold`,children:e.name}),(0,F.jsx)(O,{}),(0,F.jsxs)(x,{fontSize:`sm`,color:`gray.500`,children:[e.projects.length,` `,e.projects.length===1?`project`:`projects`,` · `,e.directMembers.length,` `,e.directMembers.length===1?`member`:`members`,e.projectOnlyAccess.length>0&&` · ${e.projectOnlyAccess.length} via projects`]}),r&&(0,F.jsx)(D,{href:`/settings/teams/${e.slug}`,onClick:e=>e.stopPropagation(),children:(0,F.jsxs)(m,{size:`xs`,variant:`ghost`,color:`gray.400`,children:[(0,F.jsx)(i,{size:13}),`Edit`]})})]}),a&&(0,F.jsxs)(E,{pt:0,borderTopWidth:`1px`,children:[(0,F.jsxs)(g,{mt:4,children:[(0,F.jsxs)(w,{mb:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,children:`Team members`}),(0,F.jsx)(O,{}),r&&(0,F.jsxs)(m,{size:`xs`,variant:`outline`,onClick:e=>{e.stopPropagation(),p(!0)},children:[(0,F.jsx)(n,{size:12}),`Add to team`]})]}),e.directMembers.length===0?(0,F.jsx)(x,{fontSize:`sm`,color:`gray.400`,fontStyle:`italic`,children:`No members yet.`}):e.directMembers.map((e,n,i)=>(0,F.jsxs)(w,{py:2,borderBottomWidth:n<i.length-1?`1px`:`0`,borderColor:`gray.100`,_dark:{borderColor:`gray.700`},opacity:e.viaGroupId?.7:1,children:[(0,F.jsx)(s,{name:e.name,size:`xs`}),(0,F.jsx)(x,{fontSize:`sm`,flex:1,children:e.name}),e.viaGroupId?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.customRoleName??e.role}),(0,F.jsxs)(D,{href:`/settings/groups`,fontSize:`xs`,color:`purple.400`,children:[`via `,e.viaGroupName]})]}):r&&e.bindingId?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(R,{value:e.role,customRoleId:e.customRoleId,organizationId:t,onChange:(n,r)=>C.mutate({organizationId:t,bindingId:e.bindingId,role:n,customRoleId:r})}),(0,F.jsx)(m,{size:`xs`,variant:`ghost`,color:`gray.400`,loading:S.isPending,onClick:()=>S.mutate({organizationId:t,bindingId:e.bindingId}),children:(0,F.jsx)(f,{size:14})})]}):(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.customRoleName??e.role})]},n)),(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,mt:2,children:`Editing a role here changes their team-level access, inherited by all projects below.`})]}),e.projectOnlyAccess.length>0&&(0,F.jsxs)(g,{mt:5,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,mb:3,children:`Also has access via projects`}),e.projectOnlyAccess.map((t,n)=>(0,F.jsxs)(w,{py:2,fontSize:`sm`,borderBottomWidth:n<e.projectOnlyAccess.length-1?`1px`:`0`,borderColor:`gray.100`,_dark:{borderColor:`gray.700`},children:[(0,F.jsx)(s,{name:t.name,size:`xs`}),(0,F.jsx)(x,{flex:1,children:t.name}),(0,F.jsx)(v,{colorPalette:L(t.role),size:`sm`,children:t.role}),(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,children:`on`}),(0,F.jsxs)(v,{colorPalette:`green`,size:`sm`,children:[`📁 `,t.projectName]}),(0,F.jsx)(D,{fontSize:`xs`,color:`purple.400`,href:`#`,onClick:e=>{e.preventDefault(),l(!0)},children:`Edit in project →`})]},n))]}),(0,F.jsxs)(g,{mt:5,children:[(0,F.jsxs)(w,{mb:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,children:`Projects`}),(0,F.jsx)(O,{}),y(`project:create`)&&(0,F.jsxs)(m,{size:`xs`,variant:`outline`,onClick:e=>{e.stopPropagation(),h(`createProject`)},children:[(0,F.jsx)(n,{size:12}),`Add project`]})]}),e.projects.length===0?(0,F.jsx)(x,{fontSize:`sm`,color:`gray.400`,fontStyle:`italic`,children:`No projects yet.`}):e.projects.map(n=>(0,F.jsx)(V,{project:n,access:e.projectAccess[n.id]??[],organizationId:t,canManage:r},n.id))]})]})]}),d&&(0,F.jsx)(z,{teamId:e.id,teamName:e.name,organizationId:t,existingMemberIds:k,open:d,onClose:()=>p(!1)})]})}function U(){let{organization:e,hasPermission:t}=j(),{openDrawer:r}=u(),i=A.team.getTeamsWithRoleBindings.useQuery({organizationId:e?.id??``},{enabled:!!e}),o=t(`team:manage`);return e?(0,F.jsx)(M,{children:(0,F.jsxs)(k,{gap:6,width:`full`,align:`start`,children:[(0,F.jsxs)(w,{width:`full`,children:[(0,F.jsxs)(g,{children:[(0,F.jsx)(b,{size:`md`,children:`Teams & Projects`}),(0,F.jsx)(x,{fontSize:`sm`,color:`gray.500`,mt:1,children:`People on a team inherit access to all its projects. Expand a project to add overrides or direct access.`})]}),(0,F.jsx)(O,{}),t(`project:create`)&&(0,F.jsxs)(a.HeaderButton,{onClick:()=>r(`createProject`),children:[(0,F.jsx)(n,{size:16}),`Add project`]}),o&&(0,F.jsxs)(a.HeaderButton,{onClick:()=>r(`createTeam`),children:[(0,F.jsx)(n,{size:16}),`New team`]})]}),i.isLoading&&(0,F.jsx)(h,{}),i.data?.length===0&&(0,F.jsx)(x,{color:`gray.500`,children:`No teams yet.`}),(0,F.jsx)(k,{gap:3,width:`full`,align:`stretch`,children:i.data?.map(t=>(0,F.jsx)(H,{team:t,organizationId:e.id,canManage:o},t.id))})]})}):(0,F.jsx)(M,{})}var W=N(`team:view`,{layoutComponent:M})(U);export{W as default};
|
|
2
|
-
//# sourceMappingURL=teams-
|
|
1
|
+
import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-C7JcuhbW.js";import{Fa as n,Ma as r,Ra as i,Xr as a,ao as o,ho as s,io as c,na as l,r as u,sc as d,ya as f}from"./command-bar-DUK45yin.js";import{j as p,n as m,r as h}from"./stack-oJ9iWdbl.js";import{t as g}from"./box-BsM8YLGl.js";import{n as _}from"./toaster-C_DYALhL.js";import{an as v,f as y}from"./dist-Cds4Mqhj.js";import{t as b}from"./heading-D90dlSnH.js";import{t as x}from"./text-CwTrMF8x.js";import{a as S,r as C}from"./field-CnUiixMS.js";import{t as w}from"./h-stack-BKLDJ2vg.js";import{r as T,t as E}from"./card-CMtKVPVl.js";import{t as D}from"./link-CwZhwOLq.js";import{t as O}from"./spacer-2LJJGbo8.js";import{t as k}from"./v-stack-EOPQ57OZ.js";import{s as A}from"./auth-client-D3UhxhQi.js";import{t as j}from"./useOrganizationTeamProject-DC0iozx2.js";import{t as M}from"./SettingsLayout--1gdEuhv.js";import{t as N}from"./WithPermissionGuard-B4Jo8E5-.js";var P=e(t()),F=p(),I=[{label:`Admin`,value:`ADMIN`},{label:`Member`,value:`MEMBER`},{label:`Viewer`,value:`VIEWER`}];function L(e){return e===`ADMIN`?`red`:e===`MEMBER`?`blue`:`gray`}function R({value:e,customRoleId:t,organizationId:n,onChange:r,size:i=`sm`}){let a=A.role.getAll.useQuery({organizationId:n}),o=[...I,...(a.data??[]).map(e=>({label:e.name,value:`CUSTOM:${e.id}`}))],s=d({items:o}),c=e===`CUSTOM`&&t?`CUSTOM:${t}`:e;return(0,F.jsxs)(l.Root,{collection:s,value:[c],onValueChange:t=>{let n=t.value[0]??e;n.startsWith(`CUSTOM:`)?r(`CUSTOM`,n.slice(7)):r(n,void 0)},disabled:a.isLoading,size:i,width:`140px`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{})}),(0,F.jsx)(l.Content,{paddingY:2,children:o.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})}function z({teamId:e,teamName:t,organizationId:n,existingMemberIds:r,open:i,onClose:a}){let[o,s]=(0,P.useState)(``),[c,u]=(0,P.useState)(`MEMBER`),[f,p]=(0,P.useState)(void 0),h=A.useContext(),g=A.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:n,includeDeactivated:!1},{enabled:i}),v=A.role.getAll.useQuery({organizationId:n},{enabled:i}),b=A.roleBinding.create.useMutation({onSuccess:()=>{_.create({title:`Member added`,type:`success`}),h.team.getTeamsWithRoleBindings.invalidate(),a()},onError:e=>{_.create({title:e.message,type:`error`})}}),w=(0,P.useMemo)(()=>(g.data?.members??[]).filter(e=>!r.includes(e.userId)).map(e=>({label:`${e.user.name??e.user.email} (${e.user.email})`,value:e.userId})),[g.data,r]),T=(0,P.useMemo)(()=>d({items:w}),[w]),E=(0,P.useMemo)(()=>[...I,...(v.data??[]).map(e=>({label:e.name,value:`CUSTOM:${e.id}`}))],[v.data]),D=(0,P.useMemo)(()=>d({items:E}),[E]);return(0,F.jsx)(y.Root,{open:i,onOpenChange:e=>!e.open&&a(),children:(0,F.jsxs)(y.Content,{maxWidth:`440px`,children:[(0,F.jsx)(y.Header,{children:(0,F.jsxs)(y.Title,{children:[`Add member to `,t]})}),(0,F.jsx)(y.CloseTrigger,{}),(0,F.jsx)(y.Body,{children:(0,F.jsxs)(k,{gap:4,align:`stretch`,children:[(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Person`}),(0,F.jsxs)(l.Root,{collection:T,value:o?[o]:[],onValueChange:e=>s(e.value[0]??``),size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{placeholder:`Select person...`})}),(0,F.jsx)(l.Content,{children:w.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Role on this team`}),(0,F.jsxs)(l.Root,{collection:D,value:[f?`CUSTOM:${f}`:c],onValueChange:e=>{let t=e.value[0]??`MEMBER`;t.startsWith(`CUSTOM:`)?(u(`CUSTOM`),p(t.slice(7))):(u(t),p(void 0))},size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{})}),(0,F.jsx)(l.Content,{children:E.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsx)(x,{fontSize:`sm`,color:`gray.500`,children:`This gives them access to all projects in the team at this role level.`})]})}),(0,F.jsxs)(y.Footer,{children:[(0,F.jsx)(m,{variant:`ghost`,onClick:a,children:`Cancel`}),(0,F.jsx)(m,{disabled:!o,loading:b.isPending,onClick:()=>b.mutate({organizationId:n,userId:o,role:f?`CUSTOM`:c,customRoleId:f,scopeType:`TEAM`,scopeId:e}),children:`Add member`})]})]})})}function B({projectId:e,projectName:t,organizationId:n,open:r,onClose:i}){let[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)(`VIEWER`),[u,f]=(0,P.useState)(void 0),p=A.useContext(),h=A.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:n,includeDeactivated:!1},{enabled:r}),g=A.role.getAll.useQuery({organizationId:n},{enabled:r}),v=A.roleBinding.create.useMutation({onSuccess:()=>{_.create({title:`Access added`,type:`success`}),p.team.getTeamsWithRoleBindings.invalidate(),i()},onError:e=>{_.create({title:e.message,type:`error`})}}),b=(h.data?.members??[]).map(e=>({label:`${e.user.name??e.user.email} (${e.user.email})`,value:e.userId})),w=d({items:b}),T=[...I,...(g.data??[]).map(e=>({label:e.name,value:`CUSTOM:${e.id}`}))],E=d({items:T});return(0,F.jsx)(y.Root,{open:r,onOpenChange:e=>!e.open&&i(),children:(0,F.jsxs)(y.Content,{maxWidth:`440px`,children:[(0,F.jsx)(y.Header,{children:(0,F.jsxs)(y.Title,{children:[`Add access to `,t]})}),(0,F.jsx)(y.CloseTrigger,{}),(0,F.jsx)(y.Body,{children:(0,F.jsxs)(k,{gap:4,align:`stretch`,children:[(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Person`}),(0,F.jsxs)(l.Root,{collection:w,value:a?[a]:[],onValueChange:e=>o(e.value[0]??``),size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{placeholder:`Select person...`})}),(0,F.jsx)(l.Content,{children:b.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{children:`Role on this project`}),(0,F.jsxs)(l.Root,{collection:E,value:[u?`CUSTOM:${u}`:s],onValueChange:e=>{let t=e.value[0]??`VIEWER`;t.startsWith(`CUSTOM:`)?(c(`CUSTOM`),f(t.slice(7))):(c(t),f(void 0))},size:`md`,children:[(0,F.jsx)(l.Trigger,{children:(0,F.jsx)(l.ValueText,{})}),(0,F.jsx)(l.Content,{children:T.map(e=>(0,F.jsx)(l.Item,{item:e,children:e.label},e.value))})]})]}),(0,F.jsx)(x,{fontSize:`sm`,color:`gray.500`,children:`If they're already on the team, this overrides their team role for this project only.`})]})}),(0,F.jsxs)(y.Footer,{children:[(0,F.jsx)(m,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,F.jsx)(m,{disabled:!a,loading:v.isPending,onClick:()=>v.mutate({organizationId:n,userId:a,role:u?`CUSTOM`:s,customRoleId:u,scopeType:`PROJECT`,scopeId:e}),children:`Add access`})]})]})})}function V({project:e,access:t,organizationId:i,canManage:a}){let[l,u]=(0,P.useState)(!1),[d,p]=(0,P.useState)(!1),h=A.useContext(),y=A.roleBinding.delete.useMutation({onSuccess:()=>{h.team.getTeamsWithRoleBindings.invalidate()},onError:e=>_.create({title:e.message,type:`error`})}),b=t.filter(e=>e.source===`team`),S=t.filter(e=>e.source!==`team`),C=S.length>0;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g,{borderWidth:`1px`,borderRadius:`md`,mb:2,overflow:`hidden`,children:[(0,F.jsxs)(w,{px:3,py:2,cursor:`pointer`,onClick:()=>u(e=>!e),_hover:{bg:`gray.50`,_dark:{bg:`gray.800`}},children:[l?(0,F.jsx)(o,{size:14}):(0,F.jsx)(c,{size:14}),(0,F.jsxs)(x,{fontSize:`sm`,fontWeight:`medium`,children:[`📁 `,e.name]}),C&&(0,F.jsx)(v,{colorPalette:`orange`,size:`sm`,children:`has overrides`}),(0,F.jsx)(O,{}),(0,F.jsxs)(x,{fontSize:`xs`,color:`gray.500`,children:[t.length,` with access`]})]}),l&&(0,F.jsxs)(g,{px:3,pb:3,borderTopWidth:`1px`,children:[b.length>0&&(0,F.jsxs)(g,{mt:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,mb:2,children:`Inherited from team`}),b.map((e,t)=>(0,F.jsxs)(w,{py:1,opacity:.5,fontSize:`sm`,children:[(0,F.jsx)(s,{name:e.name,size:`xs`}),(0,F.jsx)(x,{flex:1,children:e.name}),(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.customRoleName??e.role}),e.viaGroupName?(0,F.jsxs)(D,{href:`/settings/groups`,fontSize:`xs`,color:`purple.400`,children:[`via `,e.viaGroupName]}):(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,children:`from team`})]},t))]}),S.length>0&&(0,F.jsxs)(g,{mt:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,mb:2,children:`Project-level access`}),S.map((e,t)=>(0,F.jsxs)(w,{py:1,fontSize:`sm`,children:[(0,F.jsx)(s,{name:e.name,size:`xs`}),(0,F.jsxs)(g,{flex:1,children:[(0,F.jsx)(x,{display:`inline`,children:e.name}),e.source===`override`&&e.teamRole&&(0,F.jsxs)(x,{as:`span`,fontSize:`xs`,color:`gray.400`,ml:2,children:[`team role: `,e.teamRole]})]}),e.source===`override`&&(0,F.jsx)(v,{colorPalette:`orange`,size:`sm`,children:`override`}),(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.role}),a&&e.bindingId&&(0,F.jsx)(m,{size:`xs`,variant:`ghost`,color:e.source===`override`?`orange.400`:`gray.400`,title:e.source===`override`?`Remove override, revert to team role`:`Remove project access`,loading:y.isPending,onClick:()=>y.mutate({organizationId:i,bindingId:e.bindingId}),children:e.source===`override`?(0,F.jsxs)(w,{gap:1,children:[(0,F.jsx)(r,{size:12}),(0,F.jsx)(x,{children:`revert`})]}):(0,F.jsx)(f,{size:14})})]},t))]}),S.length===0&&b.length>0&&(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,fontStyle:`italic`,mt:2,children:`No project-level overrides. Everyone uses their team role.`}),a&&(0,F.jsx)(w,{mt:3,gap:2,flexWrap:`wrap`,children:(0,F.jsxs)(m,{size:`xs`,variant:`outline`,onClick:()=>p(!0),children:[(0,F.jsx)(n,{size:12}),`Add person to this project`]})})]})]}),d&&(0,F.jsx)(B,{projectId:e.id,projectName:e.name,organizationId:i,open:d,onClose:()=>p(!1)})]})}function H({team:e,organizationId:t,canManage:r}){let[a,l]=(0,P.useState)(!1),[d,p]=(0,P.useState)(!1),{openDrawer:h}=u(),{hasPermission:y}=j(),b=A.useContext(),S=A.roleBinding.delete.useMutation({onSuccess:()=>{b.team.getTeamsWithRoleBindings.invalidate()},onError:e=>_.create({title:e.message,type:`error`})}),C=A.roleBinding.update.useMutation({onSuccess:()=>{b.team.getTeamsWithRoleBindings.invalidate()},onError:e=>_.create({title:e.message,type:`error`})}),k=e.directMembers.flatMap(e=>e.userId?[e.userId]:[]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(T,{overflow:`hidden`,children:[(0,F.jsxs)(w,{px:4,py:3,cursor:`pointer`,onClick:()=>l(e=>!e),_hover:{bg:`gray.50`,_dark:{bg:`gray.800`}},children:[a?(0,F.jsx)(o,{size:16}):(0,F.jsx)(c,{size:16}),(0,F.jsx)(x,{fontWeight:`semibold`,children:e.name}),(0,F.jsx)(O,{}),(0,F.jsxs)(x,{fontSize:`sm`,color:`gray.500`,children:[e.projects.length,` `,e.projects.length===1?`project`:`projects`,` · `,e.directMembers.length,` `,e.directMembers.length===1?`member`:`members`,e.projectOnlyAccess.length>0&&` · ${e.projectOnlyAccess.length} via projects`]}),r&&(0,F.jsx)(D,{href:`/settings/teams/${e.slug}`,onClick:e=>e.stopPropagation(),children:(0,F.jsxs)(m,{size:`xs`,variant:`ghost`,color:`gray.400`,children:[(0,F.jsx)(i,{size:13}),`Edit`]})})]}),a&&(0,F.jsxs)(E,{pt:0,borderTopWidth:`1px`,children:[(0,F.jsxs)(g,{mt:4,children:[(0,F.jsxs)(w,{mb:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,children:`Team members`}),(0,F.jsx)(O,{}),r&&(0,F.jsxs)(m,{size:`xs`,variant:`outline`,onClick:e=>{e.stopPropagation(),p(!0)},children:[(0,F.jsx)(n,{size:12}),`Add to team`]})]}),e.directMembers.length===0?(0,F.jsx)(x,{fontSize:`sm`,color:`gray.400`,fontStyle:`italic`,children:`No members yet.`}):e.directMembers.map((e,n,i)=>(0,F.jsxs)(w,{py:2,borderBottomWidth:n<i.length-1?`1px`:`0`,borderColor:`gray.100`,_dark:{borderColor:`gray.700`},opacity:e.viaGroupId?.7:1,children:[(0,F.jsx)(s,{name:e.name,size:`xs`}),(0,F.jsx)(x,{fontSize:`sm`,flex:1,children:e.name}),e.viaGroupId?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.customRoleName??e.role}),(0,F.jsxs)(D,{href:`/settings/groups`,fontSize:`xs`,color:`purple.400`,children:[`via `,e.viaGroupName]})]}):r&&e.bindingId?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(R,{value:e.role,customRoleId:e.customRoleId,organizationId:t,onChange:(n,r)=>C.mutate({organizationId:t,bindingId:e.bindingId,role:n,customRoleId:r})}),(0,F.jsx)(m,{size:`xs`,variant:`ghost`,color:`gray.400`,loading:S.isPending,onClick:()=>S.mutate({organizationId:t,bindingId:e.bindingId}),children:(0,F.jsx)(f,{size:14})})]}):(0,F.jsx)(v,{colorPalette:L(e.role),size:`sm`,children:e.customRoleName??e.role})]},n)),(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,mt:2,children:`Editing a role here changes their team-level access, inherited by all projects below.`})]}),e.projectOnlyAccess.length>0&&(0,F.jsxs)(g,{mt:5,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,mb:3,children:`Also has access via projects`}),e.projectOnlyAccess.map((t,n)=>(0,F.jsxs)(w,{py:2,fontSize:`sm`,borderBottomWidth:n<e.projectOnlyAccess.length-1?`1px`:`0`,borderColor:`gray.100`,_dark:{borderColor:`gray.700`},children:[(0,F.jsx)(s,{name:t.name,size:`xs`}),(0,F.jsx)(x,{flex:1,children:t.name}),(0,F.jsx)(v,{colorPalette:L(t.role),size:`sm`,children:t.role}),(0,F.jsx)(x,{fontSize:`xs`,color:`gray.400`,children:`on`}),(0,F.jsxs)(v,{colorPalette:`green`,size:`sm`,children:[`📁 `,t.projectName]}),(0,F.jsx)(D,{fontSize:`xs`,color:`purple.400`,href:`#`,onClick:e=>{e.preventDefault(),l(!0)},children:`Edit in project →`})]},n))]}),(0,F.jsxs)(g,{mt:5,children:[(0,F.jsxs)(w,{mb:3,children:[(0,F.jsx)(x,{fontSize:`xs`,fontWeight:`semibold`,color:`gray.500`,textTransform:`uppercase`,letterSpacing:`wider`,children:`Projects`}),(0,F.jsx)(O,{}),y(`project:create`)&&(0,F.jsxs)(m,{size:`xs`,variant:`outline`,onClick:e=>{e.stopPropagation(),h(`createProject`)},children:[(0,F.jsx)(n,{size:12}),`Add project`]})]}),e.projects.length===0?(0,F.jsx)(x,{fontSize:`sm`,color:`gray.400`,fontStyle:`italic`,children:`No projects yet.`}):e.projects.map(n=>(0,F.jsx)(V,{project:n,access:e.projectAccess[n.id]??[],organizationId:t,canManage:r},n.id))]})]})]}),d&&(0,F.jsx)(z,{teamId:e.id,teamName:e.name,organizationId:t,existingMemberIds:k,open:d,onClose:()=>p(!1)})]})}function U(){let{organization:e,hasPermission:t}=j(),{openDrawer:r}=u(),i=A.team.getTeamsWithRoleBindings.useQuery({organizationId:e?.id??``},{enabled:!!e}),o=t(`team:manage`);return e?(0,F.jsx)(M,{children:(0,F.jsxs)(k,{gap:6,width:`full`,align:`start`,children:[(0,F.jsxs)(w,{width:`full`,children:[(0,F.jsxs)(g,{children:[(0,F.jsx)(b,{size:`md`,children:`Teams & Projects`}),(0,F.jsx)(x,{fontSize:`sm`,color:`gray.500`,mt:1,children:`People on a team inherit access to all its projects. Expand a project to add overrides or direct access.`})]}),(0,F.jsx)(O,{}),t(`project:create`)&&(0,F.jsxs)(a.HeaderButton,{onClick:()=>r(`createProject`),children:[(0,F.jsx)(n,{size:16}),`Add project`]}),o&&(0,F.jsxs)(a.HeaderButton,{onClick:()=>r(`createTeam`),children:[(0,F.jsx)(n,{size:16}),`New team`]})]}),i.isLoading&&(0,F.jsx)(h,{}),i.data?.length===0&&(0,F.jsx)(x,{color:`gray.500`,children:`No teams yet.`}),(0,F.jsx)(k,{gap:3,width:`full`,align:`stretch`,children:i.data?.map(t=>(0,F.jsx)(H,{team:t,organizationId:e.id,canManage:o},t.id))})]})}):(0,F.jsx)(M,{})}var W=N(`team:view`,{layoutComponent:M})(U);export{W as default};
|
|
2
|
+
//# sourceMappingURL=teams-DThgDQvB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ba as e,Ga as t,Sa as n,Ta as r,Va as i,Wa as a,oo as o,so as s}from"./command-bar-
|
|
2
|
-
//# sourceMappingURL=textOverflowHeuristic-
|
|
1
|
+
import{Ba as e,Ga as t,Sa as n,Ta as r,Va as i,Wa as a,oo as o,so as s}from"./command-bar-DUK45yin.js";import{j as c}from"./stack-oJ9iWdbl.js";import{a as l,u}from"./terminal-CfM0q99k.js";import{t as d}from"./createLucideIcon-BJKFyRLS.js";var f=d(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),p=d(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),m=c(),h=({type:c,size:d=12})=>{let h={size:d,strokeWidth:2.5};switch(c){case`string`:return(0,m.jsx)(n,{...h,color:`var(--chakra-colors-blue-500)`});case`number`:return(0,m.jsx)(t,{...h,color:`var(--chakra-colors-green-500)`});case`boolean`:return(0,m.jsx)(r,{size:d+2,strokeWidth:2.5,color:`var(--chakra-colors-teal-500)`});case`json`:return(0,m.jsx)(s,{...h,color:`var(--chakra-colors-purple-500)`});case`chat_messages`:return(0,m.jsx)(l,{...h,color:`var(--chakra-colors-orange-500)`});case`image`:return(0,m.jsx)(a,{...h,color:`var(--chakra-colors-gray-400)`});case`date`:return(0,m.jsx)(o,{...h,color:`var(--chakra-colors-yellow-600)`});case`list`:return(0,m.jsx)(e,{...h,color:`var(--chakra-colors-purple-400)`});case`rag_contexts`:return(0,m.jsx)(u,{...h,color:`var(--chakra-colors-cyan-500)`});case`spans`:return(0,m.jsx)(i,{...h,color:`var(--chakra-colors-gray-500)`});case`annotations`:return(0,m.jsx)(p,{...h,color:`var(--chakra-colors-yellow-500)`});case`evaluations`:return(0,m.jsx)(f,{...h,color:`var(--chakra-colors-green-600)`});default:return(0,m.jsx)(n,{...h,color:`var(--chakra-colors-gray-400)`})}},g=e=>{if(e==null)return{status:`pending`};if(e===`running`||typeof e==`object`&&e.status===`running`)return{status:`running`};if(typeof e==`boolean`)return{status:e?`passed`:`failed`};if(typeof e==`object`){let t=e,n={status:`pending`};return`error`in t&&t.error?(n.status=`error`,n.details=typeof t.error==`string`?t.error:JSON.stringify(t.error),n):`status`in t&&t.status===`error`?(n.status=`error`,`details`in t&&typeof t.details==`string`&&(n.details=t.details),n):`status`in t&&t.status===`skipped`?(n.status=`skipped`,`details`in t&&typeof t.details==`string`&&(n.details=t.details),n):`status`in t&&t.status===`running`?{status:`running`}:(`score`in t&&typeof t.score==`number`&&(n.score=t.score),`label`in t&&typeof t.label==`string`&&(n.label=t.label),`details`in t&&typeof t.details==`string`&&(n.details=t.details),`passed`in t&&t.passed!==null&&t.passed!==void 0?n.status=t.passed?`passed`:`failed`:(n.score!==void 0||n.label!==void 0||n.details!==void 0)&&(n.status=`processed`),n)}return{status:`pending`}},_={pending:`gray.400`,running:`blue.400`,passed:`green.500`,failed:`red.500`,processed:`blue.500`,error:`red.500`,skipped:`yellow.500`},v=e=>{switch(e){case`running`:return`Running`;case`passed`:return`Passed`;case`failed`:return`Failed`;case`processed`:return`Processed`;case`error`:return`Error`;case`skipped`:return`Skipped`;default:return`Pending`}},y=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.keys(e);return t.length===1&&t[0]===`output`},b=e=>{if(e==null)return``;if(typeof e!=`object`)return String(e);if(Array.isArray(e))return JSON.stringify(e,null,2);if(y(e)){let t=e.output;return t==null?``:typeof t==`object`?JSON.stringify(t,null,2):String(t)}return JSON.stringify(e,null,2)},x=(e,t=500,n=62)=>{let r=(e.match(/\n/g)||[]).length;return e.length+r*n>t};export{g as a,v as i,b as n,h as o,_ as r,x as t};
|
|
2
|
+
//# sourceMappingURL=textOverflowHeuristic-DTC8-Ffx.js.map
|
package/langwatch/dist/client/assets/{topic-clustering-Bllfw5rZ.js → topic-clustering-BR2Mbpao.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,n as t}from"./stack-oJ9iWdbl.js";import{n}from"./toaster-C_DYALhL.js";import{t as r}from"./heading-D90dlSnH.js";import{t as i}from"./text-CwTrMF8x.js";import{i as a,n as o,r as s,t as c}from"./alert-SnQmACl1.js";import{n as l,r as u,t as d}from"./card-CMtKVPVl.js";import{t as f}from"./v-stack-EOPQ57OZ.js";import{m as p,s as m}from"./auth-client-D3UhxhQi.js";import{t as h}from"./useOrganizationTeamProject-DC0iozx2.js";import{t as g}from"./SettingsLayout
|
|
2
|
-
//# sourceMappingURL=topic-clustering-
|
|
1
|
+
import{j as e,n as t}from"./stack-oJ9iWdbl.js";import{n}from"./toaster-C_DYALhL.js";import{t as r}from"./heading-D90dlSnH.js";import{t as i}from"./text-CwTrMF8x.js";import{i as a,n as o,r as s,t as c}from"./alert-SnQmACl1.js";import{n as l,r as u,t as d}from"./card-CMtKVPVl.js";import{t as f}from"./v-stack-EOPQ57OZ.js";import{m as p,s as m}from"./auth-client-D3UhxhQi.js";import{t as h}from"./useOrganizationTeamProject-DC0iozx2.js";import{t as g}from"./SettingsLayout--1gdEuhv.js";import{t as _}from"./WithPermissionGuard-B4Jo8E5-.js";import{EmbeddingsModel as v,TopicClusteringModel as y}from"./model-providers-Pv3ML_-t.js";var b=e();function x(){let{project:e}=h({redirectToOnboarding:!1});return e?(0,b.jsx)(g,{children:(0,b.jsxs)(f,{gap:6,width:`full`,align:`start`,children:[(0,b.jsx)(r,{as:`h2`,children:`Topic Clustering`}),(0,b.jsx)(C,{project:e})]})}):null}var S=_(`project:manage`,{layoutComponent:g})(x);function C({project:e}){let h=m.project.triggerTopicClustering.useMutation({onSuccess:()=>{n.create({title:`Topic clustering started`,description:`The topic clustering job has been queued and will run shortly.`,type:`success`})},onError:e=>{p(e)||n.create({title:`Failed to trigger topic clustering`,description:e.message,type:`error`})}});return(0,b.jsxs)(f,{gap:6,width:`full`,align:`start`,paddingBottom:12,children:[(0,b.jsxs)(f,{gap:0,width:`full`,align:`stretch`,children:[(0,b.jsx)(y,{}),(0,b.jsx)(v,{})]}),(0,b.jsxs)(u,{width:`full`,children:[(0,b.jsx)(l,{children:(0,b.jsx)(r,{children:`Manual Topic Clustering`})}),(0,b.jsx)(d,{width:`full`,children:(0,b.jsxs)(f,{align:`start`,gap:4,children:[(0,b.jsx)(i,{children:`Manually trigger topic clustering to organize your traces into topics and subtopics. This will analyze your recent traces and group them by similar patterns.`}),(0,b.jsxs)(a,{children:[(0,b.jsx)(s,{}),(0,b.jsx)(c,{children:(0,b.jsx)(o,{children:`Topic clustering requires at least 10 traces to run effectively. The process may take several minutes depending on the number of traces.`})})]}),(0,b.jsx)(t,{colorPalette:`blue`,onClick:()=>h.mutate({projectId:e.id}),loading:h.isLoading,children:`Run Topic Clustering`})]})})]})]})}export{S as default};
|
|
2
|
+
//# sourceMappingURL=topic-clustering-BR2Mbpao.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Gn as e,dn as t,ps as n,un as r}from"./command-bar-
|
|
2
|
-
//# sourceMappingURL=topics-
|
|
1
|
+
import{Gn as e,dn as t,ps as n,un as r}from"./command-bar-DUK45yin.js";import{j as i}from"./stack-oJ9iWdbl.js";import{s as a}from"./tabs-DwV1cIZB.js";import{t as o}from"./heading-D90dlSnH.js";import{t as s}from"./h-stack-BKLDJ2vg.js";import{n as c,r as l,t as u}from"./card-CMtKVPVl.js";import{t as d}from"./simple-grid-C3IW90zo.js";import{t as f}from"./WithPermissionGuard-B4Jo8E5-.js";import{t as p}from"./GraphsLayout-DJ-HI9N1.js";var m=i(),h={graphId:`threadsPerTopic`,graphType:`stacked_bar`,series:[{name:`Threads count`,colorSet:`colors`,metric:`metadata.thread_id`,aggregation:`cardinality`}],groupBy:`topics.topics`,includePrevious:!1,timeScale:1440,height:300},g={graphId:`mostDiscussedTopics`,graphType:`horizontal_bar`,series:[{name:`Traces count`,colorSet:`colors`,metric:`metadata.trace_id`,aggregation:`cardinality`}],groupBy:`topics.topics`,includePrevious:!1,timeScale:`full`,height:300};function _(){return(0,m.jsx)(p,{title:`Topics`,children:(0,m.jsxs)(s,{alignItems:`start`,width:`full`,gap:6,children:[(0,m.jsxs)(d,{templateColumns:`repeat(4, 1fr)`,gap:5,width:`100%`,children:[(0,m.jsx)(a,{colSpan:1,display:`inline-grid`,children:(0,m.jsxs)(l,{height:`100%`,children:[(0,m.jsx)(c,{children:(0,m.jsx)(o,{size:`sm`,children:`Top Topics`})}),(0,m.jsx)(u,{maxHeight:`340px`,overflowY:`auto`,children:(0,m.jsx)(t,{showTitle:!1})})]})}),(0,m.jsx)(a,{colSpan:3,display:`inline-grid`,children:(0,m.jsxs)(l,{children:[(0,m.jsx)(c,{children:(0,m.jsxs)(s,{gap:2,children:[(0,m.jsx)(n,{color:`orange`}),(0,m.jsx)(o,{size:`sm`,children:`Threads Per Topic`})]})}),(0,m.jsx)(u,{children:(0,m.jsx)(e,{input:h})})]})}),(0,m.jsx)(a,{colSpan:2,display:`inline-grid`,children:(0,m.jsxs)(l,{children:[(0,m.jsx)(c,{children:(0,m.jsxs)(s,{gap:2,children:[(0,m.jsx)(n,{color:`orange`}),(0,m.jsx)(o,{size:`sm`,children:`Most Discussed Topics`})]})}),(0,m.jsx)(u,{children:(0,m.jsx)(e,{input:g})})]})})]}),(0,m.jsx)(r,{hideTopics:!0})]})})}var v=f(`analytics:view`)(_);export{v as default};
|
|
2
|
+
//# sourceMappingURL=topics-CI8GoNqp.js.map
|