@cxtms/cx-schema 1.1.1 → 1.3.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.
Files changed (39) hide show
  1. package/.claude/skills/cx-core/ref-entity-commodity.md +22 -0
  2. package/.claude/skills/cx-workflow/SKILL.md +2 -2
  3. package/.claude/skills/cx-workflow/ref-entity.md +30 -1
  4. package/.claude/skills/cx-workflow/ref-expressions.md +3 -0
  5. package/.claude/skills/cx-workflow/ref-utilities.md +21 -0
  6. package/dist/cli.js +399 -88
  7. package/dist/cli.js.map +1 -1
  8. package/dist/extractUtils.d.ts +11 -0
  9. package/dist/extractUtils.d.ts.map +1 -0
  10. package/dist/extractUtils.js +19 -0
  11. package/dist/extractUtils.js.map +1 -0
  12. package/dist/validator.js +2 -2
  13. package/dist/validator.js.map +1 -1
  14. package/dist/workflowValidator.js +2 -2
  15. package/dist/workflowValidator.js.map +1 -1
  16. package/package.json +5 -5
  17. package/schemas/workflows/tasks/action-event.json +65 -0
  18. package/schemas/workflows/tasks/all.json +126 -26
  19. package/schemas/workflows/tasks/appmodule.json +56 -0
  20. package/schemas/workflows/tasks/attachment.json +4 -1
  21. package/schemas/workflows/tasks/authentication.json +72 -0
  22. package/schemas/workflows/tasks/caching.json +68 -0
  23. package/schemas/workflows/tasks/charge.json +3 -1
  24. package/schemas/workflows/tasks/commodity.json +3 -0
  25. package/schemas/workflows/tasks/contact-address.json +72 -0
  26. package/schemas/workflows/tasks/contact-payment-method.json +72 -0
  27. package/schemas/workflows/tasks/edi.json +65 -0
  28. package/schemas/workflows/tasks/filetransfer.json +102 -0
  29. package/schemas/workflows/tasks/flow-transition.json +68 -0
  30. package/schemas/workflows/tasks/httpRequest.json +23 -0
  31. package/schemas/workflows/tasks/import.json +64 -0
  32. package/schemas/workflows/tasks/inventory.json +67 -0
  33. package/schemas/workflows/tasks/movement.json +54 -0
  34. package/schemas/workflows/tasks/note.json +59 -0
  35. package/schemas/workflows/tasks/number.json +65 -0
  36. package/schemas/workflows/tasks/order.json +8 -1
  37. package/schemas/workflows/tasks/pdf-document.json +60 -0
  38. package/schemas/workflows/tasks/user.json +70 -0
  39. package/scripts/postinstall.js +3 -3
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "File Transfer Tasks",
4
+ "description": "SFTP/FTP file transfer operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "FileTransfer/Connect@1",
11
+ "FileTransfer/Disconnect@1",
12
+ "FileTransfer/ListFiles@1",
13
+ "FileTransfer/DownloadFile@1",
14
+ "FileTransfer/UploadFile@1",
15
+ "FileTransfer/MoveFile@1",
16
+ "FileTransfer/DeleteFile@1"
17
+ ],
18
+ "description": "Task type identifier"
19
+ },
20
+ "name": {
21
+ "type": "string",
22
+ "description": "Step name identifier"
23
+ },
24
+ "description": {
25
+ "type": "string",
26
+ "description": "Step description"
27
+ },
28
+ "conditions": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "properties": {
33
+ "expression": { "type": "string" }
34
+ },
35
+ "required": ["expression"]
36
+ }
37
+ },
38
+ "continueOnError": {
39
+ "type": "boolean"
40
+ },
41
+ "inputs": {
42
+ "type": "object",
43
+ "description": "File transfer operation inputs",
44
+ "properties": {
45
+ "connection": {
46
+ "type": "string",
47
+ "description": "Connection reference from Connect step"
48
+ },
49
+ "host": {
50
+ "type": "string",
51
+ "description": "Remote host (for Connect)"
52
+ },
53
+ "port": {
54
+ "type": ["string", "integer"],
55
+ "description": "Remote port (for Connect)"
56
+ },
57
+ "username": {
58
+ "type": "string",
59
+ "description": "Username (for Connect)"
60
+ },
61
+ "password": {
62
+ "type": "string",
63
+ "description": "Password (for Connect)"
64
+ },
65
+ "protocol": {
66
+ "type": "string",
67
+ "description": "Protocol: sftp, ftp, ftps"
68
+ },
69
+ "path": {
70
+ "type": "string",
71
+ "description": "Remote file/directory path"
72
+ },
73
+ "sourcePath": {
74
+ "type": "string",
75
+ "description": "Source path (for MoveFile)"
76
+ },
77
+ "destinationPath": {
78
+ "type": "string",
79
+ "description": "Destination path (for MoveFile)"
80
+ },
81
+ "content": {
82
+ "type": "string",
83
+ "description": "File content (for UploadFile)"
84
+ }
85
+ },
86
+ "additionalProperties": true
87
+ },
88
+ "outputs": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "object",
92
+ "properties": {
93
+ "name": { "type": "string" },
94
+ "mapping": { "type": "string" }
95
+ },
96
+ "required": ["name", "mapping"]
97
+ }
98
+ }
99
+ },
100
+ "required": ["task"],
101
+ "additionalProperties": true
102
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Flow Transition Task",
4
+ "description": "Trigger a Flow state transition programmatically",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "Flow/Transition@1"
11
+ ],
12
+ "description": "Task type identifier"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "description": "Step name identifier"
17
+ },
18
+ "description": {
19
+ "type": "string",
20
+ "description": "Step description"
21
+ },
22
+ "conditions": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "expression": { "type": "string" }
28
+ },
29
+ "required": ["expression"]
30
+ }
31
+ },
32
+ "continueOnError": {
33
+ "type": "boolean"
34
+ },
35
+ "inputs": {
36
+ "type": "object",
37
+ "description": "Flow transition inputs",
38
+ "properties": {
39
+ "entityName": {
40
+ "type": "string",
41
+ "description": "Entity type name"
42
+ },
43
+ "entityId": {
44
+ "type": "string",
45
+ "description": "Entity ID"
46
+ },
47
+ "transition": {
48
+ "type": "string",
49
+ "description": "Transition name to trigger"
50
+ }
51
+ },
52
+ "additionalProperties": true
53
+ },
54
+ "outputs": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "object",
58
+ "properties": {
59
+ "name": { "type": "string" },
60
+ "mapping": { "type": "string" }
61
+ },
62
+ "required": ["name", "mapping"]
63
+ }
64
+ }
65
+ },
66
+ "required": ["task"],
67
+ "additionalProperties": true
68
+ }
@@ -82,6 +82,29 @@
82
82
  },
