@shipfox/client-workflows 14.0.0 → 15.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.tsx +7 -2
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +35 -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 +8 -0
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -0
- package/dist/components/job-detail/job-detail-header.js +111 -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 +405 -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 +68 -64
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +0 -3
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js +0 -3
- package/dist/components/workflow-run-tabs/index.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-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 +271 -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 -8
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +250 -236
- 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/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/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 +47 -34
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +69 -37
- 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 +7 -7
- 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 +31 -0
- package/src/components/job-detail/job-detail-header.tsx +111 -0
- package/src/components/job-detail/job-detail-view.stories.tsx +526 -0
- package/src/components/job-detail/job-detail-view.tsx +450 -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 +0 -3
- package/src/components/workflow-run-tabs/run-annotations-empty.tsx +6 -2
- package/src/components/workflow-run-view/index.ts +0 -1
- package/src/components/workflow-run-view/run-workspace-nav.test.tsx +242 -0
- package/src/components/workflow-run-view/run-workspace-nav.tsx +301 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +1 -23
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +62 -1136
- package/src/components/workflow-run-view/workflow-run-view.tsx +330 -321
- 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/workflow-run.ts +16 -1
- package/src/feature.ts +5 -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 +539 -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 +64 -17
- 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/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/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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WORKFLOW_JOB_STATUSES } from './job.js';
|
|
2
|
+
import { elapsedTimeFromTimestamps } from './job-execution.js';
|
|
2
3
|
export const WORKFLOW_RUN_STATUSES = [
|
|
3
4
|
'pending',
|
|
4
5
|
'running',
|
|
@@ -6,6 +7,12 @@ export const WORKFLOW_RUN_STATUSES = [
|
|
|
6
7
|
'failed',
|
|
7
8
|
'cancelled'
|
|
8
9
|
];
|
|
10
|
+
export const WORKFLOW_DISPLAY_STATUSES = [
|
|
11
|
+
...WORKFLOW_RUN_STATUSES,
|
|
12
|
+
...WORKFLOW_JOB_STATUSES,
|
|
13
|
+
'listening',
|
|
14
|
+
'queued'
|
|
15
|
+
];
|
|
9
16
|
export const TERMINAL_WORKFLOW_RUN_STATUSES = [
|
|
10
17
|
'succeeded',
|
|
11
18
|
'failed',
|
|
@@ -53,5 +60,96 @@ export function isWorkflowRunTerminal(status) {
|
|
|
53
60
|
export function isWorkflowStatus(status) {
|
|
54
61
|
return WORKFLOW_STATUSES.has(status);
|
|
55
62
|
}
|
|
63
|
+
/** When the run's earliest execution began, or null while none of them has. */ export function workflowRunFirstStartedAt(jobs) {
|
|
64
|
+
let earliest = null;
|
|
65
|
+
let earliestMs = Number.POSITIVE_INFINITY;
|
|
66
|
+
for (const job of jobs){
|
|
67
|
+
for (const { startedAt } of job.jobExecutions){
|
|
68
|
+
if (startedAt === null) continue;
|
|
69
|
+
const startedMs = new Date(startedAt).getTime();
|
|
70
|
+
if (!Number.isFinite(startedMs) || startedMs >= earliestMs) continue;
|
|
71
|
+
earliest = startedAt;
|
|
72
|
+
earliestMs = startedMs;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return earliest;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Whether any work has begun. A run with no jobs on hand is a run whose jobs were not fetched,
|
|
79
|
+
* which is no evidence that nothing started, so it counts as started rather than claiming a
|
|
80
|
+
* queue this surface cannot see.
|
|
81
|
+
*/ function workflowRunHasStarted({ jobStatuses, firstStartedAt }) {
|
|
82
|
+
if (firstStartedAt != null) return true;
|
|
83
|
+
if (jobStatuses.length === 0) return true;
|
|
84
|
+
return jobStatuses.some((status)=>status !== 'pending' && status !== 'skipped');
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The single rule behind every run readout. An attempt's `startedAt` marks when the
|
|
88
|
+
* orchestrator picked the run up, not when work began, so a run whose jobs are all still
|
|
89
|
+
* waiting reads as `Queued` for queue time. Calling that "running for 2h" sends an operator to
|
|
90
|
+
* debug a build that never began.
|
|
91
|
+
*/ export function deriveWorkflowRunDisplay(progress) {
|
|
92
|
+
const { runStatus, startedAt, finishedAt, firstStartedAt } = progress;
|
|
93
|
+
const hasStarted = workflowRunHasStarted(progress);
|
|
94
|
+
const status = runStatus === 'running' && !hasStarted ? 'queued' : runStatus;
|
|
95
|
+
if (startedAt === null) return {
|
|
96
|
+
status,
|
|
97
|
+
duration: null
|
|
98
|
+
};
|
|
99
|
+
// A run cancelled before anything started keeps its queue reading rather than reporting a
|
|
100
|
+
// run that never was.
|
|
101
|
+
const time = elapsedTimeFromTimestamps({
|
|
102
|
+
from: firstStartedAt ?? startedAt,
|
|
103
|
+
to: finishedAt
|
|
104
|
+
});
|
|
105
|
+
if (time === null) return {
|
|
106
|
+
status,
|
|
107
|
+
duration: null
|
|
108
|
+
};
|
|
109
|
+
return {
|
|
110
|
+
status,
|
|
111
|
+
duration: {
|
|
112
|
+
kind: hasStarted ? 'run' : 'queue',
|
|
113
|
+
...time
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/** The run detail's reading: whole jobs, so queue and run time split on the first execution. */ export function workflowRunDetailDisplay(run) {
|
|
118
|
+
return deriveWorkflowRunDisplay({
|
|
119
|
+
runStatus: run.runAttempt.status,
|
|
120
|
+
startedAt: run.runAttempt.startedAt,
|
|
121
|
+
finishedAt: run.runAttempt.finishedAt,
|
|
122
|
+
jobStatuses: run.jobs.map((job)=>job.status),
|
|
123
|
+
firstStartedAt: workflowRunFirstStartedAt(run.jobs)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The run list's reading: status counts cover every job, not just the drawn preview, so a row
|
|
128
|
+
* reaches the same verdict as the detail page without fetching a single timestamp more.
|
|
129
|
+
*/ export function workflowRunListItemDisplay(run) {
|
|
130
|
+
return deriveWorkflowRunDisplay({
|
|
131
|
+
runStatus: run.status,
|
|
132
|
+
startedAt: run.runAttempt.startedAt,
|
|
133
|
+
finishedAt: run.runAttempt.finishedAt,
|
|
134
|
+
jobStatuses: run.jobs.statusCounts.filter(({ count })=>count > 0).map(({ status })=>status)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The job the run is waiting on: the one queued longest without starting. Named only so a
|
|
139
|
+
* queued run says what it waits for instead of showing a number with no subject.
|
|
140
|
+
*/ export function workflowRunBlockingJob(jobs) {
|
|
141
|
+
let blocking = null;
|
|
142
|
+
let queuedMs = Number.POSITIVE_INFINITY;
|
|
143
|
+
for (const job of jobs){
|
|
144
|
+
for (const { queuedAt, startedAt, finishedAt } of job.jobExecutions){
|
|
145
|
+
if (queuedAt === null || startedAt !== null || finishedAt !== null) continue;
|
|
146
|
+
const candidateMs = new Date(queuedAt).getTime();
|
|
147
|
+
if (!Number.isFinite(candidateMs) || candidateMs >= queuedMs) continue;
|
|
148
|
+
blocking = job;
|
|
149
|
+
queuedMs = candidateMs;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return blocking;
|
|
153
|
+
}
|
|
56
154
|
|
|
57
155
|
//# sourceMappingURL=workflow-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import {type Job, type JobStatus, WORKFLOW_JOB_STATUSES} from './job.js';\nimport type {WorkflowRunAttempt, WorkflowRunAttemptSummary} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\nexport type WorkflowRunRerunMode = 'all' | 'failed';\nexport type WorkflowStatus = WorkflowRunStatus | (typeof WORKFLOW_JOB_STATUSES)[number];\nexport type WorkflowDisplayStatus = WorkflowStatus | 'listening';\n\nexport const WORKFLOW_RUN_STATUSES = [\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nexport const TERMINAL_WORKFLOW_RUN_STATUSES = [\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nconst WORKFLOW_STATUSES = new Set<WorkflowStatus>([\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n]);\nconst TERMINAL_WORKFLOW_RUN_STATUS_SET = new Set<WorkflowRunStatus>(TERMINAL_WORKFLOW_RUN_STATUSES);\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\n/**\n * Provider-neutral trigger facts. Every field is nullable: only source-control triggers\n * resolve a reference at all, and a payload can name a ref without naming an actor.\n */\nexport interface WorkflowRunTriggerReference {\n repository: string | null;\n ref: string | null;\n commit: string | null;\n actor: string | null;\n}\n\n/** One glyph in a run row's job status strip: enough to draw and label it, nothing more. */\nexport interface WorkflowRunJobSummary {\n id: string;\n key: string;\n name: string | null;\n status: JobStatus;\n position: number;\n}\n\nexport interface WorkflowRunJobStatusCount {\n status: JobStatus;\n count: number;\n}\n\n/**\n * A run's jobs as the list receives them: a bounded slice to draw, plus totals covering all\n * of them.\n *\n * `preview` is capped by the API, so `preview.length` is not the job count and the strip\n * reads `total` and `statusCounts` for anything it says rather than anything it draws.\n */\nexport interface WorkflowRunJobs {\n preview: WorkflowRunJobSummary[];\n statusCounts: WorkflowRunJobStatusCount[];\n total: number;\n}\n\nexport interface WorkflowRun {\n id: string;\n projectId: string;\n definitionId: string;\n number: number | null;\n name: string;\n workflowName: string;\n currentAttempt: number;\n triggerProvider: string | null;\n triggerSource: string;\n triggerEvent: string;\n triggerDisplayLabel: string;\n triggerLabel: string;\n triggerPayload: Record<string, unknown>;\n triggerReference: WorkflowRunTriggerReference | null;\n inputs: Record<string, unknown> | null;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n createdAt: string;\n updatedAt: string;\n isTemporary: boolean;\n}\n\n/** A run as the API returns it outside the list: no job strip, because none was fetched. */\nexport interface WorkflowRunRecord extends WorkflowRun {\n status: WorkflowRunStatus;\n latestAttempt: number;\n runAttempt: WorkflowRunAttemptSummary;\n}\n\nexport interface WorkflowRunListItem extends WorkflowRunRecord {\n jobs: WorkflowRunJobs;\n}\n\nexport interface WorkflowRunDetail extends WorkflowRun {\n latestAttempt: number;\n runAttempt: WorkflowRunAttempt;\n jobs: Job[];\n}\n\nexport interface WorkflowRunListPage {\n runs: WorkflowRunListItem[];\n nextCursor: string | null;\n filteredTotalCount: number | null;\n}\n\nexport interface ManualWorkflowLaunch {\n workflowRunId: string;\n}\n\nexport function workflowRunTriggerLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return [triggerSource, triggerEvent].filter(Boolean).join(' · ');\n}\n\nexport function workflowRunTriggerDisplayLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return triggerEvent || triggerSource;\n}\n\nconst SHORT_COMMIT_LENGTH = 7;\nconst PULL_REQUEST_REF_PATTERN = /^refs\\/pull\\/(\\d+)\\/head$/u;\n\n/**\n * The ref as a person names it: `main` for a branch, `#42` for a pull request, the tag for a\n * tag. An unrecognized ref is shown verbatim rather than hidden, since a ref nobody can read\n * is still better evidence than a blank cell.\n */\nexport function workflowRunBranchLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const ref = run.triggerReference?.ref;\n if (!ref) return null;\n const pullRequest = PULL_REQUEST_REF_PATTERN.exec(ref);\n if (pullRequest) return `#${pullRequest[1]}`;\n if (ref.startsWith('refs/heads/')) return ref.slice('refs/heads/'.length);\n if (ref.startsWith('refs/tags/')) return ref.slice('refs/tags/'.length);\n return ref;\n}\n\nexport function workflowRunCommitLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const commit = run.triggerReference?.commit;\n return commit ? commit.slice(0, SHORT_COMMIT_LENGTH) : null;\n}\n\nexport function workflowRunActor(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n return run.triggerReference?.actor ?? null;\n}\n\nexport function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean {\n return TERMINAL_WORKFLOW_RUN_STATUS_SET.has(status);\n}\n\nexport function isWorkflowStatus(status: string): status is WorkflowStatus {\n return WORKFLOW_STATUSES.has(status as WorkflowStatus);\n}\n"],"names":["WORKFLOW_JOB_STATUSES","WORKFLOW_RUN_STATUSES","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_STATUSES","Set","TERMINAL_WORKFLOW_RUN_STATUS_SET","workflowRunTriggerLabel","triggerSource","triggerEvent","filter","Boolean","join","workflowRunTriggerDisplayLabel","SHORT_COMMIT_LENGTH","PULL_REQUEST_REF_PATTERN","workflowRunBranchLabel","run","ref","triggerReference","pullRequest","exec","startsWith","slice","length","workflowRunCommitLabel","commit","workflowRunActor","actor","isWorkflowRunTerminal","status","has","isWorkflowStatus"],"mappings":"AAAA,SAAkCA,qBAAqB,QAAO,WAAW;AAQzE,OAAO,MAAMC,wBAAwB;IACnC;IACA;IACA;IACA;IACA;CACD,CAAiD;AAElD,OAAO,MAAMC,iCAAiC;IAC5C;IACA;IACA;CACD,CAAiD;AAElD,MAAMC,oBAAoB,IAAIC,IAAoB;OAC7CH;OACAD;CACJ;AACD,MAAMK,mCAAmC,IAAID,IAAuBF;AA8FpE,OAAO,SAASI,wBAAwB,EACtCC,aAAa,EACbC,YAAY,EAIb;IACC,OAAO;QAACD;QAAeC;KAAa,CAACC,MAAM,CAACC,SAASC,IAAI,CAAC;AAC5D;AAEA,OAAO,SAASC,+BAA+B,EAC7CL,aAAa,EACbC,YAAY,EAIb;IACC,OAAOA,gBAAgBD;AACzB;AAEA,MAAMM,sBAAsB;AAC5B,MAAMC,2BAA2B;AAEjC;;;;CAIC,GACD,OAAO,SAASC,uBAAuBC,GAA0C;IAC/E,MAAMC,MAAMD,IAAIE,gBAAgB,EAAED;IAClC,IAAI,CAACA,KAAK,OAAO;IACjB,MAAME,cAAcL,yBAAyBM,IAAI,CAACH;IAClD,IAAIE,aAAa,OAAO,CAAC,CAAC,EAAEA,WAAW,CAAC,EAAE,EAAE;IAC5C,IAAIF,IAAII,UAAU,CAAC,gBAAgB,OAAOJ,IAAIK,KAAK,CAAC,cAAcC,MAAM;IACxE,IAAIN,IAAII,UAAU,CAAC,eAAe,OAAOJ,IAAIK,KAAK,CAAC,aAAaC,MAAM;IACtE,OAAON;AACT;AAEA,OAAO,SAASO,uBAAuBR,GAA0C;IAC/E,MAAMS,SAAST,IAAIE,gBAAgB,EAAEO;IACrC,OAAOA,SAASA,OAAOH,KAAK,CAAC,GAAGT,uBAAuB;AACzD;AAEA,OAAO,SAASa,iBAAiBV,GAA0C;IACzE,OAAOA,IAAIE,gBAAgB,EAAES,SAAS;AACxC;AAEA,OAAO,SAASC,sBAAsBC,MAAyB;IAC7D,OAAOxB,iCAAiCyB,GAAG,CAACD;AAC9C;AAEA,OAAO,SAASE,iBAAiBF,MAAc;IAC7C,OAAO1B,kBAAkB2B,GAAG,CAACD;AAC/B"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import {type Job, type JobStatus, WORKFLOW_JOB_STATUSES} from './job.js';\nimport {elapsedTimeFromTimestamps, type JobExecutionDisplayDuration} from './job-execution.js';\nimport type {WorkflowRunAttempt, WorkflowRunAttemptSummary} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\nexport type WorkflowRunRerunMode = 'all' | 'failed';\nexport type WorkflowStatus = WorkflowRunStatus | (typeof WORKFLOW_JOB_STATUSES)[number];\n/**\n * `listening` and `queued` are display-only: the API never returns them, and both are derived\n * from the jobs a run already carries.\n */\nexport type WorkflowDisplayStatus = WorkflowStatus | 'listening' | 'queued';\n\nexport const WORKFLOW_RUN_STATUSES = [\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nexport const WORKFLOW_DISPLAY_STATUSES = [\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n 'listening',\n 'queued',\n] as const satisfies readonly WorkflowDisplayStatus[];\n\nexport const TERMINAL_WORKFLOW_RUN_STATUSES = [\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nconst WORKFLOW_STATUSES = new Set<WorkflowStatus>([\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n]);\nconst TERMINAL_WORKFLOW_RUN_STATUS_SET = new Set<WorkflowRunStatus>(TERMINAL_WORKFLOW_RUN_STATUSES);\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\n/**\n * Provider-neutral trigger facts. Every field is nullable: only source-control triggers\n * resolve a reference at all, and a payload can name a ref without naming an actor.\n */\nexport interface WorkflowRunTriggerReference {\n repository: string | null;\n ref: string | null;\n commit: string | null;\n actor: string | null;\n}\n\n/** One glyph in a run row's job status strip: enough to draw and label it, nothing more. */\nexport interface WorkflowRunJobSummary {\n id: string;\n key: string;\n name: string | null;\n status: JobStatus;\n position: number;\n}\n\nexport interface WorkflowRunJobStatusCount {\n status: JobStatus;\n count: number;\n}\n\n/**\n * A run's jobs as the list receives them: a bounded slice to draw, plus totals covering all\n * of them.\n *\n * `preview` is capped by the API, so `preview.length` is not the job count and the strip\n * reads `total` and `statusCounts` for anything it says rather than anything it draws.\n */\nexport interface WorkflowRunJobs {\n preview: WorkflowRunJobSummary[];\n statusCounts: WorkflowRunJobStatusCount[];\n total: number;\n}\n\nexport interface WorkflowRun {\n id: string;\n projectId: string;\n definitionId: string;\n number: number | null;\n name: string;\n workflowName: string;\n currentAttempt: number;\n triggerProvider: string | null;\n triggerSource: string;\n triggerEvent: string;\n triggerDisplayLabel: string;\n triggerLabel: string;\n triggerPayload: Record<string, unknown>;\n triggerReference: WorkflowRunTriggerReference | null;\n inputs: Record<string, unknown> | null;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n createdAt: string;\n updatedAt: string;\n isTemporary: boolean;\n}\n\n/** A run as the API returns it outside the list: no job strip, because none was fetched. */\nexport interface WorkflowRunRecord extends WorkflowRun {\n status: WorkflowRunStatus;\n latestAttempt: number;\n runAttempt: WorkflowRunAttemptSummary;\n}\n\nexport interface WorkflowRunListItem extends WorkflowRunRecord {\n jobs: WorkflowRunJobs;\n}\n\nexport interface WorkflowRunDetail extends WorkflowRun {\n latestAttempt: number;\n runAttempt: WorkflowRunAttempt;\n jobs: Job[];\n}\n\nexport interface WorkflowRunListPage {\n runs: WorkflowRunListItem[];\n nextCursor: string | null;\n filteredTotalCount: number | null;\n}\n\nexport interface ManualWorkflowLaunch {\n workflowRunId: string;\n}\n\nexport function workflowRunTriggerLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return [triggerSource, triggerEvent].filter(Boolean).join(' · ');\n}\n\nexport function workflowRunTriggerDisplayLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return triggerEvent || triggerSource;\n}\n\nconst SHORT_COMMIT_LENGTH = 7;\nconst PULL_REQUEST_REF_PATTERN = /^refs\\/pull\\/(\\d+)\\/head$/u;\n\n/**\n * The ref as a person names it: `main` for a branch, `#42` for a pull request, the tag for a\n * tag. An unrecognized ref is shown verbatim rather than hidden, since a ref nobody can read\n * is still better evidence than a blank cell.\n */\nexport function workflowRunBranchLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const ref = run.triggerReference?.ref;\n if (!ref) return null;\n const pullRequest = PULL_REQUEST_REF_PATTERN.exec(ref);\n if (pullRequest) return `#${pullRequest[1]}`;\n if (ref.startsWith('refs/heads/')) return ref.slice('refs/heads/'.length);\n if (ref.startsWith('refs/tags/')) return ref.slice('refs/tags/'.length);\n return ref;\n}\n\nexport function workflowRunCommitLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const commit = run.triggerReference?.commit;\n return commit ? commit.slice(0, SHORT_COMMIT_LENGTH) : null;\n}\n\nexport function workflowRunActor(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n return run.triggerReference?.actor ?? null;\n}\n\nexport function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean {\n return TERMINAL_WORKFLOW_RUN_STATUS_SET.has(status);\n}\n\nexport function isWorkflowStatus(status: string): status is WorkflowStatus {\n return WORKFLOW_STATUSES.has(status as WorkflowStatus);\n}\n\n/**\n * A run's headline duration, split the way a job's already is. An attempt's `startedAt` marks\n * when the orchestrator picked the run up, not when work began, so a run whose jobs are all\n * still waiting for a runner reads as queue time rather than as run time.\n */\nexport type WorkflowRunDisplayDuration = JobExecutionDisplayDuration;\n\n/** What every surface shows for a run, derived together so status and duration cannot disagree. */\nexport interface WorkflowRunDisplay {\n status: WorkflowDisplayStatus;\n duration: WorkflowRunDisplayDuration | null;\n}\n\n/**\n * The evidence a surface can offer about a run's progress.\n *\n * `jobStatuses` is what every surface has: the list carries status counts, the detail carries\n * whole jobs. `firstStartedAt` is the detail's extra precision, and where it is absent the\n * attempt's own mark stands in.\n */\nexport interface WorkflowRunProgress {\n runStatus: WorkflowRunStatus;\n startedAt: string | null;\n finishedAt: string | null;\n jobStatuses: JobStatus[];\n firstStartedAt?: string | null | undefined;\n}\n\n/** When the run's earliest execution began, or null while none of them has. */\nexport function workflowRunFirstStartedAt(jobs: Job[]): string | null {\n let earliest: string | null = null;\n let earliestMs = Number.POSITIVE_INFINITY;\n\n for (const job of jobs) {\n for (const {startedAt} of job.jobExecutions) {\n if (startedAt === null) continue;\n const startedMs = new Date(startedAt).getTime();\n if (!Number.isFinite(startedMs) || startedMs >= earliestMs) continue;\n earliest = startedAt;\n earliestMs = startedMs;\n }\n }\n\n return earliest;\n}\n\n/**\n * Whether any work has begun. A run with no jobs on hand is a run whose jobs were not fetched,\n * which is no evidence that nothing started, so it counts as started rather than claiming a\n * queue this surface cannot see.\n */\nfunction workflowRunHasStarted({jobStatuses, firstStartedAt}: WorkflowRunProgress): boolean {\n if (firstStartedAt != null) return true;\n if (jobStatuses.length === 0) return true;\n return jobStatuses.some((status) => status !== 'pending' && status !== 'skipped');\n}\n\n/**\n * The single rule behind every run readout. An attempt's `startedAt` marks when the\n * orchestrator picked the run up, not when work began, so a run whose jobs are all still\n * waiting reads as `Queued` for queue time. Calling that \"running for 2h\" sends an operator to\n * debug a build that never began.\n */\nexport function deriveWorkflowRunDisplay(progress: WorkflowRunProgress): WorkflowRunDisplay {\n const {runStatus, startedAt, finishedAt, firstStartedAt} = progress;\n const hasStarted = workflowRunHasStarted(progress);\n const status = runStatus === 'running' && !hasStarted ? 'queued' : runStatus;\n\n if (startedAt === null) return {status, duration: null};\n\n // A run cancelled before anything started keeps its queue reading rather than reporting a\n // run that never was.\n const time = elapsedTimeFromTimestamps({from: firstStartedAt ?? startedAt, to: finishedAt});\n if (time === null) return {status, duration: null};\n\n return {status, duration: {kind: hasStarted ? 'run' : 'queue', ...time}};\n}\n\n/** The run detail's reading: whole jobs, so queue and run time split on the first execution. */\nexport function workflowRunDetailDisplay(run: {\n runAttempt: Pick<WorkflowRunAttemptSummary, 'status' | 'startedAt' | 'finishedAt'>;\n jobs: Job[];\n}): WorkflowRunDisplay {\n return deriveWorkflowRunDisplay({\n runStatus: run.runAttempt.status,\n startedAt: run.runAttempt.startedAt,\n finishedAt: run.runAttempt.finishedAt,\n jobStatuses: run.jobs.map((job) => job.status),\n firstStartedAt: workflowRunFirstStartedAt(run.jobs),\n });\n}\n\n/**\n * The run list's reading: status counts cover every job, not just the drawn preview, so a row\n * reaches the same verdict as the detail page without fetching a single timestamp more.\n */\nexport function workflowRunListItemDisplay(run: WorkflowRunListItem): WorkflowRunDisplay {\n return deriveWorkflowRunDisplay({\n runStatus: run.status,\n startedAt: run.runAttempt.startedAt,\n finishedAt: run.runAttempt.finishedAt,\n jobStatuses: run.jobs.statusCounts.filter(({count}) => count > 0).map(({status}) => status),\n });\n}\n\n/**\n * The job the run is waiting on: the one queued longest without starting. Named only so a\n * queued run says what it waits for instead of showing a number with no subject.\n */\nexport function workflowRunBlockingJob(jobs: Job[]): Job | null {\n let blocking: Job | null = null;\n let queuedMs = Number.POSITIVE_INFINITY;\n\n for (const job of jobs) {\n for (const {queuedAt, startedAt, finishedAt} of job.jobExecutions) {\n if (queuedAt === null || startedAt !== null || finishedAt !== null) continue;\n const candidateMs = new Date(queuedAt).getTime();\n if (!Number.isFinite(candidateMs) || candidateMs >= queuedMs) continue;\n blocking = job;\n queuedMs = candidateMs;\n }\n }\n\n return blocking;\n}\n"],"names":["WORKFLOW_JOB_STATUSES","elapsedTimeFromTimestamps","WORKFLOW_RUN_STATUSES","WORKFLOW_DISPLAY_STATUSES","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_STATUSES","Set","TERMINAL_WORKFLOW_RUN_STATUS_SET","workflowRunTriggerLabel","triggerSource","triggerEvent","filter","Boolean","join","workflowRunTriggerDisplayLabel","SHORT_COMMIT_LENGTH","PULL_REQUEST_REF_PATTERN","workflowRunBranchLabel","run","ref","triggerReference","pullRequest","exec","startsWith","slice","length","workflowRunCommitLabel","commit","workflowRunActor","actor","isWorkflowRunTerminal","status","has","isWorkflowStatus","workflowRunFirstStartedAt","jobs","earliest","earliestMs","Number","POSITIVE_INFINITY","job","startedAt","jobExecutions","startedMs","Date","getTime","isFinite","workflowRunHasStarted","jobStatuses","firstStartedAt","some","deriveWorkflowRunDisplay","progress","runStatus","finishedAt","hasStarted","duration","time","from","to","kind","workflowRunDetailDisplay","runAttempt","map","workflowRunListItemDisplay","statusCounts","count","workflowRunBlockingJob","blocking","queuedMs","queuedAt","candidateMs"],"mappings":"AAAA,SAAkCA,qBAAqB,QAAO,WAAW;AACzE,SAAQC,yBAAyB,QAAyC,qBAAqB;AAY/F,OAAO,MAAMC,wBAAwB;IACnC;IACA;IACA;IACA;IACA;CACD,CAAiD;AAElD,OAAO,MAAMC,4BAA4B;OACpCD;OACAF;IACH;IACA;CACD,CAAqD;AAEtD,OAAO,MAAMI,iCAAiC;IAC5C;IACA;IACA;CACD,CAAiD;AAElD,MAAMC,oBAAoB,IAAIC,IAAoB;OAC7CJ;OACAF;CACJ;AACD,MAAMO,mCAAmC,IAAID,IAAuBF;AA8FpE,OAAO,SAASI,wBAAwB,EACtCC,aAAa,EACbC,YAAY,EAIb;IACC,OAAO;QAACD;QAAeC;KAAa,CAACC,MAAM,CAACC,SAASC,IAAI,CAAC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,GAAwB;IACjE,OAAOiC,yBAAyB;QAC9BE,WAAWnC,IAAIa,MAAM;QACrBU,WAAWvB,IAAI4C,UAAU,CAACrB,SAAS;QACnCa,YAAYpC,IAAI4C,UAAU,CAACR,UAAU;QACrCN,aAAa9B,IAAIiB,IAAI,CAAC8B,YAAY,CAACtD,MAAM,CAAC,CAAC,EAACuD,KAAK,EAAC,GAAKA,QAAQ,GAAGH,GAAG,CAAC,CAAC,EAAChC,MAAM,EAAC,GAAKA;IACtF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASoC,uBAAuBhC,IAAW;IAChD,IAAIiC,WAAuB;IAC3B,IAAIC,WAAW/B,OAAOC,iBAAiB;IAEvC,KAAK,MAAMC,OAAOL,KAAM;QACtB,KAAK,MAAM,EAACmC,QAAQ,EAAE7B,SAAS,EAAEa,UAAU,EAAC,IAAId,IAAIE,aAAa,CAAE;YACjE,IAAI4B,aAAa,QAAQ7B,cAAc,QAAQa,eAAe,MAAM;YACpE,MAAMiB,cAAc,IAAI3B,KAAK0B,UAAUzB,OAAO;YAC9C,IAAI,CAACP,OAAOQ,QAAQ,CAACyB,gBAAgBA,eAAeF,UAAU;YAC9DD,WAAW5B;YACX6B,WAAWE;QACb;IACF;IAEA,OAAOH;AACT"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export type { JobDisplayDuration, JobDisplayStatus, JobListening, JobMode, JobStatus, JobStatusReason, ListenerStatus, ResolutionReason, } from './entities/job.js';
|
|
2
2
|
export { defaultJobExecution, deriveJobDisplayStatus, isTerminalJobStatus, Job, resolveJobExecution, TERMINAL_WORKFLOW_JOB_STATUSES, WORKFLOW_JOB_STATUSES, } from './entities/job.js';
|
|
3
3
|
export type { JobExecutionDisplayDuration, JobExecutionDisplayStatus, JobExecutionStatus, JobExecutionTime, WorkflowExecutionEvent, } from './entities/job-execution.js';
|
|
4
|
-
export { deriveJobExecutionDisplayStatus, isTerminalJobExecutionStatus, JobExecution, } from './entities/job-execution.js';
|
|
4
|
+
export { deriveJobExecutionDisplayStatus, elapsedTimeFromTimestamps, isTerminalJobExecutionStatus, JobExecution, } from './entities/job-execution.js';
|
|
5
5
|
export type { AgentConfigIssue, AgentStepConfig, Step, StepError, StepErrorCategory, StepErrorReason, StepSourceLocation, } from './entities/step.js';
|
|
6
|
-
export { AGENT_CONFIG_ISSUES, STEP_ERROR_REASONS } from './entities/step.js';
|
|
6
|
+
export { AGENT_CONFIG_ISSUES, compareStepAttempts, resolveStepAttempt, STEP_ERROR_REASONS, } from './entities/step.js';
|
|
7
7
|
export type { StepAttemptDisplayDuration, StepGateResult, } from './entities/step-attempt.js';
|
|
8
8
|
export { StepAttempt } from './entities/step-attempt.js';
|
|
9
|
-
export type { ManualWorkflowLaunch, WorkflowDisplayStatus, WorkflowRun, WorkflowRunDetail, WorkflowRunJobStatusCount, WorkflowRunJobSummary, WorkflowRunJobs, WorkflowRunListItem, WorkflowRunListPage, WorkflowRunRecord, WorkflowRunRerunMode, WorkflowRunStatus, WorkflowRunTriggerReference, WorkflowSourceSnapshot, WorkflowStatus, } from './entities/workflow-run.js';
|
|
10
|
-
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunActor, workflowRunBranchLabel, workflowRunCommitLabel, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel, } from './entities/workflow-run.js';
|
|
9
|
+
export type { ManualWorkflowLaunch, WorkflowDisplayStatus, WorkflowRun, WorkflowRunDetail, WorkflowRunDisplay, WorkflowRunDisplayDuration, WorkflowRunJobStatusCount, WorkflowRunJobSummary, WorkflowRunJobs, WorkflowRunListItem, WorkflowRunListPage, WorkflowRunProgress, WorkflowRunRecord, WorkflowRunRerunMode, WorkflowRunStatus, WorkflowRunTriggerReference, WorkflowSourceSnapshot, WorkflowStatus, } from './entities/workflow-run.js';
|
|
10
|
+
export { deriveWorkflowRunDisplay, isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_DISPLAY_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunActor, workflowRunBlockingJob, workflowRunBranchLabel, workflowRunCommitLabel, workflowRunDetailDisplay, workflowRunFirstStartedAt, workflowRunListItemDisplay, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel, } from './entities/workflow-run.js';
|
|
11
11
|
export type { WorkflowRunAttemptDisplayDuration } from './entities/workflow-run-attempt.js';
|
|
12
12
|
export { WorkflowRunAttempt, WorkflowRunAttemptSummary } from './entities/workflow-run-attempt.js';
|
|
13
13
|
//# sourceMappingURL=workflow-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../src/core/workflow-run.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,GAAG,EACH,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,YAAY,GACb,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../src/core/workflow-run.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAA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yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAC,iCAAiC,EAAC,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAC,kBAAkB,EAAE,yBAAyB,EAAC,MAAM,oCAAoC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { defaultJobExecution, deriveJobDisplayStatus, isTerminalJobStatus, Job, resolveJobExecution, TERMINAL_WORKFLOW_JOB_STATUSES, WORKFLOW_JOB_STATUSES } from './entities/job.js';
|
|
2
|
-
export { deriveJobExecutionDisplayStatus, isTerminalJobExecutionStatus, JobExecution } from './entities/job-execution.js';
|
|
3
|
-
export { AGENT_CONFIG_ISSUES, STEP_ERROR_REASONS } from './entities/step.js';
|
|
2
|
+
export { deriveJobExecutionDisplayStatus, elapsedTimeFromTimestamps, isTerminalJobExecutionStatus, JobExecution } from './entities/job-execution.js';
|
|
3
|
+
export { AGENT_CONFIG_ISSUES, compareStepAttempts, resolveStepAttempt, STEP_ERROR_REASONS } from './entities/step.js';
|
|
4
4
|
export { StepAttempt } from './entities/step-attempt.js';
|
|
5
|
-
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunActor, workflowRunBranchLabel, workflowRunCommitLabel, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from './entities/workflow-run.js';
|
|
5
|
+
export { deriveWorkflowRunDisplay, isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_DISPLAY_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunActor, workflowRunBlockingJob, workflowRunBranchLabel, workflowRunCommitLabel, workflowRunDetailDisplay, workflowRunFirstStartedAt, workflowRunListItemDisplay, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from './entities/workflow-run.js';
|
|
6
6
|
export { WorkflowRunAttempt, WorkflowRunAttemptSummary } from './entities/workflow-run-attempt.js';
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=workflow-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/workflow-run.ts"],"sourcesContent":["export type {\n JobDisplayDuration,\n JobDisplayStatus,\n JobListening,\n JobMode,\n JobStatus,\n JobStatusReason,\n ListenerStatus,\n ResolutionReason,\n} from './entities/job.js';\nexport {\n defaultJobExecution,\n deriveJobDisplayStatus,\n isTerminalJobStatus,\n Job,\n resolveJobExecution,\n TERMINAL_WORKFLOW_JOB_STATUSES,\n WORKFLOW_JOB_STATUSES,\n} from './entities/job.js';\nexport type {\n JobExecutionDisplayDuration,\n JobExecutionDisplayStatus,\n JobExecutionStatus,\n JobExecutionTime,\n WorkflowExecutionEvent,\n} from './entities/job-execution.js';\nexport {\n deriveJobExecutionDisplayStatus,\n isTerminalJobExecutionStatus,\n JobExecution,\n} from './entities/job-execution.js';\nexport type {\n AgentConfigIssue,\n AgentStepConfig,\n Step,\n StepError,\n StepErrorCategory,\n StepErrorReason,\n StepSourceLocation,\n} from './entities/step.js';\nexport {AGENT_CONFIG_ISSUES
|
|
1
|
+
{"version":3,"sources":["../../src/core/workflow-run.ts"],"sourcesContent":["export type {\n JobDisplayDuration,\n JobDisplayStatus,\n JobListening,\n JobMode,\n JobStatus,\n JobStatusReason,\n ListenerStatus,\n ResolutionReason,\n} from './entities/job.js';\nexport {\n defaultJobExecution,\n deriveJobDisplayStatus,\n isTerminalJobStatus,\n Job,\n resolveJobExecution,\n TERMINAL_WORKFLOW_JOB_STATUSES,\n WORKFLOW_JOB_STATUSES,\n} from './entities/job.js';\nexport type {\n JobExecutionDisplayDuration,\n JobExecutionDisplayStatus,\n JobExecutionStatus,\n JobExecutionTime,\n WorkflowExecutionEvent,\n} from './entities/job-execution.js';\nexport {\n deriveJobExecutionDisplayStatus,\n elapsedTimeFromTimestamps,\n isTerminalJobExecutionStatus,\n JobExecution,\n} from './entities/job-execution.js';\nexport type {\n AgentConfigIssue,\n AgentStepConfig,\n Step,\n StepError,\n StepErrorCategory,\n StepErrorReason,\n StepSourceLocation,\n} from './entities/step.js';\nexport {\n AGENT_CONFIG_ISSUES,\n compareStepAttempts,\n resolveStepAttempt,\n STEP_ERROR_REASONS,\n} from './entities/step.js';\nexport type {\n StepAttemptDisplayDuration,\n StepGateResult,\n} from './entities/step-attempt.js';\nexport {StepAttempt} from './entities/step-attempt.js';\nexport type {\n ManualWorkflowLaunch,\n WorkflowDisplayStatus,\n WorkflowRun,\n WorkflowRunDetail,\n WorkflowRunDisplay,\n WorkflowRunDisplayDuration,\n WorkflowRunJobStatusCount,\n WorkflowRunJobSummary,\n WorkflowRunJobs,\n WorkflowRunListItem,\n WorkflowRunListPage,\n WorkflowRunProgress,\n WorkflowRunRecord,\n WorkflowRunRerunMode,\n WorkflowRunStatus,\n WorkflowRunTriggerReference,\n WorkflowSourceSnapshot,\n WorkflowStatus,\n} from './entities/workflow-run.js';\nexport {\n deriveWorkflowRunDisplay,\n isWorkflowRunTerminal,\n isWorkflowStatus,\n TERMINAL_WORKFLOW_RUN_STATUSES,\n WORKFLOW_DISPLAY_STATUSES,\n WORKFLOW_RUN_STATUSES,\n workflowRunActor,\n workflowRunBlockingJob,\n workflowRunBranchLabel,\n workflowRunCommitLabel,\n workflowRunDetailDisplay,\n workflowRunFirstStartedAt,\n workflowRunListItemDisplay,\n workflowRunTriggerDisplayLabel,\n workflowRunTriggerLabel,\n} from './entities/workflow-run.js';\nexport type {WorkflowRunAttemptDisplayDuration} from './entities/workflow-run-attempt.js';\nexport {WorkflowRunAttempt, WorkflowRunAttemptSummary} from './entities/workflow-run-attempt.js';\n"],"names":["defaultJobExecution","deriveJobDisplayStatus","isTerminalJobStatus","Job","resolveJobExecution","TERMINAL_WORKFLOW_JOB_STATUSES","WORKFLOW_JOB_STATUSES","deriveJobExecutionDisplayStatus","elapsedTimeFromTimestamps","isTerminalJobExecutionStatus","JobExecution","AGENT_CONFIG_ISSUES","compareStepAttempts","resolveStepAttempt","STEP_ERROR_REASONS","StepAttempt","deriveWorkflowRunDisplay","isWorkflowRunTerminal","isWorkflowStatus","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_DISPLAY_STATUSES","WORKFLOW_RUN_STATUSES","workflowRunActor","workflowRunBlockingJob","workflowRunBranchLabel","workflowRunCommitLabel","workflowRunDetailDisplay","workflowRunFirstStartedAt","workflowRunListItemDisplay","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","WorkflowRunAttempt","WorkflowRunAttemptSummary"],"mappings":"AAUA,SACEA,mBAAmB,EACnBC,sBAAsB,EACtBC,mBAAmB,EACnBC,GAAG,EACHC,mBAAmB,EACnBC,8BAA8B,EAC9BC,qBAAqB,QAChB,oBAAoB;AAQ3B,SACEC,+BAA+B,EAC/BC,yBAAyB,EACzBC,4BAA4B,EAC5BC,YAAY,QACP,8BAA8B;AAUrC,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,kBAAkB,EAClBC,kBAAkB,QACb,qBAAqB;AAK5B,SAAQC,WAAW,QAAO,6BAA6B;AAqBvD,SACEC,wBAAwB,EACxBC,qBAAqB,EACrBC,gBAAgB,EAChBC,8BAA8B,EAC9BC,yBAAyB,EACzBC,qBAAqB,EACrBC,gBAAgB,EAChBC,sBAAsB,EACtBC,sBAAsB,EACtBC,sBAAsB,EACtBC,wBAAwB,EACxBC,yBAAyB,EACzBC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,uBAAuB,QAClB,6BAA6B;AAEpC,SAAQC,kBAAkB,EAAEC,yBAAyB,QAAO,qCAAqC"}
|
package/dist/feature.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const workflowsNavigation: readonly [{
|
|
2
|
-
readonly id:
|
|
3
|
-
readonly scope:
|
|
4
|
-
readonly label:
|
|
5
|
-
readonly to:
|
|
2
|
+
readonly id: 'nav.runs';
|
|
3
|
+
readonly scope: 'project';
|
|
4
|
+
readonly label: 'Runs';
|
|
5
|
+
readonly to: '/w/$workspaceSlug/p/$projectSlug/runs';
|
|
6
6
|
readonly order: 100;
|
|
7
7
|
}, {
|
|
8
|
-
readonly id:
|
|
9
|
-
readonly scope:
|
|
10
|
-
readonly label:
|
|
11
|
-
readonly to:
|
|
8
|
+
readonly id: 'nav.workflows';
|
|
9
|
+
readonly scope: 'project';
|
|
10
|
+
readonly label: 'Workflows';
|
|
11
|
+
readonly to: '/w/$workspaceSlug/p/$projectSlug/workflows';
|
|
12
12
|
readonly order: 200;
|
|
13
13
|
}];
|
|
14
14
|
export declare const workflowsFeature: {
|
|
@@ -25,18 +25,22 @@ export declare const workflowsFeature: {
|
|
|
25
25
|
readonly path: "/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId";
|
|
26
26
|
readonly parent: "projectLayout";
|
|
27
27
|
readonly impl: "@shipfox/client-workflows/routes/run-detail";
|
|
28
|
+
}, {
|
|
29
|
+
readonly path: "/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId/jobs/$jobId";
|
|
30
|
+
readonly parent: "projectLayout";
|
|
31
|
+
readonly impl: "@shipfox/client-workflows/routes/job-detail";
|
|
28
32
|
}];
|
|
29
33
|
readonly navigation: readonly [{
|
|
30
|
-
readonly id:
|
|
31
|
-
readonly scope:
|
|
32
|
-
readonly label:
|
|
33
|
-
readonly to:
|
|
34
|
+
readonly id: 'nav.runs';
|
|
35
|
+
readonly scope: 'project';
|
|
36
|
+
readonly label: 'Runs';
|
|
37
|
+
readonly to: '/w/$workspaceSlug/p/$projectSlug/runs';
|
|
34
38
|
readonly order: 100;
|
|
35
39
|
}, {
|
|
36
|
-
readonly id:
|
|
37
|
-
readonly scope:
|
|
38
|
-
readonly label:
|
|
39
|
-
readonly to:
|
|
40
|
+
readonly id: 'nav.workflows';
|
|
41
|
+
readonly scope: 'project';
|
|
42
|
+
readonly label: 'Workflows';
|
|
43
|
+
readonly to: '/w/$workspaceSlug/p/$projectSlug/workflows';
|
|
40
44
|
readonly order: 200;
|
|
41
45
|
}];
|
|
42
46
|
};
|
package/dist/feature.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../src/feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../src/feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;iBAExB,UAAU;oBACP,SAAS;oBACT,MAAM;iBACT,uCAAuC;oBACpC,GAAG;;iBAGN,eAAe;oBACZ,SAAS;oBACT,WAAW;iBACd,4CAA4C;oBACzC,GAAG;EAE6B,CAAC;AAE5C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;qBAfrB,UAAU;wBACP,SAAS;wBACT,MAAM;qBACT,uCAAuC;wBACpC,GAAG;;qBAGN,eAAe;wBACZ,SAAS;wBACT,WAAW;qBACd,4CAA4C;wBACzC,GAAG;;CA6BZ,CAAC"}
|
package/dist/feature.js
CHANGED
|
@@ -32,6 +32,11 @@ export const workflowsFeature = defineClientFeature({
|
|
|
32
32
|
path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId',
|
|
33
33
|
parent: 'projectLayout',
|
|
34
34
|
impl: '@shipfox/client-workflows/routes/run-detail'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId/jobs/$jobId',
|
|
38
|
+
parent: 'projectLayout',
|
|
39
|
+
impl: '@shipfox/client-workflows/routes/job-detail'
|
|
35
40
|
}
|
|
36
41
|
],
|
|
37
42
|
navigation: workflowsNavigation
|
package/dist/feature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {defineClientFeature, type NavTabEntry} from '@shipfox/client-shell';\n\nexport const workflowsNavigation = [\n {\n id: 'nav.runs',\n scope: 'project',\n label: 'Runs',\n to: '/w/$workspaceSlug/p/$projectSlug/runs',\n order: 100,\n },\n {\n id: 'nav.workflows',\n scope: 'project',\n label: 'Workflows',\n to: '/w/$workspaceSlug/p/$projectSlug/workflows',\n order: 200,\n },\n] as const satisfies readonly NavTabEntry[];\n\nexport const workflowsFeature = defineClientFeature({\n id: 'shipfox.workflows',\n routes: [\n {\n path: '/w/$workspaceSlug/p/$projectSlug/workflows',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/workflows',\n },\n {\n path: '/w/$workspaceSlug/p/$projectSlug/runs',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/runs',\n },\n {\n path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/run-detail',\n },\n ],\n navigation: workflowsNavigation,\n});\n"],"names":["defineClientFeature","workflowsNavigation","id","scope","label","to","order","workflowsFeature","routes","path","parent","impl","navigation"],"mappings":"AAAA,SAAQA,mBAAmB,QAAyB,wBAAwB;AAE5E,OAAO,MAAMC,sBAAsB;IACjC;QACEC,IAAI;QACJC,OAAO;QACPC,OAAO;QACPC,IAAI;QACJC,OAAO;IACT;IACA;QACEJ,IAAI;QACJC,OAAO;QACPC,OAAO;QACPC,IAAI;QACJC,OAAO;IACT;CACD,CAA2C;AAE5C,OAAO,MAAMC,mBAAmBP,oBAAoB;IAClDE,IAAI;IACJM,QAAQ;QACN;YACEC,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;KACD;IACDC,YAAYX;AACd,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {defineClientFeature, type NavTabEntry} from '@shipfox/client-shell';\n\nexport const workflowsNavigation = [\n {\n id: 'nav.runs',\n scope: 'project',\n label: 'Runs',\n to: '/w/$workspaceSlug/p/$projectSlug/runs',\n order: 100,\n },\n {\n id: 'nav.workflows',\n scope: 'project',\n label: 'Workflows',\n to: '/w/$workspaceSlug/p/$projectSlug/workflows',\n order: 200,\n },\n] as const satisfies readonly NavTabEntry[];\n\nexport const workflowsFeature = defineClientFeature({\n id: 'shipfox.workflows',\n routes: [\n {\n path: '/w/$workspaceSlug/p/$projectSlug/workflows',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/workflows',\n },\n {\n path: '/w/$workspaceSlug/p/$projectSlug/runs',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/runs',\n },\n {\n path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/run-detail',\n },\n {\n path: '/w/$workspaceSlug/p/$projectSlug/runs/$workflowRunId/jobs/$jobId',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/job-detail',\n },\n ],\n navigation: workflowsNavigation,\n});\n"],"names":["defineClientFeature","workflowsNavigation","id","scope","label","to","order","workflowsFeature","routes","path","parent","impl","navigation"],"mappings":"AAAA,SAAQA,mBAAmB,QAAyB,wBAAwB;AAE5E,OAAO,MAAMC,sBAAsB;IACjC;QACEC,IAAI;QACJC,OAAO;QACPC,OAAO;QACPC,IAAI;QACJC,OAAO;IACT;IACA;QACEJ,IAAI;QACJC,OAAO;QACPC,OAAO;QACPC,IAAI;QACJC,OAAO;IACT;CACD,CAA2C;AAE5C,OAAO,MAAMC,mBAAmBP,oBAAoB;IAClDE,IAAI;IACJM,QAAQ;QACN;YACEC,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;QACA;YACEF,MAAM;YACNC,QAAQ;YACRC,MAAM;QACR;KACD;IACDC,YAAYX;AACd,GAAG"}
|
|
@@ -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,uBA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AAC;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,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;SAA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C,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","refetch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AAC3D,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
|
|