@cxtms/cx-schema 1.0.0 → 1.1.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.
- package/README.md +34 -34
- package/dist/cli.js +545 -35
- package/dist/cli.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/workflowValidator.d.ts +31 -0
- package/dist/workflowValidator.d.ts.map +1 -1
- package/dist/workflowValidator.js +299 -9
- package/dist/workflowValidator.js.map +1 -1
- package/package.json +2 -2
- package/schemas/schema.graphql +2077 -321
- package/schemas/workflows/flow/aggregation.json +44 -0
- package/schemas/workflows/flow/entity.json +110 -0
- package/schemas/workflows/flow/state.json +105 -0
- package/schemas/workflows/flow/transition.json +143 -0
- package/schemas/workflows/input.json +53 -7
- package/schemas/workflows/output.json +20 -0
- package/schemas/workflows/trigger.json +4 -0
- package/schemas/workflows/variable.json +2 -6
- package/schemas/workflows/workflow.json +179 -21
- package/scripts/postinstall.js +30 -1
- package/templates/module-configuration.yaml +110 -0
- package/templates/module-form.yaml +152 -0
- package/templates/module-grid.yaml +229 -0
- package/templates/module-select.yaml +139 -0
- package/templates/module.yaml +3 -3
- package/templates/workflow-api-tracking.yaml +189 -0
- package/templates/workflow-basic.yaml +76 -0
- package/templates/workflow-document.yaml +155 -0
- package/templates/workflow-entity-trigger.yaml +90 -0
- package/templates/workflow-ftp-edi.yaml +158 -0
- package/templates/workflow-ftp-tracking.yaml +161 -0
- package/templates/workflow-mcp-tool.yaml +112 -0
- package/templates/workflow-public-api.yaml +135 -0
- package/templates/workflow-scheduled.yaml +125 -0
- package/templates/workflow-utility.yaml +96 -0
- package/templates/workflow-webhook.yaml +128 -0
- package/templates/workflow.yaml +52 -12
package/README.md
CHANGED
|
@@ -29,19 +29,19 @@ npm install @cxtms/cx-schema
|
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
# Initialize a new project
|
|
32
|
-
npx cx-
|
|
32
|
+
npx cx-cli init
|
|
33
33
|
|
|
34
34
|
# Create a new module
|
|
35
|
-
npx cx-
|
|
35
|
+
npx cx-cli create module orders
|
|
36
36
|
|
|
37
37
|
# Create a new workflow
|
|
38
|
-
npx cx-
|
|
38
|
+
npx cx-cli create workflow invoice-processor
|
|
39
39
|
|
|
40
40
|
# Validate files
|
|
41
|
-
npx cx-
|
|
41
|
+
npx cx-cli modules/*.yaml workflows/*.yaml
|
|
42
42
|
|
|
43
43
|
# Generate validation report
|
|
44
|
-
npx cx-
|
|
44
|
+
npx cx-cli report modules/*.yaml --report report.html
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
## CLI Commands
|
|
@@ -51,14 +51,14 @@ npx cx-validate report modules/*.yaml --report report.html
|
|
|
51
51
|
Validate YAML file(s) against JSON Schema definitions.
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
cx-
|
|
55
|
-
cx-
|
|
54
|
+
cx-cli [files...]
|
|
55
|
+
cx-cli validate [files...]
|
|
56
56
|
|
|
57
57
|
# Examples
|
|
58
|
-
cx-
|
|
59
|
-
cx-
|
|
60
|
-
cx-
|
|
61
|
-
cx-
|
|
58
|
+
cx-cli modules/orders-module.yaml
|
|
59
|
+
cx-cli modules/*.yaml workflows/*.yaml
|
|
60
|
+
cx-cli --verbose modules/orders-module.yaml
|
|
61
|
+
cx-cli --format json modules/orders-module.yaml
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
### init
|
|
@@ -66,7 +66,7 @@ cx-validate --format json modules/orders-module.yaml
|
|
|
66
66
|
Initialize a new CX project with configuration files.
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
cx-
|
|
69
|
+
cx-cli init
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Creates:
|
|
@@ -81,11 +81,11 @@ Creates:
|
|
|
81
81
|
Create a new module or workflow from template.
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
cx-
|
|
84
|
+
cx-cli create <type> <name>
|
|
85
85
|
|
|
86
86
|
# Examples
|
|
87
|
-
cx-
|
|
88
|
-
cx-
|
|
87
|
+
cx-cli create module orders
|
|
88
|
+
cx-cli create workflow invoice-generator
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Generated files include:
|
|
@@ -98,12 +98,12 @@ Generated files include:
|
|
|
98
98
|
Generate validation report for multiple files.
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
|
-
cx-
|
|
101
|
+
cx-cli report [files...] --report <output-file>
|
|
102
102
|
|
|
103
103
|
# Examples
|
|
104
|
-
cx-
|
|
105
|
-
cx-
|
|
106
|
-
cx-
|
|
104
|
+
cx-cli report modules/*.yaml --report report.html
|
|
105
|
+
cx-cli report workflows/*.yaml --report report.md
|
|
106
|
+
cx-cli report modules/*.yaml workflows/*.yaml --report results.json
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Report formats (auto-detected from extension):
|
|
@@ -116,13 +116,13 @@ Report formats (auto-detected from extension):
|
|
|
116
116
|
Display the JSON Schema definition for a component or task.
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
|
-
cx-
|
|
119
|
+
cx-cli schema <name>
|
|
120
120
|
|
|
121
121
|
# Examples
|
|
122
|
-
cx-
|
|
123
|
-
cx-
|
|
124
|
-
cx-
|
|
125
|
-
cx-
|
|
122
|
+
cx-cli schema form
|
|
123
|
+
cx-cli schema dataGrid
|
|
124
|
+
cx-cli schema workflow
|
|
125
|
+
cx-cli schema foreach
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
### example
|
|
@@ -130,11 +130,11 @@ cx-validate schema foreach
|
|
|
130
130
|
Show example YAML for a component or task.
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
cx-
|
|
133
|
+
cx-cli example <name>
|
|
134
134
|
|
|
135
135
|
# Examples
|
|
136
|
-
cx-
|
|
137
|
-
cx-
|
|
136
|
+
cx-cli example form
|
|
137
|
+
cx-cli example workflow
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
### list
|
|
@@ -142,9 +142,9 @@ cx-validate example workflow
|
|
|
142
142
|
List all available schemas for validation.
|
|
143
143
|
|
|
144
144
|
```bash
|
|
145
|
-
cx-
|
|
146
|
-
cx-
|
|
147
|
-
cx-
|
|
145
|
+
cx-cli list
|
|
146
|
+
cx-cli list --type module
|
|
147
|
+
cx-cli list --type workflow
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
## CLI Options
|
|
@@ -298,11 +298,11 @@ Generated workflows include:
|
|
|
298
298
|
```yaml
|
|
299
299
|
- name: Validate YAML files
|
|
300
300
|
run: |
|
|
301
|
-
npx cx-
|
|
301
|
+
npx cx-cli --format compact modules/*.yaml workflows/*.yaml
|
|
302
302
|
|
|
303
303
|
- name: Generate validation report
|
|
304
304
|
run: |
|
|
305
|
-
npx cx-
|
|
305
|
+
npx cx-cli report modules/*.yaml workflows/*.yaml --report validation-report.html
|
|
306
306
|
|
|
307
307
|
- name: Upload report
|
|
308
308
|
uses: actions/upload-artifact@v3
|
|
@@ -316,7 +316,7 @@ Generated workflows include:
|
|
|
316
316
|
```yaml
|
|
317
317
|
validate:
|
|
318
318
|
script:
|
|
319
|
-
- npx cx-
|
|
319
|
+
- npx cx-cli --format json modules/*.yaml > validation-results.json
|
|
320
320
|
artifacts:
|
|
321
321
|
paths:
|
|
322
322
|
- validation-results.json
|
|
@@ -331,7 +331,7 @@ validate:
|
|
|
331
331
|
staged_files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(yaml|yml)$')
|
|
332
332
|
|
|
333
333
|
if [ -n "$staged_files" ]; then
|
|
334
|
-
npx cx-
|
|
334
|
+
npx cx-cli --format compact $staged_files
|
|
335
335
|
if [ $? -ne 0 ]; then
|
|
336
336
|
echo "Validation failed. Please fix errors before committing."
|
|
337
337
|
exit 1
|