@dialecte/scl 0.2.16 → 0.2.20
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/{extensions-BQYiSBug.js → extensions-C_XbWugj.js} +372 -342
- package/dist/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.d.ts +22 -0
- package/dist/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/build/index.d.ts +2 -0
- package/dist/v2019C1/extensions/reference/query/build/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/resolve/index.d.ts +1 -0
- package/dist/v2019C1/extensions/reference/query/resolve/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.d.ts +18 -0
- package/dist/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.d.ts.map +1 -0
- package/dist/v2019C1/hooks/after-created/private-wrapper.d.ts +4 -4
- package/dist/v2019C1/hooks/after-created/private-wrapper.d.ts.map +1 -1
- package/dist/v2019C1/index.js +1 -1
- package/dist/v2019C1/test/hydrated-test.d.ts +2 -2
- package/dist/v2019C1/test/hydrated-test.d.ts.map +1 -1
- package/dist/v2019C1/test.js +2 -2
- package/package.json +11 -3
|
@@ -3702,13 +3702,13 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
3702
3702
|
"SCL",
|
|
3703
3703
|
"Substation"
|
|
3704
3704
|
]
|
|
3705
|
-
},
|
|
3705
|
+
}, ee = [
|
|
3706
3706
|
"Communication",
|
|
3707
3707
|
"DataTypeTemplates",
|
|
3708
3708
|
"Header",
|
|
3709
3709
|
"History",
|
|
3710
3710
|
"SCL"
|
|
3711
|
-
],
|
|
3711
|
+
], p = {
|
|
3712
3712
|
AccessControl: {},
|
|
3713
3713
|
AccessPoint: {
|
|
3714
3714
|
clock: "",
|
|
@@ -5161,7 +5161,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
5161
5161
|
templateUuid: "",
|
|
5162
5162
|
uuid: ""
|
|
5163
5163
|
}
|
|
5164
|
-
},
|
|
5164
|
+
}, m = {
|
|
5165
5165
|
AccessControl: {
|
|
5166
5166
|
tag: "AccessControl",
|
|
5167
5167
|
namespace: {
|
|
@@ -24053,7 +24053,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
24053
24053
|
};
|
|
24054
24054
|
//#endregion
|
|
24055
24055
|
//#region src/v2019C1/hooks/after-created/private-wrapper.ts
|
|
24056
|
-
async function
|
|
24056
|
+
async function h(e) {
|
|
24057
24057
|
let { childRecord: t, parentRecord: n, query: r } = e;
|
|
24058
24058
|
if (t.namespace.prefix === U.namespaces.default.prefix) return [];
|
|
24059
24059
|
let i = n.tagName === "Private", a = n.namespace.prefix === U.namespaces.default.prefix;
|
|
@@ -24062,26 +24062,26 @@ async function g(e) {
|
|
|
24062
24062
|
...n,
|
|
24063
24063
|
children: n.children.filter((e) => e.id !== t.id)
|
|
24064
24064
|
};
|
|
24065
|
-
return i ?
|
|
24065
|
+
return i ? g({
|
|
24066
24066
|
parentRecord: n,
|
|
24067
24067
|
childRecord: t,
|
|
24068
24068
|
query: r
|
|
24069
|
-
}) : o ?
|
|
24069
|
+
}) : o ? _({
|
|
24070
24070
|
existingPrivateRef: o,
|
|
24071
24071
|
parentRecord: n,
|
|
24072
24072
|
updatedParentRecord: s,
|
|
24073
24073
|
childRecord: t,
|
|
24074
24074
|
query: r
|
|
24075
|
-
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] :
|
|
24075
|
+
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] : v({
|
|
24076
24076
|
parentRecord: n,
|
|
24077
24077
|
updatedParentRecord: s,
|
|
24078
24078
|
childRecord: t
|
|
24079
24079
|
});
|
|
24080
24080
|
}
|
|
24081
|
-
async function
|
|
24081
|
+
async function g(e) {
|
|
24082
24082
|
let { parentRecord: t, childRecord: n, query: r } = e, o = t;
|
|
24083
24083
|
if (n.parent?.id === o.id && n.parent?.tagName === "Private") return [];
|
|
24084
|
-
let s = await
|
|
24084
|
+
let s = await y({
|
|
24085
24085
|
privateId: o.id,
|
|
24086
24086
|
query: r
|
|
24087
24087
|
});
|
|
@@ -24089,7 +24089,7 @@ async function _(e) {
|
|
|
24089
24089
|
detail: "Latest private record not found",
|
|
24090
24090
|
key: "ELEMENT_NOT_FOUND"
|
|
24091
24091
|
});
|
|
24092
|
-
let { childRecord: c, privateRecord: l } =
|
|
24092
|
+
let { childRecord: c, privateRecord: l } = b({
|
|
24093
24093
|
privateRecord: s,
|
|
24094
24094
|
childRecord: n
|
|
24095
24095
|
});
|
|
@@ -24103,8 +24103,8 @@ async function _(e) {
|
|
|
24103
24103
|
newRecord: i(l)
|
|
24104
24104
|
}];
|
|
24105
24105
|
}
|
|
24106
|
-
async function
|
|
24107
|
-
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: o, query: s } = e, c = await
|
|
24106
|
+
async function _(e) {
|
|
24107
|
+
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: o, query: s } = e, c = await y({
|
|
24108
24108
|
privateId: t.id,
|
|
24109
24109
|
query: s
|
|
24110
24110
|
});
|
|
@@ -24112,7 +24112,7 @@ async function v(e) {
|
|
|
24112
24112
|
detail: "Latest private record not found",
|
|
24113
24113
|
key: "ELEMENT_NOT_FOUND"
|
|
24114
24114
|
}), !c.attributes.some((e) => e.name === "type" && e.value === o.namespace.prefix)) return [];
|
|
24115
|
-
let { childRecord: l, privateRecord: u } =
|
|
24115
|
+
let { childRecord: l, privateRecord: u } = b({
|
|
24116
24116
|
privateRecord: c,
|
|
24117
24117
|
childRecord: o
|
|
24118
24118
|
});
|
|
@@ -24134,7 +24134,7 @@ async function v(e) {
|
|
|
24134
24134
|
}
|
|
24135
24135
|
];
|
|
24136
24136
|
}
|
|
24137
|
-
function
|
|
24137
|
+
function v(e) {
|
|
24138
24138
|
let { parentRecord: t, updatedParentRecord: n, childRecord: r } = e, a = {
|
|
24139
24139
|
id: crypto.randomUUID(),
|
|
24140
24140
|
tagName: "Private",
|
|
@@ -24183,14 +24183,14 @@ function y(e) {
|
|
|
24183
24183
|
}
|
|
24184
24184
|
];
|
|
24185
24185
|
}
|
|
24186
|
-
async function
|
|
24186
|
+
async function y(e) {
|
|
24187
24187
|
let { privateId: t, query: n } = e;
|
|
24188
24188
|
return await n.getRecord({
|
|
24189
24189
|
id: t,
|
|
24190
24190
|
tagName: "Private"
|
|
24191
24191
|
});
|
|
24192
24192
|
}
|
|
24193
|
-
function
|
|
24193
|
+
function b(e) {
|
|
24194
24194
|
let { privateRecord: t, childRecord: n } = e;
|
|
24195
24195
|
return {
|
|
24196
24196
|
childRecord: {
|
|
@@ -24211,7 +24211,7 @@ function x(e) {
|
|
|
24211
24211
|
}
|
|
24212
24212
|
//#endregion
|
|
24213
24213
|
//#region src/v2019C1/extensions/reference/constants/path-extraction.ts
|
|
24214
|
-
var
|
|
24214
|
+
var x = {
|
|
24215
24215
|
AccessPoint: { type: "transparent" },
|
|
24216
24216
|
Server: { type: "transparent" },
|
|
24217
24217
|
Private: { type: "transparent" },
|
|
@@ -24291,16 +24291,16 @@ var S = {
|
|
|
24291
24291
|
PowerSystemRelation: { type: "name" },
|
|
24292
24292
|
Variable: { type: "name" },
|
|
24293
24293
|
Process: { type: "name" }
|
|
24294
|
-
},
|
|
24294
|
+
}, te = [
|
|
24295
24295
|
"lnClass",
|
|
24296
24296
|
"prefix",
|
|
24297
24297
|
"inst",
|
|
24298
24298
|
"lnInst"
|
|
24299
|
-
],
|
|
24299
|
+
], S = new Set(Object.values(x).flatMap((e) => {
|
|
24300
24300
|
switch (e.type) {
|
|
24301
24301
|
case "transparent": return [];
|
|
24302
24302
|
case "name": return ["name"];
|
|
24303
|
-
case "lnClass": return [...
|
|
24303
|
+
case "lnClass": return [...te];
|
|
24304
24304
|
case "attribute": return [e.attr];
|
|
24305
24305
|
case "sourceRef": return [
|
|
24306
24306
|
"input",
|
|
@@ -24312,13 +24312,13 @@ var S = {
|
|
|
24312
24312
|
}));
|
|
24313
24313
|
//#endregion
|
|
24314
24314
|
//#region src/v2019C1/extensions/reference/query/build/path-segment.ts
|
|
24315
|
-
function
|
|
24315
|
+
function ne(e) {
|
|
24316
24316
|
switch (e.type) {
|
|
24317
24317
|
case "transparent": return () => null;
|
|
24318
24318
|
case "name": {
|
|
24319
24319
|
let t = e.separator ?? "/";
|
|
24320
24320
|
return (e) => {
|
|
24321
|
-
let n =
|
|
24321
|
+
let n = w(e, "name");
|
|
24322
24322
|
return n ? {
|
|
24323
24323
|
segment: n,
|
|
24324
24324
|
separator: t
|
|
@@ -24326,34 +24326,34 @@ function te(e) {
|
|
|
24326
24326
|
};
|
|
24327
24327
|
}
|
|
24328
24328
|
case "lnClass": return (e) => {
|
|
24329
|
-
let t =
|
|
24329
|
+
let t = w(e, "lnClass");
|
|
24330
24330
|
return t ? {
|
|
24331
|
-
segment: `${
|
|
24331
|
+
segment: `${w(e, "prefix") ?? ""}${t}${w(e, "inst") ?? w(e, "lnInst") ?? ""}`,
|
|
24332
24332
|
separator: "/"
|
|
24333
24333
|
} : null;
|
|
24334
24334
|
};
|
|
24335
24335
|
case "attribute": return (t) => {
|
|
24336
|
-
let n =
|
|
24336
|
+
let n = w(t, e.attr);
|
|
24337
24337
|
return n ? {
|
|
24338
24338
|
segment: n,
|
|
24339
24339
|
separator: e.separator
|
|
24340
24340
|
} : null;
|
|
24341
24341
|
};
|
|
24342
24342
|
case "sourceRef": return (e) => {
|
|
24343
|
-
let t =
|
|
24343
|
+
let t = w(e, "input");
|
|
24344
24344
|
if (!t) return null;
|
|
24345
|
-
let n = t, r =
|
|
24345
|
+
let n = t, r = w(e, "inputInst");
|
|
24346
24346
|
r && r !== "1" && (n += `(${r})`);
|
|
24347
|
-
let i =
|
|
24347
|
+
let i = w(e, "pDA");
|
|
24348
24348
|
return i && (n += `.${i}`), {
|
|
24349
24349
|
segment: n,
|
|
24350
24350
|
separator: "."
|
|
24351
24351
|
};
|
|
24352
24352
|
};
|
|
24353
24353
|
case "controlRef": return (e) => {
|
|
24354
|
-
let t =
|
|
24354
|
+
let t = w(e, "output");
|
|
24355
24355
|
if (!t) return null;
|
|
24356
|
-
let n = t, r =
|
|
24356
|
+
let n = t, r = w(e, "outputInst");
|
|
24357
24357
|
return r && r !== "1" && (n += `(${r})`), {
|
|
24358
24358
|
segment: n,
|
|
24359
24359
|
separator: "."
|
|
@@ -24361,15 +24361,15 @@ function te(e) {
|
|
|
24361
24361
|
};
|
|
24362
24362
|
}
|
|
24363
24363
|
}
|
|
24364
|
-
var
|
|
24365
|
-
function
|
|
24366
|
-
let t =
|
|
24364
|
+
var re = Object.fromEntries(Object.entries(x).map(([e, t]) => [e, ne(t)]));
|
|
24365
|
+
function C(e) {
|
|
24366
|
+
let t = re[e.tagName];
|
|
24367
24367
|
return t ? t(e) : null;
|
|
24368
24368
|
}
|
|
24369
|
-
function
|
|
24369
|
+
function ie(e) {
|
|
24370
24370
|
let { record: t, ancestry: n } = e, r = [];
|
|
24371
24371
|
for (let e of n) {
|
|
24372
|
-
let t =
|
|
24372
|
+
let t = C(e);
|
|
24373
24373
|
t && r.push({
|
|
24374
24374
|
...t,
|
|
24375
24375
|
ref: {
|
|
@@ -24378,7 +24378,7 @@ function T(e) {
|
|
|
24378
24378
|
}
|
|
24379
24379
|
});
|
|
24380
24380
|
}
|
|
24381
|
-
let i =
|
|
24381
|
+
let i = C(t);
|
|
24382
24382
|
return i && r.push({
|
|
24383
24383
|
...i,
|
|
24384
24384
|
ref: {
|
|
@@ -24386,32 +24386,32 @@ function T(e) {
|
|
|
24386
24386
|
id: t.id
|
|
24387
24387
|
}
|
|
24388
24388
|
}), r.length === 0 ? null : {
|
|
24389
|
-
path:
|
|
24389
|
+
path: T(r),
|
|
24390
24390
|
segments: r
|
|
24391
24391
|
};
|
|
24392
24392
|
}
|
|
24393
|
-
function
|
|
24393
|
+
function w(e, t) {
|
|
24394
24394
|
return e.attributes.find((e) => e.name === t)?.value;
|
|
24395
24395
|
}
|
|
24396
|
-
function
|
|
24396
|
+
function T(e) {
|
|
24397
24397
|
let t = e[0].segment;
|
|
24398
24398
|
for (let n = 1; n < e.length; n++) t += e[n].separator + e[n].segment;
|
|
24399
24399
|
return t;
|
|
24400
24400
|
}
|
|
24401
24401
|
//#endregion
|
|
24402
24402
|
//#region src/v2019C1/extensions/reference/query/build/build-element-path.ts
|
|
24403
|
-
async function
|
|
24403
|
+
async function E(e, t) {
|
|
24404
24404
|
let n = await e.getRecord(t);
|
|
24405
24405
|
if (!n) return null;
|
|
24406
24406
|
let r = await e.findAncestors(t, { order: "top-down" });
|
|
24407
|
-
return
|
|
24407
|
+
return ie({
|
|
24408
24408
|
record: i(n),
|
|
24409
24409
|
ancestry: r.map(i)
|
|
24410
24410
|
});
|
|
24411
24411
|
}
|
|
24412
24412
|
//#endregion
|
|
24413
24413
|
//#region src/v2019C1/extensions/reference/query/resolve/parse-path.ts
|
|
24414
|
-
function
|
|
24414
|
+
function D(e) {
|
|
24415
24415
|
if (!e) return [];
|
|
24416
24416
|
let t = [], n = "", r = "/";
|
|
24417
24417
|
for (let i of e) i === "/" || i === "." ? (n && t.push({
|
|
@@ -24432,19 +24432,19 @@ function O(e) {
|
|
|
24432
24432
|
qualifier: a || void 0
|
|
24433
24433
|
};
|
|
24434
24434
|
}
|
|
24435
|
-
function
|
|
24436
|
-
return !e || e ===
|
|
24435
|
+
function k(e, t, n, r) {
|
|
24436
|
+
return !e || e === N.unsupported ? null : e === N.direct ? { lookupKey: n } : e === N.iedAddress ? oe(n, r) : e === N.lnode ? ae(n) : e === N.behaviorDescription ? se(t, n, r) : null;
|
|
24437
24437
|
}
|
|
24438
|
-
function
|
|
24438
|
+
function ae(e) {
|
|
24439
24439
|
let { path: t, qualifier: n } = O(e);
|
|
24440
24440
|
return {
|
|
24441
24441
|
lookupKey: t,
|
|
24442
24442
|
qualifier: n
|
|
24443
24443
|
};
|
|
24444
24444
|
}
|
|
24445
|
-
function
|
|
24445
|
+
function oe(e, t) {
|
|
24446
24446
|
if (t) {
|
|
24447
|
-
let n =
|
|
24447
|
+
let n = ue(t);
|
|
24448
24448
|
if (n) return {
|
|
24449
24449
|
lookupKey: e,
|
|
24450
24450
|
fallbackLookupKey: `${n}/${e}`
|
|
@@ -24452,15 +24452,15 @@ function se(e, t) {
|
|
|
24452
24452
|
}
|
|
24453
24453
|
return { lookupKey: e };
|
|
24454
24454
|
}
|
|
24455
|
-
function
|
|
24455
|
+
function se(e, t, n) {
|
|
24456
24456
|
if (!n) return null;
|
|
24457
|
-
let r =
|
|
24457
|
+
let r = ce(n);
|
|
24458
24458
|
return r ? e === "dataName" ? {
|
|
24459
24459
|
lookupKey: r,
|
|
24460
24460
|
qualifier: t
|
|
24461
|
-
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${
|
|
24461
|
+
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${le(t)}` } : null : null;
|
|
24462
24462
|
}
|
|
24463
|
-
function
|
|
24463
|
+
function ce(e) {
|
|
24464
24464
|
let t = -1;
|
|
24465
24465
|
for (let n = e.length - 1; n >= 0; n--) if (e[n].tagName === "BehaviorDescription") {
|
|
24466
24466
|
t = n;
|
|
@@ -24469,34 +24469,34 @@ function le(e) {
|
|
|
24469
24469
|
if (t === -1) return null;
|
|
24470
24470
|
let n = [];
|
|
24471
24471
|
for (let r = 0; r < t; r++) {
|
|
24472
|
-
let t =
|
|
24472
|
+
let t = C(e[r]);
|
|
24473
24473
|
t && n.push(t);
|
|
24474
24474
|
}
|
|
24475
|
-
return n.length === 0 ? null :
|
|
24475
|
+
return n.length === 0 ? null : T(n);
|
|
24476
24476
|
}
|
|
24477
|
-
function
|
|
24477
|
+
function le(e) {
|
|
24478
24478
|
let t = e.indexOf("("), n = e.indexOf(".");
|
|
24479
24479
|
return t === -1 ? n === -1 ? e : e.substring(0, n) : e.substring(0, t);
|
|
24480
24480
|
}
|
|
24481
|
-
function
|
|
24481
|
+
function ue(e) {
|
|
24482
24482
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].tagName === "LNode") return e[t].attributes.find((e) => e.name === "iedName")?.value ?? null;
|
|
24483
24483
|
return null;
|
|
24484
24484
|
}
|
|
24485
24485
|
//#endregion
|
|
24486
24486
|
//#region src/v2019C1/extensions/reference/query/build/build-reference-path.ts
|
|
24487
|
-
async function
|
|
24488
|
-
let { reference: n, target: r } = t, a =
|
|
24487
|
+
async function A(e, t) {
|
|
24488
|
+
let { reference: n, target: r } = t, a = de(n.tagName, r.tagName);
|
|
24489
24489
|
if (!a) return null;
|
|
24490
24490
|
let o = a.resolution;
|
|
24491
|
-
if (o ===
|
|
24492
|
-
if (o ===
|
|
24491
|
+
if (o === N.unsupported) return null;
|
|
24492
|
+
if (o === N.behaviorDescription) {
|
|
24493
24493
|
let t = await e.getRecord(r);
|
|
24494
|
-
return t ?
|
|
24494
|
+
return t ? C(i(t))?.segment ?? null : null;
|
|
24495
24495
|
}
|
|
24496
|
-
let s = await
|
|
24496
|
+
let s = await E(e, r);
|
|
24497
24497
|
if (!s) return null;
|
|
24498
24498
|
let c = s.path;
|
|
24499
|
-
if (o ===
|
|
24499
|
+
if (o === N.lnode) {
|
|
24500
24500
|
let t = await e.getRecord(n);
|
|
24501
24501
|
if (!t) return c;
|
|
24502
24502
|
let r = t.attributes.find((e) => e.name === a.attribute.path)?.value;
|
|
@@ -24506,11 +24506,20 @@ async function k(e, t) {
|
|
|
24506
24506
|
}
|
|
24507
24507
|
return c;
|
|
24508
24508
|
}
|
|
24509
|
-
function
|
|
24510
|
-
let n =
|
|
24509
|
+
function de(e, t) {
|
|
24510
|
+
let n = P[e];
|
|
24511
24511
|
return n ? n.find((e) => e.target.includes(t)) ?? null : null;
|
|
24512
24512
|
}
|
|
24513
24513
|
//#endregion
|
|
24514
|
+
//#region src/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.ts
|
|
24515
|
+
function j(e) {
|
|
24516
|
+
let t = e.iedName;
|
|
24517
|
+
if (!t || t === fe) return null;
|
|
24518
|
+
let n = e.ldInst, r = e.lnClass;
|
|
24519
|
+
return !n || !r ? null : `${t}/${n}/${`${e.prefix ?? ""}${r}${e.lnInst ?? ""}`}`;
|
|
24520
|
+
}
|
|
24521
|
+
var fe = "None";
|
|
24522
|
+
//#endregion
|
|
24514
24523
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-reference-path.ts
|
|
24515
24524
|
async function pe(e, t, n) {
|
|
24516
24525
|
let r = me(t.tagName, n);
|
|
@@ -24523,10 +24532,10 @@ async function pe(e, t, n) {
|
|
|
24523
24532
|
qualifier: ge(r, n, a)
|
|
24524
24533
|
};
|
|
24525
24534
|
let s;
|
|
24526
|
-
(r.resolution ===
|
|
24527
|
-
let c =
|
|
24535
|
+
(r.resolution === N.behaviorDescription || r.resolution === N.iedAddress) && (s = (await e.findAncestors(t, { order: "top-down" })).map((e) => i(e)));
|
|
24536
|
+
let c = k(r.resolution, n, a, s);
|
|
24528
24537
|
if (!c) return;
|
|
24529
|
-
let l =
|
|
24538
|
+
let l = D(c.lookupKey);
|
|
24530
24539
|
if (l.length === 0) return;
|
|
24531
24540
|
let u = l[l.length - 1], d = l.slice(0, -1), f = await be({
|
|
24532
24541
|
query: e,
|
|
@@ -24540,7 +24549,7 @@ async function pe(e, t, n) {
|
|
|
24540
24549
|
};
|
|
24541
24550
|
}
|
|
24542
24551
|
function me(e, t) {
|
|
24543
|
-
let n =
|
|
24552
|
+
let n = P[e];
|
|
24544
24553
|
if (n) return n.find((e) => e.attribute.path === t);
|
|
24545
24554
|
}
|
|
24546
24555
|
async function he(e, t, n) {
|
|
@@ -24554,10 +24563,10 @@ async function he(e, t, n) {
|
|
|
24554
24563
|
}
|
|
24555
24564
|
}
|
|
24556
24565
|
function ge(e, t, n) {
|
|
24557
|
-
if (e.resolution ===
|
|
24558
|
-
if (e.resolution ===
|
|
24566
|
+
if (e.resolution === N.lnode) return O(n).qualifier;
|
|
24567
|
+
if (e.resolution === N.behaviorDescription && t === "dataName") return n;
|
|
24559
24568
|
}
|
|
24560
|
-
var _e = new Set(
|
|
24569
|
+
var _e = new Set(m.LNode.attributes.details.lnClass.facets.enumeration), ve = {
|
|
24561
24570
|
LNode: "lnInst",
|
|
24562
24571
|
LN: "inst",
|
|
24563
24572
|
LN0: "inst"
|
|
@@ -24606,37 +24615,37 @@ async function xe(e) {
|
|
|
24606
24615
|
});
|
|
24607
24616
|
for (let e of s) {
|
|
24608
24617
|
let n = e.attributes.find((e) => e.name === "prefix")?.value ?? "", r = e.attributes.find((e) => e.name === i)?.value ?? "";
|
|
24609
|
-
if (!(n !== o.prefix || r !== o.inst) && await
|
|
24618
|
+
if (!(n !== o.prefix || r !== o.inst) && await Ce(t, e, a)) return e;
|
|
24610
24619
|
}
|
|
24611
24620
|
}
|
|
24612
24621
|
async function Se(e) {
|
|
24613
24622
|
let { query: t, tagName: n, segment: r, expectedAncestry: a } = e, o = await t.getRecordsByTagName(n);
|
|
24614
24623
|
for (let e of o) {
|
|
24615
|
-
let n =
|
|
24616
|
-
if (!(!n || n.segment !== r.segment) && await
|
|
24624
|
+
let n = C(i(e));
|
|
24625
|
+
if (!(!n || n.segment !== r.segment) && await Ce(t, e, a)) return e;
|
|
24617
24626
|
}
|
|
24618
24627
|
}
|
|
24619
|
-
async function
|
|
24628
|
+
async function Ce(e, t, n) {
|
|
24620
24629
|
if (n.length === 0) return !0;
|
|
24621
24630
|
let r = await e.findAncestors(t), a = [];
|
|
24622
24631
|
for (let e = r.length - 1; e >= 0; e--) {
|
|
24623
|
-
let t =
|
|
24632
|
+
let t = C(i(r[e]));
|
|
24624
24633
|
t && a.push(t);
|
|
24625
24634
|
}
|
|
24626
24635
|
return a.length === n.length ? a.every((e, t) => e.segment === n[t].segment) : !1;
|
|
24627
24636
|
}
|
|
24628
24637
|
//#endregion
|
|
24629
24638
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-element-path.ts
|
|
24630
|
-
async function
|
|
24631
|
-
let n =
|
|
24632
|
-
if (n.length !== 0) return
|
|
24639
|
+
async function we(e, t) {
|
|
24640
|
+
let n = D(t);
|
|
24641
|
+
if (n.length !== 0) return M({
|
|
24633
24642
|
query: e,
|
|
24634
24643
|
current: await e.getRoot(),
|
|
24635
24644
|
segments: n,
|
|
24636
24645
|
index: 0
|
|
24637
24646
|
});
|
|
24638
24647
|
}
|
|
24639
|
-
async function
|
|
24648
|
+
async function M(e) {
|
|
24640
24649
|
let { query: t, current: n, segments: r, index: a } = e;
|
|
24641
24650
|
if (a >= r.length) return n;
|
|
24642
24651
|
let o = n.children ?? [];
|
|
@@ -24644,9 +24653,9 @@ async function j(e) {
|
|
|
24644
24653
|
let s = await t.getRecords(o), c = r[a];
|
|
24645
24654
|
for (let e of s) {
|
|
24646
24655
|
if (!e) continue;
|
|
24647
|
-
let n =
|
|
24656
|
+
let n = C(i(e));
|
|
24648
24657
|
if (!n) {
|
|
24649
|
-
let n = await
|
|
24658
|
+
let n = await M({
|
|
24650
24659
|
query: t,
|
|
24651
24660
|
current: e,
|
|
24652
24661
|
segments: r,
|
|
@@ -24656,7 +24665,7 @@ async function j(e) {
|
|
|
24656
24665
|
continue;
|
|
24657
24666
|
}
|
|
24658
24667
|
if (n.segment === c.segment && n.separator === c.separator) {
|
|
24659
|
-
let n = await
|
|
24668
|
+
let n = await M({
|
|
24660
24669
|
query: t,
|
|
24661
24670
|
current: e,
|
|
24662
24671
|
segments: r,
|
|
@@ -24668,14 +24677,33 @@ async function j(e) {
|
|
|
24668
24677
|
}
|
|
24669
24678
|
}
|
|
24670
24679
|
//#endregion
|
|
24680
|
+
//#region src/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.ts
|
|
24681
|
+
var Te = new Set(["LN", "LN0"]);
|
|
24682
|
+
async function Ee(e, t) {
|
|
24683
|
+
let n = j(De(t));
|
|
24684
|
+
if (!n) return;
|
|
24685
|
+
let r = await we(e, n);
|
|
24686
|
+
if (!(!r || !Te.has(r.tagName))) return r;
|
|
24687
|
+
}
|
|
24688
|
+
function De(e) {
|
|
24689
|
+
let t = (t) => e.attributes.find((e) => e.name === t)?.value;
|
|
24690
|
+
return {
|
|
24691
|
+
iedName: t("iedName"),
|
|
24692
|
+
ldInst: t("ldInst"),
|
|
24693
|
+
prefix: t("prefix"),
|
|
24694
|
+
lnClass: t("lnClass"),
|
|
24695
|
+
lnInst: t("lnInst")
|
|
24696
|
+
};
|
|
24697
|
+
}
|
|
24698
|
+
//#endregion
|
|
24671
24699
|
//#region src/v2019C1/extensions/reference/constants/resolution-types.ts
|
|
24672
|
-
var
|
|
24700
|
+
var N = {
|
|
24673
24701
|
direct: "direct",
|
|
24674
24702
|
lnode: "lnode",
|
|
24675
24703
|
iedAddress: "ied-address",
|
|
24676
24704
|
behaviorDescription: "behavior-description",
|
|
24677
24705
|
unsupported: "unsupported"
|
|
24678
|
-
},
|
|
24706
|
+
}, P = {
|
|
24679
24707
|
AllocationRoleRef: [{
|
|
24680
24708
|
attribute: {
|
|
24681
24709
|
path: "allocationRole",
|
|
@@ -25047,7 +25075,7 @@ var M = {
|
|
|
25047
25075
|
};
|
|
25048
25076
|
//#endregion
|
|
25049
25077
|
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25050
|
-
function
|
|
25078
|
+
function Oe(e) {
|
|
25051
25079
|
let t = {};
|
|
25052
25080
|
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25053
25081
|
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
@@ -25062,7 +25090,7 @@ function we(e) {
|
|
|
25062
25090
|
}
|
|
25063
25091
|
return t;
|
|
25064
25092
|
}
|
|
25065
|
-
function
|
|
25093
|
+
function ke(e) {
|
|
25066
25094
|
let t = /* @__PURE__ */ new Map();
|
|
25067
25095
|
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25068
25096
|
uuidAttr: e.attribute.uuid,
|
|
@@ -25074,16 +25102,16 @@ function Te(e) {
|
|
|
25074
25102
|
}
|
|
25075
25103
|
//#endregion
|
|
25076
25104
|
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25077
|
-
var
|
|
25078
|
-
|
|
25079
|
-
|
|
25080
|
-
|
|
25081
|
-
|
|
25082
|
-
],
|
|
25083
|
-
[...new Set(Object.values(
|
|
25105
|
+
var Ae = Oe(P), je = [
|
|
25106
|
+
N.direct,
|
|
25107
|
+
N.lnode,
|
|
25108
|
+
N.iedAddress,
|
|
25109
|
+
N.behaviorDescription
|
|
25110
|
+
], Me = ke(P);
|
|
25111
|
+
[...new Set(Object.values(P).flatMap((e) => e.map((e) => e.attribute.uuid)))];
|
|
25084
25112
|
//#endregion
|
|
25085
25113
|
//#region src/v2019C1/extensions/reference/constants/orphan-rules.ts
|
|
25086
|
-
var
|
|
25114
|
+
var F = new Set([
|
|
25087
25115
|
"SourceRef",
|
|
25088
25116
|
"ControlRef",
|
|
25089
25117
|
"DOS",
|
|
@@ -25092,7 +25120,7 @@ var I = new Set([
|
|
|
25092
25120
|
"InputVar",
|
|
25093
25121
|
"OutputVar",
|
|
25094
25122
|
"ProcessEcho"
|
|
25095
|
-
]),
|
|
25123
|
+
]), Ne = {
|
|
25096
25124
|
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25097
25125
|
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25098
25126
|
Resource: ["ProcessResource", "ProcessResources"],
|
|
@@ -25100,12 +25128,12 @@ var I = new Set([
|
|
|
25100
25128
|
};
|
|
25101
25129
|
//#endregion
|
|
25102
25130
|
//#region src/v2019C1/extensions/reference/query/find/find-refs-pointing-to.ts
|
|
25103
|
-
async function
|
|
25131
|
+
async function Pe(e, t) {
|
|
25104
25132
|
let { target: r, containerTagName: i } = t, a = await e.getRecord(r);
|
|
25105
25133
|
if (!a) return [];
|
|
25106
25134
|
let o = a.attributes.find((e) => e.name === "uuid")?.value;
|
|
25107
25135
|
if (!o) return [];
|
|
25108
|
-
let s =
|
|
25136
|
+
let s = Fe(a.tagName);
|
|
25109
25137
|
if (s.length === 0) return [];
|
|
25110
25138
|
let c = [];
|
|
25111
25139
|
for (let t of s) {
|
|
@@ -25115,7 +25143,7 @@ async function Oe(e, t) {
|
|
|
25115
25143
|
attributes: { [t.uuidAttr]: o }
|
|
25116
25144
|
});
|
|
25117
25145
|
for (let t of r) {
|
|
25118
|
-
let n = i ? await
|
|
25146
|
+
let n = i ? await Ie(e, t, i) : void 0;
|
|
25119
25147
|
c.push({
|
|
25120
25148
|
ref: t,
|
|
25121
25149
|
container: n
|
|
@@ -25124,29 +25152,31 @@ async function Oe(e, t) {
|
|
|
25124
25152
|
}
|
|
25125
25153
|
return c;
|
|
25126
25154
|
}
|
|
25127
|
-
function
|
|
25155
|
+
function Fe(e) {
|
|
25128
25156
|
let t = [];
|
|
25129
|
-
for (let n of
|
|
25130
|
-
let r =
|
|
25157
|
+
for (let n of je) {
|
|
25158
|
+
let r = Ae[n].get(e);
|
|
25131
25159
|
r && t.push(...r);
|
|
25132
25160
|
}
|
|
25133
25161
|
return t;
|
|
25134
25162
|
}
|
|
25135
|
-
async function
|
|
25163
|
+
async function Ie(e, t, n) {
|
|
25136
25164
|
return (await e.findAncestors(t, { stopAtTagName: n })).find((e) => e.tagName === n);
|
|
25137
25165
|
}
|
|
25138
25166
|
//#endregion
|
|
25139
25167
|
//#region src/v2019C1/extensions/reference/index.ts
|
|
25140
|
-
var
|
|
25141
|
-
buildElementPath: () =>
|
|
25142
|
-
|
|
25143
|
-
|
|
25144
|
-
|
|
25168
|
+
var I = { query: /* @__PURE__ */ s({
|
|
25169
|
+
buildElementPath: () => E,
|
|
25170
|
+
buildMappedLNodePath: () => j,
|
|
25171
|
+
buildReferencePath: () => A,
|
|
25172
|
+
findRefsPointingTo: () => Pe,
|
|
25173
|
+
resolveElementPath: () => we,
|
|
25174
|
+
resolveMappedLNode: () => Ee,
|
|
25145
25175
|
resolveReferencePath: () => pe
|
|
25146
25176
|
}) };
|
|
25147
25177
|
//#endregion
|
|
25148
25178
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
25149
|
-
async function
|
|
25179
|
+
async function L(e) {
|
|
25150
25180
|
let { uuid: t, entry: r, target: a, query: o } = e;
|
|
25151
25181
|
if (!n(r.refTagName, U)) return [];
|
|
25152
25182
|
let s = await o.getRecordsByTagName(r.refTagName), c = [];
|
|
@@ -25155,7 +25185,7 @@ async function R(e) {
|
|
|
25155
25185
|
let n = {
|
|
25156
25186
|
tagName: e.tagName,
|
|
25157
25187
|
id: e.id
|
|
25158
|
-
}, s = await
|
|
25188
|
+
}, s = await I.query.buildReferencePath(o, {
|
|
25159
25189
|
reference: n,
|
|
25160
25190
|
target: a
|
|
25161
25191
|
});
|
|
@@ -25175,32 +25205,32 @@ async function R(e) {
|
|
|
25175
25205
|
}
|
|
25176
25206
|
return c;
|
|
25177
25207
|
}
|
|
25178
|
-
function
|
|
25208
|
+
function R(e) {
|
|
25179
25209
|
let t = [];
|
|
25180
|
-
for (let n of
|
|
25181
|
-
let r =
|
|
25210
|
+
for (let n of je) {
|
|
25211
|
+
let r = Ae[n].get(e);
|
|
25182
25212
|
r && t.push(...r);
|
|
25183
25213
|
}
|
|
25184
25214
|
return t;
|
|
25185
25215
|
}
|
|
25186
25216
|
//#endregion
|
|
25187
25217
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
25188
|
-
async function
|
|
25189
|
-
let { childRecord: t, query: n } = e, r = await
|
|
25218
|
+
async function Le(e) {
|
|
25219
|
+
let { childRecord: t, query: n } = e, r = await Re({
|
|
25190
25220
|
childRecord: t,
|
|
25191
25221
|
query: n
|
|
25192
|
-
}), i = await
|
|
25222
|
+
}), i = await Ve({
|
|
25193
25223
|
childRecord: t,
|
|
25194
25224
|
query: n
|
|
25195
25225
|
});
|
|
25196
25226
|
return [...r, ...i];
|
|
25197
25227
|
}
|
|
25198
|
-
async function
|
|
25199
|
-
let { childRecord: t, query: n } = e, r =
|
|
25228
|
+
async function Re(e) {
|
|
25229
|
+
let { childRecord: t, query: n } = e, r = Me.get(t.tagName);
|
|
25200
25230
|
if (!r?.length) return [];
|
|
25201
25231
|
let i = [];
|
|
25202
25232
|
for (let e of r) {
|
|
25203
|
-
let r = await
|
|
25233
|
+
let r = await ze({
|
|
25204
25234
|
childRecord: t,
|
|
25205
25235
|
pair: e,
|
|
25206
25236
|
query: n
|
|
@@ -25209,16 +25239,16 @@ async function Me(e) {
|
|
|
25209
25239
|
}
|
|
25210
25240
|
return i;
|
|
25211
25241
|
}
|
|
25212
|
-
async function
|
|
25242
|
+
async function ze(e) {
|
|
25213
25243
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
25214
25244
|
if (!i) return null;
|
|
25215
|
-
let a = await
|
|
25245
|
+
let a = await Be({
|
|
25216
25246
|
uuidValue: i,
|
|
25217
25247
|
targetTagNames: n.targetTagNames,
|
|
25218
25248
|
query: r
|
|
25219
25249
|
});
|
|
25220
25250
|
if (!a) return null;
|
|
25221
|
-
let o = await
|
|
25251
|
+
let o = await A(r, {
|
|
25222
25252
|
reference: {
|
|
25223
25253
|
tagName: t.tagName,
|
|
25224
25254
|
id: t.id
|
|
@@ -25242,7 +25272,7 @@ async function Ne(e) {
|
|
|
25242
25272
|
}
|
|
25243
25273
|
};
|
|
25244
25274
|
}
|
|
25245
|
-
async function
|
|
25275
|
+
async function Be(e) {
|
|
25246
25276
|
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
25247
25277
|
for (let e of r) {
|
|
25248
25278
|
if (!n(e, U)) continue;
|
|
@@ -25254,17 +25284,17 @@ async function Pe(e) {
|
|
|
25254
25284
|
}
|
|
25255
25285
|
return null;
|
|
25256
25286
|
}
|
|
25257
|
-
async function
|
|
25287
|
+
async function Ve(e) {
|
|
25258
25288
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25259
25289
|
if (!r) return [];
|
|
25260
|
-
let i =
|
|
25290
|
+
let i = R(t.tagName);
|
|
25261
25291
|
if (i.length === 0) return [];
|
|
25262
25292
|
let a = {
|
|
25263
25293
|
tagName: t.tagName,
|
|
25264
25294
|
id: t.id
|
|
25265
25295
|
}, o = [];
|
|
25266
25296
|
for (let e of i) {
|
|
25267
|
-
let t = await
|
|
25297
|
+
let t = await L({
|
|
25268
25298
|
uuid: r,
|
|
25269
25299
|
entry: e,
|
|
25270
25300
|
target: a,
|
|
@@ -25276,12 +25306,12 @@ async function Fe(e) {
|
|
|
25276
25306
|
}
|
|
25277
25307
|
//#endregion
|
|
25278
25308
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
25279
|
-
async function
|
|
25280
|
-
let { childRecord: t, parentRecord: n, query: r } = e, i = await
|
|
25309
|
+
async function He(e) {
|
|
25310
|
+
let { childRecord: t, parentRecord: n, query: r } = e, i = await h({
|
|
25281
25311
|
childRecord: t,
|
|
25282
25312
|
parentRecord: n,
|
|
25283
25313
|
query: r
|
|
25284
|
-
}), a = await
|
|
25314
|
+
}), a = await Le({
|
|
25285
25315
|
childRecord: t,
|
|
25286
25316
|
query: r
|
|
25287
25317
|
});
|
|
@@ -25289,12 +25319,12 @@ async function Ie(e) {
|
|
|
25289
25319
|
}
|
|
25290
25320
|
//#endregion
|
|
25291
25321
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
25292
|
-
async function
|
|
25293
|
-
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await
|
|
25322
|
+
async function Ue(e) {
|
|
25323
|
+
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await We(t, n);
|
|
25294
25324
|
if (r.size === 0) return [];
|
|
25295
25325
|
let a = [];
|
|
25296
25326
|
for (let { target: e } of t) {
|
|
25297
|
-
let t = await
|
|
25327
|
+
let t = await Ke({
|
|
25298
25328
|
target: e,
|
|
25299
25329
|
uuidMap: r,
|
|
25300
25330
|
uuidToRef: i,
|
|
@@ -25304,9 +25334,9 @@ async function Le(e) {
|
|
|
25304
25334
|
}
|
|
25305
25335
|
return a;
|
|
25306
25336
|
}
|
|
25307
|
-
async function
|
|
25337
|
+
async function We(e, t) {
|
|
25308
25338
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
25309
|
-
for (let { source: i, target: a } of e) await
|
|
25339
|
+
for (let { source: i, target: a } of e) await Ge({
|
|
25310
25340
|
source: i,
|
|
25311
25341
|
target: a,
|
|
25312
25342
|
query: t,
|
|
@@ -25318,7 +25348,7 @@ async function Re(e, t) {
|
|
|
25318
25348
|
uuidToRef: r
|
|
25319
25349
|
};
|
|
25320
25350
|
}
|
|
25321
|
-
async function
|
|
25351
|
+
async function Ge(e) {
|
|
25322
25352
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
25323
25353
|
if (!o) return;
|
|
25324
25354
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -25327,14 +25357,14 @@ async function ze(e) {
|
|
|
25327
25357
|
id: o.id
|
|
25328
25358
|
}));
|
|
25329
25359
|
}
|
|
25330
|
-
async function
|
|
25360
|
+
async function Ke(e) {
|
|
25331
25361
|
let { target: t, uuidMap: n, uuidToRef: r, query: a } = e, o = t.tagName;
|
|
25332
|
-
if (!(o in
|
|
25362
|
+
if (!(o in P)) return null;
|
|
25333
25363
|
let s = await a.getRecord(t);
|
|
25334
25364
|
if (!s) return null;
|
|
25335
|
-
let c =
|
|
25365
|
+
let c = P[o], l = [...s.attributes], u = !1;
|
|
25336
25366
|
for (let e of c) {
|
|
25337
|
-
let t = await
|
|
25367
|
+
let t = await qe({
|
|
25338
25368
|
pair: e,
|
|
25339
25369
|
tagName: o,
|
|
25340
25370
|
refId: s.id,
|
|
@@ -25354,14 +25384,14 @@ async function Be(e) {
|
|
|
25354
25384
|
})
|
|
25355
25385
|
} : null;
|
|
25356
25386
|
}
|
|
25357
|
-
async function
|
|
25387
|
+
async function qe(e) {
|
|
25358
25388
|
let { pair: t, tagName: n, refId: r, uuidMap: i, uuidToRef: a, query: o } = e, s = [...e.updatedAttributes], c = s.find((e) => e.name === t.attribute.uuid)?.value;
|
|
25359
25389
|
if (!c) return null;
|
|
25360
25390
|
let l = i.get(c);
|
|
25361
25391
|
if (!l) return null;
|
|
25362
|
-
let u = !1, d =
|
|
25392
|
+
let u = !1, d = Je(s, t.attribute.uuid, c, l);
|
|
25363
25393
|
d && (s = d, u = !0);
|
|
25364
|
-
let f = await
|
|
25394
|
+
let f = await Ye({
|
|
25365
25395
|
attributes: s,
|
|
25366
25396
|
pathAttrName: t.attribute.path,
|
|
25367
25397
|
newUuid: l,
|
|
@@ -25372,16 +25402,16 @@ async function Ve(e) {
|
|
|
25372
25402
|
});
|
|
25373
25403
|
return f && (s = f, u = !0), u ? s : null;
|
|
25374
25404
|
}
|
|
25375
|
-
function
|
|
25405
|
+
function Je(e, t, n, r) {
|
|
25376
25406
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
25377
25407
|
...e,
|
|
25378
25408
|
value: r
|
|
25379
25409
|
} : e);
|
|
25380
25410
|
}
|
|
25381
|
-
async function
|
|
25411
|
+
async function Ye(e) {
|
|
25382
25412
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
25383
25413
|
if (!c) return null;
|
|
25384
|
-
let l = await
|
|
25414
|
+
let l = await I.query.buildReferencePath(s, {
|
|
25385
25415
|
reference: {
|
|
25386
25416
|
tagName: a,
|
|
25387
25417
|
id: o
|
|
@@ -25398,12 +25428,12 @@ async function Ue(e) {
|
|
|
25398
25428
|
}
|
|
25399
25429
|
//#endregion
|
|
25400
25430
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
25401
|
-
async function
|
|
25402
|
-
return
|
|
25431
|
+
async function Xe(e) {
|
|
25432
|
+
return Ue(e);
|
|
25403
25433
|
}
|
|
25404
25434
|
//#endregion
|
|
25405
25435
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
25406
|
-
function
|
|
25436
|
+
function Ze(e) {
|
|
25407
25437
|
let { record: t } = e, { tagName: n, attributes: r } = t, i = U.definition[n];
|
|
25408
25438
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
25409
25439
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
@@ -25418,20 +25448,20 @@ function Ge(e) {
|
|
|
25418
25448
|
}
|
|
25419
25449
|
//#endregion
|
|
25420
25450
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
25421
|
-
function
|
|
25422
|
-
return
|
|
25451
|
+
function Qe(e) {
|
|
25452
|
+
return Ze(e);
|
|
25423
25453
|
}
|
|
25424
25454
|
//#endregion
|
|
25425
25455
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
25426
|
-
async function
|
|
25456
|
+
async function $e(e) {
|
|
25427
25457
|
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
25428
25458
|
if (a) {
|
|
25429
|
-
let e =
|
|
25459
|
+
let e = R(n.tagName), t = {
|
|
25430
25460
|
tagName: n.tagName,
|
|
25431
25461
|
id: n.id
|
|
25432
25462
|
};
|
|
25433
25463
|
for (let n of e) {
|
|
25434
|
-
let e = await
|
|
25464
|
+
let e = await L({
|
|
25435
25465
|
uuid: a,
|
|
25436
25466
|
entry: n,
|
|
25437
25467
|
target: t,
|
|
@@ -25440,8 +25470,8 @@ async function qe(e) {
|
|
|
25440
25470
|
i.push(...e);
|
|
25441
25471
|
}
|
|
25442
25472
|
}
|
|
25443
|
-
if (
|
|
25444
|
-
let e = await
|
|
25473
|
+
if (et(t, n)) {
|
|
25474
|
+
let e = await tt({
|
|
25445
25475
|
newRecord: n,
|
|
25446
25476
|
query: r
|
|
25447
25477
|
});
|
|
@@ -25449,11 +25479,11 @@ async function qe(e) {
|
|
|
25449
25479
|
}
|
|
25450
25480
|
return i;
|
|
25451
25481
|
}
|
|
25452
|
-
function
|
|
25453
|
-
for (let n of
|
|
25482
|
+
function et(e, t) {
|
|
25483
|
+
for (let n of S) if (e.attributes.find((e) => e.name === n)?.value !== t.attributes.find((e) => e.name === n)?.value) return !0;
|
|
25454
25484
|
return !1;
|
|
25455
25485
|
}
|
|
25456
|
-
async function
|
|
25486
|
+
async function tt(e) {
|
|
25457
25487
|
let { newRecord: t, query: n } = e, r = {
|
|
25458
25488
|
tagName: t.tagName,
|
|
25459
25489
|
id: t.id
|
|
@@ -25462,14 +25492,14 @@ async function Ye(e) {
|
|
|
25462
25492
|
if (r.id === t.id) continue;
|
|
25463
25493
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
25464
25494
|
if (!e) continue;
|
|
25465
|
-
let i =
|
|
25495
|
+
let i = R(r.tagName);
|
|
25466
25496
|
if (i.length === 0) continue;
|
|
25467
25497
|
let o = {
|
|
25468
25498
|
tagName: r.tagName,
|
|
25469
25499
|
id: r.id
|
|
25470
25500
|
};
|
|
25471
25501
|
for (let t of i) {
|
|
25472
|
-
let r = await
|
|
25502
|
+
let r = await L({
|
|
25473
25503
|
uuid: e,
|
|
25474
25504
|
entry: t,
|
|
25475
25505
|
target: o,
|
|
@@ -25482,12 +25512,12 @@ async function Ye(e) {
|
|
|
25482
25512
|
}
|
|
25483
25513
|
//#endregion
|
|
25484
25514
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
25485
|
-
async function
|
|
25486
|
-
return
|
|
25515
|
+
async function nt(e) {
|
|
25516
|
+
return $e(e);
|
|
25487
25517
|
}
|
|
25488
25518
|
//#endregion
|
|
25489
25519
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
25490
|
-
function
|
|
25520
|
+
function rt(e) {
|
|
25491
25521
|
let { record: t } = e, n = !0;
|
|
25492
25522
|
t.tagName === "Private" && !t.tree.length && (n = !1);
|
|
25493
25523
|
let r = t.attributes.filter((e) => e.name !== "uuid");
|
|
@@ -25501,17 +25531,17 @@ function Ze(e) {
|
|
|
25501
25531
|
}
|
|
25502
25532
|
//#endregion
|
|
25503
25533
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
25504
|
-
async function
|
|
25534
|
+
async function it(e) {
|
|
25505
25535
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
25506
|
-
if (await
|
|
25536
|
+
if (await z({
|
|
25507
25537
|
record: t,
|
|
25508
25538
|
query: n,
|
|
25509
25539
|
ids: r,
|
|
25510
25540
|
uuids: i
|
|
25511
25541
|
}), i.size === 0) return [];
|
|
25512
|
-
let a = [], o = Object.keys(
|
|
25542
|
+
let a = [], o = Object.keys(P);
|
|
25513
25543
|
for (let e of o) {
|
|
25514
|
-
let t = await
|
|
25544
|
+
let t = await at({
|
|
25515
25545
|
refTagName: e,
|
|
25516
25546
|
subtreeIds: r,
|
|
25517
25547
|
subtreeUuids: i,
|
|
@@ -25521,11 +25551,11 @@ async function Qe(e) {
|
|
|
25521
25551
|
}
|
|
25522
25552
|
return a;
|
|
25523
25553
|
}
|
|
25524
|
-
async function
|
|
25525
|
-
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a =
|
|
25554
|
+
async function at(e) {
|
|
25555
|
+
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = P[t], o = await i.getRecordsByTagName(t), s = [];
|
|
25526
25556
|
for (let e of o) {
|
|
25527
25557
|
if (n.has(e.id)) continue;
|
|
25528
|
-
let o = await
|
|
25558
|
+
let o = await ot({
|
|
25529
25559
|
refTagName: t,
|
|
25530
25560
|
refRecord: e,
|
|
25531
25561
|
refPairs: a,
|
|
@@ -25536,15 +25566,15 @@ async function $e(e) {
|
|
|
25536
25566
|
}
|
|
25537
25567
|
return s;
|
|
25538
25568
|
}
|
|
25539
|
-
async function
|
|
25540
|
-
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o =
|
|
25569
|
+
async function ot(e) {
|
|
25570
|
+
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o = st({
|
|
25541
25571
|
refPairs: r,
|
|
25542
25572
|
refRecord: n,
|
|
25543
25573
|
subtreeUuids: i
|
|
25544
25574
|
});
|
|
25545
|
-
return o.size === 0 ? [] :
|
|
25575
|
+
return o.size === 0 ? [] : F.has(t) ? [ct(n, o)] : lt(n, a);
|
|
25546
25576
|
}
|
|
25547
|
-
function
|
|
25577
|
+
function st(e) {
|
|
25548
25578
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
25549
25579
|
for (let e of t) {
|
|
25550
25580
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -25555,7 +25585,7 @@ function tt(e) {
|
|
|
25555
25585
|
}
|
|
25556
25586
|
return i;
|
|
25557
25587
|
}
|
|
25558
|
-
function
|
|
25588
|
+
function ct(e, t) {
|
|
25559
25589
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
25560
25590
|
return {
|
|
25561
25591
|
status: "updated",
|
|
@@ -25566,7 +25596,7 @@ function nt(e, t) {
|
|
|
25566
25596
|
})
|
|
25567
25597
|
};
|
|
25568
25598
|
}
|
|
25569
|
-
async function
|
|
25599
|
+
async function lt(e, t) {
|
|
25570
25600
|
let n = [{
|
|
25571
25601
|
status: "deleted",
|
|
25572
25602
|
oldRecord: i(e),
|
|
@@ -25588,14 +25618,14 @@ async function rt(e, t) {
|
|
|
25588
25618
|
}
|
|
25589
25619
|
return n;
|
|
25590
25620
|
}
|
|
25591
|
-
async function
|
|
25621
|
+
async function z(e) {
|
|
25592
25622
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
25593
25623
|
r.add(t.id);
|
|
25594
25624
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25595
25625
|
a && i.add(a);
|
|
25596
25626
|
for (let e of t.children) {
|
|
25597
25627
|
let t = await n.getRecord(e);
|
|
25598
|
-
t && await
|
|
25628
|
+
t && await z({
|
|
25599
25629
|
record: t,
|
|
25600
25630
|
query: n,
|
|
25601
25631
|
ids: r,
|
|
@@ -25605,31 +25635,31 @@ async function B(e) {
|
|
|
25605
25635
|
}
|
|
25606
25636
|
//#endregion
|
|
25607
25637
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
25608
|
-
async function
|
|
25609
|
-
return
|
|
25638
|
+
async function ut(e) {
|
|
25639
|
+
return it(e);
|
|
25610
25640
|
}
|
|
25611
25641
|
//#endregion
|
|
25612
25642
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
25613
|
-
function
|
|
25643
|
+
function dt() {
|
|
25614
25644
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
25615
25645
|
return {
|
|
25616
25646
|
beforeImportRecord: (r) => {
|
|
25617
|
-
let { record: i, ancestry: a } = r, { tagName: o } = i, s =
|
|
25618
|
-
if (s &&
|
|
25619
|
-
let t =
|
|
25647
|
+
let { record: i, ancestry: a } = r, { tagName: o } = i, s = ht(i);
|
|
25648
|
+
if (s && mt.has(o)) {
|
|
25649
|
+
let t = ie({
|
|
25620
25650
|
record: i,
|
|
25621
25651
|
ancestry: a
|
|
25622
25652
|
});
|
|
25623
25653
|
t && e.set(t.path, s);
|
|
25624
25654
|
}
|
|
25625
|
-
if (!
|
|
25626
|
-
let c =
|
|
25655
|
+
if (!pt.has(o)) return;
|
|
25656
|
+
let c = P[o];
|
|
25627
25657
|
for (let e of c) {
|
|
25628
25658
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
25629
25659
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
25630
|
-
let s =
|
|
25660
|
+
let s = k(e.resolution, e.attribute.path, r, a);
|
|
25631
25661
|
if (!s) {
|
|
25632
|
-
e.resolution ===
|
|
25662
|
+
e.resolution === N.unsupported && n.push({
|
|
25633
25663
|
type: "unsupported-xpath-reference",
|
|
25634
25664
|
recordId: i.id,
|
|
25635
25665
|
details: {
|
|
@@ -25683,9 +25713,9 @@ function at() {
|
|
|
25683
25713
|
}
|
|
25684
25714
|
};
|
|
25685
25715
|
}
|
|
25686
|
-
var
|
|
25687
|
-
function
|
|
25688
|
-
if (!
|
|
25716
|
+
var ft = new Set(Object.entries(p).filter(([, e]) => "uuid" in e).map(([e]) => e)), pt = new Set(Object.keys(P)), mt = new Set(Object.values(P).flatMap((e) => e.flatMap((e) => e.target)));
|
|
25717
|
+
function ht(e) {
|
|
25718
|
+
if (!ft.has(e.tagName)) return;
|
|
25689
25719
|
let t = e.attributes.find((e) => e.name === "uuid");
|
|
25690
25720
|
if (t) return t.value;
|
|
25691
25721
|
let n = crypto.randomUUID();
|
|
@@ -25696,14 +25726,14 @@ function lt(e) {
|
|
|
25696
25726
|
}
|
|
25697
25727
|
//#endregion
|
|
25698
25728
|
//#region src/v2019C1/hooks/index.ts
|
|
25699
|
-
var
|
|
25700
|
-
beforeClone:
|
|
25701
|
-
afterStandardizedRecord:
|
|
25702
|
-
afterCreated:
|
|
25703
|
-
afterDeepClone:
|
|
25704
|
-
afterUpdated:
|
|
25705
|
-
beforeDelete:
|
|
25706
|
-
},
|
|
25729
|
+
var gt = {
|
|
25730
|
+
beforeClone: rt,
|
|
25731
|
+
afterStandardizedRecord: Qe,
|
|
25732
|
+
afterCreated: He,
|
|
25733
|
+
afterDeepClone: Xe,
|
|
25734
|
+
afterUpdated: nt,
|
|
25735
|
+
beforeDelete: ut
|
|
25736
|
+
}, B = {
|
|
25707
25737
|
supportedFileExtensions: [
|
|
25708
25738
|
".fsd",
|
|
25709
25739
|
".asd",
|
|
@@ -25713,8 +25743,8 @@ var ut = {
|
|
|
25713
25743
|
".icd",
|
|
25714
25744
|
".xml"
|
|
25715
25745
|
],
|
|
25716
|
-
hooks:
|
|
25717
|
-
},
|
|
25746
|
+
hooks: dt()
|
|
25747
|
+
}, V = {
|
|
25718
25748
|
recordSchema: {
|
|
25719
25749
|
primaryKey: "id",
|
|
25720
25750
|
indexes: [
|
|
@@ -25732,7 +25762,7 @@ var ut = {
|
|
|
25732
25762
|
},
|
|
25733
25763
|
additionalTables: { attachedFiles: { schema: "id, filename, file" } }
|
|
25734
25764
|
}
|
|
25735
|
-
},
|
|
25765
|
+
}, H = {
|
|
25736
25766
|
default: {
|
|
25737
25767
|
uri: "http://www.iec.ch/61850/2003/SCL",
|
|
25738
25768
|
prefix: ""
|
|
@@ -25744,22 +25774,22 @@ var ut = {
|
|
|
25744
25774
|
xsi: e
|
|
25745
25775
|
}, U = {
|
|
25746
25776
|
rootElementName: "SCL",
|
|
25747
|
-
singletonElements:
|
|
25777
|
+
singletonElements: ee,
|
|
25748
25778
|
transparentElements: ["Private"],
|
|
25749
25779
|
elements: c,
|
|
25750
|
-
namespaces:
|
|
25751
|
-
attributes:
|
|
25780
|
+
namespaces: H,
|
|
25781
|
+
attributes: p,
|
|
25752
25782
|
children: l,
|
|
25753
25783
|
parents: u,
|
|
25754
25784
|
descendants: d,
|
|
25755
25785
|
ancestors: f,
|
|
25756
|
-
database:
|
|
25757
|
-
io:
|
|
25758
|
-
definition:
|
|
25786
|
+
database: V,
|
|
25787
|
+
io: B,
|
|
25788
|
+
definition: m
|
|
25759
25789
|
};
|
|
25760
25790
|
//#endregion
|
|
25761
25791
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.ts
|
|
25762
|
-
async function
|
|
25792
|
+
async function _t(e) {
|
|
25763
25793
|
let t = await e.getRecordsByTagName("LNode");
|
|
25764
25794
|
for (let n of t) {
|
|
25765
25795
|
let t = await e.getAttribute(n, { name: "iedName" });
|
|
@@ -25768,10 +25798,10 @@ async function ft(e) {
|
|
|
25768
25798
|
tagName: "IED",
|
|
25769
25799
|
attributes: { name: t }
|
|
25770
25800
|
});
|
|
25771
|
-
r || await
|
|
25801
|
+
r || await vt(e, n);
|
|
25772
25802
|
}
|
|
25773
25803
|
}
|
|
25774
|
-
async function
|
|
25804
|
+
async function vt(e, t) {
|
|
25775
25805
|
let n = await e.getChild(t, "LNodeSpecNaming");
|
|
25776
25806
|
if (n) {
|
|
25777
25807
|
let r = await e.getAttribute(n, { name: "sLnClass" }), i = await e.getAttribute(n, { name: "sLnInst" }), a = await e.getAttribute(n, { name: "sPrefix" });
|
|
@@ -25799,8 +25829,8 @@ async function pt(e, t) {
|
|
|
25799
25829
|
}
|
|
25800
25830
|
//#endregion
|
|
25801
25831
|
//#region src/v2019C1/extensions/clean-up/transaction/prune-empty-containers.ts
|
|
25802
|
-
async function
|
|
25803
|
-
let t = [...Object.values(
|
|
25832
|
+
async function yt(e) {
|
|
25833
|
+
let t = [...Object.values(Ne).flat(), "Private"];
|
|
25804
25834
|
for (let n of t) {
|
|
25805
25835
|
let t = await e.getRecordsByTagName(n);
|
|
25806
25836
|
for (let n of t) n.children.length === 0 && await e.delete(n);
|
|
@@ -25808,27 +25838,27 @@ async function mt(e) {
|
|
|
25808
25838
|
}
|
|
25809
25839
|
//#endregion
|
|
25810
25840
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-uuid-refs.ts
|
|
25811
|
-
async function
|
|
25812
|
-
let t = Object.keys(
|
|
25841
|
+
async function bt(e) {
|
|
25842
|
+
let t = Object.keys(P);
|
|
25813
25843
|
for (let n of t) {
|
|
25814
|
-
let t =
|
|
25844
|
+
let t = P[n], r = await e.getRecordsByTagName(n);
|
|
25815
25845
|
for (let i of r) {
|
|
25816
25846
|
let r = !1, a = !1, o = {};
|
|
25817
25847
|
for (let n of t) {
|
|
25818
25848
|
let t = await e.getAttribute(i, { name: n.attribute.uuid });
|
|
25819
|
-
if (t) if (r = !0, await
|
|
25849
|
+
if (t) if (r = !0, await xt(e, t, n.target)) a = !0;
|
|
25820
25850
|
else {
|
|
25821
25851
|
o[n.attribute.uuid] = void 0, o[n.attribute.path] = void 0;
|
|
25822
25852
|
for (let e of n.companions) o[e.name] = void 0;
|
|
25823
25853
|
}
|
|
25824
25854
|
}
|
|
25825
25855
|
Object.keys(o).length > 0 && await e.update(i, { attributes: o });
|
|
25826
|
-
let s =
|
|
25856
|
+
let s = F.has(n);
|
|
25827
25857
|
r && !a && !s && await e.delete(i);
|
|
25828
25858
|
}
|
|
25829
25859
|
}
|
|
25830
25860
|
}
|
|
25831
|
-
async function
|
|
25861
|
+
async function xt(e, t, n) {
|
|
25832
25862
|
for (let r of n) {
|
|
25833
25863
|
let [n] = await e.findByAttributes({
|
|
25834
25864
|
tagName: r,
|
|
@@ -25841,13 +25871,13 @@ async function gt(e, t, n) {
|
|
|
25841
25871
|
//#endregion
|
|
25842
25872
|
//#region src/v2019C1/extensions/clean-up/index.ts
|
|
25843
25873
|
var W = { transaction: /* @__PURE__ */ s({
|
|
25844
|
-
orphanUuidRefs: () =>
|
|
25845
|
-
pruneEmptyContainers: () =>
|
|
25846
|
-
resetLNode: () =>
|
|
25874
|
+
orphanUuidRefs: () => bt,
|
|
25875
|
+
pruneEmptyContainers: () => yt,
|
|
25876
|
+
resetLNode: () => _t
|
|
25847
25877
|
}) };
|
|
25848
25878
|
//#endregion
|
|
25849
25879
|
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
25850
|
-
async function
|
|
25880
|
+
async function G(e, n) {
|
|
25851
25881
|
let { records: r } = n, i = {
|
|
25852
25882
|
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
25853
25883
|
doTypes: /* @__PURE__ */ new Map(),
|
|
@@ -25864,7 +25894,7 @@ async function _t(e, n) {
|
|
|
25864
25894
|
if (a(o, {
|
|
25865
25895
|
key: "ELEMENT_NOT_FOUND",
|
|
25866
25896
|
detail: `LNodeType not found for lnType="${r}"`
|
|
25867
|
-
}), !
|
|
25897
|
+
}), !K(i.lnodeTypes, r, o)) continue;
|
|
25868
25898
|
let s = o.children.filter((e) => t(e, "DO")), c = await e.getRecords(s);
|
|
25869
25899
|
for (let t of c) {
|
|
25870
25900
|
if (!t) continue;
|
|
@@ -25874,7 +25904,7 @@ async function _t(e, n) {
|
|
|
25874
25904
|
tagName: "DOType",
|
|
25875
25905
|
attributes: { id: n }
|
|
25876
25906
|
});
|
|
25877
|
-
r &&
|
|
25907
|
+
r && K(i.doTypes, n, r) && await q({
|
|
25878
25908
|
query: e,
|
|
25879
25909
|
parent: r,
|
|
25880
25910
|
dataModelMap: i
|
|
@@ -25888,10 +25918,10 @@ async function _t(e, n) {
|
|
|
25888
25918
|
enumTypes: Array.from(i.enumTypes.values())
|
|
25889
25919
|
};
|
|
25890
25920
|
}
|
|
25891
|
-
function
|
|
25921
|
+
function K(e, t, n) {
|
|
25892
25922
|
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
25893
25923
|
}
|
|
25894
|
-
async function
|
|
25924
|
+
async function q(e) {
|
|
25895
25925
|
let { query: n, parent: r, dataModelMap: i } = e, a = r.tagName === "DOType" ? await n.getRecords(r.children.filter((e) => t(e, "DA"))) : await n.getRecords(r.children.filter((e) => t(e, "BDA")));
|
|
25896
25926
|
for (let e of a) {
|
|
25897
25927
|
if (!e) continue;
|
|
@@ -25902,13 +25932,13 @@ async function K(e) {
|
|
|
25902
25932
|
tagName: "EnumType",
|
|
25903
25933
|
attributes: { id: r }
|
|
25904
25934
|
});
|
|
25905
|
-
e &&
|
|
25935
|
+
e && K(i.enumTypes, r, e);
|
|
25906
25936
|
} else if (t === "Struct") {
|
|
25907
25937
|
let [e] = await n.findByAttributes({
|
|
25908
25938
|
tagName: "DAType",
|
|
25909
25939
|
attributes: { id: r }
|
|
25910
25940
|
});
|
|
25911
|
-
e &&
|
|
25941
|
+
e && K(i.daTypes, r, e) && await q({
|
|
25912
25942
|
query: n,
|
|
25913
25943
|
parent: e,
|
|
25914
25944
|
dataModelMap: i
|
|
@@ -25925,7 +25955,7 @@ async function K(e) {
|
|
|
25925
25955
|
tagName: "DOType",
|
|
25926
25956
|
attributes: { id: t }
|
|
25927
25957
|
});
|
|
25928
|
-
r &&
|
|
25958
|
+
r && K(i.doTypes, t, r) && await q({
|
|
25929
25959
|
query: n,
|
|
25930
25960
|
parent: r,
|
|
25931
25961
|
dataModelMap: i
|
|
@@ -25935,11 +25965,11 @@ async function K(e) {
|
|
|
25935
25965
|
}
|
|
25936
25966
|
//#endregion
|
|
25937
25967
|
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
25938
|
-
var
|
|
25968
|
+
var St = /* @__PURE__ */ s({ resolve: () => G });
|
|
25939
25969
|
//#endregion
|
|
25940
25970
|
//#region src/v2019C1/extensions/data-model/transaction/extract.ts
|
|
25941
|
-
async function
|
|
25942
|
-
let { sourceQuery: n, records: r } = t, i =
|
|
25971
|
+
async function Ct(e, t) {
|
|
25972
|
+
let { sourceQuery: n, records: r } = t, i = wt(await G(n, { records: r })), a = await e.getRoot(), o = await e.ensureChild(a, {
|
|
25943
25973
|
tagName: "DataTypeTemplates",
|
|
25944
25974
|
attributes: {}
|
|
25945
25975
|
});
|
|
@@ -25955,7 +25985,7 @@ async function yt(e, t) {
|
|
|
25955
25985
|
a && await e.deepClone(o, a);
|
|
25956
25986
|
}
|
|
25957
25987
|
}
|
|
25958
|
-
function
|
|
25988
|
+
function wt(e) {
|
|
25959
25989
|
return [
|
|
25960
25990
|
...e.lnodeTypes,
|
|
25961
25991
|
...e.doTypes,
|
|
@@ -25965,13 +25995,13 @@ function bt(e) {
|
|
|
25965
25995
|
}
|
|
25966
25996
|
//#endregion
|
|
25967
25997
|
//#region src/v2019C1/extensions/data-model/index.ts
|
|
25968
|
-
var
|
|
25969
|
-
query:
|
|
25970
|
-
transaction: /* @__PURE__ */ s({ extract: () =>
|
|
25998
|
+
var Tt = {
|
|
25999
|
+
query: St,
|
|
26000
|
+
transaction: /* @__PURE__ */ s({ extract: () => Ct })
|
|
25971
26001
|
};
|
|
25972
26002
|
//#endregion
|
|
25973
26003
|
//#region src/v2019C1/extensions/history/query/get-sorted-hitem.ts
|
|
25974
|
-
async function
|
|
26004
|
+
async function Et(e) {
|
|
25975
26005
|
let t = await e.getRecord({ tagName: "History" });
|
|
25976
26006
|
if (!t) return [];
|
|
25977
26007
|
let { Hitem: n = [] } = await e.findDescendants(t, { collect: "Hitem" });
|
|
@@ -25985,19 +26015,19 @@ async function St(e) {
|
|
|
25985
26015
|
}
|
|
25986
26016
|
//#endregion
|
|
25987
26017
|
//#region src/v2019C1/extensions/history/query/get-latest-hitem.ts
|
|
25988
|
-
async function
|
|
25989
|
-
return (await
|
|
26018
|
+
async function Dt(e) {
|
|
26019
|
+
return (await Et(e)).at(-1);
|
|
25990
26020
|
}
|
|
25991
26021
|
//#endregion
|
|
25992
26022
|
//#region src/v2019C1/extensions/history/query/index.ts
|
|
25993
|
-
var
|
|
25994
|
-
getLatestHitem: () =>
|
|
25995
|
-
getSortedHitems: () =>
|
|
26023
|
+
var Ot = /* @__PURE__ */ s({
|
|
26024
|
+
getLatestHitem: () => Dt,
|
|
26025
|
+
getSortedHitems: () => Et
|
|
25996
26026
|
});
|
|
25997
26027
|
//#endregion
|
|
25998
26028
|
//#region src/v2019C1/extensions/history/transaction/add-entry.ts
|
|
25999
|
-
async function
|
|
26000
|
-
let { filename: n, header: r, item: i } = t, { id: a, fileType: o, nameStructure: s, version: c, tool: l } = r, { who: u, what: d, why: f } = i,
|
|
26029
|
+
async function kt(e, t) {
|
|
26030
|
+
let { filename: n, header: r, item: i } = t, { id: a, fileType: o, nameStructure: s, version: c, tool: l } = r, { who: u, what: d, why: f } = i, ee = await e.getRoot(), p = await e.getRecord({ tagName: "Header" }) ?? await e.addChild(ee, {
|
|
26001
26031
|
tagName: "Header",
|
|
26002
26032
|
attributes: {
|
|
26003
26033
|
id: a ?? n.replace(/\.[^.]+$/, "").toLowerCase().replace(/\s+/g, "_"),
|
|
@@ -26008,36 +26038,36 @@ async function Tt(e, t) {
|
|
|
26008
26038
|
revision: "1",
|
|
26009
26039
|
uuid: crypto.randomUUID()
|
|
26010
26040
|
}
|
|
26011
|
-
}),
|
|
26041
|
+
}), m = await e.getRecord({ tagName: "History" }) ?? await e.addChild(p, {
|
|
26012
26042
|
tagName: "History",
|
|
26013
26043
|
attributes: {}
|
|
26014
|
-
}),
|
|
26015
|
-
await e.update(
|
|
26016
|
-
version:
|
|
26017
|
-
revision:
|
|
26044
|
+
}), h = await Dt(e), g = h?.attributes.find((e) => e.name === "version")?.value, _ = h?.attributes.find((e) => e.name === "revision")?.value, v = c === "keep" ? g ?? "0" : g ? String(Number(g) + 1) : "0", y = _ ? String(Number(_) + 1) : "1";
|
|
26045
|
+
await e.update(p, { attributes: {
|
|
26046
|
+
version: v,
|
|
26047
|
+
revision: y
|
|
26018
26048
|
} });
|
|
26019
|
-
let
|
|
26020
|
-
await e.addChild(
|
|
26049
|
+
let b = /* @__PURE__ */ new Date(), x = b.toString().split(" "), te = b.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), S = `${x[0]} ${x[1]} ${x[2]} ${x[4]} ${te} ${x[3]}`;
|
|
26050
|
+
await e.addChild(m, {
|
|
26021
26051
|
tagName: "Hitem",
|
|
26022
26052
|
attributes: {
|
|
26023
|
-
version:
|
|
26024
|
-
revision:
|
|
26025
|
-
when:
|
|
26053
|
+
version: v,
|
|
26054
|
+
revision: y,
|
|
26055
|
+
when: S,
|
|
26026
26056
|
who: u,
|
|
26027
26057
|
what: d,
|
|
26028
26058
|
why: f
|
|
26029
26059
|
}
|
|
26030
|
-
}), await e.update(
|
|
26031
|
-
version:
|
|
26032
|
-
revision:
|
|
26060
|
+
}), await e.update(p, { attributes: {
|
|
26061
|
+
version: v,
|
|
26062
|
+
revision: y
|
|
26033
26063
|
} });
|
|
26034
26064
|
}
|
|
26035
26065
|
//#endregion
|
|
26036
26066
|
//#region src/v2019C1/extensions/history/index.ts
|
|
26037
|
-
var
|
|
26038
|
-
query:
|
|
26039
|
-
transaction: /* @__PURE__ */ s({ addEntry: () =>
|
|
26040
|
-
},
|
|
26067
|
+
var J = {
|
|
26068
|
+
query: Ot,
|
|
26069
|
+
transaction: /* @__PURE__ */ s({ addEntry: () => kt })
|
|
26070
|
+
}, At = {
|
|
26041
26071
|
LNode: {
|
|
26042
26072
|
compact: [
|
|
26043
26073
|
"prefix",
|
|
@@ -26124,13 +26154,13 @@ var q = {
|
|
|
26124
26154
|
};
|
|
26125
26155
|
//#endregion
|
|
26126
26156
|
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26127
|
-
async function
|
|
26157
|
+
async function jt(e, t, n = {}) {
|
|
26128
26158
|
let r = await e.getRecord(t);
|
|
26129
26159
|
if (!r) return n.withLabels ? {
|
|
26130
26160
|
title: "",
|
|
26131
26161
|
labels: {}
|
|
26132
26162
|
} : "";
|
|
26133
|
-
let i = r.tagName, a =
|
|
26163
|
+
let i = r.tagName, a = Mt({
|
|
26134
26164
|
tag: i,
|
|
26135
26165
|
mode: n.mode ?? "compact",
|
|
26136
26166
|
attributes: await e.any.getAttributes(r),
|
|
@@ -26138,24 +26168,24 @@ async function Dt(e, t, n = {}) {
|
|
|
26138
26168
|
});
|
|
26139
26169
|
return n.withLabels ? {
|
|
26140
26170
|
title: a,
|
|
26141
|
-
labels: await
|
|
26171
|
+
labels: await Nt(e, r)
|
|
26142
26172
|
} : a;
|
|
26143
26173
|
}
|
|
26144
|
-
function
|
|
26145
|
-
let { tag: t, mode: n, attributes: r, value: i } = e, a =
|
|
26174
|
+
function Mt(e) {
|
|
26175
|
+
let { tag: t, mode: n, attributes: r, value: i } = e, a = At[t];
|
|
26146
26176
|
if (a) {
|
|
26147
|
-
let e =
|
|
26177
|
+
let e = It(a, r, n);
|
|
26148
26178
|
if (e) return e;
|
|
26149
26179
|
}
|
|
26150
26180
|
let o = (i ?? "").trim();
|
|
26151
26181
|
if (o) return o;
|
|
26152
|
-
let s =
|
|
26182
|
+
let s = m[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
|
|
26153
26183
|
return c && r[c] ? r[c] : r.name || t;
|
|
26154
26184
|
}
|
|
26155
|
-
async function
|
|
26156
|
-
return
|
|
26185
|
+
async function Nt(e, t) {
|
|
26186
|
+
return Ft(await Pt(e, t));
|
|
26157
26187
|
}
|
|
26158
|
-
async function
|
|
26188
|
+
async function Pt(e, t) {
|
|
26159
26189
|
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26160
26190
|
for (let t of r) {
|
|
26161
26191
|
let r = await e.any.getChildren(t, "Label");
|
|
@@ -26170,26 +26200,26 @@ async function At(e, t) {
|
|
|
26170
26200
|
}
|
|
26171
26201
|
return n;
|
|
26172
26202
|
}
|
|
26173
|
-
function
|
|
26203
|
+
function Ft(e) {
|
|
26174
26204
|
let t = {};
|
|
26175
26205
|
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26176
26206
|
return t;
|
|
26177
26207
|
}
|
|
26178
|
-
function
|
|
26208
|
+
function It(e, t, n) {
|
|
26179
26209
|
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26180
|
-
if (typeof i == "string") return
|
|
26210
|
+
if (typeof i == "string") return Lt(i, t);
|
|
26181
26211
|
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26182
26212
|
return o.length > 0 ? o.join(a) : "";
|
|
26183
26213
|
}
|
|
26184
|
-
function
|
|
26214
|
+
function Lt(e, t) {
|
|
26185
26215
|
return e.replace(/\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g, (e, n) => t[n] ?? "").replace(/\[\]/g, "").replace(/\(\)/g, "").split("/").map((e) => e.split(".").filter((e) => e !== "").join(".")).filter((e) => e !== "").join("/");
|
|
26186
26216
|
}
|
|
26187
26217
|
//#endregion
|
|
26188
26218
|
//#region src/v2019C1/extensions/presentation/index.ts
|
|
26189
|
-
var
|
|
26219
|
+
var Rt = { query: /* @__PURE__ */ s({ extractElementTitle: () => jt }) };
|
|
26190
26220
|
//#endregion
|
|
26191
26221
|
//#region src/v2019C1/extensions/template/transaction/ensure-substation-structure.ts
|
|
26192
|
-
async function
|
|
26222
|
+
async function Y(e) {
|
|
26193
26223
|
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
26194
26224
|
tagName: "Substation",
|
|
26195
26225
|
attributes: { name: "TEMPLATE" }
|
|
@@ -26208,12 +26238,12 @@ async function J(e) {
|
|
|
26208
26238
|
}
|
|
26209
26239
|
//#endregion
|
|
26210
26240
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-utils.ts
|
|
26211
|
-
var
|
|
26241
|
+
var zt = {
|
|
26212
26242
|
scope: "tree",
|
|
26213
26243
|
attributes: ["templateUuid", "originUuid"]
|
|
26214
26244
|
};
|
|
26215
|
-
async function
|
|
26216
|
-
let { sourceQuery: n, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c =
|
|
26245
|
+
async function X(e, t) {
|
|
26246
|
+
let { sourceQuery: n, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = zt } = t, l = await n.getTree(i, { omit: o });
|
|
26217
26247
|
if (!l) return;
|
|
26218
26248
|
let u = s && l.tagName === s.from ? {
|
|
26219
26249
|
...l,
|
|
@@ -26226,16 +26256,16 @@ async function Y(e, t) {
|
|
|
26226
26256
|
}
|
|
26227
26257
|
//#endregion
|
|
26228
26258
|
//#region src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts
|
|
26229
|
-
async function
|
|
26259
|
+
async function Bt(e, t) {
|
|
26230
26260
|
let { sourceQuery: n, scopeRef: r } = t, { LNode: i = [] } = await n.findDescendants(r, { collect: "LNode" });
|
|
26231
|
-
i.length > 0 && await
|
|
26261
|
+
i.length > 0 && await Tt.transaction.extract(e, {
|
|
26232
26262
|
sourceQuery: n,
|
|
26233
26263
|
records: i
|
|
26234
26264
|
});
|
|
26235
26265
|
}
|
|
26236
26266
|
//#endregion
|
|
26237
26267
|
//#region src/v2019C1/extensions/template/transaction/shared/resolve-structure-ref.ts
|
|
26238
|
-
async function
|
|
26268
|
+
async function Z(e, t, n) {
|
|
26239
26269
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26240
26270
|
a(r, {
|
|
26241
26271
|
key: "ELEMENT_NOT_FOUND",
|
|
@@ -26249,9 +26279,9 @@ async function X(e, t, n) {
|
|
|
26249
26279
|
}
|
|
26250
26280
|
//#endregion
|
|
26251
26281
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-function.ts
|
|
26252
|
-
async function
|
|
26282
|
+
async function Vt(e, t) {
|
|
26253
26283
|
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t;
|
|
26254
|
-
await
|
|
26284
|
+
await X(e, {
|
|
26255
26285
|
sourceQuery: n,
|
|
26256
26286
|
ref: r,
|
|
26257
26287
|
targetParent: i,
|
|
@@ -26264,39 +26294,39 @@ async function Lt(e, t) {
|
|
|
26264
26294
|
scope: "root",
|
|
26265
26295
|
attributes: [...o]
|
|
26266
26296
|
} : !1
|
|
26267
|
-
}), await
|
|
26297
|
+
}), await Bt(e, {
|
|
26268
26298
|
sourceQuery: n,
|
|
26269
26299
|
scopeRef: r
|
|
26270
26300
|
});
|
|
26271
26301
|
}
|
|
26272
|
-
async function
|
|
26273
|
-
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await
|
|
26302
|
+
async function Ht(e, t) {
|
|
26303
|
+
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await Ut(n, r);
|
|
26274
26304
|
for (let t of o) {
|
|
26275
|
-
if (await
|
|
26305
|
+
if (await Gt(e, n, t)) continue;
|
|
26276
26306
|
let r = {
|
|
26277
26307
|
tagName: "FunctionCategory",
|
|
26278
26308
|
id: t
|
|
26279
26309
|
};
|
|
26280
|
-
await
|
|
26310
|
+
await X(e, {
|
|
26281
26311
|
sourceQuery: n,
|
|
26282
26312
|
ref: r,
|
|
26283
|
-
targetParent: await
|
|
26313
|
+
targetParent: await Z(n, r, i),
|
|
26284
26314
|
...a ? {} : { strip: !1 }
|
|
26285
26315
|
});
|
|
26286
26316
|
}
|
|
26287
26317
|
}
|
|
26288
|
-
async function
|
|
26289
|
-
let n = await
|
|
26318
|
+
async function Ut(e, t) {
|
|
26319
|
+
let n = await Wt(e, t), r = /* @__PURE__ */ new Set();
|
|
26290
26320
|
for (let { container: e } of n) e && r.add(e.id);
|
|
26291
26321
|
return r;
|
|
26292
26322
|
}
|
|
26293
|
-
async function
|
|
26294
|
-
let n = await
|
|
26323
|
+
async function Wt(e, t) {
|
|
26324
|
+
let n = await I.query.findRefsPointingTo(e, {
|
|
26295
26325
|
target: t,
|
|
26296
26326
|
containerTagName: "FunctionCategory"
|
|
26297
26327
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
26298
26328
|
for (let t of r) {
|
|
26299
|
-
let r = await
|
|
26329
|
+
let r = await I.query.findRefsPointingTo(e, {
|
|
26300
26330
|
target: {
|
|
26301
26331
|
tagName: "SubFunction",
|
|
26302
26332
|
id: t.id
|
|
@@ -26307,7 +26337,7 @@ async function Bt(e, t) {
|
|
|
26307
26337
|
}
|
|
26308
26338
|
return n;
|
|
26309
26339
|
}
|
|
26310
|
-
async function
|
|
26340
|
+
async function Gt(e, t, n) {
|
|
26311
26341
|
let r = await t.getRecord({
|
|
26312
26342
|
tagName: "FunctionCategory",
|
|
26313
26343
|
id: n
|
|
@@ -26323,8 +26353,8 @@ async function Vt(e, t, n) {
|
|
|
26323
26353
|
}
|
|
26324
26354
|
//#endregion
|
|
26325
26355
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-referenced.ts
|
|
26326
|
-
async function
|
|
26327
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a } = t, o =
|
|
26356
|
+
async function Q(e, t) {
|
|
26357
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a } = t, o = P[i][0].attribute.uuid, { [i]: s = [] } = await n.findDescendants(r, { collect: i }), c = /* @__PURE__ */ new Set();
|
|
26328
26358
|
for (let e of s) {
|
|
26329
26359
|
let t = e.attributes.find((e) => e.name === o)?.value;
|
|
26330
26360
|
t && c.add(t);
|
|
@@ -26347,23 +26377,23 @@ async function Z(e, t) {
|
|
|
26347
26377
|
}
|
|
26348
26378
|
return l;
|
|
26349
26379
|
}
|
|
26350
|
-
async function
|
|
26351
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await
|
|
26380
|
+
async function Kt(e, t) {
|
|
26381
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await Q(e, {
|
|
26352
26382
|
sourceQuery: n,
|
|
26353
26383
|
scopeRef: r,
|
|
26354
26384
|
refTagName: i,
|
|
26355
26385
|
targetTagName: a
|
|
26356
26386
|
});
|
|
26357
|
-
for (let t of c) await
|
|
26387
|
+
for (let t of c) await X(e, {
|
|
26358
26388
|
sourceQuery: n,
|
|
26359
26389
|
ref: t,
|
|
26360
26390
|
targetParent: o,
|
|
26361
26391
|
omit: s
|
|
26362
26392
|
});
|
|
26363
26393
|
}
|
|
26364
|
-
async function
|
|
26365
|
-
let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = d[r].filter((e) => e in
|
|
26366
|
-
for (let t of c) for (let r of
|
|
26394
|
+
async function qt(e, t) {
|
|
26395
|
+
let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = d[r].filter((e) => e in P && !o.has(e)), l = Kt;
|
|
26396
|
+
for (let t of c) for (let r of P[t]) for (let o of r.target) await l(e, {
|
|
26367
26397
|
sourceQuery: n,
|
|
26368
26398
|
scopeRef: i,
|
|
26369
26399
|
refTagName: t,
|
|
@@ -26374,13 +26404,13 @@ async function Ut(e, t) {
|
|
|
26374
26404
|
}
|
|
26375
26405
|
//#endregion
|
|
26376
26406
|
//#region src/v2019C1/extensions/template/transaction/shared/omit-filters.ts
|
|
26377
|
-
var
|
|
26407
|
+
var $ = [
|
|
26378
26408
|
"FunctionSclRef",
|
|
26379
26409
|
"ApplicationSclRef",
|
|
26380
26410
|
"GeneralEquipment",
|
|
26381
26411
|
"ConductingEquipment"
|
|
26382
|
-
],
|
|
26383
|
-
|
|
26412
|
+
], Jt = [
|
|
26413
|
+
...$,
|
|
26384
26414
|
"DOS",
|
|
26385
26415
|
"Labels",
|
|
26386
26416
|
"LNodeInputs",
|
|
@@ -26392,52 +26422,52 @@ var Q = [
|
|
|
26392
26422
|
];
|
|
26393
26423
|
//#endregion
|
|
26394
26424
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-application.ts
|
|
26395
|
-
async function
|
|
26425
|
+
async function Yt(e, t) {
|
|
26396
26426
|
let { sourceQuery: n, applicationRef: r, structure: i } = t, a = {
|
|
26397
26427
|
tagName: "Substation",
|
|
26398
26428
|
id: i.Substation.id
|
|
26399
|
-
}, o = await
|
|
26429
|
+
}, o = await Q(e, {
|
|
26400
26430
|
sourceQuery: n,
|
|
26401
26431
|
scopeRef: r,
|
|
26402
26432
|
refTagName: "FunctionRef",
|
|
26403
26433
|
targetTagName: "Function"
|
|
26404
26434
|
});
|
|
26405
|
-
for (let t of o) await
|
|
26435
|
+
for (let t of o) await Vt(e, {
|
|
26406
26436
|
sourceQuery: n,
|
|
26407
26437
|
functionRef: t,
|
|
26408
|
-
targetParentRef: await
|
|
26409
|
-
omit:
|
|
26438
|
+
targetParentRef: await Z(n, t, i),
|
|
26439
|
+
omit: $
|
|
26410
26440
|
});
|
|
26411
|
-
for (let t of o) await
|
|
26441
|
+
for (let t of o) await Ht(e, {
|
|
26412
26442
|
sourceQuery: n,
|
|
26413
26443
|
functionRef: t,
|
|
26414
26444
|
structure: i,
|
|
26415
26445
|
stripCategoriesUuid: !1
|
|
26416
26446
|
});
|
|
26417
|
-
await
|
|
26447
|
+
await qt(e, {
|
|
26418
26448
|
sourceQuery: n,
|
|
26419
26449
|
scopeTagName: "Application",
|
|
26420
26450
|
scopeRef: r,
|
|
26421
26451
|
targetParent: a,
|
|
26422
26452
|
skip: new Set(["FunctionRef", "FunctionCategoryRef"]),
|
|
26423
|
-
omit:
|
|
26424
|
-
}), await
|
|
26453
|
+
omit: $
|
|
26454
|
+
}), await X(e, {
|
|
26425
26455
|
sourceQuery: n,
|
|
26426
26456
|
ref: r,
|
|
26427
|
-
targetParent: await
|
|
26428
|
-
omit:
|
|
26457
|
+
targetParent: await Z(n, r, i),
|
|
26458
|
+
omit: $
|
|
26429
26459
|
});
|
|
26430
26460
|
}
|
|
26431
26461
|
//#endregion
|
|
26432
26462
|
//#region src/v2019C1/extensions/template/transaction/shared/post-extraction-cleanup.ts
|
|
26433
|
-
async function
|
|
26463
|
+
async function Xt(e) {
|
|
26434
26464
|
await W.transaction.orphanUuidRefs(e), await W.transaction.resetLNode(e), await W.transaction.pruneEmptyContainers(e);
|
|
26435
26465
|
}
|
|
26436
26466
|
//#endregion
|
|
26437
26467
|
//#region src/v2019C1/extensions/template/transaction/asd/extract-to-asd.ts
|
|
26438
|
-
async function
|
|
26439
|
-
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
26440
|
-
await
|
|
26468
|
+
async function Zt(e, t) {
|
|
26469
|
+
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await Y(e), c = await e.getAttribute(r, { name: "name" }) || "Unnamed Application";
|
|
26470
|
+
await J.transaction.addEntry(e, {
|
|
26441
26471
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
26442
26472
|
header: {
|
|
26443
26473
|
fileType: "ASD",
|
|
@@ -26450,20 +26480,20 @@ async function Kt(e, t) {
|
|
|
26450
26480
|
what: "ASD initialization",
|
|
26451
26481
|
why: "Application was extracted from a previous file"
|
|
26452
26482
|
}
|
|
26453
|
-
}), await
|
|
26483
|
+
}), await Yt(e, {
|
|
26454
26484
|
sourceQuery: n,
|
|
26455
26485
|
applicationRef: r,
|
|
26456
26486
|
structure: s
|
|
26457
|
-
}), await
|
|
26487
|
+
}), await Xt(e);
|
|
26458
26488
|
}
|
|
26459
26489
|
//#endregion
|
|
26460
26490
|
//#region src/v2019C1/extensions/template/transaction/fsd/extract-to-fsd.ts
|
|
26461
|
-
async function
|
|
26462
|
-
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
26491
|
+
async function Qt(e, t) {
|
|
26492
|
+
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await Y(e), c = {
|
|
26463
26493
|
tagName: s.Substation.tagName,
|
|
26464
26494
|
id: s.Substation.id
|
|
26465
26495
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
26466
|
-
await
|
|
26496
|
+
await J.transaction.addEntry(e, {
|
|
26467
26497
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
26468
26498
|
header: {
|
|
26469
26499
|
fileType: "FSD",
|
|
@@ -26476,31 +26506,31 @@ async function qt(e, t) {
|
|
|
26476
26506
|
what: "FSD initialization",
|
|
26477
26507
|
why: "Function was extracted from a previous file"
|
|
26478
26508
|
}
|
|
26479
|
-
}), await
|
|
26509
|
+
}), await Vt(e, {
|
|
26480
26510
|
sourceQuery: n,
|
|
26481
26511
|
functionRef: r,
|
|
26482
26512
|
targetParentRef: c,
|
|
26483
|
-
omit:
|
|
26513
|
+
omit: Jt,
|
|
26484
26514
|
stripRootAttributes: ["templateUuid"]
|
|
26485
|
-
}), await
|
|
26515
|
+
}), await Ht(e, {
|
|
26486
26516
|
sourceQuery: n,
|
|
26487
26517
|
functionRef: r,
|
|
26488
26518
|
structure: s
|
|
26489
|
-
}), await
|
|
26519
|
+
}), await Xt(e);
|
|
26490
26520
|
}
|
|
26491
26521
|
//#endregion
|
|
26492
26522
|
//#region src/v2019C1/extensions/index.ts
|
|
26493
|
-
var
|
|
26523
|
+
var $t = {
|
|
26494
26524
|
cleanUp: W,
|
|
26495
|
-
dataModel:
|
|
26496
|
-
history:
|
|
26497
|
-
reference:
|
|
26525
|
+
dataModel: Tt,
|
|
26526
|
+
history: J,
|
|
26527
|
+
reference: I,
|
|
26498
26528
|
template: { transaction: /* @__PURE__ */ s({
|
|
26499
|
-
ensureSubstationTemplateStructure: () =>
|
|
26500
|
-
extractToAsd: () =>
|
|
26501
|
-
extractToFsd: () =>
|
|
26529
|
+
ensureSubstationTemplateStructure: () => Y,
|
|
26530
|
+
extractToAsd: () => Zt,
|
|
26531
|
+
extractToFsd: () => Qt
|
|
26502
26532
|
}) },
|
|
26503
|
-
presentation:
|
|
26533
|
+
presentation: Rt
|
|
26504
26534
|
};
|
|
26505
26535
|
//#endregion
|
|
26506
|
-
export {
|
|
26536
|
+
export { H as a, B as i, V as n, gt as o, U as r, $t as t };
|