@vannizhang/living-atlas-content-validator 1.5.19-beta.0 → 1.5.19-beta.11

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 (192) hide show
  1. package/README.md +401 -61
  2. package/dist/configureSettings.js.map +1 -1
  3. package/dist/index.d.ts +9 -3
  4. package/dist/index.js +14 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/accessInformation/isValidAccessInformation.js +6 -9
  7. package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
  8. package/dist/lib/accessInformation/scoringConfig.d.ts +1 -1
  9. package/dist/lib/accessInformation/scoringConfig.js +1 -1
  10. package/dist/lib/accessInformation/scoringConfig.js.map +1 -1
  11. package/dist/lib/checkProfanities/checkProfanities.js.map +1 -1
  12. package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js +7 -7
  13. package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -1
  14. package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +1 -1
  15. package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +3 -2
  16. package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -1
  17. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +6 -9
  18. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
  19. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -1
  20. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -1
  21. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -1
  22. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.d.ts +1 -1
  23. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js +1 -1
  24. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -1
  25. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +8 -8
  26. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
  27. package/dist/lib/deleteProtection/scoringConfig.d.ts +1 -1
  28. package/dist/lib/deleteProtection/scoringConfig.js +1 -1
  29. package/dist/lib/deleteProtection/scoringConfig.js.map +1 -1
  30. package/dist/lib/deprecated/isDeprecated.js +8 -9
  31. package/dist/lib/deprecated/isDeprecated.js.map +1 -1
  32. package/dist/lib/deprecated/scoringConfig.d.ts +1 -1
  33. package/dist/lib/deprecated/scoringConfig.js +1 -1
  34. package/dist/lib/deprecated/scoringConfig.js.map +1 -1
  35. package/dist/lib/description/findDataSource.js.map +1 -1
  36. package/dist/lib/description/isValidDescription.js +23 -41
  37. package/dist/lib/description/isValidDescription.js.map +1 -1
  38. package/dist/lib/description/scoringConfig.d.ts +1 -1
  39. package/dist/lib/description/scoringConfig.js +1 -1
  40. package/dist/lib/description/scoringConfig.js.map +1 -1
  41. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +26 -0
  42. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +95 -0
  43. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -0
  44. package/dist/lib/featureServiceFieldAliases/scoringConfig.d.ts +8 -0
  45. package/dist/lib/featureServiceFieldAliases/scoringConfig.js +13 -0
  46. package/dist/lib/featureServiceFieldAliases/scoringConfig.js.map +1 -0
  47. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +25 -0
  48. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +107 -0
  49. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -0
  50. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.d.ts +8 -0
  51. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +13 -0
  52. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js.map +1 -0
  53. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +22 -0
  54. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +90 -0
  55. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -0
  56. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.d.ts +8 -0
  57. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +13 -0
  58. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js.map +1 -0
  59. package/dist/lib/licenseInfo/isValidLicenseInfo.js +16 -23
  60. package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
  61. package/dist/lib/licenseInfo/scoringConfig.d.ts +1 -1
  62. package/dist/lib/licenseInfo/scoringConfig.js +1 -1
  63. package/dist/lib/licenseInfo/scoringConfig.js.map +1 -1
  64. package/dist/lib/sharing/isValidAccess.js +13 -14
  65. package/dist/lib/sharing/isValidAccess.js.map +1 -1
  66. package/dist/lib/sharing/scoringConfig.d.ts +1 -1
  67. package/dist/lib/sharing/scoringConfig.js +1 -1
  68. package/dist/lib/sharing/scoringConfig.js.map +1 -1
  69. package/dist/lib/ssl/isValidSSL.js +12 -12
  70. package/dist/lib/ssl/isValidSSL.js.map +1 -1
  71. package/dist/lib/ssl/scoringConfig.d.ts +1 -1
  72. package/dist/lib/ssl/scoringConfig.js +1 -1
  73. package/dist/lib/ssl/scoringConfig.js.map +1 -1
  74. package/dist/lib/summary/isValidSummary.js +32 -31
  75. package/dist/lib/summary/isValidSummary.js.map +1 -1
  76. package/dist/lib/summary/scoringConfig.d.ts +1 -1
  77. package/dist/lib/summary/scoringConfig.js +1 -1
  78. package/dist/lib/summary/scoringConfig.js.map +1 -1
  79. package/dist/lib/tags/isValidTags.js +15 -21
  80. package/dist/lib/tags/isValidTags.js.map +1 -1
  81. package/dist/lib/tags/scoringConfig.d.ts +1 -1
  82. package/dist/lib/tags/scoringConfig.js +1 -1
  83. package/dist/lib/tags/scoringConfig.js.map +1 -1
  84. package/dist/lib/thumbnail/isValidThumbnail.js +16 -34
  85. package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
  86. package/dist/lib/thumbnail/scoringConfig.d.ts +1 -1
  87. package/dist/lib/thumbnail/scoringConfig.js +1 -1
  88. package/dist/lib/thumbnail/scoringConfig.js.map +1 -1
  89. package/dist/lib/title/isValidTitle.js +34 -34
  90. package/dist/lib/title/isValidTitle.js.map +1 -1
  91. package/dist/lib/title/scoringConfig.d.ts +1 -1
  92. package/dist/lib/title/scoringConfig.js +1 -1
  93. package/dist/lib/title/scoringConfig.js.map +1 -1
  94. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +31 -32
  95. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
  96. package/dist/lib/userProfileDescription/scoringConfig.d.ts +1 -1
  97. package/dist/lib/userProfileDescription/scoringConfig.js +1 -1
  98. package/dist/lib/userProfileDescription/scoringConfig.js.map +1 -1
  99. package/dist/lib/userProfileName/isValidUserProfileName.js +14 -14
  100. package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
  101. package/dist/lib/userProfileName/scoringConfig.d.ts +1 -1
  102. package/dist/lib/userProfileName/scoringConfig.js +1 -1
  103. package/dist/lib/userProfileName/scoringConfig.js.map +1 -1
  104. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +10 -10
  105. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
  106. package/dist/lib/userProfileThumbnail/scoringConfig.d.ts +1 -1
  107. package/dist/lib/userProfileThumbnail/scoringConfig.js +1 -1
  108. package/dist/lib/userProfileThumbnail/scoringConfig.js.map +1 -1
  109. package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -1
  110. package/dist/lib/util/countSentences.js.map +1 -1
  111. package/dist/lib/util/createWordBoundaryRegex.js.map +1 -1
  112. package/dist/lib/util/escapeSpecialCharacters.js.map +1 -1
  113. package/dist/lib/util/getAllValidationRuleIds.d.ts +6 -0
  114. package/dist/lib/util/getAllValidationRuleIds.js +13 -0
  115. package/dist/lib/util/getAllValidationRuleIds.js.map +1 -0
  116. package/dist/lib/util/getFeatureLayerFieldValueTypes.d.ts +10 -0
  117. package/dist/lib/util/getFeatureLayerFieldValueTypes.js +17 -0
  118. package/dist/lib/util/getFeatureLayerFieldValueTypes.js.map +1 -0
  119. package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -1
  120. package/dist/lib/util/getNumberOfWords.js.map +1 -1
  121. package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +13 -0
  122. package/dist/lib/util/getRelevantFeatureLayerFields.js +55 -0
  123. package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -0
  124. package/dist/lib/util/getScoringRules.js.map +1 -1
  125. package/dist/lib/util/getThumbnailFileName.js.map +1 -1
  126. package/dist/lib/util/isArcGISDomain.js.map +1 -1
  127. package/dist/lib/util/isEmpty.js.map +1 -1
  128. package/dist/lib/util/isFeatureCollection.js +1 -1
  129. package/dist/lib/util/isFeatureCollection.js.map +1 -1
  130. package/dist/lib/util/isFeatureService.d.ts +8 -0
  131. package/dist/lib/util/isFeatureService.js +21 -0
  132. package/dist/lib/util/isFeatureService.js.map +1 -0
  133. package/dist/lib/util/isHosted.js.map +1 -1
  134. package/dist/lib/util/isSecureProtocol.js.map +1 -1
  135. package/dist/lib/util/isUppercase.js.map +1 -1
  136. package/dist/lib/util/isUrl.js.map +1 -1
  137. package/dist/lib/util/isValidRegexPattern.js.map +1 -1
  138. package/dist/lib/util/matches.js.map +1 -1
  139. package/dist/lib/util/round.js +1 -2
  140. package/dist/lib/util/round.js.map +1 -1
  141. package/dist/lib/util/sanitizeTags.js.map +1 -1
  142. package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
  143. package/dist/lib/util/toString.js.map +1 -1
  144. package/dist/lib/validate/validate.d.ts +7 -2
  145. package/dist/lib/validate/validate.js +10 -1
  146. package/dist/lib/validate/validate.js.map +1 -1
  147. package/dist/lib/validate/validateHelpers.js +2 -2
  148. package/dist/lib/validate/validateHelpers.js.map +1 -1
  149. package/dist/locale/de.json +30 -0
  150. package/dist/locale/en.json +30 -0
  151. package/dist/locale/es.json +30 -0
  152. package/dist/locale/fr.json +30 -0
  153. package/dist/locale/ja.json +30 -0
  154. package/dist/locale/pt-br.json +30 -0
  155. package/dist/package-info.json +1 -1
  156. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +1 -1
  157. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -1
  158. package/dist/services/content-validator-assets/fetchProfanitiesData.js +1 -1
  159. package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -1
  160. package/dist/services/content-validator-assets/helpers.js.map +1 -1
  161. package/dist/services/custom-terms/config.js +1 -1
  162. package/dist/services/custom-terms/config.js.map +1 -1
  163. package/dist/services/custom-terms/customTerms.js +10 -10
  164. package/dist/services/custom-terms/customTerms.js.map +1 -1
  165. package/dist/services/custom-terms/helpers.js.map +1 -1
  166. package/dist/services/custom-terms-review-results/config.js +1 -1
  167. package/dist/services/custom-terms-review-results/config.js.map +1 -1
  168. package/dist/services/custom-terms-review-results/customTermsReviewResults.js +4 -4
  169. package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -1
  170. package/dist/services/custom-terms-review-results/helpers.js.map +1 -1
  171. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +9 -0
  172. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +52 -0
  173. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -0
  174. package/dist/services/feature-service/getFeatureServerURL.d.ts +12 -0
  175. package/dist/services/feature-service/getFeatureServerURL.js +29 -0
  176. package/dist/services/feature-service/getFeatureServerURL.js.map +1 -0
  177. package/dist/services/shared/addFeatures.js +4 -4
  178. package/dist/services/shared/addFeatures.js.map +1 -1
  179. package/dist/services/shared/applyEdits.js +4 -4
  180. package/dist/services/shared/applyEdits.js.map +1 -1
  181. package/dist/services/shared/getItemInfo.js +1 -1
  182. package/dist/services/shared/getItemInfo.js.map +1 -1
  183. package/dist/types/index.d.ts +196 -29
  184. package/dist/types/index.js +44 -0
  185. package/dist/types/index.js.map +1 -1
  186. package/package.json +8 -7
  187. package/dist/lib/accessInformation/scoringRulesConfig.d.ts +0 -0
  188. package/dist/lib/accessInformation/scoringRulesConfig.js +0 -36
  189. package/dist/lib/accessInformation/scoringRulesConfig.js.map +0 -1
  190. package/dist/lib/layers/scoringRulesConfig.d.ts +0 -0
  191. package/dist/lib/layers/scoringRulesConfig.js +0 -48
  192. package/dist/lib/layers/scoringRulesConfig.js.map +0 -1
