@fluid-experimental/property-properties 0.58.1001 → 0.58.2000-58133

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.
Files changed (223) hide show
  1. package/dist/containerSerializer.d.ts.map +1 -1
  2. package/dist/containerSerializer.js +4 -10
  3. package/dist/containerSerializer.js.map +1 -1
  4. package/dist/enableValidations.d.ts.map +1 -1
  5. package/dist/enableValidations.js +1 -1
  6. package/dist/enableValidations.js.map +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  11. package/dist/properties/abstractStaticCollectionProperty.js +1 -28
  12. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  13. package/dist/properties/arrayProperty.d.ts.map +1 -1
  14. package/dist/properties/arrayProperty.js +26 -85
  15. package/dist/properties/arrayProperty.js.map +1 -1
  16. package/dist/properties/baseProperty.d.ts.map +1 -1
  17. package/dist/properties/baseProperty.js +9 -71
  18. package/dist/properties/baseProperty.js.map +1 -1
  19. package/dist/properties/boolProperty.d.ts.map +1 -1
  20. package/dist/properties/boolProperty.js +0 -1
  21. package/dist/properties/boolProperty.js.map +1 -1
  22. package/dist/properties/containerProperty.d.ts.map +1 -1
  23. package/dist/properties/containerProperty.js +4 -22
  24. package/dist/properties/containerProperty.js.map +1 -1
  25. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  26. package/dist/properties/enumArrayProperty.js +2 -14
  27. package/dist/properties/enumArrayProperty.js.map +1 -1
  28. package/dist/properties/enumProperty.d.ts.map +1 -1
  29. package/dist/properties/enumProperty.js +3 -10
  30. package/dist/properties/enumProperty.js.map +1 -1
  31. package/dist/properties/floatProperties.js +0 -2
  32. package/dist/properties/floatProperties.js.map +1 -1
  33. package/dist/properties/index.d.ts +7 -38
  34. package/dist/properties/index.d.ts.map +1 -1
  35. package/dist/properties/index.js +37 -68
  36. package/dist/properties/index.js.map +1 -1
  37. package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  38. package/dist/properties/indexedCollectionBaseProperty.js +6 -18
  39. package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
  40. package/dist/properties/intProperties.d.ts.map +1 -1
  41. package/dist/properties/intProperties.js +3 -20
  42. package/dist/properties/intProperties.js.map +1 -1
  43. package/dist/properties/lazyLoadedProperties.js.map +1 -1
  44. package/dist/properties/mapProperty.d.ts.map +1 -1
  45. package/dist/properties/mapProperty.js +4 -23
  46. package/dist/properties/mapProperty.js.map +1 -1
  47. package/dist/properties/namedNodeProperty.d.ts.map +1 -1
  48. package/dist/properties/namedNodeProperty.js.map +1 -1
  49. package/dist/properties/namedProperty.d.ts.map +1 -1
  50. package/dist/properties/namedProperty.js +0 -3
  51. package/dist/properties/namedProperty.js.map +1 -1
  52. package/dist/properties/nodeProperty.d.ts.map +1 -1
  53. package/dist/properties/nodeProperty.js +0 -3
  54. package/dist/properties/nodeProperty.js.map +1 -1
  55. package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
  56. package/dist/properties/primitiveTypeCasts.js +2 -2
  57. package/dist/properties/primitiveTypeCasts.js.map +1 -1
  58. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  59. package/dist/properties/referenceArrayProperty.js +3 -16
  60. package/dist/properties/referenceArrayProperty.js.map +1 -1
  61. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  62. package/dist/properties/referenceMapProperty.js +3 -13
  63. package/dist/properties/referenceMapProperty.js.map +1 -1
  64. package/dist/properties/referenceProperty.d.ts.map +1 -1
  65. package/dist/properties/referenceProperty.js +4 -12
  66. package/dist/properties/referenceProperty.js.map +1 -1
  67. package/dist/properties/setProperty.d.ts.map +1 -1
  68. package/dist/properties/setProperty.js +3 -22
  69. package/dist/properties/setProperty.js.map +1 -1
  70. package/dist/properties/stringProperty.d.ts.map +1 -1
  71. package/dist/properties/stringProperty.js +12 -48
  72. package/dist/properties/stringProperty.js.map +1 -1
  73. package/dist/properties/uintProperties.js +0 -3
  74. package/dist/properties/uintProperties.js.map +1 -1
  75. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  76. package/dist/properties/valueArrayProperty.js +3 -45
  77. package/dist/properties/valueArrayProperty.js.map +1 -1
  78. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  79. package/dist/properties/valueMapProperty.js +4 -29
  80. package/dist/properties/valueMapProperty.js.map +1 -1
  81. package/dist/properties/valueProperty.d.ts.map +1 -1
  82. package/dist/properties/valueProperty.js +2 -14
  83. package/dist/properties/valueProperty.js.map +1 -1
  84. package/dist/propertyFactory.d.ts.map +1 -1
  85. package/dist/propertyFactory.js +35 -72
  86. package/dist/propertyFactory.js.map +1 -1
  87. package/dist/propertyTemplate.d.ts.map +1 -1
  88. package/dist/propertyTemplate.js +0 -14
  89. package/dist/propertyTemplate.js.map +1 -1
  90. package/dist/propertyTemplateWrapper.d.ts.map +1 -1
  91. package/dist/propertyTemplateWrapper.js +4 -12
  92. package/dist/propertyTemplateWrapper.js.map +1 -1
  93. package/dist/propertyUtils.d.ts.map +1 -1
  94. package/dist/propertyUtils.js.map +1 -1
  95. package/dist/test/properties/arrayProperty.spec.js +82 -82
  96. package/dist/test/properties/arrayProperty.spec.js.map +1 -1
  97. package/dist/test/properties/baseProperty.spec.js +53 -53
  98. package/dist/test/properties/baseProperty.spec.js.map +1 -1
  99. package/dist/test/properties/containerProperty.spec.js +25 -25
  100. package/dist/test/properties/containerProperty.spec.js.map +1 -1
  101. package/dist/test/properties/customArrayProperty.spec.js +35 -35
  102. package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
  103. package/dist/test/properties/enumArrayProperty.spec.js +6 -6
  104. package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
  105. package/dist/test/properties/enumProperty.spec.js +26 -26
  106. package/dist/test/properties/enumProperty.spec.js.map +1 -1
  107. package/dist/test/properties/float32.spec.js.map +1 -1
  108. package/dist/test/properties/int64ArrayProperty.spec.js +22 -22
  109. package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
  110. package/dist/test/properties/int64MapProperty.spec.js +28 -28
  111. package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
  112. package/dist/test/properties/int64Property.spec.js +11 -11
  113. package/dist/test/properties/int64Property.spec.js.map +1 -1
  114. package/dist/test/properties/isLeafNode.spec.js +25 -25
  115. package/dist/test/properties/isLeafNode.spec.js.map +1 -1
  116. package/dist/test/properties/mapProperty.spec.js +110 -110
  117. package/dist/test/properties/mapProperty.spec.js.map +1 -1
  118. package/dist/test/properties/namedNodeProperty.spec.js +5 -5
  119. package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
  120. package/dist/test/properties/nodeProperty.spec.js +160 -160
  121. package/dist/test/properties/nodeProperty.spec.js.map +1 -1
  122. package/dist/test/properties/referenceProperty.spec.js +21 -21
  123. package/dist/test/properties/referenceProperty.spec.js.map +1 -1
  124. package/dist/test/properties/relationshipProperty.spec.js +4 -4
  125. package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
  126. package/dist/test/properties/setProperty.spec.js +32 -32
  127. package/dist/test/properties/setProperty.spec.js.map +1 -1
  128. package/dist/test/properties/stringProperty.spec.js +38 -38
  129. package/dist/test/properties/stringProperty.spec.js.map +1 -1
  130. package/dist/test/properties/uint64Property.spec.js +3 -3
  131. package/dist/test/properties/uint64Property.spec.js.map +1 -1
  132. package/dist/test/properties/valueMapProperty.spec.js +28 -28
  133. package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
  134. package/dist/test/properties/valueProperty.spec.js +7 -7
  135. package/dist/test/properties/valueProperty.spec.js.map +1 -1
  136. package/dist/test/propertyFactory.spec.js +559 -560
  137. package/dist/test/propertyFactory.spec.js.map +1 -1
  138. package/dist/test/propertyTemplateWrapper.spec.js +38 -38
  139. package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
  140. package/dist/test/propertyUtils.spec.js +5 -5
  141. package/dist/test/propertyUtils.spec.js.map +1 -1
  142. package/dist/test/reversibleChangeset.spec.js +266 -266
  143. package/dist/test/reversibleChangeset.spec.js.map +1 -1
  144. package/dist/test/setup.js.map +1 -1
  145. package/dist/test/tsconfig.tsbuildinfo +145 -145
  146. package/dist/test/utils.spec.js +508 -517
  147. package/dist/test/utils.spec.js.map +1 -1
  148. package/dist/test/validation/badMissingSemverInTypeid.js +9 -9
  149. package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
  150. package/dist/test/validation/badPrimitiveTypeid.js +5 -5
  151. package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
  152. package/dist/test/validation/goodColorId.js +42 -42
  153. package/dist/test/validation/goodColorId.js.map +1 -1
  154. package/dist/test/validation/goodColorPalette.js +2 -2
  155. package/dist/test/validation/goodColorPalette.js.map +1 -1
  156. package/dist/test/validation/goodPointId.js +9 -9
  157. package/dist/test/validation/goodPointId.js.map +1 -1
  158. package/dist/test/validation/reversibleChangeSetTestData.js +1 -1
  159. package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
  160. package/lib/containerSerializer.js +4 -10
  161. package/lib/containerSerializer.js.map +1 -1
  162. package/lib/enableValidations.js +1 -1
  163. package/lib/enableValidations.js.map +1 -1
  164. package/lib/index.js +1 -1
  165. package/lib/index.js.map +1 -1
  166. package/lib/properties/abstractStaticCollectionProperty.js +1 -28
  167. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  168. package/lib/properties/arrayProperty.js +26 -85
  169. package/lib/properties/arrayProperty.js.map +1 -1
  170. package/lib/properties/baseProperty.js +7 -69
  171. package/lib/properties/baseProperty.js.map +1 -1
  172. package/lib/properties/boolProperty.js +0 -1
  173. package/lib/properties/boolProperty.js.map +1 -1
  174. package/lib/properties/containerProperty.js +4 -22
  175. package/lib/properties/containerProperty.js.map +1 -1
  176. package/lib/properties/enumArrayProperty.js +2 -14
  177. package/lib/properties/enumArrayProperty.js.map +1 -1
  178. package/lib/properties/enumProperty.js +3 -10
  179. package/lib/properties/enumProperty.js.map +1 -1
  180. package/lib/properties/floatProperties.js +0 -2
  181. package/lib/properties/floatProperties.js.map +1 -1
  182. package/lib/properties/index.js +7 -38
  183. package/lib/properties/index.js.map +1 -1
  184. package/lib/properties/indexedCollectionBaseProperty.js +6 -18
  185. package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
  186. package/lib/properties/intProperties.js +3 -20
  187. package/lib/properties/intProperties.js.map +1 -1
  188. package/lib/properties/lazyLoadedProperties.js.map +1 -1
  189. package/lib/properties/mapProperty.js +4 -23
  190. package/lib/properties/mapProperty.js.map +1 -1
  191. package/lib/properties/namedNodeProperty.js.map +1 -1
  192. package/lib/properties/namedProperty.js +0 -3
  193. package/lib/properties/namedProperty.js.map +1 -1
  194. package/lib/properties/nodeProperty.js +0 -3
  195. package/lib/properties/nodeProperty.js.map +1 -1
  196. package/lib/properties/primitiveTypeCasts.js +2 -2
  197. package/lib/properties/primitiveTypeCasts.js.map +1 -1
  198. package/lib/properties/referenceArrayProperty.js +3 -16
  199. package/lib/properties/referenceArrayProperty.js.map +1 -1
  200. package/lib/properties/referenceMapProperty.js +3 -13
  201. package/lib/properties/referenceMapProperty.js.map +1 -1
  202. package/lib/properties/referenceProperty.js +4 -12
  203. package/lib/properties/referenceProperty.js.map +1 -1
  204. package/lib/properties/setProperty.js +3 -22
  205. package/lib/properties/setProperty.js.map +1 -1
  206. package/lib/properties/stringProperty.js +12 -48
  207. package/lib/properties/stringProperty.js.map +1 -1
  208. package/lib/properties/uintProperties.js +0 -3
  209. package/lib/properties/uintProperties.js.map +1 -1
  210. package/lib/properties/valueArrayProperty.js +3 -45
  211. package/lib/properties/valueArrayProperty.js.map +1 -1
  212. package/lib/properties/valueMapProperty.js +4 -29
  213. package/lib/properties/valueMapProperty.js.map +1 -1
  214. package/lib/properties/valueProperty.js +2 -14
  215. package/lib/properties/valueProperty.js.map +1 -1
  216. package/lib/propertyFactory.js +35 -72
  217. package/lib/propertyFactory.js.map +1 -1
  218. package/lib/propertyTemplate.js +0 -14
  219. package/lib/propertyTemplate.js.map +1 -1
  220. package/lib/propertyTemplateWrapper.js +4 -12
  221. package/lib/propertyTemplateWrapper.js.map +1 -1
  222. package/lib/propertyUtils.js.map +1 -1
  223. package/package.json +13 -6
