@cxtms/cx-schema 1.6.7 → 1.7.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/.claude/skills/cx-core/SKILL.md +15 -15
- package/.claude/skills/cx-module/SKILL.md +32 -32
- package/.claude/skills/cx-workflow/SKILL.md +33 -33
- package/README.md +34 -34
- package/dist/cli.js +108 -66
- package/dist/cli.js.map +1 -1
- package/package.json +3 -2
- package/scripts/postinstall.js +1 -1
- package/templates/module-configuration.yaml +1 -1
- package/templates/module-form.yaml +1 -1
- package/templates/module-grid.yaml +1 -1
- package/templates/module-select.yaml +1 -1
- package/templates/module.yaml +1 -1
- package/templates/workflow-api-tracking.yaml +1 -1
- package/templates/workflow-basic.yaml +1 -1
- package/templates/workflow-document.yaml +1 -1
- package/templates/workflow-entity-trigger.yaml +1 -1
- package/templates/workflow-ftp-edi.yaml +1 -1
- package/templates/workflow-ftp-tracking.yaml +1 -1
- package/templates/workflow-mcp-tool.yaml +1 -1
- package/templates/workflow-public-api.yaml +1 -1
- package/templates/workflow-scheduled.yaml +1 -1
- package/templates/workflow-utility.yaml +1 -1
- package/templates/workflow-webhook.yaml +1 -1
- package/templates/workflow.yaml +1 -1
|
@@ -14,10 +14,10 @@ The CLI can authenticate against CX environments and manage server resources. Au
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# Login to a CX environment (OAuth2 + PKCE — opens browser)
|
|
17
|
-
npx
|
|
17
|
+
npx cxtms login https://tms-v3-dev.usatrt.com
|
|
18
18
|
|
|
19
19
|
# Logout from current session
|
|
20
|
-
npx
|
|
20
|
+
npx cxtms logout
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
The session is stored at `~/.cxtms/<project-dir>/.session.json`, scoped by project directory name. Each project gets its own server session. The CLI auto-refreshes expired tokens.
|
|
@@ -28,16 +28,16 @@ For CI/CD or headless environments, use Personal Access Tokens instead of intera
|
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
# Check PAT status and setup instructions
|
|
31
|
-
npx
|
|
31
|
+
npx cxtms pat setup
|
|
32
32
|
|
|
33
33
|
# Create a new PAT token (requires OAuth login first)
|
|
34
|
-
npx
|
|
34
|
+
npx cxtms pat create "my-ci-token"
|
|
35
35
|
|
|
36
36
|
# List active PAT tokens
|
|
37
|
-
npx
|
|
37
|
+
npx cxtms pat list
|
|
38
38
|
|
|
39
39
|
# Revoke a PAT token
|
|
40
|
-
npx
|
|
40
|
+
npx cxtms pat revoke <tokenId>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
After creating a PAT, add to `.env` in your project root:
|
|
@@ -52,16 +52,16 @@ When `CXTMS_AUTH` is set, the CLI skips OAuth and uses the PAT token directly. `
|
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
# List organizations on the server
|
|
55
|
-
npx
|
|
55
|
+
npx cxtms orgs list
|
|
56
56
|
|
|
57
57
|
# Select an organization interactively
|
|
58
|
-
npx
|
|
58
|
+
npx cxtms orgs select
|
|
59
59
|
|
|
60
60
|
# Set active organization by ID
|
|
61
|
-
npx
|
|
61
|
+
npx cxtms orgs use <orgId>
|
|
62
62
|
|
|
63
63
|
# Show current context (server, org, app)
|
|
64
|
-
npx
|
|
64
|
+
npx cxtms orgs use
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
The active org is cached in the session file and used by all server commands. Override with `--org <id>`.
|
|
@@ -77,14 +77,14 @@ Server commands resolve the target session in this order:
|
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
79
|
# Publish all modules and workflows from current project
|
|
80
|
-
npx
|
|
80
|
+
npx cxtms publish
|
|
81
81
|
|
|
82
82
|
# Publish only a specific feature directory
|
|
83
|
-
npx
|
|
84
|
-
npx
|
|
83
|
+
npx cxtms publish --feature billing
|
|
84
|
+
npx cxtms publish billing
|
|
85
85
|
|
|
86
86
|
# Publish with explicit org ID
|
|
87
|
-
npx
|
|
87
|
+
npx cxtms publish --org 42
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
Validates all YAML files first, then pushes modules and workflows to the server. Skips files with validation errors and reports results.
|
|
@@ -106,7 +106,7 @@ When creating new modules or workflows, always place them under the correct feat
|
|
|
106
106
|
- `features/<feature_name>/modules/<name>-module.yaml`
|
|
107
107
|
- `features/<feature_name>/workflows/<name>.yaml`
|
|
108
108
|
|
|
109
|
-
Use `--feature <feature_name>` with `
|
|
109
|
+
Use `--feature <feature_name>` with `cxtms create` to automatically place files in the correct location.
|
|
110
110
|
|
|
111
111
|
## Entity Field Reference
|
|
112
112
|
|
|
@@ -6,28 +6,28 @@ argument-hint: <description of what to build>
|
|
|
6
6
|
|
|
7
7
|
You are a CargoXplorer module YAML builder. You generate schema-valid YAML for CX app modules — UI screens, forms, data grids, routes, and components. All output must conform to the JSON schemas in `.cx-schema/`.
|
|
8
8
|
|
|
9
|
-
**IMPORTANT — use `
|
|
10
|
-
- **Scaffold**: `npx
|
|
11
|
-
- **Scaffold with fields**: `npx
|
|
12
|
-
- **Validate**: `npx
|
|
13
|
-
- **Schema lookup**: `npx
|
|
14
|
-
- **Examples**: `npx
|
|
15
|
-
- **List schemas**: `npx
|
|
16
|
-
- **Extract**: `npx
|
|
17
|
-
- **Feature folder**: `npx
|
|
18
|
-
- **Deploy to server**: `npx
|
|
19
|
-
- **Undeploy from server**: `npx
|
|
20
|
-
- **Publish all**: `npx
|
|
9
|
+
**IMPORTANT — use `cxtms` for all module operations:**
|
|
10
|
+
- **Scaffold**: `npx cxtms create module <name> --template <template>` — generates a schema-valid YAML file. ALWAYS run this first, then read the generated file, then customize. Do NOT write YAML from scratch or copy templates manually.
|
|
11
|
+
- **Scaffold with fields**: `npx cxtms create module <name> --template <template> --options '<json>'`
|
|
12
|
+
- **Validate**: `npx cxtms <file.yaml>` — run after every change
|
|
13
|
+
- **Schema lookup**: `npx cxtms schema <component>` — e.g., `cxtms schema form`, `cxtms schema dataGrid`
|
|
14
|
+
- **Examples**: `npx cxtms example <component>` — show example YAML
|
|
15
|
+
- **List schemas**: `npx cxtms list`
|
|
16
|
+
- **Extract**: `npx cxtms extract <source> <component> --to <target>` — move components between modules
|
|
17
|
+
- **Feature folder**: `npx cxtms create module <name> --template <template> --feature <feature-name>`
|
|
18
|
+
- **Deploy to server**: `npx cxtms appmodule deploy <file.yaml>` — creates or updates module on the CX server
|
|
19
|
+
- **Undeploy from server**: `npx cxtms appmodule undeploy <appModuleId>` — removes a module by UUID
|
|
20
|
+
- **Publish all**: `npx cxtms publish [--feature <name>]` — push all modules and workflows to the server
|
|
21
21
|
|
|
22
22
|
## Generation Workflow
|
|
23
23
|
|
|
24
24
|
### Step 1: Scaffold via CLI — MANDATORY
|
|
25
25
|
|
|
26
|
-
**You MUST run `
|
|
26
|
+
**You MUST run `cxtms create module` to generate the initial file.** Do not skip this step. Do not write YAML from scratch. Do not read template files and copy them manually. The CLI generates correct UUIDs, file paths, and structure.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
npx
|
|
30
|
-
npx
|
|
29
|
+
npx cxtms create module <name> --template <template>
|
|
30
|
+
npx cxtms create module <name> --template <template> --options '<json>'
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
| Template | Use Case |
|
|
@@ -55,7 +55,7 @@ npx cx-cli create module <name> --template <template> --options '<json>'
|
|
|
55
55
|
### Step 4: Validate
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
npx
|
|
58
|
+
npx cxtms <generated-file.yaml>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
---
|
|
@@ -67,7 +67,7 @@ Customize generated modules at scaffold time with `--options`. Accepts inline JS
|
|
|
67
67
|
### Field Array Format (all templates)
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
npx
|
|
70
|
+
npx cxtms create module "Tariff" --template grid --options '[
|
|
71
71
|
{"name": "code", "type": "text", "label": "Tariff Code", "required": true},
|
|
72
72
|
{"name": "rate", "type": "number", "label": "Rate %"},
|
|
73
73
|
{"name": "effectiveDate", "type": "date"},
|
|
@@ -78,7 +78,7 @@ npx cx-cli create module "Tariff" --template grid --options '[
|
|
|
78
78
|
### Object Format (with entityName)
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
npx
|
|
81
|
+
npx cxtms create module "Country" --template select --options '{
|
|
82
82
|
"entityName": "Country",
|
|
83
83
|
"fields": [
|
|
84
84
|
{"name": "countryCode", "type": "text", "label": "Country Code"},
|
|
@@ -113,8 +113,8 @@ npx cx-cli create module "Country" --template select --options '{
|
|
|
113
113
|
Move or copy a component (and its routes) from one module into another. Useful for splitting large modules or sharing components.
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
cxtms extract <source-file> <component-name> --to <target-file>
|
|
117
|
+
cxtms extract <source-file> <component-name> --to <target-file> --copy
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
### Flags
|
|
@@ -130,13 +130,13 @@ cx-cli extract <source-file> <component-name> --to <target-file> --copy
|
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
132
|
# Move a component to a new file (creates module scaffold automatically)
|
|
133
|
-
npx
|
|
133
|
+
npx cxtms extract modules/orders.yaml Orders/CreateItem --to modules/order-create.yaml
|
|
134
134
|
|
|
135
135
|
# Copy a component (source unchanged, target gets higher priority)
|
|
136
|
-
npx
|
|
136
|
+
npx cxtms extract modules/orders.yaml Orders/CreateItem --to modules/order-create.yaml --copy
|
|
137
137
|
|
|
138
138
|
# Extract to an existing module
|
|
139
|
-
npx
|
|
139
|
+
npx cxtms extract modules/main.yaml Dashboard --to modules/dashboard.yaml
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
### New Target Scaffold
|
|
@@ -149,7 +149,7 @@ When the target file doesn't exist, a new module is created with:
|
|
|
149
149
|
### Workflow
|
|
150
150
|
1. Run `extract` to move the component
|
|
151
151
|
2. Manually move any related permissions/entities if needed
|
|
152
|
-
3. Validate both files: `npx
|
|
152
|
+
3. Validate both files: `npx cxtms <source>` and `npx cxtms <target>`
|
|
153
153
|
|
|
154
154
|
---
|
|
155
155
|
|
|
@@ -401,26 +401,26 @@ Reusable select components (e.g., `Countries/Select`, `Ports/Select`) follow thi
|
|
|
401
401
|
|
|
402
402
|
```bash
|
|
403
403
|
# Deploy a module YAML to the server (creates or updates)
|
|
404
|
-
npx
|
|
404
|
+
npx cxtms appmodule deploy modules/my-module.yaml
|
|
405
405
|
|
|
406
406
|
# Deploy with explicit org ID
|
|
407
|
-
npx
|
|
407
|
+
npx cxtms appmodule deploy modules/my-module.yaml --org 42
|
|
408
408
|
|
|
409
409
|
# Undeploy an app module by UUID
|
|
410
|
-
npx
|
|
410
|
+
npx cxtms appmodule undeploy <appModuleId>
|
|
411
411
|
|
|
412
412
|
# Publish all modules and workflows (validates first)
|
|
413
|
-
npx
|
|
414
|
-
npx
|
|
413
|
+
npx cxtms publish
|
|
414
|
+
npx cxtms publish --feature billing
|
|
415
415
|
```
|
|
416
416
|
|
|
417
|
-
Deploy reads `module.appModuleId` from the YAML, queries the server, and creates or updates accordingly. Requires an active session (`
|
|
417
|
+
Deploy reads `module.appModuleId` from the YAML, queries the server, and creates or updates accordingly. Requires an active session (`cxtms login` or PAT token — see cx-core skill).
|
|
418
418
|
|
|
419
419
|
---
|
|
420
420
|
|
|
421
421
|
# Generation Rules
|
|
422
422
|
|
|
423
|
-
1. **Always scaffold via `
|
|
423
|
+
1. **Always scaffold via `cxtms create module` first** — never write YAML from scratch, never copy templates manually
|
|
424
424
|
2. **Use localized strings** `{ en-US: "..." }` for all user-visible text
|
|
425
425
|
3. **Follow naming conventions**:
|
|
426
426
|
- Module names: PascalCase (e.g., `WarehouseLocations`)
|
|
@@ -433,4 +433,4 @@ Deploy reads `module.appModuleId` from the YAML, queries the server, and creates
|
|
|
433
433
|
7. **DataGrid options** requires ALL properties: query, rootEntityName, entityKeys, navigationType, enableDynamicGrid, enableViews, enableSearch, enablePagination, enableColumns, enableFilter, defaultView, onRowClick
|
|
434
434
|
8. **Form component** requires `validationSchema` in props
|
|
435
435
|
9. **Do not change `appModuleId` or `filePath`** — set correctly by CLI scaffold
|
|
436
|
-
10. **Always validate** the final YAML: `npx
|
|
436
|
+
10. **Always validate** the final YAML: `npx cxtms <file.yaml>`
|
|
@@ -6,28 +6,28 @@ argument-hint: <description of what to build>
|
|
|
6
6
|
|
|
7
7
|
You are a CargoXplorer workflow YAML builder. You generate schema-valid YAML for CX workflows — both standard process workflows (activities, steps, triggers) and Flow state machine workflows (entity lifecycle, states, transitions). All output must conform to the JSON schemas in `.cx-schema/`.
|
|
8
8
|
|
|
9
|
-
**IMPORTANT — use `
|
|
10
|
-
- **Scaffold**: `npx
|
|
11
|
-
- **Validate**: `npx
|
|
12
|
-
- **Schema lookup**: `npx
|
|
13
|
-
- **Examples**: `npx
|
|
14
|
-
- **List schemas**: `npx
|
|
15
|
-
- **Feature folder**: `npx
|
|
16
|
-
- **Deploy to server**: `npx
|
|
17
|
-
- **Undeploy from server**: `npx
|
|
18
|
-
- **Execute**: `npx
|
|
19
|
-
- **List logs**: `npx
|
|
20
|
-
- **Download log**: `npx
|
|
21
|
-
- **Publish all**: `npx
|
|
9
|
+
**IMPORTANT — use `cxtms` for all workflow operations:**
|
|
10
|
+
- **Scaffold**: `npx cxtms create workflow <name> --template <template>` — generates a schema-valid YAML file. ALWAYS run this first, then read the generated file, then customize. Do NOT write YAML from scratch or copy templates manually.
|
|
11
|
+
- **Validate**: `npx cxtms <file.yaml>` — run after every change
|
|
12
|
+
- **Schema lookup**: `npx cxtms schema <task>` — e.g., `cxtms schema graphql`, `cxtms schema foreach`, `cxtms schema action-event`. Schema names use kebab-case file names. Case-insensitive: `ActionEvent` resolves to `action-event`.
|
|
13
|
+
- **Examples**: `npx cxtms example <task>` — show example YAML for a task
|
|
14
|
+
- **List schemas**: `npx cxtms list --type workflow` — shows all available task schemas in the Tasks section
|
|
15
|
+
- **Feature folder**: `npx cxtms create workflow <name> --template <template> --feature <feature-name>`
|
|
16
|
+
- **Deploy to server**: `npx cxtms workflow deploy <file.yaml>` — creates or updates workflow on the CX server
|
|
17
|
+
- **Undeploy from server**: `npx cxtms workflow undeploy <workflowId>` — removes a workflow by UUID
|
|
18
|
+
- **Execute**: `npx cxtms workflow execute <workflowId|file.yaml> [--vars '<json>']` — trigger a workflow execution
|
|
19
|
+
- **List logs**: `npx cxtms workflow logs <workflowId|file.yaml> [--from YYYY-MM-DD] [--to YYYY-MM-DD]` — list executions with log availability
|
|
20
|
+
- **Download log**: `npx cxtms workflow log <executionId> [--json] [--console] [--output <file>]` — download execution log
|
|
21
|
+
- **Publish all**: `npx cxtms publish [--feature <name>]` — push all modules and workflows to the server
|
|
22
22
|
|
|
23
23
|
## Generation Workflow
|
|
24
24
|
|
|
25
25
|
### Step 1: Scaffold via CLI — MANDATORY
|
|
26
26
|
|
|
27
|
-
**You MUST run `
|
|
27
|
+
**You MUST run `cxtms create workflow` to generate the initial file.** Do not skip this step. Do not write YAML from scratch. Do not read template files and copy them manually. The CLI generates correct UUIDs, file paths, and structure.
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx
|
|
30
|
+
npx cxtms create workflow <name> --template <template>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
| Template | Use Case |
|
|
@@ -77,7 +77,7 @@ npx cx-cli create workflow <name> --template <template>
|
|
|
77
77
|
### Step 4: Validate
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
npx
|
|
80
|
+
npx cxtms <generated-file.yaml>
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
### File Placement
|
|
@@ -319,27 +319,27 @@ Implicit variable: `iteration` (zero-based).
|
|
|
319
319
|
|
|
320
320
|
```bash
|
|
321
321
|
# Push a workflow YAML to the server (creates or updates)
|
|
322
|
-
npx
|
|
322
|
+
npx cxtms workflow deploy workflows/my-workflow.yaml
|
|
323
323
|
|
|
324
324
|
# Delete a workflow by UUID
|
|
325
|
-
npx
|
|
325
|
+
npx cxtms workflow undeploy <workflowId>
|
|
326
326
|
|
|
327
327
|
# Publish all modules and workflows (validates first)
|
|
328
|
-
npx
|
|
329
|
-
npx
|
|
328
|
+
npx cxtms publish
|
|
329
|
+
npx cxtms publish --feature billing
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
-
Deploy reads `workflow.workflowId` from the YAML, queries the server, and creates or updates accordingly. Requires an active session (`
|
|
332
|
+
Deploy reads `workflow.workflowId` from the YAML, queries the server, and creates or updates accordingly. Requires an active session (`cxtms login` or PAT token — see cx-core skill).
|
|
333
333
|
|
|
334
334
|
### Execute
|
|
335
335
|
|
|
336
336
|
```bash
|
|
337
337
|
# Execute a workflow by UUID or YAML file
|
|
338
|
-
npx
|
|
339
|
-
npx
|
|
338
|
+
npx cxtms workflow execute <workflowId>
|
|
339
|
+
npx cxtms workflow execute workflows/my-workflow.yaml
|
|
340
340
|
|
|
341
341
|
# Pass input variables as JSON
|
|
342
|
-
npx
|
|
342
|
+
npx cxtms workflow execute <workflowId> --vars '{"city": "London", "count": 5}'
|
|
343
343
|
```
|
|
344
344
|
|
|
345
345
|
Returns execution result including `executionId`, `isAsync`, `outputs` (for Sync workflows).
|
|
@@ -348,25 +348,25 @@ Returns execution result including `executionId`, `isAsync`, `outputs` (for Sync
|
|
|
348
348
|
|
|
349
349
|
```bash
|
|
350
350
|
# List executions with log availability (sorted desc by date)
|
|
351
|
-
npx
|
|
351
|
+
npx cxtms workflow logs <workflowId|file.yaml>
|
|
352
352
|
|
|
353
353
|
# Filter by date range
|
|
354
|
-
npx
|
|
354
|
+
npx cxtms workflow logs <workflowId> --from 2026-01-01 --to 2026-01-31
|
|
355
355
|
|
|
356
356
|
# Download a specific execution log (saves to temp dir by default)
|
|
357
|
-
npx
|
|
357
|
+
npx cxtms workflow log <executionId>
|
|
358
358
|
|
|
359
359
|
# Save to specific file
|
|
360
|
-
npx
|
|
360
|
+
npx cxtms workflow log <executionId> --output mylog.txt
|
|
361
361
|
|
|
362
362
|
# Print to stdout
|
|
363
|
-
npx
|
|
363
|
+
npx cxtms workflow log <executionId> --console
|
|
364
364
|
|
|
365
365
|
# Download JSON log (richer data: inputs, outputs, timing, metadata)
|
|
366
|
-
npx
|
|
366
|
+
npx cxtms workflow log <executionId> --json
|
|
367
367
|
|
|
368
368
|
# JSON log to stdout
|
|
369
|
-
npx
|
|
369
|
+
npx cxtms workflow log <executionId> --json --console
|
|
370
370
|
```
|
|
371
371
|
|
|
372
372
|
`workflow logs` shows a table with execution status, date, duration, user, and log availability indicators (filled/empty circle). `workflow log` downloads the actual log content from the server (gzip-compressed S3 URLs).
|
|
@@ -382,7 +382,7 @@ npx cx-cli workflow log <executionId> --json --console
|
|
|
382
382
|
|
|
383
383
|
## Generation Rules
|
|
384
384
|
|
|
385
|
-
1. **Always scaffold via `
|
|
385
|
+
1. **Always scaffold via `cxtms create workflow` first** — never write YAML from scratch, never copy templates manually
|
|
386
386
|
2. **Naming conventions**: step names PascalCase, variables camelCase, states PascalCase, transitions camelCase
|
|
387
387
|
3. **Template expressions** use `{{ expression }}` — NCalc conditions use `[variable]`
|
|
388
388
|
4. **Do not change `workflowId` or `filePath`** — set correctly by CLI scaffold
|
|
@@ -390,4 +390,4 @@ npx cx-cli workflow log <executionId> --json --console
|
|
|
390
390
|
6. **Flow workflows** require `entity`, `states`, `transitions` (no `activities`)
|
|
391
391
|
7. **Entity triggers** require `entityName` and `eventType`
|
|
392
392
|
8. **Always use null-safe `?`** on variable paths — `Activity?.Step?.output?` — unless referencing guaranteed system variables (see Variable References section)
|
|
393
|
-
9. **Always validate** the final YAML: `npx
|
|
393
|
+
9. **Always validate** the final YAML: `npx cxtms <file.yaml>`
|
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
|
|
32
|
+
npx cxtms init
|
|
33
33
|
|
|
34
34
|
# Create a new module
|
|
35
|
-
npx
|
|
35
|
+
npx cxtms create module orders
|
|
36
36
|
|
|
37
37
|
# Create a new workflow
|
|
38
|
-
npx
|
|
38
|
+
npx cxtms create workflow invoice-processor
|
|
39
39
|
|
|
40
40
|
# Validate files
|
|
41
|
-
npx
|
|
41
|
+
npx cxtms modules/*.yaml workflows/*.yaml
|
|
42
42
|
|
|
43
43
|
# Generate validation report
|
|
44
|
-
npx
|
|
44
|
+
npx cxtms report modules/*.yaml --report report.html
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
## CLI Commands
|
|
@@ -51,14 +51,14 @@ npx cx-cli report modules/*.yaml --report report.html
|
|
|
51
51
|
Validate YAML file(s) against JSON Schema definitions.
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
cxtms [files...]
|
|
55
|
+
cxtms validate [files...]
|
|
56
56
|
|
|
57
57
|
# Examples
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
cxtms modules/orders-module.yaml
|
|
59
|
+
cxtms modules/*.yaml workflows/*.yaml
|
|
60
|
+
cxtms --verbose modules/orders-module.yaml
|
|
61
|
+
cxtms --format json modules/orders-module.yaml
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
### init
|
|
@@ -66,7 +66,7 @@ cx-cli --format json modules/orders-module.yaml
|
|
|
66
66
|
Initialize a new CX project with configuration files.
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
|
-
|
|
69
|
+
cxtms 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
|
-
|
|
84
|
+
cxtms create <type> <name>
|
|
85
85
|
|
|
86
86
|
# Examples
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
cxtms create module orders
|
|
88
|
+
cxtms 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
|
-
|
|
101
|
+
cxtms report [files...] --report <output-file>
|
|
102
102
|
|
|
103
103
|
# Examples
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
cxtms report modules/*.yaml --report report.html
|
|
105
|
+
cxtms report workflows/*.yaml --report report.md
|
|
106
|
+
cxtms 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
|
-
|
|
119
|
+
cxtms schema <name>
|
|
120
120
|
|
|
121
121
|
# Examples
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
cxtms schema form
|
|
123
|
+
cxtms schema dataGrid
|
|
124
|
+
cxtms schema workflow
|
|
125
|
+
cxtms schema foreach
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
### example
|
|
@@ -130,11 +130,11 @@ cx-cli schema foreach
|
|
|
130
130
|
Show example YAML for a component or task.
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
|
|
133
|
+
cxtms example <name>
|
|
134
134
|
|
|
135
135
|
# Examples
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
cxtms example form
|
|
137
|
+
cxtms example workflow
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
### list
|
|
@@ -142,9 +142,9 @@ cx-cli example workflow
|
|
|
142
142
|
List all available schemas for validation.
|
|
143
143
|
|
|
144
144
|
```bash
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
cxtms list
|
|
146
|
+
cxtms list --type module
|
|
147
|
+
cxtms 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
|
|
301
|
+
npx cxtms --format compact modules/*.yaml workflows/*.yaml
|
|
302
302
|
|
|
303
303
|
- name: Generate validation report
|
|
304
304
|
run: |
|
|
305
|
-
npx
|
|
305
|
+
npx cxtms 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
|
|
319
|
+
- npx cxtms --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
|
|
334
|
+
npx cxtms --format compact $staged_files
|
|
335
335
|
if [ $? -ne 0 ]; then
|
|
336
336
|
echo "Validation failed. Please fix errors before committing."
|
|
337
337
|
exit 1
|