@muni-sanfer/types-gestor-documental 0.0.1-beta.20 → 0.0.1-beta.22
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/base/entities.d.ts +2 -0
- package/dist/contracts/index.d.ts +7 -1
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/partsOffice.contract.d.ts +12 -1
- package/dist/contracts/partsOffice.contract.js +1 -0
- package/dist/contracts/signatureCheck.contract.d.ts +14 -0
- package/dist/contracts/signatureCheck.contract.js +7 -0
- package/dist/entities/caseFile/caseFile.entity.d.ts +3 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/partsOffice/partsOffice.entity.d.ts +35 -0
- package/dist/entities/signatureCheck/index.d.ts +1 -0
- package/dist/entities/signatureCheck/index.js +17 -0
- package/dist/entities/signatureCheck/signatureCheck.entity.d.ts +49 -0
- package/dist/entities/signatureCheck/signatureCheck.entity.js +2 -0
- package/package.json +1 -1
- package/src/base/entities.ts +2 -0
- package/src/contracts/index.ts +5 -1
- package/src/contracts/partsOffice.contract.ts +11 -0
- package/src/contracts/signatureCheck.contract.ts +11 -0
- package/src/entities/caseFile/caseFile.entity.ts +3 -0
- package/src/entities/index.ts +1 -0
- package/src/entities/partsOffice/partsOffice.entity.ts +31 -0
- package/src/entities/signatureCheck/index.ts +1 -0
- package/src/entities/signatureCheck/signatureCheck.entity.ts +51 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -521,6 +521,7 @@ export interface CaseFileEntryEntity {
|
|
|
521
521
|
sha256?: string | null;
|
|
522
522
|
size?: number | null;
|
|
523
523
|
hasAdvancedSignature: boolean;
|
|
524
|
+
signatureCheck?: JsonValue | null;
|
|
524
525
|
incorporatedByEmployeeId: string;
|
|
525
526
|
incorporatedByFullName: string;
|
|
526
527
|
voidedAt?: string | null;
|
|
@@ -658,6 +659,7 @@ export interface DocDigitalInboundEntity {
|
|
|
658
659
|
fileId?: string | null;
|
|
659
660
|
fileName?: string | null;
|
|
660
661
|
attachments: JsonValue;
|
|
662
|
+
signatureCheck?: JsonValue | null;
|
|
661
663
|
registeredAt?: string | null;
|
|
662
664
|
registeredByEmployeeId?: string | null;
|
|
663
665
|
registeredByFullName?: string | null;
|
|
@@ -7,6 +7,7 @@ import { type TextSnippetContract } from './textSnippet.contract';
|
|
|
7
7
|
import { type HolidayContract } from './holiday.contract';
|
|
8
8
|
import { type IndicatorsContract } from './indicators.contract';
|
|
9
9
|
import { type AuditContract } from './audit.contract';
|
|
10
|
+
import { type SignatureCheckContract } from './signatureCheck.contract';
|
|
10
11
|
import { type ScanContract } from './scan.contract';
|
|
11
12
|
import { type PartsOfficeContract } from './partsOffice.contract';
|
|
12
13
|
import { type ProcedureContract } from './procedure.contract';
|
|
@@ -29,6 +30,7 @@ export * from './textSnippet.contract';
|
|
|
29
30
|
export * from './holiday.contract';
|
|
30
31
|
export * from './indicators.contract';
|
|
31
32
|
export * from './audit.contract';
|
|
33
|
+
export * from './signatureCheck.contract';
|
|
32
34
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
33
35
|
export declare const GestorDocumentalPatterns: {
|
|
34
36
|
readonly documentType: {
|
|
@@ -117,6 +119,7 @@ export declare const GestorDocumentalPatterns: {
|
|
|
117
119
|
readonly acknowledgeInbound: "gestorDocumental.partsOffice.acknowledgeInbound";
|
|
118
120
|
readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
|
|
119
121
|
readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
|
|
122
|
+
readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
|
|
120
123
|
};
|
|
121
124
|
readonly registerBook: {
|
|
122
125
|
readonly get: "gestorDocumental.registerBook.get";
|
|
@@ -184,6 +187,9 @@ export declare const GestorDocumentalPatterns: {
|
|
|
184
187
|
readonly getEvents: "gestorDocumental.audit.getEvents";
|
|
185
188
|
readonly export: "gestorDocumental.audit.export";
|
|
186
189
|
};
|
|
190
|
+
readonly signatureCheck: {
|
|
191
|
+
readonly check: "gestorDocumental.signatureCheck.check";
|
|
192
|
+
};
|
|
187
193
|
};
|
|
188
194
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
189
|
-
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract;
|
|
195
|
+
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract;
|
package/dist/contracts/index.js
CHANGED
|
@@ -24,6 +24,7 @@ const textSnippet_contract_1 = require("./textSnippet.contract");
|
|
|
24
24
|
const holiday_contract_1 = require("./holiday.contract");
|
|
25
25
|
const indicators_contract_1 = require("./indicators.contract");
|
|
26
26
|
const audit_contract_1 = require("./audit.contract");
|
|
27
|
+
const signatureCheck_contract_1 = require("./signatureCheck.contract");
|
|
27
28
|
const scan_contract_1 = require("./scan.contract");
|
|
28
29
|
const partsOffice_contract_1 = require("./partsOffice.contract");
|
|
29
30
|
const procedure_contract_1 = require("./procedure.contract");
|
|
@@ -46,6 +47,7 @@ __exportStar(require("./textSnippet.contract"), exports);
|
|
|
46
47
|
__exportStar(require("./holiday.contract"), exports);
|
|
47
48
|
__exportStar(require("./indicators.contract"), exports);
|
|
48
49
|
__exportStar(require("./audit.contract"), exports);
|
|
50
|
+
__exportStar(require("./signatureCheck.contract"), exports);
|
|
49
51
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
50
52
|
exports.GestorDocumentalPatterns = {
|
|
51
53
|
documentType: documentType_contract_1.DocumentTypePatterns,
|
|
@@ -63,4 +65,5 @@ exports.GestorDocumentalPatterns = {
|
|
|
63
65
|
holiday: holiday_contract_1.HolidayPatterns,
|
|
64
66
|
indicators: indicators_contract_1.IndicatorsPatterns,
|
|
65
67
|
audit: audit_contract_1.AuditPatterns,
|
|
68
|
+
signatureCheck: signatureCheck_contract_1.SignatureCheckPatterns,
|
|
66
69
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DocumentAccessLevel, type DocumentInstruction } from '../base/entities';
|
|
2
|
-
import { type DocDigitalDocumentTypeEntity, type DocDigitalEntityEntity, type PartsOfficeInboundEntity, type DocDigitalUserEntity, type PartsOfficeDispatchEntity, type PartsOfficeFileEntity, type PartsOfficeOkResponseEntity, type PartsOfficeRegisterResponseEntity, type PartsOfficeStatusEntity, type PartsOfficeSummaryEntity, type PartsOfficeSyncResponseEntity } from '../entities';
|
|
2
|
+
import { type DocDigitalDocumentTypeEntity, type DocDigitalEntityEntity, type PartsOfficeInboundEntity, type DocDigitalUserEntity, type EnablementPersonInput, type PartsOfficeEnablementEntity, type PartsOfficeDispatchEntity, type PartsOfficeFileEntity, type PartsOfficeOkResponseEntity, type PartsOfficeRegisterResponseEntity, type PartsOfficeStatusEntity, type PartsOfficeSummaryEntity, type PartsOfficeSyncResponseEntity } from '../entities';
|
|
3
3
|
import { type RpcPage } from './contract';
|
|
4
4
|
import { type DocumentActor, type DocumentExternalRecipientInput } from './document.contract';
|
|
5
5
|
/** Patrones NATS de `partsOffice` (Oficina de Partes y DocDigital): `<servicio>.<recurso>.<acción>`. */
|
|
@@ -21,6 +21,7 @@ export declare const PartsOfficePatterns: {
|
|
|
21
21
|
readonly acknowledgeInbound: "gestorDocumental.partsOffice.acknowledgeInbound";
|
|
22
22
|
readonly returnInbound: "gestorDocumental.partsOffice.returnInbound";
|
|
23
23
|
readonly getInboundFile: "gestorDocumental.partsOffice.getInboundFile";
|
|
24
|
+
readonly checkEnablement: "gestorDocumental.partsOffice.checkEnablement";
|
|
24
25
|
};
|
|
25
26
|
/** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
|
|
26
27
|
export type PartsOfficeRecipientInput = {
|
|
@@ -173,5 +174,15 @@ export interface PartsOfficeContract {
|
|
|
173
174
|
};
|
|
174
175
|
response: PartsOfficeFileEntity;
|
|
175
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Quiénes de `people` están habilitados como usuarios de DocDigital en la municipalidad o en sus entidades emisoras
|
|
179
|
+
* (por RUN). El directorio de cada entidad se guarda 10 minutos.
|
|
180
|
+
*/
|
|
181
|
+
[PartsOfficePatterns.checkEnablement]: {
|
|
182
|
+
payload: {
|
|
183
|
+
people: EnablementPersonInput[];
|
|
184
|
+
};
|
|
185
|
+
response: PartsOfficeEnablementEntity;
|
|
186
|
+
};
|
|
176
187
|
}
|
|
177
188
|
export {};
|
|
@@ -20,4 +20,5 @@ exports.PartsOfficePatterns = {
|
|
|
20
20
|
acknowledgeInbound: 'gestorDocumental.partsOffice.acknowledgeInbound',
|
|
21
21
|
returnInbound: 'gestorDocumental.partsOffice.returnInbound',
|
|
22
22
|
getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
|
|
23
|
+
checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
|
|
23
24
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type PdfSignatureReportEntity } from '../entities';
|
|
2
|
+
/** Patrones NATS de `signatureCheck`: revisión de las firmas electrónicas de un PDF. */
|
|
3
|
+
export declare const SignatureCheckPatterns: {
|
|
4
|
+
readonly check: "gestorDocumental.signatureCheck.check";
|
|
5
|
+
};
|
|
6
|
+
export interface SignatureCheckContract {
|
|
7
|
+
/** Revisa un PDF ya subido al gestor de archivos (la herramienta «Validar firmas» lo sube antes). */
|
|
8
|
+
[SignatureCheckPatterns.check]: {
|
|
9
|
+
payload: {
|
|
10
|
+
fileId: string;
|
|
11
|
+
};
|
|
12
|
+
response: PdfSignatureReportEntity;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignatureCheckPatterns = void 0;
|
|
4
|
+
/** Patrones NATS de `signatureCheck`: revisión de las firmas electrónicas de un PDF. */
|
|
5
|
+
exports.SignatureCheckPatterns = {
|
|
6
|
+
check: 'gestorDocumental.signatureCheck.check',
|
|
7
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CaseFileAccessEntity, CaseFileActorEntity, CaseFileEntity, CaseFileEntryEntity, CaseFileMetadataChangeEntity, CaseFileParticipantEntity, CaseFileTrackingEntity, DocumentEntity, ProcedureEntity } from '../../base/entities';
|
|
2
2
|
import { DocumentTypeSummaryEntity } from '../document';
|
|
3
|
+
import { type PdfSignatureReportEntity } from '../signatureCheck';
|
|
3
4
|
/** Expediente al que se hace referencia desde otro lado: cómo se cita y en qué estado está. */
|
|
4
5
|
export interface CaseFileLinkEntity {
|
|
5
6
|
id: CaseFileEntity['id'];
|
|
@@ -56,6 +57,8 @@ export interface CaseFileEntryResponseEntity {
|
|
|
56
57
|
sha256: CaseFileEntryEntity['sha256'];
|
|
57
58
|
size: CaseFileEntryEntity['size'];
|
|
58
59
|
hasAdvancedSignature: CaseFileEntryEntity['hasAdvancedSignature'];
|
|
60
|
+
/** Revisión de sus firmas al incorporarlo, en los archivos externos en PDF. */
|
|
61
|
+
signatureCheck: PdfSignatureReportEntity | null;
|
|
59
62
|
incorporatedByEmployeeId: CaseFileEntryEntity['incorporatedByEmployeeId'];
|
|
60
63
|
incorporatedByFullName: CaseFileEntryEntity['incorporatedByFullName'];
|
|
61
64
|
createdAt: CaseFileEntryEntity['createdAt'];
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PdfSignatureReportEntity } from '../signatureCheck';
|
|
1
2
|
import { type DocumentDispatchResponseEntity, type DocumentExternalRecipientResponseEntity, type DocumentLinkEntity } from '../document';
|
|
2
3
|
/** Institución del Estado en DocDigital. */
|
|
3
4
|
export interface DocDigitalEntityEntity {
|
|
@@ -54,6 +55,8 @@ export interface PartsOfficeInboundEntity {
|
|
|
54
55
|
senderPosition: string | null;
|
|
55
56
|
fileName: string | null;
|
|
56
57
|
hasFile: boolean;
|
|
58
|
+
/** Revisión de las firmas del documento principal al recibirlo. */
|
|
59
|
+
signatureCheck: PdfSignatureReportEntity | null;
|
|
57
60
|
attachments: {
|
|
58
61
|
name: string;
|
|
59
62
|
url: string | null;
|
|
@@ -100,3 +103,35 @@ export interface PartsOfficeFileEntity {
|
|
|
100
103
|
fileId: string;
|
|
101
104
|
fileName: string;
|
|
102
105
|
}
|
|
106
|
+
/** Por qué una persona tiene que estar habilitada en DocDigital. */
|
|
107
|
+
export type EnablementRole = 'PartsOffice' | 'Signer';
|
|
108
|
+
/** Persona que se revisa: la arma el gateway con organizacion-ms (permisos de Partes y firmantes por cargo). */
|
|
109
|
+
export interface EnablementPersonInput {
|
|
110
|
+
employeeId: string;
|
|
111
|
+
fullName: string;
|
|
112
|
+
/** RUN del funcionario; sin él no se puede buscar en DocDigital. */
|
|
113
|
+
rut: string | null;
|
|
114
|
+
position: string | null;
|
|
115
|
+
roles: EnablementRole[];
|
|
116
|
+
}
|
|
117
|
+
/** Resultado de una persona: en qué entidades de DocDigital está habilitada. */
|
|
118
|
+
export interface EnablementPersonEntity extends EnablementPersonInput {
|
|
119
|
+
status: 'Enabled' | 'NotEnabled' | 'NoRut';
|
|
120
|
+
enabledIn: {
|
|
121
|
+
entityId: number;
|
|
122
|
+
entityName: string;
|
|
123
|
+
docDigitalPosition: string | null;
|
|
124
|
+
}[];
|
|
125
|
+
}
|
|
126
|
+
export interface PartsOfficeEnablementEntity {
|
|
127
|
+
checkedAt: string;
|
|
128
|
+
/** DocDigital configurado en el gestor; sin él no se revisa nada. */
|
|
129
|
+
configured: boolean;
|
|
130
|
+
/** Entidades revisadas: la municipalidad y las entidades emisoras con DocDigital. */
|
|
131
|
+
entities: {
|
|
132
|
+
entityId: number;
|
|
133
|
+
entityName: string;
|
|
134
|
+
userCount: number;
|
|
135
|
+
}[];
|
|
136
|
+
people: EnablementPersonEntity[];
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './signatureCheck.entity';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./signatureCheck.entity"), exports);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resultado de una firma o del archivo completo: válida, inválida (algo no cuadra) o indeterminada (lo firmado está
|
|
3
|
+
* íntegro, pero falta confirmar algo: la cadena de confianza, la vigencia o cambios posteriores sin firmar).
|
|
4
|
+
*/
|
|
5
|
+
export type PdfSignatureStatus = 'Valid' | 'Invalid' | 'Indeterminate';
|
|
6
|
+
/** Una firma electrónica de un PDF, como se pudo comprobar. */
|
|
7
|
+
export interface PdfSignatureEntity {
|
|
8
|
+
/** Orden en el archivo: 1 es la primera. */
|
|
9
|
+
index: number;
|
|
10
|
+
/** Firma de una persona o sello de tiempo del documento. */
|
|
11
|
+
kind: 'Signature' | 'Timestamp';
|
|
12
|
+
signerName: string | null;
|
|
13
|
+
/** Identificador del titular en el certificado (en Chile, suele ser el RUN). */
|
|
14
|
+
signerSerialNumber: string | null;
|
|
15
|
+
organization: string | null;
|
|
16
|
+
issuerName: string | null;
|
|
17
|
+
certificateSerial: string | null;
|
|
18
|
+
certificateValidFrom: string | null;
|
|
19
|
+
certificateValidTo: string | null;
|
|
20
|
+
signingTime: string | null;
|
|
21
|
+
/** De dónde sale la hora de la firma: sello de tiempo (la más confiable), el certificado firmado o el PDF. */
|
|
22
|
+
signingTimeSource: 'Timestamp' | 'SignedAttribute' | 'PdfDate' | null;
|
|
23
|
+
reason: string | null;
|
|
24
|
+
location: string | null;
|
|
25
|
+
hasTimestamp: boolean;
|
|
26
|
+
/** Lo firmado no cambió y la firma corresponde al certificado. */
|
|
27
|
+
intact: boolean;
|
|
28
|
+
/** La firma abarca el archivo completo (las anteriores a la última, solo su versión). */
|
|
29
|
+
coversWholeDocument: boolean;
|
|
30
|
+
/** El certificado estaba vigente al firmar. `null` si no se sabe cuándo se firmó. */
|
|
31
|
+
certificateValidAtSigning: boolean | null;
|
|
32
|
+
/** Cadena hasta un certificado raíz de confianza. `null` si no hay raíces configuradas. */
|
|
33
|
+
trusted: boolean | null;
|
|
34
|
+
status: PdfSignatureStatus;
|
|
35
|
+
/** Lo que no cuadra o no se pudo confirmar, en palabras. */
|
|
36
|
+
problems: string[];
|
|
37
|
+
}
|
|
38
|
+
/** Revisión de las firmas de un PDF. */
|
|
39
|
+
export interface PdfSignatureReportEntity {
|
|
40
|
+
checkedAt: string;
|
|
41
|
+
status: 'NoSignatures' | PdfSignatureStatus;
|
|
42
|
+
signatures: PdfSignatureEntity[];
|
|
43
|
+
/** Hay contenido agregado después de la última firma, que no está firmado. */
|
|
44
|
+
modifiedAfterLastSignature: boolean;
|
|
45
|
+
/** Se configuraron certificados raíz para confirmar la cadena de confianza. */
|
|
46
|
+
trustConfigured: boolean;
|
|
47
|
+
/** Huella SHA-256 del archivo revisado. */
|
|
48
|
+
fileSha256: string;
|
|
49
|
+
}
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -653,6 +653,7 @@ export interface CaseFileEntryEntity {
|
|
|
653
653
|
sha256?: string | null;
|
|
654
654
|
size?: number | null;
|
|
655
655
|
hasAdvancedSignature: boolean;
|
|
656
|
+
signatureCheck?: JsonValue | null;
|
|
656
657
|
incorporatedByEmployeeId: string;
|
|
657
658
|
incorporatedByFullName: string;
|
|
658
659
|
voidedAt?: string | null;
|
|
@@ -799,6 +800,7 @@ export interface DocDigitalInboundEntity {
|
|
|
799
800
|
fileId?: string | null;
|
|
800
801
|
fileName?: string | null;
|
|
801
802
|
attachments: JsonValue;
|
|
803
|
+
signatureCheck?: JsonValue | null;
|
|
802
804
|
registeredAt?: string | null;
|
|
803
805
|
registeredByEmployeeId?: string | null;
|
|
804
806
|
registeredByFullName?: string | null;
|
package/src/contracts/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { TextSnippetPatterns, type TextSnippetContract } from './textSnippet.con
|
|
|
7
7
|
import { HolidayPatterns, type HolidayContract } from './holiday.contract';
|
|
8
8
|
import { IndicatorsPatterns, type IndicatorsContract } from './indicators.contract';
|
|
9
9
|
import { AuditPatterns, type AuditContract } from './audit.contract';
|
|
10
|
+
import { SignatureCheckPatterns, type SignatureCheckContract } from './signatureCheck.contract';
|
|
10
11
|
import { ScanPatterns, type ScanContract } from './scan.contract';
|
|
11
12
|
import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
|
|
12
13
|
import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
|
|
@@ -30,6 +31,7 @@ export * from './textSnippet.contract';
|
|
|
30
31
|
export * from './holiday.contract';
|
|
31
32
|
export * from './indicators.contract';
|
|
32
33
|
export * from './audit.contract';
|
|
34
|
+
export * from './signatureCheck.contract';
|
|
33
35
|
|
|
34
36
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
35
37
|
export const GestorDocumentalPatterns = {
|
|
@@ -48,6 +50,7 @@ export const GestorDocumentalPatterns = {
|
|
|
48
50
|
holiday: HolidayPatterns,
|
|
49
51
|
indicators: IndicatorsPatterns,
|
|
50
52
|
audit: AuditPatterns,
|
|
53
|
+
signatureCheck: SignatureCheckPatterns,
|
|
51
54
|
} as const;
|
|
52
55
|
|
|
53
56
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
@@ -65,4 +68,5 @@ export type GestorDocumentalContract = DocumentTypeContract &
|
|
|
65
68
|
TextSnippetContract &
|
|
66
69
|
HolidayContract &
|
|
67
70
|
IndicatorsContract &
|
|
68
|
-
AuditContract
|
|
71
|
+
AuditContract &
|
|
72
|
+
SignatureCheckContract;
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
type DocDigitalEntityEntity,
|
|
5
5
|
type PartsOfficeInboundEntity,
|
|
6
6
|
type DocDigitalUserEntity,
|
|
7
|
+
type EnablementPersonInput,
|
|
8
|
+
type PartsOfficeEnablementEntity,
|
|
7
9
|
type PartsOfficeDispatchEntity,
|
|
8
10
|
type PartsOfficeFileEntity,
|
|
9
11
|
type PartsOfficeOkResponseEntity,
|
|
@@ -34,6 +36,7 @@ export const PartsOfficePatterns = {
|
|
|
34
36
|
acknowledgeInbound: 'gestorDocumental.partsOffice.acknowledgeInbound',
|
|
35
37
|
returnInbound: 'gestorDocumental.partsOffice.returnInbound',
|
|
36
38
|
getInboundFile: 'gestorDocumental.partsOffice.getInboundFile',
|
|
39
|
+
checkEnablement: 'gestorDocumental.partsOffice.checkEnablement',
|
|
37
40
|
} as const;
|
|
38
41
|
|
|
39
42
|
/** Destinatario interno de un ingreso, ya resuelto por el gateway (las áreas con sus integrantes). */
|
|
@@ -120,4 +123,12 @@ export interface PartsOfficeContract {
|
|
|
120
123
|
payload: { id: string; attachment?: number };
|
|
121
124
|
response: PartsOfficeFileEntity;
|
|
122
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* Quiénes de `people` están habilitados como usuarios de DocDigital en la municipalidad o en sus entidades emisoras
|
|
128
|
+
* (por RUN). El directorio de cada entidad se guarda 10 minutos.
|
|
129
|
+
*/
|
|
130
|
+
[PartsOfficePatterns.checkEnablement]: {
|
|
131
|
+
payload: { people: EnablementPersonInput[] };
|
|
132
|
+
response: PartsOfficeEnablementEntity;
|
|
133
|
+
};
|
|
123
134
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PdfSignatureReportEntity } from '../entities';
|
|
2
|
+
|
|
3
|
+
/** Patrones NATS de `signatureCheck`: revisión de las firmas electrónicas de un PDF. */
|
|
4
|
+
export const SignatureCheckPatterns = {
|
|
5
|
+
check: 'gestorDocumental.signatureCheck.check',
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export interface SignatureCheckContract {
|
|
9
|
+
/** Revisa un PDF ya subido al gestor de archivos (la herramienta «Validar firmas» lo sube antes). */
|
|
10
|
+
[SignatureCheckPatterns.check]: { payload: { fileId: string }; response: PdfSignatureReportEntity };
|
|
11
|
+
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
ProcedureEntity,
|
|
11
11
|
} from '../../base/entities';
|
|
12
12
|
import { DocumentTypeSummaryEntity } from '../document';
|
|
13
|
+
import { type PdfSignatureReportEntity } from '../signatureCheck';
|
|
13
14
|
|
|
14
15
|
/** Expediente al que se hace referencia desde otro lado: cómo se cita y en qué estado está. */
|
|
15
16
|
export interface CaseFileLinkEntity {
|
|
@@ -70,6 +71,8 @@ export interface CaseFileEntryResponseEntity {
|
|
|
70
71
|
sha256: CaseFileEntryEntity['sha256'];
|
|
71
72
|
size: CaseFileEntryEntity['size'];
|
|
72
73
|
hasAdvancedSignature: CaseFileEntryEntity['hasAdvancedSignature'];
|
|
74
|
+
/** Revisión de sus firmas al incorporarlo, en los archivos externos en PDF. */
|
|
75
|
+
signatureCheck: PdfSignatureReportEntity | null;
|
|
73
76
|
incorporatedByEmployeeId: CaseFileEntryEntity['incorporatedByEmployeeId'];
|
|
74
77
|
incorporatedByFullName: CaseFileEntryEntity['incorporatedByFullName'];
|
|
75
78
|
createdAt: CaseFileEntryEntity['createdAt'];
|
package/src/entities/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PdfSignatureReportEntity } from '../signatureCheck';
|
|
1
2
|
import {
|
|
2
3
|
type DocumentDispatchResponseEntity,
|
|
3
4
|
type DocumentExternalRecipientResponseEntity,
|
|
@@ -63,6 +64,8 @@ export interface PartsOfficeInboundEntity {
|
|
|
63
64
|
senderPosition: string | null;
|
|
64
65
|
fileName: string | null;
|
|
65
66
|
hasFile: boolean;
|
|
67
|
+
/** Revisión de las firmas del documento principal al recibirlo. */
|
|
68
|
+
signatureCheck: PdfSignatureReportEntity | null;
|
|
66
69
|
attachments: { name: string; url: string | null; hasFile: boolean }[];
|
|
67
70
|
createdAt: string;
|
|
68
71
|
registeredAt: string | null;
|
|
@@ -105,3 +108,31 @@ export interface PartsOfficeFileEntity {
|
|
|
105
108
|
fileId: string;
|
|
106
109
|
fileName: string;
|
|
107
110
|
}
|
|
111
|
+
|
|
112
|
+
/** Por qué una persona tiene que estar habilitada en DocDigital. */
|
|
113
|
+
export type EnablementRole = 'PartsOffice' | 'Signer';
|
|
114
|
+
|
|
115
|
+
/** Persona que se revisa: la arma el gateway con organizacion-ms (permisos de Partes y firmantes por cargo). */
|
|
116
|
+
export interface EnablementPersonInput {
|
|
117
|
+
employeeId: string;
|
|
118
|
+
fullName: string;
|
|
119
|
+
/** RUN del funcionario; sin él no se puede buscar en DocDigital. */
|
|
120
|
+
rut: string | null;
|
|
121
|
+
position: string | null;
|
|
122
|
+
roles: EnablementRole[];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Resultado de una persona: en qué entidades de DocDigital está habilitada. */
|
|
126
|
+
export interface EnablementPersonEntity extends EnablementPersonInput {
|
|
127
|
+
status: 'Enabled' | 'NotEnabled' | 'NoRut';
|
|
128
|
+
enabledIn: { entityId: number; entityName: string; docDigitalPosition: string | null }[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface PartsOfficeEnablementEntity {
|
|
132
|
+
checkedAt: string;
|
|
133
|
+
/** DocDigital configurado en el gestor; sin él no se revisa nada. */
|
|
134
|
+
configured: boolean;
|
|
135
|
+
/** Entidades revisadas: la municipalidad y las entidades emisoras con DocDigital. */
|
|
136
|
+
entities: { entityId: number; entityName: string; userCount: number }[];
|
|
137
|
+
people: EnablementPersonEntity[];
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './signatureCheck.entity';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resultado de una firma o del archivo completo: válida, inválida (algo no cuadra) o indeterminada (lo firmado está
|
|
3
|
+
* íntegro, pero falta confirmar algo: la cadena de confianza, la vigencia o cambios posteriores sin firmar).
|
|
4
|
+
*/
|
|
5
|
+
export type PdfSignatureStatus = 'Valid' | 'Invalid' | 'Indeterminate';
|
|
6
|
+
|
|
7
|
+
/** Una firma electrónica de un PDF, como se pudo comprobar. */
|
|
8
|
+
export interface PdfSignatureEntity {
|
|
9
|
+
/** Orden en el archivo: 1 es la primera. */
|
|
10
|
+
index: number;
|
|
11
|
+
/** Firma de una persona o sello de tiempo del documento. */
|
|
12
|
+
kind: 'Signature' | 'Timestamp';
|
|
13
|
+
signerName: string | null;
|
|
14
|
+
/** Identificador del titular en el certificado (en Chile, suele ser el RUN). */
|
|
15
|
+
signerSerialNumber: string | null;
|
|
16
|
+
organization: string | null;
|
|
17
|
+
issuerName: string | null;
|
|
18
|
+
certificateSerial: string | null;
|
|
19
|
+
certificateValidFrom: string | null;
|
|
20
|
+
certificateValidTo: string | null;
|
|
21
|
+
signingTime: string | null;
|
|
22
|
+
/** De dónde sale la hora de la firma: sello de tiempo (la más confiable), el certificado firmado o el PDF. */
|
|
23
|
+
signingTimeSource: 'Timestamp' | 'SignedAttribute' | 'PdfDate' | null;
|
|
24
|
+
reason: string | null;
|
|
25
|
+
location: string | null;
|
|
26
|
+
hasTimestamp: boolean;
|
|
27
|
+
/** Lo firmado no cambió y la firma corresponde al certificado. */
|
|
28
|
+
intact: boolean;
|
|
29
|
+
/** La firma abarca el archivo completo (las anteriores a la última, solo su versión). */
|
|
30
|
+
coversWholeDocument: boolean;
|
|
31
|
+
/** El certificado estaba vigente al firmar. `null` si no se sabe cuándo se firmó. */
|
|
32
|
+
certificateValidAtSigning: boolean | null;
|
|
33
|
+
/** Cadena hasta un certificado raíz de confianza. `null` si no hay raíces configuradas. */
|
|
34
|
+
trusted: boolean | null;
|
|
35
|
+
status: PdfSignatureStatus;
|
|
36
|
+
/** Lo que no cuadra o no se pudo confirmar, en palabras. */
|
|
37
|
+
problems: string[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Revisión de las firmas de un PDF. */
|
|
41
|
+
export interface PdfSignatureReportEntity {
|
|
42
|
+
checkedAt: string;
|
|
43
|
+
status: 'NoSignatures' | PdfSignatureStatus;
|
|
44
|
+
signatures: PdfSignatureEntity[];
|
|
45
|
+
/** Hay contenido agregado después de la última firma, que no está firmado. */
|
|
46
|
+
modifiedAfterLastSignature: boolean;
|
|
47
|
+
/** Se configuraron certificados raíz para confirmar la cadena de confianza. */
|
|
48
|
+
trustConfigured: boolean;
|
|
49
|
+
/** Huella SHA-256 del archivo revisado. */
|
|
50
|
+
fileSha256: string;
|
|
51
|
+
}
|