@bpmnkit/core 0.0.8
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 +185 -0
- package/dist/bpmn/auto-layout.d.ts +10 -0
- package/dist/bpmn/auto-layout.js +203 -0
- package/dist/bpmn/bpmn-builder.d.ts +381 -0
- package/dist/bpmn/bpmn-builder.js +1223 -0
- package/dist/bpmn/bpmn-model.d.ts +403 -0
- package/dist/bpmn/bpmn-model.js +2 -0
- package/dist/bpmn/bpmn-parser.d.ts +4 -0
- package/dist/bpmn/bpmn-parser.js +642 -0
- package/dist/bpmn/bpmn-serializer.d.ts +4 -0
- package/dist/bpmn/bpmn-serializer.js +515 -0
- package/dist/bpmn/compact.d.ts +91 -0
- package/dist/bpmn/compact.js +349 -0
- package/dist/bpmn/di-color.d.ts +9 -0
- package/dist/bpmn/di-color.js +32 -0
- package/dist/bpmn/index.d.ts +105 -0
- package/dist/bpmn/index.js +176 -0
- package/dist/bpmn/optimize/feel.d.ts +4 -0
- package/dist/bpmn/optimize/feel.js +186 -0
- package/dist/bpmn/optimize/flow.d.ts +4 -0
- package/dist/bpmn/optimize/flow.js +323 -0
- package/dist/bpmn/optimize/index.d.ts +5 -0
- package/dist/bpmn/optimize/index.js +51 -0
- package/dist/bpmn/optimize/naming.d.ts +8 -0
- package/dist/bpmn/optimize/naming.js +145 -0
- package/dist/bpmn/optimize/tasks.d.ts +4 -0
- package/dist/bpmn/optimize/tasks.js +273 -0
- package/dist/bpmn/optimize/types.d.ts +44 -0
- package/dist/bpmn/optimize/types.js +2 -0
- package/dist/bpmn/optimize/utils.d.ts +23 -0
- package/dist/bpmn/optimize/utils.js +129 -0
- package/dist/bpmn/rest-connector.d.ts +48 -0
- package/dist/bpmn/rest-connector.js +69 -0
- package/dist/bpmn/svg.d.ts +35 -0
- package/dist/bpmn/svg.js +557 -0
- package/dist/bpmn/type-guards.d.ts +136 -0
- package/dist/bpmn/type-guards.js +211 -0
- package/dist/bpmn/utils.d.ts +88 -0
- package/dist/bpmn/utils.js +207 -0
- package/dist/bpmn/zeebe-extensions.d.ts +72 -0
- package/dist/bpmn/zeebe-extensions.js +96 -0
- package/dist/dmn/compact.d.ts +44 -0
- package/dist/dmn/compact.js +125 -0
- package/dist/dmn/dmn-builder.d.ts +59 -0
- package/dist/dmn/dmn-builder.js +144 -0
- package/dist/dmn/dmn-layout.d.ts +57 -0
- package/dist/dmn/dmn-layout.js +256 -0
- package/dist/dmn/dmn-model.d.ts +158 -0
- package/dist/dmn/dmn-model.js +2 -0
- package/dist/dmn/dmn-parser.d.ts +4 -0
- package/dist/dmn/dmn-parser.js +275 -0
- package/dist/dmn/dmn-serializer.d.ts +4 -0
- package/dist/dmn/dmn-serializer.js +296 -0
- package/dist/dmn/index.d.ts +28 -0
- package/dist/dmn/index.js +51 -0
- package/dist/errors.d.ts +77 -0
- package/dist/errors.js +66 -0
- package/dist/form/compact.d.ts +20 -0
- package/dist/form/compact.js +146 -0
- package/dist/form/form-builder.d.ts +111 -0
- package/dist/form/form-builder.js +347 -0
- package/dist/form/form-model.d.ts +221 -0
- package/dist/form/form-model.js +2 -0
- package/dist/form/form-parser.d.ts +4 -0
- package/dist/form/form-parser.js +514 -0
- package/dist/form/form-serializer.d.ts +4 -0
- package/dist/form/form-serializer.js +240 -0
- package/dist/form/index.d.ts +27 -0
- package/dist/form/index.js +43 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +19 -0
- package/dist/layout/bench.d.ts +86 -0
- package/dist/layout/bench.js +225 -0
- package/dist/layout/coordinates.d.ts +62 -0
- package/dist/layout/coordinates.js +868 -0
- package/dist/layout/crossing.d.ts +8 -0
- package/dist/layout/crossing.js +60 -0
- package/dist/layout/graph.d.ts +28 -0
- package/dist/layout/graph.js +126 -0
- package/dist/layout/index.d.ts +7 -0
- package/dist/layout/index.js +5 -0
- package/dist/layout/layers.d.ts +13 -0
- package/dist/layout/layers.js +49 -0
- package/dist/layout/layout-engine.d.ts +21 -0
- package/dist/layout/layout-engine.js +191 -0
- package/dist/layout/overlap.d.ts +10 -0
- package/dist/layout/overlap.js +70 -0
- package/dist/layout/routing.d.ts +26 -0
- package/dist/layout/routing.js +439 -0
- package/dist/layout/subprocess.d.ts +14 -0
- package/dist/layout/subprocess.js +77 -0
- package/dist/layout/types.d.ts +72 -0
- package/dist/layout/types.js +37 -0
- package/dist/types/id-generator.d.ts +8 -0
- package/dist/types/id-generator.js +31 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +2 -0
- package/dist/types/xml-element.d.ts +12 -0
- package/dist/types/xml-element.js +2 -0
- package/dist/xml/index.d.ts +2 -0
- package/dist/xml/index.js +2 -0
- package/dist/xml/xml-parser.d.ts +13 -0
- package/dist/xml/xml-parser.js +271 -0
- package/package.json +38 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/** Serializes a FormDefinition to a JSON string. */
|
|
2
|
+
export function exportForm(form) {
|
|
3
|
+
const obj = {};
|
|
4
|
+
if (form.executionPlatform !== undefined) {
|
|
5
|
+
obj.executionPlatform = form.executionPlatform;
|
|
6
|
+
}
|
|
7
|
+
if (form.executionPlatformVersion !== undefined) {
|
|
8
|
+
obj.executionPlatformVersion = form.executionPlatformVersion;
|
|
9
|
+
}
|
|
10
|
+
if (form.exporter !== undefined) {
|
|
11
|
+
obj.exporter = { name: form.exporter.name, version: form.exporter.version };
|
|
12
|
+
}
|
|
13
|
+
if (form.schemaVersion !== undefined) {
|
|
14
|
+
obj.schemaVersion = form.schemaVersion;
|
|
15
|
+
}
|
|
16
|
+
obj.id = form.id;
|
|
17
|
+
obj.components = form.components.map(serializeComponent);
|
|
18
|
+
if (form.generated !== undefined) {
|
|
19
|
+
obj.generated = form.generated;
|
|
20
|
+
}
|
|
21
|
+
obj.type = form.type;
|
|
22
|
+
return JSON.stringify(obj, null, 2);
|
|
23
|
+
}
|
|
24
|
+
function serializeComponent(component) {
|
|
25
|
+
// Use the type discriminant, casting where TypeScript can't narrow through FormUnknownComponent
|
|
26
|
+
const type = component.type;
|
|
27
|
+
switch (type) {
|
|
28
|
+
case "text":
|
|
29
|
+
return buildObj(component, ["text", "label", "type", "layout", "id"]);
|
|
30
|
+
case "textfield":
|
|
31
|
+
case "textarea":
|
|
32
|
+
return buildObj(component, [
|
|
33
|
+
"label",
|
|
34
|
+
"type",
|
|
35
|
+
"layout",
|
|
36
|
+
"id",
|
|
37
|
+
"key",
|
|
38
|
+
"validate",
|
|
39
|
+
"defaultValue",
|
|
40
|
+
]);
|
|
41
|
+
case "select":
|
|
42
|
+
return buildObj(component, [
|
|
43
|
+
"label",
|
|
44
|
+
"values",
|
|
45
|
+
"valuesKey",
|
|
46
|
+
"type",
|
|
47
|
+
"layout",
|
|
48
|
+
"id",
|
|
49
|
+
"key",
|
|
50
|
+
"validate",
|
|
51
|
+
"searchable",
|
|
52
|
+
"defaultValue",
|
|
53
|
+
]);
|
|
54
|
+
case "radio":
|
|
55
|
+
return buildObj(component, [
|
|
56
|
+
"label",
|
|
57
|
+
"values",
|
|
58
|
+
"type",
|
|
59
|
+
"layout",
|
|
60
|
+
"id",
|
|
61
|
+
"key",
|
|
62
|
+
"validate",
|
|
63
|
+
"defaultValue",
|
|
64
|
+
]);
|
|
65
|
+
case "checkbox":
|
|
66
|
+
return buildObj(component, [
|
|
67
|
+
"label",
|
|
68
|
+
"type",
|
|
69
|
+
"id",
|
|
70
|
+
"defaultValue",
|
|
71
|
+
"validate",
|
|
72
|
+
"key",
|
|
73
|
+
"layout",
|
|
74
|
+
]);
|
|
75
|
+
case "checklist":
|
|
76
|
+
return buildObj(component, ["label", "values", "type", "layout", "id", "key", "validate"]);
|
|
77
|
+
case "group":
|
|
78
|
+
return buildGroupObj(component);
|
|
79
|
+
case "number":
|
|
80
|
+
return buildObj(component, [
|
|
81
|
+
"label",
|
|
82
|
+
"type",
|
|
83
|
+
"layout",
|
|
84
|
+
"id",
|
|
85
|
+
"key",
|
|
86
|
+
"validate",
|
|
87
|
+
"defaultValue",
|
|
88
|
+
]);
|
|
89
|
+
case "datetime":
|
|
90
|
+
return buildObj(component, [
|
|
91
|
+
"subtype",
|
|
92
|
+
"dateLabel",
|
|
93
|
+
"timeLabel",
|
|
94
|
+
"type",
|
|
95
|
+
"layout",
|
|
96
|
+
"id",
|
|
97
|
+
"key",
|
|
98
|
+
"validate",
|
|
99
|
+
]);
|
|
100
|
+
case "button":
|
|
101
|
+
return buildObj(component, ["label", "action", "type", "layout", "id"]);
|
|
102
|
+
case "taglist":
|
|
103
|
+
return buildObj(component, [
|
|
104
|
+
"label",
|
|
105
|
+
"values",
|
|
106
|
+
"valuesKey",
|
|
107
|
+
"type",
|
|
108
|
+
"layout",
|
|
109
|
+
"id",
|
|
110
|
+
"key",
|
|
111
|
+
"validate",
|
|
112
|
+
]);
|
|
113
|
+
case "table":
|
|
114
|
+
return buildTableObj(component);
|
|
115
|
+
case "image":
|
|
116
|
+
return buildObj(component, ["source", "alt", "type", "layout", "id"]);
|
|
117
|
+
case "dynamiclist":
|
|
118
|
+
return buildDynamicListObj(component);
|
|
119
|
+
case "iframe":
|
|
120
|
+
return buildIframeObj(component);
|
|
121
|
+
case "separator":
|
|
122
|
+
return buildObj(component, ["type", "layout", "id"]);
|
|
123
|
+
case "spacer":
|
|
124
|
+
return buildObj(component, ["height", "type", "layout", "id"]);
|
|
125
|
+
case "documentPreview":
|
|
126
|
+
return buildObj(component, ["label", "type", "layout", "id"]);
|
|
127
|
+
case "html":
|
|
128
|
+
return buildObj(component, ["content", "type", "layout", "id"]);
|
|
129
|
+
case "expression":
|
|
130
|
+
return buildObj(component, ["computeOn", "type", "layout", "id", "key", "expression"]);
|
|
131
|
+
case "filepicker":
|
|
132
|
+
return buildObj(component, ["label", "type", "layout", "id", "key", "multiple"]);
|
|
133
|
+
default:
|
|
134
|
+
return buildUnknownObj(component);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function buildObj(component, keys) {
|
|
138
|
+
const src = component;
|
|
139
|
+
const out = {};
|
|
140
|
+
for (const key of keys) {
|
|
141
|
+
const value = src[key];
|
|
142
|
+
if (value === undefined)
|
|
143
|
+
continue;
|
|
144
|
+
if (key === "layout") {
|
|
145
|
+
out.layout = serializeLayout(value);
|
|
146
|
+
}
|
|
147
|
+
else if (key === "validate") {
|
|
148
|
+
out.validate = { ...value };
|
|
149
|
+
}
|
|
150
|
+
else if (key === "values") {
|
|
151
|
+
out.values = value.map((v) => ({
|
|
152
|
+
label: v.label,
|
|
153
|
+
value: v.value,
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
out[key] = value;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return out;
|
|
161
|
+
}
|
|
162
|
+
function buildGroupObj(component) {
|
|
163
|
+
const out = {};
|
|
164
|
+
out.label = component.label;
|
|
165
|
+
out.components = component.components.map(serializeComponent);
|
|
166
|
+
if (component.showOutline !== undefined)
|
|
167
|
+
out.showOutline = component.showOutline;
|
|
168
|
+
out.type = "group";
|
|
169
|
+
if (component.layout !== undefined)
|
|
170
|
+
out.layout = serializeLayout(component.layout);
|
|
171
|
+
out.id = component.id;
|
|
172
|
+
return out;
|
|
173
|
+
}
|
|
174
|
+
function serializeLayout(layout) {
|
|
175
|
+
const out = {};
|
|
176
|
+
if (layout.row !== undefined)
|
|
177
|
+
out.row = layout.row;
|
|
178
|
+
if (layout.columns !== undefined) {
|
|
179
|
+
out.columns = layout.columns;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
out.columns = null;
|
|
183
|
+
}
|
|
184
|
+
return out;
|
|
185
|
+
}
|
|
186
|
+
function buildTableObj(component) {
|
|
187
|
+
const out = { type: "table", id: component.id };
|
|
188
|
+
if (component.label !== undefined)
|
|
189
|
+
out.label = component.label;
|
|
190
|
+
if (component.dataSource !== undefined)
|
|
191
|
+
out.dataSource = component.dataSource;
|
|
192
|
+
if (component.rowCount !== undefined)
|
|
193
|
+
out.rowCount = component.rowCount;
|
|
194
|
+
if (component.columns !== undefined && component.columns !== null) {
|
|
195
|
+
out.columns = component.columns.map((c) => ({ label: c.label, key: c.key }));
|
|
196
|
+
}
|
|
197
|
+
if (component.layout !== undefined)
|
|
198
|
+
out.layout = serializeLayout(component.layout);
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
201
|
+
function buildDynamicListObj(component) {
|
|
202
|
+
const out = { type: "dynamiclist", id: component.id };
|
|
203
|
+
if (component.label !== undefined)
|
|
204
|
+
out.label = component.label;
|
|
205
|
+
out.components = component.components.map(serializeComponent);
|
|
206
|
+
if (component.path !== undefined)
|
|
207
|
+
out.path = component.path;
|
|
208
|
+
if (component.isRepeating !== undefined)
|
|
209
|
+
out.isRepeating = component.isRepeating;
|
|
210
|
+
if (component.allowAddRemove !== undefined)
|
|
211
|
+
out.allowAddRemove = component.allowAddRemove;
|
|
212
|
+
if (component.defaultRepetitions !== undefined)
|
|
213
|
+
out.defaultRepetitions = component.defaultRepetitions;
|
|
214
|
+
if (component.showOutline !== undefined)
|
|
215
|
+
out.showOutline = component.showOutline;
|
|
216
|
+
if (component.layout !== undefined)
|
|
217
|
+
out.layout = serializeLayout(component.layout);
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
220
|
+
function buildIframeObj(component) {
|
|
221
|
+
const out = { type: "iframe", id: component.id };
|
|
222
|
+
if (component.label !== undefined)
|
|
223
|
+
out.label = component.label;
|
|
224
|
+
if (component.url !== undefined)
|
|
225
|
+
out.url = component.url;
|
|
226
|
+
if (component.height !== undefined)
|
|
227
|
+
out.height = component.height;
|
|
228
|
+
if (component.security !== undefined)
|
|
229
|
+
out.security = { ...component.security };
|
|
230
|
+
if (component.layout !== undefined)
|
|
231
|
+
out.layout = serializeLayout(component.layout);
|
|
232
|
+
return out;
|
|
233
|
+
}
|
|
234
|
+
function buildUnknownObj(component) {
|
|
235
|
+
const out = { ...component };
|
|
236
|
+
if (component.layout !== undefined)
|
|
237
|
+
out.layout = serializeLayout(component.layout);
|
|
238
|
+
return out;
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=form-serializer.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type { FormComponent, FormButtonComponent, FormCheckboxComponent, FormChecklistComponent, FormDatetimeComponent, FormDefinition, FormDocumentPreviewComponent, FormDynamicListComponent, FormExporter, FormExpressionComponent, FormFilepickerComponent, FormGroupComponent, FormHtmlComponent, FormIframeComponent, FormImageComponent, FormLayout, FormNumberComponent, FormRadioComponent, FormSelectComponent, FormSeparatorComponent, FormSpacerComponent, FormTableComponent, FormTaglistComponent, FormTextAreaComponent, FormTextComponent, FormTextFieldComponent, FormUnknownComponent, FormValidation, FormValueOption, } from "./form-model.js";
|
|
2
|
+
export { parseForm } from "./form-parser.js";
|
|
3
|
+
export { exportForm } from "./form-serializer.js";
|
|
4
|
+
export { FormBuilder, GroupBuilder } from "./form-builder.js";
|
|
5
|
+
export type { TextFieldOptions, SelectOptions, RadioOptions, CheckboxOptions, ChecklistOptions, GroupOptions, } from "./form-builder.js";
|
|
6
|
+
export { compactifyForm, expandForm } from "./compact.js";
|
|
7
|
+
export type { CompactForm, CompactFormField } from "./compact.js";
|
|
8
|
+
import { compactifyForm } from "./compact.js";
|
|
9
|
+
import type { CompactForm } from "./compact.js";
|
|
10
|
+
import { FormBuilder } from "./form-builder.js";
|
|
11
|
+
import type { FormDefinition } from "./form-model.js";
|
|
12
|
+
/** Top-level Form namespace providing create, parse, and export entry points. */
|
|
13
|
+
export declare const Form: {
|
|
14
|
+
/** Creates a new form using a fluent builder. */
|
|
15
|
+
readonly create: (id?: string) => FormBuilder;
|
|
16
|
+
/** Returns a minimal empty FormDefinition. Useful for "New Form" actions. */
|
|
17
|
+
readonly makeEmpty: (id?: string) => FormDefinition;
|
|
18
|
+
/** Parses a JSON string into a FormDefinition. */
|
|
19
|
+
readonly parse: (json: string) => FormDefinition;
|
|
20
|
+
/** Exports a FormDefinition to a JSON string. */
|
|
21
|
+
readonly export: (form: FormDefinition) => string;
|
|
22
|
+
/** Convert a FormDefinition to a token-efficient compact representation. */
|
|
23
|
+
readonly compactify: (form: FormDefinition) => ReturnType<typeof compactifyForm>;
|
|
24
|
+
/** Convert a compact form representation back to a FormDefinition. */
|
|
25
|
+
readonly expand: (compact: CompactForm) => FormDefinition;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export { parseForm } from "./form-parser.js";
|
|
2
|
+
export { exportForm } from "./form-serializer.js";
|
|
3
|
+
export { FormBuilder, GroupBuilder } from "./form-builder.js";
|
|
4
|
+
export { compactifyForm, expandForm } from "./compact.js";
|
|
5
|
+
import { generateId } from "../types/id-generator.js";
|
|
6
|
+
import { compactifyForm, expandForm } from "./compact.js";
|
|
7
|
+
import { FormBuilder } from "./form-builder.js";
|
|
8
|
+
import { parseForm } from "./form-parser.js";
|
|
9
|
+
import { exportForm } from "./form-serializer.js";
|
|
10
|
+
/** Top-level Form namespace providing create, parse, and export entry points. */
|
|
11
|
+
export const Form = {
|
|
12
|
+
/** Creates a new form using a fluent builder. */
|
|
13
|
+
create(id) {
|
|
14
|
+
return new FormBuilder(id);
|
|
15
|
+
},
|
|
16
|
+
/** Returns a minimal empty FormDefinition. Useful for "New Form" actions. */
|
|
17
|
+
makeEmpty(id) {
|
|
18
|
+
const formId = id ?? generateId("Form");
|
|
19
|
+
return {
|
|
20
|
+
id: formId,
|
|
21
|
+
type: "default",
|
|
22
|
+
schemaVersion: 16,
|
|
23
|
+
components: [{ type: "button", id: generateId("submit"), label: "Submit" }],
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
/** Parses a JSON string into a FormDefinition. */
|
|
27
|
+
parse(json) {
|
|
28
|
+
return parseForm(json);
|
|
29
|
+
},
|
|
30
|
+
/** Exports a FormDefinition to a JSON string. */
|
|
31
|
+
export(form) {
|
|
32
|
+
return exportForm(form);
|
|
33
|
+
},
|
|
34
|
+
/** Convert a FormDefinition to a token-efficient compact representation. */
|
|
35
|
+
compactify(form) {
|
|
36
|
+
return compactifyForm(form);
|
|
37
|
+
},
|
|
38
|
+
/** Convert a compact form representation back to a FormDefinition. */
|
|
39
|
+
expand(compact) {
|
|
40
|
+
return expandForm(compact);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { BpmnSdkError, ParseError, ValidationError } from "./errors.js";
|
|
2
|
+
export type { ErrorCode } from "./errors.js";
|
|
3
|
+
export { isBpmnActivity, isBpmnAdHocSubProcess, isBpmnBoundaryEvent, isBpmnBusinessRuleTask, isBpmnCallActivity, isBpmnComplexGateway, isBpmnEndEvent, isBpmnEvent, isBpmnEventBasedGateway, isBpmnEventSubProcess, isBpmnExclusiveGateway, isBpmnGateway, isBpmnInclusiveGateway, isBpmnIntermediateCatchEvent, isBpmnIntermediateThrowEvent, isBpmnManualTask, isBpmnParallelGateway, isBpmnReceiveTask, isBpmnScriptTask, isBpmnSendTask, isBpmnServiceTask, isBpmnStartEvent, isBpmnSubProcess, isBpmnTask, isBpmnTransaction, isBpmnUserTask, } from "./bpmn/type-guards.js";
|
|
4
|
+
export { findElement, findElementInProcess, findProcess, findSequenceFlow, getAllElements, getElementType, getZeebeExtensions, } from "./bpmn/utils.js";
|
|
5
|
+
export { Bpmn, SAMPLE_BPMN_XML } from "./bpmn/index.js";
|
|
6
|
+
export { applyAutoLayout } from "./bpmn/auto-layout.js";
|
|
7
|
+
export type { ProcessBuilder, BranchBuilder, SubProcessContentBuilder, ServiceTaskOptions, ScriptTaskOptions, UserTaskOptions, CallActivityOptions, BusinessRuleTaskOptions, ElementOptions, GatewayOptions, MultiInstanceOptions, SubProcessOptions, StartEventOptions, IntermediateCatchEventOptions, IntermediateThrowEventOptions, BoundaryEventOptions, AdHocSubProcessOptions, } from "./bpmn/bpmn-builder.js";
|
|
8
|
+
export type { BpmnDefinitions, BpmnProcess, BpmnFlowNode, BpmnFlowElement, BpmnSequenceFlow, BpmnBoundaryEvent, BpmnElementType, BpmnStartEvent, BpmnEndEvent, BpmnIntermediateCatchEvent, BpmnIntermediateThrowEvent, BpmnTask, BpmnServiceTask, BpmnScriptTask, BpmnUserTask, BpmnSendTask, BpmnReceiveTask, BpmnBusinessRuleTask, BpmnManualTask, BpmnCallActivity, BpmnSubProcess, BpmnAdHocSubProcess, BpmnEventSubProcess, BpmnTransaction, BpmnExclusiveGateway, BpmnParallelGateway, BpmnInclusiveGateway, BpmnEventBasedGateway, BpmnComplexGateway, BpmnCollaboration, BpmnParticipant, BpmnMessageFlow, BpmnLane, BpmnLaneSet, BpmnError, BpmnEscalation, BpmnMessage, BpmnTextAnnotation, BpmnAssociation, BpmnConditionExpression, BpmnEventDefinition, BpmnTimerEventDefinition, BpmnErrorEventDefinition, BpmnEscalationEventDefinition, BpmnMessageEventDefinition, BpmnSignalEventDefinition, BpmnConditionalEventDefinition, BpmnLinkEventDefinition, BpmnCancelEventDefinition, BpmnTerminateEventDefinition, BpmnCompensateEventDefinition, BpmnMultiInstanceLoopCharacteristics, BpmnDiagram, BpmnDiPlane, BpmnDiShape, BpmnDiEdge, BpmnDiLabel, BpmnBounds, BpmnWaypoint, } from "./bpmn/bpmn-model.js";
|
|
9
|
+
export type { RestConnectorConfig, RestAuthentication, HttpMethod, } from "./bpmn/rest-connector.js";
|
|
10
|
+
export type { ZeebeExtensions, ZeebeTaskDefinition, ZeebeIoMapping, ZeebeIoMappingEntry, ZeebeTaskHeaders, ZeebeTaskHeaderEntry, ZeebeProperties, ZeebePropertyEntry, ZeebeFormDefinition, ZeebeCalledDecision, } from "./bpmn/zeebe-extensions.js";
|
|
11
|
+
export { zeebeExtensionsToXmlElements } from "./bpmn/zeebe-extensions.js";
|
|
12
|
+
export { Dmn, layoutDmn, benchmarkDmnLayout, compactifyDmn, expandDmn } from "./dmn/index.js";
|
|
13
|
+
export type { DmnBenchmarkResult, DmnElementPosition, CompactDmn, CompactDmnDecision, CompactDmnInput, CompactDmnOutput, CompactDmnRule, } from "./dmn/index.js";
|
|
14
|
+
export { Form, compactifyForm, expandForm } from "./form/index.js";
|
|
15
|
+
export type { CompactForm, CompactFormField } from "./form/index.js";
|
|
16
|
+
export { FormBuilder, GroupBuilder } from "./form/form-builder.js";
|
|
17
|
+
export type { TextFieldOptions, SelectOptions, RadioOptions, CheckboxOptions, ChecklistOptions, GroupOptions, } from "./form/form-builder.js";
|
|
18
|
+
export type { FormComponent, FormCheckboxComponent, FormChecklistComponent, FormDefinition, FormExporter, FormGroupComponent, FormLayout, FormRadioComponent, FormSelectComponent, FormTextAreaComponent, FormTextComponent, FormTextFieldComponent, FormValidation, FormValueOption, FormNumberComponent, FormDatetimeComponent, FormButtonComponent, FormTaglistComponent, FormTableComponent, FormImageComponent, FormDynamicListComponent, FormIframeComponent, FormSeparatorComponent, FormSpacerComponent, FormDocumentPreviewComponent, FormHtmlComponent, FormExpressionComponent, FormFilepickerComponent, FormUnknownComponent, } from "./form/form-model.js";
|
|
19
|
+
export type { DecisionTableBuilder, InputOptions, OutputOptions, RuleOptions, } from "./dmn/dmn-builder.js";
|
|
20
|
+
export type { DmnDefinitions, DmnDecision, DmnDecisionTable, DmnInput, DmnOutput, DmnRule, DmnInputEntry, DmnOutputEntry, DmnDiagram, DmnDiagramShape, DmnDiagramEdge, DmnWaypoint, DmnTypeRef, DmnAggregation, HitPolicy, DmnInformationRequirement, DmnKnowledgeRequirement, DmnAuthorityRequirement, DmnInputData, DmnKnowledgeSource, DmnBusinessKnowledgeModel, DmnTextAnnotation, DmnAssociation, } from "./dmn/dmn-model.js";
|
|
21
|
+
export type { XmlElement } from "./types/xml-element.js";
|
|
22
|
+
export { generateId, resetIdCounter } from "./types/id-generator.js";
|
|
23
|
+
export { parseXml, serializeXml } from "./xml/index.js";
|
|
24
|
+
export { readDiColor, writeDiColor, BIOC_NS, COLOR_NS } from "./bpmn/di-color.js";
|
|
25
|
+
export type { DiColor } from "./bpmn/di-color.js";
|
|
26
|
+
export { optimize } from "./bpmn/optimize/index.js";
|
|
27
|
+
export type { OptimizationReport, OptimizationFinding, OptimizationSeverity, OptimizationCategory, ApplyFixResult, OptimizeOptions, } from "./bpmn/optimize/types.js";
|
|
28
|
+
export { layoutProcess, layoutFlowNodes } from "./layout/index.js";
|
|
29
|
+
export { benchmarkLayout, compareLayouts, formatBenchmarkResult, generateAutoLayout, parseReferenceLayout, } from "./layout/index.js";
|
|
30
|
+
export type { BenchmarkResult, BoundingBox, ElementComparison, ElementPosition, FlowOrderViolation, } from "./layout/index.js";
|
|
31
|
+
export type { Bounds, LayoutEdge, LayoutNode, LayoutResult, Waypoint } from "./layout/index.js";
|
|
32
|
+
export { ELEMENT_SIZES } from "./layout/index.js";
|
|
33
|
+
export { compactify, expand } from "./bpmn/compact.js";
|
|
34
|
+
export { exportSvg } from "./bpmn/svg.js";
|
|
35
|
+
export type { SvgExportOptions } from "./bpmn/svg.js";
|
|
36
|
+
export type { CompactDiagram, CompactElement, CompactFlow, CompactProcess, } from "./bpmn/compact.js";
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { BpmnSdkError, ParseError, ValidationError } from "./errors.js";
|
|
2
|
+
export { isBpmnActivity, isBpmnAdHocSubProcess, isBpmnBoundaryEvent, isBpmnBusinessRuleTask, isBpmnCallActivity, isBpmnComplexGateway, isBpmnEndEvent, isBpmnEvent, isBpmnEventBasedGateway, isBpmnEventSubProcess, isBpmnExclusiveGateway, isBpmnGateway, isBpmnInclusiveGateway, isBpmnIntermediateCatchEvent, isBpmnIntermediateThrowEvent, isBpmnManualTask, isBpmnParallelGateway, isBpmnReceiveTask, isBpmnScriptTask, isBpmnSendTask, isBpmnServiceTask, isBpmnStartEvent, isBpmnSubProcess, isBpmnTask, isBpmnTransaction, isBpmnUserTask, } from "./bpmn/type-guards.js";
|
|
3
|
+
export { findElement, findElementInProcess, findProcess, findSequenceFlow, getAllElements, getElementType, getZeebeExtensions, } from "./bpmn/utils.js";
|
|
4
|
+
export { Bpmn, SAMPLE_BPMN_XML } from "./bpmn/index.js";
|
|
5
|
+
export { applyAutoLayout } from "./bpmn/auto-layout.js";
|
|
6
|
+
export { zeebeExtensionsToXmlElements } from "./bpmn/zeebe-extensions.js";
|
|
7
|
+
export { Dmn, layoutDmn, benchmarkDmnLayout, compactifyDmn, expandDmn } from "./dmn/index.js";
|
|
8
|
+
export { Form, compactifyForm, expandForm } from "./form/index.js";
|
|
9
|
+
export { FormBuilder, GroupBuilder } from "./form/form-builder.js";
|
|
10
|
+
export { generateId, resetIdCounter } from "./types/id-generator.js";
|
|
11
|
+
export { parseXml, serializeXml } from "./xml/index.js";
|
|
12
|
+
export { readDiColor, writeDiColor, BIOC_NS, COLOR_NS } from "./bpmn/di-color.js";
|
|
13
|
+
export { optimize } from "./bpmn/optimize/index.js";
|
|
14
|
+
export { layoutProcess, layoutFlowNodes } from "./layout/index.js";
|
|
15
|
+
export { benchmarkLayout, compareLayouts, formatBenchmarkResult, generateAutoLayout, parseReferenceLayout, } from "./layout/index.js";
|
|
16
|
+
export { ELEMENT_SIZES } from "./layout/index.js";
|
|
17
|
+
export { compactify, expand } from "./bpmn/compact.js";
|
|
18
|
+
export { exportSvg } from "./bpmn/svg.js";
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { BpmnDefinitions } from "../bpmn/bpmn-model.js";
|
|
2
|
+
export interface ElementPosition {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
cx: number;
|
|
7
|
+
cy: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ElementComparison {
|
|
14
|
+
id: string;
|
|
15
|
+
type: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
ref: {
|
|
18
|
+
cx: number;
|
|
19
|
+
cy: number;
|
|
20
|
+
};
|
|
21
|
+
auto: {
|
|
22
|
+
cx: number;
|
|
23
|
+
cy: number;
|
|
24
|
+
};
|
|
25
|
+
/** Signed displacement: auto − ref. */
|
|
26
|
+
delta: {
|
|
27
|
+
dx: number;
|
|
28
|
+
dy: number;
|
|
29
|
+
};
|
|
30
|
+
/** Euclidean distance between centres. */
|
|
31
|
+
distance: number;
|
|
32
|
+
}
|
|
33
|
+
/** An edge whose auto-layout X order contradicts the flow direction. */
|
|
34
|
+
export interface FlowOrderViolation {
|
|
35
|
+
sourceId: string;
|
|
36
|
+
targetId: string;
|
|
37
|
+
sourceName?: string;
|
|
38
|
+
targetName?: string;
|
|
39
|
+
description: string;
|
|
40
|
+
}
|
|
41
|
+
export interface BenchmarkResult {
|
|
42
|
+
/** Original file name (for reporting). */
|
|
43
|
+
fileName: string;
|
|
44
|
+
elementCount: number;
|
|
45
|
+
flowCount: number;
|
|
46
|
+
/** Elements present in both reference and auto-layout. */
|
|
47
|
+
matchedCount: number;
|
|
48
|
+
elements: ElementComparison[];
|
|
49
|
+
orderViolations: FlowOrderViolation[];
|
|
50
|
+
avgDistance: number;
|
|
51
|
+
maxDistance: number;
|
|
52
|
+
/** 90th-percentile distance (more robust than max). */
|
|
53
|
+
p90Distance: number;
|
|
54
|
+
ref: BoundingBox;
|
|
55
|
+
auto: BoundingBox;
|
|
56
|
+
/** auto.width / ref.width (1.0 = same width). */
|
|
57
|
+
widthRatio: number;
|
|
58
|
+
/** auto.height / ref.height (1.0 = same height). */
|
|
59
|
+
heightRatio: number;
|
|
60
|
+
}
|
|
61
|
+
export interface BoundingBox {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
width: number;
|
|
65
|
+
height: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Extracts element positions from the BPMN DI data (the hand-crafted or
|
|
69
|
+
* tool-generated layout stored in the XML file).
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseReferenceLayout(defs: BpmnDefinitions): ElementPosition[];
|
|
72
|
+
/**
|
|
73
|
+
* Runs the auto-layout engine on the process and returns element positions.
|
|
74
|
+
*/
|
|
75
|
+
export declare function generateAutoLayout(defs: BpmnDefinitions): ElementPosition[];
|
|
76
|
+
/**
|
|
77
|
+
* Compares a reference layout (from XML DI) with an auto-generated layout.
|
|
78
|
+
*/
|
|
79
|
+
export declare function compareLayouts(defs: BpmnDefinitions, ref: ElementPosition[], auto: ElementPosition[], fileName?: string): BenchmarkResult;
|
|
80
|
+
/**
|
|
81
|
+
* Full benchmark pipeline: parse → extract reference layout → auto-layout → compare.
|
|
82
|
+
*/
|
|
83
|
+
export declare function benchmarkLayout(xml: string, fileName?: string): BenchmarkResult;
|
|
84
|
+
/** Format a BenchmarkResult as a human-readable report string. */
|
|
85
|
+
export declare function formatBenchmarkResult(r: BenchmarkResult): string;
|
|
86
|
+
//# sourceMappingURL=bench.d.ts.map
|