@camunda8/cli 3.2.0-alpha.2 → 3.2.0-alpha.4

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 (79) hide show
  1. package/CONTEXT.md +7 -15
  2. package/EXAMPLES.md +233 -1
  3. package/README.md +44 -177
  4. package/dist/command-dispatch.js +1 -1
  5. package/dist/command-dispatch.js.map +1 -1
  6. package/dist/command-registry.d.ts +19 -7
  7. package/dist/command-registry.d.ts.map +1 -1
  8. package/dist/command-registry.js +47 -7
  9. package/dist/command-registry.js.map +1 -1
  10. package/dist/commands/deploy.d.ts +13 -0
  11. package/dist/commands/deploy.d.ts.map +1 -0
  12. package/dist/commands/deploy.js +91 -0
  13. package/dist/commands/deploy.js.map +1 -0
  14. package/dist/{deployments.d.ts → commands/helpers/deploy-helpers.d.ts} +49 -12
  15. package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -0
  16. package/dist/{deployments.js → commands/helpers/deploy-helpers.js} +16 -97
  17. package/dist/commands/helpers/deploy-helpers.js.map +1 -0
  18. package/dist/commands/identity-authorizations.d.ts +0 -13
  19. package/dist/commands/identity-authorizations.d.ts.map +1 -1
  20. package/dist/commands/identity-authorizations.js +1 -1
  21. package/dist/commands/identity-authorizations.js.map +1 -1
  22. package/dist/commands/identity.d.ts +1 -21
  23. package/dist/commands/identity.d.ts.map +1 -1
  24. package/dist/commands/identity.js +7 -8
  25. package/dist/commands/identity.js.map +1 -1
  26. package/dist/commands/profiles.d.ts +0 -32
  27. package/dist/commands/profiles.d.ts.map +1 -1
  28. package/dist/commands/profiles.js +5 -36
  29. package/dist/commands/profiles.js.map +1 -1
  30. package/dist/commands/watch.d.ts.map +1 -1
  31. package/dist/commands/watch.js +2 -2
  32. package/dist/commands/watch.js.map +1 -1
  33. package/dist/default-plugins/bpmn/c8ctl-plugin.js +7374 -137
  34. package/dist/default-plugins/bpmn/package.json +8 -1
  35. package/dist/default-plugins/element-template/c8ctl-plugin.js +10194 -248
  36. package/dist/default-plugins/element-template/package.json +11 -1
  37. package/dist/default-plugins/feel/c8ctl-plugin.js +14030 -584
  38. package/dist/default-plugins/feel/package.json +4 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +16 -9
  41. package/dist/index.js.map +1 -1
  42. package/dist/resource-extensions.d.ts.map +1 -0
  43. package/dist/resource-extensions.js.map +1 -0
  44. package/dist/vendor/bpmnlint.cjs +25907 -0
  45. package/package.json +11 -13
  46. package/dist/commands/resource-extensions.d.ts.map +0 -1
  47. package/dist/commands/resource-extensions.js.map +0 -1
  48. package/dist/default-plugins/bpmn/c8ctl-plugin.js.map +0 -1
  49. package/dist/default-plugins/bpmn/format.js +0 -64
  50. package/dist/default-plugins/bpmn/format.js.map +0 -1
  51. package/dist/default-plugins/bpmn/lint.js +0 -323
  52. package/dist/default-plugins/bpmn/lint.js.map +0 -1
  53. package/dist/default-plugins/element-template/c8ctl-plugin.js.map +0 -1
  54. package/dist/default-plugins/element-template/commands/apply.js +0 -337
  55. package/dist/default-plugins/element-template/commands/apply.js.map +0 -1
  56. package/dist/default-plugins/element-template/commands/get-properties.js +0 -350
  57. package/dist/default-plugins/element-template/commands/get-properties.js.map +0 -1
  58. package/dist/default-plugins/element-template/commands/get.js +0 -107
  59. package/dist/default-plugins/element-template/commands/get.js.map +0 -1
  60. package/dist/default-plugins/element-template/commands/info.js +0 -196
  61. package/dist/default-plugins/element-template/commands/info.js.map +0 -1
  62. package/dist/default-plugins/element-template/commands/search.js +0 -106
  63. package/dist/default-plugins/element-template/commands/search.js.map +0 -1
  64. package/dist/default-plugins/element-template/commands/sync.js +0 -36
  65. package/dist/default-plugins/element-template/commands/sync.js.map +0 -1
  66. package/dist/default-plugins/element-template/helpers.js +0 -515
  67. package/dist/default-plugins/element-template/helpers.js.map +0 -1
  68. package/dist/default-plugins/element-template/marketplace.js +0 -597
  69. package/dist/default-plugins/element-template/marketplace.js.map +0 -1
  70. package/dist/default-plugins/element-template/template-ref.js +0 -243
  71. package/dist/default-plugins/element-template/template-ref.js.map +0 -1
  72. package/dist/default-plugins/feel/c8ctl-plugin.js.map +0 -1
  73. package/dist/default-plugins/hello-world/README.md +0 -161
  74. package/dist/default-plugins/hello-world/c8ctl-plugin.js +0 -69
  75. package/dist/default-plugins/hello-world/package.json +0 -8
  76. package/dist/deployments.d.ts.map +0 -1
  77. package/dist/deployments.js.map +0 -1
  78. /package/dist/{commands/resource-extensions.d.ts → resource-extensions.d.ts} +0 -0
  79. /package/dist/{commands/resource-extensions.js → resource-extensions.js} +0 -0
