@vannizhang/living-atlas-content-validator 1.5.19-beta.3 → 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.
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/util/getRelevantFeatureLayerFields.d.ts +2 -2
- package/dist/lib/util/getRelevantFeatureLayerFields.js +11 -1
- package/dist/lib/util/getRelevantFeatureLayerFields.js.map +1 -1
- package/dist/package-info.json +1 -1
- package/dist/types/index.d.ts +26 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationMessage, ValidationInfo, ValidationResult, ValidationResultStatus,
|
|
1
|
+
import { ValidationMessage, ValidationInfo, ValidationResult, ValidationResultStatus, FeatureLayerFieldRaw, FeatureLayerFieldFormatted, 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';
|
|
@@ -41,4 +41,4 @@ import { fetchFeatureServiceLayersAndTables } from './services/feature-service/f
|
|
|
41
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, };
|
|
42
42
|
export { fetchAdditonalPatterns4TitleAndSnippetSearchability, fetchProfanitiesData, getSubmittedCustomTerms, getMyCustomTerms, addCustomTerms2FeatureTable, updateStatusOfCustomTermsInFeatureTable, getPackagedReviewResults, getReviewedReviewResults, getUnarchivedReviewResults, getDeployedReviewResults, getReviewResultsByTermAndCategory, addReviewResults2FeatureTable, updateReviewResultsInFeatureTable, getCustomTermsFeatureTableItemInfo, getCustomTermsReviewResultsFeatureTableItemInfo, containsProfanity, };
|
|
43
43
|
export { isValidRegexPattern, escapeSpecialCharacters };
|
|
44
|
-
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, FeatureLayerFieldRaw, FeatureLayerFieldFormatted, FeatureLayerJSON, FeatureLayerFieldValueType, FeatureServiceJSON, };
|
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":";;;;AAiBA,2DAAwD;AA6GpD,6FA7GK,2BAAY,OA6GL;AA5GhB,+FAA4F;AA6GxF,yGA7GK,m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|
|
2
2
|
/**
|
|
3
3
|
* Extracts and returns relevant fields from an array of feature layer JSON objects.
|
|
4
4
|
*
|
|
@@ -10,4 +10,4 @@ import { FeatureLayerField, FeatureLayerJSON } from '../../types';
|
|
|
10
10
|
* @param featureLayers - An array of `FeatureLayerJSON` objects to extract fields from.
|
|
11
11
|
* @returns An array of `FeatureLayerField` objects that are considered relevant.
|
|
12
12
|
*/
|
|
13
|
-
export declare const getRelevantFeatureLayerFields: (featureLayers: FeatureLayerJSON[]) =>
|
|
13
|
+
export declare const getRelevantFeatureLayerFields: (featureLayers: FeatureLayerJSON[]) => FeatureLayerFieldFormatted[];
|
|
@@ -36,7 +36,17 @@ const getRelevantFeatureLayerFields = (featureLayers) => {
|
|
|
36
36
|
if (fieldName === 'SHAPE__AREA' || fieldName === 'SHAPE__LENGTH') {
|
|
37
37
|
continue;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
let parsedDescription = null;
|
|
40
|
+
if (typeof field.description === 'string') {
|
|
41
|
+
try {
|
|
42
|
+
parsedDescription = JSON.parse(field.description);
|
|
43
|
+
}
|
|
44
|
+
catch (_a) {
|
|
45
|
+
parsedDescription = null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const formattedField = Object.assign(Object.assign({}, field), { description: parsedDescription });
|
|
49
|
+
featureLayerFields.push(formattedField);
|
|
40
50
|
}
|
|
41
51
|
}
|
|
42
52
|
return featureLayerFields;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelevantFeatureLayerFields.js","sourceRoot":"","sources":["../../../src/lib/util/getRelevantFeatureLayerFields.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACI,MAAM,6BAA6B,GAAG,CACzC,aAAiC,
|
|
1
|
+
{"version":3,"file":"getRelevantFeatureLayerFields.js","sourceRoot":"","sources":["../../../src/lib/util/getRelevantFeatureLayerFields.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACI,MAAM,6BAA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,CAAC,CAAC;gBACtD,CAAC;gBAAC,WAAM,CAAC;oBACL,iBAAiB,GAAG,IAAI,CAAC;gBAC7B,CAAC;YACL,CAAC;YACD,MAAM,cAAc,mCACb,KAAK,KACR,WAAW,EAAE,iBAAiB,GACjC,CAAC;YAEF,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC9B,CAAC,CAAC;AArDW,QAAA,6BAA6B,iCAqDxC"}
|
package/dist/package-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"lastCompiledTime":
|
|
1
|
+
{"lastCompiledTime":1747775562296}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -292,7 +292,7 @@ export type FeatureServiceJSON = {
|
|
|
292
292
|
*
|
|
293
293
|
* @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-layer.htm
|
|
294
294
|
*/
|
|
295
|
-
|
|
295
|
+
type FeatureLayerField = {
|
|
296
296
|
name: string;
|
|
297
297
|
type: string;
|
|
298
298
|
alias: string;
|
|
@@ -302,16 +302,36 @@ export type FeatureLayerField = {
|
|
|
302
302
|
sqlType?: string;
|
|
303
303
|
nullable?: boolean;
|
|
304
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 & {
|
|
305
325
|
description?: {
|
|
306
326
|
/**
|
|
307
|
-
*
|
|
327
|
+
* A brief description of the field, up to 500 characters.
|
|
308
328
|
*/
|
|
309
329
|
value: string;
|
|
310
330
|
/**
|
|
311
|
-
*
|
|
331
|
+
* A keyword categorizing the type of values in the field, used for smarter suggestions in ArcGIS Online.
|
|
312
332
|
*/
|
|
313
333
|
fieldValueType: FeatureLayerFieldValueType;
|
|
314
|
-
};
|
|
334
|
+
} | null;
|
|
315
335
|
};
|
|
316
336
|
/**
|
|
317
337
|
* Represents the field value type of a feature layer.
|
|
@@ -352,7 +372,7 @@ export type FeatureLayerJSON = {
|
|
|
352
372
|
/**
|
|
353
373
|
* the feature layer's fields
|
|
354
374
|
*/
|
|
355
|
-
fields:
|
|
375
|
+
fields: FeatureLayerFieldRaw[];
|
|
356
376
|
};
|
|
357
377
|
/**
|
|
358
378
|
* Represents the response from the Feature Service layers endpoint.
|
|
@@ -364,3 +384,4 @@ export type FeatureServiceLayersResponse = {
|
|
|
364
384
|
tables: FeatureLayerJSON[];
|
|
365
385
|
error?: Error;
|
|
366
386
|
};
|
|
387
|
+
export {};
|
package/package.json
CHANGED