@openforis/arena-core 2.3.38 → 2.3.39

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 (383) hide show
  1. package/dist/auth/authGroup.js.map +1 -1
  2. package/dist/auth/authGroups.d.ts +21 -11
  3. package/dist/auth/authGroups.js.map +1 -1
  4. package/dist/auth/authorizer.d.ts +64 -38
  5. package/dist/auth/authorizer.js.map +1 -1
  6. package/dist/auth/permission.js.map +1 -1
  7. package/dist/auth/user.js.map +1 -1
  8. package/dist/auth/users.d.ts +19 -9
  9. package/dist/auth/users.js +3 -2
  10. package/dist/auth/users.js.map +1 -1
  11. package/dist/category/categories.d.ts +7 -3
  12. package/dist/category/categories.js.map +1 -1
  13. package/dist/category/categoryImportSummary.js.map +1 -1
  14. package/dist/category/categoryItemGenerator.d.ts +6 -4
  15. package/dist/category/categoryItems.d.ts +9 -4
  16. package/dist/category/categoryItems.js +2 -1
  17. package/dist/category/categoryItems.js.map +1 -1
  18. package/dist/category/factory.js.map +1 -1
  19. package/dist/chain/chain.js.map +1 -1
  20. package/dist/common/index.js.map +1 -1
  21. package/dist/dataExport/FlatDataExportModel.js.map +1 -1
  22. package/dist/dataExport/FlatDataExportOptions.js.map +1 -1
  23. package/dist/dataExport/FlatDataFiles.d.ts +7 -5
  24. package/dist/dataExport/UniqueFileNamesGenerator.js.map +1 -1
  25. package/dist/dataQuery/dataQuery.js.map +1 -1
  26. package/dist/dataQuery/dataQuerySummaries.d.ts +28 -15
  27. package/dist/dataQuery/dataQuerySummaries.js +3 -3
  28. package/dist/dataQuery/dataQuerySummaries.js.map +1 -1
  29. package/dist/error/SystemError.js.map +1 -1
  30. package/dist/esm/auth/authGroups.js.map +1 -1
  31. package/dist/esm/auth/users.js +3 -2
  32. package/dist/esm/auth/users.js.map +1 -1
  33. package/dist/esm/category/categories.js.map +1 -1
  34. package/dist/esm/category/categoryItems.js +2 -1
  35. package/dist/esm/category/categoryItems.js.map +1 -1
  36. package/dist/esm/dataExport/FlatDataExportModel.js.map +1 -1
  37. package/dist/esm/dataQuery/dataQuerySummaries.js +3 -3
  38. package/dist/esm/dataQuery/dataQuerySummaries.js.map +1 -1
  39. package/dist/esm/expression/javascript/evaluator.js.map +1 -1
  40. package/dist/esm/extraProp/extraProps.js.map +1 -1
  41. package/dist/esm/geo/pointFactory.js.map +1 -1
  42. package/dist/esm/geo/points/bearing.js +1 -1
  43. package/dist/esm/geo/points/bearing.js.map +1 -1
  44. package/dist/esm/geo/points/distance.js +1 -1
  45. package/dist/esm/geo/points/distance.js.map +1 -1
  46. package/dist/esm/geo/points/isValid.js.map +1 -1
  47. package/dist/esm/geo/points/transform.js.map +1 -1
  48. package/dist/esm/job/JobBase.js +4 -3
  49. package/dist/esm/job/JobBase.js.map +1 -1
  50. package/dist/esm/message/messages.js +9 -8
  51. package/dist/esm/message/messages.js.map +1 -1
  52. package/dist/esm/node/factory.js +2 -1
  53. package/dist/esm/node/factory.js.map +1 -1
  54. package/dist/esm/node/nodeValueFormatter.js +2 -1
  55. package/dist/esm/node/nodeValueFormatter.js.map +1 -1
  56. package/dist/esm/node/nodeValues.js +3 -2
  57. package/dist/esm/node/nodeValues.js.map +1 -1
  58. package/dist/esm/node/nodes.js +4 -4
  59. package/dist/esm/node/nodes.js.map +1 -1
  60. package/dist/esm/nodeDef/nodeDefs.js +10 -10
  61. package/dist/esm/nodeDef/nodeDefs.js.map +1 -1
  62. package/dist/esm/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  63. package/dist/esm/nodeDefExpressionEvaluator/functions.js.map +1 -1
  64. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js +3 -2
  65. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  66. package/dist/esm/nodeDefExpressionEvaluator/node/member.js.map +1 -1
  67. package/dist/esm/nodeDefExpressionEvaluator/validator.js.map +1 -1
  68. package/dist/esm/record/_records/nodeDefSelfReferences.js.map +1 -1
  69. package/dist/esm/record/_records/recordGetters.js.map +1 -1
  70. package/dist/esm/record/_records/recordNodesIndexReader.js +6 -4
  71. package/dist/esm/record/_records/recordNodesIndexReader.js.map +1 -1
  72. package/dist/esm/record/_records/recordNodesIndexUpdater.js +10 -7
  73. package/dist/esm/record/_records/recordNodesIndexUpdater.js.map +1 -1
  74. package/dist/esm/record/_records/recordPagesValidation.js.map +1 -1
  75. package/dist/esm/record/_records/recordUpdater.js.map +1 -1
  76. package/dist/esm/record/factory.js +2 -1
  77. package/dist/esm/record/factory.js.map +1 -1
  78. package/dist/esm/record/recordCloner.js +2 -1
  79. package/dist/esm/record/recordCloner.js.map +1 -1
  80. package/dist/esm/record/recordExpressionEvaluator/functions.js.map +1 -1
  81. package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js +3 -2
  82. package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
  83. package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js +4 -7
  84. package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  85. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  86. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  87. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  88. package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
  89. package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  90. package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  91. package/dist/esm/record/recordUpdater.js.map +1 -1
  92. package/dist/esm/record/recordValidator/attributeTypeValidator.js +2 -2
  93. package/dist/esm/record/recordValidator/attributeTypeValidator.js.map +1 -1
  94. package/dist/esm/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  95. package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
  96. package/dist/esm/record/recordValidator/recordValidator.js.map +1 -1
  97. package/dist/esm/survey/nodeDefsFixer.js.map +1 -1
  98. package/dist/esm/survey/refData/factory.js +3 -2
  99. package/dist/esm/survey/refData/factory.js.map +1 -1
  100. package/dist/esm/survey/surveyDocImageFactory.js.map +1 -1
  101. package/dist/esm/survey/surveyDocImages.js.map +1 -1
  102. package/dist/esm/survey/surveyFileFactory.js.map +1 -1
  103. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
  104. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  105. package/dist/esm/survey/surveys/dependencies.js +2 -1
  106. package/dist/esm/survey/surveys/dependencies.js.map +1 -1
  107. package/dist/esm/survey/surveys/nodeDefs.js +4 -2
  108. package/dist/esm/survey/surveys/nodeDefs.js.map +1 -1
  109. package/dist/esm/survey/surveys/refsData.js +2 -1
  110. package/dist/esm/survey/surveys/refsData.js.map +1 -1
  111. package/dist/esm/survey/surveys/surveyGettersSecurity.js +1 -4
  112. package/dist/esm/survey/surveys/surveyGettersSecurity.js.map +1 -1
  113. package/dist/esm/survey/surveys/surveysGetters.js +5 -7
  114. package/dist/esm/survey/surveys/surveysGetters.js.map +1 -1
  115. package/dist/esm/taxonomy/taxa.js.map +1 -1
  116. package/dist/esm/taxonomy/taxonomies.js.map +1 -1
  117. package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
  118. package/dist/esm/tests/builder/recordBuilder/index.js.map +1 -1
  119. package/dist/esm/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  120. package/dist/esm/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
  121. package/dist/esm/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  122. package/dist/esm/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  123. package/dist/esm/utils/_objects/camelize.js.map +1 -1
  124. package/dist/esm/utils/arrays.js.map +1 -1
  125. package/dist/esm/utils/dates.js.map +1 -1
  126. package/dist/esm/utils/fileNames.js.map +1 -1
  127. package/dist/esm/utils/fileProcessor.js +2 -1
  128. package/dist/esm/utils/fileProcessor.js.map +1 -1
  129. package/dist/esm/utils/numbers.js.map +1 -1
  130. package/dist/esm/utils/queue.js.map +1 -1
  131. package/dist/esm/utils/versions.js.map +1 -1
  132. package/dist/esm/validation/factory.js.map +1 -1
  133. package/dist/esm/validation/fieldValidators/numeric.js.map +1 -1
  134. package/dist/esm/validation/fieldValidators/numericPositive.js.map +1 -1
  135. package/dist/esm/validation/validationResults.js +1 -1
  136. package/dist/esm/validation/validationResults.js.map +1 -1
  137. package/dist/esm/validation/validations.js +2 -2
  138. package/dist/esm/validation/validations.js.map +1 -1
  139. package/dist/esm/validation/validator.js.map +1 -1
  140. package/dist/expression/javascript/evaluator.js.map +1 -1
  141. package/dist/expression/javascript/global.js.map +1 -1
  142. package/dist/expression/javascript/node/array.js.map +1 -1
  143. package/dist/expression/javascript/node/binary.js.map +1 -1
  144. package/dist/expression/javascript/node/call.js.map +1 -1
  145. package/dist/expression/javascript/node/compound.js.map +1 -1
  146. package/dist/expression/javascript/node/conditional.js.map +1 -1
  147. package/dist/expression/javascript/node/identifier.js.map +1 -1
  148. package/dist/expression/javascript/node/literal.js.map +1 -1
  149. package/dist/expression/javascript/node/member.js.map +1 -1
  150. package/dist/expression/javascript/node/sequence.js.map +1 -1
  151. package/dist/expression/javascript/node/this.js.map +1 -1
  152. package/dist/expression/javascript/node/unary.js.map +1 -1
  153. package/dist/expression/javascript/parser/jsep.js.map +1 -1
  154. package/dist/expression/javascript/parser/parser.js.map +1 -1
  155. package/dist/expression/node.js.map +1 -1
  156. package/dist/expression/variable.js.map +1 -1
  157. package/dist/extraProp/extraProp.js.map +1 -1
  158. package/dist/extraProp/extraProps.d.ts +9 -6
  159. package/dist/extraProp/extraProps.js.map +1 -1
  160. package/dist/extraProp/extraPropsDataGenerator.d.ts +7 -5
  161. package/dist/geo/pointFactory.js.map +1 -1
  162. package/dist/geo/points/bearing.js +5 -2
  163. package/dist/geo/points/bearing.js.map +1 -1
  164. package/dist/geo/points/distance.js +5 -2
  165. package/dist/geo/points/distance.js.map +1 -1
  166. package/dist/geo/points/equals.js.map +1 -1
  167. package/dist/geo/points/getSrs.js.map +1 -1
  168. package/dist/geo/points/index.d.ts +18 -14
  169. package/dist/geo/points/isFilled.js.map +1 -1
  170. package/dist/geo/points/isValid.js.map +1 -1
  171. package/dist/geo/points/parse.js.map +1 -1
  172. package/dist/geo/points/pointAtDistance.js.map +1 -1
  173. package/dist/geo/points/toLatLong.js.map +1 -1
  174. package/dist/geo/points/toString.js.map +1 -1
  175. package/dist/geo/points/transform.js.map +1 -1
  176. package/dist/job/JobBase.js +4 -3
  177. package/dist/job/JobBase.js.map +1 -1
  178. package/dist/job/jobEvent.js.map +1 -1
  179. package/dist/job/status.js.map +1 -1
  180. package/dist/language/languageCode.js.map +1 -1
  181. package/dist/language/languages.js.map +1 -1
  182. package/dist/message/message.js.map +1 -1
  183. package/dist/message/messages.d.ts +54 -28
  184. package/dist/message/messages.js +9 -8
  185. package/dist/message/messages.js.map +1 -1
  186. package/dist/node/factory.js +2 -1
  187. package/dist/node/factory.js.map +1 -1
  188. package/dist/node/node.js.map +1 -1
  189. package/dist/node/nodeValueFormatter.d.ts +2 -1
  190. package/dist/node/nodeValueFormatter.js +2 -1
  191. package/dist/node/nodeValueFormatter.js.map +1 -1
  192. package/dist/node/nodeValueProps.js.map +1 -1
  193. package/dist/node/nodeValues.d.ts +62 -41
  194. package/dist/node/nodeValues.js +3 -2
  195. package/dist/node/nodeValues.js.map +1 -1
  196. package/dist/node/nodes.d.ts +112 -86
  197. package/dist/node/nodes.js +4 -4
  198. package/dist/node/nodes.js.map +1 -1
  199. package/dist/nodeDef/nodeDef.js.map +1 -1
  200. package/dist/nodeDef/nodeDefs.d.ts +173 -86
  201. package/dist/nodeDef/nodeDefs.js +10 -10
  202. package/dist/nodeDef/nodeDefs.js.map +1 -1
  203. package/dist/nodeDef/types/entity.js.map +1 -1
  204. package/dist/nodeDef/types/file.js.map +1 -1
  205. package/dist/nodeDef/types/formHeader.js.map +1 -1
  206. package/dist/nodeDef/types/text.js.map +1 -1
  207. package/dist/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  208. package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
  209. package/dist/nodeDefExpressionEvaluator/node/identifier.js +3 -2
  210. package/dist/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  211. package/dist/nodeDefExpressionEvaluator/node/member.js.map +1 -1
  212. package/dist/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.d.ts +11 -8
  213. package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.d.ts +1 -1
  214. package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  215. package/dist/nodeDefExpressionEvaluator/validator.js.map +1 -1
  216. package/dist/record/_records/nodeDefSelfReferences.d.ts +12 -4
  217. package/dist/record/_records/nodeDefSelfReferences.js.map +1 -1
  218. package/dist/record/_records/recordCompletion.js.map +1 -1
  219. package/dist/record/_records/recordGetters.js.map +1 -1
  220. package/dist/record/_records/recordNodesIndexReader.d.ts +14 -8
  221. package/dist/record/_records/recordNodesIndexReader.js +6 -4
  222. package/dist/record/_records/recordNodesIndexReader.js.map +1 -1
  223. package/dist/record/_records/recordNodesIndexUpdater.d.ts +22 -12
  224. package/dist/record/_records/recordNodesIndexUpdater.js +10 -7
  225. package/dist/record/_records/recordNodesIndexUpdater.js.map +1 -1
  226. package/dist/record/_records/recordPagesValidation.js.map +1 -1
  227. package/dist/record/_records/recordUpdater.js.map +1 -1
  228. package/dist/record/_records/recordUtils.js.map +1 -1
  229. package/dist/record/factory.js +2 -1
  230. package/dist/record/factory.js.map +1 -1
  231. package/dist/record/nodePointers.d.ts +13 -10
  232. package/dist/record/recordCloner.d.ts +11 -10
  233. package/dist/record/recordCloner.js +2 -1
  234. package/dist/record/recordCloner.js.map +1 -1
  235. package/dist/record/recordExpressionEvaluator/functions.js.map +1 -1
  236. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js +3 -2
  237. package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
  238. package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.d.ts +8 -6
  239. package/dist/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
  240. package/dist/record/recordExpressionEvaluator/nodeValueExtractor.d.ts +7 -5
  241. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js +4 -7
  242. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  243. package/dist/record/recordFixer.d.ts +19 -10
  244. package/dist/record/recordNodesUpdater/index.d.ts +8 -7
  245. package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
  246. package/dist/record/recordNodesUpdater/recordExpressionValueConverter.d.ts +2 -1
  247. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  248. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  249. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  250. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  251. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  252. package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
  253. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
  254. package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
  255. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  256. package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
  257. package/dist/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
  258. package/dist/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
  259. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  260. package/dist/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  261. package/dist/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  262. package/dist/record/recordPrettyPrinter.d.ts +18 -15
  263. package/dist/record/recordPrettyPrinter.js.map +1 -1
  264. package/dist/record/recordStep.d.ts +5 -2
  265. package/dist/record/recordStep.js.map +1 -1
  266. package/dist/record/recordUpdater.d.ts +22 -15
  267. package/dist/record/recordUpdater.js.map +1 -1
  268. package/dist/record/recordValidations.d.ts +21 -14
  269. package/dist/record/recordValidator/attributeKeyValidator.d.ts +8 -6
  270. package/dist/record/recordValidator/attributeKeyValidator.js.map +1 -1
  271. package/dist/record/recordValidator/attributeTypeValidator.d.ts +2 -1
  272. package/dist/record/recordValidator/attributeTypeValidator.js +2 -2
  273. package/dist/record/recordValidator/attributeTypeValidator.js.map +1 -1
  274. package/dist/record/recordValidator/attributeUniqueValidator.d.ts +1 -5
  275. package/dist/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  276. package/dist/record/recordValidator/attributeValidator.d.ts +3 -1
  277. package/dist/record/recordValidator/attributeValidator.js.map +1 -1
  278. package/dist/record/recordValidator/countVaildator.d.ts +21 -17
  279. package/dist/record/recordValidator/index.d.ts +4 -3
  280. package/dist/record/recordValidator/recordValidator.js.map +1 -1
  281. package/dist/record/records.d.ts +62 -220
  282. package/dist/registry/serviceRegistry.js.map +1 -1
  283. package/dist/registry/serviceType.js.map +1 -1
  284. package/dist/srs/srs.js.map +1 -1
  285. package/dist/survey/nodeDefsFixer.d.ts +5 -4
  286. package/dist/survey/nodeDefsFixer.js.map +1 -1
  287. package/dist/survey/refData/factory.js +3 -2
  288. package/dist/survey/refData/factory.js.map +1 -1
  289. package/dist/survey/survey.d.ts +2 -2
  290. package/dist/survey/survey.js.map +1 -1
  291. package/dist/survey/surveyDocImageFactory.js.map +1 -1
  292. package/dist/survey/surveyDocImages.d.ts +11 -5
  293. package/dist/survey/surveyDocImages.js.map +1 -1
  294. package/dist/survey/surveyFileFactory.js.map +1 -1
  295. package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
  296. package/dist/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  297. package/dist/survey/surveys/dependencies.js +2 -1
  298. package/dist/survey/surveys/dependencies.js.map +1 -1
  299. package/dist/survey/surveys/index.d.ts +82 -255
  300. package/dist/survey/surveys/nodeDefs.d.ts +4 -6
  301. package/dist/survey/surveys/nodeDefs.js +4 -2
  302. package/dist/survey/surveys/nodeDefs.js.map +1 -1
  303. package/dist/survey/surveys/refsData.js +2 -1
  304. package/dist/survey/surveys/refsData.js.map +1 -1
  305. package/dist/survey/surveys/surveyGettersSecurity.js +1 -4
  306. package/dist/survey/surveys/surveyGettersSecurity.js.map +1 -1
  307. package/dist/survey/surveys/surveysGetters.js +5 -7
  308. package/dist/survey/surveys/surveysGetters.js.map +1 -1
  309. package/dist/survey/surveys/surveysUtils.js.map +1 -1
  310. package/dist/taxonomy/taxa.d.ts +17 -11
  311. package/dist/taxonomy/taxa.js.map +1 -1
  312. package/dist/taxonomy/taxonGenerator.d.ts +6 -4
  313. package/dist/taxonomy/taxonomies.d.ts +7 -3
  314. package/dist/taxonomy/taxonomies.js.map +1 -1
  315. package/dist/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
  316. package/dist/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
  317. package/dist/tests/builder/recordBuilder/index.d.ts +4 -2
  318. package/dist/tests/builder/recordBuilder/index.js.map +1 -1
  319. package/dist/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  320. package/dist/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
  321. package/dist/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
  322. package/dist/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
  323. package/dist/tests/builder/surveyBuilder/index.d.ts +30 -15
  324. package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  325. package/dist/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  326. package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  327. package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  328. package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  329. package/dist/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
  330. package/dist/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
  331. package/dist/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
  332. package/dist/utils/_objects/assoc.js.map +1 -1
  333. package/dist/utils/_objects/assocPath.js.map +1 -1
  334. package/dist/utils/_objects/camelize.js.map +1 -1
  335. package/dist/utils/_objects/deepMerge.js.map +1 -1
  336. package/dist/utils/_objects/deleteEmptyProps.js.map +1 -1
  337. package/dist/utils/_objects/difference.js.map +1 -1
  338. package/dist/utils/_objects/dissoc.js.map +1 -1
  339. package/dist/utils/_objects/dissocPath.js.map +1 -1
  340. package/dist/utils/_objects/dissocPathIfEmpty.js.map +1 -1
  341. package/dist/utils/_objects/index.d.ts +34 -48
  342. package/dist/utils/_objects/isEmpty.js.map +1 -1
  343. package/dist/utils/_objects/isNil.js.map +1 -1
  344. package/dist/utils/_objects/isNotEmpty.js.map +1 -1
  345. package/dist/utils/_objects/parse.js.map +1 -1
  346. package/dist/utils/_objects/path.js.map +1 -1
  347. package/dist/utils/_objects/propertyOf.js.map +1 -1
  348. package/dist/utils/_objects/setInPath.js.map +1 -1
  349. package/dist/utils/_objects/stringify.js.map +1 -1
  350. package/dist/utils/arrays.d.ts +25 -15
  351. package/dist/utils/arrays.js.map +1 -1
  352. package/dist/utils/dates.d.ts +101 -48
  353. package/dist/utils/dates.js.map +1 -1
  354. package/dist/utils/fileNames.d.ts +7 -3
  355. package/dist/utils/fileNames.js.map +1 -1
  356. package/dist/utils/fileProcessor.js +2 -1
  357. package/dist/utils/fileProcessor.js.map +1 -1
  358. package/dist/utils/numbers.d.ts +42 -13
  359. package/dist/utils/numbers.js.map +1 -1
  360. package/dist/utils/promises.d.ts +12 -1
  361. package/dist/utils/queue.js.map +1 -1
  362. package/dist/utils/retryProcessor.js.map +1 -1
  363. package/dist/utils/strings.d.ts +22 -11
  364. package/dist/utils/uuids.d.ts +3 -1
  365. package/dist/utils/versions.d.ts +19 -7
  366. package/dist/utils/versions.js.map +1 -1
  367. package/dist/validation/factory.js.map +1 -1
  368. package/dist/validation/fieldValidators/email.js.map +1 -1
  369. package/dist/validation/fieldValidators/index.d.ts +12 -6
  370. package/dist/validation/fieldValidators/name.js.map +1 -1
  371. package/dist/validation/fieldValidators/notKeyword.js.map +1 -1
  372. package/dist/validation/fieldValidators/numeric.js.map +1 -1
  373. package/dist/validation/fieldValidators/numericPositive.js.map +1 -1
  374. package/dist/validation/fieldValidators/required.js.map +1 -1
  375. package/dist/validation/validation.js.map +1 -1
  376. package/dist/validation/validationResults.d.ts +17 -9
  377. package/dist/validation/validationResults.js +1 -1
  378. package/dist/validation/validationResults.js.map +1 -1
  379. package/dist/validation/validations.d.ts +71 -35
  380. package/dist/validation/validations.js +2 -2
  381. package/dist/validation/validations.js.map +1 -1
  382. package/dist/validation/validator.js.map +1 -1
  383. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/call.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0CAA4C;AAG5C,qCAAwF;AACxF,sCAAmD;AAEnD,MAAa,aAA2C,SAAQ,8BAA0C;IAClG,QAAQ,CAAC,cAA8B;;YAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAA;YAEjC,IAAI,MAAM,CAAC,IAAI,KAAK,yBAAkB,CAAC,MAAM,EAAE,CAAC;gBAC9C,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YAC5C,CAAC;iBAAM,IAAI,MAAM,CAAC,IA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AE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,kBAAkB,CAAA;YAEhF,IAAI,OAAO,GAAG,QAAQ;gBACpB,MAAM,IAAI,mBAAW,CAAC,uCAAuC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;YAC/F,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,IAAI,CAAC,IAAI,OAAO,GAAG,QAAQ;gBAC/D,MAAM,IAAI,mBAAW,CAAC,wCAAwC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;YAEhG,qBAAqB;YACrB,MAAM,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;AA/ED,sCA+EC","sourcesContent":["import { IdentifierExpression, MemberExpression } from '../..'\nimport { SystemError } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionFunction } from '../../function'\nimport { CallExpression, ExpressionNodeEvaluator, ExpressionNodeType } from '../../node'\nimport { getGlobalObjectProperty } from '../global'\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)\n } else if (callee.type === ExpressionNodeType.Identifier) {\n return this.evaluateIdentifier(expressionNode)\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('expression.invalidCalleeType', { type: callee.type })\n }\n\n async evaluateMember(expressionNode: CallExpression): Promise<any> {\n const { callee, arguments: exprArgs } = expressionNode\n\n // global function (e.g. Math.round(...))\n const fn = await this.evaluator.evaluateNode(callee, this.context)\n if (fn) {\n const { object: calleeObj } = callee as MemberExpression\n const fnObject = await this.evaluator.evaluateNode(calleeObj, this.context)\n const argsEvaluated = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, this.context)))\n const args = argsEvaluated.flat()\n return fn.call(fnObject, ...args)\n }\n return null\n }\n\n async evaluateIdentifier(expressionNode: CallExpression): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { callee, arguments: exprArgs } = expressionNode\n const { object: contextObject } = this.context\n\n const { name: fnName } = callee as IdentifierExpression\n\n const functionInfo = this.evaluator.functions[fnName]\n if (functionInfo) {\n // The function is among the custom functions.\n return this.evaluateCustomIdentifier(expressionNode)\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('expression.undefinedFunction', { name: fnName })\n }\n\n async evaluateCustomIdentifier(expressionNode: CallExpression): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { callee, arguments: exprArgs } = expressionNode\n\n const { name: fnName } = callee as IdentifierExpression\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('expression.functionHasTooFewArguments', { fnName, minArity, numArgs })\n if (maxArity !== undefined && maxArity >= 0 && numArgs > maxArity)\n throw new SystemError('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":";;;;;;;;;;;;AACA,0CAA4C;AAG5C,qCAAwF;AACxF,sCAAmD;AAEnD,mBAAwD,SAAQ,8BAA0C;IAClG,QAAQ,CAAC,cAA8B;;YAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAA;YAEjC,IAAI,MAAM,CAAC,IAAI,KAAK,yBAAkB,CAAC,MAAM,EAAE,CAAC;gBAC9C,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YAC5C,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,KAAK,yBAAkB,CAAC,UAAU,EAAE,CAAC;gBACzD,OAAO,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;YAChD,CAAC;YAED,iEAAiE;YACjE,sCAAsC;YACtC,MAAM,IAAI,mBAAW,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QAC9E,CAAC;KAAA;IAEK,cAAc,CAAC,cAA8B;;YACjD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAA;YAEtD,yCAAyC;YACzC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YAClE,IAAI,EAAE,EAAE,CAAC;gBACP,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAA0B,CAAA;gBACxD,MAAM,QAAQ,GAAG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,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 { IdentifierExpression, MemberExpression } from '../..'\nimport { SystemError } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionFunction } from '../../function'\nimport { CallExpression, ExpressionNodeEvaluator, ExpressionNodeType } from '../../node'\nimport { getGlobalObjectProperty } from '../global'\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)\n } else if (callee.type === ExpressionNodeType.Identifier) {\n return this.evaluateIdentifier(expressionNode)\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('expression.invalidCalleeType', { type: callee.type })\n }\n\n async evaluateMember(expressionNode: CallExpression): Promise<any> {\n const { callee, arguments: exprArgs } = expressionNode\n\n // global function (e.g. Math.round(...))\n const fn = await this.evaluator.evaluateNode(callee, this.context)\n if (fn) {\n const { object: calleeObj } = callee as MemberExpression\n const fnObject = await this.evaluator.evaluateNode(calleeObj, this.context)\n const argsEvaluated = await Promise.all(exprArgs.map((arg) => this.evaluator.evaluateNode(arg, this.context)))\n const args = argsEvaluated.flat()\n return fn.call(fnObject, ...args)\n }\n return null\n }\n\n async evaluateIdentifier(expressionNode: CallExpression): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { callee, arguments: exprArgs } = expressionNode\n const { object: contextObject } = this.context\n\n const { name: fnName } = callee as IdentifierExpression\n\n const functionInfo = this.evaluator.functions[fnName]\n if (functionInfo) {\n // The function is among the custom functions.\n return this.evaluateCustomIdentifier(expressionNode)\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('expression.undefinedFunction', { name: fnName })\n }\n\n async evaluateCustomIdentifier(expressionNode: CallExpression): Promise<any> {\n // Arguments is a reserved word in strict mode\n const { callee, arguments: exprArgs } = expressionNode\n\n const { name: fnName } = callee as IdentifierExpression\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('expression.functionHasTooFewArguments', { fnName, minArity, numArgs })\n if (maxArity !== undefined && maxArity >= 0 && numArgs > maxArity)\n throw new SystemError('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,0CAA4C;AAE5C,qCAAwE;AAExE,MAAa,iBAA+C,SAAQ,8BAA8C;IAChH,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,mBAAW,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AAJD,8CAIC","sourcesContent":["import { SystemError } 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('expression.notSupported', { type: 'compound' }))\n }\n}\n"]}
1
+ {"version":3,"file":"compound.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/compound.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAE5C,qCAAwE;AAExE,uBAA4D,SAAQ,8BAA8C;IAChH,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,mBAAW,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAA;IACzF,CAAC;CACF","sourcesContent":["import { SystemError } 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('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,0CAA4C;AAE5C,qCAA2E;AAE3E,MAAa,oBAAkD,SAAQ,8BAGtE;IACC,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,mBAAW,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA;IAC5F,CAAC;CACF;AAPD,oDAOC","sourcesContent":["import { SystemError } 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('expression.notSupported', { type: 'conditional' }))\n }\n}\n"]}
1
+ {"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/conditional.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAE5C,qCAA2E;AAE3E,0BAA+D,SAAQ,8BAGtE;IACC,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,mBAAW,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA;IAC5F,CAAC;CACF","sourcesContent":["import { SystemError } 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('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,0CAA4C;AAE5C,qCAA0E;AAC1E,sCAAmD;AAEnD,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,MAAW,EAAE,EAAE;IACtD,MAAM,IAAI,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,IAAI,CAAC,CAAA;IAC3B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,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,MAAa,mBAAiD,SAAQ,8BAAgD;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,IAAA,gCAAuB,EAAC,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,mBAAW,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACxG,CAAC;CACF;AA9BD,kDA8BC","sourcesContent":["import { SystemError } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, IdentifierExpression } from '../../node'\nimport { getGlobalObjectProperty } from '../global'\n\nconst getNativeProperty = (name: string, object: any) => {\n const prop = object?.[name]\n if (prop === undefined) {\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('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,0CAA4C;AAE5C,qCAA0E;AAC1E,sCAAmD;AAEnD,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,MAAW,EAAE,EAAE;IACtD,MAAM,IAAI,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,IAAI,CAAC,CAAA;IAC3B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,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,yBAA8D,SAAQ,8BAAgD;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,IAAA,gCAAuB,EAAC,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,mBAAW,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACxG,CAAC;CACF","sourcesContent":["import { SystemError } from '../../../error'\nimport { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, IdentifierExpression } from '../../node'\nimport { getGlobalObjectProperty } from '../global'\n\nconst getNativeProperty = (name: string, object: any) => {\n const prop = object?.[name]\n if (prop === undefined) {\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('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":";;;AACA,qCAAuE;AAEvE,MAAa,gBAA8C,SAAQ,8BAA6C;IAC9G,QAAQ,CAAC,cAAiC;QACxC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IAC9C,CAAC;CACF;AAJD,4CAIC","sourcesContent":["import { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, LiteralExpression } from '../../node'\n\nexport class LiteralEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, LiteralExpression> {\n evaluate(expressionNode: LiteralExpression): Promise<any> {\n return Promise.resolve(expressionNode.value)\n }\n}\n"]}
1
+ {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/literal.ts"],"names":[],"mappings":";;;AACA,qCAAuE;AAEvE,sBAA2D,SAAQ,8BAA6C;IAC9G,QAAQ,CAAC,cAAiC;QACxC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IAC9C,CAAC;CACF","sourcesContent":["import { ExpressionContext } from '../../context'\nimport { ExpressionNodeEvaluator, LiteralExpression } from '../../node'\n\nexport class LiteralEvaluator<C extends ExpressionContext> extends ExpressionNodeEvaluator<C, LiteralExpression> {\n evaluate(expressionNode: LiteralExpression): Promise<any> {\n return Promise.resolve(expressionNode.value)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"member.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/member.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qCAAsF;AAEtF,MAAa,eAA6C,SAAQ,8BAA4C;IACtG,wBAAwB,CAAC,QAA6B,EAA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AC;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;AAjDD,0CAiDC","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 if (!objectEval) 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"],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EAAE,IAAI,IAAG,CAAA;YACvG,IAAI,CAAC,UAAU;gBAAE,OAAO,IAAI,CAAA;YAE5B,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 if (!objectEval) 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,qCAAwE;AAExE,MAAa,iBAA+C,SAAQ,8BAA8C;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;AALD,8CAKC","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,qCAAwE;AAExE,uBAA4D,SAAQ,8BAA8C;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 +1 @@
1
- {"version":3,"file":"this.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/this.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAE5C,qCAAoE;AAEpE,MAAa,aAA2C,SAAQ,8BAA0C;IACxG,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,mBAAW,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACrF,CAAC;CACF;AAJD,sCAIC","sourcesContent":["import { SystemError } 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('expression.notSupported', { type: 'this' }))\n }\n}\n"]}
1
+ {"version":3,"file":"this.js","sourceRoot":"","sources":["../../../../src/expression/javascript/node/this.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAE5C,qCAAoE;AAEpE,mBAAwD,SAAQ,8BAA0C;IACxG,QAAQ;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,mBAAW,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IACrF,CAAC;CACF","sourcesContent":["import { SystemError } 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('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,0CAA4C;AAE5C,qCAAqE;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,MAAa,cAA4C,SAAQ,8BAA2C;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,mBAAW,CAAC,sCAAsC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;YAC7E,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;AAZD,wCAYC","sourcesContent":["import { SystemError } 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('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,0CAA4C;AAE5C,qCAAqE;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,oBAAyD,SAAQ,8BAA2C;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,mBAAW,CAAC,sCAAsC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;YAC7E,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 } 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('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":"jsep.js","sourceRoot":"","sources":["../../../../src/expression/javascript/parser/jsep.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AA0Cd,eA1CF,cAAI,CA0CE;AAzCb,+DAA0C;AAE1C,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAoC,CAAC,CAAA;AAE3D,8CAA8C;AAC9C,cAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAA;AAEhC,MAAM,qBAAqB,GAAG,EAAE,CAAA,CAAC,IAAI;AACrC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,IAAI;AAEtC,MAAM,mBAAmB,GAAG,oBAAoB,CAAA;AAEhD,gGAAgG;AAChG,8IAA8I;AAC9I,MAAM,wBAAwB,GAAG;IAC/B,IAAI,EAAE,YAAY;IAClB,IAAI,CAAC,QAAa;QAChB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,GAAQ,EAAQ,EAAE;YACpD,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YACvB,oBAAoB;YACpB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;gBACxF,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;gBAClB,IAAI,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;gBAC7D,IAAI,OAAO,CAAC,IAAI,KAAK,sBAAsB,EAAE,CAAC;oBAC5C,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;oBAClB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACrB,GAAG,CAAC,IAAI,GAAG;4BACT,IAAI,EAAE,mBAAmB;4BACzB,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;yBACrB,CAAA;oBACH,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;gBAClC,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,wBAAwC,CAAC,CAAA","sourcesContent":["import jsep from 'jsep'\nimport jsepRegex from '@jsep-plugin/regex'\n\njsep.plugins.register(jsepRegex as unknown as jsep.IPlugin)\n\n// Add exponentiation operator (right-to-left)\njsep.addBinaryOp('**', 11, true)\n\nconst OPEN_PARENTHESIS_CODE = 40 // (\nconst CLOSE_PARENTHESIS_CODE = 41 // )\n\nconst SEQUENCE_EXPRESSION = 'SequenceExpression'\n\n// keep sequence expressions in parsed expression, even when there is only one node inside of it\n// (by default the unnecessary enclosing parenthesis of a sequence expression are omitted, but this won't work in the basic expression editor)\nconst sequenceExpressionPlugin = {\n name: 'the plugin',\n init(thisJsep: any) {\n thisJsep.hooks.add('gobble-token', (env: any): void => {\n const { context } = env\n // token starts with\n if (!thisJsep.isIdentifierStart(context.code) && context.code === OPEN_PARENTHESIS_CODE) {\n context.index += 1\n let nodes = context.gobbleExpressions(CLOSE_PARENTHESIS_CODE)\n if (context.code === CLOSE_PARENTHESIS_CODE) {\n context.index += 1\n if (nodes.length > 0) {\n env.node = {\n type: SEQUENCE_EXPRESSION,\n expression: nodes[0],\n }\n }\n } else {\n context.throwError('Unclosed (')\n }\n }\n })\n },\n}\n\njsep.plugins.register(sequenceExpressionPlugin as jsep.IPlugin)\n\nexport { jsep }\n"]}
1
+ {"version":3,"file":"jsep.js","sourceRoot":"","sources":["../../../../src/expression/javascript/parser/jsep.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;QA0Cd,IAAI,GA1CN,cAAI;AACX,+DAA0C;AAE1C,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAoC,CAAC,CAAA;AAE3D,8CAA8C;AAC9C,cAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAA;AAEhC,MAAM,qBAAqB,GAAG,EAAE,CAAA,CAAC,IAAI;AACrC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,IAAI;AAEtC,MAAM,mBAAmB,GAAG,oBAAoB,CAAA;AAEhD,gGAAgG;AAChG,8IAA8I;AAC9I,MAAM,wBAAwB,GAAG;IAC/B,IAAI,EAAE,YAAY;IAClB,IAAI,CAAC,QAAa;QAChB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,GAAQ,EAAQ,EAAE;YACpD,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YACvB,oBAAoB;YACpB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;gBACxF,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;gBAClB,IAAI,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;gBAC7D,IAAI,OAAO,CAAC,IAAI,KAAK,sBAAsB,EAAE,CAAC;oBAC5C,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;oBAClB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACrB,GAAG,CAAC,IAAI,GAAG;4BACT,IAAI,EAAE,mBAAmB;4BACzB,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;yBACrB,CAAA;oBACH,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;gBAClC,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,wBAAwC,CAAC,CAAA","sourcesContent":["import jsep from 'jsep'\nimport jsepRegex from '@jsep-plugin/regex'\n\njsep.plugins.register(jsepRegex as unknown as jsep.IPlugin)\n\n// Add exponentiation operator (right-to-left)\njsep.addBinaryOp('**', 11, true)\n\nconst OPEN_PARENTHESIS_CODE = 40 // (\nconst CLOSE_PARENTHESIS_CODE = 41 // )\n\nconst SEQUENCE_EXPRESSION = 'SequenceExpression'\n\n// keep sequence expressions in parsed expression, even when there is only one node inside of it\n// (by default the unnecessary enclosing parenthesis of a sequence expression are omitted, but this won't work in the basic expression editor)\nconst sequenceExpressionPlugin = {\n name: 'the plugin',\n init(thisJsep: any) {\n thisJsep.hooks.add('gobble-token', (env: any): void => {\n const { context } = env\n // token starts with\n if (!thisJsep.isIdentifierStart(context.code) && context.code === OPEN_PARENTHESIS_CODE) {\n context.index += 1\n let nodes = context.gobbleExpressions(CLOSE_PARENTHESIS_CODE)\n if (context.code === CLOSE_PARENTHESIS_CODE) {\n context.index += 1\n if (nodes.length > 0) {\n env.node = {\n type: SEQUENCE_EXPRESSION,\n expression: nodes[0],\n }\n }\n } else {\n context.throwError('Unclosed (')\n }\n }\n })\n },\n}\n\njsep.plugins.register(sequenceExpressionPlugin as jsep.IPlugin)\n\nexport { jsep }\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/expression/javascript/parser/parser.ts"],"names":[],"mappings":";;;AAEA,iCAA6B;AAE7B,MAAa,0BAA0B;IACrC,KAAK,CAAC,UAAkB;QACtB,OAAO,IAAA,WAAI,EAAC,UAAU,CAAuC,CAAA;IAC/D,CAAC;CACF;AAJD,gEAIC","sourcesContent":["import { ExpressionNode, ExpressionNodeType } from '../../node'\nimport { ExpressionParser } from '../../parser'\nimport { jsep } from './jsep'\n\nexport class JavascriptExpressionParser implements ExpressionParser {\n parse(expression: string): ExpressionNode<ExpressionNodeType> {\n return jsep(expression) as ExpressionNode<ExpressionNodeType>\n }\n}\n"]}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/expression/javascript/parser/parser.ts"],"names":[],"mappings":";;;AAEA,iCAA6B;AAE7B;IACE,KAAK,CAAC,UAAkB;QACtB,OAAO,IAAA,WAAI,EAAC,UAAU,CAAuC,CAAA;IAC/D,CAAC;CACF","sourcesContent":["import { ExpressionNode, ExpressionNodeType } from '../../node'\nimport { ExpressionParser } from '../../parser'\nimport { jsep } from './jsep'\n\nexport class JavascriptExpressionParser implements ExpressionParser {\n parse(expression: string): ExpressionNode<ExpressionNodeType> {\n return jsep(expression) as ExpressionNode<ExpressionNodeType>\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/expression/node.ts"],"names":[],"mappings":";;;AAGA,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,kCAAlB,kBAAkB,QAY7B;AAsDD,MAAsB,uBAAuB;IAO3C,YAAY,SAAiC,EAAE,OAAU;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAGF;AAbD,0DAaC","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<ExpressionNode<ExpressionNodeType>>\n}\nexport interface BinaryExpression extends ExpressionNode<ExpressionNodeType.Binary> {\n left: ExpressionNode<ExpressionNodeType>\n right: ExpressionNode<ExpressionNodeType>\n operator: string\n}\nexport interface CallExpression extends ExpressionNode<ExpressionNodeType.Call> {\n arguments: Array<ExpressionNode<ExpressionNodeType>>\n callee: ExpressionNode<ExpressionNodeType>\n}\nexport type CompoundExpression = ExpressionNode<ExpressionNodeType.Compound>\nexport interface ConditionalExpression extends ExpressionNode<ExpressionNodeType.Conditional> {\n test: ExpressionNode<ExpressionNodeType>\n consequent: ExpressionNode<ExpressionNodeType>\n alternate: ExpressionNode<ExpressionNodeType>\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: ExpressionNode<ExpressionNodeType>\n property: ExpressionNode<ExpressionNodeType>\n optional?: boolean\n}\nexport interface SequenceExpression extends ExpressionNode<ExpressionNodeType.Sequence> {\n expression: ExpressionNode<ExpressionNodeType>\n}\nexport type ThisExpression = ExpressionNode<ExpressionNodeType.This>\nexport interface UnaryExpression extends ExpressionNode<ExpressionNodeType.Unary> {\n argument: ExpressionNode<ExpressionNodeType>\n operator: string\n prefix: boolean\n}\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,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,aAAlB,kBAAkB,GAAlB,kBAAkB,QAY7B;AAsDD;IAOE,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<ExpressionNode<ExpressionNodeType>>\n}\nexport interface BinaryExpression extends ExpressionNode<ExpressionNodeType.Binary> {\n left: ExpressionNode<ExpressionNodeType>\n right: ExpressionNode<ExpressionNodeType>\n operator: string\n}\nexport interface CallExpression extends ExpressionNode<ExpressionNodeType.Call> {\n arguments: Array<ExpressionNode<ExpressionNodeType>>\n callee: ExpressionNode<ExpressionNodeType>\n}\nexport type CompoundExpression = ExpressionNode<ExpressionNodeType.Compound>\nexport interface ConditionalExpression extends ExpressionNode<ExpressionNodeType.Conditional> {\n test: ExpressionNode<ExpressionNodeType>\n consequent: ExpressionNode<ExpressionNodeType>\n alternate: ExpressionNode<ExpressionNodeType>\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: ExpressionNode<ExpressionNodeType>\n property: ExpressionNode<ExpressionNodeType>\n optional?: boolean\n}\nexport interface SequenceExpression extends ExpressionNode<ExpressionNodeType.Sequence> {\n expression: ExpressionNode<ExpressionNodeType>\n}\nexport type ThisExpression = ExpressionNode<ExpressionNodeType.This>\nexport interface UnaryExpression extends ExpressionNode<ExpressionNodeType.Unary> {\n argument: ExpressionNode<ExpressionNodeType>\n operator: string\n prefix: boolean\n}\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 +1 @@
1
- {"version":3,"file":"variable.js","sourceRoot":"","sources":["../../src/expression/variable.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,0CAAoB,CAAA;AACtB,CAAC,EAFW,kBAAkB,kCAAlB,kBAAkB,QAE7B","sourcesContent":["export enum ExpressionVariable {\n CONTEXT = '$context',\n}\n"]}
1
+ {"version":3,"file":"variable.js","sourceRoot":"","sources":["../../src/expression/variable.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,0CAAoB,CAAA;AACtB,CAAC,EAFW,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QAE7B","sourcesContent":["export enum ExpressionVariable {\n CONTEXT = '$context',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extraProp.js","sourceRoot":"","sources":["../../src/extraProp/extraProp.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,oDAA+B,CAAA;AACjC,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B","sourcesContent":["export enum ExtraPropDataType {\n text = 'text',\n number = 'number',\n geometryPoint = 'geometryPoint',\n}\n\nexport interface ExtraPropDef {\n key: string\n dataType?: ExtraPropDataType\n}\n\nexport interface ExtraPropDefs {\n [key: string]: ExtraPropDef\n}\n"]}
1
+ {"version":3,"file":"extraProp.js","sourceRoot":"","sources":["../../src/extraProp/extraProp.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,oDAA+B,CAAA;AACjC,CAAC,EAJW,iBAAiB,aAAjB,iBAAiB,GAAjB,iBAAiB,QAI5B","sourcesContent":["export enum ExtraPropDataType {\n text = 'text',\n number = 'number',\n geometryPoint = 'geometryPoint',\n}\n\nexport interface ExtraPropDef {\n key: string\n dataType?: ExtraPropDataType\n}\n\nexport interface ExtraPropDefs {\n [key: string]: ExtraPropDef\n}\n"]}
@@ -1,10 +1,13 @@
1
1
  import { ExtraPropDataType, ExtraPropDef } from './extraProp';
2
2
  import { Survey } from '../survey';
3
+ declare const getDataType: (extraPropDef: ExtraPropDef) => ExtraPropDataType;
4
+ declare const convertValue: (params: {
5
+ survey: Survey;
6
+ extraPropDef: ExtraPropDef;
7
+ value: any;
8
+ }) => any;
3
9
  export declare const ExtraProps: {
4
- getDataType: (extraPropDef: ExtraPropDef) => ExtraPropDataType;
5
- convertValue: (params: {
6
- survey: Survey;
7
- extraPropDef: ExtraPropDef;
8
- value: any;
9
- }) => any;
10
+ getDataType: typeof getDataType;
11
+ convertValue: typeof convertValue;
10
12
  };
13
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"extraProps.js","sourceRoot":"","sources":["../../src/extraProp/extraProps.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAC7D,gCAA+B;AAE/B,oCAAkC;AAElC,MAAM,eAAe,GAAoF;IACvG,CAAC,6BAAiB,CAAC,aAAa,CAAC,EAAE,CAAC,MAAsB,EAAE,EAAE,CAAC,YAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IACzF,CAAC,6BAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,MAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5E,CAAC,6BAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,MAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;CAC3E,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,YAA0B,EAAqB,EAAE,WAAC,OAAA,MAAA,YAAY,CAAC,QAAQ,mCAAI,6BAAiB,CAAC,IAAI,CAAA,EAAA,CAAA;AAEtH,MAAM,YAAY,GAAG,CAAC,MAAkE,EAAE,EAAE;IAC1F,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAC9C,IAAI,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAEvC,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAA;IAC5D,OAAO,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;AACrC,CAAC,CAAA;AAEY,QAAA,UAAU,GAAG;IACxB,WAAW;IACX,YAAY;CACb,CAAA","sourcesContent":["import { ExtraPropDataType, ExtraPropDef } from './extraProp'\nimport { Points } from '../geo'\nimport { Survey } from '../survey'\nimport { Objects } from '../utils'\n\nconst covertersByType: { [key in ExtraPropDataType]: (params: { survey: Survey; value: any }) => any } = {\n [ExtraPropDataType.geometryPoint]: (params: { value: any }) => Points.parse(params.value),\n [ExtraPropDataType.number]: (params: { value: any }) => Number(params.value),\n [ExtraPropDataType.text]: (params: { value: any }) => String(params.value),\n}\n\nconst getDataType = (extraPropDef: ExtraPropDef): ExtraPropDataType => extraPropDef.dataType ?? ExtraPropDataType.text\n\nconst convertValue = (params: { survey: Survey; extraPropDef: ExtraPropDef; value: any }) => {\n const { survey, extraPropDef, value } = params\n if (Objects.isEmpty(value)) return null\n\n const converter = covertersByType[getDataType(extraPropDef)]\n return converter({ survey, value })\n}\n\nexport const ExtraProps = {\n getDataType,\n convertValue,\n}\n"]}
1
+ {"version":3,"file":"extraProps.js","sourceRoot":"","sources":["../../src/extraProp/extraProps.ts"],"names":[],"mappings":";;;AAAA,2CAA6D;AAC7D,gCAA+B;AAE/B,oCAAkC;AAElC,MAAM,eAAe,GAAoF;IACvG,CAAC,6BAAiB,CAAC,aAAa,CAAC,EAAE,CAAC,MAAsB,EAAE,EAAE,CAAC,YAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IACzF,CAAC,6BAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,MAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5E,CAAC,6BAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,MAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;CAC3E,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,YAA0B,EAAqB,EAAE,wBAAC,YAAY,CAAC,QAAQ,mCAAI,6BAAiB,CAAC,IAAI,GAAA,CAAA;AAEtH,MAAM,YAAY,GAAG,CAAC,MAAkE,EAAE,EAAE;IAC1F,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAC9C,IAAI,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAEvC,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAA;IAC5D,OAAO,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;AACrC,CAAC,CAAA;AAEY,QAAA,UAAU,GAAG;IACxB,WAAW;IACX,YAAY;CACb,CAAA","sourcesContent":["import { ExtraPropDataType, ExtraPropDef } from './extraProp'\nimport { Points } from '../geo'\nimport { Survey } from '../survey'\nimport { Objects } from '../utils'\n\nconst covertersByType: { [key in ExtraPropDataType]: (params: { survey: Survey; value: any }) => any } = {\n [ExtraPropDataType.geometryPoint]: (params: { value: any }) => Points.parse(params.value),\n [ExtraPropDataType.number]: (params: { value: any }) => Number(params.value),\n [ExtraPropDataType.text]: (params: { value: any }) => String(params.value),\n}\n\nconst getDataType = (extraPropDef: ExtraPropDef): ExtraPropDataType => extraPropDef.dataType ?? ExtraPropDataType.text\n\nconst convertValue = (params: { survey: Survey; extraPropDef: ExtraPropDef; value: any }) => {\n const { survey, extraPropDef, value } = params\n if (Objects.isEmpty(value)) return null\n\n const converter = covertersByType[getDataType(extraPropDef)]\n return converter({ survey, value })\n}\n\nexport const ExtraProps = {\n getDataType,\n convertValue,\n}\n"]}
@@ -1,8 +1,10 @@
1
1
  import { ExtraPropDefs } from './extraProp';
2
+ declare const generateData: (params: {
3
+ extraPropDefs: ExtraPropDefs;
4
+ }) => {
5
+ [key: string]: any;
6
+ };
2
7
  export declare const ExtraPropsDataGenerator: {
3
- generateData: (params: {
4
- extraPropDefs: ExtraPropDefs;
5
- }) => {
6
- [key: string]: any;
7
- };
8
+ generateData: typeof generateData;
8
9
  };
10
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"pointFactory.js","sourceRoot":"","sources":["../../src/geo/pointFactory.ts"],"names":[],"mappings":";;;AACA,gCAAoC;AAYvB,QAAA,YAAY,GAAuC;IAC9D,cAAc,EAAE,CAAC,MAA0B,EAAS,EAAE;;QACpD,uCAAY,MAAM,KAAE,GAAG,EAAE,MAAA,MAAM,CAAC,GAAG,mCAAI,iBAAW,CAAC,IAAI,IAAE;IAC3D,CAAC;CACF,CAAA","sourcesContent":["import { Factory } from '../common'\nimport { DEFAULT_SRS } from '../srs'\nimport { Point } from './point'\n\nexport type PointFactoryParams = {\n srs?: string\n x: number\n y: number\n accuracy?: number\n altitude?: number\n altitudeAccuracy?: number\n}\n\nexport const PointFactory: Factory<Point, PointFactoryParams> = {\n createInstance: (params: PointFactoryParams): Point => {\n return { ...params, srs: params.srs ?? DEFAULT_SRS.code }\n },\n}\n"]}
1
+ {"version":3,"file":"pointFactory.js","sourceRoot":"","sources":["../../src/geo/pointFactory.ts"],"names":[],"mappings":";;;AACA,gCAAoC;AAYvB,QAAA,YAAY,GAAuC;IAC9D,cAAc,EAAE,CAAC,MAA0B,EAAS,EAAE;;QACpD,uCAAY,MAAM,KAAE,GAAG,QAAE,MAAM,CAAC,GAAG,mCAAI,iBAAW,CAAC,IAAI,IAAE;IAC3D,CAAC;CACF,CAAA","sourcesContent":["import { Factory } from '../common'\nimport { DEFAULT_SRS } from '../srs'\nimport { Point } from './point'\n\nexport type PointFactoryParams = {\n srs?: string\n x: number\n y: number\n accuracy?: number\n altitude?: number\n altitudeAccuracy?: number\n}\n\nexport const PointFactory: Factory<Point, PointFactoryParams> = {\n createInstance: (params: PointFactoryParams): Point => {\n return { ...params, srs: params.srs ?? DEFAULT_SRS.code }\n },\n}\n"]}
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.bearing = void 0;
4
- const bearing_1 = require("@turf/bearing");
7
+ const bearing_1 = __importDefault(require("@turf/bearing"));
5
8
  const srs_1 = require("../../srs");
6
9
  const toLatLong_1 = require("./toLatLong");
7
10
  const utils_1 = require("../../utils");
@@ -23,7 +26,7 @@ const bearing = (pointFrom, pointTo, srsIndex = srs_1.DEFAULT_SRS_INDEX) => {
23
26
  const from = [point1LatLong.x, point1LatLong.y];
24
27
  const to = [point2LatLong.x, point2LatLong.y];
25
28
  // Turf returns bearings in the range [-180, 180]; normalize to [0, 360)
26
- const rawBearing = (0, bearing_1.bearing)(from, to);
29
+ const rawBearing = (0, bearing_1.default)(from, to);
27
30
  return utils_1.Numbers.absMod(360)(rawBearing);
28
31
  };
29
32
  exports.bearing = bearing;
@@ -1 +1 @@
1
- {"version":3,"file":"bearing.js","sourceRoot":"","sources":["../../../src/geo/points/bearing.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AAGtD,mCAAuD;AACvD,2CAAuC;AACvC,uCAAqC;AAErC;;;;;;;;GAQG;AACI,MAAM,OAAO,GAAG,CAAC,SAAgB,EAAE,OAAc,EAAE,WAAqB,uBAAiB,EAAiB,EAAE;IACjH,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAElD,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAEjD,4CAA4C;IAC5C,MAAM,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAC/C,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAE7C,wEAAwE;IACxE,MAAM,UAAU,GAAG,IAAA,iBAAW,EAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACxC,OAAO,eAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAA;AACxC,CAAC,CAAA;AAbY,QAAA,OAAO,WAanB","sourcesContent":["import { bearing as bearingTurf } from '@turf/bearing'\n\nimport { Point } from '../point'\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { toLatLong } from './toLatLong'\nimport { Numbers } from '../../utils'\n\n/**\n * Calculates the angle (bearing) in degrees from pointFrom to pointTo.\n * Returns the clockwise angle from north (0° = north, 90° = east, 180° = south, 270° = west).\n *\n * @param {!object} pointFrom - Start point.\n * @param {!object} pointTo - End point.\n * @param {!SRSIndex} srsIndex - SRSs indexed by SRS code.\n * @returns {number} - Bearing angle in degrees [0-360).\n */\nexport const bearing = (pointFrom: Point, pointTo: Point, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): number | null => {\n const point1LatLong = toLatLong(pointFrom, srsIndex)\n const point2LatLong = toLatLong(pointTo, srsIndex)\n\n if (!point1LatLong || !point2LatLong) return null\n\n // Turf expects [longitude, latitude] format\n const from = [point1LatLong.x, point1LatLong.y]\n const to = [point2LatLong.x, point2LatLong.y]\n\n // Turf returns bearings in the range [-180, 180]; normalize to [0, 360)\n const rawBearing = bearingTurf(from, to)\n return Numbers.absMod(360)(rawBearing)\n}\n"]}
1
+ {"version":3,"file":"bearing.js","sourceRoot":"","sources":["../../../src/geo/points/bearing.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAuC;AAGvC,mCAAuD;AACvD,2CAAuC;AACvC,uCAAqC;AAErC;;;;;;;;GAQG;AACI,MAAM,OAAO,GAAG,CAAC,SAAgB,EAAE,OAAc,EAAE,QAAQ,GAAa,uBAAiB,EAAiB,EAAE;IACjH,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAElD,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAEjD,4CAA4C;IAC5C,MAAM,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAC/C,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAE7C,wEAAwE;IACxE,MAAM,UAAU,GAAG,IAAA,iBAAW,EAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACxC,OAAO,eAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAA;AACxC,CAAC,CAAA;AAbY,QAAA,OAAO,GAAP,OAAO,CAanB","sourcesContent":["import bearingTurf from '@turf/bearing'\n\nimport { Point } from '../point'\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { toLatLong } from './toLatLong'\nimport { Numbers } from '../../utils'\n\n/**\n * Calculates the angle (bearing) in degrees from pointFrom to pointTo.\n * Returns the clockwise angle from north (0° = north, 90° = east, 180° = south, 270° = west).\n *\n * @param {!object} pointFrom - Start point.\n * @param {!object} pointTo - End point.\n * @param {!SRSIndex} srsIndex - SRSs indexed by SRS code.\n * @returns {number} - Bearing angle in degrees [0-360).\n */\nexport const bearing = (pointFrom: Point, pointTo: Point, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): number | null => {\n const point1LatLong = toLatLong(pointFrom, srsIndex)\n const point2LatLong = toLatLong(pointTo, srsIndex)\n\n if (!point1LatLong || !point2LatLong) return null\n\n // Turf expects [longitude, latitude] format\n const from = [point1LatLong.x, point1LatLong.y]\n const to = [point2LatLong.x, point2LatLong.y]\n\n // Turf returns bearings in the range [-180, 180]; normalize to [0, 360)\n const rawBearing = bearingTurf(from, to)\n return Numbers.absMod(360)(rawBearing)\n}\n"]}
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.distance = void 0;
4
- const distance_1 = require("@turf/distance");
7
+ const distance_1 = __importDefault(require("@turf/distance"));
5
8
  const srs_1 = require("../../srs");
6
9
  const toLatLong_1 = require("./toLatLong");
7
10
  /**
@@ -20,7 +23,7 @@ const distance = (pointFrom, pointTo, srsIndex = srs_1.DEFAULT_SRS_INDEX) => {
20
23
  // Turf expects [longitude, latitude] format
21
24
  const from = [point1LatLong.x, point1LatLong.y];
22
25
  const to = [point2LatLong.x, point2LatLong.y];
23
- return (0, distance_1.distance)(from, to, { units: 'meters' });
26
+ return (0, distance_1.default)(from, to, { units: 'meters' });
24
27
  };
25
28
  exports.distance = distance;
26
29
  //# sourceMappingURL=distance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"distance.js","sourceRoot":"","sources":["../../../src/geo/points/distance.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AACzD,mCAAuD;AAEvD,2CAAuC;AAEvC;;;;;;;GAOG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAgB,EAAE,OAAc,EAAE,WAAqB,uBAAiB,EAAiB,EAAE;IAClH,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAElD,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAEjD,4CAA4C;IAC5C,MAAM,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAC/C,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAE7C,OAAO,IAAA,mBAAY,EAAC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;AACpD,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { distance as turfDistance } from '@turf/distance'\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { toLatLong } from './toLatLong'\n\n/**\n * Takes two points and returns the distance between them as the crow flies (in meters).\n *\n * @param {!object} pointFrom - Start point.\n * @param {!object} pointTo - End point.\n * @param {!SRSIndex} srsIndex - SRSs indexed by SRS code.\n * @returns {number} - Distance between the specified points in meters.\n */\nexport const distance = (pointFrom: Point, pointTo: Point, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): number | null => {\n const point1LatLong = toLatLong(pointFrom, srsIndex)\n const point2LatLong = toLatLong(pointTo, srsIndex)\n\n if (!point1LatLong || !point2LatLong) return null\n\n // Turf expects [longitude, latitude] format\n const from = [point1LatLong.x, point1LatLong.y]\n const to = [point2LatLong.x, point2LatLong.y]\n\n return turfDistance(from, to, { units: 'meters' })\n}\n"]}
1
+ {"version":3,"file":"distance.js","sourceRoot":"","sources":["../../../src/geo/points/distance.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAyC;AACzC,mCAAuD;AAEvD,2CAAuC;AAEvC;;;;;;;GAOG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAgB,EAAE,OAAc,EAAE,QAAQ,GAAa,uBAAiB,EAAiB,EAAE;IAClH,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IAElD,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAEjD,4CAA4C;IAC5C,MAAM,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAC/C,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAE7C,OAAO,IAAA,kBAAY,EAAC,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;AACpD,CAAC,CAAA;AAXY,QAAA,QAAQ,GAAR,QAAQ,CAWpB","sourcesContent":["import turfDistance from '@turf/distance'\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { toLatLong } from './toLatLong'\n\n/**\n * Takes two points and returns the distance between them as the crow flies (in meters).\n *\n * @param {!object} pointFrom - Start point.\n * @param {!object} pointTo - End point.\n * @param {!SRSIndex} srsIndex - SRSs indexed by SRS code.\n * @returns {number} - Distance between the specified points in meters.\n */\nexport const distance = (pointFrom: Point, pointTo: Point, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): number | null => {\n const point1LatLong = toLatLong(pointFrom, srsIndex)\n const point2LatLong = toLatLong(pointTo, srsIndex)\n\n if (!point1LatLong || !point2LatLong) return null\n\n // Turf expects [longitude, latitude] format\n const from = [point1LatLong.x, point1LatLong.y]\n const to = [point2LatLong.x, point2LatLong.y]\n\n return turfDistance(from, to, { units: 'meters' })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"equals.js","sourceRoot":"","sources":["../../../src/geo/points/equals.ts"],"names":[],"mappings":";;;AAEO,MAAM,MAAM,GAAG,CAAC,MAAa,EAAE,MAAa,EAAW,EAAE;IAC9D,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAA;IAClC,OAAO,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAA;AACpF,CAAC,CAAA;AAHY,QAAA,MAAM,UAGlB","sourcesContent":["import { Point } from '../point'\n\nexport const equals = (point1: Point, point2: Point): boolean => {\n if (point1 === point2) return true\n return point1.srs === point2.srs && point1.x === point2.x && point1.y === point2.y\n}\n"]}
1
+ {"version":3,"file":"equals.js","sourceRoot":"","sources":["../../../src/geo/points/equals.ts"],"names":[],"mappings":";;;AAEO,MAAM,MAAM,GAAG,CAAC,MAAa,EAAE,MAAa,EAAW,EAAE;IAC9D,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAA;IAClC,OAAO,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAA;AACpF,CAAC,CAAA;AAHY,QAAA,MAAM,GAAN,MAAM,CAGlB","sourcesContent":["import { Point } from '../point'\n\nexport const equals = (point1: Point, point2: Point): boolean => {\n if (point1 === point2) return true\n return point1.srs === point2.srs && point1.x === point2.x && point1.y === point2.y\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getSrs.js","sourceRoot":"","sources":["../../../src/geo/points/getSrs.ts"],"names":[],"mappings":";;;AAAA,mCAAsD;AAE/C,MAAM,MAAM,GAAG,CAAC,MAA4C,EAAmB,EAAE;IACtF,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IACjC,IAAI,IAAI,KAAK,iBAAW,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,iBAAW,CAAA;IACpB,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC,CAAA;AANY,QAAA,MAAM,UAMlB","sourcesContent":["import { DEFAULT_SRS, SRS, SRSIndex } from '../../srs'\n\nexport const getSrs = (params: { code: string; srsIndex: SRSIndex }): SRS | undefined => {\n const { code, srsIndex } = params\n if (code === DEFAULT_SRS.code) {\n return DEFAULT_SRS\n }\n return srsIndex[code]\n}\n"]}
1
+ {"version":3,"file":"getSrs.js","sourceRoot":"","sources":["../../../src/geo/points/getSrs.ts"],"names":[],"mappings":";;;AAAA,mCAAsD;AAE/C,MAAM,MAAM,GAAG,CAAC,MAA4C,EAAmB,EAAE;IACtF,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;IACjC,IAAI,IAAI,KAAK,iBAAW,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,iBAAW,CAAA;IACpB,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC,CAAA;AANY,QAAA,MAAM,GAAN,MAAM,CAMlB","sourcesContent":["import { DEFAULT_SRS, SRS, SRSIndex } from '../../srs'\n\nexport const getSrs = (params: { code: string; srsIndex: SRSIndex }): SRS | undefined => {\n const { code, srsIndex } = params\n if (code === DEFAULT_SRS.code) {\n return DEFAULT_SRS\n }\n return srsIndex[code]\n}\n"]}
@@ -1,16 +1,20 @@
1
+ import { bearing } from './bearing';
2
+ import { distance } from './distance';
3
+ import { equals } from './equals';
4
+ import { isValid } from './isValid';
5
+ import { pointAtDistance } from './pointAtDistance';
6
+ import { parse } from './parse';
7
+ import { toLatLong } from './toLatLong';
8
+ import { toString } from './toString';
9
+ import { transform } from './transform';
1
10
  export declare const Points: {
2
- bearing: (pointFrom: import("..").Point, pointTo: import("..").Point, srsIndex?: import("../..").SRSIndex) => number | null;
3
- distance: (pointFrom: import("..").Point, pointTo: import("..").Point, srsIndex?: import("../..").SRSIndex) => number | null;
4
- equals: (point1: import("..").Point, point2: import("..").Point) => boolean;
5
- isValid: (point: import("..").Point, srsIndex?: import("../..").SRSIndex) => boolean;
6
- pointAtDistance: ({ origin, distanceMeters, bearingDeg, srsIndex, }: {
7
- origin: import("..").Point;
8
- distanceMeters: number;
9
- bearingDeg: number;
10
- srsIndex?: import("../..").SRSIndex;
11
- }) => import("..").Point | null;
12
- parse: (value: string | object) => import("..").Point | null;
13
- toLatLong: (point: import("..").Point, srsIndex: import("../..").SRSIndex) => import("..").Point | null;
14
- toString: (point: import("..").Point) => string;
15
- transform: (point: import("..").Point, srsCodeTo: string, srsIndex?: import("../..").SRSIndex) => import("..").Point | null;
11
+ bearing: typeof bearing;
12
+ distance: typeof distance;
13
+ equals: typeof equals;
14
+ isValid: typeof isValid;
15
+ pointAtDistance: typeof pointAtDistance;
16
+ parse: typeof parse;
17
+ toLatLong: typeof toLatLong;
18
+ toString: typeof toString;
19
+ transform: typeof transform;
16
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"isFilled.js","sourceRoot":"","sources":["../../../src/geo/points/isFilled.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAG9B,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAW,EAAE,CAChD,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AADrG,QAAA,QAAQ,YAC6F","sourcesContent":["import { Objects } from '../../utils'\nimport { Point } from '../point'\n\nexport const isFilled = (point: Point): boolean =>\n !Objects.isEmpty(point) && !Objects.isEmpty(point.srs) && !Objects.isEmpty(point.x) && !Objects.isEmpty(point.y)\n"]}
1
+ {"version":3,"file":"isFilled.js","sourceRoot":"","sources":["../../../src/geo/points/isFilled.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAG9B,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAW,EAAE,CAChD,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AADrG,QAAA,QAAQ,GAAR,QAAQ,CAC6F","sourcesContent":["import { Objects } from '../../utils'\nimport { Point } from '../point'\n\nexport const isFilled = (point: Point): boolean =>\n !Objects.isEmpty(point) && !Objects.isEmpty(point.srs) && !Objects.isEmpty(point.x) && !Objects.isEmpty(point.y)\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"isValid.js","sourceRoot":"","sources":["../../../src/geo/points/isValid.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AACvD,uCAAqC;AAErC,kDAA8C;AAC9C,qCAAiC;AACjC,qCAAiC;AACjC,yCAAqC;AACrC,2CAAuC;AAEvC,MAAM,sBAAsB,GAAU,2BAAY,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA,CAAC,yEAAyE;AAErJ,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,WAAqB,uBAAiB,EAAW,EAAE;IACvF,IAAI,CAAC,KAAK,IAAI,CAAC,IAAA,mBAAQ,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAE5C,IAAI,CAAC,IAAA,eAAM,EAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;QAAE,OAAO,KAAK,CAAA;IAExD,MAAM,YAAY,GAAG,IAAA,qBAAS,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,IAAI,CAAC,YAAY,IAAI,IAAA,eAAM,EAAC,YAAY,EAAE,sBAAsB,CAAC;QAAE,OAAO,KAAK,CAAA;IAE/E,OAAO,eAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,eAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;AAC/F,CAAC,CAAA;AATY,QAAA,OAAO,WASnB","sourcesContent":["import { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Numbers } from '../../utils'\nimport { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { equals } from './equals'\nimport { getSrs } from './getSrs'\nimport { isFilled } from './isFilled'\nimport { toLatLong } from './toLatLong'\n\nconst INVALID_LAT_LONG_POINT: Point = PointFactory.createInstance({ x: 0, y: 90 }) // Proj4 returns [0,90] when a wrong coordinate is projected into lat-lon\n\nexport const isValid = (point: Point, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): boolean => {\n if (!point || !isFilled(point)) return false\n\n if (!getSrs({ code: point.srs, srsIndex })) return false\n\n const pointLatLong = toLatLong(point, srsIndex)\n if (!pointLatLong || equals(pointLatLong, INVALID_LAT_LONG_POINT)) return false\n\n return Numbers.between(pointLatLong.x, -180, 180) && Numbers.between(pointLatLong.y, -90, 90)\n}\n"]}
1
+ {"version":3,"file":"isValid.js","sourceRoot":"","sources":["../../../src/geo/points/isValid.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AACvD,uCAAqC;AAErC,kDAA8C;AAC9C,qCAAiC;AACjC,qCAAiC;AACjC,yCAAqC;AACrC,2CAAuC;AAEvC,MAAM,sBAAsB,GAAU,2BAAY,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA,CAAC,yEAAyE;AAErJ,MAAM,OAAO,GAAG,CAAC,KAAY,EAAE,QAAQ,GAAa,uBAAiB,EAAW,EAAE;IACvF,IAAI,CAAC,KAAK,IAAI,CAAC,IAAA,mBAAQ,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAE5C,IAAI,CAAC,IAAA,eAAM,EAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;QAAE,OAAO,KAAK,CAAA;IAExD,MAAM,YAAY,GAAG,IAAA,qBAAS,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,IAAI,CAAC,YAAY,IAAI,IAAA,eAAM,EAAC,YAAY,EAAE,sBAAsB,CAAC;QAAE,OAAO,KAAK,CAAA;IAE/E,OAAO,eAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,eAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;AAC/F,CAAC,CAAA;AATY,QAAA,OAAO,GAAP,OAAO,CASnB","sourcesContent":["import { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Numbers } from '../../utils'\nimport { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { equals } from './equals'\nimport { getSrs } from './getSrs'\nimport { isFilled } from './isFilled'\nimport { toLatLong } from './toLatLong'\n\nconst INVALID_LAT_LONG_POINT: Point = PointFactory.createInstance({ x: 0, y: 90 }) // Proj4 returns [0,90] when a wrong coordinate is projected into lat-lon\n\nexport const isValid = (point: Point, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): boolean => {\n if (!point || !isFilled(point)) return false\n\n if (!getSrs({ code: point.srs, srsIndex })) return false\n\n const pointLatLong = toLatLong(point, srsIndex)\n if (!pointLatLong || equals(pointLatLong, INVALID_LAT_LONG_POINT)) return false\n\n return Numbers.between(pointLatLong.x, -180, 180) && Numbers.between(pointLatLong.y, -90, 90)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/geo/points/parse.ts"],"names":[],"mappings":";;;AACA,kDAA8C;AAE9C,MAAM,WAAW,GAAG,+DAA+D,CAAA;AAEnF;;;;;;;;GAQG;AACI,MAAM,KAAK,GAAG,CAAC,KAAsB,EAAgB,EAAE;IAC5D,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAc,CAAA;IAEpD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACrC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA;QAEvB,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1B,OAAO,2BAAY,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAfY,QAAA,KAAK,SAejB","sourcesContent":["import { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\n\nconst POINT_REGEX = /SRID=((EPSG:)?(\\w+));POINT\\((-?\\d+(\\.\\d+)?) (-?\\d+(\\.\\d+)?)\\)/\n\n/**\n * Parses a point in the format: SRID=SRS_CODE;POINT(X Y)\n * (X and Y separated by a space). Valid examples are:\n * - SRID=EPSG:4326;POINT(12.489060 41.882788)\n * - SRID=4326;POINT(12 41).\n *\n * @param {!(string | object)} value - The point to parse. It can be a string or an object.\n * @returns {Point} - The parsed Point object.\n */\nexport const parse = (value: string | object): Point | null => {\n if (!value) return null\n\n if (typeof value === 'object') return value as Point\n\n if (typeof value === 'string') {\n const match = POINT_REGEX.exec(value)\n if (!match) return null\n\n const srs = match[3]\n const x = Number(match[4])\n const y = Number(match[6])\n return PointFactory.createInstance({ srs, x, y })\n }\n return null\n}\n"]}
1
+ {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/geo/points/parse.ts"],"names":[],"mappings":";;;AACA,kDAA8C;AAE9C,MAAM,WAAW,GAAG,+DAA+D,CAAA;AAEnF;;;;;;;;GAQG;AACI,MAAM,KAAK,GAAG,CAAC,KAAsB,EAAgB,EAAE;IAC5D,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAc,CAAA;IAEpD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACrC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA;QAEvB,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1B,OAAO,2BAAY,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAfY,QAAA,KAAK,GAAL,KAAK,CAejB","sourcesContent":["import { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\n\nconst POINT_REGEX = /SRID=((EPSG:)?(\\w+));POINT\\((-?\\d+(\\.\\d+)?) (-?\\d+(\\.\\d+)?)\\)/\n\n/**\n * Parses a point in the format: SRID=SRS_CODE;POINT(X Y)\n * (X and Y separated by a space). Valid examples are:\n * - SRID=EPSG:4326;POINT(12.489060 41.882788)\n * - SRID=4326;POINT(12 41).\n *\n * @param {!(string | object)} value - The point to parse. It can be a string or an object.\n * @returns {Point} - The parsed Point object.\n */\nexport const parse = (value: string | object): Point | null => {\n if (!value) return null\n\n if (typeof value === 'object') return value as Point\n\n if (typeof value === 'string') {\n const match = POINT_REGEX.exec(value)\n if (!match) return null\n\n const srs = match[3]\n const x = Number(match[4])\n const y = Number(match[6])\n return PointFactory.createInstance({ srs, x, y })\n }\n return null\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pointAtDistance.js","sourceRoot":"","sources":["../../../src/geo/points/pointAtDistance.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA+C;AAE/C,mCAAuD;AAEvD,kDAA8C;AAC9C,2CAAuC;AACvC,2CAAuC;AACvC,uCAAmC;AAEnC;;;;;;;;GAQG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,MAAM,EACN,cAAc,EACd,UAAU,EACV,QAAQ,GAAG,uBAAiB,GAM7B,EAAgB,EAAE;IACjB,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAEjD,6EAA6E;IAC7E,IAAI,CAAC,aAAa,IAAI,CAAC,IAAA,iBAAO,EAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,CAAC;QACxD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,qBAAe,EAAC,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;IACnH,MAAM,kBAAkB,GAAG,2BAAY,CAAC,cAAc,CAAC;QACrD,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QACjC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;KAClC,CAAC,CAAA;IACF,OAAO,IAAA,qBAAS,EAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;AAC5D,CAAC,CAAA;AA7BY,QAAA,eAAe,mBA6B3B","sourcesContent":["import turfDestination from '@turf/destination'\n\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { toLatLong } from './toLatLong'\nimport { transform } from './transform'\nimport { isValid } from './isValid'\n\n/**\n * Takes a point, a distance in meters, and a bearing in degrees, and returns the location of the point at the specified distance and bearing from the original point.\n * @param params\n * @param params.origin - The original point from which to calculate the new location.\n * @param params.distanceMeters - The distance in meters from the original point to the new location.\n * @param params.bearingDeg - The bearing in degrees from the original point to the new location.\n * @param params.srsIndex - SRSs indexed by SRS code.\n * @returns The new point at the specified distance and bearing from the original point, or null if the calculation fails.\n */\nexport const pointAtDistance = ({\n origin,\n distanceMeters,\n bearingDeg,\n srsIndex = DEFAULT_SRS_INDEX,\n}: {\n origin: Point\n distanceMeters: number\n bearingDeg: number\n srsIndex?: SRSIndex\n}): Point | null => {\n const originLatLong = toLatLong(origin, srsIndex)\n\n // Validate numeric inputs and lat/long bounds before calling turfDestination\n if (!originLatLong || !isValid(originLatLong, srsIndex)) {\n return null\n }\n if (!Number.isFinite(distanceMeters) || distanceMeters < 0) {\n return null\n }\n if (!Number.isFinite(bearingDeg)) {\n return null\n }\n const target = turfDestination([originLatLong.x, originLatLong.y], distanceMeters, bearingDeg, { units: 'meters' })\n const targetPointLatLong = PointFactory.createInstance({\n x: target.geometry.coordinates[0],\n y: target.geometry.coordinates[1],\n })\n return transform(targetPointLatLong, origin.srs, srsIndex)\n}\n"]}
1
+ {"version":3,"file":"pointAtDistance.js","sourceRoot":"","sources":["../../../src/geo/points/pointAtDistance.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA+C;AAE/C,mCAAuD;AAEvD,kDAA8C;AAC9C,2CAAuC;AACvC,2CAAuC;AACvC,uCAAmC;AAEnC;;;;;;;;GAQG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,MAAM,EACN,cAAc,EACd,UAAU,EACV,QAAQ,GAAG,uBAAiB,GAM7B,EAAgB,EAAE;IACjB,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAEjD,6EAA6E;IAC7E,IAAI,CAAC,aAAa,IAAI,CAAC,IAAA,iBAAO,EAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,CAAC;QACxD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,qBAAe,EAAC,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;IACnH,MAAM,kBAAkB,GAAG,2BAAY,CAAC,cAAc,CAAC;QACrD,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QACjC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;KAClC,CAAC,CAAA;IACF,OAAO,IAAA,qBAAS,EAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;AAC5D,CAAC,CAAA;AA7BY,QAAA,eAAe,GAAf,eAAe,CA6B3B","sourcesContent":["import turfDestination from '@turf/destination'\n\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { toLatLong } from './toLatLong'\nimport { transform } from './transform'\nimport { isValid } from './isValid'\n\n/**\n * Takes a point, a distance in meters, and a bearing in degrees, and returns the location of the point at the specified distance and bearing from the original point.\n * @param params\n * @param params.origin - The original point from which to calculate the new location.\n * @param params.distanceMeters - The distance in meters from the original point to the new location.\n * @param params.bearingDeg - The bearing in degrees from the original point to the new location.\n * @param params.srsIndex - SRSs indexed by SRS code.\n * @returns The new point at the specified distance and bearing from the original point, or null if the calculation fails.\n */\nexport const pointAtDistance = ({\n origin,\n distanceMeters,\n bearingDeg,\n srsIndex = DEFAULT_SRS_INDEX,\n}: {\n origin: Point\n distanceMeters: number\n bearingDeg: number\n srsIndex?: SRSIndex\n}): Point | null => {\n const originLatLong = toLatLong(origin, srsIndex)\n\n // Validate numeric inputs and lat/long bounds before calling turfDestination\n if (!originLatLong || !isValid(originLatLong, srsIndex)) {\n return null\n }\n if (!Number.isFinite(distanceMeters) || distanceMeters < 0) {\n return null\n }\n if (!Number.isFinite(bearingDeg)) {\n return null\n }\n const target = turfDestination([originLatLong.x, originLatLong.y], distanceMeters, bearingDeg, { units: 'meters' })\n const targetPointLatLong = PointFactory.createInstance({\n x: target.geometry.coordinates[0],\n y: target.geometry.coordinates[1],\n })\n return transform(targetPointLatLong, origin.srs, srsIndex)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"toLatLong.js","sourceRoot":"","sources":["../../../src/geo/points/toLatLong.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAEjD,2CAAuC;AAEhC,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,QAAkB,EAAgB,EAAE,CAC1E,IAAA,qBAAS,EAAC,KAAK,EAAE,iBAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AADjC,QAAA,SAAS,aACwB","sourcesContent":["import { DEFAULT_SRS, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { transform } from './transform'\n\nexport const toLatLong = (point: Point, srsIndex: SRSIndex): Point | null =>\n transform(point, DEFAULT_SRS.code, srsIndex)\n"]}
1
+ {"version":3,"file":"toLatLong.js","sourceRoot":"","sources":["../../../src/geo/points/toLatLong.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AAEjD,2CAAuC;AAEhC,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,QAAkB,EAAgB,EAAE,CAC1E,IAAA,qBAAS,EAAC,KAAK,EAAE,iBAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AADjC,QAAA,SAAS,GAAT,SAAS,CACwB","sourcesContent":["import { DEFAULT_SRS, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { transform } from './transform'\n\nexport const toLatLong = (point: Point, srsIndex: SRSIndex): Point | null =>\n transform(point, DEFAULT_SRS.code, srsIndex)\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"toString.js","sourceRoot":"","sources":["../../../src/geo/points/toString.ts"],"names":[],"mappings":";;;AAEO,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAU,EAAE,CAAC,QAAQ,KAAK,CAAC,GAAG,UAAU,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAA;AAArF,QAAA,QAAQ,YAA6E","sourcesContent":["import { Point } from '../point'\n\nexport const toString = (point: Point): string => `SRID=${point.srs};POINT(${point.x} ${point.y})`\n"]}
1
+ {"version":3,"file":"toString.js","sourceRoot":"","sources":["../../../src/geo/points/toString.ts"],"names":[],"mappings":";;;AAEO,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAU,EAAE,CAAC,QAAQ,KAAK,CAAC,GAAG,UAAU,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAA;AAArF,QAAA,QAAQ,GAAR,QAAQ,CAA6E","sourcesContent":["import { Point } from '../point'\n\nexport const toString = (point: Point): string => `SRID=${point.srs};POINT(${point.x} ${point.y})`\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/geo/points/transform.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEzB,mCAAuD;AAEvD,kDAA8C;AAC9C,yCAAqC;AACrC,qCAAiC;AAEjC,oGAAoG;AACpG,MAAM,eAAe,GAAG,IAAI,GAAG,EAA2B,CAAA;AAE1D,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAmB,EAAE;IACvE,MAAM,GAAG,GAAG,GAAG,OAAO,KAAK,KAAK,EAAE,CAAA;IAClC,IAAI,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,IAAA,eAAK,EAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACjC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CA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,CAAC,CAAA;AA5BY,QAAA,SAAS,aA4BrB","sourcesContent":["import proj4 from 'proj4'\n\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { isFilled } from './isFilled'\nimport { getSrs } from './getSrs'\n\n// proj4 parses both WKT strings every time it is called with them: cache the converters by WKT pair\nconst convertersCache = new Map<string, proj4.Converter>()\n\nconst getConverter = (wktFrom: string, wktTo: string): proj4.Converter => {\n const key = `${wktFrom}\\n${wktTo}`\n let converter = convertersCache.get(key)\n if (!converter) {\n converter = proj4(wktFrom, wktTo)\n convertersCache.set(key, converter)\n }\n return converter\n}\n\n/**\n * Trasforms the specified point from one SRS into another.\n *\n * @param {!Point} point - The point to transform.\n * @param {!string} srsCodeTo - The SRS code to transform the coordinate into.\n * @param {SRSIndex} srsIndex - SRSs indexed by SRS code.\n * @returns {Point|null} - The transformed Point object, null if an error occurred.\n */\nexport const transform = (point: Point, srsCodeTo: string, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): Point | null => {\n if (!isFilled(point)) return null\n\n const { srs: srsCodeFrom } = point\n\n if (srsCodeFrom === srsCodeTo) {\n // projection is not needed\n return point\n }\n const srsFrom = getSrs({ code: srsCodeFrom, srsIndex })\n if (!srsFrom) {\n // invalid srs specified in point\n return null\n }\n\n const srsTo = getSrs({ code: srsCodeTo, srsIndex })\n if (!srsTo) {\n // invalid target srs code\n return null\n }\n try {\n const { x, y } = point\n const [long, lat] = getConverter(srsFrom.wkt, srsTo.wkt).forward([Number(x), Number(y)])\n\n return PointFactory.createInstance({ ...point, srs: srsCodeTo, x: long, y: lat })\n } catch {\n return null\n }\n}\n"]}
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/geo/points/transform.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAE7C,mCAAuD;AAEvD,kDAA8C;AAC9C,yCAAqC;AACrC,qCAAiC;AAEjC,oGAAoG;AACpG,MAAM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,IAAI,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAExF,OAAO,2BAAY,CAAC,cAAc,iCAAM,KAAK,KAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAG,CAAA;IACnF,CAAC;eAAO,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AA5BY,QAAA,SAAS,GAAT,SAAS,CA4BrB","sourcesContent":["import proj4, { type Converter } from 'proj4'\n\nimport { DEFAULT_SRS_INDEX, SRSIndex } from '../../srs'\nimport { Point } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { isFilled } from './isFilled'\nimport { getSrs } from './getSrs'\n\n// proj4 parses both WKT strings every time it is called with them: cache the converters by WKT pair\nconst convertersCache = new Map<string, Converter>()\n\nconst getConverter = (wktFrom: string, wktTo: string): Converter => {\n const key = `${wktFrom}\\n${wktTo}`\n let converter = convertersCache.get(key)\n if (!converter) {\n converter = proj4(wktFrom, wktTo)\n convertersCache.set(key, converter)\n }\n return converter\n}\n\n/**\n * Trasforms the specified point from one SRS into another.\n *\n * @param {!Point} point - The point to transform.\n * @param {!string} srsCodeTo - The SRS code to transform the coordinate into.\n * @param {SRSIndex} srsIndex - SRSs indexed by SRS code.\n * @returns {Point|null} - The transformed Point object, null if an error occurred.\n */\nexport const transform = (point: Point, srsCodeTo: string, srsIndex: SRSIndex = DEFAULT_SRS_INDEX): Point | null => {\n if (!isFilled(point)) return null\n\n const { srs: srsCodeFrom } = point\n\n if (srsCodeFrom === srsCodeTo) {\n // projection is not needed\n return point\n }\n const srsFrom = getSrs({ code: srsCodeFrom, srsIndex })\n if (!srsFrom) {\n // invalid srs specified in point\n return null\n }\n\n const srsTo = getSrs({ code: srsCodeTo, srsIndex })\n if (!srsTo) {\n // invalid target srs code\n return null\n }\n try {\n const { x, y } = point\n const [long, lat] = getConverter(srsFrom.wkt, srsTo.wkt).forward([Number(x), Number(y)])\n\n return PointFactory.createInstance({ ...point, srs: srsCodeTo, x: long, y: lat })\n } catch {\n return null\n }\n}\n"]}
@@ -347,15 +347,16 @@ class JobBase {
347
347
  */
348
348
  onInnerJobEvent(event) {
349
349
  return __awaiter(this, void 0, void 0, function* () {
350
- var _a, _b, _c, _d;
350
+ var _a, _b;
351
+ var _c, _d;
351
352
  const { status } = event;
352
353
  if (status === status_1.JobStatus.canceled) {
353
- this.canceledByAdmin = (_b = (_a = this.getCurrentInnerJob()) === null || _a === void 0 ? void 0 : _a.canceledByAdmin) !== null && _b !== void 0 ? _b : false;
354
+ this.canceledByAdmin = (_c = (_a = this.getCurrentInnerJob()) === null || _a === void 0 ? void 0 : _a.canceledByAdmin) !== null && _c !== void 0 ? _c : false;
354
355
  return this.setStatus(status);
355
356
  }
356
357
  if (status === status_1.JobStatus.failed) {
357
358
  // report the errors of the failed inner job in the failed event (and in the errors) of this job
358
- Object.assign(this.errors, (_d = (_c = this.getCurrentInnerJob()) === null || _c === void 0 ? void 0 : _c.errors) !== null && _d !== void 0 ? _d : {});
359
+ Object.assign(this.errors, (_d = (_b = this.getCurrentInnerJob()) === null || _b === void 0 ? void 0 : _b.errors) !== null && _d !== void 0 ? _d : {});
359
360
  return this.setStatus(status);
360
361
  }
361
362
  if (status === status_1.JobStatus.running) {