@cxtms/cx-schema 1.9.67 → 1.9.241

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 (81) hide show
  1. package/dist/cli.js +43 -9
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +1 -1
  4. package/schemas/actions/all.json +5 -1
  5. package/schemas/actions/reload.json +17 -0
  6. package/schemas/actions/setSessionStorage.json +38 -0
  7. package/schemas/actions/sound.json +39 -0
  8. package/schemas/actions/vibrate.json +48 -0
  9. package/schemas/components/avatar.json +1 -0
  10. package/schemas/components/badge.json +79 -0
  11. package/schemas/components/barcodeScanner.json +28 -0
  12. package/schemas/components/camera.json +177 -0
  13. package/schemas/components/card.json +78 -0
  14. package/schemas/components/dashboard-widget.json +39 -0
  15. package/schemas/components/dashboard.json +46 -0
  16. package/schemas/components/dataGrid.json +15 -0
  17. package/schemas/components/field-collection.json +86 -2
  18. package/schemas/components/field.json +39 -4
  19. package/schemas/components/form.json +4 -0
  20. package/schemas/components/index.json +17 -1
  21. package/schemas/components/infoLine.json +1 -0
  22. package/schemas/components/map.json +167 -0
  23. package/schemas/components/module.json +32 -0
  24. package/schemas/components/planner.json +1 -0
  25. package/schemas/components/progressBar.json +1 -0
  26. package/schemas/components/timeline.json +216 -74
  27. package/schemas/components/timelineGrid.json +5 -1
  28. package/schemas/fields/autocomplete-googleplaces.json +2 -2
  29. package/schemas/fields/datetime.json +2 -2
  30. package/schemas/fields/index.json +4 -0
  31. package/schemas/fields/number-select.json +88 -0
  32. package/schemas/fields/rangedatetime.json +10 -2
  33. package/schemas/fields/select-async.json +2 -2
  34. package/schemas/fields/toggle.json +91 -0
  35. package/schemas/schema.graphql +11016 -12171
  36. package/schemas/schemas.json +131 -4
  37. package/schemas/workflows/flow/entity.json +3 -1
  38. package/schemas/workflows/input.json +1 -1
  39. package/schemas/workflows/output.json +1 -1
  40. package/schemas/workflows/tasks/all.json +9 -0
  41. package/schemas/workflows/tasks/commodity.json +8 -0
  42. package/schemas/workflows/tasks/contact-address.json +25 -0
  43. package/schemas/workflows/tasks/dispatch-routes.json +64 -0
  44. package/schemas/workflows/tasks/edi.json +15 -0
  45. package/schemas/workflows/tasks/export.json +21 -0
  46. package/schemas/workflows/tasks/httpRequest.json +4 -0
  47. package/schemas/workflows/tasks/import.json +5 -0
  48. package/schemas/workflows/tasks/order-move.json +38 -0
  49. package/schemas/workflows/tasks/order.json +6 -0
  50. package/schemas/workflows/tasks/organization-config.json +101 -0
  51. package/schemas/workflows/tasks/tracking-event.json +11 -3
  52. package/schemas/workflows/tasks/workflow-execute.json +4 -0
  53. package/schemas/workflows/variable.json +2 -2
  54. package/schemas/workflows/workflow.json +39 -2
  55. package/skills/cxtms-developer/SKILL.md +5 -2
  56. package/skills/cxtms-developer/ref-cli-auth.md +2 -0
  57. package/skills/cxtms-developer/ref-entity-commodity.md +41 -5
  58. package/skills/cxtms-developer/ref-entity-contact.md +46 -0
  59. package/skills/cxtms-developer/ref-entity-dispatch-routing.md +195 -0
  60. package/skills/cxtms-developer/ref-entity-geography.md +26 -1
  61. package/skills/cxtms-developer/ref-entity-job.md +6 -2
  62. package/skills/cxtms-developer/ref-entity-order-sub.md +1 -1
  63. package/skills/cxtms-developer/ref-entity-order.md +36 -3
  64. package/skills/cxtms-developer/ref-entity-organization.md +4 -2
  65. package/skills/cxtms-developer/ref-entity-shared.md +79 -3
  66. package/skills/cxtms-developer/ref-graphql-query.md +246 -4
  67. package/skills/cxtms-module-builder/SKILL.md +33 -6
  68. package/skills/cxtms-module-builder/ref-components-data.md +85 -0
  69. package/skills/cxtms-module-builder/ref-components-display.md +282 -8
  70. package/skills/cxtms-module-builder/ref-components-forms.md +386 -21
  71. package/skills/cxtms-module-builder/ref-components-interactive.md +2 -0
  72. package/skills/cxtms-module-builder/ref-components-layout.md +288 -29
  73. package/skills/cxtms-module-builder/ref-components-specialized.md +168 -20
  74. package/skills/cxtms-workflow-builder/SKILL.md +45 -6
  75. package/skills/cxtms-workflow-builder/ref-entity.md +100 -4
  76. package/skills/cxtms-workflow-builder/ref-expressions-ncalc.md +35 -2
  77. package/skills/cxtms-workflow-builder/ref-expressions-template.md +15 -1
  78. package/skills/cxtms-workflow-builder/ref-flow.md +6 -1
  79. package/skills/cxtms-workflow-builder/ref-query.md +16 -0
  80. package/skills/cxtms-workflow-builder/ref-utilities.md +32 -2
  81. package/templates/workflow-public-api.yaml +1 -0
