@itwin/presentation-common 5.0.0-dev.57 → 5.0.0-dev.58

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 (226) hide show
  1. package/Ruleset.schema.json +3 -258
  2. package/lib/cjs/presentation-common/EC.d.ts +5 -80
  3. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  4. package/lib/cjs/presentation-common/EC.js +1 -97
  5. package/lib/cjs/presentation-common/EC.js.map +1 -1
  6. package/lib/cjs/presentation-common/KeySet.d.ts +2 -2
  7. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  8. package/lib/cjs/presentation-common/KeySet.js +4 -11
  9. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  10. package/lib/cjs/presentation-common/LabelDefinition.d.ts +0 -48
  11. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  12. package/lib/cjs/presentation-common/LabelDefinition.js +1 -44
  13. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  14. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +7 -9
  15. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  16. package/lib/cjs/presentation-common/PresentationRpcInterface.js +19 -15
  17. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  18. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +7 -7
  19. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  20. package/lib/cjs/presentation-common/RpcRequestsHandler.js +2 -1
  21. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  22. package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
  23. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  24. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  25. package/lib/cjs/presentation-common/Update.d.ts +2 -79
  26. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  27. package/lib/cjs/presentation-common/Update.js +1 -104
  28. package/lib/cjs/presentation-common/Update.js.map +1 -1
  29. package/lib/cjs/presentation-common/Utils.d.ts +7 -0
  30. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  31. package/lib/cjs/presentation-common/Utils.js +23 -0
  32. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  33. package/lib/cjs/presentation-common/content/Content.d.ts +0 -7
  34. package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
  35. package/lib/cjs/presentation-common/content/Content.js +1 -10
  36. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  37. package/lib/cjs/presentation-common/content/ContentTraverser.js +17 -12
  38. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  39. package/lib/cjs/presentation-common/content/Descriptor.d.ts +2 -31
  40. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  41. package/lib/cjs/presentation-common/content/Descriptor.js +3 -25
  42. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  43. package/lib/cjs/presentation-common/content/Fields.d.ts +4 -10
  44. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  45. package/lib/cjs/presentation-common/content/Fields.js +26 -35
  46. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  47. package/lib/cjs/presentation-common/content/Item.d.ts +5 -31
  48. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  49. package/lib/cjs/presentation-common/content/Item.js +5 -53
  50. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  51. package/lib/cjs/presentation-common/content/Property.d.ts +2 -12
  52. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  53. package/lib/cjs/presentation-common/content/Property.js +0 -18
  54. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  55. package/lib/cjs/presentation-common/content/Value.d.ts +0 -106
  56. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  57. package/lib/cjs/presentation-common/content/Value.js +1 -215
  58. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  59. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  60. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  61. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
  62. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  63. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +0 -83
  64. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  65. package/lib/cjs/presentation-common/hierarchy/Key.js +6 -24
  66. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  67. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +2 -106
  68. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  69. package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
  70. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  71. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  72. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  73. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
  74. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  75. package/lib/cjs/presentation-common/rules/Rule.d.ts +0 -14
  76. package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
  77. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  78. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  79. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  80. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  81. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  82. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  83. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  84. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  85. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  86. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
  87. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  88. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  89. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  90. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  91. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  92. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  93. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  94. package/lib/cjs/presentation-common.d.ts +1 -5
  95. package/lib/cjs/presentation-common.d.ts.map +1 -1
  96. package/lib/cjs/presentation-common.js +2 -5
  97. package/lib/cjs/presentation-common.js.map +1 -1
  98. package/lib/esm/presentation-common/EC.d.ts +5 -80
  99. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  100. package/lib/esm/presentation-common/EC.js +0 -96
  101. package/lib/esm/presentation-common/EC.js.map +1 -1
  102. package/lib/esm/presentation-common/KeySet.d.ts +2 -2
  103. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  104. package/lib/esm/presentation-common/KeySet.js +4 -11
  105. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  106. package/lib/esm/presentation-common/LabelDefinition.d.ts +0 -48
  107. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  108. package/lib/esm/presentation-common/LabelDefinition.js +0 -43
  109. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  110. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +7 -9
  111. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  112. package/lib/esm/presentation-common/PresentationRpcInterface.js +19 -15
  113. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  114. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +7 -7
  115. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  116. package/lib/esm/presentation-common/RpcRequestsHandler.js +2 -1
  117. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  118. package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
  119. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  120. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  121. package/lib/esm/presentation-common/Update.d.ts +2 -79
  122. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  123. package/lib/esm/presentation-common/Update.js +0 -103
  124. package/lib/esm/presentation-common/Update.js.map +1 -1
  125. package/lib/esm/presentation-common/Utils.d.ts +7 -0
  126. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  127. package/lib/esm/presentation-common/Utils.js +22 -0
  128. package/lib/esm/presentation-common/Utils.js.map +1 -1
  129. package/lib/esm/presentation-common/content/Content.d.ts +0 -7
  130. package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
  131. package/lib/esm/presentation-common/content/Content.js +1 -10
  132. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  133. package/lib/esm/presentation-common/content/ContentTraverser.js +17 -12
  134. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  135. package/lib/esm/presentation-common/content/Descriptor.d.ts +2 -31
  136. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  137. package/lib/esm/presentation-common/content/Descriptor.js +3 -25
  138. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  139. package/lib/esm/presentation-common/content/Fields.d.ts +4 -10
  140. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  141. package/lib/esm/presentation-common/content/Fields.js +26 -35
  142. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  143. package/lib/esm/presentation-common/content/Item.d.ts +5 -31
  144. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  145. package/lib/esm/presentation-common/content/Item.js +5 -53
  146. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  147. package/lib/esm/presentation-common/content/Property.d.ts +2 -12
  148. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  149. package/lib/esm/presentation-common/content/Property.js +0 -18
  150. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  151. package/lib/esm/presentation-common/content/Value.d.ts +0 -106
  152. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  153. package/lib/esm/presentation-common/content/Value.js +0 -214
  154. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  155. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  156. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  157. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
  158. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  159. package/lib/esm/presentation-common/hierarchy/Key.d.ts +0 -83
  160. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  161. package/lib/esm/presentation-common/hierarchy/Key.js +6 -24
  162. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  163. package/lib/esm/presentation-common/hierarchy/Node.d.ts +2 -106
  164. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  165. package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
  166. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  167. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  168. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  169. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
  170. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  171. package/lib/esm/presentation-common/rules/Rule.d.ts +0 -14
  172. package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
  173. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  174. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  175. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  176. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  177. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  178. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  179. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  180. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  181. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  182. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
  183. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  184. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  185. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  186. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  187. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  188. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  189. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  190. package/lib/esm/presentation-common.d.ts +1 -5
  191. package/lib/esm/presentation-common.d.ts.map +1 -1
  192. package/lib/esm/presentation-common.js +1 -5
  193. package/lib/esm/presentation-common.js.map +1 -1
  194. package/package.json +10 -10
  195. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  196. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  197. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
  198. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  199. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  200. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  201. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
  202. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  203. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  204. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  205. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
  206. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  207. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  208. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  209. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
  210. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
  211. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  212. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  213. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
  214. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  215. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  216. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  217. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
  218. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  219. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  220. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  221. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
  222. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  223. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  224. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  225. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
  226. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RulesetVariables.js","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAoE;AAEpE;;;GAGG;AACH,IAAY,kBAkBX;AAlBD,WAAY,kBAAkB;IAC5B,oBAAoB;IACpB,iCAAW,CAAA;IAEX,8BAA8B;IAC9B,wCAAkB,CAAA;IAElB,oBAAoB;IACpB,mCAAa,CAAA;IAEb,mBAAmB;IACnB,uCAAiB,CAAA;IAEjB,uBAAuB;IACvB,mCAAa,CAAA;IAEb,iCAAiC;IACjC,0CAAoB,CAAA;AACtB,CAAC,EAlBW,kBAAkB,kCAAlB,kBAAkB,QAkB7B;AA8JD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,eAAe,CAsB/B;AAtBD,WAAiB,eAAe;IAC9B;;;OAGG;IACH,SAAgB,MAAM,CAAC,QAAyB;QAC9C,IAAI,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE,CAAC;YACnD,OAAO,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,gCAAiB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjF,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IALe,sBAAM,SAKrB,CAAA;IAED,iDAAiD;IACjD,SAAgB,QAAQ,CAAC,IAAyB;QAChD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE,CAAC;YAC/C,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACnC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,gCAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3E,CAAC;YACD,OAAO,IAAW,CAAC,CAAC,kFAAkF;QACxG,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IARe,wBAAQ,WAQvB,CAAA;AACH,CAAC,EAtBgB,eAAe,+BAAf,eAAe,QAsB/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\n\n/**\n * Possible variable value types\n * @public\n */\nexport enum VariableValueTypes {\n /** Integer value */\n Int = \"int\",\n\n /** Array of integer values */\n IntArray = \"int[]\",\n\n /** Boolean value */\n Bool = \"bool\",\n\n /** String value */\n String = \"string\",\n\n /** Id64String value */\n Id64 = \"id64\",\n\n /** Array of Id64String values */\n Id64Array = \"id64[]\",\n}\n\n/**\n * Union of all supported variable value types\n * @public\n */\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\n\n/**\n * JSON representation of [[VariableValue]]\n * @public\n */\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\n\n/**\n * Base data structure for representing ruleset variables.\n * @public\n */\nexport interface RulesetVariableBase {\n id: string;\n type: VariableValueTypes;\n value: VariableValue;\n}\n/**\n * Data structure for representing boolean ruleset variables.\n * @public\n */\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * Data structure for representing string ruleset variables.\n * @public\n */\nexport interface StringRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * Data structure for representing int ruleset variables.\n * @public\n */\nexport interface IntRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * Data structure for representing int array ruleset variables.\n * @public\n */\nexport interface IntsRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * Data structure for representing ID ruleset variables.\n * @public\n */\nexport interface Id64RulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * Data structure for representing ID array ruleset variables.\n * @public\n */\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64Array;\n value: Id64String[];\n}\n/**\n * Data structure for representing ruleset variables.\n * @public\n */\nexport type RulesetVariable =\n | BooleanRulesetVariable\n | StringRulesetVariable\n | IntRulesetVariable\n | IntsRulesetVariable\n | Id64RulesetVariable\n | Id64sRulesetVariable;\n\n/**\n * JSON representation of [[RulesetVariableBase]].\n * @public\n */\nexport interface RulesetVariableBaseJSON {\n id: string;\n type: VariableValueTypes;\n value: VariableValueJSON;\n}\n/**\n * JSON representation of [[BooleanRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[BooleanRulesetVariable]]\n */\nexport interface BooleanRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * JSON representation of [[StringRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[StringRulesetVariable]]\n */\nexport interface StringRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * JSON representation of [[IntRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[IntRulesetVariable]]\n */\nexport interface IntRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * JSON representation of [[IntsRulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[IntsRulesetVariable]]\n */\nexport interface IntsRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * JSON representation of [[Id64RulesetVariable]].\n * @public\n * @deprecated in 3.x. Use [[Id64RulesetVariable]]\n */\nexport interface Id64RulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * JSON representation of [[Id64sRulesetVariable]].\n * @public\n */\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64Array;\n value: Id64String[] | CompressedId64Set;\n}\n/**\n * JSON representation of [[RulesetVariable]].\n * @public\n */\n\nexport type RulesetVariableJSON =\n | BooleanRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\n | StringRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\n | IntRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\n | IntsRulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\n | Id64RulesetVariableJSON // eslint-disable-line @typescript-eslint/no-deprecated\n | Id64sRulesetVariableJSON;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RulesetVariable {\n /**\n * Serialize given RulesetVariable to JSON.\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\n */\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\n if (variable.type === VariableValueTypes.Id64Array) {\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\n }\n return variable;\n }\n\n /** Deserialize [[RulesetVariable]] from JSON. */\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\n if (json.type === VariableValueTypes.Id64Array) {\n if (typeof json.value === \"string\") {\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\n }\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\n }\n return json;\n }\n}\n"]}
