@contember/binding-legacy 2.1.0-alpha.3 → 2.1.0-alpha.35
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 +85 -87
- 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 +9 -16
- 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 -668
- package/dist/development/src/core/MutationGenerator.cjs.map +0 -1
- package/dist/development/src/core/MutationGenerator.js +0 -668
- 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 -668
- package/dist/production/src/core/MutationGenerator.cjs.map +0 -1
- package/dist/production/src/core/MutationGenerator.js +0 -668
- 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
|
@@ -59,21 +59,21 @@ export class FieldOperations {
|
|
|
59
59
|
if (import.meta.env.DEV) {
|
|
60
60
|
if (newValue !== fieldState.value && (fieldState.touchLog !== undefined || entity.hasIdSetInStone)) {
|
|
61
61
|
throw new BindingError(
|
|
62
|
-
`Trying to set the '${PRIMARY_KEY_NAME}' field for the second time. This is prohibited.\n`
|
|
63
|
-
`Once set, it is immutable.`,
|
|
62
|
+
`Trying to set the '${PRIMARY_KEY_NAME}' field for the second time. This is prohibited.\n`
|
|
63
|
+
+ `Once set, it is immutable.`,
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
if (typeof newValue !== 'string' || !uuidValidate(newValue)) {
|
|
67
67
|
throw new BindingError(
|
|
68
|
-
`Invalid value supplied for the '${PRIMARY_KEY_NAME}' field. `
|
|
69
|
-
`Expecting a valid uuid but '${newValue}' was given.\n`
|
|
70
|
-
`Hint: you may use 'FieldAccessor.asUuid.setToUuid()'.`,
|
|
68
|
+
`Invalid value supplied for the '${PRIMARY_KEY_NAME}' field. `
|
|
69
|
+
+ `Expecting a valid uuid but '${newValue}' was given.\n`
|
|
70
|
+
+ `Hint: you may use 'FieldAccessor.asUuid.setToUuid()'.`,
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
if (this.treeStore.entityStore.has(ServerId.formatUniqueValue(newValue, entity.entityName))) {
|
|
74
74
|
throw new BindingError(
|
|
75
|
-
`Trying to set the '${PRIMARY_KEY_NAME}' field to '${newValue}' which is a valid uuid but is not unique. `
|
|
76
|
-
`It is already in use by an existing entity.`,
|
|
75
|
+
`Trying to set the '${PRIMARY_KEY_NAME}' field to '${newValue}' which is a valid uuid but is not unique. `
|
|
76
|
+
+ `It is already in use by an existing entity.`,
|
|
77
77
|
)
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -98,21 +98,19 @@ export class FieldOperations {
|
|
|
98
98
|
field.touchLog.add(agent)
|
|
99
99
|
field.value = newValue
|
|
100
100
|
|
|
101
|
-
const resolvedValue =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
: newValue
|
|
101
|
+
const resolvedValue = field.fieldMarker.defaultValue === undefined
|
|
102
|
+
? newValue
|
|
103
|
+
: newValue === null
|
|
104
|
+
? field.fieldMarker.defaultValue
|
|
105
|
+
: newValue
|
|
107
106
|
const normalizedPersistedValue = field.persistedValue === undefined ? null : field.persistedValue
|
|
108
107
|
const hadUnpersistedChangesBefore = field.hasUnpersistedChanges
|
|
109
108
|
const hasUnpersistedChangesNow = resolvedValue !== normalizedPersistedValue
|
|
110
109
|
field.hasUnpersistedChanges = hasUnpersistedChangesNow
|
|
111
110
|
|
|
112
|
-
const shouldInfluenceUpdateCount =
|
|
113
|
-
!
|
|
114
|
-
|
|
115
|
-
field.persistedValue !== undefined
|
|
111
|
+
const shouldInfluenceUpdateCount = !getEntityMarker(parent).fields.hasAtLeastOneBearingField
|
|
112
|
+
|| !field.fieldMarker.isNonbearing
|
|
113
|
+
|| field.persistedValue !== undefined
|
|
116
114
|
|
|
117
115
|
let changesDelta = EventManager.NO_CHANGES_DIFFERENCE
|
|
118
116
|
|
|
@@ -69,9 +69,9 @@ export class ListOperations {
|
|
|
69
69
|
for (const state of StateIterator.eachSiblingRealmChild(this.treeStore, outerState)) {
|
|
70
70
|
if (state.entityName !== stateToConnect.entity.entityName) {
|
|
71
71
|
throw new BindingError(
|
|
72
|
-
`EntityListAccessor.connectEntity: Attempting to connect at an entity of type `
|
|
73
|
-
`'${stateToConnect.entity.entityName}' but '${state.entityName}' is expected.\n\n`
|
|
74
|
-
`Entity located at: ${ErrorLocator.locateInternalState(outerState)}.`,
|
|
72
|
+
`EntityListAccessor.connectEntity: Attempting to connect at an entity of type `
|
|
73
|
+
+ `'${stateToConnect.entity.entityName}' but '${state.entityName}' is expected.\n\n`
|
|
74
|
+
+ `Entity located at: ${ErrorLocator.locateInternalState(outerState)}.`,
|
|
75
75
|
)
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -83,13 +83,13 @@ export class ListOperations {
|
|
|
83
83
|
} catch (error) {
|
|
84
84
|
if (error instanceof LocalizedBindingError) {
|
|
85
85
|
throw new BindingError(
|
|
86
|
-
`Entity list: cannot connect entity with key '${entityToConnect.key}' because its fields are `
|
|
87
|
-
`incompatible with entities found on this list. Make sure both trees are equivalent.\n\n`
|
|
88
|
-
`${error.message}\n\n`
|
|
89
|
-
(error.markerPath.length > 1
|
|
86
|
+
`Entity list: cannot connect entity with key '${entityToConnect.key}' because its fields are `
|
|
87
|
+
+ `incompatible with entities found on this list. Make sure both trees are equivalent.\n\n`
|
|
88
|
+
+ `${error.message}\n\n`
|
|
89
|
+
+ (error.markerPath.length > 1
|
|
90
90
|
? `Incompatibility found at: ${ErrorLocator.locateMarkerPath(error.markerPath)}.\n\n`
|
|
91
|
-
: '')
|
|
92
|
-
`Entity list located at: ${ErrorLocator.locateInternalState(state)}.`,
|
|
91
|
+
: '')
|
|
92
|
+
+ `Entity list located at: ${ErrorLocator.locateInternalState(state)}.`,
|
|
93
93
|
)
|
|
94
94
|
}
|
|
95
95
|
throw error
|
|
@@ -124,7 +124,7 @@ export class ListOperations {
|
|
|
124
124
|
})
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
public disconnectEntity(listState: EntityListState, childEntity: EntityAccessor, options: {noPersist?: boolean}) {
|
|
127
|
+
public disconnectEntity(listState: EntityListState, childEntity: EntityAccessor, options: { noPersist?: boolean }) {
|
|
128
128
|
this.eventManager.syncOperation(() => {
|
|
129
129
|
// TODO disable this at the top-level.
|
|
130
130
|
const persistedEntityIds = this.treeStore.getEntityListPersistedIds(listState)
|
|
@@ -205,11 +205,11 @@ export class ListOperations {
|
|
|
205
205
|
}
|
|
206
206
|
const looksLikeKey = typeof id === 'string' && (this.treeStore.entityRealmStore.has(id) || RealmKeyGenerator.vaguelyAppearsToBeAKey(id))
|
|
207
207
|
throw new BindingError(
|
|
208
|
-
`EntityList: cannot retrieve an entity with id '${id}' because it's not a valid id.`
|
|
209
|
-
(looksLikeKey
|
|
210
|
-
? `\nThe supplied value appears to be an entity *key*, not an *id*. List accessors are indexed by ids `
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
`EntityList: cannot retrieve an entity with id '${id}' because it's not a valid id.`
|
|
209
|
+
+ (looksLikeKey
|
|
210
|
+
? `\nThe supplied value appears to be an entity *key*, not an *id*. List accessors are indexed by ids `
|
|
211
|
+
+ `and you can use \`EntityAccessor.id\` to obtain one. Keys, on the other hand, are globally unique and `
|
|
212
|
+
+ `you can use \`getEntityByKey\` to get its EntityAccessor.`
|
|
213
213
|
: ''),
|
|
214
214
|
)
|
|
215
215
|
}
|
|
@@ -29,7 +29,7 @@ export class OperationsHelpers {
|
|
|
29
29
|
throw new BindingError(`Attempting to connect an entity with key '${entityToConnectKey}' but it doesn't exist.`)
|
|
30
30
|
}
|
|
31
31
|
// TODO This is commented out for now in order to at least somewhat mitigate the limitations of dealing with
|
|
32
|
-
//
|
|
32
|
+
// inverse relations. However, once that has been addressed systemically, this code needs to be re-enabled.
|
|
33
33
|
// if (!stateToConnect.entity.id.existsOnServer) {
|
|
34
34
|
// throw new BindingError(
|
|
35
35
|
// `Attempting to connect an entity with key '${stateToConnect.realmKey}' that ` +
|
|
@@ -134,7 +134,7 @@ export class OperationsHelpers {
|
|
|
134
134
|
// Version 1.
|
|
135
135
|
// The listeners subscribed to a particular entity key so we no longer want to call these.
|
|
136
136
|
// The only positionally associated listeners are in the blueprint so we re-initialize those.
|
|
137
|
-
//realm.eventListeners = stateInitializer.initializeEntityEventListenerStore(realmBlueprint)
|
|
137
|
+
// realm.eventListeners = stateInitializer.initializeEntityEventListenerStore(realmBlueprint)
|
|
138
138
|
|
|
139
139
|
// Version 2.
|
|
140
140
|
// This is version two of this terrible hack. We want to preserve e.g. persistSuccess handlers.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { EntityListAccessor, ErrorAccessor } from '@contember/binding-common'
|
|
2
2
|
import type { EntityListSubTreeMarker, HasManyRelationMarker } from '@contember/binding-common'
|
|
3
|
-
import type {
|
|
4
|
-
EntityEventListenerStore,
|
|
5
|
-
EntityId,
|
|
6
|
-
EntityListEventListenerStore,
|
|
7
|
-
EntityName,
|
|
8
|
-
RemovalType,
|
|
9
|
-
} from '@contember/binding-common'
|
|
3
|
+
import type { EntityEventListenerStore, EntityId, EntityListEventListenerStore, EntityName, RemovalType } from '@contember/binding-common'
|
|
10
4
|
import type { BijectiveIndexedMap } from '@contember/utilities'
|
|
11
5
|
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'
|
|
12
6
|
|
|
@@ -15,12 +9,12 @@ export type EntityListBlueprint =
|
|
|
15
9
|
readonly type: 'hasMany'
|
|
16
10
|
readonly marker: HasManyRelationMarker
|
|
17
11
|
readonly parent: EntityRealmState
|
|
18
|
-
|
|
12
|
+
}
|
|
19
13
|
| {
|
|
20
14
|
readonly type: 'subTree'
|
|
21
15
|
readonly marker: EntityListSubTreeMarker
|
|
22
16
|
readonly parent: undefined
|
|
23
|
-
|
|
17
|
+
}
|
|
24
18
|
|
|
25
19
|
export interface EntityListState {
|
|
26
20
|
type: 'entityList'
|
|
@@ -6,9 +6,9 @@ class TemporalFieldHelper extends FieldHelper<string> {
|
|
|
6
6
|
this.getAccessor().updateValue(new Date().toISOString(), options)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
//public setToDate() TODO
|
|
10
|
-
//public setToTime() TODO
|
|
11
|
-
//public setToDateTime() TODO
|
|
9
|
+
// public setToDate() TODO
|
|
10
|
+
// public setToTime() TODO
|
|
11
|
+
// public setToDateTime() TODO
|
|
12
12
|
}
|
|
13
13
|
namespace TemporalFieldHelper {
|
|
14
14
|
export const setToNow = (
|
package/src/utils/assertNever.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { BindingError } from '@contember/binding-common'
|
|
|
2
2
|
|
|
3
3
|
export function assertNever(_: never): never {
|
|
4
4
|
throw new BindingError(
|
|
5
|
-
`FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are. `
|
|
6
|
-
`Please find solace in having a good laugh about the whole situation. `
|
|
7
|
-
`You have just witnessed true harshness of software development. `
|
|
8
|
-
`Please report this bug.`,
|
|
5
|
+
`FATAL ERROR. This should absolutely never have happened. Yet, despite all efforts, here we are. `
|
|
6
|
+
+ `Please find solace in having a good laugh about the whole situation. `
|
|
7
|
+
+ `You have just witnessed true harshness of software development. `
|
|
8
|
+
+ `Please report this bug.`,
|
|
9
9
|
)
|
|
10
10
|
}
|
package/tests/example.test.ts
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const bindingCommon = require("@contember/binding-common");
|
|
4
|
-
const EntityAccessorImpl = require("./src/accessors/EntityAccessorImpl.cjs");
|
|
5
|
-
const EntityListAccessorImpl = require("./src/accessors/EntityListAccessorImpl.cjs");
|
|
6
|
-
const FieldAccessorImpl = require("./src/accessors/FieldAccessorImpl.cjs");
|
|
7
|
-
const NormalizedPersistedData = require("./src/accessorTree/NormalizedPersistedData.cjs");
|
|
8
|
-
const Config = require("./src/core/Config.cjs");
|
|
9
|
-
const DataBinding = require("./src/core/DataBinding.cjs");
|
|
10
|
-
const DirtinessTracker = require("./src/core/DirtinessTracker.cjs");
|
|
11
|
-
const EventManager = require("./src/core/EventManager.cjs");
|
|
12
|
-
const QueryGenerator = require("./src/core/QueryGenerator.cjs");
|
|
13
|
-
const StateInitializer = require("./src/core/StateInitializer.cjs");
|
|
14
|
-
const TreeAugmenter = require("./src/core/TreeAugmenter.cjs");
|
|
15
|
-
const TreeStore = require("./src/core/TreeStore.cjs");
|
|
16
|
-
exports.EntityAccessorImpl = EntityAccessorImpl.EntityAccessorImpl;
|
|
17
|
-
exports.EntityListAccessorImpl = EntityListAccessorImpl.EntityListAccessorImpl;
|
|
18
|
-
exports.FieldAccessorImpl = FieldAccessorImpl.FieldAccessorImpl;
|
|
19
|
-
exports.NormalizedPersistedData = NormalizedPersistedData.NormalizedPersistedData;
|
|
20
|
-
exports.Config = Config.Config;
|
|
21
|
-
exports.DataBinding = DataBinding.DataBinding;
|
|
22
|
-
exports.DirtinessTracker = DirtinessTracker.DirtinessTracker;
|
|
23
|
-
exports.EventManager = EventManager.EventManager;
|
|
24
|
-
exports.QueryGenerator = QueryGenerator.QueryGenerator;
|
|
25
|
-
exports.StateInitializer = StateInitializer.StateInitializer;
|
|
26
|
-
exports.TreeAugmenter = TreeAugmenter.TreeAugmenter;
|
|
27
|
-
exports.TreeStore = TreeStore.TreeStore;
|
|
28
|
-
Object.keys(bindingCommon).forEach((k) => {
|
|
29
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: () => bindingCommon[k]
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export * from "@contember/binding-common";
|
|
2
|
-
import { EntityAccessorImpl } from "./src/accessors/EntityAccessorImpl.js";
|
|
3
|
-
import { EntityListAccessorImpl } from "./src/accessors/EntityListAccessorImpl.js";
|
|
4
|
-
import { FieldAccessorImpl } from "./src/accessors/FieldAccessorImpl.js";
|
|
5
|
-
import { NormalizedPersistedData } from "./src/accessorTree/NormalizedPersistedData.js";
|
|
6
|
-
import { Config } from "./src/core/Config.js";
|
|
7
|
-
import { DataBinding } from "./src/core/DataBinding.js";
|
|
8
|
-
import { DirtinessTracker } from "./src/core/DirtinessTracker.js";
|
|
9
|
-
import { EventManager } from "./src/core/EventManager.js";
|
|
10
|
-
import { QueryGenerator } from "./src/core/QueryGenerator.js";
|
|
11
|
-
import { StateInitializer } from "./src/core/StateInitializer.js";
|
|
12
|
-
import { TreeAugmenter } from "./src/core/TreeAugmenter.js";
|
|
13
|
-
import { TreeStore } from "./src/core/TreeStore.js";
|
|
14
|
-
export {
|
|
15
|
-
Config,
|
|
16
|
-
DataBinding,
|
|
17
|
-
DirtinessTracker,
|
|
18
|
-
EntityAccessorImpl,
|
|
19
|
-
EntityListAccessorImpl,
|
|
20
|
-
EventManager,
|
|
21
|
-
FieldAccessorImpl,
|
|
22
|
-
NormalizedPersistedData,
|
|
23
|
-
QueryGenerator,
|
|
24
|
-
StateInitializer,
|
|
25
|
-
TreeAugmenter,
|
|
26
|
-
TreeStore
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
class NormalizedPersistedData {
|
|
4
|
-
constructor(subTreeDataStore, persistedEntityDataStore) {
|
|
5
|
-
this.subTreeDataStore = subTreeDataStore;
|
|
6
|
-
this.persistedEntityDataStore = persistedEntityDataStore;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.NormalizedPersistedData = NormalizedPersistedData;
|
|
10
|
-
//# sourceMappingURL=NormalizedPersistedData.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedPersistedData.cjs","sources":["../../../../../packages/binding-legacy/src/accessorTree/NormalizedPersistedData.ts"],"sourcesContent":["import type { EntityId, FieldValue, PlaceholderName } from '@contember/binding-common'\nimport type { ServerId, UniqueEntityId } from '@contember/binding-common'\n\n// HasMany relations are encoded as sets of entity ids.\n// HasOne relations are encoded as BoxedSingleEntityId just to make them different from actual strings.\n//\t\tNot sure whether that is a reasonable precaution or just pure overhead.\nexport type EntityFieldPersistedValue = FieldValue | ServerId | EntityListPersistedData\n\nexport type EntityFieldPersistedData<Value extends EntityFieldPersistedValue = EntityFieldPersistedValue> = {\n\treadable: boolean | undefined\n\tupdatable: boolean | undefined\n\tvalue: Value\n}\n\nexport type SingleEntityPersistedData = Map<PlaceholderName, EntityFieldPersistedData>\n\nexport type EntityListPersistedData = Set<EntityId>\n\nexport type PersistedEntityDataStore = Map<UniqueEntityId, SingleEntityPersistedData>\n\n// The key is the subTree placeholder name\nexport type SubTreeDataStore = Map<PlaceholderName, ServerId | EntityListPersistedData>\n\nexport class NormalizedPersistedData {\n\tpublic constructor(\n\t\tpublic readonly subTreeDataStore: SubTreeDataStore,\n\t\tpublic readonly persistedEntityDataStore: PersistedEntityDataStore,\n\t) {}\n}\n"],"names":[],"mappings":";;AAuBO,MAAM,wBAAwB;AAAA,EAC7B,YACU,kBACA,0BACf;AAFe,SAAA,mBAAA;AACA,SAAA,2BAAA;AAAA,EAAA;AAElB;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
class NormalizedPersistedData {
|
|
2
|
-
constructor(subTreeDataStore, persistedEntityDataStore) {
|
|
3
|
-
this.subTreeDataStore = subTreeDataStore;
|
|
4
|
-
this.persistedEntityDataStore = persistedEntityDataStore;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
NormalizedPersistedData
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=NormalizedPersistedData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedPersistedData.js","sources":["../../../../../packages/binding-legacy/src/accessorTree/NormalizedPersistedData.ts"],"sourcesContent":["import type { EntityId, FieldValue, PlaceholderName } from '@contember/binding-common'\nimport type { ServerId, UniqueEntityId } from '@contember/binding-common'\n\n// HasMany relations are encoded as sets of entity ids.\n// HasOne relations are encoded as BoxedSingleEntityId just to make them different from actual strings.\n//\t\tNot sure whether that is a reasonable precaution or just pure overhead.\nexport type EntityFieldPersistedValue = FieldValue | ServerId | EntityListPersistedData\n\nexport type EntityFieldPersistedData<Value extends EntityFieldPersistedValue = EntityFieldPersistedValue> = {\n\treadable: boolean | undefined\n\tupdatable: boolean | undefined\n\tvalue: Value\n}\n\nexport type SingleEntityPersistedData = Map<PlaceholderName, EntityFieldPersistedData>\n\nexport type EntityListPersistedData = Set<EntityId>\n\nexport type PersistedEntityDataStore = Map<UniqueEntityId, SingleEntityPersistedData>\n\n// The key is the subTree placeholder name\nexport type SubTreeDataStore = Map<PlaceholderName, ServerId | EntityListPersistedData>\n\nexport class NormalizedPersistedData {\n\tpublic constructor(\n\t\tpublic readonly subTreeDataStore: SubTreeDataStore,\n\t\tpublic readonly persistedEntityDataStore: PersistedEntityDataStore,\n\t) {}\n}\n"],"names":[],"mappings":"AAuBO,MAAM,wBAAwB;AAAA,EAC7B,YACU,kBACA,0BACf;AAFe,SAAA,mBAAA;AACA,SAAA,2BAAA;AAAA,EAAA;AAElB;"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const bindingCommon = require("@contember/binding-common");
|
|
4
|
-
const getEntityMarker = require("../core/state/getEntityMarker.cjs");
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
8
|
-
class EntityAccessorImpl {
|
|
9
|
-
constructor(state, operations, runtimeId, key, name, fieldData, dataFromServer, hasUnpersistedChanges, errors, environment, getAccessor) {
|
|
10
|
-
this.state = state;
|
|
11
|
-
this.operations = operations;
|
|
12
|
-
this.runtimeId = runtimeId;
|
|
13
|
-
this.key = key;
|
|
14
|
-
this.name = name;
|
|
15
|
-
this.fieldData = fieldData;
|
|
16
|
-
this.dataFromServer = dataFromServer;
|
|
17
|
-
this.hasUnpersistedChanges = hasUnpersistedChanges;
|
|
18
|
-
this.errors = errors;
|
|
19
|
-
this.environment = environment;
|
|
20
|
-
this.getAccessor = getAccessor;
|
|
21
|
-
__publicField(this, "__type", "EntityAccessor");
|
|
22
|
-
}
|
|
23
|
-
get idOnServer() {
|
|
24
|
-
return this.runtimeId.existsOnServer ? this.runtimeId.value : void 0;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Note that for entities that don't yet exist on server this will return a dummy id.
|
|
28
|
-
*/
|
|
29
|
-
get id() {
|
|
30
|
-
return this.runtimeId.value;
|
|
31
|
-
}
|
|
32
|
-
get existsOnServer() {
|
|
33
|
-
return this.runtimeId.existsOnServer;
|
|
34
|
-
}
|
|
35
|
-
//
|
|
36
|
-
addError(error) {
|
|
37
|
-
return this.operations.addError(this.state, bindingCommon.ErrorAccessor.normalizeError(error));
|
|
38
|
-
}
|
|
39
|
-
addEventListener(event, listener) {
|
|
40
|
-
return this.operations.addEventListener(this.state, event, listener);
|
|
41
|
-
}
|
|
42
|
-
batchUpdates(performUpdates) {
|
|
43
|
-
this.operations.batchUpdates(this.state, performUpdates);
|
|
44
|
-
}
|
|
45
|
-
connectEntityAtField(field, entityToConnect) {
|
|
46
|
-
const desugared = bindingCommon.QueryLanguage.desugarRelativeSingleEntity(field, this.environment);
|
|
47
|
-
const relativeTo = this.getEntity({
|
|
48
|
-
hasOneRelationPath: desugared.hasOneRelationPath.slice(0, -1)
|
|
49
|
-
});
|
|
50
|
-
const fieldName = desugared.hasOneRelationPath[desugared.hasOneRelationPath.length - 1].field;
|
|
51
|
-
this.operations.connectEntityAtField(relativeTo.state, fieldName, entityToConnect);
|
|
52
|
-
}
|
|
53
|
-
disconnectEntityAtField(field, initializeReplacement) {
|
|
54
|
-
const desugared = bindingCommon.QueryLanguage.desugarRelativeSingleEntity(field, this.environment);
|
|
55
|
-
const relativeTo = this.getEntity({
|
|
56
|
-
hasOneRelationPath: desugared.hasOneRelationPath.slice(0, -1)
|
|
57
|
-
});
|
|
58
|
-
const fieldName = desugared.hasOneRelationPath[desugared.hasOneRelationPath.length - 1].field;
|
|
59
|
-
this.operations.disconnectEntityAtField(relativeTo.state, fieldName, initializeReplacement);
|
|
60
|
-
}
|
|
61
|
-
deleteEntity() {
|
|
62
|
-
this.operations.deleteEntity(this.state);
|
|
63
|
-
}
|
|
64
|
-
//
|
|
65
|
-
updateValues(fieldValuePairs) {
|
|
66
|
-
this.batchUpdates((getAccessor) => {
|
|
67
|
-
const entries = Array.isArray(fieldValuePairs) ? fieldValuePairs : Object.entries(fieldValuePairs);
|
|
68
|
-
for (const [field, value] of entries) {
|
|
69
|
-
getAccessor().getField(field).updateValue(value);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Please keep in mind that this method signature is literally impossible to implement safely. The generic parameter
|
|
75
|
-
* is really just a way to succinctly write a type cast. Nothing more, really.
|
|
76
|
-
*/
|
|
77
|
-
getField(field) {
|
|
78
|
-
if (typeof field === "string" || !("hasOneRelationPath" in field)) {
|
|
79
|
-
return this.getField(bindingCommon.QueryLanguage.desugarRelativeSingleField(field, this.environment));
|
|
80
|
-
}
|
|
81
|
-
const entity = this.getEntity(field);
|
|
82
|
-
const fieldPlaceholder = bindingCommon.PlaceholderGenerator.getFieldPlaceholder(field.field);
|
|
83
|
-
const accessor = entity.fieldData.get(fieldPlaceholder);
|
|
84
|
-
if (accessor) {
|
|
85
|
-
return accessor.getAccessor();
|
|
86
|
-
}
|
|
87
|
-
bindingCommon.TreeNodeUtils.resolveColumn(entity.environment, field.field);
|
|
88
|
-
throw new bindingCommon.BindingError(
|
|
89
|
-
`EntityAccessor: cannot access field '${field.field}' on ${bindingCommon.TreeNodeUtils.describeLocation(entity.environment)}.
|
|
90
|
-
The cause of the error is that this relation has not been registered during the static rendering process. As a result, it lacks a required marker and accessor.`
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
getEntity(entity) {
|
|
94
|
-
if (typeof entity === "string" || !("hasOneRelationPath" in entity)) {
|
|
95
|
-
return this.getEntity(bindingCommon.QueryLanguage.desugarRelativeSingleEntity(entity, this.environment));
|
|
96
|
-
}
|
|
97
|
-
let relativeTo = this;
|
|
98
|
-
for (const hasOneRelation of entity.hasOneRelationPath) {
|
|
99
|
-
const fieldPlaceholder = bindingCommon.PlaceholderGenerator.getHasOneRelationPlaceholder(hasOneRelation);
|
|
100
|
-
const accessor = relativeTo.fieldData.get(fieldPlaceholder);
|
|
101
|
-
if (!accessor) {
|
|
102
|
-
return this.raiseInvalidHasOneRelationError(relativeTo, hasOneRelation);
|
|
103
|
-
}
|
|
104
|
-
relativeTo = accessor.getAccessor();
|
|
105
|
-
}
|
|
106
|
-
return relativeTo;
|
|
107
|
-
}
|
|
108
|
-
getEntityList(entityList) {
|
|
109
|
-
if (typeof entityList === "string" || !("hasOneRelationPath" in entityList)) {
|
|
110
|
-
return this.getEntityList(bindingCommon.QueryLanguage.desugarRelativeEntityList(entityList, this.environment));
|
|
111
|
-
}
|
|
112
|
-
const entity = this.getEntity(entityList);
|
|
113
|
-
const fieldPlaceholder = bindingCommon.PlaceholderGenerator.getHasManyRelationPlaceholder(entityList.hasManyRelation);
|
|
114
|
-
const accessor = entity.fieldData.get(fieldPlaceholder);
|
|
115
|
-
if (!accessor) {
|
|
116
|
-
return this.raiseInvalidHasManyRelationError(entity, entityList.hasManyRelation);
|
|
117
|
-
}
|
|
118
|
-
return accessor.getAccessor();
|
|
119
|
-
}
|
|
120
|
-
raiseInvalidHasOneRelationError(relativeTo, hasOneRelation) {
|
|
121
|
-
bindingCommon.TreeNodeUtils.resolveHasOneRelation(relativeTo.environment, hasOneRelation.field, !!hasOneRelation.reducedBy);
|
|
122
|
-
const entityMarker = relativeTo.getMarker();
|
|
123
|
-
const possibleMarkers = this.getMarkersOfType(entityMarker.fields.markers, bindingCommon.HasOneRelationMarker, hasOneRelation.field);
|
|
124
|
-
const markerParams = possibleMarkers.map((it) => bindingCommon.PlaceholderParametersGenerator.createHasOneRelationParameters(it.parameters));
|
|
125
|
-
const relationParams = bindingCommon.PlaceholderParametersGenerator.createHasOneRelationParameters(hasOneRelation);
|
|
126
|
-
this.raiseUndefinedRelationError(hasOneRelation.field, relativeTo.environment, relationParams, markerParams);
|
|
127
|
-
}
|
|
128
|
-
raiseInvalidHasManyRelationError(entity, hasManyRelation) {
|
|
129
|
-
bindingCommon.TreeNodeUtils.resolveHasManyRelation(entity.environment, hasManyRelation.field);
|
|
130
|
-
const entityMarker = entity.getMarker();
|
|
131
|
-
const possibleMarkers = this.getMarkersOfType(entityMarker.fields.markers, bindingCommon.HasManyRelationMarker, hasManyRelation.field);
|
|
132
|
-
const markerParams = possibleMarkers.map((it) => bindingCommon.PlaceholderParametersGenerator.createHasManyRelationParameters(it.parameters));
|
|
133
|
-
const relationParams = bindingCommon.PlaceholderParametersGenerator.createHasManyRelationParameters(hasManyRelation);
|
|
134
|
-
this.raiseUndefinedRelationError(hasManyRelation.field, entity.environment, relationParams, markerParams);
|
|
135
|
-
}
|
|
136
|
-
raiseUndefinedRelationError(field, environment, relationParams, otherMarkersParams) {
|
|
137
|
-
const hint = this.createHintMessage(otherMarkersParams);
|
|
138
|
-
throw new bindingCommon.BindingError(
|
|
139
|
-
`EntityAccessor: cannot access relation '${field}' on ${bindingCommon.TreeNodeUtils.describeLocation(environment)}.
|
|
140
|
-
The cause of the error is that this relation has not been registered during the static rendering process. As a result, it lacks a required marker and accessor.
|
|
141
|
-
|
|
142
|
-
Provided parameters:
|
|
143
|
-
` + JSON.stringify(relationParams) + hint
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
createHintMessage(params) {
|
|
147
|
-
if (params.length === 0) {
|
|
148
|
-
return "";
|
|
149
|
-
}
|
|
150
|
-
const serializedParams = params.map((it) => JSON.stringify(it)).join("\n");
|
|
151
|
-
const message = params.length === 1 ? "However, there is existing marker for the same field, but it have different parameters:" : "However, there are existing markers for the same field, but they have different parameters:";
|
|
152
|
-
return `
|
|
153
|
-
|
|
154
|
-
${message}
|
|
155
|
-
${serializedParams}`;
|
|
156
|
-
}
|
|
157
|
-
getMarkersOfType(markers, markerConstructor, fieldName) {
|
|
158
|
-
return Array.from(markers.values()).filter((it) => it instanceof markerConstructor && it.parameters.field === fieldName);
|
|
159
|
-
}
|
|
160
|
-
getParent() {
|
|
161
|
-
const blueprint = this.state.blueprint;
|
|
162
|
-
if (blueprint.type === "subTree") {
|
|
163
|
-
return void 0;
|
|
164
|
-
}
|
|
165
|
-
return blueprint.parent.getAccessor();
|
|
166
|
-
}
|
|
167
|
-
getMarker() {
|
|
168
|
-
return getEntityMarker.getEntityMarker(this.state);
|
|
169
|
-
}
|
|
170
|
-
getFieldMeta(field) {
|
|
171
|
-
const fieldData = this.dataFromServer?.get(field);
|
|
172
|
-
return {
|
|
173
|
-
readable: fieldData?.readable,
|
|
174
|
-
updatable: fieldData?.updatable
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
exports.EntityAccessorImpl = EntityAccessorImpl;
|
|
179
|
-
//# sourceMappingURL=EntityAccessorImpl.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityAccessorImpl.cjs","sources":["../../../../../packages/binding-legacy/src/accessors/EntityAccessorImpl.ts"],"sourcesContent":["import { EntityRealmState, getEntityMarker } from '../core/state'\nimport type { EntityOperations } from '../core/operations'\nimport { SingleEntityPersistedData } from '../accessorTree'\nimport {\n\tEntityFieldMarkers,\n\tEntityListAccessor,\n\tFieldAccessor,\n\tFieldValue,\n\tHasManyRelation,\n\tHasManyRelationMarker,\n\tHasOneRelation,\n\tRelativeEntityList,\n\tRelativeSingleEntity,\n\tRelativeSingleField,\n\tSugaredRelativeEntityList,\n\tSugaredRelativeSingleField,\n} from '@contember/binding-common'\nimport {\n\tBindingError,\n\tEntityAccessor,\n\tEntityId,\n\tEntityName,\n\tEntityRealmKey,\n\tEnvironment,\n\tErrorAccessor,\n\tHasOneRelationMarker,\n\tPlaceholderGenerator,\n\tPlaceholderParametersGenerator,\n\tQueryLanguage,\n\tRuntimeId,\n\tSugaredRelativeSingleEntity,\n\tTreeNodeUtils,\n} from '@contember/binding-common'\n\nexport class EntityAccessorImpl implements EntityAccessor {\n\tpublic readonly __type = 'EntityAccessor' as const\n\n\tpublic constructor(\n\t\tprivate readonly state: EntityRealmState,\n\t\tprivate readonly operations: EntityOperations,\n\t\tprivate readonly runtimeId: RuntimeId,\n\t\treadonly key: EntityRealmKey, // ⚠️ This is *NOT* the id! ⚠️\n\t\treadonly name: EntityName,\n\t\tprivate readonly fieldData: EntityAccessor.FieldData,\n\t\tprivate readonly dataFromServer: SingleEntityPersistedData | undefined,\n\t\treadonly hasUnpersistedChanges: boolean,\n\t\treadonly errors: ErrorAccessor | undefined,\n\t\treadonly environment: Environment,\n\t\treadonly getAccessor: EntityAccessor.GetEntityAccessor,\n\t) {\n\t}\n\n\tget idOnServer(): EntityId | undefined {\n\t\treturn this.runtimeId.existsOnServer ? this.runtimeId.value : undefined\n\t}\n\n\t/**\n\t * Note that for entities that don't yet exist on server this will return a dummy id.\n\t */\n\tget id(): EntityId {\n\t\treturn this.runtimeId.value\n\t}\n\n\tget existsOnServer(): boolean {\n\t\treturn this.runtimeId.existsOnServer\n\t}\n\n\t//\n\n\taddError(error: ErrorAccessor.Error | string): () => void {\n\t\treturn this.operations.addError(this.state, ErrorAccessor.normalizeError(error))\n\t}\n\n\taddEventListener<Type extends keyof EntityAccessor.RuntimeEntityEventListenerMap>(\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: EntityAccessor.EntityEventListenerMap[Type],\n\t): () => void {\n\t\treturn this.operations.addEventListener(this.state, event, listener)\n\t}\n\n\tbatchUpdates(performUpdates: EntityAccessor.BatchUpdatesHandler): void {\n\t\tthis.operations.batchUpdates(this.state, performUpdates)\n\t}\n\n\tconnectEntityAtField(field: SugaredRelativeSingleEntity | string, entityToConnect: EntityAccessor): void {\n\t\tconst desugared = QueryLanguage.desugarRelativeSingleEntity(field, this.environment)\n\t\tconst relativeTo = this.getEntity({\n\t\t\thasOneRelationPath: desugared.hasOneRelationPath.slice(0, -1),\n\t\t})\n\t\tconst fieldName = desugared.hasOneRelationPath[desugared.hasOneRelationPath.length - 1].field\n\t\tthis.operations.connectEntityAtField(relativeTo.state, fieldName, entityToConnect)\n\t}\n\n\tdisconnectEntityAtField(field: SugaredRelativeSingleEntity | string, initializeReplacement?: EntityAccessor.BatchUpdatesHandler): void {\n\t\tconst desugared = QueryLanguage.desugarRelativeSingleEntity(field, this.environment)\n\t\tconst relativeTo = this.getEntity({\n\t\t\thasOneRelationPath: desugared.hasOneRelationPath.slice(0, -1),\n\t\t})\n\t\tconst fieldName = desugared.hasOneRelationPath[desugared.hasOneRelationPath.length - 1].field\n\t\tthis.operations.disconnectEntityAtField(relativeTo.state, fieldName, initializeReplacement)\n\t}\n\n\tdeleteEntity(): void {\n\t\tthis.operations.deleteEntity(this.state)\n\t}\n\n\t//\n\n\tupdateValues(fieldValuePairs: EntityAccessor.FieldValuePairs): void {\n\t\tthis.batchUpdates(getAccessor => {\n\t\t\tconst entries = Array.isArray(fieldValuePairs) ? fieldValuePairs : Object.entries(fieldValuePairs)\n\n\t\t\tfor (const [field, value] of entries) {\n\t\t\t\tgetAccessor().getField(field).updateValue(value)\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Please keep in mind that this method signature is literally impossible to implement safely. The generic parameter\n\t * is really just a way to succinctly write a type cast. Nothing more, really.\n\t */\n\tgetField<Value extends FieldValue = FieldValue>(field: SugaredRelativeSingleField | string | RelativeSingleField): FieldAccessor<Value> {\n\t\tif (typeof field === 'string' || !('hasOneRelationPath' in field)) {\n\t\t\treturn this.getField<Value>(QueryLanguage.desugarRelativeSingleField(field, this.environment))\n\t\t}\n\n\t\tconst entity = this.getEntity(field)\n\t\tconst fieldPlaceholder = PlaceholderGenerator.getFieldPlaceholder(field.field)\n\t\tconst accessor = entity.fieldData.get(fieldPlaceholder)\n\t\tif (accessor) {\n\t\t\treturn accessor.getAccessor() as FieldAccessor<Value>\n\t\t}\n\n\t\tTreeNodeUtils.resolveColumn(entity.environment, field.field)\n\n\t\tthrow new BindingError(''\n\t\t\t+ 'EntityAccessor: cannot access field '\n\t\t\t+ `'${field.field}' on ${TreeNodeUtils.describeLocation(entity.environment)}.\\n`\n\t\t\t+ 'The cause of the error is that this relation has not been registered during the static rendering process. As a result, it lacks a required marker and accessor.',\n\t\t)\n\t}\n\n\tgetEntity(entity: SugaredRelativeSingleEntity | string | RelativeSingleEntity): EntityAccessorImpl {\n\t\tif (typeof entity === 'string' || !('hasOneRelationPath' in entity)) {\n\t\t\treturn this.getEntity(QueryLanguage.desugarRelativeSingleEntity(entity, this.environment))\n\t\t}\n\n\t\tlet relativeTo: EntityAccessorImpl = this\n\n\t\tfor (const hasOneRelation of entity.hasOneRelationPath) {\n\t\t\tconst fieldPlaceholder = PlaceholderGenerator.getHasOneRelationPlaceholder(hasOneRelation)\n\t\t\tconst accessor = relativeTo.fieldData.get(fieldPlaceholder)\n\t\t\tif (!accessor) {\n\t\t\t\treturn this.raiseInvalidHasOneRelationError(relativeTo, hasOneRelation)\n\t\t\t}\n\n\t\t\trelativeTo = accessor.getAccessor() as EntityAccessorImpl\n\t\t}\n\t\treturn relativeTo\n\t}\n\n\tgetEntityList(entityList: SugaredRelativeEntityList | string | RelativeEntityList): EntityListAccessor {\n\t\tif (typeof entityList === 'string' || !('hasOneRelationPath' in entityList)) {\n\t\t\treturn this.getEntityList(QueryLanguage.desugarRelativeEntityList(entityList, this.environment))\n\t\t}\n\n\t\tconst entity = this.getEntity(entityList)\n\t\tconst fieldPlaceholder = PlaceholderGenerator.getHasManyRelationPlaceholder(entityList.hasManyRelation)\n\t\tconst accessor = entity.fieldData.get(fieldPlaceholder)\n\t\tif (!accessor) {\n\t\t\treturn this.raiseInvalidHasManyRelationError(entity, entityList.hasManyRelation)\n\t\t}\n\n\t\treturn accessor.getAccessor() as EntityListAccessor\n\t}\n\n\tprivate raiseInvalidHasOneRelationError(relativeTo: EntityAccessor, hasOneRelation: HasOneRelation): never {\n\t\tTreeNodeUtils.resolveHasOneRelation(relativeTo.environment, hasOneRelation.field, !!hasOneRelation.reducedBy)\n\n\t\tconst entityMarker = relativeTo.getMarker()\n\t\tconst possibleMarkers = this.getMarkersOfType(entityMarker.fields.markers, HasOneRelationMarker, hasOneRelation.field)\n\t\tconst markerParams = possibleMarkers.map(it => PlaceholderParametersGenerator.createHasOneRelationParameters(it.parameters))\n\n\t\tconst relationParams = PlaceholderParametersGenerator.createHasOneRelationParameters(hasOneRelation)\n\n\t\tthis.raiseUndefinedRelationError(hasOneRelation.field, relativeTo.environment, relationParams, markerParams)\n\t}\n\n\tprivate raiseInvalidHasManyRelationError(entity: EntityAccessor, hasManyRelation: HasManyRelation): never {\n\t\tTreeNodeUtils.resolveHasManyRelation(entity.environment, hasManyRelation.field)\n\n\t\tconst entityMarker = entity.getMarker()\n\t\tconst possibleMarkers = this.getMarkersOfType(entityMarker.fields.markers, HasManyRelationMarker, hasManyRelation.field)\n\t\tconst markerParams = possibleMarkers.map(it => PlaceholderParametersGenerator.createHasManyRelationParameters(it.parameters))\n\n\t\tconst relationParams = PlaceholderParametersGenerator.createHasManyRelationParameters(hasManyRelation)\n\n\t\tthis.raiseUndefinedRelationError(hasManyRelation.field, entity.environment, relationParams, markerParams)\n\t}\n\n\tprivate raiseUndefinedRelationError(field: string, environment: Environment, relationParams: any, otherMarkersParams: any[]): never {\n\t\tconst hint = this.createHintMessage(otherMarkersParams)\n\t\tthrow new BindingError(''\n\t\t\t+ `EntityAccessor: cannot access relation `\n\t\t\t+ `'${field}' on ${TreeNodeUtils.describeLocation(environment)}.\\n`\n\t\t\t+ 'The cause of the error is that this relation has not been registered during the static rendering process. As a result, it lacks a required marker and accessor.\\n\\n'\n\t\t\t+ 'Provided parameters:\\n'\n\t\t\t+ JSON.stringify(relationParams)\n\t\t\t+ hint,\n\t\t)\n\t}\n\n\tprivate createHintMessage(params: any[]): string {\n\t\tif (params.length === 0) {\n\t\t\treturn ''\n\t\t}\n\n\t\tconst serializedParams = params.map(it => JSON.stringify(it)).join('\\n')\n\t\tconst message = params.length === 1\n\t\t\t? 'However, there is existing marker for the same field, but it have different parameters:'\n\t\t\t: 'However, there are existing markers for the same field, but they have different parameters:'\n\n\t\treturn `\\n\\n${message}\\n${serializedParams}`\n\t}\n\n\tprivate getMarkersOfType<T extends { new(...args: any[]): HasManyRelationMarker | HasOneRelationMarker }>(\n\t\tmarkers: EntityFieldMarkers,\n\t\tmarkerConstructor: T,\n\t\tfieldName: string,\n\t): InstanceType<T>[] {\n\t\treturn Array.from(markers.values())\n\t\t\t.filter((it): it is InstanceType<T> => (it instanceof markerConstructor) && it.parameters.field === fieldName)\n\t}\n\n\tgetParent(): EntityAccessor | EntityListAccessor | undefined {\n\t\tconst blueprint = this.state.blueprint\n\t\tif (blueprint.type === 'subTree') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn blueprint.parent.getAccessor()\n\t}\n\n\tgetMarker() {\n\t\treturn getEntityMarker(this.state)\n\t}\n\n\tgetFieldMeta(field: string) {\n\t\tconst fieldData = this.dataFromServer?.get(field)\n\t\treturn {\n\t\t\treadable: fieldData?.readable,\n\t\t\tupdatable: fieldData?.updatable,\n\t\t}\n\t}\n}\n"],"names":["ErrorAccessor","QueryLanguage","PlaceholderGenerator","TreeNodeUtils","BindingError","HasOneRelationMarker","PlaceholderParametersGenerator","HasManyRelationMarker","getEntityMarker"],"mappings":";;;;;;;AAkCO,MAAM,mBAA6C;AAAA,EAGlD,YACW,OACA,YACA,WACR,KACA,MACQ,WACA,gBACR,uBACA,QACA,aACA,aACR;AAXgB,SAAA,QAAA;AACA,SAAA,aAAA;AACA,SAAA,YAAA;AACR,SAAA,MAAA;AACA,SAAA,OAAA;AACQ,SAAA,YAAA;AACA,SAAA,iBAAA;AACR,SAAA,wBAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AACA,SAAA,cAAA;AAbV,kBAAA,MAAgB,UAAS,gBAAA;AAAA,EAAA;AAAA,EAiBzB,IAAI,aAAmC;AACtC,WAAO,KAAK,UAAU,iBAAiB,KAAK,UAAU,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAM/D,IAAI,KAAe;AAClB,WAAO,KAAK,UAAU;AAAA,EAAA;AAAA,EAGvB,IAAI,iBAA0B;AAC7B,WAAO,KAAK,UAAU;AAAA,EAAA;AAAA;AAAA,EAKvB,SAAS,OAAiD;AAClD,WAAA,KAAK,WAAW,SAAS,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