package/dist/cli.js CHANGED
@@ -53,12 +53,46 @@ const validator_1 = require("./validator");
53
53
  const workflowValidator_1 = require("./workflowValidator");
54
54
  const extractUtils_1 = require("./extractUtils");
55
55
  const pkg = require('../package.json');
56
- function checkForUpdates() {
56
+ function isNewerVersion(latest, current) {
57
+ const a = latest.split('.').map(n => parseInt(n, 10));
58
+ const b = current.split('.').map(n => parseInt(n, 10));
59
+ for (let i = 0; i < 3; i++) {
60
+ const diff = (a[i] || 0) - (b[i] || 0);
61
+ if (diff !== 0)
62
+ return diff > 0;
63
+ }
64
+ return false;
65
+ }
66
+ function checkForUpdates(command) {
57
67
  try {
58
- (0, update_notifier_1.default)({
68
+ const notifier = (0, update_notifier_1.default)({
59
69
  pkg,
60
- updateCheckInterval: 1000 * 60 * 60 * 24,
61
- }).notify({ isGlobal: true });
70
+ updateCheckInterval: 1000 * 60 * 60 * 2, // ask the npm registry at most once every 2 hours
71
+ });
72
+ const update = notifier.update;
73
+ if (!update || !isNewerVersion(update.latest, update.current))
74
+ return;
75
+ // Auto-update only in an interactive terminal, outside CI, when cxtms is
76
+ // installed locally in cwd, and not while already running `update`.
77
+ const localInstall = path.join(process.cwd(), 'node_modules', 'cxtms', 'package.json');
78
+ const autoUpdateAllowed = command !== 'update' &&
79
+ process.stdout.isTTY === true &&
80
+ !process.env.CI &&
81
+ !process.env.CXTMS_NO_AUTO_UPDATE &&
82
+ fs.existsSync(localInstall);
83
+ if (autoUpdateAllowed) {
84
+ console.log(chalk_1.default.cyan(`\ncxtms ${update.current} → ${update.latest} available — auto-updating...`));
85
+ if (runUpdate()) {
86
+ console.log(chalk_1.default.gray('The new version applies from the next run; continuing with the current command.\n'));
87
+ }
88
+ else {
89
+ console.log(chalk_1.default.yellow('Auto-update failed — continuing with the current version.\n'));
90
+ }
91
+ return;
92
+ }
93
+ notifier.notify({
94
+ message: `Update available ${chalk_1.default.dim(update.current)} → ${chalk_1.default.green(update.latest)}\nRun ${chalk_1.default.cyan('npx cxtms update')} to update`,
95
+ });
62
96
  }
63
97
  catch {
64
98
  // Update check must never break the CLI.
@@ -1504,7 +1538,7 @@ function runUpdate() {
1504
1538
  catch (error) {
1505
1539
  console.error(chalk_1.default.red('\nError: Failed to uninstall @cxtms/cx-schema'));
1506
1540
  console.error(chalk_1.default.gray(error.message));
1507
- process.exit(1);
1541
+ return false;
1508
1542
  }
1509
1543
  }
1510
1544
  console.log(' Updating to latest version...\n');
@@ -1525,11 +1559,12 @@ function runUpdate() {
1525
1559
  catch (error) {
1526
1560
  console.error(chalk_1.default.red('\nError: Failed to update cxtms'));
1527
1561
  console.error(chalk_1.default.gray(error.message));
1528
- process.exit(1);
1562
+ return false;
1529
1563
  }
1530
1564
  // Reinstall skills and update CLAUDE.md (postinstall handles schemas)
1531
1565
  runInstallSkills();
1532
1566
  runSetupClaude();
1567
+ return true;
1533
1568
  }
1534
1569
  // ============================================================================
1535
1570
  // Setup Claude Command
@@ -4523,9 +4558,9 @@ async function validateFile(filePath, options, schemasPath) {
4523
4558
  // Main
4524
4559
  // ============================================================================
4525
4560
  async function main() {
4526
- checkForUpdates();
4527
4561
  const args = process.argv.slice(2);
4528
4562
  const { command, files, options } = parseArgs(args);
4563
+ checkForUpdates(command);
4529
4564
  checkSkillsInstalled(command);
4530
4565
  // Handle help
4531
4566
  if (options.help) {
@@ -4748,8 +4783,7 @@ async function main() {
4748
4783
  }
4749
4784
  // Handle update command
4750
4785
  if (command === 'update') {
4751
- runUpdate();
4752
- process.exit(0);
4786
+ process.exit(runUpdate() ? 0 : 1);
4753
4787
  }
4754
4788
  // Handle setup-claude command
4755
4789
  if (command === 'setup-claude') {