fpavon-ee-shared 1.0.0 → 1.0.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.
- package/dist/dependency-injection/dependency-injection.d.ts +3 -0
- package/dist/digitalSignature/application/digitalSignature.useCase.d.ts +4 -0
- package/dist/digitalSignature/domain/PDFArrayCustom.d.ts +17 -0
- package/dist/digitalSignature/domain/SignPDF.d.ts +19 -0
- package/dist/digitalSignature/infrastructure/routes/digitalSignature.routes.d.ts +0 -0
- package/dist/documentos/application/documentos.useCase.d.ts +11 -0
- package/dist/documentos/domain/documento.class.d.ts +40 -0
- package/dist/documentos/domain/documento.interface.d.ts +8 -0
- package/dist/documentos/domain/documento.repository.d.ts +11 -0
- package/dist/documentos/domain/documentoFTP.d.ts +9 -0
- package/dist/documentos/domain/value-object/uuid.d.ts +7 -0
- package/dist/documentos/infrastructure/repository/documentos.ftp.repository.d.ts +14 -0
- package/dist/estados/application/flujos.useCase.d.ts +6 -0
- package/dist/estados/domain/estado.class.d.ts +61 -0
- package/dist/estados/domain/flujos.repository.d.ts +7 -0
- package/dist/estados/infrastructure/controller/flujos.controller.d.ts +6 -0
- package/dist/estados/infrastructure/repositories/flujos.sql.repository.d.ts +9 -0
- package/dist/estados/infrastructure/routes/flujo.route.d.ts +2 -0
- package/dist/expediente-electronico/application/expediente-electronico.useCase.d.ts +44 -0
- package/dist/expediente-electronico/domain/expediente-electronico.class.d.ts +61 -0
- package/dist/expediente-electronico/domain/expediente-electronico.interface.d.ts +16 -0
- package/dist/expediente-electronico/domain/expediente-electronico.repository.d.ts +51 -0
- package/dist/expediente-electronico/domain/value-object/limited-string.class.d.ts +6 -0
- package/dist/expediente-electronico/domain/value-object/notas.class.d.ts +19 -0
- package/dist/expediente-electronico/infrastructure/controller/expediente-electronico.controller.d.ts +24 -0
- package/dist/expediente-electronico/infrastructure/repositories/expediente-electronico.sql.repository.d.ts +60 -0
- package/dist/expediente-electronico/infrastructure/routes/expediente-electronico.route.d.ts +2 -0
- package/dist/infrastructure/bd/connection.sql.d.ts +4 -0
- package/dist/infrastructure/bd/pagination.sql.d.ts +4 -0
- package/dist/infrastructure/docs/swagger.d.ts +2 -0
- package/dist/infrastructure/fileServer/fileServer.basic-ftp.d.ts +17 -0
- package/dist/infrastructure/fileServer/fileServer.connection.d.ts +8 -0
- package/dist/infrastructure/middlewares/middleware.apikey.d.ts +1 -0
- package/dist/infrastructure/middlewares/middleware.auth.d.ts +18 -0
- package/dist/infrastructure/middlewares/middleware.deslogueo.d.ts +0 -0
- package/dist/infrastructure/middlewares/middleware.validarCampos.d.ts +1 -0
- package/dist/infrastructure/middlewares/middleware.validarRol.d.ts +1 -0
- package/dist/infrastructure/middlewares/validarNivel.d.ts +2 -0
- package/dist/infrastructure/server/httpsServer.class.d.ts +16 -0
- package/dist/infrastructure/server/server.class.d.ts +14 -0
- package/dist/infrastructure/socket/socketIO.d.ts +6 -0
- package/dist/infrastructure/stream-handler/stream-handler.d.ts +10 -0
- package/dist/notificaciones/domain/datosNotificacion.class.d.ts +7 -0
- package/dist/notificaciones/domain/datosNotificacion.interface.d.ts +5 -0
- package/dist/notificaciones/domain/notificacion.class.d.ts +12 -0
- package/dist/notificaciones/domain/notificacion.interface.d.ts +13 -0
- package/dist/notificaciones/domain/notificacion.repository.d.ts +7 -0
- package/dist/notificaciones/infrastructure/notificacion.controller.d.ts +4 -0
- package/dist/usuarios/application/usuarios.useCase.d.ts +6 -0
- package/dist/usuarios/domain/usuario.class.d.ts +20 -0
- package/dist/usuarios/domain/usuario.interface.d.ts +18 -0
- package/dist/usuarios/domain/usuarios.repository.d.ts +3 -0
- package/dist/usuarios/infrastructure/controller/usuarios.controller.d.ts +6 -0
- package/dist/usuarios/infrastructure/repository/usuarios.sql.repository.d.ts +4 -0
- package/dist/usuarios/infrastructure/routes/usuarios.routes.d.ts +1 -0
- package/package.json +2 -1
- package/tsconfig.json +4 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare function obtenerFirmasDocumento(uuid: string): Promise<any[]>;
|
|
3
|
+
export declare function firmarDocumento(documento: Buffer, firma: any, usuario: any, clave: any): Promise<Buffer>;
|
|
4
|
+
export declare function firmarDocumento2(token: string, uuid: any, firma: any, clave: any, x1: any, y1: any, page: any): Promise<string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PDFArray } from "pdf-lib";
|
|
2
|
+
/**
|
|
3
|
+
* Extends PDFArray class in order to make ByteRange look like this:
|
|
4
|
+
* /ByteRange [0 /********** /********** /**********]
|
|
5
|
+
* Not this:
|
|
6
|
+
* /ByteRange [ 0 /********** /********** /********** ]
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/Hopding/pdf-lib/issues/112#issuecomment-569085380
|
|
9
|
+
* @author https://github.com/Hopding
|
|
10
|
+
*/
|
|
11
|
+
export default class PDFArrayCustom extends PDFArray {
|
|
12
|
+
static withContext(context: any): any;
|
|
13
|
+
clone(context: any): any;
|
|
14
|
+
toString(): string;
|
|
15
|
+
sizeInBytes(): number;
|
|
16
|
+
copyBytesInto(buffer: any, offset: any): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export default class SignPDF {
|
|
3
|
+
pdfDoc: any;
|
|
4
|
+
certificate: any;
|
|
5
|
+
constructor(pdfFile: any, certFile: any);
|
|
6
|
+
/**
|
|
7
|
+
* @return Promise<Buffer>
|
|
8
|
+
*/
|
|
9
|
+
signPDF(clave: any): Promise<Buffer>;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://github.com/Hopding/pdf-lib/issues/112#issuecomment-569085380
|
|
12
|
+
* @returns {Promise<Buffer>}
|
|
13
|
+
*/
|
|
14
|
+
_addPlaceholder(): Promise<Buffer>;
|
|
15
|
+
/**
|
|
16
|
+
* @param {Uint8Array} unit8
|
|
17
|
+
*/
|
|
18
|
+
static unit8ToBuffer(unit8: any): Buffer;
|
|
19
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDocumentosRepository } from "../domain/documento.repository";
|
|
2
|
+
import { DocumentoFTP } from "../domain/documentoFTP";
|
|
3
|
+
export declare class DocumentosUseCase {
|
|
4
|
+
private readonly documentosRepository;
|
|
5
|
+
constructor(documentosRepository: IDocumentosRepository);
|
|
6
|
+
crearDocumento: (archivo: any) => Promise<import("../domain/documentoFTP").IDocumentoFTP>;
|
|
7
|
+
private bufferToStream;
|
|
8
|
+
crearDocumentoByBuffer: (file: any) => Promise<import("../domain/documentoFTP").IDocumentoFTP>;
|
|
9
|
+
getDocumentoAdjunto: (uuid: string) => Promise<DocumentoFTP>;
|
|
10
|
+
deleteDocumento: (uuid: any) => Promise<Boolean>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IDocumento } from "./documento.interface";
|
|
2
|
+
export declare class ImplementacionWorkflow {
|
|
3
|
+
/**
|
|
4
|
+
* @param workflowId id del workflow que se esta implentando
|
|
5
|
+
*/
|
|
6
|
+
workflowId: number;
|
|
7
|
+
/**
|
|
8
|
+
* @param firmas arreglo de usuarios firmantes del workflow.
|
|
9
|
+
*/
|
|
10
|
+
firmas: Firma[];
|
|
11
|
+
/**
|
|
12
|
+
* @param unidad la unidad actual en la que se encuentra el wf.
|
|
13
|
+
*/
|
|
14
|
+
unidad: string;
|
|
15
|
+
informacionAdicional: string;
|
|
16
|
+
estado: string;
|
|
17
|
+
motivoRechazoFinalizacion: string;
|
|
18
|
+
permitirCompartirExpediente: boolean;
|
|
19
|
+
constructor(params: any);
|
|
20
|
+
}
|
|
21
|
+
export declare class Firma {
|
|
22
|
+
usuario: any;
|
|
23
|
+
fecha: Date;
|
|
24
|
+
constructor(usuario: any);
|
|
25
|
+
}
|
|
26
|
+
export declare class Documento<TWorkflowState = ImplementacionWorkflow> implements IDocumento {
|
|
27
|
+
uuid: string;
|
|
28
|
+
extras: any;
|
|
29
|
+
fecha?: Date;
|
|
30
|
+
firmado: boolean;
|
|
31
|
+
lastUpdate?: Date;
|
|
32
|
+
descripcion: string;
|
|
33
|
+
nombre: string;
|
|
34
|
+
size: string;
|
|
35
|
+
estadoWorkflow?: TWorkflowState[];
|
|
36
|
+
constructor(uuid: string, nombre: string, descripcion: string, size: string, opciones?: {
|
|
37
|
+
lastUpdate?: Date;
|
|
38
|
+
extras?: any;
|
|
39
|
+
}, firmado?: boolean, estadoWorkflow?: TWorkflowState[], fecha?: any);
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDocumentoFTP } from "./documentoFTP";
|
|
2
|
+
export interface IDocumentosRepository {
|
|
3
|
+
/** INSERT */
|
|
4
|
+
createDocumento(documento: IDocumentoFTP): Promise<IDocumentoFTP>;
|
|
5
|
+
createDocumentoBuffer(documento: IDocumentoFTP): Promise<IDocumentoFTP>;
|
|
6
|
+
createDocumentoFromBuffer(documento: IDocumentoFTP): Promise<IDocumentoFTP>;
|
|
7
|
+
getDocumentoById(id: any): Promise<IDocumentoFTP>;
|
|
8
|
+
deleteDocumento(id: any): Promise<Boolean>;
|
|
9
|
+
modifyDocumento(documentoModificado: IDocumentoFTP): Promise<IDocumentoFTP>;
|
|
10
|
+
ver(params: any): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FtpConnection } from "../../../infrastructure/fileServer/fileServer.basic-ftp";
|
|
2
|
+
import { IDocumentosRepository } from "../../domain/documento.repository";
|
|
3
|
+
import { DocumentoFTP, IDocumentoFTP } from "../../domain/documentoFTP";
|
|
4
|
+
export declare class DocumentosFTPRepository implements IDocumentosRepository {
|
|
5
|
+
private fptClient;
|
|
6
|
+
constructor(fptClient: FtpConnection);
|
|
7
|
+
createDocumento(documento: IDocumentoFTP): Promise<DocumentoFTP>;
|
|
8
|
+
createDocumentoFromBuffer(documento: DocumentoFTP): Promise<DocumentoFTP>;
|
|
9
|
+
createDocumentoBuffer(documento: IDocumentoFTP): Promise<IDocumentoFTP>;
|
|
10
|
+
getDocumentoById(uuid: string): Promise<DocumentoFTP>;
|
|
11
|
+
deleteDocumento(uuid: any): Promise<Boolean>;
|
|
12
|
+
modifyDocumento(documentoModificado: IDocumentoFTP): Promise<IDocumentoFTP>;
|
|
13
|
+
ver(params: any): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IFlujosRepository } from "../domain/flujos.repository";
|
|
2
|
+
export declare class FlujosUseCase {
|
|
3
|
+
private readonly flujosRepository;
|
|
4
|
+
constructor(flujosRepository: IFlujosRepository);
|
|
5
|
+
getFlujoByModulo: (modulo: string) => Promise<import("../domain/estado.class").Flujo>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface EstadoFlujo {
|
|
2
|
+
/**
|
|
3
|
+
* @argument grupoRequerido Indica el grupo que debe tener un usuario para operar en este estado.
|
|
4
|
+
*/
|
|
5
|
+
grupoRequerido: string;
|
|
6
|
+
/**
|
|
7
|
+
* @argument requiereSupervision Indica si el estado requiere una supervision. Para supervisar se requiere el rol supervisar.
|
|
8
|
+
*/
|
|
9
|
+
requiereSupervision: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @argument requiereAprobacion Indica si el estado requiere una aprobacion de un usuario administrador.
|
|
12
|
+
*/
|
|
13
|
+
requiereAprobacion: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @argument requiereFirma Indica si el estado requiere una firma electronica. Para firmar se necesita el rol firmar.
|
|
16
|
+
*/
|
|
17
|
+
requiereFirma: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @argument cantidadDeFirmasRequeridas Indica la cantidad de firmas requeridas para realizar la aprobacion, en caso de requiereFirma=true.
|
|
20
|
+
* Si se requiere firma, al alcanzar la cantidad de firmas requeridas, se procede a la autorizacion del estado.
|
|
21
|
+
*/
|
|
22
|
+
cantidadDeFirmasRequeridas: number;
|
|
23
|
+
derivacion: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* @argument puedeObservarse Indica si el estado puede observarse. Al observar una solicitud se vuelve al estado anterior con el flag observado en true.
|
|
26
|
+
* Para observar se requiere el rol observar
|
|
27
|
+
*/
|
|
28
|
+
puedeObservarse: boolean | null;
|
|
29
|
+
/**
|
|
30
|
+
* @argument estadoSiguiente Indica el estado siguiente al que debe avanzar en caso de aprobarse el estado actual.
|
|
31
|
+
*/
|
|
32
|
+
estadoSiguiente: string;
|
|
33
|
+
}
|
|
34
|
+
export interface Flujo {
|
|
35
|
+
[key: string]: EstadoFlujo;
|
|
36
|
+
}
|
|
37
|
+
export declare class Estado {
|
|
38
|
+
nombre: string;
|
|
39
|
+
modulo: string;
|
|
40
|
+
exito: boolean;
|
|
41
|
+
firmado: boolean;
|
|
42
|
+
supervisado: boolean;
|
|
43
|
+
observado: boolean;
|
|
44
|
+
derivado: boolean;
|
|
45
|
+
devuelto: boolean;
|
|
46
|
+
cantidadDeFirmas: number;
|
|
47
|
+
firmantes: string[];
|
|
48
|
+
leido: boolean;
|
|
49
|
+
seModifico: boolean;
|
|
50
|
+
esVisiblePor: any[];
|
|
51
|
+
constructor(estadoParams: any);
|
|
52
|
+
static estadoPorDefault(): Estado;
|
|
53
|
+
autorizar(usuario: any, flujo: Flujo): Estado;
|
|
54
|
+
rechazar(usuario: any, flujo: Flujo): Estado;
|
|
55
|
+
cancelar(usuario: any, flujo: Flujo): Estado;
|
|
56
|
+
observar(usuario: any, flujo: Flujo): this;
|
|
57
|
+
supervisar(usuario: any, flujo: Flujo): this;
|
|
58
|
+
devolver(usuario: any, flujo: Flujo): this;
|
|
59
|
+
firmar(usuario: any, flujo: Flujo): Estado;
|
|
60
|
+
setFlagExito(exito: boolean): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Flujo } from "../../domain/estado.class";
|
|
2
|
+
import { IFlujosRepository } from "../../domain/flujos.repository";
|
|
3
|
+
export declare class FlujosRepository implements IFlujosRepository {
|
|
4
|
+
insert(flujo: Flujo): Promise<Flujo>;
|
|
5
|
+
selectByModulo(modulo: string): Promise<Flujo>;
|
|
6
|
+
update(flujo: Flujo): Promise<Flujo>;
|
|
7
|
+
delete(modulo: string): Promise<boolean>;
|
|
8
|
+
delete2(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ExpedienteElectronico } from '../domain/expediente-electronico.class';
|
|
3
|
+
import { IExpedienteElectronicoRepository } from '../domain/expediente-electronico.repository';
|
|
4
|
+
export declare class ExpedienteElectronicoUseCase {
|
|
5
|
+
private readonly expedienteRepo;
|
|
6
|
+
constructor(expedienteRepo: IExpedienteElectronicoRepository);
|
|
7
|
+
getExpedienteByIdUseCase: (id: string) => Promise<ExpedienteElectronico>;
|
|
8
|
+
getExpedienteByIdCodigoInterno: (codigoInterno: string) => Promise<ExpedienteElectronico>;
|
|
9
|
+
getExpUseCase: (usuario: any, page: number, limit: number, estado?: string[], filtro?: any) => Promise<{
|
|
10
|
+
totalRecords: number;
|
|
11
|
+
expedientes: import("../domain/expediente-electronico.interface").IExpedienteElectronico[];
|
|
12
|
+
}>;
|
|
13
|
+
getExpSinPaginacionUseCase: (usuario: any, estado?: string[], filtros?: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
totalRecords: number;
|
|
17
|
+
expedientes: import("../domain/expediente-electronico.interface").IExpedienteElectronico[];
|
|
18
|
+
}>;
|
|
19
|
+
getExpPendientesUseCase: (usuario: any, page: number, limit: number) => Promise<{
|
|
20
|
+
totalRecords: number;
|
|
21
|
+
expedientes: import("../domain/expediente-electronico.interface").IExpedienteElectronico[];
|
|
22
|
+
}>;
|
|
23
|
+
getExpPendientesSinPaginadoUseCase: (usuario: any) => Promise<{
|
|
24
|
+
totalRecords: number;
|
|
25
|
+
expedientes: import("../domain/expediente-electronico.interface").IExpedienteElectronico[];
|
|
26
|
+
}>;
|
|
27
|
+
getExpRechazadosUseCase: (usuario: any, page: number, limit: number) => Promise<{
|
|
28
|
+
totalRecords: number;
|
|
29
|
+
expedientes: import("../domain/expediente-electronico.interface").IExpedienteElectronico[];
|
|
30
|
+
}>;
|
|
31
|
+
getExpAprobadosUseCase: (usuario: any, page: number, limit: number) => Promise<{
|
|
32
|
+
totalRecords: number;
|
|
33
|
+
expedientes: import("../domain/expediente-electronico.interface").IExpedienteElectronico[];
|
|
34
|
+
}>;
|
|
35
|
+
getExpTotalesUseCase: (usuario: any) => Promise<number>;
|
|
36
|
+
getExpCantidadPendientesUseCase: (usuario: any) => Promise<number>;
|
|
37
|
+
getExpCantidadAprobadosUseCase: (usuario: any) => Promise<number>;
|
|
38
|
+
getExpCantidadRechazadosUseCase: (usuario: any) => Promise<number>;
|
|
39
|
+
guardarNotaUseCase: (idExpediente: any, notaParams: any, usuario: any) => Promise<ExpedienteElectronico>;
|
|
40
|
+
leerNotaUseCase: (idExpediente: any, usuario: any) => Promise<ExpedienteElectronico>;
|
|
41
|
+
getAllUnidades: () => Promise<string[]>;
|
|
42
|
+
getUnidadesByUnidad: (unidad: string) => Promise<string[]>;
|
|
43
|
+
firmarDocumentoUseCase: (documento: any, usuario: any, firma: any, clave: any) => Promise<Buffer>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Documento } from "../../documentos/domain/documento.class";
|
|
2
|
+
import { Estado, Flujo } from "../../estados/domain/estado.class";
|
|
3
|
+
import { IExpedienteElectronico } from "./expediente-electronico.interface";
|
|
4
|
+
import { Nota } from "./value-object/notas.class";
|
|
5
|
+
export declare class ExpedienteElectronico implements IExpedienteElectronico {
|
|
6
|
+
id: number;
|
|
7
|
+
fechaAlta: Date;
|
|
8
|
+
fechaCierre: Date;
|
|
9
|
+
usuarioResponsable: any;
|
|
10
|
+
titulo: string;
|
|
11
|
+
descripcion: string;
|
|
12
|
+
tipo: string;
|
|
13
|
+
codigoInterno: string;
|
|
14
|
+
bitacora: any;
|
|
15
|
+
private documentos;
|
|
16
|
+
private estado;
|
|
17
|
+
notas: Nota[];
|
|
18
|
+
extras: any;
|
|
19
|
+
origen: string;
|
|
20
|
+
destino: string;
|
|
21
|
+
constructor(params: any);
|
|
22
|
+
private asignarBitacora;
|
|
23
|
+
static fromRecordset(recordset: any): ExpedienteElectronico;
|
|
24
|
+
/**
|
|
25
|
+
* Setea un estado al expediente. Si el estado es undefined, se setea un estado por default.
|
|
26
|
+
* @param estado El estado que se quiere setear al expediente
|
|
27
|
+
*/
|
|
28
|
+
setEstado(estado?: Estado): void;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @returns Devuelve el estado actual del expediente.
|
|
32
|
+
*/
|
|
33
|
+
getEstado(): Estado;
|
|
34
|
+
/**
|
|
35
|
+
* Setea un arreglo de documentos al expediente
|
|
36
|
+
* @param documentos El nuevo arreglo de documentos que se quiere setear al expediente
|
|
37
|
+
*/
|
|
38
|
+
setDocumentos(documentos: Documento[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* Agrega un nuevo documento al arreglo de documentos del expediente.
|
|
41
|
+
* @param documento El documento que se quiere agregar al arreglo de documentos del expediente.
|
|
42
|
+
*/
|
|
43
|
+
pushDocumento(documento: Documento): void;
|
|
44
|
+
/**
|
|
45
|
+
* Reemplaza el documento que esta en el indice indicado por el que se envia como parametro.
|
|
46
|
+
* @param index: Indice del docuemento a reemplazar.
|
|
47
|
+
* @param documento El documento que reemplaza al anterior.
|
|
48
|
+
*/
|
|
49
|
+
modificarDocumento(index: number, documento: Documento): void;
|
|
50
|
+
getDocumentos(): Documento[];
|
|
51
|
+
avanzarEstado(usuario: any, flujo: Flujo): void;
|
|
52
|
+
updateFlagExito(exito: boolean): void;
|
|
53
|
+
supervisar(usuario: any, flujo: Flujo): void;
|
|
54
|
+
observar(usuario: any, flujo: Flujo): void;
|
|
55
|
+
rechazar(usuario: any, flujo: Flujo): void;
|
|
56
|
+
cancelar(usuario: any, flujo: Flujo): void;
|
|
57
|
+
devolver(usuario: any, flujo: Flujo): void;
|
|
58
|
+
firmar(usuario: any, flujo: Flujo): void;
|
|
59
|
+
getAtributos(): any;
|
|
60
|
+
static transferirExpediente(expediente: ExpedienteElectronico, oficinaResponsable: any): Estado;
|
|
61
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Nota } from "./value-object/notas.class";
|
|
2
|
+
export interface IExpedienteElectronico {
|
|
3
|
+
id: number;
|
|
4
|
+
fechaAlta: Date;
|
|
5
|
+
fechaCierre: Date;
|
|
6
|
+
usuarioResponsable: any;
|
|
7
|
+
titulo: string;
|
|
8
|
+
descripcion: string;
|
|
9
|
+
tipo: string;
|
|
10
|
+
codigoInterno: string;
|
|
11
|
+
bitacora: any;
|
|
12
|
+
notas: Nota[];
|
|
13
|
+
extras: any;
|
|
14
|
+
origen: string;
|
|
15
|
+
destino: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ExpedienteElectronico } from "./expediente-electronico.class";
|
|
2
|
+
import { IExpedienteElectronico } from "./expediente-electronico.interface";
|
|
3
|
+
export interface IExpedienteElectronicoRepository {
|
|
4
|
+
getExpedienteById(id: string): Promise<ExpedienteElectronico>;
|
|
5
|
+
getExpedienteByCodigoInterno(codigoInterno: string): Promise<ExpedienteElectronico>;
|
|
6
|
+
getExpRepo(usuario: any, pagination?: {
|
|
7
|
+
offset: number;
|
|
8
|
+
limitClause: string;
|
|
9
|
+
}, estado?: string[], filtro?: string): Promise<{
|
|
10
|
+
totalRecords: number;
|
|
11
|
+
expedientes: IExpedienteElectronico[];
|
|
12
|
+
}>;
|
|
13
|
+
getExpSinPaginacionRepo(usuario: any, estado?: string[], filtros?: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
totalRecords: number;
|
|
17
|
+
expedientes: IExpedienteElectronico[];
|
|
18
|
+
}>;
|
|
19
|
+
getExpPendientesRepo(usuario: any, pagination?: {
|
|
20
|
+
offset: number;
|
|
21
|
+
limitClause: string;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
totalRecords: number;
|
|
24
|
+
expedientes: IExpedienteElectronico[];
|
|
25
|
+
}>;
|
|
26
|
+
getExpPendientesSinPaginacionRepo(usuario: any): Promise<{
|
|
27
|
+
totalRecords: number;
|
|
28
|
+
expedientes: IExpedienteElectronico[];
|
|
29
|
+
}>;
|
|
30
|
+
getExpRechazadosRepo(usuario: any, pagination?: {
|
|
31
|
+
offset: number;
|
|
32
|
+
limitClause: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
totalRecords: number;
|
|
35
|
+
expedientes: IExpedienteElectronico[];
|
|
36
|
+
}>;
|
|
37
|
+
getExpAprobadosRepo(usuario: any, pagination?: {
|
|
38
|
+
offset: number;
|
|
39
|
+
limitClause: string;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
totalRecords: number;
|
|
42
|
+
expedientes: IExpedienteElectronico[];
|
|
43
|
+
}>;
|
|
44
|
+
getExpTotalesRepo(usuario: any): Promise<number>;
|
|
45
|
+
getExpCantidadPendientesRepo(usuario: any): Promise<number>;
|
|
46
|
+
getExpCantidadAprobadosRepo(usuario: any): Promise<number>;
|
|
47
|
+
getExpCantidadRechazadosRepo(usuario: any): Promise<number>;
|
|
48
|
+
updateEstado(id: any, expediente: ExpedienteElectronico): Promise<ExpedienteElectronico>;
|
|
49
|
+
updateExpediente(id: any, expediente: ExpedienteElectronico): Promise<ExpedienteElectronico>;
|
|
50
|
+
getUnidadesPref(): Promise<any>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class Nota {
|
|
2
|
+
title: string;
|
|
3
|
+
importance: string;
|
|
4
|
+
message: string;
|
|
5
|
+
unidades: string[];
|
|
6
|
+
fechaHora: string;
|
|
7
|
+
leida: boolean;
|
|
8
|
+
leidaPor: {
|
|
9
|
+
unidad: string;
|
|
10
|
+
afiliados: string[];
|
|
11
|
+
}[];
|
|
12
|
+
usuarioResponsable: {
|
|
13
|
+
nombreCompleto: string;
|
|
14
|
+
unidad: string;
|
|
15
|
+
uid: string;
|
|
16
|
+
};
|
|
17
|
+
constructor(params: any, usuario: any);
|
|
18
|
+
marcarNotaComoLeida(usuario: any): void;
|
|
19
|
+
}
|
package/dist/expediente-electronico/infrastructure/controller/expediente-electronico.controller.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExpedienteElectronicoUseCase } from "../../application/expediente-electronico.useCase";
|
|
2
|
+
import { NotificacionController } from "../../../notificaciones/infrastructure/notificacion.controller";
|
|
3
|
+
export declare class ExpedienteElectronicoController {
|
|
4
|
+
private readonly expedienteElectronicoUseCase;
|
|
5
|
+
private readonly notificacionCtrl;
|
|
6
|
+
constructor(expedienteElectronicoUseCase: ExpedienteElectronicoUseCase, notificacionCtrl: NotificacionController);
|
|
7
|
+
getExpedienteById: (req: Request, res: Response) => Promise<void>;
|
|
8
|
+
getExpCtrl: (req: Request, res: Response) => Promise<void>;
|
|
9
|
+
getExpSinPaginacionCtrl: (req: Request, res: Response) => Promise<void>;
|
|
10
|
+
private prepararFiltrosExp;
|
|
11
|
+
getExpPendientesCtrl: (req: Request, res: Response) => Promise<void>;
|
|
12
|
+
getExpPendientesSinPaginadoCtrl: (req: Request, res: Response) => Promise<void>;
|
|
13
|
+
getExpRechazadosCtrl: (req: Request, res: Response) => Promise<void>;
|
|
14
|
+
getExpAprobadosCtrl: (req: Request, res: Response) => Promise<void>;
|
|
15
|
+
getExpCantidadCtrl: (req: Request, res: Response) => Promise<void>;
|
|
16
|
+
getExpCantidadPendientesCtrl: (req: Request, res: Response) => Promise<void>;
|
|
17
|
+
getExpCantidadAprobadosCtrl: (req: Request, res: Response) => Promise<void>;
|
|
18
|
+
getExpACantidadRechazadosCtrl: (req: Request, res: Response) => Promise<void>;
|
|
19
|
+
guardarNotaCtrl: (req: Request, res: Response) => Promise<void>;
|
|
20
|
+
leerNotaCtrl: (req: Request, res: Response) => Promise<void>;
|
|
21
|
+
getAllUnidades: (req: Request, res: Response) => Promise<void>;
|
|
22
|
+
getUnidadesByUnidad: (req: Request, res: Response) => Promise<void>;
|
|
23
|
+
firmarDocumento: (req: Request, res: Response) => Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ExpedienteElectronico } from "../../domain/expediente-electronico.class";
|
|
2
|
+
import { IExpedienteElectronicoRepository } from "../../domain/expediente-electronico.repository";
|
|
3
|
+
import { IExpedienteElectronico } from "../../domain/expediente-electronico.interface";
|
|
4
|
+
export declare class ExpedienteElectronicoSqlRepository implements IExpedienteElectronicoRepository {
|
|
5
|
+
getExpedienteById(id: string): Promise<ExpedienteElectronico>;
|
|
6
|
+
getExpedienteByCodigoInterno(codigoInterno: string): Promise<ExpedienteElectronico>;
|
|
7
|
+
updateEstado(id: any, expediente: ExpedienteElectronico): Promise<ExpedienteElectronico>;
|
|
8
|
+
updateExpediente(id: any, expediente: ExpedienteElectronico): Promise<ExpedienteElectronico>;
|
|
9
|
+
getExpRepo(usuario: any, pagination?: {
|
|
10
|
+
offset: number;
|
|
11
|
+
limitClause: string;
|
|
12
|
+
}, estado?: string[], filtro?: any): Promise<{
|
|
13
|
+
totalRecords: number;
|
|
14
|
+
expedientes: IExpedienteElectronico[];
|
|
15
|
+
}>;
|
|
16
|
+
getExpSinPaginacionRepo(usuario: any, estado?: string[], filtros?: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
totalRecords: number;
|
|
20
|
+
expedientes: IExpedienteElectronico[];
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Devuelve los expedientes pendientes para el usuario.
|
|
24
|
+
* Un expediente pendiente es cuando un usuario tiene que hacer algo sobre el. Para determinar cuales son se ven los roles del usuario para cada grupo que tenga,
|
|
25
|
+
* luego se ve para cada flujo de expediente si al rol del usuario le corresponde accionar sobre el expediente.
|
|
26
|
+
* @param usuario Usuario que hace la peticion
|
|
27
|
+
* @param pagination
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
getExpPendientesRepo(usuario: any, pagination?: {
|
|
31
|
+
offset: number;
|
|
32
|
+
limitClause: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
totalRecords: number;
|
|
35
|
+
expedientes: IExpedienteElectronico[];
|
|
36
|
+
}>;
|
|
37
|
+
getExpPendientesSinPaginacionRepo(usuario: any): Promise<{
|
|
38
|
+
totalRecords: number;
|
|
39
|
+
expedientes: IExpedienteElectronico[];
|
|
40
|
+
}>;
|
|
41
|
+
getExpRechazadosRepo(usuario: any, pagination?: {
|
|
42
|
+
offset: number;
|
|
43
|
+
limitClause: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
totalRecords: number;
|
|
46
|
+
expedientes: IExpedienteElectronico[];
|
|
47
|
+
}>;
|
|
48
|
+
getExpAprobadosRepo(usuario: any, pagination?: {
|
|
49
|
+
offset: number;
|
|
50
|
+
limitClause: string;
|
|
51
|
+
}): Promise<{
|
|
52
|
+
totalRecords: number;
|
|
53
|
+
expedientes: IExpedienteElectronico[];
|
|
54
|
+
}>;
|
|
55
|
+
getExpTotalesRepo(usuario: any): Promise<number>;
|
|
56
|
+
getExpCantidadPendientesRepo(usuario: any): Promise<number>;
|
|
57
|
+
getExpCantidadAprobadosRepo(usuario: any): Promise<number>;
|
|
58
|
+
getExpCantidadRechazadosRepo(usuario: any): Promise<number>;
|
|
59
|
+
getUnidadesPref(): Promise<any>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import sql from 'mssql';
|
|
2
|
+
export declare function getConnection(query: string): Promise<any>;
|
|
3
|
+
export declare function executeQuery(query: string, params?: Record<string, any>): Promise<any>;
|
|
4
|
+
export declare function getConnectionForTransaction(): Promise<sql.ConnectionPool>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as ftp from 'basic-ftp';
|
|
4
|
+
import { PassThrough } from 'node:stream';
|
|
5
|
+
export declare class FtpConnection {
|
|
6
|
+
client: ftp.Client;
|
|
7
|
+
constructor();
|
|
8
|
+
connect(host: any, user: any, password: any, secure?: any): Promise<void>;
|
|
9
|
+
disconnect(): Promise<void>;
|
|
10
|
+
uploadBuffer(buffer: any, remotePath: any): Promise<ftp.FTPResponse>;
|
|
11
|
+
uploadFromStream(stream: NodeJS.ReadableStream, remotePath: string): Promise<void>;
|
|
12
|
+
downloadToBuffer(remotePath: any): Promise<any>;
|
|
13
|
+
downloadToStream(remotePath: any): Promise<PassThrough>;
|
|
14
|
+
deleteByUuid(uuid: string): Promise<boolean>;
|
|
15
|
+
list(path: any): Promise<ftp.FileInfo[]>;
|
|
16
|
+
private deleteAllFilesOnFtpServer;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class FtpConnection {
|
|
2
|
+
private client;
|
|
3
|
+
constructor();
|
|
4
|
+
connect(host: string, user: string, password: string): Promise<void>;
|
|
5
|
+
uploadFile(localPath: string, remotePath: string): Promise<void>;
|
|
6
|
+
downloadFile(remotePath: string, localPath: string): Promise<void>;
|
|
7
|
+
disconnect(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validarApiKeyInternet: (req: Request, res: Response, next: NextFunction) => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const validarToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2
|
+
export declare const extraerNivel: (data: any) => number;
|
|
3
|
+
export declare const cifrado: (usuario: any) => Promise<unknown>;
|
|
4
|
+
export declare const descifrarToken: (token: string) => any;
|
|
5
|
+
export declare const getChildrenLabelNumbers: (searchNumber: string) => Promise<string[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Obtiene la estructura jerárquica de una unidad
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Obtiene la estructura jerárquica de una unidad
|
|
11
|
+
*/
|
|
12
|
+
export declare function getGerencia(unidad: string): Promise<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Obtiene los IDs de todas las unidades subordinadas
|
|
15
|
+
*/
|
|
16
|
+
export declare function getChildrenUnitIds(searchUnitId: string): Promise<string[]>;
|
|
17
|
+
export declare const unidadesJoinFuncion: (unidad: any) => Promise<any[]>;
|
|
18
|
+
export declare const obtenerUnidadPadre: (unidadABuscar: any) => Promise<any>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validarCampos: (req: Request, res: Response, next: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validarRol(rolRequerido: string): (req: Request, res: Response, next: any) => any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import https from 'https';
|
|
4
|
+
export declare class HttpsServidor {
|
|
5
|
+
expressApp: any;
|
|
6
|
+
private port;
|
|
7
|
+
httpsServer: https.Server;
|
|
8
|
+
srvio: any;
|
|
9
|
+
constructor();
|
|
10
|
+
useLogger(): void;
|
|
11
|
+
useRoutes(router: any): void;
|
|
12
|
+
useCors(): void;
|
|
13
|
+
useJson(): void;
|
|
14
|
+
start(): https.Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
15
|
+
createHttpsServer(): https.Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import http from 'http';
|
|
3
|
+
export declare class Servidor {
|
|
4
|
+
expressApp: any;
|
|
5
|
+
private port;
|
|
6
|
+
httpServer: http.Server;
|
|
7
|
+
srvio: any;
|
|
8
|
+
constructor();
|
|
9
|
+
useLogger(): void;
|
|
10
|
+
useRoutes(router: any): void;
|
|
11
|
+
useCors(): void;
|
|
12
|
+
useJson(): void;
|
|
13
|
+
start(): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Request, Response } from "express";
|
|
3
|
+
import { Readable } from "stream";
|
|
4
|
+
import { Documento } from "../../documentos/domain/documento.class";
|
|
5
|
+
export declare class DocumentStreamHandler {
|
|
6
|
+
static sendDocumentStream(req: Request, res: Response, archivoStream: Readable, documento: Documento): Promise<void>;
|
|
7
|
+
private static getMimeTypeFromDocumento;
|
|
8
|
+
private static getFilenameFromDocumento;
|
|
9
|
+
static downloadDocumentStream(req: Request, res: Response, archivoStream: Readable, documento: Documento): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IDatosNotificacion } from "./datosNotificacion.interface";
|
|
2
|
+
export declare class DatosNotificacion implements IDatosNotificacion {
|
|
3
|
+
info?: string;
|
|
4
|
+
usuarioResponsable?: string;
|
|
5
|
+
icono?: string;
|
|
6
|
+
constructor(info?: string, usuario?: string, icono?: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IDatosNotificacion } from "./datosNotificacion.interface";
|
|
2
|
+
import { INotificacion } from "./notificacion.interface";
|
|
3
|
+
export declare class Notificacion implements INotificacion {
|
|
4
|
+
idNotificacion: string | undefined;
|
|
5
|
+
fecha: string;
|
|
6
|
+
unidadEmisora: string;
|
|
7
|
+
unidadReceptora: string;
|
|
8
|
+
descripcion: IDatosNotificacion;
|
|
9
|
+
lectores: string[];
|
|
10
|
+
idSolicitud?: string;
|
|
11
|
+
constructor(unidadEmisora: string, unidadReceptora: string, info: string, usuario: string, icono: string, idSolicitud?: string);
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IDatosNotificacion } from "./datosNotificacion.interface";
|
|
2
|
+
export interface INotificacion {
|
|
3
|
+
idNotificacion: string | undefined;
|
|
4
|
+
fecha: string;
|
|
5
|
+
unidadEmisora: string;
|
|
6
|
+
unidadReceptora: string;
|
|
7
|
+
descripcion: IDatosNotificacion;
|
|
8
|
+
/**
|
|
9
|
+
* @param lectores arreglo de usuarios que leyeron la notificacion.
|
|
10
|
+
*/
|
|
11
|
+
lectores: string[];
|
|
12
|
+
idSolicitud?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { INotificacion } from "./notificacion.interface";
|
|
2
|
+
export interface INotificacionRepository {
|
|
3
|
+
insert(notificacion: INotificacion): Promise<any>;
|
|
4
|
+
seleinsertctByUnidad(unidades: string[]): Promise<any>;
|
|
5
|
+
updateLectores(idNotificacion: string, notificacion: INotificacion): Promise<INotificacion>;
|
|
6
|
+
selectNotificacionById(idNotificacion: string): Promise<INotificacion>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IUsuario } from "./usuario.interface";
|
|
2
|
+
export declare class Usuario implements IUsuario {
|
|
3
|
+
uid: any;
|
|
4
|
+
nombre: string;
|
|
5
|
+
apellido: string;
|
|
6
|
+
nombreCompleto: string;
|
|
7
|
+
mail: string;
|
|
8
|
+
nacimiento: string;
|
|
9
|
+
unidad: string;
|
|
10
|
+
unidadSuperior: string;
|
|
11
|
+
gerencia: string;
|
|
12
|
+
cargo: string;
|
|
13
|
+
documento: string;
|
|
14
|
+
grupoAD: string[];
|
|
15
|
+
nombreGerencia: string;
|
|
16
|
+
roles: any[];
|
|
17
|
+
perfiles: any[];
|
|
18
|
+
grupos: any[];
|
|
19
|
+
constructor(params: any);
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface IUsuario {
|
|
2
|
+
uid: any;
|
|
3
|
+
nombre: string;
|
|
4
|
+
apellido: string;
|
|
5
|
+
nombreCompleto: string;
|
|
6
|
+
mail: string;
|
|
7
|
+
nacimiento: string;
|
|
8
|
+
unidad: string;
|
|
9
|
+
unidadSuperior: string;
|
|
10
|
+
gerencia: string;
|
|
11
|
+
cargo: string;
|
|
12
|
+
documento: string;
|
|
13
|
+
grupoAD: string[];
|
|
14
|
+
nombreGerencia: string;
|
|
15
|
+
roles: any[];
|
|
16
|
+
perfiles: any[];
|
|
17
|
+
grupos: any[];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usuariosRoutes(): any;
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
15
|
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
16
16
|
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
17
|
-
|
|
17
|
+
"declaration": true, /* Asegura que se generen los archivos .d.ts */
|
|
18
|
+
"outDir": "./dist",
|
|
19
|
+
"rootDir": "./",
|
|
18
20
|
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
19
21
|
// "composite": true, /* Enable project compilation */
|
|
20
22
|
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
@@ -69,5 +71,5 @@
|
|
|
69
71
|
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
70
72
|
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
71
73
|
},
|
|
72
|
-
"exclude": ["node_modules","test"]
|
|
74
|
+
"exclude": ["node_modules","test", "dist"]
|
|
73
75
|
}
|