@vannizhang/living-atlas-content-validator 1.5.19-beta.8 → 1.5.19

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 (51) hide show
  1. package/README.md +258 -204
  2. package/dist/configureSettings.d.ts +27 -25
  3. package/dist/configureSettings.js +14 -13
  4. package/dist/configureSettings.js.map +1 -1
  5. package/dist/index.d.ts +9 -4
  6. package/dist/index.js +13 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js +6 -9
  9. package/dist/lib/checkTitleAndSnippetSearchability/matchDateTimeInfo.js.map +1 -1
  10. package/dist/lib/config.d.ts +1 -1
  11. package/dist/lib/config.js +6 -0
  12. package/dist/lib/config.js.map +1 -1
  13. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.d.ts +4 -0
  14. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js +24 -16
  15. package/dist/lib/featureServiceFieldAliases/checkFeatureServiceFieldAliases.js.map +1 -1
  16. package/dist/lib/featureServiceFieldAliases/helpers.d.ts +19 -0
  17. package/dist/lib/featureServiceFieldAliases/helpers.js +48 -0
  18. package/dist/lib/featureServiceFieldAliases/helpers.js.map +1 -0
  19. package/dist/lib/featureServiceFieldAliases/scoringConfig.js +1 -1
  20. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.d.ts +4 -0
  21. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js +37 -18
  22. package/dist/lib/featureServiceFieldDescriptions/checkFeatureServiceFieldDescriptions.js.map +1 -1
  23. package/dist/lib/featureServiceFieldDescriptions/helpers.d.ts +20 -0
  24. package/dist/lib/featureServiceFieldDescriptions/helpers.js +53 -0
  25. package/dist/lib/featureServiceFieldDescriptions/helpers.js.map +1 -0
  26. package/dist/lib/featureServiceFieldDescriptions/scoringConfig.js +1 -1
  27. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.d.ts +4 -0
  28. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js +25 -18
  29. package/dist/lib/featureServiceFieldValueTypes/checkFeatureServiceFieldValueTypes.js.map +1 -1
  30. package/dist/lib/featureServiceFieldValueTypes/helpers.d.ts +16 -0
  31. package/dist/lib/featureServiceFieldValueTypes/helpers.js +35 -0
  32. package/dist/lib/featureServiceFieldValueTypes/helpers.js.map +1 -0
  33. package/dist/lib/featureServiceFieldValueTypes/scoringConfig.js +1 -1
  34. package/dist/lib/ssl/isValidSSL.js +3 -1
  35. package/dist/lib/ssl/isValidSSL.js.map +1 -1
  36. package/dist/locale/de.json +21 -24
  37. package/dist/locale/en.json +7 -10
  38. package/dist/locale/es.json +21 -24
  39. package/dist/locale/fr.json +21 -24
  40. package/dist/locale/ja.json +21 -24
  41. package/dist/locale/pt-br.json +21 -24
  42. package/dist/package-info.json +1 -1
  43. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.d.ts +11 -6
  44. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js +56 -16
  45. package/dist/services/feature-service/fetchFeatureServiceLayersAndTables.js.map +1 -1
  46. package/dist/services/feature-service/getFeatureServerURL.d.ts +12 -0
  47. package/dist/services/feature-service/getFeatureServerURL.js +37 -0
  48. package/dist/services/feature-service/getFeatureServerURL.js.map +1 -0
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/index.js.map +1 -1
  51. package/package.json +1 -1
@@ -172,33 +172,30 @@
172
172
  "ADD_TOPIC_INFO": "Adicione um tópico para comunicar sobre o que é este item."
173
173
  },