@@ -5,11 +5,11 @@
5
5
  /**
6
6
  * @namespace property-properties
7
7
  */
8
+ const { PathHelper } = require('@fluid-experimental/property-changeset');
8
9
  const { LazyLoadedProperties: Property } = require('./properties/lazyLoadedProperties');
9
10
  const { AbstractStaticCollectionProperty } = require('./properties/abstractStaticCollectionProperty');
10
- const { PathHelper } = require('@fluid-experimental/property-changeset');
11
11
  var MSG = {
12
- NOTHING_TO_DESERIALIZE: 'Repository deserialize(), no input given'
12
+ NOTHING_TO_DESERIALIZE: 'Repository deserialize(), no input given',
13
13
  };
14
14
  /**
15
15
  * Dummy property used to return the scope to the underlying properties
@@ -26,14 +26,12 @@ class ScopeProperty extends AbstractStaticCollectionProperty {
26
26
  super(in_params);
27
27
  this._scope = in_params.scope;
28
28
  }
29
- ;
30
29
  /**
31
30
  * @override
32
31
  */
33
32
  _getScope() {
34
33
  return this._scope;
35
34
  }
36
- ;
37
35
  /**
38
36
  * Remove a child property
39
37
  * This is an internal function, called internally by NodeProperty. Removing children dynamically by the user is
@@ -51,7 +49,6 @@ class ScopeProperty extends AbstractStaticCollectionProperty {
51
49
  throw new Error(MSG.REMOVING_NON_EXISTING_ID + in_id);
52
50
  }
53
51
  }
54
- ;
55
52
  }
56
53
  /**
57
54
  * Serialize the input document.
@@ -74,7 +71,6 @@ export function serialize(in_psets, in_dirtyOnly) {
74
71
  }
75
72
  return documentData;
76
73
  }
77
- ;
78
74
  /**
79
75
  * Deserialize the input document
80
76
  * @param {{}} in_data the input JSON document data
@@ -100,7 +96,7 @@ export function deserialize(in_data, in_scope, in_filteringOptions) {
100
96
  case PathHelper.CoverageExtent.PARTLY_COVERED:
101
97
  baseFilteringOptions = {
102
98
  basePath: in_filteringOptions.basePath,
103
- paths: pathCoverage.pathList
99
+ paths: pathCoverage.pathList,
104
100
  };
105
101
  break;
106
102
  case PathHelper.CoverageExtent.UNCOVERED:
@@ -121,7 +117,7 @@ export function deserialize(in_data, in_scope, in_filteringOptions) {
121
117
  // reconstruct entity
122
118
  let filteringOptions = baseFilteringOptions && {
123
119
  basePath: PathHelper.getChildAbsolutePathCanonical(baseFilteringOptions.basePath, classKeys[iClass]),
124
- paths: baseFilteringOptions.paths
120
+ paths: baseFilteringOptions.paths,
125
121
  };
126
122
  // TODO: In theory this could throw when the entity can not be created because it is not included
127
123
  // in the paths. Make sure to handle this case when we'll add that validation.
@@ -141,7 +137,6 @@ export function deserialize(in_data, in_scope, in_filteringOptions) {
141
137
  }
142
138
  return deserializedProperties;
143
139
  }
144
- ;
145
140
  /**
146
141
  * Deserialize the input document assuming it contains elements of a non-primitive array.
147
142
  * @param {array<object>} in_data the input JSON document data
@@ -170,5 +165,4 @@ export function deserializeNonPrimitiveArrayElements(in_data, in_scope) {
170
165
  }
171
166
  return insertedPropertyInstances;
172
167
  }
173
- ;
174
168
  //# sourceMappingURL=containerSerializer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"containerSerializer.js","sourceRoot":"","sources":["../src/containerSerializer.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AACxF,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,+CAA+C,CAAC,CAAA;AACrG,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AAGzE,IAAI,GAAG,GAAG;IACN,sBAAsB,EAAE,0CAA0C;CACrE,CAAC;AAEF;;GAEG;AACH,MAAM,aAAc,SAAQ,gCAAgC;IACxD;;;;OAIG;IACH,YAAY,SAAS;QACjB,qGAAqG;QACrG,6CAA6C;QAC7C,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,I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I,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;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,IAAI,GAAG,GAAG;IACN,sBAAsB,EAAE,0CAA0C;CACrE,CAAC;AAEF;;GAEG;AACH,MAAM,aAAc,SAAQ,gCAAgC;IACxD;;;;OAIG;IACH,YAAY,SAAS;QACjB,qGAAqG;QACrG,6CAA6C;QAC7C,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,SAAS;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,SAAS,EAAE;YAC3C,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,U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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","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"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export let validationsEnabled = {
6
- enabled: true
6
+ enabled: true,
7
7
  };
8
8
  /**
9
9
  * 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;AAEH,MAAM,CAAC,IAAI,kBAAkB,GAAG;IAC5B,OAAO,EAAE,IAAI;CAChB,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAiB;IAC/C,kBAAkB,CAAC,OAAO,GAAG,OAAO,CAAC;AACzC,CAAC","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"]}
1
+ {"version":3,"file":"enableValidations.js","sourceRoot":"","sources":["../src/enableValidations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,IAAI,kBAAkB,GAAG;IAC5B,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAC9C,kBAAkB,CAAC,OAAO,GAAG,OAAO,CAAC;AACzC,CAAC","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/lib/index.js 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.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","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;AAGxD,OAAO,EACH,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACpB,CAAA","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\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
+ {"version":3,"file":"index.js","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;AAExD,OAAO,EACH,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GACpB,CAAC","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"]}
@@ -3,9 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  const _ = require('lodash');
6
- const { BaseProperty } = require('./baseProperty');
7
6
  const { ConsoleUtils, constants } = require('@fluid-experimental/property-common');
8
7
  const { PathHelper, ChangeSet } = require('@fluid-experimental/property-changeset');
8
+ const { BaseProperty } = require('./baseProperty');
9
9
  const { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');
10
10
  const { MSG, PROPERTY_PATH_DELIMITER } = constants;
11
11
  const { BREAK_TRAVERSAL, PATH_TOKENS } = BaseProperty;
@@ -28,7 +28,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
28
28
  }
29
29
  this._constantChildren = {};
30
30
  }
31
- ;
32
31
  /**
33
32
  * Returns the sub-property having the given name, or following the given paths, in this property.
34
33
  *
@@ -94,7 +93,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
94
93
  }
95
94
  return prop;
96
95
  }
97
- ;
98
96
  /**
99
97
  * Returns the sub-property having the given name in this property.
100
98
  *
@@ -105,7 +103,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
105
103
  _get(in_id) {
106
104
  return this._staticChildren[in_id] || this._constantChildren[in_id];
107
105
  }
108
- ;
109
106
  /**
110
107
  * Returns a string identifying the property
111
108
  *
@@ -121,7 +118,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
121
118
  return this.getGuid();
122
119
  }
123
120
  }
124
- ;
125
121
  /**
126
122
  * Returns the GUID of this named property
127
123
  * A Guid is a unique identifier for a branch, commit or repository,
@@ -133,7 +129,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
133
129
  var guid = this.get('guid', { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });
134
130
  return guid ? guid.value : undefined;
135
131
  }
136
- ;
137
132
  /**
138
133
  * returns the value of a sub-property
139
134
  * This is a shortcut for .get(in_ids, in_options).getValue()
@@ -154,7 +149,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
154
149
  ConsoleUtils.assert((property instanceof Property.ValueProperty || property instanceof Property.StringProperty), MSG.GET_VALUE_NOT_A_VALUE + in_ids);
155
150
  return property.getValue();
156
151
  }
157
- ;
158
152
  /**
159
153
  * Get all sub-properties of the current property.
160
154
  * Caller MUST NOT modify the properties.
@@ -171,7 +165,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
171
165
  }
172
166
  return res;
173
167
  }
174
- ;
175
168
  /**
176
169
  * Returns the name of all the sub-properties of this property.
177
170
  *
@@ -180,7 +173,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
180
173
  getIds() {
181
174
  return this._getIds();
182
175
  }
183
- ;
184
176
  /**
185
177
  * Returns the name of all the sub-properties of this property.
186
178
  *
@@ -189,7 +181,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
189
181
  _getIds() {
190
182
  return Object.keys(this._staticChildren).concat(Object.keys(this._constantChildren));
191
183
  }
192
- ;
193
184
  /**
194
185
  * Returns an object with all the nested values contained in this property
195
186
  * @return {object} an object representing the values of your property
@@ -217,7 +208,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
217
208
  }
218
209
  return result;
219
210
  }
220
- ;
221
211
  /**
222
212
  * Checks whether a property with the given name exists
223
213
  *
@@ -227,7 +217,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
227
217
  has(in_id) {
228
218
  return this._get(in_id) !== undefined;
229
219
  }
230
- ;
231
220
  /**
232
221
  * Expand a path returning the property or value at the end.
233
222
  *
@@ -286,7 +275,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
286
275
  }
287
276
  return node;
288
277
  }
289
- ;
290
278
  /**
291
279
  * Returns the path segment for a child
292
280
  *
@@ -298,7 +286,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
298
286
  _getPathSegmentForChildNode(in_childNode) {
299
287
  return PROPERTY_PATH_DELIMITER + PathHelper.quotePathSegmentIfNeeded(in_childNode.getId());
300
288
  }
301
- ;
302
289
  /**
303
290
  * Resolves a direct child node based on the given path segment
304
291
  *
@@ -320,7 +307,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
320
307
  return undefined;
321
308
  }
322
309
  }
323
- ;
324
310
  /**
325
311
  * Given an object that mirrors a PSet Template, assigns the properties to the values
326
312
  * found in that object.
@@ -353,7 +339,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
353
339
  }
354
340
  }
355
341
  }
356
- ;
357
342
  /**
358
343
  * Given an object that mirrors a PSet Template, assigns the properties to the values
359
344
  * found in that object.
@@ -383,7 +368,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
383
368
  AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, false, false);
384
369
  }
385
370
  }
386
- ;
387
371
  /**
388
372
  * Append a child property
389
373
  *
@@ -421,7 +405,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
421
405
  }
422
406
  }
423
407
  }
424
- ;
425
408
  /**
426
409
  * Merge child properties
427
410
  *
@@ -437,7 +420,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
437
420
  this._append(in_property._staticChildren[keys[i]], true);
438
421
  }
439
422
  }
440
- ;
441
423
  /**
442
424
  * @inheritdoc
443
425
  */
