@dialecte/scl 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{extensions-DIHPFhOk.js → extensions-BQYiSBug.js} +396 -395
- package/dist/v2019C1/config/dialecte.config.d.ts +8 -0
- package/dist/v2019C1/config/dialecte.config.d.ts.map +1 -1
- package/dist/v2019C1/index.js +1 -1
- package/dist/v2019C1/test/hydrated-test.d.ts.map +1 -1
- package/dist/v2019C1/test.js +10 -10
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { invariant as
|
|
1
|
+
import { XSI_NAMESPACE as e, isChildOf as t, isElementOf as n, stripAttributes as r, toRawRecord as i } from "@dialecte/core/helpers";
|
|
2
|
+
import { invariant as a } from "@dialecte/core/utils";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
|
-
var
|
|
4
|
+
var o = Object.defineProperty, s = (e, t) => {
|
|
5
5
|
let n = {};
|
|
6
|
-
for (var r in e)
|
|
6
|
+
for (var r in e) o(n, r, {
|
|
7
7
|
get: e[r],
|
|
8
8
|
enumerable: !0
|
|
9
9
|
});
|
|
10
|
-
return t ||
|
|
11
|
-
},
|
|
10
|
+
return t || o(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
11
|
+
}, c = /* @__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("."), l = {
|
|
12
12
|
AccessControl: [],
|
|
13
13
|
AccessPoint: [
|
|
14
14
|
"Text",
|
|
@@ -799,7 +799,7 @@ var a = Object.defineProperty, o = (e, t) => {
|
|
|
799
799
|
"ProcessResources",
|
|
800
800
|
"Variable"
|
|
801
801
|
]
|
|
802
|
-
},
|
|
802
|
+
}, u = {
|
|
803
803
|
AccessControl: ["LDevice"],
|
|
804
804
|
AccessPoint: ["IED"],
|
|
805
805
|
Address: [
|
|
@@ -1197,7 +1197,7 @@ var a = Object.defineProperty, o = (e, t) => {
|
|
|
1197
1197
|
],
|
|
1198
1198
|
Voltage: ["Line", "VoltageLevel"],
|
|
1199
1199
|
VoltageLevel: ["Substation"]
|
|
1200
|
-
},
|
|
1200
|
+
}, d = {
|
|
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 a = Object.defineProperty, o = (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
|
+
}, f = {
|
|
1933
1933
|
AccessControl: [
|
|
1934
1934
|
"AccessPoint",
|
|
1935
1935
|
"IED",
|
|
@@ -3702,13 +3702,13 @@ var a = Object.defineProperty, o = (e, t) => {
|
|
|
3702
3702
|
"SCL",
|
|
3703
3703
|
"Substation"
|
|
3704
3704
|
]
|
|
3705
|
-
},
|
|
3705
|
+
}, p = [
|
|
3706
3706
|
"Communication",
|
|
3707
3707
|
"DataTypeTemplates",
|
|
3708
3708
|
"Header",
|
|
3709
3709
|
"History",
|
|
3710
3710
|
"SCL"
|
|
3711
|
-
],
|
|
3711
|
+
], m = {
|
|
3712
3712
|
AccessControl: {},
|
|
3713
3713
|
AccessPoint: {
|
|
3714
3714
|
clock: "",
|
|
@@ -5161,7 +5161,7 @@ var a = Object.defineProperty, o = (e, t) => {
|
|
|
5161
5161
|
templateUuid: "",
|
|
5162
5162
|
uuid: ""
|
|
5163
5163
|
}
|
|
5164
|
-
},
|
|
5164
|
+
}, h = {
|
|
5165
5165
|
AccessControl: {
|
|
5166
5166
|
tag: "AccessControl",
|
|
5167
5167
|
namespace: {
|
|
@@ -24053,95 +24053,95 @@ var a = Object.defineProperty, o = (e, t) => {
|
|
|
24053
24053
|
};
|
|
24054
24054
|
//#endregion
|
|
24055
24055
|
//#region src/v2019C1/hooks/after-created/private-wrapper.ts
|
|
24056
|
-
async function
|
|
24056
|
+
async function g(e) {
|
|
24057
24057
|
let { childRecord: t, parentRecord: n, query: r } = e;
|
|
24058
|
-
if (t.namespace.prefix ===
|
|
24059
|
-
let i = n.tagName === "Private", a = n.namespace.prefix ===
|
|
24058
|
+
if (t.namespace.prefix === U.namespaces.default.prefix) return [];
|
|
24059
|
+
let i = n.tagName === "Private", a = n.namespace.prefix === U.namespaces.default.prefix;
|
|
24060
24060
|
if (!i && !a) return [];
|
|
24061
24061
|
let o = n.children.find((e) => e.tagName === "Private"), s = {
|
|
24062
24062
|
...n,
|
|
24063
24063
|
children: n.children.filter((e) => e.id !== t.id)
|
|
24064
24064
|
};
|
|
24065
|
-
return i ?
|
|
24065
|
+
return i ? _({
|
|
24066
24066
|
parentRecord: n,
|
|
24067
24067
|
childRecord: t,
|
|
24068
24068
|
query: r
|
|
24069
|
-
}) : o ?
|
|
24069
|
+
}) : o ? v({
|
|
24070
24070
|
existingPrivateRef: o,
|
|
24071
24071
|
parentRecord: n,
|
|
24072
24072
|
updatedParentRecord: s,
|
|
24073
24073
|
childRecord: t,
|
|
24074
24074
|
query: r
|
|
24075
|
-
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] :
|
|
24075
|
+
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] : y({
|
|
24076
24076
|
parentRecord: n,
|
|
24077
24077
|
updatedParentRecord: s,
|
|
24078
24078
|
childRecord: t
|
|
24079
24079
|
});
|
|
24080
24080
|
}
|
|
24081
|
-
async function
|
|
24082
|
-
let { parentRecord: t, childRecord: n, query:
|
|
24081
|
+
async function _(e) {
|
|
24082
|
+
let { parentRecord: t, childRecord: n, query: r } = e, o = t;
|
|
24083
24083
|
if (n.parent?.id === o.id && n.parent?.tagName === "Private") return [];
|
|
24084
|
-
let s = await
|
|
24084
|
+
let s = await b({
|
|
24085
24085
|
privateId: o.id,
|
|
24086
|
-
query:
|
|
24086
|
+
query: r
|
|
24087
24087
|
});
|
|
24088
|
-
|
|
24088
|
+
a(s, {
|
|
24089
24089
|
detail: "Latest private record not found",
|
|
24090
24090
|
key: "ELEMENT_NOT_FOUND"
|
|
24091
24091
|
});
|
|
24092
|
-
let { childRecord: c, privateRecord: l } =
|
|
24092
|
+
let { childRecord: c, privateRecord: l } = x({
|
|
24093
24093
|
privateRecord: s,
|
|
24094
24094
|
childRecord: n
|
|
24095
24095
|
});
|
|
24096
24096
|
return [{
|
|
24097
24097
|
status: "updated",
|
|
24098
|
-
oldRecord:
|
|
24099
|
-
newRecord:
|
|
24098
|
+
oldRecord: i(n),
|
|
24099
|
+
newRecord: i(c)
|
|
24100
24100
|
}, {
|
|
24101
24101
|
status: "updated",
|
|
24102
|
-
oldRecord:
|
|
24103
|
-
newRecord:
|
|
24102
|
+
oldRecord: i(s),
|
|
24103
|
+
newRecord: i(l)
|
|
24104
24104
|
}];
|
|
24105
24105
|
}
|
|
24106
|
-
async function
|
|
24107
|
-
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord:
|
|
24106
|
+
async function v(e) {
|
|
24107
|
+
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: o, query: s } = e, c = await b({
|
|
24108
24108
|
privateId: t.id,
|
|
24109
24109
|
query: s
|
|
24110
24110
|
});
|
|
24111
|
-
if (
|
|
24111
|
+
if (a(c, {
|
|
24112
24112
|
detail: "Latest private record not found",
|
|
24113
24113
|
key: "ELEMENT_NOT_FOUND"
|
|
24114
24114
|
}), !c.attributes.some((e) => e.name === "type" && e.value === o.namespace.prefix)) return [];
|
|
24115
|
-
let { childRecord: l, privateRecord: u } =
|
|
24115
|
+
let { childRecord: l, privateRecord: u } = x({
|
|
24116
24116
|
privateRecord: c,
|
|
24117
24117
|
childRecord: o
|
|
24118
24118
|
});
|
|
24119
24119
|
return [
|
|
24120
24120
|
{
|
|
24121
24121
|
status: "updated",
|
|
24122
|
-
oldRecord:
|
|
24123
|
-
newRecord:
|
|
24122
|
+
oldRecord: i(o),
|
|
24123
|
+
newRecord: i(l)
|
|
24124
24124
|
},
|
|
24125
24125
|
{
|
|
24126
24126
|
status: "updated",
|
|
24127
|
-
oldRecord:
|
|
24128
|
-
newRecord:
|
|
24127
|
+
oldRecord: i(c),
|
|
24128
|
+
newRecord: i(u)
|
|
24129
24129
|
},
|
|
24130
24130
|
{
|
|
24131
24131
|
status: "updated",
|
|
24132
|
-
oldRecord:
|
|
24133
|
-
newRecord: r
|
|
24132
|
+
oldRecord: i(n),
|
|
24133
|
+
newRecord: i(r)
|
|
24134
24134
|
}
|
|
24135
24135
|
];
|
|
24136
24136
|
}
|
|
24137
|
-
function
|
|
24138
|
-
let { parentRecord: t, updatedParentRecord: n, childRecord:
|
|
24137
|
+
function y(e) {
|
|
24138
|
+
let { parentRecord: t, updatedParentRecord: n, childRecord: r } = e, a = {
|
|
24139
24139
|
id: crypto.randomUUID(),
|
|
24140
24140
|
tagName: "Private",
|
|
24141
|
-
namespace:
|
|
24141
|
+
namespace: U.namespaces.default,
|
|
24142
24142
|
attributes: [{
|
|
24143
24143
|
name: "type",
|
|
24144
|
-
value:
|
|
24144
|
+
value: r.namespace.prefix
|
|
24145
24145
|
}],
|
|
24146
24146
|
value: "",
|
|
24147
24147
|
parent: {
|
|
@@ -24149,11 +24149,11 @@ function v(e) {
|
|
|
24149
24149
|
tagName: t.tagName
|
|
24150
24150
|
},
|
|
24151
24151
|
children: [{
|
|
24152
|
-
id:
|
|
24153
|
-
tagName:
|
|
24152
|
+
id: r.id,
|
|
24153
|
+
tagName: r.tagName
|
|
24154
24154
|
}]
|
|
24155
24155
|
}, o = {
|
|
24156
|
-
...
|
|
24156
|
+
...r,
|
|
24157
24157
|
parent: {
|
|
24158
24158
|
id: a.id,
|
|
24159
24159
|
tagName: "Private"
|
|
@@ -24169,28 +24169,28 @@ function v(e) {
|
|
|
24169
24169
|
{
|
|
24170
24170
|
status: "created",
|
|
24171
24171
|
oldRecord: void 0,
|
|
24172
|
-
newRecord:
|
|
24172
|
+
newRecord: i(a)
|
|
24173
24173
|
},
|
|
24174
24174
|
{
|
|
24175
24175
|
status: "updated",
|
|
24176
|
-
oldRecord: r
|
|
24177
|
-
newRecord:
|
|
24176
|
+
oldRecord: i(r),
|
|
24177
|
+
newRecord: i(o)
|
|
24178
24178
|
},
|
|
24179
24179
|
{
|
|
24180
24180
|
status: "updated",
|
|
24181
|
-
oldRecord:
|
|
24182
|
-
newRecord:
|
|
24181
|
+
oldRecord: i(t),
|
|
24182
|
+
newRecord: i(s)
|
|
24183
24183
|
}
|
|
24184
24184
|
];
|
|
24185
24185
|
}
|
|
24186
|
-
async function
|
|
24186
|
+
async function b(e) {
|
|
24187
24187
|
let { privateId: t, query: n } = e;
|
|
24188
24188
|
return await n.getRecord({
|
|
24189
24189
|
id: t,
|
|
24190
24190
|
tagName: "Private"
|
|
24191
24191
|
});
|
|
24192
24192
|
}
|
|
24193
|
-
function
|
|
24193
|
+
function x(e) {
|
|
24194
24194
|
let { privateRecord: t, childRecord: n } = e;
|
|
24195
24195
|
return {
|
|
24196
24196
|
childRecord: {
|
|
@@ -24211,7 +24211,7 @@ function b(e) {
|
|
|
24211
24211
|
}
|
|
24212
24212
|
//#endregion
|
|
24213
24213
|
//#region src/v2019C1/extensions/reference/constants/path-extraction.ts
|
|
24214
|
-
var
|
|
24214
|
+
var S = {
|
|
24215
24215
|
AccessPoint: { type: "transparent" },
|
|
24216
24216
|
Server: { type: "transparent" },
|
|
24217
24217
|
Private: { type: "transparent" },
|
|
@@ -24291,16 +24291,16 @@ var x = {
|
|
|
24291
24291
|
PowerSystemRelation: { type: "name" },
|
|
24292
24292
|
Variable: { type: "name" },
|
|
24293
24293
|
Process: { type: "name" }
|
|
24294
|
-
},
|
|
24294
|
+
}, C = [
|
|
24295
24295
|
"lnClass",
|
|
24296
24296
|
"prefix",
|
|
24297
24297
|
"inst",
|
|
24298
24298
|
"lnInst"
|
|
24299
|
-
], ee = new Set(Object.values(
|
|
24299
|
+
], ee = new Set(Object.values(S).flatMap((e) => {
|
|
24300
24300
|
switch (e.type) {
|
|
24301
24301
|
case "transparent": return [];
|
|
24302
24302
|
case "name": return ["name"];
|
|
24303
|
-
case "lnClass": return [...
|
|
24303
|
+
case "lnClass": return [...C];
|
|
24304
24304
|
case "attribute": return [e.attr];
|
|
24305
24305
|
case "sourceRef": return [
|
|
24306
24306
|
"input",
|
|
@@ -24312,7 +24312,7 @@ var x = {
|
|
|
24312
24312
|
}));
|
|
24313
24313
|
//#endregion
|
|
24314
24314
|
//#region src/v2019C1/extensions/reference/query/build/path-segment.ts
|
|
24315
|
-
function
|
|
24315
|
+
function te(e) {
|
|
24316
24316
|
switch (e.type) {
|
|
24317
24317
|
case "transparent": return () => null;
|
|
24318
24318
|
case "name": {
|
|
@@ -24361,9 +24361,9 @@ function C(e) {
|
|
|
24361
24361
|
};
|
|
24362
24362
|
}
|
|
24363
24363
|
}
|
|
24364
|
-
var
|
|
24364
|
+
var ne = Object.fromEntries(Object.entries(S).map(([e, t]) => [e, te(t)]));
|
|
24365
24365
|
function w(e) {
|
|
24366
|
-
let t =
|
|
24366
|
+
let t = ne[e.tagName];
|
|
24367
24367
|
return t ? t(e) : null;
|
|
24368
24368
|
}
|
|
24369
24369
|
function T(e) {
|
|
@@ -24386,14 +24386,14 @@ function T(e) {
|
|
|
24386
24386
|
id: t.id
|
|
24387
24387
|
}
|
|
24388
24388
|
}), r.length === 0 ? null : {
|
|
24389
|
-
path:
|
|
24389
|
+
path: D(r),
|
|
24390
24390
|
segments: r
|
|
24391
24391
|
};
|
|
24392
24392
|
}
|
|
24393
24393
|
function E(e, t) {
|
|
24394
24394
|
return e.attributes.find((e) => e.name === t)?.value;
|
|
24395
24395
|
}
|
|
24396
|
-
function
|
|
24396
|
+
function D(e) {
|
|
24397
24397
|
let t = e[0].segment;
|
|
24398
24398
|
for (let n = 1; n < e.length; n++) t += e[n].separator + e[n].segment;
|
|
24399
24399
|
return t;
|
|
@@ -24403,10 +24403,10 @@ function ne(e) {
|
|
|
24403
24403
|
async function re(e, t) {
|
|
24404
24404
|
let n = await e.getRecord(t);
|
|
24405
24405
|
if (!n) return null;
|
|
24406
|
-
let
|
|
24406
|
+
let r = await e.findAncestors(t, { order: "top-down" });
|
|
24407
24407
|
return T({
|
|
24408
|
-
record:
|
|
24409
|
-
ancestry:
|
|
24408
|
+
record: i(n),
|
|
24409
|
+
ancestry: r.map(i)
|
|
24410
24410
|
});
|
|
24411
24411
|
}
|
|
24412
24412
|
//#endregion
|
|
@@ -24423,7 +24423,7 @@ function ie(e) {
|
|
|
24423
24423
|
separator: r
|
|
24424
24424
|
}), t;
|
|
24425
24425
|
}
|
|
24426
|
-
function
|
|
24426
|
+
function O(e) {
|
|
24427
24427
|
let t = e.split("/"), n = t[t.length - 1], r = n.indexOf(".");
|
|
24428
24428
|
if (r === -1) return { path: e };
|
|
24429
24429
|
let i = n.substring(0, r), a = n.substring(r + 1);
|
|
@@ -24432,19 +24432,19 @@ function D(e) {
|
|
|
24432
24432
|
qualifier: a || void 0
|
|
24433
24433
|
};
|
|
24434
24434
|
}
|
|
24435
|
-
function
|
|
24436
|
-
return !e || e === M.unsupported ? null : e === M.direct ? { lookupKey: n } : e === M.iedAddress ?
|
|
24435
|
+
function ae(e, t, n, r) {
|
|
24436
|
+
return !e || e === M.unsupported ? null : e === M.direct ? { lookupKey: n } : e === M.iedAddress ? se(n, r) : e === M.lnode ? oe(n) : e === M.behaviorDescription ? ce(t, n, r) : null;
|
|
24437
24437
|
}
|
|
24438
|
-
function
|
|
24439
|
-
let { path: t, qualifier: n } =
|
|
24438
|
+
function oe(e) {
|
|
24439
|
+
let { path: t, qualifier: n } = O(e);
|
|
24440
24440
|
return {
|
|
24441
24441
|
lookupKey: t,
|
|
24442
24442
|
qualifier: n
|
|
24443
24443
|
};
|
|
24444
24444
|
}
|
|
24445
|
-
function
|
|
24445
|
+
function se(e, t) {
|
|
24446
24446
|
if (t) {
|
|
24447
|
-
let n =
|
|
24447
|
+
let n = de(t);
|
|
24448
24448
|
if (n) return {
|
|
24449
24449
|
lookupKey: e,
|
|
24450
24450
|
fallbackLookupKey: `${n}/${e}`
|
|
@@ -24452,15 +24452,15 @@ function oe(e, t) {
|
|
|
24452
24452
|
}
|
|
24453
24453
|
return { lookupKey: e };
|
|
24454
24454
|
}
|
|
24455
|
-
function
|
|
24455
|
+
function ce(e, t, n) {
|
|
24456
24456
|
if (!n) return null;
|
|
24457
|
-
let r =
|
|
24457
|
+
let r = le(n);
|
|
24458
24458
|
return r ? e === "dataName" ? {
|
|
24459
24459
|
lookupKey: r,
|
|
24460
24460
|
qualifier: t
|
|
24461
|
-
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${
|
|
24461
|
+
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${ue(t)}` } : null : null;
|
|
24462
24462
|
}
|
|
24463
|
-
function
|
|
24463
|
+
function le(e) {
|
|
24464
24464
|
let t = -1;
|
|
24465
24465
|
for (let n = e.length - 1; n >= 0; n--) if (e[n].tagName === "BehaviorDescription") {
|
|
24466
24466
|
t = n;
|
|
@@ -24472,28 +24472,28 @@ function ce(e) {
|
|
|
24472
24472
|
let t = w(e[r]);
|
|
24473
24473
|
t && n.push(t);
|
|
24474
24474
|
}
|
|
24475
|
-
return n.length === 0 ? null :
|
|
24475
|
+
return n.length === 0 ? null : D(n);
|
|
24476
24476
|
}
|
|
24477
|
-
function
|
|
24477
|
+
function ue(e) {
|
|
24478
24478
|
let t = e.indexOf("("), n = e.indexOf(".");
|
|
24479
24479
|
return t === -1 ? n === -1 ? e : e.substring(0, n) : e.substring(0, t);
|
|
24480
24480
|
}
|
|
24481
|
-
function
|
|
24481
|
+
function de(e) {
|
|
24482
24482
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].tagName === "LNode") return e[t].attributes.find((e) => e.name === "iedName")?.value ?? null;
|
|
24483
24483
|
return null;
|
|
24484
24484
|
}
|
|
24485
24485
|
//#endregion
|
|
24486
24486
|
//#region src/v2019C1/extensions/reference/query/build/build-reference-path.ts
|
|
24487
24487
|
async function k(e, t) {
|
|
24488
|
-
let { reference: n, target:
|
|
24488
|
+
let { reference: n, target: r } = t, a = fe(n.tagName, r.tagName);
|
|
24489
24489
|
if (!a) return null;
|
|
24490
24490
|
let o = a.resolution;
|
|
24491
24491
|
if (o === M.unsupported) return null;
|
|
24492
24492
|
if (o === M.behaviorDescription) {
|
|
24493
|
-
let t = await e.getRecord(
|
|
24494
|
-
return t ? w(
|
|
24493
|
+
let t = await e.getRecord(r);
|
|
24494
|
+
return t ? w(i(t))?.segment ?? null : null;
|
|
24495
24495
|
}
|
|
24496
|
-
let s = await re(e,
|
|
24496
|
+
let s = await re(e, r);
|
|
24497
24497
|
if (!s) return null;
|
|
24498
24498
|
let c = s.path;
|
|
24499
24499
|
if (o === M.lnode) {
|
|
@@ -24501,36 +24501,36 @@ async function k(e, t) {
|
|
|
24501
24501
|
if (!t) return c;
|
|
24502
24502
|
let r = t.attributes.find((e) => e.name === a.attribute.path)?.value;
|
|
24503
24503
|
if (!r) return c;
|
|
24504
|
-
let { qualifier: i } =
|
|
24504
|
+
let { qualifier: i } = O(r);
|
|
24505
24505
|
return i ? `${c}.${i}` : c;
|
|
24506
24506
|
}
|
|
24507
24507
|
return c;
|
|
24508
24508
|
}
|
|
24509
|
-
function
|
|
24509
|
+
function fe(e, t) {
|
|
24510
24510
|
let n = N[e];
|
|
24511
24511
|
return n ? n.find((e) => e.target.includes(t)) ?? null : null;
|
|
24512
24512
|
}
|
|
24513
24513
|
//#endregion
|
|
24514
24514
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-reference-path.ts
|
|
24515
|
-
async function
|
|
24516
|
-
let
|
|
24517
|
-
if (!
|
|
24515
|
+
async function pe(e, t, n) {
|
|
24516
|
+
let r = me(t.tagName, n);
|
|
24517
|
+
if (!r) return;
|
|
24518
24518
|
let a = t.attributes.find((e) => e.name === n)?.value;
|
|
24519
24519
|
if (!a) return;
|
|
24520
|
-
let o = await
|
|
24520
|
+
let o = await he(e, t, r);
|
|
24521
24521
|
if (o) return {
|
|
24522
24522
|
record: o,
|
|
24523
|
-
qualifier:
|
|
24523
|
+
qualifier: ge(r, n, a)
|
|
24524
24524
|
};
|
|
24525
24525
|
let s;
|
|
24526
|
-
(
|
|
24527
|
-
let c =
|
|
24526
|
+
(r.resolution === M.behaviorDescription || r.resolution === M.iedAddress) && (s = (await e.findAncestors(t, { order: "top-down" })).map((e) => i(e)));
|
|
24527
|
+
let c = ae(r.resolution, n, a, s);
|
|
24528
24528
|
if (!c) return;
|
|
24529
24529
|
let l = ie(c.lookupKey);
|
|
24530
24530
|
if (l.length === 0) return;
|
|
24531
|
-
let u = l[l.length - 1], d = l.slice(0, -1), f = await
|
|
24531
|
+
let u = l[l.length - 1], d = l.slice(0, -1), f = await be({
|
|
24532
24532
|
query: e,
|
|
24533
|
-
targets:
|
|
24533
|
+
targets: r.target,
|
|
24534
24534
|
segment: u,
|
|
24535
24535
|
expectedAncestry: d
|
|
24536
24536
|
});
|
|
@@ -24539,11 +24539,11 @@ async function fe(e, t, n) {
|
|
|
24539
24539
|
qualifier: c.qualifier
|
|
24540
24540
|
};
|
|
24541
24541
|
}
|
|
24542
|
-
function
|
|
24542
|
+
function me(e, t) {
|
|
24543
24543
|
let n = N[e];
|
|
24544
24544
|
if (n) return n.find((e) => e.attribute.path === t);
|
|
24545
24545
|
}
|
|
24546
|
-
async function
|
|
24546
|
+
async function he(e, t, n) {
|
|
24547
24547
|
let r = n.attribute.uuid, i = t.attributes.find((e) => e.name === r)?.value;
|
|
24548
24548
|
if (i) for (let t of n.target) {
|
|
24549
24549
|
let n = await e.findByAttributes({
|
|
@@ -24553,19 +24553,19 @@ async function me(e, t, n) {
|
|
|
24553
24553
|
if (n.length > 0) return n[0];
|
|
24554
24554
|
}
|
|
24555
24555
|
}
|
|
24556
|
-
function
|
|
24557
|
-
if (e.resolution === M.lnode) return
|
|
24556
|
+
function ge(e, t, n) {
|
|
24557
|
+
if (e.resolution === M.lnode) return O(n).qualifier;
|
|
24558
24558
|
if (e.resolution === M.behaviorDescription && t === "dataName") return n;
|
|
24559
24559
|
}
|
|
24560
|
-
var
|
|
24560
|
+
var _e = new Set(h.LNode.attributes.details.lnClass.facets.enumeration), ve = {
|
|
24561
24561
|
LNode: "lnInst",
|
|
24562
24562
|
LN: "inst",
|
|
24563
24563
|
LN0: "inst"
|
|
24564
24564
|
};
|
|
24565
|
-
function
|
|
24565
|
+
function ye(e) {
|
|
24566
24566
|
for (let t = 0; t <= e.length - 4; t++) {
|
|
24567
24567
|
let n = e.substring(t, t + 4);
|
|
24568
|
-
if (
|
|
24568
|
+
if (_e.has(n)) return {
|
|
24569
24569
|
prefix: e.substring(0, t),
|
|
24570
24570
|
lnClass: n,
|
|
24571
24571
|
inst: e.substring(t + 4)
|
|
@@ -24573,12 +24573,12 @@ function ve(e) {
|
|
|
24573
24573
|
}
|
|
24574
24574
|
return null;
|
|
24575
24575
|
}
|
|
24576
|
-
async function
|
|
24576
|
+
async function be(e) {
|
|
24577
24577
|
let { query: t, targets: n, segment: r, expectedAncestry: i } = e;
|
|
24578
24578
|
for (let e of n) {
|
|
24579
|
-
let n =
|
|
24579
|
+
let n = ve[e];
|
|
24580
24580
|
if (n) {
|
|
24581
|
-
let a = await
|
|
24581
|
+
let a = await xe({
|
|
24582
24582
|
query: t,
|
|
24583
24583
|
tagName: e,
|
|
24584
24584
|
segment: r,
|
|
@@ -24587,7 +24587,7 @@ async function ye(e) {
|
|
|
24587
24587
|
});
|
|
24588
24588
|
if (a) return a;
|
|
24589
24589
|
} else {
|
|
24590
|
-
let n = await
|
|
24590
|
+
let n = await Se({
|
|
24591
24591
|
query: t,
|
|
24592
24592
|
tagName: e,
|
|
24593
24593
|
segment: r,
|
|
@@ -24597,8 +24597,8 @@ async function ye(e) {
|
|
|
24597
24597
|
}
|
|
24598
24598
|
}
|
|
24599
24599
|
}
|
|
24600
|
-
async function
|
|
24601
|
-
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o =
|
|
24600
|
+
async function xe(e) {
|
|
24601
|
+
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o = ye(r.segment);
|
|
24602
24602
|
if (!o) return;
|
|
24603
24603
|
let s = await t.findByAttributes({
|
|
24604
24604
|
tagName: n,
|
|
@@ -24609,25 +24609,25 @@ async function be(e) {
|
|
|
24609
24609
|
if (!(n !== o.prefix || r !== o.inst) && await A(t, e, a)) return e;
|
|
24610
24610
|
}
|
|
24611
24611
|
}
|
|
24612
|
-
async function
|
|
24613
|
-
let { query: t, tagName: n, segment:
|
|
24612
|
+
async function Se(e) {
|
|
24613
|
+
let { query: t, tagName: n, segment: r, expectedAncestry: a } = e, o = await t.getRecordsByTagName(n);
|
|
24614
24614
|
for (let e of o) {
|
|
24615
|
-
let n = w(
|
|
24616
|
-
if (!(!n || n.segment !==
|
|
24615
|
+
let n = w(i(e));
|
|
24616
|
+
if (!(!n || n.segment !== r.segment) && await A(t, e, a)) return e;
|
|
24617
24617
|
}
|
|
24618
24618
|
}
|
|
24619
24619
|
async function A(e, t, n) {
|
|
24620
24620
|
if (n.length === 0) return !0;
|
|
24621
|
-
let
|
|
24622
|
-
for (let e =
|
|
24623
|
-
let t = w(r
|
|
24621
|
+
let r = await e.findAncestors(t), a = [];
|
|
24622
|
+
for (let e = r.length - 1; e >= 0; e--) {
|
|
24623
|
+
let t = w(i(r[e]));
|
|
24624
24624
|
t && a.push(t);
|
|
24625
24625
|
}
|
|
24626
24626
|
return a.length === n.length ? a.every((e, t) => e.segment === n[t].segment) : !1;
|
|
24627
24627
|
}
|
|
24628
24628
|
//#endregion
|
|
24629
24629
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-element-path.ts
|
|
24630
|
-
async function
|
|
24630
|
+
async function Ce(e, t) {
|
|
24631
24631
|
let n = ie(t);
|
|
24632
24632
|
if (n.length !== 0) return j({
|
|
24633
24633
|
query: e,
|
|
@@ -24637,19 +24637,19 @@ async function Se(e, t) {
|
|
|
24637
24637
|
});
|
|
24638
24638
|
}
|
|
24639
24639
|
async function j(e) {
|
|
24640
|
-
let { query: t, current: n, segments:
|
|
24641
|
-
if (a >=
|
|
24640
|
+
let { query: t, current: n, segments: r, index: a } = e;
|
|
24641
|
+
if (a >= r.length) return n;
|
|
24642
24642
|
let o = n.children ?? [];
|
|
24643
24643
|
if (o.length === 0) return;
|
|
24644
|
-
let s = await t.getRecords(o), c =
|
|
24644
|
+
let s = await t.getRecords(o), c = r[a];
|
|
24645
24645
|
for (let e of s) {
|
|
24646
24646
|
if (!e) continue;
|
|
24647
|
-
let n = w(
|
|
24647
|
+
let n = w(i(e));
|
|
24648
24648
|
if (!n) {
|
|
24649
24649
|
let n = await j({
|
|
24650
24650
|
query: t,
|
|
24651
24651
|
current: e,
|
|
24652
|
-
segments:
|
|
24652
|
+
segments: r,
|
|
24653
24653
|
index: a
|
|
24654
24654
|
});
|
|
24655
24655
|
if (n) return n;
|
|
@@ -24659,7 +24659,7 @@ async function j(e) {
|
|
|
24659
24659
|
let n = await j({
|
|
24660
24660
|
query: t,
|
|
24661
24661
|
current: e,
|
|
24662
|
-
segments:
|
|
24662
|
+
segments: r,
|
|
24663
24663
|
index: a + 1
|
|
24664
24664
|
});
|
|
24665
24665
|
if (n) return n;
|
|
@@ -25047,7 +25047,7 @@ var M = {
|
|
|
25047
25047
|
};
|
|
25048
25048
|
//#endregion
|
|
25049
25049
|
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25050
|
-
function
|
|
25050
|
+
function we(e) {
|
|
25051
25051
|
let t = {};
|
|
25052
25052
|
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25053
25053
|
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
@@ -25062,7 +25062,7 @@ function Ce(e) {
|
|
|
25062
25062
|
}
|
|
25063
25063
|
return t;
|
|
25064
25064
|
}
|
|
25065
|
-
function
|
|
25065
|
+
function Te(e) {
|
|
25066
25066
|
let t = /* @__PURE__ */ new Map();
|
|
25067
25067
|
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25068
25068
|
uuidAttr: e.attribute.uuid,
|
|
@@ -25074,16 +25074,16 @@ function we(e) {
|
|
|
25074
25074
|
}
|
|
25075
25075
|
//#endregion
|
|
25076
25076
|
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25077
|
-
var P =
|
|
25077
|
+
var P = we(N), F = [
|
|
25078
25078
|
M.direct,
|
|
25079
25079
|
M.lnode,
|
|
25080
25080
|
M.iedAddress,
|
|
25081
25081
|
M.behaviorDescription
|
|
25082
|
-
], Ee =
|
|
25082
|
+
], Ee = Te(N);
|
|
25083
25083
|
[...new Set(Object.values(N).flatMap((e) => e.map((e) => e.attribute.uuid)))];
|
|
25084
25084
|
//#endregion
|
|
25085
25085
|
//#region src/v2019C1/extensions/reference/constants/orphan-rules.ts
|
|
25086
|
-
var
|
|
25086
|
+
var I = new Set([
|
|
25087
25087
|
"SourceRef",
|
|
25088
25088
|
"ControlRef",
|
|
25089
25089
|
"DOS",
|
|
@@ -25092,7 +25092,7 @@ var De = new Set([
|
|
|
25092
25092
|
"InputVar",
|
|
25093
25093
|
"OutputVar",
|
|
25094
25094
|
"ProcessEcho"
|
|
25095
|
-
]),
|
|
25095
|
+
]), De = {
|
|
25096
25096
|
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25097
25097
|
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25098
25098
|
Resource: ["ProcessResource", "ProcessResources"],
|
|
@@ -25100,22 +25100,22 @@ var De = new Set([
|
|
|
25100
25100
|
};
|
|
25101
25101
|
//#endregion
|
|
25102
25102
|
//#region src/v2019C1/extensions/reference/query/find/find-refs-pointing-to.ts
|
|
25103
|
-
async function
|
|
25104
|
-
let { target: r, containerTagName: i } =
|
|
25103
|
+
async function Oe(e, t) {
|
|
25104
|
+
let { target: r, containerTagName: i } = t, a = await e.getRecord(r);
|
|
25105
25105
|
if (!a) return [];
|
|
25106
25106
|
let o = a.attributes.find((e) => e.name === "uuid")?.value;
|
|
25107
25107
|
if (!o) return [];
|
|
25108
|
-
let s =
|
|
25108
|
+
let s = ke(a.tagName);
|
|
25109
25109
|
if (s.length === 0) return [];
|
|
25110
25110
|
let c = [];
|
|
25111
|
-
for (let
|
|
25112
|
-
if (!t
|
|
25111
|
+
for (let t of s) {
|
|
25112
|
+
if (!n(t.refTagName, U)) continue;
|
|
25113
25113
|
let r = await e.findByAttributes({
|
|
25114
|
-
tagName:
|
|
25115
|
-
attributes: { [
|
|
25114
|
+
tagName: t.refTagName,
|
|
25115
|
+
attributes: { [t.uuidAttr]: o }
|
|
25116
25116
|
});
|
|
25117
25117
|
for (let t of r) {
|
|
25118
|
-
let n = i ? await
|
|
25118
|
+
let n = i ? await Ae(e, t, i) : void 0;
|
|
25119
25119
|
c.push({
|
|
25120
25120
|
ref: t,
|
|
25121
25121
|
container: n
|
|
@@ -25124,50 +25124,50 @@ async function ke(e, n) {
|
|
|
25124
25124
|
}
|
|
25125
25125
|
return c;
|
|
25126
25126
|
}
|
|
25127
|
-
function
|
|
25127
|
+
function ke(e) {
|
|
25128
25128
|
let t = [];
|
|
25129
|
-
for (let n of
|
|
25129
|
+
for (let n of F) {
|
|
25130
25130
|
let r = P[n].get(e);
|
|
25131
25131
|
r && t.push(...r);
|
|
25132
25132
|
}
|
|
25133
25133
|
return t;
|
|
25134
25134
|
}
|
|
25135
|
-
async function
|
|
25135
|
+
async function Ae(e, t, n) {
|
|
25136
25136
|
return (await e.findAncestors(t, { stopAtTagName: n })).find((e) => e.tagName === n);
|
|
25137
25137
|
}
|
|
25138
25138
|
//#endregion
|
|
25139
25139
|
//#region src/v2019C1/extensions/reference/index.ts
|
|
25140
|
-
var
|
|
25140
|
+
var L = { query: /* @__PURE__ */ s({
|
|
25141
25141
|
buildElementPath: () => re,
|
|
25142
25142
|
buildReferencePath: () => k,
|
|
25143
|
-
findRefsPointingTo: () =>
|
|
25144
|
-
resolveElementPath: () =>
|
|
25145
|
-
resolveReferencePath: () =>
|
|
25143
|
+
findRefsPointingTo: () => Oe,
|
|
25144
|
+
resolveElementPath: () => Ce,
|
|
25145
|
+
resolveReferencePath: () => pe
|
|
25146
25146
|
}) };
|
|
25147
25147
|
//#endregion
|
|
25148
25148
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
25149
|
-
async function
|
|
25150
|
-
let { uuid:
|
|
25151
|
-
if (!
|
|
25152
|
-
let s = await o.getRecordsByTagName(
|
|
25149
|
+
async function R(e) {
|
|
25150
|
+
let { uuid: t, entry: r, target: a, query: o } = e;
|
|
25151
|
+
if (!n(r.refTagName, U)) return [];
|
|
25152
|
+
let s = await o.getRecordsByTagName(r.refTagName), c = [];
|
|
25153
25153
|
for (let e of s) {
|
|
25154
|
-
if (e.attributes.find((e) => e.name ===
|
|
25155
|
-
let
|
|
25154
|
+
if (e.attributes.find((e) => e.name === r.uuidAttr)?.value !== t) continue;
|
|
25155
|
+
let n = {
|
|
25156
25156
|
tagName: e.tagName,
|
|
25157
25157
|
id: e.id
|
|
25158
|
-
}, s = await
|
|
25159
|
-
reference:
|
|
25158
|
+
}, s = await L.query.buildReferencePath(o, {
|
|
25159
|
+
reference: n,
|
|
25160
25160
|
target: a
|
|
25161
25161
|
});
|
|
25162
|
-
if (!s || e.attributes.find((e) => e.name ===
|
|
25163
|
-
let l = e.attributes.map((e) => e.name ===
|
|
25162
|
+
if (!s || e.attributes.find((e) => e.name === r.pathAttr)?.value === s) continue;
|
|
25163
|
+
let l = e.attributes.map((e) => e.name === r.pathAttr ? {
|
|
25164
25164
|
...e,
|
|
25165
25165
|
value: s
|
|
25166
25166
|
} : e);
|
|
25167
25167
|
c.push({
|
|
25168
25168
|
status: "updated",
|
|
25169
|
-
oldRecord:
|
|
25170
|
-
newRecord:
|
|
25169
|
+
oldRecord: i(e),
|
|
25170
|
+
newRecord: i({
|
|
25171
25171
|
...e,
|
|
25172
25172
|
attributes: l
|
|
25173
25173
|
})
|
|
@@ -25175,9 +25175,9 @@ async function I(e) {
|
|
|
25175
25175
|
}
|
|
25176
25176
|
return c;
|
|
25177
25177
|
}
|
|
25178
|
-
function
|
|
25178
|
+
function z(e) {
|
|
25179
25179
|
let t = [];
|
|
25180
|
-
for (let n of
|
|
25180
|
+
for (let n of F) {
|
|
25181
25181
|
let r = P[n].get(e);
|
|
25182
25182
|
r && t.push(...r);
|
|
25183
25183
|
}
|
|
@@ -25185,22 +25185,22 @@ function L(e) {
|
|
|
25185
25185
|
}
|
|
25186
25186
|
//#endregion
|
|
25187
25187
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
25188
|
-
async function
|
|
25189
|
-
let { childRecord: t, query: n } = e, r = await
|
|
25188
|
+
async function je(e) {
|
|
25189
|
+
let { childRecord: t, query: n } = e, r = await Me({
|
|
25190
25190
|
childRecord: t,
|
|
25191
25191
|
query: n
|
|
25192
|
-
}), i = await
|
|
25192
|
+
}), i = await Fe({
|
|
25193
25193
|
childRecord: t,
|
|
25194
25194
|
query: n
|
|
25195
25195
|
});
|
|
25196
25196
|
return [...r, ...i];
|
|
25197
25197
|
}
|
|
25198
|
-
async function
|
|
25198
|
+
async function Me(e) {
|
|
25199
25199
|
let { childRecord: t, query: n } = e, r = Ee.get(t.tagName);
|
|
25200
25200
|
if (!r?.length) return [];
|
|
25201
25201
|
let i = [];
|
|
25202
25202
|
for (let e of r) {
|
|
25203
|
-
let r = await
|
|
25203
|
+
let r = await Ne({
|
|
25204
25204
|
childRecord: t,
|
|
25205
25205
|
pair: e,
|
|
25206
25206
|
query: n
|
|
@@ -25209,10 +25209,10 @@ async function Ne(e) {
|
|
|
25209
25209
|
}
|
|
25210
25210
|
return i;
|
|
25211
25211
|
}
|
|
25212
|
-
async function
|
|
25212
|
+
async function Ne(e) {
|
|
25213
25213
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
25214
25214
|
if (!i) return null;
|
|
25215
|
-
let a = await
|
|
25215
|
+
let a = await Pe({
|
|
25216
25216
|
uuidValue: i,
|
|
25217
25217
|
targetTagNames: n.targetTagNames,
|
|
25218
25218
|
query: r
|
|
@@ -25242,11 +25242,11 @@ async function Pe(e) {
|
|
|
25242
25242
|
}
|
|
25243
25243
|
};
|
|
25244
25244
|
}
|
|
25245
|
-
async function
|
|
25246
|
-
let { uuidValue:
|
|
25245
|
+
async function Pe(e) {
|
|
25246
|
+
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
25247
25247
|
for (let e of r) {
|
|
25248
|
-
if (!
|
|
25249
|
-
let r = (await i.getRecordsByTagName(e)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value ===
|
|
25248
|
+
if (!n(e, U)) continue;
|
|
25249
|
+
let r = (await i.getRecordsByTagName(e)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value === t);
|
|
25250
25250
|
if (r) return {
|
|
25251
25251
|
tagName: r.tagName,
|
|
25252
25252
|
id: r.id
|
|
@@ -25254,17 +25254,17 @@ async function Fe(e) {
|
|
|
25254
25254
|
}
|
|
25255
25255
|
return null;
|
|
25256
25256
|
}
|
|
25257
|
-
async function
|
|
25257
|
+
async function Fe(e) {
|
|
25258
25258
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25259
25259
|
if (!r) return [];
|
|
25260
|
-
let i =
|
|
25260
|
+
let i = z(t.tagName);
|
|
25261
25261
|
if (i.length === 0) return [];
|
|
25262
25262
|
let a = {
|
|
25263
25263
|
tagName: t.tagName,
|
|
25264
25264
|
id: t.id
|
|
25265
25265
|
}, o = [];
|
|
25266
25266
|
for (let e of i) {
|
|
25267
|
-
let t = await
|
|
25267
|
+
let t = await R({
|
|
25268
25268
|
uuid: r,
|
|
25269
25269
|
entry: e,
|
|
25270
25270
|
target: a,
|
|
@@ -25276,12 +25276,12 @@ async function Ie(e) {
|
|
|
25276
25276
|
}
|
|
25277
25277
|
//#endregion
|
|
25278
25278
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
25279
|
-
async function
|
|
25280
|
-
let { childRecord: t, parentRecord: n, query: r } = e, i = await
|
|
25279
|
+
async function Ie(e) {
|
|
25280
|
+
let { childRecord: t, parentRecord: n, query: r } = e, i = await g({
|
|
25281
25281
|
childRecord: t,
|
|
25282
25282
|
parentRecord: n,
|
|
25283
25283
|
query: r
|
|
25284
|
-
}), a = await
|
|
25284
|
+
}), a = await je({
|
|
25285
25285
|
childRecord: t,
|
|
25286
25286
|
query: r
|
|
25287
25287
|
});
|
|
@@ -25289,12 +25289,12 @@ async function Le(e) {
|
|
|
25289
25289
|
}
|
|
25290
25290
|
//#endregion
|
|
25291
25291
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
25292
|
-
async function
|
|
25293
|
-
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await
|
|
25292
|
+
async function Le(e) {
|
|
25293
|
+
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await Re(t, n);
|
|
25294
25294
|
if (r.size === 0) return [];
|
|
25295
25295
|
let a = [];
|
|
25296
25296
|
for (let { target: e } of t) {
|
|
25297
|
-
let t = await
|
|
25297
|
+
let t = await Be({
|
|
25298
25298
|
target: e,
|
|
25299
25299
|
uuidMap: r,
|
|
25300
25300
|
uuidToRef: i,
|
|
@@ -25304,9 +25304,9 @@ async function Re(e) {
|
|
|
25304
25304
|
}
|
|
25305
25305
|
return a;
|
|
25306
25306
|
}
|
|
25307
|
-
async function
|
|
25307
|
+
async function Re(e, t) {
|
|
25308
25308
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
25309
|
-
for (let { source: i, target: a } of e) await
|
|
25309
|
+
for (let { source: i, target: a } of e) await ze({
|
|
25310
25310
|
source: i,
|
|
25311
25311
|
target: a,
|
|
25312
25312
|
query: t,
|
|
@@ -25318,7 +25318,7 @@ async function ze(e, t) {
|
|
|
25318
25318
|
uuidToRef: r
|
|
25319
25319
|
};
|
|
25320
25320
|
}
|
|
25321
|
-
async function
|
|
25321
|
+
async function ze(e) {
|
|
25322
25322
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
25323
25323
|
if (!o) return;
|
|
25324
25324
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -25327,41 +25327,41 @@ async function Be(e) {
|
|
|
25327
25327
|
id: o.id
|
|
25328
25328
|
}));
|
|
25329
25329
|
}
|
|
25330
|
-
async function
|
|
25331
|
-
let { target: t, uuidMap: n, uuidToRef:
|
|
25330
|
+
async function Be(e) {
|
|
25331
|
+
let { target: t, uuidMap: n, uuidToRef: r, query: a } = e, o = t.tagName;
|
|
25332
25332
|
if (!(o in N)) return null;
|
|
25333
25333
|
let s = await a.getRecord(t);
|
|
25334
25334
|
if (!s) return null;
|
|
25335
25335
|
let c = N[o], l = [...s.attributes], u = !1;
|
|
25336
25336
|
for (let e of c) {
|
|
25337
|
-
let t = await
|
|
25337
|
+
let t = await Ve({
|
|
25338
25338
|
pair: e,
|
|
25339
25339
|
tagName: o,
|
|
25340
25340
|
refId: s.id,
|
|
25341
25341
|
updatedAttributes: l,
|
|
25342
25342
|
uuidMap: n,
|
|
25343
|
-
uuidToRef:
|
|
25343
|
+
uuidToRef: r,
|
|
25344
25344
|
query: a
|
|
25345
25345
|
});
|
|
25346
25346
|
t && (l = t, u = !0);
|
|
25347
25347
|
}
|
|
25348
25348
|
return u ? {
|
|
25349
25349
|
status: "updated",
|
|
25350
|
-
oldRecord:
|
|
25351
|
-
newRecord:
|
|
25350
|
+
oldRecord: i(s),
|
|
25351
|
+
newRecord: i({
|
|
25352
25352
|
...s,
|
|
25353
25353
|
attributes: l
|
|
25354
25354
|
})
|
|
25355
25355
|
} : null;
|
|
25356
25356
|
}
|
|
25357
|
-
async function
|
|
25357
|
+
async function Ve(e) {
|
|
25358
25358
|
let { pair: t, tagName: n, refId: r, uuidMap: i, uuidToRef: a, query: o } = e, s = [...e.updatedAttributes], c = s.find((e) => e.name === t.attribute.uuid)?.value;
|
|
25359
25359
|
if (!c) return null;
|
|
25360
25360
|
let l = i.get(c);
|
|
25361
25361
|
if (!l) return null;
|
|
25362
|
-
let u = !1, d =
|
|
25362
|
+
let u = !1, d = He(s, t.attribute.uuid, c, l);
|
|
25363
25363
|
d && (s = d, u = !0);
|
|
25364
|
-
let f = await
|
|
25364
|
+
let f = await Ue({
|
|
25365
25365
|
attributes: s,
|
|
25366
25366
|
pathAttrName: t.attribute.path,
|
|
25367
25367
|
newUuid: l,
|
|
@@ -25372,16 +25372,16 @@ async function He(e) {
|
|
|
25372
25372
|
});
|
|
25373
25373
|
return f && (s = f, u = !0), u ? s : null;
|
|
25374
25374
|
}
|
|
25375
|
-
function
|
|
25375
|
+
function He(e, t, n, r) {
|
|
25376
25376
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
25377
25377
|
...e,
|
|
25378
25378
|
value: r
|
|
25379
25379
|
} : e);
|
|
25380
25380
|
}
|
|
25381
|
-
async function
|
|
25381
|
+
async function Ue(e) {
|
|
25382
25382
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
25383
25383
|
if (!c) return null;
|
|
25384
|
-
let l = await
|
|
25384
|
+
let l = await L.query.buildReferencePath(s, {
|
|
25385
25385
|
reference: {
|
|
25386
25386
|
tagName: a,
|
|
25387
25387
|
id: o
|
|
@@ -25398,13 +25398,13 @@ async function We(e) {
|
|
|
25398
25398
|
}
|
|
25399
25399
|
//#endregion
|
|
25400
25400
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
25401
|
-
async function
|
|
25402
|
-
return
|
|
25401
|
+
async function We(e) {
|
|
25402
|
+
return Le(e);
|
|
25403
25403
|
}
|
|
25404
25404
|
//#endregion
|
|
25405
25405
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
25406
|
-
function
|
|
25407
|
-
let { record: t } = e, { tagName: n, attributes: r } = t, i =
|
|
25406
|
+
function Ge(e) {
|
|
25407
|
+
let { record: t } = e, { tagName: n, attributes: r } = t, i = U.definition[n];
|
|
25408
25408
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
25409
25409
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
25410
25410
|
return {
|
|
@@ -25418,20 +25418,20 @@ function Ke(e) {
|
|
|
25418
25418
|
}
|
|
25419
25419
|
//#endregion
|
|
25420
25420
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
25421
|
-
function
|
|
25422
|
-
return
|
|
25421
|
+
function Ke(e) {
|
|
25422
|
+
return Ge(e);
|
|
25423
25423
|
}
|
|
25424
25424
|
//#endregion
|
|
25425
25425
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
25426
|
-
async function
|
|
25426
|
+
async function qe(e) {
|
|
25427
25427
|
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
25428
25428
|
if (a) {
|
|
25429
|
-
let e =
|
|
25429
|
+
let e = z(n.tagName), t = {
|
|
25430
25430
|
tagName: n.tagName,
|
|
25431
25431
|
id: n.id
|
|
25432
25432
|
};
|
|
25433
25433
|
for (let n of e) {
|
|
25434
|
-
let e = await
|
|
25434
|
+
let e = await R({
|
|
25435
25435
|
uuid: a,
|
|
25436
25436
|
entry: n,
|
|
25437
25437
|
target: t,
|
|
@@ -25440,8 +25440,8 @@ async function Je(e) {
|
|
|
25440
25440
|
i.push(...e);
|
|
25441
25441
|
}
|
|
25442
25442
|
}
|
|
25443
|
-
if (
|
|
25444
|
-
let e = await
|
|
25443
|
+
if (Je(t, n)) {
|
|
25444
|
+
let e = await Ye({
|
|
25445
25445
|
newRecord: n,
|
|
25446
25446
|
query: r
|
|
25447
25447
|
});
|
|
@@ -25449,11 +25449,11 @@ async function Je(e) {
|
|
|
25449
25449
|
}
|
|
25450
25450
|
return i;
|
|
25451
25451
|
}
|
|
25452
|
-
function
|
|
25452
|
+
function Je(e, t) {
|
|
25453
25453
|
for (let n of ee) if (e.attributes.find((e) => e.name === n)?.value !== t.attributes.find((e) => e.name === n)?.value) return !0;
|
|
25454
25454
|
return !1;
|
|
25455
25455
|
}
|
|
25456
|
-
async function
|
|
25456
|
+
async function Ye(e) {
|
|
25457
25457
|
let { newRecord: t, query: n } = e, r = {
|
|
25458
25458
|
tagName: t.tagName,
|
|
25459
25459
|
id: t.id
|
|
@@ -25462,14 +25462,14 @@ async function Xe(e) {
|
|
|
25462
25462
|
if (r.id === t.id) continue;
|
|
25463
25463
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
25464
25464
|
if (!e) continue;
|
|
25465
|
-
let i =
|
|
25465
|
+
let i = z(r.tagName);
|
|
25466
25466
|
if (i.length === 0) continue;
|
|
25467
25467
|
let o = {
|
|
25468
25468
|
tagName: r.tagName,
|
|
25469
25469
|
id: r.id
|
|
25470
25470
|
};
|
|
25471
25471
|
for (let t of i) {
|
|
25472
|
-
let r = await
|
|
25472
|
+
let r = await R({
|
|
25473
25473
|
uuid: e,
|
|
25474
25474
|
entry: t,
|
|
25475
25475
|
target: o,
|
|
@@ -25482,12 +25482,12 @@ async function Xe(e) {
|
|
|
25482
25482
|
}
|
|
25483
25483
|
//#endregion
|
|
25484
25484
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
25485
|
-
async function
|
|
25486
|
-
return
|
|
25485
|
+
async function Xe(e) {
|
|
25486
|
+
return qe(e);
|
|
25487
25487
|
}
|
|
25488
25488
|
//#endregion
|
|
25489
25489
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
25490
|
-
function
|
|
25490
|
+
function Ze(e) {
|
|
25491
25491
|
let { record: t } = e, n = !0;
|
|
25492
25492
|
t.tagName === "Private" && !t.tree.length && (n = !1);
|
|
25493
25493
|
let r = t.attributes.filter((e) => e.name !== "uuid");
|
|
@@ -25501,9 +25501,9 @@ function Qe(e) {
|
|
|
25501
25501
|
}
|
|
25502
25502
|
//#endregion
|
|
25503
25503
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
25504
|
-
async function
|
|
25504
|
+
async function Qe(e) {
|
|
25505
25505
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
25506
|
-
if (await
|
|
25506
|
+
if (await B({
|
|
25507
25507
|
record: t,
|
|
25508
25508
|
query: n,
|
|
25509
25509
|
ids: r,
|
|
@@ -25511,7 +25511,7 @@ async function $e(e) {
|
|
|
25511
25511
|
}), i.size === 0) return [];
|
|
25512
25512
|
let a = [], o = Object.keys(N);
|
|
25513
25513
|
for (let e of o) {
|
|
25514
|
-
let t = await
|
|
25514
|
+
let t = await $e({
|
|
25515
25515
|
refTagName: e,
|
|
25516
25516
|
subtreeIds: r,
|
|
25517
25517
|
subtreeUuids: i,
|
|
@@ -25521,11 +25521,11 @@ async function $e(e) {
|
|
|
25521
25521
|
}
|
|
25522
25522
|
return a;
|
|
25523
25523
|
}
|
|
25524
|
-
async function
|
|
25524
|
+
async function $e(e) {
|
|
25525
25525
|
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = N[t], o = await i.getRecordsByTagName(t), s = [];
|
|
25526
25526
|
for (let e of o) {
|
|
25527
25527
|
if (n.has(e.id)) continue;
|
|
25528
|
-
let o = await
|
|
25528
|
+
let o = await et({
|
|
25529
25529
|
refTagName: t,
|
|
25530
25530
|
refRecord: e,
|
|
25531
25531
|
refPairs: a,
|
|
@@ -25536,15 +25536,15 @@ async function et(e) {
|
|
|
25536
25536
|
}
|
|
25537
25537
|
return s;
|
|
25538
25538
|
}
|
|
25539
|
-
async function
|
|
25540
|
-
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o =
|
|
25539
|
+
async function et(e) {
|
|
25540
|
+
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o = tt({
|
|
25541
25541
|
refPairs: r,
|
|
25542
25542
|
refRecord: n,
|
|
25543
25543
|
subtreeUuids: i
|
|
25544
25544
|
});
|
|
25545
|
-
return o.size === 0 ? [] :
|
|
25545
|
+
return o.size === 0 ? [] : I.has(t) ? [nt(n, o)] : rt(n, a);
|
|
25546
25546
|
}
|
|
25547
|
-
function
|
|
25547
|
+
function tt(e) {
|
|
25548
25548
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
25549
25549
|
for (let e of t) {
|
|
25550
25550
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -25555,47 +25555,47 @@ function nt(e) {
|
|
|
25555
25555
|
}
|
|
25556
25556
|
return i;
|
|
25557
25557
|
}
|
|
25558
|
-
function
|
|
25558
|
+
function nt(e, t) {
|
|
25559
25559
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
25560
25560
|
return {
|
|
25561
25561
|
status: "updated",
|
|
25562
|
-
oldRecord:
|
|
25563
|
-
newRecord:
|
|
25562
|
+
oldRecord: i(e),
|
|
25563
|
+
newRecord: i({
|
|
25564
25564
|
...e,
|
|
25565
25565
|
attributes: n
|
|
25566
25566
|
})
|
|
25567
25567
|
};
|
|
25568
25568
|
}
|
|
25569
|
-
async function
|
|
25569
|
+
async function rt(e, t) {
|
|
25570
25570
|
let n = [{
|
|
25571
25571
|
status: "deleted",
|
|
25572
|
-
oldRecord:
|
|
25572
|
+
oldRecord: i(e),
|
|
25573
25573
|
newRecord: void 0
|
|
25574
25574
|
}];
|
|
25575
25575
|
if (e.parent) {
|
|
25576
|
-
let
|
|
25577
|
-
if (
|
|
25576
|
+
let r = await t.getRecord(e.parent);
|
|
25577
|
+
if (r) {
|
|
25578
25578
|
let t = {
|
|
25579
|
-
...
|
|
25580
|
-
children:
|
|
25579
|
+
...r,
|
|
25580
|
+
children: r.children.filter((t) => t.id !== e.id)
|
|
25581
25581
|
};
|
|
25582
25582
|
n.push({
|
|
25583
25583
|
status: "updated",
|
|
25584
|
-
oldRecord: r
|
|
25585
|
-
newRecord:
|
|
25584
|
+
oldRecord: i(r),
|
|
25585
|
+
newRecord: i(t)
|
|
25586
25586
|
});
|
|
25587
25587
|
}
|
|
25588
25588
|
}
|
|
25589
25589
|
return n;
|
|
25590
25590
|
}
|
|
25591
|
-
async function
|
|
25591
|
+
async function B(e) {
|
|
25592
25592
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
25593
25593
|
r.add(t.id);
|
|
25594
25594
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25595
25595
|
a && i.add(a);
|
|
25596
25596
|
for (let e of t.children) {
|
|
25597
25597
|
let t = await n.getRecord(e);
|
|
25598
|
-
t && await
|
|
25598
|
+
t && await B({
|
|
25599
25599
|
record: t,
|
|
25600
25600
|
query: n,
|
|
25601
25601
|
ids: r,
|
|
@@ -25605,29 +25605,29 @@ async function R(e) {
|
|
|
25605
25605
|
}
|
|
25606
25606
|
//#endregion
|
|
25607
25607
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
25608
|
-
async function
|
|
25609
|
-
return
|
|
25608
|
+
async function it(e) {
|
|
25609
|
+
return Qe(e);
|
|
25610
25610
|
}
|
|
25611
25611
|
//#endregion
|
|
25612
25612
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
25613
|
-
function
|
|
25613
|
+
function at() {
|
|
25614
25614
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
25615
25615
|
return {
|
|
25616
25616
|
beforeImportRecord: (r) => {
|
|
25617
|
-
let { record: i, ancestry: a } = r, { tagName: o } = i, s =
|
|
25618
|
-
if (s &&
|
|
25617
|
+
let { record: i, ancestry: a } = r, { tagName: o } = i, s = lt(i);
|
|
25618
|
+
if (s && ct.has(o)) {
|
|
25619
25619
|
let t = T({
|
|
25620
25620
|
record: i,
|
|
25621
25621
|
ancestry: a
|
|
25622
25622
|
});
|
|
25623
25623
|
t && e.set(t.path, s);
|
|
25624
25624
|
}
|
|
25625
|
-
if (!
|
|
25625
|
+
if (!st.has(o)) return;
|
|
25626
25626
|
let c = N[o];
|
|
25627
25627
|
for (let e of c) {
|
|
25628
25628
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
25629
25629
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
25630
|
-
let s =
|
|
25630
|
+
let s = ae(e.resolution, e.attribute.path, r, a);
|
|
25631
25631
|
if (!s) {
|
|
25632
25632
|
e.resolution === M.unsupported && n.push({
|
|
25633
25633
|
type: "unsupported-xpath-reference",
|
|
@@ -25683,9 +25683,9 @@ function ot() {
|
|
|
25683
25683
|
}
|
|
25684
25684
|
};
|
|
25685
25685
|
}
|
|
25686
|
-
var
|
|
25687
|
-
function
|
|
25688
|
-
if (!
|
|
25686
|
+
var ot = new Set(Object.entries(m).filter(([, e]) => "uuid" in e).map(([e]) => e)), st = new Set(Object.keys(N)), ct = new Set(Object.values(N).flatMap((e) => e.flatMap((e) => e.target)));
|
|
25687
|
+
function lt(e) {
|
|
25688
|
+
if (!ot.has(e.tagName)) return;
|
|
25689
25689
|
let t = e.attributes.find((e) => e.name === "uuid");
|
|
25690
25690
|
if (t) return t.value;
|
|
25691
25691
|
let n = crypto.randomUUID();
|
|
@@ -25696,14 +25696,14 @@ function ut(e) {
|
|
|
25696
25696
|
}
|
|
25697
25697
|
//#endregion
|
|
25698
25698
|
//#region src/v2019C1/hooks/index.ts
|
|
25699
|
-
var
|
|
25700
|
-
beforeClone:
|
|
25701
|
-
afterStandardizedRecord:
|
|
25702
|
-
afterCreated:
|
|
25703
|
-
afterDeepClone:
|
|
25704
|
-
afterUpdated:
|
|
25705
|
-
beforeDelete:
|
|
25706
|
-
},
|
|
25699
|
+
var ut = {
|
|
25700
|
+
beforeClone: Ze,
|
|
25701
|
+
afterStandardizedRecord: Ke,
|
|
25702
|
+
afterCreated: Ie,
|
|
25703
|
+
afterDeepClone: We,
|
|
25704
|
+
afterUpdated: Xe,
|
|
25705
|
+
beforeDelete: it
|
|
25706
|
+
}, V = {
|
|
25707
25707
|
supportedFileExtensions: [
|
|
25708
25708
|
".fsd",
|
|
25709
25709
|
".asd",
|
|
@@ -25713,8 +25713,8 @@ var dt = {
|
|
|
25713
25713
|
".icd",
|
|
25714
25714
|
".xml"
|
|
25715
25715
|
],
|
|
25716
|
-
hooks:
|
|
25717
|
-
},
|
|
25716
|
+
hooks: at()
|
|
25717
|
+
}, H = {
|
|
25718
25718
|
recordSchema: {
|
|
25719
25719
|
primaryKey: "id",
|
|
25720
25720
|
indexes: [
|
|
@@ -25732,7 +25732,7 @@ var dt = {
|
|
|
25732
25732
|
},
|
|
25733
25733
|
additionalTables: { attachedFiles: { schema: "id, filename, file" } }
|
|
25734
25734
|
}
|
|
25735
|
-
},
|
|
25735
|
+
}, dt = {
|
|
25736
25736
|
default: {
|
|
25737
25737
|
uri: "http://www.iec.ch/61850/2003/SCL",
|
|
25738
25738
|
prefix: ""
|
|
@@ -25740,21 +25740,22 @@ var dt = {
|
|
|
25740
25740
|
v2019C1: {
|
|
25741
25741
|
uri: "http://www.iec.ch/61850/2019/SCL/6-100",
|
|
25742
25742
|
prefix: "eIEC61850-6-100"
|
|
25743
|
-
}
|
|
25744
|
-
|
|
25743
|
+
},
|
|
25744
|
+
xsi: e
|
|
25745
|
+
}, U = {
|
|
25745
25746
|
rootElementName: "SCL",
|
|
25746
|
-
singletonElements:
|
|
25747
|
+
singletonElements: p,
|
|
25747
25748
|
transparentElements: ["Private"],
|
|
25748
|
-
elements:
|
|
25749
|
-
namespaces:
|
|
25750
|
-
attributes:
|
|
25751
|
-
children:
|
|
25752
|
-
parents:
|
|
25753
|
-
descendants:
|
|
25754
|
-
ancestors:
|
|
25755
|
-
database:
|
|
25756
|
-
io:
|
|
25757
|
-
definition:
|
|
25749
|
+
elements: c,
|
|
25750
|
+
namespaces: dt,
|
|
25751
|
+
attributes: m,
|
|
25752
|
+
children: l,
|
|
25753
|
+
parents: u,
|
|
25754
|
+
descendants: d,
|
|
25755
|
+
ancestors: f,
|
|
25756
|
+
database: H,
|
|
25757
|
+
io: V,
|
|
25758
|
+
definition: h
|
|
25758
25759
|
};
|
|
25759
25760
|
//#endregion
|
|
25760
25761
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.ts
|
|
@@ -25799,7 +25800,7 @@ async function pt(e, t) {
|
|
|
25799
25800
|
//#endregion
|
|
25800
25801
|
//#region src/v2019C1/extensions/clean-up/transaction/prune-empty-containers.ts
|
|
25801
25802
|
async function mt(e) {
|
|
25802
|
-
let t = [...Object.values(
|
|
25803
|
+
let t = [...Object.values(De).flat(), "Private"];
|
|
25803
25804
|
for (let n of t) {
|
|
25804
25805
|
let t = await e.getRecordsByTagName(n);
|
|
25805
25806
|
for (let n of t) n.children.length === 0 && await e.delete(n);
|
|
@@ -25822,7 +25823,7 @@ async function ht(e) {
|
|
|
25822
25823
|
}
|
|
25823
25824
|
}
|
|
25824
25825
|
Object.keys(o).length > 0 && await e.update(i, { attributes: o });
|
|
25825
|
-
let s =
|
|
25826
|
+
let s = I.has(n);
|
|
25826
25827
|
r && !a && !s && await e.delete(i);
|
|
25827
25828
|
}
|
|
25828
25829
|
}
|
|
@@ -25839,59 +25840,59 @@ async function gt(e, t, n) {
|
|
|
25839
25840
|
}
|
|
25840
25841
|
//#endregion
|
|
25841
25842
|
//#region src/v2019C1/extensions/clean-up/index.ts
|
|
25842
|
-
var
|
|
25843
|
+
var W = { transaction: /* @__PURE__ */ s({
|
|
25843
25844
|
orphanUuidRefs: () => ht,
|
|
25844
25845
|
pruneEmptyContainers: () => mt,
|
|
25845
25846
|
resetLNode: () => ft
|
|
25846
25847
|
}) };
|
|
25847
25848
|
//#endregion
|
|
25848
25849
|
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
25849
|
-
async function
|
|
25850
|
-
let { records: r } = n,
|
|
25850
|
+
async function _t(e, n) {
|
|
25851
|
+
let { records: r } = n, i = {
|
|
25851
25852
|
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
25852
25853
|
doTypes: /* @__PURE__ */ new Map(),
|
|
25853
25854
|
daTypes: /* @__PURE__ */ new Map(),
|
|
25854
25855
|
enumTypes: /* @__PURE__ */ new Map()
|
|
25855
25856
|
};
|
|
25856
25857
|
for (let n of r) {
|
|
25857
|
-
let r = await
|
|
25858
|
+
let r = await e.getAttribute(n, { name: "lnType" });
|
|
25858
25859
|
if (!r) continue;
|
|
25859
|
-
let [o] = await
|
|
25860
|
+
let [o] = await e.findByAttributes({
|
|
25860
25861
|
tagName: "LNodeType",
|
|
25861
25862
|
attributes: { id: r }
|
|
25862
25863
|
});
|
|
25863
|
-
if (
|
|
25864
|
+
if (a(o, {
|
|
25864
25865
|
key: "ELEMENT_NOT_FOUND",
|
|
25865
25866
|
detail: `LNodeType not found for lnType="${r}"`
|
|
25866
|
-
}), !G(
|
|
25867
|
-
let s = o.children.filter((
|
|
25868
|
-
for (let
|
|
25869
|
-
if (!
|
|
25870
|
-
let n = await
|
|
25867
|
+
}), !G(i.lnodeTypes, r, o)) continue;
|
|
25868
|
+
let s = o.children.filter((e) => t(e, "DO")), c = await e.getRecords(s);
|
|
25869
|
+
for (let t of c) {
|
|
25870
|
+
if (!t) continue;
|
|
25871
|
+
let n = await e.getAttribute(t, { name: "type" });
|
|
25871
25872
|
if (!n) continue;
|
|
25872
|
-
let [r] = await
|
|
25873
|
+
let [r] = await e.findByAttributes({
|
|
25873
25874
|
tagName: "DOType",
|
|
25874
25875
|
attributes: { id: n }
|
|
25875
25876
|
});
|
|
25876
|
-
r && G(
|
|
25877
|
-
query:
|
|
25877
|
+
r && G(i.doTypes, n, r) && await K({
|
|
25878
|
+
query: e,
|
|
25878
25879
|
parent: r,
|
|
25879
|
-
dataModelMap:
|
|
25880
|
+
dataModelMap: i
|
|
25880
25881
|
});
|
|
25881
25882
|
}
|
|
25882
25883
|
}
|
|
25883
25884
|
return {
|
|
25884
|
-
lnodeTypes: Array.from(
|
|
25885
|
-
doTypes: Array.from(
|
|
25886
|
-
daTypes: Array.from(
|
|
25887
|
-
enumTypes: Array.from(
|
|
25885
|
+
lnodeTypes: Array.from(i.lnodeTypes.values()),
|
|
25886
|
+
doTypes: Array.from(i.doTypes.values()),
|
|
25887
|
+
daTypes: Array.from(i.daTypes.values()),
|
|
25888
|
+
enumTypes: Array.from(i.enumTypes.values())
|
|
25888
25889
|
};
|
|
25889
25890
|
}
|
|
25890
25891
|
function G(e, t, n) {
|
|
25891
25892
|
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
25892
25893
|
}
|
|
25893
|
-
async function K(
|
|
25894
|
-
let { query: n, parent: r, dataModelMap: i } =
|
|
25894
|
+
async function K(e) {
|
|
25895
|
+
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")));
|
|
25895
25896
|
for (let e of a) {
|
|
25896
25897
|
if (!e) continue;
|
|
25897
25898
|
let t = await n.getAttribute(e, { name: "bType" }), r = await n.getAttribute(e, { name: "type" });
|
|
@@ -25916,7 +25917,7 @@ async function K(t) {
|
|
|
25916
25917
|
}
|
|
25917
25918
|
}
|
|
25918
25919
|
if (r.tagName === "DOType") {
|
|
25919
|
-
let
|
|
25920
|
+
let e = r.children.filter((e) => t(e, "SDO")), a = await n.getRecords(e);
|
|
25920
25921
|
for (let e of a) {
|
|
25921
25922
|
let t = await n.getAttribute(e, { name: "type" });
|
|
25922
25923
|
if (!t) continue;
|
|
@@ -25934,11 +25935,11 @@ async function K(t) {
|
|
|
25934
25935
|
}
|
|
25935
25936
|
//#endregion
|
|
25936
25937
|
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
25937
|
-
var
|
|
25938
|
+
var vt = /* @__PURE__ */ s({ resolve: () => _t });
|
|
25938
25939
|
//#endregion
|
|
25939
25940
|
//#region src/v2019C1/extensions/data-model/transaction/extract.ts
|
|
25940
|
-
async function
|
|
25941
|
-
let { sourceQuery: n, records: r } = t, i =
|
|
25941
|
+
async function yt(e, t) {
|
|
25942
|
+
let { sourceQuery: n, records: r } = t, i = bt(await _t(n, { records: r })), a = await e.getRoot(), o = await e.ensureChild(a, {
|
|
25942
25943
|
tagName: "DataTypeTemplates",
|
|
25943
25944
|
attributes: {}
|
|
25944
25945
|
});
|
|
@@ -25954,7 +25955,7 @@ async function vt(e, t) {
|
|
|
25954
25955
|
a && await e.deepClone(o, a);
|
|
25955
25956
|
}
|
|
25956
25957
|
}
|
|
25957
|
-
function
|
|
25958
|
+
function bt(e) {
|
|
25958
25959
|
return [
|
|
25959
25960
|
...e.lnodeTypes,
|
|
25960
25961
|
...e.doTypes,
|
|
@@ -25964,13 +25965,13 @@ function yt(e) {
|
|
|
25964
25965
|
}
|
|
25965
25966
|
//#endregion
|
|
25966
25967
|
//#region src/v2019C1/extensions/data-model/index.ts
|
|
25967
|
-
var
|
|
25968
|
-
query:
|
|
25969
|
-
transaction: /* @__PURE__ */
|
|
25968
|
+
var xt = {
|
|
25969
|
+
query: vt,
|
|
25970
|
+
transaction: /* @__PURE__ */ s({ extract: () => yt })
|
|
25970
25971
|
};
|
|
25971
25972
|
//#endregion
|
|
25972
25973
|
//#region src/v2019C1/extensions/history/query/get-sorted-hitem.ts
|
|
25973
|
-
async function
|
|
25974
|
+
async function St(e) {
|
|
25974
25975
|
let t = await e.getRecord({ tagName: "History" });
|
|
25975
25976
|
if (!t) return [];
|
|
25976
25977
|
let { Hitem: n = [] } = await e.findDescendants(t, { collect: "Hitem" });
|
|
@@ -25984,18 +25985,18 @@ async function J(e) {
|
|
|
25984
25985
|
}
|
|
25985
25986
|
//#endregion
|
|
25986
25987
|
//#region src/v2019C1/extensions/history/query/get-latest-hitem.ts
|
|
25987
|
-
async function
|
|
25988
|
-
return (await
|
|
25988
|
+
async function Ct(e) {
|
|
25989
|
+
return (await St(e)).at(-1);
|
|
25989
25990
|
}
|
|
25990
25991
|
//#endregion
|
|
25991
25992
|
//#region src/v2019C1/extensions/history/query/index.ts
|
|
25992
|
-
var
|
|
25993
|
-
getLatestHitem: () =>
|
|
25994
|
-
getSortedHitems: () =>
|
|
25993
|
+
var wt = /* @__PURE__ */ s({
|
|
25994
|
+
getLatestHitem: () => Ct,
|
|
25995
|
+
getSortedHitems: () => St
|
|
25995
25996
|
});
|
|
25996
25997
|
//#endregion
|
|
25997
25998
|
//#region src/v2019C1/extensions/history/transaction/add-entry.ts
|
|
25998
|
-
async function
|
|
25999
|
+
async function Tt(e, t) {
|
|
25999
26000
|
let { filename: n, header: r, item: i } = t, { id: a, fileType: o, nameStructure: s, version: c, tool: l } = r, { who: u, what: d, why: f } = i, p = await e.getRoot(), m = await e.getRecord({ tagName: "Header" }) ?? await e.addChild(p, {
|
|
26000
26001
|
tagName: "Header",
|
|
26001
26002
|
attributes: {
|
|
@@ -26010,18 +26011,18 @@ async function St(e, t) {
|
|
|
26010
26011
|
}), h = await e.getRecord({ tagName: "History" }) ?? await e.addChild(m, {
|
|
26011
26012
|
tagName: "History",
|
|
26012
26013
|
attributes: {}
|
|
26013
|
-
}), g = await
|
|
26014
|
+
}), g = await Ct(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";
|
|
26014
26015
|
await e.update(m, { attributes: {
|
|
26015
26016
|
version: y,
|
|
26016
26017
|
revision: b
|
|
26017
26018
|
} });
|
|
26018
|
-
let x = /* @__PURE__ */ new Date(), S = x.toString().split(" "),
|
|
26019
|
+
let x = /* @__PURE__ */ new Date(), S = x.toString().split(" "), C = x.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), ee = `${S[0]} ${S[1]} ${S[2]} ${S[4]} ${C} ${S[3]}`;
|
|
26019
26020
|
await e.addChild(h, {
|
|
26020
26021
|
tagName: "Hitem",
|
|
26021
26022
|
attributes: {
|
|
26022
26023
|
version: y,
|
|
26023
26024
|
revision: b,
|
|
26024
|
-
when:
|
|
26025
|
+
when: ee,
|
|
26025
26026
|
who: u,
|
|
26026
26027
|
what: d,
|
|
26027
26028
|
why: f
|
|
@@ -26033,10 +26034,10 @@ async function St(e, t) {
|
|
|
26033
26034
|
}
|
|
26034
26035
|
//#endregion
|
|
26035
26036
|
//#region src/v2019C1/extensions/history/index.ts
|
|
26036
|
-
var
|
|
26037
|
-
query:
|
|
26038
|
-
transaction: /* @__PURE__ */
|
|
26039
|
-
},
|
|
26037
|
+
var q = {
|
|
26038
|
+
query: wt,
|
|
26039
|
+
transaction: /* @__PURE__ */ s({ addEntry: () => Tt })
|
|
26040
|
+
}, Et = {
|
|
26040
26041
|
LNode: {
|
|
26041
26042
|
compact: [
|
|
26042
26043
|
"prefix",
|
|
@@ -26123,13 +26124,13 @@ var Y = {
|
|
|
26123
26124
|
};
|
|
26124
26125
|
//#endregion
|
|
26125
26126
|
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26126
|
-
async function
|
|
26127
|
+
async function Dt(e, t, n = {}) {
|
|
26127
26128
|
let r = await e.getRecord(t);
|
|
26128
26129
|
if (!r) return n.withLabels ? {
|
|
26129
26130
|
title: "",
|
|
26130
26131
|
labels: {}
|
|
26131
26132
|
} : "";
|
|
26132
|
-
let i = r.tagName, a =
|
|
26133
|
+
let i = r.tagName, a = Ot({
|
|
26133
26134
|
tag: i,
|
|
26134
26135
|
mode: n.mode ?? "compact",
|
|
26135
26136
|
attributes: await e.any.getAttributes(r),
|
|
@@ -26137,24 +26138,24 @@ async function wt(e, t, n = {}) {
|
|
|
26137
26138
|
});
|
|
26138
26139
|
return n.withLabels ? {
|
|
26139
26140
|
title: a,
|
|
26140
|
-
labels: await
|
|
26141
|
+
labels: await kt(e, r)
|
|
26141
26142
|
} : a;
|
|
26142
26143
|
}
|
|
26143
|
-
function
|
|
26144
|
-
let { tag: t, mode: n, attributes: r, value: i } = e, a =
|
|
26144
|
+
function Ot(e) {
|
|
26145
|
+
let { tag: t, mode: n, attributes: r, value: i } = e, a = Et[t];
|
|
26145
26146
|
if (a) {
|
|
26146
|
-
let e =
|
|
26147
|
+
let e = Mt(a, r, n);
|
|
26147
26148
|
if (e) return e;
|
|
26148
26149
|
}
|
|
26149
26150
|
let o = (i ?? "").trim();
|
|
26150
26151
|
if (o) return o;
|
|
26151
|
-
let s =
|
|
26152
|
+
let s = h[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
|
|
26152
26153
|
return c && r[c] ? r[c] : r.name || t;
|
|
26153
26154
|
}
|
|
26154
|
-
async function
|
|
26155
|
-
return
|
|
26155
|
+
async function kt(e, t) {
|
|
26156
|
+
return jt(await At(e, t));
|
|
26156
26157
|
}
|
|
26157
|
-
async function
|
|
26158
|
+
async function At(e, t) {
|
|
26158
26159
|
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26159
26160
|
for (let t of r) {
|
|
26160
26161
|
let r = await e.any.getChildren(t, "Label");
|
|
@@ -26169,26 +26170,26 @@ async function Dt(e, t) {
|
|
|
26169
26170
|
}
|
|
26170
26171
|
return n;
|
|
26171
26172
|
}
|
|
26172
|
-
function
|
|
26173
|
+
function jt(e) {
|
|
26173
26174
|
let t = {};
|
|
26174
26175
|
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26175
26176
|
return t;
|
|
26176
26177
|
}
|
|
26177
|
-
function
|
|
26178
|
+
function Mt(e, t, n) {
|
|
26178
26179
|
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26179
|
-
if (typeof i == "string") return
|
|
26180
|
+
if (typeof i == "string") return Nt(i, t);
|
|
26180
26181
|
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26181
26182
|
return o.length > 0 ? o.join(a) : "";
|
|
26182
26183
|
}
|
|
26183
|
-
function
|
|
26184
|
+
function Nt(e, t) {
|
|
26184
26185
|
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("/");
|
|
26185
26186
|
}
|
|
26186
26187
|
//#endregion
|
|
26187
26188
|
//#region src/v2019C1/extensions/presentation/index.ts
|
|
26188
|
-
var
|
|
26189
|
+
var Pt = { query: /* @__PURE__ */ s({ extractElementTitle: () => Dt }) };
|
|
26189
26190
|
//#endregion
|
|
26190
26191
|
//#region src/v2019C1/extensions/template/transaction/ensure-substation-structure.ts
|
|
26191
|
-
async function
|
|
26192
|
+
async function J(e) {
|
|
26192
26193
|
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
26193
26194
|
tagName: "Substation",
|
|
26194
26195
|
attributes: { name: "TEMPLATE" }
|
|
@@ -26207,50 +26208,50 @@ async function X(e) {
|
|
|
26207
26208
|
}
|
|
26208
26209
|
//#endregion
|
|
26209
26210
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-utils.ts
|
|
26210
|
-
var
|
|
26211
|
+
var Ft = {
|
|
26211
26212
|
scope: "tree",
|
|
26212
26213
|
attributes: ["templateUuid", "originUuid"]
|
|
26213
26214
|
};
|
|
26214
|
-
async function
|
|
26215
|
-
let { sourceQuery:
|
|
26215
|
+
async function Y(e, t) {
|
|
26216
|
+
let { sourceQuery: n, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = Ft } = t, l = await n.getTree(i, { omit: o });
|
|
26216
26217
|
if (!l) return;
|
|
26217
26218
|
let u = s && l.tagName === s.from ? {
|
|
26218
26219
|
...l,
|
|
26219
26220
|
tagName: s.to
|
|
26220
26221
|
} : l, d = u;
|
|
26221
|
-
c && (d = c.scope === "tree" ?
|
|
26222
|
+
c && (d = c.scope === "tree" ? r(u, c.attributes) : {
|
|
26222
26223
|
...u,
|
|
26223
26224
|
attributes: u.attributes.filter((e) => !c.attributes.includes(e.name))
|
|
26224
26225
|
}), await e.deepClone(a, d);
|
|
26225
26226
|
}
|
|
26226
26227
|
//#endregion
|
|
26227
26228
|
//#region src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts
|
|
26228
|
-
async function
|
|
26229
|
+
async function It(e, t) {
|
|
26229
26230
|
let { sourceQuery: n, scopeRef: r } = t, { LNode: i = [] } = await n.findDescendants(r, { collect: "LNode" });
|
|
26230
|
-
i.length > 0 && await
|
|
26231
|
+
i.length > 0 && await xt.transaction.extract(e, {
|
|
26231
26232
|
sourceQuery: n,
|
|
26232
26233
|
records: i
|
|
26233
26234
|
});
|
|
26234
26235
|
}
|
|
26235
26236
|
//#endregion
|
|
26236
26237
|
//#region src/v2019C1/extensions/template/transaction/shared/resolve-structure-ref.ts
|
|
26237
|
-
async function
|
|
26238
|
+
async function X(e, t, n) {
|
|
26238
26239
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26239
|
-
|
|
26240
|
+
a(r, {
|
|
26240
26241
|
key: "ELEMENT_NOT_FOUND",
|
|
26241
26242
|
detail: `No Substation/VoltageLevel/Bay ancestor found for ${t.tagName}`
|
|
26242
26243
|
});
|
|
26243
|
-
let
|
|
26244
|
+
let i = n[r.tagName];
|
|
26244
26245
|
return {
|
|
26245
|
-
tagName:
|
|
26246
|
-
id:
|
|
26246
|
+
tagName: i.tagName,
|
|
26247
|
+
id: i.id
|
|
26247
26248
|
};
|
|
26248
26249
|
}
|
|
26249
26250
|
//#endregion
|
|
26250
26251
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-function.ts
|
|
26251
|
-
async function
|
|
26252
|
+
async function Lt(e, t) {
|
|
26252
26253
|
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t;
|
|
26253
|
-
await
|
|
26254
|
+
await Y(e, {
|
|
26254
26255
|
sourceQuery: n,
|
|
26255
26256
|
ref: r,
|
|
26256
26257
|
targetParent: i,
|
|
@@ -26263,39 +26264,39 @@ async function Pt(e, t) {
|
|
|
26263
26264
|
scope: "root",
|
|
26264
26265
|
attributes: [...o]
|
|
26265
26266
|
} : !1
|
|
26266
|
-
}), await
|
|
26267
|
+
}), await It(e, {
|
|
26267
26268
|
sourceQuery: n,
|
|
26268
26269
|
scopeRef: r
|
|
26269
26270
|
});
|
|
26270
26271
|
}
|
|
26271
|
-
async function
|
|
26272
|
-
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await
|
|
26272
|
+
async function Rt(e, t) {
|
|
26273
|
+
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await zt(n, r);
|
|
26273
26274
|
for (let t of o) {
|
|
26274
|
-
if (await
|
|
26275
|
+
if (await Vt(e, n, t)) continue;
|
|
26275
26276
|
let r = {
|
|
26276
26277
|
tagName: "FunctionCategory",
|
|
26277
26278
|
id: t
|
|
26278
26279
|
};
|
|
26279
|
-
await
|
|
26280
|
+
await Y(e, {
|
|
26280
26281
|
sourceQuery: n,
|
|
26281
26282
|
ref: r,
|
|
26282
|
-
targetParent: await
|
|
26283
|
+
targetParent: await X(n, r, i),
|
|
26283
26284
|
...a ? {} : { strip: !1 }
|
|
26284
26285
|
});
|
|
26285
26286
|
}
|
|
26286
26287
|
}
|
|
26287
|
-
async function
|
|
26288
|
-
let n = await
|
|
26288
|
+
async function zt(e, t) {
|
|
26289
|
+
let n = await Bt(e, t), r = /* @__PURE__ */ new Set();
|
|
26289
26290
|
for (let { container: e } of n) e && r.add(e.id);
|
|
26290
26291
|
return r;
|
|
26291
26292
|
}
|
|
26292
|
-
async function
|
|
26293
|
-
let n = await
|
|
26293
|
+
async function Bt(e, t) {
|
|
26294
|
+
let n = await L.query.findRefsPointingTo(e, {
|
|
26294
26295
|
target: t,
|
|
26295
26296
|
containerTagName: "FunctionCategory"
|
|
26296
26297
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
26297
26298
|
for (let t of r) {
|
|
26298
|
-
let r = await
|
|
26299
|
+
let r = await L.query.findRefsPointingTo(e, {
|
|
26299
26300
|
target: {
|
|
26300
26301
|
tagName: "SubFunction",
|
|
26301
26302
|
id: t.id
|
|
@@ -26306,7 +26307,7 @@ async function Lt(e, t) {
|
|
|
26306
26307
|
}
|
|
26307
26308
|
return n;
|
|
26308
26309
|
}
|
|
26309
|
-
async function
|
|
26310
|
+
async function Vt(e, t, n) {
|
|
26310
26311
|
let r = await t.getRecord({
|
|
26311
26312
|
tagName: "FunctionCategory",
|
|
26312
26313
|
id: n
|
|
@@ -26322,7 +26323,7 @@ async function Rt(e, t, n) {
|
|
|
26322
26323
|
}
|
|
26323
26324
|
//#endregion
|
|
26324
26325
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-referenced.ts
|
|
26325
|
-
async function
|
|
26326
|
+
async function Z(e, t) {
|
|
26326
26327
|
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a } = t, o = N[i][0].attribute.uuid, { [i]: s = [] } = await n.findDescendants(r, { collect: i }), c = /* @__PURE__ */ new Set();
|
|
26327
26328
|
for (let e of s) {
|
|
26328
26329
|
let t = e.attributes.find((e) => e.name === o)?.value;
|
|
@@ -26346,22 +26347,22 @@ async function zt(e, t) {
|
|
|
26346
26347
|
}
|
|
26347
26348
|
return l;
|
|
26348
26349
|
}
|
|
26349
|
-
async function
|
|
26350
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await
|
|
26350
|
+
async function Ht(e, t) {
|
|
26351
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await Z(e, {
|
|
26351
26352
|
sourceQuery: n,
|
|
26352
26353
|
scopeRef: r,
|
|
26353
26354
|
refTagName: i,
|
|
26354
26355
|
targetTagName: a
|
|
26355
26356
|
});
|
|
26356
|
-
for (let t of c) await
|
|
26357
|
+
for (let t of c) await Y(e, {
|
|
26357
26358
|
sourceQuery: n,
|
|
26358
26359
|
ref: t,
|
|
26359
26360
|
targetParent: o,
|
|
26360
26361
|
omit: s
|
|
26361
26362
|
});
|
|
26362
26363
|
}
|
|
26363
|
-
async function
|
|
26364
|
-
let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c =
|
|
26364
|
+
async function Ut(e, t) {
|
|
26365
|
+
let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = d[r].filter((e) => e in N && !o.has(e)), l = Ht;
|
|
26365
26366
|
for (let t of c) for (let r of N[t]) for (let o of r.target) await l(e, {
|
|
26366
26367
|
sourceQuery: n,
|
|
26367
26368
|
scopeRef: i,
|
|
@@ -26373,13 +26374,13 @@ async function Vt(e, t) {
|
|
|
26373
26374
|
}
|
|
26374
26375
|
//#endregion
|
|
26375
26376
|
//#region src/v2019C1/extensions/template/transaction/shared/omit-filters.ts
|
|
26376
|
-
var
|
|
26377
|
+
var Q = [
|
|
26377
26378
|
"FunctionSclRef",
|
|
26378
26379
|
"ApplicationSclRef",
|
|
26379
26380
|
"GeneralEquipment",
|
|
26380
26381
|
"ConductingEquipment"
|
|
26381
|
-
],
|
|
26382
|
-
|
|
26382
|
+
], Wt = [
|
|
26383
|
+
...Q,
|
|
26383
26384
|
"DOS",
|
|
26384
26385
|
"Labels",
|
|
26385
26386
|
"LNodeInputs",
|
|
@@ -26391,52 +26392,52 @@ var $ = [
|
|
|
26391
26392
|
];
|
|
26392
26393
|
//#endregion
|
|
26393
26394
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-application.ts
|
|
26394
|
-
async function
|
|
26395
|
+
async function Gt(e, t) {
|
|
26395
26396
|
let { sourceQuery: n, applicationRef: r, structure: i } = t, a = {
|
|
26396
26397
|
tagName: "Substation",
|
|
26397
26398
|
id: i.Substation.id
|
|
26398
|
-
}, o = await
|
|
26399
|
+
}, o = await Z(e, {
|
|
26399
26400
|
sourceQuery: n,
|
|
26400
26401
|
scopeRef: r,
|
|
26401
26402
|
refTagName: "FunctionRef",
|
|
26402
26403
|
targetTagName: "Function"
|
|
26403
26404
|
});
|
|
26404
|
-
for (let t of o) await
|
|
26405
|
+
for (let t of o) await Lt(e, {
|
|
26405
26406
|
sourceQuery: n,
|
|
26406
26407
|
functionRef: t,
|
|
26407
|
-
targetParentRef: await
|
|
26408
|
-
omit:
|
|
26408
|
+
targetParentRef: await X(n, t, i),
|
|
26409
|
+
omit: Q
|
|
26409
26410
|
});
|
|
26410
|
-
for (let t of o) await
|
|
26411
|
+
for (let t of o) await Rt(e, {
|
|
26411
26412
|
sourceQuery: n,
|
|
26412
26413
|
functionRef: t,
|
|
26413
26414
|
structure: i,
|
|
26414
26415
|
stripCategoriesUuid: !1
|
|
26415
26416
|
});
|
|
26416
|
-
await
|
|
26417
|
+
await Ut(e, {
|
|
26417
26418
|
sourceQuery: n,
|
|
26418
26419
|
scopeTagName: "Application",
|
|
26419
26420
|
scopeRef: r,
|
|
26420
26421
|
targetParent: a,
|
|
26421
26422
|
skip: new Set(["FunctionRef", "FunctionCategoryRef"]),
|
|
26422
|
-
omit:
|
|
26423
|
-
}), await
|
|
26423
|
+
omit: Q
|
|
26424
|
+
}), await Y(e, {
|
|
26424
26425
|
sourceQuery: n,
|
|
26425
26426
|
ref: r,
|
|
26426
|
-
targetParent: await
|
|
26427
|
-
omit:
|
|
26427
|
+
targetParent: await X(n, r, i),
|
|
26428
|
+
omit: Q
|
|
26428
26429
|
});
|
|
26429
26430
|
}
|
|
26430
26431
|
//#endregion
|
|
26431
26432
|
//#region src/v2019C1/extensions/template/transaction/shared/post-extraction-cleanup.ts
|
|
26432
|
-
async function
|
|
26433
|
-
await
|
|
26433
|
+
async function $(e) {
|
|
26434
|
+
await W.transaction.orphanUuidRefs(e), await W.transaction.resetLNode(e), await W.transaction.pruneEmptyContainers(e);
|
|
26434
26435
|
}
|
|
26435
26436
|
//#endregion
|
|
26436
26437
|
//#region src/v2019C1/extensions/template/transaction/asd/extract-to-asd.ts
|
|
26437
|
-
async function
|
|
26438
|
-
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
26439
|
-
await
|
|
26438
|
+
async function Kt(e, t) {
|
|
26439
|
+
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await J(e), c = await e.getAttribute(r, { name: "name" }) || "Unnamed Application";
|
|
26440
|
+
await q.transaction.addEntry(e, {
|
|
26440
26441
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
26441
26442
|
header: {
|
|
26442
26443
|
fileType: "ASD",
|
|
@@ -26449,20 +26450,20 @@ async function Gt(e, t) {
|
|
|
26449
26450
|
what: "ASD initialization",
|
|
26450
26451
|
why: "Application was extracted from a previous file"
|
|
26451
26452
|
}
|
|
26452
|
-
}), await
|
|
26453
|
+
}), await Gt(e, {
|
|
26453
26454
|
sourceQuery: n,
|
|
26454
26455
|
applicationRef: r,
|
|
26455
26456
|
structure: s
|
|
26456
|
-
}), await
|
|
26457
|
+
}), await $(e);
|
|
26457
26458
|
}
|
|
26458
26459
|
//#endregion
|
|
26459
26460
|
//#region src/v2019C1/extensions/template/transaction/fsd/extract-to-fsd.ts
|
|
26460
|
-
async function
|
|
26461
|
-
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
26461
|
+
async function qt(e, t) {
|
|
26462
|
+
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await J(e), c = {
|
|
26462
26463
|
tagName: s.Substation.tagName,
|
|
26463
26464
|
id: s.Substation.id
|
|
26464
26465
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
26465
|
-
await
|
|
26466
|
+
await q.transaction.addEntry(e, {
|
|
26466
26467
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
26467
26468
|
header: {
|
|
26468
26469
|
fileType: "FSD",
|
|
@@ -26475,31 +26476,31 @@ async function Kt(e, t) {
|
|
|
26475
26476
|
what: "FSD initialization",
|
|
26476
26477
|
why: "Function was extracted from a previous file"
|
|
26477
26478
|
}
|
|
26478
|
-
}), await
|
|
26479
|
+
}), await Lt(e, {
|
|
26479
26480
|
sourceQuery: n,
|
|
26480
26481
|
functionRef: r,
|
|
26481
26482
|
targetParentRef: c,
|
|
26482
|
-
omit:
|
|
26483
|
+
omit: Wt,
|
|
26483
26484
|
stripRootAttributes: ["templateUuid"]
|
|
26484
|
-
}), await
|
|
26485
|
+
}), await Rt(e, {
|
|
26485
26486
|
sourceQuery: n,
|
|
26486
26487
|
functionRef: r,
|
|
26487
26488
|
structure: s
|
|
26488
|
-
}), await
|
|
26489
|
+
}), await $(e);
|
|
26489
26490
|
}
|
|
26490
26491
|
//#endregion
|
|
26491
26492
|
//#region src/v2019C1/extensions/index.ts
|
|
26492
|
-
var
|
|
26493
|
-
cleanUp:
|
|
26494
|
-
dataModel:
|
|
26495
|
-
history:
|
|
26496
|
-
reference:
|
|
26497
|
-
template: { transaction: /* @__PURE__ */
|
|
26498
|
-
ensureSubstationTemplateStructure: () =>
|
|
26499
|
-
extractToAsd: () =>
|
|
26500
|
-
extractToFsd: () =>
|
|
26493
|
+
var Jt = {
|
|
26494
|
+
cleanUp: W,
|
|
26495
|
+
dataModel: xt,
|
|
26496
|
+
history: q,
|
|
26497
|
+
reference: L,
|
|
26498
|
+
template: { transaction: /* @__PURE__ */ s({
|
|
26499
|
+
ensureSubstationTemplateStructure: () => J,
|
|
26500
|
+
extractToAsd: () => Kt,
|
|
26501
|
+
extractToFsd: () => qt
|
|
26501
26502
|
}) },
|
|
26502
|
-
presentation:
|
|
26503
|
+
presentation: Pt
|
|
26503
26504
|
};
|
|
26504
26505
|
//#endregion
|
|
26505
|
-
export {
|
|
26506
|
+
export { dt as a, V as i, H as n, ut as o, U as r, Jt as t };
|