@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.
Files changed (198) hide show
  1. package/README.md +1376 -162
  2. package/dist/configureSettings.d.ts +133 -0
  3. package/dist/configureSettings.js +61 -0
  4. package/dist/configureSettings.js.map +1 -0
  5. package/dist/data/TitleSummaryMatchingPatterns_Locations.json +829 -0
  6. package/dist/data/TitleSummaryMatchingPatterns_Sources.json +382 -0
  7. package/dist/data/TitleSummaryMatchingPatterns_Time.json +25 -0
  8. package/dist/data/TitleSummaryMatchingPatterns_Topics.json +1365 -0
  9. package/dist/data/TitleSummaryRejectedPatterns.json +44 -0
  10. package/dist/index.d.ts +27 -9
  11. package/dist/index.js +55 -9
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/accessInformation/isValidAccessInformation.js +4 -6
  14. package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
  15. package/dist/lib/checkProfanities/checkProfanities.d.ts +7 -0
  16. package/dist/lib/checkProfanities/checkProfanities.js +26 -0
  17. package/dist/lib/checkProfanities/checkProfanities.js.map +1 -0
  18. package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.d.ts +34 -0
  19. package/dist/lib/{recommendedText/checkRecommendedText.js → checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js} +51 -25
  20. package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -0
  21. package/dist/lib/checkTitleAndSnippetSearchability/config.d.ts +97 -0
  22. package/dist/lib/checkTitleAndSnippetSearchability/config.js +41 -0
  23. package/dist/lib/checkTitleAndSnippetSearchability/config.js.map +1 -0
  24. package/dist/lib/checkTitleAndSnippetSearchability/data.d.ts +0 -0
  25. package/dist/lib/checkTitleAndSnippetSearchability/data.js +693 -0
  26. package/dist/lib/checkTitleAndSnippetSearchability/data.js.map +1 -0
  27. package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +117 -0
  28. package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +241 -0
  29. package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -0
  30. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.d.ts +34 -0
  31. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +207 -0
  32. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -0
  33. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.d.ts +34 -0
  34. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js +170 -0
  35. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -0
  36. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.d.ts +34 -0
  37. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js +172 -0
  38. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -0
  39. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.d.ts +36 -0
  40. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js +175 -0
  41. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -0
  42. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -0
  43. package/dist/lib/config.d.ts +4 -1
  44. package/dist/lib/config.js +5 -5
  45. package/dist/lib/config.js.map +1 -1
  46. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +6 -2
  47. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
  48. package/dist/lib/deprecated/isDeprecated.js +5 -2
  49. package/dist/lib/deprecated/isDeprecated.js.map +1 -1
  50. package/dist/lib/description/isValidDescription.js +8 -5
  51. package/dist/lib/description/isValidDescription.js.map +1 -1
  52. package/dist/lib/licenseInfo/isValidLicenseInfo.js +5 -2
  53. package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
  54. package/dist/lib/sharing/isValidAccess.js +5 -2
  55. package/dist/lib/sharing/isValidAccess.js.map +1 -1
  56. package/dist/lib/ssl/isValidSSL.js +15 -6
  57. package/dist/lib/ssl/isValidSSL.js.map +1 -1
  58. package/dist/lib/summary/isValidSummary.js +6 -3
  59. package/dist/lib/summary/isValidSummary.js.map +1 -1
  60. package/dist/lib/tags/isValidTags.js +7 -3
  61. package/dist/lib/tags/isValidTags.js.map +1 -1
  62. package/dist/lib/thumbnail/isValidThumbnail.d.ts +6 -1
  63. package/dist/lib/thumbnail/isValidThumbnail.js +10 -7
  64. package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
  65. package/dist/lib/title/isValidTitle.js +9 -3
  66. package/dist/lib/title/isValidTitle.js.map +1 -1
  67. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +44 -38
  68. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
  69. package/dist/lib/userProfileName/isValidUserProfileName.js +8 -5
  70. package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
  71. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +6 -3
  72. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
  73. package/dist/lib/util/containsNonEnglishCharacters.d.ts +13 -0
  74. package/dist/lib/util/containsNonEnglishCharacters.js +30 -0
  75. package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -0
  76. package/dist/lib/util/countSentences.d.ts +23 -0
  77. package/dist/lib/util/countSentences.js +54 -0
  78. package/dist/lib/util/countSentences.js.map +1 -0
  79. package/dist/lib/util/createWordBoundaryRegex.d.ts +46 -0
  80. package/dist/lib/util/createWordBoundaryRegex.js +77 -0
  81. package/dist/lib/util/createWordBoundaryRegex.js.map +1 -0
  82. package/dist/lib/util/escapeSpecialCharacters.d.ts +7 -0
  83. package/dist/lib/util/escapeSpecialCharacters.js +22 -0
  84. package/dist/lib/util/escapeSpecialCharacters.js.map +1 -0
  85. package/dist/lib/util/getLivingAtlasSupportedItemTypes.d.ts +21 -0
  86. package/dist/lib/util/getLivingAtlasSupportedItemTypes.js +34 -0
  87. package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -0
  88. package/dist/lib/util/getNumberOfWords.js +6 -2
  89. package/dist/lib/util/getNumberOfWords.js.map +1 -1
  90. package/dist/lib/util/getScoringRules.js +6 -0
  91. package/dist/lib/util/getScoringRules.js.map +1 -1
  92. package/dist/lib/util/isLayer.js +3 -2
  93. package/dist/lib/util/isLayer.js.map +1 -1
  94. package/dist/lib/util/isUrl.d.ts +6 -0
  95. package/dist/lib/util/isUrl.js +16 -1
  96. package/dist/lib/util/isUrl.js.map +1 -1
  97. package/dist/lib/util/isValidRegexPattern.d.ts +7 -0
  98. package/dist/lib/util/isValidRegexPattern.js +20 -0
  99. package/dist/lib/util/isValidRegexPattern.js.map +1 -0
  100. package/dist/lib/util/sanitizeTags.d.ts +6 -0
  101. package/dist/lib/util/sanitizeTags.js +16 -0
  102. package/dist/lib/util/sanitizeTags.js.map +1 -0
  103. package/dist/lib/util/shouldValidateByBetaRules.js +6 -1
  104. package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
  105. package/dist/lib/util/stringsConfig.d.ts +9 -0
  106. package/dist/lib/util/stringsConfig.js +9 -1
  107. package/dist/lib/util/stringsConfig.js.map +1 -1
  108. package/dist/lib/validate/validate.d.ts +57 -12
  109. package/dist/lib/validate/validate.js +87 -213
  110. package/dist/lib/validate/validate.js.map +1 -1
  111. package/dist/lib/validate/validateHelpers.d.ts +63 -0
  112. package/dist/lib/validate/validateHelpers.js +157 -0
  113. package/dist/lib/validate/validateHelpers.js.map +1 -0
  114. package/dist/locale/de.json +1 -1
  115. package/dist/locale/en.json +23 -23
  116. package/dist/locale/es.json +1 -1
  117. package/dist/locale/fr.json +1 -1
  118. package/dist/locale/ja.json +1 -1
  119. package/dist/locale/pt-br.json +1 -1
  120. package/dist/package-info.json +1 -1
  121. package/dist/services/content-validator-assets/config.d.ts +4 -0
  122. package/dist/services/content-validator-assets/config.js +8 -0
  123. package/dist/services/content-validator-assets/config.js.map +1 -0
  124. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.d.ts +95 -0
  125. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +92 -0
  126. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -0
  127. package/dist/services/content-validator-assets/fetchProfanitiesData.d.ts +18 -0
  128. package/dist/services/content-validator-assets/fetchProfanitiesData.js +55 -0
  129. package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -0
  130. package/dist/services/content-validator-assets/helpers.d.ts +16 -0
  131. package/dist/services/content-validator-assets/helpers.js +35 -0
  132. package/dist/services/content-validator-assets/helpers.js.map +1 -0
  133. package/dist/services/custom-terms/config.d.ts +27 -0
  134. package/dist/services/custom-terms/config.js +79 -0
  135. package/dist/services/custom-terms/config.js.map +1 -0
  136. package/dist/services/custom-terms/customTerms.d.ts +229 -0
  137. package/dist/services/custom-terms/customTerms.js +394 -0
  138. package/dist/services/custom-terms/customTerms.js.map +1 -0
  139. package/dist/services/custom-terms/helpers.d.ts +8 -0
  140. package/dist/services/custom-terms/helpers.js +25 -0
  141. package/dist/services/custom-terms/helpers.js.map +1 -0
  142. package/dist/services/custom-terms/index.d.ts +3 -0
  143. package/dist/services/custom-terms/index.js +10 -0
  144. package/dist/services/custom-terms/index.js.map +1 -0
  145. package/dist/services/custom-terms-review-results/config.d.ts +31 -0
  146. package/dist/services/custom-terms-review-results/config.js +78 -0
  147. package/dist/services/custom-terms-review-results/config.js.map +1 -0
  148. package/dist/services/custom-terms-review-results/customTermsReviewResults.d.ts +133 -0
  149. package/dist/services/custom-terms-review-results/customTermsReviewResults.js +276 -0
  150. package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -0
  151. package/dist/services/custom-terms-review-results/helpers.d.ts +24 -0
  152. package/dist/services/custom-terms-review-results/helpers.js +52 -0
  153. package/dist/services/custom-terms-review-results/helpers.js.map +1 -0
  154. package/dist/services/custom-terms-review-results/index.d.ts +4 -0
  155. package/dist/services/custom-terms-review-results/index.js +13 -0
  156. package/dist/services/custom-terms-review-results/index.js.map +1 -0
  157. package/dist/services/shared/addFeatures.d.ts +28 -0
  158. package/dist/services/shared/addFeatures.js +52 -0
  159. package/dist/services/shared/addFeatures.js.map +1 -0
  160. package/dist/services/shared/applyEdits.d.ts +28 -0
  161. package/dist/services/shared/applyEdits.js +53 -0
  162. package/dist/services/shared/applyEdits.js.map +1 -0
  163. package/dist/services/shared/config.d.ts +44 -0
  164. package/dist/services/shared/config.js +35 -0
  165. package/dist/services/shared/config.js.map +1 -0
  166. package/dist/services/shared/getItemInfo.d.ts +36 -0
  167. package/dist/services/shared/getItemInfo.js +56 -0
  168. package/dist/services/shared/getItemInfo.js.map +1 -0
  169. package/dist/types/index.d.ts +25 -22
  170. package/package.json +4 -3
  171. package/dist/__tests__/test-data/title-summary-data.json +0 -14654
  172. package/dist/data/TitleSummaryMatchingPatterns.json +0 -1902
  173. package/dist/lib/layers/isValidLayerCount.d.ts +0 -12
  174. package/dist/lib/layers/isValidLayerCount.js +0 -171
  175. package/dist/lib/layers/isValidLayerCount.js.map +0 -1
  176. package/dist/lib/layers/scoringConfig.d.ts +0 -10
  177. package/dist/lib/layers/scoringConfig.js +0 -20
  178. package/dist/lib/layers/scoringConfig.js.map +0 -1
  179. package/dist/lib/recommendedText/checkRecommendedText.d.ts +0 -15
  180. package/dist/lib/recommendedText/checkRecommendedText.js.map +0 -1
  181. package/dist/lib/recommendedText/helpers.d.ts +0 -15
  182. package/dist/lib/recommendedText/helpers.js +0 -62
  183. package/dist/lib/recommendedText/helpers.js.map +0 -1
  184. package/dist/lib/recommendedText/matchDateTimeInfo.d.ts +0 -9
  185. package/dist/lib/recommendedText/matchDateTimeInfo.js +0 -81
  186. package/dist/lib/recommendedText/matchDateTimeInfo.js.map +0 -1
  187. package/dist/lib/recommendedText/matchLocationInfo.d.ts +0 -9
  188. package/dist/lib/recommendedText/matchLocationInfo.js +0 -745
  189. package/dist/lib/recommendedText/matchLocationInfo.js.map +0 -1
  190. package/dist/lib/recommendedText/matchSourceInfo.d.ts +0 -9
  191. package/dist/lib/recommendedText/matchSourceInfo.js +0 -32
  192. package/dist/lib/recommendedText/matchSourceInfo.js.map +0 -1
  193. package/dist/lib/recommendedText/matchTopicInfo.d.ts +0 -9
  194. package/dist/lib/recommendedText/matchTopicInfo.js +0 -32
  195. package/dist/lib/recommendedText/matchTopicInfo.js.map +0 -1
  196. package/dist/lib/recommendedText/scoringConfig.js.map +0 -1
  197. /package/dist/lib/{recommendedText → checkTitleAndSnippetSearchability}/scoringConfig.d.ts +0 -0
  198. /package/dist/lib/{recommendedText → checkTitleAndSnippetSearchability}/scoringConfig.js +0 -0
