@muni-sanfer/types-gestor-documental 0.0.1-beta.33 → 0.0.1-beta.35
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 +52 -1
- package/dist/base/entities.js +12 -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/caseFile/caseFile.entity.d.ts +2 -0
- package/dist/entities/desk/desk.entity.d.ts +4 -0
- package/dist/entities/document/document.entity.d.ts +5 -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 +58 -1
- 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/caseFile/caseFile.entity.ts +2 -0
- package/src/entities/desk/desk.entity.ts +4 -0
- package/src/entities/document/document.entity.ts +5 -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
|
@@ -370,16 +370,29 @@ export declare const DataBreachNoticeMeans: {
|
|
|
370
370
|
Individual: "Individual";
|
|
371
371
|
PublicNotice: "PublicNotice";
|
|
372
372
|
};
|
|
373
|
-
export type DeskFileSource = 'Upload' | 'Scan';
|
|
373
|
+
export type DeskFileSource = 'Upload' | 'Scan' | 'Email';
|
|
374
374
|
export declare const DeskFileSource: {
|
|
375
375
|
Upload: "Upload";
|
|
376
376
|
Scan: "Scan";
|
|
377
|
+
Email: "Email";
|
|
377
378
|
};
|
|
378
379
|
export type DeskFileTarget = 'Document' | 'CaseFile';
|
|
379
380
|
export declare const DeskFileTarget: {
|
|
380
381
|
Document: "Document";
|
|
381
382
|
CaseFile: "CaseFile";
|
|
382
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
|
+
};
|
|
383
396
|
export interface DocumentTypeEntity {
|
|
384
397
|
id: string;
|
|
385
398
|
name: string;
|
|
@@ -448,6 +461,7 @@ export interface DocumentEntity {
|
|
|
448
461
|
originalFileName: string;
|
|
449
462
|
currentFileId?: string | null;
|
|
450
463
|
currentFileUrl?: string | null;
|
|
464
|
+
fileFormat?: string | null;
|
|
451
465
|
submittedAt?: string | null;
|
|
452
466
|
finishedAt?: string | null;
|
|
453
467
|
documentType?: DocumentTypeEntity;
|
|
@@ -696,6 +710,7 @@ export interface CaseFileEntryEntity {
|
|
|
696
710
|
sha256?: string | null;
|
|
697
711
|
size?: number | null;
|
|
698
712
|
hasAdvancedSignature: boolean;
|
|
713
|
+
fileFormat?: string | null;
|
|
699
714
|
signatureCheck?: JsonValue | null;
|
|
700
715
|
incorporatedByEmployeeId: string;
|
|
701
716
|
incorporatedByFullName: string;
|
|
@@ -1206,6 +1221,42 @@ export interface DeskFileEntity {
|
|
|
1206
1221
|
targetId?: string | null;
|
|
1207
1222
|
targetLabel?: string | null;
|
|
1208
1223
|
removedAt?: string | null;
|
|
1224
|
+
mailIntake?: MailIntakeEntity | null;
|
|
1225
|
+
mailIntakeId?: string | null;
|
|
1226
|
+
createdAt: string;
|
|
1227
|
+
updatedAt: string;
|
|
1228
|
+
}
|
|
1229
|
+
export interface MailIntakeEntity {
|
|
1230
|
+
id: string;
|
|
1231
|
+
sha256: string;
|
|
1232
|
+
messageId?: string | null;
|
|
1233
|
+
fromAddress: string;
|
|
1234
|
+
fromName?: string | null;
|
|
1235
|
+
subject: string;
|
|
1236
|
+
textPreview?: string | null;
|
|
1237
|
+
sentAt?: string | null;
|
|
1238
|
+
emlFileId: string;
|
|
1239
|
+
emlFileName: string;
|
|
1240
|
+
size: number;
|
|
1241
|
+
attachments: JsonValue;
|
|
1242
|
+
authentication: MailAuthentication;
|
|
1243
|
+
authDetail?: string | null;
|
|
1244
|
+
status: MailIntakeStatus;
|
|
1245
|
+
resolvedAt?: string | null;
|
|
1246
|
+
resolvedByEmployeeId?: string | null;
|
|
1247
|
+
deskFiles?: DeskFileEntity[];
|
|
1248
|
+
createdAt: string;
|
|
1249
|
+
updatedAt: string;
|
|
1250
|
+
}
|
|
1251
|
+
export interface PushSubscriptionEntity {
|
|
1252
|
+
id: string;
|
|
1253
|
+
employeeId: string;
|
|
1254
|
+
endpoint: string;
|
|
1255
|
+
p256dh: string;
|
|
1256
|
+
auth: string;
|
|
1257
|
+
userAgent?: string | null;
|
|
1258
|
+
lastSuccessAt?: string | null;
|
|
1259
|
+
failures: number;
|
|
1209
1260
|
createdAt: string;
|
|
1210
1261
|
updatedAt: string;
|
|
1211
1262
|
}
|
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',
|
|
@@ -329,8 +330,19 @@ exports.DataBreachNoticeMeans = {
|
|
|
329
330
|
exports.DeskFileSource = {
|
|
330
331
|
Upload: 'Upload',
|
|
331
332
|
Scan: 'Scan',
|
|
333
|
+
Email: 'Email',
|
|
332
334
|
};
|
|
333
335
|
exports.DeskFileTarget = {
|
|
334
336
|
Document: 'Document',
|
|
335
337
|
CaseFile: 'CaseFile',
|
|
336
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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -59,6 +59,8 @@ export interface CaseFileEntryResponseEntity {
|
|
|
59
59
|
sha256: CaseFileEntryEntity['sha256'];
|
|
60
60
|
size: CaseFileEntryEntity['size'];
|
|
61
61
|
hasAdvancedSignature: CaseFileEntryEntity['hasAdvancedSignature'];
|
|
62
|
+
/** Conformidad PDF/A que declara el archivo («PDF/A-2B»), «PDF», o `null` si no es un PDF o no se revisó. */
|
|
63
|
+
fileFormat: CaseFileEntryEntity['fileFormat'];
|
|
62
64
|
/** Revisión de sus firmas al incorporarlo, en los archivos externos en PDF. */
|
|
63
65
|
signatureCheck: PdfSignatureReportEntity | null;
|
|
64
66
|
incorporatedByEmployeeId: CaseFileEntryEntity['incorporatedByEmployeeId'];
|
|
@@ -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;
|
|
@@ -139,6 +139,11 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
139
139
|
keywords: DocumentEntity['keywords'];
|
|
140
140
|
accessLevel: DocumentEntity['accessLevel'];
|
|
141
141
|
hasSensitiveData: DocumentEntity['hasSensitiveData'];
|
|
142
|
+
/**
|
|
143
|
+
* Formato del archivo vigente: la conformidad PDF/A que declara («PDF/A-2B») o «PDF». `null` si no se revisó (los
|
|
144
|
+
* documentos anteriores a esta revisión, o aún sin firmar).
|
|
145
|
+
*/
|
|
146
|
+
fileFormat: DocumentEntity['fileFormat'];
|
|
142
147
|
status: DocumentEntity['status'];
|
|
143
148
|
correlative: DocumentEntity['correlative'];
|
|
144
149
|
correlativeYear: DocumentEntity['correlativeYear'];
|
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
|
@@ -554,11 +554,12 @@ export const DataBreachNoticeMeans = {
|
|
|
554
554
|
PublicNotice: 'PublicNotice',
|
|
555
555
|
} satisfies Record<string, DataBreachNoticeMeans>;
|
|
556
556
|
|
|
557
|
-
export type DeskFileSource = 'Upload' | 'Scan';
|
|
557
|
+
export type DeskFileSource = 'Upload' | 'Scan' | 'Email';
|
|
558
558
|
|
|
559
559
|
export const DeskFileSource = {
|
|
560
560
|
Upload: 'Upload',
|
|
561
561
|
Scan: 'Scan',
|
|
562
|
+
Email: 'Email',
|
|
562
563
|
} satisfies Record<string, DeskFileSource>;
|
|
563
564
|
|
|
564
565
|
export type DeskFileTarget = 'Document' | 'CaseFile';
|
|
@@ -568,6 +569,22 @@ export const DeskFileTarget = {
|
|
|
568
569
|
CaseFile: 'CaseFile',
|
|
569
570
|
} satisfies Record<string, DeskFileTarget>;
|
|
570
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
|
+
|
|
571
588
|
export interface DocumentTypeEntity {
|
|
572
589
|
id: string;
|
|
573
590
|
name: string;
|
|
@@ -637,6 +654,7 @@ export interface DocumentEntity {
|
|
|
637
654
|
originalFileName: string;
|
|
638
655
|
currentFileId?: string | null;
|
|
639
656
|
currentFileUrl?: string | null;
|
|
657
|
+
fileFormat?: string | null;
|
|
640
658
|
submittedAt?: string | null;
|
|
641
659
|
finishedAt?: string | null;
|
|
642
660
|
documentType?: DocumentTypeEntity;
|
|
@@ -899,6 +917,7 @@ export interface CaseFileEntryEntity {
|
|
|
899
917
|
sha256?: string | null;
|
|
900
918
|
size?: number | null;
|
|
901
919
|
hasAdvancedSignature: boolean;
|
|
920
|
+
fileFormat?: string | null;
|
|
902
921
|
signatureCheck?: JsonValue | null;
|
|
903
922
|
incorporatedByEmployeeId: string;
|
|
904
923
|
incorporatedByFullName: string;
|
|
@@ -1441,6 +1460,44 @@ export interface DeskFileEntity {
|
|
|
1441
1460
|
targetId?: string | null;
|
|
1442
1461
|
targetLabel?: string | null;
|
|
1443
1462
|
removedAt?: string | null;
|
|
1463
|
+
mailIntake?: MailIntakeEntity | null;
|
|
1464
|
+
mailIntakeId?: string | null;
|
|
1465
|
+
createdAt: string;
|
|
1466
|
+
updatedAt: string;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export interface MailIntakeEntity {
|
|
1470
|
+
id: string;
|
|
1471
|
+
sha256: string;
|
|
1472
|
+
messageId?: string | null;
|
|
1473
|
+
fromAddress: string;
|
|
1474
|
+
fromName?: string | null;
|
|
1475
|
+
subject: string;
|
|
1476
|
+
textPreview?: string | null;
|
|
1477
|
+
sentAt?: string | null;
|
|
1478
|
+
emlFileId: string;
|
|
1479
|
+
emlFileName: string;
|
|
1480
|
+
size: number;
|
|
1481
|
+
attachments: JsonValue;
|
|
1482
|
+
authentication: MailAuthentication;
|
|
1483
|
+
authDetail?: string | null;
|
|
1484
|
+
status: MailIntakeStatus;
|
|
1485
|
+
resolvedAt?: string | null;
|
|
1486
|
+
resolvedByEmployeeId?: string | null;
|
|
1487
|
+
deskFiles?: DeskFileEntity[];
|
|
1488
|
+
createdAt: string;
|
|
1489
|
+
updatedAt: string;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
export interface PushSubscriptionEntity {
|
|
1493
|
+
id: string;
|
|
1494
|
+
employeeId: string;
|
|
1495
|
+
endpoint: string;
|
|
1496
|
+
p256dh: string;
|
|
1497
|
+
auth: string;
|
|
1498
|
+
userAgent?: string | null;
|
|
1499
|
+
lastSuccessAt?: string | null;
|
|
1500
|
+
failures: number;
|
|
1444
1501
|
createdAt: string;
|
|
1445
1502
|
updatedAt: string;
|
|
1446
1503
|
}
|
|
@@ -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
|
+
}
|
|
@@ -73,6 +73,8 @@ export interface CaseFileEntryResponseEntity {
|
|
|
73
73
|
sha256: CaseFileEntryEntity['sha256'];
|
|
74
74
|
size: CaseFileEntryEntity['size'];
|
|
75
75
|
hasAdvancedSignature: CaseFileEntryEntity['hasAdvancedSignature'];
|
|
76
|
+
/** Conformidad PDF/A que declara el archivo («PDF/A-2B»), «PDF», o `null` si no es un PDF o no se revisó. */
|
|
77
|
+
fileFormat: CaseFileEntryEntity['fileFormat'];
|
|
76
78
|
/** Revisión de sus firmas al incorporarlo, en los archivos externos en PDF. */
|
|
77
79
|
signatureCheck: PdfSignatureReportEntity | null;
|
|
78
80
|
incorporatedByEmployeeId: CaseFileEntryEntity['incorporatedByEmployeeId'];
|
|
@@ -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 {
|
|
@@ -163,6 +163,11 @@ export interface DocumentGetByIdResponseEntity {
|
|
|
163
163
|
keywords: DocumentEntity['keywords'];
|
|
164
164
|
accessLevel: DocumentEntity['accessLevel'];
|
|
165
165
|
hasSensitiveData: DocumentEntity['hasSensitiveData'];
|
|
166
|
+
/**
|
|
167
|
+
* Formato del archivo vigente: la conformidad PDF/A que declara («PDF/A-2B») o «PDF». `null` si no se revisó (los
|
|
168
|
+
* documentos anteriores a esta revisión, o aún sin firmar).
|
|
169
|
+
*/
|
|
170
|
+
fileFormat: DocumentEntity['fileFormat'];
|
|
166
171
|
status: DocumentEntity['status'];
|
|
167
172
|
correlative: DocumentEntity['correlative'];
|
|
168
173
|
correlativeYear: DocumentEntity['correlativeYear'];
|
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
|
+
}
|