@vannizhang/living-atlas-content-validator 1.5.21 → 1.5.23
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/configureSettings.d.ts +0 -103
- package/dist/configureSettings.js +1 -43
- package/dist/configureSettings.js.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/accessInformation/isValidAccessInformation.d.ts +0 -8
- package/dist/lib/accessInformation/isValidAccessInformation.js +0 -12
- package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
- package/dist/lib/accessInformation/scoringConfig.js +0 -4
- package/dist/lib/accessInformation/scoringConfig.js.map +1 -1
- package/dist/lib/checkProfanities/checkProfanities.d.ts +0 -5
- package/dist/lib/checkProfanities/checkProfanities.js +0 -8
- package/dist/lib/checkProfanities/checkProfanities.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js +0 -35
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/config.d.ts +0 -84
- package/dist/lib/checkTitleAndSnippetSearchability/config.js +0 -17
- package/dist/lib/checkTitleAndSnippetSearchability/config.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/data.js +0 -692
- package/dist/lib/checkTitleAndSnippetSearchability/data.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +0 -94
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +0 -105
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +1 -111
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js +1 -113
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.d.ts +0 -28
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js +0 -113
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.d.ts +0 -30
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js +1 -115
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js +0 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -1
- package/dist/lib/config.d.ts +0 -16
- package/dist/lib/config.js +0 -140
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.d.ts +0 -8
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +0 -11
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
- package/dist/lib/deleteProtection/scoringConfig.js +0 -1
- package/dist/lib/deleteProtection/scoringConfig.js.map +1 -1
- package/dist/lib/deprecated/isDeprecated.d.ts +0 -8
- package/dist/lib/deprecated/isDeprecated.js +0 -9
- package/dist/lib/deprecated/isDeprecated.js.map +1 -1
- package/dist/lib/deprecated/scoringConfig.js +0 -1
- package/dist/lib/deprecated/scoringConfig.js.map +1 -1
- package/dist/lib/description/findDataSource.d.ts +0 -10
- package/dist/lib/description/findDataSource.js +0 -22
- package/dist/lib/description/findDataSource.js.map +1 -1
- package/dist/lib/description/isValidDescription.d.ts +0 -17
- package/dist/lib/description/isValidDescription.js +0 -52
- package/dist/lib/description/isValidDescription.js.map +1 -1
- package/dist/lib/description/scoringConfig.js +0 -1
- package/dist/lib/description/scoringConfig.js.map +1 -1
- package/dist/lib/description/scoringRulesConfig.js +0 -47
- package/dist/lib/description/scoringRulesConfig.js.map +1 -1
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.d.ts +0 -8
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.js +0 -12
- package/dist/lib/featureServiceCDNSetting/checkFeatureServiceCDNSetting.js.map +1 -1
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.d.ts +0 -6
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.js +0 -12
- package/dist/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.js.map +1 -1
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.d.ts +0 -8
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.js +0 -16
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtents.js.map +1 -1
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.d.ts +0 -5
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.js +0 -9
- package/dist/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +0 -23
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +0 -43
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/helpers.d.ts +0 -16
- package/dist/lib/featureServiceFieldAliases/helpers.js +5 -21
- package/dist/lib/featureServiceFieldAliases/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +0 -22
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +0 -58
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/helpers.d.ts +0 -17
- package/dist/lib/featureServiceFieldDescriptions/helpers.js +5 -22
- package/dist/lib/featureServiceFieldDescriptions/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.d.ts +0 -8
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.js +0 -8
- package/dist/lib/featureServiceFieldIndexes/checkFeatureServiceFieldIndexes.js.map +1 -1
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.d.ts +0 -5
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.js +0 -6
- package/dist/lib/featureServiceFieldIndexes/featureServiceFieldIndexesHelpers.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +0 -19
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +0 -40
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/helpers.d.ts +0 -13
- package/dist/lib/featureServiceFieldValueTypes/helpers.js +2 -15
- package/dist/lib/featureServiceFieldValueTypes/helpers.js.map +1 -1
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +0 -1
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js.map +1 -1
- package/dist/lib/itemExtent/checkItemExtent.d.ts +0 -25
- package/dist/lib/itemExtent/checkItemExtent.js +0 -30
- package/dist/lib/itemExtent/checkItemExtent.js.map +1 -1
- package/dist/lib/itemExtent/checkItemExtentHelpers.d.ts +0 -31
- package/dist/lib/itemExtent/checkItemExtentHelpers.js +0 -36
- package/dist/lib/itemExtent/checkItemExtentHelpers.js.map +1 -1
- package/dist/lib/licenseInfo/isValidLicenseInfo.d.ts +0 -32
- package/dist/lib/licenseInfo/isValidLicenseInfo.js +2 -49
- package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
- package/dist/lib/licenseInfo/scoringConfig.js +0 -1
- package/dist/lib/licenseInfo/scoringConfig.js.map +1 -1
- package/dist/lib/licenseInfo/scoringRulesConfig.js +0 -47
- package/dist/lib/licenseInfo/scoringRulesConfig.js.map +1 -1
- package/dist/lib/sharing/isValidAccess.d.ts +0 -20
- package/dist/lib/sharing/isValidAccess.js +2 -28
- package/dist/lib/sharing/isValidAccess.js.map +1 -1
- package/dist/lib/sharing/scoringConfig.js +0 -1
- package/dist/lib/sharing/scoringConfig.js.map +1 -1
- package/dist/lib/sharing/scoringRulesConfig.js +0 -47
- package/dist/lib/sharing/scoringRulesConfig.js.map +1 -1
- package/dist/lib/ssl/isValidSSL.d.ts +0 -12
- package/dist/lib/ssl/isValidSSL.js +6 -31
- package/dist/lib/ssl/isValidSSL.js.map +1 -1
- package/dist/lib/ssl/scoringConfig.js +0 -4
- package/dist/lib/ssl/scoringConfig.js.map +1 -1
- package/dist/lib/ssl/scoringRulesConfig.js +0 -41
- package/dist/lib/ssl/scoringRulesConfig.js.map +1 -1
- package/dist/lib/summary/isValidSummary.d.ts +0 -15
- package/dist/lib/summary/isValidSummary.js +1 -47
- package/dist/lib/summary/isValidSummary.js.map +1 -1
- package/dist/lib/summary/scoringConfig.js +0 -1
- package/dist/lib/summary/scoringConfig.js.map +1 -1
- package/dist/lib/summary/scoringRulesConfig.js +0 -53
- package/dist/lib/summary/scoringRulesConfig.js.map +1 -1
- package/dist/lib/tags/isValidTags.d.ts +0 -12
- package/dist/lib/tags/isValidTags.js +1 -20
- package/dist/lib/tags/isValidTags.js.map +1 -1
- package/dist/lib/tags/scoringConfig.js +0 -5
- package/dist/lib/tags/scoringConfig.js.map +1 -1
- package/dist/lib/tags/scoringRulesConfig.js +0 -41
- package/dist/lib/tags/scoringRulesConfig.js.map +1 -1
- package/dist/lib/thumbnail/isValidThumbnail.d.ts +0 -8
- package/dist/lib/thumbnail/isValidThumbnail.js +1 -30
- package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
- package/dist/lib/thumbnail/scoringConfig.js +0 -9
- package/dist/lib/thumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/thumbnail/scoringRulesConfig.js +0 -41
- package/dist/lib/thumbnail/scoringRulesConfig.js.map +1 -1
- package/dist/lib/title/isValidTitle.d.ts +0 -21
- package/dist/lib/title/isValidTitle.js +1 -55
- package/dist/lib/title/isValidTitle.js.map +1 -1
- package/dist/lib/title/scoringConfig.js +0 -1
- package/dist/lib/title/scoringConfig.js.map +1 -1
- package/dist/lib/title/scoringRulesConfig.js +0 -52
- package/dist/lib/title/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.d.ts +0 -21
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +2 -76
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.js +0 -1
- package/dist/lib/userProfileDescription/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringRulesConfig.js +0 -59
- package/dist/lib/userProfileDescription/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileName/isValidUserProfileName.d.ts +0 -8
- package/dist/lib/userProfileName/isValidUserProfileName.js +2 -26
- package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
- package/dist/lib/userProfileName/scoringConfig.js +0 -5
- package/dist/lib/userProfileName/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileName/scoringRulesConfig.js +0 -41
- package/dist/lib/userProfileName/scoringRulesConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.d.ts +0 -12
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +3 -27
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringConfig.js +0 -4
- package/dist/lib/userProfileThumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js +0 -35
- package/dist/lib/userProfileThumbnail/scoringRulesConfig.js.map +1 -1
- package/dist/lib/util/assertString.d.ts +0 -10
- package/dist/lib/util/assertString.js +0 -11
- package/dist/lib/util/assertString.js.map +1 -1
- package/dist/lib/util/checkIsLayer.d.ts +0 -5
- package/dist/lib/util/checkIsLayer.js +0 -5
- package/dist/lib/util/checkIsLayer.js.map +1 -1
- package/dist/lib/util/contains.d.ts +0 -6
- package/dist/lib/util/contains.js +0 -7
- package/dist/lib/util/contains.js.map +1 -1
- package/dist/lib/util/containsNonEnglishCharacters.d.ts +0 -12
- package/dist/lib/util/containsNonEnglishCharacters.js +2 -16
- package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -1
- package/dist/lib/util/countSentences.d.ts +0 -22
- package/dist/lib/util/countSentences.js +4 -36
- package/dist/lib/util/countSentences.js.map +1 -1
- package/dist/lib/util/createWordBoundaryRegex.d.ts +0 -40
- package/dist/lib/util/createWordBoundaryRegex.js +0 -47
- package/dist/lib/util/createWordBoundaryRegex.js.map +1 -1
- package/dist/lib/util/escapeSpecialCharacters.d.ts +0 -6
- package/dist/lib/util/escapeSpecialCharacters.js +0 -8
- package/dist/lib/util/escapeSpecialCharacters.js.map +1 -1
- package/dist/lib/util/getAllValidationRuleIds.d.ts +0 -4
- package/dist/lib/util/getAllValidationRuleIds.js +0 -4
- package/dist/lib/util/getAllValidationRuleIds.js.map +1 -1
- package/dist/lib/util/getFeatureLayerFieldValueTypes.d.ts +0 -8
- package/dist/lib/util/getFeatureLayerFieldValueTypes.js +0 -8
- package/dist/lib/util/getFeatureLayerFieldValueTypes.js.map +1 -1
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.d.ts +0 -17
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js +0 -17
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -1
- package/dist/lib/util/getNumberOfWords.d.ts +0 -5
- package/dist/lib/util/getNumberOfWords.js +1 -15
- package/dist/lib/util/getNumberOfWords.js.map +1 -1
- package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +0 -11
- package/dist/lib/util/getRelevantFeatureLayerFields.js +0 -11
- package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -1
- package/dist/lib/util/getScoringRules.d.ts +0 -17
- package/dist/lib/util/getScoringRules.js +0 -105
- package/dist/lib/util/getScoringRules.js.map +1 -1
- package/dist/lib/util/getThumbnailFileName.d.ts +0 -14
- package/dist/lib/util/getThumbnailFileName.js +0 -14
- package/dist/lib/util/getThumbnailFileName.js.map +1 -1
- package/dist/lib/util/isArcGISDomain.d.ts +0 -5
- package/dist/lib/util/isArcGISDomain.js +0 -5
- package/dist/lib/util/isArcGISDomain.js.map +1 -1
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.d.ts +0 -5
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js +0 -5
- package/dist/lib/util/isArcGISOnlineReservedThumbnailName.js.map +1 -1
- package/dist/lib/util/isDefined.d.ts +0 -7
- package/dist/lib/util/isDefined.js +0 -7
- package/dist/lib/util/isDefined.js.map +1 -1
- package/dist/lib/util/isEmail.d.ts +0 -5
- package/dist/lib/util/isEmail.js +0 -5
- package/dist/lib/util/isEmail.js.map +1 -1
- package/dist/lib/util/isEmpty.d.ts +0 -5
- package/dist/lib/util/isEmpty.js +0 -5
- package/dist/lib/util/isEmpty.js.map +1 -1
- package/dist/lib/util/isFeatureCollection.d.ts +0 -5
- package/dist/lib/util/isFeatureCollection.js +0 -5
- package/dist/lib/util/isFeatureCollection.js.map +1 -1
- package/dist/lib/util/isFeatureService.d.ts +0 -11
- package/dist/lib/util/isFeatureService.js +0 -13
- package/dist/lib/util/isFeatureService.js.map +1 -1
- package/dist/lib/util/isHosted.d.ts +0 -5
- package/dist/lib/util/isHosted.js +0 -5
- package/dist/lib/util/isHosted.js.map +1 -1
- package/dist/lib/util/isLatin.d.ts +0 -5
- package/dist/lib/util/isLatin.js +0 -5
- package/dist/lib/util/isLatin.js.map +1 -1
- package/dist/lib/util/isLayer.d.ts +0 -10
- package/dist/lib/util/isLayer.js +1 -13
- package/dist/lib/util/isLayer.js.map +1 -1
- package/dist/lib/util/isSecureProtocol.d.ts +0 -5
- package/dist/lib/util/isSecureProtocol.js +0 -5
- package/dist/lib/util/isSecureProtocol.js.map +1 -1
- package/dist/lib/util/isUppercase.d.ts +0 -3
- package/dist/lib/util/isUppercase.js +0 -3
- package/dist/lib/util/isUppercase.js.map +1 -1
- package/dist/lib/util/isUrl.d.ts +0 -8
- package/dist/lib/util/isUrl.js +1 -11
- package/dist/lib/util/isUrl.js.map +1 -1
- package/dist/lib/util/isValidRegexPattern.d.ts +0 -6
- package/dist/lib/util/isValidRegexPattern.js +0 -6
- package/dist/lib/util/isValidRegexPattern.js.map +1 -1
- package/dist/lib/util/matches.d.ts +0 -11
- package/dist/lib/util/matches.js +0 -11
- package/dist/lib/util/matches.js.map +1 -1
- package/dist/lib/util/round.js +0 -4
- package/dist/lib/util/round.js.map +1 -1
- package/dist/lib/util/sanitizeTags.d.ts +0 -5
- package/dist/lib/util/sanitizeTags.js +0 -5
- package/dist/lib/util/sanitizeTags.js.map +1 -1
- package/dist/lib/util/shouldValidateByBetaRules.d.ts +0 -7
- package/dist/lib/util/shouldValidateByBetaRules.js +0 -31
- package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
- package/dist/lib/util/stringsConfig.d.ts +0 -21
- package/dist/lib/util/stringsConfig.js +0 -38
- package/dist/lib/util/stringsConfig.js.map +1 -1
- package/dist/lib/util/toString.d.ts +0 -10
- package/dist/lib/util/toString.js +0 -10
- package/dist/lib/util/toString.js.map +1 -1
- package/dist/lib/validate/validate.d.ts +0 -64
- package/dist/lib/validate/validate.js +1 -52
- package/dist/lib/validate/validate.js.map +1 -1
- package/dist/lib/validate/validateHelpers.d.ts +0 -57
- package/dist/lib/validate/validateHelpers.js +1 -72
- package/dist/lib/validate/validateHelpers.js.map +1 -1
- package/dist/package-info.json +1 -1
- package/dist/services/content-validator-assets/config.d.ts +0 -3
- package/dist/services/content-validator-assets/config.js +0 -3
- package/dist/services/content-validator-assets/config.js.map +1 -1
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.d.ts +0 -93
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +0 -33
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -1
- package/dist/services/content-validator-assets/fetchProfanitiesData.d.ts +0 -24
- package/dist/services/content-validator-assets/fetchProfanitiesData.js +0 -19
- package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -1
- package/dist/services/content-validator-assets/helpers.d.ts +0 -14
- package/dist/services/content-validator-assets/helpers.js +1 -15
- package/dist/services/content-validator-assets/helpers.js.map +1 -1
- package/dist/services/custom-terms/config.d.ts +0 -11
- package/dist/services/custom-terms/config.js +0 -41
- package/dist/services/custom-terms/config.js.map +1 -1
- package/dist/services/custom-terms/customTerms.d.ts +0 -170
- package/dist/services/custom-terms/customTerms.js +4 -169
- package/dist/services/custom-terms/customTerms.js.map +1 -1
- package/dist/services/custom-terms/helpers.d.ts +0 -6
- package/dist/services/custom-terms/helpers.js +0 -6
- package/dist/services/custom-terms/helpers.js.map +1 -1
- package/dist/services/custom-terms-review-results/config.d.ts +0 -16
- package/dist/services/custom-terms-review-results/config.js +0 -42
- package/dist/services/custom-terms-review-results/config.js.map +1 -1
- package/dist/services/custom-terms-review-results/customTermsReviewResults.d.ts +0 -93
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js +0 -87
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -1
- package/dist/services/custom-terms-review-results/helpers.d.ts +0 -15
- package/dist/services/custom-terms-review-results/helpers.js +0 -16
- package/dist/services/custom-terms-review-results/helpers.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.d.ts +0 -12
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.js +3 -13
- package/dist/services/feature-service/fetchFeatureServiceAdminJSON.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +0 -12
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +5 -32
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.d.ts +0 -14
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.js +5 -30
- package/dist/services/feature-service/fetchFeatureServiceRootJSON.js.map +1 -1
- package/dist/services/feature-service/getFeatureServerURL.d.ts +0 -11
- package/dist/services/feature-service/getFeatureServerURL.js +2 -14
- package/dist/services/feature-service/getFeatureServerURL.js.map +1 -1
- package/dist/services/shared/addFeatures.d.ts +0 -11
- package/dist/services/shared/addFeatures.js +0 -11
- package/dist/services/shared/addFeatures.js.map +1 -1
- package/dist/services/shared/applyEdits.d.ts +0 -11
- package/dist/services/shared/applyEdits.js +0 -11
- package/dist/services/shared/applyEdits.js.map +1 -1
- package/dist/services/shared/config.d.ts +0 -38
- package/dist/services/shared/config.js +0 -22
- package/dist/services/shared/config.js.map +1 -1
- package/dist/services/shared/getItemInfo.d.ts +0 -12
- package/dist/services/shared/getItemInfo.js +1 -16
- package/dist/services/shared/getItemInfo.js.map +1 -1
- package/dist/types/index.d.ts +1 -330
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.checkFeatureServiceExportSetting = void 0;
|
|
4
4
|
const isFeatureService_1 = require("../util/isFeatureService");
|
|
5
5
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param item ArcGIS Online item to validate
|
|
9
|
-
* @param featureServiceAdminJSON Feature Service admin JSON
|
|
10
|
-
* @returns ValidationInfo object containing the validation result
|
|
11
|
-
*/
|
|
12
6
|
const checkFeatureServiceExportSetting = (item, featureServiceAdminJSON) => {
|
|
13
7
|
const strings = (0, stringsConfig_1.getStringsConfig)();
|
|
14
8
|
const { LABEL, TITLE, EXPORT_DATA_ENABLED_MESSAGE } = strings.featureServiceExportDataSetting;
|
|
@@ -28,19 +22,13 @@ const checkFeatureServiceExportSetting = (item, featureServiceAdminJSON) => {
|
|
|
28
22
|
if ((0, isFeatureService_1.isFeatureService)(item) === false) {
|
|
29
23
|
return Object.assign(Object.assign({}, validationOutput), { status: 'not-applicable' });
|
|
30
24
|
}
|
|
31
|
-
// Return early if no admin JSON is provided with the status 'unknown',
|
|
32
|
-
// this happens when validate an item that is not owned by the user
|
|
33
25
|
if (!featureServiceAdminJSON) {
|
|
34
26
|
return validationOutput;
|
|
35
27
|
}
|
|
36
28
|
const capabilities = featureServiceAdminJSON === null || featureServiceAdminJSON === void 0 ? void 0 : featureServiceAdminJSON.capabilities;
|
|
37
|
-
// Return unknown status if capabilities is not defined
|
|
38
29
|
if (!capabilities) {
|
|
39
30
|
return Object.assign(Object.assign({}, validationOutput), { status: 'unknown' });
|
|
40
31
|
}
|
|
41
|
-
// if the feature service has Extract capability, then export is enabled,
|
|
42
|
-
// should return warning status to indicate export is enabled
|
|
43
|
-
// so that user can confirm this setting is intentional.
|
|
44
32
|
if (capabilities === null || capabilities === void 0 ? void 0 : capabilities.toLowerCase().includes('extract')) {
|
|
45
33
|
validationOutput.messages.push({
|
|
46
34
|
message: EXPORT_DATA_ENABLED_MESSAGE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceExportSetting.js","sourceRoot":"","sources":["../../../src/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.ts"],"names":[],"mappings":";;;AACA,+DAA4D;AAC5D,yDAAyD;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceExportSetting.js","sourceRoot":"","sources":["../../../src/lib/featureServiceExportDataSetting/checkFeatureServiceExportSetting.ts"],"names":[],"mappings":";;;AACA,+DAA4D;AAC5D,yDAAyD;AAQlD,MAAM,gCAAgC,GAAG,CAC5C,IAAW,EACX,uBAAgD,EAClC,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,EAAE,GAC/C,OAAO,CAAC,+BAA+B,CAAC;IAE5C,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,qCAAqC;QACvD,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;KACnB,CAAC;IAEF,IAAI,IAAA,mCAAgB,EAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QACnC,uCACO,gBAAgB,KACnB,MAAM,EAAE,gBAAgB,IAC1B;IACN,CAAC;IAID,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC3B,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,MAAM,YAAY,GAAG,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,YAAY,CAAC;IAG3D,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,uCACO,gBAAgB,KACnB,MAAM,EAAE,SAAS,IACnB;IACN,CAAC;IAKD,IAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAClD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,2BAA2B;SACvC,CAAC,CAAC;QACH,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC;QAEpC,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,uCACO,gBAAgB,KACnB,MAAM,EAAE,MAAM,IAChB;AACN,CAAC,CAAC;AA9DW,QAAA,gCAAgC,oCA8D3C"}
|
|
@@ -4,13 +4,5 @@ type CheckFeatureServiceExtentsOptions = {
|
|
|
4
4
|
featureServiceAdminJSON?: FeatureServiceAdminJSON;
|
|
5
5
|
featureServiceRootJSON?: FeatureServiceJSON;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* Check the Full Extent, Initial Extent and Layers Extents of a Feature Service
|
|
9
|
-
* @param item ArcGIS Online item to validate
|
|
10
|
-
* @param options.layers Array of FeatureLayerJSON representing the layers in the Feature Service
|
|
11
|
-
* @param options.featureServiceAdminJSON Feature Service admin JSON, if not provided, Full Extent and Initial Extent will be checked from Feature Service root JSON
|
|
12
|
-
* @param options.featureServiceRootJSON Feature Service root JSON, used to check Full Extent and Initial Extent if admin JSON is not provided
|
|
13
|
-
* @returns ValidationInfo object containing the validation result
|
|
14
|
-
*/
|
|
15
7
|
export declare const checkFeatureServiceExtents: (item: IItem, { layers, featureServiceAdminJSON, featureServiceRootJSON, }: CheckFeatureServiceExtentsOptions) => ValidationInfo;
|
|
16
8
|
export {};
|
|
@@ -4,14 +4,6 @@ exports.checkFeatureServiceExtents = void 0;
|
|
|
4
4
|
const isFeatureService_1 = require("../util/isFeatureService");
|
|
5
5
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
6
6
|
const checkFeatureServiceExtentsHelpers_1 = require("./checkFeatureServiceExtentsHelpers");
|
|
7
|
-
/**
|
|
8
|
-
* Check the Full Extent, Initial Extent and Layers Extents of a Feature Service
|
|
9
|
-
* @param item ArcGIS Online item to validate
|
|
10
|
-
* @param options.layers Array of FeatureLayerJSON representing the layers in the Feature Service
|
|
11
|
-
* @param options.featureServiceAdminJSON Feature Service admin JSON, if not provided, Full Extent and Initial Extent will be checked from Feature Service root JSON
|
|
12
|
-
* @param options.featureServiceRootJSON Feature Service root JSON, used to check Full Extent and Initial Extent if admin JSON is not provided
|
|
13
|
-
* @returns ValidationInfo object containing the validation result
|
|
14
|
-
*/
|
|
15
7
|
const checkFeatureServiceExtents = (item, { layers, featureServiceAdminJSON, featureServiceRootJSON, }) => {
|
|
16
8
|
const strings = (0, stringsConfig_1.getStringsConfig)();
|
|
17
9
|
const { LABEL, TITLE, FULL_EXTENT_ISSUE_MESSAGE, INITIAL_EXTENT_ISSUE_MESSAGE, LAYER_EXTENT_ISSUE_MESSAGE, } = strings.featureServiceExtents;
|
|
@@ -28,16 +20,12 @@ const checkFeatureServiceExtents = (item, { layers, featureServiceAdminJSON, fea
|
|
|
28
20
|
isBinaryCheck: true,
|
|
29
21
|
isAdvisory: true,
|
|
30
22
|
};
|
|
31
|
-
// If item is not a Feature Service or is a Feature Table, return not-applicable
|
|
32
23
|
if ((0, isFeatureService_1.isFeatureService)(item) === false || (0, isFeatureService_1.isFeatureTable)(item) === true) {
|
|
33
24
|
return Object.assign(Object.assign({}, validationOutput), { status: 'not-applicable' });
|
|
34
25
|
}
|
|
35
|
-
// If both admin and root JSON are not provided, return unknown
|
|
36
|
-
// as the initial extent and full extent cannot be validated
|
|
37
26
|
if (!featureServiceAdminJSON && !featureServiceRootJSON) {
|
|
38
27
|
return Object.assign(Object.assign({}, validationOutput), { status: 'unknown' });
|
|
39
28
|
}
|
|
40
|
-
// Check Full Extent of the Feature Service
|
|
41
29
|
const fullExtent = (featureServiceAdminJSON === null || featureServiceAdminJSON === void 0 ? void 0 : featureServiceAdminJSON.fullExtent) ||
|
|
42
30
|
(featureServiceRootJSON === null || featureServiceRootJSON === void 0 ? void 0 : featureServiceRootJSON.fullExtent) ||
|
|
43
31
|
null;
|
|
@@ -47,7 +35,6 @@ const checkFeatureServiceExtents = (item, { layers, featureServiceAdminJSON, fea
|
|
|
47
35
|
message: FULL_EXTENT_ISSUE_MESSAGE,
|
|
48
36
|
});
|
|
49
37
|
}
|
|
50
|
-
// Check initial Extent of the Feature Service
|
|
51
38
|
const initialExtent = (featureServiceAdminJSON === null || featureServiceAdminJSON === void 0 ? void 0 : featureServiceAdminJSON.initialExtent) ||
|
|
52
39
|
(featureServiceRootJSON === null || featureServiceRootJSON === void 0 ? void 0 : featureServiceRootJSON.initialExtent) ||
|
|
53
40
|
null;
|
|
@@ -58,7 +45,6 @@ const checkFeatureServiceExtents = (item, { layers, featureServiceAdminJSON, fea
|
|
|
58
45
|
});
|
|
59
46
|
}
|
|
60
47
|
let hasValidLayerExtents = true;
|
|
61
|
-
// Check Extent of each layer
|
|
62
48
|
for (const layer of layers) {
|
|
63
49
|
const layerExtent = layer.extent || null;
|
|
64
50
|
const isLayerExtentValid = (0, checkFeatureServiceExtentsHelpers_1.isValidFeatureServiceExtent)(layerExtent);
|
|
@@ -70,13 +56,11 @@ const checkFeatureServiceExtents = (item, { layers, featureServiceAdminJSON, fea
|
|
|
70
56
|
});
|
|
71
57
|
}
|
|
72
58
|
}
|
|
73
|
-
// return warning if any of the extents are invalid
|
|
74
59
|
if (!hasValidFullExtent ||
|
|
75
60
|
!hasValidInitialExtent ||
|
|
76
61
|
!hasValidLayerExtents) {
|
|
77
62
|
return Object.assign(Object.assign({}, validationOutput), { status: 'warning' });
|
|
78
63
|
}
|
|
79
|
-
// all extents are valid
|
|
80
64
|
return Object.assign(Object.assign({}, validationOutput), { status: 'pass' });
|
|
81
65
|
};
|
|
82
66
|
exports.checkFeatureServiceExtents = checkFeatureServiceExtents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceExtents.js","sourceRoot":"","sources":["../../../src/lib/featureServiceExtents/checkFeatureServiceExtents.ts"],"names":[],"mappings":";;;AAOA,+DAA4E;AAC5E,yDAAyD;AACzD,2FAAkF;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceExtents.js","sourceRoot":"","sources":["../../../src/lib/featureServiceExtents/checkFeatureServiceExtents.ts"],"names":[],"mappings":";;;AAOA,+DAA4E;AAC5E,yDAAyD;AACzD,2FAAkF;AAgB3E,MAAM,0BAA0B,GAAG,CACtC,IAAW,EACX,EACI,MAAM,EACN,uBAAuB,EACvB,sBAAsB,GACU,EACtB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,EACF,KAAK,EACL,KAAK,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,GAC7B,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAElC,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,yBAAyB;QAC3C,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,IAAI;KACnB,CAAC;IAGF,IAAI,IAAA,mCAAgB,EAAC,IAAI,CAAC,KAAK,KAAK,IAAI,IAAA,iCAAc,EAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACpE,uCACO,gBAAgB,KACnB,MAAM,EAAE,gBAAgB,IAC1B;IACN,CAAC;IAID,IAAI,CAAC,uBAAuB,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,uCACO,gBAAgB,KACnB,MAAM,EAAE,SAAS,IACnB;IACN,CAAC;IAGD,MAAM,UAAU,GACZ,CAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,UAAU;SACnC,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,UAAU,CAAA;QAClC,IAAI,CAAC;IACT,MAAM,kBAAkB,GAAG,IAAA,+DAA2B,EAAC,UAAU,CAAC,CAAC;IAEnE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACtB,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,yBAAyB;SACrC,CAAC,CAAC;IACP,CAAC;IAGD,MAAM,aAAa,GACf,CAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,aAAa;SACtC,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,aAAa,CAAA;QACrC,IAAI,CAAC;IACT,MAAM,qBAAqB,GAAG,IAAA,+DAA2B,EAAC,aAAa,CAAC,CAAC;IAEzE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACzB,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,4BAA4B;SACxC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,oBAAoB,GAAG,IAAI,CAAC;IAGhC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;QACzC,MAAM,kBAAkB,GAAG,IAAA,+DAA2B,EAAC,WAAW,CAAC,CAAC;QACpE,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACtB,oBAAoB,GAAG,KAAK,CAAC;YAE7B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;YAEpD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC3B,OAAO,EAAE,0BAA0B,CAAC,OAAO,CACvC,eAAe,EACf,SAAS,CACZ;aACJ,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAGD,IACI,CAAC,kBAAkB;QACnB,CAAC,qBAAqB;QACtB,CAAC,oBAAoB,EACvB,CAAC;QACC,uCACO,gBAAgB,KACnB,MAAM,EAAE,SAAS,IACnB;IACN,CAAC;IAGD,uCACO,gBAAgB,KACnB,MAAM,EAAE,MAAM,IAChB;AACN,CAAC,CAAC;AAhHW,QAAA,0BAA0B,8BAgHrC"}
|
|
@@ -8,10 +8,5 @@ type ExtentObject = {
|
|
|
8
8
|
latestWkid?: number;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
* This function checks if a given extent object is a valid extent for a Feature Service.
|
|
13
|
-
* @param extent
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
11
|
export declare const isValidFeatureServiceExtent: (extent: ExtentObject) => boolean;
|
|
17
12
|
export {};
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidFeatureServiceExtent = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* This function checks if a given extent object is a valid extent for a Feature Service.
|
|
6
|
-
* @param extent
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
4
|
const isValidFeatureServiceExtent = (extent) => {
|
|
10
|
-
// Check if extent is defined
|
|
11
5
|
if (!extent) {
|
|
12
6
|
return false;
|
|
13
7
|
}
|
|
14
|
-
// Check if extent is an object
|
|
15
8
|
if (typeof extent !== 'object') {
|
|
16
9
|
return false;
|
|
17
10
|
}
|
|
18
|
-
// Check if xmin, ymin, xmax, ymax are numbers and xmin < xmax and ymin < ymax
|
|
19
11
|
const { xmin, ymin, xmax, ymax } = extent || {};
|
|
20
|
-
// Validate the extent values
|
|
21
12
|
if (typeof xmin !== 'number' ||
|
|
22
13
|
typeof ymin !== 'number' ||
|
|
23
14
|
typeof xmax !== 'number' ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceExtentsHelpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceExtentsHelpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceExtents/checkFeatureServiceExtentsHelpers.ts"],"names":[],"mappings":";;;AAgBO,MAAM,2BAA2B,GAAG,CAAC,MAAoB,EAAW,EAAE;IAEzE,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACjB,CAAC;IAGD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACjB,CAAC;IAGD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;IAGhD,IACI,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,IAAI,KAAK,QAAQ,EAC1B,CAAC;QACC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AA7BW,QAAA,2BAA2B,+BA6BtC"}
|
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* requires 90% of field aliases to be present to receive a full score
|
|
4
|
-
*/
|
|
5
2
|
export declare const FIELD_ALIASES_REQUIRED_PERCENT = 0.9;
|
|
6
|
-
/**
|
|
7
|
-
* Validates that feature layer fields have appropriate aliases.
|
|
8
|
-
*
|
|
9
|
-
* This function checks if the given item is a feature service and evaluates the presence of field aliases
|
|
10
|
-
* for relevant fields within the provided feature layers.
|
|
11
|
-
*
|
|
12
|
-
* It returns a `ValidationInfo` object containing the validation result, messages, and scoring information.
|
|
13
|
-
*
|
|
14
|
-
* The scoring logic is as follows:
|
|
15
|
-
* - If the item is not a feature layer, the rule does not contribute to the final score.
|
|
16
|
-
* - If there are no feature layers, a message is added and the result is returned.
|
|
17
|
-
* - If there are no relevant fields to check, the rule receives full score.
|
|
18
|
-
* - If none of the relevant fields have aliases, a message is added to prompt adding aliases.
|
|
19
|
-
* - If less than 80% of relevant fields have aliases, a message is added to prompt improvement and half score is given.
|
|
20
|
-
* - If at least 80% of relevant fields have aliases, the rule receives full score.
|
|
21
|
-
*
|
|
22
|
-
* @param item - The item to validate, typically representing a feature layer item.
|
|
23
|
-
* @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field aliases.
|
|
24
|
-
* @returns A `ValidationInfo` object containing the validation result, messages, and scoring.
|
|
25
|
-
*/
|
|
26
3
|
export declare const checkFeatureServiceFieldAliases: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
|
|
@@ -6,30 +6,7 @@ const isFeatureService_1 = require("../util/isFeatureService");
|
|
|
6
6
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
7
7
|
const helpers_1 = require("./helpers");
|
|
8
8
|
const scoringConfig_1 = require("./scoringConfig");
|
|
9
|
-
/**
|
|
10
|
-
* requires 90% of field aliases to be present to receive a full score
|
|
11
|
-
*/
|
|
12
9
|
exports.FIELD_ALIASES_REQUIRED_PERCENT = 0.9;
|
|
13
|
-
/**
|
|
14
|
-
* Validates that feature layer fields have appropriate aliases.
|
|
15
|
-
*
|
|
16
|
-
* This function checks if the given item is a feature service and evaluates the presence of field aliases
|
|
17
|
-
* for relevant fields within the provided feature layers.
|
|
18
|
-
*
|
|
19
|
-
* It returns a `ValidationInfo` object containing the validation result, messages, and scoring information.
|
|
20
|
-
*
|
|
21
|
-
* The scoring logic is as follows:
|
|
22
|
-
* - If the item is not a feature layer, the rule does not contribute to the final score.
|
|
23
|
-
* - If there are no feature layers, a message is added and the result is returned.
|
|
24
|
-
* - If there are no relevant fields to check, the rule receives full score.
|
|
25
|
-
* - If none of the relevant fields have aliases, a message is added to prompt adding aliases.
|
|
26
|
-
* - If less than 80% of relevant fields have aliases, a message is added to prompt improvement and half score is given.
|
|
27
|
-
* - If at least 80% of relevant fields have aliases, the rule receives full score.
|
|
28
|
-
*
|
|
29
|
-
* @param item - The item to validate, typically representing a feature layer item.
|
|
30
|
-
* @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field aliases.
|
|
31
|
-
* @returns A `ValidationInfo` object containing the validation result, messages, and scoring.
|
|
32
|
-
*/
|
|
33
10
|
const checkFeatureServiceFieldAliases = (item, featureLayers) => {
|
|
34
11
|
const strings = (0, stringsConfig_1.getStringsConfig)();
|
|
35
12
|
const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
|
|
@@ -46,8 +23,6 @@ const checkFeatureServiceFieldAliases = (item, featureLayers) => {
|
|
|
46
23
|
isBinaryCheck: false,
|
|
47
24
|
isAdvisory: false,
|
|
48
25
|
};
|
|
49
|
-
// Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
|
|
50
|
-
// if the item is not a feature layer.
|
|
51
26
|
if (!(0, isFeatureService_1.isFeatureService)(item)) {
|
|
52
27
|
return Object.assign(Object.assign({}, validationResult), { weight: 0 });
|
|
53
28
|
}
|
|
@@ -64,23 +39,7 @@ const checkFeatureServiceFieldAliases = (item, featureLayers) => {
|
|
|
64
39
|
});
|
|
65
40
|
return validationResult;
|
|
66
41
|
}
|
|
67
|
-
// // get the count of fields with aliases
|
|
68
|
-
// const countOfFieldsWithAlias = relevantFields.filter((field) => {
|
|
69
|
-
// const alias = field.alias ? field.alias.trim().toLowerCase() : '';
|
|
70
|
-
// return alias && alias !== field.name.toLowerCase();
|
|
71
|
-
// }).length;
|
|
72
|
-
// const percentWithAlias = countOfFieldsWithAlias / relevantFields.length;
|
|
73
42
|
const percentWithAlias = (0, helpers_1.getPercentOfValidFieldAliases)(relevantFields);
|
|
74
|
-
// // if percentWithAlias is 0, then there are no fields with aliases
|
|
75
|
-
// // it should receive a score of 0 and a message to add field aliases
|
|
76
|
-
// if (percentWithAlias === 0) {
|
|
77
|
-
// validationResult.messages.push({
|
|
78
|
-
// message: strings.featureLayerFieldAliases.ADD_FIELD_ALIAS,
|
|
79
|
-
// });
|
|
80
|
-
// return validationResult;
|
|
81
|
-
// }
|
|
82
|
-
// if percentWithAlias is less than 0.9, then there are some fields with aliases
|
|
83
|
-
// it should receive half of score and a message to improve field aliases
|
|
84
43
|
if (percentWithAlias < exports.FIELD_ALIASES_REQUIRED_PERCENT) {
|
|
85
44
|
validationResult.messages.push({
|
|
86
45
|
message: strings.featureLayerFieldAliases.IMPROVE_FIELD_ALIAS,
|
|
@@ -88,8 +47,6 @@ const checkFeatureServiceFieldAliases = (item, featureLayers) => {
|
|
|
88
47
|
validationResult.scoringFactor = 0;
|
|
89
48
|
return validationResult;
|
|
90
49
|
}
|
|
91
|
-
// if percentWithAlias is greater than 0.8, then there are most fields with aliases
|
|
92
|
-
// it should receive full score
|
|
93
50
|
validationResult.scoringFactor = 1;
|
|
94
51
|
return validationResult;
|
|
95
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceFieldAliases.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,uCAA0D;AAC1D,mDAAgD;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceFieldAliases.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,uCAA0D;AAC1D,mDAAgD;AAKnC,QAAA,8BAA8B,GAAG,GAAG,CAAC;AAsB3C,MAAM,+BAA+B,GAAG,CAC3C,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,+BAA+B;QACjD,KAAK,EAAE,OAAO,CAAC,wBAAwB,CAAC,KAAK;QAC7C,KAAK,EAAE,OAAO,CAAC,wBAAwB,CAAC,KAAK;QAC7C,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,KAAK;KACpB,CAAC;IAIF,IAAI,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,uCACO,gBAAgB,KACnB,MAAM,EAAE,CAAC,IACX;IACN,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,MAAK,CAAC,EAAE,CAAC;QAC/D,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,gBAAgB;SAC7D,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,6DAA6B,EAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IAE1E,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,6BAA6B,CAAC,iBAAiB;SACnE,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAUD,MAAM,gBAAgB,GAAG,IAAA,uCAA6B,EAAC,cAAc,CAAC,CAAC;IAavE,IAAI,gBAAgB,GAAG,sCAA8B,EAAE,CAAC;QACpD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,mBAAmB;SAChE,CAAC,CAAC;QACH,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;QACnC,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAID,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAjFW,QAAA,+BAA+B,mCAiF1C"}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
import { FeatureLayerFieldFormatted } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Determines if a field alias is valid based on the following criteria:
|
|
4
|
-
* - `alias` must be present and non-empty.
|
|
5
|
-
* - The trimmed, lowercased `alias` must not be empty.
|
|
6
|
-
* - The trimmed, lowercased `alias` must not be identical to the trimmed, lowercased `name`.
|
|
7
|
-
*
|
|
8
|
-
* @param fieldInfo - The field information object containing `alias` and `name` properties.
|
|
9
|
-
* @returns `true` if the alias is valid, otherwise `false`.
|
|
10
|
-
*/
|
|
11
2
|
export declare const isValidFieldAlias: (fieldInfo: FeatureLayerFieldFormatted) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Calculates the percentage of fields that have a valid alias.
|
|
14
|
-
*
|
|
15
|
-
* @param fields - An array of formatted feature layer fields to check.
|
|
16
|
-
* @returns The percentage (as a number between 0 and 1) of fields with a valid alias.
|
|
17
|
-
* Returns 0 if the input array is empty, not an array, or undefined.
|
|
18
|
-
*/
|
|
19
3
|
export declare const getPercentOfValidFieldAliases: (fields: FeatureLayerFieldFormatted[]) => number;
|
|
@@ -1,42 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPercentOfValidFieldAliases = exports.isValidFieldAlias = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Determines if a field alias is valid based on the following criteria:
|
|
6
|
-
* - `alias` must be present and non-empty.
|
|
7
|
-
* - The trimmed, lowercased `alias` must not be empty.
|
|
8
|
-
* - The trimmed, lowercased `alias` must not be identical to the trimmed, lowercased `name`.
|
|
9
|
-
*
|
|
10
|
-
* @param fieldInfo - The field information object containing `alias` and `name` properties.
|
|
11
|
-
* @returns `true` if the alias is valid, otherwise `false`.
|
|
12
|
-
*/
|
|
13
4
|
const isValidFieldAlias = (fieldInfo) => {
|
|
14
5
|
const alias = (fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.alias) || '';
|
|
15
6
|
const name = (fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.name) || '';
|
|
16
7
|
if (!alias) {
|
|
17
|
-
return false;
|
|
8
|
+
return false;
|
|
18
9
|
}
|
|
19
10
|
const trimmedAlias = alias.trim().toLowerCase();
|
|
20
11
|
const trimmedName = name.trim().toLowerCase();
|
|
21
12
|
if (!trimmedAlias) {
|
|
22
|
-
return false;
|
|
13
|
+
return false;
|
|
23
14
|
}
|
|
24
15
|
if (trimmedAlias === trimmedName) {
|
|
25
|
-
return false;
|
|
16
|
+
return false;
|
|
26
17
|
}
|
|
27
|
-
return true;
|
|
18
|
+
return true;
|
|
28
19
|
};
|
|
29
20
|
exports.isValidFieldAlias = isValidFieldAlias;
|
|
30
|
-
/**
|
|
31
|
-
* Calculates the percentage of fields that have a valid alias.
|
|
32
|
-
*
|
|
33
|
-
* @param fields - An array of formatted feature layer fields to check.
|
|
34
|
-
* @returns The percentage (as a number between 0 and 1) of fields with a valid alias.
|
|
35
|
-
* Returns 0 if the input array is empty, not an array, or undefined.
|
|
36
|
-
*/
|
|
37
21
|
const getPercentOfValidFieldAliases = (fields) => {
|
|
38
22
|
if (!fields || !Array.isArray(fields) || fields.length === 0) {
|
|
39
|
-
return 0;
|
|
23
|
+
return 0;
|
|
40
24
|
}
|
|
41
25
|
const countOfFieldsWithValidAlias = fields.filter((field) => {
|
|
42
26
|
return (0, exports.isValidFieldAlias)(field);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/helpers.ts"],"names":[],"mappings":";;;AAYO,MAAM,iBAAiB,GAAG,CAC7B,SAAqC,EAC9B,EAAE;IACT,MAAM,KAAK,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,KAAI,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,KAAI,EAAE,CAAC;IAEnC,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAChD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE9C,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,YAAY,KAAK,WAAW,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B;AASK,MAAM,6BAA6B,GAAG,CACzC,MAAoC,EAC9B,EAAE;IACR,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,CAAC;IACb,CAAC;IAED,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACxD,OAAO,IAAA,yBAAiB,EAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,MAAM,gBAAgB,GAAG,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IAErE,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAdW,QAAA,6BAA6B,iCAcxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/scoringConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/scoringConfig.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,sBAAsB,EAAE,CAAC;SAC5B;KACJ;CACJ,CAAC"}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
1
|
import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* requires 90% of field descriptions to be present to receive a full score
|
|
4
|
-
*/
|
|
5
2
|
export declare const FIELD_DESCRIPTIONS_REQUIRED_PERCENT = 0.9;
|
|
6
|
-
/**
|
|
7
|
-
* Validates that relevant fields in the provided feature layers have descriptions.
|
|
8
|
-
*
|
|
9
|
-
* This function checks if the given item is a feature service and evaluates the presence of field descriptions
|
|
10
|
-
* for relevant fields within the provided feature layers. It returns a `ValidationInfo` object containing
|
|
11
|
-
* the validation result, score, messages, and scoring factors based on the percentage of fields with descriptions.
|
|
12
|
-
*
|
|
13
|
-
* Scoring logic:
|
|
14
|
-
* - If the item is not a feature layer, the rule does not contribute to the final score.
|
|
15
|
-
* - If there are no feature layers, a message is added and the result is returned.
|
|
16
|
-
* - If there are no relevant fields, full score is given.
|
|
17
|
-
* - If no relevant fields have descriptions, a message is added and score is zero.
|
|
18
|
-
* - If less than 80% of relevant fields have descriptions, a message is added and half score is given.
|
|
19
|
-
* - If at least 80% of relevant fields have descriptions, full score is given.
|
|
20
|
-
*
|
|
21
|
-
* @param item - The item to validate, expected to be a feature layer item.
|
|
22
|
-
* @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field descriptions.
|
|
23
|
-
* @returns A `ValidationInfo` object containing the validation result, score, messages, and scoring factors.
|
|
24
|
-
*/
|
|
25
3
|
export declare const checkFeatureServiceFieldDescriptions: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
|
|
@@ -6,29 +6,7 @@ const isFeatureService_1 = require("../util/isFeatureService");
|
|
|
6
6
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
7
7
|
const helpers_1 = require("./helpers");
|
|
8
8
|
const scoringConfig_1 = require("./scoringConfig");
|
|
9
|
-
/**
|
|
10
|
-
* requires 90% of field descriptions to be present to receive a full score
|
|
11
|
-
*/
|
|
12
9
|
exports.FIELD_DESCRIPTIONS_REQUIRED_PERCENT = 0.9;
|
|
13
|
-
/**
|
|
14
|
-
* Validates that relevant fields in the provided feature layers have descriptions.
|
|
15
|
-
*
|
|
16
|
-
* This function checks if the given item is a feature service and evaluates the presence of field descriptions
|
|
17
|
-
* for relevant fields within the provided feature layers. It returns a `ValidationInfo` object containing
|
|
18
|
-
* the validation result, score, messages, and scoring factors based on the percentage of fields with descriptions.
|
|
19
|
-
*
|
|
20
|
-
* Scoring logic:
|
|
21
|
-
* - If the item is not a feature layer, the rule does not contribute to the final score.
|
|
22
|
-
* - If there are no feature layers, a message is added and the result is returned.
|
|
23
|
-
* - If there are no relevant fields, full score is given.
|
|
24
|
-
* - If no relevant fields have descriptions, a message is added and score is zero.
|
|
25
|
-
* - If less than 80% of relevant fields have descriptions, a message is added and half score is given.
|
|
26
|
-
* - If at least 80% of relevant fields have descriptions, full score is given.
|
|
27
|
-
*
|
|
28
|
-
* @param item - The item to validate, expected to be a feature layer item.
|
|
29
|
-
* @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field descriptions.
|
|
30
|
-
* @returns A `ValidationInfo` object containing the validation result, score, messages, and scoring factors.
|
|
31
|
-
*/
|
|
32
10
|
const checkFeatureServiceFieldDescriptions = (item, featureLayers) => {
|
|
33
11
|
const strings = (0, stringsConfig_1.getStringsConfig)();
|
|
34
12
|
const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
|
|
@@ -45,8 +23,6 @@ const checkFeatureServiceFieldDescriptions = (item, featureLayers) => {
|
|
|
45
23
|
isBinaryCheck: false,
|
|
46
24
|
isAdvisory: false,
|
|
47
25
|
};
|
|
48
|
-
// Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
|
|
49
|
-
// if the item is not a feature layer.
|
|
50
26
|
if (!(0, isFeatureService_1.isFeatureService)(item)) {
|
|
51
27
|
return Object.assign(Object.assign({}, validationResult), { weight: 0 });
|
|
52
28
|
}
|
|
@@ -57,45 +33,13 @@ const checkFeatureServiceFieldDescriptions = (item, featureLayers) => {
|
|
|
57
33
|
return validationResult;
|
|
58
34
|
}
|
|
59
35
|
const relevantFields = (0, getRelevantFeatureLayerFields_1.getRelevantFeatureLayerFields)(featureLayers || []);
|
|
60
|
-
// should receive 0 score since there is no relevant field found.
|
|
61
|
-
// Checked with Jim Herris and he said that he'd rather see this as a 0 score
|
|
62
|
-
// so that the user can see that there are no relevant fields
|
|
63
36
|
if (relevantFields.length === 0) {
|
|
64
37
|
validationResult.messages.push({
|
|
65
38
|
message: strings.featureLayerFieldDescriptions.NO_RELEVANT_FIELD,
|
|
66
39
|
});
|
|
67
40
|
return validationResult;
|
|
68
41
|
}
|
|
69
|
-
// // get the count of fields with descriptions provided
|
|
70
|
-
// const countOfFieldsWithDescription = relevantFields
|
|
71
|
-
// .filter((field) => field.description)
|
|
72
|
-
// .filter((field) => {
|
|
73
|
-
// const value = field.description?.value
|
|
74
|
-
// ? field.description?.value.trim().toLowerCase()
|
|
75
|
-
// : '';
|
|
76
|
-
// const fieldAlias = field.alias
|
|
77
|
-
// ? field.alias.trim().toLowerCase()
|
|
78
|
-
// : '';
|
|
79
|
-
// return (
|
|
80
|
-
// value &&
|
|
81
|
-
// value !== field.name.toLowerCase() &&
|
|
82
|
-
// value !== fieldAlias
|
|
83
|
-
// );
|
|
84
|
-
// }).length;
|
|
85
|
-
// const percentWithDescription =
|
|
86
|
-
// countOfFieldsWithDescription / relevantFields.length;
|
|
87
42
|
const percentWithDescription = (0, helpers_1.getPercentOfValidFieldDescriptions)(relevantFields);
|
|
88
|
-
// // if percentWithDescription is 0, then there are no fields with aliases
|
|
89
|
-
// // it should receive a score of 0 and a message to add field aliases
|
|
90
|
-
// if (percentWithDescription === 0) {
|
|
91
|
-
// validationResult.messages.push({
|
|
92
|
-
// message:
|
|
93
|
-
// strings.featureLayerFieldDescriptions.ADD_FIELD_DESCRIPTION,
|
|
94
|
-
// });
|
|
95
|
-
// return validationResult;
|
|
96
|
-
// }
|
|
97
|
-
// if percentWithDescription is less than 0.9, then there are some fields with aliases
|
|
98
|
-
// it should receive half of score and a message to improve field aliases
|
|
99
43
|
if (percentWithDescription < exports.FIELD_DESCRIPTIONS_REQUIRED_PERCENT) {
|
|
100
44
|
validationResult.messages.push({
|
|
101
45
|
message: strings.featureLayerFieldDescriptions.IMRPOVE_FIELD_DESCRIPTION,
|
|
@@ -103,8 +47,6 @@ const checkFeatureServiceFieldDescriptions = (item, featureLayers) => {
|
|
|
103
47
|
validationResult.scoringFactor = 0;
|
|
104
48
|
return validationResult;
|
|
105
49
|
}
|
|
106
|
-
// if percentWithDescription is greater than 0.8, then there are most fields with aliases
|
|
107
|
-
// it should receive full score
|
|
108
50
|
validationResult.scoringFactor = 1;
|
|
109
51
|
return validationResult;
|
|
110
52
|
};
|
package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFeatureServiceFieldDescriptions.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,uCAA+D;AAC/D,mDAAgD;
|
|
1
|
+
{"version":3,"file":"checkFeatureServiceFieldDescriptions.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,uCAA+D;AAC/D,mDAAgD;AAKnC,QAAA,mCAAmC,GAAG,GAAG,CAAC;AAqBhD,MAAM,oCAAoC,GAAG,CAChD,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,oCAAoC;QACtD,KAAK,EAAE,OAAO,CAAC,6BAA6B,CAAC,KAAK;QAClD,KAAK,EAAE,OAAO,CAAC,6BAA6B,CAAC,KAAK;QAClD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,KAAK;KACpB,CAAC;IAIF,IAAI,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,uCACO,gBAAgB,KACnB,MAAM,EAAE,CAAC,IACX;IACN,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QACzD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,6BAA6B,CAAC,gBAAgB;SAClE,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,6DAA6B,EAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IAK1E,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,6BAA6B,CAAC,iBAAiB;SACnE,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAwBD,MAAM,sBAAsB,GACxB,IAAA,4CAAkC,EAAC,cAAc,CAAC,CAAC;IAcvD,IAAI,sBAAsB,GAAG,2CAAmC,EAAE,CAAC;QAC/D,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EACH,OAAO,CAAC,6BAA6B,CAAC,yBAAyB;SACtE,CAAC,CAAC;QACH,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;QACnC,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAID,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AArGW,QAAA,oCAAoC,wCAqG/C"}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
1
|
import { FeatureLayerFieldFormatted } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Determines if a field's description is valid.
|
|
4
|
-
*
|
|
5
|
-
* A valid description must:
|
|
6
|
-
* - Exist and not be empty after trimming.
|
|
7
|
-
* - Not be identical (case-insensitive, trimmed) to the field's name or alias.
|
|
8
|
-
*
|
|
9
|
-
* @param fieldInfo - The field information object containing description, name, and alias.
|
|
10
|
-
* @returns `true` if the description is valid, otherwise `false`.
|
|
11
|
-
*/
|
|
12
2
|
export declare const isValidFieldDescription: (fieldInfo: FeatureLayerFieldFormatted) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Calculates the percentage of fields that have a valid description.
|
|
15
|
-
*
|
|
16
|
-
* @param fields - An array of formatted feature layer fields to check.
|
|
17
|
-
* @returns The percentage (as a number between 0 and 1) of fields with a valid description.
|
|
18
|
-
* Returns 0 if the input array is empty, not an array, or undefined.
|
|
19
|
-
*/
|
|
20
3
|
export declare const getPercentOfValidFieldDescriptions: (fields: FeatureLayerFieldFormatted[]) => number;
|
|
@@ -1,47 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPercentOfValidFieldDescriptions = exports.isValidFieldDescription = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Determines if a field's description is valid.
|
|
6
|
-
*
|
|
7
|
-
* A valid description must:
|
|
8
|
-
* - Exist and not be empty after trimming.
|
|
9
|
-
* - Not be identical (case-insensitive, trimmed) to the field's name or alias.
|
|
10
|
-
*
|
|
11
|
-
* @param fieldInfo - The field information object containing description, name, and alias.
|
|
12
|
-
* @returns `true` if the description is valid, otherwise `false`.
|
|
13
|
-
*/
|
|
14
4
|
const isValidFieldDescription = (fieldInfo) => {
|
|
15
5
|
var _a;
|
|
16
6
|
const description = ((_a = fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.description) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
17
7
|
const name = (fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.name) || '';
|
|
18
8
|
const alias = (fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.alias) || '';
|
|
19
9
|
if (!description) {
|
|
20
|
-
return false;
|
|
10
|
+
return false;
|
|
21
11
|
}
|
|
22
12
|
const trimmedDescription = description.trim().toLowerCase();
|
|
23
13
|
const trimmedName = name.trim().toLowerCase();
|
|
24
14
|
const trimmedAlias = alias.trim().toLowerCase();
|
|
25
15
|
if (!trimmedDescription) {
|
|
26
|
-
return false;
|
|
16
|
+
return false;
|
|
27
17
|
}
|
|
28
18
|
if (trimmedDescription === trimmedName ||
|
|
29
19
|
trimmedDescription === trimmedAlias) {
|
|
30
|
-
return false;
|
|
20
|
+
return false;
|
|
31
21
|
}
|
|
32
|
-
return true;
|
|
22
|
+
return true;
|
|
33
23
|
};
|
|
34
24
|
exports.isValidFieldDescription = isValidFieldDescription;
|
|
35
|
-
/**
|
|
36
|
-
* Calculates the percentage of fields that have a valid description.
|
|
37
|
-
*
|
|
38
|
-
* @param fields - An array of formatted feature layer fields to check.
|
|
39
|
-
* @returns The percentage (as a number between 0 and 1) of fields with a valid description.
|
|
40
|
-
* Returns 0 if the input array is empty, not an array, or undefined.
|
|
41
|
-
*/
|
|
42
25
|
const getPercentOfValidFieldDescriptions = (fields) => {
|
|
43
26
|
if (!fields || !Array.isArray(fields) || fields.length === 0) {
|
|
44
|
-
return 0;
|
|
27
|
+
return 0;
|
|
45
28
|
}
|
|
46
29
|
const countOfFieldsWithValidAlias = fields.filter((field) => {
|
|
47
30
|
return (0, exports.isValidFieldDescription)(field);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/helpers.ts"],"names":[],"mappings":";;;AAYO,MAAM,uBAAuB,GAAG,CACnC,SAAqC,EAC9B,EAAE;;IACT,MAAM,WAAW,GAAG,CAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,0CAAE,KAAK,KAAI,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,KAAI,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,KAAI,EAAE,CAAC;IAErC,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,kBAAkB,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEhD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IACI,kBAAkB,KAAK,WAAW;QAClC,kBAAkB,KAAK,YAAY,EACrC,CAAC;QACC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AA3BW,QAAA,uBAAuB,2BA2BlC;AASK,MAAM,kCAAkC,GAAG,CAC9C,MAAoC,EAC9B,EAAE;IACR,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,CAAC;IACb,CAAC;IAED,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACxD,OAAO,IAAA,+BAAuB,EAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,MAAM,gBAAgB,GAAG,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IAErE,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAdW,QAAA,kCAAkC,sCAc7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/scoringConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/scoringConfig.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,2BAA2B,EAAE,CAAC;SACjC;KACJ;CACJ,CAAC"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Check if feature layers have appropriate field indexes set.
|
|
4
|
-
* @param item ArcGIS Online item to validate
|
|
5
|
-
* @param featureLayers Array of feature layers JSON objects from the feature service
|
|
6
|
-
* @returns ValidationInfo object containing the validation result
|
|
7
|
-
*
|
|
8
|
-
* @see https://developers.arcgis.com/documentation/portal-and-data-services/data-services/feature-services/field-and-spatial-indexes/
|
|
9
|
-
*/
|
|
10
2
|
export declare const checkFeatureServiceFieldIndexes: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
|