@cxtms/cx-schema 1.1.0 → 1.2.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.
- package/.claude/skills/cx-core/SKILL.md +93 -0
- package/.claude/skills/cx-core/ref-entity-accounting.md +173 -0
- package/.claude/skills/cx-core/ref-entity-commodity.md +205 -0
- package/.claude/skills/cx-core/ref-entity-contact.md +153 -0
- package/.claude/skills/cx-core/ref-entity-geography.md +119 -0
- package/.claude/skills/cx-core/ref-entity-job.md +77 -0
- package/.claude/skills/cx-core/ref-entity-order-sub.md +140 -0
- package/.claude/skills/cx-core/ref-entity-order.md +168 -0
- package/.claude/skills/cx-core/ref-entity-rate.md +174 -0
- package/.claude/skills/cx-core/ref-entity-shared.md +147 -0
- package/.claude/skills/cx-core/ref-entity-warehouse.md +110 -0
- package/.claude/skills/cx-module/SKILL.md +402 -0
- package/.claude/skills/cx-module/ref-components-data.md +286 -0
- package/.claude/skills/cx-module/ref-components-display.md +394 -0
- package/.claude/skills/cx-module/ref-components-forms.md +362 -0
- package/.claude/skills/cx-module/ref-components-interactive.md +306 -0
- package/.claude/skills/cx-module/ref-components-layout.md +295 -0
- package/.claude/skills/cx-module/ref-components-specialized.md +427 -0
- package/.claude/skills/cx-workflow/SKILL.md +330 -0
- package/.claude/skills/cx-workflow/ref-accounting.md +66 -0
- package/.claude/skills/cx-workflow/ref-communication.md +161 -0
- package/.claude/skills/cx-workflow/ref-entity.md +162 -0
- package/.claude/skills/cx-workflow/ref-expressions.md +239 -0
- package/.claude/skills/cx-workflow/ref-filetransfer.md +80 -0
- package/.claude/skills/cx-workflow/ref-flow.md +180 -0
- package/.claude/skills/cx-workflow/ref-other.md +120 -0
- package/.claude/skills/cx-workflow/ref-query.md +85 -0
- package/.claude/skills/cx-workflow/ref-utilities.md +192 -0
- package/dist/cli.js +252 -33
- package/dist/cli.js.map +1 -1
- package/package.json +3 -2
- package/schemas/workflows/tasks/action-event.json +65 -0
- package/schemas/workflows/tasks/all.json +126 -26
- package/schemas/workflows/tasks/appmodule.json +56 -0
- package/schemas/workflows/tasks/attachment.json +4 -1
- package/schemas/workflows/tasks/authentication.json +72 -0
- package/schemas/workflows/tasks/caching.json +68 -0
- package/schemas/workflows/tasks/charge.json +3 -1
- package/schemas/workflows/tasks/commodity.json +3 -0
- package/schemas/workflows/tasks/contact-address.json +72 -0
- package/schemas/workflows/tasks/contact-payment-method.json +72 -0
- package/schemas/workflows/tasks/edi.json +65 -0
- package/schemas/workflows/tasks/filetransfer.json +102 -0
- package/schemas/workflows/tasks/flow-transition.json +68 -0
- package/schemas/workflows/tasks/httpRequest.json +23 -0
- package/schemas/workflows/tasks/import.json +64 -0
- package/schemas/workflows/tasks/inventory.json +67 -0
- package/schemas/workflows/tasks/movement.json +54 -0
- package/schemas/workflows/tasks/note.json +59 -0
- package/schemas/workflows/tasks/number.json +65 -0
- package/schemas/workflows/tasks/order.json +8 -1
- package/schemas/workflows/tasks/pdf-document.json +60 -0
- package/schemas/workflows/tasks/user.json +70 -0
- package/scripts/postinstall.js +2 -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,192 @@
|
|
|
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
|
+
**Action events**: When an HTTP request operates on a specific entity (e.g., sending parcel info for an order), enable `actionEvents` in the inputs so the system can track and notify about the request. Include `eventDataExt` with the entity ID to link the event to the entity.
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
- task: "Utilities/HttpRequest@1"
|
|
98
|
+
name: CallCarrierApi
|
|
99
|
+
inputs:
|
|
100
|
+
actionEvents:
|
|
101
|
+
enabled: true
|
|
102
|
+
eventName: "carrier.sendParcelInfo"
|
|
103
|
+
eventDataExt:
|
|
104
|
+
orderId: "{{ inputs.orderId }}"
|
|
105
|
+
url: "{{ carrierConfig?.baseUrl? }}/api/shipments"
|
|
106
|
+
method: POST
|
|
107
|
+
contentType: "application/json"
|
|
108
|
+
body:
|
|
109
|
+
trackingNumber: "{{ Data?.GetOrder?.order?.trackingNumber? }}"
|
|
110
|
+
outputs:
|
|
111
|
+
- name: result
|
|
112
|
+
mapping: "response?.body?"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Map@1
|
|
116
|
+
|
|
117
|
+
Extracts/reshapes data from variables into new variables.
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
- task: "Utilities/Map@1"
|
|
121
|
+
name: MapData
|
|
122
|
+
inputs:
|
|
123
|
+
variables:
|
|
124
|
+
- name: orderNumber
|
|
125
|
+
value: "{{ Data?.GetOrder?.order?.orderNumber? }}"
|
|
126
|
+
- name: customerName
|
|
127
|
+
value: "{{ Data?.GetOrder?.order?.customer?.name? }}"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Template@1
|
|
131
|
+
|
|
132
|
+
Renders a Handlebars template string with data.
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
- task: "Utilities/Template@1"
|
|
136
|
+
name: RenderMessage
|
|
137
|
+
inputs:
|
|
138
|
+
template: "Hello {{name}}, your order {{orderNumber}} is {{status}}."
|
|
139
|
+
data:
|
|
140
|
+
name: "{{ Data?.GetOrder?.order?.customer?.name? }}"
|
|
141
|
+
orderNumber: "{{ Data?.GetOrder?.order?.orderNumber? }}"
|
|
142
|
+
status: "{{ Data?.GetOrder?.order?.status? }}"
|
|
143
|
+
outputs:
|
|
144
|
+
- name: message
|
|
145
|
+
mapping: "result?"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## CsvParse@1
|
|
149
|
+
|
|
150
|
+
Parses CSV content into structured data.
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
- task: "Utilities/CsvParse@1"
|
|
154
|
+
name: ParseCsv
|
|
155
|
+
inputs:
|
|
156
|
+
content: "{{ Data?.DownloadFile?.fileContent? }}"
|
|
157
|
+
delimiter: ","
|
|
158
|
+
hasHeader: true
|
|
159
|
+
outputs:
|
|
160
|
+
- name: rows
|
|
161
|
+
mapping: "rows?"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Export@1
|
|
165
|
+
|
|
166
|
+
Exports data to file format.
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
- task: "Utilities/Export@1"
|
|
170
|
+
name: ExportData
|
|
171
|
+
inputs:
|
|
172
|
+
data: "{{ Data?.GetOrders?.result?.items? }}"
|
|
173
|
+
format: "csv"
|
|
174
|
+
outputs:
|
|
175
|
+
- name: file
|
|
176
|
+
mapping: "file?"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Import@1
|
|
180
|
+
|
|
181
|
+
Imports data from file content.
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
- task: "Utilities/Import@1"
|
|
185
|
+
name: ImportData
|
|
186
|
+
inputs:
|
|
187
|
+
content: "{{ fileContent }}"
|
|
188
|
+
format: "csv"
|
|
189
|
+
outputs:
|
|
190
|
+
- name: data
|
|
191
|
+
mapping: "data?"
|
|
192
|
+
```
|