@shipfox/client-workflows 5.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.
Files changed (121) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +53 -0
  3. package/dist/components/workflow-run-list/types.d.ts +12 -0
  4. package/dist/components/workflow-run-list/types.d.ts.map +1 -1
  5. package/dist/components/workflow-run-list/types.js.map +1 -1
  6. package/dist/components/workflow-run-list/workflow-run-list-view.d.ts +1 -1
  7. package/dist/components/workflow-run-list/workflow-run-list-view.d.ts.map +1 -1
  8. package/dist/components/workflow-run-list/workflow-run-list-view.js +32 -11
  9. package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
  10. package/dist/components/workflow-run-list/workflow-run-list.d.ts +1 -1
  11. package/dist/components/workflow-run-list/workflow-run-list.d.ts.map +1 -1
  12. package/dist/components/workflow-run-list/workflow-run-list.js +7 -2
  13. package/dist/components/workflow-run-list/workflow-run-list.js.map +1 -1
  14. package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +2 -3
  15. package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
  16. package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
  17. package/dist/components/workflow-run-view/job-card.d.ts.map +1 -1
  18. package/dist/components/workflow-run-view/job-card.js +9 -8
  19. package/dist/components/workflow-run-view/job-card.js.map +1 -1
  20. package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
  21. package/dist/core/entities/job-execution.d.ts +11 -6
  22. package/dist/core/entities/job-execution.d.ts.map +1 -1
  23. package/dist/core/entities/job-execution.js +0 -19
  24. package/dist/core/entities/job-execution.js.map +1 -1
  25. package/dist/core/entities/job.d.ts +32 -10
  26. package/dist/core/entities/job.d.ts.map +1 -1
  27. package/dist/core/entities/job.js +0 -22
  28. package/dist/core/entities/job.js.map +1 -1
  29. package/dist/core/entities/step-attempt.d.ts +28 -3
  30. package/dist/core/entities/step-attempt.d.ts.map +1 -1
  31. package/dist/core/entities/step-attempt.js +0 -17
  32. package/dist/core/entities/step-attempt.js.map +1 -1
  33. package/dist/core/entities/step.d.ts +6 -6
  34. package/dist/core/entities/step.d.ts.map +1 -1
  35. package/dist/core/entities/step.js +19 -49
  36. package/dist/core/entities/step.js.map +1 -1
  37. package/dist/core/entities/workflow-run-attempt.d.ts +0 -2
  38. package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -1
  39. package/dist/core/entities/workflow-run-attempt.js +0 -12
  40. package/dist/core/entities/workflow-run-attempt.js.map +1 -1
  41. package/dist/core/entities/workflow-run.d.ts +6 -7
  42. package/dist/core/entities/workflow-run.d.ts.map +1 -1
  43. package/dist/core/entities/workflow-run.js +1 -67
  44. package/dist/core/entities/workflow-run.js.map +1 -1
  45. package/dist/core/workflow-run.d.ts +9 -9
  46. package/dist/core/workflow-run.d.ts.map +1 -1
  47. package/dist/core/workflow-run.js +6 -6
  48. package/dist/core/workflow-run.js.map +1 -1
  49. package/dist/feature.d.ts +13 -0
  50. package/dist/feature.d.ts.map +1 -1
  51. package/dist/feature.js +17 -16
  52. package/dist/feature.js.map +1 -1
  53. package/dist/hooks/api/workflow-run-mapper.d.ts +12 -0
  54. package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -0
  55. package/dist/hooks/api/workflow-run-mapper.js +207 -0
  56. package/dist/hooks/api/workflow-run-mapper.js.map +1 -0
  57. package/dist/hooks/api/workflow-runs.d.ts +25 -55
  58. package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
  59. package/dist/hooks/api/workflow-runs.js +95 -51
  60. package/dist/hooks/api/workflow-runs.js.map +1 -1
  61. package/dist/index.d.ts +2 -2
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/pages/project-workflows-page.d.ts.map +1 -1
  66. package/dist/pages/project-workflows-page.js +14 -14
  67. package/dist/pages/project-workflows-page.js.map +1 -1
  68. package/dist/pages/workflow-run-page.d.ts +3 -1
  69. package/dist/pages/workflow-run-page.d.ts.map +1 -1
  70. package/dist/pages/workflow-run-page.js +21 -14
  71. package/dist/pages/workflow-run-page.js.map +1 -1
  72. package/dist/routes/inputs.d.ts +22 -0
  73. package/dist/routes/inputs.d.ts.map +1 -0
  74. package/dist/routes/inputs.js +76 -0
  75. package/dist/routes/inputs.js.map +1 -0
  76. package/dist/routes/run-detail.d.ts +2 -0
  77. package/dist/routes/run-detail.d.ts.map +1 -1
  78. package/dist/routes/run-detail.js +6 -6
  79. package/dist/routes/run-detail.js.map +1 -1
  80. package/dist/routes/runs.d.ts +2 -0
  81. package/dist/routes/runs.d.ts.map +1 -1
  82. package/dist/routes/runs.js +6 -6
  83. package/dist/routes/runs.js.map +1 -1
  84. package/dist/routes/workflows.js +3 -5
  85. package/dist/routes/workflows.js.map +1 -1
  86. package/dist/tsconfig.test.tsbuildinfo +1 -1
  87. package/package.json +13 -14
  88. package/src/components/workflow-run-list/types.ts +6 -0
  89. package/src/components/workflow-run-list/workflow-run-list-view.tsx +27 -11
  90. package/src/components/workflow-run-list/workflow-run-list.tsx +6 -0
  91. package/src/components/workflow-run-summary/workflow-run-attempt-switcher.test.tsx +5 -6
  92. package/src/components/workflow-run-summary/workflow-run-summary.tsx +3 -3
  93. package/src/components/workflow-run-view/job-card.tsx +20 -11
  94. package/src/components/workflow-run-view/workflow-run-view.test.tsx +3 -3
  95. package/src/components/workflow-run-view/workflow-run-view.tsx +2 -2
  96. package/src/core/entities/job-execution.ts +12 -28
  97. package/src/core/entities/job.ts +44 -45
  98. package/src/core/entities/step-attempt.ts +9 -20
  99. package/src/core/entities/step.ts +38 -66
  100. package/src/core/entities/workflow-run-attempt.ts +0 -14
  101. package/src/core/entities/workflow-run.ts +8 -86
  102. package/src/core/workflow-run.test.ts +13 -11
  103. package/src/core/workflow-run.ts +8 -13
  104. package/src/feature.ts +19 -17
  105. package/src/hooks/api/workflow-run-mapper.ts +246 -0
  106. package/src/hooks/api/workflow-runs.test.tsx +57 -59
  107. package/src/hooks/api/workflow-runs.ts +187 -88
  108. package/src/index.ts +4 -0
  109. package/src/pages/project-workflows-page.test.tsx +1 -1
  110. package/src/pages/project-workflows-page.tsx +31 -26
  111. package/src/pages/workflow-run-page.test.tsx +4 -2
  112. package/src/pages/workflow-run-page.tsx +22 -17
  113. package/src/routes/inputs.test.ts +22 -0
  114. package/src/routes/inputs.ts +58 -0
  115. package/src/routes/run-detail.tsx +12 -8
  116. package/src/routes/runs.tsx +11 -4
  117. package/src/routes/workflows.tsx +3 -3
  118. package/test/fixtures/workflow-run.ts +9 -7
  119. package/test/pages.tsx +20 -5
  120. package/tsconfig.build.tsbuildinfo +1 -1
  121. 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,KAAK,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAC,KAAK,QAAQ,EAAqB,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,iCAAiC,GACzC;IAAC,KA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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 type {WorkflowRunAttemptDto} from '@shipfox/api-workflows-dto';\nimport {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 toWorkflowRunAttempt(dto: WorkflowRunAttemptDto): WorkflowRunAttempt {\n return new WorkflowRunAttempt({\n id: dto.id,\n workflowRunId: dto.workflow_run_id,\n attempt: dto.attempt,\n status: dto.status,\n createdAt: dto.created_at,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n rerunMode: dto.rerun_mode,\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","toWorkflowRunAttempt","dto","workflowRunId","workflow_run_id","attempt","status","createdAt","created_at","startedAt","started_at","finishedAt","finished_at","rerun_mode","state","fromIso","elapsed","durationBetween","from","to","start","Date","end","Number","isFinite","getTime"],"mappings":"AACA,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,SAASC,qBAAqBC,GAA0B;IAC7D,OAAO,IAAIJ,mBAAmB;QAC5BC,IAAIG,IAAIH,EAAE;QACVI,eAAeD,IAAIE,eAAe;QAClCC,SAASH,IAAIG,OAAO;QACpBC,QAAQJ,IAAII,MAAM;QAClBC,WAAWL,IAAIM,UAAU;QACzBC,WAAWP,IAAIQ,UAAU,IAAI;QAC7BC,YAAYT,IAAIU,WAAW,IAAI;QAC/BZ,WAAWE,IAAIW,UAAU;IAC3B;AACF;AAEA,OAAO,SAAShB,gDAAgD,EAC9DY,SAAS,EACTE,UAAU,EAIX;IACC,IAAIF,cAAc,MAAM,OAAO;IAC/B,IAAIE,eAAe,MAAM,OAAO;QAACG,OAAO;QAAQC,SAASN;IAAS;IAElE,MAAMO,UAAUC,gBAAgBR,WAAWE;IAC3C,OAAOK,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,OAAOlC,mBAAmB;QACxB6B;QACAE,KAAKA,MAAMF,QAAQA,QAAQE;IAC7B;AACF"}
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 { type WorkflowRunAttempt, WorkflowRunAttemptSummary } from './workflow-run-attempt.js';
4
- export type WorkflowRunStatus = WorkflowRunStatusDto;
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,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,KAAK,GAAG,EAAS,qBAAqB,EAAC,MAAM,UAAU,CAAC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,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,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;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,sBAAsB,GAAG,WAAW,CA6BtE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,sBAAsB,GAAG,mBAAmB,CActF;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,4BAA4B,GAAG,iBAAiB,CAOxF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,0BAA0B,GAAG,mBAAmB,CAM1F"}
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,2BAA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,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 { toJob, WORKFLOW_JOB_STATUSES } from './job.js';
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 type {\n WorkflowRunDetailResponseDto,\n WorkflowRunListResponseDto,\n WorkflowRunResponseDto,\n WorkflowRunStatusDto,\n} from '@shipfox/api-workflows-dto';\nimport {type Job, toJob, WORKFLOW_JOB_STATUSES} from './job.js';\nimport {\n toWorkflowRunAttempt,\n type WorkflowRunAttempt,\n WorkflowRunAttemptSummary,\n} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = WorkflowRunStatusDto;\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 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\nexport function toWorkflowRun(dto: WorkflowRunResponseDto): WorkflowRun {\n const triggerLabel = workflowRunTriggerLabel({\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n });\n const triggerDisplayLabel = workflowRunTriggerDisplayLabel({\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n });\n\n return {\n id: dto.id,\n projectId: dto.project_id,\n definitionId: dto.definition_id,\n name: dto.name,\n currentAttempt: dto.current_attempt,\n triggerProvider: dto.trigger_provider,\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n triggerDisplayLabel,\n triggerLabel,\n triggerPayload: dto.trigger_payload,\n inputs: dto.inputs ?? null,\n sourceSnapshot: dto.source_snapshot ? toWorkflowSourceSnapshot(dto.source_snapshot) : null,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n shortId: workflowRunShortId(dto.id),\n isTemporary: dto.id.startsWith('temp-'),\n };\n}\n\nexport function toWorkflowRunListItem(dto: WorkflowRunResponseDto): WorkflowRunListItem {\n return {\n ...toWorkflowRun(dto),\n status: dto.status,\n latestAttempt: dto.latest_attempt,\n runAttempt: new WorkflowRunAttemptSummary({\n workflowRunId: dto.id,\n attempt: dto.current_attempt,\n status: dto.status,\n createdAt: dto.created_at,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n }),\n };\n}\n\nexport function toWorkflowRunDetail(dto: WorkflowRunDetailResponseDto): WorkflowRunDetail {\n return {\n ...toWorkflowRun(dto),\n latestAttempt: dto.latest_attempt,\n runAttempt: toWorkflowRunAttempt(dto.run_attempt),\n jobs: dto.jobs.map(toJob),\n };\n}\n\nexport function toWorkflowRunListPage(dto: WorkflowRunListResponseDto): WorkflowRunListPage {\n return {\n runs: dto.runs.map(toWorkflowRunListItem),\n nextCursor: dto.next_cursor,\n filteredTotalCount: dto.filtered_total_count,\n };\n}\n\nfunction toWorkflowSourceSnapshot(\n dto: NonNullable<WorkflowRunResponseDto['source_snapshot']>,\n): WorkflowSourceSnapshot {\n return {\n content: dto.content,\n format: dto.format,\n };\n}\n"],"names":["toJob","WORKFLOW_JOB_STATUSES","toWorkflowRunAttempt","WorkflowRunAttemptSummary","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","toWorkflowRun","dto","triggerLabel","trigger_source","trigger_event","triggerDisplayLabel","projectId","project_id","definitionId","definition_id","name","currentAttempt","current_attempt","triggerProvider","trigger_provider","triggerPayload","trigger_payload","inputs","sourceSnapshot","source_snapshot","toWorkflowSourceSnapshot","createdAt","created_at","updatedAt","updated_at","shortId","isTemporary","startsWith","toWorkflowRunListItem","latestAttempt","latest_attempt","runAttempt","workflowRunId","attempt","startedAt","started_at","finishedAt","finished_at","toWorkflowRunDetail","run_attempt","jobs","map","toWorkflowRunListPage","runs","nextCursor","next_cursor","filteredTotalCount","filtered_total_count","content","format"],"mappings":"AAMA,SAAkBA,KAAK,EAAEC,qBAAqB,QAAO,WAAW;AAChE,SACEC,oBAAoB,EAEpBC,yBAAyB,QACpB,4BAA4B;AAKnC,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;OACAH;CACJ;AACD,MAAMO,mCAAmC,IAAID,IAAuBF;AA6CpE,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;AAEA,OAAO,SAASG,cAAcC,GAA2B;IACvD,MAAMC,eAAeb,wBAAwB;QAC3CC,eAAeW,IAAIE,cAAc;QACjCZ,cAAcU,IAAIG,aAAa;IACjC;IACA,MAAMC,sBAAsBV,+BAA+B;QACzDL,eAAeW,IAAIE,cAAc;QACjCZ,cAAcU,IAAIG,aAAa;IACjC;IAEA,OAAO;QACLlB,IAAIe,IAAIf,EAAE;QACVoB,WAAWL,IAAIM,UAAU;QACzBC,cAAcP,IAAIQ,aAAa;QAC/BC,MAAMT,IAAIS,IAAI;QACdC,gBAAgBV,IAAIW,eAAe;QACnC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C,QAAQhD,IAAIgD,MAAM;IACpB;AACF"}
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, toJob, WORKFLOW_JOB_STATUSES, } from './entities/job.js';
3
- export type { JobExecutionDisplayDuration, JobExecutionStatus, JobExecutionTime, } from './entities/job-execution.js';
4
- export { JobExecution, toJobExecution } from './entities/job-execution.js';
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 { toStep } from './entities/step.js';
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, toStepAttempt } from './entities/step-attempt.js';
9
- export type { WorkflowRun, WorkflowRunDetail, WorkflowRunListItem, WorkflowRunListPage, WorkflowRunStatus, WorkflowSourceSnapshot, WorkflowStatus, } from './entities/workflow-run.js';
10
- export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, toWorkflowRun, toWorkflowRunDetail, toWorkflowRunListItem, toWorkflowRunListPage, WORKFLOW_RUN_STATUSES, workflowRunShortId, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel, } from './entities/workflow-run.js';
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 { toWorkflowRunAttempt, WorkflowRunAttempt, WorkflowRunAttemptSummary, } from './entities/workflow-run-attempt.js';
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,KAAK,EACL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,2BAA2B,EAC3B,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACzE,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAC1C,YAAY,EACV,0BAA0B,EAC1B,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACtE,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAC,iCAAiC,EAAC,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC"}
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, toJob, WORKFLOW_JOB_STATUSES } from './entities/job.js';
2
- export { JobExecution, toJobExecution } from './entities/job-execution.js';
3
- export { toStep } from './entities/step.js';
4
- export { StepAttempt, toStepAttempt } from './entities/step-attempt.js';
5
- export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, toWorkflowRun, toWorkflowRunDetail, toWorkflowRunListItem, toWorkflowRunListPage, WORKFLOW_RUN_STATUSES, workflowRunShortId, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from './entities/workflow-run.js';
6
- export { toWorkflowRunAttempt, WorkflowRunAttempt, WorkflowRunAttemptSummary } from './entities/workflow-run-attempt.js';
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 toJob,\n WORKFLOW_JOB_STATUSES,\n} from './entities/job.js';\nexport type {\n JobExecutionDisplayDuration,\n JobExecutionStatus,\n JobExecutionTime,\n} from './entities/job-execution.js';\nexport {JobExecution, toJobExecution} 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 {toStep} from './entities/step.js';\nexport type {\n StepAttemptDisplayDuration,\n StepGateResult,\n} from './entities/step-attempt.js';\nexport {StepAttempt, toStepAttempt} from './entities/step-attempt.js';\nexport type {\n WorkflowRun,\n WorkflowRunDetail,\n WorkflowRunListItem,\n WorkflowRunListPage,\n WorkflowRunStatus,\n WorkflowSourceSnapshot,\n WorkflowStatus,\n} from './entities/workflow-run.js';\nexport {\n isWorkflowRunTerminal,\n isWorkflowStatus,\n TERMINAL_WORKFLOW_RUN_STATUSES,\n toWorkflowRun,\n toWorkflowRunDetail,\n toWorkflowRunListItem,\n toWorkflowRunListPage,\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 {\n toWorkflowRunAttempt,\n WorkflowRunAttempt,\n WorkflowRunAttemptSummary,\n} from './entities/workflow-run-attempt.js';\n"],"names":["defaultJobExecution","isTerminalJobStatus","Job","resolveJobExecution","TERMINAL_WORKFLOW_JOB_STATUSES","toJob","WORKFLOW_JOB_STATUSES","JobExecution","toJobExecution","toStep","StepAttempt","toStepAttempt","isWorkflowRunTerminal","isWorkflowStatus","TERMINAL_WORKFLOW_RUN_STATUSES","toWorkflowRun","toWorkflowRunDetail","toWorkflowRunListItem","toWorkflowRunListPage","WORKFLOW_RUN_STATUSES","workflowRunShortId","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","toWorkflowRunAttempt","WorkflowRunAttempt","WorkflowRunAttemptSummary"],"mappings":"AAQA,SACEA,mBAAmB,EACnBC,mBAAmB,EACnBC,GAAG,EACHC,mBAAmB,EACnBC,8BAA8B,EAC9BC,KAAK,EACLC,qBAAqB,QAChB,oBAAoB;AAM3B,SAAQC,YAAY,EAAEC,cAAc,QAAO,8BAA8B;AAUzE,SAAQC,MAAM,QAAO,qBAAqB;AAK1C,SAAQC,WAAW,EAAEC,aAAa,QAAO,6BAA6B;AAUtE,SACEC,qBAAqB,EACrBC,gBAAgB,EAChBC,8BAA8B,EAC9BC,aAAa,EACbC,mBAAmB,EACnBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,kBAAkB,EAClBC,8BAA8B,EAC9BC,uBAAuB,QAClB,6BAA6B;AAEpC,SACEC,oBAAoB,EACpBC,kBAAkB,EAClBC,yBAAyB,QACpB,qCAAqC"}
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,3 +1,16 @@
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 [{
@@ -1 +1 @@
1
- {"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../src/feature.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC3B,CAAC"}
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,4 +1,20 @@
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: [
@@ -18,22 +34,7 @@ export const workflowsFeature = defineClientFeature({
18
34
  impl: '@shipfox/client-workflows/routes/run-detail'
19
35
  }
20
36
  ],
21
- navigation: [
22
- {
23
- id: 'nav.runs',
24
- scope: 'project',
25
- label: 'Runs',
26
- to: '/workspaces/$wid/projects/$pid/runs',
27
- order: 100
28
- },
29
- {
30
- id: 'nav.workflows',
31
- scope: 'project',
32
- label: 'Workflows',
33
- to: '/workspaces/$wid/projects/$pid/workflows',
34
- order: 200
35
- }
36
- ]
37
+ navigation: workflowsNavigation
37
38
  });
38
39
 
39
40
  //# sourceMappingURL=feature.js.map
@@ -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/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: [\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 ],\n});\n"],"names":["defineClientFeature","workflowsFeature","id","routes","path","parent","impl","navigation","scope","label","to","order"],"mappings":"AAAA,SAAQA,mBAAmB,QAAO,wBAAwB;AAE1D,OAAO,MAAMC,mBAAmBD,oBAAoB;IAClDE,IAAI;IACJC,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,YAAY;QACV;YACEL,IAAI;YACJM,OAAO;YACPC,OAAO;YACPC,IAAI;YACJC,OAAO;QACT;QACA;YACET,IAAI;YACJM,OAAO;YACPC,OAAO;YACPC,IAAI;YACJC,OAAO;QACT;KACD;AACH,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: '/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