@openforis/arena-core 2.24.0 → 3.0.0

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 (899) hide show
  1. package/dist/app/appInfo.d.ts +1 -1
  2. package/dist/app/appInfo.js.map +1 -1
  3. package/dist/app/index.d.ts +1 -1
  4. package/dist/app/index.js.map +1 -1
  5. package/dist/auth/authGroup.d.ts +4 -4
  6. package/dist/auth/authGroup.js.map +1 -1
  7. package/dist/auth/authGroups.d.ts +9 -9
  8. package/dist/auth/authGroups.js.map +1 -1
  9. package/dist/auth/authorizer.d.ts +58 -58
  10. package/dist/auth/authorizer.js.map +1 -1
  11. package/dist/auth/factory.d.ts +4 -4
  12. package/dist/auth/factory.js.map +1 -1
  13. package/dist/auth/index.d.ts +6 -6
  14. package/dist/auth/index.js.map +1 -1
  15. package/dist/auth/user.d.ts +17 -17
  16. package/dist/auth/user.js.map +1 -1
  17. package/dist/auth/userAuth.d.ts +10 -10
  18. package/dist/auth/userAuth.js.map +1 -1
  19. package/dist/auth/userAuthTokenService.d.ts +11 -11
  20. package/dist/auth/userAuthTokenService.js.map +1 -1
  21. package/dist/auth/userGroup.d.ts +5 -5
  22. package/dist/auth/userGroup.js.map +1 -1
  23. package/dist/auth/userService.d.ts +14 -14
  24. package/dist/auth/userService.js.map +1 -1
  25. package/dist/auth/users.d.ts +11 -11
  26. package/dist/auth/users.js.map +1 -1
  27. package/dist/category/categories.d.ts +5 -5
  28. package/dist/category/categories.js.map +1 -1
  29. package/dist/category/category.d.ts +7 -7
  30. package/dist/category/category.js.map +1 -1
  31. package/dist/category/categoryImportSummary.d.ts +3 -3
  32. package/dist/category/categoryImportSummary.js.map +1 -1
  33. package/dist/category/categoryItemGenerator.d.ts +4 -4
  34. package/dist/category/categoryItemGenerator.js.map +1 -1
  35. package/dist/category/categoryItems.d.ts +5 -5
  36. package/dist/category/categoryItems.js.map +1 -1
  37. package/dist/category/factory.d.ts +11 -11
  38. package/dist/category/factory.js.map +1 -1
  39. package/dist/category/index.d.ts +7 -7
  40. package/dist/category/index.js.map +1 -1
  41. package/dist/category/item.d.ts +6 -6
  42. package/dist/category/item.js.map +1 -1
  43. package/dist/category/itemService.d.ts +16 -16
  44. package/dist/category/itemService.js.map +1 -1
  45. package/dist/category/level.d.ts +2 -2
  46. package/dist/category/level.js.map +1 -1
  47. package/dist/category/levelService.d.ts +15 -15
  48. package/dist/category/levelService.js.map +1 -1
  49. package/dist/category/service.d.ts +19 -19
  50. package/dist/category/service.js.map +1 -1
  51. package/dist/chain/chain.d.ts +7 -7
  52. package/dist/chain/chain.js.map +1 -1
  53. package/dist/chain/chainFactory.d.ts +3 -3
  54. package/dist/chain/chainFactory.js.map +1 -1
  55. package/dist/chain/chainNodeDef.d.ts +2 -2
  56. package/dist/chain/chainNodeDef.js.map +1 -1
  57. package/dist/chain/chainNodeDefAggregate.d.ts +4 -4
  58. package/dist/chain/chainNodeDefAggregate.js.map +1 -1
  59. package/dist/chain/chainNodeDefFactory.d.ts +3 -3
  60. package/dist/chain/chainNodeDefFactory.js.map +1 -1
  61. package/dist/chain/chainNodeDefService.d.ts +7 -7
  62. package/dist/chain/chainNodeDefService.js.map +1 -1
  63. package/dist/chain/chainService.d.ts +13 -13
  64. package/dist/chain/chainService.js.map +1 -1
  65. package/dist/chain/index.d.ts +5 -5
  66. package/dist/chain/index.js.map +1 -1
  67. package/dist/common/Dictionary.d.ts +1 -1
  68. package/dist/common/Dictionary.js.map +1 -1
  69. package/dist/common/factory.d.ts +1 -1
  70. package/dist/common/factory.js.map +1 -1
  71. package/dist/common/i18n.d.ts +1 -1
  72. package/dist/common/i18n.js.map +1 -1
  73. package/dist/common/index.d.ts +5 -5
  74. package/dist/common/index.js.map +1 -1
  75. package/dist/dataExport/ArenaExportInfo.d.ts +2 -2
  76. package/dist/dataExport/ArenaExportInfo.js.map +1 -1
  77. package/dist/dataExport/ArenaExportInfoFactory.d.ts +4 -4
  78. package/dist/dataExport/ArenaExportInfoFactory.js.map +1 -1
  79. package/dist/dataExport/FlatDataExportModel.d.ts +12 -12
  80. package/dist/dataExport/FlatDataExportModel.js +11 -11
  81. package/dist/dataExport/FlatDataExportModel.js.map +1 -1
  82. package/dist/dataExport/FlatDataExportOptions.d.ts +2 -2
  83. package/dist/dataExport/FlatDataExportOptions.js.map +1 -1
  84. package/dist/dataExport/FlatDataFiles.d.ts +2 -2
  85. package/dist/dataExport/FlatDataFiles.js.map +1 -1
  86. package/dist/dataExport/UniqueFileNamesGenerator.d.ts +3 -3
  87. package/dist/dataExport/UniqueFileNamesGenerator.js.map +1 -1
  88. package/dist/dataExport/index.d.ts +1 -1
  89. package/dist/dataExport/index.js.map +1 -1
  90. package/dist/dataQuery/dataQuery.d.ts +8 -8
  91. package/dist/dataQuery/dataQuery.js.map +1 -1
  92. package/dist/dataQuery/dataQuerySummaries.d.ts +16 -16
  93. package/dist/dataQuery/dataQuerySummaries.js.map +1 -1
  94. package/dist/dataQuery/index.d.ts +1 -1
  95. package/dist/dataQuery/index.js.map +1 -1
  96. package/dist/error/SystemError.d.ts +4 -4
  97. package/dist/error/SystemError.js.map +1 -1
  98. package/dist/esm/app/appInfo.js.map +1 -1
  99. package/dist/esm/app/index.js.map +1 -1
  100. package/dist/esm/auth/authGroup.js.map +1 -1
  101. package/dist/esm/auth/authGroups.js.map +1 -1
  102. package/dist/esm/auth/authorizer.js.map +1 -1
  103. package/dist/esm/auth/factory.js.map +1 -1
  104. package/dist/esm/auth/index.js.map +1 -1
  105. package/dist/esm/auth/user.js.map +1 -1
  106. package/dist/esm/auth/userAuth.js.map +1 -1
  107. package/dist/esm/auth/userAuthTokenService.js.map +1 -1
  108. package/dist/esm/auth/userGroup.js.map +1 -1
  109. package/dist/esm/auth/userService.js.map +1 -1
  110. package/dist/esm/auth/users.js.map +1 -1
  111. package/dist/esm/category/categories.js.map +1 -1
  112. package/dist/esm/category/category.js.map +1 -1
  113. package/dist/esm/category/categoryImportSummary.js.map +1 -1
  114. package/dist/esm/category/categoryItemGenerator.js.map +1 -1
  115. package/dist/esm/category/categoryItems.js.map +1 -1
  116. package/dist/esm/category/factory.js.map +1 -1
  117. package/dist/esm/category/index.js.map +1 -1
  118. package/dist/esm/category/item.js.map +1 -1
  119. package/dist/esm/category/itemService.js.map +1 -1
  120. package/dist/esm/category/level.js.map +1 -1
  121. package/dist/esm/category/levelService.js.map +1 -1
  122. package/dist/esm/category/service.js.map +1 -1
  123. package/dist/esm/chain/chain.js.map +1 -1
  124. package/dist/esm/chain/chainFactory.js.map +1 -1
  125. package/dist/esm/chain/chainNodeDef.js.map +1 -1
  126. package/dist/esm/chain/chainNodeDefAggregate.js.map +1 -1
  127. package/dist/esm/chain/chainNodeDefFactory.js.map +1 -1
  128. package/dist/esm/chain/chainNodeDefService.js.map +1 -1
  129. package/dist/esm/chain/chainService.js.map +1 -1
  130. package/dist/esm/chain/index.js.map +1 -1
  131. package/dist/esm/common/Dictionary.js.map +1 -1
  132. package/dist/esm/common/factory.js.map +1 -1
  133. package/dist/esm/common/i18n.js.map +1 -1
  134. package/dist/esm/common/index.js.map +1 -1
  135. package/dist/esm/dataExport/ArenaExportInfo.js.map +1 -1
  136. package/dist/esm/dataExport/ArenaExportInfoFactory.js.map +1 -1
  137. package/dist/esm/dataExport/FlatDataExportModel.js +12 -12
  138. package/dist/esm/dataExport/FlatDataExportModel.js.map +1 -1
  139. package/dist/esm/dataExport/FlatDataExportOptions.js.map +1 -1
  140. package/dist/esm/dataExport/FlatDataFiles.js.map +1 -1
  141. package/dist/esm/dataExport/UniqueFileNamesGenerator.js.map +1 -1
  142. package/dist/esm/dataExport/index.js.map +1 -1
  143. package/dist/esm/dataQuery/dataQuery.js.map +1 -1
  144. package/dist/esm/dataQuery/dataQuerySummaries.js.map +1 -1
  145. package/dist/esm/dataQuery/index.js.map +1 -1
  146. package/dist/esm/error/SystemError.js.map +1 -1
  147. package/dist/esm/expression/context.js.map +1 -1
  148. package/dist/esm/expression/evaluator.js.map +1 -1
  149. package/dist/esm/expression/function.js.map +1 -1
  150. package/dist/esm/expression/index.js.map +1 -1
  151. package/dist/esm/expression/javascript/evaluator.js.map +1 -1
  152. package/dist/esm/expression/javascript/functionsDefault.js.map +1 -1
  153. package/dist/esm/expression/javascript/global.js.map +1 -1
  154. package/dist/esm/expression/javascript/node/array.js.map +1 -1
  155. package/dist/esm/expression/javascript/node/binary.js.map +1 -1
  156. package/dist/esm/expression/javascript/node/call.js.map +1 -1
  157. package/dist/esm/expression/javascript/node/compound.js.map +1 -1
  158. package/dist/esm/expression/javascript/node/conditional.js.map +1 -1
  159. package/dist/esm/expression/javascript/node/identifier.js.map +1 -1
  160. package/dist/esm/expression/javascript/node/literal.js.map +1 -1
  161. package/dist/esm/expression/javascript/node/member.js.map +1 -1
  162. package/dist/esm/expression/javascript/node/sequence.js.map +1 -1
  163. package/dist/esm/expression/javascript/node/this.js.map +1 -1
  164. package/dist/esm/expression/javascript/node/unary.js.map +1 -1
  165. package/dist/esm/expression/javascript/parser/parser.js.map +1 -1
  166. package/dist/esm/expression/node.js.map +1 -1
  167. package/dist/esm/expression/parser.js.map +1 -1
  168. package/dist/esm/extraProp/extraProp.js.map +1 -1
  169. package/dist/esm/extraProp/extraProps.js.map +1 -1
  170. package/dist/esm/extraProp/extraPropsDataGenerator.js.map +1 -1
  171. package/dist/esm/extraProp/index.js.map +1 -1
  172. package/dist/esm/geo/areaOfInterest.js.map +1 -1
  173. package/dist/esm/geo/index.js.map +1 -1
  174. package/dist/esm/geo/point.js.map +1 -1
  175. package/dist/esm/geo/pointFactory.js.map +1 -1
  176. package/dist/esm/geo/points/bearing.js +1 -1
  177. package/dist/esm/geo/points/bearing.js.map +1 -1
  178. package/dist/esm/geo/points/distance.js +1 -1
  179. package/dist/esm/geo/points/distance.js.map +1 -1
  180. package/dist/esm/geo/points/distanceToPolygonBoundary.js +3 -3
  181. package/dist/esm/geo/points/distanceToPolygonBoundary.js.map +1 -1
  182. package/dist/esm/geo/points/equals.js.map +1 -1
  183. package/dist/esm/geo/points/getSrs.js.map +1 -1
  184. package/dist/esm/geo/points/isFilled.js.map +1 -1
  185. package/dist/esm/geo/points/isValid.js.map +1 -1
  186. package/dist/esm/geo/points/parse.js +1 -1
  187. package/dist/esm/geo/points/parse.js.map +1 -1
  188. package/dist/esm/geo/points/pointAtDistance.js.map +1 -1
  189. package/dist/esm/geo/points/toLatLong.js.map +1 -1
  190. package/dist/esm/geo/points/toString.js.map +1 -1
  191. package/dist/esm/geo/points/transform.js.map +1 -1
  192. package/dist/esm/index.js +2 -2
  193. package/dist/esm/index.js.map +1 -1
  194. package/dist/esm/job/JobBase.js +6 -1
  195. package/dist/esm/job/JobBase.js.map +1 -1
  196. package/dist/esm/job/index.js.map +1 -1
  197. package/dist/esm/job/job.js.map +1 -1
  198. package/dist/esm/job/jobContext.js.map +1 -1
  199. package/dist/esm/job/jobEvent.js.map +1 -1
  200. package/dist/esm/job/jobSerialized.js.map +1 -1
  201. package/dist/esm/language/index.js.map +1 -1
  202. package/dist/esm/language/labels.js.map +1 -1
  203. package/dist/esm/logger/index.js.map +1 -1
  204. package/dist/esm/logger/logger.js.map +1 -1
  205. package/dist/esm/message/index.js.map +1 -1
  206. package/dist/esm/message/message.js.map +1 -1
  207. package/dist/esm/message/messages.js.map +1 -1
  208. package/dist/esm/node/factory.js +1 -1
  209. package/dist/esm/node/factory.js.map +1 -1
  210. package/dist/esm/node/index.js +5 -5
  211. package/dist/esm/node/index.js.map +1 -1
  212. package/dist/esm/node/node.js +10 -10
  213. package/dist/esm/node/node.js.map +1 -1
  214. package/dist/esm/node/nodePointer.js.map +1 -1
  215. package/dist/esm/node/nodeValue/code.js.map +1 -1
  216. package/dist/esm/node/nodeValue/coordinate.js.map +1 -1
  217. package/dist/esm/node/nodeValue/file.js.map +1 -1
  218. package/dist/esm/node/nodeValue/index.js.map +1 -1
  219. package/dist/esm/node/nodeValue/taxon.js.map +1 -1
  220. package/dist/esm/node/nodeValueFormatter.js +5 -5
  221. package/dist/esm/node/nodeValueFormatter.js.map +1 -1
  222. package/dist/esm/node/nodeValues.js +2 -2
  223. package/dist/esm/node/nodeValues.js.map +1 -1
  224. package/dist/esm/node/nodes.js +4 -5
  225. package/dist/esm/node/nodes.js.map +1 -1
  226. package/dist/esm/node/service.js.map +1 -1
  227. package/dist/esm/nodeDef/factory.js.map +1 -1
  228. package/dist/esm/nodeDef/index.js.map +1 -1
  229. package/dist/esm/nodeDef/nodeDef.js.map +1 -1
  230. package/dist/esm/nodeDef/nodeDefs.js.map +1 -1
  231. package/dist/esm/nodeDef/service.js.map +1 -1
  232. package/dist/esm/nodeDef/types/boolean.js.map +1 -1
  233. package/dist/esm/nodeDef/types/code.js.map +1 -1
  234. package/dist/esm/nodeDef/types/coordinate.js.map +1 -1
  235. package/dist/esm/nodeDef/types/date.js.map +1 -1
  236. package/dist/esm/nodeDef/types/decimal.js.map +1 -1
  237. package/dist/esm/nodeDef/types/entity.js.map +1 -1
  238. package/dist/esm/nodeDef/types/file.js.map +1 -1
  239. package/dist/esm/nodeDef/types/formHeader.js.map +1 -1
  240. package/dist/esm/nodeDef/types/geo.js.map +1 -1
  241. package/dist/esm/nodeDef/types/integer.js.map +1 -1
  242. package/dist/esm/nodeDef/types/taxon.js.map +1 -1
  243. package/dist/esm/nodeDef/types/text.js.map +1 -1
  244. package/dist/esm/nodeDef/types/time.js.map +1 -1
  245. package/dist/esm/nodeDefExpressionEvaluator/areaOfInterestProvider.js.map +1 -1
  246. package/dist/esm/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
  247. package/dist/esm/nodeDefExpressionEvaluator/context.js.map +1 -1
  248. package/dist/esm/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  249. package/dist/esm/nodeDefExpressionEvaluator/functions.js.map +1 -1
  250. package/dist/esm/nodeDefExpressionEvaluator/index.js.map +1 -1
  251. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js +3 -2
  252. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  253. package/dist/esm/nodeDefExpressionEvaluator/node/member.js.map +1 -1
  254. package/dist/esm/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  255. package/dist/esm/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
  256. package/dist/esm/nodeDefExpressionEvaluator/validator.js.map +1 -1
  257. package/dist/esm/record/_records/nodeDefSelfReferences.js.map +1 -1
  258. package/dist/esm/record/_records/recordCompletion.js +8 -8
  259. package/dist/esm/record/_records/recordCompletion.js.map +1 -1
  260. package/dist/esm/record/_records/recordGetters.js +12 -12
  261. package/dist/esm/record/_records/recordGetters.js.map +1 -1
  262. package/dist/esm/record/_records/recordNodesIndexUpdater.js +3 -3
  263. package/dist/esm/record/_records/recordNodesIndexUpdater.js.map +1 -1
  264. package/dist/esm/record/_records/recordPagesValidation.js +3 -3
  265. package/dist/esm/record/_records/recordPagesValidation.js.map +1 -1
  266. package/dist/esm/record/_records/recordUpdateOptions.js.map +1 -1
  267. package/dist/esm/record/_records/recordUpdater.js.map +1 -1
  268. package/dist/esm/record/_records/recordUtils.js +2 -2
  269. package/dist/esm/record/_records/recordUtils.js.map +1 -1
  270. package/dist/esm/record/factory.js.map +1 -1
  271. package/dist/esm/record/index.js +1 -1
  272. package/dist/esm/record/index.js.map +1 -1
  273. package/dist/esm/record/nodePointers.js +1 -1
  274. package/dist/esm/record/nodePointers.js.map +1 -1
  275. package/dist/esm/record/record.js.map +1 -1
  276. package/dist/esm/record/recordCloner.js +8 -8
  277. package/dist/esm/record/recordCloner.js.map +1 -1
  278. package/dist/esm/record/recordExpressionEvaluator/context.js.map +1 -1
  279. package/dist/esm/record/recordExpressionEvaluator/functions.js +5 -5
  280. package/dist/esm/record/recordExpressionEvaluator/functions.js.map +1 -1
  281. package/dist/esm/record/recordExpressionEvaluator/index.js.map +1 -1
  282. package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js +3 -3
  283. package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
  284. package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +2 -2
  285. package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
  286. package/dist/esm/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  287. package/dist/esm/record/recordExpressionEvaluator/nodeValueExtractor.js +9 -9
  288. package/dist/esm/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
  289. package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  290. package/dist/esm/record/recordFixer.js +6 -6
  291. package/dist/esm/record/recordFixer.js.map +1 -1
  292. package/dist/esm/record/recordNodesUpdater/index.js +0 -9
  293. package/dist/esm/record/recordNodesUpdater/index.js.map +1 -1
  294. package/dist/esm/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
  295. package/dist/esm/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
  296. package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js +1 -1
  297. package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
  298. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +8 -8
  299. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  300. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  301. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +5 -5
  302. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  303. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +7 -3
  304. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  305. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +11 -11
  306. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  307. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js +3 -3
  308. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
  309. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +3 -3
  310. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
  311. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +5 -4
  312. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
  313. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +7 -7
  314. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  315. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js +5 -5
  316. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
  317. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
  318. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js +3 -3
  319. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
  320. package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js +6 -6
  321. package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
  322. package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
  323. package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  324. package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  325. package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  326. package/dist/esm/record/recordPrettyPrinter.js +8 -8
  327. package/dist/esm/record/recordPrettyPrinter.js.map +1 -1
  328. package/dist/esm/record/recordStep.js.map +1 -1
  329. package/dist/esm/record/recordUpdater.js +2 -2
  330. package/dist/esm/record/recordUpdater.js.map +1 -1
  331. package/dist/esm/record/recordValidations.js.map +1 -1
  332. package/dist/esm/record/recordValidator/attributeKeyValidator.js +5 -4
  333. package/dist/esm/record/recordValidator/attributeKeyValidator.js.map +1 -1
  334. package/dist/esm/record/recordValidator/attributeTypeValidator.js +14 -14
  335. package/dist/esm/record/recordValidator/attributeTypeValidator.js.map +1 -1
  336. package/dist/esm/record/recordValidator/attributeUniqueValidator.js +3 -3
  337. package/dist/esm/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  338. package/dist/esm/record/recordValidator/attributeValidator.js +8 -8
  339. package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
  340. package/dist/esm/record/recordValidator/countValidator.js +5 -5
  341. package/dist/esm/record/recordValidator/countValidator.js.map +1 -1
  342. package/dist/esm/record/recordValidator/index.js.map +1 -1
  343. package/dist/esm/record/recordValidator/recordValidator.js.map +1 -1
  344. package/dist/esm/record/records.js +0 -4
  345. package/dist/esm/record/records.js.map +1 -1
  346. package/dist/esm/record/service.js.map +1 -1
  347. package/dist/esm/registry/index.js.map +1 -1
  348. package/dist/esm/registry/serviceRegistry.js.map +1 -1
  349. package/dist/esm/registry/serviceTypeMap.js.map +1 -1
  350. package/dist/esm/srs/factory.js.map +1 -1
  351. package/dist/esm/srs/index.js.map +1 -1
  352. package/dist/esm/srs/srs.js.map +1 -1
  353. package/dist/esm/survey/factory.js.map +1 -1
  354. package/dist/esm/survey/index.js.map +1 -1
  355. package/dist/esm/survey/nodeDefsFixer.js.map +1 -1
  356. package/dist/esm/survey/refData/factory.js.map +1 -1
  357. package/dist/esm/survey/refData/index.js.map +1 -1
  358. package/dist/esm/survey/refData/refData.js.map +1 -1
  359. package/dist/esm/survey/service.js.map +1 -1
  360. package/dist/esm/survey/survey.js.map +1 -1
  361. package/dist/esm/survey/surveyDocImageFactory.js.map +1 -1
  362. package/dist/esm/survey/surveyDocImages.js.map +1 -1
  363. package/dist/esm/survey/surveyFileFactory.js.map +1 -1
  364. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
  365. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  366. package/dist/esm/survey/surveys/dependencies.js.map +1 -1
  367. package/dist/esm/survey/surveys/nodeDefs.js.map +1 -1
  368. package/dist/esm/survey/surveys/refsData.js.map +1 -1
  369. package/dist/esm/survey/surveys/surveyGettersSecurity.js.map +1 -1
  370. package/dist/esm/survey/surveys/surveysGetters.js.map +1 -1
  371. package/dist/esm/survey/surveys/surveysUtils.js.map +1 -1
  372. package/dist/esm/taxonomy/factory.js.map +1 -1
  373. package/dist/esm/taxonomy/index.js.map +1 -1
  374. package/dist/esm/taxonomy/service.js.map +1 -1
  375. package/dist/esm/taxonomy/taxa.js.map +1 -1
  376. package/dist/esm/taxonomy/taxon.js.map +1 -1
  377. package/dist/esm/taxonomy/taxonGenerator.js.map +1 -1
  378. package/dist/esm/taxonomy/taxonService.js.map +1 -1
  379. package/dist/esm/taxonomy/taxonVernacularName.js.map +1 -1
  380. package/dist/esm/taxonomy/taxonomies.js.map +1 -1
  381. package/dist/esm/taxonomy/taxonomy.js.map +1 -1
  382. package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js +2 -2
  383. package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
  384. package/dist/esm/tests/builder/recordBuilder/entityBuilder.js +2 -2
  385. package/dist/esm/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
  386. package/dist/esm/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  387. package/dist/esm/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
  388. package/dist/esm/tests/builder/surveyBuilder/categoryBuilder.js +1 -1
  389. package/dist/esm/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
  390. package/dist/esm/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
  391. package/dist/esm/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  392. package/dist/esm/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  393. package/dist/esm/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  394. package/dist/esm/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  395. package/dist/esm/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  396. package/dist/esm/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
  397. package/dist/esm/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
  398. package/dist/esm/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
  399. package/dist/esm/utils/fileProcessor.js.map +1 -1
  400. package/dist/esm/utils/index.js.map +1 -1
  401. package/dist/esm/utils/mutationOptions.js +1 -4
  402. package/dist/esm/utils/mutationOptions.js.map +1 -1
  403. package/dist/esm/utils/versions.js.map +1 -1
  404. package/dist/esm/validation/factory.js.map +1 -1
  405. package/dist/esm/validation/fieldValidator.js.map +1 -1
  406. package/dist/esm/validation/fieldValidators/email.js.map +1 -1
  407. package/dist/esm/validation/fieldValidators/name.js.map +1 -1
  408. package/dist/esm/validation/fieldValidators/notKeyword.js.map +1 -1
  409. package/dist/esm/validation/fieldValidators/numeric.js.map +1 -1
  410. package/dist/esm/validation/fieldValidators/numericPositive.js.map +1 -1
  411. package/dist/esm/validation/fieldValidators/required.js.map +1 -1
  412. package/dist/esm/validation/index.js.map +1 -1
  413. package/dist/esm/validation/validation.js.map +1 -1
  414. package/dist/esm/validation/validationResults.js.map +1 -1
  415. package/dist/esm/validation/validations.js +4 -5
  416. package/dist/esm/validation/validations.js.map +1 -1
  417. package/dist/esm/validation/validator.js.map +1 -1
  418. package/dist/expression/context.d.ts +1 -1
  419. package/dist/expression/context.js.map +1 -1
  420. package/dist/expression/evaluator.d.ts +6 -6
  421. package/dist/expression/evaluator.js.map +1 -1
  422. package/dist/expression/function.d.ts +4 -4
  423. package/dist/expression/function.js.map +1 -1
  424. package/dist/expression/index.d.ts +4 -4
  425. package/dist/expression/index.js.map +1 -1
  426. package/dist/expression/javascript/evaluator.d.ts +11 -11
  427. package/dist/expression/javascript/evaluator.js.map +1 -1
  428. package/dist/expression/javascript/functionsDefault.d.ts +3 -3
  429. package/dist/expression/javascript/functionsDefault.js.map +1 -1
  430. package/dist/expression/javascript/global.js.map +1 -1
  431. package/dist/expression/javascript/node/array.d.ts +3 -3
  432. package/dist/expression/javascript/node/array.js.map +1 -1
  433. package/dist/expression/javascript/node/binary.d.ts +4 -4
  434. package/dist/expression/javascript/node/binary.js.map +1 -1
  435. package/dist/expression/javascript/node/call.d.ts +4 -4
  436. package/dist/expression/javascript/node/call.js.map +1 -1
  437. package/dist/expression/javascript/node/compound.d.ts +3 -3
  438. package/dist/expression/javascript/node/compound.js.map +1 -1
  439. package/dist/expression/javascript/node/conditional.d.ts +3 -3
  440. package/dist/expression/javascript/node/conditional.js.map +1 -1
  441. package/dist/expression/javascript/node/identifier.d.ts +5 -5
  442. package/dist/expression/javascript/node/identifier.js.map +1 -1
  443. package/dist/expression/javascript/node/literal.d.ts +4 -4
  444. package/dist/expression/javascript/node/literal.js.map +1 -1
  445. package/dist/expression/javascript/node/member.d.ts +5 -5
  446. package/dist/expression/javascript/node/member.js.map +1 -1
  447. package/dist/expression/javascript/node/sequence.d.ts +4 -4
  448. package/dist/expression/javascript/node/sequence.js.map +1 -1
  449. package/dist/expression/javascript/node/this.d.ts +3 -3
  450. package/dist/expression/javascript/node/this.js.map +1 -1
  451. package/dist/expression/javascript/node/unary.d.ts +4 -4
  452. package/dist/expression/javascript/node/unary.js.map +1 -1
  453. package/dist/expression/javascript/parser/parser.d.ts +2 -2
  454. package/dist/expression/javascript/parser/parser.js.map +1 -1
  455. package/dist/expression/node.d.ts +32 -32
  456. package/dist/expression/node.js.map +1 -1
  457. package/dist/expression/parser.d.ts +2 -2
  458. package/dist/expression/parser.js.map +1 -1
  459. package/dist/extraProp/extraProp.d.ts +3 -3
  460. package/dist/extraProp/extraProp.js.map +1 -1
  461. package/dist/extraProp/extraProps.d.ts +5 -5
  462. package/dist/extraProp/extraProps.js.map +1 -1
  463. package/dist/extraProp/extraPropsDataGenerator.d.ts +2 -2
  464. package/dist/extraProp/extraPropsDataGenerator.js.map +1 -1
  465. package/dist/extraProp/index.d.ts +1 -1
  466. package/dist/extraProp/index.js.map +1 -1
  467. package/dist/geo/areaOfInterest.d.ts +4 -4
  468. package/dist/geo/areaOfInterest.js.map +1 -1
  469. package/dist/geo/index.d.ts +2 -2
  470. package/dist/geo/index.js.map +1 -1
  471. package/dist/geo/point.d.ts +1 -1
  472. package/dist/geo/point.js.map +1 -1
  473. package/dist/geo/pointFactory.d.ts +3 -3
  474. package/dist/geo/pointFactory.js.map +1 -1
  475. package/dist/geo/points/bearing.d.ts +4 -4
  476. package/dist/geo/points/bearing.js +1 -1
  477. package/dist/geo/points/bearing.js.map +1 -1
  478. package/dist/geo/points/distance.d.ts +4 -4
  479. package/dist/geo/points/distance.js +1 -1
  480. package/dist/geo/points/distance.js.map +1 -1
  481. package/dist/geo/points/distanceToPolygonBoundary.d.ts +7 -7
  482. package/dist/geo/points/distanceToPolygonBoundary.js +3 -3
  483. package/dist/geo/points/distanceToPolygonBoundary.js.map +1 -1
  484. package/dist/geo/points/equals.d.ts +2 -2
  485. package/dist/geo/points/equals.js.map +1 -1
  486. package/dist/geo/points/getSrs.d.ts +3 -3
  487. package/dist/geo/points/getSrs.js.map +1 -1
  488. package/dist/geo/points/isFilled.d.ts +2 -2
  489. package/dist/geo/points/isFilled.js.map +1 -1
  490. package/dist/geo/points/isValid.d.ts +3 -3
  491. package/dist/geo/points/isValid.js.map +1 -1
  492. package/dist/geo/points/parse.d.ts +3 -3
  493. package/dist/geo/points/parse.js +1 -1
  494. package/dist/geo/points/parse.js.map +1 -1
  495. package/dist/geo/points/pointAtDistance.d.ts +5 -5
  496. package/dist/geo/points/pointAtDistance.js.map +1 -1
  497. package/dist/geo/points/toLatLong.d.ts +3 -3
  498. package/dist/geo/points/toLatLong.js.map +1 -1
  499. package/dist/geo/points/toString.d.ts +2 -2
  500. package/dist/geo/points/toString.js.map +1 -1
  501. package/dist/geo/points/transform.d.ts +4 -4
  502. package/dist/geo/points/transform.js.map +1 -1
  503. package/dist/index.d.ts +26 -26
  504. package/dist/index.js +8 -8
  505. package/dist/index.js.map +1 -1
  506. package/dist/job/JobBase.d.ts +20 -20
  507. package/dist/job/JobBase.js +6 -1
  508. package/dist/job/JobBase.js.map +1 -1
  509. package/dist/job/index.d.ts +5 -5
  510. package/dist/job/index.js.map +1 -1
  511. package/dist/job/job.d.ts +3 -3
  512. package/dist/job/job.js.map +1 -1
  513. package/dist/job/jobContext.d.ts +5 -5
  514. package/dist/job/jobContext.js.map +1 -1
  515. package/dist/job/jobEvent.d.ts +1 -1
  516. package/dist/job/jobEvent.js.map +1 -1
  517. package/dist/job/jobSerialized.d.ts +2 -2
  518. package/dist/job/jobSerialized.js.map +1 -1
  519. package/dist/language/index.d.ts +1 -1
  520. package/dist/language/index.js.map +1 -1
  521. package/dist/language/labels.d.ts +2 -2
  522. package/dist/language/labels.js.map +1 -1
  523. package/dist/logger/index.d.ts +1 -1
  524. package/dist/logger/index.js.map +1 -1
  525. package/dist/logger/logger.d.ts +1 -1
  526. package/dist/logger/logger.js.map +1 -1
  527. package/dist/message/index.d.ts +1 -1
  528. package/dist/message/index.js.map +1 -1
  529. package/dist/message/message.d.ts +1 -1
  530. package/dist/message/message.js.map +1 -1
  531. package/dist/message/messages.d.ts +30 -30
  532. package/dist/message/messages.js.map +1 -1
  533. package/dist/node/factory.d.ts +2 -2
  534. package/dist/node/factory.js +2 -2
  535. package/dist/node/factory.js.map +1 -1
  536. package/dist/node/index.d.ts +9 -9
  537. package/dist/node/index.js +7 -7
  538. package/dist/node/index.js.map +1 -1
  539. package/dist/node/node.d.ts +11 -16
  540. package/dist/node/node.js +11 -11
  541. package/dist/node/node.js.map +1 -1
  542. package/dist/node/nodePointer.d.ts +3 -3
  543. package/dist/node/nodePointer.js.map +1 -1
  544. package/dist/node/nodeValue/code.d.ts +1 -1
  545. package/dist/node/nodeValue/code.js.map +1 -1
  546. package/dist/node/nodeValue/coordinate.d.ts +1 -1
  547. package/dist/node/nodeValue/coordinate.js.map +1 -1
  548. package/dist/node/nodeValue/file.d.ts +1 -1
  549. package/dist/node/nodeValue/file.js.map +1 -1
  550. package/dist/node/nodeValue/index.d.ts +4 -4
  551. package/dist/node/nodeValue/index.js.map +1 -1
  552. package/dist/node/nodeValue/taxon.d.ts +1 -1
  553. package/dist/node/nodeValue/taxon.js.map +1 -1
  554. package/dist/node/nodeValueFormatter.d.ts +5 -5
  555. package/dist/node/nodeValueFormatter.js +5 -5
  556. package/dist/node/nodeValueFormatter.js.map +1 -1
  557. package/dist/node/nodeValues.d.ts +13 -13
  558. package/dist/node/nodeValues.js +3 -3
  559. package/dist/node/nodeValues.js.map +1 -1
  560. package/dist/node/nodes.d.ts +11 -17
  561. package/dist/node/nodes.js +5 -6
  562. package/dist/node/nodes.js.map +1 -1
  563. package/dist/node/service.d.ts +5 -5
  564. package/dist/node/service.js.map +1 -1
  565. package/dist/nodeDef/factory.d.ts +6 -6
  566. package/dist/nodeDef/factory.js.map +1 -1
  567. package/dist/nodeDef/index.d.ts +15 -15
  568. package/dist/nodeDef/index.js.map +1 -1
  569. package/dist/nodeDef/nodeDef.d.ts +32 -32
  570. package/dist/nodeDef/nodeDef.js.map +1 -1
  571. package/dist/nodeDef/nodeDefs.d.ts +106 -106
  572. package/dist/nodeDef/nodeDefs.js.map +1 -1
  573. package/dist/nodeDef/service.d.ts +15 -15
  574. package/dist/nodeDef/service.js.map +1 -1
  575. package/dist/nodeDef/types/boolean.d.ts +3 -3
  576. package/dist/nodeDef/types/boolean.js.map +1 -1
  577. package/dist/nodeDef/types/code.d.ts +4 -4
  578. package/dist/nodeDef/types/code.js.map +1 -1
  579. package/dist/nodeDef/types/coordinate.d.ts +3 -3
  580. package/dist/nodeDef/types/coordinate.js.map +1 -1
  581. package/dist/nodeDef/types/date.d.ts +2 -2
  582. package/dist/nodeDef/types/date.js.map +1 -1
  583. package/dist/nodeDef/types/decimal.d.ts +3 -3
  584. package/dist/nodeDef/types/decimal.js.map +1 -1
  585. package/dist/nodeDef/types/entity.d.ts +9 -9
  586. package/dist/nodeDef/types/entity.js.map +1 -1
  587. package/dist/nodeDef/types/file.d.ts +3 -3
  588. package/dist/nodeDef/types/file.js.map +1 -1
  589. package/dist/nodeDef/types/formHeader.d.ts +3 -3
  590. package/dist/nodeDef/types/formHeader.js.map +1 -1
  591. package/dist/nodeDef/types/geo.d.ts +3 -3
  592. package/dist/nodeDef/types/geo.js.map +1 -1
  593. package/dist/nodeDef/types/integer.d.ts +2 -2
  594. package/dist/nodeDef/types/integer.js.map +1 -1
  595. package/dist/nodeDef/types/taxon.d.ts +3 -3
  596. package/dist/nodeDef/types/taxon.js.map +1 -1
  597. package/dist/nodeDef/types/text.d.ts +4 -4
  598. package/dist/nodeDef/types/text.js.map +1 -1
  599. package/dist/nodeDef/types/time.d.ts +3 -3
  600. package/dist/nodeDef/types/time.js.map +1 -1
  601. package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.d.ts +5 -5
  602. package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.js.map +1 -1
  603. package/dist/nodeDefExpressionEvaluator/categoryItemProvider.d.ts +9 -9
  604. package/dist/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
  605. package/dist/nodeDefExpressionEvaluator/context.d.ts +16 -16
  606. package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
  607. package/dist/nodeDefExpressionEvaluator/evaluator.d.ts +6 -6
  608. package/dist/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  609. package/dist/nodeDefExpressionEvaluator/functions.d.ts +2 -2
  610. package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
  611. package/dist/nodeDefExpressionEvaluator/index.d.ts +3 -3
  612. package/dist/nodeDefExpressionEvaluator/index.js.map +1 -1
  613. package/dist/nodeDefExpressionEvaluator/node/identifier.d.ts +4 -4
  614. package/dist/nodeDefExpressionEvaluator/node/identifier.js +2 -1
  615. package/dist/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  616. package/dist/nodeDefExpressionEvaluator/node/member.d.ts +2 -2
  617. package/dist/nodeDefExpressionEvaluator/node/member.js.map +1 -1
  618. package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.d.ts +1 -1
  619. package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  620. package/dist/nodeDefExpressionEvaluator/taxonProvider.d.ts +7 -7
  621. package/dist/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
  622. package/dist/nodeDefExpressionEvaluator/validator.d.ts +2 -2
  623. package/dist/nodeDefExpressionEvaluator/validator.js.map +1 -1
  624. package/dist/record/_records/nodeDefSelfReferences.d.ts +2 -2
  625. package/dist/record/_records/nodeDefSelfReferences.js.map +1 -1
  626. package/dist/record/_records/recordCompletion.d.ts +6 -6
  627. package/dist/record/_records/recordCompletion.js +7 -7
  628. package/dist/record/_records/recordCompletion.js.map +1 -1
  629. package/dist/record/_records/recordGetters.d.ts +21 -21
  630. package/dist/record/_records/recordGetters.js +9 -9
  631. package/dist/record/_records/recordGetters.js.map +1 -1
  632. package/dist/record/_records/recordNodesIndexUpdater.d.ts +4 -4
  633. package/dist/record/_records/recordNodesIndexUpdater.js +2 -2
  634. package/dist/record/_records/recordNodesIndexUpdater.js.map +1 -1
  635. package/dist/record/_records/recordPagesValidation.d.ts +12 -12
  636. package/dist/record/_records/recordPagesValidation.js +2 -2
  637. package/dist/record/_records/recordPagesValidation.js.map +1 -1
  638. package/dist/record/_records/recordUpdateOptions.d.ts +3 -3
  639. package/dist/record/_records/recordUpdateOptions.js.map +1 -1
  640. package/dist/record/_records/recordUpdater.d.ts +3 -3
  641. package/dist/record/_records/recordUpdater.js.map +1 -1
  642. package/dist/record/_records/recordUtils.d.ts +11 -11
  643. package/dist/record/_records/recordUtils.js +1 -1
  644. package/dist/record/_records/recordUtils.js.map +1 -1
  645. package/dist/record/factory.d.ts +6 -6
  646. package/dist/record/factory.js.map +1 -1
  647. package/dist/record/index.d.ts +8 -8
  648. package/dist/record/index.js +2 -2
  649. package/dist/record/index.js.map +1 -1
  650. package/dist/record/nodePointers.d.ts +4 -4
  651. package/dist/record/nodePointers.js +2 -2
  652. package/dist/record/nodePointers.js.map +1 -1
  653. package/dist/record/record.d.ts +5 -10
  654. package/dist/record/record.js.map +1 -1
  655. package/dist/record/recordCloner.d.ts +2 -2
  656. package/dist/record/recordCloner.js +6 -6
  657. package/dist/record/recordCloner.js.map +1 -1
  658. package/dist/record/recordExpressionEvaluator/context.d.ts +12 -12
  659. package/dist/record/recordExpressionEvaluator/context.js.map +1 -1
  660. package/dist/record/recordExpressionEvaluator/functions.d.ts +3 -3
  661. package/dist/record/recordExpressionEvaluator/functions.js +4 -4
  662. package/dist/record/recordExpressionEvaluator/functions.js.map +1 -1
  663. package/dist/record/recordExpressionEvaluator/index.d.ts +1 -1
  664. package/dist/record/recordExpressionEvaluator/index.js.map +1 -1
  665. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.d.ts +4 -4
  666. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js +2 -2
  667. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
  668. package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.d.ts +4 -4
  669. package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +1 -1
  670. package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
  671. package/dist/record/recordExpressionEvaluator/node/thisEvaluator.d.ts +2 -2
  672. package/dist/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  673. package/dist/record/recordExpressionEvaluator/nodeValueExtractor.d.ts +4 -4
  674. package/dist/record/recordExpressionEvaluator/nodeValueExtractor.js +8 -8
  675. package/dist/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
  676. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.d.ts +10 -10
  677. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  678. package/dist/record/recordFixer.d.ts +3 -3
  679. package/dist/record/recordFixer.js +5 -5
  680. package/dist/record/recordFixer.js.map +1 -1
  681. package/dist/record/recordNodesUpdater/index.d.ts +2 -11
  682. package/dist/record/recordNodesUpdater/index.js +0 -9
  683. package/dist/record/recordNodesUpdater/index.js.map +1 -1
  684. package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.d.ts +6 -6
  685. package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
  686. package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.d.ts +12 -12
  687. package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
  688. package/dist/record/recordNodesUpdater/recordExpressionValueConverter.d.ts +8 -8
  689. package/dist/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
  690. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +7 -7
  691. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  692. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.d.ts +7 -7
  693. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  694. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +4 -4
  695. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  696. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +6 -2
  697. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  698. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +9 -9
  699. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  700. package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js +2 -2
  701. package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
  702. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.d.ts +4 -4
  703. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +2 -2
  704. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
  705. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.d.ts +2 -2
  706. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +4 -3
  707. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
  708. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +5 -5
  709. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  710. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.d.ts +5 -5
  711. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js +4 -4
  712. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
  713. package/dist/record/recordNodesUpdater/recordNodeDependentsUpdateParams.d.ts +2 -2
  714. package/dist/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
  715. package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js +2 -2
  716. package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
  717. package/dist/record/recordNodesUpdater/recordNodesCreator.d.ts +20 -20
  718. package/dist/record/recordNodesUpdater/recordNodesCreator.js +4 -4
  719. package/dist/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
  720. package/dist/record/recordNodesUpdater/recordNodesDeleter.d.ts +3 -3
  721. package/dist/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
  722. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.d.ts +9 -9
  723. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  724. package/dist/record/recordNodesUpdater/recordNodesUpdater.d.ts +4 -4
  725. package/dist/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  726. package/dist/record/recordNodesUpdater/recordUpdateResult.d.ts +11 -11
  727. package/dist/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  728. package/dist/record/recordPrettyPrinter.d.ts +6 -6
  729. package/dist/record/recordPrettyPrinter.js +7 -7
  730. package/dist/record/recordPrettyPrinter.js.map +1 -1
  731. package/dist/record/recordStep.d.ts +4 -4
  732. package/dist/record/recordStep.js.map +1 -1
  733. package/dist/record/recordUpdater.d.ts +7 -7
  734. package/dist/record/recordUpdater.js +1 -1
  735. package/dist/record/recordUpdater.js.map +1 -1
  736. package/dist/record/recordValidations.d.ts +3 -3
  737. package/dist/record/recordValidations.js.map +1 -1
  738. package/dist/record/recordValidator/attributeKeyValidator.d.ts +9 -9
  739. package/dist/record/recordValidator/attributeKeyValidator.js +4 -3
  740. package/dist/record/recordValidator/attributeKeyValidator.js.map +1 -1
  741. package/dist/record/recordValidator/attributeTypeValidator.d.ts +10 -10
  742. package/dist/record/recordValidator/attributeTypeValidator.js +11 -11
  743. package/dist/record/recordValidator/attributeTypeValidator.js.map +1 -1
  744. package/dist/record/recordValidator/attributeUniqueValidator.d.ts +6 -6
  745. package/dist/record/recordValidator/attributeUniqueValidator.js +2 -2
  746. package/dist/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  747. package/dist/record/recordValidator/attributeValidator.d.ts +8 -8
  748. package/dist/record/recordValidator/attributeValidator.js +6 -6
  749. package/dist/record/recordValidator/attributeValidator.js.map +1 -1
  750. package/dist/record/recordValidator/countValidator.d.ts +10 -10
  751. package/dist/record/recordValidator/countValidator.js +4 -4
  752. package/dist/record/recordValidator/countValidator.js.map +1 -1
  753. package/dist/record/recordValidator/index.d.ts +1 -1
  754. package/dist/record/recordValidator/index.js.map +1 -1
  755. package/dist/record/recordValidator/recordValidator.d.ts +5 -5
  756. package/dist/record/recordValidator/recordValidator.js.map +1 -1
  757. package/dist/record/records.d.ts +1 -5
  758. package/dist/record/records.js +0 -4
  759. package/dist/record/records.js.map +1 -1
  760. package/dist/record/service.d.ts +7 -7
  761. package/dist/record/service.js.map +1 -1
  762. package/dist/registry/index.d.ts +1 -1
  763. package/dist/registry/index.js.map +1 -1
  764. package/dist/registry/serviceRegistry.d.ts +2 -2
  765. package/dist/registry/serviceRegistry.js.map +1 -1
  766. package/dist/registry/serviceTypeMap.d.ts +22 -22
  767. package/dist/registry/serviceTypeMap.js.map +1 -1
  768. package/dist/srs/factory.d.ts +3 -3
  769. package/dist/srs/factory.js.map +1 -1
  770. package/dist/srs/index.d.ts +1 -1
  771. package/dist/srs/index.js.map +1 -1
  772. package/dist/srs/srs.d.ts +5 -5
  773. package/dist/srs/srs.js.map +1 -1
  774. package/dist/survey/factory.d.ts +7 -7
  775. package/dist/survey/factory.js.map +1 -1
  776. package/dist/survey/index.d.ts +5 -5
  777. package/dist/survey/index.js.map +1 -1
  778. package/dist/survey/nodeDefsFixer.d.ts +6 -6
  779. package/dist/survey/nodeDefsFixer.js.map +1 -1
  780. package/dist/survey/refData/factory.d.ts +7 -7
  781. package/dist/survey/refData/factory.js.map +1 -1
  782. package/dist/survey/refData/index.d.ts +1 -1
  783. package/dist/survey/refData/index.js.map +1 -1
  784. package/dist/survey/refData/refData.d.ts +5 -5
  785. package/dist/survey/refData/refData.js.map +1 -1
  786. package/dist/survey/service.d.ts +18 -18
  787. package/dist/survey/service.js.map +1 -1
  788. package/dist/survey/survey.d.ts +42 -42
  789. package/dist/survey/survey.js.map +1 -1
  790. package/dist/survey/surveyDocImageFactory.d.ts +5 -5
  791. package/dist/survey/surveyDocImageFactory.js.map +1 -1
  792. package/dist/survey/surveyDocImages.d.ts +7 -7
  793. package/dist/survey/surveyDocImages.js.map +1 -1
  794. package/dist/survey/surveyFileFactory.d.ts +4 -4
  795. package/dist/survey/surveyFileFactory.js.map +1 -1
  796. package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.d.ts +7 -7
  797. package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
  798. package/dist/survey/surveys/_nodeDefs/nodeDefsReader.d.ts +4 -4
  799. package/dist/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  800. package/dist/survey/surveys/dependencies.d.ts +12 -12
  801. package/dist/survey/surveys/dependencies.js.map +1 -1
  802. package/dist/survey/surveys/index.d.ts +3 -3
  803. package/dist/survey/surveys/nodeDefs.d.ts +80 -80
  804. package/dist/survey/surveys/nodeDefs.js.map +1 -1
  805. package/dist/survey/surveys/refsData.d.ts +23 -23
  806. package/dist/survey/surveys/refsData.js.map +1 -1
  807. package/dist/survey/surveys/surveyGettersSecurity.d.ts +10 -10
  808. package/dist/survey/surveys/surveyGettersSecurity.js.map +1 -1
  809. package/dist/survey/surveys/surveysGetters.d.ts +33 -33
  810. package/dist/survey/surveys/surveysGetters.js.map +1 -1
  811. package/dist/survey/surveys/surveysUtils.d.ts +7 -7
  812. package/dist/survey/surveys/surveysUtils.js.map +1 -1
  813. package/dist/taxonomy/factory.d.ts +13 -13
  814. package/dist/taxonomy/factory.js.map +1 -1
  815. package/dist/taxonomy/index.d.ts +6 -6
  816. package/dist/taxonomy/index.js.map +1 -1
  817. package/dist/taxonomy/service.d.ts +11 -11
  818. package/dist/taxonomy/service.js.map +1 -1
  819. package/dist/taxonomy/taxa.d.ts +7 -7
  820. package/dist/taxonomy/taxa.js.map +1 -1
  821. package/dist/taxonomy/taxon.d.ts +6 -6
  822. package/dist/taxonomy/taxon.js.map +1 -1
  823. package/dist/taxonomy/taxonGenerator.d.ts +4 -4
  824. package/dist/taxonomy/taxonGenerator.js.map +1 -1
  825. package/dist/taxonomy/taxonService.d.ts +10 -10
  826. package/dist/taxonomy/taxonService.js.map +1 -1
  827. package/dist/taxonomy/taxonVernacularName.d.ts +2 -2
  828. package/dist/taxonomy/taxonVernacularName.js.map +1 -1
  829. package/dist/taxonomy/taxonomies.d.ts +5 -5
  830. package/dist/taxonomy/taxonomies.js.map +1 -1
  831. package/dist/taxonomy/taxonomy.d.ts +6 -6
  832. package/dist/taxonomy/taxonomy.js.map +1 -1
  833. package/dist/tests/builder/recordBuilder/attributeBuilder.d.ts +2 -2
  834. package/dist/tests/builder/recordBuilder/attributeBuilder.js +1 -1
  835. package/dist/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
  836. package/dist/tests/builder/recordBuilder/entityBuilder.d.ts +2 -2
  837. package/dist/tests/builder/recordBuilder/entityBuilder.js +1 -1
  838. package/dist/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
  839. package/dist/tests/builder/recordBuilder/nodeBuilder.d.ts +5 -5
  840. package/dist/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  841. package/dist/tests/builder/recordBuilder/recordBuilder.d.ts +3 -3
  842. package/dist/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
  843. package/dist/tests/builder/surveyBuilder/categoryBuilder.d.ts +5 -5
  844. package/dist/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
  845. package/dist/tests/builder/surveyBuilder/categoryItemBuilder.d.ts +2 -2
  846. package/dist/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
  847. package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.d.ts +5 -5
  848. package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  849. package/dist/tests/builder/surveyBuilder/nodeDefBuilder.d.ts +15 -15
  850. package/dist/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  851. package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.d.ts +5 -5
  852. package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  853. package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.d.ts +5 -5
  854. package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  855. package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.d.ts +5 -5
  856. package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  857. package/dist/tests/builder/surveyBuilder/surveyBuilder.d.ts +4 -4
  858. package/dist/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
  859. package/dist/tests/builder/surveyBuilder/taxonBuilder.d.ts +2 -2
  860. package/dist/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
  861. package/dist/tests/builder/surveyBuilder/taxonomyBuilder.d.ts +5 -5
  862. package/dist/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
  863. package/dist/utils/fileProcessor.d.ts +2 -2
  864. package/dist/utils/fileProcessor.js.map +1 -1
  865. package/dist/utils/index.d.ts +3 -3
  866. package/dist/utils/index.js.map +1 -1
  867. package/dist/utils/mutationOptions.d.ts +1 -5
  868. package/dist/utils/mutationOptions.js +0 -6
  869. package/dist/utils/mutationOptions.js.map +1 -1
  870. package/dist/utils/versions.d.ts +2 -2
  871. package/dist/utils/versions.js.map +1 -1
  872. package/dist/validation/factory.d.ts +10 -10
  873. package/dist/validation/factory.js.map +1 -1
  874. package/dist/validation/fieldValidator.d.ts +2 -2
  875. package/dist/validation/fieldValidator.js.map +1 -1
  876. package/dist/validation/fieldValidators/email.d.ts +2 -2
  877. package/dist/validation/fieldValidators/email.js.map +1 -1
  878. package/dist/validation/fieldValidators/name.d.ts +2 -2
  879. package/dist/validation/fieldValidators/name.js.map +1 -1
  880. package/dist/validation/fieldValidators/notKeyword.d.ts +2 -2
  881. package/dist/validation/fieldValidators/notKeyword.js.map +1 -1
  882. package/dist/validation/fieldValidators/numeric.d.ts +2 -2
  883. package/dist/validation/fieldValidators/numeric.js.map +1 -1
  884. package/dist/validation/fieldValidators/numericPositive.d.ts +2 -2
  885. package/dist/validation/fieldValidators/numericPositive.js.map +1 -1
  886. package/dist/validation/fieldValidators/required.d.ts +2 -2
  887. package/dist/validation/fieldValidators/required.js.map +1 -1
  888. package/dist/validation/index.d.ts +3 -3
  889. package/dist/validation/index.js.map +1 -1
  890. package/dist/validation/validation.d.ts +11 -11
  891. package/dist/validation/validation.js.map +1 -1
  892. package/dist/validation/validationResults.d.ts +9 -9
  893. package/dist/validation/validationResults.js.map +1 -1
  894. package/dist/validation/validations.d.ts +35 -39
  895. package/dist/validation/validations.js +4 -5
  896. package/dist/validation/validations.js.map +1 -1
  897. package/dist/validation/validator.d.ts +4 -4
  898. package/dist/validation/validator.js.map +1 -1
  899. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FlatDataExportModel.js","sourceRoot":"","sources":["../../../src/dataExport/FlatDataExportModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAwB,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxE,OAAO,EAAU,OAAO,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,4BAA4B,EAAyB,MAAM,yBAAyB,CAAA;AAE7F,MAAM,CAAN,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACtC,mDAAmB,CAAA;IACnB,mDAAmB,CAAA;IACnB,6CAAa,CAAA;AACf,CAAC,EAJW,4BAA4B,KAA5B,4BAA4B,QAIvC;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAA2C,EAAE,EAAE,CAChH,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAA;AAEzC,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAsC,EAAE,EAAE,CAAC,CAAC;IACpF,MAAM,EAAE,QAAQ,CAAC,OAAO,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ef, NodeDefCode, NodeDefs, NodeDefType } from '../nodeDef'\nimport { Survey, Surveys } from '../survey'\nimport { Strings } from '../utils'\nimport { FlatDataExportDefaultOptions, FlatDataExportOptions } from './FlatDataExportOptions'\n\nexport enum FlatDataExportColumnDataType {\n boolean = 'boolean',\n numeric = 'numeric',\n text = 'text',\n}\n\nexport const getExpandedCategoryItemColumnHeader = ({ nodeDef, code }: { nodeDef: NodeDef<any>; code: string }) =>\n `${NodeDefs.getName(nodeDef)}__${code}`\n\nconst getMainColumn = ({ nodeDef, dataType }: { nodeDef: any; dataType: string }) => ({\n header: NodeDefs.getName(nodeDef),\n nodeDef,\n dataType,\n})\n\ntype Column = {\n key?: boolean\n header: string\n nodeDef?: any\n dataType?: string\n valueProp?: string\n}\n\ntype ColumnsExtractor = ({\n survey,\n nodeDef,\n options,\n}: {\n nodeDef: NodeDef<any>\n survey: Survey\n options: FlatDataExportOptions\n}) => Column[]\n\nconst columnsExtractorByNodeDefType: Partial<Record<NodeDefType, ColumnsExtractor>> = {\n [NodeDefType.boolean]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.boolean })],\n [NodeDefType.code]: ({ survey, nodeDef, options }) => {\n const nodeDefCode = nodeDef as NodeDefCode\n const { includeCategoryItemsLabels = false, expandCategoryItems = false } = options ?? {}\n const nodeDefName = NodeDefs.getName(nodeDef)\n const result = [\n {\n header: nodeDefName,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsCode.code,\n },\n ]\n if (includeCategoryItemsLabels) {\n result.push({\n header: `${nodeDefName}_label`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsCode.label,\n })\n }\n if (expandCategoryItems) {\n const categoryUuid = NodeDefs.getCategoryUuid(nodeDefCode)!\n const levelIndex = Surveys.getNodeDefCategoryLevelIndex({ survey, nodeDef: nodeDefCode })\n const items = Surveys.getCategoryItemsInLevel({ survey, categoryUuid, levelIndex })\n items.forEach((item) => {\n result.push({\n header: getExpandedCategoryItemColumnHeader({ nodeDef, code: CategoryItems.getCode(item) }),\n nodeDef,\n dataType: FlatDataExportColumnDataType.boolean,\n valueProp: NodeValues.ValuePropsCode.code,\n })\n })\n }\n return result\n },\n [NodeDefType.coordinate]: ({ nodeDef }) => {\n const nodeDefName = NodeDefs.getName(nodeDef)\n return [\n {\n header: `${nodeDefName}_x`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.numeric,\n valueProp: NodeValues.ValuePropsCoordinate.x,\n },\n {\n header: `${nodeDefName}_y`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.numeric,\n valueProp: NodeValues.ValuePropsCoordinate.y,\n },\n {\n header: `${nodeDefName}_srs`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsCoordinate.srs,\n },\n ...NodeDefs.getCoordinateAdditionalFields(nodeDef).map((field) => ({\n header: `${nodeDefName}_${Strings.snakeCase(field)}`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.numeric,\n valueProp: field,\n })),\n ]\n },\n [NodeDefType.date]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.text })],\n [NodeDefType.decimal]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.numeric })],\n [NodeDefType.file]: ({ nodeDef }) => {\n const nodeDefName = NodeDefs.getName(nodeDef)\n return [\n {\n header: `${nodeDefName}_file_uuid`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsFile.fileUuid,\n },\n {\n header: `${nodeDefName}_file_name`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsFile.fileName,\n },\n ]\n },\n [NodeDefType.integer]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.numeric })],\n [NodeDefType.taxon]: ({ nodeDef, options }) => {\n const { includeTaxonScientificName = false } = options ?? {}\n const nodeDefName = NodeDefs.getName(nodeDef)\n return [\n {\n header: nodeDefName,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsTaxon.code,\n },\n ...(includeTaxonScientificName\n ? [\n {\n header: `${nodeDefName}_scientific_name`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsTaxon.scientificName,\n },\n {\n header: `${nodeDefName}_vernacular_name`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: NodeValues.ValuePropsTaxon.vernacularName,\n },\n ]\n : []),\n ]\n },\n [NodeDefType.text]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.text })],\n [NodeDefType.time]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.text })],\n}\n\nconst RECORD_CYCLE_HEADER = 'record_cycle'\n\nexport class FlatDataExportModel {\n survey: Survey\n cycle: string\n nodeDefContext: NodeDef<any>\n options: FlatDataExportOptions\n columns: Column[]\n\n static readonly columnDataType: typeof FlatDataExportColumnDataType = FlatDataExportColumnDataType\n static readonly getExpandedCategoryItemColumnHeader: typeof getExpandedCategoryItemColumnHeader =\n getExpandedCategoryItemColumnHeader\n\n constructor({\n survey,\n cycle,\n nodeDefContext,\n options = FlatDataExportDefaultOptions,\n }: {\n survey: Survey\n cycle: string\n nodeDefContext: NodeDef<any>\n options?: FlatDataExportOptions\n }) {\n this.survey = survey\n this.cycle = cycle\n this.nodeDefContext = nodeDefContext\n this.options = { ...FlatDataExportDefaultOptions, ...options }\n this.columns = []\n\n this.init()\n }\n\n init() {\n this._initColumns()\n }\n\n _initColumns() {\n const { addCycle } = this.options\n\n const ancestorsColumns = this.extractAncestorsColumns()\n\n const contextNodeDefsColumns = this.extractContextNodeDefsColumns()\n\n this.columns = [\n ...(addCycle ? [{ header: RECORD_CYCLE_HEADER }] : []),\n ...ancestorsColumns,\n ...contextNodeDefsColumns,\n ]\n }\n\n _createColumnsFromAttributeDefs(attributeDefs: NodeDef<any>[]) {\n const { survey, options } = this\n const result = []\n for (const nodeDef of attributeDefs) {\n const columnsGetter = columnsExtractorByNodeDefType[NodeDefs.getType(nodeDef)]\n\n const columnsPerAttribute = columnsGetter ? columnsGetter({ survey, nodeDef, options }) : []\n\n if (NodeDefs.isKey(nodeDef)) {\n for (const col of columnsPerAttribute) {\n col.key = true\n }\n }\n result.push(...columnsPerAttribute)\n }\n return result\n }\n\n protected extractAncestorsColumns(): Column[] {\n const { survey, cycle, nodeDefContext, options } = this\n const { includeAncestorAttributes } = options\n\n const ancestorsColumns: Column[] = []\n\n Surveys.visitAncestorsAndSelfNodeDef({\n survey,\n nodeDef: nodeDefContext,\n visitor: (nodeDefAncestor) => {\n const ancestorAttributeDefs = includeAncestorAttributes\n ? // include all ancestor attributes\n this.extractAncestorAttributeDefs(nodeDefAncestor)\n : // consider only ancestor key attributes\n Surveys.getNodeDefKeys({ survey, cycle, nodeDef: nodeDefAncestor })\n const ancestorColumns = this._createColumnsFromAttributeDefs(ancestorAttributeDefs)\n ancestorsColumns.unshift(...ancestorColumns)\n },\n includeSelf: false,\n })\n\n return ancestorsColumns\n }\n\n extractAncestorAttributeDefs(nodeDefContext: NodeDef<any>): NodeDef<any>[] {\n const { cycle, options, survey } = this\n const {\n includeAnalysis,\n includeFileAttributeDefs,\n includeFiles,\n includeMultipleAttributes,\n includeReadOnlyAttributes,\n } = options\n\n let result = NodeDefs.isEntity(nodeDefContext)\n ? Surveys.getDescendantsInSingleEntities({\n survey,\n cycle,\n nodeDef: nodeDefContext,\n predicate: includeMultipleAttributes ? NodeDefs.isAttribute : NodeDefs.isSingleAttribute,\n includeAnalysis,\n })\n : [nodeDefContext] // Multiple attribute\n\n result = result.filter(\n (nodeDef) =>\n (includeFileAttributeDefs || includeFiles || NodeDefs.getType(nodeDef) !== NodeDefType.file) &&\n (includeReadOnlyAttributes || !NodeDefs.isReadOnly(nodeDef) || NodeDefs.isKey(nodeDef))\n )\n return result\n }\n\n protected extractContextNodeDefsColumns(): Column[] {\n const descendantDefs = this.extractAncestorAttributeDefs(this.nodeDefContext)\n return this._createColumnsFromAttributeDefs(descendantDefs)\n }\n\n get headers() {\n return this.columns.map((column) => column.header)\n }\n\n getColumnByHeader(header: string): Column | undefined {\n return this.columns.find((column) => column.header === header)\n }\n}\n"]}
1
+ {"version":3,"file":"FlatDataExportModel.js","sourceRoot":"","sources":["../../../src/dataExport/FlatDataExportModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAkC,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAClF,OAAO,EAAe,OAAO,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,4BAA4B,EAA8B,MAAM,yBAAyB,CAAA;AAElG,MAAM,CAAN,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACtC,mDAAmB,CAAA;IACnB,mDAAmB,CAAA;IACnB,6CAAa,CAAA;AACf,CAAC,EAJW,4BAA4B,KAA5B,4BAA4B,QAIvC;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAgD,EAAE,EAAE,CACrH,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAA;AAEzC,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAsC,EAAE,EAAE,CAAC,CAAC;IACpF,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;IACjC,OAAO;IACP,QAAQ;CACT,CAAC,CAAA;AAoBF,MAAM,6BAA6B,GAAmD;IACpF,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO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AE,yBAAyB,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB;gBACxF,eAAe;aAChB,CAAC;YACJ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA,CAAC,qBAAqB;QAE1C,MAAM,GAAG,MAAM,CAAC,MAAM,CACpB,CAAC,OAAO,EAAE,EAAE,CACV,CAAC,wBAAwB,IAAI,YAAY,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,IAAI,CAAC;YAC5F,CAAC,yBAAyB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAC1F,CAAA;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAES,6BAA6B;QACrC,MAAM,cAAc,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC7E,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAA;IAC7D,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACpD,CAAC;IAED,iBAAiB,CAAC,MAAc;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,CAAA;IAChE,CAAC;CACF;AA5HiB,kCAAc,GAAwC,4BAA4B,CAAA;AAClF,uDAAmC,GACjD,mCAAmC,CAAA","sourcesContent":["import { CategoryItems } from '../category'\nimport { RecordNodeValues } from '../node'\nimport { ArenaNodeDef, ArenaNodeDefCode, NodeDefs, NodeDefType } from '../nodeDef'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { Strings } from '../utils'\nimport { FlatDataExportDefaultOptions, ArenaFlatDataExportOptions } from './FlatDataExportOptions'\n\nexport enum FlatDataExportColumnDataType {\n boolean = 'boolean',\n numeric = 'numeric',\n text = 'text',\n}\n\nexport const getExpandedCategoryItemColumnHeader = ({ nodeDef, code }: { nodeDef: ArenaNodeDef<any>; code: string }) =>\n `${NodeDefs.getName(nodeDef)}__${code}`\n\nconst getMainColumn = ({ nodeDef, dataType }: { nodeDef: any; dataType: string }) => ({\n header: NodeDefs.getName(nodeDef),\n nodeDef,\n dataType,\n})\n\ntype Column = {\n key?: boolean\n header: string\n nodeDef?: any\n dataType?: string\n valueProp?: string\n}\n\ntype ColumnsExtractor = ({\n survey,\n nodeDef,\n options,\n}: {\n nodeDef: ArenaNodeDef<any>\n survey: ArenaSurvey\n options: ArenaFlatDataExportOptions\n}) => Column[]\n\nconst columnsExtractorByNodeDefType: Partial<Record<NodeDefType, ColumnsExtractor>> = {\n [NodeDefType.boolean]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.boolean })],\n [NodeDefType.code]: ({ survey, nodeDef, options }) => {\n const nodeDefCode = nodeDef as ArenaNodeDefCode\n const { includeCategoryItemsLabels = false, expandCategoryItems = false } = options ?? {}\n const nodeDefName = NodeDefs.getName(nodeDef)\n const result = [\n {\n header: nodeDefName,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsCode.code,\n },\n ]\n if (includeCategoryItemsLabels) {\n result.push({\n header: `${nodeDefName}_label`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsCode.label,\n })\n }\n if (expandCategoryItems) {\n const categoryUuid = NodeDefs.getCategoryUuid(nodeDefCode)!\n const levelIndex = Surveys.getNodeDefCategoryLevelIndex({ survey, nodeDef: nodeDefCode })\n const items = Surveys.getCategoryItemsInLevel({ survey, categoryUuid, levelIndex })\n items.forEach((item) => {\n result.push({\n header: getExpandedCategoryItemColumnHeader({ nodeDef, code: CategoryItems.getCode(item) }),\n nodeDef,\n dataType: FlatDataExportColumnDataType.boolean,\n valueProp: RecordNodeValues.ValuePropsCode.code,\n })\n })\n }\n return result\n },\n [NodeDefType.coordinate]: ({ nodeDef }) => {\n const nodeDefName = NodeDefs.getName(nodeDef)\n return [\n {\n header: `${nodeDefName}_x`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.numeric,\n valueProp: RecordNodeValues.ValuePropsCoordinate.x,\n },\n {\n header: `${nodeDefName}_y`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.numeric,\n valueProp: RecordNodeValues.ValuePropsCoordinate.y,\n },\n {\n header: `${nodeDefName}_srs`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsCoordinate.srs,\n },\n ...NodeDefs.getCoordinateAdditionalFields(nodeDef).map((field) => ({\n header: `${nodeDefName}_${Strings.snakeCase(field)}`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.numeric,\n valueProp: field,\n })),\n ]\n },\n [NodeDefType.date]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.text })],\n [NodeDefType.decimal]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.numeric })],\n [NodeDefType.file]: ({ nodeDef }) => {\n const nodeDefName = NodeDefs.getName(nodeDef)\n return [\n {\n header: `${nodeDefName}_file_uuid`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsFile.fileUuid,\n },\n {\n header: `${nodeDefName}_file_name`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsFile.fileName,\n },\n ]\n },\n [NodeDefType.integer]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.numeric })],\n [NodeDefType.taxon]: ({ nodeDef, options }) => {\n const { includeTaxonScientificName = false } = options ?? {}\n const nodeDefName = NodeDefs.getName(nodeDef)\n return [\n {\n header: nodeDefName,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsTaxon.code,\n },\n ...(includeTaxonScientificName\n ? [\n {\n header: `${nodeDefName}_scientific_name`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsTaxon.scientificName,\n },\n {\n header: `${nodeDefName}_vernacular_name`,\n nodeDef,\n dataType: FlatDataExportColumnDataType.text,\n valueProp: RecordNodeValues.ValuePropsTaxon.vernacularName,\n },\n ]\n : []),\n ]\n },\n [NodeDefType.text]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.text })],\n [NodeDefType.time]: ({ nodeDef }) => [getMainColumn({ nodeDef, dataType: FlatDataExportColumnDataType.text })],\n}\n\nconst RECORD_CYCLE_HEADER = 'record_cycle'\n\nexport class FlatDataExportModel {\n survey: ArenaSurvey\n cycle: string\n nodeDefContext: ArenaNodeDef<any>\n options: ArenaFlatDataExportOptions\n columns: Column[]\n\n static readonly columnDataType: typeof FlatDataExportColumnDataType = FlatDataExportColumnDataType\n static readonly getExpandedCategoryItemColumnHeader: typeof getExpandedCategoryItemColumnHeader =\n getExpandedCategoryItemColumnHeader\n\n constructor({\n survey,\n cycle,\n nodeDefContext,\n options = FlatDataExportDefaultOptions,\n }: {\n survey: ArenaSurvey\n cycle: string\n nodeDefContext: ArenaNodeDef<any>\n options?: ArenaFlatDataExportOptions\n }) {\n this.survey = survey\n this.cycle = cycle\n this.nodeDefContext = nodeDefContext\n this.options = { ...FlatDataExportDefaultOptions, ...options }\n this.columns = []\n\n this.init()\n }\n\n init() {\n this._initColumns()\n }\n\n _initColumns() {\n const { addCycle } = this.options\n\n const ancestorsColumns = this.extractAncestorsColumns()\n\n const contextNodeDefsColumns = this.extractContextNodeDefsColumns()\n\n this.columns = [\n ...(addCycle ? [{ header: RECORD_CYCLE_HEADER }] : []),\n ...ancestorsColumns,\n ...contextNodeDefsColumns,\n ]\n }\n\n _createColumnsFromAttributeDefs(attributeDefs: ArenaNodeDef<any>[]) {\n const { survey, options } = this\n const result = []\n for (const nodeDef of attributeDefs) {\n const columnsGetter = columnsExtractorByNodeDefType[NodeDefs.getType(nodeDef)]\n\n const columnsPerAttribute = columnsGetter ? columnsGetter({ survey, nodeDef, options }) : []\n\n if (NodeDefs.isKey(nodeDef)) {\n for (const col of columnsPerAttribute) {\n col.key = true\n }\n }\n result.push(...columnsPerAttribute)\n }\n return result\n }\n\n protected extractAncestorsColumns(): Column[] {\n const { survey, cycle, nodeDefContext, options } = this\n const { includeAncestorAttributes } = options\n\n const ancestorsColumns: Column[] = []\n\n Surveys.visitAncestorsAndSelfNodeDef({\n survey,\n nodeDef: nodeDefContext,\n visitor: (nodeDefAncestor) => {\n const ancestorAttributeDefs = includeAncestorAttributes\n ? // include all ancestor attributes\n this.extractAncestorAttributeDefs(nodeDefAncestor)\n : // consider only ancestor key attributes\n Surveys.getNodeDefKeys({ survey, cycle, nodeDef: nodeDefAncestor })\n const ancestorColumns = this._createColumnsFromAttributeDefs(ancestorAttributeDefs)\n ancestorsColumns.unshift(...ancestorColumns)\n },\n includeSelf: false,\n })\n\n return ancestorsColumns\n }\n\n extractAncestorAttributeDefs(nodeDefContext: ArenaNodeDef<any>): ArenaNodeDef<any>[] {\n const { cycle, options, survey } = this\n const {\n includeAnalysis,\n includeFileAttributeDefs,\n includeFiles,\n includeMultipleAttributes,\n includeReadOnlyAttributes,\n } = options\n\n let result = NodeDefs.isEntity(nodeDefContext)\n ? Surveys.getDescendantsInSingleEntities({\n survey,\n cycle,\n nodeDef: nodeDefContext,\n predicate: includeMultipleAttributes ? NodeDefs.isAttribute : NodeDefs.isSingleAttribute,\n includeAnalysis,\n })\n : [nodeDefContext] // Multiple attribute\n\n result = result.filter(\n (nodeDef) =>\n (includeFileAttributeDefs || includeFiles || NodeDefs.getType(nodeDef) !== NodeDefType.file) &&\n (includeReadOnlyAttributes || !NodeDefs.isReadOnly(nodeDef) || NodeDefs.isKey(nodeDef))\n )\n return result\n }\n\n protected extractContextNodeDefsColumns(): Column[] {\n const descendantDefs = this.extractAncestorAttributeDefs(this.nodeDefContext)\n return this._createColumnsFromAttributeDefs(descendantDefs)\n }\n\n get headers() {\n return this.columns.map((column) => column.header)\n }\n\n getColumnByHeader(header: string): Column | undefined {\n return this.columns.find((column) => column.header === header)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlatDataExportOptions.js","sourceRoot":"","sources":["../../../src/dataExport/FlatDataExportOptions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAgBX;AAhBD,WAAY,oBAAoB;IAC9B,6CAAqB,CAAA;IACrB,2DAAmC,CAAA;IACnC,+EAAuD,CAAA;IACvD,iFAAyD,CAAA;IACzD,mEAA2C,CAAA;IAC3C,uGAA+E,CAAA;IAC/E,iEAAyC,CAAA;IACzC,6EAAqD,CAAA;IACrD,qDAA6B,CAAA;IAC7B,qEAA6C,CAAA;IAC7C,+EAAuD,CAAA;IACvD,+EAAuD,CAAA;IACvD,iFAAyD,CAAA;IACzD,mEAA2C,CAAA;IAC3C,qDAA6B,CAAA;AAC/B,CAAC,EAhBW,oBAAoB,KAApB,oBAAoB,QAgB/B;AAID,MAAM,CAAC,MAAM,4BAA4B,GAA0B;IACjE,mBAAmB,EAAE,KAAK;IAC1B,qCAAqC,EAAE,KAAK;IAC5C,eAAe,EAAE,IAAI;IACrB,yBAAyB,EAAE,KAAK;IAChC,0BAA0B,EAAE,IAAI;IAChC,YAAY,EAAE,IAAI;IAClB,yBAAyB,EAAE,KAAK;IAChC,yBAAyB,EAAE,IAAI;IAC/B,0BAA0B,EAAE,IAAI;CACjC,CAAA","sourcesContent":["export enum FlatDataExportOption {\n addCycle = 'addCycle',\n includeAnalysis = 'includeAnalysis',\n includeAncestorAttributes = 'includeAncestorAttributes',\n includeCategoryItemsLabels = 'includeCategoryItemsLabels',\n expandCategoryItems = 'expandCategoryItems',\n exportSingleEntitiesIntoSeparateFiles = 'exportSingleEntitiesIntoSeparateFiles',\n includeDateCreated = 'includeDateCreated',\n includeFileAttributeDefs = 'includeFileAttributeDefs',\n includeFiles = 'includeFiles',\n includeInternalUuids = 'includeInternalUuids',\n includeMultipleAttributes = 'includeMultipleAttributes',\n includeReadOnlyAttributes = 'includeReadOnlyAttributes',\n includeTaxonScientificName = 'includeTaxonScientificName',\n keepFileNamesUnique = 'keepFileNamesUnique',\n nullsToEmpty = 'nullsToEmpty',\n}\n\nexport type FlatDataExportOptions = Partial<Record<FlatDataExportOption, boolean>>\n\nexport const FlatDataExportDefaultOptions: FlatDataExportOptions = {\n expandCategoryItems: false,\n exportSingleEntitiesIntoSeparateFiles: false,\n includeAnalysis: true,\n includeAncestorAttributes: false,\n includeCategoryItemsLabels: true,\n includeFiles: true,\n includeMultipleAttributes: false,\n includeReadOnlyAttributes: true,\n includeTaxonScientificName: true,\n}\n"]}
1
+ {"version":3,"file":"FlatDataExportOptions.js","sourceRoot":"","sources":["../../../src/dataExport/FlatDataExportOptions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAgBX;AAhBD,WAAY,oBAAoB;IAC9B,6CAAqB,CAAA;IACrB,2DAAmC,CAAA;IACnC,+EAAuD,CAAA;IACvD,iFAAyD,CAAA;IACzD,mEAA2C,CAAA;IAC3C,uGAA+E,CAAA;IAC/E,iEAAyC,CAAA;IACzC,6EAAqD,CAAA;IACrD,qDAA6B,CAAA;IAC7B,qEAA6C,CAAA;IAC7C,+EAAuD,CAAA;IACvD,+EAAuD,CAAA;IACvD,iFAAyD,CAAA;IACzD,mEAA2C,CAAA;IAC3C,qDAA6B,CAAA;AAC/B,CAAC,EAhBW,oBAAoB,KAApB,oBAAoB,QAgB/B;AAID,MAAM,CAAC,MAAM,4BAA4B,GAA+B;IACtE,mBAAmB,EAAE,KAAK;IAC1B,qCAAqC,EAAE,KAAK;IAC5C,eAAe,EAAE,IAAI;IACrB,yBAAyB,EAAE,KAAK;IAChC,0BAA0B,EAAE,IAAI;IAChC,YAAY,EAAE,IAAI;IAClB,yBAAyB,EAAE,KAAK;IAChC,yBAAyB,EAAE,IAAI;IAC/B,0BAA0B,EAAE,IAAI;CACjC,CAAA","sourcesContent":["export enum FlatDataExportOption {\n addCycle = 'addCycle',\n includeAnalysis = 'includeAnalysis',\n includeAncestorAttributes = 'includeAncestorAttributes',\n includeCategoryItemsLabels = 'includeCategoryItemsLabels',\n expandCategoryItems = 'expandCategoryItems',\n exportSingleEntitiesIntoSeparateFiles = 'exportSingleEntitiesIntoSeparateFiles',\n includeDateCreated = 'includeDateCreated',\n includeFileAttributeDefs = 'includeFileAttributeDefs',\n includeFiles = 'includeFiles',\n includeInternalUuids = 'includeInternalUuids',\n includeMultipleAttributes = 'includeMultipleAttributes',\n includeReadOnlyAttributes = 'includeReadOnlyAttributes',\n includeTaxonScientificName = 'includeTaxonScientificName',\n keepFileNamesUnique = 'keepFileNamesUnique',\n nullsToEmpty = 'nullsToEmpty',\n}\n\nexport type ArenaFlatDataExportOptions = Partial<Record<FlatDataExportOption, boolean>>\n\nexport const FlatDataExportDefaultOptions: ArenaFlatDataExportOptions = {\n expandCategoryItems: false,\n exportSingleEntitiesIntoSeparateFiles: false,\n includeAnalysis: true,\n includeAncestorAttributes: false,\n includeCategoryItemsLabels: true,\n includeFiles: true,\n includeMultipleAttributes: false,\n includeReadOnlyAttributes: true,\n includeTaxonScientificName: true,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlatDataFiles.js","sourceRoot":"","sources":["../../../src/dataExport/FlatDataFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC,MAAM,0BAA0B,GAAG,OAAO,CAAA;AAE1C,MAAM,WAAW,GAAG,CAAC,EACnB,OAAO,EACP,KAAK,EACL,SAAS,GAAG,KAAK,GAKlB,EAAU,EAAE;IACX,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1D,OAAO,GAAG,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,CAAA;AAC9D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,0BAA0B;IAC1B,WAAW;CACZ,CAAA","sourcesContent":["import { NodeDef, NodeDefs } from '../nodeDef'\nimport { Strings } from '../utils'\n\nconst attachedFilesSubfolderName = 'files'\n\nconst getFileName = ({\n nodeDef,\n index,\n extension = 'csv',\n}: {\n nodeDef: NodeDef<any>\n index: number\n extension: string\n}): string => {\n const prefix = Strings.padStart(2, '0')(String(index + 1))\n return `${prefix}_${NodeDefs.getName(nodeDef)}.${extension}`\n}\n\nexport const FlatDataFiles = {\n attachedFilesSubfolderName,\n getFileName,\n}\n"]}
1
+ {"version":3,"file":"FlatDataFiles.js","sourceRoot":"","sources":["../../../src/dataExport/FlatDataFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC,MAAM,0BAA0B,GAAG,OAAO,CAAA;AAE1C,MAAM,WAAW,GAAG,CAAC,EACnB,OAAO,EACP,KAAK,EACL,SAAS,GAAG,KAAK,GAKlB,EAAU,EAAE;IACX,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1D,OAAO,GAAG,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,CAAA;AAC9D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,0BAA0B;IAC1B,WAAW;CACZ,CAAA","sourcesContent":["import { ArenaNodeDef, NodeDefs } from '../nodeDef'\nimport { Strings } from '../utils'\n\nconst attachedFilesSubfolderName = 'files'\n\nconst getFileName = ({\n nodeDef,\n index,\n extension = 'csv',\n}: {\n nodeDef: ArenaNodeDef<any>\n index: number\n extension: string\n}): string => {\n const prefix = Strings.padStart(2, '0')(String(index + 1))\n return `${prefix}_${NodeDefs.getName(nodeDef)}.${extension}`\n}\n\nexport const FlatDataFiles = {\n attachedFilesSubfolderName,\n getFileName,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UniqueFileNamesGenerator.js","sourceRoot":"","sources":["../../../src/dataExport/UniqueFileNamesGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,kBAAkB,GAAG,kBAAkB,CAAA,CAAC,mCAAmC;AAEjF,MAAM,OAAO,wBAAwB;IASnC;QACE,IAAI,CAAC,eAAe,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAA;QACpC,IAAI,CAAC,sCAAsC,GAAG,IAAI,GAAG,EAAE,CAAA;IACzD,CAAC;IAEO,cAAc,CAAC,QAAgB;QACrC,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IAC7D,CAAC;IAEO,cAAc,CAAC,QAAgB,EAAE,GAAW;QAClD,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAA;QACpC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAA;QACpC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;QACpD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,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AAG,CAAC,CAAA;YACnC,WAAW,GAAG,GAAG,gBAAgB,KAAK,SAAS,GAAG,CAAA;QACpD,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,GAAG,IAAI,MAAM,CAAA;QAC7B,CAAC;QACD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,CAAA;IAChE,CAAC;IAED,IAAI,cAAc;QAChB,yBAAY,IAAI,CAAC,eAAe,EAAE;IACpC,CAAC;IAED,IAAI,cAAc;QAChB,yBAAY,IAAI,CAAC,eAAe,EAAE;IACpC,CAAC;CACF","sourcesContent":["import { Dictionary } from '../common'\nimport { FileNames } from '../utils'\n\nconst nameWithIndexRegEx = /^(.*) \\((\\d+)\\)$/ // file name like \"example (1).txt\"\n\nexport class UniqueFileNamesGenerator {\n private _fileNamesByKey: Dictionary<string>\n private _keysByFileName: Dictionary<string>\n // file names are compared ignoring case: names differing only in case overwrite each other on Windows/macOS\n private readonly _fileNamesLowerCase: Set<string>\n // last file name generated starting from a given first candidate file name (e.g. \"image (1).jpg\" => \"image (25).jpg\"):\n // the names before it in the sequence are all used already, so the search can start from it\n private readonly _lastGeneratedFileNameByFirstCandidate: Map<string, string>\n\n constructor() {\n this._fileNamesByKey = {}\n this._keysByFileName = {}\n this._fileNamesLowerCase = new Set()\n this._lastGeneratedFileNameByFirstCandidate = new Map()\n }\n\n private isFileNameUsed(fileName: string): boolean {\n return this._fileNamesLowerCase.has(fileName.toLowerCase())\n }\n\n private assignFileName(fileName: string, key: string): string {\n this._keysByFileName[fileName] = key\n this._fileNamesByKey[key] = fileName\n this._fileNamesLowerCase.add(fileName.toLowerCase())\n return fileName\n }\n\n /**\n * Generates a unique file name for the given key.\n *\n * If the key has been used before, the previously generated file name\n * associated with that key is returned, regardless of the current\n * {@link inputFileName} value.\n *\n * If the key has not been used before, the method either:\n * - returns {@link inputFileName} if it has not been used for another key, or\n * - generates the next available non-conflicting name by appending or\n * incrementing a numeric index in parentheses.\n *\n * @param inputFileName The desired base file name, including extension.\n * @param key A logical identifier whose associated file name should remain stable across calls.\n * @returns The unique file name associated with the given key.\n */\n generateUniqueFileName(inputFileName: string, key: string): string {\n const existingFileName = this._fileNamesByKey[key]\n if (existingFileName) {\n return existingFileName\n }\n if (!this.isFileNameUsed(inputFileName)) {\n // file name not used yet\n return this.assignFileName(inputFileName, key)\n }\n const firstCandidate = this.generateNextFileName(inputFileName)\n let generatedFileName = this._lastGeneratedFileNameByFirstCandidate.get(firstCandidate) ?? firstCandidate\n while (this.isFileNameUsed(generatedFileName)) {\n // file name already exists, generate the next one\n generatedFileName = this.generateNextFileName(generatedFileName)\n }\n this._lastGeneratedFileNameByFirstCandidate.set(firstCandidate, generatedFileName)\n return this.assignFileName(generatedFileName, key)\n }\n\n /**\n * Generates a new file name by incrementing an existing numeric suffix\n * of the form \"name (n)\" or appending \" (1)\" if no such suffix exists.\n *\n * @param inputFileName The original file name, including its extension.\n * @returns The updated file name with an incremented or newly added numeric suffix.\n */\n protected generateNextFileName(inputFileName: string): string {\n const name = FileNames.getName(inputFileName)\n const extension = FileNames.getExtension(inputFileName)\n let nameUpdated\n const matchRes = nameWithIndexRegEx.exec(name)\n if (matchRes) {\n const [, nameWithoutIndex, index] = matchRes\n const nextIndex = Number(index) + 1\n nameUpdated = `${nameWithoutIndex} (${nextIndex})`\n } else {\n nameUpdated = `${name} (1)`\n }\n return extension ? `${nameUpdated}.${extension}` : nameUpdated\n }\n\n get fileNamesByKey(): Readonly<Dictionary<string>> {\n return { ...this._fileNamesByKey }\n }\n\n get keysByFileName(): Readonly<Dictionary<string>> {\n return { ...this._keysByFileName }\n }\n}\n"]}
1
+ {"version":3,"file":"UniqueFileNamesGenerator.js","sourceRoot":"","sources":["../../../src/dataExport/UniqueFileNamesGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,kBAAkB,GAAG,kBAAkB,C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iBAAiB,CAAC,EAAE,CAAC;YAC9C,kDAAkD;YAClD,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;QAClE,CAAC;QACD,IAAI,CAAC,sCAAsC,CAAC,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;QAClF,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAA;IACpD,CAAC;IAED;;;;;;OAMG;IACO,oBAAoB,CAAC,aAAqB;QAClD,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAC7C,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;QACvD,IAAI,WAAW,CAAA;QACf,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAA;YAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACnC,WAAW,GAAG,GAAG,gBAAgB,KAAK,SAAS,GAAG,CAAA;QACpD,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,GAAG,IAAI,MAAM,CAAA;QAC7B,CAAC;QACD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,CAAA;IAChE,CAAC;IAED,IAAI,cAAc;QAChB,yBAAY,IAAI,CAAC,eAAe,EAAE;IACpC,CAAC;IAED,IAAI,cAAc;QAChB,yBAAY,IAAI,CAAC,eAAe,EAAE;IACpC,CAAC;CACF","sourcesContent":["import { ArenaDictionary } from '../common'\nimport { FileNames } from '../utils'\n\nconst nameWithIndexRegEx = /^(.*) \\((\\d+)\\)$/ // file name like \"example (1).txt\"\n\nexport class UniqueFileNamesGenerator {\n private _fileNamesByKey: ArenaDictionary<string>\n private _keysByFileName: ArenaDictionary<string>\n // file names are compared ignoring case: names differing only in case overwrite each other on Windows/macOS\n private readonly _fileNamesLowerCase: Set<string>\n // last file name generated starting from a given first candidate file name (e.g. \"image (1).jpg\" => \"image (25).jpg\"):\n // the names before it in the sequence are all used already, so the search can start from it\n private readonly _lastGeneratedFileNameByFirstCandidate: Map<string, string>\n\n constructor() {\n this._fileNamesByKey = {}\n this._keysByFileName = {}\n this._fileNamesLowerCase = new Set()\n this._lastGeneratedFileNameByFirstCandidate = new Map()\n }\n\n private isFileNameUsed(fileName: string): boolean {\n return this._fileNamesLowerCase.has(fileName.toLowerCase())\n }\n\n private assignFileName(fileName: string, key: string): string {\n this._keysByFileName[fileName] = key\n this._fileNamesByKey[key] = fileName\n this._fileNamesLowerCase.add(fileName.toLowerCase())\n return fileName\n }\n\n /**\n * Generates a unique file name for the given key.\n *\n * If the key has been used before, the previously generated file name\n * associated with that key is returned, regardless of the current\n * {@link inputFileName} value.\n *\n * If the key has not been used before, the method either:\n * - returns {@link inputFileName} if it has not been used for another key, or\n * - generates the next available non-conflicting name by appending or\n * incrementing a numeric index in parentheses.\n *\n * @param inputFileName The desired base file name, including extension.\n * @param key A logical identifier whose associated file name should remain stable across calls.\n * @returns The unique file name associated with the given key.\n */\n generateUniqueFileName(inputFileName: string, key: string): string {\n const existingFileName = this._fileNamesByKey[key]\n if (existingFileName) {\n return existingFileName\n }\n if (!this.isFileNameUsed(inputFileName)) {\n // file name not used yet\n return this.assignFileName(inputFileName, key)\n }\n const firstCandidate = this.generateNextFileName(inputFileName)\n let generatedFileName = this._lastGeneratedFileNameByFirstCandidate.get(firstCandidate) ?? firstCandidate\n while (this.isFileNameUsed(generatedFileName)) {\n // file name already exists, generate the next one\n generatedFileName = this.generateNextFileName(generatedFileName)\n }\n this._lastGeneratedFileNameByFirstCandidate.set(firstCandidate, generatedFileName)\n return this.assignFileName(generatedFileName, key)\n }\n\n /**\n * Generates a new file name by incrementing an existing numeric suffix\n * of the form \"name (n)\" or appending \" (1)\" if no such suffix exists.\n *\n * @param inputFileName The original file name, including its extension.\n * @returns The updated file name with an incremented or newly added numeric suffix.\n */\n protected generateNextFileName(inputFileName: string): string {\n const name = FileNames.getName(inputFileName)\n const extension = FileNames.getExtension(inputFileName)\n let nameUpdated\n const matchRes = nameWithIndexRegEx.exec(name)\n if (matchRes) {\n const [, nameWithoutIndex, index] = matchRes\n const nextIndex = Number(index) + 1\n nameUpdated = `${nameWithoutIndex} (${nextIndex})`\n } else {\n nameUpdated = `${name} (1)`\n }\n return extension ? `${nameUpdated}.${extension}` : nameUpdated\n }\n\n get fileNamesByKey(): Readonly<ArenaDictionary<string>> {\n return { ...this._fileNamesByKey }\n }\n\n get keysByFileName(): Readonly<ArenaDictionary<string>> {\n return { ...this._keysByFileName }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dataExport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["export type { FlatDataExportOptions } from './FlatDataExportOptions'\nexport { FlatDataExportOption, FlatDataExportDefaultOptions } from './FlatDataExportOptions'\nexport { FlatDataFiles } from './FlatDataFiles'\nexport { FlatDataExportModel } from './FlatDataExportModel'\nexport { FlatDataExportColumnDataType } from './FlatDataExportModel'\nexport type { ArenaExportInfo } from './ArenaExportInfo'\nexport { ArenaExportType } from './ArenaExportInfo'\nexport { ArenaExportInfoFactory } from './ArenaExportInfoFactory'\nexport type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory'\nexport { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator'\nexport { ArenaExportFile } from './ArenaExportFile'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dataExport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["export type { ArenaFlatDataExportOptions } from './FlatDataExportOptions'\nexport { FlatDataExportOption, FlatDataExportDefaultOptions } from './FlatDataExportOptions'\nexport { FlatDataFiles } from './FlatDataFiles'\nexport { FlatDataExportModel } from './FlatDataExportModel'\nexport { FlatDataExportColumnDataType } from './FlatDataExportModel'\nexport type { ArenaExportInfo } from './ArenaExportInfo'\nexport { ArenaExportType } from './ArenaExportInfo'\nexport { ArenaExportInfoFactory } from './ArenaExportInfoFactory'\nexport type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory'\nexport { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator'\nexport { ArenaExportFile } from './ArenaExportFile'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dataQuery.js","sourceRoot":"","sources":["../../../src/dataQuery/dataQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,wCAAuB,CAAA;AACzB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB","sourcesContent":["import { Labels } from '../language'\n\nexport enum DataQueryMode {\n raw = 'raw',\n aggregate = 'aggregate',\n}\n\nexport interface DataQuery {\n mode: DataQueryMode\n filter?: string\n sort?: string\n entityDefUuid?: string\n attributeDefUuids?: string[]\n dimensions?: string[]\n measures?: string[]\n filterRecordUuids?: string[]\n}\n\nexport interface DataQuerySummaryProps {\n name?: string\n labels?: Labels\n descriptions?: Labels\n}\n\nexport interface DataQuerySummary {\n content?: DataQuery\n dateCreated?: string\n dateModified?: string\n id?: number\n props?: DataQuerySummaryProps\n uuid?: string\n}\n"]}
1
+ {"version":3,"file":"dataQuery.js","sourceRoot":"","sources":["../../../src/dataQuery/dataQuery.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,wCAAuB,CAAA;AACzB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB","sourcesContent":["import { ArenaLabels } from '../language'\n\nexport enum DataQueryMode {\n raw = 'raw',\n aggregate = 'aggregate',\n}\n\nexport interface ArenaDataQuery {\n mode: DataQueryMode\n filter?: string\n sort?: string\n entityDefUuid?: string\n attributeDefUuids?: string[]\n dimensions?: string[]\n measures?: string[]\n filterRecordUuids?: string[]\n}\n\nexport interface ArenaDataQuerySummaryProps {\n name?: string\n labels?: ArenaLabels\n descriptions?: ArenaLabels\n}\n\nexport interface ArenaDataQuerySummary {\n content?: ArenaDataQuery\n dateCreated?: string\n dateModified?: string\n id?: number\n props?: ArenaDataQuerySummaryProps\n uuid?: string\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dataQuerySummaries.js","sourceRoot":"","sources":["../../../src/dataQuery/dataQuerySummaries.ts"],"names":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,kBAAkB,GAAG;IAChC,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,SAAS;IACT,QAAQ;IACR,eAAe;IACf,cAAc;IACd,SAAS;IACT,SAAS;IACT,WAAW;IACX,iBAAiB;IACjB,YAAY;CACb,CAAA","sourcesContent":["import { Labels, LanguageCode } from '../language'\nimport { getLabelOrDefault } from '../language/labels'\nimport { Objects, UUIDs } from '../utils'\nimport { DataQuery, DataQuerySummary, DataQuerySummaryProps } from './dataQuery'\n\nconst PropKeys = {\n name: 'name',\n labels: 'labels',\n descriptions: 'descriptions',\n}\n\nconst Keys = {\n content: 'content',\n}\n\nconst create = (params: { props?: DataQuerySummaryProps; content?: DataQuery }): DataQuerySummary => {\n const { props, content } = params ?? {}\n return { uuid: UUIDs.v4(), content, props }\n}\n\nconst getUuid = (querySummary: DataQuerySummary): string => querySummary?.uuid ?? ''\n\nconst getName = (querySummary: DataQuerySummary): string => querySummary?.props?.name ?? ''\n\nconst getContent = (querySummary: DataQuerySummary): DataQuery | undefined => querySummary?.content\n\nconst getLabels = (querySummary: DataQuerySummary): Labels => querySummary?.props?.labels ?? {}\n\nconst getLabel =\n (lang: LanguageCode) =>\n (querySummary: DataQuerySummary): string =>\n getLabelOrDefault(getLabels(querySummary), lang)\n\nconst getDescriptions = (querySummary: DataQuerySummary): Labels => querySummary?.props?.descriptions ?? {}\n\nconst getDescription =\n (lang: LanguageCode) =>\n (querySummary: DataQuerySummary): string =>\n getLabelOrDefault(getDescriptions(querySummary), lang)\n\nconst assocProp =\n (prop: string, value: any) =>\n (obj: any): any =>\n Objects.assocPath({ obj, path: ['props', prop], value })\n\nconst assocName =\n (value: string) =>\n (querySummary: DataQuerySummary): DataQuerySummary =>\n assocProp(PropKeys.name, value)(querySummary)\n\nconst assocLabels =\n (value: Labels) =>\n (querySummary: DataQuerySummary): DataQuerySummary =>\n assocProp(PropKeys.labels, value)(querySummary)\n\nconst assocDescriptions =\n (value: Labels) =>\n (querySummary: DataQuerySummary): DataQuerySummary =>\n assocProp(PropKeys.descriptions, value)(querySummary)\n\nconst assocContent =\n (content: DataQuery) =>\n (querySummary: DataQuerySummary): DataQuerySummary =>\n Objects.assoc({ obj: querySummary, prop: Keys.content, value: content })\n\nexport const DataQuerySummaries = {\n // create\n create,\n // read\n getUuid,\n getName,\n getContent,\n getLabels,\n getLabel,\n getDescriptions,\n getDescription,\n // update\n assocName,\n assocLabels,\n assocDescriptions,\n assocContent,\n}\n"]}
1
+ {"version":3,"file":"dataQuerySummaries.js","sourceRoot":"","sources":["../../../src/dataQuery/dataQuerySummaries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGzC,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;CAC7B,CAAA;AAED,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,MAAwE,EAAyB,EAAE;IACjH,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;IACvC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AAC7C,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,CAAC,YAAmC,EAAU,EAAE,wBAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,mCAAI,EAAE,GAAA,CAAA;AAEzF,MAAM,OAAO,GAAG,CAAC,YAAmC,EAAU,EAAE,gCAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,0CAAE,IAAI,mCAAI,EAAE,GAAA,CAAA;AAEhG,MAAM,UAAU,G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MAAM,iBAAiB,GACrB,CAAC,KAAkB,EAAE,EAAE,CACvB,CAAC,YAAmC,EAAyB,EAAE,CAC7D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC,CAAA;AAEzD,MAAM,YAAY,GAChB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CAAC,YAAmC,EAAyB,EAAE,CAC7D,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;AAE5E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,SAAS;IACT,QAAQ;IACR,eAAe;IACf,cAAc;IACd,SAAS;IACT,SAAS;IACT,WAAW;IACX,iBAAiB;IACjB,YAAY;CACb,CAAA","sourcesContent":["import { ArenaLabels, LanguageCode } from '../language'\nimport { getLabelOrDefault } from '../language/labels'\nimport { Objects, UUIDs } from '../utils'\nimport { ArenaDataQuery, ArenaDataQuerySummary, ArenaDataQuerySummaryProps } from './dataQuery'\n\nconst PropKeys = {\n name: 'name',\n labels: 'labels',\n descriptions: 'descriptions',\n}\n\nconst Keys = {\n content: 'content',\n}\n\nconst create = (params: { props?: ArenaDataQuerySummaryProps; content?: ArenaDataQuery }): ArenaDataQuerySummary => {\n const { props, content } = params ?? {}\n return { uuid: UUIDs.v4(), content, props }\n}\n\nconst getUuid = (querySummary: ArenaDataQuerySummary): string => querySummary?.uuid ?? ''\n\nconst getName = (querySummary: ArenaDataQuerySummary): string => querySummary?.props?.name ?? ''\n\nconst getContent = (querySummary: ArenaDataQuerySummary): ArenaDataQuery | undefined => querySummary?.content\n\nconst getLabels = (querySummary: ArenaDataQuerySummary): ArenaLabels => querySummary?.props?.labels ?? {}\n\nconst getLabel =\n (lang: LanguageCode) =>\n (querySummary: ArenaDataQuerySummary): string =>\n getLabelOrDefault(getLabels(querySummary), lang)\n\nconst getDescriptions = (querySummary: ArenaDataQuerySummary): ArenaLabels => querySummary?.props?.descriptions ?? {}\n\nconst getDescription =\n (lang: LanguageCode) =>\n (querySummary: ArenaDataQuerySummary): string =>\n getLabelOrDefault(getDescriptions(querySummary), lang)\n\nconst assocProp =\n (prop: string, value: any) =>\n (obj: any): any =>\n Objects.assocPath({ obj, path: ['props', prop], value })\n\nconst assocName =\n (value: string) =>\n (querySummary: ArenaDataQuerySummary): ArenaDataQuerySummary =>\n assocProp(PropKeys.name, value)(querySummary)\n\nconst assocLabels =\n (value: ArenaLabels) =>\n (querySummary: ArenaDataQuerySummary): ArenaDataQuerySummary =>\n assocProp(PropKeys.labels, value)(querySummary)\n\nconst assocDescriptions =\n (value: ArenaLabels) =>\n (querySummary: ArenaDataQuerySummary): ArenaDataQuerySummary =>\n assocProp(PropKeys.descriptions, value)(querySummary)\n\nconst assocContent =\n (content: ArenaDataQuery) =>\n (querySummary: ArenaDataQuerySummary): ArenaDataQuerySummary =>\n Objects.assoc({ obj: querySummary, prop: Keys.content, value: content })\n\nexport const DataQuerySummaries = {\n // create\n create,\n // read\n getUuid,\n getName,\n getContent,\n getLabels,\n getLabel,\n getDescriptions,\n getDescription,\n // update\n assocName,\n assocLabels,\n assocDescriptions,\n assocContent,\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dataQuery/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA","sourcesContent":["export type { DataQuery, DataQuerySummary, DataQuerySummaryProps } from './dataQuery'\nexport { DataQueryMode } from './dataQuery'\nexport { DataQuerySummaries } from './dataQuerySummaries'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dataQuery/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA","sourcesContent":["export type { ArenaDataQuery, ArenaDataQuerySummary, ArenaDataQuerySummaryProps } from './dataQuery'\nexport { DataQueryMode } from './dataQuery'\nexport { DataQuerySummaries } from './dataQuerySummaries'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SystemError.js","sourceRoot":"","sources":["../../../src/error/SystemError.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,WAAY,SAAQ,KAAK;IAIpC;;;;OAIG;IACH,YAAY,GAAW,EAAE,MAAwB,EAAE,OAA6B;QAC9E,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAEnB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;QAEzB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,OAAO,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;QAE3B,sDAAsD;QACtD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAC5B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;QAC3C,MAAM,cAAc,GAClB,WAAW,IAAI,WAAW,YAAY,WAAW,CAAC,CAAC,iCAAM,MAAM,KAAE,KAAK,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,EAAE,IAAG,CAAC,CAAC,MAAM,CAAA;QAC1G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;IACxC,CAAC;CACF","sourcesContent":["import { Dictionary } from '../common'\n\nexport class SystemError extends Error {\n private readonly _key: string\n private readonly _params: Dictionary<any>\n\n /**\n * @param key - Error key (translatable).\n * @param params - Parameters of the error message.\n * @param options - Error options: `cause` is the original error (kept with its stack trace).\n */\n constructor(key: string, params?: Dictionary<any>, options?: { cause?: unknown }) {\n super(key, options)\n\n this.name = 'SystemError'\n\n this._key = key\n this._params = params ?? {}\n\n // Maintains proper stack trace (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, SystemError)\n }\n }\n\n get key(): string {\n return this._key\n }\n\n get params(): Dictionary<any> {\n return this._params\n }\n\n toJSON() {\n const { key, params } = this\n const { error: nestedError } = params ?? {}\n const paramsAdjusted: Dictionary<any> =\n nestedError && nestedError instanceof SystemError ? { ...params, error: nestedError?.toJSON() } : params\n return { key, params: paramsAdjusted }\n }\n}\n"]}
1
+ {"version":3,"file":"SystemError.js","sourceRoot":"","sources":["../../../src/error/SystemError.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,WAAY,SAAQ,KAAK;IAIpC;;;;OAIG;IACH,YAAY,GAAW,EAAE,MAA6B,EAAE,OAA6B;QACnF,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAEnB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;QAEzB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,OAAO,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;QAE3B,sDAAsD;QACtD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QAC5B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;QAC3C,MAAM,cAAc,GAClB,WAAW,IAAI,WAAW,YAAY,WAAW,CAAC,CAAC,iCAAM,MAAM,KAAE,KAAK,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,EAAE,IAAG,CAAC,CAAC,MAAM,CAAA;QAC1G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;IACxC,CAAC;CACF","sourcesContent":["import { ArenaDictionary } from '../common'\n\nexport class SystemError extends Error {\n private readonly _key: string\n private readonly _params: ArenaDictionary<any>\n\n /**\n * @param key - Error key (translatable).\n * @param params - Parameters of the error message.\n * @param options - Error options: `cause` is the original error (kept with its stack trace).\n */\n constructor(key: string, params?: ArenaDictionary<any>, options?: { cause?: unknown }) {\n super(key, options)\n\n this.name = 'SystemError'\n\n this._key = key\n this._params = params ?? {}\n\n // Maintains proper stack trace (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, SystemError)\n }\n }\n\n get key(): string {\n return this._key\n }\n\n get params(): ArenaDictionary<any> {\n return this._params\n }\n\n toJSON() {\n const { key, params } = this\n const { error: nestedError } = params ?? {}\n const paramsAdjusted: ArenaDictionary<any> =\n nestedError && nestedError instanceof SystemError ? { ...params, error: nestedError?.toJSON() } : params\n return { key, params: paramsAdjusted }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/expression/context.ts"],"names":[],"mappings":"","sourcesContent":["import { LanguageCode } from '../language'\n\nexport interface ExpressionContext {\n object?: any\n evaluateToNode?: boolean\n includeAnalysis?: boolean\n /**\n * client timezone offset in minutes as returned by the Date.getTimezoneOffset function\n */\n timezoneOffset?: number\n /**\n * language selected in the client app, used by language-aware expression functions (e.g. numberToWords)\n */\n lang?: LanguageCode\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/expression/context.ts"],"names":[],"mappings":"","sourcesContent":["import { LanguageCode } from '../language'\n\nexport interface ArenaExpressionContext {\n object?: any\n evaluateToNode?: boolean\n includeAnalysis?: boolean\n /**\n * client timezone offset in minutes as returned by the Date.getTimezoneOffset function\n */\n timezoneOffset?: number\n /**\n * language selected in the client app, used by language-aware expression functions (e.g. numberToWords)\n */\n lang?: LanguageCode\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../src/expression/evaluator.ts"],"names":[],"mappings":"","sourcesContent":["import { ExpressionContext } from './context'\nimport { ExpressionFunction } from './function'\nimport { ExpressionNode, ExpressionNodeType } from './node'\n\nexport interface ExpressionEvaluator<C extends ExpressionContext> {\n functions: { [functionName: string]: ExpressionFunction<C> }\n evaluate(expression: string, context?: C): Promise<any>\n evaluateNode(expression: ExpressionNode<ExpressionNodeType>, context: C): Promise<any>\n}\n"]}
1
+ {"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../src/expression/evaluator.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaExpressionContext } from './context'\nimport { ArenaExpressionFunction } from './function'\nimport { ArenaExpressionNode, ExpressionNodeType } from './node'\n\nexport interface ArenaExpressionEvaluator<C extends ArenaExpressionContext> {\n functions: { [functionName: string]: ArenaExpressionFunction<C> }\n evaluate(expression: string, context?: C): Promise<any>\n evaluateNode(expression: ArenaExpressionNode<ExpressionNodeType>, context: C): Promise<any>\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/expression/function.ts"],"names":[],"mappings":"","sourcesContent":["import { ExpressionContext } from './context'\n\nexport interface ExpressionFunction<C extends ExpressionContext> {\n minArity: number\n maxArity?: number\n /**\n * Returns the function implementation, bound to the specified context.\n * The implementation can return either the result value or a Promise resolving to it.\n */\n executor: (context: C) => (...args: any[]) => any\n /**\n * True if the arguments of the function must be evaluated as nodes.\n * @default false\n */\n evaluateArgsToNodes?: boolean\n /**\n * True if the result of the evaluation of the function must be a node,\n * otherwise it will be the node value.\n * @default false\n */\n evaluateToNode?: boolean\n}\n\nexport interface ExpressionFunctions<C extends ExpressionContext> {\n [name: string]: ExpressionFunction<C>\n}\n"]}
1
+ {"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/expression/function.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaExpressionContext } from './context'\n\nexport interface ArenaExpressionFunction<C extends ArenaExpressionContext> {\n minArity: number\n maxArity?: number\n /**\n * Returns the function implementation, bound to the specified context.\n * The implementation can return either the result value or a Promise resolving to it.\n */\n executor: (context: C) => (...args: any[]) => any\n /**\n * True if the arguments of the function must be evaluated as nodes.\n * @default false\n */\n evaluateArgsToNodes?: boolean\n /**\n * True if the result of the evaluation of the function must be a node,\n * otherwise it will be the node value.\n * @default false\n */\n evaluateToNode?: boolean\n}\n\nexport interface ArenaExpressionFunctions<C extends ArenaExpressionContext> {\n [name: string]: ArenaExpressionFunction<C>\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/expression/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA","sourcesContent":["export type { ExpressionContext } from './context'\n\nexport type { ExpressionEvaluator } from './evaluator'\n\nexport type { ExpressionFunction, ExpressionFunctions } from './function'\n\nexport type {\n AnyExpressionNode,\n ExpressionNode,\n ExpressionNodeEvaluatorConstructor,\n ArrayExpression,\n BinaryExpression,\n CallExpression,\n CompoundExpression,\n ConditionalExpression,\n IdentifierExpression,\n LiteralExpression,\n MemberExpression,\n SequenceExpression,\n ThisExpression,\n UnaryExpression,\n} from './node'\nexport { ExpressionNodeType, ExpressionNodeEvaluator } from './node'\n\nexport { ExpressionVariable } from './variable'\n\nexport { JavascriptExpressionEvaluator } from './javascript/evaluator'\nexport { JavascriptExpressionParser } from './javascript/parser/parser'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/expression/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA","sourcesContent":["export type { ArenaExpressionContext } from './context'\n\nexport type { ArenaExpressionEvaluator } from './evaluator'\n\nexport type { ArenaExpressionFunction, ArenaExpressionFunctions } from './function'\n\nexport type {\n ArenaAnyExpressionNode,\n ArenaExpressionNode,\n ArenaExpressionNodeEvaluatorConstructor,\n ArenaArrayExpression,\n ArenaBinaryExpression,\n ArenaCallExpression,\n ArenaCompoundExpression,\n ArenaConditionalExpression,\n ArenaIdentifierExpression,\n ArenaLiteralExpression,\n ArenaMemberExpression,\n ArenaSequenceExpression,\n ArenaThisExpression,\n ArenaUnaryExpression,\n} from './node'\nexport { ExpressionNodeType, ExpressionNodeEvaluator } from './node'\n\nexport { ExpressionVariable } from './variable'\n\nexport { JavascriptExpressionEvaluator } from './javascript/evaluator'\nexport { JavascriptExpressionParser } from './javascript/parser/parser'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../../src/expression/javascript/evaluator.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAsD,kBAAkB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AAU,CAAC,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAK,EAAQ,CAAC,CAAA;QAC7E,CAAC;KAAA;IAEK,YAAY,CAAC,cAAkD,EAAE,OAAU;;YAC/E,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAA;YAE/B,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAM,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;YACrF,CAAC;YACD,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAA;QAClE,CAAC;KAAA;CACF","sourcesContent":["import { ExpressionContext } from '../context'\nimport { ExpressionEvaluator } from '../evaluator'\nimport { ExpressionFunctions } from '../function'\nimport { ExpressionNode, ExpressionNodeEvaluatorConstructor, ExpressionNodeType } from '../node'\nimport { SystemError, SystemErrorKeys } from '../../error'\n\nimport { functionsDefault } from './functionsDefault'\nimport { ArrayEvaluator } from './node/array'\nimport { BinaryEvaluator } from './node/binary'\nimport { CallEvaluator } from './node/call'\nimport { CompoundEvaluator } from './node/compound'\nimport { ConditionalEvaluator } from './node/conditional'\nimport { IdentifierEvaluator } from './node/identifier'\nimport { LiteralEvaluator } from './node/literal'\nimport { MemberEvaluator } from './node/member'\nimport { SequenceEvaluator } from './node/sequence'\nimport { ThisEvaluator } from './node/this'\nimport { UnaryEvaluator } from './node/unary'\nimport { JavascriptExpressionParser } from './parser/parser'\n\ntype Evaluators<C extends ExpressionContext> = {\n [nodeType in ExpressionNodeType]?: ExpressionNodeEvaluatorConstructor<C, ExpressionNode<ExpressionNodeType>>\n}\n\nconst defaultEvaluators = {\n [ExpressionNodeType.Array]: ArrayEvaluator,\n [ExpressionNodeType.Binary]: BinaryEvaluator,\n [ExpressionNodeType.Call]: CallEvaluator,\n [ExpressionNodeType.Compound]: CompoundEvaluator,\n [ExpressionNodeType.Conditional]: ConditionalEvaluator,\n [ExpressionNodeType.Identifier]: IdentifierEvaluator,\n [ExpressionNodeType.Literal]: LiteralEvaluator,\n [ExpressionNodeType.Member]: MemberEvaluator,\n [ExpressionNodeType.Sequence]: SequenceEvaluator,\n [ExpressionNodeType.This]: ThisEvaluator,\n [ExpressionNodeType.Unary]: UnaryEvaluator,\n}\n\n// Parsed expressions cache: the same expressions are evaluated many times (e.g. for every node during a record update).\n// The cached expression nodes are shared, so evaluators must never modify them.\nconst PARSED_EXPRESSIONS_CACHE_MAX_SIZE = 1000\nconst parsedExpressionsCache = new Map<string, ExpressionNode<ExpressionNodeType>>()\nconst expressionParser = new JavascriptExpressionParser()\n\nexport const parseExpression = (expression: string): ExpressionNode<ExpressionNodeType> => {\n let expressionNode = parsedExpressionsCache.get(expression)\n if (!expressionNode) {\n expressionNode = expressionParser.parse(expression)\n if (parsedExpressionsCache.size >= PARSED_EXPRESSIONS_CACHE_MAX_SIZE) {\n // evict the oldest entry (Map keeps insertion order)\n const oldestExpression = parsedExpressionsCache.keys().next().value\n if (oldestExpression !== undefined) parsedExpressionsCache.delete(oldestExpression)\n }\n parsedExpressionsCache.set(expression, expressionNode)\n }\n return expressionNode\n}\n\nexport class JavascriptExpressionEvaluator<C extends ExpressionContext> implements ExpressionEvaluator<C> {\n functions: ExpressionFunctions<C>\n evaluators: Evaluators<C>\n\n constructor(functions: ExpressionFunctions<C> = {}, evaluators: Evaluators<C> = {}) {\n this.evaluators = { ...defaultEvaluators, ...evaluators }\n this.functions = { ...functionsDefault, ...functions }\n }\n\n async evaluate(expression: string, context?: C): Promise<any> {\n return this.evaluateNode(parseExpression(expression), context ?? ({} as C))\n }\n\n async evaluateNode(expressionNode: ExpressionNode<ExpressionNodeType>, context: C): Promise<any> {\n const { type } = expressionNode\n\n const NodeEvaluator = this.evaluators[type]\n if (!NodeEvaluator) {\n throw new SystemError(SystemErrorKeys.expression.unsupportedFunctionType, { type })\n }\n return new NodeEvaluator(this, context).evaluate(expressionNode)\n }\n}\n"]}
1
+ {"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../../src/expression/javascript/evaluator.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAgE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC1G,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAM5D,MAAM,iBAAiB,GAAG;IACxB,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,cAAc;IAC1C,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,eAAe;IAC5C,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,aAAa;IACxC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,iBAAiB;IAChD,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE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,iBAAiB,GAAK,UAAU,CAAE,CAAA;QACzD,IAAI,CAAC,SAAS,mCAAQ,gBAAgB,GAAK,SAAS,CAAE,CAAA;IACxD,CAAC;IAEK,QAAQ,CAAC,UAAkB,EAAE,OAAW;;YAC5C,OAAO,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAK,EAAQ,CAAC,CAAA;QAC7E,CAAC;KAAA;IAEK,YAAY,CAAC,cAAuD,EAAE,OAAU;;YACpF,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAA;YAE/B,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAM,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;YACrF,CAAC;YACD,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAA;QAClE,CAAC;KAAA;CACF","sourcesContent":["import { ArenaExpressionContext } from '../context'\nimport { ArenaExpressionEvaluator } from '../evaluator'\nimport { ArenaExpressionFunctions } from '../function'\nimport { ArenaExpressionNode, ArenaExpressionNodeEvaluatorConstructor, ExpressionNodeType } from '../node'\nimport { SystemError, SystemErrorKeys } from '../../error'\n\nimport { functionsDefault } from './functionsDefault'\nimport { ArrayEvaluator } from './node/array'\nimport { BinaryEvaluator } from './node/binary'\nimport { CallEvaluator } from './node/call'\nimport { CompoundEvaluator } from './node/compound'\nimport { ConditionalEvaluator } from './node/conditional'\nimport { IdentifierEvaluator } from './node/identifier'\nimport { LiteralEvaluator } from './node/literal'\nimport { MemberEvaluator } from './node/member'\nimport { SequenceEvaluator } from './node/sequence'\nimport { ThisEvaluator } from './node/this'\nimport { UnaryEvaluator } from './node/unary'\nimport { JavascriptExpressionParser } from './parser/parser'\n\ntype Evaluators<C extends ArenaExpressionContext> = {\n [nodeType in ExpressionNodeType]?: ArenaExpressionNodeEvaluatorConstructor<C, ArenaExpressionNode<ExpressionNodeType>>\n}\n\nconst defaultEvaluators = {\n [ExpressionNodeType.Array]: ArrayEvaluator,\n [ExpressionNodeType.Binary]: BinaryEvaluator,\n [ExpressionNodeType.Call]: CallEvaluator,\n [ExpressionNodeType.Compound]: CompoundEvaluator,\n [ExpressionNodeType.Conditional]: ConditionalEvaluator,\n [ExpressionNodeType.Identifier]: IdentifierEvaluator,\n [ExpressionNodeType.Literal]: LiteralEvaluator,\n [ExpressionNodeType.Member]: MemberEvaluator,\n [ExpressionNodeType.Sequence]: SequenceEvaluator,\n [ExpressionNodeType.This]: ThisEvaluator,\n [ExpressionNodeType.Unary]: UnaryEvaluator,\n}\n\n// Parsed expressions cache: the same expressions are evaluated many times (e.g. for every node during a record update).\n// The cached expression nodes are shared, so evaluators must never modify them.\nconst PARSED_EXPRESSIONS_CACHE_MAX_SIZE = 1000\nconst parsedExpressionsCache = new Map<string, ArenaExpressionNode<ExpressionNodeType>>()\nconst expressionParser = new JavascriptExpressionParser()\n\nexport const parseExpression = (expression: string): ArenaExpressionNode<ExpressionNodeType> => {\n let expressionNode = parsedExpressionsCache.get(expression)\n if (!expressionNode) {\n expressionNode = expressionParser.parse(expression)\n if (parsedExpressionsCache.size >= PARSED_EXPRESSIONS_CACHE_MAX_SIZE) {\n // evict the oldest entry (Map keeps insertion order)\n const oldestExpression = parsedExpressionsCache.keys().next().value\n if (oldestExpression !== undefined) parsedExpressionsCache.delete(oldestExpression)\n }\n parsedExpressionsCache.set(expression, expressionNode)\n }\n return expressionNode\n}\n\nexport class JavascriptExpressionEvaluator<C extends ArenaExpressionContext> implements ArenaExpressionEvaluator<C> {\n functions: ArenaExpressionFunctions<C>\n evaluators: Evaluators<C>\n\n constructor(functions: ArenaExpressionFunctions<C> = {}, evaluators: Evaluators<C> = {}) {\n this.evaluators = { ...defaultEvaluators, ...evaluators }\n this.functions = { ...functionsDefault, ...functions }\n }\n\n async evaluate(expression: string, context?: C): Promise<any> {\n return this.evaluateNode(parseExpression(expression), context ?? ({} as C))\n }\n\n async evaluateNode(expressionNode: ArenaExpressionNode<ExpressionNodeType>, context: C): Promise<any> {\n const { type } = expressionNode\n\n const NodeEvaluator = this.evaluators[type]\n if (!NodeEvaluator) {\n throw new SystemError(SystemErrorKeys.expression.unsupportedFunctionType, { type })\n }\n return new NodeEvaluator(this, context).evaluate(expressionNode)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"functionsDefault.js","sourceRoot":"","sources":["../../../../src/expression/javascript/functionsDefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAK5C,MAAM,CAAC,MAAM,gBAAgB,GAA6D;IACxF,OAAO,EAAE;QACP,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;KACvD;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;KAC1D;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;KACjC;CACF,CAAA","sourcesContent":["import { Objects, UUIDs } from '../../utils'\nimport { ExpressionContext } from '../context'\n\nimport { ExpressionFunction } from '../function'\n\nexport const functionsDefault: { [key: string]: ExpressionFunction<ExpressionContext> } = {\n isEmpty: {\n minArity: 1,\n maxArity: 1,\n executor: () => (value: any) => Objects.isEmpty(value),\n },\n isNotEmpty: {\n minArity: 1,\n maxArity: 1,\n executor: () => (value: any) => Objects.isNotEmpty(value),\n },\n uuid: {\n minArity: 0,\n maxArity: 0,\n executor: () => () => UUIDs.v4(),\n },\n}\n"]}
1
+ {"version":3,"file":"functionsDefault.js","sourceRoot":"","sources":["../../../../src/expression/javascript/functionsDefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAK5C,MAAM,CAAC,MAAM,gBAAgB,GAAuE;IAClG,OAAO,EAAE;QACP,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;KACvD;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;KAC1D;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;KACjC;CACF,CAAA","sourcesContent":["import { Objects, UUIDs } from '../../utils'\nimport { ArenaExpressionContext } from '../context'\n\nimport { ArenaExpressionFunction } from '../function'\n\nexport const functionsDefault: { [key: string]: ArenaExpressionFunction<ArenaExpressionContext> } = {\n isEmpty: {\n minArity: 1,\n maxArity: 1,\n executor: () => (value: any) => Objects.isEmpty(value),\n },\n isNotEmpty: {\n minArity: 1,\n maxArity: 1,\n executor: () => (value: any) => Objects.isNotEmpty(value),\n },\n uuid: {\n minArity: 0,\n maxArity: 0,\n executor: () => () => UUIDs.v4(),\n },\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"global.js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import { Dictionary } from '../../common'\nimport { SystemError, SystemErrorKeys } from '../../error'\n\nconst globalObjectsDictionary: Dictionary<any> = {\n Array,\n Boolean,\n Date,\n Math,\n Number,\n String,\n}\nconst globalObjectsArray = Object.values(globalObjectsDictionary)\n\n// properties leading to Object, Function or the prototypes would let an expression run arbitrary code\nexport const isForbiddenPropertyName = (name: string): boolean =>\n name === 'constructor' || name === 'prototype' || name.startsWith('__')\n\n// Object and Function (e.g. returned by a function or found as a property value) give access to the same capabilities\nexport const isForbiddenValue = (value: any): boolean => value === Object || value === Function\n\nexport const getGlobalObjectProperty = (name: string, object: any): any => {\n const globalObject = globalObjectsDictionary[name]\n if (globalObject) {\n return globalObject\n }\n if (object && globalObjectsArray.includes(object)) {\n const property = isForbiddenPropertyName(name) ? undefined : object[name]\n\n if (!property) {\n throw new SystemError(SystemErrorKeys.expression.undefinedFunction, { name })\n }\n return property\n }\n return null\n}\n"]}
1
+ {"version":3,"file":"global.js","sourceRoot":"","sources":["../../../../src/expression/javascript/global.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE1D,MAAM,uBAAuB,GAAyB;IACpD,KAAK;IACL,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,MAAM;CACP,CAAA;AACD,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAA;AAEjE,sGAAsG;AACtG,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAW,EAAE,CAC/D,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AAEzE,sHAAsH;AACtH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,CAAA;AAE/F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAE,MAAW,EAAO,EAAE;IACxE,MAAM,YAAY,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;IAClD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAA;IACrB,CAAC;IACD,IAAI,MAAM,IAAI,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAEzE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;QAC/E,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA","sourcesContent":["import { ArenaDictionary } from '../../common'\nimport { SystemError, SystemErrorKeys } from '../../error'\n\nconst globalObjectsDictionary: ArenaDictionary<any> = {\n Array,\n Boolean,\n Date,\n Math,\n Number,\n String,\n}\nconst globalObjectsArray = Object.values(globalObjectsDictionary)\n\n// properties leading to Object, Function or the prototypes would let an expression run arbitrary code\nexport const isForbiddenPropertyName = (name: string): boolean =>\n name === 'constructor' || name === 'prototype' || name.startsWith('__')\n\n// Object and Function (e.g. returned by a function or found as a property value) give access to the same capabilities\nexport const isForbiddenValue = (value: any): boolean => value === Object || value === Function\n\nexport const getGlobalObjectProperty = (name: string, object: any): any => {\n const globalObject = globalObjectsDictionary[name]\n if (globalObject) {\n return globalObject\n }\n if (object && globalObjectsArray.includes(object)) {\n const property = isForbiddenPropertyName(name) ? undefined : object[name]\n\n if (!property) {\n throw new SystemError(SystemErrorKeys.expression.undefinedFunction, { name })\n }\n return property\n }\n return null\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAmB,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAErE,MAAM,OAAO,cAA4C,SAAQ,uBAA2C;IAC1G,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;IACpG,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ArrayExpression, ExpressionNodeEvaluator } from '../../node'\n\nexport class ArrayEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, ArrayExpression> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'array' }))\n }\n}\n"]}
1
+ {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAwB,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAE1E,MAAM,OAAO,cAAiD,SAAQ,uBAAgD;IACpH,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;IACpG,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ArenaArrayExpression, ExpressionNodeEvaluator } from '../../node'\n\nexport class ArrayEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<C, ArenaArrayExpression> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'array' }))\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/binary.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAoB,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEtE,MAAM,gBAAgB,GAAwD;IAC5E,4DAA4D;IAC5D,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/B,4BAA4B;IAC5B,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IACvB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IACpB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IACpB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC;IACtB,qCAAqC;IACrC,6CAA6C;IAC7C,6BAA6B;IAC7B,6BAA6B;CAC9B,CAAA;AAED,MAAM,mBAAmB,GAA6D;IACpF,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IACpB,GAAG,EAA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AgC;YAChC,4DAA4D;YAC5D,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,IAAI,IAAI,SAAS,GAAG,CAAC,CAAC,IAAI,SAAS,KAAK,CAAC,CAAA;YAEvE,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACrD,CAAC;KAAA;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { Objects } from '../../../utils'\nimport { ExpressionContext } from '../../context'\nimport { BinaryExpression, ExpressionNodeEvaluator } from '../../node'\n\nconst booleanOperators: { [operator: string]: (a: any, b: any) => boolean } = {\n // Short-circuiting operators (we coerce the output to bool)\n '||': (a, b) => Boolean(a || b),\n '&&': (a, b) => Boolean(a && b),\n // Normal boolean operators:\n '==': (a, b) => a === b,\n '!=': (a, b) => a !== b,\n '<': (a, b) => a < b,\n '>': (a, b) => a > b,\n '<=': (a, b) => a <= b,\n '>=': (a, b) => a >= b,\n // Only allow one kind of equalities.\n // some hidden dependencies on === and !==...\n // '===': (a, b) => a === b,\n // '!==': (a, b) => a !== b,\n}\n\nconst arithmeticOperators: { [operator: string]: (a: number, b: number) => number } = {\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '*': (a, b) => a * b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '**': (a, b) => a ** b,\n // Don't allow bitwise operators:\n // '|': (a, b) => a | b,\n // '^': (a, b) => a ^ b,\n // '&': (a, b) => a & b,\n // Don't allow shifts either:\n // '<<': (a, b) => a << b,\n // '>>': (a, b) => a >> b,\n // '>>>': (a, b) => a >>> b,\n}\n\nconst stringOperators: { [operatos: string]: (a: string, b: string) => string } = {\n '+': (a, b) => a + b,\n}\n\nconst binaryOperators = {\n ...booleanOperators,\n ...arithmeticOperators,\n}\n\nconst isNumber = (value: any) => !Objects.isNil(value) && value.constructor === Number\nconst isString = (value: any) => !Objects.isNil(value) && value.constructor === String\n\nexport class BinaryEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, BinaryExpression> {\n async evaluate(expressionNode: BinaryExpression): Promise<any> {\n const { left, right, operator } = expressionNode\n\n const fn = binaryOperators[operator]\n if (!fn) {\n throw new SystemError(SystemErrorKeys.expression.booleanOperatorNotSupported, { operator })\n }\n\n const leftResult = await this.evaluator.evaluateNode(left, this.context)\n const rightResult = await this.evaluator.evaluateNode(right, this.context)\n\n // string operators\n if (operator in stringOperators) {\n if (isString(leftResult) || isString(rightResult)) {\n // string concatenation with null or undefined gives null (like arithmetic operations with null)\n if (Objects.isNil(leftResult) || Objects.isNil(rightResult)) {\n return null\n }\n const strFn = stringOperators[operator]\n return strFn(leftResult as string, rightResult as string)\n }\n // operator can be in arithmeticOperators (+), do not return anything now\n }\n\n // Arithmetic operators will always return nulls for any non-numeric inputs\n if (operator in arithmeticOperators) {\n if (isNumber(leftResult) && isNumber(rightResult)) {\n return fn(leftResult as number, rightResult as number)\n }\n return null\n }\n\n const nullCount = [leftResult, rightResult].filter((result) => result === null || result === undefined).length\n\n // Boolean operators:\n // Like ternary logic, but logical OR has special handling.\n // The expression is boolean if either value is not null.\n // Otherwise the result is null.\n // All other operators return null if either operand is null\n const isValid = (operator === '||' && nullCount < 2) || nullCount === 0\n\n return isValid ? fn(leftResult, rightResult) : null\n }\n}\n"]}
1
+ {"version":3,"file":"binary.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/binary.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAyB,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAE3E,MAAM,gBAAgB,GAAwD;IAC5E,4DAA4D;IAC5D,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC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gGAAgG;oBAChG,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;wBAC5D,OAAO,IAAI,CAAA;oBACb,CAAC;oBACD,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;oBACvC,OAAO,KAAK,CAAC,UAAoB,EAAE,WAAqB,CAAC,CAAA;gBAC3D,CAAC;gBACD,yEAAyE;YAC3E,CAAC;YAED,2EAA2E;YAC3E,IAAI,QAAQ,IAAI,mBAAmB,EAAE,CAAC;gBACpC,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;oBAClD,OAAO,EAAE,CAAC,UAAoB,EAAE,WAAqB,CAAC,CAAA;gBACxD,CAAC;gBACD,OAAO,IAAI,CAAA;YACb,CAAC;YAED,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,MAAM,CAAA;YAE9G,qBAAqB;YACrB,2DAA2D;YAC3D,yDAAyD;YACzD,gCAAgC;YAChC,4DAA4D;YAC5D,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,IAAI,IAAI,SAAS,GAAG,CAAC,CAAC,IAAI,SAAS,KAAK,CAAC,CAAA;YAEvE,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACrD,CAAC;KAAA;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { Objects } from '../../../utils'\nimport { ArenaExpressionContext } from '../../context'\nimport { ArenaBinaryExpression, ExpressionNodeEvaluator } from '../../node'\n\nconst booleanOperators: { [operator: string]: (a: any, b: any) => boolean } = {\n // Short-circuiting operators (we coerce the output to bool)\n '||': (a, b) => Boolean(a || b),\n '&&': (a, b) => Boolean(a && b),\n // Normal boolean operators:\n '==': (a, b) => a === b,\n '!=': (a, b) => a !== b,\n '<': (a, b) => a < b,\n '>': (a, b) => a > b,\n '<=': (a, b) => a <= b,\n '>=': (a, b) => a >= b,\n // Only allow one kind of equalities.\n // some hidden dependencies on === and !==...\n // '===': (a, b) => a === b,\n // '!==': (a, b) => a !== b,\n}\n\nconst arithmeticOperators: { [operator: string]: (a: number, b: number) => number } = {\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '*': (a, b) => a * b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '**': (a, b) => a ** b,\n // Don't allow bitwise operators:\n // '|': (a, b) => a | b,\n // '^': (a, b) => a ^ b,\n // '&': (a, b) => a & b,\n // Don't allow shifts either:\n // '<<': (a, b) => a << b,\n // '>>': (a, b) => a >> b,\n // '>>>': (a, b) => a >>> b,\n}\n\nconst stringOperators: { [operatos: string]: (a: string, b: string) => string } = {\n '+': (a, b) => a + b,\n}\n\nconst binaryOperators = {\n ...booleanOperators,\n ...arithmeticOperators,\n}\n\nconst isNumber = (value: any) => !Objects.isNil(value) && value.constructor === Number\nconst isString = (value: any) => !Objects.isNil(value) && value.constructor === String\n\nexport class BinaryEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaBinaryExpression\n> {\n async evaluate(expressionNode: ArenaBinaryExpression): Promise<any> {\n const { left, right, operator } = expressionNode\n\n const fn = binaryOperators[operator]\n if (!fn) {\n throw new SystemError(SystemErrorKeys.expression.booleanOperatorNotSupported, { operator })\n }\n\n const leftResult = await this.evaluator.evaluateNode(left, this.context)\n const rightResult = await this.evaluator.evaluateNode(right, this.context)\n\n // string operators\n if (operator in stringOperators) {\n if (isString(leftResult) || isString(rightResult)) {\n // string concatenation with null or undefined gives null (like arithmetic operations with null)\n if (Objects.isNil(leftResult) || Objects.isNil(rightResult)) {\n return null\n }\n const strFn = stringOperators[operator]\n return strFn(leftResult as string, rightResult as string)\n }\n // operator can be in arithmeticOperators (+), do not return anything now\n }\n\n // Arithmetic operators will always return nulls for any non-numeric inputs\n if (operator in arithmeticOperators) {\n if (isNumber(leftResult) && isNumber(rightResult)) {\n return fn(leftResult as number, rightResult as number)\n }\n return null\n }\n\n const nullCount = [leftResult, rightResult].filter((result) => result === null || result === undefined).length\n\n // Boolean operators:\n // Like ternary logic, but logical OR has special handling.\n // The expression is boolean if either value is not null.\n // Otherwise the result is null.\n // All other operators return null if either operand is null\n const isValid = (operator === '||' && nullCount < 2) || nullCount === 0\n\n return isValid ? fn(leftResult, rightResult) : null\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/call.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAG7D,OAAO,EAEL,uBAAuB,EACvB,kBAAkB,GAInB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAEhF,gHAAgH;AAChH,MAAM,iCAAiC,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;AAElF,6FAA6F;AAC7F,MAAM,yBAAyB,GAAG,CAAC,MAAwB,EAAE,IAAW,EAAW,EAAE;IACnF,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IACrC,OAAO,CACL,CAAC,QAAQ;QACT,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,UAAU;QAC/C,iCAAiC,CAAC,GAAG,CAAE,QAAiC,CAAC,IAAI,CAAC;QAC9E,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAC5B,CAAA;AACH,CAAC,CAAA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,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;QACxC,CAAC;KAAA;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionFunction } from '../../function'\nimport {\n CallExpression,\n ExpressionNodeEvaluator,\n ExpressionNodeType,\n IdentifierExpression,\n LiteralExpression,\n MemberExpression,\n} from '../../node'\nimport { getGlobalObjectProperty } from '../global'\nimport { isUnsafeRegExpSource, REG_EXP_INPUT_MAX_LENGTH } from '../regExpSafety'\n\n// String functions converting a string argument into a regular expression (replace, replaceAll and split don't)\nconst stringFunctionsWithRegExpArgument = new Set(['match', 'matchAll', 'search'])\n\n// e.g. text.match('(a+)+$'): the string pattern is checked like a regular expression literal\nconst isRegExpStringPatternCall = (callee: MemberExpression, args: any[]): boolean => {\n const { computed, property } = callee\n return (\n !computed &&\n property.type === ExpressionNodeType.Identifier &&\n stringFunctionsWithRegExpArgument.has((property as IdentifierExpression).name) &&\n typeof args[0] === 'string'\n )\n}\n\nconst checkRegExpStringPattern = (pattern: string): void => {\n if (isUnsafeRegExpSource(pattern)) {\n throw new SystemError(SystemErrorKeys.expression.unsafeRegularExpression, { pattern })\n }\n}\n\n// e.g. /.../.test(text) or text.match(/.../): the time taken by a regular expression grows with the input length\nconst checkRegExpInputLength = (fnObject: any, args: any[], regExpStringPattern: boolean): void => {\n const values = [fnObject, ...args]\n if (!regExpStringPattern && !values.some((value) => value instanceof RegExp)) return\n const inputTooLong = values.find((value) => typeof value === 'string' && value.length > REG_EXP_INPUT_MAX_LENGTH)\n if (inputTooLong !== undefined) {\n throw new SystemError(SystemErrorKeys.expression.regularExpressionInputTooLong, {\n maxLength: REG_EXP_INPUT_MAX_LENGTH,\n length: inputTooLong.length,\n })\n }\n}\n\nexport class CallEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, CallExpression> {\n async evaluate(expressionNode: CallExpression): Promise<any> {\n const { callee } = expressionNode\n\n if (callee.type === ExpressionNodeType.Member) {\n return this.evaluateMember(expressionNode, callee)\n } else if (callee.type === ExpressionNodeType.Identifier) {\n return this.evaluateIdentifier(expressionNode, callee)\n }\n\n // No complex expressions may be put in place of a function body.\n // Only a plain identifier is allowed.\n throw new SystemError(SystemErrorKeys.expression.invalidCalleeType, { type: callee.type })\n }\n\n private async evaluateMember(expressionNode: CallExpression, callee: MemberExpression): Promise<any> {\n const { arguments: exprArgs } = expressionNode\n\n // evaluate the callee object only once: evaluating it again to find the function would take exponential time\n // with chained calls (e.g. text.trim().toUpperCase().toLowerCase())\n const fnObject = await this.evaluator.evaluateNode(callee.object, this.context)\n if (fnObject === null || fnObject === undefined) return null\n\n // find the function (e.g. Math.round or text.toUpperCase) among the properties of the already evaluated object\n const fnObjectLiteral: LiteralExpression = { type: ExpressionNodeType.Literal, value: fnObject, raw: '' }\n const calleeWithObjectEvaluated: MemberExpression = { ...callee, object: fnObjectLiteral }\n const fn = await this.evaluator.evaluateNode(calleeWithObjectEvaluated, this.context)\n if (fn) {\n const argsEvaluated = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, this.context)))\n const args = argsEvaluated.flat()\n const regExpStringPattern = isRegExpStringPatternCall(callee, args)\n if (regExpStringPattern) {\n checkRegExpStringPattern(args[0])\n }\n checkRegExpInputLength(fnObject, args, regExpStringPattern)\n return fn.call(fnObject, ...args)\n }\n return null\n }\n\n private async evaluateIdentifier(expressionNode: CallExpression, callee: IdentifierExpression): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { arguments: exprArgs } = expressionNode\n const { object: contextObject } = this.context\n\n const { name: fnName } = callee\n\n const functionInfo = this.evaluator.functions[fnName]\n if (functionInfo) {\n // The function is among the custom functions.\n return this.evaluateCustomIdentifier(expressionNode, fnName)\n }\n // identifier is a global object\n const globalFn = getGlobalObjectProperty(fnName, contextObject)\n if (globalFn !== null) {\n // global functions like String, Number, must be invoked passing node value as argument, not the node itself\n const contextArg = { ...this.context, evaluateToNode: false }\n const args = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, contextArg)))\n return globalFn(...args)\n }\n\n throw new SystemError(SystemErrorKeys.expression.undefinedFunction, { name: fnName })\n }\n\n private async evaluateCustomIdentifier(expressionNode: CallExpression, fnName: string): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { arguments: exprArgs } = expressionNode\n const numArgs = exprArgs.length\n\n const expressionFunction: ExpressionFunction<C> = this.evaluator.functions[fnName]\n\n const { minArity, maxArity, evaluateArgsToNodes, executor } = expressionFunction\n\n if (numArgs < minArity)\n throw new SystemError(SystemErrorKeys.expression.functionHasTooFewArguments, { fnName, minArity, numArgs })\n if (maxArity !== undefined && maxArity >= 0 && numArgs > maxArity)\n throw new SystemError(SystemErrorKeys.expression.functionHasTooManyArguments, { fnName, maxArity, numArgs })\n\n // evaluate arguments\n const argsContext = { ...this.context, evaluateToNode: evaluateArgsToNodes }\n const args = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, argsContext)))\n\n // Currently there are no side effects from function evaluation so it's\n // safe to call the function even when we're just parsing the expression\n // to find all identifiers being used.\n return executor(this.context)(...args)\n }\n}\n"]}
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/call.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAG7D,OAAO,EAEL,uBAAuB,EACvB,kBAAkB,GAInB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAEhF,gHAAgH;AAChH,MAAM,iCAAiC,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;AAElF,6FAA6F;AAC7F,MAAM,yBAAyB,GAAG,CAAC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M,WAAW,mCAAQ,IAAI,CAAC,OAAO,KAAE,cAAc,EAAE,mBAAmB,GAAE,CAAA;YAC5E,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;YAEpG,uEAAuE;YACvE,wEAAwE;YACxE,sCAAsC;YACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;QACxC,CAAC;KAAA;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ArenaExpressionFunction } from '../../function'\nimport {\n ArenaCallExpression,\n ExpressionNodeEvaluator,\n ExpressionNodeType,\n ArenaIdentifierExpression,\n ArenaLiteralExpression,\n ArenaMemberExpression,\n} from '../../node'\nimport { getGlobalObjectProperty } from '../global'\nimport { isUnsafeRegExpSource, REG_EXP_INPUT_MAX_LENGTH } from '../regExpSafety'\n\n// String functions converting a string argument into a regular expression (replace, replaceAll and split don't)\nconst stringFunctionsWithRegExpArgument = new Set(['match', 'matchAll', 'search'])\n\n// e.g. text.match('(a+)+$'): the string pattern is checked like a regular expression literal\nconst isRegExpStringPatternCall = (callee: ArenaMemberExpression, args: any[]): boolean => {\n const { computed, property } = callee\n return (\n !computed &&\n property.type === ExpressionNodeType.Identifier &&\n stringFunctionsWithRegExpArgument.has((property as ArenaIdentifierExpression).name) &&\n typeof args[0] === 'string'\n )\n}\n\nconst checkRegExpStringPattern = (pattern: string): void => {\n if (isUnsafeRegExpSource(pattern)) {\n throw new SystemError(SystemErrorKeys.expression.unsafeRegularExpression, { pattern })\n }\n}\n\n// e.g. /.../.test(text) or text.match(/.../): the time taken by a regular expression grows with the input length\nconst checkRegExpInputLength = (fnObject: any, args: any[], regExpStringPattern: boolean): void => {\n const values = [fnObject, ...args]\n if (!regExpStringPattern && !values.some((value) => value instanceof RegExp)) return\n const inputTooLong = values.find((value) => typeof value === 'string' && value.length > REG_EXP_INPUT_MAX_LENGTH)\n if (inputTooLong !== undefined) {\n throw new SystemError(SystemErrorKeys.expression.regularExpressionInputTooLong, {\n maxLength: REG_EXP_INPUT_MAX_LENGTH,\n length: inputTooLong.length,\n })\n }\n}\n\nexport class CallEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<C, ArenaCallExpression> {\n async evaluate(expressionNode: ArenaCallExpression): Promise<any> {\n const { callee } = expressionNode\n\n if (callee.type === ExpressionNodeType.Member) {\n return this.evaluateMember(expressionNode, callee)\n } else if (callee.type === ExpressionNodeType.Identifier) {\n return this.evaluateIdentifier(expressionNode, callee)\n }\n\n // No complex expressions may be put in place of a function body.\n // Only a plain identifier is allowed.\n throw new SystemError(SystemErrorKeys.expression.invalidCalleeType, { type: callee.type })\n }\n\n private async evaluateMember(expressionNode: ArenaCallExpression, callee: ArenaMemberExpression): Promise<any> {\n const { arguments: exprArgs } = expressionNode\n\n // evaluate the callee object only once: evaluating it again to find the function would take exponential time\n // with chained calls (e.g. text.trim().toUpperCase().toLowerCase())\n const fnObject = await this.evaluator.evaluateNode(callee.object, this.context)\n if (fnObject === null || fnObject === undefined) return null\n\n // find the function (e.g. Math.round or text.toUpperCase) among the properties of the already evaluated object\n const fnObjectLiteral: ArenaLiteralExpression = { type: ExpressionNodeType.Literal, value: fnObject, raw: '' }\n const calleeWithObjectEvaluated: ArenaMemberExpression = { ...callee, object: fnObjectLiteral }\n const fn = await this.evaluator.evaluateNode(calleeWithObjectEvaluated, this.context)\n if (fn) {\n const argsEvaluated = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, this.context)))\n const args = argsEvaluated.flat()\n const regExpStringPattern = isRegExpStringPatternCall(callee, args)\n if (regExpStringPattern) {\n checkRegExpStringPattern(args[0])\n }\n checkRegExpInputLength(fnObject, args, regExpStringPattern)\n return fn.call(fnObject, ...args)\n }\n return null\n }\n\n private async evaluateIdentifier(\n expressionNode: ArenaCallExpression,\n callee: ArenaIdentifierExpression\n ): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { arguments: exprArgs } = expressionNode\n const { object: contextObject } = this.context\n\n const { name: fnName } = callee\n\n const functionInfo = this.evaluator.functions[fnName]\n if (functionInfo) {\n // The function is among the custom functions.\n return this.evaluateCustomIdentifier(expressionNode, fnName)\n }\n // identifier is a global object\n const globalFn = getGlobalObjectProperty(fnName, contextObject)\n if (globalFn !== null) {\n // global functions like String, Number, must be invoked passing node value as argument, not the node itself\n const contextArg = { ...this.context, evaluateToNode: false }\n const args = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, contextArg)))\n return globalFn(...args)\n }\n\n throw new SystemError(SystemErrorKeys.expression.undefinedFunction, { name: fnName })\n }\n\n private async evaluateCustomIdentifier(expressionNode: ArenaCallExpression, fnName: string): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { arguments: exprArgs } = expressionNode\n const numArgs = exprArgs.length\n\n const expressionFunction: ArenaExpressionFunction<C> = this.evaluator.functions[fnName]\n\n const { minArity, maxArity, evaluateArgsToNodes, executor } = expressionFunction\n\n if (numArgs < minArity)\n throw new SystemError(SystemErrorKeys.expression.functionHasTooFewArguments, { fnName, minArity, numArgs })\n if (maxArity !== undefined && maxArity >= 0 && numArgs > maxArity)\n throw new SystemError(SystemErrorKeys.expression.functionHasTooManyArguments, { fnName, maxArity, numArgs })\n\n // evaluate arguments\n const argsContext = { ...this.context, evaluateToNode: evaluateArgsToNodes }\n const args = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, argsContext)))\n\n // Currently there are no side effects from function evaluation so it's\n // safe to call the function even when we're just parsing the expression\n // to find all identifiers being used.\n return executor(this.context)(...args)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compound.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/compound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAsB,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAExE,MAAM,OAAO,iBAA+C,SAAQ,uBAA8C;IAChH,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;IACvG,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { CompoundExpression, ExpressionNodeEvaluator } from '../../node'\n\nexport class CompoundEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, CompoundExpression> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'compound' }))\n }\n}\n"]}
1
+ {"version":3,"file":"compound.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/compound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAA2B,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAE7E,MAAM,OAAO,iBAAoD,SAAQ,uBAGxE;IACC,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;IACvG,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ArenaCompoundExpression, ExpressionNodeEvaluator } from '../../node'\n\nexport class CompoundEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaCompoundExpression\n> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'compound' }))\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/conditional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAyB,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAE3E,MAAM,OAAO,oBAAkD,SAAQ,uBAGtE;IACC,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA;IAC1G,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ConditionalExpression, ExpressionNodeEvaluator } from '../../node'\n\nexport class ConditionalEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ConditionalExpression\n> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'conditional' }))\n }\n}\n"]}
1
+ {"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/conditional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAA8B,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEhF,MAAM,OAAO,oBAAuD,SAAQ,uBAG3E;IACC,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA;IAC1G,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ArenaConditionalExpression, ExpressionNodeEvaluator } from '../../node'\n\nexport class ConditionalEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaConditionalExpression\n> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'conditional' }))\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAAwB,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE9F,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,MAAW,EAAE,EAAE;IACtD,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,IAAI,CAAC,CAAA;IAC3B,IAAI,IAAI,KAAK,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC,CAAA;AAED,MAAM,OAAO,mBAAiD,SAAQ,uBAAgD;IACpH;;;;;;OAMG;IACO,0BAA0B,CAAC,cAAoC;QACvE,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAA;QAC/B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAE9C,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QAC/D,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;QAC9B,CAAC;QACD,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QAC7D,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,CAAA;QAClC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ,CAAC,cAAoC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,CAAC,cAAc,CAAC,CAAA;QAChE,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACxC,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACtH,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, IdentifierExpression } from '../../node'\nimport { getGlobalObjectProperty, isForbiddenPropertyName, isForbiddenValue } from '../global'\n\nconst getNativeProperty = (name: string, object: any) => {\n if (isForbiddenPropertyName(name) || isForbiddenValue(object)) {\n return undefined\n }\n const prop = object?.[name]\n if (prop === undefined || isForbiddenValue(prop)) {\n return undefined\n }\n return typeof prop === 'function' ? prop.bind(object) : prop\n}\n\nexport class IdentifierEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, IdentifierExpression> {\n /**\n * Looks for the identifier among global or native properties, without throwing when it is not found\n * (creating errors captures stack traces, which is expensive when it happens for every evaluated identifier).\n *\n * @param expressionNode - The identifier expression node.\n * @returns The property value wrapped in an object, or null if the identifier has not been found.\n */\n protected findGlobalOrNativeProperty(expressionNode: IdentifierExpression): { value: any } | null {\n const { name } = expressionNode\n const { object: contextObject } = this.context\n\n const globalProp = getGlobalObjectProperty(name, contextObject)\n if (globalProp !== null) {\n return { value: globalProp }\n }\n const nativeProperty = getNativeProperty(name, contextObject)\n if (nativeProperty !== undefined) {\n return { value: nativeProperty }\n }\n return null\n }\n\n evaluate(expressionNode: IdentifierExpression): Promise<any> {\n const property = this.findGlobalOrNativeProperty(expressionNode)\n if (property) {\n return Promise.resolve(property.value)\n }\n return Promise.reject(new SystemError(SystemErrorKeys.expression.identifierNotFound, { name: expressionNode.name }))\n }\n}\n"]}
1
+ {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAA6B,MAAM,YAAY,CAAA;AAC/E,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE9F,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,MAAW,EAAE,EAAE;IACtD,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,IAAI,CAAC,CAAA;IAC3B,IAAI,IAAI,KAAK,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC,CAAA;AAED,MAAM,OAAO,mBAAsD,SAAQ,uBAG1E;IACC;;;;;;OAMG;IACO,0BAA0B,CAAC,cAAyC;QAC5E,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAA;QAC/B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAE9C,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QAC/D,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACxB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;QAC9B,CAAC;QACD,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QAC7D,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,CAAA;QAClC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ,CAAC,cAAyC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,CAAC,cAAc,CAAC,CAAA;QAChE,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACxC,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACtH,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, ArenaIdentifierExpression } from '../../node'\nimport { getGlobalObjectProperty, isForbiddenPropertyName, isForbiddenValue } from '../global'\n\nconst getNativeProperty = (name: string, object: any) => {\n if (isForbiddenPropertyName(name) || isForbiddenValue(object)) {\n return undefined\n }\n const prop = object?.[name]\n if (prop === undefined || isForbiddenValue(prop)) {\n return undefined\n }\n return typeof prop === 'function' ? prop.bind(object) : prop\n}\n\nexport class IdentifierEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaIdentifierExpression\n> {\n /**\n * Looks for the identifier among global or native properties, without throwing when it is not found\n * (creating errors captures stack traces, which is expensive when it happens for every evaluated identifier).\n *\n * @param expressionNode - The identifier expression node.\n * @returns The property value wrapped in an object, or null if the identifier has not been found.\n */\n protected findGlobalOrNativeProperty(expressionNode: ArenaIdentifierExpression): { value: any } | null {\n const { name } = expressionNode\n const { object: contextObject } = this.context\n\n const globalProp = getGlobalObjectProperty(name, contextObject)\n if (globalProp !== null) {\n return { value: globalProp }\n }\n const nativeProperty = getNativeProperty(name, contextObject)\n if (nativeProperty !== undefined) {\n return { value: nativeProperty }\n }\n return null\n }\n\n evaluate(expressionNode: ArenaIdentifierExpression): Promise<any> {\n const property = this.findGlobalOrNativeProperty(expressionNode)\n if (property) {\n return Promise.resolve(property.value)\n }\n return Promise.reject(new SystemError(SystemErrorKeys.expression.identifierNotFound, { name: expressionNode.name }))\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAAqB,MAAM,YAAY,CAAA;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,OAAO,gBAA8C,SAAQ,uBAA6C;IAC9G,QAAQ,CAAC,cAAiC;QACxC,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,CAAA;QAChC,IAAI,KAAK,YAAY,MAAM,IAAI,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAC/F,CAAA;QACH,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, LiteralExpression } from '../../node'\nimport { isUnsafeRegExpSource } from '../regExpSafety'\n\nexport class LiteralEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, LiteralExpression> {\n evaluate(expressionNode: LiteralExpression): Promise<any> {\n const { value } = expressionNode\n if (value instanceof RegExp && isUnsafeRegExpSource(value.source)) {\n return Promise.reject(\n new SystemError(SystemErrorKeys.expression.unsafeRegularExpression, { pattern: value.source })\n )\n }\n return Promise.resolve(value)\n }\n}\n"]}
1
+ {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAA0B,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,OAAO,gBAAmD,SAAQ,uBAGvE;IACC,QAAQ,CAAC,cAAsC;QAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,CAAA;QAChC,IAAI,KAAK,YAAY,MAAM,IAAI,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAC/F,CAAA;QACH,CAAC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, ArenaLiteralExpression } from '../../node'\nimport { isUnsafeRegExpSource } from '../regExpSafety'\n\nexport class LiteralEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaLiteralExpression\n> {\n evaluate(expressionNode: ArenaLiteralExpression): Promise<any> {\n const { value } = expressionNode\n if (value instanceof RegExp && isUnsafeRegExpSource(value.source)) {\n return Promise.reject(\n new SystemError(SystemErrorKeys.expression.unsafeRegularExpression, { pattern: value.source })\n )\n }\n return Promise.resolve(value)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"member.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/member.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAkB,uBAAuB,EAAoB,MAAM,YAAY,CAAA;AAEtF,MAAM,OAAO,eAA6C,SAAQ,uBAA4C;IACtG,wBAAwB,CAAC,QAA6B,EAAE,UAAe;;YAC3E,iDAAiD;YAEjD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,kCAC1D,IAAI,CAAC,OAAO,KACf,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,IAC3B,CAAA;YAEF,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACrC,2BAA2B;gBAC3B,OAAO,UAAU,CAAC,YAAY,CAAC,CAAA;YACjC,CAAC;YAED,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,uFAAuF;gBAEvF,MAAM,QAAQ,GAAG,EAAE,CAAA;gBACnB,KAAK,MAAM,cAAc,IAAI,UAAU,EAAE,CAAC;oBACxC,MAAM,WAAW,mCAAQ,IAAI,CAAC,OAAO,KAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,GAAE,CAAA;oBACtF,oGAAoG;oBACpG,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA,CAAC,UAAU;oBACvF,IAAI,WAAW,EAAE,CAAC;wBAChB,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;oBAC/B,CAAC;gBACH,CAAC;gBACD,OAAO,QAAQ,CAAA;YACjB,CAAC;iBAAM,CAAC;gBACN,OAAO,YAAY,CAAA;YACrB,CAAC;QACH,CAAC;KAAA;IAEK,QAAQ,CAAC,cAAgC;;YAC7C,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAA;YAErD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,kCAAO,IAAI,CAAC,OAAO,KAAE,cAAc,EAAE,IAAI,IAAG,CAAA;YACvG,2EAA2E;YAC3E,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS;gBAAE,OAAO,IAAI,CAAA;YAEhE,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC,wBAAwB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;YAC5D,CAAC;YAED,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,kCAC1D,IAAI,CAAC,OAAO,KACf,MAAM,EAAE,UAAU,IAClB,CAAA;YAEF,OAAO,YAAY,CAAA;QACrB,CAAC;KAAA;CACF","sourcesContent":["import { ExpressionContext } from '../../context'\nimport { ExpressionNode, ExpressionNodeEvaluator, MemberExpression } from '../../node'\n\nexport class MemberEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, MemberExpression> {\n async evaluateComputedProperty(property: ExpressionNode<any>, objectEval: any): Promise<any> {\n // expressions like plot[1] or plot[plot_id == 1]\n\n const propertyEval = await this.evaluator.evaluateNode(property, {\n ...this.context,\n object: this.context.object,\n })\n\n if (typeof propertyEval === 'number') {\n // expressions like plot[1]\n return objectEval[propertyEval]\n }\n\n if (Array.isArray(objectEval)) {\n // expressions where the member property is a filter function (e.g. plot[plot_id == 1])\n\n const filtered = []\n for (const objectEvalItem of objectEval) {\n const itemContext = { ...this.context, object: objectEvalItem, evaluateToNode: false }\n // evaluate items sequentially, to avoid concurrent category item / taxon lookups on large node sets\n const itemMatches = await this.evaluator.evaluateNode(property, itemContext) // NOSONAR\n if (itemMatches) {\n filtered.push(objectEvalItem)\n }\n }\n return filtered\n } else {\n return propertyEval\n }\n }\n\n async evaluate(expressionNode: MemberExpression): Promise<any> {\n const { object, property, computed } = expressionNode\n\n const objectEval = await this.evaluator.evaluateNode(object, { ...this.context, evaluateToNode: true })\n // null or undefined object (falsy values like 0 or '' have properties too)\n if (objectEval === null || objectEval === undefined) return null\n\n if (computed) {\n return this.evaluateComputedProperty(property, objectEval)\n }\n\n const propertyEval = await this.evaluator.evaluateNode(property, {\n ...this.context,\n object: objectEval,\n })\n\n return propertyEval\n }\n}\n"]}
1
+ {"version":3,"file":"member.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/member.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAuB,uBAAuB,EAAyB,MAAM,YAAY,CAAA;AAEhG,MAAM,OAAO,eAAkD,SAAQ,uBAGtE;IACO,wBAAwB,CAAC,QAAkC,EAAE,UAAe;;YAChF,iDAAiD;YAEjD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,kCAC1D,IAAI,CAAC,OAAO,KACf,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,IAC3B,CAAA;YAEF,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACrC,2BAA2B;gBAC3B,OAAO,UAAU,CAAC,YAAY,CAAC,CAAA;YACjC,CAAC;YAED,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,uFAAuF;gBA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berExpression } from '../../node'\n\nexport class MemberEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaMemberExpression\n> {\n async evaluateComputedProperty(property: ArenaExpressionNode<any>, objectEval: any): Promise<any> {\n // expressions like plot[1] or plot[plot_id == 1]\n\n const propertyEval = await this.evaluator.evaluateNode(property, {\n ...this.context,\n object: this.context.object,\n })\n\n if (typeof propertyEval === 'number') {\n // expressions like plot[1]\n return objectEval[propertyEval]\n }\n\n if (Array.isArray(objectEval)) {\n // expressions where the member property is a filter function (e.g. plot[plot_id == 1])\n\n const filtered = []\n for (const objectEvalItem of objectEval) {\n const itemContext = { ...this.context, object: objectEvalItem, evaluateToNode: false }\n // evaluate items sequentially, to avoid concurrent category item / taxon lookups on large node sets\n const itemMatches = await this.evaluator.evaluateNode(property, itemContext) // NOSONAR\n if (itemMatches) {\n filtered.push(objectEvalItem)\n }\n }\n return filtered\n } else {\n return propertyEval\n }\n }\n\n async evaluate(expressionNode: ArenaMemberExpression): Promise<any> {\n const { object, property, computed } = expressionNode\n\n const objectEval = await this.evaluator.evaluateNode(object, { ...this.context, evaluateToNode: true })\n // null or undefined object (falsy values like 0 or '' have properties too)\n if (objectEval === null || objectEval === undefined) return null\n\n if (computed) {\n return this.evaluateComputedProperty(property, objectEval)\n }\n\n const propertyEval = await this.evaluator.evaluateNode(property, {\n ...this.context,\n object: objectEval,\n })\n\n return propertyEval\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sequence.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/sequence.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,uBAAuB,EAAsB,MAAM,YAAY,CAAA;AAExE,MAAM,OAAO,iBAA+C,SAAQ,uBAA8C;IAC1G,QAAQ,CAAC,cAAkC;;YAC/C,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAA;YACrC,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9D,CAAC;KAAA;CACF","sourcesContent":["import { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, SequenceExpression } from '../../node'\n\nexport class SequenceEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, SequenceExpression> {\n async evaluate(expressionNode: SequenceExpression): Promise<any> {\n const { expression } = expressionNode\n return this.evaluator.evaluateNode(expression, this.context)\n }\n}\n"]}
1
+ {"version":3,"file":"sequence.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/sequence.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,uBAAuB,EAA2B,MAAM,YAAY,CAAA;AAE7E,MAAM,OAAO,iBAAoD,SAAQ,uBAGxE;IACO,QAAQ,CAAC,cAAuC;;YACpD,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAA;YACrC,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9D,CAAC;KAAA;CACF","sourcesContent":["import { ArenaExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, ArenaSequenceExpression } from '../../node'\n\nexport class SequenceEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<\n C,\n ArenaSequenceExpression\n> {\n async evaluate(expressionNode: ArenaSequenceExpression): Promise<any> {\n const { expression } = expressionNode\n return this.evaluator.evaluateNode(expression, this.context)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"this.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/this.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAAkB,MAAM,YAAY,CAAA;AAEpE,MAAM,OAAO,aAA2C,SAAQ,uBAA0C;IACxG,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACnG,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, ThisExpression } from '../../node'\n\nexport class ThisEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, ThisExpression> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'this' }))\n }\n}\n"]}
1
+ {"version":3,"file":"this.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/this.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAAuB,MAAM,YAAY,CAAA;AAEzE,MAAM,OAAO,aAAgD,SAAQ,uBAA+C;IAClH,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACnG,CAAC;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, ArenaThisExpression } from '../../node'\n\nexport class ThisEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<C, ArenaThisExpression> {\n evaluate(): Promise<any> {\n return Promise.reject(new SystemError(SystemErrorKeys.expression.notSupported, { type: 'this' }))\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"unary.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/unary.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAAmB,MAAM,YAAY,CAAA;AAErE,MAAM,cAAc,GAAuC;IACzD,wCAAwC;IACxC,wBAAwB;IACxB,GAAG,EAAE,CAAC,CAAM,EAAkB,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzG,qEAAqE;IACrE,yDAAyD;IACzD,GAAG,EAAE,CAAC,CAAM,EAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEhE,uEAAuE;IACvE,wDAAwD;IACxD,uDAAuD;IACvD,oCAAoC;CACrC,CAAA;AAED,MAAM,OAAO,cAA4C,SAAQ,uBAA2C;IACpG,QAAQ,CAAC,cAA+B;;YAC5C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAA;YAC7C,MAAM,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;YAEnC,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,MAAM,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;YAC3F,CAAC;YAED,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YACrE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;QAChB,CAAC;KAAA;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, UnaryExpression } from '../../node'\n\nconst unaryOperators: { [key: string]: (x: any) => any } = {\n // Only accept bools and nulls as input.\n // Otherwise return null\n '!': (x: any): boolean | null => (x === null || x === undefined || x.constructor === Boolean ? !x : null),\n\n // Negation: Only accept normal finite numbers, otherwise return null\n // NOTE: Under JS semantics, we would have -\"123\" -> -123\n '-': (x: any): number | null => (Number.isFinite(x) ? -x : null),\n\n // Don't allow the unary + operator now. Define semantics for it first.\n // Under JS semantics, \"+\" coerces a string to a number.\n // Maybe we should just have `parseNumber` in `stdlib`?\n // '+': x => R.isNil(x) ? null : +x,\n}\n\nexport class UnaryEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, UnaryExpression> {\n async evaluate(expressionNode: UnaryExpression): Promise<any> {\n const { argument, operator } = expressionNode\n const fn = unaryOperators[operator]\n\n if (!fn) {\n throw new SystemError(SystemErrorKeys.expression.unaryOperatorNotSupported, { operator })\n }\n\n const res = await this.evaluator.evaluateNode(argument, this.context)\n return fn(res)\n }\n}\n"]}
1
+ {"version":3,"file":"unary.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/node/unary.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,EAAE,uBAAuB,EAAwB,MAAM,YAAY,CAAA;AAE1E,MAAM,cAAc,GAAuC;IACzD,wCAAwC;IACxC,wBAAwB;IACxB,GAAG,EAAE,CAAC,CAAM,EAAkB,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzG,qEAAqE;IACrE,yDAAyD;IACzD,GAAG,EAAE,CAAC,CAAM,EAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEhE,uEAAuE;IACvE,wDAAwD;IACxD,uDAAuD;IACvD,oCAAoC;CACrC,CAAA;AAED,MAAM,OAAO,cAAiD,SAAQ,uBAAgD;IAC9G,QAAQ,CAAC,cAAoC;;YACjD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAA;YAC7C,MAAM,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;YAEnC,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,MAAM,IAAI,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;YAC3F,CAAC;YAED,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YACrE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;QAChB,CAAC;KAAA;CACF","sourcesContent":["import { SystemError, SystemErrorKeys } from '../../../error'\nimport { ArenaExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, ArenaUnaryExpression } from '../../node'\n\nconst unaryOperators: { [key: string]: (x: any) => any } = {\n // Only accept bools and nulls as input.\n // Otherwise return null\n '!': (x: any): boolean | null => (x === null || x === undefined || x.constructor === Boolean ? !x : null),\n\n // Negation: Only accept normal finite numbers, otherwise return null\n // NOTE: Under JS semantics, we would have -\"123\" -> -123\n '-': (x: any): number | null => (Number.isFinite(x) ? -x : null),\n\n // Don't allow the unary + operator now. Define semantics for it first.\n // Under JS semantics, \"+\" coerces a string to a number.\n // Maybe we should just have `parseNumber` in `stdlib`?\n // '+': x => R.isNil(x) ? null : +x,\n}\n\nexport class UnaryEvaluator<C extends ArenaExpressionContext> extends ExpressionNodeEvaluator<C, ArenaUnaryExpression> {\n async evaluate(expressionNode: ArenaUnaryExpression): Promise<any> {\n const { argument, operator } = expressionNode\n const fn = unaryOperators[operator]\n\n if (!fn) {\n throw new SystemError(SystemErrorKeys.expression.unaryOperatorNotSupported, { operator })\n }\n\n const res = await this.evaluator.evaluateNode(argument, this.context)\n return fn(res)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/parser/parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,OAAO,0BAA0B;IACrC,KAAK,CAAC,UAAkB;QACtB,OAAO,IAAI,CAAC,UAAU,CAAsB,CAAA;IAC9C,CAAC;CACF","sourcesContent":["import { AnyExpressionNode } from '../../node'\nimport { ExpressionParser } from '../../parser'\nimport { jsep } from './jsep'\n\nexport class JavascriptExpressionParser implements ExpressionParser {\n parse(expression: string): AnyExpressionNode {\n return jsep(expression) as AnyExpressionNode\n }\n}\n"]}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../src/expression/javascript/parser/parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,OAAO,0BAA0B;IACrC,KAAK,CAAC,UAAkB;QACtB,OAAO,IAAI,CAAC,UAAU,CAA2B,CAAA;IACnD,CAAC;CACF","sourcesContent":["import { ArenaAnyExpressionNode } from '../../node'\nimport { ExpressionParser } from '../../parser'\nimport { jsep } from './jsep'\n\nexport class JavascriptExpressionParser implements ExpressionParser {\n parse(expression: string): ArenaAnyExpressionNode {\n return jsep(expression) as ArenaAnyExpressionNode\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/expression/node.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iDAA2B,CAAA;IAC3B,6CAAuB,CAAA;IACvB,2CAAqB,CAAA;IACrB,2DAAqC,CAAA;IACrC,+CAAyB,CAAA;IACzB,yCAAmB,CAAA;IACnB,iDAA2B,CAAA;IAC3B,qDAA+B,CAAA;IAC/B,6CAAuB,CAAA;IACvB,+CAAyB,CAAA;AAC3B,CAAC,EAZW,kBAAkB,KAAlB,kBAAkB,QAY7B;AAsED,MAAM,OAAgB,uBAAuB;IAO3C,YAAY,SAAiC,EAAE,OAAU;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAGF","sourcesContent":["import { ExpressionEvaluator } from './evaluator'\nimport { ExpressionContext } from './context'\n\nexport enum ExpressionNodeType {\n Array = 'ArrayExpression',\n Binary = 'BinaryExpression',\n Call = 'CallExpression',\n Compound = 'Compound',\n Conditional = 'ConditionalExpression',\n Identifier = 'Identifier',\n Literal = 'Literal',\n Member = 'MemberExpression',\n Sequence = 'SequenceExpression',\n This = 'ThisExpression',\n Unary = 'UnaryExpression',\n}\n\nexport interface ExpressionNode<T extends ExpressionNodeType> {\n type: T\n}\n\nexport interface ArrayExpression extends ExpressionNode<ExpressionNodeType.Array> {\n elements: Array<AnyExpressionNode>\n}\nexport interface BinaryExpression extends ExpressionNode<ExpressionNodeType.Binary> {\n left: AnyExpressionNode\n right: AnyExpressionNode\n operator: string\n}\nexport interface CallExpression extends ExpressionNode<ExpressionNodeType.Call> {\n arguments: Array<AnyExpressionNode>\n callee: AnyExpressionNode\n}\nexport type CompoundExpression = ExpressionNode<ExpressionNodeType.Compound>\nexport interface ConditionalExpression extends ExpressionNode<ExpressionNodeType.Conditional> {\n test: AnyExpressionNode\n consequent: AnyExpressionNode\n alternate: AnyExpressionNode\n}\nexport interface IdentifierExpression extends ExpressionNode<ExpressionNodeType.Identifier> {\n name: string\n}\nexport interface LiteralExpression extends ExpressionNode<ExpressionNodeType.Literal> {\n raw: string\n value: any\n}\nexport interface MemberExpression extends ExpressionNode<ExpressionNodeType.Member> {\n computed: boolean\n object: AnyExpressionNode\n property: AnyExpressionNode\n optional?: boolean\n}\nexport interface SequenceExpression extends ExpressionNode<ExpressionNodeType.Sequence> {\n expression: AnyExpressionNode\n}\nexport type ThisExpression = ExpressionNode<ExpressionNodeType.This>\nexport interface UnaryExpression extends ExpressionNode<ExpressionNodeType.Unary> {\n argument: AnyExpressionNode\n operator: string\n prefix: boolean\n}\n\n/**\n * Union of all the expression node types: narrow it by `type` to get the specific node.\n */\nexport type AnyExpressionNode =\n | ArrayExpression\n | BinaryExpression\n | CallExpression\n | CompoundExpression\n | ConditionalExpression\n | IdentifierExpression\n | LiteralExpression\n | MemberExpression\n | SequenceExpression\n | ThisExpression\n | UnaryExpression\n\nexport interface ExpressionNodeEvaluatorConstructor<\n C extends ExpressionContext,\n N extends ExpressionNode<ExpressionNodeType>,\n> {\n new (evaluator: ExpressionEvaluator<C>, context: C): ExpressionNodeEvaluator<C, N>\n}\n\nexport abstract class ExpressionNodeEvaluator<\n C extends ExpressionContext,\n N extends ExpressionNode<ExpressionNodeType>,\n> {\n readonly evaluator: ExpressionEvaluator<C>\n readonly context: C\n\n constructor(evaluator: ExpressionEvaluator<C>, context: C) {\n this.evaluator = evaluator\n this.context = context\n }\n\n abstract evaluate(expressionNode: N): Promise<any>\n}\n"]}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/expression/node.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iDAA2B,CAAA;IAC3B,6CAAuB,CAAA;IACvB,2CAAqB,CAAA;IACrB,2DAAqC,CAAA;IACrC,+CAAyB,CAAA;IACzB,yCAAmB,CAAA;IACnB,iDAA2B,CAAA;IAC3B,qDAA+B,CAAA;IAC/B,6CAAuB,CAAA;IACvB,+CAAyB,CAAA;AAC3B,CAAC,EAZW,kBAAkB,KAAlB,kBAAkB,QAY7B;AAsED,MAAM,OAAgB,uBAAuB;IAO3C,YAAY,SAAsC,EAAE,OAAU;QAC5D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAGF","sourcesContent":["import { ArenaExpressionEvaluator } from './evaluator'\nimport { ArenaExpressionContext } from './context'\n\nexport enum ExpressionNodeType {\n Array = 'ArrayExpression',\n Binary = 'BinaryExpression',\n Call = 'CallExpression',\n Compound = 'Compound',\n Conditional = 'ConditionalExpression',\n Identifier = 'Identifier',\n Literal = 'Literal',\n Member = 'MemberExpression',\n Sequence = 'SequenceExpression',\n This = 'ThisExpression',\n Unary = 'UnaryExpression',\n}\n\nexport interface ArenaExpressionNode<T extends ExpressionNodeType> {\n type: T\n}\n\nexport interface ArenaArrayExpression extends ArenaExpressionNode<ExpressionNodeType.Array> {\n elements: Array<ArenaAnyExpressionNode>\n}\nexport interface ArenaBinaryExpression extends ArenaExpressionNode<ExpressionNodeType.Binary> {\n left: ArenaAnyExpressionNode\n right: ArenaAnyExpressionNode\n operator: string\n}\nexport interface ArenaCallExpression extends ArenaExpressionNode<ExpressionNodeType.Call> {\n arguments: Array<ArenaAnyExpressionNode>\n callee: ArenaAnyExpressionNode\n}\nexport type ArenaCompoundExpression = ArenaExpressionNode<ExpressionNodeType.Compound>\nexport interface ArenaConditionalExpression extends ArenaExpressionNode<ExpressionNodeType.Conditional> {\n test: ArenaAnyExpressionNode\n consequent: ArenaAnyExpressionNode\n alternate: ArenaAnyExpressionNode\n}\nexport interface ArenaIdentifierExpression extends ArenaExpressionNode<ExpressionNodeType.Identifier> {\n name: string\n}\nexport interface ArenaLiteralExpression extends ArenaExpressionNode<ExpressionNodeType.Literal> {\n raw: string\n value: any\n}\nexport interface ArenaMemberExpression extends ArenaExpressionNode<ExpressionNodeType.Member> {\n computed: boolean\n object: ArenaAnyExpressionNode\n property: ArenaAnyExpressionNode\n optional?: boolean\n}\nexport interface ArenaSequenceExpression extends ArenaExpressionNode<ExpressionNodeType.Sequence> {\n expression: ArenaAnyExpressionNode\n}\nexport type ArenaThisExpression = ArenaExpressionNode<ExpressionNodeType.This>\nexport interface ArenaUnaryExpression extends ArenaExpressionNode<ExpressionNodeType.Unary> {\n argument: ArenaAnyExpressionNode\n operator: string\n prefix: boolean\n}\n\n/**\n * Union of all the expression node types: narrow it by `type` to get the specific node.\n */\nexport type ArenaAnyExpressionNode =\n | ArenaArrayExpression\n | ArenaBinaryExpression\n | ArenaCallExpression\n | ArenaCompoundExpression\n | ArenaConditionalExpression\n | ArenaIdentifierExpression\n | ArenaLiteralExpression\n | ArenaMemberExpression\n | ArenaSequenceExpression\n | ArenaThisExpression\n | ArenaUnaryExpression\n\nexport interface ArenaExpressionNodeEvaluatorConstructor<\n C extends ArenaExpressionContext,\n N extends ArenaExpressionNode<ExpressionNodeType>,\n> {\n new (evaluator: ArenaExpressionEvaluator<C>, context: C): ExpressionNodeEvaluator<C, N>\n}\n\nexport abstract class ExpressionNodeEvaluator<\n C extends ArenaExpressionContext,\n N extends ArenaExpressionNode<ExpressionNodeType>,\n> {\n readonly evaluator: ArenaExpressionEvaluator<C>\n readonly context: C\n\n constructor(evaluator: ArenaExpressionEvaluator<C>, context: C) {\n this.evaluator = evaluator\n this.context = context\n }\n\n abstract evaluate(expressionNode: N): Promise<any>\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/expression/parser.ts"],"names":[],"mappings":"","sourcesContent":["import { ExpressionNode, ExpressionNodeType } from './node'\n\nexport interface ExpressionParser {\n parse(expression: string): ExpressionNode<ExpressionNodeType>\n}\n"]}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/expression/parser.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaExpressionNode, ExpressionNodeType } from './node'\n\nexport interface ExpressionParser {\n parse(expression: string): ArenaExpressionNode<ExpressionNodeType>\n}\n"]}