@openforis/arena-core 2.25.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/appInfo.d.ts +1 -1
- package/dist/app/appInfo.js.map +1 -1
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js.map +1 -1
- package/dist/auth/authGroup.d.ts +4 -4
- package/dist/auth/authGroup.js.map +1 -1
- package/dist/auth/authGroups.d.ts +9 -9
- package/dist/auth/authGroups.js.map +1 -1
- package/dist/auth/authorizer.d.ts +58 -58
- package/dist/auth/authorizer.js.map +1 -1
- package/dist/auth/factory.d.ts +4 -4
- package/dist/auth/factory.js.map +1 -1
- package/dist/auth/index.d.ts +6 -6
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/user.d.ts +17 -17
- package/dist/auth/user.js.map +1 -1
- package/dist/auth/userAuth.d.ts +10 -10
- package/dist/auth/userAuth.js.map +1 -1
- package/dist/auth/userAuthTokenService.d.ts +11 -11
- package/dist/auth/userAuthTokenService.js.map +1 -1
- package/dist/auth/userGroup.d.ts +5 -5
- package/dist/auth/userGroup.js.map +1 -1
- package/dist/auth/userService.d.ts +14 -14
- package/dist/auth/userService.js.map +1 -1
- package/dist/auth/users.d.ts +11 -11
- package/dist/auth/users.js.map +1 -1
- package/dist/category/categories.d.ts +5 -5
- package/dist/category/categories.js.map +1 -1
- package/dist/category/category.d.ts +7 -7
- package/dist/category/category.js.map +1 -1
- package/dist/category/categoryImportSummary.d.ts +3 -3
- package/dist/category/categoryImportSummary.js.map +1 -1
- package/dist/category/categoryItemGenerator.d.ts +4 -4
- package/dist/category/categoryItemGenerator.js.map +1 -1
- package/dist/category/categoryItems.d.ts +5 -5
- package/dist/category/categoryItems.js.map +1 -1
- package/dist/category/factory.d.ts +11 -11
- package/dist/category/factory.js.map +1 -1
- package/dist/category/index.d.ts +7 -7
- package/dist/category/index.js.map +1 -1
- package/dist/category/item.d.ts +6 -6
- package/dist/category/item.js.map +1 -1
- package/dist/category/itemService.d.ts +16 -16
- package/dist/category/itemService.js.map +1 -1
- package/dist/category/level.d.ts +2 -2
- package/dist/category/level.js.map +1 -1
- package/dist/category/levelService.d.ts +15 -15
- package/dist/category/levelService.js.map +1 -1
- package/dist/category/service.d.ts +19 -19
- package/dist/category/service.js.map +1 -1
- package/dist/chain/chain.d.ts +7 -7
- package/dist/chain/chain.js.map +1 -1
- package/dist/chain/chainFactory.d.ts +3 -3
- package/dist/chain/chainFactory.js.map +1 -1
- package/dist/chain/chainNodeDef.d.ts +2 -2
- package/dist/chain/chainNodeDef.js.map +1 -1
- package/dist/chain/chainNodeDefAggregate.d.ts +4 -4
- package/dist/chain/chainNodeDefAggregate.js.map +1 -1
- package/dist/chain/chainNodeDefFactory.d.ts +3 -3
- package/dist/chain/chainNodeDefFactory.js.map +1 -1
- package/dist/chain/chainNodeDefService.d.ts +7 -7
- package/dist/chain/chainNodeDefService.js.map +1 -1
- package/dist/chain/chainService.d.ts +13 -13
- package/dist/chain/chainService.js.map +1 -1
- package/dist/chain/index.d.ts +5 -5
- package/dist/chain/index.js.map +1 -1
- package/dist/common/Dictionary.d.ts +1 -1
- package/dist/common/Dictionary.js.map +1 -1
- package/dist/common/factory.d.ts +1 -1
- package/dist/common/factory.js.map +1 -1
- package/dist/common/i18n.d.ts +1 -1
- package/dist/common/i18n.js.map +1 -1
- package/dist/common/index.d.ts +5 -5
- package/dist/common/index.js.map +1 -1
- package/dist/dataExport/ArenaExportInfo.d.ts +2 -2
- package/dist/dataExport/ArenaExportInfo.js.map +1 -1
- package/dist/dataExport/ArenaExportInfoFactory.d.ts +4 -4
- package/dist/dataExport/ArenaExportInfoFactory.js.map +1 -1
- package/dist/dataExport/FlatDataExportModel.d.ts +12 -12
- package/dist/dataExport/FlatDataExportModel.js +11 -11
- package/dist/dataExport/FlatDataExportModel.js.map +1 -1
- package/dist/dataExport/FlatDataExportOptions.d.ts +2 -2
- package/dist/dataExport/FlatDataExportOptions.js.map +1 -1
- package/dist/dataExport/FlatDataFiles.d.ts +2 -2
- package/dist/dataExport/FlatDataFiles.js.map +1 -1
- package/dist/dataExport/UniqueFileNamesGenerator.d.ts +3 -3
- package/dist/dataExport/UniqueFileNamesGenerator.js.map +1 -1
- package/dist/dataExport/index.d.ts +1 -1
- package/dist/dataExport/index.js.map +1 -1
- package/dist/dataQuery/dataQuery.d.ts +8 -8
- package/dist/dataQuery/dataQuery.js.map +1 -1
- package/dist/dataQuery/dataQuerySummaries.d.ts +16 -16
- package/dist/dataQuery/dataQuerySummaries.js.map +1 -1
- package/dist/dataQuery/index.d.ts +1 -1
- package/dist/dataQuery/index.js.map +1 -1
- package/dist/error/SystemError.d.ts +4 -4
- package/dist/error/SystemError.js.map +1 -1
- package/dist/esm/app/appInfo.js.map +1 -1
- package/dist/esm/app/index.js.map +1 -1
- package/dist/esm/auth/authGroup.js.map +1 -1
- package/dist/esm/auth/authGroups.js.map +1 -1
- package/dist/esm/auth/authorizer.js.map +1 -1
- package/dist/esm/auth/factory.js.map +1 -1
- package/dist/esm/auth/index.js.map +1 -1
- package/dist/esm/auth/user.js.map +1 -1
- package/dist/esm/auth/userAuth.js.map +1 -1
- package/dist/esm/auth/userAuthTokenService.js.map +1 -1
- package/dist/esm/auth/userGroup.js.map +1 -1
- package/dist/esm/auth/userService.js.map +1 -1
- package/dist/esm/auth/users.js.map +1 -1
- package/dist/esm/category/categories.js.map +1 -1
- package/dist/esm/category/category.js.map +1 -1
- package/dist/esm/category/categoryImportSummary.js.map +1 -1
- package/dist/esm/category/categoryItemGenerator.js.map +1 -1
- package/dist/esm/category/categoryItems.js.map +1 -1
- package/dist/esm/category/factory.js.map +1 -1
- package/dist/esm/category/index.js.map +1 -1
- package/dist/esm/category/item.js.map +1 -1
- package/dist/esm/category/itemService.js.map +1 -1
- package/dist/esm/category/level.js.map +1 -1
- package/dist/esm/category/levelService.js.map +1 -1
- package/dist/esm/category/service.js.map +1 -1
- package/dist/esm/chain/chain.js.map +1 -1
- package/dist/esm/chain/chainFactory.js.map +1 -1
- package/dist/esm/chain/chainNodeDef.js.map +1 -1
- package/dist/esm/chain/chainNodeDefAggregate.js.map +1 -1
- package/dist/esm/chain/chainNodeDefFactory.js.map +1 -1
- package/dist/esm/chain/chainNodeDefService.js.map +1 -1
- package/dist/esm/chain/chainService.js.map +1 -1
- package/dist/esm/chain/index.js.map +1 -1
- package/dist/esm/common/Dictionary.js.map +1 -1
- package/dist/esm/common/factory.js.map +1 -1
- package/dist/esm/common/i18n.js.map +1 -1
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/dataExport/ArenaExportInfo.js.map +1 -1
- package/dist/esm/dataExport/ArenaExportInfoFactory.js.map +1 -1
- package/dist/esm/dataExport/FlatDataExportModel.js +12 -12
- package/dist/esm/dataExport/FlatDataExportModel.js.map +1 -1
- package/dist/esm/dataExport/FlatDataExportOptions.js.map +1 -1
- package/dist/esm/dataExport/FlatDataFiles.js.map +1 -1
- package/dist/esm/dataExport/UniqueFileNamesGenerator.js.map +1 -1
- package/dist/esm/dataExport/index.js.map +1 -1
- package/dist/esm/dataQuery/dataQuery.js.map +1 -1
- package/dist/esm/dataQuery/dataQuerySummaries.js.map +1 -1
- package/dist/esm/dataQuery/index.js.map +1 -1
- package/dist/esm/error/SystemError.js.map +1 -1
- package/dist/esm/expression/context.js.map +1 -1
- package/dist/esm/expression/evaluator.js.map +1 -1
- package/dist/esm/expression/function.js.map +1 -1
- package/dist/esm/expression/index.js.map +1 -1
- package/dist/esm/expression/javascript/evaluator.js.map +1 -1
- package/dist/esm/expression/javascript/functionsDefault.js.map +1 -1
- package/dist/esm/expression/javascript/global.js.map +1 -1
- package/dist/esm/expression/javascript/node/array.js.map +1 -1
- package/dist/esm/expression/javascript/node/binary.js.map +1 -1
- package/dist/esm/expression/javascript/node/call.js.map +1 -1
- package/dist/esm/expression/javascript/node/compound.js.map +1 -1
- package/dist/esm/expression/javascript/node/conditional.js.map +1 -1
- package/dist/esm/expression/javascript/node/identifier.js.map +1 -1
- package/dist/esm/expression/javascript/node/literal.js.map +1 -1
- package/dist/esm/expression/javascript/node/member.js.map +1 -1
- package/dist/esm/expression/javascript/node/sequence.js.map +1 -1
- package/dist/esm/expression/javascript/node/this.js.map +1 -1
- package/dist/esm/expression/javascript/node/unary.js.map +1 -1
- package/dist/esm/expression/javascript/parser/parser.js.map +1 -1
- package/dist/esm/expression/node.js.map +1 -1
- package/dist/esm/expression/parser.js.map +1 -1
- package/dist/esm/extraProp/extraProp.js.map +1 -1
- package/dist/esm/extraProp/extraProps.js.map +1 -1
- package/dist/esm/extraProp/extraPropsDataGenerator.js.map +1 -1
- package/dist/esm/extraProp/index.js.map +1 -1
- package/dist/esm/geo/areaOfInterest.js.map +1 -1
- package/dist/esm/geo/index.js.map +1 -1
- package/dist/esm/geo/point.js.map +1 -1
- package/dist/esm/geo/pointFactory.js.map +1 -1
- package/dist/esm/geo/points/bearing.js +1 -1
- package/dist/esm/geo/points/bearing.js.map +1 -1
- package/dist/esm/geo/points/distance.js +1 -1
- package/dist/esm/geo/points/distance.js.map +1 -1
- package/dist/esm/geo/points/distanceToPolygonBoundary.js +3 -3
- package/dist/esm/geo/points/distanceToPolygonBoundary.js.map +1 -1
- package/dist/esm/geo/points/equals.js.map +1 -1
- package/dist/esm/geo/points/getSrs.js.map +1 -1
- package/dist/esm/geo/points/isFilled.js.map +1 -1
- package/dist/esm/geo/points/isValid.js.map +1 -1
- package/dist/esm/geo/points/parse.js +1 -1
- package/dist/esm/geo/points/parse.js.map +1 -1
- package/dist/esm/geo/points/pointAtDistance.js.map +1 -1
- package/dist/esm/geo/points/toLatLong.js.map +1 -1
- package/dist/esm/geo/points/toString.js.map +1 -1
- package/dist/esm/geo/points/transform.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/job/JobBase.js +6 -1
- package/dist/esm/job/JobBase.js.map +1 -1
- package/dist/esm/job/index.js.map +1 -1
- package/dist/esm/job/job.js.map +1 -1
- package/dist/esm/job/jobContext.js.map +1 -1
- package/dist/esm/job/jobEvent.js.map +1 -1
- package/dist/esm/job/jobSerialized.js.map +1 -1
- package/dist/esm/language/index.js.map +1 -1
- package/dist/esm/language/labels.js.map +1 -1
- package/dist/esm/logger/index.js.map +1 -1
- package/dist/esm/logger/logger.js.map +1 -1
- package/dist/esm/message/index.js.map +1 -1
- package/dist/esm/message/message.js.map +1 -1
- package/dist/esm/message/messages.js.map +1 -1
- package/dist/esm/node/factory.js +1 -1
- package/dist/esm/node/factory.js.map +1 -1
- package/dist/esm/node/index.js +5 -5
- package/dist/esm/node/index.js.map +1 -1
- package/dist/esm/node/node.js +10 -10
- package/dist/esm/node/node.js.map +1 -1
- package/dist/esm/node/nodePointer.js.map +1 -1
- package/dist/esm/node/nodeValue/code.js.map +1 -1
- package/dist/esm/node/nodeValue/coordinate.js.map +1 -1
- package/dist/esm/node/nodeValue/file.js.map +1 -1
- package/dist/esm/node/nodeValue/index.js.map +1 -1
- package/dist/esm/node/nodeValue/taxon.js.map +1 -1
- package/dist/esm/node/nodeValueFormatter.js +5 -5
- package/dist/esm/node/nodeValueFormatter.js.map +1 -1
- package/dist/esm/node/nodeValues.js +2 -2
- package/dist/esm/node/nodeValues.js.map +1 -1
- package/dist/esm/node/nodes.js +4 -5
- package/dist/esm/node/nodes.js.map +1 -1
- package/dist/esm/node/service.js.map +1 -1
- package/dist/esm/nodeDef/factory.js.map +1 -1
- package/dist/esm/nodeDef/index.js.map +1 -1
- package/dist/esm/nodeDef/nodeDef.js.map +1 -1
- package/dist/esm/nodeDef/nodeDefs.js.map +1 -1
- package/dist/esm/nodeDef/service.js.map +1 -1
- package/dist/esm/nodeDef/types/boolean.js.map +1 -1
- package/dist/esm/nodeDef/types/code.js.map +1 -1
- package/dist/esm/nodeDef/types/coordinate.js.map +1 -1
- package/dist/esm/nodeDef/types/date.js.map +1 -1
- package/dist/esm/nodeDef/types/decimal.js.map +1 -1
- package/dist/esm/nodeDef/types/entity.js.map +1 -1
- package/dist/esm/nodeDef/types/file.js.map +1 -1
- package/dist/esm/nodeDef/types/formHeader.js.map +1 -1
- package/dist/esm/nodeDef/types/geo.js.map +1 -1
- package/dist/esm/nodeDef/types/integer.js.map +1 -1
- package/dist/esm/nodeDef/types/taxon.js.map +1 -1
- package/dist/esm/nodeDef/types/text.js.map +1 -1
- package/dist/esm/nodeDef/types/time.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/areaOfInterestProvider.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/context.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/functions.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/index.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js +3 -2
- package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/node/member.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/validator.js.map +1 -1
- package/dist/esm/record/_records/nodeDefSelfReferences.js.map +1 -1
- package/dist/esm/record/_records/recordCompletion.js +8 -8
- package/dist/esm/record/_records/recordCompletion.js.map +1 -1
- package/dist/esm/record/_records/recordGetters.js +12 -12
- package/dist/esm/record/_records/recordGetters.js.map +1 -1
- package/dist/esm/record/_records/recordNodesIndexUpdater.js +3 -3
- package/dist/esm/record/_records/recordNodesIndexUpdater.js.map +1 -1
- package/dist/esm/record/_records/recordPagesValidation.js +3 -3
- package/dist/esm/record/_records/recordPagesValidation.js.map +1 -1
- package/dist/esm/record/_records/recordUpdateOptions.js.map +1 -1
- package/dist/esm/record/_records/recordUpdater.js.map +1 -1
- package/dist/esm/record/_records/recordUtils.js +2 -2
- package/dist/esm/record/_records/recordUtils.js.map +1 -1
- package/dist/esm/record/factory.js.map +1 -1
- package/dist/esm/record/index.js +1 -1
- package/dist/esm/record/index.js.map +1 -1
- package/dist/esm/record/nodePointers.js +1 -1
- package/dist/esm/record/nodePointers.js.map +1 -1
- package/dist/esm/record/record.js.map +1 -1
- package/dist/esm/record/recordCloner.js +8 -8
- package/dist/esm/record/recordCloner.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/context.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/functions.js +5 -5
- package/dist/esm/record/recordExpressionEvaluator/functions.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/index.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js +3 -3
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +2 -2
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/nodeValueExtractor.js +9 -9
- package/dist/esm/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
- package/dist/esm/record/recordFixer.js +6 -6
- package/dist/esm/record/recordFixer.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/index.js +0 -9
- package/dist/esm/record/recordNodesUpdater/index.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js +1 -1
- package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +8 -8
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +5 -5
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +7 -3
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +11 -11
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js +3 -3
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +3 -3
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +5 -4
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +7 -7
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js +5 -5
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js +3 -3
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js +6 -6
- package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
- package/dist/esm/record/recordPrettyPrinter.js +8 -8
- package/dist/esm/record/recordPrettyPrinter.js.map +1 -1
- package/dist/esm/record/recordStep.js.map +1 -1
- package/dist/esm/record/recordUpdater.js +2 -2
- package/dist/esm/record/recordUpdater.js.map +1 -1
- package/dist/esm/record/recordValidations.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeKeyValidator.js +5 -4
- package/dist/esm/record/recordValidator/attributeKeyValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeTypeValidator.js +13 -13
- package/dist/esm/record/recordValidator/attributeTypeValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeUniqueValidator.js +3 -3
- package/dist/esm/record/recordValidator/attributeUniqueValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeValidator.js +8 -8
- package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/countValidator.js +5 -5
- package/dist/esm/record/recordValidator/countValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/index.js.map +1 -1
- package/dist/esm/record/recordValidator/recordValidator.js.map +1 -1
- package/dist/esm/record/records.js +0 -4
- package/dist/esm/record/records.js.map +1 -1
- package/dist/esm/record/service.js.map +1 -1
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/serviceRegistry.js.map +1 -1
- package/dist/esm/registry/serviceTypeMap.js.map +1 -1
- package/dist/esm/srs/factory.js.map +1 -1
- package/dist/esm/srs/index.js.map +1 -1
- package/dist/esm/srs/srs.js.map +1 -1
- package/dist/esm/survey/factory.js.map +1 -1
- package/dist/esm/survey/index.js.map +1 -1
- package/dist/esm/survey/nodeDefsFixer.js.map +1 -1
- package/dist/esm/survey/refData/factory.js.map +1 -1
- package/dist/esm/survey/refData/index.js.map +1 -1
- package/dist/esm/survey/refData/refData.js.map +1 -1
- package/dist/esm/survey/service.js.map +1 -1
- package/dist/esm/survey/survey.js.map +1 -1
- package/dist/esm/survey/surveyDocImageFactory.js.map +1 -1
- package/dist/esm/survey/surveyDocImages.js.map +1 -1
- package/dist/esm/survey/surveyFileFactory.js.map +1 -1
- package/dist/esm/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
- package/dist/esm/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
- package/dist/esm/survey/surveys/dependencies.js.map +1 -1
- package/dist/esm/survey/surveys/nodeDefs.js.map +1 -1
- package/dist/esm/survey/surveys/refsData.js.map +1 -1
- package/dist/esm/survey/surveys/surveyGettersSecurity.js.map +1 -1
- package/dist/esm/survey/surveys/surveysGetters.js.map +1 -1
- package/dist/esm/survey/surveys/surveysUtils.js.map +1 -1
- package/dist/esm/taxonomy/factory.js.map +1 -1
- package/dist/esm/taxonomy/index.js.map +1 -1
- package/dist/esm/taxonomy/service.js.map +1 -1
- package/dist/esm/taxonomy/taxa.js.map +1 -1
- package/dist/esm/taxonomy/taxon.js.map +1 -1
- package/dist/esm/taxonomy/taxonGenerator.js.map +1 -1
- package/dist/esm/taxonomy/taxonService.js.map +1 -1
- package/dist/esm/taxonomy/taxonVernacularName.js.map +1 -1
- package/dist/esm/taxonomy/taxonomies.js.map +1 -1
- package/dist/esm/taxonomy/taxonomy.js.map +1 -1
- package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js +2 -2
- package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
- package/dist/esm/tests/builder/recordBuilder/entityBuilder.js +2 -2
- package/dist/esm/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
- package/dist/esm/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
- package/dist/esm/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/categoryBuilder.js +1 -1
- package/dist/esm/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
- package/dist/esm/utils/fileProcessor.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/mutationOptions.js +1 -4
- package/dist/esm/utils/mutationOptions.js.map +1 -1
- package/dist/esm/utils/versions.js.map +1 -1
- package/dist/esm/validation/factory.js.map +1 -1
- package/dist/esm/validation/fieldValidator.js.map +1 -1
- package/dist/esm/validation/fieldValidators/email.js.map +1 -1
- package/dist/esm/validation/fieldValidators/name.js.map +1 -1
- package/dist/esm/validation/fieldValidators/notKeyword.js.map +1 -1
- package/dist/esm/validation/fieldValidators/numeric.js.map +1 -1
- package/dist/esm/validation/fieldValidators/numericPositive.js.map +1 -1
- package/dist/esm/validation/fieldValidators/required.js.map +1 -1
- package/dist/esm/validation/index.js.map +1 -1
- package/dist/esm/validation/validation.js.map +1 -1
- package/dist/esm/validation/validationResults.js.map +1 -1
- package/dist/esm/validation/validations.js +4 -5
- package/dist/esm/validation/validations.js.map +1 -1
- package/dist/esm/validation/validator.js.map +1 -1
- package/dist/expression/context.d.ts +1 -1
- package/dist/expression/context.js.map +1 -1
- package/dist/expression/evaluator.d.ts +6 -6
- package/dist/expression/evaluator.js.map +1 -1
- package/dist/expression/function.d.ts +4 -4
- package/dist/expression/function.js.map +1 -1
- package/dist/expression/index.d.ts +4 -4
- package/dist/expression/index.js.map +1 -1
- package/dist/expression/javascript/evaluator.d.ts +11 -11
- package/dist/expression/javascript/evaluator.js.map +1 -1
- package/dist/expression/javascript/functionsDefault.d.ts +3 -3
- package/dist/expression/javascript/functionsDefault.js.map +1 -1
- package/dist/expression/javascript/global.js.map +1 -1
- package/dist/expression/javascript/node/array.d.ts +3 -3
- package/dist/expression/javascript/node/array.js.map +1 -1
- package/dist/expression/javascript/node/binary.d.ts +4 -4
- package/dist/expression/javascript/node/binary.js.map +1 -1
- package/dist/expression/javascript/node/call.d.ts +4 -4
- package/dist/expression/javascript/node/call.js.map +1 -1
- package/dist/expression/javascript/node/compound.d.ts +3 -3
- package/dist/expression/javascript/node/compound.js.map +1 -1
- package/dist/expression/javascript/node/conditional.d.ts +3 -3
- package/dist/expression/javascript/node/conditional.js.map +1 -1
- package/dist/expression/javascript/node/identifier.d.ts +5 -5
- package/dist/expression/javascript/node/identifier.js.map +1 -1
- package/dist/expression/javascript/node/literal.d.ts +4 -4
- package/dist/expression/javascript/node/literal.js.map +1 -1
- package/dist/expression/javascript/node/member.d.ts +5 -5
- package/dist/expression/javascript/node/member.js.map +1 -1
- package/dist/expression/javascript/node/sequence.d.ts +4 -4
- package/dist/expression/javascript/node/sequence.js.map +1 -1
- package/dist/expression/javascript/node/this.d.ts +3 -3
- package/dist/expression/javascript/node/this.js.map +1 -1
- package/dist/expression/javascript/node/unary.d.ts +4 -4
- package/dist/expression/javascript/node/unary.js.map +1 -1
- package/dist/expression/javascript/parser/parser.d.ts +2 -2
- package/dist/expression/javascript/parser/parser.js.map +1 -1
- package/dist/expression/node.d.ts +32 -32
- package/dist/expression/node.js.map +1 -1
- package/dist/expression/parser.d.ts +2 -2
- package/dist/expression/parser.js.map +1 -1
- package/dist/extraProp/extraProp.d.ts +3 -3
- package/dist/extraProp/extraProp.js.map +1 -1
- package/dist/extraProp/extraProps.d.ts +5 -5
- package/dist/extraProp/extraProps.js.map +1 -1
- package/dist/extraProp/extraPropsDataGenerator.d.ts +2 -2
- package/dist/extraProp/extraPropsDataGenerator.js.map +1 -1
- package/dist/extraProp/index.d.ts +1 -1
- package/dist/extraProp/index.js.map +1 -1
- package/dist/geo/areaOfInterest.d.ts +4 -4
- package/dist/geo/areaOfInterest.js.map +1 -1
- package/dist/geo/index.d.ts +2 -2
- package/dist/geo/index.js.map +1 -1
- package/dist/geo/point.d.ts +1 -1
- package/dist/geo/point.js.map +1 -1
- package/dist/geo/pointFactory.d.ts +3 -3
- package/dist/geo/pointFactory.js.map +1 -1
- package/dist/geo/points/bearing.d.ts +4 -4
- package/dist/geo/points/bearing.js +1 -1
- package/dist/geo/points/bearing.js.map +1 -1
- package/dist/geo/points/distance.d.ts +4 -4
- package/dist/geo/points/distance.js +1 -1
- package/dist/geo/points/distance.js.map +1 -1
- package/dist/geo/points/distanceToPolygonBoundary.d.ts +7 -7
- package/dist/geo/points/distanceToPolygonBoundary.js +3 -3
- package/dist/geo/points/distanceToPolygonBoundary.js.map +1 -1
- package/dist/geo/points/equals.d.ts +2 -2
- package/dist/geo/points/equals.js.map +1 -1
- package/dist/geo/points/getSrs.d.ts +3 -3
- package/dist/geo/points/getSrs.js.map +1 -1
- package/dist/geo/points/isFilled.d.ts +2 -2
- package/dist/geo/points/isFilled.js.map +1 -1
- package/dist/geo/points/isValid.d.ts +3 -3
- package/dist/geo/points/isValid.js.map +1 -1
- package/dist/geo/points/parse.d.ts +3 -3
- package/dist/geo/points/parse.js +1 -1
- package/dist/geo/points/parse.js.map +1 -1
- package/dist/geo/points/pointAtDistance.d.ts +5 -5
- package/dist/geo/points/pointAtDistance.js.map +1 -1
- package/dist/geo/points/toLatLong.d.ts +3 -3
- package/dist/geo/points/toLatLong.js.map +1 -1
- package/dist/geo/points/toString.d.ts +2 -2
- package/dist/geo/points/toString.js.map +1 -1
- package/dist/geo/points/transform.d.ts +4 -4
- package/dist/geo/points/transform.js.map +1 -1
- package/dist/index.d.ts +26 -26
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/job/JobBase.d.ts +20 -20
- package/dist/job/JobBase.js +6 -1
- package/dist/job/JobBase.js.map +1 -1
- package/dist/job/index.d.ts +5 -5
- package/dist/job/index.js.map +1 -1
- package/dist/job/job.d.ts +3 -3
- package/dist/job/job.js.map +1 -1
- package/dist/job/jobContext.d.ts +5 -5
- package/dist/job/jobContext.js.map +1 -1
- package/dist/job/jobEvent.d.ts +1 -1
- package/dist/job/jobEvent.js.map +1 -1
- package/dist/job/jobSerialized.d.ts +2 -2
- package/dist/job/jobSerialized.js.map +1 -1
- package/dist/language/index.d.ts +1 -1
- package/dist/language/index.js.map +1 -1
- package/dist/language/labels.d.ts +2 -2
- package/dist/language/labels.js.map +1 -1
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/logger.d.ts +1 -1
- package/dist/logger/logger.js.map +1 -1
- package/dist/message/index.d.ts +1 -1
- package/dist/message/index.js.map +1 -1
- package/dist/message/message.d.ts +1 -1
- package/dist/message/message.js.map +1 -1
- package/dist/message/messages.d.ts +30 -30
- package/dist/message/messages.js.map +1 -1
- package/dist/node/factory.d.ts +2 -2
- package/dist/node/factory.js +2 -2
- package/dist/node/factory.js.map +1 -1
- package/dist/node/index.d.ts +9 -9
- package/dist/node/index.js +7 -7
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts +11 -16
- package/dist/node/node.js +11 -11
- package/dist/node/node.js.map +1 -1
- package/dist/node/nodePointer.d.ts +3 -3
- package/dist/node/nodePointer.js.map +1 -1
- package/dist/node/nodeValue/code.d.ts +1 -1
- package/dist/node/nodeValue/code.js.map +1 -1
- package/dist/node/nodeValue/coordinate.d.ts +1 -1
- package/dist/node/nodeValue/coordinate.js.map +1 -1
- package/dist/node/nodeValue/file.d.ts +1 -1
- package/dist/node/nodeValue/file.js.map +1 -1
- package/dist/node/nodeValue/index.d.ts +4 -4
- package/dist/node/nodeValue/index.js.map +1 -1
- package/dist/node/nodeValue/taxon.d.ts +1 -1
- package/dist/node/nodeValue/taxon.js.map +1 -1
- package/dist/node/nodeValueFormatter.d.ts +5 -5
- package/dist/node/nodeValueFormatter.js +5 -5
- package/dist/node/nodeValueFormatter.js.map +1 -1
- package/dist/node/nodeValues.d.ts +13 -13
- package/dist/node/nodeValues.js +3 -3
- package/dist/node/nodeValues.js.map +1 -1
- package/dist/node/nodes.d.ts +11 -17
- package/dist/node/nodes.js +5 -6
- package/dist/node/nodes.js.map +1 -1
- package/dist/node/service.d.ts +5 -5
- package/dist/node/service.js.map +1 -1
- package/dist/nodeDef/factory.d.ts +6 -6
- package/dist/nodeDef/factory.js.map +1 -1
- package/dist/nodeDef/index.d.ts +15 -15
- package/dist/nodeDef/index.js.map +1 -1
- package/dist/nodeDef/nodeDef.d.ts +34 -32
- package/dist/nodeDef/nodeDef.js.map +1 -1
- package/dist/nodeDef/nodeDefs.d.ts +106 -106
- package/dist/nodeDef/nodeDefs.js.map +1 -1
- package/dist/nodeDef/service.d.ts +15 -15
- package/dist/nodeDef/service.js.map +1 -1
- package/dist/nodeDef/types/boolean.d.ts +3 -3
- package/dist/nodeDef/types/boolean.js.map +1 -1
- package/dist/nodeDef/types/code.d.ts +4 -4
- package/dist/nodeDef/types/code.js.map +1 -1
- package/dist/nodeDef/types/coordinate.d.ts +3 -3
- package/dist/nodeDef/types/coordinate.js.map +1 -1
- package/dist/nodeDef/types/date.d.ts +2 -2
- package/dist/nodeDef/types/date.js.map +1 -1
- package/dist/nodeDef/types/decimal.d.ts +3 -3
- package/dist/nodeDef/types/decimal.js.map +1 -1
- package/dist/nodeDef/types/entity.d.ts +9 -9
- package/dist/nodeDef/types/entity.js.map +1 -1
- package/dist/nodeDef/types/file.d.ts +3 -3
- package/dist/nodeDef/types/file.js.map +1 -1
- package/dist/nodeDef/types/formHeader.d.ts +3 -3
- package/dist/nodeDef/types/formHeader.js.map +1 -1
- package/dist/nodeDef/types/geo.d.ts +3 -3
- package/dist/nodeDef/types/geo.js.map +1 -1
- package/dist/nodeDef/types/integer.d.ts +2 -2
- package/dist/nodeDef/types/integer.js.map +1 -1
- package/dist/nodeDef/types/taxon.d.ts +3 -3
- package/dist/nodeDef/types/taxon.js.map +1 -1
- package/dist/nodeDef/types/text.d.ts +4 -4
- package/dist/nodeDef/types/text.js.map +1 -1
- package/dist/nodeDef/types/time.d.ts +3 -3
- package/dist/nodeDef/types/time.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.d.ts +5 -5
- package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/categoryItemProvider.d.ts +9 -9
- package/dist/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/context.d.ts +15 -16
- package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/evaluator.d.ts +6 -6
- package/dist/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/functions.d.ts +2 -2
- package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/index.d.ts +3 -3
- package/dist/nodeDefExpressionEvaluator/index.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/identifier.d.ts +4 -4
- package/dist/nodeDefExpressionEvaluator/node/identifier.js +2 -1
- package/dist/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/member.d.ts +2 -2
- package/dist/nodeDefExpressionEvaluator/node/member.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.d.ts +1 -1
- package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/taxonProvider.d.ts +7 -7
- package/dist/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/validator.d.ts +2 -2
- package/dist/nodeDefExpressionEvaluator/validator.js.map +1 -1
- package/dist/record/_records/nodeDefSelfReferences.d.ts +2 -2
- package/dist/record/_records/nodeDefSelfReferences.js.map +1 -1
- package/dist/record/_records/recordCompletion.d.ts +6 -6
- package/dist/record/_records/recordCompletion.js +7 -7
- package/dist/record/_records/recordCompletion.js.map +1 -1
- package/dist/record/_records/recordGetters.d.ts +21 -21
- package/dist/record/_records/recordGetters.js +9 -9
- package/dist/record/_records/recordGetters.js.map +1 -1
- package/dist/record/_records/recordNodesIndexUpdater.d.ts +4 -4
- package/dist/record/_records/recordNodesIndexUpdater.js +2 -2
- package/dist/record/_records/recordNodesIndexUpdater.js.map +1 -1
- package/dist/record/_records/recordPagesValidation.d.ts +12 -12
- package/dist/record/_records/recordPagesValidation.js +2 -2
- package/dist/record/_records/recordPagesValidation.js.map +1 -1
- package/dist/record/_records/recordUpdateOptions.d.ts +3 -3
- package/dist/record/_records/recordUpdateOptions.js.map +1 -1
- package/dist/record/_records/recordUpdater.d.ts +3 -3
- package/dist/record/_records/recordUpdater.js.map +1 -1
- package/dist/record/_records/recordUtils.d.ts +11 -11
- package/dist/record/_records/recordUtils.js +1 -1
- package/dist/record/_records/recordUtils.js.map +1 -1
- package/dist/record/factory.d.ts +6 -6
- package/dist/record/factory.js.map +1 -1
- package/dist/record/index.d.ts +8 -8
- package/dist/record/index.js +2 -2
- package/dist/record/index.js.map +1 -1
- package/dist/record/nodePointers.d.ts +4 -4
- package/dist/record/nodePointers.js +2 -2
- package/dist/record/nodePointers.js.map +1 -1
- package/dist/record/record.d.ts +5 -10
- package/dist/record/record.js.map +1 -1
- package/dist/record/recordCloner.d.ts +2 -2
- package/dist/record/recordCloner.js +6 -6
- package/dist/record/recordCloner.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/context.d.ts +12 -12
- package/dist/record/recordExpressionEvaluator/context.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/functions.d.ts +3 -3
- package/dist/record/recordExpressionEvaluator/functions.js +4 -4
- package/dist/record/recordExpressionEvaluator/functions.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/index.d.ts +1 -1
- package/dist/record/recordExpressionEvaluator/index.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/identifier/identifier.d.ts +4 -4
- package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js +2 -2
- package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.d.ts +4 -4
- package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +1 -1
- package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/thisEvaluator.d.ts +2 -2
- package/dist/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/nodeValueExtractor.d.ts +4 -4
- package/dist/record/recordExpressionEvaluator/nodeValueExtractor.js +8 -8
- package/dist/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.d.ts +10 -10
- package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
- package/dist/record/recordFixer.d.ts +3 -3
- package/dist/record/recordFixer.js +5 -5
- package/dist/record/recordFixer.js.map +1 -1
- package/dist/record/recordNodesUpdater/index.d.ts +2 -11
- package/dist/record/recordNodesUpdater/index.js +0 -9
- package/dist/record/recordNodesUpdater/index.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.d.ts +6 -6
- package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.d.ts +12 -12
- package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordExpressionValueConverter.d.ts +8 -8
- package/dist/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +7 -7
- package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.d.ts +7 -7
- package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +4 -4
- package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +6 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +9 -9
- package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js +2 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.d.ts +4 -4
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +2 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.d.ts +2 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +4 -3
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +5 -5
- package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.d.ts +5 -5
- package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js +4 -4
- package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsUpdateParams.d.ts +2 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js +2 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesCreator.d.ts +20 -20
- package/dist/record/recordNodesUpdater/recordNodesCreator.js +4 -4
- package/dist/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesDeleter.d.ts +3 -3
- package/dist/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.d.ts +9 -9
- package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesUpdater.d.ts +4 -4
- package/dist/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordUpdateResult.d.ts +11 -11
- package/dist/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
- package/dist/record/recordPrettyPrinter.d.ts +6 -6
- package/dist/record/recordPrettyPrinter.js +7 -7
- package/dist/record/recordPrettyPrinter.js.map +1 -1
- package/dist/record/recordStep.d.ts +4 -4
- package/dist/record/recordStep.js.map +1 -1
- package/dist/record/recordUpdater.d.ts +7 -7
- package/dist/record/recordUpdater.js +1 -1
- package/dist/record/recordUpdater.js.map +1 -1
- package/dist/record/recordValidations.d.ts +3 -3
- package/dist/record/recordValidations.js.map +1 -1
- package/dist/record/recordValidator/attributeKeyValidator.d.ts +9 -9
- package/dist/record/recordValidator/attributeKeyValidator.js +4 -3
- package/dist/record/recordValidator/attributeKeyValidator.js.map +1 -1
- package/dist/record/recordValidator/attributeTypeValidator.d.ts +10 -10
- package/dist/record/recordValidator/attributeTypeValidator.js +11 -11
- package/dist/record/recordValidator/attributeTypeValidator.js.map +1 -1
- package/dist/record/recordValidator/attributeUniqueValidator.d.ts +6 -6
- package/dist/record/recordValidator/attributeUniqueValidator.js +2 -2
- package/dist/record/recordValidator/attributeUniqueValidator.js.map +1 -1
- package/dist/record/recordValidator/attributeValidator.d.ts +8 -8
- package/dist/record/recordValidator/attributeValidator.js +6 -6
- package/dist/record/recordValidator/attributeValidator.js.map +1 -1
- package/dist/record/recordValidator/countValidator.d.ts +10 -10
- package/dist/record/recordValidator/countValidator.js +4 -4
- package/dist/record/recordValidator/countValidator.js.map +1 -1
- package/dist/record/recordValidator/index.d.ts +1 -1
- package/dist/record/recordValidator/index.js.map +1 -1
- package/dist/record/recordValidator/recordValidator.d.ts +5 -5
- package/dist/record/recordValidator/recordValidator.js.map +1 -1
- package/dist/record/records.d.ts +1 -5
- package/dist/record/records.js +0 -4
- package/dist/record/records.js.map +1 -1
- package/dist/record/service.d.ts +7 -7
- package/dist/record/service.js.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/serviceRegistry.d.ts +2 -2
- package/dist/registry/serviceRegistry.js.map +1 -1
- package/dist/registry/serviceTypeMap.d.ts +22 -22
- package/dist/registry/serviceTypeMap.js.map +1 -1
- package/dist/srs/factory.d.ts +3 -3
- package/dist/srs/factory.js.map +1 -1
- package/dist/srs/index.d.ts +1 -1
- package/dist/srs/index.js.map +1 -1
- package/dist/srs/srs.d.ts +5 -5
- package/dist/srs/srs.js.map +1 -1
- package/dist/survey/factory.d.ts +7 -7
- package/dist/survey/factory.js.map +1 -1
- package/dist/survey/index.d.ts +5 -5
- package/dist/survey/index.js.map +1 -1
- package/dist/survey/nodeDefsFixer.d.ts +6 -6
- package/dist/survey/nodeDefsFixer.js.map +1 -1
- package/dist/survey/refData/factory.d.ts +7 -7
- package/dist/survey/refData/factory.js.map +1 -1
- package/dist/survey/refData/index.d.ts +1 -1
- package/dist/survey/refData/index.js.map +1 -1
- package/dist/survey/refData/refData.d.ts +5 -5
- package/dist/survey/refData/refData.js.map +1 -1
- package/dist/survey/service.d.ts +18 -18
- package/dist/survey/service.js.map +1 -1
- package/dist/survey/survey.d.ts +42 -42
- package/dist/survey/survey.js.map +1 -1
- package/dist/survey/surveyDocImageFactory.d.ts +5 -5
- package/dist/survey/surveyDocImageFactory.js.map +1 -1
- package/dist/survey/surveyDocImages.d.ts +7 -7
- package/dist/survey/surveyDocImages.js.map +1 -1
- package/dist/survey/surveyFileFactory.d.ts +4 -4
- package/dist/survey/surveyFileFactory.js.map +1 -1
- package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.d.ts +7 -7
- package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
- package/dist/survey/surveys/_nodeDefs/nodeDefsReader.d.ts +4 -4
- package/dist/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
- package/dist/survey/surveys/dependencies.d.ts +12 -12
- package/dist/survey/surveys/dependencies.js.map +1 -1
- package/dist/survey/surveys/index.d.ts +3 -3
- package/dist/survey/surveys/nodeDefs.d.ts +80 -80
- package/dist/survey/surveys/nodeDefs.js.map +1 -1
- package/dist/survey/surveys/refsData.d.ts +23 -23
- package/dist/survey/surveys/refsData.js.map +1 -1
- package/dist/survey/surveys/surveyGettersSecurity.d.ts +10 -10
- package/dist/survey/surveys/surveyGettersSecurity.js.map +1 -1
- package/dist/survey/surveys/surveysGetters.d.ts +33 -33
- package/dist/survey/surveys/surveysGetters.js.map +1 -1
- package/dist/survey/surveys/surveysUtils.d.ts +7 -7
- package/dist/survey/surveys/surveysUtils.js.map +1 -1
- package/dist/taxonomy/factory.d.ts +13 -13
- package/dist/taxonomy/factory.js.map +1 -1
- package/dist/taxonomy/index.d.ts +6 -6
- package/dist/taxonomy/index.js.map +1 -1
- package/dist/taxonomy/service.d.ts +11 -11
- package/dist/taxonomy/service.js.map +1 -1
- package/dist/taxonomy/taxa.d.ts +7 -7
- package/dist/taxonomy/taxa.js.map +1 -1
- package/dist/taxonomy/taxon.d.ts +6 -6
- package/dist/taxonomy/taxon.js.map +1 -1
- package/dist/taxonomy/taxonGenerator.d.ts +4 -4
- package/dist/taxonomy/taxonGenerator.js.map +1 -1
- package/dist/taxonomy/taxonService.d.ts +10 -10
- package/dist/taxonomy/taxonService.js.map +1 -1
- package/dist/taxonomy/taxonVernacularName.d.ts +2 -2
- package/dist/taxonomy/taxonVernacularName.js.map +1 -1
- package/dist/taxonomy/taxonomies.d.ts +5 -5
- package/dist/taxonomy/taxonomies.js.map +1 -1
- package/dist/taxonomy/taxonomy.d.ts +6 -6
- package/dist/taxonomy/taxonomy.js.map +1 -1
- package/dist/tests/builder/recordBuilder/attributeBuilder.d.ts +2 -2
- package/dist/tests/builder/recordBuilder/attributeBuilder.js +1 -1
- package/dist/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
- package/dist/tests/builder/recordBuilder/entityBuilder.d.ts +2 -2
- package/dist/tests/builder/recordBuilder/entityBuilder.js +1 -1
- package/dist/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
- package/dist/tests/builder/recordBuilder/nodeBuilder.d.ts +5 -5
- package/dist/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
- package/dist/tests/builder/recordBuilder/recordBuilder.d.ts +3 -3
- package/dist/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/categoryBuilder.d.ts +5 -5
- package/dist/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/categoryItemBuilder.d.ts +2 -2
- package/dist/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.d.ts +5 -5
- package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefBuilder.d.ts +15 -15
- package/dist/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.d.ts +5 -5
- package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.d.ts +5 -5
- package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.d.ts +5 -5
- package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/surveyBuilder.d.ts +4 -4
- package/dist/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/taxonBuilder.d.ts +2 -2
- package/dist/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/taxonomyBuilder.d.ts +5 -5
- package/dist/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
- package/dist/utils/fileProcessor.d.ts +2 -2
- package/dist/utils/fileProcessor.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mutationOptions.d.ts +1 -5
- package/dist/utils/mutationOptions.js +0 -6
- package/dist/utils/mutationOptions.js.map +1 -1
- package/dist/utils/versions.d.ts +2 -2
- package/dist/utils/versions.js.map +1 -1
- package/dist/validation/factory.d.ts +10 -10
- package/dist/validation/factory.js.map +1 -1
- package/dist/validation/fieldValidator.d.ts +2 -2
- package/dist/validation/fieldValidator.js.map +1 -1
- package/dist/validation/fieldValidators/email.d.ts +2 -2
- package/dist/validation/fieldValidators/email.js.map +1 -1
- package/dist/validation/fieldValidators/name.d.ts +2 -2
- package/dist/validation/fieldValidators/name.js.map +1 -1
- package/dist/validation/fieldValidators/notKeyword.d.ts +2 -2
- package/dist/validation/fieldValidators/notKeyword.js.map +1 -1
- package/dist/validation/fieldValidators/numeric.d.ts +2 -2
- package/dist/validation/fieldValidators/numeric.js.map +1 -1
- package/dist/validation/fieldValidators/numericPositive.d.ts +2 -2
- package/dist/validation/fieldValidators/numericPositive.js.map +1 -1
- package/dist/validation/fieldValidators/required.d.ts +2 -2
- package/dist/validation/fieldValidators/required.js.map +1 -1
- package/dist/validation/index.d.ts +3 -3
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/validation.d.ts +11 -11
- package/dist/validation/validation.js.map +1 -1
- package/dist/validation/validationResults.d.ts +9 -9
- package/dist/validation/validationResults.js.map +1 -1
- package/dist/validation/validations.d.ts +33 -37
- package/dist/validation/validations.js +4 -5
- package/dist/validation/validations.js.map +1 -1
- package/dist/validation/validator.d.ts +4 -4
- package/dist/validation/validator.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/functions.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAyB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,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AAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,QAAkC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK;KAC9D;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,OAAiC,EAAE,EAAE,CAAC,GAAG,EAAE,kBAAC,MAAA,OAAO,CAAC,IAAI,0CAAE,IAAI,GAAA;KAC1E;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,OAAiC,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,EAAE;YACpE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;YAChC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,CAAA;YACtC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAA;YACnC,MAAM,kBAAkB,GAAG,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAA;YACxE,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC/F,CAAC;KACF;CACF,CAAA","sourcesContent":["import { Users } from '../auth'\nimport { CategoryItem } from '../category'\nimport { SystemError, SystemErrorKeys } from '../error'\nimport { ExpressionFunctions } from '../expression'\nimport { ExtraProps } from '../extraProp/extraProps'\nimport { AreaOfInterest, Point, Points } from '../geo'\nimport { LanguagesISO639part2 } from '../language'\nimport { ArenaRecord } from '../record'\nimport { getNodeDefParent } from '../survey/surveys/nodeDefs'\nimport { getCategoryItemByCodePaths, getTaxonByCode } from '../survey/surveys/refsData'\nimport {\n getAreaOfInterestByName,\n getAreasOfInterest,\n getCategoryByName,\n getSRSIndex,\n getTaxonomyByName,\n} from '../survey/surveys/surveysGetters'\nimport { Taxon } from '../taxonomy'\nimport { Dates, Numbers, Objects } from '../utils'\nimport { NodeDefExpressionContext } from './context'\n\nconst sampleGeoJsonPolygon = {\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n ],\n },\n}\n\nconst isNotValidString = (value: string): boolean => Objects.isEmpty(value) || typeof value !== 'string'\n\nconst emptyExecutor = (_context: NodeDefExpressionContext) => () => null\n\nconst isUsingDraftProps = (context: NodeDefExpressionContext) => {\n // use draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n return !record || !!record.preview\n}\n\nconst getOrFetchCategoryItem = async (params: {\n context: NodeDefExpressionContext\n categoryUuid: string\n codePaths: string[]\n}): Promise<CategoryItem | undefined> => {\n const { context, categoryUuid, codePaths } = params\n // if any code path is empty, return null (no category item can be found)\n if (Objects.isEmpty(codePaths) || codePaths.some(Objects.isEmpty)) {\n return undefined\n }\n const { survey, categoryItemProvider } = context\n const categoryItem = getCategoryItemByCodePaths({ survey, categoryUuid, codePaths })\n const draft = isUsingDraftProps(context)\n return categoryItem ?? categoryItemProvider?.getItemByCodePaths({ survey, categoryUuid, codePaths, draft })\n}\n\nconst getOrFetchTaxon = async (params: {\n context: NodeDefExpressionContext\n taxonomyUuid: string\n taxonCode: string\n}): Promise<Taxon | undefined> => {\n const { context, taxonomyUuid, taxonCode } = params\n if (typeof taxonCode !== 'string' && typeof taxonCode !== 'number') {\n return undefined // node def expression validator could call it passing a node def object\n }\n // if taxonCode is empty, return undefined\n if (Objects.isEmpty(taxonCode)) {\n return undefined\n }\n const { survey, taxonProvider } = context\n const taxon = getTaxonByCode({ survey, taxonomyUuid, taxonCode })\n // fetch draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n const draft = !record || !!record.preview\n return taxon ?? taxonProvider?.getTaxonByCode({ survey, taxonomyUuid, taxonCode, draft })\n}\n\nconst fetchAreaOfInterest = async (params: {\n context: NodeDefExpressionContext\n name: string\n}): Promise<AreaOfInterest | undefined> => {\n const { context, name } = params\n const { survey, areaOfInterestProvider } = context\n if (!areaOfInterestProvider || !getAreaOfInterestByName({ survey, name })) return undefined\n return areaOfInterestProvider.getAreaOfInterest({ survey, name })\n}\n\n// expression validation (no record): a literal area name must be defined in the survey\nconst validateAreaOfInterestName = (params: { context: NodeDefExpressionContext; name: unknown }): void => {\n const { context, name } = params\n const record: ArenaRecord = (context as any).record\n if (!record && typeof name === 'string' && !getAreaOfInterestByName({ survey: context.survey, name })) {\n throw new SystemError(SystemErrorKeys.expression.areaOfInterestNotFound, { name })\n }\n}\n\nconst distanceToAreaOfInterestBoundary = async (params: {\n context: NodeDefExpressionContext\n point: Point\n name: string\n}): Promise<number | null> => {\n const { context, point, name } = params\n const areaOfInterest = await fetchAreaOfInterest({ context, name })\n if (!areaOfInterest) return null\n return Points.distanceToPolygonBoundary(point, areaOfInterest, getSRSIndex(context.survey))\n}\n\nconst geoDistanceExecutor =\n (context: NodeDefExpressionContext) =>\n (coordinateFrom: Point | string, coordinateTo: Point | string): number | null => {\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n const pointFrom = Points.parse(coordinateFrom)\n const pointTo = Points.parse(coordinateTo)\n\n return pointFrom && pointTo ? Points.distance(pointFrom, pointTo, srsIndex) : null\n }\n\nexport const nodeDefExpressionFunctions: ExpressionFunctions<NodeDefExpressionContext> = {\n categoryItemProp: {\n minArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (categoryName: string, itemPropName: string, ...codePaths: string[]): Promise<any> => {\n const { survey } = context\n\n if (Objects.isEmpty(categoryName) || Objects.isEmpty(itemPropName) || Objects.isEmpty(codePaths))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n\n const category = getCategoryByName({ survey, categoryName })\n if (!category) throw new SystemError(SystemErrorKeys.expression.invalidCategoryName, { name: categoryName })\n\n const { itemExtraDef } = category.props\n const extraPropDef =\n itemExtraDef && Object.hasOwn(itemExtraDef, itemPropName) ? itemExtraDef[itemPropName] : undefined\n if (!extraPropDef)\n throw new SystemError(SystemErrorKeys.expression.invalidCategoryExtraProp, { propName: itemPropName })\n\n const { uuid: categoryUuid } = category\n const categoryItem = await getOrFetchCategoryItem({ context, categoryUuid, codePaths })\n if (!categoryItem) return null\n\n const value = categoryItem.props.extra?.[itemPropName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n count: {\n minArity: 1,\n maxArity: 1,\n executor:\n (_context: NodeDefExpressionContext) =>\n (_nodeSet): number =>\n 1,\n },\n dateTimeDiff: {\n minArity: 4,\n maxArity: 4,\n executor:\n (_context: NodeDefExpressionContext) =>\n (date1: string, time1: string, date2: string, time2: string): number | null => {\n if (isNotValidString(date1) || isNotValidString(time1) || isNotValidString(date2) || isNotValidString(time2))\n return null\n // computed in UTC: in the local time zone of the machine a DST change between the 2 dates would alter the result\n const toUtcMinutes = (date: string, time: string): number => {\n const [year, month, day] = date.split('-').map(Number)\n const [hours, minutes] = time.split(':').map(Number)\n return Date.UTC(year, month - 1, day, hours, minutes) / 60000\n }\n const diff = toUtcMinutes(date1, time1) - toUtcMinutes(date2, time2)\n return Number.isNaN(diff) ? null : diff\n },\n },\n // deprecated, use geoDistance instead\n distance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n first: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n geoCoordinateAtDistance: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n (coordinate: Point | string, distanceMeters: number, bearingDeg: number): Point | null => {\n // validate parameters\n const origin = Points.parse(coordinate)\n if (!origin) return null\n\n const distanceMetersNumber = Number(distanceMeters)\n const bearingDegNumber = Number(bearingDeg)\n if (!Number.isFinite(distanceMetersNumber) || distanceMetersNumber < 0 || !Number.isFinite(bearingDegNumber)) {\n return null\n }\n\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n return Points.pointAtDistance({\n origin,\n distanceMeters: distanceMetersNumber,\n bearingDeg: bearingDegNumber,\n srsIndex,\n })\n },\n },\n geoDistance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n geoAOIContaining: {\n minArity: 1,\n maxArity: 1,\n executor:\n (context: NodeDefExpressionContext) =>\n async (coordinate: Point | string): Promise<string | null> => {\n const point = Points.parse(coordinate)\n if (!point || !context.areaOfInterestProvider) return null\n // the survey order is the priority of overlapping areas\n for (const { name } of getAreasOfInterest(context.survey)) {\n const distance = await distanceToAreaOfInterestBoundary({ context, point, name }) // NOSONAR\n if (distance !== null && distance <= 0) return name\n }\n return null\n },\n },\n geoDistanceToAOIBoundary: {\n minArity: 2,\n maxArity: 2,\n executor:\n (context: NodeDefExpressionContext) =>\n async (coordinate: Point | string, name: string): Promise<number | null> => {\n validateAreaOfInterestName({ context, name })\n const point = Points.parse(coordinate)\n if (!point || typeof name !== 'string') return null\n return distanceToAreaOfInterestBoundary({ context, point, name })\n },\n },\n geoPolygon: {\n minArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => sampleGeoJsonPolygon,\n },\n includes: {\n minArity: 2,\n maxArity: 2,\n evaluateArgsToNodes: false,\n executor:\n () =>\n (items: any, value: any): boolean =>\n Array.isArray(items) && items.map(String).includes(String(value)),\n },\n index: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => -1,\n },\n last: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n now: {\n minArity: 0,\n maxArity: 0,\n evaluateToNode: false,\n executor: () => () => Dates.nowFormattedForStorage(),\n },\n numberToWords: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: false,\n executor:\n (context: NodeDefExpressionContext) =>\n (value: any): string | null => {\n if (Objects.isEmpty(value)) return null\n return Numbers.toWords(value, context.lang)\n },\n },\n parent: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n evaluateToNode: true,\n executor: (context: NodeDefExpressionContext) => (nodeDef) => {\n const { survey } = context\n return getNodeDefParent({ survey, nodeDef })\n },\n },\n prevCycleValue: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n prevCycleValues: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n recordCycle: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateCreated: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateLastModified: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerEmail: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerName: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerRole: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n sum: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => 1,\n },\n taxonProp: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) => async (taxonomyName: string, propName: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(propName))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n const { extraPropsDefs } = taxonomy.props\n const extraPropDef =\n extraPropsDefs && Object.hasOwn(extraPropsDefs, propName) ? extraPropsDefs[propName] : undefined\n if (!extraPropDef) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyExtraProp, { propName })\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const value = taxon.props.extra?.[propName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n taxonVernacularName: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (taxonomyName: string, vernacularLangCode: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(vernacularLangCode))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n if (!Object.hasOwn(LanguagesISO639part2, vernacularLangCode)) {\n throw new SystemError(SystemErrorKeys.expression.invalidTaxonVernacularNameLanguageCode, {\n vernacularLangCode,\n })\n }\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const vernacularNameArray = taxon.vernacularNames?.[vernacularLangCode]\n // consider first vernacular name object only\n const firstVernacularName = vernacularNameArray?.[0]\n return firstVernacularName?.props?.name\n },\n },\n unique: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => [],\n },\n userEmail: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.email,\n },\n userIsRecordOwner: {\n minArity: 0,\n maxArity: 0,\n executor: (_context: NodeDefExpressionContext) => () => false,\n },\n userName: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.name,\n },\n userProp: {\n minArity: 1,\n maxArity: 1,\n executor: (context: NodeDefExpressionContext) => (propName: string) => {\n const { user, survey } = context\n if (!survey || !user) return undefined\n const { uuid: surveyUuid } = survey\n const combinedExtraProps = Users.getCombinedExtraProps(surveyUuid)(user)\n return Object.hasOwn(combinedExtraProps, propName) ? combinedExtraProps[propName] : undefined\n },\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/functions.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAmC,MAAM,EAAE,MAAM,QAAQ,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,GAClB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGlD,MAAM,oBAAoB,GAAG;IAC3B,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE;QACR,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACX;gBACE,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,GAAG,CAAC;aACb;SACF;KACF;CACF,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAA;AAExG,MAAM,aAAa,GAAG,CAAC,QAAkC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAA;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,kBAAkB,GAAG,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAA;YACxE,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC/F,CAAC;KACF;CACF,CAAA","sourcesContent":["import { Users } from '../auth'\nimport { ArenaCategoryItem } from '../category'\nimport { SystemError, SystemErrorKeys } from '../error'\nimport { ArenaExpressionFunctions } from '../expression'\nimport { ExtraProps } from '../extraProp/extraProps'\nimport { ArenaAreaOfInterest, ArenaPoint, Points } from '../geo'\nimport { LanguagesISO639part2 } from '../language'\nimport { ArenaRecord } from '../record'\nimport { getNodeDefParent } from '../survey/surveys/nodeDefs'\nimport { getCategoryItemByCodePaths, getTaxonByCode } from '../survey/surveys/refsData'\nimport {\n getAreaOfInterestByName,\n getAreasOfInterest,\n getCategoryByName,\n getSRSIndex,\n getTaxonomyByName,\n} from '../survey/surveys/surveysGetters'\nimport { ArenaTaxon } from '../taxonomy'\nimport { Dates, Numbers, Objects } from '../utils'\nimport { NodeDefExpressionContext } from './context'\n\nconst sampleGeoJsonPolygon = {\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n ],\n },\n}\n\nconst isNotValidString = (value: string): boolean => Objects.isEmpty(value) || typeof value !== 'string'\n\nconst emptyExecutor = (_context: NodeDefExpressionContext) => () => null\n\nconst isUsingDraftProps = (context: NodeDefExpressionContext) => {\n // use draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n return !record || !!record.preview\n}\n\nconst getOrFetchCategoryItem = async (params: {\n context: NodeDefExpressionContext\n categoryUuid: string\n codePaths: string[]\n}): Promise<ArenaCategoryItem | undefined> => {\n const { context, categoryUuid, codePaths } = params\n // if any code path is empty, return null (no category item can be found)\n if (Objects.isEmpty(codePaths) || codePaths.some(Objects.isEmpty)) {\n return undefined\n }\n const { survey, categoryItemProvider } = context\n const categoryItem = getCategoryItemByCodePaths({ survey, categoryUuid, codePaths })\n const draft = isUsingDraftProps(context)\n return categoryItem ?? categoryItemProvider?.getItemByCodePaths({ survey, categoryUuid, codePaths, draft })\n}\n\nconst getOrFetchTaxon = async (params: {\n context: NodeDefExpressionContext\n taxonomyUuid: string\n taxonCode: string\n}): Promise<ArenaTaxon | undefined> => {\n const { context, taxonomyUuid, taxonCode } = params\n if (typeof taxonCode !== 'string' && typeof taxonCode !== 'number') {\n return undefined // node def expression validator could call it passing a node def object\n }\n // if taxonCode is empty, return undefined\n if (Objects.isEmpty(taxonCode)) {\n return undefined\n }\n const { survey, taxonProvider } = context\n const taxon = getTaxonByCode({ survey, taxonomyUuid, taxonCode })\n // fetch draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n const draft = !record || !!record.preview\n return taxon ?? taxonProvider?.getTaxonByCode({ survey, taxonomyUuid, taxonCode, draft })\n}\n\nconst fetchAreaOfInterest = async (params: {\n context: NodeDefExpressionContext\n name: string\n}): Promise<ArenaAreaOfInterest | undefined> => {\n const { context, name } = params\n const { survey, areaOfInterestProvider } = context\n if (!areaOfInterestProvider || !getAreaOfInterestByName({ survey, name })) return undefined\n return areaOfInterestProvider.getAreaOfInterest({ survey, name })\n}\n\n// expression validation (no record): a literal area name must be defined in the survey\nconst validateAreaOfInterestName = (params: { context: NodeDefExpressionContext; name: unknown }): void => {\n const { context, name } = params\n const record: ArenaRecord = (context as any).record\n if (!record && typeof name === 'string' && !getAreaOfInterestByName({ survey: context.survey, name })) {\n throw new SystemError(SystemErrorKeys.expression.areaOfInterestNotFound, { name })\n }\n}\n\nconst distanceToAreaOfInterestBoundary = async (params: {\n context: NodeDefExpressionContext\n point: ArenaPoint\n name: string\n}): Promise<number | null> => {\n const { context, point, name } = params\n const areaOfInterest = await fetchAreaOfInterest({ context, name })\n if (!areaOfInterest) return null\n return Points.distanceToPolygonBoundary(point, areaOfInterest, getSRSIndex(context.survey))\n}\n\nconst geoDistanceExecutor =\n (context: NodeDefExpressionContext) =>\n (coordinateFrom: ArenaPoint | string, coordinateTo: ArenaPoint | string): number | null => {\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n const pointFrom = Points.parse(coordinateFrom)\n const pointTo = Points.parse(coordinateTo)\n\n return pointFrom && pointTo ? Points.distance(pointFrom, pointTo, srsIndex) : null\n }\n\nexport const nodeDefExpressionFunctions: ArenaExpressionFunctions<NodeDefExpressionContext> = {\n categoryItemProp: {\n minArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (categoryName: string, itemPropName: string, ...codePaths: string[]): Promise<any> => {\n const { survey } = context\n\n if (Objects.isEmpty(categoryName) || Objects.isEmpty(itemPropName) || Objects.isEmpty(codePaths))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n\n const category = getCategoryByName({ survey, categoryName })\n if (!category) throw new SystemError(SystemErrorKeys.expression.invalidCategoryName, { name: categoryName })\n\n const { itemExtraDef } = category.props\n const extraPropDef =\n itemExtraDef && Object.hasOwn(itemExtraDef, itemPropName) ? itemExtraDef[itemPropName] : undefined\n if (!extraPropDef)\n throw new SystemError(SystemErrorKeys.expression.invalidCategoryExtraProp, { propName: itemPropName })\n\n const { uuid: categoryUuid } = category\n const categoryItem = await getOrFetchCategoryItem({ context, categoryUuid, codePaths })\n if (!categoryItem) return null\n\n const value = categoryItem.props.extra?.[itemPropName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n count: {\n minArity: 1,\n maxArity: 1,\n executor:\n (_context: NodeDefExpressionContext) =>\n (_nodeSet): number =>\n 1,\n },\n dateTimeDiff: {\n minArity: 4,\n maxArity: 4,\n executor:\n (_context: NodeDefExpressionContext) =>\n (date1: string, time1: string, date2: string, time2: string): number | null => {\n if (isNotValidString(date1) || isNotValidString(time1) || isNotValidString(date2) || isNotValidString(time2))\n return null\n // computed in UTC: in the local time zone of the machine a DST change between the 2 dates would alter the result\n const toUtcMinutes = (date: string, time: string): number => {\n const [year, month, day] = date.split('-').map(Number)\n const [hours, minutes] = time.split(':').map(Number)\n return Date.UTC(year, month - 1, day, hours, minutes) / 60000\n }\n const diff = toUtcMinutes(date1, time1) - toUtcMinutes(date2, time2)\n return Number.isNaN(diff) ? null : diff\n },\n },\n // deprecated, use geoDistance instead\n distance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n first: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n geoCoordinateAtDistance: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n (coordinate: ArenaPoint | string, distanceMeters: number, bearingDeg: number): ArenaPoint | null => {\n // validate parameters\n const origin = Points.parse(coordinate)\n if (!origin) return null\n\n const distanceMetersNumber = Number(distanceMeters)\n const bearingDegNumber = Number(bearingDeg)\n if (!Number.isFinite(distanceMetersNumber) || distanceMetersNumber < 0 || !Number.isFinite(bearingDegNumber)) {\n return null\n }\n\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n return Points.pointAtDistance({\n origin,\n distanceMeters: distanceMetersNumber,\n bearingDeg: bearingDegNumber,\n srsIndex,\n })\n },\n },\n geoDistance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n geoAOIContaining: {\n minArity: 1,\n maxArity: 1,\n executor:\n (context: NodeDefExpressionContext) =>\n async (coordinate: ArenaPoint | string): Promise<string | null> => {\n const point = Points.parse(coordinate)\n if (!point || !context.areaOfInterestProvider) return null\n // the survey order is the priority of overlapping areas\n for (const { name } of getAreasOfInterest(context.survey)) {\n const distance = await distanceToAreaOfInterestBoundary({ context, point, name }) // NOSONAR\n if (distance !== null && distance <= 0) return name\n }\n return null\n },\n },\n geoDistanceToAOIBoundary: {\n minArity: 2,\n maxArity: 2,\n executor:\n (context: NodeDefExpressionContext) =>\n async (coordinate: ArenaPoint | string, name: string): Promise<number | null> => {\n validateAreaOfInterestName({ context, name })\n const point = Points.parse(coordinate)\n if (!point || typeof name !== 'string') return null\n return distanceToAreaOfInterestBoundary({ context, point, name })\n },\n },\n geoPolygon: {\n minArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => sampleGeoJsonPolygon,\n },\n includes: {\n minArity: 2,\n maxArity: 2,\n evaluateArgsToNodes: false,\n executor:\n () =>\n (items: any, value: any): boolean =>\n Array.isArray(items) && items.map(String).includes(String(value)),\n },\n index: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => -1,\n },\n last: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n now: {\n minArity: 0,\n maxArity: 0,\n evaluateToNode: false,\n executor: () => () => Dates.nowFormattedForStorage(),\n },\n numberToWords: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: false,\n executor:\n (context: NodeDefExpressionContext) =>\n (value: any): string | null => {\n if (Objects.isEmpty(value)) return null\n return Numbers.toWords(value, context.lang)\n },\n },\n parent: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n evaluateToNode: true,\n executor: (context: NodeDefExpressionContext) => (nodeDef) => {\n const { survey } = context\n return getNodeDefParent({ survey, nodeDef })\n },\n },\n prevCycleValue: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n prevCycleValues: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n recordCycle: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateCreated: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateLastModified: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerEmail: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerName: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerRole: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n sum: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => 1,\n },\n taxonProp: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) => async (taxonomyName: string, propName: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(propName))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n const { extraPropsDefs } = taxonomy.props\n const extraPropDef =\n extraPropsDefs && Object.hasOwn(extraPropsDefs, propName) ? extraPropsDefs[propName] : undefined\n if (!extraPropDef) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyExtraProp, { propName })\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const value = taxon.props.extra?.[propName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n taxonVernacularName: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (taxonomyName: string, vernacularLangCode: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(vernacularLangCode))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n if (!Object.hasOwn(LanguagesISO639part2, vernacularLangCode)) {\n throw new SystemError(SystemErrorKeys.expression.invalidTaxonVernacularNameLanguageCode, {\n vernacularLangCode,\n })\n }\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const vernacularNameArray = taxon.vernacularNames?.[vernacularLangCode]\n // consider first vernacular name object only\n const firstVernacularName = vernacularNameArray?.[0]\n return firstVernacularName?.props?.name\n },\n },\n unique: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => [],\n },\n userEmail: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.email,\n },\n userIsRecordOwner: {\n minArity: 0,\n maxArity: 0,\n executor: (_context: NodeDefExpressionContext) => () => false,\n },\n userName: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.name,\n },\n userProp: {\n minArity: 1,\n maxArity: 1,\n executor: (context: NodeDefExpressionContext) => (propName: string) => {\n const { user, survey } = context\n if (!survey || !user) return undefined\n const { uuid: surveyUuid } = survey\n const combinedExtraProps = Users.getCombinedExtraProps(surveyUuid)(user)\n return Object.hasOwn(combinedExtraProps, propName) ? combinedExtraProps[propName] : undefined\n },\n },\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA","sourcesContent":["export { NodeDefExpressionEvaluator } from './evaluator'\nexport { NodeDefExpressionValidator } from './validator'\nexport type {
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA","sourcesContent":["export { NodeDefExpressionEvaluator } from './evaluator'\nexport { NodeDefExpressionValidator } from './validator'\nexport type { ArenaAreaOfInterestProvider } from './areaOfInterestProvider'\nexport type { ArenaCategoryItemProvider } from './categoryItemProvider'\nexport type { ArenaTaxonProvider } from './taxonProvider'\n"]}
|
|
@@ -7,7 +7,7 @@ import { ExpressionVariable } from '../../expression';
|
|
|
7
7
|
import { SystemError, SystemErrorKeys } from '../../error';
|
|
8
8
|
import { ValidatorErrorKeys } from '../../validation';
|
|
9
9
|
import { NodeNativeProperties } from './nodeDefExpressionNativeProperties';
|
|
10
|
-
import {
|
|
10
|
+
import { RecordNodeValues } from '../../node/nodeValues';
|
|
11
11
|
/**
|
|
12
12
|
* Determines the actual context node def
|
|
13
13
|
* - attribute def => parent entity def
|
|
@@ -63,7 +63,8 @@ export class NodeDefIdentifierEvaluator extends IdentifierEvaluator {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
// check if identifier is a composite attribute value prop
|
|
66
|
-
if (NodeDefs.isAttribute(objectContext) &&
|
|
66
|
+
if (NodeDefs.isAttribute(objectContext) &&
|
|
67
|
+
RecordNodeValues.isValueProp({ nodeDef: objectContext, prop: exprName })) {
|
|
67
68
|
return objectContext;
|
|
68
69
|
}
|
|
69
70
|
if (memberProperty) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../../src/nodeDefExpressionEvaluator/node/identifier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACtG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAErG,OAAO,EAAE,kBAAkB,EAAwB,MAAM,kBAAkB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AC,IAAI,CAAC,CAAA;oBACxC,MAAM,QAAQ,CAAA;gBAChB,CAAC;YACH,CAAC;YACD,qCAAqC;YACrC,KAAK,CAAC,YAAY,CAAC,wBAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAA;YAE5E,oFAAoF;YACpF,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAA;gBACtF,IAAI,sBAAsB,EAAE,CAAC;oBAC3B,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAA;gBACvC,CAAC;gBACD,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;oBACtD,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;oBAChD,MAAM,gBAAgB,CAAA;gBACxB,CAAC;gBACD,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { NodeDef, NodeDefProps, NodeDefType } from '../../nodeDef/nodeDef'\nimport { getNodeDefChildren, getNodeDefParent, getNodeDefSource } from '../../survey/surveys/nodeDefs'\nimport { NodeDefs } from '../../nodeDef/nodeDefs'\nimport { Objects, Queue } from '../../utils'\nimport { IdentifierEvaluator } from '../../expression/javascript/node/identifier'\nimport { getGlobalObjectProperty, isForbiddenPropertyName } from '../../expression/javascript/global'\nimport { NodeDefExpressionContext } from '../context'\nimport { ExpressionVariable, IdentifierExpression } from '../../expression'\nimport { SystemError, SystemErrorKeys } from '../../error'\nimport { ValidatorErrorKeys } from '../../validation'\nimport { NodeNativeProperties } from './nodeDefExpressionNativeProperties'\nimport { NodeValues } from '../../node/nodeValues'\n\n/**\n * Determines the actual context node def\n * - attribute def => parent entity def\n * - virtual entity def => source node def\n * - entity def => entity def itself\n */\nconst findActualContextNode = (params: {\n context: NodeDefExpressionContext\n}): NodeDef<NodeDefType, NodeDefProps> | undefined => {\n const { context } = params\n const { survey, object: nodeDefObjectContext } = context\n\n if (!nodeDefObjectContext) return undefined\n\n if (NodeDefs.isAttribute(nodeDefObjectContext)) {\n return getNodeDefParent({ survey, nodeDef: nodeDefObjectContext })\n }\n if (nodeDefObjectContext.virtual) {\n return getNodeDefSource({ survey, nodeDef: nodeDefObjectContext })\n }\n return nodeDefObjectContext\n}\n\nexport class NodeDefIdentifierEvaluator extends IdentifierEvaluator<NodeDefExpressionContext> {\n evaluate(expressionNode: IdentifierExpression): Promise<any> {\n try {\n return Promise.resolve(this.evaluateIdentifier(expressionNode))\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private evaluateIdentifier(expressionNode: IdentifierExpression): any {\n const { context } = this\n const { nodeDefContext, object: objectContext, itemsFilter, memberProperty } = context\n const { name: exprName } = expressionNode\n\n if (isForbiddenPropertyName(exprName)) {\n this.throwIdentifierNotFound(expressionNode)\n }\n\n if (exprName === ExpressionVariable.CONTEXT) {\n if (nodeDefContext) {\n this.addReferencedNodeDefUuid(nodeDefContext.uuid)\n }\n return nodeDefContext\n }\n\n // global objects (e.g. Math, String)\n const globalObjectProperty = getGlobalObjectProperty(exprName, objectContext)\n if (globalObjectProperty !== null) {\n return globalObjectProperty\n }\n\n if (itemsFilter) {\n const prop = objectContext?.props?.[exprName] ?? objectContext?.props?.extra?.[exprName]\n if (!Objects.isEmpty(prop)) {\n return prop\n }\n }\n\n // check if identifier is a composite attribute value prop\n if (NodeDefs.isAttribute(objectContext) && NodeValues.isValueProp({ nodeDef: objectContext, prop: exprName })) {\n return objectContext\n }\n\n if (memberProperty) {\n // property of a member expression (e.g. text_attr.length or text_attr.toUpperCase()): native properties first\n const nativeProperty = this.findNativeProperty(expressionNode)\n if (nativeProperty) return nativeProperty.value\n return this.getReferencedNodeDef(expressionNode)\n }\n // identifier not in a member expression: node defs first, so that node defs named like native properties\n // (e.g. \"name\", \"type\", \"trim\") are always found (and registered as dependencies)\n const referencedNodeDef = this.findReferencedNodeDef(expressionNode)\n if (referencedNodeDef) return referencedNodeDef\n\n const nativeProperty = this.findNativeProperty(expressionNode)\n if (nativeProperty) return nativeProperty.value\n\n return this.throwIdentifierNotFound(expressionNode)\n }\n\n /**\n * Finds the identifier among the native properties or functions of the context object\n * (e.g. String.length or String.toUpperCase()).\n */\n private findNativeProperty(expressionNode: IdentifierExpression): { value: any } | null {\n const { object: objectContext } = this.context\n const { name: exprName } = expressionNode\n\n const globalOrNativeProperty = this.findGlobalOrNativeProperty(expressionNode)\n if (globalOrNativeProperty) {\n return globalOrNativeProperty\n }\n if (NodeNativeProperties.hasNativeProperty({ nodeDefOrValue: objectContext, propName: exprName })) {\n return {\n value: NodeNativeProperties.evalNodeDefProperty({ nodeDefOrValue: objectContext, propName: exprName }),\n }\n }\n return null\n }\n\n private findReferencedNodeDef(expressionNode: IdentifierExpression): NodeDef<NodeDefType, NodeDefProps> | undefined {\n const { nodeDefCurrent, selfReferenceAllowed } = this.context\n const referencedNodeDef = this.findIdentifierAmongReachableNodeDefs(expressionNode)\n if (!referencedNodeDef) return undefined\n\n if (!selfReferenceAllowed && referencedNodeDef.uuid === nodeDefCurrent?.uuid) {\n throw new SystemError(ValidatorErrorKeys.expressions.cannotUseCurrentNode, { name: expressionNode.name })\n }\n this.addReferencedNodeDefUuid(referencedNodeDef.uuid)\n return referencedNodeDef\n }\n\n private getReferencedNodeDef(expressionNode: IdentifierExpression): NodeDef<NodeDefType, NodeDefProps> {\n return this.findReferencedNodeDef(expressionNode) ?? this.throwIdentifierNotFound(expressionNode)\n }\n\n private throwIdentifierNotFound(expressionNode: IdentifierExpression): never {\n throw new SystemError(SystemErrorKeys.expression.identifierNotFound, {\n name: expressionNode.name,\n contextObject: this.context.object?.props?.name,\n })\n }\n\n private addReferencedNodeDefUuid(uuid: string) {\n const { context } = this\n const { referencedNodeDefUuids = new Set() } = context\n context.referencedNodeDefUuids = referencedNodeDefUuids.add(uuid)\n }\n\n /**\n * Tries to find the specified identifier among the node defs that can be \"reached\" from the context node def.\n */\n protected findIdentifierAmongReachableNodeDefs(\n expressionNode: IdentifierExpression\n ): NodeDef<NodeDefType, NodeDefProps> | undefined {\n const { object: contextObject } = this.context\n\n if (!contextObject) return undefined\n\n // stop at the first match, without visiting all the reachable node defs\n for (const reachableNodeDef of this.iterateReachableNodeDefs()) {\n if (reachableNodeDef.props.name === expressionNode.name) {\n return reachableNodeDef\n }\n }\n return undefined\n }\n\n /**\n * Iterates over the reachable node defs, i.e. the actual context node def, the children of its ancestors\n * (including the ones inside single entities) and the ancestors themselves, yielding every node def only once.\n */\n private *iterateReachableNodeDefs(): Generator<NodeDef<NodeDefType, NodeDefProps>> {\n const { context } = this\n const { survey, includeAnalysis } = context\n\n const reachableNodeDefUuids = new Set<string>()\n const visitedUuids = new Set<string>()\n\n const queue = new Queue<NodeDef<NodeDefType>>()\n\n const actualContextNode = findActualContextNode({ context })\n if (actualContextNode) {\n queue.enqueue(actualContextNode)\n reachableNodeDefUuids.add(actualContextNode.uuid)\n yield actualContextNode\n }\n\n while (!queue.isEmpty()) {\n const entityDefCurrent = queue.dequeue()!\n const entityDefCurrentChildren = getNodeDefChildren({ survey, nodeDef: entityDefCurrent, includeAnalysis })\n for (const childDef of entityDefCurrentChildren) {\n if (!reachableNodeDefUuids.has(childDef.uuid)) {\n reachableNodeDefUuids.add(childDef.uuid)\n yield childDef\n }\n }\n // visit nodes inside single entities\n queue.enqueueItems(entityDefCurrentChildren.filter(NodeDefs.isSingleEntity))\n\n // avoid visiting 2 times the same entity definition when traversing single entities\n if (!visitedUuids.has(entityDefCurrent.uuid)) {\n const entityDefCurrentParent = getNodeDefParent({ survey, nodeDef: entityDefCurrent })\n if (entityDefCurrentParent) {\n queue.enqueue(entityDefCurrentParent)\n }\n if (!reachableNodeDefUuids.has(entityDefCurrent.uuid)) {\n reachableNodeDefUuids.add(entityDefCurrent.uuid)\n yield entityDefCurrent\n }\n visitedUuids.add(entityDefCurrent.uuid)\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../../src/nodeDefExpressionEvaluator/node/identifier.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACtG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAErG,OAAO,EAAE,kBAAkB,EAA6B,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,CAAC,MAA6C,EAA+B,EAAE;IAC3G,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAA;IAExD,IAAI,CAAC,oBAAoB;QAAE,OAAO,SAAS,CAAA;IAE3C,IAAI,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC/C,OAAO,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAA;IACpE,CAAC;IACD,IAAI,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AA;gBACxB,CAAC;gBACD,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { ArenaAnyNodeDef } from '../../nodeDef/nodeDef'\nimport { getNodeDefChildren, getNodeDefParent, getNodeDefSource } from '../../survey/surveys/nodeDefs'\nimport { NodeDefs } from '../../nodeDef/nodeDefs'\nimport { Objects, Queue } from '../../utils'\nimport { IdentifierEvaluator } from '../../expression/javascript/node/identifier'\nimport { getGlobalObjectProperty, isForbiddenPropertyName } from '../../expression/javascript/global'\nimport { NodeDefExpressionContext } from '../context'\nimport { ExpressionVariable, ArenaIdentifierExpression } from '../../expression'\nimport { SystemError, SystemErrorKeys } from '../../error'\nimport { ValidatorErrorKeys } from '../../validation'\nimport { NodeNativeProperties } from './nodeDefExpressionNativeProperties'\nimport { RecordNodeValues } from '../../node/nodeValues'\n\n/**\n * Determines the actual context node def\n * - attribute def => parent entity def\n * - virtual entity def => source node def\n * - entity def => entity def itself\n */\nconst findActualContextNode = (params: { context: NodeDefExpressionContext }): ArenaAnyNodeDef | undefined => {\n const { context } = params\n const { survey, object: nodeDefObjectContext } = context\n\n if (!nodeDefObjectContext) return undefined\n\n if (NodeDefs.isAttribute(nodeDefObjectContext)) {\n return getNodeDefParent({ survey, nodeDef: nodeDefObjectContext })\n }\n if (nodeDefObjectContext.virtual) {\n return getNodeDefSource({ survey, nodeDef: nodeDefObjectContext })\n }\n return nodeDefObjectContext\n}\n\nexport class NodeDefIdentifierEvaluator extends IdentifierEvaluator<NodeDefExpressionContext> {\n evaluate(expressionNode: ArenaIdentifierExpression): Promise<any> {\n try {\n return Promise.resolve(this.evaluateIdentifier(expressionNode))\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private evaluateIdentifier(expressionNode: ArenaIdentifierExpression): any {\n const { context } = this\n const { nodeDefContext, object: objectContext, itemsFilter, memberProperty } = context\n const { name: exprName } = expressionNode\n\n if (isForbiddenPropertyName(exprName)) {\n this.throwIdentifierNotFound(expressionNode)\n }\n\n if (exprName === ExpressionVariable.CONTEXT) {\n if (nodeDefContext) {\n this.addReferencedNodeDefUuid(nodeDefContext.uuid)\n }\n return nodeDefContext\n }\n\n // global objects (e.g. Math, String)\n const globalObjectProperty = getGlobalObjectProperty(exprName, objectContext)\n if (globalObjectProperty !== null) {\n return globalObjectProperty\n }\n\n if (itemsFilter) {\n const prop = objectContext?.props?.[exprName] ?? objectContext?.props?.extra?.[exprName]\n if (!Objects.isEmpty(prop)) {\n return prop\n }\n }\n\n // check if identifier is a composite attribute value prop\n if (\n NodeDefs.isAttribute(objectContext) &&\n RecordNodeValues.isValueProp({ nodeDef: objectContext, prop: exprName })\n ) {\n return objectContext\n }\n\n if (memberProperty) {\n // property of a member expression (e.g. text_attr.length or text_attr.toUpperCase()): native properties first\n const nativeProperty = this.findNativeProperty(expressionNode)\n if (nativeProperty) return nativeProperty.value\n return this.getReferencedNodeDef(expressionNode)\n }\n // identifier not in a member expression: node defs first, so that node defs named like native properties\n // (e.g. \"name\", \"type\", \"trim\") are always found (and registered as dependencies)\n const referencedNodeDef = this.findReferencedNodeDef(expressionNode)\n if (referencedNodeDef) return referencedNodeDef\n\n const nativeProperty = this.findNativeProperty(expressionNode)\n if (nativeProperty) return nativeProperty.value\n\n return this.throwIdentifierNotFound(expressionNode)\n }\n\n /**\n * Finds the identifier among the native properties or functions of the context object\n * (e.g. String.length or String.toUpperCase()).\n */\n private findNativeProperty(expressionNode: ArenaIdentifierExpression): { value: any } | null {\n const { object: objectContext } = this.context\n const { name: exprName } = expressionNode\n\n const globalOrNativeProperty = this.findGlobalOrNativeProperty(expressionNode)\n if (globalOrNativeProperty) {\n return globalOrNativeProperty\n }\n if (NodeNativeProperties.hasNativeProperty({ nodeDefOrValue: objectContext, propName: exprName })) {\n return {\n value: NodeNativeProperties.evalNodeDefProperty({ nodeDefOrValue: objectContext, propName: exprName }),\n }\n }\n return null\n }\n\n private findReferencedNodeDef(expressionNode: ArenaIdentifierExpression): ArenaAnyNodeDef | undefined {\n const { nodeDefCurrent, selfReferenceAllowed } = this.context\n const referencedNodeDef = this.findIdentifierAmongReachableNodeDefs(expressionNode)\n if (!referencedNodeDef) return undefined\n\n if (!selfReferenceAllowed && referencedNodeDef.uuid === nodeDefCurrent?.uuid) {\n throw new SystemError(ValidatorErrorKeys.expressions.cannotUseCurrentNode, { name: expressionNode.name })\n }\n this.addReferencedNodeDefUuid(referencedNodeDef.uuid)\n return referencedNodeDef\n }\n\n private getReferencedNodeDef(expressionNode: ArenaIdentifierExpression): ArenaAnyNodeDef {\n return this.findReferencedNodeDef(expressionNode) ?? this.throwIdentifierNotFound(expressionNode)\n }\n\n private throwIdentifierNotFound(expressionNode: ArenaIdentifierExpression): never {\n throw new SystemError(SystemErrorKeys.expression.identifierNotFound, {\n name: expressionNode.name,\n contextObject: this.context.object?.props?.name,\n })\n }\n\n private addReferencedNodeDefUuid(uuid: string) {\n const { context } = this\n const { referencedNodeDefUuids = new Set() } = context\n context.referencedNodeDefUuids = referencedNodeDefUuids.add(uuid)\n }\n\n /**\n * Tries to find the specified identifier among the node defs that can be \"reached\" from the context node def.\n */\n protected findIdentifierAmongReachableNodeDefs(\n expressionNode: ArenaIdentifierExpression\n ): ArenaAnyNodeDef | undefined {\n const { object: contextObject } = this.context\n\n if (!contextObject) return undefined\n\n // stop at the first match, without visiting all the reachable node defs\n for (const reachableNodeDef of this.iterateReachableNodeDefs()) {\n if (reachableNodeDef.props.name === expressionNode.name) {\n return reachableNodeDef\n }\n }\n return undefined\n }\n\n /**\n * Iterates over the reachable node defs, i.e. the actual context node def, the children of its ancestors\n * (including the ones inside single entities) and the ancestors themselves, yielding every node def only once.\n */\n private *iterateReachableNodeDefs(): Generator<ArenaAnyNodeDef> {\n const { context } = this\n const { survey, includeAnalysis } = context\n\n const reachableNodeDefUuids = new Set<string>()\n const visitedUuids = new Set<string>()\n\n const queue = new Queue<ArenaAnyNodeDef>()\n\n const actualContextNode = findActualContextNode({ context })\n if (actualContextNode) {\n queue.enqueue(actualContextNode)\n reachableNodeDefUuids.add(actualContextNode.uuid)\n yield actualContextNode\n }\n\n while (!queue.isEmpty()) {\n const entityDefCurrent = queue.dequeue()!\n const entityDefCurrentChildren = getNodeDefChildren({ survey, nodeDef: entityDefCurrent, includeAnalysis })\n for (const childDef of entityDefCurrentChildren) {\n if (!reachableNodeDefUuids.has(childDef.uuid)) {\n reachableNodeDefUuids.add(childDef.uuid)\n yield childDef\n }\n }\n // visit nodes inside single entities\n queue.enqueueItems(entityDefCurrentChildren.filter(NodeDefs.isSingleEntity))\n\n // avoid visiting 2 times the same entity definition when traversing single entities\n if (!visitedUuids.has(entityDefCurrent.uuid)) {\n const entityDefCurrentParent = getNodeDefParent({ survey, nodeDef: entityDefCurrent })\n if (entityDefCurrentParent) {\n queue.enqueue(entityDefCurrentParent)\n }\n if (!reachableNodeDefUuids.has(entityDefCurrent.uuid)) {\n reachableNodeDefUuids.add(entityDefCurrent.uuid)\n yield entityDefCurrent\n }\n visitedUuids.add(entityDefCurrent.uuid)\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../../src/nodeDefExpressionEvaluator/node/member.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAGzE,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,CAAA;AAE/E,MAAM,OAAO,sBAAuB,SAAQ,eAAyC;IAC7E,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../../src/nodeDefExpressionEvaluator/node/member.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAGzE,MAAM,SAAS,GA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CAAC,UAAe;QAC7C,IAAI,SAAS,CAAC,UAAU,CAAC;YAAE,OAAO,UAAU,CAAA;QAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAA;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;IACpC,CAAC;CACF","sourcesContent":["import { ArenaMemberExpression } from '../../expression'\nimport { MemberEvaluator } from '../../expression/javascript/node/member'\nimport { NodeDefExpressionContext } from '../context'\n\nconst isNodeDef = (obj: any) => obj && typeof obj === 'object' && 'uuid' in obj\n\nexport class NodeDefMemberEvaluator extends MemberEvaluator<NodeDefExpressionContext> {\n async evaluate(expressionNode: ArenaMemberExpression): Promise<any> {\n const { object, property, computed } = expressionNode\n\n const objectEval = await this.evaluator.evaluateNode(object, this.context)\n // null or undefined object (e.g. parent of the root entity)\n if (objectEval === null || objectEval === undefined) {\n return null\n }\n if (computed) {\n // access element at index (e.g. plot[1] or plot[index(...)]) or filter items\n // (e.g. plot[plot_id == 1]).\n // There is no actual array of node instances to index/filter at this (schema) level, so the\n // result is always the referenced node def itself. Still evaluate the property expression,\n // best-effort, so that any node def referenced inside an index/filter predicate (e.g. the\n // \"plot_id == 1\" part above, or a predicate referencing sibling/cousin node defs via\n // \"$context\") is registered as a dependency too. Errors are ignored here: this evaluation is\n // only performed to detect dependencies as a side effect, not to compute an actual value, and\n // it must not affect expression validation (e.g. NodeDefExpressionValidator) or cause other\n // referenced node defs found so far to be discarded by the caller.\n try {\n await this.evaluator.evaluateNode(property, {\n ...this.context,\n object: objectEval,\n })\n } catch {\n // ignore\n }\n return objectEval\n }\n\n // eval property and return it (e.g. plot.plot_id)\n // allow self node def reference because the referenced node at runtime can be different from current node\n // e.g. current node = plot_id ; expression = parent(plot).plot[index(plot) - 1].plot_id\n\n const propertyNodeDefContext = this.determinePropertyNodeDefContext(objectEval)\n\n return this.evaluator.evaluateNode(property, {\n ...this.context,\n object: objectEval,\n nodeDefContext: propertyNodeDefContext,\n selfReferenceAllowed: true,\n memberProperty: true,\n })\n }\n\n determinePropertyNodeDefContext(objectEval: any): any {\n if (isNodeDef(objectEval)) return objectEval\n if (Array.isArray(objectEval) && isNodeDef(objectEval[0])) return objectEval[0]\n return this.context.nodeDefContext\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thisEvaluator.js","sourceRoot":"","sources":["../../../../src/nodeDefExpressionEvaluator/node/thisEvaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAG9D,MAAM,OAAO,oBAAqB,SAAQ,aAAuC;IAC/E,QAAQ;QACN,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAEpD,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA;IAC/E,CAAC;IAED,eAAe;QACb,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAC/C,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,CAAA;QAEhC,IAAI,cAAc,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC;YAC7C,MAAM,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"thisEvaluator.js","sourceRoot":"","sources":["../../../../src/nodeDefExpressionEvaluator/node/thisE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,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { CategoryItemGenerator } from '../../category/categoryItemGenerator'\nimport { ThisEvaluator } from '../../expression/javascript/node/this'\nimport { NodeDefType } from '../../nodeDef/nodeDef'\nimport { NodeDefs } from '../../nodeDef/nodeDefs'\nimport { ArenaNodeDefCode } from '../../nodeDef/types/code'\nimport { ArenaNodeDefTaxon } from '../../nodeDef/types/taxon'\nimport { TaxonGenerator } from '../../taxonomy/taxonGenerator'\nimport { NodeDefExpressionContext } from '../context'\n\nexport class NodeDefThisEvaluator extends ThisEvaluator<NodeDefExpressionContext> {\n evaluate(): Promise<any> {\n const { nodeDefCurrent, itemsFilter } = this.context\n\n return Promise.resolve(itemsFilter ? this.createEmptyItem() : nodeDefCurrent)\n }\n\n createEmptyItem() {\n const { survey, nodeDefCurrent } = this.context\n if (!nodeDefCurrent) return null\n\n if (nodeDefCurrent.type === NodeDefType.code) {\n const categoryUuid = NodeDefs.getCategoryUuid(nodeDefCurrent as ArenaNodeDefCode)\n return categoryUuid ? CategoryItemGenerator.generateItem({ survey, categoryUuid }) : null\n }\n if (nodeDefCurrent.type === NodeDefType.taxon) {\n const taxonomyUuid = NodeDefs.getTaxonomyUuid(nodeDefCurrent as ArenaNodeDefTaxon)\n return taxonomyUuid ? TaxonGenerator.generateTaxon({ survey, taxonomyUuid }) : null\n }\n return null\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taxonProvider.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/taxonProvider.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"taxonProvider.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/taxonProvider.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaSurvey } from '../survey'\nimport { ArenaTaxon } from '../taxonomy'\n\nexport interface ArenaTaxonProvider {\n getTaxonByCode: (params: {\n survey: ArenaSurvey\n taxonomyUuid: string\n taxonCode: string\n draft: boolean\n }) => Promise<ArenaTaxon | undefined>\n getTaxonByUuid: (params: {\n survey: ArenaSurvey\n taxonomyUuid: string\n taxonUuid: string\n draft: boolean\n }) => Promise<ArenaTaxon | undefined>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/validator.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/validator.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAyB,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,uBAAuB,GAAG,CAAC,MAAkE,EAAE,EAAE;;IACrG,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAA;IAEzC,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC;QACpD,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAA;IAEzD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,0CAAE,IAAI,EAAE,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,OAAO,0BAA2B,SAAQ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Parent } from '../survey/surveys/nodeDefs'\nimport { ArenaValidationResult, ValidationResultFactory } from '../validation'\nimport { NodeDefs } from '../nodeDef/nodeDefs'\nimport { NodeDefExpressionContext } from './context'\nimport { NodeDefExpressionEvaluator } from './evaluator'\nimport { SystemError } from '../error'\n\nconst determineNodeDefContext = (params: { survey: ArenaSurvey; nodeDefCurrent: ArenaNodeDef<any> }) => {\n const { survey, nodeDefCurrent } = params\n\n const nodeDefContext = NodeDefs.isRoot(nodeDefCurrent)\n ? nodeDefCurrent\n : getNodeDefParent({ survey, nodeDef: nodeDefCurrent })\n\n if (!nodeDefContext) {\n throw new Error(`Cannot find context nodeDef: ${nodeDefCurrent?.props?.name}`)\n }\n return nodeDefContext\n}\n\nexport class NodeDefExpressionValidator extends NodeDefExpressionEvaluator {\n async validate(\n params: NodeDefExpressionContext & {\n expression: string\n }\n ): Promise<{ validationResult: ArenaValidationResult; referencedNodeDefUuids: Set<string> }> {\n const { expression, survey, nodeDefCurrent, nodeDefContext: nodeDefContextParam } = params\n try {\n const nodeDefContext = nodeDefContextParam ?? determineNodeDefContext({ survey, nodeDefCurrent })\n\n const referencedNodeDefUuids = new Set<string>()\n const evaluationParams = { ...params, nodeDefContext, object: nodeDefCurrent, referencedNodeDefUuids }\n\n await this.evaluate(expression, evaluationParams)\n\n return {\n validationResult: ValidationResultFactory.createInstance(),\n referencedNodeDefUuids,\n }\n } catch (error: any) {\n const isSystemError = error instanceof SystemError\n const key = isSystemError ? error.key : 'expression.invalid'\n const params = isSystemError ? error.params : { details: error.description ?? error.toString() }\n return {\n validationResult: ValidationResultFactory.createInstance({ valid: false, key, params }),\n referencedNodeDefUuids: new Set(),\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeDefSelfReferences.js","sourceRoot":"","sources":["../../../../src/record/_records/nodeDefSelfReferences.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"nodeDefSelfReferences.js","sour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CAAA","sourcesContent":["import { ArenaAnyExpressionNode, ExpressionNodeType } from '../../expression'\nimport { parseExpression } from '../../expression/javascript/evaluator'\nimport { ArenaAnyNodeDef, NodeDefs } from '../../nodeDef'\nimport { SurveyDependencyType } from '../../survey/survey'\n\n/**\n * True if the identifier is used as (or inside) the property of a member expression (e.g. \"dbh\" in\n * \"parent(tree).tree.dbh\" or in \"tree[dbh > 10]\"): there it can refer to nodes outside the context entity.\n */\nconst isReferencedThroughMember = (params: {\n expressionNode: unknown\n name: string\n inMemberProperty: boolean\n}): boolean => {\n const { expressionNode, name, inMemberProperty } = params\n if (!expressionNode || typeof expressionNode !== 'object') return false\n if (Array.isArray(expressionNode)) {\n return expressionNode.some((item) => isReferencedThroughMember({ expressionNode: item, name, inMemberProperty }))\n }\n // parsed expression nodes (or their array or object properties)\n const node = expressionNode as ArenaAnyExpressionNode\n if (node.type === ExpressionNodeType.Identifier) {\n return inMemberProperty && node.name === name\n }\n if (node.type === ExpressionNodeType.Member) {\n const { object, property } = node\n return (\n isReferencedThroughMember({ expressionNode: object, name, inMemberProperty }) ||\n isReferencedThroughMember({ expressionNode: property, name, inMemberProperty: true })\n )\n }\n return Object.values(expressionNode).some((child) =>\n isReferencedThroughMember({ expressionNode: child, name, inMemberProperty })\n )\n}\n\nconst isExpressionSelfReferenceLocal = (params: { expression: string | undefined; name: string }): boolean => {\n const { expression, name } = params\n if (!expression) return true\n try {\n return !isReferencedThroughMember({ expressionNode: parseExpression(expression), name, inMemberProperty: false })\n } catch {\n // invalid expression: be conservative\n return false\n }\n}\n\n/**\n * Returns true if the node def references itself in its expressions of the specified dependency type only\n * as a plain identifier (e.g. \"dbh > 0\" in a validation of \"dbh\"): such a reference is resolved among the\n * children of the node's parent entity, so only the node and its siblings depend on it, not every node with\n * the same node def in the record.\n */\nconst isSelfReferenceLocal = (params: { nodeDef: ArenaAnyNodeDef; dependencyType: SurveyDependencyType }): boolean => {\n const { nodeDef, dependencyType } = params\n // self references by plain identifier are allowed only in validation expressions (see dependencies.ts)\n if (dependencyType !== SurveyDependencyType.validations) return false\n const name = NodeDefs.getName(nodeDef)\n return NodeDefs.getValidationsExpressions(nodeDef).every(\n ({ expression, applyIf }) =>\n isExpressionSelfReferenceLocal({ expression, name }) &&\n isExpressionSelfReferenceLocal({ expression: applyIf, name })\n )\n}\n\nexport const NodeDefSelfReferences = {\n isSelfReferenceLocal,\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RecordNodes } from '../../node';
|
|
2
2
|
import { NodeDefs } from '../../nodeDef';
|
|
3
3
|
import { Surveys } from '../../survey';
|
|
4
4
|
import { Numbers } from '../../utils';
|
|
@@ -10,20 +10,20 @@ const addStats = (statsAcc, statsToAdd) => {
|
|
|
10
10
|
};
|
|
11
11
|
const isAttributeRequired = (entity, nodeDef) => NodeDefs.isKey(nodeDef) ||
|
|
12
12
|
NodeDefs.isRequired(nodeDef) ||
|
|
13
|
-
(NodeDefs.isRequiredIfDefined(nodeDef) &&
|
|
13
|
+
(NodeDefs.isRequiredIfDefined(nodeDef) && RecordNodes.isChildRequired(entity, nodeDef.uuid));
|
|
14
14
|
const getAttributeCompletionStats = (params) => {
|
|
15
15
|
const { record, entity, nodeDef } = params;
|
|
16
16
|
if (NodeDefs.isMultiple(nodeDef)) {
|
|
17
|
-
const minCount =
|
|
17
|
+
const minCount = RecordNodes.getChildrenMinCount({ parentNode: entity, nodeDef });
|
|
18
18
|
if (Number.isNaN(minCount) || minCount <= 0)
|
|
19
19
|
return emptyStats();
|
|
20
|
-
const filledNodesCount = getChildren(entity, nodeDef.uuid)(record).filter(
|
|
20
|
+
const filledNodesCount = getChildren(entity, nodeDef.uuid)(record).filter(RecordNodes.isValueNotBlank).length;
|
|
21
21
|
return { total: minCount, filled: Math.min(filledNodesCount, minCount) };
|
|
22
22
|
}
|
|
23
23
|
if (!isAttributeRequired(entity, nodeDef))
|
|
24
24
|
return emptyStats();
|
|
25
25
|
const node = getChildren(entity, nodeDef.uuid)(record)[0];
|
|
26
|
-
return { total: 1, filled: node &&
|
|
26
|
+
return { total: 1, filled: node && RecordNodes.isValueNotBlank(node) ? 1 : 0 };
|
|
27
27
|
};
|
|
28
28
|
const getChildEntityCompletionStats = (params) => {
|
|
29
29
|
const { survey, record, parentEntity, nodeDef } = params;
|
|
@@ -32,7 +32,7 @@ const getChildEntityCompletionStats = (params) => {
|
|
|
32
32
|
const childEntity = childEntities[0];
|
|
33
33
|
return childEntity ? getEntityCompletionStats({ survey, record, entity: childEntity }) : emptyStats();
|
|
34
34
|
}
|
|
35
|
-
const minCountRaw =
|
|
35
|
+
const minCountRaw = RecordNodes.getChildrenMinCount({ parentNode: parentEntity, nodeDef });
|
|
36
36
|
const minCount = Number.isNaN(minCountRaw) ? 0 : Math.max(minCountRaw, 0);
|
|
37
37
|
const stats = emptyStats();
|
|
38
38
|
// entities added beyond the min count are still expected to be complete
|
|
@@ -49,7 +49,7 @@ export const getEntityCompletionStats = (params) => {
|
|
|
49
49
|
const childDefs = Surveys.getNodeDefChildren({ survey, nodeDef: entityDef }).filter(NodeDefs.isInCycle(getCycle(record)));
|
|
50
50
|
const stats = emptyStats();
|
|
51
51
|
for (const childDef of childDefs) {
|
|
52
|
-
if (!
|
|
52
|
+
if (!RecordNodes.isChildApplicable(entity, childDef.uuid))
|
|
53
53
|
continue;
|
|
54
54
|
if (NodeDefs.isEntity(childDef)) {
|
|
55
55
|
if (!includeNestedEntities)
|
|
@@ -71,7 +71,7 @@ const toCompletionPercent = (stats) => {
|
|
|
71
71
|
/**
|
|
72
72
|
* Returns the percentage of completion of the given entity (0-100), considering every descendant recursively.
|
|
73
73
|
* A required or key attribute is considered filled when it has a non empty value; multiple attributes and
|
|
74
|
-
* entities are considered filled based on their min count (see
|
|
74
|
+
* entities are considered filled based on their min count (see RecordNodes.getChildrenMinCount).
|
|
75
75
|
*/
|
|
76
76
|
export const getEntityCompletionPercent = (params) => toCompletionPercent(getEntityCompletionStats(params));
|
|
77
77
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordCompletion.js","sourceRoot":"","sources":["../../../../src/record/_records/recordCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,
|
|
1
|
+
{"version":3,"file":"recordCompletion.js","sourceRoot":"","sources":["../../../../src/record/_records/recordCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,WAAW,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAmB,QAAQ,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAe,OAAO,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAOhE,MAAM,UAAU,GAAG,GAA0B,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAA;AAEzE,MAAM,QAAQ,GAAG,CAAC,QAA+B,EAAE,UAAiC,EAAQ,EAAE;IAC5F,QAAQ,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAA;IAClC,QAAQ,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,CAAA;AACtC,CAAC,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,MAAuB,EAAE,OAAwB,EAAW,EAAE,CACzF,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;IAC5B,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;AAE9F,MAAM,2BAA2B,GAAG,CAAC,MAIpC,EAAyB,EAAE;IAC1B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IA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AAG,CAAC,MAI7C,EAAU,EAAE,CAAC,mBAAmB,CAAC,wBAAwB,iCAAM,MAAM,KAAE,qBAAqB,EAAE,KAAK,IAAG,CAAC,CAAA;AAExG;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAAoD,EAAU,EAAE;IACzG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IACjC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAClC,OAAO,UAAU,CAAC,CAAC,CAAC,0BAA0B,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5F,CAAC,CAAA","sourcesContent":["import { ArenaRecordNode, RecordNodes } from '../../node'\nimport { ArenaAnyNodeDef, NodeDefs } from '../../nodeDef'\nimport { ArenaSurvey, Surveys } from '../../survey'\nimport { Numbers } from '../../utils'\nimport { ArenaRecord } from '../record'\nimport { getChildren, getCycle, getRoot } from './recordGetters'\n\nexport interface EntityCompletionStats {\n total: number\n filled: number\n}\n\nconst emptyStats = (): EntityCompletionStats => ({ total: 0, filled: 0 })\n\nconst addStats = (statsAcc: EntityCompletionStats, statsToAdd: EntityCompletionStats): void => {\n statsAcc.total += statsToAdd.total\n statsAcc.filled += statsToAdd.filled\n}\n\nconst isAttributeRequired = (entity: ArenaRecordNode, nodeDef: ArenaAnyNodeDef): boolean =>\n NodeDefs.isKey(nodeDef) ||\n NodeDefs.isRequired(nodeDef) ||\n (NodeDefs.isRequiredIfDefined(nodeDef) && RecordNodes.isChildRequired(entity, nodeDef.uuid))\n\nconst getAttributeCompletionStats = (params: {\n record: ArenaRecord\n entity: ArenaRecordNode\n nodeDef: ArenaAnyNodeDef\n}): EntityCompletionStats => {\n const { record, entity, nodeDef } = params\n\n if (NodeDefs.isMultiple(nodeDef)) {\n const minCount = RecordNodes.getChildrenMinCount({ parentNode: entity, nodeDef })\n if (Number.isNaN(minCount) || minCount <= 0) return emptyStats()\n\n const filledNodesCount = getChildren(entity, nodeDef.uuid)(record).filter(RecordNodes.isValueNotBlank).length\n\n return { total: minCount, filled: Math.min(filledNodesCount, minCount) }\n }\n\n if (!isAttributeRequired(entity, nodeDef)) return emptyStats()\n\n const node = getChildren(entity, nodeDef.uuid)(record)[0]\n return { total: 1, filled: node && RecordNodes.isValueNotBlank(node) ? 1 : 0 }\n}\n\nconst getChildEntityCompletionStats = (params: {\n survey: ArenaSurvey\n record: ArenaRecord\n parentEntity: ArenaRecordNode\n nodeDef: ArenaAnyNodeDef\n}): EntityCompletionStats => {\n const { survey, record, parentEntity, nodeDef } = params\n const childEntities = getChildren(parentEntity, nodeDef.uuid)(record)\n\n if (NodeDefs.isSingle(nodeDef)) {\n const childEntity = childEntities[0]\n return childEntity ? getEntityCompletionStats({ survey, record, entity: childEntity }) : emptyStats()\n }\n\n const minCountRaw = RecordNodes.getChildrenMinCount({ parentNode: parentEntity, nodeDef })\n const minCount = Number.isNaN(minCountRaw) ? 0 : Math.max(minCountRaw, 0)\n\n const stats = emptyStats()\n // entities added beyond the min count are still expected to be complete\n for (const childEntity of childEntities) {\n addStats(stats, getEntityCompletionStats({ survey, record, entity: childEntity }))\n }\n // a missing repetition (below the min count) counts as a single incomplete unit\n stats.total += Math.max(minCount - childEntities.length, 0)\n return stats\n}\n\nexport const getEntityCompletionStats = (params: {\n survey: ArenaSurvey\n record: ArenaRecord\n entity: ArenaRecordNode\n includeNestedEntities?: boolean\n}): EntityCompletionStats => {\n const { survey, record, entity, includeNestedEntities = true } = params\n const entityDef = Surveys.getNodeDefByUuid({ survey, uuid: entity.nodeDefUuid })\n const childDefs = Surveys.getNodeDefChildren({ survey, nodeDef: entityDef }).filter(\n NodeDefs.isInCycle(getCycle(record))\n )\n\n const stats = emptyStats()\n for (const childDef of childDefs) {\n if (!RecordNodes.isChildApplicable(entity, childDef.uuid)) continue\n\n if (NodeDefs.isEntity(childDef)) {\n if (!includeNestedEntities) continue\n addStats(stats, getChildEntityCompletionStats({ survey, record, parentEntity: entity, nodeDef: childDef }))\n } else {\n addStats(stats, getAttributeCompletionStats({ record, entity, nodeDef: childDef }))\n }\n }\n return stats\n}\n\nconst toCompletionPercent = (stats: EntityCompletionStats): number => {\n const { total, filled } = stats\n if (total <= 0) return 100\n return Numbers.roundToPrecision((filled / total) * 100, 2)\n}\n\n/**\n * Returns the percentage of completion of the given entity (0-100), considering every descendant recursively.\n * A required or key attribute is considered filled when it has a non empty value; multiple attributes and\n * entities are considered filled based on their min count (see RecordNodes.getChildrenMinCount).\n */\nexport const getEntityCompletionPercent = (params: {\n survey: ArenaSurvey\n record: ArenaRecord\n entity: ArenaRecordNode\n}): number => toCompletionPercent(getEntityCompletionStats(params))\n\n/**\n * Returns the percentage of completion of the given entity (0-100), considering only its own attributes\n * (nested entities are ignored).\n */\nexport const getEntityOwnCompletionPercent = (params: {\n survey: ArenaSurvey\n record: ArenaRecord\n entity: ArenaRecordNode\n}): number => toCompletionPercent(getEntityCompletionStats({ ...params, includeNestedEntities: false }))\n\n/**\n * Returns the percentage of completion of the given record (0-100), i.e. the completion of its root entity.\n */\nexport const getRecordCompletionPercent = (params: { survey: ArenaSurvey; record: ArenaRecord }): number => {\n const { survey, record } = params\n const rootEntity = getRoot(record)\n return rootEntity ? getEntityCompletionPercent({ survey, record, entity: rootEntity }) : 0\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TraverseMethod } from '../../common';
|
|
2
2
|
import { SystemError, SystemErrorKeys } from '../../error';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { NodeDefs } from '../../nodeDef';
|
|
3
|
+
import { RecordNodes } from '../../node';
|
|
4
|
+
import { RecordNodeValues } from '../../node/nodeValues';
|
|
5
|
+
import { NodeDefs, } from '../../nodeDef';
|
|
6
6
|
import { defaultCycle, Surveys } from '../../survey';
|
|
7
7
|
import { Arrays, Queue } from '../../utils';
|
|
8
8
|
import { RECORD_STEP_DEFAULT } from '../record';
|
|
@@ -79,9 +79,9 @@ const isNodeFlagTrue = (isChildFlagTrue) => (node) => (record) => {
|
|
|
79
79
|
}
|
|
80
80
|
return true;
|
|
81
81
|
};
|
|
82
|
-
export const isNodeApplicable = isNodeFlagTrue((parent, nodeDefUuid) =>
|
|
83
|
-
export const isNodeEditable = isNodeFlagTrue((parent, nodeDefUuid) =>
|
|
84
|
-
export const isNodeVisible = isNodeFlagTrue((parent, nodeDefUuid) =>
|
|
82
|
+
export const isNodeApplicable = isNodeFlagTrue((parent, nodeDefUuid) => RecordNodes.isChildApplicable(parent, nodeDefUuid));
|
|
83
|
+
export const isNodeEditable = isNodeFlagTrue((parent, nodeDefUuid) => RecordNodes.isChildEditable(parent, nodeDefUuid));
|
|
84
|
+
export const isNodeVisible = isNodeFlagTrue((parent, nodeDefUuid) => RecordNodes.isChildVisible(parent, nodeDefUuid));
|
|
85
85
|
/**
|
|
86
86
|
* Whether a value is required for the node: key or always required attribute, or attribute with a "required if"
|
|
87
87
|
* condition met in its parent entity (evaluated condition stored in the parent node meta).
|
|
@@ -92,7 +92,7 @@ export const isNodeRequired = (nodeDef, node) => (record) => {
|
|
|
92
92
|
if (!NodeDefs.isRequiredIfDefined(nodeDef))
|
|
93
93
|
return false;
|
|
94
94
|
const parent = getParentNode(record, node);
|
|
95
|
-
return !!parent &&
|
|
95
|
+
return !!parent && RecordNodes.isChildRequired(parent, nodeDef.uuid);
|
|
96
96
|
};
|
|
97
97
|
export const getDependentCodeAttributes = (node) => (record) => {
|
|
98
98
|
if (record._nodesIndex) {
|
|
@@ -187,7 +187,7 @@ export const getDescendantsOrSelf = (node, nodeDefDescendant) => (record) => {
|
|
|
187
187
|
* Returns the first descendant (or the node itself) with the specified node def, or undefined if not found.
|
|
188
188
|
*/
|
|
189
189
|
export const getDescendant = (node, nodeDefDescendant) => (record) => getDescendantsOrSelf(node, nodeDefDescendant)(record)[0];
|
|
190
|
-
export const isDescendantOf = (node, ancestor) =>
|
|
190
|
+
export const isDescendantOf = (node, ancestor) => RecordNodes.getHierarchy(node).includes(ancestor.uuid);
|
|
191
191
|
export const visitDescendantsAndSelf = (node, visitor, traverseMethod = TraverseMethod.bfs) => (record) => {
|
|
192
192
|
if (traverseMethod === TraverseMethod.bfs) {
|
|
193
193
|
const queue = new Queue();
|
|
@@ -276,7 +276,7 @@ export const getEntitySiblings = (entity, includeSelf = false) => (record) => {
|
|
|
276
276
|
if (!parentEntity)
|
|
277
277
|
return [];
|
|
278
278
|
const siblingEntities = getChildren(parentEntity, entity.nodeDefUuid)(record);
|
|
279
|
-
return includeSelf ? siblingEntities : siblingEntities.filter((sibling) => !
|
|
279
|
+
return includeSelf ? siblingEntities : siblingEntities.filter((sibling) => !RecordNodes.areEqual(sibling, entity));
|
|
280
280
|
};
|
|
281
281
|
export const getAttributeSiblings = (node, nodeDef) => (record) => {
|
|
282
282
|
const parentEntity = getParent(node)(record);
|
|
@@ -310,7 +310,7 @@ export const findEntityByKeyValues = (survey, cycle, parentEntity, entityDefUuid
|
|
|
310
310
|
return keyDefs.every((keyDef) => {
|
|
311
311
|
const keyValue = siblingEntityKeyValuesByDefUuid[keyDef.uuid];
|
|
312
312
|
const keyValueSearch = keyValuesByDefUuid[keyDef.uuid];
|
|
313
|
-
return
|
|
313
|
+
return RecordNodeValues.isValueEqual({
|
|
314
314
|
survey,
|
|
315
315
|
nodeDef: keyDef,
|
|
316
316
|
value: keyValue,
|
|
@@ -395,7 +395,7 @@ export const getAncestorCodeAttributes = (survey, parentNode, nodeDef) => (recor
|
|
|
395
395
|
export const getAncestorCodePath = (survey, parentNode, nodeDef) => (record) => getAncestorCodeAttributes(survey, parentNode, nodeDef)(record).map((codeAttribute) => {
|
|
396
396
|
var _a;
|
|
397
397
|
var _b, _c;
|
|
398
|
-
const codeItemUuid =
|
|
398
|
+
const codeItemUuid = RecordNodeValues.getItemUuid(codeAttribute);
|
|
399
399
|
if (!codeItemUuid)
|
|
400
400
|
return '';
|
|
401
401
|
// items of big categories are not in the survey ref data: they can be in the node ref data
|
|
@@ -408,7 +408,7 @@ export const getCategoryItemUuid = (survey, nodeDef, parentNode, code) => (recor
|
|
|
408
408
|
const item = Surveys.getCategoryItemByCodePaths({ survey, categoryUuid, codePaths });
|
|
409
409
|
return item === null || item === void 0 ? void 0 : item.uuid;
|
|
410
410
|
};
|
|
411
|
-
export const isNodeFilledByUser = (node) => (record) => !!findDescendantOrSelf(node, (visitedNode) =>
|
|
411
|
+
export const isNodeFilledByUser = (node) => (record) => !!findDescendantOrSelf(node, (visitedNode) => RecordNodes.hasUserInputValue(visitedNode))(record);
|
|
412
412
|
export const isNodeEmpty = (node) => (record) => !isNodeFilledByUser(node)(record);
|
|
413
413
|
export const isEmpty = (record) => {
|
|
414
414
|
const rootNode = getRoot(record);
|