@dialecte/scl 0.3.7 → 0.3.9
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/{hooks-ByGralT8.js → hooks-DO4gUiix.js} +1392 -1074
- package/dist/v2019C1/constants/reference-pairs.d.ts +11 -0
- package/dist/v2019C1/constants/reference-pairs.d.ts.map +1 -1
- package/dist/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.d.ts +12 -5
- package/dist/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.d.ts.map +1 -1
- package/dist/v2019C1/extensions/clean-up/transaction/orphan-uuid-refs.d.ts.map +1 -1
- package/dist/v2019C1/extensions/data-model/query/index.d.ts +1 -0
- package/dist/v2019C1/extensions/data-model/query/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/data-model/query/is-lnode-locked.d.ts +18 -0
- package/dist/v2019C1/extensions/data-model/query/is-lnode-locked.d.ts.map +1 -0
- package/dist/v2019C1/extensions/data-model/transaction/import-types.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.d.ts +4 -3
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.types.d.ts +10 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.types.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.constants.d.ts +1 -1
- package/dist/v2019C1/extensions/lifecycle/engine/decide.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/engine/diff.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/engine/diff.types.d.ts +2 -2
- package/dist/v2019C1/extensions/lifecycle/engine/diff.types.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/engine/group.d.ts +4 -0
- package/dist/v2019C1/extensions/lifecycle/engine/group.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/engine/reconcile.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/layers/function/satellites.constants.d.ts +1 -1
- package/dist/v2019C1/extensions/lifecycle/report/query/cross-cutting-satellites.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/report/query/report-function-satellites.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/report/query/report-function.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/report/query/satellite-companions.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/satellite-companions.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/report/report.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/update/transaction/asd.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/update/transaction/function-satellites.d.ts +1 -1
- package/dist/v2019C1/extensions/presentation/constants/title.d.ts +1 -12
- package/dist/v2019C1/extensions/presentation/constants/title.d.ts.map +1 -1
- package/dist/v2019C1/extensions/presentation/constants/title.types.d.ts +25 -0
- package/dist/v2019C1/extensions/presentation/constants/title.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/public.d.ts +3 -0
- package/dist/v2019C1/extensions/presentation/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/query/extract-element-title.d.ts +2 -24
- package/dist/v2019C1/extensions/presentation/query/extract-element-title.d.ts.map +1 -1
- package/dist/v2019C1/extensions/presentation/query/extract-element-title.types.d.ts +24 -0
- package/dist/v2019C1/extensions/presentation/query/extract-element-title.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/query/index.d.ts +1 -0
- package/dist/v2019C1/extensions/presentation/query/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/public.d.ts +1 -0
- package/dist/v2019C1/extensions/public.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/derived.d.ts +18 -0
- package/dist/v2019C1/extensions/reference/constants/derived.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/index.d.ts +2 -2
- package/dist/v2019C1/extensions/reference/constants/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/orphan-rules.d.ts +0 -8
- package/dist/v2019C1/extensions/reference/constants/orphan-rules.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/build/build-mapped-name.d.ts +22 -0
- package/dist/v2019C1/extensions/reference/query/build/build-mapped-name.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/build/build-reference-path.d.ts +1 -1
- package/dist/v2019C1/extensions/reference/query/build/build-reference-path.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/build/index.d.ts +1 -0
- package/dist/v2019C1/extensions/reference/query/build/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/resolve/parse-path.d.ts +1 -1
- package/dist/v2019C1/extensions/reference/transaction/write-provenance.d.ts +1 -1
- package/dist/v2019C1/hooks/after-created/ref-paths.d.ts.map +1 -1
- package/dist/v2019C1/hooks/after-updated/ref-paths.d.ts +7 -1
- package/dist/v2019C1/hooks/after-updated/ref-paths.d.ts.map +1 -1
- package/dist/v2019C1/hooks/before-clone/before-clone.d.ts.map +1 -1
- package/dist/v2019C1/hooks/before-delete/orphaned-refs.d.ts.map +1 -1
- package/dist/v2019C1/hooks/io/io-hooks.d.ts.map +1 -1
- package/dist/v2019C1/hooks/shared/index.d.ts +4 -0
- package/dist/v2019C1/hooks/shared/index.d.ts.map +1 -1
- package/dist/v2019C1/hooks/shared/lnode-binding.d.ts +23 -0
- package/dist/v2019C1/hooks/shared/lnode-binding.d.ts.map +1 -0
- package/dist/v2019C1/hooks/shared/mapped-name.d.ts +15 -0
- package/dist/v2019C1/hooks/shared/mapped-name.d.ts.map +1 -0
- package/dist/v2019C1/hooks/shared/record-ops.d.ts +19 -0
- package/dist/v2019C1/hooks/shared/record-ops.d.ts.map +1 -0
- package/dist/v2019C1/hooks/shared/ref-path-rebuild.d.ts +17 -0
- package/dist/v2019C1/hooks/shared/ref-path-rebuild.d.ts.map +1 -0
- package/dist/v2019C1/index.js +12 -12
- package/dist/v2019C1/test.js +1 -1
- package/package.json +5 -5
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { XSI_NAMESPACE as e, isChildOf as t, isElementOf as n, stripAttributes as r, toRawRecord as i, toRef as a } from "@dialecte/core/helpers";
|
|
2
|
-
import { invariant as
|
|
1
|
+
import { XSI_NAMESPACE as e, isChildOf as t, isElementOf as n, stripAttributes as r, toRawRecord as i, toRef as a, widen as o } from "@dialecte/core/helpers";
|
|
2
|
+
import { invariant as s } from "@dialecte/core/utils";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
|
-
var
|
|
4
|
+
var c = Object.defineProperty, l = (e, t) => {
|
|
5
5
|
let n = {};
|
|
6
|
-
for (var r in e)
|
|
6
|
+
for (var r in e) c(n, r, {
|
|
7
7
|
get: e[r],
|
|
8
8
|
enumerable: !0
|
|
9
9
|
});
|
|
10
|
-
return t ||
|
|
11
|
-
},
|
|
10
|
+
return t || c(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
11
|
+
}, u = /* @__PURE__ */ "AccessControl.AccessPoint.Address.AllocationRole.AllocationRoleRef.AnalogueWiringParameters.AnalogueWiringParametersRef.Application.ApplicationSclRef.Association.Authentication.BDA.Bay.BayType.BehaviorDescription.BehaviorDescriptionRef.BehaviorReference.BinaryWiringParameters.BinaryWiringParametersRef.BitRate.CheckoutID.ClientLN.ClientServices.CommProt.Communication.CommunicationServiceSpecifications.ConductingEquipment.ConfDataSet.ConfLNs.ConfLdName.ConfLogControl.ConfReportControl.ConfSG.ConfSigRef.ConnectedAP.ConnectivityNode.ControlRef.ControllingLNode.DA.DAI.DAS.DAType.DO.DOI.DOS.DOType.DataObjectDirectory.DataSet.DataSetDirectory.DataTypeTemplates.DynAssociation.DynDataSet.EnumType.EnumVal.EqFunction.EqSubFunction.ExtCtrl.ExtRef.FCDA.FileHandling.Function.FunctionCatRef.FunctionCategory.FunctionCategoryRef.FunctionRef.FunctionRole.FunctionRoleContent.FunctionSclRef.FunctionTemplate.FunctionalSubVariant.FunctionalVariant.FunctionalVariantGroup.FunctionalVariantRef.GOOSE.GOOSEMcSecurity.GOOSESecurity.GSE.GSEControl.GSEDir.GSESettings.GSSE.GeneralEquipment.GetCBValues.GetDataObjectDefinition.GetDataSetValue.GetDirectory.GooseParameters.GooseParametersRef.Header.History.Hitem.IED.IEDName.IEDSourceFiles.InputVar.InputVarRef.Inputs.IssuerName.KDC.L2CommParameters.L3IPv4CommParameters.L3IPv6CommParameters.LDevice.LN.LN0.LNode.LNodeDataRef.LNodeInputRef.LNodeInputs.LNodeOutputRef.LNodeOutputs.LNodeSpecNaming.LNodeType.Label.Labels.Line.Log.LogControl.LogParameters.LogParametersRef.LogSettings.MaxTime.McSecurity.MinRequestedSCDFile.MinRequestedSCDFiles.MinTime.MultiAPPerSubNet.NeutralPoint.OptFields.OutputVar.OutputVarRef.Outputs.P.PhysConn.PowerSystemRelation.PowerSystemRelationRef.PowerSystemRelations.PowerTransformer.Private.Process.ProcessEcho.ProcessResource.ProcessResourceRef.ProcessResources.Project.ProjectProcessReference.ProtNs.Protocol.ReadWrite.RedProt.ReportControl.ReportParameters.ReportParametersRef.ReportSettings.Resource.RptEnabled.SCL.SCSM.SDI.SDO.SDS.SGEdit.SMV.SMVParameters.SMVParametersRef.SMVSecurity.SMVSettings.SMVsc.SVMcSecurity.SampledValueControl.SamplesPerSec.SclFileReference.SecPerSamples.Security.Server.ServerAt.ServiceSpecifications.Services.SetDataSetValue.SettingControl.SettingGroups.SignalRole.SmpRate.SmvOpts.SourceFiles.SourceRef.SubCategory.SubCheckoutID.SubEquipment.SubFunction.SubFunctionTemplate.SubNetwork.Subject.SubscriberLNode.Substation.SupSubscription.TapChanger.Terminal.Text.TimeSyncProt.TimerActivatedControl.TransformerWinding.TrgOps.Val.ValueHandling.Variable.VariableApplyTo.VariableRef.Voltage.VoltageLevel".split("."), d = {
|
|
12
12
|
AccessControl: [],
|
|
13
13
|
AccessPoint: [
|
|
14
14
|
"Text",
|
|
@@ -799,7 +799,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
799
799
|
"ProcessResources",
|
|
800
800
|
"Variable"
|
|
801
801
|
]
|
|
802
|
-
},
|
|
802
|
+
}, f = {
|
|
803
803
|
AccessControl: ["LDevice"],
|
|
804
804
|
AccessPoint: ["IED"],
|
|
805
805
|
Address: [
|
|
@@ -1197,7 +1197,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
1197
1197
|
],
|
|
1198
1198
|
Voltage: ["Line", "VoltageLevel"],
|
|
1199
1199
|
VoltageLevel: ["Substation"]
|
|
1200
|
-
},
|
|
1200
|
+
}, p = {
|
|
1201
1201
|
AccessControl: [],
|
|
1202
1202
|
AccessPoint: /* @__PURE__ */ "AccessControl.Association.Authentication.ClientLN.ClientServices.CommProt.ConfDataSet.ConfLNs.ConfLdName.ConfLogControl.ConfReportControl.ConfSG.ConfSigRef.DAI.DOI.DataObjectDirectory.DataSet.DataSetDirectory.DynAssociation.DynDataSet.ExtCtrl.ExtRef.FCDA.FileHandling.GOOSE.GOOSEMcSecurity.GOOSESecurity.GSEControl.GSEDir.GSESettings.GSSE.GetCBValues.GetDataObjectDefinition.GetDataSetValue.GetDirectory.IEDName.Inputs.IssuerName.LDevice.LN.LN0.Label.Labels.Log.LogControl.LogSettings.McSecurity.MultiAPPerSubNet.OptFields.Outputs.Private.Protocol.ReadWrite.RedProt.ReportControl.ReportSettings.RptEnabled.SCSM.SDI.SGEdit.SMVSecurity.SMVSettings.SMVsc.SVMcSecurity.SampledValueControl.SamplesPerSec.SecPerSamples.Security.Server.ServerAt.Services.SetDataSetValue.SettingControl.SettingGroups.SmpRate.SmvOpts.Subject.SupSubscription.Text.TimeSyncProt.TimerActivatedControl.TrgOps.Val.ValueHandling".split("."),
|
|
1203
1203
|
Address: ["P"],
|
|
@@ -1929,7 +1929,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
1929
1929
|
VariableRef: ["FunctionalVariantRef", "Text"],
|
|
1930
1930
|
Voltage: [],
|
|
1931
1931
|
VoltageLevel: /* @__PURE__ */ "AllocationRole.AllocationRoleRef.AnalogueWiringParametersRef.Application.ApplicationSclRef.Bay.BehaviorDescription.BehaviorDescriptionRef.BehaviorReference.BinaryWiringParametersRef.ConductingEquipment.ConnectivityNode.ControlRef.ControllingLNode.DAS.DOS.EqFunction.EqSubFunction.Function.FunctionCatRef.FunctionCategory.FunctionCategoryRef.FunctionRef.FunctionRole.FunctionRoleContent.FunctionSclRef.FunctionalSubVariant.FunctionalVariant.FunctionalVariantGroup.FunctionalVariantRef.GeneralEquipment.GooseParametersRef.InputVar.InputVarRef.LNode.LNodeDataRef.LNodeInputRef.LNodeInputs.LNodeOutputRef.LNodeOutputs.LNodeSpecNaming.Label.Labels.LogParametersRef.NeutralPoint.OutputVar.OutputVarRef.PowerSystemRelation.PowerSystemRelationRef.PowerSystemRelations.PowerTransformer.Private.ProcessEcho.ProcessResource.ProcessResourceRef.ProcessResources.ReportParametersRef.Resource.SDS.SMVParametersRef.SclFileReference.SignalRole.SourceRef.SubCategory.SubCheckoutID.SubEquipment.SubFunction.SubscriberLNode.TapChanger.Terminal.Text.TransformerWinding.Val.Variable.VariableApplyTo.VariableRef.Voltage".split(".")
|
|
1932
|
-
},
|
|
1932
|
+
}, m = {
|
|
1933
1933
|
AccessControl: [
|
|
1934
1934
|
"AccessPoint",
|
|
1935
1935
|
"IED",
|
|
@@ -3702,13 +3702,13 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
3702
3702
|
"SCL",
|
|
3703
3703
|
"Substation"
|
|
3704
3704
|
]
|
|
3705
|
-
},
|
|
3705
|
+
}, h = [
|
|
3706
3706
|
"Communication",
|
|
3707
3707
|
"DataTypeTemplates",
|
|
3708
3708
|
"Header",
|
|
3709
3709
|
"History",
|
|
3710
3710
|
"SCL"
|
|
3711
|
-
],
|
|
3711
|
+
], g = {
|
|
3712
3712
|
AccessControl: {},
|
|
3713
3713
|
AccessPoint: {
|
|
3714
3714
|
clock: "",
|
|
@@ -5161,7 +5161,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
5161
5161
|
templateUuid: "",
|
|
5162
5162
|
uuid: ""
|
|
5163
5163
|
}
|
|
5164
|
-
},
|
|
5164
|
+
}, _ = {
|
|
5165
5165
|
AccessControl: {
|
|
5166
5166
|
tag: "AccessControl",
|
|
5167
5167
|
namespace: {
|
|
@@ -24516,7 +24516,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
24516
24516
|
]
|
|
24517
24517
|
}]
|
|
24518
24518
|
}
|
|
24519
|
-
},
|
|
24519
|
+
}, v = { supportedFileExtensions: [
|
|
24520
24520
|
".fsd",
|
|
24521
24521
|
".asd",
|
|
24522
24522
|
".ssd",
|
|
@@ -24524,7 +24524,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
24524
24524
|
".isd",
|
|
24525
24525
|
".icd",
|
|
24526
24526
|
".xml"
|
|
24527
|
-
] },
|
|
24527
|
+
] }, y = {
|
|
24528
24528
|
recordSchema: {
|
|
24529
24529
|
primaryKey: "id",
|
|
24530
24530
|
indexes: [
|
|
@@ -24542,7 +24542,7 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
24542
24542
|
},
|
|
24543
24543
|
additionalTables: { attachedFiles: { schema: "id, filename, file" } }
|
|
24544
24544
|
}
|
|
24545
|
-
},
|
|
24545
|
+
}, b = {
|
|
24546
24546
|
default: {
|
|
24547
24547
|
uri: "http://www.iec.ch/61850/2003/SCL",
|
|
24548
24548
|
prefix: ""
|
|
@@ -24552,39 +24552,139 @@ var s = Object.defineProperty, c = (e, t) => {
|
|
|
24552
24552
|
prefix: "eIEC61850-6-100"
|
|
24553
24553
|
},
|
|
24554
24554
|
xsi: e
|
|
24555
|
-
},
|
|
24555
|
+
}, x = {
|
|
24556
24556
|
rootElementName: "SCL",
|
|
24557
|
-
singletonElements:
|
|
24557
|
+
singletonElements: h,
|
|
24558
24558
|
transparentElements: ["Private"],
|
|
24559
|
-
elements:
|
|
24560
|
-
namespaces:
|
|
24561
|
-
attributes:
|
|
24562
|
-
children:
|
|
24563
|
-
parents:
|
|
24564
|
-
descendants:
|
|
24565
|
-
ancestors:
|
|
24566
|
-
database:
|
|
24567
|
-
io:
|
|
24568
|
-
definition:
|
|
24559
|
+
elements: u,
|
|
24560
|
+
namespaces: b,
|
|
24561
|
+
attributes: g,
|
|
24562
|
+
children: d,
|
|
24563
|
+
parents: f,
|
|
24564
|
+
descendants: p,
|
|
24565
|
+
ancestors: m,
|
|
24566
|
+
database: y,
|
|
24567
|
+
io: v,
|
|
24568
|
+
definition: _
|
|
24569
24569
|
};
|
|
24570
24570
|
//#endregion
|
|
24571
|
+
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
24572
|
+
async function S(e, n) {
|
|
24573
|
+
let { records: r } = n, i = {
|
|
24574
|
+
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
24575
|
+
doTypes: /* @__PURE__ */ new Map(),
|
|
24576
|
+
daTypes: /* @__PURE__ */ new Map(),
|
|
24577
|
+
enumTypes: /* @__PURE__ */ new Map()
|
|
24578
|
+
};
|
|
24579
|
+
for (let n of r) {
|
|
24580
|
+
let r = await e.getAttribute(n, { name: "lnType" });
|
|
24581
|
+
if (!r) continue;
|
|
24582
|
+
let [a] = await e.findByAttributes({
|
|
24583
|
+
tagName: "LNodeType",
|
|
24584
|
+
attributes: { id: r }
|
|
24585
|
+
});
|
|
24586
|
+
if (s(a, {
|
|
24587
|
+
key: "ELEMENT_NOT_FOUND",
|
|
24588
|
+
detail: `LNodeType not found for lnType="${r}"`
|
|
24589
|
+
}), !C(i.lnodeTypes, r, a)) continue;
|
|
24590
|
+
let o = a.children.filter((e) => t(e, "DO")), c = await e.getRecords(o);
|
|
24591
|
+
for (let t of c) {
|
|
24592
|
+
if (!t) continue;
|
|
24593
|
+
let n = await e.getAttribute(t, { name: "type" });
|
|
24594
|
+
if (!n) continue;
|
|
24595
|
+
let [r] = await e.findByAttributes({
|
|
24596
|
+
tagName: "DOType",
|
|
24597
|
+
attributes: { id: n }
|
|
24598
|
+
});
|
|
24599
|
+
r && C(i.doTypes, n, r) && await w({
|
|
24600
|
+
query: e,
|
|
24601
|
+
parent: r,
|
|
24602
|
+
dataModelMap: i
|
|
24603
|
+
});
|
|
24604
|
+
}
|
|
24605
|
+
}
|
|
24606
|
+
return {
|
|
24607
|
+
lnodeTypes: Array.from(i.lnodeTypes.values()),
|
|
24608
|
+
doTypes: Array.from(i.doTypes.values()),
|
|
24609
|
+
daTypes: Array.from(i.daTypes.values()),
|
|
24610
|
+
enumTypes: Array.from(i.enumTypes.values())
|
|
24611
|
+
};
|
|
24612
|
+
}
|
|
24613
|
+
function C(e, t, n) {
|
|
24614
|
+
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
24615
|
+
}
|
|
24616
|
+
async function w(e) {
|
|
24617
|
+
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")));
|
|
24618
|
+
for (let e of a) {
|
|
24619
|
+
if (!e) continue;
|
|
24620
|
+
let t = await n.getAttribute(e, { name: "bType" }), r = await n.getAttribute(e, { name: "type" });
|
|
24621
|
+
if (r) {
|
|
24622
|
+
if (t === "Enum") {
|
|
24623
|
+
let [e] = await n.findByAttributes({
|
|
24624
|
+
tagName: "EnumType",
|
|
24625
|
+
attributes: { id: r }
|
|
24626
|
+
});
|
|
24627
|
+
e && C(i.enumTypes, r, e);
|
|
24628
|
+
} else if (t === "Struct") {
|
|
24629
|
+
let [e] = await n.findByAttributes({
|
|
24630
|
+
tagName: "DAType",
|
|
24631
|
+
attributes: { id: r }
|
|
24632
|
+
});
|
|
24633
|
+
e && C(i.daTypes, r, e) && await w({
|
|
24634
|
+
query: n,
|
|
24635
|
+
parent: e,
|
|
24636
|
+
dataModelMap: i
|
|
24637
|
+
});
|
|
24638
|
+
}
|
|
24639
|
+
}
|
|
24640
|
+
}
|
|
24641
|
+
if (r.tagName === "DOType") {
|
|
24642
|
+
let e = r.children.filter((e) => t(e, "SDO")), a = await n.getRecords(e);
|
|
24643
|
+
for (let e of a) {
|
|
24644
|
+
let t = await n.getAttribute(e, { name: "type" });
|
|
24645
|
+
if (!t) continue;
|
|
24646
|
+
let [r] = await n.findByAttributes({
|
|
24647
|
+
tagName: "DOType",
|
|
24648
|
+
attributes: { id: t }
|
|
24649
|
+
});
|
|
24650
|
+
r && C(i.doTypes, t, r) && await w({
|
|
24651
|
+
query: n,
|
|
24652
|
+
parent: r,
|
|
24653
|
+
dataModelMap: i
|
|
24654
|
+
});
|
|
24655
|
+
}
|
|
24656
|
+
}
|
|
24657
|
+
}
|
|
24658
|
+
//#endregion
|
|
24659
|
+
//#region src/v2019C1/extensions/data-model/query/is-lnode-locked.ts
|
|
24660
|
+
var ee = "None";
|
|
24661
|
+
async function T(e, t) {
|
|
24662
|
+
let n = await e.any.getAttribute(t, { name: "iedName" });
|
|
24663
|
+
return !!n && n !== ee;
|
|
24664
|
+
}
|
|
24665
|
+
//#endregion
|
|
24666
|
+
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
24667
|
+
var te = /* @__PURE__ */ l({
|
|
24668
|
+
isLNodeLocked: () => T,
|
|
24669
|
+
resolve: () => S
|
|
24670
|
+
});
|
|
24671
|
+
//#endregion
|
|
24571
24672
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.ts
|
|
24572
|
-
async function
|
|
24673
|
+
async function ne(e) {
|
|
24573
24674
|
let t = await e.getRecordsByTagName("LNode");
|
|
24574
24675
|
for (let n of t) {
|
|
24575
|
-
|
|
24576
|
-
if (!t || t === "None") {
|
|
24676
|
+
if (!await T(e, n)) {
|
|
24577
24677
|
await e.update(n, { attributes: { iedName: "None" } });
|
|
24578
24678
|
continue;
|
|
24579
24679
|
}
|
|
24580
|
-
let [r] = await e.findByAttributes({
|
|
24680
|
+
let t = await e.getAttribute(n, { name: "iedName" }), [r] = await e.findByAttributes({
|
|
24581
24681
|
tagName: "IED",
|
|
24582
24682
|
attributes: { name: t }
|
|
24583
24683
|
});
|
|
24584
|
-
r || await
|
|
24684
|
+
r || await re(e, n);
|
|
24585
24685
|
}
|
|
24586
24686
|
}
|
|
24587
|
-
async function
|
|
24687
|
+
async function re(e, t) {
|
|
24588
24688
|
let n = await e.getChild(t, "LNodeSpecNaming");
|
|
24589
24689
|
if (n) {
|
|
24590
24690
|
let r = await e.getAttribute(n, { name: "sLnClass" }), i = await e.getAttribute(n, { name: "sLnInst" }), a = await e.getAttribute(n, { name: "sPrefix" });
|
|
@@ -24595,7 +24695,6 @@ async function x(e, t) {
|
|
|
24595
24695
|
iedName: "None",
|
|
24596
24696
|
ldInst: void 0,
|
|
24597
24697
|
lnUuid: void 0,
|
|
24598
|
-
templateUuid: void 0,
|
|
24599
24698
|
lnClass: r || void 0,
|
|
24600
24699
|
lnInst: i || void 0,
|
|
24601
24700
|
prefix: a || void 0
|
|
@@ -24604,7 +24703,6 @@ async function x(e, t) {
|
|
|
24604
24703
|
iedName: "None",
|
|
24605
24704
|
ldInst: void 0,
|
|
24606
24705
|
lnUuid: void 0,
|
|
24607
|
-
templateUuid: void 0,
|
|
24608
24706
|
lnClass: void 0,
|
|
24609
24707
|
lnInst: void 0,
|
|
24610
24708
|
prefix: void 0
|
|
@@ -24612,7 +24710,7 @@ async function x(e, t) {
|
|
|
24612
24710
|
}
|
|
24613
24711
|
//#endregion
|
|
24614
24712
|
//#region src/v2019C1/extensions/reference/constants/path-extraction.ts
|
|
24615
|
-
var
|
|
24713
|
+
var ie = {
|
|
24616
24714
|
AccessPoint: { type: "transparent" },
|
|
24617
24715
|
Server: { type: "transparent" },
|
|
24618
24716
|
Private: { type: "transparent" },
|
|
@@ -24692,16 +24790,16 @@ var S = {
|
|
|
24692
24790
|
PowerSystemRelation: { type: "name" },
|
|
24693
24791
|
Variable: { type: "name" },
|
|
24694
24792
|
Process: { type: "name" }
|
|
24695
|
-
},
|
|
24793
|
+
}, ae = [
|
|
24696
24794
|
"lnClass",
|
|
24697
24795
|
"prefix",
|
|
24698
24796
|
"inst",
|
|
24699
24797
|
"lnInst"
|
|
24700
|
-
],
|
|
24798
|
+
], oe = new Set(Object.values(ie).flatMap((e) => {
|
|
24701
24799
|
switch (e.type) {
|
|
24702
24800
|
case "transparent": return [];
|
|
24703
24801
|
case "name": return ["name"];
|
|
24704
|
-
case "lnClass": return [...
|
|
24802
|
+
case "lnClass": return [...ae];
|
|
24705
24803
|
case "attribute": return [e.attr];
|
|
24706
24804
|
case "sourceRef": return [
|
|
24707
24805
|
"input",
|
|
@@ -24713,13 +24811,13 @@ var S = {
|
|
|
24713
24811
|
}));
|
|
24714
24812
|
//#endregion
|
|
24715
24813
|
//#region src/v2019C1/extensions/reference/query/build/path-segment.ts
|
|
24716
|
-
function
|
|
24814
|
+
function se(e) {
|
|
24717
24815
|
switch (e.type) {
|
|
24718
24816
|
case "transparent": return () => null;
|
|
24719
24817
|
case "name": {
|
|
24720
24818
|
let t = e.separator ?? "/";
|
|
24721
24819
|
return (e) => {
|
|
24722
|
-
let n =
|
|
24820
|
+
let n = D(e, "name");
|
|
24723
24821
|
return n ? {
|
|
24724
24822
|
segment: n,
|
|
24725
24823
|
separator: t
|
|
@@ -24727,34 +24825,34 @@ function re(e) {
|
|
|
24727
24825
|
};
|
|
24728
24826
|
}
|
|
24729
24827
|
case "lnClass": return (e) => {
|
|
24730
|
-
let t =
|
|
24828
|
+
let t = D(e, "lnClass");
|
|
24731
24829
|
return t ? {
|
|
24732
|
-
segment: `${
|
|
24830
|
+
segment: `${D(e, "prefix") ?? ""}${t}${D(e, "inst") ?? D(e, "lnInst") ?? ""}`,
|
|
24733
24831
|
separator: "/"
|
|
24734
24832
|
} : null;
|
|
24735
24833
|
};
|
|
24736
24834
|
case "attribute": return (t) => {
|
|
24737
|
-
let n =
|
|
24835
|
+
let n = D(t, e.attr);
|
|
24738
24836
|
return n ? {
|
|
24739
24837
|
segment: n,
|
|
24740
24838
|
separator: e.separator
|
|
24741
24839
|
} : null;
|
|
24742
24840
|
};
|
|
24743
24841
|
case "sourceRef": return (e) => {
|
|
24744
|
-
let t =
|
|
24842
|
+
let t = D(e, "input");
|
|
24745
24843
|
if (!t) return null;
|
|
24746
|
-
let n = t, r =
|
|
24844
|
+
let n = t, r = D(e, "inputInst");
|
|
24747
24845
|
r && r !== "1" && (n += `(${r})`);
|
|
24748
|
-
let i =
|
|
24846
|
+
let i = D(e, "pDA");
|
|
24749
24847
|
return i && (n += `.${i}`), {
|
|
24750
24848
|
segment: n,
|
|
24751
24849
|
separator: "."
|
|
24752
24850
|
};
|
|
24753
24851
|
};
|
|
24754
24852
|
case "controlRef": return (e) => {
|
|
24755
|
-
let t =
|
|
24853
|
+
let t = D(e, "output");
|
|
24756
24854
|
if (!t) return null;
|
|
24757
|
-
let n = t, r =
|
|
24855
|
+
let n = t, r = D(e, "outputInst");
|
|
24758
24856
|
return r && r !== "1" && (n += `(${r})`), {
|
|
24759
24857
|
segment: n,
|
|
24760
24858
|
separator: "."
|
|
@@ -24762,15 +24860,15 @@ function re(e) {
|
|
|
24762
24860
|
};
|
|
24763
24861
|
}
|
|
24764
24862
|
}
|
|
24765
|
-
var
|
|
24766
|
-
function
|
|
24767
|
-
let t =
|
|
24863
|
+
var ce = Object.fromEntries(Object.entries(ie).map(([e, t]) => [e, se(t)]));
|
|
24864
|
+
function E(e) {
|
|
24865
|
+
let t = ce[e.tagName];
|
|
24768
24866
|
return t ? t(e) : null;
|
|
24769
24867
|
}
|
|
24770
|
-
function
|
|
24868
|
+
function le(e) {
|
|
24771
24869
|
let { record: t, ancestry: n } = e, r = [];
|
|
24772
24870
|
for (let e of n) {
|
|
24773
|
-
let t =
|
|
24871
|
+
let t = E(e);
|
|
24774
24872
|
t && r.push({
|
|
24775
24873
|
...t,
|
|
24776
24874
|
ref: {
|
|
@@ -24779,7 +24877,7 @@ function ae(e) {
|
|
|
24779
24877
|
}
|
|
24780
24878
|
});
|
|
24781
24879
|
}
|
|
24782
|
-
let i =
|
|
24880
|
+
let i = E(t);
|
|
24783
24881
|
return i && r.push({
|
|
24784
24882
|
...i,
|
|
24785
24883
|
ref: {
|
|
@@ -24787,36 +24885,36 @@ function ae(e) {
|
|
|
24787
24885
|
id: t.id
|
|
24788
24886
|
}
|
|
24789
24887
|
}), r.length === 0 ? null : {
|
|
24790
|
-
path:
|
|
24888
|
+
path: ue(r),
|
|
24791
24889
|
segments: r
|
|
24792
24890
|
};
|
|
24793
24891
|
}
|
|
24794
|
-
function
|
|
24892
|
+
function D(e, t) {
|
|
24795
24893
|
return e.attributes.find((e) => e.name === t)?.value;
|
|
24796
24894
|
}
|
|
24797
|
-
function
|
|
24895
|
+
function ue(e) {
|
|
24798
24896
|
let t = e[0].segment;
|
|
24799
24897
|
for (let n = 1; n < e.length; n++) t += e[n].separator + e[n].segment;
|
|
24800
24898
|
return t;
|
|
24801
24899
|
}
|
|
24802
24900
|
//#endregion
|
|
24803
24901
|
//#region src/v2019C1/extensions/reference/query/build/build-element-path.ts
|
|
24804
|
-
async function
|
|
24902
|
+
async function de(e, t) {
|
|
24805
24903
|
let n = await e.getRecord(t);
|
|
24806
24904
|
if (!n) return null;
|
|
24807
24905
|
let r = i(n);
|
|
24808
|
-
if (!
|
|
24906
|
+
if (!E(r)) {
|
|
24809
24907
|
let e = r.attributes.find((e) => e.name === "uuid")?.value;
|
|
24810
24908
|
return console.warn(`[scl] buildElementPath: no path segment for <${r.tagName}>${e ? ` (uuid ${e})` : ""} — cannot build a path to this element; leaving any existing reference path untouched`), null;
|
|
24811
24909
|
}
|
|
24812
|
-
return
|
|
24910
|
+
return le({
|
|
24813
24911
|
record: r,
|
|
24814
24912
|
ancestry: (await e.findAncestors(t, { order: "top-down" })).map(i)
|
|
24815
24913
|
});
|
|
24816
24914
|
}
|
|
24817
24915
|
//#endregion
|
|
24818
24916
|
//#region src/v2019C1/constants/reference-pairs.ts
|
|
24819
|
-
var
|
|
24917
|
+
var O = {
|
|
24820
24918
|
AllocationRoleRef: [{
|
|
24821
24919
|
attribute: {
|
|
24822
24920
|
path: "allocationRole",
|
|
@@ -25161,7 +25259,7 @@ var T = {
|
|
|
25161
25259
|
uuid: "elementUuid"
|
|
25162
25260
|
},
|
|
25163
25261
|
resolution: "unsupported",
|
|
25164
|
-
target:
|
|
25262
|
+
target: u,
|
|
25165
25263
|
companions: [{
|
|
25166
25264
|
name: "doName",
|
|
25167
25265
|
required: !1
|
|
@@ -25179,10 +25277,19 @@ var T = {
|
|
|
25179
25277
|
target: ["Variable"],
|
|
25180
25278
|
companions: []
|
|
25181
25279
|
}]
|
|
25182
|
-
}
|
|
25280
|
+
}, k = new Set([
|
|
25281
|
+
"SourceRef",
|
|
25282
|
+
"ControlRef",
|
|
25283
|
+
"DOS",
|
|
25284
|
+
"SDS",
|
|
25285
|
+
"DAS",
|
|
25286
|
+
"InputVar",
|
|
25287
|
+
"OutputVar",
|
|
25288
|
+
"ProcessEcho"
|
|
25289
|
+
]), A = Object.keys(O), fe = new Set(A), pe = new Set(Object.values(O).flatMap((e) => e.flatMap((e) => e.target)));
|
|
25183
25290
|
//#endregion
|
|
25184
25291
|
//#region src/v2019C1/extensions/reference/query/resolve/parse-path.ts
|
|
25185
|
-
function
|
|
25292
|
+
function me(e) {
|
|
25186
25293
|
if (!e) return [];
|
|
25187
25294
|
let t = [], n = "", r = "/";
|
|
25188
25295
|
for (let i of e) i === "/" || i === "." ? (n && t.push({
|
|
@@ -25194,7 +25301,7 @@ function ce(e) {
|
|
|
25194
25301
|
separator: r
|
|
25195
25302
|
}), t;
|
|
25196
25303
|
}
|
|
25197
|
-
function
|
|
25304
|
+
function he(e) {
|
|
25198
25305
|
let t = e.split("/"), n = t[t.length - 1], r = n.indexOf(".");
|
|
25199
25306
|
if (r === -1) return { path: e };
|
|
25200
25307
|
let i = n.substring(0, r), a = n.substring(r + 1);
|
|
@@ -25203,19 +25310,19 @@ function le(e) {
|
|
|
25203
25310
|
qualifier: a || void 0
|
|
25204
25311
|
};
|
|
25205
25312
|
}
|
|
25206
|
-
function
|
|
25207
|
-
return !e || e ===
|
|
25313
|
+
function ge(e, t, n, r) {
|
|
25314
|
+
return !e || e === j.unsupported ? null : e === j.direct ? { lookupKey: n } : e === j.iedAddress ? ve(n, r) : e === j.lnode ? _e(n) : e === j.behaviorDescription ? ye(t, n, r) : null;
|
|
25208
25315
|
}
|
|
25209
|
-
function
|
|
25210
|
-
let { path: t, qualifier: n } =
|
|
25316
|
+
function _e(e) {
|
|
25317
|
+
let { path: t, qualifier: n } = he(e);
|
|
25211
25318
|
return {
|
|
25212
25319
|
lookupKey: t,
|
|
25213
25320
|
qualifier: n
|
|
25214
25321
|
};
|
|
25215
25322
|
}
|
|
25216
|
-
function
|
|
25323
|
+
function ve(e, t) {
|
|
25217
25324
|
if (t) {
|
|
25218
|
-
let n =
|
|
25325
|
+
let n = Se(t);
|
|
25219
25326
|
if (n) return {
|
|
25220
25327
|
lookupKey: e,
|
|
25221
25328
|
fallbackLookupKey: `${n}/${e}`
|
|
@@ -25223,15 +25330,15 @@ function fe(e, t) {
|
|
|
25223
25330
|
}
|
|
25224
25331
|
return { lookupKey: e };
|
|
25225
25332
|
}
|
|
25226
|
-
function
|
|
25333
|
+
function ye(e, t, n) {
|
|
25227
25334
|
if (!n) return null;
|
|
25228
|
-
let r =
|
|
25335
|
+
let r = be(n);
|
|
25229
25336
|
return r ? e === "dataName" ? {
|
|
25230
25337
|
lookupKey: r,
|
|
25231
25338
|
qualifier: t
|
|
25232
|
-
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${
|
|
25339
|
+
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${xe(t)}` } : null : null;
|
|
25233
25340
|
}
|
|
25234
|
-
function
|
|
25341
|
+
function be(e) {
|
|
25235
25342
|
let t = -1;
|
|
25236
25343
|
for (let n = e.length - 1; n >= 0; n--) if (e[n].tagName === "BehaviorDescription") {
|
|
25237
25344
|
t = n;
|
|
@@ -25240,74 +25347,225 @@ function me(e) {
|
|
|
25240
25347
|
if (t === -1) return null;
|
|
25241
25348
|
let n = [];
|
|
25242
25349
|
for (let r = 0; r < t; r++) {
|
|
25243
|
-
let t =
|
|
25350
|
+
let t = E(e[r]);
|
|
25244
25351
|
t && n.push(t);
|
|
25245
25352
|
}
|
|
25246
|
-
return n.length === 0 ? null :
|
|
25353
|
+
return n.length === 0 ? null : ue(n);
|
|
25247
25354
|
}
|
|
25248
|
-
function
|
|
25355
|
+
function xe(e) {
|
|
25249
25356
|
let t = e.indexOf("("), n = e.indexOf(".");
|
|
25250
25357
|
return t === -1 ? n === -1 ? e : e.substring(0, n) : e.substring(0, t);
|
|
25251
25358
|
}
|
|
25252
|
-
function
|
|
25359
|
+
function Se(e) {
|
|
25253
25360
|
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;
|
|
25254
25361
|
return null;
|
|
25255
25362
|
}
|
|
25256
25363
|
//#endregion
|
|
25257
25364
|
//#region src/v2019C1/extensions/reference/query/build/build-reference-path.ts
|
|
25258
|
-
async function
|
|
25259
|
-
let { reference: n, target: r } = t
|
|
25365
|
+
async function Ce(e, t) {
|
|
25366
|
+
let { reference: n, target: r } = t;
|
|
25367
|
+
if (N.has(n.tagName)) return null;
|
|
25368
|
+
let a = Ee(n.tagName, r.tagName);
|
|
25260
25369
|
if (!a) return null;
|
|
25261
25370
|
let o = a.resolution;
|
|
25262
|
-
if (o ===
|
|
25371
|
+
if (o === j.behaviorDescription) {
|
|
25263
25372
|
let t = await e.getRecord(r);
|
|
25264
|
-
return t ?
|
|
25373
|
+
return t ? E(i(t))?.segment ?? null : null;
|
|
25265
25374
|
}
|
|
25266
|
-
let s = await
|
|
25375
|
+
let s = await de(e, r);
|
|
25267
25376
|
if (!s) return null;
|
|
25268
25377
|
let c = s.path;
|
|
25269
|
-
if (o ===
|
|
25378
|
+
if (o === j.lnode) {
|
|
25270
25379
|
let t = await e.getRecord(n);
|
|
25271
25380
|
if (!t) return c;
|
|
25272
|
-
let r = t
|
|
25273
|
-
|
|
25274
|
-
let { qualifier: i } = le(r);
|
|
25275
|
-
return i ? `${c}.${i}` : c;
|
|
25381
|
+
let r = Te(t, a);
|
|
25382
|
+
return r ? `${c}.${we(t, a) ?? r}` : c;
|
|
25276
25383
|
}
|
|
25277
25384
|
return c;
|
|
25278
25385
|
}
|
|
25279
|
-
function
|
|
25280
|
-
let n =
|
|
25386
|
+
function we(e, t) {
|
|
25387
|
+
let [n, r] = t.companions;
|
|
25388
|
+
if (!n) return;
|
|
25389
|
+
let i = e.attributes.find((e) => e.name === n.name)?.value;
|
|
25390
|
+
if (!i) return;
|
|
25391
|
+
let a = r ? e.attributes.find((e) => e.name === r.name)?.value : void 0;
|
|
25392
|
+
return a ? `${i}.${a}` : i;
|
|
25393
|
+
}
|
|
25394
|
+
function Te(e, t) {
|
|
25395
|
+
let n = e.attributes.find((e) => e.name === t.attribute.path)?.value;
|
|
25396
|
+
if (n) return he(n).qualifier;
|
|
25397
|
+
}
|
|
25398
|
+
function Ee(e, t) {
|
|
25399
|
+
let n = O[e];
|
|
25281
25400
|
return n ? n.find((e) => e.target.includes(t)) ?? null : null;
|
|
25282
25401
|
}
|
|
25283
25402
|
//#endregion
|
|
25403
|
+
//#region src/v2019C1/extensions/reference/constants/resolution-types.ts
|
|
25404
|
+
var j = {
|
|
25405
|
+
direct: "direct",
|
|
25406
|
+
lnode: "lnode",
|
|
25407
|
+
iedAddress: "ied-address",
|
|
25408
|
+
behaviorDescription: "behavior-description",
|
|
25409
|
+
unsupported: "unsupported"
|
|
25410
|
+
}, M = {
|
|
25411
|
+
LN: [{
|
|
25412
|
+
attribute: "lnType",
|
|
25413
|
+
target: "LNodeType"
|
|
25414
|
+
}],
|
|
25415
|
+
LN0: [{
|
|
25416
|
+
attribute: "lnType",
|
|
25417
|
+
target: "LNodeType"
|
|
25418
|
+
}],
|
|
25419
|
+
LNode: [{
|
|
25420
|
+
attribute: "lnType",
|
|
25421
|
+
target: "LNodeType"
|
|
25422
|
+
}],
|
|
25423
|
+
DO: [{
|
|
25424
|
+
attribute: "type",
|
|
25425
|
+
target: "DOType"
|
|
25426
|
+
}],
|
|
25427
|
+
SDO: [{
|
|
25428
|
+
attribute: "type",
|
|
25429
|
+
target: "DOType"
|
|
25430
|
+
}],
|
|
25431
|
+
DA: [{
|
|
25432
|
+
attribute: "type",
|
|
25433
|
+
target: "EnumType",
|
|
25434
|
+
when: {
|
|
25435
|
+
attribute: "bType",
|
|
25436
|
+
equals: "Enum"
|
|
25437
|
+
}
|
|
25438
|
+
}, {
|
|
25439
|
+
attribute: "type",
|
|
25440
|
+
target: "DAType",
|
|
25441
|
+
when: {
|
|
25442
|
+
attribute: "bType",
|
|
25443
|
+
equals: "Struct"
|
|
25444
|
+
}
|
|
25445
|
+
}],
|
|
25446
|
+
BDA: [{
|
|
25447
|
+
attribute: "type",
|
|
25448
|
+
target: "EnumType",
|
|
25449
|
+
when: {
|
|
25450
|
+
attribute: "bType",
|
|
25451
|
+
equals: "Enum"
|
|
25452
|
+
}
|
|
25453
|
+
}, {
|
|
25454
|
+
attribute: "type",
|
|
25455
|
+
target: "DAType",
|
|
25456
|
+
when: {
|
|
25457
|
+
attribute: "bType",
|
|
25458
|
+
equals: "Struct"
|
|
25459
|
+
}
|
|
25460
|
+
}]
|
|
25461
|
+
};
|
|
25462
|
+
//#endregion
|
|
25463
|
+
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25464
|
+
function De(e) {
|
|
25465
|
+
let t = {};
|
|
25466
|
+
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25467
|
+
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
25468
|
+
for (let t of e.target) {
|
|
25469
|
+
let i = r.get(t) ?? [];
|
|
25470
|
+
i.push({
|
|
25471
|
+
refTagName: n,
|
|
25472
|
+
uuidAttr: e.attribute.uuid,
|
|
25473
|
+
pathAttr: e.attribute.path
|
|
25474
|
+
}), r.set(t, i);
|
|
25475
|
+
}
|
|
25476
|
+
}
|
|
25477
|
+
return t;
|
|
25478
|
+
}
|
|
25479
|
+
function Oe(e) {
|
|
25480
|
+
let t = /* @__PURE__ */ new Map();
|
|
25481
|
+
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25482
|
+
uuidAttr: e.attribute.uuid,
|
|
25483
|
+
pathAttr: e.attribute.path,
|
|
25484
|
+
resolution: e.resolution,
|
|
25485
|
+
targetTagNames: e.target
|
|
25486
|
+
})));
|
|
25487
|
+
return t;
|
|
25488
|
+
}
|
|
25489
|
+
function ke(e) {
|
|
25490
|
+
let t = /* @__PURE__ */ new Map();
|
|
25491
|
+
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25492
|
+
let r = t.get(e.target) ?? [];
|
|
25493
|
+
r.push({
|
|
25494
|
+
refTagName: n,
|
|
25495
|
+
attribute: e.attribute,
|
|
25496
|
+
when: e.when
|
|
25497
|
+
}), t.set(e.target, r);
|
|
25498
|
+
}
|
|
25499
|
+
return t;
|
|
25500
|
+
}
|
|
25501
|
+
//#endregion
|
|
25502
|
+
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25503
|
+
var Ae = De(O), je = [
|
|
25504
|
+
j.direct,
|
|
25505
|
+
j.lnode,
|
|
25506
|
+
j.iedAddress,
|
|
25507
|
+
j.behaviorDescription
|
|
25508
|
+
], Me = [...je, j.unsupported], Ne = Oe(O), N = new Map(Object.entries(O).flatMap(([e, t]) => t.filter((e) => e.attribute.path === "mappedDoName" || e.attribute.path === "mappedDaName").map((t) => [e, {
|
|
25509
|
+
path: t.attribute.path,
|
|
25510
|
+
uuid: t.attribute.uuid
|
|
25511
|
+
}]))), Pe = [...new Set(Object.values(O).flatMap((e) => e.map((e) => e.attribute.uuid)))], P = new Map(Object.entries(M).map(([e, t]) => [e, [...new Set(t.map((e) => e.attribute))]])), Fe = ke(M), Ie = new Set(Fe.keys()), Le = new Set([..._.LNode?.attributes?.identityFields ?? [], ...P.get("LNode") ?? []]), Re = {
|
|
25512
|
+
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25513
|
+
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25514
|
+
Resource: ["ProcessResource", "ProcessResources"],
|
|
25515
|
+
VariableApplyTo: ["Variable"]
|
|
25516
|
+
};
|
|
25517
|
+
//#endregion
|
|
25518
|
+
//#region src/v2019C1/extensions/reference/query/build/build-mapped-name.ts
|
|
25519
|
+
async function ze(e, t) {
|
|
25520
|
+
let n = N.get(t.tagName);
|
|
25521
|
+
if (!n) return;
|
|
25522
|
+
let r = t.attributes.find((e) => e.name === "name")?.value;
|
|
25523
|
+
if (!r) return;
|
|
25524
|
+
let i = t.attributes.find((e) => e.name === n.path)?.value, a = Be(i, t.tagName === "DAS" && !await Ve(e, t)) ?? r;
|
|
25525
|
+
return a === r ? void 0 : a;
|
|
25526
|
+
}
|
|
25527
|
+
function Be(e, t) {
|
|
25528
|
+
if (!e) return;
|
|
25529
|
+
let { path: n, qualifier: r } = he(e), i = r ?? n;
|
|
25530
|
+
if (t) return i || void 0;
|
|
25531
|
+
let a = i.split(".");
|
|
25532
|
+
return a[a.length - 1] || void 0;
|
|
25533
|
+
}
|
|
25534
|
+
async function Ve(e, t) {
|
|
25535
|
+
let n = (await e.findAncestors(t)).find((e) => e.tagName === "DOS" || e.tagName === "SDS");
|
|
25536
|
+
return n ? !!await e.getAttribute({
|
|
25537
|
+
tagName: n.tagName,
|
|
25538
|
+
id: n.id
|
|
25539
|
+
}, { name: "mappedLnUuid" }) : !1;
|
|
25540
|
+
}
|
|
25541
|
+
//#endregion
|
|
25284
25542
|
//#region src/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.ts
|
|
25285
|
-
function
|
|
25543
|
+
function He(e) {
|
|
25286
25544
|
let t = e.iedName;
|
|
25287
|
-
if (!t || t ===
|
|
25545
|
+
if (!t || t === Ue) return null;
|
|
25288
25546
|
let n = e.ldInst, r = e.lnClass;
|
|
25289
25547
|
return !n || !r ? null : `${t}/${n}/${`${e.prefix ?? ""}${r}${e.lnInst ?? ""}`}`;
|
|
25290
25548
|
}
|
|
25291
|
-
var
|
|
25549
|
+
var Ue = "None";
|
|
25292
25550
|
//#endregion
|
|
25293
25551
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-reference-path.ts
|
|
25294
|
-
async function
|
|
25295
|
-
let r =
|
|
25552
|
+
async function We(e, t, n) {
|
|
25553
|
+
let r = Ge(t.tagName, n);
|
|
25296
25554
|
if (!r) return;
|
|
25297
25555
|
let a = t.attributes.find((e) => e.name === n)?.value;
|
|
25298
25556
|
if (!a) return;
|
|
25299
|
-
let o = await
|
|
25557
|
+
let o = await Ke(e, t, r);
|
|
25300
25558
|
if (o) return {
|
|
25301
25559
|
record: o,
|
|
25302
|
-
qualifier:
|
|
25560
|
+
qualifier: qe(r, n, a)
|
|
25303
25561
|
};
|
|
25304
25562
|
let s;
|
|
25305
|
-
(r.resolution ===
|
|
25306
|
-
let c =
|
|
25563
|
+
(r.resolution === j.behaviorDescription || r.resolution === j.iedAddress) && (s = (await e.findAncestors(t, { order: "top-down" })).map((e) => i(e)));
|
|
25564
|
+
let c = ge(r.resolution, n, a, s);
|
|
25307
25565
|
if (!c) return;
|
|
25308
|
-
let l =
|
|
25566
|
+
let l = me(c.lookupKey);
|
|
25309
25567
|
if (l.length === 0) return;
|
|
25310
|
-
let u = l[l.length - 1], d = l.slice(0, -1), f = await
|
|
25568
|
+
let u = l[l.length - 1], d = l.slice(0, -1), f = await Ze({
|
|
25311
25569
|
query: e,
|
|
25312
25570
|
targets: r.target,
|
|
25313
25571
|
segment: u,
|
|
@@ -25318,11 +25576,11 @@ async function xe(e, t, n) {
|
|
|
25318
25576
|
qualifier: c.qualifier
|
|
25319
25577
|
};
|
|
25320
25578
|
}
|
|
25321
|
-
function
|
|
25322
|
-
let n =
|
|
25579
|
+
function Ge(e, t) {
|
|
25580
|
+
let n = O[e];
|
|
25323
25581
|
if (n) return n.find((e) => e.attribute.path === t);
|
|
25324
25582
|
}
|
|
25325
|
-
async function
|
|
25583
|
+
async function Ke(e, t, n) {
|
|
25326
25584
|
let r = n.attribute.uuid, i = t.attributes.find((e) => e.name === r)?.value;
|
|
25327
25585
|
if (i) for (let t of n.target) {
|
|
25328
25586
|
let n = await e.findByAttributes({
|
|
@@ -25332,19 +25590,19 @@ async function Ce(e, t, n) {
|
|
|
25332
25590
|
if (n.length > 0) return n[0];
|
|
25333
25591
|
}
|
|
25334
25592
|
}
|
|
25335
|
-
function
|
|
25336
|
-
if (e.resolution ===
|
|
25337
|
-
if (e.resolution ===
|
|
25593
|
+
function qe(e, t, n) {
|
|
25594
|
+
if (e.resolution === j.lnode) return he(n).qualifier;
|
|
25595
|
+
if (e.resolution === j.behaviorDescription && t === "dataName") return n;
|
|
25338
25596
|
}
|
|
25339
|
-
var
|
|
25597
|
+
var Je = new Set(_.LNode.attributes.details.lnClass.facets.enumeration), Ye = {
|
|
25340
25598
|
LNode: "lnInst",
|
|
25341
25599
|
LN: "inst",
|
|
25342
25600
|
LN0: "inst"
|
|
25343
25601
|
};
|
|
25344
|
-
function
|
|
25602
|
+
function Xe(e) {
|
|
25345
25603
|
for (let t = 0; t <= e.length - 4; t++) {
|
|
25346
25604
|
let n = e.substring(t, t + 4);
|
|
25347
|
-
if (
|
|
25605
|
+
if (Je.has(n)) return {
|
|
25348
25606
|
prefix: e.substring(0, t),
|
|
25349
25607
|
lnClass: n,
|
|
25350
25608
|
inst: e.substring(t + 4)
|
|
@@ -25352,12 +25610,12 @@ function De(e) {
|
|
|
25352
25610
|
}
|
|
25353
25611
|
return null;
|
|
25354
25612
|
}
|
|
25355
|
-
async function
|
|
25613
|
+
async function Ze(e) {
|
|
25356
25614
|
let { query: t, targets: n, segment: r, expectedAncestry: i } = e;
|
|
25357
25615
|
for (let e of n) {
|
|
25358
|
-
let n =
|
|
25616
|
+
let n = Ye[e];
|
|
25359
25617
|
if (n) {
|
|
25360
|
-
let a = await
|
|
25618
|
+
let a = await Qe({
|
|
25361
25619
|
query: t,
|
|
25362
25620
|
tagName: e,
|
|
25363
25621
|
segment: r,
|
|
@@ -25366,7 +25624,7 @@ async function Oe(e) {
|
|
|
25366
25624
|
});
|
|
25367
25625
|
if (a) return a;
|
|
25368
25626
|
} else {
|
|
25369
|
-
let n = await
|
|
25627
|
+
let n = await $e({
|
|
25370
25628
|
query: t,
|
|
25371
25629
|
tagName: e,
|
|
25372
25630
|
segment: r,
|
|
@@ -25376,8 +25634,8 @@ async function Oe(e) {
|
|
|
25376
25634
|
}
|
|
25377
25635
|
}
|
|
25378
25636
|
}
|
|
25379
|
-
async function
|
|
25380
|
-
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o =
|
|
25637
|
+
async function Qe(e) {
|
|
25638
|
+
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o = Xe(r.segment);
|
|
25381
25639
|
if (!o) return;
|
|
25382
25640
|
let s = await t.findByAttributes({
|
|
25383
25641
|
tagName: n,
|
|
@@ -25385,37 +25643,37 @@ async function ke(e) {
|
|
|
25385
25643
|
});
|
|
25386
25644
|
for (let e of s) {
|
|
25387
25645
|
let n = e.attributes.find((e) => e.name === "prefix")?.value ?? "", r = e.attributes.find((e) => e.name === i)?.value ?? "";
|
|
25388
|
-
if (!(n !== o.prefix || r !== o.inst) && await
|
|
25646
|
+
if (!(n !== o.prefix || r !== o.inst) && await et(t, e, a)) return e;
|
|
25389
25647
|
}
|
|
25390
25648
|
}
|
|
25391
|
-
async function
|
|
25649
|
+
async function $e(e) {
|
|
25392
25650
|
let { query: t, tagName: n, segment: r, expectedAncestry: a } = e, o = await t.getRecordsByTagName(n);
|
|
25393
25651
|
for (let e of o) {
|
|
25394
|
-
let n =
|
|
25395
|
-
if (!(!n || n.segment !== r.segment) && await
|
|
25652
|
+
let n = E(i(e));
|
|
25653
|
+
if (!(!n || n.segment !== r.segment) && await et(t, e, a)) return e;
|
|
25396
25654
|
}
|
|
25397
25655
|
}
|
|
25398
|
-
async function
|
|
25656
|
+
async function et(e, t, n) {
|
|
25399
25657
|
if (n.length === 0) return !0;
|
|
25400
25658
|
let r = await e.findAncestors(t), a = [];
|
|
25401
25659
|
for (let e = r.length - 1; e >= 0; e--) {
|
|
25402
|
-
let t =
|
|
25660
|
+
let t = E(i(r[e]));
|
|
25403
25661
|
t && a.push(t);
|
|
25404
25662
|
}
|
|
25405
25663
|
return a.length === n.length ? a.every((e, t) => e.segment === n[t].segment) : !1;
|
|
25406
25664
|
}
|
|
25407
25665
|
//#endregion
|
|
25408
25666
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-element-path.ts
|
|
25409
|
-
async function
|
|
25410
|
-
let n =
|
|
25411
|
-
if (n.length !== 0) return
|
|
25667
|
+
async function tt(e, t) {
|
|
25668
|
+
let n = me(t);
|
|
25669
|
+
if (n.length !== 0) return nt({
|
|
25412
25670
|
query: e,
|
|
25413
25671
|
current: await e.getRoot(),
|
|
25414
25672
|
segments: n,
|
|
25415
25673
|
index: 0
|
|
25416
25674
|
});
|
|
25417
25675
|
}
|
|
25418
|
-
async function
|
|
25676
|
+
async function nt(e) {
|
|
25419
25677
|
let { query: t, current: n, segments: r, index: a } = e;
|
|
25420
25678
|
if (a >= r.length) return n;
|
|
25421
25679
|
let o = n.children ?? [];
|
|
@@ -25423,9 +25681,9 @@ async function Ne(e) {
|
|
|
25423
25681
|
let s = await t.getRecords(o), c = r[a];
|
|
25424
25682
|
for (let e of s) {
|
|
25425
25683
|
if (!e) continue;
|
|
25426
|
-
let n =
|
|
25684
|
+
let n = E(i(e));
|
|
25427
25685
|
if (!n) {
|
|
25428
|
-
let n = await
|
|
25686
|
+
let n = await nt({
|
|
25429
25687
|
query: t,
|
|
25430
25688
|
current: e,
|
|
25431
25689
|
segments: r,
|
|
@@ -25435,7 +25693,7 @@ async function Ne(e) {
|
|
|
25435
25693
|
continue;
|
|
25436
25694
|
}
|
|
25437
25695
|
if (n.segment === c.segment && n.separator === c.separator) {
|
|
25438
|
-
let n = await
|
|
25696
|
+
let n = await nt({
|
|
25439
25697
|
query: t,
|
|
25440
25698
|
current: e,
|
|
25441
25699
|
segments: r,
|
|
@@ -25448,14 +25706,14 @@ async function Ne(e) {
|
|
|
25448
25706
|
}
|
|
25449
25707
|
//#endregion
|
|
25450
25708
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.ts
|
|
25451
|
-
var
|
|
25452
|
-
async function
|
|
25453
|
-
let n =
|
|
25709
|
+
var rt = new Set(["LN", "LN0"]);
|
|
25710
|
+
async function it(e, t) {
|
|
25711
|
+
let n = He(at(t));
|
|
25454
25712
|
if (!n) return;
|
|
25455
|
-
let r = await
|
|
25456
|
-
if (!(!r || !
|
|
25713
|
+
let r = await tt(e, n);
|
|
25714
|
+
if (!(!r || !rt.has(r.tagName))) return r;
|
|
25457
25715
|
}
|
|
25458
|
-
function
|
|
25716
|
+
function at(e) {
|
|
25459
25717
|
let t = (t) => e.attributes.find((e) => e.name === t)?.value;
|
|
25460
25718
|
return {
|
|
25461
25719
|
iedName: t("iedName"),
|
|
@@ -25466,151 +25724,30 @@ function Ie(e) {
|
|
|
25466
25724
|
};
|
|
25467
25725
|
}
|
|
25468
25726
|
//#endregion
|
|
25469
|
-
//#region src/v2019C1/extensions/reference/constants/resolution-types.ts
|
|
25470
|
-
var E = {
|
|
25471
|
-
direct: "direct",
|
|
25472
|
-
lnode: "lnode",
|
|
25473
|
-
iedAddress: "ied-address",
|
|
25474
|
-
behaviorDescription: "behavior-description",
|
|
25475
|
-
unsupported: "unsupported"
|
|
25476
|
-
}, D = {
|
|
25477
|
-
LN: [{
|
|
25478
|
-
attribute: "lnType",
|
|
25479
|
-
target: "LNodeType"
|
|
25480
|
-
}],
|
|
25481
|
-
LN0: [{
|
|
25482
|
-
attribute: "lnType",
|
|
25483
|
-
target: "LNodeType"
|
|
25484
|
-
}],
|
|
25485
|
-
LNode: [{
|
|
25486
|
-
attribute: "lnType",
|
|
25487
|
-
target: "LNodeType"
|
|
25488
|
-
}],
|
|
25489
|
-
DO: [{
|
|
25490
|
-
attribute: "type",
|
|
25491
|
-
target: "DOType"
|
|
25492
|
-
}],
|
|
25493
|
-
SDO: [{
|
|
25494
|
-
attribute: "type",
|
|
25495
|
-
target: "DOType"
|
|
25496
|
-
}],
|
|
25497
|
-
DA: [{
|
|
25498
|
-
attribute: "type",
|
|
25499
|
-
target: "EnumType",
|
|
25500
|
-
when: {
|
|
25501
|
-
attribute: "bType",
|
|
25502
|
-
equals: "Enum"
|
|
25503
|
-
}
|
|
25504
|
-
}, {
|
|
25505
|
-
attribute: "type",
|
|
25506
|
-
target: "DAType",
|
|
25507
|
-
when: {
|
|
25508
|
-
attribute: "bType",
|
|
25509
|
-
equals: "Struct"
|
|
25510
|
-
}
|
|
25511
|
-
}],
|
|
25512
|
-
BDA: [{
|
|
25513
|
-
attribute: "type",
|
|
25514
|
-
target: "EnumType",
|
|
25515
|
-
when: {
|
|
25516
|
-
attribute: "bType",
|
|
25517
|
-
equals: "Enum"
|
|
25518
|
-
}
|
|
25519
|
-
}, {
|
|
25520
|
-
attribute: "type",
|
|
25521
|
-
target: "DAType",
|
|
25522
|
-
when: {
|
|
25523
|
-
attribute: "bType",
|
|
25524
|
-
equals: "Struct"
|
|
25525
|
-
}
|
|
25526
|
-
}]
|
|
25527
|
-
};
|
|
25528
|
-
//#endregion
|
|
25529
|
-
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25530
|
-
function Le(e) {
|
|
25531
|
-
let t = {};
|
|
25532
|
-
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25533
|
-
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
25534
|
-
for (let t of e.target) {
|
|
25535
|
-
let i = r.get(t) ?? [];
|
|
25536
|
-
i.push({
|
|
25537
|
-
refTagName: n,
|
|
25538
|
-
uuidAttr: e.attribute.uuid,
|
|
25539
|
-
pathAttr: e.attribute.path
|
|
25540
|
-
}), r.set(t, i);
|
|
25541
|
-
}
|
|
25542
|
-
}
|
|
25543
|
-
return t;
|
|
25544
|
-
}
|
|
25545
|
-
function Re(e) {
|
|
25546
|
-
let t = /* @__PURE__ */ new Map();
|
|
25547
|
-
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25548
|
-
uuidAttr: e.attribute.uuid,
|
|
25549
|
-
pathAttr: e.attribute.path,
|
|
25550
|
-
resolution: e.resolution,
|
|
25551
|
-
targetTagNames: e.target
|
|
25552
|
-
})));
|
|
25553
|
-
return t;
|
|
25554
|
-
}
|
|
25555
|
-
function ze(e) {
|
|
25556
|
-
let t = /* @__PURE__ */ new Map();
|
|
25557
|
-
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25558
|
-
let r = t.get(e.target) ?? [];
|
|
25559
|
-
r.push({
|
|
25560
|
-
refTagName: n,
|
|
25561
|
-
attribute: e.attribute,
|
|
25562
|
-
when: e.when
|
|
25563
|
-
}), t.set(e.target, r);
|
|
25564
|
-
}
|
|
25565
|
-
return t;
|
|
25566
|
-
}
|
|
25567
|
-
//#endregion
|
|
25568
|
-
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25569
|
-
var Be = Le(T), Ve = [
|
|
25570
|
-
E.direct,
|
|
25571
|
-
E.lnode,
|
|
25572
|
-
E.iedAddress,
|
|
25573
|
-
E.behaviorDescription
|
|
25574
|
-
], He = [...Ve, E.unsupported], Ue = Re(T), We = [...new Set(Object.values(T).flatMap((e) => e.map((e) => e.attribute.uuid)))], Ge = new Map(Object.entries(D).map(([e, t]) => [e, [...new Set(t.map((e) => e.attribute))]])), Ke = ze(D), qe = new Set(Ke.keys()), Je = new Set([
|
|
25575
|
-
"SourceRef",
|
|
25576
|
-
"ControlRef",
|
|
25577
|
-
"DOS",
|
|
25578
|
-
"SDS",
|
|
25579
|
-
"DAS",
|
|
25580
|
-
"InputVar",
|
|
25581
|
-
"OutputVar",
|
|
25582
|
-
"ProcessEcho"
|
|
25583
|
-
]), Ye = {
|
|
25584
|
-
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25585
|
-
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25586
|
-
Resource: ["ProcessResource", "ProcessResources"],
|
|
25587
|
-
VariableApplyTo: ["Variable"]
|
|
25588
|
-
};
|
|
25589
|
-
//#endregion
|
|
25590
25727
|
//#region src/v2019C1/extensions/reference/guards.ts
|
|
25591
|
-
function
|
|
25592
|
-
return
|
|
25728
|
+
function ot(e) {
|
|
25729
|
+
return Ie.has(e);
|
|
25593
25730
|
}
|
|
25594
25731
|
//#endregion
|
|
25595
25732
|
//#region src/v2019C1/extensions/reference/query/find/find-refs-pointing-to.ts
|
|
25596
|
-
async function
|
|
25733
|
+
async function F(e, t) {
|
|
25597
25734
|
let { target: n, containerTagName: r } = t, i = await e.getRecord(n);
|
|
25598
|
-
return i ?
|
|
25735
|
+
return i ? ot(i.tagName) ? ct(e, i, r) : st(e, i, r) : [];
|
|
25599
25736
|
}
|
|
25600
|
-
async function
|
|
25737
|
+
async function st(e, t, r) {
|
|
25601
25738
|
let i = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25602
25739
|
if (!i) return [];
|
|
25603
|
-
let a =
|
|
25740
|
+
let a = ut(t.tagName);
|
|
25604
25741
|
if (a.length === 0) return [];
|
|
25605
25742
|
let o = [];
|
|
25606
25743
|
for (let t of a) {
|
|
25607
|
-
if (!n(t.refTagName,
|
|
25744
|
+
if (!n(t.refTagName, x)) continue;
|
|
25608
25745
|
let a = await e.findByAttributes({
|
|
25609
25746
|
tagName: t.refTagName,
|
|
25610
25747
|
attributes: { [t.uuidAttr]: i }
|
|
25611
25748
|
});
|
|
25612
25749
|
for (let t of a) {
|
|
25613
|
-
let n = r ? await
|
|
25750
|
+
let n = r ? await dt(e, t, r) : void 0;
|
|
25614
25751
|
o.push({
|
|
25615
25752
|
ref: t,
|
|
25616
25753
|
container: n
|
|
@@ -25619,19 +25756,19 @@ async function Ze(e, t, r) {
|
|
|
25619
25756
|
}
|
|
25620
25757
|
return o;
|
|
25621
25758
|
}
|
|
25622
|
-
async function
|
|
25759
|
+
async function ct(e, t, r) {
|
|
25623
25760
|
let i = t.attributes.find((e) => e.name === "id")?.value;
|
|
25624
25761
|
if (!i) return [];
|
|
25625
|
-
let a =
|
|
25762
|
+
let a = Fe.get(t.tagName) ?? [], o = [];
|
|
25626
25763
|
for (let t of a) {
|
|
25627
|
-
if (!n(t.refTagName,
|
|
25764
|
+
if (!n(t.refTagName, x)) continue;
|
|
25628
25765
|
let a = await e.findByAttributes({
|
|
25629
25766
|
tagName: t.refTagName,
|
|
25630
25767
|
attributes: { [t.attribute]: i }
|
|
25631
25768
|
});
|
|
25632
25769
|
for (let n of a) {
|
|
25633
|
-
if (
|
|
25634
|
-
let i = r ? await
|
|
25770
|
+
if (!lt(n, t)) continue;
|
|
25771
|
+
let i = r ? await dt(e, n, r) : void 0;
|
|
25635
25772
|
o.push({
|
|
25636
25773
|
ref: n,
|
|
25637
25774
|
container: i
|
|
@@ -25640,23 +25777,23 @@ async function Qe(e, t, r) {
|
|
|
25640
25777
|
}
|
|
25641
25778
|
return o;
|
|
25642
25779
|
}
|
|
25643
|
-
function
|
|
25780
|
+
function lt(e, t) {
|
|
25644
25781
|
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
25645
25782
|
}
|
|
25646
|
-
function
|
|
25783
|
+
function ut(e) {
|
|
25647
25784
|
let t = [];
|
|
25648
|
-
for (let n of
|
|
25649
|
-
let r =
|
|
25785
|
+
for (let n of Me) {
|
|
25786
|
+
let r = Ae[n]?.get(e);
|
|
25650
25787
|
r && t.push(...r);
|
|
25651
25788
|
}
|
|
25652
25789
|
return t;
|
|
25653
25790
|
}
|
|
25654
|
-
async function
|
|
25791
|
+
async function dt(e, t, n) {
|
|
25655
25792
|
return (await e.findAncestors(t, { stopAtTagName: n })).find((e) => e.tagName === n);
|
|
25656
25793
|
}
|
|
25657
25794
|
//#endregion
|
|
25658
25795
|
//#region src/v2019C1/extensions/reference/query/provenance/get-provenance.constants.ts
|
|
25659
|
-
var
|
|
25796
|
+
var ft = {
|
|
25660
25797
|
Application: "application",
|
|
25661
25798
|
Function: "function",
|
|
25662
25799
|
SubFunction: "function",
|
|
@@ -25667,10 +25804,10 @@ var nt = {
|
|
|
25667
25804
|
};
|
|
25668
25805
|
//#endregion
|
|
25669
25806
|
//#region src/v2019C1/extensions/reference/query/provenance/get-provenance.ts
|
|
25670
|
-
async function
|
|
25807
|
+
async function pt(e) {
|
|
25671
25808
|
let t = await e.getRecordsByTagName("SclFileReference"), n = [];
|
|
25672
25809
|
for (let r of t) {
|
|
25673
|
-
let t = await
|
|
25810
|
+
let t = await mt(e, r);
|
|
25674
25811
|
if (!t) continue;
|
|
25675
25812
|
let { fileType: i, fileUuid: a, fileName: o, version: s, revision: c } = await e.getAttributes(r);
|
|
25676
25813
|
n.push({
|
|
@@ -25684,17 +25821,17 @@ async function rt(e) {
|
|
|
25684
25821
|
}
|
|
25685
25822
|
return n;
|
|
25686
25823
|
}
|
|
25687
|
-
async function
|
|
25824
|
+
async function mt(e, t) {
|
|
25688
25825
|
let n = await e.findAncestors(t);
|
|
25689
25826
|
for (let e of n) {
|
|
25690
|
-
let t =
|
|
25827
|
+
let t = ft[e.tagName];
|
|
25691
25828
|
if (t) return {
|
|
25692
25829
|
kind: t,
|
|
25693
|
-
ref:
|
|
25830
|
+
ref: ht(e.tagName, e.id)
|
|
25694
25831
|
};
|
|
25695
25832
|
}
|
|
25696
25833
|
}
|
|
25697
|
-
function
|
|
25834
|
+
function ht(e, t) {
|
|
25698
25835
|
return {
|
|
25699
25836
|
tagName: e,
|
|
25700
25837
|
id: t
|
|
@@ -25702,22 +25839,23 @@ function at(e, t) {
|
|
|
25702
25839
|
}
|
|
25703
25840
|
//#endregion
|
|
25704
25841
|
//#region src/v2019C1/extensions/reference/query/index.ts
|
|
25705
|
-
var
|
|
25706
|
-
buildElementPath: () =>
|
|
25707
|
-
buildMappedLNodePath: () =>
|
|
25708
|
-
|
|
25709
|
-
|
|
25710
|
-
|
|
25711
|
-
|
|
25712
|
-
|
|
25713
|
-
|
|
25842
|
+
var gt = /* @__PURE__ */ l({
|
|
25843
|
+
buildElementPath: () => de,
|
|
25844
|
+
buildMappedLNodePath: () => He,
|
|
25845
|
+
buildMappedName: () => ze,
|
|
25846
|
+
buildReferencePath: () => Ce,
|
|
25847
|
+
findRefsPointingTo: () => F,
|
|
25848
|
+
getProvenance: () => pt,
|
|
25849
|
+
resolveElementPath: () => tt,
|
|
25850
|
+
resolveMappedLNode: () => it,
|
|
25851
|
+
resolveReferencePath: () => We
|
|
25714
25852
|
});
|
|
25715
25853
|
//#endregion
|
|
25716
25854
|
//#region src/v2019C1/extensions/reference/transaction/apply-type-id-remap.ts
|
|
25717
|
-
async function
|
|
25855
|
+
async function I(e, t) {
|
|
25718
25856
|
let { records: n, idRemap: r } = t;
|
|
25719
25857
|
if (r.size !== 0) for (let t of n) {
|
|
25720
|
-
let n =
|
|
25858
|
+
let n = P.get(t.tagName);
|
|
25721
25859
|
if (!n) continue;
|
|
25722
25860
|
let i = await e.getRecord(t);
|
|
25723
25861
|
if (!i) continue;
|
|
@@ -25733,12 +25871,12 @@ async function k(e, t) {
|
|
|
25733
25871
|
}
|
|
25734
25872
|
//#endregion
|
|
25735
25873
|
//#region src/v2019C1/extensions/reference/transaction/write-provenance.ts
|
|
25736
|
-
var
|
|
25874
|
+
var _t = {
|
|
25737
25875
|
FSD: "FunctionSclRef",
|
|
25738
25876
|
ASD: "ApplicationSclRef"
|
|
25739
25877
|
};
|
|
25740
|
-
async function
|
|
25741
|
-
let { sourceQuery: n, targetRoot: r, fileType: i } = t, [a] = await n.getRecordsByTagName("Header"), o = a ? await n.getAttributes(a) : void 0, s = await e.addChild(r, { tagName:
|
|
25878
|
+
async function vt(e, t) {
|
|
25879
|
+
let { sourceQuery: n, targetRoot: r, fileType: i } = t, [a] = await n.getRecordsByTagName("Header"), o = a ? await n.getAttributes(a) : void 0, s = await e.addChild(r, { tagName: _t[i] }), { name: c } = await n.getDocumentInfo();
|
|
25742
25880
|
await e.addChild(s, {
|
|
25743
25881
|
tagName: "SclFileReference",
|
|
25744
25882
|
attributes: {
|
|
@@ -25752,17 +25890,17 @@ async function ct(e, t) {
|
|
|
25752
25890
|
}
|
|
25753
25891
|
//#endregion
|
|
25754
25892
|
//#region src/v2019C1/extensions/reference/index.ts
|
|
25755
|
-
var
|
|
25756
|
-
query:
|
|
25757
|
-
transaction: /* @__PURE__ */
|
|
25758
|
-
applyTypeIdRemap: () =>
|
|
25759
|
-
writeProvenance: () =>
|
|
25893
|
+
var L = {
|
|
25894
|
+
query: gt,
|
|
25895
|
+
transaction: /* @__PURE__ */ l({
|
|
25896
|
+
applyTypeIdRemap: () => I,
|
|
25897
|
+
writeProvenance: () => vt
|
|
25760
25898
|
})
|
|
25761
25899
|
};
|
|
25762
25900
|
//#endregion
|
|
25763
25901
|
//#region src/v2019C1/extensions/clean-up/transaction/prune-empty-containers.ts
|
|
25764
|
-
async function
|
|
25765
|
-
let t = [...Object.values(
|
|
25902
|
+
async function yt(e) {
|
|
25903
|
+
let t = [...Object.values(Re).flat(), "Private"];
|
|
25766
25904
|
for (let n of t) {
|
|
25767
25905
|
let t = await e.getRecordsByTagName(n);
|
|
25768
25906
|
for (let n of t) n.children.length === 0 && await e.delete(n);
|
|
@@ -25770,27 +25908,26 @@ async function lt(e) {
|
|
|
25770
25908
|
}
|
|
25771
25909
|
//#endregion
|
|
25772
25910
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-uuid-refs.ts
|
|
25773
|
-
async function
|
|
25774
|
-
let t
|
|
25775
|
-
|
|
25776
|
-
let t = T[n], r = await e.getRecordsByTagName(n);
|
|
25911
|
+
async function bt(e) {
|
|
25912
|
+
for (let t of A) {
|
|
25913
|
+
let n = O[t], r = await e.getRecordsByTagName(t);
|
|
25777
25914
|
for (let i of r) {
|
|
25778
25915
|
let r = !1, a = !1, o = {};
|
|
25779
|
-
for (let
|
|
25780
|
-
let
|
|
25781
|
-
if (
|
|
25916
|
+
for (let t of n) {
|
|
25917
|
+
let n = await e.getAttribute(i, { name: t.attribute.uuid });
|
|
25918
|
+
if (n) if (r = !0, await xt(e, n, t.target)) a = !0;
|
|
25782
25919
|
else {
|
|
25783
|
-
o[
|
|
25784
|
-
for (let e of
|
|
25920
|
+
o[t.attribute.uuid] = void 0, o[t.attribute.path] = void 0;
|
|
25921
|
+
for (let e of t.companions) o[e.name] = void 0;
|
|
25785
25922
|
}
|
|
25786
25923
|
}
|
|
25787
25924
|
Object.keys(o).length > 0 && await e.update(i, { attributes: o });
|
|
25788
|
-
let s =
|
|
25925
|
+
let s = k.has(t);
|
|
25789
25926
|
r && !a && !s && await e.delete(i);
|
|
25790
25927
|
}
|
|
25791
25928
|
}
|
|
25792
25929
|
}
|
|
25793
|
-
async function
|
|
25930
|
+
async function xt(e, t, n) {
|
|
25794
25931
|
for (let r of n) {
|
|
25795
25932
|
let [n] = await e.findByAttributes({
|
|
25796
25933
|
tagName: r,
|
|
@@ -25802,171 +25939,80 @@ async function dt(e, t, n) {
|
|
|
25802
25939
|
}
|
|
25803
25940
|
//#endregion
|
|
25804
25941
|
//#region src/v2019C1/extensions/clean-up/index.ts
|
|
25805
|
-
var
|
|
25806
|
-
orphanUuidRefs: () =>
|
|
25807
|
-
pruneEmptyContainers: () =>
|
|
25808
|
-
resetLNode: () =>
|
|
25809
|
-
}) };
|
|
25810
|
-
//#endregion
|
|
25811
|
-
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
25812
|
-
async function ft(e, n) {
|
|
25813
|
-
let { records: r } = n, i = {
|
|
25814
|
-
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
25815
|
-
doTypes: /* @__PURE__ */ new Map(),
|
|
25816
|
-
daTypes: /* @__PURE__ */ new Map(),
|
|
25817
|
-
enumTypes: /* @__PURE__ */ new Map()
|
|
25818
|
-
};
|
|
25819
|
-
for (let n of r) {
|
|
25820
|
-
let r = await e.getAttribute(n, { name: "lnType" });
|
|
25821
|
-
if (!r) continue;
|
|
25822
|
-
let [a] = await e.findByAttributes({
|
|
25823
|
-
tagName: "LNodeType",
|
|
25824
|
-
attributes: { id: r }
|
|
25825
|
-
});
|
|
25826
|
-
if (o(a, {
|
|
25827
|
-
key: "ELEMENT_NOT_FOUND",
|
|
25828
|
-
detail: `LNodeType not found for lnType="${r}"`
|
|
25829
|
-
}), !M(i.lnodeTypes, r, a)) continue;
|
|
25830
|
-
let s = a.children.filter((e) => t(e, "DO")), c = await e.getRecords(s);
|
|
25831
|
-
for (let t of c) {
|
|
25832
|
-
if (!t) continue;
|
|
25833
|
-
let n = await e.getAttribute(t, { name: "type" });
|
|
25834
|
-
if (!n) continue;
|
|
25835
|
-
let [r] = await e.findByAttributes({
|
|
25836
|
-
tagName: "DOType",
|
|
25837
|
-
attributes: { id: n }
|
|
25838
|
-
});
|
|
25839
|
-
r && M(i.doTypes, n, r) && await pt({
|
|
25840
|
-
query: e,
|
|
25841
|
-
parent: r,
|
|
25842
|
-
dataModelMap: i
|
|
25843
|
-
});
|
|
25844
|
-
}
|
|
25845
|
-
}
|
|
25846
|
-
return {
|
|
25847
|
-
lnodeTypes: Array.from(i.lnodeTypes.values()),
|
|
25848
|
-
doTypes: Array.from(i.doTypes.values()),
|
|
25849
|
-
daTypes: Array.from(i.daTypes.values()),
|
|
25850
|
-
enumTypes: Array.from(i.enumTypes.values())
|
|
25851
|
-
};
|
|
25852
|
-
}
|
|
25853
|
-
function M(e, t, n) {
|
|
25854
|
-
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
25855
|
-
}
|
|
25856
|
-
async function pt(e) {
|
|
25857
|
-
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")));
|
|
25858
|
-
for (let e of a) {
|
|
25859
|
-
if (!e) continue;
|
|
25860
|
-
let t = await n.getAttribute(e, { name: "bType" }), r = await n.getAttribute(e, { name: "type" });
|
|
25861
|
-
if (r) {
|
|
25862
|
-
if (t === "Enum") {
|
|
25863
|
-
let [e] = await n.findByAttributes({
|
|
25864
|
-
tagName: "EnumType",
|
|
25865
|
-
attributes: { id: r }
|
|
25866
|
-
});
|
|
25867
|
-
e && M(i.enumTypes, r, e);
|
|
25868
|
-
} else if (t === "Struct") {
|
|
25869
|
-
let [e] = await n.findByAttributes({
|
|
25870
|
-
tagName: "DAType",
|
|
25871
|
-
attributes: { id: r }
|
|
25872
|
-
});
|
|
25873
|
-
e && M(i.daTypes, r, e) && await pt({
|
|
25874
|
-
query: n,
|
|
25875
|
-
parent: e,
|
|
25876
|
-
dataModelMap: i
|
|
25877
|
-
});
|
|
25878
|
-
}
|
|
25879
|
-
}
|
|
25880
|
-
}
|
|
25881
|
-
if (r.tagName === "DOType") {
|
|
25882
|
-
let e = r.children.filter((e) => t(e, "SDO")), a = await n.getRecords(e);
|
|
25883
|
-
for (let e of a) {
|
|
25884
|
-
let t = await n.getAttribute(e, { name: "type" });
|
|
25885
|
-
if (!t) continue;
|
|
25886
|
-
let [r] = await n.findByAttributes({
|
|
25887
|
-
tagName: "DOType",
|
|
25888
|
-
attributes: { id: t }
|
|
25889
|
-
});
|
|
25890
|
-
r && M(i.doTypes, t, r) && await pt({
|
|
25891
|
-
query: n,
|
|
25892
|
-
parent: r,
|
|
25893
|
-
dataModelMap: i
|
|
25894
|
-
});
|
|
25895
|
-
}
|
|
25896
|
-
}
|
|
25897
|
-
}
|
|
25898
|
-
//#endregion
|
|
25899
|
-
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
25900
|
-
var mt = /* @__PURE__ */ c({ resolve: () => ft }), ht = ["id", "uuid"];
|
|
25942
|
+
var R = { transaction: /* @__PURE__ */ l({
|
|
25943
|
+
orphanUuidRefs: () => bt,
|
|
25944
|
+
pruneEmptyContainers: () => yt,
|
|
25945
|
+
resetLNode: () => ne
|
|
25946
|
+
}) }, St = ["id", "uuid"];
|
|
25901
25947
|
//#endregion
|
|
25902
25948
|
//#region src/v2019C1/extensions/signature/query/element-signature.ts
|
|
25903
|
-
async function
|
|
25949
|
+
async function Ct(e, t) {
|
|
25904
25950
|
let n = {
|
|
25905
25951
|
query: e,
|
|
25906
25952
|
resolveReferences: t.resolveReferences ?? !1,
|
|
25907
|
-
ignore: new Set(t.ignoreAttributes ??
|
|
25953
|
+
ignore: new Set(t.ignoreAttributes ?? St),
|
|
25908
25954
|
memo: /* @__PURE__ */ new Map(),
|
|
25909
25955
|
seen: /* @__PURE__ */ new Set()
|
|
25910
25956
|
};
|
|
25911
|
-
return
|
|
25957
|
+
return Et(t.ref, n);
|
|
25912
25958
|
}
|
|
25913
|
-
var
|
|
25914
|
-
function
|
|
25915
|
-
return
|
|
25959
|
+
var wt = /* @__PURE__ */ new Set();
|
|
25960
|
+
function Tt(e, t) {
|
|
25961
|
+
return _[e]?.attributes?.details?.[t]?.default;
|
|
25916
25962
|
}
|
|
25917
|
-
async function
|
|
25963
|
+
async function Et(e, t) {
|
|
25918
25964
|
let n = `${e.tagName}:${e.id}`, r = t.memo.get(n);
|
|
25919
25965
|
if (r !== void 0) return r;
|
|
25920
25966
|
if (t.seen.has(n)) return `@cycle:${e.tagName}`;
|
|
25921
25967
|
t.seen.add(n);
|
|
25922
|
-
let i = await t.query.getTree(e), a = i ? await
|
|
25968
|
+
let i = await t.query.getTree(e), a = i ? await Dt(i, t) : "";
|
|
25923
25969
|
return t.seen.delete(n), t.memo.set(n, a), a;
|
|
25924
25970
|
}
|
|
25925
|
-
async function
|
|
25926
|
-
let n = t.resolveReferences ?
|
|
25971
|
+
async function Dt(e, t) {
|
|
25972
|
+
let n = t.resolveReferences ? Mt(e.tagName) : wt, r = [];
|
|
25927
25973
|
for (let i of e.attributes) {
|
|
25928
|
-
if (t.ignore.has(i.name) || n.has(i.name) || i.value ===
|
|
25974
|
+
if (t.ignore.has(i.name) || n.has(i.name) || i.value === Tt(e.tagName, i.name)) continue;
|
|
25929
25975
|
let a = i.value;
|
|
25930
25976
|
if (t.resolveReferences) {
|
|
25931
|
-
let n = await
|
|
25977
|
+
let n = await Ot(e, i.name, i.value, t);
|
|
25932
25978
|
n !== null && (a = `@sig:${n}`);
|
|
25933
25979
|
}
|
|
25934
25980
|
r.push(`${JSON.stringify(i.name)}:${JSON.stringify(a)}`);
|
|
25935
25981
|
}
|
|
25936
25982
|
r.sort();
|
|
25937
25983
|
let i = [];
|
|
25938
|
-
for (let n of e.tree ?? []) i.push(await
|
|
25984
|
+
for (let n of e.tree ?? []) i.push(await Dt(n, t));
|
|
25939
25985
|
i.sort();
|
|
25940
25986
|
let a = e.value?.trim(), o = a ? `,value:${JSON.stringify(a)}` : "";
|
|
25941
25987
|
return `{tag:${JSON.stringify(e.tagName)},attrs:[${r.join(",")}]${o},children:[${i.join(",")}]}`;
|
|
25942
25988
|
}
|
|
25943
|
-
async function
|
|
25944
|
-
let i =
|
|
25989
|
+
async function Ot(e, t, n, r) {
|
|
25990
|
+
let i = kt(e, t);
|
|
25945
25991
|
if (i) {
|
|
25946
|
-
let e = await
|
|
25947
|
-
return e ?
|
|
25992
|
+
let e = await Nt(r.query, i.target, n);
|
|
25993
|
+
return e ? Et(e, r) : `@missing:${n}`;
|
|
25948
25994
|
}
|
|
25949
|
-
let a =
|
|
25995
|
+
let a = jt(e.tagName, t);
|
|
25950
25996
|
if (a) {
|
|
25951
|
-
let e = await
|
|
25952
|
-
return e ?
|
|
25997
|
+
let e = await Pt(r.query, a.target, n);
|
|
25998
|
+
return e ? Et(e, r) : `@missing:${n}`;
|
|
25953
25999
|
}
|
|
25954
26000
|
return null;
|
|
25955
26001
|
}
|
|
25956
|
-
function
|
|
25957
|
-
return
|
|
26002
|
+
function kt(e, t) {
|
|
26003
|
+
return M[e.tagName]?.find((n) => n.attribute === t && At(e, n));
|
|
25958
26004
|
}
|
|
25959
|
-
function
|
|
26005
|
+
function At(e, t) {
|
|
25960
26006
|
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
25961
26007
|
}
|
|
25962
|
-
function
|
|
25963
|
-
return
|
|
26008
|
+
function jt(e, t) {
|
|
26009
|
+
return O[e]?.find((e) => e.attribute.uuid === t);
|
|
25964
26010
|
}
|
|
25965
|
-
function
|
|
25966
|
-
let t =
|
|
25967
|
-
return t ? new Set(t.map((e) => e.attribute.path)) :
|
|
26011
|
+
function Mt(e) {
|
|
26012
|
+
let t = O[e];
|
|
26013
|
+
return t ? new Set(t.map((e) => e.attribute.path)) : wt;
|
|
25968
26014
|
}
|
|
25969
|
-
async function
|
|
26015
|
+
async function Nt(e, t, n) {
|
|
25970
26016
|
let [r] = await e.findByAttributes({
|
|
25971
26017
|
tagName: t,
|
|
25972
26018
|
attributes: { id: n }
|
|
@@ -25976,7 +26022,7 @@ async function Et(e, t, n) {
|
|
|
25976
26022
|
id: r.id
|
|
25977
26023
|
} : null;
|
|
25978
26024
|
}
|
|
25979
|
-
async function
|
|
26025
|
+
async function Pt(e, t, n) {
|
|
25980
26026
|
for (let r of t) {
|
|
25981
26027
|
let [t] = await e.findByAttributes({
|
|
25982
26028
|
tagName: r,
|
|
@@ -25991,14 +26037,14 @@ async function Dt(e, t, n) {
|
|
|
25991
26037
|
}
|
|
25992
26038
|
//#endregion
|
|
25993
26039
|
//#region src/v2019C1/extensions/signature/query/index.ts
|
|
25994
|
-
var
|
|
26040
|
+
var Ft = /* @__PURE__ */ l({ elementSignature: () => Ct });
|
|
25995
26041
|
//#endregion
|
|
25996
26042
|
//#region src/v2019C1/extensions/data-model/transaction/import-types.ts
|
|
25997
|
-
async function
|
|
25998
|
-
let { sourceQuery: n, records: r, cloneMappings: i = [], forkPrefix: a = "", keepNameTypesFrom: o = "target" } = t, s =
|
|
26043
|
+
async function It(e, t) {
|
|
26044
|
+
let { sourceQuery: n, records: r, cloneMappings: i = [], forkPrefix: a = "", keepNameTypesFrom: o = "target" } = t, s = Lt(await S(n, { records: r })), c = await e.ensureChild(await e.getRoot(), {
|
|
25999
26045
|
tagName: "DataTypeTemplates",
|
|
26000
26046
|
attributes: {}
|
|
26001
|
-
}), l = await
|
|
26047
|
+
}), l = await zt(e), u = /* @__PURE__ */ new Map(), d = [], f = [], p = {
|
|
26002
26048
|
reused: 0,
|
|
26003
26049
|
preserved: 0,
|
|
26004
26050
|
forked: 0,
|
|
@@ -26007,7 +26053,7 @@ async function kt(e, t) {
|
|
|
26007
26053
|
for (let t of s) {
|
|
26008
26054
|
let r = await n.getAttribute(t, { name: "id" });
|
|
26009
26055
|
if (!r) continue;
|
|
26010
|
-
let i = await
|
|
26056
|
+
let i = await Ct(n, {
|
|
26011
26057
|
ref: {
|
|
26012
26058
|
tagName: t.tagName,
|
|
26013
26059
|
id: t.id
|
|
@@ -26015,7 +26061,7 @@ async function kt(e, t) {
|
|
|
26015
26061
|
resolveReferences: !0
|
|
26016
26062
|
}), s = l.get(i);
|
|
26017
26063
|
if (s !== void 0) {
|
|
26018
|
-
let n = o === "source" ? await
|
|
26064
|
+
let n = o === "source" ? await Bt(e, {
|
|
26019
26065
|
tagName: t.tagName,
|
|
26020
26066
|
currentId: s,
|
|
26021
26067
|
desiredId: r
|
|
@@ -26029,24 +26075,25 @@ async function kt(e, t) {
|
|
|
26029
26075
|
tagName: t.tagName,
|
|
26030
26076
|
attributes: { id: r }
|
|
26031
26077
|
}), g = r, _ = m;
|
|
26032
|
-
h ? (g = await
|
|
26078
|
+
h ? (g = await qt(e, t.tagName, `${a}${r}_${Jt(i)}`), _ = Vt(m, g), p.forked++) : p.preserved++;
|
|
26033
26079
|
let v = await e.deepClone(c, _);
|
|
26034
|
-
u.set(r, g), v?.record && (d.push(
|
|
26080
|
+
u.set(r, g), v?.record && (d.push(z(v.record.tagName, v.record.id)), h && f.push({
|
|
26035
26081
|
oldId: r,
|
|
26036
|
-
oldRef:
|
|
26037
|
-
forkRef:
|
|
26082
|
+
oldRef: z(h.tagName, h.id),
|
|
26083
|
+
forkRef: z(v.record.tagName, v.record.id),
|
|
26038
26084
|
forkedId: g
|
|
26039
26085
|
}));
|
|
26040
26086
|
}
|
|
26041
|
-
let m =
|
|
26087
|
+
let m = [];
|
|
26088
|
+
for (let t of i) t.target.tagName === "LNode" && await T(e, t.target) || m.push(t.target);
|
|
26042
26089
|
for (let t of d) {
|
|
26043
26090
|
let n = await e.getTree(t);
|
|
26044
|
-
n &&
|
|
26091
|
+
n && Ht(n, m);
|
|
26045
26092
|
}
|
|
26046
|
-
return await
|
|
26093
|
+
return await I(e, {
|
|
26047
26094
|
records: m,
|
|
26048
26095
|
idRemap: u
|
|
26049
|
-
}), f.length > 0 && await
|
|
26096
|
+
}), f.length > 0 && await Ut(e, {
|
|
26050
26097
|
collisions: f,
|
|
26051
26098
|
idRemap: u,
|
|
26052
26099
|
referrerRecords: m,
|
|
@@ -26056,7 +26103,7 @@ async function kt(e, t) {
|
|
|
26056
26103
|
stats: p
|
|
26057
26104
|
};
|
|
26058
26105
|
}
|
|
26059
|
-
function
|
|
26106
|
+
function Lt(e) {
|
|
26060
26107
|
return [
|
|
26061
26108
|
...e.enumTypes,
|
|
26062
26109
|
...e.daTypes,
|
|
@@ -26064,20 +26111,20 @@ function At(e) {
|
|
|
26064
26111
|
...e.lnodeTypes
|
|
26065
26112
|
];
|
|
26066
26113
|
}
|
|
26067
|
-
var
|
|
26114
|
+
var Rt = [
|
|
26068
26115
|
"EnumType",
|
|
26069
26116
|
"DAType",
|
|
26070
26117
|
"DOType",
|
|
26071
26118
|
"LNodeType"
|
|
26072
26119
|
];
|
|
26073
|
-
async function
|
|
26120
|
+
async function zt(e) {
|
|
26074
26121
|
let t = /* @__PURE__ */ new Map();
|
|
26075
|
-
for (let n of
|
|
26122
|
+
for (let n of Rt) {
|
|
26076
26123
|
let r = await e.getRecordsByTagName(n);
|
|
26077
26124
|
for (let i of r) {
|
|
26078
26125
|
let r = i.attributes.find((e) => e.name === "id")?.value;
|
|
26079
26126
|
if (!r) continue;
|
|
26080
|
-
let a = await
|
|
26127
|
+
let a = await Ct(e, {
|
|
26081
26128
|
ref: {
|
|
26082
26129
|
tagName: n,
|
|
26083
26130
|
id: i.id
|
|
@@ -26089,7 +26136,7 @@ async function Mt(e) {
|
|
|
26089
26136
|
}
|
|
26090
26137
|
return t;
|
|
26091
26138
|
}
|
|
26092
|
-
async function
|
|
26139
|
+
async function Bt(e, t) {
|
|
26093
26140
|
let { tagName: n, currentId: r, desiredId: i } = t;
|
|
26094
26141
|
if (r === i) return r;
|
|
26095
26142
|
let [a] = await e.findByAttributes({
|
|
@@ -26102,32 +26149,32 @@ async function Nt(e, t) {
|
|
|
26102
26149
|
attributes: { id: i }
|
|
26103
26150
|
});
|
|
26104
26151
|
if (o && o.id !== a.id) return r;
|
|
26105
|
-
let s =
|
|
26106
|
-
return await e.update(s, { attributes: { id: i } }), await
|
|
26107
|
-
records: c.map((e) =>
|
|
26152
|
+
let s = z(a.tagName, a.id), c = await F(e, { target: s });
|
|
26153
|
+
return await e.update(s, { attributes: { id: i } }), await I(e, {
|
|
26154
|
+
records: c.map((e) => z(e.ref.tagName, e.ref.id)),
|
|
26108
26155
|
idRemap: new Map([[r, i]])
|
|
26109
26156
|
}), i;
|
|
26110
26157
|
}
|
|
26111
|
-
function
|
|
26158
|
+
function Vt(e, t) {
|
|
26112
26159
|
let n = structuredClone(e), r = n.attributes, i = r.find((e) => e.name === "id");
|
|
26113
26160
|
return i ? i.value = t : r.push({
|
|
26114
26161
|
name: "id",
|
|
26115
26162
|
value: t
|
|
26116
26163
|
}), n;
|
|
26117
26164
|
}
|
|
26118
|
-
function
|
|
26165
|
+
function z(e, t) {
|
|
26119
26166
|
return {
|
|
26120
26167
|
tagName: e,
|
|
26121
26168
|
id: t
|
|
26122
26169
|
};
|
|
26123
26170
|
}
|
|
26124
|
-
function
|
|
26125
|
-
t.push(
|
|
26126
|
-
for (let n of e.tree ?? [])
|
|
26171
|
+
function Ht(e, t) {
|
|
26172
|
+
t.push(z(e.tagName, e.id));
|
|
26173
|
+
for (let n of e.tree ?? []) Ht(n, t);
|
|
26127
26174
|
}
|
|
26128
|
-
var
|
|
26129
|
-
async function
|
|
26130
|
-
let { collisions: n, idRemap: r, referrerRecords: i, stats: a } = t, o = await
|
|
26175
|
+
var B = (e) => `${e.tagName}#${e.id}`;
|
|
26176
|
+
async function Ut(e, t) {
|
|
26177
|
+
let { collisions: n, idRemap: r, referrerRecords: i, stats: a } = t, o = await Wt(e, n), s = /* @__PURE__ */ new Map(), c = [];
|
|
26131
26178
|
for (let t of n) if (o.has(t.oldId)) {
|
|
26132
26179
|
await e.update(t.forkRef, { attributes: { id: t.oldId } }), s.set(t.forkedId, t.oldId), c.push(t.forkRef), a.reclaimed++;
|
|
26133
26180
|
for (let [e, n] of r) n === t.forkedId && r.set(e, t.oldId);
|
|
@@ -26136,38 +26183,38 @@ async function It(e, t) {
|
|
|
26136
26183
|
let l = [...i];
|
|
26137
26184
|
for (let t of c) {
|
|
26138
26185
|
let n = await e.getTree(t);
|
|
26139
|
-
n &&
|
|
26186
|
+
n && Ht(n, l);
|
|
26140
26187
|
}
|
|
26141
|
-
await
|
|
26188
|
+
await I(e, {
|
|
26142
26189
|
records: l,
|
|
26143
26190
|
idRemap: s
|
|
26144
26191
|
});
|
|
26145
26192
|
}
|
|
26146
|
-
async function
|
|
26147
|
-
let n = /* @__PURE__ */ new Set(), r = new Map(t.map((e) => [
|
|
26193
|
+
async function Wt(e, t) {
|
|
26194
|
+
let n = /* @__PURE__ */ new Set(), r = new Map(t.map((e) => [B(e.oldRef), e.oldId])), i = t.map((e) => e.oldRef), a = new Set(i.map(B)), o = /* @__PURE__ */ new Set(), s = !0;
|
|
26148
26195
|
for (; s;) {
|
|
26149
26196
|
s = !1;
|
|
26150
26197
|
for (let t of i) {
|
|
26151
|
-
let c =
|
|
26152
|
-
if (o.has(c) || (await
|
|
26153
|
-
let l = await e.getTree(t), u = l ? await
|
|
26198
|
+
let c = B(t);
|
|
26199
|
+
if (o.has(c) || (await F(e, { target: t })).length > 0) continue;
|
|
26200
|
+
let l = await e.getTree(t), u = l ? await Gt(e, l) : [];
|
|
26154
26201
|
await e.delete(t), o.add(c), s = !0;
|
|
26155
26202
|
let d = r.get(c);
|
|
26156
26203
|
d !== void 0 && n.add(d);
|
|
26157
26204
|
for (let e of u) {
|
|
26158
|
-
let t =
|
|
26205
|
+
let t = B(e);
|
|
26159
26206
|
a.has(t) || (i.push(e), a.add(t));
|
|
26160
26207
|
}
|
|
26161
26208
|
}
|
|
26162
26209
|
}
|
|
26163
26210
|
return n;
|
|
26164
26211
|
}
|
|
26165
|
-
async function
|
|
26212
|
+
async function Gt(e, t) {
|
|
26166
26213
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
26167
26214
|
async function i(t) {
|
|
26168
|
-
let a =
|
|
26215
|
+
let a = M[t.tagName];
|
|
26169
26216
|
for (let i of a ?? []) {
|
|
26170
|
-
if (!
|
|
26217
|
+
if (!Kt(t, i)) continue;
|
|
26171
26218
|
let a = t.attributes.find((e) => e.name === i.attribute)?.value;
|
|
26172
26219
|
if (!a) continue;
|
|
26173
26220
|
let [o] = await e.findByAttributes({
|
|
@@ -26175,17 +26222,17 @@ async function Rt(e, t) {
|
|
|
26175
26222
|
attributes: { id: a }
|
|
26176
26223
|
});
|
|
26177
26224
|
if (!o) continue;
|
|
26178
|
-
let s =
|
|
26225
|
+
let s = z(i.target, o.id), c = B(s);
|
|
26179
26226
|
r.has(c) || (r.add(c), n.push(s));
|
|
26180
26227
|
}
|
|
26181
26228
|
for (let e of t.tree ?? []) await i(e);
|
|
26182
26229
|
}
|
|
26183
26230
|
return await i(t), n;
|
|
26184
26231
|
}
|
|
26185
|
-
function
|
|
26232
|
+
function Kt(e, t) {
|
|
26186
26233
|
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
26187
26234
|
}
|
|
26188
|
-
async function
|
|
26235
|
+
async function qt(e, t, n) {
|
|
26189
26236
|
let r = n, i = 2;
|
|
26190
26237
|
for (; (await e.findByAttributes({
|
|
26191
26238
|
tagName: t,
|
|
@@ -26193,20 +26240,20 @@ async function Bt(e, t, n) {
|
|
|
26193
26240
|
})).length > 0;) r = `${n}_${i}`, i += 1;
|
|
26194
26241
|
return r;
|
|
26195
26242
|
}
|
|
26196
|
-
function
|
|
26243
|
+
function Jt(e) {
|
|
26197
26244
|
let t = 2166136261;
|
|
26198
26245
|
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
26199
26246
|
return (t >>> 0).toString(16).padStart(8, "0");
|
|
26200
26247
|
}
|
|
26201
26248
|
//#endregion
|
|
26202
26249
|
//#region src/v2019C1/extensions/data-model/index.ts
|
|
26203
|
-
var
|
|
26204
|
-
query:
|
|
26205
|
-
transaction: /* @__PURE__ */
|
|
26250
|
+
var Yt = {
|
|
26251
|
+
query: te,
|
|
26252
|
+
transaction: /* @__PURE__ */ l({ importTypes: () => It })
|
|
26206
26253
|
};
|
|
26207
26254
|
//#endregion
|
|
26208
26255
|
//#region src/v2019C1/extensions/history/query/get-sorted-hitem.ts
|
|
26209
|
-
async function
|
|
26256
|
+
async function Xt(e) {
|
|
26210
26257
|
let t = await e.getRecord({ tagName: "History" });
|
|
26211
26258
|
if (!t) return [];
|
|
26212
26259
|
let { Hitem: n = [] } = await e.findDescendants(t, { collect: "Hitem" });
|
|
@@ -26220,18 +26267,18 @@ async function Ut(e) {
|
|
|
26220
26267
|
}
|
|
26221
26268
|
//#endregion
|
|
26222
26269
|
//#region src/v2019C1/extensions/history/query/get-latest-hitem.ts
|
|
26223
|
-
async function
|
|
26224
|
-
return (await
|
|
26270
|
+
async function Zt(e) {
|
|
26271
|
+
return (await Xt(e)).at(-1);
|
|
26225
26272
|
}
|
|
26226
26273
|
//#endregion
|
|
26227
26274
|
//#region src/v2019C1/extensions/history/query/index.ts
|
|
26228
|
-
var
|
|
26229
|
-
getLatestHitem: () =>
|
|
26230
|
-
getSortedHitems: () =>
|
|
26275
|
+
var Qt = /* @__PURE__ */ l({
|
|
26276
|
+
getLatestHitem: () => Zt,
|
|
26277
|
+
getSortedHitems: () => Xt
|
|
26231
26278
|
});
|
|
26232
26279
|
//#endregion
|
|
26233
26280
|
//#region src/v2019C1/extensions/history/transaction/add-entry.ts
|
|
26234
|
-
async function
|
|
26281
|
+
async function $t(e, t) {
|
|
26235
26282
|
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, p = await e.getRoot(), m = await e.getRecord({ tagName: "Header" }) ?? await e.addChild(p, {
|
|
26236
26283
|
tagName: "Header",
|
|
26237
26284
|
attributes: {
|
|
@@ -26246,18 +26293,18 @@ async function Kt(e, t) {
|
|
|
26246
26293
|
}), h = await e.getRecord({ tagName: "History" }) ?? await e.addChild(m, {
|
|
26247
26294
|
tagName: "History",
|
|
26248
26295
|
attributes: {}
|
|
26249
|
-
}), g = await
|
|
26296
|
+
}), g = await Zt(e), _ = g?.attributes.find((e) => e.name === "version")?.value, v = g?.attributes.find((e) => e.name === "revision")?.value, y = c === "keep" ? _ ?? "0" : _ ? String(Number(_) + 1) : "0", b = v ? String(Number(v) + 1) : "1";
|
|
26250
26297
|
await e.update(m, { attributes: {
|
|
26251
26298
|
version: y,
|
|
26252
26299
|
revision: b
|
|
26253
26300
|
} });
|
|
26254
|
-
let
|
|
26301
|
+
let x = /* @__PURE__ */ new Date(), S = x.toString().split(" "), C = x.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), w = `${S[0]} ${S[1]} ${S[2]} ${S[4]} ${C} ${S[3]}`;
|
|
26255
26302
|
await e.addChild(h, {
|
|
26256
26303
|
tagName: "Hitem",
|
|
26257
26304
|
attributes: {
|
|
26258
26305
|
version: y,
|
|
26259
26306
|
revision: b,
|
|
26260
|
-
when:
|
|
26307
|
+
when: w,
|
|
26261
26308
|
who: u,
|
|
26262
26309
|
what: d,
|
|
26263
26310
|
why: f
|
|
@@ -26269,57 +26316,57 @@ async function Kt(e, t) {
|
|
|
26269
26316
|
}
|
|
26270
26317
|
//#endregion
|
|
26271
26318
|
//#region src/v2019C1/extensions/history/index.ts
|
|
26272
|
-
var
|
|
26273
|
-
query:
|
|
26274
|
-
transaction: /* @__PURE__ */
|
|
26319
|
+
var en = {
|
|
26320
|
+
query: Qt,
|
|
26321
|
+
transaction: /* @__PURE__ */ l({ addEntry: () => $t })
|
|
26275
26322
|
};
|
|
26276
26323
|
//#endregion
|
|
26277
26324
|
//#region src/v2019C1/extensions/identity/transaction/write-identity.ts
|
|
26278
|
-
async function
|
|
26325
|
+
async function V(e, t) {
|
|
26279
26326
|
let { mappings: n, mode: r } = t;
|
|
26280
26327
|
if (r !== "keep") for (let t of n) {
|
|
26281
|
-
let n = r === "strip" ?
|
|
26328
|
+
let n = r === "strip" ? tn() : nn(t);
|
|
26282
26329
|
if (Object.keys(n).length === 0) continue;
|
|
26283
26330
|
let i = await e.getRecord(t.target);
|
|
26284
26331
|
i && await e.update(i, { attributes: n });
|
|
26285
26332
|
}
|
|
26286
26333
|
}
|
|
26287
|
-
function
|
|
26334
|
+
function tn() {
|
|
26288
26335
|
return {
|
|
26289
26336
|
templateUuid: void 0,
|
|
26290
26337
|
originUuid: void 0
|
|
26291
26338
|
};
|
|
26292
26339
|
}
|
|
26293
|
-
function
|
|
26294
|
-
let t =
|
|
26340
|
+
function nn(e) {
|
|
26341
|
+
let t = an(e.source.attributes, "uuid"), n = an(e.source.attributes, "templateUuid"), r = an(e.source.attributes, "originUuid"), i = {};
|
|
26295
26342
|
t && (i.templateUuid = t);
|
|
26296
|
-
let a =
|
|
26343
|
+
let a = rn(e.target.tagName);
|
|
26297
26344
|
return n && !r && a && (i.originUuid = n), i;
|
|
26298
26345
|
}
|
|
26299
|
-
function
|
|
26300
|
-
let t =
|
|
26346
|
+
function rn(e) {
|
|
26347
|
+
let t = x.attributes[e];
|
|
26301
26348
|
return t ? "originUuid" in t : !1;
|
|
26302
26349
|
}
|
|
26303
|
-
function
|
|
26350
|
+
function an(e, t) {
|
|
26304
26351
|
return e.find((e) => e.name === t)?.value;
|
|
26305
26352
|
}
|
|
26306
26353
|
//#endregion
|
|
26307
26354
|
//#region src/v2019C1/extensions/identity/index.ts
|
|
26308
|
-
var
|
|
26355
|
+
var on = { transaction: /* @__PURE__ */ l({ writeIdentity: () => V }) };
|
|
26309
26356
|
//#endregion
|
|
26310
26357
|
//#region src/v2019C1/extensions/lifecycle/engine/group.ts
|
|
26311
|
-
function
|
|
26358
|
+
function sn(e, t) {
|
|
26312
26359
|
let n = [];
|
|
26313
|
-
return
|
|
26360
|
+
return cn({
|
|
26314
26361
|
node: e,
|
|
26315
26362
|
instanceScopeId: t,
|
|
26316
26363
|
out: n
|
|
26317
26364
|
}), n;
|
|
26318
26365
|
}
|
|
26319
|
-
function
|
|
26366
|
+
function cn(e) {
|
|
26320
26367
|
let { node: t, instanceScopeId: n, out: r } = e;
|
|
26321
26368
|
if (t.change === "unchanged") {
|
|
26322
|
-
for (let e of t.children)
|
|
26369
|
+
for (let e of t.children) cn({
|
|
26323
26370
|
node: e,
|
|
26324
26371
|
instanceScopeId: n,
|
|
26325
26372
|
out: r
|
|
@@ -26327,105 +26374,118 @@ function en(e) {
|
|
|
26327
26374
|
return;
|
|
26328
26375
|
}
|
|
26329
26376
|
let i = [];
|
|
26330
|
-
|
|
26377
|
+
ln({
|
|
26331
26378
|
node: t,
|
|
26332
26379
|
out: i
|
|
26333
26380
|
}), r.push({
|
|
26334
|
-
id:
|
|
26381
|
+
id: un(t, n),
|
|
26335
26382
|
change: t.change,
|
|
26336
26383
|
title: `${t.change} ${t.tagName}`,
|
|
26337
26384
|
primary: t,
|
|
26338
26385
|
companions: i,
|
|
26339
26386
|
dependsOn: [],
|
|
26340
|
-
suggestedAction: "accept",
|
|
26387
|
+
suggestedAction: t.change === "target-only" ? "skip" : "accept",
|
|
26341
26388
|
instanceScopeId: n
|
|
26342
26389
|
});
|
|
26343
26390
|
}
|
|
26344
|
-
function
|
|
26391
|
+
function ln(e) {
|
|
26345
26392
|
let { node: t, out: n } = e;
|
|
26346
|
-
for (let e of t.children) e.change !== "unchanged" && n.push(e),
|
|
26393
|
+
for (let e of t.children) e.change !== "unchanged" && n.push(e), ln({
|
|
26347
26394
|
node: e,
|
|
26348
26395
|
out: n
|
|
26349
26396
|
});
|
|
26350
26397
|
}
|
|
26351
|
-
function
|
|
26398
|
+
function un(e, t) {
|
|
26352
26399
|
let n = e.sourceRef ?? e.instanceRef, r = n ? `${n.tagName}:${n.id}` : e.tagName;
|
|
26353
26400
|
return t ? `${t}::${r}` : r;
|
|
26354
26401
|
}
|
|
26355
26402
|
//#endregion
|
|
26356
26403
|
//#region src/v2019C1/extensions/lifecycle/engine/visible-attributes.ts
|
|
26357
|
-
var
|
|
26404
|
+
var dn = new Set([
|
|
26358
26405
|
"uuid",
|
|
26359
26406
|
"templateUuid",
|
|
26360
26407
|
"originUuid"
|
|
26361
|
-
]),
|
|
26362
|
-
function
|
|
26408
|
+
]), fn = new Set(Object.values(O).flatMap((e) => e.flatMap((e) => [e.attribute.path, e.attribute.uuid])));
|
|
26409
|
+
function H(e) {
|
|
26363
26410
|
let t = {};
|
|
26364
|
-
for (let [n, r] of Object.entries(e))
|
|
26411
|
+
for (let [n, r] of Object.entries(e)) dn.has(n) || n === "name" || fn.has(n) || (t[n] = r);
|
|
26365
26412
|
return t;
|
|
26366
26413
|
}
|
|
26367
26414
|
//#endregion
|
|
26368
26415
|
//#region src/v2019C1/extensions/lifecycle/engine/diff.ts
|
|
26369
|
-
var
|
|
26370
|
-
|
|
26416
|
+
var pn = new Set([
|
|
26417
|
+
"LNodeSpecNaming",
|
|
26418
|
+
"FunctionSclRef",
|
|
26419
|
+
"ApplicationSclRef",
|
|
26420
|
+
"SclFileReference"
|
|
26421
|
+
]);
|
|
26422
|
+
async function mn(e) {
|
|
26371
26423
|
let { sourceQuery: t, targetQuery: n, sourceRootRef: r, instanceRootRef: i } = e, a = await t.any.getTree(r);
|
|
26372
26424
|
if (!a) throw Error("diff: source subtree not found");
|
|
26373
26425
|
let o = i ? await n.any.getTree(i) : void 0;
|
|
26374
26426
|
if (!o) {
|
|
26375
|
-
let e =
|
|
26427
|
+
let e = gn(a);
|
|
26376
26428
|
return {
|
|
26377
26429
|
root: e,
|
|
26378
26430
|
roots: [e],
|
|
26379
|
-
groups:
|
|
26431
|
+
groups: sn(e),
|
|
26380
26432
|
needsDecisions: !1,
|
|
26381
|
-
summary:
|
|
26433
|
+
summary: wn(e)
|
|
26382
26434
|
};
|
|
26383
26435
|
}
|
|
26384
26436
|
let s = /* @__PURE__ */ new Map();
|
|
26385
|
-
await
|
|
26437
|
+
await xn(n, {
|
|
26386
26438
|
node: o,
|
|
26387
26439
|
index: s
|
|
26388
26440
|
});
|
|
26389
26441
|
let c = /* @__PURE__ */ new Set();
|
|
26390
|
-
await
|
|
26442
|
+
await Sn(t, {
|
|
26391
26443
|
node: a,
|
|
26392
26444
|
out: c
|
|
26393
26445
|
});
|
|
26394
|
-
let l = await
|
|
26446
|
+
let l = await hn(t, {
|
|
26395
26447
|
targetQuery: n,
|
|
26396
26448
|
sourceNode: a,
|
|
26397
26449
|
instanceNode: o,
|
|
26398
26450
|
index: s,
|
|
26399
26451
|
sourceUuids: c
|
|
26400
|
-
}), u =
|
|
26452
|
+
}), u = wn(l), d = sn(l, o.id), f = d.length > 0;
|
|
26401
26453
|
return {
|
|
26402
26454
|
root: l,
|
|
26403
26455
|
roots: [l],
|
|
26404
|
-
groups:
|
|
26405
|
-
needsDecisions:
|
|
26456
|
+
groups: d,
|
|
26457
|
+
needsDecisions: f,
|
|
26406
26458
|
summary: u
|
|
26407
26459
|
};
|
|
26408
26460
|
}
|
|
26409
|
-
async function
|
|
26410
|
-
let { targetQuery: n, sourceNode: r, instanceNode: i, index: o, sourceUuids: s } = t, c = await
|
|
26461
|
+
async function hn(e, t) {
|
|
26462
|
+
let { targetQuery: n, sourceNode: r, instanceNode: i, index: o, sourceUuids: s } = t, c = await bn(e, {
|
|
26411
26463
|
targetQuery: n,
|
|
26412
26464
|
sourceNode: r,
|
|
26413
26465
|
instanceNode: i
|
|
26414
26466
|
}), l = [], u = /* @__PURE__ */ new Set();
|
|
26415
26467
|
for (let t of r.tree) {
|
|
26416
26468
|
let r = await e.any.getAttribute(t, { name: "uuid" }), a = (r ? o.get(r) : void 0) ?? (r ? void 0 : i.tree.find((e) => e.tagName === t.tagName && !u.has(e.id)));
|
|
26417
|
-
a ? (u.add(a.id), l.push(await
|
|
26469
|
+
a ? (u.add(a.id), l.push(await hn(e, {
|
|
26418
26470
|
targetQuery: n,
|
|
26419
26471
|
sourceNode: t,
|
|
26420
26472
|
instanceNode: a,
|
|
26421
26473
|
index: o,
|
|
26422
26474
|
sourceUuids: s
|
|
26423
|
-
}))) : l.push(
|
|
26475
|
+
}))) : l.push(gn(t));
|
|
26424
26476
|
}
|
|
26425
26477
|
for (let e of i.tree) {
|
|
26426
26478
|
if (u.has(e.id)) continue;
|
|
26427
26479
|
let t = await n.any.getAttribute(e, { name: "templateUuid" });
|
|
26428
|
-
|
|
26480
|
+
if (t) {
|
|
26481
|
+
s.has(t) || l.push(_n(e));
|
|
26482
|
+
continue;
|
|
26483
|
+
}
|
|
26484
|
+
if (fe.has(e.tagName) && !k.has(e.tagName)) {
|
|
26485
|
+
l.push(_n(e));
|
|
26486
|
+
continue;
|
|
26487
|
+
}
|
|
26488
|
+
yn(e, l);
|
|
26429
26489
|
}
|
|
26430
26490
|
return {
|
|
26431
26491
|
change: c.length > 0 ? "modified" : "unchanged",
|
|
@@ -26436,8 +26496,8 @@ async function cn(e, t) {
|
|
|
26436
26496
|
children: l
|
|
26437
26497
|
};
|
|
26438
26498
|
}
|
|
26439
|
-
function
|
|
26440
|
-
let t = e.tree.map((e) =>
|
|
26499
|
+
function gn(e) {
|
|
26500
|
+
let t = e.tree.map((e) => gn(e));
|
|
26441
26501
|
return {
|
|
26442
26502
|
change: "added",
|
|
26443
26503
|
tagName: e.tagName,
|
|
@@ -26445,8 +26505,8 @@ function ln(e) {
|
|
|
26445
26505
|
children: t
|
|
26446
26506
|
};
|
|
26447
26507
|
}
|
|
26448
|
-
function
|
|
26449
|
-
let t = e.tree.map((e) =>
|
|
26508
|
+
function _n(e) {
|
|
26509
|
+
let t = e.tree.map((e) => _n(e));
|
|
26450
26510
|
return {
|
|
26451
26511
|
change: "removed",
|
|
26452
26512
|
tagName: e.tagName,
|
|
@@ -26454,8 +26514,26 @@ function un(e) {
|
|
|
26454
26514
|
children: t
|
|
26455
26515
|
};
|
|
26456
26516
|
}
|
|
26457
|
-
|
|
26458
|
-
let
|
|
26517
|
+
function vn(e) {
|
|
26518
|
+
let t = e.tree.map((e) => vn(e));
|
|
26519
|
+
return {
|
|
26520
|
+
change: "target-only",
|
|
26521
|
+
tagName: e.tagName,
|
|
26522
|
+
instanceRef: a(e),
|
|
26523
|
+
children: t
|
|
26524
|
+
};
|
|
26525
|
+
}
|
|
26526
|
+
function yn(e, t) {
|
|
26527
|
+
if (!pn.has(e.tagName)) {
|
|
26528
|
+
if (e.tagName === "Private") {
|
|
26529
|
+
for (let n of e.tree) yn(n, t);
|
|
26530
|
+
return;
|
|
26531
|
+
}
|
|
26532
|
+
t.push(vn(e));
|
|
26533
|
+
}
|
|
26534
|
+
}
|
|
26535
|
+
async function bn(e, t) {
|
|
26536
|
+
let { targetQuery: n, sourceNode: r, instanceNode: i } = t, a = H(await e.any.getAttributes(r)), o = H(await n.any.getAttributes(i)), s = [];
|
|
26459
26537
|
for (let e of new Set([...Object.keys(a), ...Object.keys(o)])) {
|
|
26460
26538
|
let t = o[e], n = a[e];
|
|
26461
26539
|
t !== n && s.push({
|
|
@@ -26466,23 +26544,23 @@ async function dn(e, t) {
|
|
|
26466
26544
|
}
|
|
26467
26545
|
return s;
|
|
26468
26546
|
}
|
|
26469
|
-
async function
|
|
26547
|
+
async function xn(e, t) {
|
|
26470
26548
|
let { node: n, index: r } = t, i = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26471
26549
|
i && r.set(i, n);
|
|
26472
|
-
for (let t of n.tree) await
|
|
26550
|
+
for (let t of n.tree) await xn(e, {
|
|
26473
26551
|
node: t,
|
|
26474
26552
|
index: r
|
|
26475
26553
|
});
|
|
26476
26554
|
}
|
|
26477
|
-
async function
|
|
26555
|
+
async function Sn(e, t) {
|
|
26478
26556
|
let { node: n, out: r } = t, i = await e.any.getAttribute(n, { name: "uuid" });
|
|
26479
26557
|
i && r.add(i);
|
|
26480
|
-
for (let t of n.tree) await
|
|
26558
|
+
for (let t of n.tree) await Sn(e, {
|
|
26481
26559
|
node: t,
|
|
26482
26560
|
out: r
|
|
26483
26561
|
});
|
|
26484
26562
|
}
|
|
26485
|
-
function
|
|
26563
|
+
function Cn(e) {
|
|
26486
26564
|
let [t] = e, n = e.flatMap((e) => e.groups), r = e.reduce((e, t) => ({
|
|
26487
26565
|
added: e.added + t.summary.added,
|
|
26488
26566
|
removed: e.removed + t.summary.removed,
|
|
@@ -26500,7 +26578,7 @@ function mn(e) {
|
|
|
26500
26578
|
summary: r
|
|
26501
26579
|
};
|
|
26502
26580
|
}
|
|
26503
|
-
function
|
|
26581
|
+
function wn(e) {
|
|
26504
26582
|
let t = {
|
|
26505
26583
|
added: 0,
|
|
26506
26584
|
removed: 0,
|
|
@@ -26513,54 +26591,58 @@ function hn(e) {
|
|
|
26513
26591
|
}
|
|
26514
26592
|
//#endregion
|
|
26515
26593
|
//#region src/v2019C1/extensions/lifecycle/constraints/classify-attribute.constants.ts
|
|
26516
|
-
var
|
|
26594
|
+
var Tn = new Set([
|
|
26517
26595
|
"uuid",
|
|
26518
26596
|
"templateUuid",
|
|
26519
26597
|
"originUuid"
|
|
26520
|
-
]),
|
|
26521
|
-
function
|
|
26522
|
-
let t =
|
|
26598
|
+
]), En = ["rename", "free"], Dn = /* @__PURE__ */ new Map();
|
|
26599
|
+
function On(e) {
|
|
26600
|
+
let t = Dn.get(e);
|
|
26523
26601
|
if (t) return t;
|
|
26524
|
-
let n =
|
|
26525
|
-
return
|
|
26602
|
+
let n = _[e]?.attributes?.identityFields ?? [], r = new Set(n);
|
|
26603
|
+
return Dn.set(e, r), r;
|
|
26526
26604
|
}
|
|
26527
26605
|
//#endregion
|
|
26528
26606
|
//#region src/v2019C1/extensions/lifecycle/constraints/classify-attribute.ts
|
|
26529
|
-
function
|
|
26530
|
-
return
|
|
26607
|
+
function U(e, t) {
|
|
26608
|
+
return Tn.has(t) ? "identity" : jn(e).has(t) || Mn(e).has(t) ? "reference" : t === "name" ? "rename" : oe.has(t) || On(e).has(t) ? "identity" : "free";
|
|
26531
26609
|
}
|
|
26532
|
-
function
|
|
26533
|
-
return
|
|
26610
|
+
function kn(e) {
|
|
26611
|
+
return En.includes(e);
|
|
26534
26612
|
}
|
|
26535
|
-
function
|
|
26536
|
-
let t = Object.keys(
|
|
26613
|
+
function An(e) {
|
|
26614
|
+
let t = Object.keys(g[e] ?? {}), n = [];
|
|
26537
26615
|
for (let r of t) {
|
|
26538
|
-
let t =
|
|
26539
|
-
|
|
26616
|
+
let t = U(e, r);
|
|
26617
|
+
kn(t) && n.push({
|
|
26540
26618
|
attr: r,
|
|
26541
26619
|
mode: t
|
|
26542
26620
|
});
|
|
26543
26621
|
}
|
|
26544
26622
|
return n;
|
|
26545
26623
|
}
|
|
26546
|
-
function
|
|
26547
|
-
let t =
|
|
26548
|
-
if (!t) return
|
|
26624
|
+
function jn(e) {
|
|
26625
|
+
let t = O[e];
|
|
26626
|
+
if (!t) return Nn;
|
|
26549
26627
|
let n = /* @__PURE__ */ new Set();
|
|
26550
26628
|
for (let e of t) n.add(e.attribute.path), n.add(e.attribute.uuid);
|
|
26551
26629
|
return n;
|
|
26552
26630
|
}
|
|
26553
|
-
|
|
26631
|
+
function Mn(e) {
|
|
26632
|
+
let t = P.get(e);
|
|
26633
|
+
return t ? new Set(t) : Nn;
|
|
26634
|
+
}
|
|
26635
|
+
var Nn = /* @__PURE__ */ new Set();
|
|
26554
26636
|
//#endregion
|
|
26555
26637
|
//#region src/v2019C1/extensions/lifecycle/constraints/find-constraint-violation.ts
|
|
26556
|
-
async function
|
|
26557
|
-
let { parentRef: n, childTag: r, candidate: i, excludeId: a } = t, o =
|
|
26638
|
+
async function W(e, t) {
|
|
26639
|
+
let { parentRef: n, childTag: r, candidate: i, excludeId: a } = t, o = Fn(n.tagName).filter((e) => (e.kind === "unique" || e.kind === "key") && In(e, r));
|
|
26558
26640
|
if (o.length === 0) return null;
|
|
26559
26641
|
let s = (await e.any.getTree(n))?.tree ?? [];
|
|
26560
26642
|
for (let e of o) {
|
|
26561
|
-
let t =
|
|
26643
|
+
let t = Ln(e);
|
|
26562
26644
|
if (!(t.length === 0 || t.some((e) => i[e] === void 0))) {
|
|
26563
|
-
for (let n of s) if (n.id !== a &&
|
|
26645
|
+
for (let n of s) if (n.id !== a && In(e, n.tagName) && t.every((e) => Pn(n, e) === i[e])) return {
|
|
26564
26646
|
constraint: e.name,
|
|
26565
26647
|
fields: t,
|
|
26566
26648
|
offendingId: n.id
|
|
@@ -26569,41 +26651,41 @@ async function R(e, t) {
|
|
|
26569
26651
|
}
|
|
26570
26652
|
return null;
|
|
26571
26653
|
}
|
|
26572
|
-
function
|
|
26654
|
+
function Pn(e, t) {
|
|
26573
26655
|
return e.attributes.find((e) => e.name === t)?.value;
|
|
26574
26656
|
}
|
|
26575
|
-
function
|
|
26576
|
-
return [...
|
|
26657
|
+
function Fn(e) {
|
|
26658
|
+
return [..._[e]?.constraints ?? []];
|
|
26577
26659
|
}
|
|
26578
|
-
function
|
|
26660
|
+
function In(e, t) {
|
|
26579
26661
|
for (let n of e.selector ?? []) {
|
|
26580
26662
|
let e = (n.steps ?? []).at(-1);
|
|
26581
26663
|
if (e && (e.kind === "wildcard" || e.kind === "name" && e.value === t)) return !0;
|
|
26582
26664
|
}
|
|
26583
26665
|
return !1;
|
|
26584
26666
|
}
|
|
26585
|
-
function
|
|
26667
|
+
function Ln(e) {
|
|
26586
26668
|
return (e.fields ?? []).map((e) => e.target?.value).filter((e) => !!e);
|
|
26587
26669
|
}
|
|
26588
26670
|
//#endregion
|
|
26589
26671
|
//#region src/v2019C1/extensions/lifecycle/constraints/resolve-unique-value.ts
|
|
26590
|
-
var
|
|
26591
|
-
async function
|
|
26672
|
+
var Rn = 1e3;
|
|
26673
|
+
async function zn(e, t) {
|
|
26592
26674
|
let { parentRef: n, childTag: r, candidate: i, attr: a, decorate: o, excludeId: s } = t, c = i[a] ?? "";
|
|
26593
|
-
if (!await
|
|
26675
|
+
if (!await W(e, {
|
|
26594
26676
|
parentRef: n,
|
|
26595
26677
|
childTag: r,
|
|
26596
26678
|
candidate: i,
|
|
26597
26679
|
excludeId: s
|
|
26598
26680
|
})) return c;
|
|
26599
|
-
for (let t = 1; t <=
|
|
26681
|
+
for (let t = 1; t <= Rn; t++) {
|
|
26600
26682
|
let l = o ? o({
|
|
26601
26683
|
base: c,
|
|
26602
26684
|
attempt: t,
|
|
26603
26685
|
attr: a,
|
|
26604
26686
|
childTag: r
|
|
26605
26687
|
}) : `${c}_${t}`;
|
|
26606
|
-
if (!await
|
|
26688
|
+
if (!await W(e, {
|
|
26607
26689
|
parentRef: n,
|
|
26608
26690
|
childTag: r,
|
|
26609
26691
|
candidate: {
|
|
@@ -26613,22 +26695,22 @@ async function kn(e, t) {
|
|
|
26613
26695
|
excludeId: s
|
|
26614
26696
|
})) return l;
|
|
26615
26697
|
}
|
|
26616
|
-
throw Error(`could not resolve a unique ${a} for <${r}> under <${n.tagName}> after ${
|
|
26698
|
+
throw Error(`could not resolve a unique ${a} for <${r}> under <${n.tagName}> after ${Rn} attempts`);
|
|
26617
26699
|
}
|
|
26618
26700
|
//#endregion
|
|
26619
26701
|
//#region src/v2019C1/extensions/lifecycle/constraints/resolve-placement-collision.ts
|
|
26620
|
-
async function
|
|
26702
|
+
async function G(e, t) {
|
|
26621
26703
|
let { ref: n, decorate: r, overrides: i } = t, a = t.parentRef ?? (await e.getRecord(n))?.parent;
|
|
26622
26704
|
if (!a) return { status: "ok" };
|
|
26623
26705
|
let o = await e.getAttributes(n);
|
|
26624
26706
|
if (i) for (let [t, r] of Object.entries(i)) {
|
|
26625
|
-
let i =
|
|
26707
|
+
let i = U(n.tagName, t);
|
|
26626
26708
|
(i === "rename" || i === "free") && o[t] !== r && (await e.update(n, { attributes: { [t]: r } }), o = {
|
|
26627
26709
|
...o,
|
|
26628
26710
|
[t]: r
|
|
26629
26711
|
});
|
|
26630
26712
|
}
|
|
26631
|
-
let s = await
|
|
26713
|
+
let s = await W(e, {
|
|
26632
26714
|
parentRef: a,
|
|
26633
26715
|
childTag: n.tagName,
|
|
26634
26716
|
candidate: o,
|
|
@@ -26636,14 +26718,14 @@ async function z(e, t) {
|
|
|
26636
26718
|
});
|
|
26637
26719
|
if (!s) return { status: "ok" };
|
|
26638
26720
|
let c = s.fields.find((e) => {
|
|
26639
|
-
let t =
|
|
26721
|
+
let t = U(n.tagName, e);
|
|
26640
26722
|
return t === "rename" || t === "free";
|
|
26641
26723
|
});
|
|
26642
26724
|
if (!c) return {
|
|
26643
26725
|
status: "unresolvable",
|
|
26644
26726
|
violation: s
|
|
26645
26727
|
};
|
|
26646
|
-
let l = o[c] ?? "", u = await
|
|
26728
|
+
let l = o[c] ?? "", u = await zn(e, {
|
|
26647
26729
|
parentRef: a,
|
|
26648
26730
|
childTag: n.tagName,
|
|
26649
26731
|
candidate: o,
|
|
@@ -26660,12 +26742,12 @@ async function z(e, t) {
|
|
|
26660
26742
|
}
|
|
26661
26743
|
//#endregion
|
|
26662
26744
|
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-tree.ts
|
|
26663
|
-
var
|
|
26745
|
+
var Bn = {
|
|
26664
26746
|
scope: "tree",
|
|
26665
26747
|
attributes: ["templateUuid", "originUuid"]
|
|
26666
26748
|
};
|
|
26667
|
-
async function
|
|
26668
|
-
let { sourceQuery: n, ref: i, targetParent: a, omit: o, retagRoot: s, strip: c =
|
|
26749
|
+
async function K(e, t) {
|
|
26750
|
+
let { sourceQuery: n, ref: i, targetParent: a, omit: o, retagRoot: s, strip: c = Bn } = t, l = await n.getTree(i, {
|
|
26669
26751
|
omit: o,
|
|
26670
26752
|
unwrap: []
|
|
26671
26753
|
});
|
|
@@ -26681,12 +26763,12 @@ async function B(e, t) {
|
|
|
26681
26763
|
}
|
|
26682
26764
|
//#endregion
|
|
26683
26765
|
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/add-children-to.ts
|
|
26684
|
-
async function
|
|
26766
|
+
async function q(e, t) {
|
|
26685
26767
|
let { sourceQuery: n, source: r, target: i, omit: a, strip: o } = t, s = await n.any.getRecord(r);
|
|
26686
26768
|
if (!s) return [];
|
|
26687
26769
|
let c = [];
|
|
26688
26770
|
for (let t of s.children) {
|
|
26689
|
-
let r = await
|
|
26771
|
+
let r = await K(e, {
|
|
26690
26772
|
sourceQuery: n,
|
|
26691
26773
|
ref: {
|
|
26692
26774
|
tagName: t.tagName,
|
|
@@ -26702,14 +26784,14 @@ async function V(e, t) {
|
|
|
26702
26784
|
}
|
|
26703
26785
|
//#endregion
|
|
26704
26786
|
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/deep.ts
|
|
26705
|
-
async function
|
|
26706
|
-
let { sourceQuery: n, ref: r, targetParent: i, withTypes: a = !0, omit: o, strip: s = !1, retagRoot: c } = t, l = await
|
|
26787
|
+
async function J(e, t) {
|
|
26788
|
+
let { sourceQuery: n, ref: r, targetParent: i, withTypes: a = !0, omit: o, strip: s = !1, retagRoot: c } = t, l = await Vn(e, {
|
|
26707
26789
|
sourceQuery: n,
|
|
26708
26790
|
ref: r,
|
|
26709
26791
|
targetParent: i
|
|
26710
26792
|
}), u, d;
|
|
26711
26793
|
if (l) {
|
|
26712
|
-
d = await
|
|
26794
|
+
d = await q(e, {
|
|
26713
26795
|
sourceQuery: n,
|
|
26714
26796
|
source: r,
|
|
26715
26797
|
target: l,
|
|
@@ -26720,7 +26802,7 @@ async function H(e, t) {
|
|
|
26720
26802
|
if (!t) throw Error(`transplant.deep: merge target vanished: ${l.id}`);
|
|
26721
26803
|
u = t;
|
|
26722
26804
|
} else {
|
|
26723
|
-
let t = await
|
|
26805
|
+
let t = await K(e, {
|
|
26724
26806
|
sourceQuery: n,
|
|
26725
26807
|
ref: r,
|
|
26726
26808
|
targetParent: i,
|
|
@@ -26733,10 +26815,10 @@ async function H(e, t) {
|
|
|
26733
26815
|
}
|
|
26734
26816
|
let f = /* @__PURE__ */ new Map();
|
|
26735
26817
|
if (a) {
|
|
26736
|
-
let t = await
|
|
26818
|
+
let t = await Hn(n, r);
|
|
26737
26819
|
if (t.length > 0) {
|
|
26738
26820
|
let r = typeof a == "object" ? a.keepNameFrom : void 0;
|
|
26739
|
-
f = (await
|
|
26821
|
+
f = (await It(e, {
|
|
26740
26822
|
sourceQuery: n,
|
|
26741
26823
|
records: t,
|
|
26742
26824
|
cloneMappings: d,
|
|
@@ -26750,7 +26832,7 @@ async function H(e, t) {
|
|
|
26750
26832
|
recordMappings: d
|
|
26751
26833
|
};
|
|
26752
26834
|
}
|
|
26753
|
-
async function
|
|
26835
|
+
async function Vn(e, t) {
|
|
26754
26836
|
let { sourceQuery: n, ref: r, targetParent: i } = t;
|
|
26755
26837
|
if (r.tagName !== "Private") return;
|
|
26756
26838
|
let a = (await n.any.getAttributes(r)).type;
|
|
@@ -26761,7 +26843,7 @@ async function jn(e, t) {
|
|
|
26761
26843
|
id: t.id
|
|
26762
26844
|
};
|
|
26763
26845
|
}
|
|
26764
|
-
async function
|
|
26846
|
+
async function Hn(e, t) {
|
|
26765
26847
|
let { LNode: n = [], LN: r = [], LN0: i = [] } = await e.findDescendants(t, { collect: [
|
|
26766
26848
|
"LNode",
|
|
26767
26849
|
"LN",
|
|
@@ -26775,8 +26857,8 @@ async function Mn(e, t) {
|
|
|
26775
26857
|
}
|
|
26776
26858
|
//#endregion
|
|
26777
26859
|
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-referenced.ts
|
|
26778
|
-
async function
|
|
26779
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, alreadyCloned: o } = t, s =
|
|
26860
|
+
async function Un(e, t) {
|
|
26861
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, alreadyCloned: o } = t, s = O[i][0].attribute.uuid, { [i]: c = [] } = await n.findDescendants(r, { collect: i }), l = /* @__PURE__ */ new Set();
|
|
26780
26862
|
for (let e of c) {
|
|
26781
26863
|
let t = e.attributes.find((e) => e.name === s)?.value;
|
|
26782
26864
|
t && l.add(t);
|
|
@@ -26799,8 +26881,8 @@ async function Nn(e, t) {
|
|
|
26799
26881
|
}
|
|
26800
26882
|
return u;
|
|
26801
26883
|
}
|
|
26802
|
-
async function
|
|
26803
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, resolveTargetParent: o, alreadyCloned: s, omit: c } = t, l = await
|
|
26884
|
+
async function Wn(e, t) {
|
|
26885
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, resolveTargetParent: o, alreadyCloned: s, omit: c } = t, l = await Un(e, {
|
|
26804
26886
|
sourceQuery: n,
|
|
26805
26887
|
scopeRef: r,
|
|
26806
26888
|
refTagName: i,
|
|
@@ -26808,7 +26890,7 @@ async function Pn(e, t) {
|
|
|
26808
26890
|
alreadyCloned: s
|
|
26809
26891
|
}), u = [];
|
|
26810
26892
|
for (let t of l) {
|
|
26811
|
-
let r = await
|
|
26893
|
+
let r = await K(e, {
|
|
26812
26894
|
sourceQuery: n,
|
|
26813
26895
|
ref: t,
|
|
26814
26896
|
targetParent: await o(t),
|
|
@@ -26818,9 +26900,9 @@ async function Pn(e, t) {
|
|
|
26818
26900
|
}
|
|
26819
26901
|
return u;
|
|
26820
26902
|
}
|
|
26821
|
-
async function
|
|
26822
|
-
let { sourceQuery: n, scopeTagName: r, scopeRef: i, resolveTargetParent: a, alreadyCloned: o, skip: s = /* @__PURE__ */ new Set(), omit: c } = t, l = (
|
|
26823
|
-
for (let t of l) for (let r of
|
|
26903
|
+
async function Gn(e, t) {
|
|
26904
|
+
let { sourceQuery: n, scopeTagName: r, scopeRef: i, resolveTargetParent: a, alreadyCloned: o, skip: s = /* @__PURE__ */ new Set(), omit: c } = t, l = (p[r] ?? []).filter((e) => e in O && !s.has(e)), u = Wn, d = [];
|
|
26905
|
+
for (let t of l) for (let r of O[t]) for (let s of r.target) {
|
|
26824
26906
|
let r = await u(e, {
|
|
26825
26907
|
sourceQuery: n,
|
|
26826
26908
|
scopeRef: i,
|
|
@@ -26836,14 +26918,14 @@ async function Fn(e, t) {
|
|
|
26836
26918
|
}
|
|
26837
26919
|
//#endregion
|
|
26838
26920
|
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/resolve-structure-ref.ts
|
|
26839
|
-
async function
|
|
26921
|
+
async function Y(e, t, n) {
|
|
26840
26922
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26841
|
-
|
|
26923
|
+
s(r, {
|
|
26842
26924
|
key: "ELEMENT_NOT_FOUND",
|
|
26843
26925
|
detail: `No Substation/VoltageLevel/Bay level in the target structure for ${t.tagName}`
|
|
26844
26926
|
});
|
|
26845
26927
|
let i = n[r.tagName];
|
|
26846
|
-
return
|
|
26928
|
+
return s(i, {
|
|
26847
26929
|
key: "ELEMENT_NOT_FOUND",
|
|
26848
26930
|
detail: `Target structure missing the ${r.tagName} level for ${t.tagName}`
|
|
26849
26931
|
}), {
|
|
@@ -26851,7 +26933,7 @@ async function U(e, t, n) {
|
|
|
26851
26933
|
id: i.id
|
|
26852
26934
|
};
|
|
26853
26935
|
}
|
|
26854
|
-
function
|
|
26936
|
+
function Kn(e) {
|
|
26855
26937
|
let { sourceQuery: t, structure: n, cloneIndex: r } = e;
|
|
26856
26938
|
return async function(e) {
|
|
26857
26939
|
let i = await t.findAncestors(e, { stopAtTagName: "Substation" });
|
|
@@ -26866,7 +26948,7 @@ function In(e) {
|
|
|
26866
26948
|
};
|
|
26867
26949
|
}
|
|
26868
26950
|
}
|
|
26869
|
-
|
|
26951
|
+
s(!1, {
|
|
26870
26952
|
key: "ELEMENT_NOT_FOUND",
|
|
26871
26953
|
detail: `No clone-mapped or structural ancestor found for ${e.tagName}`
|
|
26872
26954
|
});
|
|
@@ -26874,26 +26956,25 @@ function In(e) {
|
|
|
26874
26956
|
}
|
|
26875
26957
|
//#endregion
|
|
26876
26958
|
//#region src/v2019C1/extensions/lifecycle/engine/reconcile.ts
|
|
26877
|
-
|
|
26878
|
-
async function W(e, t) {
|
|
26959
|
+
async function qn(e, t) {
|
|
26879
26960
|
let { sourceQuery: n, sourceRootRef: r, instanceRootRef: i, accepted: a, overrides: o, keepNameTypesFrom: s } = t, c = await n.any.getTree(r), l = await e.any.getTree(i);
|
|
26880
26961
|
if (!c || !l) return;
|
|
26881
26962
|
let u = /* @__PURE__ */ new Map();
|
|
26882
|
-
await
|
|
26963
|
+
await Qn(e, {
|
|
26883
26964
|
node: l,
|
|
26884
26965
|
index: u
|
|
26885
26966
|
});
|
|
26886
26967
|
let d = /* @__PURE__ */ new Set();
|
|
26887
|
-
await
|
|
26968
|
+
await $n(n, {
|
|
26888
26969
|
node: c,
|
|
26889
26970
|
out: d
|
|
26890
|
-
}), await
|
|
26971
|
+
}), await Zn(e, {
|
|
26891
26972
|
sourceQuery: n,
|
|
26892
26973
|
instanceRecord: l,
|
|
26893
26974
|
sourceNode: c,
|
|
26894
26975
|
accepted: a,
|
|
26895
26976
|
overrides: o
|
|
26896
|
-
}), await
|
|
26977
|
+
}), await Jn(e, {
|
|
26897
26978
|
sourceQuery: n,
|
|
26898
26979
|
sourceNode: c,
|
|
26899
26980
|
instanceParent: l,
|
|
@@ -26901,24 +26982,24 @@ async function W(e, t) {
|
|
|
26901
26982
|
accepted: a,
|
|
26902
26983
|
overrides: o,
|
|
26903
26984
|
keepNameTypesFrom: s
|
|
26904
|
-
}), await
|
|
26985
|
+
}), await Yn(e, {
|
|
26905
26986
|
instanceNode: l,
|
|
26906
26987
|
sourceUuids: d,
|
|
26907
26988
|
accepted: a
|
|
26908
26989
|
});
|
|
26909
26990
|
}
|
|
26910
|
-
async function
|
|
26991
|
+
async function Jn(e, t) {
|
|
26911
26992
|
let { sourceQuery: n, sourceNode: r, instanceParent: i, index: o, accepted: s, overrides: c, keepNameTypesFrom: l } = t, u = /* @__PURE__ */ new Set();
|
|
26912
26993
|
for (let t of r.tree) {
|
|
26913
26994
|
let r = await n.any.getAttribute(t, { name: "uuid" }), d = (r ? o.get(r) : void 0) ?? (r ? void 0 : i.tree.find((e) => e.tagName === t.tagName && !u.has(e.id)));
|
|
26914
26995
|
if (d) {
|
|
26915
|
-
u.add(d.id), await
|
|
26996
|
+
u.add(d.id), await Zn(e, {
|
|
26916
26997
|
sourceQuery: n,
|
|
26917
26998
|
instanceRecord: d,
|
|
26918
26999
|
sourceNode: t,
|
|
26919
27000
|
accepted: s,
|
|
26920
27001
|
overrides: c
|
|
26921
|
-
}), await
|
|
27002
|
+
}), await Jn(e, {
|
|
26922
27003
|
sourceQuery: n,
|
|
26923
27004
|
sourceNode: t,
|
|
26924
27005
|
instanceParent: d,
|
|
@@ -26930,29 +27011,34 @@ async function Rn(e, t) {
|
|
|
26930
27011
|
continue;
|
|
26931
27012
|
}
|
|
26932
27013
|
if (s && !s.sourceIds.has(t.id)) continue;
|
|
26933
|
-
let { recordMappings: f } = await
|
|
27014
|
+
let { recordMappings: f } = await J(e, {
|
|
26934
27015
|
sourceQuery: n,
|
|
26935
27016
|
ref: a(t),
|
|
26936
27017
|
targetParent: a(i),
|
|
26937
27018
|
strip: !1,
|
|
26938
27019
|
withTypes: { keepNameFrom: l }
|
|
26939
27020
|
});
|
|
26940
|
-
await
|
|
27021
|
+
await V(e, {
|
|
26941
27022
|
mappings: f,
|
|
26942
27023
|
mode: "stamp-template"
|
|
26943
27024
|
});
|
|
26944
27025
|
let p = f.find((e) => e.source.id === t.id);
|
|
26945
|
-
p && await
|
|
27026
|
+
p && await G(e, {
|
|
26946
27027
|
ref: p.target,
|
|
26947
27028
|
parentRef: a(i),
|
|
26948
27029
|
overrides: c?.get(t.id)
|
|
26949
27030
|
});
|
|
26950
27031
|
}
|
|
26951
|
-
for (let t of i.tree) u.has(t.id)
|
|
27032
|
+
for (let t of i.tree) if (!u.has(t.id) && !await e.any.getAttribute(t, { name: "templateUuid" })) {
|
|
27033
|
+
if (fe.has(t.tagName) && !k.has(t.tagName)) {
|
|
27034
|
+
if (s && !s.instanceIds.has(t.id)) continue;
|
|
27035
|
+
} else if (!s || !s.instanceIds.has(t.id)) continue;
|
|
27036
|
+
await e.any.getRecord(t) && await e.any.delete(t);
|
|
27037
|
+
}
|
|
26952
27038
|
}
|
|
26953
|
-
async function
|
|
27039
|
+
async function Yn(e, t) {
|
|
26954
27040
|
let { instanceNode: n, sourceUuids: r, accepted: i } = t, a = [];
|
|
26955
|
-
await
|
|
27041
|
+
await Xn(e, {
|
|
26956
27042
|
node: n,
|
|
26957
27043
|
sourceUuids: r,
|
|
26958
27044
|
accepted: i,
|
|
@@ -26960,82 +27046,96 @@ async function zn(e, t) {
|
|
|
26960
27046
|
});
|
|
26961
27047
|
for (let t of a) await e.any.getRecord(t) && await e.any.delete(t);
|
|
26962
27048
|
}
|
|
26963
|
-
async function
|
|
27049
|
+
async function Xn(e, t) {
|
|
26964
27050
|
let { node: n, sourceUuids: r, accepted: i, out: a } = t, o = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26965
27051
|
if (o && !r.has(o)) {
|
|
26966
27052
|
(!i || i.instanceIds.has(n.id)) && a.push(n);
|
|
26967
27053
|
return;
|
|
26968
27054
|
}
|
|
26969
|
-
for (let t of n.tree) await
|
|
27055
|
+
for (let t of n.tree) await Xn(e, {
|
|
26970
27056
|
node: t,
|
|
26971
27057
|
sourceUuids: r,
|
|
26972
27058
|
accepted: i,
|
|
26973
27059
|
out: a
|
|
26974
27060
|
});
|
|
26975
27061
|
}
|
|
26976
|
-
async function
|
|
27062
|
+
async function Zn(e, t) {
|
|
26977
27063
|
let { sourceQuery: n, instanceRecord: r, sourceNode: i, accepted: a, overrides: o } = t;
|
|
26978
27064
|
if (a && !a.sourceIds.has(i.id)) return;
|
|
26979
27065
|
let s = {
|
|
26980
|
-
...
|
|
27066
|
+
...H(await n.any.getAttributes(i)),
|
|
26981
27067
|
...o?.get(i.id)
|
|
26982
|
-
}, c =
|
|
26983
|
-
for (let
|
|
27068
|
+
}, c = H(await e.any.getAttributes(r)), l = {};
|
|
27069
|
+
for (let e of new Set([...Object.keys(s), ...Object.keys(c)])) {
|
|
27070
|
+
let t = e in s ? s[e] : void 0;
|
|
27071
|
+
c[e] !== t && (l[e] = t);
|
|
27072
|
+
}
|
|
27073
|
+
if (r.tagName === "LNode" && Object.keys(l).some((e) => Le.has(e)) && await T(e, r)) for (let e of Le) delete l[e];
|
|
26984
27074
|
Object.keys(l).length > 0 && await e.any.update(r, { attributes: l });
|
|
26985
27075
|
}
|
|
26986
|
-
async function
|
|
27076
|
+
async function Qn(e, t) {
|
|
26987
27077
|
let { node: n, index: r } = t, i = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26988
27078
|
i && r.set(i, n);
|
|
26989
|
-
for (let t of n.tree) await
|
|
27079
|
+
for (let t of n.tree) await Qn(e, {
|
|
26990
27080
|
node: t,
|
|
26991
27081
|
index: r
|
|
26992
27082
|
});
|
|
26993
27083
|
}
|
|
26994
|
-
async function
|
|
27084
|
+
async function $n(e, t) {
|
|
26995
27085
|
let { node: n, out: r } = t, i = await e.any.getAttribute(n, { name: "uuid" });
|
|
26996
27086
|
i && r.add(i);
|
|
26997
|
-
for (let t of n.tree) await
|
|
27087
|
+
for (let t of n.tree) await $n(e, {
|
|
26998
27088
|
node: t,
|
|
26999
27089
|
out: r
|
|
27000
27090
|
});
|
|
27001
27091
|
}
|
|
27002
27092
|
//#endregion
|
|
27003
27093
|
//#region src/v2019C1/extensions/lifecycle/engine/decide.ts
|
|
27004
|
-
function
|
|
27094
|
+
function er(e) {
|
|
27005
27095
|
return e === void 0 ? "accept" : typeof e == "string" ? e : e.action;
|
|
27006
27096
|
}
|
|
27007
|
-
function
|
|
27097
|
+
function tr(e) {
|
|
27008
27098
|
return typeof e == "object" ? e.values : void 0;
|
|
27009
27099
|
}
|
|
27010
|
-
function
|
|
27011
|
-
|
|
27100
|
+
function nr(e) {
|
|
27101
|
+
let t = e.decisions.get(e.group.id);
|
|
27102
|
+
return t === void 0 ? e.group.suggestedAction : er(t);
|
|
27012
27103
|
}
|
|
27013
|
-
function
|
|
27104
|
+
function rr(e) {
|
|
27105
|
+
return nr(e) !== "skip";
|
|
27106
|
+
}
|
|
27107
|
+
function ir(e) {
|
|
27014
27108
|
let { groups: t, decisions: n } = e, r = /* @__PURE__ */ new Map();
|
|
27015
27109
|
for (let e of t) {
|
|
27016
27110
|
let t = n.get(e.id);
|
|
27017
|
-
if (
|
|
27018
|
-
|
|
27111
|
+
if (nr({
|
|
27112
|
+
group: e,
|
|
27113
|
+
decisions: n
|
|
27114
|
+
}) === "skip") continue;
|
|
27115
|
+
let i = tr(t), a = e.primary.sourceRef?.id;
|
|
27019
27116
|
i && a && r.set(a, i);
|
|
27020
27117
|
}
|
|
27021
27118
|
return r;
|
|
27022
27119
|
}
|
|
27023
|
-
function
|
|
27120
|
+
function ar(e) {
|
|
27024
27121
|
let { groups: t, decisions: n } = e;
|
|
27025
|
-
for (let e of t) if (
|
|
27026
|
-
|
|
27122
|
+
for (let e of t) if (rr({
|
|
27123
|
+
group: e,
|
|
27027
27124
|
decisions: n
|
|
27028
|
-
})) for (let
|
|
27029
|
-
|
|
27125
|
+
})) for (let r of e.dependsOn) s(rr({
|
|
27126
|
+
group: or(t, r) ?? e,
|
|
27030
27127
|
decisions: n
|
|
27031
|
-
}), { detail: `decision accepts group "${e.id}" but its dependency "${
|
|
27128
|
+
}), { detail: `decision accepts group "${e.id}" but its dependency "${r}" is skipped` });
|
|
27129
|
+
}
|
|
27130
|
+
function or(e, t) {
|
|
27131
|
+
return e.find((e) => e.id === t);
|
|
27032
27132
|
}
|
|
27033
|
-
function
|
|
27133
|
+
function sr(e) {
|
|
27034
27134
|
let { groups: t, decisions: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
27035
|
-
for (let e of t) if (
|
|
27036
|
-
|
|
27135
|
+
for (let e of t) if (rr({
|
|
27136
|
+
group: e,
|
|
27037
27137
|
decisions: n
|
|
27038
|
-
})) for (let t of [e.primary, ...e.companions])
|
|
27138
|
+
})) for (let t of [e.primary, ...e.companions]) cr({
|
|
27039
27139
|
node: t,
|
|
27040
27140
|
sourceIds: r,
|
|
27041
27141
|
instanceIds: i
|
|
@@ -27045,56 +27145,56 @@ function K(e) {
|
|
|
27045
27145
|
instanceIds: i
|
|
27046
27146
|
};
|
|
27047
27147
|
}
|
|
27048
|
-
function
|
|
27148
|
+
function cr(e) {
|
|
27049
27149
|
let { node: t, sourceIds: n, instanceIds: r } = e;
|
|
27050
|
-
t.change === "removed" ? t.instanceRef?.id && r.add(t.instanceRef.id) : t.sourceRef?.id && n.add(t.sourceRef.id);
|
|
27150
|
+
t.change === "removed" || t.change === "target-only" ? t.instanceRef?.id && r.add(t.instanceRef.id) : t.sourceRef?.id && n.add(t.sourceRef.id);
|
|
27051
27151
|
}
|
|
27052
27152
|
//#endregion
|
|
27053
27153
|
//#region src/v2019C1/extensions/lifecycle/instance/composed-functions.ts
|
|
27054
|
-
async function
|
|
27154
|
+
async function lr(e, t) {
|
|
27055
27155
|
let n = /* @__PURE__ */ new Set(), r = await e.any.getTree(t);
|
|
27056
|
-
return r && await
|
|
27156
|
+
return r && await ur(e, r, n), n;
|
|
27057
27157
|
}
|
|
27058
|
-
async function
|
|
27158
|
+
async function ur(e, t, n) {
|
|
27059
27159
|
if (t.tagName === "FunctionRef") {
|
|
27060
27160
|
let r = await e.any.getAttribute(t, { name: "functionUuid" });
|
|
27061
27161
|
r && n.add(r);
|
|
27062
27162
|
}
|
|
27063
|
-
for (let r of t.tree) await
|
|
27163
|
+
for (let r of t.tree) await ur(e, r, n);
|
|
27064
27164
|
}
|
|
27065
27165
|
//#endregion
|
|
27066
27166
|
//#region src/v2019C1/extensions/lifecycle/instance/find-instance.ts
|
|
27067
|
-
async function
|
|
27167
|
+
async function dr(e, t) {
|
|
27068
27168
|
let { targetParent: n, tagName: r, sourceUuid: i } = t;
|
|
27069
27169
|
if (!i) return [];
|
|
27070
27170
|
let a = await e.any.getTree(n);
|
|
27071
27171
|
if (!a) return [];
|
|
27072
27172
|
let o = [];
|
|
27073
|
-
return await
|
|
27173
|
+
return await fr(e, {
|
|
27074
27174
|
node: a,
|
|
27075
27175
|
tagName: r,
|
|
27076
27176
|
sourceUuid: i,
|
|
27077
27177
|
out: o
|
|
27078
27178
|
}), o;
|
|
27079
27179
|
}
|
|
27080
|
-
async function
|
|
27180
|
+
async function fr(e, t) {
|
|
27081
27181
|
let { node: n, tagName: r, sourceUuid: i, out: a } = t;
|
|
27082
27182
|
if (n.tagName === r && await e.any.getAttribute(n, { name: "templateUuid" }) === i) {
|
|
27083
27183
|
a.push(n);
|
|
27084
27184
|
return;
|
|
27085
27185
|
}
|
|
27086
|
-
for (let t of n.tree) await
|
|
27186
|
+
for (let t of n.tree) await fr(e, {
|
|
27087
27187
|
node: t,
|
|
27088
27188
|
tagName: r,
|
|
27089
27189
|
sourceUuid: i,
|
|
27090
27190
|
out: a
|
|
27091
27191
|
});
|
|
27092
27192
|
}
|
|
27093
|
-
async function
|
|
27094
|
-
let [n] = await
|
|
27193
|
+
async function pr(e, t) {
|
|
27194
|
+
let [n] = await X(e, t);
|
|
27095
27195
|
return n;
|
|
27096
27196
|
}
|
|
27097
|
-
async function
|
|
27197
|
+
async function X(e, t) {
|
|
27098
27198
|
let { tagName: n, sourceUuid: r } = t;
|
|
27099
27199
|
if (!r) return [];
|
|
27100
27200
|
let i = await e.any.getRecordsByTagName(n), a = [];
|
|
@@ -27103,15 +27203,15 @@ async function q(e, t) {
|
|
|
27103
27203
|
}
|
|
27104
27204
|
//#endregion
|
|
27105
27205
|
//#region src/v2019C1/extensions/lifecycle/update/transaction/satellite-reconcile.ts
|
|
27106
|
-
async function
|
|
27206
|
+
async function mr(e, t) {
|
|
27107
27207
|
let { sourceQuery: n, satelliteRefs: r, instanceSatelliteRefs: i, structure: a, accepted: o } = t;
|
|
27108
27208
|
for (let t of r) {
|
|
27109
|
-
let { uuid: r } = await n.any.getAttributes(t), i = await
|
|
27209
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await pr(e, {
|
|
27110
27210
|
tagName: t.tagName,
|
|
27111
27211
|
sourceUuid: r
|
|
27112
27212
|
});
|
|
27113
27213
|
if (i) {
|
|
27114
|
-
await
|
|
27214
|
+
await qn(e, {
|
|
27115
27215
|
sourceQuery: n,
|
|
27116
27216
|
sourceRootRef: t,
|
|
27117
27217
|
instanceRootRef: i,
|
|
@@ -27120,13 +27220,13 @@ async function er(e, t) {
|
|
|
27120
27220
|
continue;
|
|
27121
27221
|
}
|
|
27122
27222
|
if (o && t.id && !o.sourceIds.has(t.id)) continue;
|
|
27123
|
-
let s = await
|
|
27223
|
+
let s = await K(e, {
|
|
27124
27224
|
sourceQuery: n,
|
|
27125
27225
|
ref: t,
|
|
27126
|
-
targetParent: await
|
|
27226
|
+
targetParent: await Y(n, t, a),
|
|
27127
27227
|
strip: !1
|
|
27128
27228
|
});
|
|
27129
|
-
s && await
|
|
27229
|
+
s && await V(e, {
|
|
27130
27230
|
mappings: s.mappings,
|
|
27131
27231
|
mode: "stamp-template"
|
|
27132
27232
|
});
|
|
@@ -27138,26 +27238,26 @@ async function er(e, t) {
|
|
|
27138
27238
|
tagName: t.tagName,
|
|
27139
27239
|
attributes: { uuid: r }
|
|
27140
27240
|
});
|
|
27141
|
-
i || o && t.id && !o.instanceIds.has(t.id) || (await
|
|
27241
|
+
i || o && t.id && !o.instanceIds.has(t.id) || (await F(e, { target: t })).length > 0 || await e.delete(t);
|
|
27142
27242
|
}
|
|
27143
27243
|
}
|
|
27144
27244
|
//#endregion
|
|
27145
27245
|
//#region src/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.constants.ts
|
|
27146
|
-
var
|
|
27246
|
+
var hr = ["Variable", "BehaviorDescription"];
|
|
27147
27247
|
//#endregion
|
|
27148
27248
|
//#region src/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.ts
|
|
27149
|
-
async function
|
|
27249
|
+
async function Z(e, t) {
|
|
27150
27250
|
let { primaryRef: n } = t, r = await e.any.getTree(n);
|
|
27151
27251
|
if (!r) return [];
|
|
27152
27252
|
let i = /* @__PURE__ */ new Set(), o = [];
|
|
27153
|
-
|
|
27253
|
+
gr({
|
|
27154
27254
|
node: r,
|
|
27155
27255
|
subtreeIds: i,
|
|
27156
27256
|
targets: o
|
|
27157
27257
|
});
|
|
27158
27258
|
let s = /* @__PURE__ */ new Set(), c = [];
|
|
27159
|
-
for (let t of o) for (let n of
|
|
27160
|
-
let r = await
|
|
27259
|
+
for (let t of o) for (let n of hr) {
|
|
27260
|
+
let r = await L.query.findRefsPointingTo(e, {
|
|
27161
27261
|
target: a(t),
|
|
27162
27262
|
containerTagName: n
|
|
27163
27263
|
});
|
|
@@ -27165,10 +27265,10 @@ async function J(e, t) {
|
|
|
27165
27265
|
}
|
|
27166
27266
|
return c;
|
|
27167
27267
|
}
|
|
27168
|
-
function
|
|
27268
|
+
function gr(e) {
|
|
27169
27269
|
let { node: t, subtreeIds: n, targets: r } = e;
|
|
27170
27270
|
n.add(t.id), t.attributes.some((e) => e.name === "uuid") && r.push(t);
|
|
27171
|
-
for (let e of t.tree)
|
|
27271
|
+
for (let e of t.tree) gr({
|
|
27172
27272
|
node: e,
|
|
27173
27273
|
subtreeIds: n,
|
|
27174
27274
|
targets: r
|
|
@@ -27176,35 +27276,35 @@ function nr(e) {
|
|
|
27176
27276
|
}
|
|
27177
27277
|
//#endregion
|
|
27178
27278
|
//#region src/v2019C1/extensions/lifecycle/update/transaction/cross-cutting-satellites.ts
|
|
27179
|
-
async function
|
|
27279
|
+
async function _r(e, t) {
|
|
27180
27280
|
let { sourceQuery: n, primaryRef: r, instancePrimaryRef: i, structure: a, accepted: o } = t;
|
|
27181
|
-
await
|
|
27281
|
+
await mr(e, {
|
|
27182
27282
|
sourceQuery: n,
|
|
27183
|
-
satelliteRefs: await
|
|
27184
|
-
instanceSatelliteRefs: i ? await
|
|
27283
|
+
satelliteRefs: await Z(n, { primaryRef: r }),
|
|
27284
|
+
instanceSatelliteRefs: i ? await Z(e, { primaryRef: i }) : [],
|
|
27185
27285
|
structure: a,
|
|
27186
27286
|
accepted: o
|
|
27187
27287
|
});
|
|
27188
27288
|
}
|
|
27189
27289
|
//#endregion
|
|
27190
27290
|
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/resolve-target-structure.ts
|
|
27191
|
-
async function
|
|
27291
|
+
async function Q(e, t) {
|
|
27192
27292
|
let n = await e.getRecord(t);
|
|
27193
|
-
|
|
27293
|
+
s(n, {
|
|
27194
27294
|
key: "ELEMENT_NOT_FOUND",
|
|
27195
27295
|
detail: `resolveTargetStructure: target parent not found: ${t.tagName}#${t.id}`
|
|
27196
27296
|
});
|
|
27197
|
-
let r = [n, ...await e.findAncestors(t, { stopAtTagName: "Substation" })], i = r.find((e) => e.tagName === "Substation"), a = r.find((e) => e.tagName === "VoltageLevel"),
|
|
27198
|
-
return i && (c.Substation = i), a && (c.VoltageLevel = a),
|
|
27297
|
+
let r = [n, ...await e.findAncestors(t, { stopAtTagName: "Substation" })], i = r.find((e) => e.tagName === "Substation"), a = r.find((e) => e.tagName === "VoltageLevel"), o = r.find((e) => e.tagName === "Bay"), c = {};
|
|
27298
|
+
return i && (c.Substation = i), a && (c.VoltageLevel = a), o && (c.Bay = o), c;
|
|
27199
27299
|
}
|
|
27200
27300
|
//#endregion
|
|
27201
27301
|
//#region src/v2019C1/extensions/lifecycle/cross-cutting/clone-applied-satellites.ts
|
|
27202
|
-
async function
|
|
27203
|
-
let { sourceQuery: n, primaryRef: r, structure: i, strip: a = !0 } = t, o = await
|
|
27302
|
+
async function vr(e, t) {
|
|
27303
|
+
let { sourceQuery: n, primaryRef: r, structure: i, strip: a = !0 } = t, o = await Z(n, { primaryRef: r }), s = [];
|
|
27204
27304
|
for (let t of o) {
|
|
27205
|
-
let r = await
|
|
27305
|
+
let r = await yr(e, n, t);
|
|
27206
27306
|
if (r) {
|
|
27207
|
-
let i = await
|
|
27307
|
+
let i = await q(e, {
|
|
27208
27308
|
sourceQuery: n,
|
|
27209
27309
|
source: t,
|
|
27210
27310
|
target: r,
|
|
@@ -27213,17 +27313,17 @@ async function ir(e, t) {
|
|
|
27213
27313
|
s.push(...i);
|
|
27214
27314
|
continue;
|
|
27215
27315
|
}
|
|
27216
|
-
let o = await
|
|
27316
|
+
let o = await K(e, {
|
|
27217
27317
|
sourceQuery: n,
|
|
27218
27318
|
ref: t,
|
|
27219
|
-
targetParent: await
|
|
27319
|
+
targetParent: await Y(n, t, i),
|
|
27220
27320
|
...a ? {} : { strip: !1 }
|
|
27221
27321
|
});
|
|
27222
27322
|
o && s.push(...o.mappings);
|
|
27223
27323
|
}
|
|
27224
27324
|
return s;
|
|
27225
27325
|
}
|
|
27226
|
-
async function
|
|
27326
|
+
async function yr(e, t, n) {
|
|
27227
27327
|
let r = await t.any.getRecord(n);
|
|
27228
27328
|
if (!r) return;
|
|
27229
27329
|
let i = await t.any.getAttribute(r, { name: "name" });
|
|
@@ -27239,8 +27339,8 @@ async function ar(e, t, n) {
|
|
|
27239
27339
|
}
|
|
27240
27340
|
//#endregion
|
|
27241
27341
|
//#region src/v2019C1/extensions/lifecycle/layers/function/clone-function.ts
|
|
27242
|
-
async function
|
|
27243
|
-
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o, keepNameTypesFrom: s } = t, { recordMappings: c } = await
|
|
27342
|
+
async function br(e, t) {
|
|
27343
|
+
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o, keepNameTypesFrom: s } = t, { recordMappings: c } = await J(e, {
|
|
27244
27344
|
sourceQuery: n,
|
|
27245
27345
|
ref: r,
|
|
27246
27346
|
targetParent: i,
|
|
@@ -27257,15 +27357,15 @@ async function or(e, t) {
|
|
|
27257
27357
|
});
|
|
27258
27358
|
return c;
|
|
27259
27359
|
}
|
|
27260
|
-
async function
|
|
27261
|
-
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await
|
|
27360
|
+
async function xr(e, t) {
|
|
27361
|
+
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await Sr(n, r), s = [];
|
|
27262
27362
|
for (let t of o) {
|
|
27263
27363
|
let r = {
|
|
27264
27364
|
tagName: "FunctionCategory",
|
|
27265
27365
|
id: t
|
|
27266
|
-
}, o = await
|
|
27366
|
+
}, o = await wr(e, n, t);
|
|
27267
27367
|
if (o) {
|
|
27268
|
-
let t = await
|
|
27368
|
+
let t = await q(e, {
|
|
27269
27369
|
sourceQuery: n,
|
|
27270
27370
|
source: r,
|
|
27271
27371
|
target: o,
|
|
@@ -27274,28 +27374,28 @@ async function X(e, t) {
|
|
|
27274
27374
|
s.push(...t);
|
|
27275
27375
|
continue;
|
|
27276
27376
|
}
|
|
27277
|
-
let c = await
|
|
27377
|
+
let c = await K(e, {
|
|
27278
27378
|
sourceQuery: n,
|
|
27279
27379
|
ref: r,
|
|
27280
|
-
targetParent: await
|
|
27380
|
+
targetParent: await Y(n, r, i),
|
|
27281
27381
|
...a ? {} : { strip: !1 }
|
|
27282
27382
|
});
|
|
27283
27383
|
c && s.push(...c.mappings);
|
|
27284
27384
|
}
|
|
27285
27385
|
return s;
|
|
27286
27386
|
}
|
|
27287
|
-
async function
|
|
27288
|
-
let n = await
|
|
27387
|
+
async function Sr(e, t) {
|
|
27388
|
+
let n = await Cr(e, t), r = /* @__PURE__ */ new Set();
|
|
27289
27389
|
for (let { container: e } of n) e && r.add(e.id);
|
|
27290
27390
|
return r;
|
|
27291
27391
|
}
|
|
27292
|
-
async function
|
|
27293
|
-
let n = await
|
|
27392
|
+
async function Cr(e, t) {
|
|
27393
|
+
let n = await L.query.findRefsPointingTo(e, {
|
|
27294
27394
|
target: t,
|
|
27295
27395
|
containerTagName: "FunctionCategory"
|
|
27296
27396
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
27297
27397
|
for (let t of r) {
|
|
27298
|
-
let r = await
|
|
27398
|
+
let r = await L.query.findRefsPointingTo(e, {
|
|
27299
27399
|
target: {
|
|
27300
27400
|
tagName: "SubFunction",
|
|
27301
27401
|
id: t.id
|
|
@@ -27306,7 +27406,7 @@ async function cr(e, t) {
|
|
|
27306
27406
|
}
|
|
27307
27407
|
return n;
|
|
27308
27408
|
}
|
|
27309
|
-
async function
|
|
27409
|
+
async function wr(e, t, n) {
|
|
27310
27410
|
let r = await t.getRecord({
|
|
27311
27411
|
tagName: "FunctionCategory",
|
|
27312
27412
|
id: n
|
|
@@ -27325,18 +27425,18 @@ async function lr(e, t, n) {
|
|
|
27325
27425
|
}
|
|
27326
27426
|
//#endregion
|
|
27327
27427
|
//#region src/v2019C1/extensions/lifecycle/layers/function/satellites.constants.ts
|
|
27328
|
-
var
|
|
27428
|
+
var Tr = ["FunctionCategory"];
|
|
27329
27429
|
//#endregion
|
|
27330
27430
|
//#region src/v2019C1/extensions/lifecycle/layers/function/satellites.ts
|
|
27331
|
-
async function
|
|
27431
|
+
async function Er(e, t) {
|
|
27332
27432
|
let { primaryRef: n } = t, r = [n], { SubFunction: i = [] } = await e.findDescendants(n, { collect: "SubFunction" });
|
|
27333
27433
|
for (let e of i) r.push({
|
|
27334
27434
|
tagName: "SubFunction",
|
|
27335
27435
|
id: e.id
|
|
27336
27436
|
});
|
|
27337
27437
|
let o = /* @__PURE__ */ new Set(), s = [];
|
|
27338
|
-
for (let t of r) for (let n of
|
|
27339
|
-
let r = await
|
|
27438
|
+
for (let t of r) for (let n of Tr) {
|
|
27439
|
+
let r = await L.query.findRefsPointingTo(e, {
|
|
27340
27440
|
target: t,
|
|
27341
27441
|
containerTagName: n
|
|
27342
27442
|
});
|
|
@@ -27346,8 +27446,8 @@ async function Z(e, t) {
|
|
|
27346
27446
|
}
|
|
27347
27447
|
//#endregion
|
|
27348
27448
|
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.ts
|
|
27349
|
-
async function
|
|
27350
|
-
let { sourceQuery: n, functionRef: r, targetParent: i, overrides: a, keepNameTypesFrom: o } = t, { recordMappings: s } = await
|
|
27449
|
+
async function Dr(e, t) {
|
|
27450
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, overrides: a, keepNameTypesFrom: o } = t, { recordMappings: s } = await J(e, {
|
|
27351
27451
|
sourceQuery: n,
|
|
27352
27452
|
ref: r,
|
|
27353
27453
|
targetParent: i,
|
|
@@ -27357,18 +27457,18 @@ async function dr(e, t) {
|
|
|
27357
27457
|
to: "SubFunction"
|
|
27358
27458
|
} : void 0,
|
|
27359
27459
|
withTypes: { keepNameFrom: o }
|
|
27360
|
-
}), c = await
|
|
27460
|
+
}), c = await Q(e, i), l = await xr(e, {
|
|
27361
27461
|
sourceQuery: n,
|
|
27362
27462
|
functionRef: r,
|
|
27363
27463
|
structure: c,
|
|
27364
27464
|
stripCategoriesUuid: !1
|
|
27365
|
-
}), u = await
|
|
27465
|
+
}), u = await vr(e, {
|
|
27366
27466
|
sourceQuery: n,
|
|
27367
27467
|
primaryRef: r,
|
|
27368
27468
|
structure: c,
|
|
27369
27469
|
strip: !1
|
|
27370
27470
|
});
|
|
27371
|
-
await
|
|
27471
|
+
await V(e, {
|
|
27372
27472
|
mappings: [
|
|
27373
27473
|
...s,
|
|
27374
27474
|
...l,
|
|
@@ -27379,11 +27479,11 @@ async function dr(e, t) {
|
|
|
27379
27479
|
let d = s.find((e) => e.source.id === r.id);
|
|
27380
27480
|
if (!d) throw Error(`instantiate.fsd: cloned root not found for ${r.tagName}#${r.id}`);
|
|
27381
27481
|
let f = d.target;
|
|
27382
|
-
return await
|
|
27482
|
+
return await G(e, {
|
|
27383
27483
|
ref: f,
|
|
27384
27484
|
parentRef: i,
|
|
27385
27485
|
overrides: a?.get(r.id)
|
|
27386
|
-
}), await
|
|
27486
|
+
}), await vt(e, {
|
|
27387
27487
|
sourceQuery: n,
|
|
27388
27488
|
targetRoot: f,
|
|
27389
27489
|
fileType: "FSD"
|
|
@@ -27394,18 +27494,18 @@ async function dr(e, t) {
|
|
|
27394
27494
|
}
|
|
27395
27495
|
//#endregion
|
|
27396
27496
|
//#region src/v2019C1/extensions/lifecycle/layers/application/clone-application.ts
|
|
27397
|
-
async function
|
|
27398
|
-
let { sourceQuery: n, applicationRef: r, structure: i, omit: a, keepNameTypesFrom: o } = t, s = /* @__PURE__ */ new Map(), c = [], l = await
|
|
27497
|
+
async function Or(e, t) {
|
|
27498
|
+
let { sourceQuery: n, applicationRef: r, structure: i, omit: a, keepNameTypesFrom: o } = t, s = /* @__PURE__ */ new Map(), c = [], l = await Un(e, {
|
|
27399
27499
|
sourceQuery: n,
|
|
27400
27500
|
scopeRef: r,
|
|
27401
27501
|
refTagName: "FunctionRef",
|
|
27402
27502
|
targetTagName: "Function"
|
|
27403
27503
|
});
|
|
27404
27504
|
for (let t of l) {
|
|
27405
|
-
let r = await
|
|
27505
|
+
let r = await br(e, {
|
|
27406
27506
|
sourceQuery: n,
|
|
27407
27507
|
functionRef: t,
|
|
27408
|
-
targetParentRef: await
|
|
27508
|
+
targetParentRef: await Y(n, t, i),
|
|
27409
27509
|
omit: a,
|
|
27410
27510
|
keepNameTypesFrom: o
|
|
27411
27511
|
});
|
|
@@ -27413,7 +27513,7 @@ async function fr(e, t) {
|
|
|
27413
27513
|
for (let e of r) e.source.id && s.set(e.source.id, e.target);
|
|
27414
27514
|
}
|
|
27415
27515
|
for (let t of l) {
|
|
27416
|
-
let r = await
|
|
27516
|
+
let r = await xr(e, {
|
|
27417
27517
|
sourceQuery: n,
|
|
27418
27518
|
functionRef: t,
|
|
27419
27519
|
structure: i,
|
|
@@ -27421,16 +27521,16 @@ async function fr(e, t) {
|
|
|
27421
27521
|
});
|
|
27422
27522
|
c.push(...r);
|
|
27423
27523
|
}
|
|
27424
|
-
let u = await
|
|
27524
|
+
let u = await kr(e, {
|
|
27425
27525
|
sourceQuery: n,
|
|
27426
27526
|
applicationRef: r
|
|
27427
27527
|
});
|
|
27428
27528
|
for (let e of u) s.set(e.sourceId, e.existingRef);
|
|
27429
|
-
let d = new Set(["FunctionRef", "FunctionCategoryRef"]), f = await
|
|
27529
|
+
let d = new Set(["FunctionRef", "FunctionCategoryRef"]), f = await Gn(e, {
|
|
27430
27530
|
sourceQuery: n,
|
|
27431
27531
|
scopeTagName: "Application",
|
|
27432
27532
|
scopeRef: r,
|
|
27433
|
-
resolveTargetParent:
|
|
27533
|
+
resolveTargetParent: Kn({
|
|
27434
27534
|
sourceQuery: n,
|
|
27435
27535
|
structure: i,
|
|
27436
27536
|
cloneIndex: s
|
|
@@ -27440,10 +27540,10 @@ async function fr(e, t) {
|
|
|
27440
27540
|
omit: a
|
|
27441
27541
|
});
|
|
27442
27542
|
c.push(...f);
|
|
27443
|
-
let p = await
|
|
27543
|
+
let p = await K(e, {
|
|
27444
27544
|
sourceQuery: n,
|
|
27445
27545
|
ref: r,
|
|
27446
|
-
targetParent: await
|
|
27546
|
+
targetParent: await Y(n, r, i),
|
|
27447
27547
|
omit: a
|
|
27448
27548
|
});
|
|
27449
27549
|
p && c.push(...p.mappings);
|
|
@@ -27459,7 +27559,7 @@ async function fr(e, t) {
|
|
|
27459
27559
|
}
|
|
27460
27560
|
return c;
|
|
27461
27561
|
}
|
|
27462
|
-
async function
|
|
27562
|
+
async function kr(e, t) {
|
|
27463
27563
|
let { sourceQuery: n, applicationRef: r } = t, { AllocationRoleRef: i = [] } = await n.findDescendants(r, { collect: "AllocationRoleRef" }), a = [], o = /* @__PURE__ */ new Set();
|
|
27464
27564
|
for (let t of i) {
|
|
27465
27565
|
let r = t.attributes.find((e) => e.name === "allocationRoleUuid")?.value;
|
|
@@ -27483,7 +27583,7 @@ async function pr(e, t) {
|
|
|
27483
27583
|
tagName: "AllocationRole",
|
|
27484
27584
|
id: c.id
|
|
27485
27585
|
};
|
|
27486
|
-
await
|
|
27586
|
+
await q(e, {
|
|
27487
27587
|
sourceQuery: n,
|
|
27488
27588
|
source: {
|
|
27489
27589
|
tagName: "AllocationRole",
|
|
@@ -27502,20 +27602,20 @@ async function pr(e, t) {
|
|
|
27502
27602
|
}
|
|
27503
27603
|
//#endregion
|
|
27504
27604
|
//#region src/v2019C1/extensions/lifecycle/layers/application/satellites.constants.ts
|
|
27505
|
-
var
|
|
27605
|
+
var Ar = [{
|
|
27506
27606
|
refTag: "AllocationRoleRef",
|
|
27507
27607
|
uuidAttr: "allocationRoleUuid",
|
|
27508
27608
|
targetTag: "AllocationRole"
|
|
27509
27609
|
}];
|
|
27510
27610
|
//#endregion
|
|
27511
27611
|
//#region src/v2019C1/extensions/lifecycle/layers/application/satellites.ts
|
|
27512
|
-
async function
|
|
27612
|
+
async function jr(e, t) {
|
|
27513
27613
|
let { applicationRef: n } = t, r = await e.any.getTree(n);
|
|
27514
27614
|
if (!r) return [];
|
|
27515
27615
|
let i = /* @__PURE__ */ new Set(), o = [];
|
|
27516
|
-
for (let t of
|
|
27616
|
+
for (let t of Ar) {
|
|
27517
27617
|
let n = /* @__PURE__ */ new Set();
|
|
27518
|
-
await
|
|
27618
|
+
await Mr(e, {
|
|
27519
27619
|
node: r,
|
|
27520
27620
|
refTag: t.refTag,
|
|
27521
27621
|
uuidAttr: t.uuidAttr,
|
|
@@ -27531,13 +27631,13 @@ async function Q(e, t) {
|
|
|
27531
27631
|
}
|
|
27532
27632
|
return o;
|
|
27533
27633
|
}
|
|
27534
|
-
async function
|
|
27634
|
+
async function Mr(e, t) {
|
|
27535
27635
|
let { node: n, refTag: r, uuidAttr: i, out: a } = t;
|
|
27536
27636
|
if (n.tagName === r) {
|
|
27537
27637
|
let t = await e.any.getAttribute(n, { name: i });
|
|
27538
27638
|
t && a.add(t);
|
|
27539
27639
|
}
|
|
27540
|
-
for (let t of n.tree) await
|
|
27640
|
+
for (let t of n.tree) await Mr(e, {
|
|
27541
27641
|
node: t,
|
|
27542
27642
|
refTag: r,
|
|
27543
27643
|
uuidAttr: i,
|
|
@@ -27546,32 +27646,32 @@ async function hr(e, t) {
|
|
|
27546
27646
|
}
|
|
27547
27647
|
//#endregion
|
|
27548
27648
|
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/asd.ts
|
|
27549
|
-
async function
|
|
27550
|
-
let { sourceQuery: n, applicationRef: r, targetParent: i, overrides: a, keepNameTypesFrom: o } = t, s = await
|
|
27649
|
+
async function Nr(e, t) {
|
|
27650
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, overrides: a, keepNameTypesFrom: o } = t, s = await Q(e, i), c = await Un(e, {
|
|
27551
27651
|
sourceQuery: n,
|
|
27552
27652
|
scopeRef: r,
|
|
27553
27653
|
refTagName: "FunctionRef",
|
|
27554
27654
|
targetTagName: "Function"
|
|
27555
|
-
}), l = await
|
|
27655
|
+
}), l = await Or(e, {
|
|
27556
27656
|
sourceQuery: n,
|
|
27557
27657
|
applicationRef: r,
|
|
27558
27658
|
structure: s,
|
|
27559
27659
|
keepNameTypesFrom: o
|
|
27560
|
-
}), u = await
|
|
27660
|
+
}), u = await vr(e, {
|
|
27561
27661
|
sourceQuery: n,
|
|
27562
27662
|
primaryRef: r,
|
|
27563
27663
|
structure: s,
|
|
27564
27664
|
strip: !1
|
|
27565
27665
|
});
|
|
27566
|
-
await
|
|
27666
|
+
await V(e, {
|
|
27567
27667
|
mappings: [...l, ...u],
|
|
27568
27668
|
mode: "stamp-template"
|
|
27569
27669
|
});
|
|
27570
27670
|
for (let t of c) {
|
|
27571
27671
|
let r = l.find((e) => e.source.id === t.id);
|
|
27572
27672
|
if (!r) continue;
|
|
27573
|
-
let i = await
|
|
27574
|
-
await
|
|
27673
|
+
let i = await Y(n, t, s);
|
|
27674
|
+
await G(e, {
|
|
27575
27675
|
ref: r.target,
|
|
27576
27676
|
parentRef: i,
|
|
27577
27677
|
overrides: a?.get(t.id)
|
|
@@ -27579,12 +27679,12 @@ async function gr(e, t) {
|
|
|
27579
27679
|
}
|
|
27580
27680
|
let d = l.find((e) => e.source.id === r.id);
|
|
27581
27681
|
if (!d) throw Error(`instantiate.asd: cloned Application not found for ${r.id}`);
|
|
27582
|
-
let f = await
|
|
27583
|
-
await
|
|
27682
|
+
let f = await Y(n, r, s);
|
|
27683
|
+
await G(e, {
|
|
27584
27684
|
ref: d.target,
|
|
27585
27685
|
parentRef: f,
|
|
27586
27686
|
overrides: a?.get(r.id)
|
|
27587
|
-
}), await
|
|
27687
|
+
}), await vt(e, {
|
|
27588
27688
|
sourceQuery: n,
|
|
27589
27689
|
targetRoot: d.target,
|
|
27590
27690
|
fileType: "ASD"
|
|
@@ -27598,10 +27698,10 @@ async function gr(e, t) {
|
|
|
27598
27698
|
}
|
|
27599
27699
|
//#endregion
|
|
27600
27700
|
//#region src/v2019C1/extensions/lifecycle/update/transaction/function-satellites.ts
|
|
27601
|
-
async function
|
|
27602
|
-
let { sourceQuery: n, functionRef: r, instanceRef: i, targetParent: a, accepted: o } = t, s = await
|
|
27701
|
+
async function Pr(e, t) {
|
|
27702
|
+
let { sourceQuery: n, functionRef: r, instanceRef: i, targetParent: a, accepted: o } = t, s = await Er(n, { primaryRef: r }), c = !1;
|
|
27603
27703
|
for (let t of s) {
|
|
27604
|
-
let { uuid: r } = await n.any.getAttributes(t), i = await
|
|
27704
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await pr(e, {
|
|
27605
27705
|
tagName: t.tagName,
|
|
27606
27706
|
sourceUuid: r
|
|
27607
27707
|
});
|
|
@@ -27609,23 +27709,23 @@ async function _r(e, t) {
|
|
|
27609
27709
|
c = !0;
|
|
27610
27710
|
continue;
|
|
27611
27711
|
}
|
|
27612
|
-
await
|
|
27712
|
+
await qn(e, {
|
|
27613
27713
|
sourceQuery: n,
|
|
27614
27714
|
sourceRootRef: t,
|
|
27615
27715
|
instanceRootRef: i,
|
|
27616
27716
|
accepted: o
|
|
27617
27717
|
});
|
|
27618
27718
|
}
|
|
27619
|
-
c && (!o || o.sourceIds.has(r.id)) && await
|
|
27620
|
-
mappings: await
|
|
27719
|
+
c && (!o || o.sourceIds.has(r.id)) && await V(e, {
|
|
27720
|
+
mappings: await xr(e, {
|
|
27621
27721
|
sourceQuery: n,
|
|
27622
27722
|
functionRef: r,
|
|
27623
|
-
structure: await
|
|
27723
|
+
structure: await Q(e, a),
|
|
27624
27724
|
stripCategoriesUuid: !1
|
|
27625
27725
|
}),
|
|
27626
27726
|
mode: "stamp-template"
|
|
27627
27727
|
});
|
|
27628
|
-
let l = await
|
|
27728
|
+
let l = await Er(e, { primaryRef: {
|
|
27629
27729
|
tagName: "Function",
|
|
27630
27730
|
id: i.id
|
|
27631
27731
|
} });
|
|
@@ -27636,27 +27736,27 @@ async function _r(e, t) {
|
|
|
27636
27736
|
tagName: t.tagName,
|
|
27637
27737
|
attributes: { uuid: r }
|
|
27638
27738
|
});
|
|
27639
|
-
i || o && t.id && !o.instanceIds.has(t.id) || (await
|
|
27739
|
+
i || o && t.id && !o.instanceIds.has(t.id) || (await F(e, { target: t })).length > 0 || await e.delete(t);
|
|
27640
27740
|
}
|
|
27641
27741
|
}
|
|
27642
27742
|
//#endregion
|
|
27643
27743
|
//#region src/v2019C1/extensions/lifecycle/update/transaction/fsd.ts
|
|
27644
|
-
async function
|
|
27645
|
-
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a, report: o, decisions: s, keepNameTypesFrom: c } = t, { uuid: l } = await n.getAttributes(r), u = a === "instantiate" ? [] : await
|
|
27744
|
+
async function Fr(e, t) {
|
|
27745
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a, report: o, decisions: s, keepNameTypesFrom: c } = t, { uuid: l } = await n.getAttributes(r), u = a === "instantiate" ? [] : await dr(e, {
|
|
27646
27746
|
targetParent: i,
|
|
27647
27747
|
tagName: "Function",
|
|
27648
27748
|
sourceUuid: l
|
|
27649
27749
|
}), d = o?.groups ?? [];
|
|
27650
27750
|
if (u.length === 0) {
|
|
27651
|
-
let t = s ?
|
|
27751
|
+
let t = s ? sr({
|
|
27652
27752
|
groups: d,
|
|
27653
27753
|
decisions: s
|
|
27654
|
-
}) : void 0, a = s ?
|
|
27754
|
+
}) : void 0, a = s ? ir({
|
|
27655
27755
|
groups: d,
|
|
27656
27756
|
decisions: s
|
|
27657
27757
|
}) : void 0;
|
|
27658
27758
|
if (t && !t.sourceIds.has(r.id)) return [];
|
|
27659
|
-
let { functionRef: o } = await
|
|
27759
|
+
let { functionRef: o } = await Dr(e, {
|
|
27660
27760
|
sourceQuery: n,
|
|
27661
27761
|
functionRef: r,
|
|
27662
27762
|
targetParent: i,
|
|
@@ -27665,27 +27765,27 @@ async function vr(e, t) {
|
|
|
27665
27765
|
});
|
|
27666
27766
|
return [o];
|
|
27667
27767
|
}
|
|
27668
|
-
let f = await
|
|
27768
|
+
let f = await Q(e, i);
|
|
27669
27769
|
for (let t of u) {
|
|
27670
|
-
let { instanceAccepted: a, instanceOverrides: o } =
|
|
27770
|
+
let { instanceAccepted: a, instanceOverrides: o } = Ir({
|
|
27671
27771
|
instanceId: t.id,
|
|
27672
27772
|
groups: d,
|
|
27673
27773
|
decisions: s
|
|
27674
27774
|
});
|
|
27675
|
-
await
|
|
27775
|
+
await qn(e, {
|
|
27676
27776
|
sourceQuery: n,
|
|
27677
27777
|
sourceRootRef: r,
|
|
27678
27778
|
instanceRootRef: t,
|
|
27679
27779
|
accepted: a,
|
|
27680
27780
|
overrides: o,
|
|
27681
27781
|
keepNameTypesFrom: c
|
|
27682
|
-
}), await
|
|
27782
|
+
}), await Pr(e, {
|
|
27683
27783
|
sourceQuery: n,
|
|
27684
27784
|
functionRef: r,
|
|
27685
27785
|
instanceRef: t,
|
|
27686
27786
|
targetParent: i,
|
|
27687
27787
|
accepted: a
|
|
27688
|
-
}), await
|
|
27788
|
+
}), await _r(e, {
|
|
27689
27789
|
sourceQuery: n,
|
|
27690
27790
|
primaryRef: r,
|
|
27691
27791
|
instancePrimaryRef: {
|
|
@@ -27701,7 +27801,7 @@ async function vr(e, t) {
|
|
|
27701
27801
|
id: e.id
|
|
27702
27802
|
}));
|
|
27703
27803
|
}
|
|
27704
|
-
function
|
|
27804
|
+
function Ir(e) {
|
|
27705
27805
|
let { instanceId: t, groups: n, decisions: r } = e;
|
|
27706
27806
|
if (!r) return {
|
|
27707
27807
|
instanceAccepted: void 0,
|
|
@@ -27709,11 +27809,11 @@ function yr(e) {
|
|
|
27709
27809
|
};
|
|
27710
27810
|
let i = n.filter((e) => e.instanceScopeId === t);
|
|
27711
27811
|
return {
|
|
27712
|
-
instanceAccepted:
|
|
27812
|
+
instanceAccepted: sr({
|
|
27713
27813
|
groups: i,
|
|
27714
27814
|
decisions: r
|
|
27715
27815
|
}),
|
|
27716
|
-
instanceOverrides:
|
|
27816
|
+
instanceOverrides: ir({
|
|
27717
27817
|
groups: i,
|
|
27718
27818
|
decisions: r
|
|
27719
27819
|
})
|
|
@@ -27721,16 +27821,16 @@ function yr(e) {
|
|
|
27721
27821
|
}
|
|
27722
27822
|
//#endregion
|
|
27723
27823
|
//#region src/v2019C1/extensions/lifecycle/update/transaction/asd.ts
|
|
27724
|
-
async function
|
|
27725
|
-
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s, keepNameTypesFrom: c } = t, { uuid: l } = await n.getAttributes(r), u = a === "instantiate" ? [] : await
|
|
27824
|
+
async function Lr(e, t) {
|
|
27825
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s, keepNameTypesFrom: c } = t, { uuid: l } = await n.getAttributes(r), u = a === "instantiate" ? [] : await X(e, {
|
|
27726
27826
|
tagName: "Application",
|
|
27727
27827
|
sourceUuid: l
|
|
27728
27828
|
}), d = o?.groups ?? [];
|
|
27729
27829
|
if (u.length === 0) {
|
|
27730
|
-
let t = s ?
|
|
27830
|
+
let t = s ? sr({
|
|
27731
27831
|
groups: d,
|
|
27732
27832
|
decisions: s
|
|
27733
|
-
}) : void 0, a = s ?
|
|
27833
|
+
}) : void 0, a = s ? ir({
|
|
27734
27834
|
groups: d,
|
|
27735
27835
|
decisions: s
|
|
27736
27836
|
}) : void 0;
|
|
@@ -27738,7 +27838,7 @@ async function br(e, t) {
|
|
|
27738
27838
|
applications: [],
|
|
27739
27839
|
functions: []
|
|
27740
27840
|
};
|
|
27741
|
-
let { applicationRef: o, composedFunctionRefs: l } = await
|
|
27841
|
+
let { applicationRef: o, composedFunctionRefs: l } = await Nr(e, {
|
|
27742
27842
|
sourceQuery: n,
|
|
27743
27843
|
applicationRef: r,
|
|
27744
27844
|
targetParent: i,
|
|
@@ -27750,32 +27850,37 @@ async function br(e, t) {
|
|
|
27750
27850
|
functions: l
|
|
27751
27851
|
};
|
|
27752
27852
|
}
|
|
27753
|
-
let f = await
|
|
27853
|
+
let f = await Q(e, i), p = await jr(n, { applicationRef: r }), m = [];
|
|
27754
27854
|
for (let t of u) {
|
|
27755
|
-
let i = d.filter((e) => e.instanceScopeId === t.id), a = s ?
|
|
27855
|
+
let i = d.filter((e) => e.instanceScopeId === t.id), a = s ? sr({
|
|
27756
27856
|
groups: i,
|
|
27757
27857
|
decisions: s
|
|
27758
|
-
}) : void 0, o = s ?
|
|
27858
|
+
}) : void 0, o = s ? ir({
|
|
27759
27859
|
groups: i,
|
|
27760
27860
|
decisions: s
|
|
27761
|
-
}) : void 0
|
|
27861
|
+
}) : void 0;
|
|
27862
|
+
(!a || a.sourceIds.size > 0 || a.instanceIds.size > 0) && m.push({
|
|
27863
|
+
tagName: "Application",
|
|
27864
|
+
id: t.id
|
|
27865
|
+
});
|
|
27866
|
+
let l = await jr(e, { applicationRef: {
|
|
27762
27867
|
tagName: "Application",
|
|
27763
27868
|
id: t.id
|
|
27764
27869
|
} });
|
|
27765
|
-
await
|
|
27870
|
+
await qn(e, {
|
|
27766
27871
|
sourceQuery: n,
|
|
27767
27872
|
sourceRootRef: r,
|
|
27768
27873
|
instanceRootRef: t,
|
|
27769
27874
|
accepted: a,
|
|
27770
27875
|
overrides: o,
|
|
27771
27876
|
keepNameTypesFrom: c
|
|
27772
|
-
}), await
|
|
27877
|
+
}), await mr(e, {
|
|
27773
27878
|
sourceQuery: n,
|
|
27774
27879
|
satelliteRefs: p,
|
|
27775
27880
|
instanceSatelliteRefs: l,
|
|
27776
27881
|
structure: f,
|
|
27777
27882
|
accepted: a
|
|
27778
|
-
}), await
|
|
27883
|
+
}), await _r(e, {
|
|
27779
27884
|
sourceQuery: n,
|
|
27780
27885
|
primaryRef: r,
|
|
27781
27886
|
instancePrimaryRef: {
|
|
@@ -27786,27 +27891,23 @@ async function br(e, t) {
|
|
|
27786
27891
|
accepted: a
|
|
27787
27892
|
});
|
|
27788
27893
|
}
|
|
27789
|
-
let m = await xr(e, {
|
|
27790
|
-
sourceQuery: n,
|
|
27791
|
-
applicationRef: r,
|
|
27792
|
-
targetParent: i,
|
|
27793
|
-
scenario: a,
|
|
27794
|
-
report: o,
|
|
27795
|
-
decisions: s,
|
|
27796
|
-
keepNameTypesFrom: c
|
|
27797
|
-
});
|
|
27798
27894
|
return {
|
|
27799
|
-
applications:
|
|
27800
|
-
|
|
27801
|
-
|
|
27802
|
-
|
|
27803
|
-
|
|
27895
|
+
applications: m,
|
|
27896
|
+
functions: await Rr(e, {
|
|
27897
|
+
sourceQuery: n,
|
|
27898
|
+
applicationRef: r,
|
|
27899
|
+
targetParent: i,
|
|
27900
|
+
scenario: a,
|
|
27901
|
+
report: o,
|
|
27902
|
+
decisions: s,
|
|
27903
|
+
keepNameTypesFrom: c
|
|
27904
|
+
})
|
|
27804
27905
|
};
|
|
27805
27906
|
}
|
|
27806
|
-
async function
|
|
27807
|
-
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s, keepNameTypesFrom: c } = t, l = await
|
|
27907
|
+
async function Rr(e, t) {
|
|
27908
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s, keepNameTypesFrom: c } = t, l = await lr(n, r);
|
|
27808
27909
|
if (l.size === 0) return [];
|
|
27809
|
-
let u = await
|
|
27910
|
+
let u = await Q(e, i), d = [];
|
|
27810
27911
|
for (let t of l) {
|
|
27811
27912
|
let [r] = await n.any.findByAttributes({
|
|
27812
27913
|
tagName: "Function",
|
|
@@ -27816,10 +27917,10 @@ async function xr(e, t) {
|
|
|
27816
27917
|
let i = {
|
|
27817
27918
|
tagName: "Function",
|
|
27818
27919
|
id: r.id
|
|
27819
|
-
}, l = await
|
|
27920
|
+
}, l = await Fr(e, {
|
|
27820
27921
|
sourceQuery: n,
|
|
27821
27922
|
functionRef: i,
|
|
27822
|
-
targetParent: await
|
|
27923
|
+
targetParent: await Y(n, i, u),
|
|
27823
27924
|
scenario: a,
|
|
27824
27925
|
report: o,
|
|
27825
27926
|
decisions: s,
|
|
@@ -27831,29 +27932,29 @@ async function xr(e, t) {
|
|
|
27831
27932
|
}
|
|
27832
27933
|
//#endregion
|
|
27833
27934
|
//#region src/v2019C1/extensions/lifecycle/update/index.ts
|
|
27834
|
-
var
|
|
27835
|
-
asd: () =>
|
|
27836
|
-
fsd: () =>
|
|
27935
|
+
var zr = /* @__PURE__ */ l({
|
|
27936
|
+
asd: () => Lr,
|
|
27937
|
+
fsd: () => Fr
|
|
27837
27938
|
});
|
|
27838
27939
|
//#endregion
|
|
27839
27940
|
//#region src/v2019C1/extensions/lifecycle/apply/apply.ts
|
|
27840
|
-
async function
|
|
27941
|
+
async function Br(e, t) {
|
|
27841
27942
|
let { report: n, decisions: r } = t;
|
|
27842
|
-
return r ? (
|
|
27943
|
+
return r ? (ar({
|
|
27843
27944
|
groups: n.groups,
|
|
27844
27945
|
decisions: r
|
|
27845
27946
|
}), {
|
|
27846
27947
|
report: n,
|
|
27847
|
-
instances: await
|
|
27948
|
+
instances: await Hr(e, t, n, r)
|
|
27848
27949
|
}) : n.needsDecisions ? {
|
|
27849
27950
|
report: n,
|
|
27850
|
-
instances:
|
|
27951
|
+
instances: Vr(t.verb)
|
|
27851
27952
|
} : {
|
|
27852
27953
|
report: n,
|
|
27853
|
-
instances: await
|
|
27954
|
+
instances: await Hr(e, t, n, void 0)
|
|
27854
27955
|
};
|
|
27855
27956
|
}
|
|
27856
|
-
function
|
|
27957
|
+
function Vr(e) {
|
|
27857
27958
|
return e === "fsd" ? {
|
|
27858
27959
|
verb: "fsd",
|
|
27859
27960
|
functions: []
|
|
@@ -27863,10 +27964,10 @@ function wr(e) {
|
|
|
27863
27964
|
functions: []
|
|
27864
27965
|
};
|
|
27865
27966
|
}
|
|
27866
|
-
async function
|
|
27967
|
+
async function Hr(e, t, n, r) {
|
|
27867
27968
|
if (t.verb === "fsd") return {
|
|
27868
27969
|
verb: "fsd",
|
|
27869
|
-
functions: await
|
|
27970
|
+
functions: await Fr(e, {
|
|
27870
27971
|
sourceQuery: t.sourceQuery,
|
|
27871
27972
|
functionRef: t.ref,
|
|
27872
27973
|
targetParent: t.anchor,
|
|
@@ -27876,7 +27977,7 @@ async function Tr(e, t, n, r) {
|
|
|
27876
27977
|
keepNameTypesFrom: t.keepNameTypesFrom
|
|
27877
27978
|
})
|
|
27878
27979
|
};
|
|
27879
|
-
let { applications: i, functions: a } = await
|
|
27980
|
+
let { applications: i, functions: a } = await Lr(e, {
|
|
27880
27981
|
sourceQuery: t.sourceQuery,
|
|
27881
27982
|
applicationRef: t.ref,
|
|
27882
27983
|
targetParent: t.anchor,
|
|
@@ -27893,7 +27994,7 @@ async function Tr(e, t, n, r) {
|
|
|
27893
27994
|
}
|
|
27894
27995
|
//#endregion
|
|
27895
27996
|
//#region src/v2019C1/extensions/lifecycle/extract/transaction/ensure-substation-structure.ts
|
|
27896
|
-
async function
|
|
27997
|
+
async function Ur(e) {
|
|
27897
27998
|
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
27898
27999
|
tagName: "Substation",
|
|
27899
28000
|
attributes: { name: "TEMPLATE" }
|
|
@@ -27912,12 +28013,12 @@ async function Er(e) {
|
|
|
27912
28013
|
}
|
|
27913
28014
|
//#endregion
|
|
27914
28015
|
//#region src/v2019C1/extensions/lifecycle/extract/transaction/post-extraction-cleanup.ts
|
|
27915
|
-
async function
|
|
27916
|
-
await
|
|
28016
|
+
async function Wr(e) {
|
|
28017
|
+
await R.transaction.orphanUuidRefs(e), await R.transaction.resetLNode(e), await R.transaction.pruneEmptyContainers(e);
|
|
27917
28018
|
}
|
|
27918
28019
|
//#endregion
|
|
27919
28020
|
//#region src/v2019C1/extensions/lifecycle/layers/omit-filters.ts
|
|
27920
|
-
var
|
|
28021
|
+
var Gr = [
|
|
27921
28022
|
"FunctionSclRef",
|
|
27922
28023
|
"ApplicationSclRef",
|
|
27923
28024
|
"GeneralEquipment",
|
|
@@ -27925,9 +28026,9 @@ var Or = [
|
|
|
27925
28026
|
];
|
|
27926
28027
|
//#endregion
|
|
27927
28028
|
//#region src/v2019C1/extensions/lifecycle/extract/transaction/asd.ts
|
|
27928
|
-
async function
|
|
27929
|
-
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
27930
|
-
await
|
|
28029
|
+
async function Kr(e, t) {
|
|
28030
|
+
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await Ur(e), c = await e.getAttribute(r, { name: "name" }) || "Unnamed Application";
|
|
28031
|
+
await en.transaction.addEntry(e, {
|
|
27931
28032
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
27932
28033
|
header: {
|
|
27933
28034
|
fileType: "ASD",
|
|
@@ -27940,17 +28041,17 @@ async function kr(e, t) {
|
|
|
27940
28041
|
what: "ASD initialization",
|
|
27941
28042
|
why: "Application was extracted from a previous file"
|
|
27942
28043
|
}
|
|
27943
|
-
}), await
|
|
28044
|
+
}), await Or(e, {
|
|
27944
28045
|
sourceQuery: n,
|
|
27945
28046
|
applicationRef: r,
|
|
27946
28047
|
structure: s,
|
|
27947
|
-
omit:
|
|
27948
|
-
}), await
|
|
28048
|
+
omit: Gr
|
|
28049
|
+
}), await Wr(e);
|
|
27949
28050
|
}
|
|
27950
28051
|
//#endregion
|
|
27951
28052
|
//#region src/v2019C1/extensions/lifecycle/extract/transaction/omit.ts
|
|
27952
|
-
var
|
|
27953
|
-
...
|
|
28053
|
+
var qr = [
|
|
28054
|
+
...Gr,
|
|
27954
28055
|
"DOS",
|
|
27955
28056
|
"Labels",
|
|
27956
28057
|
"LNodeInputs",
|
|
@@ -27962,12 +28063,12 @@ var Ar = [
|
|
|
27962
28063
|
];
|
|
27963
28064
|
//#endregion
|
|
27964
28065
|
//#region src/v2019C1/extensions/lifecycle/extract/transaction/fsd.ts
|
|
27965
|
-
async function
|
|
27966
|
-
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
28066
|
+
async function Jr(e, t) {
|
|
28067
|
+
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await Ur(e), c = {
|
|
27967
28068
|
tagName: s.Substation.tagName,
|
|
27968
28069
|
id: s.Substation.id
|
|
27969
28070
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
27970
|
-
await
|
|
28071
|
+
await en.transaction.addEntry(e, {
|
|
27971
28072
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
27972
28073
|
header: {
|
|
27973
28074
|
fileType: "FSD",
|
|
@@ -27980,39 +28081,39 @@ async function jr(e, t) {
|
|
|
27980
28081
|
what: "FSD initialization",
|
|
27981
28082
|
why: "Function was extracted from a previous file"
|
|
27982
28083
|
}
|
|
27983
|
-
}), await
|
|
28084
|
+
}), await br(e, {
|
|
27984
28085
|
sourceQuery: n,
|
|
27985
28086
|
functionRef: r,
|
|
27986
28087
|
targetParentRef: c,
|
|
27987
|
-
omit:
|
|
28088
|
+
omit: qr,
|
|
27988
28089
|
stripRootAttributes: ["templateUuid"]
|
|
27989
|
-
}), await
|
|
28090
|
+
}), await xr(e, {
|
|
27990
28091
|
sourceQuery: n,
|
|
27991
28092
|
functionRef: r,
|
|
27992
28093
|
structure: s
|
|
27993
|
-
}), await
|
|
28094
|
+
}), await Wr(e);
|
|
27994
28095
|
}
|
|
27995
28096
|
//#endregion
|
|
27996
28097
|
//#region src/v2019C1/extensions/lifecycle/extract/index.ts
|
|
27997
|
-
var
|
|
27998
|
-
asd: () =>
|
|
27999
|
-
ensureSubstationTemplateStructure: () =>
|
|
28000
|
-
fsd: () =>
|
|
28001
|
-
}),
|
|
28002
|
-
asd: () =>
|
|
28003
|
-
fsd: () =>
|
|
28004
|
-
resolveTargetStructure: () =>
|
|
28098
|
+
var Yr = /* @__PURE__ */ l({
|
|
28099
|
+
asd: () => Kr,
|
|
28100
|
+
ensureSubstationTemplateStructure: () => Ur,
|
|
28101
|
+
fsd: () => Jr
|
|
28102
|
+
}), Xr = /* @__PURE__ */ l({
|
|
28103
|
+
asd: () => Nr,
|
|
28104
|
+
fsd: () => Dr,
|
|
28105
|
+
resolveTargetStructure: () => Q
|
|
28005
28106
|
});
|
|
28006
28107
|
//#endregion
|
|
28007
28108
|
//#region src/v2019C1/extensions/lifecycle/report/mark-placement-conflicts.ts
|
|
28008
|
-
async function
|
|
28109
|
+
async function Zr(e, t, n) {
|
|
28009
28110
|
if (t.scenario === "instantiate") for (let r of n.groups) {
|
|
28010
28111
|
if (r.change !== "added") continue;
|
|
28011
28112
|
let i = r.primary.sourceRef;
|
|
28012
28113
|
if (!i) continue;
|
|
28013
28114
|
let a = await t.sourceQuery.getAttributes(i), o = a.uuid;
|
|
28014
28115
|
if (!o) continue;
|
|
28015
|
-
let s = r.primary.tagName, [c] = await
|
|
28116
|
+
let s = r.primary.tagName, [c] = await X(e, {
|
|
28016
28117
|
tagName: s,
|
|
28017
28118
|
sourceUuid: o
|
|
28018
28119
|
});
|
|
@@ -28025,7 +28126,7 @@ async function Pr(e, t, n) {
|
|
|
28025
28126
|
let n = {
|
|
28026
28127
|
tagName: t.tagName,
|
|
28027
28128
|
id: t.id
|
|
28028
|
-
}, r = await
|
|
28129
|
+
}, r = await W(e, {
|
|
28029
28130
|
parentRef: n,
|
|
28030
28131
|
childTag: s,
|
|
28031
28132
|
candidate: a
|
|
@@ -28036,9 +28137,9 @@ async function Pr(e, t, n) {
|
|
|
28036
28137
|
}
|
|
28037
28138
|
}
|
|
28038
28139
|
if (!d || !u) continue;
|
|
28039
|
-
let f = d.fields.find((e) =>
|
|
28140
|
+
let f = d.fields.find((e) => kn(U(s, e)));
|
|
28040
28141
|
if (f) {
|
|
28041
|
-
let t = await
|
|
28142
|
+
let t = await zn(e, {
|
|
28042
28143
|
parentRef: u,
|
|
28043
28144
|
childTag: s,
|
|
28044
28145
|
candidate: a,
|
|
@@ -28053,29 +28154,31 @@ async function Pr(e, t, n) {
|
|
|
28053
28154
|
}
|
|
28054
28155
|
//#endregion
|
|
28055
28156
|
//#region src/v2019C1/extensions/lifecycle/report/query/satellite-companions.ts
|
|
28056
|
-
async function
|
|
28057
|
-
let { sourceQuery: n, primaryRef: r, satelliteRefs: i, instanceSatelliteRefs: a, report: o } = t,
|
|
28058
|
-
if (!s) return o;
|
|
28157
|
+
async function Qr(e, t) {
|
|
28158
|
+
let { sourceQuery: n, primaryRef: r, satelliteRefs: i, instanceSatelliteRefs: a, report: o, instanceScopeId: s } = t, c = o.groups.find((e) => e.primary.sourceRef?.id === r.id);
|
|
28059
28159
|
for (let t of i) {
|
|
28060
|
-
let { uuid: r } = await n.any.getAttributes(t), i = await
|
|
28160
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await mn({
|
|
28061
28161
|
sourceQuery: n,
|
|
28062
28162
|
targetQuery: e,
|
|
28063
28163
|
sourceRootRef: t,
|
|
28064
|
-
instanceRootRef: await
|
|
28164
|
+
instanceRootRef: await pr(e, {
|
|
28065
28165
|
tagName: t.tagName,
|
|
28066
28166
|
sourceUuid: r
|
|
28067
28167
|
})
|
|
28068
28168
|
});
|
|
28069
|
-
i.root.change !== "unchanged" &&
|
|
28169
|
+
i.summary.added + i.summary.removed + i.summary.modified > 0 && (c ? (i.root.change !== "unchanged" && c.companions.push(i.root), ln({
|
|
28170
|
+
node: i.root,
|
|
28171
|
+
out: c.companions
|
|
28172
|
+
})) : (o.groups.push(...sn(i.root, s)), o.needsDecisions = !0));
|
|
28070
28173
|
}
|
|
28071
|
-
for (let t of a ?? []) {
|
|
28174
|
+
if (c) for (let t of a ?? []) {
|
|
28072
28175
|
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
28073
28176
|
if (!r) continue;
|
|
28074
28177
|
let [i] = await n.any.findByAttributes({
|
|
28075
28178
|
tagName: t.tagName,
|
|
28076
28179
|
attributes: { uuid: r }
|
|
28077
28180
|
});
|
|
28078
|
-
i ||
|
|
28181
|
+
i || c.companions.push({
|
|
28079
28182
|
change: "removed",
|
|
28080
28183
|
tagName: t.tagName,
|
|
28081
28184
|
instanceRef: t,
|
|
@@ -28086,60 +28189,60 @@ async function Fr(e, t) {
|
|
|
28086
28189
|
}
|
|
28087
28190
|
//#endregion
|
|
28088
28191
|
//#region src/v2019C1/extensions/lifecycle/report/query/cross-cutting-satellites.ts
|
|
28089
|
-
async function
|
|
28192
|
+
async function $r(e, t) {
|
|
28090
28193
|
let { sourceQuery: n, primaryRef: r, instancePrimaryRef: i, report: a } = t;
|
|
28091
|
-
return
|
|
28194
|
+
return Qr(e, {
|
|
28092
28195
|
sourceQuery: n,
|
|
28093
28196
|
primaryRef: r,
|
|
28094
|
-
satelliteRefs: await
|
|
28095
|
-
instanceSatelliteRefs: i ? await
|
|
28096
|
-
report: a
|
|
28197
|
+
satelliteRefs: await Z(n, { primaryRef: r }),
|
|
28198
|
+
instanceSatelliteRefs: i ? await Z(e, { primaryRef: i }) : [],
|
|
28199
|
+
report: a,
|
|
28200
|
+
instanceScopeId: i?.id
|
|
28097
28201
|
});
|
|
28098
28202
|
}
|
|
28099
28203
|
//#endregion
|
|
28100
28204
|
//#region src/v2019C1/extensions/lifecycle/report/query/report-function-satellites.ts
|
|
28101
|
-
async function
|
|
28205
|
+
async function ei(e, t) {
|
|
28102
28206
|
let { sourceQuery: n, functionRef: r, instance: i, report: a } = t;
|
|
28103
|
-
return
|
|
28207
|
+
return Qr(e, {
|
|
28104
28208
|
sourceQuery: n,
|
|
28105
28209
|
primaryRef: r,
|
|
28106
|
-
satelliteRefs: await
|
|
28107
|
-
instanceSatelliteRefs: i ? await
|
|
28210
|
+
satelliteRefs: await Er(n, { primaryRef: r }),
|
|
28211
|
+
instanceSatelliteRefs: i ? await Er(e, { primaryRef: {
|
|
28108
28212
|
tagName: "Function",
|
|
28109
28213
|
id: i.id
|
|
28110
28214
|
} }) : [],
|
|
28111
|
-
report: a
|
|
28215
|
+
report: a,
|
|
28216
|
+
instanceScopeId: i?.id
|
|
28112
28217
|
});
|
|
28113
28218
|
}
|
|
28114
28219
|
//#endregion
|
|
28115
28220
|
//#region src/v2019C1/extensions/lifecycle/report/query/report-function.ts
|
|
28116
|
-
async function
|
|
28117
|
-
let { sourceQuery: n, functionRef: r, instance: i } = t, a = await
|
|
28118
|
-
sourceQuery: n,
|
|
28119
|
-
targetQuery: e,
|
|
28120
|
-
sourceRootRef: r,
|
|
28121
|
-
instanceRootRef: i
|
|
28122
|
-
});
|
|
28123
|
-
if (!i) return a;
|
|
28124
|
-
let o = await Lr(e, {
|
|
28221
|
+
async function ti(e, t) {
|
|
28222
|
+
let { sourceQuery: n, functionRef: r, instance: i } = t, a = await ei(e, {
|
|
28125
28223
|
sourceQuery: n,
|
|
28126
28224
|
functionRef: r,
|
|
28127
28225
|
instance: i,
|
|
28128
|
-
report:
|
|
28226
|
+
report: await mn({
|
|
28227
|
+
sourceQuery: n,
|
|
28228
|
+
targetQuery: e,
|
|
28229
|
+
sourceRootRef: r,
|
|
28230
|
+
instanceRootRef: i
|
|
28231
|
+
})
|
|
28129
28232
|
});
|
|
28130
|
-
return
|
|
28233
|
+
return $r(e, {
|
|
28131
28234
|
sourceQuery: n,
|
|
28132
28235
|
primaryRef: r,
|
|
28133
|
-
instancePrimaryRef: {
|
|
28236
|
+
instancePrimaryRef: i ? {
|
|
28134
28237
|
tagName: "Function",
|
|
28135
28238
|
id: i.id
|
|
28136
|
-
},
|
|
28137
|
-
report:
|
|
28239
|
+
} : void 0,
|
|
28240
|
+
report: a
|
|
28138
28241
|
});
|
|
28139
28242
|
}
|
|
28140
28243
|
//#endregion
|
|
28141
28244
|
//#region src/v2019C1/extensions/presentation/constants/title.ts
|
|
28142
|
-
var
|
|
28245
|
+
var ni = {
|
|
28143
28246
|
LNode: {
|
|
28144
28247
|
compact: [
|
|
28145
28248
|
"prefix",
|
|
@@ -28185,10 +28288,19 @@ var zr = {
|
|
|
28185
28288
|
compact: ["version", "revision"],
|
|
28186
28289
|
separator: "."
|
|
28187
28290
|
},
|
|
28188
|
-
ControlRef: {
|
|
28291
|
+
ControlRef: {
|
|
28292
|
+
compact: [{
|
|
28293
|
+
whenPresent: "controlled",
|
|
28294
|
+
template: "{output}[{outputInst}]/{controlled}"
|
|
28295
|
+
}, { template: "{output}[{outputInst}]/{pLN}.{pDO}" }],
|
|
28296
|
+
full: "{output}[{outputInst}]/{pLN}.{pDO}/{controlled}"
|
|
28297
|
+
},
|
|
28189
28298
|
SourceRef: {
|
|
28190
|
-
compact:
|
|
28191
|
-
|
|
28299
|
+
compact: [{
|
|
28300
|
+
whenPresent: "source",
|
|
28301
|
+
template: "{service}/{input}[{inputInst}]/{source}"
|
|
28302
|
+
}, { template: "{service}/{input}[{inputInst}]/{pLN}.{pDO}.{pDA}" }],
|
|
28303
|
+
full: "{service}/{input}[{inputInst}]/{pLN}.{pDO}.{pDA}/{source}"
|
|
28192
28304
|
},
|
|
28193
28305
|
FunctionCatRef: { compact: ["function"] },
|
|
28194
28306
|
FunctionRef: { compact: ["function"] },
|
|
@@ -28227,44 +28339,44 @@ var zr = {
|
|
|
28227
28339
|
};
|
|
28228
28340
|
//#endregion
|
|
28229
28341
|
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
28230
|
-
async function
|
|
28342
|
+
async function ri(e, t, n = {}) {
|
|
28231
28343
|
let r = await e.getRecord(t);
|
|
28232
28344
|
if (!r) return n.withLabels ? {
|
|
28233
28345
|
title: "",
|
|
28234
28346
|
labels: {}
|
|
28235
28347
|
} : "";
|
|
28236
|
-
let i = r.tagName, a = n.mode ?? "compact", o = await e.any.getAttributes(r), s =
|
|
28348
|
+
let i = r.tagName, a = n.mode ?? "compact", o = await e.any.getAttributes(r), s = ni[i], c = ii({
|
|
28237
28349
|
tag: i,
|
|
28238
28350
|
spec: s,
|
|
28239
28351
|
mode: a,
|
|
28240
28352
|
attributes: o,
|
|
28241
|
-
specAttributes: s?.attributesFrom ? await
|
|
28353
|
+
specAttributes: s?.attributesFrom ? await ai(e, r, s.attributesFrom) : o,
|
|
28242
28354
|
value: r.value
|
|
28243
28355
|
});
|
|
28244
28356
|
return n.withLabels ? {
|
|
28245
28357
|
title: c,
|
|
28246
|
-
labels: await
|
|
28358
|
+
labels: await oi(e, r)
|
|
28247
28359
|
} : c;
|
|
28248
28360
|
}
|
|
28249
|
-
function
|
|
28361
|
+
function ii(e) {
|
|
28250
28362
|
let { tag: t, spec: n, mode: r, attributes: i, specAttributes: a, value: o } = e;
|
|
28251
28363
|
if (n) {
|
|
28252
|
-
let e =
|
|
28364
|
+
let e = li(n, a, r);
|
|
28253
28365
|
if (e) return e;
|
|
28254
28366
|
}
|
|
28255
28367
|
let s = (o ?? "").trim();
|
|
28256
28368
|
if (s) return s;
|
|
28257
|
-
let c =
|
|
28369
|
+
let c = _[t]?.attributes?.identityFields, l = c?.find((e) => e === "name" || e === "id") ?? c?.[0];
|
|
28258
28370
|
return l && i[l] ? i[l] : i.name || t;
|
|
28259
28371
|
}
|
|
28260
|
-
async function
|
|
28372
|
+
async function ai(e, t, n) {
|
|
28261
28373
|
let [r] = await e.any.getChildren(t, n);
|
|
28262
28374
|
return r ? e.any.getAttributes(r) : {};
|
|
28263
28375
|
}
|
|
28264
|
-
async function
|
|
28265
|
-
return
|
|
28376
|
+
async function oi(e, t) {
|
|
28377
|
+
return ci(await si(e, t));
|
|
28266
28378
|
}
|
|
28267
|
-
async function
|
|
28379
|
+
async function si(e, t) {
|
|
28268
28380
|
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
28269
28381
|
for (let t of r) {
|
|
28270
28382
|
let r = await e.any.getChildren(t, "Label");
|
|
@@ -28279,64 +28391,76 @@ async function Ur(e, t) {
|
|
|
28279
28391
|
}
|
|
28280
28392
|
return n;
|
|
28281
28393
|
}
|
|
28282
|
-
function
|
|
28394
|
+
function ci(e) {
|
|
28283
28395
|
let t = {};
|
|
28284
28396
|
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
28285
28397
|
return t;
|
|
28286
28398
|
}
|
|
28287
|
-
function
|
|
28399
|
+
function li(e, t, n) {
|
|
28288
28400
|
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
28289
|
-
if (typeof i == "string") return
|
|
28401
|
+
if (typeof i == "string") return di(i, t);
|
|
28402
|
+
if (ui(i)) {
|
|
28403
|
+
for (let e of i) {
|
|
28404
|
+
if (e.whenPresent && !t[e.whenPresent]) continue;
|
|
28405
|
+
let n = di(e.template, t);
|
|
28406
|
+
if (n) return n;
|
|
28407
|
+
}
|
|
28408
|
+
return "";
|
|
28409
|
+
}
|
|
28290
28410
|
let o = i.map((e) => t[e]).filter(Boolean);
|
|
28291
28411
|
return o.length > 0 ? o.join(a) : "";
|
|
28292
28412
|
}
|
|
28293
|
-
function
|
|
28413
|
+
function ui(e) {
|
|
28414
|
+
return typeof e[0] == "object";
|
|
28415
|
+
}
|
|
28416
|
+
function di(e, t) {
|
|
28294
28417
|
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("/");
|
|
28295
28418
|
}
|
|
28296
28419
|
//#endregion
|
|
28297
28420
|
//#region src/v2019C1/extensions/presentation/query/index.ts
|
|
28298
|
-
var
|
|
28421
|
+
var fi = /* @__PURE__ */ l({ extractElementTitle: () => ri });
|
|
28299
28422
|
//#endregion
|
|
28300
28423
|
//#region src/v2019C1/extensions/lifecycle/report/query/report-asd.ts
|
|
28301
|
-
async function
|
|
28302
|
-
let { sourceQuery: n, applicationRef: r, scenario: i } = t, { uuid: a } = await n.getAttributes(r), o = i === "instantiate" ? [] : await
|
|
28424
|
+
async function pi(e, t) {
|
|
28425
|
+
let { sourceQuery: n, applicationRef: r, scenario: i } = t, { uuid: a } = await n.getAttributes(r), o = i === "instantiate" ? [] : await X(e, {
|
|
28303
28426
|
tagName: "Application",
|
|
28304
28427
|
sourceUuid: a
|
|
28305
28428
|
}), s = [];
|
|
28306
|
-
if (o.length === 0) s.push(await
|
|
28429
|
+
if (o.length === 0) s.push(await mi(e, {
|
|
28307
28430
|
sourceQuery: n,
|
|
28308
28431
|
applicationRef: r,
|
|
28309
28432
|
instance: void 0
|
|
28310
28433
|
}));
|
|
28311
|
-
else for (let t of o) s.push(await
|
|
28434
|
+
else for (let t of o) s.push(await mi(e, {
|
|
28312
28435
|
sourceQuery: n,
|
|
28313
28436
|
applicationRef: r,
|
|
28314
28437
|
instance: t
|
|
28315
28438
|
}));
|
|
28316
|
-
let c = await
|
|
28439
|
+
let c = await hi(e, {
|
|
28317
28440
|
sourceQuery: n,
|
|
28318
28441
|
applicationRef: r,
|
|
28319
28442
|
scenario: i
|
|
28320
28443
|
});
|
|
28321
|
-
return
|
|
28444
|
+
return Cn([...s, ...c]);
|
|
28322
28445
|
}
|
|
28323
|
-
async function
|
|
28324
|
-
let { sourceQuery: n, applicationRef: r, instance: i } = t, a = await
|
|
28446
|
+
async function mi(e, t) {
|
|
28447
|
+
let { sourceQuery: n, applicationRef: r, instance: i } = t, a = await mn({
|
|
28325
28448
|
sourceQuery: n,
|
|
28326
28449
|
targetQuery: e,
|
|
28327
28450
|
sourceRootRef: r,
|
|
28328
28451
|
instanceRootRef: i
|
|
28329
28452
|
});
|
|
28330
|
-
if (await
|
|
28453
|
+
if (await Qr(e, {
|
|
28331
28454
|
sourceQuery: n,
|
|
28332
28455
|
primaryRef: r,
|
|
28333
|
-
satelliteRefs: await
|
|
28334
|
-
instanceSatelliteRefs: i ? await
|
|
28456
|
+
satelliteRefs: await jr(n, { applicationRef: r }),
|
|
28457
|
+
instanceSatelliteRefs: i ? await jr(e, { applicationRef: {
|
|
28335
28458
|
tagName: "Application",
|
|
28336
28459
|
id: i.id
|
|
28337
28460
|
} }) : [],
|
|
28338
|
-
report: a
|
|
28339
|
-
|
|
28461
|
+
report: a,
|
|
28462
|
+
instanceScopeId: i?.id
|
|
28463
|
+
}), await $r(e, {
|
|
28340
28464
|
sourceQuery: n,
|
|
28341
28465
|
primaryRef: r,
|
|
28342
28466
|
instancePrimaryRef: i ? {
|
|
@@ -28345,13 +28469,13 @@ async function Yr(e, t) {
|
|
|
28345
28469
|
} : void 0,
|
|
28346
28470
|
report: a
|
|
28347
28471
|
}), i) {
|
|
28348
|
-
let t = await
|
|
28472
|
+
let t = await ri(e, i);
|
|
28349
28473
|
for (let e of a.groups) e.instanceScopeTitle = t;
|
|
28350
28474
|
}
|
|
28351
28475
|
return a;
|
|
28352
28476
|
}
|
|
28353
|
-
async function
|
|
28354
|
-
let { sourceQuery: n, applicationRef: r, scenario: i } = t, a = await
|
|
28477
|
+
async function hi(e, t) {
|
|
28478
|
+
let { sourceQuery: n, applicationRef: r, scenario: i } = t, a = await lr(n, r), o = [];
|
|
28355
28479
|
for (let t of a) {
|
|
28356
28480
|
let [r] = await n.any.findByAttributes({
|
|
28357
28481
|
tagName: "Function",
|
|
@@ -28361,12 +28485,12 @@ async function Xr(e, t) {
|
|
|
28361
28485
|
let a = {
|
|
28362
28486
|
tagName: "Function",
|
|
28363
28487
|
id: r.id
|
|
28364
|
-
}, s = i === "instantiate" ? [] : await
|
|
28488
|
+
}, s = i === "instantiate" ? [] : await X(e, {
|
|
28365
28489
|
tagName: "Function",
|
|
28366
28490
|
sourceUuid: t
|
|
28367
28491
|
});
|
|
28368
28492
|
if (s.length === 0) {
|
|
28369
|
-
o.push(await
|
|
28493
|
+
o.push(await ti(e, {
|
|
28370
28494
|
sourceQuery: n,
|
|
28371
28495
|
functionRef: a,
|
|
28372
28496
|
instance: void 0
|
|
@@ -28374,11 +28498,11 @@ async function Xr(e, t) {
|
|
|
28374
28498
|
continue;
|
|
28375
28499
|
}
|
|
28376
28500
|
for (let t of s) {
|
|
28377
|
-
let r = await
|
|
28501
|
+
let r = await ti(e, {
|
|
28378
28502
|
sourceQuery: n,
|
|
28379
28503
|
functionRef: a,
|
|
28380
28504
|
instance: t
|
|
28381
|
-
}), i = await
|
|
28505
|
+
}), i = await ri(e, t);
|
|
28382
28506
|
for (let e of r.groups) e.instanceScopeTitle = i;
|
|
28383
28507
|
o.push(r);
|
|
28384
28508
|
}
|
|
@@ -28387,48 +28511,61 @@ async function Xr(e, t) {
|
|
|
28387
28511
|
}
|
|
28388
28512
|
//#endregion
|
|
28389
28513
|
//#region src/v2019C1/extensions/lifecycle/report/query/report-fsd.ts
|
|
28390
|
-
async function
|
|
28391
|
-
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a } = t, { uuid: o } = await n.getAttributes(r), s = a === "instantiate" ? [] : await
|
|
28514
|
+
async function gi(e, t) {
|
|
28515
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a } = t, { uuid: o } = await n.getAttributes(r), s = a === "instantiate" ? [] : await dr(e, {
|
|
28392
28516
|
targetParent: i,
|
|
28393
28517
|
tagName: "Function",
|
|
28394
28518
|
sourceUuid: o
|
|
28395
28519
|
});
|
|
28396
|
-
if (s.length === 0) return
|
|
28520
|
+
if (s.length === 0) return ti(e, {
|
|
28397
28521
|
sourceQuery: n,
|
|
28398
28522
|
functionRef: r,
|
|
28399
28523
|
instance: void 0
|
|
28400
28524
|
});
|
|
28401
28525
|
let c = [];
|
|
28402
28526
|
for (let t of s) {
|
|
28403
|
-
let i = await
|
|
28527
|
+
let i = await ti(e, {
|
|
28404
28528
|
sourceQuery: n,
|
|
28405
28529
|
functionRef: r,
|
|
28406
28530
|
instance: t
|
|
28407
|
-
}), a = await
|
|
28531
|
+
}), a = await ri(e, t);
|
|
28408
28532
|
for (let e of i.groups) e.instanceScopeTitle = a;
|
|
28409
28533
|
c.push(i);
|
|
28410
28534
|
}
|
|
28411
|
-
return
|
|
28535
|
+
return Cn(c);
|
|
28412
28536
|
}
|
|
28413
28537
|
//#endregion
|
|
28414
28538
|
//#region src/v2019C1/extensions/lifecycle/report/report.ts
|
|
28415
|
-
async function
|
|
28416
|
-
let n = t.verb === "fsd" ? await
|
|
28539
|
+
async function _i(e, t) {
|
|
28540
|
+
let n = t.verb === "fsd" ? await gi(e, {
|
|
28417
28541
|
sourceQuery: t.sourceQuery,
|
|
28418
28542
|
functionRef: t.ref,
|
|
28419
28543
|
targetParent: t.anchor,
|
|
28420
28544
|
scenario: t.scenario
|
|
28421
|
-
}) : await
|
|
28545
|
+
}) : await pi(e, {
|
|
28422
28546
|
sourceQuery: t.sourceQuery,
|
|
28423
28547
|
applicationRef: t.ref,
|
|
28424
28548
|
scenario: t.scenario
|
|
28425
28549
|
});
|
|
28426
|
-
for (let e of n.groups) e.editableAttributes =
|
|
28427
|
-
return await
|
|
28550
|
+
for (let e of n.groups) e.editableAttributes = vi(An(e.primary.tagName), e.primary.attributeChanges);
|
|
28551
|
+
return await Zr(e, t, n), n;
|
|
28552
|
+
}
|
|
28553
|
+
function vi(e, t) {
|
|
28554
|
+
if (!t?.length) return e;
|
|
28555
|
+
let n = new Map(t.map((e) => [e.name, e]));
|
|
28556
|
+
return e.map((e) => {
|
|
28557
|
+
let t = n.get(e.attr);
|
|
28558
|
+
return t ? {
|
|
28559
|
+
...e,
|
|
28560
|
+
before: t.before,
|
|
28561
|
+
after: t.after,
|
|
28562
|
+
changed: !0
|
|
28563
|
+
} : e;
|
|
28564
|
+
}).sort((e, t) => Number(t.changed ?? !1) - Number(e.changed ?? !1));
|
|
28428
28565
|
}
|
|
28429
28566
|
//#endregion
|
|
28430
28567
|
//#region src/v2019C1/extensions/lifecycle/report/presentation-scope.ts
|
|
28431
|
-
function
|
|
28568
|
+
function yi(e) {
|
|
28432
28569
|
switch (e.verb) {
|
|
28433
28570
|
case "fsd":
|
|
28434
28571
|
case "asd": return {
|
|
@@ -28440,65 +28577,65 @@ function $r(e) {
|
|
|
28440
28577
|
}
|
|
28441
28578
|
//#endregion
|
|
28442
28579
|
//#region src/v2019C1/extensions/index.ts
|
|
28443
|
-
var
|
|
28444
|
-
cleanUp:
|
|
28445
|
-
dataModel:
|
|
28446
|
-
history:
|
|
28447
|
-
identity:
|
|
28580
|
+
var bi = {
|
|
28581
|
+
cleanUp: R,
|
|
28582
|
+
dataModel: Yt,
|
|
28583
|
+
history: en,
|
|
28584
|
+
identity: on,
|
|
28448
28585
|
lifecycle: {
|
|
28449
|
-
query: { report:
|
|
28586
|
+
query: { report: _i },
|
|
28450
28587
|
transaction: {
|
|
28451
|
-
extract:
|
|
28452
|
-
instantiate:
|
|
28453
|
-
transplant: { deep:
|
|
28454
|
-
update:
|
|
28455
|
-
apply:
|
|
28588
|
+
extract: Yr,
|
|
28589
|
+
instantiate: Xr,
|
|
28590
|
+
transplant: { deep: J },
|
|
28591
|
+
update: zr,
|
|
28592
|
+
apply: Br
|
|
28456
28593
|
}
|
|
28457
28594
|
},
|
|
28458
|
-
reference:
|
|
28459
|
-
signature: { query:
|
|
28460
|
-
presentation: { query:
|
|
28595
|
+
reference: L,
|
|
28596
|
+
signature: { query: Ft },
|
|
28597
|
+
presentation: { query: fi }
|
|
28461
28598
|
};
|
|
28462
28599
|
//#endregion
|
|
28463
28600
|
//#region src/v2019C1/hooks/after-created/private-wrapper.ts
|
|
28464
|
-
async function
|
|
28601
|
+
async function xi(e) {
|
|
28465
28602
|
let { childRecord: t, parentRecord: n, query: r } = e;
|
|
28466
|
-
if (t.namespace.prefix ===
|
|
28467
|
-
let i = n.tagName === "Private", a = n.namespace.prefix ===
|
|
28603
|
+
if (t.namespace.prefix === x.namespaces.default.prefix) return [];
|
|
28604
|
+
let i = n.tagName === "Private", a = n.namespace.prefix === x.namespaces.default.prefix;
|
|
28468
28605
|
if (!i && !a) return [];
|
|
28469
28606
|
let o = n.children.find((e) => e.tagName === "Private"), s = {
|
|
28470
28607
|
...n,
|
|
28471
28608
|
children: n.children.filter((e) => e.id !== t.id)
|
|
28472
28609
|
};
|
|
28473
|
-
return i ?
|
|
28610
|
+
return i ? Si({
|
|
28474
28611
|
parentRecord: n,
|
|
28475
28612
|
childRecord: t,
|
|
28476
28613
|
query: r
|
|
28477
|
-
}) : o ?
|
|
28614
|
+
}) : o ? Ci({
|
|
28478
28615
|
existingPrivateRef: o,
|
|
28479
28616
|
parentRecord: n,
|
|
28480
28617
|
updatedParentRecord: s,
|
|
28481
28618
|
childRecord: t,
|
|
28482
28619
|
query: r
|
|
28483
|
-
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] :
|
|
28620
|
+
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] : wi({
|
|
28484
28621
|
parentRecord: n,
|
|
28485
28622
|
updatedParentRecord: s,
|
|
28486
28623
|
childRecord: t
|
|
28487
28624
|
});
|
|
28488
28625
|
}
|
|
28489
|
-
async function
|
|
28626
|
+
async function Si(e) {
|
|
28490
28627
|
let { parentRecord: t, childRecord: n, query: r } = e, a = t;
|
|
28491
28628
|
if (n.parent?.id === a.id && n.parent?.tagName === "Private") return [];
|
|
28492
|
-
let
|
|
28629
|
+
let o = await Ti({
|
|
28493
28630
|
privateId: a.id,
|
|
28494
28631
|
query: r
|
|
28495
28632
|
});
|
|
28496
|
-
o
|
|
28633
|
+
s(o, {
|
|
28497
28634
|
detail: "Latest private record not found",
|
|
28498
28635
|
key: "ELEMENT_NOT_FOUND"
|
|
28499
28636
|
});
|
|
28500
|
-
let { childRecord: c, privateRecord: l } =
|
|
28501
|
-
privateRecord:
|
|
28637
|
+
let { childRecord: c, privateRecord: l } = Ei({
|
|
28638
|
+
privateRecord: o,
|
|
28502
28639
|
childRecord: n
|
|
28503
28640
|
});
|
|
28504
28641
|
return [{
|
|
@@ -28507,20 +28644,20 @@ async function ni(e) {
|
|
|
28507
28644
|
newRecord: i(c)
|
|
28508
28645
|
}, {
|
|
28509
28646
|
status: "updated",
|
|
28510
|
-
oldRecord: i(
|
|
28647
|
+
oldRecord: i(o),
|
|
28511
28648
|
newRecord: i(l)
|
|
28512
28649
|
}];
|
|
28513
28650
|
}
|
|
28514
|
-
async function
|
|
28515
|
-
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: a, query:
|
|
28651
|
+
async function Ci(e) {
|
|
28652
|
+
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: a, query: o } = e, c = await Ti({
|
|
28516
28653
|
privateId: t.id,
|
|
28517
|
-
query:
|
|
28654
|
+
query: o
|
|
28518
28655
|
});
|
|
28519
|
-
if (
|
|
28656
|
+
if (s(c, {
|
|
28520
28657
|
detail: "Latest private record not found",
|
|
28521
28658
|
key: "ELEMENT_NOT_FOUND"
|
|
28522
28659
|
}), !c.attributes.some((e) => e.name === "type" && e.value === a.namespace.prefix)) return [];
|
|
28523
|
-
let { childRecord: l, privateRecord: u } =
|
|
28660
|
+
let { childRecord: l, privateRecord: u } = Ei({
|
|
28524
28661
|
privateRecord: c,
|
|
28525
28662
|
childRecord: a
|
|
28526
28663
|
});
|
|
@@ -28542,11 +28679,11 @@ async function ri(e) {
|
|
|
28542
28679
|
}
|
|
28543
28680
|
];
|
|
28544
28681
|
}
|
|
28545
|
-
function
|
|
28682
|
+
function wi(e) {
|
|
28546
28683
|
let { parentRecord: t, updatedParentRecord: n, childRecord: r } = e, a = {
|
|
28547
28684
|
id: crypto.randomUUID(),
|
|
28548
28685
|
tagName: "Private",
|
|
28549
|
-
namespace:
|
|
28686
|
+
namespace: x.namespaces.default,
|
|
28550
28687
|
attributes: [{
|
|
28551
28688
|
name: "type",
|
|
28552
28689
|
value: r.namespace.prefix
|
|
@@ -28591,14 +28728,14 @@ function ii(e) {
|
|
|
28591
28728
|
}
|
|
28592
28729
|
];
|
|
28593
28730
|
}
|
|
28594
|
-
async function
|
|
28731
|
+
async function Ti(e) {
|
|
28595
28732
|
let { privateId: t, query: n } = e;
|
|
28596
28733
|
return await n.getRecord({
|
|
28597
28734
|
id: t,
|
|
28598
28735
|
tagName: "Private"
|
|
28599
28736
|
});
|
|
28600
28737
|
}
|
|
28601
|
-
function
|
|
28738
|
+
function Ei(e) {
|
|
28602
28739
|
let { privateRecord: t, childRecord: n } = e;
|
|
28603
28740
|
return {
|
|
28604
28741
|
childRecord: {
|
|
@@ -28619,16 +28756,16 @@ function oi(e) {
|
|
|
28619
28756
|
}
|
|
28620
28757
|
//#endregion
|
|
28621
28758
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
28622
|
-
async function
|
|
28759
|
+
async function Di(e) {
|
|
28623
28760
|
let { uuid: t, entry: r, target: a, query: o } = e;
|
|
28624
|
-
if (!n(r.refTagName,
|
|
28761
|
+
if (!n(r.refTagName, x)) return [];
|
|
28625
28762
|
let s = await o.getRecordsByTagName(r.refTagName), c = [];
|
|
28626
28763
|
for (let e of s) {
|
|
28627
28764
|
if (e.attributes.find((e) => e.name === r.uuidAttr)?.value !== t) continue;
|
|
28628
28765
|
let n = {
|
|
28629
28766
|
tagName: e.tagName,
|
|
28630
28767
|
id: e.id
|
|
28631
|
-
}, s = await
|
|
28768
|
+
}, s = await L.query.buildReferencePath(o, {
|
|
28632
28769
|
reference: n,
|
|
28633
28770
|
target: a
|
|
28634
28771
|
});
|
|
@@ -28648,32 +28785,193 @@ async function si(e) {
|
|
|
28648
28785
|
}
|
|
28649
28786
|
return c;
|
|
28650
28787
|
}
|
|
28651
|
-
function
|
|
28788
|
+
function Oi(e) {
|
|
28652
28789
|
let t = [];
|
|
28653
|
-
for (let n of
|
|
28654
|
-
let r =
|
|
28790
|
+
for (let n of Me) {
|
|
28791
|
+
let r = Ae[n]?.get(e);
|
|
28655
28792
|
r && t.push(...r);
|
|
28656
28793
|
}
|
|
28657
28794
|
return t;
|
|
28658
28795
|
}
|
|
28659
28796
|
//#endregion
|
|
28797
|
+
//#region src/v2019C1/hooks/shared/record-ops.ts
|
|
28798
|
+
function ki(e, t) {
|
|
28799
|
+
return {
|
|
28800
|
+
status: "updated",
|
|
28801
|
+
oldRecord: e,
|
|
28802
|
+
newRecord: {
|
|
28803
|
+
...e,
|
|
28804
|
+
attributes: t
|
|
28805
|
+
}
|
|
28806
|
+
};
|
|
28807
|
+
}
|
|
28808
|
+
function Ai(e, t, n) {
|
|
28809
|
+
return e.some((e) => e.name === t) ? e.map((e) => e.name === t ? {
|
|
28810
|
+
...e,
|
|
28811
|
+
value: n
|
|
28812
|
+
} : e) : [...e, {
|
|
28813
|
+
name: t,
|
|
28814
|
+
value: n
|
|
28815
|
+
}];
|
|
28816
|
+
}
|
|
28817
|
+
//#endregion
|
|
28818
|
+
//#region src/v2019C1/hooks/shared/mapped-name.ts
|
|
28819
|
+
async function ji(e, t) {
|
|
28820
|
+
let n = N.get(t.tagName);
|
|
28821
|
+
if (!n || !t.attributes.find((e) => e.name === n.uuid)?.value) return null;
|
|
28822
|
+
let r = await ze(e, t);
|
|
28823
|
+
return r === t.attributes.find((e) => e.name === n.path)?.value ? null : ki(t, r === void 0 ? t.attributes.filter((e) => e.name !== n.path) : Ai(t.attributes, n.path, r));
|
|
28824
|
+
}
|
|
28825
|
+
//#endregion
|
|
28826
|
+
//#region src/v2019C1/hooks/shared/ref-path-rebuild.ts
|
|
28827
|
+
async function Mi(e) {
|
|
28828
|
+
let { oldRecord: t, newRecord: n, query: r } = e;
|
|
28829
|
+
if (N.has(n.tagName)) return [];
|
|
28830
|
+
let i = O[n.tagName];
|
|
28831
|
+
if (!i) return [];
|
|
28832
|
+
let a = [];
|
|
28833
|
+
for (let e of i) {
|
|
28834
|
+
if (e.resolution === j.unsupported || !Ni(t, n, e)) continue;
|
|
28835
|
+
let i = await Pi({
|
|
28836
|
+
newRecord: n,
|
|
28837
|
+
pair: e,
|
|
28838
|
+
query: r
|
|
28839
|
+
});
|
|
28840
|
+
i && a.push(i);
|
|
28841
|
+
}
|
|
28842
|
+
return a;
|
|
28843
|
+
}
|
|
28844
|
+
function Ni(e, t, n) {
|
|
28845
|
+
return [n.attribute.uuid, ...n.companions.map((e) => e.name)].some((n) => $(e, n) !== $(t, n));
|
|
28846
|
+
}
|
|
28847
|
+
async function Pi(e) {
|
|
28848
|
+
let { newRecord: t, pair: n, query: r } = e, i = $(t, n.attribute.uuid);
|
|
28849
|
+
if (!i) return null;
|
|
28850
|
+
let a = await Fi({
|
|
28851
|
+
uuidValue: i,
|
|
28852
|
+
targetTagNames: n.target,
|
|
28853
|
+
query: r
|
|
28854
|
+
});
|
|
28855
|
+
if (!a) return null;
|
|
28856
|
+
let o = await Ce(r, {
|
|
28857
|
+
reference: {
|
|
28858
|
+
tagName: t.tagName,
|
|
28859
|
+
id: t.id
|
|
28860
|
+
},
|
|
28861
|
+
target: a
|
|
28862
|
+
});
|
|
28863
|
+
return !o || $(t, n.attribute.path) === o ? null : ki(t, Ai(t.attributes, n.attribute.path, o));
|
|
28864
|
+
}
|
|
28865
|
+
async function Fi(e) {
|
|
28866
|
+
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
28867
|
+
for (let e of r) {
|
|
28868
|
+
if (!n(e, x)) continue;
|
|
28869
|
+
let r = (await i.getRecordsByTagName(e)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value === t);
|
|
28870
|
+
if (r) return {
|
|
28871
|
+
tagName: r.tagName,
|
|
28872
|
+
id: r.id
|
|
28873
|
+
};
|
|
28874
|
+
}
|
|
28875
|
+
return null;
|
|
28876
|
+
}
|
|
28877
|
+
function $(e, t) {
|
|
28878
|
+
return e.attributes.find((e) => e.name === t)?.value;
|
|
28879
|
+
}
|
|
28880
|
+
//#endregion
|
|
28881
|
+
//#region src/v2019C1/hooks/shared/lnode-binding.ts
|
|
28882
|
+
var Ii = "None";
|
|
28883
|
+
async function Li(e) {
|
|
28884
|
+
let { oldRecord: t, newRecord: n, query: r } = e;
|
|
28885
|
+
if (n.tagName !== "LNode") return null;
|
|
28886
|
+
let i = Hi(t, "lnUuid"), a = Hi(n, "lnUuid");
|
|
28887
|
+
if (i === a) return null;
|
|
28888
|
+
let o = a ? await Ri(r, a) : await zi(r, n);
|
|
28889
|
+
return o ? Vi(n, o) : null;
|
|
28890
|
+
}
|
|
28891
|
+
async function Ri(e, t) {
|
|
28892
|
+
let n = await Bi(e, t);
|
|
28893
|
+
if (!n) return null;
|
|
28894
|
+
let r = await e.getAttributes(n), i = await e.findAncestors(n), a = i.find((e) => e.tagName === "LDevice"), o = i.find((e) => e.tagName === "IED"), s = a ? await e.getAttributes({
|
|
28895
|
+
tagName: "LDevice",
|
|
28896
|
+
id: a.id
|
|
28897
|
+
}) : void 0;
|
|
28898
|
+
return {
|
|
28899
|
+
iedName: (o ? await e.getAttributes({
|
|
28900
|
+
tagName: "IED",
|
|
28901
|
+
id: o.id
|
|
28902
|
+
}) : void 0)?.name,
|
|
28903
|
+
ldInst: s?.inst,
|
|
28904
|
+
prefix: r.prefix,
|
|
28905
|
+
lnClass: r.lnClass,
|
|
28906
|
+
lnInst: r.inst
|
|
28907
|
+
};
|
|
28908
|
+
}
|
|
28909
|
+
async function zi(e, t) {
|
|
28910
|
+
let n = {
|
|
28911
|
+
iedName: Ii,
|
|
28912
|
+
ldInst: void 0
|
|
28913
|
+
}, r = await e.getChild({
|
|
28914
|
+
tagName: "LNode",
|
|
28915
|
+
id: t.id
|
|
28916
|
+
}, "LNodeSpecNaming");
|
|
28917
|
+
if (!r) return n;
|
|
28918
|
+
let i = await e.getAttributes(r);
|
|
28919
|
+
return {
|
|
28920
|
+
...n,
|
|
28921
|
+
prefix: i.sPrefix,
|
|
28922
|
+
lnClass: i.sLnClass,
|
|
28923
|
+
lnInst: i.sLnInst
|
|
28924
|
+
};
|
|
28925
|
+
}
|
|
28926
|
+
async function Bi(e, t) {
|
|
28927
|
+
for (let r of ["LN", "LN0"]) {
|
|
28928
|
+
if (!n(r, x)) continue;
|
|
28929
|
+
let i = (await e.getRecordsByTagName(r)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value === t);
|
|
28930
|
+
if (i) return {
|
|
28931
|
+
tagName: i.tagName,
|
|
28932
|
+
id: i.id
|
|
28933
|
+
};
|
|
28934
|
+
}
|
|
28935
|
+
return null;
|
|
28936
|
+
}
|
|
28937
|
+
function Vi(e, t) {
|
|
28938
|
+
let n = [...e.attributes], r = !1;
|
|
28939
|
+
for (let [e, i] of Object.entries(t)) {
|
|
28940
|
+
let t = n.find((t) => t.name === e)?.value;
|
|
28941
|
+
if (i === void 0) {
|
|
28942
|
+
if (t === void 0) continue;
|
|
28943
|
+
n = n.filter((t) => t.name !== e), r = !0;
|
|
28944
|
+
continue;
|
|
28945
|
+
}
|
|
28946
|
+
t !== i && (n = Ai(n, e, i), r = !0);
|
|
28947
|
+
}
|
|
28948
|
+
return r ? ki(e, n) : null;
|
|
28949
|
+
}
|
|
28950
|
+
function Hi(e, t) {
|
|
28951
|
+
return e.attributes.find((e) => e.name === t)?.value;
|
|
28952
|
+
}
|
|
28953
|
+
//#endregion
|
|
28660
28954
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
28661
|
-
async function
|
|
28662
|
-
let { childRecord: t, query: n } = e, r = await
|
|
28955
|
+
async function Ui(e) {
|
|
28956
|
+
let { childRecord: t, query: n } = e, r = await Wi({
|
|
28663
28957
|
childRecord: t,
|
|
28664
28958
|
query: n
|
|
28665
|
-
}), i = await
|
|
28959
|
+
}), i = await qi({
|
|
28666
28960
|
childRecord: t,
|
|
28667
28961
|
query: n
|
|
28668
|
-
});
|
|
28669
|
-
return [
|
|
28962
|
+
}), a = await ji(n, o(t)), s = a ? [a] : [];
|
|
28963
|
+
return [
|
|
28964
|
+
...r,
|
|
28965
|
+
...i,
|
|
28966
|
+
...s
|
|
28967
|
+
];
|
|
28670
28968
|
}
|
|
28671
|
-
async function
|
|
28672
|
-
let { childRecord: t, query: n } = e, r =
|
|
28969
|
+
async function Wi(e) {
|
|
28970
|
+
let { childRecord: t, query: n } = e, r = Ne.get(t.tagName);
|
|
28673
28971
|
if (!r?.length) return [];
|
|
28674
28972
|
let i = [];
|
|
28675
28973
|
for (let e of r) {
|
|
28676
|
-
let r = await
|
|
28974
|
+
let r = await Gi({
|
|
28677
28975
|
childRecord: t,
|
|
28678
28976
|
pair: e,
|
|
28679
28977
|
query: n
|
|
@@ -28682,16 +28980,16 @@ async function ui(e) {
|
|
|
28682
28980
|
}
|
|
28683
28981
|
return i;
|
|
28684
28982
|
}
|
|
28685
|
-
async function
|
|
28983
|
+
async function Gi(e) {
|
|
28686
28984
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
28687
28985
|
if (!i) return null;
|
|
28688
|
-
let a = await
|
|
28986
|
+
let a = await Ki({
|
|
28689
28987
|
uuidValue: i,
|
|
28690
28988
|
targetTagNames: n.targetTagNames,
|
|
28691
28989
|
query: r
|
|
28692
28990
|
});
|
|
28693
28991
|
if (!a) return null;
|
|
28694
|
-
let o = await
|
|
28992
|
+
let o = await Ce(r, {
|
|
28695
28993
|
reference: {
|
|
28696
28994
|
tagName: t.tagName,
|
|
28697
28995
|
id: t.id
|
|
@@ -28715,10 +29013,10 @@ async function di(e) {
|
|
|
28715
29013
|
}
|
|
28716
29014
|
};
|
|
28717
29015
|
}
|
|
28718
|
-
async function
|
|
29016
|
+
async function Ki(e) {
|
|
28719
29017
|
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
28720
29018
|
for (let e of r) {
|
|
28721
|
-
if (!n(e,
|
|
29019
|
+
if (!n(e, x)) continue;
|
|
28722
29020
|
let r = (await i.getRecordsByTagName(e)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value === t);
|
|
28723
29021
|
if (r) return {
|
|
28724
29022
|
tagName: r.tagName,
|
|
@@ -28727,17 +29025,17 @@ async function fi(e) {
|
|
|
28727
29025
|
}
|
|
28728
29026
|
return null;
|
|
28729
29027
|
}
|
|
28730
|
-
async function
|
|
29028
|
+
async function qi(e) {
|
|
28731
29029
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
28732
29030
|
if (!r) return [];
|
|
28733
|
-
let i =
|
|
29031
|
+
let i = Oi(t.tagName);
|
|
28734
29032
|
if (i.length === 0) return [];
|
|
28735
29033
|
let a = {
|
|
28736
29034
|
tagName: t.tagName,
|
|
28737
29035
|
id: t.id
|
|
28738
29036
|
}, o = [];
|
|
28739
29037
|
for (let e of i) {
|
|
28740
|
-
let t = await
|
|
29038
|
+
let t = await Di({
|
|
28741
29039
|
uuid: r,
|
|
28742
29040
|
entry: e,
|
|
28743
29041
|
target: a,
|
|
@@ -28749,12 +29047,12 @@ async function pi(e) {
|
|
|
28749
29047
|
}
|
|
28750
29048
|
//#endregion
|
|
28751
29049
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
28752
|
-
async function
|
|
28753
|
-
let { childRecord: t, parentRecord: n, query: r } = e, i = await
|
|
29050
|
+
async function Ji(e) {
|
|
29051
|
+
let { childRecord: t, parentRecord: n, query: r } = e, i = await xi({
|
|
28754
29052
|
childRecord: t,
|
|
28755
29053
|
parentRecord: n,
|
|
28756
29054
|
query: r
|
|
28757
|
-
}), a = await
|
|
29055
|
+
}), a = await Ui({
|
|
28758
29056
|
childRecord: t,
|
|
28759
29057
|
query: r
|
|
28760
29058
|
});
|
|
@@ -28762,12 +29060,12 @@ async function mi(e) {
|
|
|
28762
29060
|
}
|
|
28763
29061
|
//#endregion
|
|
28764
29062
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
28765
|
-
async function
|
|
28766
|
-
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await
|
|
29063
|
+
async function Yi(e) {
|
|
29064
|
+
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await Xi(t, n);
|
|
28767
29065
|
if (r.size === 0) return [];
|
|
28768
29066
|
let a = [];
|
|
28769
29067
|
for (let { target: e } of t) {
|
|
28770
|
-
let t = await
|
|
29068
|
+
let t = await Qi({
|
|
28771
29069
|
target: e,
|
|
28772
29070
|
uuidMap: r,
|
|
28773
29071
|
uuidToRef: i,
|
|
@@ -28777,9 +29075,9 @@ async function hi(e) {
|
|
|
28777
29075
|
}
|
|
28778
29076
|
return a;
|
|
28779
29077
|
}
|
|
28780
|
-
async function
|
|
29078
|
+
async function Xi(e, t) {
|
|
28781
29079
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
28782
|
-
for (let { source: i, target: a } of e) await
|
|
29080
|
+
for (let { source: i, target: a } of e) await Zi({
|
|
28783
29081
|
source: i,
|
|
28784
29082
|
target: a,
|
|
28785
29083
|
query: t,
|
|
@@ -28791,7 +29089,7 @@ async function gi(e, t) {
|
|
|
28791
29089
|
uuidToRef: r
|
|
28792
29090
|
};
|
|
28793
29091
|
}
|
|
28794
|
-
async function
|
|
29092
|
+
async function Zi(e) {
|
|
28795
29093
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
28796
29094
|
if (!o) return;
|
|
28797
29095
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -28800,14 +29098,14 @@ async function _i(e) {
|
|
|
28800
29098
|
id: o.id
|
|
28801
29099
|
}));
|
|
28802
29100
|
}
|
|
28803
|
-
async function
|
|
29101
|
+
async function Qi(e) {
|
|
28804
29102
|
let { target: t, uuidMap: n, uuidToRef: r, query: a } = e, o = t.tagName;
|
|
28805
|
-
if (!(o in
|
|
29103
|
+
if (!(o in O)) return null;
|
|
28806
29104
|
let s = await a.getRecord(t);
|
|
28807
29105
|
if (!s) return null;
|
|
28808
|
-
let c =
|
|
29106
|
+
let c = O[o], l = [...s.attributes], u = !1;
|
|
28809
29107
|
for (let e of c) {
|
|
28810
|
-
let t = await
|
|
29108
|
+
let t = await $i({
|
|
28811
29109
|
pair: e,
|
|
28812
29110
|
tagName: o,
|
|
28813
29111
|
refId: s.id,
|
|
@@ -28827,14 +29125,14 @@ async function vi(e) {
|
|
|
28827
29125
|
})
|
|
28828
29126
|
} : null;
|
|
28829
29127
|
}
|
|
28830
|
-
async function
|
|
29128
|
+
async function $i(e) {
|
|
28831
29129
|
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;
|
|
28832
29130
|
if (!c) return null;
|
|
28833
29131
|
let l = i.get(c);
|
|
28834
29132
|
if (!l) return null;
|
|
28835
|
-
let u = !1, d =
|
|
29133
|
+
let u = !1, d = ea(s, t.attribute.uuid, c, l);
|
|
28836
29134
|
d && (s = d, u = !0);
|
|
28837
|
-
let f = await
|
|
29135
|
+
let f = await ta({
|
|
28838
29136
|
attributes: s,
|
|
28839
29137
|
pathAttrName: t.attribute.path,
|
|
28840
29138
|
newUuid: l,
|
|
@@ -28845,16 +29143,16 @@ async function yi(e) {
|
|
|
28845
29143
|
});
|
|
28846
29144
|
return f && (s = f, u = !0), u ? s : null;
|
|
28847
29145
|
}
|
|
28848
|
-
function
|
|
29146
|
+
function ea(e, t, n, r) {
|
|
28849
29147
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
28850
29148
|
...e,
|
|
28851
29149
|
value: r
|
|
28852
29150
|
} : e);
|
|
28853
29151
|
}
|
|
28854
|
-
async function
|
|
29152
|
+
async function ta(e) {
|
|
28855
29153
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
28856
29154
|
if (!c) return null;
|
|
28857
|
-
let l = await
|
|
29155
|
+
let l = await L.query.buildReferencePath(s, {
|
|
28858
29156
|
reference: {
|
|
28859
29157
|
tagName: a,
|
|
28860
29158
|
id: o
|
|
@@ -28871,13 +29169,13 @@ async function xi(e) {
|
|
|
28871
29169
|
}
|
|
28872
29170
|
//#endregion
|
|
28873
29171
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
28874
|
-
async function
|
|
28875
|
-
return
|
|
29172
|
+
async function na(e) {
|
|
29173
|
+
return Yi(e);
|
|
28876
29174
|
}
|
|
28877
29175
|
//#endregion
|
|
28878
29176
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
28879
|
-
function
|
|
28880
|
-
let { record: t } = e, { tagName: n, attributes: r } = t, i =
|
|
29177
|
+
function ra(e) {
|
|
29178
|
+
let { record: t } = e, { tagName: n, attributes: r } = t, i = x.definition[n];
|
|
28881
29179
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
28882
29180
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
28883
29181
|
return {
|
|
@@ -28891,21 +29189,35 @@ function Ci(e) {
|
|
|
28891
29189
|
}
|
|
28892
29190
|
//#endregion
|
|
28893
29191
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
28894
|
-
function
|
|
28895
|
-
return
|
|
29192
|
+
function ia(e) {
|
|
29193
|
+
return ra(e);
|
|
28896
29194
|
}
|
|
28897
29195
|
//#endregion
|
|
28898
29196
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
28899
|
-
async function
|
|
28900
|
-
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a =
|
|
28901
|
-
|
|
28902
|
-
|
|
29197
|
+
async function aa(e) {
|
|
29198
|
+
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = o(t), s = o(n), c = await ji(r, s);
|
|
29199
|
+
c && i.push(c);
|
|
29200
|
+
let l = await Li({
|
|
29201
|
+
oldRecord: a,
|
|
29202
|
+
newRecord: s,
|
|
29203
|
+
query: r
|
|
29204
|
+
});
|
|
29205
|
+
l && i.push(l);
|
|
29206
|
+
let u = await Mi({
|
|
29207
|
+
oldRecord: a,
|
|
29208
|
+
newRecord: s,
|
|
29209
|
+
query: r
|
|
29210
|
+
});
|
|
29211
|
+
i.push(...u);
|
|
29212
|
+
let d = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
29213
|
+
if (d) {
|
|
29214
|
+
let e = Oi(n.tagName), t = {
|
|
28903
29215
|
tagName: n.tagName,
|
|
28904
29216
|
id: n.id
|
|
28905
29217
|
};
|
|
28906
29218
|
for (let n of e) {
|
|
28907
|
-
let e = await
|
|
28908
|
-
uuid:
|
|
29219
|
+
let e = await Di({
|
|
29220
|
+
uuid: d,
|
|
28909
29221
|
entry: n,
|
|
28910
29222
|
target: t,
|
|
28911
29223
|
query: r
|
|
@@ -28913,8 +29225,8 @@ async function Ti(e) {
|
|
|
28913
29225
|
i.push(...e);
|
|
28914
29226
|
}
|
|
28915
29227
|
}
|
|
28916
|
-
if (
|
|
28917
|
-
let e = await
|
|
29228
|
+
if (oa(t, n)) {
|
|
29229
|
+
let e = await sa({
|
|
28918
29230
|
newRecord: n,
|
|
28919
29231
|
query: r
|
|
28920
29232
|
});
|
|
@@ -28922,11 +29234,11 @@ async function Ti(e) {
|
|
|
28922
29234
|
}
|
|
28923
29235
|
return i;
|
|
28924
29236
|
}
|
|
28925
|
-
function
|
|
28926
|
-
for (let n of
|
|
29237
|
+
function oa(e, t) {
|
|
29238
|
+
for (let n of oe) if (e.attributes.find((e) => e.name === n)?.value !== t.attributes.find((e) => e.name === n)?.value) return !0;
|
|
28927
29239
|
return !1;
|
|
28928
29240
|
}
|
|
28929
|
-
async function
|
|
29241
|
+
async function sa(e) {
|
|
28930
29242
|
let { newRecord: t, query: n } = e, r = {
|
|
28931
29243
|
tagName: t.tagName,
|
|
28932
29244
|
id: t.id
|
|
@@ -28935,14 +29247,14 @@ async function Di(e) {
|
|
|
28935
29247
|
if (r.id === t.id) continue;
|
|
28936
29248
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
28937
29249
|
if (!e) continue;
|
|
28938
|
-
let i =
|
|
29250
|
+
let i = Oi(r.tagName);
|
|
28939
29251
|
if (i.length === 0) continue;
|
|
28940
29252
|
let o = {
|
|
28941
29253
|
tagName: r.tagName,
|
|
28942
29254
|
id: r.id
|
|
28943
29255
|
};
|
|
28944
29256
|
for (let t of i) {
|
|
28945
|
-
let r = await
|
|
29257
|
+
let r = await Di({
|
|
28946
29258
|
uuid: e,
|
|
28947
29259
|
entry: t,
|
|
28948
29260
|
target: o,
|
|
@@ -28955,36 +29267,40 @@ async function Di(e) {
|
|
|
28955
29267
|
}
|
|
28956
29268
|
//#endregion
|
|
28957
29269
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
28958
|
-
async function
|
|
28959
|
-
return
|
|
29270
|
+
async function ca(e) {
|
|
29271
|
+
return aa(e);
|
|
28960
29272
|
}
|
|
28961
29273
|
//#endregion
|
|
28962
29274
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
28963
|
-
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
29275
|
+
var la = new Set(Object.values(b).map((e) => e.uri)), ua = new Set(Object.values(b).map((e) => e.prefix).filter(Boolean));
|
|
29276
|
+
function da(e) {
|
|
29277
|
+
return la.has(e.namespace.uri) && !n(e.tagName, x);
|
|
29278
|
+
}
|
|
29279
|
+
function fa(e) {
|
|
29280
|
+
let { record: t } = e, n = t, r = !0, i = !!t.value?.trim(), a = t.attributes.find((e) => e.name === "type")?.value, o = a !== void 0;
|
|
29281
|
+
t.tagName === "Private" && !t.tree.length && !i && !o && (r = !1), t.tagName === "Private" && !t.tree.length && !i && a !== void 0 && ua.has(a) && (r = !1), da(n) && (r = !1), t.tagName === "Private" && n.tree.length > 0 && n.tree.every(da) && (r = !1);
|
|
29282
|
+
let s = t.attributes.filter((e) => e.name !== "uuid");
|
|
28967
29283
|
return {
|
|
28968
|
-
shouldBeCloned:
|
|
29284
|
+
shouldBeCloned: r,
|
|
28969
29285
|
transformedRecord: {
|
|
28970
29286
|
...t,
|
|
28971
|
-
attributes:
|
|
29287
|
+
attributes: s
|
|
28972
29288
|
}
|
|
28973
29289
|
};
|
|
28974
29290
|
}
|
|
28975
29291
|
//#endregion
|
|
28976
29292
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
28977
|
-
async function
|
|
29293
|
+
async function pa(e) {
|
|
28978
29294
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
28979
|
-
if (await
|
|
29295
|
+
if (await ya({
|
|
28980
29296
|
record: t,
|
|
28981
29297
|
query: n,
|
|
28982
29298
|
ids: r,
|
|
28983
29299
|
uuids: i
|
|
28984
29300
|
}), i.size === 0) return [];
|
|
28985
|
-
let a = []
|
|
28986
|
-
for (let e of
|
|
28987
|
-
let t = await
|
|
29301
|
+
let a = [];
|
|
29302
|
+
for (let e of A) {
|
|
29303
|
+
let t = await ma({
|
|
28988
29304
|
refTagName: e,
|
|
28989
29305
|
subtreeIds: r,
|
|
28990
29306
|
subtreeUuids: i,
|
|
@@ -28994,11 +29310,11 @@ async function Ai(e) {
|
|
|
28994
29310
|
}
|
|
28995
29311
|
return a;
|
|
28996
29312
|
}
|
|
28997
|
-
async function
|
|
28998
|
-
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a =
|
|
29313
|
+
async function ma(e) {
|
|
29314
|
+
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = O[t], o = await i.getRecordsByTagName(t), s = [];
|
|
28999
29315
|
for (let e of o) {
|
|
29000
29316
|
if (n.has(e.id)) continue;
|
|
29001
|
-
let o = await
|
|
29317
|
+
let o = await ha({
|
|
29002
29318
|
refTagName: t,
|
|
29003
29319
|
refRecord: e,
|
|
29004
29320
|
refPairs: a,
|
|
@@ -29009,15 +29325,15 @@ async function ji(e) {
|
|
|
29009
29325
|
}
|
|
29010
29326
|
return s;
|
|
29011
29327
|
}
|
|
29012
|
-
async function
|
|
29013
|
-
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o =
|
|
29328
|
+
async function ha(e) {
|
|
29329
|
+
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o = ga({
|
|
29014
29330
|
refPairs: r,
|
|
29015
29331
|
refRecord: n,
|
|
29016
29332
|
subtreeUuids: i
|
|
29017
29333
|
});
|
|
29018
|
-
return o.size === 0 ? [] :
|
|
29334
|
+
return o.size === 0 ? [] : k.has(t) ? [_a(n, o)] : va(n, a);
|
|
29019
29335
|
}
|
|
29020
|
-
function
|
|
29336
|
+
function ga(e) {
|
|
29021
29337
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
29022
29338
|
for (let e of t) {
|
|
29023
29339
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -29028,7 +29344,7 @@ function Ni(e) {
|
|
|
29028
29344
|
}
|
|
29029
29345
|
return i;
|
|
29030
29346
|
}
|
|
29031
|
-
function
|
|
29347
|
+
function _a(e, t) {
|
|
29032
29348
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
29033
29349
|
return {
|
|
29034
29350
|
status: "updated",
|
|
@@ -29039,7 +29355,7 @@ function Pi(e, t) {
|
|
|
29039
29355
|
})
|
|
29040
29356
|
};
|
|
29041
29357
|
}
|
|
29042
|
-
async function
|
|
29358
|
+
async function va(e, t) {
|
|
29043
29359
|
let n = [{
|
|
29044
29360
|
status: "deleted",
|
|
29045
29361
|
oldRecord: i(e),
|
|
@@ -29061,14 +29377,14 @@ async function Fi(e, t) {
|
|
|
29061
29377
|
}
|
|
29062
29378
|
return n;
|
|
29063
29379
|
}
|
|
29064
|
-
async function
|
|
29380
|
+
async function ya(e) {
|
|
29065
29381
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
29066
29382
|
r.add(t.id);
|
|
29067
29383
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
29068
29384
|
a && i.add(a);
|
|
29069
29385
|
for (let e of t.children) {
|
|
29070
29386
|
let t = await n.getRecord(e);
|
|
29071
|
-
t && await
|
|
29387
|
+
t && await ya({
|
|
29072
29388
|
record: t,
|
|
29073
29389
|
query: n,
|
|
29074
29390
|
ids: r,
|
|
@@ -29078,31 +29394,31 @@ async function Ii(e) {
|
|
|
29078
29394
|
}
|
|
29079
29395
|
//#endregion
|
|
29080
29396
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
29081
|
-
async function
|
|
29082
|
-
return
|
|
29397
|
+
async function ba(e) {
|
|
29398
|
+
return pa(e);
|
|
29083
29399
|
}
|
|
29084
29400
|
//#endregion
|
|
29085
29401
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
29086
|
-
function
|
|
29402
|
+
function xa() {
|
|
29087
29403
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
29088
29404
|
return {
|
|
29089
29405
|
beforeImportRecord: (r) => {
|
|
29090
29406
|
let { record: i, ancestry: a } = r, { tagName: o } = i, s = i.attributes.find((e) => e.name === "uuid")?.value;
|
|
29091
|
-
if (s &&
|
|
29092
|
-
let t =
|
|
29407
|
+
if (s && pe.has(o)) {
|
|
29408
|
+
let t = le({
|
|
29093
29409
|
record: i,
|
|
29094
29410
|
ancestry: a
|
|
29095
29411
|
});
|
|
29096
29412
|
t && e.set(t.path, s);
|
|
29097
29413
|
}
|
|
29098
|
-
if (!
|
|
29099
|
-
let c =
|
|
29414
|
+
if (!fe.has(o)) return;
|
|
29415
|
+
let c = O[o];
|
|
29100
29416
|
for (let e of c) {
|
|
29101
29417
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
29102
29418
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
29103
|
-
let s =
|
|
29419
|
+
let s = ge(e.resolution, e.attribute.path, r, a);
|
|
29104
29420
|
if (!s) {
|
|
29105
|
-
e.resolution ===
|
|
29421
|
+
e.resolution === j.unsupported && n.push({
|
|
29106
29422
|
type: "unsupported-xpath-reference",
|
|
29107
29423
|
recordId: i.id,
|
|
29108
29424
|
details: {
|
|
@@ -29156,13 +29472,15 @@ function Ri() {
|
|
|
29156
29472
|
}
|
|
29157
29473
|
};
|
|
29158
29474
|
}
|
|
29159
|
-
|
|
29160
|
-
|
|
29161
|
-
|
|
29162
|
-
|
|
29163
|
-
|
|
29164
|
-
|
|
29165
|
-
|
|
29475
|
+
//#endregion
|
|
29476
|
+
//#region src/v2019C1/hooks/index.ts
|
|
29477
|
+
var Sa = {
|
|
29478
|
+
beforeClone: fa,
|
|
29479
|
+
afterStandardizedRecord: ia,
|
|
29480
|
+
afterCreated: Ji,
|
|
29481
|
+
afterDeepClone: na,
|
|
29482
|
+
afterUpdated: ca,
|
|
29483
|
+
beforeDelete: ba
|
|
29166
29484
|
};
|
|
29167
29485
|
//#endregion
|
|
29168
|
-
export { b as C,
|
|
29486
|
+
export { b as A, pe as C, y as D, ie as E, x as O, fe as S, oe as T, Ie as _, St as a, k as b, Pe as c, N as d, Ne as f, P as g, Fe as h, yi as i, v as k, Me as l, je as m, xa as n, ot as o, Ae as p, bi as r, Re as s, Sa as t, Le as u, M as v, O as w, A as x, j as y };
|