@openforis/arena-core 2.3.33 → 2.3.35
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.js.map +1 -1
- package/dist/app/index.js.map +1 -1
- package/dist/auth/authGroup.js.map +1 -1
- package/dist/auth/authGroups.js.map +1 -1
- package/dist/auth/authorizer.js +45 -0
- package/dist/auth/authorizer.js.map +1 -1
- package/dist/auth/factory.js.map +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/permission.js.map +1 -1
- package/dist/auth/user.js.map +1 -1
- package/dist/auth/userAuth.js.map +1 -1
- package/dist/auth/userAuthTokenService.d.ts +28 -0
- package/dist/auth/userAuthTokenService.js.map +1 -1
- package/dist/auth/userGroup.js.map +1 -1
- package/dist/auth/userService.js.map +1 -1
- package/dist/auth/users.js +1 -0
- package/dist/auth/users.js.map +1 -1
- package/dist/category/categories.js.map +1 -1
- package/dist/category/category.js.map +1 -1
- package/dist/category/categoryImportSummary.js.map +1 -1
- package/dist/category/categoryItemGenerator.js.map +1 -1
- package/dist/category/categoryItems.js.map +1 -1
- package/dist/category/factory.js.map +1 -1
- package/dist/category/index.js.map +1 -1
- package/dist/category/item.js.map +1 -1
- package/dist/category/itemService.js.map +1 -1
- package/dist/category/level.js.map +1 -1
- package/dist/category/levelService.js.map +1 -1
- package/dist/category/service.js.map +1 -1
- package/dist/chain/chain.js.map +1 -1
- package/dist/chain/chainFactory.js.map +1 -1
- package/dist/chain/chainNodeDef.js.map +1 -1
- package/dist/chain/chainNodeDefAggregate.js.map +1 -1
- package/dist/chain/chainNodeDefFactory.js.map +1 -1
- package/dist/chain/chainNodeDefService.js.map +1 -1
- package/dist/chain/chainService.js.map +1 -1
- package/dist/chain/index.js.map +1 -1
- package/dist/common/Dictionary.js.map +1 -1
- package/dist/common/factory.js.map +1 -1
- package/dist/common/i18n.js.map +1 -1
- package/dist/common/index.js.map +1 -1
- package/dist/dataExport/ArenaExportInfo.js.map +1 -1
- package/dist/dataExport/ArenaExportInfoFactory.js.map +1 -1
- package/dist/dataExport/FlatDataExportModel.js +3 -3
- package/dist/dataExport/FlatDataExportModel.js.map +1 -1
- package/dist/dataExport/FlatDataExportOptions.js.map +1 -1
- package/dist/dataExport/FlatDataFiles.js.map +1 -1
- package/dist/dataExport/UniqueFileNamesGenerator.d.ts +23 -0
- package/dist/dataExport/UniqueFileNamesGenerator.js +26 -1
- package/dist/dataExport/UniqueFileNamesGenerator.js.map +1 -1
- package/dist/dataExport/index.js.map +1 -1
- package/dist/dataQuery/dataQuery.js.map +1 -1
- package/dist/dataQuery/dataQuerySummaries.js +3 -0
- package/dist/dataQuery/dataQuerySummaries.js.map +1 -1
- package/dist/dataQuery/index.js.map +1 -1
- package/dist/error/SystemError.js +1 -0
- package/dist/error/SystemError.js.map +1 -1
- package/dist/error/index.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 +45 -0
- 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/permission.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 +1 -0
- 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 +3 -3
- 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 +26 -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 +3 -0
- package/dist/esm/dataQuery/dataQuerySummaries.js.map +1 -1
- package/dist/esm/dataQuery/index.js.map +1 -1
- package/dist/esm/error/SystemError.js +1 -0
- package/dist/esm/error/SystemError.js.map +1 -1
- package/dist/esm/error/index.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 +4 -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 +23 -0
- package/dist/esm/expression/javascript/node/binary.js.map +1 -1
- package/dist/esm/expression/javascript/node/call.js +12 -0
- 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 +7 -0
- 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 +5 -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 +8 -0
- package/dist/esm/expression/javascript/node/unary.js.map +1 -1
- package/dist/esm/expression/javascript/parser/jsep.js +6 -2
- package/dist/esm/expression/javascript/parser/jsep.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/expression/variable.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/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 +11 -0
- package/dist/esm/geo/points/bearing.js.map +1 -1
- package/dist/esm/geo/points/distance.js +9 -0
- package/dist/esm/geo/points/distance.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/index.js.map +1 -1
- package/dist/esm/geo/points/isFilled.js.map +1 -1
- package/dist/esm/geo/points/isValid.js +1 -1
- package/dist/esm/geo/points/isValid.js.map +1 -1
- package/dist/esm/geo/points/parse.js +9 -0
- package/dist/esm/geo/points/parse.js.map +1 -1
- package/dist/esm/geo/points/pointAtDistance.js +10 -0
- 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 +12 -0
- package/dist/esm/geo/points/transform.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/job/JobBase.js +99 -0
- 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/job/status.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/language/languageCode.js.map +1 -1
- package/dist/esm/language/languages.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 +1 -0
- package/dist/esm/message/messages.js.map +1 -1
- package/dist/esm/node/factory.js.map +1 -1
- package/dist/esm/node/index.js.map +1 -1
- 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/nodeValueComposite.js.map +1 -1
- package/dist/esm/node/nodeValue/taxon.js.map +1 -1
- package/dist/esm/node/nodeValueFormatter.js +2 -0
- package/dist/esm/node/nodeValueFormatter.js.map +1 -1
- package/dist/esm/node/nodeValueProps.js.map +1 -1
- package/dist/esm/node/nodeValues.js +20 -0
- package/dist/esm/node/nodeValues.js.map +1 -1
- package/dist/esm/node/nodes.js +7 -0
- 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 +1 -0
- package/dist/esm/nodeDef/nodeDef.js.map +1 -1
- package/dist/esm/nodeDef/nodeDefs.js +18 -0
- 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/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/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 +8 -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 +28 -0
- package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/node/member.js +15 -0
- package/dist/esm/nodeDefExpressionEvaluator/node/member.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js +3 -0
- package/dist/esm/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.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 +57 -0
- package/dist/esm/record/_records/nodeDefSelfReferences.js.map +1 -0
- package/dist/esm/record/_records/recordCompletion.js +14 -0
- package/dist/esm/record/_records/recordCompletion.js.map +1 -1
- package/dist/esm/record/_records/recordGetters.js +26 -5
- package/dist/esm/record/_records/recordGetters.js.map +1 -1
- package/dist/esm/record/_records/recordNodesIndexReader.js.map +1 -1
- package/dist/esm/record/_records/recordNodesIndexUpdater.js +17 -0
- package/dist/esm/record/_records/recordNodesIndexUpdater.js.map +1 -1
- package/dist/esm/record/_records/recordPagesValidation.js +45 -0
- 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 +2 -0
- package/dist/esm/record/_records/recordUpdater.js.map +1 -1
- 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.map +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 +10 -1
- 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.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/index.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js +14 -0
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/index.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +6 -0
- 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.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
- package/dist/esm/record/recordFixer.js +16 -0
- package/dist/esm/record/recordFixer.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/index.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js +6 -0
- 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 +5 -0
- package/dist/esm/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +20 -2
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js +2 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +13 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +9 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +17 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +5 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +4 -2
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +8 -3
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js +10 -5
- package/dist/esm/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js +7 -0
- package/dist/esm/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js +2 -0
- package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js +16 -2
- package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js +8 -0
- package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
- package/dist/esm/record/recordPrettyPrinter.js.map +1 -1
- package/dist/esm/record/recordStep.js.map +1 -1
- package/dist/esm/record/recordUpdater.js +1 -0
- 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 +3 -0
- package/dist/esm/record/recordValidator/attributeKeyValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeTypeValidator.js +3 -0
- package/dist/esm/record/recordValidator/attributeTypeValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeUniqueValidator.js +2 -0
- package/dist/esm/record/recordValidator/attributeUniqueValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeValidator.js +12 -1
- package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
- package/dist/esm/record/recordValidator/countVaildator.js +5 -0
- package/dist/esm/record/recordValidator/countVaildator.js.map +1 -1
- package/dist/esm/record/recordValidator/index.js.map +1 -1
- package/dist/esm/record/recordValidator/recordValidator.js +3 -0
- package/dist/esm/record/recordValidator/recordValidator.js.map +1 -1
- package/dist/esm/record/records.js +3 -0
- 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/serviceType.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 +1 -0
- package/dist/esm/survey/factory.js.map +1 -1
- package/dist/esm/survey/index.js.map +1 -1
- package/dist/esm/survey/nodeDefsFixer.js +1 -0
- 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 +8 -0
- 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 +11 -2
- package/dist/esm/survey/surveys/dependencies.js.map +1 -1
- package/dist/esm/survey/surveys/index.js +6 -0
- package/dist/esm/survey/surveys/index.js.map +1 -1
- package/dist/esm/survey/surveys/nodeDefs.js +12 -0
- 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 +3 -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 -0
- package/dist/esm/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
- package/dist/esm/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
- package/dist/esm/tests/builder/recordBuilder/index.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.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
- package/dist/esm/tests/builder/surveyBuilder/index.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/_objects/assoc.js.map +1 -1
- package/dist/esm/utils/_objects/assocPath.js +1 -0
- package/dist/esm/utils/_objects/assocPath.js.map +1 -1
- package/dist/esm/utils/_objects/camelize.js +9 -0
- package/dist/esm/utils/_objects/camelize.js.map +1 -1
- package/dist/esm/utils/_objects/deepMerge.js +10 -0
- package/dist/esm/utils/_objects/deepMerge.js.map +1 -1
- package/dist/esm/utils/_objects/deleteEmptyProps.js.map +1 -1
- package/dist/esm/utils/_objects/difference.js.map +1 -1
- package/dist/esm/utils/_objects/dissoc.js.map +1 -1
- package/dist/esm/utils/_objects/dissocPath.js +1 -0
- package/dist/esm/utils/_objects/dissocPath.js.map +1 -1
- package/dist/esm/utils/_objects/dissocPathIfEmpty.js.map +1 -1
- package/dist/esm/utils/_objects/fromPairs.js.map +1 -1
- package/dist/esm/utils/_objects/index.js.map +1 -1
- package/dist/esm/utils/_objects/isEmpty.js +8 -0
- package/dist/esm/utils/_objects/isEmpty.js.map +1 -1
- package/dist/esm/utils/_objects/isEqual.js.map +1 -1
- package/dist/esm/utils/_objects/isNil.js +6 -0
- package/dist/esm/utils/_objects/isNil.js.map +1 -1
- package/dist/esm/utils/_objects/isNotEmpty.js +6 -0
- package/dist/esm/utils/_objects/isNotEmpty.js.map +1 -1
- package/dist/esm/utils/_objects/parse.js +8 -0
- package/dist/esm/utils/_objects/parse.js.map +1 -1
- package/dist/esm/utils/_objects/path.js +7 -0
- package/dist/esm/utils/_objects/path.js.map +1 -1
- package/dist/esm/utils/_objects/propertyOf.js.map +1 -1
- package/dist/esm/utils/_objects/setInPath.js.map +1 -1
- package/dist/esm/utils/_objects/stringify.js +9 -0
- package/dist/esm/utils/_objects/stringify.js.map +1 -1
- package/dist/esm/utils/_objects/toPairs.js.map +1 -1
- package/dist/esm/utils/arrays.js.map +1 -1
- package/dist/esm/utils/dates.js +22 -0
- package/dist/esm/utils/dates.js.map +1 -1
- package/dist/esm/utils/fileNames.js.map +1 -1
- package/dist/esm/utils/fileProcessor.js +5 -1
- package/dist/esm/utils/fileProcessor.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/numbers.js +21 -0
- package/dist/esm/utils/numbers.js.map +1 -1
- package/dist/esm/utils/promises.js +15 -1
- package/dist/esm/utils/promises.js.map +1 -1
- package/dist/esm/utils/queue.js +9 -0
- package/dist/esm/utils/queue.js.map +1 -1
- package/dist/esm/utils/retryProcessor.js +5 -1
- package/dist/esm/utils/retryProcessor.js.map +1 -1
- package/dist/esm/utils/strings.js.map +1 -1
- package/dist/esm/utils/uuids.js.map +1 -1
- package/dist/esm/utils/versions.js +4 -0
- 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 +3 -0
- package/dist/esm/validation/fieldValidators/email.js.map +1 -1
- package/dist/esm/validation/fieldValidators/index.js.map +1 -1
- package/dist/esm/validation/fieldValidators/name.js +4 -0
- 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 +1 -1
- package/dist/esm/validation/validationResults.js.map +1 -1
- package/dist/esm/validation/validations.js +17 -1
- package/dist/esm/validation/validations.js.map +1 -1
- package/dist/esm/validation/validator.js.map +1 -1
- package/dist/esm/validation/validatorErrorKeys.js.map +1 -1
- package/dist/expression/context.d.ts +6 -0
- package/dist/expression/context.js.map +1 -1
- package/dist/expression/evaluator.js.map +1 -1
- package/dist/expression/function.d.ts +13 -0
- package/dist/expression/function.js.map +1 -1
- package/dist/expression/index.js.map +1 -1
- package/dist/expression/javascript/evaluator.d.ts +1 -0
- package/dist/expression/javascript/evaluator.js +6 -2
- package/dist/expression/javascript/evaluator.js.map +1 -1
- package/dist/expression/javascript/functionsDefault.js.map +1 -1
- package/dist/expression/javascript/global.js.map +1 -1
- package/dist/expression/javascript/node/array.js.map +1 -1
- package/dist/expression/javascript/node/binary.js +23 -0
- package/dist/expression/javascript/node/binary.js.map +1 -1
- package/dist/expression/javascript/node/call.js +12 -0
- package/dist/expression/javascript/node/call.js.map +1 -1
- package/dist/expression/javascript/node/compound.js.map +1 -1
- package/dist/expression/javascript/node/conditional.js.map +1 -1
- package/dist/expression/javascript/node/identifier.d.ts +7 -0
- package/dist/expression/javascript/node/identifier.js +7 -0
- package/dist/expression/javascript/node/identifier.js.map +1 -1
- package/dist/expression/javascript/node/literal.js.map +1 -1
- package/dist/expression/javascript/node/member.js +5 -1
- package/dist/expression/javascript/node/member.js.map +1 -1
- package/dist/expression/javascript/node/sequence.js.map +1 -1
- package/dist/expression/javascript/node/this.js.map +1 -1
- package/dist/expression/javascript/node/unary.js +8 -0
- package/dist/expression/javascript/node/unary.js.map +1 -1
- package/dist/expression/javascript/parser/jsep.js +6 -2
- package/dist/expression/javascript/parser/jsep.js.map +1 -1
- package/dist/expression/javascript/parser/parser.js.map +1 -1
- package/dist/expression/node.js.map +1 -1
- package/dist/expression/parser.js.map +1 -1
- package/dist/expression/variable.js.map +1 -1
- package/dist/extraProp/extraProp.js.map +1 -1
- package/dist/extraProp/extraProps.js.map +1 -1
- package/dist/extraProp/extraPropsDataGenerator.js.map +1 -1
- package/dist/extraProp/index.js.map +1 -1
- package/dist/geo/index.js.map +1 -1
- package/dist/geo/point.js.map +1 -1
- package/dist/geo/pointFactory.js.map +1 -1
- package/dist/geo/points/bearing.d.ts +9 -0
- package/dist/geo/points/bearing.js +11 -0
- package/dist/geo/points/bearing.js.map +1 -1
- package/dist/geo/points/distance.d.ts +8 -0
- package/dist/geo/points/distance.js +9 -0
- package/dist/geo/points/distance.js.map +1 -1
- package/dist/geo/points/equals.js.map +1 -1
- package/dist/geo/points/getSrs.js.map +1 -1
- package/dist/geo/points/index.js.map +1 -1
- package/dist/geo/points/isFilled.js.map +1 -1
- package/dist/geo/points/isValid.js +1 -1
- package/dist/geo/points/isValid.js.map +1 -1
- package/dist/geo/points/parse.d.ts +9 -0
- package/dist/geo/points/parse.js +9 -0
- package/dist/geo/points/parse.js.map +1 -1
- package/dist/geo/points/pointAtDistance.d.ts +9 -0
- package/dist/geo/points/pointAtDistance.js +10 -0
- package/dist/geo/points/pointAtDistance.js.map +1 -1
- package/dist/geo/points/toLatLong.js.map +1 -1
- package/dist/geo/points/toString.js.map +1 -1
- package/dist/geo/points/transform.d.ts +8 -0
- package/dist/geo/points/transform.js +12 -0
- package/dist/geo/points/transform.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/job/JobBase.d.ts +81 -0
- package/dist/job/JobBase.js +99 -0
- package/dist/job/JobBase.js.map +1 -1
- package/dist/job/index.js.map +1 -1
- package/dist/job/job.d.ts +20 -0
- package/dist/job/job.js.map +1 -1
- package/dist/job/jobContext.js.map +1 -1
- package/dist/job/jobEvent.js.map +1 -1
- package/dist/job/jobSerialized.d.ts +3 -0
- package/dist/job/jobSerialized.js.map +1 -1
- package/dist/job/status.js.map +1 -1
- package/dist/language/index.js.map +1 -1
- package/dist/language/labels.js.map +1 -1
- package/dist/language/languageCode.js.map +1 -1
- package/dist/language/languages.js.map +1 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/logger.js.map +1 -1
- package/dist/message/index.js.map +1 -1
- package/dist/message/message.d.ts +3 -0
- package/dist/message/message.js.map +1 -1
- package/dist/message/messages.js +1 -0
- package/dist/message/messages.js.map +1 -1
- package/dist/node/factory.js.map +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts +38 -0
- package/dist/node/node.js.map +1 -1
- package/dist/node/nodePointer.js.map +1 -1
- package/dist/node/nodeValue/code.js.map +1 -1
- package/dist/node/nodeValue/coordinate.js.map +1 -1
- package/dist/node/nodeValue/file.js.map +1 -1
- package/dist/node/nodeValue/index.js.map +1 -1
- package/dist/node/nodeValue/nodeValueComposite.js.map +1 -1
- package/dist/node/nodeValue/taxon.js.map +1 -1
- package/dist/node/nodeValueFormatter.js +2 -0
- package/dist/node/nodeValueFormatter.js.map +1 -1
- package/dist/node/nodeValueProps.js.map +1 -1
- package/dist/node/nodeValues.d.ts +4 -0
- package/dist/node/nodeValues.js +20 -0
- package/dist/node/nodeValues.js.map +1 -1
- package/dist/node/nodes.js +7 -0
- package/dist/node/nodes.js.map +1 -1
- package/dist/node/service.js.map +1 -1
- package/dist/nodeDef/factory.js.map +1 -1
- package/dist/nodeDef/index.js.map +1 -1
- package/dist/nodeDef/nodeDef.js +1 -0
- package/dist/nodeDef/nodeDef.js.map +1 -1
- package/dist/nodeDef/nodeDefs.js +18 -0
- package/dist/nodeDef/nodeDefs.js.map +1 -1
- package/dist/nodeDef/service.js.map +1 -1
- package/dist/nodeDef/types/boolean.js.map +1 -1
- package/dist/nodeDef/types/code.js.map +1 -1
- package/dist/nodeDef/types/coordinate.js.map +1 -1
- package/dist/nodeDef/types/date.js.map +1 -1
- package/dist/nodeDef/types/decimal.js.map +1 -1
- package/dist/nodeDef/types/entity.d.ts +1 -0
- package/dist/nodeDef/types/entity.js.map +1 -1
- package/dist/nodeDef/types/file.js.map +1 -1
- package/dist/nodeDef/types/formHeader.js.map +1 -1
- package/dist/nodeDef/types/integer.js.map +1 -1
- package/dist/nodeDef/types/taxon.js.map +1 -1
- package/dist/nodeDef/types/text.js.map +1 -1
- package/dist/nodeDef/types/time.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/categoryItemProvider.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/context.d.ts +3 -0
- package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/functions.js +8 -1
- package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/index.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/identifier.d.ts +14 -0
- package/dist/nodeDefExpressionEvaluator/node/identifier.js +28 -0
- package/dist/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/member.js +15 -0
- package/dist/nodeDefExpressionEvaluator/node/member.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js +3 -0
- package/dist/nodeDefExpressionEvaluator/node/nodeDefExpressionNativeProperties.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/node/thisEvaluator.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/taxonProvider.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/validator.js.map +1 -1
- package/dist/record/_records/nodeDefSelfReferences.d.ts +8 -0
- package/dist/record/_records/nodeDefSelfReferences.js +60 -0
- package/dist/record/_records/nodeDefSelfReferences.js.map +1 -0
- package/dist/record/_records/recordCompletion.d.ts +12 -0
- package/dist/record/_records/recordCompletion.js +14 -0
- package/dist/record/_records/recordCompletion.js.map +1 -1
- package/dist/record/_records/recordGetters.d.ts +3 -0
- package/dist/record/_records/recordGetters.js +26 -5
- package/dist/record/_records/recordGetters.js.map +1 -1
- package/dist/record/_records/recordNodesIndexReader.js.map +1 -1
- package/dist/record/_records/recordNodesIndexUpdater.js +17 -0
- package/dist/record/_records/recordNodesIndexUpdater.js.map +1 -1
- package/dist/record/_records/recordPagesValidation.d.ts +39 -0
- package/dist/record/_records/recordPagesValidation.js +45 -0
- package/dist/record/_records/recordPagesValidation.js.map +1 -1
- package/dist/record/_records/recordUpdateOptions.js.map +1 -1
- package/dist/record/_records/recordUpdater.js +2 -0
- package/dist/record/_records/recordUpdater.js.map +1 -1
- package/dist/record/_records/recordUtils.js.map +1 -1
- package/dist/record/factory.js.map +1 -1
- package/dist/record/index.js.map +1 -1
- package/dist/record/nodePointers.js.map +1 -1
- package/dist/record/record.d.ts +12 -0
- package/dist/record/record.js.map +1 -1
- package/dist/record/recordCloner.js +10 -1
- package/dist/record/recordCloner.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/context.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/functions.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/index.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js +14 -0
- package/dist/record/recordExpressionEvaluator/node/identifier/identifier.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/identifier/index.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js +6 -0
- package/dist/record/recordExpressionEvaluator/node/identifier/nodesFinder.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/node/thisEvaluator.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/nodeValueExtractor.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
- package/dist/record/recordFixer.js +16 -0
- package/dist/record/recordFixer.js.map +1 -1
- package/dist/record/recordNodesUpdater/index.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.d.ts +6 -0
- package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js +6 -0
- package/dist/record/recordNodesUpdater/recordEnumeratingItemsExpressionEvaluator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordExpressionValueConverter.js +5 -0
- package/dist/record/recordNodesUpdater/recordExpressionValueConverter.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +20 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js +2 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +13 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +9 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +17 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEditableUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js +5 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratedEntitiesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js +4 -2
- package/dist/record/recordNodesUpdater/recordNodeDependentsEnumeratingItemsUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +8 -3
- package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsUpdateParams.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodeDependentsVisibleUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesCreator.js +10 -5
- package/dist/record/recordNodesUpdater/recordNodesCreator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesDeleter.js +7 -0
- package/dist/record/recordNodesUpdater/recordNodesDeleter.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js +2 -0
- package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordNodesUpdater.js +16 -2
- package/dist/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordUpdateResult.d.ts +8 -0
- package/dist/record/recordNodesUpdater/recordUpdateResult.js +8 -0
- package/dist/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
- package/dist/record/recordPrettyPrinter.js.map +1 -1
- package/dist/record/recordStep.js.map +1 -1
- package/dist/record/recordUpdater.js +1 -0
- package/dist/record/recordUpdater.js.map +1 -1
- package/dist/record/recordValidations.js.map +1 -1
- package/dist/record/recordValidator/attributeKeyValidator.d.ts +4 -0
- package/dist/record/recordValidator/attributeKeyValidator.js +3 -0
- package/dist/record/recordValidator/attributeKeyValidator.js.map +1 -1
- package/dist/record/recordValidator/attributeTypeValidator.js +3 -0
- package/dist/record/recordValidator/attributeTypeValidator.js.map +1 -1
- package/dist/record/recordValidator/attributeUniqueValidator.js +2 -0
- package/dist/record/recordValidator/attributeUniqueValidator.js.map +1 -1
- package/dist/record/recordValidator/attributeValidator.js +12 -1
- package/dist/record/recordValidator/attributeValidator.js.map +1 -1
- package/dist/record/recordValidator/countVaildator.js +5 -0
- package/dist/record/recordValidator/countVaildator.js.map +1 -1
- package/dist/record/recordValidator/index.js.map +1 -1
- package/dist/record/recordValidator/recordValidator.js +3 -0
- package/dist/record/recordValidator/recordValidator.js.map +1 -1
- package/dist/record/records.js +3 -0
- package/dist/record/records.js.map +1 -1
- package/dist/record/service.js.map +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/serviceRegistry.js.map +1 -1
- package/dist/registry/serviceType.js.map +1 -1
- package/dist/srs/factory.js.map +1 -1
- package/dist/srs/index.js.map +1 -1
- package/dist/srs/srs.js.map +1 -1
- package/dist/survey/factory.js +1 -0
- package/dist/survey/factory.js.map +1 -1
- package/dist/survey/index.js.map +1 -1
- package/dist/survey/nodeDefsFixer.js +1 -0
- package/dist/survey/nodeDefsFixer.js.map +1 -1
- package/dist/survey/refData/factory.js.map +1 -1
- package/dist/survey/refData/index.js.map +1 -1
- package/dist/survey/refData/refData.d.ts +15 -0
- package/dist/survey/refData/refData.js.map +1 -1
- package/dist/survey/service.js.map +1 -1
- package/dist/survey/survey.d.ts +9 -0
- package/dist/survey/survey.js.map +1 -1
- package/dist/survey/surveyDocImageFactory.js.map +1 -1
- package/dist/survey/surveyDocImages.js.map +1 -1
- package/dist/survey/surveyFileFactory.js.map +1 -1
- package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js +8 -0
- package/dist/survey/surveys/_nodeDefs/nodeDefsIndex.js.map +1 -1
- package/dist/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
- package/dist/survey/surveys/dependencies.js +11 -2
- package/dist/survey/surveys/dependencies.js.map +1 -1
- package/dist/survey/surveys/index.js +6 -0
- package/dist/survey/surveys/index.js.map +1 -1
- package/dist/survey/surveys/nodeDefs.js +12 -0
- package/dist/survey/surveys/nodeDefs.js.map +1 -1
- package/dist/survey/surveys/refsData.js.map +1 -1
- package/dist/survey/surveys/surveyGettersSecurity.js.map +1 -1
- package/dist/survey/surveys/surveysGetters.js +3 -1
- package/dist/survey/surveys/surveysGetters.js.map +1 -1
- package/dist/survey/surveys/surveysUtils.js.map +1 -1
- package/dist/taxonomy/factory.js.map +1 -1
- package/dist/taxonomy/index.js.map +1 -1
- package/dist/taxonomy/service.js.map +1 -1
- package/dist/taxonomy/taxa.js.map +1 -1
- package/dist/taxonomy/taxon.js.map +1 -1
- package/dist/taxonomy/taxonGenerator.js.map +1 -1
- package/dist/taxonomy/taxonService.js.map +1 -1
- package/dist/taxonomy/taxonVernacularName.js.map +1 -1
- package/dist/taxonomy/taxonomies.js.map +1 -1
- package/dist/taxonomy/taxonomy.js.map +1 -1
- package/dist/tests/builder/recordBuilder/attributeBuilder.js +2 -0
- package/dist/tests/builder/recordBuilder/attributeBuilder.js.map +1 -1
- package/dist/tests/builder/recordBuilder/entityBuilder.js.map +1 -1
- package/dist/tests/builder/recordBuilder/index.js.map +1 -1
- package/dist/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
- package/dist/tests/builder/recordBuilder/recordBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/categoryBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/categoryItemBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/index.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/surveyBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/taxonBuilder.js.map +1 -1
- package/dist/tests/builder/surveyBuilder/taxonomyBuilder.js.map +1 -1
- package/dist/utils/_objects/assoc.js.map +1 -1
- package/dist/utils/_objects/assocPath.js +1 -0
- package/dist/utils/_objects/assocPath.js.map +1 -1
- package/dist/utils/_objects/camelize.d.ts +9 -0
- package/dist/utils/_objects/camelize.js +9 -0
- package/dist/utils/_objects/camelize.js.map +1 -1
- package/dist/utils/_objects/deepMerge.d.ts +5 -0
- package/dist/utils/_objects/deepMerge.js +10 -0
- package/dist/utils/_objects/deepMerge.js.map +1 -1
- package/dist/utils/_objects/deleteEmptyProps.js.map +1 -1
- package/dist/utils/_objects/difference.js.map +1 -1
- package/dist/utils/_objects/dissoc.js.map +1 -1
- package/dist/utils/_objects/dissocPath.js +1 -0
- package/dist/utils/_objects/dissocPath.js.map +1 -1
- package/dist/utils/_objects/dissocPathIfEmpty.js.map +1 -1
- package/dist/utils/_objects/fromPairs.js.map +1 -1
- package/dist/utils/_objects/index.js.map +1 -1
- package/dist/utils/_objects/isEmpty.d.ts +6 -0
- package/dist/utils/_objects/isEmpty.js +8 -0
- package/dist/utils/_objects/isEmpty.js.map +1 -1
- package/dist/utils/_objects/isEqual.js.map +1 -1
- package/dist/utils/_objects/isNil.d.ts +6 -0
- package/dist/utils/_objects/isNil.js +6 -0
- package/dist/utils/_objects/isNil.js.map +1 -1
- package/dist/utils/_objects/isNotEmpty.d.ts +6 -0
- package/dist/utils/_objects/isNotEmpty.js +6 -0
- package/dist/utils/_objects/isNotEmpty.js.map +1 -1
- package/dist/utils/_objects/parse.d.ts +8 -0
- package/dist/utils/_objects/parse.js +8 -0
- package/dist/utils/_objects/parse.js.map +1 -1
- package/dist/utils/_objects/path.d.ts +6 -0
- package/dist/utils/_objects/path.js +7 -0
- package/dist/utils/_objects/path.js.map +1 -1
- package/dist/utils/_objects/propertyOf.js.map +1 -1
- package/dist/utils/_objects/setInPath.js.map +1 -1
- package/dist/utils/_objects/stringify.d.ts +9 -0
- package/dist/utils/_objects/stringify.js +9 -0
- package/dist/utils/_objects/stringify.js.map +1 -1
- package/dist/utils/_objects/toPairs.js.map +1 -1
- package/dist/utils/arrays.js.map +1 -1
- package/dist/utils/dates.d.ts +1 -1
- package/dist/utils/dates.js +22 -0
- package/dist/utils/dates.js.map +1 -1
- package/dist/utils/fileNames.js.map +1 -1
- package/dist/utils/fileProcessor.js +5 -1
- package/dist/utils/fileProcessor.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/numbers.js +21 -0
- package/dist/utils/numbers.js.map +1 -1
- package/dist/utils/promises.js +15 -1
- package/dist/utils/promises.js.map +1 -1
- package/dist/utils/queue.d.ts +7 -0
- package/dist/utils/queue.js +9 -0
- package/dist/utils/queue.js.map +1 -1
- package/dist/utils/retryProcessor.js +5 -1
- package/dist/utils/retryProcessor.js.map +1 -1
- package/dist/utils/strings.js.map +1 -1
- package/dist/utils/uuids.js.map +1 -1
- package/dist/utils/versions.js +4 -0
- package/dist/utils/versions.js.map +1 -1
- package/dist/validation/factory.js.map +1 -1
- package/dist/validation/fieldValidator.js.map +1 -1
- package/dist/validation/fieldValidators/email.js +3 -0
- package/dist/validation/fieldValidators/email.js.map +1 -1
- package/dist/validation/fieldValidators/index.js.map +1 -1
- package/dist/validation/fieldValidators/name.js +4 -0
- package/dist/validation/fieldValidators/name.js.map +1 -1
- package/dist/validation/fieldValidators/notKeyword.js.map +1 -1
- package/dist/validation/fieldValidators/numeric.js.map +1 -1
- package/dist/validation/fieldValidators/numericPositive.js.map +1 -1
- package/dist/validation/fieldValidators/required.js.map +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/validation.js.map +1 -1
- package/dist/validation/validationResults.js +1 -1
- package/dist/validation/validationResults.js.map +1 -1
- package/dist/validation/validations.js +17 -1
- package/dist/validation/validations.js.map +1 -1
- package/dist/validation/validator.js.map +1 -1
- package/dist/validation/validatorErrorKeys.js.map +1 -1
- package/package.json +6 -9
package/dist/app/appInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appInfo.js","sourceRoot":"","sources":["../../src/app/appInfo.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"appInfo.js","sourceRoot":"","sources":["../../src/app/appInfo.ts"],"names":[],"mappings":"","sourcesContent":["export interface AppInfo {\n appId: string\n version: string\n platform?: 'android' | 'ios'\n}\n"]}
|
package/dist/app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"","sourcesContent":["export type { AppInfo } from './appInfo'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authGroup.js","sourceRoot":"","sources":["../../src/auth/authGroup.ts"],"names":[],"mappings":";;;AAAA,6CAA+D;AAE/D,IAAY,aASX;AATD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,8CAA6B,CAAA;IAC7B,gDAA+B,CAAA;IAC/B,4CAA2B,CAAA;IAC3B,0CAAyB,CAAA;IACzB,8CAA6B,CAAA;IAC7B,4CAA2B,CAAA;AAC7B,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB;AAUY,QAAA,gBAAgB,GAAG;IAC9B,aAAa,CAAC,WAAW;IACzB,aAAa,CAAC,aAAa;IAC3B,aAAa,CAAC,WAAW;IACzB,aAAa,CAAC,YAAY;IAC1B,aAAa,CAAC,WAAW;IACzB,aAAa,CAAC,YAAY;IAC1B,aAAa,CAAC,UAAU;IACxB,aAAa,CAAC,WAAW;CAC1B,CAAA;AAEY,QAAA,gBAAgB,GAAG;IAC9B,aAAa,CAAC,WAAW;IACzB,aAAa,CAAC,YAAY;IAC1B,aAAa,CAAC,UAAU;IACxB,aAAa,CAAC,YAAY;IAC1B,aAAa,CAAC,WAAW;IACzB,aAAa,CAAC,WAAW;CAC1B,CAAA;AAEY,QAAA,kBAAkB,GAAc,EAAE,IAAI,EAAE,aAAa,CAAC,WAAW,EAAE,CAAA;AAEnE,QAAA,sBAAsB,GAA6C;IAC9E,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,uB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ACX,CAAC,EAAE,iCAAoB,CAAC,GAAG;SAC5B;KACF;CACF,CAAA","sourcesContent":["import { Permission, RecordStepPermission } from './permission'\n\nexport enum AuthGroupName {\n systemAdmin = 'systemAdmin',\n surveyAdmin = 'surveyAdmin',\n surveyEditor = 'surveyEditor',\n surveyManager = 'surveyManager',\n surveyGuest = 'surveyGuest',\n dataEditor = 'dataEditor',\n dataCleanser = 'dataCleanser',\n dataAnalyst = 'dataAnalyst',\n}\n\nexport interface AuthGroup {\n name: AuthGroupName\n surveyUuid?: string\n permissions?: Array<Permission>\n recordSteps?: { [key: number]: RecordStepPermission }\n uuid?: string\n}\n\nexport const sortedGroupNames = [\n AuthGroupName.systemAdmin,\n AuthGroupName.surveyManager,\n AuthGroupName.surveyAdmin,\n AuthGroupName.surveyEditor,\n AuthGroupName.dataAnalyst,\n AuthGroupName.dataCleanser,\n AuthGroupName.dataEditor,\n AuthGroupName.surveyGuest,\n]\n\nexport const surveyGroupNames = [\n AuthGroupName.surveyAdmin,\n AuthGroupName.surveyEditor,\n AuthGroupName.dataEditor,\n AuthGroupName.dataCleanser,\n AuthGroupName.dataAnalyst,\n AuthGroupName.surveyGuest,\n]\n\nexport const SYSTEM_ADMIN_GROUP: AuthGroup = { name: AuthGroupName.systemAdmin }\n\nexport const permissionsByGroupName: { [key in AuthGroupName]: Permission[] } = {\n [AuthGroupName.systemAdmin]: Object.values(Permission),\n [AuthGroupName.surveyManager]: [\n Permission.permissionsEdit,\n Permission.surveyCreate,\n Permission.surveyEdit,\n Permission.recordView,\n Permission.recordCreate,\n Permission.recordEdit,\n Permission.recordCleanse,\n Permission.recordAnalyse,\n Permission.userEdit,\n Permission.userInvite,\n ],\n [AuthGroupName.surveyAdmin]: [\n Permission.permissionsEdit,\n Permission.surveyEdit,\n Permission.recordView,\n Permission.recordCreate,\n Permission.recordEdit,\n Permission.recordCleanse,\n Permission.recordAnalyse,\n Permission.userEdit,\n Permission.userInvite,\n ],\n [AuthGroupName.surveyEditor]: [\n Permission.surveyEdit,\n Permission.recordView,\n Permission.recordCreate,\n Permission.recordEdit,\n Permission.recordCleanse,\n Permission.recordAnalyse,\n ],\n [AuthGroupName.dataAnalyst]: [\n Permission.recordView,\n Permission.recordCreate,\n Permission.recordEdit,\n Permission.recordCleanse,\n Permission.recordAnalyse,\n ],\n [AuthGroupName.dataCleanser]: [\n Permission.recordView,\n Permission.recordCreate,\n Permission.recordEdit,\n Permission.recordCleanse,\n ],\n [AuthGroupName.dataEditor]: [Permission.recordView, Permission.recordCreate, Permission.recordEdit],\n [AuthGroupName.surveyGuest]: [Permission.recordView],\n}\n\nexport const DEFAULT_AUTH_GROUPS: Array<AuthGroup> = [\n {\n name: AuthGroupName.surveyAdmin,\n permissions: permissionsByGroupName[AuthGroupName.surveyAdmin],\n recordSteps: {\n 1: RecordStepPermission.all,\n 2: RecordStepPermission.all,\n 3: RecordStepPermission.all,\n },\n },\n {\n name: AuthGroupName.surveyEditor,\n permissions: permissionsByGroupName[AuthGroupName.surveyEditor],\n recordSteps: {\n 1: RecordStepPermission.all,\n 2: RecordStepPermission.all,\n 3: RecordStepPermission.all,\n },\n },\n {\n name: AuthGroupName.dataAnalyst,\n permissions: permissionsByGroupName[AuthGroupName.dataAnalyst],\n recordSteps: {\n 1: RecordStepPermission.all,\n 2: RecordStepPermission.all,\n 3: RecordStepPermission.all,\n },\n },\n {\n name: AuthGroupName.dataCleanser,\n permissions: permissionsByGroupName[AuthGroupName.dataCleanser],\n recordSteps: {\n 1: RecordStepPermission.all,\n 2: RecordStepPermission.all,\n },\n },\n {\n name: AuthGroupName.dataEditor,\n permissions: permissionsByGroupName[AuthGroupName.dataEditor],\n recordSteps: {\n 1: RecordStepPermission.own,\n },\n },\n {\n name: AuthGroupName.surveyGuest,\n permissions: permissionsByGroupName[AuthGroupName.surveyGuest],\n recordSteps: {\n 3: RecordStepPermission.all,\n },\n },\n]\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authGroups.js","source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IACb,eAAe;IACf,aAAa;IACb,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,cAAc;IACd,UAAU;CACX,CAAA","sourcesContent":["import { UUIDs } from '../utils'\nimport { AuthGroup, AuthGroupName, DEFAULT_AUTH_GROUPS, permissionsByGroupName, sortedGroupNames } from './authGroup'\nimport { RecordStepPermission } from './permission'\n\nconst isSystemAdmin = (authGroup: AuthGroup): boolean => authGroup?.name === AuthGroupName.systemAdmin\n\nconst isSurveyManager = (authGroup: AuthGroup): boolean => authGroup?.name === AuthGroupName.surveyManager\n\nconst isSurveyGroup = (authGroup: AuthGroup): boolean => !isSystemAdmin(authGroup) && !isSurveyManager(authGroup)\n\nconst getSurveyUuid = (authGroup: AuthGroup): string | undefined => authGroup?.surveyUuid\n\nconst getRecordSteps = (authGroup?: AuthGroup): { [key: string]: RecordStepPermission } | undefined =>\n authGroup?.recordSteps\n\nconst getRecordEditLevel =\n (step: string) =>\n (authGroup?: AuthGroup): RecordStepPermission => {\n const steps = getRecordSteps(authGroup)\n if (!steps) throw new Error('No steps')\n\n return steps[step]\n }\n\nconst getDefaultAuthGroups = (surveyUuid: string): AuthGroup[] =>\n DEFAULT_AUTH_GROUPS.map((group) => ({ ...group, uuid: UUIDs.v4(), surveyUuid }))\n\nconst getPermissions = (group: AuthGroup) => permissionsByGroupName[group.name] ?? []\n\nconst sortGroups = (groups: AuthGroup[]) => {\n const sortedGroups = [...groups]\n sortedGroups.sort((group1, group2) => {\n const sortOrder1 = sortedGroupNames.indexOf(group1.name)\n const sortOrder2 = sortedGroupNames.indexOf(group2.name)\n return sortOrder1 - sortOrder2\n })\n return sortedGroups\n}\n\nexport const AuthGroups = {\n isSystemAdmin,\n isSurveyGroup,\n isSurveyManager,\n getSurveyUuid,\n getRecordSteps,\n getRecordEditLevel,\n getDefaultAuthGroups,\n getPermissions,\n sortGroups,\n}\n"]}
|
package/dist/auth/authorizer.js
CHANGED
|
@@ -7,6 +7,9 @@ const authGroup_1 = require("./authGroup");
|
|
|
7
7
|
const authGroups_1 = require("./authGroups");
|
|
8
8
|
const permission_1 = require("./permission");
|
|
9
9
|
const users_1 = require("./users");
|
|
10
|
+
// ======
|
|
11
|
+
// ====== Survey
|
|
12
|
+
// ======
|
|
10
13
|
const _getSurveyUserGroup = (user, surveyInfo, includeSystemAdmin = true) => surveyInfo ? users_1.Users.getAuthGroupBySurveyUuid(surveyInfo.uuid, includeSystemAdmin)(user) : undefined;
|
|
11
14
|
const _hasAuthGroupForSurvey = ({ user, surveyInfo }) => Boolean(_getSurveyUserGroup(user, surveyInfo));
|
|
12
15
|
const _hasSurveyPermission = (permission) => (user, surveyInfo) => {
|
|
@@ -27,6 +30,7 @@ const _hasPermissionInSomeGroup = (permission) => (user) => {
|
|
|
27
30
|
const groups = users_1.Users.getAuthGroups(user);
|
|
28
31
|
return groups.some((group) => authGroups_1.AuthGroups.getPermissions(group).includes(permission));
|
|
29
32
|
};
|
|
33
|
+
// CREATE
|
|
30
34
|
const canCreateSurvey = _hasPermissionInSomeGroup(permission_1.Permission.surveyCreate);
|
|
31
35
|
const canCreateTemplate = (user) => users_1.Users.isSystemAdmin(user);
|
|
32
36
|
const getMaxSurveysUserCanCreate = (user) => {
|
|
@@ -36,16 +40,23 @@ const getMaxSurveysUserCanCreate = (user) => {
|
|
|
36
40
|
return users_1.Users.getMaxSurveys(user);
|
|
37
41
|
return 0;
|
|
38
42
|
};
|
|
43
|
+
// READ
|
|
39
44
|
const canViewSurvey = (user, surveyInfo) => users_1.Users.isSystemAdmin(user) || _hasAuthGroupForSurvey({ user, surveyInfo });
|
|
40
45
|
const canExportSurvey = _hasSurveyPermission(permission_1.Permission.recordAnalyse);
|
|
41
46
|
const canExportSurveysList = (user) => users_1.Users.isSystemAdmin(user);
|
|
42
47
|
const canViewTemplates = (user) => users_1.Users.isSystemAdmin(user);
|
|
48
|
+
// UPDATE
|
|
43
49
|
const canEditSurvey = _hasSurveyPermission(permission_1.Permission.surveyEdit);
|
|
44
50
|
const canEditSurveyConfig = (user) => users_1.Users.isSystemAdmin(user);
|
|
45
51
|
const canEditSurveyOwner = (user) => users_1.Users.isSystemAdmin(user);
|
|
46
52
|
const canEditTemplates = (user) => users_1.Users.isSystemAdmin(user);
|
|
47
53
|
const canRefreshAllSurveyRdbs = (user) => users_1.Users.isSystemAdmin(user);
|
|
54
|
+
// ======
|
|
55
|
+
// ====== Record
|
|
56
|
+
// ======
|
|
57
|
+
// CREATE
|
|
48
58
|
exports.canCreateRecord = _hasSurveyPermission(permission_1.Permission.recordCreate);
|
|
59
|
+
// READ
|
|
49
60
|
exports.canViewRecord = _hasSurveyPermission(permission_1.Permission.recordView);
|
|
50
61
|
exports.canExportAllRecords = _hasSurveyPermission(permission_1.Permission.recordCleanse);
|
|
51
62
|
const canViewNotOwnedRecords = (user, surveyInfo) => {
|
|
@@ -66,22 +77,31 @@ const canViewNotOwnedRecords = (user, surveyInfo) => {
|
|
|
66
77
|
};
|
|
67
78
|
exports.canViewNotOwnedRecords = canViewNotOwnedRecords;
|
|
68
79
|
exports.canExportRecordsList = _hasSurveyPermission(permission_1.Permission.surveyEdit);
|
|
80
|
+
// UPDATE
|
|
69
81
|
const canEditRecord = (user, record, allowAnalysisStepEdit = false) => {
|
|
70
82
|
var _a;
|
|
71
83
|
if (!user ||
|
|
72
84
|
!record ||
|
|
85
|
+
// records in analysis cannot be edited
|
|
73
86
|
(!allowAnalysisStepEdit && record_1.Records.isInAnalysisStep(record))) {
|
|
74
87
|
return false;
|
|
75
88
|
}
|
|
89
|
+
// system admin does not have an auth group associated to the survey, but he can always edit records;
|
|
76
90
|
if (users_1.Users.isSystemAdmin(user)) {
|
|
77
91
|
return true;
|
|
78
92
|
}
|
|
79
93
|
const { surveyUuid, ownerUuid } = record;
|
|
94
|
+
// if user doesn't have an auth group associated to the survey, he cannot edit records
|
|
80
95
|
const userAuthGroup = users_1.Users.getAuthGroupBySurveyUuid(surveyUuid)(user);
|
|
81
96
|
if (!userAuthGroup)
|
|
82
97
|
return false;
|
|
98
|
+
// groups without the record edit permission (e.g. survey guests) cannot edit records,
|
|
99
|
+
// even when their record steps permission allows it (record steps permissions are used also to view records)
|
|
83
100
|
if (!authGroups_1.AuthGroups.getPermissions(userAuthGroup).includes(permission_1.Permission.recordEdit))
|
|
84
101
|
return false;
|
|
102
|
+
// Level = 'all' or 'own'. If 'own', user can only edit records assigned to him
|
|
103
|
+
// If 'all', he can edit all survey's records
|
|
104
|
+
// permission checks must not throw: a group without record steps cannot edit records
|
|
85
105
|
const level = (_a = authGroups_1.AuthGroups.getRecordSteps(userAuthGroup)) === null || _a === void 0 ? void 0 : _a[record_1.Records.getStep(record)];
|
|
86
106
|
return level === permission_1.RecordStepPermission.all || (level === permission_1.RecordStepPermission.own && ownerUuid === user.uuid);
|
|
87
107
|
};
|
|
@@ -96,9 +116,20 @@ const canExportRecords = _hasSurveyPermission(permission_1.Permission.recordView
|
|
|
96
116
|
const canImportRecords = (user, surveyInfo) => (surveyInfo === null || surveyInfo === void 0 ? void 0 : surveyInfo.published) && _hasSurveyPermission(permission_1.Permission.recordCreate)(user, surveyInfo);
|
|
97
117
|
const canAnalyzeRecords = _hasSurveyPermission(permission_1.Permission.recordAnalyse);
|
|
98
118
|
const canUpdateRecordsStep = canAnalyzeRecords;
|
|
119
|
+
// ======
|
|
120
|
+
// ====== Explorer
|
|
121
|
+
// ======
|
|
99
122
|
const canUseExplorer = canCleanseRecords;
|
|
123
|
+
// ======
|
|
124
|
+
// ====== Map
|
|
125
|
+
// ======
|
|
100
126
|
const canUseMap = canAnalyzeRecords;
|
|
127
|
+
// ======
|
|
128
|
+
// ====== Users
|
|
129
|
+
// ======
|
|
130
|
+
// CREATE
|
|
101
131
|
const canInviteUsers = _hasSurveyPermission(permission_1.Permission.userInvite);
|
|
132
|
+
// READ
|
|
102
133
|
const canViewSurveyUsers = _hasSurveyPermission(permission_1.Permission.userInvite);
|
|
103
134
|
const _usersBelongToSameSurvey = ({ user, userToView }) => users_1.Users.getAuthGroups(user).some((authGroupUser) => authGroups_1.AuthGroups.isSurveyGroup(authGroupUser) &&
|
|
104
135
|
users_1.Users.getAuthGroups(userToView).some((authGroupUserToView) => authGroups_1.AuthGroups.isSurveyGroup(authGroupUserToView) &&
|
|
@@ -107,8 +138,10 @@ const canViewUser = (user, _surveyInfo, userToView) => users_1.Users.isSystemAdm
|
|
|
107
138
|
const canViewOtherUsersEmail = ({ user, surveyInfo }) => users_1.Users.isSystemAdmin(user) || canInviteUsers(user, surveyInfo);
|
|
108
139
|
const canViewOtherUsersNameInSameSurvey = (user, surveyInfo) => _hasSurveyPermission(permission_1.Permission.recordView)(user, surveyInfo);
|
|
109
140
|
const canViewAllUsers = (user) => users_1.Users.isSystemAdmin(user);
|
|
141
|
+
// EDIT
|
|
110
142
|
const _hasUserEditAccess = (user, surveyInfo, userToUpdate) => users_1.Users.isSystemAdmin(user) ||
|
|
111
143
|
(_hasSurveyPermission(permission_1.Permission.userEdit)(user, surveyInfo) &&
|
|
144
|
+
// user to update has an auth group in the same survey
|
|
112
145
|
_hasAuthGroupForSurvey({ user: userToUpdate, surveyInfo }));
|
|
113
146
|
const canCreateUsers = (user) => users_1.Users.isSystemAdmin(user);
|
|
114
147
|
const canEditUser = (user, surveyInfo, userToUpdate) => users_1.Users.hasAccepted(userToUpdate) &&
|
|
@@ -120,12 +153,15 @@ const canRemoveUser = (user, surveyInfo, userToRemove) => !users_1.Users.isEqual
|
|
|
120
153
|
_hasUserEditAccess(user, surveyInfo, userToRemove);
|
|
121
154
|
const canEditUserSurveyManager = (user) => users_1.Users.isSystemAdmin(user);
|
|
122
155
|
const canEditUserMaxSurveys = (user) => users_1.Users.isSystemAdmin(user);
|
|
156
|
+
// USER ACCESS REQUESTS
|
|
123
157
|
const canViewUsersAccessRequests = (user) => users_1.Users.isSystemAdmin(user);
|
|
124
158
|
const canEditUsersAccessRequests = (user) => users_1.Users.isSystemAdmin(user);
|
|
159
|
+
// INVITE
|
|
125
160
|
const getUserGroupsCanAssign = ({ user, surveyInfo = null, editingLoggedUser = false, showOnlySurveyGroups = false, }) => {
|
|
126
161
|
const groups = [];
|
|
127
162
|
let surveyGroups = [];
|
|
128
163
|
if (editingLoggedUser && !surveyInfo) {
|
|
164
|
+
// This can happen for system administrators when they don't have an active survey
|
|
129
165
|
surveyGroups = [];
|
|
130
166
|
}
|
|
131
167
|
else if (surveyInfo) {
|
|
@@ -137,15 +173,18 @@ const getUserGroupsCanAssign = ({ user, surveyInfo = null, editingLoggedUser = f
|
|
|
137
173
|
surveyGroups = adminGroup ? [adminGroup] : [];
|
|
138
174
|
}
|
|
139
175
|
}
|
|
176
|
+
// do not allow surveyEditor group selection (remove surveyEditor group completely?)
|
|
140
177
|
surveyGroups = surveyGroups.filter((group) => group.name !== authGroup_1.AuthGroupName.surveyEditor);
|
|
141
178
|
groups.push(...surveyGroups);
|
|
142
179
|
if (!showOnlySurveyGroups && (users_1.Users.isSystemAdmin(user) || users_1.Users.isSurveyManager(user))) {
|
|
180
|
+
// Add SystemAdmin or SurveyManager group if current user is a SystemAdmin or SurveyManager himself
|
|
143
181
|
const userNonSurveyGroups = users_1.Users.getAuthGroups(user).filter((group) => !authGroups_1.AuthGroups.isSurveyGroup(group));
|
|
144
182
|
groups.push(...userNonSurveyGroups);
|
|
145
183
|
}
|
|
146
184
|
return authGroups_1.AuthGroups.sortGroups(groups);
|
|
147
185
|
};
|
|
148
186
|
exports.Authorizer = {
|
|
187
|
+
// Survey
|
|
149
188
|
canCreateSurvey,
|
|
150
189
|
canCreateTemplate,
|
|
151
190
|
getMaxSurveysUserCanCreate,
|
|
@@ -158,6 +197,7 @@ exports.Authorizer = {
|
|
|
158
197
|
canEditSurveyOwner,
|
|
159
198
|
canEditTemplates,
|
|
160
199
|
canRefreshAllSurveyRdbs,
|
|
200
|
+
// Record
|
|
161
201
|
canCreateRecord: exports.canCreateRecord,
|
|
162
202
|
canViewRecord: exports.canViewRecord,
|
|
163
203
|
canExportAllRecords: exports.canExportAllRecords,
|
|
@@ -173,8 +213,11 @@ exports.Authorizer = {
|
|
|
173
213
|
canImportRecords,
|
|
174
214
|
canAnalyzeRecords,
|
|
175
215
|
canUpdateRecordsStep,
|
|
216
|
+
// Explorer
|
|
176
217
|
canUseExplorer,
|
|
218
|
+
// Map
|
|
177
219
|
canUseMap,
|
|
220
|
+
// Users
|
|
178
221
|
canInviteUsers,
|
|
179
222
|
canViewSurveyUsers,
|
|
180
223
|
canViewUser,
|
|
@@ -188,8 +231,10 @@ exports.Authorizer = {
|
|
|
188
231
|
canRemoveUser,
|
|
189
232
|
canEditUserSurveyManager,
|
|
190
233
|
canEditUserMaxSurveys,
|
|
234
|
+
// User Access Requests
|
|
191
235
|
canViewUsersAccessRequests,
|
|
192
236
|
canEditUsersAccessRequests,
|
|
237
|
+
// Invite
|
|
193
238
|
getUserGroupsCanAssign,
|
|
194
239
|
};
|
|
195
240
|
//# sourceMappingURL=authorizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorizer.js","sourceRoot":"","sources":["../../src/auth/authorizer.ts"],"names":[],"mappings":";;;AAAA,sCAA2C;AAC3C,sCAA2C;AAC3C,2CAAsD;AACtD,6CAAyC;AACzC,6CAA+D;AAE/D,mCAA+B;AAM/B,MAAM,mBAAmB,GAAG,CAAC,IAAU,EAAE,UAAkB,EAAE,kBAAkB,GAAG,IAAI,EAAyB,EAAE,CAC/G,UAAU,CAAC,CAAC,CAAC,aAAK,CAAC,wBAAwB,CAAC,UAAU,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAEpG,MAAM,sBAAsB,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAAsC,EAAW,EAAE,CACnG,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAA;AAEhD,MAAM,oBAAoB,GACxB,CAAC,UAAsB,EAAE,EAAE,CAC3B,CAAC,IAAU,EAAE,UAAkB,E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port { Survey, Surveys } from '../survey'\nimport { AuthGroup, AuthGroupName } from './authGroup'\nimport { AuthGroups } from './authGroups'\nimport { Permission, RecordStepPermission } from './permission'\nimport { User } from './user'\nimport { Users } from './users'\n\n// ======\n// ====== Survey\n// ======\n\nconst _getSurveyUserGroup = (user: User, surveyInfo: Survey, includeSystemAdmin = true): AuthGroup | undefined =>\n surveyInfo ? Users.getAuthGroupBySurveyUuid(surveyInfo.uuid, includeSystemAdmin)(user) : undefined\n\nconst _hasAuthGroupForSurvey = ({ user, surveyInfo }: { user: User; surveyInfo: Survey }): boolean =>\n Boolean(_getSurveyUserGroup(user, surveyInfo))\n\nconst _hasSurveyPermission =\n (permission: Permission) =>\n (user: User, surveyInfo: Survey): boolean => {\n if (!user) return false\n\n if (Users.isSystemAdmin(user)) return true\n\n if (!surveyInfo) return false\n\n const authGroup = _getSurveyUserGroup(user, surveyInfo)\n if (!authGroup) return false\n\n return AuthGroups.getPermissions(authGroup).includes(permission)\n }\n\nconst _hasPermissionInSomeGroup =\n (permission: Permission) =>\n (user: User): boolean => {\n if (Users.isSystemAdmin(user)) return true\n const groups = Users.getAuthGroups(user)\n return groups.some((group) => AuthGroups.getPermissions(group).includes(permission))\n }\n\n// CREATE\nconst canCreateSurvey = _hasPermissionInSomeGroup(Permission.surveyCreate)\nconst canCreateTemplate = (user: User): boolean => Users.isSystemAdmin(user)\nconst getMaxSurveysUserCanCreate = (user: User): number => {\n if (Users.isSystemAdmin(user)) return Number.NaN\n if (canCreateSurvey(user)) return Users.getMaxSurveys(user)\n return 0\n}\n\n// READ\nconst canViewSurvey = (user: User, surveyInfo: Survey): boolean =>\n Users.isSystemAdmin(user) || _hasAuthGroupForSurvey({ user, surveyInfo })\nconst canExportSurvey = _hasSurveyPermission(Permission.recordAnalyse)\nconst canExportSurveysList = (user: User): boolean => Users.isSystemAdmin(user)\nconst canViewTemplates = (user: User): boolean => Users.isSystemAdmin(user)\n// UPDATE\nconst canEditSurvey = _hasSurveyPermission(Permission.surveyEdit)\nconst canEditSurveyConfig = (user: User): boolean => Users.isSystemAdmin(user)\nconst canEditSurveyOwner = (user: User): boolean => Users.isSystemAdmin(user)\nconst canEditTemplates = (user: User): boolean => Users.isSystemAdmin(user)\nconst canRefreshAllSurveyRdbs = (user: User): boolean => Users.isSystemAdmin(user)\n\n// ======\n// ====== Record\n// ======\n\n// CREATE\nexport const canCreateRecord = _hasSurveyPermission(Permission.recordCreate)\n\n// READ\nexport const canViewRecord = _hasSurveyPermission(Permission.recordView)\nexport const canExportAllRecords = _hasSurveyPermission(Permission.recordCleanse)\nexport const canViewNotOwnedRecords = (user: User, surveyInfo: Survey): boolean => {\n if (!surveyInfo || !canViewSurvey(user, surveyInfo)) return false\n\n const { uuid: surveyUuid } = surveyInfo\n const groupInCurrentSurvey = Users.getAuthGroupBySurveyUuid(surveyUuid)(user)\n const groupName = groupInCurrentSurvey?.name\n\n if (groupName === AuthGroupName.dataEditor) {\n return Surveys.isDataEditorViewNotOwnedRecordsAllowed(surveyInfo)\n }\n if (groupName === AuthGroupName.dataAnalyst) {\n return Surveys.isDataAnalystViewNotOwnedRecordsAllowed(surveyInfo)\n }\n if (canExportAllRecords(user, surveyInfo)) return true\n\n return false\n}\nexport const canExportRecordsList = _hasSurveyPermission(Permission.surveyEdit)\n\n// UPDATE\nexport const canEditRecord = (user: User, record: Record, allowAnalysisStepEdit = false): boolean => {\n if (\n !user ||\n !record ||\n // records in analysis cannot be edited\n (!allowAnalysisStepEdit && Records.isInAnalysisStep(record))\n ) {\n return false\n }\n // system admin does not have an auth group associated to the survey, but he can always edit records;\n if (Users.isSystemAdmin(user)) {\n return true\n }\n const { surveyUuid, ownerUuid } = record\n // if user doesn't have an auth group associated to the survey, he cannot edit records\n const userAuthGroup = Users.getAuthGroupBySurveyUuid(surveyUuid)(user)\n if (!userAuthGroup) return false\n\n // groups without the record edit permission (e.g. survey guests) cannot edit records,\n // even when their record steps permission allows it (record steps permissions are used also to view records)\n if (!AuthGroups.getPermissions(userAuthGroup).includes(Permission.recordEdit)) return false\n\n // Level = 'all' or 'own'. If 'own', user can only edit records assigned to him\n // If 'all', he can edit all survey's records\n // permission checks must not throw: a group without record steps cannot edit records\n const level = AuthGroups.getRecordSteps(userAuthGroup)?.[Records.getStep(record)]\n return level === RecordStepPermission.all || (level === RecordStepPermission.own && ownerUuid === user.uuid)\n}\n\nconst canChangeRecordProps = (user: User, record: Record) => canEditRecord(user, record, true)\n\nconst canDeleteRecord = canEditRecord\n\nconst canDemoteRecord = canChangeRecordProps\n\nconst canChangeRecordOwner = canChangeRecordProps\n\nconst canChangeRecordStep = canChangeRecordProps\n\nconst canCleanseRecords = _hasSurveyPermission(Permission.recordCleanse)\n\nconst canExportRecords = _hasSurveyPermission(Permission.recordView)\n\nconst canImportRecords = (user: User, surveyInfo: Survey) =>\n surveyInfo?.published && _hasSurveyPermission(Permission.recordCreate)(user, surveyInfo)\n\nconst canAnalyzeRecords = _hasSurveyPermission(Permission.recordAnalyse)\n\nconst canUpdateRecordsStep = canAnalyzeRecords\n\n// ======\n// ====== Explorer\n// ======\n\nconst canUseExplorer = canCleanseRecords\n\n// ======\n// ====== Map\n// ======\n\nconst canUseMap = canAnalyzeRecords\n\n// ======\n// ====== Users\n// ======\n\n// CREATE\nconst canInviteUsers = _hasSurveyPermission(Permission.userInvite)\n\n// READ\nconst canViewSurveyUsers = _hasSurveyPermission(Permission.userInvite)\n\nconst _usersBelongToSameSurvey = ({ user, userToView }: { user: User; userToView: User }) =>\n Users.getAuthGroups(user).some(\n (authGroupUser) =>\n AuthGroups.isSurveyGroup(authGroupUser) &&\n Users.getAuthGroups(userToView).some(\n (authGroupUserToView) =>\n AuthGroups.isSurveyGroup(authGroupUserToView) &&\n AuthGroups.getSurveyUuid(authGroupUserToView) === AuthGroups.getSurveyUuid(authGroupUser)\n )\n )\n\nconst canViewUser = (user: User, _surveyInfo: Survey, userToView: User) =>\n Users.isSystemAdmin(user) || Users.isEqual(userToView)(user) || _usersBelongToSameSurvey({ user, userToView })\n\nconst canViewOtherUsersEmail = ({ user, surveyInfo }: { user: User; surveyInfo: Survey }) =>\n Users.isSystemAdmin(user) || canInviteUsers(user, surveyInfo)\n\nconst canViewOtherUsersNameInSameSurvey = (user: User, surveyInfo: Survey): boolean =>\n _hasSurveyPermission(Permission.recordView)(user, surveyInfo)\n\nconst canViewAllUsers = (user: User) => Users.isSystemAdmin(user)\n\n// EDIT\nconst _hasUserEditAccess = (user: User, surveyInfo: Survey, userToUpdate: User): boolean =>\n Users.isSystemAdmin(user) ||\n (_hasSurveyPermission(Permission.userEdit)(user, surveyInfo) &&\n // user to update has an auth group in the same survey\n _hasAuthGroupForSurvey({ user: userToUpdate, surveyInfo }))\n\nconst canCreateUsers = (user: User): boolean => Users.isSystemAdmin(user)\n\nconst canEditUser = (user: User, surveyInfo: Survey, userToUpdate: User): boolean =>\n Users.hasAccepted(userToUpdate) &&\n (Users.isEqual(user)(userToUpdate) || _hasUserEditAccess(user, surveyInfo, userToUpdate))\n\nconst canEditUserEmail = (user: User): boolean => Users.isSystemAdmin(user)\n\nconst canEditUserGroup = (user: User, surveyInfo: Survey, userToUpdate: User): boolean =>\n !Users.isEqual(user)(userToUpdate) && _hasUserEditAccess(user, surveyInfo, userToUpdate)\n\nconst canRemoveUser = (user: User, surveyInfo: Survey, userToRemove: User): boolean =>\n !Users.isEqual(user)(userToRemove) &&\n !Users.isSystemAdmin(userToRemove) &&\n _hasUserEditAccess(user, surveyInfo, userToRemove)\n\nconst canEditUserSurveyManager = (user: User) => Users.isSystemAdmin(user)\nconst canEditUserMaxSurveys = (user: User) => Users.isSystemAdmin(user)\n\n// USER ACCESS REQUESTS\nconst canViewUsersAccessRequests = (user: User): boolean => Users.isSystemAdmin(user)\nconst canEditUsersAccessRequests = (user: User): boolean => Users.isSystemAdmin(user)\n\n// INVITE\nconst getUserGroupsCanAssign = ({\n user,\n surveyInfo = null,\n editingLoggedUser = false,\n showOnlySurveyGroups = false,\n}: {\n user: User\n surveyInfo?: Survey | null\n editingLoggedUser?: boolean\n showOnlySurveyGroups?: boolean\n}) => {\n const groups = []\n\n let surveyGroups: AuthGroup[] = []\n if (editingLoggedUser && !surveyInfo) {\n // This can happen for system administrators when they don't have an active survey\n surveyGroups = []\n } else if (surveyInfo) {\n if (surveyInfo.published) {\n surveyGroups = Surveys.getAuthGroups(surveyInfo)\n } else {\n const adminGroup = Surveys.getAuthGroupAdmin(surveyInfo)\n surveyGroups = adminGroup ? [adminGroup] : []\n }\n }\n\n // do not allow surveyEditor group selection (remove surveyEditor group completely?)\n surveyGroups = surveyGroups.filter((group) => group.name !== AuthGroupName.surveyEditor)\n\n groups.push(...surveyGroups)\n\n if (!showOnlySurveyGroups && (Users.isSystemAdmin(user) || Users.isSurveyManager(user))) {\n // Add SystemAdmin or SurveyManager group if current user is a SystemAdmin or SurveyManager himself\n const userNonSurveyGroups = Users.getAuthGroups(user).filter((group) => !AuthGroups.isSurveyGroup(group))\n groups.push(...userNonSurveyGroups)\n }\n return AuthGroups.sortGroups(groups)\n}\n\nexport const Authorizer = {\n // Survey\n canCreateSurvey,\n canCreateTemplate,\n getMaxSurveysUserCanCreate,\n canViewSurvey,\n canExportSurvey,\n canExportSurveysList,\n canViewTemplates,\n canEditSurvey,\n canEditSurveyConfig,\n canEditSurveyOwner,\n canEditTemplates,\n canRefreshAllSurveyRdbs,\n // Record\n canCreateRecord,\n canViewRecord,\n canExportAllRecords,\n canViewNotOwnedRecords,\n canExportRecordsList,\n canEditRecord,\n canDeleteRecord,\n canDemoteRecord,\n canChangeRecordOwner,\n canChangeRecordStep,\n canCleanseRecords,\n canExportRecords,\n canImportRecords,\n canAnalyzeRecords,\n canUpdateRecordsStep,\n // Explorer\n canUseExplorer,\n // Map\n canUseMap,\n // Users\n canInviteUsers,\n canViewSurveyUsers,\n canViewUser,\n canViewOtherUsersEmail,\n canViewOtherUsersNameInSameSurvey,\n canViewAllUsers,\n canCreateUsers,\n canEditUser,\n canEditUserEmail,\n canEditUserGroup,\n canRemoveUser,\n canEditUserSurveyManager,\n canEditUserMaxSurveys,\n // User Access Requests\n canViewUsersAccessRequests,\n canEditUsersAccessRequests,\n // Invite\n getUserGroupsCanAssign,\n}\n"]}
|
package/dist/auth/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/auth/factory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAChC,iCAAoD;AAUvC,QAAA,WAAW,GAAqC;IAC3D,cAAc,EAAE,CAAC,MAAyB,EAAQ,EAAE;QAClD,MAAM,YAAY,GAAG;YACnB,iBAAiB,EAAE,KAAK;YACxB,MAAM,EAAE,iBAAU,CAAC,OAAO;SAC3B,CAAA;QAED,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,mCACzD,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,KAAK;YACL,iBAAiB;YACjB,IAAI;YACJ,KAAK,EAAE;gBACL,KAAK;gBACL,KAAK;aACN;YACD,MAAM;YACN,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/auth/factory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAChC,iCAAoD;AAUvC,QAAA,WAAW,GAAqC;IAC3D,cAAc,EAAE,CAAC,MAAyB,EAAQ,EAAE;QAClD,MAAM,YAAY,GAAG;YACnB,iBAAiB,EAAE,KAAK;YACxB,MAAM,EAAE,iBAAU,CAAC,OAAO;SAC3B,CAAA;QAED,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,mCACzD,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,KAAK;YACL,iBAAiB;YACjB,IAAI;YACJ,KAAK,EAAE;gBACL,KAAK;gBACL,KAAK;aACN;YACD,MAAM;YACN,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { Dictionary, Factory } from '../common'\nimport { UUIDs } from '../utils'\nimport { User, UserStatus, UserTitle } from './user'\n\nexport type UserFactoryParams = {\n email: string\n name: string\n status?: UserStatus\n title?: UserTitle\n extra?: Dictionary<any>\n}\n\nexport const UserFactory: Factory<User, UserFactoryParams> = {\n createInstance: (params: UserFactoryParams): User => {\n const defaultProps = {\n hasProfilePicture: false,\n status: UserStatus.INVITED,\n }\n\n const { email, name, hasProfilePicture, status, title, extra } = {\n ...defaultProps,\n ...params,\n }\n\n return {\n email,\n hasProfilePicture,\n name,\n props: {\n title,\n extra,\n },\n status,\n uuid: UUIDs.v4(),\n }\n },\n}\n"]}
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAEnB,yCAA2C;AAAlC,0GAAA,aAAa,OAAA;AAwBtB,+BAA8C;AAArC,kGAAA,UAAU,OAAA;AAAE,iGAAA,SAAS,OAAA;AAC9B,qCAAuC;AAA9B,sGAAA,WAAW,OAAA;AAEpB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAInB,iCAA+B;AAAtB,8FAAA,KAAK,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAEnB,yCAA2C;AAAlC,0GAAA,aAAa,OAAA;AAwBtB,+BAA8C;AAArC,kGAAA,UAAU,OAAA;AAAE,iGAAA,SAAS,OAAA;AAC9B,qCAAuC;AAA9B,sGAAA,WAAW,OAAA;AAEpB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAInB,iCAA+B;AAAtB,8FAAA,KAAK,OAAA","sourcesContent":["export { Authorizer } from './authorizer'\n\nexport { AuthGroupName } from './authGroup'\nexport type { AuthGroup } from './authGroup'\n\nexport type {\n User,\n UserAuthGroup,\n UserAuthGroupProps,\n UserInvitation,\n UserPrefs,\n UserProps,\n UserPrefSurveys,\n} from './user'\nexport type {\n AuthToken,\n UserAuthTokenPayload,\n UserAuthRefreshToken,\n UserAuthRefreshTokenPayload,\n UserAuthRefreshTokenProps,\n UserTokenPayload,\n DownloadAuthTokenPayload,\n} from './userAuth'\nexport type { UserService } from './userService'\nexport type { UserAuthTokenService } from './userAuthTokenService'\n\nexport { UserStatus, UserTitle } from './user'\nexport { UserFactory } from './factory'\n\nexport { Permission } from './permission'\n\nexport type { UserGroupQualifier, UserGroupProps, UserGroup } from './userGroup'\n\nexport { Users } from './users'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/auth/permission.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,2CAA6B,CAAA;IAC7B,uCAAyB,CAAA;IACzB,2CAA6B,CAAA;IAC7B,uCAAyB,CAAA;IACzB,uCAAyB,CAAA;IACzB,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,mCAAqB,CAAA;IACrB,uCAAyB,CAAA;IACzB,iDAAmC,CAAA;AACrC,CAAC,EAXW,UAAU,0BAAV,UAAU,QAWrB;AAED,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,mCAAW,CAAA;AACb,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B"}
|
|
1
|
+
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/auth/permission.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,2CAA6B,CAAA;IAC7B,uCAAyB,CAAA;IACzB,2CAA6B,CAAA;IAC7B,uCAAyB,CAAA;IACzB,uCAAyB,CAAA;IACzB,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,mCAAqB,CAAA;IACrB,uCAAyB,CAAA;IACzB,iDAAmC,CAAA;AACrC,CAAC,EAXW,UAAU,0BAAV,UAAU,QAWrB;AAED,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,mCAAW,CAAA;AACb,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B","sourcesContent":["export enum Permission {\n surveyCreate = 'surveyCreate',\n surveyEdit = 'surveyEdit',\n recordCreate = 'recordCreate',\n recordEdit = 'recordEdit',\n recordView = 'recordView',\n recordCleanse = 'recordCleanse',\n recordAnalyse = 'recordAnalyse',\n userEdit = 'userEdit',\n userInvite = 'userInvite',\n permissionsEdit = 'permissionsEdit',\n}\n\nexport enum RecordStepPermission {\n all = 'all',\n own = 'own',\n}\n"]}
|
package/dist/auth/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/auth/user.ts"],"names":[],"mappings":";;;AAGA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,6DAA+C,CAAA;AACjD,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,sBAAS,CAAA;IACT,sBAAS,CAAA;IACT,8CAAiC,CAAA;AACnC,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/auth/user.ts"],"names":[],"mappings":";;;AAGA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,6DAA+C,CAAA;AACjD,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,sBAAS,CAAA;IACT,sBAAS,CAAA;IACT,8CAAiC,CAAA;AACnC,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB","sourcesContent":["import { ArenaObject, Dictionary } from '../common'\nimport { AuthGroup } from './authGroup'\n\nexport enum UserStatus {\n INVITED = 'INVITED',\n ACCEPTED = 'ACCEPTED',\n FORCE_CHANGE_PASSWORD = 'FORCE_CHANGE_PASSWORD',\n}\n\nexport enum UserTitle {\n mr = 'mr',\n ms = 'ms',\n preferNotToSay = 'preferNotToSay',\n}\n\nexport interface UserPrefSurveys {\n [surveyId: number]: { cycle: number }\n current?: number\n}\n\nexport interface UserPrefs {\n surveys?: UserPrefSurveys\n}\n\nexport interface UserProps {\n extra?: Dictionary<any>\n // private props (visible only to the user itself)\n mapApiKeyByProvider?: Dictionary<string>\n // restricted props (editable only by system admins)\n maxSurveys?: number\n title?: UserTitle\n}\n\nexport interface UserInvitation {\n expired: boolean\n}\n\nexport interface UserAuthGroupProps {\n extra: Dictionary<any>\n}\n\nexport interface UserAuthGroup extends AuthGroup {\n props?: UserAuthGroupProps\n}\n\nexport interface User extends ArenaObject<UserProps> {\n authGroups?: UserAuthGroup[]\n email: string\n hasProfilePicture: boolean\n name: string\n prefs?: UserPrefs\n status: UserStatus\n password?: string\n invitation?: UserInvitation\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAuth.js","sourceRoot":"","sources":["../../src/auth/userAuth.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"userAuth.js","sourceRoot":"","sources":["../../src/auth/userAuth.ts"],"names":[],"mappings":"","sourcesContent":["import { AppInfo } from '../app'\n\nexport type AuthToken = {\n token: string\n dateCreated: Date\n expiresAt: Date\n}\n\nexport type UserAuthRefreshTokenProps = {\n appInfo?: AppInfo\n ipAddress?: string\n userAgent?: string\n}\n\nexport type UserAuthRefreshToken = AuthToken & {\n uuid: string\n userUuid: string\n props: UserAuthRefreshTokenProps\n revoked?: boolean\n}\n\nexport type UserTokenPayload = {\n userUuid: string\n}\n\nexport type UserAuthTokenPayload = UserTokenPayload & {\n uuid?: string\n}\n\nexport type UserAuthRefreshTokenPayload = UserTokenPayload & {\n uuid: string\n}\n\nexport type DownloadAuthTokenPayload = UserTokenPayload & {\n fileName: string\n}\n"]}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { ArenaService } from '../common';
|
|
2
2
|
import { UserAuthRefreshToken, UserAuthRefreshTokenProps, AuthToken, UserTokenPayload } from './userAuth';
|
|
3
3
|
export interface UserAuthTokenService extends ArenaService {
|
|
4
|
+
/**
|
|
5
|
+
* Create new auth and refresh tokens for the specified user.
|
|
6
|
+
* @param options
|
|
7
|
+
* @param options.userUuid The UUID of the user for whom the tokens are being created.
|
|
8
|
+
* @param options.props Additional properties for the refresh token.
|
|
9
|
+
* @param dbClient Optional database client for transaction management.
|
|
10
|
+
* @returns An object containing the created AuthToken and UserAuthRefreshToken.
|
|
11
|
+
*/
|
|
4
12
|
createUserAuthTokens(options: {
|
|
5
13
|
userUuid: string;
|
|
6
14
|
props: UserAuthRefreshTokenProps;
|
|
@@ -8,11 +16,26 @@ export interface UserAuthTokenService extends ArenaService {
|
|
|
8
16
|
authToken: AuthToken;
|
|
9
17
|
refreshToken: UserAuthRefreshToken;
|
|
10
18
|
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a one-time download auth token for the specified user and file name.
|
|
21
|
+
* @param options
|
|
22
|
+
* @param options.userUuid The UUID of the user for whom the token is being created.
|
|
23
|
+
* @param options.fileName The name of the file to be downloaded.
|
|
24
|
+
* @returns An AuthToken object containing the token string, creation date, and expiration date.
|
|
25
|
+
*/
|
|
11
26
|
createDownloadAuthToken(options: {
|
|
12
27
|
userUuid: string;
|
|
13
28
|
fileName: string;
|
|
14
29
|
}): AuthToken;
|
|
15
30
|
getByUuid(tokenUuid: string): Promise<UserAuthRefreshToken | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Rotate (refresh) the auth and refresh tokens using the provided refresh token.
|
|
33
|
+
* @param options
|
|
34
|
+
* @param options.refreshToken The current refresh token used to obtain new tokens.
|
|
35
|
+
* @param options.refreshTokenProps Additional properties for the new refresh token.
|
|
36
|
+
* @param dbClient Optional database client for transaction management.
|
|
37
|
+
* @returns An object containing the new AuthToken and UserAuthRefreshToken, or null if the refresh token is invalid.
|
|
38
|
+
*/
|
|
16
39
|
rotateTokens(options: {
|
|
17
40
|
refreshToken: string;
|
|
18
41
|
refreshTokenProps: UserAuthRefreshTokenProps;
|
|
@@ -27,5 +50,10 @@ export interface UserAuthTokenService extends ArenaService {
|
|
|
27
50
|
userUuid: string;
|
|
28
51
|
}): Promise<void>;
|
|
29
52
|
deleteExpired(): Promise<number>;
|
|
53
|
+
/**
|
|
54
|
+
* Verify the provided auth token and return its payload.
|
|
55
|
+
* @param token The auth token string to verify.
|
|
56
|
+
* @returns The payload of the verified token.
|
|
57
|
+
*/
|
|
30
58
|
verifyAuthToken<P extends UserTokenPayload>(token: string): P;
|
|
31
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAuthTokenService.js","sourceRoot":"","sources":["../../src/auth/userAuthTokenService.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"userAuthTokenService.js","sourceRoot":"","sources":["../../src/auth/userAuthTokenService.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaService } from '../common'\nimport { UserAuthRefreshToken, UserAuthRefreshTokenProps, AuthToken, UserTokenPayload } from './userAuth'\n\nexport interface UserAuthTokenService extends ArenaService {\n // ==== CREATE\n /**\n * Create new auth and refresh tokens for the specified user.\n * @param options\n * @param options.userUuid The UUID of the user for whom the tokens are being created.\n * @param options.props Additional properties for the refresh token.\n * @param dbClient Optional database client for transaction management.\n * @returns An object containing the created AuthToken and UserAuthRefreshToken.\n */\n createUserAuthTokens(\n options: { userUuid: string; props: UserAuthRefreshTokenProps },\n dbClient?: any\n ): Promise<{ authToken: AuthToken; refreshToken: UserAuthRefreshToken }>\n\n /**\n * Create a one-time download auth token for the specified user and file name.\n * @param options\n * @param options.userUuid The UUID of the user for whom the token is being created.\n * @param options.fileName The name of the file to be downloaded.\n * @returns An AuthToken object containing the token string, creation date, and expiration date.\n */\n createDownloadAuthToken(options: { userUuid: string; fileName: string }): AuthToken\n\n // ==== READ\n getByUuid(tokenUuid: string): Promise<UserAuthRefreshToken | null>\n\n // ==== UPDATE\n /**\n * Rotate (refresh) the auth and refresh tokens using the provided refresh token.\n * @param options\n * @param options.refreshToken The current refresh token used to obtain new tokens.\n * @param options.refreshTokenProps Additional properties for the new refresh token.\n * @param dbClient Optional database client for transaction management.\n * @returns An object containing the new AuthToken and UserAuthRefreshToken, or null if the refresh token is invalid.\n */\n rotateTokens(\n options: { refreshToken: string; refreshTokenProps: UserAuthRefreshTokenProps },\n dbClient?: any\n ): Promise<{\n authToken: AuthToken\n refreshToken: UserAuthRefreshToken\n } | null>\n\n revoke(options: { tokenUuid: string }): Promise<void>\n revokeAll(options: { userUuid: string }): Promise<void>\n\n // ==== DELETE\n deleteExpired(): Promise<number>\n\n // ==== UTIL\n /**\n * Verify the provided auth token and return its payload.\n * @param token The auth token string to verify.\n * @returns The payload of the verified token.\n */\n verifyAuthToken<P extends UserTokenPayload>(token: string): P\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userGroup.js","sourceRoot":"","sources":["../../src/auth/userGroup.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"userGroup.js","sourceRoot":"","sources":["../../src/auth/userGroup.ts"],"names":[],"mappings":"","sourcesContent":["export type UserGroupQualifier = {\n name: string\n value: string\n}\n\nexport type UserGroupProps = {\n name?: string\n qualifiers?: UserGroupQualifier[]\n}\n\nexport type UserGroup = {\n uuid: string\n surveyUuid?: string\n props: UserGroupProps\n dateCreated?: string\n dateModified?: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userService.js","sourceRoot":"","sources":["../../src/auth/userService.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"userService.js","sourceRoot":"","sources":["../../src/auth/userService.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ArenaService } from '../common'\n\nexport interface UserService extends ArenaService {\n // ==== CREATE\n create(options: {\n user: User\n surveyId: number\n surveyCycleKey: string\n userToInviteParam: string\n urlServer: string\n repeatInvitation?: boolean\n }): Promise<User>\n\n // ==== READ\n count(options: { user: User; surveyId: number }): Promise<number>\n\n get(options: { userUuid: string } | { email: string; password?: string }): Promise<User | null>\n getMany(options: { surveyId: number; limit?: number; offset?: number; user: User }): Promise<Array<User>>\n getProfilePicture(options: { userUuid: string }): Promise<string>\n\n // ==== UPDATE\n update(options: { user: User; surveyId: number; userToUpdate: User; filePath?: string }): Promise<User>\n updateUserPrefs(options: { userToUpdate: User }): Promise<User>\n\n // ==== DELETE\n delete(options: { surveyId: number; user: User; userUuid: string }): Promise<void>\n}\n"]}
|
package/dist/auth/users.js
CHANGED
|
@@ -25,6 +25,7 @@ const getCombinedExtraProps = (surveyUuid) => (user) => {
|
|
|
25
25
|
const userSurveyAuthGroup = user ? exports.Users.getAuthGroupBySurveyUuid(surveyUuid)(user) : null;
|
|
26
26
|
const userAuthGroupExtraProps = (_b = (_a = userSurveyAuthGroup === null || userSurveyAuthGroup === void 0 ? void 0 : userSurveyAuthGroup.props) === null || _a === void 0 ? void 0 : _a.extra) !== null && _b !== void 0 ? _b : {};
|
|
27
27
|
const userExtraProps = (_c = user === null || user === void 0 ? void 0 : user.props.extra) !== null && _c !== void 0 ? _c : {};
|
|
28
|
+
// user auth group extra props overwrite user extra props
|
|
28
29
|
return Object.assign(Object.assign({}, userExtraProps), userAuthGroupExtraProps);
|
|
29
30
|
};
|
|
30
31
|
const getMaxSurveys = (user) => { var _a, _b; return (_b = (_a = user.props) === null || _a === void 0 ? void 0 : _a.maxSurveys) !== null && _b !== void 0 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;IACvE,MAAM,cAAc,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,KAAK,mCAAI,EAAE,CAAA;IAC9C,yDAAyD;IACzD,uCAAY,cAAc,GAAK,uBAAuB,EAAE;AAC1D,CAAC,CAAA;AAEH,MAAM,aAAa,GAAG,CAAC,IAAU,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,UAAU,mCAAI,iBAAiB,CAAA,EAAA,CAAA;AAEjF,MAAM,OAAO,GACX,CAAC,aAAmB,EAAE,EAAE,CACxB,CAAC,IAAU,EAAW,EAAE,CACtB,IAAI,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;AAEjF,QAAA,KAAK,GAAG;IACnB,WAAW;IACX,aAAa;IACb,aAAa;IACb,eAAe;IACf,wBAAwB;IACxB,kBAAkB;IAClB,qBAAqB;IACrB,aAAa;IACb,OAAO;CACR,CAAA","sourcesContent":["import { Dictionary } from '../common'\nimport { AuthGroupName } from './authGroup'\nimport { AuthGroups } from './authGroups'\nimport { User, UserAuthGroup, UserStatus } from './user'\n\nconst defaultMaxSurveys = 5\n\nconst hasAccepted = (user: User): boolean => user?.status === UserStatus.ACCEPTED\n\nconst getAuthGroups = (user: User): UserAuthGroup[] => user?.authGroups ?? []\n\nconst isSystemAdmin = (user: User): boolean => getAuthGroups(user).some(AuthGroups.isSystemAdmin)\n\nconst isSurveyManager = (user: User): boolean => getAuthGroups(user).some(AuthGroups.isSurveyManager)\n\nconst getAuthGroupBySurveyUuid =\n (surveyUuid?: string, includeSystemAdmin = true) =>\n (user: User): UserAuthGroup | undefined => {\n const authGroups = getAuthGroups(user)\n if (!authGroups) return undefined\n return includeSystemAdmin && isSystemAdmin(user)\n ? authGroups.find(AuthGroups.isSystemAdmin)\n : authGroups.find((authGroup) => authGroup.surveyUuid === surveyUuid)\n }\n\nconst getAuthGroupByName = (groupName: AuthGroupName) => (user: User) => {\n const authGroups = getAuthGroups(user)\n return authGroups.find((group) => group.name === groupName)\n}\n\nconst getCombinedExtraProps =\n (surveyUuid: string) =>\n (user: User): Dictionary<any> => {\n const userSurveyAuthGroup = user ? Users.getAuthGroupBySurveyUuid(surveyUuid)(user) : null\n const userAuthGroupExtraProps = userSurveyAuthGroup?.props?.extra ?? {}\n const userExtraProps = user?.props.extra ?? {}\n // user auth group extra props overwrite user extra props\n return { ...userExtraProps, ...userAuthGroupExtraProps }\n }\n\nconst getMaxSurveys = (user: User) => user.props?.maxSurveys ?? defaultMaxSurveys\n\nconst isEqual =\n (userToCompare: User) =>\n (user: User): boolean =>\n user && userToCompare ? user === userToCompare || user.uuid === userToCompare.uuid : false\n\nexport const Users = {\n hasAccepted,\n getAuthGroups,\n isSystemAdmin,\n isSurveyManager,\n getAuthGroupBySurveyUuid,\n getAuthGroupByName,\n getCombinedExtraProps,\n getMaxSurveys,\n isEqual,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/category/categories.ts"],"names":[],"mappings":";;;AAGA,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAA6B,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAA;AAEvG,MAAM,oBAAoB,GAAG,CAAC,QAAkB,EAAY,EAAE,WAAC,OAAA,MAAM,CAAC,IAAI,CAAC,MAAA,gBAAgB,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAA;AAE5G,MAAM,qBAAqB,GACzB,CAAC,IAAY,EAAE,EAAE,CACjB,CAAC,QAAkB,EAA4B,EAAE,WAC/C,OAAA,MAAA,gBAAgB,CAAC,QAAQ,CAAC,0CAAG,IAAI,CAAC,CAAA,EAAA,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;CACtB,CAAA"}
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/category/categories.ts"],"names":[],"mappings":";;;AAGA,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAA6B,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAA;AAEvG,MAAM,oBAAoB,GAAG,CAAC,QAAkB,EAAY,EAAE,WAAC,OAAA,MAAM,CAAC,IAAI,CAAC,MAAA,gBAAgB,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAA;AAE5G,MAAM,qBAAqB,GACzB,CAAC,IAAY,EAAE,EAAE,CACjB,CAAC,QAAkB,EAA4B,EAAE,WAC/C,OAAA,MAAA,gBAAgB,CAAC,QAAQ,CAAC,0CAAG,IAAI,CAAC,CAAA,EAAA,CAAA;AAEzB,QAAA,UAAU,GAAG;IACxB,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;CACtB,CAAA","sourcesContent":["import { ExtraPropDef, ExtraPropDefs } from '../extraProp'\nimport { Category } from './category'\n\nconst getExtraPropDefs = (category: Category): ExtraPropDefs | undefined => category.props.itemExtraDef\n\nconst getExtraPropDefNames = (category: Category): string[] => Object.keys(getExtraPropDefs(category) ?? {})\n\nconst getExtraPropDefByName =\n (name: string) =>\n (category: Category): ExtraPropDef | undefined =>\n getExtraPropDefs(category)?.[name]\n\nexport const Categories = {\n getExtraPropDefs,\n getExtraPropDefNames,\n getExtraPropDefByName,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../src/category/category.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../src/category/category.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaObject, Dictionary } from '../common'\nimport { ExtraPropDefs } from '../extraProp'\nimport { CategoryLevel } from './level'\n\nexport interface CategoryProps {\n itemExtraDef?: ExtraPropDefs\n name?: string\n}\n\nexport interface Category extends ArenaObject<CategoryProps> {\n id?: number\n levels: Dictionary<CategoryLevel>\n published?: boolean\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categoryImportSummary.js","sourceRoot":"","sources":["../../src/category/categoryImportSummary.ts"],"names":[],"mappings":";;;AAGA,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,yCAAa,CAAA;IACb,uDAA2B,CAAA;IAC3B,2CAAe,CAAA;IACf,2CAAe,CAAA;AACjB,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC"}
|
|
1
|
+
{"version":3,"file":"categoryImportSummary.js","sourceRoot":"","sources":["../../src/category/categoryImportSummary.ts"],"names":[],"mappings":";;;AAGA,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,yCAAa,CAAA;IACb,uDAA2B,CAAA;IAC3B,2CAAe,CAAA;IACf,2CAAe,CAAA;AACjB,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC","sourcesContent":["import { ExtraPropDataType } from '../extraProp'\nimport { LanguageCode } from '../language'\n\nexport enum CategoryImportColumnType {\n code = 'code',\n description = 'description',\n extra = 'extra',\n label = 'label',\n}\n\nexport interface CategoryImportSummaryColumn {\n dataType: ExtraPropDataType\n lang: LanguageCode\n levelIndex: number\n levelName: string\n name: string\n type: CategoryImportColumnType\n}\n\nexport interface CategoryImportSummary {\n columns: { [key: string]: CategoryImportSummaryColumn }\n filePath: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categoryItemGenerator.js","sourceRoot":"","sources":["../../src/category/categoryItemGenerator.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,4CAAsD;AAEtD,qEAAoE;AACpE,oCAAgC;AAEhC,MAAM,YAAY,GAAG,CAAC,MAAgD,EAAuB,EAAE;IAC7F,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAA;IACvC,MAAM,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AE,KAAK,EAAE;KACvB,CAAA;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,mCAAuB,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC,CAAA;IAC5E,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAEY,QAAA,qBAAqB,GAAG;IACnC,YAAY;CACb,CAAA","sourcesContent":["import { Categories } from './categories'\nimport { CategoryItem } from './item'\nimport { ExtraPropsDataGenerator } from '../extraProp'\nimport { Survey } from '../survey'\nimport { getCategoryByUuid } from '../survey/surveys/surveysGetters'\nimport { UUIDs } from '../utils'\n\nconst generateItem = (params: { survey: Survey; categoryUuid: string }): CategoryItem | null => {\n const { survey, categoryUuid } = params\n const category = categoryUuid ? getCategoryByUuid({ survey, categoryUuid }) : null\n if (!category) return null\n const extraPropDefs = Categories.getExtraPropDefs(category)\n\n const item: CategoryItem = {\n uuid: UUIDs.v4(),\n props: { code: 'ABC' },\n }\n if (extraPropDefs) {\n item.props.extra = ExtraPropsDataGenerator.generateData({ extraPropDefs })\n }\n return item\n}\n\nexport const CategoryItemGenerator = {\n generateItem,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categoryItems.js","sourceRoot":"","sources":["../../src/category/categoryItems.ts"],"names":[],"mappings":";;;AAGA,MAAM,OAAO,GAAG,CAAC,IAAkB,EAAU,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAA,EAAA,CAAA;AAErE,MAAM,QAAQ,GAAG,CAAC,IAAkB,EAAU,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,MAAM,CAAC,GAAG,CAAA,EAAA,CAAA;AAE/E,MAAM,QAAQ,GAAG,CAAC,IAAkB,EAAE,IAAkB,EAAE,aAAuB,EAAU,EAAE;;IAC3F,MAAM,KAAK,GAAG,MAAA,MAAA,I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AAA;AACxD,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,IAAkB,EAAE,IAAkB,EAAU,EAAE;IAC1E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAClC,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AAC5C,CAAC,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,gBAAgB;CACjB,CAAA","sourcesContent":["import { LanguageCode } from '../language'\nimport { CategoryItem } from './item'\n\nconst getCode = (item: CategoryItem): string => item.props.code ?? ''\n\nconst getIndex = (item: CategoryItem): number => item.props.index ?? Number.NaN\n\nconst getLabel = (item: CategoryItem, lang: LanguageCode, defaultToCode?: boolean): string => {\n const label = item.props.labels?.[lang] ?? ''\n return !label && defaultToCode ? getCode(item) : label\n}\n\nconst getLabelWithCode = (item: CategoryItem, lang: LanguageCode): string => {\n const code = getCode(item)\n const label = getLabel(item, lang)\n return label ? `${label} (${code})` : code\n}\n\nexport const CategoryItems = {\n getCode,\n getIndex,\n getLabel,\n getLabelWithCode,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/category/factory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAWnB,QAAA,eAAe,GAA6C;IACvE,cAAc,EAAE,CAAC,MAA8B,EAAY,EAAE;QAC3D,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE;SACV,CAAA;QAED,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,mCAC7B,YAAY,GACZ,MAAM,CACV,CAAA;QAED,MAAM,QAAQ,GAAG;YACf,MAAM;YACN,KAAK;YACL,SAAS;YACT,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;QACD,uCACK,QAAQ,KACX,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI;gBAChB,CAAC,EAAE,4BAAoB,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;aAC9G,IACF;IACH,CAAC;CACF,CAAA;AAQY,QAAA,oBAAoB,GAAuD;IACtF,cAAc,EAAE,CAAC,MAAmC,EAAiB,EAAE;QACrE,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,CAAC;SACT,CAAA;QAED,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,mCAC/B,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,YAAY;YACZ,KAAK;YACL,KAAK;YACL,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;CACF,CAAA;AAQY,QAAA,mBAAmB,GAAqD;IACnF,cAAc,EAAE,CAAC,MAAkC,EAAgB,EAAE;QACnE,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE;SACV,CAAA;QAED,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,mCACjC,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;YAChB,SAAS;YACT,UAAU;YACV,KAAK;SACN,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/category/factory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAWnB,QAAA,eAAe,GAA6C;IACvE,cAAc,EAAE,CAAC,MAA8B,EAAY,EAAE;QAC3D,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE;SACV,CAAA;QAED,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,mCAC7B,YAAY,GACZ,MAAM,CACV,CAAA;QAED,MAAM,QAAQ,GAAG;YACf,MAAM;YACN,KAAK;YACL,SAAS;YACT,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;QACD,uCACK,QAAQ,KACX,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI;gBAChB,CAAC,EAAE,4BAAoB,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;aAC9G,IACF;IACH,CAAC;CACF,CAAA;AAQY,QAAA,oBAAoB,GAAuD;IACtF,cAAc,EAAE,CAAC,MAAmC,EAAiB,EAAE;QACrE,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,CAAC;SACT,CAAA;QAED,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,mCAC/B,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,YAAY;YACZ,KAAK;YACL,KAAK;YACL,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;CACF,CAAA;AAQY,QAAA,mBAAmB,GAAqD;IACnF,cAAc,EAAE,CAAC,MAAkC,EAAgB,EAAE;QACnE,MAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE;SACV,CAAA;QAED,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,mCACjC,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;YAChB,SAAS;YACT,UAAU;YACV,KAAK;SACN,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { Dictionary, Factory } from '../common'\nimport { UUIDs } from '../utils'\nimport { Category, CategoryProps } from './category'\nimport { CategoryItem, CategoryItemProps } from './item'\nimport { CategoryLevel, CategoryLevelProps } from './level'\n\nexport type CategoryFactoryParams = {\n props?: CategoryProps\n levels?: Dictionary<CategoryLevel>\n published?: boolean\n}\n\nexport const CategoryFactory: Factory<Category, CategoryFactoryParams> = {\n createInstance: (params?: CategoryFactoryParams): Category => {\n const defaultProps = {\n props: {},\n }\n\n const { published, props, levels } = {\n ...defaultProps,\n ...params,\n }\n\n const category = {\n levels,\n props,\n published,\n uuid: UUIDs.v4(),\n }\n return {\n ...category,\n levels: levels ?? {\n 0: CategoryLevelFactory.createInstance({ categoryUuid: category.uuid, index: 0, props: { name: 'level_1' } }),\n },\n }\n },\n}\n\nexport type CategoryLevelFactoryParams = {\n index?: number\n props?: CategoryLevelProps\n categoryUuid: string\n}\n\nexport const CategoryLevelFactory: Factory<CategoryLevel, CategoryLevelFactoryParams> = {\n createInstance: (params?: CategoryLevelFactoryParams): CategoryLevel => {\n const defaultProps = {\n props: {},\n index: 0,\n }\n\n const { index, categoryUuid, props } = {\n ...defaultProps,\n ...params,\n }\n\n return {\n categoryUuid,\n index,\n props,\n uuid: UUIDs.v4(),\n }\n },\n}\n\nexport type CategoryItemFactoryParams = {\n levelUuid: string\n parentUuid?: string\n props?: CategoryItemProps\n}\n\nexport const CategoryItemFactory: Factory<CategoryItem, CategoryItemFactoryParams> = {\n createInstance: (params?: CategoryItemFactoryParams): CategoryItem => {\n const defaultProps = {\n props: {},\n }\n\n const { levelUuid, parentUuid, props } = {\n ...defaultProps,\n ...params,\n }\n\n return {\n uuid: UUIDs.v4(),\n levelUuid,\n parentUuid,\n props,\n }\n },\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/category/index.ts"],"names":[],"mappings":";;;AACA,qCAAsF;AAA7E,0GAAA,eAAe,OAAA;AAAE,+GAAA,oBAAoB,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAYnE,iEAAkE;AAAzD,iIAAA,wBAAwB,OAAA;AAEjC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/category/index.ts"],"names":[],"mappings":";;;AACA,qCAAsF;AAA7E,0GAAA,eAAe,OAAA;AAAE,+GAAA,oBAAoB,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAYnE,iEAAkE;AAAzD,iIAAA,wBAAwB,OAAA;AAEjC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA","sourcesContent":["export type { Category, CategoryProps } from './category'\nexport { CategoryFactory, CategoryLevelFactory, CategoryItemFactory } from './factory'\n\nexport type { CategoryItem, CategoryItemProps } from './item'\n\nexport type { CategoryLevel, CategoryLevelProps } from './level'\n\nexport type { CategoryImportSummary, CategoryImportSummaryColumn } from './categoryImportSummary'\n\nexport type { CategoryService } from './service'\nexport type { CategoryItemService } from './itemService'\nexport type { CategoryLevelService } from './levelService'\n\nexport { CategoryImportColumnType } from './categoryImportSummary'\n\nexport { Categories } from './categories'\nexport { CategoryItems } from './categoryItems'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../src/category/item.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../src/category/item.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaObject, Dictionary } from '../common'\nimport { Labels } from '../language'\n\nexport interface CategoryItemProps {\n code?: string\n extra?: Dictionary<any>\n index?: number\n labels?: Labels\n}\n\nexport interface CategoryItem extends ArenaObject<CategoryItemProps> {\n draft?: boolean\n id?: number\n levelUuid?: string\n parentUuid?: string\n published?: boolean\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"itemService.js","sourceRoot":"","sources":["../../src/category/itemService.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"itemService.js","sourceRoot":"","sources":["../../src/category/itemService.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ArenaService } from '../common'\nimport { Category } from './category'\nimport { CategoryItem, CategoryItemProps } from './item'\n\nexport interface CategoryItemService extends ArenaService {\n // ==== CREATE\n create(options: {\n categoryUuid: string\n item: CategoryItem\n surveyId: number\n user: User\n }): Promise<{ item: CategoryItem; category: Category }>\n\n // ==== READ\n get(options: { validate?: boolean; draft?: boolean; categoryUuid: string; surveyId: number }): Promise<CategoryItem>\n\n getMany(options: {\n categoryUuid: string\n draft?: boolean\n parentUuid?: string\n surveyId: number\n }): Promise<Array<CategoryItem>>\n\n // ==== UPDATE\n update(options: {\n categoryUuid: string\n itemUuid: string\n surveyId: number\n user: User\n props: CategoryItemProps\n }): Promise<{ item: CategoryItem; category: Category }>\n\n // ==== DELETE\n delete(options: { itemUuid: string; categoryUuid: string; surveyId: number; user: User }): Promise<Category>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"level.js","sourceRoot":"","sources":["../../src/category/level.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"level.js","sourceRoot":"","sources":["../../src/category/level.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaObject } from '../common'\n\nexport interface CategoryLevelProps {\n name?: string\n}\n\nexport interface CategoryLevel extends ArenaObject<CategoryLevelProps> {\n categoryUuid?: string\n id?: number\n index?: number\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levelService.js","sourceRoot":"","sources":["../../src/category/levelService.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"levelService.js","sourceRoot":"","sources":["../../src/category/levelService.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ArenaService } from '../common'\nimport { Category } from './category'\nimport { CategoryLevel, CategoryLevelProps } from './level'\n\nexport interface CategoryLevelService extends ArenaService {\n // ==== CREATE\n create(options: { level: any; surveyId: number; user: User }): Promise<{ level: CategoryLevel; category: Category }>\n\n // ==== READ\n get(options: { validate?: boolean; draft?: boolean; categoryUuid: string; surveyId: number }): Promise<CategoryLevel>\n\n getMany(options: {\n draft?: boolean\n validate?: boolean\n limit?: number\n offset?: number\n search?: string\n surveyId: number\n }): Promise<Array<CategoryLevel>>\n\n // ==== UPDATE\n update(options: {\n categoryUuid: string\n levelUuid: string\n surveyId: number\n user: User\n props: CategoryLevelProps\n }): Promise<{ level: CategoryLevel; category: Category }>\n\n // ==== DELETE\n delete(options: { levelUuid: string; categoryUuid: string; surveyId: number; user: User }): Promise<Category>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/category/service.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/category/service.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ArenaService } from '../common'\nimport { JobSerialized } from '../job'\nimport { Category, CategoryProps } from './category'\nimport { CategoryImportSummary } from './categoryImportSummary'\n\nexport interface CategoryService extends ArenaService {\n // ==== CREATE\n create(options: { surveyId: number; category: Category; user: User }): Promise<Category>\n\n createImportSummary(filePath: string): Promise<CategoryImportSummary>\n\n createImportCategory(options: {\n categoryUuid: string\n summary: CategoryImportSummary\n surveyId: number\n user: User\n }): Promise<JobSerialized<any>>\n\n // ==== READ\n count(options: { draft?: boolean; user: User }): Promise<number>\n\n get(options: { validate?: boolean; draft?: boolean; categoryUuid: string; surveyId: number }): Promise<Category>\n\n getMany(options: {\n draft?: boolean\n validate?: boolean\n limit?: number\n offset?: number\n search?: string\n surveyId: number\n }): Promise<Array<Category>>\n\n // ==== UPDATE\n update(options: {\n categoryUuid: string\n surveyId: number\n system?: boolean\n user: User\n props: CategoryProps\n }): Promise<Category>\n\n // ==== DELETE\n delete(options: { categoryUuid: string; surveyId: number; user: User }): Promise<void>\n}\n"]}
|
package/dist/chain/chain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain/chain.ts"],"names":[],"mappings":";;;AAIA,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B"}
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain/chain.ts"],"names":[],"mappings":";;;AAIA,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B","sourcesContent":["import { ArenaObject } from '../common'\nimport { Labels } from '../language'\nimport { Validation } from '../validation'\n\nexport enum ChainStatusExec {\n error = 'error',\n running = 'running',\n success = 'success',\n}\n\nexport interface ChainProps {\n descriptions?: Labels\n labels?: Labels\n}\n\nexport interface Chain extends ArenaObject<ChainProps> {\n dateCreated?: string\n dateExecuted?: string\n dateModified?: string\n scriptCommon?: string\n statusExec?: string\n validation: Validation\n temporary?: boolean\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainFactory.js","sourceRoot":"","sources":["../../src/chain/chainFactory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAEhC,8CAAiD;AAEpC,QAAA,YAAY,GAA+B;IACtD,cAAc,CAAC,MAAmB;QAChC,OAAO;YACL,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;YAChB,KAAK,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE;YACnB,UAAU,EAAE,8BAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;SACjD,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"chainFactory.js","sourceRoot":"","sources":["../../src/chain/chainFactory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAEhC,8CAAiD;AAEpC,QAAA,YAAY,GAA+B;IACtD,cAAc,CAAC,MAAmB;QAChC,OAAO;YACL,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;YAChB,KAAK,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE;YACnB,UAAU,EAAE,8BAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;SACjD,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { Factory } from '../common'\nimport { UUIDs } from '../utils'\nimport { Chain, ChainProps } from './chain'\nimport { ValidationFactory } from '../validation'\n\nexport const ChainFactory: Factory<Chain, ChainProps> = {\n createInstance(params?: ChainProps): Chain {\n return {\n uuid: UUIDs.v4(),\n props: params ?? {},\n validation: ValidationFactory.createInstance({}),\n }\n },\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainNodeDef.js","sourceRoot":"","sources":["../../src/chain/chainNodeDef.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"chainNodeDef.js","sourceRoot":"","sources":["../../src/chain/chainNodeDef.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaObject } from '../common'\n\nexport interface ChainNodeDefProps {\n active: boolean\n}\n\nexport interface ChainNodeDef extends ArenaObject<ChainNodeDefProps> {\n chainUuid: string\n index: number\n nodeDefUuid: string\n script?: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainNodeDefAggregate.js","sourceRoot":"","sources":["../../src/chain/chainNodeDefAggregate.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"chainNodeDefAggregate.js","sourceRoot":"","sources":["../../src/chain/chainNodeDefAggregate.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaObject } from '../common'\nimport { Labels } from '../language'\n\nexport interface ChainNodeDefAggregateProps {\n alias: Labels\n}\n\nexport interface ChainNodeDefAggregate extends ArenaObject<ChainNodeDefAggregateProps> {\n chainUuid: string\n nodeDefUuid: string\n formula: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainNodeDefFactory.js","sourceRoot":"","sources":["../../src/chain/chainNodeDefFactory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAQnB,QAAA,mBAAmB,GAAoD;IAClF,cAAc,CAAC,MAAgC;QAC7C,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,MAAM,CAAA;QAEzC,OAAO;YACL,SAAS;YACT,KAAK,EAAE,CAAC;YACR,WAAW;YACX,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YACvB,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"chainNodeDefFactory.js","sourceRoot":"","sources":["../../src/chain/chainNodeDefFactory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAQnB,QAAA,mBAAmB,GAAoD;IAClF,cAAc,CAAC,MAAgC;QAC7C,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,MAAM,CAAA;QAEzC,OAAO;YACL,SAAS;YACT,KAAK,EAAE,CAAC;YACR,WAAW;YACX,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YACvB,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { Factory } from '../common'\nimport { UUIDs } from '../utils'\nimport { ChainNodeDef } from './chainNodeDef'\n\ntype ChainNodeDefCreateParams = {\n chainUuid: string\n nodeDefUuid: string\n}\n\nexport const ChainNodeDefFactory: Factory<ChainNodeDef, ChainNodeDefCreateParams> = {\n createInstance(params: ChainNodeDefCreateParams): ChainNodeDef {\n const { chainUuid, nodeDefUuid } = params\n\n return {\n chainUuid,\n index: 0,\n nodeDefUuid,\n props: { active: true },\n uuid: UUIDs.v4(),\n }\n },\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainNodeDefService.js","sourceRoot":"","sources":["../../src/chain/chainNodeDefService.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"chainNodeDefService.js","sourceRoot":"","sources":["../../src/chain/chainNodeDefService.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ArenaService } from '../common'\nimport { ChainNodeDef } from './chainNodeDef'\n\nexport interface ChainNodeDefService extends ArenaService {\n // ==== READ\n count(options: { chainUuid: string; surveyId: number }): Promise<{ [entityDefUuid: string]: number }>\n\n getMany(options: { chainUuid: string; entityDefUuid: string; surveyId: number }): Promise<Array<ChainNodeDef>>\n\n // ==== UPDATE\n update(options: { chainNodeDef: ChainNodeDef; surveyId: number; user: User }): Promise<ChainNodeDef>\n\n updateIndexes(options: { surveyId: number }): Promise<void>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainService.js","sourceRoot":"","sources":["../../src/chain/chainService.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"chainService.js","sourceRoot":"","sources":["../../src/chain/chainService.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ArenaService } from '../common'\nimport { Chain } from './chain'\n\nexport interface ChainService extends ArenaService {\n // ==== CREATE\n create(options: { chain: Chain; surveyId: number; user: User }): Promise<Chain>\n\n // ==== READ\n count(options: { cycle: string; surveyId: number }): Promise<number>\n\n getMany(options: { cycle: string; limit?: number; offset?: number; surveyId: number }): Promise<Array<Chain>>\n\n get(options: { chainUuid: string; surveyId: number }): Promise<Chain>\n\n // ==== UPDATE\n update(options: { chain: Chain; surveyId: number; user: User }): Promise<Chain>\n\n // ==== DELETE\n delete(options: { chainUuid: string; surveyId: number; user: User }): Promise<Chain>\n}\n"]}
|
package/dist/chain/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chain/index.ts"],"names":[],"mappings":";;;AACA,iCAAyC;AAAhC,wGAAA,eAAe,OAAA;AACxB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AAIrB,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chain/index.ts"],"names":[],"mappings":";;;AACA,iCAAyC;AAAhC,wGAAA,eAAe,OAAA;AACxB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AAIrB,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA","sourcesContent":["export type { Chain, ChainProps } from './chain'\nexport { ChainStatusExec } from './chain'\nexport { ChainFactory } from './chainFactory'\nexport type { ChainService } from './chainService'\n\nexport type { ChainNodeDef, ChainNodeDefProps } from './chainNodeDef'\nexport { ChainNodeDefFactory } from './chainNodeDefFactory'\nexport type { ChainNodeDefService } from './chainNodeDefService'\n\nexport type { ChainNodeDefAggregate, ChainNodeDefAggregateProps } from './chainNodeDefAggregate'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dictionary.js","sourceRoot":"","sources":["../../src/common/Dictionary.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Dictionary.js","sourceRoot":"","sources":["../../src/common/Dictionary.ts"],"names":[],"mappings":"","sourcesContent":["export interface Dictionary<T> {\n [key: string]: T\n}\n"]}
|