@dialecte/scl 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v2019C1/extensions/presentation/constants/title.d.ts +3 -0
- package/dist/v2019C1/extensions/presentation/constants/title.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/index.d.ts +5 -0
- package/dist/v2019C1/extensions/presentation/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/query/extract-element-title.d.ts +13 -0
- package/dist/v2019C1/extensions/presentation/query/extract-element-title.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/query/index.d.ts +2 -0
- package/dist/v2019C1/extensions/presentation/query/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/template/transaction/shared/clone-function.d.ts +2 -2
- package/dist/v2019C1/extensions/template/transaction/shared/clone-function.d.ts.map +1 -1
- package/dist/v2019C1/extensions/template/transaction/shared/clone-referenced.d.ts +3 -3
- package/dist/v2019C1/extensions/template/transaction/shared/clone-referenced.d.ts.map +1 -1
- package/dist/v2019C1/extensions/template/transaction/shared/clone-utils.d.ts +2 -2
- package/dist/v2019C1/extensions/template/transaction/shared/clone-utils.d.ts.map +1 -1
- package/dist/v2019C1/extensions/template/transaction/shared/extract-data-model.d.ts.map +1 -1
- package/dist/v2019C1/extensions/template/transaction/shared/omit-filters.d.ts +5 -0
- package/dist/v2019C1/extensions/template/transaction/shared/omit-filters.d.ts.map +1 -0
- package/dist/v2019C1/index.js +71 -71
- package/package.json +2 -2
- package/dist/v2019C1/extensions/template/transaction/shared/exclude-filters.d.ts +0 -5
- package/dist/v2019C1/extensions/template/transaction/shared/exclude-filters.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/constants/title.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAkBnE,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ5D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2019C1/extensions/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,YAAY;;CAExB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Config } from '../../../config';
|
|
2
|
+
import { AnyRefOrRecord } from '@dialecte/core';
|
|
3
|
+
import type * as Core from '@dialecte/core';
|
|
4
|
+
/**
|
|
5
|
+
* Query extension: extracts a human-readable title for an SCL element.
|
|
6
|
+
*
|
|
7
|
+
* Strategy:
|
|
8
|
+
* 1. If the element has a title-field override, concatenate those attributes.
|
|
9
|
+
* 2. Otherwise, use `name` > `id` > `inst` from identity fields.
|
|
10
|
+
* 3. Fallback: tagName.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractElementTitle(query: Core.Query<Config>, refOrRecord: AnyRefOrRecord): Promise<string>;
|
|
13
|
+
//# sourceMappingURL=extract-element-title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-element-title.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/query/extract-element-title.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EACzB,WAAW,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateStructure } from './shared.types';
|
|
2
2
|
import { Config, Scl } from '../../../../config';
|
|
3
|
-
import {
|
|
3
|
+
import { OmitEntry } from '@dialecte/core';
|
|
4
4
|
import type * as Core from '@dialecte/core';
|
|
5
5
|
/**
|
|
6
6
|
* Clones a Function/SubFunction tree into the target, promotes SubFunction to Function,
|
|
@@ -15,7 +15,7 @@ export declare function cloneFunction(tx: Core.Transaction<Config>, params: {
|
|
|
15
15
|
sourceQuery: Core.Query<Config>;
|
|
16
16
|
functionRef: Scl.Ref<'Function'> | Scl.Ref<'SubFunction'>;
|
|
17
17
|
targetParentRef: Scl.Ref<'Substation'> | Scl.Ref<'VoltageLevel'> | Scl.Ref<'Bay'>;
|
|
18
|
-
|
|
18
|
+
omit?: OmitEntry<Config>[];
|
|
19
19
|
stripRootAttributes?: readonly string[];
|
|
20
20
|
}): Promise<void>;
|
|
21
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone-function.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/clone-function.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"clone-function.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/clone-function.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,6 +1,6 @@
|
|
|
1
1
|
import { Config, Scl } from '../../../../config';
|
|
2
2
|
import { RefTagName, TargetOf } from '../../../reference';
|
|
3
|
-
import {
|
|
3
|
+
import { OmitEntry } from '@dialecte/core';
|
|
4
4
|
import type * as Core from '@dialecte/core';
|
|
5
5
|
/**
|
|
6
6
|
* Collects unique target refs from `refTagName` descendants inside `scopeRef`
|
|
@@ -28,7 +28,7 @@ export declare function cloneReferencedRecords<Ref extends RefTagName, Target ex
|
|
|
28
28
|
refTagName: Ref;
|
|
29
29
|
targetTagName: Target;
|
|
30
30
|
targetParent: Scl.Ref<Scl.ElementsOf>;
|
|
31
|
-
|
|
31
|
+
omit?: OmitEntry<Config>[];
|
|
32
32
|
}): Promise<void>;
|
|
33
33
|
/**
|
|
34
34
|
* Clones all referenced targets for ref types derived from
|
|
@@ -43,6 +43,6 @@ export declare function cloneAllReferencedTargets(tx: Core.Transaction<Config>,
|
|
|
43
43
|
scopeRef: Scl.Ref<Scl.ElementsOf>;
|
|
44
44
|
targetParent: Scl.Ref<Scl.ElementsOf>;
|
|
45
45
|
skip?: ReadonlySet<string>;
|
|
46
|
-
|
|
46
|
+
omit?: OmitEntry<Config>[];
|
|
47
47
|
}): Promise<void>;
|
|
48
48
|
//# sourceMappingURL=clone-referenced.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone-referenced.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/clone-referenced.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"clone-referenced.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction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EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAA;CAC1B,GACC,OAAO,CAAC,IAAI,CAAC,CAaf;AAkBD;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC9C,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE;IACP,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,YAAY,EAAE,GAAG,CAAC,UAAU,CAAA;IAC5B,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACjC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACrC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAA;CAC1B,GACC,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StripConfig, PromoteRootConfig } from './shared.types';
|
|
2
2
|
import { Scl, Config } from '../../../../config';
|
|
3
|
-
import {
|
|
3
|
+
import { OmitEntry } from '@dialecte/core';
|
|
4
4
|
import type * as Core from '@dialecte/core';
|
|
5
5
|
export type { StripConfig, PromoteRootConfig };
|
|
6
6
|
/**
|
|
@@ -15,7 +15,7 @@ export declare function cloneTree(tx: Core.Transaction<Config>, params: {
|
|
|
15
15
|
sourceQuery: Core.Query<Config>;
|
|
16
16
|
ref: Scl.Ref<Scl.ElementsOf>;
|
|
17
17
|
targetParent: Scl.Ref<Scl.ElementsOf>;
|
|
18
|
-
|
|
18
|
+
omit?: OmitEntry<Config>[];
|
|
19
19
|
promoteRoot?: PromoteRootConfig;
|
|
20
20
|
strip?: StripConfig | false;
|
|
21
21
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone-utils.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/clone-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"clone-utils.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/clone-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA;AAO9C;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC9B,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE;IACP,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC5B,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACrC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAA;IAC1B,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAA;CAC3B,GACC,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-data-model.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAE3C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACrC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE;IACP,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;CACjC,GACC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"extract-data-model.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAE3C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACrC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE;IACP,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;CACjC,GACC,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit-filters.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/omit-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,EAK1C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,EAUvC,CAAA"}
|
package/dist/v2019C1/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as q, U as w, K as Z, r as
|
|
1
|
+
import { R as q, U as w, K as Z, r as C, D as J, H as U, S as R } from "../index-lHFSidP5.js";
|
|
2
2
|
import { a as $t, b as Qt, c as zt } from "../index-lHFSidP5.js";
|
|
3
|
-
import { isChildOf as
|
|
3
|
+
import { isChildOf as b, stripAttributes as x } from "@dialecte/core/helpers";
|
|
4
4
|
import { invariant as B } from "@dialecte/core/utils";
|
|
5
5
|
import { createDialecteDocument as tt, openDialecteDocument as et, importXmlFiles as at, exportXmlFile as nt } from "@dialecte/core";
|
|
6
6
|
async function ot(t) {
|
|
@@ -69,8 +69,8 @@ async function rt(t) {
|
|
|
69
69
|
c = !0;
|
|
70
70
|
else {
|
|
71
71
|
u[f.attribute.uuid] = void 0, u[f.attribute.path] = void 0;
|
|
72
|
-
for (const
|
|
73
|
-
u[
|
|
72
|
+
for (const p of f.companions)
|
|
73
|
+
u[p.name] = void 0;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
Object.keys(u).length > 0 && await t.update(i, { attributes: u });
|
|
@@ -94,7 +94,7 @@ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
94
94
|
orphanUuidRefs: rt,
|
|
95
95
|
pruneEmptyContainers: st,
|
|
96
96
|
resetLNode: ot
|
|
97
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
97
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
98
98
|
transaction: ut
|
|
99
99
|
};
|
|
100
100
|
async function H(t, a) {
|
|
@@ -115,7 +115,7 @@ async function H(t, a) {
|
|
|
115
115
|
key: "ELEMENT_NOT_FOUND",
|
|
116
116
|
detail: `LNodeType not found for lnType="${i}"`
|
|
117
117
|
}), !y(n.lnodeTypes, i, r)) continue;
|
|
118
|
-
const c = r.children.filter((s) =>
|
|
118
|
+
const c = r.children.filter((s) => b(s, "DO")), u = await t.getRecords(c);
|
|
119
119
|
for (const s of u) {
|
|
120
120
|
if (!s) continue;
|
|
121
121
|
const d = await t.getAttribute(s, { name: "type" });
|
|
@@ -124,7 +124,7 @@ async function H(t, a) {
|
|
|
124
124
|
tagName: "DOType",
|
|
125
125
|
attributes: { id: d }
|
|
126
126
|
});
|
|
127
|
-
f && y(n.doTypes, d, f) && await
|
|
127
|
+
f && y(n.doTypes, d, f) && await E({ query: t, parent: f, dataModelMap: n });
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
return {
|
|
@@ -137,8 +137,8 @@ async function H(t, a) {
|
|
|
137
137
|
function y(t, a, e) {
|
|
138
138
|
return t.has(a) ? !1 : (t.set(a, e), !0);
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
141
|
-
const { query: a, parent: e, dataModelMap: n } = t, o = e.tagName === "DOType" ? await a.getRecords(e.children.filter((i) =>
|
|
140
|
+
async function E(t) {
|
|
141
|
+
const { query: a, parent: e, dataModelMap: n } = t, o = e.tagName === "DOType" ? await a.getRecords(e.children.filter((i) => b(i, "DA"))) : await a.getRecords(e.children.filter((i) => b(i, "BDA")));
|
|
142
142
|
for (const i of o) {
|
|
143
143
|
if (!i) continue;
|
|
144
144
|
const r = await a.getAttribute(i, { name: "bType" }), c = await a.getAttribute(i, { name: "type" });
|
|
@@ -154,12 +154,12 @@ async function _(t) {
|
|
|
154
154
|
tagName: "DAType",
|
|
155
155
|
attributes: { id: c }
|
|
156
156
|
});
|
|
157
|
-
u && y(n.daTypes, c, u) && await
|
|
157
|
+
u && y(n.daTypes, c, u) && await E({ query: a, parent: u, dataModelMap: n });
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
if (e.tagName === "DOType") {
|
|
162
|
-
const i = e.children.filter((c) =>
|
|
162
|
+
const i = e.children.filter((c) => b(c, "SDO")), r = await a.getRecords(i);
|
|
163
163
|
for (const c of r) {
|
|
164
164
|
const u = await a.getAttribute(c, { name: "type" });
|
|
165
165
|
if (!u) continue;
|
|
@@ -167,7 +167,7 @@ async function _(t) {
|
|
|
167
167
|
tagName: "DOType",
|
|
168
168
|
attributes: { id: u }
|
|
169
169
|
});
|
|
170
|
-
s && y(n.doTypes, u, s) && await
|
|
170
|
+
s && y(n.doTypes, u, s) && await E({ query: a, parent: s, dataModelMap: n });
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -216,12 +216,12 @@ async function k(t) {
|
|
|
216
216
|
async function $(t) {
|
|
217
217
|
return (await k(t)).at(-1);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
220
220
|
__proto__: null,
|
|
221
221
|
getLatestHitem: $,
|
|
222
222
|
getSortedHitems: k
|
|
223
223
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
224
|
-
async function
|
|
224
|
+
async function gt(t, a) {
|
|
225
225
|
const { filename: e, header: n, item: o } = a, { id: i, fileType: r, nameStructure: c, version: u, tool: s } = n, { who: d, what: f, why: l } = o, m = await t.getRoot(), A = await t.getRecord({ tagName: "Header" }) ?? await t.addChild(m, {
|
|
226
226
|
tagName: "Header",
|
|
227
227
|
attributes: {
|
|
@@ -233,12 +233,12 @@ async function pt(t, a) {
|
|
|
233
233
|
revision: "1",
|
|
234
234
|
uuid: crypto.randomUUID()
|
|
235
235
|
}
|
|
236
|
-
}),
|
|
236
|
+
}), X = await t.getRecord({ tagName: "History" }) ?? await t.addChild(A, { tagName: "History", attributes: {} }), I = await $(t), v = I?.attributes.find((_) => _.name === "version")?.value, P = I?.attributes.find((_) => _.name === "revision")?.value, h = u === "keep" ? v ?? "0" : v ? String(Number(v) + 1) : "0", D = P ? String(Number(P) + 1) : "1";
|
|
237
237
|
await t.update(A, {
|
|
238
238
|
attributes: { version: h, revision: D }
|
|
239
239
|
});
|
|
240
|
-
const
|
|
241
|
-
await t.addChild(
|
|
240
|
+
const M = /* @__PURE__ */ new Date(), g = M.toString().split(" "), Y = M.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), W = `${g[0]} ${g[1]} ${g[2]} ${g[4]} ${Y} ${g[3]}`;
|
|
241
|
+
await t.addChild(X, {
|
|
242
242
|
tagName: "Hitem",
|
|
243
243
|
attributes: {
|
|
244
244
|
version: h,
|
|
@@ -254,9 +254,9 @@ async function pt(t, a) {
|
|
|
254
254
|
}
|
|
255
255
|
const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
256
256
|
__proto__: null,
|
|
257
|
-
addEntry:
|
|
257
|
+
addEntry: gt
|
|
258
258
|
}, Symbol.toStringTag, { value: "Module" })), L = {
|
|
259
|
-
query:
|
|
259
|
+
query: pt,
|
|
260
260
|
transaction: yt
|
|
261
261
|
};
|
|
262
262
|
async function O(t) {
|
|
@@ -281,7 +281,7 @@ const wt = {
|
|
|
281
281
|
attributes: ["templateUuid", "originUuid"]
|
|
282
282
|
};
|
|
283
283
|
async function S(t, a) {
|
|
284
|
-
const { sourceQuery: e, ref: n, targetParent: o,
|
|
284
|
+
const { sourceQuery: e, ref: n, targetParent: o, omit: i, promoteRoot: r, strip: c = wt } = a, u = await e.getTree(n, { omit: i });
|
|
285
285
|
if (!u) return;
|
|
286
286
|
const s = r && u.tagName === r.from ? { ...u, tagName: r.to } : u;
|
|
287
287
|
let d = s;
|
|
@@ -290,9 +290,9 @@ async function S(t, a) {
|
|
|
290
290
|
attributes: s.attributes.filter((f) => !c.attributes.includes(f.name))
|
|
291
291
|
}), await t.deepClone(o, d);
|
|
292
292
|
}
|
|
293
|
-
async function
|
|
293
|
+
async function bt(t, a) {
|
|
294
294
|
const { sourceQuery: e, scopeRef: n } = a, { LNode: o = [] } = await e.findDescendants(n, {
|
|
295
|
-
|
|
295
|
+
collect: "LNode"
|
|
296
296
|
});
|
|
297
297
|
o.length > 0 && await j.transaction.extract(t, { sourceQuery: e, records: o });
|
|
298
298
|
}
|
|
@@ -306,18 +306,18 @@ async function F(t, a, e) {
|
|
|
306
306
|
return { tagName: i.tagName, id: i.id };
|
|
307
307
|
}
|
|
308
308
|
async function Q(t, a) {
|
|
309
|
-
const { sourceQuery: e, functionRef: n, targetParentRef: o,
|
|
309
|
+
const { sourceQuery: e, functionRef: n, targetParentRef: o, omit: i, stripRootAttributes: r } = a, c = r?.length ? { scope: "root", attributes: [...r] } : !1;
|
|
310
310
|
await S(t, {
|
|
311
311
|
sourceQuery: e,
|
|
312
312
|
ref: n,
|
|
313
313
|
targetParent: o,
|
|
314
|
-
|
|
314
|
+
omit: i,
|
|
315
315
|
promoteRoot: { from: "SubFunction", to: "Function" },
|
|
316
316
|
strip: c
|
|
317
|
-
}), await
|
|
317
|
+
}), await bt(t, { sourceQuery: e, scopeRef: n });
|
|
318
318
|
}
|
|
319
319
|
async function z(t, a) {
|
|
320
|
-
const { sourceQuery: e, functionRef: n, structure: o, stripCategoriesUuid: i = !0 } = a, r = await
|
|
320
|
+
const { sourceQuery: e, functionRef: n, structure: o, stripCategoriesUuid: i = !0 } = a, r = await Nt(e, n);
|
|
321
321
|
for (const c of r) {
|
|
322
322
|
if (await Rt(t, e, c)) continue;
|
|
323
323
|
const s = { tagName: "FunctionCategory", id: c }, d = await F(e, s, o);
|
|
@@ -329,21 +329,21 @@ async function z(t, a) {
|
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
async function
|
|
332
|
+
async function Nt(t, a) {
|
|
333
333
|
const e = await Tt(t, a), n = /* @__PURE__ */ new Set();
|
|
334
334
|
for (const { container: o } of e)
|
|
335
335
|
o && n.add(o.id);
|
|
336
336
|
return n;
|
|
337
337
|
}
|
|
338
338
|
async function Tt(t, a) {
|
|
339
|
-
const e = await
|
|
339
|
+
const e = await C.query.findRefsPointingTo(t, {
|
|
340
340
|
target: a,
|
|
341
341
|
containerTagName: "FunctionCategory"
|
|
342
342
|
}), { SubFunction: n = [] } = await t.findDescendants(a, {
|
|
343
|
-
|
|
343
|
+
collect: "SubFunction"
|
|
344
344
|
});
|
|
345
345
|
for (const o of n) {
|
|
346
|
-
const i = await
|
|
346
|
+
const i = await C.query.findRefsPointingTo(t, {
|
|
347
347
|
target: { tagName: "SubFunction", id: o.id },
|
|
348
348
|
containerTagName: "FunctionCategory"
|
|
349
349
|
});
|
|
@@ -367,7 +367,7 @@ async function Rt(t, a, e) {
|
|
|
367
367
|
}
|
|
368
368
|
async function V(t, a) {
|
|
369
369
|
const { sourceQuery: e, scopeRef: n, refTagName: o, targetTagName: i } = a, r = w[o][0].attribute.uuid, c = await e.findDescendants(n, {
|
|
370
|
-
|
|
370
|
+
collect: o
|
|
371
371
|
}), { [o]: u = [] } = c, s = /* @__PURE__ */ new Set();
|
|
372
372
|
for (const f of u) {
|
|
373
373
|
const l = f.attributes.find(
|
|
@@ -379,26 +379,26 @@ async function V(t, a) {
|
|
|
379
379
|
for (const f of s) {
|
|
380
380
|
const l = { uuid: f }, [m] = await t.findByAttributes({ tagName: i, attributes: l });
|
|
381
381
|
if (m) continue;
|
|
382
|
-
const [
|
|
382
|
+
const [p] = await e.findByAttributes({
|
|
383
383
|
tagName: i,
|
|
384
384
|
attributes: l
|
|
385
385
|
});
|
|
386
|
-
|
|
386
|
+
p && d.push({ tagName: i, id: p.id });
|
|
387
387
|
}
|
|
388
388
|
return d;
|
|
389
389
|
}
|
|
390
390
|
async function St(t, a) {
|
|
391
|
-
const { sourceQuery: e, scopeRef: n, refTagName: o, targetTagName: i, targetParent: r,
|
|
391
|
+
const { sourceQuery: e, scopeRef: n, refTagName: o, targetTagName: i, targetParent: r, omit: c } = a, u = await V(t, {
|
|
392
392
|
sourceQuery: e,
|
|
393
393
|
scopeRef: n,
|
|
394
394
|
refTagName: o,
|
|
395
395
|
targetTagName: i
|
|
396
396
|
});
|
|
397
397
|
for (const s of u)
|
|
398
|
-
await S(t, { sourceQuery: e, ref: s, targetParent: r,
|
|
398
|
+
await S(t, { sourceQuery: e, ref: s, targetParent: r, omit: c });
|
|
399
399
|
}
|
|
400
400
|
async function At(t, a) {
|
|
401
|
-
const { sourceQuery: e, scopeTagName: n, scopeRef: o, targetParent: i, skip: r = /* @__PURE__ */ new Set(),
|
|
401
|
+
const { sourceQuery: e, scopeTagName: n, scopeRef: o, targetParent: i, skip: r = /* @__PURE__ */ new Set(), omit: c } = a, u = J[n].filter(
|
|
402
402
|
(d) => d in w && !r.has(d)
|
|
403
403
|
), s = St;
|
|
404
404
|
for (const d of u)
|
|
@@ -410,24 +410,24 @@ async function At(t, a) {
|
|
|
410
410
|
refTagName: d,
|
|
411
411
|
targetTagName: l,
|
|
412
412
|
targetParent: i,
|
|
413
|
-
|
|
413
|
+
omit: c
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
const T = [
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
417
|
+
"FunctionSclRef",
|
|
418
|
+
"ApplicationSclRef",
|
|
419
|
+
"GeneralEquipment",
|
|
420
|
+
"ConductingEquipment"
|
|
421
421
|
], vt = [
|
|
422
422
|
...T,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
423
|
+
"DOS",
|
|
424
|
+
"Labels",
|
|
425
|
+
"LNodeInputs",
|
|
426
|
+
"LNodeOutputs",
|
|
427
|
+
"ProcessResources",
|
|
428
|
+
"PowerSystemRelations",
|
|
429
|
+
"BehaviorDescription",
|
|
430
|
+
"Variable"
|
|
431
431
|
];
|
|
432
432
|
async function ht(t, a) {
|
|
433
433
|
const { sourceQuery: e, applicationRef: n, structure: o } = a, i = {
|
|
@@ -445,7 +445,7 @@ async function ht(t, a) {
|
|
|
445
445
|
sourceQuery: e,
|
|
446
446
|
functionRef: s,
|
|
447
447
|
targetParentRef: d,
|
|
448
|
-
|
|
448
|
+
omit: T
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
451
|
for (const s of r)
|
|
@@ -461,13 +461,13 @@ async function ht(t, a) {
|
|
|
461
461
|
scopeRef: n,
|
|
462
462
|
targetParent: i,
|
|
463
463
|
skip: /* @__PURE__ */ new Set(["FunctionRef", "FunctionCategoryRef"]),
|
|
464
|
-
|
|
464
|
+
omit: T
|
|
465
465
|
});
|
|
466
466
|
const u = await F(e, n, o);
|
|
467
|
-
await S(t, { sourceQuery: e, ref: n, targetParent: u,
|
|
467
|
+
await S(t, { sourceQuery: e, ref: n, targetParent: u, omit: T });
|
|
468
468
|
}
|
|
469
|
-
async function
|
|
470
|
-
await
|
|
469
|
+
async function G(t) {
|
|
470
|
+
await N.transaction.orphanUuidRefs(t), await N.transaction.resetLNode(t), await N.transaction.pruneEmptyContainers(t);
|
|
471
471
|
}
|
|
472
472
|
async function Dt(t, a) {
|
|
473
473
|
const { sourceQuery: e, applicationRef: n, tool: o, who: i, nameStructure: r } = a, c = await O(t), u = await t.getAttribute(n, { name: "name" }) || "Unnamed Application";
|
|
@@ -484,9 +484,9 @@ async function Dt(t, a) {
|
|
|
484
484
|
what: "ASD initialization",
|
|
485
485
|
why: "Application was extracted from a previous file"
|
|
486
486
|
}
|
|
487
|
-
}), await ht(t, { sourceQuery: e, applicationRef: n, structure: c }), await
|
|
487
|
+
}), await ht(t, { sourceQuery: e, applicationRef: n, structure: c }), await G(t);
|
|
488
488
|
}
|
|
489
|
-
async function
|
|
489
|
+
async function _t(t, a) {
|
|
490
490
|
const { sourceQuery: e, functionRef: n, tool: o, who: i, nameStructure: r } = a, c = await O(t), u = {
|
|
491
491
|
tagName: c.Substation.tagName,
|
|
492
492
|
id: c.Substation.id
|
|
@@ -508,38 +508,38 @@ async function Ct(t, a) {
|
|
|
508
508
|
sourceQuery: e,
|
|
509
509
|
functionRef: n,
|
|
510
510
|
targetParentRef: u,
|
|
511
|
-
|
|
511
|
+
omit: vt,
|
|
512
512
|
stripRootAttributes: ["templateUuid"]
|
|
513
513
|
}), await z(t, {
|
|
514
514
|
sourceQuery: e,
|
|
515
515
|
functionRef: n,
|
|
516
516
|
structure: c
|
|
517
|
-
}), await
|
|
517
|
+
}), await G(t);
|
|
518
518
|
}
|
|
519
|
-
const
|
|
519
|
+
const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
520
520
|
__proto__: null,
|
|
521
521
|
ensureSubstationTemplateStructure: O,
|
|
522
522
|
extractToAsd: Dt,
|
|
523
|
-
extractToFsd:
|
|
524
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
525
|
-
transaction:
|
|
526
|
-
},
|
|
527
|
-
function
|
|
523
|
+
extractToFsd: _t
|
|
524
|
+
}, Symbol.toStringTag, { value: "Module" })), Et = {
|
|
525
|
+
transaction: Ct
|
|
526
|
+
}, K = { cleanUp: N, dataModel: j, history: L, reference: C, template: Et };
|
|
527
|
+
function Mt(t) {
|
|
528
528
|
const { storage: a, extensions: e } = t;
|
|
529
529
|
return et({
|
|
530
530
|
config: R,
|
|
531
531
|
storage: a,
|
|
532
|
-
extensions: { base:
|
|
533
|
-
hooks:
|
|
532
|
+
extensions: { base: K, custom: e },
|
|
533
|
+
hooks: U
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
async function
|
|
536
|
+
async function Ut(t) {
|
|
537
537
|
const { storage: a, extensions: e } = t;
|
|
538
538
|
return tt({
|
|
539
539
|
config: R,
|
|
540
540
|
storage: a,
|
|
541
|
-
extensions: { base:
|
|
542
|
-
hooks:
|
|
541
|
+
extensions: { base: K, custom: e },
|
|
542
|
+
hooks: U
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
function Bt(t) {
|
|
@@ -565,8 +565,8 @@ export {
|
|
|
565
565
|
R as SCL_DIALECTE_CONFIG,
|
|
566
566
|
Qt as SCL_IO_CONFIG,
|
|
567
567
|
zt as SCL_NAMESPACES,
|
|
568
|
-
|
|
568
|
+
Ut as createSclDocument,
|
|
569
569
|
Ht as exportSclFile,
|
|
570
570
|
Bt as importSclFiles,
|
|
571
|
-
|
|
571
|
+
Mt as openSclDocument
|
|
572
572
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialecte/scl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Dialecte - SCL (Substation Configuration Language) sdk",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"prepare": "husky"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@dialecte/core": "0.1.
|
|
50
|
+
"@dialecte/core": "0.1.19",
|
|
51
51
|
"dexie": "4.2.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exclude-filters.d.ts","sourceRoot":"","sources":["../../../../../../src/v2019C1/extensions/template/transaction/shared/exclude-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,EAKjD,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAU9C,CAAA"}
|