@mdgf11/filesystem-lib 2.2.10 → 2.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,9 +10,6 @@ export function writeFilesystemDocument(filesystem_document) {
10
10
  const safe = {
11
11
  ...filesystem_document,
12
12
  content: filesystem_document.content?.map(({ extension }) => ({ extension })),
13
- jurisprudencia_document: {
14
- uuid: filesystem_document.jurisprudencia_document.UUID
15
- }
16
13
  };
17
14
  const content = filesystem_document.content;
18
15
  if (filesystem_document.file_path) {
@@ -123,8 +120,9 @@ export async function createJurisprudenciaDocument(retrievable_Metadata, content
123
120
  Data: obj.Data,
124
121
  "Meio Processual": obj["Meio Processual"],
125
122
  "Texto": obj.Texto,
123
+ "Texto Não Anonimizado": obj.Texto,
126
124
  "Sumário": obj.Sumário,
127
- STATE: obj.STATE
125
+ "Sumário Não Anonimizado": obj.Sumário,
128
126
  });
129
127
  obj["UUID"] = calculateUUID(obj["HASH"]);
130
128
  return obj;
package/dist/types.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export declare const UpdateSources: readonly ["STJ (Sharepoint)", "DGSI"];
2
2
  export type SupportedUpdateSources = typeof UpdateSources[number];
3
- import { PartialJurisprudenciaDocument } from '@stjiris/jurisprudencia-document';
4
3
  export declare const ROOT_PATH: string;
5
4
  export declare const FILESYSTEM_PATH = "/FileSystem";
6
5
  export declare const SHAREPOINT_COPY_PATH = "/Sharepoint";
@@ -58,7 +57,7 @@ export type ContentType = {
58
57
  export type FilesystemDocument = {
59
58
  creation_date: Date;
60
59
  last_update_date: Date;
61
- jurisprudencia_document: PartialJurisprudenciaDocument;
60
+ jurisprudencia_document: string;
62
61
  file_path: string;
63
62
  sharepoint_metadata?: Sharepoint_Metadata;
64
63
  content?: ContentType[];
package/dist/types.js CHANGED
@@ -16,3 +16,4 @@ export const SUPPORTED_EXTENSIONS = ["txt", "pdf", "docx", "html"];
16
16
  export function isSupportedExtension(ext) {
17
17
  return SUPPORTED_EXTENSIONS.includes(ext);
18
18
  }
19
+ ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdgf11/filesystem-lib",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "description": "Library to extend usage of jurisprudencia-document",
5
5
  "license": "ISC",
6
6
  "author": "Miguel Fonseca",
@@ -13,7 +13,7 @@
13
13
  "start": "npm run build && npm run run"
14
14
  },
15
15
  "dependencies": {
16
- "@stjiris/jurisprudencia-document": "npm:@mdgf11/jurisprudencia-document@^13.2.5",
16
+ "@stjiris/jurisprudencia-document": "npm:@mdgf11/jurisprudencia-document@^13.2.6",
17
17
  "axios": "^1.13.1",
18
18
  "body-parser": "^2.2.0",
19
19
  "canvas": "^2.11.2",
@@ -12,9 +12,6 @@ export function writeFilesystemDocument(filesystem_document: FilesystemDocument)
12
12
  const safe = {
13
13
  ...filesystem_document,
14
14
  content: filesystem_document.content?.map(({ extension }) => ({ extension })),
15
- jurisprudencia_document: {
16
- uuid: filesystem_document.jurisprudencia_document.UUID
17
- }
18
15
  };
19
16
 
20
17
  const content: ContentType[] = filesystem_document.content
@@ -133,8 +130,9 @@ export async function createJurisprudenciaDocument(retrievable_Metadata: Retriev
133
130
  Data: obj.Data,
134
131
  "Meio Processual": obj["Meio Processual"],
135
132
  "Texto": obj.Texto,
133
+ "Texto Não Anonimizado": obj.Texto,
136
134
  "Sumário": obj.Sumário,
137
- STATE: obj.STATE
135
+ "Sumário Não Anonimizado": obj.Sumário,
138
136
  })
139
137
 
140
138
  obj["UUID"] = calculateUUID(obj["HASH"]);
@@ -1,6 +1,6 @@
1
1
  import path from "path";
2
2
  import fs from "fs";
3
- import { DGSI_LOGS_PATH, DGSI_UPDATE_DIR, FilesystemDocument, FilesystemUpdate, SHAREPOINT_UPDATE_DIR, SOURCE_TO_PATH, SupportedUpdateSources } from "./types.js";
3
+ import { FilesystemDocument, FilesystemUpdate, SHAREPOINT_UPDATE_DIR, SOURCE_TO_PATH, SupportedUpdateSources } from "./types.js";
4
4
 
5
5
  export function logDocumentProcessingError(update: FilesystemUpdate, err: string) {
6
6
  update.file_errors.push(err);
package/src/types.ts CHANGED
@@ -6,14 +6,14 @@ import dotenv from 'dotenv';
6
6
 
7
7
  dotenv.config();
8
8
  export const ROOT_PATH = process.env['LOCAL_ROOT'] || 'results';
9
- export const FILESYSTEM_PATH = `/FileSystem`
10
- export const SHAREPOINT_COPY_PATH = `/Sharepoint`
11
- export const DETAILS_NAME = "Detalhes"
12
- export const ORIGINAL_NAME = "Original"
13
- export const LOGS_PATH = "/Updates"
9
+ export const FILESYSTEM_PATH = `/FileSystem`;
10
+ export const SHAREPOINT_COPY_PATH = `/Sharepoint`;
11
+ export const DETAILS_NAME = "Detalhes";
12
+ export const ORIGINAL_NAME = "Original";
13
+ export const LOGS_PATH = "/Updates";
14
14
 
15
- export const SHAREPOINT_LOGS_PATH = `${LOGS_PATH}/Sharepoint`
16
- export const DGSI_LOGS_PATH = `${LOGS_PATH}/DGSI`
15
+ export const SHAREPOINT_LOGS_PATH = `${LOGS_PATH}/Sharepoint`;
16
+ export const DGSI_LOGS_PATH = `${LOGS_PATH}/DGSI`;
17
17
 
18
18
  export const SHAREPOINT_UPDATE_DIR = `${ROOT_PATH}${SHAREPOINT_LOGS_PATH}`;
19
19
  export const DGSI_UPDATE_DIR = `${ROOT_PATH}${DGSI_LOGS_PATH}`;
@@ -41,7 +41,7 @@ export type Sharepoint_Metadata = {
41
41
  sharepoint_url: string,
42
42
  extensions: Supported_Content_Extensions[],
43
43
  xor_hash?: string,
44
- }
44
+ };
45
45
 
46
46
  export type Retrievable_Metadata = { process_number: string, judge: string, process_mean: string[], decision: string, descriptors?: string[] };
47
47
  export type Date_Area_Section = { file_date: Date, area: string, section: string };
@@ -53,15 +53,16 @@ export type ContentType = {
53
53
  extension: Supported_Content_Extensions;
54
54
  data: Buffer;
55
55
  };
56
+
56
57
  export type FilesystemDocument = {
57
58
  creation_date: Date,
58
59
  last_update_date: Date,
59
- jurisprudencia_document: PartialJurisprudenciaDocument,
60
+ jurisprudencia_document: string,
60
61
  file_path: string,
61
62
  sharepoint_metadata?: Sharepoint_Metadata
62
63
  content?: ContentType[],
63
- }
64
+ };
64
65
 
65
66
  export function isSupportedExtension(ext: string): ext is Supported_Content_Extensions {
66
67
  return (SUPPORTED_EXTENSIONS as readonly string[]).includes(ext);
67
- }
68
+ };