@@ -1,515 +0,0 @@
1
- /**
2
- * Helpers for the element-template plugin: --set parsing, file/URL fetching,
3
- * shared element-template schema types.
4
- */
5
- import { existsSync, readFileSync } from "node:fs";
6
- import { resolve as resolvePath } from "node:path";
7
- import semver from "semver";
8
- if (!globalThis.c8ctl)
9
- throw new Error("c8ctl runtime not initialised");
10
- const c8ctl = globalThis.c8ctl;
11
- /**
12
- * User-Agent header sent on every outbound HTTP call this plugin makes
13
- * (marketplace index/template fetches and ad-hoc template URL loads),
14
- * so traffic from c8ctl is attributable in upstream logs.
15
- */
16
- export const USER_AGENT = `c8ctl-plugin-element-template/${c8ctl.version}`;
17
- /**
18
- * Subcommands that write the primary payload to stdout (apply, get)
19
- * must call this once before the first write. Closing the downstream
20
- * pipe early (e.g. `apply <id> ... | head -c 100`) raises EPIPE on
21
- * `process.stdout`; without a listener Node treats it as an
22
- * uncaught 'error' event and crashes with a stack trace. Swallow it
23
- * and exit cleanly — there's no useful work left to do once the
24
- * consumer has gone away.
25
- *
26
- * Idempotent: the handler is registered at most once per process so
27
- * repeated calls from different subcommand modules don't accumulate.
28
- */
29
- let stdoutEpipeInstalled = false;
30
- export function installStdoutEpipeHandler() {
31
- if (stdoutEpipeInstalled) {
32
- return;
33
- }
34
- stdoutEpipeInstalled = true;
35
- process.stdout.on("error", (err) => {
36
- if (err.code === "EPIPE") {
37
- process.exit(0);
38
- }
39
- throw err;
40
- });
41
- }
42
- export function isRecord(value) {
43
- return value != null && typeof value === "object" && !Array.isArray(value);
44
- }
45
- // Concrete version forms accepted for --engine-version:
46
- // - x.y
47
- // - x.y.z
48
- // - x.y[-prerelease] / x.y.z[-prerelease]
49
- // Ranges (e.g. ^8.8, >=8.8, 8.8 || 8.9) are intentionally excluded.
50
- const ENGINE_VERSION_PATTERN = /^\d+\.\d+(?:\.\d+)?(?:-[0-9A-Za-z.-]+)?$/;
51
- // ---------------------------------------------------------------------------
52
- // File / URL fetching
53
- // ---------------------------------------------------------------------------
54
- export function isUrl(input) {
55
- return input.startsWith("https://") || input.startsWith("http://");
56
- }
57
- /**
58
- * Rewrite a GitHub blob URL to the raw content URL.
59
- * https://github.com/<owner>/<repo>/blob/<ref>/<path>
60
- * → https://raw.githubusercontent.com/<owner>/<repo>/<ref>/<path>
61
- */
62
- export function toRawGitHubUrl(url) {
63
- const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/blob\/(.+)$/);
64
- if (match) {
65
- const [, owner, repo, rest] = match;
66
- return `https://raw.githubusercontent.com/${owner}/${repo}/${rest}`;
67
- }
68
- return url;
69
- }
70
- export async function readFileOrUrl(input) {
71
- if (input.startsWith("http://")) {
72
- throw new Error(`Insecure template URL rejected: ${input}\n` +
73
- "Template URLs must use HTTPS to protect credentials and content integrity.");
74
- }
75
- if (isUrl(input)) {
76
- const resolvedUrl = toRawGitHubUrl(input);
77
- const response = await fetch(resolvedUrl, {
78
- headers: { "User-Agent": USER_AGENT },
79
- signal: AbortSignal.timeout(30_000),
80
- });
81
- if (!response.ok) {
82
- throw new Error(`Failed to fetch ${resolvedUrl}: HTTP ${response.status}`);
83
- }
84
- return response.text();
85
- }
86
- const resolved = resolvePath(input);
87
- if (!existsSync(resolved)) {
88
- throw new Error(`File not found: ${input}`);
89
- }
90
- return readFileSync(resolved, "utf-8");
91
- }
92
- // ---------------------------------------------------------------------------
93
- // --set flag: template property mutation
94
- // ---------------------------------------------------------------------------
95
- /** Binding type shorthand prefixes for disambiguation. */
96
- export const BINDING_TYPE_SHORTHANDS = {
97
- input: "zeebe:input",
98
- output: "zeebe:output",
99
- header: "zeebe:taskHeader",
100
- property: "zeebe:property",
101
- taskDefinition: "zeebe:taskDefinition",
102
- };
103
- /** Get the user-facing binding name for a template property. */
104
- export function getBindingName(prop) {
105
- const b = prop.binding;
106
- if (!b)
107
- return null;
108
- if (b.name !== undefined)
109
- return b.name;
110
- if (b.key !== undefined)
111
- return b.key;
112
- if (b.property !== undefined)
113
- return b.property;
114
- // zeebe:output bindings use `source` as the user-facing identifier
115
- // (the expression that produces the value). Without this fallback,
116
- // output bindings are invisible to `--set` and `get-properties`.
117
- if (b.source !== undefined)
118
- return b.source;
119
- return null;
120
- }
121
- /** Get the shorthand label for a binding type (e.g. "zeebe:taskHeader" → "header"). */
122
- export function getBindingTypeShorthand(bindingType) {
123
- const entry = Object.entries(BINDING_TYPE_SHORTHANDS).find(([, v]) => v === bindingType);
124
- return entry ? entry[0] : bindingType;
125
- }
126
- /** Return only the properties that can be targeted by --set. */
127
- export function getSettableProperties(properties) {
128
- return properties.filter((p) => p.type !== "Hidden" && getBindingName(p) !== null);
129
- }
130
- /**
131
- * A property is "required" if either `optional: false` or
132
- * `constraints.notEmpty: true`. The element-template schema accepts both
133
- * forms; templates in the wild use them interchangeably.
134
- */
135
- export function isPropertyRequired(prop) {
136
- if (prop.optional === false)
137
- return true;
138
- if (prop.constraints?.notEmpty === true)
139
- return true;
140
- return false;
141
- }
142
- /**
143
- * Render an element-template `condition` object as a human-readable
144
- * expression. Handles the common forms (`equals`, `oneOf`, `isActive`)
145
- * and best-effort handles `allMatch`. Returns null for unrecognised
146
- * shapes so the caller can fall back to a generic "(conditional)"
147
- * marker.
148
- *
149
- * Examples:
150
- * { property: "method", equals: "POST" } → 'method = "POST"'
151
- * { property: "method", oneOf: ["POST","PUT"] } → 'method ∈ {"POST", "PUT"}'
152
- * { property: "auth", isActive: true } → 'auth is active'
153
- */
154
- export function formatCondition(condition) {
155
- if (!condition)
156
- return null;
157
- if (Array.isArray(condition.allMatch)) {
158
- const parts = condition.allMatch
159
- .map((c) => formatCondition(c))
160
- .filter((p) => Boolean(p));
161
- return parts.length > 0 ? parts.join(" AND ") : null;
162
- }
163
- if (!condition.property)
164
- return null;
165
- if (Object.hasOwn(condition, "equals")) {
166
- return `${condition.property} = ${formatConditionValue(condition.equals)}`;
167
- }
168
- if (Array.isArray(condition.oneOf)) {
169
- return `${condition.property} ∈ {${condition.oneOf.map(formatConditionValue).join(", ")}}`;
170
- }
171
- if (condition.isActive === true)
172
- return `${condition.property} is active`;
173
- if (condition.isActive === false)
174
- return `${condition.property} is inactive`;
175
- return null;
176
- }
177
- function formatConditionValue(value) {
178
- return JSON.stringify(value);
179
- }
180
- /**
181
- * Build the structured property descriptor used by both text and JSON
182
- * output of `get-properties`. Surfaces every field an agent or human
183
- * needs to pick a value without re-reading the raw template.
184
- */
185
- export function getPropertyDetail(prop, groupLabelMap) {
186
- const bindingName = getBindingName(prop);
187
- const bindingType = prop.binding?.type;
188
- const detail = {
189
- // `id` is the schema's stable identifier — optional in the spec
190
- // (~37% of OOTB properties don't have one) but the only reliable
191
- // discriminator for properties that share binding name + type
192
- // (operation-conditional duplicates).
193
- id: prop.id,
194
- name: bindingName,
195
- type: prop.type,
196
- label: prop.label,
197
- description: prop.description,
198
- // Both `groupId` (raw template id, used by --group filtering) and
199
- // `group` (user-facing label) are exposed so callers can filter
200
- // by the stable id without giving up the readable display string.
201
- groupId: prop.group,
202
- group: prop.group
203
- ? (groupLabelMap?.get(prop.group) ?? prop.group)
204
- : undefined,
205
- bindingType,
206
- bindingShorthand: bindingType
207
- ? getBindingTypeShorthand(bindingType)
208
- : undefined,
209
- required: isPropertyRequired(prop),
210
- feel: prop.feel,
211
- default: prop.value,
212
- choices: prop.choices?.map((c) => ({ value: c.value, label: c.name })),
213
- condition: prop.condition ?? undefined,
214
- conditionText: formatCondition(prop.condition),
215
- };
216
- if (prop.constraints?.pattern) {
217
- detail.pattern = {
218
- value: prop.constraints.pattern.value,
219
- message: prop.constraints.pattern.message,
220
- };
221
- }
222
- return detail;
223
- }
224
- /**
225
- * Compile a shell-style glob to a regex. Only `*` is special — every
226
- * other character matches literally. Used for `show-properties auth*`
227
- * style positional matching.
228
- *
229
- * "auth*" → /^auth.*$/
230
- * "url" → /^url$/
231
- * "a.b.*c" → /^a\.b\..*c$/
232
- */
233
- export function globToRegex(pattern) {
234
- const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
235
- return new RegExp(`^${escaped.replace(/\*/g, ".*")}$`);
236
- }
237
- /**
238
- * Parse a --set key=value string. If key contains a `:` prefix,
239
- * resolve the binding type shorthand.
240
- *
241
- * Whitespace normalisation applied to the value:
242
- * - Leading and trailing whitespace is stripped so that
243
- * `--set 'key= hello '` is equivalent to `--set key=hello`.
244
- * - If the value starts with `=` (a FEEL expression), leading whitespace
245
- * immediately after the `=` prefix is also stripped, so that
246
- * `--set 'key== value'` is equivalent to `--set 'key==value'`.
247
- * - Internal whitespace is preserved: `hello world` stays `hello world`.
248
- */
249
- export function parseSetArg(arg) {
250
- const eqIndex = arg.indexOf("=");
251
- if (eqIndex === -1) {
252
- throw new Error(`Invalid --set format: "${arg}". Expected key=value (e.g. --set method=POST)`);
253
- }
254
- const key = arg.slice(0, eqIndex);
255
- let value = arg.slice(eqIndex + 1).trim();
256
- // Normalise FEEL values: strip leading whitespace immediately after the
257
- // `=` prefix so `= value` and `=value` are equivalent.
258
- if (value.startsWith("=") && value.length > 1) {
259
- value = `=${value.slice(1).trimStart()}`;
260
- }
261
- const colonIndex = key.indexOf(":");
262
- if (colonIndex !== -1) {
263
- const prefix = key.slice(0, colonIndex);
264
- const name = key.slice(colonIndex + 1);
265
- const bindingType = BINDING_TYPE_SHORTHANDS[prefix];
266
- if (!bindingType) {
267
- const valid = Object.keys(BINDING_TYPE_SHORTHANDS).join(", ");
268
- throw new Error(`Unknown binding type prefix "${prefix}". Valid prefixes: ${valid}`);
269
- }
270
- return { bindingTypeFilter: bindingType, name, value };
271
- }
272
- return { bindingTypeFilter: null, name: key, value };
273
- }
274
- /**
275
- * For a property with `feel: "required"`, Modeler always stores the value
276
- * as a FEEL expression (prefixed with `=`). Auto-prepend `=` when the
277
- * user-supplied value doesn't already start with one, so `--set key=orderId`
278
- * behaves like Modeler instead of producing invalid BPMN.
279
- *
280
- * The prepend is skipped when:
281
- * - `prop.feel` is not `"required"` (no-op for `optional` / `static` / absent)
282
- * - the value is already a FEEL expression (starts with `=`)
283
- * - the value is empty (would produce `=` alone — leave as-is for validation)
284
- */
285
- export function maybePrependFeel(prop, value) {
286
- if (prop.feel !== "required") {
287
- return value;
288
- }
289
- if (value === "" || value.startsWith("=")) {
290
- return value;
291
- }
292
- return `=${value}`;
293
- }
294
- /**
295
- * Find every template property matching a binding name, optionally
296
- * filtered by binding type. Returns a non-empty array — the caller
297
- * applies the value to ALL matches.
298
- *
299
- * Multi-match handling:
300
- * - Same name + SAME binding type → conditional duplicates (template
301
- * authors use these to vary defaults/labels per operation while
302
- * all targeting the same `<zeebe:input target="x">`). Apply the
303
- * value to all; the engine's condition evaluation drops inactive
304
- * ones at apply time.
305
- * - Same name + DIFFERENT binding types → genuine ambiguity (e.g.
306
- * `correlationKey` as both `zeebe:input` and `zeebe:taskHeader`
307
- * writes to two different BPMN locations). Throw, ask the user
308
- * to qualify with `<binding-type>:<name>`.
309
- */
310
- export function findPropertiesByBindingName(properties, name, bindingTypeFilter) {
311
- const settable = getSettableProperties(properties);
312
- const matches = settable.filter((p) => {
313
- if (getBindingName(p) !== name)
314
- return false;
315
- if (bindingTypeFilter && p.binding?.type !== bindingTypeFilter)
316
- return false;
317
- return true;
318
- });
319
- if (matches.length === 0) {
320
- const available = [
321
- ...new Set(settable.map(getBindingName).filter((n) => Boolean(n))),
322
- ];
323
- throw new Error(`Unknown property "${name}". Available properties for --set:\n ${available.join(", ")}`);
324
- }
325
- // Multi-match across binding types is genuinely ambiguous — different
326
- // binding types write to different BPMN locations.
327
- const types = new Set(matches.map((p) => p.binding?.type));
328
- if (types.size > 1) {
329
- const qualified = [...types].map((t) => `${getBindingTypeShorthand(t ?? "")}:${name}`);
330
- throw new Error(`Ambiguous property "${name}" matches ${matches.length} bindings across ${types.size} binding types. ` +
331
- `Use a qualified name: ${qualified.join(", ")}`);
332
- }
333
- return matches;
334
- }
335
- export function validateDropdownValue(prop, name, value) {
336
- if (!prop.choices)
337
- return;
338
- const validValues = prop.choices.map((c) => c.value);
339
- if (!validValues.includes(value)) {
340
- throw new Error(`Invalid value "${value}" for "${name}". Valid choices: ${validValues.join(", ")}`);
341
- }
342
- }
343
- /**
344
- * Apply --set overrides to template properties. Mutates the template
345
- * in place. When a name matches multiple conditional duplicates, the
346
- * value is set on all of them — the engine's condition evaluation
347
- * picks the active one at apply time. Returns the list of binding
348
- * names that were set (deduped) for the post-apply unmet-condition
349
- * warning check.
350
- */
351
- export function applySetOverrides(properties, setArgs) {
352
- // Track by object reference so qualified sets like `input:foo=...` and
353
- // `header:foo=...` preserve their binding type through to warnUnmetConditions.
354
- const setProperties = new Set();
355
- for (const arg of setArgs) {
356
- const { bindingTypeFilter, name, value } = parseSetArg(arg);
357
- const matches = findPropertiesByBindingName(properties, name, bindingTypeFilter);
358
- for (const prop of matches) {
359
- const effectiveValue = maybePrependFeel(prop, value);
360
- if (prop.choices) {
361
- validateDropdownValue(prop, name, effectiveValue);
362
- }
363
- prop.value = effectiveValue;
364
- setProperties.add(prop);
365
- }
366
- }
367
- return [...setProperties];
368
- }
369
- /**
370
- * Check which --set bindings actually made it into the output XML.
371
- * Warn for any that were dropped (unmet condition).
372
- */
373
- export function warnUnmetConditions(logger, resultXml, setProperties) {
374
- for (const prop of setProperties) {
375
- if (!prop.binding)
376
- continue;
377
- const name = getBindingName(prop);
378
- if (!name)
379
- continue;
380
- const bt = prop.binding.type;
381
- let present = false;
382
- if (bt === "zeebe:input")
383
- present = resultXml.includes(`target="${name}"`);
384
- else if (bt === "zeebe:taskHeader")
385
- present = resultXml.includes(`key="${name}"`);
386
- else if (bt === "zeebe:taskDefinition")
387
- present = true;
388
- else
389
- present = resultXml.includes(name);
390
- if (!present) {
391
- logger.warn(`Property "${name}" was set but not applied (unmet condition). Check that controlling properties are also set.`);
392
- }
393
- }
394
- }
395
- // ---------------------------------------------------------------------------
396
- // Plugin arg parser — extracts --set, --in-place/-i, and positionals
397
- // ---------------------------------------------------------------------------
398
- /**
399
- * Parse plugin args, separating flags from positionals.
400
- * - `--set foo=bar` (or `--set=foo=bar`) is repeatable, collected into setArgs[]
401
- * - `--in-place` / `-i` is a boolean
402
- * - everything else is a positional
403
- *
404
- * `--help` / `-h` is handled by the host before args reach here.
405
- * Unknown flags return { error: '...' } so the caller can warn and exit.
406
- */
407
- export function parseArgs(args) {
408
- const result = {
409
- inPlace: false,
410
- setArgs: [],
411
- positionals: [],
412
- error: null,
413
- };
414
- for (let i = 0; i < args.length; i++) {
415
- const arg = args[i];
416
- if (arg === "--") {
417
- result.positionals.push(...args.slice(i + 1));
418
- break;
419
- }
420
- if (arg === "--in-place" || arg === "-i") {
421
- result.inPlace = true;
422
- continue;
423
- }
424
- if (arg === "--set") {
425
- const next = args[i + 1];
426
- if (next === undefined) {
427
- result.error = "--set requires a value (e.g. --set method=POST)";
428
- return result;
429
- }
430
- result.setArgs.push(next);
431
- i++;
432
- continue;
433
- }
434
- if (arg.startsWith("--set=")) {
435
- result.setArgs.push(arg.slice("--set=".length));
436
- continue;
437
- }
438
- if (arg.startsWith("-")) {
439
- result.error = `Unknown flag: ${arg}`;
440
- return result;
441
- }
442
- result.positionals.push(arg);
443
- }
444
- return result;
445
- }
446
- /**
447
- * Parse and remove repeatable `--engine-version` flags from args.
448
- * Last flag wins. Content after `--` is treated as positional.
449
- */
450
- export function parseEngineVersionFlag(args, usage) {
451
- let engineVersion = null;
452
- const rest = [];
453
- let afterDoubleDash = false;
454
- for (let i = 0; i < args.length; i++) {
455
- const arg = args[i];
456
- if (afterDoubleDash) {
457
- rest.push(arg);
458
- continue;
459
- }
460
- if (arg === "--") {
461
- afterDoubleDash = true;
462
- rest.push(arg);
463
- continue;
464
- }
465
- if (arg === "--engine-version" || arg.startsWith("--engine-version=")) {
466
- const raw = arg === "--engine-version"
467
- ? args[++i]
468
- : arg.slice("--engine-version=".length);
469
- if (raw === undefined || raw === "") {
470
- throw new Error(`--engine-version requires a value (e.g. 8.8.0). ${usage}`);
471
- }
472
- engineVersion = validateEngineVersion(raw, usage);
473
- continue;
474
- }
475
- rest.push(arg);
476
- }
477
- return { engineVersion, rest };
478
- }
479
- function validateEngineVersion(value, usage) {
480
- if (!ENGINE_VERSION_PATTERN.test(value)) {
481
- throw new Error(`--engine-version must be a concrete Camunda version (e.g. 8.8.0 or 8.8), not a range: "${value}". ${usage}`);
482
- }
483
- const coerced = semver.coerce(value);
484
- const normalized = coerced ? semver.valid(coerced) : null;
485
- if (!normalized) {
486
- throw new Error(`--engine-version must be a valid version (e.g. 8.8.0 or 8.8); got "${value}". ${usage}`);
487
- }
488
- return normalized;
489
- }
490
- /**
491
- * Parse JSON template content with explicit error wrapping. Surfaces
492
- * "expected an object" instead of letting `unknown.properties` blow up
493
- * downstream.
494
- */
495
- function isTemplate(value) {
496
- return isRecord(value) && Array.isArray(value.properties);
497
- }
498
- export function parseTemplateJson(content) {
499
- const parsed = JSON.parse(content);
500
- if (!isRecord(parsed)) {
501
- throw new Error("Element template must be a JSON object");
502
- }
503
- if (!Array.isArray(parsed.properties)) {
504
- throw new Error("Element template is missing a properties array");
505
- }
506
- if (!isTemplate(parsed)) {
507
- throw new Error("Element template did not match the expected shape");
508
- }
509
- // We trust the rest of the shape because the source is either the
510
- // marketplace (commit-pinned, schema-validated upstream) or a
511
- // file/URL the user owns. Read-time strict validation would block
512
- // 90% of the workflow without catching meaningful bugs.
513
- return parsed;
514
- }
515
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../default-plugins/element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