@shipfox/api-definitions 12.3.0 → 14.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 (223) hide show
  1. package/.turbo/turbo-build.log +11 -11
  2. package/CHANGELOG.md +45 -0
  3. package/dist/core/entities/index.d.ts +1 -1
  4. package/dist/core/entities/index.d.ts.map +1 -1
  5. package/dist/core/entities/index.js +1 -1
  6. package/dist/core/entities/index.js.map +1 -1
  7. package/dist/core/entities/integration-context.d.ts +4 -0
  8. package/dist/core/entities/integration-context.d.ts.map +1 -1
  9. package/dist/core/entities/integration-context.js.map +1 -1
  10. package/dist/core/entities/sync-state.d.ts +10 -4
  11. package/dist/core/entities/sync-state.d.ts.map +1 -1
  12. package/dist/core/entities/sync-state.js +26 -7
  13. package/dist/core/entities/sync-state.js.map +1 -1
  14. package/dist/core/entities/validation-diagnostic.d.ts +8 -0
  15. package/dist/core/entities/validation-diagnostic.d.ts.map +1 -0
  16. package/dist/core/entities/validation-diagnostic.js +3 -0
  17. package/dist/core/entities/validation-diagnostic.js.map +1 -0
  18. package/dist/core/entities/workflow-definition.d.ts +2 -0
  19. package/dist/core/entities/workflow-definition.d.ts.map +1 -1
  20. package/dist/core/entities/workflow-definition.js.map +1 -1
  21. package/dist/core/errors.d.ts +10 -0
  22. package/dist/core/errors.d.ts.map +1 -1
  23. package/dist/core/errors.js +9 -0
  24. package/dist/core/errors.js.map +1 -1
  25. package/dist/core/index.d.ts +2 -1
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/core/index.js +2 -1
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/core/integrations.d.ts +3 -1
  30. package/dist/core/integrations.d.ts.map +1 -1
  31. package/dist/core/integrations.js +10 -2
  32. package/dist/core/integrations.js.map +1 -1
  33. package/dist/core/parse-definition.d.ts +4 -4
  34. package/dist/core/parse-definition.d.ts.map +1 -1
  35. package/dist/core/parse-definition.js +5 -5
  36. package/dist/core/parse-definition.js.map +1 -1
  37. package/dist/core/resolve-definition-at-ref.d.ts +66 -0
  38. package/dist/core/resolve-definition-at-ref.d.ts.map +1 -0
  39. package/dist/core/resolve-definition-at-ref.js +374 -0
  40. package/dist/core/resolve-definition-at-ref.js.map +1 -0
  41. package/dist/core/sync-definitions.d.ts +2 -2
  42. package/dist/core/sync-definitions.d.ts.map +1 -1
  43. package/dist/core/sync-definitions.js +5 -5
  44. package/dist/core/sync-definitions.js.map +1 -1
  45. package/dist/core/validate-definition.d.ts +3 -3
  46. package/dist/core/validate-definition.d.ts.map +1 -1
  47. package/dist/core/validate-definition.js +17 -12
  48. package/dist/core/validate-definition.js.map +1 -1
  49. package/dist/core/workflow-model/cron-trigger.d.ts +1 -1
  50. package/dist/core/workflow-model/cron-trigger.d.ts.map +1 -1
  51. package/dist/core/workflow-model/cron-trigger.js +9 -5
  52. package/dist/core/workflow-model/cron-trigger.js.map +1 -1
  53. package/dist/core/workflow-model/index.d.ts +1 -1
  54. package/dist/core/workflow-model/index.d.ts.map +1 -1
  55. package/dist/core/workflow-model/index.js.map +1 -1
  56. package/dist/core/workflow-model/invalid-workflow-model-error.d.ts +4 -2
  57. package/dist/core/workflow-model/invalid-workflow-model-error.d.ts.map +1 -1
  58. package/dist/core/workflow-model/invalid-workflow-model-error.js.map +1 -1
  59. package/dist/core/workflow-model/normalize-job-listening.d.ts.map +1 -1
  60. package/dist/core/workflow-model/normalize-job-listening.js +51 -30
  61. package/dist/core/workflow-model/normalize-job-listening.js.map +1 -1
  62. package/dist/core/workflow-model/normalize-triggers.d.ts +1 -1
  63. package/dist/core/workflow-model/normalize-triggers.d.ts.map +1 -1
  64. package/dist/core/workflow-model/normalize-triggers.js +48 -18
  65. package/dist/core/workflow-model/normalize-triggers.js.map +1 -1
  66. package/dist/core/workflow-model/normalize-workflow-document.d.ts +1 -1
  67. package/dist/core/workflow-model/normalize-workflow-document.d.ts.map +1 -1
  68. package/dist/core/workflow-model/normalize-workflow-document.js +3 -3
  69. package/dist/core/workflow-model/normalize-workflow-document.js.map +1 -1
  70. package/dist/core/workflow-model/parse-interpolation-field.d.ts.map +1 -1
  71. package/dist/core/workflow-model/parse-interpolation-field.js +1 -15
  72. package/dist/core/workflow-model/parse-interpolation-field.js.map +1 -1
  73. package/dist/core/workflow-model/validate-predicate-expression.d.ts +3 -1
  74. package/dist/core/workflow-model/validate-predicate-expression.d.ts.map +1 -1
  75. package/dist/core/workflow-model/validate-predicate-expression.js +3 -0
  76. package/dist/core/workflow-model/validate-predicate-expression.js.map +1 -1
  77. package/dist/core/workflow-model/validation-issue.d.ts +2 -1
  78. package/dist/core/workflow-model/validation-issue.d.ts.map +1 -1
  79. package/dist/core/workflow-model/validation-issue.js +12 -15
  80. package/dist/core/workflow-model/validation-issue.js.map +1 -1
  81. package/dist/db/db.d.ts +196 -4
  82. package/dist/db/db.d.ts.map +1 -1
  83. package/dist/db/db.js +3 -1
  84. package/dist/db/db.js.map +1 -1
  85. package/dist/db/definition-triggers.js +3 -1
  86. package/dist/db/definition-triggers.js.map +1 -1
  87. package/dist/db/definitions.d.ts +17 -0
  88. package/dist/db/definitions.d.ts.map +1 -1
  89. package/dist/db/definitions.js +190 -23
  90. package/dist/db/definitions.js.map +1 -1
  91. package/dist/db/index.d.ts +2 -1
  92. package/dist/db/index.d.ts.map +1 -1
  93. package/dist/db/index.js +2 -1
  94. package/dist/db/index.js.map +1 -1
  95. package/dist/db/schema/definitions.d.ts +17 -0
  96. package/dist/db/schema/definitions.d.ts.map +1 -1
  97. package/dist/db/schema/definitions.js +8 -0
  98. package/dist/db/schema/definitions.js.map +1 -1
  99. package/dist/db/schema/sync-states.d.ts +7 -3
  100. package/dist/db/schema/sync-states.d.ts.map +1 -1
  101. package/dist/db/schema/sync-states.js +5 -1
  102. package/dist/db/schema/sync-states.js.map +1 -1
  103. package/dist/db/schema/workflows.d.ts +78 -0
  104. package/dist/db/schema/workflows.d.ts.map +1 -0
  105. package/dist/db/schema/workflows.js +17 -0
  106. package/dist/db/schema/workflows.js.map +1 -0
  107. package/dist/db/sync-states.d.ts +2 -2
  108. package/dist/db/sync-states.d.ts.map +1 -1
  109. package/dist/db/sync-states.js +4 -4
  110. package/dist/db/sync-states.js.map +1 -1
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +5 -1
  113. package/dist/index.js.map +1 -1
  114. package/dist/metrics/index.d.ts +2 -0
  115. package/dist/metrics/index.d.ts.map +1 -0
  116. package/dist/metrics/index.js +3 -0
  117. package/dist/metrics/index.js.map +1 -0
  118. package/dist/metrics/instance.d.ts +4 -0
  119. package/dist/metrics/instance.d.ts.map +1 -0
  120. package/dist/metrics/instance.js +19 -0
  121. package/dist/metrics/instance.js.map +1 -0
  122. package/dist/presentation/dto/definition.d.ts.map +1 -1
  123. package/dist/presentation/dto/definition.js +11 -4
  124. package/dist/presentation/dto/definition.js.map +1 -1
  125. package/dist/presentation/inter-module.d.ts +9 -1
  126. package/dist/presentation/inter-module.d.ts.map +1 -1
  127. package/dist/presentation/inter-module.js +66 -2
  128. package/dist/presentation/inter-module.js.map +1 -1
  129. package/dist/presentation/routes/create-definition.d.ts.map +1 -1
  130. package/dist/presentation/routes/create-definition.js +16 -3
  131. package/dist/presentation/routes/create-definition.js.map +1 -1
  132. package/dist/presentation/routes/get-definition.d.ts.map +1 -1
  133. package/dist/presentation/routes/get-definition.js +18 -4
  134. package/dist/presentation/routes/get-definition.js.map +1 -1
  135. package/dist/presentation/routes/project-access.d.ts +1 -0
  136. package/dist/presentation/routes/project-access.d.ts.map +1 -1
  137. package/dist/presentation/routes/validate-definition.js +3 -3
  138. package/dist/presentation/routes/validate-definition.js.map +1 -1
  139. package/dist/temporal/activities/sync-activities.d.ts +3 -3
  140. package/dist/temporal/activities/sync-activities.d.ts.map +1 -1
  141. package/dist/temporal/activities/sync-activities.js +7 -4
  142. package/dist/temporal/activities/sync-activities.js.map +1 -1
  143. package/dist/temporal/workflows/definition-sync.js +1 -1
  144. package/dist/temporal/workflows/definition-sync.js.map +1 -1
  145. package/dist/temporal/workflows/index.bundle.js +50 -22
  146. package/dist/tsconfig.test.tsbuildinfo +1 -1
  147. package/drizzle/0003_nebulous_nemesis.sql +11 -0
  148. package/drizzle/0004_workflow_ref_lookup.sql +1 -0
  149. package/drizzle/meta/0003_snapshot.json +627 -0
  150. package/drizzle/meta/0004_snapshot.json +649 -0
  151. package/drizzle/meta/_journal.json +14 -0
  152. package/drizzle.config.ts +1 -0
  153. package/package.json +7 -7
  154. package/src/core/entities/index.ts +1 -1
  155. package/src/core/entities/integration-context.ts +4 -0
  156. package/src/core/entities/sync-state.test.ts +49 -0
  157. package/src/core/entities/sync-state.ts +35 -12
  158. package/src/core/entities/validation-diagnostic.ts +8 -0
  159. package/src/core/entities/workflow-definition.ts +2 -0
  160. package/src/core/errors.ts +26 -0
  161. package/src/core/index.ts +12 -0
  162. package/src/core/integrations.test.ts +38 -0
  163. package/src/core/integrations.ts +10 -1
  164. package/src/core/parse-definition-diagnostics.test.ts +47 -0
  165. package/src/core/parse-definition.test.ts +29 -5
  166. package/src/core/parse-definition.ts +7 -7
  167. package/src/core/resolve-definition-at-ref.test.ts +792 -0
  168. package/src/core/resolve-definition-at-ref.ts +551 -0
  169. package/src/core/sync-definitions.test.ts +61 -2
  170. package/src/core/sync-definitions.ts +7 -7
  171. package/src/core/validate-definition.test.ts +31 -22
  172. package/src/core/validate-definition.ts +21 -13
  173. package/src/core/workflow-model/cron-trigger.ts +6 -2
  174. package/src/core/workflow-model/index.ts +1 -0
  175. package/src/core/workflow-model/invalid-workflow-model-error.ts +5 -1
  176. package/src/core/workflow-model/normalize-job-listening.ts +55 -23
  177. package/src/core/workflow-model/normalize-triggers.ts +44 -15
  178. package/src/core/workflow-model/normalize-workflow-document.test.ts +494 -36
  179. package/src/core/workflow-model/normalize-workflow-document.ts +8 -4
  180. package/src/core/workflow-model/parse-interpolation-field.ts +1 -23
  181. package/src/core/workflow-model/validate-predicate-expression.ts +6 -0
  182. package/src/core/workflow-model/validation-issue.ts +8 -13
  183. package/src/db/db.ts +7 -1
  184. package/src/db/definition-triggers.test.ts +44 -0
  185. package/src/db/definition-triggers.ts +1 -1
  186. package/src/db/definitions.test.ts +300 -1
  187. package/src/db/definitions.ts +282 -28
  188. package/src/db/index.ts +2 -0
  189. package/src/db/schema/definitions.test.ts +1 -0
  190. package/src/db/schema/definitions.ts +11 -0
  191. package/src/db/schema/sync-states.ts +12 -3
  192. package/src/db/schema/workflows.ts +23 -0
  193. package/src/db/sync-states.test.ts +87 -18
  194. package/src/db/sync-states.ts +6 -6
  195. package/src/db/workflow-lineage-migration.test.ts +158 -0
  196. package/src/index.ts +3 -1
  197. package/src/metrics/index.ts +1 -0
  198. package/src/metrics/instance.test.ts +50 -0
  199. package/src/metrics/instance.ts +23 -0
  200. package/src/presentation/dto/definition.test.ts +89 -1
  201. package/src/presentation/dto/definition.ts +8 -5
  202. package/src/presentation/inter-module.test.ts +177 -0
  203. package/src/presentation/inter-module.ts +77 -4
  204. package/src/presentation/routes/create-definition.test.ts +38 -0
  205. package/src/presentation/routes/create-definition.ts +20 -3
  206. package/src/presentation/routes/get-definition.test.ts +125 -11
  207. package/src/presentation/routes/get-definition.ts +21 -4
  208. package/src/presentation/routes/list-definitions.test.ts +1 -1
  209. package/src/presentation/routes/validate-definition.test.ts +1 -1
  210. package/src/presentation/routes/validate-definition.ts +3 -3
  211. package/src/presentation/subscribers/on-integration-connection-available.test.ts +3 -0
  212. package/src/temporal/activities/sync-activities.test.ts +46 -2
  213. package/src/temporal/activities/sync-activities.ts +9 -7
  214. package/src/temporal/workflows/definition-sync.ts +1 -1
  215. package/test/factories/definition.ts +1 -0
  216. package/test/globalSetup.ts +2 -0
  217. package/tsconfig.build.tsbuildinfo +1 -1
  218. package/dist/core/entities/validation-warning.d.ts +0 -6
  219. package/dist/core/entities/validation-warning.d.ts.map +0 -1
  220. package/dist/core/entities/validation-warning.js +0 -3
  221. package/dist/core/entities/validation-warning.js.map +0 -1
  222. package/src/core/entities/validation-warning.ts +0 -5
  223. package/src/core/parse-definition-warnings.test.ts +0 -33
