cxtms 1.9.16 → 1.9.22

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Workflow validator for CargoXplorer YAML workflow files
2
+ * Workflow validator for CXTMS YAML workflow files
3
3
  */
4
4
  import { ValidationResult, WorkflowValidatorOptions } from './types';
5
5
  export declare class WorkflowValidator {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Workflow validator for CargoXplorer YAML workflow files
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",
3
- "version": "1.9.16",
4
- "description": "Schema validation package for CargoXplorer YAML modules",
3
+ "version": "1.9.22",
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
- "cargoxplorer",
22
+ "cxtms",
23
23
  "module"
24
24
  ],
25
- "author": "CargoXplorer",
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 CargoXplorer component type. Breaking down component schemas into separate files improves maintainability, organization, and reusability.
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 CargoXplorer App Component",
3
+ "title": "Generic CXTMS App Component",
4
4
  "type": "object",
5
- "description": "Base schema for any CargoXplorer component that can be used within the application",
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 CargoXplorer component schemas",
4
+ "description": "Index of all available CXTMS component schemas",
5
5
  "type": "object",
6
6
  "definitions": {
7
7
  "appComponent": {
@@ -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 the CargoXplorer TMS system.
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 CargoXplorer modules
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 CargoXplorer TMS modules, ensuring practical applicability and correct implementation.
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 CargoXplorer TMS",
4
+ "description": "Index of all available field types for CXTMS",
5
5
  "definitions": {
6
6
  "fieldType": {
7
7
  "oneOf": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "CargoXplorer Module and Component Schemas",
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 CargoXplorer",
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": "CargoXplorer entity definition",
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": "CargoXplorer Workflow",
4
- "description": "Schema for CargoXplorer workflow YAML files. Supports standard task-based workflows and Flow (state machine) workflows.",
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": {
@@ -115,9 +115,9 @@ const CX_CLAUDE_MARKER = '<!-- cx-schema-instructions -->';
115
115
 
116
116
  function generateClaudeMdContent() {
117
117
  return `${CX_CLAUDE_MARKER}
118
- ## CargoXplorer Project
118
+ ## CXTMS Project
119
119
 
120
- This is a CargoXplorer (CX) application. Modules and workflows are defined as YAML files validated against JSON schemas provided by \`@cxtms/cx-schema\`.
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 CargoXplorer domain reference — entity fields, enums, customValues, GraphQL queries, and CLI auth.
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 CargoXplorer entities. Used by `cxtms-workflow-builder` and `cxtms-module-builder` skills for entity field names, types, navigation properties, enums, and customValues extension patterns.
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
- - Publish (push modules and workflows to server)
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
- ## Publish
73
+ ## Deploy All
74
74
 
75
75
  ```bash
76
- # Publish all modules and workflows from current project
77
- npx cxtms publish
76
+ # Deploy all modules and workflows from current project to the CX server
77
+ npx cxtms deploy-all
78
78
 
79
- # Publish only a specific feature directory
80
- npx cxtms publish --feature billing
81
- npx cxtms publish billing
79
+ # Deploy only a specific feature directory
80
+ npx cxtms deploy-all --feature billing
81
+ npx cxtms deploy-all billing
82
82
 
83
- # Publish with explicit org ID
84
- npx cxtms publish --org 42
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 unpublished local changes
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 republish" --force
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 unpublished changes.
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, unpublished changes, update available), and repository info.
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 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/`.
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
- - **Publish all**: `npx cxtms publish [--feature <name>] --org <id>` — deploy all modules and workflows to the server
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: "CargoXplorer" # Required
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 unpublished changes to GitHub (creates a PR) — message is required
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 unpublished ones)
427
- npx cxtms app release -m "Full republish" --force
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 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/`.
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
- - **Publish all**: `npx cxtms publish [--feature <name>] --org <id>` — deploy all modules and workflows to the server
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 unpublished changes to GitHub (creates a PR) — message is required
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 unpublished ones)
337
- npx cxtms app release -m "Full republish" --force
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
@@ -4,8 +4,8 @@
4
4
  - NCalc expression syntax `[variable]` (in conditions and expression directives)
5
5
  - Operators (comparison, logical, arithmetic, ternary, membership)
6
6
  - Iterator variables (`[each.*]` and `[item.*]`)
7
- - Collection functions (any, all, count, sum, first, last, distinct, groupBy, join, etc.)
8
- - String functions (isNullOrEmpty, length, lower, upper, replace, format, base64, etc.)
7
+ - Collection functions (any, all, count, sum, first, last, distinct, select, zip, groupBy, join, etc.)
8
+ - String functions (isNullOrEmpty, length, lower, upper, replace, format, base64, coalesce, etc.)
9
9
  - Date functions (now, parseDate, addDays, formatDate, dateFromUnix, etc.)
10
10
  - Math functions (Abs, Ceiling, Floor, Round, Min, Max, etc.)
11
11
  - Domain functions (convertWeight, convertDimension)
@@ -28,6 +28,7 @@ conditions:
28
28
  - Numeric strings are auto-converted to `decimal` when needed (e.g., `[price] > 100` works even if price is the string `"150"`)
29
29
  - Dot paths resolve deep: `[Activity.Step.output.nested.field]`
30
30
  - Optional suffix `?` prevents errors: `[order.customer?.name?]`
31
+ - Wildcard traversal continues through POCOs, dictionaries, and `JObject` values, for example `[items[*].customValues.chapter_en?]`
31
32
 
32
33
  ### Operators
33
34
 
@@ -42,14 +43,14 @@ conditions:
42
43
  ### Iterator Variables
43
44
 
44
45
  Functions use two iterator variable names:
45
- - **`[each.*]`** -- used by: `any`, `all`, `sum`, `join` (3-arg)
46
+ - **`[each.*]`** -- used by: `any`, `all`, `sum`, `select`, `join` (3-arg), and projections over `zip(...)` output
46
47
  - **`[item.*]`** -- used by: `first`, `last`, `groupBy`
47
48
 
48
49
  ### Collection Functions
49
50
 
50
51
  | Function | Description |
51
52
  |----------|-------------|
52
- | `any([items], [each.prop] = 'val')` | True if any item matches expression. Without expression: checks if collection contains the value |
53
+ | `any([items], [each.prop] = 'val')` | True if any item matches expression. Without expression: checks if collection contains the value. Returns `false` for empty collections |
53
54
  | `all([items], [each.prop] > 0)` | True if all items match. Returns `false` for null/empty collections |
54
55
  | `count([items])` | Count items in list or JToken. Returns `0` for non-collections |
55
56
  | `sum([items], [each.amount])` | Sum values as `decimal`. Optional `[each.*]` accessor. Skips nulls |
@@ -63,6 +64,8 @@ Functions use two iterator variable names:
63
64
  | `groupBy([items], [item.cat])` | Group by one or more key expressions. Returns `[{key, items}]`. Multi-key: keys joined with `\|` |
64
65
  | `join([items], [each.name], ',')` | Join collection with `[each.*]` accessor and separator (3-arg) |
65
66
  | `join([items], ',')` | Join collection directly with separator (2-arg) |
67
+ | `select([items], [each.field])` | Project each item via `[each.*]` accessor. Returns flat `List<object>` of projected values. Empty input → empty list |
68
+ | `zip([a], [b])` | Pair elements from two or more lists into `[{item1, item2}, ...]`. Custom keys: `zip([a], [b], 'name', 'code')`. Variadic: accepts N lists. Truncates to shortest list. Returns empty list if any input is empty/null. Falls back to `item1`, `item2`, ... when custom key count does not match list count |
66
69
  | `split([str], ' ')` | Split string by first character of separator. Returns `List<string>` |
67
70
  | `elementAt([items], 0)` | Get element at index (zero-based) from list |
68
71
 
@@ -82,6 +85,8 @@ Functions use two iterator variable names:
82
85
  | `bool([value])` | Convert to boolean: null->`false`, empty string->`false`, "true"/"false"->parsed, non-zero number->`true`, any object->`true` |
83
86
  | `transliterate([value])` | Unicode to ASCII (Unidecode). Returns `""` for null |
84
87
  | `transliterateUa([value])` | Ukrainian-specific transliteration. Returns `""` for null |
88
+ | `coalesce([a], [b], 'default')` | First non-null, non-empty/whitespace argument. Variadic. `0` and `false` are kept (not skipped). Returns `null` if all args are null/empty |
89
+ | `prop([obj], 'path.to.field')` | Drill into an object by a runtime-computed string path. Supports dotted paths and `?` optional suffix, same as `[obj.path]` but the path is a string argument |
85
90
  | `parseAddress([address])` | Parse address -> `{StreetNumber, StreetName}`. Handles US and EU formats |
86
91
 
87
92
  ### Date Functions
@@ -152,6 +152,7 @@ Used in `collection:` (foreach), `mapping:` (outputs), and variable resolution.
152
152
  | `list[0]` | Array index | `items[0]` |
153
153
  | `list[^1]` | Index from end (last item) | `items[^1]` |
154
154
  | `list[*]` | Flatten/wildcard (all items) | `containers[*].commodities` |
155
+ | `list[*].dictKey` | Wildcard traversal into Dictionary/JObject keys | `items[*].customValues.chapter_en` |
155
156
  | `list[**]` | Recursive flatten (all depths) | `containerCommodities[**]` |
156
157
  | `list[-1]` | Depth filter (leaves only) | `tree[**][-1]` |
157
158
  | `list[condition]` | Filter by condition | `items[status=Active]` |
@@ -159,3 +160,7 @@ Used in `collection:` (foreach), `mapping:` (outputs), and variable resolution.
159
160
  | `list[*].{f1 f2}` | Field selector (projection) | `items[*].{name description}` |
160
161
  | `list[*].{alias:source}` | Field selector with alias | `items[*].{id:commodityId}` |
161
162
  | `list[*].{alias:_.parent}` | Field selector referencing parent | `items[*].{parentId:_.orderId}` |
163
+
164
+ **Wildcard traversal into Dictionary/JObject**: After `[*]`, subsequent path segments drill into Dictionary keys and JObject properties on each item. Dictionary-like values are preserved intact (not flattened) so multi-hop paths work: `items[*].customValues.chapter_en` extracts the `chapter_en` key from each item's `customValues` dictionary. This also works with nested dictionaries (`items[*].meta.locale.name`) and JObject items from JSON payloads.
165
+
166
+ **JArray primitive unwrapping**: When `GetPropertyValue` encounters a JArray where every element is a JValue (primitive), it automatically unwraps the array into a `List<object>` of plain .NET values. This ensures downstream iteration (e.g., `select()`, `zip()`, `foreach`) works with primitives rather than JValue wrappers.