@contember/binding-legacy 2.1.0-beta.1 → 2.2.0-alpha.1
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/src/accessors/EntityAccessorImpl.cjs.map +1 -1
- package/dist/development/src/accessors/EntityAccessorImpl.js.map +1 -1
- package/dist/development/src/accessors/EntityListAccessorImpl.cjs.map +1 -1
- package/dist/development/src/accessors/EntityListAccessorImpl.js.map +1 -1
- package/dist/development/src/accessors/FieldAccessorImpl.cjs.map +1 -1
- package/dist/development/src/accessors/FieldAccessorImpl.js.map +1 -1
- package/dist/development/src/core/AccessorErrorManager.cjs.map +1 -1
- package/dist/development/src/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/src/core/Config.cjs.map +1 -1
- package/dist/development/src/core/Config.js.map +1 -1
- package/dist/development/src/core/DataBinding.cjs.map +1 -1
- package/dist/development/src/core/DataBinding.js.map +1 -1
- package/dist/development/src/core/ErrorsPreprocessor.cjs.map +1 -1
- package/dist/development/src/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/src/core/EventManager.cjs.map +1 -1
- package/dist/development/src/core/EventManager.js.map +1 -1
- package/dist/development/src/core/MutationGenerator.cjs.map +1 -1
- package/dist/development/src/core/MutationGenerator.js.map +1 -1
- package/dist/development/src/core/RealmKeyGenerator.cjs.map +1 -1
- package/dist/development/src/core/RealmKeyGenerator.js.map +1 -1
- package/dist/development/src/core/RequestResponseNormalizer.cjs.map +1 -1
- package/dist/development/src/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/development/src/core/StateInitializer.cjs +23 -1
- package/dist/development/src/core/StateInitializer.cjs.map +1 -1
- package/dist/development/src/core/StateInitializer.js +23 -1
- package/dist/development/src/core/StateInitializer.js.map +1 -1
- package/dist/development/src/core/TreeAugmenter.cjs.map +1 -1
- package/dist/development/src/core/TreeAugmenter.js.map +1 -1
- package/dist/development/src/core/TreeStore.cjs.map +1 -1
- package/dist/development/src/core/TreeStore.js.map +1 -1
- package/dist/development/src/core/exceptions/ErrorLocator.cjs.map +1 -1
- package/dist/development/src/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/development/src/core/exceptions/MarkerSugarer.cjs.map +1 -1
- package/dist/development/src/core/exceptions/MarkerSugarer.js.map +1 -1
- package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -1
- package/dist/development/src/core/factories/createBatchUpdatesOptions.js.map +1 -1
- package/dist/development/src/core/operations/EntityOperations.cjs.map +1 -1
- package/dist/development/src/core/operations/EntityOperations.js.map +1 -1
- package/dist/development/src/core/operations/FieldOperations.cjs.map +1 -1
- package/dist/development/src/core/operations/FieldOperations.js.map +1 -1
- package/dist/development/src/core/operations/ListOperations.cjs.map +1 -1
- package/dist/development/src/core/operations/ListOperations.js.map +1 -1
- package/dist/development/src/core/operations/OperationsHelpers.cjs.map +1 -1
- package/dist/development/src/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/development/src/core/state/StateIterator.cjs.map +1 -1
- package/dist/development/src/core/state/StateIterator.js.map +1 -1
- package/dist/development/src/core/state/getEntityMarker.cjs.map +1 -1
- package/dist/development/src/core/state/getEntityMarker.js.map +1 -1
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -1
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -1
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
- package/dist/production/src/accessors/EntityAccessorImpl.cjs.map +1 -1
- package/dist/production/src/accessors/EntityAccessorImpl.js.map +1 -1
- package/dist/production/src/accessors/EntityListAccessorImpl.cjs.map +1 -1
- package/dist/production/src/accessors/EntityListAccessorImpl.js.map +1 -1
- package/dist/production/src/accessors/FieldAccessorImpl.cjs.map +1 -1
- package/dist/production/src/accessors/FieldAccessorImpl.js.map +1 -1
- package/dist/production/src/core/AccessorErrorManager.cjs.map +1 -1
- package/dist/production/src/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/src/core/Config.cjs.map +1 -1
- package/dist/production/src/core/Config.js.map +1 -1
- package/dist/production/src/core/DataBinding.cjs.map +1 -1
- package/dist/production/src/core/DataBinding.js.map +1 -1
- package/dist/production/src/core/ErrorsPreprocessor.cjs.map +1 -1
- package/dist/production/src/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/src/core/EventManager.cjs.map +1 -1
- package/dist/production/src/core/EventManager.js.map +1 -1
- package/dist/production/src/core/MutationGenerator.cjs.map +1 -1
- package/dist/production/src/core/MutationGenerator.js.map +1 -1
- package/dist/production/src/core/RealmKeyGenerator.cjs.map +1 -1
- package/dist/production/src/core/RealmKeyGenerator.js.map +1 -1
- package/dist/production/src/core/RequestResponseNormalizer.cjs.map +1 -1
- package/dist/production/src/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/production/src/core/StateInitializer.cjs +23 -1
- package/dist/production/src/core/StateInitializer.cjs.map +1 -1
- package/dist/production/src/core/StateInitializer.js +23 -1
- package/dist/production/src/core/StateInitializer.js.map +1 -1
- package/dist/production/src/core/TreeAugmenter.cjs.map +1 -1
- package/dist/production/src/core/TreeAugmenter.js.map +1 -1
- package/dist/production/src/core/TreeStore.cjs.map +1 -1
- package/dist/production/src/core/TreeStore.js.map +1 -1
- package/dist/production/src/core/exceptions/ErrorLocator.cjs.map +1 -1
- package/dist/production/src/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/production/src/core/exceptions/MarkerSugarer.cjs.map +1 -1
- package/dist/production/src/core/exceptions/MarkerSugarer.js.map +1 -1
- package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -1
- package/dist/production/src/core/factories/createBatchUpdatesOptions.js.map +1 -1
- package/dist/production/src/core/operations/EntityOperations.cjs.map +1 -1
- package/dist/production/src/core/operations/EntityOperations.js.map +1 -1
- package/dist/production/src/core/operations/FieldOperations.cjs.map +1 -1
- package/dist/production/src/core/operations/FieldOperations.js.map +1 -1
- package/dist/production/src/core/operations/ListOperations.cjs.map +1 -1
- package/dist/production/src/core/operations/ListOperations.js.map +1 -1
- package/dist/production/src/core/operations/OperationsHelpers.cjs.map +1 -1
- package/dist/production/src/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/production/src/core/state/StateIterator.cjs.map +1 -1
- package/dist/production/src/core/state/StateIterator.js.map +1 -1
- package/dist/production/src/core/state/getEntityMarker.cjs.map +1 -1
- package/dist/production/src/core/state/getEntityMarker.js.map +1 -1
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -1
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -1
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
- package/dist/types/accessorTree/index.d.ts +1 -1
- package/dist/types/accessorTree/index.d.ts.map +1 -1
- package/dist/types/accessors/EntityAccessorImpl.d.ts +3 -3
- package/dist/types/accessors/EntityAccessorImpl.d.ts.map +1 -1
- package/dist/types/accessors/EntityListAccessorImpl.d.ts +2 -2
- package/dist/types/accessors/EntityListAccessorImpl.d.ts.map +1 -1
- package/dist/types/accessors/FieldAccessorImpl.d.ts +3 -3
- package/dist/types/accessors/FieldAccessorImpl.d.ts.map +1 -1
- package/dist/types/accessors/index.d.ts +4 -4
- package/dist/types/accessors/index.d.ts.map +1 -1
- package/dist/types/core/AccessorErrorManager.d.ts +4 -4
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
- package/dist/types/core/Config.d.ts +1 -1
- package/dist/types/core/Config.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts +1 -1
- package/dist/types/core/DataBinding.d.ts.map +1 -1
- package/dist/types/core/ErrorsPreprocessor.d.ts +1 -1
- package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -1
- package/dist/types/core/EventManager.d.ts +5 -5
- package/dist/types/core/EventManager.d.ts.map +1 -1
- package/dist/types/core/MutationGenerator.d.ts +1 -1
- package/dist/types/core/MutationGenerator.d.ts.map +1 -1
- package/dist/types/core/RealmKeyGenerator.d.ts +1 -1
- package/dist/types/core/RealmKeyGenerator.d.ts.map +1 -1
- package/dist/types/core/RequestResponseNormalizer.d.ts +2 -2
- package/dist/types/core/RequestResponseNormalizer.d.ts.map +1 -1
- package/dist/types/core/StateInitializer.d.ts +5 -4
- package/dist/types/core/StateInitializer.d.ts.map +1 -1
- package/dist/types/core/TreeAugmenter.d.ts +4 -4
- package/dist/types/core/TreeAugmenter.d.ts.map +1 -1
- package/dist/types/core/TreeStore.d.ts +3 -3
- package/dist/types/core/TreeStore.d.ts.map +1 -1
- package/dist/types/core/exceptions/ErrorLocator.d.ts +1 -1
- package/dist/types/core/exceptions/ErrorLocator.d.ts.map +1 -1
- package/dist/types/core/factories/createBatchUpdatesOptions.d.ts +1 -1
- package/dist/types/core/factories/createBatchUpdatesOptions.d.ts.map +1 -1
- package/dist/types/core/factories/index.d.ts +1 -1
- package/dist/types/core/factories/index.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +8 -8
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/operations/EntityOperations.d.ts +5 -5
- package/dist/types/core/operations/EntityOperations.d.ts.map +1 -1
- package/dist/types/core/operations/FieldOperations.d.ts +5 -5
- package/dist/types/core/operations/FieldOperations.d.ts.map +1 -1
- package/dist/types/core/operations/ListOperations.d.ts +5 -5
- package/dist/types/core/operations/ListOperations.d.ts.map +1 -1
- package/dist/types/core/operations/OperationsHelpers.d.ts +4 -4
- package/dist/types/core/operations/OperationsHelpers.d.ts.map +1 -1
- package/dist/types/core/operations/index.d.ts +3 -3
- package/dist/types/core/operations/index.d.ts.map +1 -1
- package/dist/types/core/requestAliases/index.d.ts +1 -1
- package/dist/types/core/requestAliases/index.d.ts.map +1 -1
- package/dist/types/core/state/EntityListState.d.ts +1 -1
- package/dist/types/core/state/EntityListState.d.ts.map +1 -1
- package/dist/types/core/state/EntityRealmState.d.ts +3 -3
- package/dist/types/core/state/EntityRealmState.d.ts.map +1 -1
- package/dist/types/core/state/EntityState.d.ts +1 -1
- package/dist/types/core/state/EntityState.d.ts.map +1 -1
- package/dist/types/core/state/FieldState.d.ts +1 -1
- package/dist/types/core/state/FieldState.d.ts.map +1 -1
- package/dist/types/core/state/StateIterator.d.ts +5 -5
- package/dist/types/core/state/StateIterator.d.ts.map +1 -1
- package/dist/types/core/state/StateNode.d.ts +3 -3
- package/dist/types/core/state/StateNode.d.ts.map +1 -1
- package/dist/types/core/state/getEntityMarker.d.ts +1 -1
- package/dist/types/core/state/getEntityMarker.d.ts.map +1 -1
- package/dist/types/core/state/index.d.ts +7 -7
- package/dist/types/core/state/index.d.ts.map +1 -1
- package/dist/types/core/utils/index.d.ts +1 -1
- package/dist/types/core/utils/index.d.ts.map +1 -1
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts +1 -1
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts.map +1 -1
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts +1 -1
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts.map +1 -1
- package/dist/types/fieldHelpers/helpers/index.d.ts +2 -2
- package/dist/types/fieldHelpers/helpers/index.d.ts.map +1 -1
- package/dist/types/fieldHelpers/index.d.ts +1 -1
- package/dist/types/fieldHelpers/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utils/index.d.ts +3 -3
- package/dist/types/utils/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/accessorTree/index.ts +1 -1
- package/src/accessors/EntityAccessorImpl.ts +3 -3
- package/src/accessors/EntityListAccessorImpl.ts +2 -2
- package/src/accessors/FieldAccessorImpl.ts +3 -3
- package/src/accessors/index.ts +4 -4
- package/src/core/AccessorErrorManager.ts +5 -5
- package/src/core/Config.ts +1 -1
- package/src/core/DataBinding.ts +14 -14
- package/src/core/ErrorsPreprocessor.ts +2 -2
- package/src/core/EventManager.ts +5 -5
- package/src/core/MutationGenerator.ts +6 -6
- package/src/core/RealmKeyGenerator.ts +1 -1
- package/src/core/RequestResponseNormalizer.ts +2 -2
- package/src/core/StateInitializer.ts +32 -9
- package/src/core/TreeAugmenter.ts +7 -7
- package/src/core/TreeStore.ts +4 -4
- package/src/core/exceptions/ErrorLocator.ts +3 -3
- package/src/core/exceptions/MarkerSugarer.ts +1 -1
- package/src/core/factories/createBatchUpdatesOptions.ts +1 -1
- package/src/core/factories/index.ts +1 -1
- package/src/core/index.ts +8 -8
- package/src/core/operations/EntityOperations.ts +7 -7
- package/src/core/operations/FieldOperations.ts +6 -6
- package/src/core/operations/ListOperations.ts +8 -8
- package/src/core/operations/OperationsHelpers.ts +5 -5
- package/src/core/operations/index.ts +3 -3
- package/src/core/requestAliases/index.ts +1 -1
- package/src/core/state/EntityListState.ts +1 -1
- package/src/core/state/EntityRealmState.ts +3 -3
- package/src/core/state/EntityState.ts +1 -1
- package/src/core/state/FieldState.ts +1 -1
- package/src/core/state/StateIterator.ts +6 -6
- package/src/core/state/StateNode.ts +3 -3
- package/src/core/state/getEntityMarker.ts +1 -1
- package/src/core/state/index.ts +7 -7
- package/src/core/utils/index.ts +1 -1
- package/src/fieldHelpers/helpers/TemporalFieldHelper.ts +1 -1
- package/src/fieldHelpers/helpers/UuidFieldHelper.ts +1 -1
- package/src/fieldHelpers/helpers/index.ts +2 -2
- package/src/fieldHelpers/index.ts +1 -1
- package/src/index.ts +3 -3
- package/src/utils/index.ts +3 -3
|
@@ -14,10 +14,10 @@ import type {
|
|
|
14
14
|
} from '@contember/binding-common'
|
|
15
15
|
import { EventListenersStore } from '@contember/binding-common'
|
|
16
16
|
import { assertNever } from '@contember/binding-common'
|
|
17
|
-
import type { AccessorErrorManager } from './AccessorErrorManager'
|
|
18
|
-
import type { EventManager } from './EventManager'
|
|
19
|
-
import { EntityOperations, FieldOperations, ListOperations } from './operations'
|
|
20
|
-
import { RealmKeyGenerator } from './RealmKeyGenerator'
|
|
17
|
+
import type { AccessorErrorManager } from './AccessorErrorManager.js'
|
|
18
|
+
import type { EventManager } from './EventManager.js'
|
|
19
|
+
import { EntityOperations, FieldOperations, ListOperations } from './operations/index.js'
|
|
20
|
+
import { RealmKeyGenerator } from './RealmKeyGenerator.js'
|
|
21
21
|
import {
|
|
22
22
|
EntityListBlueprint,
|
|
23
23
|
EntityListState,
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
FieldState,
|
|
29
29
|
getEntityMarker,
|
|
30
30
|
RootStateNode,
|
|
31
|
-
} from './state'
|
|
31
|
+
} from './state/index.js'
|
|
32
32
|
import { TreeParameterMerger } from '@contember/binding-common'
|
|
33
|
-
import type { TreeStore } from './TreeStore'
|
|
34
|
-
import { EntityAccessorImpl, EntityListAccessorImpl, FieldAccessorImpl } from '../accessors'
|
|
35
|
-
import { EntityFieldPersistedData, EntityFieldPersistedValue } from '../accessorTree'
|
|
33
|
+
import type { TreeStore } from './TreeStore.js'
|
|
34
|
+
import { EntityAccessorImpl, EntityListAccessorImpl, FieldAccessorImpl } from '../accessors/index.js'
|
|
35
|
+
import { EntityFieldPersistedData, EntityFieldPersistedValue } from '../accessorTree/index.js'
|
|
36
36
|
|
|
37
37
|
export class StateInitializer {
|
|
38
38
|
private readonly fieldOperations: FieldOperations
|
|
@@ -188,7 +188,7 @@ export class StateInitializer {
|
|
|
188
188
|
// keep in sync two copies of the same data. TS hides the extra info anyway.
|
|
189
189
|
entityRealm.children,
|
|
190
190
|
this.treeStore.persistedEntityData.get(entity.id.uniqueValue),
|
|
191
|
-
entityRealm.unpersistedChangesCount !== 0,
|
|
191
|
+
entityRealm.unpersistedChangesCount !== 0 || this.hasConnectionChangedFromPersisted(entityRealm),
|
|
192
192
|
entityRealm.errors,
|
|
193
193
|
getEntityMarker(entityRealm).environment,
|
|
194
194
|
entityRealm.getAccessor,
|
|
@@ -200,6 +200,29 @@ export class StateInitializer {
|
|
|
200
200
|
return entityRealm
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
private hasConnectionChangedFromPersisted(entityRealm: EntityRealmState): boolean {
|
|
204
|
+
if (entityRealm.blueprint.type !== 'hasOne') {
|
|
205
|
+
return false
|
|
206
|
+
}
|
|
207
|
+
const parentState = entityRealm.blueprint.parent
|
|
208
|
+
const parentPersistedData = this.treeStore.persistedEntityData.get(parentState.entity.id.uniqueValue)
|
|
209
|
+
if (!parentPersistedData) {
|
|
210
|
+
return false
|
|
211
|
+
}
|
|
212
|
+
const persistedField = parentPersistedData.get(entityRealm.blueprint.marker.placeholderName)
|
|
213
|
+
if (persistedField === undefined) {
|
|
214
|
+
return false
|
|
215
|
+
}
|
|
216
|
+
const persistedValue = persistedField.value
|
|
217
|
+
if (persistedValue instanceof ServerId) {
|
|
218
|
+
return persistedValue.value !== entityRealm.entity.id.value
|
|
219
|
+
}
|
|
220
|
+
if (persistedValue === null) {
|
|
221
|
+
return entityRealm.entity.id.existsOnServer
|
|
222
|
+
}
|
|
223
|
+
return false
|
|
224
|
+
}
|
|
225
|
+
|
|
203
226
|
private materializeEntityRealm(state: EntityRealmState | EntityRealmStateStub): EntityRealmState {
|
|
204
227
|
if (state.type === 'entityRealm') {
|
|
205
228
|
return state
|
|
@@ -3,13 +3,13 @@ import { BindingError } from '@contember/binding-common'
|
|
|
3
3
|
import type { MarkerTreeRoot } from '@contember/binding-common'
|
|
4
4
|
import type { EntityId, PlaceholderName, TreeRootId } from '@contember/binding-common'
|
|
5
5
|
import { assertNever } from '@contember/binding-common'
|
|
6
|
-
import { EventManager } from './EventManager'
|
|
7
|
-
import { OperationsHelpers } from './operations/OperationsHelpers'
|
|
8
|
-
import { EntityListState, EntityRealmState, EntityRealmStateStub, getEntityMarker, RootStateNode } from './state'
|
|
9
|
-
import type { StateInitializer } from './StateInitializer'
|
|
10
|
-
import type { TreeStore } from './TreeStore'
|
|
11
|
-
import { SubMutationOperation } from './MutationGenerator'
|
|
12
|
-
import { EntityListPersistedData } from '../accessorTree'
|
|
6
|
+
import { EventManager } from './EventManager.js'
|
|
7
|
+
import { OperationsHelpers } from './operations/OperationsHelpers.js'
|
|
8
|
+
import { EntityListState, EntityRealmState, EntityRealmStateStub, getEntityMarker, RootStateNode } from './state/index.js'
|
|
9
|
+
import type { StateInitializer } from './StateInitializer.js'
|
|
10
|
+
import type { TreeStore } from './TreeStore.js'
|
|
11
|
+
import { SubMutationOperation } from './MutationGenerator.js'
|
|
12
|
+
import { EntityListPersistedData } from '../accessorTree/index.js'
|
|
13
13
|
|
|
14
14
|
export class TreeAugmenter {
|
|
15
15
|
public constructor(
|
package/src/core/TreeStore.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedPersistedData, PersistedEntityDataStore, SubTreeDataStore } from '../accessorTree'
|
|
1
|
+
import { NormalizedPersistedData, PersistedEntityDataStore, SubTreeDataStore } from '../accessorTree/index.js'
|
|
2
2
|
import type {
|
|
3
3
|
Alias,
|
|
4
4
|
EntityId,
|
|
@@ -18,9 +18,9 @@ import type {
|
|
|
18
18
|
} from '@contember/binding-common'
|
|
19
19
|
import { BindingError, MarkerComparator, MarkerTreeRoot, PlaceholderGenerator, QueryLanguage } from '@contember/binding-common'
|
|
20
20
|
import { assertNever } from '@contember/binding-common'
|
|
21
|
-
import { RequestResponseNormalizer } from './RequestResponseNormalizer'
|
|
22
|
-
import type { EntityListState, EntityRealmState, EntityRealmStateStub, EntityState, RootStateNode } from './state'
|
|
23
|
-
import { SubMutationOperation } from './MutationGenerator'
|
|
21
|
+
import { RequestResponseNormalizer } from './RequestResponseNormalizer.js'
|
|
22
|
+
import type { EntityListState, EntityRealmState, EntityRealmStateStub, EntityState, RootStateNode } from './state/index.js'
|
|
23
|
+
import { SubMutationOperation } from './MutationGenerator.js'
|
|
24
24
|
|
|
25
25
|
const emptyEntityIdSet: ReadonlySet<EntityId> = new Set()
|
|
26
26
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { assertNever } from '@contember/binding-common'
|
|
2
|
-
import type { StateNode } from '../state'
|
|
2
|
+
import type { StateNode } from '../state/index.js'
|
|
3
3
|
import type { MeaningfulMarker } from '@contember/binding-common'
|
|
4
|
-
import { MarkerSugarer } from './MarkerSugarer'
|
|
5
|
-
import { TreeParameterSugarer } from './TreeParameterSugarer'
|
|
4
|
+
import { MarkerSugarer } from './MarkerSugarer.js'
|
|
5
|
+
import { TreeParameterSugarer } from './TreeParameterSugarer.js'
|
|
6
6
|
|
|
7
7
|
export class ErrorLocator {
|
|
8
8
|
private static readonly GLUE = '.'
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
MeaningfulMarker,
|
|
8
8
|
} from '@contember/binding-common'
|
|
9
9
|
import { assertNever } from '@contember/binding-common'
|
|
10
|
-
import { TreeParameterSugarer } from './TreeParameterSugarer'
|
|
10
|
+
import { TreeParameterSugarer } from './TreeParameterSugarer.js'
|
|
11
11
|
|
|
12
12
|
export class MarkerSugarer {
|
|
13
13
|
public static sugarMarker(marker: MeaningfulMarker): string {
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
SugaredUnconstrainedQualifiedSingleEntity,
|
|
10
10
|
TreeRootId,
|
|
11
11
|
} from '@contember/binding-common'
|
|
12
|
-
import type { TreeStore } from '../TreeStore'
|
|
12
|
+
import type { TreeStore } from '../TreeStore.js'
|
|
13
13
|
|
|
14
14
|
export const createBatchUpdatesOptions = (rootEnvironment: Environment, treeStore: TreeStore): BatchUpdatesOptions =>
|
|
15
15
|
Object.freeze({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './createBatchUpdatesOptions'
|
|
1
|
+
export * from './createBatchUpdatesOptions.js'
|
package/src/core/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './Config'
|
|
2
|
-
export * from './DataBinding'
|
|
3
|
-
export * from './DirtinessTracker'
|
|
4
|
-
export * from './EventManager'
|
|
5
|
-
export * from './QueryGenerator'
|
|
6
|
-
export * from './StateInitializer'
|
|
7
|
-
export * from './TreeAugmenter'
|
|
8
|
-
export * from './TreeStore'
|
|
1
|
+
export * from './Config.js'
|
|
2
|
+
export * from './DataBinding.js'
|
|
3
|
+
export * from './DirtinessTracker.js'
|
|
4
|
+
export * from './EventManager.js'
|
|
5
|
+
export * from './QueryGenerator.js'
|
|
6
|
+
export * from './StateInitializer.js'
|
|
7
|
+
export * from './TreeAugmenter.js'
|
|
8
|
+
export * from './TreeStore.js'
|
|
@@ -4,16 +4,16 @@ import { BindingError } from '@contember/binding-common'
|
|
|
4
4
|
import { EntityFieldMarkersContainer, HasOneRelationMarker } from '@contember/binding-common'
|
|
5
5
|
import type { FieldName } from '@contember/binding-common'
|
|
6
6
|
import { assertNever } from '@contember/binding-common'
|
|
7
|
-
import type { AccessorErrorManager } from '../AccessorErrorManager'
|
|
8
|
-
import type { EventManager } from '../EventManager'
|
|
7
|
+
import type { AccessorErrorManager } from '../AccessorErrorManager.js'
|
|
8
|
+
import type { EventManager } from '../EventManager.js'
|
|
9
9
|
import { LocalizedBindingError } from '@contember/binding-common'
|
|
10
10
|
import { MarkerComparator } from '@contember/binding-common'
|
|
11
|
-
import { EntityListState, EntityRealmState, EntityRealmStateStub, getEntityMarker, StateIterator } from '../state'
|
|
12
|
-
import type { StateInitializer } from '../StateInitializer'
|
|
13
|
-
import type { TreeStore } from '../TreeStore'
|
|
14
|
-
import { OperationsHelpers } from './OperationsHelpers'
|
|
11
|
+
import { EntityListState, EntityRealmState, EntityRealmStateStub, getEntityMarker, StateIterator } from '../state/index.js'
|
|
12
|
+
import type { StateInitializer } from '../StateInitializer.js'
|
|
13
|
+
import type { TreeStore } from '../TreeStore.js'
|
|
14
|
+
import { OperationsHelpers } from './OperationsHelpers.js'
|
|
15
15
|
import { EventListenersStore } from '@contember/binding-common'
|
|
16
|
-
import { ErrorLocator } from '../exceptions/ErrorLocator'
|
|
16
|
+
import { ErrorLocator } from '../exceptions/ErrorLocator.js'
|
|
17
17
|
|
|
18
18
|
export class EntityOperations {
|
|
19
19
|
public constructor(
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
PRIMARY_KEY_NAME,
|
|
10
10
|
ServerId,
|
|
11
11
|
} from '@contember/binding-common'
|
|
12
|
-
import type { AccessorErrorManager } from '../AccessorErrorManager'
|
|
13
|
-
import { EventManager } from '../EventManager'
|
|
14
|
-
import { FieldState, getEntityMarker, StateIterator } from '../state'
|
|
15
|
-
import type { StateInitializer } from '../StateInitializer'
|
|
16
|
-
import type { TreeStore } from '../TreeStore'
|
|
17
|
-
import { OperationsHelpers } from './OperationsHelpers'
|
|
12
|
+
import type { AccessorErrorManager } from '../AccessorErrorManager.js'
|
|
13
|
+
import { EventManager } from '../EventManager.js'
|
|
14
|
+
import { FieldState, getEntityMarker, StateIterator } from '../state/index.js'
|
|
15
|
+
import type { StateInitializer } from '../StateInitializer.js'
|
|
16
|
+
import type { TreeStore } from '../TreeStore.js'
|
|
17
|
+
import { OperationsHelpers } from './OperationsHelpers.js'
|
|
18
18
|
|
|
19
19
|
export class FieldOperations {
|
|
20
20
|
public constructor(
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
RuntimeId,
|
|
10
10
|
UnpersistedEntityDummyId,
|
|
11
11
|
} from '@contember/binding-common'
|
|
12
|
-
import type { AccessorErrorManager } from '../AccessorErrorManager'
|
|
13
|
-
import { EventManager } from '../EventManager'
|
|
14
|
-
import { RealmKeyGenerator } from '../RealmKeyGenerator'
|
|
15
|
-
import { EntityListState, getEntityMarker, StateIterator } from '../state'
|
|
16
|
-
import type { StateInitializer } from '../StateInitializer'
|
|
17
|
-
import type { TreeStore } from '../TreeStore'
|
|
18
|
-
import { OperationsHelpers } from './OperationsHelpers'
|
|
19
|
-
import { ErrorLocator } from '../exceptions/ErrorLocator'
|
|
12
|
+
import type { AccessorErrorManager } from '../AccessorErrorManager.js'
|
|
13
|
+
import { EventManager } from '../EventManager.js'
|
|
14
|
+
import { RealmKeyGenerator } from '../RealmKeyGenerator.js'
|
|
15
|
+
import { EntityListState, getEntityMarker, StateIterator } from '../state/index.js'
|
|
16
|
+
import type { StateInitializer } from '../StateInitializer.js'
|
|
17
|
+
import type { TreeStore } from '../TreeStore.js'
|
|
18
|
+
import { OperationsHelpers } from './OperationsHelpers.js'
|
|
19
|
+
import { ErrorLocator } from '../exceptions/ErrorLocator.js'
|
|
20
20
|
|
|
21
21
|
export class ListOperations {
|
|
22
22
|
public constructor(
|
|
@@ -2,11 +2,11 @@ import type { EntityAccessor } from '@contember/binding-common'
|
|
|
2
2
|
import type { RuntimeId } from '@contember/binding-common'
|
|
3
3
|
import { BindingError } from '@contember/binding-common'
|
|
4
4
|
import { PRIMARY_KEY_NAME } from '@contember/binding-common'
|
|
5
|
-
import { EventManager } from '../EventManager'
|
|
6
|
-
import { RealmKeyGenerator } from '../RealmKeyGenerator'
|
|
7
|
-
import type { EntityRealmState, EntityRealmStateStub, EntityState } from '../state'
|
|
8
|
-
import type { StateInitializer } from '../StateInitializer'
|
|
9
|
-
import type { TreeStore } from '../TreeStore'
|
|
5
|
+
import { EventManager } from '../EventManager.js'
|
|
6
|
+
import { RealmKeyGenerator } from '../RealmKeyGenerator.js'
|
|
7
|
+
import type { EntityRealmState, EntityRealmStateStub, EntityState } from '../state/index.js'
|
|
8
|
+
import type { StateInitializer } from '../StateInitializer.js'
|
|
9
|
+
import type { TreeStore } from '../TreeStore.js'
|
|
10
10
|
|
|
11
11
|
export class OperationsHelpers {
|
|
12
12
|
public static rejectInvalidAccessorTree(): never {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './EntityOperations'
|
|
2
|
-
export * from './FieldOperations'
|
|
3
|
-
export * from './ListOperations'
|
|
1
|
+
export * from './EntityOperations.js'
|
|
2
|
+
export * from './FieldOperations.js'
|
|
3
|
+
export * from './ListOperations.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './MutationAlias'
|
|
1
|
+
export * from './MutationAlias.js'
|
|
@@ -2,7 +2,7 @@ import type { EntityListAccessor, ErrorAccessor } from '@contember/binding-commo
|
|
|
2
2
|
import type { EntityListSubTreeMarker, HasManyRelationMarker } from '@contember/binding-common'
|
|
3
3
|
import type { EntityEventListenerStore, EntityId, EntityListEventListenerStore, EntityName, RemovalType } from '@contember/binding-common'
|
|
4
4
|
import type { BijectiveIndexedMap } from '@contember/utilities'
|
|
5
|
-
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'
|
|
5
|
+
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState.js'
|
|
6
6
|
|
|
7
7
|
export type EntityListBlueprint =
|
|
8
8
|
| {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { EntityAccessor, ErrorAccessor } from '@contember/binding-common'
|
|
2
2
|
import type { EntitySubTreeMarker, HasOneRelationMarker } from '@contember/binding-common'
|
|
3
3
|
import type { EntityEventListenerStore, EntityRealmKey, FieldName, PlaceholderName } from '@contember/binding-common'
|
|
4
|
-
import type { EntityListState } from './EntityListState'
|
|
5
|
-
import type { EntityState } from './EntityState'
|
|
6
|
-
import type { StateNode } from './StateNode'
|
|
4
|
+
import type { EntityListState } from './EntityListState.js'
|
|
5
|
+
import type { EntityState } from './EntityState.js'
|
|
6
|
+
import type { StateNode } from './StateNode.js'
|
|
7
7
|
|
|
8
8
|
export interface HasOneEntityRealmBlueprint {
|
|
9
9
|
readonly type: 'hasOne'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntityName, EntityRealmKey, RuntimeId, UnpersistedEntityDummyId } from '@contember/binding-common'
|
|
2
|
-
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'
|
|
2
|
+
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState.js'
|
|
3
3
|
|
|
4
4
|
export interface EntityState {
|
|
5
5
|
entityName: EntityName
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ErrorAccessor, FieldAccessor } from '@contember/binding-common'
|
|
2
2
|
import type { FieldMarker } from '@contember/binding-common'
|
|
3
3
|
import type { FieldEventListenerStore, FieldName, FieldValue } from '@contember/binding-common'
|
|
4
|
-
import type { EntityRealmState } from './EntityRealmState'
|
|
4
|
+
import type { EntityRealmState } from './EntityRealmState.js'
|
|
5
5
|
|
|
6
6
|
export interface FieldState<Value extends FieldValue = FieldValue> {
|
|
7
7
|
type: 'field'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { FieldValue, PlaceholderName } from '@contember/binding-common'
|
|
2
2
|
import { assertNever } from '@contember/binding-common'
|
|
3
|
-
import type { TreeStore } from '../TreeStore'
|
|
4
|
-
import type { EntityListState } from './EntityListState'
|
|
5
|
-
import type { EntityRealmState } from './EntityRealmState'
|
|
6
|
-
import type { FieldState } from './FieldState'
|
|
7
|
-
import { getEntityMarker } from './getEntityMarker'
|
|
8
|
-
import type { RootStateNode, StateINode, StateNode } from './StateNode'
|
|
3
|
+
import type { TreeStore } from '../TreeStore.js'
|
|
4
|
+
import type { EntityListState } from './EntityListState.js'
|
|
5
|
+
import type { EntityRealmState } from './EntityRealmState.js'
|
|
6
|
+
import type { FieldState } from './FieldState.js'
|
|
7
|
+
import { getEntityMarker } from './getEntityMarker.js'
|
|
8
|
+
import type { RootStateNode, StateINode, StateNode } from './StateNode.js'
|
|
9
9
|
|
|
10
10
|
export class StateIterator {
|
|
11
11
|
public static *eachSiblingRealm(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EntityListState } from './EntityListState'
|
|
2
|
-
import type { EntityRealmState } from './EntityRealmState'
|
|
3
|
-
import type { FieldState } from './FieldState'
|
|
1
|
+
import type { EntityListState } from './EntityListState.js'
|
|
2
|
+
import type { EntityRealmState } from './EntityRealmState.js'
|
|
3
|
+
import type { FieldState } from './FieldState.js'
|
|
4
4
|
import type { FieldValue } from '@contember/binding-common'
|
|
5
5
|
|
|
6
6
|
export type RootStateNode = EntityRealmState | EntityListState
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'
|
|
1
|
+
import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState.js'
|
|
2
2
|
|
|
3
3
|
export const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>
|
|
4
4
|
realm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker
|
package/src/core/state/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './EntityListState'
|
|
2
|
-
export * from './EntityRealmState'
|
|
3
|
-
export * from './EntityState'
|
|
4
|
-
export * from './FieldState'
|
|
5
|
-
export * from './getEntityMarker'
|
|
6
|
-
export * from './StateIterator'
|
|
7
|
-
export * from './StateNode'
|
|
1
|
+
export * from './EntityListState.js'
|
|
2
|
+
export * from './EntityRealmState.js'
|
|
3
|
+
export * from './EntityState.js'
|
|
4
|
+
export * from './FieldState.js'
|
|
5
|
+
export * from './getEntityMarker.js'
|
|
6
|
+
export * from './StateIterator.js'
|
|
7
|
+
export * from './StateNode.js'
|
package/src/core/utils/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './getCombinedSignal'
|
|
1
|
+
export * from './getCombinedSignal.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FieldAccessor } from '@contember/binding-common'
|
|
2
|
-
import { FieldHelper } from './FieldHelper'
|
|
2
|
+
import { FieldHelper } from './FieldHelper.js'
|
|
3
3
|
|
|
4
4
|
class TemporalFieldHelper extends FieldHelper<string> {
|
|
5
5
|
public setToNow(options?: FieldAccessor.UpdateOptions) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v4 as uuidV4 } from 'uuid'
|
|
2
2
|
import type { FieldAccessor } from '@contember/binding-common'
|
|
3
|
-
import { FieldHelper } from './FieldHelper'
|
|
3
|
+
import { FieldHelper } from './FieldHelper.js'
|
|
4
4
|
|
|
5
5
|
class UuidFieldHelper extends FieldHelper<string> {
|
|
6
6
|
public setToUuid(options?: FieldAccessor.UpdateOptions) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './TemporalFieldHelper'
|
|
2
|
-
export * from './UuidFieldHelper'
|
|
1
|
+
export * from './TemporalFieldHelper.js'
|
|
2
|
+
export * from './UuidFieldHelper.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './helpers'
|
|
1
|
+
export * from './helpers/index.js'
|
package/src/index.ts
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './assertNever'
|
|
2
|
-
export * from './generateEnumerabilityPreventingEntropy'
|
|
3
|
-
export * from './isEmptyObject'
|
|
1
|
+
export * from './assertNever.js'
|
|
2
|
+
export * from './generateEnumerabilityPreventingEntropy.js'
|
|
3
|
+
export * from './isEmptyObject.js'
|