1
+ {"version":3,"file":"RulesetVariables.js","sourceRoot":"","sources":["../../../src/presentation-common/RulesetVariables.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAoE;AAEpE;;;GAGG;AACH,IAAY,kBAkBX;AAlBD,WAAY,kBAAkB;IAC5B,oBAAoB;IACpB,iCAAW,CAAA;IAEX,8BAA8B;IAC9B,wCAAkB,CAAA;IAElB,oBAAoB;IACpB,mCAAa,CAAA;IAEb,mBAAmB;IACnB,uCAAiB,CAAA;IAEjB,uBAAuB;IACvB,mCAAa,CAAA;IAEb,iCAAiC;IACjC,0CAAoB,CAAA;AACtB,CAAC,EAlBW,kBAAkB,kCAAlB,kBAAkB,QAkB7B;AAiHD,cAAc;AACd,2DAA2D;AAC3D,IAAiB,eAAe,CAsB/B;AAtBD,WAAiB,eAAe;IAC9B;;;OAGG;IACH,SAAgB,MAAM,CAAC,QAAyB;QAC9C,IAAI,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE,CAAC;YACnD,OAAO,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,gCAAiB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjF,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IALe,sBAAM,SAKrB,CAAA;IAED,iDAAiD;IACjD,SAAgB,QAAQ,CAAC,IAAyB;QAChD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE,CAAC;YAC/C,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACnC,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,gCAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3E,CAAC;YACD,OAAO,IAAW,CAAC,CAAC,kFAAkF;QACxG,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IARe,wBAAQ,WAQvB,CAAA;AACH,CAAC,EAtBgB,eAAe,+BAAf,eAAe,QAsB/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { CompressedId64Set, Id64String } from \"@itwin/core-bentley\";\n\n/**\n * Possible variable value types\n * @public\n */\nexport enum VariableValueTypes {\n /** Integer value */\n Int = \"int\",\n\n /** Array of integer values */\n IntArray = \"int[]\",\n\n /** Boolean value */\n Bool = \"bool\",\n\n /** String value */\n String = \"string\",\n\n /** Id64String value */\n Id64 = \"id64\",\n\n /** Array of Id64String values */\n Id64Array = \"id64[]\",\n}\n\n/**\n * Union of all supported variable value types\n * @public\n */\nexport type VariableValue = boolean | string | number | number[] | Id64String | Id64String[];\n\n/**\n * JSON representation of [[VariableValue]]\n * @public\n */\nexport type VariableValueJSON = boolean | string | number | number[] | Id64String | Id64String[] | CompressedId64Set;\n\n/**\n * Base data structure for representing ruleset variables.\n * @public\n */\nexport interface RulesetVariableBase {\n id: string;\n type: VariableValueTypes;\n value: VariableValue;\n}\n/**\n * Data structure for representing boolean ruleset variables.\n * @public\n */\nexport interface BooleanRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Bool;\n value: boolean;\n}\n/**\n * Data structure for representing string ruleset variables.\n * @public\n */\nexport interface StringRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.String;\n value: string;\n}\n/**\n * Data structure for representing int ruleset variables.\n * @public\n */\nexport interface IntRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Int;\n value: number;\n}\n/**\n * Data structure for representing int array ruleset variables.\n * @public\n */\nexport interface IntsRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.IntArray;\n value: number[];\n}\n/**\n * Data structure for representing ID ruleset variables.\n * @public\n */\nexport interface Id64RulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64;\n value: Id64String;\n}\n/**\n * Data structure for representing ID array ruleset variables.\n * @public\n */\nexport interface Id64sRulesetVariable extends RulesetVariableBase {\n type: VariableValueTypes.Id64Array;\n value: Id64String[];\n}\n/**\n * Data structure for representing ruleset variables.\n * @public\n */\nexport type RulesetVariable =\n | BooleanRulesetVariable\n | StringRulesetVariable\n | IntRulesetVariable\n | IntsRulesetVariable\n | Id64RulesetVariable\n | Id64sRulesetVariable;\n\n/**\n * JSON representation of [[RulesetVariableBase]].\n * @public\n */\nexport interface RulesetVariableBaseJSON {\n id: string;\n type: VariableValueTypes;\n value: VariableValueJSON;\n}\n/**\n * JSON representation of [[Id64sRulesetVariable]].\n * @public\n */\nexport interface Id64sRulesetVariableJSON extends RulesetVariableBaseJSON {\n type: VariableValueTypes.Id64Array;\n value: Id64String[] | CompressedId64Set;\n}\n/**\n * JSON representation of [[RulesetVariable]].\n * @public\n */\n\nexport type RulesetVariableJSON =\n | BooleanRulesetVariable\n | StringRulesetVariable\n | IntRulesetVariable\n | IntsRulesetVariable\n | Id64RulesetVariable\n | Id64sRulesetVariableJSON;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RulesetVariable {\n /**\n * Serialize given RulesetVariable to JSON.\n * Note: In case of [[Id64sRulesetVariable]], this method expects IDs are sorted. See [[OrderedId64Iterable.sortArray]].\n */\n export function toJSON(variable: RulesetVariable): RulesetVariableJSON {\n if (variable.type === VariableValueTypes.Id64Array) {\n return { ...variable, value: CompressedId64Set.compressArray(variable.value) };\n }\n return variable;\n }\n\n /** Deserialize [[RulesetVariable]] from JSON. */\n export function fromJSON(json: RulesetVariableJSON): RulesetVariable {\n if (json.type === VariableValueTypes.Id64Array) {\n if (typeof json.value === \"string\") {\n return { ...json, value: CompressedId64Set.decompressArray(json.value) };\n }\n return json as any; // for some reason TS doesn't understand that `json.value` is always an array here\n }\n return json;\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  /** @packageDocumentation
2
2
  * @module Core
3
3
  */
4
- import { NodeKey, NodeKeyJSON } from "./hierarchy/Key";
5
- import { Node, NodeJSON, PartialNode, PartialNodeJSON } from "./hierarchy/Node";
4
+ import { NodeKey } from "./hierarchy/Key";
5
+ import { Node, PartialNode } from "./hierarchy/Node";
6
6
  /**
7
7
  * A constant for indicating that a full update is required.
8
8
  * @public
@@ -32,30 +32,11 @@ export type HierarchyUpdateInfo = typeof UPDATE_FULL;
32
32
  * @public
33
33
  */
34
34
  export type ContentUpdateInfo = typeof UPDATE_FULL;
35
- /**
36
- * JSON representation of [[PartialHierarchyModification]].
37
- * @public
38
- * @deprecated in 3.x. Use [[PartialHierarchyModification]]
39
- */
40
- export type PartialHierarchyModificationJSON = NodeInsertionInfoJSON | NodeDeletionInfoJSON | NodeUpdateInfoJSON;
41
35
  /**
42
36
  * Information about a hierarchy change: insertion, deletion or node update.
43
37
  * @public
44
38
  */
45
39
  export type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;
46
- /** @public */
47
- export declare namespace PartialHierarchyModification {
48
- /**
49
- * Serialize given object to JSON.
50
- * @deprecated in 3.x. Use [[PartialHierarchyModification]]
51
- */
52
- function toJSON(obj: PartialHierarchyModification): PartialHierarchyModificationJSON;
53
- /**
54
- * Deserialize given object from JSON
55
- * @deprecated in 3.x. Use [[PartialHierarchyModification]]
56
- */
57
- function fromJSON(json: PartialHierarchyModificationJSON): PartialHierarchyModification;
58
- }
59
40
  /**
60
41
  * Information about node insertion.
61
42
  * @public
@@ -69,17 +50,6 @@ export interface NodeInsertionInfo {
69
50
  /** Inserted node */
70
51
  node: Node;
71
52
  }
72
- /**
73
- * JSON representation of [[NodeInsertionInfo]].
74
- * @public
75
- * @deprecated in 3.x. Use [[NodeInsertionInfo]]
76
- */
77
- export interface NodeInsertionInfoJSON {
78
- type: "Insert";
79
- parent?: NodeKeyJSON;
80
- position: number;
81
- node: NodeJSON;
82
- }
83
53
  /**
84
54
  * Information about node deletion.
85
55
  * @public
@@ -91,18 +61,6 @@ export interface NodeDeletionInfo {
91
61
  /** Position of the deleted node among its siblings in the initial, not updated tree */
92
62
  position: number;
93
63
  }
