@cxtms/cx-schema 1.1.0 → 1.1.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.
Files changed (29) hide show
  1. package/.claude/skills/cx-core/SKILL.md +93 -0
  2. package/.claude/skills/cx-core/ref-entity-accounting.md +173 -0
  3. package/.claude/skills/cx-core/ref-entity-commodity.md +205 -0
  4. package/.claude/skills/cx-core/ref-entity-contact.md +153 -0
  5. package/.claude/skills/cx-core/ref-entity-geography.md +119 -0
  6. package/.claude/skills/cx-core/ref-entity-job.md +77 -0
  7. package/.claude/skills/cx-core/ref-entity-order-sub.md +140 -0
  8. package/.claude/skills/cx-core/ref-entity-order.md +168 -0
  9. package/.claude/skills/cx-core/ref-entity-rate.md +174 -0
  10. package/.claude/skills/cx-core/ref-entity-shared.md +147 -0
  11. package/.claude/skills/cx-core/ref-entity-warehouse.md +110 -0
  12. package/.claude/skills/cx-module/SKILL.md +402 -0
  13. package/.claude/skills/cx-module/ref-components-data.md +286 -0
  14. package/.claude/skills/cx-module/ref-components-display.md +394 -0
  15. package/.claude/skills/cx-module/ref-components-forms.md +362 -0
  16. package/.claude/skills/cx-module/ref-components-interactive.md +306 -0
  17. package/.claude/skills/cx-module/ref-components-layout.md +295 -0
  18. package/.claude/skills/cx-module/ref-components-specialized.md +427 -0
  19. package/.claude/skills/cx-workflow/SKILL.md +330 -0
  20. package/.claude/skills/cx-workflow/ref-accounting.md +66 -0
  21. package/.claude/skills/cx-workflow/ref-communication.md +161 -0
  22. package/.claude/skills/cx-workflow/ref-entity.md +162 -0
  23. package/.claude/skills/cx-workflow/ref-expressions.md +239 -0
  24. package/.claude/skills/cx-workflow/ref-filetransfer.md +80 -0
  25. package/.claude/skills/cx-workflow/ref-flow.md +180 -0
  26. package/.claude/skills/cx-workflow/ref-other.md +120 -0
  27. package/.claude/skills/cx-workflow/ref-query.md +85 -0
  28. package/.claude/skills/cx-workflow/ref-utilities.md +171 -0
  29. package/package.json +3 -2