83
83
  "description": "Retry configuration"
84
84
  },
85
+ "responseContentType": {
86
+ "type": "string",
87
+ "description": "Expected response content type (e.g., application/pdf, application/json)"
88
+ },
89
+ "actionEvents": {
90
+ "type": "object",
91
+ "description": "Enable action events when the request operates on a specific entity",
92
+ "properties": {
93
+ "enabled": {
94
+ "type": "boolean",
95
+ "description": "Enable action event tracking"
96
+ },
97
+ "eventName": {
98
+ "type": "string",
99
+ "description": "Event name identifier (e.g., carrier.sendParcelInfo)"
100
+ },
101
+ "eventDataExt": {
102
+ "type": "object",
103
+ "description": "Extended event data linking to entity (e.g., orderId)",
104
+ "additionalProperties": true
105
+ }
106
+ }
107
+ },
85
108
  "cache": {
86
109
  "type": "object",
87
110
  "properties": {
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Import Tasks",
4
+ "description": "Data import operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "Utilities/Import@1"
11
+ ],
12
+ "description": "Task type identifier"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "description": "Step name identifier"
17
+ },
18
+ "description": {
19
+ "type": "string",
20
+ "description": "Step description"
21
+ },
22
+ "conditions": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "expression": { "type": "string" }
28
+ },
29
+ "required": ["expression"]
30
+ }
31
+ },
32
+ "continueOnError": {
33
+ "type": "boolean"
34
+ },
35
+ "inputs": {
36
+ "type": "object",
37
+ "description": "Import operation inputs",
38
+ "properties": {
39
+ "content": {
40
+ "type": "string",
41
+ "description": "File content to import"
42
+ },
43
+ "format": {
44
+ "type": "string",
45
+ "description": "Import format (e.g., csv)"
46
+ }
47
+ },
48
+ "additionalProperties": true
49
+ },
50
+ "outputs": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "object",
54
+ "properties": {
55
+ "name": { "type": "string" },
56
+ "mapping": { "type": "string" }
57
+ },
58
+ "required": ["name", "mapping"]
59
+ }
60
+ }
61
+ },
62
+ "required": ["task"],
63
+ "additionalProperties": true
64
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Inventory Tasks",
4
+ "description": "Inventory item CRUD operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "InventoryItem/Create",
11
+ "InventoryItem/Update",
12
+ "InventoryItem/Delete"
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": { "type": "string" }
30
+ },
31
+ "required": ["expression"]
32
+ }
33
+ },
34
+ "continueOnError": {
35
+ "type": "boolean"
36
+ },
37
+ "inputs": {
38
+ "type": "object",
39
+ "description": "Inventory item operation inputs",
40
+ "properties": {
41
+ "inventoryItemId": {
42
+ "type": "string",
43
+ "description": "Inventory item ID"
44
+ },
45
+ "entity": {
46
+ "type": "object",
47
+ "description": "Inventory item entity data",
48
+ "additionalProperties": true
49
+ }
50
+ },
51
+ "additionalProperties": true
52
+ },
53
+ "outputs": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "properties": {
58
+ "name": { "type": "string" },
59
+ "mapping": { "type": "string" }
60
+ },
61
+ "required": ["name", "mapping"]
62
+ }
63
+ }
64
+ },
65
+ "required": ["task"],
66
+ "additionalProperties": true
67
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Movement Tasks",
4
+ "description": "Cargo movement operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "Movement/Create"
11
+ ],
12
+ "description": "Task type identifier"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "description": "Step name identifier"
17
+ },
18
+ "description": {
19
+ "type": "string",
20
+ "description": "Step description"
21
+ },
22
+ "conditions": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "expression": { "type": "string" }
28
+ },
29
+ "required": ["expression"]
30
+ }
31
+ },
32
+ "continueOnError": {
33
+ "type": "boolean"
34
+ },
35
+ "inputs": {
36
+ "type": "object",
37
+ "description": "Movement operation inputs",
38
+ "additionalProperties": true
39
+ },
40
+ "outputs": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "properties": {
45
+ "name": { "type": "string" },
46
+ "mapping": { "type": "string" }
47
+ },
48
+ "required": ["name", "mapping"]
49
+ }
50
+ }
51
+ },
52
+ "required": ["task"],
53
+ "additionalProperties": true
54
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Note Tasks",
4
+ "description": "Note and note thread operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "Note/Create",
11
+ "Note/Update",
12
+ "Note/Delete",
13
+ "NoteThread/Rename",
14
+ "Notes/Import",
15
+ "Notes/Export"
16
+ ],
17
+ "description": "Task type identifier"
18
+ },
19
+ "name": {
20
+ "type": "string",
21
+ "description": "Step name identifier"
22
+ },
23
+ "description": {
24
+ "type": "string",
25
+ "description": "Step description"
26
+ },
27
+ "conditions": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "expression": { "type": "string" }
33
+ },
34
+ "required": ["expression"]
35
+ }
36
+ },
37
+ "continueOnError": {
38
+ "type": "boolean"
39
+ },
40
+ "inputs": {
41
+ "type": "object",
42
+ "description": "Note operation inputs",
43
+ "additionalProperties": true
44
+ },
45
+ "outputs": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "object",
49
+ "properties": {
50
+ "name": { "type": "string" },
51
+ "mapping": { "type": "string" }
52
+ },
53
+ "required": ["name", "mapping"]
54
+ }
55
+ }
56
+ },
57
+ "required": ["task"],
58
+ "additionalProperties": true
59
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Number Generation Tasks",
4
+ "description": "Sequential number generation operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "Number/Generate@1",
11
+ "SequenceNumber/Get@1"
12
+ ],
13
+ "description": "Task type identifier"
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "description": "Step name identifier"
18
+ },
19
+ "description": {
20
+ "type": "string",
21
+ "description": "Step description"
22
+ },
23
+ "conditions": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "expression": { "type": "string" }
29
+ },
30
+ "required": ["expression"]
31
+ }
32
+ },
33
+ "continueOnError": {
34
+ "type": "boolean"
35
+ },
36
+ "inputs": {
37
+ "type": "object",
38
+ "description": "Number generation inputs",
39
+ "properties": {
40
+ "format": {
41
+ "type": "string",
42
+ "description": "Number format string (e.g., INV-{0:D6})"
43
+ },
44
+ "sequenceName": {
45
+ "type": "string",
46
+ "description": "Sequence name identifier"
47
+ }
48
+ },
49
+ "additionalProperties": true
50
+ },
51
+ "outputs": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "properties": {
56
+ "name": { "type": "string" },
57
+ "mapping": { "type": "string" }
58
+ },
59
+ "required": ["name", "mapping"]
60
+ }
61
+ }
62
+ },
63
+ "required": ["task"],
64
+ "additionalProperties": true
65
+ }
@@ -11,7 +11,14 @@
11
11
  "Order/Update@1",
