cxtms 1.9.13

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 (215) hide show
  1. package/README.md +384 -0
  2. package/dist/cli.d.ts +6 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +4784 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/extractUtils.d.ts +11 -0
  7. package/dist/extractUtils.d.ts.map +1 -0
  8. package/dist/extractUtils.js +19 -0
  9. package/dist/extractUtils.js.map +1 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +11 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/types.d.ts +129 -0
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +6 -0
  17. package/dist/types.js.map +1 -0
  18. package/dist/utils/schemaLoader.d.ts +17 -0
  19. package/dist/utils/schemaLoader.d.ts.map +1 -0
  20. package/dist/utils/schemaLoader.js +134 -0
  21. package/dist/utils/schemaLoader.js.map +1 -0
  22. package/dist/validator.d.ts +72 -0
  23. package/dist/validator.d.ts.map +1 -0
  24. package/dist/validator.js +432 -0
  25. package/dist/validator.js.map +1 -0
  26. package/dist/workflowValidator.d.ts +103 -0
  27. package/dist/workflowValidator.d.ts.map +1 -0
  28. package/dist/workflowValidator.js +753 -0
  29. package/dist/workflowValidator.js.map +1 -0
  30. package/package.json +51 -0
  31. package/schemas/actions/all.json +27 -0
  32. package/schemas/actions/clipboard.json +46 -0
  33. package/schemas/actions/confirm.json +21 -0
  34. package/schemas/actions/consoleLog.json +16 -0
  35. package/schemas/actions/dialog.json +25 -0
  36. package/schemas/actions/fileDownload.json +16 -0
  37. package/schemas/actions/forEach.json +31 -0
  38. package/schemas/actions/if.json +12 -0
  39. package/schemas/actions/mutation.json +25 -0
  40. package/schemas/actions/navigate.json +18 -0
  41. package/schemas/actions/navigateBack.json +22 -0
  42. package/schemas/actions/navigateBackOrClose.json +21 -0
  43. package/schemas/actions/notification.json +19 -0
  44. package/schemas/actions/openBarcodeScanner.json +104 -0
  45. package/schemas/actions/query.json +32 -0
  46. package/schemas/actions/refresh.json +13 -0
  47. package/schemas/actions/resetDirtyState.json +22 -0
  48. package/schemas/actions/setFields.json +21 -0
  49. package/schemas/actions/setStore.json +13 -0
  50. package/schemas/actions/validateForm.json +15 -0
  51. package/schemas/actions/workflow.json +24 -0
  52. package/schemas/components/README.md +147 -0
  53. package/schemas/components/appComponent.json +58 -0
  54. package/schemas/components/barcodeScanner.json +69 -0
  55. package/schemas/components/button.json +123 -0
  56. package/schemas/components/calendar.json +489 -0
  57. package/schemas/components/card.json +176 -0
  58. package/schemas/components/collection.json +54 -0
  59. package/schemas/components/dataGrid.json +119 -0
  60. package/schemas/components/datasource.json +151 -0
  61. package/schemas/components/dropdown.json +57 -0
  62. package/schemas/components/field-collection.json +618 -0
  63. package/schemas/components/field.json +265 -0
  64. package/schemas/components/form.json +234 -0
  65. package/schemas/components/index.json +71 -0
  66. package/schemas/components/layout.json +69 -0
  67. package/schemas/components/module.json +167 -0
  68. package/schemas/components/navDropdown.json +36 -0
  69. package/schemas/components/navbar.json +78 -0
  70. package/schemas/components/navbarItem.json +28 -0
  71. package/schemas/components/navbarLink.json +36 -0
  72. package/schemas/components/row.json +31 -0
  73. package/schemas/components/slot.json +30 -0
  74. package/schemas/components/tab.json +34 -0
  75. package/schemas/components/tabs.json +35 -0
  76. package/schemas/components/timeline.json +172 -0
  77. package/schemas/components/timelineGrid.json +328 -0
  78. package/schemas/fields/README.md +66 -0
  79. package/schemas/fields/attachment.json +156 -0
  80. package/schemas/fields/autocomplete-googleplaces.json +130 -0
  81. package/schemas/fields/checkbox.json +82 -0
  82. package/schemas/fields/date.json +88 -0
  83. package/schemas/fields/datetime.json +75 -0
  84. package/schemas/fields/email.json +75 -0
  85. package/schemas/fields/index.json +53 -0
  86. package/schemas/fields/number.json +91 -0
  87. package/schemas/fields/password.json +70 -0
  88. package/schemas/fields/radio.json +94 -0
  89. package/schemas/fields/rangedatetime.json +56 -0
  90. package/schemas/fields/select-async.json +334 -0
  91. package/schemas/fields/select.json +115 -0
  92. package/schemas/fields/tel.json +79 -0
  93. package/schemas/fields/text.json +86 -0
  94. package/schemas/fields/textarea.json +95 -0
  95. package/schemas/fields/time.json +91 -0
  96. package/schemas/fields/url.json +74 -0
  97. package/schemas/schema.graphql +12248 -0
  98. package/schemas/schemas.json +610 -0
  99. package/schemas/workflows/activity.json +96 -0
  100. package/schemas/workflows/common/condition.json +48 -0
  101. package/schemas/workflows/common/expression.json +76 -0
  102. package/schemas/workflows/common/mapping.json +173 -0
  103. package/schemas/workflows/common/step.json +38 -0
  104. package/schemas/workflows/flow/aggregation.json +44 -0
  105. package/schemas/workflows/flow/entity.json +129 -0
  106. package/schemas/workflows/flow/state.json +105 -0
  107. package/schemas/workflows/flow/transition.json +143 -0
  108. package/schemas/workflows/input.json +122 -0
  109. package/schemas/workflows/output.json +61 -0
  110. package/schemas/workflows/schedule.json +26 -0
  111. package/schemas/workflows/tasks/accounting-transaction.json +95 -0
  112. package/schemas/workflows/tasks/action-event.json +65 -0
  113. package/schemas/workflows/tasks/all.json +152 -0
  114. package/schemas/workflows/tasks/appmodule.json +56 -0
  115. package/schemas/workflows/tasks/attachment.json +97 -0
  116. package/schemas/workflows/tasks/authentication.json +86 -0
  117. package/schemas/workflows/tasks/caching.json +68 -0
  118. package/schemas/workflows/tasks/charge.json +92 -0
  119. package/schemas/workflows/tasks/commodity.json +92 -0
  120. package/schemas/workflows/tasks/contact-address.json +72 -0
  121. package/schemas/workflows/tasks/contact-payment-method.json +72 -0
  122. package/schemas/workflows/tasks/contact.json +82 -0
  123. package/schemas/workflows/tasks/csv.json +81 -0
  124. package/schemas/workflows/tasks/document-render.json +105 -0
  125. package/schemas/workflows/tasks/document-send.json +84 -0
  126. package/schemas/workflows/tasks/edi.json +157 -0
  127. package/schemas/workflows/tasks/email-send.json +110 -0
  128. package/schemas/workflows/tasks/error.json +72 -0
  129. package/schemas/workflows/tasks/export.json +90 -0
  130. package/schemas/workflows/tasks/filetransfer.json +102 -0
  131. package/schemas/workflows/tasks/flow-transition.json +68 -0
  132. package/schemas/workflows/tasks/foreach.json +69 -0
  133. package/schemas/workflows/tasks/generic.json +47 -0
  134. package/schemas/workflows/tasks/graphql.json +78 -0
  135. package/schemas/workflows/tasks/httpRequest.json +161 -0
  136. package/schemas/workflows/tasks/import.json +64 -0
  137. package/schemas/workflows/tasks/inventory.json +67 -0
  138. package/schemas/workflows/tasks/job.json +88 -0
  139. package/schemas/workflows/tasks/log.json +73 -0
  140. package/schemas/workflows/tasks/map.json +58 -0
  141. package/schemas/workflows/tasks/movement.json +54 -0
  142. package/schemas/workflows/tasks/note.json +59 -0
  143. package/schemas/workflows/tasks/number.json +65 -0
  144. package/schemas/workflows/tasks/order-tracking-event.json +109 -0
  145. package/schemas/workflows/tasks/order.json +139 -0
  146. package/schemas/workflows/tasks/payment.json +85 -0
  147. package/schemas/workflows/tasks/pdf-document.json +60 -0
  148. package/schemas/workflows/tasks/postal-codes.json +92 -0
  149. package/schemas/workflows/tasks/resolve-timezone.json +65 -0
  150. package/schemas/workflows/tasks/setVariable.json +76 -0
  151. package/schemas/workflows/tasks/switch.json +75 -0
  152. package/schemas/workflows/tasks/template.json +73 -0
  153. package/schemas/workflows/tasks/tracking-event.json +137 -0
  154. package/schemas/workflows/tasks/transmission.json +185 -0
  155. package/schemas/workflows/tasks/unzip-file.json +68 -0
  156. package/schemas/workflows/tasks/user.json +70 -0
  157. package/schemas/workflows/tasks/validation.json +99 -0
  158. package/schemas/workflows/tasks/while.json +53 -0
  159. package/schemas/workflows/tasks/workflow-execute.json +82 -0
  160. package/schemas/workflows/trigger.json +90 -0
  161. package/schemas/workflows/variable.json +46 -0
  162. package/schemas/workflows/workflow.json +335 -0
  163. package/scripts/postinstall.js +291 -0
  164. package/scripts/setup-vscode.js +80 -0
  165. package/skills/cxtms-developer/SKILL.md +118 -0
  166. package/skills/cxtms-developer/ref-cli-auth.md +120 -0
  167. package/skills/cxtms-developer/ref-entity-accounting.md +180 -0
  168. package/skills/cxtms-developer/ref-entity-commodity.md +239 -0
  169. package/skills/cxtms-developer/ref-entity-contact.md +163 -0
  170. package/skills/cxtms-developer/ref-entity-geography.md +154 -0
  171. package/skills/cxtms-developer/ref-entity-job.md +77 -0
  172. package/skills/cxtms-developer/ref-entity-notification.md +85 -0
  173. package/skills/cxtms-developer/ref-entity-order-sub.md +160 -0
  174. package/skills/cxtms-developer/ref-entity-order.md +183 -0
  175. package/skills/cxtms-developer/ref-entity-organization.md +41 -0
  176. package/skills/cxtms-developer/ref-entity-rate.md +182 -0
  177. package/skills/cxtms-developer/ref-entity-shared.md +176 -0
  178. package/skills/cxtms-developer/ref-entity-warehouse.md +115 -0
  179. package/skills/cxtms-developer/ref-graphql-query.md +309 -0
  180. package/skills/cxtms-module-builder/SKILL.md +477 -0
  181. package/skills/cxtms-module-builder/ref-components-data.md +293 -0
  182. package/skills/cxtms-module-builder/ref-components-display.md +411 -0
  183. package/skills/cxtms-module-builder/ref-components-forms.md +369 -0
  184. package/skills/cxtms-module-builder/ref-components-interactive.md +317 -0
  185. package/skills/cxtms-module-builder/ref-components-layout.md +390 -0
  186. package/skills/cxtms-module-builder/ref-components-specialized.md +477 -0
  187. package/skills/cxtms-workflow-builder/SKILL.md +438 -0
  188. package/skills/cxtms-workflow-builder/ref-accounting.md +66 -0
  189. package/skills/cxtms-workflow-builder/ref-communication.md +169 -0
  190. package/skills/cxtms-workflow-builder/ref-entity.md +342 -0
  191. package/skills/cxtms-workflow-builder/ref-expressions-ncalc.md +128 -0
  192. package/skills/cxtms-workflow-builder/ref-expressions-template.md +161 -0
  193. package/skills/cxtms-workflow-builder/ref-filetransfer.md +80 -0
  194. package/skills/cxtms-workflow-builder/ref-flow.md +210 -0
  195. package/skills/cxtms-workflow-builder/ref-other.md +157 -0
  196. package/skills/cxtms-workflow-builder/ref-query.md +105 -0
  197. package/skills/cxtms-workflow-builder/ref-utilities.md +417 -0
  198. package/templates/module-configuration.yaml +44 -0
  199. package/templates/module-form.yaml +152 -0
  200. package/templates/module-grid.yaml +229 -0
  201. package/templates/module-select.yaml +139 -0
  202. package/templates/module.yaml +84 -0
  203. package/templates/workflow-api-tracking.yaml +189 -0
  204. package/templates/workflow-basic.yaml +76 -0
  205. package/templates/workflow-document.yaml +155 -0
  206. package/templates/workflow-entity-trigger.yaml +90 -0
  207. package/templates/workflow-ftp-edi.yaml +158 -0
  208. package/templates/workflow-ftp-tracking.yaml +161 -0
  209. package/templates/workflow-mcp-tool.yaml +112 -0
  210. package/templates/workflow-public-api.yaml +135 -0
  211. package/templates/workflow-scheduled-execute.yaml +75 -0
  212. package/templates/workflow-scheduled.yaml +125 -0
  213. package/templates/workflow-utility.yaml +96 -0
  214. package/templates/workflow-webhook.yaml +128 -0
  215. package/templates/workflow.yaml +140 -0
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Workflow Execute Task",
4
+ "description": "Execute another workflow",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": ["Workflow/Execute@1"],
10
+ "description": "Task type identifier"
11
+ },
12
+ "name": {
13
+ "type": "string",
14
+ "description": "Step name identifier"
15
+ },
16
+ "description": {
17
+ "type": "string",
18
+ "description": "Step description"
19
+ },
20
+ "conditions": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "properties": {
25
+ "expression": {
26
+ "type": "string"
27
+ }
28
+ },
29
+ "required": ["expression"]
30
+ }
31
+ },
32
+ "continueOnError": {
33
+ "type": "boolean"
34
+ },
35
+ "inputs": {
36
+ "type": "object",
37
+ "description": "Workflow execution inputs",
38
+ "properties": {
39
+ "workflowId": {
40
+ "type": "string",
41
+ "format": "uuid",
42
+ "description": "ID of workflow to execute"
43
+ },
44
+ "workflowName": {
45
+ "type": "string",
46
+ "description": "Name of workflow to execute (alternative to workflowId)"
47
+ },
48
+ "workflowInputs": {
49
+ "type": "object",
50
+ "description": "Inputs to pass to the child workflow",
51
+ "additionalProperties": true
52
+ },
53
+ "async": {
54
+ "type": "boolean",
55
+ "description": "Execute asynchronously"
56
+ },
57
+ "timeout": {
58
+ "type": "integer",
59
+ "description": "Execution timeout in milliseconds"
60
+ }
61
+ },
62
+ "additionalProperties": true
63
+ },
64
+ "outputs": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object",
68
+ "properties": {
69
+ "name": {
70
+ "type": "string"
71
+ },
72
+ "mapping": {
73
+ "type": "string"
74
+ }
75
+ },
76
+ "required": ["name", "mapping"]
77
+ }
78
+ }
79
+ },
80
+ "required": ["task"],
81
+ "additionalProperties": true
82
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Workflow Trigger",
4
+ "description": "Definition of a workflow trigger",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "Trigger name identifier"
10
+ },
11
+ "type": {
12
+ "type": "string",
13
+ "enum": ["Manual", "Entity"],
14
+ "description": "Trigger type"
15
+ },
16
+ "displayName": {
17
+ "type": "string",
18
+ "description": "Display name for manual triggers (button text)"
19
+ },
20
+ "entityName": {
21
+ "type": "string",
22
+ "description": "Entity name for the trigger context"
23
+ },
24
+ "eventType": {
25
+ "type": "string",
26
+ "enum": ["Added", "Modified", "Deleted"],
27
+ "description": "Entity event type (for Entity triggers)"
28
+ },
29
+ "position": {
30
+ "type": "string",
31
+ "enum": ["Before", "After"],
32
+ "description": "When to execute relative to entity operation"
33
+ },
34
+ "conditions": {
35
+ "oneOf": [
36
+ {
37
+ "type": "string",
38
+ "description": "Single condition expression"
39
+ },
40
+ {
41
+ "type": "array",
42
+ "items": {
43
+ "oneOf": [
44
+ {
45
+ "type": "string"
46
+ },
47
+ {
48
+ "type": "object",
49
+ "properties": {
50
+ "expression": {
51
+ "type": "string"
52
+ }
53
+ },
54
+ "required": ["expression"]
55
+ }
56
+ ]
57
+ },
58
+ "description": "Array of condition expressions"
59
+ }
60
+ ],
61
+ "description": "Conditions for trigger activation"
62
+ },
63
+ "additionalProperties": {
64
+ "type": "object",
65
+ "description": "Additional trigger properties",
66
+ "properties": {
67
+ "silent": {
68
+ "type": "boolean"
69
+ }
70
+ },
71
+ "additionalProperties": true
72
+ }
73
+ },
74
+ "allOf": [
75
+ {
76
+ "if": {
77
+ "properties": {
78
+ "type": {
79
+ "const": "Entity"
80
+ }
81
+ },
82
+ "required": ["type"]
83
+ },
84
+ "then": {
85
+ "required": ["entityName", "eventType"]
86
+ }
87
+ }
88
+ ],
89
+ "additionalProperties": true
90
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Workflow Variable",
4
+ "description": "Definition of a workflow variable. Valid properties: name, value, fromConfig, expression.",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
10
+ "description": "Variable name"
11
+ },
12
+ "value": {
13
+ "description": "Static variable value or template expression"
14
+ },
15
+ "expression": {
16
+ "type": "string",
17
+ "description": "NCalc expression to evaluate at runtime. Has access to all previously resolved variables. Mutually exclusive with value and fromConfig."
18
+ },
19
+ "fromConfig": {
20
+ "oneOf": [
21
+ {
22
+ "type": "string",
23
+ "description": "Configuration key to load value from"
24
+ },
25
+ {
26
+ "type": "object",
27
+ "properties": {
28
+ "configName": {
29
+ "type": "string",
30
+ "description": "Configuration name (e.g., 'apps.novaposhta')"
31
+ },
32
+ "key": {
33
+ "type": "string",
34
+ "description": "Optional key within configuration"
35
+ }
36
+ },
37
+ "required": ["configName"],
38
+ "additionalProperties": true
39
+ }
40
+ ],
41
+ "description": "Load value from configuration"
42
+ }
43
+ },
44
+ "required": ["name"],
45
+ "additionalProperties": false
46
+ }
@@ -0,0 +1,335 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "CargoXplorer Workflow",
4
+ "description": "Schema for CargoXplorer workflow YAML files. Supports standard task-based workflows and Flow (state machine) workflows.",
5
+ "type": "object",
6
+ "properties": {
7
+ "workflow": {
8
+ "type": "object",
9
+ "description": "Workflow metadata and configuration",
10
+ "properties": {
11
+ "workflowId": {
12
+ "type": "string",
13
+ "format": "uuid",
14
+ "description": "Unique workflow identifier (UUID)"
15
+ },
16
+ "name": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "description": "Workflow name"
20
+ },
21
+ "description": {
22
+ "type": "string",
23
+ "description": "Workflow description"
24
+ },
25
+ "version": {
26
+ "type": "string",
27
+ "description": "Workflow version (e.g., '1.0')"
28
+ },
29
+ "executionMode": {
30
+ "type": "string",
31
+ "enum": ["Sync", "Async"],
32
+ "description": "Execution mode - synchronous or asynchronous"
33
+ },
34
+ "logLevel": {
35
+ "type": "string",
36
+ "enum": ["None", "Trace", "Debug", "Information", "Warning", "Error"],
37
+ "description": "Logging level for workflow execution"
38
+ },
39
+ "isActive": {
40
+ "type": "boolean",
41
+ "description": "Whether the workflow is active"
42
+ },
43
+ "enableAudit": {
44
+ "type": "boolean",
45
+ "description": "Enable audit logging"
46
+ },
47
+ "enableTransaction": {
48
+ "type": "boolean",
49
+ "description": "Enable transaction support"
50
+ },
51
+ "enableActionEvents": {
52
+ "type": "boolean",
53
+ "description": "Enable action events (deprecated)"
54
+ },
55
+ "priority": {
56
+ "type": "integer",
57
+ "minimum": 0,
58
+ "maximum": 100,
59
+ "description": "Workflow priority (0-100, higher = higher priority, default: 50)"
60
+ },
61
+ "tags": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string"
65
+ },
66
+ "description": "Tags for categorization and filtering"
67
+ },
68
+ "workflowType": {
69
+ "type": "string",
70
+ "enum": ["Document", "Quote", "Flow", "Webhook", "PublicApi"],
71
+ "description": "Workflow type: Document (PDF/Excel generation), Quote, Flow (declarative state machine), Webhook (HTTP endpoint), or PublicApi (REST API endpoint). Omit for standard process workflows."
72
+ },
73
+ "runAs": {
74
+ "type": "string",
75
+ "description": "Username or user ID for workflow execution context"
76
+ },
77
+ "concurrency": {
78
+ "type": "object",
79
+ "properties": {
80
+ "enabled": {
81
+ "type": "boolean",
82
+ "default": true,
83
+ "description": "Whether concurrency control is active"
84
+ },
85
+ "group": {
86
+ "type": "string",
87
+ "description": "Concurrency group identifier"
88
+ },
89
+ "waitTime": {
90
+ "type": "number",
91
+ "default": 15,
92
+ "description": "Seconds to wait for lock (default: 15)"
93
+ }
94
+ },
95
+ "additionalProperties": true
96
+ },
97
+ "filePath": {
98
+ "type": "string",
99
+ "description": "Repository file path under workflows/ or features/{name}/workflows/"
100
+ },
101
+ "agentInstruction": {
102
+ "type": "string",
103
+ "description": "AI agent instruction describing how to use this workflow, expected inputs, and returned outputs"
104
+ },
105
+ "actionEvent": {
106
+ "type": "object",
107
+ "description": "Workflow action event configuration",
108
+ "additionalProperties": true
109
+ },
110
+ "additionalProperties": {
111
+ "type": "object",
112
+ "description": "Custom additional properties",
113
+ "additionalProperties": true
114
+ }
115
+ },
116
+ "required": ["workflowId", "name"],
117
+ "additionalProperties": true
118
+ },
119
+ "inputs": {
120
+ "type": ["array", "null"],
121
+ "description": "Workflow input parameters",
122
+ "items": {
123
+ "$ref": "input.json"
124
+ }
125
+ },
126
+ "outputs": {
127
+ "type": ["array", "null"],
128
+ "description": "Workflow output definitions",
129
+ "items": {
130
+ "$ref": "output.json"
131
+ }
132
+ },
133
+ "variables": {
134
+ "type": ["array", "null"],
135
+ "description": "Workflow variables",
136
+ "items": {
137
+ "$ref": "variable.json"
138
+ }
139
+ },
140
+ "activities": {
141
+ "type": "array",
142
+ "description": "Workflow activities containing steps (required for standard workflows, not used in Flow workflows)",
143
+ "items": {
144
+ "$ref": "activity.json"
145
+ },
146
+ "minItems": 1
147
+ },
148
+ "triggers": {
149
+ "type": "array",
150
+ "description": "Workflow triggers",
151
+ "items": {
152
+ "$ref": "trigger.json"
153
+ }
154
+ },
155
+ "schedules": {
156
+ "type": "array",
157
+ "description": "Scheduled execution configurations",
158
+ "items": {
159
+ "$ref": "schedule.json"
160
+ }
161
+ },
162
+ "events": {
163
+ "oneOf": [
164
+ {
165
+ "type": "object",
166
+ "description": "Workflow-level event handlers as object",
167
+ "properties": {
168
+ "onWorkflowStarted": {
169
+ "type": "array",
170
+ "description": "Steps to execute when workflow starts",
171
+ "items": { "$ref": "common/step.json" }
172
+ },
173
+ "onWorkflowCompleted": {
174
+ "type": "array",
175
+ "description": "Steps to execute when workflow completes",
176
+ "items": { "$ref": "common/step.json" }
177
+ },
178
+ "onWorkflowExecuted": {
179
+ "type": "array",
180
+ "description": "Alias for onWorkflowCompleted (deprecated, use onWorkflowCompleted)",
181
+ "items": { "$ref": "common/step.json" }
182
+ },
183
+ "onWorkflowFailed": {
184
+ "type": "array",
185
+ "description": "Steps to execute when workflow fails",
186
+ "items": { "$ref": "common/step.json" }
187
+ }
188
+ },
189
+ "additionalProperties": false
190
+ },
191
+ {
192
+ "type": "array",
193
+ "description": "Workflow-level event handlers as array",
194
+ "items": {
195
+ "type": "object",
196
+ "properties": {
197
+ "type": {
198
+ "type": "string",
199
+ "description": "Event type"
200
+ },
201
+ "steps": {
202
+ "type": "array",
203
+ "description": "Steps to execute for this event",
204
+ "items": { "$ref": "common/step.json" }
205
+ }
206
+ },
207
+ "additionalProperties": true
208
+ }
209
+ }
210
+ ]
211
+ },
212
+ "api": {
213
+ "type": "object",
214
+ "description": "Public API endpoint configuration (required for PublicApi workflows)",
215
+ "properties": {
216
+ "path": {
217
+ "type": "string",
218
+ "description": "API route path with parameter placeholders (e.g., '/orders/{orderId}')"
219
+ },
220
+ "method": {
221
+ "type": "string",
222
+ "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
223
+ "description": "HTTP method"
224
+ },
225
+ "summary": {
226
+ "type": "string",
227
+ "description": "Short summary for Swagger/OpenAPI documentation"
228
+ },
229
+ "description": {
230
+ "type": "string",
231
+ "description": "Detailed description for Swagger/OpenAPI documentation"
232
+ },
233
+ "operationId": {
234
+ "type": "string",
235
+ "description": "Unique operation ID for OpenAPI (auto-generated if omitted)"
236
+ },
237
+ "document": {
238
+ "type": "string",
239
+ "description": "Swagger document name (default: 'public')"
240
+ },
241
+ "category": {
242
+ "type": "string",
243
+ "description": "Swagger tag/group for organizing endpoints"
244
+ },
245
+ "authentication": {
246
+ "type": "string",
247
+ "enum": ["none", "bearer", "apiKey"],
248
+ "description": "Authentication method: none (anonymous), bearer (JWT token), or apiKey"
249
+ },
250
+ "rateLimit": {
251
+ "type": "object",
252
+ "description": "Rate limiting configuration",
253
+ "properties": {
254
+ "perSecond": {
255
+ "type": "integer",
256
+ "description": "Maximum requests per second"
257
+ },
258
+ "perMinute": {
259
+ "type": "integer",
260
+ "description": "Maximum requests per minute"
261
+ }
262
+ },
263
+ "additionalProperties": false
264
+ }
265
+ },
266
+ "required": ["path", "method"],
267
+ "additionalProperties": true
268
+ },
269
+ "entity": {
270
+ "$ref": "flow/entity.json",
271
+ "description": "Entity configuration for Flow workflows"
272
+ },
273
+ "states": {
274
+ "type": "array",
275
+ "description": "State definitions for Flow workflows",
276
+ "items": {
277
+ "$ref": "flow/state.json"
278
+ }
279
+ },
280
+ "transitions": {
281
+ "type": "array",
282
+ "description": "Transition definitions for Flow workflows",
283
+ "items": {
284
+ "$ref": "flow/transition.json"
285
+ }
286
+ },
287
+ "aggregations": {
288
+ "type": "array",
289
+ "description": "Aggregation definitions for Flow workflows",
290
+ "items": {
291
+ "$ref": "flow/aggregation.json"
292
+ }
293
+ }
294
+ },
295
+ "required": ["workflow"],
296
+ "allOf": [
297
+ {
298
+ "if": {
299
+ "properties": {
300
+ "workflow": {
301
+ "properties": {
302
+ "workflowType": { "const": "Flow" }
303
+ },
304
+ "required": ["workflowType"]
305
+ }
306
+ }
307
+ },
308
+ "then": {
309
+ "required": ["workflow", "entity"],
310
+ "properties": {
311
+ "activities": false
312
+ }
313
+ },
314
+ "else": {
315
+ "required": ["workflow", "activities"]
316
+ }
317
+ },
318
+ {
319
+ "if": {
320
+ "properties": {
321
+ "workflow": {
322
+ "properties": {
323
+ "workflowType": { "const": "PublicApi" }
324
+ },
325
+ "required": ["workflowType"]
326
+ }
327
+ }
328
+ },
329
+ "then": {
330
+ "required": ["workflow", "activities", "api"]
331
+ }
332
+ }
333
+ ],
334
+ "additionalProperties": true
335
+ }