@cxtms/cx-schema 1.6.7 → 1.7.1
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 +18 -16
- package/.claude/skills/cx-module/SKILL.md +36 -33
- package/.claude/skills/cx-workflow/SKILL.md +37 -34
- 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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cx-core
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Shared CargoXplorer entity field reference — domain entities, field names, enums, and customValues patterns.
|
|
5
|
+
TRIGGER when: user asks about CX entity fields, enums, customValues, entity relationships, or needs domain reference for Orders, Contacts, Commodities, Jobs, etc.
|
|
4
6
|
argument-hint: <entity name or question about fields>
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -14,10 +16,10 @@ The CLI can authenticate against CX environments and manage server resources. Au
|
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
18
|
# Login to a CX environment (OAuth2 + PKCE — opens browser)
|
|
17
|
-
npx
|
|
19
|
+
npx cxtms login https://tms-v3-dev.usatrt.com
|
|
18
20
|
|
|
19
21
|
# Logout from current session
|
|
20
|
-
npx
|
|
22
|
+
npx cxtms logout
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
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 +30,16 @@ For CI/CD or headless environments, use Personal Access Tokens instead of intera
|
|
|
28
30
|
|
|
29
31
|
```bash
|
|
30
32
|
# Check PAT status and setup instructions
|
|
31
|
-
npx
|
|
33
|
+
npx cxtms pat setup
|
|
32
34
|
|
|
33
35
|
# Create a new PAT token (requires OAuth login first)
|
|
34
|
-
npx
|
|
36
|
+
npx cxtms pat create "my-ci-token"
|
|
35
37
|
|
|
36
38
|
# List active PAT tokens
|
|
37
|
-
npx
|
|
39
|
+
npx cxtms pat list
|
|
38
40
|
|
|
39
41
|
# Revoke a PAT token
|
|
40
|
-
npx
|
|
42
|
+
npx cxtms pat revoke <tokenId>
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
After creating a PAT, add to `.env` in your project root:
|
|
@@ -52,16 +54,16 @@ When `CXTMS_AUTH` is set, the CLI skips OAuth and uses the PAT token directly. `
|
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
56
|
# List organizations on the server
|
|
55
|
-
npx
|
|
57
|
+
npx cxtms orgs list
|
|
56
58
|
|
|
57
59
|
# Select an organization interactively
|
|
58
|
-
npx
|
|
60
|
+
npx cxtms orgs select
|
|
59
61
|
|
|
60
62
|
# Set active organization by ID
|
|
61
|
-
npx
|
|
63
|
+
npx cxtms orgs use <orgId>
|
|
62
64
|
|
|
63
65
|
# Show current context (server, org, app)
|
|
64
|
-
npx
|
|
66
|
+
npx cxtms orgs use
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
The active org is cached in the session file and used by all server commands. Override with `--org <id>`.
|
|
@@ -77,14 +79,14 @@ Server commands resolve the target session in this order:
|
|
|
77
79
|
|
|
78
80
|
```bash
|
|
79
81
|
# Publish all modules and workflows from current project
|
|
80
|
-
npx
|
|
82
|
+
npx cxtms publish
|
|
81
83
|
|
|
82
84
|
# Publish only a specific feature directory
|
|
83
|
-
npx
|
|
84
|
-
npx
|
|
85
|
+
npx cxtms publish --feature billing
|
|
86
|
+
npx cxtms publish billing
|
|
85
87
|
|
|
86
88
|
# Publish with explicit org ID
|
|
87
|
-
npx
|
|
89
|
+
npx cxtms publish --org 42
|
|
88
90
|
```
|
|
89
91
|
|
|
90
92
|
Validates all YAML files first, then pushes modules and workflows to the server. Skips files with validation errors and reports results.
|
|
@@ -106,7 +108,7 @@ When creating new modules or workflows, always place them under the correct feat
|
|
|
106
108
|
- `features/<feature_name>/modules/<name>-module.yaml`
|
|
107
109
|
- `features/<feature_name>/workflows/<name>.yaml`
|
|
108
110
|
|
|
109
|
-
Use `--feature <feature_name>` with `
|
|
111
|
+
Use `--feature <feature_name>` with `cxtms create` to automatically place files in the correct location.
|
|
110
112
|
|
|
111
113
|
## Entity Field Reference
|
|
112
114
|
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cx-module
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Generate schema-valid CargoXplorer app module YAML files (UI screens, forms, grids, routes).
|
|
5
|
+
TRIGGER when: user asks to create, modify, or fix a module YAML file, or references *-module.yaml files, or asks about UI components/forms/grids/routes in a CX project.
|
|
6
|
+
DO NOT TRIGGER when: working with workflow YAML files, general TypeScript/code changes, or non-YAML tasks.
|
|
4
7
|
argument-hint: <description of what to build>
|
|
5
8
|
---
|
|
6
9
|
|
|
7
10
|
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
11
|
|
|
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
|
|
12
|
+
**IMPORTANT — use `cxtms` for all module operations:**
|
|
13
|
+
- **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.
|
|
14
|
+
- **Scaffold with fields**: `npx cxtms create module <name> --template <template> --options '<json>'`
|
|
15
|
+
- **Validate**: `npx cxtms <file.yaml>` — run after every change
|
|
16
|
+
- **Schema lookup**: `npx cxtms schema <component>` — e.g., `cxtms schema form`, `cxtms schema dataGrid`
|
|
17
|
+
- **Examples**: `npx cxtms example <component>` — show example YAML
|
|
18
|
+
- **List schemas**: `npx cxtms list`
|
|
19
|
+
- **Extract**: `npx cxtms extract <source> <component> --to <target>` — move components between modules
|
|
20
|
+
- **Feature folder**: `npx cxtms create module <name> --template <template> --feature <feature-name>`
|
|
21
|
+
- **Deploy to server**: `npx cxtms appmodule deploy <file.yaml>` — creates or updates module on the CX server
|
|
22
|
+
- **Undeploy from server**: `npx cxtms appmodule undeploy <appModuleId>` — removes a module by UUID
|
|
23
|
+
- **Publish all**: `npx cxtms publish [--feature <name>]` — push all modules and workflows to the server
|
|
21
24
|
|
|
22
25
|
## Generation Workflow
|
|
23
26
|
|
|
24
27
|
### Step 1: Scaffold via CLI — MANDATORY
|
|
25
28
|
|
|
26
|
-
**You MUST run `
|
|
29
|
+
**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
30
|
|
|
28
31
|
```bash
|
|
29
|
-
npx
|
|
30
|
-
npx
|
|
32
|
+
npx cxtms create module <name> --template <template>
|
|
33
|
+
npx cxtms create module <name> --template <template> --options '<json>'
|
|
31
34
|
```
|
|
32
35
|
|
|
33
36
|
| Template | Use Case |
|
|
@@ -55,7 +58,7 @@ npx cx-cli create module <name> --template <template> --options '<json>'
|
|
|
55
58
|
### Step 4: Validate
|
|
56
59
|
|
|
57
60
|
```bash
|
|
58
|
-
npx
|
|
61
|
+
npx cxtms <generated-file.yaml>
|
|
59
62
|
```
|
|
60
63
|
|
|
61
64
|
---
|
|
@@ -67,7 +70,7 @@ Customize generated modules at scaffold time with `--options`. Accepts inline JS
|
|
|
67
70
|
### Field Array Format (all templates)
|
|
68
71
|
|
|
69
72
|
```bash
|
|
70
|
-
npx
|
|
73
|
+
npx cxtms create module "Tariff" --template grid --options '[
|
|
71
74
|
{"name": "code", "type": "text", "label": "Tariff Code", "required": true},
|
|
72
75
|
{"name": "rate", "type": "number", "label": "Rate %"},
|
|
73
76
|
{"name": "effectiveDate", "type": "date"},
|
|
@@ -78,7 +81,7 @@ npx cx-cli create module "Tariff" --template grid --options '[
|
|
|
78
81
|
### Object Format (with entityName)
|
|
79
82
|
|
|
80
83
|
```bash
|
|
81
|
-
npx
|
|
84
|
+
npx cxtms create module "Country" --template select --options '{
|
|
82
85
|
"entityName": "Country",
|
|
83
86
|
"fields": [
|
|
84
87
|
{"name": "countryCode", "type": "text", "label": "Country Code"},
|
|
@@ -113,8 +116,8 @@ npx cx-cli create module "Country" --template select --options '{
|
|
|
113
116
|
Move or copy a component (and its routes) from one module into another. Useful for splitting large modules or sharing components.
|
|
114
117
|
|
|
115
118
|
```bash
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
cxtms extract <source-file> <component-name> --to <target-file>
|
|
120
|
+
cxtms extract <source-file> <component-name> --to <target-file> --copy
|
|
118
121
|
```
|
|
119
122
|
|
|
120
123
|
### Flags
|
|
@@ -130,13 +133,13 @@ cx-cli extract <source-file> <component-name> --to <target-file> --copy
|
|
|
130
133
|
|
|
131
134
|
```bash
|
|
132
135
|
# Move a component to a new file (creates module scaffold automatically)
|
|
133
|
-
npx
|
|
136
|
+
npx cxtms extract modules/orders.yaml Orders/CreateItem --to modules/order-create.yaml
|
|
134
137
|
|
|
135
138
|
# Copy a component (source unchanged, target gets higher priority)
|
|
136
|
-
npx
|
|
139
|
+
npx cxtms extract modules/orders.yaml Orders/CreateItem --to modules/order-create.yaml --copy
|
|
137
140
|
|
|
138
141
|
# Extract to an existing module
|
|
139
|
-
npx
|
|
142
|
+
npx cxtms extract modules/main.yaml Dashboard --to modules/dashboard.yaml
|
|
140
143
|
```
|
|
141
144
|
|
|
142
145
|
### New Target Scaffold
|
|
@@ -149,7 +152,7 @@ When the target file doesn't exist, a new module is created with:
|
|
|
149
152
|
### Workflow
|
|
150
153
|
1. Run `extract` to move the component
|
|
151
154
|
2. Manually move any related permissions/entities if needed
|
|
152
|
-
3. Validate both files: `npx
|
|
155
|
+
3. Validate both files: `npx cxtms <source>` and `npx cxtms <target>`
|
|
153
156
|
|
|
154
157
|
---
|
|
155
158
|
|
|
@@ -401,26 +404,26 @@ Reusable select components (e.g., `Countries/Select`, `Ports/Select`) follow thi
|
|
|
401
404
|
|
|
402
405
|
```bash
|
|
403
406
|
# Deploy a module YAML to the server (creates or updates)
|
|
404
|
-
npx
|
|
407
|
+
npx cxtms appmodule deploy modules/my-module.yaml
|
|
405
408
|
|
|
406
409
|
# Deploy with explicit org ID
|
|
407
|
-
npx
|
|
410
|
+
npx cxtms appmodule deploy modules/my-module.yaml --org 42
|
|
408
411
|
|
|
409
412
|
# Undeploy an app module by UUID
|
|
410
|
-
npx
|
|
413
|
+
npx cxtms appmodule undeploy <appModuleId>
|
|
411
414
|
|
|
412
415
|
# Publish all modules and workflows (validates first)
|
|
413
|
-
npx
|
|
414
|
-
npx
|
|
416
|
+
npx cxtms publish
|
|
417
|
+
npx cxtms publish --feature billing
|
|
415
418
|
```
|
|
416
419
|
|
|
417
|
-
Deploy reads `module.appModuleId` from the YAML, queries the server, and creates or updates accordingly. Requires an active session (`
|
|
420
|
+
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
421
|
|
|
419
422
|
---
|
|
420
423
|
|
|
421
424
|
# Generation Rules
|
|
422
425
|
|
|
423
|
-
1. **Always scaffold via `
|
|
426
|
+
1. **Always scaffold via `cxtms create module` first** — never write YAML from scratch, never copy templates manually
|
|
424
427
|
2. **Use localized strings** `{ en-US: "..." }` for all user-visible text
|
|
425
428
|
3. **Follow naming conventions**:
|
|
426
429
|
- Module names: PascalCase (e.g., `WarehouseLocations`)
|
|
@@ -433,4 +436,4 @@ Deploy reads `module.appModuleId` from the YAML, queries the server, and creates
|
|
|
433
436
|
7. **DataGrid options** requires ALL properties: query, rootEntityName, entityKeys, navigationType, enableDynamicGrid, enableViews, enableSearch, enablePagination, enableColumns, enableFilter, defaultView, onRowClick
|
|
434
437
|
8. **Form component** requires `validationSchema` in props
|
|
435
438
|
9. **Do not change `appModuleId` or `filePath`** — set correctly by CLI scaffold
|
|
436
|
-
10. **Always validate** the final YAML: `npx
|
|
439
|
+
10. **Always validate** the final YAML: `npx cxtms <file.yaml>`
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cx-workflow
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Generate schema-valid CargoXplorer workflow YAML files (standard process and Flow state machine workflows).
|
|
5
|
+
TRIGGER when: user asks to create, modify, or fix a workflow YAML file, or references workflow/*.yaml files, or asks about workflow tasks/triggers/activities in a CX project.
|
|
6
|
+
DO NOT TRIGGER when: working with module YAML files, general TypeScript/code changes, or non-YAML tasks.
|
|
4
7
|
argument-hint: <description of what to build>
|
|
5
8
|
---
|
|
6
9
|
|
|
7
10
|
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
11
|
|
|
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
|
|
12
|
+
**IMPORTANT — use `cxtms` for all workflow operations:**
|
|
13
|
+
- **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.
|
|
14
|
+
- **Validate**: `npx cxtms <file.yaml>` — run after every change
|
|
15
|
+
- **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`.
|
|
16
|
+
- **Examples**: `npx cxtms example <task>` — show example YAML for a task
|
|
17
|
+
- **List schemas**: `npx cxtms list --type workflow` — shows all available task schemas in the Tasks section
|
|
18
|
+
- **Feature folder**: `npx cxtms create workflow <name> --template <template> --feature <feature-name>`
|
|
19
|
+
- **Deploy to server**: `npx cxtms workflow deploy <file.yaml>` — creates or updates workflow on the CX server
|
|
20
|
+
- **Undeploy from server**: `npx cxtms workflow undeploy <workflowId>` — removes a workflow by UUID
|
|
21
|
+
- **Execute**: `npx cxtms workflow execute <workflowId|file.yaml> [--vars '<json>']` — trigger a workflow execution
|
|
22
|
+
- **List logs**: `npx cxtms workflow logs <workflowId|file.yaml> [--from YYYY-MM-DD] [--to YYYY-MM-DD]` — list executions with log availability
|
|
23
|
+
- **Download log**: `npx cxtms workflow log <executionId> [--json] [--console] [--output <file>]` — download execution log
|
|
24
|
+
- **Publish all**: `npx cxtms publish [--feature <name>]` — push all modules and workflows to the server
|
|
22
25
|
|
|
23
26
|
## Generation Workflow
|
|
24
27
|
|
|
25
28
|
### Step 1: Scaffold via CLI — MANDATORY
|
|
26
29
|
|
|
27
|
-
**You MUST run `
|
|
30
|
+
**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
31
|
|
|
29
32
|
```bash
|
|
30
|
-
npx
|
|
33
|
+
npx cxtms create workflow <name> --template <template>
|
|
31
34
|
```
|
|
32
35
|
|
|
33
36
|
| Template | Use Case |
|
|
@@ -77,7 +80,7 @@ npx cx-cli create workflow <name> --template <template>
|
|
|
77
80
|
### Step 4: Validate
|
|
78
81
|
|
|
79
82
|
```bash
|
|
80
|
-
npx
|
|
83
|
+
npx cxtms <generated-file.yaml>
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
### File Placement
|
|
@@ -319,27 +322,27 @@ Implicit variable: `iteration` (zero-based).
|
|
|
319
322
|
|
|
320
323
|
```bash
|
|
321
324
|
# Push a workflow YAML to the server (creates or updates)
|
|
322
|
-
npx
|
|
325
|
+
npx cxtms workflow deploy workflows/my-workflow.yaml
|
|
323
326
|
|
|
324
327
|
# Delete a workflow by UUID
|
|
325
|
-
npx
|
|
328
|
+
npx cxtms workflow undeploy <workflowId>
|
|
326
329
|
|
|
327
330
|
# Publish all modules and workflows (validates first)
|
|
328
|
-
npx
|
|
329
|
-
npx
|
|
331
|
+
npx cxtms publish
|
|
332
|
+
npx cxtms publish --feature billing
|
|
330
333
|
```
|
|
331
334
|
|
|
332
|
-
Deploy reads `workflow.workflowId` from the YAML, queries the server, and creates or updates accordingly. Requires an active session (`
|
|
335
|
+
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
336
|
|
|
334
337
|
### Execute
|
|
335
338
|
|
|
336
339
|
```bash
|
|
337
340
|
# Execute a workflow by UUID or YAML file
|
|
338
|
-
npx
|
|
339
|
-
npx
|
|
341
|
+
npx cxtms workflow execute <workflowId>
|
|
342
|
+
npx cxtms workflow execute workflows/my-workflow.yaml
|
|
340
343
|
|
|
341
344
|
# Pass input variables as JSON
|
|
342
|
-
npx
|
|
345
|
+
npx cxtms workflow execute <workflowId> --vars '{"city": "London", "count": 5}'
|
|
343
346
|
```
|
|
344
347
|
|
|
345
348
|
Returns execution result including `executionId`, `isAsync`, `outputs` (for Sync workflows).
|
|
@@ -348,25 +351,25 @@ Returns execution result including `executionId`, `isAsync`, `outputs` (for Sync
|
|
|
348
351
|
|
|
349
352
|
```bash
|
|
350
353
|
# List executions with log availability (sorted desc by date)
|
|
351
|
-
npx
|
|
354
|
+
npx cxtms workflow logs <workflowId|file.yaml>
|
|
352
355
|
|
|
353
356
|
# Filter by date range
|
|
354
|
-
npx
|
|
357
|
+
npx cxtms workflow logs <workflowId> --from 2026-01-01 --to 2026-01-31
|
|
355
358
|
|
|
356
359
|
# Download a specific execution log (saves to temp dir by default)
|
|
357
|
-
npx
|
|
360
|
+
npx cxtms workflow log <executionId>
|
|
358
361
|
|
|
359
362
|
# Save to specific file
|
|
360
|
-
npx
|
|
363
|
+
npx cxtms workflow log <executionId> --output mylog.txt
|
|
361
364
|
|
|
362
365
|
# Print to stdout
|
|
363
|
-
npx
|
|
366
|
+
npx cxtms workflow log <executionId> --console
|
|
364
367
|
|
|
365
368
|
# Download JSON log (richer data: inputs, outputs, timing, metadata)
|
|
366
|
-
npx
|
|
369
|
+
npx cxtms workflow log <executionId> --json
|
|
367
370
|
|
|
368
371
|
# JSON log to stdout
|
|
369
|
-
npx
|
|
372
|
+
npx cxtms workflow log <executionId> --json --console
|
|
370
373
|
```
|
|
371
374
|
|
|
372
375
|
`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 +385,7 @@ npx cx-cli workflow log <executionId> --json --console
|
|
|
382
385
|
|
|
383
386
|
## Generation Rules
|
|
384
387
|
|
|
385
|
-
1. **Always scaffold via `
|
|
388
|
+
1. **Always scaffold via `cxtms create workflow` first** — never write YAML from scratch, never copy templates manually
|
|
386
389
|
2. **Naming conventions**: step names PascalCase, variables camelCase, states PascalCase, transitions camelCase
|
|
387
390
|
3. **Template expressions** use `{{ expression }}` — NCalc conditions use `[variable]`
|
|
388
391
|
4. **Do not change `workflowId` or `filePath`** — set correctly by CLI scaffold
|
|
@@ -390,4 +393,4 @@ npx cx-cli workflow log <executionId> --json --console
|
|
|
390
393
|
6. **Flow workflows** require `entity`, `states`, `transitions` (no `activities`)
|
|
391
394
|
7. **Entity triggers** require `entityName` and `eventType`
|
|
392
395
|
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
|
|
396
|
+
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
|