174
174
  "featureLayerFieldAliases": {
175
- "GUIDANCE_DEFAULT": "Field aliases are the names of the fields in your feature layer.",
176
- "SCORING_MSG_DEFAULT": "Points are awarded for having at least 80% of the field aliases in your feature layer.",
177
- "LABEL": "Improve Field Aliases",
178
- "TITLE": "Check Field Aliases",
179
- "ADD_FIELD_ALIAS": "Add field aliases to your feature layer",
180
- "IMPROVE_FIELD_ALIAS": "Improve field aliases in your feature layer",
181
- "NO_FEATURE_LAYER": "This feature service does not have any feature layer or non-spatial table",
182
- "NO_RELEVANT_FIELD": "This feature service does not have any relevant fields (non-system generated) to validate"
175
+ "GUIDANCE_DEFAULT": "Por padrão, a maioria das camadas começa usando o Nome do Campo como o Apelido do Ca</strong><strong></strong><strong><p>mpo, tornando-os idênticos. Isso coloca sobre cada usuário a responsabilidade de traduzir cada Nome de Campo em um Apelido ​​de Campo útil (às vezes mostrado como Nome de Exibição). Se, como proprietário deste item, você fornecer Apelidos de Campo agora, isso economizará cumulativamente centenas ou milhares de horas de trabalho para outros que encontrarem sua camada e quiserem usá-la. Ao colocar esses metadados adicionais &quot;on board&quot; da camada, os usuários não precisam procurar essas informações em documentos de metadados, pois as informações já estão presentes. Como resultado, cada usuário pode aprender o que esse campo representa simplesmente lendo o Apelido ​​do Campo em todos os lugares onde ele aparece: legenda do mapa, pop-up, tabela de dados, todas as interfaces onde o usuário é solicitado a escolher um campo.</p><br/><p>Na página do item, vá para a guia <strong>Dados</strong>, clique no botão <strong>Campos</strong> e clique no primeiro campo na coluna <strong>Nome de exibição</strong>. Para editar o <strong>Apelido do Campo</strong> (também conhecido como <strong>Nome de Exibição</strong>), clique no botão de lápis e insira um Apelido ​​de Campo/Nome de Exibição fácil de entender. Dica: copie e cole o conteúdo de um dicionário de dados, um documento oficial de metadados ou PDF que descreva cada campo.</p><br/><p><strong>Exemplos:</strong> no texto do Apelido do Campo, altere &quot;LASTEDITOR&quot; to &quot;Last Editor&quot;; change &quot;FEATURECODE&quot; to &quot;Facility Site Code&quot;; change &quot;NUMSTORIES&quot; to &quot;Number of Stories.&quot; Observe como o nome do campo permanece inalterado.</p>",
176
+ "SCORING_MSG_DEFAULT": "Pontos serão concedidos se 90% dos Apelidos de Campo (Nomes de Exibição) forem editados de forma que não sejam mais idênticos aos Nomes de Campo.",
177
+ "LABEL": "Melhorar os Apelidos de Campo",
178
+ "TITLE": "Verificar Apelidos do Campo",
179
+ "IMPROVE_FIELD_ALIAS": "Melhore os Apelidos de Campo no seu serviço de feição.",
180
+ "NO_FEATURE_LAYER": "Este serviço de feição não possui nenhuma camada de feição ou tabela não espacial.",
181
+ "NO_RELEVANT_FIELD": "Este serviço de feição não possui campos relevantes (não gerados pelo sistema) para validar."
183
182
  },
