@vannizhang/living-atlas-content-validator 1.5.12 → 1.5.14
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/data/TitleSummaryMatchingPatterns.json +1901 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/layers/scoringConfig.js +1 -1
- package/dist/lib/recommendedText/checkRecommendedText.d.ts +15 -0
- package/dist/lib/recommendedText/checkRecommendedText.js +95 -0
- package/dist/lib/recommendedText/checkRecommendedText.js.map +1 -0
- package/dist/lib/recommendedText/helpers.d.ts +8 -0
- package/dist/lib/recommendedText/helpers.js +44 -0
- package/dist/lib/recommendedText/helpers.js.map +1 -0
- package/dist/lib/recommendedText/matchDateTimeInfo.d.ts +9 -0
- package/dist/lib/recommendedText/matchDateTimeInfo.js +80 -0
- package/dist/lib/recommendedText/matchDateTimeInfo.js.map +1 -0
- package/dist/lib/recommendedText/matchLocationInfo.d.ts +9 -0
- package/dist/lib/recommendedText/matchLocationInfo.js +744 -0
- package/dist/lib/recommendedText/matchLocationInfo.js.map +1 -0
- package/dist/lib/recommendedText/matchSourceInfo.d.ts +9 -0
- package/dist/lib/recommendedText/matchSourceInfo.js +31 -0
- package/dist/lib/recommendedText/matchSourceInfo.js.map +1 -0
- package/dist/lib/recommendedText/matchTopicInfo.d.ts +9 -0
- package/dist/lib/recommendedText/matchTopicInfo.js +31 -0
- package/dist/lib/recommendedText/matchTopicInfo.js.map +1 -0
- package/dist/lib/recommendedText/scoringConfig.d.ts +11 -0
- package/dist/lib/recommendedText/scoringConfig.js +16 -0
- package/dist/lib/recommendedText/scoringConfig.js.map +1 -0
- package/dist/lib/ssl/scoringConfig.js +1 -1
- package/dist/lib/tags/scoringConfig.js +1 -1
- package/dist/lib/tags/scoringConfig.js.map +1 -1
- package/dist/lib/thumbnail/scoringConfig.js +1 -1
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +4 -4
- package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
- package/dist/lib/userProfileDescription/scoringConfig.js +9 -9
- package/dist/lib/userProfileName/scoringConfig.js +3 -3
- package/dist/lib/userProfileThumbnail/scoringConfig.js +1 -1
- package/dist/lib/util/getScoringRules.d.ts +8 -0
- package/dist/lib/util/getScoringRules.js +28 -1
- package/dist/lib/util/getScoringRules.js.map +1 -1
- package/dist/lib/util/isLayer.d.ts +12 -0
- package/dist/lib/util/isLayer.js +26 -0
- package/dist/lib/util/isLayer.js.map +1 -0
- package/dist/lib/util/isUrl.d.ts +1 -1
- package/dist/lib/util/isUrl.js +4 -2
- package/dist/lib/util/isUrl.js.map +1 -1
- package/dist/lib/util/shouldValidateByBetaRules.d.ts +10 -0
- package/dist/lib/util/shouldValidateByBetaRules.js +53 -0
- package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -0
- package/dist/lib/validate/validate.js +5 -0
- package/dist/lib/validate/validate.js.map +1 -1
- package/dist/locale/de.json +11 -1
- package/dist/locale/en.json +10 -0
- package/dist/locale/es.json +10 -0
- package/dist/locale/fr.json +10 -0
- package/dist/locale/ja.json +10 -0
- package/dist/locale/pt-br.json +10 -0
- package/dist/package-info.json +1 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchLocationInfo.js","sourceRoot":"","sources":["../../../src/lib/recommendedText/matchLocationInfo.ts"],"names":[],"mappings":";;;;;;AACA,uCAA0D;AAC1D,qHAAwF;AAExF,MAAM,eAAe,GAAG;IACpB,aAAa;IACb,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,qBAAqB;IACrB,WAAW;IACX,SAAS;IACT,OAAO;IACP,WAAW;IACX,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,SAAS;IACT,YAAY;IACZ,UAAU;IACV,SAAS;IACT,SAA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AAM,aAAa,GAAG,IAAI,MAAM,CAAC,OAAO,gBAAgB,MAAM,EAAE,IAAI,CAAC,CAAC;IAEtE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAEnC,MAAM,yBAAyB,GAC3B,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,2BAA2B,GAC7B,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAEvC,MAAM,gBAAgB,GAAG;QACrB,GAAG,yBAAyB;QAC5B,GAAG,2BAA2B;KACjC,CAAC;IAEF,MAAM,UAAU,GAAa,IAAA,qBAAW,EAAC,gBAAgB,CAAC,CAAC;IAE3D,OAAO,IAAA,0BAAgB,EAAC,UAAU,CAAC,CAAC;AACxC,CAAC,CAAC;AA5BW,QAAA,iBAAiB,qBA4B5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IItem } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Matches source information from an item's title and snippet using predefined or custom matching patterns.
|
|
4
|
+
*
|
|
5
|
+
* @param {IItem} item - The item containing title and snippet to search for matching patterns.
|
|
6
|
+
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be used in addition to the predefined ones.
|
|
7
|
+
* @returns {string[]} - An array of matched strings after deduplication and removal of overlaps.
|
|
8
|
+
*/
|
|
9
|
+
export declare const matchSourceInfo: (item: IItem, customMatchingPattenrs?: string[]) => string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.matchSourceInfo = void 0;
|
|
7
|
+
const helpers_1 = require("./helpers");
|
|
8
|
+
const TitleSummaryMatchingPatterns_json_1 = __importDefault(require("../../data/TitleSummaryMatchingPatterns.json"));
|
|
9
|
+
let matchingPatterns = TitleSummaryMatchingPatterns_json_1.default.sources.join('|');
|
|
10
|
+
/**
|
|
11
|
+
* Matches source information from an item's title and snippet using predefined or custom matching patterns.
|
|
12
|
+
*
|
|
13
|
+
* @param {IItem} item - The item containing title and snippet to search for matching patterns.
|
|
14
|
+
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be used in addition to the predefined ones.
|
|
15
|
+
* @returns {string[]} - An array of matched strings after deduplication and removal of overlaps.
|
|
16
|
+
*/
|
|
17
|
+
const matchSourceInfo = (item, customMatchingPattenrs) => {
|
|
18
|
+
const title = item.title || '';
|
|
19
|
+
const snippet = item.snippet || '';
|
|
20
|
+
if (customMatchingPattenrs) {
|
|
21
|
+
matchingPatterns = `${matchingPatterns}|${customMatchingPattenrs.join('|')}`;
|
|
22
|
+
}
|
|
23
|
+
const combinedRegex = new RegExp(`\\b(${matchingPatterns})\\b`, 'gi');
|
|
24
|
+
const matchedStrFromTitle = title.match(combinedRegex) || [];
|
|
25
|
+
const matchedStrFromSnippet = snippet.match(combinedRegex) || [];
|
|
26
|
+
const matched = [...matchedStrFromTitle, ...matchedStrFromSnippet];
|
|
27
|
+
const candidates = (0, helpers_1.deduplicate)(matched);
|
|
28
|
+
return (0, helpers_1.removeOverlapped)(candidates);
|
|
29
|
+
};
|
|
30
|
+
exports.matchSourceInfo = matchSourceInfo;
|
|
31
|
+
//# sourceMappingURL=matchSourceInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchSourceInfo.js","sourceRoot":"","sources":["../../../src/lib/recommendedText/matchSourceInfo.ts"],"names":[],"mappings":";;;;;;AACA,uCAA0D;AAC1D,qHAAwF;AAExF,IAAI,gBAAgB,GAAG,2CAA4B,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEtE;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC3B,IAAW,EACX,sBAAiC,EACzB,EAAE;IACV,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAEnC,IAAI,sBAAsB,EAAE;QACxB,gBAAgB,GAAG,GAAG,gBAAgB,IAAI,sBAAsB,CAAC,IAAI,CACjE,GAAG,CACN,EAAE,CAAC;KACP;IAED,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,OAAO,gBAAgB,MAAM,EAAE,IAAI,CAAC,CAAC;IAEtE,MAAM,mBAAmB,GAAa,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IACvE,MAAM,qBAAqB,GAAa,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAE3E,MAAM,OAAO,GAAG,CAAC,GAAG,mBAAmB,EAAE,GAAG,qBAAqB,CAAC,CAAC;IAEnE,MAAM,UAAU,GAAa,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;IAElD,OAAO,IAAA,0BAAgB,EAAC,UAAU,CAAC,CAAC;AACxC,CAAC,CAAC;AAvBW,QAAA,eAAe,mBAuB1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IItem } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Matches topic information from an item's title and snippet using predefined or custom matching patterns.
|
|
4
|
+
*
|
|
5
|
+
* @param {IItem} item - The item containing the title and snippet to be matched.
|
|
6
|
+
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be used in addition to the predefined ones.
|
|
7
|
+
* @returns {string[]} - An array of matched topic strings, deduplicated and with overlaps removed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const matchTopicInfo: (item: IItem, customMatchingPattenrs?: string[]) => string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.matchTopicInfo = void 0;
|
|
7
|
+
const helpers_1 = require("./helpers");
|
|
8
|
+
const TitleSummaryMatchingPatterns_json_1 = __importDefault(require("../../data/TitleSummaryMatchingPatterns.json"));
|
|
9
|
+
let matchingPatterns = TitleSummaryMatchingPatterns_json_1.default.topics.join('|');
|
|
10
|
+
/**
|
|
11
|
+
* Matches topic information from an item's title and snippet using predefined or custom matching patterns.
|
|
12
|
+
*
|
|
13
|
+
* @param {IItem} item - The item containing the title and snippet to be matched.
|
|
14
|
+
* @param {string[]} [customMatchingPattenrs] - Optional custom matching patterns to be used in addition to the predefined ones.
|
|
15
|
+
* @returns {string[]} - An array of matched topic strings, deduplicated and with overlaps removed.
|
|
16
|
+
*/
|
|
17
|
+
const matchTopicInfo = (item, customMatchingPattenrs) => {
|
|
18
|
+
const title = item.title || '';
|
|
19
|
+
const snippet = item.snippet || '';
|
|
20
|
+
if (customMatchingPattenrs) {
|
|
21
|
+
matchingPatterns = `${matchingPatterns}|${customMatchingPattenrs.join('|')}`;
|
|
22
|
+
}
|
|
23
|
+
const combinedRegex = new RegExp(`\\b(${matchingPatterns})\\b`, 'gi');
|
|
24
|
+
const matchedStrFromTitle = title.match(combinedRegex) || [];
|
|
25
|
+
const matchedStrFromSnippet = snippet.match(combinedRegex) || [];
|
|
26
|
+
const matched = [...matchedStrFromTitle, ...matchedStrFromSnippet];
|
|
27
|
+
const candidates = (0, helpers_1.deduplicate)(matched);
|
|
28
|
+
return (0, helpers_1.removeOverlapped)(candidates);
|
|
29
|
+
};
|
|
30
|
+
exports.matchTopicInfo = matchTopicInfo;
|
|
31
|
+
//# sourceMappingURL=matchTopicInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchTopicInfo.js","sourceRoot":"","sources":["../../../src/lib/recommendedText/matchTopicInfo.ts"],"names":[],"mappings":";;;;;;AACA,uCAA0D;AAC1D,qHAAwF;AAExF,IAAI,gBAAgB,GAAG,2CAA4B,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAErE;;;;;;GAMG;AACI,MAAM,cAAc,GAAG,CAC1B,IAAW,EACX,sBAAiC,EACzB,EAAE;IACV,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IAEnC,IAAI,sBAAsB,EAAE;QACxB,gBAAgB,GAAG,GAAG,gBAAgB,IAAI,sBAAsB,CAAC,IAAI,CACjE,GAAG,CACN,EAAE,CAAC;KACP;IAED,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,OAAO,gBAAgB,MAAM,EAAE,IAAI,CAAC,CAAC;IAEtE,MAAM,mBAAmB,GAAa,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IACvE,MAAM,qBAAqB,GAAa,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAE3E,MAAM,OAAO,GAAG,CAAC,GAAG,mBAAmB,EAAE,GAAG,qBAAqB,CAAC,CAAC;IAEnE,MAAM,UAAU,GAAa,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;IAElD,OAAO,IAAA,0BAAgB,EAAC,UAAU,CAAC,CAAC;AACxC,CAAC,CAAC;AAvBW,QAAA,cAAc,kBAuBzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { ScoringConfig } from '../../types';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.scoringConfig = void 0;
|
|
5
|
+
exports.scoringConfig = {
|
|
6
|
+
weight: 16,
|
|
7
|
+
weightFactors: {
|
|
8
|
+
DEFAULT: {
|
|
9
|
+
CONTAINS_LOCATION_INFO: 0.25,
|
|
10
|
+
CONTAINS_TIME_INFO: 0.25,
|
|
11
|
+
CONTAINS_SOURCE_INFO: 0.25,
|
|
12
|
+
CONTAINS_TOPIC_INFO: 0.25,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=scoringConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/recommendedText/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,EAAE;IACV,aAAa,EAAE;QACX,OAAO,EAAE;YACL,sBAAsB,EAAE,IAAI;YAC5B,kBAAkB,EAAE,IAAI;YACxB,oBAAoB,EAAE,IAAI;YAC1B,mBAAmB,EAAE,IAAI;SAC5B;KACJ;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/tags/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"scoringConfig.js","sourceRoot":"","sources":["../../../src/lib/tags/scoringConfig.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAElC,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE,CAAC;IACT,aAAa,EAAE;QACX,OAAO,EAAE;YACL,iBAAiB,EAAE,GAAG;YACtB,yBAAyB,EAAE,GAAG;SACjC;QACD,mBAAmB;QACnB,8BAA8B;QAC9B,sCAAsC;QACtC,KAAK;KACR;CACJ,CAAC"}
|
|
@@ -93,10 +93,10 @@ const isValidUserProfileDescription = (userProfile
|
|
|
93
93
|
else {
|
|
94
94
|
// if it is not an email and not a url
|
|
95
95
|
nWords += 1;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
}
|
|
97
|
+
const lastChar = word[word.length - 1];
|
|
98
|
+
if (lastChar === '.' || lastChar === '?' || lastChar === '!') {
|
|
99
|
+
nSentences += 1;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
if (nEmailAddresses > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isValidUserProfileDescription.js","sourceRoot":"","sources":["../../../src/lib/userProfileDescription/isValidUserProfileDescription.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,6DAGiC;AAEjC,yDAAyD;AACzD,uDAAoD;AACpD,6CAA0C;AAC1C,6CAA0C;AAC1C,yCAAsC;AACtC,mDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,6BAA6B,GAAG,CACzC,WAAkB;AAClB,cAAc;EACA,EAAE;IAChB,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IAEpC,uBAAuB;IACvB,MAAM,MAAM,GAAG,IAAA,uCAAqB,EAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAE1D,MAAM,aAAa,GACf,MAAM,KAAK,IAAI;QACX,CAAC,CAAC,6BAAa,CAAC,aAAa,CAAC,OAAO;QACrC,CAAC,CAAC,6BAAa,CAAC,aAAa,CAAC,aAAa,CAAC;IAEpD,mBAAmB;IACnB,6DAA6D;IAE7D,MAAM,aAAa,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAEzC,MAAM,MAAM,GAAmB;QAC3B,QAAQ,EAAE,wBAAwB;QAClC,KAAK,EAAE,aAAa,CAAC,sBAAsB,CAAC,KAAK;QACjD,KAAK,EAAE,aAAa,CAAC,sBAAsB,CAAC,KAAK;QACjD,QAAQ,EAAE,CAAC;QACX,+BAA+B;QAC/B,qDAAqD;QACrD,2DAA2D;QAC3D,uDAAuD;QACvD,8CAA8C;QAC9C,8CAA8C;QAC9C,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;QACZ,M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Module", { value: true });
|
|
4
4
|
exports.scoringConfig = void 0;
|
|
5
5
|
exports.scoringConfig = {
|
|
6
|
-
weight:
|
|
6
|
+
weight: 8,
|
|
7
7
|
weightFactors: {
|
|
8
8
|
DEFAULT: {
|
|
9
|
-
USER_PROFILE_DESCRIPTION_HAS_DESCRIPTION_FACTOR: 1 /
|
|
10
|
-
USER_PROFILE_DESCRIPTION_HAS_MIN_NUM_SENTENCES_FACTOR: 2 /
|
|
11
|
-
USER_PROFILE_DESCRIPTION_HAS_MIN_NUM_WORDS_FACTOR: 1 /
|
|
12
|
-
USER_PROFILE_DESCRIPTION_HAS_LINK_FACTOR:
|
|
13
|
-
USER_PROFILE_DESCRIPTION_HAS_EMAIL_FACTOR: 2 /
|
|
9
|
+
USER_PROFILE_DESCRIPTION_HAS_DESCRIPTION_FACTOR: 1 / 8,
|
|
10
|
+
USER_PROFILE_DESCRIPTION_HAS_MIN_NUM_SENTENCES_FACTOR: 2 / 8,
|
|
11
|
+
USER_PROFILE_DESCRIPTION_HAS_MIN_NUM_WORDS_FACTOR: 1 / 8,
|
|
12
|
+
USER_PROFILE_DESCRIPTION_HAS_LINK_FACTOR: 2 / 8,
|
|
13
|
+
USER_PROFILE_DESCRIPTION_HAS_EMAIL_FACTOR: 2 / 8,
|
|
14
14
|
},
|
|
15
15
|
INTERNATIONAL: {
|
|
16
|
-
USER_PROFILE_DESCRIPTION_HAS_DESCRIPTION_FACTOR: 4 /
|
|
16
|
+
USER_PROFILE_DESCRIPTION_HAS_DESCRIPTION_FACTOR: 4 / 8,
|
|
17
17
|
USER_PROFILE_DESCRIPTION_HAS_MIN_NUM_SENTENCES_FACTOR: 0,
|
|
18
18
|
USER_PROFILE_DESCRIPTION_HAS_MIN_NUM_WORDS_FACTOR: 0,
|
|
19
|
-
USER_PROFILE_DESCRIPTION_HAS_LINK_FACTOR:
|
|
20
|
-
USER_PROFILE_DESCRIPTION_HAS_EMAIL_FACTOR: 2 /
|
|
19
|
+
USER_PROFILE_DESCRIPTION_HAS_LINK_FACTOR: 2 / 8,
|
|
20
|
+
USER_PROFILE_DESCRIPTION_HAS_EMAIL_FACTOR: 2 / 8,
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
};
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.scoringConfig = void 0;
|
|
5
5
|
exports.scoringConfig = {
|
|
6
|
-
weight:
|
|
6
|
+
weight: 2,
|
|
7
7
|
weightFactors: {
|
|
8
8
|
DEFAULT: {
|
|
9
|
-
HAS_USERNAME_FACTOR:
|
|
10
|
-
NO_UNDERSCORE_FACTOR: 2 /
|
|
9
|
+
HAS_USERNAME_FACTOR: 1 / 3,
|
|
10
|
+
NO_UNDERSCORE_FACTOR: 2 / 3,
|
|
11
11
|
},
|
|
12
12
|
// INTERNATIONAL: {
|
|
13
13
|
// HAS_USERNAME_FACTOR: 5 / 7,
|
|
@@ -10,4 +10,12 @@ type ScoringRulesLocale = 'en' | 'international';
|
|
|
10
10
|
* @returns Returns 'en' for English items, otherwise returns 'international'.
|
|
11
11
|
*/
|
|
12
12
|
export declare const getScoringRulesLocale: (culture: string) => ScoringRulesLocale;
|
|
13
|
+
/**
|
|
14
|
+
* Determines the locale of scoring rules based on the `owner` property of the input item.
|
|
15
|
+
* English and Non-English items are scored using different rules.
|
|
16
|
+
*
|
|
17
|
+
* @param owner The owner of ArcGIS Online item.
|
|
18
|
+
* @returns Returns 'international' if the content is owned by one of International distributors, otherwise returns 'en'.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getScoringRulesLocaleByItemOwner: (owner: string) => ScoringRulesLocale;
|
|
13
21
|
export {};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// } from '../../types';
|
|
10
10
|
// import { LivingAtlasSupportedItemType } from '../config';
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getScoringRulesLocale = void 0;
|
|
12
|
+
exports.getScoringRulesLocaleByItemOwner = exports.getScoringRulesLocale = void 0;
|
|
13
13
|
// /**
|
|
14
14
|
// * Look up table that maps Living Atlas supported item types to the corresponding Scoring Rules Type.
|
|
15
15
|
// */
|
|
@@ -60,6 +60,33 @@ const getScoringRulesLocale = (culture) => {
|
|
|
60
60
|
return 'international';
|
|
61
61
|
};
|
|
62
62
|
exports.getScoringRulesLocale = getScoringRulesLocale;
|
|
63
|
+
/**
|
|
64
|
+
* Determines the locale of scoring rules based on the `owner` property of the input item.
|
|
65
|
+
* English and Non-English items are scored using different rules.
|
|
66
|
+
*
|
|
67
|
+
* @param owner The owner of ArcGIS Online item.
|
|
68
|
+
* @returns Returns 'international' if the content is owned by one of International distributors, otherwise returns 'en'.
|
|
69
|
+
*/
|
|
70
|
+
const getScoringRulesLocaleByItemOwner = (owner) => {
|
|
71
|
+
if (!owner) {
|
|
72
|
+
return 'en';
|
|
73
|
+
}
|
|
74
|
+
const internationalDistributors = [
|
|
75
|
+
'Esri_NL_Content',
|
|
76
|
+
'Esri_France_Content',
|
|
77
|
+
'EsriSuisse_Content',
|
|
78
|
+
'EsriEspanaContenidos',
|
|
79
|
+
'Esri_JP_Content',
|
|
80
|
+
'esri_DE_content',
|
|
81
|
+
'CommunityMaps_EsriColombia',
|
|
82
|
+
];
|
|
83
|
+
if (internationalDistributors.includes(owner)) {
|
|
84
|
+
return 'international';
|
|
85
|
+
}
|
|
86
|
+
return 'en';
|
|
87
|
+
// return 'international';
|
|
88
|
+
};
|
|
89
|
+
exports.getScoringRulesLocaleByItemOwner = getScoringRulesLocaleByItemOwner;
|
|
63
90
|
// /**
|
|
64
91
|
// * Returns the rules that will be used to score the item based on the item type
|
|
65
92
|
// * @param itemType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getScoringRules.js","sourceRoot":"","sources":["../../../src/lib/util/getScoringRules.ts"],"names":[],"mappings":";AAAA,WAAW;AACX,aAAa;AACb,mBAAmB;AACnB,oBAAoB;AACpB,0BA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AAC7D,wBAAwB;AACxB,0CAA0C;AAC1C,2CAA2C;AAC3C,8CAA8C;AAC9C,kCAAkC;AAClC,mCAAmC;AACnC,2BAA2B;AAC3B,mCAAmC;AACnC,+BAA+B;AAC/B,+DAA+D;AAC/D,wBAAwB;AACxB,+BAA+B;AAC/B,mCAAmC;AACnC,qCAAqC;AACrC,8BAA8B;AAC9B,oCAAoC;AACpC,6CAA6C;AAC7C,6CAA6C;AAC7C,yBAAyB;AACzB,iEAAiE;AACjE,wBAAwB;AACxB,sBAAsB;AACtB,wBAAwB;AACxB,2BAA2B;AAC3B,WAAW;AAEX,wDAAwD;AACxD,KAAK"}
|
|
1
|
+
{"version":3,"file":"getScoringRules.js","sourceRoot":"","sources":["../../../src/lib/util/getScoringRules.ts"],"names":[],"mappings":";AAAA,WAAW;AACX,aAAa;AACb,mBAAmB;AACnB,oBAAoB;AACpB,0BAA0B;AAC1B,0BAA0B;AAC1B,wBAAwB;AACxB,wBAAwB;AACxB,4DAA4D;;;AAO5D,MAAM;AACN,wGAAwG;AACxG,MAAM;AACN,sCAAsC;AACtC,oCAAoC;AACpC,uBAAuB;AACvB,QAAQ;AACR,uCAAuC;AACvC,oCAAoC;AACpC,kCAAkC;AAClC,gCAAgC;AAChC,4BAA4B;AAC5B,wCAAwC;AACxC,2CAA2C;AAC3C,4CAA4C;AAC5C,+CAA+C;AAC/C,mCAAmC;AACnC,oCAAoC;AACpC,0BAA0B;AAC1B,oCAAoC;AACpC,gCAAgC;AAChC,gCAAgC;AAChC,sCAAsC;AACtC,wCAAwC;AACxC,+BAA+B;AAC/B,uCAAuC;AACvC,gDAAgD;AAChD,gDAAgD;AAChD,0BAA0B;AAC1B,KAAK;AAEL;;;;;;GAMG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAsB,EAAE;IACzE,IAAI,CAAC,OAAO,EAAE;QACV,OAAO,IAAI,CAAC;KACf;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,CAA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AoC;AACpC,6CAA6C;AAC7C,6CAA6C;AAC7C,yBAAyB;AACzB,iEAAiE;AACjE,wBAAwB;AACxB,sBAAsB;AACtB,wBAAwB;AACxB,2BAA2B;AAC3B,WAAW;AAEX,wDAAwD;AACxD,KAAK"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IItem } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Determines if the given item is a type of layer supported by the Living Atlas.
|
|
4
|
+
*
|
|
5
|
+
* This function checks the `type` property of the provided item to see if it matches any
|
|
6
|
+
* of the supported layer types, such as 'Feature Service', 'Image Service', 'Map Service',
|
|
7
|
+
* 'Vector Tile Service', 'WMS', 'Group Layer', 'Scene Service', or 'Media Layer'.
|
|
8
|
+
*
|
|
9
|
+
* @param item - The item to check, which includes a `type` property that specifies its item type.
|
|
10
|
+
* @returns A boolean indicating whether the item is a supported layer type.
|
|
11
|
+
*/
|
|
12
|
+
export declare const isLayer: (item: IItem) => boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isLayer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Determines if the given item is a type of layer supported by the Living Atlas.
|
|
6
|
+
*
|
|
7
|
+
* This function checks the `type` property of the provided item to see if it matches any
|
|
8
|
+
* of the supported layer types, such as 'Feature Service', 'Image Service', 'Map Service',
|
|
9
|
+
* 'Vector Tile Service', 'WMS', 'Group Layer', 'Scene Service', or 'Media Layer'.
|
|
10
|
+
*
|
|
11
|
+
* @param item - The item to check, which includes a `type` property that specifies its item type.
|
|
12
|
+
* @returns A boolean indicating whether the item is a supported layer type.
|
|
13
|
+
*/
|
|
14
|
+
const isLayer = (item) => {
|
|
15
|
+
const itemType = item.type;
|
|
16
|
+
return (itemType === 'Feature Service' ||
|
|
17
|
+
itemType === 'Image Service' ||
|
|
18
|
+
itemType === 'Map Service' ||
|
|
19
|
+
itemType === 'Vector Tile Service' ||
|
|
20
|
+
itemType === 'WMS' ||
|
|
21
|
+
itemType === 'Group Layer' ||
|
|
22
|
+
itemType === 'Scene Service' ||
|
|
23
|
+
itemType === 'Media Layer');
|
|
24
|
+
};
|
|
25
|
+
exports.isLayer = isLayer;
|
|
26
|
+
//# sourceMappingURL=isLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isLayer.js","sourceRoot":"","sources":["../../../src/lib/util/isLayer.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;GASG;AACI,MAAM,OAAO,GAAG,CAAC,IAAW,EAAW,EAAE;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAoC,CAAC;IAE3D,OAAO,CACH,QAAQ,KAAK,iBAAiB;QAC9B,QAAQ,KAAK,eAAe;QAC5B,QAAQ,KAAK,aAAa;QAC1B,QAAQ,KAAK,qBAAqB;QAClC,QAAQ,KAAK,KAAK;QAClB,QAAQ,KAAK,aAAa;QAC1B,QAAQ,KAAK,eAAe;QAC5B,QAAQ,KAAK,aAAa,CAC7B,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,OAAO,WAalB"}
|
package/dist/lib/util/isUrl.d.ts
CHANGED
package/dist/lib/util/isUrl.js
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isUrl = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Check if input string is a valid URL
|
|
5
|
+
* Check if input string is a valid URL, ignoring leading/trailing characters like parentheses, dots, or whitespace
|
|
6
6
|
*/
|
|
7
7
|
const isUrl = (str) => {
|
|
8
|
+
// Remove leading and trailing characters like parentheses, whitespace, and dots
|
|
9
|
+
const trimmedStr = str.trim().replace(/^[^\w]+|[^\w]+$/g, '');
|
|
8
10
|
const regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;
|
|
9
|
-
return regexp.test(
|
|
11
|
+
return regexp.test(trimmedStr);
|
|
10
12
|
};
|
|
11
13
|
exports.isUrl = isUrl;
|
|
12
14
|
//# sourceMappingURL=isUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUrl.js","sourceRoot":"","sources":["../../../src/lib/util/isUrl.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,MAAM,KAAK,GAAG,CAAC,GAAW,EAAW,EAAE;IAC1C,MAAM,MAAM,GACR,8aAA8a,CAAC;IAEnb,OAAO,MAAM,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"isUrl.js","sourceRoot":"","sources":["../../../src/lib/util/isUrl.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,MAAM,KAAK,GAAG,CAAC,GAAW,EAAW,EAAE;IAC1C,gFAAgF;IAChF,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAE9D,MAAM,MAAM,GACR,8aAA8a,CAAC;IAEnb,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC,CAAC;AARW,QAAA,KAAK,SAQhB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IItem } from '../../types';
|
|
2
|
+
export declare const esriOwners: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Determine if the item qualifies for validation under beta rules.
|
|
5
|
+
* Beta rules are applied to items owned by Esri and other specific accounts decided by Jim Herries.
|
|
6
|
+
*
|
|
7
|
+
* @param item - The item to evaluate for beta testing eligibility.
|
|
8
|
+
* @returns A boolean value indicating whether the item's owner is a beta tester.
|
|
9
|
+
*/
|
|
10
|
+
export declare const shouldValidateByBetaRules: (item: IItem) => boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shouldValidateByBetaRules = exports.esriOwners = void 0;
|
|
4
|
+
exports.esriOwners = [
|
|
5
|
+
'esri',
|
|
6
|
+
'Federal_User_Community',
|
|
7
|
+
'esri_Landscape',
|
|
8
|
+
'esri_dm',
|
|
9
|
+
'AtlasPublisher',
|
|
10
|
+
'StoryMaps',
|
|
11
|
+
'esri_basemaps',
|
|
12
|
+
'UOdocent',
|
|
13
|
+
'esri_vector',
|
|
14
|
+
'esri_livefeeds',
|
|
15
|
+
'esri_oceans',
|
|
16
|
+
'esri_demographics',
|
|
17
|
+
'esri_observations',
|
|
18
|
+
'esri_landscape2',
|
|
19
|
+
'Esri_GI',
|
|
20
|
+
'esri_livefeeds2',
|
|
21
|
+
'esri_analytics',
|
|
22
|
+
'esri_imagery',
|
|
23
|
+
'Esri_US_Federal_Data',
|
|
24
|
+
'esri_environment',
|
|
25
|
+
'esri_webstyles',
|
|
26
|
+
];
|
|
27
|
+
const additonalAccounts = [
|
|
28
|
+
'lisa_berry',
|
|
29
|
+
'stevenaviles_livingatlas',
|
|
30
|
+
'dianaclavery_uo',
|
|
31
|
+
'esri_canada',
|
|
32
|
+
'EsriUKContent',
|
|
33
|
+
'jzhang_content',
|
|
34
|
+
];
|
|
35
|
+
const additonalAccountsDevext = ['kbaloun_dev', 'Curator_JZhang'];
|
|
36
|
+
/**
|
|
37
|
+
* Determine if the item qualifies for validation under beta rules.
|
|
38
|
+
* Beta rules are applied to items owned by Esri and other specific accounts decided by Jim Herries.
|
|
39
|
+
*
|
|
40
|
+
* @param item - The item to evaluate for beta testing eligibility.
|
|
41
|
+
* @returns A boolean value indicating whether the item's owner is a beta tester.
|
|
42
|
+
*/
|
|
43
|
+
const shouldValidateByBetaRules = (item) => {
|
|
44
|
+
const owner = item === null || item === void 0 ? void 0 : item.owner;
|
|
45
|
+
if (!owner) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return (exports.esriOwners.includes(owner) ||
|
|
49
|
+
additonalAccounts.includes(owner) ||
|
|
50
|
+
additonalAccountsDevext.includes(owner));
|
|
51
|
+
};
|
|
52
|
+
exports.shouldValidateByBetaRules = shouldValidateByBetaRules;
|
|
53
|
+
//# sourceMappingURL=shouldValidateByBetaRules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldValidateByBetaRules.js","sourceRoot":"","sources":["../../../src/lib/util/shouldValidateByBetaRules.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAa;IAChC,MAAM;IACN,wBAAwB;IACxB,gBAAgB;IAChB,SAAS;IACT,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,UAAU;IACV,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,SAAS;IACT,iBAAiB;IACjB,gBAAgB;IAChB,cAAc;IACd,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;CACnB,CAAC;AAEF,MAAM,iBAAiB,GAAG;IACtB,YAAY;IACZ,0BAA0B;IAC1B,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,gBAAgB;CACnB,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAElE;;;;;;GAMG;AACI,MAAM,yBAAyB,GAAG,CAAC,IAAW,EAAW,EAAE;IAC9D,MAAM,KAAK,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC;IAE1B,IAAI,CAAC,KAAK,EAAE;QACR,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,CACH,kBAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC1B,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC;QACjC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC1C,CAAC;AACN,CAAC,CAAC;AAZW,QAAA,yBAAyB,6BAYpC"}
|
|
@@ -5,6 +5,7 @@ const __1 = require("../../");
|
|
|
5
5
|
const config_1 = require("../config");
|
|
6
6
|
const round_1 = require("../util/round");
|
|
7
7
|
const isDeleteProtectionEnabled_1 = require("../deleteProtection/isDeleteProtectionEnabled");
|
|
8
|
+
const checkRecommendedText_1 = require("../recommendedText/checkRecommendedText");
|
|
8
9
|
/**
|
|
9
10
|
* Validate a single item and the item owner's user profile in ArcGIS Online.
|
|
10
11
|
*
|
|
@@ -32,6 +33,7 @@ const validate = (item, userProfile) => {
|
|
|
32
33
|
const title = (0, __1.isValidTitle)(item);
|
|
33
34
|
const deprecated = (0, __1.isDeprecated)(item);
|
|
34
35
|
const deleteProtection = (0, isDeleteProtectionEnabled_1.isDeleteProtectionEnabled)(item);
|
|
36
|
+
const recommendedTextInTitleAndSummary = (0, checkRecommendedText_1.checkRecommendedText)(item);
|
|
35
37
|
const userProfileDescription = (0, __1.isValidUserProfileDescription)(userProfile
|
|
36
38
|
// item
|
|
37
39
|
);
|
|
@@ -67,6 +69,7 @@ const validate = (item, userProfile) => {
|
|
|
67
69
|
title,
|
|
68
70
|
deprecated,
|
|
69
71
|
deleteProtection,
|
|
72
|
+
recommendedTextInTitleAndSummary,
|
|
70
73
|
},
|
|
71
74
|
validatedProfile: {
|
|
72
75
|
userProfileDescription,
|
|
@@ -104,6 +107,7 @@ const validate = (item, userProfile) => {
|
|
|
104
107
|
title,
|
|
105
108
|
deprecated,
|
|
106
109
|
deleteProtection,
|
|
110
|
+
recommendedTextInTitleAndSummary,
|
|
107
111
|
},
|
|
108
112
|
validatedProfile: {
|
|
109
113
|
userProfileDescription,
|
|
@@ -125,6 +129,7 @@ const validate = (item, userProfile) => {
|
|
|
125
129
|
title,
|
|
126
130
|
deprecated,
|
|
127
131
|
deleteProtection,
|
|
132
|
+
recommendedTextInTitleAndSummary,
|
|
128
133
|
},
|
|
129
134
|
validatedProfile: {
|
|
130
135
|
userProfileDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/lib/validate/validate.ts"],"names":[],"mappings":";;;AACA,8BAegB;AAChB,sCAImB;AACnB,yCAAsC;AACtC,6FAA0F;
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/lib/validate/validate.ts"],"names":[],"mappings":";;;AACA,8BAegB;AAChB,sCAImB;AACnB,yCAAsC;AACtC,6FAA0F;AAC1F,kFAA+E;AAE/E;;;;;;;;GAQG;AACI,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAE,WAAkB,EAAoB,EAAE;IAC1E,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,2FAA2F;IAC3F,IACI,0CAAiC,CAAC,QAAQ,CACtC,IAAoC,CACvC,KAAK,KAAK,EACb;QACE,OAAO,IAAI,CAAC;KACf;IAED,MAAM,MAAM,GAAG,IAAA,iBAAa,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,iBAAiB,GAAG,IAAA,4BAAwB,EAAC,IAAI,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,IAAA,sBAAkB,EAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,qBAAiB,EAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAA,sBAAkB,EAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAA,kBAAc,EAAC,IAAI,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,IAAA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,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,IAAA,6BAAqB,EAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,KAAK,EAAE;QAC9D,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAAC;IAE7D,MAAM,EACF,MAAM,EACN,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,gBAAgB,GACnB,GAAG,aAAa,CAAC;IAElB,MAAM,EAAE,sBAAsB,EAAE,GAAG,gBAAgB,CAAC;IAEpD;IACI,6BAA6B;IAC7B,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ;QAChC,8BAA8B;QAC9B,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ;QACtC,yBAAyB;QACzB,UAAU,CAAC,KAAK,KAAK,UAAU,CAAC,QAAQ;QACxC,sCAAsC;QACtC,gBAAgB,CAAC,KAAK,KAAK,gBAAgB,CAAC,QAAQ;QACpD,0BAA0B;QAC1B,OAAO,CAAC,KAAK,KAAK,CAAC;QACnB,8BAA8B;QAC9B,WAAW,CAAC,KAAK,KAAK,CAAC;QACvB,+BAA+B;QAC/B,sBAAsB,CAAC,KAAK,KAAK,CAAC,EACpC;QACE,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/locale/de.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"CONTAINS_SOURCE_MESSAGE": "Der Beschreibung Quellinformation im Format \"Quelle: [Quellinformationen oder Link]\" hinzufügen"
|
|
23
23
|
},
|
|
24
24
|
"layers": {
|
|
25
|
-
"TOOLTIP_GUIDANCE_DEFAULT": "Für
|
|
25
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Für eine übersichtliche und zielführende Karte sind im Allgemeinen etwa 1–5 Layer erforderlich. Wenn ein Element immer mehr Layer erfordert, weist dies in der Regel darauf hin, dass das Informationsprodukt von einer Überarbeitung oder Neukonzeption durch den Ersteller profitieren würde. Es wird mehr Zeit benötigt, um zu klären und herauszuarbeiten, wie das Ergebnis aussehen soll.",
|
|
26
26
|
"TOOLTIP_GUIDANCE_INTL": "",
|
|
27
27
|
"TOOLTIP_SCORING_MSG_DEFAULT": "Die maximale Punktzahl wird für einen Layer vergeben. Mit steigender Anzahl der Layer wird die Punktzahl reduziert.",
|
|
28
28
|
"TOOLTIP_SCORING_MSG_INTL": "",
|
|
@@ -160,5 +160,15 @@
|
|
|
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
|
+
"recommendedTextInTitleAndSummary": {
|
|
165
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Benutzende, die nach Inhalten suchen, halten stets nach folgenden vier Angaben Ausschau:</br><ul><li>Ort oder Abdeckungsbereich, um zu verstehen, welcher geographische Bereich eingeschlossen ist</li><li>Thema, um zu verstehen, worum es bei diesem Element geht</li><li>Datenpublikationsjahr oder Aufnahmedatum, um zu verstehen, wie lange die Erfassung oder Aktualisierung der Daten zurückliegt</li><li>Quellorganisation/-programm, um zu verstehen, woher die Inhalte des Elements stammen</li></ul>",
|
|
166
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Derzeit findet die Bewertung von Titel und Zusammenfassung nur bei Layer-Elementen Anwendung. Wenn das Element in englischer Sprache verfasst ist, werden die Wörter im Titel und in der Zusammenfassung bewertet. Die volle Punktzahl wird vergeben, wenn die folgenden vier Angaben im Titel und/oder in der Zusammenfassung des Elements enthalten sind: </br><ul><li>Ort oder Abdeckungsbereich (z .B. \"London\", \"England\", \"Europa\", \"Global\" oder \"Welt\")</li><li>Thema (z. B. \"Parks\", \"Bevölkerungsdichte\", \"Meeresoberflächentemperatur\" oder \"Grundkarte\")</li> <li>Datenpublikationsjahr oder Aufnahmedatum (z. B. \"2024\", \"Aktuell\" oder \"1990–2020\")</li> <li>Quellorganisation/-programm (z. B. \"NASA\", \"Sentinel\" oder \"Erstellt vom EcoVision Lab des Departements Bau, Umwelt und Geomatik der ETH Zürich\"</li></ul></br>Wenden Sie sich bei Fragen oder Anregungen an jherries@esri.com.",
|
|
167
|
+
"LABEL": "Titel und Zusammenfassung auf suchoptimierte Angaben prüfen",
|
|
168
|
+
"TITLE": "Titel und Zusammenfassung prüfen",
|
|
169
|
+
"ADD_LOCATION_INFO": "Fügen Sie den Ort oder den Abdeckungsbereich hinzu, um über den enthaltenen geographischen Bereich zu informieren.",
|
|
170
|
+
"ADD_TIME_INFO": "Fügen Sie das Datenpublikationsjahr oder Aufnahmedatum hinzu, um darüber zu informieren, wie lange die Erfassung oder Aktualisierung der Daten zurückliegt.",
|
|
171
|
+
"ADD_SOURCE_INFO": "Fügen Sie die Quellorganisation bzw. das Quellprogramm hinzu, um über die Herkunft der Elementinhalte zu informieren.",
|
|
172
|
+
"ADD_TOPIC_INFO": "Fügen Sie das Thema hinzu, um über den Gegenstand des Elements zu informieren."
|
|
163
173
|
}
|
|
164
174
|
}
|
package/dist/locale/en.json
CHANGED
|
@@ -160,5 +160,15 @@
|
|
|
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
|
+
"recommendedTextInTitleAndSummary": {
|
|
165
|
+
"TOOLTIP_GUIDANCE_DEFAULT": "Users who search for content consistently look for four pieces of information:</br><ul><li>Location or area of coverage, to understand which geographic area is included.</li><li>Topic, to understand what this item is about.</li><li>Year or Vintage, to understand the how recently the data was collected or updated.</li><li>Source organization/program, to understand where the item’s content originated</li></ul>",
|
|
166
|
+
"TOOLTIP_SCORING_MSG_DEFAULT": "Title & Summary scoring is applied to layer items only at this time. If your item’s language is English, the words in your Title & Summary are evaluated. Full points are awarded if these four things are found in the item’s Title and/or Summary: </br><ul><li>Location or area of coverage (e.g. “London” or “England” or “Europe” or “Global” or “World” )</li><li>Topic (e.g. “Parks” or “Population Density” or “Sea Surface Temperature” or “Basemap”)</li> <li>Year or Vintage (e.g. “2024” or “Current” or “Latest” or “1990-2020”)</li> <li>Source organization/program (e.g. “NASA” or “Sentinel” or “Produced by EcoVision Lab in the ETH Zurich Department of Civil, Environmental and Geomatic Engineering.”</li></ul></br>For questions or suggestions, please contact jherries@esri.com",
|
|
167
|
+
"LABEL": "Verify Title and Summary have search-friendly information",
|
|
168
|
+
"TITLE": "Check Title and Summary",
|
|
169
|
+
"ADD_LOCATION_INFO": "Add location or area of coverage, to communicate which geographic area is included.",
|
|
170
|
+
"ADD_TIME_INFO": "Add year or vintage, to communicate the how recently the data was collected or updated.",
|
|
171
|
+
"ADD_SOURCE_INFO": "Add source organization/program, to communicate where the item’s content originated.",
|
|
172
|
+
"ADD_TOPIC_INFO": "Add topic to communicate what this item is about."
|
|
163
173
|
}
|
|
164
174
|
}
|