@bpmnkit/plugins 0.0.31 → 0.0.33

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.
package/README.md CHANGED
@@ -147,10 +147,12 @@ const ai = createAiBridgePlugin({
147
147
  | [`@bpmnkit/feel`](https://www.npmjs.com/package/@bpmnkit/feel) | FEEL expression language parser & evaluator |
148
148
  | [`@bpmnkit/api`](https://www.npmjs.com/package/@bpmnkit/api) | Camunda 8 REST API TypeScript client |
149
149
  | [`@bpmnkit/ascii`](https://www.npmjs.com/package/@bpmnkit/ascii) | Render BPMN diagrams as Unicode ASCII art |
150
+ | [`@bpmnkit/docspack`](https://www.npmjs.com/package/@bpmnkit/docspack) | BPMN Kit docs as an offline docspack package for AI agents |
150
151
  | [`@bpmnkit/ui`](https://www.npmjs.com/package/@bpmnkit/ui) | Shared design tokens and UI components |
151
152
  | [`@bpmnkit/profiles`](https://www.npmjs.com/package/@bpmnkit/profiles) | Shared auth, profile storage, and client factories for CLI & proxy |
152
153
  | [`@bpmnkit/operate`](https://www.npmjs.com/package/@bpmnkit/operate) | Monitoring & operations frontend for Camunda clusters |
153
154
  | [`@bpmnkit/connector-gen`](https://www.npmjs.com/package/@bpmnkit/connector-gen) | Generate connector templates from OpenAPI specs |
155
+ | [`@bpmnkit/connectors`](https://www.npmjs.com/package/@bpmnkit/connectors) | Camunda 8 OOTB connector catalog and deterministic template application |
154
156
  | [`@bpmnkit/cli`](https://www.npmjs.com/package/@bpmnkit/cli) | Camunda 8 command-line interface (casen) |
155
157
  | [`@bpmnkit/proxy`](https://www.npmjs.com/package/@bpmnkit/proxy) | Local AI bridge and Camunda API proxy server |
156
158
  | [`@bpmnkit/patterns`](https://www.npmjs.com/package/@bpmnkit/patterns) | Domain process patterns for BPMNKit AIKit |
@@ -25,11 +25,11 @@
25
25
  * @packageDocumentation
26
26
  */
27
27
  import type { CanvasPlugin } from "@bpmnkit/canvas";
28
+ import type { ElementTemplate } from "@bpmnkit/connectors";
28
29
  import type { BpmnDefinitions } from "@bpmnkit/core";
29
30
  import { ELEMENT_TYPE_LABELS } from "@bpmnkit/editor";
30
31
  import type { ConfigPanelPlugin } from "../config-panel/index.js";
31
- import type { ElementTemplate } from "./template-types.js";
32
- export { CAMUNDA_CONNECTOR_TEMPLATES } from "./templates/generated.js";
32
+ export { CAMUNDA_CONNECTOR_TEMPLATES } from "@bpmnkit/connectors";
33
33
  export { templateToServiceTaskOptions } from "./template-to-service-task.js";
34
34
  export interface ConfigPanelBpmnOptions {
35
35
  /**
@@ -24,11 +24,11 @@
24
24
  *
25
25
  * @packageDocumentation
26
26
  */
27
+ import { CAMUNDA_CONNECTOR_TEMPLATES } from "@bpmnkit/connectors";
27
28
  import { buildValidationDmn, findValidationStructure, insertValidationStructure, removeValidationStructure, validationDecisionId, zeebeExtensionsToXmlElements, } from "@bpmnkit/core";
28
29
  import { ELEMENT_TYPE_LABELS } from "@bpmnkit/editor";
30
+ export { CAMUNDA_CONNECTOR_TEMPLATES } from "@bpmnkit/connectors";
29
31
  import { buildRegistrationFromTemplate } from "./template-engine.js";
30
- import { CAMUNDA_CONNECTOR_TEMPLATES } from "./templates/generated.js";
31
- export { CAMUNDA_CONNECTOR_TEMPLATES } from "./templates/generated.js";
32
32
  export { templateToServiceTaskOptions } from "./template-to-service-task.js";
33
33
  import { buildPropertiesWithExampleOutput, buildZeebeLoopCharacteristics, findFlowElement, findSequenceFlow, getExampleOutputJson, getIoInput, getTaskHeader, parseCalledElement, parseZeebeError, parseZeebeEscalation, parseZeebeExtensions, parseZeebeLoopCharacteristics, parseZeebeMessage, parseZeebeScript, parseZeebeSignal, updateFlowElement, updateSequenceFlow, xmlLocalName, } from "./util.js";
34
34
  /** Validates that a field value is valid JSON, or returns an error message. */
@@ -2,8 +2,8 @@
2
2
  * Converts a Camunda element template into the PanelSchema + PanelAdapter pair
3
3
  * used by the config-panel plugin renderer.
4
4
  */
5
+ import type { ElementTemplate } from "@bpmnkit/connectors";
5
6
  import type { PanelAdapter, PanelSchema } from "../config-panel/index.js";
6
- import type { ElementTemplate } from "./template-types.js";
7
7
  export interface TemplateRegistration {
8
8
  schema: PanelSchema;
9
9
  adapter: PanelAdapter;
@@ -2,13 +2,17 @@
2
2
  * Convert an element template + user-provided values into ServiceTaskOptions
3
3
  * for use with the core `Bpmn` builder.
4
4
  */
5
+ import type { ElementTemplate } from "@bpmnkit/connectors";
5
6
  import type { ServiceTaskOptions } from "@bpmnkit/core";
6
- import type { ElementTemplate } from "./template-types.js";
7
7
  /**
8
- * Convert a Camunda element template into `ServiceTaskOptions` for the core
8
+ * Converts a Camunda element template into `ServiceTaskOptions` for the core
9
9
  * `Bpmn` builder, applying `values` for user-configurable properties and
10
10
  * fixed template defaults for Hidden properties.
11
11
  *
12
+ * Delegates to `@bpmnkit/connectors`' `applyElementTemplate()`, which resolves
13
+ * every binding kind (`zeebe:input`/`output`/`taskHeader`/`taskDefinition`/`property`),
14
+ * not just `zeebe:input` as this function did historically.
15
+ *
12
16
  * @example
13
17
  * ```typescript
14
18
  * import { Bpmn } from "@bpmnkit/core";
@@ -1,46 +1,13 @@
1
- /** Derive the lookup key for a template property (same logic as the template engine). */
2
- function propertyKey(prop) {
3
- if (prop.id)
4
- return prop.id;
5
- const b = prop.binding;
6
- if (b.type === "zeebe:input")
7
- return b.name;
8
- if (b.type === "zeebe:output")
9
- return b.source;
10
- if (b.type === "zeebe:taskHeader")
11
- return b.key;
12
- if (b.type === "zeebe:taskDefinition")
13
- return `taskDef.${b.property}`;
14
- if (b.type === "zeebe:taskDefinition:type")
15
- return "taskDef.type";
16
- if (b.type === "property")
17
- return b.name;
18
- if (b.type === "zeebe:property")
19
- return b.name;
20
- return "";
21
- }
22
- function applyBinding(binding, value, inputs, taskHeaders, out) {
23
- if (binding.type === "zeebe:input") {
24
- inputs.push({ source: value, target: binding.name });
25
- }
26
- else if (binding.type === "zeebe:taskHeader") {
27
- taskHeaders[binding.key] = value;
28
- }
29
- else if (binding.type === "zeebe:taskDefinition" && binding.property === "type") {
30
- out.taskType = value;
31
- }
32
- else if (binding.type === "zeebe:taskDefinition" && binding.property === "retries") {
33
- out.retries = value;
34
- }
35
- else if (binding.type === "zeebe:taskDefinition:type") {
36
- out.taskType = value;
37
- }
38
- }
1
+ import { applyElementTemplate } from "@bpmnkit/connectors";
39
2
  /**
40
- * Convert a Camunda element template into `ServiceTaskOptions` for the core
3
+ * Converts a Camunda element template into `ServiceTaskOptions` for the core
41
4
  * `Bpmn` builder, applying `values` for user-configurable properties and
42
5
  * fixed template defaults for Hidden properties.
43
6
  *
7
+ * Delegates to `@bpmnkit/connectors`' `applyElementTemplate()`, which resolves
8
+ * every binding kind (`zeebe:input`/`output`/`taskHeader`/`taskDefinition`/`property`),
9
+ * not just `zeebe:input` as this function did historically.
10
+ *
44
11
  * @example
45
12
  * ```typescript
46
13
  * import { Bpmn } from "@bpmnkit/core";
@@ -59,34 +26,10 @@ function applyBinding(binding, value, inputs, taskHeaders, out) {
59
26
  * ```
60
27
  */
61
28
  export function templateToServiceTaskOptions(template, values = {}) {
62
- const inputs = [];
63
- const taskHeaders = {};
64
- const out = {
65
- taskType: "",
66
- retries: undefined,
67
- };
68
- for (const prop of template.properties) {
69
- if (prop.type === "Hidden") {
70
- if (typeof prop.value === "string" && prop.value) {
71
- applyBinding(prop.binding, prop.value, inputs, taskHeaders, out);
72
- }
73
- continue;
74
- }
75
- const key = propertyKey(prop);
76
- const val = values[key] ?? (typeof prop.value === "string" ? prop.value : undefined);
77
- if (!val)
78
- continue;
79
- applyBinding(prop.binding, val, inputs, taskHeaders, out);
80
- }
81
- return {
29
+ const result = applyElementTemplate(template, values);
30
+ return (result.serviceTask ?? {
82
31
  name: values.name ?? template.name,
83
- taskType: out.taskType,
84
- retries: out.retries,
85
- modelerTemplate: template.id,
86
- modelerTemplateVersion: template.version !== undefined ? String(template.version) : undefined,
87
- modelerTemplateIcon: template.icon?.contents,
88
- ioMapping: inputs.length > 0 ? { inputs } : undefined,
89
- taskHeaders: Object.keys(taskHeaders).length > 0 ? taskHeaders : undefined,
90
- };
32
+ taskType: "",
33
+ });
91
34
  }
92
35
  //# sourceMappingURL=template-to-service-task.js.map
@@ -5,6 +5,6 @@
5
5
  * the local proxy is running. They mirror the runtime definitions served by
6
6
  * `GET /worker-templates` on the proxy.
7
7
  */
8
- import type { ElementTemplate } from "../config-panel-bpmn/template-types.js";
8
+ import type { ElementTemplate } from "@bpmnkit/connectors";
9
9
  export declare const BUILTIN_WORKER_TEMPLATES: ElementTemplate[];
10
10
  //# sourceMappingURL=builtin-templates.d.ts.map
@@ -9,7 +9,7 @@
9
9
  * panel.open()
10
10
  */
11
11
  import type { CatalogEntry } from "@bpmnkit/connector-gen/browser";
12
- import type { ElementTemplate } from "../config-panel-bpmn/template-types.js";
12
+ import type { ElementTemplate } from "@bpmnkit/connectors";
13
13
  export interface CatalogPanelOptions {
14
14
  builtinTemplates: ElementTemplate[];
15
15
  catalogEntries: CatalogEntry[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmnkit/plugins",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -132,12 +132,13 @@
132
132
  "dist/**/*.d.ts"
133
133
  ],
134
134
  "dependencies": {
135
- "@bpmnkit/ascii": "0.0.28",
136
- "@bpmnkit/canvas": "0.0.28",
137
- "@bpmnkit/connector-gen": "0.0.14",
138
- "@bpmnkit/core": "0.1.0",
139
- "@bpmnkit/editor": "0.0.31",
140
- "@bpmnkit/feel": "0.0.19"
135
+ "@bpmnkit/ascii": "0.0.30",
136
+ "@bpmnkit/canvas": "0.0.30",
137
+ "@bpmnkit/connector-gen": "0.0.15",
138
+ "@bpmnkit/connectors": "0.0.2",
139
+ "@bpmnkit/core": "0.1.2",
140
+ "@bpmnkit/editor": "0.0.33",
141
+ "@bpmnkit/feel": "0.0.20"
141
142
  },
142
143
  "description": "23 composable canvas plugins for BPMN editors and viewers — minimap, AI chat, process simulation, storage, and more",
143
144
  "keywords": [
@@ -1,126 +0,0 @@
1
- /**
2
- * TypeScript types matching the Camunda element template JSON schema.
3
- * https://github.com/camunda/element-templates-json-schema
4
- */
5
- export interface ElementTemplate {
6
- /** Unique template identifier (reverse-domain, e.g. "io.camunda.connectors.HttpJson.v2"). */
7
- id: string;
8
- /** Display name shown in the template catalog. */
9
- name: string;
10
- /** Short description. */
11
- description?: string;
12
- /** Integer version; templates with the same id + different version are distinct. */
13
- version?: number;
14
- /** BPMN element types this template applies to (e.g. "bpmn:ServiceTask", "bpmn:Task"). */
15
- appliesTo: string[];
16
- /** Forces the element to be converted to this type on apply. */
17
- elementType?: {
18
- value: string;
19
- };
20
- /** UI section definitions (collapsible groups). */
21
- groups?: TemplateGroup[];
22
- /** All property definitions. */
23
- properties: TemplateProperty[];
24
- /** Link to external documentation. */
25
- documentationRef?: string;
26
- /** Custom icon: { contents: "data:image/svg+xml;base64,..." } */
27
- icon?: {
28
- contents: string;
29
- };
30
- }
31
- export interface TemplateGroup {
32
- id: string;
33
- label: string;
34
- tooltip?: string;
35
- openByDefault?: boolean;
36
- }
37
- export interface TemplateProperty {
38
- /** Unique key used in condition references. Falls back to binding name if absent. */
39
- id?: string;
40
- /** Label shown above the input. Hidden properties have no label. */
41
- label?: string;
42
- /** Hint text shown below the input. */
43
- description?: string;
44
- /** UI control type. */
45
- type: "String" | "Text" | "Hidden" | "Dropdown" | "Boolean" | "Number";
46
- /** Default value applied when the template is first used. */
47
- value?: string | number | boolean;
48
- /** Placeholder text. */
49
- placeholder?: string;
50
- /** If true, empty values are not written to the BPMN XML. */
51
- optional?: boolean;
52
- /** FEEL expression mode (only relevant for String/Text). */
53
- feel?: "optional" | "required" | "static";
54
- /** Which template group this property belongs to. */
55
- group?: string;
56
- /** Tooltip text. */
57
- tooltip?: string;
58
- /** How this property maps to the BPMN XML. */
59
- binding: TemplateBinding;
60
- /** Conditional visibility. */
61
- condition?: TemplateCondition;
62
- /** Required for Dropdown type. */
63
- choices?: Array<{
64
- name: string;
65
- value: string;
66
- }>;
67
- /** Validation constraints. */
68
- constraints?: {
69
- notEmpty?: boolean;
70
- minLength?: number;
71
- maxLength?: number;
72
- pattern?: string | {
73
- value: string;
74
- message: string;
75
- };
76
- };
77
- }
78
- /** All supported binding types. */
79
- export type TemplateBinding = {
80
- type: "property";
81
- name: string;
82
- }
83
- /** @deprecated Use zeebe:taskDefinition with property field instead. */
84
- | {
85
- type: "zeebe:taskDefinition:type";
86
- } | {
87
- type: "zeebe:taskDefinition";
88
- property: "type" | "retries";
89
- } | {
90
- type: "zeebe:input";
91
- name: string;
92
- } | {
93
- type: "zeebe:output";
94
- source: string;
95
- } | {
96
- type: "zeebe:taskHeader";
97
- key: string;
98
- } | {
99
- type: "zeebe:property";
100
- name: string;
101
- } | {
102
- type: "zeebe:adHoc";
103
- property: "outputCollection" | "outputElement" | "activeElementsCollection";
104
- };
105
- /** Condition controlling whether a property is shown in the UI. */
106
- export type TemplateCondition = {
107
- property: string;
108
- equals: string;
109
- type?: string;
110
- } | {
111
- property: string;
112
- oneOf: string[];
113
- type?: string;
114
- } | {
115
- property: string;
116
- isActive: boolean;
117
- type?: string;
118
- } | {
119
- allMatch: Array<{
120
- property: string;
121
- equals?: string;
122
- oneOf?: string[];
123
- isActive?: boolean;
124
- }>;
125
- };
126
- //# sourceMappingURL=template-types.d.ts.map
@@ -1,6 +0,0 @@
1
- /**
2
- * TypeScript types matching the Camunda element template JSON schema.
3
- * https://github.com/camunda/element-templates-json-schema
4
- */
5
- export {};
6
- //# sourceMappingURL=template-types.js.map
@@ -1,3 +0,0 @@
1
- import type { ElementTemplate } from "../template-types.js";
2
- export declare const CAMUNDA_CONNECTOR_TEMPLATES: ElementTemplate[];
3
- //# sourceMappingURL=generated.d.ts.map