@vannizhang/living-atlas-content-validator 1.5.19-beta.2 → 1.5.19-beta.4

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 (183) hide show
  1. package/README.md +338 -55
  2. package/dist/configureSettings.js.map +1 -1
  3. package/dist/index.d.ts +7 -3
  4. package/dist/index.js +10 -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.js.map +1 -1
  15. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
  16. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -1
  17. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -1
  18. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -1
  19. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.d.ts +1 -1
  20. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js +1 -1
  21. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -1
  22. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +8 -8
  23. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
  24. package/dist/lib/deleteProtection/scoringConfig.d.ts +1 -1
  25. package/dist/lib/deleteProtection/scoringConfig.js +1 -1
  26. package/dist/lib/deleteProtection/scoringConfig.js.map +1 -1
  27. package/dist/lib/deprecated/isDeprecated.js +8 -9
  28. package/dist/lib/deprecated/isDeprecated.js.map +1 -1
  29. package/dist/lib/deprecated/scoringConfig.d.ts +1 -1
  30. package/dist/lib/deprecated/scoringConfig.js +1 -1
  31. package/dist/lib/deprecated/scoringConfig.js.map +1 -1
  32. package/dist/lib/description/findDataSource.js.map +1 -1
  33. package/dist/lib/description/isValidDescription.js +23 -41
  34. package/dist/lib/description/isValidDescription.js.map +1 -1
  35. package/dist/lib/description/scoringConfig.d.ts +1 -1
  36. package/dist/lib/description/scoringConfig.js +1 -1
  37. package/dist/lib/description/scoringConfig.js.map +1 -1
  38. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +22 -0
  39. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +87 -0
  40. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -0
  41. package/dist/lib/featureServiceFieldAliases/scoringConfig.d.ts +8 -0
  42. package/dist/lib/featureServiceFieldAliases/scoringConfig.js +13 -0
  43. package/dist/lib/featureServiceFieldAliases/scoringConfig.js.map +1 -0
  44. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +21 -0
  45. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +89 -0
  46. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -0
  47. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.d.ts +8 -0
  48. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +13 -0
  49. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js.map +1 -0
  50. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +18 -0
  51. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +86 -0
  52. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -0
  53. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.d.ts +8 -0
  54. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +13 -0
  55. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js.map +1 -0
  56. package/dist/lib/licenseInfo/isValidLicenseInfo.js +16 -23
  57. package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
  58. package/dist/lib/licenseInfo/scoringConfig.d.ts +1 -1
  59. package/dist/lib/licenseInfo/scoringConfig.js +1 -1
  60. package/dist/lib/licenseInfo/scoringConfig.js.map +1 -1
  61. package/dist/lib/sharing/isValidAccess.js +13 -14
  62. package/dist/lib/sharing/isValidAccess.js.map +1 -1
  63. package/dist/lib/sharing/scoringConfig.d.ts +1 -1
  64. package/dist/lib/sharing/scoringConfig.js +1 -1
  65. package/dist/lib/sharing/scoringConfig.js.map +1 -1
  66. package/dist/lib/ssl/isValidSSL.js +12 -12
  67. package/dist/lib/ssl/isValidSSL.js.map +1 -1
  68. package/dist/lib/ssl/scoringConfig.d.ts +1 -1
  69. package/dist/lib/ssl/scoringConfig.js +1 -1
  70. package/dist/lib/ssl/scoringConfig.js.map +1 -1
  71. package/dist/lib/summary/isValidSummary.js +32 -31
  72. package/dist/lib/summary/isValidSummary.js.map +1 -1
  73. package/dist/lib/summary/scoringConfig.d.ts +1 -1
  74. package/dist/lib/summary/scoringConfig.js +1 -1
  75. package/dist/lib/summary/scoringConfig.js.map +1 -1
  76. package/dist/lib/tags/isValidTags.js +15 -21
  77. package/dist/lib/tags/isValidTags.js.map +1 -1
  78. package/dist/lib/tags/scoringConfig.d.ts +1 -1
  79. package/dist/lib/tags/scoringConfig.js +1 -1
  80. package/dist/lib/tags/scoringConfig.js.map +1 -1
  81. package/dist/lib/thumbnail/isValidThumbnail.js +16 -34
  82. package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
  83. package/dist/lib/thumbnail/scoringConfig.d.ts +1 -1
  84. package/dist/lib/thumbnail/scoringConfig.js +1 -1
  85. package/dist/lib/thumbnail/scoringConfig.js.map +1 -1
  86. package/dist/lib/title/isValidTitle.js +34 -34
  87. package/dist/lib/title/isValidTitle.js.map +1 -1
  88. package/dist/lib/title/scoringConfig.d.ts +1 -1
  89. package/dist/lib/title/scoringConfig.js +1 -1
  90. package/dist/lib/title/scoringConfig.js.map +1 -1
  91. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +31 -32
  92. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
  93. package/dist/lib/userProfileDescription/scoringConfig.d.ts +1 -1
  94. package/dist/lib/userProfileDescription/scoringConfig.js +1 -1
  95. package/dist/lib/userProfileDescription/scoringConfig.js.map +1 -1
  96. package/dist/lib/userProfileName/isValidUserProfileName.js +14 -14
  97. package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
  98. package/dist/lib/userProfileName/scoringConfig.d.ts +1 -1
  99. package/dist/lib/userProfileName/scoringConfig.js +1 -1
  100. package/dist/lib/userProfileName/scoringConfig.js.map +1 -1
  101. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +10 -10
  102. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
  103. package/dist/lib/userProfileThumbnail/scoringConfig.d.ts +1 -1
  104. package/dist/lib/userProfileThumbnail/scoringConfig.js +1 -1
  105. package/dist/lib/userProfileThumbnail/scoringConfig.js.map +1 -1
  106. package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -1
  107. package/dist/lib/util/countSentences.js.map +1 -1
  108. package/dist/lib/util/createWordBoundaryRegex.js.map +1 -1
  109. package/dist/lib/util/escapeSpecialCharacters.js.map +1 -1
  110. package/dist/lib/util/getAllValidationRuleIds.d.ts +6 -0
  111. package/dist/lib/util/getAllValidationRuleIds.js +13 -0
  112. package/dist/lib/util/getAllValidationRuleIds.js.map +1 -0
  113. package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -1
  114. package/dist/lib/util/getNumberOfWords.js.map +1 -1
  115. package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +13 -0
  116. package/dist/lib/util/getRelevantFeatureLayerFields.js +55 -0
  117. package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -0
  118. package/dist/lib/util/getScoringRules.js.map +1 -1
  119. package/dist/lib/util/getThumbnailFileName.js.map +1 -1
  120. package/dist/lib/util/isArcGISDomain.js.map +1 -1
  121. package/dist/lib/util/isEmpty.js.map +1 -1
  122. package/dist/lib/util/isFeatureCollection.js +1 -1
  123. package/dist/lib/util/isFeatureCollection.js.map +1 -1
  124. package/dist/lib/util/isFeatureService.d.ts +8 -0
  125. package/dist/lib/util/isFeatureService.js +21 -0
  126. package/dist/lib/util/isFeatureService.js.map +1 -0
  127. package/dist/lib/util/isHosted.js.map +1 -1
  128. package/dist/lib/util/isSecureProtocol.js.map +1 -1
  129. package/dist/lib/util/isUppercase.js.map +1 -1
  130. package/dist/lib/util/isUrl.js.map +1 -1
  131. package/dist/lib/util/isValidRegexPattern.js.map +1 -1
  132. package/dist/lib/util/matches.js.map +1 -1
  133. package/dist/lib/util/round.js +1 -2
  134. package/dist/lib/util/round.js.map +1 -1
  135. package/dist/lib/util/sanitizeTags.js.map +1 -1
  136. package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
  137. package/dist/lib/util/toString.js.map +1 -1
  138. package/dist/lib/validate/validate.d.ts +7 -2
  139. package/dist/lib/validate/validate.js +10 -1
  140. package/dist/lib/validate/validate.js.map +1 -1
  141. package/dist/lib/validate/validateHelpers.js +2 -2
  142. package/dist/lib/validate/validateHelpers.js.map +1 -1
  143. package/dist/locale/de.json +27 -0
  144. package/dist/locale/en.json +27 -0
  145. package/dist/locale/es.json +27 -0
  146. package/dist/locale/fr.json +27 -0
  147. package/dist/locale/ja.json +27 -0
  148. package/dist/locale/pt-br.json +27 -0
  149. package/dist/package-info.json +1 -1
  150. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +1 -1
  151. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -1
  152. package/dist/services/content-validator-assets/fetchProfanitiesData.js +1 -1
  153. package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -1
  154. package/dist/services/content-validator-assets/helpers.js.map +1 -1
  155. package/dist/services/custom-terms/config.js +1 -1
  156. package/dist/services/custom-terms/config.js.map +1 -1
  157. package/dist/services/custom-terms/customTerms.js +10 -10
  158. package/dist/services/custom-terms/customTerms.js.map +1 -1
  159. package/dist/services/custom-terms/helpers.js.map +1 -1
  160. package/dist/services/custom-terms-review-results/config.js +1 -1
  161. package/dist/services/custom-terms-review-results/config.js.map +1 -1
  162. package/dist/services/custom-terms-review-results/customTermsReviewResults.js +4 -4
  163. package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -1
  164. package/dist/services/custom-terms-review-results/helpers.js.map +1 -1
  165. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +9 -0
  166. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +49 -0
  167. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -0
  168. package/dist/services/shared/addFeatures.js +4 -4
  169. package/dist/services/shared/addFeatures.js.map +1 -1
  170. package/dist/services/shared/applyEdits.js +4 -4
  171. package/dist/services/shared/applyEdits.js.map +1 -1
  172. package/dist/services/shared/getItemInfo.js +1 -1
  173. package/dist/services/shared/getItemInfo.js.map +1 -1
  174. package/dist/types/index.d.ts +189 -29
  175. package/dist/types/index.js +21 -0
  176. package/dist/types/index.js.map +1 -1
  177. package/package.json +5 -4
  178. package/dist/lib/accessInformation/scoringRulesConfig.d.ts +0 -0
  179. package/dist/lib/accessInformation/scoringRulesConfig.js +0 -36
  180. package/dist/lib/accessInformation/scoringRulesConfig.js.map +0 -1
  181. package/dist/lib/layers/scoringRulesConfig.d.ts +0 -0
  182. package/dist/lib/layers/scoringRulesConfig.js +0 -48
  183. package/dist/lib/layers/scoringRulesConfig.js.map +0 -1
