@dialecte/scl 0.2.13 → 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-BBb7Goo6.js → extensions-BQYiSBug.js} +405 -400
- 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,30 +24637,34 @@ 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;
|
|
24656
24656
|
continue;
|
|
24657
24657
|
}
|
|
24658
|
-
if (n.segment === c.segment && n.separator === c.separator)
|
|
24659
|
-
|
|
24660
|
-
|
|
24661
|
-
|
|
24662
|
-
|
|
24663
|
-
|
|
24658
|
+
if (n.segment === c.segment && n.separator === c.separator) {
|
|
24659
|
+
let n = await j({
|
|
24660
|
+
query: t,
|
|
24661
|
+
current: e,
|
|
24662
|
+
segments: r,
|
|
24663
|
+
index: a + 1
|
|
24664
|
+
});
|
|
24665
|
+
if (n) return n;
|
|
24666
|
+
continue;
|
|
24667
|
+
}
|
|
24664
24668
|
}
|
|
24665
24669
|
}
|
|
24666
24670
|
//#endregion
|
|
@@ -25043,7 +25047,7 @@ var M = {
|
|
|
25043
25047
|
};
|
|
25044
25048
|
//#endregion
|
|
25045
25049
|
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25046
|
-
function
|
|
25050
|
+
function we(e) {
|
|
25047
25051
|
let t = {};
|
|
25048
25052
|
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25049
25053
|
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
@@ -25058,7 +25062,7 @@ function Ce(e) {
|
|
|
25058
25062
|
}
|
|
25059
25063
|
return t;
|
|
25060
25064
|
}
|
|
25061
|
-
function
|
|
25065
|
+
function Te(e) {
|
|
25062
25066
|
let t = /* @__PURE__ */ new Map();
|
|
25063
25067
|
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25064
25068
|
uuidAttr: e.attribute.uuid,
|
|
@@ -25070,16 +25074,16 @@ function we(e) {
|
|
|
25070
25074
|
}
|
|
25071
25075
|
//#endregion
|
|
25072
25076
|
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25073
|
-
var P =
|
|
25077
|
+
var P = we(N), F = [
|
|
25074
25078
|
M.direct,
|
|
25075
25079
|
M.lnode,
|
|
25076
25080
|
M.iedAddress,
|
|
25077
25081
|
M.behaviorDescription
|
|
25078
|
-
], Ee =
|
|
25082
|
+
], Ee = Te(N);
|
|
25079
25083
|
[...new Set(Object.values(N).flatMap((e) => e.map((e) => e.attribute.uuid)))];
|
|
25080
25084
|
//#endregion
|
|
25081
25085
|
//#region src/v2019C1/extensions/reference/constants/orphan-rules.ts
|
|
25082
|
-
var
|
|
25086
|
+
var I = new Set([
|
|
25083
25087
|
"SourceRef",
|
|
25084
25088
|
"ControlRef",
|
|
25085
25089
|
"DOS",
|
|
@@ -25088,7 +25092,7 @@ var De = new Set([
|
|
|
25088
25092
|
"InputVar",
|
|
25089
25093
|
"OutputVar",
|
|
25090
25094
|
"ProcessEcho"
|
|
25091
|
-
]),
|
|
25095
|
+
]), De = {
|
|
25092
25096
|
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25093
25097
|
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25094
25098
|
Resource: ["ProcessResource", "ProcessResources"],
|
|
@@ -25096,22 +25100,22 @@ var De = new Set([
|
|
|
25096
25100
|
};
|
|
25097
25101
|
//#endregion
|
|
25098
25102
|
//#region src/v2019C1/extensions/reference/query/find/find-refs-pointing-to.ts
|
|
25099
|
-
async function
|
|
25100
|
-
let { target: r, containerTagName: i } =
|
|
25103
|
+
async function Oe(e, t) {
|
|
25104
|
+
let { target: r, containerTagName: i } = t, a = await e.getRecord(r);
|
|
25101
25105
|
if (!a) return [];
|
|
25102
25106
|
let o = a.attributes.find((e) => e.name === "uuid")?.value;
|
|
25103
25107
|
if (!o) return [];
|
|
25104
|
-
let s =
|
|
25108
|
+
let s = ke(a.tagName);
|
|
25105
25109
|
if (s.length === 0) return [];
|
|
25106
25110
|
let c = [];
|
|
25107
|
-
for (let
|
|
25108
|
-
if (!t
|
|
25111
|
+
for (let t of s) {
|
|
25112
|
+
if (!n(t.refTagName, U)) continue;
|
|
25109
25113
|
let r = await e.findByAttributes({
|
|
25110
|
-
tagName:
|
|
25111
|
-
attributes: { [
|
|
25114
|
+
tagName: t.refTagName,
|
|
25115
|
+
attributes: { [t.uuidAttr]: o }
|
|
25112
25116
|
});
|
|
25113
25117
|
for (let t of r) {
|
|
25114
|
-
let n = i ? await
|
|
25118
|
+
let n = i ? await Ae(e, t, i) : void 0;
|
|
25115
25119
|
c.push({
|
|
25116
25120
|
ref: t,
|
|
25117
25121
|
container: n
|
|
@@ -25120,50 +25124,50 @@ async function ke(e, n) {
|
|
|
25120
25124
|
}
|
|
25121
25125
|
return c;
|
|
25122
25126
|
}
|
|
25123
|
-
function
|
|
25127
|
+
function ke(e) {
|
|
25124
25128
|
let t = [];
|
|
25125
|
-
for (let n of
|
|
25129
|
+
for (let n of F) {
|
|
25126
25130
|
let r = P[n].get(e);
|
|
25127
25131
|
r && t.push(...r);
|
|
25128
25132
|
}
|
|
25129
25133
|
return t;
|
|
25130
25134
|
}
|
|
25131
|
-
async function
|
|
25135
|
+
async function Ae(e, t, n) {
|
|
25132
25136
|
return (await e.findAncestors(t, { stopAtTagName: n })).find((e) => e.tagName === n);
|
|
25133
25137
|
}
|
|
25134
25138
|
//#endregion
|
|
25135
25139
|
//#region src/v2019C1/extensions/reference/index.ts
|
|
25136
|
-
var
|
|
25140
|
+
var L = { query: /* @__PURE__ */ s({
|
|
25137
25141
|
buildElementPath: () => re,
|
|
25138
25142
|
buildReferencePath: () => k,
|
|
25139
|
-
findRefsPointingTo: () =>
|
|
25140
|
-
resolveElementPath: () =>
|
|
25141
|
-
resolveReferencePath: () =>
|
|
25143
|
+
findRefsPointingTo: () => Oe,
|
|
25144
|
+
resolveElementPath: () => Ce,
|
|
25145
|
+
resolveReferencePath: () => pe
|
|
25142
25146
|
}) };
|
|
25143
25147
|
//#endregion
|
|
25144
25148
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
25145
|
-
async function
|
|
25146
|
-
let { uuid:
|
|
25147
|
-
if (!
|
|
25148
|
-
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 = [];
|
|
25149
25153
|
for (let e of s) {
|
|
25150
|
-
if (e.attributes.find((e) => e.name ===
|
|
25151
|
-
let
|
|
25154
|
+
if (e.attributes.find((e) => e.name === r.uuidAttr)?.value !== t) continue;
|
|
25155
|
+
let n = {
|
|
25152
25156
|
tagName: e.tagName,
|
|
25153
25157
|
id: e.id
|
|
25154
|
-
}, s = await
|
|
25155
|
-
reference:
|
|
25158
|
+
}, s = await L.query.buildReferencePath(o, {
|
|
25159
|
+
reference: n,
|
|
25156
25160
|
target: a
|
|
25157
25161
|
});
|
|
25158
|
-
if (!s || e.attributes.find((e) => e.name ===
|
|
25159
|
-
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 ? {
|
|
25160
25164
|
...e,
|
|
25161
25165
|
value: s
|
|
25162
25166
|
} : e);
|
|
25163
25167
|
c.push({
|
|
25164
25168
|
status: "updated",
|
|
25165
|
-
oldRecord:
|
|
25166
|
-
newRecord:
|
|
25169
|
+
oldRecord: i(e),
|
|
25170
|
+
newRecord: i({
|
|
25167
25171
|
...e,
|
|
25168
25172
|
attributes: l
|
|
25169
25173
|
})
|
|
@@ -25171,9 +25175,9 @@ async function I(e) {
|
|
|
25171
25175
|
}
|
|
25172
25176
|
return c;
|
|
25173
25177
|
}
|
|
25174
|
-
function
|
|
25178
|
+
function z(e) {
|
|
25175
25179
|
let t = [];
|
|
25176
|
-
for (let n of
|
|
25180
|
+
for (let n of F) {
|
|
25177
25181
|
let r = P[n].get(e);
|
|
25178
25182
|
r && t.push(...r);
|
|
25179
25183
|
}
|
|
@@ -25181,22 +25185,22 @@ function L(e) {
|
|
|
25181
25185
|
}
|
|
25182
25186
|
//#endregion
|
|
25183
25187
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
25184
|
-
async function
|
|
25185
|
-
let { childRecord: t, query: n } = e, r = await
|
|
25188
|
+
async function je(e) {
|
|
25189
|
+
let { childRecord: t, query: n } = e, r = await Me({
|
|
25186
25190
|
childRecord: t,
|
|
25187
25191
|
query: n
|
|
25188
|
-
}), i = await
|
|
25192
|
+
}), i = await Fe({
|
|
25189
25193
|
childRecord: t,
|
|
25190
25194
|
query: n
|
|
25191
25195
|
});
|
|
25192
25196
|
return [...r, ...i];
|
|
25193
25197
|
}
|
|
25194
|
-
async function
|
|
25198
|
+
async function Me(e) {
|
|
25195
25199
|
let { childRecord: t, query: n } = e, r = Ee.get(t.tagName);
|
|
25196
25200
|
if (!r?.length) return [];
|
|
25197
25201
|
let i = [];
|
|
25198
25202
|
for (let e of r) {
|
|
25199
|
-
let r = await
|
|
25203
|
+
let r = await Ne({
|
|
25200
25204
|
childRecord: t,
|
|
25201
25205
|
pair: e,
|
|
25202
25206
|
query: n
|
|
@@ -25205,10 +25209,10 @@ async function Ne(e) {
|
|
|
25205
25209
|
}
|
|
25206
25210
|
return i;
|
|
25207
25211
|
}
|
|
25208
|
-
async function
|
|
25212
|
+
async function Ne(e) {
|
|
25209
25213
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
25210
25214
|
if (!i) return null;
|
|
25211
|
-
let a = await
|
|
25215
|
+
let a = await Pe({
|
|
25212
25216
|
uuidValue: i,
|
|
25213
25217
|
targetTagNames: n.targetTagNames,
|
|
25214
25218
|
query: r
|
|
@@ -25238,11 +25242,11 @@ async function Pe(e) {
|
|
|
25238
25242
|
}
|
|
25239
25243
|
};
|
|
25240
25244
|
}
|
|
25241
|
-
async function
|
|
25242
|
-
let { uuidValue:
|
|
25245
|
+
async function Pe(e) {
|
|
25246
|
+
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
25243
25247
|
for (let e of r) {
|
|
25244
|
-
if (!
|
|
25245
|
-
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);
|
|
25246
25250
|
if (r) return {
|
|
25247
25251
|
tagName: r.tagName,
|
|
25248
25252
|
id: r.id
|
|
@@ -25250,17 +25254,17 @@ async function Fe(e) {
|
|
|
25250
25254
|
}
|
|
25251
25255
|
return null;
|
|
25252
25256
|
}
|
|
25253
|
-
async function
|
|
25257
|
+
async function Fe(e) {
|
|
25254
25258
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25255
25259
|
if (!r) return [];
|
|
25256
|
-
let i =
|
|
25260
|
+
let i = z(t.tagName);
|
|
25257
25261
|
if (i.length === 0) return [];
|
|
25258
25262
|
let a = {
|
|
25259
25263
|
tagName: t.tagName,
|
|
25260
25264
|
id: t.id
|
|
25261
25265
|
}, o = [];
|
|
25262
25266
|
for (let e of i) {
|
|
25263
|
-
let t = await
|
|
25267
|
+
let t = await R({
|
|
25264
25268
|
uuid: r,
|
|
25265
25269
|
entry: e,
|
|
25266
25270
|
target: a,
|
|
@@ -25272,12 +25276,12 @@ async function Ie(e) {
|
|
|
25272
25276
|
}
|
|
25273
25277
|
//#endregion
|
|
25274
25278
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
25275
|
-
async function
|
|
25276
|
-
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({
|
|
25277
25281
|
childRecord: t,
|
|
25278
25282
|
parentRecord: n,
|
|
25279
25283
|
query: r
|
|
25280
|
-
}), a = await
|
|
25284
|
+
}), a = await je({
|
|
25281
25285
|
childRecord: t,
|
|
25282
25286
|
query: r
|
|
25283
25287
|
});
|
|
@@ -25285,12 +25289,12 @@ async function Le(e) {
|
|
|
25285
25289
|
}
|
|
25286
25290
|
//#endregion
|
|
25287
25291
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
25288
|
-
async function
|
|
25289
|
-
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);
|
|
25290
25294
|
if (r.size === 0) return [];
|
|
25291
25295
|
let a = [];
|
|
25292
25296
|
for (let { target: e } of t) {
|
|
25293
|
-
let t = await
|
|
25297
|
+
let t = await Be({
|
|
25294
25298
|
target: e,
|
|
25295
25299
|
uuidMap: r,
|
|
25296
25300
|
uuidToRef: i,
|
|
@@ -25300,9 +25304,9 @@ async function Re(e) {
|
|
|
25300
25304
|
}
|
|
25301
25305
|
return a;
|
|
25302
25306
|
}
|
|
25303
|
-
async function
|
|
25307
|
+
async function Re(e, t) {
|
|
25304
25308
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
25305
|
-
for (let { source: i, target: a } of e) await
|
|
25309
|
+
for (let { source: i, target: a } of e) await ze({
|
|
25306
25310
|
source: i,
|
|
25307
25311
|
target: a,
|
|
25308
25312
|
query: t,
|
|
@@ -25314,7 +25318,7 @@ async function ze(e, t) {
|
|
|
25314
25318
|
uuidToRef: r
|
|
25315
25319
|
};
|
|
25316
25320
|
}
|
|
25317
|
-
async function
|
|
25321
|
+
async function ze(e) {
|
|
25318
25322
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
25319
25323
|
if (!o) return;
|
|
25320
25324
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -25323,41 +25327,41 @@ async function Be(e) {
|
|
|
25323
25327
|
id: o.id
|
|
25324
25328
|
}));
|
|
25325
25329
|
}
|
|
25326
|
-
async function
|
|
25327
|
-
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;
|
|
25328
25332
|
if (!(o in N)) return null;
|
|
25329
25333
|
let s = await a.getRecord(t);
|
|
25330
25334
|
if (!s) return null;
|
|
25331
25335
|
let c = N[o], l = [...s.attributes], u = !1;
|
|
25332
25336
|
for (let e of c) {
|
|
25333
|
-
let t = await
|
|
25337
|
+
let t = await Ve({
|
|
25334
25338
|
pair: e,
|
|
25335
25339
|
tagName: o,
|
|
25336
25340
|
refId: s.id,
|
|
25337
25341
|
updatedAttributes: l,
|
|
25338
25342
|
uuidMap: n,
|
|
25339
|
-
uuidToRef:
|
|
25343
|
+
uuidToRef: r,
|
|
25340
25344
|
query: a
|
|
25341
25345
|
});
|
|
25342
25346
|
t && (l = t, u = !0);
|
|
25343
25347
|
}
|
|
25344
25348
|
return u ? {
|
|
25345
25349
|
status: "updated",
|
|
25346
|
-
oldRecord:
|
|
25347
|
-
newRecord:
|
|
25350
|
+
oldRecord: i(s),
|
|
25351
|
+
newRecord: i({
|
|
25348
25352
|
...s,
|
|
25349
25353
|
attributes: l
|
|
25350
25354
|
})
|
|
25351
25355
|
} : null;
|
|
25352
25356
|
}
|
|
25353
|
-
async function
|
|
25357
|
+
async function Ve(e) {
|
|
25354
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;
|
|
25355
25359
|
if (!c) return null;
|
|
25356
25360
|
let l = i.get(c);
|
|
25357
25361
|
if (!l) return null;
|
|
25358
|
-
let u = !1, d =
|
|
25362
|
+
let u = !1, d = He(s, t.attribute.uuid, c, l);
|
|
25359
25363
|
d && (s = d, u = !0);
|
|
25360
|
-
let f = await
|
|
25364
|
+
let f = await Ue({
|
|
25361
25365
|
attributes: s,
|
|
25362
25366
|
pathAttrName: t.attribute.path,
|
|
25363
25367
|
newUuid: l,
|
|
@@ -25368,16 +25372,16 @@ async function He(e) {
|
|
|
25368
25372
|
});
|
|
25369
25373
|
return f && (s = f, u = !0), u ? s : null;
|
|
25370
25374
|
}
|
|
25371
|
-
function
|
|
25375
|
+
function He(e, t, n, r) {
|
|
25372
25376
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
25373
25377
|
...e,
|
|
25374
25378
|
value: r
|
|
25375
25379
|
} : e);
|
|
25376
25380
|
}
|
|
25377
|
-
async function
|
|
25381
|
+
async function Ue(e) {
|
|
25378
25382
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
25379
25383
|
if (!c) return null;
|
|
25380
|
-
let l = await
|
|
25384
|
+
let l = await L.query.buildReferencePath(s, {
|
|
25381
25385
|
reference: {
|
|
25382
25386
|
tagName: a,
|
|
25383
25387
|
id: o
|
|
@@ -25394,13 +25398,13 @@ async function We(e) {
|
|
|
25394
25398
|
}
|
|
25395
25399
|
//#endregion
|
|
25396
25400
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
25397
|
-
async function
|
|
25398
|
-
return
|
|
25401
|
+
async function We(e) {
|
|
25402
|
+
return Le(e);
|
|
25399
25403
|
}
|
|
25400
25404
|
//#endregion
|
|
25401
25405
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
25402
|
-
function
|
|
25403
|
-
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];
|
|
25404
25408
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
25405
25409
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
25406
25410
|
return {
|
|
@@ -25414,20 +25418,20 @@ function Ke(e) {
|
|
|
25414
25418
|
}
|
|
25415
25419
|
//#endregion
|
|
25416
25420
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
25417
|
-
function
|
|
25418
|
-
return
|
|
25421
|
+
function Ke(e) {
|
|
25422
|
+
return Ge(e);
|
|
25419
25423
|
}
|
|
25420
25424
|
//#endregion
|
|
25421
25425
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
25422
|
-
async function
|
|
25426
|
+
async function qe(e) {
|
|
25423
25427
|
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
25424
25428
|
if (a) {
|
|
25425
|
-
let e =
|
|
25429
|
+
let e = z(n.tagName), t = {
|
|
25426
25430
|
tagName: n.tagName,
|
|
25427
25431
|
id: n.id
|
|
25428
25432
|
};
|
|
25429
25433
|
for (let n of e) {
|
|
25430
|
-
let e = await
|
|
25434
|
+
let e = await R({
|
|
25431
25435
|
uuid: a,
|
|
25432
25436
|
entry: n,
|
|
25433
25437
|
target: t,
|
|
@@ -25436,8 +25440,8 @@ async function Je(e) {
|
|
|
25436
25440
|
i.push(...e);
|
|
25437
25441
|
}
|
|
25438
25442
|
}
|
|
25439
|
-
if (
|
|
25440
|
-
let e = await
|
|
25443
|
+
if (Je(t, n)) {
|
|
25444
|
+
let e = await Ye({
|
|
25441
25445
|
newRecord: n,
|
|
25442
25446
|
query: r
|
|
25443
25447
|
});
|
|
@@ -25445,11 +25449,11 @@ async function Je(e) {
|
|
|
25445
25449
|
}
|
|
25446
25450
|
return i;
|
|
25447
25451
|
}
|
|
25448
|
-
function
|
|
25452
|
+
function Je(e, t) {
|
|
25449
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;
|
|
25450
25454
|
return !1;
|
|
25451
25455
|
}
|
|
25452
|
-
async function
|
|
25456
|
+
async function Ye(e) {
|
|
25453
25457
|
let { newRecord: t, query: n } = e, r = {
|
|
25454
25458
|
tagName: t.tagName,
|
|
25455
25459
|
id: t.id
|
|
@@ -25458,14 +25462,14 @@ async function Xe(e) {
|
|
|
25458
25462
|
if (r.id === t.id) continue;
|
|
25459
25463
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
25460
25464
|
if (!e) continue;
|
|
25461
|
-
let i =
|
|
25465
|
+
let i = z(r.tagName);
|
|
25462
25466
|
if (i.length === 0) continue;
|
|
25463
25467
|
let o = {
|
|
25464
25468
|
tagName: r.tagName,
|
|
25465
25469
|
id: r.id
|
|
25466
25470
|
};
|
|
25467
25471
|
for (let t of i) {
|
|
25468
|
-
let r = await
|
|
25472
|
+
let r = await R({
|
|
25469
25473
|
uuid: e,
|
|
25470
25474
|
entry: t,
|
|
25471
25475
|
target: o,
|
|
@@ -25478,12 +25482,12 @@ async function Xe(e) {
|
|
|
25478
25482
|
}
|
|
25479
25483
|
//#endregion
|
|
25480
25484
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
25481
|
-
async function
|
|
25482
|
-
return
|
|
25485
|
+
async function Xe(e) {
|
|
25486
|
+
return qe(e);
|
|
25483
25487
|
}
|
|
25484
25488
|
//#endregion
|
|
25485
25489
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
25486
|
-
function
|
|
25490
|
+
function Ze(e) {
|
|
25487
25491
|
let { record: t } = e, n = !0;
|
|
25488
25492
|
t.tagName === "Private" && !t.tree.length && (n = !1);
|
|
25489
25493
|
let r = t.attributes.filter((e) => e.name !== "uuid");
|
|
@@ -25497,9 +25501,9 @@ function Qe(e) {
|
|
|
25497
25501
|
}
|
|
25498
25502
|
//#endregion
|
|
25499
25503
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
25500
|
-
async function
|
|
25504
|
+
async function Qe(e) {
|
|
25501
25505
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
25502
|
-
if (await
|
|
25506
|
+
if (await B({
|
|
25503
25507
|
record: t,
|
|
25504
25508
|
query: n,
|
|
25505
25509
|
ids: r,
|
|
@@ -25507,7 +25511,7 @@ async function $e(e) {
|
|
|
25507
25511
|
}), i.size === 0) return [];
|
|
25508
25512
|
let a = [], o = Object.keys(N);
|
|
25509
25513
|
for (let e of o) {
|
|
25510
|
-
let t = await
|
|
25514
|
+
let t = await $e({
|
|
25511
25515
|
refTagName: e,
|
|
25512
25516
|
subtreeIds: r,
|
|
25513
25517
|
subtreeUuids: i,
|
|
@@ -25517,11 +25521,11 @@ async function $e(e) {
|
|
|
25517
25521
|
}
|
|
25518
25522
|
return a;
|
|
25519
25523
|
}
|
|
25520
|
-
async function
|
|
25524
|
+
async function $e(e) {
|
|
25521
25525
|
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = N[t], o = await i.getRecordsByTagName(t), s = [];
|
|
25522
25526
|
for (let e of o) {
|
|
25523
25527
|
if (n.has(e.id)) continue;
|
|
25524
|
-
let o = await
|
|
25528
|
+
let o = await et({
|
|
25525
25529
|
refTagName: t,
|
|
25526
25530
|
refRecord: e,
|
|
25527
25531
|
refPairs: a,
|
|
@@ -25532,15 +25536,15 @@ async function et(e) {
|
|
|
25532
25536
|
}
|
|
25533
25537
|
return s;
|
|
25534
25538
|
}
|
|
25535
|
-
async function
|
|
25536
|
-
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({
|
|
25537
25541
|
refPairs: r,
|
|
25538
25542
|
refRecord: n,
|
|
25539
25543
|
subtreeUuids: i
|
|
25540
25544
|
});
|
|
25541
|
-
return o.size === 0 ? [] :
|
|
25545
|
+
return o.size === 0 ? [] : I.has(t) ? [nt(n, o)] : rt(n, a);
|
|
25542
25546
|
}
|
|
25543
|
-
function
|
|
25547
|
+
function tt(e) {
|
|
25544
25548
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
25545
25549
|
for (let e of t) {
|
|
25546
25550
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -25551,47 +25555,47 @@ function nt(e) {
|
|
|
25551
25555
|
}
|
|
25552
25556
|
return i;
|
|
25553
25557
|
}
|
|
25554
|
-
function
|
|
25558
|
+
function nt(e, t) {
|
|
25555
25559
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
25556
25560
|
return {
|
|
25557
25561
|
status: "updated",
|
|
25558
|
-
oldRecord:
|
|
25559
|
-
newRecord:
|
|
25562
|
+
oldRecord: i(e),
|
|
25563
|
+
newRecord: i({
|
|
25560
25564
|
...e,
|
|
25561
25565
|
attributes: n
|
|
25562
25566
|
})
|
|
25563
25567
|
};
|
|
25564
25568
|
}
|
|
25565
|
-
async function
|
|
25569
|
+
async function rt(e, t) {
|
|
25566
25570
|
let n = [{
|
|
25567
25571
|
status: "deleted",
|
|
25568
|
-
oldRecord:
|
|
25572
|
+
oldRecord: i(e),
|
|
25569
25573
|
newRecord: void 0
|
|
25570
25574
|
}];
|
|
25571
25575
|
if (e.parent) {
|
|
25572
|
-
let
|
|
25573
|
-
if (
|
|
25576
|
+
let r = await t.getRecord(e.parent);
|
|
25577
|
+
if (r) {
|
|
25574
25578
|
let t = {
|
|
25575
|
-
...
|
|
25576
|
-
children:
|
|
25579
|
+
...r,
|
|
25580
|
+
children: r.children.filter((t) => t.id !== e.id)
|
|
25577
25581
|
};
|
|
25578
25582
|
n.push({
|
|
25579
25583
|
status: "updated",
|
|
25580
|
-
oldRecord: r
|
|
25581
|
-
newRecord:
|
|
25584
|
+
oldRecord: i(r),
|
|
25585
|
+
newRecord: i(t)
|
|
25582
25586
|
});
|
|
25583
25587
|
}
|
|
25584
25588
|
}
|
|
25585
25589
|
return n;
|
|
25586
25590
|
}
|
|
25587
|
-
async function
|
|
25591
|
+
async function B(e) {
|
|
25588
25592
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
25589
25593
|
r.add(t.id);
|
|
25590
25594
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25591
25595
|
a && i.add(a);
|
|
25592
25596
|
for (let e of t.children) {
|
|
25593
25597
|
let t = await n.getRecord(e);
|
|
25594
|
-
t && await
|
|
25598
|
+
t && await B({
|
|
25595
25599
|
record: t,
|
|
25596
25600
|
query: n,
|
|
25597
25601
|
ids: r,
|
|
@@ -25601,29 +25605,29 @@ async function R(e) {
|
|
|
25601
25605
|
}
|
|
25602
25606
|
//#endregion
|
|
25603
25607
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
25604
|
-
async function
|
|
25605
|
-
return
|
|
25608
|
+
async function it(e) {
|
|
25609
|
+
return Qe(e);
|
|
25606
25610
|
}
|
|
25607
25611
|
//#endregion
|
|
25608
25612
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
25609
|
-
function
|
|
25613
|
+
function at() {
|
|
25610
25614
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
25611
25615
|
return {
|
|
25612
25616
|
beforeImportRecord: (r) => {
|
|
25613
|
-
let { record: i, ancestry: a } = r, { tagName: o } = i, s =
|
|
25614
|
-
if (s &&
|
|
25617
|
+
let { record: i, ancestry: a } = r, { tagName: o } = i, s = lt(i);
|
|
25618
|
+
if (s && ct.has(o)) {
|
|
25615
25619
|
let t = T({
|
|
25616
25620
|
record: i,
|
|
25617
25621
|
ancestry: a
|
|
25618
25622
|
});
|
|
25619
25623
|
t && e.set(t.path, s);
|
|
25620
25624
|
}
|
|
25621
|
-
if (!
|
|
25625
|
+
if (!st.has(o)) return;
|
|
25622
25626
|
let c = N[o];
|
|
25623
25627
|
for (let e of c) {
|
|
25624
25628
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
25625
25629
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
25626
|
-
let s =
|
|
25630
|
+
let s = ae(e.resolution, e.attribute.path, r, a);
|
|
25627
25631
|
if (!s) {
|
|
25628
25632
|
e.resolution === M.unsupported && n.push({
|
|
25629
25633
|
type: "unsupported-xpath-reference",
|
|
@@ -25679,9 +25683,9 @@ function ot() {
|
|
|
25679
25683
|
}
|
|
25680
25684
|
};
|
|
25681
25685
|
}
|
|
25682
|
-
var
|
|
25683
|
-
function
|
|
25684
|
-
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;
|
|
25685
25689
|
let t = e.attributes.find((e) => e.name === "uuid");
|
|
25686
25690
|
if (t) return t.value;
|
|
25687
25691
|
let n = crypto.randomUUID();
|
|
@@ -25692,14 +25696,14 @@ function ut(e) {
|
|
|
25692
25696
|
}
|
|
25693
25697
|
//#endregion
|
|
25694
25698
|
//#region src/v2019C1/hooks/index.ts
|
|
25695
|
-
var
|
|
25696
|
-
beforeClone:
|
|
25697
|
-
afterStandardizedRecord:
|
|
25698
|
-
afterCreated:
|
|
25699
|
-
afterDeepClone:
|
|
25700
|
-
afterUpdated:
|
|
25701
|
-
beforeDelete:
|
|
25702
|
-
},
|
|
25699
|
+
var ut = {
|
|
25700
|
+
beforeClone: Ze,
|
|
25701
|
+
afterStandardizedRecord: Ke,
|
|
25702
|
+
afterCreated: Ie,
|
|
25703
|
+
afterDeepClone: We,
|
|
25704
|
+
afterUpdated: Xe,
|
|
25705
|
+
beforeDelete: it
|
|
25706
|
+
}, V = {
|
|
25703
25707
|
supportedFileExtensions: [
|
|
25704
25708
|
".fsd",
|
|
25705
25709
|
".asd",
|
|
@@ -25709,8 +25713,8 @@ var dt = {
|
|
|
25709
25713
|
".icd",
|
|
25710
25714
|
".xml"
|
|
25711
25715
|
],
|
|
25712
|
-
hooks:
|
|
25713
|
-
},
|
|
25716
|
+
hooks: at()
|
|
25717
|
+
}, H = {
|
|
25714
25718
|
recordSchema: {
|
|
25715
25719
|
primaryKey: "id",
|
|
25716
25720
|
indexes: [
|
|
@@ -25728,7 +25732,7 @@ var dt = {
|
|
|
25728
25732
|
},
|
|
25729
25733
|
additionalTables: { attachedFiles: { schema: "id, filename, file" } }
|
|
25730
25734
|
}
|
|
25731
|
-
},
|
|
25735
|
+
}, dt = {
|
|
25732
25736
|
default: {
|
|
25733
25737
|
uri: "http://www.iec.ch/61850/2003/SCL",
|
|
25734
25738
|
prefix: ""
|
|
@@ -25736,21 +25740,22 @@ var dt = {
|
|
|
25736
25740
|
v2019C1: {
|
|
25737
25741
|
uri: "http://www.iec.ch/61850/2019/SCL/6-100",
|
|
25738
25742
|
prefix: "eIEC61850-6-100"
|
|
25739
|
-
}
|
|
25740
|
-
|
|
25743
|
+
},
|
|
25744
|
+
xsi: e
|
|
25745
|
+
}, U = {
|
|
25741
25746
|
rootElementName: "SCL",
|
|
25742
|
-
singletonElements:
|
|
25747
|
+
singletonElements: p,
|
|
25743
25748
|
transparentElements: ["Private"],
|
|
25744
|
-
elements:
|
|
25745
|
-
namespaces:
|
|
25746
|
-
attributes:
|
|
25747
|
-
children:
|
|
25748
|
-
parents:
|
|
25749
|
-
descendants:
|
|
25750
|
-
ancestors:
|
|
25751
|
-
database:
|
|
25752
|
-
io:
|
|
25753
|
-
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
|
|
25754
25759
|
};
|
|
25755
25760
|
//#endregion
|
|
25756
25761
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.ts
|
|
@@ -25795,7 +25800,7 @@ async function pt(e, t) {
|
|
|
25795
25800
|
//#endregion
|
|
25796
25801
|
//#region src/v2019C1/extensions/clean-up/transaction/prune-empty-containers.ts
|
|
25797
25802
|
async function mt(e) {
|
|
25798
|
-
let t = [...Object.values(
|
|
25803
|
+
let t = [...Object.values(De).flat(), "Private"];
|
|
25799
25804
|
for (let n of t) {
|
|
25800
25805
|
let t = await e.getRecordsByTagName(n);
|
|
25801
25806
|
for (let n of t) n.children.length === 0 && await e.delete(n);
|
|
@@ -25818,7 +25823,7 @@ async function ht(e) {
|
|
|
25818
25823
|
}
|
|
25819
25824
|
}
|
|
25820
25825
|
Object.keys(o).length > 0 && await e.update(i, { attributes: o });
|
|
25821
|
-
let s =
|
|
25826
|
+
let s = I.has(n);
|
|
25822
25827
|
r && !a && !s && await e.delete(i);
|
|
25823
25828
|
}
|
|
25824
25829
|
}
|
|
@@ -25835,59 +25840,59 @@ async function gt(e, t, n) {
|
|
|
25835
25840
|
}
|
|
25836
25841
|
//#endregion
|
|
25837
25842
|
//#region src/v2019C1/extensions/clean-up/index.ts
|
|
25838
|
-
var
|
|
25843
|
+
var W = { transaction: /* @__PURE__ */ s({
|
|
25839
25844
|
orphanUuidRefs: () => ht,
|
|
25840
25845
|
pruneEmptyContainers: () => mt,
|
|
25841
25846
|
resetLNode: () => ft
|
|
25842
25847
|
}) };
|
|
25843
25848
|
//#endregion
|
|
25844
25849
|
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
25845
|
-
async function
|
|
25846
|
-
let { records: r } = n,
|
|
25850
|
+
async function _t(e, n) {
|
|
25851
|
+
let { records: r } = n, i = {
|
|
25847
25852
|
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
25848
25853
|
doTypes: /* @__PURE__ */ new Map(),
|
|
25849
25854
|
daTypes: /* @__PURE__ */ new Map(),
|
|
25850
25855
|
enumTypes: /* @__PURE__ */ new Map()
|
|
25851
25856
|
};
|
|
25852
25857
|
for (let n of r) {
|
|
25853
|
-
let r = await
|
|
25858
|
+
let r = await e.getAttribute(n, { name: "lnType" });
|
|
25854
25859
|
if (!r) continue;
|
|
25855
|
-
let [o] = await
|
|
25860
|
+
let [o] = await e.findByAttributes({
|
|
25856
25861
|
tagName: "LNodeType",
|
|
25857
25862
|
attributes: { id: r }
|
|
25858
25863
|
});
|
|
25859
|
-
if (
|
|
25864
|
+
if (a(o, {
|
|
25860
25865
|
key: "ELEMENT_NOT_FOUND",
|
|
25861
25866
|
detail: `LNodeType not found for lnType="${r}"`
|
|
25862
|
-
}), !G(
|
|
25863
|
-
let s = o.children.filter((
|
|
25864
|
-
for (let
|
|
25865
|
-
if (!
|
|
25866
|
-
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" });
|
|
25867
25872
|
if (!n) continue;
|
|
25868
|
-
let [r] = await
|
|
25873
|
+
let [r] = await e.findByAttributes({
|
|
25869
25874
|
tagName: "DOType",
|
|
25870
25875
|
attributes: { id: n }
|
|
25871
25876
|
});
|
|
25872
|
-
r && G(
|
|
25873
|
-
query:
|
|
25877
|
+
r && G(i.doTypes, n, r) && await K({
|
|
25878
|
+
query: e,
|
|
25874
25879
|
parent: r,
|
|
25875
|
-
dataModelMap:
|
|
25880
|
+
dataModelMap: i
|
|
25876
25881
|
});
|
|
25877
25882
|
}
|
|
25878
25883
|
}
|
|
25879
25884
|
return {
|
|
25880
|
-
lnodeTypes: Array.from(
|
|
25881
|
-
doTypes: Array.from(
|
|
25882
|
-
daTypes: Array.from(
|
|
25883
|
-
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())
|
|
25884
25889
|
};
|
|
25885
25890
|
}
|
|
25886
25891
|
function G(e, t, n) {
|
|
25887
25892
|
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
25888
25893
|
}
|
|
25889
|
-
async function K(
|
|
25890
|
-
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")));
|
|
25891
25896
|
for (let e of a) {
|
|
25892
25897
|
if (!e) continue;
|
|
25893
25898
|
let t = await n.getAttribute(e, { name: "bType" }), r = await n.getAttribute(e, { name: "type" });
|
|
@@ -25912,7 +25917,7 @@ async function K(t) {
|
|
|
25912
25917
|
}
|
|
25913
25918
|
}
|
|
25914
25919
|
if (r.tagName === "DOType") {
|
|
25915
|
-
let
|
|
25920
|
+
let e = r.children.filter((e) => t(e, "SDO")), a = await n.getRecords(e);
|
|
25916
25921
|
for (let e of a) {
|
|
25917
25922
|
let t = await n.getAttribute(e, { name: "type" });
|
|
25918
25923
|
if (!t) continue;
|
|
@@ -25930,11 +25935,11 @@ async function K(t) {
|
|
|
25930
25935
|
}
|
|
25931
25936
|
//#endregion
|
|
25932
25937
|
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
25933
|
-
var
|
|
25938
|
+
var vt = /* @__PURE__ */ s({ resolve: () => _t });
|
|
25934
25939
|
//#endregion
|
|
25935
25940
|
//#region src/v2019C1/extensions/data-model/transaction/extract.ts
|
|
25936
|
-
async function
|
|
25937
|
-
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, {
|
|
25938
25943
|
tagName: "DataTypeTemplates",
|
|
25939
25944
|
attributes: {}
|
|
25940
25945
|
});
|
|
@@ -25950,7 +25955,7 @@ async function vt(e, t) {
|
|
|
25950
25955
|
a && await e.deepClone(o, a);
|
|
25951
25956
|
}
|
|
25952
25957
|
}
|
|
25953
|
-
function
|
|
25958
|
+
function bt(e) {
|
|
25954
25959
|
return [
|
|
25955
25960
|
...e.lnodeTypes,
|
|
25956
25961
|
...e.doTypes,
|
|
@@ -25960,13 +25965,13 @@ function yt(e) {
|
|
|
25960
25965
|
}
|
|
25961
25966
|
//#endregion
|
|
25962
25967
|
//#region src/v2019C1/extensions/data-model/index.ts
|
|
25963
|
-
var
|
|
25964
|
-
query:
|
|
25965
|
-
transaction: /* @__PURE__ */
|
|
25968
|
+
var xt = {
|
|
25969
|
+
query: vt,
|
|
25970
|
+
transaction: /* @__PURE__ */ s({ extract: () => yt })
|
|
25966
25971
|
};
|
|
25967
25972
|
//#endregion
|
|
25968
25973
|
//#region src/v2019C1/extensions/history/query/get-sorted-hitem.ts
|
|
25969
|
-
async function
|
|
25974
|
+
async function St(e) {
|
|
25970
25975
|
let t = await e.getRecord({ tagName: "History" });
|
|
25971
25976
|
if (!t) return [];
|
|
25972
25977
|
let { Hitem: n = [] } = await e.findDescendants(t, { collect: "Hitem" });
|
|
@@ -25980,18 +25985,18 @@ async function J(e) {
|
|
|
25980
25985
|
}
|
|
25981
25986
|
//#endregion
|
|
25982
25987
|
//#region src/v2019C1/extensions/history/query/get-latest-hitem.ts
|
|
25983
|
-
async function
|
|
25984
|
-
return (await
|
|
25988
|
+
async function Ct(e) {
|
|
25989
|
+
return (await St(e)).at(-1);
|
|
25985
25990
|
}
|
|
25986
25991
|
//#endregion
|
|
25987
25992
|
//#region src/v2019C1/extensions/history/query/index.ts
|
|
25988
|
-
var
|
|
25989
|
-
getLatestHitem: () =>
|
|
25990
|
-
getSortedHitems: () =>
|
|
25993
|
+
var wt = /* @__PURE__ */ s({
|
|
25994
|
+
getLatestHitem: () => Ct,
|
|
25995
|
+
getSortedHitems: () => St
|
|
25991
25996
|
});
|
|
25992
25997
|
//#endregion
|
|
25993
25998
|
//#region src/v2019C1/extensions/history/transaction/add-entry.ts
|
|
25994
|
-
async function
|
|
25999
|
+
async function Tt(e, t) {
|
|
25995
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, {
|
|
25996
26001
|
tagName: "Header",
|
|
25997
26002
|
attributes: {
|
|
@@ -26006,18 +26011,18 @@ async function St(e, t) {
|
|
|
26006
26011
|
}), h = await e.getRecord({ tagName: "History" }) ?? await e.addChild(m, {
|
|
26007
26012
|
tagName: "History",
|
|
26008
26013
|
attributes: {}
|
|
26009
|
-
}), 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";
|
|
26010
26015
|
await e.update(m, { attributes: {
|
|
26011
26016
|
version: y,
|
|
26012
26017
|
revision: b
|
|
26013
26018
|
} });
|
|
26014
|
-
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]}`;
|
|
26015
26020
|
await e.addChild(h, {
|
|
26016
26021
|
tagName: "Hitem",
|
|
26017
26022
|
attributes: {
|
|
26018
26023
|
version: y,
|
|
26019
26024
|
revision: b,
|
|
26020
|
-
when:
|
|
26025
|
+
when: ee,
|
|
26021
26026
|
who: u,
|
|
26022
26027
|
what: d,
|
|
26023
26028
|
why: f
|
|
@@ -26029,10 +26034,10 @@ async function St(e, t) {
|
|
|
26029
26034
|
}
|
|
26030
26035
|
//#endregion
|
|
26031
26036
|
//#region src/v2019C1/extensions/history/index.ts
|
|
26032
|
-
var
|
|
26033
|
-
query:
|
|
26034
|
-
transaction: /* @__PURE__ */
|
|
26035
|
-
},
|
|
26037
|
+
var q = {
|
|
26038
|
+
query: wt,
|
|
26039
|
+
transaction: /* @__PURE__ */ s({ addEntry: () => Tt })
|
|
26040
|
+
}, Et = {
|
|
26036
26041
|
LNode: {
|
|
26037
26042
|
compact: [
|
|
26038
26043
|
"prefix",
|
|
@@ -26119,13 +26124,13 @@ var Y = {
|
|
|
26119
26124
|
};
|
|
26120
26125
|
//#endregion
|
|
26121
26126
|
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26122
|
-
async function
|
|
26127
|
+
async function Dt(e, t, n = {}) {
|
|
26123
26128
|
let r = await e.getRecord(t);
|
|
26124
26129
|
if (!r) return n.withLabels ? {
|
|
26125
26130
|
title: "",
|
|
26126
26131
|
labels: {}
|
|
26127
26132
|
} : "";
|
|
26128
|
-
let i = r.tagName, a =
|
|
26133
|
+
let i = r.tagName, a = Ot({
|
|
26129
26134
|
tag: i,
|
|
26130
26135
|
mode: n.mode ?? "compact",
|
|
26131
26136
|
attributes: await e.any.getAttributes(r),
|
|
@@ -26133,24 +26138,24 @@ async function wt(e, t, n = {}) {
|
|
|
26133
26138
|
});
|
|
26134
26139
|
return n.withLabels ? {
|
|
26135
26140
|
title: a,
|
|
26136
|
-
labels: await
|
|
26141
|
+
labels: await kt(e, r)
|
|
26137
26142
|
} : a;
|
|
26138
26143
|
}
|
|
26139
|
-
function
|
|
26140
|
-
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];
|
|
26141
26146
|
if (a) {
|
|
26142
|
-
let e =
|
|
26147
|
+
let e = Mt(a, r, n);
|
|
26143
26148
|
if (e) return e;
|
|
26144
26149
|
}
|
|
26145
26150
|
let o = (i ?? "").trim();
|
|
26146
26151
|
if (o) return o;
|
|
26147
|
-
let s =
|
|
26152
|
+
let s = h[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
|
|
26148
26153
|
return c && r[c] ? r[c] : r.name || t;
|
|
26149
26154
|
}
|
|
26150
|
-
async function
|
|
26151
|
-
return
|
|
26155
|
+
async function kt(e, t) {
|
|
26156
|
+
return jt(await At(e, t));
|
|
26152
26157
|
}
|
|
26153
|
-
async function
|
|
26158
|
+
async function At(e, t) {
|
|
26154
26159
|
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26155
26160
|
for (let t of r) {
|
|
26156
26161
|
let r = await e.any.getChildren(t, "Label");
|
|
@@ -26165,26 +26170,26 @@ async function Dt(e, t) {
|
|
|
26165
26170
|
}
|
|
26166
26171
|
return n;
|
|
26167
26172
|
}
|
|
26168
|
-
function
|
|
26173
|
+
function jt(e) {
|
|
26169
26174
|
let t = {};
|
|
26170
26175
|
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26171
26176
|
return t;
|
|
26172
26177
|
}
|
|
26173
|
-
function
|
|
26178
|
+
function Mt(e, t, n) {
|
|
26174
26179
|
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26175
|
-
if (typeof i == "string") return
|
|
26180
|
+
if (typeof i == "string") return Nt(i, t);
|
|
26176
26181
|
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26177
26182
|
return o.length > 0 ? o.join(a) : "";
|
|
26178
26183
|
}
|
|
26179
|
-
function
|
|
26184
|
+
function Nt(e, t) {
|
|
26180
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("/");
|
|
26181
26186
|
}
|
|
26182
26187
|
//#endregion
|
|
26183
26188
|
//#region src/v2019C1/extensions/presentation/index.ts
|
|
26184
|
-
var
|
|
26189
|
+
var Pt = { query: /* @__PURE__ */ s({ extractElementTitle: () => Dt }) };
|
|
26185
26190
|
//#endregion
|
|
26186
26191
|
//#region src/v2019C1/extensions/template/transaction/ensure-substation-structure.ts
|
|
26187
|
-
async function
|
|
26192
|
+
async function J(e) {
|
|
26188
26193
|
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
26189
26194
|
tagName: "Substation",
|
|
26190
26195
|
attributes: { name: "TEMPLATE" }
|
|
@@ -26203,50 +26208,50 @@ async function X(e) {
|
|
|
26203
26208
|
}
|
|
26204
26209
|
//#endregion
|
|
26205
26210
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-utils.ts
|
|
26206
|
-
var
|
|
26211
|
+
var Ft = {
|
|
26207
26212
|
scope: "tree",
|
|
26208
26213
|
attributes: ["templateUuid", "originUuid"]
|
|
26209
26214
|
};
|
|
26210
|
-
async function
|
|
26211
|
-
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 });
|
|
26212
26217
|
if (!l) return;
|
|
26213
26218
|
let u = s && l.tagName === s.from ? {
|
|
26214
26219
|
...l,
|
|
26215
26220
|
tagName: s.to
|
|
26216
26221
|
} : l, d = u;
|
|
26217
|
-
c && (d = c.scope === "tree" ?
|
|
26222
|
+
c && (d = c.scope === "tree" ? r(u, c.attributes) : {
|
|
26218
26223
|
...u,
|
|
26219
26224
|
attributes: u.attributes.filter((e) => !c.attributes.includes(e.name))
|
|
26220
26225
|
}), await e.deepClone(a, d);
|
|
26221
26226
|
}
|
|
26222
26227
|
//#endregion
|
|
26223
26228
|
//#region src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts
|
|
26224
|
-
async function
|
|
26229
|
+
async function It(e, t) {
|
|
26225
26230
|
let { sourceQuery: n, scopeRef: r } = t, { LNode: i = [] } = await n.findDescendants(r, { collect: "LNode" });
|
|
26226
|
-
i.length > 0 && await
|
|
26231
|
+
i.length > 0 && await xt.transaction.extract(e, {
|
|
26227
26232
|
sourceQuery: n,
|
|
26228
26233
|
records: i
|
|
26229
26234
|
});
|
|
26230
26235
|
}
|
|
26231
26236
|
//#endregion
|
|
26232
26237
|
//#region src/v2019C1/extensions/template/transaction/shared/resolve-structure-ref.ts
|
|
26233
|
-
async function
|
|
26238
|
+
async function X(e, t, n) {
|
|
26234
26239
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26235
|
-
|
|
26240
|
+
a(r, {
|
|
26236
26241
|
key: "ELEMENT_NOT_FOUND",
|
|
26237
26242
|
detail: `No Substation/VoltageLevel/Bay ancestor found for ${t.tagName}`
|
|
26238
26243
|
});
|
|
26239
|
-
let
|
|
26244
|
+
let i = n[r.tagName];
|
|
26240
26245
|
return {
|
|
26241
|
-
tagName:
|
|
26242
|
-
id:
|
|
26246
|
+
tagName: i.tagName,
|
|
26247
|
+
id: i.id
|
|
26243
26248
|
};
|
|
26244
26249
|
}
|
|
26245
26250
|
//#endregion
|
|
26246
26251
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-function.ts
|
|
26247
|
-
async function
|
|
26252
|
+
async function Lt(e, t) {
|
|
26248
26253
|
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t;
|
|
26249
|
-
await
|
|
26254
|
+
await Y(e, {
|
|
26250
26255
|
sourceQuery: n,
|
|
26251
26256
|
ref: r,
|
|
26252
26257
|
targetParent: i,
|
|
@@ -26259,39 +26264,39 @@ async function Pt(e, t) {
|
|
|
26259
26264
|
scope: "root",
|
|
26260
26265
|
attributes: [...o]
|
|
26261
26266
|
} : !1
|
|
26262
|
-
}), await
|
|
26267
|
+
}), await It(e, {
|
|
26263
26268
|
sourceQuery: n,
|
|
26264
26269
|
scopeRef: r
|
|
26265
26270
|
});
|
|
26266
26271
|
}
|
|
26267
|
-
async function
|
|
26268
|
-
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);
|
|
26269
26274
|
for (let t of o) {
|
|
26270
|
-
if (await
|
|
26275
|
+
if (await Vt(e, n, t)) continue;
|
|
26271
26276
|
let r = {
|
|
26272
26277
|
tagName: "FunctionCategory",
|
|
26273
26278
|
id: t
|
|
26274
26279
|
};
|
|
26275
|
-
await
|
|
26280
|
+
await Y(e, {
|
|
26276
26281
|
sourceQuery: n,
|
|
26277
26282
|
ref: r,
|
|
26278
|
-
targetParent: await
|
|
26283
|
+
targetParent: await X(n, r, i),
|
|
26279
26284
|
...a ? {} : { strip: !1 }
|
|
26280
26285
|
});
|
|
26281
26286
|
}
|
|
26282
26287
|
}
|
|
26283
|
-
async function
|
|
26284
|
-
let n = await
|
|
26288
|
+
async function zt(e, t) {
|
|
26289
|
+
let n = await Bt(e, t), r = /* @__PURE__ */ new Set();
|
|
26285
26290
|
for (let { container: e } of n) e && r.add(e.id);
|
|
26286
26291
|
return r;
|
|
26287
26292
|
}
|
|
26288
|
-
async function
|
|
26289
|
-
let n = await
|
|
26293
|
+
async function Bt(e, t) {
|
|
26294
|
+
let n = await L.query.findRefsPointingTo(e, {
|
|
26290
26295
|
target: t,
|
|
26291
26296
|
containerTagName: "FunctionCategory"
|
|
26292
26297
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
26293
26298
|
for (let t of r) {
|
|
26294
|
-
let r = await
|
|
26299
|
+
let r = await L.query.findRefsPointingTo(e, {
|
|
26295
26300
|
target: {
|
|
26296
26301
|
tagName: "SubFunction",
|
|
26297
26302
|
id: t.id
|
|
@@ -26302,7 +26307,7 @@ async function Lt(e, t) {
|
|
|
26302
26307
|
}
|
|
26303
26308
|
return n;
|
|
26304
26309
|
}
|
|
26305
|
-
async function
|
|
26310
|
+
async function Vt(e, t, n) {
|
|
26306
26311
|
let r = await t.getRecord({
|
|
26307
26312
|
tagName: "FunctionCategory",
|
|
26308
26313
|
id: n
|
|
@@ -26318,7 +26323,7 @@ async function Rt(e, t, n) {
|
|
|
26318
26323
|
}
|
|
26319
26324
|
//#endregion
|
|
26320
26325
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-referenced.ts
|
|
26321
|
-
async function
|
|
26326
|
+
async function Z(e, t) {
|
|
26322
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();
|
|
26323
26328
|
for (let e of s) {
|
|
26324
26329
|
let t = e.attributes.find((e) => e.name === o)?.value;
|
|
@@ -26342,22 +26347,22 @@ async function zt(e, t) {
|
|
|
26342
26347
|
}
|
|
26343
26348
|
return l;
|
|
26344
26349
|
}
|
|
26345
|
-
async function
|
|
26346
|
-
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, {
|
|
26347
26352
|
sourceQuery: n,
|
|
26348
26353
|
scopeRef: r,
|
|
26349
26354
|
refTagName: i,
|
|
26350
26355
|
targetTagName: a
|
|
26351
26356
|
});
|
|
26352
|
-
for (let t of c) await
|
|
26357
|
+
for (let t of c) await Y(e, {
|
|
26353
26358
|
sourceQuery: n,
|
|
26354
26359
|
ref: t,
|
|
26355
26360
|
targetParent: o,
|
|
26356
26361
|
omit: s
|
|
26357
26362
|
});
|
|
26358
26363
|
}
|
|
26359
|
-
async function
|
|
26360
|
-
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;
|
|
26361
26366
|
for (let t of c) for (let r of N[t]) for (let o of r.target) await l(e, {
|
|
26362
26367
|
sourceQuery: n,
|
|
26363
26368
|
scopeRef: i,
|
|
@@ -26369,13 +26374,13 @@ async function Vt(e, t) {
|
|
|
26369
26374
|
}
|
|
26370
26375
|
//#endregion
|
|
26371
26376
|
//#region src/v2019C1/extensions/template/transaction/shared/omit-filters.ts
|
|
26372
|
-
var
|
|
26377
|
+
var Q = [
|
|
26373
26378
|
"FunctionSclRef",
|
|
26374
26379
|
"ApplicationSclRef",
|
|
26375
26380
|
"GeneralEquipment",
|
|
26376
26381
|
"ConductingEquipment"
|
|
26377
|
-
],
|
|
26378
|
-
|
|
26382
|
+
], Wt = [
|
|
26383
|
+
...Q,
|
|
26379
26384
|
"DOS",
|
|
26380
26385
|
"Labels",
|
|
26381
26386
|
"LNodeInputs",
|
|
@@ -26387,52 +26392,52 @@ var $ = [
|
|
|
26387
26392
|
];
|
|
26388
26393
|
//#endregion
|
|
26389
26394
|
//#region src/v2019C1/extensions/template/transaction/shared/clone-application.ts
|
|
26390
|
-
async function
|
|
26395
|
+
async function Gt(e, t) {
|
|
26391
26396
|
let { sourceQuery: n, applicationRef: r, structure: i } = t, a = {
|
|
26392
26397
|
tagName: "Substation",
|
|
26393
26398
|
id: i.Substation.id
|
|
26394
|
-
}, o = await
|
|
26399
|
+
}, o = await Z(e, {
|
|
26395
26400
|
sourceQuery: n,
|
|
26396
26401
|
scopeRef: r,
|
|
26397
26402
|
refTagName: "FunctionRef",
|
|
26398
26403
|
targetTagName: "Function"
|
|
26399
26404
|
});
|
|
26400
|
-
for (let t of o) await
|
|
26405
|
+
for (let t of o) await Lt(e, {
|
|
26401
26406
|
sourceQuery: n,
|
|
26402
26407
|
functionRef: t,
|
|
26403
|
-
targetParentRef: await
|
|
26404
|
-
omit:
|
|
26408
|
+
targetParentRef: await X(n, t, i),
|
|
26409
|
+
omit: Q
|
|
26405
26410
|
});
|
|
26406
|
-
for (let t of o) await
|
|
26411
|
+
for (let t of o) await Rt(e, {
|
|
26407
26412
|
sourceQuery: n,
|
|
26408
26413
|
functionRef: t,
|
|
26409
26414
|
structure: i,
|
|
26410
26415
|
stripCategoriesUuid: !1
|
|
26411
26416
|
});
|
|
26412
|
-
await
|
|
26417
|
+
await Ut(e, {
|
|
26413
26418
|
sourceQuery: n,
|
|
26414
26419
|
scopeTagName: "Application",
|
|
26415
26420
|
scopeRef: r,
|
|
26416
26421
|
targetParent: a,
|
|
26417
26422
|
skip: new Set(["FunctionRef", "FunctionCategoryRef"]),
|
|
26418
|
-
omit:
|
|
26419
|
-
}), await
|
|
26423
|
+
omit: Q
|
|
26424
|
+
}), await Y(e, {
|
|
26420
26425
|
sourceQuery: n,
|
|
26421
26426
|
ref: r,
|
|
26422
|
-
targetParent: await
|
|
26423
|
-
omit:
|
|
26427
|
+
targetParent: await X(n, r, i),
|
|
26428
|
+
omit: Q
|
|
26424
26429
|
});
|
|
26425
26430
|
}
|
|
26426
26431
|
//#endregion
|
|
26427
26432
|
//#region src/v2019C1/extensions/template/transaction/shared/post-extraction-cleanup.ts
|
|
26428
|
-
async function
|
|
26429
|
-
await
|
|
26433
|
+
async function $(e) {
|
|
26434
|
+
await W.transaction.orphanUuidRefs(e), await W.transaction.resetLNode(e), await W.transaction.pruneEmptyContainers(e);
|
|
26430
26435
|
}
|
|
26431
26436
|
//#endregion
|
|
26432
26437
|
//#region src/v2019C1/extensions/template/transaction/asd/extract-to-asd.ts
|
|
26433
|
-
async function
|
|
26434
|
-
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
26435
|
-
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, {
|
|
26436
26441
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
26437
26442
|
header: {
|
|
26438
26443
|
fileType: "ASD",
|
|
@@ -26445,20 +26450,20 @@ async function Gt(e, t) {
|
|
|
26445
26450
|
what: "ASD initialization",
|
|
26446
26451
|
why: "Application was extracted from a previous file"
|
|
26447
26452
|
}
|
|
26448
|
-
}), await
|
|
26453
|
+
}), await Gt(e, {
|
|
26449
26454
|
sourceQuery: n,
|
|
26450
26455
|
applicationRef: r,
|
|
26451
26456
|
structure: s
|
|
26452
|
-
}), await
|
|
26457
|
+
}), await $(e);
|
|
26453
26458
|
}
|
|
26454
26459
|
//#endregion
|
|
26455
26460
|
//#region src/v2019C1/extensions/template/transaction/fsd/extract-to-fsd.ts
|
|
26456
|
-
async function
|
|
26457
|
-
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 = {
|
|
26458
26463
|
tagName: s.Substation.tagName,
|
|
26459
26464
|
id: s.Substation.id
|
|
26460
26465
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
26461
|
-
await
|
|
26466
|
+
await q.transaction.addEntry(e, {
|
|
26462
26467
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
26463
26468
|
header: {
|
|
26464
26469
|
fileType: "FSD",
|
|
@@ -26471,31 +26476,31 @@ async function Kt(e, t) {
|
|
|
26471
26476
|
what: "FSD initialization",
|
|
26472
26477
|
why: "Function was extracted from a previous file"
|
|
26473
26478
|
}
|
|
26474
|
-
}), await
|
|
26479
|
+
}), await Lt(e, {
|
|
26475
26480
|
sourceQuery: n,
|
|
26476
26481
|
functionRef: r,
|
|
26477
26482
|
targetParentRef: c,
|
|
26478
|
-
omit:
|
|
26483
|
+
omit: Wt,
|
|
26479
26484
|
stripRootAttributes: ["templateUuid"]
|
|
26480
|
-
}), await
|
|
26485
|
+
}), await Rt(e, {
|
|
26481
26486
|
sourceQuery: n,
|
|
26482
26487
|
functionRef: r,
|
|
26483
26488
|
structure: s
|
|
26484
|
-
}), await
|
|
26489
|
+
}), await $(e);
|
|
26485
26490
|
}
|
|
26486
26491
|
//#endregion
|
|
26487
26492
|
//#region src/v2019C1/extensions/index.ts
|
|
26488
|
-
var
|
|
26489
|
-
cleanUp:
|
|
26490
|
-
dataModel:
|
|
26491
|
-
history:
|
|
26492
|
-
reference:
|
|
26493
|
-
template: { transaction: /* @__PURE__ */
|
|
26494
|
-
ensureSubstationTemplateStructure: () =>
|
|
26495
|
-
extractToAsd: () =>
|
|
26496
|
-
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
|
|
26497
26502
|
}) },
|
|
26498
|
-
presentation:
|
|
26503
|
+
presentation: Pt
|
|
26499
26504
|
};
|
|
26500
26505
|
//#endregion
|
|
26501
|
-
export {
|
|
26506
|
+
export { dt as a, V as i, H as n, ut as o, U as r, Jt as t };
|