@shipfox/api-definitions-dto 12.2.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.
@@ -1,2 +1,2 @@
1
1
  $ shipfox-swc
2
- Successfully compiled: 7 files with swc (412.8ms)
2
+ Successfully compiled: 7 files with swc (255.38ms)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @shipfox/api-definitions-dto
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
+ - 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.
12
+
13
+ ### Minor Changes
14
+
15
+ - c0fc35b: Adds `resolveDefinitionAtRef` and `listDefinitionsAtRef` inter-module methods that resolve and validate workflow definitions at a git ref without persisting them.
16
+ - 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.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [4f30864]
21
+ - @shipfox/workflow-document@3.1.0
22
+ - @shipfox/expression@2.2.1
23
+
24
+ ## 12.3.0
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [3e7fe76]
29
+ - @shipfox/expression@2.2.0
30
+
3
31
  ## 12.2.0
4
32
 
5
33
  ### Patch Changes
package/dist/events.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const definitionResolvedEventSchema: z.ZodObject<{
9
9
  configPath: z.ZodNullable<z.ZodString>;
10
10
  triggers: z.ZodRecord<z.ZodString, z.ZodObject<{
11
11
  source: z.ZodString;
12
- event: z.ZodString;
12
+ event: z.ZodOptional<z.ZodString>;
13
13
  with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
14
  filter: z.ZodOptional<z.ZodString>;
15
15
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -41,7 +41,7 @@ export declare const definitionsEventSchemas: {
41
41
  configPath: z.ZodNullable<z.ZodString>;
42
42
  triggers: z.ZodRecord<z.ZodString, z.ZodObject<{
43
43
  source: z.ZodString;
44
- event: z.ZodString;
44
+ event: z.ZodOptional<z.ZodString>;
45
45
  with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
46
46
  filter: z.ZodOptional<z.ZodString>;
47
47
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { type CreateDefinitionBodyDto, createDefinitionBodySchema, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH, DEFINITION_SYNC_WARNINGS_MAX_COUNT, type DefinitionDto, type DefinitionListQueryDto, type DefinitionListResponseDto, type DefinitionResponseDto, type DefinitionSyncSummaryDto, type DefinitionValidationErrorDto, type DefinitionValidationWarningDto, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationErrorSchema, definitionValidationWarningSchema, type TriggerDto, } from '#schemas/index.js';
1
+ export { type CreateDefinitionBodyDto, createDefinitionBodySchema, 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, type DefinitionDto, type DefinitionListQueryDto, type DefinitionListResponseDto, type DefinitionResponseDto, type DefinitionSyncSummaryDto, type DefinitionValidationDiagnosticDto, type DefinitionValidationErrorDto, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationDiagnosticSchema, definitionValidationErrorSchema, type TriggerDto, } from '#schemas/index.js';
2
2
  export { DEFINITION_DELETED, DEFINITION_INVALID, DEFINITION_RESOLVED, type DefinitionDeletedEvent, type DefinitionInvalidEvent, type DefinitionResolvedEvent, type DefinitionsEventMap, definitionDeletedEventSchema, definitionInvalidEventSchema, definitionResolvedEventSchema, definitionsEventSchemas, } from './events.js';
3
3
  export type * from './workflow-model.js';
4
4
  export { createWorkflowModelSnapshot, DEFAULT_JOB_CHECKOUT, DEFAULT_JOB_SUCCESS, DEFAULT_RUN_TIMEOUT_MS, readPersistedWorkflowModel, WORKFLOW_MODEL_CHECKOUT_TARGET_FIELDS, workflowModelFromSnapshot, workflowModelSnapshotSchema, } from './workflow-model.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,uCAAuC,EACvC,0CAA0C,EAC1C,uCAAuC,EACvC,kCAAkC,EAClC,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EACjC,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,mBAAmB,qBAAqB,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,qCAAqC,EACrC,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,+CAA+C,EAC/C,qCAAqC,EACrC,uCAAuC,EACvC,0CAA0C,EAC1C,uCAAuC,EACvC,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,oCAAoC,EACpC,+BAA+B,EAC/B,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,mBAAmB,qBAAqB,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,qCAAqC,EACrC,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { createDefinitionBodySchema, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH, DEFINITION_SYNC_WARNINGS_MAX_COUNT, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationErrorSchema, definitionValidationWarningSchema } from '#schemas/index.js';
1
+ export { createDefinitionBodySchema, 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, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationDiagnosticSchema, definitionValidationErrorSchema } from '#schemas/index.js';
2
2
  export { DEFINITION_DELETED, DEFINITION_INVALID, DEFINITION_RESOLVED, definitionDeletedEventSchema, definitionInvalidEventSchema, definitionResolvedEventSchema, definitionsEventSchemas } from './events.js';
3
3
  export { createWorkflowModelSnapshot, DEFAULT_JOB_CHECKOUT, DEFAULT_JOB_SUCCESS, DEFAULT_RUN_TIMEOUT_MS, readPersistedWorkflowModel, WORKFLOW_MODEL_CHECKOUT_TARGET_FIELDS, workflowModelFromSnapshot, workflowModelSnapshotSchema } from './workflow-model.js';
4
4
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type CreateDefinitionBodyDto,\n createDefinitionBodySchema,\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 type DefinitionDto,\n type DefinitionListQueryDto,\n type DefinitionListResponseDto,\n type DefinitionResponseDto,\n type DefinitionSyncSummaryDto,\n type DefinitionValidationErrorDto,\n type DefinitionValidationWarningDto,\n definitionDtoSchema,\n definitionListQuerySchema,\n definitionListResponseSchema,\n definitionResponseSchema,\n definitionSyncSummarySchema,\n definitionValidationErrorSchema,\n definitionValidationWarningSchema,\n type TriggerDto,\n} from '#schemas/index.js';\nexport {\n DEFINITION_DELETED,\n DEFINITION_INVALID,\n DEFINITION_RESOLVED,\n type DefinitionDeletedEvent,\n type DefinitionInvalidEvent,\n type DefinitionResolvedEvent,\n type DefinitionsEventMap,\n definitionDeletedEventSchema,\n definitionInvalidEventSchema,\n definitionResolvedEventSchema,\n definitionsEventSchemas,\n} from './events.js';\nexport type * from './workflow-model.js';\nexport {\n createWorkflowModelSnapshot,\n DEFAULT_JOB_CHECKOUT,\n DEFAULT_JOB_SUCCESS,\n DEFAULT_RUN_TIMEOUT_MS,\n readPersistedWorkflowModel,\n WORKFLOW_MODEL_CHECKOUT_TARGET_FIELDS,\n workflowModelFromSnapshot,\n workflowModelSnapshotSchema,\n} from './workflow-model.js';\n"],"names":["createDefinitionBodySchema","DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH","DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH","DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH","DEFINITION_SYNC_WARNINGS_MAX_COUNT","definitionDtoSchema","definitionListQuerySchema","definitionListResponseSchema","definitionResponseSchema","definitionSyncSummarySchema","definitionValidationErrorSchema","definitionValidationWarningSchema","DEFINITION_DELETED","DEFINITION_INVALID","DEFINITION_RESOLVED","definitionDeletedEventSchema","definitionInvalidEventSchema","definitionResolvedEventSchema","definitionsEventSchemas","createWorkflowModelSnapshot","DEFAULT_JOB_CHECKOUT","DEFAULT_JOB_SUCCESS","DEFAULT_RUN_TIMEOUT_MS","readPersistedWorkflowModel","WORKFLOW_MODEL_CHECKOUT_TARGET_FIELDS","workflowModelFromSnapshot","workflowModelSnapshotSchema"],"mappings":"AAAA,SAEEA,0BAA0B,EAC1BC,uCAAuC,EACvCC,0CAA0C,EAC1CC,uCAAuC,EACvCC,kCAAkC,EAQlCC,mBAAmB,EACnBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,wBAAwB,EACxBC,2BAA2B,EAC3BC,+BAA+B,EAC/BC,iCAAiC,QAE5B,oBAAoB;AAC3B,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,mBAAmB,EAKnBC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,uBAAuB,QAClB,cAAc;AAErB,SACEC,2BAA2B,EAC3BC,oBAAoB,EACpBC,mBAAmB,EACnBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,qCAAqC,EACrCC,yBAAyB,EACzBC,2BAA2B,QACtB,sBAAsB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type CreateDefinitionBodyDto,\n createDefinitionBodySchema,\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 type DefinitionDto,\n type DefinitionListQueryDto,\n type DefinitionListResponseDto,\n type DefinitionResponseDto,\n type DefinitionSyncSummaryDto,\n type DefinitionValidationDiagnosticDto,\n type DefinitionValidationErrorDto,\n definitionDtoSchema,\n definitionListQuerySchema,\n definitionListResponseSchema,\n definitionResponseSchema,\n definitionSyncSummarySchema,\n definitionValidationDiagnosticSchema,\n definitionValidationErrorSchema,\n type TriggerDto,\n} from '#schemas/index.js';\nexport {\n DEFINITION_DELETED,\n DEFINITION_INVALID,\n DEFINITION_RESOLVED,\n type DefinitionDeletedEvent,\n type DefinitionInvalidEvent,\n type DefinitionResolvedEvent,\n type DefinitionsEventMap,\n definitionDeletedEventSchema,\n definitionInvalidEventSchema,\n definitionResolvedEventSchema,\n definitionsEventSchemas,\n} from './events.js';\nexport type * from './workflow-model.js';\nexport {\n createWorkflowModelSnapshot,\n DEFAULT_JOB_CHECKOUT,\n DEFAULT_JOB_SUCCESS,\n DEFAULT_RUN_TIMEOUT_MS,\n readPersistedWorkflowModel,\n WORKFLOW_MODEL_CHECKOUT_TARGET_FIELDS,\n workflowModelFromSnapshot,\n workflowModelSnapshotSchema,\n} from './workflow-model.js';\n"],"names":["createDefinitionBodySchema","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","definitionDtoSchema","definitionListQuerySchema","definitionListResponseSchema","definitionResponseSchema","definitionSyncSummarySchema","definitionValidationDiagnosticSchema","definitionValidationErrorSchema","DEFINITION_DELETED","DEFINITION_INVALID","DEFINITION_RESOLVED","definitionDeletedEventSchema","definitionInvalidEventSchema","definitionResolvedEventSchema","definitionsEventSchemas","createWorkflowModelSnapshot","DEFAULT_JOB_CHECKOUT","DEFAULT_JOB_SUCCESS","DEFAULT_RUN_TIMEOUT_MS","readPersistedWorkflowModel","WORKFLOW_MODEL_CHECKOUT_TARGET_FIELDS","workflowModelFromSnapshot","workflowModelSnapshotSchema"],"mappings":"AAAA,SAEEA,0BAA0B,EAC1BC,+CAA+C,EAC/CC,qCAAqC,EACrCC,uCAAuC,EACvCC,0CAA0C,EAC1CC,uCAAuC,EAQvCC,mBAAmB,EACnBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,wBAAwB,EACxBC,2BAA2B,EAC3BC,oCAAoC,EACpCC,+BAA+B,QAE1B,oBAAoB;AAC3B,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,mBAAmB,EAKnBC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,uBAAuB,QAClB,cAAc;AAErB,SACEC,2BAA2B,EAC3BC,oBAAoB,EACpBC,mBAAmB,EACnBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,qCAAqC,EACrCC,yBAAyB,EACzBC,2BAA2B,QACtB,sBAAsB"}
@@ -2,6 +2,7 @@ import { type InterModuleClient } from '@shipfox/inter-module';
2
2
  import { z } from 'zod';
3
3
  declare const definitionSnapshotSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
+ workflowId: z.ZodString;
5
6
  projectId: z.ZodString;
6
7
  name: z.ZodString;
7
8
  model: z.ZodObject<{
@@ -23,6 +24,7 @@ export declare const definitionsInterModuleContract: import("@shipfox/inter-modu
23
24
  output: z.ZodObject<{
24
25
  definition: z.ZodNullable<z.ZodObject<{
25
26
  id: z.ZodString;
27
+ workflowId: z.ZodString;
26
28
  projectId: z.ZodString;
27
29
  name: z.ZodString;
28
30
  model: z.ZodObject<{
@@ -36,6 +38,113 @@ export declare const definitionsInterModuleContract: import("@shipfox/inter-modu
36
38
  }, z.core.$strip>>;
37
39
  }, z.core.$strip>;
38
40
  };
41
+ resolveDefinitionAtRef: {
42
+ input: z.ZodObject<{
43
+ projectId: z.ZodString;
44
+ ref: z.ZodString;
45
+ configPath: z.ZodString;
46
+ expectedCommit: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ output: z.ZodObject<{
49
+ workflow: z.ZodObject<{
50
+ id: z.ZodString;
51
+ configPath: z.ZodString;
52
+ }, z.core.$strip>;
53
+ commit: z.ZodString;
54
+ model: z.ZodObject<{
55
+ version: z.ZodLiteral<2>;
56
+ model: z.ZodCustom<import("./workflow-model.js").WorkflowModel, import("./workflow-model.js").WorkflowModel>;
57
+ }, z.core.$strip>;
58
+ sourceSnapshot: z.ZodObject<{
59
+ content: z.ZodString;
60
+ format: z.ZodLiteral<"yaml">;
61
+ }, z.core.$strip>;
62
+ triggers: z.ZodRecord<z.ZodString, z.ZodObject<{
63
+ source: z.ZodString;
64
+ event: z.ZodOptional<z.ZodString>;
65
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
66
+ filter: z.ZodOptional<z.ZodString>;
67
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
68
+ }, z.core.$strip>>;
69
+ warnings: z.ZodArray<z.ZodObject<{
70
+ code: z.ZodString;
71
+ message: z.ZodString;
72
+ path: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strip>>;
74
+ }, z.core.$strip>;
75
+ errors: {
76
+ 'project-not-found': z.ZodObject<{
77
+ projectId: z.ZodString;
78
+ }, z.core.$strip>;
79
+ 'ref-not-found': z.ZodObject<{
80
+ ref: z.ZodString;
81
+ }, z.core.$strip>;
82
+ 'ref-invalid': z.ZodObject<{
83
+ ref: z.ZodString;
84
+ }, z.core.$strip>;
85
+ 'ref-moved': z.ZodObject<{
86
+ ref: z.ZodString;
87
+ expectedCommit: z.ZodString;
88
+ }, z.core.$strip>;
89
+ 'file-not-found': z.ZodObject<{
90
+ ref: z.ZodString;
91
+ configPath: z.ZodString;
92
+ }, z.core.$strip>;
93
+ 'content-too-large': z.ZodObject<{
94
+ configPath: z.ZodString;
95
+ }, z.core.$strip>;
96
+ 'invalid-definition': z.ZodObject<{
97
+ errors: z.ZodArray<z.ZodObject<{
98
+ message: z.ZodString;
99
+ path: z.ZodOptional<z.ZodString>;
100
+ }, z.core.$strip>>;
101
+ }, z.core.$strip>;
102
+ 'source-unavailable': z.ZodObject<{}, z.core.$strip>;
103
+ };
104
+ };
105
+ listDefinitionsAtRef: {
106
+ input: z.ZodObject<{
107
+ projectId: z.ZodString;
108
+ ref: z.ZodString;
109
+ }, z.core.$strip>;
110
+ output: z.ZodObject<{
111
+ commit: z.ZodString;
112
+ files: z.ZodArray<z.ZodObject<{
113
+ configPath: z.ZodString;
114
+ name: z.ZodNullable<z.ZodString>;
115
+ valid: z.ZodBoolean;
116
+ errors: z.ZodArray<z.ZodObject<{
117
+ message: z.ZodString;
118
+ path: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strip>>;
120
+ warnings: z.ZodArray<z.ZodObject<{
121
+ code: z.ZodString;
122
+ message: z.ZodString;
123
+ path: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>>;
125
+ triggers: z.ZodRecord<z.ZodString, z.ZodObject<{
126
+ source: z.ZodString;
127
+ event: z.ZodOptional<z.ZodString>;
128
+ with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
+ filter: z.ZodOptional<z.ZodString>;
130
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
131
+ }, z.core.$strip>>;
132
+ }, z.core.$strip>>;
133
+ }, z.core.$strip>;
134
+ errors: {
135
+ 'project-not-found': z.ZodObject<{
136
+ projectId: z.ZodString;
137
+ }, z.core.$strip>;
138
+ 'ref-not-found': z.ZodObject<{
139
+ ref: z.ZodString;
140
+ }, z.core.$strip>;
141
+ 'ref-invalid': z.ZodObject<{
142
+ ref: z.ZodString;
143
+ }, z.core.$strip>;
144
+ 'too-many-files': z.ZodObject<{}, z.core.$strip>;
145
+ 'source-unavailable': z.ZodObject<{}, z.core.$strip>;
146
+ };
147
+ };
39
148
  };
40
149
  }>;
41
150
  export type DefinitionsInterModuleClient = InterModuleClient<typeof definitionsInterModuleContract>;
@@ -1 +1 @@
1
- {"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../src/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,QAAA,MAAM,wBAAwB;;;;;;;;;;;;iBAM5B,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;QAGvC,2BAA2B;YACzB,KAAK;;;YACL,MAAM;;;;;;;;;;;;;;;;;EAGV,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACpG,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../src/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAQtB,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;iBAO5B,CAAC;AAwCH,eAAO,MAAM,8BAA8B;;;QAGvC,2BAA2B;YACzB,KAAK;;;YACL,MAAM;;;;;;;;;;;;;;;;;QAER,sBAAsB;YACpB,KAAK;;;;;;YAML,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;YACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAER,oBAAoB;YAClB,KAAK;;;;YACL,MAAM;;;;;;;;;;;;;;;;;;;;;;;;YAIN,MAAM;;;;;;;;;;;;;;;EAGV,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACpG,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1,9 +1,14 @@
1
1
  import { defineInterModuleContract } from '@shipfox/inter-module';
2
2
  import { z } from 'zod';
3
+ import { definitionValidationErrorSchema } from '#schemas/dto.js';
4
+ import { triggerDtoSchema } from '#schemas/trigger.js';
3
5
  import { workflowModelSnapshotSchema } from './workflow-model.js';
4
6
  const idSchema = z.string().uuid();
7
+ const refSchema = z.string().min(1);
8
+ const configPathSchema = z.string().min(1);
5
9
  const definitionSnapshotSchema = z.object({
6
10
  id: idSchema,
11
+ workflowId: idSchema,
7
12
  projectId: idSchema,
8
13
  name: z.string(),
9
14
  model: workflowModelSnapshotSchema,
@@ -12,6 +17,72 @@ const definitionSnapshotSchema = z.object({
12
17
  format: z.literal('yaml')
13
18
  }).nullable()
14
19
  });
20
+ const validationWarningSchema = z.object({
21
+ code: z.string(),
22
+ message: z.string(),
23
+ path: z.string().optional()
24
+ });
25
+ const refResolutionErrors = {
26
+ 'project-not-found': z.object({
27
+ projectId: idSchema
28
+ }),
29
+ 'ref-not-found': z.object({
30
+ ref: refSchema
31
+ }),
32
+ 'ref-invalid': z.object({
33
+ ref: refSchema
34
+ }),
35
+ 'ref-moved': z.object({
36
+ ref: refSchema,
37
+ expectedCommit: z.string()
38
+ }),
39
+ 'file-not-found': z.object({
40
+ ref: refSchema,
41
+ configPath: configPathSchema
42
+ }),
43
+ 'content-too-large': z.object({
44
+ configPath: configPathSchema
45
+ }),
46
+ 'invalid-definition': z.object({
47
+ errors: z.array(definitionValidationErrorSchema)
48
+ }),
49
+ 'source-unavailable': z.object({})
50
+ };
51
+ const refListingErrors = {
52
+ 'project-not-found': z.object({
53
+ projectId: idSchema
54
+ }),
55
+ 'ref-not-found': z.object({
56
+ ref: refSchema
57
+ }),
58
+ 'ref-invalid': z.object({
59
+ ref: refSchema
60
+ }),
61
+ 'too-many-files': z.object({}),
62
+ 'source-unavailable': z.object({})
63
+ };
64
+ const resolvedDefinitionAtRefSchema = z.object({
65
+ workflow: z.object({
66
+ id: idSchema,
67
+ configPath: configPathSchema
68
+ }),
69
+ commit: z.string(),
70
+ model: workflowModelSnapshotSchema,
71
+ sourceSnapshot: z.object({
72
+ content: z.string(),
73
+ format: z.literal('yaml')
74
+ }),
75
+ triggers: z.record(z.string(), triggerDtoSchema),
76
+ warnings: z.array(validationWarningSchema)
77
+ });
78
+ const definitionAtRefFileSchema = z.object({
79
+ configPath: configPathSchema,
80
+ name: z.string().nullable(),
81
+ valid: z.boolean(),
82
+ errors: z.array(definitionValidationErrorSchema),
83
+ warnings: z.array(validationWarningSchema),
84
+ triggers: z.record(z.string(), triggerDtoSchema)
85
+ });
15
86
  export const definitionsInterModuleContract = defineInterModuleContract({
16
87
  module: 'definitions',
17
88
  methods: {
@@ -22,6 +93,27 @@ export const definitionsInterModuleContract = defineInterModuleContract({
22
93
  output: z.object({
23
94
  definition: definitionSnapshotSchema.nullable()
24
95
  })
96
+ },
97
+ resolveDefinitionAtRef: {
98
+ input: z.object({
99
+ projectId: idSchema,
100
+ ref: refSchema,
101
+ configPath: configPathSchema,
102
+ expectedCommit: z.string().optional()
103
+ }),
104
+ output: resolvedDefinitionAtRefSchema,
105
+ errors: refResolutionErrors
106
+ },
107
+ listDefinitionsAtRef: {
108
+ input: z.object({
109
+ projectId: idSchema,
110
+ ref: refSchema
111
+ }),
112
+ output: z.object({
113
+ commit: z.string(),
114
+ files: z.array(definitionAtRefFileSchema)
115
+ }),
116
+ errors: refListingErrors
25
117
  }
26
118
  }
27
119
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/inter-module.ts"],"sourcesContent":["import {defineInterModuleContract, type InterModuleClient} from '@shipfox/inter-module';\nimport {z} from 'zod';\nimport {workflowModelSnapshotSchema} from './workflow-model.js';\n\nconst idSchema = z.string().uuid();\nconst definitionSnapshotSchema = z.object({\n id: idSchema,\n projectId: idSchema,\n name: z.string(),\n model: workflowModelSnapshotSchema,\n sourceSnapshot: z.object({content: z.string(), format: z.literal('yaml')}).nullable(),\n});\n\nexport const definitionsInterModuleContract = defineInterModuleContract({\n module: 'definitions',\n methods: {\n getDefinitionForWorkflowRun: {\n input: z.object({definitionId: idSchema}),\n output: z.object({definition: definitionSnapshotSchema.nullable()}),\n },\n },\n});\n\nexport type DefinitionsInterModuleClient = InterModuleClient<typeof definitionsInterModuleContract>;\nexport type DefinitionWorkflowSnapshot = z.infer<typeof definitionSnapshotSchema>;\n"],"names":["defineInterModuleContract","z","workflowModelSnapshotSchema","idSchema","string","uuid","definitionSnapshotSchema","object","id","projectId","name","model","sourceSnapshot","content","format","literal","nullable","definitionsInterModuleContract","module","methods","getDefinitionForWorkflowRun","input","definitionId","output","definition"],"mappings":"AAAA,SAAQA,yBAAyB,QAA+B,wBAAwB;AACxF,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,2BAA2B,QAAO,sBAAsB;AAEhE,MAAMC,WAAWF,EAAEG,MAAM,GAAGC,IAAI;AAChC,MAAMC,2BAA2BL,EAAEM,MAAM,CAAC;IACxCC,IAAIL;IACJM,WAAWN;IACXO,MAAMT,EAAEG,MAAM;IACdO,OAAOT;IACPU,gBAAgBX,EAAEM,MAAM,CAAC;QAACM,SAASZ,EAAEG,MAAM;QAAIU,QAAQb,EAAEc,OAAO,CAAC;IAAO,GAAGC,QAAQ;AACrF;AAEA,OAAO,MAAMC,iCAAiCjB,0BAA0B;IACtEkB,QAAQ;IACRC,SAAS;QACPC,6BAA6B;YAC3BC,OAAOpB,EAAEM,MAAM,CAAC;gBAACe,cAAcnB;YAAQ;YACvCoB,QAAQtB,EAAEM,MAAM,CAAC;gBAACiB,YAAYlB,yBAAyBU,QAAQ;YAAE;QACnE;IACF;AACF,GAAG"}
1
+ {"version":3,"sources":["../src/inter-module.ts"],"sourcesContent":["import {defineInterModuleContract, type InterModuleClient} from '@shipfox/inter-module';\nimport {z} from 'zod';\nimport {definitionValidationErrorSchema} from '#schemas/dto.js';\nimport {triggerDtoSchema} from '#schemas/trigger.js';\nimport {workflowModelSnapshotSchema} from './workflow-model.js';\n\nconst idSchema = z.string().uuid();\nconst refSchema = z.string().min(1);\nconst configPathSchema = z.string().min(1);\nconst definitionSnapshotSchema = z.object({\n id: idSchema,\n workflowId: idSchema,\n projectId: idSchema,\n name: z.string(),\n model: workflowModelSnapshotSchema,\n sourceSnapshot: z.object({content: z.string(), format: z.literal('yaml')}).nullable(),\n});\nconst validationWarningSchema = z.object({\n code: z.string(),\n message: z.string(),\n path: z.string().optional(),\n});\nconst refResolutionErrors = {\n 'project-not-found': z.object({projectId: idSchema}),\n 'ref-not-found': z.object({ref: refSchema}),\n 'ref-invalid': z.object({ref: refSchema}),\n 'ref-moved': z.object({ref: refSchema, expectedCommit: z.string()}),\n 'file-not-found': z.object({ref: refSchema, configPath: configPathSchema}),\n 'content-too-large': z.object({configPath: configPathSchema}),\n 'invalid-definition': z.object({errors: z.array(definitionValidationErrorSchema)}),\n 'source-unavailable': z.object({}),\n};\nconst refListingErrors = {\n 'project-not-found': z.object({projectId: idSchema}),\n 'ref-not-found': z.object({ref: refSchema}),\n 'ref-invalid': z.object({ref: refSchema}),\n 'too-many-files': z.object({}),\n 'source-unavailable': z.object({}),\n};\nconst resolvedDefinitionAtRefSchema = z.object({\n workflow: z.object({id: idSchema, configPath: configPathSchema}),\n commit: z.string(),\n model: workflowModelSnapshotSchema,\n sourceSnapshot: z.object({content: z.string(), format: z.literal('yaml')}),\n triggers: z.record(z.string(), triggerDtoSchema),\n warnings: z.array(validationWarningSchema),\n});\nconst definitionAtRefFileSchema = z.object({\n configPath: configPathSchema,\n name: z.string().nullable(),\n valid: z.boolean(),\n errors: z.array(definitionValidationErrorSchema),\n warnings: z.array(validationWarningSchema),\n triggers: z.record(z.string(), triggerDtoSchema),\n});\n\nexport const definitionsInterModuleContract = defineInterModuleContract({\n module: 'definitions',\n methods: {\n getDefinitionForWorkflowRun: {\n input: z.object({definitionId: idSchema}),\n output: z.object({definition: definitionSnapshotSchema.nullable()}),\n },\n resolveDefinitionAtRef: {\n input: z.object({\n projectId: idSchema,\n ref: refSchema,\n configPath: configPathSchema,\n expectedCommit: z.string().optional(),\n }),\n output: resolvedDefinitionAtRefSchema,\n errors: refResolutionErrors,\n },\n listDefinitionsAtRef: {\n input: z.object({projectId: idSchema, ref: refSchema}),\n output: z.object({\n commit: z.string(),\n files: z.array(definitionAtRefFileSchema),\n }),\n errors: refListingErrors,\n },\n },\n});\n\nexport type DefinitionsInterModuleClient = InterModuleClient<typeof definitionsInterModuleContract>;\nexport type DefinitionWorkflowSnapshot = z.infer<typeof definitionSnapshotSchema>;\n"],"names":["defineInterModuleContract","z","definitionValidationErrorSchema","triggerDtoSchema","workflowModelSnapshotSchema","idSchema","string","uuid","refSchema","min","configPathSchema","definitionSnapshotSchema","object","id","workflowId","projectId","name","model","sourceSnapshot","content","format","literal","nullable","validationWarningSchema","code","message","path","optional","refResolutionErrors","ref","expectedCommit","configPath","errors","array","refListingErrors","resolvedDefinitionAtRefSchema","workflow","commit","triggers","record","warnings","definitionAtRefFileSchema","valid","boolean","definitionsInterModuleContract","module","methods","getDefinitionForWorkflowRun","input","definitionId","output","definition","resolveDefinitionAtRef","listDefinitionsAtRef","files"],"mappings":"AAAA,SAAQA,yBAAyB,QAA+B,wBAAwB;AACxF,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,+BAA+B,QAAO,kBAAkB;AAChE,SAAQC,gBAAgB,QAAO,sBAAsB;AACrD,SAAQC,2BAA2B,QAAO,sBAAsB;AAEhE,MAAMC,WAAWJ,EAAEK,MAAM,GAAGC,IAAI;AAChC,MAAMC,YAAYP,EAAEK,MAAM,GAAGG,GAAG,CAAC;AACjC,MAAMC,mBAAmBT,EAAEK,MAAM,GAAGG,GAAG,CAAC;AACxC,MAAME,2BAA2BV,EAAEW,MAAM,CAAC;IACxCC,IAAIR;IACJS,YAAYT;IACZU,WAAWV;IACXW,MAAMf,EAAEK,MAAM;IACdW,OAAOb;IACPc,gBAAgBjB,EAAEW,MAAM,CAAC;QAACO,SAASlB,EAAEK,MAAM;QAAIc,QAAQnB,EAAEoB,OAAO,CAAC;IAAO,GAAGC,QAAQ;AACrF;AACA,MAAMC,0BAA0BtB,EAAEW,MAAM,CAAC;IACvCY,MAAMvB,EAAEK,MAAM;IACdmB,SAASxB,EAAEK,MAAM;IACjBoB,MAAMzB,EAAEK,MAAM,GAAGqB,QAAQ;AAC3B;AACA,MAAMC,sBAAsB;IAC1B,qBAAqB3B,EAAEW,MAAM,CAAC;QAACG,WAAWV;IAAQ;IAClD,iBAAiBJ,EAAEW,MAAM,CAAC;QAACiB,KAAKrB;IAAS;IACzC,eAAeP,EAAEW,MAAM,CAAC;QAACiB,KAAKrB;IAAS;IACvC,aAAaP,EAAEW,MAAM,CAAC;Q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;AACjC;AAEA,OAAO,MAAMyC,iCAAiC5C,0BAA0B;IACtE6C,QAAQ;IACRC,SAAS;QACPC,6BAA6B;YAC3BC,OAAO/C,EAAEW,MAAM,CAAC;gBAACqC,cAAc5C;YAAQ;YACvC6C,QAAQjD,EAAEW,MAAM,CAAC;gBAACuC,YAAYxC,yBAAyBW,QAAQ;YAAE;QACnE;QACA8B,wBAAwB;YACtBJ,OAAO/C,EAAEW,MAAM,CAAC;gBACdG,WAAWV;gBACXwB,KAAKrB;gBACLuB,YAAYrB;gBACZoB,gBAAgB7B,EAAEK,MAAM,GAAGqB,QAAQ;YACrC;YACAuB,QAAQf;YACRH,QAAQJ;QACV;QACAyB,sBAAsB;YACpBL,OAAO/C,EAAEW,MAAM,CAAC;gBAACG,WAAWV;gBAAUwB,KAAKrB;YAAS;YACpD0C,QAAQjD,EAAEW,MAAM,CAAC;gBACfyB,QAAQpC,EAAEK,MAAM;gBAChBgD,OAAOrD,EAAEgC,KAAK,CAACQ;YACjB;YACAT,QAAQE;QACV;IACF;AACF,GAAG"}
@@ -1,8 +1,9 @@
1
1
  import { z } from 'zod';
2
- export declare const DEFINITION_SYNC_WARNINGS_MAX_COUNT = 100;
2
+ export declare const DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT = 100;
3
3
  export declare const DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH = 128;
4
4
  export declare const DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH = 2048;
5
5
  export declare const DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH = 512;
6
+ export declare const DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH = 512;
6
7
  export declare const createDefinitionBodySchema: z.ZodObject<{
7
8
  project_id: z.ZodString;
8
9
  config_path: z.ZodOptional<z.ZodString>;
@@ -62,12 +63,17 @@ export declare const definitionValidationErrorSchema: z.ZodObject<{
62
63
  path: z.ZodOptional<z.ZodString>;
63
64
  }, z.core.$strip>;
64
65
  export type DefinitionValidationErrorDto = z.infer<typeof definitionValidationErrorSchema>;
65
- export declare const definitionValidationWarningSchema: z.ZodObject<{
66
+ export declare const definitionValidationDiagnosticSchema: z.ZodObject<{
66
67
  code: z.ZodString;
67
68
  message: z.ZodString;
68
69
  path: z.ZodOptional<z.ZodString>;
70
+ file_path: z.ZodOptional<z.ZodString>;
71
+ severity: z.ZodEnum<{
72
+ error: "error";
73
+ warning: "warning";
74
+ }>;
69
75
  }, z.core.$strip>;
70
- export type DefinitionValidationWarningDto = z.infer<typeof definitionValidationWarningSchema>;
76
+ export type DefinitionValidationDiagnosticDto = z.infer<typeof definitionValidationDiagnosticSchema>;
71
77
  export declare const definitionListQuerySchema: z.ZodObject<{
72
78
  project_id: z.ZodString;
73
79
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -101,10 +107,15 @@ export declare const definitionSyncSummarySchema: z.ZodObject<{
101
107
  unknown: "unknown";
102
108
  }>>;
103
109
  last_error_message: z.ZodNullable<z.ZodString>;
104
- warnings: z.ZodArray<z.ZodObject<{
110
+ diagnostics: z.ZodArray<z.ZodObject<{
105
111
  code: z.ZodString;
106
112
  message: z.ZodString;
107
113
  path: z.ZodOptional<z.ZodString>;
114
+ file_path: z.ZodOptional<z.ZodString>;
115
+ severity: z.ZodEnum<{
116
+ error: "error";
117
+ warning: "warning";
118
+ }>;
108
119
  }, z.core.$strip>>;
109
120
  }, z.core.$strip>;
110
121
  export type DefinitionSyncSummaryDto = z.infer<typeof definitionSyncSummarySchema>;
@@ -156,10 +167,15 @@ export declare const definitionListResponseSchema: z.ZodObject<{
156
167
  unknown: "unknown";
157
168
  }>>;
158
169
  last_error_message: z.ZodNullable<z.ZodString>;
159
- warnings: z.ZodArray<z.ZodObject<{
170
+ diagnostics: z.ZodArray<z.ZodObject<{
160
171
  code: z.ZodString;
161
172
  message: z.ZodString;
162
173
  path: z.ZodOptional<z.ZodString>;
174
+ file_path: z.ZodOptional<z.ZodString>;
175
+ severity: z.ZodEnum<{
176
+ error: "error";
177
+ warning: "warning";
178
+ }>;
163
179
  }, z.core.$strip>>;
164
180
  }, z.core.$strip>>;
165
181
  next_cursor: z.ZodNullable<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/schemas/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,kCAAkC,MAAM,CAAC;AACtD,eAAO,MAAM,uCAAuC,MAAM,CAAC;AAC3D,eAAO,MAAM,0CAA0C,OAAO,CAAC;AAC/D,eAAO,MAAM,uCAAuC,MAAM,CAAC;AAE3D,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAiCnC,CAAC;AAEL,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;iBAkB9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;iBAAsB,CAAC;AAE5D,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,eAAO,MAAM,+BAA+B;;;iBAG1C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE3F,eAAO,MAAM,iCAAiC;;;;iBAI5C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE/F,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE/E,eAAO,M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MAAM,oCAAoC;;;;;;;;;iBAM/C,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE/E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BtC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIvC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { z } from 'zod';
2
- export const DEFINITION_SYNC_WARNINGS_MAX_COUNT = 100;
2
+ export const DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT = 100;
3
3
  export const DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH = 128;
4
4
  export const DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH = 2048;
5
5
  export const DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH = 512;
6
+ export const DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH = 512;
6
7
  export const createDefinitionBodySchema = z.object({
7
8
  project_id: z.string().uuid(),
8
9
  config_path: z.string().min(1).optional(),
@@ -71,10 +72,15 @@ export const definitionValidationErrorSchema = z.object({
71
72
  message: z.string(),
72
73
  path: z.string().optional()
73
74
  });
74
- export const definitionValidationWarningSchema = z.object({
75
+ export const definitionValidationDiagnosticSchema = z.object({
75
76
  code: z.string().max(DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),
76
77
  message: z.string().max(DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),
77
- path: z.string().max(DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH).optional()
78
+ path: z.string().max(DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH).optional(),
79
+ file_path: z.string().max(DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH).optional(),
80
+ severity: z.enum([
81
+ 'error',
82
+ 'warning'
83
+ ])
78
84
  });
79
85
  export const definitionListQuerySchema = z.object({
80
86
  project_id: z.string().uuid(),
@@ -108,7 +114,7 @@ export const definitionSyncSummarySchema = z.object({
108
114
  'unknown'
109
115
  ]).nullable(),
110
116
  last_error_message: z.string().nullable(),
111
- warnings: z.array(definitionValidationWarningSchema).max(DEFINITION_SYNC_WARNINGS_MAX_COUNT)
117
+ diagnostics: z.array(definitionValidationDiagnosticSchema).max(DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT)
112
118
  });
113
119
  export const definitionListResponseSchema = z.object({
114
120
  definitions: z.array(definitionResponseSchema),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/dto.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const DEFINITION_SYNC_WARNINGS_MAX_COUNT = 100;\nexport const DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH = 128;\nexport const DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH = 2048;\nexport const DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH = 512;\n\nexport const createDefinitionBodySchema = z\n .object({\n project_id: z.string().uuid(),\n config_path: z.string().min(1).optional(),\n source: z.enum(['manual', 'vcs']).optional(),\n yaml: z.string().min(1).max(1_000_000),\n sha: z.string().optional(),\n ref: z.string().optional(),\n })\n .superRefine((value, ctx) => {\n const source = value.source ?? 'manual';\n if (source === 'vcs' && !value.config_path) {\n ctx.addIssue({\n code: 'custom',\n message: 'config_path is required for VCS definitions',\n path: ['config_path'],\n });\n }\n const hasRefOrSha = value.ref != null || value.sha != null;\n if (source === 'vcs' && !hasRefOrSha) {\n ctx.addIssue({\n code: 'custom',\n message: 'VCS definitions require a ref or sha',\n path: ['ref'],\n });\n }\n if (source === 'manual' && hasRefOrSha) {\n ctx.addIssue({\n code: 'custom',\n message: 'manual definitions must not set ref or sha',\n path: value.ref != null ? ['ref'] : ['sha'],\n });\n }\n });\n\nexport type CreateDefinitionBodyDto = z.infer<typeof createDefinitionBodySchema>;\n\nexport const definitionDtoSchema = z.object({\n id: z.string().uuid(),\n project_id: z.string().uuid(),\n config_path: z.string().nullable(),\n source: z.enum(['manual', 'vcs']),\n sha: z.string().nullable(),\n ref: z.string().nullable(),\n name: z.string(),\n workflow_document: z.unknown(),\n workflow_model: z.unknown(),\n manual_trigger: z\n .object({\n name: z.string(),\n })\n .nullable(),\n fetched_at: z.string(),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport type DefinitionDto = z.infer<typeof definitionDtoSchema>;\n\nexport const definitionResponseSchema = definitionDtoSchema;\n\nexport type DefinitionResponseDto = z.infer<typeof definitionResponseSchema>;\n\nexport const definitionValidationErrorSchema = z.object({\n message: z.string(),\n path: z.string().optional(),\n});\n\nexport type DefinitionValidationErrorDto = z.infer<typeof definitionValidationErrorSchema>;\n\nexport const definitionValidationWarningSchema = z.object({\n code: z.string().max(DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),\n message: z.string().max(DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),\n path: z.string().max(DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH).optional(),\n});\n\nexport type DefinitionValidationWarningDto = z.infer<typeof definitionValidationWarningSchema>;\n\nexport const definitionListQuerySchema = 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});\n\nexport type DefinitionListQueryDto = z.infer<typeof definitionListQuerySchema>;\n\nexport const definitionSyncSummarySchema = z.object({\n ref: z.string().nullable(),\n status: z.enum(['pending', 'syncing', 'succeeded', 'failed']),\n last_sync_at: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n last_error_code: z\n .enum([\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 ])\n .nullable(),\n last_error_message: z.string().nullable(),\n warnings: z.array(definitionValidationWarningSchema).max(DEFINITION_SYNC_WARNINGS_MAX_COUNT),\n});\n\nexport type DefinitionSyncSummaryDto = z.infer<typeof definitionSyncSummarySchema>;\n\nexport const definitionListResponseSchema = z.object({\n definitions: z.array(definitionResponseSchema),\n sync: definitionSyncSummarySchema.nullable(),\n next_cursor: z.string().nullable(),\n});\n\nexport type DefinitionListResponseDto = z.infer<typeof definitionListResponseSchema>;\n"],"names":["z","DEFINITION_SYNC_WARNINGS_MAX_COUNT","DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH","DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH","DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH","createDefinitionBodySchema","object","project_id","string","uuid","config_path","min","optional","source","enum","yaml","max","sha","ref","superRefine","value","ctx","addIssue","code","message","path","hasRefOrSha","definitionDtoSchema","id","nullable","name","workflow_document","unknown","workflow_model","manual_trigger","fetched_at","created_at","updated_at","definitionResponseSchema","definitionValidationErrorSchema","definitionValidationWarningSchema","definitionListQuerySchema","limit","coerce","number","int","default","cursor","definitionSyncSummarySchema","status","last_sync_at","started_at","finished_at","last_error_code","last_error_message","warnings","array","definitionListResponseSchema","definitions","sync","next_cursor"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,qCAAqC,IAAI;AACtD,OAAO,MAAMC,0CAA0C,IAAI;AAC3D,OAAO,MAAMC,6CAA6C,KAAK;AAC/D,OAAO,MA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,MAAM;IACtB2C,YAAYnD,EAAEQ,MAAM,GAAGqB,QAAQ;IAC/BuB,aAAapD,EAAEQ,MAAM,GAAGqB,QAAQ;IAChCwB,iBAAiBrD,EACdc,IAAI,CAAC;QACJ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,EACAe,QAAQ;IACXyB,oBAAoBtD,EAAEQ,MAAM,GAAGqB,QAAQ;IACvC0B,UAAUvD,EAAEwD,KAAK,CAAChB,mCAAmCxB,GAAG,CAACf;AAC3D,GAAG;AAIH,OAAO,MAAMwD,+BAA+BzD,EAAEM,MAAM,CAAC;IACnDoD,aAAa1D,EAAEwD,KAAK,CAAClB;IACrBqB,MAAMX,4BAA4BnB,QAAQ;IAC1C+B,aAAa5D,EAAEQ,MAAM,GAAGqB,QAAQ;AAClC,GAAG"}
1
+ {"version":3,"sources":["../../src/schemas/dto.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT = 100;\nexport const DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH = 128;\nexport const DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH = 2048;\nexport const DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH = 512;\nexport const DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH = 512;\n\nexport const createDefinitionBodySchema = z\n .object({\n project_id: z.string().uuid(),\n config_path: z.string().min(1).optional(),\n source: z.enum(['manual', 'vcs']).optional(),\n yaml: z.string().min(1).max(1_000_000),\n sha: z.string().optional(),\n ref: z.string().optional(),\n })\n .superRefine((value, ctx) => {\n const source = value.source ?? 'manual';\n if (source === 'vcs' && !value.config_path) {\n ctx.addIssue({\n code: 'custom',\n message: 'config_path is required for VCS definitions',\n path: ['config_path'],\n });\n }\n const hasRefOrSha = value.ref != null || value.sha != null;\n if (source === 'vcs' && !hasRefOrSha) {\n ctx.addIssue({\n code: 'custom',\n message: 'VCS definitions require a ref or sha',\n path: ['ref'],\n });\n }\n if (source === 'manual' && hasRefOrSha) {\n ctx.addIssue({\n code: 'custom',\n message: 'manual definitions must not set ref or sha',\n path: value.ref != null ? ['ref'] : ['sha'],\n });\n }\n });\n\nexport type CreateDefinitionBodyDto = z.infer<typeof createDefinitionBodySchema>;\n\nexport const definitionDtoSchema = z.object({\n id: z.string().uuid(),\n project_id: z.string().uuid(),\n config_path: z.string().nullable(),\n source: z.enum(['manual', 'vcs']),\n sha: z.string().nullable(),\n ref: z.string().nullable(),\n name: z.string(),\n workflow_document: z.unknown(),\n workflow_model: z.unknown(),\n manual_trigger: z\n .object({\n name: z.string(),\n })\n .nullable(),\n fetched_at: z.string(),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport type DefinitionDto = z.infer<typeof definitionDtoSchema>;\n\nexport const definitionResponseSchema = definitionDtoSchema;\n\nexport type DefinitionResponseDto = z.infer<typeof definitionResponseSchema>;\n\nexport const definitionValidationErrorSchema = z.object({\n message: z.string(),\n path: z.string().optional(),\n});\n\nexport type DefinitionValidationErrorDto = z.infer<typeof definitionValidationErrorSchema>;\n\nexport const definitionValidationDiagnosticSchema = z.object({\n code: z.string().max(DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH),\n message: z.string().max(DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH),\n path: z.string().max(DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH).optional(),\n file_path: z.string().max(DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH).optional(),\n severity: z.enum(['error', 'warning']),\n});\n\nexport type DefinitionValidationDiagnosticDto = z.infer<\n typeof definitionValidationDiagnosticSchema\n>;\n\nexport const definitionListQuerySchema = 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});\n\nexport type DefinitionListQueryDto = z.infer<typeof definitionListQuerySchema>;\n\nexport const definitionSyncSummarySchema = z.object({\n ref: z.string().nullable(),\n status: z.enum(['pending', 'syncing', 'succeeded', 'failed']),\n last_sync_at: z.string(),\n started_at: z.string().nullable(),\n finished_at: z.string().nullable(),\n last_error_code: z\n .enum([\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 ])\n .nullable(),\n last_error_message: z.string().nullable(),\n diagnostics: z\n .array(definitionValidationDiagnosticSchema)\n .max(DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT),\n});\n\nexport type DefinitionSyncSummaryDto = z.infer<typeof definitionSyncSummarySchema>;\n\nexport const definitionListResponseSchema = z.object({\n definitions: z.array(definitionResponseSchema),\n sync: definitionSyncSummarySchema.nullable(),\n next_cursor: z.string().nullable(),\n});\n\nexport type DefinitionListResponseDto = z.infer<typeof definitionListResponseSchema>;\n"],"names":["z","DEFINITION_SYNC_DIAGNOSTICS_MAX_COUNT","DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH","DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH","DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH","DEFINITION_SYNC_DIAGNOSTIC_FILE_PATH_MAX_LENGTH","createDefinitionBodySchema","object","project_id","string","uuid","config_path","min","optional","source","enum","yaml","max","sha","ref","superRefine","value","ctx","addIssue","code","message","path","hasRefOrSha","definitionDtoSchema","id","nullable","name","workflow_document","unknown","workflow_model","manual_trigger","fetched_at","created_at","updated_at","definitionResponseSchema","definitionValidationErrorSchema","definitionValidationDiagnosticSchema","file_path","severity","definitionListQuerySchema","limit","coerce","number","int","default","cursor","definitionSyncSummarySchema","status","last_sync_at","started_at","finished_at","last_error_code","last_error_message","diagnostics","array","definitionListResponseSchema","definitions","sync","next_cursor"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,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;AAC7B,GAAG;AAIH,OAAO,MAAMsC,8BAA8BnD,EAAEO,MAAM,CAAC;IAClDY,KAAKnB,EAAES,MAAM,GAAGqB,QAAQ;IACxBsB,QAAQpD,EAAEe,IAAI,CAAC;QAAC;QAAW;QAAW;QAAa;KAAS;IAC5DsC,cAAcrD,EAAES,MAAM;IACtB6C,YAAYtD,EAAES,MAAM,GAAGqB,QAAQ;IAC/ByB,aAAavD,EAAES,MAAM,GAAGqB,QAAQ;IAChC0B,iBAAiBxD,EACde,IAAI,CAAC;QACJ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,EACAe,QAAQ;IACX2B,oBAAoBzD,EAAES,MAAM,GAAGqB,QAAQ;IACvC4B,aAAa1D,EACV2D,KAAK,CAAClB,sCACNxB,GAAG,CAAChB;AACT,GAAG;AAIH,OAAO,MAAM2D,+BAA+B5D,EAAEO,MAAM,CAAC;IACnDsD,aAAa7D,EAAE2D,KAAK,CAACpB;IACrBuB,MAAMX,4BAA4BrB,QAAQ;IAC1CiC,aAAa/D,EAAES,MAAM,GAAGqB,QAAQ;AAClC,GAAG"}
@@ -1,3 +1,3 @@
1
- export { type CreateDefinitionBodyDto, createDefinitionBodySchema, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH, DEFINITION_SYNC_WARNINGS_MAX_COUNT, type DefinitionDto, type DefinitionListQueryDto, type DefinitionListResponseDto, type DefinitionResponseDto, type DefinitionSyncSummaryDto, type DefinitionValidationErrorDto, type DefinitionValidationWarningDto, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationErrorSchema, definitionValidationWarningSchema, } from './dto.js';
1
+ export { type CreateDefinitionBodyDto, createDefinitionBodySchema, 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, type DefinitionDto, type DefinitionListQueryDto, type DefinitionListResponseDto, type DefinitionResponseDto, type DefinitionSyncSummaryDto, type DefinitionValidationDiagnosticDto, type DefinitionValidationErrorDto, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationDiagnosticSchema, definitionValidationErrorSchema, } from './dto.js';
2
2
  export type { TriggerDto } from './trigger.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,uCAAuC,EACvC,0CAA0C,EAC1C,uCAAuC,EACvC,kCAAkC,EAClC,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,UAAU,CAAC;AAClB,YAAY,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,+CAA+C,EAC/C,qCAAqC,EACrC,uCAAuC,EACvC,0CAA0C,EAC1C,uCAAuC,EACvC,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,UAAU,CAAC;AAClB,YAAY,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC"}
@@ -1,3 +1,3 @@
1
- export { createDefinitionBodySchema, DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH, DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH, DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH, DEFINITION_SYNC_WARNINGS_MAX_COUNT, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationErrorSchema, definitionValidationWarningSchema } from './dto.js';
1
+ export { createDefinitionBodySchema, 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, definitionDtoSchema, definitionListQuerySchema, definitionListResponseSchema, definitionResponseSchema, definitionSyncSummarySchema, definitionValidationDiagnosticSchema, definitionValidationErrorSchema } from './dto.js';
2
2
 
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n type CreateDefinitionBodyDto,\n createDefinitionBodySchema,\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 type DefinitionDto,\n type DefinitionListQueryDto,\n type DefinitionListResponseDto,\n type DefinitionResponseDto,\n type DefinitionSyncSummaryDto,\n type DefinitionValidationErrorDto,\n type DefinitionValidationWarningDto,\n definitionDtoSchema,\n definitionListQuerySchema,\n definitionListResponseSchema,\n definitionResponseSchema,\n definitionSyncSummarySchema,\n definitionValidationErrorSchema,\n definitionValidationWarningSchema,\n} from './dto.js';\nexport type {TriggerDto} from './trigger.js';\n"],"names":["createDefinitionBodySchema","DEFINITION_SYNC_WARNING_CODE_MAX_LENGTH","DEFINITION_SYNC_WARNING_MESSAGE_MAX_LENGTH","DEFINITION_SYNC_WARNING_PATH_MAX_LENGTH","DEFINITION_SYNC_WARNINGS_MAX_COUNT","definitionDtoSchema","definitionListQuerySchema","definitionListResponseSchema","definitionResponseSchema","definitionSyncSummarySchema","definitionValidationErrorSchema","definitionValidationWarningSchema"],"mappings":"AAAA,SAEEA,0BAA0B,EAC1BC,uCAAuC,EACvCC,0CAA0C,EAC1CC,uCAAuC,EACvCC,kCAAkC,EAQlCC,mBAAmB,EACnBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,wBAAwB,EACxBC,2BAA2B,EAC3BC,+BAA+B,EAC/BC,iCAAiC,QAC5B,WAAW"}
1
+ {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n type CreateDefinitionBodyDto,\n createDefinitionBodySchema,\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 type DefinitionDto,\n type DefinitionListQueryDto,\n type DefinitionListResponseDto,\n type DefinitionResponseDto,\n type DefinitionSyncSummaryDto,\n type DefinitionValidationDiagnosticDto,\n type DefinitionValidationErrorDto,\n definitionDtoSchema,\n definitionListQuerySchema,\n definitionListResponseSchema,\n definitionResponseSchema,\n definitionSyncSummarySchema,\n definitionValidationDiagnosticSchema,\n definitionValidationErrorSchema,\n} from './dto.js';\nexport type {TriggerDto} from './trigger.js';\n"],"names":["createDefinitionBodySchema","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","definitionDtoSchema","definitionListQuerySchema","definitionListResponseSchema","definitionResponseSchema","definitionSyncSummarySchema","definitionValidationDiagnosticSchema","definitionValidationErrorSchema"],"mappings":"AAAA,SAEEA,0BAA0B,EAC1BC,+CAA+C,EAC/CC,qCAAqC,EACrCC,uCAAuC,EACvCC,0CAA0C,EAC1CC,uCAAuC,EAQvCC,mBAAmB,EACnBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,wBAAwB,EACxBC,2BAA2B,EAC3BC,oCAAoC,EACpCC,+BAA+B,QAC1B,WAAW"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const triggerDtoSchema: z.ZodObject<{
3
3
  source: z.ZodString;
4
- event: z.ZodString;
4
+ event: z.ZodOptional<z.ZodString>;
5
5
  with: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6
6
  filter: z.ZodOptional<z.ZodString>;
7
7
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export const triggerDtoSchema = z.object({
3
3
  source: z.string(),
4
- event: z.string(),
4
+ event: z.string().optional(),
5
5
  with: z.record(z.string(), z.unknown()).optional(),
6
6
  filter: z.string().optional(),
7
7
  config: z.record(z.string(), z.unknown()).optional()
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/trigger.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const triggerDtoSchema = z.object({\n source: z.string(),\n event: z.string(),\n with: z.record(z.string(), z.unknown()).optional(),\n filter: z.string().optional(),\n config: z.record(z.string(), z.unknown()).optional(),\n});\nexport type TriggerDto = z.infer<typeof triggerDtoSchema>;\n"],"names":["z","triggerDtoSchema","object","source","string","event","with","record","unknown","optional","filter","config"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,mBAAmBD,EAAEE,MAAM,CAAC;IACvCC,QAAQH,EAAEI,MAAM;IAChBC,OAAOL,EAAEI,MAAM;IACfE,MAAMN,EAAEO,MAAM,CAACP,EAAEI,MAAM,IAAIJ,EAAEQ,OAAO,IAAIC,QAAQ;IAChDC,QAAQV,EAAEI,MAAM,GAAGK,QAAQ;IAC3BE,QAAQX,EAAEO,MAAM,CAACP,EAAEI,MAAM,IAAIJ,EAAEQ,OAAO,IAAIC,QAAQ;AACpD,GAAG"}
1
+ {"version":3,"sources":["../../src/schemas/trigger.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const triggerDtoSchema = z.object({\n source: z.string(),\n event: z.string().optional(),\n with: z.record(z.string(), z.unknown()).optional(),\n filter: z.string().optional(),\n config: z.record(z.string(), z.unknown()).optional(),\n});\nexport type TriggerDto = z.infer<typeof triggerDtoSchema>;\n"],"names":["z","triggerDtoSchema","object","source","string","event","optional","with","record","unknown","filter","config"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,mBAAmBD,EAAEE,MAAM,CAAC;IACvCC,QAAQH,EAAEI,MAAM;IAChBC,OAAOL,EAAEI,MAAM,GAAGE,QAAQ;IAC1BC,MAAMP,EAAEQ,MAAM,CAACR,EAAEI,MAAM,IAAIJ,EAAES,OAAO,IAAIH,QAAQ;IAChDI,QAAQV,EAAEI,MAAM,GAAGE,QAAQ;IAC3BK,QAAQX,EAAEQ,MAAM,CAACR,EAAEI,MAAM,IAAIJ,EAAES,OAAO,IAAIH,QAAQ;AACpD,GAAG"}