@shipfox/client-workflows 14.0.1 → 16.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/.storybook/preview.tsx +7 -2
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +42 -0
- package/dist/components/job-detail/agent-config-failure-callout.d.ts.map +1 -0
- package/dist/components/{workflow-run-view → job-detail}/agent-config-failure-callout.js +2 -2
- package/dist/components/job-detail/agent-config-failure-callout.js.map +1 -0
- package/dist/components/job-detail/job-detail-header.d.ts +15 -0
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-header.js +124 -0
- package/dist/components/job-detail/job-detail-header.js.map +1 -0
- package/dist/components/job-detail/job-detail-view.d.ts +16 -0
- package/dist/components/job-detail/job-detail-view.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-view.js +420 -0
- package/dist/components/job-detail/job-detail-view.js.map +1 -0
- package/dist/components/job-detail/job-empty-states.d.ts +10 -0
- package/dist/components/job-detail/job-empty-states.d.ts.map +1 -0
- package/dist/components/job-detail/job-empty-states.js +195 -0
- package/dist/components/job-detail/job-empty-states.js.map +1 -0
- package/dist/components/job-detail/job-execution-switcher.d.ts.map +1 -0
- package/dist/components/job-detail/job-execution-switcher.js.map +1 -0
- package/dist/components/job-detail/job-execution-time-text.d.ts.map +1 -0
- package/dist/components/job-detail/job-execution-time-text.js.map +1 -0
- package/dist/components/job-detail/job-selection.d.ts +24 -0
- package/dist/components/job-detail/job-selection.d.ts.map +1 -0
- package/dist/components/job-detail/job-selection.js +66 -0
- package/dist/components/job-detail/job-selection.js.map +1 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts +15 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts.map +1 -0
- package/dist/components/{workflow-run-view → job-detail}/step-attempt-log-panel.js +61 -16
- package/dist/components/job-detail/step-attempt-log-panel.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.js +1 -1
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/step-list/step-list-model.js +2 -2
- package/dist/components/step-list/step-list-model.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +1 -0
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js +29 -4
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.d.ts +9 -4
- package/dist/components/workflow-run-duration-label.d.ts.map +1 -1
- package/dist/components/workflow-run-duration-label.js +27 -7
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +6 -5
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -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 +69 -64
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +3 -3
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js +3 -3
- 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 +32 -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 +202 -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 +87 -22
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts +3 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotations-empty.js +2 -2
- package/dist/components/workflow-run-tabs/run-annotations-empty.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/index.d.ts +0 -1
- package/dist/components/workflow-run-view/index.d.ts.map +1 -1
- package/dist/components/workflow-run-view/index.js +0 -1
- package/dist/components/workflow-run-view/index.js.map +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts +20 -0
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts.map +1 -0
- package/dist/components/workflow-run-view/run-workspace-nav.js +277 -0
- package/dist/components/workflow-run-view/run-workspace-nav.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js +1 -14
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +10 -10
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +351 -239
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -1
- package/dist/components/workflow-status/status-visuals.js +10 -2
- package/dist/components/workflow-status/status-visuals.js.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts +3 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.js +13 -2
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +9 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js +13 -3
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step.d.ts +2 -0
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js +13 -0
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +56 -1
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +98 -0
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/run-annotation.d.ts +73 -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 +4 -4
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js +3 -3
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/feature.d.ts +20 -16
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +5 -0
- package/dist/feature.js.map +1 -1
- 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/workflow-runs.d.ts +5 -3
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
- package/dist/hooks/api/workflow-runs.js +5 -4
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pages/workflow-job-detail-page.d.ts +11 -0
- package/dist/pages/workflow-job-detail-page.d.ts.map +1 -0
- package/dist/pages/workflow-job-detail-page.js +66 -0
- package/dist/pages/workflow-job-detail-page.js.map +1 -0
- package/dist/pages/workflow-run-detail-page.d.ts.map +1 -1
- package/dist/pages/workflow-run-detail-page.js +4 -37
- package/dist/pages/workflow-run-detail-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +52 -34
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +74 -43
- package/dist/routes/inputs.js.map +1 -1
- package/dist/routes/job-detail.d.ts +10 -0
- package/dist/routes/job-detail.d.ts.map +1 -0
- package/dist/routes/job-detail.js +27 -0
- package/dist/routes/job-detail.js.map +1 -0
- package/dist/routes/project-route.d.ts +1 -1
- package/dist/routes/run-detail.d.ts.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/src/components/{workflow-run-view → job-detail}/agent-config-failure-callout.stories.tsx +1 -1
- package/src/components/{workflow-run-view → job-detail}/agent-config-failure-callout.tsx +2 -2
- package/src/components/job-detail/job-detail-header.test.tsx +34 -0
- package/src/components/job-detail/job-detail-header.tsx +136 -0
- package/src/components/job-detail/job-detail-view.stories.tsx +531 -0
- package/src/components/job-detail/job-detail-view.tsx +467 -0
- package/src/components/job-detail/job-empty-states.test.ts +27 -0
- package/src/components/job-detail/job-empty-states.tsx +248 -0
- package/src/components/job-detail/job-selection.test.ts +188 -0
- package/src/components/job-detail/job-selection.ts +96 -0
- package/src/components/{workflow-run-view → job-detail}/step-attempt-log-panel.test.tsx +32 -9
- package/src/components/{workflow-run-view → job-detail}/step-attempt-log-panel.tsx +52 -18
- package/src/components/job-graph/job-graph-content.tsx +1 -1
- package/src/components/step-list/step-list-model.test.ts +1 -1
- package/src/components/step-list/step-list-model.ts +2 -2
- package/src/components/step-list/step-list.stories.tsx +1 -1
- package/src/components/step-list/step-list.test.tsx +33 -0
- package/src/components/step-list/step-list.tsx +40 -9
- package/src/components/workflow-run-duration-label.tsx +50 -12
- package/src/components/workflow-run-list/workflow-run-row.tsx +6 -4
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +38 -0
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +79 -5
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +56 -60
- package/src/components/workflow-run-tabs/index.ts +3 -3
- 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 +258 -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 +92 -17
- package/src/components/workflow-run-tabs/run-annotations-empty.tsx +6 -2
- 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/index.ts +0 -1
- package/src/components/workflow-run-view/run-workspace-nav.test.tsx +286 -0
- package/src/components/workflow-run-view/run-workspace-nav.tsx +314 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +1 -23
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +237 -1085
- package/src/components/workflow-run-view/workflow-run-view.tsx +450 -323
- package/src/components/workflow-status/status-visuals.ts +5 -2
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +1 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +26 -1
- package/src/core/entities/job-execution.ts +17 -2
- package/src/core/entities/step.ts +26 -0
- package/src/core/entities/workflow-run-display.test.ts +159 -0
- package/src/core/entities/workflow-run.ts +139 -1
- package/src/core/run-annotation.test.ts +315 -0
- package/src/core/run-annotation.ts +238 -0
- package/src/core/workflow-run.ts +16 -1
- package/src/feature.ts +5 -0
- package/src/hooks/api/run-annotation-mapper.ts +30 -0
- package/src/hooks/api/run-annotations.ts +137 -0
- package/src/hooks/api/workflow-runs.ts +6 -2
- package/src/index.ts +1 -0
- package/src/page-harness-budget.test.ts +1 -0
- package/src/pages/workflow-job-detail-page.test.tsx +605 -0
- package/src/pages/workflow-job-detail-page.tsx +84 -0
- package/src/pages/workflow-run-detail-page.tsx +3 -43
- package/src/pages/workflow-run-pages.test.tsx +77 -332
- package/src/routes/inputs.test.ts +56 -6
- package/src/routes/inputs.ts +71 -19
- package/src/routes/job-detail.tsx +29 -0
- package/test/pages.tsx +25 -3
- package/test/render.tsx +6 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts +0 -18
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-jobs-list.js +0 -107
- package/dist/components/workflow-run-tabs/run-jobs-list.js.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts +0 -6
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-count.js +0 -27
- package/dist/components/workflow-run-tabs/run-tab-count.js.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts +0 -8
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts.map +0 -1
- package/dist/components/workflow-run-tabs/run-tab-strip.js +0 -82
- package/dist/components/workflow-run-tabs/run-tab-strip.js.map +0 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +0 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +0 -1
- package/dist/components/workflow-run-view/job-card.d.ts +0 -17
- package/dist/components/workflow-run-view/job-card.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-card.js +0 -496
- package/dist/components/workflow-run-view/job-card.js.map +0 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +0 -1
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts.map +0 -1
- package/dist/components/workflow-run-view/job-execution-time-text.js.map +0 -1
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts +0 -9
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts.map +0 -1
- package/dist/components/workflow-run-view/step-attempt-log-panel.js.map +0 -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/components/workflow-run-tabs/run-jobs-list.tsx +0 -151
- package/src/components/workflow-run-tabs/run-tab-count.tsx +0 -28
- package/src/components/workflow-run-tabs/run-tab-strip.stories.tsx +0 -52
- package/src/components/workflow-run-tabs/run-tab-strip.test.tsx +0 -117
- package/src/components/workflow-run-tabs/run-tab-strip.tsx +0 -97
- package/src/components/workflow-run-view/job-card.stories.tsx +0 -789
- package/src/components/workflow-run-view/job-card.test.tsx +0 -115
- package/src/components/workflow-run-view/job-card.tsx +0 -614
- package/src/core/workflow-run-tabs.ts +0 -8
- /package/dist/components/{workflow-run-view → job-detail}/agent-config-failure-callout.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-switcher.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-switcher.js +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-time-text.d.ts +0 -0
- /package/dist/components/{workflow-run-view → job-detail}/job-execution-time-text.js +0 -0
- /package/src/components/{workflow-run-view → job-detail}/job-execution-switcher.tsx +0 -0
- /package/src/components/{workflow-run-view → job-detail}/job-execution-time-text.tsx +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type InfiniteData, type UseInfiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';
|
|
2
|
+
import { type RunAnnotationRecord, type RunAnnotationSummary } from '#core/run-annotation.js';
|
|
3
|
+
import { type RunAnnotationPage } from './run-annotation-mapper.js';
|
|
4
|
+
export declare const runAnnotationsQueryKeys: {
|
|
5
|
+
all: readonly ['run-annotations'];
|
|
6
|
+
list: (workflowRunId: string, runAttempt?: number | undefined) => readonly ["run-annotations", "list", string, number | null];
|
|
7
|
+
};
|
|
8
|
+
type RunAnnotationsQueryKey = ReturnType<typeof runAnnotationsQueryKeys.list> | readonly ['run-annotations', 'list'];
|
|
9
|
+
type RunAnnotationsQueryOptions = UseInfiniteQueryOptions<RunAnnotationPage, Error, InfiniteData<RunAnnotationPage, string | undefined>, RunAnnotationsQueryKey, string | undefined>;
|
|
10
|
+
export interface RunAnnotationsQueryInput {
|
|
11
|
+
workflowRunId: string | undefined;
|
|
12
|
+
runAttempt: number | undefined;
|
|
13
|
+
/** Poll while the run attempt is non-terminal, then settle. */
|
|
14
|
+
live?: boolean | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare function runAnnotationsQueryOptions({ workflowRunId, runAttempt, live, }: RunAnnotationsQueryInput): RunAnnotationsQueryOptions;
|
|
17
|
+
export interface RunAnnotationsQueryResult {
|
|
18
|
+
query: ReturnType<typeof useInfiniteQuery<RunAnnotationPage, Error, InfiniteData<RunAnnotationPage, string | undefined>, RunAnnotationsQueryKey, string | undefined>>;
|
|
19
|
+
/** `undefined` until the first page resolves, so counts never render a speculative zero. */
|
|
20
|
+
annotations: RunAnnotationRecord[] | undefined;
|
|
21
|
+
summary: RunAnnotationSummary | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare function useRunAnnotationsQuery(input: RunAnnotationsQueryInput): RunAnnotationsQueryResult;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=run-annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-annotations.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/run-annotations.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,uBAAuB,EAC5B,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAE1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,KAAK,iBAAiB,EAAsB,MAAM,4BAA4B,CAAC;AAKvF,eAAO,MAAM,uBAAuB;IAClC,GAAG,YAAG,iBAAiB;IACvB,IAAI,kBAAkB,MAAM,eAAe,MAAM,GAAG,SAAS;CAE9D,CAAC;AAEF,KAAK,sBAAsB,GACvB,UAAU,CAAC,OAAO,uBAAuB,CAAC,IAAI,CAAC,GAC/C,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAEzC,KAAK,0BAA0B,GAAG,uBAAuB,CACvD,iBAAiB,EACjB,KAAK,EACL,YAAY,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,EACnD,sBAAsB,EACtB,MAAM,GAAG,SAAS,CACnB,CAAC;AA2BF,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAgB,0BAA0B,CAAC,EACzC,aAAa,EACb,UAAU,EACV,IAAY,GACb,EAAE,wBAAwB,GAAG,0BAA0B,CA6BvD;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,UAAU,CACf,OAAO,gBAAgB,CACrB,iBAAiB,EACjB,KAAK,EACL,YAAY,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,EACnD,sBAAsB,EACtB,MAAM,GAAG,SAAS,CACnB,CACF,CAAC;IACF,4FAA4F;IAC5F,WAAW,EAAE,mBAAmB,EAAE,GAAG,SAAS,CAAC;IAC/C,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,wBAAwB,GAAG,yBAAyB,CAiBjG"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { READ_ANNOTATIONS_MAX_LIMIT, readAnnotationsResponseSchema } from '@shipfox/annotations-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
3
|
+
import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { summarizeRunAnnotations } from '#core/run-annotation.js';
|
|
6
|
+
import { toRunAnnotationPage } from './run-annotation-mapper.js';
|
|
7
|
+
/** Matches the run detail poll, so annotations and run state never disagree by more than a tick. */ const ACTIVE_POLL_MS = 4_000;
|
|
8
|
+
export const runAnnotationsQueryKeys = {
|
|
9
|
+
all: [
|
|
10
|
+
'run-annotations'
|
|
11
|
+
],
|
|
12
|
+
list: (workflowRunId, runAttempt)=>[
|
|
13
|
+
...runAnnotationsQueryKeys.all,
|
|
14
|
+
'list',
|
|
15
|
+
workflowRunId,
|
|
16
|
+
runAttempt ?? null
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
async function listRunAnnotations({ workflowRunId, runAttempt, cursor, signal }) {
|
|
20
|
+
const params = new URLSearchParams({
|
|
21
|
+
workflow_run_id: workflowRunId,
|
|
22
|
+
attempt: String(runAttempt),
|
|
23
|
+
limit: String(READ_ANNOTATIONS_MAX_LIMIT)
|
|
24
|
+
});
|
|
25
|
+
if (cursor) params.set('cursor', cursor);
|
|
26
|
+
return toRunAnnotationPage(await checkedApiRequest(readAnnotationsResponseSchema, `/annotations?${params.toString()}`, {
|
|
27
|
+
signal
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
export function runAnnotationsQueryOptions({ workflowRunId, runAttempt, live = false }) {
|
|
31
|
+
const enabled = Boolean(workflowRunId) && runAttempt !== undefined;
|
|
32
|
+
// Polling stops once the reader has paged past the first page: the cursor bounding page 2 was
|
|
33
|
+
// computed from page 1's last row, so a refetch that shifts that boundary can drop a range of
|
|
34
|
+
// annotations into a between-pages gap.
|
|
35
|
+
return infiniteQueryOptions({
|
|
36
|
+
queryKey: workflowRunId ? runAnnotationsQueryKeys.list(workflowRunId, runAttempt) : [
|
|
37
|
+
...runAnnotationsQueryKeys.all,
|
|
38
|
+
'list'
|
|
39
|
+
],
|
|
40
|
+
enabled,
|
|
41
|
+
initialPageParam: undefined,
|
|
42
|
+
queryFn: ({ pageParam, signal })=>listRunAnnotations({
|
|
43
|
+
workflowRunId: workflowRunId ?? '',
|
|
44
|
+
runAttempt: runAttempt ?? 1,
|
|
45
|
+
cursor: pageParam,
|
|
46
|
+
signal
|
|
47
|
+
}),
|
|
48
|
+
getNextPageParam: (lastPage)=>lastPage.nextCursor ?? undefined,
|
|
49
|
+
staleTime: 2_000,
|
|
50
|
+
refetchOnWindowFocus: true,
|
|
51
|
+
refetchInterval: (query)=>{
|
|
52
|
+
if (!live) return false;
|
|
53
|
+
const pages = query.state.data?.pages;
|
|
54
|
+
return pages && pages.length > 1 ? false : ACTIVE_POLL_MS;
|
|
55
|
+
},
|
|
56
|
+
refetchIntervalInBackground: false
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export function useRunAnnotationsQuery(input) {
|
|
60
|
+
const query = useInfiniteQuery(runAnnotationsQueryOptions(input));
|
|
61
|
+
const pages = query.data?.pages;
|
|
62
|
+
const annotations = useMemo(()=>pages ? pages.flatMap((page)=>page.annotations) : undefined, [
|
|
63
|
+
pages
|
|
64
|
+
]);
|
|
65
|
+
const summary = useMemo(()=>annotations ? summarizeRunAnnotations(annotations, {
|
|
66
|
+
truncated: pages?.at(-1)?.hasMore ?? false
|
|
67
|
+
}) : undefined, [
|
|
68
|
+
annotations,
|
|
69
|
+
pages
|
|
70
|
+
]);
|
|
71
|
+
return {
|
|
72
|
+
query,
|
|
73
|
+
annotations,
|
|
74
|
+
summary
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=run-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/run-annotations.ts"],"sourcesContent":["import {READ_ANNOTATIONS_MAX_LIMIT, readAnnotationsResponseSchema} from '@shipfox/annotations-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {\n type InfiniteData,\n infiniteQueryOptions,\n type UseInfiniteQueryOptions,\n useInfiniteQuery,\n} from '@tanstack/react-query';\nimport {useMemo} from 'react';\nimport {\n type RunAnnotationRecord,\n type RunAnnotationSummary,\n summarizeRunAnnotations,\n} from '#core/run-annotation.js';\nimport {type RunAnnotationPage, toRunAnnotationPage} from './run-annotation-mapper.js';\n\n/** Matches the run detail poll, so annotations and run state never disagree by more than a tick. */\nconst ACTIVE_POLL_MS = 4_000;\n\nexport const runAnnotationsQueryKeys = {\n all: ['run-annotations'] as const,\n list: (workflowRunId: string, runAttempt?: number | undefined) =>\n [...runAnnotationsQueryKeys.all, 'list', workflowRunId, runAttempt ?? null] as const,\n};\n\ntype RunAnnotationsQueryKey =\n | ReturnType<typeof runAnnotationsQueryKeys.list>\n | readonly ['run-annotations', 'list'];\n\ntype RunAnnotationsQueryOptions = UseInfiniteQueryOptions<\n RunAnnotationPage,\n Error,\n InfiniteData<RunAnnotationPage, string | undefined>,\n RunAnnotationsQueryKey,\n string | undefined\n>;\n\nasync function listRunAnnotations({\n workflowRunId,\n runAttempt,\n cursor,\n signal,\n}: {\n workflowRunId: string;\n runAttempt: number;\n cursor?: string | undefined;\n signal?: AbortSignal;\n}): Promise<RunAnnotationPage> {\n const params = new URLSearchParams({\n workflow_run_id: workflowRunId,\n attempt: String(runAttempt),\n limit: String(READ_ANNOTATIONS_MAX_LIMIT),\n });\n if (cursor) params.set('cursor', cursor);\n\n return toRunAnnotationPage(\n await checkedApiRequest(readAnnotationsResponseSchema, `/annotations?${params.toString()}`, {\n signal,\n }),\n );\n}\n\nexport interface RunAnnotationsQueryInput {\n workflowRunId: string | undefined;\n runAttempt: number | undefined;\n /** Poll while the run attempt is non-terminal, then settle. */\n live?: boolean | undefined;\n}\n\nexport function runAnnotationsQueryOptions({\n workflowRunId,\n runAttempt,\n live = false,\n}: RunAnnotationsQueryInput): RunAnnotationsQueryOptions {\n const enabled = Boolean(workflowRunId) && runAttempt !== undefined;\n\n // Polling stops once the reader has paged past the first page: the cursor bounding page 2 was\n // computed from page 1's last row, so a refetch that shifts that boundary can drop a range of\n // annotations into a between-pages gap.\n return infiniteQueryOptions({\n queryKey: workflowRunId\n ? runAnnotationsQueryKeys.list(workflowRunId, runAttempt)\n : ([...runAnnotationsQueryKeys.all, 'list'] as const),\n enabled,\n initialPageParam: undefined as string | undefined,\n queryFn: ({pageParam, signal}) =>\n listRunAnnotations({\n workflowRunId: workflowRunId ?? '',\n runAttempt: runAttempt ?? 1,\n cursor: pageParam,\n signal,\n }),\n getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined,\n staleTime: 2_000,\n refetchOnWindowFocus: true,\n refetchInterval: (query) => {\n if (!live) return false;\n const pages = query.state.data?.pages;\n return pages && pages.length > 1 ? false : ACTIVE_POLL_MS;\n },\n refetchIntervalInBackground: false,\n });\n}\n\nexport interface RunAnnotationsQueryResult {\n query: ReturnType<\n typeof useInfiniteQuery<\n RunAnnotationPage,\n Error,\n InfiniteData<RunAnnotationPage, string | undefined>,\n RunAnnotationsQueryKey,\n string | undefined\n >\n >;\n /** `undefined` until the first page resolves, so counts never render a speculative zero. */\n annotations: RunAnnotationRecord[] | undefined;\n summary: RunAnnotationSummary | undefined;\n}\n\nexport function useRunAnnotationsQuery(input: RunAnnotationsQueryInput): RunAnnotationsQueryResult {\n const query = useInfiniteQuery(runAnnotationsQueryOptions(input));\n const pages = query.data?.pages;\n\n const annotations = useMemo(\n () => (pages ? pages.flatMap((page) => page.annotations) : undefined),\n [pages],\n );\n const summary = useMemo(\n () =>\n annotations\n ? summarizeRunAnnotations(annotations, {truncated: pages?.at(-1)?.hasMore ?? false})\n : undefined,\n [annotations, pages],\n );\n\n return {query, annotations, summary};\n}\n"],"names":["READ_ANNOTATIONS_MAX_LIMIT","readAnnotationsResponseSchema","checkedApiRequest","infiniteQueryOptions","useInfiniteQuery","useMemo","summarizeRunAnnotations","toRunAnnotationPage","ACTIVE_POLL_MS","runAnnotationsQueryKeys","all","list","workflowRunId","runAttempt","listRunAnnotations","cursor","signal","params","URLSearchParams","workflow_run_id","attempt","String","limit","set","toString","runAnnotationsQueryOptions","live","enabled","Boolean","undefined","queryKey","initialPageParam","queryFn","pageParam","getNextPageParam","lastPage","nextCursor","staleTime","refetchOnWindowFocus","refetchInterval","query","pages","state","data","length","refetchIntervalInBackground","useRunAnnotationsQuery","input","annotations","flatMap","page","summary","truncated","at","hasMore"],"mappings":"AAAA,SAAQA,0BAA0B,EAAEC,6BAA6B,QAAO,2BAA2B;AACnG,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAEEC,oBAAoB,EAEpBC,gBAAgB,QACX,wBAAwB;AAC/B,SAAQC,OAAO,QAAO,QAAQ;AAC9B,SAGEC,uBAAuB,QAClB,0BAA0B;AACjC,SAAgCC,mBAAmB,QAAO,6BAA6B;AAEvF,kGAAkG,GAClG,MAAMC,iBAAiB;AAEvB,OAAO,MAAMC,0BAA0B;IACrCC,KAAK;QAAC;KAAkB;IACxBC,MAAM,CAACC,eAAuBC,aAC5B;eAAIJ,wBAAwBC,GAAG;YAAE;YAAQE;YAAeC,cAAc;SAAK;AAC/E,EAAE;AAcF,eAAeC,mBAAmB,EAChCF,aAAa,EACbC,UAAU,EACVE,MAAM,EACNC,MAAM,EAMP;IACC,MAAMC,SAAS,IA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C,cACI1C,wBAAwB0C,aAAa;YAACI,WAAWX,OAAOY,GAAG,CAAC,IAAIC,WAAW;QAAK,KAChFzB,WACN;QAACmB;QAAaP;KAAM;IAGtB,OAAO;QAACD;QAAOQ;QAAaG;IAAO;AACrC"}
|
|
@@ -9,7 +9,7 @@ export interface WorkflowRunFilters {
|
|
|
9
9
|
createdTo?: string | undefined;
|
|
10
10
|
}
|
|
11
11
|
export declare const workflowRunsQueryKeys: {
|
|
12
|
-
all: readonly [
|
|
12
|
+
all: readonly ['workflow-runs'];
|
|
13
13
|
lists: (projectId: string) => readonly ["workflow-runs", "list", string];
|
|
14
14
|
list: (projectId: string, filters: WorkflowRunFilters) => readonly ["workflow-runs", "list", string, {
|
|
15
15
|
status: WorkflowRunStatus | null;
|
|
@@ -58,13 +58,15 @@ export declare function useFireManualWorkflowMutation(): import("@tanstack/react
|
|
|
58
58
|
touchedQueryKeys: (readonly unknown[])[];
|
|
59
59
|
}>;
|
|
60
60
|
export declare function useWorkflowRunQuery(workflowRunId: string | undefined): import("@tanstack/react-query").UseQueryResult<NoInfer<WorkflowRunDetail>, Error>;
|
|
61
|
-
export declare function useWorkflowRunAttemptQuery({ workflowRunId, runAttempt, }: {
|
|
61
|
+
export declare function useWorkflowRunAttemptQuery({ workflowRunId, runAttempt, enabled, }: {
|
|
62
62
|
workflowRunId: string | undefined;
|
|
63
63
|
runAttempt?: number | undefined;
|
|
64
|
+
enabled?: boolean | undefined;
|
|
64
65
|
}): import("@tanstack/react-query").UseQueryResult<NoInfer<WorkflowRunDetail>, Error>;
|
|
65
|
-
export declare function workflowRunQueryOptions({ workflowRunId, runAttempt, }: {
|
|
66
|
+
export declare function workflowRunQueryOptions({ workflowRunId, runAttempt, enabled, }: {
|
|
66
67
|
workflowRunId: string | undefined;
|
|
67
68
|
runAttempt?: number | undefined;
|
|
69
|
+
enabled?: boolean | undefined;
|
|
68
70
|
}): WorkflowRunDetailQueryOptions;
|
|
69
71
|
export declare function useWorkflowRunAttemptsQuery({ workflowRunId, enabled, }: {
|
|
70
72
|
workflowRunId: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-runs.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/workflow-runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAM7B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EAKrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"workflow-runs.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/workflow-runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAM7B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EAKrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM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gB,uBAAuB,CAAC,EACtC,aAAa,EACb,UAAU,EACV,OAAc,GACf,EAAE;IACD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,GAAG,6BAA6B,CAmBhC;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,aAAa,EACb,OAAO,GACR,EAAE;IACD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,wFAEA;AAED,wBAAgB,+BAA+B,CAAC,EAC9C,aAAa,EACb,OAAO,GACR,EAAE;IACD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,+BAA+B,CAWlC;AAED,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,8FAgBxE"}
|
|
@@ -365,13 +365,14 @@ export function useWorkflowRunQuery(workflowRunId) {
|
|
|
365
365
|
runAttempt: undefined
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
export function useWorkflowRunAttemptQuery({ workflowRunId, runAttempt }) {
|
|
368
|
+
export function useWorkflowRunAttemptQuery({ workflowRunId, runAttempt, enabled = true }) {
|
|
369
369
|
return useQuery(workflowRunQueryOptions({
|
|
370
370
|
workflowRunId,
|
|
371
|
-
runAttempt
|
|
371
|
+
runAttempt,
|
|
372
|
+
enabled
|
|
372
373
|
}));
|
|
373
374
|
}
|
|
374
|
-
export function workflowRunQueryOptions({ workflowRunId, runAttempt }) {
|
|
375
|
+
export function workflowRunQueryOptions({ workflowRunId, runAttempt, enabled = true }) {
|
|
375
376
|
// Poll a non-terminal run so the open run detail stays live (same cadence as the run
|
|
376
377
|
// list); stop once the run is terminal.
|
|
377
378
|
return queryOptions({
|
|
@@ -379,7 +380,7 @@ export function workflowRunQueryOptions({ workflowRunId, runAttempt }) {
|
|
|
379
380
|
...workflowRunsQueryKeys.all,
|
|
380
381
|
'detail'
|
|
381
382
|
],
|
|
382
|
-
enabled: Boolean(workflowRunId),
|
|
383
|
+
enabled: Boolean(workflowRunId) && enabled,
|
|
383
384
|
queryFn: ({ signal })=>getWorkflowRun({
|
|
384
385
|
workflowRunId: workflowRunId ?? '',
|
|
385
386
|
runAttempt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/workflow-runs.ts"],"sourcesContent":["import {\n type RerunWorkflowRunBodyDto,\n type WorkflowRunRerunModeDto,\n workflowRunAttemptsResponseSchema,\n workflowRunDetailResponseSchema,\n workflowRunDtoSchema,\n workflowRunListResponseSchema,\n workflowRunResponseSchema,\n} from '@shipfox/api-workflows-dto';\nimport {checkedApiRequest, type StandardSchema} from '@shipfox/client-api';\nimport {\n type InfiniteData,\n infiniteQueryOptions,\n keepPreviousData,\n queryOptions,\n type UseInfiniteQueryOptions,\n type UseQueryOptions,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from '@tanstack/react-query';\nimport {\n isWorkflowRunTerminal,\n type ManualWorkflowLaunch,\n type WorkflowRun,\n type WorkflowRunAttempt,\n WorkflowRunAttemptSummary,\n type WorkflowRunDetail,\n type WorkflowRunListItem,\n type WorkflowRunListPage,\n type WorkflowRunRecord,\n type WorkflowRunStatus,\n} from '#core/workflow-run.js';\nimport {\n toWorkflowRunAttempt,\n toWorkflowRunDetail,\n toWorkflowRunListPage,\n toWorkflowRunRecord,\n} from './workflow-run-mapper.js';\n\nexport interface WorkflowRunFilters {\n status?: WorkflowRunStatus | undefined;\n definitionId?: string | undefined;\n triggerSource?: string | undefined;\n createdFrom?: string | undefined;\n createdTo?: string | undefined;\n}\n\nexport const workflowRunsQueryKeys = {\n all: ['workflow-runs'] as const,\n lists: (projectId: string) => [...workflowRunsQueryKeys.all, 'list', projectId] as const,\n list: (projectId: string, filters: WorkflowRunFilters) =>\n [...workflowRunsQueryKeys.lists(projectId), normalizeFilters(filters)] as const,\n detail: (workflowRunId: string, runAttempt?: number | undefined) =>\n [...workflowRunsQueryKeys.all, 'detail', workflowRunId, runAttempt ?? null] as const,\n attempts: (workflowRunId: string) =>\n [...workflowRunsQueryKeys.all, 'attempts', workflowRunId] as const,\n};\n\ntype WorkflowRunsListQueryKey =\n | ReturnType<typeof workflowRunsQueryKeys.list>\n | readonly ['workflow-runs', 'list'];\ntype WorkflowRunDetailQueryKey =\n | ReturnType<typeof workflowRunsQueryKeys.detail>\n | readonly ['workflow-runs', 'detail'];\ntype WorkflowRunAttemptsQueryKey =\n | ReturnType<typeof workflowRunsQueryKeys.attempts>\n | readonly ['workflow-runs', 'attempts'];\ntype WorkflowRunsInfiniteQueryOptions = UseInfiniteQueryOptions<\n WorkflowRunListPage,\n Error,\n InfiniteData<WorkflowRunListPage, string | undefined>,\n WorkflowRunsListQueryKey,\n string | undefined\n>;\ntype WorkflowRunDetailQueryOptions = UseQueryOptions<\n WorkflowRunDetail,\n Error,\n WorkflowRunDetail,\n WorkflowRunDetailQueryKey\n>;\ntype WorkflowRunAttemptsQueryOptions = UseQueryOptions<\n WorkflowRunAttempt[],\n Error,\n WorkflowRunAttempt[],\n WorkflowRunAttemptsQueryKey\n>;\n\nfunction normalizeFilters(filters: WorkflowRunFilters) {\n return {\n status: filters.status ?? null,\n definitionId: filters.definitionId ?? null,\n triggerSource: filters.triggerSource ?? null,\n createdFrom: filters.createdFrom ?? null,\n createdTo: filters.createdTo ?? null,\n };\n}\n\nfunction appendFilters(params: URLSearchParams, filters: WorkflowRunFilters) {\n if (filters.status) params.set('status', filters.status);\n if (filters.definitionId) params.set('definition_id', filters.definitionId);\n if (filters.triggerSource) params.set('trigger_source', filters.triggerSource);\n if (filters.createdFrom) params.set('created_from', filters.createdFrom);\n if (filters.createdTo) params.set('created_to', filters.createdTo);\n}\n\nasync function listWorkflowRuns({\n projectId,\n filters,\n limit = 50,\n cursor,\n signal,\n}: {\n projectId: string;\n filters: WorkflowRunFilters;\n limit?: number;\n cursor?: string | undefined;\n signal?: AbortSignal;\n}): Promise<WorkflowRunListPage> {\n const params = new URLSearchParams({project_id: projectId, limit: String(limit)});\n if (cursor) params.set('cursor', cursor);\n appendFilters(params, filters);\n const response = await checkedApiRequest(\n workflowRunListResponseSchema,\n `/workflows/runs?${params.toString()}`,\n {signal},\n );\n return toWorkflowRunListPage(response);\n}\n\n/**\n * Fire the manual trigger of a workflow definition.\n *\n * The server resolves the manual subscription by definition id (workflows\n * may declare at most one manual trigger). `inputs` are forwarded to the\n * run when provided.\n */\nexport async function fireManualWorkflow({\n definitionId,\n inputs,\n}: {\n definitionId: string;\n inputs?: Record<string, unknown>;\n}): Promise<ManualWorkflowLaunch> {\n const response = await checkedApiRequest(\n manualWorkflowResponseSchema,\n `/workflow-definitions/${definitionId}/fire-manual`,\n {\n method: 'POST',\n body: inputs ? {inputs} : {},\n },\n );\n return {workflowRunId: response.workflow_run_id};\n}\n\nconst ACTIVE_POLL_MS = 4_000;\nconst IDLE_POLL_MS = 30_000;\n\ntype RunListInfinite = InfiniteData<WorkflowRunListPage, string | undefined>;\n\nexport function useWorkflowRunsInfiniteQuery(\n projectId: string | undefined,\n filters: WorkflowRunFilters,\n limit = 50,\n) {\n return useInfiniteQuery(workflowRunsInfiniteQueryOptions(projectId, filters, limit));\n}\n\nexport function workflowRunsInfiniteQueryOptions(\n projectId: string | undefined,\n filters: WorkflowRunFilters,\n limit = 50,\n): WorkflowRunsInfiniteQueryOptions {\n // Polling is owned by react-query, not the page. Polling fast (4s) while\n // any non-terminal run is visible covers state transitions; polling slow\n // (30s) when idle covers brand-new external runs (webhook/schedule\n // triggers) without leaving the list stale.\n //\n // We disable polling once the user has loaded more than one page. With\n // cursor pagination the cursor that bounds page 1 was computed from\n // page 0's last row; if a refetch shifts that boundary, a small range\n // of rows can drop into a between-pages gap. Users who scrolled into\n // history opted into \"reading mode\": pause until they refocus, filter,\n // or scroll back.\n return infiniteQueryOptions({\n queryKey: projectId\n ? workflowRunsQueryKeys.list(projectId, filters)\n : ([...workflowRunsQueryKeys.all, 'list'] as const),\n enabled: Boolean(projectId),\n initialPageParam: undefined as string | undefined,\n queryFn: ({pageParam, signal}) =>\n listWorkflowRuns({projectId: projectId ?? '', filters, limit, cursor: pageParam, signal}),\n getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined,\n placeholderData: keepPreviousData,\n staleTime: 2_000,\n refetchOnWindowFocus: true,\n refetchInterval: (query) => {\n const data = query.state.data;\n if (!data || data.pages.length > 1) return false;\n const hasActive = data.pages.some((page) =>\n page.runs.some((run) => !isWorkflowRunTerminal(run.status)),\n );\n return hasActive ? ACTIVE_POLL_MS : IDLE_POLL_MS;\n },\n refetchIntervalInBackground: false,\n });\n}\n\nasync function getWorkflowRun({\n workflowRunId,\n runAttempt,\n signal,\n}: {\n workflowRunId: string;\n runAttempt?: number | undefined;\n signal?: AbortSignal;\n}): Promise<WorkflowRunDetail> {\n const params = new URLSearchParams();\n if (runAttempt) params.set('attempt', String(runAttempt));\n const query = params.size > 0 ? `?${params.toString()}` : '';\n return toWorkflowRunDetail(\n await checkedApiRequest(\n workflowRunDetailResponseSchema,\n `/workflows/runs/${workflowRunId}${query}`,\n {\n signal,\n },\n ),\n );\n}\n\nasync function getWorkflowRunAttempts({\n workflowRunId,\n signal,\n}: {\n workflowRunId: string;\n signal?: AbortSignal;\n}): Promise<WorkflowRunAttempt[]> {\n const response = await checkedApiRequest(\n workflowRunAttemptsResponseSchema,\n `/workflows/runs/${workflowRunId}/attempts`,\n {\n signal,\n },\n );\n return response.attempts.map(toWorkflowRunAttempt);\n}\n\nasync function cancelWorkflowRun({\n workflowRunId,\n}: {\n workflowRunId: string;\n}): Promise<WorkflowRunRecord> {\n return toWorkflowRunRecord(\n await checkedApiRequest(workflowRunDtoSchema, `/workflows/runs/${workflowRunId}/cancel`, {\n method: 'POST',\n }),\n );\n}\n\nexport async function rerunWorkflowRun({\n workflowRunId,\n mode,\n}: {\n workflowRunId: string;\n mode: WorkflowRunRerunModeDto;\n}): Promise<WorkflowRunRecord> {\n return toWorkflowRunRecord(\n await checkedApiRequest(workflowRunResponseSchema, `/workflows/runs/${workflowRunId}/rerun`, {\n method: 'POST',\n body: {mode} satisfies RerunWorkflowRunBodyDto,\n }),\n );\n}\n\nconst manualWorkflowResponseSchema: StandardSchema<unknown, {workflow_run_id: string}> = {\n '~standard': {\n version: 1,\n vendor: 'client-workflows',\n validate: (value) => {\n if (\n typeof value === 'object' &&\n value !== null &&\n 'workflow_run_id' in value &&\n typeof value.workflow_run_id === 'string'\n )\n return {value: {workflow_run_id: value.workflow_run_id}};\n return {issues: [{message: 'Expected workflow_run_id.'}]};\n },\n },\n};\n\nexport function useRerunWorkflowRunMutation(projectId: string) {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: rerunWorkflowRun,\n onSuccess: async (_run, variables) => {\n await Promise.all([\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.lists(projectId)}),\n queryClient.invalidateQueries({\n queryKey: workflowRunsQueryKeys.detail(variables.workflowRunId),\n }),\n queryClient.invalidateQueries({\n queryKey: workflowRunsQueryKeys.attempts(variables.workflowRunId),\n }),\n ]);\n },\n });\n}\n\nfunction filtersAcceptManualPendingRun(\n filters: WorkflowRunFilters,\n definitionId: string,\n now: Date,\n): boolean {\n if (filters.status && filters.status !== 'pending') return false;\n if (filters.definitionId && filters.definitionId !== definitionId) return false;\n if (filters.triggerSource && filters.triggerSource !== 'manual') return false;\n if (filters.createdFrom && Date.parse(filters.createdFrom) > now.getTime()) return false;\n if (filters.createdTo && Date.parse(filters.createdTo) < now.getTime()) return false;\n return true;\n}\n\nfunction buildTempRun({\n projectId,\n definitionId,\n name,\n createdAt,\n}: {\n projectId: string;\n definitionId: string;\n name: string;\n createdAt: string;\n}): WorkflowRunListItem {\n const id = `temp-${cryptoRandomId()}`;\n return {\n id,\n projectId,\n definitionId,\n number: null,\n name,\n workflowName: name,\n status: 'pending',\n currentAttempt: 1,\n latestAttempt: 1,\n triggerProvider: null,\n triggerSource: 'manual',\n triggerEvent: 'fire',\n triggerPayload: {source: 'manual', event: 'fire'},\n triggerDisplayLabel: 'fire',\n triggerLabel: 'manual · fire',\n triggerReference: null,\n inputs: null,\n sourceSnapshot: null,\n createdAt,\n updatedAt: createdAt,\n isTemporary: true,\n // The optimistic row genuinely has no jobs yet: the server has not planned the graph.\n jobs: {preview: [], statusCounts: [], total: 0},\n runAttempt: new WorkflowRunAttemptSummary({\n workflowRunId: id,\n attempt: 1,\n status: 'pending',\n createdAt,\n startedAt: null,\n finishedAt: null,\n }),\n };\n}\n\nfunction cryptoRandomId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return `${Date.now()}-${Math.random().toString(36).slice(2)}`;\n}\n\nexport interface FireManualWorkflowVariables {\n projectId: string;\n definitionId: string;\n inputs?: Record<string, unknown>;\n}\n\nexport function useFireManualWorkflowMutation() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (variables: FireManualWorkflowVariables) =>\n fireManualWorkflow(\n variables.inputs\n ? {definitionId: variables.definitionId, inputs: variables.inputs}\n : {definitionId: variables.definitionId},\n ),\n onMutate: (variables) => {\n const definitionName = lookupDefinitionName(\n queryClient,\n variables.projectId,\n variables.definitionId,\n );\n const createdAt = new Date().toISOString();\n const tempRun = buildTempRun({\n projectId: variables.projectId,\n definitionId: variables.definitionId,\n name: definitionName ?? 'New run',\n createdAt,\n });\n\n const listsKey = workflowRunsQueryKeys.lists(variables.projectId);\n const touchedQueryKeys: Array<readonly unknown[]> = [];\n\n const entries = queryClient.getQueriesData<RunListInfinite>({queryKey: listsKey});\n const now = new Date(createdAt);\n for (const [queryKey] of entries) {\n const filters = readFiltersFromKey(queryKey);\n if (!filters) continue;\n if (!filtersAcceptManualPendingRun(filters, variables.definitionId, now)) continue;\n\n touchedQueryKeys.push(queryKey);\n queryClient.setQueryData<RunListInfinite>(queryKey, (current) => {\n if (!current || current.pages.length === 0) return current;\n const firstPage = current.pages[0];\n if (!firstPage) return current;\n const nextFirstPage: WorkflowRunListPage = {\n ...firstPage,\n runs: [tempRun, ...firstPage.runs],\n filteredTotalCount:\n firstPage.filteredTotalCount != null ? firstPage.filteredTotalCount + 1 : null,\n };\n return {...current, pages: [nextFirstPage, ...current.pages.slice(1)]};\n });\n }\n\n return {tempWorkflowRunId: tempRun.id, touchedQueryKeys};\n },\n onError: (_error, _variables, context) => {\n if (!context) return;\n for (const queryKey of context.touchedQueryKeys) {\n queryClient.setQueryData<RunListInfinite>(queryKey, (current) => {\n if (!current) return current;\n let removedCount = 0;\n const pages = current.pages.map((page) => {\n const runs = page.runs.filter((run) => {\n if (run.id !== context.tempWorkflowRunId) return true;\n removedCount += 1;\n return false;\n });\n if (runs.length === page.runs.length) return page;\n return {\n ...page,\n runs,\n filteredTotalCount:\n page.filteredTotalCount != null\n ? Math.max(0, page.filteredTotalCount - removedCount)\n : null,\n };\n });\n if (removedCount === 0) return current;\n return {...current, pages};\n });\n }\n },\n onSuccess: (_data, variables) => {\n void queryClient.invalidateQueries({\n queryKey: workflowRunsQueryKeys.lists(variables.projectId),\n });\n },\n });\n}\n\nfunction readFiltersFromKey(queryKey: readonly unknown[]): WorkflowRunFilters | null {\n if (queryKey.length < 4) return null;\n const normalized = queryKey[3];\n if (!normalized || typeof normalized !== 'object') return null;\n const obj = normalized as Record<string, unknown>;\n return {\n status: (obj.status as WorkflowRunStatus | null) ?? undefined,\n definitionId: (obj.definitionId as string | null) ?? undefined,\n triggerSource: (obj.triggerSource as string | null) ?? undefined,\n createdFrom: (obj.createdFrom as string | null) ?? undefined,\n createdTo: (obj.createdTo as string | null) ?? undefined,\n };\n}\n\nfunction lookupDefinitionName(\n queryClient: ReturnType<typeof useQueryClient>,\n projectId: string,\n definitionId: string,\n): string | undefined {\n const entries = queryClient.getQueriesData<\n InfiniteData<{definitions: Array<{id: string; name: string}>}>\n >({queryKey: ['definitions', 'list', projectId]});\n for (const [, data] of entries) {\n if (!data) continue;\n for (const page of data.pages) {\n const match = page.definitions.find((d) => d.id === definitionId);\n if (match) return match.name;\n }\n }\n return undefined;\n}\n\nexport function useWorkflowRunQuery(workflowRunId: string | undefined) {\n return useWorkflowRunAttemptQuery({workflowRunId, runAttempt: undefined});\n}\n\nexport function useWorkflowRunAttemptQuery({\n workflowRunId,\n runAttempt,\n}: {\n workflowRunId: string | undefined;\n runAttempt?: number | undefined;\n}) {\n return useQuery(workflowRunQueryOptions({workflowRunId, runAttempt}));\n}\n\nexport function workflowRunQueryOptions({\n workflowRunId,\n runAttempt,\n}: {\n workflowRunId: string | undefined;\n runAttempt?: number | undefined;\n}): WorkflowRunDetailQueryOptions {\n // Poll a non-terminal run so the open run detail stays live (same cadence as the run\n // list); stop once the run is terminal.\n return queryOptions({\n queryKey: workflowRunId\n ? workflowRunsQueryKeys.detail(workflowRunId, runAttempt)\n : ([...workflowRunsQueryKeys.all, 'detail'] as const),\n enabled: Boolean(workflowRunId),\n queryFn: ({signal}) => getWorkflowRun({workflowRunId: workflowRunId ?? '', runAttempt, signal}),\n staleTime: 2_000,\n refetchOnWindowFocus: true,\n refetchInterval: (query) => {\n const status: WorkflowRunDetail['runAttempt']['status'] | undefined =\n query.state.data?.runAttempt.status;\n if (!status) return false;\n return isWorkflowRunTerminal(status) ? false : ACTIVE_POLL_MS;\n },\n refetchIntervalInBackground: false,\n });\n}\n\nexport function useWorkflowRunAttemptsQuery({\n workflowRunId,\n enabled,\n}: {\n workflowRunId: string | undefined;\n enabled: boolean;\n}) {\n return useQuery(workflowRunAttemptsQueryOptions({workflowRunId, enabled}));\n}\n\nexport function workflowRunAttemptsQueryOptions({\n workflowRunId,\n enabled,\n}: {\n workflowRunId: string | undefined;\n enabled: boolean;\n}): WorkflowRunAttemptsQueryOptions {\n return queryOptions({\n queryKey: workflowRunId\n ? workflowRunsQueryKeys.attempts(workflowRunId)\n : ([...workflowRunsQueryKeys.all, 'attempts'] as const),\n enabled: Boolean(workflowRunId) && enabled,\n queryFn: ({signal}) => getWorkflowRunAttempts({workflowRunId: workflowRunId ?? '', signal}),\n staleTime: 0,\n refetchOnMount: true,\n refetchOnWindowFocus: false,\n });\n}\n\nexport function useCancelWorkflowRunMutation(run: WorkflowRun | undefined) {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (): Promise<WorkflowRunRecord> => {\n if (!run) throw new Error('Workflow run is not loaded');\n return await cancelWorkflowRun({workflowRunId: run.id});\n },\n onSuccess: async () => {\n if (!run) return;\n await Promise.all([\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.detail(run.id)}),\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.lists(run.projectId)}),\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.attempts(run.id)}),\n ]);\n },\n });\n}\n"],"names":["workflowRunAttemptsResponseSchema","workflowRunDetailResponseSchema","workflowRunDtoSchema","workflowRunListResponseSchema","workflowRunResponseSchema","checkedApiRequest","infiniteQueryOptions","keepPreviousData","queryOptions","useInfiniteQuery","useMutation","useQuery","useQueryClient","isWorkflowRunTerminal","WorkflowRunAttemptSummary","toWorkflowRunAttempt","toWorkflowRunDetail","toWorkflowRunListPage","toWorkflowRunRecord","workflowRunsQueryKeys","all","lists","projectId","list","filters","normalizeFilters","detail","workflowRunId","runAttempt","attempts","status","definitionId","triggerSource","createdFrom","createdTo","appendFilters","params","set","listWorkflowRuns","limit","cursor","signal","URLSearchParams","project_id","String","response","toString","fireManualWorkflow","inputs","manualWorkflowResponseSchema","method","body","workflow_run_id","ACTIVE_POLL_MS","IDLE_POLL_MS","useWorkflowRunsInfiniteQuery","workflowRunsInfiniteQueryOptions","queryKey","enabled","Boolean","initialPageParam","undefined","queryFn","pageParam","getNextPageParam","lastPage","nextCursor","placeholderData","staleTime","refetchOnWindowFocus","refetchInterval","query","data","state","pages","length","hasActive","some","page","runs","run","refetchIntervalInBackground","getWorkflowRun","size","getWorkflowRunAttempts","map","cancelWorkflowRun","rerunWorkflowRun","mode","version","vendor","validate","value","issues","message","useRerunWorkflowRunMutation","queryClient","mutationFn","onSuccess","_run","variables","Promise","invalidateQueries","filtersAcceptManualPendingRun","now","Date","parse","getTime","buildTempRun","name","createdAt","id","cryptoRandomId","number","workflowName","currentAttempt","latestAttempt","triggerProvider","triggerEvent","triggerPayload","source","event","triggerDisplayLabel","triggerLabel","triggerReference","sourceSnapshot","updatedAt","isTemporary","jobs","preview","statusCounts","total","attempt","startedAt","finishedAt","crypto","randomUUID","Math","random","slice","useFireManualWorkflowMutation","onMutate","definitionName","lookupDefinitionName","toISOString","tempRun","listsKey","touchedQueryKeys","entries","getQueriesData","readFiltersFromKey","push","setQueryData","current","firstPage","nextFirstPage","filteredTotalCount","tempWorkflowRunId","onError","_error","_variables","context","removedCount","filter","max","_data","normalized","obj","match","definitions","find","d","useWorkflowRunQuery","useWorkflowRunAttemptQuery","workflowRunQueryOptions","useWorkflowRunAttemptsQuery","workflowRunAttemptsQueryOptions","refetchOnMount","useCancelWorkflowRunMutation","Error"],"mappings":"AAAA,SAGEA,iCAAiC,EACjCC,+BAA+B,EAC/BC,oBAAoB,EACpBC,6BAA6B,EAC7BC,yBAAyB,QACpB,6BAA6B;AACpC,SAAQC,iBAAiB,QAA4B,sBAAsB;AAC3E,SAEEC,oBAAoB,EACpBC,gBAAgB,EAChBC,YAAY,EAGZC,gBAAgB,EAChBC,WAAW,EACXC,QAAQ,EACRC,cAAc,QACT,wBAAwB;AAC/B,SACEC,qBAAqB,EAIrBC,yBAAyB,QAMpB,wBAAwB;AAC/B,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,qBAAqB,EACrBC,mBAAmB,QACd,2BAA2B;AAUlC,OAAO,MAAMC,wBAAwB;IACnCC,KAAK;QAAC;KAAgB;IACtBC,OAAO,CAACC,YAAsB;eAAIH,sBAAsBC,GAAG;YAAE;YAAQE;SAAU;IAC/EC,MAAM,CAACD,WAAmBE,UACxB;eAAIL,sBAAsB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ASqK,gCAAgC;QAACrJ;QAAe+B;IAAO;AACzE;AAEA,OAAO,SAASsH,gCAAgC,EAC9CrJ,aAAa,EACb+B,OAAO,EAIR;IACC,OAAOlD,aAAa;QAClBiD,UAAU9B,gBACNR,sBAAsBU,QAAQ,CAACF,iBAC9B;eAAIR,sBAAsBC,GAAG;YAAE;SAAW;QAC/CsC,SAASC,QAAQhC,kBAAkB+B;QACnCI,SAAS,CAAC,EAACrB,MAAM,EAAC,GAAK2C,uBAAuB;gBAACzD,eAAeA,iBAAiB;gBAAIc;YAAM;QACzF2B,WAAW;QACX6G,gBAAgB;QAChB5G,sBAAsB;IACxB;AACF;AAEA,OAAO,SAAS6G,6BAA6BlG,GAA4B;IACvE,MAAMgB,cAAcpF;IACpB,OAAOF,YAAY;QACjBuF,YAAY;YACV,IAAI,CAACjB,KAAK,MAAM,IAAImG,MAAM;YAC1B,OAAO,MAAM7F,kBAAkB;gBAAC3D,eAAeqD,IAAI+B,EAAE;YAAA;QACvD;QACAb,WAAW;YACT,IAAI,CAAClB,KAAK;YACV,MAAMqB,QAAQjF,GAAG,CAAC;gBAChB4E,YAAYM,iBAAiB,CAAC;oBAAC7C,UAAUtC,sBAAsBO,MAAM,CAACsD,IAAI+B,EAAE;gBAAC;gBAC7Ef,YAAYM,iBAAiB,CAAC;oBAAC7C,UAAUtC,sBAAsBE,KAAK,CAAC2D,IAAI1D,SAAS;gBAAC;gBACnF0E,YAAYM,iBAAiB,CAAC;oBAAC7C,UAAUtC,sBAAsBU,QAAQ,CAACmD,IAAI+B,EAAE;gBAAC;aAChF;QACH;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/workflow-runs.ts"],"sourcesContent":["import {\n type RerunWorkflowRunBodyDto,\n type WorkflowRunRerunModeDto,\n workflowRunAttemptsResponseSchema,\n workflowRunDetailResponseSchema,\n workflowRunDtoSchema,\n workflowRunListResponseSchema,\n workflowRunResponseSchema,\n} from '@shipfox/api-workflows-dto';\nimport {checkedApiRequest, type StandardSchema} from '@shipfox/client-api';\nimport {\n type InfiniteData,\n infiniteQueryOptions,\n keepPreviousData,\n queryOptions,\n type UseInfiniteQueryOptions,\n type UseQueryOptions,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from '@tanstack/react-query';\nimport {\n isWorkflowRunTerminal,\n type ManualWorkflowLaunch,\n type WorkflowRun,\n type WorkflowRunAttempt,\n WorkflowRunAttemptSummary,\n type WorkflowRunDetail,\n type WorkflowRunListItem,\n type WorkflowRunListPage,\n type WorkflowRunRecord,\n type WorkflowRunStatus,\n} from '#core/workflow-run.js';\nimport {\n toWorkflowRunAttempt,\n toWorkflowRunDetail,\n toWorkflowRunListPage,\n toWorkflowRunRecord,\n} from './workflow-run-mapper.js';\n\nexport interface WorkflowRunFilters {\n status?: WorkflowRunStatus | undefined;\n definitionId?: string | undefined;\n triggerSource?: string | undefined;\n createdFrom?: string | undefined;\n createdTo?: string | undefined;\n}\n\nexport const workflowRunsQueryKeys = {\n all: ['workflow-runs'] as const,\n lists: (projectId: string) => [...workflowRunsQueryKeys.all, 'list', projectId] as const,\n list: (projectId: string, filters: WorkflowRunFilters) =>\n [...workflowRunsQueryKeys.lists(projectId), normalizeFilters(filters)] as const,\n detail: (workflowRunId: string, runAttempt?: number | undefined) =>\n [...workflowRunsQueryKeys.all, 'detail', workflowRunId, runAttempt ?? null] as const,\n attempts: (workflowRunId: string) =>\n [...workflowRunsQueryKeys.all, 'attempts', workflowRunId] as const,\n};\n\ntype WorkflowRunsListQueryKey =\n | ReturnType<typeof workflowRunsQueryKeys.list>\n | readonly ['workflow-runs', 'list'];\ntype WorkflowRunDetailQueryKey =\n | ReturnType<typeof workflowRunsQueryKeys.detail>\n | readonly ['workflow-runs', 'detail'];\ntype WorkflowRunAttemptsQueryKey =\n | ReturnType<typeof workflowRunsQueryKeys.attempts>\n | readonly ['workflow-runs', 'attempts'];\ntype WorkflowRunsInfiniteQueryOptions = UseInfiniteQueryOptions<\n WorkflowRunListPage,\n Error,\n InfiniteData<WorkflowRunListPage, string | undefined>,\n WorkflowRunsListQueryKey,\n string | undefined\n>;\ntype WorkflowRunDetailQueryOptions = UseQueryOptions<\n WorkflowRunDetail,\n Error,\n WorkflowRunDetail,\n WorkflowRunDetailQueryKey\n>;\ntype WorkflowRunAttemptsQueryOptions = UseQueryOptions<\n WorkflowRunAttempt[],\n Error,\n WorkflowRunAttempt[],\n WorkflowRunAttemptsQueryKey\n>;\n\nfunction normalizeFilters(filters: WorkflowRunFilters) {\n return {\n status: filters.status ?? null,\n definitionId: filters.definitionId ?? null,\n triggerSource: filters.triggerSource ?? null,\n createdFrom: filters.createdFrom ?? null,\n createdTo: filters.createdTo ?? null,\n };\n}\n\nfunction appendFilters(params: URLSearchParams, filters: WorkflowRunFilters) {\n if (filters.status) params.set('status', filters.status);\n if (filters.definitionId) params.set('definition_id', filters.definitionId);\n if (filters.triggerSource) params.set('trigger_source', filters.triggerSource);\n if (filters.createdFrom) params.set('created_from', filters.createdFrom);\n if (filters.createdTo) params.set('created_to', filters.createdTo);\n}\n\nasync function listWorkflowRuns({\n projectId,\n filters,\n limit = 50,\n cursor,\n signal,\n}: {\n projectId: string;\n filters: WorkflowRunFilters;\n limit?: number;\n cursor?: string | undefined;\n signal?: AbortSignal;\n}): Promise<WorkflowRunListPage> {\n const params = new URLSearchParams({project_id: projectId, limit: String(limit)});\n if (cursor) params.set('cursor', cursor);\n appendFilters(params, filters);\n const response = await checkedApiRequest(\n workflowRunListResponseSchema,\n `/workflows/runs?${params.toString()}`,\n {signal},\n );\n return toWorkflowRunListPage(response);\n}\n\n/**\n * Fire the manual trigger of a workflow definition.\n *\n * The server resolves the manual subscription by definition id (workflows\n * may declare at most one manual trigger). `inputs` are forwarded to the\n * run when provided.\n */\nexport async function fireManualWorkflow({\n definitionId,\n inputs,\n}: {\n definitionId: string;\n inputs?: Record<string, unknown>;\n}): Promise<ManualWorkflowLaunch> {\n const response = await checkedApiRequest(\n manualWorkflowResponseSchema,\n `/workflow-definitions/${definitionId}/fire-manual`,\n {\n method: 'POST',\n body: inputs ? {inputs} : {},\n },\n );\n return {workflowRunId: response.workflow_run_id};\n}\n\nconst ACTIVE_POLL_MS = 4_000;\nconst IDLE_POLL_MS = 30_000;\n\ntype RunListInfinite = InfiniteData<WorkflowRunListPage, string | undefined>;\n\nexport function useWorkflowRunsInfiniteQuery(\n projectId: string | undefined,\n filters: WorkflowRunFilters,\n limit = 50,\n) {\n return useInfiniteQuery(workflowRunsInfiniteQueryOptions(projectId, filters, limit));\n}\n\nexport function workflowRunsInfiniteQueryOptions(\n projectId: string | undefined,\n filters: WorkflowRunFilters,\n limit = 50,\n): WorkflowRunsInfiniteQueryOptions {\n // Polling is owned by react-query, not the page. Polling fast (4s) while\n // any non-terminal run is visible covers state transitions; polling slow\n // (30s) when idle covers brand-new external runs (webhook/schedule\n // triggers) without leaving the list stale.\n //\n // We disable polling once the user has loaded more than one page. With\n // cursor pagination the cursor that bounds page 1 was computed from\n // page 0's last row; if a refetch shifts that boundary, a small range\n // of rows can drop into a between-pages gap. Users who scrolled into\n // history opted into \"reading mode\": pause until they refocus, filter,\n // or scroll back.\n return infiniteQueryOptions({\n queryKey: projectId\n ? workflowRunsQueryKeys.list(projectId, filters)\n : ([...workflowRunsQueryKeys.all, 'list'] as const),\n enabled: Boolean(projectId),\n initialPageParam: undefined as string | undefined,\n queryFn: ({pageParam, signal}) =>\n listWorkflowRuns({projectId: projectId ?? '', filters, limit, cursor: pageParam, signal}),\n getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined,\n placeholderData: keepPreviousData,\n staleTime: 2_000,\n refetchOnWindowFocus: true,\n refetchInterval: (query) => {\n const data = query.state.data;\n if (!data || data.pages.length > 1) return false;\n const hasActive = data.pages.some((page) =>\n page.runs.some((run) => !isWorkflowRunTerminal(run.status)),\n );\n return hasActive ? ACTIVE_POLL_MS : IDLE_POLL_MS;\n },\n refetchIntervalInBackground: false,\n });\n}\n\nasync function getWorkflowRun({\n workflowRunId,\n runAttempt,\n signal,\n}: {\n workflowRunId: string;\n runAttempt?: number | undefined;\n signal?: AbortSignal;\n}): Promise<WorkflowRunDetail> {\n const params = new URLSearchParams();\n if (runAttempt) params.set('attempt', String(runAttempt));\n const query = params.size > 0 ? `?${params.toString()}` : '';\n return toWorkflowRunDetail(\n await checkedApiRequest(\n workflowRunDetailResponseSchema,\n `/workflows/runs/${workflowRunId}${query}`,\n {\n signal,\n },\n ),\n );\n}\n\nasync function getWorkflowRunAttempts({\n workflowRunId,\n signal,\n}: {\n workflowRunId: string;\n signal?: AbortSignal;\n}): Promise<WorkflowRunAttempt[]> {\n const response = await checkedApiRequest(\n workflowRunAttemptsResponseSchema,\n `/workflows/runs/${workflowRunId}/attempts`,\n {\n signal,\n },\n );\n return response.attempts.map(toWorkflowRunAttempt);\n}\n\nasync function cancelWorkflowRun({\n workflowRunId,\n}: {\n workflowRunId: string;\n}): Promise<WorkflowRunRecord> {\n return toWorkflowRunRecord(\n await checkedApiRequest(workflowRunDtoSchema, `/workflows/runs/${workflowRunId}/cancel`, {\n method: 'POST',\n }),\n );\n}\n\nexport async function rerunWorkflowRun({\n workflowRunId,\n mode,\n}: {\n workflowRunId: string;\n mode: WorkflowRunRerunModeDto;\n}): Promise<WorkflowRunRecord> {\n return toWorkflowRunRecord(\n await checkedApiRequest(workflowRunResponseSchema, `/workflows/runs/${workflowRunId}/rerun`, {\n method: 'POST',\n body: {mode} satisfies RerunWorkflowRunBodyDto,\n }),\n );\n}\n\nconst manualWorkflowResponseSchema: StandardSchema<unknown, {workflow_run_id: string}> = {\n '~standard': {\n version: 1,\n vendor: 'client-workflows',\n validate: (value) => {\n if (\n typeof value === 'object' &&\n value !== null &&\n 'workflow_run_id' in value &&\n typeof value.workflow_run_id === 'string'\n )\n return {value: {workflow_run_id: value.workflow_run_id}};\n return {issues: [{message: 'Expected workflow_run_id.'}]};\n },\n },\n};\n\nexport function useRerunWorkflowRunMutation(projectId: string) {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: rerunWorkflowRun,\n onSuccess: async (_run, variables) => {\n await Promise.all([\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.lists(projectId)}),\n queryClient.invalidateQueries({\n queryKey: workflowRunsQueryKeys.detail(variables.workflowRunId),\n }),\n queryClient.invalidateQueries({\n queryKey: workflowRunsQueryKeys.attempts(variables.workflowRunId),\n }),\n ]);\n },\n });\n}\n\nfunction filtersAcceptManualPendingRun(\n filters: WorkflowRunFilters,\n definitionId: string,\n now: Date,\n): boolean {\n if (filters.status && filters.status !== 'pending') return false;\n if (filters.definitionId && filters.definitionId !== definitionId) return false;\n if (filters.triggerSource && filters.triggerSource !== 'manual') return false;\n if (filters.createdFrom && Date.parse(filters.createdFrom) > now.getTime()) return false;\n if (filters.createdTo && Date.parse(filters.createdTo) < now.getTime()) return false;\n return true;\n}\n\nfunction buildTempRun({\n projectId,\n definitionId,\n name,\n createdAt,\n}: {\n projectId: string;\n definitionId: string;\n name: string;\n createdAt: string;\n}): WorkflowRunListItem {\n const id = `temp-${cryptoRandomId()}`;\n return {\n id,\n projectId,\n definitionId,\n number: null,\n name,\n workflowName: name,\n status: 'pending',\n currentAttempt: 1,\n latestAttempt: 1,\n triggerProvider: null,\n triggerSource: 'manual',\n triggerEvent: 'fire',\n triggerPayload: {source: 'manual', event: 'fire'},\n triggerDisplayLabel: 'fire',\n triggerLabel: 'manual · fire',\n triggerReference: null,\n inputs: null,\n sourceSnapshot: null,\n createdAt,\n updatedAt: createdAt,\n isTemporary: true,\n // The optimistic row genuinely has no jobs yet: the server has not planned the graph.\n jobs: {preview: [], statusCounts: [], total: 0},\n runAttempt: new WorkflowRunAttemptSummary({\n workflowRunId: id,\n attempt: 1,\n status: 'pending',\n createdAt,\n startedAt: null,\n finishedAt: null,\n }),\n };\n}\n\nfunction cryptoRandomId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return `${Date.now()}-${Math.random().toString(36).slice(2)}`;\n}\n\nexport interface FireManualWorkflowVariables {\n projectId: string;\n definitionId: string;\n inputs?: Record<string, unknown>;\n}\n\nexport function useFireManualWorkflowMutation() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (variables: FireManualWorkflowVariables) =>\n fireManualWorkflow(\n variables.inputs\n ? {definitionId: variables.definitionId, inputs: variables.inputs}\n : {definitionId: variables.definitionId},\n ),\n onMutate: (variables) => {\n const definitionName = lookupDefinitionName(\n queryClient,\n variables.projectId,\n variables.definitionId,\n );\n const createdAt = new Date().toISOString();\n const tempRun = buildTempRun({\n projectId: variables.projectId,\n definitionId: variables.definitionId,\n name: definitionName ?? 'New run',\n createdAt,\n });\n\n const listsKey = workflowRunsQueryKeys.lists(variables.projectId);\n const touchedQueryKeys: Array<readonly unknown[]> = [];\n\n const entries = queryClient.getQueriesData<RunListInfinite>({queryKey: listsKey});\n const now = new Date(createdAt);\n for (const [queryKey] of entries) {\n const filters = readFiltersFromKey(queryKey);\n if (!filters) continue;\n if (!filtersAcceptManualPendingRun(filters, variables.definitionId, now)) continue;\n\n touchedQueryKeys.push(queryKey);\n queryClient.setQueryData<RunListInfinite>(queryKey, (current) => {\n if (!current || current.pages.length === 0) return current;\n const firstPage = current.pages[0];\n if (!firstPage) return current;\n const nextFirstPage: WorkflowRunListPage = {\n ...firstPage,\n runs: [tempRun, ...firstPage.runs],\n filteredTotalCount:\n firstPage.filteredTotalCount != null ? firstPage.filteredTotalCount + 1 : null,\n };\n return {...current, pages: [nextFirstPage, ...current.pages.slice(1)]};\n });\n }\n\n return {tempWorkflowRunId: tempRun.id, touchedQueryKeys};\n },\n onError: (_error, _variables, context) => {\n if (!context) return;\n for (const queryKey of context.touchedQueryKeys) {\n queryClient.setQueryData<RunListInfinite>(queryKey, (current) => {\n if (!current) return current;\n let removedCount = 0;\n const pages = current.pages.map((page) => {\n const runs = page.runs.filter((run) => {\n if (run.id !== context.tempWorkflowRunId) return true;\n removedCount += 1;\n return false;\n });\n if (runs.length === page.runs.length) return page;\n return {\n ...page,\n runs,\n filteredTotalCount:\n page.filteredTotalCount != null\n ? Math.max(0, page.filteredTotalCount - removedCount)\n : null,\n };\n });\n if (removedCount === 0) return current;\n return {...current, pages};\n });\n }\n },\n onSuccess: (_data, variables) => {\n void queryClient.invalidateQueries({\n queryKey: workflowRunsQueryKeys.lists(variables.projectId),\n });\n },\n });\n}\n\nfunction readFiltersFromKey(queryKey: readonly unknown[]): WorkflowRunFilters | null {\n if (queryKey.length < 4) return null;\n const normalized = queryKey[3];\n if (!normalized || typeof normalized !== 'object') return null;\n const obj = normalized as Record<string, unknown>;\n return {\n status: (obj.status as WorkflowRunStatus | null) ?? undefined,\n definitionId: (obj.definitionId as string | null) ?? undefined,\n triggerSource: (obj.triggerSource as string | null) ?? undefined,\n createdFrom: (obj.createdFrom as string | null) ?? undefined,\n createdTo: (obj.createdTo as string | null) ?? undefined,\n };\n}\n\nfunction lookupDefinitionName(\n queryClient: ReturnType<typeof useQueryClient>,\n projectId: string,\n definitionId: string,\n): string | undefined {\n const entries = queryClient.getQueriesData<\n InfiniteData<{definitions: Array<{id: string; name: string}>}>\n >({queryKey: ['definitions', 'list', projectId]});\n for (const [, data] of entries) {\n if (!data) continue;\n for (const page of data.pages) {\n const match = page.definitions.find((d) => d.id === definitionId);\n if (match) return match.name;\n }\n }\n return undefined;\n}\n\nexport function useWorkflowRunQuery(workflowRunId: string | undefined) {\n return useWorkflowRunAttemptQuery({workflowRunId, runAttempt: undefined});\n}\n\nexport function useWorkflowRunAttemptQuery({\n workflowRunId,\n runAttempt,\n enabled = true,\n}: {\n workflowRunId: string | undefined;\n runAttempt?: number | undefined;\n enabled?: boolean | undefined;\n}) {\n return useQuery(workflowRunQueryOptions({workflowRunId, runAttempt, enabled}));\n}\n\nexport function workflowRunQueryOptions({\n workflowRunId,\n runAttempt,\n enabled = true,\n}: {\n workflowRunId: string | undefined;\n runAttempt?: number | undefined;\n enabled?: boolean | undefined;\n}): WorkflowRunDetailQueryOptions {\n // Poll a non-terminal run so the open run detail stays live (same cadence as the run\n // list); stop once the run is terminal.\n return queryOptions({\n queryKey: workflowRunId\n ? workflowRunsQueryKeys.detail(workflowRunId, runAttempt)\n : ([...workflowRunsQueryKeys.all, 'detail'] as const),\n enabled: Boolean(workflowRunId) && enabled,\n queryFn: ({signal}) => getWorkflowRun({workflowRunId: workflowRunId ?? '', runAttempt, signal}),\n staleTime: 2_000,\n refetchOnWindowFocus: true,\n refetchInterval: (query) => {\n const status: WorkflowRunDetail['runAttempt']['status'] | undefined =\n query.state.data?.runAttempt.status;\n if (!status) return false;\n return isWorkflowRunTerminal(status) ? false : ACTIVE_POLL_MS;\n },\n refetchIntervalInBackground: false,\n });\n}\n\nexport function useWorkflowRunAttemptsQuery({\n workflowRunId,\n enabled,\n}: {\n workflowRunId: string | undefined;\n enabled: boolean;\n}) {\n return useQuery(workflowRunAttemptsQueryOptions({workflowRunId, enabled}));\n}\n\nexport function workflowRunAttemptsQueryOptions({\n workflowRunId,\n enabled,\n}: {\n workflowRunId: string | undefined;\n enabled: boolean;\n}): WorkflowRunAttemptsQueryOptions {\n return queryOptions({\n queryKey: workflowRunId\n ? workflowRunsQueryKeys.attempts(workflowRunId)\n : ([...workflowRunsQueryKeys.all, 'attempts'] as const),\n enabled: Boolean(workflowRunId) && enabled,\n queryFn: ({signal}) => getWorkflowRunAttempts({workflowRunId: workflowRunId ?? '', signal}),\n staleTime: 0,\n refetchOnMount: true,\n refetchOnWindowFocus: false,\n });\n}\n\nexport function useCancelWorkflowRunMutation(run: WorkflowRun | undefined) {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (): Promise<WorkflowRunRecord> => {\n if (!run) throw new Error('Workflow run is not loaded');\n return await cancelWorkflowRun({workflowRunId: run.id});\n },\n onSuccess: async () => {\n if (!run) return;\n await Promise.all([\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.detail(run.id)}),\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.lists(run.projectId)}),\n queryClient.invalidateQueries({queryKey: workflowRunsQueryKeys.attempts(run.id)}),\n ]);\n },\n });\n}\n"],"names":["workflowRunAttemptsResponseSchema","workflowRunDetailResponseSchema","workflowRunDtoSchema","workflowRunListResponseSchema","workflowRunResponseSchema","checkedApiRequest","infiniteQueryOptions","keepPreviousData","queryOptions","useInfiniteQuery","useMutation","useQuery","useQueryClient","isWorkflowRunTerminal","WorkflowRunAttemptSummary","toWorkflowRunAttempt","toWorkflowRunDetail","toWorkflowRunListPage","toWorkflowRunRecord","workflowRunsQueryKeys","all","lists","projectId","list","filters","normalizeFilters","detail","workflowRunId","runAttempt","attempts","status","definitionId","triggerSource","createdFrom","createdTo","appendFilters","params","set","listWorkflowRuns","limit","cursor","signal","URLSearchParams","project_id","String","response","toString","fireManualWorkflow","inputs","manualWorkflowResponseSchema","method","body","workflow_run_id","ACTIVE_POLL_MS","IDLE_POLL_MS","useWorkflowRunsInfiniteQuery","workflowRunsInfiniteQueryOptions","queryKey","enabled","Boolean","initialPageParam","undefined","queryFn","pageParam","getNextPageParam","lastPage","nextCursor","placeholderData","staleTime","refetchOnWindowFocus","refetchInterval","query","data","state","pages","length","hasActive","some","page","runs","run","refetchIntervalInBackground","getWorkflowRun","size","getWorkflowRunAttempts","map","cancelWorkflowRun","rerunWorkflowRun","mode","version","vendor","validate","value","issues","message","useRerunWorkflowRunMutation","queryClient","mutationFn","onSuccess","_run","variables","Promise","invalidateQueries","filtersAcceptManualPendingRun","now","Date","parse","getTime","buildTempRun","name","createdAt","id","cryptoRandomId","number","workflowName","currentAttempt","latestAttempt","triggerProvider","triggerEvent","triggerPayload","source","event","triggerDisplayLabel","triggerLabel","triggerReference","sourceSnapshot","updatedAt","isTemporary","jobs","preview","statusCounts","total","attempt","startedAt","finishedAt","crypto","randomUUID","Math","random","slice","useFireManualWorkflowMutation","onMutate","definitionName","lookupDefinitionName","toISOString","tempRun","listsKey","touchedQueryKeys","entries","getQueriesData","readFiltersFromKey","push","setQueryData","current","firstPage","nextFirstPage","filteredTotalCount","tempWorkflowRunId","onError","_error","_variables","context","removedCount","filter","max","_data","normalized","obj","match","definitions","find","d","useWorkflowRunQuery","useWorkflowRunAttemptQuery","workflowRunQueryOptions","useWorkflowRunAttemptsQuery","workflowRunAttemptsQueryOptions","refetchOnMount","useCancelWorkflowRunMutation","Error"],"mappings":"AAAA,SAGEA,iCAAiC,EACjCC,+BAA+B,EAC/BC,oBAAoB,EACpBC,6BAA6B,EAC7BC,yBAAyB,QACpB,6BAA6B;AACpC,SAAQC,iBAAiB,QAA4B,sBAAsB;AAC3E,SAEEC,oBAAoB,EACpBC,gBAAgB,EAChBC,YAAY,EAGZC,gBAAgB,EAChBC,WAAW,EACXC,QAAQ,EACRC,cAAc,QACT,wBAAwB;AAC/B,SACEC,qBAAqB,EAIrBC,yBAAyB,QAMpB,wBAAwB;AAC/B,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,qBAAqB,EACrBC,mBAAmB,QACd,2BAA2B;AAUlC,OAAO,MAAMC,wBAAwB;IACnCC,KAAK;QAAC;KAAgB;IACtBC,OAAO,CAACC,YAAsB;eAAIH,sBAAsBC,GAAG;YAAE;YAAQE;SAAU;IAC/EC,MAAM,CAACD,WAAmBE,UACxB;eAAIL,sBAAsBE,KAAK,CAACC;YAAYG,iBAAiBD;SAAS;IACxEE,QAAQ,CAACC,eAAuBC,aAC9B;eAAIT,sBAAsBC,GAAG;YAAE;YAAUO;YAAeC,cAAc;SAAK;IAC7EC,UAAU,CAACF,gBACT;eAAIR,sBAAsBC,GAAG;YAAE;YAAYO;SAAc;AAC7D,EAAE;AA+BF,SAASF,iBAAiBD,OAA2B;IACnD,OAAO;QACLM,QAAQN,QAAQM,MAAM,IAAI;QAC1BC,cAAcP,QAAQO,YAAY,IAAI;QACtCC,eAAeR,QAAQQ,aAAa,IAAI;QACxCC,aAAaT,QAAQS,WAAW,IAAI;QACpCC,WAAWV,QAAQU,SAAS,IAAI;IAClC;AACF;A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B5G,sBAAsB;IACxB;AACF;AAEA,OAAO,SAAS6G,6BAA6BlG,GAA4B;IACvE,MAAMgB,cAAcpF;IACpB,OAAOF,YAAY;QACjBuF,YAAY;YACV,IAAI,CAACjB,KAAK,MAAM,IAAImG,MAAM;YAC1B,OAAO,MAAM7F,kBAAkB;gBAAC3D,eAAeqD,IAAI+B,EAAE;YAAA;QACvD;QACAb,WAAW;YACT,IAAI,CAAClB,KAAK;YACV,MAAMqB,QAAQjF,GAAG,CAAC;gBAChB4E,YAAYM,iBAAiB,CAAC;oBAAC7C,UAAUtC,sBAAsBO,MAAM,CAACsD,IAAI+B,EAAE;gBAAC;gBAC7Ef,YAAYM,iBAAiB,CAAC;oBAAC7C,UAAUtC,sBAAsBE,KAAK,CAAC2D,IAAI1D,SAAS;gBAAC;gBACnF0E,YAAYM,iBAAiB,CAAC;oBAAC7C,UAAUtC,sBAAsBU,QAAQ,CAACmD,IAAI+B,EAAE;gBAAC;aAChF;QACH;IACF;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type { AgentConfigIssue, JobDisplayDuration, JobDisplayStatus, JobExecuti
|
|
|
2
2
|
export { deriveJobDisplayStatus, deriveJobExecutionDisplayStatus, isWorkflowRunTerminal, isWorkflowStatus, Job, JobExecution, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunTriggerLabel, } from '#core/workflow-run.js';
|
|
3
3
|
export { type FireManualWorkflowVariables, fireManualWorkflow, useCancelWorkflowRunMutation, useFireManualWorkflowMutation, useWorkflowRunAttemptsQuery, useWorkflowRunQuery, useWorkflowRunsInfiniteQuery, type WorkflowRunFilters, workflowRunAttemptsQueryOptions, workflowRunQueryOptions, workflowRunsInfiniteQueryOptions, workflowRunsQueryKeys, } from './hooks/api/workflow-runs.js';
|
|
4
4
|
export { ProjectWorkflowsPage } from './pages/project-workflows-page.js';
|
|
5
|
+
export { WorkflowJobDetailPage } from './pages/workflow-job-detail-page.js';
|
|
5
6
|
export { WorkflowRunDetailPage } from './pages/workflow-run-detail-page.js';
|
|
6
7
|
export { WorkflowRunsPage } from './pages/workflow-run-list-page.js';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,IAAI,EACJ,WAAW,EACX,0BAA0B,EAC1B,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,qBAAqB,EACrB,gBAAgB,EAChB,GAAG,EACH,YAAY,EACZ,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,2BAA2B,EAChC,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,uBAAuB,EACvB,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,IAAI,EACJ,WAAW,EACX,0BAA0B,EAC1B,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,qBAAqB,EACrB,gBAAgB,EAChB,GAAG,EACH,YAAY,EACZ,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,2BAA2B,EAChC,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,uBAAuB,EACvB,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { deriveJobDisplayStatus, deriveJobExecutionDisplayStatus, isWorkflowRunTerminal, isWorkflowStatus, Job, JobExecution, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunTriggerLabel } from '#core/workflow-run.js';
|
|
2
2
|
export { fireManualWorkflow, useCancelWorkflowRunMutation, useFireManualWorkflowMutation, useWorkflowRunAttemptsQuery, useWorkflowRunQuery, useWorkflowRunsInfiniteQuery, workflowRunAttemptsQueryOptions, workflowRunQueryOptions, workflowRunsInfiniteQueryOptions, workflowRunsQueryKeys } from './hooks/api/workflow-runs.js';
|
|
3
3
|
export { ProjectWorkflowsPage } from './pages/project-workflows-page.js';
|
|
4
|
+
export { WorkflowJobDetailPage } from './pages/workflow-job-detail-page.js';
|
|
4
5
|
export { WorkflowRunDetailPage } from './pages/workflow-run-detail-page.js';
|
|
5
6
|
export { WorkflowRunsPage } from './pages/workflow-run-list-page.js';
|
|
6
7
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {\n AgentConfigIssue,\n JobDisplayDuration,\n JobDisplayStatus,\n JobExecutionDisplayDuration,\n JobExecutionDisplayStatus,\n JobExecutionStatus,\n JobExecutionTime,\n JobStatus,\n ManualWorkflowLaunch,\n Step,\n StepAttempt,\n StepAttemptDisplayDuration,\n StepError,\n StepErrorCategory,\n StepErrorReason,\n StepGateResult,\n StepSourceLocation,\n WorkflowDisplayStatus,\n WorkflowRun,\n WorkflowRunAttempt,\n WorkflowRunDetail,\n WorkflowRunListPage,\n WorkflowRunStatus,\n WorkflowSourceSnapshot,\n WorkflowStatus,\n} from '#core/workflow-run.js';\nexport {\n deriveJobDisplayStatus,\n deriveJobExecutionDisplayStatus,\n isWorkflowRunTerminal,\n isWorkflowStatus,\n Job,\n JobExecution,\n TERMINAL_WORKFLOW_RUN_STATUSES,\n WORKFLOW_RUN_STATUSES,\n workflowRunTriggerLabel,\n} from '#core/workflow-run.js';\nexport {\n type FireManualWorkflowVariables,\n fireManualWorkflow,\n useCancelWorkflowRunMutation,\n useFireManualWorkflowMutation,\n useWorkflowRunAttemptsQuery,\n useWorkflowRunQuery,\n useWorkflowRunsInfiniteQuery,\n type WorkflowRunFilters,\n workflowRunAttemptsQueryOptions,\n workflowRunQueryOptions,\n workflowRunsInfiniteQueryOptions,\n workflowRunsQueryKeys,\n} from './hooks/api/workflow-runs.js';\nexport {ProjectWorkflowsPage} from './pages/project-workflows-page.js';\nexport {WorkflowRunDetailPage} from './pages/workflow-run-detail-page.js';\nexport {WorkflowRunsPage} from './pages/workflow-run-list-page.js';\n"],"names":["deriveJobDisplayStatus","deriveJobExecutionDisplayStatus","isWorkflowRunTerminal","isWorkflowStatus","Job","JobExecution","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_RUN_STATUSES","workflowRunTriggerLabel","fireManualWorkflow","useCancelWorkflowRunMutation","useFireManualWorkflowMutation","useWorkflowRunAttemptsQuery","useWorkflowRunQuery","useWorkflowRunsInfiniteQuery","workflowRunAttemptsQueryOptions","workflowRunQueryOptions","workflowRunsInfiniteQueryOptions","workflowRunsQueryKeys","ProjectWorkflowsPage","WorkflowRunDetailPage","WorkflowRunsPage"],"mappings":"AA2BA,SACEA,sBAAsB,EACtBC,+BAA+B,EAC/BC,qBAAqB,EACrBC,gBAAgB,EAChBC,GAAG,EACHC,YAAY,EACZC,8BAA8B,EAC9BC,qBAAqB,EACrBC,uBAAuB,QAClB,wBAAwB;AAC/B,SAEEC,kBAAkB,EAClBC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,4BAA4B,EAE5BC,+BAA+B,EAC/BC,uBAAuB,EACvBC,gCAAgC,EAChCC,qBAAqB,QAChB,+BAA+B;AACtC,SAAQC,oBAAoB,QAAO,oCAAoC;AACvE,SAAQC,qBAAqB,QAAO,sCAAsC;AAC1E,SAAQC,gBAAgB,QAAO,oCAAoC"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {\n AgentConfigIssue,\n JobDisplayDuration,\n JobDisplayStatus,\n JobExecutionDisplayDuration,\n JobExecutionDisplayStatus,\n JobExecutionStatus,\n JobExecutionTime,\n JobStatus,\n ManualWorkflowLaunch,\n Step,\n StepAttempt,\n StepAttemptDisplayDuration,\n StepError,\n StepErrorCategory,\n StepErrorReason,\n StepGateResult,\n StepSourceLocation,\n WorkflowDisplayStatus,\n WorkflowRun,\n WorkflowRunAttempt,\n WorkflowRunDetail,\n WorkflowRunListPage,\n WorkflowRunStatus,\n WorkflowSourceSnapshot,\n WorkflowStatus,\n} from '#core/workflow-run.js';\nexport {\n deriveJobDisplayStatus,\n deriveJobExecutionDisplayStatus,\n isWorkflowRunTerminal,\n isWorkflowStatus,\n Job,\n JobExecution,\n TERMINAL_WORKFLOW_RUN_STATUSES,\n WORKFLOW_RUN_STATUSES,\n workflowRunTriggerLabel,\n} from '#core/workflow-run.js';\nexport {\n type FireManualWorkflowVariables,\n fireManualWorkflow,\n useCancelWorkflowRunMutation,\n useFireManualWorkflowMutation,\n useWorkflowRunAttemptsQuery,\n useWorkflowRunQuery,\n useWorkflowRunsInfiniteQuery,\n type WorkflowRunFilters,\n workflowRunAttemptsQueryOptions,\n workflowRunQueryOptions,\n workflowRunsInfiniteQueryOptions,\n workflowRunsQueryKeys,\n} from './hooks/api/workflow-runs.js';\nexport {ProjectWorkflowsPage} from './pages/project-workflows-page.js';\nexport {WorkflowJobDetailPage} from './pages/workflow-job-detail-page.js';\nexport {WorkflowRunDetailPage} from './pages/workflow-run-detail-page.js';\nexport {WorkflowRunsPage} from './pages/workflow-run-list-page.js';\n"],"names":["deriveJobDisplayStatus","deriveJobExecutionDisplayStatus","isWorkflowRunTerminal","isWorkflowStatus","Job","JobExecution","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_RUN_STATUSES","workflowRunTriggerLabel","fireManualWorkflow","useCancelWorkflowRunMutation","useFireManualWorkflowMutation","useWorkflowRunAttemptsQuery","useWorkflowRunQuery","useWorkflowRunsInfiniteQuery","workflowRunAttemptsQueryOptions","workflowRunQueryOptions","workflowRunsInfiniteQueryOptions","workflowRunsQueryKeys","ProjectWorkflowsPage","WorkflowJobDetailPage","WorkflowRunDetailPage","WorkflowRunsPage"],"mappings":"AA2BA,SACEA,sBAAsB,EACtBC,+BAA+B,EAC/BC,qBAAqB,EACrBC,gBAAgB,EAChBC,GAAG,EACHC,YAAY,EACZC,8BAA8B,EAC9BC,qBAAqB,EACrBC,uBAAuB,QAClB,wBAAwB;AAC/B,SAEEC,kBAAkB,EAClBC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,4BAA4B,EAE5BC,+BAA+B,EAC/BC,uBAAuB,EACvBC,gCAAgC,EAChCC,qBAAqB,QAChB,+BAA+B;AACtC,SAAQC,oBAAoB,QAAO,oCAAoC;AACvE,SAAQC,qBAAqB,QAAO,sCAAsC;AAC1E,SAAQC,qBAAqB,QAAO,sCAAsC;AAC1E,SAAQC,gBAAgB,QAAO,oCAAoC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type WorkflowJobSearch } from '#routes/inputs.js';
|
|
2
|
+
export interface WorkflowJobDetailPageProps {
|
|
3
|
+
projectId: string;
|
|
4
|
+
workspaceSlug: string;
|
|
5
|
+
projectSlug: string;
|
|
6
|
+
workflowRunId: string;
|
|
7
|
+
jobId: string;
|
|
8
|
+
search?: WorkflowJobSearch;
|
|
9
|
+
}
|
|
10
|
+
export declare function WorkflowJobDetailPage({ projectId, workspaceSlug, projectSlug, workflowRunId, jobId, search, }: WorkflowJobDetailPageProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=workflow-job-detail-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-job-detail-page.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-job-detail-page.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAC,KAAK,iBAAiB,EAA0B,MAAM,mBAAmB,CAAC;AAElF,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,KAAK,EACL,MAAW,GACZ,EAAE,0BAA0B,+BA2D5B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router';
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
|
+
import { JobDetailView } from '#components/job-detail/job-detail-view.js';
|
|
5
|
+
import { WorkflowRunView } from '#components/workflow-run-view/index.js';
|
|
6
|
+
import { isWorkflowRunTerminal } from '#core/workflow-run.js';
|
|
7
|
+
import { useWorkflowRunAttemptQuery, useWorkflowRunAttemptsQuery } from '#hooks/api/workflow-runs.js';
|
|
8
|
+
import { workflowJobSearchParams } from '#routes/inputs.js';
|
|
9
|
+
export function WorkflowJobDetailPage({ projectId, workspaceSlug, projectSlug, workflowRunId, jobId, search = {} }) {
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const runQuery = useWorkflowRunAttemptQuery({
|
|
12
|
+
workflowRunId,
|
|
13
|
+
runAttempt: search.runAttempt
|
|
14
|
+
});
|
|
15
|
+
const attemptsQuery = useWorkflowRunAttemptsQuery({
|
|
16
|
+
workflowRunId,
|
|
17
|
+
enabled: Boolean(runQuery.data && isWorkflowRunTerminal(runQuery.data.runAttempt.status))
|
|
18
|
+
});
|
|
19
|
+
const newerAttempt = useMemo(()=>{
|
|
20
|
+
const currentAttempt = runQuery.data?.runAttempt.attempt ?? search.runAttempt ?? 1;
|
|
21
|
+
return attemptsQuery.data?.filter((attempt)=>attempt.attempt > currentAttempt).sort((left, right)=>right.attempt - left.attempt)[0]?.attempt;
|
|
22
|
+
}, [
|
|
23
|
+
attemptsQuery.data,
|
|
24
|
+
runQuery.data?.runAttempt.attempt,
|
|
25
|
+
search.runAttempt
|
|
26
|
+
]);
|
|
27
|
+
const newerRunQuery = useWorkflowRunAttemptQuery({
|
|
28
|
+
workflowRunId,
|
|
29
|
+
runAttempt: newerAttempt,
|
|
30
|
+
enabled: newerAttempt !== undefined
|
|
31
|
+
});
|
|
32
|
+
const currentJobKey = runQuery.data?.jobs.find((job)=>job.id === jobId)?.key;
|
|
33
|
+
const newerJob = currentJobKey ? newerRunQuery.data?.jobs.find((job)=>job.key === currentJobKey) : undefined;
|
|
34
|
+
const onSelectionChange = useCallback((nextSelection)=>{
|
|
35
|
+
navigate({
|
|
36
|
+
search: workflowJobSearchParams(nextSelection)
|
|
37
|
+
});
|
|
38
|
+
}, [
|
|
39
|
+
navigate
|
|
40
|
+
]);
|
|
41
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
42
|
+
className: "flex min-h-0 flex-1 overflow-hidden bg-background-neutral-background",
|
|
43
|
+
children: /*#__PURE__*/ _jsx(WorkflowRunView, {
|
|
44
|
+
projectId: projectId,
|
|
45
|
+
workspaceSlug: workspaceSlug,
|
|
46
|
+
projectSlug: projectSlug,
|
|
47
|
+
workflowRunId: workflowRunId,
|
|
48
|
+
runAttempt: search.runAttempt,
|
|
49
|
+
activeJobId: jobId,
|
|
50
|
+
jobSearch: search,
|
|
51
|
+
jobContent: /*#__PURE__*/ _jsx(JobDetailView, {
|
|
52
|
+
workspaceSlug: workspaceSlug,
|
|
53
|
+
projectSlug: projectSlug,
|
|
54
|
+
workflowRunId: workflowRunId,
|
|
55
|
+
jobId: jobId,
|
|
56
|
+
search: search,
|
|
57
|
+
query: runQuery,
|
|
58
|
+
newerAttempt: newerAttempt,
|
|
59
|
+
newerJob: newerJob,
|
|
60
|
+
onSelectionChange: onSelectionChange
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=workflow-job-detail-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/pages/workflow-job-detail-page.tsx"],"sourcesContent":["import {useNavigate} from '@tanstack/react-router';\nimport {useCallback, useMemo} from 'react';\nimport {JobDetailView} from '#components/job-detail/job-detail-view.js';\nimport {WorkflowRunView} from '#components/workflow-run-view/index.js';\nimport {isWorkflowRunTerminal} from '#core/workflow-run.js';\nimport {useWorkflowRunAttemptQuery, useWorkflowRunAttemptsQuery} from '#hooks/api/workflow-runs.js';\nimport {type WorkflowJobSearch, workflowJobSearchParams} from '#routes/inputs.js';\n\nexport interface WorkflowJobDetailPageProps {\n projectId: string;\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId: string;\n jobId: string;\n search?: WorkflowJobSearch;\n}\n\nexport function WorkflowJobDetailPage({\n projectId,\n workspaceSlug,\n projectSlug,\n workflowRunId,\n jobId,\n search = {},\n}: WorkflowJobDetailPageProps) {\n const navigate = useNavigate();\n const runQuery = useWorkflowRunAttemptQuery({\n workflowRunId,\n runAttempt: search.runAttempt,\n });\n const attemptsQuery = useWorkflowRunAttemptsQuery({\n workflowRunId,\n enabled: Boolean(runQuery.data && isWorkflowRunTerminal(runQuery.data.runAttempt.status)),\n });\n const newerAttempt = useMemo(() => {\n const currentAttempt = runQuery.data?.runAttempt.attempt ?? search.runAttempt ?? 1;\n return attemptsQuery.data\n ?.filter((attempt) => attempt.attempt > currentAttempt)\n .sort((left, right) => right.attempt - left.attempt)[0]?.attempt;\n }, [attemptsQuery.data, runQuery.data?.runAttempt.attempt, search.runAttempt]);\n const newerRunQuery = useWorkflowRunAttemptQuery({\n workflowRunId,\n runAttempt: newerAttempt,\n enabled: newerAttempt !== undefined,\n });\n\n const currentJobKey = runQuery.data?.jobs.find((job) => job.id === jobId)?.key;\n const newerJob = currentJobKey\n ? newerRunQuery.data?.jobs.find((job) => job.key === currentJobKey)\n : undefined;\n\n const onSelectionChange = useCallback(\n (nextSelection: WorkflowJobSearch) => {\n navigate({search: workflowJobSearchParams(nextSelection) as never});\n },\n [navigate],\n );\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden bg-background-neutral-background\">\n <WorkflowRunView\n projectId={projectId}\n workspaceSlug={workspaceSlug}\n projectSlug={projectSlug}\n workflowRunId={workflowRunId}\n runAttempt={search.runAttempt}\n activeJobId={jobId}\n jobSearch={search}\n jobContent={\n <JobDetailView\n workspaceSlug={workspaceSlug}\n projectSlug={projectSlug}\n workflowRunId={workflowRunId}\n jobId={jobId}\n search={search}\n query={runQuery}\n newerAttempt={newerAttempt}\n newerJob={newerJob}\n onSelectionChange={onSelectionChange}\n />\n }\n />\n </div>\n );\n}\n"],"names":["useNavigate","useCallback","useMemo","JobDetailView","WorkflowRunView","isWorkflowRunTerminal","useWorkflowRunAttemptQuery","useWorkflowRunAttemptsQuery","workflowJobSearchParams","WorkflowJobDetailPage","projectId","workspaceSlug","projectSlug","workflowRunId","jobId","search","navigate","runQuery","runAttempt","attemptsQuery","enabled","Boolean","data","status","newerAttempt","currentAttempt","attempt","filter","sort","left","right","newerRunQuery","undefined","currentJobKey","jobs","find","job","id","key","newerJob","onSelectionChange","nextSelection","div","className","activeJobId","jobSearch","jobContent","query"],"mappings":";AAAA,SAAQA,WAAW,QAAO,yBAAyB;AACnD,SAAQC,WAAW,EAAEC,OAAO,QAAO,QAAQ;AAC3C,SAAQC,aAAa,QAAO,4CAA4C;AACxE,SAAQC,eAAe,QAAO,yCAAyC;AACvE,SAAQC,qBAAqB,QAAO,wBAAwB;AAC5D,SAAQC,0BAA0B,EAAEC,2BAA2B,QAAO,8BAA8B;AACpG,SAAgCC,uBAAuB,QAAO,oBAAoB;AAWlF,OAAO,SAASC,sBAAsB,EACpCC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,aAAa,EACbC,KAAK,EACLC,SAAS,CAAC,CAAC,EACgB;IAC3B,MAAMC,WAAWhB;IACjB,MAAMiB,WAAWX,2BAA2B;QAC1CO;QACAK,YAAYH,OAAOG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AAmBA;;;;AAM/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-detail-page.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-run-detail-page.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow-run-detail-page.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-run-detail-page.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,kBAAkB,EAAiB,MAAM,mBAAmB,CAAC;AAE1E,UAAU,0BAA0B;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,MAAW,GACZ,EAAE,0BAA0B,+BAc5B"}
|
|
@@ -1,39 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useNavigate } from '@tanstack/react-router';
|
|
3
|
-
import { useCallback } from 'react';
|
|
4
2
|
import { WorkflowRunView } from '#components/workflow-run-view/index.js';
|
|
5
|
-
import {
|
|
3
|
+
import { workflowRunTab } from '#routes/inputs.js';
|
|
6
4
|
export function WorkflowRunDetailPage({ projectId, workspaceSlug, projectSlug, workflowRunId, search = {} }) {
|
|
7
|
-
const navigate = useNavigate();
|
|
8
|
-
const selection = search;
|
|
9
|
-
const onSelectionChange = useCallback((nextSelection)=>{
|
|
10
|
-
navigate({
|
|
11
|
-
search: (previous)=>{
|
|
12
|
-
const current = validateWorkflowRunsSearch(previous);
|
|
13
|
-
return workflowRunSearchParams(current, nextSelection);
|
|
14
|
-
},
|
|
15
|
-
replace: true
|
|
16
|
-
});
|
|
17
|
-
}, [
|
|
18
|
-
navigate
|
|
19
|
-
]);
|
|
20
|
-
const onTabChange = useCallback((nextTab)=>{
|
|
21
|
-
navigate({
|
|
22
|
-
search: (previous)=>{
|
|
23
|
-
const current = validateWorkflowRunsSearch(previous);
|
|
24
|
-
const nextSearch = workflowRunSearchParams({
|
|
25
|
-
...current,
|
|
26
|
-
tab: nextTab
|
|
27
|
-
}, current);
|
|
28
|
-
return nextTab === 'summary' && (current.jobId || current.jobExecutionId || current.stepId || current.stepAttemptId) ? {
|
|
29
|
-
...nextSearch,
|
|
30
|
-
tab: nextTab
|
|
31
|
-
} : nextSearch;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}, [
|
|
35
|
-
navigate
|
|
36
|
-
]);
|
|
37
5
|
return /*#__PURE__*/ _jsx("div", {
|
|
38
6
|
className: "flex min-h-0 flex-1 overflow-hidden bg-background-neutral-background",
|
|
39
7
|
children: /*#__PURE__*/ _jsx(WorkflowRunView, {
|
|
@@ -41,10 +9,9 @@ export function WorkflowRunDetailPage({ projectId, workspaceSlug, projectSlug, w
|
|
|
41
9
|
workspaceSlug: workspaceSlug,
|
|
42
10
|
projectSlug: projectSlug,
|
|
43
11
|
workflowRunId: workflowRunId,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
tab: workflowRunTab(search)
|
|
47
|
-
onTabChange: onTabChange
|
|
12
|
+
runAttempt: search.runAttempt,
|
|
13
|
+
selection: search,
|
|
14
|
+
tab: workflowRunTab(search)
|
|
48
15
|
})
|
|
49
16
|
});
|
|
50
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/workflow-run-detail-page.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/pages/workflow-run-detail-page.tsx"],"sourcesContent":["import {WorkflowRunView} from '#components/workflow-run-view/index.js';\nimport {type WorkflowRunsSearch, workflowRunTab} from '#routes/inputs.js';\n\ninterface WorkflowRunDetailPageProps {\n projectId: string;\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId?: string | undefined;\n search?: WorkflowRunsSearch;\n}\n\nexport function WorkflowRunDetailPage({\n projectId,\n workspaceSlug,\n projectSlug,\n workflowRunId,\n search = {},\n}: WorkflowRunDetailPageProps) {\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden bg-background-neutral-background\">\n <WorkflowRunView\n projectId={projectId}\n workspaceSlug={workspaceSlug}\n projectSlug={projectSlug}\n workflowRunId={workflowRunId}\n runAttempt={search.runAttempt}\n selection={search}\n tab={workflowRunTab(search)}\n />\n </div>\n );\n}\n"],"names":["WorkflowRunView","workflowRunTab","WorkflowRunDetailPage","projectId","workspaceSlug","projectSlug","workflowRunId","search","div","className","runAttempt","selection","tab"],"mappings":";AAAA,SAAQA,eAAe,QAAO,yCAAyC;AACvE,SAAiCC,cAAc,QAAO,oBAAoB;AAU1E,OAAO,SAASC,sBAAsB,EACpCC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,aAAa,EACbC,SAAS,CAAC,CAAC,EACgB;IAC3B,qBACE,KAACC;QAAIC,WAAU;kBACb,cAAA,KAACT;YACCG,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,eAAeA;YACfI,YAAYH,OAAOG,UAAU;YAC7BC,WAAWJ;YACXK,KAAKX,eAAeM;;;AAI5B"}
|