@waron97/prbot 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -18
- package/agrippa-pb.md +172 -74
- package/package.json +1 -1
- package/src/agrippa/commands/clone.js +7 -1
- package/src/agrippa/commands/cloneLrp.js +114 -0
- package/src/agrippa/commands/diff.js +23 -10
- package/src/agrippa/commands/initPhase.js +44 -34
- package/src/agrippa/commands/pb.js +61 -16
- package/src/agrippa/commands/pull.js +93 -17
- package/src/agrippa/commands/pullLrp.js +55 -0
- package/src/agrippa/commands/push.js +88 -19
- package/src/agrippa/commands/pushLrp.js +56 -0
- package/src/agrippa/index.js +32 -17
- package/src/agrippa/lib/lrpApi.js +153 -0
- package/src/agrippa/lib/pbEdit.js +103 -6
- package/src/agrippa/lib/pbLayout.js +23 -2
- package/src/agrippa/lib/pbModel.js +324 -90
- package/src/agrippa/lib/pbPreview.js +4 -2
- package/src/agrippa/lib/pbProject.js +34 -5
- package/src/agrippa/lib/pbScriptTemplate.js +29 -0
- package/src/commands/autopr.js +1 -1
|
@@ -52,7 +52,9 @@ const NODE_FIELDS = [
|
|
|
52
52
|
'fields',
|
|
53
53
|
'formKey',
|
|
54
54
|
'attachedToRef',
|
|
55
|
-
'
|
|
55
|
+
'eventDefinitions',
|
|
56
|
+
'calledElement',
|
|
57
|
+
'dataIO',
|
|
56
58
|
'multiInstance',
|
|
57
59
|
'documentation',
|
|
58
60
|
];
|
|
@@ -107,9 +109,12 @@ function geometryMaps(diagram) {
|
|
|
107
109
|
if (s.attrs.isExpanded !== undefined)
|
|
108
110
|
expanded[s.attrs.bpmnElement] = s.attrs.isExpanded;
|
|
109
111
|
}
|
|
112
|
+
// Always record the edge, even with zero waypoints (rare, but real —
|
|
113
|
+
// some exporters emit an empty <...:BPMNEdge>). Skipping on `.length`
|
|
114
|
+
// would drop the entry, so buildDiagram doesn't recreate the edge shape
|
|
115
|
+
// at all, losing a real (if degenerate) diagram element.
|
|
110
116
|
for (const e of diagram.edges)
|
|
111
|
-
|
|
112
|
-
waypoints[e.attrs.bpmnElement] = e.waypoints.map((w) => [w.x, w.y]);
|
|
117
|
+
waypoints[e.attrs.bpmnElement] = (e.waypoints || []).map((w) => [w.x, w.y]);
|
|
113
118
|
}
|
|
114
119
|
return { bounds, waypoints, expanded };
|
|
115
120
|
}
|
|
@@ -121,6 +126,7 @@ function structEdge(e, geo) {
|
|
|
121
126
|
if (e.name !== undefined) o.name = e.name;
|
|
122
127
|
if (e.condition !== undefined) o.condition = e.condition;
|
|
123
128
|
if (e.conditionType !== undefined) o.conditionType = e.conditionType;
|
|
129
|
+
if (e.conditionAttrs !== undefined) o.conditionAttrs = e.conditionAttrs;
|
|
124
130
|
if (e.documentation !== undefined) o.documentation = e.documentation;
|
|
125
131
|
if (geo.waypoints[e.id]) o.waypoints = geo.waypoints[e.id];
|
|
126
132
|
return o;
|
|
@@ -166,9 +172,11 @@ function flattenNodes(structNodes, parentId, model, read, geo) {
|
|
|
166
172
|
if (se.name !== undefined) e.name = se.name;
|
|
167
173
|
if (se.condition !== undefined) e.condition = se.condition;
|
|
168
174
|
if (se.conditionType !== undefined) e.conditionType = se.conditionType;
|
|
175
|
+
if (se.conditionAttrs !== undefined) e.conditionAttrs = se.conditionAttrs;
|
|
169
176
|
if (se.documentation !== undefined) e.documentation = se.documentation;
|
|
170
177
|
if (parentId) e.parent = parentId;
|
|
171
178
|
if (se.waypoints) geo.waypoints[se.id] = se.waypoints;
|
|
179
|
+
if (se.labelPos) geo.labelPos[se.id] = se.labelPos;
|
|
172
180
|
model.edges.push(e);
|
|
173
181
|
}
|
|
174
182
|
if (sn.nodes) flattenNodes(sn.nodes, sn.id, model, read, geo);
|
|
@@ -218,7 +226,10 @@ function decompose(payload) {
|
|
|
218
226
|
// back for the diagram).
|
|
219
227
|
const structure = {
|
|
220
228
|
process: model.process,
|
|
229
|
+
messages: model.messages,
|
|
221
230
|
errors: model.errors,
|
|
231
|
+
signals: model.signals,
|
|
232
|
+
extraDefs: model.extraDefs,
|
|
222
233
|
nodes: nestNodes(model, null, scriptsMap, geo),
|
|
223
234
|
annotations: model.annotations.map((a) =>
|
|
224
235
|
geo.bounds[a.id] ? { ...a, layout: geo.bounds[a.id] } : a
|
|
@@ -226,6 +237,9 @@ function decompose(payload) {
|
|
|
226
237
|
associations: model.associations.map((a) =>
|
|
227
238
|
geo.waypoints[a.id] ? { ...a, waypoints: geo.waypoints[a.id] } : a
|
|
228
239
|
),
|
|
240
|
+
groups: (model.groups || []).map((g) =>
|
|
241
|
+
geo.bounds[g.id] ? { ...g, layout: geo.bounds[g.id] } : g
|
|
242
|
+
),
|
|
229
243
|
};
|
|
230
244
|
files[STRUCTURE_FILE] = stringifyStructure(structure);
|
|
231
245
|
|
|
@@ -258,17 +272,22 @@ function recompose(read) {
|
|
|
258
272
|
|
|
259
273
|
const model = {
|
|
260
274
|
process: structure.process,
|
|
275
|
+
messages: structure.messages || [],
|
|
261
276
|
errors: structure.errors || [],
|
|
277
|
+
signals: structure.signals || [],
|
|
278
|
+
extraDefs: structure.extraDefs || [],
|
|
262
279
|
nodes: [],
|
|
263
280
|
edges: [],
|
|
264
281
|
annotations: structure.annotations || [],
|
|
265
282
|
associations: structure.associations || [],
|
|
283
|
+
groups: structure.groups || [],
|
|
266
284
|
};
|
|
267
|
-
const geo = { bounds: {}, waypoints: {}, expanded: {} };
|
|
285
|
+
const geo = { bounds: {}, waypoints: {}, expanded: {}, labelPos: {} };
|
|
268
286
|
flattenNodes(structure.nodes, null, model, read, geo);
|
|
269
|
-
// annotation/association geometry (top-level lists carry it inline)
|
|
287
|
+
// annotation/association/group geometry (top-level lists carry it inline)
|
|
270
288
|
for (const a of model.annotations) if (a.layout) geo.bounds[a.id] = a.layout;
|
|
271
289
|
for (const a of model.associations) if (a.waypoints) geo.waypoints[a.id] = a.waypoints;
|
|
290
|
+
for (const g of model.groups) if (g.layout) geo.bounds[g.id] = g.layout;
|
|
272
291
|
|
|
273
292
|
const built_page = buildProcess({ ns: manifest.ns, model, geo });
|
|
274
293
|
|
|
@@ -342,6 +361,15 @@ function localChecksum(read) {
|
|
|
342
361
|
return computeChecksum(stableStringify(recompose(read)));
|
|
343
362
|
}
|
|
344
363
|
|
|
364
|
+
// Semantic checksum of a remote payload. Decompose → recompose normalises field
|
|
365
|
+
// order and non-semantic server-side differences, same pipeline as localChecksum
|
|
366
|
+
// so the two are directly comparable.
|
|
367
|
+
function remoteChecksumPb(payload) {
|
|
368
|
+
const { files } = decompose(payload);
|
|
369
|
+
const read = (p) => files[p] ?? '';
|
|
370
|
+
return computeChecksum(stableStringify(recompose(read)));
|
|
371
|
+
}
|
|
372
|
+
|
|
345
373
|
// Enumerate the wizard's pages from the pages/*.yml files (the authoritative
|
|
346
374
|
// local set). Each page links to its userTask via `page._id.stepkey`; the
|
|
347
375
|
// manifest supplies the upstream page guid (absent => a locally-added page that
|
|
@@ -379,6 +407,7 @@ export {
|
|
|
379
407
|
verifyRoundTrip,
|
|
380
408
|
stableStringify,
|
|
381
409
|
localChecksum,
|
|
410
|
+
remoteChecksumPb,
|
|
382
411
|
enumeratePages,
|
|
383
412
|
stringifyStructure,
|
|
384
413
|
pad,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Initial body scaffolded into a new scriptTask's .js file (mirrors the
|
|
2
|
+
// `pbtemplate` editor snippet) so created scripts aren't empty.
|
|
3
|
+
export const SCRIPT_TEMPLATE = `try {
|
|
4
|
+
// ----------------------------
|
|
5
|
+
// Input gathering
|
|
6
|
+
// ----------------------------
|
|
7
|
+
|
|
8
|
+
// ----------------------------
|
|
9
|
+
// Output variable initialization
|
|
10
|
+
// ----------------------------
|
|
11
|
+
|
|
12
|
+
// ----------------------------
|
|
13
|
+
// Logical Helpers
|
|
14
|
+
// ----------------------------
|
|
15
|
+
|
|
16
|
+
// ----------------------------
|
|
17
|
+
// Main Execution
|
|
18
|
+
// ----------------------------
|
|
19
|
+
|
|
20
|
+
// ----------------------------
|
|
21
|
+
// Output
|
|
22
|
+
// ----------------------------
|
|
23
|
+
|
|
24
|
+
} catch (err) {
|
|
25
|
+
execution.setVariable('isAlive', false);
|
|
26
|
+
execution.setVariable('errorCode', '');
|
|
27
|
+
execution.setVariable('errorMessage', err.message);
|
|
28
|
+
}
|
|
29
|
+
`;
|
package/src/commands/autopr.js
CHANGED
|
@@ -282,7 +282,7 @@ async function autopr(options) {
|
|
|
282
282
|
|
|
283
283
|
const content = readFileSync(changelogPath, 'utf-8');
|
|
284
284
|
|
|
285
|
-
const duplicate =
|
|
285
|
+
const duplicate = findDuplicateLine(content, ids, options.jira ?? []);
|
|
286
286
|
|
|
287
287
|
let appendMode = false;
|
|
288
288
|
if (duplicate) {
|