@cxtms/cx-schema 1.7.15 → 1.7.17

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.
@@ -10,7 +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
- For CLI authentication, PAT tokens, org management, and publishing: see [ref-cli-auth.md](ref-cli-auth.md)
13
+ For CLI authentication, PAT tokens, org management, and releasing: see [ref-cli-auth.md](ref-cli-auth.md)
14
14
 
15
15
  ## GraphQL Querying & Audit History
16
16
 
@@ -61,7 +61,7 @@ npx cxtms orgs use <orgId>
61
61
  npx cxtms orgs use
62
62
  ```
63
63
 
64
- The active org is cached in the session file and used by all server commands. **Always pass `--org <id>` on deploy/undeploy/publish/execute/logs commands** to avoid the interactive org picker blocking automation.
64
+ The active org is cached in the session file and used by all server commands. **Always pass `--org <id>` on deploy/undeploy/release/execute/logs commands** to avoid the interactive org picker blocking automation.
65
65
 
66
66
  ## Session Resolution
67
67
 
@@ -88,7 +88,7 @@ Validates all YAML files first, then pushes modules and workflows to the server.
88
88
 
89
89
  ## App Manifest Management
90
90
 
91
- Server-side app manifest operations — install from git, publish changes to git, and list installed apps.
91
+ Server-side app manifest operations — install from git, release changes to git, and list installed apps.
92
92
 
93
93
  ```bash
94
94
  # Install/refresh app from its git repository into the CX server
@@ -65,6 +65,8 @@ Field names as used in workflow expressions: `{{ entity.orderId }}`, `{{ entity.
65
65
  | `orderCarriers` | `[OrderCarrier]` | |
66
66
  | `allTags` | `[OrderAllTagsView]` | View: all tags including from commodities |
67
67
  | `allRelatedOrders` | `[OrderRelatedOrdersView]` | Orders sharing commodities |
68
+ | `attachmentsSummary` | `OrderAttachmentSummaryView?` | DB view: `.totalCount`, `.hasAny` (active attachments) |
69
+ | `notesSummary` | `OrderNoteSummaryView?` | DB view: `.totalCount`, `.hasAny` (non-deleted notes) |
68
70
  | `outgoingLinks` | `[LinkedOrder]` | |
69
71
  | `incomingLinks` | `[LinkedOrder]` | |
70
72
 
@@ -107,6 +109,8 @@ These are virtual fields that filter `orderEntities` by type:
107
109
  | `getChargesByChargeType(chargeType)` | `[Charge]` | Charges filtered by type |
108
110
  | `getOrderSummary(weightUnit, volumeUnit, dimensionsUnit)` | `OrderSummary` | |
109
111
  | `lastTrackingEvent(eventDefinitionName)` | `TrackingEvent` | Most recent |
112
+ | `attachmentsSummary` | `OrderAttachmentSummaryGqlDto` | `.totalCount` (int), `.hasAny` (bool) — batched DataLoader, backed by DB view |
113
+ | `notesSummary` | `OrderNoteSummaryGqlDto` | `.totalCount` (int), `.hasAny` (bool) — batched DataLoader, backed by DB view |
110
114
  | `notesCount(threadFilter)` | `int` | |
111
115
  | `changeHistory(startDate, endDate, maxResults)` | `[ChangeHistory]` | Audit trail |
112
116
 
@@ -0,0 +1,41 @@
1
+ # Organization Entity Reference
2
+
3
+ Core tenant entity. Each organization represents a company/tenant in the system.
4
+
5
+ ## Fields
6
+
7
+ | Field | Type | Notes |
8
+ |-------|------|-------|
9
+ | `organizationId` | `int` | PK |
10
+ | `companyName` | `string` | Required |
11
+ | `addressLine` | `string?` | |
12
+ | `addressLine2` | `string?` | |
13
+ | `cityName` | `string?` | |
14
+ | `countryCode` | `string?` | |
15
+ | `stateCode` | `string?` | |
16
+ | `postalCode` | `string?` | |
17
+ | `phoneNumber` | `string?` | |
18
+ | `faxNumber` | `string?` | |
19
+ | `uniqueId` | `Guid` | Immutable external identifier |
20
+ | `slug` | `string?` | URL-friendly identifier for Public API routes (lowercase, hyphenated) |
21
+ | `isDeleted` | `bool` | Soft delete |
22
+ | `customValues` | `Dictionary?` | jsonb, merged on update |
23
+ | `created` / `lastModified` | `DateTime` | Audit fields (from `AuditableEntity`) |
24
+ | `createdBy` / `lastModifiedBy` | `string` | Audit fields |
25
+
26
+ ## Slug
27
+
28
+ Generated by `SlugGenerator`: lowercased, non-alphanumeric stripped, spaces→hyphens, truncated to max length. Numeric suffix appended for uniqueness.
29
+
30
+ Used by `PublicApiOrganizationResolver` to resolve org by slug or GUID in Public API URLs. Cached 1h sliding.
31
+
32
+ ## Relationships
33
+
34
+ - `AspNetUserEmployees` — users belonging to this organization
35
+
36
+ ## Domain Methods
37
+
38
+ - `ChangeSlug(string?)` — trims and lowercases
39
+ - `ChangeCompanyName(string)`, `ChangeAddressLine(string?)`, etc.
40
+ - `ChangeCustomValues(Dictionary?)` — merges into existing values
41
+ - `DeleteOrganization()` — sets `IsDeleted = true`
@@ -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>` — push all modules and workflows to the server
23
+ - **Publish all**: `npx cxtms publish [--feature <name>] --org <id>` — deploy all modules and workflows to the server
24
24
 