94
- /**
95
- * JSON representation of [[NodeDeletionInfo]].
96
- * @public
97
- * @deprecated in 3.x. Use [[NodeDeletionInfo]]
98
- */
99
- export interface NodeDeletionInfoJSON {
100
- type: "Delete";
101
- /** Parent of the deleted node */
102
- parent?: NodeKeyJSON;
103
- /** Position of the deleted node among its siblings in the initial, not updated tree */
104
- position: number;
105
- }
106
64
  /**
107
65
  * Information about node update.
108
66
  * @public
@@ -114,28 +72,6 @@ export interface NodeUpdateInfo {
114
72
  /** Updated node attributes */
115
73
  changes: PartialNode;
116
74
  }
117
- /**
118
- * JSON representation of [[NodeUpdateInfo]].
119
- * @public
120
- * @deprecated in 3.x. Use [[NodeUpdateInfo]]
121
- */
122
- export interface NodeUpdateInfoJSON {
123
- type: "Update";
124
- target: NodeKeyJSON;
125
- changes: PartialNodeJSON;
126
- }
127
- /**
128
- * JSON representation of [[HierarchyCompareInfo]].
129
- * @public
130
- * @deprecated in 3.x. Use [[HierarchyCompareInfo]].
131
- */
132
- export interface HierarchyCompareInfoJSON {
133
- changes: PartialHierarchyModificationJSON[];
134
- continuationToken?: {
135
- prevHierarchyNode: string;
136
- currHierarchyNode: string;
137
- };
138
- }
139
75
  /**
140
76
  * Information about hierarchy modification / differences.
141
77
  * @public
@@ -149,17 +85,4 @@ export interface HierarchyCompareInfo {
149
85
  currHierarchyNode: string;
150
86
  };
151
87
  }
152
- /** @public */
153
- export declare namespace HierarchyCompareInfo {
154
- /**
155
- * Serialize given object to JSON.
156
- * @deprecated in 3.x. Use [[HierarchyCompareInfo]]
157
- */
158
- function toJSON(obj: HierarchyCompareInfo): HierarchyCompareInfoJSON;
159
- /**
160
- * Deserialize given object from JSON
161
- * @deprecated in 3.x. Use [[HierarchyCompareInfo]]
162
- */
163
- function fromJSON(json: HierarchyCompareInfoJSON): HierarchyCompareInfo;
164
- }
165
88
  //# sourceMappingURL=Update.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":"AAIA;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;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,8BAA8B;IAC9B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,OAAO,EAAE,4BAA4B,EAAE,CAAC;IACxC,sDAAsD;IACtD,iBAAiB,CAAC,EAAE;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH"}