184
183
  "featureLayerFieldTypes": {
185
- "GUIDANCE_DEFAULT": "Field types are the data types of the fields in your feature layer.",
186
- "SCORING_MSG_DEFAULT": "Points are awarded for having at least 80% of the field types in your feature layer.",
187
- "LABEL": "Improve Field Types",
188
- "TITLE": "Check Field Types",
189
- "ADD_FIELD_TYPE": "Add field types to your feature layer",
190
- "IMRPOVE_FIELD_TYPE": "Improve field types in your feature layer",
191
- "NO_FEATURE_LAYER": "This feature service does not have any feature layer or non-spatial table",
192
- "NO_RELEVANT_FIELD": "This feature service does not have any relevant fields (non-system generated) to validate"
184
+ "GUIDANCE_DEFAULT": "<p>Para ajudar usuários e aplicativos clientes a identificar como os valores de campo devem ser usados ​​ou representados, defina os tipos de valores que são armazenados em cada campo de atributo em uma camada de feição hospedada. Por exemplo, se você definir um campo de texto como um número de telefone, os aplicativos clientes podem formatar o texto da maneira apropriada, como (123) 456-7890. O ArcGIS Online usa tipos de valores de campo para mostrar as opções mais relevantes ao desenhar uma camada em um mapa ou configurar pop-ups. Veja os <a href=\"https://doc.arcgis.com/en/arcgis-online/manage-data/describe-fields.htm\" target=\"_blank\">Tipos de Valor de Campo listados aqui</a>.</p><br/><p>Por padrão, uma camada geralmente não contém um <strong>Tipo de Valor de Campo</strong> em seus campos de atributo. Esta é uma oportunidade perdida de compartilhar contexto adicional sobre que tipo de valor é armazenado no campo. Isso coloca sobre cada usuário a responsabilidade de encontrar um documento de metadados, se disponível, para que eles possam descobrir exatamente o que está armazenado naquele campo. Se, como proprietário deste item, você fornecer Tipos de Valor de Campo agora, isso economizará cumulativamente centenas ou milhares de horas de trabalho para outras pessoas que encontrarem sua camada e quiserem usá-la. Ao colocar esses metadados adicionais \"a bordo\" da camada, os usuários não precisam procurar essas informações em documentos de metadados, pois elas já estão presentes. Como resultado, cada usuário pode aprender um detalhe importante sobre o que esse campo representa simplesmente lendo o Tipo de Valor do Campo em todos os lugares onde ele aparece, por exemplo, quando o usuário clica em um botão de informações do campo. Ele também ajuda os desenvolvedores de software a detectar se um valor de campo conterá uma contagem, porcentagem, medição etc.</p><br/><p>Na página do item, vá para a guia <strong>Dados</strong>, clique no botão <strong>Campos</strong> e clique no primeiro campo na coluna <strong>Nome de exibição</strong>. Para editar o <strong>Tipo de Valor do Campo</strong>, clique no botão de lápis e edite o Tipo de Valor do Campo para que ele represente os tipos de valores que o campo contém.</p>",
185
+ "SCORING_MSG_DEFAULT": "Os pontos serão concedidos se 90% dos Tipos de Valor de Campo forem definidos como um valor.",
186
+ "LABEL": "Melhorar os Tipos de Valor de Campo",
187
+ "TITLE": "Verificar Tipos de Valor de Campo",
188
+ "IMRPOVE_FIELD_TYPE": "Melhore os Tipos de Valores de Campo no seu serviço de feição.",
189
+ "NO_FEATURE_LAYER": "Este serviço de feição não possui nenhuma camada de feição ou tabela não espacial.",
190
+ "NO_RELEVANT_FIELD": "Este serviço de feição não possui campos relevantes (não gerados pelo sistema) para validar."
193
191
  },
194
192
  "featureLayerFieldDescriptions": {
195
- "GUIDANCE_DEFAULT": "Field descriptions are the descriptions of the fields in your feature layer. ",
196
- "SCORING_MSG_DEFAULT": "Points are awarded for having at least 80% of the field descriptions in your feature layer.",
197
- "LABEL": "Improve Field Descriptions",
198
- "TITLE": "Check Field Descriptions",
199
- "ADD_FIELD_DESCRIPTION": "Add field descriptions to your feature layer",
200
- "IMRPOVE_FIELD_DESCRIPTION": "Improve field descriptions in your feature layer",
201
- "NO_FEATURE_LAYER": "This feature service does not have any feature layer or non-spatial table",
202
- "NO_RELEVANT_FIELD": "This feature service does not have any relevant fields (non-system generated) to validate"
193
+ "GUIDANCE_DEFAULT": "<p>Por padrão, uma camada geralmente não contém uma <strong>Descrição de Campo</strong> em seus campos de atributo. Isso coloca sobre cada usuário a responsabilidade de encontrar um documento de metadados, se disponível, para que eles possam descobrir exatamente o que está armazenado naquele campo. Se, como proprietário deste item, você fornecer Descrições de Campo agora, isso economizará cumulativamente centenas ou milhares de horas de trabalho para outros que encontrarem sua camada e quiserem usá-la. Ao colocar esses metadados adicionais &quot;a bordo&quot; da camada, os usuários não precisam procurar essas informações em documentos de metadados, pois as informações já estão presentes. Como resultado, cada usuário pode aprender os detalhes sobre o que esse campo representa simplesmente lendo a Descrição do Campo em todos os lugares onde ela aparece, por exemplo, quando o usuário clica em um botão de informações do campo.</p><br/><p>Na página do item, vá para a guia <strong>Dados</strong>, clique no botão <strong>Campos</strong> e clique no primeiro campo na coluna <strong>Nome de exibição</strong>. Para editar a <strong>Descrição do Campo</strong>, clique no botão de lápis e edite a descrição para que ela explique o que o campo contém. Dica: copie e cole o conteúdo de um dicionário de dados, um documento oficial de metadados ou PDF que descreva cada campo.</p>",
194
+ "SCORING_MSG_DEFAULT": "Os pontos são concedidos se 90% das Descrições de Campo contiverem uma frase ou mais de informações descrevendo o atributo. A Descrição do Campo deve ser diferente do Apelido do Campo.",
195
+ "LABEL": "Melhore as Descrições dos Campos",
196
+ "TITLE": "Verifique as Descrições dos Campos",
197
+ "IMRPOVE_FIELD_DESCRIPTION": "Melhore as Descrições dos Campos no seu serviço de feição.",
198
+ "NO_FEATURE_LAYER": "Este serviço de feição não possui nenhuma camada de feição ou tabela não espacial.",
199
+ "NO_RELEVANT_FIELD": "Este serviço de feição não possui campos relevantes (não gerados pelo sistema) para validar."
203
200
  }