25
25
  ## Generation Workflow
26
26
 
@@ -409,7 +409,7 @@ Reusable select components (e.g., `Countries/Select`, `Ports/Select`) follow thi
409
409
 
410
410
  ## Server Module Commands
411
411
 
412
- 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)
412
+ Deploy, undeploy, and release 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)
413
413
 
414
414
  ### Releasing App to GitHub
415
415
 
@@ -438,11 +438,11 @@ npx cxtms app release -m "Add warehouse locations module" --org 42
438
438
  5. Creates a pull request from the publish branch to the target branch
439
439
  6. Marks published modules and workflows as `hasUnpublishedChanges: false`
440
440
 
441
- **This is a commit-and-push operation** — it commits the current server-side YAML directly to GitHub via the API. No local git repo is involved. The modules and workflows being published are taken from the CX server database, not from local files. The YAML file arguments only identify *which* items to include by their IDs.
441
+ **This is a release-to-git operation** — it commits the current server-side YAML directly to GitHub via the API. No local git repo is involved. The modules and workflows being released are taken from the CX server database, not from local files. The YAML file arguments only identify *which* items to include by their IDs.
442
442
 
443
- **Important:** Modules and workflows must be deployed to the TMS server before they can be published. Use `cxtms appmodule deploy` or `cxtms workflow deploy` first, then `cxtms app release` to commit them to GitHub.
443
+ **Important:** Modules and workflows must be deployed to the TMS server before they can be released. Use `cxtms appmodule deploy` or `cxtms workflow deploy` first, then `cxtms app release` to commit them to GitHub.
444
444
 
445
- **Do NOT run `app release` automatically.** Only publish when the user explicitly requests it. Publishing creates a branch and PR on GitHub, so it should be done once when all changes are ready — not after every deploy.
445
+ **Do NOT run `app release` automatically.** Only release when the user explicitly requests it. Releasing creates a branch and PR on GitHub, so it should be done once when all changes are ready — not after every deploy.
446
446
 
447
447
  **Prerequisites:**
448
448
  - `app.yaml` must exist with a valid `id` field
@@ -288,6 +288,47 @@ children:
288
288
 
289
289
  ---
290
290
 