@@ -1,20 +1,20 @@
1
1
  $ shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js
2
- Successfully compiled: 75 files with swc (565.09ms)
3
- 2026-08-07T08:46:28.995Z [INFO] asset workflow-bundle-db3e4e474e0c4d6a3553.js 4.01 MiB [emitted] [immutable] (name: main)
2
+ Successfully compiled: 79 files with swc (483.81ms)
3
+ 2026-08-23T20:27:02.315Z [INFO] asset workflow-bundle-3f8e06c1c05b04ce000f.js 4.02 MiB [emitted] [immutable] (name: main)
4
4
  orphan modules 322 KiB [orphan] 82 modules
5
5
  runtime modules 1.13 KiB 5 modules
6
6
  modules by path ../../../node_modules/.pnpm/ 1.21 MiB 214 modules
7
- modules by path ../definitions-dto/dist/ 7.85 KiB
8
- modules by path ../definitions-dto/dist/*.js 3.48 KiB 3 modules
9
- modules by path ../definitions-dto/dist/schemas/*.js 4.37 KiB 3 modules
10
- modules by path ./dist/ 5.46 KiB
11
- modules by path ./dist/temporal/workflows/*.js 3.34 KiB 2 modules
7
+ modules by path ../definitions-dto/dist/ 8.2 KiB
8
+ modules by path ../definitions-dto/dist/*.js 3.54 KiB 3 modules
9
+ modules by path ../definitions-dto/dist/schemas/*.js 4.66 KiB 3 modules
10
+ modules by path ./dist/ 6.25 KiB
11
+ modules by path ./dist/temporal/workflows/*.js 3.35 KiB 2 modules
12
12
  ./dist/temporal/workflows/index-autogenerated-entrypoint.cjs 936 bytes [built] [code generated]
13
- ./dist/core/entities/sync-state.js 1.2 KiB [built] [code generated]
13
+ ./dist/core/entities/sync-state.js 1.99 KiB [built] [code generated]
14
14
  optional modules 30 bytes [optional]
15
15
  __temporal_custom_payload_converter (ignored) 15 bytes [optional] [built] [code generated]
16
16
  __temporal_custom_failure_converter (ignored) 15 bytes [optional] [built] [code generated]
17
17
  ../../shared/node/temporal/dist/workflow-error-interceptor.js 1.21 KiB [built] [code generated]
18
- webpack 5.107.2 compiled successfully in 8382 ms
19
- 2026-08-07T08:46:29.013Z [INFO] Workflow bundle created { size: '4.01MB' }
20
- /home/runner/work/shipfox/shipfox/libs/api/definitions/dist/temporal/workflows/index.js: 4207937 bytes
18
+ webpack 5.107.2 compiled successfully in 10012 ms
19
+ 2026-08-23T20:27:02.327Z [INFO] Workflow bundle created { size: '4.02MB' }
20
+ /home/runner/work/shipfox/shipfox/libs/api/definitions/dist/temporal/workflows/index.js: 4212204 bytes
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @shipfox/api-definitions
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - f7b3db8: Replaces published definition warning exports and the sync `warnings` field with severity-aware diagnostics, including workflow file paths for the workflows UI.
8
+
9
+ Consumers must migrate from `warnings` to `diagnostics`; this release does not provide a legacy-field fallback.
10
+
11
+ ### Minor Changes
12
+
13
+ - c0fc35b: Adds `resolveDefinitionAtRef` and `listDefinitionsAtRef` inter-module methods that resolve and validate workflow definitions at a git ref without persisting them.
14
+ - 4f30864: Trigger `event` is now optional end to end. An omitted event subscribes to every event from its source. Explicit events continue to work unchanged. Built-in manual and scheduled triggers use `fire` and `tick`, respectively.
15
+ - aeaa0de: Adds stable workflow lineage identifiers to definition records and the definitions inter-module contract. Existing definitions are reconciled when read or synchronized, so the schema migration does not backfill historical rows.
16
+ - 1b71a66: Exposes each provider's event catalog and the fixed-event providers on the integration validation context. Every provider now refuses the reserved `manual` and `cron` connection slugs.
17
+
18
+ ### Patch Changes
19
+
20
+ - a97890f: Makes trigger-scoped validation errors inert. Reports broken triggers as error diagnostics with their paths while the definition and its other triggers keep syncing.
21
+ - a4df8d9: Resolves a workflow lineage id on GET /definitions/:id by selecting the project's default-branch row, or 404 when the file is not on that branch.
22
+ - Updated dependencies [c0fc35b]
23
+ - Updated dependencies [f7b3db8]
24
+ - Updated dependencies [09924ca]
25
+ - Updated dependencies [4f30864]
26
+ - Updated dependencies [18e9bad]
27
+ - Updated dependencies [a4df8d9]
28
+ - Updated dependencies [aeaa0de]
29
+ - Updated dependencies [c44641f]
30
+ - Updated dependencies [1b71a66]
31
+ - @shipfox/api-definitions-dto@14.0.0
32
+ - @shipfox/api-agent-dto@14.0.0
33
+ - @shipfox/workflow-document@3.1.0
34
+ - @shipfox/api-integration-core-dto@14.0.0
35
+ - @shipfox/api-projects-dto@14.0.0
36
+ - @shipfox/expression@2.2.1
37
+
38
+ ## 13.1.0
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [0d3c2e3]
43
+ - Updated dependencies [5c100d6]
44
+ - Updated dependencies [ca91dc3]
45
+ - Updated dependencies [67aab38]
46
+ - @shipfox/api-agent-dto@13.1.0
47
+
3
48
  ## 12.3.0
4
49
 
5
50
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  export * from './integration-context.js';
2
2
  export * from './sync-state.js';
3
- export * from './validation-warning.js';
3
+ export * from './validation-diagnostic.js';
4
4
  export * from './workflow-definition.js';
5
5
  export * from './workflow-model.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export * from './integration-context.js';
2
2
  export * from './sync-state.js';
3
- export * from './validation-warning.js';
3
+ export * from './validation-diagnostic.js';
4
4
  export * from './workflow-definition.js';
5
5
  export * from './workflow-model.js';
6
6
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/entities/index.ts"],"sourcesContent":["export * from './integration-context.js';\nexport * from './sync-state.js';\nexport * from './validation-warning.js';\nexport * from './workflow-definition.js';\nexport * from './workflow-model.js';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,kBAAkB;AAChC,cAAc,0BAA0B;AACxC,cAAc,2BAA2B;AACzC,cAAc,sBAAsB"}
1
+ {"version":3,"sources":["../../../src/core/entities/index.ts"],"sourcesContent":["export * from './integration-context.js';\nexport * from './sync-state.js';\nexport * from './validation-diagnostic.js';\nexport * from './workflow-definition.js';\nexport * from './workflow-model.js';\n"],"names":[],"mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,kBAAkB;AAChC,cAAc,6BAA6B;AAC3C,cAAc,2BAA2B;AACzC,cAAc,sBAAsB"}
@@ -16,6 +16,10 @@ export interface IntegrationValidationContext {
16
16
  readonly provider: IntegrationProviderKind;
17
17
  readonly capabilities: readonly IntegrationCapability[];
18
18
  }>;
19
+ /** Documented event names per provider; provider-minted names are never a closed set. */
20
+ readonly eventCatalogs: ReadonlyMap<IntegrationProviderKind, ReadonlySet<string>>;
21
+ /** Providers whose single event name is Shipfox-minted (`webhook` today). */
22
+ readonly fixedEventProviders: ReadonlySet<IntegrationProviderKind>;
19
23
  readonly defaultConnectionSlug?: string | undefined;