204
201
  }
@@ -1 +1 @@
1
- {"lastCompiledTime":1748449412805}
1
+ {"lastCompiledTime":1750786361701}
@@ -1,9 +1,14 @@
1
1
  import { FeatureLayerJSON, IItem } from '../../types';
2
2
  /**
3
- * Fetches the layers of a feature service from the ArcGIS REST API.
4
- * @param item - The item representing the feature service.
5
- * @param token - The token for authentication.
6
- * @returns A promise that resolves to an array of FeatureLayerJSON objects.
7
- * @throws An error if the item is not a feature service or if the URL is not found.
3
+ * Fetches the layers and tables from a given feature service item.
4
+ *
5
+ * Attempts to retrieve the feature service layers and tables using the provided authentication token.
6
+ * If an 'Invalid token' error is encountered, it retries the request without the token.
7
+ *
8
+ * @param item - The feature service item to fetch layers and tables from.
9
+ * @param token - The authentication token to use for the request.
10
+ * @param bypassCache - Optional flag to bypass any caching mechanisms. Defaults to false.
11
+ * @returns A promise that resolves to an array of `FeatureLayerJSON` objects representing the layers and tables.
12
+ * @throws Will throw an error if fetching fails, including after retrying without a token.
8
13
  */
9
- export declare const fetchFeatureServiceLayersAndTables: (item: IItem, token: string) => Promise<FeatureLayerJSON[]>;
14
+ export declare const fetchFeatureServiceLayersAndTables: (item: IItem, token: string, bypassCache?: boolean) => Promise<FeatureLayerJSON[]>;
@@ -11,15 +11,51 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.fetchFeatureServiceLayersAndTables = void 0;
13
13
  const isFeatureService_1 = require("../../lib/util/isFeatureService");
