@vannizhang/living-atlas-content-validator 1.5.9 → 1.5.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.
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/description/isValidDescription.js +20 -23
- package/dist/lib/description/isValidDescription.js.map +1 -1
- package/dist/lib/util/stringsConfig.d.ts +5 -3
- package/dist/lib/util/stringsConfig.js.map +1 -1
- package/dist/locale/de.json +0 -5
- package/dist/locale/en.json +0 -5
- package/dist/locale/es.json +0 -5
- package/dist/locale/fr.json +0 -5
- package/dist/locale/ja.json +0 -5
- package/dist/locale/pt-br.json +0 -5
- package/dist/package-info.json +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ import { isValidUserProfileName } from './lib/userProfileName/isValidUserProfile
|
|
|
14
14
|
import { isValidUserProfileThumbnail } from './lib/userProfileThumbnail/isValidUserProfileThumbnail';
|
|
15
15
|
import { isDeprecated } from './lib/deprecated/isDeprecated';
|
|
16
16
|
import { validate, meetMinimumTotalScore } from './lib/validate/validate';
|
|
17
|
-
import { setStrings, getStringsConfig } from './lib/util/stringsConfig';
|
|
18
|
-
export { ValidationMessage, ValidationInfo, ValidationResult, setStrings, getStringsConfig, validate, meetMinimumTotalScore, isValidTitle, isValidAccessInformation, isValidDescription, isValidLayerCount, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, isDeprecated, };
|
|
17
|
+
import { setStrings, getStringsConfig, ValidationRulesStringJSON } from './lib/util/stringsConfig';
|
|
18
|
+
export { ValidationMessage, ValidationInfo, ValidationResult, ValidationRulesStringJSON, setStrings, getStringsConfig, validate, meetMinimumTotalScore, isValidTitle, isValidAccessInformation, isValidDescription, isValidLayerCount, isValidLicenseInfo, isValidAccess, isValidSSL, isValidSummary, isValidTags, isValidThumbnail, isValidUserProfileDescription, isValidUserProfileName, isValidUserProfileThumbnail, isDeprecated, };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAWA,2DAAwD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAWA,2DAAwD;AAwCpD,6FAxCK,2BAAY,OAwCL;AAvChB,+FAA4F;AAwCxF,yGAxCK,mDAAwB,OAwCL;AAvC5B,6EAA0E;AAwCtE,mGAxCK,uCAAkB,OAwCL;AAvCtB,sEAAmE;AAwC/D,kGAxCK,qCAAiB,OAwCL;AAvCrB,6EAA0E;AAwCtE,mGAxCK,uCAAkB,OAwCL;AAvCtB,+DAA4D;AAwCxD,8FAxCK,6BAAa,OAwCL;AAvCjB,qDAAkD;AAwC9C,2FAxCK,uBAAU,OAwCL;AAvCd,iEAA8D;AAwC1D,+FAxCK,+BAAc,OAwCL;AAvClB,wDAAqD;AAwCjD,4FAxCK,yBAAW,OAwCL;AAvCf,uEAAoE;AAwChE,iGAxCK,mCAAgB,OAwCL;AAvCpB,8GAA2G;AAwCvG,8GAxCK,6DAA6B,OAwCL;AAvCjC,yFAAsF;AAwClF,uGAxCK,+CAAsB,OAwCL;AAvC1B,wGAAqG;AAwCjG,4GAxCK,yDAA2B,OAwCL;AAvC/B,gEAA6D;AAwCzD,6FAxCK,2BAAY,OAwCL;AAvChB,sDAA0E;AAwBtE,yFAxBK,mBAAQ,OAwBL;AACR,sGAzBe,gCAAqB,OAyBf;AAvBzB,4DAIkC;AAgB9B,2FAnBA,0BAAU,OAmBA;AACV,iGAnBA,gCAAgB,OAmBA"}
|
|
@@ -12,8 +12,6 @@ const isEmpty_1 = require("../util/isEmpty");
|
|
|
12
12
|
const getScoringRules_1 = require("../util/getScoringRules");
|
|
13
13
|
const stringsConfig_1 = require("../util/stringsConfig");
|
|
14
14
|
const scoringConfig_1 = require("./scoringConfig");
|
|
15
|
-
const findDataSource_1 = require("./findDataSource");
|
|
16
|
-
const checkIsLayer_1 = require("../util/checkIsLayer");
|
|
17
15
|
/**
|
|
18
16
|
* Validate an item's description. A valid description must meet these rules below:
|
|
19
17
|
*
|
|
@@ -33,8 +31,8 @@ const checkIsLayer_1 = require("../util/checkIsLayer");
|
|
|
33
31
|
*/
|
|
34
32
|
const isValidDescription = (item) => {
|
|
35
33
|
const { description } = item;
|
|
36
|
-
// check and see if the input item is Layer
|
|
37
|
-
const isLayer =
|
|
34
|
+
// // check and see if the input item is Layer
|
|
35
|
+
// const isLayer = checkIsLayer(item);
|
|
38
36
|
// scoring rules locale
|
|
39
37
|
const locale = (0, getScoringRules_1.getScoringRulesLocale)(item.culture);
|
|
40
38
|
let weightFactors = scoringConfig_1.scoringConfig.weightFactors.DEFAULT;
|
|
@@ -45,10 +43,10 @@ const isValidDescription = (item) => {
|
|
|
45
43
|
// for non-english items, use the International weight factors
|
|
46
44
|
weightFactors = scoringConfig_1.scoringConfig.weightFactors.INTERNATIONAL;
|
|
47
45
|
}
|
|
48
|
-
else if (isLayer) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
46
|
+
// else if (isLayer) {
|
|
47
|
+
// // for Layers, use the Layers weight factors
|
|
48
|
+
// weightFactors = scoringConfig.weightFactors.LAYERS;
|
|
49
|
+
// }
|
|
52
50
|
// // scoring rules
|
|
53
51
|
// const SCORING = getScoringRules(item, scoringRulesConfig);
|
|
54
52
|
const stringsConfig = (0, stringsConfig_1.getStringsConfig)();
|
|
@@ -69,11 +67,11 @@ const isValidDescription = (item) => {
|
|
|
69
67
|
weightFactor: 0,
|
|
70
68
|
critical: true,
|
|
71
69
|
};
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const shouldCheckDataSource = locale === 'en' && isLayer;
|
|
70
|
+
// /**
|
|
71
|
+
// * We should check the Description and see if it contains key words like "Data Source" or similar
|
|
72
|
+
// * for all layer items (English-based)
|
|
73
|
+
// */
|
|
74
|
+
// const shouldCheckDataSource = locale === 'en' && isLayer;
|
|
77
75
|
// remove html tags
|
|
78
76
|
const sanitizedStr = (0, sanitize_html_1.default)(description, {
|
|
79
77
|
allowedTags: [],
|
|
@@ -117,16 +115,15 @@ const isValidDescription = (item) => {
|
|
|
117
115
|
// issues.score += SCORING.MIN_LENGTH_SCORE;
|
|
118
116
|
issues.weightFactor += weightFactors.MIN_LENGTH_FACTOR;
|
|
119
117
|
}
|
|
120
|
-
// For non-internation items that are also Layers, we need to check if the description
|
|
121
|
-
// contains the key word similar to "data source"
|
|
122
|
-
if (shouldCheckDataSource &&
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
118
|
+
// // For non-internation items that are also Layers, we need to check if the description
|
|
119
|
+
// // contains the key word similar to "data source"
|
|
120
|
+
// if (shouldCheckDataSource && containsDataSource(description) === false) {
|
|
121
|
+
// issues.messages.push({
|
|
122
|
+
// message: stringsConfig.description.CONTAINS_SOURCE_MESSAGE,
|
|
123
|
+
// });
|
|
124
|
+
// } else {
|
|
125
|
+
// issues.weightFactor += weightFactors.HAS_SOURCE;
|
|
126
|
+
// }
|
|
130
127
|
if (locale === 'international') {
|
|
131
128
|
issues.critical = false;
|
|
132
129
|
}
|
|
@@ -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,yDAAyD;AACzD,mDAAgD;
|
|
1
|
+
{"version":3,"file":"isValidDescription.js","sourceRoot":"","sources":["../../../src/lib/description/isValidDescription.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAyC;AACzC,yDAAyD;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AC7B,sEAAsE;IACtE,UAAU;IACV,WAAW;IACX,uDAAuD;IACvD,IAAI;IAEJ,IAAI,MAAM,KAAK,eAAe,EAAE;QAC5B,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;KAC3B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AApHW,QAAA,kBAAkB,sBAoH7B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import enStringsConfig from '../../locale/en.json';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A JSON file contains strings for all validation rules
|
|
4
|
+
*/
|
|
5
|
+
export type ValidationRulesStringJSON = typeof enStringsConfig;
|
|
3
6
|
/**
|
|
4
7
|
* Set user preferred language for output Strings JSON file that contains messages for validation results
|
|
5
8
|
* @param preferredLocale
|
|
@@ -9,5 +12,4 @@ export declare const setStrings: (preferredLocale: string) => void;
|
|
|
9
12
|
* Get Strings Config data for user preferred language
|
|
10
13
|
* @returns
|
|
11
14
|
*/
|
|
12
|
-
export declare const getStringsConfig: () =>
|
|
13
|
-
export {};
|
|
15
|
+
export declare const getStringsConfig: () => ValidationRulesStringJSON;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringsConfig.js","sourceRoot":"","sources":["../../../src/lib/util/stringsConfig.ts"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,mEAAmD;AACnD,mEAAmD;AACnD,mEAAmD;AACnD,mEAAmD;AACnD,mEAAmD;AACnD,yEAAwD;
|
|
1
|
+
{"version":3,"file":"stringsConfig.js","sourceRoot":"","sources":["../../../src/lib/util/stringsConfig.ts"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,mEAAmD;AACnD,mEAAmD;AACnD,mEAAmD;AACnD,mEAAmD;AACnD,mEAAmD;AACnD,yEAAwD;AAYxD;;GAEG;AACH,IAAI,MAAM,GAAW,IAAI,CAAC;AAE1B,MAAM,eAAe,GAA8C;IAC/D,EAAE,EAAE,iBAAe;IACnB,EAAE,EAAE,iBAAe;IACnB,EAAE,EAAE,iBAAe;IACnB,EAAE,EAAE,iBAAe;IACnB,EAAE,EAAE,iBAAe;IACnB,OAAO,EAAE,oBAAiB;CAC7B,CAAC;AAEF;;;GAGG;AACI,MAAM,UAAU,GAAG,CAAC,eAAuB,EAAE,EAAE;IAClD,MAAM,YAAY,GAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAEvE,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,eAAyB,CAAC;QACrD,CAAC,CAAE,eAA0B;QAC7B,CAAC,CAAC,IAAI,CAAC;AACf,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,GAA8B,EAAE;IAC5D,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,iBAAe,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B"}
|
package/dist/locale/de.json
CHANGED
|
@@ -160,10 +160,5 @@
|
|
|
160
160
|
"LABEL": "Profilminiaturansicht verbessern",
|
|
161
161
|
"TITLE": "Profilminiaturansicht prüfen",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "Eine gute Miniaturansicht zum Profil hinzufügen"
|
|
163
|
-
},
|
|
164
|
-
"tooltips": {
|
|
165
|
-
"tooltip_section_label_suggestion_label": "Vorschläge",
|
|
166
|
-
"tooltip_section_label_guidance_label": "Anleitung",
|
|
167
|
-
"tooltip_section_label_score_label": "Punktzahl"
|
|
168
163
|
}
|
|
169
164
|
}
|
package/dist/locale/en.json
CHANGED
|
@@ -160,10 +160,5 @@
|
|
|
160
160
|
"LABEL": "Improve Profile Thumbnail",
|
|
161
161
|
"TITLE": "Check Profile Thumbnail",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "Add a good thumbnail to Profile"
|
|
163
|
-
},
|
|
164
|
-
"tooltips": {
|
|
165
|
-
"tooltip_section_label_suggestion_label": "Suggestions",
|
|
166
|
-
"tooltip_section_label_guidance_label": "Guidance",
|
|
167
|
-
"tooltip_section_label_score_label": "Score"
|
|
168
163
|
}
|
|
169
164
|
}
|
package/dist/locale/es.json
CHANGED
|
@@ -160,10 +160,5 @@
|
|
|
160
160
|
"LABEL": "Mejorar el perfil Vista en miniatura",
|
|
161
161
|
"TITLE": "Comprobar el perfil Vista en miniatura",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "Agregar una buena miniatura al perfil"
|
|
163
|
-
},
|
|
164
|
-
"tooltips": {
|
|
165
|
-
"tooltip_section_label_suggestion_label": "Sugerencias",
|
|
166
|
-
"tooltip_section_label_guidance_label": "Orientación",
|
|
167
|
-
"tooltip_section_label_score_label": "Puntuación"
|
|
168
163
|
}
|
|
169
164
|
}
|
package/dist/locale/fr.json
CHANGED
|
@@ -160,10 +160,5 @@
|
|
|
160
160
|
"LABEL": "Améliorer la miniature du profil",
|
|
161
161
|
"TITLE": "Vérifier la miniature du profil",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "Ajoutez une miniature soignée au profil"
|
|
163
|
-
},
|
|
164
|
-
"tooltips": {
|
|
165
|
-
"tooltip_section_label_suggestion_label": "Suggestions",
|
|
166
|
-
"tooltip_section_label_guidance_label": "Conseils",
|
|
167
|
-
"tooltip_section_label_score_label": "Score"
|
|
168
163
|
}
|
|
169
164
|
}
|
package/dist/locale/ja.json
CHANGED
|
@@ -160,10 +160,5 @@
|
|
|
160
160
|
"LABEL": "プロフィールのサムネイルの改善",
|
|
161
161
|
"TITLE": "プロフィールのサムネイルの確認",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "プロフィールに適切なサムネイルを追加する"
|
|
163
|
-
},
|
|
164
|
-
"tooltips": {
|
|
165
|
-
"tooltip_section_label_suggestion_label": "候補",
|
|
166
|
-
"tooltip_section_label_guidance_label": "ガイダンス",
|
|
167
|
-
"tooltip_section_label_score_label": "スコア"
|
|
168
163
|
}
|
|
169
164
|
}
|
package/dist/locale/pt-br.json
CHANGED
|
@@ -160,10 +160,5 @@
|
|
|
160
160
|
"LABEL": "Melhorar a Miniatura do Perfil",
|
|
161
161
|
"TITLE": "Verificar Miniatura do Perfil",
|
|
162
162
|
"EMPTY_STRING_MESSAGE": "Adicione uma boa miniatura ao perfil"
|
|
163
|
-
},
|
|
164
|
-
"tooltips": {
|
|
165
|
-
"tooltip_section_label_suggestion_label": "Sugestões",
|
|
166
|
-
"tooltip_section_label_guidance_label": "Guia",
|
|
167
|
-
"tooltip_section_label_score_label": "Pontuação"
|
|
168
163
|
}
|
|
169
164
|
}
|
package/dist/package-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"lastCompiledTime":
|
|
1
|
+
{"lastCompiledTime":1718645746573}
|