@cxtms/cx-schema 1.7.3 → 1.7.4

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,8 +1,8 @@
1
1
  ---
2
2
  name: cx-core
3
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
+ Provides shared CargoXplorer entity field reference — domain entities, field names, enums, and customValues patterns.
5
+ Use when the user asks about CX entity fields, enums, customValues, entity relationships, or needs domain reference for Orders, Contacts, Commodities, Jobs, etc.
6
6
  argument-hint: <entity name or question about fields>
7
7
  ---
8
8
 
@@ -10,88 +10,7 @@ Shared domain reference for CargoXplorer entities. Used by `cx-workflow` and `cx
10
10
 
11
11
  ## CX Server Authentication & Management
12
12
 
13
- The CLI can authenticate against CX environments and manage server resources. Auth is required for push, delete, execute, logs, publish, and org commands.
14
-
15
- ### Authentication
16
-
17
- ```bash
18
- # Login to a CX environment (OAuth2 + PKCE — opens browser)
19
- npx cxtms login https://tms-v3-dev.usatrt.com
20
-
21
- # Logout from current session
22
- npx cxtms logout
23
- ```
24
-
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.
26
-
27
- ### PAT Tokens (alternative to OAuth)
28
-
29
- For CI/CD or headless environments, use Personal Access Tokens instead of interactive OAuth:
30
-
31
- ```bash
32
- # Check PAT status and setup instructions
33
- npx cxtms pat setup
34
-
35
- # Create a new PAT token (requires OAuth login first)
36
- npx cxtms pat create "my-ci-token"
37
-
38
- # List active PAT tokens
39
- npx cxtms pat list
40
-
41
- # Revoke a PAT token
42
- npx cxtms pat revoke <tokenId>
43
- ```
44
-
45
- After creating a PAT, add to `.env` in your project root:
46
- ```
47
- CXTMS_AUTH=pat_xxxxx...
48
- CXTMS_SERVER=https://tms-v3-dev.usatrt.com
49
- ```
50
-
51
- When `CXTMS_AUTH` is set, the CLI skips OAuth and uses the PAT token directly. `CXTMS_SERVER` provides the server URL (or set `server` in `app.yaml`).
52
-
53
- ### Organization Management
54
-
55
- ```bash
56
- # List organizations on the server
57
- npx cxtms orgs list
58
-
59
- # Select an organization interactively
60
- npx cxtms orgs select
61
-
62
- # Set active organization by ID
63
- npx cxtms orgs use <orgId>
64
-
65
- # Show current context (server, org, app)
66
- npx cxtms orgs use
67
- ```
68
-
69
- The active org is cached in the session file and used by all server commands. Override with `--org <id>`.
70
-
71
- ### Session Resolution
72
-
73
- Server commands resolve the target session in this order:
74
- 1. `CXTMS_AUTH` env var → PAT token auth (with `CXTMS_SERVER` or `app.yaml` server field)
75
- 2. `~/.cxtms/<project-dir>/.session.json` → project-scoped OAuth session
76
- 3. Not logged in → error
77
-
78
- ### Publish
79
-
80
- ```bash
81
- # Publish all modules and workflows from current project
82
- npx cxtms publish
83
-
84
- # Publish only a specific feature directory
85
- npx cxtms publish --feature billing
86
- npx cxtms publish billing
87
-
88
- # Publish with explicit org ID
89
- npx cxtms publish --org 42
90
- ```
91
-
92
- Validates all YAML files first, then pushes modules and workflows to the server. Skips files with validation errors and reports results.
93
-
94
- ---
13
+ For CLI authentication, PAT tokens, org management, and publishing: see [ref-cli-auth.md](ref-cli-auth.md)
95
14
 
96
15
  ## Feature File Layout
97
16
 
@@ -112,40 +31,17 @@ Use `--feature <feature_name>` with `cxtms create` to automatically place files
112
31
 
113
32
  ## Entity Field Reference
114
33
 
115
- ### Primary Entities
116
-
117
- !cat .claude/skills/cx-core/ref-entity-order.md
118
- !cat .claude/skills/cx-core/ref-entity-contact.md
119
- !cat .claude/skills/cx-core/ref-entity-commodity.md
120
- !cat .claude/skills/cx-core/ref-entity-accounting.md
121
-
122
- ### Order Sub-Entities & Related
123
-
124
- !cat .claude/skills/cx-core/ref-entity-order-sub.md
125
- !cat .claude/skills/cx-core/ref-entity-job.md
126
-
127
- ### Pricing & Accounting Lookups
128
-
129
- !cat .claude/skills/cx-core/ref-entity-rate.md
130
-
131
- ### Shared & Lookup Entities
132
-
133
- !cat .claude/skills/cx-core/ref-entity-shared.md
134
- !cat .claude/skills/cx-core/ref-entity-geography.md
135
-
136
- ### Warehouse & Inventory
137
-
138
- !cat .claude/skills/cx-core/ref-entity-warehouse.md
34
+ Read the relevant entity reference file when needed for the current task. Do not load all files upfront.
139
35
 
140
36
  | Category | Entities | Reference |
141
37
  |----------|----------|-----------|
142
- | **Primary** | Order, Contact, Commodity, AccountingTransaction | ref-entity-order/contact/commodity/accounting.md |
143
- | **Order sub** | OrderEntity, TrackingEvent, EventDefinition, LinkedOrder, OrderDocument | ref-entity-order-sub.md |
144
- | **Job** | Job, JobOrder, JobStatus | ref-entity-job.md |
145
- | **Pricing** | Rate, Lane, Discount, AccountingItem, AccountingAccount, PaymentTerm | ref-entity-rate.md |
146
- | **Shared** | Tag, Attachment, Division, EquipmentType, PackageType, Note/NoteThread | ref-entity-shared.md |
147
- | **Geography** | Country, State, City, Port, Vessel, CustomCode, ModeOfTransportation | ref-entity-geography.md |
148
- | **Warehouse** | InventoryItem, WarehouseLocation, CargoMovement (Order variant) | ref-entity-warehouse.md |
38
+ | **Primary** | Order, Contact, Commodity, AccountingTransaction | [ref-entity-order.md](ref-entity-order.md), [ref-entity-contact.md](ref-entity-contact.md), [ref-entity-commodity.md](ref-entity-commodity.md), [ref-entity-accounting.md](ref-entity-accounting.md) |
39
+ | **Order sub** | OrderEntity, TrackingEvent, EventDefinition, LinkedOrder, OrderDocument | [ref-entity-order-sub.md](ref-entity-order-sub.md) |
40
+ | **Job** | Job, JobOrder, JobStatus | [ref-entity-job.md](ref-entity-job.md) |
41
+ | **Pricing** | Rate, Lane, Discount, AccountingItem, AccountingAccount, PaymentTerm | [ref-entity-rate.md](ref-entity-rate.md) |
42
+ | **Shared** | Tag, Attachment, Division, EquipmentType, PackageType, Note/NoteThread | [ref-entity-shared.md](ref-entity-shared.md) |
43
+ | **Geography** | Country, State, City, Port, Vessel, CustomCode, ModeOfTransportation | [ref-entity-geography.md](ref-entity-geography.md) |
44
+ | **Warehouse** | InventoryItem, WarehouseLocation, CargoMovement (Order variant) | [ref-entity-warehouse.md](ref-entity-warehouse.md) |
149
45
 
150
46
  ## CustomValues Pattern
151
47
 
@@ -0,0 +1,87 @@
1
+ # CX Server Authentication & Management
2
+
3
+ ## Contents
4
+ - Authentication (OAuth2 login/logout)
5
+ - PAT Tokens (CI/CD alternative to OAuth)
6
+ - Organization Management
7
+ - Session Resolution
8
+ - Publish (push modules and workflows to server)
9
+
10
+ ## Authentication
11
+
12
+ ```bash
13
+ # Login to a CX environment (OAuth2 + PKCE — opens browser)
14
+ npx cxtms login https://tms-v3-dev.usatrt.com
15
+
16
+ # Logout from current session
17
+ npx cxtms logout
18
+ ```
19
+
20
+ 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.
21
+
22
+ ## PAT Tokens (alternative to OAuth)
23
+
24
+ For CI/CD or headless environments, use Personal Access Tokens instead of interactive OAuth:
25
+
26
+ ```bash
27
+ # Check PAT status and setup instructions
28
+ npx cxtms pat setup
29
+
30
+ # Create a new PAT token (requires OAuth login first)
31
+ npx cxtms pat create "my-ci-token"
32
+
33
+ # List active PAT tokens
34
+ npx cxtms pat list
35
+
36
+ # Revoke a PAT token
37
+ npx cxtms pat revoke <tokenId>
38
+ ```
39
+
40
+ After creating a PAT, add to `.env` in your project root:
41
+ ```
42
+ CXTMS_AUTH=pat_xxxxx...
43
+ CXTMS_SERVER=https://tms-v3-dev.usatrt.com
44
+ ```
45
+
46
+ When `CXTMS_AUTH` is set, the CLI skips OAuth and uses the PAT token directly. `CXTMS_SERVER` provides the server URL (or set `server` in `app.yaml`).
47
+
48
+ ## Organization Management
49
+
50
+ ```bash
51
+ # List organizations on the server
52
+ npx cxtms orgs list
53
+
54
+ # Select an organization interactively
55
+ npx cxtms orgs select
56
+
57
+ # Set active organization by ID
58
+ npx cxtms orgs use <orgId>
59
+
60
+ # Show current context (server, org, app)
61
+ npx cxtms orgs use
62
+ ```
63
+
64
+ The active org is cached in the session file and used by all server commands. Override with `--org <id>`.
65
+
66
+ ## Session Resolution
67
+
68
+ Server commands resolve the target session in this order:
69
+ 1. `CXTMS_AUTH` env var → PAT token auth (with `CXTMS_SERVER` or `app.yaml` server field)
70
+ 2. `~/.cxtms/<project-dir>/.session.json` → project-scoped OAuth session
71
+ 3. Not logged in → error
72
+
73
+ ## Publish
74
+
75
+ ```bash
76
+ # Publish all modules and workflows from current project
77
+ npx cxtms publish
78
+
79
+ # Publish only a specific feature directory
80
+ npx cxtms publish --feature billing
81
+ npx cxtms publish billing
82
+
83
+ # Publish with explicit org ID
84
+ npx cxtms publish --org 42
85
+ ```
86
+
87
+ Validates all YAML files first, then pushes modules and workflows to the server. Skips files with validation errors and reports results.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: cx-module
3
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
+ Generates schema-valid CargoXplorer app module YAML files (UI screens, forms, grids, routes).
5
+ Use when the user asks to create, modify, or fix a module YAML file, references *-module.yaml files, or asks about UI components/forms/grids/routes in a CX project.
6
+ Not for workflow YAML files, TypeScript code, or non-YAML tasks.
7
7
  argument-hint: <description of what to build>
8
8
  ---
9
9
 
@@ -400,24 +400,7 @@ Reusable select components (e.g., `Countries/Select`, `Ports/Select`) follow thi
400
400
 
401
401
  ## Server Module Commands
402
402
 
403
- ### Deploy / Undeploy
404
-
405
- ```bash
406
- # Deploy a module YAML to the server (creates or updates)
407
- npx cxtms appmodule deploy modules/my-module.yaml
408
-
409
- # Deploy with explicit org ID
410
- npx cxtms appmodule deploy modules/my-module.yaml --org 42
411
-
412
- # Undeploy an app module by UUID
413
- npx cxtms appmodule undeploy <appModuleId>
414
-
415
- # Publish all modules and workflows (validates first)
416
- npx cxtms publish
417
- npx cxtms publish --feature billing
418
- ```
419
-
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).
403
+ Deploy, undeploy, and publish commands are listed in the CLI section at the top of this file. For authentication setup (login, PAT tokens, org management): see [cx-core/ref-cli-auth.md](.claude/skills/cx-core/ref-cli-auth.md)
421
404
 
422
405
  ---
423
406
 
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: cx-workflow
3
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
+ Generates schema-valid CargoXplorer workflow YAML files (standard process and Flow state machine workflows).
5
+ Use when the user asks to create, modify, or fix a workflow YAML file, references workflow/*.yaml files, or asks about workflow tasks/triggers/activities in a CX project.
6
+ Not for module YAML files, TypeScript code, or non-YAML tasks.
7
7
  argument-hint: <description of what to build>
8
8
  ---
9
9
 
@@ -318,21 +318,7 @@ Implicit variable: `iteration` (zero-based).
318
318
 
319
319
  ## Server Workflow Commands
320
320
 
321
- ### Deploy / Undeploy
322
-
323
- ```bash
324
- # Push a workflow YAML to the server (creates or updates)
325
- npx cxtms workflow deploy workflows/my-workflow.yaml
326
-
327
- # Delete a workflow by UUID
328
- npx cxtms workflow undeploy <workflowId>
329
-
330
- # Publish all modules and workflows (validates first)
331
- npx cxtms publish
332
- npx cxtms publish --feature billing
333
- ```
334
-
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).
321
+ Deploy, undeploy, and publish commands are listed in the CLI section at the top of this file. For authentication setup (login, PAT tokens, org management): see [cx-core/ref-cli-auth.md](.claude/skills/cx-core/ref-cli-auth.md)
336
322
 
337
323
  ### Execute
338
324
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cxtms/cx-schema",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Schema validation package for CargoXplorer YAML modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",