@@ -0,0 +1,44 @@
1
+ {
2
+ "common": [
3
+ "test",
4
+ "demo",
5
+ "eval",
6
+ "copy",
7
+ "n/a",
8
+ "none",
9
+ "undefined",
10
+ "not applicable",
11
+ "unknown",
12
+ "lorem",
13
+ "ipsum",
14
+ "lorem ipsum",
15
+ "placeholder",
16
+ "foo",
17
+ "foobar"
18
+ ],
19
+ "topics": ["no topic", "unknown topic"],
20
+ "time": ["no date", "unknown date"],
21
+ "sources": [
22
+ "unknown source",
23
+ "unknown sources",
24
+ "anonymous",
25
+ "no source",
26
+ "no sources"
27
+ ],
28
+ "locations": [
29
+ "anywhere",
30
+ "no location",
31
+ "unknown location",
32
+ "us",
33
+ "tract",
34
+ "tracts",
35
+ "state",
36
+ "states",
37
+ "country",
38
+ "countries",
39
+ "county",
40
+ "counties",
41
+ "congressional district",
42
+ "congressional districts"
43
+ ]
44
+ }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { ValidationMessage, ValidationInfo, ValidationResult } from './types';
1
+ import { ValidationMessage, ValidationInfo, ValidationResult, ValidationResultStatus } from './types';
2
2
  import { isValidTitle } from './lib/title/isValidTitle';
3
3
  import { isValidAccessInformation } from './lib/accessInformation/isValidAccessInformation';
4
4
  import { isValidDescription } from './lib/description/isValidDescription';
5
- import { isValidLayerCount } from './lib/layers/isValidLayerCount';
6
5
  import { isValidLicenseInfo } from './lib/licenseInfo/isValidLicenseInfo';
7
6
  import { isValidAccess } from './lib/sharing/isValidAccess';
8
7
  import { isValidSSL } from './lib/ssl/isValidSSL';
@@ -13,10 +12,29 @@ import { isValidUserProfileDescription } from './lib/userProfileDescription/isVa
13
12
  import { isValidUserProfileName } from './lib/userProfileName/isValidUserProfileName';
14
13
  import { isValidUserProfileThumbnail } from './lib/userProfileThumbnail/isValidUserProfileThumbnail';
