@vannizhang/living-atlas-content-validator 1.5.19-beta.2 → 1.5.19-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +338 -55
- package/dist/configureSettings.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/accessInformation/isValidAccessInformation.js +6 -9
- package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
- package/dist/lib/accessInformation/scoringConfig.d.ts +1 -1
- package/dist/lib/accessInformation/scoringConfig.js +1 -1
- package/dist/lib/accessInformation/scoringConfig.js.map +1 -1
- package/dist/lib/checkProfanities/checkProfanities.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js +7 -7
- package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.d.ts +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js +1 -1
- package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -1
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +8 -8
- package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
- package/dist/lib/deleteProtection/scoringConfig.d.ts +1 -1
- package/dist/lib/deleteProtection/scoringConfig.js +1 -1
- package/dist/lib/deleteProtection/scoringConfig.js.map +1 -1
- package/dist/lib/deprecated/isDeprecated.js +8 -9
- package/dist/lib/deprecated/isDeprecated.js.map +1 -1
- package/dist/lib/deprecated/scoringConfig.d.ts +1 -1
- package/dist/lib/deprecated/scoringConfig.js +1 -1
- package/dist/lib/deprecated/scoringConfig.js.map +1 -1
- package/dist/lib/description/findDataSource.js.map +1 -1
- package/dist/lib/description/isValidDescription.js +23 -41
- package/dist/lib/description/isValidDescription.js.map +1 -1
- package/dist/lib/description/scoringConfig.d.ts +1 -1
- package/dist/lib/description/scoringConfig.js +1 -1
- package/dist/lib/description/scoringConfig.js.map +1 -1
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +22 -0
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +87 -0
- package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -0
- package/dist/lib/featureServiceFieldAliases/scoringConfig.d.ts +8 -0
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js +13 -0
- package/dist/lib/featureServiceFieldAliases/scoringConfig.js.map +1 -0
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +21 -0
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +89 -0
- package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -0
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.d.ts +8 -0
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +13 -0
- package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js.map +1 -0
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +18 -0
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +86 -0
- package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -0
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.d.ts +8 -0
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +13 -0
- package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js.map +1 -0
- package/dist/lib/licenseInfo/isValidLicenseInfo.js +16 -23
- package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
- package/dist/lib/licenseInfo/scoringConfig.d.ts +1 -1
- package/dist/lib/licenseInfo/scoringConfig.js +1 -1
- package/dist/lib/licenseInfo/scoringConfig.js.map +1 -1
- package/dist/lib/sharing/isValidAccess.js +13 -14
- package/dist/lib/sharing/isValidAccess.js.map +1 -1
- package/dist/lib/sharing/scoringConfig.d.ts +1 -1
- package/dist/lib/sharing/scoringConfig.js +1 -1
- package/dist/lib/sharing/scoringConfig.js.map +1 -1
- package/dist/lib/ssl/isValidSSL.js +12 -12
- package/dist/lib/ssl/isValidSSL.js.map +1 -1
- package/dist/lib/ssl/scoringConfig.d.ts +1 -1
- package/dist/lib/ssl/scoringConfig.js +1 -1
- package/dist/lib/ssl/scoringConfig.js.map +1 -1
- package/dist/lib/summary/isValidSummary.js +32 -31
- package/dist/lib/summary/isValidSummary.js.map +1 -1
- package/dist/lib/summary/scoringConfig.d.ts +1 -1
- package/dist/lib/summary/scoringConfig.js +1 -1
- package/dist/lib/summary/scoringConfig.js.map +1 -1
- package/dist/lib/tags/isValidTags.js +15 -21
- package/dist/lib/tags/isValidTags.js.map +1 -1
- package/dist/lib/tags/scoringConfig.d.ts +1 -1
- package/dist/lib/tags/scoringConfig.js +1 -1
- package/dist/lib/tags/scoringConfig.js.map +1 -1
- package/dist/lib/thumbnail/isValidThumbnail.js +16 -34
- package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
- package/dist/lib/thumbnail/scoringConfig.d.ts +1 -1
- package/dist/lib/thumbnail/scoringConfig.js +1 -1
- package/dist/lib/thumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/title/isValidTitle.js +34 -34
- package/dist/lib/title/isValidTitle.js.map +1 -1
- package/dist/lib/title/scoringConfig.d.ts +1 -1
- package/dist/lib/title/scoringConfig.js +1 -1
- package/dist/lib/title/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +31 -32
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.d.ts +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.js +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileName/isValidUserProfileName.js +14 -14
- package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
- package/dist/lib/userProfileName/scoringConfig.d.ts +1 -1
- package/dist/lib/userProfileName/scoringConfig.js +1 -1
- package/dist/lib/userProfileName/scoringConfig.js.map +1 -1
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +10 -10
- package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
- package/dist/lib/userProfileThumbnail/scoringConfig.d.ts +1 -1
- package/dist/lib/userProfileThumbnail/scoringConfig.js +1 -1
- package/dist/lib/userProfileThumbnail/scoringConfig.js.map +1 -1
- package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -1
- package/dist/lib/util/countSentences.js.map +1 -1
- package/dist/lib/util/createWordBoundaryRegex.js.map +1 -1
- package/dist/lib/util/escapeSpecialCharacters.js.map +1 -1
- package/dist/lib/util/getAllValidationRuleIds.d.ts +6 -0
- package/dist/lib/util/getAllValidationRuleIds.js +13 -0
- package/dist/lib/util/getAllValidationRuleIds.js.map +1 -0
- package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -1
- package/dist/lib/util/getNumberOfWords.js.map +1 -1
- package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +13 -0
- package/dist/lib/util/getRelevantFeatureLayerFields.js +45 -0
- package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -0
- package/dist/lib/util/getScoringRules.js.map +1 -1
- package/dist/lib/util/getThumbnailFileName.js.map +1 -1
- package/dist/lib/util/isArcGISDomain.js.map +1 -1
- package/dist/lib/util/isEmpty.js.map +1 -1
- package/dist/lib/util/isFeatureCollection.js +1 -1
- package/dist/lib/util/isFeatureCollection.js.map +1 -1
- package/dist/lib/util/isFeatureService.d.ts +8 -0
- package/dist/lib/util/isFeatureService.js +21 -0
- package/dist/lib/util/isFeatureService.js.map +1 -0
- package/dist/lib/util/isHosted.js.map +1 -1
- package/dist/lib/util/isSecureProtocol.js.map +1 -1
- package/dist/lib/util/isUppercase.js.map +1 -1
- package/dist/lib/util/isUrl.js.map +1 -1
- package/dist/lib/util/isValidRegexPattern.js.map +1 -1
- package/dist/lib/util/matches.js.map +1 -1
- package/dist/lib/util/round.js +1 -2
- package/dist/lib/util/round.js.map +1 -1
- package/dist/lib/util/sanitizeTags.js.map +1 -1
- package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
- package/dist/lib/util/toString.js.map +1 -1
- package/dist/lib/validate/validate.d.ts +7 -2
- package/dist/lib/validate/validate.js +10 -1
- package/dist/lib/validate/validate.js.map +1 -1
- package/dist/lib/validate/validateHelpers.js +2 -2
- package/dist/lib/validate/validateHelpers.js.map +1 -1
- package/dist/locale/de.json +27 -0
- package/dist/locale/en.json +27 -0
- package/dist/locale/es.json +27 -0
- package/dist/locale/fr.json +27 -0
- package/dist/locale/ja.json +27 -0
- package/dist/locale/pt-br.json +27 -0
- package/dist/package-info.json +1 -1
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +1 -1
- package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -1
- package/dist/services/content-validator-assets/fetchProfanitiesData.js +1 -1
- package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -1
- package/dist/services/content-validator-assets/helpers.js.map +1 -1
- package/dist/services/custom-terms/config.js +1 -1
- package/dist/services/custom-terms/config.js.map +1 -1
- package/dist/services/custom-terms/customTerms.js +10 -10
- package/dist/services/custom-terms/customTerms.js.map +1 -1
- package/dist/services/custom-terms/helpers.js.map +1 -1
- package/dist/services/custom-terms-review-results/config.js +1 -1
- package/dist/services/custom-terms-review-results/config.js.map +1 -1
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js +4 -4
- package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -1
- package/dist/services/custom-terms-review-results/helpers.js.map +1 -1
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +9 -0
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +49 -0
- package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -0
- package/dist/services/shared/addFeatures.js +4 -4
- package/dist/services/shared/addFeatures.js.map +1 -1
- package/dist/services/shared/applyEdits.js +4 -4
- package/dist/services/shared/applyEdits.js.map +1 -1
- package/dist/services/shared/getItemInfo.js +1 -1
- package/dist/services/shared/getItemInfo.js.map +1 -1
- package/dist/types/index.d.ts +168 -29
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +5 -4
- package/dist/lib/accessInformation/scoringRulesConfig.d.ts +0 -0
- package/dist/lib/accessInformation/scoringRulesConfig.js +0 -36
- package/dist/lib/accessInformation/scoringRulesConfig.js.map +0 -1
- package/dist/lib/layers/scoringRulesConfig.d.ts +0 -0
- package/dist/lib/layers/scoringRulesConfig.js +0 -48
- package/dist/lib/layers/scoringRulesConfig.js.map +0 -1
package/README.md
CHANGED
|
@@ -43,13 +43,20 @@ The validation process evaluates whether an item meets all necessary criteria, s
|
|
|
43
43
|
- [matchDateTimeInfo](#matchdatetimeinfo)
|
|
44
44
|
- [isRecognizedDateTimeInfo](#isrecognizeddatetimeinfo)
|
|
45
45
|
- [isRejectedDateTimeInfo](#isrejecteddatetimeinfo)
|
|
46
|
+
- [checkFeatureServiceFieldAliases](#checkfeatureservicefieldaliases)
|
|
47
|
+
- [checkFeatureServiceFieldDescriptions](#checkFeatureServiceFieldDescriptions)
|
|
48
|
+
- [checkFeatureServiceFieldValueTypes](#checkFeatureServiceFieldValueTypes)
|
|
46
49
|
- [getLivingAtlasSupportedItemTypes](#getlivingatlassupporteditemtypes)
|
|
47
50
|
- [checkIsLivingAtlasSupportedItemType](#checkislivingatlassupporteditemtype)
|
|
51
|
+
|
|
48
52
|
- [Types](#types)
|
|
49
53
|
- [ValidationResult](#validationresult)
|
|
50
54
|
- [ValidationResultStatus](#validationresultstatus)
|
|
51
55
|
- [ValidationInfo](#validationinfo)
|
|
52
56
|
- [MatchResult](#matchresult)
|
|
57
|
+
- [FeatureLayerFieldValueType](#featurelayerfieldvaluetype)
|
|
58
|
+
- [FeatureLayerJSON](#featurelayerjson)
|
|
59
|
+
- [Weight based scoring](#weight-based-scoring-system)
|
|
53
60
|
- [Issues](#issues)
|
|
54
61
|
- [License](#license)
|
|
55
62
|
|
|
@@ -1192,108 +1199,287 @@ console.log(isSupported); // true or false
|
|
|
1192
1199
|
|
|
1193
1200
|
---
|
|
1194
1201
|
|
|
1202
|
+
### `checkFeatureServiceFieldAliases`
|
|
1203
|
+
Validates that relevant fields in feature layers have appropriate aliases.
|
|
1204
|
+
|
|
1205
|
+
```ts
|
|
1206
|
+
import { checkFeatureServiceFieldAliases } from '@vannizhang/living-atlas-content-validator';
|
|
1207
|
+
|
|
1208
|
+
checkFeatureServiceFieldAliases(
|
|
1209
|
+
item: IItem,
|
|
1210
|
+
featureLayers: FeatureLayerJSON[]
|
|
1211
|
+
): ValidationInfo
|
|
1212
|
+
```
|
|
1213
|
+
|
|
1214
|
+
**Parameters:**
|
|
1215
|
+
- `item` (`IItem`, required): The ArcGIS Online item to validate
|
|
1216
|
+
- `featureLayers` (`FeatureLayerJSON[]`, required): An array of JSON objects representing the feature layers published to this feature service to check for field aliases.
|
|
1217
|
+
|
|
1218
|
+
**Returns:**
|
|
1219
|
+
- `ValidationInfo`: An object containing the validation result, messages, and scoring for field aliases.
|
|
1220
|
+
|
|
1221
|
+
**Description:**
|
|
1222
|
+
This function checks the provided feature layers for relevant fields and evaluates whether those fields have aliases defined. The scoring logic is as follows:
|
|
1223
|
+
- If the item is not a feature layer, the rule does not contribute to the final score (weight is 0).
|
|
1224
|
+
- If there are no feature layers, a message is added and the result is returned.
|
|
1225
|
+
- If none of the relevant fields have aliases, a message is added to prompt adding aliases.
|
|
1226
|
+
- If less than 80% of relevant fields have aliases, a message is added to prompt improvement and half score is given.
|
|
1227
|
+
- If at least 80% of relevant fields have aliases, the rule receives full score.
|
|
1228
|
+
|
|
1229
|
+
**Example:**
|
|
1230
|
+
```ts
|
|
1231
|
+
import { checkFeatureServiceFieldAliases } from '@vannizhang/living-atlas-content-validator';
|
|
1232
|
+
|
|
1233
|
+
const item = {
|
|
1234
|
+
id: 'mock-feature-layer-id',
|
|
1235
|
+
type: 'Feature Service',
|
|
1236
|
+
// Other properties...
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
const featureLayers = [
|
|
1240
|
+
{
|
|
1241
|
+
fields: [
|
|
1242
|
+
{ name: 'field1', alias: 'Field 1' },
|
|
1243
|
+
{ name: 'field2', alias: '' },
|
|
1244
|
+
// Other fields...
|
|
1245
|
+
],
|
|
1246
|
+
// Other properties...
|
|
1247
|
+
}
|
|
1248
|
+
// Additional feature layers if needed...
|
|
1249
|
+
];
|
|
1250
|
+
|
|
1251
|
+
const validationInfo = checkFeatureServiceFieldAliases(item, featureLayers);
|
|
1252
|
+
console.log(validationInfo);
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
---
|
|
1256
|
+
|
|
1257
|
+
### `checkFeatureServiceFieldDescriptions`
|
|
1258
|
+
Validates that relevant fields in feature layers have appropriate descriptions.
|
|
1259
|
+
|
|
1260
|
+
```ts
|
|
1261
|
+
import { checkFeatureServiceFieldDescriptions } from '@vannizhang/living-atlas-content-validator';
|
|
1262
|
+
|
|
1263
|
+
checkFeatureServiceFieldDescriptions(
|
|
1264
|
+
item: IItem,
|
|
1265
|
+
featureLayers: FeatureLayerJSON[]
|
|
1266
|
+
): ValidationInfo
|
|
1267
|
+
```
|
|
1268
|
+
|
|
1269
|
+
**Parameters:**
|
|
1270
|
+
- `item` (`IItem`, required): The ArcGIS Online item to validate, expected to be a feature layer.
|
|
1271
|
+
- `featureLayers` (`FeatureLayerJSON[]`, required): An array of JSON objects representing the feature layers published to this feature service to check for field descriptions.
|
|
1272
|
+
|
|
1273
|
+
**Returns:**
|
|
1274
|
+
- `ValidationInfo`: An object containing the validation result, messages, score, and scoring factors for field descriptions.
|
|
1275
|
+
|
|
1276
|
+
**Description:**
|
|
1277
|
+
This function checks if the given item is a feature layer and evaluates the presence of field descriptions for relevant fields within the provided feature layers. The scoring logic is as follows:
|
|
1278
|
+
- If the item is not a feature layer, the rule does not contribute to the final score (weight is 0).
|
|
1279
|
+
- If there are no feature layers, a message is added and the result is returned.
|
|
1280
|
+
- If none of the relevant fields have descriptions, a message is added and the score is zero.
|
|
1281
|
+
- If less than 80% of relevant fields have descriptions, a message is added and half score is given.
|
|
1282
|
+
- If at least 80% of relevant fields have descriptions, the rule receives full score.
|
|
1283
|
+
|
|
1284
|
+
**Example:**
|
|
1285
|
+
```ts
|
|
1286
|
+
import { checkFeatureServiceFieldDescriptions } from '@vannizhang/living-atlas-content-validator';
|
|
1287
|
+
|
|
1288
|
+
const item = {
|
|
1289
|
+
id: 'mock-feature-layer-id',
|
|
1290
|
+
type: 'Feature Service',
|
|
1291
|
+
// Other properties...
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
const featureLayers = [
|
|
1295
|
+
{
|
|
1296
|
+
fields: [
|
|
1297
|
+
{ name: 'field1', description: { value: 'Description for field 1' } },
|
|
1298
|
+
{ name: 'field2', description: { value: '' } },
|
|
1299
|
+
// Other fields...
|
|
1300
|
+
],
|
|
1301
|
+
// Other properties...
|
|
1302
|
+
}
|
|
1303
|
+
// Additional feature layers if needed...
|
|
1304
|
+
];
|
|
1305
|
+
|
|
1306
|
+
const validationInfo = checkFeatureServiceFieldDescriptions(item, featureLayers);
|
|
1307
|
+
console.log(validationInfo);
|
|
1308
|
+
```
|
|
1309
|
+
|
|
1310
|
+
---
|
|
1311
|
+
|
|
1312
|
+
### `checkFeatureServiceFieldValueTypes`
|
|
1313
|
+
Validates that relevant fields in feature layers have a `fieldValueType` defined in their field descriptions.
|
|
1195
1314
|
|
|
1315
|
+
```ts
|
|
1316
|
+
import { checkFeatureServiceFieldValueTypes } from '@vannizhang/living-atlas-content-validator';
|
|
1317
|
+
|
|
1318
|
+
checkFeatureServiceFieldValueTypes(
|
|
1319
|
+
item: IItem,
|
|
1320
|
+
featureLayers: FeatureLayerJSON[]
|
|
1321
|
+
): ValidationInfo
|
|
1322
|
+
```
|
|
1323
|
+
|
|
1324
|
+
**Parameters:**
|
|
1325
|
+
- `item` (`IItem`, required): The ArcGIS Online item to validate.
|
|
1326
|
+
- `featureLayers` (`FeatureLayerJSON[]`, required): An array of JSON objects representing the feature layers published to this feature service.
|
|
1327
|
+
|
|
1328
|
+
**Returns:**
|
|
1329
|
+
- `ValidationInfo`: An object containing the validation result, messages, and scoring for field value types.
|
|
1330
|
+
|
|
1331
|
+
**Description:**
|
|
1332
|
+
This function checks the provided feature layers for relevant fields and evaluates whether those fields have a `fieldValueType` defined in their descriptions. The scoring logic is as follows:
|
|
1333
|
+
- If the item is not a feature layer, the rule does not contribute to the final score (weight is 0).
|
|
1334
|
+
- If there are no feature layers, a message is added and the result is returned.
|
|
1335
|
+
- If there are no relevant fields to check, the rule is considered fully satisfied.
|
|
1336
|
+
- If none of the relevant fields have a `fieldValueType`, a message is added and the score is zero.
|
|
1337
|
+
- If less than 80% of relevant fields have a `fieldValueType`, a message is added and half score is given.
|
|
1338
|
+
- If at least 80% of relevant fields have a `fieldValueType`, the rule receives full score.
|
|
1339
|
+
|
|
1340
|
+
**Example:**
|
|
1341
|
+
```ts
|
|
1342
|
+
import { checkFeatureServiceFieldValueTypes } from '@vannizhang/living-atlas-content-validator';
|
|
1343
|
+
|
|
1344
|
+
const item = {
|
|
1345
|
+
id: 'mock-feature-layer-id',
|
|
1346
|
+
type: 'Feature Service',
|
|
1347
|
+
// Other properties...
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
const featureLayers = [
|
|
1351
|
+
{
|
|
1352
|
+
fields: [
|
|
1353
|
+
{ name: 'field1', description: { fieldValueType: 'type1' } },
|
|
1354
|
+
{ name: 'field2', description: { fieldValueType: '' } },
|
|
1355
|
+
// Other fields...
|
|
1356
|
+
],
|
|
1357
|
+
// Other properties...
|
|
1358
|
+
}
|
|
1359
|
+
// Additional feature layers if needed...
|
|
1360
|
+
];
|
|
1361
|
+
|
|
1362
|
+
const validationInfo = checkFeatureServiceFieldValueTypes(item, featureLayers);
|
|
1363
|
+
console.log(validationInfo);
|
|
1364
|
+
```
|
|
1196
1365
|
|
|
1197
1366
|
## Types
|
|
1198
1367
|
|
|
1199
1368
|
### `ValidationResult`
|
|
1200
|
-
The `ValidationResult` type represents the
|
|
1369
|
+
The `ValidationResult` type represents the output of the `validate` function, providing detailed assessments for both the ArcGIS Online item and its owner's profile. It helps determine whether an item meets the necessary criteria for nomination to the ArcGIS Living Atlas.
|
|
1201
1370
|
|
|
1202
1371
|
```ts
|
|
1372
|
+
/**
|
|
1373
|
+
* Represents the result of validating an ArcGIS Online item and its owner's profile.
|
|
1374
|
+
*
|
|
1375
|
+
* This type is returned by the `validate` function and contains detailed validation results
|
|
1376
|
+
* for both the item and its owner's profile, as well as overall scoring and nomination eligibility.
|
|
1377
|
+
*/
|
|
1203
1378
|
export type ValidationResult = {
|
|
1379
|
+
/**
|
|
1380
|
+
* Validation results for the ArcGIS Online item.
|
|
1381
|
+
* Each property corresponds to a specific validation rule applied to the item.
|
|
1382
|
+
*/
|
|
1204
1383
|
validatedItem: {
|
|
1205
|
-
/**
|
|
1206
|
-
* Validation result for the item's sharing level.
|
|
1384
|
+
/**
|
|
1385
|
+
* Validation result for the item's sharing level (access).
|
|
1207
1386
|
*/
|
|
1208
1387
|
access: ValidationInfo;
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
* Validation result for the item's credits/attribution information.
|
|
1388
|
+
/**
|
|
1389
|
+
* Validation result for the item's credits/attribution information.
|
|
1212
1390
|
*/
|
|
1213
1391
|
accessInformation: ValidationInfo;
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
* Validation result for the item's description text.
|
|
1392
|
+
/**
|
|
1393
|
+
* Validation result for the item's description text.
|
|
1217
1394
|
*/
|
|
1218
1395
|
description: ValidationInfo;
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
* Validation result for the item's license information.
|
|
1396
|
+
/**
|
|
1397
|
+
* Validation result for the item's license information.
|
|
1222
1398
|
*/
|
|
1223
1399
|
licenseInfo: ValidationInfo;
|
|
1224
|
-
|
|
1225
1400
|
/**
|
|
1226
|
-
*
|
|
1401
|
+
* Validation result for the item's snippet (summary text).
|
|
1227
1402
|
*/
|
|
1228
1403
|
snippet: ValidationInfo;
|
|
1229
|
-
|
|
1230
1404
|
/**
|
|
1231
|
-
*
|
|
1405
|
+
* Validation result for the item's HTTPS URL.
|
|
1232
1406
|
*/
|
|
1233
1407
|
ssl: ValidationInfo;
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
* Validation result for the item's tags.
|
|
1408
|
+
/**
|
|
1409
|
+
* Validation result for the item's tags.
|
|
1237
1410
|
*/
|
|
1238
1411
|
tags: ValidationInfo;
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
* Validation result for the item's thumbnail image.
|
|
1412
|
+
/**
|
|
1413
|
+
* Validation result for the item's thumbnail image.
|
|
1242
1414
|
*/
|
|
1243
1415
|
thumbnail: ValidationInfo;
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
* Validation result for the item's title.
|
|
1416
|
+
/**
|
|
1417
|
+
* Validation result for the item's title.
|
|
1247
1418
|
*/
|
|
1248
1419
|
title: ValidationInfo;
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
* Validation result for the item's content status, checking for deprecated content.
|
|
1420
|
+
/**
|
|
1421
|
+
* Validation result for the item's deprecated/content status.
|
|
1252
1422
|
*/
|
|
1253
1423
|
deprecated: ValidationInfo;
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
* Validation result for the item's "delete protection" property.
|
|
1424
|
+
/**
|
|
1425
|
+
* Validation result for the item's delete protection property.
|
|
1257
1426
|
*/
|
|
1258
1427
|
deleteProtection: ValidationInfo;
|
|
1259
|
-
|
|
1260
1428
|
/**
|
|
1261
|
-
* Validation result for
|
|
1429
|
+
* Validation result for searchability the item's title and summary.
|
|
1430
|
+
* Applicable only to English layer items.
|
|
1262
1431
|
*/
|
|
1263
1432
|
recommendedTextInTitleAndSummary: ValidationInfo;
|
|
1433
|
+
/**
|
|
1434
|
+
* Validation result for field aliases in feature layers of a feature service item.
|
|
1435
|
+
* Applicable only to feature service items.
|
|
1436
|
+
*/
|
|
1437
|
+
featureServiceFieldAliases: ValidationInfo;
|
|
1438
|
+
/**
|
|
1439
|
+
* Validation result for field descriptions in feature layers of a feature service item.
|
|
1440
|
+
* Applicable only to feature service items.
|
|
1441
|
+
*/
|
|
1442
|
+
featureServiceFieldDescriptions: ValidationInfo;
|
|
1443
|
+
/**
|
|
1444
|
+
* Validation result for field value types in feature layers of a feature service item.
|
|
1445
|
+
* Applicable only to feature service items.
|
|
1446
|
+
*/
|
|
1447
|
+
featureServiceFieldValueTypes: ValidationInfo;
|
|
1264
1448
|
};
|
|
1449
|
+
/**
|
|
1450
|
+
* Validation results for the item owner's profile.
|
|
1451
|
+
* Each property corresponds to a specific validation rule applied to the user profile.
|
|
1452
|
+
*/
|
|
1265
1453
|
validatedProfile: {
|
|
1266
|
-
/**
|
|
1267
|
-
* Validation result for the
|
|
1454
|
+
/**
|
|
1455
|
+
* Validation result for the owner's profile description.
|
|
1268
1456
|
*/
|
|
1269
1457
|
userProfileDescription: ValidationInfo;
|
|
1270
|
-
|
|
1271
1458
|
/**
|
|
1272
|
-
* Validation result for the
|
|
1459
|
+
* Validation result for the owner's full name.
|
|
1273
1460
|
*/
|
|
1274
1461
|
userProfileFullName: ValidationInfo;
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
* Validation result for the item owner's profile thumbnail image.
|
|
1462
|
+
/**
|
|
1463
|
+
* Validation result for the owner's thumbnail image.
|
|
1278
1464
|
*/
|
|
1279
1465
|
userProfileThumbnail: ValidationInfo;
|
|
1280
1466
|
};
|
|
1281
|
-
/**
|
|
1282
|
-
*
|
|
1467
|
+
/**
|
|
1468
|
+
* The ArcGIS Online Item ID.
|
|
1283
1469
|
*/
|
|
1284
1470
|
id: string;
|
|
1285
|
-
/**
|
|
1286
|
-
* total score
|
|
1471
|
+
/**
|
|
1472
|
+
* The total score calculated from all validation rules.
|
|
1287
1473
|
*/
|
|
1288
1474
|
totalScore: number;
|
|
1289
1475
|
/**
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
1293
|
-
* -
|
|
1476
|
+
* Indicates if the item meets all minimum requirements and can be nominated to Living Atlas.
|
|
1477
|
+
*
|
|
1478
|
+
* An item is eligible for nomination if:
|
|
1479
|
+
* - The total score meets the minimum threshold (e.g., 80).
|
|
1294
1480
|
* - It is shared with the public.
|
|
1295
|
-
* -
|
|
1296
|
-
* - It has a snippet text.
|
|
1481
|
+
* - The thumbnail image meets required dimensions.
|
|
1482
|
+
* - It has a snippet (summary) text.
|
|
1297
1483
|
* - It has a description text.
|
|
1298
1484
|
* - The item owner has a user profile description.
|
|
1299
1485
|
*/
|
|
@@ -1328,6 +1514,11 @@ The `ValidationInfo` type provides detailed information about a specific validat
|
|
|
1328
1514
|
|
|
1329
1515
|
```ts
|
|
1330
1516
|
export type ValidationInfo = {
|
|
1517
|
+
/**
|
|
1518
|
+
* The identifier of the validation rule, e.g., "item-sharing-level" or "item-description".
|
|
1519
|
+
* It serves as a unique, human-readable identifier for each rule.
|
|
1520
|
+
*/
|
|
1521
|
+
validationRuleId: ValidationRuleId;
|
|
1331
1522
|
/**
|
|
1332
1523
|
* The title string tells the user what this validation rule checks, e.g., "Check Thumbnail" or "Check Number of Layers".
|
|
1333
1524
|
*/
|
|
@@ -1337,7 +1528,7 @@ export type ValidationInfo = {
|
|
|
1337
1528
|
*/
|
|
1338
1529
|
label: string;
|
|
1339
1530
|
/**
|
|
1340
|
-
*
|
|
1531
|
+
* array of validation messages
|
|
1341
1532
|
*/
|
|
1342
1533
|
messages: ValidationMessage[];
|
|
1343
1534
|
/**
|
|
@@ -1353,15 +1544,16 @@ export type ValidationInfo = {
|
|
|
1353
1544
|
*/
|
|
1354
1545
|
weight: number;
|
|
1355
1546
|
/**
|
|
1356
|
-
* A factor ranging between 0 and 1 used to calculate the final score by multiplying it with the weight number.
|
|
1547
|
+
* A scoring factor ranging between 0 and 1 used to calculate the final score by multiplying it with the weight number.
|
|
1548
|
+
* 0 means the validation rule received no points, while 1 means it received the maximum score.
|
|
1357
1549
|
*/
|
|
1358
|
-
|
|
1550
|
+
scoringFactor: number;
|
|
1359
1551
|
/**
|
|
1360
|
-
* Status of the validation result
|
|
1552
|
+
* Status of the validation result
|
|
1361
1553
|
*/
|
|
1362
1554
|
status: ValidationResultStatus;
|
|
1363
1555
|
/**
|
|
1364
|
-
*
|
|
1556
|
+
* if true, this validation rule is a binary check, i.e., it can only pass or fail.
|
|
1365
1557
|
*/
|
|
1366
1558
|
isBinaryCheck: boolean;
|
|
1367
1559
|
};
|
|
@@ -1388,6 +1580,97 @@ export type MatchResult = {
|
|
|
1388
1580
|
};
|
|
1389
1581
|
```
|
|
1390
1582
|
|
|
1583
|
+
### `FeatureLayerFieldValueType`
|
|
1584
|
+
Represents the value type of a field in a feature layer.
|
|
1585
|
+
|
|
1586
|
+
```ts
|
|
1587
|
+
/**
|
|
1588
|
+
* Represents the field value type of a feature layer.
|
|
1589
|
+
*
|
|
1590
|
+
* @see https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm
|
|
1591
|
+
* @see https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/describing-layer-attributes-with-field-descriptions-march-2019
|
|
1592
|
+
*/
|
|
1593
|
+
export type FeatureLayerFieldValueType =
|
|
1594
|
+
| 'nameOrTitle'
|
|
1595
|
+
| 'description'
|
|
1596
|
+
| 'typeOrCategory'
|
|
1597
|
+
| 'countOrAmount'
|
|
1598
|
+
| 'percentageOrRatio'
|
|
1599
|
+
| 'measurement'
|
|
1600
|
+
| 'uniqueIdentifier'
|
|
1601
|
+
| 'orderedOrRanked'
|
|
1602
|
+
| 'binary'
|
|
1603
|
+
| 'locationOrPlaceName'
|
|
1604
|
+
| 'coordinate'
|
|
1605
|
+
| 'dateAndTime';
|
|
1606
|
+
|
|
1607
|
+
```
|
|
1608
|
+
|
|
1609
|
+
---
|
|
1610
|
+
|
|
1611
|
+
### `FeatureLayerJSON`
|
|
1612
|
+
Represents the JSON structure of a feature layer.
|
|
1613
|
+
|
|
1614
|
+
```ts
|
|
1615
|
+
/**
|
|
1616
|
+
* Represents a Feature Layer in JSON format.
|
|
1617
|
+
*
|
|
1618
|
+
* An individual Feature Layer resource represents a single feature layer or a non-spatial table in a feature service.
|
|
1619
|
+
* - For tables, it provides basic information about the table such as its ID, name, fields, types and templates.
|
|
1620
|
+
* - 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.
|
|
1621
|
+
*
|
|
1622
|
+
* @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer/
|
|
1623
|
+
*/
|
|
1624
|
+
export type FeatureLayerJSON = {
|
|
1625
|
+
id: number;
|
|
1626
|
+
name: string;
|
|
1627
|
+
type: string;
|
|
1628
|
+
description: string;
|
|
1629
|
+
copyrightText: string;
|
|
1630
|
+
supportsRollbackOnFailures: boolean;
|
|
1631
|
+
geometryType?: string;
|
|
1632
|
+
minScale?: number;
|
|
1633
|
+
maxScale?: number;
|
|
1634
|
+
'extent?': {
|
|
1635
|
+
xmin: number;
|
|
1636
|
+
ymin: number;
|
|
1637
|
+
xmax: number;
|
|
1638
|
+
ymax: number;
|
|
1639
|
+
spatialReference: {
|
|
1640
|
+
wkid: number;
|
|
1641
|
+
latestWkid: number;
|
|
1642
|
+
};
|
|
1643
|
+
};
|
|
1644
|
+
/**
|
|
1645
|
+
* the feature layer's fields
|
|
1646
|
+
*/
|
|
1647
|
+
fields: FeatureLayerField[];
|
|
1648
|
+
};
|
|
1649
|
+
```
|
|
1650
|
+
|
|
1651
|
+
## Weight-Based Scoring System
|
|
1652
|
+
The evaluation process uses a weight-based scoring system, where each validation rule is assigned a specific weight to indicate its relative importance in the overall score calculation. A higher weight means the rule has more impact on the final score. Setting a rule’s weight to zero effectively excludes it from the scoring process—this typically happens when a rule is not applicable to the item being evaluated.
|
|
1653
|
+
|
|
1654
|
+
Below is the list of weights assigned to each validation rule:
|
|
1655
|
+
|
|
1656
|
+
| Validation Rule | Weight |
|
|
1657
|
+
|------------------------------------------------|--------|
|
|
1658
|
+
| Check Thumbnail | 8 |
|
|
1659
|
+
| Check Title | 8 |
|
|
1660
|
+
| Check Summary | 8 |
|
|
1661
|
+
| Check Description | 8 |
|
|
1662
|
+
| Check Tags | 4 |
|
|
1663
|
+
| Check Discoverability of Title and Summary | 16 |
|
|
1664
|
+
| Check Terms of Use | 8 |
|
|
1665
|
+
| Check Credits (Attribution) | 8 |
|
|
1666
|
+
| Check Sharing Level | 1 |
|
|
1667
|
+
| Check Delete Protection Setting | 1 |
|
|
1668
|
+
| Check Deprecated Setting | 1 |
|
|
1669
|
+
| Check HTTPS in URL | 1 |
|
|
1670
|
+
| Check Profile Thumbnail | 2 |
|
|
1671
|
+
| Check Profile Full Name | 2 |
|
|
1672
|
+
| Check Profile Description | 8 |
|
|
1673
|
+
|
|
1391
1674
|
## Issues
|
|
1392
1675
|
Find a bug or want to request a new feature? Please let us know by submitting an issue.
|
|
1393
1676
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureSettings.js","sourceRoot":"","sources":["../src/configureSettings.ts"],"names":[],"mappings":";;;AAAA,8EAAyE;AACzE,2EAAsH;AACtH,4DAA8D;AAC9D,qDAAuE;AAgHvE;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,iBAAiB,GAAG,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,iDAAiD,EACjD,WAAW,GACW,EAAE,EAAE;IAC1B,IAAI,WAAW,KAAK,KAAK,IAAI,WAAW,KAAK,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"configureSettings.js","sourceRoot":"","sources":["../src/configureSettings.ts"],"names":[],"mappings":";;;AAAA,8EAAyE;AACzE,2EAAsH;AACtH,4DAA8D;AAC9D,qDAAuE;AAgHvE;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,iBAAiB,GAAG,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,iDAAiD,EACjD,WAAW,GACW,EAAE,EAAE;IAC1B,IAAI,WAAW,KAAK,KAAK,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACX,0DAA0D,CAC7D,CAAC;IACN,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,YAAY,GAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACvE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAkB,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CACX,8CAA8C,YAAY,CAAC,IAAI,CAC3D,IAAI,CACP,GAAG,CACP,CAAC;IACN,CAAC;IAED,2CAA2C;IAC3C,IAAA,uBAAc,EAAC,WAAW,CAAC,CAAC;IAE5B,uCAAuC;IACvC,IAAA,0BAAU,EAAC,QAAQ,CAAC,CAAC;IAErB,MAAM,EACF,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,GAC/B,GAAG,iDAAiD,IAAI,EAAE,CAAC;IAE5D,8DAA8D;IAC9D,IAAA,6DAAoD,EAAC;QACjD,wBAAwB;QACxB,wBAAwB;QACxB,sBAAsB;QACtB,sBAAsB;QACtB,qBAAqB;QACrB,qBAAqB;QACrB,2BAA2B;QAC3B,2BAA2B;QAC3B,4BAA4B;KAC/B,CAAC,CAAC;IAEH,iCAAiC;IACjC,IAAA,iCAAc,EAAC,WAAW,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC,CAAC;AA1DW,QAAA,iBAAiB,qBA0D5B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationMessage, ValidationInfo, ValidationResult, ValidationResultStatus } from './types';
|
|
1
|
+
import { ValidationMessage, ValidationInfo, ValidationResult, ValidationResultStatus, FeatureLayerField, FeatureLayerJSON, FeatureLayerFieldValueType, FeatureServiceJSON } 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';
|
|
@@ -34,7 +34,11 @@ import { fetchProfanitiesData } from './services/content-validator-assets/fetchP
|
|
|
34
34
|
import { containsProfanity } from './lib/checkProfanities/checkProfanities';
|
|
35
35
|
import { getLivingAtlasSupportedItemTypes, checkIsLivingAtlasSupportedItemType } from './lib/util/getLivingAtlasSupportedItemTypes';
|
|
36
36
|
import { LivingAtlasSupportedItemType } from './lib/config';
|
|
37
|
-
|
|
37
|
+
import { checkFeatureServiceFieldDescriptions } from './lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions';
|
|
38
|
+
import { checkFeatureServiceFieldAliases } from './lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases';
|
|
39
|
+
import { checkFeatureServiceFieldValueTypes } from './lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes';
|
|
40
|
+
import { fetchFeatureServiceLayersAndTables } from './services/feature-service/fetchFeatureServiceLayersAndTables';
|
|
41
|
+
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, checkFeatureServiceFieldAliases, checkFeatureServiceFieldDescriptions, checkFeatureServiceFieldValueTypes, fetchFeatureServiceLayersAndTables, };
|
|
38
42
|
export { fetchAdditonalPatterns4TitleAndSnippetSearchability, fetchProfanitiesData, getSubmittedCustomTerms, getMyCustomTerms, addCustomTerms2FeatureTable, updateStatusOfCustomTermsInFeatureTable, getPackagedReviewResults, getReviewedReviewResults, getUnarchivedReviewResults, getDeployedReviewResults, getReviewResultsByTermAndCategory, addReviewResults2FeatureTable, updateReviewResultsInFeatureTable, getCustomTermsFeatureTableItemInfo, getCustomTermsReviewResultsFeatureTableItemInfo, containsProfanity, };
|
|
39
43
|
export { isValidRegexPattern, escapeSpecialCharacters };
|
|
40
|
-
export type { ValidationMessage, ValidationInfo, ValidationResult, ValidationRulesStringJSON, ValidationResultStatus, MatchResult, CustomTermFeature, CustomTermCategory, CustomTermStatus, CustomTermsReviewResultLifecycle, CustomTermReviewResultFeature, AdditionalPatterns4TitleAndSnippetSearchability, AddFeaturesResponse, LivingAtlasSupportedItemType, };
|
|
44
|
+
export type { ValidationMessage, ValidationInfo, ValidationResult, ValidationRulesStringJSON, ValidationResultStatus, MatchResult, CustomTermFeature, CustomTermCategory, CustomTermStatus, CustomTermsReviewResultLifecycle, CustomTermReviewResultFeature, AdditionalPatterns4TitleAndSnippetSearchability, AddFeaturesResponse, LivingAtlasSupportedItemType, FeatureLayerField, FeatureLayerJSON, FeatureLayerFieldValueType, FeatureServiceJSON, };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.escapeSpecialCharacters = exports.isValidRegexPattern = exports.containsProfanity = void 0;
|
|
3
|
+
exports.getReviewResultsByTermAndCategory = exports.getDeployedReviewResults = exports.getUnarchivedReviewResults = exports.getReviewedReviewResults = exports.getPackagedReviewResults = exports.updateStatusOfCustomTermsInFeatureTable = exports.addCustomTerms2FeatureTable = exports.getMyCustomTerms = exports.getSubmittedCustomTerms = exports.fetchProfanitiesData = exports.fetchAdditonalPatterns4TitleAndSnippetSearchability = exports.fetchFeatureServiceLayersAndTables = exports.checkFeatureServiceFieldValueTypes = exports.checkFeatureServiceFieldDescriptions = exports.checkFeatureServiceFieldAliases = 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 = exports.getCustomTermsReviewResultsFeatureTableItemInfo = exports.getCustomTermsFeatureTableItemInfo = exports.updateReviewResultsInFeatureTable = exports.addReviewResults2FeatureTable = void 0;
|
|
5
5
|
const isValidTitle_1 = require("./lib/title/isValidTitle");
|
|
6
6
|
Object.defineProperty(exports, "isValidTitle", { enumerable: true, get: function () { return isValidTitle_1.isValidTitle; } });
|
|
7
7
|
const isValidAccessInformation_1 = require("./lib/accessInformation/isValidAccessInformation");
|
|
@@ -89,4 +89,12 @@ Object.defineProperty(exports, "containsProfanity", { enumerable: true, get: fun
|
|
|
89
89
|
const getLivingAtlasSupportedItemTypes_1 = require("./lib/util/getLivingAtlasSupportedItemTypes");
|
|
90
90
|
Object.defineProperty(exports, "getLivingAtlasSupportedItemTypes", { enumerable: true, get: function () { return getLivingAtlasSupportedItemTypes_1.getLivingAtlasSupportedItemTypes; } });
|
|
91
91
|
Object.defineProperty(exports, "checkIsLivingAtlasSupportedItemType", { enumerable: true, get: function () { return getLivingAtlasSupportedItemTypes_1.checkIsLivingAtlasSupportedItemType; } });
|
|
92
|
+
const checkFeatureServiceFieldDescriptions_1 = require("./lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions");
|
|
93
|
+
Object.defineProperty(exports, "checkFeatureServiceFieldDescriptions", { enumerable: true, get: function () { return checkFeatureServiceFieldDescriptions_1.checkFeatureServiceFieldDescriptions; } });
|
|
94
|
+
const checkFeatureServiceFieldAliases_1 = require("./lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases");
|
|
95
|
+
Object.defineProperty(exports, "checkFeatureServiceFieldAliases", { enumerable: true, get: function () { return checkFeatureServiceFieldAliases_1.checkFeatureServiceFieldAliases; } });
|
|
96
|
+
const checkFeatureServiceFieldValueTypes_1 = require("./lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes");
|
|
97
|
+
Object.defineProperty(exports, "checkFeatureServiceFieldValueTypes", { enumerable: true, get: function () { return checkFeatureServiceFieldValueTypes_1.checkFeatureServiceFieldValueTypes; } });
|
|
98
|
+
const fetchFeatureServiceLayersAndTables_1 = require("./services/feature-service/fetchFeatureServiceLayersAndTables");
|
|
99
|
+
Object.defineProperty(exports, "fetchFeatureServiceLayersAndTables", { enumerable: true, get: function () { return fetchFeatureServiceLayersAndTables_1.fetchFeatureServiceLayersAndTables; } });
|
|
92
100
|
//# 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":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAgBA,2DAAwD;AA6GpD,6FA7GK,2BAAY,OA6GL;AA5GhB,+FAA4F;AA6GxF,yGA7GK,mDAAwB,OA6GL;AA5G5B,6EAA0E;AA6GtE,mGA7GK,uCAAkB,OA6GL;AA5GtB,yEAAyE;AACzE,6EAA0E;AA6GtE,mGA7GK,uCAAkB,OA6GL;AA5GtB,+DAA4D;AA6GxD,8FA7GK,6BAAa,OA6GL;AA5GjB,qDAAkD;AA6G9C,2FA7GK,uBAAU,OA6GL;AA5Gd,iEAA8D;AA6G1D,+FA7GK,+BAAc,OA6GL;AA5GlB,wDAAqD;AA6GjD,4FA7GK,yBAAW,OA6GL;AA5Gf,uEAAoE;AA6GhE,iGA7GK,mCAAgB,OA6GL;AA5GpB,8GAA2G;AA6GvG,8GA7GK,6DAA6B,OA6GL;AA5GjC,yFAAsF;AA6GlF,uGA7GK,+CAAsB,OA6GL;AA5G1B,wGAAqG;AA6GjG,4GA7GK,yDAA2B,OA6GL;AA5G/B,gEAA6D;AA6GzD,6FA7GK,2BAAY,OA6GL;AA5GhB,sDAAmD;AA6F/C,yFA7FK,mBAAQ,OA6FL;AA5FZ,gGAA6F,CAAC,kCAAkC;AA4G5H,0GA5GK,qDAAyB,OA4GL;AA3G7B,0EAA0E;AAC1E,iIAA8H;AA2G1H,kHA3GK,qEAAiC,OA2GL;AA1GrC,iGAImE;AAuG/D,kGA1GA,qCAAiB,OA0GA;AAIjB,qGA7GA,wCAAoB,OA6GA;AAIpB,uGAhHA,0CAAsB,OAgHA;AA9G1B,iGAImE;AAmG/D,kGAtGA,qCAAiB,OAsGA;AAIjB,yGAzGA,4CAAwB,OAyGA;AAIxB,uGA5GA,0CAAsB,OA4GA;AA1G1B,6FAIiE;AA+F7D,gGAlGA,iCAAe,OAkGA;AAIf,mGArGA,oCAAkB,OAqGA;AAIlB,qGAxGA,sCAAoB,OAwGA;AAtGxB,2FAIgE;AA2F5D,+FA9FA,+BAAc,OA8FA;AAId,kGAjGA,kCAAiB,OAiGA;AAIjB,oGApGA,oCAAmB,OAoGA;AAlGvB,6EAGyD;AAgGrD,kIAlGA,2DAAiD,OAkGA;AA/FrD,wEAAqE;AA8H5D,oGA9HA,yCAAmB,OA8HA;AA7H5B,0DAAuD;AAiGnD,6FAjGK,2BAAY,OAiGL;AA/FhB,4DAIkC;AA4F9B,iGA/FA,gCAAgB,OA+FA;AAChB,wGA9FA,uCAAuB,OA8FA;AA3F3B,2DAAwD;AAuDpD,kGAvDK,qCAAiB,OAuDL;AArDrB,0DAOiC;AA4F7B,wGAjGA,sCAAuB,OAiGA;AACvB,iGAjGA,+BAAgB,OAiGA;AAChB,4GAjGA,0CAA2B,OAiGA;AAC3B,wHAjGA,sDAAuC,OAiGA;AAQvC,mHAxGA,iDAAkC,OAwGA;AAnGtC,iKAGiG;AAmF7F,oIArFA,yGAAmD,OAqFA;AA5EvD,wFAWgD;AA4E5C,8GAtFA,2DAA6B,OAsFA;AAC7B,kHAtFA,+DAAiC,OAsFA;AANjC,yGA/EA,sDAAwB,OA+EA;AACxB,yGA/EA,sDAAwB,OA+EA;AACxB,2GA/EA,wDAA0B,OA+EA;AAC1B,yGA/EA,sDAAwB,OA+EA;AACxB,kHA/EA,+DAAiC,OA+EA;AAIjC,gIAhFA,6EAA+C,OAgFA;AA7EnD,gFAA6E;AAiF/C,wGAjFrB,iDAAuB,OAiFqB;AAhFrD,mGAAgG;AA+D5F,qGA/DK,2CAAoB,OA+DL;AA9DxB,8EAA4E;AA4ExE,kGA5EK,oCAAiB,OA4EL;AA3ErB,kGAGqD;AA6CjD,iHA/CA,mEAAgC,OA+CA;AAChC,oHA/CA,sEAAmC,OA+CA;AA1CvC,qIAAkI;AA+C9H,qHA/CK,2EAAoC,OA+CL;AA7CxC,sHAAmH;AA4C/G,gHA5CK,iEAA+B,OA4CL;AA1CnC,+HAA4H;AA4CxH,mHA5CK,uEAAkC,OA4CL;AA1CtC,sHAAmH;AA2C/G,mHA3CK,uEAAkC,OA2CL"}
|
|
@@ -16,15 +16,12 @@ const scoringConfig_1 = require("./scoringConfig");
|
|
|
16
16
|
*/
|
|
17
17
|
const isValidAccessInformation = (item) => {
|
|
18
18
|
const { accessInformation } = item;
|
|
19
|
-
//
|
|
20
|
-
const
|
|
21
|
-
// // scoring rules
|
|
22
|
-
// const SCORING = getScoringRules(item, scoringRulesConfig);
|
|
19
|
+
// scoring factors that will be used to calculate the final score
|
|
20
|
+
const scoringFactors = scoringConfig_1.scoringConfig.scoringFactors.DEFAULT;
|
|
23
21
|
const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
|
|
24
22
|
const validAccessInformation = (0, assertString_1.assertString)(item.accessInformation) && !(0, isEmpty_1.isEmpty)(accessInformation);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// property: 'accessInformation',
|
|
23
|
+
const validationOutput = {
|
|
24
|
+
validationRuleId: 'item-credits-attribution-info',
|
|
28
25
|
label: stringsConfig.accessInformation.LABEL,
|
|
29
26
|
title: stringsConfig.accessInformation.TITLE,
|
|
30
27
|
// the maxScore and score will be calculated afterward using weight and weight factor
|
|
@@ -38,12 +35,12 @@ const isValidAccessInformation = (item) => {
|
|
|
38
35
|
},
|
|
39
36
|
],
|
|
40
37
|
weight: scoringConfig_1.scoringConfig.weight,
|
|
41
|
-
|
|
38
|
+
scoringFactor: validAccessInformation ? scoringFactors.EXIST_FACTOR : 0,
|
|
42
39
|
// critical: false,
|
|
43
40
|
status: 'unknown',
|
|
44
41
|
isBinaryCheck: false,
|
|
45
42
|
};
|
|
46
|
-
return
|
|
43
|
+
return validationOutput;
|
|
47
44
|
};
|
|
48
45
|
exports.isValidAccessInformation = isValidAccessInformation;
|
|
49
46
|
//# sourceMappingURL=isValidAccessInformation.js.map
|
|
@@ -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,
|
|
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,iEAAiE;IACjE,MAAM,cAAc,GAAG,6BAAa,CAAC,cAAc,CAAC,OAAO,CAAC;IAE5D,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,MAAM,gBAAgB,GAAmB;QACrC,gBAAgB,EAAE,+BAA+B;QACjD,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,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACvE,mBAAmB;QACnB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,KAAK;KACvB,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AAlCW,QAAA,wBAAwB,4BAkCnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/accessInformation/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,cAAc,EAAE;QACZ,OAAO,EAAE;YACL,YAAY,EAAE,CAAC;SAClB;QACD,mBAAmB;QACnB,uBAAuB;QACvB,KAAK;KACR;CACJ,CAAC"}
|