@vannizhang/living-atlas-content-validator 1.5.17 → 1.5.18-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/README.md +1376 -162
  2. package/dist/configureSettings.d.ts +133 -0
  3. package/dist/configureSettings.js +61 -0
  4. package/dist/configureSettings.js.map +1 -0
  5. package/dist/data/TitleSummaryMatchingPatterns_Locations.json +829 -0
  6. package/dist/data/TitleSummaryMatchingPatterns_Sources.json +382 -0
  7. package/dist/data/TitleSummaryMatchingPatterns_Time.json +25 -0
  8. package/dist/data/TitleSummaryMatchingPatterns_Topics.json +1365 -0
  9. package/dist/data/TitleSummaryRejectedPatterns.json +44 -0
  10. package/dist/index.d.ts +27 -9
  11. package/dist/index.js +55 -9
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/accessInformation/isValidAccessInformation.js +4 -6
  14. package/dist/lib/accessInformation/isValidAccessInformation.js.map +1 -1
  15. package/dist/lib/checkProfanities/checkProfanities.d.ts +7 -0
  16. package/dist/lib/checkProfanities/checkProfanities.js +26 -0
  17. package/dist/lib/checkProfanities/checkProfanities.js.map +1 -0
  18. package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.d.ts +34 -0
  19. package/dist/lib/{recommendedText/checkRecommendedText.js → checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js} +51 -25
  20. package/dist/lib/checkTitleAndSnippetSearchability/checkTitleAndSnippetSearchability.js.map +1 -0
  21. package/dist/lib/checkTitleAndSnippetSearchability/config.d.ts +97 -0
  22. package/dist/lib/checkTitleAndSnippetSearchability/config.js +41 -0
  23. package/dist/lib/checkTitleAndSnippetSearchability/config.js.map +1 -0
  24. package/dist/lib/checkTitleAndSnippetSearchability/data.d.ts +0 -0
  25. package/dist/lib/checkTitleAndSnippetSearchability/data.js +693 -0
  26. package/dist/lib/checkTitleAndSnippetSearchability/data.js.map +1 -0
  27. package/dist/lib/checkTitleAndSnippetSearchability/helpers.d.ts +117 -0
  28. package/dist/lib/checkTitleAndSnippetSearchability/helpers.js +241 -0
  29. package/dist/lib/checkTitleAndSnippetSearchability/helpers.js.map +1 -0
  30. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.d.ts +34 -0
  31. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +207 -0
  32. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -0
  33. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.d.ts +34 -0
  34. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js +170 -0
  35. package/dist/lib/checkTitleAndSnippetSearchability/matchLocationInfo.js.map +1 -0
  36. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.d.ts +34 -0
  37. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js +172 -0
  38. package/dist/lib/checkTitleAndSnippetSearchability/matchSourceInfo.js.map +1 -0
  39. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.d.ts +36 -0
  40. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js +175 -0
  41. package/dist/lib/checkTitleAndSnippetSearchability/matchTopicInfo.js.map +1 -0
  42. package/dist/lib/checkTitleAndSnippetSearchability/scoringConfig.js.map +1 -0
  43. package/dist/lib/config.d.ts +4 -1
  44. package/dist/lib/config.js +5 -5
  45. package/dist/lib/config.js.map +1 -1
  46. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js +6 -2
  47. package/dist/lib/deleteProtection/isDeleteProtectionEnabled.js.map +1 -1
  48. package/dist/lib/deprecated/isDeprecated.js +5 -2
  49. package/dist/lib/deprecated/isDeprecated.js.map +1 -1
  50. package/dist/lib/description/isValidDescription.js +8 -5
  51. package/dist/lib/description/isValidDescription.js.map +1 -1
  52. package/dist/lib/licenseInfo/isValidLicenseInfo.js +5 -2
  53. package/dist/lib/licenseInfo/isValidLicenseInfo.js.map +1 -1
  54. package/dist/lib/sharing/isValidAccess.js +5 -2
  55. package/dist/lib/sharing/isValidAccess.js.map +1 -1
  56. package/dist/lib/ssl/isValidSSL.js +15 -6
  57. package/dist/lib/ssl/isValidSSL.js.map +1 -1
  58. package/dist/lib/summary/isValidSummary.js +6 -3
  59. package/dist/lib/summary/isValidSummary.js.map +1 -1
  60. package/dist/lib/tags/isValidTags.js +7 -3
  61. package/dist/lib/tags/isValidTags.js.map +1 -1
  62. package/dist/lib/thumbnail/isValidThumbnail.d.ts +6 -1
  63. package/dist/lib/thumbnail/isValidThumbnail.js +10 -7
  64. package/dist/lib/thumbnail/isValidThumbnail.js.map +1 -1
  65. package/dist/lib/title/isValidTitle.js +9 -3
  66. package/dist/lib/title/isValidTitle.js.map +1 -1
  67. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js +44 -38
  68. package/dist/lib/userProfileDescription/isValidUserProfileDescription.js.map +1 -1
  69. package/dist/lib/userProfileName/isValidUserProfileName.js +8 -5
  70. package/dist/lib/userProfileName/isValidUserProfileName.js.map +1 -1
  71. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js +6 -3
  72. package/dist/lib/userProfileThumbnail/isValidUserProfileThumbnail.js.map +1 -1
  73. package/dist/lib/util/containsNonEnglishCharacters.d.ts +13 -0
  74. package/dist/lib/util/containsNonEnglishCharacters.js +30 -0
  75. package/dist/lib/util/containsNonEnglishCharacters.js.map +1 -0
  76. package/dist/lib/util/countSentences.d.ts +23 -0
  77. package/dist/lib/util/countSentences.js +54 -0
  78. package/dist/lib/util/countSentences.js.map +1 -0
  79. package/dist/lib/util/createWordBoundaryRegex.d.ts +46 -0
  80. package/dist/lib/util/createWordBoundaryRegex.js +77 -0
  81. package/dist/lib/util/createWordBoundaryRegex.js.map +1 -0
  82. package/dist/lib/util/escapeSpecialCharacters.d.ts +7 -0
  83. package/dist/lib/util/escapeSpecialCharacters.js +22 -0
  84. package/dist/lib/util/escapeSpecialCharacters.js.map +1 -0
  85. package/dist/lib/util/getLivingAtlasSupportedItemTypes.d.ts +21 -0
  86. package/dist/lib/util/getLivingAtlasSupportedItemTypes.js +34 -0
  87. package/dist/lib/util/getLivingAtlasSupportedItemTypes.js.map +1 -0
  88. package/dist/lib/util/getNumberOfWords.js +6 -2
  89. package/dist/lib/util/getNumberOfWords.js.map +1 -1
  90. package/dist/lib/util/getScoringRules.js +6 -0
  91. package/dist/lib/util/getScoringRules.js.map +1 -1
  92. package/dist/lib/util/isLayer.js +3 -2
  93. package/dist/lib/util/isLayer.js.map +1 -1
  94. package/dist/lib/util/isUrl.d.ts +6 -0
  95. package/dist/lib/util/isUrl.js +16 -1
  96. package/dist/lib/util/isUrl.js.map +1 -1
  97. package/dist/lib/util/isValidRegexPattern.d.ts +7 -0
  98. package/dist/lib/util/isValidRegexPattern.js +20 -0
  99. package/dist/lib/util/isValidRegexPattern.js.map +1 -0
  100. package/dist/lib/util/sanitizeTags.d.ts +6 -0
  101. package/dist/lib/util/sanitizeTags.js +16 -0
  102. package/dist/lib/util/sanitizeTags.js.map +1 -0
  103. package/dist/lib/util/shouldValidateByBetaRules.js +6 -1
  104. package/dist/lib/util/shouldValidateByBetaRules.js.map +1 -1
  105. package/dist/lib/util/stringsConfig.d.ts +9 -0
  106. package/dist/lib/util/stringsConfig.js +9 -1
  107. package/dist/lib/util/stringsConfig.js.map +1 -1
  108. package/dist/lib/validate/validate.d.ts +57 -12
  109. package/dist/lib/validate/validate.js +87 -213
  110. package/dist/lib/validate/validate.js.map +1 -1
  111. package/dist/lib/validate/validateHelpers.d.ts +63 -0
  112. package/dist/lib/validate/validateHelpers.js +157 -0
  113. package/dist/lib/validate/validateHelpers.js.map +1 -0
  114. package/dist/locale/de.json +1 -1
  115. package/dist/locale/en.json +23 -23
  116. package/dist/locale/es.json +1 -1
  117. package/dist/locale/fr.json +1 -1
  118. package/dist/locale/ja.json +1 -1
  119. package/dist/locale/pt-br.json +1 -1
  120. package/dist/package-info.json +1 -1
  121. package/dist/services/content-validator-assets/config.d.ts +4 -0
  122. package/dist/services/content-validator-assets/config.js +8 -0
  123. package/dist/services/content-validator-assets/config.js.map +1 -0
  124. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.d.ts +95 -0
  125. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js +92 -0
  126. package/dist/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map +1 -0
  127. package/dist/services/content-validator-assets/fetchProfanitiesData.d.ts +18 -0
  128. package/dist/services/content-validator-assets/fetchProfanitiesData.js +55 -0
  129. package/dist/services/content-validator-assets/fetchProfanitiesData.js.map +1 -0
  130. package/dist/services/content-validator-assets/helpers.d.ts +16 -0
  131. package/dist/services/content-validator-assets/helpers.js +35 -0
  132. package/dist/services/content-validator-assets/helpers.js.map +1 -0
  133. package/dist/services/custom-terms/config.d.ts +27 -0
  134. package/dist/services/custom-terms/config.js +79 -0
  135. package/dist/services/custom-terms/config.js.map +1 -0
  136. package/dist/services/custom-terms/customTerms.d.ts +229 -0
  137. package/dist/services/custom-terms/customTerms.js +394 -0
  138. package/dist/services/custom-terms/customTerms.js.map +1 -0
  139. package/dist/services/custom-terms/helpers.d.ts +8 -0
  140. package/dist/services/custom-terms/helpers.js +25 -0
  141. package/dist/services/custom-terms/helpers.js.map +1 -0
  142. package/dist/services/custom-terms/index.d.ts +3 -0
  143. package/dist/services/custom-terms/index.js +10 -0
  144. package/dist/services/custom-terms/index.js.map +1 -0
  145. package/dist/services/custom-terms-review-results/config.d.ts +31 -0
  146. package/dist/services/custom-terms-review-results/config.js +78 -0
  147. package/dist/services/custom-terms-review-results/config.js.map +1 -0
  148. package/dist/services/custom-terms-review-results/customTermsReviewResults.d.ts +133 -0
  149. package/dist/services/custom-terms-review-results/customTermsReviewResults.js +276 -0
  150. package/dist/services/custom-terms-review-results/customTermsReviewResults.js.map +1 -0
  151. package/dist/services/custom-terms-review-results/helpers.d.ts +24 -0
  152. package/dist/services/custom-terms-review-results/helpers.js +52 -0
  153. package/dist/services/custom-terms-review-results/helpers.js.map +1 -0
  154. package/dist/services/custom-terms-review-results/index.d.ts +4 -0
  155. package/dist/services/custom-terms-review-results/index.js +13 -0
  156. package/dist/services/custom-terms-review-results/index.js.map +1 -0
  157. package/dist/services/shared/addFeatures.d.ts +28 -0
  158. package/dist/services/shared/addFeatures.js +52 -0
  159. package/dist/services/shared/addFeatures.js.map +1 -0
  160. package/dist/services/shared/applyEdits.d.ts +28 -0
  161. package/dist/services/shared/applyEdits.js +53 -0
  162. package/dist/services/shared/applyEdits.js.map +1 -0
  163. package/dist/services/shared/config.d.ts +44 -0
  164. package/dist/services/shared/config.js +35 -0
  165. package/dist/services/shared/config.js.map +1 -0
  166. package/dist/services/shared/getItemInfo.d.ts +36 -0
  167. package/dist/services/shared/getItemInfo.js +56 -0
  168. package/dist/services/shared/getItemInfo.js.map +1 -0
  169. package/dist/types/index.d.ts +25 -22
  170. package/package.json +4 -3
  171. package/dist/__tests__/test-data/title-summary-data.json +0 -14654
  172. package/dist/data/TitleSummaryMatchingPatterns.json +0 -1902
  173. package/dist/lib/layers/isValidLayerCount.d.ts +0 -12
  174. package/dist/lib/layers/isValidLayerCount.js +0 -171
  175. package/dist/lib/layers/isValidLayerCount.js.map +0 -1
  176. package/dist/lib/layers/scoringConfig.d.ts +0 -10
  177. package/dist/lib/layers/scoringConfig.js +0 -20
  178. package/dist/lib/layers/scoringConfig.js.map +0 -1
  179. package/dist/lib/recommendedText/checkRecommendedText.d.ts +0 -15
  180. package/dist/lib/recommendedText/checkRecommendedText.js.map +0 -1
  181. package/dist/lib/recommendedText/helpers.d.ts +0 -15
  182. package/dist/lib/recommendedText/helpers.js +0 -62
  183. package/dist/lib/recommendedText/helpers.js.map +0 -1
  184. package/dist/lib/recommendedText/matchDateTimeInfo.d.ts +0 -9
  185. package/dist/lib/recommendedText/matchDateTimeInfo.js +0 -81
  186. package/dist/lib/recommendedText/matchDateTimeInfo.js.map +0 -1
  187. package/dist/lib/recommendedText/matchLocationInfo.d.ts +0 -9
  188. package/dist/lib/recommendedText/matchLocationInfo.js +0 -745
  189. package/dist/lib/recommendedText/matchLocationInfo.js.map +0 -1
  190. package/dist/lib/recommendedText/matchSourceInfo.d.ts +0 -9
  191. package/dist/lib/recommendedText/matchSourceInfo.js +0 -32
  192. package/dist/lib/recommendedText/matchSourceInfo.js.map +0 -1
  193. package/dist/lib/recommendedText/matchTopicInfo.d.ts +0 -9
  194. package/dist/lib/recommendedText/matchTopicInfo.js +0 -32
  195. package/dist/lib/recommendedText/matchTopicInfo.js.map +0 -1
  196. package/dist/lib/recommendedText/scoringConfig.js.map +0 -1
  197. /package/dist/lib/{recommendedText → checkTitleAndSnippetSearchability}/scoringConfig.d.ts +0 -0
  198. /package/dist/lib/{recommendedText → checkTitleAndSnippetSearchability}/scoringConfig.js +0 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.fetchAdditonalPatterns4TitleAndSnippetSearchability = void 0;