15
14
  import { isDeprecated } from './lib/deprecated/isDeprecated';
16
- import { validate, meetMinimumTotalScore } from './lib/validate/validate';
17
- import { matchLocationInfo } from './lib/recommendedText/matchLocationInfo';
18
- import { matchDateTimeInfo } from './lib/recommendedText/matchDateTimeInfo';
19
- import { matchSourceInfo } from './lib/recommendedText/matchSourceInfo';
20
- import { matchTopicInfo } from './lib/recommendedText/matchTopicInfo';
21
- import { setStrings, getStringsConfig, ValidationRulesStringJSON } from './lib/util/stringsConfig';
22
- export { ValidationMessage, ValidationInfo, ValidationResult, ValidationRulesStringJSON, setStrings, getStringsConfig, validate, meetMinimumTotalScore, isValidTitle, isValidAccessInformation, isValidDescription, isValidLayerCount, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, isDeprecated, matchLocationInfo, matchDateTimeInfo, matchSourceInfo, matchTopicInfo, };
15
+ import { validate } from './lib/validate/validate';
16
+ import { isDeleteProtectionEnabled } from './lib/deleteProtection/isDeleteProtectionEnabled';
17
+ import { checkTitleAndSnippetSearchability } from './lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability';
18
+ import { matchLocationInfo, isRecognizedLocation, isRejectedLocationInfo } from './lib/checkTitleAndSnippetSearchability/matchLocationInfo';
19
+ import { matchDateTimeInfo, isRecognizedDateTimeInfo, isRejectedDateTimeInfo } from './lib/checkTitleAndSnippetSearchability/matchDateTimeInfo';
20
+ import { matchSourceInfo, isRecognizedSource, isRejectedSourceInfo } from './lib/checkTitleAndSnippetSearchability/matchSourceInfo';
21
+ import { matchTopicInfo, isRecognizedTopic, isRejectedTopicInfo } from './lib/checkTitleAndSnippetSearchability/matchTopicInfo';
22
+ import { isEligibleForCheckingTitleAndSnippetSearchability, MatchResult } from './lib/checkTitleAndSnippetSearchability/helpers';
23
+ import { isValidRegexPattern } from './lib/util/isValidRegexPattern';
24
+ import { sanitizeTags } from './lib/util/sanitizeTags';
25
+ import { getStringsConfig, ValidationRulesStringJSON, getDefaultStringsConfig } from './lib/util/stringsConfig';
26
+ import { configureSettings } from './configureSettings';
27
+ import { CustomTermFeature, getSubmittedCustomTerms, getMyCustomTerms, addCustomTerms2FeatureTable, updateStatusOfCustomTermsInFeatureTable, getCustomTermsFeatureTableItemInfo } from './services/custom-terms';
28
+ import { CustomTermCategory, CustomTermStatus } from './services/shared/config';
29
+ import { fetchAdditonalPatterns4TitleAndSnippetSearchability, AdditionalPatterns4TitleAndSnippetSearchability } from './services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability';
30
+ import { AddFeaturesResponse } from './services/shared/addFeatures';
31
+ import { addReviewResults2FeatureTable, updateReviewResultsInFeatureTable, getPackagedReviewResults, getReviewedReviewResults, getUnarchivedReviewResults, getDeployedReviewResults, getReviewResultsByTermAndCategory, CustomTermsReviewResultLifecycle, CustomTermReviewResultFeature, getCustomTermsReviewResultsFeatureTableItemInfo } from './services/custom-terms-review-results';
32
+ import { escapeSpecialCharacters } from './lib/util/escapeSpecialCharacters';
33
+ import { fetchProfanitiesData } from './services/content-validator-assets/fetchProfanitiesData';
34
+ import { containsProfanity } from './lib/checkProfanities/checkProfanities';
35
+ import { getLivingAtlasSupportedItemTypes, checkIsLivingAtlasSupportedItemType } from './lib/util/getLivingAtlasSupportedItemTypes';
36
+ import { LivingAtlasSupportedItemType } from './lib/config';
37
+ export { configureSettings, validate, isValidTitle, isValidAccessInformation, isValidDescription, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, isDeprecated, isDeleteProtectionEnabled, checkTitleAndSnippetSearchability, matchLocationInfo, matchDateTimeInfo, matchSourceInfo, matchTopicInfo, isRecognizedLocation, isRecognizedDateTimeInfo, isRecognizedSource, isRecognizedTopic, isRejectedLocationInfo, isRejectedDateTimeInfo, isRejectedSourceInfo, isRejectedTopicInfo, isEligibleForCheckingTitleAndSnippetSearchability, getLivingAtlasSupportedItemTypes, checkIsLivingAtlasSupportedItemType, sanitizeTags, getStringsConfig, getDefaultStringsConfig, };
38
+ export { fetchAdditonalPatterns4TitleAndSnippetSearchability, fetchProfanitiesData, getSubmittedCustomTerms, getMyCustomTerms, addCustomTerms2FeatureTable, updateStatusOfCustomTermsInFeatureTable, getPackagedReviewResults, getReviewedReviewResults, getUnarchivedReviewResults, getDeployedReviewResults, getReviewResultsByTermAndCategory, addReviewResults2FeatureTable, updateReviewResultsInFeatureTable, getCustomTermsFeatureTableItemInfo, getCustomTermsReviewResultsFeatureTableItemInfo, containsProfanity, };
39
+ export { isValidRegexPattern, escapeSpecialCharacters };
40
+ export type { ValidationMessage, ValidationInfo, ValidationResult, ValidationRulesStringJSON, ValidationResultStatus, MatchResult, CustomTermFeature, CustomTermCategory, CustomTermStatus, CustomTermsReviewResultLifecycle, CustomTermReviewResultFeature, AdditionalPatterns4TitleAndSnippetSearchability, AddFeaturesResponse, LivingAtlasSupportedItemType, };
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.matchTopicInfo = exports.matchSourceInfo = exports.matchDateTimeInfo = exports.matchLocationInfo = exports.isDeprecated = exports.isValidUserProfileThumbnail = exports.isValidUserProfileName = exports.isValidUserProfileDescription = exports.isValidThumbnail = exports.isValidTags = exports.isValidSummary = exports.isValidSSL = exports.isValidAccess = exports.isValidLicenseInfo = exports.isValidLayerCount = exports.isValidDescription = exports.isValidAccessInformation = exports.isValidTitle = exports.meetMinimumTotalScore = exports.validate = exports.getStringsConfig = exports.setStrings = void 0;
3
+ exports.getCustomTermsReviewResultsFeatureTableItemInfo = exports.getCustomTermsFeatureTableItemInfo = exports.updateReviewResultsInFeatureTable = exports.addReviewResults2FeatureTable = exports.getReviewResultsByTermAndCategory = exports.getDeployedReviewResults = exports.getUnarchivedReviewResults = exports.getReviewedReviewResults = exports.getPackagedReviewResults = exports.updateStatusOfCustomTermsInFeatureTable = exports.addCustomTerms2FeatureTable = exports.getMyCustomTerms = exports.getSubmittedCustomTerms = exports.fetchProfanitiesData = exports.fetchAdditonalPatterns4TitleAndSnippetSearchability = exports.getDefaultStringsConfig = exports.getStringsConfig = exports.sanitizeTags = exports.checkIsLivingAtlasSupportedItemType = exports.getLivingAtlasSupportedItemTypes = exports.isEligibleForCheckingTitleAndSnippetSearchability = exports.isRejectedTopicInfo = exports.isRejectedSourceInfo = exports.isRejectedDateTimeInfo = exports.isRejectedLocationInfo = exports.isRecognizedTopic = exports.isRecognizedSource = exports.isRecognizedDateTimeInfo = exports.isRecognizedLocation = exports.matchTopicInfo = exports.matchSourceInfo = exports.matchDateTimeInfo = exports.matchLocationInfo = exports.checkTitleAndSnippetSearchability = exports.isDeleteProtectionEnabled = exports.isDeprecated = exports.isValidUserProfileThumbnail = exports.isValidUserProfileName = exports.isValidUserProfileDescription = exports.isValidThumbnail = exports.isValidTags = exports.isValidSummary = exports.isValidSSL = exports.isValidAccess = exports.isValidLicenseInfo = exports.isValidDescription = exports.isValidAccessInformation = exports.isValidTitle = exports.validate = exports.configureSettings = void 0;
4
+ exports.escapeSpecialCharacters = exports.isValidRegexPattern = exports.containsProfanity = void 0;
4
5
  const isValidTitle_1 = require("./lib/title/isValidTitle");