@@ -35,36 +35,30 @@ const isValidDescription = (item) => {
35
35
  // const isLayer = checkIsLayer(item);
36
36
  // scoring rules locale
37
37
  const locale = (0, getScoringRules_1.getScoringRulesLocale)(item.culture);
38
- let weightFactors = scoringConfig_1.scoringConfig.weightFactors.DEFAULT;
38
+ let scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
39
39
  // locale === 'en'
40
- // ? scoringConfig.weightFactors.DEFAULT
41
- // : scoringConfig.weightFactors.INTERNATIONAL;
40
+ // ? scoringConfig.scoringFactors.DEFAULT
41
+ // : scoringConfig.scoringFactors.INTERNATIONAL;
42
42
  if (locale !== 'en') {
43
- // for non-english items, use the International weight factors
44
- weightFactors = scoringConfig_1.scoringConfig.weightFactors.INTERNATIONAL;
43
+ // for non-english items, use the International scoring factors
44
+ scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.INTERNATIONAL;
45
45
  }
46
46
  // else if (isLayer) {
47
- // // for Layers, use the Layers weight factors
48
- // weightFactors = scoringConfig.weightFactors.LAYERS;
47
+ // // for Layers, use the Layers scoring factors
48
+ // scoringFactors = scoringConfig.scoringFactors.LAYERS;
49
49
  // }
50
50
  // // scoring rules
51
51
  // const SCORING = getScoringRules(item, scoringRulesConfig);
52
52
  const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
53
- const issues = {
54
- // property: 'description',
53
+ const validationOutput = {
54
+ validationRuleId: 'item-description',
55
55
  label: stringsConfig.description.LABEL,
56
56
  title: stringsConfig.description.TITLE,
57
- // maxScore:
58
- // SCORING.EMPTY_STRING_SCORE +
59
- // SCORING.MUST_EXIST_SCORE +
60
- // SCORING.MIN_LENGTH_SCORE +
61
- // SCORING.HAS_LINK_SCORE,
62
- // score: SCORING.EMPTY_STRING_SCORE,
63
57
  maxScore: 0,
64
58
  score: 0,
65
59
  messages: [],
66
60
  weight: scoringConfig_1.scoringConfig.weight,
67
- weightFactor: 0,
61
+ scoringFactor: 0,
68
62
  // critical: true,
69
63
  // the status will be updated afterward based on the validation result
70
64
  status: 'unknown',
@@ -84,53 +78,41 @@ const isValidDescription = (item) => {
84
78
  if (!(0, assertString_1.assertString)(description) ||
85
79
  (0, isEmpty_1.isEmpty)(description) ||
86
80
  (0, isEmpty_1.isEmpty)(sanitizedStr)) {
87
- issues.label = stringsConfig.description.EMPTY_STRING_MESSAGE;
88
- // issues.score = SCORING.EMPTY_STRING_SCORE;
89
- issues.messages.push({
81
+ validationOutput.label = stringsConfig.description.EMPTY_STRING_MESSAGE;
82
+ // validationOutput.score = SCORING.EMPTY_STRING_SCORE;
83
+ validationOutput.messages.push({
90
84
  // code: stringsConfig.description.EMPTY_STRING_CODE,
91
85
  message: stringsConfig.description.EMPTY_STRING_MESSAGE,
92
86
  });
93
- return issues;
87
+ return validationOutput;
94
88
  }
95
- // issues.score = SCORING.MUST_EXIST_SCORE;
96
- issues.weightFactor += weightFactors.MUST_EXIST_FACTOR;
89
+ // validationOutput.score = SCORING.MUST_EXIST_SCORE;
90
+ validationOutput.scoringFactor += scoringFactors.MUST_EXIST_FACTOR;
97
91
  // The search() method searches a string for a specified value, and returns the position of the match.
98
92
  // The search value can be string or a regular expression.
99
93
  // This method returns -1 if no match is found.
100
94
  if (description.search('href') < 0) {
101
- issues.messages.push({
95
+ validationOutput.messages.push({
102
96
  // code: stringsConfig.description.CONTAINS_LINKS_CODE,
103
97
  message: stringsConfig.description.CONTAINS_LINKS_MESSAGE,
104
98
  });
105
99
  }
106
100
  else {
107
- // issues.score += SCORING.HAS_LINK_SCORE;
108
- issues.weightFactor += weightFactors.HAS_LINK_FACTOR;
101
+ // validationOutput.score += SCORING.HAS_LINK_SCORE;
102
+ validationOutput.scoringFactor += scoringFactors.HAS_LINK_FACTOR;
109
103
  }
110
104
  // For non-international items, check if description contains 48 or more words
111
105
  if (locale === 'en' && (0, getNumberOfWords_1.getNumberOfWords)(description) <= 48) {
112
- issues.messages.push({
106
+ validationOutput.messages.push({
113
107
  // code: stringsConfig.description.MINIMUM_WORD_COUNT_CODE,
114
108
  message: stringsConfig.description.MINIMUM_WORD_COUNT_MESSAGE,
115
109
  });
116
110
  }
117
111
  else {
118
- // issues.score += SCORING.MIN_LENGTH_SCORE;
119
- issues.weightFactor += weightFactors.MIN_LENGTH_FACTOR;
112
+ // validationOutput.score += SCORING.MIN_LENGTH_SCORE;
113
+ validationOutput.scoringFactor += scoringFactors.MIN_LENGTH_FACTOR;
120
114
  }
121
- // // For non-internation items that are also Layers, we need to check if the description
122
- // // contains the key word similar to "data source"
123
- // if (shouldCheckDataSource && containsDataSource(description) === false) {
124
- // issues.messages.push({
125
- // message: stringsConfig.description.CONTAINS_SOURCE_MESSAGE,
126
- // });
127
- // } else {
128
- // issues.weightFactor += weightFactors.HAS_SOURCE;
129
- // }
130
- // if (locale === 'international') {
131
- // issues.critical = false;
132
- // }
133
- return issues;
115
+ return validationOutput;
134
116
  };
135
117
  exports.isValidDescription = isValidDescription;
136
118
  //# sourceMappingURL=isValidDescription.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValidDescription.js","sourceRoot":"","sources":["../../../src/lib/description/isValidDescription.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AACzC,yDAAyD;AACzD,uDAAoD;AACpD,+DAA4D;AAC5D,6CAA0C;AAC1C,6DAGiC;AAEjC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U;IACV,WAAW;IACX,uDAAuD;IACvD,IAAI;IAEJ,oCAAoC;IACpC,+BAA+B;IAC/B,IAAI;IAEJ,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAvHW,QAAA,kBAAkB,sBAuH7B"}
1
+ {"version":3,"file":"isValidDescription.js","sourceRoot":"","sources":["../../../src/lib/description/isValidDescription.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AACzC,yDAAyD;AACzD,uDAAoD;AACpD,+DAA4D;AAC5D,6CAA0C;AAC1C,6DAGiC;AAEjC,yDAAyD;AACzD,mDAAgD;AAIhD;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,kBAAkB,GAAG,CAAC,IAAW,EAAkB,EAAE;IAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE7B,8CAA8C;IAC9C,sCAAsC;IAEtC,uBAAuB;IACvB,MAAM,MAAM,GAAG,IAAA,uCAAqB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEnD,IAAI,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAC1D,kBAAkB;IAClB,6CAA6C;IAC7C,oDAAoD;IAEpD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClB,+DAA+D;QAC/D,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,aAAa,CAAC;IAChE,CAAC;IACD,sBAAsB;IACtB,oDAAoD;IACpD,4DAA4D;IAC5D,IAAI;IAEJ,mBAAmB;IACnB,6DAA6D;IAE7D,MAAM,aAAa,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEzC,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,kBAAkB;QACpC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK;QACtC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK;QACtC,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EA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AAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC;QACzD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,2DAA2D;YAC3D,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,0BAA0B;SAChE,CAAC,CAAC;IACP,CAAC;SAAM,CAAC;QACJ,sDAAsD;QACtD,gBAAgB,CAAC,aAAa,IAAI,cAAc,CAAC,iBAAiB,CAAC;IACvE,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAnGW,QAAA,kBAAkB,sBAmG7B"}
@@ -1,6 +1,6 @@
1
1
  export declare const scoringConfig: {
2
2
  weight: number;
3
- weightFactors: {
3
+ scoringFactors: {
4
4
  DEFAULT: {
5
5
  MUST_EXIST_FACTOR: number;
6
6
  MIN_LENGTH_FACTOR: number;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.scoringConfig = void 0;
5
5
  exports.scoringConfig = {
6
6
  weight: 8,
7
- weightFactors: {
7
+ scoringFactors: {
8
8
  DEFAULT: {
9
9
  MUST_EXIST_FACTOR: 0.125,
10
10
  MIN_LENGTH_FACTOR: 0.625,
@@ -1 +1 @@
1
- {"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/description/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,aAAa,EAAE;QACX,OAAO,EAAE;YACL,iBAAiB,EAAE,KAAK;YACxB,iBAAiB,EAAE,KAAK;YACxB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,CAAC;SAChB;QACD,MAAM,EAAE;YACJ,iBAAiB,EAAE,KAAK;YACxB,iBAAiB,EAAE,KAAK;YACxB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,IAAI;SACnB;QACD,aAAa,EAAE;YACX,iBAAiB,EAAE,IAAI;YACvB,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,CAAC;SAChB;KACJ;CACJ,CAAC"}
1
+ {"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/description/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,iBAAiB,EAAE,KAAK;YACxB,iBAAiB,EAAE,KAAK;YACxB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,CAAC;SAChB;QACD,MAAM,EAAE;YACJ,iBAAiB,EAAE,KAAK;YACxB,iBAAiB,EAAE,KAAK;YACxB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,IAAI;SACnB;QACD,aAAa,EAAE;YACX,iBAAiB,EAAE,IAAI;YACvB,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,CAAC;SAChB;KACJ;CACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
2
+ /**
3
+ * requires 90% of field aliases to be present to receive a full score
4
+ */
5
+ export declare const FIELD_ALIASES_REQUIRED_PERCENT = 0.9;
6
+ /**
7
+ * Validates that feature layer fields have appropriate aliases.
8
+ *
9
+ * This function checks if the given item is a feature service and evaluates the presence of field aliases
10
+ * for relevant fields within the provided feature layers.
11
+ *
12
+ * It returns a `ValidationInfo` object containing the validation result, messages, and scoring information.
13
+ *
14
+ * The scoring logic is as follows:
15
+ * - If the item is not a feature layer, the rule does not contribute to the final score.
16
+ * - If there are no feature layers, a message is added and the result is returned.
17
+ * - If there are no relevant fields to check, the rule receives full score.
18
+ * - If none of the relevant fields have aliases, a message is added to prompt adding aliases.
19
+ * - If less than 80% of relevant fields have aliases, a message is added to prompt improvement and half score is given.
20
+ * - If at least 80% of relevant fields have aliases, the rule receives full score.
21
+ *
22
+ * @param item - The item to validate, typically representing a feature layer item.
23
+ * @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field aliases.
24
+ * @returns A `ValidationInfo` object containing the validation result, messages, and scoring.
25
+ */
26
+ export declare const checkFeatureServiceFieldAliases: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkFeatureServiceFieldAliases = exports.FIELD_ALIASES_REQUIRED_PERCENT = void 0;
4
+ const getRelevantFeatureLayerFields_1 = require("../util/getRelevantFeatureLayerFields");
5
+ const isFeatureService_1 = require("../util/isFeatureService");
6
+ const stringsConfig_1 = require("../util/stringsConfig");
7
+ const scoringConfig_1 = require("./scoringConfig");
8
+ /**
9
+ * requires 90% of field aliases to be present to receive a full score
10
+ */
11
+ exports.FIELD_ALIASES_REQUIRED_PERCENT = 0.9;
12
+ /**
13
+ * Validates that feature layer fields have appropriate aliases.
14
+ *
15
+ * This function checks if the given item is a feature service and evaluates the presence of field aliases
16
+ * for relevant fields within the provided feature layers.
17
+ *
18
+ * It returns a `ValidationInfo` object containing the validation result, messages, and scoring information.
19
+ *
20
+ * The scoring logic is as follows:
21
+ * - If the item is not a feature layer, the rule does not contribute to the final score.
22
+ * - If there are no feature layers, a message is added and the result is returned.
23
+ * - If there are no relevant fields to check, the rule receives full score.
24
+ * - If none of the relevant fields have aliases, a message is added to prompt adding aliases.
25
+ * - If less than 80% of relevant fields have aliases, a message is added to prompt improvement and half score is given.
26
+ * - If at least 80% of relevant fields have aliases, the rule receives full score.
27
+ *
28
+ * @param item - The item to validate, typically representing a feature layer item.
29
+ * @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field aliases.
30
+ * @returns A `ValidationInfo` object containing the validation result, messages, and scoring.
31
+ */
32
+ const checkFeatureServiceFieldAliases = (item, featureLayers) => {
33
+ const strings = (0, stringsConfig_1.getStringsConfig)();
34
+ const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
35
+ const validationResult = {
36
+ validationRuleId: 'feature-service-field-aliases',
37
+ label: strings.featureLayerFieldAliases.LABEL,
38
+ title: strings.featureLayerFieldAliases.TITLE,
39
+ maxScore: 0,
40
+ score: 0,
41
+ messages: [],
42
+ weight: scoringConfig_1.scoringConfig.weight,
43
+ scoringFactor: 0,
44
+ status: 'unknown',
45
+ isBinaryCheck: false,
46
+ };
47
+ // Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
48
+ // if the item is not a feature layer.
49
+ if (!(0, isFeatureService_1.isFeatureService)(item)) {
50
+ return Object.assign(Object.assign({}, validationResult), { weight: 0 });
51
+ }
52
+ if (!Array.isArray(featureLayers) || (featureLayers === null || featureLayers === void 0 ? void 0 : featureLayers.length) === 0) {
53
+ validationResult.messages.push({
54
+ message: strings.featureLayerFieldAliases.NO_FEATURE_LAYER,
55
+ });
56
+ return validationResult;
57
+ }
58
+ const relevantFields = (0, getRelevantFeatureLayerFields_1.getRelevantFeatureLayerFields)(featureLayers || []);
59
+ if (relevantFields.length === 0) {
60
+ validationResult.messages.push({
61
+ message: strings.featureLayerFieldDescriptions.NO_RELEVANT_FIELD,
62
+ });
63
+ return validationResult;
64
+ }
65
+ // get the count of fields with aliases
66
+ const countOfFieldsWithAlias = relevantFields.filter((field) => {
67
+ const alias = field.alias ? field.alias.trim().toLowerCase() : '';
68
+ return alias && alias !== field.name.toLowerCase();
69
+ }).length;
70
+ const percentWithAlias = countOfFieldsWithAlias / relevantFields.length;
71
+ // if percentWithAlias is 0, then there are no fields with aliases
72
+ // it should receive a score of 0 and a message to add field aliases
73
+ if (percentWithAlias === 0) {
74
+ validationResult.messages.push({
75
+ message: strings.featureLayerFieldAliases.ADD_FIELD_ALIAS,
76
+ });
77
+ return validationResult;
78
+ }
79
+ // if percentWithAlias is less than 0.9, then there are some fields with aliases
80
+ // it should receive half of score and a message to improve field aliases
81
+ if (percentWithAlias < exports.FIELD_ALIASES_REQUIRED_PERCENT) {
82
+ validationResult.messages.push({
83
+ message: strings.featureLayerFieldAliases.IMPROVE_FIELD_ALIAS,
84
+ });
85
+ validationResult.scoringFactor =
86
+ scoringFactors.CONTAINS_FIELD_ALIASES / 2;
87
+ return validationResult;
88
+ }
89
+ // if percentWithAlias is greater than 0.8, then there are most fields with aliases
90
+ // it should receive full score
91
+ validationResult.scoringFactor = 1;
92
+ return validationResult;
93
+ };
94
+ exports.checkFeatureServiceFieldAliases = checkFeatureServiceFieldAliases;
95
+ //# sourceMappingURL=checkFeatureServiceFieldAliases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkFeatureServiceFieldAliases.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,mDAAgD;AAEhD;;GAEG;AACU,QAAA,8BAA8B,GAAG,GAAG,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,+BAA+B,GAAG,CAC3C,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,+BAA+B;QACjD,KAAK,EAAE,OAAO,CAAC,wBAAwB,CAAC,KAAK;QAC7C,KAAK,EAAE,OAAO,CAAC,wBAAwB,CAAC,KAAK;QAC7C,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;KACvB,CAAC;IAEF,uGAAuG;IACvG,sCAAsC;IACtC,IAAI,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC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CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,gFAAgF;IAChF,yEAAyE;IACzE,IAAI,gBAAgB,GAAG,sCAA8B,EAAE,CAAC;QACpD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,mBAAmB;SAChE,CAAC,CAAC;QACH,gBAAgB,CAAC,aAAa;YAC1B,cAAc,CAAC,sBAAsB,GAAG,CAAC,CAAC;QAC9C,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,mFAAmF;IACnF,+BAA+B;IAC/B,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AA/EW,QAAA,+BAA+B,mCA+E1C"}
@@ -0,0 +1,8 @@
1
+ export declare const scoringConfig: {
2
+ weight: number;
3
+ scoringFactors: {
4
+ DEFAULT: {
5
+ CONTAINS_FIELD_ALIASES: number;
6
+ };
7
+ };
8
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // import { ScoringConfig } from '../../types';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.scoringConfig = void 0;
5
+ exports.scoringConfig = {
6
+ weight: 8,
7
+ scoringFactors: {
8
+ DEFAULT: {
9
+ CONTAINS_FIELD_ALIASES: 1,
10
+ },
11
+ },
12
+ };
13
+ //# sourceMappingURL=scoringConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldAliases/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,sBAAsB,EAAE,CAAC;SAC5B;KACJ;CACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
2
+ /**
3
+ * requires 90% of field descriptions to be present to receive a full score
4
+ */
5
+ export declare const FIELD_DESCRIPTIONS_REQUIRED_PERCENT = 0.9;
6
+ /**
7
+ * Validates that relevant fields in the provided feature layers have descriptions.
8
+ *
9
+ * This function checks if the given item is a feature service and evaluates the presence of field descriptions
10
+ * for relevant fields within the provided feature layers. It returns a `ValidationInfo` object containing
11
+ * the validation result, score, messages, and scoring factors based on the percentage of fields with descriptions.
12
+ *
13
+ * Scoring logic:
14
+ * - If the item is not a feature layer, the rule does not contribute to the final score.
15
+ * - If there are no feature layers, a message is added and the result is returned.
16
+ * - If there are no relevant fields, full score is given.
17
+ * - If no relevant fields have descriptions, a message is added and score is zero.
18
+ * - If less than 80% of relevant fields have descriptions, a message is added and half score is given.
19
+ * - If at least 80% of relevant fields have descriptions, full score is given.
20
+ *
21
+ * @param item - The item to validate, expected to be a feature layer item.
22
+ * @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field descriptions.
23
+ * @returns A `ValidationInfo` object containing the validation result, score, messages, and scoring factors.
24
+ */
25
+ export declare const checkFeatureServiceFieldDescriptions: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkFeatureServiceFieldDescriptions = exports.FIELD_DESCRIPTIONS_REQUIRED_PERCENT = void 0;
4
+ const getRelevantFeatureLayerFields_1 = require("../util/getRelevantFeatureLayerFields");
5
+ const isFeatureService_1 = require("../util/isFeatureService");
6
+ const stringsConfig_1 = require("../util/stringsConfig");
7
+ const scoringConfig_1 = require("./scoringConfig");
8
+ /**
9
+ * requires 90% of field descriptions to be present to receive a full score
10
+ */
11
+ exports.FIELD_DESCRIPTIONS_REQUIRED_PERCENT = 0.9;
12
+ /**
13
+ * Validates that relevant fields in the provided feature layers have descriptions.
14
+ *
15
+ * This function checks if the given item is a feature service and evaluates the presence of field descriptions
16
+ * for relevant fields within the provided feature layers. It returns a `ValidationInfo` object containing
17
+ * the validation result, score, messages, and scoring factors based on the percentage of fields with descriptions.
18
+ *
19
+ * Scoring logic:
20
+ * - If the item is not a feature layer, the rule does not contribute to the final score.
21
+ * - If there are no feature layers, a message is added and the result is returned.
22
+ * - If there are no relevant fields, full score is given.
23
+ * - If no relevant fields have descriptions, a message is added and score is zero.
24
+ * - If less than 80% of relevant fields have descriptions, a message is added and half score is given.
25
+ * - If at least 80% of relevant fields have descriptions, full score is given.
26
+ *
27
+ * @param item - The item to validate, expected to be a feature layer item.
28
+ * @param featureLayers - An array of JSON objects representing the feature layers published to this feature service to check for field descriptions.
29
+ * @returns A `ValidationInfo` object containing the validation result, score, messages, and scoring factors.
30
+ */
31
+ const checkFeatureServiceFieldDescriptions = (item, featureLayers) => {
32
+ const strings = (0, stringsConfig_1.getStringsConfig)();
33
+ const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
34
+ const validationResult = {
35
+ validationRuleId: 'feature-service-field-descriptions',
36
+ label: strings.featureLayerFieldDescriptions.LABEL,
37
+ title: strings.featureLayerFieldDescriptions.TITLE,
38
+ maxScore: 0,
39
+ score: 0,
40
+ messages: [],
41
+ weight: scoringConfig_1.scoringConfig.weight,
42
+ scoringFactor: 0,
43
+ status: 'unknown',
44
+ isBinaryCheck: false,
45
+ };
46
+ // Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
47
+ // if the item is not a feature layer.
48
+ if (!(0, isFeatureService_1.isFeatureService)(item)) {
49
+ return Object.assign(Object.assign({}, validationResult), { weight: 0 });
50
+ }
51
+ if (!Array.isArray(featureLayers) || !featureLayers.length) {
52
+ validationResult.messages.push({
53
+ message: strings.featureLayerFieldDescriptions.NO_FEATURE_LAYER,
54
+ });
55
+ return validationResult;
56
+ }
57
+ const relevantFields = (0, getRelevantFeatureLayerFields_1.getRelevantFeatureLayerFields)(featureLayers || []);
58
+ // should receive 0 score since there is no relevant field found.
59
+ // Checked with Jim Herris and he said that he'd rather see this as a 0 score
60
+ // so that the user can see that there are no relevant fields
61
+ if (relevantFields.length === 0) {
62
+ validationResult.messages.push({
63
+ message: strings.featureLayerFieldDescriptions.NO_RELEVANT_FIELD,
64
+ });
65
+ return validationResult;
66
+ }
67
+ // get the count of fields with descriptions provided
68
+ const countOfFieldsWithDescription = relevantFields
69
+ .filter((field) => field.description)
70
+ .filter((field) => {
71
+ var _a, _b;
72
+ const value = ((_a = field.description) === null || _a === void 0 ? void 0 : _a.value)
73
+ ? (_b = field.description) === null || _b === void 0 ? void 0 : _b.value.trim().toLowerCase()
74
+ : '';
75
+ const fieldAlias = field.alias
76
+ ? field.alias.trim().toLowerCase()
77
+ : '';
78
+ return (value &&
79
+ value !== field.name.toLowerCase() &&
80
+ value !== fieldAlias);
81
+ }).length;
82
+ const percentWithDescription = countOfFieldsWithDescription / relevantFields.length;
83
+ // if percentWithDescription is 0, then there are no fields with aliases
84
+ // it should receive a score of 0 and a message to add field aliases
85
+ if (percentWithDescription === 0) {
86
+ validationResult.messages.push({
87
+ message: strings.featureLayerFieldDescriptions.ADD_FIELD_DESCRIPTION,
88
+ });
89
+ return validationResult;
90
+ }
91
+ // if percentWithDescription is less than 0.9, then there are some fields with aliases
92
+ // it should receive half of score and a message to improve field aliases
93
+ if (percentWithDescription < exports.FIELD_DESCRIPTIONS_REQUIRED_PERCENT) {
94
+ validationResult.messages.push({
95
+ message: strings.featureLayerFieldDescriptions.IMRPOVE_FIELD_DESCRIPTION,
96
+ });
97
+ validationResult.scoringFactor =
98
+ scoringFactors.CONTAINS_FIELD_DESCRIPTIONS / 2;
99
+ return validationResult;
100
+ }
101
+ // if percentWithDescription is greater than 0.8, then there are most fields with aliases
102
+ // it should receive full score
103
+ validationResult.scoringFactor = 1;
104
+ return validationResult;
105
+ };
106
+ exports.checkFeatureServiceFieldDescriptions = checkFeatureServiceFieldDescriptions;
107
+ //# sourceMappingURL=checkFeatureServiceFieldDescriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkFeatureServiceFieldDescriptions.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,mDAAgD;AAEhD;;GAEG;AACU,QAAA,mCAAmC,GAAG,GAAG,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,oCAAoC,GAAG,CAChD,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,oCAAoC;QACtD,KAAK,EAAE,OAAO,CAAC,6BAA6B,CAAC,KAAK;QAClD,KAAK,EAAE,OAAO,CAAC,6BAA6B,CAAC,KAAK;QAClD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,6BAAa,CAAC,MAAM;QAC5B,aAAa,EAAE,CAAC;QAChB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;KACvB,CAAC;IAEF,uGAAuG;IACvG,sCAAsC;IACtC,IAAI,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,uCACO,gBAAgB,KACnB,MAAM,EAAE,CAAC,IACX;IACN,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QACzD,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,6BAA6B,CAAC,gBAAgB;SAClE,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,6DAA6B,EAAC,aAAa,IAA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AAyE;IACzE,IAAI,sBAAsB,GAAG,2CAAmC,EAAE,CAAC;QAC/D,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EACH,OAAO,CAAC,6BAA6B,CAAC,yBAAyB;SACtE,CAAC,CAAC;QACH,gBAAgB,CAAC,aAAa;YAC1B,cAAc,CAAC,2BAA2B,GAAG,CAAC,CAAC;QACnD,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,yFAAyF;IACzF,+BAA+B;IAC/B,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAlGW,QAAA,oCAAoC,wCAkG/C"}
@@ -0,0 +1,8 @@
1
+ export declare const scoringConfig: {
2
+ weight: number;
3
+ scoringFactors: {
4
+ DEFAULT: {
5
+ CONTAINS_FIELD_DESCRIPTIONS: number;
6
+ };
7
+ };
8
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // import { ScoringConfig } from '../../types';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.scoringConfig = void 0;
5
+ exports.scoringConfig = {
6
+ weight: 8,
7
+ scoringFactors: {
8
+ DEFAULT: {
9
+ CONTAINS_FIELD_DESCRIPTIONS: 1,
10
+ },
11
+ },
12
+ };
13
+ //# sourceMappingURL=scoringConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldDescriptions/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,2BAA2B,EAAE,CAAC;SACjC;KACJ;CACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { FeatureLayerJSON, IItem, ValidationInfo } from '../../types';
2
+ /**
3
+ * requires 90% of field value types to be present to receive a full score
4
+ */
5
+ export declare const FIELD_VALUE_TYPES_REQUIRED_PERCENT = 0.9;
6
+ /**
7
+ * Validates the presence and completeness of `fieldValueType` descriptions for relevant fields
8
+ * in the provided feature layers of an ArcGIS item. The validation assigns a scoring factor based
9
+ * on the proportion of relevant fields that have a `fieldValueType` defined in their field description.
10
+ *
11
+ * - If the item is not a feature layer, the rule is skipped (weight 0).
12
+ * - If there are no feature layers, a message is added and the rule is considered incomplete.
13
+ * - If there are no relevant fields to check, the rule is considered fully satisfied.
14
+ * - If none of the relevant fields have a `fieldValueType`, a message is added and the score is 0.
15
+ * - If less than 80% of relevant fields have a `fieldValueType`, a message is added and the score is halved.
16
+ * - If at least 80% of relevant fields have a `fieldValueType`, the rule is considered fully satisfied.
17
+ *
18
+ * @param item - The ArcGIS item to validate.
19
+ * @param featureLayers - The feature layers associated with the item.
20
+ * @returns ValidationInfo object containing the validation result, messages, and scoring factor.
21
+ */
22
+ export declare const checkFeatureServiceFieldValueTypes: (item: IItem, featureLayers: FeatureLayerJSON[]) => ValidationInfo;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkFeatureServiceFieldValueTypes = exports.FIELD_VALUE_TYPES_REQUIRED_PERCENT = void 0;
4
+ const getRelevantFeatureLayerFields_1 = require("../util/getRelevantFeatureLayerFields");
5
+ const isFeatureService_1 = require("../util/isFeatureService");
6
+ const stringsConfig_1 = require("../util/stringsConfig");
7
+ const scoringConfig_1 = require("./scoringConfig");
8
+ /**
9
+ * requires 90% of field value types to be present to receive a full score
10
+ */
11
+ exports.FIELD_VALUE_TYPES_REQUIRED_PERCENT = 0.9;
12
+ /**
13
+ * Validates the presence and completeness of `fieldValueType` descriptions for relevant fields
14
+ * in the provided feature layers of an ArcGIS item. The validation assigns a scoring factor based
15
+ * on the proportion of relevant fields that have a `fieldValueType` defined in their field description.
16
+ *
17
+ * - If the item is not a feature layer, the rule is skipped (weight 0).
18
+ * - If there are no feature layers, a message is added and the rule is considered incomplete.
19
+ * - If there are no relevant fields to check, the rule is considered fully satisfied.
20
+ * - If none of the relevant fields have a `fieldValueType`, a message is added and the score is 0.
21
+ * - If less than 80% of relevant fields have a `fieldValueType`, a message is added and the score is halved.
22
+ * - If at least 80% of relevant fields have a `fieldValueType`, the rule is considered fully satisfied.
23
+ *
24
+ * @param item - The ArcGIS item to validate.
25
+ * @param featureLayers - The feature layers associated with the item.
26
+ * @returns ValidationInfo object containing the validation result, messages, and scoring factor.
27
+ */
28
+ const checkFeatureServiceFieldValueTypes = (item, featureLayers) => {
29
+ const strings = (0, stringsConfig_1.getStringsConfig)();
30
+ const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
31
+ const validationResult = {
32
+ validationRuleId: 'feature-service-field-value-types',
33
+ label: strings.featureLayerFieldTypes.LABEL,
34
+ title: strings.featureLayerFieldTypes.TITLE,
35
+ maxScore: 0,
36
+ score: 0,
37
+ messages: [],
38
+ weight: scoringConfig_1.scoringConfig.weight,
39
+ scoringFactor: 0,
40
+ status: 'unknown',
41
+ isBinaryCheck: false,
42
+ };
43
+ // Return the validationResult with a weight of 0 (so this rule does not contribute to the final score)
44
+ // if the item is not a feature layer.
45
+ if (!(0, isFeatureService_1.isFeatureService)(item)) {
46
+ return Object.assign(Object.assign({}, validationResult), { weight: 0 });
47
+ }
48
+ if (!Array.isArray(featureLayers) || !featureLayers.length) {
49
+ validationResult.messages.push({
50
+ message: strings.featureLayerFieldTypes.NO_FEATURE_LAYER,
51
+ });
52
+ return validationResult;
53
+ }
54
+ const relevantFields = (0, getRelevantFeatureLayerFields_1.getRelevantFeatureLayerFields)(featureLayers || []);
55
+ if (relevantFields.length === 0) {
56
+ validationResult.messages.push({
57
+ message: strings.featureLayerFieldDescriptions.NO_RELEVANT_FIELD,
58
+ });
59
+ return validationResult;
60
+ }
61
+ // get the count of fields with descriptions provided
62
+ const countOfFieldsWithValueType = relevantFields
63
+ .filter((field) => field.description)
64
+ .filter((field) => { var _a; return (_a = field.description) === null || _a === void 0 ? void 0 : _a.fieldValueType; }).length;
65
+ const percentWithValueType = countOfFieldsWithValueType / relevantFields.length;
66
+ // if percentWithValueType is 0, then there are no fields with aliases
67
+ // it should receive a score of 0 and a message to add field aliases
68
+ if (percentWithValueType === 0) {
69
+ validationResult.messages.push({
70
+ message: strings.featureLayerFieldTypes.ADD_FIELD_TYPE,
71
+ });
72
+ return validationResult;
73
+ }
74
+ // if percentWithValueType is less than 0.9, then there are some fields with aliases
75
+ // it should receive half of score and a message to improve field aliases
76
+ if (percentWithValueType < exports.FIELD_VALUE_TYPES_REQUIRED_PERCENT) {
77
+ validationResult.messages.push({
78
+ message: strings.featureLayerFieldTypes.IMRPOVE_FIELD_TYPE,
79
+ });
80
+ validationResult.scoringFactor =
81
+ scoringFactors.CONTAINS_FIELD_VALUE_TYPES / 2;
82
+ return validationResult;
83
+ }
84
+ // if percentWithValueType is greater than 0.8, then there are most fields with aliases
85
+ // it should receive full score
86
+ validationResult.scoringFactor = 1;
87
+ return validationResult;
88
+ };
89
+ exports.checkFeatureServiceFieldValueTypes = checkFeatureServiceFieldValueTypes;
90
+ //# sourceMappingURL=checkFeatureServiceFieldValueTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkFeatureServiceFieldValueTypes.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.ts"],"names":[],"mappings":";;;AACA,yFAAsF;AACtF,+DAA4D;AAC5D,yDAAyD;AACzD,mDAAgD;AAEhD;;GAEG;AACU,QAAA,kCAAkC,GAAG,GAAG,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACI,MAAM,kCAAkC,GAAG,CAC9C,IAAW,EACX,aAAiC,EACnB,EAAE;IAChB,MAAM,OAAO,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,E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CAAC,MAAM,CAAC;IAEjE,MAAM,oBAAoB,GACtB,0BAA0B,GAAG,cAAc,CAAC,MAAM,CAAC;IAEvD,sEAAsE;IACtE,oEAAoE;IACpE,IAAI,oBAAoB,KAAK,CAAC,EAAE,CAAC;QAC7B,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,sBAAsB,CAAC,cAAc;SACzD,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,oFAAoF;IACpF,yEAAyE;IACzE,IAAI,oBAAoB,GAAG,0CAAkC,EAAE,CAAC;QAC5D,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3B,OAAO,EAAE,OAAO,CAAC,sBAAsB,CAAC,kBAAkB;SAC7D,CAAC,CAAC;QACH,gBAAgB,CAAC,aAAa;YAC1B,cAAc,CAAC,0BAA0B,GAAG,CAAC,CAAC;QAClD,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED,uFAAuF;IACvF,+BAA+B;IAC/B,gBAAgB,CAAC,aAAa,GAAG,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AA/EW,QAAA,kCAAkC,sCA+E7C"}
@@ -0,0 +1,8 @@
1
+ export declare const scoringConfig: {
2
+ weight: number;
3
+ scoringFactors: {
4
+ DEFAULT: {
5
+ CONTAINS_FIELD_VALUE_TYPES: number;
6
+ };
7
+ };
8
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // import { ScoringConfig } from '../../types';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.scoringConfig = void 0;
5
+ exports.scoringConfig = {
6
+ weight: 8,
7
+ scoringFactors: {
8
+ DEFAULT: {
9
+ CONTAINS_FIELD_VALUE_TYPES: 1,
10
+ },
11
+ },
12
+ };
13
+ //# sourceMappingURL=scoringConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/featureServiceFieldValueTypes/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,0BAA0B,EAAE,CAAC;SAChC;KACJ;CACJ,CAAC"}