13
+ const helpers_1 = require("./helpers");
14
+ /**
15
+ * Fetches additional pattern rules for validating the searchability of titles and snippets.
16
+ *
17
+ * This function retrieves additional matching and rejected patterns for different categories,
18
+ * including location, source, topic, and year vintage. These patterns help determine whether
19
+ * a title or snippet is valid for searchability.
20
+ *
21
+ * @param {string} language - The language code (e.g., "en", "es", "fr") to fetch the appropriate localized patterns. The default is "en".
22
+ * @returns {Promise<AdditionalPattern>} A promise resolving to an object containing categorized matching and rejected patterns.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const patterns = await fetchPatternRulesForTitleSearchability("en");
27
+ * console.log(patterns.matchingPatternsLocation); // ["New York", "Los Angeles"]
28
+ * ```
29
+ */
30
+ const fetchAdditonalPatterns4TitleAndSnippetSearchability = (language = 'en') => __awaiter(void 0, void 0, void 0, function* () {
31
+ const queryTimestamp = (0, helpers_1.getRoundedTimestamp)(1);
32
+ const assetsFolderPath = (0, helpers_1.getAssetFolderPath)();
33
+ // add the timestamp to the request URL to avoid cdn caching
34
+ const requestURL = `${assetsFolderPath}/check-title-snippet-searchability/additional-patterns.${language}.json?timestamp=${queryTimestamp}`;
35
+ try {
36
+ const response = yield fetch(requestURL);
37
+ if (!response.ok || response.status === 404) {
38
+ throw new Error(`Error fetching additional patterns: ${response.statusText}`);
39
+ }
40
+ const data = yield response.json();
41
+ // console.log('data', data);
42
+ if (!data || typeof data !== 'object' || Array.isArray(data)) {
43
+ throw new Error(`Invalid JSON format received for language: ${language}`);
44
+ }
45
+ if (!data['matchingPatternsLocation'] ||
46
+ !data['rejectedPatternsLocation'] ||
47
+ !data['matchingPatternsSource'] ||
48
+ !data['rejectedPatternsSource'] ||
49
+ !data['matchingPatternsTopic'] ||
50
+ !data['rejectedPatternsTopic'] ||
51
+ !data['matchingPatternsYearVintage'] ||
52
+ !data['rejectedPatternsYearVintage']) {
53
+ throw new Error(`Missing required fields in the JSON data`);
54
+ }
55
+ const matchingPatternsLocation = data['matchingPatternsLocation'] || [];
56
+ const rejectedPatternsLocation = data['rejectedPatternsLocation'] || [];
57
+ const matchingPatternsSource = data['matchingPatternsSource'] || [];
58
+ const rejectedPatternsSource = data['rejectedPatternsSource'] || [];
59
+ const matchingPatternsTopic = data['matchingPatternsTopic'] || [];
60
+ const rejectedPatternsTopic = data['rejectedPatternsTopic'] || [];
61
+ const matchingPatternsYearVintage = data['matchingPatternsYearVintage'] || [];
62
+ const rejectedPatternsYearVintage = data['rejectedPatternsYearVintage'] || [];
63
+ return {
64
+ matchingPatternsLocation,
65
+ rejectedPatternsLocation,
66
+ matchingPatternsSource,
67
+ rejectedPatternsSource,
68
+ matchingPatternsTopic,
69
+ rejectedPatternsTopic,
70
+ matchingPatternsYearVintage,
71
+ rejectedPatternsYearVintage,
72
+ updatedAt: data['updatedAt'],
73
+ };
74
+ }
75
+ catch (error) {
76
+ console.error(`Error fetching pattern rules for language: ${language}`, error);
77
+ throw new Error((error === null || error === void 0 ? void 0 : error.message) ||
78
+ `Error fetching pattern rules for language: ${language}`);
79
+ // return {
80
+ // matchingPatternsLocation: [],
81
+ // rejectedPatternsLocation: [],
82
+ // matchingPatternsSource: [],
83
+ // rejectedPatternsSource: [],
84
+ // matchingPatternsTopic: [],
85
+ // rejectedPatternsTopic: [],
86
+ // matchingPatternsYearVintage: [],
87
+ // rejectedPatternsYearVintage: [],
88
+ // };
89
+ }
90
+ });
91
+ exports.fetchAdditonalPatterns4TitleAndSnippetSearchability = fetchAdditonalPatterns4TitleAndSnippetSearchability;
92
+ //# sourceMappingURL=fetchAdditonalPatterns4TitleAndSnippetSearchability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchAdditonalPatterns4TitleAndSnippetSearchability.js","sourceRoot":"","sources":["../../../src/services/content-validator-assets/fetchAdditonalPatterns4TitleAndSnippetSearchability.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Fetches profanities data for a specified language from a remote source.
3
+ *
4
+ * This function retrieves a list of profane terms from a JSON file located in the assets folder.
5
+ * The URL includes a timestamp to prevent CDN caching.
6
+ *
7
+ * @param language - The language code for which to fetch profanities. Defaults to 'en' (English).
8
+ * @returns A Promise that resolves to an array of strings containing profanity terms.
9
+ * @throws {Error} If the fetch request fails, returns a 404, or if the response contains invalid data.
10
+ *
11
+ * @example
12
+ * // Fetch English profanities
13
+ * const englishProfanities = await fetchProfanitiesData();
14
+ *
15
+ * // Fetch Spanish profanities
16
+ * const spanishProfanities = await fetchProfanitiesData('es');
17
+ */
18
+ export declare const fetchProfanitiesData: (language?: string) => Promise<string[]>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.fetchProfanitiesData = void 0;
13
+ const helpers_1 = require("./helpers");
14
+ /**
15
+ * Fetches profanities data for a specified language from a remote source.
16
+ *
17
+ * This function retrieves a list of profane terms from a JSON file located in the assets folder.
18
+ * The URL includes a timestamp to prevent CDN caching.
19
+ *
20
+ * @param language - The language code for which to fetch profanities. Defaults to 'en' (English).
21
+ * @returns A Promise that resolves to an array of strings containing profanity terms.
22
+ * @throws {Error} If the fetch request fails, returns a 404, or if the response contains invalid data.
23
+ *
24
+ * @example
25
+ * // Fetch English profanities
26
+ * const englishProfanities = await fetchProfanitiesData();
27
+ *
28
+ * // Fetch Spanish profanities
29
+ * const spanishProfanities = await fetchProfanitiesData('es');
30
+ */
31
+ const fetchProfanitiesData = (language = 'en') => __awaiter(void 0, void 0, void 0, function* () {
32
+ const queryTimestamp = (0, helpers_1.getRoundedTimestamp)(1);
33
+ const assetsFolderPath = (0, helpers_1.getAssetFolderPath)();
34
+ // add the timestamp to the request URL to avoid cdn caching
35
+ const requestURL = `${assetsFolderPath}/check-profanity/profanities.${language}.json?timestamp=${queryTimestamp}`;
36
+ try {
37
+ const response = yield fetch(requestURL);
38
+ if (!response.ok || response.status === 404) {
39
+ throw new Error(`Error fetching profanities data: ${response.statusText}`);
40
+ }
41
+ const data = yield response.json();
42
+ // console.log('data', data);
43
+ if (!data || typeof data !== 'object' || !Array.isArray(data)) {
44
+ throw new Error(`Invalid JSON format received for language: ${language}`);
45
+ }
46
+ return data || [];
47
+ }
48
+ catch (error) {
49
+ console.error(`Error fetching profanities data for language: ${language}`, error);
50
+ throw new Error((error === null || error === void 0 ? void 0 : error.message) ||
51
+ `Error fetching profanities data for language: ${language}`);
52
+ }
53
+ });
54
+ exports.fetchProfanitiesData = fetchProfanitiesData;
55
+ //# sourceMappingURL=fetchProfanitiesData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchProfanitiesData.js","sourceRoot":"","sources":["../../../src/services/content-validator-assets/fetchProfanitiesData.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoE;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,oBAAoB,GAAG,CAChC,QAAQ,GAAG,IAAI,EACE,EAAE;IACnB,MAAM,cAAc,GAAG,IAAA,6BAAmB,EAAC,CAAC,CAAC,CAAC;IAE9C,MAAM,gBAAgB,GAAG,IAAA,4BAAkB,GAAE,CAAC;IAE9C,4DAA4D;IAC5D,MAAM,UAAU,GAAG,GAAG,gBAAgB,gCAAgC,QAAQ,mBAAmB,cAAc,EAAE,CAAC;IAElH,IAAI;QACA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC;QAEzC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;YACzC,MAAM,IAAI,KAAK,CACX,oCAAoC,QAAQ,CAAC,UAAU,EAAE,CAC5D,CAAC;SACL;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,6BAA6B;QAE7B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC3D,MAAM,IAAI,KAAK,CACX,8CAA8C,QAAQ,EAAE,CAC3D,CAAC;SACL;QAED,OAAO,IAAI,IAAI,EAAE,CAAC;KACrB;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CACT,iDAAiD,QAAQ,EAAE,EAC3D,KAAK,CACR,CAAC;QAEF,MAAM,IAAI,KAAK,CACX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO;YACV,iDAAiD,QAAQ,EAAE,CAClE,CAAC;KACL;AACL,CAAC,CAAA,CAAC;AAxCW,QAAA,oBAAoB,wBAwC/B"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Returns a rounded timestamp based on the specified number of minutes.
3
+ * @param {number} numOfMin - The number of minutes to round the timestamp to. Defaults to 5 if not provided.
4
+ * @returns {number} The rounded timestamp in milliseconds.
5
+ */
6
+ export declare const getRoundedTimestamp: (numOfMin?: number) => number;
7
+ /**
8
+ * Retrieves the asset folder path based on the environment.
9
+ *
10
+ * If the environment is not Node.js, it returns the predefined `ASSETS_FOLDER_PATH`.
11
+ * Otherwise, it constructs the URL based on the service tier (development or production)
12
+ * and appends the `ASSETS_FOLDER_PATH` to it.
13
+ *
14
+ * @returns {string} The asset folder path.
15
+ */
16
+ export declare const getAssetFolderPath: () => string;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAssetFolderPath = exports.getRoundedTimestamp = void 0;
4
+ const config_1 = require("../shared/config");
5
+ const config_2 = require("./config");
6
+ /**
7
+ * Returns a rounded timestamp based on the specified number of minutes.
8
+ * @param {number} numOfMin - The number of minutes to round the timestamp to. Defaults to 5 if not provided.
9
+ * @returns {number} The rounded timestamp in milliseconds.
10
+ */
11
+ const getRoundedTimestamp = (numOfMin = 5) => {
12
+ const coeff = 1000 * 60 * numOfMin;
13
+ return Math.floor(Date.now() / coeff) * coeff; // Keeps milliseconds
14
+ };
15
+ exports.getRoundedTimestamp = getRoundedTimestamp;
16
+ /**
17
+ * Retrieves the asset folder path based on the environment.
18
+ *
19
+ * If the environment is not Node.js, it returns the predefined `ASSETS_FOLDER_PATH`.
20
+ * Otherwise, it constructs the URL based on the service tier (development or production)
21
+ * and appends the `ASSETS_FOLDER_PATH` to it.
22
+ *
23
+ * @returns {string} The asset folder path.
24
+ */
25
+ const getAssetFolderPath = () => {
26
+ if (!config_1.isNodeEnv) {
27
+ return config_2.ASSETS_FOLDER_PATH;
28
+ }
29
+ const hostname = config_1.serviceTier === 'dev'
30
+ ? 'https://livingatlasdev.arcgis.com'
31
+ : 'https://livingatlas.arcgis.com';
32
+ return hostname + config_2.ASSETS_FOLDER_PATH;
33
+ };
34
+ exports.getAssetFolderPath = getAssetFolderPath;
35
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/services/content-validator-assets/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAC1D,qCAA8C;AAE9C;;;;GAIG;AACI,MAAM,mBAAmB,GAAG,CAAC,QAAQ,GAAG,CAAC,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,GAAG,QAAQ,CAAC;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,qBAAqB;AACxE,CAAC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B;AAEF;;;;;;;;GAQG;AACI,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,IAAI,CAAC,kBAAS,EAAE;QACZ,OAAO,2BAAkB,CAAC;KAC7B;IAED,MAAM,QAAQ,GACV,oBAAW,KAAK,KAAK;QACjB,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,gCAAgC,CAAC;IAE3C,OAAO,QAAQ,GAAG,2BAAkB,CAAC;AACzC,CAAC,CAAC;AAXW,QAAA,kBAAkB,sBAW7B"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This enum defines the field names used in the Custom Terms feature table.
3
+ */
4
+ export declare enum CustomTermsFeatureTableField {
5
+ OBJECT_ID = "OBJECTID",
6
+ TERM = "term",
7
+ CATEGORY = "category",
8
+ STATUS = "status",
9
+ TITLE = "item_title",
10
+ ITEM_ID = "item_id",
11
+ SNIPPET = "item_snippet",
12
+ NOTE = "note",
13
+ CREATION_DATE = "CreationDate",
14
+ CREATOR = "Creator",
15
+ EDIT_DATE = "EditDate",
16
+ EDITOR = "Editor"
17
+ }
18
+ /**
19
+ * Gets the URL for the Custom Terms feature table based on the service tier.
20
+ * @returns the URL for the Custom Terms feature table.
21
+ */
22
+ export declare const getCustomTermsFeatureTableUrl: () => string;
23
+ /**
24
+ * Gets the URL for the itemInfo endpoint for the Custom Terms feature table.
25
+ * @returns The URL for the itemInfo endpoint for the Custom Terms feature table.
26
+ */
27
+ export declare const getCustomTermsFeatureTableItemInfoUrl: () => string;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCustomTermsFeatureTableItemInfoUrl = exports.getCustomTermsFeatureTableUrl = exports.CustomTermsFeatureTableField = void 0;
4
+ const config_1 = require("../shared/config");
5
+ /**
6
+ * The root URL for the Custom Terms feature table in the development environment.
7
+ * @see
8
+ * https://servicesdev.arcgis.com/VLx4vrvwONglS8iz/ArcGIS/rest/services/Custom_Terms/FeatureServer
9
+ */
10
+ const CUSTOM_TERMS_FEATURE_TABLE_ROOT_DEV = 'https://servicesdev.arcgis.com/VLx4vrvwONglS8iz/arcgis/rest/services/Custom_Terms/FeatureServer';
11
+ /**
12
+ * The URL for the Custom Terms feature table in the development environment.
13
+ * @see
14
+ * https://servicesdev.arcgis.com/VLx4vrvwONglS8iz/ArcGIS/rest/services/Custom_Terms/FeatureServer/0
15
+ */
16
+ const CUSTOM_TERMS_FEATURE_TABLE_URL_DEV = CUSTOM_TERMS_FEATURE_TABLE_ROOT_DEV + '/0';
17
+ /**
18
+ * The URL for the itemInfo endpoint for the Custom Terms feature table in the development environment.
19
+ * @see
20
+ * https://servicesdev.arcgis.com/VLx4vrvwONglS8iz/ArcGIS/rest/services/Custom_Terms/FeatureServer/info/itemInfo
21
+ */
22
+ const CUSTOM_TERMS_FEATURE_TABLE_ITEMINFO_DEV = CUSTOM_TERMS_FEATURE_TABLE_ROOT_DEV + '/info/itemInfo';
23
+ /**
24
+ * The root URL for the Custom Terms feature table in the production environment.
25
+ * @see
26
+ * https://services.arcgis.com/jIL9msH9OI208GCb/arcgis/rest/services/Custom_Terms/FeatureServer
27
+ */
28
+ const CUSTOM_TERMS_FEATURE_TABLE_ROOT_PROD = 'https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/Custom_Terms/FeatureServer';
29
+ /**
30
+ * The URL for the Custom Terms feature table in the production environment.
31
+ * @see
32
+ * https://services.arcgis.com/jIL9msH9OI208GCb/ArcGIS/rest/services/Custom_Terms/FeatureServer/0
33
+ */
34
+ const CUSTOM_TERMS_FEATURE_TABLE_URL_PROD = CUSTOM_TERMS_FEATURE_TABLE_ROOT_PROD + '/0';
35
+ /**
36
+ * The URL for the itemInfo endpoint for the Custom Terms feature table in the production environment.
37
+ * @see
38
+ * https://services.arcgis.com/jIL9msH9OI208GCb/ArcGIS/rest/services/Custom_Terms/FeatureServer/info/itemInfo
39
+ */
40
+ const CUSTOM_TERMS_FEATURE_TABLE_ITEMINFO_PROD = CUSTOM_TERMS_FEATURE_TABLE_ROOT_PROD + '/info/itemInfo';
41
+ /**
42
+ * This enum defines the field names used in the Custom Terms feature table.
43
+ */
44
+ var CustomTermsFeatureTableField;
45
+ (function (CustomTermsFeatureTableField) {
46
+ CustomTermsFeatureTableField["OBJECT_ID"] = "OBJECTID";
47
+ CustomTermsFeatureTableField["TERM"] = "term";
48
+ CustomTermsFeatureTableField["CATEGORY"] = "category";
49
+ CustomTermsFeatureTableField["STATUS"] = "status";
50
+ CustomTermsFeatureTableField["TITLE"] = "item_title";
51
+ CustomTermsFeatureTableField["ITEM_ID"] = "item_id";
52
+ CustomTermsFeatureTableField["SNIPPET"] = "item_snippet";
53
+ CustomTermsFeatureTableField["NOTE"] = "note";
54
+ CustomTermsFeatureTableField["CREATION_DATE"] = "CreationDate";
55
+ CustomTermsFeatureTableField["CREATOR"] = "Creator";
56
+ CustomTermsFeatureTableField["EDIT_DATE"] = "EditDate";
57
+ CustomTermsFeatureTableField["EDITOR"] = "Editor";
58
+ })(CustomTermsFeatureTableField = exports.CustomTermsFeatureTableField || (exports.CustomTermsFeatureTableField = {}));
59
+ /**
60
+ * Gets the URL for the Custom Terms feature table based on the service tier.
61
+ * @returns the URL for the Custom Terms feature table.
62
+ */
63
+ const getCustomTermsFeatureTableUrl = () => {
64
+ return config_1.serviceTier === 'prod'
65
+ ? CUSTOM_TERMS_FEATURE_TABLE_URL_PROD
66
+ : CUSTOM_TERMS_FEATURE_TABLE_URL_DEV;
67
+ };
68
+ exports.getCustomTermsFeatureTableUrl = getCustomTermsFeatureTableUrl;
69
+ /**
70
+ * Gets the URL for the itemInfo endpoint for the Custom Terms feature table.
71
+ * @returns The URL for the itemInfo endpoint for the Custom Terms feature table.
72
+ */
73
+ const getCustomTermsFeatureTableItemInfoUrl = () => {
74
+ return config_1.serviceTier === 'prod'
75
+ ? CUSTOM_TERMS_FEATURE_TABLE_ITEMINFO_PROD
76
+ : CUSTOM_TERMS_FEATURE_TABLE_ITEMINFO_DEV;
77
+ };
78
+ exports.getCustomTermsFeatureTableItemInfoUrl = getCustomTermsFeatureTableItemInfoUrl;
79
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/services/custom-terms/config.ts"],"names":[],"mappings":";;;AAAA,6CAA+C;AAE/C;;;;GAIG;AACH,MAAM,mCAAmC,GACrC,iGAAiG,CAAC;AAEtG;;;;GAIG;AACH,MAAM,kCAAkC,GACpC,mCAAmC,GAAG,IAAI,CAAC;AAE/C;;;;GAIG;AACH,MAAM,uCAAuC,GACzC,mCAAmC,GAAG,gBAAgB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,oCAAoC,GACtC,8FAA8F,CAAC;AAEnG;;;;GAIG;AACH,MAAM,mCAAmC,GACrC,oCAAoC,GAAG,IAAI,CAAC;AAEhD;;;;GAIG;AACH,MAAM,wCAAwC,GAC1C,oCAAoC,GAAG,gBAAgB,CAAC;AAE5D;;GAEG;AACH,IAAY,4BAaX;AAbD,WAAY,4BAA4B;IACpC,sDAAsB,CAAA;IACtB,6CAAa,CAAA;IACb,qDAAqB,CAAA;IACrB,iDAAiB,CAAA;IACjB,oDAAoB,CAAA;IACpB,mDAAmB,CAAA;IACnB,wDAAwB,CAAA;IACxB,6CAAa,CAAA;IACb,8DAA8B,CAAA;IAC9B,mDAAmB,CAAA;IACnB,sDAAsB,CAAA;IACtB,iDAAiB,CAAA;AACrB,CAAC,EAbW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAavC;AAED;;;GAGG;AACI,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAC9C,OAAO,oBAAW,KAAK,MAAM;QACzB,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,kCAAkC,CAAC;AAC7C,CAAC,CAAC;AAJW,QAAA,6BAA6B,iCAIxC;AAEF;;;GAGG;AACI,MAAM,qCAAqC,GAAG,GAAG,EAAE;IACtD,OAAO,oBAAW,KAAK,MAAM;QACzB,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,uCAAuC,CAAC;AAClD,CAAC,CAAC;AAJW,QAAA,qCAAqC,yCAIhD"}
@@ -0,0 +1,229 @@
1
+ import { AddFeaturesResponse } from '../shared/addFeatures';
2
+ import { ApplyEditsResult } from '../shared/applyEdits';
3
+ import { CustomTermCategory, CustomTermStatus } from '../shared/config';
4
+ import { ItemInfoResponse } from '../shared/getItemInfo';
5
+ import { CustomTermsFeatureTableField } from './config';
6
+ /**
7
+ * Custom term feature from the feature table
8
+ */
9
+ export type CustomTermFeature = {
10
+ /**
11
+ * objectId of the feature
12
+ */
13
+ objectId: number;
14
+ /**
15
+ * the term that is added by the user
16
+ */
17
+ term: string;
18
+ /**
19
+ * the category of the term
20
+ */
21
+ category: CustomTermCategory;
22
+ /**
23
+ * the status of the term
24
+ */
25
+ status: CustomTermStatus;
26
+ /**
27
+ * title of the item that the term is added to,
28
+ * this is used to provide context to the term
29
+ * when it is reviewed by the Living Atlas team
30
+ */
31
+ title: string;
32
+ /**
33
+ * snippet of the item that the term is added to,
34
+ * this is used to provide context to the term
35
+ * when it is reviewed by the Living Atlas team
36
+ */
37
+ snippet: string;
38
+ /**
39
+ * itemId of the item that the term is added to,
40
+ */
41
+ itemId: string;
42
+ /**
43
+ * note of this term
44
+ */
45
+ note: string;
46
+ /**
47
+ * date when the term was created
48
+ */
49
+ creationDate: number;
50
+ /**
51
+ * date when the term was last modified
52
+ */
53
+ modifiedDate: number;
54
+ /**
55
+ * the user who created the term
56
+ */
57
+ creator: string;
58
+ /**
59
+ * the user who edited the term
60
+ */
61
+ editor: string;
62
+ };
63
+ type GetCustomTermsOptions = {
64
+ /**
65
+ * The user IDs to filter the custom terms by creator.
66
+ */
67
+ userIds: string[];
68
+ /**
69
+ * The authentication token.
70
+ */
71
+ token: string;
72
+ /**
73
+ * The status filter for the custom terms.
74
+ */
75
+ status?: CustomTermStatus[];
76
+ /**
77
+ * The fields to include in the response.
78
+ */
79
+ fields?: CustomTermsFeatureTableField[];
80
+ /**
81
+ * The maximum number of records to return.
82
+ * If set, the function will stop fetching more records once this limit is reached.
83
+ * If not set, the function will fetch all records.
84
+ */
85
+ maxNumOfRecords?: number;
86
+ /**
87
+ * The offset for the result set.
88
+ */
89
+ resultOffset?: number;
90
+ };
91
+ /**
92
+ * Fetches custom terms from the Custom Terms Feature Table based on the provided options.
93
+ *
94
+ * @param {Object} options - The options for fetching custom terms.
95
+ * @param {string} options.token - The authentication token.
96
+ * @param {string[]} [options.status] - The status filter for the custom terms.
97
+ * @param {string[]} options.userIds - The user IDs to filter the custom terms by creator.
98
+ * @param {string[]} [options.fields] - The fields to include in the response.
99
+ *
100
+ * @returns {Promise<CustomTermFeature[]>} A promise that resolves to an array of custom term features.
101
+ *
102
+ * @throws Will throw an error if the response contains an error.
103
+ */
104
+ export declare const getCustomTerms: ({ token, status, userIds, fields, maxNumOfRecords, resultOffset, }: GetCustomTermsOptions) => Promise<CustomTermFeature[]>;
105
+ /**
106
+ * Retrieves the count of custom terms based on the provided criteria.
107
+ *
108
+ * @param {Object} params - The parameters for the request.
109
+ * @param {string} params.token - The authentication token.
110
+ * @param {CustomTermStatus[]} [params.status] - Optional array of custom term statuses to filter by.
111
+ * @param {string[]} params.userIds - Array of user IDs to filter by.
112
+ *
113
+ * @returns {Promise<number>} - A promise that resolves to the count of custom terms.
114
+ */
115
+ export declare const getCountOfCustomTerms: ({ token, status, userIds, }: {
116
+ token: string;
117
+ status?: CustomTermStatus[];
118
+ userIds: string[];
119
+ }) => Promise<number>;
120
+ /**
121
+ * Retrieves the custom terms that have been submitted by users for review.
122
+ * The custom terms have a status of 'submitted' meaning they are **pending review** by the Living Atlas team.
123
+ *
124
+ * @param {Object} params - The parameters for retrieving submitted custom terms.
125
+ * @param {string[]} [params.userIds] - Optional array of user IDs to filter the custom terms.
126
+ * @param {boolean} [params.shouldIncludeAllFields=false] - Flag indicating whether to include all fields in the response.
127
+ * @param {string} params.token - The authentication token required to access the custom terms.
128
+ * @returns {Promise<CustomTermFeature[]>} A promise that resolves to an array of submitted custom term features.
129
+ */
130
+ export declare const getSubmittedCustomTerms: ({ userIds, shouldIncludeAllFields, token, }: {
131
+ userIds?: string[];
132
+ shouldIncludeAllFields?: boolean;
133
+ token: string;
134
+ }) => Promise<CustomTermFeature[]>;
135
+ /**
136
+ * Get custom terms that are added by the signed-in user.
137
+ *
138
+ * @param userId id of the user
139
+ * @param token authentication token
140
+ * @returns Promise<CustomTermFeature[]> array of custom term features that are added by the signed-in user.
141
+ */
142
+ export declare const getMyCustomTerms: ({ userId, token, maxNumOfRecords, resultOffset, }: {
143
+ userId: string;
144
+ token: string;
145
+ maxNumOfRecords?: number;
146
+ resultOffset?: number;
147
+ }) => Promise<CustomTermFeature[]>;
148
+ /**
149
+ * Get the count of custom terms that are added by the signed-in user.
150
+ *
151
+ * @param userId id of the user
152
+ * @param token authentication token
153
+ * @returns Promise<number> count of custom terms that are added by the signed-in user.
154
+ */
155
+ export declare const getCountOfMyCustomTerms: (userId: string, token: string) => Promise<number>;
156
+ /**
157
+ * Add custom term to the feature table for the Living Atlas team to review
158
+ *
159
+ * @param customTermFeature - The custom term feature to be added.
160
+ * @param token - The authentication token.
161
+ * @returns A promise that resolves to an array of `AddCustomTermFeatureResponse` objects.
162
+ *
163
+ * @remark
164
+ * Here is an example of a failed request with `rollbackOnFailure`. This is caused by the second feature containing invalid data for the `item_id` field.
165
+ *
166
+ * ```
167
+ * {
168
+ * "addResults" : [
169
+ * {
170
+ * "objectId" : 1010,
171
+ * "uniqueId" : 1010,
172
+ * "globalId" : "1F68",
173
+ * "success" : false,
174
+ * "error" : {
175
+ * "code" : 1003,
176
+ * "description" : "Operation rolled back."
177
+ * }
178
+ * },
179
+ * {
180
+ * "objectId" : -1,
181
+ * "uniqueId" : -1,
182
+ * "globalId" : "AE186",
183
+ * "success" : false,
184
+ * "error" : {
185
+ * "code" : 1000,
186
+ * "description" : "String or binary data would be truncated.\r\nThe statement has been terminated."
187
+ * }
188
+ * }
189
+ * ]
190
+ * }
191
+ * ```
192
+ */
193
+ export declare const addCustomTerms2FeatureTable: (data: {
194
+ term: string;
195
+ category: CustomTermCategory;
196
+ title: string;
197
+ snippet: string;
198
+ itemId: string;
199
+ }[], token: string) => Promise<AddFeaturesResponse[]>;
200
+ /**
201
+ * Updates the status of custom terms in the feature table.
202
+ *
203
+ * @param token - The authentication token required for the operation
204
+ * @param data - An array of objects containing:
205
+ * - objectId: The unique identifier of the custom term
206
+ * - status: The decision made by the Living Atlas team about the term
207
+ * - note: A comment/note left by the Living Atlas team
208
+ *
209
+ * @throws {Error} If token is missing, required fields are not provided, or other operation errors occur
210
+ * @returns A promise that resolves to an array of ApplyEditsResult objects
211
+ */
212
+ export declare const updateStatusOfCustomTermsInFeatureTable: (token: string, data: {
213
+ objectId: number;
214
+ /**
215
+ * the status of the term, which is the decision made by the Living Atlas team
216
+ */
217
+ status: CustomTermStatus;
218
+ /**
219
+ * note/comment left by the Living Atlas team
220
+ */
221
+ note: string;
222
+ }[]) => Promise<ApplyEditsResult[]>;
223
+ /**
224
+ * Get the item info for the Custom Terms feature table.
225
+ * @param token - The authentication token required to access the item info.
226
+ * @returns A promise that resolves to an `ItemInfoResponse` object containing metadata about the feature table.
227
+ */
228
+ export declare const getCustomTermsFeatureTableItemInfo: (token: string) => Promise<ItemInfoResponse>;
229
+ export {};