14
+ const getFeatureServerURL_1 = require("./getFeatureServerURL");
15
+ /**
16
+ * Fetches the layers and tables from a given feature service item.
17
+ *
18
+ * Attempts to retrieve the feature service layers and tables using the provided authentication token.
19
+ * If an 'Invalid token' error is encountered, it retries the request without the token.
20
+ *
21
+ * @param item - The feature service item to fetch layers and tables from.
22
+ * @param token - The authentication token to use for the request.
23
+ * @param bypassCache - Optional flag to bypass any caching mechanisms. Defaults to false.
24
+ * @returns A promise that resolves to an array of `FeatureLayerJSON` objects representing the layers and tables.
25
+ * @throws Will throw an error if fetching fails, including after retrying without a token.
26
+ */
27
+ const fetchFeatureServiceLayersAndTables = (item_1, token_1, ...args_1) => __awaiter(void 0, [item_1, token_1, ...args_1], void 0, function* (item, token, bypassCache = false) {
28
+ try {
29
+ return yield fetchFeatureServiceLayersAndTablesHelper(item, token, bypassCache);
30
+ }
31
+ catch (error) {
32
+ // Check for 'Invalid token' error and retry without token
33
+ if (error instanceof Error &&
34
+ error.message &&
35
+ error.message.toLowerCase().includes('invalid token')) {
36
+ try {
37
+ console.warn('Invalid token error detected while fetching feature service layers. Retrying without token...');
38
+ return yield fetchFeatureServiceLayersAndTablesHelper(item, undefined, bypassCache);
39
+ }
40
+ catch (retryError) {
41
+ console.error('Error fetching feature service layers and tables after retry:', retryError);
42
+ throw retryError;
43
+ }
44
+ }
45
+ console.error('Error fetching feature service layers and tables:', error);
46
+ throw error; // rethrow the error for the caller to handle
47
+ }
48
+ });
49
+ exports.fetchFeatureServiceLayersAndTables = fetchFeatureServiceLayersAndTables;
14
50
  /**
15
51
  * Fetches the layers of a feature service from the ArcGIS REST API.
16
52
  * @param item - The item representing the feature service.
17
53
  * @param token - The token for authentication.
54
+ * @param bypassCache - Whether to bypass the cache (default is false). If true, a query timestamp is added to the request to bypass any cached responses.
18
55
  * @returns A promise that resolves to an array of FeatureLayerJSON objects.
19
56
  * @throws An error if the item is not a feature service or if the URL is not found.
20
57
  */