@@ -7,113 +7,10 @@
7
7
  * @module Core
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.HierarchyCompareInfo = exports.PartialHierarchyModification = exports.UPDATE_FULL = void 0;
11
- const Key_1 = require("./hierarchy/Key");
12
- const Node_1 = require("./hierarchy/Node");
10
+ exports.UPDATE_FULL = void 0;
13
11
  /**
14
12
  * A constant for indicating that a full update is required.
15
13
  * @public
16
14
  */
17
15
  exports.UPDATE_FULL = "FULL";
18
- /** @public */
19
- // eslint-disable-next-line @typescript-eslint/no-redeclare
20
- var PartialHierarchyModification;
21
- (function (PartialHierarchyModification) {
22
- /**
23
- * Serialize given object to JSON.
24
- * @deprecated in 3.x. Use [[PartialHierarchyModification]]
25
- */
26
- // eslint-disable-next-line @typescript-eslint/no-deprecated
27
- function toJSON(obj) {
28
- switch (obj.type) {
29
- case "Insert":
30
- return {
31
- type: "Insert",
32
- // eslint-disable-next-line @typescript-eslint/no-deprecated
33
- parent: obj.parent === undefined ? undefined : Key_1.NodeKey.toJSON(obj.parent),
34
- position: obj.position,
35
- // eslint-disable-next-line @typescript-eslint/no-deprecated
36
- node: Node_1.Node.toJSON(obj.node),
37
- };
38
- case "Update":
39
- return {
40
- type: "Update",
41
- // eslint-disable-next-line @typescript-eslint/no-deprecated
42
- target: Key_1.NodeKey.toJSON(obj.target),
43
- changes: Node_1.Node.toPartialJSON(obj.changes),
44
- };
45
- case "Delete":
46
- return {
47
- type: "Delete",
48
- // eslint-disable-next-line @typescript-eslint/no-deprecated
49
- parent: obj.parent === undefined ? undefined : Key_1.NodeKey.toJSON(obj.parent),
50
- position: obj.position,
51
- };
52
- }
53
- }
54
- PartialHierarchyModification.toJSON = toJSON;
55
- /**
56
- * Deserialize given object from JSON
57
- * @deprecated in 3.x. Use [[PartialHierarchyModification]]
58
- */
59
- // eslint-disable-next-line @typescript-eslint/no-deprecated
60
- function fromJSON(json) {
61
- switch (json.type) {
62
- case "Insert":
63
- return {
64
- type: "Insert",
65
- // eslint-disable-next-line @typescript-eslint/no-deprecated
66
- parent: json.parent === undefined ? undefined : Key_1.NodeKey.fromJSON(json.parent),
67
- position: json.position,
68
- // eslint-disable-next-line @typescript-eslint/no-deprecated
69
- node: Node_1.Node.fromJSON(json.node),
70
- };
71
- case "Update":
72
- return {
73
- type: "Update",
74
- // eslint-disable-next-line @typescript-eslint/no-deprecated
75
- target: Key_1.NodeKey.fromJSON(json.target),
76
- changes: Node_1.Node.fromPartialJSON(json.changes),
77
- };
78
- case "Delete":
79
- return {
80
- type: "Delete",
81
- // eslint-disable-next-line @typescript-eslint/no-deprecated
82
- parent: json.parent === undefined ? undefined : Key_1.NodeKey.fromJSON(json.parent),
83
- position: json.position,
84
- };
85
- }
86
- }
87
- PartialHierarchyModification.fromJSON = fromJSON;
88
- })(PartialHierarchyModification || (exports.PartialHierarchyModification = PartialHierarchyModification = {}));
89
- /** @public */
90
- var HierarchyCompareInfo;
91
- (function (HierarchyCompareInfo) {
92
- /**
93
- * Serialize given object to JSON.
94
- * @deprecated in 3.x. Use [[HierarchyCompareInfo]]
95
- */
96
- // eslint-disable-next-line @typescript-eslint/no-deprecated
97
- function toJSON(obj) {
98
- return {
99
- ...obj,
100
- // eslint-disable-next-line @typescript-eslint/no-deprecated
101
- changes: obj.changes.map((change) => PartialHierarchyModification.toJSON(change)),
102
- };
103
- }
104
- HierarchyCompareInfo.toJSON = toJSON;
105
- /**
106
- * Deserialize given object from JSON
107
- * @deprecated in 3.x. Use [[HierarchyCompareInfo]]
108
- */
109
- // eslint-disable-next-line @typescript-eslint/no-deprecated
110
- function fromJSON(json) {
111
- return {
112
- ...json,
113
- // eslint-disable-next-line @typescript-eslint/no-deprecated
114
- changes: json.changes.map((change) => PartialHierarchyModification.fromJSON(change)),
115
- };
116
- }
117
- HierarchyCompareInfo.fromJSON = fromJSON;
118
- })(HierarchyCompareInfo || (exports.HierarchyCompareInfo = HierarchyCompareInfo = {}));
119
16
  //# sourceMappingURL=Update.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,yCAAuD;AACvD,2CAAgF;AAEhF;;;GAGG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC;AA2ClC,cAAc;AACd,2DAA2D;AAC3D,IAAiB,4BAA4B,CAsE5C;AAtED,WAAiB,4BAA4B;IAC3C;;;OAGG;IACH,4DAA4D;IAC5D,SAAgB,MAAM,CAAC,GAAiC;QACtD,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;YACjB,KAAK,QAAQ;gBACX,OAAO;oBACL,IAAI,EAAE,QAAQ;oBACd,4DAA4D;oBAC5D,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;oBACzE,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,4DAA4D;oBAC5D,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;iBAC5B,CAAC;YAEJ,KAAK,QAAQ;gBACX,OAAO;oBACL,IAAI,EAAE,QAAQ;oBACd,4DAA4D;oBAC5D,MAAM,EAAE,aAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,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,CAAC,CAAC,CAAC,aAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC7E,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBACxB,CAAC;QACN,CAAC;IACH,CAAC;IA5Be,qCAAQ,WA4BvB,CAAA;AACH,CAAC,EAtEgB,4BAA4B,4CAA5B,4BAA4B,QAsE5C;AA6GD,cAAc;AACd,IAAiB,oBAAoB,CA0BpC;AA1BD,WAAiB,oBAAoB;IACnC;;;OAGG;IACH,4DAA4D;IAC5D,SAAgB,MAAM,CAAC,GAAyB;QAC9C,OAAO;YACL,GAAG,GAAG;YACN,4DAA4D;YAC5D,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,4BAA4B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAClF,CAAC;IACJ,CAAC;IANe,2BAAM,SAMrB,CAAA;IAED;;;OAGG;IACH,4DAA4D;IAC5D,SAAgB,QAAQ,CAAC,IAA8B;QACrD,OAAO;YACL,GAAG,IAAI;YACP,4DAA4D;YAC5D,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,4BAA4B,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACrF,CAAC;IACJ,CAAC;IANe,6BAAQ,WAMvB,CAAA;AACH,CAAC,EA1BgB,oBAAoB,oCAApB,oBAAoB,QA0BpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey, NodeKeyJSON } from \"./hierarchy/Key\";\nimport { Node, NodeJSON, PartialNode, PartialNodeJSON } from \"./hierarchy/Node\";\n\n/**\n * A constant for indicating that a full update is required.\n * @public\n */\nexport const UPDATE_FULL = \"FULL\";\n\n/**\n * A data structure that describes changes that need to be applied to the hierarchy and\n * content components due to some changes on the backend.\n *\n * @public\n */\nexport interface UpdateInfo {\n [imodel: string]: {\n [rulesetId: string]: {\n hierarchy?: HierarchyUpdateInfo;\n content?: ContentUpdateInfo;\n };\n };\n}\n\n/**\n * Information about a required hierarchy update.\n * @public\n */\nexport type HierarchyUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a required content update.\n * @public\n */\nexport type ContentUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * JSON representation of [[PartialHierarchyModification]].\n * @public\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type PartialHierarchyModificationJSON = NodeInsertionInfoJSON | NodeDeletionInfoJSON | NodeUpdateInfoJSON;\n\n/**\n * Information about a hierarchy change: insertion, deletion or node update.\n * @public\n */\nexport type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace PartialHierarchyModification {\n /**\n * Serialize given object to JSON.\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n export function toJSON(obj: PartialHierarchyModification): PartialHierarchyModificationJSON {\n switch (obj.type) {\n case \"Insert\":\n return {\n type: \"Insert\",\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n parent: obj.parent === undefined ? undefined : NodeKey.toJSON(obj.parent),\n position: obj.position,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n node: Node.toJSON(obj.node),\n };\n\n case \"Update\":\n return {\n type: \"Update\",\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n target: NodeKey.toJSON(obj.target),\n changes: Node.toPartialJSON(obj.changes),\n };\n\n case \"Delete\":\n return {\n type: \"Delete\",\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n parent: obj.parent === undefined ? undefined : NodeKey.toJSON(obj.parent),\n position: obj.position,\n };\n }\n }\n\n /**\n * Deserialize given object from JSON\n * @deprecated in 3.x. Use [[PartialHierarchyModification]]\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n export function fromJSON(json: PartialHierarchyModificationJSON): PartialHierarchyModification {\n switch (json.type) {\n case \"Insert\":\n return {\n type: \"Insert\",\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n parent: json.parent === undefined ? undefined : NodeKey.fromJSON(json.parent),\n position: json.position,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n node: Node.fromJSON(json.node),\n };\n\n case \"Update\":\n return {\n type: \"Update\",\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n target: NodeKey.fromJSON(json.target),\n changes: Node.fromPartialJSON(json.changes),\n };\n\n case \"Delete\":\n return {\n type: \"Delete\",\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n parent: json.parent === undefined ? undefined : NodeKey.fromJSON(json.parent),\n position: json.position,\n };\n }\n }\n}\n\n/**\n * Information about node insertion.\n * @public\n */\nexport interface NodeInsertionInfo {\n type: \"Insert\";\n /** Parent node key */\n parent?: NodeKey;\n /** Index of the new node under its parent */\n position: number;\n /** Inserted node */\n node: Node;\n}\n\n/**\n * JSON representation of [[NodeInsertionInfo]].\n * @public\n * @deprecated in 3.x. Use [[NodeInsertionInfo]]\n */\nexport interface NodeInsertionInfoJSON {\n type: \"Insert\";\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n parent?: NodeKeyJSON;\n position: number;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n node: NodeJSON;\n}\n\n/**\n * Information about node deletion.\n * @public\n */\nexport interface NodeDeletionInfo {\n type: \"Delete\";\n /** Parent of the deleted node */\n parent?: NodeKey;\n /** Position of the deleted node among its siblings in the initial, not updated tree */\n position: number;\n}\n\n/**\n * JSON representation of [[NodeDeletionInfo]].\n * @public\n * @deprecated in 3.x. Use [[NodeDeletionInfo]]\n */\nexport interface NodeDeletionInfoJSON {\n type: \"Delete\";\n /** Parent of the deleted node */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n parent?: NodeKeyJSON;\n /** Position of the deleted node among its siblings in the initial, not updated tree */\n position: number;\n}\n\n/**\n * Information about node update.\n * @public\n */\nexport interface NodeUpdateInfo {\n type: \"Update\";\n /** Key of the updated node */\n target: NodeKey;\n /** Updated node attributes */\n changes: PartialNode;\n}\n\n/**\n * JSON representation of [[NodeUpdateInfo]].\n * @public\n * @deprecated in 3.x. Use [[NodeUpdateInfo]]\n */\nexport interface NodeUpdateInfoJSON {\n type: \"Update\";\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n target: NodeKeyJSON;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n changes: PartialNodeJSON;\n}\n\n/**\n * JSON representation of [[HierarchyCompareInfo]].\n * @public\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]].\n */\nexport interface HierarchyCompareInfoJSON {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n changes: PartialHierarchyModificationJSON[];\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n}\n\n/**\n * Information about hierarchy modification / differences.\n * @public\n */\nexport interface HierarchyCompareInfo {\n /** A list of hierarchy changes */\n changes: PartialHierarchyModification[];\n /** Continuation token for requesting more changes. */\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n}\n\n/** @public */\nexport namespace HierarchyCompareInfo {\n /**\n * Serialize given object to JSON.\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]]\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n export function toJSON(obj: HierarchyCompareInfo): HierarchyCompareInfoJSON {\n return {\n ...obj,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n changes: obj.changes.map((change) => PartialHierarchyModification.toJSON(change)),\n };\n }\n\n /**\n * Deserialize given object from JSON\n * @deprecated in 3.x. Use [[HierarchyCompareInfo]]\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n export function fromJSON(json: HierarchyCompareInfoJSON): HierarchyCompareInfo {\n return {\n ...json,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n changes: json.changes.map((change) => PartialHierarchyModification.fromJSON(change)),\n };\n }\n}\n"]}