@@ -99,7 +99,17 @@ export type ValidationMessage = {
99
99
  * - `unknown`: The validation status is unknown, which is the default status when a ValidationInfo object is created but the validation process has not yet been executed.
100
100
  */
101
101
  export type ValidationResultStatus = 'pass' | 'warning' | 'error' | 'not-applicable' | 'unknown';
102
+ export declare const ValidationRuleIds: readonly ["item-sharing-level", "item-credits-attribution-info", "item-description", "item-license-info", "item-snippet", "item-ssl", "item-tags", "item-thumbnail", "item-title", "item-deprecated", "item-delete-protection", "item-title-and-summary-searchability", "user-profile-description", "user-profile-full-name", "user-profile-thumbnail", "feature-service-field-value-types", "feature-service-field-aliases", "feature-service-field-descriptions"];
103
+ /**
104
+ * Validation rule identifier
105
+ */
106
+ export type ValidationRuleId = (typeof ValidationRuleIds)[number];
102
107
  export type ValidationInfo = {
108
+ /**
109
+ * The identifier of the validation rule, e.g., "item-sharing-level" or "item-description".
110
+ * It serves as a unique, human-readable identifier for each rule.
111
+ */
112
+ validationRuleId: ValidationRuleId;
103
113
  /**
104
114
  * The title string tells the user what this validation rule checks, e.g., "Check Thumbnail" or "Check Number of Layers".
105
115
  */
@@ -125,9 +135,10 @@ export type ValidationInfo = {
125
135
  */
126
136
  weight: number;
127
137
  /**
128
- * A factor ranging between 0 and 1 used to calculate the final score by multiplying it with the weight number.
138
+ * A scoring factor ranging between 0 and 1 used to calculate the final score by multiplying it with the weight number.
139
+ * 0 means the validation rule received no points, while 1 means it received the maximum score.
129
140
  */
130
- weightFactor: number;
141
+ scoringFactor: number;
131
142
  /**
132
143
  * Status of the validation result
133
144
  */
@@ -138,90 +149,239 @@ export type ValidationInfo = {
138
149
  isBinaryCheck: boolean;
139
150
  };
140
151
  /**
141
- * Validation result returned by the `validate` function
152
+ * Represents the result of validating an ArcGIS Online item and its owner's profile.
153
+ *
154
+ * This type is returned by the `validate` function and contains detailed validation results
155
+ * for both the item and its owner's profile, as well as overall scoring and nomination eligibility.
142
156
  */
143
157
  export type ValidationResult = {
158
+ /**
159
+ * Validation results for the ArcGIS Online item.
160
+ * Each property corresponds to a specific validation rule applied to the item.
161
+ */
144
162
  validatedItem: {
145
163
  /**
146
- * validation result of item's Sharing Level
164
+ * Validation result for the item's sharing level (access).
147
165
  */
148
166
  access: ValidationInfo;
149
167
  /**
150
- * validation result of item's Credits/Attribution Info
168
+ * Validation result for the item's credits/attribution information.
151
169
  */
152
170
  accessInformation: ValidationInfo;
153
171
  /**
154
- * validation result of item's Description text
172
+ * Validation result for the item's description text.
155
173
  */
156
174
  description: ValidationInfo;
157
175
  /**
158
- * validation result of item's License Info
176
+ * Validation result for the item's license information.
159
177
  */
160
178
  licenseInfo: ValidationInfo;
161
179
  /**
162
- * validation result of item's snippet (summary text)
180
+ * Validation result for the item's snippet (summary text).
163
181
  */
164
182
  snippet: ValidationInfo;
183
+ /**
184
+ * Validation result for the item's HTTPS URL.
185
+ */
165
186
  ssl: ValidationInfo;
166
187
  /**
167
- * validation result of item's tags
188
+ * Validation result for the item's tags.
168
189
  */
169
190
  tags: ValidationInfo;
170
191
  /**
171
- * validation result of item's thumbnail
192
+ * Validation result for the item's thumbnail image.
172
193
  */
173
194
  thumbnail: ValidationInfo;
174
195
  /**
175
- * validation result of item's title
196
+ * Validation result for the item's title.
176
197
  */
177
198
  title: ValidationInfo;
178
199
  /**
179
- * validation result of item's contentStatus
200
+ * Validation result for the item's deprecated/content status.
180
201
  */
181
202
  deprecated: ValidationInfo;
182
203
  /**
183
- * validation result of item's "delete protection" property
204
+ * Validation result for the item's delete protection property.
184
205
  */
185
206
  deleteProtection: ValidationInfo;
186
207
  /**
187
- * validation result of checking recommended text in item's title and summary text
208
+ * Validation result for searchability the item's title and summary.
209
+ * Applicable only to English layer items.
188
210
  */
189
211
  recommendedTextInTitleAndSummary: ValidationInfo;
212
+ /**
213
+ * Validation result for field aliases in feature layers of a feature service item.
214
+ * Applicable only to feature service items.
215
+ */
216
+ featureServiceFieldAliases: ValidationInfo;
217
+ /**
218
+ * Validation result for field descriptions in feature layers of a feature service item.
219
+ * Applicable only to feature service items.
220
+ */
221
+ featureServiceFieldDescriptions: ValidationInfo;
222
+ /**
223
+ * Validation result for field value types in feature layers of a feature service item.
224
+ * Applicable only to feature service items.
225
+ */
226
+ featureServiceFieldValueTypes: ValidationInfo;
190
227
  };
228
+ /**
229
+ * Validation results for the item owner's profile.
230
+ * Each property corresponds to a specific validation rule applied to the user profile.
231
+ */
191
232
  validatedProfile: {
192
233
  /**
193
- * validation result of item owner's profile descriotion
234
+ * Validation result for the owner's profile description.
194
235
  */
195
236
  userProfileDescription: ValidationInfo;
196
237
  /**
197
- * validation result of item owner's full name
238
+ * Validation result for the owner's full name.
198
239
  */
199
240
  userProfileFullName: ValidationInfo;
200
241
  /**
201
- * validation result of item owner's thumbnail image
242
+ * Validation result for the owner's thumbnail image.
202
243
  */
203
244
  userProfileThumbnail: ValidationInfo;
204
245
  };
205
246
  /**
206
- * Id of the ArcGIS Online Item
247
+ * The ArcGIS Online Item ID.
207
248
  */
208
249
  id: string;
209
250
  /**
210
- * total score of the validation result
251
+ * The total score calculated from all validation rules.
211
252
  */
212
253
  totalScore: number;
213
254
  /**
214
- * if true, this item meets all minimum requirements
215
- * and it can be nominated to Living Atlas.
216
- *
217
- * An item can be nominated to Living Atlas only if its total score meets the minimum required threshold of 80 and it also passes
218
- * the following checks:
255
+ * Indicates if the item meets all minimum requirements and can be nominated to Living Atlas.
219
256
  *
220
- * - It is shared with the public
221
- * - Its thumbnail image meets the required dimension
222
- * - It has a snippet text
223
- * - It has a description text
224
- * - The item owner has a user profile description
257
+ * An item is eligible for nomination if:
258
+ * - The total score meets the minimum threshold (e.g., 80).
259
+ * - It is shared with the public.
260
+ * - The thumbnail image meets required dimensions.
261
+ * - It has a snippet (summary) text.
262
+ * - It has a description text.
263
+ * - The item owner has a user profile description.
225
264
  */
226
265
  canBeNominated: boolean;
227
266
  };
267
+ /**
268
+ * Represents a Feature Service in JSON format.
269
+ *
270
+ * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service/
271
+ */
272
+ export type FeatureServiceJSON = {
273
+ /**
274
+ * the feature layers published by this service
275
+ */
276
+ layers: {
277
+ id: number;
278
+ name: string;
279
+ type: string;
280
+ geometryType: string;
281
+ }[];
282
+ /**
283
+ * the tables published by this service
284
+ */
285
+ tables: {
286
+ id: number;
287
+ name: string;
288
+ }[];
289
+ };
290
+ /**
291
+ * Represents a Feature Layer field in JSON format.
292
+ *
293
+ * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer.htm
294
+ */
295
+ type FeatureLayerField = {
296
+ name: string;
297
+ type: string;
298
+ alias: string;
299
+ length?: number;
300
+ domain?: any;
301
+ defaultValue?: any;
302
+ sqlType?: string;
303
+ nullable?: boolean;
304
+ editable?: boolean;
305
+ };
306
+ /**
307
+ * Represents a raw Feature Layer field as returned by the Feature Layer JSON.
308
+ *
309
+ * The `description` property is typically returned by the server as a stringified JSON object,
310
+ * for example: `"{\"value\":\"\",\"fieldValueType\":\"dateAndTime\"}"`.
311
+ */
312
+ export type FeatureLayerFieldRaw = FeatureLayerField & {
313
+ /**
314
+ * The field description as a stringified JSON object, if present.
315
+ */
316
+ description?: string;
317
+ };
318
+ /**
319
+ * Represents a Feature Layer field with a parsed and formatted description.
320
+ *
321
+ * The `description` property is an object containing the description text and the field value type,
322
+ * or `null` if not present or not properly formatted.
323
+ */
324
+ export type FeatureLayerFieldFormatted = FeatureLayerField & {
325
+ description?: {
326
+ /**
327
+ * A brief description of the field, up to 500 characters.
328
+ */
329
+ value: string;
330
+ /**
331
+ * A keyword categorizing the type of values in the field, used for smarter suggestions in ArcGIS Online.
332
+ */
333
+ fieldValueType: FeatureLayerFieldValueType;
334
+ } | null;
335
+ };
336
+ /**
337
+ * Represents the field value type of a feature layer.
338
+ *
339
+ * @see https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm
340
+ * @see https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/describing-layer-attributes-with-field-descriptions-march-2019
341
+ */
342
+ export type FeatureLayerFieldValueType = 'nameOrTitle' | 'description' | 'typeOrCategory' | 'countOrAmount' | 'percentageOrRatio' | 'measurement' | 'uniqueIdentifier' | 'orderedOrRanked' | 'binary' | 'locationOrPlaceName' | 'coordinate' | 'dateAndTime';
343
+ /**
344
+ * Represents a Feature Layer in JSON format.
345
+ *
346
+ * An individual Feature Layer resource represents a single feature layer or a non-spatial table in a feature service.
347
+ * - For tables, it provides basic information about the table such as its ID, name, fields, types and templates.
348
+ * - For feature layers, in addition to the table information above, it provides information such as its geometry type, min and max scales, and spatial reference. A feature layer is a table or view with at least one spatial column.
349
+ *
350
+ * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer/
351
+ */
352
+ export type FeatureLayerJSON = {
353
+ id: number;
354
+ name: string;
355
+ type: string;
356
+ description: string;
357
+ copyrightText: string;
358
+ supportsRollbackOnFailures: boolean;
359
+ geometryType?: string;
360
+ minScale?: number;
361
+ maxScale?: number;
362
+ 'extent?': {
363
+ xmin: number;
364
+ ymin: number;
365
+ xmax: number;
366
+ ymax: number;
367
+ spatialReference: {
368
+ wkid: number;
369
+ latestWkid: number;
370
+ };
371
+ };
372
+ /**
373
+ * the feature layer's fields
374
+ */
375
+ fields: FeatureLayerFieldRaw[];
376
+ };
377
+ /**
378
+ * Represents the response from the Feature Service layers endpoint.
379
+ *
380
+ * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
381
+ */
382
+ export type FeatureServiceLayersResponse = {
383
+ layers: FeatureLayerJSON[];
384
+ tables: FeatureLayerJSON[];
385
+ error?: Error;
386
+ };
387
+ export {};
@@ -13,4 +13,25 @@
13
13
  * @see https://stackoverflow.com/questions/56018167/typescript-does-not-copy-d-ts-files-to-build
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ValidationRuleIds = void 0;
17
+ exports.ValidationRuleIds = [
18
+ 'item-sharing-level',
19
+ 'item-credits-attribution-info',
20
+ 'item-description',
21
+ 'item-license-info',
22
+ 'item-snippet',
23
+ 'item-ssl',
24
+ 'item-tags',
25
+ 'item-thumbnail',
26
+ 'item-title',
27
+ 'item-deprecated',
28
+ 'item-delete-protection',
29
+ 'item-title-and-summary-searchability',
30
+ 'user-profile-description',
31
+ 'user-profile-full-name',
32
+ 'user-profile-thumbnail',
33
+ 'feature-service-field-value-types',
34
+ 'feature-service-field-aliases',
35
+ 'feature-service-field-descriptions',
36
+ ];
16
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAoIU,QAAA,iBAAiB,GAAG;IAC7B,oBAAoB;IACpB,+BAA+B;IAC/B,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,UAAU;IACV,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,wBAAwB;IACxB,sCAAsC;IACtC,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,mCAAmC;IACnC,+BAA+B;IAC/B,oCAAoC;CAC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vannizhang/living-atlas-content-validator",
3
- "version": "1.5.19-beta.2",
3
+ "version": "1.5.19-beta.4",
4
4
  "description": "Validation and Scoring rules for curating content in the ArcGIS Living Atlas",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/jest": "^29.5.0",
42
+ "@types/node": "^22.15.18",
42
43
  "@typescript-eslint/eslint-plugin": "^5.58.0",
43
44
  "@typescript-eslint/parser": "^5.58.0",
44
45
  "eslint": "^8.38.0",
@@ -49,9 +50,9 @@
49
50
  "jest-environment-jsdom": "^29.7.0",
50
51
  "lint-staged": "^13.2.1",
51
52
  "prettier": "^2.8.7",
52
- "rimraf": "^5.0.0",
53
- "ts-jest": "^29.1.0",
54
- "typescript": "^5.0.4"
53
+ "rimraf": "^5.0.10",
54
+ "ts-jest": "^29.3.3",
55
+ "typescript": "^5.8.3"
55
56
  },
56
57
  "dependencies": {
57
58
  "sanitize-html": "^2.10.0"
@@ -1,36 +0,0 @@
1
- // import { ScoringRulesConfig } from '../../types';
2
- // const config: ScoringRulesConfig = {
3
- // // Scoring
4
- // SCORING: {
5
- // DEFAULT: {
6
- // WEB_MAP: {
7
- // EMPTY_STRING_SCORE: 0,
8
- // EXIST_SCORE: 8,
9
- // },
10
- // WEB_SCENE: {
11
- // EMPTY_STRING_SCORE: 0,
12
- // EXIST_SCORE: 9,
13
- // },
14
- // APPLICATION: {
15
- // EMPTY_STRING_SCORE: 0,
16
- // EXIST_SCORE: 9,
17
- // },
18
- // },
19
- // INTERNATIONAL: {
20
- // WEB_MAP: {
21
- // EMPTY_STRING_SCORE: 0,
22
- // EXIST_SCORE: 8,
23
- // },
24
- // WEB_SCENE: {
25
- // EMPTY_STRING_SCORE: 0,
26
- // EXIST_SCORE: 9,
27
- // },
28
- // APPLICATION: {
29
- // EMPTY_STRING_SCORE: 0,
30
- // EXIST_SCORE: 9,
31
- // },
32
- // },
33
- // },
34
- // };
35
- // export default config;
36
- //# sourceMappingURL=scoringRulesConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scoringRulesConfig.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/scoringRulesConfig.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,uCAAuC;AACvC,iBAAiB;AACjB,iBAAiB;AACjB,qBAAqB;AACrB,yBAAyB;AACzB,yCAAyC;AACzC,kCAAkC;AAClC,iBAAiB;AACjB,2BAA2B;AAC3B,yCAAyC;AACzC,kCAAkC;AAClC,iBAAiB;AACjB,6BAA6B;AAC7B,yCAAyC;AACzC,kCAAkC;AAClC,iBAAiB;AACjB,aAAa;AAEb,2BAA2B;AAC3B,yBAAyB;AACzB,yCAAyC;AACzC,kCAAkC;AAClC,iBAAiB;AACjB,2BAA2B;AAC3B,yCAAyC;AACzC,kCAAkC;AAClC,iBAAiB;AACjB,6BAA6B;AAC7B,yCAAyC;AACzC,kCAAkC;AAClC,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AAEL,yBAAyB"}
File without changes
@@ -1,48 +0,0 @@
1
- // import { ScoringRulesConfig } from '../../types';
2
- // const config: ScoringRulesConfig = {
3
- // // Scoring
4
- // SCORING: {
5
- // DEFAULT: {
6
- // WEB_MAP: {
7
- // EMPTY_STRING_SCORE: 0,
8
- // LAYER_COUNT_BEST_SCORE: 8,
9
- // LAYER_COUNT_BETTER_SCORE: 4,
10
- // LAYER_COUNT_GOOD_SCORE: 1,
11
- // },
12
- // WEB_SCENE: {
13
- // EMPTY_STRING_SCORE: 0,
14
- // LAYER_COUNT_BEST_SCORE: 0,
15
- // LAYER_COUNT_BETTER_SCORE: 0,
16
- // LAYER_COUNT_GOOD_SCORE: 0,
17
- // },
18
- // APPLICATION: {
19
- // EMPTY_STRING_SCORE: 0,
20
- // LAYER_COUNT_BEST_SCORE: 0,
21
- // LAYER_COUNT_BETTER_SCORE: 0,
22
- // LAYER_COUNT_GOOD_SCORE: 0,
23
- // },
24
- // },
25
- // INTERNATIONAL: {
26
- // WEB_MAP: {
27
- // EMPTY_STRING_SCORE: 0,
28
- // LAYER_COUNT_BEST_SCORE: 8,
29
- // LAYER_COUNT_BETTER_SCORE: 4,
30
- // LAYER_COUNT_GOOD_SCORE: 1,
31
- // },
32
- // WEB_SCENE: {
33
- // EMPTY_STRING_SCORE: 0,
34
- // LAYER_COUNT_BEST_SCORE: 0,
35
- // LAYER_COUNT_BETTER_SCORE: 0,
36
- // LAYER_COUNT_GOOD_SCORE: 0,
37
- // },
38
- // APPLICATION: {
39
- // EMPTY_STRING_SCORE: 0,
40
- // LAYER_COUNT_BEST_SCORE: 0,
41
- // LAYER_COUNT_BETTER_SCORE: 0,
42
- // LAYER_COUNT_GOOD_SCORE: 0,
43
- // },
44
- // },
45
- // },
46
- // };
47
- // export default config;
48
- //# sourceMappingURL=scoringRulesConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scoringRulesConfig.js","sourceRoot":"","sources":["../../../src/lib/layers/scoringRulesConfig.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,uCAAuC;AACvC,iBAAiB;AACjB,iBAAiB;AACjB,qBAAqB;AACrB,yBAAyB;AACzB,yCAAyC;AACzC,6CAA6C;AAC7C,+CAA+C;AAC/C,6CAA6C;AAC7C,iBAAiB;AACjB,2BAA2B;AAC3B,yCAAyC;AACzC,6CAA6C;AAC7C,+CAA+C;AAC/C,6CAA6C;AAC7C,iBAAiB;AACjB,6BAA6B;AAC7B,yCAAyC;AACzC,6CAA6C;AAC7C,+CAA+C;AAC/C,6CAA6C;AAC7C,iBAAiB;AACjB,aAAa;AAEb,2BAA2B;AAC3B,yBAAyB;AACzB,yCAAyC;AACzC,6CAA6C;AAC7C,+CAA+C;AAC/C,6CAA6C;AAC7C,iBAAiB;AACjB,2BAA2B;AAC3B,yCAAyC;AACzC,6CAA6C;AAC7C,+CAA+C;AAC/C,6CAA6C;AAC7C,iBAAiB;AACjB,6BAA6B;AAC7B,yCAAyC;AACzC,6CAA6C;AAC7C,+CAA+C;AAC/C,6CAA6C;AAC7C,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AAEL,yBAAyB"}