@dotbep/core 0.2.15 → 0.2.16
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/dist/index.d.ts +14 -18
- package/dist/index.js +255 -277
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const Ge = r.enum([
|
|
|
4
4
|
"appointing-party",
|
|
5
5
|
"lead-appointed-party",
|
|
6
6
|
"appointed-party"
|
|
7
|
-
]), Xe = r.enum(["video", "document"]), Ve = r.enum(["zone", "location"]), He = r.enum(["LR", "TB"]),
|
|
7
|
+
]), Xe = r.enum(["video", "document"]), Ve = r.enum(["zone", "location"]), He = r.enum(["LR", "TB"]), Ps = r.enum(["start", "end", "process", "decision", "automation"]), Ye = r.enum(["info", "warning", "blocking"]), Qe = r.enum([
|
|
8
8
|
"roles",
|
|
9
9
|
"members",
|
|
10
10
|
"teams",
|
|
@@ -98,10 +98,10 @@ const Ge = r.enum([
|
|
|
98
98
|
}), ge = r.object({
|
|
99
99
|
id: r.string().min(1).describe("Used in deliverables nomenclature."),
|
|
100
100
|
name: r.string().min(1)
|
|
101
|
-
}).describe("A project discipline used to classify deliverables and information requirements. Represents a technical domain such as structure, architecture, or MEP."),
|
|
101
|
+
}).describe("A project discipline used to classify deliverables and information requirements. Represents a technical domain such as structure, architecture, or MEP."), we = r.object({
|
|
102
102
|
id: r.string().min(1),
|
|
103
103
|
name: r.string().min(1)
|
|
104
|
-
}).describe("A file format or extension accepted for deliverables, such as IFC, PDF, or DWG. Used to specify the required output formats per deliverable."),
|
|
104
|
+
}).describe("A file format or extension accepted for deliverables, such as IFC, PDF, or DWG. Used to specify the required output formats per deliverable."), ye = r.object({
|
|
105
105
|
id: r.string().min(1).describe("Used in deliverables nomenclature."),
|
|
106
106
|
name: r.string().min(1),
|
|
107
107
|
extensionIds: r.array(r.string()).optional()
|
|
@@ -128,7 +128,7 @@ const Ge = r.enum([
|
|
|
128
128
|
description: r.string().optional(),
|
|
129
129
|
softwareIds: r.array(r.string()).optional().describe("ref Software.id[]"),
|
|
130
130
|
guideIds: r.array(r.string()).optional().describe("ref Guide.id[]")
|
|
131
|
-
}).describe("A human-performed activity referenced by workflow process nodes. Actions represent what a person in a given role does at a specific step."),
|
|
131
|
+
}).describe("A human-performed activity referenced by workflow process nodes. Actions represent what a person in a given role does at a specific step."), C = r.object({
|
|
132
132
|
key: r.string().min(1),
|
|
133
133
|
type: r.enum(["string", "number", "boolean"]),
|
|
134
134
|
required: r.boolean(),
|
|
@@ -140,18 +140,18 @@ const Ge = r.enum([
|
|
|
140
140
|
}), Se = r.object({
|
|
141
141
|
id: r.string().min(1).describe('Human-readable slug, e.g. "status-changed".'),
|
|
142
142
|
name: r.string().min(1),
|
|
143
|
-
payload: r.array(
|
|
143
|
+
payload: r.array(C).optional()
|
|
144
144
|
}).describe("A signal that advances a workflow instance from one node to the next. Carries a typed payload that moves the workflow instance forward and can be evaluated by decision guards."), Ne = r.object({
|
|
145
145
|
id: r.string().min(1).describe('Human-readable slug, e.g. "notify".'),
|
|
146
146
|
name: r.string().min(1),
|
|
147
147
|
description: r.string().min(1).describe("Describe exactly what this effect must do so the runtime developer knows what to implement: what action it performs and what external system or service it calls."),
|
|
148
|
-
payload: r.array(
|
|
148
|
+
payload: r.array(C).optional()
|
|
149
149
|
}).describe("A fire-and-forget side effect triggered on a workflow edge. Executed by the runtime when the edge is traversed, using fields from the instance context as payload."), ke = r.object({
|
|
150
150
|
id: r.string().min(1).describe('Human-readable slug, e.g. "verify-tolerances".'),
|
|
151
151
|
name: r.string().min(1),
|
|
152
152
|
description: r.string().min(1).describe("Describe what this handler checks and what decision it produces: what condition or business rule it evaluates and where that data comes from."),
|
|
153
|
-
payload: r.array(
|
|
154
|
-
output: r.array(
|
|
153
|
+
payload: r.array(C).optional().describe("Fields consumed from instance context and passed to the handler."),
|
|
154
|
+
output: r.array(C).describe("Fields the handler must return. Guards on outgoing edges reference these.")
|
|
155
155
|
}).describe("A system-executed node in a workflow. Runs a handler automatically, produces a typed output, and must be followed by a decision node that branches on that output."), it = r.object({
|
|
156
156
|
hours: r.number().positive(),
|
|
157
157
|
effectId: r.string().min(1).describe("ref FlowEffect.id")
|
|
@@ -222,7 +222,7 @@ const Ge = r.enum([
|
|
|
222
222
|
triggerEventId: r.string().min(1).describe("ref FlowEvent.id — the event that fires this transition")
|
|
223
223
|
}), pt = Y.extend({
|
|
224
224
|
guard: ut.describe("Condition evaluated against the instance context to determine which path to take.")
|
|
225
|
-
}), ht = Y, gt = r.union([mt, pt, ht]),
|
|
225
|
+
}), ht = Y, gt = r.union([mt, pt, ht]), wt = r.object({
|
|
226
226
|
direction: He.default("LR"),
|
|
227
227
|
nodes: r.record(r.string(), ft),
|
|
228
228
|
edges: r.record(r.string(), gt)
|
|
@@ -282,20 +282,20 @@ const Ge = r.enum([
|
|
|
282
282
|
path: ["edges", a, "guard"]
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
}).describe("The visual and structural definition of a workflow."),
|
|
285
|
+
}).describe("The visual and structural definition of a workflow."), Re = r.object({
|
|
286
286
|
id: r.uuid(),
|
|
287
287
|
name: r.string().min(1),
|
|
288
288
|
description: r.string().optional(),
|
|
289
289
|
example: r.string().optional().describe("Narrative example showcasing one cycle of this workflow."),
|
|
290
290
|
trackedAssetTypeId: r.string().optional().describe("ref AssetType.id"),
|
|
291
|
-
diagram:
|
|
292
|
-
}).describe("A reusable process definition associated with one or more BIM uses. Describes the ordered steps, responsibilities, and transitions that govern how work is carried out."),
|
|
291
|
+
diagram: wt
|
|
292
|
+
}).describe("A reusable process definition associated with one or more BIM uses. Describes the ordered steps, responsibilities, and transitions that govern how work is carried out."), Te = r.object({
|
|
293
293
|
id: r.uuid(),
|
|
294
294
|
name: r.string().min(1),
|
|
295
295
|
type: Xe,
|
|
296
296
|
url: r.string().min(1),
|
|
297
297
|
description: r.string().optional()
|
|
298
|
-
}).describe("Supporting material attached to the BEP, such as a reference document or instructional video."),
|
|
298
|
+
}).describe("Supporting material attached to the BEP, such as a reference document or instructional video."), $e = r.object({
|
|
299
299
|
id: r.uuid(),
|
|
300
300
|
name: r.string().min(1),
|
|
301
301
|
description: r.string().optional().describe("Short guide description, not it's content"),
|
|
@@ -305,7 +305,7 @@ const Ge = r.enum([
|
|
|
305
305
|
name: r.string().min(1),
|
|
306
306
|
description: r.string().optional(),
|
|
307
307
|
contentPath: r.string().describe("Relative path to the .md file inside the .bep archive.")
|
|
308
|
-
}).describe("A normative reference or rule that governs how work is carried out on the project. Standards define what must be followed, as opposed to guides which explain how."),
|
|
308
|
+
}).describe("A normative reference or rule that governs how work is carried out on the project. Standards define what must be followed, as opposed to guides which explain how."), je = r.object({
|
|
309
309
|
id: r.string().min(1),
|
|
310
310
|
name: r.string().min(1),
|
|
311
311
|
checklist: r.array(r.string()).optional()
|
|
@@ -313,17 +313,17 @@ const Ge = r.enum([
|
|
|
313
313
|
id: r.string().min(1),
|
|
314
314
|
name: r.string().min(1),
|
|
315
315
|
checklist: r.array(r.string()).optional()
|
|
316
|
-
}).describe("An information detail level assigned to model elements in LOIN requirements. Specifies the non-geometric properties required of a model element at a given milestone."),
|
|
316
|
+
}).describe("An information detail level assigned to model elements in LOIN requirements. Specifies the non-geometric properties required of a model element at a given milestone."), yt = r.object({
|
|
317
317
|
milestoneId: r.string(),
|
|
318
318
|
lodId: r.string().min(1),
|
|
319
319
|
loiId: r.string().min(1),
|
|
320
320
|
idsPath: r.string().optional().describe("Relative path to the .ids (Information Delivery Specification) file inside the .bep archive.")
|
|
321
|
-
}),
|
|
321
|
+
}), Be = r.object({
|
|
322
322
|
id: r.uuid(),
|
|
323
323
|
element: r.string().min(1),
|
|
324
324
|
disciplineId: r.string(),
|
|
325
|
-
milestones: r.array(
|
|
326
|
-
}).describe("An information requirement for a model element. Declares what geometric detail and information properties are required for a specific model element and discipline across project milestones."),
|
|
325
|
+
milestones: r.array(yt).optional()
|
|
326
|
+
}).describe("An information requirement for a model element. Declares what geometric detail and information properties are required for a specific model element and discipline across project milestones."), Me = r.object({
|
|
327
327
|
id: r.uuid(),
|
|
328
328
|
message: r.string().min(1),
|
|
329
329
|
memberEmail: r.email(),
|
|
@@ -335,7 +335,7 @@ const Ge = r.enum([
|
|
|
335
335
|
severity: Ye,
|
|
336
336
|
message: r.string().min(1),
|
|
337
337
|
generatedAt: r.iso.datetime()
|
|
338
|
-
}).describe("A diagnostic message attached to the BEP or one of its entities. Indicates an issue or observation with a severity level that guides the author."),
|
|
338
|
+
}).describe("A diagnostic message attached to the BEP or one of its entities. Indicates an issue or observation with a severity level that guides the author."), Pe = vt.refine((n) => n.entity === null == (n.entityId === null), {
|
|
339
339
|
message: "entity and entityId must both be null (BEP-level) or both be non-null (entity-level)."
|
|
340
340
|
}), bt = r.object({
|
|
341
341
|
id: r.uuid(),
|
|
@@ -350,25 +350,25 @@ const Ge = r.enum([
|
|
|
350
350
|
predecessorId: r.string().optional(),
|
|
351
351
|
url: r.url().optional(),
|
|
352
352
|
resolverId: r.string().min(1).optional()
|
|
353
|
-
}).describe("A formal output committed by a team at a milestone. Defines what must be delivered, in what format, by whom, and by when."),
|
|
353
|
+
}).describe("A formal output committed by a team at a milestone. Defines what must be delivered, in what format, by whom, and by when."), xe = bt.refine((n) => !n.predecessorId || n.predecessorId !== n.id, {
|
|
354
354
|
message: "predecessorId cannot reference the deliverable itself.",
|
|
355
355
|
path: ["predecessorId"]
|
|
356
356
|
}), Fe = r.object({
|
|
357
357
|
key: r.string().min(1),
|
|
358
358
|
description: r.string().min(1).describe("Describe what this variable holds and which service it belongs to."),
|
|
359
359
|
sensitive: r.boolean().optional()
|
|
360
|
-
}).describe("A runtime configuration entry for handlers. Used to store credentials, endpoints, or other runtime settings without hardcoding them."),
|
|
360
|
+
}).describe("A runtime configuration entry for handlers. Used to store credentials, endpoints, or other runtime settings without hardcoding them."), Ce = r.object({
|
|
361
361
|
id: r.string().min(1).describe('Human-readable slug, e.g. "google-sheet"'),
|
|
362
362
|
name: r.string().min(1),
|
|
363
363
|
description: r.string().min(1).describe("Describe what external data this fetches, from where, and what format it returns: which service or API it calls, what credentials it needs, and the shape of the raw payload it returns."),
|
|
364
364
|
envKeys: r.array(r.string().min(1)).describe("ref EnvVar.key[] — env vars required by this resolver handler.")
|
|
365
|
-
}).describe("A server-side handler declared in the BEP bundle that authenticates against an external service, fetches data, and returns a raw payload for a live resource."),
|
|
365
|
+
}).describe("A server-side handler declared in the BEP bundle that authenticates against an external service, fetches data, and returns a raw payload for a live resource."), Le = r.object({
|
|
366
366
|
id: r.uuid(),
|
|
367
367
|
name: r.string().min(1),
|
|
368
368
|
description: r.string().min(1).describe("Describe what this data source represents in the project context: what information it holds, how it is used in the BEP, and who or what system produces it."),
|
|
369
369
|
url: r.url(),
|
|
370
370
|
resolverId: r.string().min(1).optional().describe("ref Resolver.id")
|
|
371
|
-
}).describe("A reference to an external data source that is fetched at runtime. The BEP does not store the data — it only declares where it lives and how to access it using a resolver."),
|
|
371
|
+
}).describe("A reference to an external data source that is fetched at runtime. The BEP does not store the data — it only declares where it lives and how to access it using a resolver."), xs = r.object({
|
|
372
372
|
project: de,
|
|
373
373
|
deliverableNamingConvention: ue.optional(),
|
|
374
374
|
roles: r.array(le),
|
|
@@ -378,8 +378,8 @@ const Ge = r.enum([
|
|
|
378
378
|
milestones: r.array(pe),
|
|
379
379
|
lbs: r.array(he),
|
|
380
380
|
disciplines: r.array(ge),
|
|
381
|
-
extensions: r.array(
|
|
382
|
-
assetTypes: r.array(
|
|
381
|
+
extensions: r.array(we),
|
|
382
|
+
assetTypes: r.array(ye),
|
|
383
383
|
softwares: r.array(ve),
|
|
384
384
|
objectives: r.array(be),
|
|
385
385
|
bimUses: r.array(Ie),
|
|
@@ -388,18 +388,18 @@ const Ge = r.enum([
|
|
|
388
388
|
effects: r.array(Ne),
|
|
389
389
|
automations: r.array(ke),
|
|
390
390
|
env: r.array(Fe),
|
|
391
|
-
resolvers: r.array(
|
|
392
|
-
remoteData: r.array(
|
|
393
|
-
workflows: r.array(
|
|
394
|
-
guides: r.array(
|
|
395
|
-
annexes: r.array(
|
|
391
|
+
resolvers: r.array(Ce),
|
|
392
|
+
remoteData: r.array(Le),
|
|
393
|
+
workflows: r.array(Re),
|
|
394
|
+
guides: r.array($e),
|
|
395
|
+
annexes: r.array(Te),
|
|
396
396
|
standards: r.array(Ae),
|
|
397
|
-
lods: r.array(
|
|
397
|
+
lods: r.array(je),
|
|
398
398
|
lois: r.array(Oe),
|
|
399
|
-
loin: r.array(
|
|
400
|
-
deliverables: r.array(
|
|
401
|
-
notes: r.array(
|
|
402
|
-
flags: r.array(
|
|
399
|
+
loin: r.array(Be),
|
|
400
|
+
deliverables: r.array(xe),
|
|
401
|
+
notes: r.array(Me),
|
|
402
|
+
flags: r.array(Pe)
|
|
403
403
|
}), ne = r.object({
|
|
404
404
|
version: r.string().regex(/^\d+\.\d+$/).describe('Format: "{major}.{minor}" (e.g. "1.0", "2.3").'),
|
|
405
405
|
date: r.iso.datetime(),
|
|
@@ -416,7 +416,7 @@ const Ge = r.enum([
|
|
|
416
416
|
current: r.string().regex(/^\d+\.\d+$/).describe('Current version in "{major}.{minor}" format.'),
|
|
417
417
|
versions: r.array(It)
|
|
418
418
|
});
|
|
419
|
-
function
|
|
419
|
+
function $(n) {
|
|
420
420
|
return n.roles ??= [], n.members ??= [], n.teams ??= [], n.phases ??= [], n.milestones ??= [], n.lbs ??= [], n.disciplines ??= [], n.extensions ??= [], n.assetTypes ??= [], n.softwares ??= [], n.objectives ??= [], n.bimUses ??= [], n.actions ??= [], n.events ??= [], n.effects ??= [], n.workflows ??= [], n.guides ??= [], n.annexes ??= [], n.standards ??= [], n.lods ??= [], n.lois ??= [], n.loin ??= [], n.deliverables ??= [], n.notes ??= [], n.flags ??= [], n.env ??= [], n.automations ??= [], n.resolvers ??= [], n.remoteData ??= [], n;
|
|
421
421
|
}
|
|
422
422
|
const Et = "-", St = "^[A-Z0-9]{3}$";
|
|
@@ -427,13 +427,13 @@ function Nt(n, e) {
|
|
|
427
427
|
}
|
|
428
428
|
return St;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function j(n, e, s) {
|
|
431
431
|
const t = s?.delimiter ?? Et, i = Nt(n, s);
|
|
432
432
|
return new RegExp(i).test(e) ? e.includes(t) ? `"${e}" contains the naming delimiter "${t}"` : null : `"${e}" does not match naming pattern ${i} for token "${n}"`;
|
|
433
433
|
}
|
|
434
434
|
function kt(n, e) {
|
|
435
435
|
const s = [], t = (i, o) => {
|
|
436
|
-
const a =
|
|
436
|
+
const a = j(i, o, e);
|
|
437
437
|
a && s.push(a);
|
|
438
438
|
};
|
|
439
439
|
t("project", n.project.code);
|
|
@@ -504,7 +504,7 @@ const De = [
|
|
|
504
504
|
// lbs (self-referential)
|
|
505
505
|
{ entity: "lbs", references: "lbs", inField: "lbsNodeIds", array: !0 }
|
|
506
506
|
];
|
|
507
|
-
function
|
|
507
|
+
function Rt(n, e, s) {
|
|
508
508
|
return De.filter((t) => t.references === e).flatMap((t) => s[t.entity].filter((o) => {
|
|
509
509
|
const a = o[t.inField];
|
|
510
510
|
return t.array ? Array.isArray(a) && a.includes(n) : a === n;
|
|
@@ -524,7 +524,7 @@ function ie(n, e, s) {
|
|
|
524
524
|
function z(n) {
|
|
525
525
|
return n instanceof We ? n.issues.map((e) => (e.path.length ? e.path.join(".") + ": " : "") + e.message).join("; ") : n.message;
|
|
526
526
|
}
|
|
527
|
-
class
|
|
527
|
+
class w {
|
|
528
528
|
constructor(e, s, t) {
|
|
529
529
|
this.getItems = e, this.getBep = s, this.config = t, this.idField = t.idField ?? "id";
|
|
530
530
|
}
|
|
@@ -599,7 +599,7 @@ class y {
|
|
|
599
599
|
continue;
|
|
600
600
|
}
|
|
601
601
|
try {
|
|
602
|
-
const d =
|
|
602
|
+
const d = Rt(i, this.config.key, this.getBep());
|
|
603
603
|
if (d.length) throw new Error(`Referenced by: ${d.join(", ")}`);
|
|
604
604
|
this.config.beforeRemove?.(i, this.getBep()), o.splice(a, 1), s.push(i);
|
|
605
605
|
} catch (d) {
|
|
@@ -609,7 +609,7 @@ class y {
|
|
|
609
609
|
return { succeeded: s, failed: t };
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
class
|
|
612
|
+
class Tt extends w {
|
|
613
613
|
constructor(e) {
|
|
614
614
|
super(
|
|
615
615
|
() => e().actions,
|
|
@@ -628,20 +628,20 @@ class Rt extends y {
|
|
|
628
628
|
);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
class
|
|
631
|
+
class $t extends w {
|
|
632
632
|
constructor(e) {
|
|
633
633
|
super(
|
|
634
634
|
() => e().annexes,
|
|
635
635
|
e,
|
|
636
636
|
{
|
|
637
637
|
key: "annexes",
|
|
638
|
-
schema:
|
|
638
|
+
schema: Te,
|
|
639
639
|
autoId: !0
|
|
640
640
|
}
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
class At extends
|
|
644
|
+
class At extends w {
|
|
645
645
|
constructor(e) {
|
|
646
646
|
super(
|
|
647
647
|
() => e().effects,
|
|
@@ -663,7 +663,7 @@ class At extends y {
|
|
|
663
663
|
);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
class
|
|
666
|
+
class jt extends w {
|
|
667
667
|
constructor(e) {
|
|
668
668
|
super(
|
|
669
669
|
() => e().automations,
|
|
@@ -681,7 +681,7 @@ class Tt extends y {
|
|
|
681
681
|
);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
class Ot extends
|
|
684
|
+
class Ot extends w {
|
|
685
685
|
constructor(e) {
|
|
686
686
|
super(
|
|
687
687
|
() => e().env,
|
|
@@ -694,7 +694,7 @@ class Ot extends y {
|
|
|
694
694
|
);
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
class
|
|
697
|
+
class Bt extends w {
|
|
698
698
|
constructor(e) {
|
|
699
699
|
super(
|
|
700
700
|
() => e().events,
|
|
@@ -712,7 +712,7 @@ class Mt extends y {
|
|
|
712
712
|
);
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function x(n) {
|
|
716
716
|
const e = /* @__PURE__ */ new Map();
|
|
717
717
|
for (const s of n)
|
|
718
718
|
for (const t of s.lbsNodeIds ?? [])
|
|
@@ -727,7 +727,7 @@ function Q(n) {
|
|
|
727
727
|
}
|
|
728
728
|
function Ue(n, e) {
|
|
729
729
|
if (!n) return { zoneCode: "XXX", locationCode: "XXX" };
|
|
730
|
-
const s = new Map(e.map((d) => [d.id, d])), t =
|
|
730
|
+
const s = new Map(e.map((d) => [d.id, d])), t = x(e), i = Q(e), o = s.get(n);
|
|
731
731
|
if (!o) return { zoneCode: "XXX", locationCode: "XXX" };
|
|
732
732
|
if (i.has(o.id)) return { zoneCode: "ZZZ", locationCode: "ZZZ" };
|
|
733
733
|
if (o.type === "zone") return { zoneCode: o.id, locationCode: "ZZZ" };
|
|
@@ -741,7 +741,7 @@ function Ue(n, e) {
|
|
|
741
741
|
}
|
|
742
742
|
return { zoneCode: "ZZZ", locationCode: o.id };
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Mt(n) {
|
|
745
745
|
const e = [], s = new Map(n.map((d) => [d.id, d])), t = Q(n);
|
|
746
746
|
for (const d of t) {
|
|
747
747
|
const l = s.get(d);
|
|
@@ -773,7 +773,7 @@ function K(n) {
|
|
|
773
773
|
}
|
|
774
774
|
return e;
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const P = "XXX";
|
|
777
777
|
function ze(n, e, s, t, i) {
|
|
778
778
|
const { zoneCode: o, locationCode: a } = Ue(n.lbsNodeId, t);
|
|
779
779
|
if (!i) {
|
|
@@ -787,13 +787,13 @@ function ze(n, e, s, t, i) {
|
|
|
787
787
|
}
|
|
788
788
|
switch (l.token) {
|
|
789
789
|
case "project":
|
|
790
|
-
return e ||
|
|
790
|
+
return e || P;
|
|
791
791
|
case "team":
|
|
792
|
-
return n.responsibleId ||
|
|
792
|
+
return n.responsibleId || P;
|
|
793
793
|
case "discipline":
|
|
794
|
-
return n.disciplineId ||
|
|
794
|
+
return n.disciplineId || P;
|
|
795
795
|
case "assetType":
|
|
796
|
-
return n.assetTypeId ||
|
|
796
|
+
return n.assetTypeId || P;
|
|
797
797
|
case "lbsZone":
|
|
798
798
|
return o;
|
|
799
799
|
case "lbsLocation":
|
|
@@ -808,7 +808,7 @@ function Ze(n, e, s, t) {
|
|
|
808
808
|
ze(o, e, i, s, t)
|
|
809
809
|
]));
|
|
810
810
|
}
|
|
811
|
-
class
|
|
811
|
+
class Pt {
|
|
812
812
|
constructor(e) {
|
|
813
813
|
this.getBep = e;
|
|
814
814
|
}
|
|
@@ -833,14 +833,14 @@ class xt {
|
|
|
833
833
|
return Ze(e.deliverables, e.project.code, e.lbs, e.deliverableNamingConvention);
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
class
|
|
836
|
+
class xt extends w {
|
|
837
837
|
constructor(e, s, t, i, o) {
|
|
838
838
|
super(
|
|
839
839
|
() => e().deliverables,
|
|
840
840
|
e,
|
|
841
841
|
{
|
|
842
842
|
key: "deliverables",
|
|
843
|
-
schema:
|
|
843
|
+
schema: xe,
|
|
844
844
|
autoId: !0
|
|
845
845
|
}
|
|
846
846
|
), this.getTeams = s, this.getAssetTypes = t, this.getLBSNodes = i, this.getMilestones = o;
|
|
@@ -874,27 +874,27 @@ class Pt extends y {
|
|
|
874
874
|
return [...d.values()];
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
class Ft extends
|
|
877
|
+
class Ft extends w {
|
|
878
878
|
constructor(e) {
|
|
879
879
|
super(
|
|
880
880
|
() => e().flags,
|
|
881
881
|
e,
|
|
882
882
|
{
|
|
883
883
|
key: "flags",
|
|
884
|
-
schema:
|
|
884
|
+
schema: Pe,
|
|
885
885
|
autoId: !0
|
|
886
886
|
}
|
|
887
887
|
);
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
class
|
|
890
|
+
class Ct extends w {
|
|
891
891
|
constructor(e, s) {
|
|
892
892
|
super(
|
|
893
893
|
() => e().notes,
|
|
894
894
|
e,
|
|
895
895
|
{
|
|
896
896
|
key: "notes",
|
|
897
|
-
schema:
|
|
897
|
+
schema: Me,
|
|
898
898
|
autoId: !0
|
|
899
899
|
}
|
|
900
900
|
), this.getMembers = s;
|
|
@@ -908,7 +908,7 @@ class Lt extends y {
|
|
|
908
908
|
}));
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
|
-
class
|
|
911
|
+
class Lt extends w {
|
|
912
912
|
constructor(e, s) {
|
|
913
913
|
super(
|
|
914
914
|
() => e().bimUses,
|
|
@@ -944,7 +944,7 @@ class Ct extends y {
|
|
|
944
944
|
}));
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
|
-
class Dt extends
|
|
947
|
+
class Dt extends w {
|
|
948
948
|
constructor(e) {
|
|
949
949
|
super(
|
|
950
950
|
() => e().disciplines,
|
|
@@ -953,21 +953,21 @@ class Dt extends y {
|
|
|
953
953
|
key: "disciplines",
|
|
954
954
|
schema: ge,
|
|
955
955
|
validate: (s, t) => {
|
|
956
|
-
const i =
|
|
956
|
+
const i = j("discipline", s.id, t.deliverableNamingConvention);
|
|
957
957
|
return i ? [i] : [];
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
);
|
|
961
961
|
}
|
|
962
962
|
}
|
|
963
|
-
class Ut extends
|
|
963
|
+
class Ut extends w {
|
|
964
964
|
constructor(e) {
|
|
965
965
|
super(
|
|
966
966
|
() => e().guides,
|
|
967
967
|
e,
|
|
968
968
|
{
|
|
969
969
|
key: "guides",
|
|
970
|
-
schema:
|
|
970
|
+
schema: $e,
|
|
971
971
|
autoId: !0
|
|
972
972
|
}
|
|
973
973
|
);
|
|
@@ -980,14 +980,14 @@ class Ut extends y {
|
|
|
980
980
|
}));
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
class zt extends
|
|
983
|
+
class zt extends w {
|
|
984
984
|
constructor(e) {
|
|
985
985
|
super(
|
|
986
986
|
() => e().lods,
|
|
987
987
|
e,
|
|
988
988
|
{
|
|
989
989
|
key: "lods",
|
|
990
|
-
schema:
|
|
990
|
+
schema: je,
|
|
991
991
|
beforeRemove: (s, t) => {
|
|
992
992
|
for (const i of t.loin)
|
|
993
993
|
if (i.milestones?.find((a) => a.lodId === s)) throw new Error(`Referenced by: loin["${i.id}"].milestones[lodId=${s}]`);
|
|
@@ -996,7 +996,7 @@ class zt extends y {
|
|
|
996
996
|
);
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
|
-
class Zt extends
|
|
999
|
+
class Zt extends w {
|
|
1000
1000
|
constructor(e) {
|
|
1001
1001
|
super(
|
|
1002
1002
|
() => e().lois,
|
|
@@ -1012,14 +1012,14 @@ class Zt extends y {
|
|
|
1012
1012
|
);
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
class Jt extends
|
|
1015
|
+
class Jt extends w {
|
|
1016
1016
|
constructor(e) {
|
|
1017
1017
|
super(
|
|
1018
1018
|
() => e().loin,
|
|
1019
1019
|
e,
|
|
1020
1020
|
{
|
|
1021
1021
|
key: "loin",
|
|
1022
|
-
schema:
|
|
1022
|
+
schema: Be,
|
|
1023
1023
|
autoId: !0,
|
|
1024
1024
|
validate: (s, t) => {
|
|
1025
1025
|
const i = [];
|
|
@@ -1116,16 +1116,16 @@ class Jt extends y {
|
|
|
1116
1116
|
}));
|
|
1117
1117
|
}
|
|
1118
1118
|
}
|
|
1119
|
-
class Kt extends
|
|
1119
|
+
class Kt extends w {
|
|
1120
1120
|
constructor(e) {
|
|
1121
1121
|
super(
|
|
1122
1122
|
() => e().assetTypes,
|
|
1123
1123
|
e,
|
|
1124
1124
|
{
|
|
1125
1125
|
key: "assetTypes",
|
|
1126
|
-
schema:
|
|
1126
|
+
schema: ye,
|
|
1127
1127
|
validate: (s, t) => {
|
|
1128
|
-
const i =
|
|
1128
|
+
const i = j("assetType", s.id, t.deliverableNamingConvention);
|
|
1129
1129
|
return i ? [i] : [];
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
@@ -1139,19 +1139,19 @@ class Kt extends y {
|
|
|
1139
1139
|
}));
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
class qt extends
|
|
1142
|
+
class qt extends w {
|
|
1143
1143
|
constructor(e) {
|
|
1144
1144
|
super(
|
|
1145
1145
|
() => e().extensions,
|
|
1146
1146
|
e,
|
|
1147
1147
|
{
|
|
1148
1148
|
key: "extensions",
|
|
1149
|
-
schema:
|
|
1149
|
+
schema: we
|
|
1150
1150
|
}
|
|
1151
1151
|
);
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
|
-
class Wt extends
|
|
1154
|
+
class Wt extends w {
|
|
1155
1155
|
constructor(e) {
|
|
1156
1156
|
super(
|
|
1157
1157
|
() => e().roles,
|
|
@@ -1174,7 +1174,7 @@ class Wt extends y {
|
|
|
1174
1174
|
);
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
class Gt extends
|
|
1177
|
+
class Gt extends w {
|
|
1178
1178
|
constructor(e) {
|
|
1179
1179
|
super(
|
|
1180
1180
|
() => e().lbs,
|
|
@@ -1183,7 +1183,7 @@ class Gt extends y {
|
|
|
1183
1183
|
key: "lbs",
|
|
1184
1184
|
schema: he,
|
|
1185
1185
|
validate: (s, t) => {
|
|
1186
|
-
const i = [], o = s.type === "zone" ? "lbsZone" : "lbsLocation", a =
|
|
1186
|
+
const i = [], o = s.type === "zone" ? "lbsZone" : "lbsLocation", a = j(o, s.id, t.deliverableNamingConvention);
|
|
1187
1187
|
if (a && i.push(a), s.type === "location" && s.lbsNodeIds?.length) {
|
|
1188
1188
|
const d = new Map(t.lbs.map((l) => [l.id, l]));
|
|
1189
1189
|
for (const l of s.lbsNodeIds ?? [])
|
|
@@ -1195,7 +1195,7 @@ class Gt extends y {
|
|
|
1195
1195
|
);
|
|
1196
1196
|
}
|
|
1197
1197
|
listResolved() {
|
|
1198
|
-
const e = this.getBep(), s =
|
|
1198
|
+
const e = this.getBep(), s = x(e.lbs), t = Q(e.lbs), i = new Map(e.lbs.map((o) => [o.id, o]));
|
|
1199
1199
|
return e.lbs.map((o) => {
|
|
1200
1200
|
const a = s.get(o.id), d = a ? i.get(a) : void 0;
|
|
1201
1201
|
return {
|
|
@@ -1244,7 +1244,7 @@ class Gt extends y {
|
|
|
1244
1244
|
i.push({ id: o.id, error: "A node cannot be its own parent." });
|
|
1245
1245
|
continue;
|
|
1246
1246
|
}
|
|
1247
|
-
const a = s.lbs.find((h) => h.id === o.id), d =
|
|
1247
|
+
const a = s.lbs.find((h) => h.id === o.id), d = x(s.lbs).get(o.id) ?? null, { parentId: l, ...c } = o, u = this.update([c]);
|
|
1248
1248
|
if (u.failed.length > 0) {
|
|
1249
1249
|
i.push({ id: o.id, error: u.failed[0].error });
|
|
1250
1250
|
continue;
|
|
@@ -1252,9 +1252,9 @@ class Gt extends y {
|
|
|
1252
1252
|
const f = { name: a.name, type: a.type, description: a.description, parentId: d }, m = s.lbs.find((h) => h.id === o.id);
|
|
1253
1253
|
if (l !== void 0) {
|
|
1254
1254
|
for (const h of s.lbs)
|
|
1255
|
-
h.lbsNodeIds?.includes(o.id) && (h.lbsNodeIds = h.lbsNodeIds.filter((
|
|
1255
|
+
h.lbsNodeIds?.includes(o.id) && (h.lbsNodeIds = h.lbsNodeIds.filter((y) => y !== o.id));
|
|
1256
1256
|
if (l) {
|
|
1257
|
-
const h = s.lbs.find((
|
|
1257
|
+
const h = s.lbs.find((y) => y.id === l);
|
|
1258
1258
|
h.lbsNodeIds ??= [], h.lbsNodeIds.push(o.id);
|
|
1259
1259
|
}
|
|
1260
1260
|
}
|
|
@@ -1262,16 +1262,16 @@ class Gt extends y {
|
|
|
1262
1262
|
if (p.length > 0) {
|
|
1263
1263
|
if (m.name = f.name, m.type = f.type, f.description !== void 0 ? m.description = f.description : delete m.description, l !== void 0) {
|
|
1264
1264
|
for (const h of s.lbs)
|
|
1265
|
-
h.lbsNodeIds?.includes(o.id) && (h.lbsNodeIds = h.lbsNodeIds.filter((
|
|
1265
|
+
h.lbsNodeIds?.includes(o.id) && (h.lbsNodeIds = h.lbsNodeIds.filter((y) => y !== o.id));
|
|
1266
1266
|
if (f.parentId) {
|
|
1267
|
-
const h = s.lbs.find((
|
|
1267
|
+
const h = s.lbs.find((y) => y.id === f.parentId);
|
|
1268
1268
|
h && (h.lbsNodeIds ??= [], h.lbsNodeIds.push(o.id));
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
1271
|
i.push({ id: o.id, error: p.join("; ") });
|
|
1272
1272
|
continue;
|
|
1273
1273
|
}
|
|
1274
|
-
const g =
|
|
1274
|
+
const g = x(s.lbs).get(m.id) ?? null;
|
|
1275
1275
|
t.push({ id: o.id, before: f, after: { name: m.name, type: m.type, description: m.description, parentId: g } });
|
|
1276
1276
|
}
|
|
1277
1277
|
return { succeeded: t, failed: i };
|
|
@@ -1282,10 +1282,10 @@ class Gt extends y {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
/** Validates the full LBS tree and returns a list of structural errors. */
|
|
1284
1284
|
validateTree() {
|
|
1285
|
-
return
|
|
1285
|
+
return Mt(this.list());
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
|
-
class Xt extends
|
|
1288
|
+
class Xt extends w {
|
|
1289
1289
|
constructor(e) {
|
|
1290
1290
|
super(
|
|
1291
1291
|
() => e().members,
|
|
@@ -1378,7 +1378,7 @@ class Xt extends y {
|
|
|
1378
1378
|
return { succeeded: s, failed: t };
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
|
-
class Vt extends
|
|
1381
|
+
class Vt extends w {
|
|
1382
1382
|
constructor(e) {
|
|
1383
1383
|
super(
|
|
1384
1384
|
() => e().milestones,
|
|
@@ -1402,7 +1402,7 @@ class Vt extends y {
|
|
|
1402
1402
|
}));
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
class Ht extends
|
|
1405
|
+
class Ht extends w {
|
|
1406
1406
|
constructor(e) {
|
|
1407
1407
|
super(
|
|
1408
1408
|
() => e().objectives,
|
|
@@ -1415,7 +1415,7 @@ class Ht extends y {
|
|
|
1415
1415
|
);
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
class Yt extends
|
|
1418
|
+
class Yt extends w {
|
|
1419
1419
|
constructor(e) {
|
|
1420
1420
|
super(
|
|
1421
1421
|
() => e().phases,
|
|
@@ -1428,27 +1428,27 @@ class Yt extends y {
|
|
|
1428
1428
|
);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
class Qt extends
|
|
1431
|
+
class Qt extends w {
|
|
1432
1432
|
constructor(e) {
|
|
1433
1433
|
super(
|
|
1434
1434
|
() => e().remoteData,
|
|
1435
1435
|
e,
|
|
1436
1436
|
{
|
|
1437
1437
|
key: "remoteData",
|
|
1438
|
-
schema:
|
|
1438
|
+
schema: Le,
|
|
1439
1439
|
autoId: !0
|
|
1440
1440
|
}
|
|
1441
1441
|
);
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
|
-
class es extends
|
|
1444
|
+
class es extends w {
|
|
1445
1445
|
constructor(e) {
|
|
1446
1446
|
super(
|
|
1447
1447
|
() => e().resolvers,
|
|
1448
1448
|
e,
|
|
1449
1449
|
{
|
|
1450
1450
|
key: "resolvers",
|
|
1451
|
-
schema:
|
|
1451
|
+
schema: Ce,
|
|
1452
1452
|
beforeRemove: (s, t) => {
|
|
1453
1453
|
const i = t.remoteData.find((o) => o.resolverId === s);
|
|
1454
1454
|
if (i) throw new Error(`Referenced by: remoteData["${i.id}"].resolverId`);
|
|
@@ -1457,7 +1457,7 @@ class es extends y {
|
|
|
1457
1457
|
);
|
|
1458
1458
|
}
|
|
1459
1459
|
}
|
|
1460
|
-
class ts extends
|
|
1460
|
+
class ts extends w {
|
|
1461
1461
|
constructor(e, s) {
|
|
1462
1462
|
super(
|
|
1463
1463
|
() => e().softwares,
|
|
@@ -1477,7 +1477,7 @@ class ts extends y {
|
|
|
1477
1477
|
}));
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
|
-
class ss extends
|
|
1480
|
+
class ss extends w {
|
|
1481
1481
|
constructor(e, s) {
|
|
1482
1482
|
super(
|
|
1483
1483
|
() => e().standards,
|
|
@@ -1529,7 +1529,7 @@ class ss extends y {
|
|
|
1529
1529
|
this.getZip().file(t.contentPath, s);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
|
-
class ns extends
|
|
1532
|
+
class ns extends w {
|
|
1533
1533
|
constructor(e, s) {
|
|
1534
1534
|
super(
|
|
1535
1535
|
() => e().teams,
|
|
@@ -1538,7 +1538,7 @@ class ns extends y {
|
|
|
1538
1538
|
key: "teams",
|
|
1539
1539
|
schema: fe,
|
|
1540
1540
|
validate: (t, i) => {
|
|
1541
|
-
const o = [], a =
|
|
1541
|
+
const o = [], a = j("team", t.id, i.deliverableNamingConvention);
|
|
1542
1542
|
return a && o.push(a), t.representativeEmail && !(t.memberEmails ?? []).includes(t.representativeEmail) && o.push(`representativeEmail "${t.representativeEmail}" is not a member of this team`), o;
|
|
1543
1543
|
},
|
|
1544
1544
|
beforeRemove: (t, i) => {
|
|
@@ -1609,14 +1609,14 @@ function is(n, e, s) {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
return t;
|
|
1611
1611
|
}
|
|
1612
|
-
class os extends
|
|
1612
|
+
class os extends w {
|
|
1613
1613
|
constructor(e, s, t) {
|
|
1614
1614
|
super(
|
|
1615
1615
|
() => e().workflows,
|
|
1616
1616
|
e,
|
|
1617
1617
|
{
|
|
1618
1618
|
key: "workflows",
|
|
1619
|
-
schema:
|
|
1619
|
+
schema: Re,
|
|
1620
1620
|
autoId: !0,
|
|
1621
1621
|
validate: (i, o) => is(i.diagram, o, i.id)
|
|
1622
1622
|
}
|
|
@@ -1745,7 +1745,7 @@ function W(n) {
|
|
|
1745
1745
|
q(n, i) && t.push(i);
|
|
1746
1746
|
return t;
|
|
1747
1747
|
}
|
|
1748
|
-
function
|
|
1748
|
+
function S(n) {
|
|
1749
1749
|
switch (typeof n) {
|
|
1750
1750
|
case "object":
|
|
1751
1751
|
return JSON.parse(JSON.stringify(n));
|
|
@@ -1767,7 +1767,7 @@ function G(n) {
|
|
|
1767
1767
|
}
|
|
1768
1768
|
return !0;
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function _(n) {
|
|
1771
1771
|
return n.indexOf("/") === -1 && n.indexOf("~") === -1 ? n : n.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1772
1772
|
}
|
|
1773
1773
|
function Je(n) {
|
|
@@ -1808,7 +1808,7 @@ var Ke = (
|
|
|
1808
1808
|
}
|
|
1809
1809
|
return e;
|
|
1810
1810
|
})(Error)
|
|
1811
|
-
), b = Ke, ds =
|
|
1811
|
+
), b = Ke, ds = S, A = {
|
|
1812
1812
|
add: function(n, e, s) {
|
|
1813
1813
|
return n[e] = this.value, { newDocument: s };
|
|
1814
1814
|
},
|
|
@@ -1821,17 +1821,17 @@ var Ke = (
|
|
|
1821
1821
|
return n[e] = this.value, { newDocument: s, removed: t };
|
|
1822
1822
|
},
|
|
1823
1823
|
move: function(n, e, s) {
|
|
1824
|
-
var t =
|
|
1825
|
-
t && (t =
|
|
1824
|
+
var t = L(s, this.path);
|
|
1825
|
+
t && (t = S(t));
|
|
1826
1826
|
var i = R(s, { op: "remove", path: this.from }).removed;
|
|
1827
1827
|
return R(s, { op: "add", path: this.path, value: i }), { newDocument: s, removed: t };
|
|
1828
1828
|
},
|
|
1829
1829
|
copy: function(n, e, s) {
|
|
1830
|
-
var t =
|
|
1831
|
-
return R(s, { op: "add", path: this.path, value:
|
|
1830
|
+
var t = L(s, this.from);
|
|
1831
|
+
return R(s, { op: "add", path: this.path, value: S(t) }), { newDocument: s };
|
|
1832
1832
|
},
|
|
1833
1833
|
test: function(n, e, s) {
|
|
1834
|
-
return { newDocument: s, test:
|
|
1834
|
+
return { newDocument: s, test: B(n[e], this.value) };
|
|
1835
1835
|
},
|
|
1836
1836
|
_get: function(n, e, s) {
|
|
1837
1837
|
return this.value = n[e], { newDocument: s };
|
|
@@ -1853,7 +1853,7 @@ var Ke = (
|
|
|
1853
1853
|
test: A.test,
|
|
1854
1854
|
_get: A._get
|
|
1855
1855
|
};
|
|
1856
|
-
function
|
|
1856
|
+
function L(n, e) {
|
|
1857
1857
|
if (e == "")
|
|
1858
1858
|
return n;
|
|
1859
1859
|
var s = { op: "_get", path: e };
|
|
@@ -1867,9 +1867,9 @@ function R(n, e, s, t, i, o) {
|
|
|
1867
1867
|
if (e.op === "replace")
|
|
1868
1868
|
return a.newDocument = e.value, a.removed = n, a;
|
|
1869
1869
|
if (e.op === "move" || e.op === "copy")
|
|
1870
|
-
return a.newDocument =
|
|
1870
|
+
return a.newDocument = L(n, e.from), e.op === "move" && (a.removed = n), a;
|
|
1871
1871
|
if (e.op === "test") {
|
|
1872
|
-
if (a.test =
|
|
1872
|
+
if (a.test = B(n, e.value), a.test === !1)
|
|
1873
1873
|
throw new b("Test operation failed", "TEST_OPERATION_FAILED", o, e, n);
|
|
1874
1874
|
return a.newDocument = n, a;
|
|
1875
1875
|
} else {
|
|
@@ -1882,7 +1882,7 @@ function R(n, e, s, t, i, o) {
|
|
|
1882
1882
|
return a;
|
|
1883
1883
|
}
|
|
1884
1884
|
} else {
|
|
1885
|
-
t || (n =
|
|
1885
|
+
t || (n = S(n));
|
|
1886
1886
|
var d = e.path || "", l = d.split("/"), c = n, u = 1, f = l.length, m = void 0, p = void 0, g = void 0;
|
|
1887
1887
|
for (typeof s == "function" ? g = s : g = D; ; ) {
|
|
1888
1888
|
if (p = l[u], p && p.indexOf("~") != -1 && (p = Je(p)), i && (p == "__proto__" || p == "prototype" && u > 0 && l[u - 1] == "constructor"))
|
|
@@ -1917,7 +1917,7 @@ function R(n, e, s, t, i, o) {
|
|
|
1917
1917
|
function U(n, e, s, t, i) {
|
|
1918
1918
|
if (t === void 0 && (t = !0), i === void 0 && (i = !0), s && !Array.isArray(e))
|
|
1919
1919
|
throw new b("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
|
|
1920
|
-
t || (n =
|
|
1920
|
+
t || (n = S(n));
|
|
1921
1921
|
for (var o = new Array(e.length), a = 0, d = e.length; a < d; a++)
|
|
1922
1922
|
o[a] = R(n, e[a], s, !0, i, a), n = o[a].newDocument;
|
|
1923
1923
|
return o.newDocument = n, o;
|
|
@@ -1963,7 +1963,7 @@ function qe(n, e, s) {
|
|
|
1963
1963
|
if (!Array.isArray(n))
|
|
1964
1964
|
throw new b("Patch sequence must be an array", "SEQUENCE_NOT_AN_ARRAY");
|
|
1965
1965
|
if (e)
|
|
1966
|
-
U(
|
|
1966
|
+
U(S(e), S(n), s || !0);
|
|
1967
1967
|
else {
|
|
1968
1968
|
s = s || D;
|
|
1969
1969
|
for (var t = 0; t < n.length; t++)
|
|
@@ -1975,7 +1975,7 @@ function qe(n, e, s) {
|
|
|
1975
1975
|
throw i;
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function B(n, e) {
|
|
1979
1979
|
if (n === e)
|
|
1980
1980
|
return !0;
|
|
1981
1981
|
if (n && e && typeof n == "object" && typeof e == "object") {
|
|
@@ -1984,7 +1984,7 @@ function M(n, e) {
|
|
|
1984
1984
|
if (o = n.length, o != e.length)
|
|
1985
1985
|
return !1;
|
|
1986
1986
|
for (i = o; i-- !== 0; )
|
|
1987
|
-
if (!
|
|
1987
|
+
if (!B(n[i], e[i]))
|
|
1988
1988
|
return !1;
|
|
1989
1989
|
return !0;
|
|
1990
1990
|
}
|
|
@@ -1997,7 +1997,7 @@ function M(n, e) {
|
|
|
1997
1997
|
if (!e.hasOwnProperty(d[i]))
|
|
1998
1998
|
return !1;
|
|
1999
1999
|
for (i = o; i-- !== 0; )
|
|
2000
|
-
if (a = d[i], !
|
|
2000
|
+
if (a = d[i], !B(n[a], e[a]))
|
|
2001
2001
|
return !1;
|
|
2002
2002
|
return !0;
|
|
2003
2003
|
}
|
|
@@ -2006,12 +2006,12 @@ function M(n, e) {
|
|
|
2006
2006
|
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2007
2007
|
__proto__: null,
|
|
2008
2008
|
JsonPatchError: b,
|
|
2009
|
-
_areEquals:
|
|
2009
|
+
_areEquals: B,
|
|
2010
2010
|
applyOperation: R,
|
|
2011
2011
|
applyPatch: U,
|
|
2012
2012
|
applyReducer: cs,
|
|
2013
2013
|
deepClone: ds,
|
|
2014
|
-
getValueByPointer:
|
|
2014
|
+
getValueByPointer: L,
|
|
2015
2015
|
validate: qe,
|
|
2016
2016
|
validator: D
|
|
2017
2017
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -2041,10 +2041,10 @@ function hs(n, e) {
|
|
|
2041
2041
|
function gs(n, e) {
|
|
2042
2042
|
n.observers.delete(e.callback);
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function ws(n, e) {
|
|
2045
2045
|
e.unobserve();
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2047
|
+
function ys(n, e) {
|
|
2048
2048
|
var s = [], t, i = ps(n);
|
|
2049
2049
|
if (!i)
|
|
2050
2050
|
i = new us(n), ee.set(n, i);
|
|
@@ -2054,7 +2054,7 @@ function ws(n, e) {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
if (t)
|
|
2056
2056
|
return t;
|
|
2057
|
-
if (t = {}, i.value =
|
|
2057
|
+
if (t = {}, i.value = S(n), e) {
|
|
2058
2058
|
t.callback = e, t.next = null;
|
|
2059
2059
|
var a = function() {
|
|
2060
2060
|
V(t);
|
|
@@ -2081,13 +2081,13 @@ function te(n, e, s, t, i) {
|
|
|
2081
2081
|
var c = a[l], u = n[c];
|
|
2082
2082
|
if (q(e, c) && !(e[c] === void 0 && u !== void 0 && Array.isArray(e) === !1)) {
|
|
2083
2083
|
var f = e[c];
|
|
2084
|
-
typeof u == "object" && u != null && typeof f == "object" && f != null && Array.isArray(u) === Array.isArray(f) ? te(u, f, s, t + "/" +
|
|
2085
|
-
} else Array.isArray(n) === Array.isArray(e) ? (i && s.push({ op: "test", path: t + "/" +
|
|
2084
|
+
typeof u == "object" && u != null && typeof f == "object" && f != null && Array.isArray(u) === Array.isArray(f) ? te(u, f, s, t + "/" + _(c), i) : u !== f && (i && s.push({ op: "test", path: t + "/" + _(c), value: S(u) }), s.push({ op: "replace", path: t + "/" + _(c), value: S(f) }));
|
|
2085
|
+
} else Array.isArray(n) === Array.isArray(e) ? (i && s.push({ op: "test", path: t + "/" + _(c), value: S(u) }), s.push({ op: "remove", path: t + "/" + _(c) }), d = !0) : (i && s.push({ op: "test", path: t, value: n }), s.push({ op: "replace", path: t, value: e }));
|
|
2086
2086
|
}
|
|
2087
2087
|
if (!(!d && o.length == a.length))
|
|
2088
2088
|
for (var l = 0; l < o.length; l++) {
|
|
2089
2089
|
var c = o[l];
|
|
2090
|
-
!q(n, c) && e[c] !== void 0 && s.push({ op: "add", path: t + "/" +
|
|
2090
|
+
!q(n, c) && e[c] !== void 0 && s.push({ op: "add", path: t + "/" + _(c), value: S(e[c]) });
|
|
2091
2091
|
}
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
@@ -2100,13 +2100,13 @@ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2100
2100
|
__proto__: null,
|
|
2101
2101
|
compare: H,
|
|
2102
2102
|
generate: V,
|
|
2103
|
-
observe:
|
|
2104
|
-
unobserve:
|
|
2103
|
+
observe: ys,
|
|
2104
|
+
unobserve: ws
|
|
2105
2105
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2106
2106
|
Object.assign({}, fs, vs, {
|
|
2107
2107
|
JsonPatchError: Ke,
|
|
2108
|
-
deepClone:
|
|
2109
|
-
escapePathComponent:
|
|
2108
|
+
deepClone: S,
|
|
2109
|
+
escapePathComponent: _,
|
|
2110
2110
|
unescapePathComponent: Je
|
|
2111
2111
|
});
|
|
2112
2112
|
function v(n, e, s) {
|
|
@@ -2165,7 +2165,7 @@ function Es(n, e) {
|
|
|
2165
2165
|
const i = [...s ? ["project"] : [], ...Object.keys(t)];
|
|
2166
2166
|
return { project: s, sections: t, changedKeys: i };
|
|
2167
2167
|
}
|
|
2168
|
-
class
|
|
2168
|
+
class I {
|
|
2169
2169
|
constructor(e, s, t) {
|
|
2170
2170
|
this.getBep = e, this.setBep = s, this.getZip = t;
|
|
2171
2171
|
}
|
|
@@ -2178,7 +2178,7 @@ class E {
|
|
|
2178
2178
|
return { major: s, minor: t };
|
|
2179
2179
|
}
|
|
2180
2180
|
static compareVersions(e, s) {
|
|
2181
|
-
const t =
|
|
2181
|
+
const t = I.parseVersion(e), i = I.parseVersion(s);
|
|
2182
2182
|
return t.major !== i.major ? t.major - i.major : t.minor - i.minor;
|
|
2183
2183
|
}
|
|
2184
2184
|
static bumpVersion(e, s) {
|
|
@@ -2192,7 +2192,7 @@ class E {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
async readBaseline() {
|
|
2194
2194
|
const e = this.getZip().file("baseline/bep.json");
|
|
2195
|
-
return e ?
|
|
2195
|
+
return e ? $(JSON.parse(await e.async("string"))) : null;
|
|
2196
2196
|
}
|
|
2197
2197
|
// ─── Standards versioning helpers ─────────────────────────────────────────
|
|
2198
2198
|
/**
|
|
@@ -2207,7 +2207,7 @@ class E {
|
|
|
2207
2207
|
const a = await o.async("string"), d = `changelog/standards/${i.id}/`, l = Object.keys(t.files).filter((u) => u.startsWith(d) && u.endsWith(".md") && u.slice(d.length).startsWith("v")).map((u) => u.slice(d.length + 1, -3));
|
|
2208
2208
|
let c = null;
|
|
2209
2209
|
if (l.length > 0) {
|
|
2210
|
-
const u = l.sort((m, p) =>
|
|
2210
|
+
const u = l.sort((m, p) => I.compareVersions(p, m))[0], f = t.file(`${d}v${u}.md`);
|
|
2211
2211
|
f && (c = await f.async("string"));
|
|
2212
2212
|
}
|
|
2213
2213
|
c !== a && t.file(`${d}v${s}.md`, a);
|
|
@@ -2232,7 +2232,7 @@ class E {
|
|
|
2232
2232
|
* Falls back to the current file if no snapshot exists (content never changed).
|
|
2233
2233
|
*/
|
|
2234
2234
|
async resolveStandardContent(e, s) {
|
|
2235
|
-
const t = this.getZip(), i = `changelog/standards/${e.id}/`, o = Object.keys(t.files).filter((d) => d.startsWith(i) && d.endsWith(".md") && d.slice(i.length).startsWith("v")).map((d) => d.slice(i.length + 1, -3)).filter((d) =>
|
|
2235
|
+
const t = this.getZip(), i = `changelog/standards/${e.id}/`, o = Object.keys(t.files).filter((d) => d.startsWith(i) && d.endsWith(".md") && d.slice(i.length).startsWith("v")).map((d) => d.slice(i.length + 1, -3)).filter((d) => I.compareVersions(d, s) <= 0).sort((d, l) => I.compareVersions(l, d));
|
|
2236
2236
|
if (o.length === 0) {
|
|
2237
2237
|
const d = t.file(e.contentPath);
|
|
2238
2238
|
return d ? d.async("string") : null;
|
|
@@ -2251,12 +2251,12 @@ class E {
|
|
|
2251
2251
|
const t = this.getZip(), i = this.getBep(), o = await this.readChangelog(), a = await this.readBaseline(), d = (/* @__PURE__ */ new Date()).toISOString();
|
|
2252
2252
|
if (!a) throw new Error("No baseline found — create a BEP with Bep.create() or open one with Bep.open()");
|
|
2253
2253
|
if (e.type === "version") {
|
|
2254
|
-
const g = e.approvedBy.filter((h) => !i.members.some((
|
|
2254
|
+
const g = e.approvedBy.filter((h) => !i.members.some((y) => y.email === h));
|
|
2255
2255
|
if (g.length) throw new Error(`Members not found: ${g.join(", ")}`);
|
|
2256
2256
|
}
|
|
2257
2257
|
if (!s && !await this.hasPendingChanges())
|
|
2258
2258
|
throw new Error("No pending changes since last commit");
|
|
2259
|
-
const l = o?.current ?? "0.0", c =
|
|
2259
|
+
const l = o?.current ?? "0.0", c = I.bumpVersion(l, e.type), u = `changelog/v${c}.diff.json`, f = H(i, a), m = e.type === "patch" ? { version: c, type: "patch", date: d, author: e.author, description: e.description, diff: u } : { version: c, type: "version", date: d, author: e.author, description: e.description, approvedBy: e.approvedBy, diff: u }, p = {
|
|
2260
2260
|
current: c,
|
|
2261
2261
|
versions: [...o?.versions ?? [], m]
|
|
2262
2262
|
};
|
|
@@ -2275,14 +2275,14 @@ class E {
|
|
|
2275
2275
|
if (t === -1) {
|
|
2276
2276
|
const a = this.getZip().file(`changelog/v${e}.json`);
|
|
2277
2277
|
if (!a) throw new Error(`Version not found: ${e}`);
|
|
2278
|
-
return
|
|
2278
|
+
return $(JSON.parse(await a.async("string")));
|
|
2279
2279
|
}
|
|
2280
2280
|
if (s.versions[t].diff === null) {
|
|
2281
2281
|
const a = this.getZip().file(`changelog/v${e}.json`);
|
|
2282
2282
|
if (!a) throw new Error(`Missing terminus: changelog/v${e}.json`);
|
|
2283
|
-
return
|
|
2283
|
+
return $(JSON.parse(await a.async("string")));
|
|
2284
2284
|
}
|
|
2285
|
-
const i = s.versions.filter((a) =>
|
|
2285
|
+
const i = s.versions.filter((a) => I.compareVersions(a.version, e) > 0).sort((a, d) => I.compareVersions(d.version, a.version)), o = JSON.parse(JSON.stringify(this.getBep()));
|
|
2286
2286
|
for (const a of i) {
|
|
2287
2287
|
if (!a.diff) break;
|
|
2288
2288
|
const d = this.getZip().file(a.diff);
|
|
@@ -2290,7 +2290,7 @@ class E {
|
|
|
2290
2290
|
const l = JSON.parse(await d.async("string"));
|
|
2291
2291
|
U(o, l);
|
|
2292
2292
|
}
|
|
2293
|
-
return
|
|
2293
|
+
return $(o);
|
|
2294
2294
|
}
|
|
2295
2295
|
/** Returns the RFC 6902 diff and standards summary between two versions. */
|
|
2296
2296
|
async compare(e, s) {
|
|
@@ -2298,12 +2298,12 @@ class E {
|
|
|
2298
2298
|
this.get(e),
|
|
2299
2299
|
this.get(s),
|
|
2300
2300
|
this.readChangelog()
|
|
2301
|
-
]), a = H(t, i), d = new Set(t.standards.map((h) => h.id)), l = new Set(i.standards.map((h) => h.id)), c = i.standards.filter((h) => !d.has(h.id)).map((h) => ({ id: h.id, name: h.name })), u = t.standards.filter((h) => !l.has(h.id)).map((h) => ({ id: h.id, name: h.name })), m = (o?.versions ?? []).filter((h) =>
|
|
2301
|
+
]), a = H(t, i), d = new Set(t.standards.map((h) => h.id)), l = new Set(i.standards.map((h) => h.id)), c = i.standards.filter((h) => !d.has(h.id)).map((h) => ({ id: h.id, name: h.name })), u = t.standards.filter((h) => !l.has(h.id)).map((h) => ({ id: h.id, name: h.name })), m = (o?.versions ?? []).filter((h) => I.compareVersions(h.version, e) > 0 && I.compareVersions(h.version, s) <= 0).map((h) => h.version), p = this.getZip(), g = (await Promise.all(
|
|
2302
2302
|
i.standards.filter((h) => d.has(h.id)).map(async (h) => {
|
|
2303
|
-
const
|
|
2304
|
-
m.map(async (
|
|
2305
|
-
)).filter((
|
|
2306
|
-
return
|
|
2303
|
+
const y = (await Promise.all(
|
|
2304
|
+
m.map(async (N) => p.file(`changelog/standards/${h.id}/v${N}.md`) !== null ? N : null)
|
|
2305
|
+
)).filter((N) => N !== null);
|
|
2306
|
+
return y.length > 0 ? { id: h.id, name: h.name, changedIn: y } : null;
|
|
2307
2307
|
})
|
|
2308
2308
|
)).filter((h) => h !== null);
|
|
2309
2309
|
return { diff: a, standards: { added: c, removed: u, contentModified: g } };
|
|
@@ -2364,7 +2364,7 @@ class E {
|
|
|
2364
2364
|
/** Returns all versions sorted ascending, with author/approvedBy resolved to { email, name } objects. */
|
|
2365
2365
|
async listResolved() {
|
|
2366
2366
|
const [e, s] = await Promise.all([this.list(), this.current()]), t = this.getBep().members;
|
|
2367
|
-
return e.sort((i, o) =>
|
|
2367
|
+
return e.sort((i, o) => I.compareVersions(i.version, o.version)).map((i) => ({
|
|
2368
2368
|
version: i.version,
|
|
2369
2369
|
type: i.type,
|
|
2370
2370
|
date: i.date,
|
|
@@ -2400,7 +2400,7 @@ class E {
|
|
|
2400
2400
|
throw new Error(`Version not found: ${e}`);
|
|
2401
2401
|
if (e === t.current)
|
|
2402
2402
|
throw new Error(`Already at version ${e}`);
|
|
2403
|
-
const a = t.versions.filter((c) =>
|
|
2403
|
+
const a = t.versions.filter((c) => I.compareVersions(c.version, e) > 0), d = await this.get(e);
|
|
2404
2404
|
for (const c of d.standards) {
|
|
2405
2405
|
const u = await this.resolveStandardContent(c, e);
|
|
2406
2406
|
u !== null && s.file(c.contentPath, u);
|
|
@@ -2411,7 +2411,7 @@ class E {
|
|
|
2411
2411
|
const l = JSON.stringify(d, null, 2);
|
|
2412
2412
|
s.file("changelog.json", JSON.stringify({
|
|
2413
2413
|
current: e,
|
|
2414
|
-
versions: t.versions.filter((c) =>
|
|
2414
|
+
versions: t.versions.filter((c) => I.compareVersions(c.version, e) <= 0)
|
|
2415
2415
|
}, null, 2)), s.file("bep.json", l), s.file("baseline/bep.json", l), this.setBep(d);
|
|
2416
2416
|
}
|
|
2417
2417
|
/**
|
|
@@ -2424,7 +2424,7 @@ class E {
|
|
|
2424
2424
|
if (!t) throw new Error("No changelog found");
|
|
2425
2425
|
if (!/^\d+\.0$/.test(e.newBase))
|
|
2426
2426
|
throw new Error(`newBase must be in X.0 format (e.g. "2.0"), got "${e.newBase}"`);
|
|
2427
|
-
if (
|
|
2427
|
+
if (I.compareVersions(e.newBase, t.current) <= 0)
|
|
2428
2428
|
throw new Error(`newBase "${e.newBase}" must be greater than current version "${t.current}"`);
|
|
2429
2429
|
const i = this.getBep(), o = e.approvedBy.filter((d) => !i.members.some((l) => l.email === d));
|
|
2430
2430
|
if (o.length) throw new Error(`Members not found: ${o.join(", ")}`);
|
|
@@ -2493,13 +2493,13 @@ function ks(n, e, s, t) {
|
|
|
2493
2493
|
if (!a && !d) return !0;
|
|
2494
2494
|
const c = n.members.find((m) => m.email === t)?.roleId, u = new Set(n.teams.filter((m) => (m.memberEmails ?? []).includes(t)).map((m) => m.id)), f = (m, p, g) => {
|
|
2495
2495
|
if (g?.includes(t)) return !0;
|
|
2496
|
-
const h = !!m?.length,
|
|
2497
|
-
return
|
|
2496
|
+
const h = !!m?.length, y = !!p?.length;
|
|
2497
|
+
return y && h ? !!c && m.includes(c) && p.some((N) => u.has(N)) : y ? p.some((N) => u.has(N)) : h ? !!c && m.includes(c) : !1;
|
|
2498
2498
|
};
|
|
2499
2499
|
return a && f(o.responsibleRoleIds, o.responsibleTeamIds, o.responsibleEmails) || d && f(o.accountableRoleIds, o.accountableTeamIds, o.accountableEmails);
|
|
2500
2500
|
}
|
|
2501
2501
|
const _s = { string: "string", number: "number", boolean: "boolean" };
|
|
2502
|
-
function
|
|
2502
|
+
function Rs(n, e, s) {
|
|
2503
2503
|
const t = n.events.find((d) => d.id === e);
|
|
2504
2504
|
if (!t?.payload?.length) return [];
|
|
2505
2505
|
const i = [], o = s ?? {};
|
|
@@ -2523,10 +2523,10 @@ function $s(n, e, s) {
|
|
|
2523
2523
|
a.has(d) || i.push({ field: d, reason: "unknown_field" });
|
|
2524
2524
|
return i;
|
|
2525
2525
|
}
|
|
2526
|
-
function
|
|
2526
|
+
function Ts(n, e) {
|
|
2527
2527
|
return !(!("triggerEventId" in n) || n.triggerEventId !== e.eventId);
|
|
2528
2528
|
}
|
|
2529
|
-
function
|
|
2529
|
+
function $s(n, e, s, t, i) {
|
|
2530
2530
|
const o = n.workflows.find((f) => f.id === e);
|
|
2531
2531
|
if (!o) return null;
|
|
2532
2532
|
const a = Object.keys(o.diagram.nodes).find(
|
|
@@ -2555,37 +2555,37 @@ function J(n, e, s, t) {
|
|
|
2555
2555
|
return { ok: !1, error: "INSTANCE_NOT_ACTIVE" };
|
|
2556
2556
|
if (!t?.skipRaci && !ks(n, e.currentNodeId, e.workflowId, s.actor))
|
|
2557
2557
|
return { ok: !1, error: "UNAUTHORIZED" };
|
|
2558
|
-
const i = n.workflows.find((
|
|
2558
|
+
const i = n.workflows.find((E) => E.id === e.workflowId);
|
|
2559
2559
|
if (!i) return { ok: !1, error: "NO_MATCHING_EDGE" };
|
|
2560
2560
|
const { nodes: o, edges: a } = i.diagram;
|
|
2561
2561
|
let d = e.currentNodeId;
|
|
2562
2562
|
const l = [], c = [], u = [], f = Object.entries(a).filter(
|
|
2563
|
-
([,
|
|
2563
|
+
([, E]) => E.from === d && Ts(E, s)
|
|
2564
2564
|
);
|
|
2565
2565
|
if (f.length === 0) return { ok: !1, error: "NO_MATCHING_EDGE" };
|
|
2566
2566
|
if (f.length > 1) return { ok: !1, error: "AMBIGUOUS_TRANSITION" };
|
|
2567
2567
|
const [m, p] = f[0];
|
|
2568
2568
|
if ("triggerEventId" in p) {
|
|
2569
|
-
const
|
|
2570
|
-
if (
|
|
2569
|
+
const E = Rs(n, p.triggerEventId, s.payload);
|
|
2570
|
+
if (E.length > 0) return { ok: !1, error: "INVALID_PAYLOAD", payloadErrors: E };
|
|
2571
2571
|
}
|
|
2572
|
-
l.push(re(m, d, p.to, s)), c.push(...(p.effectIds ?? []).map((
|
|
2572
|
+
l.push(re(m, d, p.to, s)), c.push(...(p.effectIds ?? []).map((E) => ({ effectId: E, fromEdgeId: m, triggerPayload: s.payload ?? {} }))), u.push({ edgeId: m, fromNodeId: d, toNodeId: p.to }), d = p.to;
|
|
2573
2573
|
let g = 0;
|
|
2574
2574
|
for (; o[d]?.type === "decision"; ) {
|
|
2575
2575
|
if (++g > Ss) return { ok: !1, error: "DECISION_LOOP" };
|
|
2576
|
-
const
|
|
2577
|
-
if (
|
|
2578
|
-
const [
|
|
2579
|
-
l.push(re(
|
|
2576
|
+
const E = Object.entries(a).filter(([, O]) => O.from !== d || !("guard" in O) ? !1 : Ns(O.guard, s.payload ?? {}));
|
|
2577
|
+
if (E.length === 0) break;
|
|
2578
|
+
const [k, T] = E[0];
|
|
2579
|
+
l.push(re(k, d, T.to, s, !0)), c.push(...(T.effectIds ?? []).map((O) => ({ effectId: O, fromEdgeId: k, triggerPayload: s.payload ?? {} }))), u.push({ edgeId: k, fromNodeId: d, toNodeId: T.to }), d = T.to;
|
|
2580
2580
|
}
|
|
2581
|
-
const h = o[d],
|
|
2581
|
+
const h = o[d], y = h?.type === "end" ? "completed" : "active", N = {
|
|
2582
2582
|
...e,
|
|
2583
2583
|
currentNodeId: d,
|
|
2584
|
-
status:
|
|
2584
|
+
status: y,
|
|
2585
2585
|
history: [...e.history, ...l],
|
|
2586
2586
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2587
|
-
},
|
|
2588
|
-
return { ok: !0, instance:
|
|
2587
|
+
}, M = h?.type === "automation" && h.automationId ? { nodeId: d, automationId: h.automationId, triggerPayload: s.payload ?? {} } : void 0;
|
|
2588
|
+
return { ok: !0, instance: N, transitionsApplied: u, effectsToFire: c, automationNodePending: M };
|
|
2589
2589
|
}
|
|
2590
2590
|
function As(n, e) {
|
|
2591
2591
|
const s = n.workflows.find((m) => m.id === e.workflowId), { nodes: t, edges: i } = s.diagram, o = t[e.currentNodeId], a = (m) => (m ?? []).flatMap((p) => {
|
|
@@ -2643,7 +2643,7 @@ function re(n, e, s, t, i) {
|
|
|
2643
2643
|
...i ? { auto: !0 } : {}
|
|
2644
2644
|
};
|
|
2645
2645
|
}
|
|
2646
|
-
class
|
|
2646
|
+
class js {
|
|
2647
2647
|
instances = /* @__PURE__ */ new Map();
|
|
2648
2648
|
async listInstances(e) {
|
|
2649
2649
|
let s = [...this.instances.values()];
|
|
@@ -2714,7 +2714,7 @@ class Os {
|
|
|
2714
2714
|
* Returns `this` for chaining.
|
|
2715
2715
|
*/
|
|
2716
2716
|
init(e) {
|
|
2717
|
-
return this._runtime = e.runtime, this.storage = e.storage ?? new
|
|
2717
|
+
return this._runtime = e.runtime, this.storage = e.storage ?? new js(), this.skipRaci = e.events?.skipRaci ?? !1, e.runtime._engine = this, this;
|
|
2718
2718
|
}
|
|
2719
2719
|
// ─── Remote data ──────────────────────────────────────────────────────────
|
|
2720
2720
|
async getRemoteData(e) {
|
|
@@ -2727,29 +2727,36 @@ class Os {
|
|
|
2727
2727
|
// ─── Private workflow instance operations ─────────────────────────────────
|
|
2728
2728
|
async _create(e, s, t) {
|
|
2729
2729
|
this._assertInit();
|
|
2730
|
-
|
|
2731
|
-
if (
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
await
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
const
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2730
|
+
let i;
|
|
2731
|
+
if ("rawPayload" in s) {
|
|
2732
|
+
const y = this._runtime.triggers[e];
|
|
2733
|
+
if (!y) throw new Error(`No trigger handler declared for workflow "${e}"`);
|
|
2734
|
+
i = await y(s.rawPayload), t = "dotBEP";
|
|
2735
|
+
} else
|
|
2736
|
+
i = s;
|
|
2737
|
+
const o = this.getBep(), d = $s(o, e, i, t, "unversioned");
|
|
2738
|
+
if (!d) return null;
|
|
2739
|
+
const { instance: l, startEffects: c } = d;
|
|
2740
|
+
for (const y of c)
|
|
2741
|
+
await this._executeEffect(l, y);
|
|
2742
|
+
const f = o.workflows.find((y) => y.id === e)?.diagram.nodes[l.currentNodeId];
|
|
2743
|
+
let m = f?.type === "automation" && f.automationId ? { automationId: f.automationId, triggerPayload: {} } : void 0, p = l;
|
|
2744
|
+
const g = 10;
|
|
2745
|
+
let h = 0;
|
|
2746
|
+
for (; m && h++ < g; ) {
|
|
2747
|
+
const { automationId: y, triggerPayload: N } = m, { eventId: M, ...E } = await this._executeAutomationNode(p, y, N), k = J(o, p, {
|
|
2748
|
+
eventId: M,
|
|
2749
|
+
actor: "dotBEP",
|
|
2750
|
+
softwareId: "dotBEP",
|
|
2751
|
+
payload: E
|
|
2745
2752
|
});
|
|
2746
|
-
if (!
|
|
2747
|
-
|
|
2748
|
-
for (const
|
|
2749
|
-
await this._executeEffect(
|
|
2750
|
-
|
|
2753
|
+
if (!k.ok) break;
|
|
2754
|
+
p = k.instance;
|
|
2755
|
+
for (const T of k.effectsToFire ?? [])
|
|
2756
|
+
await this._executeEffect(p, T);
|
|
2757
|
+
m = k.automationNodePending;
|
|
2751
2758
|
}
|
|
2752
|
-
return await this.storage.saveInstance(
|
|
2759
|
+
return await this.storage.saveInstance(p), await this._fire(this._createdListeners, p), p;
|
|
2753
2760
|
}
|
|
2754
2761
|
async _emit(e, s) {
|
|
2755
2762
|
this._assertInit();
|
|
@@ -2768,8 +2775,8 @@ class Os {
|
|
|
2768
2775
|
const { automationId: f, triggerPayload: m } = o.automationNodePending, { eventId: p, ...g } = await this._executeAutomationNode(l, f, m);
|
|
2769
2776
|
if (o = J(i, l, {
|
|
2770
2777
|
eventId: p,
|
|
2771
|
-
actor: "
|
|
2772
|
-
softwareId: "
|
|
2778
|
+
actor: "dotBEP",
|
|
2779
|
+
softwareId: "dotBEP",
|
|
2773
2780
|
payload: g
|
|
2774
2781
|
}), !o.ok) break;
|
|
2775
2782
|
l = o.instance, a.push(...o.transitionsApplied ?? []);
|
|
@@ -2870,7 +2877,7 @@ class Os {
|
|
|
2870
2877
|
}
|
|
2871
2878
|
}
|
|
2872
2879
|
}
|
|
2873
|
-
function
|
|
2880
|
+
function Cs(n, e) {
|
|
2874
2881
|
const s = /* @__PURE__ */ new Map();
|
|
2875
2882
|
for (const t of n) {
|
|
2876
2883
|
const i = [e(t)].flat();
|
|
@@ -2879,50 +2886,12 @@ function Ls(n, e) {
|
|
|
2879
2886
|
}
|
|
2880
2887
|
return Array.from(s.entries()).map(([t, i]) => ({ key: t, rows: i }));
|
|
2881
2888
|
}
|
|
2882
|
-
|
|
2883
|
-
const { topologicalSort: t = !1 } = s, i = (m) => `_${m}`, o = "#444444", a = Object.entries(n.nodes), d = a.find(([, m]) => m.type === "start")?.[0], l = a.find(([, m]) => m.type === "end")?.[0];
|
|
2884
|
-
let c;
|
|
2885
|
-
if (t && d) {
|
|
2886
|
-
const m = /* @__PURE__ */ new Set(), p = [d], g = [];
|
|
2887
|
-
for (; p.length; ) {
|
|
2888
|
-
const h = p.shift();
|
|
2889
|
-
if (!m.has(h)) {
|
|
2890
|
-
m.add(h), g.push(h);
|
|
2891
|
-
for (const w of Object.values(n.edges))
|
|
2892
|
-
w.from === h && !m.has(w.to) && p.push(w.to);
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
for (const [h] of a)
|
|
2896
|
-
m.has(h) || g.push(h);
|
|
2897
|
-
c = g;
|
|
2898
|
-
} else {
|
|
2899
|
-
const m = a.map(([p]) => p).filter((p) => p !== d && p !== l);
|
|
2900
|
-
c = [
|
|
2901
|
-
...d ? [d] : [],
|
|
2902
|
-
...m,
|
|
2903
|
-
...l ? [l] : []
|
|
2904
|
-
];
|
|
2905
|
-
}
|
|
2906
|
-
const u = [`flowchart ${n.direction}`];
|
|
2907
|
-
for (const m of c) {
|
|
2908
|
-
const p = n.nodes[m];
|
|
2909
|
-
if (!p) continue;
|
|
2910
|
-
const g = p.type === "start" || p.type === "end", w = (p.type === "decision" ? p.label ?? m : p.action?.name ?? p.automation?.name ?? "").replace(/"/g, """), S = g || p.type === "decision" ? [] : p[e].roles.map((_) => _.name), k = S.length > 0 ? `"<b>${S.join(" · ")}</b><br/>${w}"` : `"${w || m}"`;
|
|
2911
|
-
g ? u.push(` ${i(m)}([${w || p.type.toUpperCase()}])`) : p.type === "decision" ? u.push(` ${i(m)}{${k}}`) : p.type === "automation" ? u.push(` ${i(m)}[[${k}]]`) : u.push(` ${i(m)}(${k})`);
|
|
2912
|
-
const I = p[e].roles[0]?.color ?? o;
|
|
2913
|
-
g ? u.push(` style ${i(m)} fill:#2962FF,stroke:none`) : u.push(` style ${i(m)} fill:none,stroke:${I},stroke-width:3px`);
|
|
2914
|
-
}
|
|
2915
|
-
const f = t ? c.flatMap((m) => Object.values(n.edges).filter((p) => p.from === m)) : Object.values(n.edges);
|
|
2916
|
-
for (const m of f)
|
|
2917
|
-
m.label ? u.push(` ${i(m.from)} -->|${m.label}| ${i(m.to)}`) : u.push(` ${i(m.from)} --> ${i(m.to)}`);
|
|
2918
|
-
return u.join(`
|
|
2919
|
-
`);
|
|
2920
|
-
}
|
|
2921
|
-
class Ds {
|
|
2889
|
+
class Ls {
|
|
2922
2890
|
env;
|
|
2923
2891
|
effects = {};
|
|
2924
2892
|
automations = {};
|
|
2925
2893
|
resolvers = {};
|
|
2894
|
+
triggers = {};
|
|
2926
2895
|
/** Set by Engine.init() — available inside handlers via this.engine */
|
|
2927
2896
|
_engine = null;
|
|
2928
2897
|
get engine() {
|
|
@@ -2941,6 +2910,9 @@ class Ds {
|
|
|
2941
2910
|
resolver(e, s) {
|
|
2942
2911
|
return this.resolvers[e] = s, this;
|
|
2943
2912
|
}
|
|
2913
|
+
trigger(e, s) {
|
|
2914
|
+
return this.triggers[e] = s, this;
|
|
2915
|
+
}
|
|
2944
2916
|
/** @internal Called by Engine.getRemoteData — keeps env encapsulated inside the Runtime. */
|
|
2945
2917
|
_runResolver(e, s) {
|
|
2946
2918
|
const t = this.resolvers[e];
|
|
@@ -2959,20 +2931,20 @@ class F {
|
|
|
2959
2931
|
},
|
|
2960
2932
|
de,
|
|
2961
2933
|
(i, o) => {
|
|
2962
|
-
const a = [], d =
|
|
2934
|
+
const a = [], d = j("project", i.code, o.deliverableNamingConvention);
|
|
2963
2935
|
return d && a.push(d), i.clientId && !o.teams.some((l) => l.id === i.clientId) && a.push(`teams["${i.clientId}"] not found`), a;
|
|
2964
2936
|
},
|
|
2965
2937
|
t
|
|
2966
|
-
), this.actions = new
|
|
2938
|
+
), this.actions = new Tt(t), this.annexes = new $t(t), this.env = new Ot(t), this.events = new Bt(t), this.effects = new At(t), this.automations = new jt(t), this.bimUses = new Lt(t, () => this.workflows), this.disciplines = new Dt(t), this.guides = new Ut(t), this.lods = new zt(t), this.lois = new Zt(t), this.loin = new Jt(t), this.lbsNodes = new Gt(t), this.assetTypes = new Kt(t), this.extensions = new qt(t), this.roles = new Wt(t), this.members = new Xt(t), this.milestones = new Vt(t), this.objectives = new Ht(t), this.phases = new Yt(t), this.remoteData = new Qt(t), this.resolvers = new es(t), this.softwares = new ts(t, () => this.assetTypes), this.standards = new ss(t, () => this._zip), this.teams = new ns(t, () => this.members), this.workflows = new os(t, () => this.members, () => this.teams), this.deliverables = new xt(t, () => this.teams, () => this.assetTypes, () => this.lbsNodes, () => this.milestones), this.notes = new Ct(t, () => this.members), this.flags = new Ft(t), this.engine = new Os(
|
|
2967
2939
|
() => this._data,
|
|
2968
2940
|
(i) => this.history.get(i)
|
|
2969
|
-
), this.history = new
|
|
2941
|
+
), this.history = new I(
|
|
2970
2942
|
t,
|
|
2971
2943
|
(i) => {
|
|
2972
2944
|
this._data = i;
|
|
2973
2945
|
},
|
|
2974
2946
|
() => this._zip
|
|
2975
|
-
), this.nomenclature = new
|
|
2947
|
+
), this.nomenclature = new Pt(t), this.memory = new Z("memory.md", () => this._zip), this.skill = new Z("skills/bep-authoring/SKILL.md", () => this._zip), this.icon = new Z("icon.svg", () => this._zip);
|
|
2976
2948
|
}
|
|
2977
2949
|
_data;
|
|
2978
2950
|
_zip;
|
|
@@ -3031,7 +3003,7 @@ class F {
|
|
|
3031
3003
|
static async open(e) {
|
|
3032
3004
|
const s = await se.loadAsync(e), t = s.file("bep.json");
|
|
3033
3005
|
if (!t) throw new Error("Invalid .bep file: missing bep.json");
|
|
3034
|
-
const i = await t.async("string"), o =
|
|
3006
|
+
const i = await t.async("string"), o = $(JSON.parse(i));
|
|
3035
3007
|
return await F._initialize(o, s), new F(o, s);
|
|
3036
3008
|
}
|
|
3037
3009
|
/**
|
|
@@ -3059,7 +3031,7 @@ class F {
|
|
|
3059
3031
|
}
|
|
3060
3032
|
}
|
|
3061
3033
|
static create(e) {
|
|
3062
|
-
const s =
|
|
3034
|
+
const s = $({
|
|
3063
3035
|
project: { name: e.name, code: e.code, clientId: e.clientId, description: e.description },
|
|
3064
3036
|
roles: [],
|
|
3065
3037
|
members: [],
|
|
@@ -3203,6 +3175,12 @@ ${t.join(`
|
|
|
3203
3175
|
c,
|
|
3204
3176
|
"}",
|
|
3205
3177
|
"",
|
|
3178
|
+
"// ─── Triggers ─────────────────────────────────────────────────────────────────",
|
|
3179
|
+
"",
|
|
3180
|
+
"export interface BepTriggers {",
|
|
3181
|
+
" [key: string]: (rawPayload: unknown) => Promise<{ assetTypeId: string; source: string; id: string; label: string }>",
|
|
3182
|
+
"}",
|
|
3183
|
+
"",
|
|
3206
3184
|
"// ─── Env ──────────────────────────────────────────────────────────────────────",
|
|
3207
3185
|
"",
|
|
3208
3186
|
"export interface BepEnv {",
|
|
@@ -3215,6 +3193,7 @@ ${t.join(`
|
|
|
3215
3193
|
" effects: BepEffects",
|
|
3216
3194
|
" automations: BepAutomations",
|
|
3217
3195
|
" resolvers: BepResolvers",
|
|
3196
|
+
" triggers: BepTriggers",
|
|
3218
3197
|
" env: BepEnv",
|
|
3219
3198
|
"}",
|
|
3220
3199
|
""
|
|
@@ -3233,46 +3212,46 @@ ${t.join(`
|
|
|
3233
3212
|
}
|
|
3234
3213
|
export {
|
|
3235
3214
|
Ee as ActionSchema,
|
|
3236
|
-
|
|
3237
|
-
|
|
3215
|
+
Tt as Actions,
|
|
3216
|
+
Te as AnnexSchema,
|
|
3238
3217
|
Xe as AnnexType,
|
|
3239
|
-
|
|
3240
|
-
|
|
3218
|
+
$t as Annexes,
|
|
3219
|
+
ye as AssetTypeSchema,
|
|
3241
3220
|
Kt as AssetTypes,
|
|
3242
|
-
|
|
3243
|
-
|
|
3221
|
+
jt as Automations,
|
|
3222
|
+
xs as BEPSchema,
|
|
3244
3223
|
ne as BEPVersionBase,
|
|
3245
3224
|
It as BEPVersionSchema,
|
|
3246
3225
|
Ie as BIMUseSchema,
|
|
3247
|
-
|
|
3226
|
+
Lt as BIMUses,
|
|
3248
3227
|
F as Bep,
|
|
3249
3228
|
Fs as ChangelogSchema,
|
|
3250
3229
|
Et as DEFAULT_DELIMITER,
|
|
3251
3230
|
St as DEFAULT_TOKEN_PATTERN,
|
|
3252
3231
|
bt as DeliverableBaseSchema,
|
|
3253
|
-
|
|
3254
|
-
|
|
3232
|
+
xe as DeliverableSchema,
|
|
3233
|
+
xt as Deliverables,
|
|
3255
3234
|
ge as DisciplineSchema,
|
|
3256
3235
|
Dt as Disciplines,
|
|
3257
3236
|
ut as EdgeGuardSchema,
|
|
3258
3237
|
At as Effects,
|
|
3259
3238
|
Os as Engine,
|
|
3260
|
-
|
|
3239
|
+
w as Entity,
|
|
3261
3240
|
Ot as Env,
|
|
3262
3241
|
Fe as EnvVarSchema,
|
|
3263
|
-
|
|
3264
|
-
|
|
3242
|
+
Bt as Events,
|
|
3243
|
+
we as ExtensionSchema,
|
|
3265
3244
|
qt as Extensions,
|
|
3266
3245
|
vt as FlagBaseSchema,
|
|
3267
3246
|
Qe as FlagEntityType,
|
|
3268
|
-
|
|
3247
|
+
Pe as FlagSchema,
|
|
3269
3248
|
Ye as FlagSeverity,
|
|
3270
3249
|
Ft as Flags,
|
|
3271
3250
|
lt as FlowAutomationNodeSchema,
|
|
3272
3251
|
ke as FlowAutomationSchema,
|
|
3273
3252
|
pt as FlowDecisionEdgeSchema,
|
|
3274
3253
|
dt as FlowDecisionNodeSchema,
|
|
3275
|
-
|
|
3254
|
+
wt as FlowDiagramSchema,
|
|
3276
3255
|
ht as FlowDirectEdgeSchema,
|
|
3277
3256
|
He as FlowDirection,
|
|
3278
3257
|
gt as FlowEdgeSchema,
|
|
@@ -3280,50 +3259,50 @@ export {
|
|
|
3280
3259
|
at as FlowEndNodeSchema,
|
|
3281
3260
|
Se as FlowEventSchema,
|
|
3282
3261
|
ft as FlowNodeSchema,
|
|
3283
|
-
|
|
3262
|
+
C as FlowPayloadFieldSchema,
|
|
3284
3263
|
ct as FlowProcessNodeSchema,
|
|
3285
3264
|
rt as FlowStartNodeSchema,
|
|
3286
3265
|
mt as FlowTransitionEdgeSchema,
|
|
3287
|
-
|
|
3266
|
+
$e as GuideSchema,
|
|
3288
3267
|
Ut as Guides,
|
|
3289
|
-
|
|
3268
|
+
I as History,
|
|
3290
3269
|
Ge as ISORole,
|
|
3291
3270
|
nt as LBSNodeBaseSchema,
|
|
3292
3271
|
he as LBSNodeSchema,
|
|
3293
3272
|
Ve as LBSNodeType,
|
|
3294
3273
|
Gt as LBSNodes,
|
|
3295
|
-
|
|
3274
|
+
je as LODSchema,
|
|
3296
3275
|
zt as LODs,
|
|
3297
3276
|
Jt as LOINEntity,
|
|
3298
|
-
|
|
3299
|
-
|
|
3277
|
+
yt as LOINMilestoneSchema,
|
|
3278
|
+
Be as LOINSchema,
|
|
3300
3279
|
Oe as LOISchema,
|
|
3301
3280
|
Zt as LOIs,
|
|
3302
3281
|
ce as MemberSchema,
|
|
3303
3282
|
Xt as Members,
|
|
3304
|
-
|
|
3283
|
+
js as MemoryStorage,
|
|
3305
3284
|
pe as MilestoneSchema,
|
|
3306
3285
|
Vt as Milestones,
|
|
3307
3286
|
ue as NamingConventionSchema,
|
|
3308
3287
|
st as NamingSegmentSchema,
|
|
3309
3288
|
tt as NamingTokenSchema,
|
|
3310
3289
|
it as NodeTimeoutSchema,
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3290
|
+
Ps as NodeType,
|
|
3291
|
+
Pt as Nomenclature,
|
|
3292
|
+
Me as NoteSchema,
|
|
3293
|
+
Ct as Notes,
|
|
3315
3294
|
be as ObjectiveSchema,
|
|
3316
3295
|
Ht as Objectives,
|
|
3317
3296
|
me as PhaseSchema,
|
|
3318
3297
|
Yt as Phases,
|
|
3319
3298
|
de as ProjectSchema,
|
|
3320
3299
|
Qt as RemoteDataEntity,
|
|
3321
|
-
|
|
3322
|
-
|
|
3300
|
+
Le as RemoteDataSchema,
|
|
3301
|
+
Ce as ResolverSchema,
|
|
3323
3302
|
es as Resolvers,
|
|
3324
3303
|
le as RoleSchema,
|
|
3325
3304
|
Wt as Roles,
|
|
3326
|
-
|
|
3305
|
+
Ls as Runtime,
|
|
3327
3306
|
_t as Singleton,
|
|
3328
3307
|
ve as SoftwareSchema,
|
|
3329
3308
|
ts as Softwares,
|
|
@@ -3333,22 +3312,21 @@ export {
|
|
|
3333
3312
|
fe as TeamSchema,
|
|
3334
3313
|
ns as Teams,
|
|
3335
3314
|
Z as TextFile,
|
|
3336
|
-
|
|
3315
|
+
Re as WorkflowSchema,
|
|
3337
3316
|
os as Workflows,
|
|
3338
3317
|
bs as arrayDefs,
|
|
3339
3318
|
Ze as buildCodeMap,
|
|
3340
3319
|
K as buildConsecutivoMap,
|
|
3341
|
-
|
|
3320
|
+
x as buildParentMap,
|
|
3342
3321
|
Es as diffBep,
|
|
3343
3322
|
Is as diffEntities,
|
|
3344
|
-
Cs as flowDiagramToMermaid,
|
|
3345
3323
|
ze as getNomenCode,
|
|
3346
3324
|
Q as getRootIds,
|
|
3347
3325
|
Nt as getTokenPattern,
|
|
3348
|
-
|
|
3349
|
-
|
|
3326
|
+
Cs as groupRaciRows,
|
|
3327
|
+
$ as normalizeBep,
|
|
3350
3328
|
Ue as resolveLBSCodes,
|
|
3351
3329
|
kt as validateAllTokens,
|
|
3352
|
-
|
|
3353
|
-
|
|
3330
|
+
Mt as validateLBS,
|
|
3331
|
+
j as validateTokenValue
|
|
3354
3332
|
};
|