@cxtms/cx-schema 1.9.254 → 1.9.256

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cxtms/cx-schema",
3
- "version": "1.9.254",
3
+ "version": "1.9.256",
4
4
  "description": "Schema validation package for CXTMS YAML modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,6 +25,9 @@
25
25
  {
26
26
  "$ref": "caching.json"
27
27
  },
28
+ {
29
+ "$ref": "calendar.json"
30
+ },
28
31
  {
29
32
  "$ref": "charge.json"
30
33
  },
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Calendar Tasks",
4
+ "description": "Issue and import iCalendar feed links",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": { "type": "string", "enum": ["Calendar/IssueLink@1", "Calendar/ImportFeed@1"] },
8
+ "name": { "type": "string" },
9
+ "description": { "type": "string" },
10
+ "conditions": { "type": "array" },
11
+ "continueOnError": { "type": "boolean" },
12
+ "inputs": {
13
+ "type": "object",
14
+ "properties": {
15
+ "organizationId": {}, "calendarId": {}, "label": {},
16
+ "organizationConnectionId": {}, "url": {}, "etag": {}
17
+ },
18
+ "required": ["organizationId"],
19
+ "additionalProperties": true
20
+ },
21
+ "outputs": { "type": "array" }
22
+ },
23
+ "required": ["task", "name", "inputs"],
24
+ "additionalProperties": true
25
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "Transmission Tasks",
4
- "description": "Create, update, and delete transmission records linked to orders",
4
+ "description": "Create, update, and delete transmission records linked to orders or addressed to contacts",
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "task": {
@@ -55,7 +55,11 @@
55
55
  "orderIds": {
56
56
  "type": ["array", "string"],
57
57
  "items": { "type": ["integer", "string"] },
58
- "description": "Order IDs to link (required for Create, at least one)"
58
+ "description": "Optional order IDs to link"
59
+ },
60
+ "contactId": {
61
+ "type": ["integer", "string", "null"],
62
+ "description": "Partner contact used for delivery and channel defaults"
59
63
  },
60
64
  "channel": {
61
65
  "type": "string",
@@ -145,7 +149,31 @@
145
149
  },
146
150
  "payloadRef": {
147
151
  "type": ["string", "null"],
148
- "description": "Reference to stored payload (e.g. blob URI)"
152
+ "description": "Reference to a stored payload; mutually exclusive with payload"
153
+ },
154
+ "payload": {
155
+ "description": "JSON, text, or binary/base64 payload uploaded to storage"
156
+ },
157
+ "payloadContentType": {
158
+ "type": ["string", "null"],
159
+ "description": "Content type override for payload"
160
+ },
161
+ "attachments": {
162
+ "type": ["array", "string", "null"],
163
+ "description": "Attachment inputs; each uses exactly one source",
164
+ "items": {
165
+ "type": "object",
166
+ "properties": {
167
+ "attachmentId": { "type": ["integer", "string", "null"] },
168
+ "attachmentGuid": { "type": ["string", "null"], "format": "uuid" },
169
+ "url": { "type": ["string", "null"] },
170
+ "data": { "description": "Raw bytes or base64 data" },
171
+ "fileName": { "type": ["string", "null"] },
172
+ "contentType": { "type": ["string", "null"] },
173
+ "metadata": { "type": ["object", "string", "null"] }
174
+ },
175
+ "additionalProperties": false
176
+ }
149
177
  },
150
178
  "scheduledAt": {
151
179
  "type": ["string", "null"],
@@ -53,6 +53,8 @@ npx cxtms create workflow <name> --template <template>
53
53
 
54
54
  **All templates** — update `name`, `description`, `tags`, `inputs`, `variables`, replace placeholder steps.
55
55
 
56
+ **Workflow overrides** — active workflows in the same organization with the same case-insensitive `workflow.name` form an override group. Only the highest `workflow.priority` is effective (default 50; lowest workflow ID wins ties). Use a higher priority to replace a base-app workflow without modifying it. The rule covers triggers, schedules, execution by name, MCP surfaces, public API routes, and document workflows; deactivating or deleting the winner restores the next-highest definition.
57
+
56
58
  **`entity-trigger`** — set `entityName`, `eventType` (Modified/Created/Deleted), `position` (Before/After), `conditions` on `changes`. Access entity via `{{ entity.* }}`. Before: use `Validation/Validate@1`. After: cascade changes.
57
59
 
58
60
  **`document`** — keep `file`/`fileName`/`fileDisposition` outputs. Update `Document/Render@1`: `engine` (handlebars/jsrender), `recipe` (chrome-pdf/html-to-xlsx), `content` (HTML template), `data` mapping.
@@ -18,9 +18,21 @@
18
18
  - Notification tasks (Create)
19
19
  - Note tasks (Create, Update, Delete, Import, Export, RenameThread)
20
20
  - AccountingTransaction/ApplyCredit task
21
+ - Calendar feed tasks (IssueLink, ImportFeed)
21
22
 
22
23
  All entity tasks follow the `Namespace/Operation@Version` pattern. Outputs are stored as `ActivityName.StepName.outputKey`.
23
24
 
25
+ ## Calendar feeds
26
+
27
+ | Task | Description |
28
+ |------|-------------|
29
+ | `Calendar/IssueLink@1` | Issue a user or organization-connection iCalendar feed link |
30
+ | `Calendar/ImportFeed@1` | Reconcile an iCalendar feed into a local mirror calendar |
31
+
32
+ `Calendar/IssueLink@1` requires `organizationId` and `calendarId`; optional `label` and `organizationConnectionId` create a labeled user link or an idempotent system link. Outputs: `calendarLinkId`, `url`, `isSystem`. The URL contains the token and must be stored securely.
33
+
34
+ `Calendar/ImportFeed@1` requires `organizationId` and accepts `url`, prior mirror `calendarId`, and prior `etag`. Outputs: `status`, `reason`, `calendarId`, `etag`, `businessHours`, and `availabilityBlocks`. Status is `ok`, `unchanged`, `revoked`, `error`, or `skipped`. Persist the returned calendar ID and ETag after successful calls; do not delete a previous mirror on `error`.
35
+
24
36
  ## PostalCodes
25
37
 
26
38
  | Task | Description |
@@ -479,11 +491,11 @@ Output `result`: `{ added, updated, skipped, failed, total, errors[] }`.
479
491
 
480
492
  | Task | Description |
481
493
  |------|-------------|
482
- | `Transmission/Create` | Create transmission record linked to orders |
494
+ | `Transmission/Create` | Create a transmission, optionally linked to orders or addressed to a contact |
483
495
  | `Transmission/Update` | Update transmission fields (dynamic) |
484
496
  | `Transmission/Delete` | Delete transmission record |
485
497
 
486
- Records inbound/outbound message transmissions (EDI, API, Email, Webhook) linked to orders.
498
+ Records inbound/outbound message transmissions (EDI, API, Email, Webhook). Contact-addressed outbound records can carry stored payloads and attachments and are queued for delivery.
487
499
 
488
500
  ```yaml
489
501
  - task: "Transmission/Create@1"
@@ -492,14 +504,10 @@ Records inbound/outbound message transmissions (EDI, API, Email, Webhook) linked
492
504
  organizationId: "{{ int organizationId }}"
493
505
  transmission:
494
506
  orderIds: "{{ orderIds }}"
495
- channel: "EDI"
496
- direction: "Outbound"
507
+ contactId: "{{ int partnerContactId }}"
497
508
  messageType: "214"
498
- sender: "{{ senderISA }}"
499
- receiver: "{{ receiverISA }}"
500
- status: "Pending"
501
- endpoint: "{{ endpoint }}"
502
- protocol: "SFTP"
509
+ payload: "{{ orderPayload }}"
510
+ payloadContentType: "application/json"
503
511
  outputs:
504
512
  - name: transmission
505
513
  mapping: "transmission"
@@ -527,12 +535,14 @@ Records inbound/outbound message transmissions (EDI, API, Email, Webhook) linked
527
535
  mapping: "success"
528
536
  ```
529
537
 
530
- **Create inputs:** `organizationId` (int, required), `transmission` object — `orderIds` (required, at least one), `channel`, `direction` (Inbound/Outbound), `messageType`, `sender`, `receiver`, `status`, `endpoint`, `protocol`, `correlationId` (auto-generated if omitted), `parentId`, `httpStatus`, `byteSize`, `retryCount`, `maxRetries`, `nextRetryAt`, `errorCode`, `errorMessage`, `customValues`, `headers`, `payloadRef`, `scheduledAt`, `startedAt`, `completedAt`, `durationMs`.
538
+ **Create inputs:** `organizationId` (int, required), `transmission` object — optional `orderIds`; `contactId`; `channel` (required without `contactId`); `direction` (Inbound/Outbound, defaults to Outbound); `messageType`, `sender`, `receiver`, `status`, `endpoint`, `protocol`, `correlationId` (auto-generated if omitted), `parentId`, `httpStatus`, `byteSize`, `retryCount`, `maxRetries`, `nextRetryAt`, `errorCode`, `errorMessage`, `customValues`, `headers`, `payloadRef`, `payload`, `payloadContentType`, `attachments`, `scheduledAt`, `startedAt`, `completedAt`, `durationMs`. `payload` and `payloadRef` are mutually exclusive. Each attachment uses exactly one of `attachmentId`, `attachmentGuid`, `url`, or `data`; URL/data entries require `fileName`.
531
539
 
532
540
  **Create outputs:** `transmission` (full TransmissionDto).
533
541
  **Update inputs:** `organizationId`, `transmissionId`, `transmission` (dynamic partial fields).
534
542
  **Delete outputs:** `success` (boolean).
535
543
 
544
+ Contact-addressed transmissions with a supported transport are queued through the outbox. Transmission entity triggers expose decoded `entity.payload` (within the server preload limit) and `entity.attachments` with download URLs.
545
+
536
546
  **Status enum:** Pending, InProgress, Sent, Received, Delivered, Acknowledged, Rejected, Error, RetryScheduled, Cancelled, Expired, Accepted.
537
547
 
538
548
  ## Accounting Transaction (Additional)