@vannizhang/living-atlas-content-validator 1.5.17 → 1.5.18-beta.2
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/README.md +1376 -162
- package/dist/configureSettings.d.ts +133 -0
- package/dist/configureSettings.js +61 -0
- package/dist/configureSettings.js.map +1 -0
- package/dist/data/TitleSummaryMatchingPatterns_Locations.json +829 -0
- package/dist/data/TitleSummaryMatchingPatterns_Sources.json +382 -0
- package/dist/data/TitleSummaryMatchingPatterns_Time.json +25 -0
- package/dist/data/TitleSummaryMatchingPatterns_Topics.json +1365 -0
- package/dist/data/TitleSummaryRejectedPatterns.json +44 -0
- package/dist/index.d.ts +27 -9
- package/dist/index.js +55 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/accessInformation/isValidAccessInformation.js +4 -6
- package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
- package/dist/lib/checkProfanities/checkProfanities.d.ts +7 -0
- package/dist/lib/checkProfanities/checkProfanities.js +26 -0
- package/dist/lib/checkProfanities/checkProfanities.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.d.ts +34 -0
- package/dist/lib/{recommendedText/checkRecommendedText.js → checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js} +51 -25
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/config.d.ts +97 -0
- package/dist/lib/checkTitleAndSnippetSearchability/config.js +41 -0
- package/dist/lib/checkTitleAndSnippetSearchability/config.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/data.d.ts +0 -0
- package/dist/lib/checkTitleAndSnippetSearchability/data.js +693 -0
- package/dist/lib/checkTitleAndSnippetSearchability/data.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +117 -0
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +241 -0
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.d.ts +34 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +207 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.d.ts +34 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js +170 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.d.ts +34 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js +172 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.d.ts +36 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js +175 -0
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -0
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -0
- package/dist/lib/config.d.ts +4 -1
- package/dist/lib/config.js +5 -5
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +6 -2
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
- package/dist/lib/deprecated/isDeprecated.js +5 -2
- package/dist/lib/deprecated/isDeprecated.js.map +1 -1
- package/dist/lib/description/isValidDescription.js +8 -5
- package/dist/lib/description/isValidDescription.js.map +1 -1
- package/dist/lib/licenseInfo/isValidLicenseInfo.js +5 -2
- package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
- package/dist/lib/sharing/isValidAccess.js +5 -2
- package/dist/lib/sharing/isValidAccess.js.map +1 -1
- package/dist/lib/ssl/isValidSSL.js +15 -6
- package/dist/lib/ssl/isValidSSL.js.map +1 -1
- package/dist/lib/summary/isValidSummary.js +6 -3
- package/dist/lib/summary/isValidSummary.js.map +1 -1
- package/dist/lib/tags/isValidTags.js +7 -3
- package/dist/lib/tags/isValidTags.js.map +1 -1
- package/dist/lib/thumbnail/isValidThumbnail.d.ts +6 -1
- package/dist/lib/thumbnail/isValidThumbnail.js +10 -7
- package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
- package/dist/lib/title/isValidTitle.js +9 -3
- package/dist/lib/title/isValidTitle.js.map +1 -1
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +44 -38
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
- package/dist/lib/userProfileName/isValidUserProfileName.js +8 -5
- package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +6 -3
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
- package/dist/lib/util/containsNonEnglishCharacters.d.ts +13 -0
- package/dist/lib/util/containsNonEnglishCharacters.js +30 -0
- package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -0
- package/dist/lib/util/countSentences.d.ts +23 -0
- package/dist/lib/util/countSentences.js +54 -0
- package/dist/lib/util/countSentences.js.map +1 -0
- package/dist/lib/util/createWordBoundaryRegex.d.ts +46 -0
- package/dist/lib/util/createWordBoundaryRegex.js +77 -0
- package/dist/lib/util/createWordBoundaryRegex.js.map +1 -0
- package/dist/lib/util/escapeSpecialCharacters.d.ts +7 -0
- package/dist/lib/util/escapeSpecialCharacters.js +22 -0
- package/dist/lib/util/escapeSpecialCharacters.js.map +1 -0
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.d.ts +21 -0
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js +34 -0
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -0
- package/dist/lib/util/getNumberOfWords.js +6 -2
- package/dist/lib/util/getNumberOfWords.js.map +1 -1
- package/dist/lib/util/getScoringRules.js +6 -0
- package/dist/lib/util/getScoringRules.js.map +1 -1
- package/dist/lib/util/isLayer.js +3 -2
- package/dist/lib/util/isLayer.js.map +1 -1
- package/dist/lib/util/isUrl.d.ts +6 -0
- package/dist/lib/util/isUrl.js +16 -1
- package/dist/lib/util/isUrl.js.map +1 -1
- package/dist/lib/util/isValidRegexPattern.d.ts +7 -0
- package/dist/lib/util/isValidRegexPattern.js +20 -0
- package/dist/lib/util/isValidRegexPattern.js.map +1 -0
- package/dist/lib/util/sanitizeTags.d.ts +6 -0
- package/dist/lib/util/sanitizeTags.js +16 -0
- package/dist/lib/util/sanitizeTags.js.map +1 -0
- package/dist/lib/util/shouldValidateByBetaRules.js +6 -1
- package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
- package/dist/lib/util/stringsConfig.d.ts +9 -0
- package/dist/lib/util/stringsConfig.js +9 -1
- package/dist/lib/util/stringsConfig.js.map +1 -1
- package/dist/lib/validate/validate.d.ts +57 -12
- package/dist/lib/validate/validate.js +87 -213
- package/dist/lib/validate/validate.js.map +1 -1
- package/dist/lib/validate/validateHelpers.d.ts +63 -0
- package/dist/lib/validate/validateHelpers.js +157 -0
- package/dist/lib/validate/validateHelpers.js.map +1 -0
- package/dist/locale/de.json +1 -1
- package/dist/locale/en.json +23 -23
- package/dist/locale/es.json +1 -1
- package/dist/locale/fr.json +1 -1
- package/dist/locale/ja.json +1 -1
- package/dist/locale/pt-br.json +1 -1
- package/dist/package-info.json +1 -1
- package/dist/services/content-validator-assets/config.d.ts +4 -0
- package/dist/services/content-validator-assets/config.js +8 -0
- package/dist/services/content-validator-assets/config.js.map +1 -0
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.d.ts +95 -0
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +92 -0
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -0
- package/dist/services/content-validator-assets/fetchProfanitiesData.d.ts +18 -0
- package/dist/services/content-validator-assets/fetchProfanitiesData.js +55 -0
- package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -0
- package/dist/services/content-validator-assets/helpers.d.ts +16 -0
- package/dist/services/content-validator-assets/helpers.js +35 -0
- package/dist/services/content-validator-assets/helpers.js.map +1 -0
- package/dist/services/custom-terms/config.d.ts +27 -0
- package/dist/services/custom-terms/config.js +79 -0
- package/dist/services/custom-terms/config.js.map +1 -0
- package/dist/services/custom-terms/customTerms.d.ts +229 -0
- package/dist/services/custom-terms/customTerms.js +394 -0
- package/dist/services/custom-terms/customTerms.js.map +1 -0
- package/dist/services/custom-terms/helpers.d.ts +8 -0
- package/dist/services/custom-terms/helpers.js +25 -0
- package/dist/services/custom-terms/helpers.js.map +1 -0
- package/dist/services/custom-terms/index.d.ts +3 -0
- package/dist/services/custom-terms/index.js +10 -0
- package/dist/services/custom-terms/index.js.map +1 -0
- package/dist/services/custom-terms-review-results/config.d.ts +31 -0
- package/dist/services/custom-terms-review-results/config.js +78 -0
- package/dist/services/custom-terms-review-results/config.js.map +1 -0
- package/dist/services/custom-terms-review-results/customTermsReviewResults.d.ts +133 -0
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js +276 -0
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -0
- package/dist/services/custom-terms-review-results/helpers.d.ts +24 -0
- package/dist/services/custom-terms-review-results/helpers.js +52 -0
- package/dist/services/custom-terms-review-results/helpers.js.map +1 -0
- package/dist/services/custom-terms-review-results/index.d.ts +4 -0
- package/dist/services/custom-terms-review-results/index.js +13 -0
- package/dist/services/custom-terms-review-results/index.js.map +1 -0
- package/dist/services/shared/addFeatures.d.ts +28 -0
- package/dist/services/shared/addFeatures.js +52 -0
- package/dist/services/shared/addFeatures.js.map +1 -0
- package/dist/services/shared/applyEdits.d.ts +28 -0
- package/dist/services/shared/applyEdits.js +53 -0
- package/dist/services/shared/applyEdits.js.map +1 -0
- package/dist/services/shared/config.d.ts +44 -0
- package/dist/services/shared/config.js +35 -0
- package/dist/services/shared/config.js.map +1 -0
- package/dist/services/shared/getItemInfo.d.ts +36 -0
- package/dist/services/shared/getItemInfo.js +56 -0
- package/dist/services/shared/getItemInfo.js.map +1 -0
- package/dist/types/index.d.ts +25 -22
- package/package.json +4 -3
- package/dist/__tests__/test-data/title-summary-data.json +0 -14654
- package/dist/data/TitleSummaryMatchingPatterns.json +0 -1902
- package/dist/lib/layers/isValidLayerCount.d.ts +0 -12
- package/dist/lib/layers/isValidLayerCount.js +0 -171
- package/dist/lib/layers/isValidLayerCount.js.map +0 -1
- package/dist/lib/layers/scoringConfig.d.ts +0 -10
- package/dist/lib/layers/scoringConfig.js +0 -20
- package/dist/lib/layers/scoringConfig.js.map +0 -1
- package/dist/lib/recommendedText/checkRecommendedText.d.ts +0 -15
- package/dist/lib/recommendedText/checkRecommendedText.js.map +0 -1
- package/dist/lib/recommendedText/helpers.d.ts +0 -15
- package/dist/lib/recommendedText/helpers.js +0 -62
- package/dist/lib/recommendedText/helpers.js.map +0 -1
- package/dist/lib/recommendedText/matchDateTimeInfo.d.ts +0 -9
- package/dist/lib/recommendedText/matchDateTimeInfo.js +0 -81
- package/dist/lib/recommendedText/matchDateTimeInfo.js.map +0 -1
- package/dist/lib/recommendedText/matchLocationInfo.d.ts +0 -9
- package/dist/lib/recommendedText/matchLocationInfo.js +0 -745
- package/dist/lib/recommendedText/matchLocationInfo.js.map +0 -1
- package/dist/lib/recommendedText/matchSourceInfo.d.ts +0 -9
- package/dist/lib/recommendedText/matchSourceInfo.js +0 -32
- package/dist/lib/recommendedText/matchSourceInfo.js.map +0 -1
- package/dist/lib/recommendedText/matchTopicInfo.d.ts +0 -9
- package/dist/lib/recommendedText/matchTopicInfo.js +0 -32
- package/dist/lib/recommendedText/matchTopicInfo.js.map +0 -1
- package/dist/lib/recommendedText/scoringConfig.js.map +0 -1
- /package/dist/lib/{recommendedText → checkTitleAndSnippetSearchability}/scoringConfig.d.ts +0 -0
- /package/dist/lib/{recommendedText → checkTitleAndSnippetSearchability}/scoringConfig.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/lib/validate/validate.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/lib/validate/validate.ts"],"names":[],"mappings":";;;AAuBA,6FAA0F;AAC1F,8HAA2H;AAC3H,4DAAyD;AACzD,4FAAyF;AACzF,0EAAuE;AACvE,mEAAmE;AACnE,0EAAuE;AACvE,8DAA2D;AAC3D,kDAA+C;AAC/C,qDAAkD;AAClD,oEAAiE;AACjE,wDAAqD;AACrD,6DAA0D;AAC1D,2GAAwG;AACxG,sFAAmF;AACnF,qGAAkG;AAClG,+FAA+F;AAC/F,uDAI2B;AA6B3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACI,MAAM,QAAQ,GAAG,CACpB,IAAW,EACX,WAAkB,EAClB,EACI,6BAA6B,EAC7B,gCAAgC,EAChC,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,MACD,EAAE,EACP,EAAE;IAClB,yBAAyB;IAEzB,MAAM,mBAAmB,GAAG,IAAA,sEAAmC,EAAC,IAAI,CAAC,CAAC;IAEtE,gEAAgE;IAChE,MAAM,UAAU,qBAAQ,IAAI,CAAE,CAAC;IAC/B,gFAAgF;IAChF,MAAM,iBAAiB,qBAAQ,WAAW,CAAE,CAAC;IAE7C,MAAM,MAAM,GAAG,IAAA,6BAAa,EAAC,UAAU,CAAC,CAAC;IACzC,MAAM,iBAAiB,GAAG,IAAA,mDAAwB,EAAC,UAAU,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,IAAA,uCAAkB,EAAC,UAAU,CAAC,CAAC;IACnD,8CAA8C;IAC9C,MAAM,WAAW,GAAG,IAAA,uCAAkB,EAAC,UAAU,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,IAAA,+BAAc,EAAC,UAAU,CAA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UAAU,GAAG,IAAA,+BAAa,EACvC,gBAAgB,EAChB,mBAAmB,CACtB,CAAC;IAEF,6FAA6F;IAC7F,gBAAgB,CAAC,cAAc,GAAG,IAAA,wCAAsB,EACpD,gBAAgB,EAChB,mBAAmB,CACtB,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AA9FW,QAAA,QAAQ,YA8FnB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ValidationInfo, ValidationResult } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Flat the `ValidationResult` object and return an array of `ValidationInfo`
|
|
4
|
+
* @param validationResult
|
|
5
|
+
* @returns {ValidationInfo[]} array of all `ValidationInfo` from `validatedItem` and `validatedProfile` objects
|
|
6
|
+
*/
|
|
7
|
+
export declare const flatValidationResults: (validationResult: ValidationResult) => ValidationInfo[];
|
|
8
|
+
/**
|
|
9
|
+
* Returns the total score of the validation result.
|
|
10
|
+
*
|
|
11
|
+
* The total score is calculated by summing up the scores of all validation results
|
|
12
|
+
* that are applicable to Living Atlas supported item types.
|
|
13
|
+
*
|
|
14
|
+
* @param validationResult - The validation result object containing all validation information
|
|
15
|
+
* @param isLivingAtlasSupportedItemType - Boolean indicating if the item type is supported by Living Atlas
|
|
16
|
+
* @returns The total score of the validation result
|
|
17
|
+
*/
|
|
18
|
+
export declare const getTotalScore: (validationResult: ValidationResult, isLivingAtlasSupportedItemType: boolean) => number;
|
|
19
|
+
/**
|
|
20
|
+
* Assigns final scores and statuses to each validation result within the given validation result object.
|
|
21
|
+
*
|
|
22
|
+
* This function processes each validation result to:
|
|
23
|
+
* 1. Calculate total weight of all applicable validation rules
|
|
24
|
+
* 2. Calculate score per weight unit
|
|
25
|
+
* 3. Assign maximum possible score and actual score to each validation result
|
|
26
|
+
* 4. Determine status based on applicability and score
|
|
27
|
+
*
|
|
28
|
+
* The status will be one of:
|
|
29
|
+
* - 'not-applicable': When the rule doesn't apply to this item type
|
|
30
|
+
* - 'error': When applicable but scored 0
|
|
31
|
+
* - 'warning': When applicable but scored less than maximum
|
|
32
|
+
* - 'pass': When applicable and scored the maximum
|
|
33
|
+
*
|
|
34
|
+
* @param validationResult - The validation result object containing all validation information
|
|
35
|
+
* @param isLivingAtlasSupportedItemType - Boolean indicating if the item type is supported by Living Atlas
|
|
36
|
+
* @returns The updated validation result object with scores and statuses assigned
|
|
37
|
+
*/
|
|
38
|
+
export declare const assignFinalScoresAndStatus: (validationResult: ValidationResult, isLivingAtlasSupportedItemType: boolean) => ValidationResult;
|
|
39
|
+
/**
|
|
40
|
+
* Return `true` if the total score of the validation result meets the minimum threshold, which is 80.
|
|
41
|
+
*
|
|
42
|
+
* @param totalScore total score from the validation result
|
|
43
|
+
* @returns true if it meets the minimum threshold
|
|
44
|
+
*/
|
|
45
|
+
export declare const meetMinimumTotalScore: (totalScore: number) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if an item can be nominated to Living Atlas based on a set of minimum requirements.
|
|
48
|
+
*
|
|
49
|
+
* An item can be nominated only if its total score meets the minimum required threshold of **80** and it also passes all of
|
|
50
|
+
* the following checks:
|
|
51
|
+
*
|
|
52
|
+
* - It is shared with the public
|
|
53
|
+
* - It is NOT marked as deprecated
|
|
54
|
+
* - It has Delete Protection enabled
|
|
55
|
+
* - Its thumbnail image meets the required dimension
|
|
56
|
+
* - It has a snippet text
|
|
57
|
+
* - It has a description text
|
|
58
|
+
* - The item owner has a user profile description
|
|
59
|
+
*
|
|
60
|
+
* @param validationResult The validation result
|
|
61
|
+
* @returns A boolean value that indicates whether all the scores meet the required thresholds.
|
|
62
|
+
*/
|
|
63
|
+
export declare const meetRequiredThresholds: (validationResult: ValidationResult, isLivingAtlasSupportedItemType: boolean) => boolean;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.meetRequiredThresholds = exports.meetMinimumTotalScore = exports.assignFinalScoresAndStatus = exports.getTotalScore = exports.flatValidationResults = void 0;
|
|
4
|
+
const config_1 = require("../config");
|
|
5
|
+
const round_1 = require("../util/round");
|
|
6
|
+
/**
|
|
7
|
+
* Flat the `ValidationResult` object and return an array of `ValidationInfo`
|
|
8
|
+
* @param validationResult
|
|
9
|
+
* @returns {ValidationInfo[]} array of all `ValidationInfo` from `validatedItem` and `validatedProfile` objects
|
|
10
|
+
*/
|
|
11
|
+
const flatValidationResults = (validationResult) => {
|
|
12
|
+
const { validatedItem, validatedProfile } = validationResult || {};
|
|
13
|
+
if (!validatedItem || !validatedProfile) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
return [
|
|
17
|
+
...Object.values(validatedItem),
|
|
18
|
+
...Object.values(validatedProfile),
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
exports.flatValidationResults = flatValidationResults;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the total score of the validation result.
|
|
24
|
+
*
|
|
25
|
+
* The total score is calculated by summing up the scores of all validation results
|
|
26
|
+
* that are applicable to Living Atlas supported item types.
|
|
27
|
+
*
|
|
28
|
+
* @param validationResult - The validation result object containing all validation information
|
|
29
|
+
* @param isLivingAtlasSupportedItemType - Boolean indicating if the item type is supported by Living Atlas
|
|
30
|
+
* @returns The total score of the validation result
|
|
31
|
+
*/
|
|
32
|
+
const getTotalScore = (validationResult, isLivingAtlasSupportedItemType) => {
|
|
33
|
+
if (!validationResult || !isLivingAtlasSupportedItemType) {
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
const validationResults = (0, exports.flatValidationResults)(validationResult);
|
|
37
|
+
const totalScore = validationResults.reduce((prev, curr) => prev + curr.score, 0);
|
|
38
|
+
return (0, round_1.round)(totalScore);
|
|
39
|
+
};
|
|
40
|
+
exports.getTotalScore = getTotalScore;
|
|
41
|
+
/**
|
|
42
|
+
* Assigns final scores and statuses to each validation result within the given validation result object.
|
|
43
|
+
*
|
|
44
|
+
* This function processes each validation result to:
|
|
45
|
+
* 1. Calculate total weight of all applicable validation rules
|
|
46
|
+
* 2. Calculate score per weight unit
|
|
47
|
+
* 3. Assign maximum possible score and actual score to each validation result
|
|
48
|
+
* 4. Determine status based on applicability and score
|
|
49
|
+
*
|
|
50
|
+
* The status will be one of:
|
|
51
|
+
* - 'not-applicable': When the rule doesn't apply to this item type
|
|
52
|
+
* - 'error': When applicable but scored 0
|
|
53
|
+
* - 'warning': When applicable but scored less than maximum
|
|
54
|
+
* - 'pass': When applicable and scored the maximum
|
|
55
|
+
*
|
|
56
|
+
* @param validationResult - The validation result object containing all validation information
|
|
57
|
+
* @param isLivingAtlasSupportedItemType - Boolean indicating if the item type is supported by Living Atlas
|
|
58
|
+
* @returns The updated validation result object with scores and statuses assigned
|
|
59
|
+
*/
|
|
60
|
+
const assignFinalScoresAndStatus = (validationResult, isLivingAtlasSupportedItemType) => {
|
|
61
|
+
const validationResults = (0, exports.flatValidationResults)(validationResult);
|
|
62
|
+
// Calculate the sum of weights from all validation rules that can be applied to the input item.
|
|
63
|
+
const totalWeight = validationResults.reduce((prev, curr) => prev + curr.weight, 0);
|
|
64
|
+
// Calculate the score associated with each weight.
|
|
65
|
+
const scorePerWeight = 100 / totalWeight;
|
|
66
|
+
for (const validationResult of validationResults) {
|
|
67
|
+
const { weight, weightFactor } = validationResult;
|
|
68
|
+
// Calculate the maximum score and actual score based on the weight.
|
|
69
|
+
const maxScore = weight * scorePerWeight;
|
|
70
|
+
const score = weightFactor * maxScore;
|
|
71
|
+
// Assign the calculated values to the validation result object.
|
|
72
|
+
validationResult.maxScore = maxScore;
|
|
73
|
+
validationResult.score = score;
|
|
74
|
+
}
|
|
75
|
+
for (const validationResult of validationResults) {
|
|
76
|
+
const { maxScore, score } = validationResult;
|
|
77
|
+
// Determine if the validation result is applicable.
|
|
78
|
+
const isApplicable = maxScore > 0 && isLivingAtlasSupportedItemType;
|
|
79
|
+
// Determine the status of the validation result.
|
|
80
|
+
if (!isApplicable) {
|
|
81
|
+
validationResult.status = 'not-applicable';
|
|
82
|
+
}
|
|
83
|
+
else if (isApplicable && score === 0) {
|
|
84
|
+
validationResult.status = 'error';
|
|
85
|
+
}
|
|
86
|
+
else if (isApplicable && score < maxScore) {
|
|
87
|
+
validationResult.status = 'warning';
|
|
88
|
+
}
|
|
89
|
+
else if (isApplicable && score === maxScore) {
|
|
90
|
+
validationResult.status = 'pass';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return validationResult;
|
|
94
|
+
};
|
|
95
|
+
exports.assignFinalScoresAndStatus = assignFinalScoresAndStatus;
|
|
96
|
+
/**
|
|
97
|
+
* Return `true` if the total score of the validation result meets the minimum threshold, which is 80.
|
|
98
|
+
*
|
|
99
|
+
* @param totalScore total score from the validation result
|
|
100
|
+
* @returns true if it meets the minimum threshold
|
|
101
|
+
*/
|
|
102
|
+
const meetMinimumTotalScore = (totalScore) => {
|
|
103
|
+
return totalScore >= config_1.MINIMUM_SCORE_THRESHHOLD;
|
|
104
|
+
};
|
|
105
|
+
exports.meetMinimumTotalScore = meetMinimumTotalScore;
|
|
106
|
+
/**
|
|
107
|
+
* Checks if an item can be nominated to Living Atlas based on a set of minimum requirements.
|
|
108
|
+
*
|
|
109
|
+
* An item can be nominated only if its total score meets the minimum required threshold of **80** and it also passes all of
|
|
110
|
+
* the following checks:
|
|
111
|
+
*
|
|
112
|
+
* - It is shared with the public
|
|
113
|
+
* - It is NOT marked as deprecated
|
|
114
|
+
* - It has Delete Protection enabled
|
|
115
|
+
* - Its thumbnail image meets the required dimension
|
|
116
|
+
* - It has a snippet text
|
|
117
|
+
* - It has a description text
|
|
118
|
+
* - The item owner has a user profile description
|
|
119
|
+
*
|
|
120
|
+
* @param validationResult The validation result
|
|
121
|
+
* @returns A boolean value that indicates whether all the scores meet the required thresholds.
|
|
122
|
+
*/
|
|
123
|
+
const meetRequiredThresholds = (validationResult, isLivingAtlasSupportedItemType) => {
|
|
124
|
+
if (!validationResult || !isLivingAtlasSupportedItemType) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const totalScore = (validationResult === null || validationResult === void 0 ? void 0 : validationResult.totalScore) || 0;
|
|
128
|
+
if ((0, exports.meetMinimumTotalScore)(totalScore) === false) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
const { validatedItem, validatedProfile } = validationResult;
|
|
132
|
+
if (!validatedItem || !validatedProfile) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
const { access, thumbnail, snippet, description, deprecated, deleteProtection, } = validatedItem;
|
|
136
|
+
const { userProfileDescription } = validatedProfile;
|
|
137
|
+
if (
|
|
138
|
+
// must be shared with public
|
|
139
|
+
access.score !== access.maxScore ||
|
|
140
|
+
// must have perfect thumbnail
|
|
141
|
+
thumbnail.score !== thumbnail.maxScore ||
|
|
142
|
+
// must not be deprecated
|
|
143
|
+
deprecated.score !== deprecated.maxScore ||
|
|
144
|
+
// must have delete protection enabled
|
|
145
|
+
deleteProtection.score !== deleteProtection.maxScore ||
|
|
146
|
+
// snippet cannot be empty
|
|
147
|
+
snippet.score === 0 ||
|
|
148
|
+
// description cannot be empty
|
|
149
|
+
description.score === 0 ||
|
|
150
|
+
// user profile cannot be empty
|
|
151
|
+
userProfileDescription.score === 0) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
};
|
|
156
|
+
exports.meetRequiredThresholds = meetRequiredThresholds;
|
|
157
|
+
//# sourceMappingURL=validateHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateHelpers.js","sourceRoot":"","sources":["../../../src/lib/validate/validateHelpers.ts"],"names":[],"mappings":";;;AACA,sCAAqD;AACrD,yCAAsC;AAEtC;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CACjC,gBAAkC,EAClB,EAAE;IAClB,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,IAAI,EAAE,CAAC;IAEnE,IAAI,CAAC,a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gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,UAAU,KAAI,CAAC,CAAC;IAErD,IAAI,IAAA,6BAAqB,EAAC,UAAU,CAAC,KAAK,KAAK,EAAE;QAC7C,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAAC;IAE7D,IAAI,CAAC,aAAa,IAAI,CAAC,gBAAgB,EAAE;QACrC,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,EACF,MAAM,EACN,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,gBAAgB,GACnB,GAAG,aAAa,CAAC;IAElB,MAAM,EAAE,sBAAsB,EAAE,GAAG,gBAAgB,CAAC;IAEpD;IACI,6BAA6B;IAC7B,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ;QAChC,8BAA8B;QAC9B,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ;QACtC,yBAAyB;QACzB,UAAU,CAAC,KAAK,KAAK,UAAU,CAAC,QAAQ;QACxC,sCAAsC;QACtC,gBAAgB,CAAC,KAAK,KAAK,gBAAgB,CAAC,QAAQ;QACpD,0BAA0B;QAC1B,OAAO,CAAC,KAAK,KAAK,CAAC;QACnB,8BAA8B;QAC9B,WAAW,CAAC,KAAK,KAAK,CAAC;QACvB,+BAA+B;QAC/B,sBAAsB,CAAC,KAAK,KAAK,CAAC,EACpC;QACE,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAnDW,QAAA,sBAAsB,0BAmDjC"}
|
package/dist/locale/de.json
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
111
111
|
"LABEL": "Miniaturansicht verbessern",
|
|
112
112
|
"TITLE": "Miniaturansicht prüfen",
|
|
113
|
-
"
|
|
113
|
+
"EMPTY_THUMBNAIL_MESSAGE": "A custom high resolution thumbnail is required.",
|
|
114
114
|
"BAD_THUMBNAIL_ERROR_MESSAGE": "Es gibt ein Problem mit dem Format der Miniaturansicht.",
|
|
115
115
|
"SMALL_THUMBNAIL_FILENAME_ISSUE_MESSAGE": "Eine benutzerdefinierte Miniaturansicht ist erforderlich. Die vom System erstellte Miniaturansicht ist ungeeignet.",
|
|
116
116
|
"THUMBNAIL_SIZE_MESSAGE": "Eine hochauflösende Miniaturansicht ist erforderlich"
|
package/dist/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"accessInformation": {
|
|
3
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Enter text that gives credit/attribution to the organizations requiring it: data provider, application developer, etc. Be brief
|
|
3
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Enter text that gives credit/attribution to the organizations requiring it: data provider, application developer, etc. <b>Be brief</b>. Use the Description section for a full citation.",
|
|
4
4
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
5
5
|
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for entering text here.",
|
|
6
6
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"MINIMUM_WORD_COUNT_MESSAGE": ""
|
|
11
11
|
},
|
|
12
12
|
"description": {
|
|
13
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "A good description directly answers the questions \"What is this?\" and \"What does this layer/map/app show?\" A couple of short paragraphs is usually enough to cover the basic questions of \"who, what, when, where, why and how\" (not necessarily in that order, of course). Avoid using jargon or abbreviations unless they are explained. Provide source information and in-depth explanations via web links using the link editor in ArcGIS Online and provide HTTPS links. Provide the year or version of the data. Indicate the geographic area covered. For layers, provide a simple list of attribute field aliases included. ",
|
|
13
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "A good description directly answers the questions \"What is this?\" and \"What does this layer/map/app show?\" A couple of short paragraphs is usually enough to cover the basic questions of \"who, what, when, where, why and how\" (not necessarily in that order, of course). Avoid using jargon or abbreviations unless they are explained. Provide source information and in-depth explanations via web links using the link editor in ArcGIS Online and provide HTTPS links. Provide the year or version of the data. Indicate the geographic area covered. For layers, provide a simple list of attribute field aliases included. For imagery layers, provide information about pixel size.",
|
|
14
14
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
15
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are awarded for having roughly 4-5 sentences, 12 words per sentence average. Points are awarded for providing links to more detailed information.
|
|
15
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are awarded for having roughly 4-5 sentences, 12 words per sentence average. Points are awarded for providing links to more detailed information. In the near future, points will be awarded for providing \"Source: [source information or link]\" or \"Citation: [source information or link]\".",
|
|
16
16
|
"TOOLTIP_SCORING_MSG_INTL": "Points are awarded for having a description. Points are awarded for providing links to more detailed information.",
|
|
17
17
|
"LABEL": "Improve Description",
|
|
18
18
|
"TITLE": "Check Description",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"BEST_MESSAGE": ""
|
|
35
35
|
},
|
|
36
36
|
"licenseInfo": {
|
|
37
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Communicate any Terms of Use required by your organization or the data provider.
|
|
37
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Communicate any Terms of Use required by your organization or the data provider. When adding hyperlinks, please use the link editor in ArcGIS Online and provide HTTPS links.",
|
|
38
38
|
"TOOLTIP_GUIDANCE_INTL": "Communicate any Terms of Use required by your organization or by the data provider.",
|
|
39
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are awarded for having more than one word here. Also rewarded: text that includes a hyperlink
|
|
40
|
-
"TOOLTIP_SCORING_MSG_INTL": "Points are awarded for
|
|
39
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are awarded for having more than one word here. Also rewarded: text that includes a hyperlink to more detailed information explaining the constraints more fully.",
|
|
40
|
+
"TOOLTIP_SCORING_MSG_INTL": "Points are awarded for terms of use descriptions containing more than one word. Points are awarded for text that includes a hyperlink to more detailed usage constraints.",
|
|
41
41
|
"LABEL": "Improve Terms of Use",
|
|
42
42
|
"TITLE": "Check Terms of Use",
|
|
43
43
|
"EMPTY_STRING_MESSAGE": "Add Terms of Use",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"sharing": {
|
|
48
48
|
"TOOLTIP_GUIDANCE_DEFAULT": "When ready, publicly share your item so others can see it in Living Atlas.",
|
|
49
49
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
50
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for setting the sharing
|
|
50
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for setting the sharing level to Public.",
|
|
51
51
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
52
52
|
"LABEL": "Set sharing level to: Public ",
|
|
53
53
|
"TITLE": "Check Sharing Level",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"ORG_MESSAGE": "Set sharing level to: Public"
|
|
57
57
|
},
|
|
58
58
|
"deprecated": {
|
|
59
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Change the Content Status setting to remove the Deprecated mark",
|
|
60
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for item that is NOT marked as Deprecated",
|
|
59
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Change the Content Status setting to remove the Deprecated mark. Items that are marked Deprecated are automatically removed from Living Atlas within a day.",
|
|
60
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for an item that is NOT marked as Deprecated.",
|
|
61
61
|
"LABEL": "Items may not be marked ‘Deprecated'",
|
|
62
62
|
"TITLE": "Check Deprecated Setting",
|
|
63
63
|
"DEPRECATED_MESSAGE": "Disable the 'Deprecated' setting"
|
|
64
64
|
},
|
|
65
65
|
"deleteProtection": {
|
|
66
66
|
"TOOLTIP_GUIDANCE_DEFAULT": "<a href='https://doc.arcgis.com/en/arcgis-online/manage-data/configure-item-details.htm#GUID-C43BEBC5-2C2F-4D70-8E48-227E8567E01F' target='_blank'>Enable Delete Protection</a> to prevent this item from being accidentally deleted.",
|
|
67
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for item that has Delete Protection enabled",
|
|
67
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for an item that has Delete Protection enabled.",
|
|
68
68
|
"LABEL": "Item must have 'Delete Protection' enabled",
|
|
69
69
|
"TITLE": "Check Delete Protection Setting",
|
|
70
70
|
"DELETE_PROTECTION_NOT_ENABLED_MESSAGE": "Enable the 'Delete Protection' setting"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"PROHIBITED_WORDS_MESSAGE": "Copy, demo, test, or eval are used in the Summary"
|
|
93
93
|
},
|
|
94
94
|
"tags": {
|
|
95
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Click the Edit button to improve the tags. Enter at least three tags that help people find your work. You
|
|
95
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Click the Edit button to improve the tags. Enter at least three tags that help people find your work. You can add the item's title as a tag to improve search results in most situations. Think more broadly about tags that are synonyms or other words related to your item's Title and Summary. Extra tags help answer the question, \"How can someone find this item if they don't know its title or the industry?\" For example, if your map is titled \"Population Density\" you may also want tags like \"crowding\" or \"overcrowding\" in your item since that is something it measures.",
|
|
96
96
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
97
97
|
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are awarded for having at least three tags total. Points are deducted if tags <i>copy</i>, <i>demo</i>, <i>test</i>, or <i>eval</i> are used.",
|
|
98
98
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
@@ -104,21 +104,21 @@
|
|
|
104
104
|
"PROHIBITED_WORDS_MESSAGE": "Copy, demo, test, or eval are used as tags."
|
|
105
105
|
},
|
|
106
106
|
"thumbnail": {
|
|
107
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Upload a great-looking thumbnail that shows the layer, map or app at its best. Zoom to a scale at which your item looks great and take a screen capture. Then trim or resize it to the standard thumbnail image size, 600 x 400 pixel dimension.",
|
|
107
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Upload a great-looking thumbnail that shows the layer, map or app at its best. Zoom to a scale at which your item looks great and take a screen capture. Then trim or resize it to the standard thumbnail image size, 600 x 400 pixel dimension, or larger.",
|
|
108
108
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
109
109
|
"TOOLTIP_SCORING_MSG_DEFAULT": "Full points are awarded for adding a non-system generated thumbnail that is 600 pixels wide by 400 pixels high.",
|
|
110
110
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
111
111
|
"LABEL": "Improve Thumbnail",
|
|
112
112
|
"TITLE": "Check Thumbnail",
|
|
113
|
-
"
|
|
113
|
+
"EMPTY_THUMBNAIL_MESSAGE": "A custom high resolution thumbnail is required.",
|
|
114
114
|
"BAD_THUMBNAIL_ERROR_MESSAGE": "There is an issue with the thumbnail format",
|
|
115
115
|
"SMALL_THUMBNAIL_FILENAME_ISSUE_MESSAGE": "A custom thumbnail is required. The system-generated thumbnail is not adequate.",
|
|
116
116
|
"THUMBNAIL_SIZE_MESSAGE": "High resolution thumbnail is required"
|
|
117
117
|
},
|
|
118
118
|
"title": {
|
|
119
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Enter a title that is easy to read and avoid the use of jargon or abbreviations.
|
|
119
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "The item title answers the question: <b>What is this?</b> Enter a title that is easy to read and avoid the use of jargon or abbreviations. Acronyms can be useful in the title to save space if the acronym is well-known, but spell the acronym out in the Summary. Keep the title as short as seems reasonable, and use the Summary to provide additional details.",
|
|
120
120
|
"TOOLTIP_GUIDANCE_INTL": "Enter a title that is easy to read and avoid the use of jargon or abbreviations. The item title answers the question, What is this?",
|
|
121
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are deducted if <i>copy</i>, <i>demo</i>, <i>test</i>, <i>eval</i>,
|
|
121
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are deducted if <i>copy</i>, <i>demo</i>, <i>test</i>, <i>eval</i>, _ (underscore), : (colon) or words in ALL CAPS are used. Points are awarded if two or more words are in the title.",
|
|
122
122
|
"TOOLTIP_SCORING_MSG_INTL": "Points are awarded for having a title.",
|
|
123
123
|
"LABEL": "Improve Title",
|
|
124
124
|
"TITLE": "Check Title",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"PROHIBITED_WORDS_MESSAGE": "Remove prohibited word(s)"
|
|
130
130
|
},
|
|
131
131
|
"userProfileDescription": {
|
|
132
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Describe yourself, your team, your organization, and how to contact
|
|
132
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Describe yourself, your team, your organization, and how to contact someone through email. Read <a href=\"https://www.esri.com/arcgis-blog/products/arcgis-online/sharing-collaboration/create-a-great-profile/\" target=\"_blank\"> this blog about best practices for your ArcGIS Online profile.</a>",
|
|
133
133
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
134
134
|
"TOOLTIP_SCORING_MSG_DEFAULT": "Points are awarded for having at least 20 words in this description. Points are awarded for having a hyperlink to related information and an email present so that people can contact the person or team responsible for this item.",
|
|
135
135
|
"TOOLTIP_SCORING_MSG_INTL": "Points are awarded for having a description. Points are awarded for having a hyperlink to related information, and an email present so that people can contact the person or team responsible for this item.",
|
|
@@ -138,9 +138,9 @@
|
|
|
138
138
|
"EMPTY_STRING_MESSAGE": "Add a full description for this userID’s Profile",
|
|
139
139
|
"PROHIBITED_CHARS_MESSAGE": "",
|
|
140
140
|
"NO_VALID_EMAIL_MESSAGE": "Add an email link",
|
|
141
|
-
"NO_VALID_URL_MESSAGE": " Add a link to
|
|
141
|
+
"NO_VALID_URL_MESSAGE": " Add a link to your organization, social media, or other information.",
|
|
142
142
|
"MIN_NUM_WORDS_MESSAGE": "Profile description needs more words, add information",
|
|
143
|
-
"MIN_NUM_SENTENCES_MESSAGE": " Profile description needs
|
|
143
|
+
"MIN_NUM_SENTENCES_MESSAGE": " Profile description needs additional information about you, your team, your organization."
|
|
144
144
|
},
|
|
145
145
|
"userProfileName": {
|
|
146
146
|
"TOOLTIP_GUIDANCE_DEFAULT": "Enter your name. If someone has a question, whom should they contact? Read <a href=\"https://www.esri.com/arcgis-blog/products/arcgis-online/sharing-collaboration/create-a-great-profile/\" target=\"_blank\">this blog about best practices for your ArcGIS Online profile.</a>",
|
|
@@ -155,20 +155,20 @@
|
|
|
155
155
|
"userProfileThumbnail": {
|
|
156
156
|
"TOOLTIP_GUIDANCE_DEFAULT": "People want to know who is behind a map or app. Share your image or organization logo — something visual to remember. Read <a href=\"https://www.esri.com/arcgis-blog/products/arcgis-online/sharing-collaboration/create-a-great-profile/\" target=\"_blank\">this blog about best practices for your ArcGIS Online profile.</a>",
|
|
157
157
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
158
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Any image
|
|
158
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Any image beyond the default is awarded points. Bonus points if it fits the required dimensions.",
|
|
159
159
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
160
160
|
"LABEL": "Improve Profile Thumbnail",
|
|
161
161
|
"TITLE": "Check Profile Thumbnail",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "Add a good thumbnail to Profile"
|
|
163
163
|
},
|
|
164
164
|
"recommendedTextInTitleAndSummary": {
|
|
165
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Users who search for content consistently look for four pieces of information:</br><ul><li>Location or area of coverage, to understand which geographic area is included.</li><li>Topic, to understand what this item is about.</li><li>Year or Vintage, to understand
|
|
166
|
-
"TOOLTIP_SCORING_MSG_DEFAULT": "Title
|
|
165
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Users who search for content consistently look for four pieces of information:</br><ul><li>Location or area of coverage, to understand which geographic area is included.</li><li>Topic, to understand what this item is about.</li><li>Year or Vintage, to understand how recently the data was collected or updated.</li><li>Source organization/program, to understand where the item’s content originated</li></ul>",
|
|
166
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Title and Summary scoring is applied to layer items only at this time. If your layer item’s language is English, the words in your Title and Summary are evaluated. Full points are awarded if these four things are found in the item’s Title and/or Summary: </br><ul><li>Location or area of coverage (e.g., “London” or “England” or “Europe” or “Global” or “World” )</li><li>Topic (e.g., “Parks” or “Population Density” or “Sea Surface Temperature” or “Basemap”)</li> <li>Year or Vintage (e.g., “2024” or “Current” or “Latest” or “1990-2020”)</li> <li>Source organization/program (e.g., “NASA” or “Sentinel” or “Produced by EcoVision Lab in the ETH Zurich Department of Civil, Environmental and Geomatic Engineering.”</li></ul>",
|
|
167
167
|
"LABEL": "Verify Title and Summary have search-friendly information",
|
|
168
|
-
"TITLE": "Check Title and Summary",
|
|
168
|
+
"TITLE": "Check Discoverability of Title and Summary",
|
|
169
169
|
"ADD_LOCATION_INFO": "Add location or area of coverage, to communicate which geographic area is included.",
|
|
170
170
|
"ADD_TIME_INFO": "Add year or vintage, to communicate the how recently the data was collected or updated.",
|
|
171
|
-
"ADD_SOURCE_INFO": "Add source organization/program
|
|
171
|
+
"ADD_SOURCE_INFO": "Add source organization/program to communicate where the item’s content originated.",
|
|
172
172
|
"ADD_TOPIC_INFO": "Add topic to communicate what this item is about."
|
|
173
173
|
}
|
|
174
174
|
}
|
package/dist/locale/es.json
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
111
111
|
"LABEL": "Mejorar vista en miniatura",
|
|
112
112
|
"TITLE": "Comprobar vista en miniatura",
|
|
113
|
-
"
|
|
113
|
+
"EMPTY_THUMBNAIL_MESSAGE": "A custom high resolution thumbnail is required.",
|
|
114
114
|
"BAD_THUMBNAIL_ERROR_MESSAGE": "Hay un problema con el formato en miniatura",
|
|
115
115
|
"SMALL_THUMBNAIL_FILENAME_ISSUE_MESSAGE": "Se requiere una vista en miniatura personalizada. La vista en miniatura generada por el sistema no es adecuada.",
|
|
116
116
|
"THUMBNAIL_SIZE_MESSAGE": "Se requiere una vista en miniatura de alta resolución"
|
package/dist/locale/fr.json
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
111
111
|
"LABEL": "Améliorer la miniature",
|
|
112
112
|
"TITLE": "Vérifier la miniature",
|
|
113
|
-
"
|
|
113
|
+
"EMPTY_THUMBNAIL_MESSAGE": "A custom high resolution thumbnail is required.",
|
|
114
114
|
"BAD_THUMBNAIL_ERROR_MESSAGE": "Le format de la miniature pose problème",
|
|
115
115
|
"SMALL_THUMBNAIL_FILENAME_ISSUE_MESSAGE": "Une miniature personnalisée est obligatoire. La miniature générée par le système n’est pas appropriée.",
|
|
116
116
|
"THUMBNAIL_SIZE_MESSAGE": "Une miniature haute résolution est obligatoire"
|
package/dist/locale/ja.json
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
111
111
|
"LABEL": "サムネイルの改善",
|
|
112
112
|
"TITLE": "サムネイルの確認",
|
|
113
|
-
"
|
|
113
|
+
"EMPTY_THUMBNAIL_MESSAGE": "A custom high resolution thumbnail is required.",
|
|
114
114
|
"BAD_THUMBNAIL_ERROR_MESSAGE": "サムネイルの形式に問題があります",
|
|
115
115
|
"SMALL_THUMBNAIL_FILENAME_ISSUE_MESSAGE": "カスタム サムネイルが必要です。 システムで生成されたサムネイルは不適切です。",
|
|
116
116
|
"THUMBNAIL_SIZE_MESSAGE": "高解像度のサムネイルが必要です"
|
package/dist/locale/pt-br.json
CHANGED
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
111
111
|
"LABEL": "Melhorar Miniatura",
|
|
112
112
|
"TITLE": "Verificar Miniatura",
|
|
113
|
-
"
|
|
113
|
+
"EMPTY_THUMBNAIL_MESSAGE": "A custom high resolution thumbnail is required.",
|
|
114
114
|
"BAD_THUMBNAIL_ERROR_MESSAGE": "Há um problema com o formato da miniatura",
|
|
115
115
|
"SMALL_THUMBNAIL_FILENAME_ISSUE_MESSAGE": "Uma miniatura personalizada é exigida. A miniatura gerada pelo sistema não é adequada.",
|
|
116
116
|
"THUMBNAIL_SIZE_MESSAGE": "É necessária uma miniatura de alta resolução"
|
package/dist/package-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"lastCompiledTime":
|
|
1
|
+
{"lastCompiledTime":1745601716544}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ASSETS_FOLDER_PATH = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Path of the assets folder on the Living Atlas server.
|
|
6
|
+
*/
|
|
7
|
+
exports.ASSETS_FOLDER_PATH = '/media/content-validator-assets';
|
|
8
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/services/content-validator-assets/config.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,kBAAkB,GAAG,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export type AdditionalPatterns4TitleAndSnippetSearchability = {
|
|
2
|
+
/**
|
|
3
|
+
* A list of extra matching patterns for location matching.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```
|
|
7
|
+
* ["New York", "Los Angeles"]
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
matchingPatternsLocation: string[];
|
|
11
|
+
/**
|
|
12
|
+
* A list of extra rejected patterns for location matching.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```
|
|
16
|
+
* ["Unknown", "Unknown Location"]
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
rejectedPatternsLocation: string[];
|
|
20
|
+
/**
|
|
21
|
+
* A list of extra matching patterns for source matching.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```
|
|
25
|
+
* ["NOAA", "Department of Energy"]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
matchingPatternsSource: string[];
|
|
29
|
+
/**
|
|
30
|
+
* A list of extra rejected patterns for source matching.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```
|
|
34
|
+
* ["Unknown", "Unknown Source"]
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
rejectedPatternsSource: string[];
|
|
38
|
+
/**
|
|
39
|
+
* A list of extra matching patterns for topic matching.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```
|
|
43
|
+
* ["Climate Change", "Renewable Energy"]
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
matchingPatternsTopic: string[];
|
|
47
|
+
/**
|
|
48
|
+
* A list of extra rejected patterns for topic matching.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```
|
|
52
|
+
* ["Unknown", "Unknown Topic"]
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
rejectedPatternsTopic: string[];
|
|
56
|
+
/**
|
|
57
|
+
* A list of extra matching patterns for title matching.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```
|
|
61
|
+
* ["bi-weekly", "monthly"]
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
matchingPatternsYearVintage: string[];
|
|
65
|
+
/**
|
|
66
|
+
* A list of extra rejected patterns for year vintage matching.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```
|
|
70
|
+
* ["Unknown", "Unknown Year Vintage"]
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
rejectedPatternsYearVintage: string[];
|
|
74
|
+
/**
|
|
75
|
+
* The timestamp when the data was last updated.
|
|
76
|
+
*/
|
|
77
|
+
updatedAt?: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Fetches additional pattern rules for validating the searchability of titles and snippets.
|
|
81
|
+
*
|
|
82
|
+
* This function retrieves additional matching and rejected patterns for different categories,
|
|
83
|
+
* including location, source, topic, and year vintage. These patterns help determine whether
|
|
84
|
+
* a title or snippet is valid for searchability.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} language - The language code (e.g., "en", "es", "fr") to fetch the appropriate localized patterns. The default is "en".
|
|
87
|
+
* @returns {Promise<AdditionalPattern>} A promise resolving to an object containing categorized matching and rejected patterns.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const patterns = await fetchPatternRulesForTitleSearchability("en");
|
|
92
|
+
* console.log(patterns.matchingPatternsLocation); // ["New York", "Los Angeles"]
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare const fetchAdditonalPatterns4TitleAndSnippetSearchability: (language?: string) => Promise<AdditionalPatterns4TitleAndSnippetSearchability>;
|