20
24
  }
21
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"integration-context.d.ts","sourceRoot":"","sources":["../../../src/core/entities/integration-context.ts"],"names":[],"mappings":"AAAA,KAAK,uBAAuB,GAAG,MAAM,CAAC;AACtC,KAAK,qBAAqB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE9D,UAAU,yBAAyB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAClD;AAED,UAAU,iBAAiB;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,GAAG,YAAY,CAAC;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAC9C,uBAAuB,EACvB,yBAAyB,CAC1B,CAAC;IACF,QAAQ,CAAC,2BAA2B,EAAE,WAAW,CAC/C,MAAM,EACN;QACE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;QAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;KACzD,CACF,CAAC;IACF,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrD"}
1
+ {"version":3,"file":"integration-context.d.ts","sourceRoot":"","sources":["../../../src/core/entities/integration-context.ts"],"names":[],"mappings":"AAAA,KAAK,uBAAuB,GAAG,MAAM,CAAC;AACtC,KAAK,qBAAqB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE9D,UAAU,yBAAyB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAClD;AAED,UAAU,iBAAiB;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,GAAG,YAAY,CAAC;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,0BAA0B,EAAE,WAAW,CAC9C,uBAAuB,EACvB,yBAAyB,CAC1B,CAAC;IACF,QAAQ,CAAC,2BAA2B,EAAE,WAAW,CAC/C,MAAM,EACN;QACE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;QAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;KACzD,CACF,CAAC;IACF,yFAAyF;IACzF,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,6EAA6E;IAC7E,QAAQ,CAAC,mBAAmB,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;IACnE,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/entities/integration-context.ts"],"sourcesContent":["type IntegrationProviderKind = string;\ntype IntegrationCapability = 'source_control' | 'agent_tools';\n\ninterface AgentToolSelectionCatalog {\n readonly selectors: readonly AgentToolSelector[];\n}\n\ninterface AgentToolSelector {\n readonly token: string;\n readonly kind: 'family' | 'family_wildcard' | 'method' | 'standalone';\n readonly sensitivity: 'read' | 'write';\n readonly sensitive: boolean;\n}\n\nexport interface IntegrationValidationContext {\n readonly agentToolSelectionCatalogs: ReadonlyMap<\n IntegrationProviderKind,\n AgentToolSelectionCatalog\n >;\n readonly workspaceConnectionSnapshot: ReadonlyMap<\n string,\n {\n readonly id: string;\n readonly provider: IntegrationProviderKind;\n readonly capabilities: readonly IntegrationCapability[];\n }\n >;\n readonly defaultConnectionSlug?: string | undefined;\n}\n"],"names":[],"mappings":"AAcA,WAcC"}
1
+ {"version":3,"sources":["../../../src/core/entities/integration-context.ts"],"sourcesContent":["type IntegrationProviderKind = string;\ntype IntegrationCapability = 'source_control' | 'agent_tools';\n\ninterface AgentToolSelectionCatalog {\n readonly selectors: readonly AgentToolSelector[];\n}\n\ninterface AgentToolSelector {\n readonly token: string;\n readonly kind: 'family' | 'family_wildcard' | 'method' | 'standalone';\n readonly sensitivity: 'read' | 'write';\n readonly sensitive: boolean;\n}\n\nexport interface IntegrationValidationContext {\n readonly agentToolSelectionCatalogs: ReadonlyMap<\n IntegrationProviderKind,\n AgentToolSelectionCatalog\n >;\n readonly workspaceConnectionSnapshot: ReadonlyMap<\n string,\n {\n readonly id: string;\n readonly provider: IntegrationProviderKind;\n readonly capabilities: readonly IntegrationCapability[];\n }\n >;\n /** Documented event names per provider; provider-minted names are never a closed set. */\n readonly eventCatalogs: ReadonlyMap<IntegrationProviderKind, ReadonlySet<string>>;\n /** Providers whose single event name is Shipfox-minted (`webhook` today). */\n readonly fixedEventProviders: ReadonlySet<IntegrationProviderKind>;\n readonly defaultConnectionSlug?: string | undefined;\n}\n"],"names":[],"mappings":"AAcA,WAkBC"}
@@ -1,7 +1,13 @@
1
- import type { ValidationWarning } from './validation-warning.js';
1
+ import type { ValidationDiagnostic } from './validation-diagnostic.js';
2
2
  export type DefinitionSyncStatus = 'pending' | 'syncing' | 'succeeded' | 'failed';
3
- export type DefinitionSyncWarning = ValidationWarning;
4
- export declare function limitDefinitionSyncWarnings(warnings: readonly DefinitionSyncWarning[]): DefinitionSyncWarning[];
3
+ export interface DefinitionSyncDiagnostic extends ValidationDiagnostic {
4
+ filePath?: string | undefined;
5
+ }
6
+ /**
7
+ * Orders errors before warnings and bounds the list so truncation at
8
+ * `DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT` drops warnings first.
9
+ */
10
+ export declare function limitDefinitionSyncDiagnostics(diagnostics: readonly DefinitionSyncDiagnostic[]): DefinitionSyncDiagnostic[];
5
11
  export declare const DEFINITION_SYNC_ERROR_CODES: readonly ['no-workflow-files', 'invalid-definition', 'provider-repository-not-found', 'provider-file-not-found', 'provider-access-denied', 'provider-rate-limited', 'provider-timeout', 'provider-unavailable', 'provider-malformed-response', 'content-too-large', 'too-many-files', 'connection-unavailable', 'unknown'];
6
12
  export type DefinitionSyncErrorCode = (typeof DEFINITION_SYNC_ERROR_CODES)[number];
7
13
  export declare function isDefinitionSyncErrorCode(value: unknown): value is DefinitionSyncErrorCode;