21
- const fetchFeatureServiceLayersAndTables = (item, token) => __awaiter(void 0, void 0, void 0, function* () {
22
- var _a;
58
+ const fetchFeatureServiceLayersAndTablesHelper = (item_1, token_1, ...args_1) => __awaiter(void 0, [item_1, token_1, ...args_1], void 0, function* (item, token, bypassCache = false) {
23
59
  if (!item) {
24
60
  throw new Error('Item is required');
25
61
  }
@@ -29,21 +65,25 @@ const fetchFeatureServiceLayersAndTables = (item, token) => __awaiter(void 0, vo
29
65
  if (!item.url) {
30
66
  throw new Error('URL of the feature service is not found');
31
67
  }
32
- try {
33
- const res = yield fetch(`${item.url}/layers?f=json&token=${token}`);
34
- const data = yield res.json();
35
- if (data.error) {
36
- throw new Error('Error fetching feature service data: ' +
37
- (((_a = data === null || data === void 0 ? void 0 : data.error) === null || _a === void 0 ? void 0 : _a.message) || 'Unknown error'));
38
- }
39
- const layers = data.layers || [];
40
- const tables = data.tables || [];
41
- const layersAndTables = [...layers, ...tables];
42
- return layersAndTables;
68
+ // get the feature server URL
69
+ const url = (0, getFeatureServerURL_1.getFeatureServerRootURL)(item.url);
70
+ const params = new URLSearchParams({
71
+ f: 'json',
72
+ });
73
+ if (token) {
74
+ params.append('token', token);
43
75
  }
44
- catch (error) {
45
- throw new Error('Error fetching feature service data: ' + error);
76
+ if (bypassCache) {
77
+ params.append('queryTimestamp', new Date().getTime().toString());
78
+ }
79
+ const res = yield fetch(`${url}/layers?${params.toString()}`);
80
+ const data = yield res.json();
81
+ if (data.error) {
82
+ throw new Error(data.error.message || 'Error fetching feature service layers');
46
83
  }
84
+ const layers = data.layers || [];
85
+ const tables = data.tables || [];
86
+ const layersAndTables = [...layers, ...tables];
87
+ return layersAndTables;
47
88
  });
48
- exports.fetchFeatureServiceLayersAndTables = fetchFeatureServiceLayersAndTables;
49
89
  //# sourceMappingURL=fetchFeatureServiceLayersAndTables.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchFeatureServiceLayersAndTables.js","sourceRoot":"","sources":["../../../src/services/feature-service/fetchFeatureServiceLayersAndTables.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sEAAmE;AAQnE;;;;;;GAMG;AACI,MAAM,kCAAkC,GAAG,CAC9C,IAAW,EACX,KAAa,EACc,EAAE;;IAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,IAAA,mCAAgB,EAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,wBAAwB,KAAK,EAAE,CAAC,CAAC;QACpE,MAAM,IAAI,GAAiC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAE5D,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACX,uCAAuC;gBACnC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,OAAO,KAAI,eAAe,CAAC,CAChD,CAAC;QACN,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;QAEjC,MAAM,eAAe,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;QAE/C,OAAO,eAAe,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uCAAuC,GAAG,KAAK,CAAC,CAAC;IACrE,CAAC;AACL,CAAC,CAAA,CAAC;AApCW,QAAA,kCAAkC,sCAoC7C"}
1
+ {"version":3,"file":"fetchFeatureServiceLayersAndTables.js","sourceRoot":"","sources":["../../../src/services/feature-service/fetchFeatureServiceLayersAndTables.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sEAAmE;AAOnE,+DAAgE;AAEhE;;;;;;;;;;;GAWG;AACI,MAAM,kCAAkC,GAAG,6BAInB,EAAE,oEAH7B,IAAW,EACX,KAAa,EACb,WAAW,GAAG,KAAK;IAEnB,IAAI,CAAC;QACD,OAAO,MAAM,wCAAwC,CACjD,IAAI,EACJ,KAAK,EACL,WAAW,CACd,CAAC;IACN,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,0DAA0D;QAC1D,IACI,KAAK,YAAY,KAAK;YACtB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,EACvD,CAAC;YACC,IAAI,CAAC;gBACD,OAAO,CAAC,IAAI,CACR,+FAA+F,CAClG,CAAC;gBACF,OAAO,MAAM,wCAAwC,CACjD,IAAI,EACJ,SAAS,EACT,WAAW,CACd,CAAC;YACN,CAAC;YAAC,OAAO,UAAU,EAAE,CAAC;gBAClB,OAAO,CAAC,KAAK,CACT,+DAA+D,EAC/D,UAAU,CACb,CAAC;gBACF,MAAM,UAAU,CAAC;YACrB,CAAC;QACL,CAAC;QACD,OAAO,CAAC,KAAK,CACT,mDAAmD,EACnD,KAAK,CACR,CAAC;QACF,MAAM,KAAK,CAAC,CAAC,6CAA6C;IAC9D,CAAC;AACL,CAAC,CAAA,CAAC;AAzCW,QAAA,kCAAkC,sCAyC7C;AAEF;;;;;;;GAOG;AACH,MAAM,wCAAwC,GAAG,6BAIlB,EAAE,oEAH7B,IAAW,EACX,KAAa,EACb,WAAW,GAAG,KAAK;IAEnB,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,IAAA,mCAAgB,EAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC/D,CAAC;IAED,6BAA6B;IAC7B,MAAM,GAAG,GAAG,IAAA,6CAAuB,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QAC/B,CAAC,EAAE,MAAM;KACZ,CAAC,CAAC;IAEH,IAAI,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QACd,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,GAAG,WAAW,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAiC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAE5D,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACX,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,uCAAuC,CAChE,CAAC;IACN,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;IAE/C,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAA,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Returns the URL of the FeatureServer endpoint for a given item URL.
3
+ *
4
+ * - If the input URL is empty or falsy, returns an empty string.
5
+ * - If the URL already ends with '/FeatureServer', returns it as is.
6
+ * - If the URL ends with a trailing slash, removes it.
7
+ * - If the URL ends with a layer or table index (e.g., '/0'), removes the index.
8
+ *
9
+ * @param itemUrl - The URL of the item to process.
10
+ * @returns The normalized FeatureServer URL.
11
+ */
12
+ export declare const getFeatureServerRootURL: (itemUrl: string, amdinEndPoint?: boolean) => string;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFeatureServerRootURL = void 0;
4
+ const getFeatureServerAdminRootURL = (itemUrl) => {
5
+ if (!itemUrl) {
6
+ return '';
7
+ }
8
+ itemUrl = itemUrl.replace(/\/rest\/services/i, '/rest/admin/services');
9
+ return itemUrl;
10
+ };
11
+ /**
12
+ * Returns the URL of the FeatureServer endpoint for a given item URL.
13
+ *
14
+ * - If the input URL is empty or falsy, returns an empty string.
15
+ * - If the URL already ends with '/FeatureServer', returns it as is.
16
+ * - If the URL ends with a trailing slash, removes it.
17
+ * - If the URL ends with a layer or table index (e.g., '/0'), removes the index.
18
+ *
19
+ * @param itemUrl - The URL of the item to process.
20
+ * @returns The normalized FeatureServer URL.
21
+ */
22
+ const getFeatureServerRootURL = (itemUrl, amdinEndPoint = false) => {
23
+ if (!itemUrl) {
24
+ return '';
25
+ }
26
+ if (itemUrl.endsWith('/FeatureServer')) {
27
+ return amdinEndPoint ? getFeatureServerAdminRootURL(itemUrl) : itemUrl; // Return as is if it already ends with /FeatureServer
28
+ }
29
+ if (itemUrl.endsWith('/')) {
30
+ itemUrl = itemUrl.slice(0, -1); // Remove trailing slash
31
+ }
32
+ // /\/\d+$/ matches a forward slash (/) followed by one or more digits (\d+) at the end of the string ($).
33
+ itemUrl = itemUrl.replace(/\/\d+$/, '');
34
+ return amdinEndPoint ? getFeatureServerAdminRootURL(itemUrl) : itemUrl;
35
+ };
36
+ exports.getFeatureServerRootURL = getFeatureServerRootURL;
37
+ //# sourceMappingURL=getFeatureServerURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFeatureServerURL.js","sourceRoot":"","sources":["../../../src/services/feature-service/getFeatureServerURL.ts"],"names":[],"mappings":";;;AAAA,MAAM,4BAA4B,GAAG,CAAC,OAAe,EAAU,EAAE;IAC7D,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAAC;IAEvE,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACI,MAAM,uBAAuB,GAAG,CACnC,OAAe,EACf,aAAa,GAAG,KAAK,EACf,EAAE;IACR,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACd,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACrC,OAAO,aAAa,CAAC,CAAC,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,sDAAsD;IAClI,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB;IAC5D,CAAC;IAED,0GAA0G;IAC1G,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAExC,OAAO,aAAa,CAAC,CAAC,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3E,CAAC,CAAC;AApBW,QAAA,uBAAuB,2BAoBlC"}
@@ -38,6 +38,7 @@ export type IItem = {
38
38
  numViews: number;
39
39
  size: number;
40
40
  protected?: boolean;
41
+ access?: 'private' | 'shared' | 'org' | 'public';
41
42
  [key: string]: any;
42
43
  };
43
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAoIU,QAAA,iBAAiB,GAAG;IAC7B,oBAAoB;IACpB,+BAA+B;IAC/B,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,UAAU;IACV,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,wBAAwB;IACxB,sCAAsC;IACtC,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,mCAAmC;IACnC,+BAA+B;IAC/B,oCAAoC;CAC9B,CAAC;AA4PX;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG;IACvC,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,eAAe;IACf,mBAAmB;IACnB,aAAa;IACb,UAAU;IACV,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,QAAQ;IACR,qBAAqB;IACrB,YAAY;IACZ,aAAa;CACP,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAqIU,QAAA,iBAAiB,GAAG;IAC7B,oBAAoB;IACpB,+BAA+B;IAC/B,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,UAAU;IACV,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,wBAAwB;IACxB,sCAAsC;IACtC,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,mCAAmC;IACnC,+BAA+B;IAC/B,oCAAoC;CAC9B,CAAC;AA4PX;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG;IACvC,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,eAAe;IACf,mBAAmB;IACnB,aAAa;IACb,UAAU;IACV,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,QAAQ;IACR,qBAAqB;IACrB,YAAY;IACZ,aAAa;CACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vannizhang/living-atlas-content-validator",
3
- "version": "1.5.19-beta.8",
3
+ "version": "1.5.19",
4
4
  "description": "Validation and Scoring rules for curating content in the ArcGIS Living Atlas",
5
5
  "repository": {
6
6
  "type": "git",