5
6
  Object.defineProperty(exports, "isValidTitle", { enumerable: true, get: function () { return isValidTitle_1.isValidTitle; } });
6
7
  const isValidAccessInformation_1 = require("./lib/accessInformation/isValidAccessInformation");
7
8
  Object.defineProperty(exports, "isValidAccessInformation", { enumerable: true, get: function () { return isValidAccessInformation_1.isValidAccessInformation; } });
8
9
  const isValidDescription_1 = require("./lib/description/isValidDescription");
9
10
  Object.defineProperty(exports, "isValidDescription", { enumerable: true, get: function () { return isValidDescription_1.isValidDescription; } });
10
- const isValidLayerCount_1 = require("./lib/layers/isValidLayerCount");
11
- Object.defineProperty(exports, "isValidLayerCount", { enumerable: true, get: function () { return isValidLayerCount_1.isValidLayerCount; } });
11
+ // import { isValidLayerCount } from './lib/layers/isValidLayerCount.ts';
12
12
  const isValidLicenseInfo_1 = require("./lib/licenseInfo/isValidLicenseInfo");
13
13
  Object.defineProperty(exports, "isValidLicenseInfo", { enumerable: true, get: function () { return isValidLicenseInfo_1.isValidLicenseInfo; } });
14
14
  const isValidAccess_1 = require("./lib/sharing/isValidAccess");
@@ -31,16 +31,62 @@ const isDeprecated_1 = require("./lib/deprecated/isDeprecated");
31
31
  Object.defineProperty(exports, "isDeprecated", { enumerable: true, get: function () { return isDeprecated_1.isDeprecated; } });
32
32
  const validate_1 = require("./lib/validate/validate");
33
33
  Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_1.validate; } });
34
- Object.defineProperty(exports, "meetMinimumTotalScore", { enumerable: true, get: function () { return validate_1.meetMinimumTotalScore; } });
35
- const matchLocationInfo_1 = require("./lib/recommendedText/matchLocationInfo");
34
+ const isDeleteProtectionEnabled_1 = require("./lib/deleteProtection/isDeleteProtectionEnabled"); // Importing for side effects only
35
+ Object.defineProperty(exports, "isDeleteProtectionEnabled", { enumerable: true, get: function () { return isDeleteProtectionEnabled_1.isDeleteProtectionEnabled; } });
36
+ // import { meetMinimumTotalScore } from './lib/validate/validateHelpers';
37
+ const checkTitleAndSnippetSearchability_1 = require("./lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability");
38
+ Object.defineProperty(exports, "checkTitleAndSnippetSearchability", { enumerable: true, get: function () { return checkTitleAndSnippetSearchability_1.checkTitleAndSnippetSearchability; } });
39
+ const matchLocationInfo_1 = require("./lib/checkTitleAndSnippetSearchability/matchLocationInfo");
36
40
  Object.defineProperty(exports, "matchLocationInfo", { enumerable: true, get: function () { return matchLocationInfo_1.matchLocationInfo; } });
37
- const matchDateTimeInfo_1 = require("./lib/recommendedText/matchDateTimeInfo");
41
+ Object.defineProperty(exports, "isRecognizedLocation", { enumerable: true, get: function () { return matchLocationInfo_1.isRecognizedLocation; } });
42
+ Object.defineProperty(exports, "isRejectedLocationInfo", { enumerable: true, get: function () { return matchLocationInfo_1.isRejectedLocationInfo; } });
43
+ const matchDateTimeInfo_1 = require("./lib/checkTitleAndSnippetSearchability/matchDateTimeInfo");
38
44
  Object.defineProperty(exports, "matchDateTimeInfo", { enumerable: true, get: function () { return matchDateTimeInfo_1.matchDateTimeInfo; } });
39
- const matchSourceInfo_1 = require("./lib/recommendedText/matchSourceInfo");
45
+ Object.defineProperty(exports, "isRecognizedDateTimeInfo", { enumerable: true, get: function () { return matchDateTimeInfo_1.isRecognizedDateTimeInfo; } });
46
+ Object.defineProperty(exports, "isRejectedDateTimeInfo", { enumerable: true, get: function () { return matchDateTimeInfo_1.isRejectedDateTimeInfo; } });
47
+ const matchSourceInfo_1 = require("./lib/checkTitleAndSnippetSearchability/matchSourceInfo");
40
48
  Object.defineProperty(exports, "matchSourceInfo", { enumerable: true, get: function () { return matchSourceInfo_1.matchSourceInfo; } });
41
- const matchTopicInfo_1 = require("./lib/recommendedText/matchTopicInfo");
49
+ Object.defineProperty(exports, "isRecognizedSource", { enumerable: true, get: function () { return matchSourceInfo_1.isRecognizedSource; } });
50
+ Object.defineProperty(exports, "isRejectedSourceInfo", { enumerable: true, get: function () { return matchSourceInfo_1.isRejectedSourceInfo; } });
51
+ const matchTopicInfo_1 = require("./lib/checkTitleAndSnippetSearchability/matchTopicInfo");
42
52
  Object.defineProperty(exports, "matchTopicInfo", { enumerable: true, get: function () { return matchTopicInfo_1.matchTopicInfo; } });
53
+ Object.defineProperty(exports, "isRecognizedTopic", { enumerable: true, get: function () { return matchTopicInfo_1.isRecognizedTopic; } });
54
+ Object.defineProperty(exports, "isRejectedTopicInfo", { enumerable: true, get: function () { return matchTopicInfo_1.isRejectedTopicInfo; } });
55
+ const helpers_1 = require("./lib/checkTitleAndSnippetSearchability/helpers");
56
+ Object.defineProperty(exports, "isEligibleForCheckingTitleAndSnippetSearchability", { enumerable: true, get: function () { return helpers_1.isEligibleForCheckingTitleAndSnippetSearchability; } });
57
+ const isValidRegexPattern_1 = require("./lib/util/isValidRegexPattern");
58
+ Object.defineProperty(exports, "isValidRegexPattern", { enumerable: true, get: function () { return isValidRegexPattern_1.isValidRegexPattern; } });
59
+ const sanitizeTags_1 = require("./lib/util/sanitizeTags");
60
+ Object.defineProperty(exports, "sanitizeTags", { enumerable: true, get: function () { return sanitizeTags_1.sanitizeTags; } });
43
61
  const stringsConfig_1 = require("./lib/util/stringsConfig");
44
- Object.defineProperty(exports, "setStrings", { enumerable: true, get: function () { return stringsConfig_1.setStrings; } });
45
62
  Object.defineProperty(exports, "getStringsConfig", { enumerable: true, get: function () { return stringsConfig_1.getStringsConfig; } });
