@muni-sanfer/types-gestor-documental 0.0.1-beta.32 → 0.0.1-beta.34
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 +54 -2
- package/dist/base/entities.js +13 -0
- package/dist/contracts/dataProtection.contract.d.ts +5 -0
- package/dist/contracts/desk.contract.d.ts +2 -0
- package/dist/contracts/index.d.ts +19 -1
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/mailIntake.contract.d.ts +61 -0
- package/dist/contracts/mailIntake.contract.js +15 -0
- package/dist/contracts/push.contract.d.ts +59 -0
- package/dist/contracts/push.contract.js +14 -0
- package/dist/entities/dataProtection/dataProtection.entity.d.ts +6 -0
- package/dist/entities/desk/desk.entity.d.ts +4 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.js +2 -0
- package/dist/entities/mailIntake/index.d.ts +1 -0
- package/dist/entities/mailIntake/index.js +17 -0
- package/dist/entities/mailIntake/mailIntake.entity.d.ts +51 -0
- package/dist/entities/mailIntake/mailIntake.entity.js +2 -0
- package/dist/entities/push/index.d.ts +1 -0
- package/dist/entities/push/index.js +17 -0
- package/dist/entities/push/push.entity.d.ts +28 -0
- package/dist/entities/push/push.entity.js +2 -0
- package/package.json +1 -1
- package/src/base/entities.ts +60 -1
- package/src/contracts/dataProtection.contract.ts +2 -0
- package/src/contracts/desk.contract.ts +5 -1
- package/src/contracts/index.ts +9 -1
- package/src/contracts/mailIntake.contract.ts +49 -0
- package/src/contracts/push.contract.ts +41 -0
- package/src/entities/dataProtection/dataProtection.entity.ts +6 -0
- package/src/entities/desk/desk.entity.ts +4 -0
- package/src/entities/index.ts +2 -0
- package/src/entities/mailIntake/index.ts +1 -0
- package/src/entities/mailIntake/mailIntake.entity.ts +55 -0
- package/src/entities/push/index.ts +1 -0
- package/src/entities/push/push.entity.ts +31 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -330,7 +330,7 @@ export declare const DataRightsResolution: {
|
|
|
330
330
|
Denied: "Denied";
|
|
331
331
|
Withdrawn: "Withdrawn";
|
|
332
332
|
};
|
|
333
|
-
export type DataRightsEventAction = 'Received' | 'Updated' | 'Acknowledged' | 'IdentityVerified' | 'Assigned' | 'BlockingResolved' | 'Extended' | 'Resolved' | 'ResponseSent' | 'ComplaintRegistered';
|
|
333
|
+
export type DataRightsEventAction = 'Received' | 'Updated' | 'Acknowledged' | 'IdentityVerified' | 'Assigned' | 'BlockingResolved' | 'BlockingLifted' | 'Extended' | 'Resolved' | 'ResponseSent' | 'ComplaintRegistered';
|
|
334
334
|
export declare const DataRightsEventAction: {
|
|
335
335
|
Received: "Received";
|
|
336
336
|
Updated: "Updated";
|
|
@@ -338,6 +338,7 @@ export declare const DataRightsEventAction: {
|
|
|
338
338
|
IdentityVerified: "IdentityVerified";
|
|
339
339
|
Assigned: "Assigned";
|
|
340
340
|
BlockingResolved: "BlockingResolved";
|
|
341
|
+
BlockingLifted: "BlockingLifted";
|
|
341
342
|
Extended: "Extended";
|
|
342
343
|
Resolved: "Resolved";
|
|
343
344
|
ResponseSent: "ResponseSent";
|
|
@@ -369,16 +370,29 @@ export declare const DataBreachNoticeMeans: {
|
|
|
369
370
|
Individual: "Individual";
|
|
370
371
|
PublicNotice: "PublicNotice";
|
|
371
372
|
};
|
|
372
|
-
export type DeskFileSource = 'Upload' | 'Scan';
|
|
373
|
+
export type DeskFileSource = 'Upload' | 'Scan' | 'Email';
|
|
373
374
|
export declare const DeskFileSource: {
|
|
374
375
|
Upload: "Upload";
|
|
375
376
|
Scan: "Scan";
|
|
377
|
+
Email: "Email";
|
|
376
378
|
};
|
|
377
379
|
export type DeskFileTarget = 'Document' | 'CaseFile';
|
|
378
380
|
export declare const DeskFileTarget: {
|
|
379
381
|
Document: "Document";
|
|
380
382
|
CaseFile: "CaseFile";
|
|
381
383
|
};
|
|
384
|
+
export type MailIntakeStatus = 'Pending' | 'Accepted' | 'Discarded';
|
|
385
|
+
export declare const MailIntakeStatus: {
|
|
386
|
+
Pending: "Pending";
|
|
387
|
+
Accepted: "Accepted";
|
|
388
|
+
Discarded: "Discarded";
|
|
389
|
+
};
|
|
390
|
+
export type MailAuthentication = 'Pass' | 'Fail' | 'Unknown';
|
|
391
|
+
export declare const MailAuthentication: {
|
|
392
|
+
Pass: "Pass";
|
|
393
|
+
Fail: "Fail";
|
|
394
|
+
Unknown: "Unknown";
|
|
395
|
+
};
|
|
382
396
|
export interface DocumentTypeEntity {
|
|
383
397
|
id: string;
|
|
384
398
|
name: string;
|
|
@@ -1118,6 +1132,8 @@ export interface DataRightsRequestEntity {
|
|
|
1118
1132
|
blockingGranted?: boolean | null;
|
|
1119
1133
|
blockingResolvedAt?: string | null;
|
|
1120
1134
|
blockingNote?: string | null;
|
|
1135
|
+
blockingLiftedAt?: string | null;
|
|
1136
|
+
blockingLiftNote?: string | null;
|
|
1121
1137
|
assigneeEmployeeId?: string | null;
|
|
1122
1138
|
assigneeFullName?: string | null;
|
|
1123
1139
|
resolution?: DataRightsResolution | null;
|
|
@@ -1203,6 +1219,42 @@ export interface DeskFileEntity {
|
|
|
1203
1219
|
targetId?: string | null;
|
|
1204
1220
|
targetLabel?: string | null;
|
|
1205
1221
|
removedAt?: string | null;
|
|
1222
|
+
mailIntake?: MailIntakeEntity | null;
|
|
1223
|
+
mailIntakeId?: string | null;
|
|
1224
|
+
createdAt: string;
|
|
1225
|
+
updatedAt: string;
|
|
1226
|
+
}
|
|
1227
|
+
export interface MailIntakeEntity {
|
|
1228
|
+
id: string;
|
|
1229
|
+
sha256: string;
|
|
1230
|
+
messageId?: string | null;
|
|
1231
|
+
fromAddress: string;
|
|
1232
|
+
fromName?: string | null;
|
|
1233
|
+
subject: string;
|
|
1234
|
+
textPreview?: string | null;
|
|
1235
|
+
sentAt?: string | null;
|
|
1236
|
+
emlFileId: string;
|
|
1237
|
+
emlFileName: string;
|
|
1238
|
+
size: number;
|
|
1239
|
+
attachments: JsonValue;
|
|
1240
|
+
authentication: MailAuthentication;
|
|
1241
|
+
authDetail?: string | null;
|
|
1242
|
+
status: MailIntakeStatus;
|
|
1243
|
+
resolvedAt?: string | null;
|
|
1244
|
+
resolvedByEmployeeId?: string | null;
|
|
1245
|
+
deskFiles?: DeskFileEntity[];
|
|
1246
|
+
createdAt: string;
|
|
1247
|
+
updatedAt: string;
|
|
1248
|
+
}
|
|
1249
|
+
export interface PushSubscriptionEntity {
|
|
1250
|
+
id: string;
|
|
1251
|
+
employeeId: string;
|
|
1252
|
+
endpoint: string;
|
|
1253
|
+
p256dh: string;
|
|
1254
|
+
auth: string;
|
|
1255
|
+
userAgent?: string | null;
|
|
1256
|
+
lastSuccessAt?: string | null;
|
|
1257
|
+
failures: number;
|
|
1206
1258
|
createdAt: string;
|
|
1207
1259
|
updatedAt: string;
|
|
1208
1260
|
}
|
package/dist/base/entities.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// This file was auto-generated by prisma-generator-typescript-interfaces
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.DeskFileTarget = exports.DeskFileSource = exports.DataBreachNoticeMeans = exports.DataBreachEventAction = exports.DataBreachStatus = exports.DataBreachKind = exports.DataRightsEventAction = exports.DataRightsResolution = exports.DataRightsRequestStatus = exports.DataRightsChannel = exports.DataRight = exports.DataLegalBasis = exports.TransparencyStatus = exports.AccessRequestEventAction = exports.AccessRequestResolution = exports.AccessRequestStatus = exports.AccessRequestChannel = exports.DispositionKind = exports.FinalDisposition = exports.AuditAction = exports.AuditEntity = exports.DocumentAccessAction = exports.QualityMetricKey = exports.ServiceOutageKind = exports.WorkFolderItemKind = exports.TextSnippetSection = exports.ScanSessionStatus = exports.CaseFileAccessAction = exports.CaseFileTrackingAction = exports.CaseFileActorType = exports.CaseFileActorRelation = exports.CaseFileEntryKind = exports.CaseFileActuationType = exports.CaseFileIncorporationMechanism = exports.CaseFileStatus = exports.DocumentInstruction = exports.DocumentDeliveryOrigin = exports.DocumentRecipientType = exports.DocumentAttachmentType = exports.DocumentFlowStepType = exports.DocDigitalInboundStatus = exports.DocumentDispatchStatus = exports.CommunicationMeans = exports.DocumentOrigin = exports.DocumentTrackingAction = exports.DocumentParticipantStatus = exports.DocumentParticipantRole = exports.DocumentAccessLevel = exports.DocumentStatus = exports.DocumentCategory = void 0;
|
|
5
|
+
exports.MailAuthentication = exports.MailIntakeStatus = void 0;
|
|
5
6
|
exports.DocumentCategory = {
|
|
6
7
|
Decree: 'Decree',
|
|
7
8
|
Communication: 'Communication',
|
|
@@ -298,6 +299,7 @@ exports.DataRightsEventAction = {
|
|
|
298
299
|
IdentityVerified: 'IdentityVerified',
|
|
299
300
|
Assigned: 'Assigned',
|
|
300
301
|
BlockingResolved: 'BlockingResolved',
|
|
302
|
+
BlockingLifted: 'BlockingLifted',
|
|
301
303
|
Extended: 'Extended',
|
|
302
304
|
Resolved: 'Resolved',
|
|
303
305
|
ResponseSent: 'ResponseSent',
|
|
@@ -328,8 +330,19 @@ exports.DataBreachNoticeMeans = {
|
|
|
328
330
|
exports.DeskFileSource = {
|
|
329
331
|
Upload: 'Upload',
|
|
330
332
|
Scan: 'Scan',
|
|
333
|
+
Email: 'Email',
|
|
331
334
|
};
|
|
332
335
|
exports.DeskFileTarget = {
|
|
333
336
|
Document: 'Document',
|
|
334
337
|
CaseFile: 'CaseFile',
|
|
335
338
|
};
|
|
339
|
+
exports.MailIntakeStatus = {
|
|
340
|
+
Pending: 'Pending',
|
|
341
|
+
Accepted: 'Accepted',
|
|
342
|
+
Discarded: 'Discarded',
|
|
343
|
+
};
|
|
344
|
+
exports.MailAuthentication = {
|
|
345
|
+
Pass: 'Pass',
|
|
346
|
+
Fail: 'Fail',
|
|
347
|
+
Unknown: 'Unknown',
|
|
348
|
+
};
|
|
@@ -76,6 +76,11 @@ export type DataRightsAction = {
|
|
|
76
76
|
type: 'resolveBlocking';
|
|
77
77
|
granted: boolean;
|
|
78
78
|
note?: string | null;
|
|
79
|
+
}
|
|
80
|
+
/** Levanta el bloqueo concedido (también después de responder): esos datos se vuelven a tratar. */
|
|
81
|
+
| {
|
|
82
|
+
type: 'liftBlocking';
|
|
83
|
+
note?: string | null;
|
|
79
84
|
} | {
|
|
80
85
|
type: 'extend';
|
|
81
86
|
note: string;
|
|
@@ -19,8 +19,10 @@ export interface DeskContract {
|
|
|
19
19
|
};
|
|
20
20
|
response: DeskFileResponseEntity[];
|
|
21
21
|
};
|
|
22
|
+
/** `email`, el correo institucional de la sesión, cuenta también los correos que esperan que elija sus adjuntos. */
|
|
22
23
|
[DeskPatterns.getSummary]: {
|
|
23
24
|
payload: {
|
|
25
|
+
email?: string | null;
|
|
24
26
|
actor: DocumentActor;
|
|
25
27
|
};
|
|
26
28
|
response: DeskSummaryEntity;
|
|
@@ -14,6 +14,8 @@ import { type AccessRequestContract } from './accessRequest.contract';
|
|
|
14
14
|
import { type TransparencyContract } from './transparency.contract';
|
|
15
15
|
import { type DataProtectionContract } from './dataProtection.contract';
|
|
16
16
|
import { type DeskContract } from './desk.contract';
|
|
17
|
+
import { type MailIntakeContract } from './mailIntake.contract';
|
|
18
|
+
import { type PushContract } from './push.contract';
|
|
17
19
|
import { type ScanContract } from './scan.contract';
|
|
18
20
|
import { type PartsOfficeContract } from './partsOffice.contract';
|
|
19
21
|
import { type ProcedureContract } from './procedure.contract';
|
|
@@ -43,6 +45,8 @@ export * from './accessRequest.contract';
|
|
|
43
45
|
export * from './transparency.contract';
|
|
44
46
|
export * from './dataProtection.contract';
|
|
45
47
|
export * from './desk.contract';
|
|
48
|
+
export * from './mailIntake.contract';
|
|
49
|
+
export * from './push.contract';
|
|
46
50
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
47
51
|
export declare const GestorDocumentalPatterns: {
|
|
48
52
|
readonly documentType: {
|
|
@@ -267,6 +271,20 @@ export declare const GestorDocumentalPatterns: {
|
|
|
267
271
|
readonly classify: "gestorDocumental.desk.classify";
|
|
268
272
|
readonly moveToCaseFile: "gestorDocumental.desk.moveToCaseFile";
|
|
269
273
|
};
|
|
274
|
+
readonly mailIntake: {
|
|
275
|
+
readonly getMine: "gestorDocumental.mailIntake.getMine";
|
|
276
|
+
readonly accept: "gestorDocumental.mailIntake.accept";
|
|
277
|
+
readonly discard: "gestorDocumental.mailIntake.discard";
|
|
278
|
+
readonly getEml: "gestorDocumental.mailIntake.getEml";
|
|
279
|
+
readonly sync: "gestorDocumental.mailIntake.sync";
|
|
280
|
+
};
|
|
281
|
+
readonly push: {
|
|
282
|
+
readonly getConfig: "gestorDocumental.push.getConfig";
|
|
283
|
+
readonly subscribe: "gestorDocumental.push.subscribe";
|
|
284
|
+
readonly unsubscribe: "gestorDocumental.push.unsubscribe";
|
|
285
|
+
readonly test: "gestorDocumental.push.test";
|
|
286
|
+
readonly send: "gestorDocumental.push.send";
|
|
287
|
+
};
|
|
270
288
|
};
|
|
271
289
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
272
|
-
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract;
|
|
290
|
+
export type GestorDocumentalContract = DocumentTypeContract & DocumentContract & ProcedureContract & IssuingEntityContract & CaseFileContract & PartsOfficeContract & RegisterBookContract & SignatureBatchContract & WorkFolderContract & ScanContract & ArchivalSeriesContract & TextSnippetContract & HolidayContract & IndicatorsContract & AuditContract & SignatureCheckContract & RepositoryExportContract & RetentionContract & AccessRequestContract & TransparencyContract & DataProtectionContract & DeskContract & MailIntakeContract & PushContract;
|
package/dist/contracts/index.js
CHANGED
|
@@ -31,6 +31,8 @@ const accessRequest_contract_1 = require("./accessRequest.contract");
|
|
|
31
31
|
const transparency_contract_1 = require("./transparency.contract");
|
|
32
32
|
const dataProtection_contract_1 = require("./dataProtection.contract");
|
|
33
33
|
const desk_contract_1 = require("./desk.contract");
|
|
34
|
+
const mailIntake_contract_1 = require("./mailIntake.contract");
|
|
35
|
+
const push_contract_1 = require("./push.contract");
|
|
34
36
|
const scan_contract_1 = require("./scan.contract");
|
|
35
37
|
const partsOffice_contract_1 = require("./partsOffice.contract");
|
|
36
38
|
const procedure_contract_1 = require("./procedure.contract");
|
|
@@ -60,6 +62,8 @@ __exportStar(require("./accessRequest.contract"), exports);
|
|
|
60
62
|
__exportStar(require("./transparency.contract"), exports);
|
|
61
63
|
__exportStar(require("./dataProtection.contract"), exports);
|
|
62
64
|
__exportStar(require("./desk.contract"), exports);
|
|
65
|
+
__exportStar(require("./mailIntake.contract"), exports);
|
|
66
|
+
__exportStar(require("./push.contract"), exports);
|
|
63
67
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
64
68
|
exports.GestorDocumentalPatterns = {
|
|
65
69
|
documentType: documentType_contract_1.DocumentTypePatterns,
|
|
@@ -84,4 +88,6 @@ exports.GestorDocumentalPatterns = {
|
|
|
84
88
|
transparency: transparency_contract_1.TransparencyPatterns,
|
|
85
89
|
dataProtection: dataProtection_contract_1.DataProtectionPatterns,
|
|
86
90
|
desk: desk_contract_1.DeskPatterns,
|
|
91
|
+
mailIntake: mailIntake_contract_1.MailIntakePatterns,
|
|
92
|
+
push: push_contract_1.PushPatterns,
|
|
87
93
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type DeskFileResponseEntity, type DeskOkResponseEntity, type DocumentPublicFileResponseEntity, type MailIntakeInboxEntity, type MailIntakeSyncEntity } from '../entities';
|
|
2
|
+
import { type DocumentActor } from './document.contract';
|
|
3
|
+
/**
|
|
4
|
+
* Patrones NATS de `mailIntake`: el ingreso por correo. Un funcionario reenvía un correo a la casilla del gestor y
|
|
5
|
+
* después elige qué adjuntos entran a su escritorio. `email` es el correo institucional de la sesión, que agrega el
|
|
6
|
+
* gateway: solo con él se ven los correos que envió.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MailIntakePatterns: {
|
|
9
|
+
readonly getMine: "gestorDocumental.mailIntake.getMine";
|
|
10
|
+
readonly accept: "gestorDocumental.mailIntake.accept";
|
|
11
|
+
readonly discard: "gestorDocumental.mailIntake.discard";
|
|
12
|
+
readonly getEml: "gestorDocumental.mailIntake.getEml";
|
|
13
|
+
readonly sync: "gestorDocumental.mailIntake.sync";
|
|
14
|
+
};
|
|
15
|
+
export interface MailIntakeContract {
|
|
16
|
+
/** Los correos pendientes que envió quien tiene la sesión, del más reciente al más antiguo. */
|
|
17
|
+
[MailIntakePatterns.getMine]: {
|
|
18
|
+
payload: {
|
|
19
|
+
email: string | null;
|
|
20
|
+
actor: DocumentActor;
|
|
21
|
+
};
|
|
22
|
+
response: MailIntakeInboxEntity;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Lleva al escritorio los adjuntos elegidos (por su `index`) y, si se pide, el correo completo en EML. El correo
|
|
26
|
+
* queda aceptado: no se puede volver a procesar.
|
|
27
|
+
*/
|
|
28
|
+
[MailIntakePatterns.accept]: {
|
|
29
|
+
payload: {
|
|
30
|
+
id: string;
|
|
31
|
+
email: string | null;
|
|
32
|
+
attachments: number[];
|
|
33
|
+
includeEml: boolean;
|
|
34
|
+
actor: DocumentActor;
|
|
35
|
+
};
|
|
36
|
+
response: DeskFileResponseEntity[];
|
|
37
|
+
};
|
|
38
|
+
/** Lo descarta sin traer nada. El EML se conserva. */
|
|
39
|
+
[MailIntakePatterns.discard]: {
|
|
40
|
+
payload: {
|
|
41
|
+
id: string;
|
|
42
|
+
email: string | null;
|
|
43
|
+
actor: DocumentActor;
|
|
44
|
+
};
|
|
45
|
+
response: DeskOkResponseEntity;
|
|
46
|
+
};
|
|
47
|
+
/** El correo completo (EML), para su remitente. */
|
|
48
|
+
[MailIntakePatterns.getEml]: {
|
|
49
|
+
payload: {
|
|
50
|
+
id: string;
|
|
51
|
+
email: string | null;
|
|
52
|
+
actor: DocumentActor;
|
|
53
|
+
};
|
|
54
|
+
response: DocumentPublicFileResponseEntity;
|
|
55
|
+
};
|
|
56
|
+
/** Revisa la casilla ahora, sin esperar a la revisión periódica. */
|
|
57
|
+
[MailIntakePatterns.sync]: {
|
|
58
|
+
payload: Record<string, never>;
|
|
59
|
+
response: MailIntakeSyncEntity;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MailIntakePatterns = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Patrones NATS de `mailIntake`: el ingreso por correo. Un funcionario reenvía un correo a la casilla del gestor y
|
|
6
|
+
* después elige qué adjuntos entran a su escritorio. `email` es el correo institucional de la sesión, que agrega el
|
|
7
|
+
* gateway: solo con él se ven los correos que envió.
|
|
8
|
+
*/
|
|
9
|
+
exports.MailIntakePatterns = {
|
|
10
|
+
getMine: 'gestorDocumental.mailIntake.getMine',
|
|
11
|
+
accept: 'gestorDocumental.mailIntake.accept',
|
|
12
|
+
discard: 'gestorDocumental.mailIntake.discard',
|
|
13
|
+
getEml: 'gestorDocumental.mailIntake.getEml',
|
|
14
|
+
sync: 'gestorDocumental.mailIntake.sync',
|
|
15
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type PushConfigResponseEntity, type PushNotificationInput, type PushOkResponseEntity, type PushSendResultEntity } from '../entities';
|
|
2
|
+
import { type DocumentActor } from './document.contract';
|
|
3
|
+
/**
|
|
4
|
+
* Patrones NATS de `push`: avisos en el celular o el computador (Web Push), además del correo. Cada funcionario los
|
|
5
|
+
* activa en sus dispositivos; el gateway los envía junto con los correos de aviso.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PushPatterns: {
|
|
8
|
+
readonly getConfig: "gestorDocumental.push.getConfig";
|
|
9
|
+
readonly subscribe: "gestorDocumental.push.subscribe";
|
|
10
|
+
readonly unsubscribe: "gestorDocumental.push.unsubscribe";
|
|
11
|
+
readonly test: "gestorDocumental.push.test";
|
|
12
|
+
readonly send: "gestorDocumental.push.send";
|
|
13
|
+
};
|
|
14
|
+
export interface PushContract {
|
|
15
|
+
[PushPatterns.getConfig]: {
|
|
16
|
+
payload: {
|
|
17
|
+
actor: DocumentActor;
|
|
18
|
+
};
|
|
19
|
+
response: PushConfigResponseEntity;
|
|
20
|
+
};
|
|
21
|
+
/** Registra el dispositivo (o lo actualiza, si ya estaba) a nombre de quien tiene la sesión. */
|
|
22
|
+
[PushPatterns.subscribe]: {
|
|
23
|
+
payload: {
|
|
24
|
+
subscription: {
|
|
25
|
+
endpoint: string;
|
|
26
|
+
keys: {
|
|
27
|
+
p256dh: string;
|
|
28
|
+
auth: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
userAgent?: string | null;
|
|
32
|
+
actor: DocumentActor;
|
|
33
|
+
};
|
|
34
|
+
response: PushOkResponseEntity;
|
|
35
|
+
};
|
|
36
|
+
/** Quita el dispositivo, solo si es de quien tiene la sesión. */
|
|
37
|
+
[PushPatterns.unsubscribe]: {
|
|
38
|
+
payload: {
|
|
39
|
+
endpoint: string;
|
|
40
|
+
actor: DocumentActor;
|
|
41
|
+
};
|
|
42
|
+
response: PushOkResponseEntity;
|
|
43
|
+
};
|
|
44
|
+
/** Un aviso de prueba a los dispositivos de quien tiene la sesión. */
|
|
45
|
+
[PushPatterns.test]: {
|
|
46
|
+
payload: {
|
|
47
|
+
actor: DocumentActor;
|
|
48
|
+
};
|
|
49
|
+
response: PushSendResultEntity;
|
|
50
|
+
};
|
|
51
|
+
/** Envía un aviso a los dispositivos de esos funcionarios. Lo usa el gateway, no el navegador. */
|
|
52
|
+
[PushPatterns.send]: {
|
|
53
|
+
payload: {
|
|
54
|
+
employeeIds: string[];
|
|
55
|
+
notification: PushNotificationInput;
|
|
56
|
+
};
|
|
57
|
+
response: PushSendResultEntity;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PushPatterns = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Patrones NATS de `push`: avisos en el celular o el computador (Web Push), además del correo. Cada funcionario los
|
|
6
|
+
* activa en sus dispositivos; el gateway los envía junto con los correos de aviso.
|
|
7
|
+
*/
|
|
8
|
+
exports.PushPatterns = {
|
|
9
|
+
getConfig: 'gestorDocumental.push.getConfig',
|
|
10
|
+
subscribe: 'gestorDocumental.push.subscribe',
|
|
11
|
+
unsubscribe: 'gestorDocumental.push.unsubscribe',
|
|
12
|
+
test: 'gestorDocumental.push.test',
|
|
13
|
+
send: 'gestorDocumental.push.send',
|
|
14
|
+
};
|
|
@@ -50,6 +50,8 @@ export interface DataRightsRequestListItemEntity {
|
|
|
50
50
|
identityVerified: boolean;
|
|
51
51
|
/** Bloqueo temporal pedido y sin resolver. */
|
|
52
52
|
blockingPending: boolean;
|
|
53
|
+
/** Bloqueo temporal concedido y todavía no levantado: esos datos no se tratan. */
|
|
54
|
+
blockingActive: boolean;
|
|
53
55
|
/** Solo mientras está abierta. */
|
|
54
56
|
dueStatus: DataRightsDueStatus | null;
|
|
55
57
|
daysLeft: number | null;
|
|
@@ -79,6 +81,8 @@ export interface DataRightsRequestDetailEntity extends DataRightsRequestListItem
|
|
|
79
81
|
blockingGranted: boolean | null;
|
|
80
82
|
blockingResolvedAt: string | null;
|
|
81
83
|
blockingNote: string | null;
|
|
84
|
+
blockingLiftedAt: string | null;
|
|
85
|
+
blockingLiftNote: string | null;
|
|
82
86
|
assigneeEmployeeId: string | null;
|
|
83
87
|
resolvedAt: string | null;
|
|
84
88
|
denialGrounds: string[];
|
|
@@ -113,6 +117,8 @@ export interface DataRightsSummaryEntity {
|
|
|
113
117
|
unacknowledged: number;
|
|
114
118
|
/** Bloqueos temporales pedidos y sin resolver. */
|
|
115
119
|
blockingPending: number;
|
|
120
|
+
/** Bloqueos temporales concedidos y no levantados, de cualquier año. */
|
|
121
|
+
blockingActive: number;
|
|
116
122
|
byRight: Record<DataRight, number>;
|
|
117
123
|
resolved: Record<DataRightsResolution, number>;
|
|
118
124
|
/** Respondidas dentro del plazo sobre las respondidas, en %. */
|
|
@@ -7,6 +7,8 @@ export interface DeskFileResponseEntity {
|
|
|
7
7
|
sha256: string;
|
|
8
8
|
source: DeskFileSource;
|
|
9
9
|
description: string | null;
|
|
10
|
+
/** Correo del que salió, si llegó por correo. */
|
|
11
|
+
mailIntakeId: string | null;
|
|
10
12
|
/** Es un PDF: se puede redactar una comunicación con él o firmarlo como documento suelto. */
|
|
11
13
|
isPdf: boolean;
|
|
12
14
|
createdAt: string;
|
|
@@ -14,6 +16,8 @@ export interface DeskFileResponseEntity {
|
|
|
14
16
|
export interface DeskSummaryEntity {
|
|
15
17
|
/** Archivos del escritorio aún sin clasificar. */
|
|
16
18
|
unclassified: number;
|
|
19
|
+
/** Correos reenviados a la casilla del gestor que esperan que elija sus adjuntos. */
|
|
20
|
+
pendingMails: number;
|
|
17
21
|
}
|
|
18
22
|
export interface DeskOkResponseEntity {
|
|
19
23
|
id: string;
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -36,3 +36,5 @@ __exportStar(require("./accessRequest"), exports);
|
|
|
36
36
|
__exportStar(require("./transparency"), exports);
|
|
37
37
|
__exportStar(require("./dataProtection"), exports);
|
|
38
38
|
__exportStar(require("./desk"), exports);
|
|
39
|
+
__exportStar(require("./mailIntake"), exports);
|
|
40
|
+
__exportStar(require("./push"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './mailIntake.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("./mailIntake.entity"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type MailAuthentication } from '../../base/entities';
|
|
2
|
+
/** Adjunto de un correo recibido. `index` lo identifica al elegir qué entra al escritorio. */
|
|
3
|
+
export interface MailIntakeAttachmentEntity {
|
|
4
|
+
index: number;
|
|
5
|
+
fileName: string;
|
|
6
|
+
contentType: string;
|
|
7
|
+
size: number;
|
|
8
|
+
sha256: string;
|
|
9
|
+
/** Su tipo de archivo puede entrar al escritorio (PDF, documentos de oficina, imágenes). */
|
|
10
|
+
supported: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Correo reenviado a la casilla del gestor, a la espera de que su remitente elija qué adjuntos entran. */
|
|
13
|
+
export interface MailIntakeItemEntity {
|
|
14
|
+
id: string;
|
|
15
|
+
fromAddress: string;
|
|
16
|
+
fromName: string | null;
|
|
17
|
+
subject: string;
|
|
18
|
+
/** Comienzo del texto del correo, para reconocerlo. */
|
|
19
|
+
textPreview: string | null;
|
|
20
|
+
/** Fecha del correo, según su remitente. */
|
|
21
|
+
sentAt: string | null;
|
|
22
|
+
/** Cuándo lo trajo el gestor desde la casilla. */
|
|
23
|
+
receivedAt: string;
|
|
24
|
+
/** Tamaño del correo completo (EML), en bytes. */
|
|
25
|
+
size: number;
|
|
26
|
+
/** Lo que informó el servidor de correo sobre el remitente: `Fail` puede ser un remitente suplantado. */
|
|
27
|
+
authentication: MailAuthentication;
|
|
28
|
+
authDetail: string | null;
|
|
29
|
+
attachments: MailIntakeAttachmentEntity[];
|
|
30
|
+
}
|
|
31
|
+
/** Los correos pendientes de quien tiene la sesión y a qué casilla reenviarlos. */
|
|
32
|
+
export interface MailIntakeInboxEntity {
|
|
33
|
+
/** La casilla está configurada y se revisa. */
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
/** Dirección a la que se reenvían los correos; `null` si no está configurada. */
|
|
36
|
+
address: string | null;
|
|
37
|
+
/** Los dominios desde los que se aceptan correos (los institucionales). */
|
|
38
|
+
domains: string[];
|
|
39
|
+
mails: MailIntakeItemEntity[];
|
|
40
|
+
}
|
|
41
|
+
/** Resultado de una revisión de la casilla. */
|
|
42
|
+
export interface MailIntakeSyncEntity {
|
|
43
|
+
/** Correos sin leer que se revisaron. */
|
|
44
|
+
checked: number;
|
|
45
|
+
/** Los que quedaron registrados. */
|
|
46
|
+
created: number;
|
|
47
|
+
/** Repetidos o de un dominio que no es institucional: no se guardan. */
|
|
48
|
+
ignored: number;
|
|
49
|
+
/** Los que no se pudieron procesar; se reintentan en la próxima revisión. */
|
|
50
|
+
failed: number;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './push.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("./push.entity"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Si los avisos push están habilitados y con qué clave pública se suscribe el navegador. */
|
|
2
|
+
export interface PushConfigResponseEntity {
|
|
3
|
+
/** El servidor tiene sus claves VAPID: se pueden activar. */
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
/** Clave pública VAPID (base64url) para `pushManager.subscribe`; `null` si no está habilitado. */
|
|
6
|
+
publicKey: string | null;
|
|
7
|
+
/** Dispositivos en que quien consulta tiene los avisos activos. */
|
|
8
|
+
devices: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PushOkResponseEntity {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Resultado de un envío: avisos entregados al servicio push, suscripciones vencidas que se borraron y fallas. */
|
|
14
|
+
export interface PushSendResultEntity {
|
|
15
|
+
sent: number;
|
|
16
|
+
removed: number;
|
|
17
|
+
failed: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Un aviso. `url` es una ruta del gestor (`/documentos/…/detalle`): el service worker la abre al tocar el aviso.
|
|
21
|
+
* `tag` agrupa: un aviso nuevo con el mismo `tag` reemplaza al anterior en el dispositivo.
|
|
22
|
+
*/
|
|
23
|
+
export interface PushNotificationInput {
|
|
24
|
+
title: string;
|
|
25
|
+
body: string;
|
|
26
|
+
url: string;
|
|
27
|
+
tag?: string | null;
|
|
28
|
+
}
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -500,6 +500,7 @@ export type DataRightsEventAction =
|
|
|
500
500
|
| 'IdentityVerified'
|
|
501
501
|
| 'Assigned'
|
|
502
502
|
| 'BlockingResolved'
|
|
503
|
+
| 'BlockingLifted'
|
|
503
504
|
| 'Extended'
|
|
504
505
|
| 'Resolved'
|
|
505
506
|
| 'ResponseSent'
|
|
@@ -512,6 +513,7 @@ export const DataRightsEventAction = {
|
|
|
512
513
|
IdentityVerified: 'IdentityVerified',
|
|
513
514
|
Assigned: 'Assigned',
|
|
514
515
|
BlockingResolved: 'BlockingResolved',
|
|
516
|
+
BlockingLifted: 'BlockingLifted',
|
|
515
517
|
Extended: 'Extended',
|
|
516
518
|
Resolved: 'Resolved',
|
|
517
519
|
ResponseSent: 'ResponseSent',
|
|
@@ -552,11 +554,12 @@ export const DataBreachNoticeMeans = {
|
|
|
552
554
|
PublicNotice: 'PublicNotice',
|
|
553
555
|
} satisfies Record<string, DataBreachNoticeMeans>;
|
|
554
556
|
|
|
555
|
-
export type DeskFileSource = 'Upload' | 'Scan';
|
|
557
|
+
export type DeskFileSource = 'Upload' | 'Scan' | 'Email';
|
|
556
558
|
|
|
557
559
|
export const DeskFileSource = {
|
|
558
560
|
Upload: 'Upload',
|
|
559
561
|
Scan: 'Scan',
|
|
562
|
+
Email: 'Email',
|
|
560
563
|
} satisfies Record<string, DeskFileSource>;
|
|
561
564
|
|
|
562
565
|
export type DeskFileTarget = 'Document' | 'CaseFile';
|
|
@@ -566,6 +569,22 @@ export const DeskFileTarget = {
|
|
|
566
569
|
CaseFile: 'CaseFile',
|
|
567
570
|
} satisfies Record<string, DeskFileTarget>;
|
|
568
571
|
|
|
572
|
+
export type MailIntakeStatus = 'Pending' | 'Accepted' | 'Discarded';
|
|
573
|
+
|
|
574
|
+
export const MailIntakeStatus = {
|
|
575
|
+
Pending: 'Pending',
|
|
576
|
+
Accepted: 'Accepted',
|
|
577
|
+
Discarded: 'Discarded',
|
|
578
|
+
} satisfies Record<string, MailIntakeStatus>;
|
|
579
|
+
|
|
580
|
+
export type MailAuthentication = 'Pass' | 'Fail' | 'Unknown';
|
|
581
|
+
|
|
582
|
+
export const MailAuthentication = {
|
|
583
|
+
Pass: 'Pass',
|
|
584
|
+
Fail: 'Fail',
|
|
585
|
+
Unknown: 'Unknown',
|
|
586
|
+
} satisfies Record<string, MailAuthentication>;
|
|
587
|
+
|
|
569
588
|
export interface DocumentTypeEntity {
|
|
570
589
|
id: string;
|
|
571
590
|
name: string;
|
|
@@ -1348,6 +1367,8 @@ export interface DataRightsRequestEntity {
|
|
|
1348
1367
|
blockingGranted?: boolean | null;
|
|
1349
1368
|
blockingResolvedAt?: string | null;
|
|
1350
1369
|
blockingNote?: string | null;
|
|
1370
|
+
blockingLiftedAt?: string | null;
|
|
1371
|
+
blockingLiftNote?: string | null;
|
|
1351
1372
|
assigneeEmployeeId?: string | null;
|
|
1352
1373
|
assigneeFullName?: string | null;
|
|
1353
1374
|
resolution?: DataRightsResolution | null;
|
|
@@ -1437,6 +1458,44 @@ export interface DeskFileEntity {
|
|
|
1437
1458
|
targetId?: string | null;
|
|
1438
1459
|
targetLabel?: string | null;
|
|
1439
1460
|
removedAt?: string | null;
|
|
1461
|
+
mailIntake?: MailIntakeEntity | null;
|
|
1462
|
+
mailIntakeId?: string | null;
|
|
1463
|
+
createdAt: string;
|
|
1464
|
+
updatedAt: string;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
export interface MailIntakeEntity {
|
|
1468
|
+
id: string;
|
|
1469
|
+
sha256: string;
|
|
1470
|
+
messageId?: string | null;
|
|
1471
|
+
fromAddress: string;
|
|
1472
|
+
fromName?: string | null;
|
|
1473
|
+
subject: string;
|
|
1474
|
+
textPreview?: string | null;
|
|
1475
|
+
sentAt?: string | null;
|
|
1476
|
+
emlFileId: string;
|
|
1477
|
+
emlFileName: string;
|
|
1478
|
+
size: number;
|
|
1479
|
+
attachments: JsonValue;
|
|
1480
|
+
authentication: MailAuthentication;
|
|
1481
|
+
authDetail?: string | null;
|
|
1482
|
+
status: MailIntakeStatus;
|
|
1483
|
+
resolvedAt?: string | null;
|
|
1484
|
+
resolvedByEmployeeId?: string | null;
|
|
1485
|
+
deskFiles?: DeskFileEntity[];
|
|
1486
|
+
createdAt: string;
|
|
1487
|
+
updatedAt: string;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export interface PushSubscriptionEntity {
|
|
1491
|
+
id: string;
|
|
1492
|
+
employeeId: string;
|
|
1493
|
+
endpoint: string;
|
|
1494
|
+
p256dh: string;
|
|
1495
|
+
auth: string;
|
|
1496
|
+
userAgent?: string | null;
|
|
1497
|
+
lastSuccessAt?: string | null;
|
|
1498
|
+
failures: number;
|
|
1440
1499
|
createdAt: string;
|
|
1441
1500
|
updatedAt: string;
|
|
1442
1501
|
}
|
|
@@ -83,6 +83,8 @@ export type DataRightsAction =
|
|
|
83
83
|
| { type: 'assign'; employeeId: string; fullName: string; note?: string | null }
|
|
84
84
|
/** Bloqueo temporal, en 2 días hábiles; si se rechaza, fundado (y se comunica a la Agencia). */
|
|
85
85
|
| { type: 'resolveBlocking'; granted: boolean; note?: string | null }
|
|
86
|
+
/** Levanta el bloqueo concedido (también después de responder): esos datos se vuelven a tratar. */
|
|
87
|
+
| { type: 'liftBlocking'; note?: string | null }
|
|
86
88
|
| { type: 'extend'; note: string }
|
|
87
89
|
| {
|
|
88
90
|
type: 'resolve';
|
|
@@ -22,7 +22,11 @@ export const DeskPatterns = {
|
|
|
22
22
|
export interface DeskContract {
|
|
23
23
|
/** Los archivos sin clasificar de quien tiene la sesión, del más reciente al más antiguo. */
|
|
24
24
|
[DeskPatterns.getFiles]: { payload: { actor: DocumentActor }; response: DeskFileResponseEntity[] };
|
|
25
|
-
|
|
25
|
+
/** `email`, el correo institucional de la sesión, cuenta también los correos que esperan que elija sus adjuntos. */
|
|
26
|
+
[DeskPatterns.getSummary]: {
|
|
27
|
+
payload: { email?: string | null; actor: DocumentActor };
|
|
28
|
+
response: DeskSummaryEntity;
|
|
29
|
+
};
|
|
26
30
|
/** Archivos ya subidos a la carpeta del gestor (por el gateway), que quedan en el escritorio. */
|
|
27
31
|
[DeskPatterns.addFiles]: {
|
|
28
32
|
payload: {
|
package/src/contracts/index.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { AccessRequestPatterns, type AccessRequestContract } from './accessReque
|
|
|
14
14
|
import { TransparencyPatterns, type TransparencyContract } from './transparency.contract';
|
|
15
15
|
import { DataProtectionPatterns, type DataProtectionContract } from './dataProtection.contract';
|
|
16
16
|
import { DeskPatterns, type DeskContract } from './desk.contract';
|
|
17
|
+
import { MailIntakePatterns, type MailIntakeContract } from './mailIntake.contract';
|
|
18
|
+
import { PushPatterns, type PushContract } from './push.contract';
|
|
17
19
|
import { ScanPatterns, type ScanContract } from './scan.contract';
|
|
18
20
|
import { PartsOfficePatterns, type PartsOfficeContract } from './partsOffice.contract';
|
|
19
21
|
import { ProcedurePatterns, type ProcedureContract } from './procedure.contract';
|
|
@@ -44,6 +46,8 @@ export * from './accessRequest.contract';
|
|
|
44
46
|
export * from './transparency.contract';
|
|
45
47
|
export * from './dataProtection.contract';
|
|
46
48
|
export * from './desk.contract';
|
|
49
|
+
export * from './mailIntake.contract';
|
|
50
|
+
export * from './push.contract';
|
|
47
51
|
|
|
48
52
|
/** Patrones NATS de gestor-documental-ms, por recurso: `gestorDocumental.<recurso>.<acción>`. */
|
|
49
53
|
export const GestorDocumentalPatterns = {
|
|
@@ -69,6 +73,8 @@ export const GestorDocumentalPatterns = {
|
|
|
69
73
|
transparency: TransparencyPatterns,
|
|
70
74
|
dataProtection: DataProtectionPatterns,
|
|
71
75
|
desk: DeskPatterns,
|
|
76
|
+
mailIntake: MailIntakePatterns,
|
|
77
|
+
push: PushPatterns,
|
|
72
78
|
} as const;
|
|
73
79
|
|
|
74
80
|
/** Contrato completo de gestor-documental-ms: la unión de los contratos de sus recursos. */
|
|
@@ -93,4 +99,6 @@ export type GestorDocumentalContract = DocumentTypeContract &
|
|
|
93
99
|
AccessRequestContract &
|
|
94
100
|
TransparencyContract &
|
|
95
101
|
DataProtectionContract &
|
|
96
|
-
DeskContract
|
|
102
|
+
DeskContract &
|
|
103
|
+
MailIntakeContract &
|
|
104
|
+
PushContract;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type DeskFileResponseEntity,
|
|
3
|
+
type DeskOkResponseEntity,
|
|
4
|
+
type DocumentPublicFileResponseEntity,
|
|
5
|
+
type MailIntakeInboxEntity,
|
|
6
|
+
type MailIntakeSyncEntity,
|
|
7
|
+
} from '../entities';
|
|
8
|
+
import { type DocumentActor } from './document.contract';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Patrones NATS de `mailIntake`: el ingreso por correo. Un funcionario reenvía un correo a la casilla del gestor y
|
|
12
|
+
* después elige qué adjuntos entran a su escritorio. `email` es el correo institucional de la sesión, que agrega el
|
|
13
|
+
* gateway: solo con él se ven los correos que envió.
|
|
14
|
+
*/
|
|
15
|
+
export const MailIntakePatterns = {
|
|
16
|
+
getMine: 'gestorDocumental.mailIntake.getMine',
|
|
17
|
+
accept: 'gestorDocumental.mailIntake.accept',
|
|
18
|
+
discard: 'gestorDocumental.mailIntake.discard',
|
|
19
|
+
getEml: 'gestorDocumental.mailIntake.getEml',
|
|
20
|
+
sync: 'gestorDocumental.mailIntake.sync',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
export interface MailIntakeContract {
|
|
24
|
+
/** Los correos pendientes que envió quien tiene la sesión, del más reciente al más antiguo. */
|
|
25
|
+
[MailIntakePatterns.getMine]: {
|
|
26
|
+
payload: { email: string | null; actor: DocumentActor };
|
|
27
|
+
response: MailIntakeInboxEntity;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Lleva al escritorio los adjuntos elegidos (por su `index`) y, si se pide, el correo completo en EML. El correo
|
|
31
|
+
* queda aceptado: no se puede volver a procesar.
|
|
32
|
+
*/
|
|
33
|
+
[MailIntakePatterns.accept]: {
|
|
34
|
+
payload: { id: string; email: string | null; attachments: number[]; includeEml: boolean; actor: DocumentActor };
|
|
35
|
+
response: DeskFileResponseEntity[];
|
|
36
|
+
};
|
|
37
|
+
/** Lo descarta sin traer nada. El EML se conserva. */
|
|
38
|
+
[MailIntakePatterns.discard]: {
|
|
39
|
+
payload: { id: string; email: string | null; actor: DocumentActor };
|
|
40
|
+
response: DeskOkResponseEntity;
|
|
41
|
+
};
|
|
42
|
+
/** El correo completo (EML), para su remitente. */
|
|
43
|
+
[MailIntakePatterns.getEml]: {
|
|
44
|
+
payload: { id: string; email: string | null; actor: DocumentActor };
|
|
45
|
+
response: DocumentPublicFileResponseEntity;
|
|
46
|
+
};
|
|
47
|
+
/** Revisa la casilla ahora, sin esperar a la revisión periódica. */
|
|
48
|
+
[MailIntakePatterns.sync]: { payload: Record<string, never>; response: MailIntakeSyncEntity };
|
|
49
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type PushConfigResponseEntity,
|
|
3
|
+
type PushNotificationInput,
|
|
4
|
+
type PushOkResponseEntity,
|
|
5
|
+
type PushSendResultEntity,
|
|
6
|
+
} from '../entities';
|
|
7
|
+
import { type DocumentActor } from './document.contract';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Patrones NATS de `push`: avisos en el celular o el computador (Web Push), además del correo. Cada funcionario los
|
|
11
|
+
* activa en sus dispositivos; el gateway los envía junto con los correos de aviso.
|
|
12
|
+
*/
|
|
13
|
+
export const PushPatterns = {
|
|
14
|
+
getConfig: 'gestorDocumental.push.getConfig',
|
|
15
|
+
subscribe: 'gestorDocumental.push.subscribe',
|
|
16
|
+
unsubscribe: 'gestorDocumental.push.unsubscribe',
|
|
17
|
+
test: 'gestorDocumental.push.test',
|
|
18
|
+
send: 'gestorDocumental.push.send',
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
export interface PushContract {
|
|
22
|
+
[PushPatterns.getConfig]: { payload: { actor: DocumentActor }; response: PushConfigResponseEntity };
|
|
23
|
+
/** Registra el dispositivo (o lo actualiza, si ya estaba) a nombre de quien tiene la sesión. */
|
|
24
|
+
[PushPatterns.subscribe]: {
|
|
25
|
+
payload: {
|
|
26
|
+
subscription: { endpoint: string; keys: { p256dh: string; auth: string } };
|
|
27
|
+
userAgent?: string | null;
|
|
28
|
+
actor: DocumentActor;
|
|
29
|
+
};
|
|
30
|
+
response: PushOkResponseEntity;
|
|
31
|
+
};
|
|
32
|
+
/** Quita el dispositivo, solo si es de quien tiene la sesión. */
|
|
33
|
+
[PushPatterns.unsubscribe]: { payload: { endpoint: string; actor: DocumentActor }; response: PushOkResponseEntity };
|
|
34
|
+
/** Un aviso de prueba a los dispositivos de quien tiene la sesión. */
|
|
35
|
+
[PushPatterns.test]: { payload: { actor: DocumentActor }; response: PushSendResultEntity };
|
|
36
|
+
/** Envía un aviso a los dispositivos de esos funcionarios. Lo usa el gateway, no el navegador. */
|
|
37
|
+
[PushPatterns.send]: {
|
|
38
|
+
payload: { employeeIds: string[]; notification: PushNotificationInput };
|
|
39
|
+
response: PushSendResultEntity;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -66,6 +66,8 @@ export interface DataRightsRequestListItemEntity {
|
|
|
66
66
|
identityVerified: boolean;
|
|
67
67
|
/** Bloqueo temporal pedido y sin resolver. */
|
|
68
68
|
blockingPending: boolean;
|
|
69
|
+
/** Bloqueo temporal concedido y todavía no levantado: esos datos no se tratan. */
|
|
70
|
+
blockingActive: boolean;
|
|
69
71
|
/** Solo mientras está abierta. */
|
|
70
72
|
dueStatus: DataRightsDueStatus | null;
|
|
71
73
|
daysLeft: number | null;
|
|
@@ -97,6 +99,8 @@ export interface DataRightsRequestDetailEntity extends DataRightsRequestListItem
|
|
|
97
99
|
blockingGranted: boolean | null;
|
|
98
100
|
blockingResolvedAt: string | null;
|
|
99
101
|
blockingNote: string | null;
|
|
102
|
+
blockingLiftedAt: string | null;
|
|
103
|
+
blockingLiftNote: string | null;
|
|
100
104
|
assigneeEmployeeId: string | null;
|
|
101
105
|
resolvedAt: string | null;
|
|
102
106
|
denialGrounds: string[];
|
|
@@ -127,6 +131,8 @@ export interface DataRightsSummaryEntity {
|
|
|
127
131
|
unacknowledged: number;
|
|
128
132
|
/** Bloqueos temporales pedidos y sin resolver. */
|
|
129
133
|
blockingPending: number;
|
|
134
|
+
/** Bloqueos temporales concedidos y no levantados, de cualquier año. */
|
|
135
|
+
blockingActive: number;
|
|
130
136
|
byRight: Record<DataRight, number>;
|
|
131
137
|
resolved: Record<DataRightsResolution, number>;
|
|
132
138
|
/** Respondidas dentro del plazo sobre las respondidas, en %. */
|
|
@@ -8,6 +8,8 @@ export interface DeskFileResponseEntity {
|
|
|
8
8
|
sha256: string;
|
|
9
9
|
source: DeskFileSource;
|
|
10
10
|
description: string | null;
|
|
11
|
+
/** Correo del que salió, si llegó por correo. */
|
|
12
|
+
mailIntakeId: string | null;
|
|
11
13
|
/** Es un PDF: se puede redactar una comunicación con él o firmarlo como documento suelto. */
|
|
12
14
|
isPdf: boolean;
|
|
13
15
|
createdAt: string;
|
|
@@ -16,6 +18,8 @@ export interface DeskFileResponseEntity {
|
|
|
16
18
|
export interface DeskSummaryEntity {
|
|
17
19
|
/** Archivos del escritorio aún sin clasificar. */
|
|
18
20
|
unclassified: number;
|
|
21
|
+
/** Correos reenviados a la casilla del gestor que esperan que elija sus adjuntos. */
|
|
22
|
+
pendingMails: number;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
export interface DeskOkResponseEntity {
|
package/src/entities/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './mailIntake.entity';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type MailAuthentication } from '../../base/entities';
|
|
2
|
+
|
|
3
|
+
/** Adjunto de un correo recibido. `index` lo identifica al elegir qué entra al escritorio. */
|
|
4
|
+
export interface MailIntakeAttachmentEntity {
|
|
5
|
+
index: number;
|
|
6
|
+
fileName: string;
|
|
7
|
+
contentType: string;
|
|
8
|
+
size: number;
|
|
9
|
+
sha256: string;
|
|
10
|
+
/** Su tipo de archivo puede entrar al escritorio (PDF, documentos de oficina, imágenes). */
|
|
11
|
+
supported: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Correo reenviado a la casilla del gestor, a la espera de que su remitente elija qué adjuntos entran. */
|
|
15
|
+
export interface MailIntakeItemEntity {
|
|
16
|
+
id: string;
|
|
17
|
+
fromAddress: string;
|
|
18
|
+
fromName: string | null;
|
|
19
|
+
subject: string;
|
|
20
|
+
/** Comienzo del texto del correo, para reconocerlo. */
|
|
21
|
+
textPreview: string | null;
|
|
22
|
+
/** Fecha del correo, según su remitente. */
|
|
23
|
+
sentAt: string | null;
|
|
24
|
+
/** Cuándo lo trajo el gestor desde la casilla. */
|
|
25
|
+
receivedAt: string;
|
|
26
|
+
/** Tamaño del correo completo (EML), en bytes. */
|
|
27
|
+
size: number;
|
|
28
|
+
/** Lo que informó el servidor de correo sobre el remitente: `Fail` puede ser un remitente suplantado. */
|
|
29
|
+
authentication: MailAuthentication;
|
|
30
|
+
authDetail: string | null;
|
|
31
|
+
attachments: MailIntakeAttachmentEntity[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Los correos pendientes de quien tiene la sesión y a qué casilla reenviarlos. */
|
|
35
|
+
export interface MailIntakeInboxEntity {
|
|
36
|
+
/** La casilla está configurada y se revisa. */
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
/** Dirección a la que se reenvían los correos; `null` si no está configurada. */
|
|
39
|
+
address: string | null;
|
|
40
|
+
/** Los dominios desde los que se aceptan correos (los institucionales). */
|
|
41
|
+
domains: string[];
|
|
42
|
+
mails: MailIntakeItemEntity[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Resultado de una revisión de la casilla. */
|
|
46
|
+
export interface MailIntakeSyncEntity {
|
|
47
|
+
/** Correos sin leer que se revisaron. */
|
|
48
|
+
checked: number;
|
|
49
|
+
/** Los que quedaron registrados. */
|
|
50
|
+
created: number;
|
|
51
|
+
/** Repetidos o de un dominio que no es institucional: no se guardan. */
|
|
52
|
+
ignored: number;
|
|
53
|
+
/** Los que no se pudieron procesar; se reintentan en la próxima revisión. */
|
|
54
|
+
failed: number;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './push.entity';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Si los avisos push están habilitados y con qué clave pública se suscribe el navegador. */
|
|
2
|
+
export interface PushConfigResponseEntity {
|
|
3
|
+
/** El servidor tiene sus claves VAPID: se pueden activar. */
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
/** Clave pública VAPID (base64url) para `pushManager.subscribe`; `null` si no está habilitado. */
|
|
6
|
+
publicKey: string | null;
|
|
7
|
+
/** Dispositivos en que quien consulta tiene los avisos activos. */
|
|
8
|
+
devices: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface PushOkResponseEntity {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Resultado de un envío: avisos entregados al servicio push, suscripciones vencidas que se borraron y fallas. */
|
|
16
|
+
export interface PushSendResultEntity {
|
|
17
|
+
sent: number;
|
|
18
|
+
removed: number;
|
|
19
|
+
failed: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Un aviso. `url` es una ruta del gestor (`/documentos/…/detalle`): el service worker la abre al tocar el aviso.
|
|
24
|
+
* `tag` agrupa: un aviso nuevo con el mismo `tag` reemplaza al anterior en el dispositivo.
|
|
25
|
+
*/
|
|
26
|
+
export interface PushNotificationInput {
|
|
27
|
+
title: string;
|
|
28
|
+
body: string;
|
|
29
|
+
url: string;
|
|
30
|
+
tag?: string | null;
|
|
31
|
+
}
|