1
+ {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAKH;;;GAGG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { Node, PartialNode } from \"./hierarchy/Node\";\n\n/**\n * A constant for indicating that a full update is required.\n * @public\n */\nexport const UPDATE_FULL = \"FULL\";\n\n/**\n * A data structure that describes changes that need to be applied to the hierarchy and\n * content components due to some changes on the backend.\n *\n * @public\n */\nexport interface UpdateInfo {\n [imodel: string]: {\n [rulesetId: string]: {\n hierarchy?: HierarchyUpdateInfo;\n content?: ContentUpdateInfo;\n };\n };\n}\n\n/**\n * Information about a required hierarchy update.\n * @public\n */\nexport type HierarchyUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a required content update.\n * @public\n */\nexport type ContentUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a hierarchy change: insertion, deletion or node update.\n * @public\n */\nexport type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;\n\n/**\n * Information about node insertion.\n * @public\n */\nexport interface NodeInsertionInfo {\n type: \"Insert\";\n /** Parent node key */\n parent?: NodeKey;\n /** Index of the new node under its parent */\n position: number;\n /** Inserted node */\n node: Node;\n}\n\n/**\n * Information about node deletion.\n * @public\n */\nexport interface NodeDeletionInfo {\n type: \"Delete\";\n /** Parent of the deleted node */\n parent?: NodeKey;\n /** Position of the deleted node among its siblings in the initial, not updated tree */\n position: number;\n}\n\n/**\n * Information about node update.\n * @public\n */\nexport interface NodeUpdateInfo {\n type: \"Update\";\n /** Key of the updated node */\n target: NodeKey;\n /** Updated node attributes */\n changes: PartialNode;\n}\n\n/**\n * Information about hierarchy modification / differences.\n * @public\n */\nexport interface HierarchyCompareInfo {\n /** A list of hierarchy changes */\n changes: PartialHierarchyModification[];\n /** Continuation token for requesting more changes. */\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n}\n"]}
@@ -69,4 +69,11 @@ export declare const DEFAULT_KEYS_BATCH_SIZE = 5000;
69
69
  * @internal
