@muni-sanfer/types-gestor-documental 0.0.1-beta.26 → 0.0.1-beta.28
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 +150 -2
- package/dist/base/entities.js +53 -1
- package/dist/contracts/dataProtection.contract.d.ts +168 -0
- package/dist/contracts/dataProtection.contract.js +17 -0
- package/dist/contracts/documentType.contract.d.ts +3 -0
- package/dist/contracts/index.d.ts +26 -1
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/transparency.contract.d.ts +96 -0
- package/dist/contracts/transparency.contract.js +12 -0
- package/dist/entities/dataProtection/dataProtection.entity.d.ts +129 -0
- package/dist/entities/dataProtection/dataProtection.entity.js +2 -0
- package/dist/entities/dataProtection/index.d.ts +1 -0
- package/dist/entities/dataProtection/index.js +17 -0
- package/dist/entities/documentType/documentType.entity.d.ts +3 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.js +2 -0
- package/dist/entities/transparency/index.d.ts +1 -0
- package/dist/entities/transparency/index.js +17 -0
- package/dist/entities/transparency/transparency.entity.d.ts +77 -0
- package/dist/entities/transparency/transparency.entity.js +2 -0
- package/package.json +1 -1
- package/src/base/entities.ts +182 -2
- package/src/contracts/dataProtection.contract.ts +137 -0
- package/src/contracts/documentType.contract.ts +3 -0
- package/src/contracts/index.ts +9 -1
- package/src/contracts/transparency.contract.ts +55 -0
- package/src/entities/dataProtection/dataProtection.entity.ts +140 -0
- package/src/entities/dataProtection/index.ts +1 -0
- package/src/entities/documentType/documentType.entity.ts +3 -0
- package/src/entities/index.ts +2 -0
- package/src/entities/transparency/index.ts +1 -0
- package/src/entities/transparency/transparency.entity.ts +78 -0
package/src/contracts/index.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { SignatureCheckPatterns, type SignatureCheckContract } from './signature
|
|
|
11
11
|
import { RepositoryExportPatterns, type RepositoryExportContract } from './repositoryExport.contract';
|
|
12
12
|
import { RetentionPatterns, type RetentionContract } from './retention.contract';
|
|
13
13
|
import { AccessRequestPatterns, type AccessRequestContract } from './accessRequest.contract';
|
|
14
|
+
import { TransparencyPatterns, type TransparencyContract } from './transparency.contract';
|
|
15
|
+
import { DataProtectionPatterns, type DataProtectionContract } from './dataProtection.contract';
|
|
14
16
|
import { ScanPatterns, type ScanContract } from './scan.contract';
|
|
15
17
|
import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
|
|
16
18
|
import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
|
|
@@ -38,6 +40,8 @@ export * from './signatureCheck.contract';
|
|
|
38
40
|
export * from './repositoryExport.contract';
|
|
39
41
|
export * from './retention.contract';
|
|
40
42
|
export * from './accessRequest.contract';
|
|
43
|
+
export * from './transparency.contract';
|
|
44
|
+
export * from './dataProtection.contract';
|
|
41
45
|
|
|
42
46
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
43
47
|
export const GestorDocumentalPatterns = {
|
|
@@ -60,6 +64,8 @@ export const GestorDocumentalPatterns = {
|
|
|
60
64
|
repositoryExport: RepositoryExportPatterns,
|
|
61
65
|
retention: RetentionPatterns,
|
|
62
66
|
accessRequest: AccessRequestPatterns,
|
|
67
|
+
transparency: TransparencyPatterns,
|
|
68
|
+
dataProtection: DataProtectionPatterns,
|
|
63
69
|
} as const;
|
|
64
70
|
|
|
65
71
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
@@ -81,4 +87,6 @@ export type GestorDocumentalContract = DocumentTypeContract &
|
|
|
81
87
|
SignatureCheckContract &
|
|
82
88
|
RepositoryExportContract &
|
|
83
89
|
RetentionContract &
|
|
84
|
-
AccessRequestContract
|
|
90
|
+
AccessRequestContract &
|
|
91
|
+
TransparencyContract &
|
|
92
|
+
DataProtectionContract;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type DocumentPublicFileResponseEntity,
|
|
3
|
+
type IndicatorsFileEntity,
|
|
4
|
+
type TransparencyItemEntity,
|
|
5
|
+
type TransparencyItemStatus,
|
|
6
|
+
type TransparencyMonthEntity,
|
|
7
|
+
type TransparencyPublicEntity,
|
|
8
|
+
} from '../entities';
|
|
9
|
+
|
|
10
|
+
/** Patrones NATS de `transparency`: Transparencia Activa de los documentos firmados (Ley 20.285, art. 7°). */
|
|
11
|
+
export const TransparencyPatterns = {
|
|
12
|
+
getMonth: 'gestorDocumental.transparency.getMonth',
|
|
13
|
+
update: 'gestorDocumental.transparency.update',
|
|
14
|
+
export: 'gestorDocumental.transparency.export',
|
|
15
|
+
getRedactedFile: 'gestorDocumental.transparency.getRedactedFile',
|
|
16
|
+
getPublic: 'gestorDocumental.transparency.getPublic',
|
|
17
|
+
getPublicFile: 'gestorDocumental.transparency.getPublicFile',
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
type TTransparencyActor = { employeeId: string; fullName: string };
|
|
21
|
+
|
|
22
|
+
/** Lo que se decide sobre un documento en Transparencia Activa. */
|
|
23
|
+
export type TransparencyUpdatePayload =
|
|
24
|
+
/** Publicarlo (o corregir el enlace): si el original no es público, exige antes la versión tarjada. */
|
|
25
|
+
| { action: 'publish'; documentId: string; url?: string | null; note?: string | null; actor: TTransparencyActor }
|
|
26
|
+
/** No se publica, con su motivo (p. ej. reservado por el art. 21 de la Ley 20.285). */
|
|
27
|
+
| { action: 'exclude'; documentId: string; reason: string; actor: TTransparencyActor }
|
|
28
|
+
/** Vuelve a pendiente: se retiró la publicación o se revisó la exclusión. */
|
|
29
|
+
| { action: 'withdraw'; documentId: string; reason: string; actor: TTransparencyActor }
|
|
30
|
+
/** Versión tarjada ya subida al gestor de archivos (PDF). */
|
|
31
|
+
| { action: 'setRedacted'; documentId: string; fileId: string; fileName: string; actor: TTransparencyActor }
|
|
32
|
+
| { action: 'removeRedacted'; documentId: string; actor: TTransparencyActor };
|
|
33
|
+
|
|
34
|
+
export interface TransparencyContract {
|
|
35
|
+
/** Lo firmado en el mes (hora de Chile) de los tipos que se publican, y lo que ya se publicó aunque el tipo cambie. */
|
|
36
|
+
[TransparencyPatterns.getMonth]: {
|
|
37
|
+
payload: { year: number; month: number; status?: TransparencyItemStatus | null };
|
|
38
|
+
response: TransparencyMonthEntity;
|
|
39
|
+
};
|
|
40
|
+
[TransparencyPatterns.update]: { payload: TransparencyUpdatePayload; response: TransparencyItemEntity };
|
|
41
|
+
/** Planilla del mes (Excel) para cargar en el Portal de Transparencia. */
|
|
42
|
+
[TransparencyPatterns.export]: {
|
|
43
|
+
payload: { year: number; month: number; generatedBy: string };
|
|
44
|
+
response: IndicatorsFileEntity;
|
|
45
|
+
};
|
|
46
|
+
/** La versión tarjada cargada, para revisarla antes de publicar. */
|
|
47
|
+
[TransparencyPatterns.getRedactedFile]: {
|
|
48
|
+
payload: { documentId: string };
|
|
49
|
+
response: DocumentPublicFileResponseEntity;
|
|
50
|
+
};
|
|
51
|
+
/** Página pública de un documento publicado, por su código de verificación. No exige sesión. */
|
|
52
|
+
[TransparencyPatterns.getPublic]: { payload: { code: string }; response: TransparencyPublicEntity };
|
|
53
|
+
/** La versión publicada: la tarjada si existe; si no, el original público. Solo de un documento vigente. */
|
|
54
|
+
[TransparencyPatterns.getPublicFile]: { payload: { code: string }; response: DocumentPublicFileResponseEntity };
|
|
55
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CommunicationMeans,
|
|
3
|
+
type DataLegalBasis,
|
|
4
|
+
type DataRight,
|
|
5
|
+
type DataRightsChannel,
|
|
6
|
+
type DataRightsEventAction,
|
|
7
|
+
type DataRightsRequestStatus,
|
|
8
|
+
type DataRightsResolution,
|
|
9
|
+
} from '../../base/entities';
|
|
10
|
+
|
|
11
|
+
/** Tratamiento de datos personales de la municipalidad: lo que se informa al público (Ley 19.628, art. 14 ter). */
|
|
12
|
+
export interface DataTreatmentResponseEntity {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
purpose: string;
|
|
16
|
+
legalBasis: DataLegalBasis;
|
|
17
|
+
legalBasisDetail: string | null;
|
|
18
|
+
dataCategories: string[];
|
|
19
|
+
sensitiveData: boolean;
|
|
20
|
+
dataSubjects: string;
|
|
21
|
+
recipients: string | null;
|
|
22
|
+
source: string | null;
|
|
23
|
+
retention: string | null;
|
|
24
|
+
securityMeasures: string | null;
|
|
25
|
+
internationalTransfer: string | null;
|
|
26
|
+
responsibleUnit: string | null;
|
|
27
|
+
published: boolean;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
/** Solicitudes de titulares que lo mencionan. */
|
|
30
|
+
requests: number;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Página pública de protección de datos: quién es el responsable, cómo ejercer los derechos y qué se trata. */
|
|
35
|
+
export interface DataProtectionPolicyEntity {
|
|
36
|
+
organ: string;
|
|
37
|
+
/** Correo o medio en que se reciben las solicitudes de los titulares (art. 14 ter letra c). */
|
|
38
|
+
contact: string | null;
|
|
39
|
+
/** Dirección de la política de tratamiento, si está publicada aparte. */
|
|
40
|
+
policyUrl: string | null;
|
|
41
|
+
treatments: Omit<DataTreatmentResponseEntity, 'published' | 'enabled' | 'requests' | 'securityMeasures'>[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Semáforo del plazo: a tiempo, por vencer (5 días corridos o menos) o vencido. */
|
|
45
|
+
export type DataRightsDueStatus = 'OnTime' | 'DueSoon' | 'Overdue';
|
|
46
|
+
|
|
47
|
+
export interface DataRightsRequestListItemEntity {
|
|
48
|
+
id: string;
|
|
49
|
+
/** «N° 4/2026». */
|
|
50
|
+
label: string;
|
|
51
|
+
channel: DataRightsChannel;
|
|
52
|
+
rights: DataRight[];
|
|
53
|
+
requesterName: string;
|
|
54
|
+
requestText: string;
|
|
55
|
+
treatmentName: string | null;
|
|
56
|
+
receivedAt: string;
|
|
57
|
+
dueAt: string;
|
|
58
|
+
status: DataRightsRequestStatus;
|
|
59
|
+
resolution: DataRightsResolution | null;
|
|
60
|
+
assigneeFullName: string | null;
|
|
61
|
+
acknowledged: boolean;
|
|
62
|
+
identityVerified: boolean;
|
|
63
|
+
/** Bloqueo temporal pedido y sin resolver. */
|
|
64
|
+
blockingPending: boolean;
|
|
65
|
+
/** Solo mientras está abierta. */
|
|
66
|
+
dueStatus: DataRightsDueStatus | null;
|
|
67
|
+
daysLeft: number | null;
|
|
68
|
+
resolvedOnTime: boolean | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface DataRightsDocumentLinkEntity {
|
|
72
|
+
id: string;
|
|
73
|
+
folio: string | null;
|
|
74
|
+
subject: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface DataRightsRequestDetailEntity extends DataRightsRequestListItemEntity {
|
|
78
|
+
year: number;
|
|
79
|
+
number: number;
|
|
80
|
+
requesterRut: string | null;
|
|
81
|
+
requesterEmail: string | null;
|
|
82
|
+
requesterAddress: string | null;
|
|
83
|
+
representativeName: string | null;
|
|
84
|
+
identityVerifiedAt: string | null;
|
|
85
|
+
identityNote: string | null;
|
|
86
|
+
treatmentId: string | null;
|
|
87
|
+
acknowledgedAt: string | null;
|
|
88
|
+
extendedAt: string | null;
|
|
89
|
+
extensionNote: string | null;
|
|
90
|
+
blockingRequested: boolean;
|
|
91
|
+
blockingReason: string | null;
|
|
92
|
+
blockingDueAt: string | null;
|
|
93
|
+
blockingGranted: boolean | null;
|
|
94
|
+
blockingResolvedAt: string | null;
|
|
95
|
+
blockingNote: string | null;
|
|
96
|
+
assigneeEmployeeId: string | null;
|
|
97
|
+
resolvedAt: string | null;
|
|
98
|
+
denialGrounds: string[];
|
|
99
|
+
resolutionNote: string | null;
|
|
100
|
+
responseDocument: DataRightsDocumentLinkEntity | null;
|
|
101
|
+
responseSentAt: string | null;
|
|
102
|
+
responseSentTo: string | null;
|
|
103
|
+
responseSentMeans: CommunicationMeans | null;
|
|
104
|
+
/** Hasta cuándo el titular puede reclamar ante la Agencia (30 días hábiles), si se denegó en todo o en parte. */
|
|
105
|
+
complaintDeadline: string | null;
|
|
106
|
+
complaintAt: string | null;
|
|
107
|
+
complaintNote: string | null;
|
|
108
|
+
createdByFullName: string;
|
|
109
|
+
/** Se puede prorrogar: abierta, sin prórroga y antes de vencer. */
|
|
110
|
+
canExtend: boolean;
|
|
111
|
+
/** El titular ya puede reclamar ante la Agencia: denegación o plazo vencido sin respuesta. */
|
|
112
|
+
canRegisterComplaint: boolean;
|
|
113
|
+
events: { action: DataRightsEventAction; note: string | null; employeeFullName: string; createdAt: string }[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface DataRightsSummaryEntity {
|
|
117
|
+
year: number;
|
|
118
|
+
total: number;
|
|
119
|
+
open: number;
|
|
120
|
+
overdue: number;
|
|
121
|
+
dueSoon: number;
|
|
122
|
+
/** Abiertas sin acuse de recibo. */
|
|
123
|
+
unacknowledged: number;
|
|
124
|
+
/** Bloqueos temporales pedidos y sin resolver. */
|
|
125
|
+
blockingPending: number;
|
|
126
|
+
byRight: Record<DataRight, number>;
|
|
127
|
+
resolved: Record<DataRightsResolution, number>;
|
|
128
|
+
/** Respondidas dentro del plazo sobre las respondidas, en %. */
|
|
129
|
+
onTimeRate: number | null;
|
|
130
|
+
complaints: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Datos personales que se reconocen en el texto de un documento, enmascarados: ayudan a tarjar. */
|
|
134
|
+
export interface PersonalDataHintsEntity {
|
|
135
|
+
ruts: number;
|
|
136
|
+
emails: number;
|
|
137
|
+
phones: number;
|
|
138
|
+
/** Algunos ejemplos enmascarados («11.1••.•••-1»). */
|
|
139
|
+
samples: string[];
|
|
140
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dataProtection.entity';
|
|
@@ -26,6 +26,9 @@ export interface DocumentTypeGetAllResponseEntity {
|
|
|
26
26
|
resetsYearly: DocumentTypeEntity['resetsYearly'];
|
|
27
27
|
// Sin numeración, sus documentos solo llevan fecha, código de verificación y QR.
|
|
28
28
|
numbered: DocumentTypeEntity['numbered'];
|
|
29
|
+
/** Transparencia Activa: sus documentos se publican cada mes, en esta sección del Portal. */
|
|
30
|
+
activeTransparency: DocumentTypeEntity['activeTransparency'];
|
|
31
|
+
transparencySection: DocumentTypeEntity['transparencySection'];
|
|
29
32
|
directorateCodeReference: DocumentTypeEntity['directorateCodeReference'];
|
|
30
33
|
// Serie documental del Cuadro de Clasificación a la que van sus documentos (MGDDE1_2).
|
|
31
34
|
archivalSeries: { id: string; code: string; name: string } | null;
|
package/src/entities/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './transparency.entity';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type DocumentAccessLevel, type DocumentStatus } from '../../base/entities';
|
|
2
|
+
import { type PersonalDataHintsEntity } from '../dataProtection';
|
|
3
|
+
|
|
4
|
+
/** En qué quedó un documento en Transparencia Activa: aún sin decidir, publicado o excluido con su motivo. */
|
|
5
|
+
export type TransparencyItemStatus = 'Pending' | 'Published' | 'Excluded';
|
|
6
|
+
|
|
7
|
+
/** Un documento que se publica en Transparencia Activa (Ley 20.285, art. 7°), con lo que se decidió de él. */
|
|
8
|
+
export interface TransparencyItemEntity {
|
|
9
|
+
documentId: string;
|
|
10
|
+
documentStatus: DocumentStatus;
|
|
11
|
+
verificationCode: string | null;
|
|
12
|
+
documentTypeName: string;
|
|
13
|
+
documentTypeAbbreviation: string | null;
|
|
14
|
+
/** Sección del Portal en que se publica, según su tipo documental. */
|
|
15
|
+
section: string | null;
|
|
16
|
+
/** Folio del documento (`Decreto Alcaldicio N° 15/2026`), o el nombre del tipo si no lleva número. */
|
|
17
|
+
reference: string;
|
|
18
|
+
correlative: number | null;
|
|
19
|
+
correlativeYear: number | null;
|
|
20
|
+
subject: string;
|
|
21
|
+
finishedAt: string | null;
|
|
22
|
+
annulledAt: string | null;
|
|
23
|
+
accessLevel: DocumentAccessLevel;
|
|
24
|
+
hasSensitiveData: boolean;
|
|
25
|
+
/** El original se puede publicar tal cual: es público (o su restricción terminó) y no tiene datos sensibles. */
|
|
26
|
+
originalIsPublic: boolean;
|
|
27
|
+
/** Para publicarlo hace falta antes la versión tarjada. */
|
|
28
|
+
needsRedacted: boolean;
|
|
29
|
+
redactedFileName: string | null;
|
|
30
|
+
/** RUN, correos y teléfonos que se reconocen en el texto del original (`null` si no tiene texto): ayudan a tarjar. */
|
|
31
|
+
personalData: PersonalDataHintsEntity | null;
|
|
32
|
+
status: TransparencyItemStatus;
|
|
33
|
+
/** Dirección de la publicación en el Portal de Transparencia, si se anotó. */
|
|
34
|
+
transparencyUrl: string | null;
|
|
35
|
+
/** Motivo de la exclusión, u observación de la publicación. */
|
|
36
|
+
transparencyNote: string | null;
|
|
37
|
+
transparencyAt: string | null;
|
|
38
|
+
transparencyByFullName: string | null;
|
|
39
|
+
/** Enlace público estable a la versión que se publica (`<TRANSPARENCY_URL>/<código>`), si está configurado. */
|
|
40
|
+
publicLink: string | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface TransparencyMonthCountsEntity {
|
|
44
|
+
total: number;
|
|
45
|
+
pending: number;
|
|
46
|
+
published: number;
|
|
47
|
+
excluded: number;
|
|
48
|
+
/** Publicados que después se anularon: hay que retirarlos o actualizarlos en el Portal. */
|
|
49
|
+
annulledPublished: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Lo firmado en un mes de los tipos documentales que se publican, con lo que falta por decidir. */
|
|
53
|
+
export interface TransparencyMonthEntity {
|
|
54
|
+
year: number;
|
|
55
|
+
month: number;
|
|
56
|
+
counts: TransparencyMonthCountsEntity;
|
|
57
|
+
/** Tipos documentales marcados para Transparencia Activa. Sin ninguno, la bandeja queda vacía. */
|
|
58
|
+
documentTypes: { id: string; name: string; section: string | null }[];
|
|
59
|
+
items: TransparencyItemEntity[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Lo que muestra la página pública de un documento publicado en Transparencia Activa. No exige sesión. */
|
|
63
|
+
export interface TransparencyPublicEntity {
|
|
64
|
+
verificationCode: string;
|
|
65
|
+
documentTypeName: string;
|
|
66
|
+
issuerName: string;
|
|
67
|
+
section: string | null;
|
|
68
|
+
reference: string;
|
|
69
|
+
/** La materia solo se muestra si el original es público; si se publicó tarjado, se lee en el archivo. */
|
|
70
|
+
subject: string | null;
|
|
71
|
+
finishedAt: string | null;
|
|
72
|
+
/** Anulado después de publicarse: se informa y ya no se descarga. */
|
|
73
|
+
annulled: boolean;
|
|
74
|
+
/** Se publicó una versión tarjada (sin datos personales o reservados). */
|
|
75
|
+
redacted: boolean;
|
|
76
|
+
canDownload: boolean;
|
|
77
|
+
publishedAt: string | null;
|
|
78
|
+
}
|