@cxtms/cx-schema 1.7.17 → 1.8.0
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/ref-entity-geography.md +25 -1
- package/.claude/skills/cx-core/ref-entity-order-sub.md +6 -0
- package/.claude/skills/cx-module/ref-components-display.md +4 -0
- package/.claude/skills/cx-module/ref-components-forms.md +1 -1
- package/.claude/skills/cx-workflow/ref-entity.md +26 -0
- package/.claude/skills/cx-workflow/ref-expressions-ncalc.md +1 -0
- package/.claude/skills/cx-workflow/ref-expressions-template.md +1 -0
- package/.claude/skills/cx-workflow/ref-flow.md +1 -1
- package/.claude/skills/cx-workflow/ref-utilities.md +24 -0
- package/package.json +1 -1
- package/schemas/workflows/tasks/transmission.json +185 -0
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
- Country
|
|
5
5
|
- State
|
|
6
6
|
- City
|
|
7
|
+
- PostalCode
|
|
7
8
|
- Port
|
|
8
9
|
- Vessel
|
|
9
10
|
- CustomCode
|
|
10
11
|
- ModeOfTransportation
|
|
11
12
|
|
|
12
|
-
Country, State, City, Port, Vessel, CustomCode, ModeOfTransportation.
|
|
13
|
+
Country, State, City, PostalCode, Port, Vessel, CustomCode, ModeOfTransportation.
|
|
13
14
|
|
|
14
15
|
## Country
|
|
15
16
|
|
|
@@ -59,6 +60,29 @@ Composite key: `organizationId` + `countryCode` + `stateCode`.
|
|
|
59
60
|
|
|
60
61
|
---
|
|
61
62
|
|
|
63
|
+
## PostalCode
|
|
64
|
+
|
|
65
|
+
PK: `id` (int, auto). Scoped per organization.
|
|
66
|
+
|
|
67
|
+
| Field | Type | Notes |
|
|
68
|
+
|-------|------|-------|
|
|
69
|
+
| `id` | `int` | PK |
|
|
70
|
+
| `organizationId` | `int` | |
|
|
71
|
+
| `code` | `string` | Postal/zip code value |
|
|
72
|
+
| `countryCode` | `string` | FK to Country |
|
|
73
|
+
| `placeName` | `string` | Place/city name |
|
|
74
|
+
| `stateCode` | `string?` | FK to State |
|
|
75
|
+
| `accuracy` | `AccuracyTypes?` | 1=Region, 2=Municipality, 3=Neighborhood, 4=Place, 5=Street, 6=Centroid |
|
|
76
|
+
| `timeZone` | `string?` | IANA timezone ID (e.g., `America/Chicago`) |
|
|
77
|
+
| `customValues` | `Dictionary` | jsonb |
|
|
78
|
+
| `location` | `Point?` | WGS 84 (SRID 4326). X=longitude, Y=latitude |
|
|
79
|
+
|
|
80
|
+
**Navigation:** `country`, `state`
|
|
81
|
+
|
|
82
|
+
**Mutations:** `ChangeCode`, `ChangePlaceName`, `ChangeCoordinates(lat, lng, accuracy)`, `ChangeCountry`/`ChangeCountryCode`, `ChangeState`/`ChangeStateCode`, `ChangeTimeZone`, `ChangeCustomValues`, `ChangeLatitude`, `ChangeLongitude`
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
62
86
|
## Port
|
|
63
87
|
|
|
64
88
|
String-based PK (e.g., UN/LOCODE).
|
|
@@ -94,6 +94,12 @@ Template/type definition for tracking events.
|
|
|
94
94
|
| `triggerConditionFields` | `string?` | |
|
|
95
95
|
| `customValues` | `Dictionary` | jsonb |
|
|
96
96
|
|
|
97
|
+
### GraphQL Resolvers
|
|
98
|
+
|
|
99
|
+
| Resolver | Arguments | Returns | Description |
|
|
100
|
+
|----------|-----------|---------|-------------|
|
|
101
|
+
| `getContact` | `customValuesKey: String!` | `Contact` | Looks up a Contact by ID stored in `customValues[key]` |
|
|
102
|
+
|
|
97
103
|
---
|
|
98
104
|
|
|
99
105
|
## LinkedOrder
|
|
@@ -44,7 +44,11 @@ Full-featured data table with views, filtering, sorting, pagination, and row act
|
|
|
44
44
|
| `defaultView` | `string` | — | Default view name |
|
|
45
45
|
| `defaultPageSize` | `number` | `20` | Rows per page |
|
|
46
46
|
| `enableRefresh` | `boolean` | — | Auto-refresh |
|
|
47
|
+
| `refreshInterval` | `number` | `30000` | Auto-refresh polling interval (ms) |
|
|
47
48
|
| `enableChangeTracking` | `boolean` | `true` | Track data changes |
|
|
49
|
+
| `highlightNew` | `boolean` | `true` | Highlight newly added rows |
|
|
50
|
+
| `highlightUpdated` | `boolean` | `true` | Highlight rows with updated values |
|
|
51
|
+
| `highlightForRefreshes` | `number` | `1` | Per-row TTL — refresh cycles a highlight persists |
|
|
48
52
|
| `onRowClick` | `action[]` | — | Default row click action |
|
|
49
53
|
| `onDataLoad` | `action[]` | — | Action after data loads |
|
|
50
54
|
| `items` | `any` | — | Static data (instead of query) |
|
|
@@ -187,7 +187,7 @@ Polymorphic form field — renders different input types based on `type` prop.
|
|
|
187
187
|
| `onFocus` | Fires on focus |
|
|
188
188
|
| `onKeyPress` | Fires on keypress (data: `key`, `keyCode`) |
|
|
189
189
|
| `onSelectValue` | Fires on select-async value selection |
|
|
190
|
-
| `onEditClick` | Fires when edit icon clicked
|
|
190
|
+
| `onEditClick` | Fires when edit icon clicked. Supported on text and select-async fields. Passes current form values (with optional `valueFieldName`) to the action context |
|
|
191
191
|
|
|
192
192
|
```yaml
|
|
193
193
|
# Text field
|
|
@@ -19,6 +19,32 @@
|
|
|
19
19
|
|
|
20
20
|
All entity tasks follow the `Namespace/Operation@Version` pattern. Outputs are stored as `ActivityName.StepName.outputKey`.
|
|
21
21
|
|
|
22
|
+
## PostalCodes
|
|
23
|
+
|
|
24
|
+
| Task | Description |
|
|
25
|
+
|------|-------------|
|
|
26
|
+
| `PostalCodes/Import@1` | Import postal codes from file URL, stream, or inline data |
|
|
27
|
+
|
|
28
|
+
### PostalCodes/Import@1
|
|
29
|
+
|
|
30
|
+
Imports postal codes (CSV, JSON, Excel). Supports upsert via `matchByFields`.
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
- task: "PostalCodes/Import@1"
|
|
34
|
+
name: ImportPostalCodes
|
|
35
|
+
inputs:
|
|
36
|
+
organizationId: "{{ int inputs.organizationId }}"
|
|
37
|
+
fileUrl: "{{ inputs.fileUrl }}"
|
|
38
|
+
matchByFields: ["code", "countryCode"]
|
|
39
|
+
outputs:
|
|
40
|
+
- name: importResult
|
|
41
|
+
mapping: "result?"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Inputs:** `organizationId` (int, required), `fileUrl` (string?), `fileType` (FileType?), `stream` (Stream?), `postalCodes` (List?), `matchByFields` (string[]?)
|
|
45
|
+
**Outputs:** `result.success`, `result.added`, `result.updated`, `result.errors`, `result.totalProcessed`, `result.hasErrors`
|
|
46
|
+
Input priority: `stream` > `fileUrl` > `postalCodes`. Task catches exceptions and returns them in `result.errors`.
|
|
47
|
+
|
|
22
48
|
## Generic Entity Change
|
|
23
49
|
|
|
24
50
|
| Task | Description |
|
|
@@ -96,6 +96,7 @@ Functions use two iterator variable names:
|
|
|
96
96
|
| `formatDate([date], 'dd/MM/yyyy', 'en-US')` | Format date with culture. Accepts DateTime or string |
|
|
97
97
|
| `dateFromUnix([unixTime])` | Unix timestamp (seconds) -> `DateTimeOffset`. Accepts int, long, decimal, string |
|
|
98
98
|
| `dateToUtc([date])` or `dateToUtc([date], 'en-US')` | Convert to UTC. Optional culture for string parsing |
|
|
99
|
+
| `toLocalTime([date], 'America/Chicago')` | Convert UTC datetime to local time in IANA timezone. Returns `null` if date or timezone is invalid |
|
|
99
100
|
|
|
100
101
|
### Math Functions (NCalc built-in)
|
|
101
102
|
|
|
@@ -55,6 +55,7 @@ search: "{{ luceneString query }}" # escape & quote for Lucene
|
|
|
55
55
|
| `fromJson` | `dict` or `array` | null. Empty string -> empty dict |
|
|
56
56
|
| `toJson` | `string` | `""` if null |
|
|
57
57
|
| `trim` | `string` | null |
|
|
58
|
+
| `toLocalTime` | `DateTime` or `string` | null. Syntax: `{{ toLocalTime path 'TimezoneId' 'format?' }}` |
|
|
58
59
|
|
|
59
60
|
### Value Directives (in YAML input mappings)
|
|
60
61
|
|
|
@@ -93,7 +93,7 @@ states:
|
|
|
93
93
|
|
|
94
94
|
### State Rules
|
|
95
95
|
- **name**: Required, must be unique across all states
|
|
96
|
-
- **isInitial**: At most one state can be initial
|
|
96
|
+
- **isInitial**: At most one state can be initial. When an entity has null status, the engine resolves it to the initial state automatically.
|
|
97
97
|
- **isFinal**: Final states cannot be transition sources
|
|
98
98
|
- **parent**: References another state; parent cannot be initial or final; children inherit parent transitions
|
|
99
99
|
|
|
@@ -28,6 +28,30 @@
|
|
|
28
28
|
| `Utilities/MoveFile@1` | Move file |
|
|
29
29
|
| `Utilities/ValidateReCaptcha` | Validate reCAPTCHA |
|
|
30
30
|
| `Utilities/ValidateHMAC` | Validate HMAC signatures |
|
|
31
|
+
| `Utilities/ResolveTimezone@1` | Resolve IANA timezone and UTC offset from lat/lng coordinates |
|
|
32
|
+
|
|
33
|
+
## ResolveTimezone@1
|
|
34
|
+
|
|
35
|
+
Resolves IANA timezone ID and current UTC offset from geographic coordinates using offline boundary lookup (GeoTimeZone).
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
- task: "Utilities/ResolveTimezone@1"
|
|
39
|
+
name: ResolveTimezone
|
|
40
|
+
inputs:
|
|
41
|
+
latitude: "{{ postalCode.location.y }}"
|
|
42
|
+
longitude: "{{ postalCode.location.x }}"
|
|
43
|
+
outputs:
|
|
44
|
+
- name: tz
|
|
45
|
+
mapping: "timezoneId?"
|
|
46
|
+
- name: offset
|
|
47
|
+
mapping: "utcOffset?"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Inputs:** `latitude` (double/string, required), `longitude` (double/string, required)
|
|
51
|
+
**Outputs:** `timezoneId` (string, e.g. `America/Chicago`), `utcOffset` (double, e.g. `-5`)
|
|
52
|
+
Throws `WorkflowRuntimeException` if lat/lng missing or unparseable.
|
|
53
|
+
|
|
54
|
+
---
|
|
31
55
|
|
|
32
56
|
## SetVariable@1
|
|
33
57
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Transmission Tasks",
|
|
4
|
+
"description": "Create, update, and delete transmission records linked to orders",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"task": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": [
|
|
10
|
+
"Transmission/Create@1",
|
|
11
|
+
"Transmission/Update@1",
|
|
12
|
+
"Transmission/Delete@1"
|
|
13
|
+
],
|
|
14
|
+
"description": "Task type identifier"
|
|
15
|
+
},
|
|
16
|
+
"name": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Step name identifier"
|
|
19
|
+
},
|
|
20
|
+
"description": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Step description"
|
|
23
|
+
},
|
|
24
|
+
"conditions": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"expression": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": ["expression"]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"continueOnError": {
|
|
37
|
+
"type": "boolean"
|
|
38
|
+
},
|
|
39
|
+
"inputs": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "Task inputs — shape depends on task type",
|
|
42
|
+
"properties": {
|
|
43
|
+
"organizationId": {
|
|
44
|
+
"type": ["string", "integer"],
|
|
45
|
+
"description": "Organization ID (required for all task types)"
|
|
46
|
+
},
|
|
47
|
+
"transmissionId": {
|
|
48
|
+
"type": ["string", "integer"],
|
|
49
|
+
"description": "Transmission ID (required for Update and Delete)"
|
|
50
|
+
},
|
|
51
|
+
"transmission": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"description": "Transmission field values (Create: full object; Update: partial/dynamic)",
|
|
54
|
+
"properties": {
|
|
55
|
+
"orderIds": {
|
|
56
|
+
"type": ["array", "string"],
|
|
57
|
+
"items": { "type": ["integer", "string"] },
|
|
58
|
+
"description": "Order IDs to link (required for Create, at least one)"
|
|
59
|
+
},
|
|
60
|
+
"channel": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"maxLength": 20,
|
|
63
|
+
"description": "Communication channel (e.g. EDI, API, EMAIL, WEBHOOK)"
|
|
64
|
+
},
|
|
65
|
+
"direction": {
|
|
66
|
+
"type": ["string", "integer"],
|
|
67
|
+
"enum": ["Inbound", "Outbound", 0, 1],
|
|
68
|
+
"description": "Inbound (0) or Outbound (1)"
|
|
69
|
+
},
|
|
70
|
+
"messageType": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"maxLength": 50,
|
|
73
|
+
"description": "Message type identifier (e.g. 204, 990, 214)"
|
|
74
|
+
},
|
|
75
|
+
"sender": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"maxLength": 100,
|
|
78
|
+
"description": "Sender identifier"
|
|
79
|
+
},
|
|
80
|
+
"receiver": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"maxLength": 100,
|
|
83
|
+
"description": "Receiver identifier"
|
|
84
|
+
},
|
|
85
|
+
"correlationId": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"format": "uuid",
|
|
88
|
+
"description": "Correlation ID (auto-generated if omitted on Create)"
|
|
89
|
+
},
|
|
90
|
+
"parentId": {
|
|
91
|
+
"type": ["integer", "string", "null"],
|
|
92
|
+
"description": "Parent transmission ID for chaining"
|
|
93
|
+
},
|
|
94
|
+
"status": {
|
|
95
|
+
"type": ["string", "integer"],
|
|
96
|
+
"enum": ["Pending", "InProgress", "Sent", "Received", "Delivered", "Acknowledged", "Rejected", "Error", "RetryScheduled", "Cancelled", "Expired", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
97
|
+
"description": "Transmission status"
|
|
98
|
+
},
|
|
99
|
+
"endpoint": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"maxLength": 500,
|
|
102
|
+
"description": "Target endpoint URL"
|
|
103
|
+
},
|
|
104
|
+
"protocol": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"maxLength": 20,
|
|
107
|
+
"description": "Protocol (e.g. HTTPS, SFTP, AS2)"
|
|
108
|
+
},
|
|
109
|
+
"httpStatus": {
|
|
110
|
+
"type": ["integer", "string", "null"],
|
|
111
|
+
"description": "HTTP response status code"
|
|
112
|
+
},
|
|
113
|
+
"byteSize": {
|
|
114
|
+
"type": ["integer", "string", "null"],
|
|
115
|
+
"description": "Payload size in bytes"
|
|
116
|
+
},
|
|
117
|
+
"retryCount": {
|
|
118
|
+
"type": ["integer", "string"],
|
|
119
|
+
"description": "Current retry count (default: 0)"
|
|
120
|
+
},
|
|
121
|
+
"maxRetries": {
|
|
122
|
+
"type": ["integer", "string"],
|
|
123
|
+
"description": "Maximum retry attempts (default: 3)"
|
|
124
|
+
},
|
|
125
|
+
"nextRetryAt": {
|
|
126
|
+
"type": ["string", "null"],
|
|
127
|
+
"description": "Scheduled next retry time (ISO 8601)"
|
|
128
|
+
},
|
|
129
|
+
"errorCode": {
|
|
130
|
+
"type": ["string", "null"],
|
|
131
|
+
"maxLength": 50,
|
|
132
|
+
"description": "Error code"
|
|
133
|
+
},
|
|
134
|
+
"errorMessage": {
|
|
135
|
+
"type": ["string", "null"],
|
|
136
|
+
"description": "Error description"
|
|
137
|
+
},
|
|
138
|
+
"customValues": {
|
|
139
|
+
"type": ["object", "string", "null"],
|
|
140
|
+
"description": "Arbitrary key-value metadata (JSONB)"
|
|
141
|
+
},
|
|
142
|
+
"headers": {
|
|
143
|
+
"type": ["object", "string", "null"],
|
|
144
|
+
"description": "Message headers (JSONB)"
|
|
145
|
+
},
|
|
146
|
+
"payloadRef": {
|
|
147
|
+
"type": ["string", "null"],
|
|
148
|
+
"description": "Reference to stored payload (e.g. blob URI)"
|
|
149
|
+
},
|
|
150
|
+
"scheduledAt": {
|
|
151
|
+
"type": ["string", "null"],
|
|
152
|
+
"description": "Scheduled send time (ISO 8601)"
|
|
153
|
+
},
|
|
154
|
+
"startedAt": {
|
|
155
|
+
"type": ["string", "null"],
|
|
156
|
+
"description": "Processing start time (ISO 8601)"
|
|
157
|
+
},
|
|
158
|
+
"completedAt": {
|
|
159
|
+
"type": ["string", "null"],
|
|
160
|
+
"description": "Processing end time (ISO 8601)"
|
|
161
|
+
},
|
|
162
|
+
"durationMs": {
|
|
163
|
+
"type": ["integer", "string", "null"],
|
|
164
|
+
"description": "Processing duration in milliseconds"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"required": ["organizationId"]
|
|
170
|
+
},
|
|
171
|
+
"outputs": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"items": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"properties": {
|
|
176
|
+
"name": { "type": "string" },
|
|
177
|
+
"mapping": { "type": "string" }
|
|
178
|
+
},
|
|
179
|
+
"required": ["name", "mapping"]
|
|
180
|
+
},
|
|
181
|
+
"description": "Create outputs: transmission (TransmissionDto). Delete outputs: success (boolean)."
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"required": ["task", "name", "inputs"]
|
|
185
|
+
}
|