@@ -452,7 +434,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
452
434
  }
453
435
  return rtn;
454
436
  }
455
- ;
456
437
  /**
457
438
  * Traverses the property hierarchy downwards until all child properties are reached
458
439
  *
@@ -466,7 +447,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
466
447
  ConsoleUtils.assert(_.isFunction(in_callback), MSG.CALLBACK_NOT_FCT);
467
448
  return this._traverse(in_callback, '');
468
449
  }
469
- ;
470
450
  /**
471
451
  * Traverses all children in the child hierarchy
472
452
  * TODO: How should this behave for collections?
@@ -497,7 +477,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
497
477
  }
498
478
  return undefined;
499
479
  }
500
- ;
501
480
  /**
502
481
  * Traverses all static properties (properties declared in the template and not added dynamically) in the
503
482
  * hierarchy below this node
@@ -524,7 +503,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
524
503
  in_callback(property, childPath);
525
504
  }
526
505
  }
527
- ;
528
506
  /**
529
507
  * Serialize the property into a changeSet
530
508
  *
@@ -572,7 +550,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
572
550
  }
573
551
  return serializedChildren;
574
552
  }
575
- ;
576
553
  /**
577
554
  * Sets the property to the state in the given normalized changeset
578
555
  *
@@ -619,7 +596,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
619
596
  }
620
597
  return changeSet;
621
598
  }
622
- ;
623
599
  /**
624
600
  * Get a flattened, tree like representation of this object and all of it's
625
601
  * descendants. The flattening will stop at primitive properties and collections.
@@ -648,7 +624,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
648
624
  flattenedRepresentation.propertyNode = this;
649
625
  return flattenedRepresentation;
650
626
  }
651
- ;
652
627
  /**
653
628
  * Returns the number of children this node has
654
629
  * @return {number} The number of children
@@ -657,7 +632,6 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
657
632
  _getChildrenCount() {
658
633
  return this._getIds().length;
659
634
  }
660
- ;
661
635
  /**
662
636
  * Sets constants
663
637
  * @param {Object} in_constants - The list of typed values.
@@ -667,6 +641,5 @@ export class AbstractStaticCollectionProperty extends BaseProperty {
667
641
  ' setConstants parameter: in_constants must be an object.');
668
642
  this._constantChildren = in_constants;
669
643
  }
670
- ;
671
644
  }
672
645
  //# sourceMappingURL=abstractStaticCollectionProperty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"abstractStaticCollectionProperty.js","sourceRoot":"","sources":["../../src/properties/abstractStaticCollectionProperty.js"],"names":[],"mappings":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AC,CAAC;QAChE,IAAI,CAAC,iBAAiB,GAAG,YAAY,CAAC;IAC1C,CAAC;IAAA,CAAC;CAEL","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nconst _ = require('lodash');\nconst { BaseProperty } = require('./baseProperty');\nconst { ConsoleUtils, constants } = require('@fluid-experimental/property-common');\nconst { PathHelper, ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nconst { MSG, PROPERTY_PATH_DELIMITER } = constants;\nconst { BREAK_TRAVERSAL, PATH_TOKENS } = BaseProperty;\n/**\n * This class serves as a view to read, write and listen to changes in an\n * object's value field. To do this we simply keep a pointer to the object and\n * its associated data field that we are interested in. If no data field is\n * present this property will fail constructing.\n */\n\nexport class AbstractStaticCollectionProperty extends BaseProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @protected\n */\n constructor(in_params) {\n super(in_params);\n\n // internal management\n if (!this._staticChildren) {\n this._staticChildren = {};\n }\n this._constantChildren = {};\n };\n\n /**\n * Returns the sub-property having the given name, or following the given paths, in this property.\n *\n * @param {string|number|array<string|number>} in_ids the ID or IDs of the property or an array of IDs\n * if an array is passed, the .get function will be performed on each id in sequence\n * for example .get(['position','x']) is equivalent to .get('position').get('x').\n * If .get resolves to a ReferenceProperty, it will, by default, return the property that the\n * ReferenceProperty refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n *\n * @throws if an in_id is neither a string or an array of strings and numbers.\n * @return {property-properties.BaseProperty | undefined} The property you seek or undefined if none is found.\n */\n get(in_ids, in_options) {\n in_options = _.isObject(in_options) ? in_options : {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n\n var prop = this;\n if (typeof in_ids === 'string' ||\n typeof in_ids === 'number') {\n prop = this._get(in_ids);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n if (prop instanceof Property.ReferenceProperty) {\n prop = prop.ref;\n }\n }\n } else if (_.isArray(in_ids)) {\n for (var i = 0; i < in_ids.length && prop; i++) {\n var mode = in_options.referenceResolutionMode;\n // do not do anything with token itself, only changes behavior of path preceding the token;\n if (in_ids[i] === PATH_TOKENS.REF) {\n continue;\n }\n if (mode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS) {\n mode = i !== in_ids.length - 1 ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n if (in_ids[i - 1] === PATH_TOKENS.REF ||\n in_ids[i + 1] === PATH_TOKENS.REF) {\n mode = BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n prop = prop.get(in_ids[i], { referenceResolutionMode: mode });\n if (prop === undefined && i < in_ids.length - 1) {\n return undefined;\n }\n }\n } else if (in_ids === PATH_TOKENS.ROOT) {\n prop = prop.getRoot();\n } else if (in_ids === PATH_TOKENS.UP) {\n prop = prop.getParent();\n } else if (in_ids === PATH_TOKENS.REF) {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n } else {\n throw new Error(MSG.STRING_OR_ARRAY_STRINGS + in_ids);\n }\n\n return prop;\n };\n\n /**\n * Returns the sub-property having the given name in this property.\n *\n * @param {string|number} in_id the id of the prop you wish to retrieve.\n *\n * @return {property-properties.BaseProperty | undefined} The property you seek or undefined if none is found.\n */\n _get(in_id) {\n return this._staticChildren[in_id] || this._constantChildren[in_id];\n };\n\n /**\n * Returns a string identifying the property\n *\n * If an id has been explicitly set on this property we return that one, otherwise the GUID is used.\n *\n * @return {string} String identifying the property\n */\n getId() {\n if (this._id !== null) {\n return this._id;\n } else {\n return this.getGuid();\n }\n };\n\n /**\n * Returns the GUID of this named property\n * A Guid is a unique identifier for a branch, commit or repository,\n * similar to a URN. Most functions in the API will us a URN but the\n * Guid is used to traverse the commit graph.\n * @return {string} The GUID\n */\n getGuid() {\n var guid = this.get('guid', { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n return guid ? guid.value : undefined;\n };\n\n /**\n * returns the value of a sub-property\n * This is a shortcut for .get(in_ids, in_options).getValue()\n * @param {string|number|array<string|number>} in_ids the ID or IDs of the property or an array of IDs\n * if an array is passed, the .get function will be performed on each id in sequence\n * for example .getValue(['position','x']) is equivalent to .get('position').get('x').getValue().\n * If at any point .get resolves to a ReferenceProperty, it will, by default, return the property that the\n * ReferenceProperty refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n * @throws if the in_ids does not resolve to a ValueProperty or StringProperty\n * @throws if in_ids is not a string or an array of strings or numbers.\n * @return {*} The value of the given sub-property\n */\n getValue(in_ids, in_options) {\n var property = this.get(in_ids, in_options);\n ConsoleUtils.assert((property instanceof Property.ValueProperty || property instanceof Property.StringProperty),\n MSG.GET_VALUE_NOT_A_VALUE + in_ids);\n return property.getValue();\n };\n\n\n /**\n * Get all sub-properties of the current property.\n * Caller MUST NOT modify the properties.\n * If entries include References, it will return the reference (will not automatically resolve the reference)\n * @return {Object.<property-properties.BaseProperty>} An object containing all the properties\n */\n getEntriesReadOnly() {\n /* Note that the implementation is voluntarily generic so that derived classes\n should not have to redefine this function. */\n var res = {};\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n res[ids[i]] = this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n }\n return res;\n };\n\n\n /**\n * Returns the name of all the sub-properties of this property.\n *\n * @return {Array.<string>} An array of all the property ids\n */\n getIds() {\n return this._getIds();\n };\n\n /**\n * Returns the name of all the sub-properties of this property.\n *\n * @return {Array.<string>} An array of all the property ids\n */\n _getIds() {\n return Object.keys(this._staticChildren).concat(Object.keys(this._constantChildren));\n };\n\n\n\n /**\n * Returns an object with all the nested values contained in this property\n * @return {object} an object representing the values of your property\n * for example: {\n * position: {\n * x: 2,\n * y: 5\n * }\n * }\n */\n getValues() {\n var ids = this._getIds();\n var result = {};\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n if (_.isUndefined(child)) {\n result[ids[i]] = undefined;\n } else if (child._context === 'single' && child.isPrimitiveType()) {\n result[ids[i]] = child.getValue();\n } else {\n result[ids[i]] = child.getValues();\n }\n }\n return result;\n };\n\n /**\n * Checks whether a property with the given name exists\n *\n * @param {string} in_id - Name of the property\n * @return {boolean} True if the property exists. Otherwise false.\n */\n has(in_id) {\n return this._get(in_id) !== undefined;\n };\n\n /**\n * Expand a path returning the property or value at the end.\n *\n * @param {string} in_path the path\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n * @throws if in_path is not a valid path\n * @return {property-properties.BaseProperty|undefined|*} resolved path\n */\n resolvePath(in_path, in_options) {\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n\n var node = this;\n\n // Tokenize the path string\n var tokenTypes = [];\n var pathArr = PathHelper.tokenizePathString(in_path, tokenTypes);\n\n // Return to the repository root, if the path starts with a root token (a / )\n var iterationStart = 0;\n if (pathArr.length > 0) {\n if (tokenTypes[0] === PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN) {\n node = this.getRoot();\n iterationStart = 1;\n } else if (tokenTypes[0] === PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN) {\n for (var j = 0; j < pathArr.length; j++) {\n if (tokenTypes[j] === PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN) {\n var parent = node.getParent();\n if (parent) {\n node = parent;\n } else {\n return undefined;\n }\n iterationStart++;\n }\n\n }\n }\n }\n\n for (var i = iterationStart; i < pathArr.length && node; i++) {\n if (tokenTypes[i] !== PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN) {\n node = node._resolvePathSegment(pathArr[i], tokenTypes[i]);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS ||\n (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS &&\n i !== pathArr.length - 1)) {\n if (node instanceof Property.ReferenceProperty) {\n if (tokenTypes[i + 1] !== PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN) {\n // recursive function to resolve nested reference properties\n node = node.ref;\n }\n }\n }\n }\n }\n return node;\n\n };\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n *\n * @return {string} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n return PROPERTY_PATH_DELIMITER + PathHelper.quotePathSegmentIfNeeded(in_childNode.getId());\n };\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n // Base Properties only support paths separated via dots\n if (in_segmentType !== PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN) {\n throw new Error(MSG.INVALID_PATH_TOKEN + in_segment);\n }\n\n if (this.has(in_segment)) {\n return this.get(in_segment, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n } else {\n return undefined;\n }\n };\n\n /**\n * Given an object that mirrors a PSet Template, assigns the properties to the values\n * found in that object.\n * @see {setValues}\n * @param {object} in_values The object containing the nested values to assign\n * @param {Bool} in_typed Whether the values are typed/polymorphic.\n * @param {Bool} in_initial - Whether we are setting default/initial values\n or if the function is called directly with the values to set.\n */\n _setValues(in_values, in_typed, in_initial) {\n ConsoleUtils.assert(_.isObject(in_values), MSG.SET_VALUES_PARAM_NOT_OBJECT);\n\n var that = this;\n var keys = Object.keys(in_values);\n\n for (var i = 0; i < keys.length; i++) {\n var propertyKey = keys[i];\n var propertyValue = in_values[propertyKey];\n var property = that.get(propertyKey, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n\n if (property instanceof Property.ValueProperty || property instanceof Property.StringProperty) {\n property.setValue(propertyValue);\n } else if (property instanceof BaseProperty && _.isObject(propertyValue)) {\n property._setValues(propertyValue, in_typed, in_initial);\n } else if (property instanceof BaseProperty) {\n const typeid = property.getTypeid();\n throw new Error(MSG.SET_VALUES_PATH_PROPERTY + propertyKey + ', of type: ' + typeid);\n } else if (property === undefined) {\n throw new Error(MSG.SET_VALUES_PATH_INVALID + propertyKey);\n }\n }\n };\n\n /**\n * Given an object that mirrors a PSet Template, assigns the properties to the values\n * found in that object.\n * eg.\n * <pre>\n * Templates = {\n * properties: [\n * { id: 'foo', typeid: 'String' },\n * { id: 'bar', properties: [{id: 'baz', typeid: 'Uint32'}] }\n * ]\n * }\n * </pre>\n *\n * @param {object} in_values The object containing the nested values to assign\n * @throws if in_values is not an object (or in the case of ArrayProperty, an array)\n * @throws if one of the path in in_values does not correspond to a path in that property\n * @throws if one of the path to a value in in_values leads to a property in this property.\n */\n setValues(in_values) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, false, false);\n }\n };\n\n /**\n * Append a child property\n *\n * This is an internal function, called by the PropertyFactory when instantiating a template and internally by the\n * NodeProperty. Adding children dynamically by the user is only allowed in the NodeProperty.\n *\n * @param {property-properties.BaseProperty} in_property the property to append\n * @param {boolean} in_allowChildMerges - Whether merging of children (nested properties) is allowed.\n * This is used for extending inherited properties.\n * @protected\n * @throws {OVERWRITING_ID} - Thrown when adding a property with an existing id.\n * @throws {OVERRIDDING_INHERITED_TYPES} - Thrown when overriding inherited typed properties.\n */\n _append(in_property, in_allowChildMerges) {\n var id = in_property.getId();\n if (this._staticChildren[id] === undefined) {\n this._staticChildren[id] = in_property;\n in_property._setParent(this);\n } else {\n if (!in_allowChildMerges) {\n throw new Error(MSG.OVERWRITING_ID + id);\n }\n\n // if child is untyped then merge its properties\n if (this._staticChildren[id].getTypeid() === 'AbstractStaticCollectionProperty' &&\n this._staticChildren[id].getContext() === 'single') {\n // if the property's type is different than the child type, throw error.\n if (this._staticChildren[id].getTypeid() !== in_property.getTypeid()) {\n throw new Error(MSG.OVERRIDDING_INHERITED_TYPES + id);\n }\n\n this._staticChildren[id]._merge(in_property);\n } else {\n throw new Error(MSG.OVERRIDDING_INHERITED_TYPES + id);\n }\n }\n };\n\n /**\n * Merge child properties\n *\n * This is an internal function that merges children of two properties.\n * This is used for extending inherited properties.\n *\n * @param {property-properties.BaseProperty} in_property the property to merge its children (nested properties) with.\n * @protected\n */\n _merge(in_property) {\n var keys = Object.keys(in_property._staticChildren);\n\n for (var i = 0; i < keys.length; i++) {\n this._append(in_property._staticChildren[keys[i]], true);\n }\n };\n\n /**\n * @inheritdoc\n */\n _getDirtyChildren(in_flags) {\n var flags = in_flags === undefined ? ~BaseProperty.MODIFIED_STATE_FLAGS.CLEAN : in_flags;\n var rtn = [];\n var childKeys = _.keys(this._staticChildren);\n for (var i = 0; i < childKeys.length; i++) {\n if ((this._get(childKeys[i])._isDirty(flags)) !== 0) {\n rtn.push(childKeys[i]);\n }\n }\n\n return rtn;\n };\n\n /**\n * Traverses the property hierarchy downwards until all child properties are reached\n *\n * @param {Function} in_callback - Callback to invoke for each property. The traversal can be stopped\n * by returning BaseProperty.BREAK_TRAVERSAL\n * @throws if in_callback is not a function.\n * @return {string|undefined} Returns BaseProperty.BREAK_TRAVERSAL if the traversal has been interrupted,\n * otherwise undefined\n */\n traverseDown(in_callback) {\n ConsoleUtils.assert(_.isFunction(in_callback), MSG.CALLBACK_NOT_FCT);\n return this._traverse(in_callback, '');\n };\n\n /**\n * Traverses all children in the child hierarchy\n * TODO: How should this behave for collections?\n *\n * @param {function} in_callback - Callback to invoke for every child\n * @param {string} in_pathFromTraversalStart - Path from the root of the traversal to this node\n * @return {string|undefined} Returns BaseProperty.BREAK_TRAVERSAL if the traversal has been interrupted,\n * otherwise undefined\n * @private\n */\n _traverse(in_callback, in_pathFromTraversalStart) {\n if (in_pathFromTraversalStart) {\n in_pathFromTraversalStart += PROPERTY_PATH_DELIMITER;\n }\n\n var childKeys, child, childPath, result, i;\n\n childKeys = this._getIds();\n for (i = 0; i < childKeys.length; i++) {\n child = this._get(childKeys[i]);\n childPath = in_pathFromTraversalStart + PathHelper.quotePathSegmentIfNeeded(child.getId());\n\n result = in_callback(child, childPath);\n if (result !== BREAK_TRAVERSAL) {\n result = child._traverse(in_callback, childPath);\n if (result !== BREAK_TRAVERSAL) {\n continue;\n }\n }\n return BREAK_TRAVERSAL;\n }\n\n return undefined;\n };\n\n /**\n * Traverses all static properties (properties declared in the template and not added dynamically) in the\n * hierarchy below this node\n *\n * @param {function} in_callback - Callback to invoke for every property\n * @param {string?} in_pathFromTraversalStart - Path from the root of the traversal to this node\n * @protected\n */\n _traverseStaticProperties(in_callback,\n in_pathFromTraversalStart) {\n in_pathFromTraversalStart = in_pathFromTraversalStart || '';\n var propertyKeys = _.keys(this._staticChildren);\n for (var i = 0; i < propertyKeys.length; i++) {\n var property = this._staticChildren[propertyKeys[i]];\n var childPath = in_pathFromTraversalStart +\n (in_pathFromTraversalStart.length !== 0 ? PROPERTY_PATH_DELIMITER : '') +\n PathHelper.quotePathSegmentIfNeeded(property.getId());\n\n // We only recursively traverse ContainerProperties, since these are used to define the hierarchy within\n // one template\n if ((property.getTypeid() === 'AbstractStaticCollectionProperty' ||\n property.getTypeid() === 'ContainerProperty') &&\n property.getContext() === 'single') {\n property._traverseStaticProperties(in_callback, childPath);\n }\n in_callback(property, childPath);\n }\n };\n\n /**\n * Serialize the property into a changeSet\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly,\n in_includeRootTypeid,\n in_dirtinessType,\n in_includeReferencedRepositories) {\n\n var serializedChildren = {};\n var childrenType;\n\n in_dirtyOnly = in_dirtyOnly || false;\n in_dirtinessType = in_dirtinessType === undefined ?\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE : in_dirtinessType;\n\n this._traverseStaticProperties(function (in_node, in_pathFromTraversalStart) {\n\n if (in_dirtyOnly && !in_node._isDirty(in_dirtinessType)) {\n return;\n }\n\n childrenType = in_node.getFullTypeid();\n\n if (childrenType !== 'AbstractStaticCollectionProperty' &&\n childrenType !== 'ContainerProperty') { // we don't want to keep BaseProperties\n // as they mostly behave as 'paths' to\n // a ValueProperty.\n var serialized = in_node._serialize(in_dirtyOnly,\n false,\n in_dirtinessType,\n in_includeReferencedRepositories);\n\n // Add the root typeid if requested\n if (!ChangeSet.isEmptyChangeSet(serialized) || !in_dirtyOnly) {\n if (!serializedChildren[childrenType]) {\n serializedChildren[childrenType] = {};\n }\n serializedChildren[childrenType][in_pathFromTraversalStart] = serialized;\n }\n }\n });\n\n if (in_includeRootTypeid) {\n serializedChildren['typeid'] = this.getFullTypeid();\n }\n\n return serializedChildren;\n };\n\n /**\n * Sets the property to the state in the given normalized changeset\n *\n * @param { property-changeset.SerializedChangeSet} in_serializedObj - The serialized changeset to apply to this node. This\n * has to be an normalized change-set (only containing additions and property assignments. Deletes and Modify\n * must not appear)\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {property-changeset.SerializedChangeSet} ChangeSet with the changes that actually were performed during the\n * deserialization\n */\n _deserialize(in_serializedObj, in_reportToView) {\n\n var changeSet = {};\n\n // Traverse all properties of this template\n this._traverseStaticProperties(function (in_node, in_pathFromTraversalStart) {\n // We do not deserialize base properties, since the traverseStatic function\n // already traverses recursively\n if (in_node.getTypeid() === 'ContainerProperty' && in_node.getContext() === 'single') {\n return;\n }\n\n var typeid = in_node.getFullTypeid();\n\n // Get the ChangeSet\n // If there is a ChangeSet in the serialized object, we use that as the\n // target ChangeSet, otherwise we use an empty ChangeSet (since properties with\n // empty Sub-ChangeSets are removed from the parent ChangeSet, we have to\n // explicitly use an empty ChangeSet for those)\n var propertyChangeSet = {};\n if (in_serializedObj[typeid] !== undefined &&\n in_serializedObj[typeid][in_pathFromTraversalStart] !== undefined) {\n propertyChangeSet = in_serializedObj[typeid][in_pathFromTraversalStart];\n }\n\n // Deserialize the ChangeSet into the property\n var changes = in_node._deserialize(propertyChangeSet, false);\n\n // And track the performed modification in the result\n if (!ChangeSet.isEmptyChangeSet(changes)) {\n changeSet[typeid] = changeSet[typeid] || {};\n changeSet[typeid][in_pathFromTraversalStart] = changes;\n }\n });\n\n // Finally report the dirtiness to the view (we postponed this above)\n if (in_reportToView) {\n this._reportDirtinessToView();\n }\n return changeSet;\n };\n\n /**\n * Get a flattened, tree like representation of this object and all of it's\n * descendants. The flattening will stop at primitive properties and collections.\n *\n * For non-leaf nodes, it is possible to access the corresponding node object itself via the\n * propertyNode member of the flattened representation (warning, this will overwrite a\n * property of this name).\n * TODO: Do we want to have this feature or is it to dangerous?\n *\n * @return {Object} the flat representation\n * @private\n */\n _flatten() {\n var flattenedRepresentation = {};\n var keys = this._getIds();\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var child = this._get(key);\n if (!child._isFlattenLeaf()) {\n flattenedRepresentation[key] = child._flatten();\n } else {\n flattenedRepresentation[key] = child;\n }\n }\n\n flattenedRepresentation.propertyNode = this;\n\n return flattenedRepresentation;\n };\n\n /**\n * Returns the number of children this node has\n * @return {number} The number of children\n * @private\n */\n _getChildrenCount() {\n return this._getIds().length;\n };\n\n /**\n * Sets constants\n * @param {Object} in_constants - The list of typed values.\n */\n _setConstants(in_constants) {\n ConsoleUtils.assert(_.isObject(in_constants), MSG.ASSERTION_FAILED +\n ' setConstants parameter: in_constants must be an object.');\n this._constantChildren = in_constants;\n };\n\n}\n"]}
1
+ {"version":3,"file":"abstractStaticCollectionProperty.js","sourceRoot":"","sources":["../../src/properties/abstractStaticCollectionProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACnF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACpF,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE7E,MAAM,EAAE,GAAG,EAAE,uBAAuB,EAAE,GAAG,SAAS,CAAC;AACnD,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;AACtD;;;;;GAKG;AAEH,MAAM,OAAO,gCAAiC,SAAQ,YAAY;IAC9D;;;OAGG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,sBAAsB;QACtB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACvB,IAAI,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,CAAC,MAAM,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,aAAa,CAAC,YAAY;QACtB,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,gBAAgB;YAC9D,0DAA0D,CAAC,CAAC;QAChE,IAAI,CAAC,iBAAiB,GAAG,YAAY,CAAC;IAC1C,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nconst _ = require('lodash');\nconst { ConsoleUtils, constants } = require('@fluid-experimental/property-common');\nconst { PathHelper, ChangeSet } = require('@fluid-experimental/property-changeset');\nconst { BaseProperty } = require('./baseProperty');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nconst { MSG, PROPERTY_PATH_DELIMITER } = constants;\nconst { BREAK_TRAVERSAL, PATH_TOKENS } = BaseProperty;\n/**\n * This class serves as a view to read, write and listen to changes in an\n * object's value field. To do this we simply keep a pointer to the object and\n * its associated data field that we are interested in. If no data field is\n * present this property will fail constructing.\n */\n\nexport class AbstractStaticCollectionProperty extends BaseProperty {\n /**\n * @param {Object=} in_params - the parameters\n * @protected\n */\n constructor(in_params) {\n super(in_params);\n\n // internal management\n if (!this._staticChildren) {\n this._staticChildren = {};\n }\n this._constantChildren = {};\n }\n\n /**\n * Returns the sub-property having the given name, or following the given paths, in this property.\n *\n * @param {string|number|array<string|number>} in_ids the ID or IDs of the property or an array of IDs\n * if an array is passed, the .get function will be performed on each id in sequence\n * for example .get(['position','x']) is equivalent to .get('position').get('x').\n * If .get resolves to a ReferenceProperty, it will, by default, return the property that the\n * ReferenceProperty refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n *\n * @throws if an in_id is neither a string or an array of strings and numbers.\n * @return {property-properties.BaseProperty | undefined} The property you seek or undefined if none is found.\n */\n get(in_ids, in_options) {\n in_options = _.isObject(in_options) ? in_options : {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n\n var prop = this;\n if (typeof in_ids === 'string' ||\n typeof in_ids === 'number') {\n prop = this._get(in_ids);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n if (prop instanceof Property.ReferenceProperty) {\n prop = prop.ref;\n }\n }\n } else if (_.isArray(in_ids)) {\n for (var i = 0; i < in_ids.length && prop; i++) {\n var mode = in_options.referenceResolutionMode;\n // do not do anything with token itself, only changes behavior of path preceding the token;\n if (in_ids[i] === PATH_TOKENS.REF) {\n continue;\n }\n if (mode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS) {\n mode = i !== in_ids.length - 1 ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n if (in_ids[i - 1] === PATH_TOKENS.REF ||\n in_ids[i + 1] === PATH_TOKENS.REF) {\n mode = BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n prop = prop.get(in_ids[i], { referenceResolutionMode: mode });\n if (prop === undefined && i < in_ids.length - 1) {\n return undefined;\n }\n }\n } else if (in_ids === PATH_TOKENS.ROOT) {\n prop = prop.getRoot();\n } else if (in_ids === PATH_TOKENS.UP) {\n prop = prop.getParent();\n } else if (in_ids === PATH_TOKENS.REF) {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n } else {\n throw new Error(MSG.STRING_OR_ARRAY_STRINGS + in_ids);\n }\n\n return prop;\n }\n\n /**\n * Returns the sub-property having the given name in this property.\n *\n * @param {string|number} in_id the id of the prop you wish to retrieve.\n *\n * @return {property-properties.BaseProperty | undefined} The property you seek or undefined if none is found.\n */\n _get(in_id) {\n return this._staticChildren[in_id] || this._constantChildren[in_id];\n }\n\n /**\n * Returns a string identifying the property\n *\n * If an id has been explicitly set on this property we return that one, otherwise the GUID is used.\n *\n * @return {string} String identifying the property\n */\n getId() {\n if (this._id !== null) {\n return this._id;\n } else {\n return this.getGuid();\n }\n }\n\n /**\n * Returns the GUID of this named property\n * A Guid is a unique identifier for a branch, commit or repository,\n * similar to a URN. Most functions in the API will us a URN but the\n * Guid is used to traverse the commit graph.\n * @return {string} The GUID\n */\n getGuid() {\n var guid = this.get('guid', { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n return guid ? guid.value : undefined;\n }\n\n /**\n * returns the value of a sub-property\n * This is a shortcut for .get(in_ids, in_options).getValue()\n * @param {string|number|array<string|number>} in_ids the ID or IDs of the property or an array of IDs\n * if an array is passed, the .get function will be performed on each id in sequence\n * for example .getValue(['position','x']) is equivalent to .get('position').get('x').getValue().\n * If at any point .get resolves to a ReferenceProperty, it will, by default, return the property that the\n * ReferenceProperty refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n * @throws if the in_ids does not resolve to a ValueProperty or StringProperty\n * @throws if in_ids is not a string or an array of strings or numbers.\n * @return {*} The value of the given sub-property\n */\n getValue(in_ids, in_options) {\n var property = this.get(in_ids, in_options);\n ConsoleUtils.assert((property instanceof Property.ValueProperty || property instanceof Property.StringProperty),\n MSG.GET_VALUE_NOT_A_VALUE + in_ids);\n return property.getValue();\n }\n\n /**\n * Get all sub-properties of the current property.\n * Caller MUST NOT modify the properties.\n * If entries include References, it will return the reference (will not automatically resolve the reference)\n * @return {Object.<property-properties.BaseProperty>} An object containing all the properties\n */\n getEntriesReadOnly() {\n /* Note that the implementation is voluntarily generic so that derived classes\n should not have to redefine this function. */\n var res = {};\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n res[ids[i]] = this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n }\n return res;\n }\n\n /**\n * Returns the name of all the sub-properties of this property.\n *\n * @return {Array.<string>} An array of all the property ids\n */\n getIds() {\n return this._getIds();\n }\n\n /**\n * Returns the name of all the sub-properties of this property.\n *\n * @return {Array.<string>} An array of all the property ids\n */\n _getIds() {\n return Object.keys(this._staticChildren).concat(Object.keys(this._constantChildren));\n }\n\n /**\n * Returns an object with all the nested values contained in this property\n * @return {object} an object representing the values of your property\n * for example: {\n * position: {\n * x: 2,\n * y: 5\n * }\n * }\n */\n getValues() {\n var ids = this._getIds();\n var result = {};\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n if (_.isUndefined(child)) {\n result[ids[i]] = undefined;\n } else if (child._context === 'single' && child.isPrimitiveType()) {\n result[ids[i]] = child.getValue();\n } else {\n result[ids[i]] = child.getValues();\n }\n }\n return result;\n }\n\n /**\n * Checks whether a property with the given name exists\n *\n * @param {string} in_id - Name of the property\n * @return {boolean} True if the property exists. Otherwise false.\n */\n has(in_id) {\n return this._get(in_id) !== undefined;\n }\n\n /**\n * Expand a path returning the property or value at the end.\n *\n * @param {string} in_path the path\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]\n * How should this function behave during reference resolution?\n * @throws if in_path is not a valid path\n * @return {property-properties.BaseProperty|undefined|*} resolved path\n */\n resolvePath(in_path, in_options) {\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n\n var node = this;\n\n // Tokenize the path string\n var tokenTypes = [];\n var pathArr = PathHelper.tokenizePathString(in_path, tokenTypes);\n\n // Return to the repository root, if the path starts with a root token (a / )\n var iterationStart = 0;\n if (pathArr.length > 0) {\n if (tokenTypes[0] === PathHelper.TOKEN_TYPES.PATH_ROOT_TOKEN) {\n node = this.getRoot();\n iterationStart = 1;\n } else if (tokenTypes[0] === PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN) {\n for (var j = 0; j < pathArr.length; j++) {\n if (tokenTypes[j] === PathHelper.TOKEN_TYPES.RAISE_LEVEL_TOKEN) {\n var parent = node.getParent();\n if (parent) {\n node = parent;\n } else {\n return undefined;\n }\n iterationStart++;\n }\n }\n }\n }\n\n for (var i = iterationStart; i < pathArr.length && node; i++) {\n if (tokenTypes[i] !== PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN) {\n node = node._resolvePathSegment(pathArr[i], tokenTypes[i]);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS ||\n (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS &&\n i !== pathArr.length - 1)) {\n if (node instanceof Property.ReferenceProperty) {\n if (tokenTypes[i + 1] !== PathHelper.TOKEN_TYPES.DEREFERENCE_TOKEN) {\n // recursive function to resolve nested reference properties\n node = node.ref;\n }\n }\n }\n }\n }\n return node;\n }\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n *\n * @return {string} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n return PROPERTY_PATH_DELIMITER + PathHelper.quotePathSegmentIfNeeded(in_childNode.getId());\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n // Base Properties only support paths separated via dots\n if (in_segmentType !== PathHelper.TOKEN_TYPES.PATH_SEGMENT_TOKEN) {\n throw new Error(MSG.INVALID_PATH_TOKEN + in_segment);\n }\n\n if (this.has(in_segment)) {\n return this.get(in_segment, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n } else {\n return undefined;\n }\n }\n\n /**\n * Given an object that mirrors a PSet Template, assigns the properties to the values\n * found in that object.\n * @see {setValues}\n * @param {object} in_values The object containing the nested values to assign\n * @param {Bool} in_typed Whether the values are typed/polymorphic.\n * @param {Bool} in_initial - Whether we are setting default/initial values\n or if the function is called directly with the values to set.\n */\n _setValues(in_values, in_typed, in_initial) {\n ConsoleUtils.assert(_.isObject(in_values), MSG.SET_VALUES_PARAM_NOT_OBJECT);\n\n var that = this;\n var keys = Object.keys(in_values);\n\n for (var i = 0; i < keys.length; i++) {\n var propertyKey = keys[i];\n var propertyValue = in_values[propertyKey];\n var property = that.get(propertyKey, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n\n if (property instanceof Property.ValueProperty || property instanceof Property.StringProperty) {\n property.setValue(propertyValue);\n } else if (property instanceof BaseProperty && _.isObject(propertyValue)) {\n property._setValues(propertyValue, in_typed, in_initial);\n } else if (property instanceof BaseProperty) {\n const typeid = property.getTypeid();\n throw new Error(MSG.SET_VALUES_PATH_PROPERTY + propertyKey + ', of type: ' + typeid);\n } else if (property === undefined) {\n throw new Error(MSG.SET_VALUES_PATH_INVALID + propertyKey);\n }\n }\n }\n\n /**\n * Given an object that mirrors a PSet Template, assigns the properties to the values\n * found in that object.\n * eg.\n * <pre>\n * Templates = {\n * properties: [\n * { id: 'foo', typeid: 'String' },\n * { id: 'bar', properties: [{id: 'baz', typeid: 'Uint32'}] }\n * ]\n * }\n * </pre>\n *\n * @param {object} in_values The object containing the nested values to assign\n * @throws if in_values is not an object (or in the case of ArrayProperty, an array)\n * @throws if one of the path in in_values does not correspond to a path in that property\n * @throws if one of the path to a value in in_values leads to a property in this property.\n */\n setValues(in_values) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, false, false);\n }\n }\n\n /**\n * Append a child property\n *\n * This is an internal function, called by the PropertyFactory when instantiating a template and internally by the\n * NodeProperty. Adding children dynamically by the user is only allowed in the NodeProperty.\n *\n * @param {property-properties.BaseProperty} in_property the property to append\n * @param {boolean} in_allowChildMerges - Whether merging of children (nested properties) is allowed.\n * This is used for extending inherited properties.\n * @protected\n * @throws {OVERWRITING_ID} - Thrown when adding a property with an existing id.\n * @throws {OVERRIDDING_INHERITED_TYPES} - Thrown when overriding inherited typed properties.\n */\n _append(in_property, in_allowChildMerges) {\n var id = in_property.getId();\n if (this._staticChildren[id] === undefined) {\n this._staticChildren[id] = in_property;\n in_property._setParent(this);\n } else {\n if (!in_allowChildMerges) {\n throw new Error(MSG.OVERWRITING_ID + id);\n }\n\n // if child is untyped then merge its properties\n if (this._staticChildren[id].getTypeid() === 'AbstractStaticCollectionProperty' &&\n this._staticChildren[id].getContext() === 'single') {\n // if the property's type is different than the child type, throw error.\n if (this._staticChildren[id].getTypeid() !== in_property.getTypeid()) {\n throw new Error(MSG.OVERRIDDING_INHERITED_TYPES + id);\n }\n\n this._staticChildren[id]._merge(in_property);\n } else {\n throw new Error(MSG.OVERRIDDING_INHERITED_TYPES + id);\n }\n }\n }\n\n /**\n * Merge child properties\n *\n * This is an internal function that merges children of two properties.\n * This is used for extending inherited properties.\n *\n * @param {property-properties.BaseProperty} in_property the property to merge its children (nested properties) with.\n * @protected\n */\n _merge(in_property) {\n var keys = Object.keys(in_property._staticChildren);\n\n for (var i = 0; i < keys.length; i++) {\n this._append(in_property._staticChildren[keys[i]], true);\n }\n }\n\n /**\n * @inheritdoc\n */\n _getDirtyChildren(in_flags) {\n var flags = in_flags === undefined ? ~BaseProperty.MODIFIED_STATE_FLAGS.CLEAN : in_flags;\n var rtn = [];\n var childKeys = _.keys(this._staticChildren);\n for (var i = 0; i < childKeys.length; i++) {\n if ((this._get(childKeys[i])._isDirty(flags)) !== 0) {\n rtn.push(childKeys[i]);\n }\n }\n\n return rtn;\n }\n\n /**\n * Traverses the property hierarchy downwards until all child properties are reached\n *\n * @param {Function} in_callback - Callback to invoke for each property. The traversal can be stopped\n * by returning BaseProperty.BREAK_TRAVERSAL\n * @throws if in_callback is not a function.\n * @return {string|undefined} Returns BaseProperty.BREAK_TRAVERSAL if the traversal has been interrupted,\n * otherwise undefined\n */\n traverseDown(in_callback) {\n ConsoleUtils.assert(_.isFunction(in_callback), MSG.CALLBACK_NOT_FCT);\n return this._traverse(in_callback, '');\n }\n\n /**\n * Traverses all children in the child hierarchy\n * TODO: How should this behave for collections?\n *\n * @param {function} in_callback - Callback to invoke for every child\n * @param {string} in_pathFromTraversalStart - Path from the root of the traversal to this node\n * @return {string|undefined} Returns BaseProperty.BREAK_TRAVERSAL if the traversal has been interrupted,\n * otherwise undefined\n * @private\n */\n _traverse(in_callback, in_pathFromTraversalStart) {\n if (in_pathFromTraversalStart) {\n in_pathFromTraversalStart += PROPERTY_PATH_DELIMITER;\n }\n\n var childKeys, child, childPath, result, i;\n\n childKeys = this._getIds();\n for (i = 0; i < childKeys.length; i++) {\n child = this._get(childKeys[i]);\n childPath = in_pathFromTraversalStart + PathHelper.quotePathSegmentIfNeeded(child.getId());\n\n result = in_callback(child, childPath);\n if (result !== BREAK_TRAVERSAL) {\n result = child._traverse(in_callback, childPath);\n if (result !== BREAK_TRAVERSAL) {\n continue;\n }\n }\n return BREAK_TRAVERSAL;\n }\n\n return undefined;\n }\n\n /**\n * Traverses all static properties (properties declared in the template and not added dynamically) in the\n * hierarchy below this node\n *\n * @param {function} in_callback - Callback to invoke for every property\n * @param {string?} in_pathFromTraversalStart - Path from the root of the traversal to this node\n * @protected\n */\n _traverseStaticProperties(in_callback,\n in_pathFromTraversalStart) {\n in_pathFromTraversalStart = in_pathFromTraversalStart || '';\n var propertyKeys = _.keys(this._staticChildren);\n for (var i = 0; i < propertyKeys.length; i++) {\n var property = this._staticChildren[propertyKeys[i]];\n var childPath = in_pathFromTraversalStart +\n (in_pathFromTraversalStart.length !== 0 ? PROPERTY_PATH_DELIMITER : '') +\n PathHelper.quotePathSegmentIfNeeded(property.getId());\n\n // We only recursively traverse ContainerProperties, since these are used to define the hierarchy within\n // one template\n if ((property.getTypeid() === 'AbstractStaticCollectionProperty' ||\n property.getTypeid() === 'ContainerProperty') &&\n property.getContext() === 'single') {\n property._traverseStaticProperties(in_callback, childPath);\n }\n in_callback(property, childPath);\n }\n }\n\n /**\n * Serialize the property into a changeSet\n *\n * @param {boolean} in_dirtyOnly -\n * Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid -\n * Include the typeid of the root of the hierarchy\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] -\n * The type of dirtiness to use when reporting dirty changes. By default this is\n * PENDING_CHANGE\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the serialize\n * function will descend into referenced repositories. WARNING: if there are loops in the references\n * this can result in an infinite loop\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly,\n in_includeRootTypeid,\n in_dirtinessType,\n in_includeReferencedRepositories) {\n var serializedChildren = {};\n var childrenType;\n\n in_dirtyOnly = in_dirtyOnly || false;\n in_dirtinessType = in_dirtinessType === undefined ?\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE : in_dirtinessType;\n\n this._traverseStaticProperties(function(in_node, in_pathFromTraversalStart) {\n if (in_dirtyOnly && !in_node._isDirty(in_dirtinessType)) {\n return;\n }\n\n childrenType = in_node.getFullTypeid();\n\n if (childrenType !== 'AbstractStaticCollectionProperty' &&\n childrenType !== 'ContainerProperty') { // we don't want to keep BaseProperties\n // as they mostly behave as 'paths' to\n // a ValueProperty.\n var serialized = in_node._serialize(in_dirtyOnly,\n false,\n in_dirtinessType,\n in_includeReferencedRepositories);\n\n // Add the root typeid if requested\n if (!ChangeSet.isEmptyChangeSet(serialized) || !in_dirtyOnly) {\n if (!serializedChildren[childrenType]) {\n serializedChildren[childrenType] = {};\n }\n serializedChildren[childrenType][in_pathFromTraversalStart] = serialized;\n }\n }\n });\n\n if (in_includeRootTypeid) {\n serializedChildren['typeid'] = this.getFullTypeid();\n }\n\n return serializedChildren;\n }\n\n /**\n * Sets the property to the state in the given normalized changeset\n *\n * @param { property-changeset.SerializedChangeSet} in_serializedObj - The serialized changeset to apply to this node. This\n * has to be an normalized change-set (only containing additions and property assignments. Deletes and Modify\n * must not appear)\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this\n * can be prevented via this flag.\n * @return {property-changeset.SerializedChangeSet} ChangeSet with the changes that actually were performed during the\n * deserialization\n */\n _deserialize(in_serializedObj, in_reportToView) {\n var changeSet = {};\n\n // Traverse all properties of this template\n this._traverseStaticProperties(function(in_node, in_pathFromTraversalStart) {\n // We do not deserialize base properties, since the traverseStatic function\n // already traverses recursively\n if (in_node.getTypeid() === 'ContainerProperty' && in_node.getContext() === 'single') {\n return;\n }\n\n var typeid = in_node.getFullTypeid();\n\n // Get the ChangeSet\n // If there is a ChangeSet in the serialized object, we use that as the\n // target ChangeSet, otherwise we use an empty ChangeSet (since properties with\n // empty Sub-ChangeSets are removed from the parent ChangeSet, we have to\n // explicitly use an empty ChangeSet for those)\n var propertyChangeSet = {};\n if (in_serializedObj[typeid] !== undefined &&\n in_serializedObj[typeid][in_pathFromTraversalStart] !== undefined) {\n propertyChangeSet = in_serializedObj[typeid][in_pathFromTraversalStart];\n }\n\n // Deserialize the ChangeSet into the property\n var changes = in_node._deserialize(propertyChangeSet, false);\n\n // And track the performed modification in the result\n if (!ChangeSet.isEmptyChangeSet(changes)) {\n changeSet[typeid] = changeSet[typeid] || {};\n changeSet[typeid][in_pathFromTraversalStart] = changes;\n }\n });\n\n // Finally report the dirtiness to the view (we postponed this above)\n if (in_reportToView) {\n this._reportDirtinessToView();\n }\n return changeSet;\n }\n\n /**\n * Get a flattened, tree like representation of this object and all of it's\n * descendants. The flattening will stop at primitive properties and collections.\n *\n * For non-leaf nodes, it is possible to access the corresponding node object itself via the\n * propertyNode member of the flattened representation (warning, this will overwrite a\n * property of this name).\n * TODO: Do we want to have this feature or is it to dangerous?\n *\n * @return {Object} the flat representation\n * @private\n */\n _flatten() {\n var flattenedRepresentation = {};\n var keys = this._getIds();\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var child = this._get(key);\n if (!child._isFlattenLeaf()) {\n flattenedRepresentation[key] = child._flatten();\n } else {\n flattenedRepresentation[key] = child;\n }\n }\n\n flattenedRepresentation.propertyNode = this;\n\n return flattenedRepresentation;\n }\n\n /**\n * Returns the number of children this node has\n * @return {number} The number of children\n * @private\n */\n _getChildrenCount() {\n return this._getIds().length;\n }\n\n /**\n * Sets constants\n * @param {Object} in_constants - The list of typed values.\n */\n _setConstants(in_constants) {\n ConsoleUtils.assert(_.isObject(in_constants), MSG.ASSERTION_FAILED +\n ' setConstants parameter: in_constants must be an object.');\n this._constantChildren = in_constants;\n }\n}\n"]}