@openforis/arena-core 2.3.32 → 2.3.34

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 (837) hide show
  1. package/dist/app/appInfo.js.map +1 -1
  2. package/dist/app/index.js.map +1 -1
  3. package/dist/auth/authGroup.js.map +1 -1
  4. package/dist/auth/authGroups.js.map +1 -1
  5. package/dist/auth/authorizer.js +45 -0
  6. package/dist/auth/authorizer.js.map +1 -1
  7. package/dist/auth/factory.js.map +1 -1
  8. package/dist/auth/index.js.map +1 -1
  9. package/dist/auth/permission.js.map +1 -1
  10. package/dist/auth/user.js.map +1 -1
  11. package/dist/auth/userAuth.js.map +1 -1
  12. package/dist/auth/userAuthTokenService.d.ts +28 -0
  13. package/dist/auth/userAuthTokenService.js.map +1 -1
  14. package/dist/auth/userGroup.js.map +1 -1
  15. package/dist/auth/userService.js.map +1 -1
  16. package/dist/auth/users.js +1 -0
  17. package/dist/auth/users.js.map +1 -1
  18. package/dist/category/categories.js.map +1 -1
  19. package/dist/category/category.js.map +1 -1
  20. package/dist/category/categoryImportSummary.js.map +1 -1
  21. package/dist/category/categoryItemGenerator.js.map +1 -1
  22. package/dist/category/categoryItems.js.map +1 -1
  23. package/dist/category/factory.js.map +1 -1
  24. package/dist/category/index.js.map +1 -1
  25. package/dist/category/item.js.map +1 -1
  26. package/dist/category/itemService.js.map +1 -1
  27. package/dist/category/level.js.map +1 -1
  28. package/dist/category/levelService.js.map +1 -1
  29. package/dist/category/service.js.map +1 -1
  30. package/dist/chain/chain.js.map +1 -1
  31. package/dist/chain/chainFactory.js.map +1 -1
  32. package/dist/chain/chainNodeDef.js.map +1 -1
  33. package/dist/chain/chainNodeDefAggregate.js.map +1 -1
  34. package/dist/chain/chainNodeDefFactory.js.map +1 -1
  35. package/dist/chain/chainNodeDefService.js.map +1 -1
  36. package/dist/chain/chainService.js.map +1 -1
  37. package/dist/chain/index.js.map +1 -1
  38. package/dist/common/Dictionary.js.map +1 -1
  39. package/dist/common/factory.js.map +1 -1
  40. package/dist/common/i18n.js.map +1 -1
  41. package/dist/common/index.js.map +1 -1
  42. package/dist/dataExport/ArenaExportInfo.js.map +1 -1
  43. package/dist/dataExport/ArenaExportInfoFactory.js.map +1 -1
  44. package/dist/dataExport/FlatDataExportModel.js +3 -3
  45. package/dist/dataExport/FlatDataExportModel.js.map +1 -1
  46. package/dist/dataExport/FlatDataExportOptions.js.map +1 -1
  47. package/dist/dataExport/FlatDataFiles.js.map +1 -1
  48. package/dist/dataExport/UniqueFileNamesGenerator.d.ts +23 -0
  49. package/dist/dataExport/UniqueFileNamesGenerator.js +26 -1
  50. package/dist/dataExport/UniqueFileNamesGenerator.js.map +1 -1
  51. package/dist/dataExport/index.js.map +1 -1
  52. package/dist/dataQuery/dataQuery.js.map +1 -1
  53. package/dist/dataQuery/dataQuerySummaries.js +3 -0
  54. package/dist/dataQuery/dataQuerySummaries.js.map +1 -1
  55. package/dist/dataQuery/index.js.map +1 -1
  56. package/dist/error/SystemError.js +1 -0
  57. package/dist/error/SystemError.js.map +1 -1
  58. package/dist/error/index.js.map +1 -1
  59. package/dist/esm/app/appInfo.js.map +1 -1
  60. package/dist/esm/app/index.js.map +1 -1
  61. package/dist/esm/auth/authGroup.js.map +1 -1
  62. package/dist/esm/auth/authGroups.js.map +1 -1
  63. package/dist/esm/auth/authorizer.js +45 -0
  64. package/dist/esm/auth/authorizer.js.map +1 -1
  65. package/dist/esm/auth/factory.js.map +1 -1
  66. package/dist/esm/auth/index.js.map +1 -1
  67. package/dist/esm/auth/permission.js.map +1 -1
  68. package/dist/esm/auth/user.js.map +1 -1
  69. package/dist/esm/auth/userAuth.js.map +1 -1
  70. package/dist/esm/auth/userAuthTokenService.js.map +1 -1
  71. package/dist/esm/auth/userGroup.js.map +1 -1
  72. package/dist/esm/auth/userService.js.map +1 -1
  73. package/dist/esm/auth/users.js +1 -0
  74. package/dist/esm/auth/users.js.map +1 -1
  75. package/dist/esm/category/categories.js.map +1 -1
  76. package/dist/esm/category/category.js.map +1 -1
  77. package/dist/esm/category/categoryImportSummary.js.map +1 -1
  78. package/dist/esm/category/categoryItemGenerator.js.map +1 -1
  79. package/dist/esm/category/categoryItems.js.map +1 -1
  80. package/dist/esm/category/factory.js.map +1 -1
  81. package/dist/esm/category/index.js.map +1 -1
  82. package/dist/esm/category/item.js.map +1 -1
  83. package/dist/esm/category/itemService.js.map +1 -1
  84. package/dist/esm/category/level.js.map +1 -1
  85. package/dist/esm/category/levelService.js.map +1 -1
  86. package/dist/esm/category/service.js.map +1 -1
  87. package/dist/esm/chain/chain.js.map +1 -1
  88. package/dist/esm/chain/chainFactory.js.map +1 -1
  89. package/dist/esm/chain/chainNodeDef.js.map +1 -1
  90. package/dist/esm/chain/chainNodeDefAggregate.js.map +1 -1
  91. package/dist/esm/chain/chainNodeDefFactory.js.map +1 -1
  92. package/dist/esm/chain/chainNodeDefService.js.map +1 -1
  93. package/dist/esm/chain/chainService.js.map +1 -1
  94. package/dist/esm/chain/index.js.map +1 -1
  95. package/dist/esm/common/Dictionary.js.map +1 -1
  96. package/dist/esm/common/factory.js.map +1 -1
  97. package/dist/esm/common/i18n.js.map +1 -1
  98. package/dist/esm/common/index.js.map +1 -1
  99. package/dist/esm/dataExport/ArenaExportInfo.js.map +1 -1
  100. package/dist/esm/dataExport/ArenaExportInfoFactory.js.map +1 -1
  101. package/dist/esm/dataExport/FlatDataExportModel.js +3 -3
  102. package/dist/esm/dataExport/FlatDataExportModel.js.map +1 -1
  103. package/dist/esm/dataExport/FlatDataExportOptions.js.map +1 -1
  104. package/dist/esm/dataExport/FlatDataFiles.js.map +1 -1
  105. package/dist/esm/dataExport/UniqueFileNamesGenerator.js +26 -1
  106. package/dist/esm/dataExport/UniqueFileNamesGenerator.js.map +1 -1
  107. package/dist/esm/dataExport/index.js.map +1 -1
  108. package/dist/esm/dataQuery/dataQuery.js.map +1 -1
  109. package/dist/esm/dataQuery/dataQuerySummaries.js +3 -0
  110. package/dist/esm/dataQuery/dataQuerySummaries.js.map +1 -1
  111. package/dist/esm/dataQuery/index.js.map +1 -1
  112. package/dist/esm/error/SystemError.js +1 -0
  113. package/dist/esm/error/SystemError.js.map +1 -1
  114. package/dist/esm/error/index.js.map +1 -1
  115. package/dist/esm/expression/context.js.map +1 -1
  116. package/dist/esm/expression/evaluator.js.map +1 -1
  117. package/dist/esm/expression/function.js.map +1 -1
  118. package/dist/esm/expression/index.js.map +1 -1
  119. package/dist/esm/expression/javascript/evaluator.js +3 -0
  120. package/dist/esm/expression/javascript/evaluator.js.map +1 -1
  121. package/dist/esm/expression/javascript/functionsDefault.js.map +1 -1
  122. package/dist/esm/expression/javascript/global.js.map +1 -1
  123. package/dist/esm/expression/javascript/node/array.js.map +1 -1
  124. package/dist/esm/expression/javascript/node/binary.js +23 -0
  125. package/dist/esm/expression/javascript/node/binary.js.map +1 -1
  126. package/dist/esm/expression/javascript/node/call.js +12 -0
  127. package/dist/esm/expression/javascript/node/call.js.map +1 -1
  128. package/dist/esm/expression/javascript/node/compound.js.map +1 -1
  129. package/dist/esm/expression/javascript/node/conditional.js.map +1 -1
  130. package/dist/esm/expression/javascript/node/identifier.js +7 -0
  131. package/dist/esm/expression/javascript/node/identifier.js.map +1 -1
  132. package/dist/esm/expression/javascript/node/literal.js.map +1 -1
  133. package/dist/esm/expression/javascript/node/member.js +5 -1
  134. package/dist/esm/expression/javascript/node/member.js.map +1 -1
  135. package/dist/esm/expression/javascript/node/sequence.js.map +1 -1
  136. package/dist/esm/expression/javascript/node/this.js.map +1 -1
  137. package/dist/esm/expression/javascript/node/unary.js +8 -0
  138. package/dist/esm/expression/javascript/node/unary.js.map +1 -1
  139. package/dist/esm/expression/javascript/parser/jsep.js +6 -2
  140. package/dist/esm/expression/javascript/parser/jsep.js.map +1 -1
  141. package/dist/esm/expression/javascript/parser/parser.js.map +1 -1
  142. package/dist/esm/expression/node.js.map +1 -1
  143. package/dist/esm/expression/parser.js.map +1 -1
  144. package/dist/esm/expression/variable.js.map +1 -1
  145. package/dist/esm/extraProp/extraProp.js.map +1 -1
  146. package/dist/esm/extraProp/extraProps.js.map +1 -1
  147. package/dist/esm/extraProp/extraPropsDataGenerator.js.map +1 -1
  148. package/dist/esm/extraProp/index.js.map +1 -1
  149. package/dist/esm/geo/index.js.map +1 -1
  150. package/dist/esm/geo/point.js.map +1 -1
  151. package/dist/esm/geo/pointFactory.js.map +1 -1
  152. package/dist/esm/geo/points/bearing.js +11 -0
  153. package/dist/esm/geo/points/bearing.js.map +1 -1
  154. package/dist/esm/geo/points/distance.js +9 -0
  155. package/dist/esm/geo/points/distance.js.map +1 -1
  156. package/dist/esm/geo/points/equals.js.map +1 -1
  157. package/dist/esm/geo/points/getSrs.js.map +1 -1
  158. package/dist/esm/geo/points/index.js.map +1 -1
  159. package/dist/esm/geo/points/isFilled.js.map +1 -1
  160. package/dist/esm/geo/points/isValid.js +1 -1
  161. package/dist/esm/geo/points/isValid.js.map +1 -1
  162. package/dist/esm/geo/points/parse.js +9 -0
  163. package/dist/esm/geo/points/parse.js.map +1 -1
  164. package/dist/esm/geo/points/pointAtDistance.js +10 -0
  165. package/dist/esm/geo/points/pointAtDistance.js.map +1 -1
  166. package/dist/esm/geo/points/toLatLong.js.map +1 -1
  167. package/dist/esm/geo/points/toString.js.map +1 -1
  168. package/dist/esm/geo/points/transform.js +12 -0
  169. package/dist/esm/geo/points/transform.js.map +1 -1
  170. package/dist/esm/index.js.map +1 -1
  171. package/dist/esm/job/JobBase.js +99 -0
  172. package/dist/esm/job/JobBase.js.map +1 -1
  173. package/dist/esm/job/index.js.map +1 -1
  174. package/dist/esm/job/job.js.map +1 -1
  175. package/dist/esm/job/jobContext.js.map +1 -1
  176. package/dist/esm/job/jobEvent.js.map +1 -1
  177. package/dist/esm/job/jobSerialized.js.map +1 -1
  178. package/dist/esm/job/status.js.map +1 -1
  179. package/dist/esm/language/index.js.map +1 -1
  180. package/dist/esm/language/labels.js.map +1 -1
  181. package/dist/esm/language/languageCode.js.map +1 -1
  182. package/dist/esm/language/languages.js.map +1 -1
  183. package/dist/esm/logger/index.js.map +1 -1
  184. package/dist/esm/logger/logger.js.map +1 -1
  185. package/dist/esm/message/index.js.map +1 -1
  186. package/dist/esm/message/message.js.map +1 -1
  187. package/dist/esm/message/messages.js +1 -0
  188. package/dist/esm/message/messages.js.map +1 -1
  189. package/dist/esm/node/factory.js.map +1 -1
  190. package/dist/esm/node/index.js.map +1 -1
  191. package/dist/esm/node/node.js.map +1 -1
  192. package/dist/esm/node/nodePointer.js.map +1 -1
  193. package/dist/esm/node/nodeValue/code.js.map +1 -1
  194. package/dist/esm/node/nodeValue/coordinate.js.map +1 -1
  195. package/dist/esm/node/nodeValue/file.js.map +1 -1
  196. package/dist/esm/node/nodeValue/index.js.map +1 -1
  197. package/dist/esm/node/nodeValue/nodeValueComposite.js.map +1 -1
  198. package/dist/esm/node/nodeValue/taxon.js.map +1 -1
  199. package/dist/esm/node/nodeValueFormatter.js +2 -0
  200. package/dist/esm/node/nodeValueFormatter.js.map +1 -1
  201. package/dist/esm/node/nodeValueProps.js.map +1 -1
  202. package/dist/esm/node/nodeValues.js +20 -0
  203. package/dist/esm/node/nodeValues.js.map +1 -1
  204. package/dist/esm/node/nodes.js +7 -0
  205. package/dist/esm/node/nodes.js.map +1 -1
  206. package/dist/esm/node/service.js.map +1 -1
  207. package/dist/esm/nodeDef/factory.js.map +1 -1
  208. package/dist/esm/nodeDef/index.js.map +1 -1
  209. package/dist/esm/nodeDef/nodeDef.js +1 -0
  210. package/dist/esm/nodeDef/nodeDef.js.map +1 -1
  211. package/dist/esm/nodeDef/nodeDefs.js +18 -0
  212. package/dist/esm/nodeDef/nodeDefs.js.map +1 -1
  213. package/dist/esm/nodeDef/service.js.map +1 -1
  214. package/dist/esm/nodeDef/types/boolean.js.map +1 -1
  215. package/dist/esm/nodeDef/types/code.js.map +1 -1
  216. package/dist/esm/nodeDef/types/coordinate.js.map +1 -1
  217. package/dist/esm/nodeDef/types/date.js.map +1 -1
  218. package/dist/esm/nodeDef/types/decimal.js.map +1 -1
  219. package/dist/esm/nodeDef/types/entity.js.map +1 -1
  220. package/dist/esm/nodeDef/types/file.js.map +1 -1
  221. package/dist/esm/nodeDef/types/formHeader.js.map +1 -1
  222. package/dist/esm/nodeDef/types/integer.js.map +1 -1
  223. package/dist/esm/nodeDef/types/taxon.js.map +1 -1
  224. package/dist/esm/nodeDef/types/text.js.map +1 -1
  225. package/dist/esm/nodeDef/types/time.js.map +1 -1
  226. package/dist/esm/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
  227. package/dist/esm/nodeDefExpressionEvaluator/context.js.map +1 -1
  228. package/dist/esm/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  229. package/dist/esm/nodeDefExpressionEvaluator/functions.js +8 -1
  230. package/dist/esm/nodeDefExpressionEvaluator/functions.js.map +1 -1
  231. package/dist/esm/nodeDefExpressionEvaluator/index.js.map +1 -1
  232. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js +28 -0
  233. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  234. package/dist/esm/nodeDefExpressionEvaluator/node/member.js +15 -0
  235. package/dist/esm/nodeDefExpressionEvaluator/node/member.js.map +1 -1
  236. package/dist/esm/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js +3 -0
  237. package/dist/esm/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js.map +1 -1
  238. package/dist/esm/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  239. package/dist/esm/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
  240. package/dist/esm/nodeDefExpressionEvaluator/validator.js.map +1 -1
  241. package/dist/esm/record/_records/recordCompletion.js +14 -0
  242. package/dist/esm/record/_records/recordCompletion.js.map +1 -1
  243. package/dist/esm/record/_records/recordGetters.js +19 -2
  244. package/dist/esm/record/_records/recordGetters.js.map +1 -1
  245. package/dist/esm/record/_records/recordNodesIndexReader.js.map +1 -1
  246. package/dist/esm/record/_records/recordNodesIndexUpdater.js +17 -0
  247. package/dist/esm/record/_records/recordNodesIndexUpdater.js.map +1 -1
  248. package/dist/esm/record/_records/recordPagesValidation.js +45 -0
  249. package/dist/esm/record/_records/recordPagesValidation.js.map +1 -1
  250. package/dist/esm/record/_records/recordUpdateOptions.js.map +1 -1
  251. package/dist/esm/record/_records/recordUpdater.js +2 -0
  252. package/dist/esm/record/_records/recordUpdater.js.map +1 -1
  253. package/dist/esm/record/_records/recordUtils.js.map +1 -1
  254. package/dist/esm/record/factory.js.map +1 -1
  255. package/dist/esm/record/index.js.map +1 -1
  256. package/dist/esm/record/nodePointers.js.map +1 -1
  257. package/dist/esm/record/record.js.map +1 -1
  258. package/dist/esm/record/recordCloner.js +10 -1
  259. package/dist/esm/record/recordCloner.js.map +1 -1
  260. package/dist/esm/record/recordExpressionEvaluator/context.js.map +1 -1
  261. package/dist/esm/record/recordExpressionEvaluator/functions.js.map +1 -1
  262. package/dist/esm/record/recordExpressionEvaluator/index.js.map +1 -1
  263. package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js +14 -0
  264. package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
  265. package/dist/esm/record/recordExpressionEvaluator/node/identifier/index.js.map +1 -1
  266. package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +6 -0
  267. package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
  268. package/dist/esm/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  269. package/dist/esm/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
  270. package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  271. package/dist/esm/record/recordFixer.js +16 -0
  272. package/dist/esm/record/recordFixer.js.map +1 -1
  273. package/dist/esm/record/recordNodesUpdater/index.js.map +1 -1
  274. package/dist/esm/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js +6 -0
  275. package/dist/esm/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
  276. package/dist/esm/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
  277. package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js +5 -0
  278. package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
  279. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +20 -2
  280. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  281. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js +2 -1
  282. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  283. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +13 -1
  284. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  285. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +9 -1
  286. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  287. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +17 -1
  288. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  289. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
  290. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +5 -1
  291. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
  292. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +4 -2
  293. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
  294. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +8 -3
  295. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  296. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
  297. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
  298. package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js +10 -5
  299. package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
  300. package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js +7 -0
  301. package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
  302. package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js +2 -0
  303. package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  304. package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js +16 -2
  305. package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  306. package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js +8 -0
  307. package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  308. package/dist/esm/record/recordPrettyPrinter.js.map +1 -1
  309. package/dist/esm/record/recordStep.js.map +1 -1
  310. package/dist/esm/record/recordUpdater.js +1 -0
  311. package/dist/esm/record/recordUpdater.js.map +1 -1
  312. package/dist/esm/record/recordValidations.js.map +1 -1
  313. package/dist/esm/record/recordValidator/attributeKeyValidator.js +3 -0
  314. package/dist/esm/record/recordValidator/attributeKeyValidator.js.map +1 -1
  315. package/dist/esm/record/recordValidator/attributeTypeValidator.js +3 -0
  316. package/dist/esm/record/recordValidator/attributeTypeValidator.js.map +1 -1
  317. package/dist/esm/record/recordValidator/attributeUniqueValidator.js +2 -0
  318. package/dist/esm/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  319. package/dist/esm/record/recordValidator/attributeValidator.js +12 -1
  320. package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
  321. package/dist/esm/record/recordValidator/countVaildator.js +5 -0
  322. package/dist/esm/record/recordValidator/countVaildator.js.map +1 -1
  323. package/dist/esm/record/recordValidator/index.js.map +1 -1
  324. package/dist/esm/record/recordValidator/recordValidator.js +3 -0
  325. package/dist/esm/record/recordValidator/recordValidator.js.map +1 -1
  326. package/dist/esm/record/records.js +3 -0
  327. package/dist/esm/record/records.js.map +1 -1
  328. package/dist/esm/record/service.js.map +1 -1
  329. package/dist/esm/registry/index.js.map +1 -1
  330. package/dist/esm/registry/serviceRegistry.js.map +1 -1
  331. package/dist/esm/registry/serviceType.js.map +1 -1
  332. package/dist/esm/srs/factory.js.map +1 -1
  333. package/dist/esm/srs/index.js.map +1 -1
  334. package/dist/esm/srs/srs.js.map +1 -1
  335. package/dist/esm/survey/factory.js +1 -0
  336. package/dist/esm/survey/factory.js.map +1 -1
  337. package/dist/esm/survey/index.js.map +1 -1
  338. package/dist/esm/survey/nodeDefsFixer.js +1 -0
  339. package/dist/esm/survey/nodeDefsFixer.js.map +1 -1
  340. package/dist/esm/survey/refData/factory.js.map +1 -1
  341. package/dist/esm/survey/refData/index.js.map +1 -1
  342. package/dist/esm/survey/refData/refData.js.map +1 -1
  343. package/dist/esm/survey/service.js.map +1 -1
  344. package/dist/esm/survey/survey.js.map +1 -1
  345. package/dist/esm/survey/surveyDocImageFactory.js.map +1 -1
  346. package/dist/esm/survey/surveyDocImages.js.map +1 -1
  347. package/dist/esm/survey/surveyFileFactory.js.map +1 -1
  348. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsIndex.js +8 -0
  349. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
  350. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  351. package/dist/esm/survey/surveys/dependencies.js +11 -2
  352. package/dist/esm/survey/surveys/dependencies.js.map +1 -1
  353. package/dist/esm/survey/surveys/index.js +6 -0
  354. package/dist/esm/survey/surveys/index.js.map +1 -1
  355. package/dist/esm/survey/surveys/nodeDefs.js +12 -0
  356. package/dist/esm/survey/surveys/nodeDefs.js.map +1 -1
  357. package/dist/esm/survey/surveys/refsData.js.map +1 -1
  358. package/dist/esm/survey/surveys/surveyGettersSecurity.js.map +1 -1
  359. package/dist/esm/survey/surveys/surveysGetters.js +3 -1
  360. package/dist/esm/survey/surveys/surveysGetters.js.map +1 -1
  361. package/dist/esm/survey/surveys/surveysUtils.js.map +1 -1
  362. package/dist/esm/taxonomy/factory.js.map +1 -1
  363. package/dist/esm/taxonomy/index.js.map +1 -1
  364. package/dist/esm/taxonomy/service.js.map +1 -1
  365. package/dist/esm/taxonomy/taxa.js.map +1 -1
  366. package/dist/esm/taxonomy/taxon.js.map +1 -1
  367. package/dist/esm/taxonomy/taxonGenerator.js.map +1 -1
  368. package/dist/esm/taxonomy/taxonService.js.map +1 -1
  369. package/dist/esm/taxonomy/taxonVernacularName.js.map +1 -1
  370. package/dist/esm/taxonomy/taxonomies.js.map +1 -1
  371. package/dist/esm/taxonomy/taxonomy.js.map +1 -1
  372. package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js +2 -0
  373. package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
  374. package/dist/esm/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
  375. package/dist/esm/tests/builder/recordBuilder/index.js.map +1 -1
  376. package/dist/esm/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  377. package/dist/esm/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
  378. package/dist/esm/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
  379. package/dist/esm/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
  380. package/dist/esm/tests/builder/surveyBuilder/index.js.map +1 -1
  381. package/dist/esm/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  382. package/dist/esm/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  383. package/dist/esm/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  384. package/dist/esm/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  385. package/dist/esm/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  386. package/dist/esm/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
  387. package/dist/esm/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
  388. package/dist/esm/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
  389. package/dist/esm/utils/_objects/assoc.js.map +1 -1
  390. package/dist/esm/utils/_objects/assocPath.js +1 -0
  391. package/dist/esm/utils/_objects/assocPath.js.map +1 -1
  392. package/dist/esm/utils/_objects/camelize.js +9 -0
  393. package/dist/esm/utils/_objects/camelize.js.map +1 -1
  394. package/dist/esm/utils/_objects/deepMerge.js +10 -0
  395. package/dist/esm/utils/_objects/deepMerge.js.map +1 -1
  396. package/dist/esm/utils/_objects/deleteEmptyProps.js.map +1 -1
  397. package/dist/esm/utils/_objects/difference.js.map +1 -1
  398. package/dist/esm/utils/_objects/dissoc.js.map +1 -1
  399. package/dist/esm/utils/_objects/dissocPath.js +1 -0
  400. package/dist/esm/utils/_objects/dissocPath.js.map +1 -1
  401. package/dist/esm/utils/_objects/dissocPathIfEmpty.js.map +1 -1
  402. package/dist/esm/utils/_objects/fromPairs.js.map +1 -1
  403. package/dist/esm/utils/_objects/index.js.map +1 -1
  404. package/dist/esm/utils/_objects/isEmpty.js +8 -0
  405. package/dist/esm/utils/_objects/isEmpty.js.map +1 -1
  406. package/dist/esm/utils/_objects/isEqual.js.map +1 -1
  407. package/dist/esm/utils/_objects/isNil.js +6 -0
  408. package/dist/esm/utils/_objects/isNil.js.map +1 -1
  409. package/dist/esm/utils/_objects/isNotEmpty.js +6 -0
  410. package/dist/esm/utils/_objects/isNotEmpty.js.map +1 -1
  411. package/dist/esm/utils/_objects/parse.js +8 -0
  412. package/dist/esm/utils/_objects/parse.js.map +1 -1
  413. package/dist/esm/utils/_objects/path.js +7 -0
  414. package/dist/esm/utils/_objects/path.js.map +1 -1
  415. package/dist/esm/utils/_objects/propertyOf.js.map +1 -1
  416. package/dist/esm/utils/_objects/setInPath.js.map +1 -1
  417. package/dist/esm/utils/_objects/stringify.js +9 -0
  418. package/dist/esm/utils/_objects/stringify.js.map +1 -1
  419. package/dist/esm/utils/_objects/toPairs.js.map +1 -1
  420. package/dist/esm/utils/arrays.js.map +1 -1
  421. package/dist/esm/utils/dates.js +66 -15
  422. package/dist/esm/utils/dates.js.map +1 -1
  423. package/dist/esm/utils/fileNames.js.map +1 -1
  424. package/dist/esm/utils/fileProcessor.js +5 -1
  425. package/dist/esm/utils/fileProcessor.js.map +1 -1
  426. package/dist/esm/utils/index.js.map +1 -1
  427. package/dist/esm/utils/numbers.js +21 -0
  428. package/dist/esm/utils/numbers.js.map +1 -1
  429. package/dist/esm/utils/promises.js +15 -1
  430. package/dist/esm/utils/promises.js.map +1 -1
  431. package/dist/esm/utils/queue.js +9 -0
  432. package/dist/esm/utils/queue.js.map +1 -1
  433. package/dist/esm/utils/retryProcessor.js +5 -1
  434. package/dist/esm/utils/retryProcessor.js.map +1 -1
  435. package/dist/esm/utils/strings.js.map +1 -1
  436. package/dist/esm/utils/uuids.js.map +1 -1
  437. package/dist/esm/utils/versions.js +4 -0
  438. package/dist/esm/utils/versions.js.map +1 -1
  439. package/dist/esm/validation/factory.js.map +1 -1
  440. package/dist/esm/validation/fieldValidator.js.map +1 -1
  441. package/dist/esm/validation/fieldValidators/email.js +3 -0
  442. package/dist/esm/validation/fieldValidators/email.js.map +1 -1
  443. package/dist/esm/validation/fieldValidators/index.js.map +1 -1
  444. package/dist/esm/validation/fieldValidators/name.js +4 -0
  445. package/dist/esm/validation/fieldValidators/name.js.map +1 -1
  446. package/dist/esm/validation/fieldValidators/notKeyword.js.map +1 -1
  447. package/dist/esm/validation/fieldValidators/numeric.js.map +1 -1
  448. package/dist/esm/validation/fieldValidators/numericPositive.js.map +1 -1
  449. package/dist/esm/validation/fieldValidators/required.js.map +1 -1
  450. package/dist/esm/validation/index.js.map +1 -1
  451. package/dist/esm/validation/validation.js.map +1 -1
  452. package/dist/esm/validation/validationResults.js +1 -1
  453. package/dist/esm/validation/validationResults.js.map +1 -1
  454. package/dist/esm/validation/validations.js +17 -1
  455. package/dist/esm/validation/validations.js.map +1 -1
  456. package/dist/esm/validation/validator.js.map +1 -1
  457. package/dist/esm/validation/validatorErrorKeys.js.map +1 -1
  458. package/dist/expression/context.d.ts +6 -0
  459. package/dist/expression/context.js.map +1 -1
  460. package/dist/expression/evaluator.js.map +1 -1
  461. package/dist/expression/function.d.ts +13 -0
  462. package/dist/expression/function.js.map +1 -1
  463. package/dist/expression/index.js.map +1 -1
  464. package/dist/expression/javascript/evaluator.js +3 -0
  465. package/dist/expression/javascript/evaluator.js.map +1 -1
  466. package/dist/expression/javascript/functionsDefault.js.map +1 -1
  467. package/dist/expression/javascript/global.js.map +1 -1
  468. package/dist/expression/javascript/node/array.js.map +1 -1
  469. package/dist/expression/javascript/node/binary.js +23 -0
  470. package/dist/expression/javascript/node/binary.js.map +1 -1
  471. package/dist/expression/javascript/node/call.js +12 -0
  472. package/dist/expression/javascript/node/call.js.map +1 -1
  473. package/dist/expression/javascript/node/compound.js.map +1 -1
  474. package/dist/expression/javascript/node/conditional.js.map +1 -1
  475. package/dist/expression/javascript/node/identifier.d.ts +7 -0
  476. package/dist/expression/javascript/node/identifier.js +7 -0
  477. package/dist/expression/javascript/node/identifier.js.map +1 -1
  478. package/dist/expression/javascript/node/literal.js.map +1 -1
  479. package/dist/expression/javascript/node/member.js +5 -1
  480. package/dist/expression/javascript/node/member.js.map +1 -1
  481. package/dist/expression/javascript/node/sequence.js.map +1 -1
  482. package/dist/expression/javascript/node/this.js.map +1 -1
  483. package/dist/expression/javascript/node/unary.js +8 -0
  484. package/dist/expression/javascript/node/unary.js.map +1 -1
  485. package/dist/expression/javascript/parser/jsep.js +6 -2
  486. package/dist/expression/javascript/parser/jsep.js.map +1 -1
  487. package/dist/expression/javascript/parser/parser.js.map +1 -1
  488. package/dist/expression/node.js.map +1 -1
  489. package/dist/expression/parser.js.map +1 -1
  490. package/dist/expression/variable.js.map +1 -1
  491. package/dist/extraProp/extraProp.js.map +1 -1
  492. package/dist/extraProp/extraProps.js.map +1 -1
  493. package/dist/extraProp/extraPropsDataGenerator.js.map +1 -1
  494. package/dist/extraProp/index.js.map +1 -1
  495. package/dist/geo/index.js.map +1 -1
  496. package/dist/geo/point.js.map +1 -1
  497. package/dist/geo/pointFactory.js.map +1 -1
  498. package/dist/geo/points/bearing.d.ts +9 -0
  499. package/dist/geo/points/bearing.js +11 -0
  500. package/dist/geo/points/bearing.js.map +1 -1
  501. package/dist/geo/points/distance.d.ts +8 -0
  502. package/dist/geo/points/distance.js +9 -0
  503. package/dist/geo/points/distance.js.map +1 -1
  504. package/dist/geo/points/equals.js.map +1 -1
  505. package/dist/geo/points/getSrs.js.map +1 -1
  506. package/dist/geo/points/index.js.map +1 -1
  507. package/dist/geo/points/isFilled.js.map +1 -1
  508. package/dist/geo/points/isValid.js +1 -1
  509. package/dist/geo/points/isValid.js.map +1 -1
  510. package/dist/geo/points/parse.d.ts +9 -0
  511. package/dist/geo/points/parse.js +9 -0
  512. package/dist/geo/points/parse.js.map +1 -1
  513. package/dist/geo/points/pointAtDistance.d.ts +9 -0
  514. package/dist/geo/points/pointAtDistance.js +10 -0
  515. package/dist/geo/points/pointAtDistance.js.map +1 -1
  516. package/dist/geo/points/toLatLong.js.map +1 -1
  517. package/dist/geo/points/toString.js.map +1 -1
  518. package/dist/geo/points/transform.d.ts +8 -0
  519. package/dist/geo/points/transform.js +12 -0
  520. package/dist/geo/points/transform.js.map +1 -1
  521. package/dist/index.js.map +1 -1
  522. package/dist/job/JobBase.d.ts +81 -0
  523. package/dist/job/JobBase.js +99 -0
  524. package/dist/job/JobBase.js.map +1 -1
  525. package/dist/job/index.js.map +1 -1
  526. package/dist/job/job.d.ts +20 -0
  527. package/dist/job/job.js.map +1 -1
  528. package/dist/job/jobContext.js.map +1 -1
  529. package/dist/job/jobEvent.js.map +1 -1
  530. package/dist/job/jobSerialized.d.ts +3 -0
  531. package/dist/job/jobSerialized.js.map +1 -1
  532. package/dist/job/status.js.map +1 -1
  533. package/dist/language/index.js.map +1 -1
  534. package/dist/language/labels.js.map +1 -1
  535. package/dist/language/languageCode.js.map +1 -1
  536. package/dist/language/languages.js.map +1 -1
  537. package/dist/logger/index.js.map +1 -1
  538. package/dist/logger/logger.js.map +1 -1
  539. package/dist/message/index.js.map +1 -1
  540. package/dist/message/message.d.ts +3 -0
  541. package/dist/message/message.js.map +1 -1
  542. package/dist/message/messages.js +1 -0
  543. package/dist/message/messages.js.map +1 -1
  544. package/dist/node/factory.js.map +1 -1
  545. package/dist/node/index.js.map +1 -1
  546. package/dist/node/node.d.ts +38 -0
  547. package/dist/node/node.js.map +1 -1
  548. package/dist/node/nodePointer.js.map +1 -1
  549. package/dist/node/nodeValue/code.js.map +1 -1
  550. package/dist/node/nodeValue/coordinate.js.map +1 -1
  551. package/dist/node/nodeValue/file.js.map +1 -1
  552. package/dist/node/nodeValue/index.js.map +1 -1
  553. package/dist/node/nodeValue/nodeValueComposite.js.map +1 -1
  554. package/dist/node/nodeValue/taxon.js.map +1 -1
  555. package/dist/node/nodeValueFormatter.js +2 -0
  556. package/dist/node/nodeValueFormatter.js.map +1 -1
  557. package/dist/node/nodeValueProps.js.map +1 -1
  558. package/dist/node/nodeValues.d.ts +4 -0
  559. package/dist/node/nodeValues.js +20 -0
  560. package/dist/node/nodeValues.js.map +1 -1
  561. package/dist/node/nodes.js +7 -0
  562. package/dist/node/nodes.js.map +1 -1
  563. package/dist/node/service.js.map +1 -1
  564. package/dist/nodeDef/factory.js.map +1 -1
  565. package/dist/nodeDef/index.js.map +1 -1
  566. package/dist/nodeDef/nodeDef.js +1 -0
  567. package/dist/nodeDef/nodeDef.js.map +1 -1
  568. package/dist/nodeDef/nodeDefs.js +18 -0
  569. package/dist/nodeDef/nodeDefs.js.map +1 -1
  570. package/dist/nodeDef/service.js.map +1 -1
  571. package/dist/nodeDef/types/boolean.js.map +1 -1
  572. package/dist/nodeDef/types/code.js.map +1 -1
  573. package/dist/nodeDef/types/coordinate.js.map +1 -1
  574. package/dist/nodeDef/types/date.js.map +1 -1
  575. package/dist/nodeDef/types/decimal.js.map +1 -1
  576. package/dist/nodeDef/types/entity.d.ts +1 -0
  577. package/dist/nodeDef/types/entity.js.map +1 -1
  578. package/dist/nodeDef/types/file.js.map +1 -1
  579. package/dist/nodeDef/types/formHeader.js.map +1 -1
  580. package/dist/nodeDef/types/integer.js.map +1 -1
  581. package/dist/nodeDef/types/taxon.js.map +1 -1
  582. package/dist/nodeDef/types/text.js.map +1 -1
  583. package/dist/nodeDef/types/time.js.map +1 -1
  584. package/dist/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
  585. package/dist/nodeDefExpressionEvaluator/context.d.ts +3 -0
  586. package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
  587. package/dist/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  588. package/dist/nodeDefExpressionEvaluator/functions.js +8 -1
  589. package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
  590. package/dist/nodeDefExpressionEvaluator/index.js.map +1 -1
  591. package/dist/nodeDefExpressionEvaluator/node/identifier.d.ts +14 -0
  592. package/dist/nodeDefExpressionEvaluator/node/identifier.js +28 -0
  593. package/dist/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  594. package/dist/nodeDefExpressionEvaluator/node/member.js +15 -0
  595. package/dist/nodeDefExpressionEvaluator/node/member.js.map +1 -1
  596. package/dist/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js +3 -0
  597. package/dist/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js.map +1 -1
  598. package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  599. package/dist/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
  600. package/dist/nodeDefExpressionEvaluator/validator.js.map +1 -1
  601. package/dist/record/_records/recordCompletion.d.ts +12 -0
  602. package/dist/record/_records/recordCompletion.js +14 -0
  603. package/dist/record/_records/recordCompletion.js.map +1 -1
  604. package/dist/record/_records/recordGetters.d.ts +3 -0
  605. package/dist/record/_records/recordGetters.js +19 -2
  606. package/dist/record/_records/recordGetters.js.map +1 -1
  607. package/dist/record/_records/recordNodesIndexReader.js.map +1 -1
  608. package/dist/record/_records/recordNodesIndexUpdater.js +17 -0
  609. package/dist/record/_records/recordNodesIndexUpdater.js.map +1 -1
  610. package/dist/record/_records/recordPagesValidation.d.ts +39 -0
  611. package/dist/record/_records/recordPagesValidation.js +45 -0
  612. package/dist/record/_records/recordPagesValidation.js.map +1 -1
  613. package/dist/record/_records/recordUpdateOptions.js.map +1 -1
  614. package/dist/record/_records/recordUpdater.js +2 -0
  615. package/dist/record/_records/recordUpdater.js.map +1 -1
  616. package/dist/record/_records/recordUtils.js.map +1 -1
  617. package/dist/record/factory.js.map +1 -1
  618. package/dist/record/index.js.map +1 -1
  619. package/dist/record/nodePointers.js.map +1 -1
  620. package/dist/record/record.d.ts +12 -0
  621. package/dist/record/record.js.map +1 -1
  622. package/dist/record/recordCloner.js +10 -1
  623. package/dist/record/recordCloner.js.map +1 -1
  624. package/dist/record/recordExpressionEvaluator/context.js.map +1 -1
  625. package/dist/record/recordExpressionEvaluator/functions.js.map +1 -1
  626. package/dist/record/recordExpressionEvaluator/index.js.map +1 -1
  627. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js +14 -0
  628. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
  629. package/dist/record/recordExpressionEvaluator/node/identifier/index.js.map +1 -1
  630. package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +6 -0
  631. package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
  632. package/dist/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  633. package/dist/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
  634. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  635. package/dist/record/recordFixer.js +16 -0
  636. package/dist/record/recordFixer.js.map +1 -1
  637. package/dist/record/recordNodesUpdater/index.js.map +1 -1
  638. package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.d.ts +6 -0
  639. package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js +6 -0
  640. package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
  641. package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
  642. package/dist/record/recordNodesUpdater/recordExpressionValueConverter.js +5 -0
  643. package/dist/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
  644. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +20 -2
  645. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  646. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js +2 -1
  647. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  648. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +13 -1
  649. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  650. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +9 -1
  651. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  652. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +17 -1
  653. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  654. package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
  655. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +5 -1
  656. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
  657. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +4 -2
  658. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
  659. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +8 -3
  660. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  661. package/dist/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
  662. package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
  663. package/dist/record/recordNodesUpdater/recordNodesCreator.js +10 -5
  664. package/dist/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
  665. package/dist/record/recordNodesUpdater/recordNodesDeleter.js +7 -0
  666. package/dist/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
  667. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js +2 -0
  668. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  669. package/dist/record/recordNodesUpdater/recordNodesUpdater.js +16 -2
  670. package/dist/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  671. package/dist/record/recordNodesUpdater/recordUpdateResult.d.ts +8 -0
  672. package/dist/record/recordNodesUpdater/recordUpdateResult.js +8 -0
  673. package/dist/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  674. package/dist/record/recordPrettyPrinter.js.map +1 -1
  675. package/dist/record/recordStep.js.map +1 -1
  676. package/dist/record/recordUpdater.js +1 -0
  677. package/dist/record/recordUpdater.js.map +1 -1
  678. package/dist/record/recordValidations.js.map +1 -1
  679. package/dist/record/recordValidator/attributeKeyValidator.d.ts +4 -0
  680. package/dist/record/recordValidator/attributeKeyValidator.js +3 -0
  681. package/dist/record/recordValidator/attributeKeyValidator.js.map +1 -1
  682. package/dist/record/recordValidator/attributeTypeValidator.js +3 -0
  683. package/dist/record/recordValidator/attributeTypeValidator.js.map +1 -1
  684. package/dist/record/recordValidator/attributeUniqueValidator.js +2 -0
  685. package/dist/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  686. package/dist/record/recordValidator/attributeValidator.js +12 -1
  687. package/dist/record/recordValidator/attributeValidator.js.map +1 -1
  688. package/dist/record/recordValidator/countVaildator.js +5 -0
  689. package/dist/record/recordValidator/countVaildator.js.map +1 -1
  690. package/dist/record/recordValidator/index.js.map +1 -1
  691. package/dist/record/recordValidator/recordValidator.js +3 -0
  692. package/dist/record/recordValidator/recordValidator.js.map +1 -1
  693. package/dist/record/records.js +3 -0
  694. package/dist/record/records.js.map +1 -1
  695. package/dist/record/service.js.map +1 -1
  696. package/dist/registry/index.js.map +1 -1
  697. package/dist/registry/serviceRegistry.js.map +1 -1
  698. package/dist/registry/serviceType.js.map +1 -1
  699. package/dist/srs/factory.js.map +1 -1
  700. package/dist/srs/index.js.map +1 -1
  701. package/dist/srs/srs.js.map +1 -1
  702. package/dist/survey/factory.js +1 -0
  703. package/dist/survey/factory.js.map +1 -1
  704. package/dist/survey/index.js.map +1 -1
  705. package/dist/survey/nodeDefsFixer.js +1 -0
  706. package/dist/survey/nodeDefsFixer.js.map +1 -1
  707. package/dist/survey/refData/factory.js.map +1 -1
  708. package/dist/survey/refData/index.js.map +1 -1
  709. package/dist/survey/refData/refData.d.ts +15 -0
  710. package/dist/survey/refData/refData.js.map +1 -1
  711. package/dist/survey/service.js.map +1 -1
  712. package/dist/survey/survey.d.ts +9 -0
  713. package/dist/survey/survey.js.map +1 -1
  714. package/dist/survey/surveyDocImageFactory.js.map +1 -1
  715. package/dist/survey/surveyDocImages.js.map +1 -1
  716. package/dist/survey/surveyFileFactory.js.map +1 -1
  717. package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js +8 -0
  718. package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
  719. package/dist/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  720. package/dist/survey/surveys/dependencies.js +11 -2
  721. package/dist/survey/surveys/dependencies.js.map +1 -1
  722. package/dist/survey/surveys/index.js +6 -0
  723. package/dist/survey/surveys/index.js.map +1 -1
  724. package/dist/survey/surveys/nodeDefs.js +12 -0
  725. package/dist/survey/surveys/nodeDefs.js.map +1 -1
  726. package/dist/survey/surveys/refsData.js.map +1 -1
  727. package/dist/survey/surveys/surveyGettersSecurity.js.map +1 -1
  728. package/dist/survey/surveys/surveysGetters.js +3 -1
  729. package/dist/survey/surveys/surveysGetters.js.map +1 -1
  730. package/dist/survey/surveys/surveysUtils.js.map +1 -1
  731. package/dist/taxonomy/factory.js.map +1 -1
  732. package/dist/taxonomy/index.js.map +1 -1
  733. package/dist/taxonomy/service.js.map +1 -1
  734. package/dist/taxonomy/taxa.js.map +1 -1
  735. package/dist/taxonomy/taxon.js.map +1 -1
  736. package/dist/taxonomy/taxonGenerator.js.map +1 -1
  737. package/dist/taxonomy/taxonService.js.map +1 -1
  738. package/dist/taxonomy/taxonVernacularName.js.map +1 -1
  739. package/dist/taxonomy/taxonomies.js.map +1 -1
  740. package/dist/taxonomy/taxonomy.js.map +1 -1
  741. package/dist/tests/builder/recordBuilder/attributeBuilder.js +2 -0
  742. package/dist/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
  743. package/dist/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
  744. package/dist/tests/builder/recordBuilder/index.js.map +1 -1
  745. package/dist/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  746. package/dist/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
  747. package/dist/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
  748. package/dist/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
  749. package/dist/tests/builder/surveyBuilder/index.js.map +1 -1
  750. package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  751. package/dist/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  752. package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  753. package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  754. package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  755. package/dist/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
  756. package/dist/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
  757. package/dist/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
  758. package/dist/utils/_objects/assoc.js.map +1 -1
  759. package/dist/utils/_objects/assocPath.js +1 -0
  760. package/dist/utils/_objects/assocPath.js.map +1 -1
  761. package/dist/utils/_objects/camelize.d.ts +9 -0
  762. package/dist/utils/_objects/camelize.js +9 -0
  763. package/dist/utils/_objects/camelize.js.map +1 -1
  764. package/dist/utils/_objects/deepMerge.d.ts +5 -0
  765. package/dist/utils/_objects/deepMerge.js +10 -0
  766. package/dist/utils/_objects/deepMerge.js.map +1 -1
  767. package/dist/utils/_objects/deleteEmptyProps.js.map +1 -1
  768. package/dist/utils/_objects/difference.js.map +1 -1
  769. package/dist/utils/_objects/dissoc.js.map +1 -1
  770. package/dist/utils/_objects/dissocPath.js +1 -0
  771. package/dist/utils/_objects/dissocPath.js.map +1 -1
  772. package/dist/utils/_objects/dissocPathIfEmpty.js.map +1 -1
  773. package/dist/utils/_objects/fromPairs.js.map +1 -1
  774. package/dist/utils/_objects/index.js.map +1 -1
  775. package/dist/utils/_objects/isEmpty.d.ts +6 -0
  776. package/dist/utils/_objects/isEmpty.js +8 -0
  777. package/dist/utils/_objects/isEmpty.js.map +1 -1
  778. package/dist/utils/_objects/isEqual.js.map +1 -1
  779. package/dist/utils/_objects/isNil.d.ts +6 -0
  780. package/dist/utils/_objects/isNil.js +6 -0
  781. package/dist/utils/_objects/isNil.js.map +1 -1
  782. package/dist/utils/_objects/isNotEmpty.d.ts +6 -0
  783. package/dist/utils/_objects/isNotEmpty.js +6 -0
  784. package/dist/utils/_objects/isNotEmpty.js.map +1 -1
  785. package/dist/utils/_objects/parse.d.ts +8 -0
  786. package/dist/utils/_objects/parse.js +8 -0
  787. package/dist/utils/_objects/parse.js.map +1 -1
  788. package/dist/utils/_objects/path.d.ts +6 -0
  789. package/dist/utils/_objects/path.js +7 -0
  790. package/dist/utils/_objects/path.js.map +1 -1
  791. package/dist/utils/_objects/propertyOf.js.map +1 -1
  792. package/dist/utils/_objects/setInPath.js.map +1 -1
  793. package/dist/utils/_objects/stringify.d.ts +9 -0
  794. package/dist/utils/_objects/stringify.js +9 -0
  795. package/dist/utils/_objects/stringify.js.map +1 -1
  796. package/dist/utils/_objects/toPairs.js.map +1 -1
  797. package/dist/utils/arrays.js.map +1 -1
  798. package/dist/utils/dates.d.ts +1 -1
  799. package/dist/utils/dates.js +66 -15
  800. package/dist/utils/dates.js.map +1 -1
  801. package/dist/utils/fileNames.js.map +1 -1
  802. package/dist/utils/fileProcessor.js +5 -1
  803. package/dist/utils/fileProcessor.js.map +1 -1
  804. package/dist/utils/index.js.map +1 -1
  805. package/dist/utils/numbers.js +21 -0
  806. package/dist/utils/numbers.js.map +1 -1
  807. package/dist/utils/promises.js +15 -1
  808. package/dist/utils/promises.js.map +1 -1
  809. package/dist/utils/queue.d.ts +7 -0
  810. package/dist/utils/queue.js +9 -0
  811. package/dist/utils/queue.js.map +1 -1
  812. package/dist/utils/retryProcessor.js +5 -1
  813. package/dist/utils/retryProcessor.js.map +1 -1
  814. package/dist/utils/strings.js.map +1 -1
  815. package/dist/utils/uuids.js.map +1 -1
  816. package/dist/utils/versions.js +4 -0
  817. package/dist/utils/versions.js.map +1 -1
  818. package/dist/validation/factory.js.map +1 -1
  819. package/dist/validation/fieldValidator.js.map +1 -1
  820. package/dist/validation/fieldValidators/email.js +3 -0
  821. package/dist/validation/fieldValidators/email.js.map +1 -1
  822. package/dist/validation/fieldValidators/index.js.map +1 -1
  823. package/dist/validation/fieldValidators/name.js +4 -0
  824. package/dist/validation/fieldValidators/name.js.map +1 -1
  825. package/dist/validation/fieldValidators/notKeyword.js.map +1 -1
  826. package/dist/validation/fieldValidators/numeric.js.map +1 -1
  827. package/dist/validation/fieldValidators/numericPositive.js.map +1 -1
  828. package/dist/validation/fieldValidators/required.js.map +1 -1
  829. package/dist/validation/index.js.map +1 -1
  830. package/dist/validation/validation.js.map +1 -1
  831. package/dist/validation/validationResults.js +1 -1
  832. package/dist/validation/validationResults.js.map +1 -1
  833. package/dist/validation/validations.js +17 -1
  834. package/dist/validation/validations.js.map +1 -1
  835. package/dist/validation/validator.js.map +1 -1
  836. package/dist/validation/validatorErrorKeys.js.map +1 -1
  837. package/package.json +7 -10
