@contember/binding 1.1.0-alpha.0 → 1.1.0-alpha.3
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/accessorPropagation/useEntityListSubTree.js +4 -2
- package/dist/development/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useEntitySubTree.js +4 -2
- package/dist/development/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useExtendTree.js +27 -0
- package/dist/development/accessorPropagation/useExtendTree.js.map +1 -0
- package/dist/development/accessorTree/AccessorTree.js +9 -4
- package/dist/development/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/accessorTree/AccessorTreeStateContext.js +6 -0
- package/dist/development/accessorTree/AccessorTreeStateContext.js.map +1 -0
- package/dist/development/accessorTree/NormalizedPersistedData.js.map +1 -1
- package/dist/development/accessorTree/RuntimeId.js +17 -4
- package/dist/development/accessorTree/RuntimeId.js.map +1 -1
- package/dist/development/accessorTree/useAccessorTreeState.js +5 -0
- package/dist/development/accessorTree/useAccessorTreeState.js.map +1 -0
- package/dist/development/accessors/EntityAccessor.js +0 -32
- package/dist/development/accessors/EntityAccessor.js.map +1 -1
- package/dist/development/accessors/EntityListAccessor.js +1 -1
- package/dist/development/accessors/EntityListAccessor.js.map +1 -1
- package/dist/development/core/AccessorErrorManager.js +3 -0
- package/dist/development/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/core/DataBinding.js +7 -6
- package/dist/development/core/DataBinding.js.map +1 -1
- package/dist/development/core/DirtinessTracker.js +4 -13
- package/dist/development/core/DirtinessTracker.js.map +1 -1
- package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/core/EventManager.js +12 -7
- package/dist/development/core/EventManager.js.map +1 -1
- package/dist/development/core/MutationGenerator.js +100 -94
- package/dist/development/core/MutationGenerator.js.map +1 -1
- package/dist/development/core/RequestResponseNormalizer.js +27 -31
- package/dist/development/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/development/core/StateInitializer.js +23 -26
- package/dist/development/core/StateInitializer.js.map +1 -1
- package/dist/development/core/TreeAugmenter.js +10 -10
- package/dist/development/core/TreeAugmenter.js.map +1 -1
- package/dist/development/core/TreeFilterGenerator.js +2 -2
- package/dist/development/core/TreeFilterGenerator.js.map +1 -1
- package/dist/development/core/TreeStore.js +5 -5
- package/dist/development/core/TreeStore.js.map +1 -1
- package/dist/development/core/operations/EntityOperations.js +12 -11
- package/dist/development/core/operations/EntityOperations.js.map +1 -1
- package/dist/development/core/operations/FieldOperations.js +2 -2
- package/dist/development/core/operations/FieldOperations.js.map +1 -1
- package/dist/development/core/operations/ListOperations.js +3 -3
- package/dist/development/core/operations/ListOperations.js.map +1 -1
- package/dist/development/core/operations/OperationsHelpers.js +2 -2
- package/dist/development/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/development/core/requestAliases/MutationAlias.js +5 -3
- package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/development/core/schema/SchemaPreprocessor.js +1 -1
- package/dist/development/core/schema/SchemaPreprocessor.js.map +1 -1
- package/dist/development/dao/Environment.js +12 -2
- package/dist/development/dao/Environment.js.map +1 -1
- package/dist/development/dao/TreeNodeEnvironmentFactory.js +2 -2
- package/dist/development/dao/TreeNodeEnvironmentFactory.js.map +1 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +4 -2
- package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/helperComponents/If.js +39 -0
- package/dist/development/helperComponents/If.js.map +1 -0
- package/dist/development/helperComponents/SugaredField.js +1 -1
- package/dist/development/helperComponents/helpers/FilterEvaluator.js +38 -0
- package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +1 -0
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js +41 -0
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js.map +1 -0
- package/dist/development/helperComponents/helpers/evaluateCondition.js +46 -0
- package/dist/development/helperComponents/helpers/evaluateCondition.js.map +1 -0
- package/dist/development/index.js +4 -1
- package/dist/development/index.js.map +1 -1
- package/dist/development/markers/EntityListSubTreeMarker.js +1 -1
- package/dist/development/markers/EntityListSubTreeMarker.js.map +1 -1
- package/dist/development/markers/EntitySubTreeMarker.js +1 -1
- package/dist/development/markers/EntitySubTreeMarker.js.map +1 -1
- package/dist/development/markers/PlaceholderGenerator.js +4 -4
- package/dist/development/markers/PlaceholderGenerator.js.map +1 -1
- package/dist/development/utils/Hashing.js +21 -6
- package/dist/development/utils/Hashing.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTree.js +4 -2
- package/dist/production/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useEntitySubTree.js +4 -2
- package/dist/production/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useExtendTree.js +27 -0
- package/dist/production/accessorPropagation/useExtendTree.js.map +1 -0
- package/dist/production/accessorTree/AccessorTree.js +9 -4
- package/dist/production/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/accessorTree/AccessorTreeStateContext.js +6 -0
- package/dist/production/accessorTree/AccessorTreeStateContext.js.map +1 -0
- package/dist/production/accessorTree/NormalizedPersistedData.js.map +1 -1
- package/dist/production/accessorTree/RuntimeId.js +17 -4
- package/dist/production/accessorTree/RuntimeId.js.map +1 -1
- package/dist/production/accessorTree/useAccessorTreeState.js +5 -0
- package/dist/production/accessorTree/useAccessorTreeState.js.map +1 -0
- package/dist/production/accessors/EntityAccessor.js +0 -32
- package/dist/production/accessors/EntityAccessor.js.map +1 -1
- package/dist/production/accessors/EntityListAccessor.js +1 -1
- package/dist/production/accessors/EntityListAccessor.js.map +1 -1
- package/dist/production/core/AccessorErrorManager.js +3 -0
- package/dist/production/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/core/DataBinding.js +7 -6
- package/dist/production/core/DataBinding.js.map +1 -1
- package/dist/production/core/DirtinessTracker.js +4 -13
- package/dist/production/core/DirtinessTracker.js.map +1 -1
- package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/core/EventManager.js +11 -6
- package/dist/production/core/EventManager.js.map +1 -1
- package/dist/production/core/MutationGenerator.js +100 -94
- package/dist/production/core/MutationGenerator.js.map +1 -1
- package/dist/production/core/RequestResponseNormalizer.js +27 -31
- package/dist/production/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/production/core/StateInitializer.js +23 -26
- package/dist/production/core/StateInitializer.js.map +1 -1
- package/dist/production/core/TreeAugmenter.js +10 -10
- package/dist/production/core/TreeAugmenter.js.map +1 -1
- package/dist/production/core/TreeFilterGenerator.js +2 -2
- package/dist/production/core/TreeFilterGenerator.js.map +1 -1
- package/dist/production/core/TreeStore.js +5 -5
- package/dist/production/core/TreeStore.js.map +1 -1
- package/dist/production/core/operations/EntityOperations.js +12 -11
- package/dist/production/core/operations/EntityOperations.js.map +1 -1
- package/dist/production/core/operations/FieldOperations.js.map +1 -1
- package/dist/production/core/operations/ListOperations.js +3 -3
- package/dist/production/core/operations/ListOperations.js.map +1 -1
- package/dist/production/core/operations/OperationsHelpers.js +2 -2
- package/dist/production/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/production/core/requestAliases/MutationAlias.js +5 -3
- package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/production/core/schema/SchemaPreprocessor.js +1 -1
- package/dist/production/core/schema/SchemaPreprocessor.js.map +1 -1
- package/dist/production/dao/Environment.js +12 -2
- package/dist/production/dao/Environment.js.map +1 -1
- package/dist/production/dao/TreeNodeEnvironmentFactory.js +2 -2
- package/dist/production/dao/TreeNodeEnvironmentFactory.js.map +1 -1
- package/dist/production/helperComponents/DeferredSubTrees.js +4 -2
- package/dist/production/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/helperComponents/If.js +39 -0
- package/dist/production/helperComponents/If.js.map +1 -0
- package/dist/production/helperComponents/SugaredField.js +1 -1
- package/dist/production/helperComponents/helpers/FilterEvaluator.js +38 -0
- package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +1 -0
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js +41 -0
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js.map +1 -0
- package/dist/production/helperComponents/helpers/evaluateCondition.js +46 -0
- package/dist/production/helperComponents/helpers/evaluateCondition.js.map +1 -0
- package/dist/production/index.js +4 -1
- package/dist/production/index.js.map +1 -1
- package/dist/production/markers/EntityListSubTreeMarker.js +1 -1
- package/dist/production/markers/EntityListSubTreeMarker.js.map +1 -1
- package/dist/production/markers/EntitySubTreeMarker.js +1 -1
- package/dist/production/markers/EntitySubTreeMarker.js.map +1 -1
- package/dist/production/markers/PlaceholderGenerator.js +4 -4
- package/dist/production/markers/PlaceholderGenerator.js.map +1 -1
- package/dist/production/utils/Hashing.js +21 -6
- package/dist/production/utils/Hashing.js.map +1 -1
- package/dist/types/accessorPropagation/index.d.ts +1 -0
- package/dist/types/accessorPropagation/index.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useEntityListSubTree.d.ts +2 -1
- package/dist/types/accessorPropagation/useEntityListSubTree.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts +2 -1
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts.map +1 -1
- package/dist/types/accessorPropagation/useExtendTree.d.ts +5 -0
- package/dist/types/accessorPropagation/useExtendTree.d.ts.map +1 -0
- package/dist/types/accessorTree/AccessorTree.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +4 -0
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -0
- package/dist/types/accessorTree/MutationRequestResponse.d.ts +5 -1
- package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +1 -1
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts +4 -4
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +1 -1
- package/dist/types/accessorTree/PersistResult.d.ts +2 -1
- package/dist/types/accessorTree/PersistResult.d.ts.map +1 -1
- package/dist/types/accessorTree/QueryRequestResponse.d.ts +11 -10
- package/dist/types/accessorTree/QueryRequestResponse.d.ts.map +1 -1
- package/dist/types/accessorTree/RuntimeId.d.ts +16 -6
- package/dist/types/accessorTree/RuntimeId.d.ts.map +1 -1
- package/dist/types/accessorTree/index.d.ts +1 -0
- package/dist/types/accessorTree/index.d.ts.map +1 -1
- package/dist/types/accessorTree/useAccessorTreeState.d.ts +2 -0
- package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +1 -0
- package/dist/types/accessors/EntityAccessor.d.ts +1 -3
- package/dist/types/accessors/EntityAccessor.d.ts.map +1 -1
- package/dist/types/accessors/EntityListAccessor.d.ts +2 -2
- package/dist/types/accessors/EntityListAccessor.d.ts.map +1 -1
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts.map +1 -1
- package/dist/types/core/DirtinessTracker.d.ts +2 -5
- package/dist/types/core/DirtinessTracker.d.ts.map +1 -1
- package/dist/types/core/ErrorsPreprocessor.d.ts +2 -2
- package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -1
- package/dist/types/core/EventManager.d.ts +1 -1
- package/dist/types/core/EventManager.d.ts.map +1 -1
- package/dist/types/core/MutationGenerator.d.ts.map +1 -1
- package/dist/types/core/RequestResponseNormalizer.d.ts.map +1 -1
- package/dist/types/core/StateInitializer.d.ts +1 -5
- package/dist/types/core/StateInitializer.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/operations/EntityOperations.d.ts.map +1 -1
- package/dist/types/core/operations/ListOperations.d.ts +2 -1
- package/dist/types/core/operations/ListOperations.d.ts.map +1 -1
- package/dist/types/core/requestAliases/MutationAlias.d.ts.map +1 -1
- package/dist/types/core/schema/RawSchemaEntity.d.ts +3 -2
- package/dist/types/core/schema/RawSchemaEntity.d.ts.map +1 -1
- package/dist/types/core/schema/SchemaEntity.d.ts +1 -1
- package/dist/types/core/schema/SchemaEntity.d.ts.map +1 -1
- package/dist/types/dao/Environment.d.ts +7 -5
- package/dist/types/dao/Environment.d.ts.map +1 -1
- package/dist/types/helperComponents/If.d.ts +14 -0
- package/dist/types/helperComponents/If.d.ts.map +1 -0
- package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts +9 -0
- package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts.map +1 -0
- package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts +10 -0
- package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts.map +1 -0
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts +4 -0
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +1 -0
- package/dist/types/helperComponents/index.d.ts +1 -0
- package/dist/types/helperComponents/index.d.ts.map +1 -1
- package/dist/types/markers/PlaceholderGenerator.d.ts +3 -2
- package/dist/types/markers/PlaceholderGenerator.d.ts.map +1 -1
- package/dist/types/treeParameters/primitives/EntityId.d.ts +1 -1
- package/dist/types/treeParameters/primitives/EntityId.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utils/Hashing.d.ts +3 -2
- package/dist/types/utils/Hashing.d.ts.map +1 -1
- package/package.json +7 -5
- package/src/accessorPropagation/index.ts +1 -0
- package/src/accessorPropagation/useEntityListSubTree.ts +8 -1
- package/src/accessorPropagation/useEntitySubTree.ts +8 -1
- package/src/accessorPropagation/useExtendTree.ts +30 -0
- package/src/accessorTree/AccessorTree.tsx +18 -12
- package/src/accessorTree/AccessorTreeStateContext.ts +6 -0
- package/src/accessorTree/MutationRequestResponse.ts +3 -1
- package/src/accessorTree/NormalizedPersistedData.ts +4 -4
- package/src/accessorTree/PersistResult.ts +2 -1
- package/src/accessorTree/QueryRequestResponse.ts +17 -14
- package/src/accessorTree/RuntimeId.ts +27 -6
- package/src/accessorTree/index.ts +1 -0
- package/src/accessorTree/useAccessorTreeState.ts +4 -0
- package/src/accessors/EntityAccessor.ts +2 -51
- package/src/accessors/EntityListAccessor.ts +3 -3
- package/src/core/AccessorErrorManager.ts +3 -0
- package/src/core/DataBinding.ts +6 -7
- package/src/core/DirtinessTracker.ts +4 -16
- package/src/core/ErrorsPreprocessor.ts +2 -2
- package/src/core/EventManager.ts +14 -8
- package/src/core/MutationGenerator.ts +137 -130
- package/src/core/RequestResponseNormalizer.ts +37 -38
- package/src/core/StateInitializer.ts +35 -42
- package/src/core/TreeAugmenter.ts +11 -11
- package/src/core/TreeFilterGenerator.ts +5 -5
- package/src/core/TreeStore.ts +14 -6
- package/src/core/operations/EntityOperations.ts +12 -13
- package/src/core/operations/FieldOperations.ts +2 -2
- package/src/core/operations/ListOperations.ts +6 -5
- package/src/core/operations/OperationsHelpers.ts +2 -2
- package/src/core/requestAliases/MutationAlias.ts +5 -3
- package/src/core/schema/RawSchemaEntity.ts +1 -2
- package/src/core/schema/SchemaEntity.ts +1 -1
- package/src/core/schema/SchemaPreprocessor.ts +1 -1
- package/src/dao/Environment.ts +18 -7
- package/src/dao/TreeNodeEnvironmentFactory.ts +2 -2
- package/src/helperComponents/DeferredSubTrees.tsx +4 -4
- package/src/helperComponents/If.tsx +71 -0
- package/src/helperComponents/helpers/FilterEvaluator.ts +48 -0
- package/src/helperComponents/helpers/FilterFieldsCollector.ts +49 -0
- package/src/helperComponents/helpers/evaluateCondition.ts +52 -0
- package/src/helperComponents/index.ts +1 -0
- package/src/markers/EntityListSubTreeMarker.ts +1 -1
- package/src/markers/EntitySubTreeMarker.ts +1 -1
- package/src/markers/PlaceholderGenerator.ts +5 -2
- package/src/treeParameters/primitives/EntityId.ts +1 -1
- package/src/utils/Hashing.ts +23 -8
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BindingError } from "../../BindingError.js";
|
|
2
|
+
class FilterFieldsCollector {
|
|
3
|
+
constructor(schema, rootFilter) {
|
|
4
|
+
this.schema = schema;
|
|
5
|
+
this.rootFilter = rootFilter;
|
|
6
|
+
}
|
|
7
|
+
collectFields(entity) {
|
|
8
|
+
const result = /* @__PURE__ */ new Set();
|
|
9
|
+
this.collectFieldsInternal(this.rootFilter, entity, [], result);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
collectFieldsInternal(filter, entity, path, result) {
|
|
13
|
+
for (const [key, value] of Object.entries(filter)) {
|
|
14
|
+
if (key === "and" || key === "or") {
|
|
15
|
+
if (!Array.isArray(value)) {
|
|
16
|
+
throw new BindingError();
|
|
17
|
+
}
|
|
18
|
+
value?.forEach((it) => this.collectFieldsInternal(it, entity, path, result));
|
|
19
|
+
} else if (key === "not") {
|
|
20
|
+
this.collectFieldsInternal(value, entity, path, result);
|
|
21
|
+
} else {
|
|
22
|
+
const field = entity.fields.get(key);
|
|
23
|
+
if (!field) {
|
|
24
|
+
throw new BindingError(`Invalid field: the name "${key}" does not exist on entity "${entity.name}" in a ${path.length === 0 ? "root" : `path "${path.join(".")}"`} of a following filter:
|
|
25
|
+
` + JSON.stringify(this.rootFilter, null, " "));
|
|
26
|
+
}
|
|
27
|
+
if (field.__typename === "_Column") {
|
|
28
|
+
result.add([...path, key].join("."));
|
|
29
|
+
} else {
|
|
30
|
+
const entity2 = this.schema.getEntity(field.targetEntity);
|
|
31
|
+
if (!entity2) {
|
|
32
|
+
throw new BindingError();
|
|
33
|
+
}
|
|
34
|
+
this.collectFieldsInternal(value, entity2, [...path, key], result);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { FilterFieldsCollector };
|
|
41
|
+
//# sourceMappingURL=FilterFieldsCollector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterFieldsCollector.js","sources":["../../../../src/helperComponents/helpers/FilterFieldsCollector.ts"],"sourcesContent":["import { Schema, SchemaEntity } from '../../core/schema'\nimport { Filter } from '../../treeParameters'\nimport { BindingError } from '../../BindingError'\n\nexport class FilterFieldsCollector {\n\tconstructor(\n\t\tprivate readonly schema: Schema,\n\t\tprivate readonly rootFilter: Filter,\n\t) {\n\t}\n\n\n\tcollectFields(entity: SchemaEntity): Set<string> {\n\t\tconst result = new Set<string>()\n\t\tthis.collectFieldsInternal(this.rootFilter, entity, [], result)\n\t\treturn result\n\t}\n\n\tprivate collectFieldsInternal(filter: Filter, entity: SchemaEntity, path: string[], result: Set<string>): void {\n\t\tfor (const [key, value] of Object.entries(filter)) {\n\t\t\tif (key === 'and' || key === 'or') {\n\t\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tvalue?.forEach(it => this.collectFieldsInternal(it, entity, path, result))\n\n\t\t\t} else if (key === 'not') {\n\t\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, path, result)\n\n\t\t\t} else {\n\t\t\t\tconst field = entity.fields.get(key)\n\t\t\t\tif (!field) {\n\t\t\t\t\tthrow new BindingError(`Invalid field: the name \"${key}\" does not exist on entity \"${entity.name}\" `\n\t\t\t\t\t\t+ `in a ${path.length === 0 ? 'root' : `path \"${path.join('.')}\"`} of a following filter:\\n`\n\t\t\t\t\t\t+ JSON.stringify(this.rootFilter, null, ' '))\n\t\t\t\t}\n\t\t\t\tif (field.__typename === '_Column') {\n\t\t\t\t\tresult.add([...path, key].join('.'))\n\t\t\t\t} else {\n\t\t\t\t\tconst entity = this.schema.getEntity(field.targetEntity)\n\t\t\t\t\tif (!entity) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tthis.collectFieldsInternal(value as Filter, entity, [...path, key], result)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAIO,MAAM,sBAAsB;AAAA,EAClC,YACkB,QACA,YAChB;AAFgB,SAAA,SAAA;AACA,SAAA,aAAA;AAAA,EAElB;AAAA,EAGA,cAAc,QAAmC;AAC1C,UAAA,6BAAa;AACnB,SAAK,sBAAsB,KAAK,YAAY,QAAQ,CAAA,GAAI,MAAM;AACvD,WAAA;AAAA,EACR;AAAA,EAEQ,sBAAsB,QAAgB,QAAsB,MAAgB,QAA2B;AAC9G,eAAW,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAAG;AAC9C,UAAA,QAAQ,SAAS,QAAQ,MAAM;AACjC,YAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,gBAAM,IAAI,aAAa;AAAA,QACxB;AACO,eAAA,QAAQ,QAAM,KAAK,sBAAsB,IAAI,QAAQ,MAAM,MAAM,CAAC;AAAA,MAAA,WAEhE,QAAQ,OAAO;AACxB,aAAK,sBAAsB,OAAiB,QAAQ,MAAM,MAAM;AAAA,MAAA,OAE3D;AACN,cAAM,QAAQ,OAAO,OAAO,IAAI,GAAG;AACnC,YAAI,CAAC,OAAO;AACX,gBAAM,IAAI,aAAa,4BAA4B,kCAAkC,OAAO,cACjF,KAAK,WAAW,IAAI,SAAS,SAAS,KAAK,KAAK,GAAG;AAAA,IAC3D,KAAK,UAAU,KAAK,YAAY,MAAM,IAAI,CAAC;AAAA,QAC/C;AACI,YAAA,MAAM,eAAe,WAAW;AAC5B,iBAAA,IAAI,CAAC,GAAG,MAAM,GAAG,EAAE,KAAK,GAAG,CAAC;AAAA,QAAA,OAC7B;AACN,gBAAM,UAAS,KAAK,OAAO,UAAU,MAAM,YAAY;AACvD,cAAI,CAAC,SAAQ;AACZ,kBAAM,IAAI,aAAa;AAAA,UACxB;AACK,eAAA,sBAAsB,OAAiB,SAAQ,CAAC,GAAG,MAAM,GAAG,GAAG,MAAM;AAAA,QAC3E;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { GraphQlLiteral } from "@contember/client";
|
|
2
|
+
import { BindingError } from "../../BindingError.js";
|
|
3
|
+
const unwrapGraphqlLiteral = (value) => {
|
|
4
|
+
if (value instanceof GraphQlLiteral) {
|
|
5
|
+
return value.value;
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
const evaluateCondition = (value, condition) => {
|
|
10
|
+
const handlers = {
|
|
11
|
+
and: (expr) => expr.every((it) => evaluateCondition(value, it)),
|
|
12
|
+
or: (expr) => expr.some((it) => evaluateCondition(value, it)),
|
|
13
|
+
not: (expr) => !evaluateCondition(value, expr),
|
|
14
|
+
eq: (expr) => value === unwrapGraphqlLiteral(expr),
|
|
15
|
+
notEq: (expr) => value !== unwrapGraphqlLiteral(expr),
|
|
16
|
+
isNull: (expr) => value === null === expr,
|
|
17
|
+
in: (expr) => expr.map(unwrapGraphqlLiteral).includes(value),
|
|
18
|
+
notIn: (expr) => !expr.map(unwrapGraphqlLiteral).includes(value),
|
|
19
|
+
lt: (expr) => value !== null && value < unwrapGraphqlLiteral(expr),
|
|
20
|
+
lte: (expr) => value !== null && value <= unwrapGraphqlLiteral(expr),
|
|
21
|
+
gt: (expr) => value !== null && value > unwrapGraphqlLiteral(expr),
|
|
22
|
+
gte: (expr) => value !== null && value >= unwrapGraphqlLiteral(expr),
|
|
23
|
+
contains: (expr) => typeof value === "string" && value.includes(unwrapGraphqlLiteral(expr)),
|
|
24
|
+
startsWith: (expr) => typeof value === "string" && value.startsWith(unwrapGraphqlLiteral(expr)),
|
|
25
|
+
endsWith: (expr) => typeof value === "string" && value.endsWith(unwrapGraphqlLiteral(expr)),
|
|
26
|
+
containsCI: (expr) => typeof value === "string" && value.toLowerCase().includes(unwrapGraphqlLiteral(expr).toLowerCase()),
|
|
27
|
+
startsWithCI: (expr) => typeof value === "string" && value.toLowerCase().startsWith(unwrapGraphqlLiteral(expr).toLowerCase()),
|
|
28
|
+
endsWithCI: (expr) => typeof value === "string" && value.toLowerCase().endsWith(unwrapGraphqlLiteral(expr).toLowerCase()),
|
|
29
|
+
never: () => false,
|
|
30
|
+
always: () => true,
|
|
31
|
+
null: (expr) => value === null === expr
|
|
32
|
+
};
|
|
33
|
+
return Object.entries(condition).every(([operator, argument]) => {
|
|
34
|
+
if (value === void 0) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
const handlerKey = operator;
|
|
38
|
+
const handler = handlers[handlerKey];
|
|
39
|
+
if (!handler) {
|
|
40
|
+
throw new BindingError();
|
|
41
|
+
}
|
|
42
|
+
return handler(argument);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export { evaluateCondition };
|
|
46
|
+
//# sourceMappingURL=evaluateCondition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateCondition.js","sources":["../../../../src/helperComponents/helpers/evaluateCondition.ts"],"sourcesContent":["import { GraphQlLiteral, Input } from '@contember/client'\nimport { Scalar } from '../../treeParameters'\nimport { BindingError } from '../../BindingError'\n\nconst unwrapGraphqlLiteral = (value: Input.ColumnValue<GraphQlLiteral>): any => {\n\tif (value instanceof GraphQlLiteral) {\n\t\treturn value.value\n\t}\n\treturn value\n}\n\nexport const evaluateCondition = (value: Scalar | null, condition: Input.Condition<Input.ColumnValue<GraphQlLiteral>>) => {\n\t\tconst handlers: {\n\t\t\t[K in keyof Required<Input.Condition<any>>]: (\n\t\t\t\tparam: Exclude<Input.Condition<any>[K], undefined>,\n\t\t\t) => boolean\n\t\t} = {\n\t\t\tand: expr => expr.every(it => evaluateCondition(value, it)),\n\t\t\tor: expr => expr.some(it => evaluateCondition(value, it)),\n\t\t\tnot: expr => !evaluateCondition(value, expr),\n\t\t\teq: expr => value === unwrapGraphqlLiteral(expr),\n\t\t\tnotEq: expr => value !== unwrapGraphqlLiteral(expr),\n\t\t\tisNull: expr => (value === null) === expr,\n\t\t\tin: expr => expr.map(unwrapGraphqlLiteral).includes(value),\n\t\t\tnotIn: expr => !expr.map(unwrapGraphqlLiteral).includes(value),\n\t\t\tlt: expr => value !== null && value < unwrapGraphqlLiteral(expr),\n\t\t\tlte: expr => value !== null && value <= unwrapGraphqlLiteral(expr),\n\t\t\tgt: expr => value !== null && value > unwrapGraphqlLiteral(expr),\n\t\t\tgte: expr => value !== null && value >= unwrapGraphqlLiteral(expr),\n\t\t\tcontains: expr => typeof value === 'string' && value.includes(unwrapGraphqlLiteral(expr)),\n\t\t\tstartsWith: expr => typeof value === 'string' && value.startsWith(unwrapGraphqlLiteral(expr)),\n\t\t\tendsWith: expr => typeof value === 'string' && value.endsWith(unwrapGraphqlLiteral(expr)),\n\t\t\tcontainsCI: expr => typeof value === 'string' && value.toLowerCase().includes(unwrapGraphqlLiteral(expr).toLowerCase()),\n\t\t\tstartsWithCI: expr => typeof value === 'string' && value.toLowerCase().startsWith(unwrapGraphqlLiteral(expr).toLowerCase()),\n\t\t\tendsWithCI: expr => typeof value === 'string' && value.toLowerCase().endsWith(unwrapGraphqlLiteral(expr).toLowerCase()),\n\t\t\tnever: () => false,\n\t\t\talways: () => true,\n\t\t\t// deprecated\n\t\t\tnull: expr => (value === null) === expr,\n\t\t}\n\t\treturn Object.entries(condition).every(([operator, argument]) => {\n\t\t\tif (value === undefined) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tconst handlerKey = operator as keyof typeof handlers\n\t\t\tconst handler = handlers[handlerKey]\n\t\t\tif (!handler) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\treturn handler(argument)\n\t\t})\n\t}\n"],"names":[],"mappings":";;AAIA,MAAM,uBAAuB,CAAC,UAAkD;AAC/E,MAAI,iBAAiB,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACd;AACO,SAAA;AACR;AAEa,MAAA,oBAAoB,CAAC,OAAsB,cAAkE;AACxH,QAAM,WAIF;AAAA,IACH,KAAK,UAAQ,KAAK,MAAM,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IAC1D,IAAI,UAAQ,KAAK,KAAK,QAAM,kBAAkB,OAAO,EAAE,CAAC;AAAA,IACxD,KAAK,CAAA,SAAQ,CAAC,kBAAkB,OAAO,IAAI;AAAA,IAC3C,IAAI,CAAA,SAAQ,UAAU,qBAAqB,IAAI;AAAA,IAC/C,OAAO,CAAA,SAAQ,UAAU,qBAAqB,IAAI;AAAA,IAClD,QAAQ,CAAS,SAAA,UAAU,SAAU;AAAA,IACrC,IAAI,CAAQ,SAAA,KAAK,IAAI,oBAAoB,EAAE,SAAS,KAAK;AAAA,IACzD,OAAO,UAAQ,CAAC,KAAK,IAAI,oBAAoB,EAAE,SAAS,KAAK;AAAA,IAC7D,IAAI,CAAQ,SAAA,UAAU,QAAQ,QAAQ,qBAAqB,IAAI;AAAA,IAC/D,KAAK,CAAQ,SAAA,UAAU,QAAQ,SAAS,qBAAqB,IAAI;AAAA,IACjE,IAAI,CAAQ,SAAA,UAAU,QAAQ,QAAQ,qBAAqB,IAAI;AAAA,IAC/D,KAAK,CAAQ,SAAA,UAAU,QAAQ,SAAS,qBAAqB,IAAI;AAAA,IACjE,UAAU,UAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,qBAAqB,IAAI,CAAC;AAAA,IACxF,YAAY,UAAQ,OAAO,UAAU,YAAY,MAAM,WAAW,qBAAqB,IAAI,CAAC;AAAA,IAC5F,UAAU,UAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,qBAAqB,IAAI,CAAC;AAAA,IACxF,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,YAAY,EAAE,SAAS,qBAAqB,IAAI,EAAE,aAAa;AAAA,IACtH,cAAc,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,YAAY,EAAE,WAAW,qBAAqB,IAAI,EAAE,aAAa;AAAA,IAC1H,YAAY,CAAA,SAAQ,OAAO,UAAU,YAAY,MAAM,YAAY,EAAE,SAAS,qBAAqB,IAAI,EAAE,aAAa;AAAA,IACtH,OAAO,MAAM;AAAA,IACb,QAAQ,MAAM;AAAA,IAEd,MAAM,CAAS,SAAA,UAAU,SAAU;AAAA,EAAA;AAE7B,SAAA,OAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,CAAC,UAAU,cAAc;AAChE,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IACR;AACA,UAAM,aAAa;AACnB,UAAM,UAAU,SAAS;AACzB,QAAI,CAAC,SAAS;AACb,YAAM,IAAI,aAAa;AAAA,IACxB;AACA,WAAO,QAAQ,QAAQ;AAAA,EAAA,CACvB;AACF;;"}
|
package/dist/production/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { useEntityListSubTreeParameters } from "./accessorPropagation/useEntityL
|
|
|
20
20
|
export { useEntitySubTree } from "./accessorPropagation/useEntitySubTree.js";
|
|
21
21
|
export { useEntitySubTreeParameters } from "./accessorPropagation/useEntitySubTreeParameters.js";
|
|
22
22
|
export { useEnvironment } from "./accessorPropagation/useEnvironment.js";
|
|
23
|
+
export { useExtendTree } from "./accessorPropagation/useExtendTree.js";
|
|
23
24
|
export { useField } from "./accessorPropagation/useField.js";
|
|
24
25
|
export { useGetEntityByKey } from "./accessorPropagation/useGetEntityByKey.js";
|
|
25
26
|
export { useGetEntityListSubTree } from "./accessorPropagation/useGetEntityListSubTree.js";
|
|
@@ -44,7 +45,8 @@ export { DirtinessContext } from "./accessorTree/DirtinessContext.js";
|
|
|
44
45
|
export { metadataToRequestError } from "./accessorTree/metadataToRequestError.js";
|
|
45
46
|
export { MutationStateContext } from "./accessorTree/MutationStateContext.js";
|
|
46
47
|
export { NormalizedPersistedData } from "./accessorTree/NormalizedPersistedData.js";
|
|
47
|
-
export { ClientGeneratedUuid,
|
|
48
|
+
export { ClientGeneratedUuid, ServerId, UnpersistedEntityDummyId } from "./accessorTree/RuntimeId.js";
|
|
49
|
+
export { useAccessorTreeState } from "./accessorTree/useAccessorTreeState.js";
|
|
48
50
|
export { useDataBinding } from "./accessorTree/useDataBinding.js";
|
|
49
51
|
export { useDirtinessState } from "./accessorTree/useDirtinessState.js";
|
|
50
52
|
export { useMutationState } from "./accessorTree/useMutationState.js";
|
|
@@ -74,6 +76,7 @@ export { useEntityPersistSuccess } from "./entityEvents/useEntityPersistSuccess.
|
|
|
74
76
|
export { useOnConnectionUpdate } from "./entityEvents/useOnConnectionUpdate.js";
|
|
75
77
|
export { DeferredSubTrees } from "./helperComponents/DeferredSubTrees.js";
|
|
76
78
|
export { EntityView } from "./helperComponents/EntityView.js";
|
|
79
|
+
export { If } from "./helperComponents/If.js";
|
|
77
80
|
export { FieldView } from "./helperComponents/FieldView.js";
|
|
78
81
|
export { StaticRender } from "./helperComponents/StaticRender.js";
|
|
79
82
|
export { SugaredField } from "./helperComponents/SugaredField.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -11,7 +11,7 @@ class EntityListSubTreeMarker {
|
|
|
11
11
|
this.parameters = parameters;
|
|
12
12
|
this.fields = fields;
|
|
13
13
|
this.environment = environment;
|
|
14
|
-
this.placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(this.parameters);
|
|
14
|
+
this.placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(this.parameters, this.environment);
|
|
15
15
|
}
|
|
16
16
|
get entityName() {
|
|
17
17
|
return this.parameters.entityName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityListSubTreeMarker.js","sources":["../../../src/markers/EntityListSubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedEntityList, UnconstrainedQualifiedEntityList } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntityListSubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(this.parameters)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,wBAAwB;AAAA,EAG7B,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,gCAAgC,KAAK,
|
|
1
|
+
{"version":3,"file":"EntityListSubTreeMarker.js","sources":["../../../src/markers/EntityListSubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedEntityList, UnconstrainedQualifiedEntityList } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntityListSubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntityListSubTreePlaceholder(this.parameters, this.environment)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,wBAAwB;AAAA,EAG7B,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,gCAAgC,KAAK,YAAY,KAAK,WAAW;AAAA,EAC9G;AAAA,MAEW,aAAa;AACvB,WAAO,KAAK,WAAW;AAAA,EACxB;AACD;;"}
|
|
@@ -11,7 +11,7 @@ class EntitySubTreeMarker {
|
|
|
11
11
|
this.parameters = parameters;
|
|
12
12
|
this.fields = fields;
|
|
13
13
|
this.environment = environment;
|
|
14
|
-
this.placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(this.parameters);
|
|
14
|
+
this.placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(this.parameters, this.environment);
|
|
15
15
|
}
|
|
16
16
|
get entityName() {
|
|
17
17
|
return this.parameters.entityName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntitySubTreeMarker.js","sources":["../../../src/markers/EntitySubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedSingleEntity, UnconstrainedQualifiedSingleEntity } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntitySubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(this.parameters)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,oBAAoB;AAAA,EAGzB,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,4BAA4B,KAAK,
|
|
1
|
+
{"version":3,"file":"EntitySubTreeMarker.js","sources":["../../../src/markers/EntitySubTreeMarker.ts"],"sourcesContent":["import type { Environment } from '../dao'\nimport type { QualifiedSingleEntity, UnconstrainedQualifiedSingleEntity } from '../treeParameters'\nimport type { EntityFieldMarkersContainer } from './EntityFieldMarkersContainer'\nimport { PlaceholderGenerator } from './PlaceholderGenerator'\n\nexport class EntitySubTreeMarker {\n\tpublic readonly placeholderName: string\n\n\tpublic constructor(\n\t\tpublic readonly parameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tpublic readonly fields: EntityFieldMarkersContainer,\n\t\tpublic readonly environment: Environment,\n\t) {\n\t\tthis.placeholderName = PlaceholderGenerator.getEntitySubTreePlaceholder(this.parameters, this.environment)\n\t}\n\n\tpublic get entityName() {\n\t\treturn this.parameters.entityName\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAKO,MAAM,oBAAoB;AAAA,EAGzB,YACU,YACA,QACA,aACf;AANc;AAGC,SAAA,aAAA;AACA,SAAA,SAAA;AACA,SAAA,cAAA;AAEhB,SAAK,kBAAkB,qBAAqB,4BAA4B,KAAK,YAAY,KAAK,WAAW;AAAA,EAC1G;AAAA,MAEW,aAAa;AACvB,WAAO,KAAK,WAAW;AAAA,EACxB;AACD;;"}
|
|
@@ -9,11 +9,11 @@ class PlaceholderGenerator {
|
|
|
9
9
|
static getHasManyRelationPlaceholder(relation) {
|
|
10
10
|
return `${relation.field}_${Hashing.hashHasManyRelation(relation)}`;
|
|
11
11
|
}
|
|
12
|
-
static getEntitySubTreePlaceholder(subTreeParameters) {
|
|
13
|
-
return `est_${Hashing.hashEntitySubTreeParameters(subTreeParameters)}`;
|
|
12
|
+
static getEntitySubTreePlaceholder(subTreeParameters, environment) {
|
|
13
|
+
return `est_${Hashing.hashEntitySubTreeParameters(subTreeParameters, environment)}`;
|
|
14
14
|
}
|
|
15
|
-
static getEntityListSubTreePlaceholder(subTreeParameters) {
|
|
16
|
-
return `lst_${Hashing.hashEntityListSubTreeParameters(subTreeParameters)}`;
|
|
15
|
+
static getEntityListSubTreePlaceholder(subTreeParameters, environment) {
|
|
16
|
+
return `lst_${Hashing.hashEntityListSubTreeParameters(subTreeParameters, environment)}`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export { PlaceholderGenerator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaceholderGenerator.js","sources":["../../../src/markers/PlaceholderGenerator.ts"],"sourcesContent":["import type {\n\tFieldName,\n\tHasManyRelation,\n\tHasOneRelation,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n} from '../treeParameters'\nimport { Hashing } from '../utils'\n\nexport class PlaceholderGenerator {\n\tpublic static getFieldPlaceholder(fieldName: FieldName): string {\n\t\treturn fieldName\n\t}\n\n\tpublic static getHasOneRelationPlaceholder(relation: HasOneRelation): string {\n\t\treturn `${relation.field}_${Hashing.hashHasOneRelation(relation)}`\n\t}\n\n\tpublic static getHasManyRelationPlaceholder(relation: HasManyRelation): string {\n\t\treturn `${relation.field}_${Hashing.hashHasManyRelation(relation)}`\n\t}\n\n\tpublic static getEntitySubTreePlaceholder(\n\t\tsubTreeParameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t): string {\n\t\treturn `est_${Hashing.hashEntitySubTreeParameters(subTreeParameters)}`\n\t}\n\n\tpublic static getEntityListSubTreePlaceholder(\n\t\tsubTreeParameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t): string {\n\t\treturn `lst_${Hashing.hashEntityListSubTreeParameters(subTreeParameters)}`\n\t}\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PlaceholderGenerator.js","sources":["../../../src/markers/PlaceholderGenerator.ts"],"sourcesContent":["import type {\n\tFieldName,\n\tHasManyRelation,\n\tHasOneRelation,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n} from '../treeParameters'\nimport { Hashing } from '../utils'\nimport { Environment } from '../dao'\n\nexport class PlaceholderGenerator {\n\tpublic static getFieldPlaceholder(fieldName: FieldName): string {\n\t\treturn fieldName\n\t}\n\n\tpublic static getHasOneRelationPlaceholder(relation: HasOneRelation): string {\n\t\treturn `${relation.field}_${Hashing.hashHasOneRelation(relation)}`\n\t}\n\n\tpublic static getHasManyRelationPlaceholder(relation: HasManyRelation): string {\n\t\treturn `${relation.field}_${Hashing.hashHasManyRelation(relation)}`\n\t}\n\n\tpublic static getEntitySubTreePlaceholder(\n\t\tsubTreeParameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tenvironment: Environment,\n\t): string {\n\t\treturn `est_${Hashing.hashEntitySubTreeParameters(subTreeParameters, environment)}`\n\t}\n\n\tpublic static getEntityListSubTreePlaceholder(\n\t\tsubTreeParameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tenvironment: Environment,\n\t): string {\n\t\treturn `lst_${Hashing.hashEntityListSubTreeParameters(subTreeParameters, environment)}`\n\t}\n}\n"],"names":[],"mappings":";AAYO,MAAM,qBAAqB;AAAA,SACnB,oBAAoB,WAA8B;AACxD,WAAA;AAAA,EACR;AAAA,SAEc,6BAA6B,UAAkC;AAC5E,WAAO,GAAG,SAAS,SAAS,QAAQ,mBAAmB,QAAQ;AAAA,EAChE;AAAA,SAEc,8BAA8B,UAAmC;AAC9E,WAAO,GAAG,SAAS,SAAS,QAAQ,oBAAoB,QAAQ;AAAA,EACjE;AAAA,SAEc,4BACb,mBACA,aACS;AACT,WAAO,OAAO,QAAQ,4BAA4B,mBAAmB,WAAW;AAAA,EACjF;AAAA,SAEc,gCACb,mBACA,aACS;AACT,WAAO,OAAO,QAAQ,gCAAgC,mBAAmB,WAAW;AAAA,EACrF;AACD;;"}
|
|
@@ -19,9 +19,13 @@ class Hashing {
|
|
|
19
19
|
];
|
|
20
20
|
return Hashing.hashArray(where);
|
|
21
21
|
}
|
|
22
|
-
static hashEntityListSubTreeParameters(parameters) {
|
|
22
|
+
static hashEntityListSubTreeParameters(parameters, environment) {
|
|
23
23
|
if (parameters.isCreating) {
|
|
24
|
-
return Hashing.hashArray([
|
|
24
|
+
return Hashing.hashArray([
|
|
25
|
+
parameters.isCreating,
|
|
26
|
+
parameters.entityName,
|
|
27
|
+
environment.getAllVariables()
|
|
28
|
+
]);
|
|
25
29
|
}
|
|
26
30
|
return Hashing.hashArray([
|
|
27
31
|
parameters.isCreating,
|
|
@@ -29,14 +33,25 @@ class Hashing {
|
|
|
29
33
|
parameters.filter,
|
|
30
34
|
parameters.orderBy,
|
|
31
35
|
parameters.offset,
|
|
32
|
-
parameters.limit
|
|
36
|
+
parameters.limit,
|
|
37
|
+
environment.getAllVariables()
|
|
33
38
|
]);
|
|
34
39
|
}
|
|
35
|
-
static hashEntitySubTreeParameters(parameters) {
|
|
40
|
+
static hashEntitySubTreeParameters(parameters, environment) {
|
|
36
41
|
if (parameters.isCreating) {
|
|
37
|
-
return Hashing.hashArray([
|
|
42
|
+
return Hashing.hashArray([
|
|
43
|
+
parameters.isCreating,
|
|
44
|
+
parameters.entityName,
|
|
45
|
+
environment.getAllVariables()
|
|
46
|
+
]);
|
|
38
47
|
}
|
|
39
|
-
return Hashing.hashArray([
|
|
48
|
+
return Hashing.hashArray([
|
|
49
|
+
parameters.isCreating,
|
|
50
|
+
parameters.where,
|
|
51
|
+
parameters.entityName,
|
|
52
|
+
parameters.filter,
|
|
53
|
+
environment.getAllVariables()
|
|
54
|
+
]);
|
|
40
55
|
}
|
|
41
56
|
static hashArray(array) {
|
|
42
57
|
const json = array.map((item) => JSON.stringify(item)).join("_");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hashing.js","sources":["../../../src/utils/Hashing.ts"],"sourcesContent":["import type {\n\
|
|
1
|
+
{"version":3,"file":"Hashing.js","sources":["../../../src/utils/Hashing.ts"],"sourcesContent":["import type {\n\tHasManyRelation,\n\tHasOneRelation,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n} from '../treeParameters'\nimport { Environment } from '../dao'\n\n// TODO update hashing so that for offset, 0 == undefined\nexport class Hashing {\n\tpublic static hashHasOneRelation(relation: HasOneRelation): number {\n\t\tconst where = [\n\t\t\t'upToOne',\n\t\t\trelation.field,\n\t\t\trelation.filter,\n\t\t\trelation.reducedBy,\n\t\t]\n\n\t\treturn Hashing.hashArray(where)\n\t}\n\n\tpublic static hashHasManyRelation(relation: HasManyRelation): number {\n\t\tconst where = [\n\t\t\t'possiblyMany',\n\t\t\trelation.field,\n\t\t\trelation.filter,\n\t\t\t'offset' in relation ? relation.offset : undefined,\n\t\t\t'limit' in relation ? relation.limit : undefined,\n\t\t\t'orderBy' in relation ? relation.orderBy : undefined,\n\t\t]\n\n\t\treturn Hashing.hashArray(where)\n\t}\n\n\tpublic static hashEntityListSubTreeParameters(\n\t\tparameters: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tenvironment: Environment,\n\t): number {\n\t\tif (parameters.isCreating) {\n\t\t\treturn Hashing.hashArray([\n\t\t\t\tparameters.isCreating,\n\t\t\t\tparameters.entityName,\n\t\t\t\tenvironment.getAllVariables(),\n\t\t\t])\n\t\t}\n\t\treturn Hashing.hashArray([\n\t\t\tparameters.isCreating,\n\t\t\tparameters.entityName,\n\t\t\tparameters.filter,\n\t\t\tparameters.orderBy,\n\t\t\tparameters.offset,\n\t\t\tparameters.limit,\n\t\t\tenvironment.getAllVariables(),\n\t\t])\n\t}\n\n\tpublic static hashEntitySubTreeParameters(\n\t\tparameters: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tenvironment: Environment,\n\t): number {\n\t\tif (parameters.isCreating) {\n\t\t\treturn Hashing.hashArray([\n\t\t\t\tparameters.isCreating,\n\t\t\t\tparameters.entityName,\n\t\t\t\tenvironment.getAllVariables(),\n\t\t\t])\n\t\t}\n\t\treturn Hashing.hashArray([\n\t\t\tparameters.isCreating,\n\t\t\tparameters.where,\n\t\t\tparameters.entityName,\n\t\t\tparameters.filter,\n\t\t\tenvironment.getAllVariables(),\n\t\t])\n\t}\n\n\tprivate static hashArray(array: any[]): number {\n\t\tconst json = array.map(item => JSON.stringify(item)).join('_')\n\t\treturn Hashing.hash(json)\n\t}\n\n\t// Taken from Java\n\tpublic static hash(str: string): number {\n\t\tlet hash = 0\n\t\tif (str.length === 0) {\n\t\t\treturn hash\n\t\t}\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\thash = (hash << 5) - hash + str.charCodeAt(i)\n\t\t\thash = hash & hash // Convert to 32bit integer\n\t\t}\n\t\treturn Math.abs(hash)\n\t}\n}\n"],"names":[],"mappings":"AAWO,MAAM,QAAQ;AAAA,SACN,mBAAmB,UAAkC;AAClE,UAAM,QAAQ;AAAA,MACb;AAAA,MACA,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAGH,WAAA,QAAQ,UAAU,KAAK;AAAA,EAC/B;AAAA,SAEc,oBAAoB,UAAmC;AACpE,UAAM,QAAQ;AAAA,MACb;AAAA,MACA,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY,WAAW,SAAS,SAAS;AAAA,MACzC,WAAW,WAAW,SAAS,QAAQ;AAAA,MACvC,aAAa,WAAW,SAAS,UAAU;AAAA,IAAA;AAGrC,WAAA,QAAQ,UAAU,KAAK;AAAA,EAC/B;AAAA,SAEc,gCACb,YACA,aACS;AACT,QAAI,WAAW,YAAY;AAC1B,aAAO,QAAQ,UAAU;AAAA,QACxB,WAAW;AAAA,QACX,WAAW;AAAA,QACX,YAAY,gBAAgB;AAAA,MAAA,CAC5B;AAAA,IACF;AACA,WAAO,QAAQ,UAAU;AAAA,MACxB,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,YAAY,gBAAgB;AAAA,IAAA,CAC5B;AAAA,EACF;AAAA,SAEc,4BACb,YACA,aACS;AACT,QAAI,WAAW,YAAY;AAC1B,aAAO,QAAQ,UAAU;AAAA,QACxB,WAAW;AAAA,QACX,WAAW;AAAA,QACX,YAAY,gBAAgB;AAAA,MAAA,CAC5B;AAAA,IACF;AACA,WAAO,QAAQ,UAAU;AAAA,MACxB,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,YAAY,gBAAgB;AAAA,IAAA,CAC5B;AAAA,EACF;AAAA,SAEe,UAAU,OAAsB;AACxC,UAAA,OAAO,MAAM,IAAI,CAAQ,SAAA,KAAK,UAAU,IAAI,CAAC,EAAE,KAAK,GAAG;AACtD,WAAA,QAAQ,KAAK,IAAI;AAAA,EACzB;AAAA,SAGc,KAAK,KAAqB;AACvC,QAAI,OAAO;AACP,QAAA,IAAI,WAAW,GAAG;AACd,aAAA;AAAA,IACR;AACA,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACpC,aAAgB,SAAA,KAAK,OAAO,IAAI,WAAW,CAAC;AAC5C,aAAO,OAAO;AAAA,IACf;AACO,WAAA,KAAK,IAAI,IAAI;AAAA,EACrB;AACD;;"}
|
|
@@ -17,6 +17,7 @@ export * from './useEntityListSubTreeParameters';
|
|
|
17
17
|
export * from './useEntitySubTree';
|
|
18
18
|
export * from './useEntitySubTreeParameters';
|
|
19
19
|
export * from './useEnvironment';
|
|
20
|
+
export * from './useExtendTree';
|
|
20
21
|
export * from './useField';
|
|
21
22
|
export * from './useGetEntityByKey';
|
|
22
23
|
export * from './useGetEntityListSubTree';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,oBAAoB,CAAA;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EntityListAccessor } from '../accessors';
|
|
2
2
|
import type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '../treeParameters';
|
|
3
|
-
|
|
3
|
+
import { TreeRootId } from '../treeParameters';
|
|
4
|
+
export declare const useEntityListSubTree: (qualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList, ...treeId: [TreeRootId | undefined] | []) => EntityListAccessor;
|
|
4
5
|
//# sourceMappingURL=useEntityListSubTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntityListSubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntityListSubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAA;AAInH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,eAAO,MAAM,oBAAoB,wBACX,KAAK,GAAG,0BAA0B,GAAG,uCAAuC,aACtF,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,EAAE,KACtC,kBAeF,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EntityAccessor } from '../accessors';
|
|
2
2
|
import type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '../treeParameters';
|
|
3
|
-
|
|
3
|
+
import { TreeRootId } from '../treeParameters';
|
|
4
|
+
export declare const useEntitySubTree: (qualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity, ...treeId: [TreeRootId | undefined] | []) => EntityAccessor;
|
|
4
5
|
//# sourceMappingURL=useEntitySubTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntitySubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,yCAAyC,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"useEntitySubTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntitySubTree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,yCAAyC,EAAE,MAAM,mBAAmB,CAAA;AAIvH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,eAAO,MAAM,gBAAgB,0BACL,KAAK,GAAG,4BAA4B,GAAG,yCAAyC,aAC5F,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,EAAE,KACtC,cAcF,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TreeRootId } from '../treeParameters';
|
|
3
|
+
import { ExtendTreeOptions } from '../accessors';
|
|
4
|
+
export declare const useExtendTree: () => (newFragment: ReactNode, options?: Omit<ExtendTreeOptions, "signal"> | undefined) => Promise<TreeRootId | undefined>;
|
|
5
|
+
//# sourceMappingURL=useExtendTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExtendTree.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useExtendTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAIhD,eAAO,MAAM,aAAa,sBAKc,SAAS,8DAAgD,QAAQ,UAAU,GAAG,SAAS,CAgB9H,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorTree.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/AccessorTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"AccessorTree.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/AccessorTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAK5D,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,iBAAiB,CAAA;IACxB,QAAQ,EAAE,SAAS,CAAA;CACnB;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eAyBlE;yBAzBe,YAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessorTreeStateContext.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/AccessorTreeStateContext.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,eAAO,MAAM,wBAAwB,4CAEnC,CAAA"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Result } from '@contember/client';
|
|
2
2
|
import type { ReceivedEntityData } from './QueryRequestResponse';
|
|
3
|
+
declare type WithType<V, Type extends string> = V & {
|
|
4
|
+
__typename: Type;
|
|
5
|
+
};
|
|
3
6
|
export interface FieldPathErrorFragment {
|
|
4
7
|
__typename: '_FieldPathFragment';
|
|
5
8
|
field: string;
|
|
@@ -36,7 +39,7 @@ export interface MutationDataResponse {
|
|
|
36
39
|
[alias: string]: MutationResponse;
|
|
37
40
|
}
|
|
38
41
|
export interface MutationTransactionResponse {
|
|
39
|
-
transaction: MutationDataResponse | null;
|
|
42
|
+
transaction: WithType<MutationDataResponse, 'MutationTransaction'> | null;
|
|
40
43
|
}
|
|
41
44
|
export interface MutationRequestResponse {
|
|
42
45
|
data: MutationTransactionResponse | null;
|
|
@@ -45,4 +48,5 @@ export interface MutationRequestResponse {
|
|
|
45
48
|
path?: string[];
|
|
46
49
|
}[];
|
|
47
50
|
}
|
|
51
|
+
export {};
|
|
48
52
|
//# sourceMappingURL=MutationRequestResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutationRequestResponse.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/MutationRequestResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,oBAAoB,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,oBAAoB,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,oBAAY,iBAAiB,GAAG,sBAAsB,GAAG,sBAAsB,CAAA;AAE/E,oBAAY,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;AAEnD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,iBAAiB,CAAA;IACvB,OAAO,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;KACZ,CAAA;CACD;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,iBAAiB,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,kBAAkB,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,OAAO,CAAA;IACX,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,EACP;QACA,KAAK,EAAE,OAAO,CAAA;QACd,MAAM,EAAE,eAAe,EAAE,CAAA;KACxB,GACD,SAAS,CAAA;IACZ,IAAI,EAAE,kBAAkB,CAAA;CACxB;AAED,MAAM,WAAW,oBAAoB;IACpC,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACjC;AAED,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"MutationRequestResponse.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/MutationRequestResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,aAAK,QAAQ,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,IAAI,CAAC,GAAG;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,CAAA;AAEhE,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,oBAAoB,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,oBAAoB,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,oBAAY,iBAAiB,GAAG,sBAAsB,GAAG,sBAAsB,CAAA;AAE/E,oBAAY,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;AAEnD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,iBAAiB,CAAA;IACvB,OAAO,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;KACZ,CAAA;CACD;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,iBAAiB,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,kBAAkB,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,OAAO,CAAA;IACX,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,EACP;QACA,KAAK,EAAE,OAAO,CAAA;QACd,MAAM,EAAE,eAAe,EAAE,CAAA;KACxB,GACD,SAAS,CAAA;IACZ,IAAI,EAAE,kBAAkB,CAAA;CACxB;AAED,MAAM,WAAW,oBAAoB;IACpC,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACjC;AAED,MAAM,WAAW,2BAA2B;IAC3C,WAAW,EAAE,QAAQ,CAAC,oBAAoB,EAAE,qBAAqB,CAAC,GAAG,IAAI,CAAA;CACzE;AAED,MAAM,WAAW,uBAAuB;IACvC,IAAI,EAAE,2BAA2B,GAAG,IAAI,CAAA;IACxC,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAA;CAC/C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { EntityId, PlaceholderName, Scalar } from '../treeParameters';
|
|
2
|
-
import type {
|
|
3
|
-
export declare type EntityFieldPersistedData = Scalar |
|
|
2
|
+
import type { ServerId, UniqueEntityId } from './RuntimeId';
|
|
3
|
+
export declare type EntityFieldPersistedData = Scalar | ServerId | EntityListPersistedData;
|
|
4
4
|
export declare type SingleEntityPersistedData = Map<PlaceholderName, EntityFieldPersistedData>;
|
|
5
5
|
export declare type EntityListPersistedData = Set<EntityId>;
|
|
6
|
-
export declare type PersistedEntityDataStore = Map<
|
|
7
|
-
export declare type SubTreeDataStore = Map<PlaceholderName,
|
|
6
|
+
export declare type PersistedEntityDataStore = Map<UniqueEntityId, SingleEntityPersistedData>;
|
|
7
|
+
export declare type SubTreeDataStore = Map<PlaceholderName, ServerId | EntityListPersistedData>;
|
|
8
8
|
export declare class NormalizedPersistedData {
|
|
9
9
|
readonly subTreeDataStore: SubTreeDataStore;
|
|
10
10
|
readonly persistedEntityDataStore: PersistedEntityDataStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedPersistedData.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/NormalizedPersistedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NormalizedPersistedData.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/NormalizedPersistedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK3D,oBAAY,wBAAwB,GAAG,MAAM,GAAG,QAAQ,GAAG,uBAAuB,CAAA;AAElF,oBAAY,yBAAyB,GAAG,GAAG,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAA;AAEtF,oBAAY,uBAAuB,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEnD,oBAAY,wBAAwB,GAAG,GAAG,CAAC,cAAc,EAAE,yBAAyB,CAAC,CAAA;AAGrF,oBAAY,gBAAgB,GAAG,GAAG,CAAC,eAAe,EAAE,QAAQ,GAAG,uBAAuB,CAAC,CAAA;AAEvF,qBAAa,uBAAuB;aAElB,gBAAgB,EAAE,gBAAgB;aAClC,wBAAwB,EAAE,wBAAwB;gBADlD,gBAAgB,EAAE,gBAAgB,EAClC,wBAAwB,EAAE,wBAAwB;CAEnE"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { RequestError } from './RequestError';
|
|
2
2
|
import { ErrorAccessor } from '../accessors';
|
|
3
|
+
import { EntityId } from '../treeParameters';
|
|
3
4
|
export interface NothingToPersistPersistResult {
|
|
4
5
|
type: 'nothingToPersist';
|
|
5
6
|
}
|
|
6
7
|
export interface JustSuccessPersistResult {
|
|
7
8
|
type: 'justSuccess';
|
|
8
|
-
persistedEntityIds:
|
|
9
|
+
persistedEntityIds: EntityId[];
|
|
9
10
|
afterPersistError?: any;
|
|
10
11
|
}
|
|
11
12
|
export interface InvalidInputPersistResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersistResult.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/PersistResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,WAAW,6BAA6B;IAC7C,IAAI,EAAE,kBAAkB,CAAA;CACxB;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,aAAa,CAAA;IACnB,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"PersistResult.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/PersistResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,MAAM,WAAW,6BAA6B;IAC7C,IAAI,EAAE,kBAAkB,CAAA;CACxB;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,aAAa,CAAA;IACnB,kBAAkB,EAAE,QAAQ,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,GAAG,CAAA;CACvB;AAED,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,cAAc,CAAA;IACpB,MAAM,EAAE,aAAa,CAAC,KAAK,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,iBAAiB,CAAA;IACvB,MAAM,EAAE,GAAG,CAAA;CACX;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,SAAS,CAAA;CACf;AAED,oBAAY,uBAAuB,GAAG,6BAA6B,GAAG,wBAAwB,CAAA;AAE9F,oBAAY,kBAAkB,GAAG,yBAAyB,GAAG,oBAAoB,GAAG,YAAY,GAAG,qBAAqB,CAAA"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import type { Scalar } from '../treeParameters';
|
|
2
|
-
export declare type ReceivedFieldData
|
|
3
|
-
export declare type ReceivedEntityData
|
|
4
|
-
id: string;
|
|
1
|
+
import type { EntityId, Scalar } from '../treeParameters';
|
|
2
|
+
export declare type ReceivedFieldData = Scalar | ReceivedEntityData | Array<ReceivedEntityData>;
|
|
3
|
+
export declare type ReceivedEntityData = {
|
|
5
4
|
__typename: string;
|
|
6
|
-
|
|
5
|
+
id: EntityId;
|
|
6
|
+
} & {
|
|
7
|
+
[fieldName: string]: ReceivedFieldData;
|
|
7
8
|
};
|
|
8
|
-
export declare type ReceivedData
|
|
9
|
-
export interface ReceivedDataTree
|
|
10
|
-
[treeId: string]: ReceivedData
|
|
9
|
+
export declare type ReceivedData = ReceivedEntityData | ReceivedEntityData[];
|
|
10
|
+
export interface ReceivedDataTree {
|
|
11
|
+
[treeId: string]: ReceivedData | null;
|
|
11
12
|
}
|
|
12
|
-
export interface QueryRequestResponse
|
|
13
|
-
data: ReceivedDataTree
|
|
13
|
+
export interface QueryRequestResponse {
|
|
14
|
+
data: ReceivedDataTree;
|
|
14
15
|
errors?: {
|
|
15
16
|
message: string;
|
|
16
17
|
path?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryRequestResponse.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/QueryRequestResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"QueryRequestResponse.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/QueryRequestResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEzD,oBAAY,iBAAiB,GAAG,MAAM,GAAG,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAA;AAEvF,oBAAY,kBAAkB,GAC3B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,QAAQ,CAAA;CACZ,GACC;IACD,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAAA;CACtC,CAAA;AAEF,oBAAY,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,EAAE,CAAA;AAEpE,MAAM,WAAW,gBAAgB;IAChC,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAAA;CACrC;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAA;CAC/C"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
import { EntityId } from '../treeParameters';
|
|
2
|
+
export declare type UniqueEntityId = string & {
|
|
3
|
+
__type: 'UniqueEntityId';
|
|
4
|
+
};
|
|
1
5
|
export interface RuntimeIdSpec {
|
|
2
6
|
existsOnServer: boolean;
|
|
3
|
-
value:
|
|
7
|
+
value: EntityId;
|
|
8
|
+
uniqueValue: UniqueEntityId;
|
|
4
9
|
}
|
|
5
|
-
export declare class
|
|
6
|
-
readonly value:
|
|
10
|
+
export declare class ServerId implements RuntimeIdSpec {
|
|
11
|
+
readonly value: EntityId;
|
|
12
|
+
readonly entityName: string;
|
|
7
13
|
get existsOnServer(): true;
|
|
8
|
-
constructor(value: string);
|
|
14
|
+
constructor(value: EntityId, entityName: string);
|
|
15
|
+
get uniqueValue(): UniqueEntityId;
|
|
16
|
+
static formatUniqueValue(id: EntityId, entityName: string): UniqueEntityId;
|
|
9
17
|
}
|
|
10
18
|
export declare class ClientGeneratedUuid implements RuntimeIdSpec {
|
|
11
19
|
readonly value: string;
|
|
12
20
|
get existsOnServer(): false;
|
|
13
21
|
constructor(value: string);
|
|
22
|
+
get uniqueValue(): UniqueEntityId;
|
|
14
23
|
}
|
|
15
24
|
export declare class UnpersistedEntityDummyId implements RuntimeIdSpec {
|
|
16
25
|
get existsOnServer(): false;
|
|
@@ -19,7 +28,8 @@ export declare class UnpersistedEntityDummyId implements RuntimeIdSpec {
|
|
|
19
28
|
constructor();
|
|
20
29
|
private static entropyLength;
|
|
21
30
|
private static dummyIdRegex;
|
|
22
|
-
static matchesDummyId(candidate:
|
|
31
|
+
static matchesDummyId(candidate: EntityId): boolean;
|
|
32
|
+
get uniqueValue(): UniqueEntityId;
|
|
23
33
|
}
|
|
24
|
-
export declare type RuntimeId =
|
|
34
|
+
export declare type RuntimeId = ServerId | ClientGeneratedUuid | UnpersistedEntityDummyId;
|
|
25
35
|
//# sourceMappingURL=RuntimeId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeId.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/RuntimeId.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RuntimeId.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/RuntimeId.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,oBAAY,cAAc,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAElE,MAAM,WAAW,aAAa;IAC7B,cAAc,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,QAAQ,CAAA;IACf,WAAW,EAAE,cAAc,CAAA;CAC3B;AAED,qBAAa,QAAS,YAAW,aAAa;aAIV,KAAK,EAAE,QAAQ;aAAkB,UAAU,EAAE,MAAM;IAHtF,IAAW,cAAc,IAAI,IAAI,CAEhC;gBACkC,KAAK,EAAE,QAAQ,EAAkB,UAAU,EAAE,MAAM;IAGtF,IAAI,WAAW,mBAEd;IAED,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc;CAG1E;AAED,qBAAa,mBAAoB,YAAW,aAAa;aAIrB,KAAK,EAAE,MAAM;IAHhD,IAAW,cAAc,IAAI,KAAK,CAEjC;gBACkC,KAAK,EAAE,MAAM;IAEhD,IAAI,WAAW,mBAEd;CACD;AAED,qBAAa,wBAAyB,YAAW,aAAa;IAC7D,IAAW,cAAc,IAAI,KAAK,CAEjC;IACD,SAAgB,KAAK,EAAE,MAAM,CAAA;IAE7B,OAAO,CAAC,MAAM,CAAC,WAAW,CAGtB;;IAWJ,OAAO,CAAC,MAAM,CAAC,aAAa,CAAI;IAChC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAuF;WACpG,cAAc,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO;IAI1D,IAAI,WAAW,mBAEd;CACD;AAED,oBAAY,SAAS,GAAG,QAAQ,GAAG,mBAAmB,GAAG,wBAAwB,CAAA"}
|
|
@@ -13,6 +13,7 @@ export * from './PersistResult';
|
|
|
13
13
|
export * from './QueryRequestResponse';
|
|
14
14
|
export * from './RequestError';
|
|
15
15
|
export * from './RuntimeId';
|
|
16
|
+
export * from './useAccessorTreeState';
|
|
16
17
|
export * from './useDataBinding';
|
|
17
18
|
export * from './useDirtinessState';
|
|
18
19
|
export * from './useMutationState';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccessorTreeState.d.ts","sourceRoot":"","sources":["../../../src/accessorTree/useAccessorTreeState.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,uDAA6C,CAAA"}
|
|
@@ -25,7 +25,7 @@ declare class EntityAccessor implements Errorable {
|
|
|
25
25
|
readonly getAccessor: EntityAccessor.GetEntityAccessor;
|
|
26
26
|
constructor(stateKey: EntityRealmState, operations: EntityOperations, runtimeId: RuntimeId, key: EntityRealmKey, // ⚠️ This is *NOT* the id! ⚠️
|
|
27
27
|
name: EntityName, fieldData: EntityAccessor.FieldData, dataFromServer: SingleEntityPersistedData | undefined, hasUnpersistedChanges: boolean, errors: ErrorAccessor | undefined, environment: Environment, getAccessor: EntityAccessor.GetEntityAccessor);
|
|
28
|
-
get idOnServer():
|
|
28
|
+
get idOnServer(): EntityId | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Note that for entities that don't yet exist on server this will return a dummy id.
|
|
31
31
|
*/
|
|
@@ -48,7 +48,6 @@ declare class EntityAccessor implements Errorable {
|
|
|
48
48
|
getField<Value extends FieldValue = FieldValue>(field: SugaredRelativeSingleField | string): FieldAccessor<Value>;
|
|
49
49
|
getEntity(entity: SugaredRelativeSingleEntity | string): EntityAccessor;
|
|
50
50
|
getEntityList(entityList: SugaredRelativeEntityList | string): EntityListAccessor;
|
|
51
|
-
getKeyConnectedOnServer(entity: SugaredRelativeSingleEntity | string): string | null;
|
|
52
51
|
/**
|
|
53
52
|
* @see EntityAccessor.getField
|
|
54
53
|
*/
|
|
@@ -56,7 +55,6 @@ declare class EntityAccessor implements Errorable {
|
|
|
56
55
|
getRelativeSingleEntity(relativeSingleEntity: RelativeSingleEntity): EntityAccessor;
|
|
57
56
|
getRelativeEntityList(entityList: RelativeEntityList): EntityListAccessor;
|
|
58
57
|
private getAccessorByPlaceholder;
|
|
59
|
-
private getPersistedKeyByPlaceholder;
|
|
60
58
|
}
|
|
61
59
|
declare namespace EntityAccessor {
|
|
62
60
|
interface FieldDatum {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityAccessor.d.ts","sourceRoot":"","sources":["../../../src/accessors/EntityAccessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"EntityAccessor.d.ts","sourceRoot":"","sources":["../../../src/accessors/EntityAccessor.ts"],"names":[],"mappings":"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"}
|