63
+ Object.defineProperty(exports, "getDefaultStringsConfig", { enumerable: true, get: function () { return stringsConfig_1.getDefaultStringsConfig; } });
64
+ const configureSettings_1 = require("./configureSettings");
65
+ Object.defineProperty(exports, "configureSettings", { enumerable: true, get: function () { return configureSettings_1.configureSettings; } });
66
+ const custom_terms_1 = require("./services/custom-terms");
67
+ Object.defineProperty(exports, "getSubmittedCustomTerms", { enumerable: true, get: function () { return custom_terms_1.getSubmittedCustomTerms; } });
68
+ Object.defineProperty(exports, "getMyCustomTerms", { enumerable: true, get: function () { return custom_terms_1.getMyCustomTerms; } });
69
+ Object.defineProperty(exports, "addCustomTerms2FeatureTable", { enumerable: true, get: function () { return custom_terms_1.addCustomTerms2FeatureTable; } });
70
+ Object.defineProperty(exports, "updateStatusOfCustomTermsInFeatureTable", { enumerable: true, get: function () { return custom_terms_1.updateStatusOfCustomTermsInFeatureTable; } });
71
+ Object.defineProperty(exports, "getCustomTermsFeatureTableItemInfo", { enumerable: true, get: function () { return custom_terms_1.getCustomTermsFeatureTableItemInfo; } });
72
+ const fetchAdditonalPatterns4TitleAndSnippetSearchability_1 = require("./services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability");
73
+ Object.defineProperty(exports, "fetchAdditonalPatterns4TitleAndSnippetSearchability", { enumerable: true, get: function () { return fetchAdditonalPatterns4TitleAndSnippetSearchability_1.fetchAdditonalPatterns4TitleAndSnippetSearchability; } });
74
+ const custom_terms_review_results_1 = require("./services/custom-terms-review-results");
75
+ Object.defineProperty(exports, "addReviewResults2FeatureTable", { enumerable: true, get: function () { return custom_terms_review_results_1.addReviewResults2FeatureTable; } });
76
+ Object.defineProperty(exports, "updateReviewResultsInFeatureTable", { enumerable: true, get: function () { return custom_terms_review_results_1.updateReviewResultsInFeatureTable; } });
77
+ Object.defineProperty(exports, "getPackagedReviewResults", { enumerable: true, get: function () { return custom_terms_review_results_1.getPackagedReviewResults; } });
78
+ Object.defineProperty(exports, "getReviewedReviewResults", { enumerable: true, get: function () { return custom_terms_review_results_1.getReviewedReviewResults; } });
79
+ Object.defineProperty(exports, "getUnarchivedReviewResults", { enumerable: true, get: function () { return custom_terms_review_results_1.getUnarchivedReviewResults; } });
80
+ Object.defineProperty(exports, "getDeployedReviewResults", { enumerable: true, get: function () { return custom_terms_review_results_1.getDeployedReviewResults; } });
81
+ Object.defineProperty(exports, "getReviewResultsByTermAndCategory", { enumerable: true, get: function () { return custom_terms_review_results_1.getReviewResultsByTermAndCategory; } });
82
+ Object.defineProperty(exports, "getCustomTermsReviewResultsFeatureTableItemInfo", { enumerable: true, get: function () { return custom_terms_review_results_1.getCustomTermsReviewResultsFeatureTableItemInfo; } });
83
+ const escapeSpecialCharacters_1 = require("./lib/util/escapeSpecialCharacters");
84
+ Object.defineProperty(exports, "escapeSpecialCharacters", { enumerable: true, get: function () { return escapeSpecialCharacters_1.escapeSpecialCharacters; } });
85
+ const fetchProfanitiesData_1 = require("./services/content-validator-assets/fetchProfanitiesData");
86
+ Object.defineProperty(exports, "fetchProfanitiesData", { enumerable: true, get: function () { return fetchProfanitiesData_1.fetchProfanitiesData; } });
87
+ const checkProfanities_1 = require("./lib/checkProfanities/checkProfanities");
88
+ Object.defineProperty(exports, "containsProfanity", { enumerable: true, get: function () { return checkProfanities_1.containsProfanity; } });
89
+ const getLivingAtlasSupportedItemTypes_1 = require("./lib/util/getLivingAtlasSupportedItemTypes");
90
+ Object.defineProperty(exports, "getLivingAtlasSupportedItemTypes", { enumerable: true, get: function () { return getLivingAtlasSupportedItemTypes_1.getLivingAtlasSupportedItemTypes; } });
91
+ Object.defineProperty(exports, "checkIsLivingAtlasSupportedItemType", { enumerable: true, get: function () { return getLivingAtlasSupportedItemTypes_1.checkIsLivingAtlasSupportedItemType; } });
46
92
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAWA,2DAAwD;AA4CpD,6FA5CK,2BAAY,OA4CL;AA3ChB,+FAA4F;AA4CxF,yGA5CK,mDAAwB,OA4CL;AA3C5B,6EAA0E;AA4CtE,mGA5CK,uCAAkB,OA4CL;AA3CtB,sEAAmE;AA4C/D,kGA5CK,qCAAiB,OA4CL;AA3CrB,6EAA0E;AA4CtE,mGA5CK,uCAAkB,OA4CL;AA3CtB,+DAA4D;AA4CxD,8FA5CK,6BAAa,OA4CL;AA3CjB,qDAAkD;AA4C9C,2FA5CK,uBAAU,OA4CL;AA3Cd,iEAA8D;AA4C1D,+FA5CK,+BAAc,OA4CL;AA3ClB,wDAAqD;AA4CjD,4FA5CK,yBAAW,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A;AANjC,yGAnEA,sDAAwB,OAmEA;AACxB,yGAnEA,sDAAwB,OAmEA;AACxB,2GAnEA,wDAA0B,OAmEA;AAC1B,yGAnEA,sDAAwB,OAmEA;AACxB,kHAnEA,+DAAiC,OAmEA;AAIjC,gIApEA,6EAA+C,OAoEA;AAjEnD,gFAA6E;AAqE/C,wGArErB,iDAAuB,OAqEqB;AApErD,mGAAgG;AAmD5F,qGAnDK,2CAAoB,OAmDL;AAlDxB,8EAA4E;AAgExE,kGAhEK,oCAAiB,OAgEL;AA/DrB,kGAGqD;AAqCjD,iHAvCA,mEAAgC,OAuCA;AAChC,oHAvCA,sEAAmC,OAuCA"}
@@ -24,13 +24,9 @@ const isValidAccessInformation = (item) => {
24
24
  const validAccessInformation = (0, assertString_1.assertString)(item.accessInformation) && !(0, isEmpty_1.isEmpty)(accessInformation);
25
25
  // issues
26
26
  const issues = {
27
- property: 'accessInformation',
27
+ // property: 'accessInformation',
28
28
  label: stringsConfig.accessInformation.LABEL,
29
29
  title: stringsConfig.accessInformation.TITLE,
30
- // maxScore: SCORING.EMPTY_STRING_SCORE + SCORING.EXIST_SCORE,
31
- // score: validAccessInformation
32
- // ? SCORING.EXIST_SCORE
33
- // : SCORING.EMPTY_STRING_SCORE,
34
30
  // the maxScore and score will be calculated afterward using weight and weight factor
35
31
  maxScore: 0,
36
32
  score: 0,
@@ -43,7 +39,9 @@ const isValidAccessInformation = (item) => {
43
39
  ],
44
40
  weight: scoringConfig_1.scoringConfig.weight,
45
41
  weightFactor: validAccessInformation ? weightFactors.EXIST_FACTOR : 0,
46
- critical: false,
42
+ // critical: false,
43
+ status: 'unknown',
44
+ isBinaryCheck: false,
47
45
  };
48
46
  return issues;
49
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"isValidAccessInformation.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/isValidAccessInformation.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,uDAAoD;AACpD,6CAA0C;AAG1C,yDAAyD;AACzD,mDAAgD;AAEhD;;;;;;;GAOG;AACI,MAAM,wBAAwB,GAAG,CAAC,IAAW,EAAkB,EAAE;IACpE,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;IAEnC,gEAAgE;IAChE,MAAM,aAAa,GAAG,6BAAa,CAAC,aAAa,CAAC,OAAO,CAAC;IAE1D,mBAAmB;IACnB,6DAA6D;IAE7D,MAAM,aAAa,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEzC,MAAM,sBAAsB,GACxB,IAAA,2BAAY,EAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAA,iBAAO,EAAC,iBAAiB,CAAC,CAAC;IAExE,SAAS;IACT,MAAM,MAAM,GAAmB;QAC3B,QAAQ,EAAE,mBAAmB;QAC7B,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,KAAK;QAC5C,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,KAAK;QAC5C,8DAA8D;QAC9D,gCAAgC;QAChC,4BAA4B;QAC5B,oCAAoC;QACpC,qFAAqF;QACrF,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,sBAAsB;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACI;oBACI,OAAO,EACH,aAAa,CAAC,iBAAiB,CAAC,oBAAoB;iBAC3D;aACJ;QACP,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,YAAY,EAAE,sBAAsB,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrE,QAAQ,EAAE,KAAK;KAClB,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAxCW,QAAA,wBAAwB,4BAwCnC"}
1
+ {"version":3,"file":"isValidAccessInformation.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/isValidAccessInformation.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,uDAAoD;AACpD,6CAA0C;AAG1C,yDAAyD;AACzD,mDAAgD;AAEhD;;;;;;;GAOG;AACI,MAAM,wBAAwB,GAAG,CAAC,IAAW,EAAkB,EAAE;IACpE,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC;IAEnC,gEAAgE;IAChE,MAAM,aAAa,GAAG,6BAAa,CAAC,aAAa,CAAC,OAAO,CAAC;IAE1D,mBAAmB;IACnB,6DAA6D;IAE7D,MAAM,aAAa,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEzC,MAAM,sBAAsB,GACxB,IAAA,2BAAY,EAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAA,iBAAO,EAAC,iBAAiB,CAAC,CAAC;IAExE,SAAS;IACT,MAAM,MAAM,GAAmB;QAC3B,iCAAiC;QACjC,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,KAAK;QAC5C,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,KAAK;QAC5C,qFAAqF;QACrF,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,sBAAsB;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACI;oBACI,OAAO,EACH,aAAa,CAAC,iBAAiB,CAAC,oBAAoB;iBAC3D;aACJ;QACP,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,YAAY,EAAE,sBAAsB,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrE,mBAAmB;QACnB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;KACvB,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAtCW,QAAA,wBAAwB,4BAsCnC"}
@@ -0,0 +1,7 @@
1
+ export declare const setProfanities: (profanities: string[]) => void;
2
+ /**
3
+ * Checks if the given text contains any profanities.
4
+ * @param text - The text to check for profanities.
5
+ * @returns boolean - True if the text contains profanities, false otherwise.
6
+ */
7
+ export declare const containsProfanity: (text: string) => boolean;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.containsProfanity = exports.setProfanities = void 0;
4
+ const createWordBoundaryRegex_1 = require("../util/createWordBoundaryRegex");
5
+ /**
6
+ * Regular expression to match profanities.
7
+ */
8
+ let profanitiesRegExp = null;
9
+ const setProfanities = (profanities) => {
10
+ profanitiesRegExp = (0, createWordBoundaryRegex_1.createWordBoundaryRegex)(profanities);
11
+ };
12
+ exports.setProfanities = setProfanities;
13
+ /**
14
+ * Checks if the given text contains any profanities.
15
+ * @param text - The text to check for profanities.
16
+ * @returns boolean - True if the text contains profanities, false otherwise.
17
+ */
18
+ const containsProfanity = (text) => {
19
+ if (!profanitiesRegExp) {
20
+ return false;
21
+ }
22
+ const matched = text.match(profanitiesRegExp);
23
+ return matched !== null && matched.length > 0;
24
+ };
25
+ exports.containsProfanity = containsProfanity;
26
+ //# sourceMappingURL=checkProfanities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkProfanities.js","sourceRoot":"","sources":["../../../src/lib/checkProfanities/checkProfanities.ts"],"names":[],"mappings":";;;AAAA,6EAA0E;AAE1E;;GAEG;AACH,IAAI,iBAAiB,GAAW,IAAI,CAAC;AAE9B,MAAM,cAAc,GAAG,CAAC,WAAqB,EAAE,EAAE;IACpD,iBAAiB,GAAG,IAAA,iDAAuB,EAAC,WAAW,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEF;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAW,EAAE;IACvD,IAAI,CAAC,iBAAiB,EAAE;QACpB,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE9C,OAAO,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
@@ -0,0 +1,34 @@
1
+ import { IItem, ValidationInfo } from '../../types';
2
+ type Options = {
3
+ /**
4
+ * Custom patterns for location information.
5
+ */
6
+ customPatternsForLocationInfo?: string[];
7
+ /**
8
+ * Custom patterns for data vintage information.
9
+ */
10
+ customPatternsForDataVintageInfo?: string[];
11
+ /**
12
+ * Custom patterns for source information.
13
+ */
14
+ customPatternsForSourceInfo?: string[];
15
+ /**
16
+ * Custom patterns for time information.
17
+ */
18
+ customPatternsForTopicInfo?: string[];
19
+ };
20
+ /**
21
+ * Check for required and recommended text in items' title and summary text to make sure they are search-friendly.
22
+ * We want Title and Summary to do a great job establishing the 4 key things: topic from a source for year and region.
23
+ *
24
+ * Title/summary text are required to state what the thing is, e.g. "Earthquakes" or "Public Health Dashboard"
25
+ * Title/summary text often benefit from having words like "Global" or "World" to indicate the area included.
26
+ * Title/summary text often benefit from having a source indicated (unless the source name is very long)
27
+ * Title/summary text often benefit from having a version, vintage or year indicated
28
+ *
29
+ *
30
+ * @see https://devtopia.esri.com/kenn4005/Curator_Suggestions/issues/9
31
+ *
32
+ */
33
+ export declare const checkTitleAndSnippetSearchability: (item: IItem, { customPatternsForLocationInfo, customPatternsForDataVintageInfo, customPatternsForSourceInfo, customPatternsForTopicInfo, }?: Options) => ValidationInfo;
34
+ export {};
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkRecommendedText = void 0;
6
+ exports.checkTitleAndSnippetSearchability = void 0;
4
7
  const stringsConfig_1 = require("../util/stringsConfig");
