cxtms 1.9.13

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 (215) hide show
  1. package/README.md +384 -0
  2. package/dist/cli.d.ts +6 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +4784 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/extractUtils.d.ts +11 -0
  7. package/dist/extractUtils.d.ts.map +1 -0
  8. package/dist/extractUtils.js +19 -0
  9. package/dist/extractUtils.js.map +1 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +11 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/types.d.ts +129 -0
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +6 -0
  17. package/dist/types.js.map +1 -0
  18. package/dist/utils/schemaLoader.d.ts +17 -0
  19. package/dist/utils/schemaLoader.d.ts.map +1 -0
  20. package/dist/utils/schemaLoader.js +134 -0
  21. package/dist/utils/schemaLoader.js.map +1 -0
  22. package/dist/validator.d.ts +72 -0
  23. package/dist/validator.d.ts.map +1 -0
  24. package/dist/validator.js +432 -0
  25. package/dist/validator.js.map +1 -0
  26. package/dist/workflowValidator.d.ts +103 -0
  27. package/dist/workflowValidator.d.ts.map +1 -0
  28. package/dist/workflowValidator.js +753 -0
  29. package/dist/workflowValidator.js.map +1 -0
  30. package/package.json +51 -0
  31. package/schemas/actions/all.json +27 -0
  32. package/schemas/actions/clipboard.json +46 -0
  33. package/schemas/actions/confirm.json +21 -0
  34. package/schemas/actions/consoleLog.json +16 -0
  35. package/schemas/actions/dialog.json +25 -0
  36. package/schemas/actions/fileDownload.json +16 -0
  37. package/schemas/actions/forEach.json +31 -0
  38. package/schemas/actions/if.json +12 -0
  39. package/schemas/actions/mutation.json +25 -0
  40. package/schemas/actions/navigate.json +18 -0
  41. package/schemas/actions/navigateBack.json +22 -0
  42. package/schemas/actions/navigateBackOrClose.json +21 -0
  43. package/schemas/actions/notification.json +19 -0
  44. package/schemas/actions/openBarcodeScanner.json +104 -0
  45. package/schemas/actions/query.json +32 -0
  46. package/schemas/actions/refresh.json +13 -0
  47. package/schemas/actions/resetDirtyState.json +22 -0
  48. package/schemas/actions/setFields.json +21 -0
  49. package/schemas/actions/setStore.json +13 -0
  50. package/schemas/actions/validateForm.json +15 -0
  51. package/schemas/actions/workflow.json +24 -0
  52. package/schemas/components/README.md +147 -0
  53. package/schemas/components/appComponent.json +58 -0
  54. package/schemas/components/barcodeScanner.json +69 -0
  55. package/schemas/components/button.json +123 -0
  56. package/schemas/components/calendar.json +489 -0
  57. package/schemas/components/card.json +176 -0
  58. package/schemas/components/collection.json +54 -0
  59. package/schemas/components/dataGrid.json +119 -0
  60. package/schemas/components/datasource.json +151 -0
  61. package/schemas/components/dropdown.json +57 -0
  62. package/schemas/components/field-collection.json +618 -0
  63. package/schemas/components/field.json +265 -0
  64. package/schemas/components/form.json +234 -0
  65. package/schemas/components/index.json +71 -0
  66. package/schemas/components/layout.json +69 -0
  67. package/schemas/components/module.json +167 -0
  68. package/schemas/components/navDropdown.json +36 -0
  69. package/schemas/components/navbar.json +78 -0
  70. package/schemas/components/navbarItem.json +28 -0
  71. package/schemas/components/navbarLink.json +36 -0
  72. package/schemas/components/row.json +31 -0
  73. package/schemas/components/slot.json +30 -0
  74. package/schemas/components/tab.json +34 -0
  75. package/schemas/components/tabs.json +35 -0
  76. package/schemas/components/timeline.json +172 -0
  77. package/schemas/components/timelineGrid.json +328 -0
  78. package/schemas/fields/README.md +66 -0
  79. package/schemas/fields/attachment.json +156 -0
  80. package/schemas/fields/autocomplete-googleplaces.json +130 -0
  81. package/schemas/fields/checkbox.json +82 -0
  82. package/schemas/fields/date.json +88 -0
  83. package/schemas/fields/datetime.json +75 -0
  84. package/schemas/fields/email.json +75 -0
  85. package/schemas/fields/index.json +53 -0
  86. package/schemas/fields/number.json +91 -0
  87. package/schemas/fields/password.json +70 -0
  88. package/schemas/fields/radio.json +94 -0
  89. package/schemas/fields/rangedatetime.json +56 -0
  90. package/schemas/fields/select-async.json +334 -0
  91. package/schemas/fields/select.json +115 -0
  92. package/schemas/fields/tel.json +79 -0
  93. package/schemas/fields/text.json +86 -0
  94. package/schemas/fields/textarea.json +95 -0
  95. package/schemas/fields/time.json +91 -0
  96. package/schemas/fields/url.json +74 -0
  97. package/schemas/schema.graphql +12248 -0
  98. package/schemas/schemas.json +610 -0
  99. package/schemas/workflows/activity.json +96 -0
  100. package/schemas/workflows/common/condition.json +48 -0
  101. package/schemas/workflows/common/expression.json +76 -0
  102. package/schemas/workflows/common/mapping.json +173 -0
  103. package/schemas/workflows/common/step.json +38 -0
  104. package/schemas/workflows/flow/aggregation.json +44 -0
  105. package/schemas/workflows/flow/entity.json +129 -0
  106. package/schemas/workflows/flow/state.json +105 -0
  107. package/schemas/workflows/flow/transition.json +143 -0
  108. package/schemas/workflows/input.json +122 -0
  109. package/schemas/workflows/output.json +61 -0
  110. package/schemas/workflows/schedule.json +26 -0
  111. package/schemas/workflows/tasks/accounting-transaction.json +95 -0
  112. package/schemas/workflows/tasks/action-event.json +65 -0
  113. package/schemas/workflows/tasks/all.json +152 -0
  114. package/schemas/workflows/tasks/appmodule.json +56 -0
  115. package/schemas/workflows/tasks/attachment.json +97 -0
  116. package/schemas/workflows/tasks/authentication.json +86 -0
  117. package/schemas/workflows/tasks/caching.json +68 -0
  118. package/schemas/workflows/tasks/charge.json +92 -0
  119. package/schemas/workflows/tasks/commodity.json +92 -0
  120. package/schemas/workflows/tasks/contact-address.json +72 -0
  121. package/schemas/workflows/tasks/contact-payment-method.json +72 -0
  122. package/schemas/workflows/tasks/contact.json +82 -0
  123. package/schemas/workflows/tasks/csv.json +81 -0
  124. package/schemas/workflows/tasks/document-render.json +105 -0
  125. package/schemas/workflows/tasks/document-send.json +84 -0
  126. package/schemas/workflows/tasks/edi.json +157 -0
  127. package/schemas/workflows/tasks/email-send.json +110 -0
  128. package/schemas/workflows/tasks/error.json +72 -0
  129. package/schemas/workflows/tasks/export.json +90 -0
  130. package/schemas/workflows/tasks/filetransfer.json +102 -0
  131. package/schemas/workflows/tasks/flow-transition.json +68 -0
  132. package/schemas/workflows/tasks/foreach.json +69 -0
  133. package/schemas/workflows/tasks/generic.json +47 -0
  134. package/schemas/workflows/tasks/graphql.json +78 -0
  135. package/schemas/workflows/tasks/httpRequest.json +161 -0
  136. package/schemas/workflows/tasks/import.json +64 -0
  137. package/schemas/workflows/tasks/inventory.json +67 -0
  138. package/schemas/workflows/tasks/job.json +88 -0
  139. package/schemas/workflows/tasks/log.json +73 -0
  140. package/schemas/workflows/tasks/map.json +58 -0
  141. package/schemas/workflows/tasks/movement.json +54 -0
  142. package/schemas/workflows/tasks/note.json +59 -0
  143. package/schemas/workflows/tasks/number.json +65 -0
  144. package/schemas/workflows/tasks/order-tracking-event.json +109 -0
  145. package/schemas/workflows/tasks/order.json +139 -0
  146. package/schemas/workflows/tasks/payment.json +85 -0
  147. package/schemas/workflows/tasks/pdf-document.json +60 -0
  148. package/schemas/workflows/tasks/postal-codes.json +92 -0
  149. package/schemas/workflows/tasks/resolve-timezone.json +65 -0
  150. package/schemas/workflows/tasks/setVariable.json +76 -0
  151. package/schemas/workflows/tasks/switch.json +75 -0
  152. package/schemas/workflows/tasks/template.json +73 -0
  153. package/schemas/workflows/tasks/tracking-event.json +137 -0
  154. package/schemas/workflows/tasks/transmission.json +185 -0
  155. package/schemas/workflows/tasks/unzip-file.json +68 -0
  156. package/schemas/workflows/tasks/user.json +70 -0
  157. package/schemas/workflows/tasks/validation.json +99 -0
  158. package/schemas/workflows/tasks/while.json +53 -0
  159. package/schemas/workflows/tasks/workflow-execute.json +82 -0
  160. package/schemas/workflows/trigger.json +90 -0
  161. package/schemas/workflows/variable.json +46 -0
  162. package/schemas/workflows/workflow.json +335 -0
  163. package/scripts/postinstall.js +291 -0
  164. package/scripts/setup-vscode.js +80 -0
  165. package/skills/cxtms-developer/SKILL.md +118 -0
  166. package/skills/cxtms-developer/ref-cli-auth.md +120 -0
  167. package/skills/cxtms-developer/ref-entity-accounting.md +180 -0
  168. package/skills/cxtms-developer/ref-entity-commodity.md +239 -0
  169. package/skills/cxtms-developer/ref-entity-contact.md +163 -0
  170. package/skills/cxtms-developer/ref-entity-geography.md +154 -0
  171. package/skills/cxtms-developer/ref-entity-job.md +77 -0
  172. package/skills/cxtms-developer/ref-entity-notification.md +85 -0
  173. package/skills/cxtms-developer/ref-entity-order-sub.md +160 -0
  174. package/skills/cxtms-developer/ref-entity-order.md +183 -0
  175. package/skills/cxtms-developer/ref-entity-organization.md +41 -0
  176. package/skills/cxtms-developer/ref-entity-rate.md +182 -0
  177. package/skills/cxtms-developer/ref-entity-shared.md +176 -0
  178. package/skills/cxtms-developer/ref-entity-warehouse.md +115 -0
  179. package/skills/cxtms-developer/ref-graphql-query.md +309 -0
  180. package/skills/cxtms-module-builder/SKILL.md +477 -0
  181. package/skills/cxtms-module-builder/ref-components-data.md +293 -0
  182. package/skills/cxtms-module-builder/ref-components-display.md +411 -0
  183. package/skills/cxtms-module-builder/ref-components-forms.md +369 -0
  184. package/skills/cxtms-module-builder/ref-components-interactive.md +317 -0
  185. package/skills/cxtms-module-builder/ref-components-layout.md +390 -0
  186. package/skills/cxtms-module-builder/ref-components-specialized.md +477 -0
  187. package/skills/cxtms-workflow-builder/SKILL.md +438 -0
  188. package/skills/cxtms-workflow-builder/ref-accounting.md +66 -0
  189. package/skills/cxtms-workflow-builder/ref-communication.md +169 -0
  190. package/skills/cxtms-workflow-builder/ref-entity.md +342 -0
  191. package/skills/cxtms-workflow-builder/ref-expressions-ncalc.md +128 -0
  192. package/skills/cxtms-workflow-builder/ref-expressions-template.md +161 -0
  193. package/skills/cxtms-workflow-builder/ref-filetransfer.md +80 -0
  194. package/skills/cxtms-workflow-builder/ref-flow.md +210 -0
  195. package/skills/cxtms-workflow-builder/ref-other.md +157 -0
  196. package/skills/cxtms-workflow-builder/ref-query.md +105 -0
  197. package/skills/cxtms-workflow-builder/ref-utilities.md +417 -0
  198. package/templates/module-configuration.yaml +44 -0
  199. package/templates/module-form.yaml +152 -0
  200. package/templates/module-grid.yaml +229 -0
  201. package/templates/module-select.yaml +139 -0
  202. package/templates/module.yaml +84 -0
  203. package/templates/workflow-api-tracking.yaml +189 -0
  204. package/templates/workflow-basic.yaml +76 -0
  205. package/templates/workflow-document.yaml +155 -0
  206. package/templates/workflow-entity-trigger.yaml +90 -0
  207. package/templates/workflow-ftp-edi.yaml +158 -0
  208. package/templates/workflow-ftp-tracking.yaml +161 -0
  209. package/templates/workflow-mcp-tool.yaml +112 -0
  210. package/templates/workflow-public-api.yaml +135 -0
  211. package/templates/workflow-scheduled-execute.yaml +75 -0
  212. package/templates/workflow-scheduled.yaml +125 -0
  213. package/templates/workflow-utility.yaml +96 -0
  214. package/templates/workflow-webhook.yaml +128 -0
  215. package/templates/workflow.yaml +140 -0