@@ -14,7 +20,7 @@ export interface DefinitionSyncState {
14
20
  status: DefinitionSyncStatus;
15
21
  lastErrorCode: DefinitionSyncErrorCode | null;
16
22
  lastErrorMessage: string | null;
17
- warnings: DefinitionSyncWarning[];
23
+ diagnostics: DefinitionSyncDiagnostic[];
18
24
  startedAt: Date | null;
19
25
  finishedAt: Date | null;
20
26
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"sync-state.d.ts","sourceRoot":"","sources":["../../../src/core/entities/sync-state.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElF,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,GACzC,qBAAqB,EAAE,CAQzB;AAED,eAAO,MAAM,2BAA2B,YACtC,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,CACD,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAI1F;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,oBAAoB,CAAC;IAC7B,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC9C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
1
+ {"version":3,"file":"sync-state.d.ts","sourceRoot":"","sources":["../../../src/core/entities/sync-state.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElF,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,SAAS,wBAAwB,EAAE,GAC/C,wBAAwB,EAAE,CAwB5B;AAED,eAAO,MAAM,2BAA2B,YACtC,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,CACD,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAI1F;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,oBAAoB,CAAC;IAC7B,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC9C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACxC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -1,10 +1,29 @@
1
- import { DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH, DEFINITION_SYNC_WARNINGS_MAX_COUNT } from '@shipfox/api-definitions-dto';
2
- export function limitDefinitionSyncWarnings(warnings) {
3
- return warnings.slice(0, DEFINITION_SYNC_WARNINGS_MAX_COUNT).map((warning)=>({
4
- code: warning.code.slice(0, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),
5
- message: warning.message.slice(0, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),
6
- ...warning.path === undefined ? {} : {
7
- path: warning.path.slice(0, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH)
1
+ import { DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH, DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH } from '@shipfox/api-definitions-dto';
2
+ /**
3
+ * Orders errors before warnings and bounds the list so truncation at
4
+ * `DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT` drops warnings first.
5
+ */ export function limitDefinitionSyncDiagnostics(diagnostics) {
6
+ const ordered = [];
7
+ for (const severity of [
8
+ 'error',
9
+ 'warning'
10
+ ]){
11
+ for (const diagnostic of diagnostics){
12
+ if (diagnostic.severity !== severity) continue;
13
+ ordered.push(diagnostic);
14
+ if (ordered.length === DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT) break;
15
+ }
16
+ if (ordered.length === DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT) break;
17
+ }
18
+ return ordered.map((diagnostic)=>({
19
+ code: diagnostic.code.slice(0, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),
20
+ message: diagnostic.message.slice(0, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),
21
+ severity: diagnostic.severity,
22
+ ...diagnostic.path === undefined ? {} : {
23
+ path: diagnostic.path.slice(0, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH)
24
+ },
25
+ ...diagnostic.filePath === undefined ? {} : {
26
+ filePath: diagnostic.filePath.slice(0, DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH)
8
27
  }
9
28
  }));
10
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/entities/sync-state.ts"],"sourcesContent":["import {\n DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH,\n DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH,\n DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH,\n DEFINITION_SYNC_WARNINGS_MAX_COUNT,\n} from '@shipfox/api-definitions-dto';\nimport type {ValidationWarning} from './validation-warning.js';\n\nexport type DefinitionSyncStatus = 'pending' | 'syncing' | 'succeeded' | 'failed';\n\nexport type DefinitionSyncWarning = ValidationWarning;\n\nexport function limitDefinitionSyncWarnings(\n warnings: readonly DefinitionSyncWarning[],\n): DefinitionSyncWarning[] {\n return warnings.slice(0, DEFINITION_SYNC_WARNINGS_MAX_COUNT).map((warning) => ({\n code: warning.code.slice(0, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),\n message: warning.message.slice(0, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),\n ...(warning.path === undefined\n ? {}\n : {path: warning.path.slice(0, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH)}),\n }));\n}\n\nexport const DEFINITION_SYNC_ERROR_CODES = [\n 'no-workflow-files',\n 'invalid-definition',\n 'provider-repository-not-found',\n 'provider-file-not-found',\n 'provider-access-denied',\n 'provider-rate-limited',\n 'provider-timeout',\n 'provider-unavailable',\n 'provider-malformed-response',\n 'content-too-large',\n 'too-many-files',\n 'connection-unavailable',\n 'unknown',\n] as const;\n\nexport type DefinitionSyncErrorCode = (typeof DEFINITION_SYNC_ERROR_CODES)[number];\n\nexport function isDefinitionSyncErrorCode(value: unknown): value is DefinitionSyncErrorCode {\n return (\n typeof value === 'string' && (DEFINITION_SYNC_ERROR_CODES as readonly string[]).includes(value)\n );\n}\n\nexport interface DefinitionSyncState {\n id: string;\n projectId: string;\n sourceConnectionId: string;\n sourceExternalRepositoryId: string;\n ref: string;\n status: DefinitionSyncStatus;\n lastErrorCode: DefinitionSyncErrorCode | null;\n lastErrorMessage: string | null;\n warnings: DefinitionSyncWarning[];\n startedAt: Date | null;\n finishedAt: Date | null;\n createdAt: Date;\n updatedAt: Date;\n}\n"],"names":["DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH","DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH","DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH","DEFINITION_SYNC_WARNINGS_MAX_COUNT","limitDefinitionSyncWarnings","warnings","slice","map","warning","code","message","path","undefined","DEFINITION_SYNC_ERROR_CODES","isDefinitionSyncErrorCode","value","includes"],"mappings":"AAAA,SACEA,uCAAuC,EACvCC,0CAA0C,EAC1CC,uCAAuC,EACvCC,kCAAkC,QAC7B,+BAA+B;AAOtC,OAAO,SAASC,4BACdC,QAA0C;IAE1C,OAAOA,SAASC,KAAK,CAAC,GAAGH,oCAAoCI,GAAG,CAAC,CAACC,UAAa,CAAA;YAC7EC,MAAMD,QAAQC,IAAI,CAACH,KAAK,CAAC,GAAGN;YAC5BU,SAASF,QAAQE,OAAO,CAACJ,KAAK,CAAC,GAAGL;YAClC,GAAIO,QAAQG,IAAI,KAAKC,YACjB,CAAC,IACD;gBAACD,MAAMH,QAAQG,IAAI,CAACL,KAAK,CAAC,GAAGJ;YAAwC,CAAC;QAC5E,CAAA;AACF;AAEA,OAAO,MAAMW,8BAA8B;IACzC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAIX,OAAO,SAASC,0BAA0BC,KAAc;IACtD,OACE,OAAOA,UAAU,YAAY,AAACF,4BAAkDG,QAAQ,CAACD;AAE7F"}
1
+ {"version":3,"sources":["../../../src/core/entities/sync-state.ts"],"sourcesContent":["import {\n DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH,\n DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT,\n DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH,\n DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH,\n DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH,\n} from '@shipfox/api-definitions-dto';\nimport type {ValidationDiagnostic} from './validation-diagnostic.js';\n\nexport type DefinitionSyncStatus = 'pending' | 'syncing' | 'succeeded' | 'failed';\n\nexport interface DefinitionSyncDiagnostic extends ValidationDiagnostic {\n filePath?: string | undefined;\n}\n\n/**\n * Orders errors before warnings and bounds the list so truncation at\n * `DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT` drops warnings first.\n */\nexport function limitDefinitionSyncDiagnostics(\n diagnostics: readonly DefinitionSyncDiagnostic[],\n): DefinitionSyncDiagnostic[] {\n const ordered: DefinitionSyncDiagnostic[] = [];\n for (const severity of ['error', 'warning'] as const) {\n for (const diagnostic of diagnostics) {\n if (diagnostic.severity !== severity) continue;\n ordered.push(diagnostic);\n if (ordered.length === DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT) break;\n }\n if (ordered.length === DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT) break;\n }\n\n return ordered.map((diagnostic) => ({\n code: diagnostic.code.slice(0, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),\n message: diagnostic.message.slice(0, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),\n severity: diagnostic.severity,\n ...(diagnostic.path === undefined\n ? {}\n : {path: diagnostic.path.slice(0, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH)}),\n ...(diagnostic.filePath === undefined\n ? {}\n : {\n filePath: diagnostic.filePath.slice(0, DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH),\n }),\n }));\n}\n\nexport const DEFINITION_SYNC_ERROR_CODES = [\n 'no-workflow-files',\n 'invalid-definition',\n 'provider-repository-not-found',\n 'provider-file-not-found',\n 'provider-access-denied',\n 'provider-rate-limited',\n 'provider-timeout',\n 'provider-unavailable',\n 'provider-malformed-response',\n 'content-too-large',\n 'too-many-files',\n 'connection-unavailable',\n 'unknown',\n] as const;\n\nexport type DefinitionSyncErrorCode = (typeof DEFINITION_SYNC_ERROR_CODES)[number];\n\nexport function isDefinitionSyncErrorCode(value: unknown): value is DefinitionSyncErrorCode {\n return (\n typeof value === 'string' && (DEFINITION_SYNC_ERROR_CODES as readonly string[]).includes(value)\n );\n}\n\nexport interface DefinitionSyncState {\n id: string;\n projectId: string;\n sourceConnectionId: string;\n sourceExternalRepositoryId: string;\n ref: string;\n status: DefinitionSyncStatus;\n lastErrorCode: DefinitionSyncErrorCode | null;\n lastErrorMessage: string | null;\n diagnostics: DefinitionSyncDiagnostic[];\n startedAt: Date | null;\n finishedAt: Date | null;\n createdAt: Date;\n updatedAt: Date;\n}\n"],"names":["DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH","DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT","DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH","DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH","DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH","limitDefinitionSyncDiagnostics","diagnostics","ordered","severity","diagnostic","push","length","map","code","slice","message","path","undefined","filePath","DEFINITION_SYNC_ERROR_CODES","isDefinitionSyncErrorCode","value","includes"],"mappings":"AAAA,SACEA,+CAA+C,EAC/CC,qCAAqC,EACrCC,uCAAuC,EACvCC,0CAA0C,EAC1CC,uCAAuC,QAClC,+BAA+B;AAStC;;;CAGC,GACD,OAAO,SAASC,+BACdC,WAAgD;IAEhD,MAAMC,UAAsC,EAAE;IAC9C,KAAK,MAAMC,YAAY;QAAC;QAAS;KAAU,CAAW;QACpD,KAAK,MAAMC,cAAcH,YAAa;YACpC,IAAIG,WAAWD,QAAQ,KAAKA,UAAU;YACtCD,QAAQG,IAAI,CAACD;YACb,IAAIF,QAAQI,MAAM,KAAKV,uCAAuC;QAChE;QACA,IAAIM,QAAQI,MAAM,KAAKV,uCAAuC;IAChE;IAEA,OAAOM,QAAQK,GAAG,CAAC,CAACH,aAAgB,CAAA;YAClCI,MAAMJ,WAAWI,IAAI,CAACC,KAAK,CAAC,GAAGZ;YAC/Ba,SAASN,WAAWM,OAAO,CAACD,KAAK,CAAC,GAAGX;YACrCK,UAAUC,WAAWD,QAAQ;YAC7B,GAAIC,WAAWO,IAAI,KAAKC,YACpB,CAAC,IACD;gBAACD,MAAMP,WAAWO,IAAI,CAACF,KAAK,CAAC,GAAGV;YAAwC,CAAC;YAC7E,GAAIK,WAAWS,QAAQ,KAAKD,YACxB,CAAC,IACD;gBACEC,UAAUT,WAAWS,QAAQ,CAACJ,KAAK,CAAC,GAAGd;YACzC,CAAC;QACP,CAAA;AACF;AAEA,OAAO,MAAMmB,8BAA8B;IACzC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AAIX,OAAO,SAASC,0BAA0BC,KAAc;IACtD,OACE,OAAOA,UAAU,YAAY,AAACF,4BAAkDG,QAAQ,CAACD;AAE7F"}
@@ -0,0 +1,8 @@
1
+ export type ValidationDiagnosticSeverity = 'error' | 'warning';
2
+ export interface ValidationDiagnostic {
3
+ code: string;
4
+ message: string;
5
+ path?: string | undefined;
6
+ severity: ValidationDiagnosticSeverity;
7
+ }
8
+ //# sourceMappingURL=validation-diagnostic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-diagnostic.d.ts","sourceRoot":"","sources":["../../../src/core/entities/validation-diagnostic.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,4BAA4B,CAAC;CACxC"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=validation-diagnostic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/entities/validation-diagnostic.ts"],"sourcesContent":["export type ValidationDiagnosticSeverity = 'error' | 'warning';\n\nexport interface ValidationDiagnostic {\n code: string;\n message: string;\n path?: string | undefined;\n severity: ValidationDiagnosticSeverity;\n}\n"],"names":[],"mappings":"AAEA,WAKC"}
@@ -9,6 +9,8 @@ export interface WorkflowDefinitionPayload {
9
9
  }
10
10
  export interface WorkflowDefinition {
11
11
  id: string;
12
+ /** Stable identity per project and config path; pathless manual rows share a project lineage. */
13
+ workflowId: string;
12
14
  projectId: string;
13
15
  configPath: string | null;
14
16
  source: 'manual' | 'vcs';
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-definition.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,sBAAsB,EAAC,MAAM,8BAA8B,CAAC;AACxF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EAAC,sBAAsB,EAAC,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB"}
1
+ {"version":3,"file":"workflow-definition.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,sBAAsB,EAAC,MAAM,8BAA8B,CAAC;AACxF,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EAAC,sBAAsB,EAAC,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,iGAAiG;IACjG,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/entities/workflow-definition.ts"],"sourcesContent":["import type {WorkflowModel, WorkflowSourceSnapshot} from '@shipfox/api-definitions-dto';\nimport type {WorkflowDocument} from '@shipfox/workflow-document';\n\nexport type {WorkflowSourceSnapshot};\n\nexport type WorkflowSpec = WorkflowDocument;\n\nexport interface WorkflowDefinitionPayload {\n document: WorkflowDocument;\n model: WorkflowModel;\n sourceSnapshot?: WorkflowSourceSnapshot | null;\n}\n\nexport interface WorkflowDefinition {\n id: string;\n projectId: string;\n configPath: string | null;\n source: 'manual' | 'vcs';\n sha: string | null;\n ref: string | null;\n name: string;\n /**\n * Compatibility alias for packages that still consume the authoring document\n * before they migrate to `document`/`model`.\n */\n definition: WorkflowSpec;\n document: WorkflowDocument;\n model: WorkflowModel;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n contentHash: string | null;\n fetchedAt: Date;\n createdAt: Date;\n updatedAt: Date;\n deletedAt: Date | null;\n}\n"],"names":[],"mappings":"AAaA,WAqBC"}
1
+ {"version":3,"sources":["../../../src/core/entities/workflow-definition.ts"],"sourcesContent":["import type {WorkflowModel, WorkflowSourceSnapshot} from '@shipfox/api-definitions-dto';\nimport type {WorkflowDocument} from '@shipfox/workflow-document';\n\nexport type {WorkflowSourceSnapshot};\n\nexport type WorkflowSpec = WorkflowDocument;\n\nexport interface WorkflowDefinitionPayload {\n document: WorkflowDocument;\n model: WorkflowModel;\n sourceSnapshot?: WorkflowSourceSnapshot | null;\n}\n\nexport interface WorkflowDefinition {\n id: string;\n /** Stable identity per project and config path; pathless manual rows share a project lineage. */\n workflowId: string;\n projectId: string;\n configPath: string | null;\n source: 'manual' | 'vcs';\n sha: string | null;\n ref: string | null;\n name: string;\n /**\n * Compatibility alias for packages that still consume the authoring document\n * before they migrate to `document`/`model`.\n */\n definition: WorkflowSpec;\n document: WorkflowDocument;\n model: WorkflowModel;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n contentHash: string | null;\n fetchedAt: Date;\n createdAt: Date;\n updatedAt: Date;\n deletedAt: Date | null;\n}\n"],"names":[],"mappings":"AAaA,WAuBC"}
@@ -7,4 +7,14 @@ export declare class DefinitionSyncPermanentError extends Error {
7
7
  readonly code: DefinitionSyncErrorCode;
8
8
  constructor(code: DefinitionSyncErrorCode, message: string);
9
9
  }
10
+ export type DefinitionAtRefErrorCode = 'project-not-found' | 'ref-not-found' | 'ref-invalid' | 'ref-moved' | 'file-not-found' | 'content-too-large' | 'invalid-definition' | 'too-many-files' | 'source-unavailable';
11
+ /**
12
+ * Rejects a definition resolution or listing at a git ref. `details` carries
13
+ * the bounded context the presentation translates into known-error details.
14
+ */
15
+ export declare class DefinitionAtRefError extends Error {
16
+ readonly code: DefinitionAtRefErrorCode;
17
+ readonly details: Record<string, unknown>;
18
+ constructor(code: DefinitionAtRefErrorCode, message: string, details?: Record<string, unknown>);
19
+ }
10
20
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AAEtE,qBAAa,oBAAqB,SAAQ,KAAK;IAGpC,OAAO,CAAC,EAAE,OAAO;IAF1B,YACE,OAAO,EAAE,MAAM,EACR,OAAO,CAAC,EAAE,OAAO,EAIzB;CACF;AAED,qBAAa,4BAA6B,SAAQ,KAAK;aAEnC,IAAI,EAAE,uBAAuB;IAD/C,YACkB,IAAI,EAAE,uBAAuB,EAC7C,OAAO,EAAE,MAAM,EAIhB;CACF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AAEtE,qBAAa,oBAAqB,SAAQ,KAAK;IAGpC,OAAO,CAAC,EAAE,OAAO;IAF1B,YACE,OAAO,EAAE,MAAM,EACR,OAAO,CAAC,EAAE,OAAO,EAIzB;CACF;AAED,qBAAa,4BAA6B,SAAQ,KAAK;aAEnC,IAAI,EAAE,uBAAuB;IAD/C,YACkB,IAAI,EAAE,uBAAuB,EAC7C,OAAO,EAAE,MAAM,EAIhB;CACF;AAED,MAAM,MAAM,wBAAwB,GAChC,mBAAmB,GACnB,eAAe,GACf,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,oBAAoB,CAAC;AAEzB;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAE3B,IAAI,EAAE,wBAAwB;aAE9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAHlD,YACkB,IAAI,EAAE,wBAAwB,EAC9C,OAAO,EAAE,MAAM,EACC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EAItD;CACF"}
@@ -10,5 +10,14 @@ export class DefinitionSyncPermanentError extends Error {
10
10
  this.name = 'DefinitionSyncPermanentError';
11
11
  }
12
12
  }
13
+ /**
14
+ * Rejects a definition resolution or listing at a git ref. `details` carries
15
+ * the bounded context the presentation translates into known-error details.
16
+ */ export class DefinitionAtRefError extends Error {
17
+ constructor(code, message, details = {}){
18
+ super(message), this.code = code, this.details = details;
19
+ this.name = 'DefinitionAtRefError';
20
+ }
21
+ }
13
22
 
14
23
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/errors.ts"],"sourcesContent":["import type {DefinitionSyncErrorCode} from './entities/sync-state.js';\n\nexport class DefinitionParseError extends Error {\n constructor(\n message: string,\n public details?: unknown,\n ) {\n super(message);\n this.name = 'DefinitionParseError';\n }\n}\n\nexport class DefinitionSyncPermanentError extends Error {\n constructor(\n public readonly code: DefinitionSyncErrorCode,\n message: string,\n ) {\n super(message);\n this.name = 'DefinitionSyncPermanentError';\n }\n}\n"],"names":["DefinitionParseError","Error","message","details","name","DefinitionSyncPermanentError","code"],"mappings":"AAEA,OAAO,MAAMA,6BAA6BC;IACxC,YACEC,OAAe,EACf,AAAOC,OAAiB,CACxB;QACA,KAAK,CAACD,eAFCC,UAAAA;QAGP,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMC,qCAAqCJ;IAChD,YACE,AAAgBK,IAA6B,EAC7CJ,OAAe,CACf;QACA,KAAK,CAACA,eAHUI,OAAAA;QAIhB,IAAI,CAACF,IAAI,GAAG;IACd;AACF"}
1
+ {"version":3,"sources":["../../src/core/errors.ts"],"sourcesContent":["import type {DefinitionSyncErrorCode} from './entities/sync-state.js';\n\nexport class DefinitionParseError extends Error {\n constructor(\n message: string,\n public details?: unknown,\n ) {\n super(message);\n this.name = 'DefinitionParseError';\n }\n}\n\nexport class DefinitionSyncPermanentError extends Error {\n constructor(\n public readonly code: DefinitionSyncErrorCode,\n message: string,\n ) {\n super(message);\n this.name = 'DefinitionSyncPermanentError';\n }\n}\n\nexport type DefinitionAtRefErrorCode =\n | 'project-not-found'\n | 'ref-not-found'\n | 'ref-invalid'\n | 'ref-moved'\n | 'file-not-found'\n | 'content-too-large'\n | 'invalid-definition'\n | 'too-many-files'\n | 'source-unavailable';\n\n/**\n * Rejects a definition resolution or listing at a git ref. `details` carries\n * the bounded context the presentation translates into known-error details.\n */\nexport class DefinitionAtRefError extends Error {\n constructor(\n public readonly code: DefinitionAtRefErrorCode,\n message: string,\n public readonly details: Record<string, unknown> = {},\n ) {\n super(message);\n this.name = 'DefinitionAtRefError';\n }\n}\n"],"names":["DefinitionParseError","Error","message","details","name","DefinitionSyncPermanentError","code","DefinitionAtRefError"],"mappings":"AAEA,OAAO,MAAMA,6BAA6BC;IACxC,YACEC,OAAe,EACf,AAAOC,OAAiB,CACxB;QACA,KAAK,CAACD,eAFCC,UAAAA;QAGP,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMC,qCAAqCJ;IAChD,YACE,AAAgBK,IAA6B,EAC7CJ,OAAe,CACf;QACA,KAAK,CAACA,eAHUI,OAAAA;QAIhB,IAAI,CAACF,IAAI,GAAG;IACd;AACF;AAaA;;;CAGC,GACD,OAAO,MAAMG,6BAA6BN;IACxC,YACE,AAAgBK,IAA8B,EAC9CJ,OAAe,EACf,AAAgBC,UAAmC,CAAC,CAAC,CACrD;QACA,KAAK,CAACD,eAJUI,OAAAA,WAEAH,UAAAA;QAGhB,IAAI,CAACC,IAAI,GAAG;IACd;AACF"}
@@ -1,6 +1,7 @@
1
1
  export type * from './entities/index.js';
2
- export { DefinitionParseError, DefinitionSyncPermanentError, } from './errors.js';
2
+ export { DefinitionAtRefError, type DefinitionAtRefErrorCode, DefinitionParseError, DefinitionSyncPermanentError, } from './errors.js';
3
3
  export { parseDefinition } from './parse-definition.js';
4
+ export { type DefinitionAtRefFile, type DefinitionsAtRefListing, type ListDefinitionsAtRefParams, listDefinitionsAtRef, type ResolveDefinitionAtRefParams, type ResolvedDefinitionAtRef, resolveDefinitionAtRef, type ValidationWarning, } from './resolve-definition-at-ref.js';
4
5
  export { classifySyncFailure, DEFAULT_WORKFLOW_PATH, type DiscoverWorkflowFilesParams, discoverWorkflowFiles, type FetchAndParseWorkflowsParams, FILE_FETCH_CONCURRENCY, fetchAndParseWorkflows, MAX_WORKFLOW_FILES, type ParsedWorkflow, type ResolvedSyncSource, resolveSyncSource, type SyncFailureClassification, type SyncSourceContext, UNRESOLVED_SYNC_REF, } from './sync-definitions.js';
5
6
  export { DEFAULT_RUN_TIMEOUT_MS } from './workflow-model/constants.js';
6
7
  export { normalizeWorkflowDocument } from './workflow-model/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,qBAAqB,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,2BAA2B,EAChC,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,sBAAsB,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAC,oBAAoB,EAAC,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,qBAAqB,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,sBAAsB,EACtB,KAAK,iBAAiB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,2BAA2B,EAChC,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,sBAAsB,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAC,oBAAoB,EAAC,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC"}
@@ -1,5 +1,6 @@
1
- export { DefinitionParseError, DefinitionSyncPermanentError } from './errors.js';
1
+ export { DefinitionAtRefError, DefinitionParseError, DefinitionSyncPermanentError } from './errors.js';
2
2
  export { parseDefinition } from './parse-definition.js';
3
+ export { listDefinitionsAtRef, resolveDefinitionAtRef } from './resolve-definition-at-ref.js';
3
4
  export { classifySyncFailure, DEFAULT_WORKFLOW_PATH, discoverWorkflowFiles, FILE_FETCH_CONCURRENCY, fetchAndParseWorkflows, MAX_WORKFLOW_FILES, resolveSyncSource, UNRESOLVED_SYNC_REF } from './sync-definitions.js';
4
5
  export { DEFAULT_RUN_TIMEOUT_MS } from './workflow-model/constants.js';
5
6
  export { normalizeWorkflowDocument } from './workflow-model/index.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["export type * from './entities/index.js';\nexport {\n DefinitionParseError,\n DefinitionSyncPermanentError,\n} from './errors.js';\nexport {parseDefinition} from './parse-definition.js';\nexport {\n classifySyncFailure,\n DEFAULT_WORKFLOW_PATH,\n type DiscoverWorkflowFilesParams,\n discoverWorkflowFiles,\n type FetchAndParseWorkflowsParams,\n FILE_FETCH_CONCURRENCY,\n fetchAndParseWorkflows,\n MAX_WORKFLOW_FILES,\n type ParsedWorkflow,\n type ResolvedSyncSource,\n resolveSyncSource,\n type SyncFailureClassification,\n type SyncSourceContext,\n UNRESOLVED_SYNC_REF,\n} from './sync-definitions.js';\nexport {DEFAULT_RUN_TIMEOUT_MS} from './workflow-model/constants.js';\nexport {normalizeWorkflowDocument} from './workflow-model/index.js';\nexport {DEFAULT_JOB_CHECKOUT} from './workflow-model/normalize-job-checkout.js';\nexport {DEFAULT_JOB_SUCCESS} from './workflow-model/normalize-job-success.js';\n"],"names":["DefinitionParseError","DefinitionSyncPermanentError","parseDefinition","classifySyncFailure","DEFAULT_WORKFLOW_PATH","discoverWorkflowFiles","FILE_FETCH_CONCURRENCY","fetchAndParseWorkflows","MAX_WORKFLOW_FILES","resolveSyncSource","UNRESOLVED_SYNC_REF","DEFAULT_RUN_TIMEOUT_MS","normalizeWorkflowDocument","DEFAULT_JOB_CHECKOUT","DEFAULT_JOB_SUCCESS"],"mappings":"AACA,SACEA,oBAAoB,EACpBC,4BAA4B,QACvB,cAAc;AACrB,SAAQC,eAAe,QAAO,wBAAwB;AACtD,SACEC,mBAAmB,EACnBC,qBAAqB,EAErBC,qBAAqB,EAErBC,sBAAsB,EACtBC,sBAAsB,EACtBC,kBAAkB,EAGlBC,iBAAiB,EAGjBC,mBAAmB,QACd,wBAAwB;AAC/B,SAAQC,sBAAsB,QAAO,gCAAgC;AACrE,SAAQC,yBAAyB,QAAO,4BAA4B;AACpE,SAAQC,oBAAoB,QAAO,6CAA6C;AAChF,SAAQC,mBAAmB,QAAO,4CAA4C"}
1
+ {"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["export type * from './entities/index.js';\nexport {\n DefinitionAtRefError,\n type DefinitionAtRefErrorCode,\n DefinitionParseError,\n DefinitionSyncPermanentError,\n} from './errors.js';\nexport {parseDefinition} from './parse-definition.js';\nexport {\n type DefinitionAtRefFile,\n type DefinitionsAtRefListing,\n type ListDefinitionsAtRefParams,\n listDefinitionsAtRef,\n type ResolveDefinitionAtRefParams,\n type ResolvedDefinitionAtRef,\n resolveDefinitionAtRef,\n type ValidationWarning,\n} from './resolve-definition-at-ref.js';\nexport {\n classifySyncFailure,\n DEFAULT_WORKFLOW_PATH,\n type DiscoverWorkflowFilesParams,\n discoverWorkflowFiles,\n type FetchAndParseWorkflowsParams,\n FILE_FETCH_CONCURRENCY,\n fetchAndParseWorkflows,\n MAX_WORKFLOW_FILES,\n type ParsedWorkflow,\n type ResolvedSyncSource,\n resolveSyncSource,\n type SyncFailureClassification,\n type SyncSourceContext,\n UNRESOLVED_SYNC_REF,\n} from './sync-definitions.js';\nexport {DEFAULT_RUN_TIMEOUT_MS} from './workflow-model/constants.js';\nexport {normalizeWorkflowDocument} from './workflow-model/index.js';\nexport {DEFAULT_JOB_CHECKOUT} from './workflow-model/normalize-job-checkout.js';\nexport {DEFAULT_JOB_SUCCESS} from './workflow-model/normalize-job-success.js';\n"],"names":["DefinitionAtRefError","DefinitionParseError","DefinitionSyncPermanentError","parseDefinition","listDefinitionsAtRef","resolveDefinitionAtRef","classifySyncFailure","DEFAULT_WORKFLOW_PATH","discoverWorkflowFiles","FILE_FETCH_CONCURRENCY","fetchAndParseWorkflows","MAX_WORKFLOW_FILES","resolveSyncSource","UNRESOLVED_SYNC_REF","DEFAULT_RUN_TIMEOUT_MS","normalizeWorkflowDocument","DEFAULT_JOB_CHECKOUT","DEFAULT_JOB_SUCCESS"],"mappings":"AACA,SACEA,oBAAoB,EAEpBC,oBAAoB,EACpBC,4BAA4B,QACvB,cAAc;AACrB,SAAQC,eAAe,QAAO,wBAAwB;AACtD,SAIEC,oBAAoB,EAGpBC,sBAAsB,QAEjB,iCAAiC;AACxC,SACEC,mBAAmB,EACnBC,qBAAqB,EAErBC,qBAAqB,EAErBC,sBAAsB,EACtBC,sBAAsB,EACtBC,kBAAkB,EAGlBC,iBAAiB,EAGjBC,mBAAmB,QACd,wBAAwB;AAC/B,SAAQC,sBAAsB,QAAO,gCAAgC;AACrE,SAAQC,yBAAyB,QAAO,4BAA4B;AACpE,SAAQC,oBAAoB,QAAO,6CAA6C;AAChF,SAAQC,mBAAmB,QAAO,4CAA4C"}
@@ -5,7 +5,7 @@ export type DefinitionsSourceControl = {
5
5
  fetchFile: IntegrationsModuleClient['fetchSourceFile'];
6
6
  };
7
7
  export declare function createDefinitionsSourceControl(integrations: IntegrationsModuleClient): DefinitionsSourceControl;
8
- export declare function loadIntegrationValidationContext(integrations: IntegrationsModuleClient, workspaceId: string, defaultConnectionId: string): Promise<{
8
+ export declare function loadIntegrationValidationContext(integrations: IntegrationsModuleClient, workspaceId: string, defaultConnectionId: string, signal?: AbortSignal): Promise<{
9
9
  agentToolSelectionCatalogs: Map<string, {
10
10
  selectors: {
11
11
  token: string;
@@ -19,6 +19,8 @@ export declare function loadIntegrationValidationContext(integrations: Integrati
19
19
  provider: string;
20
20
  capabilities: ("agent_tools" | "source_control")[];
21
21
  }>;
22
+ eventCatalogs: Map<string, Set<string>>;
23
+ fixedEventProviders: Set<string>;
22
24
  defaultConnectionSlug: string | undefined;
23
25
  }>;
24
26
  export { integrationsInterModuleContract };
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/core/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,+BAA+B,EAChC,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,EAAE,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;IACvE,SAAS,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;IACvD,SAAS,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;CACxD,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,wBAAwB,GACrC,wBAAwB,CAM1B;AAED,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,wBAAwB,EACtC,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM;;;;;;;;;;;;;;;GAY5B;AAED,OAAO,EAAC,+BAA+B,EAAC,CAAC"}
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/core/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,+BAA+B,EAChC,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,EAAE,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;IACvE,SAAS,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;IACvD,SAAS,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;CACxD,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,wBAAwB,GACrC,wBAAwB,CAM1B;AAED,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,wBAAwB,EACtC,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,MAAM,EAC3B,MAAM,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;GAoBrB;AAED,OAAO,EAAC,+BAA+B,EAAC,CAAC"}
@@ -6,10 +6,13 @@ export function createDefinitionsSourceControl(integrations) {
6
6
  fetchFile: integrations.fetchSourceFile
7
7
  };
8
8
  }
9
- export async function loadIntegrationValidationContext(integrations, workspaceId, defaultConnectionId) {
10
- const context = await integrations.getAgentToolsContext({
9
+ export async function loadIntegrationValidationContext(integrations, workspaceId, defaultConnectionId, signal) {
10
+ const input = {
11
11
  workspaceId,
12
12
  defaultConnectionId
13
+ };
14
+ const context = signal === undefined ? await integrations.getAgentToolsContext(input) : await integrations.getAgentToolsContext(input, {
15
+ signal
13
16
  });
14
17
  return {
15
18
  agentToolSelectionCatalogs: new Map(context.selectionCatalogs.map(({ provider, selectors })=>[
@@ -22,6 +25,11 @@ export async function loadIntegrationValidationContext(integrations, workspaceId
22
25
  slug,
23
26
  connection
24
27
  ])),
28
+ eventCatalogs: new Map(context.eventCatalogs.map(({ provider, events })=>[
29
+ provider,
30
+ new Set(events)
31
+ ])),
32
+ fixedEventProviders: new Set(context.fixedEventProviders),
25
33
  defaultConnectionSlug: context.defaultConnection?.slug
26
34
  };
27
35
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/integrations.ts"],"sourcesContent":["import {\n type IntegrationsModuleClient,\n integrationsInterModuleContract,\n} from '@shipfox/api-integration-core-dto/inter-module';\n\nexport type DefinitionsSourceControl = {\n resolveRepository: IntegrationsModuleClient['resolveSourceRepository'];\n listFiles: IntegrationsModuleClient['listSourceFiles'];\n fetchFile: IntegrationsModuleClient['fetchSourceFile'];\n};\n\nexport function createDefinitionsSourceControl(\n integrations: IntegrationsModuleClient,\n): DefinitionsSourceControl {\n return {\n resolveRepository: integrations.resolveSourceRepository,\n listFiles: integrations.listSourceFiles,\n fetchFile: integrations.fetchSourceFile,\n };\n}\n\nexport async function loadIntegrationValidationContext(\n integrations: IntegrationsModuleClient,\n workspaceId: string,\n defaultConnectionId: string,\n) {\n const context = await integrations.getAgentToolsContext({workspaceId, defaultConnectionId});\n return {\n agentToolSelectionCatalogs: new Map(\n context.selectionCatalogs.map(({provider, selectors}) => [provider, {selectors}]),\n ),\n workspaceConnectionSnapshot: new Map(\n context.workspaceConnections.map(({slug, ...connection}) => [slug, connection]),\n ),\n defaultConnectionSlug: context.defaultConnection?.slug,\n };\n}\n\nexport {integrationsInterModuleContract};\n"],"names":["integrationsInterModuleContract","createDefinitionsSourceControl","integrations","resolveRepository","resolveSourceRepository","listFiles","listSourceFiles","fetchFile","fetchSourceFile","loadIntegrationValidationContext","workspaceId","defaultConnectionId","context","getAgentToolsContext","agentToolSelectionCatalogs","Map","selectionCatalogs","map","provider","selectors","workspaceConnectionSnapshot","workspaceConnections","slug","connection","defaultConnectionSlug","defaultConnection"],"mappings":"AAAA,SAEEA,+BAA+B,QAC1B,iDAAiD;AAQxD,OAAO,SAASC,+BACdC,YAAsC;IAEtC,OAAO;QACLC,mBAAmBD,aAAaE,uBAAuB;QACvDC,WAAWH,aAAaI,eAAe;QACvCC,WAAWL,aAAaM,eAAe;IACzC;AACF;AAEA,OAAO,eAAeC,iCACpBP,YAAsC,EACtCQ,WAAmB,EACnBC,mBAA2B;IAE3B,MAAMC,UAAU,MAAMV,aAAaW,oBAAoB,CAAC;QAACH;QAAaC;IAAmB;IACzF,OAAO;QACLG,4BAA4B,IAAIC,IAC9BH,QAAQI,iBAAiB,CAACC,GAAG,CAAC,CAAC,EAACC,QAAQ,EAAEC,SAAS,EAAC,GAAK;gBAACD;gBAAU;oBAACC;gBAAS;aAAE;QAElFC,6BAA6B,IAAIL,IAC/BH,QAAQS,oBAAoB,CAACJ,GAAG,CAAC,CAAC,EAACK,IAAI,EAAE,GAAGC,YAAW,GAAK;gBAACD;gBAAMC;aAAW;QAEhFC,uBAAuBZ,QAAQa,iBAAiB,EAAEH;IACpD;AACF;AAEA,SAAQtB,+BAA+B,GAAE"}
1
+ {"version":3,"sources":["../../src/core/integrations.ts"],"sourcesContent":["import {\n type IntegrationsModuleClient,\n integrationsInterModuleContract,\n} from '@shipfox/api-integration-core-dto/inter-module';\n\nexport type DefinitionsSourceControl = {\n resolveRepository: IntegrationsModuleClient['resolveSourceRepository'];\n listFiles: IntegrationsModuleClient['listSourceFiles'];\n fetchFile: IntegrationsModuleClient['fetchSourceFile'];\n};\n\nexport function createDefinitionsSourceControl(\n integrations: IntegrationsModuleClient,\n): DefinitionsSourceControl {\n return {\n resolveRepository: integrations.resolveSourceRepository,\n listFiles: integrations.listSourceFiles,\n fetchFile: integrations.fetchSourceFile,\n };\n}\n\nexport async function loadIntegrationValidationContext(\n integrations: IntegrationsModuleClient,\n workspaceId: string,\n defaultConnectionId: string,\n signal?: AbortSignal,\n) {\n const input = {workspaceId, defaultConnectionId};\n const context =\n signal === undefined\n ? await integrations.getAgentToolsContext(input)\n : await integrations.getAgentToolsContext(input, {signal});\n return {\n agentToolSelectionCatalogs: new Map(\n context.selectionCatalogs.map(({provider, selectors}) => [provider, {selectors}]),\n ),\n workspaceConnectionSnapshot: new Map(\n context.workspaceConnections.map(({slug, ...connection}) => [slug, connection]),\n ),\n eventCatalogs: new Map(\n context.eventCatalogs.map(({provider, events}) => [provider, new Set(events)]),\n ),\n fixedEventProviders: new Set(context.fixedEventProviders),\n defaultConnectionSlug: context.defaultConnection?.slug,\n };\n}\n\nexport {integrationsInterModuleContract};\n"],"names":["integrationsInterModuleContract","createDefinitionsSourceControl","integrations","resolveRepository","resolveSourceRepository","listFiles","listSourceFiles","fetchFile","fetchSourceFile","loadIntegrationValidationContext","workspaceId","defaultConnectionId","signal","input","context","undefined","getAgentToolsContext","agentToolSelectionCatalogs","Map","selectionCatalogs","map","provider","selectors","workspaceConnectionSnapshot","workspaceConnections","slug","connection","eventCatalogs","events","Set","fixedEventProviders","defaultConnectionSlug","defaultConnection"],"mappings":"AAAA,SAEEA,+BAA+B,QAC1B,iDAAiD;AAQxD,OAAO,SAASC,+BACdC,YAAsC;IAEtC,OAAO;QACLC,mBAAmBD,aAAaE,uBAAuB;QACvDC,WAAWH,aAAaI,eAAe;QACvCC,WAAWL,aAAaM,eAAe;IACzC;AACF;AAEA,OAAO,eAAeC,iCACpBP,YAAsC,EACtCQ,WAAmB,EACnBC,mBAA2B,EAC3BC,MAAoB;IAEpB,MAAMC,QAAQ;QAACH;QAAaC;IAAmB;IAC/C,MAAMG,UACJF,WAAWG,YACP,MAAMb,aAAac,oBAAoB,CAACH,SACxC,MAAMX,aAAac,oBAAoB,CAACH,OAAO;QAACD;IAAM;IAC5D,OAAO;QACLK,4BAA4B,IAAIC,IAC9BJ,QAAQK,iBAAiB,CAACC,GAAG,CAAC,CAAC,EAACC,QAAQ,EAAEC,SAAS,EAAC,GAAK;gBAACD;gBAAU;oBAACC;gBAAS;aAAE;QAElFC,6BAA6B,IAAIL,IAC/BJ,QAAQU,oBAAoB,CAACJ,GAAG,CAAC,CAAC,EAACK,IAAI,EAAE,GAAGC,YAAW,GAAK;gBAACD;gBAAMC;aAAW;QAEhFC,eAAe,IAAIT,IACjBJ,QAAQa,aAAa,CAACP,GAAG,CAAC,CAAC,EAACC,QAAQ,EAAEO,MAAM,EAAC,GAAK;gBAACP;gBAAU,IAAIQ,IAAID;aAAQ;QAE/EE,qBAAqB,IAAID,IAAIf,QAAQgB,mBAAmB;QACxDC,uBAAuBjB,QAAQkB,iBAAiB,EAAEP;IACpD;AACF;AAEA,SAAQzB,+BAA+B,GAAE"}
@@ -1,11 +1,11 @@
1
- import type { ValidationWarning } from './entities/validation-warning.js';
1
+ import type { ValidationDiagnostic } from './entities/validation-diagnostic.js';
2
2
  import type { WorkflowDefinitionPayload } from './entities/workflow-definition.js';
3
3
  import { type DefinitionValidationOptions } from './validate-definition.js';
4
4
  export interface ParsedDefinition extends WorkflowDefinitionPayload {
5
- warnings: ValidationWarning[];
5
+ diagnostics: ValidationDiagnostic[];
6
6
  }
7
7
  export type ParseDefinitionOptions = DefinitionValidationOptions;
8
- export declare function parseDefinitionWithWarnings(yamlString: string, options: ParseDefinitionOptions): ParsedDefinition;
8
+ export declare function parseDefinitionWithDiagnostics(yamlString: string, options: ParseDefinitionOptions): ParsedDefinition;
9
9
  export declare function parseDefinition(yamlString: string, options: ParseDefinitionOptions): WorkflowDefinitionPayload;
10
- export declare function stripDefinitionWarnings(parsed: ParsedDefinition): WorkflowDefinitionPayload;
10
+ export declare function stripDefinitionDiagnostics(parsed: ParsedDefinition): WorkflowDefinitionPayload;
11
11
  //# sourceMappingURL=parse-definition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-definition.d.ts","sourceRoot":"","sources":["../../src/core/parse-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAAC,KAAK,2BAA2B,EAAqB,MAAM,0BAA0B,CAAC;AAE9F,MAAM,WAAW,gBAAiB,SAAQ,yBAAyB;IACjE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAEjE,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,sBAAsB,GAC9B,gBAAgB,CAelB;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,sBAAsB,GAC9B,yBAAyB,CAG3B;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,yBAAyB,CAM3F"}
1
+ {"version":3,"file":"parse-definition.d.ts","sourceRoot":"","sources":["../../src/core/parse-definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAAC,KAAK,2BAA2B,EAAqB,MAAM,0BAA0B,CAAC;AAE9F,MAAM,WAAW,gBAAiB,SAAQ,yBAAyB;IACjE,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAEjE,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,sBAAsB,GAC9B,gBAAgB,CAelB;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,sBAAsB,GAC9B,yBAAyB,CAG3B;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gBAAgB,GAAG,yBAAyB,CAM9F"}
@@ -1,6 +1,6 @@
1
1
  import { DefinitionParseError } from './errors.js';
2
2
  import { validateDefinition } from './validate-definition.js';
3
- export function parseDefinitionWithWarnings(yamlString, options) {
3
+ export function parseDefinitionWithDiagnostics(yamlString, options) {
4
4
  const result = validateDefinition(yamlString, options);
5
5
  if (!result.valid) {
6
6
  throw new DefinitionParseError(result.errors[0]?.message ?? 'Invalid definition', result.errors);
@@ -11,14 +11,14 @@ export function parseDefinitionWithWarnings(yamlString, options) {
11
11
  content: yamlString,
12
12
  format: 'yaml'
13
13
  },
14
- warnings: result.warnings
14
+ diagnostics: result.diagnostics
15
15
  };
16
16
  }
17
17
  export function parseDefinition(yamlString, options) {
18
- const parsed = parseDefinitionWithWarnings(yamlString, options);
19
- return stripDefinitionWarnings(parsed);
18
+ const parsed = parseDefinitionWithDiagnostics(yamlString, options);
19
+ return stripDefinitionDiagnostics(parsed);
20
20
  }
21
- export function stripDefinitionWarnings(parsed) {
21
+ export function stripDefinitionDiagnostics(parsed) {
22
22
  return {
23
23
  document: parsed.document,
24
24
  model: parsed.model,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/parse-definition.ts"],"sourcesContent":["import type {ValidationWarning} from './entities/validation-warning.js';\nimport type {WorkflowDefinitionPayload} from './entities/workflow-definition.js';\nimport {DefinitionParseError} from './errors.js';\nimport {type DefinitionValidationOptions, validateDefinition} from './validate-definition.js';\n\nexport interface ParsedDefinition extends WorkflowDefinitionPayload {\n warnings: ValidationWarning[];\n}\n\nexport type ParseDefinitionOptions = DefinitionValidationOptions;\n\nexport function parseDefinitionWithWarnings(\n yamlString: string,\n options: ParseDefinitionOptions,\n): ParsedDefinition {\n const result = validateDefinition(yamlString, options);\n\n if (!result.valid) {\n throw new DefinitionParseError(\n result.errors[0]?.message ?? 'Invalid definition',\n result.errors,\n );\n }\n\n return {\n ...result.definition,\n sourceSnapshot: {content: yamlString, format: 'yaml'},\n warnings: result.warnings,\n };\n}\n\nexport function parseDefinition(\n yamlString: string,\n options: ParseDefinitionOptions,\n): WorkflowDefinitionPayload {\n const parsed = parseDefinitionWithWarnings(yamlString, options);\n return stripDefinitionWarnings(parsed);\n}\n\nexport function stripDefinitionWarnings(parsed: ParsedDefinition): WorkflowDefinitionPayload {\n return {\n document: parsed.document,\n model: parsed.model,\n sourceSnapshot: parsed.sourceSnapshot ?? null,\n };\n}\n"],"names":["DefinitionParseError","validateDefinition","parseDefinitionWithWarnings","yamlString","options","result","valid","errors","message","definition","sourceSnapshot","content","format","warnings","parseDefinition","parsed","stripDefinitionWarnings","document","model"],"mappings":"AAEA,SAAQA,oBAAoB,QAAO,cAAc;AACjD,SAA0CC,kBAAkB,QAAO,2BAA2B;AAQ9F,OAAO,SAASC,4BACdC,UAAkB,EAClBC,OAA+B;IAE/B,MAAMC,SAASJ,mBAAmBE,YAAYC;IAE9C,IAAI,CAACC,OAAOC,KAAK,EAAE;QACjB,MAAM,IAAIN,qBACRK,OAAOE,MAAM,CAAC,EAAE,EAAEC,WAAW,sBAC7BH,OAAOE,MAAM;IAEjB;IAEA,OAAO;QACL,GAAGF,OAAOI,UAAU;QACpBC,gBAAgB;YAACC,SAASR;YAAYS,QAAQ;QAAM;QACpDC,UAAUR,OAAOQ,QAAQ;IAC3B;AACF;AAEA,OAAO,SAASC,gBACdX,UAAkB,EAClBC,OAA+B;IAE/B,MAAMW,SAASb,4BAA4BC,YAAYC;IACvD,OAAOY,wBAAwBD;AACjC;AAEA,OAAO,SAASC,wBAAwBD,MAAwB;IAC9D,OAAO;QACLE,UAAUF,OAAOE,QAAQ;QACzBC,OAAOH,OAAOG,KAAK;QACnBR,gBAAgBK,OAAOL,cAAc,IAAI;IAC3C;AACF"}
1
+ {"version":3,"sources":["../../src/core/parse-definition.ts"],"sourcesContent":["import type {ValidationDiagnostic} from './entities/validation-diagnostic.js';\nimport type {WorkflowDefinitionPayload} from './entities/workflow-definition.js';\nimport {DefinitionParseError} from './errors.js';\nimport {type DefinitionValidationOptions, validateDefinition} from './validate-definition.js';\n\nexport interface ParsedDefinition extends WorkflowDefinitionPayload {\n diagnostics: ValidationDiagnostic[];\n}\n\nexport type ParseDefinitionOptions = DefinitionValidationOptions;\n\nexport function parseDefinitionWithDiagnostics(\n yamlString: string,\n options: ParseDefinitionOptions,\n): ParsedDefinition {\n const result = validateDefinition(yamlString, options);\n\n if (!result.valid) {\n throw new DefinitionParseError(\n result.errors[0]?.message ?? 'Invalid definition',\n result.errors,\n );\n }\n\n return {\n ...result.definition,\n sourceSnapshot: {content: yamlString, format: 'yaml'},\n diagnostics: result.diagnostics,\n };\n}\n\nexport function parseDefinition(\n yamlString: string,\n options: ParseDefinitionOptions,\n): WorkflowDefinitionPayload {\n const parsed = parseDefinitionWithDiagnostics(yamlString, options);\n return stripDefinitionDiagnostics(parsed);\n}\n\nexport function stripDefinitionDiagnostics(parsed: ParsedDefinition): WorkflowDefinitionPayload {\n return {\n document: parsed.document,\n model: parsed.model,\n sourceSnapshot: parsed.sourceSnapshot ?? null,\n };\n}\n"],"names":["DefinitionParseError","validateDefinition","parseDefinitionWithDiagnostics","yamlString","options","result","valid","errors","message","definition","sourceSnapshot","content","format","diagnostics","parseDefinition","parsed","stripDefinitionDiagnostics","document","model"],"mappings":"AAEA,SAAQA,oBAAoB,QAAO,cAAc;AACjD,SAA0CC,kBAAkB,QAAO,2BAA2B;AAQ9F,OAAO,SAASC,+BACdC,UAAkB,EAClBC,OAA+B;IAE/B,MAAMC,SAASJ,mBAAmBE,YAAYC;IAE9C,IAAI,CAACC,OAAOC,KAAK,EAAE;QACjB,MAAM,IAAIN,qBACRK,OAAOE,MAAM,CAAC,EAAE,EAAEC,WAAW,sBAC7BH,OAAOE,MAAM;IAEjB;IAEA,OAAO;QACL,GAAGF,OAAOI,UAAU;QACpBC,gBAAgB;YAACC,SAASR;YAAYS,QAAQ;QAAM;QACpDC,aAAaR,OAAOQ,WAAW;IACjC;AACF;AAEA,OAAO,SAASC,gBACdX,UAAkB,EAClBC,OAA+B;IAE/B,MAAMW,SAASb,+BAA+BC,YAAYC;IAC1D,OAAOY,2BAA2BD;AACpC;AAEA,OAAO,SAASC,2BAA2BD,MAAwB;IACjE,OAAO;QACLE,UAAUF,OAAOE,QAAQ;QACzBC,OAAOH,OAAOG,KAAK;QACnBR,gBAAgBK,OAAOL,cAAc,IAAI;IAC3C;AACF"}
@@ -0,0 +1,66 @@
1
+ import type { AgentInterModuleClient } from '@shipfox/api-agent-dto/inter-module';
2
+ import type { TriggerDto, WorkflowModelSnapshot, WorkflowSourceSnapshot } from '@shipfox/api-definitions-dto';
3
+ import { type IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
4
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
5
+ import type { ValidationError } from './validate-definition.js';
6
+ export interface ResolveDefinitionAtRefParams {
7
+ projectId: string;
8
+ ref: string;
9
+ configPath: string;
10
+ expectedCommit?: string | undefined;
11
+ projects: ProjectsModuleClient;
12
+ agent: AgentInterModuleClient;
13
+ integrations: IntegrationsModuleClient;
14
+ signal?: AbortSignal;
15
+ }
16
+ export interface ValidationWarning {
17
+ code: string;
18
+ message: string;
19
+ path?: string | undefined;
20
+ }
21
+ export interface ResolvedDefinitionAtRef {
22
+ workflow: {
23
+ id: string;
24
+ configPath: string;
25
+ };
26
+ commit: string;
27
+ model: WorkflowModelSnapshot;
28
+ sourceSnapshot: WorkflowSourceSnapshot;
29
+ triggers: Record<string, TriggerDto>;
30
+ warnings: ValidationWarning[];
31
+ }
32
+ export interface ListDefinitionsAtRefParams {
33
+ projectId: string;
34
+ ref: string;
35
+ projects: ProjectsModuleClient;
36
+ agent: AgentInterModuleClient;
37
+ integrations: IntegrationsModuleClient;
38
+ signal?: AbortSignal;
39
+ }
40
+ export interface DefinitionAtRefFile {
41
+ configPath: string;
42
+ name: string | null;
43
+ valid: boolean;
44
+ errors: ValidationError[];
45
+ warnings: ValidationWarning[];
46
+ triggers: Record<string, TriggerDto>;
47
+ }
48
+ export interface DefinitionsAtRefListing {
49
+ commit: string;
50
+ files: DefinitionAtRefFile[];
51
+ }
52
+ /**
53
+ * Resolves a workflow definition file at a git ref without persisting it.
54
+ * The ref is pinned to a commit, the file is fetched at that commit, and the
55
+ * result is validated with the sync pipeline. Only the workflow lineage row is
56
+ * created so the dev run can be numbered; no definition row and no outbox
57
+ * event are written.
58
+ */
59
+ export declare function resolveDefinitionAtRef(params: ResolveDefinitionAtRefParams): Promise<ResolvedDefinitionAtRef>;
60
+ /**
61
+ * Lists the workflow files at a git ref with their validation state. Applies
62
+ * the sync limits (100 files, 1 MB per file). One invalid file does not fail
63
+ * the listing; it is reported as invalid.
64
+ */
65
+ export declare function listDefinitionsAtRef(params: ListDefinitionsAtRefParams): Promise<DefinitionsAtRefListing>;
66
+ //# sourceMappingURL=resolve-definition-at-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-definition-at-ref.d.ts","sourceRoot":"","sources":["../../src/core/resolve-definition-at-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAsBjF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,YAAY,EAAE,wBAAwB,CAAC;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,qBAAqB,CAAC;IAC7B,cAAc,EAAE,sBAAsB,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,YAAY,EAAE,wBAAwB,CAAC;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAQD;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,uBAAuB,CAAC,CASlC;AAwDD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,uBAAuB,CAAC,CASlC"}