70
70
  */
71
71
  export declare function omitUndefined<T extends object>(obj: T): T;
72
+ /** @internal */
73
+ type NullToUndefined<T> = T extends null ? undefined : T extends Array<infer U> ? Array<NullToUndefined<U>> : T extends object ? {
74
+ [K in keyof T]: NullToUndefined<T[K]>;
75
+ } : T;
76
+ /** @internal */
77
+ export declare function deepReplaceNullsToUndefined<T>(obj: T): NullToUndefined<T>;
78
+ export {};
72
79
  //# sourceMappingURL=Utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAA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jC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,KAAK,EAAE,CAAC,EAAE,CAAC;CACZ;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,SAAU,QAAQ,CAAC,MAAM,CAAC,KAAG,MAU1D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAOzD;AAED,gBAAgB;AAChB,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,GACpC,SAAS,GACT,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACtB,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GACzB,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACzC,CAAC,CAAC;AAEV,gBAAgB;AAChB,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAoBzE"}
@@ -9,6 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.DEFAULT_KEYS_BATCH_SIZE = exports.getInstancesCount = void 0;
11
11
  exports.omitUndefined = omitUndefined;
12
+ exports.deepReplaceNullsToUndefined = deepReplaceNullsToUndefined;
12
13
  const Key_1 = require("./hierarchy/Key");
13
14
  /**
14
15
  * Get total number of instances included in the supplied key set. The
@@ -58,4 +59,26 @@ function omitUndefined(obj) {
58
59
  });
59
60
  return obj;
60
61
  }
62
+ /** @internal */
63
+ function deepReplaceNullsToUndefined(obj) {
64
+ /* istanbul ignore next */
65
+ if (obj === null) {
66
+ return undefined;
67
+ }
68
+ /* istanbul ignore next */
69
+ if (Array.isArray(obj)) {
70
+ return obj.map(deepReplaceNullsToUndefined);
71
+ }
72
+ if (typeof obj === "object") {
73
+ return Object.keys(obj).reduce((acc, key) => {
74
+ const value = obj[key];
75
+ /* istanbul ignore else */
76
+ if (value !== null && value !== undefined) {
77
+ acc[key] = deepReplaceNullsToUndefined(value);
78
+ }
79
+ return acc;
80
+ }, {});
81
+ }
82
+ return obj;
83
+ }
61
84
  //# sourceMappingURL=Utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAwFH,sCAOC;AA7FD,yCAA0C;AA8C1C;;;;;;;;;;;GAWG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAsB,EAAU,EAAE;IAClE,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACnC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAY,EAAE,EAAE;QACrC,IAAI,aAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,KAAK,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;QACnC,CAAC;aAAM,IAAI,aAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1C,KAAK,IAAI,GAAG,CAAC,qBAAqB,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B;AAEF;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAmB,GAAM;IACpD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC,GAAc,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { KeySet } from \"./KeySet\";\n\n/**\n * Create a type with `T` properties excluding properties listed in `K`.\n *\n * Usage example: `Omit<SomeType, \"exclude_prop1\" | \"exclude_prop2\">`\n *\n * @public\n */\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;\n\n/**\n * Create a type with `T` properties excluding all properties in type `K`.\n *\n * Usage example: `Subtract<SomeType, ExcludePropertiesInThisType>`\n *\n * @public\n */\nexport type Subtract<T, K> = Omit<T, keyof K>;\n\n/**\n * Create a type from given type `T` and make specified properties optional.\n * @public\n */\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * A dictionary data structure.\n * @public\n */\nexport interface ValuesDictionary<T> {\n [key: string]: T;\n}\n\n/**\n * A structure for paged responses\n * @public\n */\nexport interface PagedResponse<T> {\n /** Total number of items */\n total: number;\n /** Items for the requested page */\n items: T[];\n}\n\n/**\n * Get total number of instances included in the supplied key set. The\n * count is calculated by adding all of the following:\n * - `keys.instanceKeysCount`\n * - number of `keys.nodeKeys` which are *ECInstance* keys\n * - for every grouping node key in `keys.nodeKeys`, number of grouped instances\n *\n * E.g. if `keys` contains one instance key, one *ECInstance* node key\n * and one grouping node key which groups 3 instances, the result is 5.\n *\n * @public\n */\nexport const getInstancesCount = (keys: Readonly<KeySet>): number => {\n let count = keys.instanceKeysCount;\n keys.nodeKeys.forEach((key: NodeKey) => {\n if (NodeKey.isInstancesNodeKey(key)) {\n count += key.instanceKeys.length;\n } else if (NodeKey.isGroupingNodeKey(key)) {\n count += key.groupedInstancesCount;\n }\n });\n return count;\n};\n\n/**\n * Default (recommended) keyset batch size for cases when it needs to be sent\n * over HTTP. Sending keys in batches helps avoid HTTP413 error.\n *\n * @public\n */\nexport const DEFAULT_KEYS_BATCH_SIZE = 5000;\n\n/**\n * Removes all `undefined` properties from given `obj` object and returns\n * the same (mutated) object.\n *\n * Example: `omitUndefined({ a: 1, b: undefined })` will return `{ a: 1 }`\n *\n * @internal\n */\nexport function omitUndefined<T extends object>(obj: T): T {\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) {\n delete obj[key as keyof T];\n }\n });\n return obj;\n}\n"]}
