@shipfox/client-workflows 4.0.0 → 6.0.1
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +68 -0
- package/dist/components/workflow-run-list/types.d.ts +12 -0
- package/dist/components/workflow-run-list/types.d.ts.map +1 -1
- package/dist/components/workflow-run-list/types.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js +32 -11
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.d.ts +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.js +7 -2
- package/dist/components/workflow-run-list/workflow-run-list.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +2 -3
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-view/job-card.d.ts.map +1 -1
- package/dist/components/workflow-run-view/job-card.js +9 -8
- package/dist/components/workflow-run-view/job-card.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +11 -6
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js +0 -19
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts +32 -10
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js +0 -22
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/step-attempt.d.ts +28 -3
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.js +0 -17
- package/dist/core/entities/step-attempt.js.map +1 -1
- package/dist/core/entities/step.d.ts +6 -6
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js +19 -49
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/entities/workflow-run-attempt.d.ts +0 -2
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -1
- package/dist/core/entities/workflow-run-attempt.js +0 -12
- package/dist/core/entities/workflow-run-attempt.js.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +6 -7
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +1 -67
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/workflow-run.d.ts +9 -9
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js +6 -6
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/feature.d.ts +23 -0
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +22 -9
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.d.ts +12 -0
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -0
- package/dist/hooks/api/workflow-run-mapper.js +207 -0
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -0
- package/dist/hooks/api/workflow-runs.d.ts +25 -55
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
- package/dist/hooks/api/workflow-runs.js +95 -51
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pages/project-workflows-page.d.ts +4 -0
- package/dist/pages/project-workflows-page.d.ts.map +1 -0
- package/dist/pages/project-workflows-page.js +479 -0
- package/dist/pages/project-workflows-page.js.map +1 -0
- package/dist/pages/workflow-run-page.d.ts +3 -1
- package/dist/pages/workflow-run-page.d.ts.map +1 -1
- package/dist/pages/workflow-run-page.js +21 -14
- package/dist/pages/workflow-run-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +22 -0
- package/dist/routes/inputs.d.ts.map +1 -0
- package/dist/routes/inputs.js +76 -0
- package/dist/routes/inputs.js.map +1 -0
- package/dist/routes/run-detail.d.ts +2 -0
- package/dist/routes/run-detail.d.ts.map +1 -1
- package/dist/routes/run-detail.js +6 -6
- package/dist/routes/run-detail.js.map +1 -1
- package/dist/routes/runs.d.ts +2 -0
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +6 -6
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/workflows.d.ts +5 -0
- package/dist/routes/workflows.d.ts.map +1 -0
- package/dist/routes/workflows.js +14 -0
- package/dist/routes/workflows.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +13 -12
- package/src/components/workflow-run-list/types.ts +6 -0
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +27 -11
- package/src/components/workflow-run-list/workflow-run-list.tsx +6 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.test.tsx +5 -6
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +3 -3
- package/src/components/workflow-run-view/job-card.tsx +20 -11
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +3 -3
- package/src/components/workflow-run-view/workflow-run-view.tsx +2 -2
- package/src/core/entities/job-execution.ts +12 -28
- package/src/core/entities/job.ts +44 -45
- package/src/core/entities/step-attempt.ts +9 -20
- package/src/core/entities/step.ts +38 -66
- package/src/core/entities/workflow-run-attempt.ts +0 -14
- package/src/core/entities/workflow-run.ts +8 -86
- package/src/core/workflow-run.test.ts +13 -11
- package/src/core/workflow-run.ts +8 -13
- package/src/feature.ts +24 -10
- package/src/hooks/api/workflow-run-mapper.ts +246 -0
- package/src/hooks/api/workflow-runs.test.tsx +57 -59
- package/src/hooks/api/workflow-runs.ts +187 -88
- package/src/index.ts +5 -0
- package/src/page-harness-budget.test.ts +1 -0
- package/src/pages/project-workflows-page.test.tsx +247 -0
- package/src/pages/project-workflows-page.tsx +448 -0
- package/src/pages/workflow-run-page.test.tsx +4 -2
- package/src/pages/workflow-run-page.tsx +22 -17
- package/src/routes/inputs.test.ts +22 -0
- package/src/routes/inputs.ts +58 -0
- package/src/routes/run-detail.tsx +12 -8
- package/src/routes/runs.tsx +11 -4
- package/src/routes/workflows.tsx +10 -0
- package/test/fixtures/workflow-run.ts +9 -7
- package/test/pages.tsx +48 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/vercel.json +5 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { WorkflowRunAttemptDto } from '@shipfox/api-workflows-dto';
|
|
2
1
|
import { type Duration } from 'date-fns';
|
|
3
2
|
import type { WorkflowRunStatus } from './workflow-run.js';
|
|
4
3
|
export type WorkflowRunAttemptDisplayDuration = {
|
|
@@ -35,7 +34,6 @@ export declare class WorkflowRunAttempt extends WorkflowRunAttemptSummary {
|
|
|
35
34
|
rerunMode: 'all' | 'failed' | null;
|
|
36
35
|
constructor(fields: WorkflowRunAttemptFields);
|
|
37
36
|
}
|
|
38
|
-
export declare function toWorkflowRunAttempt(dto: WorkflowRunAttemptDto): WorkflowRunAttempt;
|
|
39
37
|
export declare function workflowRunAttemptDisplayDurationFromTimestamps({ startedAt, finishedAt, }: {
|
|
40
38
|
startedAt: string | null;
|
|
41
39
|
finishedAt: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-attempt.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run-attempt.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow-run-attempt.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run-attempt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAAqB,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,iCAAiC,GACzC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAC,GACnC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC;AAErC,UAAU,+BAA+B;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,wBAAyB,SAAQ,+BAA+B;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;CACpC;AAED,qBAAa,yBAAyB;IACpC,aAAa,EAAG,MAAM,CAAC;IACvB,OAAO,EAAG,MAAM,CAAC;IACjB,MAAM,EAAG,iBAAiB,CAAC;IAC3B,SAAS,EAAG,MAAM,CAAC;IACnB,SAAS,EAAG,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAG,MAAM,GAAG,IAAI,CAAC;gBAEf,MAAM,EAAE,+BAA+B;IAInD,IAAI,eAAe,IAAI,iCAAiC,GAAG,IAAI,CAE9D;CACF;AAED,qBAAa,kBAAmB,SAAQ,yBAAyB;IAC/D,EAAE,EAAG,MAAM,CAAC;IACZ,SAAS,EAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;gBAExB,MAAM,EAAE,wBAAwB;CAK7C;AAED,wBAAgB,+CAA+C,CAAC,EAC9D,SAAS,EACT,UAAU,GACX,EAAE;IACD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,iCAAiC,GAAG,IAAI,CAM3C"}
|
|
@@ -14,18 +14,6 @@ export class WorkflowRunAttempt extends WorkflowRunAttemptSummary {
|
|
|
14
14
|
this.rerunMode = fields.rerunMode;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
export function toWorkflowRunAttempt(dto) {
|
|
18
|
-
return new WorkflowRunAttempt({
|
|
19
|
-
id: dto.id,
|
|
20
|
-
workflowRunId: dto.workflow_run_id,
|
|
21
|
-
attempt: dto.attempt,
|
|
22
|
-
status: dto.status,
|
|
23
|
-
createdAt: dto.created_at,
|
|
24
|
-
startedAt: dto.started_at ?? null,
|
|
25
|
-
finishedAt: dto.finished_at ?? null,
|
|
26
|
-
rerunMode: dto.rerun_mode
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
17
|
export function workflowRunAttemptDisplayDurationFromTimestamps({ startedAt, finishedAt }) {
|
|
30
18
|
if (startedAt === null) return null;
|
|
31
19
|
if (finishedAt === null) return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/workflow-run-attempt.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-run-attempt.ts"],"sourcesContent":["import {type Duration, intervalToDuration} from 'date-fns';\nimport type {WorkflowRunStatus} from './workflow-run.js';\n\nexport type WorkflowRunAttemptDisplayDuration =\n | {state: 'fixed'; elapsed: Duration}\n | {state: 'live'; fromIso: string};\n\ninterface WorkflowRunAttemptSummaryFields {\n workflowRunId: string;\n attempt: number;\n status: WorkflowRunStatus;\n createdAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n}\n\ninterface WorkflowRunAttemptFields extends WorkflowRunAttemptSummaryFields {\n id: string;\n rerunMode: 'all' | 'failed' | null;\n}\n\nexport class WorkflowRunAttemptSummary {\n workflowRunId!: string;\n attempt!: number;\n status!: WorkflowRunStatus;\n createdAt!: string;\n startedAt!: string | null;\n finishedAt!: string | null;\n\n constructor(fields: WorkflowRunAttemptSummaryFields) {\n Object.assign(this, fields);\n }\n\n get displayDuration(): WorkflowRunAttemptDisplayDuration | null {\n return workflowRunAttemptDisplayDurationFromTimestamps(this);\n }\n}\n\nexport class WorkflowRunAttempt extends WorkflowRunAttemptSummary {\n id!: string;\n rerunMode!: 'all' | 'failed' | null;\n\n constructor(fields: WorkflowRunAttemptFields) {\n super(fields);\n this.id = fields.id;\n this.rerunMode = fields.rerunMode;\n }\n}\n\nexport function workflowRunAttemptDisplayDurationFromTimestamps({\n startedAt,\n finishedAt,\n}: {\n startedAt: string | null;\n finishedAt: string | null;\n}): WorkflowRunAttemptDisplayDuration | null {\n if (startedAt === null) return null;\n if (finishedAt === null) return {state: 'live', fromIso: startedAt};\n\n const elapsed = durationBetween(startedAt, finishedAt);\n return elapsed === null ? null : {state: 'fixed', elapsed};\n}\n\nfunction durationBetween(from: string, to: string): Duration | null {\n const start = new Date(from);\n const end = new Date(to);\n if (!Number.isFinite(start.getTime()) || !Number.isFinite(end.getTime())) return null;\n\n return intervalToDuration({\n start,\n end: end < start ? start : end,\n });\n}\n"],"names":["intervalToDuration","WorkflowRunAttemptSummary","fields","Object","assign","displayDuration","workflowRunAttemptDisplayDurationFromTimestamps","WorkflowRunAttempt","id","rerunMode","startedAt","finishedAt","state","fromIso","elapsed","durationBetween","from","to","start","Date","end","Number","isFinite","getTime"],"mappings":"AAAA,SAAuBA,kBAAkB,QAAO,WAAW;AAqB3D,OAAO,MAAMC;IAQX,YAAYC,MAAuC,CAAE;QACnDC,OAAOC,MAAM,CAAC,IAAI,EAAEF;IACtB;IAEA,IAAIG,kBAA4D;QAC9D,OAAOC,gDAAgD,IAAI;IAC7D;AACF;AAEA,OAAO,MAAMC,2BAA2BN;IAItC,YAAYC,MAAgC,CAAE;QAC5C,KAAK,CAACA;QACN,IAAI,CAACM,EAAE,GAAGN,OAAOM,EAAE;QACnB,IAAI,CAACC,SAAS,GAAGP,OAAOO,SAAS;IACnC;AACF;AAEA,OAAO,SAASH,gDAAgD,EAC9DI,SAAS,EACTC,UAAU,EAIX;IACC,IAAID,cAAc,MAAM,OAAO;IAC/B,IAAIC,eAAe,MAAM,OAAO;QAACC,OAAO;QAAQC,SAASH;IAAS;IAElE,MAAMI,UAAUC,gBAAgBL,WAAWC;IAC3C,OAAOG,YAAY,OAAO,OAAO;QAACF,OAAO;QAASE;IAAO;AAC3D;AAEA,SAASC,gBAAgBC,IAAY,EAAEC,EAAU;IAC/C,MAAMC,QAAQ,IAAIC,KAAKH;IACvB,MAAMI,MAAM,IAAID,KAAKF;IACrB,IAAI,CAACI,OAAOC,QAAQ,CAACJ,MAAMK,OAAO,OAAO,CAACF,OAAOC,QAAQ,CAACF,IAAIG,OAAO,KAAK,OAAO;IAEjF,OAAOvB,mBAAmB;QACxBkB;QACAE,KAAKA,MAAMF,QAAQA,QAAQE;IAC7B;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { WorkflowRunDetailResponseDto, WorkflowRunListResponseDto, WorkflowRunResponseDto, WorkflowRunStatusDto } from '@shipfox/api-workflows-dto';
|
|
2
1
|
import { type Job, WORKFLOW_JOB_STATUSES } from './job.js';
|
|
3
|
-
import {
|
|
4
|
-
export type WorkflowRunStatus =
|
|
2
|
+
import type { WorkflowRunAttempt, WorkflowRunAttemptSummary } from './workflow-run-attempt.js';
|
|
3
|
+
export type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
4
|
+
export type WorkflowRunRerunMode = 'all' | 'failed';
|
|
5
5
|
export type WorkflowStatus = WorkflowRunStatus | (typeof WORKFLOW_JOB_STATUSES)[number];
|
|
6
6
|
export declare const WORKFLOW_RUN_STATUSES: readonly ["pending", "running", "succeeded", "failed", "cancelled"];
|
|
7
7
|
export declare const TERMINAL_WORKFLOW_RUN_STATUSES: readonly ["succeeded", "failed", "cancelled"];
|
|
@@ -43,6 +43,9 @@ export interface WorkflowRunListPage {
|
|
|
43
43
|
nextCursor: string | null;
|
|
44
44
|
filteredTotalCount: number | null;
|
|
45
45
|
}
|
|
46
|
+
export interface ManualWorkflowLaunch {
|
|
47
|
+
workflowRunId: string;
|
|
48
|
+
}
|
|
46
49
|
export declare function workflowRunShortId(id: string): string;
|
|
47
50
|
export declare function workflowRunTriggerLabel({ triggerSource, triggerEvent, }: {
|
|
48
51
|
triggerSource: string;
|
|
@@ -54,8 +57,4 @@ export declare function workflowRunTriggerDisplayLabel({ triggerSource, triggerE
|
|
|
54
57
|
}): string;
|
|
55
58
|
export declare function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean;
|
|
56
59
|
export declare function isWorkflowStatus(status: string): status is WorkflowStatus;
|
|
57
|
-
export declare function toWorkflowRun(dto: WorkflowRunResponseDto): WorkflowRun;
|
|
58
|
-
export declare function toWorkflowRunListItem(dto: WorkflowRunResponseDto): WorkflowRunListItem;
|
|
59
|
-
export declare function toWorkflowRunDetail(dto: WorkflowRunDetailResponseDto): WorkflowRunDetail;
|
|
60
|
-
export declare function toWorkflowRunListPage(dto: WorkflowRunListResponseDto): WorkflowRunListPage;
|
|
61
60
|
//# sourceMappingURL=workflow-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,GAAG,EAAE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAC,kBAAkB,EAAE,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AAE7F,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAC7F,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,eAAO,MAAM,qBAAqB,qEAMe,CAAC;AAElD,eAAO,MAAM,8BAA8B,+CAIM,CAAC;AAQlD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,yBAAyB,CAAC;CACvC;AAED,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,YAAY,GACb,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAET;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,aAAa,EACb,YAAY,GACb,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAET;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAExE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,cAAc,CAEzE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { toWorkflowRunAttempt, WorkflowRunAttemptSummary } from './workflow-run-attempt.js';
|
|
1
|
+
import { WORKFLOW_JOB_STATUSES } from './job.js';
|
|
3
2
|
export const WORKFLOW_RUN_STATUSES = [
|
|
4
3
|
'pending',
|
|
5
4
|
'running',
|
|
@@ -35,70 +34,5 @@ export function isWorkflowRunTerminal(status) {
|
|
|
35
34
|
export function isWorkflowStatus(status) {
|
|
36
35
|
return WORKFLOW_STATUSES.has(status);
|
|
37
36
|
}
|
|
38
|
-
export function toWorkflowRun(dto) {
|
|
39
|
-
const triggerLabel = workflowRunTriggerLabel({
|
|
40
|
-
triggerSource: dto.trigger_source,
|
|
41
|
-
triggerEvent: dto.trigger_event
|
|
42
|
-
});
|
|
43
|
-
const triggerDisplayLabel = workflowRunTriggerDisplayLabel({
|
|
44
|
-
triggerSource: dto.trigger_source,
|
|
45
|
-
triggerEvent: dto.trigger_event
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
id: dto.id,
|
|
49
|
-
projectId: dto.project_id,
|
|
50
|
-
definitionId: dto.definition_id,
|
|
51
|
-
name: dto.name,
|
|
52
|
-
currentAttempt: dto.current_attempt,
|
|
53
|
-
triggerProvider: dto.trigger_provider,
|
|
54
|
-
triggerSource: dto.trigger_source,
|
|
55
|
-
triggerEvent: dto.trigger_event,
|
|
56
|
-
triggerDisplayLabel,
|
|
57
|
-
triggerLabel,
|
|
58
|
-
triggerPayload: dto.trigger_payload,
|
|
59
|
-
inputs: dto.inputs ?? null,
|
|
60
|
-
sourceSnapshot: dto.source_snapshot ? toWorkflowSourceSnapshot(dto.source_snapshot) : null,
|
|
61
|
-
createdAt: dto.created_at,
|
|
62
|
-
updatedAt: dto.updated_at,
|
|
63
|
-
shortId: workflowRunShortId(dto.id),
|
|
64
|
-
isTemporary: dto.id.startsWith('temp-')
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export function toWorkflowRunListItem(dto) {
|
|
68
|
-
return {
|
|
69
|
-
...toWorkflowRun(dto),
|
|
70
|
-
status: dto.status,
|
|
71
|
-
latestAttempt: dto.latest_attempt,
|
|
72
|
-
runAttempt: new WorkflowRunAttemptSummary({
|
|
73
|
-
workflowRunId: dto.id,
|
|
74
|
-
attempt: dto.current_attempt,
|
|
75
|
-
status: dto.status,
|
|
76
|
-
createdAt: dto.created_at,
|
|
77
|
-
startedAt: dto.started_at ?? null,
|
|
78
|
-
finishedAt: dto.finished_at ?? null
|
|
79
|
-
})
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
export function toWorkflowRunDetail(dto) {
|
|
83
|
-
return {
|
|
84
|
-
...toWorkflowRun(dto),
|
|
85
|
-
latestAttempt: dto.latest_attempt,
|
|
86
|
-
runAttempt: toWorkflowRunAttempt(dto.run_attempt),
|
|
87
|
-
jobs: dto.jobs.map(toJob)
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export function toWorkflowRunListPage(dto) {
|
|
91
|
-
return {
|
|
92
|
-
runs: dto.runs.map(toWorkflowRunListItem),
|
|
93
|
-
nextCursor: dto.next_cursor,
|
|
94
|
-
filteredTotalCount: dto.filtered_total_count
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function toWorkflowSourceSnapshot(dto) {
|
|
98
|
-
return {
|
|
99
|
-
content: dto.content,
|
|
100
|
-
format: dto.format
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
37
|
|
|
104
38
|
//# sourceMappingURL=workflow-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import {type Job, 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];\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\nexport interface WorkflowRun {\n id: string;\n projectId: string;\n definitionId: string;\n name: 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 inputs: Record<string, unknown> | null;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n createdAt: string;\n updatedAt: string;\n shortId: string;\n isTemporary: boolean;\n}\n\nexport interface WorkflowRunListItem extends WorkflowRun {\n status: WorkflowRunStatus;\n latestAttempt: number;\n runAttempt: WorkflowRunAttemptSummary;\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 workflowRunShortId(id: string): string {\n return id.length <= 8 ? id : id.slice(0, 8);\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\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","workflowRunShortId","id","length","slice","workflowRunTriggerLabel","triggerSource","triggerEvent","filter","Boolean","join","workflowRunTriggerDisplayLabel","isWorkflowRunTerminal","status","has","isWorkflowStatus"],"mappings":"AAAA,SAAkBA,qBAAqB,QAAO,WAAW;AAOzD,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;AAiDpE,OAAO,SAASI,mBAAmBC,EAAU;IAC3C,OAAOA,GAAGC,MAAM,IAAI,IAAID,KAAKA,GAAGE,KAAK,CAAC,GAAG;AAC3C;AAEA,OAAO,SAASC,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,OAAO,SAASM,sBAAsBC,MAAyB;IAC7D,OAAOb,iCAAiCc,GAAG,CAACD;AAC9C;AAEA,OAAO,SAASE,iBAAiBF,MAAc;IAC7C,OAAOf,kBAAkBgB,GAAG,CAACD;AAC/B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type { JobDisplayDuration, JobMode, JobStatus, JobStatusReason, ListenerStatus, ResolutionReason, } from './entities/job.js';
|
|
2
|
-
export { defaultJobExecution, isTerminalJobStatus, Job, resolveJobExecution, TERMINAL_WORKFLOW_JOB_STATUSES,
|
|
3
|
-
export type { JobExecutionDisplayDuration, JobExecutionStatus, JobExecutionTime, } from './entities/job-execution.js';
|
|
4
|
-
export { JobExecution
|
|
1
|
+
export type { JobDisplayDuration, JobListening, JobMode, JobStatus, JobStatusReason, ListenerStatus, ResolutionReason, } from './entities/job.js';
|
|
2
|
+
export { defaultJobExecution, isTerminalJobStatus, Job, resolveJobExecution, TERMINAL_WORKFLOW_JOB_STATUSES, WORKFLOW_JOB_STATUSES, } from './entities/job.js';
|
|
3
|
+
export type { JobExecutionDisplayDuration, JobExecutionStatus, JobExecutionTime, WorkflowExecutionEvent, } from './entities/job-execution.js';
|
|
4
|
+
export { JobExecution } from './entities/job-execution.js';
|
|
5
5
|
export type { AgentConfigIssue, AgentStepConfig, Step, StepError, StepErrorCategory, StepErrorReason, StepSourceLocation, } from './entities/step.js';
|
|
6
|
-
export {
|
|
6
|
+
export { AGENT_CONFIG_ISSUES, STEP_ERROR_REASONS } from './entities/step.js';
|
|
7
7
|
export type { StepAttemptDisplayDuration, StepGateResult, } from './entities/step-attempt.js';
|
|
8
|
-
export { StepAttempt
|
|
9
|
-
export type { WorkflowRun, WorkflowRunDetail, WorkflowRunListItem, WorkflowRunListPage, WorkflowRunStatus, WorkflowSourceSnapshot, WorkflowStatus, } from './entities/workflow-run.js';
|
|
10
|
-
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES,
|
|
8
|
+
export { StepAttempt } from './entities/step-attempt.js';
|
|
9
|
+
export type { ManualWorkflowLaunch, WorkflowRun, WorkflowRunDetail, WorkflowRunListItem, WorkflowRunListPage, WorkflowRunRerunMode, WorkflowRunStatus, WorkflowSourceSnapshot, WorkflowStatus, } from './entities/workflow-run.js';
|
|
10
|
+
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunShortId, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel, } from './entities/workflow-run.js';
|
|
11
11
|
export type { WorkflowRunAttemptDisplayDuration } from './entities/workflow-run-attempt.js';
|
|
12
|
-
export {
|
|
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,OAAO,EACP,SAAS,EACT,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,GAAG,EACH,mBAAmB,EACnB,8BAA8B,EAC9B,
|
|
1
|
+
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../src/core/workflow-run.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,GAAG,EACH,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,2BAA2B,EAC3B,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACzD,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3E,YAAY,EACV,0BAA0B,EAC1B,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,qBAAqB,EACrB,kBAAkB,EAClB,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
|
-
export { defaultJobExecution, isTerminalJobStatus, Job, resolveJobExecution, TERMINAL_WORKFLOW_JOB_STATUSES,
|
|
2
|
-
export { JobExecution
|
|
3
|
-
export {
|
|
4
|
-
export { StepAttempt
|
|
5
|
-
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES,
|
|
6
|
-
export {
|
|
1
|
+
export { defaultJobExecution, isTerminalJobStatus, Job, resolveJobExecution, TERMINAL_WORKFLOW_JOB_STATUSES, WORKFLOW_JOB_STATUSES } from './entities/job.js';
|
|
2
|
+
export { JobExecution } from './entities/job-execution.js';
|
|
3
|
+
export { AGENT_CONFIG_ISSUES, STEP_ERROR_REASONS } from './entities/step.js';
|
|
4
|
+
export { StepAttempt } from './entities/step-attempt.js';
|
|
5
|
+
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunShortId, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from './entities/workflow-run.js';
|
|
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 JobMode,\n JobStatus,\n JobStatusReason,\n ListenerStatus,\n ResolutionReason,\n} from './entities/job.js';\nexport {\n defaultJobExecution,\n isTerminalJobStatus,\n Job,\n resolveJobExecution,\n TERMINAL_WORKFLOW_JOB_STATUSES,\n
|
|
1
|
+
{"version":3,"sources":["../../src/core/workflow-run.ts"],"sourcesContent":["export type {\n JobDisplayDuration,\n JobListening,\n JobMode,\n JobStatus,\n JobStatusReason,\n ListenerStatus,\n ResolutionReason,\n} from './entities/job.js';\nexport {\n defaultJobExecution,\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 JobExecutionStatus,\n JobExecutionTime,\n WorkflowExecutionEvent,\n} from './entities/job-execution.js';\nexport {JobExecution} 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, STEP_ERROR_REASONS} 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 WorkflowRun,\n WorkflowRunDetail,\n WorkflowRunListItem,\n WorkflowRunListPage,\n WorkflowRunRerunMode,\n WorkflowRunStatus,\n WorkflowSourceSnapshot,\n WorkflowStatus,\n} from './entities/workflow-run.js';\nexport {\n isWorkflowRunTerminal,\n isWorkflowStatus,\n TERMINAL_WORKFLOW_RUN_STATUSES,\n WORKFLOW_RUN_STATUSES,\n workflowRunShortId,\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","isTerminalJobStatus","Job","resolveJobExecution","TERMINAL_WORKFLOW_JOB_STATUSES","WORKFLOW_JOB_STATUSES","JobExecution","AGENT_CONFIG_ISSUES","STEP_ERROR_REASONS","StepAttempt","isWorkflowRunTerminal","isWorkflowStatus","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_RUN_STATUSES","workflowRunShortId","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","WorkflowRunAttempt","WorkflowRunAttemptSummary"],"mappings":"AASA,SACEA,mBAAmB,EACnBC,mBAAmB,EACnBC,GAAG,EACHC,mBAAmB,EACnBC,8BAA8B,EAC9BC,qBAAqB,QAChB,oBAAoB;AAO3B,SAAQC,YAAY,QAAO,8BAA8B;AAUzD,SAAQC,mBAAmB,EAAEC,kBAAkB,QAAO,qBAAqB;AAK3E,SAAQC,WAAW,QAAO,6BAA6B;AAYvD,SACEC,qBAAqB,EACrBC,gBAAgB,EAChBC,8BAA8B,EAC9BC,qBAAqB,EACrBC,kBAAkB,EAClBC,8BAA8B,EAC9BC,uBAAuB,QAClB,6BAA6B;AAEpC,SAAQC,kBAAkB,EAAEC,yBAAyB,QAAO,qCAAqC"}
|
package/dist/feature.d.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
export declare const workflowsNavigation: readonly [{
|
|
2
|
+
readonly id: "nav.runs";
|
|
3
|
+
readonly scope: "project";
|
|
4
|
+
readonly label: "Runs";
|
|
5
|
+
readonly to: "/workspaces/$wid/projects/$pid/runs";
|
|
6
|
+
readonly order: 100;
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "nav.workflows";
|
|
9
|
+
readonly scope: "project";
|
|
10
|
+
readonly label: "Workflows";
|
|
11
|
+
readonly to: "/workspaces/$wid/projects/$pid/workflows";
|
|
12
|
+
readonly order: 200;
|
|
13
|
+
}];
|
|
1
14
|
export declare const workflowsFeature: {
|
|
2
15
|
readonly id: "shipfox.workflows";
|
|
3
16
|
readonly routes: readonly [{
|
|
17
|
+
readonly path: "/workspaces/$wid/projects/$pid/workflows";
|
|
18
|
+
readonly parent: "projectLayout";
|
|
19
|
+
readonly impl: "@shipfox/client-workflows/routes/workflows";
|
|
20
|
+
}, {
|
|
4
21
|
readonly path: "/workspaces/$wid/projects/$pid/runs";
|
|
5
22
|
readonly parent: "projectLayout";
|
|
6
23
|
readonly impl: "@shipfox/client-workflows/routes/runs";
|
|
@@ -15,6 +32,12 @@ export declare const workflowsFeature: {
|
|
|
15
32
|
readonly label: "Runs";
|
|
16
33
|
readonly to: "/workspaces/$wid/projects/$pid/runs";
|
|
17
34
|
readonly order: 100;
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "nav.workflows";
|
|
37
|
+
readonly scope: "project";
|
|
38
|
+
readonly label: "Workflows";
|
|
39
|
+
readonly to: "/workspaces/$wid/projects/$pid/workflows";
|
|
40
|
+
readonly order: 200;
|
|
18
41
|
}];
|
|
19
42
|
};
|
|
20
43
|
//# sourceMappingURL=feature.d.ts.map
|
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,gBAAgB
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../src/feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAeW,CAAC;AAE5C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB3B,CAAC"}
|
package/dist/feature.js
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import { defineClientFeature } from '@shipfox/client-shell';
|
|
2
|
+
export const workflowsNavigation = [
|
|
3
|
+
{
|
|
4
|
+
id: 'nav.runs',
|
|
5
|
+
scope: 'project',
|
|
6
|
+
label: 'Runs',
|
|
7
|
+
to: '/workspaces/$wid/projects/$pid/runs',
|
|
8
|
+
order: 100
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: 'nav.workflows',
|
|
12
|
+
scope: 'project',
|
|
13
|
+
label: 'Workflows',
|
|
14
|
+
to: '/workspaces/$wid/projects/$pid/workflows',
|
|
15
|
+
order: 200
|
|
16
|
+
}
|
|
17
|
+
];
|
|
2
18
|
export const workflowsFeature = defineClientFeature({
|
|
3
19
|
id: 'shipfox.workflows',
|
|
4
20
|
routes: [
|
|
21
|
+
{
|
|
22
|
+
path: '/workspaces/$wid/projects/$pid/workflows',
|
|
23
|
+
parent: 'projectLayout',
|
|
24
|
+
impl: '@shipfox/client-workflows/routes/workflows'
|
|
25
|
+
},
|
|
5
26
|
{
|
|
6
27
|
path: '/workspaces/$wid/projects/$pid/runs',
|
|
7
28
|
parent: 'projectLayout',
|
|
@@ -13,15 +34,7 @@ export const workflowsFeature = defineClientFeature({
|
|
|
13
34
|
impl: '@shipfox/client-workflows/routes/run-detail'
|
|
14
35
|
}
|
|
15
36
|
],
|
|
16
|
-
navigation:
|
|
17
|
-
{
|
|
18
|
-
id: 'nav.runs',
|
|
19
|
-
scope: 'project',
|
|
20
|
-
label: 'Runs',
|
|
21
|
-
to: '/workspaces/$wid/projects/$pid/runs',
|
|
22
|
-
order: 100
|
|
23
|
-
}
|
|
24
|
-
]
|
|
37
|
+
navigation: workflowsNavigation
|
|
25
38
|
});
|
|
26
39
|
|
|
27
40
|
//# sourceMappingURL=feature.js.map
|
package/dist/feature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/feature.ts"],"sourcesContent":["import {defineClientFeature} from '@shipfox/client-shell';\n\nexport const workflowsFeature = defineClientFeature({\n id: 'shipfox.workflows',\n routes: [\n {\n path: '/workspaces/$wid/projects/$pid/
|
|
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: '/workspaces/$wid/projects/$pid/runs',\n order: 100,\n },\n {\n id: 'nav.workflows',\n scope: 'project',\n label: 'Workflows',\n to: '/workspaces/$wid/projects/$pid/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: '/workspaces/$wid/projects/$pid/workflows',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/workflows',\n },\n {\n path: '/workspaces/$wid/projects/$pid/runs',\n parent: 'projectLayout',\n impl: '@shipfox/client-workflows/routes/runs',\n },\n {\n path: '/workspaces/$wid/projects/$pid/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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StepAttemptDto, WorkflowRunAttemptDto, WorkflowRunDetailResponseDto, WorkflowRunJobDetailDto, WorkflowRunJobExecutionDetailDto, WorkflowRunListResponseDto, WorkflowRunResponseDto, WorkflowRunStepDetailDto } from '@shipfox/api-workflows-dto';
|
|
2
|
+
import { Job, JobExecution, type Step, StepAttempt, type WorkflowRun, WorkflowRunAttempt, type WorkflowRunDetail, type WorkflowRunListItem, type WorkflowRunListPage } from '#core/workflow-run.js';
|
|
3
|
+
export declare function toWorkflowRun(dto: WorkflowRunResponseDto): WorkflowRun;
|
|
4
|
+
export declare function toWorkflowRunAttempt(dto: WorkflowRunAttemptDto): WorkflowRunAttempt;
|
|
5
|
+
export declare function toWorkflowRunListItem(dto: WorkflowRunResponseDto): WorkflowRunListItem;
|
|
6
|
+
export declare function toWorkflowRunListPage(dto: WorkflowRunListResponseDto): WorkflowRunListPage;
|
|
7
|
+
export declare function toWorkflowRunDetail(dto: WorkflowRunDetailResponseDto): WorkflowRunDetail;
|
|
8
|
+
export declare function toJob(dto: WorkflowRunJobDetailDto): Job;
|
|
9
|
+
export declare function toJobExecution(dto: WorkflowRunJobExecutionDetailDto): JobExecution;
|
|
10
|
+
export declare function toStep(dto: WorkflowRunStepDetailDto): Step;
|
|
11
|
+
export declare function toStepAttempt(dto: StepAttemptDto, jobExecutionId: string): StepAttempt;
|
|
12
|
+
//# sourceMappingURL=workflow-run-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-run-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/workflow-run-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EAGd,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,gCAAgC,EAChC,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,GAAG,EACH,YAAY,EAEZ,KAAK,IAAI,EACT,WAAW,EAGX,KAAK,WAAW,EAChB,kBAAkB,EAElB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAIzB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,aAAa,CAAC,GAAG,EAAE,sBAAsB,GAAG,WAAW,CA4BtE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,qBAAqB,GAAG,kBAAkB,CAWnF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,sBAAsB,GAAG,mBAAmB,CActF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,0BAA0B,GAAG,mBAAmB,CAM1F;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,4BAA4B,GAAG,iBAAiB,CAOxF;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,uBAAuB,GAAG,GAAG,CAmBvD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,gCAAgC,GAAG,YAAY,CAiBlF;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,wBAAwB,GAAG,IAAI,CA6B1D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,GAAG,WAAW,CAgBtF"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { Job, JobExecution, StepAttempt, WorkflowRunAttempt, WorkflowRunAttemptSummary, workflowRunShortId, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from '#core/workflow-run.js';
|
|
2
|
+
export function toWorkflowRun(dto) {
|
|
3
|
+
return {
|
|
4
|
+
id: dto.id,
|
|
5
|
+
projectId: dto.project_id,
|
|
6
|
+
definitionId: dto.definition_id,
|
|
7
|
+
name: dto.name,
|
|
8
|
+
currentAttempt: dto.current_attempt,
|
|
9
|
+
triggerProvider: dto.trigger_provider,
|
|
10
|
+
triggerSource: dto.trigger_source,
|
|
11
|
+
triggerEvent: dto.trigger_event,
|
|
12
|
+
triggerDisplayLabel: workflowRunTriggerDisplayLabel({
|
|
13
|
+
triggerSource: dto.trigger_source,
|
|
14
|
+
triggerEvent: dto.trigger_event
|
|
15
|
+
}),
|
|
16
|
+
triggerLabel: workflowRunTriggerLabel({
|
|
17
|
+
triggerSource: dto.trigger_source,
|
|
18
|
+
triggerEvent: dto.trigger_event
|
|
19
|
+
}),
|
|
20
|
+
triggerPayload: dto.trigger_payload,
|
|
21
|
+
inputs: dto.inputs ?? null,
|
|
22
|
+
sourceSnapshot: dto.source_snapshot ? {
|
|
23
|
+
content: dto.source_snapshot.content,
|
|
24
|
+
format: dto.source_snapshot.format
|
|
25
|
+
} : null,
|
|
26
|
+
createdAt: dto.created_at,
|
|
27
|
+
updatedAt: dto.updated_at,
|
|
28
|
+
shortId: workflowRunShortId(dto.id),
|
|
29
|
+
isTemporary: dto.id.startsWith('temp-')
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function toWorkflowRunAttempt(dto) {
|
|
33
|
+
return new WorkflowRunAttempt({
|
|
34
|
+
id: dto.id,
|
|
35
|
+
workflowRunId: dto.workflow_run_id,
|
|
36
|
+
attempt: dto.attempt,
|
|
37
|
+
status: dto.status,
|
|
38
|
+
createdAt: dto.created_at,
|
|
39
|
+
startedAt: dto.started_at ?? null,
|
|
40
|
+
finishedAt: dto.finished_at ?? null,
|
|
41
|
+
rerunMode: dto.rerun_mode
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export function toWorkflowRunListItem(dto) {
|
|
45
|
+
return {
|
|
46
|
+
...toWorkflowRun(dto),
|
|
47
|
+
status: dto.status,
|
|
48
|
+
latestAttempt: dto.latest_attempt,
|
|
49
|
+
runAttempt: new WorkflowRunAttemptSummary({
|
|
50
|
+
workflowRunId: dto.id,
|
|
51
|
+
attempt: dto.current_attempt,
|
|
52
|
+
status: dto.status,
|
|
53
|
+
createdAt: dto.created_at,
|
|
54
|
+
startedAt: dto.started_at ?? null,
|
|
55
|
+
finishedAt: dto.finished_at ?? null
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function toWorkflowRunListPage(dto) {
|
|
60
|
+
return {
|
|
61
|
+
runs: dto.runs.map(toWorkflowRunListItem),
|
|
62
|
+
nextCursor: dto.next_cursor,
|
|
63
|
+
filteredTotalCount: dto.filtered_total_count
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function toWorkflowRunDetail(dto) {
|
|
67
|
+
return {
|
|
68
|
+
...toWorkflowRun(dto),
|
|
69
|
+
latestAttempt: dto.latest_attempt,
|
|
70
|
+
runAttempt: toWorkflowRunAttempt(dto.run_attempt),
|
|
71
|
+
jobs: dto.jobs.map(toJob)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function toJob(dto) {
|
|
75
|
+
return new Job({
|
|
76
|
+
id: dto.id,
|
|
77
|
+
runAttemptId: dto.run_attempt_id,
|
|
78
|
+
key: dto.key,
|
|
79
|
+
name: dto.name,
|
|
80
|
+
mode: dto.mode,
|
|
81
|
+
status: dto.status,
|
|
82
|
+
statusReason: dto.status_reason,
|
|
83
|
+
carriedOver: dto.carried_over,
|
|
84
|
+
listening: dto.listening ? toJobListening(dto.listening) : null,
|
|
85
|
+
listenerStatus: dto.listener_status,
|
|
86
|
+
resolutionReason: dto.resolution_reason,
|
|
87
|
+
dependencies: dto.dependencies,
|
|
88
|
+
position: dto.position,
|
|
89
|
+
createdAt: dto.created_at,
|
|
90
|
+
updatedAt: dto.updated_at,
|
|
91
|
+
jobExecutions: dto.job_executions.map(toJobExecution)
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export function toJobExecution(dto) {
|
|
95
|
+
return new JobExecution({
|
|
96
|
+
id: dto.id,
|
|
97
|
+
jobId: dto.job_id,
|
|
98
|
+
sequence: dto.sequence,
|
|
99
|
+
name: dto.name,
|
|
100
|
+
status: dto.status,
|
|
101
|
+
statusReason: dto.status_reason,
|
|
102
|
+
triggerEvents: (dto.trigger_events ?? []).map(toWorkflowExecutionEvent),
|
|
103
|
+
queuedAt: dto.queued_at ?? null,
|
|
104
|
+
startedAt: dto.started_at ?? null,
|
|
105
|
+
finishedAt: dto.finished_at ?? null,
|
|
106
|
+
timedOutAt: dto.timed_out_at ?? null,
|
|
107
|
+
createdAt: dto.created_at,
|
|
108
|
+
updatedAt: dto.updated_at,
|
|
109
|
+
steps: dto.steps.map(toStep)
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export function toStep(dto) {
|
|
113
|
+
return {
|
|
114
|
+
id: dto.id,
|
|
115
|
+
jobExecutionId: dto.job_execution_id,
|
|
116
|
+
key: dto.key,
|
|
117
|
+
name: dto.name,
|
|
118
|
+
sourceLocation: dto.source_location ? {
|
|
119
|
+
startLine: dto.source_location.start_line,
|
|
120
|
+
endLine: dto.source_location.end_line
|
|
121
|
+
} : null,
|
|
122
|
+
status: dto.status,
|
|
123
|
+
type: dto.type,
|
|
124
|
+
config: dto.config,
|
|
125
|
+
agentConfig: toAgentStepConfig(dto),
|
|
126
|
+
error: dto.error ? {
|
|
127
|
+
message: dto.error.message,
|
|
128
|
+
exitCode: dto.error.exit_code ?? null,
|
|
129
|
+
signal: dto.error.signal,
|
|
130
|
+
reason: dto.error.reason,
|
|
131
|
+
agentConfigIssue: dto.error.agent_config_issue,
|
|
132
|
+
category: dto.error.category
|
|
133
|
+
} : null,
|
|
134
|
+
position: dto.position,
|
|
135
|
+
currentAttempt: dto.current_attempt,
|
|
136
|
+
createdAt: dto.created_at,
|
|
137
|
+
updatedAt: dto.updated_at,
|
|
138
|
+
attempts: dto.attempts.map((attempt)=>toStepAttempt(attempt, dto.job_execution_id))
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export function toStepAttempt(dto, jobExecutionId) {
|
|
142
|
+
return new StepAttempt({
|
|
143
|
+
id: dto.id,
|
|
144
|
+
stepId: dto.step_id,
|
|
145
|
+
jobExecutionId,
|
|
146
|
+
attempt: dto.attempt,
|
|
147
|
+
executionOrder: dto.execution_order,
|
|
148
|
+
status: dto.status,
|
|
149
|
+
exitCode: dto.exit_code ?? null,
|
|
150
|
+
output: dto.output ?? null,
|
|
151
|
+
error: dto.error ?? null,
|
|
152
|
+
gateResult: toStepGateResult(dto.gate_result),
|
|
153
|
+
restartFeedback: dto.restart_feedback ?? null,
|
|
154
|
+
startedAt: dto.started_at,
|
|
155
|
+
finishedAt: dto.finished_at ?? null
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function toJobListening(dto) {
|
|
159
|
+
return {
|
|
160
|
+
on: dto.on,
|
|
161
|
+
until: dto.until,
|
|
162
|
+
timeoutMs: dto.timeout_ms,
|
|
163
|
+
maxExecutions: dto.max_executions,
|
|
164
|
+
batch: dto.batch ? {
|
|
165
|
+
debounceMs: dto.batch.debounce_ms,
|
|
166
|
+
maxSize: dto.batch.max_size,
|
|
167
|
+
maxWaitMs: dto.batch.max_wait_ms
|
|
168
|
+
} : null,
|
|
169
|
+
onResolve: dto.on_resolve,
|
|
170
|
+
executionTimeoutMs: dto.execution_timeout_ms,
|
|
171
|
+
name: dto.name
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function toWorkflowExecutionEvent(dto) {
|
|
175
|
+
return {
|
|
176
|
+
source: dto.source,
|
|
177
|
+
event: dto.event,
|
|
178
|
+
deliveryId: dto.delivery_id,
|
|
179
|
+
receivedAt: dto.received_at,
|
|
180
|
+
data: dto.data
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function toStepGateResult(dto) {
|
|
184
|
+
if (dto === null || dto.kind === 'none' || dto.kind === 'not_evaluated') return dto;
|
|
185
|
+
if (dto.kind === 'passed' || dto.kind === 'failed') return {
|
|
186
|
+
...dto,
|
|
187
|
+
exitCode: dto.exit_code
|
|
188
|
+
};
|
|
189
|
+
if (dto.kind === 'uncheckable' || dto.kind === 'evaluation_error') return {
|
|
190
|
+
...dto,
|
|
191
|
+
exitCode: dto.exit_code
|
|
192
|
+
};
|
|
193
|
+
return dto;
|
|
194
|
+
}
|
|
195
|
+
function toAgentStepConfig(dto) {
|
|
196
|
+
if (dto.type !== 'agent') return null;
|
|
197
|
+
return {
|
|
198
|
+
provider: stringConfigValue(dto.config.provider),
|
|
199
|
+
model: stringConfigValue(dto.config.model),
|
|
200
|
+
thinking: stringConfigValue(dto.config.thinking)
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function stringConfigValue(value) {
|
|
204
|
+
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
//# sourceMappingURL=workflow-run-mapper.js.map
|