@shipfox/api-workflows-dto 10.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +34 -0
  3. package/dist/index.d.ts +3 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +3 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/inter-module.d.ts +53 -1
  8. package/dist/inter-module.d.ts.map +1 -1
  9. package/dist/inter-module.js +30 -2
  10. package/dist/inter-module.js.map +1 -1
  11. package/dist/schemas/checkout-token.d.ts +9 -0
  12. package/dist/schemas/checkout-token.d.ts.map +1 -1
  13. package/dist/schemas/checkout-token.js +7 -0
  14. package/dist/schemas/checkout-token.js.map +1 -1
  15. package/dist/schemas/index.d.ts +3 -3
  16. package/dist/schemas/index.d.ts.map +1 -1
  17. package/dist/schemas/index.js +3 -3
  18. package/dist/schemas/index.js.map +1 -1
  19. package/dist/schemas/job-execution.d.ts +13 -0
  20. package/dist/schemas/job-execution.d.ts.map +1 -1
  21. package/dist/schemas/job-execution.js +7 -0
  22. package/dist/schemas/job-execution.js.map +1 -1
  23. package/dist/schemas/job-listening.d.ts +18 -0
  24. package/dist/schemas/job-listening.d.ts.map +1 -1
  25. package/dist/schemas/job-listening.js +6 -0
  26. package/dist/schemas/job-listening.js.map +1 -1
  27. package/dist/schemas/workflow-run-detail.d.ts +32 -0
  28. package/dist/schemas/workflow-run-detail.d.ts.map +1 -1
  29. package/dist/schemas/workflow-run.d.ts +155 -0
  30. package/dist/schemas/workflow-run.d.ts.map +1 -1
  31. package/dist/schemas/workflow-run.js +39 -1
  32. package/dist/schemas/workflow-run.js.map +1 -1
  33. package/dist/tsconfig.test.tsbuildinfo +1 -1
  34. package/dist/working-directory.d.ts +9 -0
  35. package/dist/working-directory.d.ts.map +1 -0
  36. package/dist/working-directory.js +23 -0
  37. package/dist/working-directory.js.map +1 -0
  38. package/package.json +3 -3
  39. package/src/index.ts +16 -0
  40. package/src/inter-module.test.ts +17 -0
  41. package/src/inter-module.ts +27 -1
  42. package/src/schemas/checkout-token.test.ts +44 -2
  43. package/src/schemas/checkout-token.ts +13 -0
  44. package/src/schemas/index.ts +15 -0
  45. package/src/schemas/job-execution.test.ts +15 -0
  46. package/src/schemas/job-execution.ts +13 -0
  47. package/src/schemas/job-listening.test.ts +4 -0
  48. package/src/schemas/job-listening.ts +4 -0
  49. package/src/schemas/workflow-run.test.ts +106 -1
  50. package/src/schemas/workflow-run.ts +56 -1
  51. package/src/working-directory.ts +28 -0
  52. package/tsconfig.build.tsbuildinfo +1 -1
@@ -57,6 +57,12 @@ export declare const workflowExecutionEventSchema: z.ZodObject<{
57
57
  event: z.ZodString;
58
58
  delivery_id: z.ZodString;
59
59
  received_at: z.ZodString;
60
+ project: z.ZodNullable<z.ZodObject<{
61
+ id: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ repository: z.ZodNullable<z.ZodString>;
64
+ ref: z.ZodNullable<z.ZodString>;
65
+ commit: z.ZodNullable<z.ZodString>;
60
66
  data: z.ZodUnknown;
61
67
  }, z.core.$strip>;
62
68
  export declare const workflowExecutionContextSchema: z.ZodObject<{
@@ -70,6 +76,12 @@ export declare const workflowExecutionContextSchema: z.ZodObject<{
70
76
  event: z.ZodString;
71
77
  delivery_id: z.ZodString;
72
78
  received_at: z.ZodString;
79
+ project: z.ZodNullable<z.ZodObject<{
80
+ id: z.ZodString;
81
+ }, z.core.$strip>>;
82
+ repository: z.ZodNullable<z.ZodString>;
83
+ ref: z.ZodNullable<z.ZodString>;
84
+ commit: z.ZodNullable<z.ZodString>;
73
85
  data: z.ZodUnknown;
74
86
  }, z.core.$strip>>;
75
87
  }, z.core.$strip>;
@@ -79,6 +91,12 @@ export declare const triggerEventsBatchSchema: z.ZodObject<{
79
91
  event: z.ZodString;
80
92
  delivery_id: z.ZodString;
81
93
  received_at: z.ZodString;
94
+ project: z.ZodNullable<z.ZodObject<{
95
+ id: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ repository: z.ZodNullable<z.ZodString>;
98
+ ref: z.ZodNullable<z.ZodString>;
99
+ commit: z.ZodNullable<z.ZodString>;
82
100
  data: z.ZodUnknown;
83
101
  }, z.core.$strip>>;
84
102
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"job-listening.d.ts","sourceRoot":"","sources":["../../src/schemas/job-listening.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,aAAa;;;EAAoC,CAAC;AAC/D,eAAO,MAAM,oBAAoB;;;;EAAgD,CAAC;AAClF,eAAO,MAAM,sBAAsB;;;;;EAA8D,CAAC;AAElG,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS7B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;iBAMvC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;iBAOzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;iBAEnC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACjE,MAAM,MAAM,yBAAyB,GAAG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AAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AACrF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACzF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -43,6 +43,12 @@ export const workflowExecutionEventSchema = z.object({
43
43
  event: z.string(),
44
44
  delivery_id: z.string(),
45
45
  received_at: z.string(),
46
+ project: z.object({
47
+ id: z.string().uuid()
48
+ }).nullable(),
49
+ repository: z.string().nullable(),
50
+ ref: z.string().nullable(),
51
+ commit: z.string().nullable(),
46
52
  data: z.unknown()
47
53
  });
48
54
  export const workflowExecutionContextSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/job-listening.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const jobModeSchema = z.enum(['one_shot', 'listening']);\nexport const listenerStatusSchema = z.enum(['inactive', 'listening', 'resolved']);\nexport const resolutionReasonSchema = z.enum(['until', 'timeout', 'max_executions', 'cancelled']);\n\nexport const listeningTriggerSchema = z.object({\n source: z.string(),\n event: z.string(),\n inputs: z.record(z.string(), z.unknown()).optional(),\n filter: z.string().optional(),\n});\n\nexport const jobListeningBatchSchema = z.object({\n debounce_ms: z.number().int().positive().optional(),\n max_size: z.number().int().positive().optional(),\n max_wait_ms: z.number().int().positive().optional(),\n});\n\nexport const jobListeningSchema = z.object({\n on: z.array(listeningTriggerSchema).min(1),\n until: z.array(listeningTriggerSchema).min(1).nullable(),\n timeout_ms: z.number().int().positive().nullable(),\n max_executions: z.number().int().positive().nullable(),\n batch: jobListeningBatchSchema.nullable(),\n on_resolve: z.enum(['finish', 'cancel']),\n execution_timeout_ms: z.number().int().positive().nullable(),\n name: z.string().nullable(),\n});\n\nexport const workflowExecutionEventSchema = z.object({\n source: z.string(),\n event: z.string(),\n delivery_id: z.string(),\n received_at: z.string(),\n data: z.unknown(),\n});\n\nexport const workflowExecutionContextSchema = z.object({\n index: z.number().int().nonnegative(),\n name: z.string(),\n status: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n events: z.array(workflowExecutionEventSchema),\n});\n\nexport const triggerEventsBatchSchema = z.object({\n events: z.array(workflowExecutionEventSchema),\n});\n\nexport type JobModeDto = z.infer<typeof jobModeSchema>;\nexport type ListenerStatusDto = z.infer<typeof listenerStatusSchema>;\nexport type ResolutionReasonDto = z.infer<typeof resolutionReasonSchema>;\nexport type ListeningTriggerDto = z.infer<typeof listeningTriggerSchema>;\nexport type JobListeningDto = z.infer<typeof jobListeningSchema>;\nexport type WorkflowExecutionEventDto = z.infer<typeof workflowExecutionEventSchema>;\nexport type WorkflowExecutionContextDto = z.infer<typeof workflowExecutionContextSchema>;\nexport type TriggerEventsBatchDto = z.infer<typeof triggerEventsBatchSchema>;\n"],"names":["z","jobModeSchema","enum","listenerStatusSchema","resolutionReasonSchema","listeningTriggerSchema","object","source","string","event","inputs","record","unknown","optional","filter","jobListeningBatchSchema","debounce_ms","number","int","positive","max_size","max_wait_ms","jobListeningSchema","on","array","min","until","nullable","timeout_ms","max_executions","batch","on_resolve","execution_timeout_ms","name","workflowExecutionEventSchema","delivery_id","received_at","data","workflowExecutionContextSchema","index","nonnegative","status","started_at","finished_at","events","triggerEventsBatchSchema"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,gBAAgBD,EAAEE,IAAI,CAAC;IAAC;IAAY;CAAY,EAAE;AAC/D,OAAO,MAAMC,uBAAuBH,EAAEE,IAAI,CAAC;IAAC;IAAY;IAAa;CAAW,EAAE;AAClF,OAAO,MAAME,yBAAyBJ,EAAEE,IAAI,CAAC;IAAC;IAAS;IAAW;IAAkB;CAAY,EAAE;AAElG,OAAO,MAAMG,yBAAyBL,EAAEM,MAAM,CAAC;IAC7CC,QAAQP,EAAEQ,MAAM;IAChBC,OAAOT,EA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AAM,CAAC;IACrDiC,OAAOvC,EAAEiB,MAAM,GAAGC,GAAG,GAAGsB,WAAW;IACnCP,MAAMjC,EAAEQ,MAAM;IACdiC,QAAQzC,EAAEQ,MAAM;IAChBkC,YAAY1C,EAAEQ,MAAM,GAAGmB,QAAQ;IAC/BgB,aAAa3C,EAAEQ,MAAM,GAAGmB,QAAQ;IAChCiB,QAAQ5C,EAAEwB,KAAK,CAACU;AAClB,GAAG;AAEH,OAAO,MAAMW,2BAA2B7C,EAAEM,MAAM,CAAC;IAC/CsC,QAAQ5C,EAAEwB,KAAK,CAACU;AAClB,GAAG"}