1
+ {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAwFH,sCAOC;AAYD,kEAoBC;AA7HD,yCAA0C;AA8C1C;;;;;;;;;;;GAWG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAsB,EAAU,EAAE;IAClE,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACnC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAY,EAAE,EAAE;QACrC,IAAI,aAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,KAAK,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;QACnC,CAAC;aAAM,IAAI,aAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1C,KAAK,IAAI,GAAG,CAAC,qBAAqB,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B;AAEF;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAmB,GAAM;IACpD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC,GAAc,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAWD,gBAAgB;AAChB,SAAgB,2BAA2B,CAAI,GAAM;IACnD,0BAA0B;IAC1B,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,SAAgB,CAAC;IAC1B,CAAC;IACD,0BAA0B;IAC1B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,GAAG,CAAC,2BAA2B,CAAuB,CAAC;IACpE,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAc,CAAC,CAAC;YAClC,0BAA0B;YAC1B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC1C,GAAG,CAAC,GAA+B,CAAC,GAAG,2BAA2B,CAAC,KAAK,CAAQ,CAAC;YACnF,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAwB,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,GAAU,CAAC;AACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey } from \"./hierarchy/Key\";\nimport { KeySet } from \"./KeySet\";\n\n/**\n * Create a type with `T` properties excluding properties listed in `K`.\n *\n * Usage example: `Omit<SomeType, \"exclude_prop1\" | \"exclude_prop2\">`\n *\n * @public\n */\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;\n\n/**\n * Create a type with `T` properties excluding all properties in type `K`.\n *\n * Usage example: `Subtract<SomeType, ExcludePropertiesInThisType>`\n *\n * @public\n */\nexport type Subtract<T, K> = Omit<T, keyof K>;\n\n/**\n * Create a type from given type `T` and make specified properties optional.\n * @public\n */\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * A dictionary data structure.\n * @public\n */\nexport interface ValuesDictionary<T> {\n [key: string]: T;\n}\n\n/**\n * A structure for paged responses\n * @public\n */\nexport interface PagedResponse<T> {\n /** Total number of items */\n total: number;\n /** Items for the requested page */\n items: T[];\n}\n\n/**\n * Get total number of instances included in the supplied key set. The\n * count is calculated by adding all of the following:\n * - `keys.instanceKeysCount`\n * - number of `keys.nodeKeys` which are *ECInstance* keys\n * - for every grouping node key in `keys.nodeKeys`, number of grouped instances\n *\n * E.g. if `keys` contains one instance key, one *ECInstance* node key\n * and one grouping node key which groups 3 instances, the result is 5.\n *\n * @public\n */\nexport const getInstancesCount = (keys: Readonly<KeySet>): number => {\n let count = keys.instanceKeysCount;\n keys.nodeKeys.forEach((key: NodeKey) => {\n if (NodeKey.isInstancesNodeKey(key)) {\n count += key.instanceKeys.length;\n } else if (NodeKey.isGroupingNodeKey(key)) {\n count += key.groupedInstancesCount;\n }\n });\n return count;\n};\n\n/**\n * Default (recommended) keyset batch size for cases when it needs to be sent\n * over HTTP. Sending keys in batches helps avoid HTTP413 error.\n *\n * @public\n */\nexport const DEFAULT_KEYS_BATCH_SIZE = 5000;\n\n/**\n * Removes all `undefined` properties from given `obj` object and returns\n * the same (mutated) object.\n *\n * Example: `omitUndefined({ a: 1, b: undefined })` will return `{ a: 1 }`\n *\n * @internal\n */\nexport function omitUndefined<T extends object>(obj: T): T {\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) {\n delete obj[key as keyof T];\n }\n });\n return obj;\n}\n\n/** @internal */\ntype NullToUndefined<T> = T extends null\n ? undefined\n : T extends Array<infer U>\n ? Array<NullToUndefined<U>>\n : T extends object\n ? { [K in keyof T]: NullToUndefined<T[K]> }\n : T;\n\n/** @internal */\nexport function deepReplaceNullsToUndefined<T>(obj: T): NullToUndefined<T> {\n /* istanbul ignore next */\n if (obj === null) {\n return undefined as any;\n }\n /* istanbul ignore next */\n if (Array.isArray(obj)) {\n return obj.map(deepReplaceNullsToUndefined) as NullToUndefined<T>;\n }\n if (typeof obj === \"object\") {\n return Object.keys(obj).reduce((acc, key) => {\n const value = obj[key as keyof T];\n /* istanbul ignore else */\n if (value !== null && value !== undefined) {\n acc[key as keyof NullToUndefined<T>] = deepReplaceNullsToUndefined(value) as any;\n }\n return acc;\n }, {} as NullToUndefined<T>);\n }\n return obj as any;\n}\n"]}
@@ -28,12 +28,5 @@ export declare class Content {
28
28
  toJSON(): ContentJSON;
29
29
  /** Deserialize [[Content]] from JSON */
30
30
  static fromJSON(json: ContentJSON | string | undefined): Content | undefined;
31
- /**
32
- * Reviver function that can be used as a second argument for
33
- * `JSON.parse` method when parsing Content objects.
34
- *
35
- * @internal
36
- */
37
- static reviver(key: string, value: any): any;
38
31
  }
39
32
  //# sourceMappingURL=Content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,OAAO;IAClB,4CAA4C;IAC5C,SAAgB,UAAU,EAAE,UAAU,CAAC;IACvC,oBAAoB;IACpB,SAAgB,UAAU,EAAE,IAAI,EAAE,CAAC;IAEnC,wCAAwC;gBACrB,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;IAKxD,oCAAoC;IAC7B,MAAM,IAAI,WAAW;IAO5B,wCAAwC;WAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS;IAkBnF;;;;;OAKG;WACW,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG;CAGpD"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,OAAO;IAClB,4CAA4C;IAC5C,SAAgB,UAAU,EAAE,UAAU,CAAC;IACvC,oBAAoB;IACpB,SAAgB,UAAU,EAAE,IAAI,EAAE,CAAC;IAEnC,wCAAwC;gBACrB,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE;IAKxD,oCAAoC;IAC7B,MAAM,IAAI,WAAW;IAO5B,wCAAwC;WAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS;CAiBpF"}
@@ -39,7 +39,7 @@ class Content {
39
39
  return undefined;
40
40
  }
41
41
  if (typeof json === "string") {
42
- return JSON.parse(json, (key, value) => Content.reviver(key, value));
42
+ return Content.fromJSON(JSON.parse(json));
43
43
  }
44
44
  const descriptor = Descriptor_1.Descriptor.fromJSON(json.descriptor);
45
45
  if (!descriptor) {
@@ -48,15 +48,6 @@ class Content {
48
48
  const contentSet = json.contentSet.map((itemJson) => Item_1.Item.fromJSON(itemJson)).filter((item) => item !== undefined);
49
49
  return new Content(descriptor, contentSet);
50
50
  }
51
- /**
52
- * Reviver function that can be used as a second argument for
53
- * `JSON.parse` method when parsing Content objects.
54
- *
55
- * @internal
56
- */
57
- static reviver(key, value) {
58
- return key === "" ? Content.fromJSON(value) : value;
59
- }
60
51
  }