5
- const isLayer_1 = require("../util/isLayer");
6
- const getScoringRules_1 = require("../util/getScoringRules");
7
8
  const matchLocationInfo_1 = require("./matchLocationInfo");
8
9
  const matchDateTimeInfo_1 = require("./matchDateTimeInfo");
9
10
  const matchSourceInfo_1 = require("./matchSourceInfo");
10
11
  const matchTopicInfo_1 = require("./matchTopicInfo");
11
12
  const scoringConfig_1 = require("./scoringConfig");
12
- const shouldValidateByBetaRules_1 = require("../util/shouldValidateByBetaRules");
13
+ const sanitize_html_1 = __importDefault(require("sanitize-html"));
14
+ const helpers_1 = require("./helpers");
13
15
  /**
14
- * Check for required and recommended text in items' title and summary text.
16
+ * Check for required and recommended text in items' title and summary text to make sure they are search-friendly.
15
17
  * We want Title and Summary to do a great job establishing the 4 key things: topic from a source for year and region.
16
18
  *
17
19
  * Title/summary text are required to state what the thing is, e.g. "Earthquakes" or "Public Health Dashboard"
@@ -23,21 +25,17 @@ const shouldValidateByBetaRules_1 = require("../util/shouldValidateByBetaRules")
23
25
  * @see https://devtopia.esri.com/kenn4005/Curator_Suggestions/issues/9
24
26
  *
25
27
  */
