@contember/binding-legacy 2.1.0-alpha.37 → 2.1.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/index.cjs +34 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +28 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/src/accessorTree/NormalizedPersistedData.cjs +10 -0
- package/dist/development/src/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/development/src/accessorTree/NormalizedPersistedData.js +10 -0
- package/dist/development/src/accessorTree/NormalizedPersistedData.js.map +1 -0
- package/dist/development/src/accessors/EntityAccessorImpl.cjs +179 -0
- package/dist/development/src/accessors/EntityAccessorImpl.cjs.map +1 -0
- package/dist/development/src/accessors/EntityAccessorImpl.js +179 -0
- package/dist/development/src/accessors/EntityAccessorImpl.js.map +1 -0
- package/dist/development/src/accessors/EntityListAccessorImpl.cjs +112 -0
- package/dist/development/src/accessors/EntityListAccessorImpl.cjs.map +1 -0
- package/dist/development/src/accessors/EntityListAccessorImpl.js +112 -0
- package/dist/development/src/accessors/EntityListAccessorImpl.js.map +1 -0
- package/dist/development/src/accessors/FieldAccessorImpl.cjs +54 -0
- package/dist/development/src/accessors/FieldAccessorImpl.cjs.map +1 -0
- package/dist/development/src/accessors/FieldAccessorImpl.js +54 -0
- package/dist/development/src/accessors/FieldAccessorImpl.js.map +1 -0
- package/dist/development/src/core/AccessorErrorManager.cjs +200 -0
- package/dist/development/src/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/development/src/core/AccessorErrorManager.js +200 -0
- package/dist/development/src/core/AccessorErrorManager.js.map +1 -0
- package/dist/development/src/core/Config.cjs +29 -0
- package/dist/development/src/core/Config.cjs.map +1 -0
- package/dist/development/src/core/Config.js +29 -0
- package/dist/development/src/core/Config.js.map +1 -0
- package/dist/development/src/core/DataBinding.cjs +357 -0
- package/dist/development/src/core/DataBinding.cjs.map +1 -0
- package/dist/development/src/core/DataBinding.js +357 -0
- package/dist/development/src/core/DataBinding.js.map +1 -0
- package/dist/development/src/core/DirtinessTracker.cjs +26 -0
- package/dist/development/src/core/DirtinessTracker.cjs.map +1 -0
- package/dist/development/src/core/DirtinessTracker.js +26 -0
- package/dist/development/src/core/DirtinessTracker.js.map +1 -0
- package/dist/development/src/core/ErrorsPreprocessor.cjs +180 -0
- package/dist/development/src/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/development/src/core/ErrorsPreprocessor.js +180 -0
- package/dist/development/src/core/ErrorsPreprocessor.js.map +1 -0
- package/dist/development/src/core/EventManager.cjs +439 -0
- package/dist/development/src/core/EventManager.cjs.map +1 -0
- package/dist/development/src/core/EventManager.js +439 -0
- package/dist/development/src/core/EventManager.js.map +1 -0
- package/dist/development/src/core/MutationGenerator.cjs +670 -0
- package/dist/development/src/core/MutationGenerator.cjs.map +1 -0
- package/dist/development/src/core/MutationGenerator.js +670 -0
- package/dist/development/src/core/MutationGenerator.js.map +1 -0
- package/dist/development/src/core/QueryGenerator.cjs +110 -0
- package/dist/development/src/core/QueryGenerator.cjs.map +1 -0
- package/dist/development/src/core/QueryGenerator.js +110 -0
- package/dist/development/src/core/QueryGenerator.js.map +1 -0
- package/dist/development/src/core/RealmKeyGenerator.cjs +42 -0
- package/dist/development/src/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/development/src/core/RealmKeyGenerator.js +42 -0
- package/dist/development/src/core/RealmKeyGenerator.js.map +1 -0
- package/dist/development/src/core/RequestResponseNormalizer.cjs +136 -0
- package/dist/development/src/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/development/src/core/RequestResponseNormalizer.js +136 -0
- package/dist/development/src/core/RequestResponseNormalizer.js.map +1 -0
- package/dist/development/src/core/StateInitializer.cjs +379 -0
- package/dist/development/src/core/StateInitializer.cjs.map +1 -0
- package/dist/development/src/core/StateInitializer.js +379 -0
- package/dist/development/src/core/StateInitializer.js.map +1 -0
- package/dist/development/src/core/TreeAugmenter.cjs +351 -0
- package/dist/development/src/core/TreeAugmenter.cjs.map +1 -0
- package/dist/development/src/core/TreeAugmenter.js +351 -0
- package/dist/development/src/core/TreeAugmenter.js.map +1 -0
- package/dist/development/src/core/TreeStore.cjs +172 -0
- package/dist/development/src/core/TreeStore.cjs.map +1 -0
- package/dist/development/src/core/TreeStore.js +172 -0
- package/dist/development/src/core/TreeStore.js.map +1 -0
- package/dist/development/src/core/exceptions/ErrorLocator.cjs +59 -0
- package/dist/development/src/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/development/src/core/exceptions/ErrorLocator.js +59 -0
- package/dist/development/src/core/exceptions/ErrorLocator.js.map +1 -0
- package/dist/development/src/core/exceptions/MarkerSugarer.cjs +51 -0
- package/dist/development/src/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/development/src/core/exceptions/MarkerSugarer.js +51 -0
- package/dist/development/src/core/exceptions/MarkerSugarer.js.map +1 -0
- package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs +33 -0
- package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/development/src/core/exceptions/TreeParameterSugarer.js +33 -0
- package/dist/development/src/core/exceptions/TreeParameterSugarer.js.map +1 -0
- package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs +23 -0
- package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/development/src/core/factories/createBatchUpdatesOptions.js +23 -0
- package/dist/development/src/core/factories/createBatchUpdatesOptions.js.map +1 -0
- package/dist/development/src/core/operations/EntityOperations.cjs +224 -0
- package/dist/development/src/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/development/src/core/operations/EntityOperations.js +224 -0
- package/dist/development/src/core/operations/EntityOperations.js.map +1 -0
- package/dist/development/src/core/operations/FieldOperations.cjs +92 -0
- package/dist/development/src/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/development/src/core/operations/FieldOperations.js +92 -0
- package/dist/development/src/core/operations/FieldOperations.js.map +1 -0
- package/dist/development/src/core/operations/ListOperations.cjs +158 -0
- package/dist/development/src/core/operations/ListOperations.cjs.map +1 -0
- package/dist/development/src/core/operations/ListOperations.js +158 -0
- package/dist/development/src/core/operations/ListOperations.js.map +1 -0
- package/dist/development/src/core/operations/OperationsHelpers.cjs +87 -0
- package/dist/development/src/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/development/src/core/operations/OperationsHelpers.js +87 -0
- package/dist/development/src/core/operations/OperationsHelpers.js.map +1 -0
- package/dist/development/src/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/development/src/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/development/src/core/requestAliases/MutationAlias.js +14 -0
- package/dist/development/src/core/requestAliases/MutationAlias.js.map +1 -0
- package/dist/development/src/core/state/StateIterator.cjs +100 -0
- package/dist/development/src/core/state/StateIterator.cjs.map +1 -0
- package/dist/development/src/core/state/StateIterator.js +100 -0
- package/dist/development/src/core/state/StateIterator.js.map +1 -0
- package/dist/development/src/core/state/getEntityMarker.cjs +5 -0
- package/dist/development/src/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/development/src/core/state/getEntityMarker.js +5 -0
- package/dist/development/src/core/state/getEntityMarker.js.map +1 -0
- package/dist/development/src/core/utils/getCombinedSignal.cjs +33 -0
- package/dist/development/src/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/development/src/core/utils/getCombinedSignal.js +33 -0
- package/dist/development/src/core/utils/getCombinedSignal.js.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs +13 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.js +13 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.js.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js +18 -0
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js +16 -0
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -0
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js +7 -0
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js.map +1 -0
- package/dist/development/src/utils/isEmptyObject.cjs +12 -0
- package/dist/development/src/utils/isEmptyObject.cjs.map +1 -0
- package/dist/development/src/utils/isEmptyObject.js +12 -0
- package/dist/development/src/utils/isEmptyObject.js.map +1 -0
- package/dist/production/index.cjs +34 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +28 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/src/accessorTree/NormalizedPersistedData.cjs +10 -0
- package/dist/production/src/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/production/src/accessorTree/NormalizedPersistedData.js +10 -0
- package/dist/production/src/accessorTree/NormalizedPersistedData.js.map +1 -0
- package/dist/production/src/accessors/EntityAccessorImpl.cjs +179 -0
- package/dist/production/src/accessors/EntityAccessorImpl.cjs.map +1 -0
- package/dist/production/src/accessors/EntityAccessorImpl.js +179 -0
- package/dist/production/src/accessors/EntityAccessorImpl.js.map +1 -0
- package/dist/production/src/accessors/EntityListAccessorImpl.cjs +112 -0
- package/dist/production/src/accessors/EntityListAccessorImpl.cjs.map +1 -0
- package/dist/production/src/accessors/EntityListAccessorImpl.js +112 -0
- package/dist/production/src/accessors/EntityListAccessorImpl.js.map +1 -0
- package/dist/production/src/accessors/FieldAccessorImpl.cjs +54 -0
- package/dist/production/src/accessors/FieldAccessorImpl.cjs.map +1 -0
- package/dist/production/src/accessors/FieldAccessorImpl.js +54 -0
- package/dist/production/src/accessors/FieldAccessorImpl.js.map +1 -0
- package/dist/production/src/core/AccessorErrorManager.cjs +200 -0
- package/dist/production/src/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/production/src/core/AccessorErrorManager.js +200 -0
- package/dist/production/src/core/AccessorErrorManager.js.map +1 -0
- package/dist/production/src/core/Config.cjs +29 -0
- package/dist/production/src/core/Config.cjs.map +1 -0
- package/dist/production/src/core/Config.js +29 -0
- package/dist/production/src/core/Config.js.map +1 -0
- package/dist/production/src/core/DataBinding.cjs +357 -0
- package/dist/production/src/core/DataBinding.cjs.map +1 -0
- package/dist/production/src/core/DataBinding.js +357 -0
- package/dist/production/src/core/DataBinding.js.map +1 -0
- package/dist/production/src/core/DirtinessTracker.cjs +26 -0
- package/dist/production/src/core/DirtinessTracker.cjs.map +1 -0
- package/dist/production/src/core/DirtinessTracker.js +26 -0
- package/dist/production/src/core/DirtinessTracker.js.map +1 -0
- package/dist/production/src/core/ErrorsPreprocessor.cjs +180 -0
- package/dist/production/src/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/production/src/core/ErrorsPreprocessor.js +180 -0
- package/dist/production/src/core/ErrorsPreprocessor.js.map +1 -0
- package/dist/production/src/core/EventManager.cjs +413 -0
- package/dist/production/src/core/EventManager.cjs.map +1 -0
- package/dist/production/src/core/EventManager.js +413 -0
- package/dist/production/src/core/EventManager.js.map +1 -0
- package/dist/production/src/core/MutationGenerator.cjs +670 -0
- package/dist/production/src/core/MutationGenerator.cjs.map +1 -0
- package/dist/production/src/core/MutationGenerator.js +670 -0
- package/dist/production/src/core/MutationGenerator.js.map +1 -0
- package/dist/production/src/core/QueryGenerator.cjs +110 -0
- package/dist/production/src/core/QueryGenerator.cjs.map +1 -0
- package/dist/production/src/core/QueryGenerator.js +110 -0
- package/dist/production/src/core/QueryGenerator.js.map +1 -0
- package/dist/production/src/core/RealmKeyGenerator.cjs +42 -0
- package/dist/production/src/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/production/src/core/RealmKeyGenerator.js +42 -0
- package/dist/production/src/core/RealmKeyGenerator.js.map +1 -0
- package/dist/production/src/core/RequestResponseNormalizer.cjs +136 -0
- package/dist/production/src/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/production/src/core/RequestResponseNormalizer.js +136 -0
- package/dist/production/src/core/RequestResponseNormalizer.js.map +1 -0
- package/dist/production/src/core/StateInitializer.cjs +379 -0
- package/dist/production/src/core/StateInitializer.cjs.map +1 -0
- package/dist/production/src/core/StateInitializer.js +379 -0
- package/dist/production/src/core/StateInitializer.js.map +1 -0
- package/dist/production/src/core/TreeAugmenter.cjs +351 -0
- package/dist/production/src/core/TreeAugmenter.cjs.map +1 -0
- package/dist/production/src/core/TreeAugmenter.js +351 -0
- package/dist/production/src/core/TreeAugmenter.js.map +1 -0
- package/dist/production/src/core/TreeStore.cjs +172 -0
- package/dist/production/src/core/TreeStore.cjs.map +1 -0
- package/dist/production/src/core/TreeStore.js +172 -0
- package/dist/production/src/core/TreeStore.js.map +1 -0
- package/dist/production/src/core/exceptions/ErrorLocator.cjs +59 -0
- package/dist/production/src/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/production/src/core/exceptions/ErrorLocator.js +59 -0
- package/dist/production/src/core/exceptions/ErrorLocator.js.map +1 -0
- package/dist/production/src/core/exceptions/MarkerSugarer.cjs +51 -0
- package/dist/production/src/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/production/src/core/exceptions/MarkerSugarer.js +51 -0
- package/dist/production/src/core/exceptions/MarkerSugarer.js.map +1 -0
- package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs +33 -0
- package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/production/src/core/exceptions/TreeParameterSugarer.js +33 -0
- package/dist/production/src/core/exceptions/TreeParameterSugarer.js.map +1 -0
- package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs +23 -0
- package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/production/src/core/factories/createBatchUpdatesOptions.js +23 -0
- package/dist/production/src/core/factories/createBatchUpdatesOptions.js.map +1 -0
- package/dist/production/src/core/operations/EntityOperations.cjs +224 -0
- package/dist/production/src/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/production/src/core/operations/EntityOperations.js +224 -0
- package/dist/production/src/core/operations/EntityOperations.js.map +1 -0
- package/dist/production/src/core/operations/FieldOperations.cjs +73 -0
- package/dist/production/src/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/production/src/core/operations/FieldOperations.js +73 -0
- package/dist/production/src/core/operations/FieldOperations.js.map +1 -0
- package/dist/production/src/core/operations/ListOperations.cjs +158 -0
- package/dist/production/src/core/operations/ListOperations.cjs.map +1 -0
- package/dist/production/src/core/operations/ListOperations.js +158 -0
- package/dist/production/src/core/operations/ListOperations.js.map +1 -0
- package/dist/production/src/core/operations/OperationsHelpers.cjs +87 -0
- package/dist/production/src/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/production/src/core/operations/OperationsHelpers.js +87 -0
- package/dist/production/src/core/operations/OperationsHelpers.js.map +1 -0
- package/dist/production/src/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/production/src/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/production/src/core/requestAliases/MutationAlias.js +14 -0
- package/dist/production/src/core/requestAliases/MutationAlias.js.map +1 -0
- package/dist/production/src/core/state/StateIterator.cjs +100 -0
- package/dist/production/src/core/state/StateIterator.cjs.map +1 -0
- package/dist/production/src/core/state/StateIterator.js +100 -0
- package/dist/production/src/core/state/StateIterator.js.map +1 -0
- package/dist/production/src/core/state/getEntityMarker.cjs +5 -0
- package/dist/production/src/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/production/src/core/state/getEntityMarker.js +5 -0
- package/dist/production/src/core/state/getEntityMarker.js.map +1 -0
- package/dist/production/src/core/utils/getCombinedSignal.cjs +33 -0
- package/dist/production/src/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/production/src/core/utils/getCombinedSignal.js +33 -0
- package/dist/production/src/core/utils/getCombinedSignal.js.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs +13 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.js +13 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.js.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js +18 -0
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js +16 -0
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -0
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js +7 -0
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js.map +1 -0
- package/dist/production/src/utils/isEmptyObject.cjs +12 -0
- package/dist/production/src/utils/isEmptyObject.cjs.map +1 -0
- package/dist/production/src/utils/isEmptyObject.js +12 -0
- package/dist/production/src/utils/isEmptyObject.js.map +1 -0
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts +18 -0
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +1 -0
- package/dist/types/accessorTree/index.d.ts +2 -0
- package/dist/types/accessorTree/index.d.ts.map +1 -0
- package/dist/types/accessors/BindingConfig.d.ts +6 -0
- package/dist/types/accessors/BindingConfig.d.ts.map +1 -0
- package/dist/types/accessors/EntityAccessorImpl.d.ts +56 -0
- package/dist/types/accessors/EntityAccessorImpl.d.ts.map +1 -0
- package/dist/types/accessors/EntityListAccessorImpl.d.ts +57 -0
- package/dist/types/accessors/EntityListAccessorImpl.d.ts.map +1 -0
- package/dist/types/accessors/FieldAccessorImpl.d.ts +32 -0
- package/dist/types/accessors/FieldAccessorImpl.d.ts.map +1 -0
- package/dist/types/accessors/index.d.ts +5 -0
- package/dist/types/accessors/index.d.ts.map +1 -0
- package/dist/types/core/AccessorErrorManager.d.ts +25 -0
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -0
- package/dist/types/core/Config.d.ts +9 -0
- package/dist/types/core/Config.d.ts.map +1 -0
- package/dist/types/core/DataBinding.d.ts +54 -0
- package/dist/types/core/DataBinding.d.ts.map +1 -0
- package/dist/types/core/DirtinessTracker.d.ts +9 -0
- package/dist/types/core/DirtinessTracker.d.ts.map +1 -0
- package/dist/types/core/ErrorsPreprocessor.d.ts +34 -0
- package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -0
- package/dist/types/core/EventManager.d.ts +57 -0
- package/dist/types/core/EventManager.d.ts.map +1 -0
- package/dist/types/core/MutationGenerator.d.ts +49 -0
- package/dist/types/core/MutationGenerator.d.ts.map +1 -0
- package/dist/types/core/QueryGenerator.d.ts +13 -0
- package/dist/types/core/QueryGenerator.d.ts.map +1 -0
- package/dist/types/core/RealmKeyGenerator.d.ts +10 -0
- package/dist/types/core/RealmKeyGenerator.d.ts.map +1 -0
- package/dist/types/core/RequestResponseNormalizer.d.ts +11 -0
- package/dist/types/core/RequestResponseNormalizer.d.ts.map +1 -0
- package/dist/types/core/StateInitializer.d.ts +34 -0
- package/dist/types/core/StateInitializer.d.ts.map +1 -0
- package/dist/types/core/TreeAugmenter.d.ts +25 -0
- package/dist/types/core/TreeAugmenter.d.ts.map +1 -0
- package/dist/types/core/TreeStore.d.ts +30 -0
- package/dist/types/core/TreeStore.d.ts.map +1 -0
- package/dist/types/core/UpdateMetadata.d.ts +4 -0
- package/dist/types/core/UpdateMetadata.d.ts.map +1 -0
- package/dist/types/core/exceptions/ErrorLocator.d.ts +8 -0
- package/dist/types/core/exceptions/ErrorLocator.d.ts.map +1 -0
- package/dist/types/core/exceptions/MarkerSugarer.d.ts +10 -0
- package/dist/types/core/exceptions/MarkerSugarer.d.ts.map +1 -0
- package/dist/types/core/exceptions/TreeParameterSugarer.d.ts +11 -0
- package/dist/types/core/exceptions/TreeParameterSugarer.d.ts.map +1 -0
- package/dist/types/core/factories/createBatchUpdatesOptions.d.ts +5 -0
- package/dist/types/core/factories/createBatchUpdatesOptions.d.ts.map +1 -0
- package/dist/types/core/factories/index.d.ts +2 -0
- package/dist/types/core/factories/index.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +9 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/operations/EntityOperations.d.ts +26 -0
- package/dist/types/core/operations/EntityOperations.d.ts.map +1 -0
- package/dist/types/core/operations/FieldOperations.d.ts +22 -0
- package/dist/types/core/operations/FieldOperations.d.ts.map +1 -0
- package/dist/types/core/operations/ListOperations.d.ts +32 -0
- package/dist/types/core/operations/ListOperations.d.ts.map +1 -0
- package/dist/types/core/operations/OperationsHelpers.d.ts +14 -0
- package/dist/types/core/operations/OperationsHelpers.d.ts.map +1 -0
- package/dist/types/core/operations/index.d.ts +4 -0
- package/dist/types/core/operations/index.d.ts.map +1 -0
- package/dist/types/core/requestAliases/MutationAlias.d.ts +6 -0
- package/dist/types/core/requestAliases/MutationAlias.d.ts.map +1 -0
- package/dist/types/core/requestAliases/index.d.ts +2 -0
- package/dist/types/core/requestAliases/index.d.ts.map +1 -0
- package/dist/types/core/state/EntityListState.d.ts +29 -0
- package/dist/types/core/state/EntityListState.d.ts.map +1 -0
- package/dist/types/core/state/EntityRealmState.d.ts +44 -0
- package/dist/types/core/state/EntityRealmState.d.ts.map +1 -0
- package/dist/types/core/state/EntityState.d.ts +11 -0
- package/dist/types/core/state/EntityState.d.ts.map +1 -0
- package/dist/types/core/state/FieldState.d.ts +19 -0
- package/dist/types/core/state/FieldState.d.ts.map +1 -0
- package/dist/types/core/state/StateIterator.d.ts +14 -0
- package/dist/types/core/state/StateIterator.d.ts.map +1 -0
- package/dist/types/core/state/StateNode.d.ts +8 -0
- package/dist/types/core/state/StateNode.d.ts.map +1 -0
- package/dist/types/core/state/getEntityMarker.d.ts +3 -0
- package/dist/types/core/state/getEntityMarker.d.ts.map +1 -0
- package/dist/types/core/state/index.d.ts +8 -0
- package/dist/types/core/state/index.d.ts.map +1 -0
- package/dist/types/core/utils/getCombinedSignal.d.ts +2 -0
- package/dist/types/core/utils/getCombinedSignal.d.ts.map +1 -0
- package/dist/types/core/utils/index.d.ts +2 -0
- package/dist/types/core/utils/index.d.ts.map +1 -0
- package/dist/types/fieldHelpers/helpers/FieldHelper.d.ts +7 -0
- package/dist/types/fieldHelpers/helpers/FieldHelper.d.ts.map +1 -0
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts +10 -0
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts.map +1 -0
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts +10 -0
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts.map +1 -0
- package/dist/types/fieldHelpers/helpers/index.d.ts +3 -0
- package/dist/types/fieldHelpers/helpers/index.d.ts.map +1 -0
- package/dist/types/fieldHelpers/index.d.ts +2 -0
- package/dist/types/fieldHelpers/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dist/types/utils/assertNever.d.ts +2 -0
- package/dist/types/utils/assertNever.d.ts.map +1 -0
- package/dist/types/utils/generateEnumerabilityPreventingEntropy.d.ts +2 -0
- package/dist/types/utils/generateEnumerabilityPreventingEntropy.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/isEmptyObject.d.ts +2 -0
- package/dist/types/utils/isEmptyObject.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BindingError, PRIMARY_KEY_NAME } from "@contember/binding-common";
|
|
2
|
+
import { EventManager } from "../EventManager.js";
|
|
3
|
+
import { RealmKeyGenerator } from "../RealmKeyGenerator.js";
|
|
4
|
+
class OperationsHelpers {
|
|
5
|
+
static rejectInvalidAccessorTree() {
|
|
6
|
+
throw new BindingError(
|
|
7
|
+
`The accessor tree does not correspond to the MarkerTree. This should absolutely never happen.`
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
static resolveAndPrepareEntityToConnect(treeStore, entityToConnect) {
|
|
11
|
+
const entityToConnectKey = entityToConnect.key;
|
|
12
|
+
if (!entityToConnectKey) {
|
|
13
|
+
throw new BindingError(`Attempting to connect an entity without a key.`);
|
|
14
|
+
}
|
|
15
|
+
const stateToConnect = treeStore.entityRealmStore.get(entityToConnectKey);
|
|
16
|
+
if (stateToConnect === void 0) {
|
|
17
|
+
throw new BindingError(`Attempting to connect an entity with key '${entityToConnectKey}' but it doesn't exist.`);
|
|
18
|
+
}
|
|
19
|
+
return stateToConnect;
|
|
20
|
+
}
|
|
21
|
+
static changeEntityId(treeStore, eventManager, stateInitializer, entity, newId) {
|
|
22
|
+
const previousId = entity.id;
|
|
23
|
+
treeStore.entityStore.delete(previousId.uniqueValue);
|
|
24
|
+
treeStore.entityStore.set(newId.uniqueValue, entity);
|
|
25
|
+
let counter = 0;
|
|
26
|
+
for (const realm of entity.realms.values()) {
|
|
27
|
+
this.changeRealmId(treeStore, eventManager, stateInitializer, realm, newId);
|
|
28
|
+
if (++counter === entity.realms.size) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
entity.hasIdSetInStone = true;
|
|
33
|
+
entity.id = newId;
|
|
34
|
+
}
|
|
35
|
+
static changeRealmId(treeStore, eventManager, stateInitializer, realm, newId) {
|
|
36
|
+
const oldEntity = realm.entity;
|
|
37
|
+
const oldRealmKey = realm.realmKey;
|
|
38
|
+
const oldId = oldEntity.id;
|
|
39
|
+
const realmBlueprint = realm.blueprint;
|
|
40
|
+
const newEntity = stateInitializer.initializeEntityState(newId, oldEntity.entityName);
|
|
41
|
+
const newRealmKey = RealmKeyGenerator.getRealmKey(newId, realmBlueprint);
|
|
42
|
+
realm.realmKey = newRealmKey;
|
|
43
|
+
realm.entity = newEntity;
|
|
44
|
+
newEntity.id = newId;
|
|
45
|
+
oldEntity.realms.delete(oldRealmKey);
|
|
46
|
+
newEntity.realms.set(newRealmKey, realm);
|
|
47
|
+
if (realm.type === "entityRealm") {
|
|
48
|
+
const childIdState = realm.children.get(PRIMARY_KEY_NAME);
|
|
49
|
+
if (childIdState?.type === "field") {
|
|
50
|
+
childIdState.value = newId.value;
|
|
51
|
+
eventManager.registerJustUpdated(childIdState, EventManager.NO_CHANGES_DIFFERENCE);
|
|
52
|
+
}
|
|
53
|
+
this.purgeStaleListenersAfterIdChange(realm);
|
|
54
|
+
}
|
|
55
|
+
if (oldEntity.realms.size === 0) {
|
|
56
|
+
treeStore.disposeOfEntity(oldEntity);
|
|
57
|
+
}
|
|
58
|
+
treeStore.entityRealmStore.delete(oldRealmKey);
|
|
59
|
+
treeStore.entityRealmStore.set(newRealmKey, realm);
|
|
60
|
+
if (realmBlueprint.type === "listEntity") {
|
|
61
|
+
const list = realmBlueprint.parent;
|
|
62
|
+
list.children.changeKey(oldId.value, newId.value);
|
|
63
|
+
} else if (realmBlueprint.type === "hasOne") {
|
|
64
|
+
eventManager.registerUpdatedConnection(realmBlueprint.parent, realmBlueprint.marker.placeholderName);
|
|
65
|
+
}
|
|
66
|
+
const parent = realmBlueprint.parent;
|
|
67
|
+
if (parent) {
|
|
68
|
+
eventManager.registerJustUpdated(parent, EventManager.NO_CHANGES_DIFFERENCE);
|
|
69
|
+
}
|
|
70
|
+
if (realm.type === "entityRealm") {
|
|
71
|
+
eventManager.registerJustUpdated(realm, EventManager.NO_CHANGES_DIFFERENCE);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static purgeStaleListenersAfterIdChange(realm) {
|
|
75
|
+
const listeners = realm.eventListeners;
|
|
76
|
+
if (listeners) {
|
|
77
|
+
if (realm.blueprint.parent) {
|
|
78
|
+
listeners.delete({ type: "update" });
|
|
79
|
+
}
|
|
80
|
+
listeners.deleteByType("connectionUpdate");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
OperationsHelpers
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=OperationsHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationsHelpers.js","sources":["../../../../../../packages/binding-legacy/src/core/operations/OperationsHelpers.ts"],"sourcesContent":["import type { EntityAccessor } from '@contember/binding-common'\nimport type { RuntimeId } from '@contember/binding-common'\nimport { BindingError } from '@contember/binding-common'\nimport { PRIMARY_KEY_NAME } from '@contember/binding-common'\nimport { EventManager } from '../EventManager'\nimport { RealmKeyGenerator } from '../RealmKeyGenerator'\nimport type { EntityRealmState, EntityRealmStateStub, EntityState } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\n\nexport class OperationsHelpers {\n\tpublic static rejectInvalidAccessorTree(): never {\n\t\tthrow new BindingError(\n\t\t\t`The accessor tree does not correspond to the MarkerTree. This should absolutely never happen.`,\n\t\t)\n\t}\n\n\tpublic static resolveAndPrepareEntityToConnect(\n\t\ttreeStore: TreeStore,\n\t\tentityToConnect: EntityAccessor,\n\t): EntityRealmState | EntityRealmStateStub {\n\t\tconst entityToConnectKey = entityToConnect.key\n\t\tif (!entityToConnectKey) {\n\t\t\tthrow new BindingError(`Attempting to connect an entity without a key.`)\n\t\t}\n\t\tconst stateToConnect = treeStore.entityRealmStore.get(entityToConnectKey)\n\n\t\tif (stateToConnect === undefined) {\n\t\t\tthrow new BindingError(`Attempting to connect an entity with key '${entityToConnectKey}' but it doesn't exist.`)\n\t\t}\n\t\t// TODO This is commented out for now in order to at least somewhat mitigate the limitations of dealing with\n\t\t// \t\tinverse relations. However, once that has been addressed systemically, this code needs to be re-enabled.\n\t\t// if (!stateToConnect.entity.id.existsOnServer) {\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Attempting to connect an entity with key '${stateToConnect.realmKey}' that ` +\n\t\t// \t\t\t`doesn't exist on server. That is currently impossible.`, // At least for now.\n\t\t// \t)\n\t\t// }\n\n\t\t// TODO\n\t\t// if (stateToConnect.entity.isScheduledForDeletion) {\n\t\t// \t// As far as the other realms are concerned, this entity is deleted. We don't want to just make it re-appear\n\t\t// \t// for them just because some other random relation decided to connect it.\n\t\t// \tstateToConnect.entity.realms.clear()\n\t\t// \tstateToConnect.entity.isScheduledForDeletion = false\n\t\t// }\n\n\t\treturn stateToConnect\n\t}\n\n\tpublic static changeEntityId(\n\t\ttreeStore: TreeStore,\n\t\teventManager: EventManager,\n\t\tstateInitializer: StateInitializer,\n\t\tentity: EntityState,\n\t\tnewId: RuntimeId,\n\t) {\n\t\tconst previousId = entity.id\n\n\t\ttreeStore.entityStore.delete(previousId.uniqueValue)\n\t\ttreeStore.entityStore.set(newId.uniqueValue, entity)\n\n\t\tlet counter = 0\n\t\tfor (const realm of entity.realms.values()) {\n\t\t\tthis.changeRealmId(treeStore, eventManager, stateInitializer, realm, newId)\n\n\t\t\tif (++counter === entity.realms.size) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tentity.hasIdSetInStone = true\n\t\tentity.id = newId\n\t}\n\n\tpublic static changeRealmId(\n\t\ttreeStore: TreeStore,\n\t\teventManager: EventManager,\n\t\tstateInitializer: StateInitializer,\n\t\trealm: EntityRealmState | EntityRealmStateStub,\n\t\tnewId: RuntimeId,\n\t) {\n\t\tconst oldEntity = realm.entity\n\t\tconst oldRealmKey = realm.realmKey\n\t\tconst oldId = oldEntity.id\n\n\t\tconst realmBlueprint = realm.blueprint\n\n\t\tconst newEntity = stateInitializer.initializeEntityState(newId, oldEntity.entityName)\n\t\tconst newRealmKey = RealmKeyGenerator.getRealmKey(newId, realmBlueprint)\n\n\t\trealm.realmKey = newRealmKey\n\t\trealm.entity = newEntity\n\n\t\t// This may still actually be necessary if we're going from a client to server generated uuid.\n\t\t// They both may have the same value but still be different.\n\t\tnewEntity.id = newId\n\t\toldEntity.realms.delete(oldRealmKey)\n\t\tnewEntity.realms.set(newRealmKey, realm)\n\n\t\tif (realm.type === 'entityRealm') {\n\t\t\tconst childIdState = realm.children.get(PRIMARY_KEY_NAME)\n\t\t\tif (childIdState?.type === 'field') {\n\t\t\t\tchildIdState.value = newId.value\n\t\t\t\teventManager.registerJustUpdated(childIdState, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t}\n\n\t\t\tthis.purgeStaleListenersAfterIdChange(realm)\n\t\t}\n\n\t\tif (oldEntity.realms.size === 0) {\n\t\t\ttreeStore.disposeOfEntity(oldEntity)\n\t\t}\n\n\t\ttreeStore.entityRealmStore.delete(oldRealmKey)\n\t\ttreeStore.entityRealmStore.set(newRealmKey, realm)\n\n\t\tif (realmBlueprint.type === 'listEntity') {\n\t\t\tconst list = realmBlueprint.parent\n\t\t\tlist.children.changeKey(oldId.value, newId.value) // 😎\n\t\t} else if (realmBlueprint.type === 'hasOne') {\n\t\t\teventManager.registerUpdatedConnection(realmBlueprint.parent, realmBlueprint.marker.placeholderName)\n\t\t}\n\t\tconst parent = realmBlueprint.parent\n\t\tif (parent) {\n\t\t\teventManager.registerJustUpdated(parent, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t}\n\t\tif (realm.type === 'entityRealm') {\n\t\t\teventManager.registerJustUpdated(realm, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t}\n\t}\n\n\tpublic static purgeStaleListenersAfterIdChange(realm: EntityRealmState) {\n\t\t// Version 1.\n\t\t// The listeners subscribed to a particular entity key so we no longer want to call these.\n\t\t// The only positionally associated listeners are in the blueprint so we re-initialize those.\n\t\t// realm.eventListeners = stateInitializer.initializeEntityEventListenerStore(realmBlueprint)\n\n\t\t// Version 2.\n\t\t// This is version two of this terrible hack. We want to preserve e.g. persistSuccess handlers.\n\n\t\t// Version 3.\n\t\t// The saga continues. We add a condition to exempt top-level realms. That way they can start\n\t\t// propagating changes from the top.\n\t\tconst listeners = realm.eventListeners\n\t\tif (listeners) {\n\t\t\tif (realm.blueprint.parent) {\n\t\t\t\tlisteners.delete({ type: 'update' })\n\t\t\t}\n\t\t\tlisteners.deleteByType('connectionUpdate')\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAUO,MAAM,kBAAkB;AAAA,EAC9B,OAAc,4BAAmC;AAChD,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAAA,EAEF;AAAA,EAEA,OAAc,iCACb,WACA,iBAC0C;AAC1C,UAAM,qBAAqB,gBAAgB;AAC3C,QAAI,CAAC,oBAAoB;AACxB,YAAM,IAAI,aAAa,gDAAgD;AAAA,IACxE;AACA,UAAM,iBAAiB,UAAU,iBAAiB,IAAI,kBAAkB;AAExE,QAAI,mBAAmB,QAAW;AACjC,YAAM,IAAI,aAAa,6CAA6C,kBAAkB,yBAAyB;AAAA,IAChH;AAkBA,WAAO;AAAA,EACR;AAAA,EAEA,OAAc,eACb,WACA,cACA,kBACA,QACA,OACC;AACD,UAAM,aAAa,OAAO;AAE1B,cAAU,YAAY,OAAO,WAAW,WAAW;AACnD,cAAU,YAAY,IAAI,MAAM,aAAa,MAAM;AAEnD,QAAI,UAAU;AACd,eAAW,SAAS,OAAO,OAAO,OAAA,GAAU;AAC3C,WAAK,cAAc,WAAW,cAAc,kBAAkB,OAAO,KAAK;AAE1E,UAAI,EAAE,YAAY,OAAO,OAAO,MAAM;AACrC;AAAA,MACD;AAAA,IACD;AAEA,WAAO,kBAAkB;AACzB,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,OAAc,cACb,WACA,cACA,kBACA,OACA,OACC;AACD,UAAM,YAAY,MAAM;AACxB,UAAM,cAAc,MAAM;AAC1B,UAAM,QAAQ,UAAU;AAExB,UAAM,iBAAiB,MAAM;AAE7B,UAAM,YAAY,iBAAiB,sBAAsB,OAAO,UAAU,UAAU;AACpF,UAAM,cAAc,kBAAkB,YAAY,OAAO,cAAc;AAEvE,UAAM,WAAW;AACjB,UAAM,SAAS;AAIf,cAAU,KAAK;AACf,cAAU,OAAO,OAAO,WAAW;AACnC,cAAU,OAAO,IAAI,aAAa,KAAK;AAEvC,QAAI,MAAM,SAAS,eAAe;AACjC,YAAM,eAAe,MAAM,SAAS,IAAI,gBAAgB;AACxD,UAAI,cAAc,SAAS,SAAS;AACnC,qBAAa,QAAQ,MAAM;AAC3B,qBAAa,oBAAoB,cAAc,aAAa,qBAAqB;AAAA,MAClF;AAEA,WAAK,iCAAiC,KAAK;AAAA,IAC5C;AAEA,QAAI,UAAU,OAAO,SAAS,GAAG;AAChC,gBAAU,gBAAgB,SAAS;AAAA,IACpC;AAEA,cAAU,iBAAiB,OAAO,WAAW;AAC7C,cAAU,iBAAiB,IAAI,aAAa,KAAK;AAEjD,QAAI,eAAe,SAAS,cAAc;AACzC,YAAM,OAAO,eAAe;AAC5B,WAAK,SAAS,UAAU,MAAM,OAAO,MAAM,KAAK;AAAA,IACjD,WAAW,eAAe,SAAS,UAAU;AAC5C,mBAAa,0BAA0B,eAAe,QAAQ,eAAe,OAAO,eAAe;AAAA,IACpG;AACA,UAAM,SAAS,eAAe;AAC9B,QAAI,QAAQ;AACX,mBAAa,oBAAoB,QAAQ,aAAa,qBAAqB;AAAA,IAC5E;AACA,QAAI,MAAM,SAAS,eAAe;AACjC,mBAAa,oBAAoB,OAAO,aAAa,qBAAqB;AAAA,IAC3E;AAAA,EACD;AAAA,EAEA,OAAc,iCAAiC,OAAyB;AAYvE,UAAM,YAAY,MAAM;AACxB,QAAI,WAAW;AACd,UAAI,MAAM,UAAU,QAAQ;AAC3B,kBAAU,OAAO,EAAE,MAAM,SAAA,CAAU;AAAA,MACpC;AACA,gBAAU,aAAa,kBAAkB;AAAA,IAC1C;AAAA,EACD;AACD;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
class MutationAlias {
|
|
4
|
+
static encodeEntityId(entityId) {
|
|
5
|
+
return `_${String(entityId.value).replace(/-/g, "_")}`;
|
|
6
|
+
}
|
|
7
|
+
static decodeEntityId(alias) {
|
|
8
|
+
const stringId = `${alias.substring(1).replace(/_/g, "-")}`;
|
|
9
|
+
const intId = parseInt(stringId);
|
|
10
|
+
return intId.toString() === stringId ? intId : stringId;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.MutationAlias = MutationAlias;
|
|
14
|
+
//# sourceMappingURL=MutationAlias.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MutationAlias.cjs","sources":["../../../../../../packages/binding-legacy/src/core/requestAliases/MutationAlias.ts"],"sourcesContent":["import type { RuntimeId } from '@contember/binding-common'\n\nexport class MutationAlias {\n\tpublic static encodeEntityId(entityId: RuntimeId): string {\n\t\treturn `_${String(entityId.value).replace(/-/g, '_')}`\n\t}\n\n\tpublic static decodeEntityId(alias: string): RuntimeId['value'] {\n\t\tconst stringId = `${alias.substring(1).replace(/_/g, '-')}`\n\t\tconst intId = parseInt(stringId)\n\t\treturn intId.toString() === stringId ? intId : stringId\n\t}\n}\n"],"names":[],"mappings":";;AAEO,MAAM,cAAc;AAAA,EAC1B,OAAc,eAAe,UAA6B;AACzD,WAAO,IAAI,OAAO,SAAS,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC;AAAA,EACrD;AAAA,EAEA,OAAc,eAAe,OAAmC;AAC/D,UAAM,WAAW,GAAG,MAAM,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,CAAC;AACzD,UAAM,QAAQ,SAAS,QAAQ;AAC/B,WAAO,MAAM,SAAA,MAAe,WAAW,QAAQ;AAAA,EAChD;AACD;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class MutationAlias {
|
|
2
|
+
static encodeEntityId(entityId) {
|
|
3
|
+
return `_${String(entityId.value).replace(/-/g, "_")}`;
|
|
4
|
+
}
|
|
5
|
+
static decodeEntityId(alias) {
|
|
6
|
+
const stringId = `${alias.substring(1).replace(/_/g, "-")}`;
|
|
7
|
+
const intId = parseInt(stringId);
|
|
8
|
+
return intId.toString() === stringId ? intId : stringId;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
MutationAlias
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=MutationAlias.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MutationAlias.js","sources":["../../../../../../packages/binding-legacy/src/core/requestAliases/MutationAlias.ts"],"sourcesContent":["import type { RuntimeId } from '@contember/binding-common'\n\nexport class MutationAlias {\n\tpublic static encodeEntityId(entityId: RuntimeId): string {\n\t\treturn `_${String(entityId.value).replace(/-/g, '_')}`\n\t}\n\n\tpublic static decodeEntityId(alias: string): RuntimeId['value'] {\n\t\tconst stringId = `${alias.substring(1).replace(/_/g, '-')}`\n\t\tconst intId = parseInt(stringId)\n\t\treturn intId.toString() === stringId ? intId : stringId\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,cAAc;AAAA,EAC1B,OAAc,eAAe,UAA6B;AACzD,WAAO,IAAI,OAAO,SAAS,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC;AAAA,EACrD;AAAA,EAEA,OAAc,eAAe,OAAmC;AAC/D,UAAM,WAAW,GAAG,MAAM,UAAU,CAAC,EAAE,QAAQ,MAAM,GAAG,CAAC;AACzD,UAAM,QAAQ,SAAS,QAAQ;AAC/B,WAAO,MAAM,SAAA,MAAe,WAAW,QAAQ;AAAA,EAChD;AACD;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const bindingCommon = require("@contember/binding-common");
|
|
4
|
+
const getEntityMarker = require("./getEntityMarker.cjs");
|
|
5
|
+
class StateIterator {
|
|
6
|
+
static *eachSiblingRealm(state, relevantPlaceholder) {
|
|
7
|
+
for (let [realmKey, realm] of state.entity.realms) {
|
|
8
|
+
if (realm.type === "entityRealmStub") {
|
|
9
|
+
if (relevantPlaceholder === void 0 || getEntityMarker.getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {
|
|
10
|
+
realm.getAccessor();
|
|
11
|
+
realm = state.entity.realms.get(realmKey);
|
|
12
|
+
} else {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
yield realm;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// Note that this only yields siblings with the same placeholderName!
|
|
20
|
+
static *eachSiblingRealmChild(treeStore, state) {
|
|
21
|
+
if (state.type === "entityList" && state.blueprint.parent === void 0) {
|
|
22
|
+
for (const [, rootStates] of treeStore.subTreeStatesByRoot) {
|
|
23
|
+
const rootList = rootStates.get(state.blueprint.marker.placeholderName);
|
|
24
|
+
if (rootList?.type === "entityList") {
|
|
25
|
+
yield rootList;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let closestEntityRealm;
|
|
31
|
+
let placeholderName;
|
|
32
|
+
if (state.type === "field") {
|
|
33
|
+
closestEntityRealm = state.parent;
|
|
34
|
+
placeholderName = state.placeholderName;
|
|
35
|
+
} else if (state.type === "entityList") {
|
|
36
|
+
closestEntityRealm = state.blueprint.parent;
|
|
37
|
+
placeholderName = state.blueprint.marker.placeholderName;
|
|
38
|
+
} else {
|
|
39
|
+
return bindingCommon.assertNever(state);
|
|
40
|
+
}
|
|
41
|
+
for (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {
|
|
42
|
+
const child = realm.children.get(placeholderName);
|
|
43
|
+
if (child === void 0) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (child.type === state.type) {
|
|
47
|
+
yield child;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
static *depthFirstAllNodes(root) {
|
|
52
|
+
switch (root.type) {
|
|
53
|
+
case "entityRealm":
|
|
54
|
+
case "entityList":
|
|
55
|
+
for (const childState of root.children.values()) {
|
|
56
|
+
switch (childState.type) {
|
|
57
|
+
case "field":
|
|
58
|
+
case "entityRealm":
|
|
59
|
+
case "entityList":
|
|
60
|
+
yield* this.depthFirstAllNodes(childState);
|
|
61
|
+
break;
|
|
62
|
+
case "entityRealmStub":
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
return bindingCommon.assertNever(childState);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case "field":
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
return bindingCommon.assertNever(root);
|
|
73
|
+
}
|
|
74
|
+
yield root;
|
|
75
|
+
}
|
|
76
|
+
static *depthFirstINodes(root, match) {
|
|
77
|
+
switch (root.type) {
|
|
78
|
+
case "entityRealm":
|
|
79
|
+
case "entityList":
|
|
80
|
+
for (const childState of root.children.values()) {
|
|
81
|
+
if (childState.type === "entityRealm" || childState.type === "entityList") {
|
|
82
|
+
yield* this.depthFirstINodes(childState, match);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
return bindingCommon.assertNever(root);
|
|
88
|
+
}
|
|
89
|
+
if (match === void 0 || match(root)) {
|
|
90
|
+
yield root;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
static *eachRootState(treeStore) {
|
|
94
|
+
for (const rootStates of treeStore.subTreeStatesByRoot.values()) {
|
|
95
|
+
yield* rootStates.entries();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.StateIterator = StateIterator;
|
|
100
|
+
//# sourceMappingURL=StateIterator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateIterator.cjs","sources":["../../../../../../packages/binding-legacy/src/core/state/StateIterator.ts"],"sourcesContent":["import type { FieldValue, PlaceholderName } from '@contember/binding-common'\nimport { assertNever } from '@contember/binding-common'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":["getEntityMarker","assertNever"],"mappings":";;;;AASO,MAAM,cAAc;AAAA,EAC1B,QAAe,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,KAAK,KAAK,MAAM,OAAO,QAAQ;AAClD,UAAI,MAAM,SAAS,mBAAmB;AACrC,YAAI,wBAAwB,UAAaA,gBAAAA,gBAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAA;AACN,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA,QACzC,OAAO;AAEN;AAAA,QACD;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD;AAAA;AAAA,EAGA,QAAe,sBACd,WACA,OACsB;AACtB,QAAI,MAAM,SAAS,gBAAgB,MAAM,UAAU,WAAW,QAAW;AAExE,iBAAW,CAAA,EAAG,UAAU,KAAK,UAAU,qBAAqB;AAC3D,cAAM,WAAW,WAAW,IAAI,MAAM,UAAU,OAAO,eAAe;AACtE,YAAI,UAAU,SAAS,cAAc;AACpC,gBAAM;AAAA,QACP;AAAA,MACD;AACA;AAAA,IACD;AAEA,QAAI;AACJ,QAAI;AAEJ,QAAI,MAAM,SAAS,SAAS;AAC3B,2BAAqB,MAAM;AAC3B,wBAAkB,MAAM;AAAA,IACzB,WAAW,MAAM,SAAS,cAAc;AACvC,2BAAqB,MAAM,UAAU;AACrC,wBAAkB,MAAM,UAAU,OAAO;AAAA,IAC1C,OAAO;AACN,aAAOC,cAAAA,YAAY,KAAK;AAAA,IACzB;AAEA,eAAW,SAAS,KAAK,iBAAiB,oBAAoB,eAAe,GAAG;AAC/E,YAAM,QAAQ,MAAM,SAAS,IAAI,eAAe;AAChD,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACA,UAAI,MAAM,SAAS,MAAM,MAAM;AAC9B,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AAAA,EAEA,QAAe,mBAAmB,MAA8C;AAC/E,YAAQ,KAAK,MAAA;AAAA,MACZ,KAAK;AAAA,MACL,KAAK;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,kBAAQ,WAAW,MAAA;AAAA,YAClB,KAAK;AAAA,YACL,KAAK;AAAA,YACL,KAAK;AACJ,qBAAO,KAAK,mBAAmB,UAAU;AACzC;AAAA,YACD,KAAK;AACJ;AAAA,YACD;AACC,qBAAOA,cAAAA,YAAY,UAAU;AAAA,UAAA;AAAA,QAEhC;AACA;AAAA,MACD,KAAK;AACJ;AAAA,MACD;AACC,eAAOA,cAAAA,YAAY,IAAI;AAAA,IAAA;AAEzB,UAAM;AAAA,EACP;AAAA,EAEA,QAAe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK,MAAA;AAAA,MACZ,KAAK;AAAA,MACL,KAAK;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,cAAI,WAAW,SAAS,iBAAiB,WAAW,SAAS,cAAc;AAC1E,mBAAO,KAAK,iBAAiB,YAAY,KAAK;AAAA,UAC/C;AAAA,QACD;AACA;AAAA,MACD;AACC,eAAOA,cAAAA,YAAY,IAAI;AAAA,IAAA;AAEzB,QAAI,UAAU,UAAa,MAAM,IAAI,GAAG;AACvC,YAAM;AAAA,IACP;AAAA,EACD;AAAA,EAEA,QAAe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW,QAAA;AAAA,IACnB;AAAA,EACD;AACD;;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { assertNever } from "@contember/binding-common";
|
|
2
|
+
import { getEntityMarker } from "./getEntityMarker.js";
|
|
3
|
+
class StateIterator {
|
|
4
|
+
static *eachSiblingRealm(state, relevantPlaceholder) {
|
|
5
|
+
for (let [realmKey, realm] of state.entity.realms) {
|
|
6
|
+
if (realm.type === "entityRealmStub") {
|
|
7
|
+
if (relevantPlaceholder === void 0 || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {
|
|
8
|
+
realm.getAccessor();
|
|
9
|
+
realm = state.entity.realms.get(realmKey);
|
|
10
|
+
} else {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
yield realm;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Note that this only yields siblings with the same placeholderName!
|
|
18
|
+
static *eachSiblingRealmChild(treeStore, state) {
|
|
19
|
+
if (state.type === "entityList" && state.blueprint.parent === void 0) {
|
|
20
|
+
for (const [, rootStates] of treeStore.subTreeStatesByRoot) {
|
|
21
|
+
const rootList = rootStates.get(state.blueprint.marker.placeholderName);
|
|
22
|
+
if (rootList?.type === "entityList") {
|
|
23
|
+
yield rootList;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let closestEntityRealm;
|
|
29
|
+
let placeholderName;
|
|
30
|
+
if (state.type === "field") {
|
|
31
|
+
closestEntityRealm = state.parent;
|
|
32
|
+
placeholderName = state.placeholderName;
|
|
33
|
+
} else if (state.type === "entityList") {
|
|
34
|
+
closestEntityRealm = state.blueprint.parent;
|
|
35
|
+
placeholderName = state.blueprint.marker.placeholderName;
|
|
36
|
+
} else {
|
|
37
|
+
return assertNever(state);
|
|
38
|
+
}
|
|
39
|
+
for (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {
|
|
40
|
+
const child = realm.children.get(placeholderName);
|
|
41
|
+
if (child === void 0) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (child.type === state.type) {
|
|
45
|
+
yield child;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static *depthFirstAllNodes(root) {
|
|
50
|
+
switch (root.type) {
|
|
51
|
+
case "entityRealm":
|
|
52
|
+
case "entityList":
|
|
53
|
+
for (const childState of root.children.values()) {
|
|
54
|
+
switch (childState.type) {
|
|
55
|
+
case "field":
|
|
56
|
+
case "entityRealm":
|
|
57
|
+
case "entityList":
|
|
58
|
+
yield* this.depthFirstAllNodes(childState);
|
|
59
|
+
break;
|
|
60
|
+
case "entityRealmStub":
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
return assertNever(childState);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "field":
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
return assertNever(root);
|
|
71
|
+
}
|
|
72
|
+
yield root;
|
|
73
|
+
}
|
|
74
|
+
static *depthFirstINodes(root, match) {
|
|
75
|
+
switch (root.type) {
|
|
76
|
+
case "entityRealm":
|
|
77
|
+
case "entityList":
|
|
78
|
+
for (const childState of root.children.values()) {
|
|
79
|
+
if (childState.type === "entityRealm" || childState.type === "entityList") {
|
|
80
|
+
yield* this.depthFirstINodes(childState, match);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
default:
|
|
85
|
+
return assertNever(root);
|
|
86
|
+
}
|
|
87
|
+
if (match === void 0 || match(root)) {
|
|
88
|
+
yield root;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
static *eachRootState(treeStore) {
|
|
92
|
+
for (const rootStates of treeStore.subTreeStatesByRoot.values()) {
|
|
93
|
+
yield* rootStates.entries();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
StateIterator
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=StateIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateIterator.js","sources":["../../../../../../packages/binding-legacy/src/core/state/StateIterator.ts"],"sourcesContent":["import type { FieldValue, PlaceholderName } from '@contember/binding-common'\nimport { assertNever } from '@contember/binding-common'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AASO,MAAM,cAAc;AAAA,EAC1B,QAAe,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,KAAK,KAAK,MAAM,OAAO,QAAQ;AAClD,UAAI,MAAM,SAAS,mBAAmB;AACrC,YAAI,wBAAwB,UAAa,gBAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAA;AACN,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA,QACzC,OAAO;AAEN;AAAA,QACD;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD;AAAA;AAAA,EAGA,QAAe,sBACd,WACA,OACsB;AACtB,QAAI,MAAM,SAAS,gBAAgB,MAAM,UAAU,WAAW,QAAW;AAExE,iBAAW,CAAA,EAAG,UAAU,KAAK,UAAU,qBAAqB;AAC3D,cAAM,WAAW,WAAW,IAAI,MAAM,UAAU,OAAO,eAAe;AACtE,YAAI,UAAU,SAAS,cAAc;AACpC,gBAAM;AAAA,QACP;AAAA,MACD;AACA;AAAA,IACD;AAEA,QAAI;AACJ,QAAI;AAEJ,QAAI,MAAM,SAAS,SAAS;AAC3B,2BAAqB,MAAM;AAC3B,wBAAkB,MAAM;AAAA,IACzB,WAAW,MAAM,SAAS,cAAc;AACvC,2BAAqB,MAAM,UAAU;AACrC,wBAAkB,MAAM,UAAU,OAAO;AAAA,IAC1C,OAAO;AACN,aAAO,YAAY,KAAK;AAAA,IACzB;AAEA,eAAW,SAAS,KAAK,iBAAiB,oBAAoB,eAAe,GAAG;AAC/E,YAAM,QAAQ,MAAM,SAAS,IAAI,eAAe;AAChD,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACA,UAAI,MAAM,SAAS,MAAM,MAAM;AAC9B,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AAAA,EAEA,QAAe,mBAAmB,MAA8C;AAC/E,YAAQ,KAAK,MAAA;AAAA,MACZ,KAAK;AAAA,MACL,KAAK;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,kBAAQ,WAAW,MAAA;AAAA,YAClB,KAAK;AAAA,YACL,KAAK;AAAA,YACL,KAAK;AACJ,qBAAO,KAAK,mBAAmB,UAAU;AACzC;AAAA,YACD,KAAK;AACJ;AAAA,YACD;AACC,qBAAO,YAAY,UAAU;AAAA,UAAA;AAAA,QAEhC;AACA;AAAA,MACD,KAAK;AACJ;AAAA,MACD;AACC,eAAO,YAAY,IAAI;AAAA,IAAA;AAEzB,UAAM;AAAA,EACP;AAAA,EAEA,QAAe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK,MAAA;AAAA,MACZ,KAAK;AAAA,MACL,KAAK;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,cAAI,WAAW,SAAS,iBAAiB,WAAW,SAAS,cAAc;AAC1E,mBAAO,KAAK,iBAAiB,YAAY,KAAK;AAAA,UAC/C;AAAA,QACD;AACA;AAAA,MACD;AACC,eAAO,YAAY,IAAI;AAAA,IAAA;AAEzB,QAAI,UAAU,UAAa,MAAM,IAAI,GAAG;AACvC,YAAM;AAAA,IACP;AAAA,EACD;AAAA,EAEA,QAAe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW,QAAA;AAAA,IACnB;AAAA,EACD;AACD;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getEntityMarker = (realm) => realm.blueprint.type === "listEntity" ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker;
|
|
4
|
+
exports.getEntityMarker = getEntityMarker;
|
|
5
|
+
//# sourceMappingURL=getEntityMarker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntityMarker.cjs","sources":["../../../../../../packages/binding-legacy/src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntityMarker.js","sources":["../../../../../../packages/binding-legacy/src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getCombinedSignal = (components) => {
|
|
4
|
+
let abortedCount = 0;
|
|
5
|
+
let signalCount = 0;
|
|
6
|
+
const controller = new AbortController();
|
|
7
|
+
const refresh = () => {
|
|
8
|
+
if (signalCount === 0) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (abortedCount >= signalCount) {
|
|
12
|
+
controller.abort();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
for (const component of components) {
|
|
16
|
+
if (!component) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
signalCount++;
|
|
20
|
+
if (component.aborted) {
|
|
21
|
+
abortedCount++;
|
|
22
|
+
} else {
|
|
23
|
+
component.addEventListener("abort", () => {
|
|
24
|
+
abortedCount++;
|
|
25
|
+
refresh();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
refresh();
|
|
30
|
+
return controller.signal;
|
|
31
|
+
};
|
|
32
|
+
exports.getCombinedSignal = getCombinedSignal;
|
|
33
|
+
//# sourceMappingURL=getCombinedSignal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCombinedSignal.cjs","sources":["../../../../../../packages/binding-legacy/src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":";;AACO,MAAM,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAElB,QAAM,aAAa,IAAI,gBAAA;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAA;AAAA,IACZ;AAAA,EACD;AAEA,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IACD,OAAO;AACN,gBAAU,iBAAiB,SAAS,MAAM;AACzC;AACA,gBAAA;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AAEA,UAAA;AAEA,SAAO,WAAW;AACnB;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const getCombinedSignal = (components) => {
|
|
2
|
+
let abortedCount = 0;
|
|
3
|
+
let signalCount = 0;
|
|
4
|
+
const controller = new AbortController();
|
|
5
|
+
const refresh = () => {
|
|
6
|
+
if (signalCount === 0) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (abortedCount >= signalCount) {
|
|
10
|
+
controller.abort();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
for (const component of components) {
|
|
14
|
+
if (!component) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
signalCount++;
|
|
18
|
+
if (component.aborted) {
|
|
19
|
+
abortedCount++;
|
|
20
|
+
} else {
|
|
21
|
+
component.addEventListener("abort", () => {
|
|
22
|
+
abortedCount++;
|
|
23
|
+
refresh();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
refresh();
|
|
28
|
+
return controller.signal;
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
getCombinedSignal
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=getCombinedSignal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCombinedSignal.js","sources":["../../../../../../packages/binding-legacy/src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":"AACO,MAAM,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAElB,QAAM,aAAa,IAAI,gBAAA;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAA;AAAA,IACZ;AAAA,EACD;AAEA,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IACD,OAAO;AACN,gBAAU,iBAAiB,SAAS,MAAM;AACzC;AACA,gBAAA;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AAEA,UAAA;AAEA,SAAO,WAAW;AACnB;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
6
|
+
class FieldHelper {
|
|
7
|
+
constructor(field) {
|
|
8
|
+
__publicField(this, "getAccessor");
|
|
9
|
+
this.getAccessor = typeof field === "function" ? field : field.getAccessor;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.FieldHelper = FieldHelper;
|
|
13
|
+
//# sourceMappingURL=FieldHelper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldHelper.cjs","sources":["../../../../../../packages/binding-legacy/src/fieldHelpers/helpers/FieldHelper.ts"],"sourcesContent":["import type { FieldValue } from '@contember/binding-common'\nimport { FieldAccessor } from '@contember/binding-common'\n\nexport class FieldHelper<Value extends FieldValue = FieldValue> {\n\tprotected readonly getAccessor: FieldAccessor.GetFieldAccessor<Value>\n\n\tpublic constructor(field: FieldAccessor<Value> | FieldAccessor.GetFieldAccessor<Value>) {\n\t\tthis.getAccessor = typeof field === 'function' ? field : field.getAccessor\n\t}\n}\n"],"names":[],"mappings":";;;;;AAGO,MAAM,YAAmD;AAAA,EAGxD,YAAY,OAAqE;AAFxF,kBAAA,MAAmB,aAAA;AAGlB,SAAK,cAAc,OAAO,UAAU,aAAa,QAAQ,MAAM;AAAA,EAChE;AACD;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
4
|
+
class FieldHelper {
|
|
5
|
+
constructor(field) {
|
|
6
|
+
__publicField(this, "getAccessor");
|
|
7
|
+
this.getAccessor = typeof field === "function" ? field : field.getAccessor;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
FieldHelper
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=FieldHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldHelper.js","sources":["../../../../../../packages/binding-legacy/src/fieldHelpers/helpers/FieldHelper.ts"],"sourcesContent":["import type { FieldValue } from '@contember/binding-common'\nimport { FieldAccessor } from '@contember/binding-common'\n\nexport class FieldHelper<Value extends FieldValue = FieldValue> {\n\tprotected readonly getAccessor: FieldAccessor.GetFieldAccessor<Value>\n\n\tpublic constructor(field: FieldAccessor<Value> | FieldAccessor.GetFieldAccessor<Value>) {\n\t\tthis.getAccessor = typeof field === 'function' ? field : field.getAccessor\n\t}\n}\n"],"names":[],"mappings":";;;AAGO,MAAM,YAAmD;AAAA,EAGxD,YAAY,OAAqE;AAFxF,kBAAA,MAAmB,aAAA;AAGlB,SAAK,cAAc,OAAO,UAAU,aAAa,QAAQ,MAAM;AAAA,EAChE;AACD;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const FieldHelper = require("./FieldHelper.cjs");
|
|
4
|
+
class TemporalFieldHelper extends FieldHelper.FieldHelper {
|
|
5
|
+
setToNow(options) {
|
|
6
|
+
this.getAccessor().updateValue((/* @__PURE__ */ new Date()).toISOString(), options);
|
|
7
|
+
}
|
|
8
|
+
// public setToDate() TODO
|
|
9
|
+
// public setToTime() TODO
|
|
10
|
+
// public setToDateTime() TODO
|
|
11
|
+
}
|
|
12
|
+
((TemporalFieldHelper2) => {
|
|
13
|
+
TemporalFieldHelper2.setToNow = (field, options) => {
|
|
14
|
+
new TemporalFieldHelper2(field).setToNow(options);
|
|
15
|
+
};
|
|
16
|
+
})(TemporalFieldHelper || (TemporalFieldHelper = {}));
|
|
17
|
+
exports.TemporalFieldHelper = TemporalFieldHelper;
|
|
18
|
+
//# sourceMappingURL=TemporalFieldHelper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemporalFieldHelper.cjs","sources":["../../../../../../packages/binding-legacy/src/fieldHelpers/helpers/TemporalFieldHelper.ts"],"sourcesContent":["import type { FieldAccessor } from '@contember/binding-common'\nimport { FieldHelper } from './FieldHelper'\n\nclass TemporalFieldHelper extends FieldHelper<string> {\n\tpublic setToNow(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(new Date().toISOString(), options)\n\t}\n\n\t// public setToDate() TODO\n\t// public setToTime() TODO\n\t// public setToDateTime() TODO\n}\nnamespace TemporalFieldHelper {\n\texport const setToNow = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew TemporalFieldHelper(field).setToNow(options)\n\t}\n}\nexport { TemporalFieldHelper }\n"],"names":["FieldHelper","TemporalFieldHelper"],"mappings":";;;AAGA,MAAM,4BAA4BA,YAAAA,YAAoB;AAAA,EAC9C,SAAS,SAAuC;AACtD,SAAK,YAAA,EAAc,aAAY,oBAAI,QAAO,YAAA,GAAe,OAAO;AAAA,EACjE;AAAA;AAAA;AAAA;AAKD;AAAA,CACA,CAAUC,yBAAV;AACcA,uBAAA,WAAW,CACvB,OACA,YACI;AACJ,QAAIA,qBAAoB,KAAK,EAAE,SAAS,OAAO;AAAA,EAChD;AAAA,GANS,wBAAA,sBAAA,CAAA,EAAA;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FieldHelper } from "./FieldHelper.js";
|
|
2
|
+
class TemporalFieldHelper extends FieldHelper {
|
|
3
|
+
setToNow(options) {
|
|
4
|
+
this.getAccessor().updateValue((/* @__PURE__ */ new Date()).toISOString(), options);
|
|
5
|
+
}
|
|
6
|
+
// public setToDate() TODO
|
|
7
|
+
// public setToTime() TODO
|
|
8
|
+
// public setToDateTime() TODO
|
|
9
|
+
}
|
|
10
|
+
((TemporalFieldHelper2) => {
|
|
11
|
+
TemporalFieldHelper2.setToNow = (field, options) => {
|
|
12
|
+
new TemporalFieldHelper2(field).setToNow(options);
|
|
13
|
+
};
|
|
14
|
+
})(TemporalFieldHelper || (TemporalFieldHelper = {}));
|
|
15
|
+
export {
|
|
16
|
+
TemporalFieldHelper
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=TemporalFieldHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemporalFieldHelper.js","sources":["../../../../../../packages/binding-legacy/src/fieldHelpers/helpers/TemporalFieldHelper.ts"],"sourcesContent":["import type { FieldAccessor } from '@contember/binding-common'\nimport { FieldHelper } from './FieldHelper'\n\nclass TemporalFieldHelper extends FieldHelper<string> {\n\tpublic setToNow(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(new Date().toISOString(), options)\n\t}\n\n\t// public setToDate() TODO\n\t// public setToTime() TODO\n\t// public setToDateTime() TODO\n}\nnamespace TemporalFieldHelper {\n\texport const setToNow = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew TemporalFieldHelper(field).setToNow(options)\n\t}\n}\nexport { TemporalFieldHelper }\n"],"names":["TemporalFieldHelper"],"mappings":";AAGA,MAAM,4BAA4B,YAAoB;AAAA,EAC9C,SAAS,SAAuC;AACtD,SAAK,YAAA,EAAc,aAAY,oBAAI,QAAO,YAAA,GAAe,OAAO;AAAA,EACjE;AAAA;AAAA;AAAA;AAKD;AAAA,CACA,CAAUA,yBAAV;AACcA,uBAAA,WAAW,CACvB,OACA,YACI;AACJ,QAAIA,qBAAoB,KAAK,EAAE,SAAS,OAAO;AAAA,EAChD;AAAA,GANS,wBAAA,sBAAA,CAAA,EAAA;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const uuid = require("uuid");
|
|
4
|
+
const FieldHelper = require("./FieldHelper.cjs");
|
|
5
|
+
class UuidFieldHelper extends FieldHelper.FieldHelper {
|
|
6
|
+
setToUuid(options) {
|
|
7
|
+
this.getAccessor().updateValue(uuid.v4(), options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
((UuidFieldHelper2) => {
|
|
11
|
+
UuidFieldHelper2.setToUuid = (field, options) => {
|
|
12
|
+
new UuidFieldHelper2(field).setToUuid(options);
|
|
13
|
+
};
|
|
14
|
+
})(UuidFieldHelper || (UuidFieldHelper = {}));
|
|
15
|
+
exports.UuidFieldHelper = UuidFieldHelper;
|
|
16
|
+
//# sourceMappingURL=UuidFieldHelper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UuidFieldHelper.cjs","sources":["../../../../../../packages/binding-legacy/src/fieldHelpers/helpers/UuidFieldHelper.ts"],"sourcesContent":["import { v4 as uuidV4 } from 'uuid'\nimport type { FieldAccessor } from '@contember/binding-common'\nimport { FieldHelper } from './FieldHelper'\n\nclass UuidFieldHelper extends FieldHelper<string> {\n\tpublic setToUuid(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(uuidV4(), options)\n\t}\n}\nnamespace UuidFieldHelper {\n\texport const setToUuid = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew UuidFieldHelper(field).setToUuid(options)\n\t}\n}\nexport { UuidFieldHelper }\n"],"names":["FieldHelper","uuidV4","UuidFieldHelper"],"mappings":";;;;AAIA,MAAM,wBAAwBA,YAAAA,YAAoB;AAAA,EAC1C,UAAU,SAAuC;AACvD,SAAK,YAAA,EAAc,YAAYC,KAAAA,GAAA,GAAU,OAAO;AAAA,EACjD;AACD;AAAA,CACA,CAAUC,qBAAV;AACcA,mBAAA,YAAY,CACxB,OACA,YACI;AACJ,QAAIA,iBAAgB,KAAK,EAAE,UAAU,OAAO;AAAA,EAC7C;AAAA,GANS,oBAAA,kBAAA,CAAA,EAAA;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { v4 } from "uuid";
|
|
2
|
+
import { FieldHelper } from "./FieldHelper.js";
|
|
3
|
+
class UuidFieldHelper extends FieldHelper {
|
|
4
|
+
setToUuid(options) {
|
|
5
|
+
this.getAccessor().updateValue(v4(), options);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
((UuidFieldHelper2) => {
|
|
9
|
+
UuidFieldHelper2.setToUuid = (field, options) => {
|
|
10
|
+
new UuidFieldHelper2(field).setToUuid(options);
|
|
11
|
+
};
|
|
12
|
+
})(UuidFieldHelper || (UuidFieldHelper = {}));
|
|
13
|
+
export {
|
|
14
|
+
UuidFieldHelper
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=UuidFieldHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UuidFieldHelper.js","sources":["../../../../../../packages/binding-legacy/src/fieldHelpers/helpers/UuidFieldHelper.ts"],"sourcesContent":["import { v4 as uuidV4 } from 'uuid'\nimport type { FieldAccessor } from '@contember/binding-common'\nimport { FieldHelper } from './FieldHelper'\n\nclass UuidFieldHelper extends FieldHelper<string> {\n\tpublic setToUuid(options?: FieldAccessor.UpdateOptions) {\n\t\tthis.getAccessor().updateValue(uuidV4(), options)\n\t}\n}\nnamespace UuidFieldHelper {\n\texport const setToUuid = (\n\t\tfield: FieldAccessor<string> | FieldAccessor.GetFieldAccessor<string>,\n\t\toptions?: FieldAccessor.UpdateOptions,\n\t) => {\n\t\tnew UuidFieldHelper(field).setToUuid(options)\n\t}\n}\nexport { UuidFieldHelper }\n"],"names":["uuidV4","UuidFieldHelper"],"mappings":";;AAIA,MAAM,wBAAwB,YAAoB;AAAA,EAC1C,UAAU,SAAuC;AACvD,SAAK,YAAA,EAAc,YAAYA,GAAA,GAAU,OAAO;AAAA,EACjD;AACD;AAAA,CACA,CAAUC,qBAAV;AACcA,mBAAA,YAAY,CACxB,OACA,YACI;AACJ,QAAIA,iBAAgB,KAAK,EAAE,UAAU,OAAO;AAAA,EAC7C;AAAA,GANS,oBAAA,kBAAA,CAAA,EAAA;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const generateEnumerabilityPreventingEntropy = (length = 5) => {
|
|
4
|
+
return (Math.random() * Math.pow(10, length)).toFixed(0).padStart(length, "0");
|
|
5
|
+
};
|
|
6
|
+
exports.generateEnumerabilityPreventingEntropy = generateEnumerabilityPreventingEntropy;
|
|
7
|
+
//# sourceMappingURL=generateEnumerabilityPreventingEntropy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateEnumerabilityPreventingEntropy.cjs","sources":["../../../../../packages/binding-legacy/src/utils/generateEnumerabilityPreventingEntropy.ts"],"sourcesContent":["export const generateEnumerabilityPreventingEntropy = (length: number = 5): string => {\n\treturn (Math.random() * Math.pow(10, length)).toFixed(0).padStart(length, '0')\n}\n"],"names":[],"mappings":";;AAAO,MAAM,yCAAyC,CAAC,SAAiB,MAAc;AACrF,UAAQ,KAAK,OAAA,IAAW,KAAK,IAAI,IAAI,MAAM,GAAG,QAAQ,CAAC,EAAE,SAAS,QAAQ,GAAG;AAC9E;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const generateEnumerabilityPreventingEntropy = (length = 5) => {
|
|
2
|
+
return (Math.random() * Math.pow(10, length)).toFixed(0).padStart(length, "0");
|
|
3
|
+
};
|
|
4
|
+
export {
|
|
5
|
+
generateEnumerabilityPreventingEntropy
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=generateEnumerabilityPreventingEntropy.js.map
|