@fluid-experimental/property-properties 0.58.1000 → 0.58.2000
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/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +4 -10
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.d.ts.map +1 -1
- package/dist/enableValidations.js +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +1 -28
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +26 -85
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +9 -71
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +0 -1
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +4 -22
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +2 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +3 -10
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +0 -2
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +7 -38
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js +37 -68
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +6 -18
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +3 -20
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +4 -23
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +0 -3
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +0 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +2 -2
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +3 -16
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +3 -13
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +4 -12
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +3 -22
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +12 -48
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +0 -3
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +3 -45
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +4 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +2 -14
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +35 -72
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +0 -14
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +4 -12
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +82 -82
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +53 -53
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +25 -25
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +35 -35
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +6 -6
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +26 -26
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +22 -22
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +28 -28
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +11 -11
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +25 -25
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +110 -110
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +5 -5
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +160 -160
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +21 -21
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +4 -4
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +32 -32
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +38 -38
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +3 -3
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +28 -28
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +7 -7
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +559 -560
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +38 -38
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +5 -5
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +266 -266
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +145 -145
- package/dist/test/utils.spec.js +508 -517
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +9 -9
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +5 -5
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +42 -42
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +2 -2
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +9 -9
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.js +4 -10
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +1 -28
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.js +26 -85
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.js +7 -69
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.js +0 -1
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.js +4 -22
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.js +2 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.js +3 -10
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +0 -2
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.js +7 -38
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +6 -18
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.js +3 -20
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.js +4 -23
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.js +0 -3
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.js +0 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +2 -2
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.js +3 -16
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.js +3 -13
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.js +4 -12
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.js +3 -22
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.js +12 -48
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +0 -3
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.js +3 -45
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.js +4 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.js +2 -14
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.js +35 -72
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.js +0 -14
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.js +4 -12
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +13 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerSerializer.d.ts","sourceRoot":"","sources":["../src/containerSerializer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"containerSerializer.d.ts","sourceRoot":"","sources":["../src/containerSerializer.js"],"names":[],"mappings":"AAwDA;;;;;;GAMG;AACH,oCALW,UAAmB,sBAElB,EAAE,CAmBb;AAED;;;;;;;;GAQG;AACH,qCAPW,EAAE,YACF,MAAM,GAAC,SAAS,6BAGf,EAAE,CAsEb;AACD;;;;;;GAMG;AACH,6EAJW,MAAM,GAAC,SAAS,OAiC1B"}
|
|
@@ -8,11 +8,11 @@ exports.deserializeNonPrimitiveArrayElements = exports.deserialize = exports.ser
|
|
|
8
8
|
/**
|
|
9
9
|
* @namespace property-properties
|
|
10
10
|
*/
|
|
11
|
+
const { PathHelper } = require('@fluid-experimental/property-changeset');
|
|
11
12
|
const { LazyLoadedProperties: Property } = require('./properties/lazyLoadedProperties');
|
|
12
13
|
const { AbstractStaticCollectionProperty } = require('./properties/abstractStaticCollectionProperty');
|
|
13
|
-
const { PathHelper } = require('@fluid-experimental/property-changeset');
|
|
14
14
|
var MSG = {
|
|
15
|
-
NOTHING_TO_DESERIALIZE: 'Repository deserialize(), no input given'
|
|
15
|
+
NOTHING_TO_DESERIALIZE: 'Repository deserialize(), no input given',
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Dummy property used to return the scope to the underlying properties
|
|
@@ -29,14 +29,12 @@ class ScopeProperty extends AbstractStaticCollectionProperty {
|
|
|
29
29
|
super(in_params);
|
|
30
30
|
this._scope = in_params.scope;
|
|
31
31
|
}
|
|
32
|
-
;
|
|
33
32
|
/**
|
|
34
33
|
* @override
|
|
35
34
|
*/
|
|
36
35
|
_getScope() {
|
|
37
36
|
return this._scope;
|
|
38
37
|
}
|
|
39
|
-
;
|
|
40
38
|
/**
|
|
41
39
|
* Remove a child property
|
|
42
40
|
* This is an internal function, called internally by NodeProperty. Removing children dynamically by the user is
|
|
@@ -54,7 +52,6 @@ class ScopeProperty extends AbstractStaticCollectionProperty {
|
|
|
54
52
|
throw new Error(MSG.REMOVING_NON_EXISTING_ID + in_id);
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
;
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* Serialize the input document.
|
|
@@ -78,7 +75,6 @@ function serialize(in_psets, in_dirtyOnly) {
|
|
|
78
75
|
return documentData;
|
|
79
76
|
}
|
|
80
77
|
exports.serialize = serialize;
|
|
81
|
-
;
|
|
82
78
|
/**
|
|
83
79
|
* Deserialize the input document
|
|
84
80
|
* @param {{}} in_data the input JSON document data
|
|
@@ -104,7 +100,7 @@ function deserialize(in_data, in_scope, in_filteringOptions) {
|
|
|
104
100
|
case PathHelper.CoverageExtent.PARTLY_COVERED:
|
|
105
101
|
baseFilteringOptions = {
|
|
106
102
|
basePath: in_filteringOptions.basePath,
|
|
107
|
-
paths: pathCoverage.pathList
|
|
103
|
+
paths: pathCoverage.pathList,
|
|
108
104
|
};
|
|
109
105
|
break;
|
|
110
106
|
case PathHelper.CoverageExtent.UNCOVERED:
|
|
@@ -125,7 +121,7 @@ function deserialize(in_data, in_scope, in_filteringOptions) {
|
|
|
125
121
|
// reconstruct entity
|
|
126
122
|
let filteringOptions = baseFilteringOptions && {
|
|
127
123
|
basePath: PathHelper.getChildAbsolutePathCanonical(baseFilteringOptions.basePath, classKeys[iClass]),
|
|
128
|
-
paths: baseFilteringOptions.paths
|
|
124
|
+
paths: baseFilteringOptions.paths,
|
|
129
125
|
};
|
|
130
126
|
// TODO: In theory this could throw when the entity can not be created because it is not included
|
|
131
127
|
// in the paths. Make sure to handle this case when we'll add that validation.
|
|
@@ -146,7 +142,6 @@ function deserialize(in_data, in_scope, in_filteringOptions) {
|
|
|
146
142
|
return deserializedProperties;
|
|
147
143
|
}
|
|
148
144
|
exports.deserialize = deserialize;
|
|
149
|
-
;
|
|
150
145
|
/**
|
|
151
146
|
* Deserialize the input document assuming it contains elements of a non-primitive array.
|
|
152
147
|
* @param {array<object>} in_data the input JSON document data
|
|
@@ -176,5 +171,4 @@ function deserializeNonPrimitiveArrayElements(in_data, in_scope) {
|
|
|
176
171
|
return insertedPropertyInstances;
|
|
177
172
|
}
|
|
178
173
|
exports.deserializeNonPrimitiveArrayElements = deserializeNonPrimitiveArrayElements;
|
|
179
|
-
;
|
|
180
174
|
//# sourceMappingURL=containerSerializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerSerializer.js","sourceRoot":"","sources":["../src/containerSerializer.js"],"names":[],"mappings":";;;AAAA;;;GAGG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AyB,CAAC;AACrC,CAAC;AA9BD,oFA8BC;AAAA,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @namespace property-properties\n */\nconst { LazyLoadedProperties: Property } = require('./properties/lazyLoadedProperties');\nconst { AbstractStaticCollectionProperty } = require('./properties/abstractStaticCollectionProperty')\nconst { PathHelper } = require('@fluid-experimental/property-changeset');\n\n\nvar MSG = {\n NOTHING_TO_DESERIALIZE: 'Repository deserialize(), no input given'\n};\n\n/**\n * Dummy property used to return the scope to the underlying properties\n */\nclass ScopeProperty extends AbstractStaticCollectionProperty {\n /**\n * @param {object} in_params BaseProperty parameters\n * @param {string} in_params.scope The scope to keep track of\n * @constructor\n */\n constructor(in_params) {\n // HACK: Normally, we would inherit from NodeProperty however, NodeProperty seems to not be available\n // at this point. There may be a bug with MR.\n super(in_params);\n this._scope = in_params.scope;\n };\n\n\n /**\n * @override\n */\n _getScope() {\n return this._scope;\n };\n\n /**\n * Remove a child property\n * This is an internal function, called internally by NodeProperty. Removing children dynamically by the user is\n * only allowed in the NodeProperty.\n *\n * @param {String} in_id - the id of the property to remove\n * @protected\n */\n _remove(in_id) {\n if (this._staticChildren[in_id] !== undefined) {\n this._staticChildren[in_id]._setParent(undefined);\n delete this._staticChildren[in_id];\n } else {\n throw new Error(MSG.REMOVING_NON_EXISTING_ID + in_id);\n }\n };\n}\n\n/**\n * Serialize the input document.\n * @param {Array<BaseProperty>} in_psets property set\n * @param {bool} in_dirtyOnly serialize dirty properties only\n * @return {{}} JSON data of the document\n * @alias property-properties.serialize\n */\nexport function serialize(in_psets, in_dirtyOnly) {\n\n in_dirtyOnly = in_dirtyOnly || false;\n\n var documentData = {};\n var rootTypeid;\n\n var keys = Object.keys(in_psets);\n for (var i = 0; i < keys.length; i++) {\n rootTypeid = in_psets[keys[i]].getTypeid();\n if (!documentData[rootTypeid]) {\n documentData[rootTypeid] = {};\n }\n documentData[rootTypeid][keys[i]] = in_psets[keys[i]].serialize(in_dirtyOnly);\n }\n\n\n return documentData;\n};\n\n/**\n * Deserialize the input document\n * @param {{}} in_data the input JSON document data\n * @param {string|undefined} in_scope The scope to construct the properties from\n * @param {property-properties.BaseProperty.PathFilteringOptions} [in_filteringOptions]\n * The options to selectively create only a subset of a property. Creates all properties if undefined.\n * @return {{}} an object of guid : pset\n * @alias property-properties.deserialize\n */\nexport function deserialize(in_data, in_scope, in_filteringOptions) {\n\n if (!in_data) {\n console.warn(MSG.NOTHING_TO_DESERIALIZE);\n return {};\n }\n\n // From the given filtering options, keep only what is relevant for this property.\n let baseFilteringOptions;\n if (in_filteringOptions) {\n let pathCoverage = PathHelper.getPathCoverage(in_filteringOptions.basePath, in_filteringOptions.paths);\n switch (pathCoverage.coverageExtent) {\n case PathHelper.CoverageExtent.FULLY_COVERED:\n // No need for filtering options anymore, keep them undefined.\n break;\n case PathHelper.CoverageExtent.PARTLY_COVERED:\n baseFilteringOptions = {\n basePath: in_filteringOptions.basePath,\n paths: pathCoverage.pathList\n };\n break;\n case PathHelper.CoverageExtent.UNCOVERED:\n // No need to create anything, it is outside the paths.\n return {};\n default:\n break;\n }\n }\n\n var deserializedProperties = {};\n var typeid, entity, classed;\n\n var dataKeys = Object.keys(in_data);\n for (var iData = 0; iData < dataKeys.length; iData++) {\n typeid = dataKeys[iData];\n classed = in_data[typeid];\n var classKeys = Object.keys(classed);\n for (var iClass = 0; iClass < classKeys.length; iClass++) {\n // reconstruct entity\n let filteringOptions = baseFilteringOptions && {\n basePath: PathHelper.getChildAbsolutePathCanonical(baseFilteringOptions.basePath, classKeys[iClass]),\n paths: baseFilteringOptions.paths\n };\n // TODO: In theory this could throw when the entity can not be created because it is not included\n // in the paths. Make sure to handle this case when we'll add that validation.\n entity = Property.PropertyFactory._createProperty(typeid, null, undefined, in_scope, filteringOptions);\n\n // Store the id prior to calling entity.deserialize() since it is subject to change afterwards\n var id = entity.getId();\n\n // Create a scope property which captures the scope that was passed in as arguments\n // so that it can be picked up downstream by the respective deserialize functions\n var scopeProperty = new ScopeProperty({ scope: in_scope });\n\n scopeProperty._append(entity, false);\n\n entity.deserialize(classed[classKeys[iClass]], filteringOptions, false);\n\n scopeProperty._remove(id);\n\n entity._id = classKeys[iClass];\n\n // keep track of the reconstructed entities\n deserializedProperties[classKeys[iClass]] = entity;\n }\n }\n\n return deserializedProperties;\n};\n/**\n * Deserialize the input document assuming it contains elements of a non-primitive array.\n * @param {array<object>} in_data the input JSON document data\n * @param {string|undefined} in_scope The scope to construct the properties from\n * @return {array<BaseProperty>} an array of psets\n * @alias property-properties.deserializeNonPrimitiveArrayElements\n */\nexport function deserializeNonPrimitiveArrayElements(in_data, in_scope) {\n\n if (!in_data) {\n console.warn(MSG.NOTHING_TO_DESERIALIZE);\n return [];\n }\n\n var insertedPropertyInstances = [];\n for (var i = 0; i < in_data.length; ++i) {\n // reconstruct entity\n var createdProperty = Property.PropertyFactory._createProperty(\n in_data[i]['typeid'], null, undefined, in_scope);\n\n var id = createdProperty.getId();\n\n // Create a scope property which captures the scope that was passed in as argument\n // so that it can be picked up downstream by the respective deserialize functions\n var scopeProperty = new ScopeProperty({ scope: in_scope });\n\n scopeProperty._append(createdProperty, false);\n\n createdProperty._deserialize(in_data[i], false, undefined, false);\n\n scopeProperty._remove(id);\n\n // keep track of the reconstructed entities\n insertedPropertyInstances.push(createdProperty);\n }\n\n return insertedPropertyInstances;\n};\n\n"]}
|
|
1
|
+
{"version":3,"file":"containerSerializer.js","sourceRoot":"","sources":["../src/containerSerializer.js"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACzE,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AACxF,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,+CAA+C,CAAC,CAAC;AAEtG,IA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AoC,CAAC,OAAO,EAAE,QAAQ;IAClE,IAAI,CAAC,OAAO,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC;KACb;IAED,IAAI,yBAAyB,GAAG,EAAE,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACrC,qBAAqB;QACrB,IAAI,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,eAAe,CAC1D,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAErD,IAAI,EAAE,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC;QAEjC,kFAAkF;QAClF,iFAAiF;QACjF,IAAI,aAAa,GAAG,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE3D,aAAa,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QAE9C,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAElE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE1B,2CAA2C;QAC3C,yBAAyB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACnD;IAED,OAAO,yBAAyB,CAAC;AACrC,CAAC;AA7BD,oFA6BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @namespace property-properties\n */\nconst { PathHelper } = require('@fluid-experimental/property-changeset');\nconst { LazyLoadedProperties: Property } = require('./properties/lazyLoadedProperties');\nconst { AbstractStaticCollectionProperty } = require('./properties/abstractStaticCollectionProperty');\n\nvar MSG = {\n NOTHING_TO_DESERIALIZE: 'Repository deserialize(), no input given',\n};\n\n/**\n * Dummy property used to return the scope to the underlying properties\n */\nclass ScopeProperty extends AbstractStaticCollectionProperty {\n /**\n * @param {object} in_params BaseProperty parameters\n * @param {string} in_params.scope The scope to keep track of\n * @constructor\n */\n constructor(in_params) {\n // HACK: Normally, we would inherit from NodeProperty however, NodeProperty seems to not be available\n // at this point. There may be a bug with MR.\n super(in_params);\n this._scope = in_params.scope;\n }\n\n /**\n * @override\n */\n _getScope() {\n return this._scope;\n }\n\n /**\n * Remove a child property\n * This is an internal function, called internally by NodeProperty. Removing children dynamically by the user is\n * only allowed in the NodeProperty.\n *\n * @param {String} in_id - the id of the property to remove\n * @protected\n */\n _remove(in_id) {\n if (this._staticChildren[in_id] !== undefined) {\n this._staticChildren[in_id]._setParent(undefined);\n delete this._staticChildren[in_id];\n } else {\n throw new Error(MSG.REMOVING_NON_EXISTING_ID + in_id);\n }\n }\n}\n\n/**\n * Serialize the input document.\n * @param {Array<BaseProperty>} in_psets property set\n * @param {bool} in_dirtyOnly serialize dirty properties only\n * @return {{}} JSON data of the document\n * @alias property-properties.serialize\n */\nexport function serialize(in_psets, in_dirtyOnly) {\n in_dirtyOnly = in_dirtyOnly || false;\n\n var documentData = {};\n var rootTypeid;\n\n var keys = Object.keys(in_psets);\n for (var i = 0; i < keys.length; i++) {\n rootTypeid = in_psets[keys[i]].getTypeid();\n if (!documentData[rootTypeid]) {\n documentData[rootTypeid] = {};\n }\n documentData[rootTypeid][keys[i]] = in_psets[keys[i]].serialize(in_dirtyOnly);\n }\n\n return documentData;\n}\n\n/**\n * Deserialize the input document\n * @param {{}} in_data the input JSON document data\n * @param {string|undefined} in_scope The scope to construct the properties from\n * @param {property-properties.BaseProperty.PathFilteringOptions} [in_filteringOptions]\n * The options to selectively create only a subset of a property. Creates all properties if undefined.\n * @return {{}} an object of guid : pset\n * @alias property-properties.deserialize\n */\nexport function deserialize(in_data, in_scope, in_filteringOptions) {\n if (!in_data) {\n console.warn(MSG.NOTHING_TO_DESERIALIZE);\n return {};\n }\n\n // From the given filtering options, keep only what is relevant for this property.\n let baseFilteringOptions;\n if (in_filteringOptions) {\n let pathCoverage = PathHelper.getPathCoverage(in_filteringOptions.basePath, in_filteringOptions.paths);\n switch (pathCoverage.coverageExtent) {\n case PathHelper.CoverageExtent.FULLY_COVERED:\n // No need for filtering options anymore, keep them undefined.\n break;\n case PathHelper.CoverageExtent.PARTLY_COVERED:\n baseFilteringOptions = {\n basePath: in_filteringOptions.basePath,\n paths: pathCoverage.pathList,\n };\n break;\n case PathHelper.CoverageExtent.UNCOVERED:\n // No need to create anything, it is outside the paths.\n return {};\n default:\n break;\n }\n }\n\n var deserializedProperties = {};\n var typeid, entity, classed;\n\n var dataKeys = Object.keys(in_data);\n for (var iData = 0; iData < dataKeys.length; iData++) {\n typeid = dataKeys[iData];\n classed = in_data[typeid];\n var classKeys = Object.keys(classed);\n for (var iClass = 0; iClass < classKeys.length; iClass++) {\n // reconstruct entity\n let filteringOptions = baseFilteringOptions && {\n basePath: PathHelper.getChildAbsolutePathCanonical(baseFilteringOptions.basePath, classKeys[iClass]),\n paths: baseFilteringOptions.paths,\n };\n // TODO: In theory this could throw when the entity can not be created because it is not included\n // in the paths. Make sure to handle this case when we'll add that validation.\n entity = Property.PropertyFactory._createProperty(typeid, null, undefined, in_scope, filteringOptions);\n\n // Store the id prior to calling entity.deserialize() since it is subject to change afterwards\n var id = entity.getId();\n\n // Create a scope property which captures the scope that was passed in as arguments\n // so that it can be picked up downstream by the respective deserialize functions\n var scopeProperty = new ScopeProperty({ scope: in_scope });\n\n scopeProperty._append(entity, false);\n\n entity.deserialize(classed[classKeys[iClass]], filteringOptions, false);\n\n scopeProperty._remove(id);\n\n entity._id = classKeys[iClass];\n\n // keep track of the reconstructed entities\n deserializedProperties[classKeys[iClass]] = entity;\n }\n }\n\n return deserializedProperties;\n}\n/**\n * Deserialize the input document assuming it contains elements of a non-primitive array.\n * @param {array<object>} in_data the input JSON document data\n * @param {string|undefined} in_scope The scope to construct the properties from\n * @return {array<BaseProperty>} an array of psets\n * @alias property-properties.deserializeNonPrimitiveArrayElements\n */\nexport function deserializeNonPrimitiveArrayElements(in_data, in_scope) {\n if (!in_data) {\n console.warn(MSG.NOTHING_TO_DESERIALIZE);\n return [];\n }\n\n var insertedPropertyInstances = [];\n for (var i = 0; i < in_data.length; ++i) {\n // reconstruct entity\n var createdProperty = Property.PropertyFactory._createProperty(\n in_data[i]['typeid'], null, undefined, in_scope);\n\n var id = createdProperty.getId();\n\n // Create a scope property which captures the scope that was passed in as argument\n // so that it can be picked up downstream by the respective deserialize functions\n var scopeProperty = new ScopeProperty({ scope: in_scope });\n\n scopeProperty._append(createdProperty, false);\n\n createdProperty._deserialize(in_data[i], false, undefined, false);\n\n scopeProperty._remove(id);\n\n // keep track of the reconstructed entities\n insertedPropertyInstances.push(createdProperty);\n }\n\n return insertedPropertyInstances;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enableValidations.d.ts","sourceRoot":"","sources":["../src/enableValidations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,IAAI,kBAAkB;;CAE5B,
|
|
1
|
+
{"version":3,"file":"enableValidations.d.ts","sourceRoot":"","sources":["../src/enableValidations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,IAAI,kBAAkB;;CAE5B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,QAEjD"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.enableValidations = exports.validationsEnabled = void 0;
|
|
8
8
|
exports.validationsEnabled = {
|
|
9
|
-
enabled: true
|
|
9
|
+
enabled: true,
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Switch off validation to increase performance (but you risk modifying read only properties, creating cycles in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enableValidations.js","sourceRoot":"","sources":["../src/enableValidations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEQ,QAAA,kBAAkB,GAAG;IAC5B,OAAO,EAAE,IAAI;CAChB,
|
|
1
|
+
{"version":3,"file":"enableValidations.js","sourceRoot":"","sources":["../src/enableValidations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEQ,QAAA,kBAAkB,GAAG;IAC5B,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,OAAgB;IAC9C,0BAAkB,CAAC,OAAO,GAAG,OAAO,CAAC;AACzC,CAAC;AAFD,8CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport let validationsEnabled = {\n enabled: true,\n};\n\n/**\n * Switch off validation to increase performance (but you risk modifying read only properties, creating cycles in\n * the tree, etc...)\n *\n * @param enabled - Are the validations enabled?\n */\nexport function enableValidations(enabled: boolean) {\n validationsEnabled.enabled = enabled;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,5 +21,5 @@ import { ValueArrayProperty } from './properties/valueArrayProperty';
|
|
|
21
21
|
import { ValueMapProperty } from './properties/valueMapProperty';
|
|
22
22
|
import { ValueProperty } from './properties/valueProperty';
|
|
23
23
|
import { enableValidations } from './enableValidations';
|
|
24
|
-
export { PropertyFactory, PropertyUtils, BaseProperty, ContainerProperty, MapProperty, NodeProperty, ArrayProperty, SetProperty, StringProperty, ReferenceProperty, ReferenceMapProperty, ReferenceArrayProperty, Uint64Property, EnumArrayProperty, EnumProperty, Int64Property, ValueArrayProperty, ValueMapProperty, ValueProperty, enableValidations };
|
|
24
|
+
export { PropertyFactory, PropertyUtils, BaseProperty, ContainerProperty, MapProperty, NodeProperty, ArrayProperty, SetProperty, StringProperty, ReferenceProperty, ReferenceMapProperty, ReferenceArrayProperty, Uint64Property, EnumArrayProperty, EnumProperty, Int64Property, ValueArrayProperty, ValueMapProperty, ValueProperty, enableValidations, };
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRo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B,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GACpB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAoD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAoD;AAqBhD,gGArBK,iCAAe,OAqBL;AApBnB,mDAAgD;AAqB5C,8FArBK,6BAAa,OAqBL;AApBjB,4DAAyD;AAqBrD,6FArBK,2BAAY,OAqBL;AApBhB,sEAAmE;AAqB/D,kGArBK,qCAAiB,OAqBL;AApBrB,0DAAuD;AAqBnD,4FArBK,yBAAW,OAqBL;AApBf,4DAAyD;AAqBrD,6FArBK,2BAAY,OAqBL;AApBhB,8DAA2D;AAqBvD,8FArBK,6BAAa,OAqBL;AApBjB,0DAAuD;AAqBnD,4FArBK,yBAAW,OAqBL;AApBf,gEAA6D;AAqBzD,+FArBK,+BAAc,OAqBL;AApBlB,sEAAmE;AAqB/D,kGArBK,qCAAiB,OAqBL;AApBrB,gFAA6E;AAsBzE,uGAtBK,+CAAsB,OAsBL;AArB1B,4EAAyE;AAoBrE,qGApBK,2CAAoB,OAoBL;AAnBxB,sEAAmE;AAsB/D,kGAtBK,qCAAiB,OAsBL;AArBrB,4DAAyD;AAsBrD,6FAtBK,2BAAY,OAsBL;AArBhB,8DAA2E;AAsBvE,8FAtBK,6BAAa,OAsBL;AAHb,+FAnBoB,8BAAc,OAmBpB;AAlBlB,wEAAqE;AAsBjE,mGAtBK,uCAAkB,OAsBL;AArBtB,oEAAiE;AAsB7D,iGAtBK,mCAAgB,OAsBL;AArBpB,8DAA2D;AAsBvD,8FAtBK,6BAAa,OAsBL;AArBjB,2DAAwD;AAsBpD,kGAtBK,qCAAiB,OAsBL","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { PropertyFactory } from './propertyFactory';\nimport { PropertyUtils } from './propertyUtils';\nimport { BaseProperty } from './properties/baseProperty';\nimport { ContainerProperty } from './properties/containerProperty';\nimport { MapProperty } from './properties/mapProperty';\nimport { NodeProperty } from './properties/nodeProperty';\nimport { ArrayProperty } from './properties/arrayProperty';\nimport { SetProperty } from './properties/setProperty';\nimport { StringProperty } from './properties/stringProperty';\nimport { ReferenceProperty } from './properties/referenceProperty';\nimport { ReferenceArrayProperty } from './properties/referenceArrayProperty';\nimport { ReferenceMapProperty } from './properties/referenceMapProperty';\nimport { EnumArrayProperty } from './properties/enumArrayProperty';\nimport { EnumProperty } from './properties/enumProperty';\nimport { Int64Property, Uint64Property } from './properties/intProperties';\nimport { ValueArrayProperty } from './properties/valueArrayProperty';\nimport { ValueMapProperty } from './properties/valueMapProperty';\nimport { ValueProperty } from './properties/valueProperty';\nimport { enableValidations } from './enableValidations';\n\nexport {\n PropertyFactory,\n PropertyUtils,\n BaseProperty,\n ContainerProperty,\n MapProperty,\n NodeProperty,\n ArrayProperty,\n SetProperty,\n StringProperty,\n ReferenceProperty,\n ReferenceMapProperty,\n ReferenceArrayProperty,\n Uint64Property,\n EnumArrayProperty,\n EnumProperty,\n Int64Property,\n ValueArrayProperty,\n ValueMapProperty,\n ValueProperty,\n enableValidations,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractStaticCollectionProperty.d.ts","sourceRoot":"","sources":["../../src/properties/abstractStaticCollectionProperty.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AAEH;IACI;;;OAGG;IACH,wBAQC;IAHO,oBAAyB;IAE7B,sBAA2B;IAkE/B;;;;;;OAMG;IACH,YAJY,MAAM,GAAC,MAAM,OAMxB;IAiBD;;;;;;OAMG;IACH,WAFY,MAAM,CAKjB;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAZY,MAAM,GAAC,MAAM,MAAqB,wBAiB7C;
|
|
1
|
+
{"version":3,"file":"abstractStaticCollectionProperty.d.ts","sourceRoot":"","sources":["../../src/properties/abstractStaticCollectionProperty.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AAEH;IACI;;;OAGG;IACH,wBAQC;IAHO,oBAAyB;IAE7B,sBAA2B;IAkE/B;;;;;;OAMG;IACH,YAJY,MAAM,GAAC,MAAM,OAMxB;IAiBD;;;;;;OAMG;IACH,WAFY,MAAM,CAKjB;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAZY,MAAM,GAAC,MAAM,MAAqB,wBAiB7C;IAED;;;;;OAKG;IACH,0BASC;IAWD;;;;OAIG;IACH,WAFY,MAAO,MAAM,CAAC,CAIzB;IAED;;;;;;;;;OASG;IACH,aARY,MAAM,CAsBjB;IAED;;;;;OAKG;IACH,WAHW,MAAM,GACL,OAAO,CAIlB;IAiGD;;;;;;;;OAQG;IACH,sBALW,MAAM,wCA2BhB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,qBALW,MAAM,QAchB;IAED;;;;;;;;;;;;OAYG;IACH,yDANW,OAAO,QA6BjB;IAED;;;;;;;;MAQE;IACF,yCAMC;IAmED;;;;;;;OAOG;IACH,sFAHW,MAAM,eAsBhB;IAkJD;;;;OAIG;IACH,0BAEC;IAED;;;OAGG;IACH,uCAIC;CACJ"}
|
|
@@ -6,9 +6,9 @@ exports.AbstractStaticCollectionProperty = void 0;
|
|
|
6
6
|
* Licensed under the MIT License.
|
|
7
7
|
*/
|
|
8
8
|
const _ = require('lodash');
|
|
9
|
-
const { BaseProperty } = require('./baseProperty');
|
|
10
9
|
const { ConsoleUtils, constants } = require('@fluid-experimental/property-common');
|
|
11
10
|
const { PathHelper, ChangeSet } = require('@fluid-experimental/property-changeset');
|
|
11
|
+
const { BaseProperty } = require('./baseProperty');
|
|
12
12
|
const { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');
|
|
13
13
|
const { MSG, PROPERTY_PATH_DELIMITER } = constants;
|
|
14
14
|
const { BREAK_TRAVERSAL, PATH_TOKENS } = BaseProperty;
|
|
@@ -31,7 +31,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
31
31
|
}
|
|
32
32
|
this._constantChildren = {};
|
|
33
33
|
}
|
|
34
|
-
;
|
|
35
34
|
/**
|
|
36
35
|
* Returns the sub-property having the given name, or following the given paths, in this property.
|
|
37
36
|
*
|
|
@@ -97,7 +96,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
97
96
|
}
|
|
98
97
|
return prop;
|
|
99
98
|
}
|
|
100
|
-
;
|
|
101
99
|
/**
|
|
102
100
|
* Returns the sub-property having the given name in this property.
|
|
103
101
|
*
|
|
@@ -108,7 +106,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
108
106
|
_get(in_id) {
|
|
109
107
|
return this._staticChildren[in_id] || this._constantChildren[in_id];
|
|
110
108
|
}
|
|
111
|
-
;
|
|
112
109
|
/**
|
|
113
110
|
* Returns a string identifying the property
|
|
114
111
|
*
|
|
@@ -124,7 +121,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
124
121
|
return this.getGuid();
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
|
-
;
|
|
128
124
|
/**
|
|
129
125
|
* Returns the GUID of this named property
|
|
130
126
|
* A Guid is a unique identifier for a branch, commit or repository,
|
|
@@ -136,7 +132,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
136
132
|
var guid = this.get('guid', { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });
|
|
137
133
|
return guid ? guid.value : undefined;
|
|
138
134
|
}
|
|
139
|
-
;
|
|
140
135
|
/**
|
|
141
136
|
* returns the value of a sub-property
|
|
142
137
|
* This is a shortcut for .get(in_ids, in_options).getValue()
|
|
@@ -157,7 +152,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
157
152
|
ConsoleUtils.assert((property instanceof Property.ValueProperty || property instanceof Property.StringProperty), MSG.GET_VALUE_NOT_A_VALUE + in_ids);
|
|
158
153
|
return property.getValue();
|
|
159
154
|
}
|
|
160
|
-
;
|
|
161
155
|
/**
|
|
162
156
|
* Get all sub-properties of the current property.
|
|
163
157
|
* Caller MUST NOT modify the properties.
|
|
@@ -174,7 +168,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
174
168
|
}
|
|
175
169
|
return res;
|
|
176
170
|
}
|
|
177
|
-
;
|
|
178
171
|
/**
|
|
179
172
|
* Returns the name of all the sub-properties of this property.
|
|
180
173
|
*
|
|
@@ -183,7 +176,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
183
176
|
getIds() {
|
|
184
177
|
return this._getIds();
|
|
185
178
|
}
|
|
186
|
-
;
|
|
187
179
|
/**
|
|
188
180
|
* Returns the name of all the sub-properties of this property.
|
|
189
181
|
*
|
|
@@ -192,7 +184,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
192
184
|
_getIds() {
|
|
193
185
|
return Object.keys(this._staticChildren).concat(Object.keys(this._constantChildren));
|
|
194
186
|
}
|
|
195
|
-
;
|
|
196
187
|
/**
|
|
197
188
|
* Returns an object with all the nested values contained in this property
|
|
198
189
|
* @return {object} an object representing the values of your property
|
|
@@ -220,7 +211,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
220
211
|
}
|
|
221
212
|
return result;
|
|
222
213
|
}
|
|
223
|
-
;
|
|
224
214
|
/**
|
|
225
215
|
* Checks whether a property with the given name exists
|
|
226
216
|
*
|
|
@@ -230,7 +220,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
230
220
|
has(in_id) {
|
|
231
221
|
return this._get(in_id) !== undefined;
|
|
232
222
|
}
|
|
233
|
-
;
|
|
234
223
|
/**
|
|
235
224
|
* Expand a path returning the property or value at the end.
|
|
236
225
|
*
|
|
@@ -289,7 +278,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
289
278
|
}
|
|
290
279
|
return node;
|
|
291
280
|
}
|
|
292
|
-
;
|
|
293
281
|
/**
|
|
294
282
|
* Returns the path segment for a child
|
|
295
283
|
*
|
|
@@ -301,7 +289,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
301
289
|
_getPathSegmentForChildNode(in_childNode) {
|
|
302
290
|
return PROPERTY_PATH_DELIMITER + PathHelper.quotePathSegmentIfNeeded(in_childNode.getId());
|
|
303
291
|
}
|
|
304
|
-
;
|
|
305
292
|
/**
|
|
306
293
|
* Resolves a direct child node based on the given path segment
|
|
307
294
|
*
|
|
@@ -323,7 +310,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
323
310
|
return undefined;
|
|
324
311
|
}
|
|
325
312
|
}
|
|
326
|
-
;
|
|
327
313
|
/**
|
|
328
314
|
* Given an object that mirrors a PSet Template, assigns the properties to the values
|
|
329
315
|
* found in that object.
|
|
@@ -356,7 +342,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
356
342
|
}
|
|
357
343
|
}
|
|
358
344
|
}
|
|
359
|
-
;
|
|
360
345
|
/**
|
|
361
346
|
* Given an object that mirrors a PSet Template, assigns the properties to the values
|
|
362
347
|
* found in that object.
|
|
@@ -386,7 +371,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
386
371
|
AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, false, false);
|
|
387
372
|
}
|
|
388
373
|
}
|
|
389
|
-
;
|
|
390
374
|
/**
|
|
391
375
|
* Append a child property
|
|
392
376
|
*
|
|
@@ -424,7 +408,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
424
408
|
}
|
|
425
409
|
}
|
|
426
410
|
}
|
|
427
|
-
;
|
|
428
411
|
/**
|
|
429
412
|
* Merge child properties
|
|
430
413
|
*
|
|
@@ -440,7 +423,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
440
423
|
this._append(in_property._staticChildren[keys[i]], true);
|
|
441
424
|
}
|
|
442
425
|
}
|
|
443
|
-
;
|
|
444
426
|
/**
|
|
445
427
|
* @inheritdoc
|
|
446
428
|
*/
|
|
@@ -455,7 +437,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
455
437
|
}
|
|
456
438
|
return rtn;
|
|
457
439
|
}
|
|
458
|
-
;
|
|
459
440
|
/**
|
|
460
441
|
* Traverses the property hierarchy downwards until all child properties are reached
|
|
461
442
|
*
|
|
@@ -469,7 +450,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
469
450
|
ConsoleUtils.assert(_.isFunction(in_callback), MSG.CALLBACK_NOT_FCT);
|
|
470
451
|
return this._traverse(in_callback, '');
|
|
471
452
|
}
|
|
472
|
-
;
|
|
473
453
|
/**
|
|
474
454
|
* Traverses all children in the child hierarchy
|
|
475
455
|
* TODO: How should this behave for collections?
|
|
@@ -500,7 +480,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
500
480
|
}
|
|
501
481
|
return undefined;
|
|
502
482
|
}
|
|
503
|
-
;
|
|
504
483
|
/**
|
|
505
484
|
* Traverses all static properties (properties declared in the template and not added dynamically) in the
|
|
506
485
|
* hierarchy below this node
|
|
@@ -527,7 +506,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
527
506
|
in_callback(property, childPath);
|
|
528
507
|
}
|
|
529
508
|
}
|
|
530
|
-
;
|
|
531
509
|
/**
|
|
532
510
|
* Serialize the property into a changeSet
|
|
533
511
|
*
|
|
@@ -575,7 +553,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
575
553
|
}
|
|
576
554
|
return serializedChildren;
|
|
577
555
|
}
|
|
578
|
-
;
|
|
579
556
|
/**
|
|
580
557
|
* Sets the property to the state in the given normalized changeset
|
|
581
558
|
*
|
|
@@ -622,7 +599,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
622
599
|
}
|
|
623
600
|
return changeSet;
|
|
624
601
|
}
|
|
625
|
-
;
|
|
626
602
|
/**
|
|
627
603
|
* Get a flattened, tree like representation of this object and all of it's
|
|
628
604
|
* descendants. The flattening will stop at primitive properties and collections.
|
|
@@ -651,7 +627,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
651
627
|
flattenedRepresentation.propertyNode = this;
|
|
652
628
|
return flattenedRepresentation;
|
|
653
629
|
}
|
|
654
|
-
;
|
|
655
630
|
/**
|
|
656
631
|
* Returns the number of children this node has
|
|
657
632
|
* @return {number} The number of children
|
|
@@ -660,7 +635,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
660
635
|
_getChildrenCount() {
|
|
661
636
|
return this._getIds().length;
|
|
662
637
|
}
|
|
663
|
-
;
|
|
664
638
|
/**
|
|
665
639
|
* Sets constants
|
|
666
640
|
* @param {Object} in_constants - The list of typed values.
|
|
@@ -670,7 +644,6 @@ class AbstractStaticCollectionProperty extends BaseProperty {
|
|
|
670
644
|
' setConstants parameter: in_constants must be an object.');
|
|
671
645
|
this._constantChildren = in_constants;
|
|
672
646
|
}
|
|
673
|
-
;
|
|
674
647
|
}
|
|
675
648
|
exports.AbstractStaticCollectionProperty = AbstractStaticCollectionProperty;
|
|
676
649
|
//# sourceMappingURL=abstractStaticCollectionProperty.js.map
|