@cxtms/cx-schema 1.8.0 → 1.8.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 +38 -20
- package/.claude/skills/cx-core/ref-entity-accounting.md +0 -7
- package/.claude/skills/cx-core/ref-entity-commodity.md +0 -12
- package/.claude/skills/cx-core/ref-entity-contact.md +0 -10
- package/.claude/skills/cx-core/ref-entity-geography.md +1 -34
- package/.claude/skills/cx-core/ref-entity-notification.md +85 -0
- package/.claude/skills/cx-core/ref-entity-order-sub.md +7 -13
- package/.claude/skills/cx-core/ref-entity-order.md +1 -14
- package/.claude/skills/cx-core/ref-entity-rate.md +0 -8
- package/.claude/skills/cx-core/ref-entity-shared.md +20 -9
- package/.claude/skills/cx-core/ref-entity-warehouse.md +0 -5
- package/.claude/skills/cx-module/SKILL.md +28 -103
- package/.claude/skills/cx-module/ref-components-data.md +0 -7
- package/.claude/skills/cx-module/ref-components-display.md +0 -17
- package/.claude/skills/cx-module/ref-components-forms.md +2 -7
- package/.claude/skills/cx-module/ref-components-interactive.md +0 -11
- package/.claude/skills/cx-module/ref-components-layout.md +0 -11
- package/.claude/skills/cx-module/ref-components-specialized.md +0 -50
- package/.claude/skills/cx-workflow/SKILL.md +21 -130
- package/.claude/skills/cx-workflow/ref-communication.md +0 -8
- package/.claude/skills/cx-workflow/ref-entity.md +62 -43
- package/.claude/skills/cx-workflow/ref-expressions.md +272 -0
- package/.claude/skills/cx-workflow/ref-flow.md +6 -12
- package/.claude/skills/cx-workflow/ref-other.md +33 -14
- package/.claude/skills/cx-workflow/ref-utilities.md +87 -14
- package/README.md +34 -34
- package/dist/cli.js +166 -2394
- package/dist/cli.js.map +1 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/validator.d.ts +0 -8
- package/dist/validator.d.ts.map +1 -1
- package/dist/validator.js +2 -54
- package/dist/validator.js.map +1 -1
- package/dist/workflowValidator.d.ts +0 -4
- package/dist/workflowValidator.d.ts.map +1 -1
- package/dist/workflowValidator.js +2 -28
- package/dist/workflowValidator.js.map +1 -1
- package/package.json +2 -3
- package/schemas/actions/all.json +2 -1
- package/schemas/actions/clipboard.json +46 -0
- package/schemas/components/appComponent.json +0 -8
- package/schemas/components/module.json +2 -31
- package/schemas/components/timelineGrid.json +0 -4
- package/schemas/schemas.json +0 -12
- package/schemas/workflows/flow/entity.json +19 -0
- package/schemas/workflows/tasks/all.json +9 -0
- package/schemas/workflows/tasks/authentication.json +12 -26
- package/schemas/workflows/tasks/edi.json +93 -1
- package/schemas/workflows/tasks/httpRequest.json +4 -0
- package/schemas/workflows/tasks/order.json +45 -0
- package/schemas/workflows/tasks/resolve-timezone.json +65 -0
- package/schemas/workflows/tasks/transmission.json +1 -1
- package/schemas/workflows/tasks/unzip-file.json +68 -0
- package/schemas/workflows/variable.json +5 -1
- package/schemas/workflows/workflow.json +4 -0
- package/scripts/postinstall.js +1 -1
- package/templates/module-configuration.yaml +89 -23
- package/templates/module-form.yaml +3 -3
- package/templates/module-grid.yaml +3 -3
- package/templates/module-select.yaml +3 -3
- package/templates/module.yaml +2 -3
- package/templates/workflow-api-tracking.yaml +1 -1
- package/templates/workflow-basic.yaml +1 -1
- package/templates/workflow-document.yaml +1 -1
- package/templates/workflow-entity-trigger.yaml +1 -1
- package/templates/workflow-ftp-edi.yaml +1 -1
- package/templates/workflow-ftp-tracking.yaml +1 -1
- package/templates/workflow-mcp-tool.yaml +1 -1
- package/templates/workflow-public-api.yaml +1 -1
- package/templates/workflow-scheduled.yaml +1 -1
- package/templates/workflow-utility.yaml +1 -1
- package/templates/workflow-webhook.yaml +1 -1
- package/templates/workflow.yaml +1 -1
- package/.claude/skills/cx-core/ref-cli-auth.md +0 -120
- package/.claude/skills/cx-core/ref-graphql-query.md +0 -320
- package/.claude/skills/cx-workflow/ref-expressions-ncalc.md +0 -112
- package/.claude/skills/cx-workflow/ref-expressions-template.md +0 -149
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Template Expressions & Value Directives
|
|
2
|
-
|
|
3
|
-
## Contents
|
|
4
|
-
- Template expression syntax `{{ path }}` (in step inputs)
|
|
5
|
-
- Type converters (int, decimal, bool, fromJson, toJson, etc.)
|
|
6
|
-
- Value directives (expression, coalesce, foreach, switch, extends, $raw, $eval, encrypt/decrypt)
|
|
7
|
-
- Property path syntax (dot paths, array indexing, wildcards, filters, projections)
|
|
8
|
-
|
|
9
|
-
There are **two distinct syntaxes** for referencing variables, used in different contexts. This file covers **template expressions** used in step inputs. For NCalc conditions and functions, see [ref-expressions-ncalc.md](ref-expressions-ncalc.md).
|
|
10
|
-
|
|
11
|
-
## Template Expressions: `{{ path }}` (in step inputs)
|
|
12
|
-
|
|
13
|
-
Used in step `inputs` values. Resolves variable paths from scoped variables.
|
|
14
|
-
|
|
15
|
-
```yaml
|
|
16
|
-
inputs:
|
|
17
|
-
orderId: "{{ inputs.orderId }}" # Simple reference
|
|
18
|
-
url: "{{ chopinConfig.baseUrl }}/api/v1" # String interpolation
|
|
19
|
-
order: "{{ Data.GetOrder.order }}" # Raw object (single {{ }})
|
|
20
|
-
name: "Order {{ Data.GetOrder.order.orderNumber }}" # String interpolation (multiple)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**Key behavior**: A single `{{ path }}` returns the **raw object** (preserving type). Multiple `{{ }}` in a string returns string interpolation (each resolved value is `.ToString()`).
|
|
24
|
-
|
|
25
|
-
### Type Converters (prefix in {{ }})
|
|
26
|
-
|
|
27
|
-
```yaml
|
|
28
|
-
organizationId: "{{ int organizationId }}"
|
|
29
|
-
amount: "{{ decimal totalAmount }}"
|
|
30
|
-
isActive: "{{ bool isActive }}"
|
|
31
|
-
flag: "{{ boolOrFalse someFlag }}" # null -> false
|
|
32
|
-
flagOn: "{{ boolOrTrue someFlag }}" # null -> true
|
|
33
|
-
notes: "{{ emptyIfNull notes }}" # null -> ""
|
|
34
|
-
notes: "{{ nullIfEmpty notes }}" # "" or whitespace -> null
|
|
35
|
-
config: "{{ fromJson configJsonString }}" # JSON string -> dict/array
|
|
36
|
-
payload: "{{ toJson someObject }}" # object -> JSON string
|
|
37
|
-
name: "{{ trim value }}"
|
|
38
|
-
search: "{{ luceneString query }}" # escape & quote for Lucene
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
| Converter | Returns | Null handling |
|
|
42
|
-
|-----------|---------|---------------|
|
|
43
|
-
| `string` | `string` | null. Reads `Stream` to string if value is Stream |
|
|
44
|
-
| `int` | `int` | Throws on null |
|
|
45
|
-
| `decimal` | `decimal` | Throws on null |
|
|
46
|
-
| `bool` | `bool` | Throws on null |
|
|
47
|
-
| `boolOrFalse` | `bool` | `false` if null |
|
|
48
|
-
| `boolOrTrue` | `bool` | `true` if null |
|
|
49
|
-
| `datetime` | `DateTime` | Throws on null |
|
|
50
|
-
| `emptyIfNull` | same type | `""` if null, `0` for int?, `0m` for decimal? |
|
|
51
|
-
| `nullIfEmpty` | same type | `null` if empty/whitespace string or empty collection |
|
|
52
|
-
| `luceneString` | `string` | null |
|
|
53
|
-
| `transliterate` | `string` | null (Unicode -> ASCII via Unidecode) |
|
|
54
|
-
| `transliterateUa` | `string` | null (Ukrainian-specific rules) |
|
|
55
|
-
| `fromJson` | `dict` or `array` | null. Empty string -> empty dict |
|
|
56
|
-
| `toJson` | `string` | `""` if null |
|
|
57
|
-
| `trim` | `string` | null |
|
|
58
|
-
| `toLocalTime` | `DateTime` or `string` | null. Syntax: `{{ toLocalTime path 'TimezoneId' 'format?' }}` |
|
|
59
|
-
|
|
60
|
-
### Value Directives (in YAML input mappings)
|
|
61
|
-
|
|
62
|
-
**`expression`** -- Evaluate NCalc expression as a value:
|
|
63
|
-
```yaml
|
|
64
|
-
amount:
|
|
65
|
-
expression: "[price] * [quantity]"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**`coalesce`** -- First non-null value from a list:
|
|
69
|
-
```yaml
|
|
70
|
-
displayName:
|
|
71
|
-
coalesce:
|
|
72
|
-
- "{{ customer.name? }}"
|
|
73
|
-
- "{{ customer.email? }}"
|
|
74
|
-
- "Unknown"
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**`foreach`** (value context) -- Transform collections inline:
|
|
78
|
-
```yaml
|
|
79
|
-
commodities:
|
|
80
|
-
foreach: "sourceCommodities"
|
|
81
|
-
item: "item" # default: "item"
|
|
82
|
-
conditions: "[item.isActive] = true" # optional NCalc filter per item
|
|
83
|
-
continueOnError: false # optional, skip errors
|
|
84
|
-
mapping: # dict -> List<dict>, string -> List<object>
|
|
85
|
-
name: "{{ item.name }}"
|
|
86
|
-
quantity: "{{ item.qty }}"
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**`switch`** (value context) -- Value-based switch (case-insensitive match):
|
|
90
|
-
```yaml
|
|
91
|
-
perLb:
|
|
92
|
-
switch: "{{ contact.commissionTier }}"
|
|
93
|
-
cases:
|
|
94
|
-
"tier1": "{{ rate.customValues.commission_per_lb_tier1 }}"
|
|
95
|
-
"tier2": "{{ rate.customValues.commission_per_lb_tier2 }}"
|
|
96
|
-
default: "0"
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**`extends`** -- Extend/merge an existing object or array:
|
|
100
|
-
```yaml
|
|
101
|
-
orderData:
|
|
102
|
-
extends: "{{ existingOrder }}" # base object or array
|
|
103
|
-
defaultIfNull: {} # fallback if extends is null
|
|
104
|
-
mapping: # dict: merge overrides. array: append items
|
|
105
|
-
status: "Updated"
|
|
106
|
-
notes: "{{ newNotes }}"
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**`$raw`** -- Prevent template parsing (pass as-is):
|
|
110
|
-
```yaml
|
|
111
|
-
template:
|
|
112
|
-
$raw: "This {{ won't }} be parsed"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**`$eval`** -- Parse JSON string then evaluate as template:
|
|
116
|
-
```yaml
|
|
117
|
-
dynamicConfig:
|
|
118
|
-
$eval: "{{ configJsonString }}"
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
**`decrypt`** / **`encrypt`** -- AES-CBC encryption (optional key/IV, has defaults):
|
|
122
|
-
```yaml
|
|
123
|
-
apiKey:
|
|
124
|
-
decrypt:
|
|
125
|
-
encryptedValue: "{{ encryptedApiKey }}"
|
|
126
|
-
key: "{{ encryptionKey }}" # optional Base64 AES key
|
|
127
|
-
initializationVector: "{{ iv }}" # optional Base64 IV
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
## Property Path Syntax (in collection, mapping, variable paths)
|
|
133
|
-
|
|
134
|
-
Used in `collection:` (foreach), `mapping:` (outputs), and variable resolution.
|
|
135
|
-
|
|
136
|
-
| Pattern | Description | Example |
|
|
137
|
-
|---------|-------------|---------|
|
|
138
|
-
| `a.b.c` | Dot-separated nested path | `order.customer.name` |
|
|
139
|
-
| `prop?` | Optional access (null if missing) | `order.customer?.name?` |
|
|
140
|
-
| `list[0]` | Array index | `items[0]` |
|
|
141
|
-
| `list[^1]` | Index from end (last item) | `items[^1]` |
|
|
142
|
-
| `list[*]` | Flatten/wildcard (all items) | `containers[*].commodities` |
|
|
143
|
-
| `list[**]` | Recursive flatten (all depths) | `containerCommodities[**]` |
|
|
144
|
-
| `list[-1]` | Depth filter (leaves only) | `tree[**][-1]` |
|
|
145
|
-
| `list[condition]` | Filter by condition | `items[status=Active]` |
|
|
146
|
-
| `dict['key']` | Dictionary key access | `customValues['myField']` |
|
|
147
|
-
| `list[*].{f1 f2}` | Field selector (projection) | `items[*].{name description}` |
|
|
148
|
-
| `list[*].{alias:source}` | Field selector with alias | `items[*].{id:commodityId}` |
|
|
149
|
-
| `list[*].{alias:_.parent}` | Field selector referencing parent | `items[*].{parentId:_.orderId}` |
|