@cxtms/cx-schema 1.9.16 → 1.9.21
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 +1 -1
- package/dist/cli.js +81 -48
- package/dist/cli.js.map +1 -1
- package/dist/workflowValidator.d.ts +1 -1
- package/dist/workflowValidator.js +1 -1
- package/package.json +4 -4
- package/schemas/components/README.md +1 -1
- package/schemas/components/appComponent.json +2 -2
- package/schemas/components/index.json +1 -1
- package/schemas/fields/README.md +3 -3
- package/schemas/fields/index.json +1 -1
- package/schemas/schemas.json +3 -3
- package/schemas/workflows/workflow.json +2 -2
- package/scripts/postinstall.js +2 -2
- package/skills/cxtms-developer/SKILL.md +2 -2
- package/skills/cxtms-developer/ref-cli-auth.md +15 -13
- package/skills/cxtms-module-builder/SKILL.md +6 -6
- package/skills/cxtms-workflow-builder/SKILL.md +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Workflow validator for
|
|
3
|
+
* Workflow validator for CXTMS YAML workflow files
|
|
4
4
|
*/
|
|
5
5
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cxtms/cx-schema",
|
|
3
|
-
"version": "1.9.
|
|
4
|
-
"description": "Schema validation package for
|
|
3
|
+
"version": "1.9.21",
|
|
4
|
+
"description": "Schema validation package for CXTMS YAML modules",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"validation",
|
|
20
20
|
"yaml",
|
|
21
21
|
"tms",
|
|
22
|
-
"
|
|
22
|
+
"cxtms",
|
|
23
23
|
"module"
|
|
24
24
|
],
|
|
25
|
-
"author": "
|
|
25
|
+
"author": "CXTMS",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Component Schemas
|
|
2
2
|
|
|
3
|
-
This directory contains individual JSON schema files for each
|
|
3
|
+
This directory contains individual JSON schema files for each CXTMS component type. Breaking down component schemas into separate files improves maintainability, organization, and reusability.
|
|
4
4
|
|
|
5
5
|
## Directory Structure
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Generic
|
|
3
|
+
"title": "Generic CXTMS App Component",
|
|
4
4
|
"type": "object",
|
|
5
|
-
"description": "Base schema for any
|
|
5
|
+
"description": "Base schema for any CXTMS component that can be used within the application",
|
|
6
6
|
"properties": {
|
|
7
7
|
"name": {
|
|
8
8
|
"type": "string",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "Component Schemas Index",
|
|
4
|
-
"description": "Index of all available
|
|
4
|
+
"description": "Index of all available CXTMS component schemas",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"definitions": {
|
|
7
7
|
"appComponent": {
|
package/schemas/fields/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Field Type Schemas
|
|
2
2
|
|
|
3
|
-
This directory contains separate JSON schema files for each field type supported by
|
|
3
|
+
This directory contains separate JSON schema files for each field type supported by CXTMS.
|
|
4
4
|
|
|
5
5
|
## Available Field Types
|
|
6
6
|
|
|
@@ -39,7 +39,7 @@ Each field type schema includes:
|
|
|
39
39
|
- Field-specific properties and validation
|
|
40
40
|
- Event handlers (onChange, onBlur, onFocus, onSelectValue)
|
|
41
41
|
- Transformation configurations
|
|
42
|
-
- Real-world examples from the
|
|
42
|
+
- Real-world examples from the CXTMS modules
|
|
43
43
|
- Complete type safety and validation rules
|
|
44
44
|
|
|
45
45
|
## Usage
|
|
@@ -63,4 +63,4 @@ The field schemas integrate with:
|
|
|
63
63
|
|
|
64
64
|
## Examples
|
|
65
65
|
|
|
66
|
-
Each schema includes comprehensive examples derived from real usage patterns in the
|
|
66
|
+
Each schema includes comprehensive examples derived from real usage patterns in the CXTMS modules, ensuring practical applicability and correct implementation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "Field Types Index",
|
|
4
|
-
"description": "Index of all available field types for
|
|
4
|
+
"description": "Index of all available field types for CXTMS",
|
|
5
5
|
"definitions": {
|
|
6
6
|
"fieldType": {
|
|
7
7
|
"oneOf": [
|
package/schemas/schemas.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "
|
|
3
|
+
"title": "CXTMS Module and Component Schemas",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"definitions": {
|
|
6
6
|
"templateExpression": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
"component": {
|
|
47
47
|
"type": "object",
|
|
48
|
-
"description": "Generic component structure for
|
|
48
|
+
"description": "Generic component structure for CXTMS",
|
|
49
49
|
"properties": {
|
|
50
50
|
"component": {
|
|
51
51
|
"type": "string",
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
|
|
405
405
|
"entity": {
|
|
406
406
|
"type": "object",
|
|
407
|
-
"description": "
|
|
407
|
+
"description": "CXTMS entity definition",
|
|
408
408
|
"properties": {
|
|
409
409
|
"name": { "type": "string" },
|
|
410
410
|
"entityKind": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "
|
|
4
|
-
"description": "Schema for
|
|
3
|
+
"title": "CXTMS Workflow",
|
|
4
|
+
"description": "Schema for CXTMS workflow YAML files. Supports standard task-based workflows and Flow (state machine) workflows.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"workflow": {
|
package/scripts/postinstall.js
CHANGED
|
@@ -115,9 +115,9 @@ const CX_CLAUDE_MARKER = '<!-- cx-schema-instructions -->';
|
|
|
115
115
|
|
|
116
116
|
function generateClaudeMdContent() {
|
|
117
117
|
return `${CX_CLAUDE_MARKER}
|
|
118
|
-
##
|
|
118
|
+
## CXTMS Project
|
|
119
119
|
|
|
120
|
-
This is a
|
|
120
|
+
This is a CXTMS (CX) application. Modules and workflows are defined as YAML files validated against JSON schemas provided by \`@cxtms/cx-schema\`.
|
|
121
121
|
|
|
122
122
|
### Project Structure
|
|
123
123
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cxtms-developer
|
|
3
3
|
description: >
|
|
4
|
-
Shared
|
|
4
|
+
Shared CXTMS domain reference — entity fields, enums, customValues, GraphQL queries, and CLI auth.
|
|
5
5
|
Use when the user asks about CX entity fields, enums, customValues, entity relationships, or needs domain reference for Orders, Contacts, Commodities, Jobs, Charges, or other CX entities.
|
|
6
6
|
Also use when the user wants to look up, check, or query specific orders, parcel shipments, commodities, tracking events, workflow logs, or any CX data.
|
|
7
7
|
argument-hint: <entity name or question about fields>
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Shared domain reference for
|
|
10
|
+
Shared domain reference for CXTMS entities. Used by `cxtms-workflow-builder` and `cxtms-module-builder` skills for entity field names, types, navigation properties, enums, and customValues extension patterns.
|
|
11
11
|
|
|
12
12
|
## Feature File Layout
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- PAT Tokens (CI/CD alternative to OAuth)
|
|
6
6
|
- Organization Management
|
|
7
7
|
- Session Resolution
|
|
8
|
-
-
|
|
8
|
+
- Deploy All (push modules and workflows to server)
|
|
9
9
|
|
|
10
10
|
## Authentication
|
|
11
11
|
|
|
@@ -70,22 +70,24 @@ Server commands resolve the target session in this order:
|
|
|
70
70
|
2. `~/.cxtms/<project-dir>/.session.json` → project-scoped OAuth session
|
|
71
71
|
3. Not logged in → error
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## Deploy All
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
#
|
|
77
|
-
npx cxtms
|
|
76
|
+
# Deploy all modules and workflows from current project to the CX server
|
|
77
|
+
npx cxtms deploy-all
|
|
78
78
|
|
|
79
|
-
#
|
|
80
|
-
npx cxtms
|
|
81
|
-
npx cxtms
|
|
79
|
+
# Deploy only a specific feature directory
|
|
80
|
+
npx cxtms deploy-all --feature billing
|
|
81
|
+
npx cxtms deploy-all billing
|
|
82
82
|
|
|
83
|
-
#
|
|
84
|
-
npx cxtms
|
|
83
|
+
# Deploy with explicit org ID
|
|
84
|
+
npx cxtms deploy-all --org 42
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
Validates all YAML files first, then pushes modules and workflows to the server. Skips files with validation errors and reports results.
|
|
88
88
|
|
|
89
|
+
> Note: `deploy-all` pushes local YAML files to the CX server (per-file `updateWorkflow` / `updateAppModule` mutations). It does **not** touch git or create a PR. Use `app release` to open a git PR from the server's pending changes.
|
|
90
|
+
|
|
89
91
|
## App Manifest Management
|
|
90
92
|
|
|
91
93
|
Server-side app manifest operations — install from git, release changes to git, and list installed apps.
|
|
@@ -100,21 +102,21 @@ npx cxtms app install --force
|
|
|
100
102
|
# Install from a specific branch
|
|
101
103
|
npx cxtms app install --branch develop
|
|
102
104
|
|
|
103
|
-
# Install but skip modules that have
|
|
105
|
+
# Install but skip modules that have unreleased local changes
|
|
104
106
|
npx cxtms app install --skip-changed
|
|
105
107
|
|
|
106
108
|
# Release server changes to git (creates a PR) — message is required
|
|
107
109
|
npx cxtms app release -m "Add new shipping module"
|
|
108
110
|
|
|
109
111
|
# Force release all modules and workflows (not just changed ones)
|
|
110
|
-
npx cxtms app release -m "Full
|
|
112
|
+
npx cxtms app release -m "Full re-release" --force
|
|
111
113
|
|
|
112
114
|
# List installed app manifests on the server
|
|
113
115
|
npx cxtms app list
|
|
114
116
|
```
|
|
115
117
|
|
|
116
|
-
**`app install`** reads `repository` and `branch` from `app.yaml`, downloads the repo on the server side, and installs/updates all modules and workflows. Use `--force` to reinstall even if the version hasn't changed. Use `--skip-changed` to preserve modules with
|
|
118
|
+
**`app install`** reads `repository` and `branch` from `app.yaml`, downloads the repo on the server side, and installs/updates all modules and workflows. Use `--force` to reinstall even if the version hasn't changed. Use `--skip-changed` to preserve modules with unreleased changes.
|
|
117
119
|
|
|
118
120
|
**`app release`** takes the current server state and releases it to git by creating a PR. Requires a `-m` message describing the changes (like a git commit message). The server increments the version, creates a release branch, commits all module/workflow YAML files, and opens a pull request to the target branch.
|
|
119
121
|
|
|
120
|
-
**`app list`** shows all installed app manifests with their version, status flags (disabled,
|
|
122
|
+
**`app list`** shows all installed app manifests with their version, status flags (disabled, unreleased changes, update available), and repository info.
|
|
@@ -7,7 +7,7 @@ description: >
|
|
|
7
7
|
argument-hint: <description of what to build>
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
You are a
|
|
10
|
+
You are a CXTMS 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/`.
|
|
11
11
|
|
|
12
12
|
**IMPORTANT — use `cxtms` for all module operations:**
|
|
13
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.
|
|
@@ -20,7 +20,7 @@ You are a CargoXplorer module YAML builder. You generate schema-valid YAML for C
|
|
|
20
20
|
- **Feature folder**: `npx cxtms create module <name> --template <template> --feature <feature-name>`
|
|
21
21
|
- **Deploy to server**: `npx cxtms appmodule deploy <file.yaml> --org <id>` — creates or updates module on the CX server
|
|
22
22
|
- **Undeploy from server**: `npx cxtms appmodule undeploy <appModuleId> --org <id>` — removes a module by UUID
|
|
23
|
-
- **
|
|
23
|
+
- **Deploy all**: `npx cxtms deploy-all [--feature <name>] --org <id>` — push all modules and workflows from the project to the CX server
|
|
24
24
|
|
|
25
25
|
## Generation Workflow
|
|
26
26
|
|
|
@@ -211,7 +211,7 @@ module:
|
|
|
211
211
|
en-US: "Human Readable Name"
|
|
212
212
|
description:
|
|
213
213
|
en-US: "Module description"
|
|
214
|
-
application: "
|
|
214
|
+
application: "CXTMS" # Required
|
|
215
215
|
filePath: "modules/<name>-module.yaml" # File path in repo
|
|
216
216
|
|
|
217
217
|
entities:
|
|
@@ -416,15 +416,15 @@ Deploy, undeploy, and release commands are listed in the CLI section at the top
|
|
|
416
416
|
Use `app release` to release modified modules and workflows from the CX server to a GitHub repository. This creates a branch and pull request — it does NOT push directly to the target branch.
|
|
417
417
|
|
|
418
418
|
```bash
|
|
419
|
-
# Release all
|
|
419
|
+
# Release all unreleased changes to GitHub (creates a PR) — message is required
|
|
420
420
|
npx cxtms app release -m "Add warehouse locations module"
|
|
421
421
|
|
|
422
422
|
# Release specific modules and/or workflows by YAML file
|
|
423
423
|
npx cxtms app release -m "Fix country module" modules/my-module.yaml
|
|
424
424
|
npx cxtms app release -m "Update billing" modules/a.yaml workflows/b.yaml
|
|
425
425
|
|
|
426
|
-
# Force release all modules and workflows (not just
|
|
427
|
-
npx cxtms app release -m "Full
|
|
426
|
+
# Force release all modules and workflows (not just unreleased ones)
|
|
427
|
+
npx cxtms app release -m "Full re-release" --force
|
|
428
428
|
|
|
429
429
|
# Release with explicit org
|
|
430
430
|
npx cxtms app release -m "Add warehouse locations module" --org 42
|
|
@@ -7,7 +7,7 @@ description: >
|
|
|
7
7
|
argument-hint: <description of what to build>
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
You are a
|
|
10
|
+
You are a CXTMS 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/`.
|
|
11
11
|
|
|
12
12
|
**IMPORTANT — use `cxtms` for all workflow operations:**
|
|
13
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.
|
|
@@ -21,7 +21,7 @@ You are a CargoXplorer workflow YAML builder. You generate schema-valid YAML for
|
|
|
21
21
|
- **Execute**: `npx cxtms workflow execute <workflowId|file.yaml> --org <id> [--vars '<json>'] [--file varName=path]` — trigger a workflow execution (--file uploads a local file and passes the URL as a variable)
|
|
22
22
|
- **List logs**: `npx cxtms workflow logs <workflowId|file.yaml> --org <id> [--from YYYY-MM-DD] [--to YYYY-MM-DD]` — list executions with log availability
|
|
23
23
|
- **Download log**: `npx cxtms workflow log <executionId> --org <id> [--json] [--console] [--output <file>]` — download execution log
|
|
24
|
-
- **
|
|
24
|
+
- **Deploy all**: `npx cxtms deploy-all [--feature <name>] --org <id>` — push all modules and workflows from the project to the CX server
|
|
25
25
|
|
|
26
26
|
## Generation Workflow
|
|
27
27
|
|
|
@@ -326,15 +326,15 @@ Deploy, undeploy, and release commands are listed in the CLI section at the top
|
|
|
326
326
|
Use `app release` to release modified workflows and modules from the CX server to a GitHub repository. This creates a branch and pull request — it does NOT push directly to the target branch.
|
|
327
327
|
|
|
328
328
|
```bash
|
|
329
|
-
# Release all
|
|
329
|
+
# Release all unreleased changes to GitHub (creates a PR) — message is required
|
|
330
330
|
npx cxtms app release -m "Add order notification workflow"
|
|
331
331
|
|
|
332
332
|
# Release specific workflows and/or modules by YAML file
|
|
333
333
|
npx cxtms app release -m "Fix tracking workflow" workflows/my-workflow.yaml
|
|
334
334
|
npx cxtms app release -m "Update shipping" workflows/a.yaml modules/b.yaml
|
|
335
335
|
|
|
336
|
-
# Force release all workflows and modules (not just
|
|
337
|
-
npx cxtms app release -m "Full
|
|
336
|
+
# Force release all workflows and modules (not just unreleased ones)
|
|
337
|
+
npx cxtms app release -m "Full re-release" --force
|
|
338
338
|
|
|
339
339
|
# Release with explicit org
|
|
340
340
|
npx cxtms app release -m "Add order notification workflow" --org 42
|