@dialecte/scl 0.3.2 → 0.3.4
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-BaLMAs9W.js → hooks-abaf9148.js} +2615 -897
- 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/data-model/query/resolve.d.ts +1 -1
- package/dist/v2019C1/extensions/data-model/query/resolve.d.ts.map +1 -1
- package/dist/v2019C1/extensions/data-model/transaction/import-types.types.d.ts +1 -1
- package/dist/v2019C1/extensions/data-model/transaction/import-types.types.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/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 +4 -3
- 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,99 @@ 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
|
-
|
|
26733
|
+
async function Mn(e, t) {
|
|
26734
|
+
let { LNode: n = [], LN: r = [], LN0: i = [] } = await e.findDescendants(t, { collect: [
|
|
26735
|
+
"LNode",
|
|
26736
|
+
"LN",
|
|
26737
|
+
"LN0"
|
|
26738
|
+
] });
|
|
26739
|
+
return [
|
|
26740
|
+
...n,
|
|
26741
|
+
...r,
|
|
26742
|
+
...i
|
|
26743
|
+
];
|
|
26180
26744
|
}
|
|
26181
26745
|
//#endregion
|
|
26182
|
-
//#region src/v2019C1/extensions/
|
|
26183
|
-
async function
|
|
26184
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, alreadyCloned: o } = t, s =
|
|
26746
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/primitives/clone-referenced.ts
|
|
26747
|
+
async function Nn(e, t) {
|
|
26748
|
+
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
26749
|
for (let e of c) {
|
|
26186
26750
|
let t = e.attributes.find((e) => e.name === s)?.value;
|
|
26187
26751
|
t && l.add(t);
|
|
@@ -26204,48 +26768,59 @@ async function Et(e, t) {
|
|
|
26204
26768
|
}
|
|
26205
26769
|
return u;
|
|
26206
26770
|
}
|
|
26207
|
-
async function
|
|
26208
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, resolveTargetParent: o, alreadyCloned: s, omit: c } = t, l = await
|
|
26771
|
+
async function Pn(e, t) {
|
|
26772
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, resolveTargetParent: o, alreadyCloned: s, omit: c } = t, l = await Nn(e, {
|
|
26209
26773
|
sourceQuery: n,
|
|
26210
26774
|
scopeRef: r,
|
|
26211
26775
|
refTagName: i,
|
|
26212
26776
|
targetTagName: a,
|
|
26213
26777
|
alreadyCloned: s
|
|
26214
|
-
});
|
|
26215
|
-
for (let t of l)
|
|
26216
|
-
|
|
26217
|
-
|
|
26218
|
-
|
|
26219
|
-
|
|
26220
|
-
|
|
26778
|
+
}), u = [];
|
|
26779
|
+
for (let t of l) {
|
|
26780
|
+
let r = await z(e, {
|
|
26781
|
+
sourceQuery: n,
|
|
26782
|
+
ref: t,
|
|
26783
|
+
targetParent: await o(t),
|
|
26784
|
+
omit: c
|
|
26785
|
+
});
|
|
26786
|
+
r && u.push(...r.mappings);
|
|
26787
|
+
}
|
|
26788
|
+
return u;
|
|
26221
26789
|
}
|
|
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
|
-
|
|
26790
|
+
async function Fn(e, t) {
|
|
26791
|
+
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 = [];
|
|
26792
|
+
for (let t of l) for (let r of T[t]) for (let s of r.target) {
|
|
26793
|
+
let r = await u(e, {
|
|
26794
|
+
sourceQuery: n,
|
|
26795
|
+
scopeRef: i,
|
|
26796
|
+
refTagName: t,
|
|
26797
|
+
targetTagName: s,
|
|
26798
|
+
resolveTargetParent: a,
|
|
26799
|
+
alreadyCloned: o,
|
|
26800
|
+
omit: c
|
|
26801
|
+
});
|
|
26802
|
+
d.push(...r);
|
|
26803
|
+
}
|
|
26804
|
+
return d;
|
|
26233
26805
|
}
|
|
26234
26806
|
//#endregion
|
|
26235
|
-
//#region src/v2019C1/extensions/
|
|
26236
|
-
async function
|
|
26807
|
+
//#region src/v2019C1/extensions/lifecycle/transplant/transaction/resolve-structure-ref.ts
|
|
26808
|
+
async function H(e, t, n) {
|
|
26237
26809
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26238
|
-
|
|
26810
|
+
o(r, {
|
|
26239
26811
|
key: "ELEMENT_NOT_FOUND",
|
|
26240
|
-
detail: `No Substation/VoltageLevel/Bay
|
|
26812
|
+
detail: `No Substation/VoltageLevel/Bay level in the target structure for ${t.tagName}`
|
|
26241
26813
|
});
|
|
26242
26814
|
let i = n[r.tagName];
|
|
26243
|
-
return {
|
|
26815
|
+
return o(i, {
|
|
26816
|
+
key: "ELEMENT_NOT_FOUND",
|
|
26817
|
+
detail: `Target structure missing the ${r.tagName} level for ${t.tagName}`
|
|
26818
|
+
}), {
|
|
26244
26819
|
tagName: i.tagName,
|
|
26245
26820
|
id: i.id
|
|
26246
26821
|
};
|
|
26247
26822
|
}
|
|
26248
|
-
function
|
|
26823
|
+
function In(e) {
|
|
26249
26824
|
let { sourceQuery: t, structure: n, cloneIndex: r } = e;
|
|
26250
26825
|
return async function(e) {
|
|
26251
26826
|
let i = await t.findAncestors(e, { stopAtTagName: "Substation" });
|
|
@@ -26254,22 +26829,384 @@ function kt(e) {
|
|
|
26254
26829
|
if (t) return t;
|
|
26255
26830
|
if (e.tagName in n) {
|
|
26256
26831
|
let t = n[e.tagName];
|
|
26257
|
-
return {
|
|
26832
|
+
if (t) return {
|
|
26258
26833
|
tagName: t.tagName,
|
|
26259
26834
|
id: t.id
|
|
26260
26835
|
};
|
|
26261
26836
|
}
|
|
26262
26837
|
}
|
|
26263
|
-
|
|
26838
|
+
o(!1, {
|
|
26264
26839
|
key: "ELEMENT_NOT_FOUND",
|
|
26265
26840
|
detail: `No clone-mapped or structural ancestor found for ${e.tagName}`
|
|
26266
26841
|
});
|
|
26267
26842
|
};
|
|
26268
26843
|
}
|
|
26269
26844
|
//#endregion
|
|
26270
|
-
//#region src/v2019C1/extensions/
|
|
26271
|
-
|
|
26272
|
-
|
|
26845
|
+
//#region src/v2019C1/extensions/lifecycle/engine/reconcile.ts
|
|
26846
|
+
var Ln = new Set(Object.keys(T));
|
|
26847
|
+
async function U(e, t) {
|
|
26848
|
+
let { sourceQuery: n, sourceRootRef: r, instanceRootRef: i, accepted: a, overrides: o } = t, s = await n.any.getTree(r), c = await e.any.getTree(i);
|
|
26849
|
+
if (!s || !c) return;
|
|
26850
|
+
let l = /* @__PURE__ */ new Map();
|
|
26851
|
+
await Hn(e, {
|
|
26852
|
+
node: c,
|
|
26853
|
+
index: l
|
|
26854
|
+
});
|
|
26855
|
+
let u = /* @__PURE__ */ new Set();
|
|
26856
|
+
await Un(n, {
|
|
26857
|
+
node: s,
|
|
26858
|
+
out: u
|
|
26859
|
+
}), await Vn(e, {
|
|
26860
|
+
sourceQuery: n,
|
|
26861
|
+
instanceRecord: c,
|
|
26862
|
+
sourceNode: s,
|
|
26863
|
+
accepted: a,
|
|
26864
|
+
overrides: o
|
|
26865
|
+
}), await Rn(e, {
|
|
26866
|
+
sourceQuery: n,
|
|
26867
|
+
sourceNode: s,
|
|
26868
|
+
instanceParent: c,
|
|
26869
|
+
index: l,
|
|
26870
|
+
accepted: a,
|
|
26871
|
+
overrides: o
|
|
26872
|
+
}), await zn(e, {
|
|
26873
|
+
instanceNode: c,
|
|
26874
|
+
sourceUuids: u,
|
|
26875
|
+
accepted: a
|
|
26876
|
+
});
|
|
26877
|
+
}
|
|
26878
|
+
async function Rn(e, t) {
|
|
26879
|
+
let { sourceQuery: n, sourceNode: r, instanceParent: i, index: o, accepted: s, overrides: c } = t, l = /* @__PURE__ */ new Set();
|
|
26880
|
+
for (let t of r.tree) {
|
|
26881
|
+
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)));
|
|
26882
|
+
if (u) {
|
|
26883
|
+
l.add(u.id), await Vn(e, {
|
|
26884
|
+
sourceQuery: n,
|
|
26885
|
+
instanceRecord: u,
|
|
26886
|
+
sourceNode: t,
|
|
26887
|
+
accepted: s,
|
|
26888
|
+
overrides: c
|
|
26889
|
+
}), await Rn(e, {
|
|
26890
|
+
sourceQuery: n,
|
|
26891
|
+
sourceNode: t,
|
|
26892
|
+
instanceParent: u,
|
|
26893
|
+
index: o,
|
|
26894
|
+
accepted: s,
|
|
26895
|
+
overrides: c
|
|
26896
|
+
});
|
|
26897
|
+
continue;
|
|
26898
|
+
}
|
|
26899
|
+
if (s && !s.sourceIds.has(t.id)) continue;
|
|
26900
|
+
let { recordMappings: d } = await V(e, {
|
|
26901
|
+
sourceQuery: n,
|
|
26902
|
+
ref: a(t),
|
|
26903
|
+
targetParent: a(i),
|
|
26904
|
+
strip: !1
|
|
26905
|
+
});
|
|
26906
|
+
await P(e, {
|
|
26907
|
+
mappings: d,
|
|
26908
|
+
mode: "stamp-template"
|
|
26909
|
+
});
|
|
26910
|
+
let f = d.find((e) => e.source.id === t.id);
|
|
26911
|
+
f && await R(e, {
|
|
26912
|
+
ref: f.target,
|
|
26913
|
+
parentRef: a(i),
|
|
26914
|
+
overrides: c?.get(t.id)
|
|
26915
|
+
});
|
|
26916
|
+
}
|
|
26917
|
+
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));
|
|
26918
|
+
}
|
|
26919
|
+
async function zn(e, t) {
|
|
26920
|
+
let { instanceNode: n, sourceUuids: r, accepted: i } = t, a = [];
|
|
26921
|
+
await Bn(e, {
|
|
26922
|
+
node: n,
|
|
26923
|
+
sourceUuids: r,
|
|
26924
|
+
accepted: i,
|
|
26925
|
+
out: a
|
|
26926
|
+
});
|
|
26927
|
+
for (let t of a) await e.any.getRecord(t) && await e.any.delete(t);
|
|
26928
|
+
}
|
|
26929
|
+
async function Bn(e, t) {
|
|
26930
|
+
let { node: n, sourceUuids: r, accepted: i, out: a } = t, o = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26931
|
+
if (o && !r.has(o)) {
|
|
26932
|
+
(!i || i.instanceIds.has(n.id)) && a.push(n);
|
|
26933
|
+
return;
|
|
26934
|
+
}
|
|
26935
|
+
for (let t of n.tree) await Bn(e, {
|
|
26936
|
+
node: t,
|
|
26937
|
+
sourceUuids: r,
|
|
26938
|
+
accepted: i,
|
|
26939
|
+
out: a
|
|
26940
|
+
});
|
|
26941
|
+
}
|
|
26942
|
+
async function Vn(e, t) {
|
|
26943
|
+
let { sourceQuery: n, instanceRecord: r, sourceNode: i, accepted: a, overrides: o } = t;
|
|
26944
|
+
if (a && !a.sourceIds.has(i.id)) return;
|
|
26945
|
+
let s = {
|
|
26946
|
+
...F(await n.any.getAttributes(i)),
|
|
26947
|
+
...o?.get(i.id)
|
|
26948
|
+
}, c = F(await e.any.getAttributes(r)), l = {};
|
|
26949
|
+
for (let [e, t] of Object.entries(s)) c[e] !== t && (l[e] = t);
|
|
26950
|
+
Object.keys(l).length > 0 && await e.any.update(r, { attributes: l });
|
|
26951
|
+
}
|
|
26952
|
+
async function Hn(e, t) {
|
|
26953
|
+
let { node: n, index: r } = t, i = await e.any.getAttribute(n, { name: "templateUuid" });
|
|
26954
|
+
i && r.set(i, n);
|
|
26955
|
+
for (let t of n.tree) await Hn(e, {
|
|
26956
|
+
node: t,
|
|
26957
|
+
index: r
|
|
26958
|
+
});
|
|
26959
|
+
}
|
|
26960
|
+
async function Un(e, t) {
|
|
26961
|
+
let { node: n, out: r } = t, i = await e.any.getAttribute(n, { name: "uuid" });
|
|
26962
|
+
i && r.add(i);
|
|
26963
|
+
for (let t of n.tree) await Un(e, {
|
|
26964
|
+
node: t,
|
|
26965
|
+
out: r
|
|
26966
|
+
});
|
|
26967
|
+
}
|
|
26968
|
+
//#endregion
|
|
26969
|
+
//#region src/v2019C1/extensions/lifecycle/engine/decide.ts
|
|
26970
|
+
function Wn(e) {
|
|
26971
|
+
return e === void 0 ? "accept" : typeof e == "string" ? e : e.action;
|
|
26972
|
+
}
|
|
26973
|
+
function Gn(e) {
|
|
26974
|
+
return typeof e == "object" ? e.values : void 0;
|
|
26975
|
+
}
|
|
26976
|
+
function Kn(e) {
|
|
26977
|
+
return Wn(e.decisions.get(e.groupId)) !== "skip";
|
|
26978
|
+
}
|
|
26979
|
+
function W(e) {
|
|
26980
|
+
let { groups: t, decisions: n } = e, r = /* @__PURE__ */ new Map();
|
|
26981
|
+
for (let e of t) {
|
|
26982
|
+
let t = n.get(e.id);
|
|
26983
|
+
if (Wn(t) === "skip") continue;
|
|
26984
|
+
let i = Gn(t), a = e.primary.sourceRef?.id;
|
|
26985
|
+
i && a && r.set(a, i);
|
|
26986
|
+
}
|
|
26987
|
+
return r;
|
|
26988
|
+
}
|
|
26989
|
+
function qn(e) {
|
|
26990
|
+
let { groups: t, decisions: n } = e;
|
|
26991
|
+
for (let e of t) if (Kn({
|
|
26992
|
+
groupId: e.id,
|
|
26993
|
+
decisions: n
|
|
26994
|
+
})) for (let t of e.dependsOn) o(Kn({
|
|
26995
|
+
groupId: t,
|
|
26996
|
+
decisions: n
|
|
26997
|
+
}), { detail: `decision accepts group "${e.id}" but its dependency "${t}" is skipped` });
|
|
26998
|
+
}
|
|
26999
|
+
function G(e) {
|
|
27000
|
+
let { groups: t, decisions: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
27001
|
+
for (let e of t) if (Kn({
|
|
27002
|
+
groupId: e.id,
|
|
27003
|
+
decisions: n
|
|
27004
|
+
})) for (let t of [e.primary, ...e.companions]) Jn({
|
|
27005
|
+
node: t,
|
|
27006
|
+
sourceIds: r,
|
|
27007
|
+
instanceIds: i
|
|
27008
|
+
});
|
|
27009
|
+
return {
|
|
27010
|
+
sourceIds: r,
|
|
27011
|
+
instanceIds: i
|
|
27012
|
+
};
|
|
27013
|
+
}
|
|
27014
|
+
function Jn(e) {
|
|
27015
|
+
let { node: t, sourceIds: n, instanceIds: r } = e;
|
|
27016
|
+
t.change === "removed" ? t.instanceRef?.id && r.add(t.instanceRef.id) : t.sourceRef?.id && n.add(t.sourceRef.id);
|
|
27017
|
+
}
|
|
27018
|
+
//#endregion
|
|
27019
|
+
//#region src/v2019C1/extensions/lifecycle/instance/composed-functions.ts
|
|
27020
|
+
async function Yn(e, t) {
|
|
27021
|
+
let n = /* @__PURE__ */ new Set(), r = await e.any.getTree(t);
|
|
27022
|
+
return r && await Xn(e, r, n), n;
|
|
27023
|
+
}
|
|
27024
|
+
async function Xn(e, t, n) {
|
|
27025
|
+
if (t.tagName === "FunctionRef") {
|
|
27026
|
+
let r = await e.any.getAttribute(t, { name: "functionUuid" });
|
|
27027
|
+
r && n.add(r);
|
|
27028
|
+
}
|
|
27029
|
+
for (let r of t.tree) await Xn(e, r, n);
|
|
27030
|
+
}
|
|
27031
|
+
//#endregion
|
|
27032
|
+
//#region src/v2019C1/extensions/lifecycle/instance/find-instance.ts
|
|
27033
|
+
async function Zn(e, t) {
|
|
27034
|
+
let { targetParent: n, tagName: r, sourceUuid: i } = t;
|
|
27035
|
+
if (!i) return [];
|
|
27036
|
+
let a = await e.any.getTree(n);
|
|
27037
|
+
if (!a) return [];
|
|
27038
|
+
let o = [];
|
|
27039
|
+
return await Qn(e, {
|
|
27040
|
+
node: a,
|
|
27041
|
+
tagName: r,
|
|
27042
|
+
sourceUuid: i,
|
|
27043
|
+
out: o
|
|
27044
|
+
}), o;
|
|
27045
|
+
}
|
|
27046
|
+
async function Qn(e, t) {
|
|
27047
|
+
let { node: n, tagName: r, sourceUuid: i, out: a } = t;
|
|
27048
|
+
if (n.tagName === r && await e.any.getAttribute(n, { name: "templateUuid" }) === i) {
|
|
27049
|
+
a.push(n);
|
|
27050
|
+
return;
|
|
27051
|
+
}
|
|
27052
|
+
for (let t of n.tree) await Qn(e, {
|
|
27053
|
+
node: t,
|
|
27054
|
+
tagName: r,
|
|
27055
|
+
sourceUuid: i,
|
|
27056
|
+
out: a
|
|
27057
|
+
});
|
|
27058
|
+
}
|
|
27059
|
+
async function $n(e, t) {
|
|
27060
|
+
let [n] = await K(e, t);
|
|
27061
|
+
return n;
|
|
27062
|
+
}
|
|
27063
|
+
async function K(e, t) {
|
|
27064
|
+
let { tagName: n, sourceUuid: r } = t;
|
|
27065
|
+
if (!r) return [];
|
|
27066
|
+
let i = await e.any.getRecordsByTagName(n), a = [];
|
|
27067
|
+
for (let t of i) await e.any.getAttribute(t, { name: "templateUuid" }) === r && a.push(t);
|
|
27068
|
+
return a;
|
|
27069
|
+
}
|
|
27070
|
+
//#endregion
|
|
27071
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/satellite-reconcile.ts
|
|
27072
|
+
async function er(e, t) {
|
|
27073
|
+
let { sourceQuery: n, satelliteRefs: r, instanceSatelliteRefs: i, structure: a, accepted: o } = t;
|
|
27074
|
+
for (let t of r) {
|
|
27075
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await $n(e, {
|
|
27076
|
+
tagName: t.tagName,
|
|
27077
|
+
sourceUuid: r
|
|
27078
|
+
});
|
|
27079
|
+
if (i) {
|
|
27080
|
+
await U(e, {
|
|
27081
|
+
sourceQuery: n,
|
|
27082
|
+
sourceRootRef: t,
|
|
27083
|
+
instanceRootRef: i,
|
|
27084
|
+
accepted: o
|
|
27085
|
+
});
|
|
27086
|
+
continue;
|
|
27087
|
+
}
|
|
27088
|
+
if (o && t.id && !o.sourceIds.has(t.id)) continue;
|
|
27089
|
+
let s = await z(e, {
|
|
27090
|
+
sourceQuery: n,
|
|
27091
|
+
ref: t,
|
|
27092
|
+
targetParent: await H(n, t, a),
|
|
27093
|
+
strip: !1
|
|
27094
|
+
});
|
|
27095
|
+
s && await P(e, {
|
|
27096
|
+
mappings: s.mappings,
|
|
27097
|
+
mode: "stamp-template"
|
|
27098
|
+
});
|
|
27099
|
+
}
|
|
27100
|
+
for (let t of i ?? []) {
|
|
27101
|
+
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
27102
|
+
if (!r) continue;
|
|
27103
|
+
let [i] = await n.any.findByAttributes({
|
|
27104
|
+
tagName: t.tagName,
|
|
27105
|
+
attributes: { uuid: r }
|
|
27106
|
+
});
|
|
27107
|
+
i || o && t.id && !o.instanceIds.has(t.id) || (await O(e, { target: t })).length > 0 || await e.delete(t);
|
|
27108
|
+
}
|
|
27109
|
+
}
|
|
27110
|
+
//#endregion
|
|
27111
|
+
//#region src/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.constants.ts
|
|
27112
|
+
var tr = ["Variable", "BehaviorDescription"];
|
|
27113
|
+
//#endregion
|
|
27114
|
+
//#region src/v2019C1/extensions/lifecycle/cross-cutting/applied-satellites.ts
|
|
27115
|
+
async function q(e, t) {
|
|
27116
|
+
let { primaryRef: n } = t, r = await e.any.getTree(n);
|
|
27117
|
+
if (!r) return [];
|
|
27118
|
+
let i = /* @__PURE__ */ new Set(), o = [];
|
|
27119
|
+
nr({
|
|
27120
|
+
node: r,
|
|
27121
|
+
subtreeIds: i,
|
|
27122
|
+
targets: o
|
|
27123
|
+
});
|
|
27124
|
+
let s = /* @__PURE__ */ new Set(), c = [];
|
|
27125
|
+
for (let t of o) for (let n of tr) {
|
|
27126
|
+
let r = await k.query.findRefsPointingTo(e, {
|
|
27127
|
+
target: a(t),
|
|
27128
|
+
containerTagName: n
|
|
27129
|
+
});
|
|
27130
|
+
for (let { container: e } of r) !e || s.has(e.id) || i.has(e.id) || (s.add(e.id), c.push(a(e)));
|
|
27131
|
+
}
|
|
27132
|
+
return c;
|
|
27133
|
+
}
|
|
27134
|
+
function nr(e) {
|
|
27135
|
+
let { node: t, subtreeIds: n, targets: r } = e;
|
|
27136
|
+
n.add(t.id), t.attributes.some((e) => e.name === "uuid") && r.push(t);
|
|
27137
|
+
for (let e of t.tree) nr({
|
|
27138
|
+
node: e,
|
|
27139
|
+
subtreeIds: n,
|
|
27140
|
+
targets: r
|
|
27141
|
+
});
|
|
27142
|
+
}
|
|
27143
|
+
//#endregion
|
|
27144
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/cross-cutting-satellites.ts
|
|
27145
|
+
async function rr(e, t) {
|
|
27146
|
+
let { sourceQuery: n, primaryRef: r, instancePrimaryRef: i, structure: a, accepted: o } = t;
|
|
27147
|
+
await er(e, {
|
|
27148
|
+
sourceQuery: n,
|
|
27149
|
+
satelliteRefs: await q(n, { primaryRef: r }),
|
|
27150
|
+
instanceSatelliteRefs: i ? await q(e, { primaryRef: i }) : [],
|
|
27151
|
+
structure: a,
|
|
27152
|
+
accepted: o
|
|
27153
|
+
});
|
|
27154
|
+
}
|
|
27155
|
+
//#endregion
|
|
27156
|
+
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/resolve-target-structure.ts
|
|
27157
|
+
async function J(e, t) {
|
|
27158
|
+
let n = await e.getRecord(t);
|
|
27159
|
+
o(n, {
|
|
27160
|
+
key: "ELEMENT_NOT_FOUND",
|
|
27161
|
+
detail: `resolveTargetStructure: target parent not found: ${t.tagName}#${t.id}`
|
|
27162
|
+
});
|
|
27163
|
+
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 = {};
|
|
27164
|
+
return i && (c.Substation = i), a && (c.VoltageLevel = a), s && (c.Bay = s), c;
|
|
27165
|
+
}
|
|
27166
|
+
//#endregion
|
|
27167
|
+
//#region src/v2019C1/extensions/lifecycle/cross-cutting/clone-applied-satellites.ts
|
|
27168
|
+
async function ir(e, t) {
|
|
27169
|
+
let { sourceQuery: n, primaryRef: r, structure: i, strip: a = !0 } = t, o = await q(n, { primaryRef: r }), s = [];
|
|
27170
|
+
for (let t of o) {
|
|
27171
|
+
let r = await ar(e, n, t);
|
|
27172
|
+
if (r) {
|
|
27173
|
+
let i = await B(e, {
|
|
27174
|
+
sourceQuery: n,
|
|
27175
|
+
source: t,
|
|
27176
|
+
target: r,
|
|
27177
|
+
strip: !1
|
|
27178
|
+
});
|
|
27179
|
+
s.push(...i);
|
|
27180
|
+
continue;
|
|
27181
|
+
}
|
|
27182
|
+
let o = await z(e, {
|
|
27183
|
+
sourceQuery: n,
|
|
27184
|
+
ref: t,
|
|
27185
|
+
targetParent: await H(n, t, i),
|
|
27186
|
+
...a ? {} : { strip: !1 }
|
|
27187
|
+
});
|
|
27188
|
+
o && s.push(...o.mappings);
|
|
27189
|
+
}
|
|
27190
|
+
return s;
|
|
27191
|
+
}
|
|
27192
|
+
async function ar(e, t, n) {
|
|
27193
|
+
let r = await t.any.getRecord(n);
|
|
27194
|
+
if (!r) return;
|
|
27195
|
+
let i = await t.any.getAttribute(r, { name: "name" });
|
|
27196
|
+
if (!i) return;
|
|
27197
|
+
let [a] = await e.any.findByAttributes({
|
|
27198
|
+
tagName: n.tagName,
|
|
27199
|
+
attributes: { name: i }
|
|
27200
|
+
});
|
|
27201
|
+
return a ? {
|
|
27202
|
+
tagName: n.tagName,
|
|
27203
|
+
id: a.id
|
|
27204
|
+
} : void 0;
|
|
27205
|
+
}
|
|
27206
|
+
//#endregion
|
|
27207
|
+
//#region src/v2019C1/extensions/lifecycle/layers/function/clone-function.ts
|
|
27208
|
+
async function or(e, t) {
|
|
27209
|
+
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t, { recordMappings: s } = await V(e, {
|
|
26273
27210
|
sourceQuery: n,
|
|
26274
27211
|
ref: r,
|
|
26275
27212
|
targetParent: i,
|
|
@@ -26278,7 +27215,7 @@ async function At(e, t) {
|
|
|
26278
27215
|
scope: "root",
|
|
26279
27216
|
attributes: [...o]
|
|
26280
27217
|
} : !1,
|
|
26281
|
-
|
|
27218
|
+
retagRoot: {
|
|
26282
27219
|
from: "SubFunction",
|
|
26283
27220
|
to: "Function"
|
|
26284
27221
|
},
|
|
@@ -26286,184 +27223,666 @@ async function At(e, t) {
|
|
|
26286
27223
|
});
|
|
26287
27224
|
return s;
|
|
26288
27225
|
}
|
|
26289
|
-
async function
|
|
26290
|
-
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await
|
|
27226
|
+
async function Y(e, t) {
|
|
27227
|
+
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await sr(n, r), s = [];
|
|
26291
27228
|
for (let t of o) {
|
|
26292
|
-
if (await Pt(e, n, t)) continue;
|
|
26293
27229
|
let r = {
|
|
26294
27230
|
tagName: "FunctionCategory",
|
|
26295
27231
|
id: t
|
|
26296
|
-
};
|
|
26297
|
-
|
|
27232
|
+
}, o = await lr(e, n, t);
|
|
27233
|
+
if (o) {
|
|
27234
|
+
let t = await B(e, {
|
|
27235
|
+
sourceQuery: n,
|
|
27236
|
+
source: r,
|
|
27237
|
+
target: o,
|
|
27238
|
+
strip: !1
|
|
27239
|
+
});
|
|
27240
|
+
s.push(...t);
|
|
27241
|
+
continue;
|
|
27242
|
+
}
|
|
27243
|
+
let c = await z(e, {
|
|
26298
27244
|
sourceQuery: n,
|
|
26299
27245
|
ref: r,
|
|
26300
|
-
targetParent: await
|
|
27246
|
+
targetParent: await H(n, r, i),
|
|
26301
27247
|
...a ? {} : { strip: !1 }
|
|
26302
27248
|
});
|
|
27249
|
+
c && s.push(...c.mappings);
|
|
26303
27250
|
}
|
|
27251
|
+
return s;
|
|
26304
27252
|
}
|
|
26305
|
-
async function
|
|
26306
|
-
let n = await
|
|
27253
|
+
async function sr(e, t) {
|
|
27254
|
+
let n = await cr(e, t), r = /* @__PURE__ */ new Set();
|
|
26307
27255
|
for (let { container: e } of n) e && r.add(e.id);
|
|
26308
27256
|
return r;
|
|
26309
27257
|
}
|
|
26310
|
-
async function
|
|
26311
|
-
let n = await
|
|
27258
|
+
async function cr(e, t) {
|
|
27259
|
+
let n = await k.query.findRefsPointingTo(e, {
|
|
26312
27260
|
target: t,
|
|
26313
27261
|
containerTagName: "FunctionCategory"
|
|
26314
27262
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
26315
27263
|
for (let t of r) {
|
|
26316
|
-
let r = await
|
|
27264
|
+
let r = await k.query.findRefsPointingTo(e, {
|
|
26317
27265
|
target: {
|
|
26318
27266
|
tagName: "SubFunction",
|
|
26319
27267
|
id: t.id
|
|
26320
27268
|
},
|
|
26321
|
-
containerTagName: "FunctionCategory"
|
|
27269
|
+
containerTagName: "FunctionCategory"
|
|
27270
|
+
});
|
|
27271
|
+
n.push(...r);
|
|
27272
|
+
}
|
|
27273
|
+
return n;
|
|
27274
|
+
}
|
|
27275
|
+
async function lr(e, t, n) {
|
|
27276
|
+
let r = await t.getRecord({
|
|
27277
|
+
tagName: "FunctionCategory",
|
|
27278
|
+
id: n
|
|
27279
|
+
});
|
|
27280
|
+
if (!r) return;
|
|
27281
|
+
let i = await t.getAttribute(r, { name: "name" });
|
|
27282
|
+
if (!i) return;
|
|
27283
|
+
let [a] = await e.findByAttributes({
|
|
27284
|
+
tagName: "FunctionCategory",
|
|
27285
|
+
attributes: { name: i }
|
|
27286
|
+
});
|
|
27287
|
+
return a ? {
|
|
27288
|
+
tagName: "FunctionCategory",
|
|
27289
|
+
id: a.id
|
|
27290
|
+
} : void 0;
|
|
27291
|
+
}
|
|
27292
|
+
//#endregion
|
|
27293
|
+
//#region src/v2019C1/extensions/lifecycle/layers/function/satellites.constants.ts
|
|
27294
|
+
var ur = ["FunctionCategory"];
|
|
27295
|
+
//#endregion
|
|
27296
|
+
//#region src/v2019C1/extensions/lifecycle/layers/function/satellites.ts
|
|
27297
|
+
async function X(e, t) {
|
|
27298
|
+
let { primaryRef: n } = t, r = [n], { SubFunction: i = [] } = await e.findDescendants(n, { collect: "SubFunction" });
|
|
27299
|
+
for (let e of i) r.push({
|
|
27300
|
+
tagName: "SubFunction",
|
|
27301
|
+
id: e.id
|
|
27302
|
+
});
|
|
27303
|
+
let o = /* @__PURE__ */ new Set(), s = [];
|
|
27304
|
+
for (let t of r) for (let n of ur) {
|
|
27305
|
+
let r = await k.query.findRefsPointingTo(e, {
|
|
27306
|
+
target: t,
|
|
27307
|
+
containerTagName: n
|
|
27308
|
+
});
|
|
27309
|
+
for (let { container: e } of r) !e || o.has(e.id) || (o.add(e.id), s.push(a(e)));
|
|
27310
|
+
}
|
|
27311
|
+
return s;
|
|
27312
|
+
}
|
|
27313
|
+
//#endregion
|
|
27314
|
+
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/fsd.ts
|
|
27315
|
+
async function dr(e, t) {
|
|
27316
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, overrides: a } = t, { recordMappings: o } = await V(e, {
|
|
27317
|
+
sourceQuery: n,
|
|
27318
|
+
ref: r,
|
|
27319
|
+
targetParent: i,
|
|
27320
|
+
strip: !1,
|
|
27321
|
+
retagRoot: i.tagName === "Function" || i.tagName === "SubFunction" ? {
|
|
27322
|
+
from: "Function",
|
|
27323
|
+
to: "SubFunction"
|
|
27324
|
+
} : void 0
|
|
27325
|
+
}), s = await J(e, i), c = await Y(e, {
|
|
27326
|
+
sourceQuery: n,
|
|
27327
|
+
functionRef: r,
|
|
27328
|
+
structure: s,
|
|
27329
|
+
stripCategoriesUuid: !1
|
|
27330
|
+
}), l = await ir(e, {
|
|
27331
|
+
sourceQuery: n,
|
|
27332
|
+
primaryRef: r,
|
|
27333
|
+
structure: s,
|
|
27334
|
+
strip: !1
|
|
27335
|
+
});
|
|
27336
|
+
await P(e, {
|
|
27337
|
+
mappings: [
|
|
27338
|
+
...o,
|
|
27339
|
+
...c,
|
|
27340
|
+
...l
|
|
27341
|
+
],
|
|
27342
|
+
mode: "stamp-template"
|
|
27343
|
+
});
|
|
27344
|
+
let u = o.find((e) => e.source.id === r.id);
|
|
27345
|
+
if (!u) throw Error(`instantiate.fsd: cloned root not found for ${r.tagName}#${r.id}`);
|
|
27346
|
+
let d = u.target;
|
|
27347
|
+
return await R(e, {
|
|
27348
|
+
ref: d,
|
|
27349
|
+
parentRef: i,
|
|
27350
|
+
overrides: a?.get(r.id)
|
|
27351
|
+
}), await lt(e, {
|
|
27352
|
+
sourceQuery: n,
|
|
27353
|
+
targetRoot: d,
|
|
27354
|
+
fileType: "FSD"
|
|
27355
|
+
}), {
|
|
27356
|
+
functionRef: d,
|
|
27357
|
+
recordMappings: o
|
|
27358
|
+
};
|
|
27359
|
+
}
|
|
27360
|
+
//#endregion
|
|
27361
|
+
//#region src/v2019C1/extensions/lifecycle/layers/application/clone-application.ts
|
|
27362
|
+
async function fr(e, t) {
|
|
27363
|
+
let { sourceQuery: n, applicationRef: r, structure: i, omit: a } = t, o = /* @__PURE__ */ new Map(), s = [], c = await Nn(e, {
|
|
27364
|
+
sourceQuery: n,
|
|
27365
|
+
scopeRef: r,
|
|
27366
|
+
refTagName: "FunctionRef",
|
|
27367
|
+
targetTagName: "Function"
|
|
27368
|
+
});
|
|
27369
|
+
for (let t of c) {
|
|
27370
|
+
let r = await or(e, {
|
|
27371
|
+
sourceQuery: n,
|
|
27372
|
+
functionRef: t,
|
|
27373
|
+
targetParentRef: await H(n, t, i),
|
|
27374
|
+
omit: a
|
|
27375
|
+
});
|
|
27376
|
+
s.push(...r);
|
|
27377
|
+
for (let e of r) e.source.id && o.set(e.source.id, e.target);
|
|
27378
|
+
}
|
|
27379
|
+
for (let t of c) {
|
|
27380
|
+
let r = await Y(e, {
|
|
27381
|
+
sourceQuery: n,
|
|
27382
|
+
functionRef: t,
|
|
27383
|
+
structure: i,
|
|
27384
|
+
stripCategoriesUuid: !1
|
|
27385
|
+
});
|
|
27386
|
+
s.push(...r);
|
|
27387
|
+
}
|
|
27388
|
+
let l = await pr(e, {
|
|
27389
|
+
sourceQuery: n,
|
|
27390
|
+
applicationRef: r
|
|
27391
|
+
});
|
|
27392
|
+
for (let e of l) o.set(e.sourceId, e.existingRef);
|
|
27393
|
+
let u = new Set(["FunctionRef", "FunctionCategoryRef"]), d = await Fn(e, {
|
|
27394
|
+
sourceQuery: n,
|
|
27395
|
+
scopeTagName: "Application",
|
|
27396
|
+
scopeRef: r,
|
|
27397
|
+
resolveTargetParent: In({
|
|
27398
|
+
sourceQuery: n,
|
|
27399
|
+
structure: i,
|
|
27400
|
+
cloneIndex: o
|
|
27401
|
+
}),
|
|
27402
|
+
alreadyCloned: new Set(o.keys()),
|
|
27403
|
+
skip: u,
|
|
27404
|
+
omit: a
|
|
27405
|
+
});
|
|
27406
|
+
s.push(...d);
|
|
27407
|
+
let f = await z(e, {
|
|
27408
|
+
sourceQuery: n,
|
|
27409
|
+
ref: r,
|
|
27410
|
+
targetParent: await H(n, r, i),
|
|
27411
|
+
omit: a
|
|
27412
|
+
});
|
|
27413
|
+
f && s.push(...f.mappings);
|
|
27414
|
+
for (let t of l) {
|
|
27415
|
+
let n = await e.findByAttributes({
|
|
27416
|
+
tagName: "AllocationRoleRef",
|
|
27417
|
+
attributes: { allocationRoleUuid: t.sourceUuid }
|
|
27418
|
+
});
|
|
27419
|
+
for (let r of n) await e.update({
|
|
27420
|
+
tagName: "AllocationRoleRef",
|
|
27421
|
+
id: r.id
|
|
27422
|
+
}, { attributes: { allocationRoleUuid: t.existingUuid } });
|
|
27423
|
+
}
|
|
27424
|
+
return s;
|
|
27425
|
+
}
|
|
27426
|
+
async function pr(e, t) {
|
|
27427
|
+
let { sourceQuery: n, applicationRef: r } = t, { AllocationRoleRef: i = [] } = await n.findDescendants(r, { collect: "AllocationRoleRef" }), a = [], o = /* @__PURE__ */ new Set();
|
|
27428
|
+
for (let t of i) {
|
|
27429
|
+
let r = t.attributes.find((e) => e.name === "allocationRoleUuid")?.value;
|
|
27430
|
+
if (!r || o.has(r)) continue;
|
|
27431
|
+
o.add(r);
|
|
27432
|
+
let [i] = await n.findByAttributes({
|
|
27433
|
+
tagName: "AllocationRole",
|
|
27434
|
+
attributes: { uuid: r }
|
|
27435
|
+
});
|
|
27436
|
+
if (!i) continue;
|
|
27437
|
+
let s = i.attributes.find((e) => e.name === "name")?.value;
|
|
27438
|
+
if (!s) continue;
|
|
27439
|
+
let [c] = await e.findByAttributes({
|
|
27440
|
+
tagName: "AllocationRole",
|
|
27441
|
+
attributes: { name: s }
|
|
27442
|
+
});
|
|
27443
|
+
if (!c) continue;
|
|
27444
|
+
let l = c.attributes.find((e) => e.name === "uuid")?.value;
|
|
27445
|
+
if (!l) continue;
|
|
27446
|
+
let u = {
|
|
27447
|
+
tagName: "AllocationRole",
|
|
27448
|
+
id: c.id
|
|
27449
|
+
};
|
|
27450
|
+
await B(e, {
|
|
27451
|
+
sourceQuery: n,
|
|
27452
|
+
source: {
|
|
27453
|
+
tagName: "AllocationRole",
|
|
27454
|
+
id: i.id
|
|
27455
|
+
},
|
|
27456
|
+
target: u,
|
|
27457
|
+
strip: !1
|
|
27458
|
+
}), a.push({
|
|
27459
|
+
sourceId: i.id,
|
|
27460
|
+
sourceUuid: r,
|
|
27461
|
+
existingRef: u,
|
|
27462
|
+
existingUuid: l
|
|
27463
|
+
});
|
|
27464
|
+
}
|
|
27465
|
+
return a;
|
|
27466
|
+
}
|
|
27467
|
+
//#endregion
|
|
27468
|
+
//#region src/v2019C1/extensions/lifecycle/layers/application/satellites.constants.ts
|
|
27469
|
+
var mr = [{
|
|
27470
|
+
refTag: "AllocationRoleRef",
|
|
27471
|
+
uuidAttr: "allocationRoleUuid",
|
|
27472
|
+
targetTag: "AllocationRole"
|
|
27473
|
+
}];
|
|
27474
|
+
//#endregion
|
|
27475
|
+
//#region src/v2019C1/extensions/lifecycle/layers/application/satellites.ts
|
|
27476
|
+
async function Z(e, t) {
|
|
27477
|
+
let { applicationRef: n } = t, r = await e.any.getTree(n);
|
|
27478
|
+
if (!r) return [];
|
|
27479
|
+
let i = /* @__PURE__ */ new Set(), o = [];
|
|
27480
|
+
for (let t of mr) {
|
|
27481
|
+
let n = /* @__PURE__ */ new Set();
|
|
27482
|
+
await hr(e, {
|
|
27483
|
+
node: r,
|
|
27484
|
+
refTag: t.refTag,
|
|
27485
|
+
uuidAttr: t.uuidAttr,
|
|
27486
|
+
out: n
|
|
27487
|
+
});
|
|
27488
|
+
for (let r of n) {
|
|
27489
|
+
let [n] = await e.any.findByAttributes({
|
|
27490
|
+
tagName: t.targetTag,
|
|
27491
|
+
attributes: { uuid: r }
|
|
27492
|
+
});
|
|
27493
|
+
!n || i.has(n.id) || (i.add(n.id), o.push(a(n)));
|
|
27494
|
+
}
|
|
27495
|
+
}
|
|
27496
|
+
return o;
|
|
27497
|
+
}
|
|
27498
|
+
async function hr(e, t) {
|
|
27499
|
+
let { node: n, refTag: r, uuidAttr: i, out: a } = t;
|
|
27500
|
+
if (n.tagName === r) {
|
|
27501
|
+
let t = await e.any.getAttribute(n, { name: i });
|
|
27502
|
+
t && a.add(t);
|
|
27503
|
+
}
|
|
27504
|
+
for (let t of n.tree) await hr(e, {
|
|
27505
|
+
node: t,
|
|
27506
|
+
refTag: r,
|
|
27507
|
+
uuidAttr: i,
|
|
27508
|
+
out: a
|
|
27509
|
+
});
|
|
27510
|
+
}
|
|
27511
|
+
//#endregion
|
|
27512
|
+
//#region src/v2019C1/extensions/lifecycle/instantiate/transaction/asd.ts
|
|
27513
|
+
async function gr(e, t) {
|
|
27514
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, overrides: a } = t, o = await J(e, i), s = await Nn(e, {
|
|
27515
|
+
sourceQuery: n,
|
|
27516
|
+
scopeRef: r,
|
|
27517
|
+
refTagName: "FunctionRef",
|
|
27518
|
+
targetTagName: "Function"
|
|
27519
|
+
}), c = await fr(e, {
|
|
27520
|
+
sourceQuery: n,
|
|
27521
|
+
applicationRef: r,
|
|
27522
|
+
structure: o
|
|
27523
|
+
}), l = await ir(e, {
|
|
27524
|
+
sourceQuery: n,
|
|
27525
|
+
primaryRef: r,
|
|
27526
|
+
structure: o,
|
|
27527
|
+
strip: !1
|
|
27528
|
+
});
|
|
27529
|
+
await P(e, {
|
|
27530
|
+
mappings: [...c, ...l],
|
|
27531
|
+
mode: "stamp-template"
|
|
27532
|
+
});
|
|
27533
|
+
for (let t of s) {
|
|
27534
|
+
let r = c.find((e) => e.source.id === t.id);
|
|
27535
|
+
if (!r) continue;
|
|
27536
|
+
let i = await H(n, t, o);
|
|
27537
|
+
await R(e, {
|
|
27538
|
+
ref: r.target,
|
|
27539
|
+
parentRef: i,
|
|
27540
|
+
overrides: a?.get(t.id)
|
|
27541
|
+
});
|
|
27542
|
+
}
|
|
27543
|
+
let u = c.find((e) => e.source.id === r.id);
|
|
27544
|
+
if (!u) throw Error(`instantiate.asd: cloned Application not found for ${r.id}`);
|
|
27545
|
+
let d = await H(n, r, o);
|
|
27546
|
+
await R(e, {
|
|
27547
|
+
ref: u.target,
|
|
27548
|
+
parentRef: d,
|
|
27549
|
+
overrides: a?.get(r.id)
|
|
27550
|
+
}), await lt(e, {
|
|
27551
|
+
sourceQuery: n,
|
|
27552
|
+
targetRoot: u.target,
|
|
27553
|
+
fileType: "ASD"
|
|
27554
|
+
});
|
|
27555
|
+
let f = s.map((e) => c.find((t) => t.source.id === e.id)?.target).filter((e) => !!e);
|
|
27556
|
+
return {
|
|
27557
|
+
applicationRef: u.target,
|
|
27558
|
+
composedFunctionRefs: f,
|
|
27559
|
+
recordMappings: c
|
|
27560
|
+
};
|
|
27561
|
+
}
|
|
27562
|
+
//#endregion
|
|
27563
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/function-satellites.ts
|
|
27564
|
+
async function _r(e, t) {
|
|
27565
|
+
let { sourceQuery: n, functionRef: r, instanceRef: i, targetParent: a, accepted: o } = t, s = await X(n, { primaryRef: r }), c = !1;
|
|
27566
|
+
for (let t of s) {
|
|
27567
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await $n(e, {
|
|
27568
|
+
tagName: t.tagName,
|
|
27569
|
+
sourceUuid: r
|
|
27570
|
+
});
|
|
27571
|
+
if (!i) {
|
|
27572
|
+
c = !0;
|
|
27573
|
+
continue;
|
|
27574
|
+
}
|
|
27575
|
+
await U(e, {
|
|
27576
|
+
sourceQuery: n,
|
|
27577
|
+
sourceRootRef: t,
|
|
27578
|
+
instanceRootRef: i,
|
|
27579
|
+
accepted: o
|
|
27580
|
+
});
|
|
27581
|
+
}
|
|
27582
|
+
c && (!o || o.sourceIds.has(r.id)) && await P(e, {
|
|
27583
|
+
mappings: await Y(e, {
|
|
27584
|
+
sourceQuery: n,
|
|
27585
|
+
functionRef: r,
|
|
27586
|
+
structure: await J(e, a),
|
|
27587
|
+
stripCategoriesUuid: !1
|
|
27588
|
+
}),
|
|
27589
|
+
mode: "stamp-template"
|
|
27590
|
+
});
|
|
27591
|
+
let l = await X(e, { primaryRef: {
|
|
27592
|
+
tagName: "Function",
|
|
27593
|
+
id: i.id
|
|
27594
|
+
} });
|
|
27595
|
+
for (let t of l) {
|
|
27596
|
+
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
27597
|
+
if (!r) continue;
|
|
27598
|
+
let [i] = await n.any.findByAttributes({
|
|
27599
|
+
tagName: t.tagName,
|
|
27600
|
+
attributes: { uuid: r }
|
|
27601
|
+
});
|
|
27602
|
+
i || o && t.id && !o.instanceIds.has(t.id) || (await O(e, { target: t })).length > 0 || await e.delete(t);
|
|
27603
|
+
}
|
|
27604
|
+
}
|
|
27605
|
+
//#endregion
|
|
27606
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/fsd.ts
|
|
27607
|
+
async function vr(e, t) {
|
|
27608
|
+
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, {
|
|
27609
|
+
targetParent: i,
|
|
27610
|
+
tagName: "Function",
|
|
27611
|
+
sourceUuid: c
|
|
27612
|
+
}), u = o?.groups ?? [];
|
|
27613
|
+
if (l.length === 0) {
|
|
27614
|
+
let t = s ? G({
|
|
27615
|
+
groups: u,
|
|
27616
|
+
decisions: s
|
|
27617
|
+
}) : void 0, a = s ? W({
|
|
27618
|
+
groups: u,
|
|
27619
|
+
decisions: s
|
|
27620
|
+
}) : void 0;
|
|
27621
|
+
if (t && !t.sourceIds.has(r.id)) return [];
|
|
27622
|
+
let { functionRef: o } = await dr(e, {
|
|
27623
|
+
sourceQuery: n,
|
|
27624
|
+
functionRef: r,
|
|
27625
|
+
targetParent: i,
|
|
27626
|
+
overrides: a
|
|
27627
|
+
});
|
|
27628
|
+
return [o];
|
|
27629
|
+
}
|
|
27630
|
+
let d = await J(e, i);
|
|
27631
|
+
for (let t of l) {
|
|
27632
|
+
let { instanceAccepted: a, instanceOverrides: o } = yr({
|
|
27633
|
+
instanceId: t.id,
|
|
27634
|
+
groups: u,
|
|
27635
|
+
decisions: s
|
|
27636
|
+
});
|
|
27637
|
+
await U(e, {
|
|
27638
|
+
sourceQuery: n,
|
|
27639
|
+
sourceRootRef: r,
|
|
27640
|
+
instanceRootRef: t,
|
|
27641
|
+
accepted: a,
|
|
27642
|
+
overrides: o
|
|
27643
|
+
}), await _r(e, {
|
|
27644
|
+
sourceQuery: n,
|
|
27645
|
+
functionRef: r,
|
|
27646
|
+
instanceRef: t,
|
|
27647
|
+
targetParent: i,
|
|
27648
|
+
accepted: a
|
|
27649
|
+
}), await rr(e, {
|
|
27650
|
+
sourceQuery: n,
|
|
27651
|
+
primaryRef: r,
|
|
27652
|
+
instancePrimaryRef: {
|
|
27653
|
+
tagName: "Function",
|
|
27654
|
+
id: t.id
|
|
27655
|
+
},
|
|
27656
|
+
structure: d,
|
|
27657
|
+
accepted: a
|
|
26322
27658
|
});
|
|
26323
|
-
n.push(...r);
|
|
26324
27659
|
}
|
|
26325
|
-
return
|
|
27660
|
+
return l.map((e) => ({
|
|
27661
|
+
tagName: "Function",
|
|
27662
|
+
id: e.id
|
|
27663
|
+
}));
|
|
26326
27664
|
}
|
|
26327
|
-
|
|
26328
|
-
let r =
|
|
26329
|
-
|
|
26330
|
-
|
|
26331
|
-
|
|
26332
|
-
|
|
26333
|
-
let i =
|
|
26334
|
-
|
|
26335
|
-
|
|
26336
|
-
|
|
26337
|
-
|
|
26338
|
-
|
|
26339
|
-
|
|
27665
|
+
function yr(e) {
|
|
27666
|
+
let { instanceId: t, groups: n, decisions: r } = e;
|
|
27667
|
+
if (!r) return {
|
|
27668
|
+
instanceAccepted: void 0,
|
|
27669
|
+
instanceOverrides: void 0
|
|
27670
|
+
};
|
|
27671
|
+
let i = n.filter((e) => e.instanceScopeId === t);
|
|
27672
|
+
return {
|
|
27673
|
+
instanceAccepted: G({
|
|
27674
|
+
groups: i,
|
|
27675
|
+
decisions: r
|
|
27676
|
+
}),
|
|
27677
|
+
instanceOverrides: W({
|
|
27678
|
+
groups: i,
|
|
27679
|
+
decisions: r
|
|
27680
|
+
})
|
|
27681
|
+
};
|
|
26340
27682
|
}
|
|
26341
27683
|
//#endregion
|
|
26342
|
-
//#region src/v2019C1/extensions/
|
|
26343
|
-
|
|
26344
|
-
"
|
|
26345
|
-
|
|
26346
|
-
|
|
26347
|
-
|
|
26348
|
-
|
|
26349
|
-
|
|
26350
|
-
|
|
26351
|
-
|
|
26352
|
-
|
|
26353
|
-
|
|
26354
|
-
|
|
26355
|
-
|
|
26356
|
-
|
|
26357
|
-
|
|
26358
|
-
|
|
26359
|
-
|
|
27684
|
+
//#region src/v2019C1/extensions/lifecycle/update/transaction/asd.ts
|
|
27685
|
+
async function br(e, t) {
|
|
27686
|
+
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, {
|
|
27687
|
+
tagName: "Application",
|
|
27688
|
+
sourceUuid: c
|
|
27689
|
+
}), u = o?.groups ?? [];
|
|
27690
|
+
if (l.length === 0) {
|
|
27691
|
+
let t = s ? G({
|
|
27692
|
+
groups: u,
|
|
27693
|
+
decisions: s
|
|
27694
|
+
}) : void 0, a = s ? W({
|
|
27695
|
+
groups: u,
|
|
27696
|
+
decisions: s
|
|
27697
|
+
}) : void 0;
|
|
27698
|
+
if (t && !t.sourceIds.has(r.id)) return {
|
|
27699
|
+
applications: [],
|
|
27700
|
+
functions: []
|
|
27701
|
+
};
|
|
27702
|
+
let { applicationRef: o, composedFunctionRefs: c } = await gr(e, {
|
|
26360
27703
|
sourceQuery: n,
|
|
26361
|
-
|
|
26362
|
-
|
|
26363
|
-
|
|
27704
|
+
applicationRef: r,
|
|
27705
|
+
targetParent: i,
|
|
27706
|
+
overrides: a
|
|
26364
27707
|
});
|
|
26365
|
-
|
|
27708
|
+
return {
|
|
27709
|
+
applications: [o],
|
|
27710
|
+
functions: c
|
|
27711
|
+
};
|
|
26366
27712
|
}
|
|
26367
|
-
|
|
26368
|
-
|
|
26369
|
-
|
|
26370
|
-
|
|
26371
|
-
|
|
26372
|
-
|
|
26373
|
-
|
|
26374
|
-
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
|
|
26378
|
-
|
|
27713
|
+
let d = await J(e, i), f = await Z(n, { applicationRef: r });
|
|
27714
|
+
for (let t of l) {
|
|
27715
|
+
let i = u.filter((e) => e.instanceScopeId === t.id), a = s ? G({
|
|
27716
|
+
groups: i,
|
|
27717
|
+
decisions: s
|
|
27718
|
+
}) : void 0, o = s ? W({
|
|
27719
|
+
groups: i,
|
|
27720
|
+
decisions: s
|
|
27721
|
+
}) : void 0, c = await Z(e, { applicationRef: {
|
|
27722
|
+
tagName: "Application",
|
|
27723
|
+
id: t.id
|
|
27724
|
+
} });
|
|
27725
|
+
await U(e, {
|
|
26379
27726
|
sourceQuery: n,
|
|
26380
|
-
|
|
26381
|
-
|
|
26382
|
-
|
|
26383
|
-
|
|
26384
|
-
|
|
26385
|
-
|
|
26386
|
-
|
|
27727
|
+
sourceRootRef: r,
|
|
27728
|
+
instanceRootRef: t,
|
|
27729
|
+
accepted: a,
|
|
27730
|
+
overrides: o
|
|
27731
|
+
}), await er(e, {
|
|
27732
|
+
sourceQuery: n,
|
|
27733
|
+
satelliteRefs: f,
|
|
27734
|
+
instanceSatelliteRefs: c,
|
|
27735
|
+
structure: d,
|
|
27736
|
+
accepted: a
|
|
27737
|
+
}), await rr(e, {
|
|
27738
|
+
sourceQuery: n,
|
|
27739
|
+
primaryRef: r,
|
|
27740
|
+
instancePrimaryRef: {
|
|
27741
|
+
tagName: "Application",
|
|
27742
|
+
id: t.id
|
|
27743
|
+
},
|
|
27744
|
+
structure: d,
|
|
27745
|
+
accepted: a
|
|
27746
|
+
});
|
|
27747
|
+
}
|
|
27748
|
+
let p = await xr(e, {
|
|
26387
27749
|
sourceQuery: n,
|
|
26388
|
-
|
|
26389
|
-
targetParent:
|
|
26390
|
-
|
|
27750
|
+
applicationRef: r,
|
|
27751
|
+
targetParent: i,
|
|
27752
|
+
scenario: a,
|
|
27753
|
+
report: o,
|
|
27754
|
+
decisions: s
|
|
26391
27755
|
});
|
|
27756
|
+
return {
|
|
27757
|
+
applications: l.map((e) => ({
|
|
27758
|
+
tagName: "Application",
|
|
27759
|
+
id: e.id
|
|
27760
|
+
})),
|
|
27761
|
+
functions: p
|
|
27762
|
+
};
|
|
26392
27763
|
}
|
|
26393
|
-
|
|
26394
|
-
|
|
26395
|
-
|
|
26396
|
-
let
|
|
26397
|
-
|
|
26398
|
-
|
|
26399
|
-
|
|
26400
|
-
|
|
27764
|
+
async function xr(e, t) {
|
|
27765
|
+
let { sourceQuery: n, applicationRef: r, targetParent: i, scenario: a, report: o, decisions: s } = t, c = await Yn(n, r);
|
|
27766
|
+
if (c.size === 0) return [];
|
|
27767
|
+
let l = await J(e, i), u = [];
|
|
27768
|
+
for (let t of c) {
|
|
27769
|
+
let [r] = await n.any.findByAttributes({
|
|
27770
|
+
tagName: "Function",
|
|
27771
|
+
attributes: { uuid: t }
|
|
27772
|
+
});
|
|
27773
|
+
if (!r) continue;
|
|
27774
|
+
let i = {
|
|
27775
|
+
tagName: "Function",
|
|
27776
|
+
id: r.id
|
|
27777
|
+
}, c = await vr(e, {
|
|
27778
|
+
sourceQuery: n,
|
|
27779
|
+
functionRef: i,
|
|
27780
|
+
targetParent: await H(n, i, l),
|
|
27781
|
+
scenario: a,
|
|
27782
|
+
report: o,
|
|
27783
|
+
decisions: s
|
|
27784
|
+
});
|
|
27785
|
+
u.push(...c);
|
|
26401
27786
|
}
|
|
26402
|
-
return
|
|
26403
|
-
let n = r(e, "version") - r(t, "version");
|
|
26404
|
-
return n === 0 ? r(e, "revision") - r(t, "revision") : n;
|
|
26405
|
-
});
|
|
27787
|
+
return u;
|
|
26406
27788
|
}
|
|
26407
27789
|
//#endregion
|
|
26408
|
-
//#region src/v2019C1/extensions/
|
|
26409
|
-
|
|
26410
|
-
|
|
27790
|
+
//#region src/v2019C1/extensions/lifecycle/update/index.ts
|
|
27791
|
+
var Sr = /* @__PURE__ */ c({
|
|
27792
|
+
asd: () => br,
|
|
27793
|
+
fsd: () => vr
|
|
27794
|
+
});
|
|
27795
|
+
//#endregion
|
|
27796
|
+
//#region src/v2019C1/extensions/lifecycle/apply/apply.ts
|
|
27797
|
+
async function Cr(e, t) {
|
|
27798
|
+
let { report: n, decisions: r } = t;
|
|
27799
|
+
return r ? (qn({
|
|
27800
|
+
groups: n.groups,
|
|
27801
|
+
decisions: r
|
|
27802
|
+
}), {
|
|
27803
|
+
report: n,
|
|
27804
|
+
instances: await Tr(e, t, n, r)
|
|
27805
|
+
}) : n.needsDecisions ? {
|
|
27806
|
+
report: n,
|
|
27807
|
+
instances: wr(t.verb)
|
|
27808
|
+
} : {
|
|
27809
|
+
report: n,
|
|
27810
|
+
instances: await Tr(e, t, n, void 0)
|
|
27811
|
+
};
|
|
27812
|
+
}
|
|
27813
|
+
function wr(e) {
|
|
27814
|
+
return e === "fsd" ? {
|
|
27815
|
+
verb: "fsd",
|
|
27816
|
+
functions: []
|
|
27817
|
+
} : {
|
|
27818
|
+
verb: "asd",
|
|
27819
|
+
applications: [],
|
|
27820
|
+
functions: []
|
|
27821
|
+
};
|
|
27822
|
+
}
|
|
27823
|
+
async function Tr(e, t, n, r) {
|
|
27824
|
+
if (t.verb === "fsd") return {
|
|
27825
|
+
verb: "fsd",
|
|
27826
|
+
functions: await vr(e, {
|
|
27827
|
+
sourceQuery: t.sourceQuery,
|
|
27828
|
+
functionRef: t.ref,
|
|
27829
|
+
targetParent: t.anchor,
|
|
27830
|
+
scenario: t.scenario,
|
|
27831
|
+
report: n,
|
|
27832
|
+
decisions: r
|
|
27833
|
+
})
|
|
27834
|
+
};
|
|
27835
|
+
let { applications: i, functions: a } = await br(e, {
|
|
27836
|
+
sourceQuery: t.sourceQuery,
|
|
27837
|
+
applicationRef: t.ref,
|
|
27838
|
+
targetParent: t.anchor,
|
|
27839
|
+
scenario: t.scenario,
|
|
27840
|
+
report: n,
|
|
27841
|
+
decisions: r
|
|
27842
|
+
});
|
|
27843
|
+
return {
|
|
27844
|
+
verb: "asd",
|
|
27845
|
+
applications: i,
|
|
27846
|
+
functions: a
|
|
27847
|
+
};
|
|
26411
27848
|
}
|
|
26412
27849
|
//#endregion
|
|
26413
|
-
//#region src/v2019C1/extensions/
|
|
26414
|
-
|
|
26415
|
-
|
|
26416
|
-
|
|
26417
|
-
}
|
|
27850
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/ensure-substation-structure.ts
|
|
27851
|
+
async function Er(e) {
|
|
27852
|
+
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
27853
|
+
tagName: "Substation",
|
|
27854
|
+
attributes: { name: "TEMPLATE" }
|
|
27855
|
+
}), r = await e.ensureChild(n, {
|
|
27856
|
+
tagName: "VoltageLevel",
|
|
27857
|
+
attributes: { name: "TEMPLATE" }
|
|
27858
|
+
});
|
|
27859
|
+
return {
|
|
27860
|
+
Substation: n,
|
|
27861
|
+
VoltageLevel: r,
|
|
27862
|
+
Bay: await e.ensureChild(r, {
|
|
27863
|
+
tagName: "Bay",
|
|
27864
|
+
attributes: { name: "TEMPLATE" }
|
|
27865
|
+
})
|
|
27866
|
+
};
|
|
27867
|
+
}
|
|
26418
27868
|
//#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
|
-
} });
|
|
27869
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/post-extraction-cleanup.ts
|
|
27870
|
+
async function Dr(e) {
|
|
27871
|
+
await A.transaction.orphanUuidRefs(e), await A.transaction.resetLNode(e), await A.transaction.pruneEmptyContainers(e);
|
|
26455
27872
|
}
|
|
26456
27873
|
//#endregion
|
|
26457
|
-
//#region src/v2019C1/extensions/
|
|
26458
|
-
var
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
|
|
27874
|
+
//#region src/v2019C1/extensions/lifecycle/layers/omit-filters.ts
|
|
27875
|
+
var Or = [
|
|
27876
|
+
"FunctionSclRef",
|
|
27877
|
+
"ApplicationSclRef",
|
|
27878
|
+
"GeneralEquipment",
|
|
27879
|
+
"ConductingEquipment"
|
|
27880
|
+
];
|
|
26462
27881
|
//#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
|
|
27882
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/asd.ts
|
|
27883
|
+
async function kr(e, t) {
|
|
27884
|
+
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";
|
|
27885
|
+
await qt.transaction.addEntry(e, {
|
|
26467
27886
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
26468
27887
|
header: {
|
|
26469
27888
|
fileType: "ASD",
|
|
@@ -26476,16 +27895,17 @@ async function Bt(e, t) {
|
|
|
26476
27895
|
what: "ASD initialization",
|
|
26477
27896
|
why: "Application was extracted from a previous file"
|
|
26478
27897
|
}
|
|
26479
|
-
}), await
|
|
27898
|
+
}), await fr(e, {
|
|
26480
27899
|
sourceQuery: n,
|
|
26481
27900
|
applicationRef: r,
|
|
26482
|
-
structure: s
|
|
26483
|
-
|
|
27901
|
+
structure: s,
|
|
27902
|
+
omit: Or
|
|
27903
|
+
}), await Dr(e);
|
|
26484
27904
|
}
|
|
26485
27905
|
//#endregion
|
|
26486
|
-
//#region src/v2019C1/extensions/
|
|
26487
|
-
var
|
|
26488
|
-
...
|
|
27906
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/omit.ts
|
|
27907
|
+
var Ar = [
|
|
27908
|
+
...Or,
|
|
26489
27909
|
"DOS",
|
|
26490
27910
|
"Labels",
|
|
26491
27911
|
"LNodeInputs",
|
|
@@ -26496,13 +27916,13 @@ var Vt = [
|
|
|
26496
27916
|
"Variable"
|
|
26497
27917
|
];
|
|
26498
27918
|
//#endregion
|
|
26499
|
-
//#region src/v2019C1/extensions/
|
|
26500
|
-
async function
|
|
26501
|
-
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await
|
|
27919
|
+
//#region src/v2019C1/extensions/lifecycle/extract/transaction/fsd.ts
|
|
27920
|
+
async function jr(e, t) {
|
|
27921
|
+
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await Er(e), c = {
|
|
26502
27922
|
tagName: s.Substation.tagName,
|
|
26503
27923
|
id: s.Substation.id
|
|
26504
27924
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
26505
|
-
await
|
|
27925
|
+
await qt.transaction.addEntry(e, {
|
|
26506
27926
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
26507
27927
|
header: {
|
|
26508
27928
|
fileType: "FSD",
|
|
@@ -26515,26 +27935,166 @@ async function Ht(e, t) {
|
|
|
26515
27935
|
what: "FSD initialization",
|
|
26516
27936
|
why: "Function was extracted from a previous file"
|
|
26517
27937
|
}
|
|
26518
|
-
}), await
|
|
27938
|
+
}), await or(e, {
|
|
26519
27939
|
sourceQuery: n,
|
|
26520
27940
|
functionRef: r,
|
|
26521
27941
|
targetParentRef: c,
|
|
26522
|
-
omit:
|
|
27942
|
+
omit: Ar,
|
|
26523
27943
|
stripRootAttributes: ["templateUuid"]
|
|
26524
|
-
}), await
|
|
27944
|
+
}), await Y(e, {
|
|
26525
27945
|
sourceQuery: n,
|
|
26526
27946
|
functionRef: r,
|
|
26527
27947
|
structure: s
|
|
26528
|
-
}), await
|
|
27948
|
+
}), await Dr(e);
|
|
27949
|
+
}
|
|
27950
|
+
//#endregion
|
|
27951
|
+
//#region src/v2019C1/extensions/lifecycle/extract/index.ts
|
|
27952
|
+
var Mr = /* @__PURE__ */ c({
|
|
27953
|
+
asd: () => kr,
|
|
27954
|
+
ensureSubstationTemplateStructure: () => Er,
|
|
27955
|
+
fsd: () => jr
|
|
27956
|
+
}), Nr = /* @__PURE__ */ c({
|
|
27957
|
+
asd: () => gr,
|
|
27958
|
+
fsd: () => dr,
|
|
27959
|
+
resolveTargetStructure: () => J
|
|
27960
|
+
});
|
|
27961
|
+
//#endregion
|
|
27962
|
+
//#region src/v2019C1/extensions/lifecycle/report/mark-placement-conflicts.ts
|
|
27963
|
+
async function Pr(e, t, n) {
|
|
27964
|
+
if (t.scenario === "instantiate") for (let r of n.groups) {
|
|
27965
|
+
if (r.change !== "added") continue;
|
|
27966
|
+
let i = r.primary.sourceRef;
|
|
27967
|
+
if (!i) continue;
|
|
27968
|
+
let a = await t.sourceQuery.getAttributes(i), o = a.uuid;
|
|
27969
|
+
if (!o) continue;
|
|
27970
|
+
let s = r.primary.tagName, [c] = await K(e, {
|
|
27971
|
+
tagName: s,
|
|
27972
|
+
sourceUuid: o
|
|
27973
|
+
});
|
|
27974
|
+
if (!c) continue;
|
|
27975
|
+
let l = await e.findAncestors({
|
|
27976
|
+
tagName: c.tagName,
|
|
27977
|
+
id: c.id
|
|
27978
|
+
}), u, d = null;
|
|
27979
|
+
for (let t of l) {
|
|
27980
|
+
let n = {
|
|
27981
|
+
tagName: t.tagName,
|
|
27982
|
+
id: t.id
|
|
27983
|
+
}, r = await L(e, {
|
|
27984
|
+
parentRef: n,
|
|
27985
|
+
childTag: s,
|
|
27986
|
+
candidate: a
|
|
27987
|
+
});
|
|
27988
|
+
if (r) {
|
|
27989
|
+
u = n, d = r;
|
|
27990
|
+
break;
|
|
27991
|
+
}
|
|
27992
|
+
}
|
|
27993
|
+
if (!d || !u) continue;
|
|
27994
|
+
let f = d.fields.find((e) => bn(I(s, e)));
|
|
27995
|
+
if (f) {
|
|
27996
|
+
let t = await kn(e, {
|
|
27997
|
+
parentRef: u,
|
|
27998
|
+
childTag: s,
|
|
27999
|
+
candidate: a,
|
|
28000
|
+
attr: f
|
|
28001
|
+
}), n = r.editableAttributes?.find((e) => e.attr === f);
|
|
28002
|
+
n && (n.conflict = !0, n.suggestedValue = t);
|
|
28003
|
+
} else r.conflict = {
|
|
28004
|
+
fields: d.fields,
|
|
28005
|
+
adoptTargetId: d.offendingId
|
|
28006
|
+
}, n.needsDecisions = !0;
|
|
28007
|
+
}
|
|
28008
|
+
}
|
|
28009
|
+
//#endregion
|
|
28010
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/satellite-companions.ts
|
|
28011
|
+
async function Fr(e, t) {
|
|
28012
|
+
let { sourceQuery: n, primaryRef: r, satelliteRefs: i, instanceSatelliteRefs: a, report: o } = t, s = o.groups.find((e) => e.primary.sourceRef?.id === r.id);
|
|
28013
|
+
if (!s) return o;
|
|
28014
|
+
for (let t of i) {
|
|
28015
|
+
let { uuid: r } = await n.any.getAttributes(t), i = await sn({
|
|
28016
|
+
sourceQuery: n,
|
|
28017
|
+
targetQuery: e,
|
|
28018
|
+
sourceRootRef: t,
|
|
28019
|
+
instanceRootRef: await $n(e, {
|
|
28020
|
+
tagName: t.tagName,
|
|
28021
|
+
sourceUuid: r
|
|
28022
|
+
})
|
|
28023
|
+
});
|
|
28024
|
+
i.root.change !== "unchanged" && s.companions.push(i.root);
|
|
28025
|
+
}
|
|
28026
|
+
for (let t of a ?? []) {
|
|
28027
|
+
let { templateUuid: r } = await e.any.getAttributes(t);
|
|
28028
|
+
if (!r) continue;
|
|
28029
|
+
let [i] = await n.any.findByAttributes({
|
|
28030
|
+
tagName: t.tagName,
|
|
28031
|
+
attributes: { uuid: r }
|
|
28032
|
+
});
|
|
28033
|
+
i || s.companions.push({
|
|
28034
|
+
change: "removed",
|
|
28035
|
+
tagName: t.tagName,
|
|
28036
|
+
instanceRef: t,
|
|
28037
|
+
children: []
|
|
28038
|
+
});
|
|
28039
|
+
}
|
|
28040
|
+
return o;
|
|
28041
|
+
}
|
|
28042
|
+
//#endregion
|
|
28043
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/cross-cutting-satellites.ts
|
|
28044
|
+
async function Ir(e, t) {
|
|
28045
|
+
let { sourceQuery: n, primaryRef: r, instancePrimaryRef: i, report: a } = t;
|
|
28046
|
+
return Fr(e, {
|
|
28047
|
+
sourceQuery: n,
|
|
28048
|
+
primaryRef: r,
|
|
28049
|
+
satelliteRefs: await q(n, { primaryRef: r }),
|
|
28050
|
+
instanceSatelliteRefs: i ? await q(e, { primaryRef: i }) : [],
|
|
28051
|
+
report: a
|
|
28052
|
+
});
|
|
28053
|
+
}
|
|
28054
|
+
//#endregion
|
|
28055
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-function-satellites.ts
|
|
28056
|
+
async function Lr(e, t) {
|
|
28057
|
+
let { sourceQuery: n, functionRef: r, instance: i, report: a } = t;
|
|
28058
|
+
return Fr(e, {
|
|
28059
|
+
sourceQuery: n,
|
|
28060
|
+
primaryRef: r,
|
|
28061
|
+
satelliteRefs: await X(n, { primaryRef: r }),
|
|
28062
|
+
instanceSatelliteRefs: i ? await X(e, { primaryRef: {
|
|
28063
|
+
tagName: "Function",
|
|
28064
|
+
id: i.id
|
|
28065
|
+
} }) : [],
|
|
28066
|
+
report: a
|
|
28067
|
+
});
|
|
28068
|
+
}
|
|
28069
|
+
//#endregion
|
|
28070
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-function.ts
|
|
28071
|
+
async function Q(e, t) {
|
|
28072
|
+
let { sourceQuery: n, functionRef: r, instance: i } = t, a = await sn({
|
|
28073
|
+
sourceQuery: n,
|
|
28074
|
+
targetQuery: e,
|
|
28075
|
+
sourceRootRef: r,
|
|
28076
|
+
instanceRootRef: i
|
|
28077
|
+
});
|
|
28078
|
+
if (!i) return a;
|
|
28079
|
+
let o = await Lr(e, {
|
|
28080
|
+
sourceQuery: n,
|
|
28081
|
+
functionRef: r,
|
|
28082
|
+
instance: i,
|
|
28083
|
+
report: a
|
|
28084
|
+
});
|
|
28085
|
+
return Ir(e, {
|
|
28086
|
+
sourceQuery: n,
|
|
28087
|
+
primaryRef: r,
|
|
28088
|
+
instancePrimaryRef: {
|
|
28089
|
+
tagName: "Function",
|
|
28090
|
+
id: i.id
|
|
28091
|
+
},
|
|
28092
|
+
report: o
|
|
28093
|
+
});
|
|
26529
28094
|
}
|
|
26530
28095
|
//#endregion
|
|
26531
|
-
//#region src/v2019C1/extensions/
|
|
26532
|
-
var
|
|
26533
|
-
deep: () => Ct,
|
|
26534
|
-
ensureSubstationTemplateStructure: () => J,
|
|
26535
|
-
toAsd: () => Bt,
|
|
26536
|
-
toFsd: () => Ht
|
|
26537
|
-
}) }, Wt = {
|
|
28096
|
+
//#region src/v2019C1/extensions/presentation/constants/title.ts
|
|
28097
|
+
var Rr = {
|
|
26538
28098
|
LNode: {
|
|
26539
28099
|
compact: [
|
|
26540
28100
|
"prefix",
|
|
@@ -26622,44 +28182,44 @@ var Ut = { transaction: /* @__PURE__ */ s({
|
|
|
26622
28182
|
};
|
|
26623
28183
|
//#endregion
|
|
26624
28184
|
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26625
|
-
async function
|
|
28185
|
+
async function $(e, t, n = {}) {
|
|
26626
28186
|
let r = await e.getRecord(t);
|
|
26627
28187
|
if (!r) return n.withLabels ? {
|
|
26628
28188
|
title: "",
|
|
26629
28189
|
labels: {}
|
|
26630
28190
|
} : "";
|
|
26631
|
-
let i = r.tagName, a = n.mode ?? "compact", o = await e.any.getAttributes(r), s =
|
|
28191
|
+
let i = r.tagName, a = n.mode ?? "compact", o = await e.any.getAttributes(r), s = Rr[i], c = zr({
|
|
26632
28192
|
tag: i,
|
|
26633
28193
|
spec: s,
|
|
26634
28194
|
mode: a,
|
|
26635
28195
|
attributes: o,
|
|
26636
|
-
specAttributes: s?.attributesFrom ? await
|
|
28196
|
+
specAttributes: s?.attributesFrom ? await Br(e, r, s.attributesFrom) : o,
|
|
26637
28197
|
value: r.value
|
|
26638
28198
|
});
|
|
26639
28199
|
return n.withLabels ? {
|
|
26640
28200
|
title: c,
|
|
26641
|
-
labels: await
|
|
28201
|
+
labels: await Vr(e, r)
|
|
26642
28202
|
} : c;
|
|
26643
28203
|
}
|
|
26644
|
-
function
|
|
28204
|
+
function zr(e) {
|
|
26645
28205
|
let { tag: t, spec: n, mode: r, attributes: i, specAttributes: a, value: o } = e;
|
|
26646
28206
|
if (n) {
|
|
26647
|
-
let e =
|
|
28207
|
+
let e = Wr(n, a, r);
|
|
26648
28208
|
if (e) return e;
|
|
26649
28209
|
}
|
|
26650
28210
|
let s = (o ?? "").trim();
|
|
26651
28211
|
if (s) return s;
|
|
26652
|
-
let c =
|
|
28212
|
+
let c = g[t]?.attributes?.identityFields, l = c?.find((e) => e === "name" || e === "id") ?? c?.[0];
|
|
26653
28213
|
return l && i[l] ? i[l] : i.name || t;
|
|
26654
28214
|
}
|
|
26655
|
-
async function
|
|
28215
|
+
async function Br(e, t, n) {
|
|
26656
28216
|
let [r] = await e.any.getChildren(t, n);
|
|
26657
28217
|
return r ? e.any.getAttributes(r) : {};
|
|
26658
28218
|
}
|
|
26659
|
-
async function
|
|
26660
|
-
return
|
|
28219
|
+
async function Vr(e, t) {
|
|
28220
|
+
return Ur(await Hr(e, t));
|
|
26661
28221
|
}
|
|
26662
|
-
async function
|
|
28222
|
+
async function Hr(e, t) {
|
|
26663
28223
|
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26664
28224
|
for (let t of r) {
|
|
26665
28225
|
let r = await e.any.getChildren(t, "Label");
|
|
@@ -26674,70 +28234,228 @@ async function Yt(e, t) {
|
|
|
26674
28234
|
}
|
|
26675
28235
|
return n;
|
|
26676
28236
|
}
|
|
26677
|
-
function
|
|
28237
|
+
function Ur(e) {
|
|
26678
28238
|
let t = {};
|
|
26679
28239
|
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26680
28240
|
return t;
|
|
26681
28241
|
}
|
|
26682
|
-
function
|
|
28242
|
+
function Wr(e, t, n) {
|
|
26683
28243
|
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26684
|
-
if (typeof i == "string") return
|
|
28244
|
+
if (typeof i == "string") return Gr(i, t);
|
|
26685
28245
|
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26686
28246
|
return o.length > 0 ? o.join(a) : "";
|
|
26687
28247
|
}
|
|
26688
|
-
function
|
|
28248
|
+
function Gr(e, t) {
|
|
26689
28249
|
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("/");
|
|
26690
28250
|
}
|
|
26691
28251
|
//#endregion
|
|
28252
|
+
//#region src/v2019C1/extensions/presentation/query/index.ts
|
|
28253
|
+
var Kr = /* @__PURE__ */ c({ extractElementTitle: () => $ });
|
|
28254
|
+
//#endregion
|
|
28255
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-asd.ts
|
|
28256
|
+
async function qr(e, t) {
|
|
28257
|
+
let { sourceQuery: n, applicationRef: r, scenario: i } = t, { uuid: a } = await n.getAttributes(r), o = i === "instantiate" ? [] : await K(e, {
|
|
28258
|
+
tagName: "Application",
|
|
28259
|
+
sourceUuid: a
|
|
28260
|
+
}), s = [];
|
|
28261
|
+
if (o.length === 0) s.push(await Jr(e, {
|
|
28262
|
+
sourceQuery: n,
|
|
28263
|
+
applicationRef: r,
|
|
28264
|
+
instance: void 0
|
|
28265
|
+
}));
|
|
28266
|
+
else for (let t of o) s.push(await Jr(e, {
|
|
28267
|
+
sourceQuery: n,
|
|
28268
|
+
applicationRef: r,
|
|
28269
|
+
instance: t
|
|
28270
|
+
}));
|
|
28271
|
+
let c = await Yr(e, {
|
|
28272
|
+
sourceQuery: n,
|
|
28273
|
+
applicationRef: r,
|
|
28274
|
+
scenario: i
|
|
28275
|
+
});
|
|
28276
|
+
return mn([...s, ...c]);
|
|
28277
|
+
}
|
|
28278
|
+
async function Jr(e, t) {
|
|
28279
|
+
let { sourceQuery: n, applicationRef: r, instance: i } = t, a = await sn({
|
|
28280
|
+
sourceQuery: n,
|
|
28281
|
+
targetQuery: e,
|
|
28282
|
+
sourceRootRef: r,
|
|
28283
|
+
instanceRootRef: i
|
|
28284
|
+
});
|
|
28285
|
+
if (await Fr(e, {
|
|
28286
|
+
sourceQuery: n,
|
|
28287
|
+
primaryRef: r,
|
|
28288
|
+
satelliteRefs: await Z(n, { applicationRef: r }),
|
|
28289
|
+
instanceSatelliteRefs: i ? await Z(e, { applicationRef: {
|
|
28290
|
+
tagName: "Application",
|
|
28291
|
+
id: i.id
|
|
28292
|
+
} }) : [],
|
|
28293
|
+
report: a
|
|
28294
|
+
}), await Ir(e, {
|
|
28295
|
+
sourceQuery: n,
|
|
28296
|
+
primaryRef: r,
|
|
28297
|
+
instancePrimaryRef: i ? {
|
|
28298
|
+
tagName: "Application",
|
|
28299
|
+
id: i.id
|
|
28300
|
+
} : void 0,
|
|
28301
|
+
report: a
|
|
28302
|
+
}), i) {
|
|
28303
|
+
let t = await $(e, i);
|
|
28304
|
+
for (let e of a.groups) e.instanceScopeTitle = t;
|
|
28305
|
+
}
|
|
28306
|
+
return a;
|
|
28307
|
+
}
|
|
28308
|
+
async function Yr(e, t) {
|
|
28309
|
+
let { sourceQuery: n, applicationRef: r, scenario: i } = t, a = await Yn(n, r), o = [];
|
|
28310
|
+
for (let t of a) {
|
|
28311
|
+
let [r] = await n.any.findByAttributes({
|
|
28312
|
+
tagName: "Function",
|
|
28313
|
+
attributes: { uuid: t }
|
|
28314
|
+
});
|
|
28315
|
+
if (!r) continue;
|
|
28316
|
+
let a = {
|
|
28317
|
+
tagName: "Function",
|
|
28318
|
+
id: r.id
|
|
28319
|
+
}, s = i === "instantiate" ? [] : await K(e, {
|
|
28320
|
+
tagName: "Function",
|
|
28321
|
+
sourceUuid: t
|
|
28322
|
+
});
|
|
28323
|
+
if (s.length === 0) {
|
|
28324
|
+
o.push(await Q(e, {
|
|
28325
|
+
sourceQuery: n,
|
|
28326
|
+
functionRef: a,
|
|
28327
|
+
instance: void 0
|
|
28328
|
+
}));
|
|
28329
|
+
continue;
|
|
28330
|
+
}
|
|
28331
|
+
for (let t of s) {
|
|
28332
|
+
let r = await Q(e, {
|
|
28333
|
+
sourceQuery: n,
|
|
28334
|
+
functionRef: a,
|
|
28335
|
+
instance: t
|
|
28336
|
+
}), i = await $(e, t);
|
|
28337
|
+
for (let e of r.groups) e.instanceScopeTitle = i;
|
|
28338
|
+
o.push(r);
|
|
28339
|
+
}
|
|
28340
|
+
}
|
|
28341
|
+
return o;
|
|
28342
|
+
}
|
|
28343
|
+
//#endregion
|
|
28344
|
+
//#region src/v2019C1/extensions/lifecycle/report/query/report-fsd.ts
|
|
28345
|
+
async function Xr(e, t) {
|
|
28346
|
+
let { sourceQuery: n, functionRef: r, targetParent: i, scenario: a } = t, { uuid: o } = await n.getAttributes(r), s = a === "instantiate" ? [] : await Zn(e, {
|
|
28347
|
+
targetParent: i,
|
|
28348
|
+
tagName: "Function",
|
|
28349
|
+
sourceUuid: o
|
|
28350
|
+
});
|
|
28351
|
+
if (s.length === 0) return Q(e, {
|
|
28352
|
+
sourceQuery: n,
|
|
28353
|
+
functionRef: r,
|
|
28354
|
+
instance: void 0
|
|
28355
|
+
});
|
|
28356
|
+
let c = [];
|
|
28357
|
+
for (let t of s) {
|
|
28358
|
+
let i = await Q(e, {
|
|
28359
|
+
sourceQuery: n,
|
|
28360
|
+
functionRef: r,
|
|
28361
|
+
instance: t
|
|
28362
|
+
}), a = await $(e, t);
|
|
28363
|
+
for (let e of i.groups) e.instanceScopeTitle = a;
|
|
28364
|
+
c.push(i);
|
|
28365
|
+
}
|
|
28366
|
+
return mn(c);
|
|
28367
|
+
}
|
|
28368
|
+
//#endregion
|
|
28369
|
+
//#region src/v2019C1/extensions/lifecycle/report/report.ts
|
|
28370
|
+
async function Zr(e, t) {
|
|
28371
|
+
let n = t.verb === "fsd" ? await Xr(e, {
|
|
28372
|
+
sourceQuery: t.sourceQuery,
|
|
28373
|
+
functionRef: t.ref,
|
|
28374
|
+
targetParent: t.anchor,
|
|
28375
|
+
scenario: t.scenario
|
|
28376
|
+
}) : await qr(e, {
|
|
28377
|
+
sourceQuery: t.sourceQuery,
|
|
28378
|
+
applicationRef: t.ref,
|
|
28379
|
+
scenario: t.scenario
|
|
28380
|
+
});
|
|
28381
|
+
for (let e of n.groups) e.editableAttributes = xn(e.primary.tagName);
|
|
28382
|
+
return await Pr(e, t, n), n;
|
|
28383
|
+
}
|
|
28384
|
+
//#endregion
|
|
28385
|
+
//#region src/v2019C1/extensions/lifecycle/report/presentation-scope.ts
|
|
28386
|
+
function Qr(e) {
|
|
28387
|
+
switch (e.verb) {
|
|
28388
|
+
case "fsd":
|
|
28389
|
+
case "asd": return {
|
|
28390
|
+
rootTag: "Substation",
|
|
28391
|
+
omit: [
|
|
28392
|
+
"DataTypeTemplates",
|
|
28393
|
+
"Communication",
|
|
28394
|
+
"IED"
|
|
28395
|
+
]
|
|
28396
|
+
};
|
|
28397
|
+
}
|
|
28398
|
+
}
|
|
28399
|
+
//#endregion
|
|
26692
28400
|
//#region src/v2019C1/extensions/index.ts
|
|
26693
|
-
var $
|
|
26694
|
-
cleanUp:
|
|
26695
|
-
dataModel:
|
|
26696
|
-
|
|
26697
|
-
|
|
26698
|
-
|
|
26699
|
-
|
|
26700
|
-
|
|
28401
|
+
var $r = {
|
|
28402
|
+
cleanUp: A,
|
|
28403
|
+
dataModel: Ht,
|
|
28404
|
+
history: qt,
|
|
28405
|
+
identity: Qt,
|
|
28406
|
+
lifecycle: {
|
|
28407
|
+
query: { report: Zr },
|
|
28408
|
+
transaction: {
|
|
28409
|
+
extract: Mr,
|
|
28410
|
+
instantiate: Nr,
|
|
28411
|
+
transplant: { deep: V },
|
|
28412
|
+
update: Sr,
|
|
28413
|
+
apply: Cr
|
|
28414
|
+
}
|
|
28415
|
+
},
|
|
28416
|
+
reference: k,
|
|
28417
|
+
signature: { query: kt },
|
|
28418
|
+
presentation: { query: Kr }
|
|
26701
28419
|
};
|
|
26702
28420
|
//#endregion
|
|
26703
28421
|
//#region src/v2019C1/hooks/after-created/private-wrapper.ts
|
|
26704
|
-
async function
|
|
28422
|
+
async function ei(e) {
|
|
26705
28423
|
let { childRecord: t, parentRecord: n, query: r } = e;
|
|
26706
|
-
if (t.namespace.prefix ===
|
|
26707
|
-
let i = n.tagName === "Private", a = n.namespace.prefix ===
|
|
28424
|
+
if (t.namespace.prefix === b.namespaces.default.prefix) return [];
|
|
28425
|
+
let i = n.tagName === "Private", a = n.namespace.prefix === b.namespaces.default.prefix;
|
|
26708
28426
|
if (!i && !a) return [];
|
|
26709
28427
|
let o = n.children.find((e) => e.tagName === "Private"), s = {
|
|
26710
28428
|
...n,
|
|
26711
28429
|
children: n.children.filter((e) => e.id !== t.id)
|
|
26712
28430
|
};
|
|
26713
|
-
return i ?
|
|
28431
|
+
return i ? ti({
|
|
26714
28432
|
parentRecord: n,
|
|
26715
28433
|
childRecord: t,
|
|
26716
28434
|
query: r
|
|
26717
|
-
}) : o ?
|
|
28435
|
+
}) : o ? ni({
|
|
26718
28436
|
existingPrivateRef: o,
|
|
26719
28437
|
parentRecord: n,
|
|
26720
28438
|
updatedParentRecord: s,
|
|
26721
28439
|
childRecord: t,
|
|
26722
28440
|
query: r
|
|
26723
|
-
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] :
|
|
28441
|
+
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] : ri({
|
|
26724
28442
|
parentRecord: n,
|
|
26725
28443
|
updatedParentRecord: s,
|
|
26726
28444
|
childRecord: t
|
|
26727
28445
|
});
|
|
26728
28446
|
}
|
|
26729
|
-
async function
|
|
26730
|
-
let { parentRecord: t, childRecord: n, query: r } = e,
|
|
26731
|
-
if (n.parent?.id ===
|
|
26732
|
-
let s = await
|
|
26733
|
-
privateId:
|
|
28447
|
+
async function ti(e) {
|
|
28448
|
+
let { parentRecord: t, childRecord: n, query: r } = e, a = t;
|
|
28449
|
+
if (n.parent?.id === a.id && n.parent?.tagName === "Private") return [];
|
|
28450
|
+
let s = await ii({
|
|
28451
|
+
privateId: a.id,
|
|
26734
28452
|
query: r
|
|
26735
28453
|
});
|
|
26736
|
-
|
|
28454
|
+
o(s, {
|
|
26737
28455
|
detail: "Latest private record not found",
|
|
26738
28456
|
key: "ELEMENT_NOT_FOUND"
|
|
26739
28457
|
});
|
|
26740
|
-
let { childRecord: c, privateRecord: l } =
|
|
28458
|
+
let { childRecord: c, privateRecord: l } = ai({
|
|
26741
28459
|
privateRecord: s,
|
|
26742
28460
|
childRecord: n
|
|
26743
28461
|
});
|
|
@@ -26751,23 +28469,23 @@ async function tn(e) {
|
|
|
26751
28469
|
newRecord: i(l)
|
|
26752
28470
|
}];
|
|
26753
28471
|
}
|
|
26754
|
-
async function
|
|
26755
|
-
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord:
|
|
28472
|
+
async function ni(e) {
|
|
28473
|
+
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: a, query: s } = e, c = await ii({
|
|
26756
28474
|
privateId: t.id,
|
|
26757
28475
|
query: s
|
|
26758
28476
|
});
|
|
26759
|
-
if (
|
|
28477
|
+
if (o(c, {
|
|
26760
28478
|
detail: "Latest private record not found",
|
|
26761
28479
|
key: "ELEMENT_NOT_FOUND"
|
|
26762
|
-
}), !c.attributes.some((e) => e.name === "type" && e.value ===
|
|
26763
|
-
let { childRecord: l, privateRecord: u } =
|
|
28480
|
+
}), !c.attributes.some((e) => e.name === "type" && e.value === a.namespace.prefix)) return [];
|
|
28481
|
+
let { childRecord: l, privateRecord: u } = ai({
|
|
26764
28482
|
privateRecord: c,
|
|
26765
|
-
childRecord:
|
|
28483
|
+
childRecord: a
|
|
26766
28484
|
});
|
|
26767
28485
|
return [
|
|
26768
28486
|
{
|
|
26769
28487
|
status: "updated",
|
|
26770
|
-
oldRecord: i(
|
|
28488
|
+
oldRecord: i(a),
|
|
26771
28489
|
newRecord: i(l)
|
|
26772
28490
|
},
|
|
26773
28491
|
{
|
|
@@ -26782,11 +28500,11 @@ async function nn(e) {
|
|
|
26782
28500
|
}
|
|
26783
28501
|
];
|
|
26784
28502
|
}
|
|
26785
|
-
function
|
|
28503
|
+
function ri(e) {
|
|
26786
28504
|
let { parentRecord: t, updatedParentRecord: n, childRecord: r } = e, a = {
|
|
26787
28505
|
id: crypto.randomUUID(),
|
|
26788
28506
|
tagName: "Private",
|
|
26789
|
-
namespace:
|
|
28507
|
+
namespace: b.namespaces.default,
|
|
26790
28508
|
attributes: [{
|
|
26791
28509
|
name: "type",
|
|
26792
28510
|
value: r.namespace.prefix
|
|
@@ -26831,14 +28549,14 @@ function rn(e) {
|
|
|
26831
28549
|
}
|
|
26832
28550
|
];
|
|
26833
28551
|
}
|
|
26834
|
-
async function
|
|
28552
|
+
async function ii(e) {
|
|
26835
28553
|
let { privateId: t, query: n } = e;
|
|
26836
28554
|
return await n.getRecord({
|
|
26837
28555
|
id: t,
|
|
26838
28556
|
tagName: "Private"
|
|
26839
28557
|
});
|
|
26840
28558
|
}
|
|
26841
|
-
function
|
|
28559
|
+
function ai(e) {
|
|
26842
28560
|
let { privateRecord: t, childRecord: n } = e;
|
|
26843
28561
|
return {
|
|
26844
28562
|
childRecord: {
|
|
@@ -26859,16 +28577,16 @@ function on(e) {
|
|
|
26859
28577
|
}
|
|
26860
28578
|
//#endregion
|
|
26861
28579
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
26862
|
-
async function
|
|
28580
|
+
async function oi(e) {
|
|
26863
28581
|
let { uuid: t, entry: r, target: a, query: o } = e;
|
|
26864
|
-
if (!n(r.refTagName,
|
|
28582
|
+
if (!n(r.refTagName, b)) return [];
|
|
26865
28583
|
let s = await o.getRecordsByTagName(r.refTagName), c = [];
|
|
26866
28584
|
for (let e of s) {
|
|
26867
28585
|
if (e.attributes.find((e) => e.name === r.uuidAttr)?.value !== t) continue;
|
|
26868
28586
|
let n = {
|
|
26869
28587
|
tagName: e.tagName,
|
|
26870
28588
|
id: e.id
|
|
26871
|
-
}, s = await
|
|
28589
|
+
}, s = await k.query.buildReferencePath(o, {
|
|
26872
28590
|
reference: n,
|
|
26873
28591
|
target: a
|
|
26874
28592
|
});
|
|
@@ -26888,32 +28606,32 @@ async function Q(e) {
|
|
|
26888
28606
|
}
|
|
26889
28607
|
return c;
|
|
26890
28608
|
}
|
|
26891
|
-
function
|
|
28609
|
+
function si(e) {
|
|
26892
28610
|
let t = [];
|
|
26893
|
-
for (let n of
|
|
26894
|
-
let r =
|
|
28611
|
+
for (let n of He) {
|
|
28612
|
+
let r = Be[n]?.get(e);
|
|
26895
28613
|
r && t.push(...r);
|
|
26896
28614
|
}
|
|
26897
28615
|
return t;
|
|
26898
28616
|
}
|
|
26899
28617
|
//#endregion
|
|
26900
28618
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
26901
|
-
async function
|
|
26902
|
-
let { childRecord: t, query: n } = e, r = await
|
|
28619
|
+
async function ci(e) {
|
|
28620
|
+
let { childRecord: t, query: n } = e, r = await li({
|
|
26903
28621
|
childRecord: t,
|
|
26904
28622
|
query: n
|
|
26905
|
-
}), i = await
|
|
28623
|
+
}), i = await fi({
|
|
26906
28624
|
childRecord: t,
|
|
26907
28625
|
query: n
|
|
26908
28626
|
});
|
|
26909
28627
|
return [...r, ...i];
|
|
26910
28628
|
}
|
|
26911
|
-
async function
|
|
26912
|
-
let { childRecord: t, query: n } = e, r =
|
|
28629
|
+
async function li(e) {
|
|
28630
|
+
let { childRecord: t, query: n } = e, r = Ue.get(t.tagName);
|
|
26913
28631
|
if (!r?.length) return [];
|
|
26914
28632
|
let i = [];
|
|
26915
28633
|
for (let e of r) {
|
|
26916
|
-
let r = await
|
|
28634
|
+
let r = await ui({
|
|
26917
28635
|
childRecord: t,
|
|
26918
28636
|
pair: e,
|
|
26919
28637
|
query: n
|
|
@@ -26922,16 +28640,16 @@ async function cn(e) {
|
|
|
26922
28640
|
}
|
|
26923
28641
|
return i;
|
|
26924
28642
|
}
|
|
26925
|
-
async function
|
|
28643
|
+
async function ui(e) {
|
|
26926
28644
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
26927
28645
|
if (!i) return null;
|
|
26928
|
-
let a = await
|
|
28646
|
+
let a = await di({
|
|
26929
28647
|
uuidValue: i,
|
|
26930
28648
|
targetTagNames: n.targetTagNames,
|
|
26931
28649
|
query: r
|
|
26932
28650
|
});
|
|
26933
28651
|
if (!a) return null;
|
|
26934
|
-
let o = await
|
|
28652
|
+
let o = await _e(r, {
|
|
26935
28653
|
reference: {
|
|
26936
28654
|
tagName: t.tagName,
|
|
26937
28655
|
id: t.id
|
|
@@ -26955,10 +28673,10 @@ async function ln(e) {
|
|
|
26955
28673
|
}
|
|
26956
28674
|
};
|
|
26957
28675
|
}
|
|
26958
|
-
async function
|
|
28676
|
+
async function di(e) {
|
|
26959
28677
|
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
26960
28678
|
for (let e of r) {
|
|
26961
|
-
if (!n(e,
|
|
28679
|
+
if (!n(e, b)) continue;
|
|
26962
28680
|
let r = (await i.getRecordsByTagName(e)).find((e) => e.attributes.find((e) => e.name === "uuid")?.value === t);
|
|
26963
28681
|
if (r) return {
|
|
26964
28682
|
tagName: r.tagName,
|
|
@@ -26967,17 +28685,17 @@ async function un(e) {
|
|
|
26967
28685
|
}
|
|
26968
28686
|
return null;
|
|
26969
28687
|
}
|
|
26970
|
-
async function
|
|
28688
|
+
async function fi(e) {
|
|
26971
28689
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
26972
28690
|
if (!r) return [];
|
|
26973
|
-
let i =
|
|
28691
|
+
let i = si(t.tagName);
|
|
26974
28692
|
if (i.length === 0) return [];
|
|
26975
28693
|
let a = {
|
|
26976
28694
|
tagName: t.tagName,
|
|
26977
28695
|
id: t.id
|
|
26978
28696
|
}, o = [];
|
|
26979
28697
|
for (let e of i) {
|
|
26980
|
-
let t = await
|
|
28698
|
+
let t = await oi({
|
|
26981
28699
|
uuid: r,
|
|
26982
28700
|
entry: e,
|
|
26983
28701
|
target: a,
|
|
@@ -26989,12 +28707,12 @@ async function dn(e) {
|
|
|
26989
28707
|
}
|
|
26990
28708
|
//#endregion
|
|
26991
28709
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
26992
|
-
async function
|
|
26993
|
-
let { childRecord: t, parentRecord: n, query: r } = e, i = await
|
|
28710
|
+
async function pi(e) {
|
|
28711
|
+
let { childRecord: t, parentRecord: n, query: r } = e, i = await ei({
|
|
26994
28712
|
childRecord: t,
|
|
26995
28713
|
parentRecord: n,
|
|
26996
28714
|
query: r
|
|
26997
|
-
}), a = await
|
|
28715
|
+
}), a = await ci({
|
|
26998
28716
|
childRecord: t,
|
|
26999
28717
|
query: r
|
|
27000
28718
|
});
|
|
@@ -27002,12 +28720,12 @@ async function fn(e) {
|
|
|
27002
28720
|
}
|
|
27003
28721
|
//#endregion
|
|
27004
28722
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
27005
|
-
async function
|
|
27006
|
-
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await
|
|
28723
|
+
async function mi(e) {
|
|
28724
|
+
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await hi(t, n);
|
|
27007
28725
|
if (r.size === 0) return [];
|
|
27008
28726
|
let a = [];
|
|
27009
28727
|
for (let { target: e } of t) {
|
|
27010
|
-
let t = await
|
|
28728
|
+
let t = await _i({
|
|
27011
28729
|
target: e,
|
|
27012
28730
|
uuidMap: r,
|
|
27013
28731
|
uuidToRef: i,
|
|
@@ -27017,9 +28735,9 @@ async function pn(e) {
|
|
|
27017
28735
|
}
|
|
27018
28736
|
return a;
|
|
27019
28737
|
}
|
|
27020
|
-
async function
|
|
28738
|
+
async function hi(e, t) {
|
|
27021
28739
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
27022
|
-
for (let { source: i, target: a } of e) await
|
|
28740
|
+
for (let { source: i, target: a } of e) await gi({
|
|
27023
28741
|
source: i,
|
|
27024
28742
|
target: a,
|
|
27025
28743
|
query: t,
|
|
@@ -27031,7 +28749,7 @@ async function mn(e, t) {
|
|
|
27031
28749
|
uuidToRef: r
|
|
27032
28750
|
};
|
|
27033
28751
|
}
|
|
27034
|
-
async function
|
|
28752
|
+
async function gi(e) {
|
|
27035
28753
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
27036
28754
|
if (!o) return;
|
|
27037
28755
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -27040,14 +28758,14 @@ async function hn(e) {
|
|
|
27040
28758
|
id: o.id
|
|
27041
28759
|
}));
|
|
27042
28760
|
}
|
|
27043
|
-
async function
|
|
28761
|
+
async function _i(e) {
|
|
27044
28762
|
let { target: t, uuidMap: n, uuidToRef: r, query: a } = e, o = t.tagName;
|
|
27045
|
-
if (!(o in
|
|
28763
|
+
if (!(o in T)) return null;
|
|
27046
28764
|
let s = await a.getRecord(t);
|
|
27047
28765
|
if (!s) return null;
|
|
27048
|
-
let c =
|
|
28766
|
+
let c = T[o], l = [...s.attributes], u = !1;
|
|
27049
28767
|
for (let e of c) {
|
|
27050
|
-
let t = await
|
|
28768
|
+
let t = await vi({
|
|
27051
28769
|
pair: e,
|
|
27052
28770
|
tagName: o,
|
|
27053
28771
|
refId: s.id,
|
|
@@ -27067,14 +28785,14 @@ async function gn(e) {
|
|
|
27067
28785
|
})
|
|
27068
28786
|
} : null;
|
|
27069
28787
|
}
|
|
27070
|
-
async function
|
|
28788
|
+
async function vi(e) {
|
|
27071
28789
|
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;
|
|
27072
28790
|
if (!c) return null;
|
|
27073
28791
|
let l = i.get(c);
|
|
27074
28792
|
if (!l) return null;
|
|
27075
|
-
let u = !1, d =
|
|
28793
|
+
let u = !1, d = yi(s, t.attribute.uuid, c, l);
|
|
27076
28794
|
d && (s = d, u = !0);
|
|
27077
|
-
let f = await
|
|
28795
|
+
let f = await bi({
|
|
27078
28796
|
attributes: s,
|
|
27079
28797
|
pathAttrName: t.attribute.path,
|
|
27080
28798
|
newUuid: l,
|
|
@@ -27085,16 +28803,16 @@ async function _n(e) {
|
|
|
27085
28803
|
});
|
|
27086
28804
|
return f && (s = f, u = !0), u ? s : null;
|
|
27087
28805
|
}
|
|
27088
|
-
function
|
|
28806
|
+
function yi(e, t, n, r) {
|
|
27089
28807
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
27090
28808
|
...e,
|
|
27091
28809
|
value: r
|
|
27092
28810
|
} : e);
|
|
27093
28811
|
}
|
|
27094
|
-
async function
|
|
28812
|
+
async function bi(e) {
|
|
27095
28813
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
27096
28814
|
if (!c) return null;
|
|
27097
|
-
let l = await
|
|
28815
|
+
let l = await k.query.buildReferencePath(s, {
|
|
27098
28816
|
reference: {
|
|
27099
28817
|
tagName: a,
|
|
27100
28818
|
id: o
|
|
@@ -27111,13 +28829,13 @@ async function yn(e) {
|
|
|
27111
28829
|
}
|
|
27112
28830
|
//#endregion
|
|
27113
28831
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
27114
|
-
async function
|
|
27115
|
-
return
|
|
28832
|
+
async function xi(e) {
|
|
28833
|
+
return mi(e);
|
|
27116
28834
|
}
|
|
27117
28835
|
//#endregion
|
|
27118
28836
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
27119
|
-
function
|
|
27120
|
-
let { record: t } = e, { tagName: n, attributes: r } = t, i =
|
|
28837
|
+
function Si(e) {
|
|
28838
|
+
let { record: t } = e, { tagName: n, attributes: r } = t, i = b.definition[n];
|
|
27121
28839
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
27122
28840
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
27123
28841
|
return {
|
|
@@ -27131,20 +28849,20 @@ function xn(e) {
|
|
|
27131
28849
|
}
|
|
27132
28850
|
//#endregion
|
|
27133
28851
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
27134
|
-
function
|
|
27135
|
-
return
|
|
28852
|
+
function Ci(e) {
|
|
28853
|
+
return Si(e);
|
|
27136
28854
|
}
|
|
27137
28855
|
//#endregion
|
|
27138
28856
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
27139
|
-
async function
|
|
28857
|
+
async function wi(e) {
|
|
27140
28858
|
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
27141
28859
|
if (a) {
|
|
27142
|
-
let e =
|
|
28860
|
+
let e = si(n.tagName), t = {
|
|
27143
28861
|
tagName: n.tagName,
|
|
27144
28862
|
id: n.id
|
|
27145
28863
|
};
|
|
27146
28864
|
for (let n of e) {
|
|
27147
|
-
let e = await
|
|
28865
|
+
let e = await oi({
|
|
27148
28866
|
uuid: a,
|
|
27149
28867
|
entry: n,
|
|
27150
28868
|
target: t,
|
|
@@ -27153,8 +28871,8 @@ async function Cn(e) {
|
|
|
27153
28871
|
i.push(...e);
|
|
27154
28872
|
}
|
|
27155
28873
|
}
|
|
27156
|
-
if (
|
|
27157
|
-
let e = await
|
|
28874
|
+
if (Ti(t, n)) {
|
|
28875
|
+
let e = await Ei({
|
|
27158
28876
|
newRecord: n,
|
|
27159
28877
|
query: r
|
|
27160
28878
|
});
|
|
@@ -27162,11 +28880,11 @@ async function Cn(e) {
|
|
|
27162
28880
|
}
|
|
27163
28881
|
return i;
|
|
27164
28882
|
}
|
|
27165
|
-
function
|
|
27166
|
-
for (let n of
|
|
28883
|
+
function Ti(e, t) {
|
|
28884
|
+
for (let n of ne) if (e.attributes.find((e) => e.name === n)?.value !== t.attributes.find((e) => e.name === n)?.value) return !0;
|
|
27167
28885
|
return !1;
|
|
27168
28886
|
}
|
|
27169
|
-
async function
|
|
28887
|
+
async function Ei(e) {
|
|
27170
28888
|
let { newRecord: t, query: n } = e, r = {
|
|
27171
28889
|
tagName: t.tagName,
|
|
27172
28890
|
id: t.id
|
|
@@ -27175,14 +28893,14 @@ async function Tn(e) {
|
|
|
27175
28893
|
if (r.id === t.id) continue;
|
|
27176
28894
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
27177
28895
|
if (!e) continue;
|
|
27178
|
-
let i =
|
|
28896
|
+
let i = si(r.tagName);
|
|
27179
28897
|
if (i.length === 0) continue;
|
|
27180
28898
|
let o = {
|
|
27181
28899
|
tagName: r.tagName,
|
|
27182
28900
|
id: r.id
|
|
27183
28901
|
};
|
|
27184
28902
|
for (let t of i) {
|
|
27185
|
-
let r = await
|
|
28903
|
+
let r = await oi({
|
|
27186
28904
|
uuid: e,
|
|
27187
28905
|
entry: t,
|
|
27188
28906
|
target: o,
|
|
@@ -27195,12 +28913,12 @@ async function Tn(e) {
|
|
|
27195
28913
|
}
|
|
27196
28914
|
//#endregion
|
|
27197
28915
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
27198
|
-
async function
|
|
27199
|
-
return
|
|
28916
|
+
async function Di(e) {
|
|
28917
|
+
return wi(e);
|
|
27200
28918
|
}
|
|
27201
28919
|
//#endregion
|
|
27202
28920
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
27203
|
-
function
|
|
28921
|
+
function Oi(e) {
|
|
27204
28922
|
let { record: t } = e, n = !0;
|
|
27205
28923
|
t.tagName === "Private" && !t.tree.length && (n = !1);
|
|
27206
28924
|
let r = t.attributes.filter((e) => e.name !== "uuid");
|
|
@@ -27214,17 +28932,17 @@ function Dn(e) {
|
|
|
27214
28932
|
}
|
|
27215
28933
|
//#endregion
|
|
27216
28934
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
27217
|
-
async function
|
|
28935
|
+
async function ki(e) {
|
|
27218
28936
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
27219
|
-
if (await
|
|
28937
|
+
if (await Fi({
|
|
27220
28938
|
record: t,
|
|
27221
28939
|
query: n,
|
|
27222
28940
|
ids: r,
|
|
27223
28941
|
uuids: i
|
|
27224
28942
|
}), i.size === 0) return [];
|
|
27225
|
-
let a = [], o = Object.keys(
|
|
28943
|
+
let a = [], o = Object.keys(T);
|
|
27226
28944
|
for (let e of o) {
|
|
27227
|
-
let t = await
|
|
28945
|
+
let t = await Ai({
|
|
27228
28946
|
refTagName: e,
|
|
27229
28947
|
subtreeIds: r,
|
|
27230
28948
|
subtreeUuids: i,
|
|
@@ -27234,11 +28952,11 @@ async function On(e) {
|
|
|
27234
28952
|
}
|
|
27235
28953
|
return a;
|
|
27236
28954
|
}
|
|
27237
|
-
async function
|
|
27238
|
-
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a =
|
|
28955
|
+
async function Ai(e) {
|
|
28956
|
+
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = T[t], o = await i.getRecordsByTagName(t), s = [];
|
|
27239
28957
|
for (let e of o) {
|
|
27240
28958
|
if (n.has(e.id)) continue;
|
|
27241
|
-
let o = await
|
|
28959
|
+
let o = await ji({
|
|
27242
28960
|
refTagName: t,
|
|
27243
28961
|
refRecord: e,
|
|
27244
28962
|
refPairs: a,
|
|
@@ -27249,15 +28967,15 @@ async function kn(e) {
|
|
|
27249
28967
|
}
|
|
27250
28968
|
return s;
|
|
27251
28969
|
}
|
|
27252
|
-
async function
|
|
27253
|
-
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o =
|
|
28970
|
+
async function ji(e) {
|
|
28971
|
+
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o = Mi({
|
|
27254
28972
|
refPairs: r,
|
|
27255
28973
|
refRecord: n,
|
|
27256
28974
|
subtreeUuids: i
|
|
27257
28975
|
});
|
|
27258
|
-
return o.size === 0 ? [] :
|
|
28976
|
+
return o.size === 0 ? [] : Je.has(t) ? [Ni(n, o)] : Pi(n, a);
|
|
27259
28977
|
}
|
|
27260
|
-
function
|
|
28978
|
+
function Mi(e) {
|
|
27261
28979
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
27262
28980
|
for (let e of t) {
|
|
27263
28981
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -27268,7 +28986,7 @@ function jn(e) {
|
|
|
27268
28986
|
}
|
|
27269
28987
|
return i;
|
|
27270
28988
|
}
|
|
27271
|
-
function
|
|
28989
|
+
function Ni(e, t) {
|
|
27272
28990
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
27273
28991
|
return {
|
|
27274
28992
|
status: "updated",
|
|
@@ -27279,7 +28997,7 @@ function Mn(e, t) {
|
|
|
27279
28997
|
})
|
|
27280
28998
|
};
|
|
27281
28999
|
}
|
|
27282
|
-
async function
|
|
29000
|
+
async function Pi(e, t) {
|
|
27283
29001
|
let n = [{
|
|
27284
29002
|
status: "deleted",
|
|
27285
29003
|
oldRecord: i(e),
|
|
@@ -27301,14 +29019,14 @@ async function Nn(e, t) {
|
|
|
27301
29019
|
}
|
|
27302
29020
|
return n;
|
|
27303
29021
|
}
|
|
27304
|
-
async function
|
|
29022
|
+
async function Fi(e) {
|
|
27305
29023
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
27306
29024
|
r.add(t.id);
|
|
27307
29025
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
27308
29026
|
a && i.add(a);
|
|
27309
29027
|
for (let e of t.children) {
|
|
27310
29028
|
let t = await n.getRecord(e);
|
|
27311
|
-
t && await
|
|
29029
|
+
t && await Fi({
|
|
27312
29030
|
record: t,
|
|
27313
29031
|
query: n,
|
|
27314
29032
|
ids: r,
|
|
@@ -27318,31 +29036,31 @@ async function Pn(e) {
|
|
|
27318
29036
|
}
|
|
27319
29037
|
//#endregion
|
|
27320
29038
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
27321
|
-
async function
|
|
27322
|
-
return
|
|
29039
|
+
async function Ii(e) {
|
|
29040
|
+
return ki(e);
|
|
27323
29041
|
}
|
|
27324
29042
|
//#endregion
|
|
27325
29043
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
27326
|
-
function
|
|
29044
|
+
function Li() {
|
|
27327
29045
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
27328
29046
|
return {
|
|
27329
29047
|
beforeImportRecord: (r) => {
|
|
27330
29048
|
let { record: i, ancestry: a } = r, { tagName: o } = i, s = i.attributes.find((e) => e.name === "uuid")?.value;
|
|
27331
|
-
if (s &&
|
|
27332
|
-
let t =
|
|
29049
|
+
if (s && zi.has(o)) {
|
|
29050
|
+
let t = ae({
|
|
27333
29051
|
record: i,
|
|
27334
29052
|
ancestry: a
|
|
27335
29053
|
});
|
|
27336
29054
|
t && e.set(t.path, s);
|
|
27337
29055
|
}
|
|
27338
|
-
if (!
|
|
27339
|
-
let c =
|
|
29056
|
+
if (!Ri.has(o)) return;
|
|
29057
|
+
let c = T[o];
|
|
27340
29058
|
for (let e of c) {
|
|
27341
29059
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
27342
29060
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
27343
|
-
let s =
|
|
29061
|
+
let s = ue(e.resolution, e.attribute.path, r, a);
|
|
27344
29062
|
if (!s) {
|
|
27345
|
-
e.resolution ===
|
|
29063
|
+
e.resolution === E.unsupported && n.push({
|
|
27346
29064
|
type: "unsupported-xpath-reference",
|
|
27347
29065
|
recordId: i.id,
|
|
27348
29066
|
details: {
|
|
@@ -27396,13 +29114,13 @@ function In() {
|
|
|
27396
29114
|
}
|
|
27397
29115
|
};
|
|
27398
29116
|
}
|
|
27399
|
-
var
|
|
27400
|
-
beforeClone:
|
|
27401
|
-
afterStandardizedRecord:
|
|
27402
|
-
afterCreated:
|
|
27403
|
-
afterDeepClone:
|
|
27404
|
-
afterUpdated:
|
|
27405
|
-
beforeDelete:
|
|
29117
|
+
var Ri = new Set(Object.keys(T)), zi = new Set(Object.values(T).flatMap((e) => e.flatMap((e) => e.target))), Bi = {
|
|
29118
|
+
beforeClone: Oi,
|
|
29119
|
+
afterStandardizedRecord: Ci,
|
|
29120
|
+
afterCreated: pi,
|
|
29121
|
+
afterDeepClone: xi,
|
|
29122
|
+
afterUpdated: Di,
|
|
29123
|
+
beforeDelete: Ii
|
|
27406
29124
|
};
|
|
27407
29125
|
//#endregion
|
|
27408
|
-
export {
|
|
29126
|
+
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 };
|