26
- const checkRecommendedText = (item) => {
27
- const localeByCultreProperty = (0, getScoringRules_1.getScoringRulesLocale)(item.culture);
28
- const localeByItemOwner = (0, getScoringRules_1.getScoringRulesLocaleByItemOwner)(item.owner);
29
- const isEnglishedBased = localeByCultreProperty === 'en' && localeByItemOwner === 'en';
28
+ const checkTitleAndSnippetSearchability = (item, { customPatternsForLocationInfo, customPatternsForDataVintageInfo, customPatternsForSourceInfo, customPatternsForTopicInfo, } = {}) => {
29
+ // const localeByCultreProperty = getScoringRulesLocale(item.culture);
30
+ // const localeByItemOwner = getScoringRulesLocaleByItemOwner(item.owner);
31
+ // const isEnglishedBased =
32
+ // localeByCultreProperty === 'en' && localeByItemOwner === 'en';
30
33
  const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
31
34
  const weightFactors = scoringConfig_1.scoringConfig.weightFactors.DEFAULT;
32
- /**
33
- * Jim Herris has confirmed that we should only check the recommend text for items meeting the following criteria:
34
- * 1. The item is a layer
35
- * 2. The item is English-based
36
- * 3. The item is qualified for validation under beta rule (this is a temporary condition for the beta release of this rule)
37
- */
38
- const shouldCheckRecommendedText = (0, isLayer_1.isLayer)(item) && isEnglishedBased && (0, shouldValidateByBetaRules_1.shouldValidateByBetaRules)(item);
35
+ const shouldCheckRecommendedText = (0, helpers_1.isEligibleForCheckingTitleAndSnippetSearchability)(item);
36
+ // isLayer(item) && isEnglishedBased && shouldValidateByBetaRules(item);
39
37
  const validationResult = {
40
- property: 'recommendedTextInTitleAndSummary',
38
+ // property: 'recommendedTextInTitleAndSummary',
41
39
  label: stringsConfig.recommendedTextInTitleAndSummary.LABEL,
42
40
  title: stringsConfig.recommendedTextInTitleAndSummary.TITLE,
43
41
  maxScore: 0,
@@ -45,17 +43,45 @@ const checkRecommendedText = (item) => {
45
43
  messages: [],
46
44
  weight: scoringConfig_1.scoringConfig.weight,
47
45
  weightFactor: 0,
48
- critical: true,
46
+ // critical: true,
47
+ // the status will be updated afterward based on the validation result
48
+ status: 'unknown',
49
+ isBinaryCheck: false,
49
50
  };
50
51
  // Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
51
52
  // if the recommended text does not need to be checked.
52
53
  if (shouldCheckRecommendedText === false) {
53
- return Object.assign(Object.assign({}, validationResult), { weight: 0, critical: false });
54
+ return Object.assign(Object.assign({}, validationResult), { weight: 0 });
54
55
  }
55
- const matchedLocationInfo = (0, matchLocationInfo_1.matchLocationInfo)(item);
56
- const matchedTimeInfo = (0, matchDateTimeInfo_1.matchDateTimeInfo)(item);
57
- const matchedSourceInfo = (0, matchSourceInfo_1.matchSourceInfo)(item);
58
- const matchedTopicInfo = (0, matchTopicInfo_1.matchTopicInfo)(item);
56
+ // item.title = item.title
57
+ // ? sanitizeHtml(item.title, {
58
+ // allowedTags: [],
59
+ // })
60
+ // : '';
61
+ // item.snippet = item.snippet
62
+ // ? sanitizeHtml(item.snippet, {
63
+ // allowedTags: [],
64
+ // })
65
+ // : '';
66
+ // create a copy of the item to avoid mutating the original item
67
+ // sanitize the title and snippet to remove any HTML tags
68
+ // that might impact the matching results
69
+ const copyOfItem = {
70
+ title: item.title
71
+ ? (0, sanitize_html_1.default)(item.title, {
72
+ allowedTags: [],
73
+ })
74
+ : '',
75
+ snippet: item.snippet
76
+ ? (0, sanitize_html_1.default)(item.snippet, {
77
+ allowedTags: [],
78
+ })
79
+ : '',
80
+ };
81
+ const matchedLocationInfo = (0, matchLocationInfo_1.matchLocationInfo)(copyOfItem, customPatternsForLocationInfo);
82
+ const matchedTimeInfo = (0, matchDateTimeInfo_1.matchDateTimeInfo)(copyOfItem, customPatternsForDataVintageInfo);
83
+ const matchedSourceInfo = (0, matchSourceInfo_1.matchSourceInfo)(copyOfItem, customPatternsForSourceInfo);
84
+ const matchedTopicInfo = (0, matchTopicInfo_1.matchTopicInfo)(copyOfItem, customPatternsForTopicInfo);
59
85
  if (!matchedLocationInfo.length) {
60
86
  validationResult.messages.push({
61
87
  message: stringsConfig.recommendedTextInTitleAndSummary
@@ -91,5 +117,5 @@ const checkRecommendedText = (item) => {
91
117
  }
92
118
  return validationResult;
93
119
  };
94
- exports.checkRecommendedText = checkRecommendedText;
95
- //# sourceMappingURL=checkRecommendedText.js.map
120
+ exports.checkTitleAndSnippetSearchability = checkTitleAndSnippetSearchability;
121
+ //# sourceMappingURL=checkTitleAndSnippetSearchability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkTitleAndSnippetSearchability.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.ts"],"names":[],"mappings":";;;;;;AAGA,yDAAyD;AAEzD,2DAAwD;AACxD,2DAAwD;AACxD,uDAAoD;AACpD,qDAAkD;AAClD,mDAAgD;AAEhD,kEAAyC;AACzC,uCAGmB;AAqBnB;;;;;;;;;;;;GAYG;AACI,MAAM,iCAAiC,GAAG,CAC7C,IAAW,EACX,EACI,6BAA6B,EAC7B,gCAAgC,EAChC,2BAA2B,EAC3B,0BAA0B,MACjB,EAAE,EACD,EAAE;IAChB,sEAAsE;IAEtE,0EAA0E;IAE1E,2BAA2B;IAC3B,qEAAqE;IAErE,MAAM,aAAa,GAAG,IAAA,gCAAgB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C,CAAC;AApIW,QAAA,iCAAiC,qCAoI5C"}
@@ -0,0 +1,97 @@
1
+ type SetAdditionalMatchingPatternsParams = {
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
+ * A boolean indicating whether to avoid using word boundaries (useful for languages like Chinese and Japanese).
76
+ */
77
+ shouldAvoidUsingWordBoundary: boolean;
78
+ };
79
+ /**
80
+ * Sets additional patterns for checking title and snippet searchability rules.
81
+ *
82
+ * These patterns supplement the default ones and help match titles and snippets more effectively.
83
+ * They may include multilingual patterns or user-suggested patterns from the nomination app.
84
+ *
85
+ * @param {SetExtraMatchingPatternsParams} params - The parameters for setting extra matching patterns.
86
+ * @param {string[]} params.matchingPatternsLocation - Additional matching patterns for location. (e.g. `["New York", "Los Angeles"]`)
87
+ * @param {string[]} params.rejectedPatternsLocation - Additional rejected patterns for location. (e.g. `["Unknown", "Unknown Location"]`)
88
+ * @param {string[]} params.matchingPatternsSource - Additional matching patterns for source. (e.g. `["NOAA", "Department of Energy"]`)
89
+ * @param {string[]} params.rejectedPatternsSource - Additional rejected patterns for source. (e.g. `["Unknown", "Unknown Source"]`)
90
+ * @param {string[]} params.matchingPatternsTopic - Additional matching patterns for topic. (e.g. `["Climate Change", "Renewable Energy"]`)
91
+ * @param {string[]} params.rejectedPatternsTopic - Additional rejected patterns for topic. (e.g. `["Unknown", "Unknown Topic"]`)
92
+ * @param {string[]} params.matchingPatternsYearVintage - Additional matching patterns for year vintage. (e.g. `["bi-weekly", "monthly"]`)
93
+ * @param {string[]} params.rejectedPatternsYearVintage - Additional rejected patterns for year vintage. (e.g. `["Unknown", "Unknown Year Vintage"]`)
94
+ * @param {boolean} params.shouldAvoidUsingWordBoundary - Flag to indicate whether to avoid using word boundaries.
95
+ */
96
+ export declare const setAdditionalPatternsForTitleAndSnippetSearchability: ({ matchingPatternsLocation, rejectedPatternsLocation, matchingPatternsSource, rejectedPatternsSource, matchingPatternsTopic, rejectedPatternsTopic, matchingPatternsYearVintage, rejectedPatternsYearVintage, shouldAvoidUsingWordBoundary, }: SetAdditionalMatchingPatternsParams) => void;
97
+ export {};
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setAdditionalPatternsForTitleAndSnippetSearchability = void 0;
4
+ const matchDateTimeInfo_1 = require("./matchDateTimeInfo");
5
+ const matchLocationInfo_1 = require("./matchLocationInfo");
6
+ const matchSourceInfo_1 = require("./matchSourceInfo");
7
+ const matchTopicInfo_1 = require("./matchTopicInfo");
8
+ /**
9
+ * Sets additional patterns for checking title and snippet searchability rules.
10
+ *
11
+ * These patterns supplement the default ones and help match titles and snippets more effectively.
12
+ * They may include multilingual patterns or user-suggested patterns from the nomination app.
13
+ *
14
+ * @param {SetExtraMatchingPatternsParams} params - The parameters for setting extra matching patterns.
15
+ * @param {string[]} params.matchingPatternsLocation - Additional matching patterns for location. (e.g. `["New York", "Los Angeles"]`)
16
+ * @param {string[]} params.rejectedPatternsLocation - Additional rejected patterns for location. (e.g. `["Unknown", "Unknown Location"]`)
17
+ * @param {string[]} params.matchingPatternsSource - Additional matching patterns for source. (e.g. `["NOAA", "Department of Energy"]`)
18
+ * @param {string[]} params.rejectedPatternsSource - Additional rejected patterns for source. (e.g. `["Unknown", "Unknown Source"]`)
19
+ * @param {string[]} params.matchingPatternsTopic - Additional matching patterns for topic. (e.g. `["Climate Change", "Renewable Energy"]`)
20
+ * @param {string[]} params.rejectedPatternsTopic - Additional rejected patterns for topic. (e.g. `["Unknown", "Unknown Topic"]`)
21
+ * @param {string[]} params.matchingPatternsYearVintage - Additional matching patterns for year vintage. (e.g. `["bi-weekly", "monthly"]`)
22
+ * @param {string[]} params.rejectedPatternsYearVintage - Additional rejected patterns for year vintage. (e.g. `["Unknown", "Unknown Year Vintage"]`)
23
+ * @param {boolean} params.shouldAvoidUsingWordBoundary - Flag to indicate whether to avoid using word boundaries.
24
+ */
25
+ const setAdditionalPatternsForTitleAndSnippetSearchability = ({ matchingPatternsLocation, rejectedPatternsLocation, matchingPatternsSource, rejectedPatternsSource, matchingPatternsTopic, rejectedPatternsTopic, matchingPatternsYearVintage, rejectedPatternsYearVintage, shouldAvoidUsingWordBoundary, }) => {
26
+ matchingPatternsLocation = matchingPatternsLocation || [];
27
+ rejectedPatternsLocation = rejectedPatternsLocation || [];
28
+ matchingPatternsSource = matchingPatternsSource || [];
29
+ rejectedPatternsSource = rejectedPatternsSource || [];
30
+ matchingPatternsTopic = matchingPatternsTopic || [];
31
+ rejectedPatternsTopic = rejectedPatternsTopic || [];
32
+ matchingPatternsYearVintage = matchingPatternsYearVintage || [];
33
+ rejectedPatternsYearVintage = rejectedPatternsYearVintage || [];
34
+ shouldAvoidUsingWordBoundary = shouldAvoidUsingWordBoundary || false;
35
+ (0, matchDateTimeInfo_1.setExtraDateTimeInfoMatchingPatterns)(matchingPatternsYearVintage, rejectedPatternsYearVintage, shouldAvoidUsingWordBoundary);
36
+ (0, matchLocationInfo_1.setExtraMatchingPatternsForLocations)(matchingPatternsLocation, rejectedPatternsLocation, shouldAvoidUsingWordBoundary);
37
+ (0, matchSourceInfo_1.setExtraMatchingPatternsForSources)(matchingPatternsSource, rejectedPatternsSource, shouldAvoidUsingWordBoundary);
38
+ (0, matchTopicInfo_1.setExtraMatchingPatternsForTopics)(matchingPatternsTopic, rejectedPatternsTopic, shouldAvoidUsingWordBoundary);
39
+ };
40
+ exports.setAdditionalPatternsForTitleAndSnippetSearchability = setAdditionalPatternsForTitleAndSnippetSearchability;
41
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/checkTitleAndSnippetSearchability/config.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;AAC3E,2DAA2E;AAC3E,uDAAuE;AACvE,qDAAqE;AAiFrE;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,oDAAoD,GAAG,CAAC,EACjE,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,GACM,EAAE,EAAE;IACtC,wBAAwB,GAAG,wBAAwB,IAAI,EAAE,CAAC;IAC1D,wBAAwB,GAAG,wBAAwB,IAAI,EAAE,CAAC;IAC1D,sBAAsB,GAAG,sBAAsB,IAAI,EAAE,CAAC;IACtD,sBAAsB,GAAG,sBAAsB,IAAI,EAAE,CAAC;IACtD,qBAAqB,GAAG,qBAAqB,IAAI,EAAE,CAAC;IACpD,qBAAqB,GAAG,qBAAqB,IAAI,EAAE,CAAC;IACpD,2BAA2B,GAAG,2BAA2B,IAAI,EAAE,CAAC;IAChE,2BAA2B,GAAG,2BAA2B,IAAI,EAAE,CAAC;IAChE,4BAA4B,GAAG,4BAA4B,IAAI,KAAK,CAAC;IAErE,IAAA,wDAAoC,EAChC,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,CAC/B,CAAC;IAEF,IAAA,wDAAoC,EAChC,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,CAC/B,CAAC;IAEF,IAAA,oDAAkC,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,CAC/B,CAAC;IAEF,IAAA,kDAAiC,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,CAC/B,CAAC;AACN,CAAC,CAAC;AA5CW,QAAA,oDAAoD,wDA4C/D"}