@camunda8/cli 2.8.0-alpha.9 → 3.0.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 (88) hide show
  1. package/EXAMPLES.md +22 -5
  2. package/PLUGIN-HELP.md +26 -0
  3. package/README.md +37 -4
  4. package/dist/command-dispatch.d.ts.map +1 -1
  5. package/dist/command-dispatch.js +2 -1
  6. package/dist/command-dispatch.js.map +1 -1
  7. package/dist/command-registry.d.ts +30 -0
  8. package/dist/command-registry.d.ts.map +1 -1
  9. package/dist/command-registry.js +34 -1
  10. package/dist/command-registry.js.map +1 -1
  11. package/dist/commands/plugins.d.ts +21 -0
  12. package/dist/commands/plugins.d.ts.map +1 -1
  13. package/dist/commands/plugins.js +74 -1
  14. package/dist/commands/plugins.js.map +1 -1
  15. package/dist/commands/resource-extensions.d.ts +12 -0
  16. package/dist/commands/resource-extensions.d.ts.map +1 -1
  17. package/dist/commands/resource-extensions.js +13 -1
  18. package/dist/commands/resource-extensions.js.map +1 -1
  19. package/dist/commands/run.d.ts.map +1 -1
  20. package/dist/commands/run.js +5 -3
  21. package/dist/commands/run.js.map +1 -1
  22. package/dist/commands/watch.d.ts.map +1 -1
  23. package/dist/commands/watch.js +21 -12
  24. package/dist/commands/watch.js.map +1 -1
  25. package/dist/completion.d.ts.map +1 -1
  26. package/dist/completion.js +140 -13
  27. package/dist/completion.js.map +1 -1
  28. package/dist/default-plugins/bpmn/README.md +69 -0
  29. package/dist/default-plugins/bpmn/c8ctl-plugin.js +125 -0
  30. package/dist/default-plugins/bpmn/c8ctl-plugin.js.map +1 -0
  31. package/dist/default-plugins/bpmn/lint.js +259 -0
  32. package/dist/default-plugins/bpmn/lint.js.map +1 -0
  33. package/dist/default-plugins/bpmn/package.json +8 -0
  34. package/dist/default-plugins/cluster/package.json +1 -1
  35. package/dist/default-plugins/element-template/AGENTS.md +65 -0
  36. package/dist/default-plugins/element-template/README.md +331 -0
  37. package/dist/default-plugins/element-template/c8ctl-plugin.js +247 -0
  38. package/dist/default-plugins/element-template/c8ctl-plugin.js.map +1 -0
  39. package/dist/default-plugins/element-template/commands/apply.js +298 -0
  40. package/dist/default-plugins/element-template/commands/apply.js.map +1 -0
  41. package/dist/default-plugins/element-template/commands/get-properties.js +344 -0
  42. package/dist/default-plugins/element-template/commands/get-properties.js.map +1 -0
  43. package/dist/default-plugins/element-template/commands/get.js +107 -0
  44. package/dist/default-plugins/element-template/commands/get.js.map +1 -0
  45. package/dist/default-plugins/element-template/commands/info.js +189 -0
  46. package/dist/default-plugins/element-template/commands/info.js.map +1 -0
  47. package/dist/default-plugins/element-template/commands/search.js +101 -0
  48. package/dist/default-plugins/element-template/commands/search.js.map +1 -0
  49. package/dist/default-plugins/element-template/commands/sync.js +36 -0
  50. package/dist/default-plugins/element-template/commands/sync.js.map +1 -0
  51. package/dist/default-plugins/element-template/docs/design.md +145 -0
  52. package/dist/default-plugins/element-template/helpers.js +404 -0
  53. package/dist/default-plugins/element-template/helpers.js.map +1 -0
  54. package/dist/default-plugins/element-template/marketplace.js +396 -0
  55. package/dist/default-plugins/element-template/marketplace.js.map +1 -0
  56. package/dist/default-plugins/element-template/package.json +8 -0
  57. package/dist/default-plugins/element-template/template-ref.js +232 -0
  58. package/dist/default-plugins/element-template/template-ref.js.map +1 -0
  59. package/dist/default-plugins/element-template/vendor-src/bundle-entry.js +44 -0
  60. package/dist/default-plugins/feel/README.md +163 -0
  61. package/dist/default-plugins/feel/c8ctl-plugin.js +616 -0
  62. package/dist/default-plugins/feel/c8ctl-plugin.js.map +1 -0
  63. package/dist/default-plugins/feel/package.json +8 -0
  64. package/dist/deployments.d.ts +1 -0
  65. package/dist/deployments.d.ts.map +1 -1
  66. package/dist/deployments.js +89 -20
  67. package/dist/deployments.js.map +1 -1
  68. package/dist/help.d.ts.map +1 -1
  69. package/dist/help.js +156 -5
  70. package/dist/help.js.map +1 -1
  71. package/dist/ignore.d.ts +16 -1
  72. package/dist/ignore.d.ts.map +1 -1
  73. package/dist/ignore.js +55 -3
  74. package/dist/ignore.js.map +1 -1
  75. package/dist/index.d.ts +23 -0
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +294 -25
  78. package/dist/index.js.map +1 -1
  79. package/dist/plugin-loader.d.ts +168 -7
  80. package/dist/plugin-loader.d.ts.map +1 -1
  81. package/dist/plugin-loader.js +284 -21
  82. package/dist/plugin-loader.js.map +1 -1
  83. package/dist/runtime.d.ts +10 -0
  84. package/dist/runtime.d.ts.map +1 -1
  85. package/dist/runtime.js +6 -0
  86. package/dist/runtime.js.map +1 -1
  87. package/dist/vendor/bpmn-element-templates.cjs +59639 -0
  88. package/package.json +20 -7
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Vendor bundle entry point for the element-template plugin.
3
+ *
4
+ * bpmn-js and bpmn-js-element-templates use extensionless ESM imports
5
+ * internally, which Node.js cannot resolve without a bundler. This file
6
+ * is bundled with esbuild into a single self-contained CJS module that
7
+ * is loaded at runtime by the plugin via require().
8
+ *
9
+ * Build: npm run build:vendor
10
+ */
11
+
12
+ import Modeler from 'bpmn-js-headless/lib/Modeler';
13
+ import { CloudElementTemplatesCoreModule } from 'bpmn-js-element-templates/core';
14
+ import ZeebeModdleExtension from 'zeebe-bpmn-moddle/resources/zeebe.json';
15
+
16
+ /**
17
+ * No-op TextRenderer module.
18
+ *
19
+ * bpmn-js's BpmnImporter.addLabel calls textRenderer.getExternalLabelBounds
20
+ * to fit external labels (event/gateway names). The default implementation
21
+ * creates an SVG <text> via document.createElementNS to measure dimensions
22
+ * — which throws in Node.js where `document` doesn't exist. The errors are
23
+ * non-fatal (the importer catches them) but produce noisy stack traces.
24
+ *
25
+ * For template application we don't need accurate label measurements:
26
+ * the input file's existing BPMNLabel bounds are preserved on saveXML.
27
+ * Returning the input bounds unchanged keeps the importer happy without
28
+ * touching the DOM.
29
+ */
30
+ const HeadlessTextRendererModule = {
31
+ textRenderer: ['type', function HeadlessTextRenderer() {
32
+ this.getExternalLabelBounds = function(bounds) { return bounds; };
33
+ this.getTextAnnotationBounds = function(bounds) { return bounds; };
34
+ this.getDimensions = function() { return { width: 0, height: 0 }; };
35
+ this.createText = function() { return null; };
36
+ }],
37
+ };
38
+
39
+ export {
40
+ Modeler,
41
+ CloudElementTemplatesCoreModule,
42
+ ZeebeModdleExtension,
43
+ HeadlessTextRendererModule,
44
+ };
@@ -0,0 +1,163 @@
1
+ # c8ctl-plugin-feel
2
+
3
+ A default [c8ctl](https://github.com/camunda/c8ctl) plugin for
4
+ evaluating [FEEL](https://docs.camunda.io/docs/components/modeler/feel/what-is-feel/)
5
+ expressions. By default uses the connected Camunda cluster's engine
6
+ via the 8.9+ REST API. Use `--engine local` to evaluate in-process
7
+ via [feelin](https://github.com/nikku/feelin) without a cluster connection.
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ # Evaluate a simple expression on the cluster (default)
13
+ c8ctl feel evaluate '1 + 2'
14
+ # → 3
15
+
16
+ # Leading '=' is optional — both forms work
17
+ c8ctl feel evaluate '=1 + 2'
18
+
19
+ # Pass variables individually
20
+ c8ctl feel evaluate 'a + b' --var a=1 --var b=2
21
+ # → 3
22
+
23
+ # Tenant-scoped cluster variables
24
+ c8ctl feel evaluate 'camunda.vars.env.API_BASE' --tenant my-tenant
25
+
26
+ # Compose with other tools — bulk JSON via stdin/file
27
+ c8ctl feel evaluate 'sum(items)' --vars "$(jq -c '{items: .data}' input.json)"
28
+
29
+ # Evaluate offline via feelin (no cluster needed)
30
+ c8ctl feel evaluate '1 + 2' --engine local
31
+ ```
32
+
33
+ ## Warnings
34
+
35
+ Runtime issues (unknown variables, type mismatches) come back as
36
+ warnings, not errors — `result` falls to `null` and the expression
37
+ still exits 0.
38
+
39
+ ```text
40
+ $ c8ctl feel evaluate 'unknownVar' --engine local
41
+ null
42
+
43
+ ⚠ 1 warning:
44
+ Variable 'unknownVar' not found (NO_VARIABLE_FOUND)
45
+ ```
46
+
47
+ The trailing `(NO_VARIABLE_FOUND)` is the engine's diagnostic type —
48
+ emitted when available (local engine) and omitted when not (cluster).
49
+
50
+ In JSON mode warnings expand to the engine's diagnostic shape:
51
+
52
+ ```bash
53
+ c8ctl output json
54
+ c8ctl feel evaluate 'unknownVar' --engine local
55
+ # → {"expression":"unknownVar","result":null,"warnings":[
56
+ # { "message": "Variable 'unknownVar' not found",
57
+ # "type": "NO_VARIABLE_FOUND",
58
+ # "position": { "from": 0, "to": 10 } }
59
+ # ]}
60
+ ```
61
+
62
+ The envelope `{ expression, result, warnings }` is identical across
63
+ engines. The per-warning fields differ:
64
+
65
+ | Field | `cluster` | `local` |
66
+ |---|---|---|
67
+ | `message` | always | always |
68
+ | `type` | — | feelin's `WarningType` (`NO_VARIABLE_FOUND`, `INVALID_TYPE`, …) |
69
+ | `position` | — | `{ from, to }` byte offsets in the expression |
70
+
71
+ JSON consumers should treat `type` and `position` as engine-conditional.
72
+
73
+ ## Engines
74
+
75
+ | Engine | When | Notes |
76
+ |---|---|---|
77
+ | `cluster` (default) | Connected to a Camunda 8.9+ cluster | Uses `POST /v2/expression/evaluation`. Real Zeebe FEEL semantics, full Camunda extensions, supports tenant-scoped cluster variables. |
78
+ | `local` | Offline or no cluster configured | Uses [feelin](https://github.com/nikku/feelin) in-process. Fast, but **does not support all Camunda FEEL extensions** — result may differ from the cluster engine. |
79
+
80
+ `feel evaluate` exits non-zero for CLI/input validation errors (missing
81
+ expression, unknown flag, invalid `--engine`, malformed `--var`, invalid
82
+ `--vars` JSON) and for FEEL parse failures. Runtime evaluation issues
83
+ (e.g. unresolved variables) are warnings in the output, not failures,
84
+ because they're the engine's diagnostic output rather than a CLI error.
85
+
86
+ ## Error behaviour
87
+
88
+ The cluster engine never silently falls back to `--engine local` —
89
+ hidden behaviour is bad, and feelin's missing Camunda extensions
90
+ could give a different answer. When the cluster is unavailable, you
91
+ get an explicit error with a hint:
92
+
93
+ | Failure | Detection | Behaviour |
94
+ |---|---|---|
95
+ | No cluster configured | client construction fails | error + hint to use `--engine local` |
96
+ | Parse error | 400 | error with cleaned-up FEEL parser message (no hint — fix the expression) |
97
+ | Auth failure | 401 / 403 | error + hint |
98
+ | Cluster pre-8.9 | 404 on `/v2/expression/evaluation` | error noting 8.9 requirement + hint |
99
+ | Anything else (network failure, 5xx, …) | non-400/401/403/404 | generic "cannot connect" error + hint |
100
+
101
+ The hint always reminds you that feelin behaviour may differ from
102
+ the cluster engine.
103
+
104
+ ## Setting variables
105
+
106
+ Two flags, mix and match:
107
+
108
+ - **`--var key=value`** (repeatable) — set a single variable. Path
109
+ segments separated by `.` nest. The value is parsed as JSON
110
+ (`42`, `true`, `null`, `[1,2,3]`, `{"a":1}`); if JSON parsing
111
+ fails the value is taken as a string literal.
112
+ - **`--vars '{...}'`** — bulk-load variables from a JSON object.
113
+
114
+ When both are given, `--vars` is the base and each `--var` applies
115
+ on top. Within `--var`, last write wins.
116
+
117
+ ```bash
118
+ # Simple values
119
+ c8ctl feel evaluate 'a + b' --var a=10 --var b=5
120
+ # → 15
121
+
122
+ # Strings (no JSON quoting needed)
123
+ c8ctl feel evaluate 'name' --var name=Alice
124
+ # → Alice
125
+
126
+ # Booleans, null, numbers — parsed as JSON
127
+ c8ctl feel evaluate 'if active then "yes" else "no"' --var active=true
128
+ # → yes
129
+
130
+ # Arrays — quote for the shell so '[' isn't globbed
131
+ c8ctl feel evaluate 'sum(items)' --var 'items=[1,2,3,4]'
132
+ # → 10
133
+
134
+ # Nested via dot path
135
+ c8ctl feel evaluate 'person.name' --var person.name=Alice --var person.age=30
136
+ # → Alice
137
+
138
+ # Mix --vars (bulk) with --var (override)
139
+ c8ctl feel evaluate 'a + b' --vars '{"a": 1, "b": 2}' --var b=99
140
+ # → 100
141
+
142
+ # Or load --vars from a file
143
+ c8ctl feel evaluate 'sum(items)' --vars "$(cat payload.json)"
144
+ ```
145
+
146
+ ### Conflict detection
147
+
148
+ You can't nest a property under a value that's already a
149
+ non-object — the CLI fails with the offending path:
150
+
151
+ ```
152
+ $ c8ctl feel evaluate 'foo.bar' --var foo=hello --var foo.bar=nested
153
+ ✗ Failed to feel evaluate: Cannot set --var foo.bar: 'foo' is of type string; cannot nest a property under it.
154
+ ```
155
+
156
+ The reverse direction (a `--var` overwriting an existing object
157
+ with a scalar) is allowed — last write wins.
158
+
159
+ ## See also
160
+
161
+ - [Camunda FEEL docs](https://docs.camunda.io/docs/components/modeler/feel/what-is-feel/)
162
+ - [Built-in FEEL functions](https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-introduction/)
163
+ - [Evaluate Expression API reference](https://docs.camunda.io/docs/apis-tools/orchestration-cluster-api-rest/specifications/evaluate-expression/)