@@ -0,0 +1,309 @@
1
+ # GraphQL Query Reference
2
+
3
+ ## CLI Query Command
4
+
5
+ ```bash
6
+ npx cxtms query '<graphql-query>' # Inline query
7
+ npx cxtms query my-query.graphql # From file
8
+ npx cxtms query '<query>' --vars '{"key":"v"}' # With variables
9
+ ```
10
+
11
+ Requires active login (`npx cxtms login`). Uses the active organization.
12
+
13
+ ## Query Arguments
14
+
15
+ All root entity queries follow this pattern:
16
+
17
+ ```graphql
18
+ orders(
19
+ organizationId: Int! # Required — active org ID
20
+ filter: String # Lucene query syntax (see below)
21
+ search: String # Full-text search across key fields
22
+ orderBy: String # Comma-separated sort fields
23
+ take: Int # Page size (alias: limit)
24
+ skip: Int # Offset (alias: offset)
25
+ )
26
+ ```
27
+
28
+ Entity-specific extras:
29
+ - `orders` — `includeDraft: Boolean` (default false)
30
+
31
+ Available root queries: `orders`, `contacts`, `commodities`, `accountingTransactions`, `jobs`, and others.
32
+
33
+ ## Filter Syntax (Lucene Query)
34
+
35
+ Filters use **Lucene Query syntax** (not OData, not NCalc).
36
+
37
+ ### Basic field matching
38
+ ```
39
+ filter: "orderId:196596"
40
+ filter: "orderType:ParcelShipment"
41
+ filter: "status:Active"
42
+ ```
43
+
44
+ ### Wildcards
45
+ ```
46
+ filter: "name:*pending*" # Contains
47
+ filter: "code:ABC*" # Starts with
48
+ filter: "status:*Active" # Ends with
49
+ ```
50
+
51
+ ### Logical operators
52
+ ```
53
+ filter: "countryCode:US AND name:Test"
54
+ filter: "status:Active OR status:Pending"
55
+ filter: "NOT customValues.po:123"
56
+ filter: "orderType:ParcelShipment AND (status:Active OR status:Pending)"
57
+ ```
58
+
59
+ ### Nested paths (dot notation)
60
+ ```
61
+ filter: "orderEntities.entityType:Consignee"
62
+ filter: "orderEntities.contactId:7128"
63
+ filter: "jobs.orders.orderNumber:16*"
64
+ ```
65
+
66
+ ### Range queries
67
+ ```
68
+ filter: "lastModified:[\"2026-01-01\" TO \"2026-03-15\"]"
69
+ filter: "lastModified:[\"2026-01-01\" TO *]" # >= date
70
+ filter: "amount:[100 TO 500]"
71
+ ```
72
+
73
+ ### NULL checks
74
+ ```
75
+ filter: "customValues.po:NULL"
76
+ ```
77
+
78
+ ### CustomValues (JSONB fields)
79
+ ```
80
+ filter: "customValues.fieldName:value"
81
+ filter: "customValues.fieldName:\"exact match\""
82
+ filter: "customValues.fieldName:NULL"
83
+ ```
84
+
85
+ ### Filtered collections (bracket notation)
86
+ ```
87
+ filter: "children[category:CatA].name:test"
88
+ ```
89
+
90
+ ## OrderBy Syntax
91
+
92
+ ```
93
+ orderBy: "orderNumber" # Ascending
94
+ orderBy: "-orderNumber" # Descending
95
+ orderBy: "-created,orderNumber" # Multi-field
96
+ orderBy: "customValues.fieldName" # Custom field sort
97
+ orderBy: "orderNumber~ToInt32" # Type conversion during sort
98
+ ```
99
+
100
+ ## Pagination
101
+
102
+ ```graphql
103
+ {
104
+ orders(organizationId: 1, take: 50, skip: 0) {
105
+ items { orderId orderNumber }
106
+ totalCount
107
+ pageInfo { hasNextPage hasPreviousPage }
108
+ }
109
+ }
110
+ ```
111
+
112
+ ## Audit Change History
113
+
114
+ ### Entity-level: `changeHistory` computed field
115
+
116
+ Available on: **Order**, **Contact**, **Commodity**, **AccountingTransaction**
117
+
118
+ ```graphql
119
+ {
120
+ orders(organizationId: 1, filter: "orderId:196596", take: 1) {
121
+ items {
122
+ orderId
123
+ changeHistory(maxResults: 20) {
124
+ entityName
125
+ hasMoreRecords
126
+ continuationToken
127
+ changes {
128
+ state # "Added" | "Modified" | "Deleted"
129
+ userId
130
+ timestamp
131
+ user {
132
+ fullName
133
+ email
134
+ }
135
+ changedFields {
136
+ fieldName
137
+ originalValue
138
+ currentValue
139
+ fieldType
140
+ }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ Arguments: `startDate: DateTime`, `endDate: DateTime`, `maxResults: Int` (default 10)
149
+
150
+ ### Root-level: `auditChanges` query
151
+
152
+ Query audit changes directly without fetching the entity first:
153
+
154
+ ```graphql
155
+ {
156
+ auditChanges(
157
+ organizationId: 1
158
+ filter: "entityName:Order AND primaryKey:196596"
159
+ take: 20
160
+ ) {
161
+ items {
162
+ state
163
+ userId
164
+ timestamp
165
+ user { fullName email }
166
+ changedFields {
167
+ fieldName
168
+ originalValue
169
+ currentValue
170
+ fieldType
171
+ }
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ Arguments: `organizationId: Int!`, `filter: String`, `search: String`, `take: Int`, `skip: Int`, `orderBy: String`
178
+
179
+ Filter fields: `entityName`, `primaryKey`, `userId`, `state`
180
+
181
+ ### Root-level: `auditChangeSummaries` query
182
+
183
+ High-level summary of changes (grouped by change event):
184
+
185
+ ```graphql
186
+ {
187
+ auditChangeSummaries(
188
+ organizationId: 1
189
+ startDate: "2026-03-01T00:00:00Z"
190
+ endDate: "2026-03-15T23:59:59Z"
191
+ maxResults: 50
192
+ ) {
193
+ items {
194
+ changeId
195
+ userId
196
+ timestamp
197
+ changePaths
198
+ organizationId
199
+ }
200
+ continuationToken
201
+ hasMoreRecords
202
+ }
203
+ }
204
+ ```
205
+
206
+ ### Root-level: `auditChange` — single change detail
207
+
208
+ ```graphql
209
+ {
210
+ auditChange(filePath: "<s3-file-path>") {
211
+ entityName
212
+ state
213
+ primaryKey
214
+ userId
215
+ timestamp
216
+ originalValues
217
+ currentValues
218
+ fields {
219
+ fieldName
220
+ originalValue
221
+ currentValue
222
+ fieldType
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ ## GraphQL Type Reference
229
+
230
+ ### EntityAuditHistoryLightResult
231
+ | Field | Type |
232
+ |-------|------|
233
+ | `entityName` | `String` |
234
+ | `primaryKey` | `String` |
235
+ | `organizationId` | `Int` |
236
+ | `changes` | `[AuditChangeEntry!]!` |
237
+ | `continuationToken` | `String` |
238
+ | `hasMoreRecords` | `Boolean!` |
239
+
240
+ ### AuditChangeEntry
241
+ | Field | Type | Notes |
242
+ |-------|------|-------|
243
+ | `state` | `String` | "Added", "Modified", "Deleted" |
244
+ | `userId` | `String` | |
245
+ | `timestamp` | `DateTime!` | |
246
+ | `user` | `AuditUser` | Lazy-loaded resolver |
247
+ | `changedFields` | `[AuditChangeField!]!` | Lazy-loaded resolver |
248
+
249
+ ### AuditChangeField
250
+ | Field | Type |
251
+ |-------|------|
252
+ | `fieldName` | `String!` |
253
+ | `originalValue` | `Any` |
254
+ | `currentValue` | `Any` |
255
+ | `fieldType` | `String!` |
256
+
257
+ ### AuditUser
258
+ | Field | Type |
259
+ |-------|------|
260
+ | `id` | `String` |
261
+ | `firstName` | `String` |
262
+ | `lastName` | `String` |
263
+ | `fullName` | `String` |
264
+ | `userName` | `String` |
265
+ | `email` | `String` |
266
+
267
+ ## Discovering Fields
268
+
269
+ **Always discover field names before building a query.** Do not guess field names — use the tools below.
270
+
271
+ ### CLI: `cxtms gql` — schema exploration commands
272
+
273
+ ```bash
274
+ # List all query root fields (what you can query)
275
+ npx cxtms gql queries
276
+ npx cxtms gql queries --filter order
277
+
278
+ # List all mutation root fields
279
+ npx cxtms gql mutations
280
+ npx cxtms gql mutations --filter order
281
+
282
+ # List all types (filter by name)
283
+ npx cxtms gql types --filter audit
284
+ npx cxtms gql types --filter order
285
+
286
+ # Inspect a specific type — shows fields, arguments, input fields, enum values
287
+ npx cxtms gql type OrderGqlDto
288
+ npx cxtms gql type AuditChangeEntry
289
+ npx cxtms gql type EntityAuditHistoryLightResult
290
+ npx cxtms gql type CreateOrderInput
291
+ ```
292
+
293
+ ### Workflow: discover → query
294
+
295
+ 1. **Find the type** — `cxtms gql types --filter order` to find type names
296
+ 2. **Inspect the type** — `cxtms gql type OrderGqlDto` to see all fields and their types
297
+ 3. **Check query args** — `cxtms gql queries --filter order` to see arguments
298
+ 4. **Build and run** — `cxtms query '<graphql-query>'`
299
+
300
+ ### Fallback: error-driven discovery
301
+
302
+ GraphQL error messages reveal valid field/type names:
303
+ - "The field `foo` does not exist on the type `BarType`" — tells you the type name
304
+ - "The argument `bar` does not exist" — tells you valid argument patterns
305
+
306
+ ### Other sources
307
+
308
+ - `npx cxtms schema <name>` — shows workflow/module JSON schema fields (not GraphQL)
309
+ - Entity reference files (`ref-entity-*.md`) — document common fields, computed properties, and enums