61
52
  exports.Content = Content;
62
53
  //# sourceMappingURL=Content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,6CAA0D;AAC1D,iCAAwC;AAWxC;;;;;GAKG;AACH,MAAa,OAAO;IAClB,4CAA4C;IAC5B,UAAU,CAAa;IACvC,oBAAoB;IACJ,UAAU,CAAS;IAEnC,wCAAwC;IACxC,YAAmB,UAAsB,EAAE,KAAa;QACtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,oCAAoC;IAC7B,MAAM;QACX,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YACpC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;SAC/D,CAAC;IACJ,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,QAAQ,CAAC,IAAsC;QAC3D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,UAAU,GAAG,uBAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,WAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAO,CAAC,IAAI,EAAgB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACjJ,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,OAAO,CAAC,GAAW,EAAE,KAAU;QAC3C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC;CACF;AAhDD,0BAgDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { Descriptor, DescriptorJSON } from \"./Descriptor\";\nimport { Item, ItemJSON } from \"./Item\";\n\n/**\n * Serialized [[Content]] JSON representation.\n * @public\n */\nexport interface ContentJSON {\n descriptor: DescriptorJSON;\n contentSet: ItemJSON[];\n}\n\n/**\n * A data structure that contains the [[Descriptor]] and a list of [[Item]]\n * objects which are based on that descriptor.\n *\n * @public\n */\nexport class Content {\n /** Descriptor used to create the content */\n public readonly descriptor: Descriptor;\n /** Content items */\n public readonly contentSet: Item[];\n\n /** Create a new [[Content]] instance */\n public constructor(descriptor: Descriptor, items: Item[]) {\n this.descriptor = descriptor;\n this.contentSet = items;\n }\n\n /** Serialize this object to JSON */\n public toJSON(): ContentJSON {\n return {\n descriptor: this.descriptor.toJSON(),\n contentSet: this.contentSet.map((item: Item) => item.toJSON()),\n };\n }\n\n /** Deserialize [[Content]] from JSON */\n public static fromJSON(json: ContentJSON | string | undefined): Content | undefined {\n if (!json) {\n return undefined;\n }\n\n if (typeof json === \"string\") {\n return JSON.parse(json, (key, value) => Content.reviver(key, value));\n }\n\n const descriptor = Descriptor.fromJSON(json.descriptor);\n if (!descriptor) {\n return undefined;\n }\n\n const contentSet = json.contentSet.map((itemJson: ItemJSON) => Item.fromJSON(itemJson)).filter<Item>((item): item is Item => item !== undefined);\n return new Content(descriptor, contentSet);\n }\n\n /**\n * Reviver function that can be used as a second argument for\n * `JSON.parse` method when parsing Content objects.\n *\n * @internal\n */\n public static reviver(key: string, value: any): any {\n return key === \"\" ? Content.fromJSON(value) : value;\n }\n}\n"]}
1
+ {"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Content.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,6CAA0D;AAC1D,iCAAwC;AAWxC;;;;;GAKG;AACH,MAAa,OAAO;IAClB,4CAA4C;IAC5B,UAAU,CAAa;IACvC,oBAAoB;IACJ,UAAU,CAAS;IAEnC,wCAAwC;IACxC,YAAmB,UAAsB,EAAE,KAAa;QACtD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,oCAAoC;IAC7B,MAAM;QACX,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YACpC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;SAC/D,CAAC;IACJ,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,QAAQ,CAAC,IAAsC;QAC3D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,UAAU,GAAG,uBAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAO,CAAC,IAAI,EAAgB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACvI,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC;CACF;AAtCD,0BAsCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { Descriptor, DescriptorJSON } from \"./Descriptor\";\nimport { Item, ItemJSON } from \"./Item\";\n\n/**\n * Serialized [[Content]] JSON representation.\n * @public\n */\nexport interface ContentJSON {\n descriptor: DescriptorJSON;\n contentSet: ItemJSON[];\n}\n\n/**\n * A data structure that contains the [[Descriptor]] and a list of [[Item]]\n * objects which are based on that descriptor.\n *\n * @public\n */\nexport class Content {\n /** Descriptor used to create the content */\n public readonly descriptor: Descriptor;\n /** Content items */\n public readonly contentSet: Item[];\n\n /** Create a new [[Content]] instance */\n public constructor(descriptor: Descriptor, items: Item[]) {\n this.descriptor = descriptor;\n this.contentSet = items;\n }\n\n /** Serialize this object to JSON */\n public toJSON(): ContentJSON {\n return {\n descriptor: this.descriptor.toJSON(),\n contentSet: this.contentSet.map((item: Item) => item.toJSON()),\n };\n }\n\n /** Deserialize [[Content]] from JSON */\n public static fromJSON(json: ContentJSON | string | undefined): Content | undefined {\n if (!json) {\n return undefined;\n }\n\n if (typeof json === \"string\") {\n return Content.fromJSON(JSON.parse(json));\n }\n\n const descriptor = Descriptor.fromJSON(json.descriptor);\n if (!descriptor) {\n return undefined;\n }\n\n const contentSet = json.contentSet.map((itemJson) => Item.fromJSON(itemJson)).filter<Item>((item): item is Item => item !== undefined);\n return new Content(descriptor, contentSet);\n }\n}\n"]}
@@ -447,21 +447,26 @@ function convertNestedContentItemToStructArrayItem(item, field, nextField) {
447
447
  if (value.length === 0) {
448
448
  return { emptyNestedItem: true, convertedItem: item };
449
449
  }
450
- const nextFieldValues = { raw: [], display: [] };
451
- value.forEach((ncv) => {
452
- const nextRawValue = ncv.values[nextField.name];
453
- const nextDisplayValue = ncv.displayValues[nextField.name];
454
- if (nextField.isNestedContentField()) {
450
+ let nextFieldValues = { raw: [], display: [] };
451
+ if (nextField.isNestedContentField()) {
452
+ const nextNestedContent = [];
453
+ value.forEach((ncv) => {
454
+ const nextRawValue = ncv.values[nextField.name];
455
455
  if (nextRawValue) {
456
456
  (0, core_bentley_1.assert)(Value_1.Value.isNestedContent(nextRawValue));
457
- nextFieldValues.raw.push(...nextRawValue);
457
+ nextNestedContent.push(...nextRawValue);
458
458
  }
459
- }
460
- else {
461
- nextFieldValues.raw.push(nextRawValue);
462
- nextFieldValues.display.push(nextDisplayValue);
463
- }
464
- });
459
+ });
460
+ nextFieldValues.raw = nextNestedContent;
461
+ }
462
+ else {
463
+ const nextValues = { raw: [], display: [] };
464
+ value.forEach((ncv) => {
465
+ nextValues.raw.push(ncv.values[nextField.name]);
466
+ nextValues.display.push(ncv.displayValues[nextField.name]);
467
+ });
468
+ nextFieldValues = nextValues;
469
+ }
465
470
  const convertedItem = new Item_1.Item({
466
471
  ...item,
467
472
  values: { [nextField.name]: nextFieldValues.raw },