@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.
Files changed (38) hide show
  1. package/README.md +34 -34
  2. package/dist/cli.js +545 -35
  3. package/dist/cli.js.map +1 -1
  4. package/dist/types.d.ts +17 -1
  5. package/dist/types.d.ts.map +1 -1
  6. package/dist/workflowValidator.d.ts +31 -0
  7. package/dist/workflowValidator.d.ts.map +1 -1
  8. package/dist/workflowValidator.js +299 -9
  9. package/dist/workflowValidator.js.map +1 -1
  10. package/package.json +2 -2
  11. package/schemas/schema.graphql +2077 -321
  12. package/schemas/workflows/flow/aggregation.json +44 -0
  13. package/schemas/workflows/flow/entity.json +110 -0
  14. package/schemas/workflows/flow/state.json +105 -0
  15. package/schemas/workflows/flow/transition.json +143 -0
  16. package/schemas/workflows/input.json +53 -7
  17. package/schemas/workflows/output.json +20 -0
  18. package/schemas/workflows/trigger.json +4 -0
  19. package/schemas/workflows/variable.json +2 -6
  20. package/schemas/workflows/workflow.json +179 -21
  21. package/scripts/postinstall.js +30 -1
  22. package/templates/module-configuration.yaml +110 -0
  23. package/templates/module-form.yaml +152 -0
  24. package/templates/module-grid.yaml +229 -0
  25. package/templates/module-select.yaml +139 -0
  26. package/templates/module.yaml +3 -3
  27. package/templates/workflow-api-tracking.yaml +189 -0
  28. package/templates/workflow-basic.yaml +76 -0
  29. package/templates/workflow-document.yaml +155 -0
  30. package/templates/workflow-entity-trigger.yaml +90 -0
  31. package/templates/workflow-ftp-edi.yaml +158 -0
  32. package/templates/workflow-ftp-tracking.yaml +161 -0
  33. package/templates/workflow-mcp-tool.yaml +112 -0
  34. package/templates/workflow-public-api.yaml +135 -0
  35. package/templates/workflow-scheduled.yaml +125 -0
  36. package/templates/workflow-utility.yaml +96 -0
  37. package/templates/workflow-webhook.yaml +128 -0
  38. 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-validate init
32
+ npx cx-cli init
33
33
 
34
34
  # Create a new module
35
- npx cx-validate create module orders
35
+ npx cx-cli create module orders
36
36
 
37
37
  # Create a new workflow
38
- npx cx-validate create workflow invoice-processor
38
+ npx cx-cli create workflow invoice-processor
39
39
 
40
40
  # Validate files
41
- npx cx-validate modules/*.yaml workflows/*.yaml
41
+ npx cx-cli modules/*.yaml workflows/*.yaml
42
42
 
43
43
  # Generate validation report
44
- npx cx-validate report modules/*.yaml --report report.html
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-validate [files...]
55
- cx-validate validate [files...]
54
+ cx-cli [files...]
55
+ cx-cli validate [files...]
56
56
 
57
57
  # Examples
58
- cx-validate modules/orders-module.yaml
59
- cx-validate modules/*.yaml workflows/*.yaml
60
- cx-validate --verbose modules/orders-module.yaml
61
- cx-validate --format json modules/orders-module.yaml
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-validate init
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-validate create <type> <name>
84
+ cx-cli create <type> <name>
85
85
 
86
86
  # Examples
87
- cx-validate create module orders
88
- cx-validate create workflow invoice-generator
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-validate report [files...] --report <output-file>
101
+ cx-cli report [files...] --report <output-file>
102
102
 
103
103
  # Examples
104
- cx-validate report modules/*.yaml --report report.html
105
- cx-validate report workflows/*.yaml --report report.md
106
- cx-validate report modules/*.yaml workflows/*.yaml --report results.json
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-validate schema <name>
119
+ cx-cli schema <name>
120
120
 
121
121
  # Examples
122
- cx-validate schema form
123
- cx-validate schema dataGrid
124
- cx-validate schema workflow
125
- cx-validate schema foreach
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-validate example <name>
133
+ cx-cli example <name>
134
134
 
135
135
  # Examples
136
- cx-validate example form
137
- cx-validate example workflow
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-validate list
146
- cx-validate list --type module
147
- cx-validate list --type workflow
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-validate --format compact modules/*.yaml workflows/*.yaml
301
+ npx cx-cli --format compact modules/*.yaml workflows/*.yaml
302
302
 
303
303
  - name: Generate validation report
304
304
  run: |
305
- npx cx-validate report modules/*.yaml workflows/*.yaml --report validation-report.html
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-validate --format json modules/*.yaml > validation-results.json
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-validate --format compact $staged_files
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