@dialecte/scl 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{hooks-CtOTydon.js → hooks-BTkrNj6r.js} +2620 -903
- package/dist/v2019C1/constants/index.d.ts +2 -0
- package/dist/v2019C1/constants/index.d.ts.map +1 -0
- package/dist/v2019C1/{extensions/reference/constants/pairs.d.ts → constants/reference-pairs.d.ts} +2 -13
- package/dist/v2019C1/constants/reference-pairs.d.ts.map +1 -0
- package/dist/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.d.ts +3 -1
- package/dist/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.d.ts.map +1 -1
- package/dist/v2019C1/extensions/clean-up/transaction/orphan-uuid-refs.d.ts.map +1 -1
- package/dist/v2019C1/extensions/identity/index.d.ts +5 -0
- package/dist/v2019C1/extensions/identity/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/identity/transaction/index.d.ts +3 -0
- package/dist/v2019C1/extensions/identity/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/identity/transaction/write-identity.d.ts +21 -0
- package/dist/v2019C1/extensions/identity/transaction/write-identity.d.ts.map +1 -0
- package/dist/v2019C1/extensions/identity/transaction/write-identity.types.d.ts +3 -0
- package/dist/v2019C1/extensions/identity/transaction/write-identity.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/index.d.ts +17 -3
- package/dist/v2019C1/extensions/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/lifecycle/apply/apply.d.ts +29 -0
- package/dist/v2019C1/extensions/lifecycle/apply/apply.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/apply/apply.types.d.ts +26 -0
- package/dist/v2019C1/extensions/lifecycle/apply/apply.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/apply/index.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/apply/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.constants.d.ts +5 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.constants.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.d.ts +25 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.types.d.ts +23 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/classify-attribute.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/find-constraint-violation.d.ts +21 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/find-constraint-violation.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/find-constraint-violation.types.d.ts +26 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/find-constraint-violation.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/find-constraint-violations.d.ts +17 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/find-constraint-violations.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/identity-fields.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/identity-fields.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/index.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/public.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-placement-collision.d.ts +29 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-placement-collision.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-placement-collision.types.d.ts +20 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-placement-collision.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-unique-value.d.ts +23 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-unique-value.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-unique-value.types.d.ts +16 -0
- package/dist/v2019C1/extensions/lifecycle/constraints/resolve-unique-value.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/contract.types.d.ts +53 -0
- package/dist/v2019C1/extensions/lifecycle/contract.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.constants.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.constants.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.d.ts +13 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/clone-applied-satellites.d.ts +24 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/clone-applied-satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/index.d.ts +4 -0
- package/dist/v2019C1/extensions/lifecycle/cross-cutting/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/decide.d.ts +31 -0
- package/dist/v2019C1/extensions/lifecycle/engine/decide.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/decide.types.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/engine/decide.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/diff.d.ts +30 -0
- package/dist/v2019C1/extensions/lifecycle/engine/diff.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/diff.types.d.ts +121 -0
- package/dist/v2019C1/extensions/lifecycle/engine/diff.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/group.d.ts +16 -0
- package/dist/v2019C1/extensions/lifecycle/engine/group.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/index.d.ts +8 -0
- package/dist/v2019C1/extensions/lifecycle/engine/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/public.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/engine/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/reconcile.d.ts +37 -0
- package/dist/v2019C1/extensions/lifecycle/engine/reconcile.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/engine/visible-attributes.d.ts +7 -0
- package/dist/v2019C1/extensions/lifecycle/engine/visible-attributes.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/extract/index.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/extract/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/asd/to-asd.d.ts → lifecycle/extract/transaction/asd.d.ts} +3 -3
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/asd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/shared → lifecycle/extract/transaction}/ensure-substation-structure.d.ts +1 -1
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/ensure-substation-structure.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/fsd/to-fsd.d.ts → lifecycle/extract/transaction/fsd.d.ts} +3 -3
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/fsd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/index.d.ts +4 -0
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/fsd → lifecycle/extract/transaction}/omit.d.ts +1 -1
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/omit.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/shared → lifecycle/extract/transaction}/post-extraction-cleanup.d.ts +1 -1
- package/dist/v2019C1/extensions/lifecycle/extract/transaction/post-extraction-cleanup.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/index.d.ts +44 -0
- package/dist/v2019C1/extensions/lifecycle/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instance/composed-functions.d.ts +10 -0
- package/dist/v2019C1/extensions/lifecycle/instance/composed-functions.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instance/find-instance.d.ts +50 -0
- package/dist/v2019C1/extensions/lifecycle/instance/find-instance.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instance/index.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/instance/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/index.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/asd.d.ts +22 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/asd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/asd.types.d.ts +21 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/asd.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.d.ts +27 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.types.d.ts +22 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/index.d.ts +6 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/resolve-target-structure.d.ts +20 -0
- package/dist/v2019C1/extensions/lifecycle/instantiate/transaction/resolve-target-structure.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/clone-application.d.ts +20 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/clone-application.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/index.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/satellites.constants.d.ts +15 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/satellites.constants.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/satellites.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/layers/application/satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/shared → lifecycle/layers/function}/clone-function.d.ts +4 -4
- package/dist/v2019C1/extensions/lifecycle/layers/function/clone-function.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/function/index.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/layers/function/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/function/satellites.constants.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/layers/function/satellites.constants.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/function/satellites.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/layers/function/satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/index.d.ts +4 -0
- package/dist/v2019C1/extensions/lifecycle/layers/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/layers/omit-filters.d.ts +9 -0
- package/dist/v2019C1/extensions/lifecycle/layers/omit-filters.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/public.d.ts +7 -0
- package/dist/v2019C1/extensions/lifecycle/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/index.d.ts +4 -0
- package/dist/v2019C1/extensions/lifecycle/report/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/mark-placement-conflicts.d.ts +22 -0
- package/dist/v2019C1/extensions/lifecycle/report/mark-placement-conflicts.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/presentation-scope.d.ts +13 -0
- package/dist/v2019C1/extensions/lifecycle/report/presentation-scope.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/presentation-scope.types.d.ts +12 -0
- package/dist/v2019C1/extensions/lifecycle/report/presentation-scope.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/public.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/report/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/cross-cutting-satellites.d.ts +21 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/cross-cutting-satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/index.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-asd.d.ts +22 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-asd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-fsd.d.ts +23 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-fsd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-function-satellites.d.ts +21 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-function-satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-function.d.ts +21 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/report-function.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/satellite-companions.d.ts +29 -0
- package/dist/v2019C1/extensions/lifecycle/report/query/satellite-companions.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/report/report.d.ts +17 -0
- package/dist/v2019C1/extensions/lifecycle/report/report.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/index.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/public.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction → lifecycle/transplant}/transaction/deep.d.ts +8 -2
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/deep.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction → lifecycle/transplant}/transaction/deep.types.d.ts +3 -3
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/deep.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/index.d.ts +8 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/add-children-to.d.ts +23 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/add-children-to.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction → lifecycle/transplant}/transaction/primitives/clone-referenced.d.ts +5 -6
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-referenced.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-referenced.types.d.ts +4 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-referenced.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction → lifecycle/transplant}/transaction/primitives/clone-tree.d.ts +4 -5
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-tree.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction → lifecycle/transplant}/transaction/primitives/clone-tree.types.d.ts +2 -2
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-tree.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{extraction/transaction/recipes/shared → lifecycle/transplant/transaction}/resolve-structure-ref.d.ts +6 -6
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/resolve-structure-ref.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/structure.types.d.ts +13 -0
- package/dist/v2019C1/extensions/lifecycle/transplant/transaction/structure.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/index.d.ts +2 -0
- package/dist/v2019C1/extensions/lifecycle/update/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/asd.d.ts +38 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/asd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/cross-cutting-satellites.d.ts +23 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/cross-cutting-satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/fsd.d.ts +29 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/fsd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/function-satellites.d.ts +33 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/function-satellites.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/index.d.ts +3 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/satellite-reconcile.d.ts +29 -0
- package/dist/v2019C1/extensions/lifecycle/update/transaction/satellite-reconcile.d.ts.map +1 -0
- package/dist/v2019C1/extensions/presentation/constants/title.d.ts +6 -0
- package/dist/v2019C1/extensions/presentation/constants/title.d.ts.map +1 -1
- package/dist/v2019C1/extensions/public.d.ts +2 -1
- package/dist/v2019C1/extensions/public.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/derived.d.ts +7 -0
- package/dist/v2019C1/extensions/reference/constants/derived.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/index.d.ts +1 -2
- package/dist/v2019C1/extensions/reference/constants/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/orphan-rules.d.ts +1 -1
- package/dist/v2019C1/extensions/reference/constants/orphan-rules.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/types.d.ts +2 -1
- package/dist/v2019C1/extensions/reference/constants/types.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/build/build-element-path.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/build/build-reference-path.d.ts +6 -0
- package/dist/v2019C1/extensions/reference/query/build/build-reference-path.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/index.d.ts +1 -0
- package/dist/v2019C1/extensions/reference/query/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/provenance/get-provenance.constants.d.ts +8 -0
- package/dist/v2019C1/extensions/reference/query/provenance/get-provenance.constants.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/provenance/get-provenance.d.ts +12 -0
- package/dist/v2019C1/extensions/reference/query/provenance/get-provenance.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/provenance/get-provenance.types.d.ts +19 -0
- package/dist/v2019C1/extensions/reference/query/provenance/get-provenance.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/provenance/index.d.ts +3 -0
- package/dist/v2019C1/extensions/reference/query/provenance/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/resolve/parse-path.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/query/resolve/resolve-reference-path.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/transaction/index.d.ts +2 -0
- package/dist/v2019C1/extensions/reference/transaction/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/transaction/write-provenance.d.ts +18 -0
- package/dist/v2019C1/extensions/reference/transaction/write-provenance.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/transaction/write-provenance.types.d.ts +13 -0
- package/dist/v2019C1/extensions/reference/transaction/write-provenance.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.d.ts.map +1 -1
- package/dist/v2019C1/hooks/after-deep-clone/ref-paths.d.ts.map +1 -1
- package/dist/v2019C1/hooks/before-delete/orphaned-refs.d.ts.map +1 -1
- package/dist/v2019C1/hooks/io/io-hooks.d.ts.map +1 -1
- package/dist/v2019C1/hooks/shared/ref-entry-ops.d.ts.map +1 -1
- package/dist/v2019C1/index.d.ts +1 -0
- package/dist/v2019C1/index.d.ts.map +1 -1
- package/dist/v2019C1/index.js +12 -12
- package/dist/v2019C1/test/hydrated-test.d.ts +34 -6
- package/dist/v2019C1/test/hydrated-test.d.ts.map +1 -1
- package/dist/v2019C1/test.js +11 -11
- package/package.json +6 -4
- package/dist/v2019C1/extensions/extraction/index.d.ts +0 -12
- package/dist/v2019C1/extensions/extraction/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/public.d.ts +0 -3
- package/dist/v2019C1/extensions/extraction/public.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/deep.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/deep.types.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/index.d.ts +0 -6
- package/dist/v2019C1/extensions/extraction/transaction/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/primitives/clone-referenced.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/primitives/clone-tree.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/primitives/clone-tree.types.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/clone-application.d.ts +0 -16
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/clone-application.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/index.d.ts +0 -2
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/to-asd.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/index.d.ts +0 -2
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/omit.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/to-fsd.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/clone-function.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/ensure-substation-structure.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/omit-filters.d.ts +0 -4
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/omit-filters.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/post-extraction-cleanup.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/resolve-structure-ref.d.ts.map +0 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/shared.types.d.ts +0 -7
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/shared.types.d.ts.map +0 -1
- package/dist/v2019C1/extensions/reference/constants/pairs.d.ts.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
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
|
|
1
|
+
import { XSI_NAMESPACE as e, isChildOf as t, isElementOf as n, stripAttributes as r, toRawRecord as i, toRef as a } from "@dialecte/core/helpers";
|
|
2
|
+
import { invariant as o } from "@dialecte/core/utils";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
|
-
var
|
|
4
|
+
var s = Object.defineProperty, c = (e, t) => {
|
|
5
5
|
let n = {};
|
|
6
|
-
for (var r in e)
|
|
6
|
+
for (var r in e) s(n, r, {
|
|
7
7
|
get: e[r],
|
|
8
8
|
enumerable: !0
|
|
9
9
|
});
|
|
10
|
-
return t ||
|
|
11
|
-
},
|
|
10
|
+
return t || s(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
11
|
+
}, l = /* @__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("."), u = {
|
|
12
12
|
AccessControl: [],
|
|
13
13
|
AccessPoint: [
|
|
14
14
|
"Text",
|
|
@@ -799,7 +799,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
799
799
|
"ProcessResources",
|
|
800
800
|
"Variable"
|
|
801
801
|
]
|
|
802
|
-
},
|
|
802
|
+
}, d = {
|
|
803
803
|
AccessControl: ["LDevice"],
|
|
804
804
|
AccessPoint: ["IED"],
|
|
805
805
|
Address: [
|
|
@@ -1197,7 +1197,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
1197
1197
|
],
|
|
1198
1198
|
Voltage: ["Line", "VoltageLevel"],
|
|
1199
1199
|
VoltageLevel: ["Substation"]
|
|
1200
|
-
},
|
|
1200
|
+
}, f = {
|
|
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 o = Object.defineProperty, s = (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
|
+
}, p = {
|
|
1933
1933
|
AccessControl: [
|
|
1934
1934
|
"AccessPoint",
|
|
1935
1935
|
"IED",
|
|
@@ -3702,13 +3702,13 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
3702
3702
|
"SCL",
|
|
3703
3703
|
"Substation"
|
|
3704
3704
|
]
|
|
3705
|
-
},
|
|
3705
|
+
}, m = [
|
|
3706
3706
|
"Communication",
|
|
3707
3707
|
"DataTypeTemplates",
|
|
3708
3708
|
"Header",
|
|
3709
3709
|
"History",
|
|
3710
3710
|
"SCL"
|
|
3711
|
-
],
|
|
3711
|
+
], h = {
|
|
3712
3712
|
AccessControl: {},
|
|
3713
3713
|
AccessPoint: {
|
|
3714
3714
|
clock: "",
|
|
@@ -5161,7 +5161,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
5161
5161
|
templateUuid: "",
|
|
5162
5162
|
uuid: ""
|
|
5163
5163
|
}
|
|
5164
|
-
},
|
|
5164
|
+
}, g = {
|
|
5165
5165
|
AccessControl: {
|
|
5166
5166
|
tag: "AccessControl",
|
|
5167
5167
|
namespace: {
|
|
@@ -24516,7 +24516,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
24516
24516
|
]
|
|
24517
24517
|
}]
|
|
24518
24518
|
}
|
|
24519
|
-
},
|
|
24519
|
+
}, _ = { supportedFileExtensions: [
|
|
24520
24520
|
".fsd",
|
|
24521
24521
|
".asd",
|
|
24522
24522
|
".ssd",
|
|
@@ -24524,7 +24524,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
24524
24524
|
".isd",
|
|
24525
24525
|
".icd",
|
|
24526
24526
|
".xml"
|
|
24527
|
-
] },
|
|
24527
|
+
] }, v = {
|
|
24528
24528
|
recordSchema: {
|
|
24529
24529
|
primaryKey: "id",
|
|
24530
24530
|
indexes: [
|
|
@@ -24542,7 +24542,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
24542
24542
|
},
|
|
24543
24543
|
additionalTables: { attachedFiles: { schema: "id, filename, file" } }
|
|
24544
24544
|
}
|
|
24545
|
-
},
|
|
24545
|
+
}, y = {
|
|
24546
24546
|
default: {
|
|
24547
24547
|
uri: "http://www.iec.ch/61850/2003/SCL",
|
|
24548
24548
|
prefix: ""
|
|
@@ -24552,28 +24552,31 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
24552
24552
|
prefix: "eIEC61850-6-100"
|
|
24553
24553
|
},
|
|
24554
24554
|
xsi: e
|
|
24555
|
-
},
|
|
24555
|
+
}, b = {
|
|
24556
24556
|
rootElementName: "SCL",
|
|
24557
|
-
singletonElements:
|
|
24557
|
+
singletonElements: m,
|
|
24558
24558
|
transparentElements: ["Private"],
|
|
24559
|
-
elements:
|
|
24560
|
-
namespaces:
|
|
24561
|
-
attributes:
|
|
24562
|
-
children:
|
|
24563
|
-
parents:
|
|
24564
|
-
descendants:
|
|
24565
|
-
ancestors:
|
|
24566
|
-
database:
|
|
24567
|
-
io:
|
|
24568
|
-
definition:
|
|
24559
|
+
elements: l,
|
|
24560
|
+
namespaces: y,
|
|
24561
|
+
attributes: h,
|
|
24562
|
+
children: u,
|
|
24563
|
+
parents: d,
|
|
24564
|
+
descendants: f,
|
|
24565
|
+
ancestors: p,
|
|
24566
|
+
database: v,
|
|
24567
|
+
io: _,
|
|
24568
|
+
definition: g
|
|
24569
24569
|
};
|
|
24570
24570
|
//#endregion
|
|
24571
24571
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.ts
|
|
24572
|
-
async function
|
|
24572
|
+
async function ee(e) {
|
|
24573
24573
|
let t = await e.getRecordsByTagName("LNode");
|
|
24574
24574
|
for (let n of t) {
|
|
24575
24575
|
let t = await e.getAttribute(n, { name: "iedName" });
|
|
24576
|
-
if (!t || t === "None")
|
|
24576
|
+
if (!t || t === "None") {
|
|
24577
|
+
await e.update(n, { attributes: { iedName: "None" } });
|
|
24578
|
+
continue;
|
|
24579
|
+
}
|
|
24577
24580
|
let [r] = await e.findByAttributes({
|
|
24578
24581
|
tagName: "IED",
|
|
24579
24582
|
attributes: { name: t }
|
|
@@ -24689,16 +24692,16 @@ var S = {
|
|
|
24689
24692
|
PowerSystemRelation: { type: "name" },
|
|
24690
24693
|
Variable: { type: "name" },
|
|
24691
24694
|
Process: { type: "name" }
|
|
24692
|
-
},
|
|
24695
|
+
}, te = [
|
|
24693
24696
|
"lnClass",
|
|
24694
24697
|
"prefix",
|
|
24695
24698
|
"inst",
|
|
24696
24699
|
"lnInst"
|
|
24697
|
-
],
|
|
24700
|
+
], ne = new Set(Object.values(S).flatMap((e) => {
|
|
24698
24701
|
switch (e.type) {
|
|
24699
24702
|
case "transparent": return [];
|
|
24700
24703
|
case "name": return ["name"];
|
|
24701
|
-
case "lnClass": return [...
|
|
24704
|
+
case "lnClass": return [...te];
|
|
24702
24705
|
case "attribute": return [e.attr];
|
|
24703
24706
|
case "sourceRef": return [
|
|
24704
24707
|
"input",
|
|
@@ -24710,13 +24713,13 @@ var S = {
|
|
|
24710
24713
|
}));
|
|
24711
24714
|
//#endregion
|
|
24712
24715
|
//#region src/v2019C1/extensions/reference/query/build/path-segment.ts
|
|
24713
|
-
function
|
|
24716
|
+
function re(e) {
|
|
24714
24717
|
switch (e.type) {
|
|
24715
24718
|
case "transparent": return () => null;
|
|
24716
24719
|
case "name": {
|
|
24717
24720
|
let t = e.separator ?? "/";
|
|
24718
24721
|
return (e) => {
|
|
24719
|
-
let n =
|
|
24722
|
+
let n = w(e, "name");
|
|
24720
24723
|
return n ? {
|
|
24721
24724
|
segment: n,
|
|
24722
24725
|
separator: t
|
|
@@ -24724,34 +24727,34 @@ function te(e) {
|
|
|
24724
24727
|
};
|
|
24725
24728
|
}
|
|
24726
24729
|
case "lnClass": return (e) => {
|
|
24727
|
-
let t =
|
|
24730
|
+
let t = w(e, "lnClass");
|
|
24728
24731
|
return t ? {
|
|
24729
|
-
segment: `${
|
|
24732
|
+
segment: `${w(e, "prefix") ?? ""}${t}${w(e, "inst") ?? w(e, "lnInst") ?? ""}`,
|
|
24730
24733
|
separator: "/"
|
|
24731
24734
|
} : null;
|
|
24732
24735
|
};
|
|
24733
24736
|
case "attribute": return (t) => {
|
|
24734
|
-
let n =
|
|
24737
|
+
let n = w(t, e.attr);
|
|
24735
24738
|
return n ? {
|
|
24736
24739
|
segment: n,
|
|
24737
24740
|
separator: e.separator
|
|
24738
24741
|
} : null;
|
|
24739
24742
|
};
|
|
24740
24743
|
case "sourceRef": return (e) => {
|
|
24741
|
-
let t =
|
|
24744
|
+
let t = w(e, "input");
|
|
24742
24745
|
if (!t) return null;
|
|
24743
|
-
let n = t, r =
|
|
24746
|
+
let n = t, r = w(e, "inputInst");
|
|
24744
24747
|
r && r !== "1" && (n += `(${r})`);
|
|
24745
|
-
let i =
|
|
24748
|
+
let i = w(e, "pDA");
|
|
24746
24749
|
return i && (n += `.${i}`), {
|
|
24747
24750
|
segment: n,
|
|
24748
24751
|
separator: "."
|
|
24749
24752
|
};
|
|
24750
24753
|
};
|
|
24751
24754
|
case "controlRef": return (e) => {
|
|
24752
|
-
let t =
|
|
24755
|
+
let t = w(e, "output");
|
|
24753
24756
|
if (!t) return null;
|
|
24754
|
-
let n = t, r =
|
|
24757
|
+
let n = t, r = w(e, "outputInst");
|
|
24755
24758
|
return r && r !== "1" && (n += `(${r})`), {
|
|
24756
24759
|
segment: n,
|
|
24757
24760
|
separator: "."
|
|
@@ -24759,15 +24762,15 @@ function te(e) {
|
|
|
24759
24762
|
};
|
|
24760
24763
|
}
|
|
24761
24764
|
}
|
|
24762
|
-
var
|
|
24763
|
-
function
|
|
24764
|
-
let t =
|
|
24765
|
+
var ie = Object.fromEntries(Object.entries(S).map(([e, t]) => [e, re(t)]));
|
|
24766
|
+
function C(e) {
|
|
24767
|
+
let t = ie[e.tagName];
|
|
24765
24768
|
return t ? t(e) : null;
|
|
24766
24769
|
}
|
|
24767
|
-
function
|
|
24770
|
+
function ae(e) {
|
|
24768
24771
|
let { record: t, ancestry: n } = e, r = [];
|
|
24769
24772
|
for (let e of n) {
|
|
24770
|
-
let t =
|
|
24773
|
+
let t = C(e);
|
|
24771
24774
|
t && r.push({
|
|
24772
24775
|
...t,
|
|
24773
24776
|
ref: {
|
|
@@ -24776,7 +24779,7 @@ function re(e) {
|
|
|
24776
24779
|
}
|
|
24777
24780
|
});
|
|
24778
24781
|
}
|
|
24779
|
-
let i =
|
|
24782
|
+
let i = C(t);
|
|
24780
24783
|
return i && r.push({
|
|
24781
24784
|
...i,
|
|
24782
24785
|
ref: {
|
|
@@ -24784,324 +24787,36 @@ function re(e) {
|
|
|
24784
24787
|
id: t.id
|
|
24785
24788
|
}
|
|
24786
24789
|
}), r.length === 0 ? null : {
|
|
24787
|
-
path:
|
|
24790
|
+
path: oe(r),
|
|
24788
24791
|
segments: r
|
|
24789
24792
|
};
|
|
24790
24793
|
}
|
|
24791
|
-
function
|
|
24794
|
+
function w(e, t) {
|
|
24792
24795
|
return e.attributes.find((e) => e.name === t)?.value;
|
|
24793
24796
|
}
|
|
24794
|
-
function
|
|
24797
|
+
function oe(e) {
|
|
24795
24798
|
let t = e[0].segment;
|
|
24796
24799
|
for (let n = 1; n < e.length; n++) t += e[n].separator + e[n].segment;
|
|
24797
24800
|
return t;
|
|
24798
24801
|
}
|
|
24799
24802
|
//#endregion
|
|
24800
24803
|
//#region src/v2019C1/extensions/reference/query/build/build-element-path.ts
|
|
24801
|
-
async function
|
|
24804
|
+
async function se(e, t) {
|
|
24802
24805
|
let n = await e.getRecord(t);
|
|
24803
24806
|
if (!n) return null;
|
|
24804
|
-
let r =
|
|
24805
|
-
|
|
24806
|
-
|
|
24807
|
-
|
|
24808
|
-
});
|
|
24809
|
-
}
|
|
24810
|
-
//#endregion
|
|
24811
|
-
//#region src/v2019C1/extensions/reference/query/resolve/parse-path.ts
|
|
24812
|
-
function ae(e) {
|
|
24813
|
-
if (!e) return [];
|
|
24814
|
-
let t = [], n = "", r = "/";
|
|
24815
|
-
for (let i of e) i === "/" || i === "." ? (n && t.push({
|
|
24816
|
-
segment: n,
|
|
24817
|
-
separator: r
|
|
24818
|
-
}), r = i, n = "") : n += i;
|
|
24819
|
-
return n && t.push({
|
|
24820
|
-
segment: n,
|
|
24821
|
-
separator: r
|
|
24822
|
-
}), t;
|
|
24823
|
-
}
|
|
24824
|
-
function D(e) {
|
|
24825
|
-
let t = e.split("/"), n = t[t.length - 1], r = n.indexOf(".");
|
|
24826
|
-
if (r === -1) return { path: e };
|
|
24827
|
-
let i = n.substring(0, r), a = n.substring(r + 1);
|
|
24828
|
-
return {
|
|
24829
|
-
path: [...t.slice(0, -1), i].join("/"),
|
|
24830
|
-
qualifier: a || void 0
|
|
24831
|
-
};
|
|
24832
|
-
}
|
|
24833
|
-
function oe(e, t, n, r) {
|
|
24834
|
-
return !e || e === k.unsupported ? null : e === k.direct ? { lookupKey: n } : e === k.iedAddress ? ce(n, r) : e === k.lnode ? se(n) : e === k.behaviorDescription ? le(t, n, r) : null;
|
|
24835
|
-
}
|
|
24836
|
-
function se(e) {
|
|
24837
|
-
let { path: t, qualifier: n } = D(e);
|
|
24838
|
-
return {
|
|
24839
|
-
lookupKey: t,
|
|
24840
|
-
qualifier: n
|
|
24841
|
-
};
|
|
24842
|
-
}
|
|
24843
|
-
function ce(e, t) {
|
|
24844
|
-
if (t) {
|
|
24845
|
-
let n = fe(t);
|
|
24846
|
-
if (n) return {
|
|
24847
|
-
lookupKey: e,
|
|
24848
|
-
fallbackLookupKey: `${n}/${e}`
|
|
24849
|
-
};
|
|
24850
|
-
}
|
|
24851
|
-
return { lookupKey: e };
|
|
24852
|
-
}
|
|
24853
|
-
function le(e, t, n) {
|
|
24854
|
-
if (!n) return null;
|
|
24855
|
-
let r = ue(n);
|
|
24856
|
-
return r ? e === "dataName" ? {
|
|
24857
|
-
lookupKey: r,
|
|
24858
|
-
qualifier: t
|
|
24859
|
-
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${de(t)}` } : null : null;
|
|
24860
|
-
}
|
|
24861
|
-
function ue(e) {
|
|
24862
|
-
let t = -1;
|
|
24863
|
-
for (let n = e.length - 1; n >= 0; n--) if (e[n].tagName === "BehaviorDescription") {
|
|
24864
|
-
t = n;
|
|
24865
|
-
break;
|
|
24866
|
-
}
|
|
24867
|
-
if (t === -1) return null;
|
|
24868
|
-
let n = [];
|
|
24869
|
-
for (let r = 0; r < t; r++) {
|
|
24870
|
-
let t = w(e[r]);
|
|
24871
|
-
t && n.push(t);
|
|
24872
|
-
}
|
|
24873
|
-
return n.length === 0 ? null : E(n);
|
|
24874
|
-
}
|
|
24875
|
-
function de(e) {
|
|
24876
|
-
let t = e.indexOf("("), n = e.indexOf(".");
|
|
24877
|
-
return t === -1 ? n === -1 ? e : e.substring(0, n) : e.substring(0, t);
|
|
24878
|
-
}
|
|
24879
|
-
function fe(e) {
|
|
24880
|
-
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;
|
|
24881
|
-
return null;
|
|
24882
|
-
}
|
|
24883
|
-
//#endregion
|
|
24884
|
-
//#region src/v2019C1/extensions/reference/query/build/build-reference-path.ts
|
|
24885
|
-
async function pe(e, t) {
|
|
24886
|
-
let { reference: n, target: r } = t, a = me(n.tagName, r.tagName);
|
|
24887
|
-
if (!a) return null;
|
|
24888
|
-
let o = a.resolution;
|
|
24889
|
-
if (o === k.unsupported) return null;
|
|
24890
|
-
if (o === k.behaviorDescription) {
|
|
24891
|
-
let t = await e.getRecord(r);
|
|
24892
|
-
return t ? w(i(t))?.segment ?? null : null;
|
|
24893
|
-
}
|
|
24894
|
-
let s = await ie(e, r);
|
|
24895
|
-
if (!s) return null;
|
|
24896
|
-
let c = s.path;
|
|
24897
|
-
if (o === k.lnode) {
|
|
24898
|
-
let t = await e.getRecord(n);
|
|
24899
|
-
if (!t) return c;
|
|
24900
|
-
let r = t.attributes.find((e) => e.name === a.attribute.path)?.value;
|
|
24901
|
-
if (!r) return c;
|
|
24902
|
-
let { qualifier: i } = D(r);
|
|
24903
|
-
return i ? `${c}.${i}` : c;
|
|
24904
|
-
}
|
|
24905
|
-
return c;
|
|
24906
|
-
}
|
|
24907
|
-
function me(e, t) {
|
|
24908
|
-
let n = A[e];
|
|
24909
|
-
return n ? n.find((e) => e.target.includes(t)) ?? null : null;
|
|
24910
|
-
}
|
|
24911
|
-
//#endregion
|
|
24912
|
-
//#region src/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.ts
|
|
24913
|
-
function he(e) {
|
|
24914
|
-
let t = e.iedName;
|
|
24915
|
-
if (!t || t === ge) return null;
|
|
24916
|
-
let n = e.ldInst, r = e.lnClass;
|
|
24917
|
-
return !n || !r ? null : `${t}/${n}/${`${e.prefix ?? ""}${r}${e.lnInst ?? ""}`}`;
|
|
24918
|
-
}
|
|
24919
|
-
var ge = "None";
|
|
24920
|
-
//#endregion
|
|
24921
|
-
//#region src/v2019C1/extensions/reference/query/resolve/resolve-reference-path.ts
|
|
24922
|
-
async function _e(e, t, n) {
|
|
24923
|
-
let r = ve(t.tagName, n);
|
|
24924
|
-
if (!r) return;
|
|
24925
|
-
let a = t.attributes.find((e) => e.name === n)?.value;
|
|
24926
|
-
if (!a) return;
|
|
24927
|
-
let o = await ye(e, t, r);
|
|
24928
|
-
if (o) return {
|
|
24929
|
-
record: o,
|
|
24930
|
-
qualifier: be(r, n, a)
|
|
24931
|
-
};
|
|
24932
|
-
let s;
|
|
24933
|
-
(r.resolution === k.behaviorDescription || r.resolution === k.iedAddress) && (s = (await e.findAncestors(t, { order: "top-down" })).map((e) => i(e)));
|
|
24934
|
-
let c = oe(r.resolution, n, a, s);
|
|
24935
|
-
if (!c) return;
|
|
24936
|
-
let l = ae(c.lookupKey);
|
|
24937
|
-
if (l.length === 0) return;
|
|
24938
|
-
let u = l[l.length - 1], d = l.slice(0, -1), f = await we({
|
|
24939
|
-
query: e,
|
|
24940
|
-
targets: r.target,
|
|
24941
|
-
segment: u,
|
|
24942
|
-
expectedAncestry: d
|
|
24943
|
-
});
|
|
24944
|
-
if (f) return {
|
|
24945
|
-
record: f,
|
|
24946
|
-
qualifier: c.qualifier
|
|
24947
|
-
};
|
|
24948
|
-
}
|
|
24949
|
-
function ve(e, t) {
|
|
24950
|
-
let n = A[e];
|
|
24951
|
-
if (n) return n.find((e) => e.attribute.path === t);
|
|
24952
|
-
}
|
|
24953
|
-
async function ye(e, t, n) {
|
|
24954
|
-
let r = n.attribute.uuid, i = t.attributes.find((e) => e.name === r)?.value;
|
|
24955
|
-
if (i) for (let t of n.target) {
|
|
24956
|
-
let n = await e.findByAttributes({
|
|
24957
|
-
tagName: t,
|
|
24958
|
-
attributes: { uuid: i }
|
|
24959
|
-
});
|
|
24960
|
-
if (n.length > 0) return n[0];
|
|
24807
|
+
let r = i(n);
|
|
24808
|
+
if (!C(r)) {
|
|
24809
|
+
let e = r.attributes.find((e) => e.name === "uuid")?.value;
|
|
24810
|
+
return console.warn(`[scl] buildElementPath: no path segment for <${r.tagName}>${e ? ` (uuid ${e})` : ""} — cannot build a path to this element; leaving any existing reference path untouched`), null;
|
|
24961
24811
|
}
|
|
24962
|
-
|
|
24963
|
-
|
|
24964
|
-
|
|
24965
|
-
if (e.resolution === k.behaviorDescription && t === "dataName") return n;
|
|
24966
|
-
}
|
|
24967
|
-
var xe = new Set(h.LNode.attributes.details.lnClass.facets.enumeration), Se = {
|
|
24968
|
-
LNode: "lnInst",
|
|
24969
|
-
LN: "inst",
|
|
24970
|
-
LN0: "inst"
|
|
24971
|
-
};
|
|
24972
|
-
function Ce(e) {
|
|
24973
|
-
for (let t = 0; t <= e.length - 4; t++) {
|
|
24974
|
-
let n = e.substring(t, t + 4);
|
|
24975
|
-
if (xe.has(n)) return {
|
|
24976
|
-
prefix: e.substring(0, t),
|
|
24977
|
-
lnClass: n,
|
|
24978
|
-
inst: e.substring(t + 4)
|
|
24979
|
-
};
|
|
24980
|
-
}
|
|
24981
|
-
return null;
|
|
24982
|
-
}
|
|
24983
|
-
async function we(e) {
|
|
24984
|
-
let { query: t, targets: n, segment: r, expectedAncestry: i } = e;
|
|
24985
|
-
for (let e of n) {
|
|
24986
|
-
let n = Se[e];
|
|
24987
|
-
if (n) {
|
|
24988
|
-
let a = await Te({
|
|
24989
|
-
query: t,
|
|
24990
|
-
tagName: e,
|
|
24991
|
-
segment: r,
|
|
24992
|
-
instAttr: n,
|
|
24993
|
-
expectedAncestry: i
|
|
24994
|
-
});
|
|
24995
|
-
if (a) return a;
|
|
24996
|
-
} else {
|
|
24997
|
-
let n = await Ee({
|
|
24998
|
-
query: t,
|
|
24999
|
-
tagName: e,
|
|
25000
|
-
segment: r,
|
|
25001
|
-
expectedAncestry: i
|
|
25002
|
-
});
|
|
25003
|
-
if (n) return n;
|
|
25004
|
-
}
|
|
25005
|
-
}
|
|
25006
|
-
}
|
|
25007
|
-
async function Te(e) {
|
|
25008
|
-
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o = Ce(r.segment);
|
|
25009
|
-
if (!o) return;
|
|
25010
|
-
let s = await t.findByAttributes({
|
|
25011
|
-
tagName: n,
|
|
25012
|
-
attributes: { lnClass: o.lnClass }
|
|
25013
|
-
});
|
|
25014
|
-
for (let e of s) {
|
|
25015
|
-
let n = e.attributes.find((e) => e.name === "prefix")?.value ?? "", r = e.attributes.find((e) => e.name === i)?.value ?? "";
|
|
25016
|
-
if (!(n !== o.prefix || r !== o.inst) && await De(t, e, a)) return e;
|
|
25017
|
-
}
|
|
25018
|
-
}
|
|
25019
|
-
async function Ee(e) {
|
|
25020
|
-
let { query: t, tagName: n, segment: r, expectedAncestry: a } = e, o = await t.getRecordsByTagName(n);
|
|
25021
|
-
for (let e of o) {
|
|
25022
|
-
let n = w(i(e));
|
|
25023
|
-
if (!(!n || n.segment !== r.segment) && await De(t, e, a)) return e;
|
|
25024
|
-
}
|
|
25025
|
-
}
|
|
25026
|
-
async function De(e, t, n) {
|
|
25027
|
-
if (n.length === 0) return !0;
|
|
25028
|
-
let r = await e.findAncestors(t), a = [];
|
|
25029
|
-
for (let e = r.length - 1; e >= 0; e--) {
|
|
25030
|
-
let t = w(i(r[e]));
|
|
25031
|
-
t && a.push(t);
|
|
25032
|
-
}
|
|
25033
|
-
return a.length === n.length ? a.every((e, t) => e.segment === n[t].segment) : !1;
|
|
25034
|
-
}
|
|
25035
|
-
//#endregion
|
|
25036
|
-
//#region src/v2019C1/extensions/reference/query/resolve/resolve-element-path.ts
|
|
25037
|
-
async function Oe(e, t) {
|
|
25038
|
-
let n = ae(t);
|
|
25039
|
-
if (n.length !== 0) return O({
|
|
25040
|
-
query: e,
|
|
25041
|
-
current: await e.getRoot(),
|
|
25042
|
-
segments: n,
|
|
25043
|
-
index: 0
|
|
24812
|
+
return ae({
|
|
24813
|
+
record: r,
|
|
24814
|
+
ancestry: (await e.findAncestors(t, { order: "top-down" })).map(i)
|
|
25044
24815
|
});
|
|
25045
24816
|
}
|
|
25046
|
-
async function O(e) {
|
|
25047
|
-
let { query: t, current: n, segments: r, index: a } = e;
|
|
25048
|
-
if (a >= r.length) return n;
|
|
25049
|
-
let o = n.children ?? [];
|
|
25050
|
-
if (o.length === 0) return;
|
|
25051
|
-
let s = await t.getRecords(o), c = r[a];
|
|
25052
|
-
for (let e of s) {
|
|
25053
|
-
if (!e) continue;
|
|
25054
|
-
let n = w(i(e));
|
|
25055
|
-
if (!n) {
|
|
25056
|
-
let n = await O({
|
|
25057
|
-
query: t,
|
|
25058
|
-
current: e,
|
|
25059
|
-
segments: r,
|
|
25060
|
-
index: a
|
|
25061
|
-
});
|
|
25062
|
-
if (n) return n;
|
|
25063
|
-
continue;
|
|
25064
|
-
}
|
|
25065
|
-
if (n.segment === c.segment && n.separator === c.separator) {
|
|
25066
|
-
let n = await O({
|
|
25067
|
-
query: t,
|
|
25068
|
-
current: e,
|
|
25069
|
-
segments: r,
|
|
25070
|
-
index: a + 1
|
|
25071
|
-
});
|
|
25072
|
-
if (n) return n;
|
|
25073
|
-
continue;
|
|
25074
|
-
}
|
|
25075
|
-
}
|
|
25076
|
-
}
|
|
25077
|
-
//#endregion
|
|
25078
|
-
//#region src/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.ts
|
|
25079
|
-
var ke = new Set(["LN", "LN0"]);
|
|
25080
|
-
async function Ae(e, t) {
|
|
25081
|
-
let n = he(je(t));
|
|
25082
|
-
if (!n) return;
|
|
25083
|
-
let r = await Oe(e, n);
|
|
25084
|
-
if (!(!r || !ke.has(r.tagName))) return r;
|
|
25085
|
-
}
|
|
25086
|
-
function je(e) {
|
|
25087
|
-
let t = (t) => e.attributes.find((e) => e.name === t)?.value;
|
|
25088
|
-
return {
|
|
25089
|
-
iedName: t("iedName"),
|
|
25090
|
-
ldInst: t("ldInst"),
|
|
25091
|
-
prefix: t("prefix"),
|
|
25092
|
-
lnClass: t("lnClass"),
|
|
25093
|
-
lnInst: t("lnInst")
|
|
25094
|
-
};
|
|
25095
|
-
}
|
|
25096
24817
|
//#endregion
|
|
25097
|
-
//#region src/v2019C1/
|
|
25098
|
-
var
|
|
25099
|
-
direct: "direct",
|
|
25100
|
-
lnode: "lnode",
|
|
25101
|
-
iedAddress: "ied-address",
|
|
25102
|
-
behaviorDescription: "behavior-description",
|
|
25103
|
-
unsupported: "unsupported"
|
|
25104
|
-
}, A = {
|
|
24818
|
+
//#region src/v2019C1/constants/reference-pairs.ts
|
|
24819
|
+
var T = {
|
|
25105
24820
|
AllocationRoleRef: [{
|
|
25106
24821
|
attribute: {
|
|
25107
24822
|
path: "allocationRole",
|
|
@@ -25446,13 +25161,7 @@ var k = {
|
|
|
25446
25161
|
uuid: "elementUuid"
|
|
25447
25162
|
},
|
|
25448
25163
|
resolution: "unsupported",
|
|
25449
|
-
target:
|
|
25450
|
-
"LNode",
|
|
25451
|
-
"Function",
|
|
25452
|
-
"SubFunction",
|
|
25453
|
-
"EqFunction",
|
|
25454
|
-
"EqSubFunction"
|
|
25455
|
-
],
|
|
25164
|
+
target: l,
|
|
25456
25165
|
companions: [{
|
|
25457
25166
|
name: "doName",
|
|
25458
25167
|
required: !1
|
|
@@ -25470,21 +25179,315 @@ var k = {
|
|
|
25470
25179
|
target: ["Variable"],
|
|
25471
25180
|
companions: []
|
|
25472
25181
|
}]
|
|
25473
|
-
}
|
|
25474
|
-
|
|
25475
|
-
|
|
25476
|
-
|
|
25477
|
-
|
|
25478
|
-
|
|
25479
|
-
|
|
25480
|
-
|
|
25481
|
-
|
|
25482
|
-
|
|
25483
|
-
|
|
25484
|
-
|
|
25485
|
-
|
|
25486
|
-
|
|
25487
|
-
|
|
25182
|
+
};
|
|
25183
|
+
//#endregion
|
|
25184
|
+
//#region src/v2019C1/extensions/reference/query/resolve/parse-path.ts
|
|
25185
|
+
function ce(e) {
|
|
25186
|
+
if (!e) return [];
|
|
25187
|
+
let t = [], n = "", r = "/";
|
|
25188
|
+
for (let i of e) i === "/" || i === "." ? (n && t.push({
|
|
25189
|
+
segment: n,
|
|
25190
|
+
separator: r
|
|
25191
|
+
}), r = i, n = "") : n += i;
|
|
25192
|
+
return n && t.push({
|
|
25193
|
+
segment: n,
|
|
25194
|
+
separator: r
|
|
25195
|
+
}), t;
|
|
25196
|
+
}
|
|
25197
|
+
function le(e) {
|
|
25198
|
+
let t = e.split("/"), n = t[t.length - 1], r = n.indexOf(".");
|
|
25199
|
+
if (r === -1) return { path: e };
|
|
25200
|
+
let i = n.substring(0, r), a = n.substring(r + 1);
|
|
25201
|
+
return {
|
|
25202
|
+
path: [...t.slice(0, -1), i].join("/"),
|
|
25203
|
+
qualifier: a || void 0
|
|
25204
|
+
};
|
|
25205
|
+
}
|
|
25206
|
+
function ue(e, t, n, r) {
|
|
25207
|
+
return !e || e === E.unsupported ? null : e === E.direct ? { lookupKey: n } : e === E.iedAddress ? fe(n, r) : e === E.lnode ? de(n) : e === E.behaviorDescription ? pe(t, n, r) : null;
|
|
25208
|
+
}
|
|
25209
|
+
function de(e) {
|
|
25210
|
+
let { path: t, qualifier: n } = le(e);
|
|
25211
|
+
return {
|
|
25212
|
+
lookupKey: t,
|
|
25213
|
+
qualifier: n
|
|
25214
|
+
};
|
|
25215
|
+
}
|
|
25216
|
+
function fe(e, t) {
|
|
25217
|
+
if (t) {
|
|
25218
|
+
let n = ge(t);
|
|
25219
|
+
if (n) return {
|
|
25220
|
+
lookupKey: e,
|
|
25221
|
+
fallbackLookupKey: `${n}/${e}`
|
|
25222
|
+
};
|
|
25223
|
+
}
|
|
25224
|
+
return { lookupKey: e };
|
|
25225
|
+
}
|
|
25226
|
+
function pe(e, t, n) {
|
|
25227
|
+
if (!n) return null;
|
|
25228
|
+
let r = me(n);
|
|
25229
|
+
return r ? e === "dataName" ? {
|
|
25230
|
+
lookupKey: r,
|
|
25231
|
+
qualifier: t
|
|
25232
|
+
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${he(t)}` } : null : null;
|
|
25233
|
+
}
|
|
25234
|
+
function me(e) {
|
|
25235
|
+
let t = -1;
|
|
25236
|
+
for (let n = e.length - 1; n >= 0; n--) if (e[n].tagName === "BehaviorDescription") {
|
|
25237
|
+
t = n;
|
|
25238
|
+
break;
|
|
25239
|
+
}
|
|
25240
|
+
if (t === -1) return null;
|
|
25241
|
+
let n = [];
|
|
25242
|
+
for (let r = 0; r < t; r++) {
|
|
25243
|
+
let t = C(e[r]);
|
|
25244
|
+
t && n.push(t);
|
|
25245
|
+
}
|
|
25246
|
+
return n.length === 0 ? null : oe(n);
|
|
25247
|
+
}
|
|
25248
|
+
function he(e) {
|
|
25249
|
+
let t = e.indexOf("("), n = e.indexOf(".");
|
|
25250
|
+
return t === -1 ? n === -1 ? e : e.substring(0, n) : e.substring(0, t);
|
|
25251
|
+
}
|
|
25252
|
+
function ge(e) {
|
|
25253
|
+
for (let t = e.length - 1; t >= 0; t--) if (e[t].tagName === "LNode") return e[t].attributes.find((e) => e.name === "iedName")?.value ?? null;
|
|
25254
|
+
return null;
|
|
25255
|
+
}
|
|
25256
|
+
//#endregion
|
|
25257
|
+
//#region src/v2019C1/extensions/reference/query/build/build-reference-path.ts
|
|
25258
|
+
async function _e(e, t) {
|
|
25259
|
+
let { reference: n, target: r } = t, a = ve(n.tagName, r.tagName);
|
|
25260
|
+
if (!a) return null;
|
|
25261
|
+
let o = a.resolution;
|
|
25262
|
+
if (o === E.behaviorDescription) {
|
|
25263
|
+
let t = await e.getRecord(r);
|
|
25264
|
+
return t ? C(i(t))?.segment ?? null : null;
|
|
25265
|
+
}
|
|
25266
|
+
let s = await se(e, r);
|
|
25267
|
+
if (!s) return null;
|
|
25268
|
+
let c = s.path;
|
|
25269
|
+
if (o === E.lnode) {
|
|
25270
|
+
let t = await e.getRecord(n);
|
|
25271
|
+
if (!t) return c;
|
|
25272
|
+
let r = t.attributes.find((e) => e.name === a.attribute.path)?.value;
|
|
25273
|
+
if (!r) return c;
|
|
25274
|
+
let { qualifier: i } = le(r);
|
|
25275
|
+
return i ? `${c}.${i}` : c;
|
|
25276
|
+
}
|
|
25277
|
+
return c;
|
|
25278
|
+
}
|
|
25279
|
+
function ve(e, t) {
|
|
25280
|
+
let n = T[e];
|
|
25281
|
+
return n ? n.find((e) => e.target.includes(t)) ?? null : null;
|
|
25282
|
+
}
|
|
25283
|
+
//#endregion
|
|
25284
|
+
//#region src/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.ts
|
|
25285
|
+
function ye(e) {
|
|
25286
|
+
let t = e.iedName;
|
|
25287
|
+
if (!t || t === be) return null;
|
|
25288
|
+
let n = e.ldInst, r = e.lnClass;
|
|
25289
|
+
return !n || !r ? null : `${t}/${n}/${`${e.prefix ?? ""}${r}${e.lnInst ?? ""}`}`;
|
|
25290
|
+
}
|
|
25291
|
+
var be = "None";
|
|
25292
|
+
//#endregion
|
|
25293
|
+
//#region src/v2019C1/extensions/reference/query/resolve/resolve-reference-path.ts
|
|
25294
|
+
async function xe(e, t, n) {
|
|
25295
|
+
let r = Se(t.tagName, n);
|
|
25296
|
+
if (!r) return;
|
|
25297
|
+
let a = t.attributes.find((e) => e.name === n)?.value;
|
|
25298
|
+
if (!a) return;
|
|
25299
|
+
let o = await Ce(e, t, r);
|
|
25300
|
+
if (o) return {
|
|
25301
|
+
record: o,
|
|
25302
|
+
qualifier: we(r, n, a)
|
|
25303
|
+
};
|
|
25304
|
+
let s;
|
|
25305
|
+
(r.resolution === E.behaviorDescription || r.resolution === E.iedAddress) && (s = (await e.findAncestors(t, { order: "top-down" })).map((e) => i(e)));
|
|
25306
|
+
let c = ue(r.resolution, n, a, s);
|
|
25307
|
+
if (!c) return;
|
|
25308
|
+
let l = ce(c.lookupKey);
|
|
25309
|
+
if (l.length === 0) return;
|
|
25310
|
+
let u = l[l.length - 1], d = l.slice(0, -1), f = await Oe({
|
|
25311
|
+
query: e,
|
|
25312
|
+
targets: r.target,
|
|
25313
|
+
segment: u,
|
|
25314
|
+
expectedAncestry: d
|
|
25315
|
+
});
|
|
25316
|
+
if (f) return {
|
|
25317
|
+
record: f,
|
|
25318
|
+
qualifier: c.qualifier
|
|
25319
|
+
};
|
|
25320
|
+
}
|
|
25321
|
+
function Se(e, t) {
|
|
25322
|
+
let n = T[e];
|
|
25323
|
+
if (n) return n.find((e) => e.attribute.path === t);
|
|
25324
|
+
}
|
|
25325
|
+
async function Ce(e, t, n) {
|
|
25326
|
+
let r = n.attribute.uuid, i = t.attributes.find((e) => e.name === r)?.value;
|
|
25327
|
+
if (i) for (let t of n.target) {
|
|
25328
|
+
let n = await e.findByAttributes({
|
|
25329
|
+
tagName: t,
|
|
25330
|
+
attributes: { uuid: i }
|
|
25331
|
+
});
|
|
25332
|
+
if (n.length > 0) return n[0];
|
|
25333
|
+
}
|
|
25334
|
+
}
|
|
25335
|
+
function we(e, t, n) {
|
|
25336
|
+
if (e.resolution === E.lnode) return le(n).qualifier;
|
|
25337
|
+
if (e.resolution === E.behaviorDescription && t === "dataName") return n;
|
|
25338
|
+
}
|
|
25339
|
+
var Te = new Set(g.LNode.attributes.details.lnClass.facets.enumeration), Ee = {
|
|
25340
|
+
LNode: "lnInst",
|
|
25341
|
+
LN: "inst",
|
|
25342
|
+
LN0: "inst"
|
|
25343
|
+
};
|
|
25344
|
+
function De(e) {
|
|
25345
|
+
for (let t = 0; t <= e.length - 4; t++) {
|
|
25346
|
+
let n = e.substring(t, t + 4);
|
|
25347
|
+
if (Te.has(n)) return {
|
|
25348
|
+
prefix: e.substring(0, t),
|
|
25349
|
+
lnClass: n,
|
|
25350
|
+
inst: e.substring(t + 4)
|
|
25351
|
+
};
|
|
25352
|
+
}
|
|
25353
|
+
return null;
|
|
25354
|
+
}
|
|
25355
|
+
async function Oe(e) {
|
|
25356
|
+
let { query: t, targets: n, segment: r, expectedAncestry: i } = e;
|
|
25357
|
+
for (let e of n) {
|
|
25358
|
+
let n = Ee[e];
|
|
25359
|
+
if (n) {
|
|
25360
|
+
let a = await ke({
|
|
25361
|
+
query: t,
|
|
25362
|
+
tagName: e,
|
|
25363
|
+
segment: r,
|
|
25364
|
+
instAttr: n,
|
|
25365
|
+
expectedAncestry: i
|
|
25366
|
+
});
|
|
25367
|
+
if (a) return a;
|
|
25368
|
+
} else {
|
|
25369
|
+
let n = await Ae({
|
|
25370
|
+
query: t,
|
|
25371
|
+
tagName: e,
|
|
25372
|
+
segment: r,
|
|
25373
|
+
expectedAncestry: i
|
|
25374
|
+
});
|
|
25375
|
+
if (n) return n;
|
|
25376
|
+
}
|
|
25377
|
+
}
|
|
25378
|
+
}
|
|
25379
|
+
async function ke(e) {
|
|
25380
|
+
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o = De(r.segment);
|
|
25381
|
+
if (!o) return;
|
|
25382
|
+
let s = await t.findByAttributes({
|
|
25383
|
+
tagName: n,
|
|
25384
|
+
attributes: { lnClass: o.lnClass }
|
|
25385
|
+
});
|
|
25386
|
+
for (let e of s) {
|
|
25387
|
+
let n = e.attributes.find((e) => e.name === "prefix")?.value ?? "", r = e.attributes.find((e) => e.name === i)?.value ?? "";
|
|
25388
|
+
if (!(n !== o.prefix || r !== o.inst) && await je(t, e, a)) return e;
|
|
25389
|
+
}
|
|
25390
|
+
}
|
|
25391
|
+
async function Ae(e) {
|
|
25392
|
+
let { query: t, tagName: n, segment: r, expectedAncestry: a } = e, o = await t.getRecordsByTagName(n);
|
|
25393
|
+
for (let e of o) {
|
|
25394
|
+
let n = C(i(e));
|
|
25395
|
+
if (!(!n || n.segment !== r.segment) && await je(t, e, a)) return e;
|
|
25396
|
+
}
|
|
25397
|
+
}
|
|
25398
|
+
async function je(e, t, n) {
|
|
25399
|
+
if (n.length === 0) return !0;
|
|
25400
|
+
let r = await e.findAncestors(t), a = [];
|
|
25401
|
+
for (let e = r.length - 1; e >= 0; e--) {
|
|
25402
|
+
let t = C(i(r[e]));
|
|
25403
|
+
t && a.push(t);
|
|
25404
|
+
}
|
|
25405
|
+
return a.length === n.length ? a.every((e, t) => e.segment === n[t].segment) : !1;
|
|
25406
|
+
}
|
|
25407
|
+
//#endregion
|
|
25408
|
+
//#region src/v2019C1/extensions/reference/query/resolve/resolve-element-path.ts
|
|
25409
|
+
async function Me(e, t) {
|
|
25410
|
+
let n = ce(t);
|
|
25411
|
+
if (n.length !== 0) return Ne({
|
|
25412
|
+
query: e,
|
|
25413
|
+
current: await e.getRoot(),
|
|
25414
|
+
segments: n,
|
|
25415
|
+
index: 0
|
|
25416
|
+
});
|
|
25417
|
+
}
|
|
25418
|
+
async function Ne(e) {
|
|
25419
|
+
let { query: t, current: n, segments: r, index: a } = e;
|
|
25420
|
+
if (a >= r.length) return n;
|
|
25421
|
+
let o = n.children ?? [];
|
|
25422
|
+
if (o.length === 0) return;
|
|
25423
|
+
let s = await t.getRecords(o), c = r[a];
|
|
25424
|
+
for (let e of s) {
|
|
25425
|
+
if (!e) continue;
|
|
25426
|
+
let n = C(i(e));
|
|
25427
|
+
if (!n) {
|
|
25428
|
+
let n = await Ne({
|
|
25429
|
+
query: t,
|
|
25430
|
+
current: e,
|
|
25431
|
+
segments: r,
|
|
25432
|
+
index: a
|
|
25433
|
+
});
|
|
25434
|
+
if (n) return n;
|
|
25435
|
+
continue;
|
|
25436
|
+
}
|
|
25437
|
+
if (n.segment === c.segment && n.separator === c.separator) {
|
|
25438
|
+
let n = await Ne({
|
|
25439
|
+
query: t,
|
|
25440
|
+
current: e,
|
|
25441
|
+
segments: r,
|
|
25442
|
+
index: a + 1
|
|
25443
|
+
});
|
|
25444
|
+
if (n) return n;
|
|
25445
|
+
continue;
|
|
25446
|
+
}
|
|
25447
|
+
}
|
|
25448
|
+
}
|
|
25449
|
+
//#endregion
|
|
25450
|
+
//#region src/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.ts
|
|
25451
|
+
var Pe = new Set(["LN", "LN0"]);
|
|
25452
|
+
async function Fe(e, t) {
|
|
25453
|
+
let n = ye(Ie(t));
|
|
25454
|
+
if (!n) return;
|
|
25455
|
+
let r = await Me(e, n);
|
|
25456
|
+
if (!(!r || !Pe.has(r.tagName))) return r;
|
|
25457
|
+
}
|
|
25458
|
+
function Ie(e) {
|
|
25459
|
+
let t = (t) => e.attributes.find((e) => e.name === t)?.value;
|
|
25460
|
+
return {
|
|
25461
|
+
iedName: t("iedName"),
|
|
25462
|
+
ldInst: t("ldInst"),
|
|
25463
|
+
prefix: t("prefix"),
|
|
25464
|
+
lnClass: t("lnClass"),
|
|
25465
|
+
lnInst: t("lnInst")
|
|
25466
|
+
};
|
|
25467
|
+
}
|
|
25468
|
+
//#endregion
|
|
25469
|
+
//#region src/v2019C1/extensions/reference/constants/resolution-types.ts
|
|
25470
|
+
var E = {
|
|
25471
|
+
direct: "direct",
|
|
25472
|
+
lnode: "lnode",
|
|
25473
|
+
iedAddress: "ied-address",
|
|
25474
|
+
behaviorDescription: "behavior-description",
|
|
25475
|
+
unsupported: "unsupported"
|
|
25476
|
+
}, D = {
|
|
25477
|
+
LN: [{
|
|
25478
|
+
attribute: "lnType",
|
|
25479
|
+
target: "LNodeType"
|
|
25480
|
+
}],
|
|
25481
|
+
LN0: [{
|
|
25482
|
+
attribute: "lnType",
|
|
25483
|
+
target: "LNodeType"
|
|
25484
|
+
}],
|
|
25485
|
+
LNode: [{
|
|
25486
|
+
attribute: "lnType",
|
|
25487
|
+
target: "LNodeType"
|
|
25488
|
+
}],
|
|
25489
|
+
DO: [{
|
|
25490
|
+
attribute: "type",
|
|
25488
25491
|
target: "DOType"
|
|
25489
25492
|
}],
|
|
25490
25493
|
SDO: [{
|
|
@@ -25524,7 +25527,7 @@ var k = {
|
|
|
25524
25527
|
};
|
|
25525
25528
|
//#endregion
|
|
25526
25529
|
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25527
|
-
function
|
|
25530
|
+
function Le(e) {
|
|
25528
25531
|
let t = {};
|
|
25529
25532
|
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25530
25533
|
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
@@ -25539,7 +25542,7 @@ function Me(e) {
|
|
|
25539
25542
|
}
|
|
25540
25543
|
return t;
|
|
25541
25544
|
}
|
|
25542
|
-
function
|
|
25545
|
+
function Re(e) {
|
|
25543
25546
|
let t = /* @__PURE__ */ new Map();
|
|
25544
25547
|
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25545
25548
|
uuidAttr: e.attribute.uuid,
|
|
@@ -25549,7 +25552,7 @@ function Ne(e) {
|
|
|
25549
25552
|
})));
|
|
25550
25553
|
return t;
|
|
25551
25554
|
}
|
|
25552
|
-
function
|
|
25555
|
+
function ze(e) {
|
|
25553
25556
|
let t = /* @__PURE__ */ new Map();
|
|
25554
25557
|
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25555
25558
|
let r = t.get(e.target) ?? [];
|
|
@@ -25563,12 +25566,12 @@ function Pe(e) {
|
|
|
25563
25566
|
}
|
|
25564
25567
|
//#endregion
|
|
25565
25568
|
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25566
|
-
var
|
|
25567
|
-
|
|
25568
|
-
|
|
25569
|
-
|
|
25570
|
-
|
|
25571
|
-
],
|
|
25569
|
+
var Be = Le(T), Ve = [
|
|
25570
|
+
E.direct,
|
|
25571
|
+
E.lnode,
|
|
25572
|
+
E.iedAddress,
|
|
25573
|
+
E.behaviorDescription
|
|
25574
|
+
], He = [...Ve, E.unsupported], Ue = Re(T), We = [...new Set(Object.values(T).flatMap((e) => e.map((e) => e.attribute.uuid)))], Ge = new Map(Object.entries(D).map(([e, t]) => [e, [...new Set(t.map((e) => e.attribute))]])), Ke = ze(D), qe = new Set(Ke.keys()), Je = new Set([
|
|
25572
25575
|
"SourceRef",
|
|
25573
25576
|
"ControlRef",
|
|
25574
25577
|
"DOS",
|
|
@@ -25577,7 +25580,7 @@ var M = Me(A), N = [
|
|
|
25577
25580
|
"InputVar",
|
|
25578
25581
|
"OutputVar",
|
|
25579
25582
|
"ProcessEcho"
|
|
25580
|
-
]),
|
|
25583
|
+
]), Ye = {
|
|
25581
25584
|
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25582
25585
|
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25583
25586
|
Resource: ["ProcessResource", "ProcessResources"],
|
|
@@ -25585,29 +25588,29 @@ var M = Me(A), N = [
|
|
|
25585
25588
|
};
|
|
25586
25589
|
//#endregion
|
|
25587
25590
|
//#region src/v2019C1/extensions/reference/guards.ts
|
|
25588
|
-
function
|
|
25589
|
-
return
|
|
25591
|
+
function Xe(e) {
|
|
25592
|
+
return qe.has(e);
|
|
25590
25593
|
}
|
|
25591
25594
|
//#endregion
|
|
25592
25595
|
//#region src/v2019C1/extensions/reference/query/find/find-refs-pointing-to.ts
|
|
25593
|
-
async function
|
|
25596
|
+
async function O(e, t) {
|
|
25594
25597
|
let { target: n, containerTagName: r } = t, i = await e.getRecord(n);
|
|
25595
|
-
return i ?
|
|
25598
|
+
return i ? Xe(i.tagName) ? Qe(e, i, r) : Ze(e, i, r) : [];
|
|
25596
25599
|
}
|
|
25597
|
-
async function
|
|
25600
|
+
async function Ze(e, t, r) {
|
|
25598
25601
|
let i = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25599
25602
|
if (!i) return [];
|
|
25600
|
-
let a =
|
|
25603
|
+
let a = et(t.tagName);
|
|
25601
25604
|
if (a.length === 0) return [];
|
|
25602
25605
|
let o = [];
|
|
25603
25606
|
for (let t of a) {
|
|
25604
|
-
if (!n(t.refTagName,
|
|
25607
|
+
if (!n(t.refTagName, b)) continue;
|
|
25605
25608
|
let a = await e.findByAttributes({
|
|
25606
25609
|
tagName: t.refTagName,
|
|
25607
25610
|
attributes: { [t.uuidAttr]: i }
|
|
25608
25611
|
});
|
|
25609
25612
|
for (let t of a) {
|
|
25610
|
-
let n = r ? await
|
|
25613
|
+
let n = r ? await tt(e, t, r) : void 0;
|
|
25611
25614
|
o.push({
|
|
25612
25615
|
ref: t,
|
|
25613
25616
|
container: n
|
|
@@ -25616,19 +25619,19 @@ async function He(e, t, r) {
|
|
|
25616
25619
|
}
|
|
25617
25620
|
return o;
|
|
25618
25621
|
}
|
|
25619
|
-
async function
|
|
25622
|
+
async function Qe(e, t, r) {
|
|
25620
25623
|
let i = t.attributes.find((e) => e.name === "id")?.value;
|
|
25621
25624
|
if (!i) return [];
|
|
25622
|
-
let a =
|
|
25625
|
+
let a = Ke.get(t.tagName) ?? [], o = [];
|
|
25623
25626
|
for (let t of a) {
|
|
25624
|
-
if (!n(t.refTagName,
|
|
25627
|
+
if (!n(t.refTagName, b)) continue;
|
|
25625
25628
|
let a = await e.findByAttributes({
|
|
25626
25629
|
tagName: t.refTagName,
|
|
25627
25630
|
attributes: { [t.attribute]: i }
|
|
25628
25631
|
});
|
|
25629
25632
|
for (let n of a) {
|
|
25630
|
-
if (
|
|
25631
|
-
let i = r ? await
|
|
25633
|
+
if (!$e(n, t)) continue;
|
|
25634
|
+
let i = r ? await tt(e, n, r) : void 0;
|
|
25632
25635
|
o.push({
|
|
25633
25636
|
ref: n,
|
|
25634
25637
|
container: i
|
|
@@ -25637,60 +25640,129 @@ async function Ue(e, t, r) {
|
|
|
25637
25640
|
}
|
|
25638
25641
|
return o;
|
|
25639
25642
|
}
|
|
25640
|
-
function
|
|
25643
|
+
function $e(e, t) {
|
|
25641
25644
|
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
25642
25645
|
}
|
|
25643
|
-
function
|
|
25646
|
+
function et(e) {
|
|
25644
25647
|
let t = [];
|
|
25645
|
-
for (let n of
|
|
25646
|
-
let r =
|
|
25648
|
+
for (let n of He) {
|
|
25649
|
+
let r = Be[n]?.get(e);
|
|
25647
25650
|
r && t.push(...r);
|
|
25648
25651
|
}
|
|
25649
25652
|
return t;
|
|
25650
25653
|
}
|
|
25651
|
-
async function
|
|
25654
|
+
async function tt(e, t, n) {
|
|
25652
25655
|
return (await e.findAncestors(t, { stopAtTagName: n })).find((e) => e.tagName === n);
|
|
25653
25656
|
}
|
|
25654
25657
|
//#endregion
|
|
25655
|
-
//#region src/v2019C1/extensions/reference/query/
|
|
25656
|
-
var
|
|
25657
|
-
|
|
25658
|
-
|
|
25659
|
-
|
|
25660
|
-
|
|
25661
|
-
|
|
25662
|
-
|
|
25663
|
-
|
|
25664
|
-
}
|
|
25658
|
+
//#region src/v2019C1/extensions/reference/query/provenance/get-provenance.constants.ts
|
|
25659
|
+
var nt = {
|
|
25660
|
+
Application: "application",
|
|
25661
|
+
Function: "function",
|
|
25662
|
+
SubFunction: "function",
|
|
25663
|
+
EqFunction: "function",
|
|
25664
|
+
EqSubFunction: "function",
|
|
25665
|
+
IED: "ied",
|
|
25666
|
+
Header: "document"
|
|
25667
|
+
};
|
|
25665
25668
|
//#endregion
|
|
25666
|
-
//#region src/v2019C1/extensions/reference/
|
|
25667
|
-
async function
|
|
25668
|
-
let
|
|
25669
|
-
|
|
25670
|
-
let
|
|
25671
|
-
if (!
|
|
25672
|
-
let i = await e.
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
|
|
25676
|
-
|
|
25677
|
-
|
|
25678
|
-
|
|
25679
|
-
|
|
25680
|
-
}
|
|
25669
|
+
//#region src/v2019C1/extensions/reference/query/provenance/get-provenance.ts
|
|
25670
|
+
async function rt(e) {
|
|
25671
|
+
let t = await e.getRecordsByTagName("SclFileReference"), n = [];
|
|
25672
|
+
for (let r of t) {
|
|
25673
|
+
let t = await it(e, r);
|
|
25674
|
+
if (!t) continue;
|
|
25675
|
+
let { fileType: i, fileUuid: a, fileName: o, version: s, revision: c } = await e.getAttributes(r);
|
|
25676
|
+
n.push({
|
|
25677
|
+
fileType: i,
|
|
25678
|
+
fileUuid: a,
|
|
25679
|
+
fileName: o,
|
|
25680
|
+
version: s,
|
|
25681
|
+
revision: c,
|
|
25682
|
+
anchor: t
|
|
25683
|
+
});
|
|
25684
|
+
}
|
|
25685
|
+
return n;
|
|
25686
|
+
}
|
|
25687
|
+
async function it(e, t) {
|
|
25688
|
+
let n = await e.findAncestors(t);
|
|
25689
|
+
for (let e of n) {
|
|
25690
|
+
let t = nt[e.tagName];
|
|
25691
|
+
if (t) return {
|
|
25692
|
+
kind: t,
|
|
25693
|
+
ref: at(e.tagName, e.id)
|
|
25694
|
+
};
|
|
25695
|
+
}
|
|
25696
|
+
}
|
|
25697
|
+
function at(e, t) {
|
|
25698
|
+
return {
|
|
25699
|
+
tagName: e,
|
|
25700
|
+
id: t
|
|
25701
|
+
};
|
|
25702
|
+
}
|
|
25703
|
+
//#endregion
|
|
25704
|
+
//#region src/v2019C1/extensions/reference/query/index.ts
|
|
25705
|
+
var ot = /* @__PURE__ */ c({
|
|
25706
|
+
buildElementPath: () => se,
|
|
25707
|
+
buildMappedLNodePath: () => ye,
|
|
25708
|
+
buildReferencePath: () => _e,
|
|
25709
|
+
findRefsPointingTo: () => O,
|
|
25710
|
+
getProvenance: () => rt,
|
|
25711
|
+
resolveElementPath: () => Me,
|
|
25712
|
+
resolveMappedLNode: () => Fe,
|
|
25713
|
+
resolveReferencePath: () => xe
|
|
25714
|
+
});
|
|
25715
|
+
//#endregion
|
|
25716
|
+
//#region src/v2019C1/extensions/reference/transaction/apply-type-id-remap.ts
|
|
25717
|
+
async function st(e, t) {
|
|
25718
|
+
let { records: n, idRemap: r } = t;
|
|
25719
|
+
if (r.size !== 0) for (let t of n) {
|
|
25720
|
+
let n = Ge.get(t.tagName);
|
|
25721
|
+
if (!n) continue;
|
|
25722
|
+
let i = await e.getRecord(t);
|
|
25723
|
+
if (!i) continue;
|
|
25724
|
+
let a = {};
|
|
25725
|
+
for (let e of n) {
|
|
25726
|
+
let t = i.attributes.find((t) => t.name === e)?.value;
|
|
25727
|
+
if (!t) continue;
|
|
25728
|
+
let n = r.get(t);
|
|
25729
|
+
n !== void 0 && n !== t && (a[e] = n);
|
|
25730
|
+
}
|
|
25681
25731
|
Object.keys(a).length > 0 && await e.update(i, { attributes: a });
|
|
25682
25732
|
}
|
|
25683
25733
|
}
|
|
25684
25734
|
//#endregion
|
|
25735
|
+
//#region src/v2019C1/extensions/reference/transaction/write-provenance.ts
|
|
25736
|
+
var ct = {
|
|
25737
|
+
FSD: "FunctionSclRef",
|
|
25738
|
+
ASD: "ApplicationSclRef"
|
|
25739
|
+
};
|
|
25740
|
+
async function lt(e, t) {
|
|
25741
|
+
let { sourceQuery: n, targetRoot: r, fileType: i } = t, [a] = await n.getRecordsByTagName("Header"), o = a ? await n.getAttributes(a) : void 0, s = await e.addChild(r, { tagName: ct[i] }), { name: c } = await n.getDocumentInfo();
|
|
25742
|
+
await e.addChild(s, {
|
|
25743
|
+
tagName: "SclFileReference",
|
|
25744
|
+
attributes: {
|
|
25745
|
+
fileType: i,
|
|
25746
|
+
version: o?.version ?? "",
|
|
25747
|
+
revision: o?.revision ?? "",
|
|
25748
|
+
fileName: c,
|
|
25749
|
+
fileUuid: o?.uuid ?? ""
|
|
25750
|
+
}
|
|
25751
|
+
});
|
|
25752
|
+
}
|
|
25753
|
+
//#endregion
|
|
25685
25754
|
//#region src/v2019C1/extensions/reference/index.ts
|
|
25686
|
-
var
|
|
25687
|
-
query:
|
|
25688
|
-
transaction: /* @__PURE__ */
|
|
25755
|
+
var k = {
|
|
25756
|
+
query: ot,
|
|
25757
|
+
transaction: /* @__PURE__ */ c({
|
|
25758
|
+
applyTypeIdRemap: () => st,
|
|
25759
|
+
writeProvenance: () => lt
|
|
25760
|
+
})
|
|
25689
25761
|
};
|
|
25690
25762
|
//#endregion
|
|
25691
25763
|
//#region src/v2019C1/extensions/clean-up/transaction/prune-empty-containers.ts
|
|
25692
|
-
async function
|
|
25693
|
-
let t = [...Object.values(
|
|
25764
|
+
async function ut(e) {
|
|
25765
|
+
let t = [...Object.values(Ye).flat(), "Private"];
|
|
25694
25766
|
for (let n of t) {
|
|
25695
25767
|
let t = await e.getRecordsByTagName(n);
|
|
25696
25768
|
for (let n of t) n.children.length === 0 && await e.delete(n);
|
|
@@ -25698,27 +25770,27 @@ async function Je(e) {
|
|
|
25698
25770
|
}
|
|
25699
25771
|
//#endregion
|
|
25700
25772
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-uuid-refs.ts
|
|
25701
|
-
async function
|
|
25702
|
-
let t = Object.keys(
|
|
25773
|
+
async function dt(e) {
|
|
25774
|
+
let t = Object.keys(T);
|
|
25703
25775
|
for (let n of t) {
|
|
25704
|
-
let t =
|
|
25776
|
+
let t = T[n], r = await e.getRecordsByTagName(n);
|
|
25705
25777
|
for (let i of r) {
|
|
25706
25778
|
let r = !1, a = !1, o = {};
|
|
25707
25779
|
for (let n of t) {
|
|
25708
25780
|
let t = await e.getAttribute(i, { name: n.attribute.uuid });
|
|
25709
|
-
if (t) if (r = !0, await
|
|
25781
|
+
if (t) if (r = !0, await ft(e, t, n.target)) a = !0;
|
|
25710
25782
|
else {
|
|
25711
25783
|
o[n.attribute.uuid] = void 0, o[n.attribute.path] = void 0;
|
|
25712
25784
|
for (let e of n.companions) o[e.name] = void 0;
|
|
25713
25785
|
}
|
|
25714
25786
|
}
|
|
25715
25787
|
Object.keys(o).length > 0 && await e.update(i, { attributes: o });
|
|
25716
|
-
let s =
|
|
25788
|
+
let s = Je.has(n);
|
|
25717
25789
|
r && !a && !s && await e.delete(i);
|
|
25718
25790
|
}
|
|
25719
25791
|
}
|
|
25720
25792
|
}
|
|
25721
|
-
async function
|
|
25793
|
+
async function ft(e, t, n) {
|
|
25722
25794
|
for (let r of n) {
|
|
25723
25795
|
let [n] = await e.findByAttributes({
|
|
25724
25796
|
tagName: r,
|
|
@@ -25730,14 +25802,14 @@ async function Xe(e, t, n) {
|
|
|
25730
25802
|
}
|
|
25731
25803
|
//#endregion
|
|
25732
25804
|
//#region src/v2019C1/extensions/clean-up/index.ts
|
|
25733
|
-
var
|
|
25734
|
-
orphanUuidRefs: () =>
|
|
25735
|
-
pruneEmptyContainers: () =>
|
|
25736
|
-
resetLNode: () =>
|
|
25805
|
+
var A = { transaction: /* @__PURE__ */ c({
|
|
25806
|
+
orphanUuidRefs: () => dt,
|
|
25807
|
+
pruneEmptyContainers: () => ut,
|
|
25808
|
+
resetLNode: () => ee
|
|
25737
25809
|
}) };
|
|
25738
25810
|
//#endregion
|
|
25739
25811
|
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
25740
|
-
async function
|
|
25812
|
+
async function pt(e, n) {
|
|
25741
25813
|
let { records: r } = n, i = {
|
|
25742
25814
|
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
25743
25815
|
doTypes: /* @__PURE__ */ new Map(),
|
|
@@ -25747,15 +25819,15 @@ async function Ze(e, n) {
|
|
|
25747
25819
|
for (let n of r) {
|
|
25748
25820
|
let r = await e.getAttribute(n, { name: "lnType" });
|
|
25749
25821
|
if (!r) continue;
|
|
25750
|
-
let [
|
|
25822
|
+
let [a] = await e.findByAttributes({
|
|
25751
25823
|
tagName: "LNodeType",
|
|
25752
25824
|
attributes: { id: r }
|
|
25753
25825
|
});
|
|
25754
|
-
if (a
|
|
25826
|
+
if (o(a, {
|
|
25755
25827
|
key: "ELEMENT_NOT_FOUND",
|
|
25756
25828
|
detail: `LNodeType not found for lnType="${r}"`
|
|
25757
|
-
}), !
|
|
25758
|
-
let s =
|
|
25829
|
+
}), !j(i.lnodeTypes, r, a)) continue;
|
|
25830
|
+
let s = a.children.filter((e) => t(e, "DO")), c = await e.getRecords(s);
|
|
25759
25831
|
for (let t of c) {
|
|
25760
25832
|
if (!t) continue;
|
|
25761
25833
|
let n = await e.getAttribute(t, { name: "type" });
|
|
@@ -25764,7 +25836,7 @@ async function Ze(e, n) {
|
|
|
25764
25836
|
tagName: "DOType",
|
|
25765
25837
|
attributes: { id: n }
|
|
25766
25838
|
});
|
|
25767
|
-
r &&
|
|
25839
|
+
r && j(i.doTypes, n, r) && await mt({
|
|
25768
25840
|
query: e,
|
|
25769
25841
|
parent: r,
|
|
25770
25842
|
dataModelMap: i
|
|
@@ -25778,10 +25850,10 @@ async function Ze(e, n) {
|
|
|
25778
25850
|
enumTypes: Array.from(i.enumTypes.values())
|
|
25779
25851
|
};
|
|
25780
25852
|
}
|
|
25781
|
-
function
|
|
25853
|
+
function j(e, t, n) {
|
|
25782
25854
|
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
25783
25855
|
}
|
|
25784
|
-
async function
|
|
25856
|
+
async function mt(e) {
|
|
25785
25857
|
let { query: n, parent: r, dataModelMap: i } = e, a = r.tagName === "DOType" ? await n.getRecords(r.children.filter((e) => t(e, "DA"))) : await n.getRecords(r.children.filter((e) => t(e, "BDA")));
|
|
25786
25858
|
for (let e of a) {
|
|
25787
25859
|
if (!e) continue;
|
|
@@ -25792,13 +25864,13 @@ async function B(e) {
|
|
|
25792
25864
|
tagName: "EnumType",
|
|
25793
25865
|
attributes: { id: r }
|
|
25794
25866
|
});
|
|
25795
|
-
e &&
|
|
25867
|
+
e && j(i.enumTypes, r, e);
|
|
25796
25868
|
} else if (t === "Struct") {
|
|
25797
25869
|
let [e] = await n.findByAttributes({
|
|
25798
25870
|
tagName: "DAType",
|
|
25799
25871
|
attributes: { id: r }
|
|
25800
25872
|
});
|
|
25801
|
-
e &&
|
|
25873
|
+
e && j(i.daTypes, r, e) && await mt({
|
|
25802
25874
|
query: n,
|
|
25803
25875
|
parent: e,
|
|
25804
25876
|
dataModelMap: i
|
|
@@ -25815,7 +25887,7 @@ async function B(e) {
|
|
|
25815
25887
|
tagName: "DOType",
|
|
25816
25888
|
attributes: { id: t }
|
|
25817
25889
|
});
|
|
25818
|
-
r &&
|
|
25890
|
+
r && j(i.doTypes, t, r) && await mt({
|
|
25819
25891
|
query: n,
|
|
25820
25892
|
parent: r,
|
|
25821
25893
|
dataModelMap: i
|
|
@@ -25825,76 +25897,76 @@ async function B(e) {
|
|
|
25825
25897
|
}
|
|
25826
25898
|
//#endregion
|
|
25827
25899
|
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
25828
|
-
var
|
|
25900
|
+
var ht = /* @__PURE__ */ c({ resolve: () => pt }), gt = ["id", "uuid"];
|
|
25829
25901
|
//#endregion
|
|
25830
25902
|
//#region src/v2019C1/extensions/signature/query/element-signature.ts
|
|
25831
|
-
async function
|
|
25903
|
+
async function _t(e, t) {
|
|
25832
25904
|
let n = {
|
|
25833
25905
|
query: e,
|
|
25834
25906
|
resolveReferences: t.resolveReferences ?? !1,
|
|
25835
|
-
ignore: new Set(t.ignoreAttributes ??
|
|
25907
|
+
ignore: new Set(t.ignoreAttributes ?? gt),
|
|
25836
25908
|
memo: /* @__PURE__ */ new Map(),
|
|
25837
25909
|
seen: /* @__PURE__ */ new Set()
|
|
25838
25910
|
};
|
|
25839
|
-
return
|
|
25911
|
+
return bt(t.ref, n);
|
|
25840
25912
|
}
|
|
25841
|
-
var
|
|
25842
|
-
function
|
|
25843
|
-
return
|
|
25913
|
+
var vt = /* @__PURE__ */ new Set();
|
|
25914
|
+
function yt(e, t) {
|
|
25915
|
+
return g[e]?.attributes?.details?.[t]?.default;
|
|
25844
25916
|
}
|
|
25845
|
-
async function
|
|
25917
|
+
async function bt(e, t) {
|
|
25846
25918
|
let n = `${e.tagName}:${e.id}`, r = t.memo.get(n);
|
|
25847
25919
|
if (r !== void 0) return r;
|
|
25848
25920
|
if (t.seen.has(n)) return `@cycle:${e.tagName}`;
|
|
25849
25921
|
t.seen.add(n);
|
|
25850
|
-
let i = await t.query.getTree(e), a = i ? await
|
|
25922
|
+
let i = await t.query.getTree(e), a = i ? await xt(i, t) : "";
|
|
25851
25923
|
return t.seen.delete(n), t.memo.set(n, a), a;
|
|
25852
25924
|
}
|
|
25853
|
-
async function
|
|
25854
|
-
let n = t.resolveReferences ?
|
|
25925
|
+
async function xt(e, t) {
|
|
25926
|
+
let n = t.resolveReferences ? Et(e.tagName) : vt, r = [];
|
|
25855
25927
|
for (let i of e.attributes) {
|
|
25856
|
-
if (t.ignore.has(i.name) || n.has(i.name) || i.value ===
|
|
25928
|
+
if (t.ignore.has(i.name) || n.has(i.name) || i.value === yt(e.tagName, i.name)) continue;
|
|
25857
25929
|
let a = i.value;
|
|
25858
25930
|
if (t.resolveReferences) {
|
|
25859
|
-
let n = await
|
|
25931
|
+
let n = await St(e, i.name, i.value, t);
|
|
25860
25932
|
n !== null && (a = `@sig:${n}`);
|
|
25861
25933
|
}
|
|
25862
25934
|
r.push(`${JSON.stringify(i.name)}:${JSON.stringify(a)}`);
|
|
25863
25935
|
}
|
|
25864
25936
|
r.sort();
|
|
25865
25937
|
let i = [];
|
|
25866
|
-
for (let n of e.tree ?? []) i.push(await
|
|
25938
|
+
for (let n of e.tree ?? []) i.push(await xt(n, t));
|
|
25867
25939
|
i.sort();
|
|
25868
25940
|
let a = e.value?.trim(), o = a ? `,value:${JSON.stringify(a)}` : "";
|
|
25869
25941
|
return `{tag:${JSON.stringify(e.tagName)},attrs:[${r.join(",")}]${o},children:[${i.join(",")}]}`;
|
|
25870
25942
|
}
|
|
25871
|
-
async function
|
|
25872
|
-
let i =
|
|
25943
|
+
async function St(e, t, n, r) {
|
|
25944
|
+
let i = Ct(e, t);
|
|
25873
25945
|
if (i) {
|
|
25874
|
-
let e = await
|
|
25875
|
-
return e ?
|
|
25946
|
+
let e = await Dt(r.query, i.target, n);
|
|
25947
|
+
return e ? bt(e, r) : `@missing:${n}`;
|
|
25876
25948
|
}
|
|
25877
|
-
let a =
|
|
25949
|
+
let a = Tt(e.tagName, t);
|
|
25878
25950
|
if (a) {
|
|
25879
|
-
let e = await
|
|
25880
|
-
return e ?
|
|
25951
|
+
let e = await Ot(r.query, a.target, n);
|
|
25952
|
+
return e ? bt(e, r) : `@missing:${n}`;
|
|
25881
25953
|
}
|
|
25882
25954
|
return null;
|
|
25883
25955
|
}
|
|
25884
|
-
function
|
|
25885
|
-
return
|
|
25956
|
+
function Ct(e, t) {
|
|
25957
|
+
return D[e.tagName]?.find((n) => n.attribute === t && wt(e, n));
|
|
25886
25958
|
}
|
|
25887
|
-
function
|
|
25959
|
+
function wt(e, t) {
|
|
25888
25960
|
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
25889
25961
|
}
|
|
25890
|
-
function
|
|
25891
|
-
return
|
|
25962
|
+
function Tt(e, t) {
|
|
25963
|
+
return T[e]?.find((e) => e.attribute.uuid === t);
|
|
25892
25964
|
}
|
|
25893
|
-
function
|
|
25894
|
-
let t =
|
|
25895
|
-
return t ? new Set(t.map((e) => e.attribute.path)) :
|
|
25965
|
+
function Et(e) {
|
|
25966
|
+
let t = T[e];
|
|
25967
|
+
return t ? new Set(t.map((e) => e.attribute.path)) : vt;
|
|
25896
25968
|
}
|
|
25897
|
-
async function
|
|
25969
|
+
async function Dt(e, t, n) {
|
|
25898
25970
|
let [r] = await e.findByAttributes({
|
|
25899
25971
|
tagName: t,
|
|
25900
25972
|
attributes: { id: n }
|
|
@@ -25904,7 +25976,7 @@ async function st(e, t, n) {
|
|
|
25904
25976
|
id: r.id
|
|
25905
25977
|
} : null;
|
|
25906
25978
|
}
|
|
25907
|
-
async function
|
|
25979
|
+
async function Ot(e, t, n) {
|
|
25908
25980
|
for (let r of t) {
|
|
25909
25981
|
let [t] = await e.findByAttributes({
|
|
25910
25982
|
tagName: r,
|
|
@@ -25919,14 +25991,14 @@ async function ct(e, t, n) {
|
|
|
25919
25991
|
}
|
|
25920
25992
|
//#endregion
|
|
25921
25993
|
//#region src/v2019C1/extensions/signature/query/index.ts
|
|
25922
|
-
var
|
|
25994
|
+
var kt = /* @__PURE__ */ c({ elementSignature: () => _t });
|
|
25923
25995
|
//#endregion
|
|
25924
25996
|
//#region src/v2019C1/extensions/data-model/transaction/import-types.ts
|
|
25925
|
-
async function
|
|
25926
|
-
let { sourceQuery: n, records: r, cloneMappings: i = [], forkPrefix: a = "" } = t, o =
|
|
25997
|
+
async function At(e, t) {
|
|
25998
|
+
let { sourceQuery: n, records: r, cloneMappings: i = [], forkPrefix: a = "" } = t, o = jt(await pt(n, { records: r })), s = await e.ensureChild(await e.getRoot(), {
|
|
25927
25999
|
tagName: "DataTypeTemplates",
|
|
25928
26000
|
attributes: {}
|
|
25929
|
-
}), c = await
|
|
26001
|
+
}), c = await Nt(e), l = /* @__PURE__ */ new Map(), u = [], d = [], f = {
|
|
25930
26002
|
reused: 0,
|
|
25931
26003
|
preserved: 0,
|
|
25932
26004
|
forked: 0,
|
|
@@ -25935,7 +26007,7 @@ async function ut(e, t) {
|
|
|
25935
26007
|
for (let t of o) {
|
|
25936
26008
|
let r = await n.getAttribute(t, { name: "id" });
|
|
25937
26009
|
if (!r) continue;
|
|
25938
|
-
let i = await
|
|
26010
|
+
let i = await _t(n, {
|
|
25939
26011
|
ref: {
|
|
25940
26012
|
tagName: t.tagName,
|
|
25941
26013
|
id: t.id
|
|
@@ -25952,24 +26024,24 @@ async function ut(e, t) {
|
|
|
25952
26024
|
tagName: t.tagName,
|
|
25953
26025
|
attributes: { id: r }
|
|
25954
26026
|
}), h = r, g = p;
|
|
25955
|
-
m ? (h = await
|
|
26027
|
+
m ? (h = await Bt(e, t.tagName, `${a}${r}_${Vt(i)}`), g = Pt(p, h), f.forked++) : f.preserved++;
|
|
25956
26028
|
let _ = await e.deepClone(s, g);
|
|
25957
|
-
l.set(r, h), _?.record && (u.push(
|
|
26029
|
+
l.set(r, h), _?.record && (u.push(M(_.record.tagName, _.record.id)), m && d.push({
|
|
25958
26030
|
oldId: r,
|
|
25959
|
-
oldRef:
|
|
25960
|
-
forkRef:
|
|
26031
|
+
oldRef: M(m.tagName, m.id),
|
|
26032
|
+
forkRef: M(_.record.tagName, _.record.id),
|
|
25961
26033
|
forkedId: h
|
|
25962
26034
|
}));
|
|
25963
26035
|
}
|
|
25964
26036
|
let p = i.map((e) => e.target);
|
|
25965
26037
|
for (let t of u) {
|
|
25966
26038
|
let n = await e.getTree(t);
|
|
25967
|
-
n &&
|
|
26039
|
+
n && Ft(n, p);
|
|
25968
26040
|
}
|
|
25969
|
-
return await
|
|
26041
|
+
return await st(e, {
|
|
25970
26042
|
records: p,
|
|
25971
26043
|
idRemap: l
|
|
25972
|
-
}), d.length > 0 && await
|
|
26044
|
+
}), d.length > 0 && await It(e, {
|
|
25973
26045
|
collisions: d,
|
|
25974
26046
|
idRemap: l,
|
|
25975
26047
|
referrerRecords: p,
|
|
@@ -25979,7 +26051,7 @@ async function ut(e, t) {
|
|
|
25979
26051
|
stats: f
|
|
25980
26052
|
};
|
|
25981
26053
|
}
|
|
25982
|
-
function
|
|
26054
|
+
function jt(e) {
|
|
25983
26055
|
return [
|
|
25984
26056
|
...e.enumTypes,
|
|
25985
26057
|
...e.daTypes,
|
|
@@ -25987,20 +26059,20 @@ function dt(e) {
|
|
|
25987
26059
|
...e.lnodeTypes
|
|
25988
26060
|
];
|
|
25989
26061
|
}
|
|
25990
|
-
var
|
|
26062
|
+
var Mt = [
|
|
25991
26063
|
"EnumType",
|
|
25992
26064
|
"DAType",
|
|
25993
26065
|
"DOType",
|
|
25994
26066
|
"LNodeType"
|
|
25995
26067
|
];
|
|
25996
|
-
async function
|
|
26068
|
+
async function Nt(e) {
|
|
25997
26069
|
let t = /* @__PURE__ */ new Map();
|
|
25998
|
-
for (let n of
|
|
26070
|
+
for (let n of Mt) {
|
|
25999
26071
|
let r = await e.getRecordsByTagName(n);
|
|
26000
26072
|
for (let i of r) {
|
|
26001
26073
|
let r = i.attributes.find((e) => e.name === "id")?.value;
|
|
26002
26074
|
if (!r) continue;
|
|
26003
|
-
let a = await
|
|
26075
|
+
let a = await _t(e, {
|
|
26004
26076
|
ref: {
|
|
26005
26077
|
tagName: n,
|
|
26006
26078
|
id: i.id
|
|
@@ -26012,26 +26084,26 @@ async function pt(e) {
|
|
|
26012
26084
|
}
|
|
26013
26085
|
return t;
|
|
26014
26086
|
}
|
|
26015
|
-
function
|
|
26087
|
+
function Pt(e, t) {
|
|
26016
26088
|
let n = structuredClone(e), r = n.attributes, i = r.find((e) => e.name === "id");
|
|
26017
26089
|
return i ? i.value = t : r.push({
|
|
26018
26090
|
name: "id",
|
|
26019
26091
|
value: t
|
|
26020
26092
|
}), n;
|
|
26021
26093
|
}
|
|
26022
|
-
function
|
|
26094
|
+
function M(e, t) {
|
|
26023
26095
|
return {
|
|
26024
26096
|
tagName: e,
|
|
26025
26097
|
id: t
|
|
26026
26098
|
};
|
|
26027
26099
|
}
|
|
26028
|
-
function
|
|
26029
|
-
t.push(
|
|
26030
|
-
for (let n of e.tree ?? [])
|
|
26100
|
+
function Ft(e, t) {
|
|
26101
|
+
t.push(M(e.tagName, e.id));
|
|
26102
|
+
for (let n of e.tree ?? []) Ft(n, t);
|
|
26031
26103
|
}
|
|
26032
|
-
var
|
|
26033
|
-
async function
|
|
26034
|
-
let { collisions: n, idRemap: r, referrerRecords: i, stats: a } = t, o = await
|
|
26104
|
+
var N = (e) => `${e.tagName}#${e.id}`;
|
|
26105
|
+
async function It(e, t) {
|
|
26106
|
+
let { collisions: n, idRemap: r, referrerRecords: i, stats: a } = t, o = await Lt(e, n), s = /* @__PURE__ */ new Map(), c = [];
|
|
26035
26107
|
for (let t of n) if (o.has(t.oldId)) {
|
|
26036
26108
|
await e.update(t.forkRef, { attributes: { id: t.oldId } }), s.set(t.forkedId, t.oldId), c.push(t.forkRef), a.reclaimed++;
|
|
26037
26109
|
for (let [e, n] of r) n === t.forkedId && r.set(e, t.oldId);
|
|
@@ -26040,38 +26112,38 @@ async function ht(e, t) {
|
|
|
26040
26112
|
let l = [...i];
|
|
26041
26113
|
for (let t of c) {
|
|
26042
26114
|
let n = await e.getTree(t);
|
|
26043
|
-
n &&
|
|
26115
|
+
n && Ft(n, l);
|
|
26044
26116
|
}
|
|
26045
|
-
await
|
|
26117
|
+
await st(e, {
|
|
26046
26118
|
records: l,
|
|
26047
26119
|
idRemap: s
|
|
26048
26120
|
});
|
|
26049
26121
|
}
|
|
26050
|
-
async function
|
|
26051
|
-
let n = /* @__PURE__ */ new Set(), r = new Map(t.map((e) => [
|
|
26122
|
+
async function Lt(e, t) {
|
|
26123
|
+
let n = /* @__PURE__ */ new Set(), r = new Map(t.map((e) => [N(e.oldRef), e.oldId])), i = t.map((e) => e.oldRef), a = new Set(i.map(N)), o = /* @__PURE__ */ new Set(), s = !0;
|
|
26052
26124
|
for (; s;) {
|
|
26053
26125
|
s = !1;
|
|
26054
26126
|
for (let t of i) {
|
|
26055
|
-
let c =
|
|
26056
|
-
if (o.has(c) || (await
|
|
26057
|
-
let l = await e.getTree(t), u = l ? await
|
|
26127
|
+
let c = N(t);
|
|
26128
|
+
if (o.has(c) || (await O(e, { target: t })).length > 0) continue;
|
|
26129
|
+
let l = await e.getTree(t), u = l ? await Rt(e, l) : [];
|
|
26058
26130
|
await e.delete(t), o.add(c), s = !0;
|
|
26059
26131
|
let d = r.get(c);
|
|
26060
26132
|
d !== void 0 && n.add(d);
|
|
26061
26133
|
for (let e of u) {
|
|
26062
|
-
let t =
|
|
26134
|
+
let t = N(e);
|
|
26063
26135
|
a.has(t) || (i.push(e), a.add(t));
|
|
26064
26136
|
}
|
|
26065
26137
|
}
|
|
26066
26138
|
}
|
|
26067
26139
|
return n;
|
|
26068
26140
|
}
|
|
26069
|
-
async function
|
|
26141
|
+
async function Rt(e, t) {
|
|
26070
26142
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
26071
26143
|
async function i(t) {
|
|
26072
|
-
let a =
|
|
26144
|
+
let a = D[t.tagName];
|
|
26073
26145
|
for (let i of a ?? []) {
|
|
26074
|
-
if (!
|
|
26146
|
+
if (!zt(t, i)) continue;
|
|
26075
26147
|
let a = t.attributes.find((e) => e.name === i.attribute)?.value;
|
|
26076
26148
|
if (!a) continue;
|
|
26077
26149
|
let [o] = await e.findByAttributes({
|
|
@@ -26079,17 +26151,17 @@ async function _t(e, t) {
|
|
|
26079
26151
|
attributes: { id: a }
|
|
26080
26152
|
});
|
|
26081
26153
|
if (!o) continue;
|
|
26082
|
-
let s =
|
|
26154
|
+
let s = M(i.target, o.id), c = N(s);
|
|
26083
26155
|
r.has(c) || (r.add(c), n.push(s));
|
|
26084
26156
|
}
|
|
26085
26157
|
for (let e of t.tree ?? []) await i(e);
|
|
26086
26158
|
}
|
|
26087
26159
|
return await i(t), n;
|
|
26088
26160
|
}
|
|
26089
|
-
function
|
|
26161
|
+
function zt(e, t) {
|
|
26090
26162
|
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
26091
26163
|
}
|
|
26092
|
-
async function
|
|
26164
|
+
async function Bt(e, t, n) {
|
|
26093
26165
|
let r = n, i = 2;
|
|
26094
26166
|
for (; (await e.findByAttributes({
|
|
26095
26167
|
tagName: t,
|
|
@@ -26097,22 +26169,479 @@ async function yt(e, t, n) {
|
|
|
26097
26169
|
})).length > 0;) r = `${n}_${i}`, i += 1;
|
|
26098
26170
|
return r;
|
|
26099
26171
|
}
|
|
26100
|
-
function
|
|
26172
|
+
function Vt(e) {
|
|
26101
26173
|
let t = 2166136261;
|
|
26102
26174
|
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
26103
26175
|
return (t >>> 0).toString(16).padStart(8, "0");
|
|
26104
26176
|
}
|
|
26105
26177
|
//#endregion
|
|
26106
26178
|
//#region src/v2019C1/extensions/data-model/index.ts
|
|
26107
|
-
var
|
|
26108
|
-
query:
|
|
26109
|
-
transaction: /* @__PURE__ */
|
|
26110
|
-
}
|
|
26179
|
+
var Ht = {
|
|
26180
|
+
query: ht,
|
|
26181
|
+
transaction: /* @__PURE__ */ c({ importTypes: () => At })
|
|
26182
|
+
};
|
|
26183
|
+
//#endregion
|
|
26184
|
+
//#region src/v2019C1/extensions/history/query/get-sorted-hitem.ts
|
|
26185
|
+
async function Ut(e) {
|
|
26186
|
+
let t = await e.getRecord({ tagName: "History" });
|
|
26187
|
+
if (!t) return [];
|
|
26188
|
+
let { Hitem: n = [] } = await e.findDescendants(t, { collect: "Hitem" });
|
|
26189
|
+
function r(e, t) {
|
|
26190
|
+
return Number(e.attributes.find((e) => e.name === t)?.value || 0);
|
|
26191
|
+
}
|
|
26192
|
+
return [...n].sort((e, t) => {
|
|
26193
|
+
let n = r(e, "version") - r(t, "version");
|
|
26194
|
+
return n === 0 ? r(e, "revision") - r(t, "revision") : n;
|
|
26195
|
+
});
|
|
26196
|
+
}
|
|
26197
|
+
//#endregion
|
|
26198
|
+
//#region src/v2019C1/extensions/history/query/get-latest-hitem.ts
|
|
26199
|
+
async function Wt(e) {
|
|
26200
|
+
return (await Ut(e)).at(-1);
|
|
26201
|
+
}
|
|
26202
|
+
//#endregion
|
|
26203
|
+
//#region src/v2019C1/extensions/history/query/index.ts
|
|
26204
|
+
var Gt = /* @__PURE__ */ c({
|
|
26205
|
+
getLatestHitem: () => Wt,
|
|
26206
|
+
getSortedHitems: () => Ut
|
|
26207
|
+
});
|
|
26208
|
+
//#endregion
|
|
26209
|
+
//#region src/v2019C1/extensions/history/transaction/add-entry.ts
|
|
26210
|
+
async function Kt(e, t) {
|
|
26211
|
+
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, {
|
|
26212
|
+
tagName: "Header",
|
|
26213
|
+
attributes: {
|
|
26214
|
+
id: a ?? n.replace(/\.[^.]+$/, "").toLowerCase().replace(/\s+/g, "_"),
|
|
26215
|
+
toolID: l,
|
|
26216
|
+
fileType: o,
|
|
26217
|
+
...s ? { nameStructure: s } : {},
|
|
26218
|
+
version: "0",
|
|
26219
|
+
revision: "1",
|
|
26220
|
+
uuid: crypto.randomUUID()
|
|
26221
|
+
}
|
|
26222
|
+
}), h = await e.getRecord({ tagName: "History" }) ?? await e.addChild(m, {
|
|
26223
|
+
tagName: "History",
|
|
26224
|
+
attributes: {}
|
|
26225
|
+
}), g = await Wt(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";
|
|
26226
|
+
await e.update(m, { attributes: {
|
|
26227
|
+
version: y,
|
|
26228
|
+
revision: b
|
|
26229
|
+
} });
|
|
26230
|
+
let ee = /* @__PURE__ */ new Date(), x = ee.toString().split(" "), S = ee.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), te = `${x[0]} ${x[1]} ${x[2]} ${x[4]} ${S} ${x[3]}`;
|
|
26231
|
+
await e.addChild(h, {
|
|
26232
|
+
tagName: "Hitem",
|
|
26233
|
+
attributes: {
|
|
26234
|
+
version: y,
|
|
26235
|
+
revision: b,
|
|
26236
|
+
when: te,
|
|
26237
|
+
who: u,
|
|
26238
|
+
what: d,
|
|
26239
|
+
why: f
|
|
26240
|
+
}
|
|
26241
|
+
}), await e.update(m, { attributes: {
|
|
26242
|
+
version: y,
|
|
26243
|
+
revision: b
|
|
26244
|
+
} });
|
|
26245
|
+
}
|
|
26246
|
+
//#endregion
|
|
26247
|
+
//#region src/v2019C1/extensions/history/index.ts
|
|
26248
|
+
var qt = {
|
|
26249
|
+
query: Gt,
|
|
26250
|
+
transaction: /* @__PURE__ */ c({ addEntry: () => Kt })
|
|
26251
|
+
};
|
|
26252
|
+
//#endregion
|
|
26253
|
+
//#region src/v2019C1/extensions/identity/transaction/write-identity.ts
|
|
26254
|
+
async function P(e, t) {
|
|
26255
|
+
let { mappings: n, mode: r } = t;
|
|
26256
|
+
if (r !== "keep") for (let t of n) {
|
|
26257
|
+
let n = r === "strip" ? Jt() : Yt(t);
|
|
26258
|
+
if (Object.keys(n).length === 0) continue;
|
|
26259
|
+
let i = await e.getRecord(t.target);
|
|
26260
|
+
i && await e.update(i, { attributes: n });
|
|
26261
|
+
}
|
|
26262
|
+
}
|
|
26263
|
+
function Jt() {
|
|
26264
|
+
return {
|
|
26265
|
+
templateUuid: void 0,
|
|
26266
|
+
originUuid: void 0
|
|
26267
|
+
};
|
|
26268
|
+
}
|
|
26269
|
+
function Yt(e) {
|
|
26270
|
+
let t = Zt(e.source.attributes, "uuid"), n = Zt(e.source.attributes, "templateUuid"), r = Zt(e.source.attributes, "originUuid"), i = {};
|
|
26271
|
+
t && (i.templateUuid = t);
|
|
26272
|
+
let a = Xt(e.target.tagName);
|
|
26273
|
+
return n && !r && a && (i.originUuid = n), i;
|
|
26274
|
+
}
|
|
26275
|
+
function Xt(e) {
|
|
26276
|
+
let t = b.attributes[e];
|
|
26277
|
+
return t ? "originUuid" in t : !1;
|
|
26278
|
+
}
|
|
26279
|
+
function Zt(e, t) {
|
|
26280
|
+
return e.find((e) => e.name === t)?.value;
|
|
26281
|
+
}
|
|
26282
|
+
//#endregion
|
|
26283
|
+
//#region src/v2019C1/extensions/identity/index.ts
|
|
26284
|
+
var Qt = { transaction: /* @__PURE__ */ c({ writeIdentity: () => P }) };
|
|
26285
|
+
//#endregion
|
|
26286
|
+
//#region src/v2019C1/extensions/lifecycle/engine/group.ts
|
|
26287
|
+
function $t(e, t) {
|
|
26288
|
+
let n = [];
|
|
26289
|
+
return en({
|
|
26290
|
+
node: e,
|
|
26291
|
+
instanceScopeId: t,
|
|
26292
|
+
out: n
|
|
26293
|
+
}), n;
|
|
26294
|
+
}
|
|
26295
|
+
function en(e) {
|
|
26296
|
+
let { node: t, instanceScopeId: n, out: r } = e;
|
|
26297
|
+
if (t.change === "unchanged") {
|
|
26298
|
+
for (let e of t.children) en({
|
|
26299
|
+
node: e,
|
|
26300
|
+
instanceScopeId: n,
|
|
26301
|
+
out: r
|
|
26302
|
+
});
|
|
26303
|
+
return;
|
|
26304
|
+
}
|
|
26305
|
+
let i = [];
|
|
26306
|
+
tn({
|
|
26307
|
+
node: t,
|
|
26308
|
+
out: i
|
|
26309
|
+
}), r.push({
|
|
26310
|
+
id: nn(t, n),
|
|
26311
|
+
change: t.change,
|
|
26312
|
+
title: `${t.change} ${t.tagName}`,
|
|
26313
|
+
primary: t,
|
|
26314
|
+
companions: i,
|
|
26315
|
+
dependsOn: [],
|
|
26316
|
+
suggestedAction: "accept",
|
|
26317
|
+
instanceScopeId: n
|
|
26318
|
+
});
|
|
26319
|
+
}
|
|
26320
|
+
function tn(e) {
|
|
26321
|
+
let { node: t, out: n } = e;
|
|
26322
|
+
for (let e of t.children) e.change !== "unchanged" && n.push(e), tn({
|
|
26323
|
+
node: e,
|
|
26324
|
+
out: n
|
|
26325
|
+
});
|
|
26326
|
+
}
|
|
26327
|
+
function nn(e, t) {
|
|
26328
|
+
let n = e.sourceRef ?? e.instanceRef, r = n ? `${n.tagName}:${n.id}` : e.tagName;
|
|
26329
|
+
return t ? `${t}::${r}` : r;
|
|
26330
|
+
}
|
|
26331
|
+
//#endregion
|
|
26332
|
+
//#region src/v2019C1/extensions/lifecycle/engine/visible-attributes.ts
|
|
26333
|
+
var rn = new Set([
|
|
26334
|
+
"uuid",
|
|
26335
|
+
"templateUuid",
|
|
26336
|
+
"originUuid"
|
|
26337
|
+
]), an = new Set(Object.values(T).flatMap((e) => e.flatMap((e) => [e.attribute.path, e.attribute.uuid])));
|
|
26338
|
+
function F(e) {
|
|
26339
|
+
let t = {};
|
|
26340
|
+
for (let [n, r] of Object.entries(e)) rn.has(n) || n === "name" || an.has(n) || (t[n] = r);
|
|
26341
|
+
return t;
|
|
26342
|
+
}
|
|
26343
|
+
//#endregion
|
|
26344
|
+
//#region src/v2019C1/extensions/lifecycle/engine/diff.ts
|
|
26345
|
+
var on = new Set(Object.keys(T));
|
|
26346
|
+
async function sn(e) {
|
|
26347
|
+
let { sourceQuery: t, targetQuery: n, sourceRootRef: r, instanceRootRef: i } = e, a = await t.any.getTree(r);
|
|
26348
|
+
if (!a) throw Error("diff: source subtree not found");
|
|
26349
|
+
let o = i ? await n.any.getTree(i) : void 0;
|
|
26350
|
+
if (!o) {
|
|
26351
|
+
let e = ln(a);
|
|
26352
|
+
return {
|
|
26353
|
+
root: e,
|
|
26354
|
+
roots: [e],
|
|
26355
|
+
groups: $t(e),
|
|
26356
|
+
needsDecisions: !1,
|
|
26357
|
+
summary: hn(e)
|
|
26358
|
+
};
|
|
26359
|
+
}
|
|
26360
|
+
let s = /* @__PURE__ */ new Map();
|
|
26361
|
+
await fn(n, {
|
|
26362
|
+
node: o,
|
|
26363
|
+
index: s
|
|
26364
|
+
});
|
|
26365
|
+
let c = /* @__PURE__ */ new Set();
|
|
26366
|
+
await pn(t, {
|
|
26367
|
+
node: a,
|
|
26368
|
+
out: c
|
|
26369
|
+
});
|
|
26370
|
+
let l = await cn(t, {
|
|
26371
|
+
targetQuery: n,
|
|
26372
|
+
sourceNode: a,
|
|
26373
|
+
instanceNode: o,
|
|
26374
|
+
index: s,
|
|
26375
|
+
sourceUuids: c
|
|
26376
|
+
}), u = hn(l), d = u.added + u.removed + u.modified > 0;
|
|
26377
|
+
return {
|
|
26378
|
+
root: l,
|
|
26379
|
+
roots: [l],
|
|
26380
|
+
groups: $t(l, o.id),
|
|
26381
|
+
needsDecisions: d,
|
|
26382
|
+
summary: u
|
|
26383
|
+
};
|
|
26384
|
+
}
|
|
26385
|
+
async function cn(e, t) {
|
|
26386
|
+
let { targetQuery: n, sourceNode: r, instanceNode: i, index: o, sourceUuids: s } = t, c = await dn(e, {
|
|
26387
|
+
targetQuery: n,
|
|
26388
|
+
sourceNode: r,
|
|
26389
|
+
instanceNode: i
|
|
26390
|
+
}), l = [], u = /* @__PURE__ */ new Set();
|
|
26391
|
+
for (let t of r.tree) {
|
|
26392
|
+
let r = await e.any.getAttribute(t, { name: "uuid" }), a = (r ? o.get(r) : void 0) ?? (r ? void 0 : i.tree.find((e) => e.tagName === t.tagName && !u.has(e.id)));
|
|
26393
|
+
a ? (u.add(a.id), l.push(await cn(e, {
|
|
26394
|
+
targetQuery: n,
|
|
26395
|
+
sourceNode: t,
|
|
26396
|
+
instanceNode: a,
|
|
26397
|
+
index: o,
|
|
26398
|
+
sourceUuids: s
|
|
26399
|
+
}))) : l.push(ln(t));
|
|
26400
|
+
}
|
|
26401
|
+
for (let e of i.tree) {
|
|
26402
|
+
if (u.has(e.id)) continue;
|
|
26403
|
+
let t = await n.any.getAttribute(e, { name: "templateUuid" });
|
|
26404
|
+
(t ? !s.has(t) : on.has(e.tagName)) && l.push(un(e));
|
|
26405
|
+
}
|
|
26406
|
+
return {
|
|
26407
|
+
change: c.length > 0 ? "modified" : "unchanged",
|
|
26408
|
+
tagName: r.tagName,
|
|
26409
|
+
sourceRef: a(r),
|
|
26410
|
+
instanceRef: a(i),
|
|
26411
|
+
attributeChanges: c.length > 0 ? c : void 0,
|
|
26412
|
+
children: l
|
|
26413
|
+
};
|
|
26414
|
+
}
|
|
26415
|
+
function ln(e) {
|
|
26416
|
+
let t = e.tree.map((e) => ln(e));
|
|
26417
|
+
return {
|
|
26418
|
+
change: "added",
|
|
26419
|
+
tagName: e.tagName,
|
|
26420
|
+
sourceRef: a(e),
|
|
26421
|
+
children: t
|
|
26422
|
+
};
|
|
26423
|
+
}
|
|
26424
|
+
function un(e) {
|
|
26425
|
+
let t = e.tree.map((e) => un(e));
|
|
26426
|
+
return {
|
|
26427
|
+
change: "removed",
|
|
26428
|
+
tagName: e.tagName,
|
|
26429
|
+
instanceRef: a(e),
|
|
26430
|
+
children: t
|
|
26431
|
+
};
|
|
26432
|
+
}
|
|
26433
|
+
async function dn(e, t) {
|
|
26434
|
+
let { targetQuery: n, sourceNode: r, instanceNode: i } = t, a = F(await e.any.getAttributes(r)), o = F(await n.any.getAttributes(i)), s = [];
|
|
26435
|
+
for (let e of new Set([...Object.keys(a), ...Object.keys(o)])) {
|
|
26436
|
+
let t = o[e], n = a[e];
|
|
26437
|
+
t !== n && s.push({
|
|
26438
|
+
name: e,
|
|
26439
|
+
before: t,
|
|
26440
|
+
after: n
|
|
26441
|
+
});
|
|
26442
|
+
}
|
|
26443
|
+
return s;
|
|
26444
|
+
}
|
|
26445
|
+
async function fn(e, t) {
|
|
26446
|
+
let { node: n, index: r } = t, i = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26447
|
+
i && r.set(i, n);
|
|
26448
|
+
for (let t of n.tree) await fn(e, {
|
|
26449
|
+
node: t,
|
|
26450
|
+
index: r
|
|
26451
|
+
});
|
|
26452
|
+
}
|
|
26453
|
+
async function pn(e, t) {
|
|
26454
|
+
let { node: n, out: r } = t, i = await e.any.getAttribute(n, { name: "uuid" });
|
|
26455
|
+
i && r.add(i);
|
|
26456
|
+
for (let t of n.tree) await pn(e, {
|
|
26457
|
+
node: t,
|
|
26458
|
+
out: r
|
|
26459
|
+
});
|
|
26460
|
+
}
|
|
26461
|
+
function mn(e) {
|
|
26462
|
+
let [t] = e, n = e.flatMap((e) => e.groups), r = e.reduce((e, t) => ({
|
|
26463
|
+
added: e.added + t.summary.added,
|
|
26464
|
+
removed: e.removed + t.summary.removed,
|
|
26465
|
+
modified: e.modified + t.summary.modified
|
|
26466
|
+
}), {
|
|
26467
|
+
added: 0,
|
|
26468
|
+
removed: 0,
|
|
26469
|
+
modified: 0
|
|
26470
|
+
}), i = e.some((e) => e.needsDecisions);
|
|
26471
|
+
return {
|
|
26472
|
+
root: t.root,
|
|
26473
|
+
roots: e.flatMap((e) => e.roots),
|
|
26474
|
+
groups: n,
|
|
26475
|
+
needsDecisions: i,
|
|
26476
|
+
summary: r
|
|
26477
|
+
};
|
|
26478
|
+
}
|
|
26479
|
+
function hn(e) {
|
|
26480
|
+
let t = {
|
|
26481
|
+
added: 0,
|
|
26482
|
+
removed: 0,
|
|
26483
|
+
modified: 0
|
|
26484
|
+
}, n = (e) => {
|
|
26485
|
+
e.change === "added" ? t.added++ : e.change === "removed" ? t.removed++ : e.change === "modified" && t.modified++;
|
|
26486
|
+
for (let t of e.children) n(t);
|
|
26487
|
+
};
|
|
26488
|
+
return n(e), t;
|
|
26489
|
+
}
|
|
26490
|
+
//#endregion
|
|
26491
|
+
//#region src/v2019C1/extensions/lifecycle/constraints/classify-attribute.constants.ts
|
|
26492
|
+
var gn = new Set([
|
|
26493
|
+
"uuid",
|
|
26494
|
+
"templateUuid",
|
|
26495
|
+
"originUuid"
|
|
26496
|
+
]), _n = ["rename", "free"], vn = /* @__PURE__ */ new Map();
|
|
26497
|
+
function yn(e) {
|
|
26498
|
+
let t = vn.get(e);
|
|
26499
|
+
if (t) return t;
|
|
26500
|
+
let n = g[e]?.attributes?.identityFields ?? [], r = new Set(n);
|
|
26501
|
+
return vn.set(e, r), r;
|
|
26502
|
+
}
|
|
26503
|
+
//#endregion
|
|
26504
|
+
//#region src/v2019C1/extensions/lifecycle/constraints/classify-attribute.ts
|
|
26505
|
+
function I(e, t) {
|
|
26506
|
+
return gn.has(t) ? "identity" : Sn(e).has(t) ? "reference" : t === "name" ? "rename" : ne.has(t) || yn(e).has(t) ? "identity" : "free";
|
|
26507
|
+
}
|
|
26508
|
+
function bn(e) {
|
|
26509
|
+
return _n.includes(e);
|
|
26510
|
+
}
|
|
26511
|
+
function xn(e) {
|
|
26512
|
+
let t = Object.keys(h[e] ?? {}), n = [];
|
|
26513
|
+
for (let r of t) {
|
|
26514
|
+
let t = I(e, r);
|
|
26515
|
+
bn(t) && n.push({
|
|
26516
|
+
attr: r,
|
|
26517
|
+
mode: t
|
|
26518
|
+
});
|
|
26519
|
+
}
|
|
26520
|
+
return n;
|
|
26521
|
+
}
|
|
26522
|
+
function Sn(e) {
|
|
26523
|
+
let t = T[e];
|
|
26524
|
+
if (!t) return Cn;
|
|
26525
|
+
let n = /* @__PURE__ */ new Set();
|
|
26526
|
+
for (let e of t) n.add(e.attribute.path), n.add(e.attribute.uuid);
|
|
26527
|
+
return n;
|
|
26528
|
+
}
|
|
26529
|
+
var Cn = /* @__PURE__ */ new Set();
|
|
26530
|
+
//#endregion
|
|
26531
|
+
//#region src/v2019C1/extensions/lifecycle/constraints/find-constraint-violation.ts
|
|
26532
|
+
async function L(e, t) {
|
|
26533
|
+
let { parentRef: n, childTag: r, candidate: i, excludeId: a } = t, o = Tn(n.tagName).filter((e) => (e.kind === "unique" || e.kind === "key") && En(e, r));
|
|
26534
|
+
if (o.length === 0) return null;
|
|
26535
|
+
let s = (await e.any.getTree(n))?.tree ?? [];
|
|
26536
|
+
for (let e of o) {
|
|
26537
|
+
let t = Dn(e);
|
|
26538
|
+
if (!(t.length === 0 || t.some((e) => i[e] === void 0))) {
|
|
26539
|
+
for (let n of s) if (n.id !== a && En(e, n.tagName) && t.every((e) => wn(n, e) === i[e])) return {
|
|
26540
|
+
constraint: e.name,
|
|
26541
|
+
fields: t,
|
|
26542
|
+
offendingId: n.id
|
|
26543
|
+
};
|
|
26544
|
+
}
|
|
26545
|
+
}
|
|
26546
|
+
return null;
|
|
26547
|
+
}
|
|
26548
|
+
function wn(e, t) {
|
|
26549
|
+
return e.attributes.find((e) => e.name === t)?.value;
|
|
26550
|
+
}
|
|
26551
|
+
function Tn(e) {
|
|
26552
|
+
return [...g[e]?.constraints ?? []];
|
|
26553
|
+
}
|
|
26554
|
+
function En(e, t) {
|
|
26555
|
+
for (let n of e.selector ?? []) {
|
|
26556
|
+
let e = (n.steps ?? []).at(-1);
|
|
26557
|
+
if (e && (e.kind === "wildcard" || e.kind === "name" && e.value === t)) return !0;
|
|
26558
|
+
}
|
|
26559
|
+
return !1;
|
|
26560
|
+
}
|
|
26561
|
+
function Dn(e) {
|
|
26562
|
+
return (e.fields ?? []).map((e) => e.target?.value).filter((e) => !!e);
|
|
26563
|
+
}
|
|
26564
|
+
//#endregion
|
|
26565
|
+
//#region src/v2019C1/extensions/lifecycle/constraints/resolve-unique-value.ts
|
|
26566
|
+
var On = 1e3;
|
|
26567
|
+
async function kn(e, t) {
|
|
26568
|
+
let { parentRef: n, childTag: r, candidate: i, attr: a, decorate: o, excludeId: s } = t, c = i[a] ?? "";
|
|
26569
|
+
if (!await L(e, {
|
|
26570
|
+
parentRef: n,
|
|
26571
|
+
childTag: r,
|
|
26572
|
+
candidate: i,
|
|
26573
|
+
excludeId: s
|
|
26574
|
+
})) return c;
|
|
26575
|
+
for (let t = 1; t <= On; t++) {
|
|
26576
|
+
let l = o ? o({
|
|
26577
|
+
base: c,
|
|
26578
|
+
attempt: t,
|
|
26579
|
+
attr: a,
|
|
26580
|
+
childTag: r
|
|
26581
|
+
}) : `${c}_${t}`;
|
|
26582
|
+
if (!await L(e, {
|
|
26583
|
+
parentRef: n,
|
|
26584
|
+
childTag: r,
|
|
26585
|
+
candidate: {
|
|
26586
|
+
...i,
|
|
26587
|
+
[a]: l
|
|
26588
|
+
},
|
|
26589
|
+
excludeId: s
|
|
26590
|
+
})) return l;
|
|
26591
|
+
}
|
|
26592
|
+
throw Error(`could not resolve a unique ${a} for <${r}> under <${n.tagName}> after ${On} attempts`);
|
|
26593
|
+
}
|
|
26594
|
+
//#endregion
|
|
26595
|
+
//#region src/v2019C1/extensions/lifecycle/constraints/resolve-placement-collision.ts
|
|
26596
|
+
async function R(e, t) {
|
|
26597
|
+
let { ref: n, decorate: r, overrides: i } = t, a = t.parentRef ?? (await e.getRecord(n))?.parent;
|
|
26598
|
+
if (!a) return { status: "ok" };
|
|
26599
|
+
let o = await e.getAttributes(n);
|
|
26600
|
+
if (i) for (let [t, r] of Object.entries(i)) {
|
|
26601
|
+
let i = I(n.tagName, t);
|
|
26602
|
+
(i === "rename" || i === "free") && o[t] !== r && (await e.update(n, { attributes: { [t]: r } }), o = {
|
|
26603
|
+
...o,
|
|
26604
|
+
[t]: r
|
|
26605
|
+
});
|
|
26606
|
+
}
|
|
26607
|
+
let s = await L(e, {
|
|
26608
|
+
parentRef: a,
|
|
26609
|
+
childTag: n.tagName,
|
|
26610
|
+
candidate: o,
|
|
26611
|
+
excludeId: n.id
|
|
26612
|
+
});
|
|
26613
|
+
if (!s) return { status: "ok" };
|
|
26614
|
+
let c = s.fields.find((e) => {
|
|
26615
|
+
let t = I(n.tagName, e);
|
|
26616
|
+
return t === "rename" || t === "free";
|
|
26617
|
+
});
|
|
26618
|
+
if (!c) return {
|
|
26619
|
+
status: "unresolvable",
|
|
26620
|
+
violation: s
|
|
26621
|
+
};
|
|
26622
|
+
let l = o[c] ?? "", u = await kn(e, {
|
|
26623
|
+
parentRef: a,
|
|
26624
|
+
childTag: n.tagName,
|
|
26625
|
+
candidate: o,
|
|
26626
|
+
attr: c,
|
|
26627
|
+
excludeId: n.id,
|
|
26628
|
+
decorate: r
|
|
26629
|
+
});
|
|
26630
|
+
return u !== l && await e.update(n, { attributes: { [c]: u } }), {
|
|
26631
|
+
status: "resolved",
|
|
26632
|
+
attr: c,
|
|
26633
|
+
from: l,
|
|
26634
|
+
to: u
|
|
26635
|
+
};
|
|
26636
|
+
}
|
|
26637
|
+
//#endregion
|
|
26638
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-tree.ts
|
|
26639
|
+
var An = {
|
|
26111
26640
|
scope: "tree",
|
|
26112
26641
|
attributes: ["templateUuid", "originUuid"]
|
|
26113
26642
|
};
|
|
26114
|
-
async function
|
|
26115
|
-
let { sourceQuery: n, ref: i, targetParent: a, omit: o,
|
|
26643
|
+
async function z(e, t) {
|
|
26644
|
+
let { sourceQuery: n, ref: i, targetParent: a, omit: o, retagRoot: s, strip: c = An } = t, l = await n.getTree(i, { omit: o });
|
|
26116
26645
|
if (!l) return;
|
|
26117
26646
|
let u = s && l.tagName === s.from ? {
|
|
26118
26647
|
...l,
|
|
@@ -26124,64 +26653,91 @@ async function q(e, t) {
|
|
|
26124
26653
|
}), await e.deepClone(a, d);
|
|
26125
26654
|
}
|
|
26126
26655
|
//#endregion
|
|
26127
|
-
//#region src/v2019C1/extensions/
|
|
26128
|
-
async function
|
|
26129
|
-
let { sourceQuery: n,
|
|
26656
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/add-children-to.ts
|
|
26657
|
+
async function B(e, t) {
|
|
26658
|
+
let { sourceQuery: n, source: r, target: i, omit: a, strip: o } = t, s = await n.any.getRecord(r);
|
|
26659
|
+
if (!s) return [];
|
|
26660
|
+
let c = [];
|
|
26661
|
+
for (let t of s.children) {
|
|
26662
|
+
let r = await z(e, {
|
|
26663
|
+
sourceQuery: n,
|
|
26664
|
+
ref: {
|
|
26665
|
+
tagName: t.tagName,
|
|
26666
|
+
id: t.id
|
|
26667
|
+
},
|
|
26668
|
+
targetParent: i,
|
|
26669
|
+
omit: a,
|
|
26670
|
+
...o === void 0 ? {} : { strip: o }
|
|
26671
|
+
});
|
|
26672
|
+
r && c.push(...r.mappings);
|
|
26673
|
+
}
|
|
26674
|
+
return c;
|
|
26675
|
+
}
|
|
26676
|
+
//#endregion
|
|
26677
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/deep.ts
|
|
26678
|
+
async function V(e, t) {
|
|
26679
|
+
let { sourceQuery: n, ref: r, targetParent: i, withTypes: a = !0, omit: o, strip: s = !1, retagRoot: c } = t, l = await jn(e, {
|
|
26130
26680
|
sourceQuery: n,
|
|
26131
26681
|
ref: r,
|
|
26132
|
-
targetParent: i
|
|
26133
|
-
|
|
26134
|
-
|
|
26135
|
-
|
|
26136
|
-
|
|
26137
|
-
|
|
26138
|
-
|
|
26682
|
+
targetParent: i
|
|
26683
|
+
}), u, d;
|
|
26684
|
+
if (l) {
|
|
26685
|
+
d = await B(e, {
|
|
26686
|
+
sourceQuery: n,
|
|
26687
|
+
source: r,
|
|
26688
|
+
target: l,
|
|
26689
|
+
omit: o,
|
|
26690
|
+
strip: s
|
|
26691
|
+
});
|
|
26692
|
+
let t = await e.getRecord(l);
|
|
26693
|
+
if (!t) throw Error(`transplant.deep: merge target vanished: ${l.id}`);
|
|
26694
|
+
u = t;
|
|
26695
|
+
} else {
|
|
26696
|
+
let t = await z(e, {
|
|
26697
|
+
sourceQuery: n,
|
|
26698
|
+
ref: r,
|
|
26699
|
+
targetParent: i,
|
|
26700
|
+
omit: o,
|
|
26701
|
+
strip: s,
|
|
26702
|
+
retagRoot: c
|
|
26703
|
+
});
|
|
26704
|
+
if (!t) throw Error(`transplant.deep: source element not found: ${r.tagName}#${r.id}`);
|
|
26705
|
+
u = t.record, d = t.mappings;
|
|
26706
|
+
}
|
|
26707
|
+
let f = /* @__PURE__ */ new Map();
|
|
26139
26708
|
if (a) {
|
|
26140
|
-
let t = await
|
|
26141
|
-
t.length > 0 && (
|
|
26709
|
+
let t = await Mn(n, r);
|
|
26710
|
+
t.length > 0 && (f = (await At(e, {
|
|
26142
26711
|
sourceQuery: n,
|
|
26143
26712
|
records: t,
|
|
26144
|
-
cloneMappings:
|
|
26713
|
+
cloneMappings: d
|
|
26145
26714
|
})).idRemap);
|
|
26146
26715
|
}
|
|
26147
26716
|
return {
|
|
26148
|
-
record:
|
|
26149
|
-
typeIdRemap:
|
|
26150
|
-
recordMappings:
|
|
26717
|
+
record: u,
|
|
26718
|
+
typeIdRemap: f,
|
|
26719
|
+
recordMappings: d
|
|
26151
26720
|
};
|
|
26152
26721
|
}
|
|
26153
|
-
async function
|
|
26154
|
-
let {
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
attributes: { name: "TEMPLATE" }
|
|
26163
|
-
}), r = await e.ensureChild(n, {
|
|
26164
|
-
tagName: "VoltageLevel",
|
|
26165
|
-
attributes: { name: "TEMPLATE" }
|
|
26166
|
-
});
|
|
26167
|
-
return {
|
|
26168
|
-
Substation: n,
|
|
26169
|
-
VoltageLevel: r,
|
|
26170
|
-
Bay: await e.ensureChild(r, {
|
|
26171
|
-
tagName: "Bay",
|
|
26172
|
-
attributes: { name: "TEMPLATE" }
|
|
26173
|
-
})
|
|
26722
|
+
async function jn(e, t) {
|
|
26723
|
+
let { sourceQuery: n, ref: r, targetParent: i } = t;
|
|
26724
|
+
if (r.tagName !== "Private") return;
|
|
26725
|
+
let a = (await n.any.getAttributes(r)).type;
|
|
26726
|
+
if (!a) return;
|
|
26727
|
+
let o = (await e.getRecord(i))?.children.filter((e) => e.tagName === "Private") ?? [];
|
|
26728
|
+
for (let t of o) if ((await e.any.getAttributes(t)).type === a) return {
|
|
26729
|
+
tagName: "Private",
|
|
26730
|
+
id: t.id
|
|
26174
26731
|
};
|
|
26175
26732
|
}
|
|
26176
|
-
|
|
26177
|
-
|
|
26178
|
-
|
|
26179
|
-
await R.transaction.orphanUuidRefs(e), await R.transaction.resetLNode(e), await R.transaction.pruneEmptyContainers(e);
|
|
26733
|
+
async function Mn(e, t) {
|
|
26734
|
+
let { LNode: n = [] } = await e.findDescendants(t, { collect: "LNode" }), { LN: r = [] } = await e.findDescendants(t, { collect: "LN" });
|
|
26735
|
+
return [...n, ...r];
|
|
26180
26736
|
}
|
|
26181
26737
|
//#endregion
|
|
26182
|
-
//#region src/v2019C1/extensions/
|
|
26183
|
-
async function
|
|
26184
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, alreadyCloned: o } = t, s =
|
|
26738
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-referenced.ts
|
|
26739
|
+
async function Nn(e, t) {
|
|
26740
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, alreadyCloned: o } = t, s = T[i][0].attribute.uuid, { [i]: c = [] } = await n.findDescendants(r, { collect: i }), l = /* @__PURE__ */ new Set();
|
|
26185
26741
|
for (let e of c) {
|
|
26186
26742
|
let t = e.attributes.find((e) => e.name === s)?.value;
|
|
26187
26743
|
t && l.add(t);
|
|
@@ -26204,48 +26760,59 @@ async function Et(e, t) {
|
|
|
26204
26760
|
}
|
|
26205
26761
|
return u;
|
|
26206
26762
|
}
|
|
26207
|
-
async function
|
|
26208
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, resolveTargetParent: o, alreadyCloned: s, omit: c } = t, l = await
|
|
26763
|
+
async function Pn(e, t) {
|
|
26764
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, resolveTargetParent: o, alreadyCloned: s, omit: c } = t, l = await Nn(e, {
|
|
26209
26765
|
sourceQuery: n,
|
|
26210
26766
|
scopeRef: r,
|
|
26211
26767
|
refTagName: i,
|
|
26212
26768
|
targetTagName: a,
|
|
26213
26769
|
alreadyCloned: s
|
|
26214
|
-
});
|
|
26215
|
-
for (let t of l)
|
|
26216
|
-
|
|
26217
|
-
|
|
26218
|
-
|
|
26219
|
-
|
|
26220
|
-
|
|
26770
|
+
}), u = [];
|
|
26771
|
+
for (let t of l) {
|
|
26772
|
+
let r = await z(e, {
|
|
26773
|
+
sourceQuery: n,
|
|
26774
|
+
ref: t,
|
|
26775
|
+
targetParent: await o(t),
|
|
26776
|
+
omit: c
|
|
26777
|
+
});
|
|
26778
|
+
r && u.push(...r.mappings);
|
|
26779
|
+
}
|
|
26780
|
+
return u;
|
|
26221
26781
|
}
|
|
26222
|
-
async function
|
|
26223
|
-
let { sourceQuery: n, scopeTagName: r, scopeRef: i, resolveTargetParent: a, alreadyCloned: o, skip: s = /* @__PURE__ */ new Set(), omit: c } = t, l = (
|
|
26224
|
-
for (let t of l) for (let r of
|
|
26225
|
-
|
|
26226
|
-
|
|
26227
|
-
|
|
26228
|
-
|
|
26229
|
-
|
|
26230
|
-
|
|
26231
|
-
|
|
26232
|
-
|
|
26782
|
+
async function Fn(e, t) {
|
|
26783
|
+
let { sourceQuery: n, scopeTagName: r, scopeRef: i, resolveTargetParent: a, alreadyCloned: o, skip: s = /* @__PURE__ */ new Set(), omit: c } = t, l = (f[r] ?? []).filter((e) => e in T && !s.has(e)), u = Pn, d = [];
|
|
26784
|
+
for (let t of l) for (let r of T[t]) for (let s of r.target) {
|
|
26785
|
+
let r = await u(e, {
|
|
26786
|
+
sourceQuery: n,
|
|
26787
|
+
scopeRef: i,
|
|
26788
|
+
refTagName: t,
|
|
26789
|
+
targetTagName: s,
|
|
26790
|
+
resolveTargetParent: a,
|
|
26791
|
+
alreadyCloned: o,
|
|
26792
|
+
omit: c
|
|
26793
|
+
});
|
|
26794
|
+
d.push(...r);
|
|
26795
|
+
}
|
|
26796
|
+
return d;
|
|
26233
26797
|
}
|
|
26234
26798
|
//#endregion
|
|
26235
|
-
//#region src/v2019C1/extensions/
|
|
26236
|
-
async function
|
|
26799
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/resolve-structure-ref.ts
|
|
26800
|
+
async function H(e, t, n) {
|
|
26237
26801
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26238
|
-
|
|
26802
|
+
o(r, {
|
|
26239
26803
|
key: "ELEMENT_NOT_FOUND",
|
|
26240
|
-
detail: `No Substation/VoltageLevel/Bay
|
|
26804
|
+
detail: `No Substation/VoltageLevel/Bay level in the target structure for ${t.tagName}`
|
|
26241
26805
|
});
|
|
26242
26806
|
let i = n[r.tagName];
|
|
26243
|
-
return {
|
|
26807
|
+
return o(i, {
|
|
26808
|
+
key: "ELEMENT_NOT_FOUND",
|
|
26809
|
+
detail: `Target structure missing the ${r.tagName} level for ${t.tagName}`
|
|
26810
|
+
}), {
|
|
26244
26811
|
tagName: i.tagName,
|
|
26245
26812
|
id: i.id
|
|
26246
26813
|
};
|
|
26247
26814
|
}
|
|
26248
|
-
function
|
|
26815
|
+
function In(e) {
|
|
26249
26816
|
let { sourceQuery: t, structure: n, cloneIndex: r } = e;
|
|
26250
26817
|
return async function(e) {
|
|
26251
26818
|
let i = await t.findAncestors(e, { stopAtTagName: "Substation" });
|
|
@@ -26254,22 +26821,384 @@ function kt(e) {
|
|
|
26254
26821
|
if (t) return t;
|
|
26255
26822
|
if (e.tagName in n) {
|
|
26256
26823
|
let t = n[e.tagName];
|
|
26257
|
-
return {
|
|
26824
|
+
if (t) return {
|
|
26258
26825
|
tagName: t.tagName,
|
|
26259
26826
|
id: t.id
|
|
26260
26827
|
};
|
|
26261
26828
|
}
|
|
26262
26829
|
}
|
|
26263
|
-
|
|
26830
|
+
o(!1, {
|
|
26264
26831
|
key: "ELEMENT_NOT_FOUND",
|
|
26265
26832
|
detail: `No clone-mapped or structural ancestor found for ${e.tagName}`
|
|
26266
26833
|
});
|
|
26267
26834
|
};
|
|
26268
26835
|
}
|
|
26269
26836
|
//#endregion
|
|
26270
|
-
//#region src/v2019C1/extensions/
|
|
26271
|
-
|
|
26272
|
-
|
|
26837
|
+
//#region src/v2019C1/extensions/lifecycle/engine/reconcile.ts
|
|
26838
|
+
var Ln = new Set(Object.keys(T));
|
|
26839
|
+
async function U(e, t) {
|
|
26840
|
+
let { sourceQuery: n, sourceRootRef: r, instanceRootRef: i, accepted: a, overrides: o } = t, s = await n.any.getTree(r), c = await e.any.getTree(i);
|
|
26841
|
+
if (!s || !c) return;
|
|
26842
|
+
let l = /* @__PURE__ */ new Map();
|
|
26843
|
+
await Hn(e, {
|
|
26844
|
+
node: c,
|
|
26845
|
+
index: l
|
|
26846
|
+
});
|
|
26847
|
+
let u = /* @__PURE__ */ new Set();
|
|
26848
|
+
await Un(n, {
|
|
26849
|
+
node: s,
|
|
26850
|
+
out: u
|
|
26851
|
+
}), await Vn(e, {
|
|
26852
|
+
sourceQuery: n,
|
|
26853
|
+
instanceRecord: c,
|
|
26854
|
+
sourceNode: s,
|
|
26855
|
+
accepted: a,
|
|
26856
|
+
overrides: o
|
|
26857
|
+
}), await Rn(e, {
|
|
26858
|
+
sourceQuery: n,
|
|
26859
|
+
sourceNode: s,
|
|
26860
|
+
instanceParent: c,
|
|
26861
|
+
index: l,
|
|
26862
|
+
accepted: a,
|
|
26863
|
+
overrides: o
|
|
26864
|
+
}), await zn(e, {
|
|
26865
|
+
instanceNode: c,
|
|
26866
|
+
sourceUuids: u,
|
|
26867
|
+
accepted: a
|
|
26868
|
+
});
|
|
26869
|
+
}
|
|
26870
|
+
async function Rn(e, t) {
|
|
26871
|
+
let { sourceQuery: n, sourceNode: r, instanceParent: i, index: o, accepted: s, overrides: c } = t, l = /* @__PURE__ */ new Set();
|
|
26872
|
+
for (let t of r.tree) {
|
|
26873
|
+
let r = await n.any.getAttribute(t, { name: "uuid" }), u = (r ? o.get(r) : void 0) ?? (r ? void 0 : i.tree.find((e) => e.tagName === t.tagName && !l.has(e.id)));
|
|
26874
|
+
if (u) {
|
|
26875
|
+
l.add(u.id), await Vn(e, {
|
|
26876
|
+
sourceQuery: n,
|
|
26877
|
+
instanceRecord: u,
|
|
26878
|
+
sourceNode: t,
|
|
26879
|
+
accepted: s,
|
|
26880
|
+
overrides: c
|
|
26881
|
+
}), await Rn(e, {
|
|
26882
|
+
sourceQuery: n,
|
|
26883
|
+
sourceNode: t,
|
|
26884
|
+
instanceParent: u,
|
|
26885
|
+
index: o,
|
|
26886
|
+
accepted: s,
|
|
26887
|
+
overrides: c
|
|
26888
|
+
});
|
|
26889
|
+
continue;
|
|
26890
|
+
}
|
|
26891
|
+
if (s && !s.sourceIds.has(t.id)) continue;
|
|
26892
|
+
let { recordMappings: d } = await V(e, {
|
|
26893
|
+
sourceQuery: n,
|
|
26894
|
+
ref: a(t),
|
|
26895
|
+
targetParent: a(i),
|
|
26896
|
+
strip: !1
|
|
26897
|
+
});
|
|
26898
|
+
await P(e, {
|
|
26899
|
+
mappings: d,
|
|
26900
|
+
mode: "stamp-template"
|
|
26901
|
+
});
|
|
26902
|
+
let f = d.find((e) => e.source.id === t.id);
|
|
26903
|
+
f && await R(e, {
|
|
26904
|
+
ref: f.target,
|
|
26905
|
+
parentRef: a(i),
|
|
26906
|
+
overrides: c?.get(t.id)
|
|
26907
|
+
});
|
|
26908
|
+
}
|
|
26909
|
+
for (let t of i.tree) l.has(t.id) || Ln.has(t.tagName) && (await e.any.getAttribute(t, { name: "templateUuid" }) || s && !s.instanceIds.has(t.id) || await e.any.getRecord(t) && await e.any.delete(t));
|
|
26910
|
+
}
|
|
26911
|
+
async function zn(e, t) {
|
|
26912
|
+
let { instanceNode: n, sourceUuids: r, accepted: i } = t, a = [];
|
|
26913
|
+
await Bn(e, {
|
|
26914
|
+
node: n,
|
|
26915
|
+
sourceUuids: r,
|
|
26916
|
+
accepted: i,
|
|
26917
|
+
out: a
|
|
26918
|
+
});
|
|
26919
|
+
for (let t of a) await e.any.getRecord(t) && await e.any.delete(t);
|
|
26920
|
+
}
|
|
26921
|
+
async function Bn(e, t) {
|
|
26922
|
+
let { node: n, sourceUuids: r, accepted: i, out: a } = t, o = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26923
|
+
if (o && !r.has(o)) {
|
|
26924
|
+
(!i || i.instanceIds.has(n.id)) && a.push(n);
|
|
26925
|
+
return;
|
|
26926
|
+
}
|
|
26927
|
+
for (let t of n.tree) await Bn(e, {
|
|
26928
|
+
node: t,
|
|
26929
|
+
sourceUuids: r,
|
|
26930
|
+
accepted: i,
|
|
26931
|
+
out: a
|
|
26932
|
+
});
|
|
26933
|
+
}
|
|
26934
|
+
async function Vn(e, t) {
|
|
26935
|
+
let { sourceQuery: n, instanceRecord: r, sourceNode: i, accepted: a, overrides: o } = t;
|
|
26936
|
+
if (a && !a.sourceIds.has(i.id)) return;
|
|
26937
|
+
let s = {
|
|
26938
|
+
...F(await n.any.getAttributes(i)),
|
|
26939
|
+
...o?.get(i.id)
|
|
26940
|
+
}, c = F(await e.any.getAttributes(r)), l = {};
|
|
26941
|
+
for (let [e, t] of Object.entries(s)) c[e] !== t && (l[e] = t);
|
|
26942
|
+
Object.keys(l).length > 0 && await e.any.update(r, { attributes: l });
|
|
26943
|
+
}
|
|
26944
|
+
async function Hn(e, t) {
|
|
26945
|
+
let { node: n, index: r } = t, i = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26946
|
+
i && r.set(i, n);
|
|
26947
|
+
for (let t of n.tree) await Hn(e, {
|
|
26948
|
+
node: t,
|
|
26949
|
+
index: r
|
|
26950
|
+
});
|
|
26951
|
+
}
|
|
26952
|
+
async function Un(e, t) {
|
|
26953
|
+
let { node: n, out: r } = t, i = await e.any.getAttribute(n, { name: "uuid" });
|
|
26954
|
+
i && r.add(i);
|
|
26955
|
+
for (let t of n.tree) await Un(e, {
|
|
26956
|
+
node: t,
|
|
26957
|
+
out: r
|
|
26958
|
+
});
|
|
26959
|
+
}
|
|
26960
|
+
//#endregion
|
|
26961
|
+
//#region src/v2019C1/extensions/lifecycle/engine/decide.ts
|
|
26962
|
+
function Wn(e) {
|
|
26963
|
+
return e === void 0 ? "accept" : typeof e == "string" ? e : e.action;
|
|
26964
|
+
}
|
|
26965
|
+
function Gn(e) {
|
|
26966
|
+
return typeof e == "object" ? e.values : void 0;
|
|
26967
|
+
}
|
|
26968
|
+
function Kn(e) {
|
|
26969
|
+
return Wn(e.decisions.get(e.groupId)) !== "skip";
|
|
26970
|
+
}
|
|
26971
|
+
function W(e) {
|
|
26972
|
+
let { groups: t, decisions: n } = e, r = /* @__PURE__ */ new Map();
|
|
26973
|
+
for (let e of t) {
|
|
26974
|
+
let t = n.get(e.id);
|
|
26975
|
+
if (Wn(t) === "skip") continue;
|
|
26976
|
+
let i = Gn(t), a = e.primary.sourceRef?.id;
|
|
26977
|
+
i && a && r.set(a, i);
|
|
26978
|
+
}
|
|
26979
|
+
return r;
|
|
26980
|
+
}
|
|
26981
|
+
function qn(e) {
|
|
26982
|
+
let { groups: t, decisions: n } = e;
|
|
26983
|
+
for (let e of t) if (Kn({
|
|
26984
|
+
groupId: e.id,
|
|
26985
|
+
decisions: n
|
|
26986
|
+
})) for (let t of e.dependsOn) o(Kn({
|
|
26987
|
+
groupId: t,
|
|
26988
|
+
decisions: n
|
|
26989
|
+
}), { detail: `decision accepts group "${e.id}" but its dependency "${t}" is skipped` });
|
|
26990
|
+
}
|
|
26991
|
+
function G(e) {
|
|
26992
|
+
let { groups: t, decisions: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
26993
|
+
for (let e of t) if (Kn({
|
|
26994
|
+
groupId: e.id,
|
|
26995
|
+
decisions: n
|
|
26996
|
+
})) for (let t of [e.primary, ...e.companions]) Jn({
|
|
26997
|
+
node: t,
|
|
26998
|
+
sourceIds: r,
|
|
26999
|
+
instanceIds: i
|
|
27000
|
+
});
|
|
27001
|
+
return {
|
|
27002
|
+
sourceIds: r,
|
|
27003
|
+
instanceIds: i
|
|
27004
|
+
};
|
|
27005
|
+
}
|
|
27006
|
+
function Jn(e) {
|
|
27007
|
+
let { node: t, sourceIds: n, instanceIds: r } = e;
|
|
27008
|
+
t.change === "removed" ? t.instanceRef?.id && r.add(t.instanceRef.id) : t.sourceRef?.id && n.add(t.sourceRef.id);
|
|
27009
|
+
}
|
|
27010
|
+
//#endregion
|
|
27011
|
+
//#region src/v2019C1/extensions/lifecycle/instance/composed-functions.ts
|
|
27012
|
+
async function Yn(e, t) {
|
|
27013
|
+
let n = /* @__PURE__ */ new Set(), r = await e.any.getTree(t);
|
|
27014
|
+
return r && await Xn(e, r, n), n;
|
|
27015
|
+
}
|
|
27016
|
+
async function Xn(e, t, n) {
|
|
27017
|
+
if (t.tagName === "FunctionRef") {
|
|
27018
|
+
let r = await e.any.getAttribute(t, { name: "functionUuid" });
|
|
27019
|
+
r && n.add(r);
|
|
27020
|
+
}
|
|
27021
|
+
for (let r of t.tree) await Xn(e, r, n);
|
|
27022
|
+
}
|
|
27023
|
+
//#endregion
|
|
27024
|
+
//#region src/v2019C1/extensions/lifecycle/instance/find-instance.ts
|
|
27025
|
+
async function Zn(e, t) {
|
|
27026
|
+
let { targetParent: n, tagName: r, sourceUuid: i } = t;
|
|
27027
|
+
if (!i) return [];
|
|
27028
|
+
let a = await e.any.getTree(n);
|
|
27029
|
+
if (!a) return [];
|
|
27030
|
+
let o = [];
|
|
27031
|
+
return await Qn(e, {
|
|
27032
|
+
node: a,
|
|
27033
|
+
tagName: r,
|
|
27034
|
+
sourceUuid: i,
|
|
27035
|
+
out: o
|
|
27036
|
+
}), o;
|
|
27037
|
+
}
|
|
27038
|
+
async function Qn(e, t) {
|
|
27039
|
+
let { node: n, tagName: r, sourceUuid: i, out: a } = t;
|
|
27040
|
+
if (n.tagName === r && await e.any.getAttribute(n, { name: "templateUuid" }) === i) {
|
|
27041
|
+
a.push(n);
|
|
27042
|
+
return;
|
|
27043
|
+
}
|
|
27044
|
+
for (let t of n.tree) await Qn(e, {
|
|
27045
|
+
node: t,
|
|
27046
|
+
tagName: r,
|
|
27047
|
+
sourceUuid: i,
|
|
27048
|
+
out: a
|
|
27049
|
+
});
|
|
27050
|
+
}
|
|
27051
|
+
async function $n(e, t) {
|
|
27052
|
+
let [n] = await K(e, t);
|
|
27053
|
+
return n;
|
|
27054
|
+
}
|
|
27055
|
+
async function K(e, t) {
|
|
27056
|
+
let { tagName: n, sourceUuid: r } = t;
|
|
27057
|
+
if (!r) return [];
|
|
27058
|
+
let i = await e.any.getRecordsByTagName(n), a = [];
|
|
27059
|
+
for (let t of i) await e.any.getAttribute(t, { name: "templateUuid" }) === r && a.push(t);
|
|
27060
|
+
return a;
|
|
27061
|
+
}
|
|
27062
|
+
//#endregion
|
|
27063
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/satellite-reconcile.ts
|
|
27064
|
+
async function er(e, t) {
|
|
27065
|
+
let { sourceQuery: n, satelliteRefs: r, instanceSatelliteRefs: i, structure: a, accepted: o } = t;
|
|
27066
|
+
for (let t of r) {
|
|
27067
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await $n(e, {
|
|
27068
|
+
tagName: t.tagName,
|
|
27069
|
+
sourceUuid: r
|
|
27070
|
+
});
|
|
27071
|
+
if (i) {
|
|
27072
|
+
await U(e, {
|
|
27073
|
+
sourceQuery: n,
|
|
27074
|
+
sourceRootRef: t,
|
|
27075
|
+
instanceRootRef: i,
|
|
27076
|
+
accepted: o
|
|
27077
|
+
});
|
|
27078
|
+
continue;
|
|
27079
|
+
}
|
|
27080
|
+
if (o && t.id && !o.sourceIds.has(t.id)) continue;
|
|
27081
|
+
let s = await z(e, {
|
|
27082
|
+
sourceQuery: n,
|
|
27083
|
+
ref: t,
|
|
27084
|
+
targetParent: await H(n, t, a),
|
|
27085
|
+
strip: !1
|
|
27086
|
+
});
|
|
27087
|
+
s && await P(e, {
|
|
27088
|
+
mappings: s.mappings,
|
|
27089
|
+
mode: "stamp-template"
|
|
27090
|
+
});
|
|
27091
|
+
}
|
|
27092
|
+
for (let t of i ?? []) {
|
|
27093
|
+
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
27094
|
+
if (!r) continue;
|
|
27095
|
+
let [i] = await n.any.findByAttributes({
|
|
27096
|
+
tagName: t.tagName,
|
|
27097
|
+
attributes: { uuid: r }
|
|
27098
|
+
});
|
|
27099
|
+
i || o && t.id && !o.instanceIds.has(t.id) || (await O(e, { target: t })).length > 0 || await e.delete(t);
|
|
27100
|
+
}
|
|
27101
|
+
}
|
|
27102
|
+
//#endregion
|
|
27103
|
+
//#region src/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.constants.ts
|
|
27104
|
+
var tr = ["Variable", "BehaviorDescription"];
|
|
27105
|
+
//#endregion
|
|
27106
|
+
//#region src/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.ts
|
|
27107
|
+
async function q(e, t) {
|
|
27108
|
+
let { primaryRef: n } = t, r = await e.any.getTree(n);
|
|
27109
|
+
if (!r) return [];
|
|
27110
|
+
let i = /* @__PURE__ */ new Set(), o = [];
|
|
27111
|
+
nr({
|
|
27112
|
+
node: r,
|
|
27113
|
+
subtreeIds: i,
|
|
27114
|
+
targets: o
|
|
27115
|
+
});
|
|
27116
|
+
let s = /* @__PURE__ */ new Set(), c = [];
|
|
27117
|
+
for (let t of o) for (let n of tr) {
|
|
27118
|
+
let r = await k.query.findRefsPointingTo(e, {
|
|
27119
|
+
target: a(t),
|
|
27120
|
+
containerTagName: n
|
|
27121
|
+
});
|
|
27122
|
+
for (let { container: e } of r) !e || s.has(e.id) || i.has(e.id) || (s.add(e.id), c.push(a(e)));
|
|
27123
|
+
}
|
|
27124
|
+
return c;
|
|
27125
|
+
}
|
|
27126
|
+
function nr(e) {
|
|
27127
|
+
let { node: t, subtreeIds: n, targets: r } = e;
|
|
27128
|
+
n.add(t.id), t.attributes.some((e) => e.name === "uuid") && r.push(t);
|
|
27129
|
+
for (let e of t.tree) nr({
|
|
27130
|
+
node: e,
|
|
27131
|
+
subtreeIds: n,
|
|
27132
|
+
targets: r
|
|
27133
|
+
});
|
|
27134
|
+
}
|
|
27135
|
+
//#endregion
|
|
27136
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/cross-cutting-satellites.ts
|
|
27137
|
+
async function rr(e, t) {
|
|
27138
|
+
let { sourceQuery: n, primaryRef: r, instancePrimaryRef: i, structure: a, accepted: o } = t;
|
|
27139
|
+
await er(e, {
|
|
27140
|
+
sourceQuery: n,
|
|
27141
|
+
satelliteRefs: await q(n, { primaryRef: r }),
|
|
27142
|
+
instanceSatelliteRefs: i ? await q(e, { primaryRef: i }) : [],
|
|
27143
|
+
structure: a,
|
|
27144
|
+
accepted: o
|
|
27145
|
+
});
|
|
27146
|
+
}
|
|
27147
|
+
//#endregion
|
|
27148
|
+
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/resolve-target-structure.ts
|
|
27149
|
+
async function J(e, t) {
|
|
27150
|
+
let n = await e.getRecord(t);
|
|
27151
|
+
o(n, {
|
|
27152
|
+
key: "ELEMENT_NOT_FOUND",
|
|
27153
|
+
detail: `resolveTargetStructure: target parent not found: ${t.tagName}#${t.id}`
|
|
27154
|
+
});
|
|
27155
|
+
let r = [n, ...await e.findAncestors(t, { stopAtTagName: "Substation" })], i = r.find((e) => e.tagName === "Substation"), a = r.find((e) => e.tagName === "VoltageLevel"), s = r.find((e) => e.tagName === "Bay"), c = {};
|
|
27156
|
+
return i && (c.Substation = i), a && (c.VoltageLevel = a), s && (c.Bay = s), c;
|
|
27157
|
+
}
|
|
27158
|
+
//#endregion
|
|
27159
|
+
//#region src/v2019C1/extensions/lifecycle/cross-cutting/clone-applied-satellites.ts
|
|
27160
|
+
async function ir(e, t) {
|
|
27161
|
+
let { sourceQuery: n, primaryRef: r, structure: i, strip: a = !0 } = t, o = await q(n, { primaryRef: r }), s = [];
|
|
27162
|
+
for (let t of o) {
|
|
27163
|
+
let r = await ar(e, n, t);
|
|
27164
|
+
if (r) {
|
|
27165
|
+
let i = await B(e, {
|
|
27166
|
+
sourceQuery: n,
|
|
27167
|
+
source: t,
|
|
27168
|
+
target: r,
|
|
27169
|
+
strip: !1
|
|
27170
|
+
});
|
|
27171
|
+
s.push(...i);
|
|
27172
|
+
continue;
|
|
27173
|
+
}
|
|
27174
|
+
let o = await z(e, {
|
|
27175
|
+
sourceQuery: n,
|
|
27176
|
+
ref: t,
|
|
27177
|
+
targetParent: await H(n, t, i),
|
|
27178
|
+
...a ? {} : { strip: !1 }
|
|
27179
|
+
});
|
|
27180
|
+
o && s.push(...o.mappings);
|
|
27181
|
+
}
|
|
27182
|
+
return s;
|
|
27183
|
+
}
|
|
27184
|
+
async function ar(e, t, n) {
|
|
27185
|
+
let r = await t.any.getRecord(n);
|
|
27186
|
+
if (!r) return;
|
|
27187
|
+
let i = await t.any.getAttribute(r, { name: "name" });
|
|
27188
|
+
if (!i) return;
|
|
27189
|
+
let [a] = await e.any.findByAttributes({
|
|
27190
|
+
tagName: n.tagName,
|
|
27191
|
+
attributes: { name: i }
|
|
27192
|
+
});
|
|
27193
|
+
return a ? {
|
|
27194
|
+
tagName: n.tagName,
|
|
27195
|
+
id: a.id
|
|
27196
|
+
} : void 0;
|
|
27197
|
+
}
|
|
27198
|
+
//#endregion
|
|
27199
|
+
//#region src/v2019C1/extensions/lifecycle/layers/function/clone-function.ts
|
|
27200
|
+
async function or(e, t) {
|
|
27201
|
+
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t, { recordMappings: s } = await V(e, {
|
|
26273
27202
|
sourceQuery: n,
|
|
26274
27203
|
ref: r,
|
|
26275
27204
|
targetParent: i,
|
|
@@ -26278,7 +27207,7 @@ async function At(e, t) {
|
|
|
26278
27207
|
scope: "root",
|
|
26279
27208
|
attributes: [...o]
|
|
26280
27209
|
} : !1,
|
|
26281
|
-
|
|
27210
|
+
retagRoot: {
|
|
26282
27211
|
from: "SubFunction",
|
|
26283
27212
|
to: "Function"
|
|
26284
27213
|
},
|
|
@@ -26286,34 +27215,45 @@ async function At(e, t) {
|
|
|
26286
27215
|
});
|
|
26287
27216
|
return s;
|
|
26288
27217
|
}
|
|
26289
|
-
async function
|
|
26290
|
-
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await
|
|
27218
|
+
async function Y(e, t) {
|
|
27219
|
+
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await sr(n, r), s = [];
|
|
26291
27220
|
for (let t of o) {
|
|
26292
|
-
if (await Pt(e, n, t)) continue;
|
|
26293
27221
|
let r = {
|
|
26294
27222
|
tagName: "FunctionCategory",
|
|
26295
27223
|
id: t
|
|
26296
|
-
};
|
|
26297
|
-
|
|
27224
|
+
}, o = await lr(e, n, t);
|
|
27225
|
+
if (o) {
|
|
27226
|
+
let t = await B(e, {
|
|
27227
|
+
sourceQuery: n,
|
|
27228
|
+
source: r,
|
|
27229
|
+
target: o,
|
|
27230
|
+
strip: !1
|
|
27231
|
+
});
|
|
27232
|
+
s.push(...t);
|
|
27233
|
+
continue;
|
|
27234
|
+
}
|
|
27235
|
+
let c = await z(e, {
|
|
26298
27236
|
sourceQuery: n,
|
|
26299
27237
|
ref: r,
|
|
26300
|
-
targetParent: await
|
|
27238
|
+
targetParent: await H(n, r, i),
|
|
26301
27239
|
...a ? {} : { strip: !1 }
|
|
26302
27240
|
});
|
|
27241
|
+
c && s.push(...c.mappings);
|
|
26303
27242
|
}
|
|
27243
|
+
return s;
|
|
26304
27244
|
}
|
|
26305
|
-
async function
|
|
26306
|
-
let n = await
|
|
27245
|
+
async function sr(e, t) {
|
|
27246
|
+
let n = await cr(e, t), r = /* @__PURE__ */ new Set();
|
|
26307
27247
|
for (let { container: e } of n) e && r.add(e.id);
|
|
26308
27248
|
return r;
|
|
26309
27249
|
}
|
|
26310
|
-
async function
|
|
26311
|
-
let n = await
|
|
27250
|
+
async function cr(e, t) {
|
|
27251
|
+
let n = await k.query.findRefsPointingTo(e, {
|
|
26312
27252
|
target: t,
|
|
26313
27253
|
containerTagName: "FunctionCategory"
|
|
26314
27254
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
26315
27255
|
for (let t of r) {
|
|
26316
|
-
let r = await
|
|
27256
|
+
let r = await k.query.findRefsPointingTo(e, {
|
|
26317
27257
|
target: {
|
|
26318
27258
|
tagName: "SubFunction",
|
|
26319
27259
|
id: t.id
|
|
@@ -26324,146 +27264,617 @@ async function Nt(e, t) {
|
|
|
26324
27264
|
}
|
|
26325
27265
|
return n;
|
|
26326
27266
|
}
|
|
26327
|
-
async function
|
|
26328
|
-
let r = await t.getRecord({
|
|
26329
|
-
tagName: "FunctionCategory",
|
|
26330
|
-
id: n
|
|
26331
|
-
});
|
|
26332
|
-
if (!r) return
|
|
26333
|
-
let i = await t.getAttribute(r, { name: "name" });
|
|
26334
|
-
if (!i) return
|
|
26335
|
-
let [a] = await e.findByAttributes({
|
|
26336
|
-
tagName: "FunctionCategory",
|
|
26337
|
-
attributes: { name: i }
|
|
26338
|
-
});
|
|
26339
|
-
return
|
|
27267
|
+
async function lr(e, t, n) {
|
|
27268
|
+
let r = await t.getRecord({
|
|
27269
|
+
tagName: "FunctionCategory",
|
|
27270
|
+
id: n
|
|
27271
|
+
});
|
|
27272
|
+
if (!r) return;
|
|
27273
|
+
let i = await t.getAttribute(r, { name: "name" });
|
|
27274
|
+
if (!i) return;
|
|
27275
|
+
let [a] = await e.findByAttributes({
|
|
27276
|
+
tagName: "FunctionCategory",
|
|
27277
|
+
attributes: { name: i }
|
|
27278
|
+
});
|
|
27279
|
+
return a ? {
|
|
27280
|
+
tagName: "FunctionCategory",
|
|
27281
|
+
id: a.id
|
|
27282
|
+
} : void 0;
|
|
27283
|
+
}
|
|
27284
|
+
//#endregion
|
|
27285
|
+
//#region src/v2019C1/extensions/lifecycle/layers/function/satellites.constants.ts
|
|
27286
|
+
var ur = ["FunctionCategory"];
|
|
27287
|
+
//#endregion
|
|
27288
|
+
//#region src/v2019C1/extensions/lifecycle/layers/function/satellites.ts
|
|
27289
|
+
async function X(e, t) {
|
|
27290
|
+
let { primaryRef: n } = t, r = [n], { SubFunction: i = [] } = await e.findDescendants(n, { collect: "SubFunction" });
|
|
27291
|
+
for (let e of i) r.push({
|
|
27292
|
+
tagName: "SubFunction",
|
|
27293
|
+
id: e.id
|
|
27294
|
+
});
|
|
27295
|
+
let o = /* @__PURE__ */ new Set(), s = [];
|
|
27296
|
+
for (let t of r) for (let n of ur) {
|
|
27297
|
+
let r = await k.query.findRefsPointingTo(e, {
|
|
27298
|
+
target: t,
|
|
27299
|
+
containerTagName: n
|
|
27300
|
+
});
|
|
27301
|
+
for (let { container: e } of r) !e || o.has(e.id) || (o.add(e.id), s.push(a(e)));
|
|
27302
|
+
}
|
|
27303
|
+
return s;
|
|
27304
|
+
}
|
|
27305
|
+
//#endregion
|
|
27306
|
+
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.ts
|
|
27307
|
+
async function dr(e, t) {
|
|
27308
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, overrides: a } = t, { recordMappings: o } = await V(e, {
|
|
27309
|
+
sourceQuery: n,
|
|
27310
|
+
ref: r,
|
|
27311
|
+
targetParent: i,
|
|
27312
|
+
strip: !1,
|
|
27313
|
+
retagRoot: i.tagName === "Function" || i.tagName === "SubFunction" ? {
|
|
27314
|
+
from: "Function",
|
|
27315
|
+
to: "SubFunction"
|
|
27316
|
+
} : void 0
|
|
27317
|
+
}), s = await J(e, i), c = await Y(e, {
|
|
27318
|
+
sourceQuery: n,
|
|
27319
|
+
functionRef: r,
|
|
27320
|
+
structure: s,
|
|
27321
|
+
stripCategoriesUuid: !1
|
|
27322
|
+
}), l = await ir(e, {
|
|
27323
|
+
sourceQuery: n,
|
|
27324
|
+
primaryRef: r,
|
|
27325
|
+
structure: s,
|
|
27326
|
+
strip: !1
|
|
27327
|
+
});
|
|
27328
|
+
await P(e, {
|
|
27329
|
+
mappings: [
|
|
27330
|
+
...o,
|
|
27331
|
+
...c,
|
|
27332
|
+
...l
|
|
27333
|
+
],
|
|
27334
|
+
mode: "stamp-template"
|
|
27335
|
+
});
|
|
27336
|
+
let u = o.find((e) => e.source.id === r.id);
|
|
27337
|
+
if (!u) throw Error(`instantiate.fsd: cloned root not found for ${r.tagName}#${r.id}`);
|
|
27338
|
+
let d = u.target;
|
|
27339
|
+
return await R(e, {
|
|
27340
|
+
ref: d,
|
|
27341
|
+
parentRef: i,
|
|
27342
|
+
overrides: a?.get(r.id)
|
|
27343
|
+
}), await lt(e, {
|
|
27344
|
+
sourceQuery: n,
|
|
27345
|
+
targetRoot: d,
|
|
27346
|
+
fileType: "FSD"
|
|
27347
|
+
}), {
|
|
27348
|
+
functionRef: d,
|
|
27349
|
+
recordMappings: o
|
|
27350
|
+
};
|
|
27351
|
+
}
|
|
27352
|
+
//#endregion
|
|
27353
|
+
//#region src/v2019C1/extensions/lifecycle/layers/application/clone-application.ts
|
|
27354
|
+
async function fr(e, t) {
|
|
27355
|
+
let { sourceQuery: n, applicationRef: r, structure: i, omit: a } = t, o = /* @__PURE__ */ new Map(), s = [], c = await Nn(e, {
|
|
27356
|
+
sourceQuery: n,
|
|
27357
|
+
scopeRef: r,
|
|
27358
|
+
refTagName: "FunctionRef",
|
|
27359
|
+
targetTagName: "Function"
|
|
27360
|
+
});
|
|
27361
|
+
for (let t of c) {
|
|
27362
|
+
let r = await or(e, {
|
|
27363
|
+
sourceQuery: n,
|
|
27364
|
+
functionRef: t,
|
|
27365
|
+
targetParentRef: await H(n, t, i),
|
|
27366
|
+
omit: a
|
|
27367
|
+
});
|
|
27368
|
+
s.push(...r);
|
|
27369
|
+
for (let e of r) e.source.id && o.set(e.source.id, e.target);
|
|
27370
|
+
}
|
|
27371
|
+
for (let t of c) {
|
|
27372
|
+
let r = await Y(e, {
|
|
27373
|
+
sourceQuery: n,
|
|
27374
|
+
functionRef: t,
|
|
27375
|
+
structure: i,
|
|
27376
|
+
stripCategoriesUuid: !1
|
|
27377
|
+
});
|
|
27378
|
+
s.push(...r);
|
|
27379
|
+
}
|
|
27380
|
+
let l = await pr(e, {
|
|
27381
|
+
sourceQuery: n,
|
|
27382
|
+
applicationRef: r
|
|
27383
|
+
});
|
|
27384
|
+
for (let e of l) o.set(e.sourceId, e.existingRef);
|
|
27385
|
+
let u = new Set(["FunctionRef", "FunctionCategoryRef"]), d = await Fn(e, {
|
|
27386
|
+
sourceQuery: n,
|
|
27387
|
+
scopeTagName: "Application",
|
|
27388
|
+
scopeRef: r,
|
|
27389
|
+
resolveTargetParent: In({
|
|
27390
|
+
sourceQuery: n,
|
|
27391
|
+
structure: i,
|
|
27392
|
+
cloneIndex: o
|
|
27393
|
+
}),
|
|
27394
|
+
alreadyCloned: new Set(o.keys()),
|
|
27395
|
+
skip: u,
|
|
27396
|
+
omit: a
|
|
27397
|
+
});
|
|
27398
|
+
s.push(...d);
|
|
27399
|
+
let f = await z(e, {
|
|
27400
|
+
sourceQuery: n,
|
|
27401
|
+
ref: r,
|
|
27402
|
+
targetParent: await H(n, r, i),
|
|
27403
|
+
omit: a
|
|
27404
|
+
});
|
|
27405
|
+
f && s.push(...f.mappings);
|
|
27406
|
+
for (let t of l) {
|
|
27407
|
+
let n = await e.findByAttributes({
|
|
27408
|
+
tagName: "AllocationRoleRef",
|
|
27409
|
+
attributes: { allocationRoleUuid: t.sourceUuid }
|
|
27410
|
+
});
|
|
27411
|
+
for (let r of n) await e.update({
|
|
27412
|
+
tagName: "AllocationRoleRef",
|
|
27413
|
+
id: r.id
|
|
27414
|
+
}, { attributes: { allocationRoleUuid: t.existingUuid } });
|
|
27415
|
+
}
|
|
27416
|
+
return s;
|
|
27417
|
+
}
|
|
27418
|
+
async function pr(e, t) {
|
|
27419
|
+
let { sourceQuery: n, applicationRef: r } = t, { AllocationRoleRef: i = [] } = await n.findDescendants(r, { collect: "AllocationRoleRef" }), a = [], o = /* @__PURE__ */ new Set();
|
|
27420
|
+
for (let t of i) {
|
|
27421
|
+
let r = t.attributes.find((e) => e.name === "allocationRoleUuid")?.value;
|
|
27422
|
+
if (!r || o.has(r)) continue;
|
|
27423
|
+
o.add(r);
|
|
27424
|
+
let [i] = await n.findByAttributes({
|
|
27425
|
+
tagName: "AllocationRole",
|
|
27426
|
+
attributes: { uuid: r }
|
|
27427
|
+
});
|
|
27428
|
+
if (!i) continue;
|
|
27429
|
+
let s = i.attributes.find((e) => e.name === "name")?.value;
|
|
27430
|
+
if (!s) continue;
|
|
27431
|
+
let [c] = await e.findByAttributes({
|
|
27432
|
+
tagName: "AllocationRole",
|
|
27433
|
+
attributes: { name: s }
|
|
27434
|
+
});
|
|
27435
|
+
if (!c) continue;
|
|
27436
|
+
let l = c.attributes.find((e) => e.name === "uuid")?.value;
|
|
27437
|
+
if (!l) continue;
|
|
27438
|
+
let u = {
|
|
27439
|
+
tagName: "AllocationRole",
|
|
27440
|
+
id: c.id
|
|
27441
|
+
};
|
|
27442
|
+
await B(e, {
|
|
27443
|
+
sourceQuery: n,
|
|
27444
|
+
source: {
|
|
27445
|
+
tagName: "AllocationRole",
|
|
27446
|
+
id: i.id
|
|
27447
|
+
},
|
|
27448
|
+
target: u,
|
|
27449
|
+
strip: !1
|
|
27450
|
+
}), a.push({
|
|
27451
|
+
sourceId: i.id,
|
|
27452
|
+
sourceUuid: r,
|
|
27453
|
+
existingRef: u,
|
|
27454
|
+
existingUuid: l
|
|
27455
|
+
});
|
|
27456
|
+
}
|
|
27457
|
+
return a;
|
|
27458
|
+
}
|
|
27459
|
+
//#endregion
|
|
27460
|
+
//#region src/v2019C1/extensions/lifecycle/layers/application/satellites.constants.ts
|
|
27461
|
+
var mr = [{
|
|
27462
|
+
refTag: "AllocationRoleRef",
|
|
27463
|
+
uuidAttr: "allocationRoleUuid",
|
|
27464
|
+
targetTag: "AllocationRole"
|
|
27465
|
+
}];
|
|
27466
|
+
//#endregion
|
|
27467
|
+
//#region src/v2019C1/extensions/lifecycle/layers/application/satellites.ts
|
|
27468
|
+
async function Z(e, t) {
|
|
27469
|
+
let { applicationRef: n } = t, r = await e.any.getTree(n);
|
|
27470
|
+
if (!r) return [];
|
|
27471
|
+
let i = /* @__PURE__ */ new Set(), o = [];
|
|
27472
|
+
for (let t of mr) {
|
|
27473
|
+
let n = /* @__PURE__ */ new Set();
|
|
27474
|
+
await hr(e, {
|
|
27475
|
+
node: r,
|
|
27476
|
+
refTag: t.refTag,
|
|
27477
|
+
uuidAttr: t.uuidAttr,
|
|
27478
|
+
out: n
|
|
27479
|
+
});
|
|
27480
|
+
for (let r of n) {
|
|
27481
|
+
let [n] = await e.any.findByAttributes({
|
|
27482
|
+
tagName: t.targetTag,
|
|
27483
|
+
attributes: { uuid: r }
|
|
27484
|
+
});
|
|
27485
|
+
!n || i.has(n.id) || (i.add(n.id), o.push(a(n)));
|
|
27486
|
+
}
|
|
27487
|
+
}
|
|
27488
|
+
return o;
|
|
27489
|
+
}
|
|
27490
|
+
async function hr(e, t) {
|
|
27491
|
+
let { node: n, refTag: r, uuidAttr: i, out: a } = t;
|
|
27492
|
+
if (n.tagName === r) {
|
|
27493
|
+
let t = await e.any.getAttribute(n, { name: i });
|
|
27494
|
+
t && a.add(t);
|
|
27495
|
+
}
|
|
27496
|
+
for (let t of n.tree) await hr(e, {
|
|
27497
|
+
node: t,
|
|
27498
|
+
refTag: r,
|
|
27499
|
+
uuidAttr: i,
|
|
27500
|
+
out: a
|
|
27501
|
+
});
|
|
27502
|
+
}
|
|
27503
|
+
//#endregion
|
|
27504
|
+
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/asd.ts
|
|
27505
|
+
async function gr(e, t) {
|
|
27506
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, overrides: a } = t, o = await J(e, i), s = await Nn(e, {
|
|
27507
|
+
sourceQuery: n,
|
|
27508
|
+
scopeRef: r,
|
|
27509
|
+
refTagName: "FunctionRef",
|
|
27510
|
+
targetTagName: "Function"
|
|
27511
|
+
}), c = await fr(e, {
|
|
27512
|
+
sourceQuery: n,
|
|
27513
|
+
applicationRef: r,
|
|
27514
|
+
structure: o
|
|
27515
|
+
}), l = await ir(e, {
|
|
27516
|
+
sourceQuery: n,
|
|
27517
|
+
primaryRef: r,
|
|
27518
|
+
structure: o,
|
|
27519
|
+
strip: !1
|
|
27520
|
+
});
|
|
27521
|
+
await P(e, {
|
|
27522
|
+
mappings: [...c, ...l],
|
|
27523
|
+
mode: "stamp-template"
|
|
27524
|
+
});
|
|
27525
|
+
for (let t of s) {
|
|
27526
|
+
let r = c.find((e) => e.source.id === t.id);
|
|
27527
|
+
if (!r) continue;
|
|
27528
|
+
let i = await H(n, t, o);
|
|
27529
|
+
await R(e, {
|
|
27530
|
+
ref: r.target,
|
|
27531
|
+
parentRef: i,
|
|
27532
|
+
overrides: a?.get(t.id)
|
|
27533
|
+
});
|
|
27534
|
+
}
|
|
27535
|
+
let u = c.find((e) => e.source.id === r.id);
|
|
27536
|
+
if (!u) throw Error(`instantiate.asd: cloned Application not found for ${r.id}`);
|
|
27537
|
+
let d = await H(n, r, o);
|
|
27538
|
+
await R(e, {
|
|
27539
|
+
ref: u.target,
|
|
27540
|
+
parentRef: d,
|
|
27541
|
+
overrides: a?.get(r.id)
|
|
27542
|
+
}), await lt(e, {
|
|
27543
|
+
sourceQuery: n,
|
|
27544
|
+
targetRoot: u.target,
|
|
27545
|
+
fileType: "ASD"
|
|
27546
|
+
});
|
|
27547
|
+
let f = s.map((e) => c.find((t) => t.source.id === e.id)?.target).filter((e) => !!e);
|
|
27548
|
+
return {
|
|
27549
|
+
applicationRef: u.target,
|
|
27550
|
+
composedFunctionRefs: f,
|
|
27551
|
+
recordMappings: c
|
|
27552
|
+
};
|
|
27553
|
+
}
|
|
27554
|
+
//#endregion
|
|
27555
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/function-satellites.ts
|
|
27556
|
+
async function _r(e, t) {
|
|
27557
|
+
let { sourceQuery: n, functionRef: r, instanceRef: i, targetParent: a, accepted: o } = t, s = await X(n, { primaryRef: r }), c = !1;
|
|
27558
|
+
for (let t of s) {
|
|
27559
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await $n(e, {
|
|
27560
|
+
tagName: t.tagName,
|
|
27561
|
+
sourceUuid: r
|
|
27562
|
+
});
|
|
27563
|
+
if (!i) {
|
|
27564
|
+
c = !0;
|
|
27565
|
+
continue;
|
|
27566
|
+
}
|
|
27567
|
+
await U(e, {
|
|
27568
|
+
sourceQuery: n,
|
|
27569
|
+
sourceRootRef: t,
|
|
27570
|
+
instanceRootRef: i,
|
|
27571
|
+
accepted: o
|
|
27572
|
+
});
|
|
27573
|
+
}
|
|
27574
|
+
c && (!o || o.sourceIds.has(r.id)) && await P(e, {
|
|
27575
|
+
mappings: await Y(e, {
|
|
27576
|
+
sourceQuery: n,
|
|
27577
|
+
functionRef: r,
|
|
27578
|
+
structure: await J(e, a),
|
|
27579
|
+
stripCategoriesUuid: !1
|
|
27580
|
+
}),
|
|
27581
|
+
mode: "stamp-template"
|
|
27582
|
+
});
|
|
27583
|
+
let l = await X(e, { primaryRef: {
|
|
27584
|
+
tagName: "Function",
|
|
27585
|
+
id: i.id
|
|
27586
|
+
} });
|
|
27587
|
+
for (let t of l) {
|
|
27588
|
+
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
27589
|
+
if (!r) continue;
|
|
27590
|
+
let [i] = await n.any.findByAttributes({
|
|
27591
|
+
tagName: t.tagName,
|
|
27592
|
+
attributes: { uuid: r }
|
|
27593
|
+
});
|
|
27594
|
+
i || o && t.id && !o.instanceIds.has(t.id) || (await O(e, { target: t })).length > 0 || await e.delete(t);
|
|
27595
|
+
}
|
|
27596
|
+
}
|
|
27597
|
+
//#endregion
|
|
27598
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/fsd.ts
|
|
27599
|
+
async function vr(e, t) {
|
|
27600
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a, report: o, decisions: s } = t, { uuid: c } = await n.getAttributes(r), l = a === "instantiate" ? [] : await Zn(e, {
|
|
27601
|
+
targetParent: i,
|
|
27602
|
+
tagName: "Function",
|
|
27603
|
+
sourceUuid: c
|
|
27604
|
+
}), u = o?.groups ?? [];
|
|
27605
|
+
if (l.length === 0) {
|
|
27606
|
+
let t = s ? G({
|
|
27607
|
+
groups: u,
|
|
27608
|
+
decisions: s
|
|
27609
|
+
}) : void 0, a = s ? W({
|
|
27610
|
+
groups: u,
|
|
27611
|
+
decisions: s
|
|
27612
|
+
}) : void 0;
|
|
27613
|
+
if (t && !t.sourceIds.has(r.id)) return [];
|
|
27614
|
+
let { functionRef: o } = await dr(e, {
|
|
27615
|
+
sourceQuery: n,
|
|
27616
|
+
functionRef: r,
|
|
27617
|
+
targetParent: i,
|
|
27618
|
+
overrides: a
|
|
27619
|
+
});
|
|
27620
|
+
return [o];
|
|
27621
|
+
}
|
|
27622
|
+
let d = await J(e, i);
|
|
27623
|
+
for (let t of l) {
|
|
27624
|
+
let { instanceAccepted: a, instanceOverrides: o } = yr({
|
|
27625
|
+
instanceId: t.id,
|
|
27626
|
+
groups: u,
|
|
27627
|
+
decisions: s
|
|
27628
|
+
});
|
|
27629
|
+
await U(e, {
|
|
27630
|
+
sourceQuery: n,
|
|
27631
|
+
sourceRootRef: r,
|
|
27632
|
+
instanceRootRef: t,
|
|
27633
|
+
accepted: a,
|
|
27634
|
+
overrides: o
|
|
27635
|
+
}), await _r(e, {
|
|
27636
|
+
sourceQuery: n,
|
|
27637
|
+
functionRef: r,
|
|
27638
|
+
instanceRef: t,
|
|
27639
|
+
targetParent: i,
|
|
27640
|
+
accepted: a
|
|
27641
|
+
}), await rr(e, {
|
|
27642
|
+
sourceQuery: n,
|
|
27643
|
+
primaryRef: r,
|
|
27644
|
+
instancePrimaryRef: {
|
|
27645
|
+
tagName: "Function",
|
|
27646
|
+
id: t.id
|
|
27647
|
+
},
|
|
27648
|
+
structure: d,
|
|
27649
|
+
accepted: a
|
|
27650
|
+
});
|
|
27651
|
+
}
|
|
27652
|
+
return l.map((e) => ({
|
|
27653
|
+
tagName: "Function",
|
|
27654
|
+
id: e.id
|
|
27655
|
+
}));
|
|
27656
|
+
}
|
|
27657
|
+
function yr(e) {
|
|
27658
|
+
let { instanceId: t, groups: n, decisions: r } = e;
|
|
27659
|
+
if (!r) return {
|
|
27660
|
+
instanceAccepted: void 0,
|
|
27661
|
+
instanceOverrides: void 0
|
|
27662
|
+
};
|
|
27663
|
+
let i = n.filter((e) => e.instanceScopeId === t);
|
|
27664
|
+
return {
|
|
27665
|
+
instanceAccepted: G({
|
|
27666
|
+
groups: i,
|
|
27667
|
+
decisions: r
|
|
27668
|
+
}),
|
|
27669
|
+
instanceOverrides: W({
|
|
27670
|
+
groups: i,
|
|
27671
|
+
decisions: r
|
|
27672
|
+
})
|
|
27673
|
+
};
|
|
26340
27674
|
}
|
|
26341
27675
|
//#endregion
|
|
26342
|
-
//#region src/v2019C1/extensions/
|
|
26343
|
-
|
|
26344
|
-
"
|
|
26345
|
-
|
|
26346
|
-
|
|
26347
|
-
|
|
26348
|
-
|
|
26349
|
-
|
|
26350
|
-
|
|
26351
|
-
|
|
26352
|
-
|
|
26353
|
-
|
|
26354
|
-
|
|
26355
|
-
|
|
26356
|
-
|
|
26357
|
-
|
|
26358
|
-
|
|
26359
|
-
|
|
27676
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/asd.ts
|
|
27677
|
+
async function br(e, t) {
|
|
27678
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s } = t, { uuid: c } = await n.getAttributes(r), l = a === "instantiate" ? [] : await K(e, {
|
|
27679
|
+
tagName: "Application",
|
|
27680
|
+
sourceUuid: c
|
|
27681
|
+
}), u = o?.groups ?? [];
|
|
27682
|
+
if (l.length === 0) {
|
|
27683
|
+
let t = s ? G({
|
|
27684
|
+
groups: u,
|
|
27685
|
+
decisions: s
|
|
27686
|
+
}) : void 0, a = s ? W({
|
|
27687
|
+
groups: u,
|
|
27688
|
+
decisions: s
|
|
27689
|
+
}) : void 0;
|
|
27690
|
+
if (t && !t.sourceIds.has(r.id)) return {
|
|
27691
|
+
applications: [],
|
|
27692
|
+
functions: []
|
|
27693
|
+
};
|
|
27694
|
+
let { applicationRef: o, composedFunctionRefs: c } = await gr(e, {
|
|
26360
27695
|
sourceQuery: n,
|
|
26361
|
-
|
|
26362
|
-
|
|
26363
|
-
|
|
27696
|
+
applicationRef: r,
|
|
27697
|
+
targetParent: i,
|
|
27698
|
+
overrides: a
|
|
26364
27699
|
});
|
|
26365
|
-
|
|
27700
|
+
return {
|
|
27701
|
+
applications: [o],
|
|
27702
|
+
functions: c
|
|
27703
|
+
};
|
|
26366
27704
|
}
|
|
26367
|
-
|
|
26368
|
-
|
|
26369
|
-
|
|
26370
|
-
|
|
26371
|
-
|
|
26372
|
-
|
|
26373
|
-
|
|
26374
|
-
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
|
|
26378
|
-
|
|
27705
|
+
let d = await J(e, i), f = await Z(n, { applicationRef: r });
|
|
27706
|
+
for (let t of l) {
|
|
27707
|
+
let i = u.filter((e) => e.instanceScopeId === t.id), a = s ? G({
|
|
27708
|
+
groups: i,
|
|
27709
|
+
decisions: s
|
|
27710
|
+
}) : void 0, o = s ? W({
|
|
27711
|
+
groups: i,
|
|
27712
|
+
decisions: s
|
|
27713
|
+
}) : void 0, c = await Z(e, { applicationRef: {
|
|
27714
|
+
tagName: "Application",
|
|
27715
|
+
id: t.id
|
|
27716
|
+
} });
|
|
27717
|
+
await U(e, {
|
|
26379
27718
|
sourceQuery: n,
|
|
26380
|
-
|
|
26381
|
-
|
|
26382
|
-
|
|
26383
|
-
|
|
26384
|
-
|
|
26385
|
-
|
|
26386
|
-
|
|
27719
|
+
sourceRootRef: r,
|
|
27720
|
+
instanceRootRef: t,
|
|
27721
|
+
accepted: a,
|
|
27722
|
+
overrides: o
|
|
27723
|
+
}), await er(e, {
|
|
27724
|
+
sourceQuery: n,
|
|
27725
|
+
satelliteRefs: f,
|
|
27726
|
+
instanceSatelliteRefs: c,
|
|
27727
|
+
structure: d,
|
|
27728
|
+
accepted: a
|
|
27729
|
+
}), await rr(e, {
|
|
27730
|
+
sourceQuery: n,
|
|
27731
|
+
primaryRef: r,
|
|
27732
|
+
instancePrimaryRef: {
|
|
27733
|
+
tagName: "Application",
|
|
27734
|
+
id: t.id
|
|
27735
|
+
},
|
|
27736
|
+
structure: d,
|
|
27737
|
+
accepted: a
|
|
27738
|
+
});
|
|
27739
|
+
}
|
|
27740
|
+
let p = await xr(e, {
|
|
26387
27741
|
sourceQuery: n,
|
|
26388
|
-
|
|
26389
|
-
targetParent:
|
|
26390
|
-
|
|
27742
|
+
applicationRef: r,
|
|
27743
|
+
targetParent: i,
|
|
27744
|
+
scenario: a,
|
|
27745
|
+
report: o,
|
|
27746
|
+
decisions: s
|
|
26391
27747
|
});
|
|
27748
|
+
return {
|
|
27749
|
+
applications: l.map((e) => ({
|
|
27750
|
+
tagName: "Application",
|
|
27751
|
+
id: e.id
|
|
27752
|
+
})),
|
|
27753
|
+
functions: p
|
|
27754
|
+
};
|
|
26392
27755
|
}
|
|
26393
|
-
|
|
26394
|
-
|
|
26395
|
-
|
|
26396
|
-
let
|
|
26397
|
-
|
|
26398
|
-
|
|
26399
|
-
|
|
26400
|
-
|
|
27756
|
+
async function xr(e, t) {
|
|
27757
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s } = t, c = await Yn(n, r);
|
|
27758
|
+
if (c.size === 0) return [];
|
|
27759
|
+
let l = await J(e, i), u = [];
|
|
27760
|
+
for (let t of c) {
|
|
27761
|
+
let [r] = await n.any.findByAttributes({
|
|
27762
|
+
tagName: "Function",
|
|
27763
|
+
attributes: { uuid: t }
|
|
27764
|
+
});
|
|
27765
|
+
if (!r) continue;
|
|
27766
|
+
let i = {
|
|
27767
|
+
tagName: "Function",
|
|
27768
|
+
id: r.id
|
|
27769
|
+
}, c = await vr(e, {
|
|
27770
|
+
sourceQuery: n,
|
|
27771
|
+
functionRef: i,
|
|
27772
|
+
targetParent: await H(n, i, l),
|
|
27773
|
+
scenario: a,
|
|
27774
|
+
report: o,
|
|
27775
|
+
decisions: s
|
|
27776
|
+
});
|
|
27777
|
+
u.push(...c);
|
|
26401
27778
|
}
|
|
26402
|
-
return
|
|
26403
|
-
let n = r(e, "version") - r(t, "version");
|
|
26404
|
-
return n === 0 ? r(e, "revision") - r(t, "revision") : n;
|
|
26405
|
-
});
|
|
27779
|
+
return u;
|
|
26406
27780
|
}
|
|
26407
27781
|
//#endregion
|
|
26408
|
-
//#region src/v2019C1/extensions/
|
|
26409
|
-
|
|
26410
|
-
|
|
27782
|
+
//#region src/v2019C1/extensions/lifecycle/update/index.ts
|
|
27783
|
+
var Sr = /* @__PURE__ */ c({
|
|
27784
|
+
asd: () => br,
|
|
27785
|
+
fsd: () => vr
|
|
27786
|
+
});
|
|
27787
|
+
//#endregion
|
|
27788
|
+
//#region src/v2019C1/extensions/lifecycle/apply/apply.ts
|
|
27789
|
+
async function Cr(e, t) {
|
|
27790
|
+
let { report: n, decisions: r } = t;
|
|
27791
|
+
return r ? (qn({
|
|
27792
|
+
groups: n.groups,
|
|
27793
|
+
decisions: r
|
|
27794
|
+
}), {
|
|
27795
|
+
report: n,
|
|
27796
|
+
instances: await Tr(e, t, n, r)
|
|
27797
|
+
}) : n.needsDecisions ? {
|
|
27798
|
+
report: n,
|
|
27799
|
+
instances: wr(t.verb)
|
|
27800
|
+
} : {
|
|
27801
|
+
report: n,
|
|
27802
|
+
instances: await Tr(e, t, n, void 0)
|
|
27803
|
+
};
|
|
27804
|
+
}
|
|
27805
|
+
function wr(e) {
|
|
27806
|
+
return e === "fsd" ? {
|
|
27807
|
+
verb: "fsd",
|
|
27808
|
+
functions: []
|
|
27809
|
+
} : {
|
|
27810
|
+
verb: "asd",
|
|
27811
|
+
applications: [],
|
|
27812
|
+
functions: []
|
|
27813
|
+
};
|
|
27814
|
+
}
|
|
27815
|
+
async function Tr(e, t, n, r) {
|
|
27816
|
+
if (t.verb === "fsd") return {
|
|
27817
|
+
verb: "fsd",
|
|
27818
|
+
functions: await vr(e, {
|
|
27819
|
+
sourceQuery: t.sourceQuery,
|
|
27820
|
+
functionRef: t.ref,
|
|
27821
|
+
targetParent: t.anchor,
|
|
27822
|
+
scenario: t.scenario,
|
|
27823
|
+
report: n,
|
|
27824
|
+
decisions: r
|
|
27825
|
+
})
|
|
27826
|
+
};
|
|
27827
|
+
let { applications: i, functions: a } = await br(e, {
|
|
27828
|
+
sourceQuery: t.sourceQuery,
|
|
27829
|
+
applicationRef: t.ref,
|
|
27830
|
+
targetParent: t.anchor,
|
|
27831
|
+
scenario: t.scenario,
|
|
27832
|
+
report: n,
|
|
27833
|
+
decisions: r
|
|
27834
|
+
});
|
|
27835
|
+
return {
|
|
27836
|
+
verb: "asd",
|
|
27837
|
+
applications: i,
|
|
27838
|
+
functions: a
|
|
27839
|
+
};
|
|
26411
27840
|
}
|
|
26412
27841
|
//#endregion
|
|
26413
|
-
//#region src/v2019C1/extensions/
|
|
26414
|
-
|
|
26415
|
-
|
|
26416
|
-
|
|
26417
|
-
}
|
|
27842
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/ensure-substation-structure.ts
|
|
27843
|
+
async function Er(e) {
|
|
27844
|
+
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
27845
|
+
tagName: "Substation",
|
|
27846
|
+
attributes: { name: "TEMPLATE" }
|
|
27847
|
+
}), r = await e.ensureChild(n, {
|
|
27848
|
+
tagName: "VoltageLevel",
|
|
27849
|
+
attributes: { name: "TEMPLATE" }
|
|
27850
|
+
});
|
|
27851
|
+
return {
|
|
27852
|
+
Substation: n,
|
|
27853
|
+
VoltageLevel: r,
|
|
27854
|
+
Bay: await e.ensureChild(r, {
|
|
27855
|
+
tagName: "Bay",
|
|
27856
|
+
attributes: { name: "TEMPLATE" }
|
|
27857
|
+
})
|
|
27858
|
+
};
|
|
27859
|
+
}
|
|
26418
27860
|
//#endregion
|
|
26419
|
-
//#region src/v2019C1/extensions/
|
|
26420
|
-
async function
|
|
26421
|
-
|
|
26422
|
-
tagName: "Header",
|
|
26423
|
-
attributes: {
|
|
26424
|
-
id: a ?? n.replace(/\.[^.]+$/, "").toLowerCase().replace(/\s+/g, "_"),
|
|
26425
|
-
toolID: l,
|
|
26426
|
-
fileType: o,
|
|
26427
|
-
...s ? { nameStructure: s } : {},
|
|
26428
|
-
version: "0",
|
|
26429
|
-
revision: "1",
|
|
26430
|
-
uuid: crypto.randomUUID()
|
|
26431
|
-
}
|
|
26432
|
-
}), h = await e.getRecord({ tagName: "History" }) ?? await e.addChild(m, {
|
|
26433
|
-
tagName: "History",
|
|
26434
|
-
attributes: {}
|
|
26435
|
-
}), g = await Lt(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";
|
|
26436
|
-
await e.update(m, { attributes: {
|
|
26437
|
-
version: y,
|
|
26438
|
-
revision: b
|
|
26439
|
-
} });
|
|
26440
|
-
let x = /* @__PURE__ */ new Date(), S = x.toString().split(" "), ee = x.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), C = `${S[0]} ${S[1]} ${S[2]} ${S[4]} ${ee} ${S[3]}`;
|
|
26441
|
-
await e.addChild(h, {
|
|
26442
|
-
tagName: "Hitem",
|
|
26443
|
-
attributes: {
|
|
26444
|
-
version: y,
|
|
26445
|
-
revision: b,
|
|
26446
|
-
when: C,
|
|
26447
|
-
who: u,
|
|
26448
|
-
what: d,
|
|
26449
|
-
why: f
|
|
26450
|
-
}
|
|
26451
|
-
}), await e.update(m, { attributes: {
|
|
26452
|
-
version: y,
|
|
26453
|
-
revision: b
|
|
26454
|
-
} });
|
|
27861
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/post-extraction-cleanup.ts
|
|
27862
|
+
async function Dr(e) {
|
|
27863
|
+
await A.transaction.orphanUuidRefs(e), await A.transaction.resetLNode(e), await A.transaction.pruneEmptyContainers(e);
|
|
26455
27864
|
}
|
|
26456
27865
|
//#endregion
|
|
26457
|
-
//#region src/v2019C1/extensions/
|
|
26458
|
-
var
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
|
|
27866
|
+
//#region src/v2019C1/extensions/lifecycle/layers/omit-filters.ts
|
|
27867
|
+
var Or = [
|
|
27868
|
+
"FunctionSclRef",
|
|
27869
|
+
"ApplicationSclRef",
|
|
27870
|
+
"GeneralEquipment",
|
|
27871
|
+
"ConductingEquipment"
|
|
27872
|
+
];
|
|
26462
27873
|
//#endregion
|
|
26463
|
-
//#region src/v2019C1/extensions/
|
|
26464
|
-
async function
|
|
26465
|
-
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
26466
|
-
await
|
|
27874
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/asd.ts
|
|
27875
|
+
async function kr(e, t) {
|
|
27876
|
+
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await Er(e), c = await e.getAttribute(r, { name: "name" }) || "Unnamed Application";
|
|
27877
|
+
await qt.transaction.addEntry(e, {
|
|
26467
27878
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
26468
27879
|
header: {
|
|
26469
27880
|
fileType: "ASD",
|
|
@@ -26476,16 +27887,17 @@ async function Bt(e, t) {
|
|
|
26476
27887
|
what: "ASD initialization",
|
|
26477
27888
|
why: "Application was extracted from a previous file"
|
|
26478
27889
|
}
|
|
26479
|
-
}), await
|
|
27890
|
+
}), await fr(e, {
|
|
26480
27891
|
sourceQuery: n,
|
|
26481
27892
|
applicationRef: r,
|
|
26482
|
-
structure: s
|
|
26483
|
-
|
|
27893
|
+
structure: s,
|
|
27894
|
+
omit: Or
|
|
27895
|
+
}), await Dr(e);
|
|
26484
27896
|
}
|
|
26485
27897
|
//#endregion
|
|
26486
|
-
//#region src/v2019C1/extensions/
|
|
26487
|
-
var
|
|
26488
|
-
...
|
|
27898
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/omit.ts
|
|
27899
|
+
var Ar = [
|
|
27900
|
+
...Or,
|
|
26489
27901
|
"DOS",
|
|
26490
27902
|
"Labels",
|
|
26491
27903
|
"LNodeInputs",
|
|
@@ -26496,13 +27908,13 @@ var Vt = [
|
|
|
26496
27908
|
"Variable"
|
|
26497
27909
|
];
|
|
26498
27910
|
//#endregion
|
|
26499
|
-
//#region src/v2019C1/extensions/
|
|
26500
|
-
async function
|
|
26501
|
-
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
27911
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/fsd.ts
|
|
27912
|
+
async function jr(e, t) {
|
|
27913
|
+
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await Er(e), c = {
|
|
26502
27914
|
tagName: s.Substation.tagName,
|
|
26503
27915
|
id: s.Substation.id
|
|
26504
27916
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
26505
|
-
await
|
|
27917
|
+
await qt.transaction.addEntry(e, {
|
|
26506
27918
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
26507
27919
|
header: {
|
|
26508
27920
|
fileType: "FSD",
|
|
@@ -26515,26 +27927,166 @@ async function Ht(e, t) {
|
|
|
26515
27927
|
what: "FSD initialization",
|
|
26516
27928
|
why: "Function was extracted from a previous file"
|
|
26517
27929
|
}
|
|
26518
|
-
}), await
|
|
27930
|
+
}), await or(e, {
|
|
26519
27931
|
sourceQuery: n,
|
|
26520
27932
|
functionRef: r,
|
|
26521
27933
|
targetParentRef: c,
|
|
26522
|
-
omit:
|
|
27934
|
+
omit: Ar,
|
|
26523
27935
|
stripRootAttributes: ["templateUuid"]
|
|
26524
|
-
}), await
|
|
27936
|
+
}), await Y(e, {
|
|
26525
27937
|
sourceQuery: n,
|
|
26526
27938
|
functionRef: r,
|
|
26527
27939
|
structure: s
|
|
26528
|
-
}), await
|
|
27940
|
+
}), await Dr(e);
|
|
27941
|
+
}
|
|
27942
|
+
//#endregion
|
|
27943
|
+
//#region src/v2019C1/extensions/lifecycle/extract/index.ts
|
|
27944
|
+
var Mr = /* @__PURE__ */ c({
|
|
27945
|
+
asd: () => kr,
|
|
27946
|
+
ensureSubstationTemplateStructure: () => Er,
|
|
27947
|
+
fsd: () => jr
|
|
27948
|
+
}), Nr = /* @__PURE__ */ c({
|
|
27949
|
+
asd: () => gr,
|
|
27950
|
+
fsd: () => dr,
|
|
27951
|
+
resolveTargetStructure: () => J
|
|
27952
|
+
});
|
|
27953
|
+
//#endregion
|
|
27954
|
+
//#region src/v2019C1/extensions/lifecycle/report/mark-placement-conflicts.ts
|
|
27955
|
+
async function Pr(e, t, n) {
|
|
27956
|
+
if (t.scenario === "instantiate") for (let r of n.groups) {
|
|
27957
|
+
if (r.change !== "added") continue;
|
|
27958
|
+
let i = r.primary.sourceRef;
|
|
27959
|
+
if (!i) continue;
|
|
27960
|
+
let a = await t.sourceQuery.getAttributes(i), o = a.uuid;
|
|
27961
|
+
if (!o) continue;
|
|
27962
|
+
let s = r.primary.tagName, [c] = await K(e, {
|
|
27963
|
+
tagName: s,
|
|
27964
|
+
sourceUuid: o
|
|
27965
|
+
});
|
|
27966
|
+
if (!c) continue;
|
|
27967
|
+
let l = await e.findAncestors({
|
|
27968
|
+
tagName: c.tagName,
|
|
27969
|
+
id: c.id
|
|
27970
|
+
}), u, d = null;
|
|
27971
|
+
for (let t of l) {
|
|
27972
|
+
let n = {
|
|
27973
|
+
tagName: t.tagName,
|
|
27974
|
+
id: t.id
|
|
27975
|
+
}, r = await L(e, {
|
|
27976
|
+
parentRef: n,
|
|
27977
|
+
childTag: s,
|
|
27978
|
+
candidate: a
|
|
27979
|
+
});
|
|
27980
|
+
if (r) {
|
|
27981
|
+
u = n, d = r;
|
|
27982
|
+
break;
|
|
27983
|
+
}
|
|
27984
|
+
}
|
|
27985
|
+
if (!d || !u) continue;
|
|
27986
|
+
let f = d.fields.find((e) => bn(I(s, e)));
|
|
27987
|
+
if (f) {
|
|
27988
|
+
let t = await kn(e, {
|
|
27989
|
+
parentRef: u,
|
|
27990
|
+
childTag: s,
|
|
27991
|
+
candidate: a,
|
|
27992
|
+
attr: f
|
|
27993
|
+
}), n = r.editableAttributes?.find((e) => e.attr === f);
|
|
27994
|
+
n && (n.conflict = !0, n.suggestedValue = t);
|
|
27995
|
+
} else r.conflict = {
|
|
27996
|
+
fields: d.fields,
|
|
27997
|
+
adoptTargetId: d.offendingId
|
|
27998
|
+
}, n.needsDecisions = !0;
|
|
27999
|
+
}
|
|
28000
|
+
}
|
|
28001
|
+
//#endregion
|
|
28002
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/satellite-companions.ts
|
|
28003
|
+
async function Fr(e, t) {
|
|
28004
|
+
let { sourceQuery: n, primaryRef: r, satelliteRefs: i, instanceSatelliteRefs: a, report: o } = t, s = o.groups.find((e) => e.primary.sourceRef?.id === r.id);
|
|
28005
|
+
if (!s) return o;
|
|
28006
|
+
for (let t of i) {
|
|
28007
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await sn({
|
|
28008
|
+
sourceQuery: n,
|
|
28009
|
+
targetQuery: e,
|
|
28010
|
+
sourceRootRef: t,
|
|
28011
|
+
instanceRootRef: await $n(e, {
|
|
28012
|
+
tagName: t.tagName,
|
|
28013
|
+
sourceUuid: r
|
|
28014
|
+
})
|
|
28015
|
+
});
|
|
28016
|
+
i.root.change !== "unchanged" && s.companions.push(i.root);
|
|
28017
|
+
}
|
|
28018
|
+
for (let t of a ?? []) {
|
|
28019
|
+
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
28020
|
+
if (!r) continue;
|
|
28021
|
+
let [i] = await n.any.findByAttributes({
|
|
28022
|
+
tagName: t.tagName,
|
|
28023
|
+
attributes: { uuid: r }
|
|
28024
|
+
});
|
|
28025
|
+
i || s.companions.push({
|
|
28026
|
+
change: "removed",
|
|
28027
|
+
tagName: t.tagName,
|
|
28028
|
+
instanceRef: t,
|
|
28029
|
+
children: []
|
|
28030
|
+
});
|
|
28031
|
+
}
|
|
28032
|
+
return o;
|
|
28033
|
+
}
|
|
28034
|
+
//#endregion
|
|
28035
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/cross-cutting-satellites.ts
|
|
28036
|
+
async function Ir(e, t) {
|
|
28037
|
+
let { sourceQuery: n, primaryRef: r, instancePrimaryRef: i, report: a } = t;
|
|
28038
|
+
return Fr(e, {
|
|
28039
|
+
sourceQuery: n,
|
|
28040
|
+
primaryRef: r,
|
|
28041
|
+
satelliteRefs: await q(n, { primaryRef: r }),
|
|
28042
|
+
instanceSatelliteRefs: i ? await q(e, { primaryRef: i }) : [],
|
|
28043
|
+
report: a
|
|
28044
|
+
});
|
|
28045
|
+
}
|
|
28046
|
+
//#endregion
|
|
28047
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-function-satellites.ts
|
|
28048
|
+
async function Lr(e, t) {
|
|
28049
|
+
let { sourceQuery: n, functionRef: r, instance: i, report: a } = t;
|
|
28050
|
+
return Fr(e, {
|
|
28051
|
+
sourceQuery: n,
|
|
28052
|
+
primaryRef: r,
|
|
28053
|
+
satelliteRefs: await X(n, { primaryRef: r }),
|
|
28054
|
+
instanceSatelliteRefs: i ? await X(e, { primaryRef: {
|
|
28055
|
+
tagName: "Function",
|
|
28056
|
+
id: i.id
|
|
28057
|
+
} }) : [],
|
|
28058
|
+
report: a
|
|
28059
|
+
});
|
|
28060
|
+
}
|
|
28061
|
+
//#endregion
|
|
28062
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-function.ts
|
|
28063
|
+
async function Q(e, t) {
|
|
28064
|
+
let { sourceQuery: n, functionRef: r, instance: i } = t, a = await sn({
|
|
28065
|
+
sourceQuery: n,
|
|
28066
|
+
targetQuery: e,
|
|
28067
|
+
sourceRootRef: r,
|
|
28068
|
+
instanceRootRef: i
|
|
28069
|
+
});
|
|
28070
|
+
if (!i) return a;
|
|
28071
|
+
let o = await Lr(e, {
|
|
28072
|
+
sourceQuery: n,
|
|
28073
|
+
functionRef: r,
|
|
28074
|
+
instance: i,
|
|
28075
|
+
report: a
|
|
28076
|
+
});
|
|
28077
|
+
return Ir(e, {
|
|
28078
|
+
sourceQuery: n,
|
|
28079
|
+
primaryRef: r,
|
|
28080
|
+
instancePrimaryRef: {
|
|
28081
|
+
tagName: "Function",
|
|
28082
|
+
id: i.id
|
|
28083
|
+
},
|
|
28084
|
+
report: o
|
|
28085
|
+
});
|
|
26529
28086
|
}
|
|
26530
28087
|
//#endregion
|
|
26531
|
-
//#region src/v2019C1/extensions/
|
|
26532
|
-
var
|
|
26533
|
-
deep: () => Ct,
|
|
26534
|
-
ensureSubstationTemplateStructure: () => J,
|
|
26535
|
-
toAsd: () => Bt,
|
|
26536
|
-
toFsd: () => Ht
|
|
26537
|
-
}) }, Wt = {
|
|
28088
|
+
//#region src/v2019C1/extensions/presentation/constants/title.ts
|
|
28089
|
+
var Rr = {
|
|
26538
28090
|
LNode: {
|
|
26539
28091
|
compact: [
|
|
26540
28092
|
"prefix",
|
|
@@ -26595,9 +28147,10 @@ var Ut = { transaction: /* @__PURE__ */ s({
|
|
|
26595
28147
|
FunctionCategoryRef: { compact: ["functionCategory"] },
|
|
26596
28148
|
LNodeInputRef: { compact: ["sourceRef"] },
|
|
26597
28149
|
LNodeOutputRef: { compact: ["controlRef"] },
|
|
26598
|
-
|
|
28150
|
+
ApplicationSclRef: {
|
|
26599
28151
|
compact: "{fileType} v{version}.{revision}",
|
|
26600
|
-
full: "{fileUuid}/{fileType} v{version}.{revision}"
|
|
28152
|
+
full: "{fileUuid}/{fileType} v{version}.{revision}",
|
|
28153
|
+
attributesFrom: "SclFileReference"
|
|
26601
28154
|
},
|
|
26602
28155
|
LNodeSpecNaming: { compact: "{sIedName}/{sLdInst}/{sPrefix}{sLnClass}{sLnInst}" },
|
|
26603
28156
|
SubscriberLNode: {
|
|
@@ -26621,38 +28174,44 @@ var Ut = { transaction: /* @__PURE__ */ s({
|
|
|
26621
28174
|
};
|
|
26622
28175
|
//#endregion
|
|
26623
28176
|
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26624
|
-
async function
|
|
28177
|
+
async function $(e, t, n = {}) {
|
|
26625
28178
|
let r = await e.getRecord(t);
|
|
26626
28179
|
if (!r) return n.withLabels ? {
|
|
26627
28180
|
title: "",
|
|
26628
28181
|
labels: {}
|
|
26629
28182
|
} : "";
|
|
26630
|
-
let i = r.tagName, a =
|
|
28183
|
+
let i = r.tagName, a = n.mode ?? "compact", o = await e.any.getAttributes(r), s = Rr[i], c = zr({
|
|
26631
28184
|
tag: i,
|
|
26632
|
-
|
|
26633
|
-
|
|
28185
|
+
spec: s,
|
|
28186
|
+
mode: a,
|
|
28187
|
+
attributes: o,
|
|
28188
|
+
specAttributes: s?.attributesFrom ? await Br(e, r, s.attributesFrom) : o,
|
|
26634
28189
|
value: r.value
|
|
26635
28190
|
});
|
|
26636
28191
|
return n.withLabels ? {
|
|
26637
|
-
title:
|
|
26638
|
-
labels: await
|
|
26639
|
-
} :
|
|
28192
|
+
title: c,
|
|
28193
|
+
labels: await Vr(e, r)
|
|
28194
|
+
} : c;
|
|
26640
28195
|
}
|
|
26641
|
-
function
|
|
26642
|
-
let { tag: t,
|
|
26643
|
-
if (
|
|
26644
|
-
let e =
|
|
28196
|
+
function zr(e) {
|
|
28197
|
+
let { tag: t, spec: n, mode: r, attributes: i, specAttributes: a, value: o } = e;
|
|
28198
|
+
if (n) {
|
|
28199
|
+
let e = Wr(n, a, r);
|
|
26645
28200
|
if (e) return e;
|
|
26646
28201
|
}
|
|
26647
|
-
let
|
|
26648
|
-
if (
|
|
26649
|
-
let
|
|
26650
|
-
return
|
|
28202
|
+
let s = (o ?? "").trim();
|
|
28203
|
+
if (s) return s;
|
|
28204
|
+
let c = g[t]?.attributes?.identityFields, l = c?.find((e) => e === "name" || e === "id") ?? c?.[0];
|
|
28205
|
+
return l && i[l] ? i[l] : i.name || t;
|
|
26651
28206
|
}
|
|
26652
|
-
async function
|
|
26653
|
-
|
|
28207
|
+
async function Br(e, t, n) {
|
|
28208
|
+
let [r] = await e.any.getChildren(t, n);
|
|
28209
|
+
return r ? e.any.getAttributes(r) : {};
|
|
26654
28210
|
}
|
|
26655
|
-
async function
|
|
28211
|
+
async function Vr(e, t) {
|
|
28212
|
+
return Ur(await Hr(e, t));
|
|
28213
|
+
}
|
|
28214
|
+
async function Hr(e, t) {
|
|
26656
28215
|
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26657
28216
|
for (let t of r) {
|
|
26658
28217
|
let r = await e.any.getChildren(t, "Label");
|
|
@@ -26667,70 +28226,228 @@ async function Jt(e, t) {
|
|
|
26667
28226
|
}
|
|
26668
28227
|
return n;
|
|
26669
28228
|
}
|
|
26670
|
-
function
|
|
28229
|
+
function Ur(e) {
|
|
26671
28230
|
let t = {};
|
|
26672
28231
|
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26673
28232
|
return t;
|
|
26674
28233
|
}
|
|
26675
|
-
function
|
|
28234
|
+
function Wr(e, t, n) {
|
|
26676
28235
|
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26677
|
-
if (typeof i == "string") return
|
|
28236
|
+
if (typeof i == "string") return Gr(i, t);
|
|
26678
28237
|
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26679
28238
|
return o.length > 0 ? o.join(a) : "";
|
|
26680
28239
|
}
|
|
26681
|
-
function
|
|
28240
|
+
function Gr(e, t) {
|
|
26682
28241
|
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("/");
|
|
26683
28242
|
}
|
|
26684
28243
|
//#endregion
|
|
28244
|
+
//#region src/v2019C1/extensions/presentation/query/index.ts
|
|
28245
|
+
var Kr = /* @__PURE__ */ c({ extractElementTitle: () => $ });
|
|
28246
|
+
//#endregion
|
|
28247
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-asd.ts
|
|
28248
|
+
async function qr(e, t) {
|
|
28249
|
+
let { sourceQuery: n, applicationRef: r, scenario: i } = t, { uuid: a } = await n.getAttributes(r), o = i === "instantiate" ? [] : await K(e, {
|
|
28250
|
+
tagName: "Application",
|
|
28251
|
+
sourceUuid: a
|
|
28252
|
+
}), s = [];
|
|
28253
|
+
if (o.length === 0) s.push(await Jr(e, {
|
|
28254
|
+
sourceQuery: n,
|
|
28255
|
+
applicationRef: r,
|
|
28256
|
+
instance: void 0
|
|
28257
|
+
}));
|
|
28258
|
+
else for (let t of o) s.push(await Jr(e, {
|
|
28259
|
+
sourceQuery: n,
|
|
28260
|
+
applicationRef: r,
|
|
28261
|
+
instance: t
|
|
28262
|
+
}));
|
|
28263
|
+
let c = await Yr(e, {
|
|
28264
|
+
sourceQuery: n,
|
|
28265
|
+
applicationRef: r,
|
|
28266
|
+
scenario: i
|
|
28267
|
+
});
|
|
28268
|
+
return mn([...s, ...c]);
|
|
28269
|
+
}
|
|
28270
|
+
async function Jr(e, t) {
|
|
28271
|
+
let { sourceQuery: n, applicationRef: r, instance: i } = t, a = await sn({
|
|
28272
|
+
sourceQuery: n,
|
|
28273
|
+
targetQuery: e,
|
|
28274
|
+
sourceRootRef: r,
|
|
28275
|
+
instanceRootRef: i
|
|
28276
|
+
});
|
|
28277
|
+
if (await Fr(e, {
|
|
28278
|
+
sourceQuery: n,
|
|
28279
|
+
primaryRef: r,
|
|
28280
|
+
satelliteRefs: await Z(n, { applicationRef: r }),
|
|
28281
|
+
instanceSatelliteRefs: i ? await Z(e, { applicationRef: {
|
|
28282
|
+
tagName: "Application",
|
|
28283
|
+
id: i.id
|
|
28284
|
+
} }) : [],
|
|
28285
|
+
report: a
|
|
28286
|
+
}), await Ir(e, {
|
|
28287
|
+
sourceQuery: n,
|
|
28288
|
+
primaryRef: r,
|
|
28289
|
+
instancePrimaryRef: i ? {
|
|
28290
|
+
tagName: "Application",
|
|
28291
|
+
id: i.id
|
|
28292
|
+
} : void 0,
|
|
28293
|
+
report: a
|
|
28294
|
+
}), i) {
|
|
28295
|
+
let t = await $(e, i);
|
|
28296
|
+
for (let e of a.groups) e.instanceScopeTitle = t;
|
|
28297
|
+
}
|
|
28298
|
+
return a;
|
|
28299
|
+
}
|
|
28300
|
+
async function Yr(e, t) {
|
|
28301
|
+
let { sourceQuery: n, applicationRef: r, scenario: i } = t, a = await Yn(n, r), o = [];
|
|
28302
|
+
for (let t of a) {
|
|
28303
|
+
let [r] = await n.any.findByAttributes({
|
|
28304
|
+
tagName: "Function",
|
|
28305
|
+
attributes: { uuid: t }
|
|
28306
|
+
});
|
|
28307
|
+
if (!r) continue;
|
|
28308
|
+
let a = {
|
|
28309
|
+
tagName: "Function",
|
|
28310
|
+
id: r.id
|
|
28311
|
+
}, s = i === "instantiate" ? [] : await K(e, {
|
|
28312
|
+
tagName: "Function",
|
|
28313
|
+
sourceUuid: t
|
|
28314
|
+
});
|
|
28315
|
+
if (s.length === 0) {
|
|
28316
|
+
o.push(await Q(e, {
|
|
28317
|
+
sourceQuery: n,
|
|
28318
|
+
functionRef: a,
|
|
28319
|
+
instance: void 0
|
|
28320
|
+
}));
|
|
28321
|
+
continue;
|
|
28322
|
+
}
|
|
28323
|
+
for (let t of s) {
|
|
28324
|
+
let r = await Q(e, {
|
|
28325
|
+
sourceQuery: n,
|
|
28326
|
+
functionRef: a,
|
|
28327
|
+
instance: t
|
|
28328
|
+
}), i = await $(e, t);
|
|
28329
|
+
for (let e of r.groups) e.instanceScopeTitle = i;
|
|
28330
|
+
o.push(r);
|
|
28331
|
+
}
|
|
28332
|
+
}
|
|
28333
|
+
return o;
|
|
28334
|
+
}
|
|
28335
|
+
//#endregion
|
|
28336
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-fsd.ts
|
|
28337
|
+
async function Xr(e, t) {
|
|
28338
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a } = t, { uuid: o } = await n.getAttributes(r), s = a === "instantiate" ? [] : await Zn(e, {
|
|
28339
|
+
targetParent: i,
|
|
28340
|
+
tagName: "Function",
|
|
28341
|
+
sourceUuid: o
|
|
28342
|
+
});
|
|
28343
|
+
if (s.length === 0) return Q(e, {
|
|
28344
|
+
sourceQuery: n,
|
|
28345
|
+
functionRef: r,
|
|
28346
|
+
instance: void 0
|
|
28347
|
+
});
|
|
28348
|
+
let c = [];
|
|
28349
|
+
for (let t of s) {
|
|
28350
|
+
let i = await Q(e, {
|
|
28351
|
+
sourceQuery: n,
|
|
28352
|
+
functionRef: r,
|
|
28353
|
+
instance: t
|
|
28354
|
+
}), a = await $(e, t);
|
|
28355
|
+
for (let e of i.groups) e.instanceScopeTitle = a;
|
|
28356
|
+
c.push(i);
|
|
28357
|
+
}
|
|
28358
|
+
return mn(c);
|
|
28359
|
+
}
|
|
28360
|
+
//#endregion
|
|
28361
|
+
//#region src/v2019C1/extensions/lifecycle/report/report.ts
|
|
28362
|
+
async function Zr(e, t) {
|
|
28363
|
+
let n = t.verb === "fsd" ? await Xr(e, {
|
|
28364
|
+
sourceQuery: t.sourceQuery,
|
|
28365
|
+
functionRef: t.ref,
|
|
28366
|
+
targetParent: t.anchor,
|
|
28367
|
+
scenario: t.scenario
|
|
28368
|
+
}) : await qr(e, {
|
|
28369
|
+
sourceQuery: t.sourceQuery,
|
|
28370
|
+
applicationRef: t.ref,
|
|
28371
|
+
scenario: t.scenario
|
|
28372
|
+
});
|
|
28373
|
+
for (let e of n.groups) e.editableAttributes = xn(e.primary.tagName);
|
|
28374
|
+
return await Pr(e, t, n), n;
|
|
28375
|
+
}
|
|
28376
|
+
//#endregion
|
|
28377
|
+
//#region src/v2019C1/extensions/lifecycle/report/presentation-scope.ts
|
|
28378
|
+
function Qr(e) {
|
|
28379
|
+
switch (e.verb) {
|
|
28380
|
+
case "fsd":
|
|
28381
|
+
case "asd": return {
|
|
28382
|
+
rootTag: "Substation",
|
|
28383
|
+
omit: [
|
|
28384
|
+
"DataTypeTemplates",
|
|
28385
|
+
"Communication",
|
|
28386
|
+
"IED"
|
|
28387
|
+
]
|
|
28388
|
+
};
|
|
28389
|
+
}
|
|
28390
|
+
}
|
|
28391
|
+
//#endregion
|
|
26685
28392
|
//#region src/v2019C1/extensions/index.ts
|
|
26686
|
-
var
|
|
26687
|
-
cleanUp:
|
|
26688
|
-
dataModel:
|
|
26689
|
-
|
|
26690
|
-
|
|
26691
|
-
|
|
26692
|
-
|
|
26693
|
-
|
|
28393
|
+
var $r = {
|
|
28394
|
+
cleanUp: A,
|
|
28395
|
+
dataModel: Ht,
|
|
28396
|
+
history: qt,
|
|
28397
|
+
identity: Qt,
|
|
28398
|
+
lifecycle: {
|
|
28399
|
+
query: { report: Zr },
|
|
28400
|
+
transaction: {
|
|
28401
|
+
extract: Mr,
|
|
28402
|
+
instantiate: Nr,
|
|
28403
|
+
transplant: { deep: V },
|
|
28404
|
+
update: Sr,
|
|
28405
|
+
apply: Cr
|
|
28406
|
+
}
|
|
28407
|
+
},
|
|
28408
|
+
reference: k,
|
|
28409
|
+
signature: { query: kt },
|
|
28410
|
+
presentation: { query: Kr }
|
|
26694
28411
|
};
|
|
26695
28412
|
//#endregion
|
|
26696
28413
|
//#region src/v2019C1/hooks/after-created/private-wrapper.ts
|
|
26697
|
-
async function
|
|
28414
|
+
async function ei(e) {
|
|
26698
28415
|
let { childRecord: t, parentRecord: n, query: r } = e;
|
|
26699
|
-
if (t.namespace.prefix ===
|
|
26700
|
-
let i = n.tagName === "Private", a = n.namespace.prefix ===
|
|
28416
|
+
if (t.namespace.prefix === b.namespaces.default.prefix) return [];
|
|
28417
|
+
let i = n.tagName === "Private", a = n.namespace.prefix === b.namespaces.default.prefix;
|
|
26701
28418
|
if (!i && !a) return [];
|
|
26702
28419
|
let o = n.children.find((e) => e.tagName === "Private"), s = {
|
|
26703
28420
|
...n,
|
|
26704
28421
|
children: n.children.filter((e) => e.id !== t.id)
|
|
26705
28422
|
};
|
|
26706
|
-
return i ?
|
|
28423
|
+
return i ? ti({
|
|
26707
28424
|
parentRecord: n,
|
|
26708
28425
|
childRecord: t,
|
|
26709
28426
|
query: r
|
|
26710
|
-
}) : o ?
|
|
28427
|
+
}) : o ? ni({
|
|
26711
28428
|
existingPrivateRef: o,
|
|
26712
28429
|
parentRecord: n,
|
|
26713
28430
|
updatedParentRecord: s,
|
|
26714
28431
|
childRecord: t,
|
|
26715
28432
|
query: r
|
|
26716
|
-
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] :
|
|
28433
|
+
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] : ri({
|
|
26717
28434
|
parentRecord: n,
|
|
26718
28435
|
updatedParentRecord: s,
|
|
26719
28436
|
childRecord: t
|
|
26720
28437
|
});
|
|
26721
28438
|
}
|
|
26722
|
-
async function
|
|
26723
|
-
let { parentRecord: t, childRecord: n, query: r } = e,
|
|
26724
|
-
if (n.parent?.id ===
|
|
26725
|
-
let s = await
|
|
26726
|
-
privateId:
|
|
28439
|
+
async function ti(e) {
|
|
28440
|
+
let { parentRecord: t, childRecord: n, query: r } = e, a = t;
|
|
28441
|
+
if (n.parent?.id === a.id && n.parent?.tagName === "Private") return [];
|
|
28442
|
+
let s = await ii({
|
|
28443
|
+
privateId: a.id,
|
|
26727
28444
|
query: r
|
|
26728
28445
|
});
|
|
26729
|
-
|
|
28446
|
+
o(s, {
|
|
26730
28447
|
detail: "Latest private record not found",
|
|
26731
28448
|
key: "ELEMENT_NOT_FOUND"
|
|
26732
28449
|
});
|
|
26733
|
-
let { childRecord: c, privateRecord: l } =
|
|
28450
|
+
let { childRecord: c, privateRecord: l } = ai({
|
|
26734
28451
|
privateRecord: s,
|
|
26735
28452
|
childRecord: n
|
|
26736
28453
|
});
|
|
@@ -26744,23 +28461,23 @@ async function en(e) {
|
|
|
26744
28461
|
newRecord: i(l)
|
|
26745
28462
|
}];
|
|
26746
28463
|
}
|
|
26747
|
-
async function
|
|
26748
|
-
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord:
|
|
28464
|
+
async function ni(e) {
|
|
28465
|
+
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: a, query: s } = e, c = await ii({
|
|
26749
28466
|
privateId: t.id,
|
|
26750
28467
|
query: s
|
|
26751
28468
|
});
|
|
26752
|
-
if (
|
|
28469
|
+
if (o(c, {
|
|
26753
28470
|
detail: "Latest private record not found",
|
|
26754
28471
|
key: "ELEMENT_NOT_FOUND"
|
|
26755
|
-
}), !c.attributes.some((e) => e.name === "type" && e.value ===
|
|
26756
|
-
let { childRecord: l, privateRecord: u } =
|
|
28472
|
+
}), !c.attributes.some((e) => e.name === "type" && e.value === a.namespace.prefix)) return [];
|
|
28473
|
+
let { childRecord: l, privateRecord: u } = ai({
|
|
26757
28474
|
privateRecord: c,
|
|
26758
|
-
childRecord:
|
|
28475
|
+
childRecord: a
|
|
26759
28476
|
});
|
|
26760
28477
|
return [
|
|
26761
28478
|
{
|
|
26762
28479
|
status: "updated",
|
|
26763
|
-
oldRecord: i(
|
|
28480
|
+
oldRecord: i(a),
|
|
26764
28481
|
newRecord: i(l)
|
|
26765
28482
|
},
|
|
26766
28483
|
{
|
|
@@ -26775,11 +28492,11 @@ async function tn(e) {
|
|
|
26775
28492
|
}
|
|
26776
28493
|
];
|
|
26777
28494
|
}
|
|
26778
|
-
function
|
|
28495
|
+
function ri(e) {
|
|
26779
28496
|
let { parentRecord: t, updatedParentRecord: n, childRecord: r } = e, a = {
|
|
26780
28497
|
id: crypto.randomUUID(),
|
|
26781
28498
|
tagName: "Private",
|
|
26782
|
-
namespace:
|
|
28499
|
+
namespace: b.namespaces.default,
|
|
26783
28500
|
attributes: [{
|
|
26784
28501
|
name: "type",
|
|
26785
28502
|
value: r.namespace.prefix
|
|
@@ -26824,14 +28541,14 @@ function nn(e) {
|
|
|
26824
28541
|
}
|
|
26825
28542
|
];
|
|
26826
28543
|
}
|
|
26827
|
-
async function
|
|
28544
|
+
async function ii(e) {
|
|
26828
28545
|
let { privateId: t, query: n } = e;
|
|
26829
28546
|
return await n.getRecord({
|
|
26830
28547
|
id: t,
|
|
26831
28548
|
tagName: "Private"
|
|
26832
28549
|
});
|
|
26833
28550
|
}
|
|
26834
|
-
function
|
|
28551
|
+
function ai(e) {
|
|
26835
28552
|
let { privateRecord: t, childRecord: n } = e;
|
|
26836
28553
|
return {
|
|
26837
28554
|
childRecord: {
|
|
@@ -26852,16 +28569,16 @@ function an(e) {
|
|
|
26852
28569
|
}
|
|
26853
28570
|
//#endregion
|
|
26854
28571
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
26855
|
-
async function
|
|
28572
|
+
async function oi(e) {
|
|
26856
28573
|
let { uuid: t, entry: r, target: a, query: o } = e;
|
|
26857
|
-
if (!n(r.refTagName,
|
|
28574
|
+
if (!n(r.refTagName, b)) return [];
|
|
26858
28575
|
let s = await o.getRecordsByTagName(r.refTagName), c = [];
|
|
26859
28576
|
for (let e of s) {
|
|
26860
28577
|
if (e.attributes.find((e) => e.name === r.uuidAttr)?.value !== t) continue;
|
|
26861
28578
|
let n = {
|
|
26862
28579
|
tagName: e.tagName,
|
|
26863
28580
|
id: e.id
|
|
26864
|
-
}, s = await
|
|
28581
|
+
}, s = await k.query.buildReferencePath(o, {
|
|
26865
28582
|
reference: n,
|
|
26866
28583
|
target: a
|
|
26867
28584
|
});
|
|
@@ -26881,32 +28598,32 @@ async function Q(e) {
|
|
|
26881
28598
|
}
|
|
26882
28599
|
return c;
|
|
26883
28600
|
}
|
|
26884
|
-
function
|
|
28601
|
+
function si(e) {
|
|
26885
28602
|
let t = [];
|
|
26886
|
-
for (let n of
|
|
26887
|
-
let r =
|
|
28603
|
+
for (let n of He) {
|
|
28604
|
+
let r = Be[n]?.get(e);
|
|
26888
28605
|
r && t.push(...r);
|
|
26889
28606
|
}
|
|
26890
28607
|
return t;
|
|
26891
28608
|
}
|
|
26892
28609
|
//#endregion
|
|
26893
28610
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
26894
|
-
async function
|
|
26895
|
-
let { childRecord: t, query: n } = e, r = await
|
|
28611
|
+
async function ci(e) {
|
|
28612
|
+
let { childRecord: t, query: n } = e, r = await li({
|
|
26896
28613
|
childRecord: t,
|
|
26897
28614
|
query: n
|
|
26898
|
-
}), i = await
|
|
28615
|
+
}), i = await fi({
|
|
26899
28616
|
childRecord: t,
|
|
26900
28617
|
query: n
|
|
26901
28618
|
});
|
|
26902
28619
|
return [...r, ...i];
|
|
26903
28620
|
}
|
|
26904
|
-
async function
|
|
26905
|
-
let { childRecord: t, query: n } = e, r =
|
|
28621
|
+
async function li(e) {
|
|
28622
|
+
let { childRecord: t, query: n } = e, r = Ue.get(t.tagName);
|
|
26906
28623
|
if (!r?.length) return [];
|
|
26907
28624
|
let i = [];
|
|
26908
28625
|
for (let e of r) {
|
|
26909
|
-
let r = await
|
|
28626
|
+
let r = await ui({
|
|
26910
28627
|
childRecord: t,
|
|
26911
28628
|
pair: e,
|
|
26912
28629
|
query: n
|
|
@@ -26915,16 +28632,16 @@ async function sn(e) {
|
|
|
26915
28632
|
}
|
|
26916
28633
|
return i;
|
|
26917
28634
|
}
|
|
26918
|
-
async function
|
|
28635
|
+
async function ui(e) {
|
|
26919
28636
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
26920
28637
|
if (!i) return null;
|
|
26921
|
-
let a = await
|
|
28638
|
+
let a = await di({
|
|
26922
28639
|
uuidValue: i,
|
|
26923
28640
|
targetTagNames: n.targetTagNames,
|
|
26924
28641
|
query: r
|
|
26925
28642
|
});
|
|
26926
28643
|
if (!a) return null;
|
|
26927
|
-
let o = await
|
|
28644
|
+
let o = await _e(r, {
|
|
26928
28645
|
reference: {
|
|
26929
28646
|
tagName: t.tagName,
|
|
26930
28647
|
id: t.id
|
|
@@ -26948,10 +28665,10 @@ async function cn(e) {
|
|
|
26948
28665
|
}
|
|
26949
28666
|
};
|
|
26950
28667
|
}
|
|
26951
|
-
async function
|
|
28668
|
+
async function di(e) {
|
|
26952
28669
|
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
26953
28670
|
for (let e of r) {
|
|
26954
|
-
if (!n(e,
|
|
28671
|
+
if (!n(e, b)) continue;
|
|
26955
28672
|
let r = (await i.getRecordsByTagName(e)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value === t);
|
|
26956
28673
|
if (r) return {
|
|
26957
28674
|
tagName: r.tagName,
|
|
@@ -26960,17 +28677,17 @@ async function ln(e) {
|
|
|
26960
28677
|
}
|
|
26961
28678
|
return null;
|
|
26962
28679
|
}
|
|
26963
|
-
async function
|
|
28680
|
+
async function fi(e) {
|
|
26964
28681
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
26965
28682
|
if (!r) return [];
|
|
26966
|
-
let i =
|
|
28683
|
+
let i = si(t.tagName);
|
|
26967
28684
|
if (i.length === 0) return [];
|
|
26968
28685
|
let a = {
|
|
26969
28686
|
tagName: t.tagName,
|
|
26970
28687
|
id: t.id
|
|
26971
28688
|
}, o = [];
|
|
26972
28689
|
for (let e of i) {
|
|
26973
|
-
let t = await
|
|
28690
|
+
let t = await oi({
|
|
26974
28691
|
uuid: r,
|
|
26975
28692
|
entry: e,
|
|
26976
28693
|
target: a,
|
|
@@ -26982,12 +28699,12 @@ async function un(e) {
|
|
|
26982
28699
|
}
|
|
26983
28700
|
//#endregion
|
|
26984
28701
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
26985
|
-
async function
|
|
26986
|
-
let { childRecord: t, parentRecord: n, query: r } = e, i = await
|
|
28702
|
+
async function pi(e) {
|
|
28703
|
+
let { childRecord: t, parentRecord: n, query: r } = e, i = await ei({
|
|
26987
28704
|
childRecord: t,
|
|
26988
28705
|
parentRecord: n,
|
|
26989
28706
|
query: r
|
|
26990
|
-
}), a = await
|
|
28707
|
+
}), a = await ci({
|
|
26991
28708
|
childRecord: t,
|
|
26992
28709
|
query: r
|
|
26993
28710
|
});
|
|
@@ -26995,12 +28712,12 @@ async function dn(e) {
|
|
|
26995
28712
|
}
|
|
26996
28713
|
//#endregion
|
|
26997
28714
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
26998
|
-
async function
|
|
26999
|
-
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await
|
|
28715
|
+
async function mi(e) {
|
|
28716
|
+
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await hi(t, n);
|
|
27000
28717
|
if (r.size === 0) return [];
|
|
27001
28718
|
let a = [];
|
|
27002
28719
|
for (let { target: e } of t) {
|
|
27003
|
-
let t = await
|
|
28720
|
+
let t = await _i({
|
|
27004
28721
|
target: e,
|
|
27005
28722
|
uuidMap: r,
|
|
27006
28723
|
uuidToRef: i,
|
|
@@ -27010,9 +28727,9 @@ async function fn(e) {
|
|
|
27010
28727
|
}
|
|
27011
28728
|
return a;
|
|
27012
28729
|
}
|
|
27013
|
-
async function
|
|
28730
|
+
async function hi(e, t) {
|
|
27014
28731
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
27015
|
-
for (let { source: i, target: a } of e) await
|
|
28732
|
+
for (let { source: i, target: a } of e) await gi({
|
|
27016
28733
|
source: i,
|
|
27017
28734
|
target: a,
|
|
27018
28735
|
query: t,
|
|
@@ -27024,7 +28741,7 @@ async function pn(e, t) {
|
|
|
27024
28741
|
uuidToRef: r
|
|
27025
28742
|
};
|
|
27026
28743
|
}
|
|
27027
|
-
async function
|
|
28744
|
+
async function gi(e) {
|
|
27028
28745
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
27029
28746
|
if (!o) return;
|
|
27030
28747
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -27033,14 +28750,14 @@ async function mn(e) {
|
|
|
27033
28750
|
id: o.id
|
|
27034
28751
|
}));
|
|
27035
28752
|
}
|
|
27036
|
-
async function
|
|
28753
|
+
async function _i(e) {
|
|
27037
28754
|
let { target: t, uuidMap: n, uuidToRef: r, query: a } = e, o = t.tagName;
|
|
27038
|
-
if (!(o in
|
|
28755
|
+
if (!(o in T)) return null;
|
|
27039
28756
|
let s = await a.getRecord(t);
|
|
27040
28757
|
if (!s) return null;
|
|
27041
|
-
let c =
|
|
28758
|
+
let c = T[o], l = [...s.attributes], u = !1;
|
|
27042
28759
|
for (let e of c) {
|
|
27043
|
-
let t = await
|
|
28760
|
+
let t = await vi({
|
|
27044
28761
|
pair: e,
|
|
27045
28762
|
tagName: o,
|
|
27046
28763
|
refId: s.id,
|
|
@@ -27060,14 +28777,14 @@ async function hn(e) {
|
|
|
27060
28777
|
})
|
|
27061
28778
|
} : null;
|
|
27062
28779
|
}
|
|
27063
|
-
async function
|
|
28780
|
+
async function vi(e) {
|
|
27064
28781
|
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;
|
|
27065
28782
|
if (!c) return null;
|
|
27066
28783
|
let l = i.get(c);
|
|
27067
28784
|
if (!l) return null;
|
|
27068
|
-
let u = !1, d =
|
|
28785
|
+
let u = !1, d = yi(s, t.attribute.uuid, c, l);
|
|
27069
28786
|
d && (s = d, u = !0);
|
|
27070
|
-
let f = await
|
|
28787
|
+
let f = await bi({
|
|
27071
28788
|
attributes: s,
|
|
27072
28789
|
pathAttrName: t.attribute.path,
|
|
27073
28790
|
newUuid: l,
|
|
@@ -27078,16 +28795,16 @@ async function gn(e) {
|
|
|
27078
28795
|
});
|
|
27079
28796
|
return f && (s = f, u = !0), u ? s : null;
|
|
27080
28797
|
}
|
|
27081
|
-
function
|
|
28798
|
+
function yi(e, t, n, r) {
|
|
27082
28799
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
27083
28800
|
...e,
|
|
27084
28801
|
value: r
|
|
27085
28802
|
} : e);
|
|
27086
28803
|
}
|
|
27087
|
-
async function
|
|
28804
|
+
async function bi(e) {
|
|
27088
28805
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
27089
28806
|
if (!c) return null;
|
|
27090
|
-
let l = await
|
|
28807
|
+
let l = await k.query.buildReferencePath(s, {
|
|
27091
28808
|
reference: {
|
|
27092
28809
|
tagName: a,
|
|
27093
28810
|
id: o
|
|
@@ -27104,13 +28821,13 @@ async function vn(e) {
|
|
|
27104
28821
|
}
|
|
27105
28822
|
//#endregion
|
|
27106
28823
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
27107
|
-
async function
|
|
27108
|
-
return
|
|
28824
|
+
async function xi(e) {
|
|
28825
|
+
return mi(e);
|
|
27109
28826
|
}
|
|
27110
28827
|
//#endregion
|
|
27111
28828
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
27112
|
-
function
|
|
27113
|
-
let { record: t } = e, { tagName: n, attributes: r } = t, i =
|
|
28829
|
+
function Si(e) {
|
|
28830
|
+
let { record: t } = e, { tagName: n, attributes: r } = t, i = b.definition[n];
|
|
27114
28831
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
27115
28832
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
27116
28833
|
return {
|
|
@@ -27124,20 +28841,20 @@ function bn(e) {
|
|
|
27124
28841
|
}
|
|
27125
28842
|
//#endregion
|
|
27126
28843
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
27127
|
-
function
|
|
27128
|
-
return
|
|
28844
|
+
function Ci(e) {
|
|
28845
|
+
return Si(e);
|
|
27129
28846
|
}
|
|
27130
28847
|
//#endregion
|
|
27131
28848
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
27132
|
-
async function
|
|
28849
|
+
async function wi(e) {
|
|
27133
28850
|
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
27134
28851
|
if (a) {
|
|
27135
|
-
let e =
|
|
28852
|
+
let e = si(n.tagName), t = {
|
|
27136
28853
|
tagName: n.tagName,
|
|
27137
28854
|
id: n.id
|
|
27138
28855
|
};
|
|
27139
28856
|
for (let n of e) {
|
|
27140
|
-
let e = await
|
|
28857
|
+
let e = await oi({
|
|
27141
28858
|
uuid: a,
|
|
27142
28859
|
entry: n,
|
|
27143
28860
|
target: t,
|
|
@@ -27146,8 +28863,8 @@ async function Sn(e) {
|
|
|
27146
28863
|
i.push(...e);
|
|
27147
28864
|
}
|
|
27148
28865
|
}
|
|
27149
|
-
if (
|
|
27150
|
-
let e = await
|
|
28866
|
+
if (Ti(t, n)) {
|
|
28867
|
+
let e = await Ei({
|
|
27151
28868
|
newRecord: n,
|
|
27152
28869
|
query: r
|
|
27153
28870
|
});
|
|
@@ -27155,11 +28872,11 @@ async function Sn(e) {
|
|
|
27155
28872
|
}
|
|
27156
28873
|
return i;
|
|
27157
28874
|
}
|
|
27158
|
-
function
|
|
27159
|
-
for (let n of
|
|
28875
|
+
function Ti(e, t) {
|
|
28876
|
+
for (let n of ne) if (e.attributes.find((e) => e.name === n)?.value !== t.attributes.find((e) => e.name === n)?.value) return !0;
|
|
27160
28877
|
return !1;
|
|
27161
28878
|
}
|
|
27162
|
-
async function
|
|
28879
|
+
async function Ei(e) {
|
|
27163
28880
|
let { newRecord: t, query: n } = e, r = {
|
|
27164
28881
|
tagName: t.tagName,
|
|
27165
28882
|
id: t.id
|
|
@@ -27168,14 +28885,14 @@ async function wn(e) {
|
|
|
27168
28885
|
if (r.id === t.id) continue;
|
|
27169
28886
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
27170
28887
|
if (!e) continue;
|
|
27171
|
-
let i =
|
|
28888
|
+
let i = si(r.tagName);
|
|
27172
28889
|
if (i.length === 0) continue;
|
|
27173
28890
|
let o = {
|
|
27174
28891
|
tagName: r.tagName,
|
|
27175
28892
|
id: r.id
|
|
27176
28893
|
};
|
|
27177
28894
|
for (let t of i) {
|
|
27178
|
-
let r = await
|
|
28895
|
+
let r = await oi({
|
|
27179
28896
|
uuid: e,
|
|
27180
28897
|
entry: t,
|
|
27181
28898
|
target: o,
|
|
@@ -27188,12 +28905,12 @@ async function wn(e) {
|
|
|
27188
28905
|
}
|
|
27189
28906
|
//#endregion
|
|
27190
28907
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
27191
|
-
async function
|
|
27192
|
-
return
|
|
28908
|
+
async function Di(e) {
|
|
28909
|
+
return wi(e);
|
|
27193
28910
|
}
|
|
27194
28911
|
//#endregion
|
|
27195
28912
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
27196
|
-
function
|
|
28913
|
+
function Oi(e) {
|
|
27197
28914
|
let { record: t } = e, n = !0;
|
|
27198
28915
|
t.tagName === "Private" && !t.tree.length && (n = !1);
|
|
27199
28916
|
let r = t.attributes.filter((e) => e.name !== "uuid");
|
|
@@ -27207,17 +28924,17 @@ function En(e) {
|
|
|
27207
28924
|
}
|
|
27208
28925
|
//#endregion
|
|
27209
28926
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
27210
|
-
async function
|
|
28927
|
+
async function ki(e) {
|
|
27211
28928
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
27212
|
-
if (await
|
|
28929
|
+
if (await Fi({
|
|
27213
28930
|
record: t,
|
|
27214
28931
|
query: n,
|
|
27215
28932
|
ids: r,
|
|
27216
28933
|
uuids: i
|
|
27217
28934
|
}), i.size === 0) return [];
|
|
27218
|
-
let a = [], o = Object.keys(
|
|
28935
|
+
let a = [], o = Object.keys(T);
|
|
27219
28936
|
for (let e of o) {
|
|
27220
|
-
let t = await
|
|
28937
|
+
let t = await Ai({
|
|
27221
28938
|
refTagName: e,
|
|
27222
28939
|
subtreeIds: r,
|
|
27223
28940
|
subtreeUuids: i,
|
|
@@ -27227,11 +28944,11 @@ async function Dn(e) {
|
|
|
27227
28944
|
}
|
|
27228
28945
|
return a;
|
|
27229
28946
|
}
|
|
27230
|
-
async function
|
|
27231
|
-
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a =
|
|
28947
|
+
async function Ai(e) {
|
|
28948
|
+
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = T[t], o = await i.getRecordsByTagName(t), s = [];
|
|
27232
28949
|
for (let e of o) {
|
|
27233
28950
|
if (n.has(e.id)) continue;
|
|
27234
|
-
let o = await
|
|
28951
|
+
let o = await ji({
|
|
27235
28952
|
refTagName: t,
|
|
27236
28953
|
refRecord: e,
|
|
27237
28954
|
refPairs: a,
|
|
@@ -27242,15 +28959,15 @@ async function On(e) {
|
|
|
27242
28959
|
}
|
|
27243
28960
|
return s;
|
|
27244
28961
|
}
|
|
27245
|
-
async function
|
|
27246
|
-
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o =
|
|
28962
|
+
async function ji(e) {
|
|
28963
|
+
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o = Mi({
|
|
27247
28964
|
refPairs: r,
|
|
27248
28965
|
refRecord: n,
|
|
27249
28966
|
subtreeUuids: i
|
|
27250
28967
|
});
|
|
27251
|
-
return o.size === 0 ? [] :
|
|
28968
|
+
return o.size === 0 ? [] : Je.has(t) ? [Ni(n, o)] : Pi(n, a);
|
|
27252
28969
|
}
|
|
27253
|
-
function
|
|
28970
|
+
function Mi(e) {
|
|
27254
28971
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
27255
28972
|
for (let e of t) {
|
|
27256
28973
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -27261,7 +28978,7 @@ function An(e) {
|
|
|
27261
28978
|
}
|
|
27262
28979
|
return i;
|
|
27263
28980
|
}
|
|
27264
|
-
function
|
|
28981
|
+
function Ni(e, t) {
|
|
27265
28982
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
27266
28983
|
return {
|
|
27267
28984
|
status: "updated",
|
|
@@ -27272,7 +28989,7 @@ function jn(e, t) {
|
|
|
27272
28989
|
})
|
|
27273
28990
|
};
|
|
27274
28991
|
}
|
|
27275
|
-
async function
|
|
28992
|
+
async function Pi(e, t) {
|
|
27276
28993
|
let n = [{
|
|
27277
28994
|
status: "deleted",
|
|
27278
28995
|
oldRecord: i(e),
|
|
@@ -27294,14 +29011,14 @@ async function Mn(e, t) {
|
|
|
27294
29011
|
}
|
|
27295
29012
|
return n;
|
|
27296
29013
|
}
|
|
27297
|
-
async function
|
|
29014
|
+
async function Fi(e) {
|
|
27298
29015
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
27299
29016
|
r.add(t.id);
|
|
27300
29017
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
27301
29018
|
a && i.add(a);
|
|
27302
29019
|
for (let e of t.children) {
|
|
27303
29020
|
let t = await n.getRecord(e);
|
|
27304
|
-
t && await
|
|
29021
|
+
t && await Fi({
|
|
27305
29022
|
record: t,
|
|
27306
29023
|
query: n,
|
|
27307
29024
|
ids: r,
|
|
@@ -27311,31 +29028,31 @@ async function Nn(e) {
|
|
|
27311
29028
|
}
|
|
27312
29029
|
//#endregion
|
|
27313
29030
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
27314
|
-
async function
|
|
27315
|
-
return
|
|
29031
|
+
async function Ii(e) {
|
|
29032
|
+
return ki(e);
|
|
27316
29033
|
}
|
|
27317
29034
|
//#endregion
|
|
27318
29035
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
27319
|
-
function
|
|
29036
|
+
function Li() {
|
|
27320
29037
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
27321
29038
|
return {
|
|
27322
29039
|
beforeImportRecord: (r) => {
|
|
27323
29040
|
let { record: i, ancestry: a } = r, { tagName: o } = i, s = i.attributes.find((e) => e.name === "uuid")?.value;
|
|
27324
|
-
if (s &&
|
|
27325
|
-
let t =
|
|
29041
|
+
if (s && zi.has(o)) {
|
|
29042
|
+
let t = ae({
|
|
27326
29043
|
record: i,
|
|
27327
29044
|
ancestry: a
|
|
27328
29045
|
});
|
|
27329
29046
|
t && e.set(t.path, s);
|
|
27330
29047
|
}
|
|
27331
|
-
if (!
|
|
27332
|
-
let c =
|
|
29048
|
+
if (!Ri.has(o)) return;
|
|
29049
|
+
let c = T[o];
|
|
27333
29050
|
for (let e of c) {
|
|
27334
29051
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
27335
29052
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
27336
|
-
let s =
|
|
29053
|
+
let s = ue(e.resolution, e.attribute.path, r, a);
|
|
27337
29054
|
if (!s) {
|
|
27338
|
-
e.resolution ===
|
|
29055
|
+
e.resolution === E.unsupported && n.push({
|
|
27339
29056
|
type: "unsupported-xpath-reference",
|
|
27340
29057
|
recordId: i.id,
|
|
27341
29058
|
details: {
|
|
@@ -27389,13 +29106,13 @@ function Fn() {
|
|
|
27389
29106
|
}
|
|
27390
29107
|
};
|
|
27391
29108
|
}
|
|
27392
|
-
var
|
|
27393
|
-
beforeClone:
|
|
27394
|
-
afterStandardizedRecord:
|
|
27395
|
-
afterCreated:
|
|
27396
|
-
afterDeepClone:
|
|
27397
|
-
afterUpdated:
|
|
27398
|
-
beforeDelete:
|
|
29109
|
+
var Ri = new Set(Object.keys(T)), zi = new Set(Object.values(T).flatMap((e) => e.flatMap((e) => e.target))), Bi = {
|
|
29110
|
+
beforeClone: Oi,
|
|
29111
|
+
afterStandardizedRecord: Ci,
|
|
29112
|
+
afterCreated: pi,
|
|
29113
|
+
afterDeepClone: xi,
|
|
29114
|
+
afterUpdated: Di,
|
|
29115
|
+
beforeDelete: Ii
|
|
27399
29116
|
};
|
|
27400
29117
|
//#endregion
|
|
27401
|
-
export {
|
|
29118
|
+
export { b as C, v as S, y as T, D as _, gt as a, ne as b, Ye as c, Ue as d, Be as f, qe as g, Ge as h, Qr as i, We as l, Ke as m, Li as n, Xe as o, Ve as p, $r as r, Je as s, Bi as t, He as u, E as v, _ as w, S as x, T as y };
|