1
+ {"version":3,"sources":["../../src/schemas/job-listening.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const jobModeSchema = z.enum(['one_shot', 'listening']);\nexport const listenerStatusSchema = z.enum(['inactive', 'listening', 'resolved']);\nexport const resolutionReasonSchema = z.enum(['until', 'timeout', 'max_executions', 'cancelled']);\n\nexport const listeningTriggerSchema = z.object({\n source: z.string(),\n event: z.string(),\n inputs: z.record(z.string(), z.unknown()).optional(),\n filter: z.string().optional(),\n});\n\nexport const jobListeningBatchSchema = z.object({\n debounce_ms: z.number().int().positive().optional(),\n max_size: z.number().int().positive().optional(),\n max_wait_ms: z.number().int().positive().optional(),\n});\n\nexport const jobListeningSchema = z.object({\n on: z.array(listeningTriggerSchema).min(1),\n until: z.array(listeningTriggerSchema).min(1).nullable(),\n timeout_ms: z.number().int().positive().nullable(),\n max_executions: z.number().int().positive().nullable(),\n batch: jobListeningBatchSchema.nullable(),\n on_resolve: z.enum(['finish', 'cancel']),\n execution_timeout_ms: z.number().int().positive().nullable(),\n name: z.string().nullable(),\n});\n\nexport const workflowExecutionEventSchema = z.object({\n source: z.string(),\n event: z.string(),\n delivery_id: z.string(),\n received_at: z.string(),\n project: z.object({id: z.string().uuid()}).nullable(),\n repository: z.string().nullable(),\n ref: z.string().nullable(),\n commit: z.string().nullable(),\n data: z.unknown(),\n});\n\nexport const workflowExecutionContextSchema = z.object({\n index: z.number().int().nonnegative(),\n name: z.string(),\n status: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n events: z.array(workflowExecutionEventSchema),\n});\n\nexport const triggerEventsBatchSchema = z.object({\n events: z.array(workflowExecutionEventSchema),\n});\n\nexport type JobModeDto = z.infer<typeof jobModeSchema>;\nexport type ListenerStatusDto = z.infer<typeof listenerStatusSchema>;\nexport type ResolutionReasonDto = z.infer<typeof resolutionReasonSchema>;\nexport type ListeningTriggerDto = z.infer<typeof listeningTriggerSchema>;\nexport type JobListeningDto = z.infer<typeof jobListeningSchema>;\nexport type WorkflowExecutionEventDto = z.infer<typeof workflowExecutionEventSchema>;\nexport type WorkflowExecutionContextDto = z.infer<typeof workflowExecutionContextSchema>;\nexport type TriggerEventsBatchDto = z.infer<typeof triggerEventsBatchSchema>;\n"],"names":["z","jobModeSchema","enum","listenerStatusSchema","resolutionReasonSchema","listeningTriggerSchema","object","source","string","event","inputs","record","unknown","optional","filter","jobListeningBatchSchema","debounce_ms","number","int","positive","max_size","max_wait_ms","jobListeningSchema","on","array","min","until","nullable","timeout_ms","max_executions","batch","on_resolve","execution_timeout_ms","name","workflowExecutionEventSchema","delivery_id","received_at","project","id","uuid","repository","ref","commit","data","workflowExecutionContextSchema","index","nonnegative","status","started_at","finished_at","events","triggerEventsBatchSchema"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,gBAAgBD,EAAEE,IAAI,CAAC;IAAC;IAAY;CAAY,EAAE;AAC/D,OAAO,MAAMC,uBAAuBH,EAAEE,IAAI,CAAC;IAAC;IAAY;IAAa;CAAW,EAAE;AAClF,OAAO,MAAME,yBAAyBJ,EAAEE,IAAI,CAAC;IAAC;IAAS;IAAW;IAAkB;CAAY,EAAE;AAElG,OAAO,MAAMG,yBAAyBL,EAAEM,MAAM,CAAC;IAC7CC,QAAQP,EAAEQ,MAAM;IAChBC,OAAOT,EAAEQ,MAAM;IACfE,QAAQV,EAAEW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C,EAAEQ,MAAM,GAAGmB,QAAQ;IAC/Bc,KAAKzC,EAAEQ,MAAM,GAAGmB,QAAQ;IACxBe,QAAQ1C,EAAEQ,MAAM,GAAGmB,QAAQ;IAC3BgB,MAAM3C,EAAEY,OAAO;AACjB,GAAG;AAEH,OAAO,MAAMgC,iCAAiC5C,EAAEM,MAAM,CAAC;IACrDuC,OAAO7C,EAAEiB,MAAM,GAAGC,GAAG,GAAG4B,WAAW;IACnCb,MAAMjC,EAAEQ,MAAM;IACduC,QAAQ/C,EAAEQ,MAAM;IAChBwC,YAAYhD,EAAEQ,MAAM,GAAGmB,QAAQ;IAC/BsB,aAAajD,EAAEQ,MAAM,GAAGmB,QAAQ;IAChCuB,QAAQlD,EAAEwB,KAAK,CAACU;AAClB,GAAG;AAEH,OAAO,MAAMiB,2BAA2BnD,EAAEM,MAAM,CAAC;IAC/C4C,QAAQlD,EAAEwB,KAAK,CAACU;AAClB,GAAG"}
@@ -24,6 +24,12 @@ export declare const jobExecutionDtoSchema: z.ZodObject<{
24
24
  event: z.ZodString;
25
25
  delivery_id: z.ZodString;
26
26
  received_at: z.ZodString;
27
+ project: z.ZodNullable<z.ZodObject<{
28
+ id: z.ZodString;
29
+ }, z.core.$strip>>;
30
+ repository: z.ZodNullable<z.ZodString>;
31
+ ref: z.ZodNullable<z.ZodString>;
32
+ commit: z.ZodNullable<z.ZodString>;
27
33
  data: z.ZodUnknown;
28
34
  }, z.core.$strip>>>;
29
35
  outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -176,6 +182,12 @@ export declare const workflowRunJobExecutionDetailDtoSchema: z.ZodObject<{
176
182
  event: z.ZodString;
177
183
  delivery_id: z.ZodString;
178
184
  received_at: z.ZodString;
185
+ project: z.ZodNullable<z.ZodObject<{
186
+ id: z.ZodString;
187
+ }, z.core.$strip>>;
188
+ repository: z.ZodNullable<z.ZodString>;
189
+ ref: z.ZodNullable<z.ZodString>;
190
+ commit: z.ZodNullable<z.ZodString>;
179
191
  data: z.ZodUnknown;
180
192
  }, z.core.$strip>>>;
181
193
  outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -401,6 +413,12 @@ export declare const workflowRunJobDetailDtoSchema: z.ZodObject<{
401
413
  event: z.ZodString;
402
414
  delivery_id: z.ZodString;
403
415
  received_at: z.ZodString;
416
+ project: z.ZodNullable<z.ZodObject<{
417
+ id: z.ZodString;
418
+ }, z.core.$strip>>;
419
+ repository: z.ZodNullable<z.ZodString>;
420
+ ref: z.ZodNullable<z.ZodString>;
421
+ commit: z.ZodNullable<z.ZodString>;
404
422
  data: z.ZodUnknown;
405
423
  }, z.core.$strip>>>;
406
424
  outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -539,7 +557,9 @@ export declare const workflowRunDetailResponseSchema: z.ZodObject<{
539
557
  id: z.ZodString;
540
558
  project_id: z.ZodString;
541
559
  definition_id: z.ZodString;
560
+ number: z.ZodNumber;
542
561
  name: z.ZodString;
562
+ workflow_name: z.ZodString;
543
563
  status: z.ZodEnum<{
544
564
  cancelled: "cancelled";
545
565
  pending: "pending";
@@ -553,6 +573,12 @@ export declare const workflowRunDetailResponseSchema: z.ZodObject<{
553
573
  trigger_source: z.ZodString;
554
574
  trigger_event: z.ZodString;
555
575
  trigger_payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
576
+ trigger_reference: z.ZodNullable<z.ZodObject<{
577
+ repository: z.ZodNullable<z.ZodString>;
578
+ ref: z.ZodNullable<z.ZodString>;
579
+ commit: z.ZodNullable<z.ZodString>;
580
+ actor: z.ZodNullable<z.ZodString>;
581
+ }, z.core.$strip>>;
556
582
  inputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
557
583
  source_snapshot: z.ZodNullable<z.ZodObject<{
558
584
  content: z.ZodString;
@@ -673,6 +699,12 @@ export declare const workflowRunDetailResponseSchema: z.ZodObject<{
673
699
  event: z.ZodString;
674
700
  delivery_id: z.ZodString;
675
701
  received_at: z.ZodString;
702
+ project: z.ZodNullable<z.ZodObject<{
703
+ id: z.ZodString;
704
+ }, z.core.$strip>>;
705
+ repository: z.ZodNullable<z.ZodString>;
706
+ ref: z.ZodNullable<z.ZodString>;
707
+ commit: z.ZodNullable<z.ZodString>;
676
708
  data: z.ZodUnknown;
677
709
  }, z.core.$strip>>>;
678
710
  outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-run-detail.d.ts","sourceRoot":"","sources":["../../src/schemas/workflow-run-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB,eAAO,MAAM,wBAAwB;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAehC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAIpE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEjD,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AAEF,eAAO,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG1C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -56,11 +56,20 @@ export declare const workflowSourceSnapshotSchema: z.ZodObject<{
56
56
  format: z.ZodLiteral<"yaml">;
57
57
  }, z.core.$strip>;
58
58
  export type WorkflowSourceSnapshotDto = z.infer<typeof workflowSourceSnapshotSchema>;
59
+ export declare const workflowRunTriggerReferenceSchema: z.ZodObject<{
60
+ repository: z.ZodNullable<z.ZodString>;
61
+ ref: z.ZodNullable<z.ZodString>;
62
+ commit: z.ZodNullable<z.ZodString>;
63
+ actor: z.ZodNullable<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export type WorkflowRunTriggerReferenceDto = z.infer<typeof workflowRunTriggerReferenceSchema>;
59
66
  export declare const workflowRunDtoSchema: z.ZodObject<{
60
67
  id: z.ZodString;
61
68
  project_id: z.ZodString;
62
69
  definition_id: z.ZodString;
70
+ number: z.ZodNumber;
63
71
  name: z.ZodString;
72
+ workflow_name: z.ZodString;
64
73
  status: z.ZodEnum<{
65
74
  cancelled: "cancelled";
66
75
  pending: "pending";
@@ -74,6 +83,12 @@ export declare const workflowRunDtoSchema: z.ZodObject<{
74
83
  trigger_source: z.ZodString;
75
84
  trigger_event: z.ZodString;
76
85
  trigger_payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
86
+ trigger_reference: z.ZodNullable<z.ZodObject<{
87
+ repository: z.ZodNullable<z.ZodString>;
88
+ ref: z.ZodNullable<z.ZodString>;
89
+ commit: z.ZodNullable<z.ZodString>;
90
+ actor: z.ZodNullable<z.ZodString>;
91
+ }, z.core.$strip>>;
77
92
  inputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
78
93
  source_snapshot: z.ZodNullable<z.ZodObject<{
79
94
  content: z.ZodString;
@@ -109,7 +124,9 @@ export declare const workflowRunResponseSchema: z.ZodObject<{
109
124
  id: z.ZodString;
110
125
  project_id: z.ZodString;
111
126
  definition_id: z.ZodString;
127
+ number: z.ZodNumber;
112
128
  name: z.ZodString;
129
+ workflow_name: z.ZodString;
113
130
  status: z.ZodEnum<{
114
131
  cancelled: "cancelled";
115
132
  pending: "pending";
@@ -123,6 +140,12 @@ export declare const workflowRunResponseSchema: z.ZodObject<{
123
140
  trigger_source: z.ZodString;
124
141
  trigger_event: z.ZodString;
125
142
  trigger_payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
143
+ trigger_reference: z.ZodNullable<z.ZodObject<{
144
+ repository: z.ZodNullable<z.ZodString>;
145
+ ref: z.ZodNullable<z.ZodString>;
146
+ commit: z.ZodNullable<z.ZodString>;
147
+ actor: z.ZodNullable<z.ZodString>;
148
+ }, z.core.$strip>>;
126
149
  inputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
127
150
  source_snapshot: z.ZodNullable<z.ZodObject<{
128
151
  content: z.ZodString;
@@ -156,12 +179,113 @@ export declare const workflowRunAttemptsResponseSchema: z.ZodObject<{
156
179
  }, z.core.$strip>>;
157
180
  }, z.core.$strip>;
158
181
  export type WorkflowRunAttemptsResponseDto = z.infer<typeof workflowRunAttemptsResponseSchema>;
182
+ export declare const workflowRunJobSummaryDtoSchema: z.ZodObject<{
183
+ id: z.ZodString;
184
+ key: z.ZodString;
185
+ name: z.ZodNullable<z.ZodString>;
186
+ status: z.ZodEnum<{
187
+ cancelled: "cancelled";
188
+ pending: "pending";
189
+ running: "running";
190
+ succeeded: "succeeded";
191
+ failed: "failed";
192
+ skipped: "skipped";
193
+ }>;
194
+ position: z.ZodNumber;
195
+ }, z.core.$strip>;
196
+ export type WorkflowRunJobSummaryDto = z.infer<typeof workflowRunJobSummaryDtoSchema>;
197
+ /**
198
+ * How many jobs a run list row carries in graph order.
199
+ *
200
+ * A workflow has no job limit, and the list is polled while runs are active, so the row
201
+ * cannot carry every job of every run on the page. This bound is the API's, deliberately set
202
+ * above what any current surface draws: a client is free to show fewer without a server
203
+ * change, and `job_status_counts` still describes the jobs beyond it.
204
+ */
205
+ export declare const WORKFLOW_RUN_JOB_PREVIEW_LIMIT = 16;
206
+ /** One status and how many of the run's jobs hold it, counted over all of them. */
207
+ export declare const workflowRunJobStatusCountDtoSchema: z.ZodObject<{
208
+ status: z.ZodEnum<{
209
+ cancelled: "cancelled";
210
+ pending: "pending";
211
+ running: "running";
212
+ succeeded: "succeeded";
213
+ failed: "failed";
214
+ skipped: "skipped";
215
+ }>;
216
+ count: z.ZodNumber;
217
+ }, z.core.$strip>;
218
+ export type WorkflowRunJobStatusCountDto = z.infer<typeof workflowRunJobStatusCountDtoSchema>;
219
+ export declare const workflowRunListItemSchema: z.ZodObject<{
220
+ id: z.ZodString;
221
+ project_id: z.ZodString;
222
+ definition_id: z.ZodString;
223
+ number: z.ZodNumber;
224
+ name: z.ZodString;
225
+ workflow_name: z.ZodString;
226
+ status: z.ZodEnum<{
227
+ cancelled: "cancelled";
228
+ pending: "pending";
229
+ running: "running";
230
+ succeeded: "succeeded";
231
+ failed: "failed";
232
+ }>;
233
+ current_attempt: z.ZodNumber;
234
+ latest_attempt: z.ZodNumber;
235
+ trigger_provider: z.ZodNullable<z.ZodString>;
236
+ trigger_source: z.ZodString;
237
+ trigger_event: z.ZodString;
238
+ trigger_payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
239
+ trigger_reference: z.ZodNullable<z.ZodObject<{
240
+ repository: z.ZodNullable<z.ZodString>;
241
+ ref: z.ZodNullable<z.ZodString>;
242
+ commit: z.ZodNullable<z.ZodString>;
243
+ actor: z.ZodNullable<z.ZodString>;
244
+ }, z.core.$strip>>;
245
+ inputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ source_snapshot: z.ZodNullable<z.ZodObject<{
247
+ content: z.ZodString;
248
+ format: z.ZodLiteral<"yaml">;
249
+ }, z.core.$strip>>;
250
+ created_at: z.ZodString;
251
+ updated_at: z.ZodString;
252
+ started_at: z.ZodNullable<z.ZodString>;
253
+ finished_at: z.ZodNullable<z.ZodString>;
254
+ jobs: z.ZodArray<z.ZodObject<{
255
+ id: z.ZodString;
256
+ key: z.ZodString;
257
+ name: z.ZodNullable<z.ZodString>;
258
+ status: z.ZodEnum<{
259
+ cancelled: "cancelled";
260
+ pending: "pending";
261
+ running: "running";
262
+ succeeded: "succeeded";
263
+ failed: "failed";
264
+ skipped: "skipped";
265
+ }>;
266
+ position: z.ZodNumber;
267
+ }, z.core.$strip>>;
268
+ job_status_counts: z.ZodArray<z.ZodObject<{
269
+ status: z.ZodEnum<{
270
+ cancelled: "cancelled";
271
+ pending: "pending";
272
+ running: "running";
273
+ succeeded: "succeeded";
274
+ failed: "failed";
275
+ skipped: "skipped";
276
+ }>;
277
+ count: z.ZodNumber;
278
+ }, z.core.$strip>>;
279
+ }, z.core.$strip>;
280
+ export type WorkflowRunListItemDto = z.infer<typeof workflowRunListItemSchema>;
159
281
  export declare const workflowRunListResponseSchema: z.ZodObject<{
160
282
  runs: z.ZodArray<z.ZodObject<{
161
283
  id: z.ZodString;
162
284
  project_id: z.ZodString;
163
285
  definition_id: z.ZodString;
286
+ number: z.ZodNumber;
164
287
  name: z.ZodString;
288
+ workflow_name: z.ZodString;
165
289
  status: z.ZodEnum<{
166
290
  cancelled: "cancelled";
167
291
  pending: "pending";
@@ -175,6 +299,12 @@ export declare const workflowRunListResponseSchema: z.ZodObject<{
175
299
  trigger_source: z.ZodString;
176
300
  trigger_event: z.ZodString;
177
301
  trigger_payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
302
+ trigger_reference: z.ZodNullable<z.ZodObject<{
303
+ repository: z.ZodNullable<z.ZodString>;
304
+ ref: z.ZodNullable<z.ZodString>;
305
+ commit: z.ZodNullable<z.ZodString>;
306
+ actor: z.ZodNullable<z.ZodString>;
307
+ }, z.core.$strip>>;
178
308
  inputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
179
309
  source_snapshot: z.ZodNullable<z.ZodObject<{
180
310
  content: z.ZodString;
@@ -184,6 +314,31 @@ export declare const workflowRunListResponseSchema: z.ZodObject<{
184
314
  updated_at: z.ZodString;
185
315
  started_at: z.ZodNullable<z.ZodString>;
186
316
  finished_at: z.ZodNullable<z.ZodString>;
317
+ jobs: z.ZodArray<z.ZodObject<{
318
+ id: z.ZodString;
319
+ key: z.ZodString;
320
+ name: z.ZodNullable<z.ZodString>;
321
+ status: z.ZodEnum<{
322
+ cancelled: "cancelled";
323
+ pending: "pending";
324
+ running: "running";
325
+ succeeded: "succeeded";
326
+ failed: "failed";
327
+ skipped: "skipped";
328
+ }>;
329
+ position: z.ZodNumber;
330
+ }, z.core.$strip>>;
331
+ job_status_counts: z.ZodArray<z.ZodObject<{
332
+ status: z.ZodEnum<{
333
+ cancelled: "cancelled";
334
+ pending: "pending";
335
+ running: "running";
336
+ succeeded: "succeeded";
337
+ failed: "failed";
338
+ skipped: "skipped";
339
+ }>;
340
+ count: z.ZodNumber;
341
+ }, z.core.$strip>>;
187
342
  }, z.core.$strip>>;
188
343
  next_cursor: z.ZodNullable<z.ZodString>;
189
344
  filtered_total_count: z.ZodNullable<z.ZodNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../src/schemas/workflow-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,uBAAuB;;;;;;EAMlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,0BAA0B;;;EAA4B,CAAC;AAEpE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAO,MAAM,0BAA0B;;;;;iBAErC,CAAC;AAEH,MAAM,MAAM,uBAAuB,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;;;;;;;;;;iBAIxC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAOvF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;iBAM9C,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { jobStatusSchema } from './job.js';
2
3
  export const workflowRunStatusSchema = z.enum([
3
4
  'pending',
4
5
  'running',
@@ -58,11 +59,22 @@ export const workflowSourceSnapshotSchema = z.object({
58
59
  content: z.string(),
59
60
  format: z.literal('yaml')
60
61
  });
62
+ // Provider-neutral trigger facts captured at run creation. Every field is nullable because
63
+ // only source-control triggers resolve one at all, and a given payload may name a ref
64
+ // without naming an actor.
65
+ export const workflowRunTriggerReferenceSchema = z.object({
66
+ repository: z.string().nullable(),
67
+ ref: z.string().nullable(),
68
+ commit: z.string().nullable(),
69
+ actor: z.string().nullable()
70
+ });
61
71
  export const workflowRunDtoSchema = z.object({
62
72
  id: z.string().uuid(),
63
73
  project_id: z.string().uuid(),
64
74
  definition_id: z.string().uuid(),
75
+ number: z.number().int().positive(),
65
76
  name: z.string(),
77
+ workflow_name: z.string(),
66
78
  status: workflowRunStatusSchema,
67
79
  current_attempt: z.number().int().positive(),
68
80
  latest_attempt: z.number().int().positive(),
@@ -70,6 +82,7 @@ export const workflowRunDtoSchema = z.object({
70
82
  trigger_source: z.string(),
71
83
  trigger_event: z.string(),
72
84
  trigger_payload: z.record(z.string(), z.unknown()),
85
+ trigger_reference: workflowRunTriggerReferenceSchema.nullable(),
73
86
  inputs: z.record(z.string(), z.unknown()).nullable(),
74
87
  source_snapshot: workflowSourceSnapshotSchema.nullable(),
75
88
  created_at: z.string(),
@@ -91,8 +104,33 @@ export const workflowRunResponseSchema = workflowRunDtoSchema;
91
104
  export const workflowRunAttemptsResponseSchema = z.object({
92
105
  attempts: z.array(workflowRunAttemptDtoSchema)
93
106
  });
107
+ // The run list renders a status glyph per job so a failing run can be read without being
108
+ // opened, which needs the current attempt's jobs in graph order but none of their steps.
109
+ export const workflowRunJobSummaryDtoSchema = z.object({
110
+ id: z.string().uuid(),
111
+ key: z.string(),
112
+ name: z.string().nullable(),
113
+ status: jobStatusSchema,
114
+ position: z.number().int().nonnegative()
115
+ });
116
+ /**
117
+ * How many jobs a run list row carries in graph order.
118
+ *
119
+ * A workflow has no job limit, and the list is polled while runs are active, so the row
120
+ * cannot carry every job of every run on the page. This bound is the API's, deliberately set
121
+ * above what any current surface draws: a client is free to show fewer without a server
122
+ * change, and `job_status_counts` still describes the jobs beyond it.
123
+ */ export const WORKFLOW_RUN_JOB_PREVIEW_LIMIT = 16;
124
+ /** One status and how many of the run's jobs hold it, counted over all of them. */ export const workflowRunJobStatusCountDtoSchema = z.object({
125
+ status: jobStatusSchema,
126
+ count: z.number().int().positive()
127
+ });
128
+ export const workflowRunListItemSchema = workflowRunResponseSchema.extend({
129
+ /** Up to `WORKFLOW_RUN_JOB_PREVIEW_LIMIT` jobs in graph order, not the whole set. */ jobs: z.array(workflowRunJobSummaryDtoSchema).max(WORKFLOW_RUN_JOB_PREVIEW_LIMIT),
130
+ /** Counted over every job of the attempt, including those past the preview. */ job_status_counts: z.array(workflowRunJobStatusCountDtoSchema)
131
+ });
94
132
  export const workflowRunListResponseSchema = z.object({
95
- runs: z.array(workflowRunResponseSchema),
133
+ runs: z.array(workflowRunListItemSchema),
96
134
  next_cursor: z.string().nullable(),
97
135
  filtered_total_count: z.number().int().nonnegative().nullable()
98
136
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/workflow-run.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const workflowRunStatusSchema = z.enum([\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n]);\n\nexport type WorkflowRunStatusDto = z.infer<typeof workflowRunStatusSchema>;\n\nexport const workflowRunRerunModeSchema = z.enum(['all', 'failed']);\n\nexport type WorkflowRunRerunModeDto = z.infer<typeof workflowRunRerunModeSchema>;\n\nexport const rerunWorkflowRunBodySchema = z.object({\n mode: workflowRunRerunModeSchema,\n});\n\nexport type RerunWorkflowRunBodyDto = z.infer<typeof rerunWorkflowRunBodySchema>;\n\nconst isoDateTimeSchema = z.string().datetime();\nconst runListQueryBaseSchema = z.object({\n project_id: z.string().uuid(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n cursor: z.string().optional(),\n status: workflowRunStatusSchema.optional(),\n definition_id: z.string().uuid().optional(),\n trigger_source: z.string().optional(),\n created_from: isoDateTimeSchema.optional(),\n created_to: isoDateTimeSchema.optional(),\n});\n\nfunction validateDateWindow(\n value: {created_from?: string | undefined; created_to?: string | undefined},\n ctx: z.RefinementCtx,\n) {\n if (!value.created_from || !value.created_to) return;\n const from = new Date(value.created_from);\n const to = new Date(value.created_to);\n if (from > to) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'created_from must be before or equal to created_to',\n path: ['created_from'],\n });\n return;\n }\n\n const maxWindowMs = 365 * 24 * 60 * 60 * 1000;\n if (to.getTime() - from.getTime() > maxWindowMs) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'created date window must be 365 days or less',\n path: ['created_to'],\n });\n }\n}\n\nexport const workflowRunListQuerySchema = runListQueryBaseSchema.superRefine(validateDateWindow);\n\nexport type WorkflowRunListQueryDto = z.infer<typeof workflowRunListQuerySchema>;\n\nexport const workflowRunAggregatesQuerySchema = runListQueryBaseSchema\n .omit({limit: true, cursor: true})\n .superRefine(validateDateWindow);\n\nexport type WorkflowRunAggregatesQueryDto = z.infer<typeof workflowRunAggregatesQuerySchema>;\n\nexport const workflowSourceSnapshotSchema = z.object({\n content: z.string(),\n format: z.literal('yaml'),\n});\n\nexport type WorkflowSourceSnapshotDto = z.infer<typeof workflowSourceSnapshotSchema>;\n\nexport const workflowRunDtoSchema = z.object({\n id: z.string().uuid(),\n project_id: z.string().uuid(),\n definition_id: z.string().uuid(),\n name: z.string(),\n status: workflowRunStatusSchema,\n current_attempt: z.number().int().positive(),\n latest_attempt: z.number().int().positive(),\n trigger_provider: z.string().nullable(),\n trigger_source: z.string(),\n trigger_event: z.string(),\n trigger_payload: z.record(z.string(), z.unknown()),\n inputs: z.record(z.string(), z.unknown()).nullable(),\n source_snapshot: workflowSourceSnapshotSchema.nullable(),\n created_at: z.string(),\n updated_at: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n});\n\nexport type WorkflowRunDto = z.infer<typeof workflowRunDtoSchema>;\n\nexport const workflowRunAttemptDtoSchema = z.object({\n id: z.string().uuid(),\n workflow_run_id: z.string().uuid(),\n attempt: z.number().int().positive(),\n status: workflowRunStatusSchema,\n created_at: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n rerun_mode: workflowRunRerunModeSchema.nullable(),\n});\n\nexport type WorkflowRunAttemptDto = z.infer<typeof workflowRunAttemptDtoSchema>;\n\nexport const workflowRunResponseSchema = workflowRunDtoSchema;\n\nexport type WorkflowRunResponseDto = z.infer<typeof workflowRunResponseSchema>;\n\nexport const workflowRunAttemptsResponseSchema = z.object({\n attempts: z.array(workflowRunAttemptDtoSchema),\n});\n\nexport type WorkflowRunAttemptsResponseDto = z.infer<typeof workflowRunAttemptsResponseSchema>;\n\nexport const workflowRunListResponseSchema = z.object({\n runs: z.array(workflowRunResponseSchema),\n next_cursor: z.string().nullable(),\n filtered_total_count: z.number().int().nonnegative().nullable(),\n});\n\nexport type WorkflowRunListResponseDto = z.infer<typeof workflowRunListResponseSchema>;\n\nconst aggregateBucketSchema = z.object({\n value: z.string(),\n count: z.number().int().nonnegative(),\n});\n\nexport const workflowRunAggregatesResponseSchema = z.object({\n status: z.array(\n z.object({value: workflowRunStatusSchema, count: z.number().int().nonnegative()}),\n ),\n trigger_source: z.array(aggregateBucketSchema),\n workflow: z.array(aggregateBucketSchema),\n});\n\nexport type WorkflowRunAggregatesResponseDto = z.infer<typeof workflowRunAggregatesResponseSchema>;\n"],"names":["z","workflowRunStatusSchema","enum","workflowRunRerunModeSchema","rerunWorkflowRunBodySchema","object","mode","isoDateTimeSchema","string","datetime","runListQueryBaseSchema","project_id","uuid","limit","coerce","number","int","min","max","default","cursor","optional","status","definition_id","trigger_source","created_from","created_to","validateDateWindow","value","ctx","from","Date","to","addIssue","code","ZodIssueCode","custom","message","path","maxWindowMs","getTime","workflowRunListQuerySchema","superRefine","workflowRunAggregatesQuerySchema","omit","workflowSourceSnapshotSchema","content","format","literal","workflowRunDtoSchema","id","name","current_attempt","positive","latest_attempt","trigger_provider","nullable","trigger_event","trigger_payload","record","unknown","inputs","source_snapshot","created_at","updated_at","started_at","finished_at","workflowRunAttemptDtoSchema","workflow_run_id","attempt","rerun_mode","workflowRunResponseSchema","workflowRunAttemptsResponseSchema","attempts","array","workflowRunListResponseSchema","runs","next_cursor","filtered_total_count","nonnegative","aggregateBucketSchema","count","workflowRunAggregatesResponseSchema","workflow"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,0BAA0BD,EAAEE,IAAI,CAAC;IAC5C;IACA;IACA;IACA;IACA;CACD,EAAE;AAIH,OAAO,MAAMC,6BAA6BH,EAAEE,IAAI,CAAC;IAAC;IAAO;CAAS,EAAE;AAIpE,OAAO,MAAME,6BAA6BJ,EAAEK,MAAM,CAAC;IACjDC,MAAMH;AACR,GAAG;AAIH,MAAMI,oBAAoBP,EAAEQ,MAAM,GAAGC,QAAQ;AAC7C,MAAMC,yBAAyBV,EAAEK,MAAM,CAAC;IACtCM,YAAYX,EAAEQ,MAAM,GAAGI,IAAI;IAC3BC,OAAOb,EAAEc,MAAM,CAACC,MAAM,GAAGC,GAAG,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC,KAAKC,OAAO,CAAC;IACvDC,QAAQpB,EAAEQ,MAAM,GAAGa,QAAQ;IAC3BC,Q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AgC3E,EAAEK,MAAM,CAAC;IACpDuE,MAAM5E,EAAE0E,KAAK,CAACH;IACdM,aAAa7E,EAAEQ,MAAM,GAAGgD,QAAQ;IAChCsB,sBAAsB9E,EAAEe,MAAM,GAAGC,GAAG,GAAG+D,WAAW,GAAGvB,QAAQ;AAC/D,GAAG;AAIH,MAAMwB,wBAAwBhF,EAAEK,MAAM,CAAC;IACrCuB,OAAO5B,EAAEQ,MAAM;IACfyE,OAAOjF,EAAEe,MAAM,GAAGC,GAAG,GAAG+D,WAAW;AACrC;AAEA,OAAO,MAAMG,sCAAsClF,EAAEK,MAAM,CAAC;IAC1DiB,QAAQtB,EAAE0E,KAAK,CACb1E,EAAEK,MAAM,CAAC;QAACuB,OAAO3B;QAAyBgF,OAAOjF,EAAEe,MAAM,GAAGC,GAAG,GAAG+D,WAAW;IAAE;IAEjFvD,gBAAgBxB,EAAE0E,KAAK,CAACM;IACxBG,UAAUnF,EAAE0E,KAAK,CAACM;AACpB,GAAG"}
1
+ {"version":3,"sources":["../../src/schemas/workflow-run.ts"],"sourcesContent":["import {z} from 'zod';\nimport {jobStatusSchema} from './job.js';\n\nexport const workflowRunStatusSchema = z.enum([\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n]);\n\nexport type WorkflowRunStatusDto = z.infer<typeof workflowRunStatusSchema>;\n\nexport const workflowRunRerunModeSchema = z.enum(['all', 'failed']);\n\nexport type WorkflowRunRerunModeDto = z.infer<typeof workflowRunRerunModeSchema>;\n\nexport const rerunWorkflowRunBodySchema = z.object({\n mode: workflowRunRerunModeSchema,\n});\n\nexport type RerunWorkflowRunBodyDto = z.infer<typeof rerunWorkflowRunBodySchema>;\n\nconst isoDateTimeSchema = z.string().datetime();\nconst runListQueryBaseSchema = z.object({\n project_id: z.string().uuid(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n cursor: z.string().optional(),\n status: workflowRunStatusSchema.optional(),\n definition_id: z.string().uuid().optional(),\n trigger_source: z.string().optional(),\n created_from: isoDateTimeSchema.optional(),\n created_to: isoDateTimeSchema.optional(),\n});\n\nfunction validateDateWindow(\n value: {created_from?: string | undefined; created_to?: string | undefined},\n ctx: z.RefinementCtx,\n) {\n if (!value.created_from || !value.created_to) return;\n const from = new Date(value.created_from);\n const to = new Date(value.created_to);\n if (from > to) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'created_from must be before or equal to created_to',\n path: ['created_from'],\n });\n return;\n }\n\n const maxWindowMs = 365 * 24 * 60 * 60 * 1000;\n if (to.getTime() - from.getTime() > maxWindowMs) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'created date window must be 365 days or less',\n path: ['created_to'],\n });\n }\n}\n\nexport const workflowRunListQuerySchema = runListQueryBaseSchema.superRefine(validateDateWindow);\n\nexport type WorkflowRunListQueryDto = z.infer<typeof workflowRunListQuerySchema>;\n\nexport const workflowRunAggregatesQuerySchema = runListQueryBaseSchema\n .omit({limit: true, cursor: true})\n .superRefine(validateDateWindow);\n\nexport type WorkflowRunAggregatesQueryDto = z.infer<typeof workflowRunAggregatesQuerySchema>;\n\nexport const workflowSourceSnapshotSchema = z.object({\n content: z.string(),\n format: z.literal('yaml'),\n});\n\nexport type WorkflowSourceSnapshotDto = z.infer<typeof workflowSourceSnapshotSchema>;\n\n// Provider-neutral trigger facts captured at run creation. Every field is nullable because\n// only source-control triggers resolve one at all, and a given payload may name a ref\n// without naming an actor.\nexport const workflowRunTriggerReferenceSchema = z.object({\n repository: z.string().nullable(),\n ref: z.string().nullable(),\n commit: z.string().nullable(),\n actor: z.string().nullable(),\n});\n\nexport type WorkflowRunTriggerReferenceDto = z.infer<typeof workflowRunTriggerReferenceSchema>;\n\nexport const workflowRunDtoSchema = z.object({\n id: z.string().uuid(),\n project_id: z.string().uuid(),\n definition_id: z.string().uuid(),\n number: z.number().int().positive(),\n name: z.string(),\n workflow_name: z.string(),\n status: workflowRunStatusSchema,\n current_attempt: z.number().int().positive(),\n latest_attempt: z.number().int().positive(),\n trigger_provider: z.string().nullable(),\n trigger_source: z.string(),\n trigger_event: z.string(),\n trigger_payload: z.record(z.string(), z.unknown()),\n trigger_reference: workflowRunTriggerReferenceSchema.nullable(),\n inputs: z.record(z.string(), z.unknown()).nullable(),\n source_snapshot: workflowSourceSnapshotSchema.nullable(),\n created_at: z.string(),\n updated_at: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n});\n\nexport type WorkflowRunDto = z.infer<typeof workflowRunDtoSchema>;\n\nexport const workflowRunAttemptDtoSchema = z.object({\n id: z.string().uuid(),\n workflow_run_id: z.string().uuid(),\n attempt: z.number().int().positive(),\n status: workflowRunStatusSchema,\n created_at: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n rerun_mode: workflowRunRerunModeSchema.nullable(),\n});\n\nexport type WorkflowRunAttemptDto = z.infer<typeof workflowRunAttemptDtoSchema>;\n\nexport const workflowRunResponseSchema = workflowRunDtoSchema;\n\nexport type WorkflowRunResponseDto = z.infer<typeof workflowRunResponseSchema>;\n\nexport const workflowRunAttemptsResponseSchema = z.object({\n attempts: z.array(workflowRunAttemptDtoSchema),\n});\n\nexport type WorkflowRunAttemptsResponseDto = z.infer<typeof workflowRunAttemptsResponseSchema>;\n\n// The run list renders a status glyph per job so a failing run can be read without being\n// opened, which needs the current attempt's jobs in graph order but none of their steps.\nexport const workflowRunJobSummaryDtoSchema = z.object({\n id: z.string().uuid(),\n key: z.string(),\n name: z.string().nullable(),\n status: jobStatusSchema,\n position: z.number().int().nonnegative(),\n});\n\nexport type WorkflowRunJobSummaryDto = z.infer<typeof workflowRunJobSummaryDtoSchema>;\n\n/**\n * How many jobs a run list row carries in graph order.\n *\n * A workflow has no job limit, and the list is polled while runs are active, so the row\n * cannot carry every job of every run on the page. This bound is the API's, deliberately set\n * above what any current surface draws: a client is free to show fewer without a server\n * change, and `job_status_counts` still describes the jobs beyond it.\n */\nexport const WORKFLOW_RUN_JOB_PREVIEW_LIMIT = 16;\n\n/** One status and how many of the run's jobs hold it, counted over all of them. */\nexport const workflowRunJobStatusCountDtoSchema = z.object({\n status: jobStatusSchema,\n count: z.number().int().positive(),\n});\n\nexport type WorkflowRunJobStatusCountDto = z.infer<typeof workflowRunJobStatusCountDtoSchema>;\n\nexport const workflowRunListItemSchema = workflowRunResponseSchema.extend({\n /** Up to `WORKFLOW_RUN_JOB_PREVIEW_LIMIT` jobs in graph order, not the whole set. */\n jobs: z.array(workflowRunJobSummaryDtoSchema).max(WORKFLOW_RUN_JOB_PREVIEW_LIMIT),\n /** Counted over every job of the attempt, including those past the preview. */\n job_status_counts: z.array(workflowRunJobStatusCountDtoSchema),\n});\n\nexport type WorkflowRunListItemDto = z.infer<typeof workflowRunListItemSchema>;\n\nexport const workflowRunListResponseSchema = z.object({\n runs: z.array(workflowRunListItemSchema),\n next_cursor: z.string().nullable(),\n filtered_total_count: z.number().int().nonnegative().nullable(),\n});\n\nexport type WorkflowRunListResponseDto = z.infer<typeof workflowRunListResponseSchema>;\n\nconst aggregateBucketSchema = z.object({\n value: z.string(),\n count: z.number().int().nonnegative(),\n});\n\nexport const workflowRunAggregatesResponseSchema = z.object({\n status: z.array(\n z.object({value: workflowRunStatusSchema, count: z.number().int().nonnegative()}),\n ),\n trigger_source: z.array(aggregateBucketSchema),\n workflow: z.array(aggregateBucketSchema),\n});\n\nexport type WorkflowRunAggregatesResponseDto = z.infer<typeof workflowRunAggregatesResponseSchema>;\n"],"names":["z","jobStatusSchema","workflowRunStatusSchema","enum","workflowRunRerunModeSchema","rerunWorkflowRunBodySchema","object","mode","isoDateTimeSchema","string","datetime","runListQueryBaseSchema","project_id","uuid","limit","coerce","number","int","min","max","default","cursor","optional","status","definition_id","trigger_source","created_from","created_to","validateDateWindow","value","ctx","from","Date","to","addIssue","code","ZodIssueCode","custom","message","path","maxWindowMs","getTime","workflowRunListQuerySchema","superRefine","workflowRunAggregatesQuerySchema","omit","workflowSourceSnapshotSchema","content","format","literal","workflowRunTriggerReferenceSchema","repository","nullable","ref","commit","actor","workflowRunDtoSchema","id","positive","name","workflow_name","current_attempt","latest_attempt","trigger_provider","trigger_event","trigger_payload","record","unknown","trigger_reference","inputs","source_snapshot","created_at","updated_at","started_at","finished_at","workflowRunAttemptDtoSchema","workflow_run_id","attempt","rerun_mode","workflowRunResponseSchema","workflowRunAttemptsResponseSchema","attempts","array","workflowRunJobSummaryDtoSchema","key","position","nonnegative","WORKFLOW_RUN_JOB_PREVIEW_LIMIT","workflowRunJobStatusCountDtoSchema","count","workflowRunListItemSchema","extend","jobs","job_status_counts","workflowRunListResponseSchema","runs","next_cursor","filtered_total_count","aggregateBucketSchema","workflowRunAggregatesResponseSchema","workflow"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AACtB,SAAQC,eAAe,QAAO,WAAW;AAEzC,OAAO,MAAMC,0BAA0BF,EAAEG,IAAI,CAAC;IAC5C;IACA;IACA;IACA;IACA;CACD,EAAE;AAIH,OAAO,MAAMC,6BAA6BJ,EAAEG,IAAI,CAAC;IAAC;IAAO;CAAS,EAAE;AAIpE,OAAO,MAAME,6BAA6BL,EAAEM,MAAM,CAAC;IACjDC,MAAMH;AACR,GAAG;AAIH,MAAMI,oBAAoBR,EAAES,MAAM,GAAGC,QAAQ;AAC7C,MAAMC,yBAAyBX,EAAEM,MAAM,CAAC;IACtCM,YAAYZ,EAAES,MAAM,GAAGI,IAAI;IAC3BC,OAAOd,EAAEe,MAAM,CAACC,MAAM,GAAGC,GAAG,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC,KAAKC,OAAO,CAAC;IACvDC,QAAQrB,EAAES,MAAM,GAAGa,QAAQ;IAC3BC,QAAQrB,wBAAwBoB,QAAQ;IACxCE,eAAexB,EAAES,MAAM,GAAGI,IAAI,GAAGS,QAAQ;IACzCG,gBAAgBzB,EAAES,MAAM,GAAGa,QAAQ;IACnCI,cAAclB,kBAAkBc,QAAQ;IACxCK,YAAYnB,kBAAkBc,QAAQ;AACxC;AAEA,SAAS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