@camunda8/cli 3.3.0 → 3.4.0-alpha.1

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.
@@ -8059,14 +8059,96 @@ var init_dist4 = __esm({
8059
8059
  });
8060
8060
 
8061
8061
  // default-plugins/element-template/commands/apply.ts
8062
- import { existsSync as existsSync4, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
8063
8062
  import { createRequire } from "node:module";
8064
- import { dirname, resolve as resolvePath3 } from "node:path";
8065
- import { fileURLToPath } from "node:url";
8063
+
8064
+ // default-plugins/element-template/moddle.ts
8065
+ function isModdleElement(value) {
8066
+ if (typeof value !== "object" || value === null) {
8067
+ return false;
8068
+ }
8069
+ if (!("get" in value)) {
8070
+ return false;
8071
+ }
8072
+ return typeof value.get === "function";
8073
+ }
8074
+ function getModdleString(element, name2) {
8075
+ const value = element.get(name2);
8076
+ return typeof value === "string" ? value : void 0;
8077
+ }
8078
+ function getModdleNumber(element, name2) {
8079
+ const value = element.get(name2);
8080
+ return typeof value === "number" ? value : void 0;
8081
+ }
8082
+ function getModdleElement(element, name2) {
8083
+ const value = element.get(name2);
8084
+ return isModdleElement(value) ? value : void 0;
8085
+ }
8086
+ function getModdleList(element, name2) {
8087
+ if (!element) {
8088
+ return [];
8089
+ }
8090
+ const value = element.get(name2);
8091
+ return Array.isArray(value) ? value.filter(isModdleElement) : [];
8092
+ }
8093
+
8094
+ // default-plugins/element-template/binding.ts
8095
+ function findExtensionByType(extensionElements, type) {
8096
+ if (!extensionElements) {
8097
+ return void 0;
8098
+ }
8099
+ const values = getModdleList(extensionElements, "values");
8100
+ return values.find((v) => v.$type === type);
8101
+ }
8102
+ function findExtensionContainers(extensionElements) {
8103
+ return {
8104
+ ioMapping: findExtensionByType(extensionElements, "zeebe:IoMapping"),
8105
+ taskHeaders: findExtensionByType(extensionElements, "zeebe:TaskHeaders"),
8106
+ taskDefinition: findExtensionByType(
8107
+ extensionElements,
8108
+ "zeebe:TaskDefinition"
8109
+ ),
8110
+ zeebeProperties: findExtensionByType(extensionElements, "zeebe:Properties")
8111
+ };
8112
+ }
8113
+ function resolveBindingTarget(binding, containers) {
8114
+ switch (binding.type) {
8115
+ case "zeebe:input": {
8116
+ const inputs = getModdleList(containers.ioMapping, "inputParameters");
8117
+ const child = inputs.find((p) => p.target === binding.name);
8118
+ return child ? { child, property: "source" } : void 0;
8119
+ }
8120
+ case "zeebe:output": {
8121
+ const outputs = getModdleList(containers.ioMapping, "outputParameters");
8122
+ const child = outputs.find((p) => p.source === binding.source);
8123
+ return child ? { child, property: "target" } : void 0;
8124
+ }
8125
+ case "zeebe:taskHeader": {
8126
+ const headers = getModdleList(containers.taskHeaders, "values");
8127
+ const child = headers.find((h) => h.key === binding.key);
8128
+ return child ? { child, property: "value" } : void 0;
8129
+ }
8130
+ case "zeebe:property": {
8131
+ const props = getModdleList(containers.zeebeProperties, "properties");
8132
+ const child = props.find((p) => p.name === binding.name);
8133
+ return child ? { child, property: "value" } : void 0;
8134
+ }
8135
+ case "zeebe:taskDefinition": {
8136
+ return containers.taskDefinition && binding.property ? { child: containers.taskDefinition, property: binding.property } : void 0;
8137
+ }
8138
+ default:
8139
+ return void 0;
8140
+ }
8141
+ }
8066
8142
 
8067
8143
  // default-plugins/element-template/helpers.ts
8068
8144
  var import_semver = __toESM(require_semver2(), 1);
8069
- import { existsSync, readFileSync } from "node:fs";
8145
+ import {
8146
+ existsSync,
8147
+ readFileSync,
8148
+ renameSync,
8149
+ unlinkSync,
8150
+ writeFileSync
8151
+ } from "node:fs";
8070
8152
  import { resolve as resolvePath } from "node:path";
8071
8153
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
8072
8154
  var c8ctl = globalThis.c8ctl;
@@ -8087,6 +8169,25 @@ function installStdoutEpipeHandler() {
8087
8169
  function isRecord(value) {
8088
8170
  return value != null && typeof value === "object" && !Array.isArray(value);
8089
8171
  }
8172
+ function atomicOverwriteFile(targetPath, contents) {
8173
+ const target = resolvePath(targetPath);
8174
+ const tmp = `${target}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
8175
+ try {
8176
+ writeFileSync(tmp, contents, "utf-8");
8177
+ renameSync(tmp, target);
8178
+ } catch (error3) {
8179
+ try {
8180
+ unlinkSync(tmp);
8181
+ } catch {
8182
+ }
8183
+ const code = isRecord(error3) && typeof error3.code === "string" ? error3.code : void 0;
8184
+ if (code === "EXDEV") {
8185
+ writeFileSync(target, contents, "utf-8");
8186
+ return;
8187
+ }
8188
+ throw error3;
8189
+ }
8190
+ }
8090
8191
  var ENGINE_VERSION_PATTERN = /^\d+\.\d+(?:\.\d+)?(?:-[0-9A-Za-z.-]+)?$/;
8091
8192
  function isUrl(input) {
8092
8193
  return input.startsWith("https://") || input.startsWith("http://");
@@ -8444,9 +8545,9 @@ import {
8444
8545
  mkdirSync,
8445
8546
  openSync,
8446
8547
  readFileSync as readFileSync2,
8447
- renameSync,
8448
- unlinkSync,
8449
- writeFileSync,
8548
+ renameSync as renameSync2,
8549
+ unlinkSync as unlinkSync2,
8550
+ writeFileSync as writeFileSync2,
8450
8551
  writeSync
8451
8552
  } from "node:fs";
8452
8553
  import { join } from "node:path";
@@ -8537,7 +8638,7 @@ function acquireSyncLock(logger) {
8537
8638
  );
8538
8639
  }
8539
8640
  try {
8540
- unlinkSync(path);
8641
+ unlinkSync2(path);
8541
8642
  } catch {
8542
8643
  }
8543
8644
  if (tryCreateLock(path, payload)) {
@@ -8551,7 +8652,7 @@ function acquireSyncLock(logger) {
8551
8652
  }
8552
8653
  function releaseSyncLock() {
8553
8654
  try {
8554
- unlinkSync(getSyncLockPath());
8655
+ unlinkSync2(getSyncLockPath());
8555
8656
  } catch {
8556
8657
  }
8557
8658
  }
@@ -8612,11 +8713,11 @@ function loadFetchedAt() {
8612
8713
  function atomicWriteFileSync(target, contents) {
8613
8714
  const tmp = `${target}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
8614
8715
  try {
8615
- writeFileSync(tmp, contents, "utf-8");
8616
- renameSync(tmp, target);
8716
+ writeFileSync2(tmp, contents, "utf-8");
8717
+ renameSync2(tmp, target);
8617
8718
  } catch (error3) {
8618
8719
  try {
8619
- unlinkSync(tmp);
8720
+ unlinkSync2(tmp);
8620
8721
  } catch {
8621
8722
  }
8622
8723
  throw error3;
@@ -9050,10 +9151,10 @@ async function loadTemplate(templateArg, {
9050
9151
  };
9051
9152
  }
9052
9153
 
9053
- // default-plugins/element-template/commands/apply.ts
9054
- if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9055
- var c8ctl3 = globalThis.c8ctl;
9056
- var require2 = createRequire(import.meta.url);
9154
+ // default-plugins/element-template/vendor.ts
9155
+ import { existsSync as existsSync4 } from "node:fs";
9156
+ import { dirname, resolve as resolvePath3 } from "node:path";
9157
+ import { fileURLToPath } from "node:url";
9057
9158
  var __dirname = dirname(fileURLToPath(import.meta.url));
9058
9159
  function resolveVendorBundle() {
9059
9160
  const candidates = [
@@ -9061,19 +9162,11 @@ function resolveVendorBundle() {
9061
9162
  __dirname,
9062
9163
  "..",
9063
9164
  "..",
9064
- "..",
9065
9165
  "dist",
9066
9166
  "vendor",
9067
9167
  "bpmn-element-templates.cjs"
9068
9168
  ),
9069
- resolvePath3(
9070
- __dirname,
9071
- "..",
9072
- "..",
9073
- "..",
9074
- "vendor",
9075
- "bpmn-element-templates.cjs"
9076
- )
9169
+ resolvePath3(__dirname, "..", "..", "vendor", "bpmn-element-templates.cjs")
9077
9170
  ];
9078
9171
  for (const path of candidates) {
9079
9172
  if (existsSync4(path)) {
@@ -9085,32 +9178,21 @@ function resolveVendorBundle() {
9085
9178
  Searched: ${candidates.join(", ")}`
9086
9179
  );
9087
9180
  }
9088
- function findExtensionByType(extensionElements, type) {
9089
- if (!extensionElements) {
9090
- return void 0;
9091
- }
9092
- const values = extensionElements.get("values");
9093
- return values?.find((v) => v.$type === type);
9094
- }
9181
+
9182
+ // default-plugins/element-template/commands/apply.ts
9183
+ if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9184
+ var c8ctl3 = globalThis.c8ctl;
9185
+ var require2 = createRequire(import.meta.url);
9095
9186
  function forceSetValues(modeler, element, template, setArgs) {
9096
9187
  const modeling = modeler.get("modeling");
9097
- const extensionElements = element.businessObject.get("extensionElements");
9188
+ const extensionElements = getModdleElement(
9189
+ element.businessObject,
9190
+ "extensionElements"
9191
+ );
9098
9192
  if (!extensionElements) {
9099
9193
  return;
9100
9194
  }
9101
- const ioMapping = findExtensionByType(extensionElements, "zeebe:IoMapping");
9102
- const taskHeaders = findExtensionByType(
9103
- extensionElements,
9104
- "zeebe:TaskHeaders"
9105
- );
9106
- const taskDefinition = findExtensionByType(
9107
- extensionElements,
9108
- "zeebe:TaskDefinition"
9109
- );
9110
- const zeebeProperties = findExtensionByType(
9111
- extensionElements,
9112
- "zeebe:Properties"
9113
- );
9195
+ const containers = findExtensionContainers(extensionElements);
9114
9196
  for (const arg of setArgs) {
9115
9197
  const { bindingTypeFilter, name: name2, value } = parseSetArg(arg);
9116
9198
  const matches = findPropertiesByBindingName(
@@ -9119,61 +9201,14 @@ function forceSetValues(modeler, element, template, setArgs) {
9119
9201
  bindingTypeFilter
9120
9202
  );
9121
9203
  for (const prop of matches) {
9204
+ if (!prop.binding) continue;
9122
9205
  const effectiveValue = maybePrependFeel(prop, value);
9123
- updateModdleForProperty(modeling, element, prop, effectiveValue, {
9124
- ioMapping,
9125
- taskHeaders,
9126
- taskDefinition,
9127
- zeebeProperties
9128
- });
9129
- }
9130
- }
9131
- }
9132
- function updateModdleForProperty(modeling, element, prop, value, containers) {
9133
- const binding = prop.binding;
9134
- if (!binding) {
9135
- return;
9136
- }
9137
- switch (binding.type) {
9138
- case "zeebe:input": {
9139
- const inputs = containers.ioMapping?.get("inputParameters") ?? [];
9140
- const child = inputs.find((p) => p.target === binding.name);
9141
- if (child) {
9142
- modeling.updateModdleProperties(element, child, { source: value });
9143
- }
9144
- return;
9145
- }
9146
- case "zeebe:output": {
9147
- const outputs = containers.ioMapping?.get("outputParameters") ?? [];
9148
- const child = outputs.find((p) => p.source === binding.source);
9149
- if (child) {
9150
- modeling.updateModdleProperties(element, child, { target: value });
9151
- }
9152
- return;
9153
- }
9154
- case "zeebe:taskHeader": {
9155
- const headers = containers.taskHeaders?.get("values") ?? [];
9156
- const child = headers.find((h) => h.key === binding.key);
9157
- if (child) {
9158
- modeling.updateModdleProperties(element, child, { value });
9159
- }
9160
- return;
9161
- }
9162
- case "zeebe:property": {
9163
- const props = containers.zeebeProperties?.get("properties") ?? [];
9164
- const child = props.find((p) => p.name === binding.name);
9165
- if (child) {
9166
- modeling.updateModdleProperties(element, child, { value });
9167
- }
9168
- return;
9169
- }
9170
- case "zeebe:taskDefinition": {
9171
- if (containers.taskDefinition && binding.property) {
9172
- modeling.updateModdleProperties(element, containers.taskDefinition, {
9173
- [binding.property]: value
9206
+ const target = resolveBindingTarget(prop.binding, containers);
9207
+ if (target) {
9208
+ modeling.updateModdleProperties(element, target.child, {
9209
+ [target.property]: effectiveValue
9174
9210
  });
9175
9211
  }
9176
- return;
9177
9212
  }
9178
9213
  }
9179
9214
  }
@@ -9323,24 +9358,178 @@ async function applySubcommand(args) {
9323
9358
  }
9324
9359
  process.stdout.write(resultXml);
9325
9360
  }
9326
- function atomicOverwriteFile(targetPath, contents) {
9327
- const target = resolvePath3(targetPath);
9328
- const tmp = `${target}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
9361
+
9362
+ // default-plugins/element-template/commands/edit.ts
9363
+ import { createRequire as createRequire2 } from "node:module";
9364
+ if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9365
+ var c8ctl4 = globalThis.c8ctl;
9366
+ var require3 = createRequire2(import.meta.url);
9367
+ async function planEdit(modeler, elementId, setArgs) {
9368
+ const elementRegistry = modeler.get("elementRegistry");
9369
+ const element = elementRegistry.get(elementId);
9370
+ if (!element) {
9371
+ throw new Error(`Element "${elementId}" not found in the BPMN diagram`);
9372
+ }
9373
+ const templateId = getModdleString(element.businessObject, "modelerTemplate");
9374
+ if (!templateId) {
9375
+ throw new Error(
9376
+ `Element "${elementId}" has no element template applied (no zeebe:modelerTemplate attribute). Use 'apply' to apply one first.`
9377
+ );
9378
+ }
9379
+ const templateVersion = getModdleNumber(
9380
+ element.businessObject,
9381
+ "modelerTemplateVersion"
9382
+ );
9383
+ if (templateVersion === void 0) {
9384
+ throw new Error(
9385
+ `Element "${elementId}" has zeebe:modelerTemplate="${templateId}" but no recorded zeebe:modelerTemplateVersion. 'edit' requires a pinned version to resolve the exact template that was applied \u2014 use 'apply' with an explicit template reference instead.`
9386
+ );
9387
+ }
9388
+ const template = await resolveOotbTemplate({
9389
+ kind: "id",
9390
+ id: templateId,
9391
+ version: templateVersion
9392
+ });
9393
+ const extensionElements = getModdleElement(
9394
+ element.businessObject,
9395
+ "extensionElements"
9396
+ );
9397
+ const containers = findExtensionContainers(extensionElements);
9398
+ const writesByChild = /* @__PURE__ */ new Map();
9399
+ for (const arg of setArgs) {
9400
+ const { bindingTypeFilter, name: name2, value } = parseSetArg(arg);
9401
+ const matches = findPropertiesByBindingName(
9402
+ template.properties,
9403
+ name2,
9404
+ bindingTypeFilter
9405
+ );
9406
+ let materialized = false;
9407
+ for (const prop of matches) {
9408
+ if (!prop.binding) continue;
9409
+ const effectiveValue = maybePrependFeel(prop, value);
9410
+ if (prop.choices) {
9411
+ validateDropdownValue(prop, name2, effectiveValue);
9412
+ }
9413
+ const target = resolveBindingTarget(prop.binding, containers);
9414
+ if (target) {
9415
+ materialized = true;
9416
+ let byProperty = writesByChild.get(target.child);
9417
+ if (!byProperty) {
9418
+ byProperty = /* @__PURE__ */ new Map();
9419
+ writesByChild.set(target.child, byProperty);
9420
+ }
9421
+ byProperty.set(target.property, {
9422
+ child: target.child,
9423
+ property: target.property,
9424
+ value: effectiveValue
9425
+ });
9426
+ }
9427
+ }
9428
+ if (!materialized) {
9429
+ throw new Error(
9430
+ `Property "${name2}" has no existing value on this element to edit (its condition may not be met, its binding type isn't supported by 'edit', or the template was never fully applied). Use 'apply --set ${name2}=...' to materialize it first.`
9431
+ );
9432
+ }
9433
+ }
9434
+ const writes = [];
9435
+ for (const byProperty of writesByChild.values()) {
9436
+ writes.push(...byProperty.values());
9437
+ }
9438
+ return { element, template, writes };
9439
+ }
9440
+ async function editSubcommand(args) {
9441
+ const logger = c8ctl4.getLogger();
9442
+ installStdoutEpipeHandler();
9443
+ const parsed = parseArgs(args);
9444
+ if (parsed.error) {
9445
+ throw new Error(parsed.error);
9446
+ }
9447
+ const [elementId, bpmnFilePath] = parsed.positionals;
9448
+ if (parsed.positionals.length > 2) {
9449
+ throw new Error(
9450
+ `Unexpected argument: ${parsed.positionals[2]}. Usage: c8ctl element-template edit <element-id> [<file.bpmn>] --set name=value`
9451
+ );
9452
+ }
9453
+ if (!elementId) {
9454
+ throw new Error(
9455
+ "Missing element-id argument. Usage: c8ctl element-template edit <element-id> [<file.bpmn>] --set name=value"
9456
+ );
9457
+ }
9458
+ if (parsed.setArgs.length === 0) {
9459
+ throw new Error(
9460
+ "edit requires at least one --set name=value (nothing to edit). Usage: c8ctl element-template edit <element-id> [<file.bpmn>] --set name=value"
9461
+ );
9462
+ }
9463
+ if (parsed.inPlace && !bpmnFilePath) {
9464
+ throw new Error("--in-place cannot be used with stdin input");
9465
+ }
9466
+ const input = await readBpmnInput(bpmnFilePath);
9467
+ if (!input) {
9468
+ throw new Error(
9469
+ "No BPMN input provided. Pass a file path or pipe BPMN XML via stdin."
9470
+ );
9471
+ }
9472
+ const vendorPath = resolveVendorBundle();
9473
+ const vendor = require3(vendorPath);
9474
+ const { Modeler, ZeebeModdleExtension, HeadlessTextRendererModule } = vendor;
9475
+ const modeler = new Modeler({
9476
+ additionalModules: [HeadlessTextRendererModule],
9477
+ moddleExtensions: { zeebe: ZeebeModdleExtension }
9478
+ });
9479
+ let plan;
9329
9480
  try {
9330
- writeFileSync2(tmp, contents, "utf-8");
9331
- renameSync2(tmp, target);
9481
+ await modeler.importXML(input.xml);
9482
+ plan = await planEdit(modeler, elementId, parsed.setArgs);
9332
9483
  } catch (error3) {
9333
- try {
9334
- unlinkSync2(tmp);
9335
- } catch {
9336
- }
9337
- const code = isRecord(error3) && typeof error3.code === "string" ? error3.code : void 0;
9338
- if (code === "EXDEV") {
9339
- writeFileSync2(target, contents, "utf-8");
9340
- return;
9484
+ const message = error3 instanceof Error ? error3.message : String(error3);
9485
+ throw new Error(`Error editing element: ${message}`);
9486
+ }
9487
+ if (c8ctl4.dryRun) {
9488
+ const info = {
9489
+ dryRun: true,
9490
+ command: "element-template edit",
9491
+ template: {
9492
+ id: plan.template.id,
9493
+ name: plan.template.name,
9494
+ version: plan.template.version
9495
+ },
9496
+ elementId,
9497
+ source: input.source,
9498
+ inPlace: parsed.inPlace && !!bpmnFilePath,
9499
+ setOverrides: parsed.setArgs
9500
+ };
9501
+ if (c8ctl4.outputMode === "json") {
9502
+ logger.json(info);
9503
+ } else {
9504
+ logger.output("Dry run \u2014 no changes applied.");
9505
+ logger.output(
9506
+ ` Template: ${info.template.name ?? info.template.id}${info.template.version != null ? ` v${info.template.version}` : ""}`
9507
+ );
9508
+ logger.output(` Element: ${elementId}`);
9509
+ logger.output(` Source: ${input.source}`);
9510
+ if (info.inPlace) {
9511
+ logger.output(` Mode: in-place (would overwrite ${bpmnFilePath})`);
9512
+ } else {
9513
+ logger.output(" Mode: stdout (would print transformed XML)");
9514
+ }
9515
+ logger.output(` --set: ${parsed.setArgs.join(", ")}`);
9341
9516
  }
9342
- throw error3;
9517
+ return;
9518
+ }
9519
+ const modeling = modeler.get("modeling");
9520
+ for (const write of plan.writes) {
9521
+ modeling.updateModdleProperties(plan.element, write.child, {
9522
+ [write.property]: write.value
9523
+ });
9343
9524
  }
9525
+ const result = await modeler.saveXML({ format: true });
9526
+ const resultXml = result.xml;
9527
+ if (parsed.inPlace && bpmnFilePath) {
9528
+ atomicOverwriteFile(bpmnFilePath, resultXml);
9529
+ logger.info(`Updated ${bpmnFilePath}`);
9530
+ return;
9531
+ }
9532
+ process.stdout.write(resultXml);
9344
9533
  }
9345
9534
 
9346
9535
  // default-plugins/element-template/commands/get.ts
@@ -9426,7 +9615,7 @@ import { styleText as styleText2 } from "node:util";
9426
9615
  // default-plugins/element-template/commands/info.ts
9427
9616
  import { styleText } from "node:util";
9428
9617
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9429
- var c8ctl4 = globalThis.c8ctl;
9618
+ var c8ctl5 = globalThis.c8ctl;
9430
9619
  function parseInspectArgs(args, usage, {
9431
9620
  allowPropertyNames,
9432
9621
  allowFilters
@@ -9554,7 +9743,7 @@ function formatKeyedCard({
9554
9743
  return lines;
9555
9744
  }
9556
9745
  async function infoSubcommand(args) {
9557
- const logger = c8ctl4.getLogger();
9746
+ const logger = c8ctl5.getLogger();
9558
9747
  const usage = "Usage: c8ctl element-template info <template> [--engine-version <x.y.z>]";
9559
9748
  const { engineVersion, rest } = parseEngineVersionFlag(args, usage);
9560
9749
  const parsed = parseInspectArgs(rest, usage, {
@@ -9569,7 +9758,7 @@ async function infoSubcommand(args) {
9569
9758
  `Ignoring --engine-version ${engineVersion} because ${parsed.templateArg} pins a template version.`
9570
9759
  );
9571
9760
  }
9572
- if (c8ctl4.outputMode === "json") {
9761
+ if (c8ctl5.outputMode === "json") {
9573
9762
  logger.json(buildTemplateSummary(template));
9574
9763
  return;
9575
9764
  }
@@ -9590,9 +9779,9 @@ async function infoSubcommand(args) {
9590
9779
 
9591
9780
  // default-plugins/element-template/commands/get-properties.ts
9592
9781
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9593
- var c8ctl5 = globalThis.c8ctl;
9782
+ var c8ctl6 = globalThis.c8ctl;
9594
9783
  async function getPropertiesSubcommand(args) {
9595
- const logger = c8ctl5.getLogger();
9784
+ const logger = c8ctl6.getLogger();
9596
9785
  const usage = "Usage: c8ctl element-template get-properties <template> [<name>...] [--group <id>...] [--detailed | -d] [--engine-version <x.y.z>]\n Default: condensed list (name + description). --detailed shows full cards.\n Names may include shell-style globs \u2014 quote to avoid shell expansion: 'auth*'";
9597
9786
  const { engineVersion, rest } = parseEngineVersionFlag(args, usage);
9598
9787
  const parsed = parseInspectArgs(rest, usage, {
@@ -9638,7 +9827,7 @@ async function getPropertiesSubcommand(args) {
9638
9827
  throw new Error(`No properties match ${what}.`);
9639
9828
  }
9640
9829
  const total = allDetails.length;
9641
- if (c8ctl5.outputMode === "json") {
9830
+ if (c8ctl6.outputMode === "json") {
9642
9831
  const projector = parsed.detailed ? buildShowProperty : buildCondensedProperty;
9643
9832
  logger.json(
9644
9833
  buildJsonPayload(template, details, projector, total, sourceByDetail)
@@ -9861,9 +10050,9 @@ function formatBadgeValue(value) {
9861
10050
  // default-plugins/element-template/commands/search.ts
9862
10051
  import { styleText as styleText3 } from "node:util";
9863
10052
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9864
- var c8ctl6 = globalThis.c8ctl;
10053
+ var c8ctl7 = globalThis.c8ctl;
9865
10054
  async function searchSubcommand(args) {
9866
- const logger = c8ctl6.getLogger();
10055
+ const logger = c8ctl7.getLogger();
9867
10056
  const usage = "Usage: c8ctl element-template search <query> [--limit N] [--engine-version <x.y.z>]";
9868
10057
  const { engineVersion, rest } = parseEngineVersionFlag(args, usage);
9869
10058
  const DEFAULT_LIMIT = 20;
@@ -9908,7 +10097,7 @@ async function searchSubcommand(args) {
9908
10097
  const total = allMatches.length;
9909
10098
  const limited = allMatches.slice(0, limit);
9910
10099
  const truncated = total > limited.length;
9911
- if (c8ctl6.outputMode === "json") {
10100
+ if (c8ctl7.outputMode === "json") {
9912
10101
  logger.json({
9913
10102
  query,
9914
10103
  count: limited.length,
@@ -9967,9 +10156,9 @@ async function searchSubcommand(args) {
9967
10156
 
9968
10157
  // default-plugins/element-template/commands/sync.ts
9969
10158
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
9970
- var c8ctl7 = globalThis.c8ctl;
10159
+ var c8ctl8 = globalThis.c8ctl;
9971
10160
  async function syncSubcommand(args) {
9972
- const logger = c8ctl7.getLogger();
10161
+ const logger = c8ctl8.getLogger();
9973
10162
  let prune = false;
9974
10163
  for (let i = 0; i < args.length; i++) {
9975
10164
  const arg = args[i];
@@ -9996,14 +10185,14 @@ async function syncSubcommand(args) {
9996
10185
  );
9997
10186
  }
9998
10187
  const summary = await syncTemplates({ logger, prune });
9999
- if (c8ctl7.outputMode === "json") {
10188
+ if (c8ctl8.outputMode === "json") {
10000
10189
  logger.json(summary);
10001
10190
  }
10002
10191
  }
10003
10192
 
10004
10193
  // default-plugins/element-template/c8ctl-plugin.ts
10005
10194
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
10006
- var c8ctl8 = globalThis.c8ctl;
10195
+ var c8ctl9 = globalThis.c8ctl;
10007
10196
  function injectFlagsIntoArgs(args, flags) {
10008
10197
  const out = [...args];
10009
10198
  if (!flags) {
@@ -10034,6 +10223,7 @@ var subcommandHandlers = {
10034
10223
  info: infoSubcommand,
10035
10224
  "get-properties": getPropertiesSubcommand,
10036
10225
  apply: applySubcommand,
10226
+ edit: editSubcommand,
10037
10227
  get: getSubcommand,
10038
10228
  sync: syncSubcommand
10039
10229
  };
@@ -10045,7 +10235,7 @@ async function elementTemplateHandler(args, flags) {
10045
10235
  const subcommand = reinjected[0];
10046
10236
  const subArgs = reinjected.slice(1);
10047
10237
  if (!subcommand || !isSubcommand(subcommand)) {
10048
- const logger = c8ctl8.getLogger();
10238
+ const logger = c8ctl9.getLogger();
10049
10239
  const lead = subcommand ? `Unknown subcommand '${subcommand}'.` : "c8ctl element-template requires a subcommand.";
10050
10240
  const validSubcommands = Object.keys(subcommandHandlers);
10051
10241
  logger.info(`${lead} Available: ${validSubcommands.join(", ")}`);
@@ -10057,7 +10247,7 @@ async function elementTemplateHandler(args, flags) {
10057
10247
  await subcommandHandlers[subcommand](subArgs);
10058
10248
  } catch (error3) {
10059
10249
  const message = error3 instanceof Error ? error3.message : String(error3);
10060
- const logger = c8ctl8.getLogger();
10250
+ const logger = c8ctl9.getLogger();
10061
10251
  logger.error(`Failed to element-template ${subcommand}: ${message}`);
10062
10252
  process.exitCode = 1;
10063
10253
  }
@@ -10068,7 +10258,7 @@ var metadata = {
10068
10258
  commands: {
10069
10259
  "element-template": {
10070
10260
  description: "Apply, inspect, and export Camunda element templates",
10071
- helpDescription: "Apply Camunda element templates to BPMN elements, inspect template metadata and properties, search the out-of-the-box template catalogue, export raw template JSON, and manage the local template cache.\n\n<template> is a local path, an https:// URL, or an OOTB template id (optionally @<version>).\n\napply --set name=value targets a property by binding name (run `get-properties` to discover names). Pass --set multiple times to set multiple properties. Prefix with a binding type (input | output | header | property | taskDefinition) when the same name is bound across multiple types \u2014 e.g. --set input:correlationKey=order-42.\n\nFEEL values: properties with feel=required always store a FEEL expression (prefixed with `=`). For those properties, c8ctl auto-prepends `=` when it is missing, so `--set key=orderId` writes `=orderId` to the BPMN \u2014 equivalent to `--set key==orderId`. Properties with feel=optional keep the value verbatim; you must supply the `=` prefix yourself when you want to write a FEEL expression for those. Three forms for feel=required properties:\n --set key='=value' canonical: single-quoted FEEL value (explicit =)\n --set 'key==value' compact: whole argument single-quoted (explicit =)\n --set key=value shorthand: = auto-prepended (feel=required only)\nLeading/trailing whitespace is stripped from values, and whitespace immediately after a FEEL `=` prefix is also stripped, so `--set 'key== value'` is equivalent to `--set 'key==value'`.",
10261
+ helpDescription: "Apply Camunda element templates to BPMN elements, inspect template metadata and properties, search the out-of-the-box template catalogue, export raw template JSON, and manage the local template cache.\n\n<template> is a local path, an https:// URL, or an OOTB template id (optionally @<version>).\n\napply --set name=value targets a property by binding name (run `get-properties` to discover names). Pass --set multiple times to set multiple properties. Prefix with a binding type (input | output | header | property | taskDefinition) when the same name is bound across multiple types \u2014 e.g. --set input:correlationKey=order-42.\n\nedit --set name=value updates a property on an element that already has a template applied, without re-running template application \u2014 it never resets other template-owned content (including hand-customized extension values a template doesn't fully control) and doesn't need a <template> argument (it reads zeebe:modelerTemplate/-Version off the element). The tradeoff: edit can only change bindings that already have a value; a property whose gating condition was never met has nothing to edit \u2014 use apply --set to materialize it first.\n\nFEEL values: properties with feel=required always store a FEEL expression (prefixed with `=`). For those properties, c8ctl auto-prepends `=` when it is missing, so `--set key=orderId` writes `=orderId` to the BPMN \u2014 equivalent to `--set key==orderId`. Properties with feel=optional keep the value verbatim; you must supply the `=` prefix yourself when you want to write a FEEL expression for those. Three forms for feel=required properties:\n --set key='=value' canonical: single-quoted FEEL value (explicit =)\n --set 'key==value' compact: whole argument single-quoted (explicit =)\n --set key=value shorthand: = auto-prepended (feel=required only)\nLeading/trailing whitespace is stripped from values, and whitespace immediately after a FEEL `=` prefix is also stripped, so `--set 'key== value'` is equivalent to `--set 'key==value'`.",
10072
10262
  subcommands: [
10073
10263
  {
10074
10264
  name: "search",
@@ -10086,6 +10276,10 @@ var metadata = {
10086
10276
  name: "apply",
10087
10277
  description: "Apply a Camunda element template to a BPMN element"
10088
10278
  },
10279
+ {
10280
+ name: "edit",
10281
+ description: "Update a property on an element that already has a template applied, without re-applying it"
10282
+ },
10089
10283
  {
10090
10284
  name: "get",
10091
10285
  description: "Print the raw template JSON to stdout (pipe-friendly)"
@@ -10148,6 +10342,10 @@ var metadata = {
10148
10342
  command: "c8ctl element-template apply io.camunda.connectors.HttpJson.v2 Task_1 process.bpmn --set input:method=POST",
10149
10343
  description: "Qualify with <binding-type>:name=value when the same name is bound across multiple types"
10150
10344
  },
10345
+ {
10346
+ command: "c8ctl element-template edit Task_1 process.bpmn --set method=PUT",
10347
+ description: "Update a single property on an already-templated element in place, without touching anything else the template governs"
10348
+ },
10151
10349
  {
10152
10350
  command: "c8ctl element-template get io.camunda.connectors.HttpJson.v2 > template.json",
10153
10351
  description: "Print the raw template JSON to stdout (redirect to save a copy)"
@@ -10170,12 +10368,12 @@ var commands = {
10170
10368
  "in-place": {
10171
10369
  type: "boolean",
10172
10370
  short: "i",
10173
- description: "Modify the BPMN file in place [apply]"
10371
+ description: "Modify the BPMN file in place [apply|edit]"
10174
10372
  },
10175
10373
  set: {
10176
10374
  type: "string",
10177
10375
  multiple: true,
10178
- description: "Set a property value: name=value (repeatable; binding name from get-properties; = auto-prepended for feel=required properties) [apply]"
10376
+ description: "Set a property value: name=value (repeatable; binding name from get-properties; = auto-prepended for feel=required properties) [apply|edit]"
10179
10377
  },
10180
10378
  detailed: {
10181
10379
  type: "boolean",
@@ -616,7 +616,7 @@ export const COMMAND_REGISTRY = {
616
616
  "tenants",
617
617
  "auth",
618
618
  "mapping-rules",
619
- "wait-state",
619
+ "ws",
620
620
  ],
621
621
  // Verb-level `flags` holds only genuinely shared flags. Per-resource
622
622
  // flags live exclusively in `resourceFlags` so unknown-flag detection