@@ -0,0 +1,120 @@
1
+ # Other Tasks Reference
2
+
3
+ ## User & Auth
4
+
5
+ | Task | Description |
6
+ |------|-------------|
7
+ | `User/Create` | Create user account |
8
+ | `User/Update` | Update user |
9
+ | `User/Delete` | Delete user |
10
+ | `User/GetVerificationCode` | Get phone verification code |
11
+ | `User/GetEmailVerificationCode` | Get email verification code |
12
+ | `User/GetResetPasswordToken` | Get password reset token |
13
+ | `Authentication/OAuth2` | Execute OAuth2 authentication flow |
14
+
15
+ ```yaml
16
+ - task: "Authentication/OAuth2"
17
+ name: Authenticate
18
+ inputs:
19
+ provider: "{{ oauthConfig.provider }}"
20
+ clientId: "{{ oauthConfig.clientId }}"
21
+ clientSecret: "{{ oauthConfig.clientSecret }}"
22
+ tokenUrl: "{{ oauthConfig.tokenUrl }}"
23
+ outputs:
24
+ - name: token
25
+ mapping: "accessToken"
26
+ ```
27
+
28
+ ## Caching
29
+
30
+ | Task | Description |
31
+ |------|-------------|
32
+ | `Caching/SetCache` | Store value in in-memory cache |
33
+ | `Caching/GetCache` | Retrieve value from cache |
34
+
35
+ ```yaml
36
+ - task: "Caching/SetCache@1"
37
+ name: CacheRate
38
+ inputs:
39
+ key: "rate-{{ inputs.carrierId }}"
40
+ value: "{{ Data.GetRate.rate }}"
41
+ ttl: 3600
42
+ ```
43
+
44
+ ```yaml
45
+ - task: "Caching/GetCache@1"
46
+ name: GetCachedRate
47
+ inputs:
48
+ key: "rate-{{ inputs.carrierId }}"
49
+ outputs:
50
+ - name: rate
51
+ mapping: "value"
52
+ ```
53
+
54
+ ## EDI & Structured File Parsing
55
+
56
+ | Task | Description |
57
+ |------|-------------|
58
+ | `EDI/Parse` | Parse EDI documents (X12, EDIFACT) |
59
+ | `StructuredFile/Parse` | Parse structured files |
60
+
61
+ ```yaml
62
+ - task: "EDI/Parse@1"
63
+ name: ParseEdi
64
+ inputs:
65
+ content: "{{ Transfer.Download.content }}"
66
+ format: "X12"
67
+ outputs:
68
+ - name: parsed
69
+ mapping: "document"
70
+ ```
71
+
72
+ ## Flow
73
+
74
+ | Task | Description |
75
+ |------|-------------|
76
+ | `Flow/Transition` | Trigger a Flow state transition programmatically |
77
+
78
+ ```yaml
79
+ - task: "Flow/Transition@1"
80
+ name: TransitionOrder
81
+ inputs:
82
+ entityName: "Order"
83
+ entityId: "{{ inputs.orderId }}"
84
+ transition: "approve"
85
+ ```
86
+
87
+ ## Notes
88
+
89
+ | Task | Description |
90
+ |------|-------------|
91
+ | `Note/Create` | Create a note |
92
+ | `Note/Update` | Update a note |
93
+ | `Note/Delete` | Delete a note |
94
+ | `NoteThread/Rename` | Rename note thread |
95
+ | `Notes/Import` | Bulk import notes |
96
+ | `Notes/Export` | Bulk export notes |
97
+
98
+ ## App Module
99
+
100
+ | Task | Description |
101
+ |------|-------------|
102
+ | `AppModule/Create` | Create app module |
103
+ | `AppModule/Update` | Update app module |
104
+ | `AppModule/Delete` | Delete app module |
105
+
106
+ ## Action Events
107
+
108
+ | Task | Description |
109
+ |------|-------------|
110
+ | `ActionEvent/Create` | Create action event (triggers UI notifications or webhook) |
111
+
112
+ ```yaml
113
+ - task: "ActionEvent/Create"
114
+ name: NotifyUser
115
+ inputs:
116
+ eventName: "OrderStatusChanged"
117
+ data:
118
+ orderId: "{{ inputs.orderId }}"
119
+ newStatus: "{{ Data.GetOrder.order.status }}"
120
+ ```
@@ -0,0 +1,85 @@
1
+ # Query, Validation & Workflow Tasks Reference
2
+
3
+ ## Query/GraphQL
4
+
5
+ Executes internal GraphQL queries against the CX backend. The query runs via MediatR to the internal GraphQL engine.
6
+
7
+ ```yaml
8
+ - task: "Query/GraphQL"
9
+ name: GetOrder
10
+ inputs:
11
+ query: |
12
+ query($organizationId: Int!, $orderId: Int!) {
13
+ order(organizationId: $organizationId, orderId: $orderId) {
14
+ orderId
15
+ orderNumber
16
+ status
17
+ customer {
18
+ contactId
19
+ name
20
+ }
21
+ }
22
+ }
23
+ variables:
24
+ organizationId: "{{ organizationId }}"
25
+ orderId: "{{ inputs.orderId }}"
26
+ outputs:
27
+ - name: order
28
+ mapping: "order"
29
+ ```
30
+
31
+ The query result is a dictionary. The `mapping` path extracts from the result. Output stored at `ActivityName.GetOrder.order`.
32
+
33
+ **Notes**:
34
+ - `organizationId` is always available as a system variable
35
+ - Variables support template expressions: `"{{ int organizationId }}"`
36
+ - Multiple queries can be in one step (returns merged results)
37
+
38
+ ## Validation/Validate@1
39
+
40
+ Validates data against rules. Commonly used in Before entity triggers to block invalid changes.
41
+
42
+ ```yaml
43
+ - task: "Validation/Validate@1"
44
+ name: ValidateOrder
45
+ inputs:
46
+ rules:
47
+ - field: "status"
48
+ condition: "[Data.GetOrder.order.status] != 'Cancelled'"
49
+ message: "Cannot modify cancelled orders"
50
+ - field: "amount"
51
+ condition: "[Data.GetOrder.order.amount] > 0"
52
+ message: "Amount must be positive"
53
+ ```
54
+
55
+ If validation fails, execution stops and error is returned to the caller.
56
+
57
+ ## Workflow/Execute
58
+
59
+ Executes a child workflow. Can run sync (wait for result) or async (fire and forget).
60
+
61
+ ```yaml
62
+ - task: "Workflow/Execute@1"
63
+ name: RunChild
64
+ inputs:
65
+ workflowId: "<uuid>"
66
+ workflowInputs:
67
+ orderId: "{{ inputs.orderId }}"
68
+ customerId: "{{ Data.GetOrder.order.customer.contactId }}"
69
+ ```
70
+
71
+ The child workflow's outputs are available as step outputs: `ActivityName.RunChild.outputName`.
72
+
73
+ **Circular call detection**: The executor maintains a call stack and throws if a workflow calls itself recursively.
74
+
75
+ ## Workflow/Create, Workflow/Update, Workflow/Delete
76
+
77
+ CRUD operations on workflow definitions (not executions). Rarely used in standard workflows.
78
+
79
+ ```yaml
80
+ - task: "Workflow/Create"
81
+ name: CreateWorkflow
82
+ inputs:
83
+ name: "Generated Workflow"
84
+ document: "{{ workflowYaml }}"
85
+ ```
@@ -0,0 +1,171 @@
1
+ # Utilities Tasks Reference
2
+
3
+ ## Available Tasks
4
+
5
+ | Task | Description |
6
+ |------|-------------|
7
+ | `Utilities/SetVariable@1` | Set variables in workflow scope (activity + global) |
8
+ | `Utilities/Log@1` | Log all task variables to workflow logger |
9
+ | `Utilities/Error@1` | Throw a workflow error with message |
10
+ | `Utilities/HttpRequest@1` | HTTP request (GET/POST/PUT/PATCH/DELETE) |
11
+ | `Utilities/Map@1` | Map/extract variables from inputs |
12
+ | `Utilities/Template@1` | Handlebars template rendering |
13
+ | `Utilities/Import@1` | Import data |
14
+ | `Utilities/Export@1` | Export data |
15
+ | `Utilities/CsvParse@1` | Parse CSV content |
16
+ | `Utilities/MoveFile@1` | Move file |
17
+ | `Utilities/ValidateReCaptcha` | Validate reCAPTCHA |
18
+ | `Utilities/ValidateHMAC` | Validate HMAC signatures |
19
+
20
+ ## SetVariable@1
21
+
22
+ Sets variables directly into both activity and global scope. No outputs — the side effect IS the variable setting.
23
+
24
+ ```yaml
25
+ - task: "Utilities/SetVariable@1"
26
+ name: SetResult
27
+ inputs:
28
+ variables:
29
+ - name: processResult
30
+ value:
31
+ success: true
32
+ orderId: "{{ inputs.orderId }}"
33
+ - name: hasMore
34
+ value:
35
+ expression: "[offset] < [Data?.FetchPage?.result?.totalCount?]"
36
+ ```
37
+
38
+ Each variable entry has `name` (string) and `value` (any type, supports expression directives).
39
+
40
+ ## Log@1
41
+
42
+ Logs all task variables (everything in the step's scoped variables) to the workflow file logger.
43
+
44
+ ```yaml
45
+ - task: "Utilities/Log@1"
46
+ name: LogInfo
47
+ inputs:
48
+ message: "Processing order: {{ Data?.GetOrder?.order?.orderNumber? }}"
49
+ level: Information
50
+ ```
51
+
52
+ Levels: `Debug`, `Information`, `Warning`, `Error`.
53
+
54
+ ## Error@1
55
+
56
+ Throws a workflow error that halts execution (unless `continueOnError: true` on a parent step).
57
+
58
+ ```yaml
59
+ - task: "Utilities/Error@1"
60
+ name: ThrowValidationError
61
+ conditions:
62
+ - expression: "isNullOrEmpty([Data?.GetOrder?.order?]) = true"
63
+ inputs:
64
+ message: "Order not found: {{ inputs.orderId }}"
65
+ ```
66
+
67
+ ## HttpRequest@1
68
+
69
+ Performs HTTP requests to external APIs.
70
+
71
+ ```yaml
72
+ - task: "Utilities/HttpRequest@1"
73
+ name: CallApi
74
+ inputs:
75
+ url: "{{ apiBaseUrl }}/api/v1/orders"
76
+ method: POST
77
+ contentType: "application/json"
78
+ headers:
79
+ - name: "Authorization"
80
+ value: "Bearer {{ apiToken }}"
81
+ body:
82
+ orderId: "{{ inputs.orderId }}"
83
+ outputs:
84
+ - name: result
85
+ mapping: "response?.body?"
86
+ ```
87
+
88
+ **Response structure**: The task returns a `Dictionary<string, object>` (case-insensitive) with key `response`. The response contains `StatusCode`, `Headers`, and `Body` (PascalCase in C#, but access is case-insensitive). Use `response?.body?` to get the parsed body. You can drill deeper: `response?.body?.output?`, `response?.body?.items?[0]?`.
89
+
90
+ **Case sensitivity**: Variable paths go through `Dictionary<string, object>(StringComparer.OrdinalIgnoreCase)` — so `body` and `Body` both work. Convention: use lowercase `body`.
91
+
92
+ Response available at `ActivityName?.CallApi?.result?`.
93
+
94
+ ## Map@1
95
+
96
+ Extracts/reshapes data from variables into new variables.
97
+
98
+ ```yaml
99
+ - task: "Utilities/Map@1"
100
+ name: MapData
101
+ inputs:
102
+ variables:
103
+ - name: orderNumber
104
+ value: "{{ Data?.GetOrder?.order?.orderNumber? }}"
105
+ - name: customerName
106
+ value: "{{ Data?.GetOrder?.order?.customer?.name? }}"
107
+ ```
108
+
109
+ ## Template@1
110
+
111
+ Renders a Handlebars template string with data.
112
+
113
+ ```yaml
114
+ - task: "Utilities/Template@1"
115
+ name: RenderMessage
116
+ inputs:
117
+ template: "Hello {{name}}, your order {{orderNumber}} is {{status}}."
118
+ data:
119
+ name: "{{ Data?.GetOrder?.order?.customer?.name? }}"
120
+ orderNumber: "{{ Data?.GetOrder?.order?.orderNumber? }}"
121
+ status: "{{ Data?.GetOrder?.order?.status? }}"
122
+ outputs:
123
+ - name: message
124
+ mapping: "result?"
125
+ ```
126
+
127
+ ## CsvParse@1
128
+
129
+ Parses CSV content into structured data.
130
+
131
+ ```yaml
132
+ - task: "Utilities/CsvParse@1"
133
+ name: ParseCsv
134
+ inputs:
135
+ content: "{{ Data?.DownloadFile?.fileContent? }}"
136
+ delimiter: ","
137
+ hasHeader: true
138
+ outputs:
139
+ - name: rows
140
+ mapping: "rows?"
141
+ ```
142
+
143
+ ## Export@1
144
+
145
+ Exports data to file format.
146
+
147
+ ```yaml
148
+ - task: "Utilities/Export@1"
149
+ name: ExportData
150
+ inputs:
151
+ data: "{{ Data?.GetOrders?.result?.items? }}"
152
+ format: "csv"
153
+ outputs:
154
+ - name: file
155
+ mapping: "file?"
156
+ ```
157
+
158
+ ## Import@1
159
+
160
+ Imports data from file content.
161
+
162
+ ```yaml
163
+ - task: "Utilities/Import@1"
164
+ name: ImportData
165
+ inputs:
166
+ content: "{{ fileContent }}"
167
+ format: "csv"
168
+ outputs:
169
+ - name: data
170
+ mapping: "data?"
171
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cxtms/cx-schema",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Schema validation package for CargoXplorer YAML modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,7 +31,8 @@
31
31
  "dist",
32
32
  "schemas",
33
33
  "scripts",
34
- "templates"
34
+ "templates",
35
+ ".claude"
35
36
  ],
36
37
  "dependencies": {
37
38
  "ajv": "^8.12.0",