@contember/binding-legacy 2.1.0-alpha.30 → 2.1.0-alpha.36
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/package.json +10 -5
- package/src/accessorTree/NormalizedPersistedData.ts +1 -1
- package/src/accessors/EntityAccessorImpl.ts +13 -11
- package/src/accessors/EntityListAccessorImpl.ts +16 -7
- package/src/core/AccessorErrorManager.ts +2 -2
- package/src/core/DataBinding.ts +24 -15
- package/src/core/ErrorsPreprocessor.ts +4 -5
- package/src/core/EventManager.ts +34 -46
- package/src/core/MutationGenerator.ts +23 -27
- package/src/core/QueryGenerator.ts +4 -5
- package/src/core/RealmKeyGenerator.ts +5 -3
- package/src/core/RequestResponseNormalizer.ts +3 -8
- package/src/core/StateInitializer.ts +10 -18
- package/src/core/TreeAugmenter.ts +8 -15
- package/src/core/TreeStore.ts +5 -4
- package/src/core/operations/EntityOperations.ts +25 -25
- package/src/core/operations/FieldOperations.ts +15 -17
- package/src/core/operations/ListOperations.ts +15 -15
- package/src/core/operations/OperationsHelpers.ts +2 -2
- package/src/core/state/EntityListState.ts +3 -9
- package/src/fieldHelpers/helpers/TemporalFieldHelper.ts +3 -3
- package/src/utils/assertNever.ts +4 -4
- package/tests/example.test.ts +2 -2
- package/dist/development/index.cjs +0 -34
- package/dist/development/index.cjs.map +0 -1
- package/dist/development/index.js +0 -28
- package/dist/development/index.js.map +0 -1
- package/dist/development/src/accessorTree/NormalizedPersistedData.cjs +0 -10
- package/dist/development/src/accessorTree/NormalizedPersistedData.cjs.map +0 -1
- package/dist/development/src/accessorTree/NormalizedPersistedData.js +0 -10
- package/dist/development/src/accessorTree/NormalizedPersistedData.js.map +0 -1
- package/dist/development/src/accessors/EntityAccessorImpl.cjs +0 -179
- package/dist/development/src/accessors/EntityAccessorImpl.cjs.map +0 -1
- package/dist/development/src/accessors/EntityAccessorImpl.js +0 -179
- package/dist/development/src/accessors/EntityAccessorImpl.js.map +0 -1
- package/dist/development/src/accessors/EntityListAccessorImpl.cjs +0 -112
- package/dist/development/src/accessors/EntityListAccessorImpl.cjs.map +0 -1
- package/dist/development/src/accessors/EntityListAccessorImpl.js +0 -112
- package/dist/development/src/accessors/EntityListAccessorImpl.js.map +0 -1
- package/dist/development/src/accessors/FieldAccessorImpl.cjs +0 -54
- package/dist/development/src/accessors/FieldAccessorImpl.cjs.map +0 -1
- package/dist/development/src/accessors/FieldAccessorImpl.js +0 -54
- package/dist/development/src/accessors/FieldAccessorImpl.js.map +0 -1
- package/dist/development/src/core/AccessorErrorManager.cjs +0 -200
- package/dist/development/src/core/AccessorErrorManager.cjs.map +0 -1
- package/dist/development/src/core/AccessorErrorManager.js +0 -200
- package/dist/development/src/core/AccessorErrorManager.js.map +0 -1
- package/dist/development/src/core/Config.cjs +0 -29
- package/dist/development/src/core/Config.cjs.map +0 -1
- package/dist/development/src/core/Config.js +0 -29
- package/dist/development/src/core/Config.js.map +0 -1
- package/dist/development/src/core/DataBinding.cjs +0 -354
- package/dist/development/src/core/DataBinding.cjs.map +0 -1
- package/dist/development/src/core/DataBinding.js +0 -354
- package/dist/development/src/core/DataBinding.js.map +0 -1
- package/dist/development/src/core/DirtinessTracker.cjs +0 -26
- package/dist/development/src/core/DirtinessTracker.cjs.map +0 -1
- package/dist/development/src/core/DirtinessTracker.js +0 -26
- package/dist/development/src/core/DirtinessTracker.js.map +0 -1
- package/dist/development/src/core/ErrorsPreprocessor.cjs +0 -180
- package/dist/development/src/core/ErrorsPreprocessor.cjs.map +0 -1
- package/dist/development/src/core/ErrorsPreprocessor.js +0 -180
- package/dist/development/src/core/ErrorsPreprocessor.js.map +0 -1
- package/dist/development/src/core/EventManager.cjs +0 -439
- package/dist/development/src/core/EventManager.cjs.map +0 -1
- package/dist/development/src/core/EventManager.js +0 -439
- package/dist/development/src/core/EventManager.js.map +0 -1
- package/dist/development/src/core/MutationGenerator.cjs +0 -670
- package/dist/development/src/core/MutationGenerator.cjs.map +0 -1
- package/dist/development/src/core/MutationGenerator.js +0 -670
- package/dist/development/src/core/MutationGenerator.js.map +0 -1
- package/dist/development/src/core/QueryGenerator.cjs +0 -110
- package/dist/development/src/core/QueryGenerator.cjs.map +0 -1
- package/dist/development/src/core/QueryGenerator.js +0 -110
- package/dist/development/src/core/QueryGenerator.js.map +0 -1
- package/dist/development/src/core/RealmKeyGenerator.cjs +0 -42
- package/dist/development/src/core/RealmKeyGenerator.cjs.map +0 -1
- package/dist/development/src/core/RealmKeyGenerator.js +0 -42
- package/dist/development/src/core/RealmKeyGenerator.js.map +0 -1
- package/dist/development/src/core/RequestResponseNormalizer.cjs +0 -136
- package/dist/development/src/core/RequestResponseNormalizer.cjs.map +0 -1
- package/dist/development/src/core/RequestResponseNormalizer.js +0 -136
- package/dist/development/src/core/RequestResponseNormalizer.js.map +0 -1
- package/dist/development/src/core/StateInitializer.cjs +0 -379
- package/dist/development/src/core/StateInitializer.cjs.map +0 -1
- package/dist/development/src/core/StateInitializer.js +0 -379
- package/dist/development/src/core/StateInitializer.js.map +0 -1
- package/dist/development/src/core/TreeAugmenter.cjs +0 -354
- package/dist/development/src/core/TreeAugmenter.cjs.map +0 -1
- package/dist/development/src/core/TreeAugmenter.js +0 -354
- package/dist/development/src/core/TreeAugmenter.js.map +0 -1
- package/dist/development/src/core/TreeStore.cjs +0 -172
- package/dist/development/src/core/TreeStore.cjs.map +0 -1
- package/dist/development/src/core/TreeStore.js +0 -172
- package/dist/development/src/core/TreeStore.js.map +0 -1
- package/dist/development/src/core/exceptions/ErrorLocator.cjs +0 -59
- package/dist/development/src/core/exceptions/ErrorLocator.cjs.map +0 -1
- package/dist/development/src/core/exceptions/ErrorLocator.js +0 -59
- package/dist/development/src/core/exceptions/ErrorLocator.js.map +0 -1
- package/dist/development/src/core/exceptions/MarkerSugarer.cjs +0 -51
- package/dist/development/src/core/exceptions/MarkerSugarer.cjs.map +0 -1
- package/dist/development/src/core/exceptions/MarkerSugarer.js +0 -51
- package/dist/development/src/core/exceptions/MarkerSugarer.js.map +0 -1
- package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs +0 -33
- package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs.map +0 -1
- package/dist/development/src/core/exceptions/TreeParameterSugarer.js +0 -33
- package/dist/development/src/core/exceptions/TreeParameterSugarer.js.map +0 -1
- package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs +0 -23
- package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs.map +0 -1
- package/dist/development/src/core/factories/createBatchUpdatesOptions.js +0 -23
- package/dist/development/src/core/factories/createBatchUpdatesOptions.js.map +0 -1
- package/dist/development/src/core/operations/EntityOperations.cjs +0 -226
- package/dist/development/src/core/operations/EntityOperations.cjs.map +0 -1
- package/dist/development/src/core/operations/EntityOperations.js +0 -226
- package/dist/development/src/core/operations/EntityOperations.js.map +0 -1
- package/dist/development/src/core/operations/FieldOperations.cjs +0 -92
- package/dist/development/src/core/operations/FieldOperations.cjs.map +0 -1
- package/dist/development/src/core/operations/FieldOperations.js +0 -92
- package/dist/development/src/core/operations/FieldOperations.js.map +0 -1
- package/dist/development/src/core/operations/ListOperations.cjs +0 -158
- package/dist/development/src/core/operations/ListOperations.cjs.map +0 -1
- package/dist/development/src/core/operations/ListOperations.js +0 -158
- package/dist/development/src/core/operations/ListOperations.js.map +0 -1
- package/dist/development/src/core/operations/OperationsHelpers.cjs +0 -87
- package/dist/development/src/core/operations/OperationsHelpers.cjs.map +0 -1
- package/dist/development/src/core/operations/OperationsHelpers.js +0 -87
- package/dist/development/src/core/operations/OperationsHelpers.js.map +0 -1
- package/dist/development/src/core/requestAliases/MutationAlias.cjs +0 -14
- package/dist/development/src/core/requestAliases/MutationAlias.cjs.map +0 -1
- package/dist/development/src/core/requestAliases/MutationAlias.js +0 -14
- package/dist/development/src/core/requestAliases/MutationAlias.js.map +0 -1
- package/dist/development/src/core/state/StateIterator.cjs +0 -100
- package/dist/development/src/core/state/StateIterator.cjs.map +0 -1
- package/dist/development/src/core/state/StateIterator.js +0 -100
- package/dist/development/src/core/state/StateIterator.js.map +0 -1
- package/dist/development/src/core/state/getEntityMarker.cjs +0 -5
- package/dist/development/src/core/state/getEntityMarker.cjs.map +0 -1
- package/dist/development/src/core/state/getEntityMarker.js +0 -5
- package/dist/development/src/core/state/getEntityMarker.js.map +0 -1
- package/dist/development/src/core/utils/getCombinedSignal.cjs +0 -33
- package/dist/development/src/core/utils/getCombinedSignal.cjs.map +0 -1
- package/dist/development/src/core/utils/getCombinedSignal.js +0 -33
- package/dist/development/src/core/utils/getCombinedSignal.js.map +0 -1
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs +0 -13
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs.map +0 -1
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.js +0 -13
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.js.map +0 -1
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs +0 -18
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +0 -1
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js +0 -18
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +0 -1
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs +0 -16
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +0 -1
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js +0 -16
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js.map +0 -1
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs +0 -7
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +0 -1
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js +0 -7
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js.map +0 -1
- package/dist/development/src/utils/isEmptyObject.cjs +0 -12
- package/dist/development/src/utils/isEmptyObject.cjs.map +0 -1
- package/dist/development/src/utils/isEmptyObject.js +0 -12
- package/dist/development/src/utils/isEmptyObject.js.map +0 -1
- package/dist/production/index.cjs +0 -34
- package/dist/production/index.cjs.map +0 -1
- package/dist/production/index.js +0 -28
- package/dist/production/index.js.map +0 -1
- package/dist/production/src/accessorTree/NormalizedPersistedData.cjs +0 -10
- package/dist/production/src/accessorTree/NormalizedPersistedData.cjs.map +0 -1
- package/dist/production/src/accessorTree/NormalizedPersistedData.js +0 -10
- package/dist/production/src/accessorTree/NormalizedPersistedData.js.map +0 -1
- package/dist/production/src/accessors/EntityAccessorImpl.cjs +0 -179
- package/dist/production/src/accessors/EntityAccessorImpl.cjs.map +0 -1
- package/dist/production/src/accessors/EntityAccessorImpl.js +0 -179
- package/dist/production/src/accessors/EntityAccessorImpl.js.map +0 -1
- package/dist/production/src/accessors/EntityListAccessorImpl.cjs +0 -112
- package/dist/production/src/accessors/EntityListAccessorImpl.cjs.map +0 -1
- package/dist/production/src/accessors/EntityListAccessorImpl.js +0 -112
- package/dist/production/src/accessors/EntityListAccessorImpl.js.map +0 -1
- package/dist/production/src/accessors/FieldAccessorImpl.cjs +0 -54
- package/dist/production/src/accessors/FieldAccessorImpl.cjs.map +0 -1
- package/dist/production/src/accessors/FieldAccessorImpl.js +0 -54
- package/dist/production/src/accessors/FieldAccessorImpl.js.map +0 -1
- package/dist/production/src/core/AccessorErrorManager.cjs +0 -200
- package/dist/production/src/core/AccessorErrorManager.cjs.map +0 -1
- package/dist/production/src/core/AccessorErrorManager.js +0 -200
- package/dist/production/src/core/AccessorErrorManager.js.map +0 -1
- package/dist/production/src/core/Config.cjs +0 -29
- package/dist/production/src/core/Config.cjs.map +0 -1
- package/dist/production/src/core/Config.js +0 -29
- package/dist/production/src/core/Config.js.map +0 -1
- package/dist/production/src/core/DataBinding.cjs +0 -354
- package/dist/production/src/core/DataBinding.cjs.map +0 -1
- package/dist/production/src/core/DataBinding.js +0 -354
- package/dist/production/src/core/DataBinding.js.map +0 -1
- package/dist/production/src/core/DirtinessTracker.cjs +0 -26
- package/dist/production/src/core/DirtinessTracker.cjs.map +0 -1
- package/dist/production/src/core/DirtinessTracker.js +0 -26
- package/dist/production/src/core/DirtinessTracker.js.map +0 -1
- package/dist/production/src/core/ErrorsPreprocessor.cjs +0 -180
- package/dist/production/src/core/ErrorsPreprocessor.cjs.map +0 -1
- package/dist/production/src/core/ErrorsPreprocessor.js +0 -180
- package/dist/production/src/core/ErrorsPreprocessor.js.map +0 -1
- package/dist/production/src/core/EventManager.cjs +0 -413
- package/dist/production/src/core/EventManager.cjs.map +0 -1
- package/dist/production/src/core/EventManager.js +0 -413
- package/dist/production/src/core/EventManager.js.map +0 -1
- package/dist/production/src/core/MutationGenerator.cjs +0 -670
- package/dist/production/src/core/MutationGenerator.cjs.map +0 -1
- package/dist/production/src/core/MutationGenerator.js +0 -670
- package/dist/production/src/core/MutationGenerator.js.map +0 -1
- package/dist/production/src/core/QueryGenerator.cjs +0 -110
- package/dist/production/src/core/QueryGenerator.cjs.map +0 -1
- package/dist/production/src/core/QueryGenerator.js +0 -110
- package/dist/production/src/core/QueryGenerator.js.map +0 -1
- package/dist/production/src/core/RealmKeyGenerator.cjs +0 -42
- package/dist/production/src/core/RealmKeyGenerator.cjs.map +0 -1
- package/dist/production/src/core/RealmKeyGenerator.js +0 -42
- package/dist/production/src/core/RealmKeyGenerator.js.map +0 -1
- package/dist/production/src/core/RequestResponseNormalizer.cjs +0 -136
- package/dist/production/src/core/RequestResponseNormalizer.cjs.map +0 -1
- package/dist/production/src/core/RequestResponseNormalizer.js +0 -136
- package/dist/production/src/core/RequestResponseNormalizer.js.map +0 -1
- package/dist/production/src/core/StateInitializer.cjs +0 -379
- package/dist/production/src/core/StateInitializer.cjs.map +0 -1
- package/dist/production/src/core/StateInitializer.js +0 -379
- package/dist/production/src/core/StateInitializer.js.map +0 -1
- package/dist/production/src/core/TreeAugmenter.cjs +0 -354
- package/dist/production/src/core/TreeAugmenter.cjs.map +0 -1
- package/dist/production/src/core/TreeAugmenter.js +0 -354
- package/dist/production/src/core/TreeAugmenter.js.map +0 -1
- package/dist/production/src/core/TreeStore.cjs +0 -172
- package/dist/production/src/core/TreeStore.cjs.map +0 -1
- package/dist/production/src/core/TreeStore.js +0 -172
- package/dist/production/src/core/TreeStore.js.map +0 -1
- package/dist/production/src/core/exceptions/ErrorLocator.cjs +0 -59
- package/dist/production/src/core/exceptions/ErrorLocator.cjs.map +0 -1
- package/dist/production/src/core/exceptions/ErrorLocator.js +0 -59
- package/dist/production/src/core/exceptions/ErrorLocator.js.map +0 -1
- package/dist/production/src/core/exceptions/MarkerSugarer.cjs +0 -51
- package/dist/production/src/core/exceptions/MarkerSugarer.cjs.map +0 -1
- package/dist/production/src/core/exceptions/MarkerSugarer.js +0 -51
- package/dist/production/src/core/exceptions/MarkerSugarer.js.map +0 -1
- package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs +0 -33
- package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs.map +0 -1
- package/dist/production/src/core/exceptions/TreeParameterSugarer.js +0 -33
- package/dist/production/src/core/exceptions/TreeParameterSugarer.js.map +0 -1
- package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs +0 -23
- package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs.map +0 -1
- package/dist/production/src/core/factories/createBatchUpdatesOptions.js +0 -23
- package/dist/production/src/core/factories/createBatchUpdatesOptions.js.map +0 -1
- package/dist/production/src/core/operations/EntityOperations.cjs +0 -226
- package/dist/production/src/core/operations/EntityOperations.cjs.map +0 -1
- package/dist/production/src/core/operations/EntityOperations.js +0 -226
- package/dist/production/src/core/operations/EntityOperations.js.map +0 -1
- package/dist/production/src/core/operations/FieldOperations.cjs +0 -73
- package/dist/production/src/core/operations/FieldOperations.cjs.map +0 -1
- package/dist/production/src/core/operations/FieldOperations.js +0 -73
- package/dist/production/src/core/operations/FieldOperations.js.map +0 -1
- package/dist/production/src/core/operations/ListOperations.cjs +0 -158
- package/dist/production/src/core/operations/ListOperations.cjs.map +0 -1
- package/dist/production/src/core/operations/ListOperations.js +0 -158
- package/dist/production/src/core/operations/ListOperations.js.map +0 -1
- package/dist/production/src/core/operations/OperationsHelpers.cjs +0 -87
- package/dist/production/src/core/operations/OperationsHelpers.cjs.map +0 -1
- package/dist/production/src/core/operations/OperationsHelpers.js +0 -87
- package/dist/production/src/core/operations/OperationsHelpers.js.map +0 -1
- package/dist/production/src/core/requestAliases/MutationAlias.cjs +0 -14
- package/dist/production/src/core/requestAliases/MutationAlias.cjs.map +0 -1
- package/dist/production/src/core/requestAliases/MutationAlias.js +0 -14
- package/dist/production/src/core/requestAliases/MutationAlias.js.map +0 -1
- package/dist/production/src/core/state/StateIterator.cjs +0 -100
- package/dist/production/src/core/state/StateIterator.cjs.map +0 -1
- package/dist/production/src/core/state/StateIterator.js +0 -100
- package/dist/production/src/core/state/StateIterator.js.map +0 -1
- package/dist/production/src/core/state/getEntityMarker.cjs +0 -5
- package/dist/production/src/core/state/getEntityMarker.cjs.map +0 -1
- package/dist/production/src/core/state/getEntityMarker.js +0 -5
- package/dist/production/src/core/state/getEntityMarker.js.map +0 -1
- package/dist/production/src/core/utils/getCombinedSignal.cjs +0 -33
- package/dist/production/src/core/utils/getCombinedSignal.cjs.map +0 -1
- package/dist/production/src/core/utils/getCombinedSignal.js +0 -33
- package/dist/production/src/core/utils/getCombinedSignal.js.map +0 -1
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs +0 -13
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs.map +0 -1
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.js +0 -13
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.js.map +0 -1
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs +0 -18
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +0 -1
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js +0 -18
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +0 -1
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs +0 -16
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +0 -1
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js +0 -16
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js.map +0 -1
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs +0 -7
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +0 -1
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js +0 -7
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js.map +0 -1
- package/dist/production/src/utils/isEmptyObject.cjs +0 -12
- package/dist/production/src/utils/isEmptyObject.cjs.map +0 -1
- package/dist/production/src/utils/isEmptyObject.js +0 -12
- package/dist/production/src/utils/isEmptyObject.js.map +0 -1
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts +0 -18
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +0 -1
- package/dist/types/accessorTree/index.d.ts +0 -2
- package/dist/types/accessorTree/index.d.ts.map +0 -1
- package/dist/types/accessors/BindingConfig.d.ts +0 -6
- package/dist/types/accessors/BindingConfig.d.ts.map +0 -1
- package/dist/types/accessors/EntityAccessorImpl.d.ts +0 -56
- package/dist/types/accessors/EntityAccessorImpl.d.ts.map +0 -1
- package/dist/types/accessors/EntityListAccessorImpl.d.ts +0 -57
- package/dist/types/accessors/EntityListAccessorImpl.d.ts.map +0 -1
- package/dist/types/accessors/FieldAccessorImpl.d.ts +0 -32
- package/dist/types/accessors/FieldAccessorImpl.d.ts.map +0 -1
- package/dist/types/accessors/index.d.ts +0 -5
- package/dist/types/accessors/index.d.ts.map +0 -1
- package/dist/types/core/AccessorErrorManager.d.ts +0 -25
- package/dist/types/core/AccessorErrorManager.d.ts.map +0 -1
- package/dist/types/core/Config.d.ts +0 -9
- package/dist/types/core/Config.d.ts.map +0 -1
- package/dist/types/core/DataBinding.d.ts +0 -54
- package/dist/types/core/DataBinding.d.ts.map +0 -1
- package/dist/types/core/DirtinessTracker.d.ts +0 -9
- package/dist/types/core/DirtinessTracker.d.ts.map +0 -1
- package/dist/types/core/ErrorsPreprocessor.d.ts +0 -34
- package/dist/types/core/ErrorsPreprocessor.d.ts.map +0 -1
- package/dist/types/core/EventManager.d.ts +0 -57
- package/dist/types/core/EventManager.d.ts.map +0 -1
- package/dist/types/core/MutationGenerator.d.ts +0 -49
- package/dist/types/core/MutationGenerator.d.ts.map +0 -1
- package/dist/types/core/QueryGenerator.d.ts +0 -13
- package/dist/types/core/QueryGenerator.d.ts.map +0 -1
- package/dist/types/core/RealmKeyGenerator.d.ts +0 -10
- package/dist/types/core/RealmKeyGenerator.d.ts.map +0 -1
- package/dist/types/core/RequestResponseNormalizer.d.ts +0 -11
- package/dist/types/core/RequestResponseNormalizer.d.ts.map +0 -1
- package/dist/types/core/StateInitializer.d.ts +0 -34
- package/dist/types/core/StateInitializer.d.ts.map +0 -1
- package/dist/types/core/TreeAugmenter.d.ts +0 -25
- package/dist/types/core/TreeAugmenter.d.ts.map +0 -1
- package/dist/types/core/TreeStore.d.ts +0 -30
- package/dist/types/core/TreeStore.d.ts.map +0 -1
- package/dist/types/core/UpdateMetadata.d.ts +0 -4
- package/dist/types/core/UpdateMetadata.d.ts.map +0 -1
- package/dist/types/core/exceptions/ErrorLocator.d.ts +0 -8
- package/dist/types/core/exceptions/ErrorLocator.d.ts.map +0 -1
- package/dist/types/core/exceptions/MarkerSugarer.d.ts +0 -10
- package/dist/types/core/exceptions/MarkerSugarer.d.ts.map +0 -1
- package/dist/types/core/exceptions/TreeParameterSugarer.d.ts +0 -11
- package/dist/types/core/exceptions/TreeParameterSugarer.d.ts.map +0 -1
- package/dist/types/core/factories/createBatchUpdatesOptions.d.ts +0 -5
- package/dist/types/core/factories/createBatchUpdatesOptions.d.ts.map +0 -1
- package/dist/types/core/factories/index.d.ts +0 -2
- package/dist/types/core/factories/index.d.ts.map +0 -1
- package/dist/types/core/index.d.ts +0 -9
- package/dist/types/core/index.d.ts.map +0 -1
- package/dist/types/core/operations/EntityOperations.d.ts +0 -26
- package/dist/types/core/operations/EntityOperations.d.ts.map +0 -1
- package/dist/types/core/operations/FieldOperations.d.ts +0 -22
- package/dist/types/core/operations/FieldOperations.d.ts.map +0 -1
- package/dist/types/core/operations/ListOperations.d.ts +0 -32
- package/dist/types/core/operations/ListOperations.d.ts.map +0 -1
- package/dist/types/core/operations/OperationsHelpers.d.ts +0 -14
- package/dist/types/core/operations/OperationsHelpers.d.ts.map +0 -1
- package/dist/types/core/operations/index.d.ts +0 -4
- package/dist/types/core/operations/index.d.ts.map +0 -1
- package/dist/types/core/requestAliases/MutationAlias.d.ts +0 -6
- package/dist/types/core/requestAliases/MutationAlias.d.ts.map +0 -1
- package/dist/types/core/requestAliases/index.d.ts +0 -2
- package/dist/types/core/requestAliases/index.d.ts.map +0 -1
- package/dist/types/core/state/EntityListState.d.ts +0 -29
- package/dist/types/core/state/EntityListState.d.ts.map +0 -1
- package/dist/types/core/state/EntityRealmState.d.ts +0 -44
- package/dist/types/core/state/EntityRealmState.d.ts.map +0 -1
- package/dist/types/core/state/EntityState.d.ts +0 -11
- package/dist/types/core/state/EntityState.d.ts.map +0 -1
- package/dist/types/core/state/FieldState.d.ts +0 -19
- package/dist/types/core/state/FieldState.d.ts.map +0 -1
- package/dist/types/core/state/StateIterator.d.ts +0 -14
- package/dist/types/core/state/StateIterator.d.ts.map +0 -1
- package/dist/types/core/state/StateNode.d.ts +0 -8
- package/dist/types/core/state/StateNode.d.ts.map +0 -1
- package/dist/types/core/state/getEntityMarker.d.ts +0 -3
- package/dist/types/core/state/getEntityMarker.d.ts.map +0 -1
- package/dist/types/core/state/index.d.ts +0 -8
- package/dist/types/core/state/index.d.ts.map +0 -1
- package/dist/types/core/utils/getCombinedSignal.d.ts +0 -2
- package/dist/types/core/utils/getCombinedSignal.d.ts.map +0 -1
- package/dist/types/core/utils/index.d.ts +0 -2
- package/dist/types/core/utils/index.d.ts.map +0 -1
- package/dist/types/fieldHelpers/helpers/FieldHelper.d.ts +0 -7
- package/dist/types/fieldHelpers/helpers/FieldHelper.d.ts.map +0 -1
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts +0 -10
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts.map +0 -1
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts +0 -10
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts.map +0 -1
- package/dist/types/fieldHelpers/helpers/index.d.ts +0 -3
- package/dist/types/fieldHelpers/helpers/index.d.ts.map +0 -1
- package/dist/types/fieldHelpers/index.d.ts +0 -2
- package/dist/types/fieldHelpers/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/dist/types/utils/assertNever.d.ts +0 -2
- package/dist/types/utils/assertNever.d.ts.map +0 -1
- package/dist/types/utils/generateEnumerabilityPreventingEntropy.d.ts +0 -2
- package/dist/types/utils/generateEnumerabilityPreventingEntropy.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/isEmptyObject.d.ts +0 -2
- package/dist/types/utils/isEmptyObject.d.ts.map +0 -1
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { assertNever, BindingError, PlaceholderGenerator, QueryLanguage, MarkerComparator } from "@contember/binding-common";
|
|
2
|
-
import { RequestResponseNormalizer } from "./RequestResponseNormalizer.js";
|
|
3
|
-
import { NormalizedPersistedData } from "../accessorTree/NormalizedPersistedData.js";
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
-
const emptyEntityIdSet = /* @__PURE__ */ new Set();
|
|
8
|
-
class TreeStore {
|
|
9
|
-
constructor(_schema) {
|
|
10
|
-
this._schema = _schema;
|
|
11
|
-
__publicField(this, "entityStore", /* @__PURE__ */ new Map());
|
|
12
|
-
__publicField(this, "entityRealmStore", /* @__PURE__ */ new Map());
|
|
13
|
-
__publicField(this, "markerTrees", /* @__PURE__ */ new Map());
|
|
14
|
-
__publicField(this, "subTreeStatesByRoot", /* @__PURE__ */ new Map());
|
|
15
|
-
__publicField(this, "persistedData", new NormalizedPersistedData(/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()));
|
|
16
|
-
}
|
|
17
|
-
mergeInQueryResponse(response, markerTree) {
|
|
18
|
-
RequestResponseNormalizer.mergeInQueryResponse(this.persistedData, response, markerTree);
|
|
19
|
-
}
|
|
20
|
-
mergeInMutationResponse(response, operations) {
|
|
21
|
-
RequestResponseNormalizer.mergeInMutationResponse(this.persistedData, response, operations);
|
|
22
|
-
}
|
|
23
|
-
get persistedEntityData() {
|
|
24
|
-
return this.persistedData.persistedEntityDataStore;
|
|
25
|
-
}
|
|
26
|
-
get subTreePersistedData() {
|
|
27
|
-
return this.persistedData.subTreeDataStore;
|
|
28
|
-
}
|
|
29
|
-
get schema() {
|
|
30
|
-
return this._schema;
|
|
31
|
-
}
|
|
32
|
-
getPathBackToParent(entityRealm) {
|
|
33
|
-
const blueprint = entityRealm.blueprint;
|
|
34
|
-
if (blueprint.parent === void 0) {
|
|
35
|
-
return void 0;
|
|
36
|
-
}
|
|
37
|
-
let parentEntityName;
|
|
38
|
-
let relationFromParent;
|
|
39
|
-
let parent;
|
|
40
|
-
if (blueprint.type === "hasOne") {
|
|
41
|
-
parentEntityName = blueprint.parent.entity.entityName;
|
|
42
|
-
relationFromParent = blueprint.marker.parameters.field;
|
|
43
|
-
parent = blueprint.parent;
|
|
44
|
-
} else if (blueprint.type === "listEntity") {
|
|
45
|
-
const grandparentBlueprint = blueprint.parent.blueprint;
|
|
46
|
-
if (grandparentBlueprint.parent === void 0) {
|
|
47
|
-
return void 0;
|
|
48
|
-
}
|
|
49
|
-
parentEntityName = grandparentBlueprint.parent.entity.entityName;
|
|
50
|
-
relationFromParent = grandparentBlueprint.marker.parameters.field;
|
|
51
|
-
parent = grandparentBlueprint.parent;
|
|
52
|
-
} else {
|
|
53
|
-
return assertNever(blueprint);
|
|
54
|
-
}
|
|
55
|
-
const relationSchema = this.schema.getEntityRelation(parentEntityName, relationFromParent);
|
|
56
|
-
const fieldBack = (relationSchema.ownedBy || relationSchema.inversedBy) ?? null;
|
|
57
|
-
if (fieldBack === null) {
|
|
58
|
-
return void 0;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
parent,
|
|
62
|
-
fieldBackToParent: fieldBack
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
getSubTreeState(mode, treeRootId, aliasOrParameters, environment) {
|
|
66
|
-
const markerRoot = this.markerTrees.get(treeRootId);
|
|
67
|
-
const subTreeStates = this.subTreeStatesByRoot.get(treeRootId);
|
|
68
|
-
if (subTreeStates === void 0 || markerRoot === void 0) {
|
|
69
|
-
if (treeRootId) {
|
|
70
|
-
throw new BindingError(
|
|
71
|
-
`Invalid tree id '${treeRootId}'. Make sure you use the one supplied by the correct extendTree call.`
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
throw new BindingError(`Failed to retrieve a sub tree.`);
|
|
75
|
-
}
|
|
76
|
-
let placeholderName;
|
|
77
|
-
if (typeof aliasOrParameters === "string") {
|
|
78
|
-
const placeholderByAlias = markerRoot.placeholdersByAliases.get(aliasOrParameters);
|
|
79
|
-
if (placeholderByAlias === void 0) {
|
|
80
|
-
throw new BindingError(`Undefined sub-tree alias '${aliasOrParameters}'.`);
|
|
81
|
-
}
|
|
82
|
-
placeholderName = placeholderByAlias;
|
|
83
|
-
} else if (mode === "entityList") {
|
|
84
|
-
placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(
|
|
85
|
-
aliasOrParameters.isCreating ? QueryLanguage.desugarUnconstrainedQualifiedEntityList(
|
|
86
|
-
aliasOrParameters,
|
|
87
|
-
environment
|
|
88
|
-
) : QueryLanguage.desugarQualifiedEntityList(aliasOrParameters, environment),
|
|
89
|
-
environment
|
|
90
|
-
);
|
|
91
|
-
} else if (mode === "entity") {
|
|
92
|
-
placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(
|
|
93
|
-
aliasOrParameters.isCreating ? QueryLanguage.desugarUnconstrainedQualifiedSingleEntity(
|
|
94
|
-
aliasOrParameters,
|
|
95
|
-
environment
|
|
96
|
-
) : QueryLanguage.desugarQualifiedSingleEntity(aliasOrParameters, environment),
|
|
97
|
-
environment
|
|
98
|
-
);
|
|
99
|
-
} else {
|
|
100
|
-
throw new BindingError();
|
|
101
|
-
}
|
|
102
|
-
const subTreeState = subTreeStates.get(placeholderName);
|
|
103
|
-
if (subTreeState === void 0) {
|
|
104
|
-
throw new BindingError(`Trying to retrieve a non-existent sub-tree '${placeholderName}'.`);
|
|
105
|
-
}
|
|
106
|
-
return subTreeState;
|
|
107
|
-
}
|
|
108
|
-
getEntityListPersistedIds(state) {
|
|
109
|
-
const blueprint = state.blueprint;
|
|
110
|
-
if (blueprint.parent) {
|
|
111
|
-
const entityData = this.persistedEntityData.get(blueprint.parent.entity.id.uniqueValue);
|
|
112
|
-
return entityData?.get(blueprint.marker.placeholderName)?.value ?? emptyEntityIdSet;
|
|
113
|
-
} else {
|
|
114
|
-
return this.subTreePersistedData.get(blueprint.marker.placeholderName) ?? emptyEntityIdSet;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
disposeOfRealm(realmToDisposeOf) {
|
|
118
|
-
this.entityRealmStore.delete(realmToDisposeOf.realmKey);
|
|
119
|
-
realmToDisposeOf.entity.realms.delete(realmToDisposeOf.realmKey);
|
|
120
|
-
if (realmToDisposeOf.type === "entityRealm") {
|
|
121
|
-
realmToDisposeOf.blueprint.parent?.childrenWithPendingUpdates?.delete(realmToDisposeOf);
|
|
122
|
-
for (const child of realmToDisposeOf.children.values()) {
|
|
123
|
-
switch (child.type) {
|
|
124
|
-
case "field":
|
|
125
|
-
continue;
|
|
126
|
-
case "entityRealm":
|
|
127
|
-
case "entityRealmStub": {
|
|
128
|
-
this.disposeOfRealm(child);
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
case "entityList": {
|
|
132
|
-
for (const listChild of child.children.values()) {
|
|
133
|
-
this.disposeOfRealm(listChild);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
const entity = realmToDisposeOf.entity;
|
|
140
|
-
if (entity.realms.size === 0) {
|
|
141
|
-
this.disposeOfEntity(entity);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
disposeOfEntity(entity) {
|
|
145
|
-
for (const realm of entity.realms.values()) {
|
|
146
|
-
this.disposeOfRealm(realm);
|
|
147
|
-
}
|
|
148
|
-
this.entityStore.delete(entity.id.uniqueValue);
|
|
149
|
-
this.persistedEntityData.delete(entity.id.uniqueValue);
|
|
150
|
-
}
|
|
151
|
-
effectivelyHasTreeRoot(candidateRoot) {
|
|
152
|
-
candidateRoots: for (const candidateSubTree of candidateRoot.subTrees.values()) {
|
|
153
|
-
if (candidateSubTree.parameters.isCreating) {
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
for (const root of this.markerTrees.values()) {
|
|
157
|
-
for (const alreadyPresentSubTree of root.subTrees.values()) {
|
|
158
|
-
const isSubset = MarkerComparator.isSubTreeSubsetOf(candidateSubTree, alreadyPresentSubTree);
|
|
159
|
-
if (isSubset) {
|
|
160
|
-
continue candidateRoots;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
export {
|
|
170
|
-
TreeStore
|
|
171
|
-
};
|
|
172
|
-
//# sourceMappingURL=TreeStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeStore.js","sources":["../../../../../packages/binding-legacy/src/core/TreeStore.ts"],"sourcesContent":["import { NormalizedPersistedData, PersistedEntityDataStore, SubTreeDataStore } from '../accessorTree'\nimport type {\n\tAlias,\n\tEntityId,\n\tEntityName,\n\tEntityRealmKey,\n\tEnvironment,\n\tFieldName,\n\tPlaceholderName,\n\tReceivedDataTree,\n\tSchema,\n\tSugaredQualifiedEntityList,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n\tUniqueEntityId,\n} from '@contember/binding-common'\nimport { BindingError, MarkerComparator, MarkerTreeRoot, PlaceholderGenerator, QueryLanguage } from '@contember/binding-common'\nimport { assertNever } from '@contember/binding-common'\nimport { RequestResponseNormalizer } from './RequestResponseNormalizer'\nimport type { EntityListState, EntityRealmState, EntityRealmStateStub, EntityState, RootStateNode } from './state'\nimport { SubMutationOperation } from './MutationGenerator'\n\nconst emptyEntityIdSet: ReadonlySet<EntityId> = new Set()\n\nexport class TreeStore {\n\tpublic readonly entityStore: Map<UniqueEntityId, EntityState> = new Map()\n\tpublic readonly entityRealmStore: Map<EntityRealmKey, EntityRealmState | EntityRealmStateStub> = new Map()\n\n\t// This is tricky. We allow placeholder name duplicates, only the (TreeRootId, PlaceholderName) tuple is unique.\n\t// This is useful when the tree is extended to contain a sub-tree with the same placeholder.\n\tpublic readonly markerTrees: Map<TreeRootId | undefined, MarkerTreeRoot> = new Map()\n\tpublic readonly subTreeStatesByRoot: Map<TreeRootId | undefined, Map<PlaceholderName, RootStateNode>> = new Map()\n\n\tpublic readonly persistedData: NormalizedPersistedData = new NormalizedPersistedData(new Map(), new Map())\n\n\tpublic constructor(\n\t\tprivate readonly _schema: Schema,\n\t) {}\n\n\tpublic mergeInQueryResponse(response: ReceivedDataTree, markerTree: MarkerTreeRoot): void {\n\t\tRequestResponseNormalizer.mergeInQueryResponse(this.persistedData, response, markerTree)\n\t}\n\n\tpublic mergeInMutationResponse(response: ReceivedDataTree, operations: SubMutationOperation[]): void {\n\t\tRequestResponseNormalizer.mergeInMutationResponse(this.persistedData, response, operations)\n\t}\n\n\tpublic get persistedEntityData(): PersistedEntityDataStore {\n\t\treturn this.persistedData.persistedEntityDataStore\n\t}\n\n\tpublic get subTreePersistedData(): SubTreeDataStore {\n\t\treturn this.persistedData.subTreeDataStore\n\t}\n\n\tpublic get schema(): Schema {\n\t\treturn this._schema\n\t}\n\n\tpublic getPathBackToParent(entityRealm: EntityRealmState | EntityRealmStateStub):\n\t\t| {\n\t\t\tfieldBackToParent: FieldName\n\t\t\tparent: EntityRealmState\n\t\t }\n\t\t| undefined {\n\t\tconst blueprint = entityRealm.blueprint\n\t\tif (blueprint.parent === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tlet parentEntityName: EntityName\n\t\tlet relationFromParent: FieldName\n\t\tlet parent: EntityRealmState\n\n\t\tif (blueprint.type === 'hasOne') {\n\t\t\tparentEntityName = blueprint.parent.entity.entityName\n\t\t\trelationFromParent = blueprint.marker.parameters.field\n\t\t\tparent = blueprint.parent\n\t\t} else if (blueprint.type === 'listEntity') {\n\t\t\tconst grandparentBlueprint = blueprint.parent.blueprint\n\n\t\t\tif (grandparentBlueprint.parent === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tparentEntityName = grandparentBlueprint.parent.entity.entityName\n\t\t\trelationFromParent = grandparentBlueprint.marker.parameters.field\n\t\t\tparent = grandparentBlueprint.parent\n\t\t} else {\n\t\t\treturn assertNever(blueprint)\n\t\t}\n\n\t\tconst relationSchema = this.schema.getEntityRelation(parentEntityName, relationFromParent)\n\t\tconst fieldBack = (relationSchema.ownedBy || relationSchema.inversedBy) ?? null\n\n\t\t// console.log(parentEntityName, relationFromParent, entityRealm.entity.entityName, fieldBack)\n\t\tif (fieldBack === null) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn {\n\t\t\tparent,\n\t\t\tfieldBackToParent: fieldBack,\n\t\t}\n\t}\n\n\tpublic getSubTreeState(\n\t\tmode: 'entity',\n\t\ttreeRootId: TreeRootId | undefined,\n\t\taliasOrParameters: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\tenvironment: Environment,\n\t): EntityRealmState\n\tpublic getSubTreeState(\n\t\tmode: 'entityList',\n\t\ttreeRootId: TreeRootId | undefined,\n\t\taliasOrParameters: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\tenvironment: Environment,\n\t): EntityListState\n\tpublic getSubTreeState(\n\t\tmode: 'entity' | 'entityList',\n\t\ttreeRootId: TreeRootId | undefined,\n\t\taliasOrParameters:\n\t\t\t| Alias\n\t\t\t| SugaredQualifiedSingleEntity\n\t\t\t| SugaredUnconstrainedQualifiedSingleEntity\n\t\t\t| SugaredQualifiedEntityList\n\t\t\t| SugaredUnconstrainedQualifiedEntityList,\n\t\tenvironment: Environment,\n\t): RootStateNode {\n\t\tconst markerRoot = this.markerTrees.get(treeRootId)\n\t\tconst subTreeStates = this.subTreeStatesByRoot.get(treeRootId)\n\n\t\tif (subTreeStates === undefined || markerRoot === undefined) {\n\t\t\tif (treeRootId) {\n\t\t\t\tthrow new BindingError(\n\t\t\t\t\t`Invalid tree id '${treeRootId}'. Make sure you use the one supplied by the correct extendTree call.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tthrow new BindingError(`Failed to retrieve a sub tree.`)\n\t\t}\n\n\t\tlet placeholderName: string\n\n\t\tif (typeof aliasOrParameters === 'string') {\n\t\t\tconst placeholderByAlias = markerRoot.placeholdersByAliases.get(aliasOrParameters)\n\n\t\t\tif (placeholderByAlias === undefined) {\n\t\t\t\tthrow new BindingError(`Undefined sub-tree alias '${aliasOrParameters}'.`)\n\t\t\t}\n\t\t\tplaceholderName = placeholderByAlias\n\t\t} else if (mode === 'entityList') {\n\t\t\tplaceholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(\n\t\t\t\taliasOrParameters.isCreating\n\t\t\t\t\t? QueryLanguage.desugarUnconstrainedQualifiedEntityList(\n\t\t\t\t\t\taliasOrParameters as SugaredUnconstrainedQualifiedEntityList,\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t )\n\t\t\t\t\t: QueryLanguage.desugarQualifiedEntityList(aliasOrParameters as SugaredQualifiedEntityList, environment),\n\t\t\t\tenvironment,\n\t\t\t)\n\t\t} else if (mode === 'entity') {\n\t\t\tplaceholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(\n\t\t\t\taliasOrParameters.isCreating\n\t\t\t\t\t? QueryLanguage.desugarUnconstrainedQualifiedSingleEntity(\n\t\t\t\t\t\taliasOrParameters as SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t )\n\t\t\t\t\t: QueryLanguage.desugarQualifiedSingleEntity(aliasOrParameters as SugaredQualifiedSingleEntity, environment),\n\t\t\t\tenvironment,\n\t\t\t)\n\t\t} else {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\tconst subTreeState = subTreeStates.get(placeholderName)\n\n\t\tif (subTreeState === undefined) {\n\t\t\tthrow new BindingError(`Trying to retrieve a non-existent sub-tree '${placeholderName}'.`)\n\t\t}\n\t\treturn subTreeState\n\t}\n\n\tpublic getEntityListPersistedIds(state: EntityListState): ReadonlySet<EntityId> {\n\t\tconst blueprint = state.blueprint\n\n\t\tif (blueprint.parent) {\n\t\t\tconst entityData = this.persistedEntityData.get(blueprint.parent.entity.id.uniqueValue)\n\t\t\treturn (entityData?.get(blueprint.marker.placeholderName)?.value as Set<string> | undefined) ?? emptyEntityIdSet\n\t\t} else {\n\t\t\treturn (this.subTreePersistedData.get(blueprint.marker.placeholderName) as Set<string>) ?? emptyEntityIdSet\n\t\t}\n\t}\n\n\tpublic disposeOfRealm(realmToDisposeOf: EntityRealmState | EntityRealmStateStub) {\n\t\tthis.entityRealmStore.delete(realmToDisposeOf.realmKey)\n\t\trealmToDisposeOf.entity.realms.delete(realmToDisposeOf.realmKey)\n\n\t\tif (realmToDisposeOf.type === 'entityRealm') {\n\t\t\trealmToDisposeOf.blueprint.parent?.childrenWithPendingUpdates?.delete(realmToDisposeOf)\n\n\t\t\tfor (const child of realmToDisposeOf.children.values()) {\n\t\t\t\tswitch (child.type) {\n\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcontinue\n\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\tcase 'entityRealmStub': {\n\t\t\t\t\t\tthis.disposeOfRealm(child)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 'entityList': {\n\t\t\t\t\t\tfor (const listChild of child.children.values()) {\n\t\t\t\t\t\t\tthis.disposeOfRealm(listChild)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst entity = realmToDisposeOf.entity\n\t\tif (entity.realms.size === 0) {\n\t\t\tthis.disposeOfEntity(entity)\n\t\t}\n\t}\n\n\tpublic disposeOfEntity(entity: EntityState) {\n\t\tfor (const realm of entity.realms.values()) {\n\t\t\tthis.disposeOfRealm(realm)\n\t\t}\n\t\tthis.entityStore.delete(entity.id.uniqueValue)\n\t\tthis.persistedEntityData.delete(entity.id.uniqueValue)\n\t}\n\n\tpublic effectivelyHasTreeRoot(candidateRoot: MarkerTreeRoot): boolean {\n\t\tcandidateRoots: for (const candidateSubTree of candidateRoot.subTrees.values()) {\n\t\t\tif (candidateSubTree.parameters.isCreating) {\n\t\t\t\t// This, by definition, won't trigger a query.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor (const root of this.markerTrees.values()) {\n\t\t\t\tfor (const alreadyPresentSubTree of root.subTrees.values()) {\n\t\t\t\t\tconst isSubset = MarkerComparator.isSubTreeSubsetOf(candidateSubTree, alreadyPresentSubTree)\n\t\t\t\t\tif (isSubset) {\n\t\t\t\t\t\tcontinue candidateRoots\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,uCAA8C,IAAI;AAEjD,MAAM,UAAU;AAAA,EAWf,YACW,SAChB;AADgB,SAAA,UAAA;AAXF,kBAAA,MAAA,mCAAoD,IAAI,CAAA;AACxD,kBAAA,MAAA,wCAAqF,IAAI,CAAA;AAIzF,kBAAA,MAAA,mCAA+D,IAAI,CAAA;AACnE,kBAAA,MAAA,2CAA4F,IAAI,CAAA;AAEhG,kBAAA,MAAA,iBAAyC,IAAI,wBAAwB,oBAAI,IAAO,GAAA,oBAAI,KAAK,CAAA;AAAA,EAAA;AAAA,EAMlG,qBAAqB,UAA4B,YAAkC;AACzF,8BAA0B,qBAAqB,KAAK,eAAe,UAAU,UAAU;AAAA,EAAA;AAAA,EAGjF,wBAAwB,UAA4B,YAA0C;AACpG,8BAA0B,wBAAwB,KAAK,eAAe,UAAU,UAAU;AAAA,EAAA;AAAA,EAG3F,IAAW,sBAAgD;AAC1D,WAAO,KAAK,cAAc;AAAA,EAAA;AAAA,EAG3B,IAAW,uBAAyC;AACnD,WAAO,KAAK,cAAc;AAAA,EAAA;AAAA,EAG3B,IAAW,SAAiB;AAC3B,WAAO,KAAK;AAAA,EAAA;AAAA,EAGN,oBAAoB,aAKd;AACZ,UAAM,YAAY,YAAY;AAC1B,QAAA,UAAU,WAAW,QAAW;AAC5B,aAAA;AAAA,IAAA;AAEJ,QAAA;AACA,QAAA;AACA,QAAA;AAEA,QAAA,UAAU,SAAS,UAAU;AACb,yBAAA,UAAU,OAAO,OAAO;AACtB,2BAAA,UAAU,OAAO,WAAW;AACjD,eAAS,UAAU;AAAA,IAAA,WACT,UAAU,SAAS,cAAc;AACrC,YAAA,uBAAuB,UAAU,OAAO;AAE1C,UAAA,qBAAqB,WAAW,QAAW;AACvC,eAAA;AAAA,MAAA;AAEW,yBAAA,qBAAqB,OAAO,OAAO;AACjC,2BAAA,qBAAqB,OAAO,WAAW;AAC5D,eAAS,qBAAqB;AAAA,IAAA,OACxB;AACN,aAAO,YAAY,SAAS;AAAA,IAAA;AAG7B,UAAM,iBAAiB,KAAK,OAAO,kBAAkB,kBAAkB,kBAAkB;AACzF,UAAM,aAAa,eAAe,WAAW,eAAe,eAAe;AAG3E,QAAI,cAAc,MAAM;AAChB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,MACN;AAAA,MACA,mBAAmB;AAAA,IACpB;AAAA,EAAA;AAAA,EAeM,gBACN,MACA,YACA,mBAMA,aACgB;AAChB,UAAM,aAAa,KAAK,YAAY,IAAI,UAAU;AAClD,UAAM,gBAAgB,KAAK,oBAAoB,IAAI,UAAU;AAEzD,QAAA,kBAAkB,UAAa,eAAe,QAAW;AAC5D,UAAI,YAAY;AACf,cAAM,IAAI;AAAA,UACT,oBAAoB,UAAU;AAAA,QAC/B;AAAA,MAAA;AAEK,YAAA,IAAI,aAAa,gCAAgC;AAAA,IAAA;AAGpD,QAAA;AAEA,QAAA,OAAO,sBAAsB,UAAU;AAC1C,YAAM,qBAAqB,WAAW,sBAAsB,IAAI,iBAAiB;AAEjF,UAAI,uBAAuB,QAAW;AACrC,cAAM,IAAI,aAAa,6BAA6B,iBAAiB,IAAI;AAAA,MAAA;AAExD,wBAAA;AAAA,IAAA,WACR,SAAS,cAAc;AACjC,wBAAkB,qBAAqB;AAAA,QACtC,kBAAkB,aACf,cAAc;AAAA,UACf;AAAA,UACA;AAAA,QAEC,IAAA,cAAc,2BAA2B,mBAAiD,WAAW;AAAA,QACxG;AAAA,MACD;AAAA,IAAA,WACU,SAAS,UAAU;AAC7B,wBAAkB,qBAAqB;AAAA,QACtC,kBAAkB,aACf,cAAc;AAAA,UACf;AAAA,UACA;AAAA,QAEC,IAAA,cAAc,6BAA6B,mBAAmD,WAAW;AAAA,QAC5G;AAAA,MACD;AAAA,IAAA,OACM;AACN,YAAM,IAAI,aAAa;AAAA,IAAA;AAElB,UAAA,eAAe,cAAc,IAAI,eAAe;AAEtD,QAAI,iBAAiB,QAAW;AAC/B,YAAM,IAAI,aAAa,+CAA+C,eAAe,IAAI;AAAA,IAAA;AAEnF,WAAA;AAAA,EAAA;AAAA,EAGD,0BAA0B,OAA+C;AAC/E,UAAM,YAAY,MAAM;AAExB,QAAI,UAAU,QAAQ;AACf,YAAA,aAAa,KAAK,oBAAoB,IAAI,UAAU,OAAO,OAAO,GAAG,WAAW;AACtF,aAAQ,YAAY,IAAI,UAAU,OAAO,eAAe,GAAG,SAAqC;AAAA,IAAA,OAC1F;AACN,aAAQ,KAAK,qBAAqB,IAAI,UAAU,OAAO,eAAe,KAAqB;AAAA,IAAA;AAAA,EAC5F;AAAA,EAGM,eAAe,kBAA2D;AAC3E,SAAA,iBAAiB,OAAO,iBAAiB,QAAQ;AACtD,qBAAiB,OAAO,OAAO,OAAO,iBAAiB,QAAQ;AAE3D,QAAA,iBAAiB,SAAS,eAAe;AAC5C,uBAAiB,UAAU,QAAQ,4BAA4B,OAAO,gBAAgB;AAEtF,iBAAW,SAAS,iBAAiB,SAAS,OAAA,GAAU;AACvD,gBAAQ,MAAM,MAAM;AAAA,UACnB,KAAK;AACJ;AAAA,UACD,KAAK;AAAA,UACL,KAAK,mBAAmB;AACvB,iBAAK,eAAe,KAAK;AACzB;AAAA,UAAA;AAAA,UAED,KAAK,cAAc;AAClB,uBAAW,aAAa,MAAM,SAAS,OAAA,GAAU;AAChD,mBAAK,eAAe,SAAS;AAAA,YAAA;AAAA,UAC9B;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAGD,UAAM,SAAS,iBAAiB;AAC5B,QAAA,OAAO,OAAO,SAAS,GAAG;AAC7B,WAAK,gBAAgB,MAAM;AAAA,IAAA;AAAA,EAC5B;AAAA,EAGM,gBAAgB,QAAqB;AAC3C,eAAW,SAAS,OAAO,OAAO,OAAA,GAAU;AAC3C,WAAK,eAAe,KAAK;AAAA,IAAA;AAE1B,SAAK,YAAY,OAAO,OAAO,GAAG,WAAW;AAC7C,SAAK,oBAAoB,OAAO,OAAO,GAAG,WAAW;AAAA,EAAA;AAAA,EAG/C,uBAAuB,eAAwC;AACrE,mBAA2B,YAAA,oBAAoB,cAAc,SAAS,UAAU;AAC3E,UAAA,iBAAiB,WAAW,YAAY;AAE3C;AAAA,MAAA;AAED,iBAAW,QAAQ,KAAK,YAAY,OAAA,GAAU;AAC7C,mBAAW,yBAAyB,KAAK,SAAS,OAAA,GAAU;AAC3D,gBAAM,WAAW,iBAAiB,kBAAkB,kBAAkB,qBAAqB;AAC3F,cAAI,UAAU;AACJ,qBAAA;AAAA,UAAA;AAAA,QACV;AAAA,MACD;AAEM,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,EAAA;AAET;"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const bindingCommon = require("@contember/binding-common");
|
|
4
|
-
const MarkerSugarer = require("./MarkerSugarer.cjs");
|
|
5
|
-
const TreeParameterSugarer = require("./TreeParameterSugarer.cjs");
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
9
|
-
class ErrorLocator {
|
|
10
|
-
static locateMarkerPath(path) {
|
|
11
|
-
return path.map((marker) => MarkerSugarer.MarkerSugarer.sugarMarker(marker)).join(this.GLUE);
|
|
12
|
-
}
|
|
13
|
-
static locateInternalState(state) {
|
|
14
|
-
function stateToPath(state2) {
|
|
15
|
-
if (state2 === void 0) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
switch (state2.type) {
|
|
19
|
-
case "field":
|
|
20
|
-
return [...stateToPath(state2.parent), TreeParameterSugarer.TreeParameterSugarer.sugarField(state2.fieldMarker.fieldName)];
|
|
21
|
-
case "entityRealm": {
|
|
22
|
-
const blueprint = state2.blueprint;
|
|
23
|
-
if (blueprint.type === "subTree") {
|
|
24
|
-
return [
|
|
25
|
-
TreeParameterSugarer.TreeParameterSugarer.sugarRootEntity(
|
|
26
|
-
state2.entity.entityName,
|
|
27
|
-
blueprint.marker.parameters.isCreating ? void 0 : blueprint.marker.parameters.where
|
|
28
|
-
)
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
if (blueprint.type === "listEntity") {
|
|
32
|
-
return [...stateToPath(blueprint.parent)];
|
|
33
|
-
}
|
|
34
|
-
if (blueprint.type === "hasOne") {
|
|
35
|
-
return [...stateToPath(blueprint.parent), MarkerSugarer.MarkerSugarer.sugarHasOneRelationMarker(blueprint.marker)];
|
|
36
|
-
}
|
|
37
|
-
return bindingCommon.assertNever(blueprint);
|
|
38
|
-
}
|
|
39
|
-
case "entityList": {
|
|
40
|
-
const blueprint = state2.blueprint;
|
|
41
|
-
if (blueprint.parent === void 0) {
|
|
42
|
-
return [
|
|
43
|
-
TreeParameterSugarer.TreeParameterSugarer.sugarRootEntityList(
|
|
44
|
-
state2.entityName,
|
|
45
|
-
blueprint.marker.parameters.isCreating ? void 0 : blueprint.marker.parameters.filter
|
|
46
|
-
)
|
|
47
|
-
];
|
|
48
|
-
}
|
|
49
|
-
const hasMany = blueprint.marker;
|
|
50
|
-
return [...stateToPath(blueprint.parent), MarkerSugarer.MarkerSugarer.sugarHasManyRelationMarker(hasMany)];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return stateToPath(state).join(this.GLUE);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
__publicField(ErrorLocator, "GLUE", ".");
|
|
58
|
-
exports.ErrorLocator = ErrorLocator;
|
|
59
|
-
//# sourceMappingURL=ErrorLocator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorLocator.cjs","sources":["../../../../../../packages/binding-legacy/src/core/exceptions/ErrorLocator.ts"],"sourcesContent":["import { assertNever } from '@contember/binding-common'\nimport type { StateNode } from '../state'\nimport type { MeaningfulMarker } from '@contember/binding-common'\nimport { MarkerSugarer } from './MarkerSugarer'\nimport { TreeParameterSugarer } from './TreeParameterSugarer'\n\nexport class ErrorLocator {\n\tprivate static readonly GLUE = '.'\n\n\tpublic static locateMarkerPath(path: MeaningfulMarker[]): string {\n\t\treturn path.map(marker => MarkerSugarer.sugarMarker(marker)).join(this.GLUE)\n\t}\n\n\tpublic static locateInternalState(state: StateNode): string {\n\t\tfunction stateToPath(state: StateNode | undefined): string[] {\n\t\t\tif (state === undefined) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tswitch (state.type) {\n\t\t\t\tcase 'field':\n\t\t\t\t\treturn [...stateToPath(state.parent), TreeParameterSugarer.sugarField(state.fieldMarker.fieldName)]\n\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\t\t\t\t\tif (blueprint.type === 'subTree') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntity(\n\t\t\t\t\t\t\t\tstate.entity.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.where,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'listEntity') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent)]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'hasOne') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasOneRelationMarker(blueprint.marker)]\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(blueprint)\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\n\t\t\t\t\tif (blueprint.parent === undefined) {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntityList(\n\t\t\t\t\t\t\t\tstate.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.filter,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tconst hasMany = blueprint.marker\n\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasManyRelationMarker(hasMany)]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stateToPath(state).join(this.GLUE)\n\t}\n}\n"],"names":["MarkerSugarer","state","TreeParameterSugarer","assertNever"],"mappings":";;;;;;;;AAMO,MAAM,aAAa;AAAA,EAGzB,OAAc,iBAAiB,MAAkC;AACzD,WAAA,KAAK,IAAI,CAAA,WAAUA,cAAc,cAAA,YAAY,MAAM,CAAC,EAAE,KAAK,KAAK,IAAI;AAAA,EAAA;AAAA,EAG5E,OAAc,oBAAoB,OAA0B;AAC3D,aAAS,YAAYC,QAAwC;AAC5D,UAAIA,WAAU,QAAW;AACxB,eAAO,CAAC;AAAA,MAAA;AAET,cAAQA,OAAM,MAAM;AAAA,QACnB,KAAK;AACG,iBAAA,CAAC,GAAG,YAAYA,OAAM,MAAM,GAAGC,0CAAqB,WAAWD,OAAM,YAAY,SAAS,CAAC;AAAA,QACnG,KAAK,eAAe;AACnB,gBAAM,YAAYA,OAAM;AACpB,cAAA,UAAU,SAAS,WAAW;AAC1B,mBAAA;AAAA,cACNC,qBAAAA,qBAAqB;AAAA,gBACpBD,OAAM,OAAO;AAAA,gBACb,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAAA;AAAA,YAEnF;AAAA,UAAA;AAEG,cAAA,UAAU,SAAS,cAAc;AACpC,mBAAO,CAAC,GAAG,YAAY,UAAU,MAAM,CAAC;AAAA,UAAA;AAErC,cAAA,UAAU,SAAS,UAAU;AACzB,mBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAGD,cAAAA,cAAc,0BAA0B,UAAU,MAAM,CAAC;AAAA,UAAA;AAEpG,iBAAOG,cAAAA,YAAY,SAAS;AAAA,QAAA;AAAA,QAE7B,KAAK,cAAc;AAClB,gBAAM,YAAYF,OAAM;AAEpB,cAAA,UAAU,WAAW,QAAW;AAC5B,mBAAA;AAAA,cACNC,qBAAAA,qBAAqB;AAAA,gBACpBD,OAAM;AAAA,gBACN,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAAA;AAAA,YAEnF;AAAA,UAAA;AAED,gBAAM,UAAU,UAAU;AACnB,iBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAGD,4BAAc,2BAA2B,OAAO,CAAC;AAAA,QAAA;AAAA,MAC5F;AAAA,IACD;AAED,WAAO,YAAY,KAAK,EAAE,KAAK,KAAK,IAAI;AAAA,EAAA;AAE1C;AAlDC,cADY,cACY,QAAO,GAAA;;"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { assertNever } from "@contember/binding-common";
|
|
2
|
-
import { MarkerSugarer } from "./MarkerSugarer.js";
|
|
3
|
-
import { TreeParameterSugarer } from "./TreeParameterSugarer.js";
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
7
|
-
class ErrorLocator {
|
|
8
|
-
static locateMarkerPath(path) {
|
|
9
|
-
return path.map((marker) => MarkerSugarer.sugarMarker(marker)).join(this.GLUE);
|
|
10
|
-
}
|
|
11
|
-
static locateInternalState(state) {
|
|
12
|
-
function stateToPath(state2) {
|
|
13
|
-
if (state2 === void 0) {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
switch (state2.type) {
|
|
17
|
-
case "field":
|
|
18
|
-
return [...stateToPath(state2.parent), TreeParameterSugarer.sugarField(state2.fieldMarker.fieldName)];
|
|
19
|
-
case "entityRealm": {
|
|
20
|
-
const blueprint = state2.blueprint;
|
|
21
|
-
if (blueprint.type === "subTree") {
|
|
22
|
-
return [
|
|
23
|
-
TreeParameterSugarer.sugarRootEntity(
|
|
24
|
-
state2.entity.entityName,
|
|
25
|
-
blueprint.marker.parameters.isCreating ? void 0 : blueprint.marker.parameters.where
|
|
26
|
-
)
|
|
27
|
-
];
|
|
28
|
-
}
|
|
29
|
-
if (blueprint.type === "listEntity") {
|
|
30
|
-
return [...stateToPath(blueprint.parent)];
|
|
31
|
-
}
|
|
32
|
-
if (blueprint.type === "hasOne") {
|
|
33
|
-
return [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasOneRelationMarker(blueprint.marker)];
|
|
34
|
-
}
|
|
35
|
-
return assertNever(blueprint);
|
|
36
|
-
}
|
|
37
|
-
case "entityList": {
|
|
38
|
-
const blueprint = state2.blueprint;
|
|
39
|
-
if (blueprint.parent === void 0) {
|
|
40
|
-
return [
|
|
41
|
-
TreeParameterSugarer.sugarRootEntityList(
|
|
42
|
-
state2.entityName,
|
|
43
|
-
blueprint.marker.parameters.isCreating ? void 0 : blueprint.marker.parameters.filter
|
|
44
|
-
)
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
const hasMany = blueprint.marker;
|
|
48
|
-
return [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasManyRelationMarker(hasMany)];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return stateToPath(state).join(this.GLUE);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
__publicField(ErrorLocator, "GLUE", ".");
|
|
56
|
-
export {
|
|
57
|
-
ErrorLocator
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=ErrorLocator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorLocator.js","sources":["../../../../../../packages/binding-legacy/src/core/exceptions/ErrorLocator.ts"],"sourcesContent":["import { assertNever } from '@contember/binding-common'\nimport type { StateNode } from '../state'\nimport type { MeaningfulMarker } from '@contember/binding-common'\nimport { MarkerSugarer } from './MarkerSugarer'\nimport { TreeParameterSugarer } from './TreeParameterSugarer'\n\nexport class ErrorLocator {\n\tprivate static readonly GLUE = '.'\n\n\tpublic static locateMarkerPath(path: MeaningfulMarker[]): string {\n\t\treturn path.map(marker => MarkerSugarer.sugarMarker(marker)).join(this.GLUE)\n\t}\n\n\tpublic static locateInternalState(state: StateNode): string {\n\t\tfunction stateToPath(state: StateNode | undefined): string[] {\n\t\t\tif (state === undefined) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tswitch (state.type) {\n\t\t\t\tcase 'field':\n\t\t\t\t\treturn [...stateToPath(state.parent), TreeParameterSugarer.sugarField(state.fieldMarker.fieldName)]\n\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\t\t\t\t\tif (blueprint.type === 'subTree') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntity(\n\t\t\t\t\t\t\t\tstate.entity.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.where,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'listEntity') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent)]\n\t\t\t\t\t}\n\t\t\t\t\tif (blueprint.type === 'hasOne') {\n\t\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasOneRelationMarker(blueprint.marker)]\n\t\t\t\t\t}\n\t\t\t\t\treturn assertNever(blueprint)\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tconst blueprint = state.blueprint\n\n\t\t\t\t\tif (blueprint.parent === undefined) {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tTreeParameterSugarer.sugarRootEntityList(\n\t\t\t\t\t\t\t\tstate.entityName,\n\t\t\t\t\t\t\t\tblueprint.marker.parameters.isCreating ? undefined : blueprint.marker.parameters.filter,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tconst hasMany = blueprint.marker\n\t\t\t\t\treturn [...stateToPath(blueprint.parent), MarkerSugarer.sugarHasManyRelationMarker(hasMany)]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stateToPath(state).join(this.GLUE)\n\t}\n}\n"],"names":["state"],"mappings":";;;;;;AAMO,MAAM,aAAa;AAAA,EAGzB,OAAc,iBAAiB,MAAkC;AACzD,WAAA,KAAK,IAAI,CAAA,WAAU,cAAc,YAAY,MAAM,CAAC,EAAE,KAAK,KAAK,IAAI;AAAA,EAAA;AAAA,EAG5E,OAAc,oBAAoB,OAA0B;AAC3D,aAAS,YAAYA,QAAwC;AAC5D,UAAIA,WAAU,QAAW;AACxB,eAAO,CAAC;AAAA,MAAA;AAET,cAAQA,OAAM,MAAM;AAAA,QACnB,KAAK;AACG,iBAAA,CAAC,GAAG,YAAYA,OAAM,MAAM,GAAG,qBAAqB,WAAWA,OAAM,YAAY,SAAS,CAAC;AAAA,QACnG,KAAK,eAAe;AACnB,gBAAM,YAAYA,OAAM;AACpB,cAAA,UAAU,SAAS,WAAW;AAC1B,mBAAA;AAAA,cACN,qBAAqB;AAAA,gBACpBA,OAAM,OAAO;AAAA,gBACb,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAAA;AAAA,YAEnF;AAAA,UAAA;AAEG,cAAA,UAAU,SAAS,cAAc;AACpC,mBAAO,CAAC,GAAG,YAAY,UAAU,MAAM,CAAC;AAAA,UAAA;AAErC,cAAA,UAAU,SAAS,UAAU;AACzB,mBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAG,cAAc,0BAA0B,UAAU,MAAM,CAAC;AAAA,UAAA;AAEpG,iBAAO,YAAY,SAAS;AAAA,QAAA;AAAA,QAE7B,KAAK,cAAc;AAClB,gBAAM,YAAYA,OAAM;AAEpB,cAAA,UAAU,WAAW,QAAW;AAC5B,mBAAA;AAAA,cACN,qBAAqB;AAAA,gBACpBA,OAAM;AAAA,gBACN,UAAU,OAAO,WAAW,aAAa,SAAY,UAAU,OAAO,WAAW;AAAA,cAAA;AAAA,YAEnF;AAAA,UAAA;AAED,gBAAM,UAAU,UAAU;AACnB,iBAAA,CAAC,GAAG,YAAY,UAAU,MAAM,GAAG,cAAc,2BAA2B,OAAO,CAAC;AAAA,QAAA;AAAA,MAC5F;AAAA,IACD;AAED,WAAO,YAAY,KAAK,EAAE,KAAK,KAAK,IAAI;AAAA,EAAA;AAE1C;AAlDC,cADY,cACY,QAAO,GAAA;"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const bindingCommon = require("@contember/binding-common");
|
|
4
|
-
const TreeParameterSugarer = require("./TreeParameterSugarer.cjs");
|
|
5
|
-
class MarkerSugarer {
|
|
6
|
-
static sugarMarker(marker) {
|
|
7
|
-
if (marker instanceof bindingCommon.FieldMarker) {
|
|
8
|
-
return this.sugarFieldMarker(marker);
|
|
9
|
-
}
|
|
10
|
-
if (marker instanceof bindingCommon.HasOneRelationMarker) {
|
|
11
|
-
return this.sugarHasOneRelationMarker(marker);
|
|
12
|
-
}
|
|
13
|
-
if (marker instanceof bindingCommon.HasManyRelationMarker) {
|
|
14
|
-
return this.sugarHasManyRelationMarker(marker);
|
|
15
|
-
}
|
|
16
|
-
if (marker instanceof bindingCommon.EntityListSubTreeMarker) {
|
|
17
|
-
return this.sugarEntityListSubTreeMarker(marker);
|
|
18
|
-
}
|
|
19
|
-
if (marker instanceof bindingCommon.EntitySubTreeMarker) {
|
|
20
|
-
return this.sugarEntitySubTreeMarker(marker);
|
|
21
|
-
}
|
|
22
|
-
return bindingCommon.assertNever(marker);
|
|
23
|
-
}
|
|
24
|
-
static sugarFieldMarker(field) {
|
|
25
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarField(field.fieldName);
|
|
26
|
-
}
|
|
27
|
-
static sugarHasOneRelationMarker(hasOne) {
|
|
28
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarHasOneRelation(
|
|
29
|
-
hasOne.parameters.field,
|
|
30
|
-
hasOne.parameters.reducedBy,
|
|
31
|
-
hasOne.parameters.filter
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
static sugarHasManyRelationMarker(hasMany) {
|
|
35
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarHasManyRelation(hasMany.parameters.field, hasMany.parameters.filter);
|
|
36
|
-
}
|
|
37
|
-
static sugarEntitySubTreeMarker(subTree) {
|
|
38
|
-
if (subTree.parameters.isCreating) {
|
|
39
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarRootEntity(subTree.entityName, void 0);
|
|
40
|
-
}
|
|
41
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarRootEntity(subTree.entityName, subTree.parameters.where);
|
|
42
|
-
}
|
|
43
|
-
static sugarEntityListSubTreeMarker(subTree) {
|
|
44
|
-
if (subTree.parameters.isCreating) {
|
|
45
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarRootEntityList(subTree.entityName, void 0);
|
|
46
|
-
}
|
|
47
|
-
return TreeParameterSugarer.TreeParameterSugarer.sugarRootEntityList(subTree.entityName, subTree.parameters.filter);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.MarkerSugarer = MarkerSugarer;
|
|
51
|
-
//# sourceMappingURL=MarkerSugarer.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerSugarer.cjs","sources":["../../../../../../packages/binding-legacy/src/core/exceptions/MarkerSugarer.ts"],"sourcesContent":["import {\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMeaningfulMarker,\n} from '@contember/binding-common'\nimport { assertNever } from '@contember/binding-common'\nimport { TreeParameterSugarer } from './TreeParameterSugarer'\n\nexport class MarkerSugarer {\n\tpublic static sugarMarker(marker: MeaningfulMarker): string {\n\t\tif (marker instanceof FieldMarker) {\n\t\t\treturn this.sugarFieldMarker(marker)\n\t\t}\n\t\tif (marker instanceof HasOneRelationMarker) {\n\t\t\treturn this.sugarHasOneRelationMarker(marker)\n\t\t}\n\t\tif (marker instanceof HasManyRelationMarker) {\n\t\t\treturn this.sugarHasManyRelationMarker(marker)\n\t\t}\n\t\tif (marker instanceof EntityListSubTreeMarker) {\n\t\t\treturn this.sugarEntityListSubTreeMarker(marker)\n\t\t}\n\t\tif (marker instanceof EntitySubTreeMarker) {\n\t\t\treturn this.sugarEntitySubTreeMarker(marker)\n\t\t}\n\t\treturn assertNever(marker)\n\t}\n\n\tpublic static sugarFieldMarker(field: FieldMarker) {\n\t\treturn TreeParameterSugarer.sugarField(field.fieldName)\n\t}\n\n\tpublic static sugarHasOneRelationMarker(hasOne: HasOneRelationMarker) {\n\t\treturn TreeParameterSugarer.sugarHasOneRelation(\n\t\t\thasOne.parameters.field,\n\t\t\thasOne.parameters.reducedBy,\n\t\t\thasOne.parameters.filter,\n\t\t)\n\t}\n\n\tpublic static sugarHasManyRelationMarker(hasMany: HasManyRelationMarker) {\n\t\treturn TreeParameterSugarer.sugarHasManyRelation(hasMany.parameters.field, hasMany.parameters.filter)\n\t}\n\n\tpublic static sugarEntitySubTreeMarker(subTree: EntitySubTreeMarker) {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\treturn TreeParameterSugarer.sugarRootEntity(subTree.entityName, undefined)\n\t\t}\n\t\treturn TreeParameterSugarer.sugarRootEntity(subTree.entityName, subTree.parameters.where)\n\t}\n\n\tpublic static sugarEntityListSubTreeMarker(subTree: EntityListSubTreeMarker) {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\treturn TreeParameterSugarer.sugarRootEntityList(subTree.entityName, undefined)\n\t\t}\n\t\treturn TreeParameterSugarer.sugarRootEntityList(subTree.entityName, subTree.parameters.filter)\n\t}\n}\n"],"names":["FieldMarker","HasOneRelationMarker","HasManyRelationMarker","EntityListSubTreeMarker","EntitySubTreeMarker","assertNever","TreeParameterSugarer"],"mappings":";;;;AAWO,MAAM,cAAc;AAAA,EAC1B,OAAc,YAAY,QAAkC;AAC3D,QAAI,kBAAkBA,cAAAA,aAAa;AAC3B,aAAA,KAAK,iBAAiB,MAAM;AAAA,IAAA;AAEpC,QAAI,kBAAkBC,cAAAA,sBAAsB;AACpC,aAAA,KAAK,0BAA0B,MAAM;AAAA,IAAA;AAE7C,QAAI,kBAAkBC,cAAAA,uBAAuB;AACrC,aAAA,KAAK,2BAA2B,MAAM;AAAA,IAAA;AAE9C,QAAI,kBAAkBC,cAAAA,yBAAyB;AACvC,aAAA,KAAK,6BAA6B,MAAM;AAAA,IAAA;AAEhD,QAAI,kBAAkBC,cAAAA,qBAAqB;AACnC,aAAA,KAAK,yBAAyB,MAAM;AAAA,IAAA;AAE5C,WAAOC,cAAAA,YAAY,MAAM;AAAA,EAAA;AAAA,EAG1B,OAAc,iBAAiB,OAAoB;AAC3C,WAAAC,0CAAqB,WAAW,MAAM,SAAS;AAAA,EAAA;AAAA,EAGvD,OAAc,0BAA0B,QAA8B;AACrE,WAAOA,qBAAqB,qBAAA;AAAA,MAC3B,OAAO,WAAW;AAAA,MAClB,OAAO,WAAW;AAAA,MAClB,OAAO,WAAW;AAAA,IACnB;AAAA,EAAA;AAAA,EAGD,OAAc,2BAA2B,SAAgC;AACxE,WAAOA,0CAAqB,qBAAqB,QAAQ,WAAW,OAAO,QAAQ,WAAW,MAAM;AAAA,EAAA;AAAA,EAGrG,OAAc,yBAAyB,SAA8B;AAChE,QAAA,QAAQ,WAAW,YAAY;AAClC,aAAOA,qBAAqB,qBAAA,gBAAgB,QAAQ,YAAY,MAAS;AAAA,IAAA;AAE1E,WAAOA,qBAAAA,qBAAqB,gBAAgB,QAAQ,YAAY,QAAQ,WAAW,KAAK;AAAA,EAAA;AAAA,EAGzF,OAAc,6BAA6B,SAAkC;AACxE,QAAA,QAAQ,WAAW,YAAY;AAClC,aAAOA,qBAAqB,qBAAA,oBAAoB,QAAQ,YAAY,MAAS;AAAA,IAAA;AAE9E,WAAOA,qBAAAA,qBAAqB,oBAAoB,QAAQ,YAAY,QAAQ,WAAW,MAAM;AAAA,EAAA;AAE/F;;"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { FieldMarker, HasOneRelationMarker, HasManyRelationMarker, EntityListSubTreeMarker, EntitySubTreeMarker, assertNever } from "@contember/binding-common";
|
|
2
|
-
import { TreeParameterSugarer } from "./TreeParameterSugarer.js";
|
|
3
|
-
class MarkerSugarer {
|
|
4
|
-
static sugarMarker(marker) {
|
|
5
|
-
if (marker instanceof FieldMarker) {
|
|
6
|
-
return this.sugarFieldMarker(marker);
|
|
7
|
-
}
|
|
8
|
-
if (marker instanceof HasOneRelationMarker) {
|
|
9
|
-
return this.sugarHasOneRelationMarker(marker);
|
|
10
|
-
}
|
|
11
|
-
if (marker instanceof HasManyRelationMarker) {
|
|
12
|
-
return this.sugarHasManyRelationMarker(marker);
|
|
13
|
-
}
|
|
14
|
-
if (marker instanceof EntityListSubTreeMarker) {
|
|
15
|
-
return this.sugarEntityListSubTreeMarker(marker);
|
|
16
|
-
}
|
|
17
|
-
if (marker instanceof EntitySubTreeMarker) {
|
|
18
|
-
return this.sugarEntitySubTreeMarker(marker);
|
|
19
|
-
}
|
|
20
|
-
return assertNever(marker);
|
|
21
|
-
}
|
|
22
|
-
static sugarFieldMarker(field) {
|
|
23
|
-
return TreeParameterSugarer.sugarField(field.fieldName);
|
|
24
|
-
}
|
|
25
|
-
static sugarHasOneRelationMarker(hasOne) {
|
|
26
|
-
return TreeParameterSugarer.sugarHasOneRelation(
|
|
27
|
-
hasOne.parameters.field,
|
|
28
|
-
hasOne.parameters.reducedBy,
|
|
29
|
-
hasOne.parameters.filter
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
static sugarHasManyRelationMarker(hasMany) {
|
|
33
|
-
return TreeParameterSugarer.sugarHasManyRelation(hasMany.parameters.field, hasMany.parameters.filter);
|
|
34
|
-
}
|
|
35
|
-
static sugarEntitySubTreeMarker(subTree) {
|
|
36
|
-
if (subTree.parameters.isCreating) {
|
|
37
|
-
return TreeParameterSugarer.sugarRootEntity(subTree.entityName, void 0);
|
|
38
|
-
}
|
|
39
|
-
return TreeParameterSugarer.sugarRootEntity(subTree.entityName, subTree.parameters.where);
|
|
40
|
-
}
|
|
41
|
-
static sugarEntityListSubTreeMarker(subTree) {
|
|
42
|
-
if (subTree.parameters.isCreating) {
|
|
43
|
-
return TreeParameterSugarer.sugarRootEntityList(subTree.entityName, void 0);
|
|
44
|
-
}
|
|
45
|
-
return TreeParameterSugarer.sugarRootEntityList(subTree.entityName, subTree.parameters.filter);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
MarkerSugarer
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=MarkerSugarer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerSugarer.js","sources":["../../../../../../packages/binding-legacy/src/core/exceptions/MarkerSugarer.ts"],"sourcesContent":["import {\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMeaningfulMarker,\n} from '@contember/binding-common'\nimport { assertNever } from '@contember/binding-common'\nimport { TreeParameterSugarer } from './TreeParameterSugarer'\n\nexport class MarkerSugarer {\n\tpublic static sugarMarker(marker: MeaningfulMarker): string {\n\t\tif (marker instanceof FieldMarker) {\n\t\t\treturn this.sugarFieldMarker(marker)\n\t\t}\n\t\tif (marker instanceof HasOneRelationMarker) {\n\t\t\treturn this.sugarHasOneRelationMarker(marker)\n\t\t}\n\t\tif (marker instanceof HasManyRelationMarker) {\n\t\t\treturn this.sugarHasManyRelationMarker(marker)\n\t\t}\n\t\tif (marker instanceof EntityListSubTreeMarker) {\n\t\t\treturn this.sugarEntityListSubTreeMarker(marker)\n\t\t}\n\t\tif (marker instanceof EntitySubTreeMarker) {\n\t\t\treturn this.sugarEntitySubTreeMarker(marker)\n\t\t}\n\t\treturn assertNever(marker)\n\t}\n\n\tpublic static sugarFieldMarker(field: FieldMarker) {\n\t\treturn TreeParameterSugarer.sugarField(field.fieldName)\n\t}\n\n\tpublic static sugarHasOneRelationMarker(hasOne: HasOneRelationMarker) {\n\t\treturn TreeParameterSugarer.sugarHasOneRelation(\n\t\t\thasOne.parameters.field,\n\t\t\thasOne.parameters.reducedBy,\n\t\t\thasOne.parameters.filter,\n\t\t)\n\t}\n\n\tpublic static sugarHasManyRelationMarker(hasMany: HasManyRelationMarker) {\n\t\treturn TreeParameterSugarer.sugarHasManyRelation(hasMany.parameters.field, hasMany.parameters.filter)\n\t}\n\n\tpublic static sugarEntitySubTreeMarker(subTree: EntitySubTreeMarker) {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\treturn TreeParameterSugarer.sugarRootEntity(subTree.entityName, undefined)\n\t\t}\n\t\treturn TreeParameterSugarer.sugarRootEntity(subTree.entityName, subTree.parameters.where)\n\t}\n\n\tpublic static sugarEntityListSubTreeMarker(subTree: EntityListSubTreeMarker) {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\treturn TreeParameterSugarer.sugarRootEntityList(subTree.entityName, undefined)\n\t\t}\n\t\treturn TreeParameterSugarer.sugarRootEntityList(subTree.entityName, subTree.parameters.filter)\n\t}\n}\n"],"names":[],"mappings":";;AAWO,MAAM,cAAc;AAAA,EAC1B,OAAc,YAAY,QAAkC;AAC3D,QAAI,kBAAkB,aAAa;AAC3B,aAAA,KAAK,iBAAiB,MAAM;AAAA,IAAA;AAEpC,QAAI,kBAAkB,sBAAsB;AACpC,aAAA,KAAK,0BAA0B,MAAM;AAAA,IAAA;AAE7C,QAAI,kBAAkB,uBAAuB;AACrC,aAAA,KAAK,2BAA2B,MAAM;AAAA,IAAA;AAE9C,QAAI,kBAAkB,yBAAyB;AACvC,aAAA,KAAK,6BAA6B,MAAM;AAAA,IAAA;AAEhD,QAAI,kBAAkB,qBAAqB;AACnC,aAAA,KAAK,yBAAyB,MAAM;AAAA,IAAA;AAE5C,WAAO,YAAY,MAAM;AAAA,EAAA;AAAA,EAG1B,OAAc,iBAAiB,OAAoB;AAC3C,WAAA,qBAAqB,WAAW,MAAM,SAAS;AAAA,EAAA;AAAA,EAGvD,OAAc,0BAA0B,QAA8B;AACrE,WAAO,qBAAqB;AAAA,MAC3B,OAAO,WAAW;AAAA,MAClB,OAAO,WAAW;AAAA,MAClB,OAAO,WAAW;AAAA,IACnB;AAAA,EAAA;AAAA,EAGD,OAAc,2BAA2B,SAAgC;AACxE,WAAO,qBAAqB,qBAAqB,QAAQ,WAAW,OAAO,QAAQ,WAAW,MAAM;AAAA,EAAA;AAAA,EAGrG,OAAc,yBAAyB,SAA8B;AAChE,QAAA,QAAQ,WAAW,YAAY;AAClC,aAAO,qBAAqB,gBAAgB,QAAQ,YAAY,MAAS;AAAA,IAAA;AAE1E,WAAO,qBAAqB,gBAAgB,QAAQ,YAAY,QAAQ,WAAW,KAAK;AAAA,EAAA;AAAA,EAGzF,OAAc,6BAA6B,SAAkC;AACxE,QAAA,QAAQ,WAAW,YAAY;AAClC,aAAO,qBAAqB,oBAAoB,QAAQ,YAAY,MAAS;AAAA,IAAA;AAE9E,WAAO,qBAAqB,oBAAoB,QAAQ,YAAY,QAAQ,WAAW,MAAM;AAAA,EAAA;AAE/F;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
class TreeParameterSugarer {
|
|
4
|
-
static sugarField(fieldName) {
|
|
5
|
-
return fieldName;
|
|
6
|
-
}
|
|
7
|
-
static sugarHasOneRelation(fieldName, reducedBy, filter) {
|
|
8
|
-
return `${fieldName}${this.sugarUniqueWhere(reducedBy)}${this.sugarFilter(filter)}`;
|
|
9
|
-
}
|
|
10
|
-
static sugarHasManyRelation(fieldName, filter) {
|
|
11
|
-
return `${fieldName}${this.sugarFilter(filter)}`;
|
|
12
|
-
}
|
|
13
|
-
static sugarRootEntity(entityName, where) {
|
|
14
|
-
return `${entityName}${this.sugarUniqueWhere(where)}`;
|
|
15
|
-
}
|
|
16
|
-
static sugarRootEntityList(entityName, filter) {
|
|
17
|
-
return `${entityName}${this.sugarFilter(filter)}`;
|
|
18
|
-
}
|
|
19
|
-
static sugarUniqueWhere(where) {
|
|
20
|
-
if (where === void 0) {
|
|
21
|
-
return "";
|
|
22
|
-
}
|
|
23
|
-
return `(…)`;
|
|
24
|
-
}
|
|
25
|
-
static sugarFilter(filter) {
|
|
26
|
-
if (filter === void 0) {
|
|
27
|
-
return "";
|
|
28
|
-
}
|
|
29
|
-
return `[…]`;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.TreeParameterSugarer = TreeParameterSugarer;
|
|
33
|
-
//# sourceMappingURL=TreeParameterSugarer.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeParameterSugarer.cjs","sources":["../../../../../../packages/binding-legacy/src/core/exceptions/TreeParameterSugarer.ts"],"sourcesContent":["import type { EntityName, FieldName, Filter, UniqueWhere } from '@contember/binding-common'\n\nexport class TreeParameterSugarer {\n\tpublic static sugarField(fieldName: FieldName) {\n\t\treturn fieldName\n\t}\n\n\tpublic static sugarHasOneRelation(\n\t\tfieldName: FieldName,\n\t\treducedBy: UniqueWhere | undefined,\n\t\tfilter: Filter | undefined,\n\t) {\n\t\treturn `${fieldName}${this.sugarUniqueWhere(reducedBy)}${this.sugarFilter(filter)}`\n\t}\n\n\tpublic static sugarHasManyRelation(fieldName: FieldName, filter: Filter | undefined) {\n\t\treturn `${fieldName}${this.sugarFilter(filter)}`\n\t}\n\n\tpublic static sugarRootEntity(entityName: EntityName, where: UniqueWhere | undefined) {\n\t\treturn `${entityName}${this.sugarUniqueWhere(where)}`\n\t}\n\n\tpublic static sugarRootEntityList(entityName: EntityName, filter: Filter | undefined) {\n\t\treturn `${entityName}${this.sugarFilter(filter)}`\n\t}\n\n\tpublic static sugarUniqueWhere(where: UniqueWhere | undefined): string {\n\t\tif (where === undefined) {\n\t\t\treturn ''\n\t\t}\n\t\treturn `(…)` // TODO\n\t}\n\n\tpublic static sugarFilter(filter: Filter | undefined): string {\n\t\tif (filter === undefined) {\n\t\t\treturn ''\n\t\t}\n\t\treturn `[…]` // TODO\n\t}\n}\n"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB;AAAA,EACjC,OAAc,WAAW,WAAsB;AACvC,WAAA;AAAA,EAAA;AAAA,EAGR,OAAc,oBACb,WACA,WACA,QACC;AACM,WAAA,GAAG,SAAS,GAAG,KAAK,iBAAiB,SAAS,CAAC,GAAG,KAAK,YAAY,MAAM,CAAC;AAAA,EAAA;AAAA,EAGlF,OAAc,qBAAqB,WAAsB,QAA4B;AACpF,WAAO,GAAG,SAAS,GAAG,KAAK,YAAY,MAAM,CAAC;AAAA,EAAA;AAAA,EAG/C,OAAc,gBAAgB,YAAwB,OAAgC;AACrF,WAAO,GAAG,UAAU,GAAG,KAAK,iBAAiB,KAAK,CAAC;AAAA,EAAA;AAAA,EAGpD,OAAc,oBAAoB,YAAwB,QAA4B;AACrF,WAAO,GAAG,UAAU,GAAG,KAAK,YAAY,MAAM,CAAC;AAAA,EAAA;AAAA,EAGhD,OAAc,iBAAiB,OAAwC;AACtE,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,EAAA;AAAA,EAGR,OAAc,YAAY,QAAoC;AAC7D,QAAI,WAAW,QAAW;AAClB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,EAAA;AAET;;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
class TreeParameterSugarer {
|
|
2
|
-
static sugarField(fieldName) {
|
|
3
|
-
return fieldName;
|
|
4
|
-
}
|
|
5
|
-
static sugarHasOneRelation(fieldName, reducedBy, filter) {
|
|
6
|
-
return `${fieldName}${this.sugarUniqueWhere(reducedBy)}${this.sugarFilter(filter)}`;
|
|
7
|
-
}
|
|
8
|
-
static sugarHasManyRelation(fieldName, filter) {
|
|
9
|
-
return `${fieldName}${this.sugarFilter(filter)}`;
|
|
10
|
-
}
|
|
11
|
-
static sugarRootEntity(entityName, where) {
|
|
12
|
-
return `${entityName}${this.sugarUniqueWhere(where)}`;
|
|
13
|
-
}
|
|
14
|
-
static sugarRootEntityList(entityName, filter) {
|
|
15
|
-
return `${entityName}${this.sugarFilter(filter)}`;
|
|
16
|
-
}
|
|
17
|
-
static sugarUniqueWhere(where) {
|
|
18
|
-
if (where === void 0) {
|
|
19
|
-
return "";
|
|
20
|
-
}
|
|
21
|
-
return `(…)`;
|
|
22
|
-
}
|
|
23
|
-
static sugarFilter(filter) {
|
|
24
|
-
if (filter === void 0) {
|
|
25
|
-
return "";
|
|
26
|
-
}
|
|
27
|
-
return `[…]`;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
TreeParameterSugarer
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=TreeParameterSugarer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeParameterSugarer.js","sources":["../../../../../../packages/binding-legacy/src/core/exceptions/TreeParameterSugarer.ts"],"sourcesContent":["import type { EntityName, FieldName, Filter, UniqueWhere } from '@contember/binding-common'\n\nexport class TreeParameterSugarer {\n\tpublic static sugarField(fieldName: FieldName) {\n\t\treturn fieldName\n\t}\n\n\tpublic static sugarHasOneRelation(\n\t\tfieldName: FieldName,\n\t\treducedBy: UniqueWhere | undefined,\n\t\tfilter: Filter | undefined,\n\t) {\n\t\treturn `${fieldName}${this.sugarUniqueWhere(reducedBy)}${this.sugarFilter(filter)}`\n\t}\n\n\tpublic static sugarHasManyRelation(fieldName: FieldName, filter: Filter | undefined) {\n\t\treturn `${fieldName}${this.sugarFilter(filter)}`\n\t}\n\n\tpublic static sugarRootEntity(entityName: EntityName, where: UniqueWhere | undefined) {\n\t\treturn `${entityName}${this.sugarUniqueWhere(where)}`\n\t}\n\n\tpublic static sugarRootEntityList(entityName: EntityName, filter: Filter | undefined) {\n\t\treturn `${entityName}${this.sugarFilter(filter)}`\n\t}\n\n\tpublic static sugarUniqueWhere(where: UniqueWhere | undefined): string {\n\t\tif (where === undefined) {\n\t\t\treturn ''\n\t\t}\n\t\treturn `(…)` // TODO\n\t}\n\n\tpublic static sugarFilter(filter: Filter | undefined): string {\n\t\tif (filter === undefined) {\n\t\t\treturn ''\n\t\t}\n\t\treturn `[…]` // TODO\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,qBAAqB;AAAA,EACjC,OAAc,WAAW,WAAsB;AACvC,WAAA;AAAA,EAAA;AAAA,EAGR,OAAc,oBACb,WACA,WACA,QACC;AACM,WAAA,GAAG,SAAS,GAAG,KAAK,iBAAiB,SAAS,CAAC,GAAG,KAAK,YAAY,MAAM,CAAC;AAAA,EAAA;AAAA,EAGlF,OAAc,qBAAqB,WAAsB,QAA4B;AACpF,WAAO,GAAG,SAAS,GAAG,KAAK,YAAY,MAAM,CAAC;AAAA,EAAA;AAAA,EAG/C,OAAc,gBAAgB,YAAwB,OAAgC;AACrF,WAAO,GAAG,UAAU,GAAG,KAAK,iBAAiB,KAAK,CAAC;AAAA,EAAA;AAAA,EAGpD,OAAc,oBAAoB,YAAwB,QAA4B;AACrF,WAAO,GAAG,UAAU,GAAG,KAAK,YAAY,MAAM,CAAC;AAAA,EAAA;AAAA,EAGhD,OAAc,iBAAiB,OAAwC;AACtE,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,EAAA;AAAA,EAGR,OAAc,YAAY,QAAoC;AAC7D,QAAI,WAAW,QAAW;AAClB,aAAA;AAAA,IAAA;AAED,WAAA;AAAA,EAAA;AAET;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const bindingCommon = require("@contember/binding-common");
|
|
4
|
-
const createBatchUpdatesOptions = (rootEnvironment, treeStore) => Object.freeze({
|
|
5
|
-
getEntityByKey: (key) => {
|
|
6
|
-
if (typeof key === "function") {
|
|
7
|
-
return key();
|
|
8
|
-
}
|
|
9
|
-
const realm = treeStore.entityRealmStore.get(key);
|
|
10
|
-
if (realm === void 0) {
|
|
11
|
-
throw new bindingCommon.BindingError(`Trying to retrieve a non-existent entity: key '${key}' was not found.`);
|
|
12
|
-
}
|
|
13
|
-
return realm.getAccessor();
|
|
14
|
-
},
|
|
15
|
-
getEntityListSubTree: (aliasOrParameters, treeId, environment = rootEnvironment) => {
|
|
16
|
-
return treeStore.getSubTreeState("entityList", treeId, aliasOrParameters, environment).getAccessor();
|
|
17
|
-
},
|
|
18
|
-
getEntitySubTree: (aliasOrParameters, treeId, environment = rootEnvironment) => {
|
|
19
|
-
return treeStore.getSubTreeState("entity", treeId, aliasOrParameters, environment).getAccessor();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
exports.createBatchUpdatesOptions = createBatchUpdatesOptions;
|
|
23
|
-
//# sourceMappingURL=createBatchUpdatesOptions.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBatchUpdatesOptions.cjs","sources":["../../../../../../packages/binding-legacy/src/core/factories/createBatchUpdatesOptions.ts"],"sourcesContent":["import type { BatchUpdatesOptions, EntityAccessor, EntityListAccessor } from '@contember/binding-common'\nimport { BindingError } from '@contember/binding-common'\nimport type { Environment } from '@contember/binding-common'\nimport type {\n\tAlias,\n\tSugaredQualifiedEntityList,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '@contember/binding-common'\nimport type { TreeStore } from '../TreeStore'\n\nexport const createBatchUpdatesOptions = (rootEnvironment: Environment, treeStore: TreeStore): BatchUpdatesOptions =>\n\tObject.freeze({\n\t\tgetEntityByKey: (key: string | (() => EntityAccessor)) => {\n\t\t\tif (typeof key === 'function') {\n\t\t\t\treturn key()\n\t\t\t}\n\t\t\tconst realm = treeStore.entityRealmStore.get(key)\n\n\t\t\tif (realm === undefined) {\n\t\t\t\tthrow new BindingError(`Trying to retrieve a non-existent entity: key '${key}' was not found.`)\n\t\t\t}\n\t\t\treturn realm.getAccessor()\n\t\t},\n\t\tgetEntityListSubTree: (\n\t\t\taliasOrParameters: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\ttreeId: TreeRootId | undefined,\n\t\t\tenvironment = rootEnvironment,\n\t\t): EntityListAccessor => {\n\t\t\treturn treeStore.getSubTreeState('entityList', treeId, aliasOrParameters, environment).getAccessor()\n\t\t},\n\t\tgetEntitySubTree: (\n\t\t\taliasOrParameters: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\ttreeId: TreeRootId | undefined,\n\t\t\tenvironment = rootEnvironment,\n\t\t): EntityAccessor => {\n\t\t\treturn treeStore.getSubTreeState('entity', treeId, aliasOrParameters, environment).getAccessor()\n\t\t},\n\t})\n"],"names":["BindingError"],"mappings":";;;AAaO,MAAM,4BAA4B,CAAC,iBAA8B,cACvE,OAAO,OAAO;AAAA,EACb,gBAAgB,CAAC,QAAyC;AACrD,QAAA,OAAO,QAAQ,YAAY;AAC9B,aAAO,IAAI;AAAA,IAAA;AAEZ,UAAM,QAAQ,UAAU,iBAAiB,IAAI,GAAG;AAEhD,QAAI,UAAU,QAAW;AACxB,YAAM,IAAIA,cAAAA,aAAa,kDAAkD,GAAG,kBAAkB;AAAA,IAAA;AAE/F,WAAO,MAAM,YAAY;AAAA,EAC1B;AAAA,EACA,sBAAsB,CACrB,mBACA,QACA,cAAc,oBACU;AACxB,WAAO,UAAU,gBAAgB,cAAc,QAAQ,mBAAmB,WAAW,EAAE,YAAY;AAAA,EACpG;AAAA,EACA,kBAAkB,CACjB,mBACA,QACA,cAAc,oBACM;AACpB,WAAO,UAAU,gBAAgB,UAAU,QAAQ,mBAAmB,WAAW,EAAE,YAAY;AAAA,EAAA;AAEjG,CAAC;;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BindingError } from "@contember/binding-common";
|
|
2
|
-
const createBatchUpdatesOptions = (rootEnvironment, treeStore) => Object.freeze({
|
|
3
|
-
getEntityByKey: (key) => {
|
|
4
|
-
if (typeof key === "function") {
|
|
5
|
-
return key();
|
|
6
|
-
}
|
|
7
|
-
const realm = treeStore.entityRealmStore.get(key);
|
|
8
|
-
if (realm === void 0) {
|
|
9
|
-
throw new BindingError(`Trying to retrieve a non-existent entity: key '${key}' was not found.`);
|
|
10
|
-
}
|
|
11
|
-
return realm.getAccessor();
|
|
12
|
-
},
|
|
13
|
-
getEntityListSubTree: (aliasOrParameters, treeId, environment = rootEnvironment) => {
|
|
14
|
-
return treeStore.getSubTreeState("entityList", treeId, aliasOrParameters, environment).getAccessor();
|
|
15
|
-
},
|
|
16
|
-
getEntitySubTree: (aliasOrParameters, treeId, environment = rootEnvironment) => {
|
|
17
|
-
return treeStore.getSubTreeState("entity", treeId, aliasOrParameters, environment).getAccessor();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
export {
|
|
21
|
-
createBatchUpdatesOptions
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=createBatchUpdatesOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBatchUpdatesOptions.js","sources":["../../../../../../packages/binding-legacy/src/core/factories/createBatchUpdatesOptions.ts"],"sourcesContent":["import type { BatchUpdatesOptions, EntityAccessor, EntityListAccessor } from '@contember/binding-common'\nimport { BindingError } from '@contember/binding-common'\nimport type { Environment } from '@contember/binding-common'\nimport type {\n\tAlias,\n\tSugaredQualifiedEntityList,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '@contember/binding-common'\nimport type { TreeStore } from '../TreeStore'\n\nexport const createBatchUpdatesOptions = (rootEnvironment: Environment, treeStore: TreeStore): BatchUpdatesOptions =>\n\tObject.freeze({\n\t\tgetEntityByKey: (key: string | (() => EntityAccessor)) => {\n\t\t\tif (typeof key === 'function') {\n\t\t\t\treturn key()\n\t\t\t}\n\t\t\tconst realm = treeStore.entityRealmStore.get(key)\n\n\t\t\tif (realm === undefined) {\n\t\t\t\tthrow new BindingError(`Trying to retrieve a non-existent entity: key '${key}' was not found.`)\n\t\t\t}\n\t\t\treturn realm.getAccessor()\n\t\t},\n\t\tgetEntityListSubTree: (\n\t\t\taliasOrParameters: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\ttreeId: TreeRootId | undefined,\n\t\t\tenvironment = rootEnvironment,\n\t\t): EntityListAccessor => {\n\t\t\treturn treeStore.getSubTreeState('entityList', treeId, aliasOrParameters, environment).getAccessor()\n\t\t},\n\t\tgetEntitySubTree: (\n\t\t\taliasOrParameters: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\ttreeId: TreeRootId | undefined,\n\t\t\tenvironment = rootEnvironment,\n\t\t): EntityAccessor => {\n\t\t\treturn treeStore.getSubTreeState('entity', treeId, aliasOrParameters, environment).getAccessor()\n\t\t},\n\t})\n"],"names":[],"mappings":";AAaO,MAAM,4BAA4B,CAAC,iBAA8B,cACvE,OAAO,OAAO;AAAA,EACb,gBAAgB,CAAC,QAAyC;AACrD,QAAA,OAAO,QAAQ,YAAY;AAC9B,aAAO,IAAI;AAAA,IAAA;AAEZ,UAAM,QAAQ,UAAU,iBAAiB,IAAI,GAAG;AAEhD,QAAI,UAAU,QAAW;AACxB,YAAM,IAAI,aAAa,kDAAkD,GAAG,kBAAkB;AAAA,IAAA;AAE/F,WAAO,MAAM,YAAY;AAAA,EAC1B;AAAA,EACA,sBAAsB,CACrB,mBACA,QACA,cAAc,oBACU;AACxB,WAAO,UAAU,gBAAgB,cAAc,QAAQ,mBAAmB,WAAW,EAAE,YAAY;AAAA,EACpG;AAAA,EACA,kBAAkB,CACjB,mBACA,QACA,cAAc,oBACM;AACpB,WAAO,UAAU,gBAAgB,UAAU,QAAQ,mBAAmB,WAAW,EAAE,YAAY;AAAA,EAAA;AAEjG,CAAC;"}
|