@mdgf11/filesystem-lib 2.2.4 → 2.2.6

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.
@@ -83,8 +83,14 @@ export async function createJurisprudenciaDocument(retrievable_Metadata, content
83
83
  "Jurisprudência": { Index: ["Simples"], Original: ["Simples"], Show: ["Simples"] },
84
84
  "STATE": "importação",
85
85
  };
86
- obj.Sumário = "";
87
- obj.Texto = content.map(line => `<p><font>${line}</font><br>`).join('');
86
+ if (retrievable_Metadata.process_mean.includes("Sumário")) {
87
+ obj.Sumário = content.map(line => `<p><font>${line}</font><br>`).join('');
88
+ obj.Texto = "";
89
+ }
90
+ else {
91
+ obj.Sumário = "";
92
+ obj.Texto = content.map(line => `<p><font>${line}</font><br>`).join('');
93
+ }
88
94
  if (retrievable_Metadata.descriptors && retrievable_Metadata.descriptors.length > 0) {
89
95
  obj.Descritores = {
90
96
  Index: retrievable_Metadata.descriptors.map(desc => DescritorOficial[desc]),
@@ -102,7 +108,7 @@ export async function createJurisprudenciaDocument(retrievable_Metadata, content
102
108
  obj["Relator Nome Profissional"] = { Index: [retrievable_Metadata.judge], Original: [retrievable_Metadata.judge], Show: [retrievable_Metadata.judge] };
103
109
  }
104
110
  if (retrievable_Metadata.process_mean && retrievable_Metadata.process_mean.length > 0) {
105
- obj["Meio Processual"] = { Index: [retrievable_Metadata.process_mean], Original: [retrievable_Metadata.process_mean], Show: [retrievable_Metadata.process_mean] };
111
+ obj["Meio Processual"] = { Index: retrievable_Metadata.process_mean, Original: retrievable_Metadata.process_mean, Show: retrievable_Metadata.process_mean };
106
112
  }
107
113
  if (retrievable_Metadata.decision && retrievable_Metadata.decision.length > 0) {
108
114
  obj["Decisão"] = { Index: [retrievable_Metadata.decision], Original: [retrievable_Metadata.decision], Show: [retrievable_Metadata.decision] };
package/dist/types.d.ts CHANGED
@@ -39,7 +39,7 @@ export type Sharepoint_Metadata = {
39
39
  export type Retrievable_Metadata = {
40
40
  process_number: string;
41
41
  judge: string;
42
- process_mean: string;
42
+ process_mean: string[];
43
43
  decision: string;
44
44
  descriptors?: string[];
45
45
  };
@@ -48,7 +48,7 @@ export type Date_Area_Section = {
48
48
  area: string;
49
49
  section: string;
50
50
  };
51
- export declare const SUPPORTED_EXTENSIONS: readonly ["txt", "pdf", "docx"];
51
+ export declare const SUPPORTED_EXTENSIONS: readonly ["txt", "pdf", "docx", "html"];
52
52
  export type Supported_Content_Extensions = typeof SUPPORTED_EXTENSIONS[number];
53
53
  export type ContentType = {
54
54
  extension: Supported_Content_Extensions;
package/dist/types.js CHANGED
@@ -11,7 +11,7 @@ export const SHAREPOINT_LOGS_PATH = `${LOGS_PATH}/Sharepoint`;
11
11
  export const JURIS_LOGS_PATH = `${LOGS_PATH}/Juris`;
12
12
  export const SHAREPOINT_UPDATE_DIR = `${ROOT_PATH}${SHAREPOINT_LOGS_PATH}`;
13
13
  export const JURIS_UPDATE_DIR = `${ROOT_PATH}${JURIS_LOGS_PATH}`;
14
- export const SUPPORTED_EXTENSIONS = ["txt", "pdf", "docx"];
14
+ export const SUPPORTED_EXTENSIONS = ["txt", "pdf", "docx", "html"];
15
15
  export function isSupportedExtension(ext) {
16
16
  return SUPPORTED_EXTENSIONS.includes(ext);
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdgf11/filesystem-lib",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "Library to extend usage of jurisprudencia-document",
5
5
  "license": "ISC",
6
6
  "author": "Miguel Fonseca",
@@ -93,8 +93,13 @@ export async function createJurisprudenciaDocument(retrievable_Metadata: Retriev
93
93
  "Jurisprudência": { Index: ["Simples"], Original: ["Simples"], Show: ["Simples"] },
94
94
  "STATE": "importação",
95
95
  }
96
- obj.Sumário = "";
97
- obj.Texto = content.map(line => `<p><font>${line}</font><br>`).join('');
96
+ if (retrievable_Metadata.process_mean.includes("Sumário")) {
97
+ obj.Sumário = content.map(line => `<p><font>${line}</font><br>`).join('');
98
+ obj.Texto = "";
99
+ } else {
100
+ obj.Sumário = "";
101
+ obj.Texto = content.map(line => `<p><font>${line}</font><br>`).join('');
102
+ }
98
103
  if (retrievable_Metadata.descriptors && retrievable_Metadata.descriptors.length > 0) {
99
104
  obj.Descritores = {
100
105
  Index: retrievable_Metadata.descriptors.map(desc => DescritorOficial[desc]),
@@ -112,7 +117,7 @@ export async function createJurisprudenciaDocument(retrievable_Metadata: Retriev
112
117
  obj["Relator Nome Profissional"] = { Index: [retrievable_Metadata.judge], Original: [retrievable_Metadata.judge], Show: [retrievable_Metadata.judge] };
113
118
  }
114
119
  if (retrievable_Metadata.process_mean && retrievable_Metadata.process_mean.length > 0) {
115
- obj["Meio Processual"] = { Index: [retrievable_Metadata.process_mean], Original: [retrievable_Metadata.process_mean], Show: [retrievable_Metadata.process_mean] };
120
+ obj["Meio Processual"] = { Index: retrievable_Metadata.process_mean, Original: retrievable_Metadata.process_mean, Show: retrievable_Metadata.process_mean };
116
121
  }
117
122
  if (retrievable_Metadata.decision && retrievable_Metadata.decision.length > 0) {
118
123
  obj["Decisão"] = { Index: [retrievable_Metadata.decision], Original: [retrievable_Metadata.decision], Show: [retrievable_Metadata.decision] };
package/src/types.ts CHANGED
@@ -41,10 +41,10 @@ export type Sharepoint_Metadata = {
41
41
  xor_hash?: string,
42
42
  }
43
43
 
44
- export type Retrievable_Metadata = { process_number: string, judge: string, process_mean: string, decision: string, descriptors?: string[] };
44
+ export type Retrievable_Metadata = { process_number: string, judge: string, process_mean: string[], decision: string, descriptors?: string[] };
45
45
  export type Date_Area_Section = { file_date: Date, area: string, section: string };
46
46
 
47
- export const SUPPORTED_EXTENSIONS = ["txt", "pdf", "docx"] as const;
47
+ export const SUPPORTED_EXTENSIONS = ["txt", "pdf", "docx", "html"] as const;
48
48
  export type Supported_Content_Extensions = typeof SUPPORTED_EXTENSIONS[number];
49
49
 
50
50
  export type ContentType = {