@shipfox/client-workflows 15.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.css +4 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +41 -0
- package/dist/components/identifier/identifier.js +2 -2
- package/dist/components/identifier/identifier.js.map +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.d.ts.map +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.js +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.js.map +1 -1
- package/dist/components/job-detail/job-context-panel.d.ts +6 -0
- package/dist/components/job-detail/job-context-panel.d.ts.map +1 -0
- package/dist/components/job-detail/job-context-panel.js +224 -0
- package/dist/components/job-detail/job-context-panel.js.map +1 -0
- package/dist/components/job-detail/job-detail-header.d.ts +10 -1
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -1
- package/dist/components/job-detail/job-detail-header.js +58 -39
- package/dist/components/job-detail/job-detail-header.js.map +1 -1
- package/dist/components/job-detail/job-detail-view.d.ts +1 -1
- package/dist/components/job-detail/job-detail-view.d.ts.map +1 -1
- package/dist/components/job-detail/job-detail-view.js +92 -41
- package/dist/components/job-detail/job-detail-view.js.map +1 -1
- package/dist/components/job-detail/job-empty-states.d.ts.map +1 -1
- package/dist/components/job-detail/job-empty-states.js +19 -10
- package/dist/components/job-detail/job-empty-states.js.map +1 -1
- package/dist/components/job-detail/job-execution-switcher.js +4 -4
- package/dist/components/job-detail/job-execution-switcher.js.map +1 -1
- package/dist/components/job-detail/json-code.d.ts +14 -0
- package/dist/components/job-detail/json-code.d.ts.map +1 -0
- package/dist/components/job-detail/json-code.js +93 -0
- package/dist/components/job-detail/json-code.js.map +1 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts.map +1 -1
- package/dist/components/job-detail/step-attempt-log-panel.js +9 -6
- package/dist/components/job-detail/step-attempt-log-panel.js.map +1 -1
- package/dist/components/job-detail/step-troubleshooting.d.ts +18 -0
- package/dist/components/job-detail/step-troubleshooting.d.ts.map +1 -0
- package/dist/components/job-detail/step-troubleshooting.js +493 -0
- package/dist/components/job-detail/step-troubleshooting.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-content.js +5 -4
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/job-graph/job-node.js +3 -3
- package/dist/components/job-graph/job-node.js.map +1 -1
- package/dist/components/step-list/index.d.ts +1 -0
- package/dist/components/step-list/index.d.ts.map +1 -1
- package/dist/components/step-list/index.js.map +1 -1
- package/dist/components/step-list/step-list-model.d.ts.map +1 -1
- package/dist/components/step-list/step-list-model.js +5 -0
- package/dist/components/step-list/step-list-model.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +5 -1
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js +117 -82
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.js +1 -1
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/job-status-strip.js +6 -6
- package/dist/components/workflow-run-list/job-status-strip.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filters.js +4 -4
- package/dist/components/workflow-run-list/workflow-run-filters.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.js +6 -6
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +7 -7
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +0 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +9 -13
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +3 -0
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js +3 -0
- package/dist/components/workflow-run-tabs/index.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.d.ts +16 -0
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.js +50 -0
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.d.ts +20 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.js +102 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.d.ts +39 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.js +211 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js +90 -25
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js.map +1 -1
- package/dist/components/workflow-run-tabs/severity-visuals.d.ts +20 -0
- package/dist/components/workflow-run-tabs/severity-visuals.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/severity-visuals.js +31 -0
- package/dist/components/workflow-run-tabs/severity-visuals.js.map +1 -0
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts.map +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.js +16 -10
- package/dist/components/workflow-run-view/run-workspace-nav.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.js +6 -6
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +1 -3
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +217 -59
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +7 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts +9 -0
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/step-attempt.d.ts +29 -0
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.js.map +1 -1
- package/dist/core/entities/step.d.ts +3 -1
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/run-annotation.d.ts +79 -0
- package/dist/core/run-annotation.d.ts.map +1 -0
- package/dist/core/run-annotation.js +125 -0
- package/dist/core/run-annotation.js.map +1 -0
- package/dist/core/workflow-run.d.ts +1 -1
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/hooks/api/annotations.d.ts +63 -0
- package/dist/hooks/api/annotations.d.ts.map +1 -0
- package/dist/hooks/api/annotations.js +145 -0
- package/dist/hooks/api/annotations.js.map +1 -0
- package/dist/hooks/api/run-annotation-mapper.d.ts +10 -0
- package/dist/hooks/api/run-annotation-mapper.d.ts.map +1 -0
- package/dist/hooks/api/run-annotation-mapper.js +22 -0
- package/dist/hooks/api/run-annotation-mapper.js.map +1 -0
- package/dist/hooks/api/run-annotations.d.ts +25 -0
- package/dist/hooks/api/run-annotations.d.ts.map +1 -0
- package/dist/hooks/api/run-annotations.js +78 -0
- package/dist/hooks/api/run-annotations.js.map +1 -0
- package/dist/hooks/api/step-attempt-detail.d.ts +14 -0
- package/dist/hooks/api/step-attempt-detail.d.ts.map +1 -0
- package/dist/hooks/api/step-attempt-detail.js +43 -0
- package/dist/hooks/api/step-attempt-detail.js.map +1 -0
- package/dist/hooks/api/workflow-run-mapper.d.ts +9 -2
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.js +47 -0
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -1
- package/dist/pages/project-workflows-page.js +19 -19
- package/dist/pages/project-workflows-page.js.map +1 -1
- package/dist/pages/workflow-run-list-page.js +1 -1
- package/dist/pages/workflow-run-list-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +7 -2
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +5 -6
- package/dist/routes/inputs.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/src/components/identifier/identifier.tsx +2 -2
- package/src/components/job-detail/agent-config-failure-callout.tsx +5 -1
- package/src/components/job-detail/job-context-panel.test.tsx +72 -0
- package/src/components/job-detail/job-context-panel.tsx +237 -0
- package/src/components/job-detail/job-detail-header.test.tsx +3 -0
- package/src/components/job-detail/job-detail-header.tsx +65 -34
- package/src/components/job-detail/job-detail-view.stories.tsx +555 -48
- package/src/components/job-detail/job-detail-view.tsx +101 -42
- package/src/components/job-detail/job-empty-states.tsx +23 -10
- package/src/components/job-detail/job-execution-switcher.tsx +5 -5
- package/src/components/job-detail/json-code.tsx +120 -0
- package/src/components/job-detail/step-attempt-log-panel.test.tsx +1 -0
- package/src/components/job-detail/step-attempt-log-panel.tsx +17 -6
- package/src/components/job-detail/step-troubleshooting.stories.tsx +120 -0
- package/src/components/job-detail/step-troubleshooting.test.tsx +337 -0
- package/src/components/job-detail/step-troubleshooting.tsx +537 -0
- package/src/components/job-graph/job-graph-content.tsx +4 -3
- package/src/components/job-graph/job-node.tsx +3 -3
- package/src/components/step-list/index.ts +1 -0
- package/src/components/step-list/step-list-model.ts +5 -0
- package/src/components/step-list/step-list.test.tsx +75 -2
- package/src/components/step-list/step-list.tsx +73 -20
- package/src/components/workflow-run-duration-label.tsx +1 -1
- package/src/components/workflow-run-list/job-status-strip.tsx +6 -6
- package/src/components/workflow-run-list/workflow-run-filter-menu.tsx +1 -1
- package/src/components/workflow-run-list/workflow-run-filters.tsx +4 -4
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +6 -6
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +1 -1
- package/src/components/workflow-run-list/workflow-run-row.tsx +7 -7
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +12 -12
- package/src/components/workflow-run-tabs/index.ts +7 -0
- package/src/components/workflow-run-tabs/run-annotation-count-chip.tsx +63 -0
- package/src/components/workflow-run-tabs/run-annotation-item.tsx +123 -0
- package/src/components/workflow-run-tabs/run-annotation-list.tsx +273 -0
- package/src/components/workflow-run-tabs/run-annotation-summary-line.test.tsx +77 -3
- package/src/components/workflow-run-tabs/run-annotation-summary-line.tsx +95 -20
- package/src/components/workflow-run-tabs/run-annotations.stories.tsx +293 -0
- package/src/components/workflow-run-tabs/severity-visuals.ts +37 -0
- package/src/components/workflow-run-view/run-workspace-nav.test.tsx +44 -0
- package/src/components/workflow-run-view/run-workspace-nav.tsx +22 -9
- package/src/components/workflow-run-view/workflow-run-states.tsx +6 -6
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +246 -20
- package/src/components/workflow-run-view/workflow-run-view.tsx +255 -37
- package/src/core/entities/job-execution.ts +7 -0
- package/src/core/entities/job.ts +9 -0
- package/src/core/entities/step-attempt.ts +33 -0
- package/src/core/entities/step.ts +3 -1
- package/src/core/run-annotation.test.ts +315 -0
- package/src/core/run-annotation.ts +244 -0
- package/src/core/workflow-run.ts +4 -0
- package/src/hooks/api/annotations.test.ts +84 -0
- package/src/hooks/api/annotations.ts +240 -0
- package/src/hooks/api/run-annotation-mapper.ts +30 -0
- package/src/hooks/api/run-annotations.ts +137 -0
- package/src/hooks/api/step-attempt-detail.ts +67 -0
- package/src/hooks/api/workflow-run-mapper.ts +46 -0
- package/src/hooks/api/workflow-runs.test.tsx +61 -1
- package/src/pages/project-workflows-page.tsx +19 -19
- package/src/pages/workflow-job-detail-page.test.tsx +118 -1
- package/src/pages/workflow-run-list-page.tsx +1 -1
- package/src/routes/inputs.ts +7 -2
- package/test/fixtures/workflow-run.ts +7 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/core/workflow-run-tabs.d.ts +0 -9
- package/dist/core/workflow-run-tabs.d.ts.map +0 -1
- package/dist/core/workflow-run-tabs.js +0 -3
- package/dist/core/workflow-run-tabs.js.map +0 -1
- package/src/core/workflow-run-tabs.ts +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/workflow-run-list-page.tsx"],"sourcesContent":["import {useNavigate} from '@tanstack/react-router';\nimport {useCallback} from 'react';\nimport {WorkflowRunList} from '#components/workflow-run-list/workflow-run-list.js';\nimport {\n applyWorkflowRunFilterPatch,\n clearWorkflowRunFilters,\n type WorkflowRunFilterPatch,\n type WorkflowRunsSearch,\n workflowRunSearchParams,\n} from '#routes/inputs.js';\n\ninterface WorkflowRunsPageProps {\n projectId: string;\n workspaceSlug: string;\n projectSlug: string;\n search?: WorkflowRunsSearch;\n}\n\nconst EMPTY_SEARCH: WorkflowRunsSearch = {};\n\nexport function WorkflowRunsPage({\n projectId,\n workspaceSlug,\n projectSlug,\n search = EMPTY_SEARCH,\n}: WorkflowRunsPageProps) {\n const navigate = useNavigate();\n\n // Filter changes replace history instead of pushing it, so Back leaves the list rather than\n // walking every keystroke of a search box.\n const commitSearch = useCallback(\n (next: WorkflowRunsSearch) => {\n navigate({\n search: workflowRunSearchParams(next, {}) as never,\n replace: true,\n });\n },\n [navigate],\n );\n\n const onFiltersChange = useCallback(\n (patch: WorkflowRunFilterPatch) => commitSearch(applyWorkflowRunFilterPatch(search, patch)),\n [commitSearch, search],\n );\n\n const onClearFilters = useCallback(\n () => commitSearch(clearWorkflowRunFilters(search)),\n [commitSearch, search],\n );\n\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden bg-background-neutral-base\">\n <div className=\"mx-auto flex min-h-0 w-full max-w-[1120px] flex-1 flex-col px-
|
|
1
|
+
{"version":3,"sources":["../../src/pages/workflow-run-list-page.tsx"],"sourcesContent":["import {useNavigate} from '@tanstack/react-router';\nimport {useCallback} from 'react';\nimport {WorkflowRunList} from '#components/workflow-run-list/workflow-run-list.js';\nimport {\n applyWorkflowRunFilterPatch,\n clearWorkflowRunFilters,\n type WorkflowRunFilterPatch,\n type WorkflowRunsSearch,\n workflowRunSearchParams,\n} from '#routes/inputs.js';\n\ninterface WorkflowRunsPageProps {\n projectId: string;\n workspaceSlug: string;\n projectSlug: string;\n search?: WorkflowRunsSearch;\n}\n\nconst EMPTY_SEARCH: WorkflowRunsSearch = {};\n\nexport function WorkflowRunsPage({\n projectId,\n workspaceSlug,\n projectSlug,\n search = EMPTY_SEARCH,\n}: WorkflowRunsPageProps) {\n const navigate = useNavigate();\n\n // Filter changes replace history instead of pushing it, so Back leaves the list rather than\n // walking every keystroke of a search box.\n const commitSearch = useCallback(\n (next: WorkflowRunsSearch) => {\n navigate({\n search: workflowRunSearchParams(next, {}) as never,\n replace: true,\n });\n },\n [navigate],\n );\n\n const onFiltersChange = useCallback(\n (patch: WorkflowRunFilterPatch) => commitSearch(applyWorkflowRunFilterPatch(search, patch)),\n [commitSearch, search],\n );\n\n const onClearFilters = useCallback(\n () => commitSearch(clearWorkflowRunFilters(search)),\n [commitSearch, search],\n );\n\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden bg-background-neutral-base\">\n <div className=\"mx-auto flex min-h-0 w-full max-w-[1120px] flex-1 flex-col px-frame py-frame\">\n <WorkflowRunList\n projectId={projectId}\n workspaceSlug={workspaceSlug}\n projectSlug={projectSlug}\n search={search}\n onFiltersChange={onFiltersChange}\n onClearFilters={onClearFilters}\n />\n </div>\n </div>\n );\n}\n"],"names":["useNavigate","useCallback","WorkflowRunList","applyWorkflowRunFilterPatch","clearWorkflowRunFilters","workflowRunSearchParams","EMPTY_SEARCH","WorkflowRunsPage","projectId","workspaceSlug","projectSlug","search","navigate","commitSearch","next","replace","onFiltersChange","patch","onClearFilters","div","className"],"mappings":";AAAA,SAAQA,WAAW,QAAO,yBAAyB;AACnD,SAAQC,WAAW,QAAO,QAAQ;AAClC,SAAQC,eAAe,QAAO,qDAAqD;AACnF,SACEC,2BAA2B,EAC3BC,uBAAuB,EAGvBC,uBAAuB,QAClB,oBAAoB;AAS3B,MAAMC,eAAmC,CAAC;AAE1C,OAAO,SAASC,iBAAiB,EAC/BC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,SAASL,YAAY,EACC;IACtB,MAAMM,WAAWZ;IAEjB,4FAA4F;IAC5F,2CAA2C;IAC3C,MAAMa,eAAeZ,YACnB,CAACa;QACCF,SAAS;YACPD,QAAQN,wBAAwBS,MAAM,CAAC;YACvCC,SAAS;QACX;IACF,GACA;QAACH;KAAS;IAGZ,MAAMI,kBAAkBf,YACtB,CAACgB,QAAkCJ,aAAaV,4BAA4BQ,QAAQM,SACpF;QAACJ;QAAcF;KAAO;IAGxB,MAAMO,iBAAiBjB,YACrB,IAAMY,aAAaT,wBAAwBO,UAC3C;QAACE;QAAcF;KAAO;IAGxB,qBACE,KAACQ;QAAIC,WAAU;kBACb,cAAA,KAACD;YAAIC,WAAU;sBACb,cAAA,KAAClB;gBACCM,WAAWA;gBACXC,eAAeA;gBACfC,aAAaA;gBACbC,QAAQA;gBACRK,iBAAiBA;gBACjBE,gBAAgBA;;;;AAK1B"}
|
package/dist/routes/inputs.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RunAnnotationSeverity } from '#core/run-annotation.js';
|
|
1
2
|
import type { WorkflowRunSelectionInput } from '#core/workflow-run-url-state.js';
|
|
2
3
|
/**
|
|
3
4
|
* Statuses the run list can filter by. Absent means all; there is deliberately no `all`
|
|
@@ -7,8 +8,12 @@ export declare const WORKFLOW_RUN_LIST_STATUSES: readonly ['succeeded', 'failed'
|
|
|
7
8
|
export type WorkflowRunListStatus = (typeof WORKFLOW_RUN_LIST_STATUSES)[number];
|
|
8
9
|
export declare const WORKFLOW_RUN_TABS: readonly ['summary', 'jobs', 'annotations', 'source'];
|
|
9
10
|
export type WorkflowRunTab = (typeof WORKFLOW_RUN_TABS)[number];
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The `severity` parameter's vocabulary is the display severity set, not a second list: a URL
|
|
13
|
+
* that could name a severity the list cannot rank would be a filter with no matching rows.
|
|
14
|
+
*/
|
|
15
|
+
export declare const WORKFLOW_RUN_ANNOTATION_SEVERITIES: readonly ["error", "warning", "info", "success"];
|
|
16
|
+
export type WorkflowRunAnnotationSeverity = RunAnnotationSeverity;
|
|
12
17
|
export interface WorkflowRunsSearch extends WorkflowRunSelectionInput {
|
|
13
18
|
search?: string;
|
|
14
19
|
status?: WorkflowRunListStatus[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/routes/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,0BAA0B,YAAI,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAEnG,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,M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,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,sBAAsB,GAC5B,kBAAkB,CAUpB;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAUtF;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAUzE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAOA;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CASA"}
|
package/dist/routes/inputs.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RUN_ANNOTATION_SEVERITIES } from '#core/run-annotation.js';
|
|
1
2
|
/**
|
|
2
3
|
* Statuses the run list can filter by. Absent means all; there is deliberately no `all`
|
|
3
4
|
* value, so "no filter" and "every filter" are the same URL rather than two.
|
|
@@ -13,12 +14,10 @@ export const WORKFLOW_RUN_TABS = [
|
|
|
13
14
|
'annotations',
|
|
14
15
|
'source'
|
|
15
16
|
];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'success'
|
|
21
|
-
];
|
|
17
|
+
/**
|
|
18
|
+
* The `severity` parameter's vocabulary is the display severity set, not a second list: a URL
|
|
19
|
+
* that could name a severity the list cannot rank would be a filter with no matching rows.
|
|
20
|
+
*/ export const WORKFLOW_RUN_ANNOTATION_SEVERITIES = RUN_ANNOTATION_SEVERITIES;
|
|
22
21
|
const STATUS_VALUES = new Set(WORKFLOW_RUN_LIST_STATUSES);
|
|
23
22
|
const TAB_VALUES = new Set(WORKFLOW_RUN_TABS);
|
|
24
23
|
const ANNOTATION_SEVERITY_VALUES = new Set(WORKFLOW_RUN_ANNOTATION_SEVERITIES);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/inputs.ts"],"sourcesContent":["import type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\n\n/**\n * Statuses the run list can filter by. Absent means all; there is deliberately no `all`\n * value, so \"no filter\" and \"every filter\" are the same URL rather than two.\n */\nexport const WORKFLOW_RUN_LIST_STATUSES = ['succeeded', 'failed', 'running', 'cancelled'] as const;\n\nexport type WorkflowRunListStatus = (typeof WORKFLOW_RUN_LIST_STATUSES)[number];\n\nexport const WORKFLOW_RUN_TABS = ['summary', 'jobs', 'annotations', 'source'] as const;\n\nexport type WorkflowRunTab = (typeof WORKFLOW_RUN_TABS)[number];\n\nexport const WORKFLOW_RUN_ANNOTATION_SEVERITIES = ['error', 'warning', 'info', 'success'] as const;\n\nexport type WorkflowRunAnnotationSeverity = (typeof WORKFLOW_RUN_ANNOTATION_SEVERITIES)[number];\n\nexport interface WorkflowRunsSearch extends WorkflowRunSelectionInput {\n search?: string;\n status?: WorkflowRunListStatus[];\n branch?: string[];\n actor?: string[];\n event?: string[];\n /** Inclusive lower bound on the run's local calendar date, `YYYY-MM-DD`. */\n after?: string;\n /** Inclusive upper bound on the run's local calendar date, `YYYY-MM-DD`. */\n before?: string;\n tab?: WorkflowRunTab;\n annotation?: string;\n severity?: WorkflowRunAnnotationSeverity;\n}\n\nexport type WorkflowJobSearch = Omit<WorkflowRunSelectionInput, 'jobId'>;\n\nconst STATUS_VALUES = new Set<string>(WORKFLOW_RUN_LIST_STATUSES);\nconst TAB_VALUES = new Set<string>(WORKFLOW_RUN_TABS);\nconst ANNOTATION_SEVERITY_VALUES = new Set<string>(WORKFLOW_RUN_ANNOTATION_SEVERITIES);\nconst CALENDAR_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/u;\n\n/**\n * Reads the run list and run detail query string.\n *\n * Every value is dropped rather than rejected when it does not fit: a truncated or\n * hand-edited URL should degrade to a sensible page, never to an error screen. Unknown\n * parameters are ignored for the same reason.\n */\nexport function validateWorkflowRunsSearch(input: Record<string, unknown>): WorkflowRunsSearch {\n const search = string(input.search);\n const status = repeatable(input.status).filter(isWorkflowRunListStatus);\n const branch = repeatable(input.branch);\n const actor = repeatable(input.actor);\n const event = repeatable(input.event);\n const after = calendarDate(input.after);\n const before = calendarDate(input.before);\n const tabValue = string(input.tab);\n const tab = tabValue && TAB_VALUES.has(tabValue) ? (tabValue as WorkflowRunTab) : undefined;\n const annotation = string(input.annotation);\n const severityValue = string(input.severity);\n const severity =\n severityValue && ANNOTATION_SEVERITY_VALUES.has(severityValue)\n ? (severityValue as WorkflowRunAnnotationSeverity)\n : undefined;\n\n return {\n ...(search ? {search} : {}),\n ...(status.length > 0 ? {status} : {}),\n ...(branch.length > 0 ? {branch} : {}),\n ...(actor.length > 0 ? {actor} : {}),\n ...(event.length > 0 ? {event} : {}),\n ...(after ? {after} : {}),\n ...(before ? {before} : {}),\n ...(tab ? {tab} : {}),\n ...(annotation ? {annotation} : {}),\n ...(severity ? {severity} : {}),\n ...workflowSelectionFromSearch(input, true),\n };\n}\n\n/** Reads the job-detail query string without allowing a job id to leak back into URL state. */\nexport function validateWorkflowJobSearch(input: Record<string, unknown>): WorkflowJobSearch {\n const {jobId: _jobId, ...selection} = workflowSelectionFromSearch(input, false);\n return selection;\n}\n\n/**\n * Writes the query string back.\n *\n * Array values reach the router as arrays and the app's `stringifySearch` expands each into\n * repeated keys; joining them here would defeat that and break on branch names with commas.\n */\nexport function workflowRunSearchParams(\n search: WorkflowRunsSearch,\n selection: WorkflowRunSelectionInput = search,\n) {\n return {\n ...(search.search ? {search: search.search} : {}),\n ...(search.status?.length ? {status: search.status} : {}),\n ...(search.branch?.length ? {branch: search.branch} : {}),\n ...(search.actor?.length ? {actor: search.actor} : {}),\n ...(search.event?.length ? {event: search.event} : {}),\n ...(search.after ? {after: search.after} : {}),\n ...(search.before ? {before: search.before} : {}),\n ...(search.tab && search.tab !== 'summary' ? {tab: search.tab} : {}),\n ...(search.annotation ? {annotation: search.annotation} : {}),\n ...(search.severity ? {severity: search.severity} : {}),\n ...workflowSelectionSearchParams(selection, true),\n };\n}\n\nexport function workflowJobSearchParams(selection: WorkflowJobSearch) {\n return workflowSelectionSearchParams(selection, false);\n}\n\n/** Resolves the run-level surface. Removed Jobs-tab and selection-only URLs fall back to Summary. */\nexport function workflowRunTab(\n search: Pick<WorkflowRunsSearch, 'tab' | 'jobId' | 'jobExecutionId' | 'stepId' | 'stepAttemptId'>,\n): WorkflowRunTab {\n if (search.tab === 'annotations' || search.tab === 'source') return search.tab;\n return 'summary';\n}\n\n/** Serializes only list filters when leaving a run detail page for the run list. */\nexport function workflowRunListSearchParams(search: WorkflowRunsSearch) {\n const {tab: _tab, annotation: _annotation, severity: _severity, ...listSearch} = search;\n return workflowRunSearchParams(listSearch, {});\n}\n\n/**\n * A filter change. Each member is explicitly optional-or-undefined so that \"present and\n * undefined\" (clear this filter) stays distinguishable from \"absent\" (leave it alone) under\n * `exactOptionalPropertyTypes`.\n */\nexport interface WorkflowRunFilterPatch {\n search?: string | undefined;\n status?: WorkflowRunListStatus[] | undefined;\n branch?: string[] | undefined;\n actor?: string[] | undefined;\n event?: string[] | undefined;\n after?: string | undefined;\n before?: string | undefined;\n}\n\n/**\n * Applies a filter change.\n *\n * A key present with `undefined`, an empty string, or an empty array clears that filter; a\n * key left out is untouched. Cleared filters are deleted rather than stored empty, so \"no\n * filter\" is one URL instead of several that render the same list.\n */\nexport function applyWorkflowRunFilterPatch(\n search: WorkflowRunsSearch,\n patch: WorkflowRunFilterPatch,\n): WorkflowRunsSearch {\n const next: WorkflowRunsSearch = {...search};\n if ('search' in patch) setOrDelete(next, 'search', patch.search || undefined);\n if ('status' in patch) setOrDelete(next, 'status', nonEmptyList(patch.status));\n if ('branch' in patch) setOrDelete(next, 'branch', nonEmptyList(patch.branch));\n if ('actor' in patch) setOrDelete(next, 'actor', nonEmptyList(patch.actor));\n if ('event' in patch) setOrDelete(next, 'event', nonEmptyList(patch.event));\n if ('after' in patch) setOrDelete(next, 'after', patch.after || undefined);\n if ('before' in patch) setOrDelete(next, 'before', patch.before || undefined);\n return next;\n}\n\n/** Drops every filter while keeping the run-selection parameters the detail route owns. */\nexport function clearWorkflowRunFilters(search: WorkflowRunsSearch): WorkflowRunsSearch {\n return applyWorkflowRunFilterPatch(search, {\n search: undefined,\n status: undefined,\n branch: undefined,\n actor: undefined,\n event: undefined,\n after: undefined,\n before: undefined,\n });\n}\n\n/** True when any list filter is active, which separates \"no matches\" from \"no runs\". */\nexport function hasWorkflowRunFilters(search: WorkflowRunsSearch): boolean {\n return Boolean(\n search.search ||\n search.status?.length ||\n search.branch?.length ||\n search.actor?.length ||\n search.event?.length ||\n search.after ||\n search.before,\n );\n}\n\nexport function workflowRouteParams(input: Record<string, unknown>): {\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId?: string;\n} {\n const workspaceSlug = string(input.workspaceSlug);\n const projectSlug = string(input.projectSlug);\n if (!workspaceSlug || !projectSlug)\n throw new Error('Workflow route is missing required path parameters.');\n const workflowRunId = string(input.workflowRunId);\n return workflowRunId ? {workspaceSlug, projectSlug, workflowRunId} : {workspaceSlug, projectSlug};\n}\n\nexport function workflowJobRouteParams(input: Record<string, unknown>): {\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId: string;\n jobId: string;\n} {\n const workspaceSlug = string(input.workspaceSlug);\n const projectSlug = string(input.projectSlug);\n const workflowRunId = string(input.workflowRunId);\n const jobId = string(input.jobId);\n if (!workspaceSlug || !projectSlug || !workflowRunId || !jobId) {\n throw new Error('Workflow job route is missing required path parameters.');\n }\n return {workspaceSlug, projectSlug, workflowRunId, jobId};\n}\n\nfunction workflowSelectionFromSearch(\n input: Record<string, unknown>,\n includeJobId: boolean,\n): WorkflowRunSelectionInput {\n const jobId = includeJobId ? string(input.job) : undefined;\n const jobExecutionId = string(input.jobExecution);\n const stepId = string(input.step);\n const stepAttemptId = string(input.stepAttempt);\n const runAttempt = positiveInteger(input.runAttempt);\n\n return {\n ...(jobId ? {jobId} : {}),\n ...(jobExecutionId ? {jobExecutionId} : {}),\n ...(stepId ? {stepId} : {}),\n ...(stepAttemptId ? {stepAttemptId} : {}),\n ...(runAttempt ? {runAttempt} : {}),\n };\n}\n\nfunction workflowSelectionSearchParams(\n selection: WorkflowRunSelectionInput,\n includeJobId: boolean,\n) {\n return {\n ...(includeJobId && selection.jobId ? {job: selection.jobId} : {}),\n ...(selection.jobExecutionId ? {jobExecution: selection.jobExecutionId} : {}),\n ...(selection.stepId ? {step: selection.stepId} : {}),\n ...(selection.stepAttemptId ? {stepAttempt: selection.stepAttemptId} : {}),\n ...(selection.runAttempt ? {runAttempt: String(selection.runAttempt)} : {}),\n };\n}\n\nfunction setOrDelete<TKey extends keyof WorkflowRunsSearch>(\n target: WorkflowRunsSearch,\n key: TKey,\n value: WorkflowRunsSearch[TKey] | undefined,\n): void {\n if (value === undefined) delete target[key];\n else target[key] = value;\n}\n\nfunction nonEmptyList<TValue>(value: readonly TValue[] | undefined): TValue[] | undefined {\n return value && value.length > 0 ? [...value] : undefined;\n}\n\nfunction isWorkflowRunListStatus(value: string): value is WorkflowRunListStatus {\n return STATUS_VALUES.has(value);\n}\n\n/**\n * Normalizes a repeatable parameter into a deduplicated list.\n *\n * A single occurrence parses as a scalar rather than a one-element array, and the parser\n * coerces bare digits to numbers, so `?branch=2024` has to survive as the string `\"2024\"`.\n */\nfunction repeatable(value: unknown): string[] {\n const values = Array.isArray(value) ? value : [value];\n const normalized = values.flatMap((entry) => {\n if (typeof entry === 'string') return entry.length > 0 ? [entry] : [];\n if (typeof entry === 'number' && Number.isFinite(entry)) return [String(entry)];\n if (typeof entry === 'boolean') return [String(entry)];\n return [];\n });\n return [...new Set(normalized)];\n}\n\nfunction calendarDate(value: unknown): string | undefined {\n if (typeof value !== 'string' || !CALENDAR_DATE_PATTERN.test(value)) return undefined;\n // Rejects a well-shaped but impossible date such as 2026-02-31, which Date rolls forward.\n // Parsed as UTC: whether `2026-05-01` is a real date does not depend on the reader's zone,\n // and a local-time parse would reject a day the reader's zone skipped outright.\n const [year, month, day] = value.split('-').map(Number) as [number, number, number];\n const parsed = new Date(`${value}T00:00:00.000Z`);\n const isRealDate =\n !Number.isNaN(parsed.getTime()) &&\n parsed.getUTCFullYear() === year &&\n parsed.getUTCMonth() === month - 1 &&\n parsed.getUTCDate() === day;\n return isRealDate ? value : undefined;\n}\n\nfunction string(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction positiveInteger(value: unknown): number | undefined {\n const number = typeof value === 'string' ? Number(value) : value;\n return typeof number === 'number' && Number.isInteger(number) && number > 0 ? number : undefined;\n}\n"],"names":["WORKFLOW_RUN_LIST_STATUSES","WORKFLOW_RUN_TABS","WORKFLOW_RUN_ANNOTATION_SEVERITIES","STATUS_VALUES","Set","TAB_VALUES","ANNOTATION_SEVERITY_VALUES","CALENDAR_DATE_PATTERN","validateWorkflowRunsSearch","input","search","string","status","repeatable","filter","isWorkflowRunListStatus","branch","actor","event","after","calendarDate","before","tabValue","tab","has","undefined","annotation","severityValue","severity","length","workflowSelectionFromSearch","validateWorkflowJobSearch","jobId","_jobId","selection","workflowRunSearchParams","workflowSelectionSearchParams","workflowJobSearchParams","workflowRunTab","workflowRunListSearchParams","_tab","_annotation","_severity","listSearch","applyWorkflowRunFilterPatch","patch","next","setOrDelete","nonEmptyList","clearWorkflowRunFilters","hasWorkflowRunFilters","Boolean","workflowRouteParams","workspaceSlug","projectSlug","Error","workflowRunId","workflowJobRouteParams","includeJobId","job","jobExecutionId","jobExecution","stepId","step","stepAttemptId","stepAttempt","runAttempt","positiveInteger","String","target","key","value","values","Array","isArray","normalized","flatMap","entry","Number","isFinite","test","year","month","day","split","map","parsed","Date","isRealDate","isNaN","getTime","getUTCFullYear","getUTCMonth","getUTCDate","number","isInteger"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,6BAA6B;IAAC;IAAa;IAAU;IAAW;CAAY,CAAU;AAInG,OAAO,MAAMC,oBAAoB;IAAC;IAAW;IAAQ;IAAe;CAAS,CAAU;AAIvF,OAAO,MAAMC,qCAAqC;IAAC;IAAS;IAAW;IAAQ;CAAU,CAAU;AAqBnG,MAAMC,gBAAgB,IAAIC,IAAYJ;AACtC,MAAMK,aAAa,IAAID,IAAYH;AACnC,MAAMK,6BAA6B,IAAIF,IAAYF;AACnD,MAAMK,wBAAwB;AAE9B;;;;;;CAMC,GACD,OAAO,SAASC,2BAA2BC,KAA8B;IACvE,MAAMC,SAASC,OAAOF,MAAMC,MAAM;IAClC,MAAME,SAASC,WAAWJ,MAAMG,MAAM,EAAEE,MAAM,CAACC;IAC/C,MAAMC,SAASH,WAAWJ,MAAMO,MAAM;IACtC,MAAMC,QAAQJ,WAAWJ,MAAMQ,KAAK;IACpC,MAAMC,QAAQL,WAAWJ,MAAMS,KAAK;IACpC,MAAMC,QAAQC,aAAaX,MAAMU,KAAK;IACtC,MAAME,SAASD,aAAaX,MAAMY,MAAM;IACxC,MAAMC,WAAWX,OAAOF,MAAMc,GAAG;IACjC,MAAMA,MAAMD,YAAYjB,WAAWmB,GAAG,CAACF,YAAaA,WAA8BG;IAClF,MAAMC,aAAaf,OAAOF,MAAMiB,UAAU;IAC1C,MAAMC,gBAAgBhB,OAAOF,MAAMmB,QAAQ;IAC3C,MAAMA,WACJD,iBAAiBrB,2BAA2BkB,GAAG,CAACG,iBAC3CA,gBACDF;IAEN,OAAO;QACL,GAAIf,SAAS;YAACA;QAAM,IAAI,CAAC,CAAC;QAC1B,GAAIE,OAAOiB,M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OAAOV,QAC5BK,OAAOM,WAAW,OAAOV,QAAQ,KACjCI,OAAOO,UAAU,OAAOV;IAC1B,OAAOK,aAAajB,QAAQ9C;AAC9B;AAEA,SAASd,OAAO4D,KAAc;IAC5B,OAAO,OAAOA,UAAU,YAAYA,MAAM1C,MAAM,GAAG,IAAI0C,QAAQ9C;AACjE;AAEA,SAAS0C,gBAAgBI,KAAc;IACrC,MAAMuB,SAAS,OAAOvB,UAAU,WAAWO,OAAOP,SAASA;IAC3D,OAAO,OAAOuB,WAAW,YAAYhB,OAAOiB,SAAS,CAACD,WAAWA,SAAS,IAAIA,SAASrE;AACzF"}
|
|
1
|
+
{"version":3,"sources":["../../src/routes/inputs.ts"],"sourcesContent":["import {RUN_ANNOTATION_SEVERITIES, type RunAnnotationSeverity} from '#core/run-annotation.js';\nimport type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\n\n/**\n * Statuses the run list can filter by. Absent means all; there is deliberately no `all`\n * value, so \"no filter\" and \"every filter\" are the same URL rather than two.\n */\nexport const WORKFLOW_RUN_LIST_STATUSES = ['succeeded', 'failed', 'running', 'cancelled'] as const;\n\nexport type WorkflowRunListStatus = (typeof WORKFLOW_RUN_LIST_STATUSES)[number];\n\nexport const WORKFLOW_RUN_TABS = ['summary', 'jobs', 'annotations', 'source'] as const;\n\nexport type WorkflowRunTab = (typeof WORKFLOW_RUN_TABS)[number];\n\n/**\n * The `severity` parameter's vocabulary is the display severity set, not a second list: a URL\n * that could name a severity the list cannot rank would be a filter with no matching rows.\n */\nexport const WORKFLOW_RUN_ANNOTATION_SEVERITIES = RUN_ANNOTATION_SEVERITIES;\n\nexport type WorkflowRunAnnotationSeverity = RunAnnotationSeverity;\n\nexport interface WorkflowRunsSearch extends WorkflowRunSelectionInput {\n search?: string;\n status?: WorkflowRunListStatus[];\n branch?: string[];\n actor?: string[];\n event?: string[];\n /** Inclusive lower bound on the run's local calendar date, `YYYY-MM-DD`. */\n after?: string;\n /** Inclusive upper bound on the run's local calendar date, `YYYY-MM-DD`. */\n before?: string;\n tab?: WorkflowRunTab;\n annotation?: string;\n severity?: WorkflowRunAnnotationSeverity;\n}\n\nexport type WorkflowJobSearch = Omit<WorkflowRunSelectionInput, 'jobId'>;\n\nconst STATUS_VALUES = new Set<string>(WORKFLOW_RUN_LIST_STATUSES);\nconst TAB_VALUES = new Set<string>(WORKFLOW_RUN_TABS);\nconst ANNOTATION_SEVERITY_VALUES = new Set<string>(WORKFLOW_RUN_ANNOTATION_SEVERITIES);\nconst CALENDAR_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/u;\n\n/**\n * Reads the run list and run detail query string.\n *\n * Every value is dropped rather than rejected when it does not fit: a truncated or\n * hand-edited URL should degrade to a sensible page, never to an error screen. Unknown\n * parameters are ignored for the same reason.\n */\nexport function validateWorkflowRunsSearch(input: Record<string, unknown>): WorkflowRunsSearch {\n const search = string(input.search);\n const status = repeatable(input.status).filter(isWorkflowRunListStatus);\n const branch = repeatable(input.branch);\n const actor = repeatable(input.actor);\n const event = repeatable(input.event);\n const after = calendarDate(input.after);\n const before = calendarDate(input.before);\n const tabValue = string(input.tab);\n const tab = tabValue && TAB_VALUES.has(tabValue) ? (tabValue as WorkflowRunTab) : undefined;\n const annotation = string(input.annotation);\n const severityValue = string(input.severity);\n const severity =\n severityValue && ANNOTATION_SEVERITY_VALUES.has(severityValue)\n ? (severityValue as WorkflowRunAnnotationSeverity)\n : undefined;\n\n return {\n ...(search ? {search} : {}),\n ...(status.length > 0 ? {status} : {}),\n ...(branch.length > 0 ? {branch} : {}),\n ...(actor.length > 0 ? {actor} : {}),\n ...(event.length > 0 ? {event} : {}),\n ...(after ? {after} : {}),\n ...(before ? {before} : {}),\n ...(tab ? {tab} : {}),\n ...(annotation ? {annotation} : {}),\n ...(severity ? {severity} : {}),\n ...workflowSelectionFromSearch(input, true),\n };\n}\n\n/** Reads the job-detail query string without allowing a job id to leak back into URL state. */\nexport function validateWorkflowJobSearch(input: Record<string, unknown>): WorkflowJobSearch {\n const {jobId: _jobId, ...selection} = workflowSelectionFromSearch(input, false);\n return selection;\n}\n\n/**\n * Writes the query string back.\n *\n * Array values reach the router as arrays and the app's `stringifySearch` expands each into\n * repeated keys; joining them here would defeat that and break on branch names with commas.\n */\nexport function workflowRunSearchParams(\n search: WorkflowRunsSearch,\n selection: WorkflowRunSelectionInput = search,\n) {\n return {\n ...(search.search ? {search: search.search} : {}),\n ...(search.status?.length ? {status: search.status} : {}),\n ...(search.branch?.length ? {branch: search.branch} : {}),\n ...(search.actor?.length ? {actor: search.actor} : {}),\n ...(search.event?.length ? {event: search.event} : {}),\n ...(search.after ? {after: search.after} : {}),\n ...(search.before ? {before: search.before} : {}),\n ...(search.tab && search.tab !== 'summary' ? {tab: search.tab} : {}),\n ...(search.annotation ? {annotation: search.annotation} : {}),\n ...(search.severity ? {severity: search.severity} : {}),\n ...workflowSelectionSearchParams(selection, true),\n };\n}\n\nexport function workflowJobSearchParams(selection: WorkflowJobSearch) {\n return workflowSelectionSearchParams(selection, false);\n}\n\n/** Resolves the run-level surface. Removed Jobs-tab and selection-only URLs fall back to Summary. */\nexport function workflowRunTab(\n search: Pick<WorkflowRunsSearch, 'tab' | 'jobId' | 'jobExecutionId' | 'stepId' | 'stepAttemptId'>,\n): WorkflowRunTab {\n if (search.tab === 'annotations' || search.tab === 'source') return search.tab;\n return 'summary';\n}\n\n/** Serializes only list filters when leaving a run detail page for the run list. */\nexport function workflowRunListSearchParams(search: WorkflowRunsSearch) {\n const {tab: _tab, annotation: _annotation, severity: _severity, ...listSearch} = search;\n return workflowRunSearchParams(listSearch, {});\n}\n\n/**\n * A filter change. Each member is explicitly optional-or-undefined so that \"present and\n * undefined\" (clear this filter) stays distinguishable from \"absent\" (leave it alone) under\n * `exactOptionalPropertyTypes`.\n */\nexport interface WorkflowRunFilterPatch {\n search?: string | undefined;\n status?: WorkflowRunListStatus[] | undefined;\n branch?: string[] | undefined;\n actor?: string[] | undefined;\n event?: string[] | undefined;\n after?: string | undefined;\n before?: string | undefined;\n}\n\n/**\n * Applies a filter change.\n *\n * A key present with `undefined`, an empty string, or an empty array clears that filter; a\n * key left out is untouched. Cleared filters are deleted rather than stored empty, so \"no\n * filter\" is one URL instead of several that render the same list.\n */\nexport function applyWorkflowRunFilterPatch(\n search: WorkflowRunsSearch,\n patch: WorkflowRunFilterPatch,\n): WorkflowRunsSearch {\n const next: WorkflowRunsSearch = {...search};\n if ('search' in patch) setOrDelete(next, 'search', patch.search || undefined);\n if ('status' in patch) setOrDelete(next, 'status', nonEmptyList(patch.status));\n if ('branch' in patch) setOrDelete(next, 'branch', nonEmptyList(patch.branch));\n if ('actor' in patch) setOrDelete(next, 'actor', nonEmptyList(patch.actor));\n if ('event' in patch) setOrDelete(next, 'event', nonEmptyList(patch.event));\n if ('after' in patch) setOrDelete(next, 'after', patch.after || undefined);\n if ('before' in patch) setOrDelete(next, 'before', patch.before || undefined);\n return next;\n}\n\n/** Drops every filter while keeping the run-selection parameters the detail route owns. */\nexport function clearWorkflowRunFilters(search: WorkflowRunsSearch): WorkflowRunsSearch {\n return applyWorkflowRunFilterPatch(search, {\n search: undefined,\n status: undefined,\n branch: undefined,\n actor: undefined,\n event: undefined,\n after: undefined,\n before: undefined,\n });\n}\n\n/** True when any list filter is active, which separates \"no matches\" from \"no runs\". */\nexport function hasWorkflowRunFilters(search: WorkflowRunsSearch): boolean {\n return Boolean(\n search.search ||\n search.status?.length ||\n search.branch?.length ||\n search.actor?.length ||\n search.event?.length ||\n search.after ||\n search.before,\n );\n}\n\nexport function workflowRouteParams(input: Record<string, unknown>): {\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId?: string;\n} {\n const workspaceSlug = string(input.workspaceSlug);\n const projectSlug = string(input.projectSlug);\n if (!workspaceSlug || !projectSlug)\n throw new Error('Workflow route is missing required path parameters.');\n const workflowRunId = string(input.workflowRunId);\n return workflowRunId ? {workspaceSlug, projectSlug, workflowRunId} : {workspaceSlug, projectSlug};\n}\n\nexport function workflowJobRouteParams(input: Record<string, unknown>): {\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId: string;\n jobId: string;\n} {\n const workspaceSlug = string(input.workspaceSlug);\n const projectSlug = string(input.projectSlug);\n const workflowRunId = string(input.workflowRunId);\n const jobId = string(input.jobId);\n if (!workspaceSlug || !projectSlug || !workflowRunId || !jobId) {\n throw new Error('Workflow job route is missing required path parameters.');\n }\n return {workspaceSlug, projectSlug, workflowRunId, jobId};\n}\n\nfunction workflowSelectionFromSearch(\n input: Record<string, unknown>,\n includeJobId: boolean,\n): WorkflowRunSelectionInput {\n const jobId = includeJobId ? string(input.job) : undefined;\n const jobExecutionId = string(input.jobExecution);\n const stepId = string(input.step);\n const stepAttemptId = string(input.stepAttempt);\n const runAttempt = positiveInteger(input.runAttempt);\n\n return {\n ...(jobId ? {jobId} : {}),\n ...(jobExecutionId ? {jobExecutionId} : {}),\n ...(stepId ? {stepId} : {}),\n ...(stepAttemptId ? {stepAttemptId} : {}),\n ...(runAttempt ? {runAttempt} : {}),\n };\n}\n\nfunction workflowSelectionSearchParams(\n selection: WorkflowRunSelectionInput,\n includeJobId: boolean,\n) {\n return {\n ...(includeJobId && selection.jobId ? {job: selection.jobId} : {}),\n ...(selection.jobExecutionId ? {jobExecution: selection.jobExecutionId} : {}),\n ...(selection.stepId ? {step: selection.stepId} : {}),\n ...(selection.stepAttemptId ? {stepAttempt: selection.stepAttemptId} : {}),\n ...(selection.runAttempt ? {runAttempt: String(selection.runAttempt)} : {}),\n };\n}\n\nfunction setOrDelete<TKey extends keyof WorkflowRunsSearch>(\n target: WorkflowRunsSearch,\n key: TKey,\n value: WorkflowRunsSearch[TKey] | undefined,\n): void {\n if (value === undefined) delete target[key];\n else target[key] = value;\n}\n\nfunction nonEmptyList<TValue>(value: readonly TValue[] | undefined): TValue[] | undefined {\n return value && value.length > 0 ? [...value] : undefined;\n}\n\nfunction isWorkflowRunListStatus(value: string): value is WorkflowRunListStatus {\n return STATUS_VALUES.has(value);\n}\n\n/**\n * Normalizes a repeatable parameter into a deduplicated list.\n *\n * A single occurrence parses as a scalar rather than a one-element array, and the parser\n * coerces bare digits to numbers, so `?branch=2024` has to survive as the string `\"2024\"`.\n */\nfunction repeatable(value: unknown): string[] {\n const values = Array.isArray(value) ? value : [value];\n const normalized = values.flatMap((entry) => {\n if (typeof entry === 'string') return entry.length > 0 ? [entry] : [];\n if (typeof entry === 'number' && Number.isFinite(entry)) return [String(entry)];\n if (typeof entry === 'boolean') return [String(entry)];\n return [];\n });\n return [...new Set(normalized)];\n}\n\nfunction calendarDate(value: unknown): string | undefined {\n if (typeof value !== 'string' || !CALENDAR_DATE_PATTERN.test(value)) return undefined;\n // Rejects a well-shaped but impossible date such as 2026-02-31, which Date rolls forward.\n // Parsed as UTC: whether `2026-05-01` is a real date does not depend on the reader's zone,\n // and a local-time parse would reject a day the reader's zone skipped outright.\n const [year, month, day] = value.split('-').map(Number) as [number, number, number];\n const parsed = new Date(`${value}T00:00:00.000Z`);\n const isRealDate =\n !Number.isNaN(parsed.getTime()) &&\n parsed.getUTCFullYear() === year &&\n parsed.getUTCMonth() === month - 1 &&\n parsed.getUTCDate() === day;\n return isRealDate ? value : undefined;\n}\n\nfunction string(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction positiveInteger(value: unknown): number | undefined {\n const number = typeof value === 'string' ? Number(value) : value;\n return typeof number === 'number' && Number.isInteger(number) && number > 0 ? number : undefined;\n}\n"],"names":["RUN_ANNOTATION_SEVERITIES","WORKFLOW_RUN_LIST_STATUSES","WORKFLOW_RUN_TABS","WORKFLOW_RUN_ANNOTATION_SEVERITIES","STATUS_VALUES","Set","TAB_VALUES","ANNOTATION_SEVERITY_VALUES","CALENDAR_DATE_PATTERN","validateWorkflowRunsSearch","input","search","string","status","repeatable","filter","isWorkflowRunListStatus","branch","actor","event","after","calendarDate","before","tabValue","tab","has","undefined","annotation","severityValue","severity","length","workflowSelectionFromSearch","validateWorkflowJobSearch","jobId","_jobId","selection","workflowRunSearchParams","workflowSelectionSearchParams","workflowJobSearchParams","workflowRunTab","workflowRunListSearchParams","_tab","_annotation","_severity","listSearch","applyWorkflowRunFilterPatch","patch","next","setOrDelete","nonEmptyList","clearWorkflowRunFilters","hasWorkflowRunFilters","Boolean","workflowRouteParams","workspaceSlug","projectSlug","Error","workflowRunId","workflowJobRouteParams","includeJobId","job","jobExecutionId","jobExecution","stepId","step","stepAttemptId","stepAttempt","runAttempt","positiveInteger","String","target","key","value","values","Array","isArray","normalized","flatMap","entry","Number","isFinite","test","year","month","day","split","map","parsed","Date","isRealDate","isNaN","getTime","getUTCFullYear","getUTCMonth","getUTCDate","number","isInteger"],"mappings":"AAAA,SAAQA,yBAAyB,QAAmC,0BAA0B;AAG9F;;;CAGC,GACD,OAAO,MAAMC,6BAA6B;IAAC;IAAa;IAAU;IAAW;CAAY,CAAU;AAInG,OAAO,MAAMC,oBAAoB;IAAC;IAAW;IAAQ;IAAe;CAAS,CAAU;AAIvF;;;CAGC,GACD,OAAO,MAAMC,qCAAqCH,0BAA0B;AAqB5E,MAAMI,gBAAgB,IAAIC,IAAYJ;AACtC,MAAMK,aAAa,IAAID,IAAYH;AACnC,MAAMK,6BAA6B,IAAIF,IAAYF;AACnD,MAAMK,wBAAwB;AAE9B;;;;;;CAMC,GACD,OAAO,SAASC,2BAA2BC,KAA8B;IACvE,MAAMC,SAASC,OAAOF,MAAMC,MAAM;IAClC,MAAME,SAASC,WAAWJ,MAAMG,MAAM,EAAEE,MAAM,CAACC;IAC/C,MAAMC,SAASH,WAAWJ,MAAMO,MAAM;IACtC,MAAMC,QAAQJ,WAAWJ,MAAMQ,KAAK;IACpC,MAAMC,QAAQL,WAAWJ,MAAMS,KAAK;IACpC,MAAMC,QAAQC,aAAaX,MAAMU,KAAK;IACtC,MAAME,SAASD,aAAaX,MAAMY,MAAM;IACxC,MAAMC,WAAWX,OAAOF,MAAMc,GAAG;IACjC,MAAMA,MAAMD,YAAYjB,WAAWmB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