291
+ ## slot
292
+
293
+ Extension point that renders dynamically registered components targeting a named slot. Enables cross-module UI extensions without modifying the original layout.
294
+
295
+ **Props:**
296
+ | Prop | Type | Default | Description |
297
+ |------|------|---------|-------------|
298
+ | `name` | `string` | — | Slot name to match. Supports templates: `TMS/{{entityType}}/Actions` |
299
+ | `itemTag` | `string` | `React.Fragment` | HTML element to wrap each extension (`div`, `li`, etc.) |
300
+
301
+ **Children:** No — extensions are loaded from the database at runtime.
302
+
303
+ Extension components must define `props.targetSlot` matching the slot name, `props.order` for sort order, and a `layout` object.
304
+
305
+ ```yaml
306
+ # Define a slot extension point
307
+ component: slot
308
+ props:
309
+ name: "TMS/ShipmentDashboard/Tabs"
310
+ ```
311
+
312
+ ```yaml
313
+ # Extension component (registered via another module's appComponents)
314
+ name: "TMS/ShipmentDashboard/TrackingTab"
315
+ props:
316
+ targetSlot: "TMS/ShipmentDashboard/Tabs"
317
+ order: 10
318
+ layout:
319
+ component: tab
320
+ props:
321
+ label: { en-US: "Tracking" }
322
+ children:
323
+ - component: layout
324
+ props:
325
+ component: "TMS/Tracking/Panel"
326
+ ```
327
+
328
+ **Naming convention:** `{Module}/{Entity}/{Location}` (e.g., `TMS/OrderDetail/Actions`)
329
+
330
+ ---
331
+
291
332
  ## line
292
333
 
293
334
  Simple `<hr>` horizontal divider.
@@ -341,7 +341,9 @@ CSS Grid-based timeline with swim lanes, drill-down, and virtual scrolling.
341
341
  | `view` | `day \| week \| month \| year` | `week` | Time view |
342
342
  | `startDate` / `endDate` | `string` | — | Date range |
343
343
  | `eventSources` | `EventSource[]` | — | Event data sources |
344
+ | `eventSources[].query.name` | `string` | `query1`, `query2`... | Source name, used as key in `summaryComponent` `dataSources` |
344
345
  | `eventTemplate` | `ComponentProps` | — | Custom event template |
346
+ | `summaryComponent` | `ComponentProps` | — | Custom component rendered per column in the summary row. Replaces numeric totals when set. |
345
347
  | `options.height` | `string \| number` | `600` | Container height |
346
348
  | `options.cellHeight` | `number` | `60/100` | Cell height (px) |
347
349
  | `options.groupBy` | `string` | — | Field for swim lane grouping |
@@ -352,6 +354,14 @@ CSS Grid-based timeline with swim lanes, drill-down, and virtual scrolling.
352
354
  | `options.showWeekends` | `boolean` | `true` | Show weekends |
353
355
  | `options.showTotalCount` | `boolean` | `false` | Show event totals |
354
356
 
357
+ **Summary component variables** (available when `summaryComponent` is set):
358
+ | Variable | Type | Description |
359
+ |----------|------|-------------|
360
+ | `dataSources` | `Record<string, TimelineEvent[]>` | Per-source events filtered to the column, keyed by `query.name` |
361
+ | `column` | `ColumnDefinition` | Column metadata (`id`, `label`, `date`, `startDate`, `endDate`) |
362
+ | `columnIndex` | `number` | Zero-based column index |
363
+ | `totalCount` | `number` | Total event count for the column across all sources |
364
+
355
365
  **Events:**
356
366
  | Event | Data | Description |
357
367
  |-------|------|-------------|
@@ -397,6 +407,36 @@ props:
397
407
  props: { date: "{{ date }}", assignee: "{{ row }}" }
398
408
  ```
399
409
 
410
+ **Summary component example** (per-source breakdown per column):
411
+ ```yaml
412
+ component: timeline-grid
413
+ props:
414
+ view: week
415
+ options: { height: 600, enableNavigation: true }
416
+ eventSources:
417
+ - query:
418
+ name: ups
419
+ command: "query($s:String!,$e:String!){ upsShipments(start:$s,end:$e){ id date title } }"
420
+ variables: { s: "{{ startDate }}", e: "{{ endDate }}" }
421
+ path: upsShipments
422
+ - query:
423
+ name: fedex
424
+ command: "query($s:String!,$e:String!){ fedexShipments(start:$s,end:$e){ id date title } }"
425
+ variables: { s: "{{ startDate }}", e: "{{ endDate }}" }
426
+ path: fedexShipments
427
+ summaryComponent:
428
+ component: layout
429
+ props:
430
+ direction: column
431
+ children:
432
+ - component: text
433
+ props: { value: "UPS: {{ dataSources.ups.length }}" }
434
+ - component: text
435
+ props: { value: "FedEx: {{ dataSources.fedex.length }}" }
436
+ - component: text
437
+ props: { value: "Total: {{ totalCount }}" }
438
+ ```
439
+
400
440
  ---
401
441
 
402
442
  ## oauth2
@@ -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>` — push all modules and workflows to the server
24
+ - **Publish all**: `npx cxtms publish [--feature <name>] --org <id>` — deploy all modules and workflows to the server
25
25
 