12
12
  "Order/Update@2",
13
13
  "Order/Delete@1",
14
- "Order/Get@1"
14
+ "Order/Get@1",
15
+ "Order/Copy@1",
16
+ "Order/Split@1",
17
+ "Order/Import@1",
18
+ "Order/RecalculateCharges@1",
19
+ "Order/GenerateTrackingNumber@1",
20
+ "Order/Purge@1",
21
+ "Order/GetCargoMovementByPalletQuery"
15
22
  ],
16
23
  "description": "Task type identifier"
17
24
  },
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "PDF Document Tasks",
4
+ "description": "PDF document operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "PdfDocument/Merge@1"
11
+ ],
12
+ "description": "Task type identifier"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "description": "Step name identifier"
17
+ },
18
+ "description": {
19
+ "type": "string",
20
+ "description": "Step description"
21
+ },
22
+ "conditions": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "expression": { "type": "string" }
28
+ },
29
+ "required": ["expression"]
30
+ }
31
+ },
32
+ "continueOnError": {
33
+ "type": "boolean"
34
+ },
35
+ "inputs": {
36
+ "type": "object",
37
+ "description": "PDF document operation inputs",
38
+ "properties": {
39
+ "documents": {
40
+ "type": "array",
41
+ "description": "Array of PDF documents to merge"
42
+ }
43
+ },
44
+ "additionalProperties": true
45
+ },
46
+ "outputs": {
47
+ "type": "array",
48
+ "items": {
49
+ "type": "object",
50
+ "properties": {
51
+ "name": { "type": "string" },
52
+ "mapping": { "type": "string" }
53
+ },
54
+ "required": ["name", "mapping"]
55
+ }
56
+ }
57
+ },
58
+ "required": ["task"],
59
+ "additionalProperties": true
60
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "User Tasks",
4
+ "description": "User account management operations",
5
+ "type": "object",
6
+ "properties": {
7
+ "task": {
8
+ "type": "string",
9
+ "enum": [
10
+ "User/Create",
11
+ "User/Update",
12
+ "User/Delete",
13
+ "User/GetVerificationCode",
14
+ "User/GetEmailVerificationCode",
15
+ "User/GetResetPasswordToken"
16
+ ],
17
+ "description": "Task type identifier"
18
+ },
19
+ "name": {
20
+ "type": "string",
21
+ "description": "Step name identifier"
22
+ },
23
+ "description": {
24
+ "type": "string",
25
+ "description": "Step description"
26
+ },
27
+ "conditions": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "expression": { "type": "string" }
33
+ },
34
+ "required": ["expression"]
35
+ }
36
+ },
37
+ "continueOnError": {
38
+ "type": "boolean"
39
+ },
40
+ "inputs": {
41
+ "type": "object",
42
+ "description": "User operation inputs",
43
+ "properties": {
44
+ "userId": {
45
+ "type": "string",
46
+ "description": "User ID"
47
+ },
48
+ "entity": {
49
+ "type": "object",
50
+ "description": "User entity data",
51
+ "additionalProperties": true
52
+ }
53
+ },
54
+ "additionalProperties": true
55
+ },
56
+ "outputs": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "name": { "type": "string" },
62
+ "mapping": { "type": "string" }
63
+ },
64
+ "required": ["name", "mapping"]
65
+ }
66
+ }
67
+ },
68
+ "required": ["task"],
69
+ "additionalProperties": true
70
+ }
@@ -17,7 +17,7 @@ function findProjectRoot() {
17
17
  // Check if this is not the cx-schema-validator package itself
18
18
  try {
19
19
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
20
- if (packageJson.name !== 'cx-schema-validator') {
20
+ if (packageJson.name !== '@cxtms/cx-schema') {
21
21
  return currentDir;
22
22
  }
23
23
  } catch (error) {
@@ -59,7 +59,7 @@ function createValidationScript(projectRoot) {
59
59
  * This script uses the schemas in .cx-schema to validate modules
60
60
  */
61
61
 
62
- const { ModuleValidator } = require('cx-schema-validator');
62
+ const { ModuleValidator } = require('@cxtms/cx-schema');
63
63
  const path = require('path');
64
64
 
65
65
  async function main() {
@@ -185,6 +185,6 @@ function main() {
185
185
  }
186
186
 
187
187
  // Only run if this is not being installed as a dependency of cx-schema-validator itself
188
- if (!process.env.npm_package_name || process.env.npm_package_name !== 'cx-schema-validator') {
188
+ if (!process.env.npm_package_name || process.env.npm_package_name !== '@cxtms/cx-schema') {
189
189
  main();
190
190
  }