@@ -1 +1 @@
1
- {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/node/identifier.ts"],"names":[],"mappings":";;;AACA,4DAAsG;AACtG,qDAAiD;AACjD,uCAA4C;AAC5C,4EAAiF;AACjF,+DAA4E;AAE5E,iDAA2E;AAC3E,uCAAyC;AACzC,iDAAqD;AACrD,2FAA0E;AAC1E,sDAAkD;AAQlD,MAAM,qBAAqB,GAAG,CAAC,MAE9B,EAAkD,EAAE;IACnD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAA;IAExD,IAAI,CAAC,oBAAoB;QAAE,OAAO,SAAS,CAAA;IAE3C,IAAI,mBAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC/C,OAAO,IAAA,2BAAgB,EAAC,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAA;IACpE,CAAC;IACD,IAAI,oBAAoB,CAAC,OAAO,EAAE,CAAC;QACjC,OAAO,IAAA,2BAAgB,EAAC,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAA;IACpE,CAAC;IACD,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AAED,MAAa,0BAA2B,SAAQ,gCAA6C;IAC3F,QAAQ,CAAC,cAAoC;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AAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,MAAM,sBAAsB,GAAG,IAAA,2BAAgB,EAAC,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAA;gBACtF,IAAI,sBAAsB,EAAE,CAAC;oBAC3B,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAA;gBACvC,CAAC;gBACD,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;oBACtD,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;oBAChD,MAAM,gBAAgB,CAAA;gBACxB,CAAC;gBACD,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAjLD,gEAiLC","sourcesContent":["import { NodeDef, NodeDefProps, NodeDefType } from '../../nodeDef/nodeDef'\nimport { getNodeDefChildren, getNodeDefParent, getNodeDefSource } from '../../survey/surveys/nodeDefs'\nimport { NodeDefs } from '../../nodeDef/nodeDefs'\nimport { Objects, Queue } from '../../utils'\nimport { IdentifierEvaluator } from '../../expression/javascript/node/identifier'\nimport { getGlobalObjectProperty } from '../../expression/javascript/global'\nimport { NodeDefExpressionContext } from '../context'\nimport { ExpressionVariable, IdentifierExpression } from '../../expression'\nimport { SystemError } from '../../error'\nimport { ValidatorErrorKeys } from '../../validation'\nimport { NodeNativeProperties } from './nodeDefExpressionNativeProperties'\nimport { NodeValues } from '../../node/nodeValues'\n\n/**\n * Determines the actual context node def\n * - attribute def => parent entity def\n * - virtual entity def => source node def\n * - entity def => entity def itself\n */\nconst findActualContextNode = (params: {\n context: NodeDefExpressionContext\n}): NodeDef<NodeDefType, NodeDefProps> | undefined => {\n const { context } = params\n const { survey, object: nodeDefObjectContext } = context\n\n if (!nodeDefObjectContext) return undefined\n\n if (NodeDefs.isAttribute(nodeDefObjectContext)) {\n return getNodeDefParent({ survey, nodeDef: nodeDefObjectContext })\n }\n if (nodeDefObjectContext.virtual) {\n return getNodeDefSource({ survey, nodeDef: nodeDefObjectContext })\n }\n return nodeDefObjectContext\n}\n\nexport class NodeDefIdentifierEvaluator extends IdentifierEvaluator<NodeDefExpressionContext> {\n evaluate(expressionNode: IdentifierExpression): Promise<any> {\n try {\n return Promise.resolve(this.evaluateIdentifier(expressionNode))\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private evaluateIdentifier(expressionNode: IdentifierExpression): any {\n const { context } = this\n const { nodeDefContext, object: objectContext, itemsFilter, memberProperty } = context\n const { name: exprName } = expressionNode\n\n if (exprName === ExpressionVariable.CONTEXT) {\n if (nodeDefContext) {\n this.addReferencedNodeDefUuid(nodeDefContext.uuid)\n }\n return nodeDefContext\n }\n\n // global objects (e.g. Math, String)\n const globalObjectProperty = getGlobalObjectProperty(exprName, objectContext)\n if (globalObjectProperty !== null) {\n return globalObjectProperty\n }\n\n if (itemsFilter) {\n const prop = objectContext?.props?.[exprName] ?? objectContext?.props?.extra?.[exprName]\n if (!Objects.isEmpty(prop)) {\n return prop\n }\n }\n\n // check if identifier is a composite attribute value prop\n if (NodeDefs.isAttribute(objectContext) && NodeValues.isValueProp({ nodeDef: objectContext, prop: exprName })) {\n return objectContext\n }\n\n if (memberProperty) {\n // property of a member expression (e.g. text_attr.length or text_attr.toUpperCase()): native properties first\n const nativeProperty = this.findNativeProperty(expressionNode)\n if (nativeProperty) return nativeProperty.value\n return this.getReferencedNodeDef(expressionNode)\n }\n // identifier not in a member expression: node defs first, so that node defs named like native properties\n // (e.g. \"name\", \"type\", \"trim\") are always found (and registered as dependencies)\n const referencedNodeDef = this.findReferencedNodeDef(expressionNode)\n if (referencedNodeDef) return referencedNodeDef\n\n const nativeProperty = this.findNativeProperty(expressionNode)\n if (nativeProperty) return nativeProperty.value\n\n return this.throwIdentifierNotFound(expressionNode)\n }\n\n /**\n * Finds the identifier among the native properties or functions of the context object\n * (e.g. String.length or String.toUpperCase()).\n */\n private findNativeProperty(expressionNode: IdentifierExpression): { value: any } | null {\n const { object: objectContext } = this.context\n const { name: exprName } = expressionNode\n\n const globalOrNativeProperty = this.findGlobalOrNativeProperty(expressionNode)\n if (globalOrNativeProperty) {\n return globalOrNativeProperty\n }\n if (NodeNativeProperties.hasNativeProperty({ nodeDefOrValue: objectContext, propName: exprName })) {\n return {\n value: NodeNativeProperties.evalNodeDefProperty({ nodeDefOrValue: objectContext, propName: exprName }),\n }\n }\n return null\n }\n\n private findReferencedNodeDef(expressionNode: IdentifierExpression): NodeDef<NodeDefType, NodeDefProps> | undefined {\n const { nodeDefCurrent, selfReferenceAllowed } = this.context\n const referencedNodeDef = this.findIdentifierAmongReachableNodeDefs(expressionNode)\n if (!referencedNodeDef) return undefined\n\n if (!selfReferenceAllowed && referencedNodeDef.uuid === nodeDefCurrent?.uuid) {\n throw new SystemError(ValidatorErrorKeys.expressions.cannotUseCurrentNode, { name: expressionNode.name })\n }\n this.addReferencedNodeDefUuid(referencedNodeDef.uuid)\n return referencedNodeDef\n }\n\n private getReferencedNodeDef(expressionNode: IdentifierExpression): NodeDef<NodeDefType, NodeDefProps> {\n return this.findReferencedNodeDef(expressionNode) ?? this.throwIdentifierNotFound(expressionNode)\n }\n\n private throwIdentifierNotFound(expressionNode: IdentifierExpression): never {\n throw new SystemError('expression.identifierNotFound', {\n name: expressionNode.name,\n contextObject: this.context.object?.props?.name,\n })\n }\n\n private addReferencedNodeDefUuid(uuid: string) {\n const { context } = this\n const { referencedNodeDefUuids = new Set() } = context\n context.referencedNodeDefUuids = referencedNodeDefUuids.add(uuid)\n }\n\n /**\n * Tries to find the specified identifier among the node defs that can be \"reached\" from the context node def.\n */\n protected findIdentifierAmongReachableNodeDefs(\n expressionNode: IdentifierExpression\n ): NodeDef<NodeDefType, NodeDefProps> | undefined {\n const { object: contextObject } = this.context\n\n if (!contextObject) return undefined\n\n // stop at the first match (same order as getReachableNodeDefs), without visiting all the reachable node defs\n for (const reachableNodeDef of this.iterateReachableNodeDefs()) {\n if (reachableNodeDef.props.name === expressionNode.name) {\n return reachableNodeDef\n }\n }\n return undefined\n }\n\n /**\n * Get reachable node defs, i.e. the children of the node definition's ancestors.\n * NOTE: The root node def is excluded, but it _should_ be an entity, so that is fine.\n */\n protected getReachableNodeDefs(): NodeDef<NodeDefType, NodeDefProps>[] {\n return Array.from(this.iterateReachableNodeDefs())\n }\n\n /**\n * Iterates over the reachable node defs (see getReachableNodeDefs), yielding every node def only once.\n */\n private *iterateReachableNodeDefs(): Generator<NodeDef<NodeDefType, NodeDefProps>> {\n const { context } = this\n const { survey, includeAnalysis } = context\n\n const reachableNodeDefUuids = new Set<string>()\n const visitedUuids = new Set<string>()\n\n const queue = new Queue()\n\n const actualContextNode = findActualContextNode({ context })\n if (actualContextNode) {\n queue.enqueue(actualContextNode)\n reachableNodeDefUuids.add(actualContextNode.uuid)\n yield actualContextNode\n }\n\n while (!queue.isEmpty()) {\n const entityDefCurrent = queue.dequeue()\n const entityDefCurrentChildren = getNodeDefChildren({ survey, nodeDef: entityDefCurrent, includeAnalysis })\n for (const childDef of entityDefCurrentChildren) {\n if (!reachableNodeDefUuids.has(childDef.uuid)) {\n reachableNodeDefUuids.add(childDef.uuid)\n yield childDef\n }\n }\n // visit nodes inside single entities\n queue.enqueueItems(entityDefCurrentChildren.filter(NodeDefs.isSingleEntity))\n\n // avoid visiting 2 times the same entity definition when traversing single entities\n if (!visitedUuids.has(entityDefCurrent.uuid)) {\n const entityDefCurrentParent = getNodeDefParent({ survey, nodeDef: entityDefCurrent })\n if (entityDefCurrentParent) {\n queue.enqueue(entityDefCurrentParent)\n }\n if (!reachableNodeDefUuids.has(entityDefCurrent.uuid)) {\n reachableNodeDefUuids.add(entityDefCurrent.uuid)\n yield entityDefCurrent\n }\n visitedUuids.add(entityDefCurrent.uuid)\n }\n }\n }\n}\n"]}
@@ -17,17 +17,32 @@ class NodeDefMemberEvaluator extends member_1.MemberEvaluator {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  const { object, property, computed } = expressionNode;
19
19
  const objectEval = yield this.evaluator.evaluateNode(object, this.context);
20
+ // null or undefined object (e.g. parent of the root entity)
20
21
  if (objectEval === null || objectEval === undefined) {
21
22
  return null;
22
23
  }
23
24
  if (computed) {
25
+ // access element at index (e.g. plot[1] or plot[index(...)]) or filter items
26
+ // (e.g. plot[plot_id == 1]).
27
+ // There is no actual array of node instances to index/filter at this (schema) level, so the
28
+ // result is always the referenced node def itself. Still evaluate the property expression,
29
+ // best-effort, so that any node def referenced inside an index/filter predicate (e.g. the
30
+ // "plot_id == 1" part above, or a predicate referencing sibling/cousin node defs via
31
+ // "$context") is registered as a dependency too. Errors are ignored here: this evaluation is
32
+ // only performed to detect dependencies as a side effect, not to compute an actual value, and
33
+ // it must not affect expression validation (e.g. NodeDefExpressionValidator) or cause other
34
+ // referenced node defs found so far to be discarded by the caller.
24
35
  try {
25
36
  yield this.evaluator.evaluateNode(property, Object.assign(Object.assign({}, this.context), { object: objectEval }));
26
37
  }
27
38
  catch (_a) {
39
+ // ignore
28
40
  }
29
41
  return objectEval;
30
42
  }
43
+ // eval property and return it (e.g. plot.plot_id)
44
+ // allow self node def reference because the referenced node at runtime can be different from current node
45
+ // e.g. current node = plot_id ; expression = parent(plot).plot[index(plot) - 1].plot_id
31
46
  const propertyNodeDefContext = this.determinePropertyNodeDefContext(objectEval);
32
47
  return this.evaluator.evaluateNode(property, Object.assign(Object.assign({}, this.context), { object: objectEval, nodeDefContext: propertyNodeDefContext, selfReferenceAllowed: true, memberProperty: true }));
33
48
  });
@@ -1 +1 @@
1
- {"version":3,"file":"member.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/node/member.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oEAAyE;AAGzE,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM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cAAc,EAAE,sBAAsB,EACtC,oBAAoB,EAAE,IAAI,EAC1B,cAAc,EAAE,IAAI,IACpB,CAAA;QACJ,CAAC;KAAA;IAED,+BAA+B,CAAC,UAAe;QAC7C,IAAI,SAAS,CAAC,UAAU,CAAC;YAAE,OAAO,UAAU,CAAA;QAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAA;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;IACpC,CAAC;CACF;AAnDD,wDAmDC","sourcesContent":["import { MemberExpression } from '../../expression'\nimport { MemberEvaluator } from '../../expression/javascript/node/member'\nimport { NodeDefExpressionContext } from '../context'\n\nconst isNodeDef = (obj: any) => obj && typeof obj === 'object' && 'uuid' in obj\n\nexport class NodeDefMemberEvaluator extends MemberEvaluator<NodeDefExpressionContext> {\n async evaluate(expressionNode: MemberExpression): Promise<any> {\n const { object, property, computed } = expressionNode\n\n const objectEval = await this.evaluator.evaluateNode(object, this.context)\n // null or undefined object (e.g. parent of the root entity)\n if (objectEval === null || objectEval === undefined) {\n return null\n }\n if (computed) {\n // access element at index (e.g. plot[1] or plot[index(...)]) or filter items\n // (e.g. plot[plot_id == 1]).\n // There is no actual array of node instances to index/filter at this (schema) level, so the\n // result is always the referenced node def itself. Still evaluate the property expression,\n // best-effort, so that any node def referenced inside an index/filter predicate (e.g. the\n // \"plot_id == 1\" part above, or a predicate referencing sibling/cousin node defs via\n // \"$context\") is registered as a dependency too. Errors are ignored here: this evaluation is\n // only performed to detect dependencies as a side effect, not to compute an actual value, and\n // it must not affect expression validation (e.g. NodeDefExpressionValidator) or cause other\n // referenced node defs found so far to be discarded by the caller.\n try {\n await this.evaluator.evaluateNode(property, {\n ...this.context,\n object: objectEval,\n })\n } catch {\n // ignore\n }\n return objectEval\n }\n\n // eval property and return it (e.g. plot.plot_id)\n // allow self node def reference because the referenced node at runtime can be different from current node\n // e.g. current node = plot_id ; expression = parent(plot).plot[index(plot) - 1].plot_id\n\n const propertyNodeDefContext = this.determinePropertyNodeDefContext(objectEval)\n\n return this.evaluator.evaluateNode(property, {\n ...this.context,\n object: objectEval,\n nodeDefContext: propertyNodeDefContext,\n selfReferenceAllowed: true,\n memberProperty: true,\n })\n }\n\n determinePropertyNodeDefContext(objectEval: any): any {\n if (isNodeDef(objectEval)) return objectEval\n if (Array.isArray(objectEval) && isNodeDef(objectEval[0])) return objectEval[0]\n return this.context.nodeDefContext\n }\n}\n"]}
@@ -19,8 +19,10 @@ const classByObjectType = {
19
19
  };
20
20
  const _getJsType = (nodeDefOrValue) => {
21
21
  if (nodeDefOrValue.uuid) {
22
+ // the parameter is a nodeDef
22
23
  return jsTypeByNodeDefType[nodeDefOrValue.type];
23
24
  }
25
+ // the parameter is a value (number or string)
24
26
  return classByObjectType[typeof nodeDefOrValue];
25
27
  };
26
28
  const _hasProperty = (params) => {
@@ -48,6 +50,7 @@ const evalNodeDefProperty = (params) => {
48
50
  if (_hasProperty({ JsType, propName })) {
49
51
  return JsType[propName];
50
52
  }
53
+ // return function with name "propertyName" and bind it to an instance of JsType
51
54
  return JsType.prototype[propName].bind(new JsType());
52
55
  };
53
56
  exports.NodeNativeProperties = {
@@ -1 +1 @@
1
- {"version":3,"file":"nodeDefExpressionNativeProperties.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.ts"],"names":[],"mappings":";;;AAAA,mDAAmD;AACnD,qDAAiD;AAEjD,MAAM,gBAAgB,GAA8B;IAClD,MAAM,EAAE,QAAQ;CACjB,CAAA;AAED,MAAM,mBAAmB,GAAmC;IAC1D,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,MAAM;IAC1B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,MAAM;IAC1B,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,MAAM;IAC7B,CA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,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA;AACvG,CAAC,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,MAAiD,EAAE,EAAE;IAChF,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IAC3C,IAAI,QAAQ,KAAK,gBAAgB,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,CAAC,CAAA;IACV,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACzC,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAA;IACzB,CAAC;IAED,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC,CAAA;AACtD,CAAC,CAAA;AAEY,QAAA,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,mBAAmB;CACpB,CAAA"}
1
+ {"version":3,"file":"nodeDefExpressionNativeProperties.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.ts"],"names":[],"mappings":";;;AAAA,mDAAmD;AACnD,qDAAiD;AAEjD,MAAM,gBAAgB,GAA8B;IAClD,MAAM,EAAE,QAAQ;CACjB,CAAA;AAED,MAAM,mBAAmB,GAAmC;IAC1D,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,MAAM;IAC1B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,MAAM;IAC1B,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,MAAM;IAC7B,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,MAAM;IAC7B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,MAAM;CAC3B,CAAA;AAED,MAAM,iBAAiB,GAA2B;IAChD,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;CACf,CAAA;AAED,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,MAAM,CAAA;IAC3C,IAAI,QAAQ,KAAK,gBAAgB,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,CAAC,CAAA;IACV,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACzC,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAA;IACzB,CAAC;IACD,gFAAgF;IAChF,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC,CAAA;AACtD,CAAC,CAAA;AAEY,QAAA,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,mBAAmB;CACpB,CAAA","sourcesContent":["import { NodeDefType } from '../../nodeDef/nodeDef'\nimport { NodeDefs } from '../../nodeDef/nodeDefs'\n\nconst nativeProperties: { [key: string]: string } = {\n length: 'length',\n}\n\nconst jsTypeByNodeDefType: { [key in NodeDefType]?: any } = {\n [NodeDefType.code]: String,\n [NodeDefType.date]: String,\n [NodeDefType.decimal]: Number,\n [NodeDefType.integer]: Number,\n [NodeDefType.text]: String,\n}\n\nconst classByObjectType: { [key: string]: any } = {\n number: Number,\n string: String,\n}\n\nconst _getJsType = (nodeDefOrValue: any) => {\n if (nodeDefOrValue.uuid) {\n // the parameter is a nodeDef\n return jsTypeByNodeDefType[nodeDefOrValue.type as NodeDefType]\n }\n // the parameter is a value (number or string)\n return classByObjectType[typeof nodeDefOrValue]\n}\n\nconst _hasProperty = (params: { JsType: any; propName: string }) => {\n const { JsType, propName } = params\n return Object.hasOwn(JsType, propName)\n}\n\nconst _hasFunction = (params: { JsType: any; funcName: string }) => {\n const { JsType, funcName } = params\n return Boolean(JsType.prototype[funcName])\n}\n\nconst hasNativeProperty = (params: { nodeDefOrValue: any; propName: string }) => {\n const { nodeDefOrValue, propName } = params\n if (propName === nativeProperties.length && NodeDefs.isMultiple(nodeDefOrValue)) {\n return true\n }\n const JsType = _getJsType(nodeDefOrValue)\n return JsType && (_hasProperty({ JsType, propName }) || _hasFunction({ JsType, funcName: propName }))\n}\n\nconst evalNodeDefProperty = (params: { nodeDefOrValue: any; propName: string }) => {\n const { nodeDefOrValue, propName } = params\n if (propName === nativeProperties.length) {\n return 0\n }\n const JsType = _getJsType(nodeDefOrValue)\n if (_hasProperty({ JsType, propName })) {\n return JsType[propName]\n }\n // return function with name \"propertyName\" and bind it to an instance of JsType\n return JsType.prototype[propName].bind(new JsType())\n}\n\nexport const NodeNativeProperties = {\n hasNativeProperty,\n evalNodeDefProperty,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thisEvaluator.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/node/thisEvaluator.ts"],"names":[],"mappings":";;;AAAA,gFAA4E;AAC5E,gEAAqE;AACrE,mDAAmD;AACnD,qDAAiD;AAGjD,kEAA8D;AAG9D,MAAa,oBAAqB,SAAQ,oBAAuC;IAC/E,QAAQ;QACN,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAEpD,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA;IAC/E,CAAC;IAED,eAAe;QACb,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAC/C,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,CAAA;QAEhC,IAAI,cAAc,CAAC,IAAI,KAAK,qBAAW,CAAC,IAAI,EAAE,CAAC;YAC7C,MAAM,YAAY,GAAG,mBAAQ,CAAC,eAAe,CAAC,cAA6B,CAAC,CAAA;YAC5E,OAAO,YAAY,CAAC,CAAC,CAAC,6CAAqB,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC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AI,KAAK,qBAAW,CAAC,KAAK,EAAE,CAAC;YAC9C,MAAM,YAAY,GAAG,mBAAQ,CAAC,eAAe,CAAC,cAA8B,CAAC,CAAA;YAC7E,OAAO,YAAY,CAAC,CAAC,CAAC,+BAAc,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACrF,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArBD,oDAqBC","sourcesContent":["import { CategoryItemGenerator } from '../../category/categoryItemGenerator'\nimport { ThisEvaluator } from '../../expression/javascript/node/this'\nimport { NodeDefType } from '../../nodeDef/nodeDef'\nimport { NodeDefs } from '../../nodeDef/nodeDefs'\nimport { NodeDefCode } from '../../nodeDef/types/code'\nimport { NodeDefTaxon } from '../../nodeDef/types/taxon'\nimport { TaxonGenerator } from '../../taxonomy/taxonGenerator'\nimport { NodeDefExpressionContext } from '../context'\n\nexport class NodeDefThisEvaluator extends ThisEvaluator<NodeDefExpressionContext> {\n evaluate(): Promise<any> {\n const { nodeDefCurrent, itemsFilter } = this.context\n\n return Promise.resolve(itemsFilter ? this.createEmptyItem() : nodeDefCurrent)\n }\n\n createEmptyItem() {\n const { survey, nodeDefCurrent } = this.context\n if (!nodeDefCurrent) return null\n\n if (nodeDefCurrent.type === NodeDefType.code) {\n const categoryUuid = NodeDefs.getCategoryUuid(nodeDefCurrent as NodeDefCode)\n return categoryUuid ? CategoryItemGenerator.generateItem({ survey, categoryUuid }) : null\n }\n if (nodeDefCurrent.type === NodeDefType.taxon) {\n const taxonomyUuid = NodeDefs.getTaxonomyUuid(nodeDefCurrent as NodeDefTaxon)\n return taxonomyUuid ? TaxonGenerator.generateTaxon({ survey, taxonomyUuid }) : null\n }\n return null\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"taxonProvider.js","sourceRoot":"","sources":["../../src/nodeDefExpressionEvaluator/taxonProvider.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"taxonProvider.js","sourceRoot":"","sources":["../../src/nodeDefExpressionEvaluator/taxonProvider.ts"],"names":[],"mappings":"","sourcesContent":["import { Survey } from '../survey'\nimport { Taxon } from '../taxonomy'\n\nexport interface TaxonProvider {\n getTaxonByCode: (params: {\n survey: Survey\n taxonomyUuid: string\n taxonCode: string\n draft: boolean\n }) => Promise<Taxon | undefined>\n getTaxonByUuid: (params: {\n survey: Survey\n taxonomyUuid: string\n taxonUuid: string\n draft: boolean\n }) => Promise<Taxon | undefined>\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/nodeDefExpressionEvaluator/validator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yDAA6D;AAC7D,8CAAyE;AACzE,kDAA8C;AAE9C,2CAAwD;AACxD,oCAAsC;AAEtC,MAAM,uBAAuB,GAAG,CAAC,MAAwD,EAAE,EAAE;;IAC3F,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAA;IAEzC,MAAM,cAAc,GAAG,mBAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;QACpD,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,IAAA,2BAAgB,EAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAA;IAEzD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,0CAAE,IAAI,EAAE,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA;AAED,MAAa,0BAA2B,SAAQ,sCAA0B;IAClE,QAAQ,CACZ,MAEC;;;YAED,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAA;YAC1F,IAAI,CAAC;gBACH,MAAM,cAAc,GAAG,mBAAmB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C,CAAC,oBAAoB,CAAA;gBAC5D,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAA,KAAK,CAAC,WAAW,mCAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAA;gBAChG,OAAO;oBACL,gBAAgB,EAAE,oCAAuB,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;oBACvF,sBAAsB,EAAE,IAAI,GAAG,EAAE;iBAClC,CAAA;YACH,CAAC;QACH,CAAC;KAAA;CACF;AA7BD,gEA6BC","sourcesContent":["import { NodeDef } from '../nodeDef'\nimport { Survey } from '../survey'\nimport { getNodeDefParent } from '../survey/surveys/nodeDefs'\nimport { ValidationResult, ValidationResultFactory } from '../validation'\nimport { NodeDefs } from '../nodeDef/nodeDefs'\nimport { NodeDefExpressionContext } from './context'\nimport { NodeDefExpressionEvaluator } from './evaluator'\nimport { SystemError } from '../error'\n\nconst determineNodeDefContext = (params: { survey: Survey; nodeDefCurrent: NodeDef<any> }) => {\n const { survey, nodeDefCurrent } = params\n\n const nodeDefContext = NodeDefs.isRoot(nodeDefCurrent)\n ? nodeDefCurrent\n : getNodeDefParent({ survey, nodeDef: nodeDefCurrent })\n\n if (!nodeDefContext) {\n throw new Error(`Cannot find context nodeDef: ${nodeDefCurrent?.props?.name}`)\n }\n return nodeDefContext\n}\n\nexport class NodeDefExpressionValidator extends NodeDefExpressionEvaluator {\n async validate(\n params: NodeDefExpressionContext & {\n expression: string\n }\n ): Promise<{ validationResult: ValidationResult; referencedNodeDefUuids: Set<string> }> {\n const { expression, survey, nodeDefCurrent, nodeDefContext: nodeDefContextParam } = params\n try {\n const nodeDefContext = nodeDefContextParam ?? determineNodeDefContext({ survey, nodeDefCurrent })\n\n const referencedNodeDefUuids = new Set<string>()\n const evaluationParams = { ...params, nodeDefContext, object: nodeDefCurrent, referencedNodeDefUuids }\n\n await this.evaluate(expression, evaluationParams)\n\n return {\n validationResult: ValidationResultFactory.createInstance(),\n referencedNodeDefUuids,\n }\n } catch (error: any) {\n const isSystemError = error instanceof SystemError\n const key = isSystemError ? error.key : 'expression.invalid'\n const params = isSystemError ? error.params : { details: error.description ?? error.toString() }\n return {\n validationResult: ValidationResultFactory.createInstance({ valid: false, key, params }),\n referencedNodeDefUuids: new Set(),\n }\n }\n }\n}\n"]}
@@ -11,16 +11,28 @@ export declare const getEntityCompletionStats: (params: {
11
11
  entity: Node;
12
12
  includeNestedEntities?: boolean;
13
13
  }) => EntityCompletionStats;
14
+ /**
15
+ * Returns the percentage of completion of the given entity (0-100), considering every descendant recursively.
16
+ * A required or key attribute is considered filled when it has a non empty value; multiple attributes and
17
+ * entities are considered filled based on their min count (see Nodes.getChildrenMinCount).
18
+ */
14
19
  export declare const getEntityCompletionPercent: (params: {
15
20
  survey: Survey;
16
21
  record: Record;
17
22
  entity: Node;
18
23
  }) => number;
24
+ /**
25
+ * Returns the percentage of completion of the given entity (0-100), considering only its own attributes
26
+ * (nested entities are ignored).
27
+ */
19
28
  export declare const getEntityOwnCompletionPercent: (params: {
20
29
  survey: Survey;
21
30
  record: Record;
22
31
  entity: Node;
23
32
  }) => number;
33
+ /**
34
+ * Returns the percentage of completion of the given record (0-100), i.e. the completion of its root entity.
35
+ */
24
36
  export declare const getRecordCompletionPercent: (params: {
25
37
  survey: Survey;
26
38
  record: Record;
@@ -34,12 +34,14 @@ const getChildEntityCompletionStats = (params) => {
34
34
  }
35
35
  const minCountRaw = node_1.Nodes.getChildrenMinCount({ parentNode: parentEntity, nodeDef });
36
36
  const minCount = Number.isNaN(minCountRaw) ? 0 : Math.max(minCountRaw, 0);
37
+ // entities added beyond the min count are still expected to be complete
37
38
  const expectedCount = Math.max(minCount, childEntities.length);
38
39
  if (expectedCount === 0)
39
40
  return emptyStats();
40
41
  const stats = emptyStats();
41
42
  for (let index = 0; index < expectedCount; index++) {
42
43
  const childEntity = childEntities[index];
44
+ // a missing repetition (below the min count) counts as a single incomplete unit
43
45
  addStats(stats, childEntity ? (0, exports.getEntityCompletionStats)({ survey, record, entity: childEntity }) : { total: 1, filled: 0 });
44
46
  }
45
47
  return stats;
@@ -70,10 +72,22 @@ const toCompletionPercent = (stats) => {
70
72
  return 100;
71
73
  return utils_1.Numbers.roundToPrecision((filled / total) * 100, 2);
72
74
  };
75
+ /**
76
+ * Returns the percentage of completion of the given entity (0-100), considering every descendant recursively.
77
+ * A required or key attribute is considered filled when it has a non empty value; multiple attributes and
78
+ * entities are considered filled based on their min count (see Nodes.getChildrenMinCount).
79
+ */
73
80
  const getEntityCompletionPercent = (params) => toCompletionPercent((0, exports.getEntityCompletionStats)(params));
74
81
  exports.getEntityCompletionPercent = getEntityCompletionPercent;
82
+ /**
83
+ * Returns the percentage of completion of the given entity (0-100), considering only its own attributes
84
+ * (nested entities are ignored).
85
+ */
75
86
  const getEntityOwnCompletionPercent = (params) => toCompletionPercent((0, exports.getEntityCompletionStats)(Object.assign(Object.assign({}, params), { includeNestedEntities: false })));
76
87
  exports.getEntityOwnCompletionPercent = getEntityOwnCompletionPercent;
88
+ /**
89
+ * Returns the percentage of completion of the given record (0-100), i.e. the completion of its root entity.
90
+ */
77
91
  const getRecordCompletionPercent = (params) => {
78
92
  const { survey, record } = params;
79
93
  const rootEntity = (0, recordGetters_1.getRoot)(record);
@@ -1 +1 @@
1
- {"version":3,"file":"recordCompletion.js","sourceRoot":"","sources":["../../../src/record/_records/recordCompletion.ts"],"names":[],"mappings":";;;AAAA,qCAAwC;AACxC,2CAA4E;AAC5E,yCAA8C;AAC9C,uCAAqC;AAErC,mDAAsD;AAOtD,MAAM,UAAU,GAAG,GAA0B,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAA;AAEzE,MAAM,QAAQ,GAAG,CAAC,QAA+B,EAAE,UAAiC,EAAQ,EAAE;IAC5F,QAAQ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efType } from '../../nodeDef'\nimport { Survey, Surveys } from '../../survey'\nimport { Numbers } from '../../utils'\nimport { Record } from '../record'\nimport { getChildren, getRoot } from './recordGetters'\n\nexport interface EntityCompletionStats {\n total: number\n filled: number\n}\n\nconst emptyStats = (): EntityCompletionStats => ({ total: 0, filled: 0 })\n\nconst addStats = (statsAcc: EntityCompletionStats, statsToAdd: EntityCompletionStats): void => {\n statsAcc.total += statsToAdd.total\n statsAcc.filled += statsToAdd.filled\n}\n\nconst getAttributeCompletionStats = (params: {\n record: Record\n entity: Node\n nodeDef: NodeDef<NodeDefType, NodeDefProps>\n}): EntityCompletionStats => {\n const { record, entity, nodeDef } = params\n\n if (NodeDefs.isMultiple(nodeDef)) {\n const minCount = Nodes.getChildrenMinCount({ parentNode: entity, nodeDef })\n if (Number.isNaN(minCount) || minCount <= 0) return emptyStats()\n\n const filledNodesCount = getChildren(entity, nodeDef.uuid)(record).filter(Nodes.isValueNotBlank).length\n\n return { total: minCount, filled: Math.min(filledNodesCount, minCount) }\n }\n\n if (!NodeDefs.isRequired(nodeDef) && !NodeDefs.isKey(nodeDef)) return emptyStats()\n\n const node = getChildren(entity, nodeDef.uuid)(record)[0]\n return { total: 1, filled: node && Nodes.isValueNotBlank(node) ? 1 : 0 }\n}\n\nconst getChildEntityCompletionStats = (params: {\n survey: Survey\n record: Record\n parentEntity: Node\n nodeDef: NodeDef<NodeDefType, NodeDefProps>\n}): EntityCompletionStats => {\n const { survey, record, parentEntity, nodeDef } = params\n const childEntities = getChildren(parentEntity, nodeDef.uuid)(record)\n\n if (NodeDefs.isSingle(nodeDef)) {\n const childEntity = childEntities[0]\n return childEntity ? getEntityCompletionStats({ survey, record, entity: childEntity }) : emptyStats()\n }\n\n const minCountRaw = Nodes.getChildrenMinCount({ parentNode: parentEntity, nodeDef })\n const minCount = Number.isNaN(minCountRaw) ? 0 : Math.max(minCountRaw, 0)\n // entities added beyond the min count are still expected to be complete\n const expectedCount = Math.max(minCount, childEntities.length)\n if (expectedCount === 0) return emptyStats()\n\n const stats = emptyStats()\n for (let index = 0; index < expectedCount; index++) {\n const childEntity = childEntities[index]\n // a missing repetition (below the min count) counts as a single incomplete unit\n addStats(\n stats,\n childEntity ? getEntityCompletionStats({ survey, record, entity: childEntity }) : { total: 1, filled: 0 }\n )\n }\n return stats\n}\n\nexport const getEntityCompletionStats = (params: {\n survey: Survey\n record: Record\n entity: Node\n includeNestedEntities?: boolean\n}): EntityCompletionStats => {\n const { survey, record, entity, includeNestedEntities = true } = params\n const entityDef = Surveys.getNodeDefByUuid({ survey, uuid: entity.nodeDefUuid })\n const childDefs = Surveys.getNodeDefChildren({ survey, nodeDef: entityDef })\n\n const stats = emptyStats()\n for (const childDef of childDefs) {\n if (!Nodes.isChildApplicable(entity, childDef.uuid)) continue\n\n if (NodeDefs.isEntity(childDef)) {\n if (!includeNestedEntities) continue\n addStats(stats, getChildEntityCompletionStats({ survey, record, parentEntity: entity, nodeDef: childDef }))\n } else {\n addStats(stats, getAttributeCompletionStats({ record, entity, nodeDef: childDef }))\n }\n }\n return stats\n}\n\nconst toCompletionPercent = (stats: EntityCompletionStats): number => {\n const { total, filled } = stats\n if (total <= 0) return 100\n return Numbers.roundToPrecision((filled / total) * 100, 2)\n}\n\n/**\n * Returns the percentage of completion of the given entity (0-100), considering every descendant recursively.\n * A required or key attribute is considered filled when it has a non empty value; multiple attributes and\n * entities are considered filled based on their min count (see Nodes.getChildrenMinCount).\n */\nexport const getEntityCompletionPercent = (params: { survey: Survey; record: Record; entity: Node }): number =>\n toCompletionPercent(getEntityCompletionStats(params))\n\n/**\n * Returns the percentage of completion of the given entity (0-100), considering only its own attributes\n * (nested entities are ignored).\n */\nexport const getEntityOwnCompletionPercent = (params: { survey: Survey; record: Record; entity: Node }): number =>\n toCompletionPercent(getEntityCompletionStats({ ...params, includeNestedEntities: false }))\n\n/**\n * Returns the percentage of completion of the given record (0-100), i.e. the completion of its root entity.\n */\nexport const getRecordCompletionPercent = (params: { survey: Survey; record: Record }): number => {\n const { survey, record } = params\n const rootEntity = getRoot(record)\n return rootEntity ? getEntityCompletionPercent({ survey, record, entity: rootEntity }) : 0\n}\n"]}
@@ -37,6 +37,9 @@ export declare const getAncestor: (params: {
37
37
  node: Node;
38
38
  ancestorDefUuid: string;
39
39
  }) => Node | undefined;
40
+ /**
41
+ * Returns the list of ancestors from the given node to the root entity
42
+ */
40
43
  export declare const getAncestorsAndSelf: (params: {
41
44
  record: Record;
42
45
  node: Node;
@@ -101,6 +101,7 @@ const getParentCodeAttribute = (params) => (record) => {
101
101
  return undefined;
102
102
  };
103
103
  exports.getParentCodeAttribute = getParentCodeAttribute;
104
+ // ancestors
104
105
  const visitAncestorsAndSelf = (node, visitor, stopIfFn) => (record) => {
105
106
  let currentNode = node;
106
107
  while (currentNode) {
@@ -132,6 +133,9 @@ const getAncestor = (params) => {
132
133
  return ancestor;
133
134
  };
134
135
  exports.getAncestor = getAncestor;
136
+ /**
137
+ * Returns the list of ancestors from the given node to the root entity
138
+ */
135
139
  const getAncestorsAndSelf = (params) => {
136
140
  const { record, node } = params;
137
141
  const ancestors = [];
@@ -141,12 +145,15 @@ const getAncestorsAndSelf = (params) => {
141
145
  return ancestors;
142
146
  };
143
147
  exports.getAncestorsAndSelf = getAncestorsAndSelf;
148
+ // descendants
144
149
  const getDescendantsOrSelf = (params) => {
145
150
  const { record, node, nodeDefDescendant } = params;
146
151
  if (nodeDefDescendant.uuid === node.nodeDefUuid)
147
152
  return [node];
148
153
  const nodeDefDescendantFullHierarchy = [...nodeDefDescendant.meta.h, nodeDefDescendant.uuid];
154
+ // 1. get the descendant node defs uuids starting from node nodeDefUuid (not inclusive) down to the specified nodeDefDescendant uuid
149
155
  const descendantNodeDefUuids = nodeDefDescendantFullHierarchy.slice(nodeDefDescendantFullHierarchy.indexOf(node.nodeDefUuid) + 1);
156
+ // 2. for every level in the hierarchy, find the children having the nodeDefUuid equal to the current one
150
157
  let currentAncestors = [node];
151
158
  let currentDescendants = [];
152
159
  for (const currentDescendantDefUuid of descendantNodeDefUuids) {
@@ -156,7 +163,7 @@ const getDescendantsOrSelf = (params) => {
156
163
  currentAncestors = currentDescendants;
157
164
  currentDescendants = [];
158
165
  }
159
- return currentAncestors;
166
+ return currentAncestors; // currentAncestors is equal to the currentDescendants of the last level
160
167
  };
161
168
  exports.getDescendantsOrSelf = getDescendantsOrSelf;
162
169
  const getDescendant = (params) => {
@@ -177,6 +184,7 @@ const visitDescendantsAndSelf = (params) => {
177
184
  while (!queue.isEmpty()) {
178
185
  const visitedNode = queue.dequeue();
179
186
  if (visitor(visitedNode)) {
187
+ // stop if visitor returns true
180
188
  return;
181
189
  }
182
190
  const children = (0, exports.getChildren)(visitedNode)(record);
@@ -189,9 +197,11 @@ const visitDescendantsAndSelf = (params) => {
189
197
  while (stack.length > 0) {
190
198
  const visitedNode = stack.pop();
191
199
  if (visitor(visitedNode)) {
200
+ // stop if visitor returns true
192
201
  return;
193
202
  }
194
203
  const children = (0, exports.getChildren)(visitedNode)(record);
204
+ // add children to stack in reverse order
195
205
  for (let index = children.length - 1; index >= 0; index--) {
196
206
  const child = children[index];
197
207
  stack.push(child);
@@ -218,12 +228,17 @@ const findDescendantOrSelf = (node, predicate) => (record) => {
218
228
  exports.findDescendantOrSelf = findDescendantOrSelf;
219
229
  const getClosestAncestorNode = (params) => {
220
230
  const { record, node, nodeDef, dependentDef } = params;
231
+ // 1a if dependent def is the same as node def, potentially all nodes with
232
+ // nodeDefUuid === dependentDef.uuid in record could be dependent of nodeDef;
233
+ // consider the root node as the closest ancestor node
221
234
  if (nodeDef.uuid === dependentDef.uuid) {
222
235
  return (0, exports.getRoot)(record);
223
236
  }
237
+ // 1 find common ancestor def
224
238
  const commonAncestorDefUuid = utils_1.Arrays.last(utils_1.Arrays.intersection(nodeDef.meta.h, dependentDef.meta.h));
225
239
  if (!commonAncestorDefUuid)
226
240
  return undefined;
241
+ // 2 get ancestor node with common parent def
227
242
  return (0, exports.getAncestor)({ record, node, ancestorDefUuid: commonAncestorDefUuid });
228
243
  };
229
244
  const getEntityKeyNodesByDefUuid = (params) => {
@@ -274,7 +289,7 @@ const getNodeIndex = (params) => {
274
289
  const { record, node } = params;
275
290
  const parentEntity = (0, exports.getParent)(node)(record);
276
291
  if (!parentEntity)
277
- return 0;
292
+ return 0; // root entity
278
293
  const siblings = (0, exports.getChildren)(parentEntity, node.nodeDefUuid)(record);
279
294
  return siblings.indexOf(node);
280
295
  };
@@ -354,12 +369,14 @@ const getDependentNodePointers = (params) => {
354
369
  }
355
370
  };
356
371
  for (const dependentDef of dependentDefs) {
372
+ // 1 find common ancestor node
357
373
  const commonAncestorNode = getClosestAncestorNode({ record, node, nodeDef, dependentDef });
358
374
  if (!commonAncestorNode)
359
375
  continue;
360
376
  const nodeDefDependentParent = survey_1.Surveys.getNodeDefParent({ survey, nodeDef: dependentDef });
361
377
  if (!nodeDefDependentParent)
362
378
  throw new error_1.SystemError('record.nodes.dependents.dependencyOnRootFound');
379
+ // 2 find descendant nodes of common parent node with nodeDefUuid = dependentDef uuid
363
380
  const dependentContextNodes = (0, exports.getDescendantsOrSelf)({
364
381
  record,
365
382
  node: commonAncestorNode,
@@ -1 +1 @@
1
- {"version":3,"file":"recordGetters.js","sourceRoot":"","sources":["../../../src/record/_records/recordGetters.ts"],"names":[],"mappings":";;;AAAA,yCAAyD;AACzD,uCAAyC;AACzC,qCAA+D;AAC/D,sDAAkD;AAClD,2CAA2G;AAC3G,yCAAoD;AAEpD,uCAA2C;AAC3C,sCAAuD;AACvD,8CAAsD;AACtD,qEAAiE;AAE1D,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAU,EAAE,WAAC,OAAA,MAAA,MAAM,CAAC,KAAK,mCAAI,qBAAY,CAAA,EAAA,CAAA;AAAnE,QAAA,QAAQ,YAA2D;AAEzE,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAoB,EAAE,WAAC,OAAA,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAA,EAAA,CAAA;AAAnE,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,EAAE,CAC1B,CAAC,CAAC,IAAA,4BAAoB,EAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,YAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAHlF,QAAA,kBAAkB,sBAGgE;AAExF,MAAM,WAAW,GACtB,CAAC,IAAU,EAAE,EAAE,CACf,CAAC,MAAc,EAAW,EAAE,CAC1B,CAAC,IAAA,0BAAkB,EAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAA;AAHxB,QAAA,WAAW,eAGa;AAE9B,MAAM,OAAO,GAAG,CAAC,MAAc,EAAW,EAAE;IACjD,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,MAAM,CAAC,CAAA;IAChC,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACxD,CAAC,CAAA;AAHY,QAAA,OAAO,WAGnB;AAEM,MAAM,OAAO,GAAG,CAAC,MAAc,EAAU,EAAE,WAAC,OAAA,MAAA,MAAM,CAAC,IAAI,mCAAI,4BAAmB,CAAA,EAAA,CAAA;AAAxE,QAAA,OAAO,WAAiE;AAE9E,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAW,EAAE,CAAC,IAAA,eAAO,EAAC,MAAM,CAAC,KAAK,mCAAsB,CAAA;AAA1F,QAAA,gBAAgB,oBAA0E","sourcesContent":["import { Dictionary, TraverseMethod } from '../../common'\nimport { SystemError } from '../../error'\nimport { Node, NodePointer, Nodes, NodesMap } from '../../node'\nimport { NodeValues } from '../../node/nodeValues'\nimport { NodeDef, NodeDefCode, NodeDefCodeProps, NodeDefProps, NodeDefs, NodeDefType } from '../../nodeDef'\nimport { defaultCycle, Surveys } from '../../survey'\nimport { Survey, SurveyDependencyType } from '../../survey/survey'\nimport { Arrays, Queue } from '../../utils'\nimport { Record, RECORD_STEP_DEFAULT } from '../record'\nimport { RecordStepAnalysisCode } from '../recordStep'\nimport { RecordNodesIndexReader } from './recordNodesIndexReader'\n\nexport const getCycle = (record: Record): string => record.cycle ?? defaultCycle\n\nexport const getNodes = (record: Record): Dictionary<Node> => record.nodes ?? {}\n\nexport const getNodesArray = (record: Record): Node[] => Object.values(getNodes(record))\n\nexport const getNodeByUuid =\n (uuid: string) =>\n (record: Record): Node | undefined =>\n record.nodes?.[uuid]\n\nexport const getNodesByUuids =\n (uuids: string[]) =>\n (record: Record): Node[] =>\n uuids.map((uuid: string) => getNodeByUuid(uuid)(record)) as Node[]\n\nexport const getRoot = (record: Record): Node | undefined => {\n const rootUuid = record._nodesIndex ? RecordNodesIndexReader.getNodeRootUuid(record._nodesIndex) : null\n if (rootUuid) {\n return getNodeByUuid(rootUuid)(record)\n }\n return getNodesArray(record).find((node) => !node.parentUuid)\n}\n\nexport const getChildren =\n (parentNode: Node, childDefUuid?: string) =>\n (record: Record): Node[] => {\n if (record._nodesIndex) {\n const childrenUuids = childDefUuid\n ? RecordNodesIndexReader.getNodeUuidsByParentAndChildDef({\n parentNodeUuid: parentNode.uuid,\n childDefUuid,\n })(record._nodesIndex)\n : RecordNodesIndexReader.getNodeUuidsByParent(parentNode.uuid)(record._nodesIndex)\n return getNodesByUuids(childrenUuids)(record)\n }\n return getNodesArray(record).filter(\n (node) => node.parentUuid === parentNode.uuid && (!childDefUuid || node.nodeDefUuid == childDefUuid)\n )\n }\n\nexport const getChild =\n (parentNode: Node, childDefUuid: string) =>\n (record: Record): Node => {\n const children = getChildren(parentNode, childDefUuid)(record)\n const errorParams = { childDefUuid, parentNodeUuid: parentNode.uuid, recordUuid: record.uuid }\n if (children.length === 1) {\n return children[0]\n }\n if (children.length > 1) {\n throw new SystemError('systemError.record.multipleNodesFound', errorParams)\n }\n throw new SystemError('systemError.record.childNotFound', errorParams)\n }\n\nexport const getParent =\n (node: Node) =>\n (record: Record): Node | undefined =>\n node.parentUuid ? getNodeByUuid(node.parentUuid)(record) : undefined\n\nexport const getNodesByDefUuid =\n (nodeDefUuid: string) =>\n (record: Record): Node[] => {\n if (record._nodesIndex) {\n const nodeUuids = RecordNodesIndexReader.getNodeUuidsByDef(nodeDefUuid)(record._nodesIndex)\n return getNodesByUuids(nodeUuids)(record)\n }\n return getNodesArray(record).filter((node) => node.nodeDefUuid === nodeDefUuid)\n }\n\nconst isNodeFlagTrue =\n (isChildFlagTrue: (parent: Node, nodeDefUuid: string) => boolean) =>\n (params: { record: Record; node: Node }): boolean => {\n const { record, node } = params\n const ancestorsAndSelf = getAncestorsAndSelf({ record, node })\n for (let i = 0; i < ancestorsAndSelf.length - 1; i++) {\n const child = ancestorsAndSelf[i]\n const parent = ancestorsAndSelf[i + 1]\n if (!isChildFlagTrue(parent, child.nodeDefUuid)) return false\n }\n return true\n }\n\nexport const isNodeApplicable = isNodeFlagTrue((parent, nodeDefUuid) => Nodes.isChildApplicable(parent, nodeDefUuid))\nexport const isNodeEditable = isNodeFlagTrue((parent, nodeDefUuid) => Nodes.isChildEditable(parent, nodeDefUuid))\nexport const isNodeVisible = isNodeFlagTrue((parent, nodeDefUuid) => Nodes.isChildVisible(parent, nodeDefUuid))\n\nexport const getDependentCodeAttributes =\n (node: Node) =>\n (record: Record): Node[] => {\n if (record._nodesIndex) {\n const nodeUuids = RecordNodesIndexReader.getNodeCodeDependentUuids(node.uuid)(record._nodesIndex)\n return getNodesByUuids(nodeUuids)(record)\n }\n throw new SystemError('record.nodesIndexNotInitialized')\n }\n\nexport const getParentCodeAttribute =\n (params: { parentNode: Node; nodeDef: NodeDefCode }) =>\n (record: Record): Node | undefined => {\n const { parentNode, nodeDef } = params\n\n const parentCodeDefUuid = NodeDefs.getParentCodeDefUuid(nodeDef)\n if (!parentCodeDefUuid) return undefined\n\n const ancestors = getAncestorsAndSelf({ record, node: parentNode })\n for (const ancestor of ancestors) {\n const children = getChildren(ancestor, parentCodeDefUuid)(record)\n if (children.length === 1) {\n return children[0]\n }\n }\n return undefined\n }\n\n// ancestors\nexport const visitAncestorsAndSelf =\n (node: Node, visitor: (node: Node) => void, stopIfFn?: () => boolean) =>\n (record: Record): void => {\n let currentNode: Node | undefined = node\n while (currentNode) {\n visitor(currentNode)\n if (stopIfFn?.()) break\n currentNode = getParent(currentNode)(record)\n }\n }\n\nexport const findAncestor =\n (node: Node, predicate: (node: Node) => boolean) =>\n (record: Record): Node | undefined => {\n let result: Node | undefined = undefined\n visitAncestorsAndSelf(\n node,\n (visitedNode) => {\n if (predicate(visitedNode)) {\n result = visitedNode\n }\n },\n () => !!result\n )(record)\n return result\n }\n\nexport const getAncestor = (params: { record: Record; node: Node; ancestorDefUuid: string }): Node | undefined => {\n const { record, node, ancestorDefUuid } = params\n if (node.nodeDefUuid === ancestorDefUuid) return node\n\n let ancestor = getParent(node)(record)\n while (ancestor && ancestor.nodeDefUuid !== ancestorDefUuid) {\n ancestor = getParent(ancestor)(record)\n }\n return ancestor\n}\n\n/**\n * Returns the list of ancestors from the given node to the root entity\n */\nexport const getAncestorsAndSelf = (params: { record: Record; node: Node }): Array<Node> => {\n const { record, node } = params\n const ancestors: Array<Node> = []\n visitAncestorsAndSelf(node, (currentNode) => {\n ancestors.push(currentNode)\n })(record)\n return ancestors\n}\n\n// descendants\n\nexport const getDescendantsOrSelf = (params: {\n record: Record\n node: Node\n nodeDefDescendant: NodeDef<any>\n}): Node[] => {\n const { record, node, nodeDefDescendant } = params\n\n if (nodeDefDescendant.uuid === node.nodeDefUuid) return [node]\n\n const nodeDefDescendantFullHierarchy = [...nodeDefDescendant.meta.h, nodeDefDescendant.uuid]\n\n // 1. get the descendant node defs uuids starting from node nodeDefUuid (not inclusive) down to the specified nodeDefDescendant uuid\n const descendantNodeDefUuids = nodeDefDescendantFullHierarchy.slice(\n nodeDefDescendantFullHierarchy.indexOf(node.nodeDefUuid) + 1\n )\n // 2. for every level in the hierarchy, find the children having the nodeDefUuid equal to the current one\n let currentAncestors = [node]\n let currentDescendants: Node[] = []\n for (const currentDescendantDefUuid of descendantNodeDefUuids) {\n for (const currentAncestor of currentAncestors) {\n currentDescendants.push(...getChildren(currentAncestor, currentDescendantDefUuid)(record))\n }\n currentAncestors = currentDescendants\n currentDescendants = []\n }\n return currentAncestors // currentAncestors is equal to the currentDescendants of the last level\n}\n\nexport const getDescendant = (params: { record: Record; node: Node; nodeDefDescendant: NodeDef<any> }): Node => {\n const { record, node, nodeDefDescendant } = params\n\n return getDescendantsOrSelf({ record, node, nodeDefDescendant })[0]\n}\n\nexport const isDescendantOf = (params: { node: Node; ancestor: Node }): boolean => {\n const { node, ancestor } = params\n return Nodes.getHierarchy(node).includes(ancestor.uuid)\n}\n\nexport const visitDescendantsAndSelf = (params: {\n record: Record\n node: Node\n visitor: (node: Node) => boolean | void\n traverseMethod?: TraverseMethod\n}): void => {\n const { record, node, visitor, traverseMethod = TraverseMethod.bfs } = params\n\n if (traverseMethod === TraverseMethod.bfs) {\n const queue = new Queue()\n\n queue.enqueue(node)\n\n while (!queue.isEmpty()) {\n const visitedNode = queue.dequeue()\n\n if (visitor(visitedNode)) {\n // stop if visitor returns true\n return\n }\n\n const children = getChildren(visitedNode)(record)\n queue.enqueueItems(children)\n }\n } else {\n const stack = []\n\n stack.push(node)\n\n while (stack.length > 0) {\n const visitedNode = stack.pop() as Node\n\n if (visitor(visitedNode)) {\n // stop if visitor returns true\n return\n }\n\n const children = getChildren(visitedNode)(record)\n\n // add children to stack in reverse order\n for (let index = children.length - 1; index >= 0; index--) {\n const child = children[index]\n stack.push(child)\n }\n }\n }\n}\n\nexport const findDescendantOrSelf =\n (node: Node, predicate: (node: Node) => boolean) =>\n (record: Record): Node | undefined => {\n let found = undefined\n\n visitDescendantsAndSelf({\n record,\n node,\n visitor: (currentNode) => {\n if (predicate(currentNode)) {\n found = currentNode\n return true\n }\n return false\n },\n })\n return found\n }\n\nconst getClosestAncestorNode = (params: {\n record: Record\n node: Node\n nodeDef: NodeDef<NodeDefType, NodeDefProps>\n dependentDef: NodeDef<NodeDefType, NodeDefProps>\n}): Node | undefined => {\n const { record, node, nodeDef, dependentDef } = params\n\n // 1a if dependent def is the same as node def, potentially all nodes with\n // nodeDefUuid === dependentDef.uuid in record could be dependent of nodeDef;\n // consider the root node as the closest ancestor node\n if (nodeDef.uuid === dependentDef.uuid) {\n return getRoot(record)\n }\n // 1 find common ancestor def\n const commonAncestorDefUuid = Arrays.last(Arrays.intersection(nodeDef.meta.h, dependentDef.meta.h))\n if (!commonAncestorDefUuid) return undefined\n\n // 2 get ancestor node with common parent def\n return getAncestor({ record, node, ancestorDefUuid: commonAncestorDefUuid })\n}\n\ntype EntityKeyNodesGetterParams = {\n survey: Survey\n cycle?: string\n record: Record\n entity: Node\n keyDefs?: NodeDef<NodeDefType, NodeDefProps>[]\n}\n\nexport const getEntityKeyNodesByDefUuid = (params: EntityKeyNodesGetterParams): NodesMap => {\n const { survey, cycle, record, entity, keyDefs } = params\n const nodeDef = Surveys.getNodeDefByUuid({ survey, uuid: entity.nodeDefUuid })\n const nodeDefKeys = keyDefs ?? Surveys.getNodeDefKeys({ survey, cycle, nodeDef })\n return nodeDefKeys.reduce((acc: NodesMap, nodeDefKey) => {\n const nodeKey = getDescendant({ record, node: entity, nodeDefDescendant: nodeDefKey })\n acc[nodeDefKey.uuid] = nodeKey\n return acc\n }, {})\n}\n\nexport const getEntityKeyNodes = (params: EntityKeyNodesGetterParams): Node[] =>\n Object.values(getEntityKeyNodesByDefUuid(params))\n\nexport const getEntityKeyValuesByDefUuid = (params: EntityKeyNodesGetterParams): Dictionary<any> => {\n const keyNodesByDefUuid = getEntityKeyNodesByDefUuid(params)\n return Object.entries(keyNodesByDefUuid).reduce((acc: Dictionary<any>, [uuid, keyNode]) => {\n acc[uuid] = keyNode?.value\n return acc\n }, {})\n}\n\nexport const getEntityKeyValues = (params: EntityKeyNodesGetterParams): any[] =>\n Object.values(getEntityKeyValuesByDefUuid(params))\n\nexport const getEntitySiblings = (params: { record: Record; entity: Node; includeSelf?: boolean }) => {\n const { record, entity, includeSelf = false } = params\n const parentEntity = getParent(entity)(record)\n if (!parentEntity) return []\n const siblingEntities = getChildren(parentEntity, entity.nodeDefUuid)(record)\n return includeSelf ? siblingEntities : siblingEntities.filter((sibling) => !Nodes.areEqual(sibling, entity))\n}\n\nexport const getAttributeSiblings = (params: {\n record: Record\n node: Node\n nodeDef: NodeDef<NodeDefType, NodeDefProps>\n}) => {\n const { record, node, nodeDef } = params\n const parentEntity = getParent(node)(record)\n if (!parentEntity) return []\n const siblingParentEntities = getEntitySiblings({ record, entity: parentEntity })\n return siblingParentEntities.reduce((siblingsAcc: Node[], siblingEntity) => {\n siblingsAcc.push(...getChildren(siblingEntity, nodeDef.uuid)(record))\n return siblingsAcc\n }, [])\n}\n\nexport const getNodeIndex = (params: { record: Record; node: Node }) => {\n const { record, node } = params\n const parentEntity = getParent(node)(record)\n if (!parentEntity) return 0 // root entity\n const siblings = getChildren(parentEntity, node.nodeDefUuid)(record)\n return siblings.indexOf(node)\n}\n\nexport const findEntityByKeyValues = (params: {\n survey: Survey\n cycle: string\n record: Record\n parentEntity: Node\n entityDefUuid: string\n keyValuesByDefUuid: Dictionary<any>\n}): Node | undefined => {\n const { survey, cycle, record, parentEntity, entityDefUuid, keyValuesByDefUuid } = params\n const entityDef = Surveys.getNodeDefByUuid({ survey, uuid: entityDefUuid })\n const siblingEntities = getChildren(parentEntity, entityDefUuid)(record)\n if (NodeDefs.isSingle(entityDef)) {\n return siblingEntities[0]\n }\n const keyDefs = Surveys.getNodeDefKeys({ survey, cycle, nodeDef: entityDef })\n\n return siblingEntities.find((siblingEntity) => {\n const siblingEntityKeyValuesByDefUuid = getEntityKeyValuesByDefUuid({\n survey,\n record,\n entity: siblingEntity,\n keyDefs,\n })\n return keyDefs.every((keyDef) => {\n const keyValue = siblingEntityKeyValuesByDefUuid[keyDef.uuid]\n const keyValueSearch = keyValuesByDefUuid[keyDef.uuid]\n return NodeValues.isValueEqual({\n survey,\n nodeDef: keyDef,\n value: keyValue,\n valueSearch: keyValueSearch,\n })\n })\n })\n}\n\nexport const findEntityWithSameKeysInAnotherRecord = (params: {\n survey: Survey\n cycle: string\n entityUuid: string\n record: Record\n recordOther: Record\n}): Node | undefined => {\n const { survey, cycle, entityUuid, record, recordOther } = params\n const entity = getNodeByUuid(entityUuid)(record)\n if (!entity) return undefined\n\n let otherRecordCurrentParentEntity = getRoot(recordOther)\n if (!otherRecordCurrentParentEntity) return undefined\n\n const entityAncestorsAndSelf = getAncestorsAndSelf({\n record,\n node: entity,\n })\n const ancestorDefUuidsAndKeys = entityAncestorsAndSelf.map((ancestor) => ({\n entityDefUuid: ancestor.nodeDefUuid,\n keyValuesByDefUuid: getEntityKeyValuesByDefUuid({\n survey,\n record,\n entity: ancestor,\n }),\n }))\n\n const ancestorDefUuidsAndKeysToVisit = [...ancestorDefUuidsAndKeys].reverse()\n\n for (let index = 1; otherRecordCurrentParentEntity && index < ancestorDefUuidsAndKeysToVisit.length; index++) {\n const { entityDefUuid, keyValuesByDefUuid } = ancestorDefUuidsAndKeysToVisit[index]\n otherRecordCurrentParentEntity = findEntityByKeyValues({\n survey,\n cycle,\n record: recordOther,\n parentEntity: otherRecordCurrentParentEntity,\n entityDefUuid,\n keyValuesByDefUuid,\n })\n }\n return otherRecordCurrentParentEntity\n}\n\nexport const getDependentNodePointers = (params: {\n survey: Survey\n record: Record\n node: Node\n dependencyType: SurveyDependencyType\n includeSelf?: boolean\n filterFn?: (nodePointer: NodePointer) => boolean\n}) => {\n const { survey, record, node, dependencyType, includeSelf = false, filterFn = null } = params\n const nodeDefUuid = node.nodeDefUuid\n const nodeDef = Surveys.getNodeDefByUuid({ survey, uuid: nodeDefUuid })\n const dependentDefs = Surveys.getNodeDefDependents({ survey, nodeDefUuid, dependencyType })\n const nodePointers: Array<NodePointer> = []\n\n const addToNodePointers = (nodePointer: NodePointer): void => {\n if (filterFn === null || filterFn(nodePointer)) {\n nodePointers.push(nodePointer)\n }\n }\n\n for (const dependentDef of dependentDefs) {\n // 1 find common ancestor node\n const commonAncestorNode = getClosestAncestorNode({ record, node, nodeDef, dependentDef })\n if (!commonAncestorNode) continue\n\n const nodeDefDependentParent = Surveys.getNodeDefParent({ survey, nodeDef: dependentDef })\n if (!nodeDefDependentParent) throw new SystemError('record.nodes.dependents.dependencyOnRootFound')\n\n // 2 find descendant nodes of common parent node with nodeDefUuid = dependentDef uuid\n const dependentContextNodes = getDescendantsOrSelf({\n record,\n node: commonAncestorNode,\n nodeDefDescendant: nodeDefDependentParent,\n })\n\n for (const dependentContextNode of dependentContextNodes) {\n addToNodePointers({\n nodeCtx: dependentContextNode,\n nodeDef: dependentDef,\n })\n }\n }\n if (includeSelf) {\n const parentNode = getParent(node)(record)\n if (parentNode) {\n addToNodePointers({\n nodeCtx: parentNode,\n nodeDef,\n })\n }\n }\n\n return nodePointers\n}\n\nexport const getAncestorCodePath = (params: {\n survey: Survey\n record: Record\n parentNode: Node\n nodeDef: NodeDef<NodeDefType.code, NodeDefCodeProps>\n}): string[] => {\n const { record, parentNode, nodeDef, survey } = params\n\n const getCodeAttributeItemCode = (codeAttribute: Node | undefined): string => {\n const codeItemUuid = codeAttribute ? NodeValues.getItemUuid(codeAttribute) : undefined\n if (!codeItemUuid) return ''\n const item = Surveys.getCategoryItemByUuid({ survey, itemUuid: codeItemUuid })\n return item?.props.code ?? ''\n }\n\n const codePaths = []\n let currentParentCodeAttribute = getParentCodeAttribute({ parentNode, nodeDef })(record)\n\n while (currentParentCodeAttribute) {\n const ancestorItemCode = getCodeAttributeItemCode(currentParentCodeAttribute)\n codePaths.unshift(ancestorItemCode)\n const ancestorCodeDef = Surveys.getNodeDefByUuid({\n survey,\n uuid: currentParentCodeAttribute.nodeDefUuid,\n }) as NodeDefCode\n currentParentCodeAttribute = getParentCodeAttribute({ parentNode, nodeDef: ancestorCodeDef })(record)\n }\n return codePaths\n}\n\nexport const getCategoryItemUuid = (params: {\n survey: Survey\n nodeDef: NodeDef<NodeDefType.code, NodeDefCodeProps>\n record: Record\n parentNode: Node\n code: string\n}): string | undefined => {\n const { survey, nodeDef, record, parentNode, code } = params\n const categoryUuid = nodeDef.props.categoryUuid\n\n const codePaths = [...getAncestorCodePath({ survey, record, parentNode, nodeDef }), code]\n\n const item = Surveys.getCategoryItemByCodePaths({ survey, categoryUuid, codePaths })\n\n return item?.uuid\n}\n\nexport const isNodeFilledByUser =\n (node: Node) =>\n (record: Record): boolean =>\n !!findDescendantOrSelf(node, (visitedNode) => Nodes.hasUserInputValue(visitedNode))(record)\n\nexport const isNodeEmpty =\n (node: Node) =>\n (record: Record): boolean =>\n !isNodeFilledByUser(node)(record)\n\nexport const isEmpty = (record: Record): boolean => {\n const rootNode = getRoot(record)\n return rootNode ? isNodeEmpty(rootNode)(record) : true\n}\n\nexport const getStep = (record: Record): string => record.step ?? RECORD_STEP_DEFAULT\n\nexport const isInAnalysisStep = (record: Record): boolean => getStep(record) === RecordStepAnalysisCode\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"recordNodesIndexReader.js","sourceRoot":"","sources":["../../../src/record/_records/recordNodesIndexReader.ts"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAG,CAAC,KAAuB,EAAsB,EAAE,CAAC,KAAK,CAAC,YAAY,CAAA;AAE3F,MAAM,iBAAiB,GACrB,CAAC,WAAmB,EAAE,EAAE,CACxB,CAAC,KAAuB,EAAY,EAAE,eACpC,OAAA,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,KAAK,CAAC,UAAU,0CAAG,WAAW,CAAC,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAA;AAEtD,MAAM,+BAA+B,GACnC,CAAC,MAAwD,EAAE,EAAE,CAC7D,CAAC,KAAuB,EAAY,EAAE;;IACpC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,MAAM,CAAA;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,MAAA,KAAK,CAAC,wBAAwB,0CAAG,cAAc,CAAC,0CAAG,YAAY,CAAC,mCAAI,EAA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AA;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,MAAA,KAAK,CAAC,wBAAwB,0CAAG,cAAc,CAAC,0CAAG,YAAY,CAAC,mCAAI,EAAE,CAAC,CAAA;AAC5F,CAAC,CAAA;AAEH,MAAM,oBAAoB,GACxB,CAAC,cAAsB,EAAE,EAAE,CAC3B,CAAC,KAAuB,EAAY,EAAE;;IACpC,MAAM,2BAA2B,GAAG,MAAA,MAAA,KAAK,CAAC,wBAAwB,0CAAG,cAAc,CAAC,mCAAI,EAAE,CAAA;IAC1F,OAAO,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;AAC1G,CAAC,CAAA;AAEH,MAAM,yBAAyB,GAC7B,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,KAAuB,EAAY,EAAE,eACpC,OAAA,MAAM,CAAC,IAAI,CAAC,MAAA,MAAA,KAAK,CAAC,kBAAkB,0CAAG,QAAQ,CAAC,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAA;AAE9C,QAAA,sBAAsB,GAAG;IACpC,eAAe;IACf,iBAAiB;IACjB,+BAA+B;IAC/B,oBAAoB;IACpB,yBAAyB;CAC1B,CAAA","sourcesContent":["import { RecordNodesIndex } from '../record'\n\nconst getNodeRootUuid = (index: RecordNodesIndex): string | undefined => index.nodeRootUuid\n\nconst getNodeUuidsByDef =\n (nodeDefUuid: string) =>\n (index: RecordNodesIndex): string[] =>\n Object.keys(index.nodesByDef?.[nodeDefUuid] ?? {})\n\nconst getNodeUuidsByParentAndChildDef =\n (params: { parentNodeUuid: string; childDefUuid: string }) =>\n (index: RecordNodesIndex): string[] => {\n const { parentNodeUuid, childDefUuid } = params\n return Object.keys(index.nodesByParentAndChildDef?.[parentNodeUuid]?.[childDefUuid] ?? {})\n }\n\nconst getNodeUuidsByParent =\n (parentNodeUuid: string) =>\n (index: RecordNodesIndex): string[] => {\n const nodesPresenceByChildDefUuid = index.nodesByParentAndChildDef?.[parentNodeUuid] ?? {}\n return Object.values(nodesPresenceByChildDefUuid).flatMap((nodesPresence) => Object.keys(nodesPresence))\n }\n\nconst getNodeCodeDependentUuids =\n (nodeUuid: string) =>\n (index: RecordNodesIndex): string[] =>\n Object.keys(index.nodeCodeDependents?.[nodeUuid] ?? {})\n\nexport const RecordNodesIndexReader = {\n getNodeRootUuid,\n getNodeUuidsByDef,\n getNodeUuidsByParentAndChildDef,\n getNodeUuidsByParent,\n getNodeCodeDependentUuids,\n}\n"]}
@@ -15,6 +15,7 @@ const sortNodesByIdOrCreationDate = (nodeA, nodeB) => {
15
15
  return -1;
16
16
  if (!nodeB.parentUuid)
17
17
  return 1;
18
+ // read the hierarchy length directly: Nodes.getHierarchy copies the array on every comparison
18
19
  const hierarchyDepthA = (_c = (_b = (_a = nodeA.meta) === null || _a === void 0 ? void 0 : _a.h) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
19
20
  const hierarchyDepthB = (_f = (_e = (_d = nodeB.meta) === null || _d === void 0 ? void 0 : _d.h) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0;
20
21
  const depthDiff = hierarchyDepthA - hierarchyDepthB;
@@ -26,6 +27,11 @@ const sortNodesByIdOrCreationDate = (nodeA, nodeB) => {
26
27
  return nodeA.dateCreated.localeCompare(nodeB.dateCreated);
27
28
  return 0;
28
29
  };
30
+ /**
31
+ * Mutable copy of a nodes index, used to apply many changes to it at once.
32
+ * When sideEffect is false, every object along a modified path is copied only the first time it is modified
33
+ * (copy on write): applying N changes costs one copy of each touched object instead of N copies.
34
+ */
29
35
  class NodesIndexDraft {
30
36
  constructor(index, sideEffect) {
31
37
  this.copiedObjects = new Set();
@@ -58,6 +64,9 @@ class NodesIndexDraft {
58
64
  }
59
65
  current[path.at(-1)] = value;
60
66
  }
67
+ /**
68
+ * Deletes the value at the specified path, then removes the objects along the path left empty.
69
+ */
61
70
  delete(path) {
62
71
  const containers = [this.index];
63
72
  let current = this.index;
@@ -78,12 +87,16 @@ class NodesIndexDraft {
78
87
  var _a, _b;
79
88
  const { uuid: nodeUuid, nodeDefUuid, parentUuid } = node;
80
89
  if (parentUuid) {
90
+ // nodes by parent and child def uuid
81
91
  this.set([keys.nodesByParentAndChildDef, parentUuid, nodeDefUuid, nodeUuid], true);
82
92
  }
83
93
  else {
94
+ // root entity index
84
95
  this.index.nodeRootUuid = nodeUuid;
85
96
  }
97
+ // nodes by def uuid
86
98
  this.set([keys.nodesByDef, nodeDefUuid, nodeUuid], true);
99
+ // code dependents
87
100
  for (const ancestorCodeAttributeUuid of (_b = (_a = node.meta) === null || _a === void 0 ? void 0 : _a.hCode) !== null && _b !== void 0 ? _b : []) {
88
101
  this.set([keys.nodeCodeDependents, ancestorCodeAttributeUuid, nodeUuid], true);
89
102
  }
@@ -97,6 +110,7 @@ class NodesIndexDraft {
97
110
  delete this.index.nodeRootUuid;
98
111
  }
99
112
  this.delete([keys.nodesByDef, nodeDefUuid, nodeUuid]);
113
+ // code dependents
100
114
  for (const ancestorCodeAttributeUuid of node_1.Nodes.getHierarchyCode(node)) {
101
115
  this.delete([keys.nodeCodeDependents, ancestorCodeAttributeUuid, nodeUuid]);
102
116
  }
@@ -130,6 +144,9 @@ const _isSameHierarchyCode = (nodeA, nodeB) => {
130
144
  const hCodeB = (_d = (_c = nodeB.meta) === null || _c === void 0 ? void 0 : _c.hCode) !== null && _d !== void 0 ? _d : [];
131
145
  return hCodeA.length === hCodeB.length && hCodeA.every((uuid, index) => uuid === hCodeB[index]);
132
146
  };
147
+ /**
148
+ * Returns true if the index entries of the specified node would not change when the node replaces the previous version of it.
149
+ */
133
150
  const isNodeIndexUnchanged = (params) => {
134
151
  var _a, _b, _c, _d, _e;
135
152
  const { index, node, nodePrev } = params;