26
26
  ## Generation Workflow
27
27
 
@@ -320,7 +320,7 @@ Implicit variable: `iteration` (zero-based).
320
320
 
321
321
  ## Server Workflow Commands
322
322
 
323
- 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)
323
+ Deploy, undeploy, and release 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)
324
324
 
325
325
  ### Releasing App to GitHub
326
326
 
@@ -349,11 +349,11 @@ npx cxtms app release -m "Add order notification workflow" --org 42
349
349
  5. Creates a pull request from the publish branch to the target branch
350
350
  6. Marks published workflows and modules as `hasUnpublishedChanges: false`
351
351
 
352
- **This is a commit-and-push operation** — it commits the current server-side YAML directly to GitHub via the API. No local git repo is involved. The workflows and modules being published are taken from the CX server database, not from local files. The YAML file arguments only identify *which* items to include by their IDs.
352
+ **This is a release-to-git operation** — it commits the current server-side YAML directly to GitHub via the API. No local git repo is involved. The workflows and modules being released are taken from the CX server database, not from local files. The YAML file arguments only identify *which* items to include by their IDs.
353
353
 
354
- **Important:** Workflows and modules must be deployed to the TMS server before they can be published. Use `cxtms workflow deploy` or `cxtms appmodule deploy` first, then `cxtms app release` to commit them to GitHub.
354
+ **Important:** Workflows and modules must be deployed to the TMS server before they can be released. Use `cxtms workflow deploy` or `cxtms appmodule deploy` first, then `cxtms app release` to commit them to GitHub.
355
355
 
356
- **Do NOT run `app release` automatically.** Only publish when the user explicitly requests it. Publishing creates a branch and PR on GitHub, so it should be done once when all changes are ready — not after every deploy.
356
+ **Do NOT run `app release` automatically.** Only release when the user explicitly requests it. Releasing creates a branch and PR on GitHub, so it should be done once when all changes are ready — not after every deploy.
357
357
 
358
358
  **Prerequisites:**
359
359
  - `app.yaml` must exist with a valid `id` field
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cxtms/cx-schema",
3
- "version": "1.7.15",
3
+ "version": "1.7.17",
4
4
  "description": "Schema validation package for CargoXplorer YAML modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -130,6 +130,10 @@
130
130
  "$ref": "../schemas.json#/definitions/component",
131
131
  "description": "Template for items; receives 'item' context"
132
132
  },
133
+ "summaryComponent": {
134
+ "$ref": "../schemas.json#/definitions/component",
135
+ "description": "Custom component for the summary row. When set, the built-in overall total row is hidden and replaced with this component. Receives aggregated data."
136
+ },
133
137
  "isHidden": {
134
138
  "$ref": "../schemas.json#/definitions/templateExpression",
135
139
  "description": "Boolean expression for conditional rendering"
@@ -115,6 +115,18 @@
115
115
  "isHidden": {
116
116
  "type": "boolean",
117
117
  "description": "Whether column is hidden"
118
+ },
119
+ "enableEdit": {
120
+ "type": "boolean",
121
+ "description": "Enables inline cell editing for this column"
122
+ },
123
+ "editor": {
124
+ "$ref": "#/definitions/component",
125
+ "description": "Component rendered via ComponentRender when enableEdit is true. Uses same pattern as showAs."
126
+ },
127
+ "onEdit": {
128
+ "$ref": "#/definitions/actionsList",
129
+ "description": "Action array executed sequentially when the cell value changes. Receives changedValues and value variables."
118
130
  }
119
131
  }
120
132
  }