@muni-sanfer/types-gestor-documental 0.0.1-beta.35 → 0.0.1-beta.37
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 +1 -0
- package/dist/contracts/caseFile.contract.d.ts +11 -1
- package/dist/contracts/caseFile.contract.js +1 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/entities/document/document.entity.d.ts +83 -0
- package/dist/entities/signatureCheck/signatureCheck.entity.d.ts +11 -0
- package/package.json +1 -1
- package/src/base/entities.ts +1 -0
- package/src/contracts/caseFile.contract.ts +11 -0
- package/src/entities/document/document.entity.ts +57 -1
- package/src/entities/signatureCheck/signatureCheck.entity.ts +12 -0
package/dist/base/entities.d.ts
CHANGED
|
@@ -660,6 +660,7 @@ export interface CaseFileEntity {
|
|
|
660
660
|
metadataChanges?: CaseFileMetadataChangeEntity[];
|
|
661
661
|
accesses?: CaseFileAccessEntity[];
|
|
662
662
|
shareLinks?: CaseFileShareLinkEntity[];
|
|
663
|
+
integratedPdf?: JsonValue | null;
|
|
663
664
|
createdAt: string;
|
|
664
665
|
updatedAt: string;
|
|
665
666
|
workFolder?: WorkFolderEntity | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CaseFileActorRelation, type CaseFileActorType, type CaseFileActuationType, type CaseFileEntity, type CaseFileStatus, type DocumentAccessLevel } from '../base/entities';
|
|
2
|
-
import { type CaseFileAddBatchResponseEntity, type CaseFileAddEntryResponseEntity, type CaseFileCreateResponseEntity, type CaseFileEntryFileResponseEntity, type CaseFileExportResponseEntity, type CaseFileGetAllResponseEntity, type CaseFileGetByIdResponseEntity, type CaseFileShareLinkCreateResponseEntity, type CaseFileShareLinkResponseEntity, type CaseFileSharedResponseEntity, type CaseFileUpdateResponseEntity, type CaseFileVerifyExportResponseEntity } from '../entities';
|
|
2
|
+
import { type CaseFileAddBatchResponseEntity, type CaseFileAddEntryResponseEntity, type CaseFileCreateResponseEntity, type CaseFileEntryFileResponseEntity, type CaseFileExportResponseEntity, type CaseFileGetAllResponseEntity, type CaseFileGetByIdResponseEntity, type CaseFileShareLinkCreateResponseEntity, type CaseFileShareLinkResponseEntity, type CaseFileSharedResponseEntity, type CaseFileUpdateResponseEntity, type CaseFileVerifyExportResponseEntity, type DocumentPublicFileResponseEntity } from '../entities';
|
|
3
3
|
import { type RpcPage } from './contract';
|
|
4
4
|
import { type DocumentActor } from './document.contract';
|
|
5
5
|
/** Patrones NATS de `caseFile`: `<servicio>.<recurso>.<acción>`. */
|
|
@@ -17,6 +17,7 @@ export declare const CaseFilePatterns: {
|
|
|
17
17
|
readonly close: "gestorDocumental.caseFile.close";
|
|
18
18
|
readonly getEntryFile: "gestorDocumental.caseFile.getEntryFile";
|
|
19
19
|
readonly getExport: "gestorDocumental.caseFile.getExport";
|
|
20
|
+
readonly getIntegratedPdf: "gestorDocumental.caseFile.getIntegratedPdf";
|
|
20
21
|
readonly createShareLink: "gestorDocumental.caseFile.createShareLink";
|
|
21
22
|
readonly getShareLinks: "gestorDocumental.caseFile.getShareLinks";
|
|
22
23
|
readonly revokeShareLink: "gestorDocumental.caseFile.revokeShareLink";
|
|
@@ -204,6 +205,15 @@ export interface CaseFileContract {
|
|
|
204
205
|
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
205
206
|
response: CaseFileExportResponseEntity;
|
|
206
207
|
};
|
|
208
|
+
/**
|
|
209
|
+
* PDF integrador: todas las actuaciones en un solo PDF, en orden de incorporación, con portada e índice. Queda en la
|
|
210
|
+
* trazabilidad y en el registro de accesos, como la exportación. Sin el sello de copia autorizada (necesita firma
|
|
211
|
+
* desatendida).
|
|
212
|
+
*/
|
|
213
|
+
[CaseFilePatterns.getIntegratedPdf]: {
|
|
214
|
+
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
215
|
+
response: DocumentPublicFileResponseEntity;
|
|
216
|
+
};
|
|
207
217
|
/** Crea un enlace temporal: solo su responsable. El token viaja solo en esta respuesta. */
|
|
208
218
|
[CaseFilePatterns.createShareLink]: {
|
|
209
219
|
payload: Pick<CaseFileEntity, 'id'> & CaseFileShareLinkPayload & {
|
|
@@ -16,6 +16,7 @@ exports.CaseFilePatterns = {
|
|
|
16
16
|
close: 'gestorDocumental.caseFile.close',
|
|
17
17
|
getEntryFile: 'gestorDocumental.caseFile.getEntryFile',
|
|
18
18
|
getExport: 'gestorDocumental.caseFile.getExport',
|
|
19
|
+
getIntegratedPdf: 'gestorDocumental.caseFile.getIntegratedPdf',
|
|
19
20
|
createShareLink: 'gestorDocumental.caseFile.createShareLink',
|
|
20
21
|
getShareLinks: 'gestorDocumental.caseFile.getShareLinks',
|
|
21
22
|
revokeShareLink: 'gestorDocumental.caseFile.revokeShareLink',
|
|
@@ -114,6 +114,7 @@ export declare const GestorDocumentalPatterns: {
|
|
|
114
114
|
readonly close: "gestorDocumental.caseFile.close";
|
|
115
115
|
readonly getEntryFile: "gestorDocumental.caseFile.getEntryFile";
|
|
116
116
|
readonly getExport: "gestorDocumental.caseFile.getExport";
|
|
117
|
+
readonly getIntegratedPdf: "gestorDocumental.caseFile.getIntegratedPdf";
|
|
117
118
|
readonly createShareLink: "gestorDocumental.caseFile.createShareLink";
|
|
118
119
|
readonly getShareLinks: "gestorDocumental.caseFile.getShareLinks";
|
|
119
120
|
readonly revokeShareLink: "gestorDocumental.caseFile.revokeShareLink";
|
|
@@ -390,6 +390,77 @@ export interface DocumentTrailExportEntity {
|
|
|
390
390
|
}
|
|
391
391
|
/** Plantilla oficial con que se redacta un documento en el sistema. */
|
|
392
392
|
export type DocumentTemplateKind = 'Decree' | 'Office' | 'Memorandum' | 'General';
|
|
393
|
+
/** Formato de un trozo de texto en el editor del gestor. */
|
|
394
|
+
export type RichMark = 'bold' | 'italic' | 'underline';
|
|
395
|
+
/**
|
|
396
|
+
* Texto con su formato, o un campo de la plantilla (`field`: su clave), que se reemplaza por su valor al armar el PDF.
|
|
397
|
+
* Un salto de línea dentro del texto (`\n`) es un salto de línea del párrafo.
|
|
398
|
+
*/
|
|
399
|
+
export type RichInline = {
|
|
400
|
+
text: string;
|
|
401
|
+
marks?: RichMark[];
|
|
402
|
+
} | {
|
|
403
|
+
field: string;
|
|
404
|
+
};
|
|
405
|
+
export type RichAlign = 'left' | 'center' | 'right' | 'justify';
|
|
406
|
+
/** Numeración de una lista: viñetas, «1.» o la de los decretos, «1.-». */
|
|
407
|
+
export type RichListStyle = 'bullet' | 'decimal' | 'decree';
|
|
408
|
+
/**
|
|
409
|
+
* Cómo se ve una tabla: con bordes (`grid`), o como las líneas «DE:», «A:», «MAT.:» de un oficio, con la etiqueta en
|
|
410
|
+
* negrita y sin bordes (`labels`, o `labelsRight`, en la mitad derecha, como «ANT.» y «MAT.» de un oficio).
|
|
411
|
+
*/
|
|
412
|
+
export type RichTableVariant = 'grid' | 'labels' | 'labelsRight';
|
|
413
|
+
/**
|
|
414
|
+
* Un bloque del texto. Los de una plantilla pueden ser fijos (`locked`): quien redacta no los cambia. Las listas son
|
|
415
|
+
* bloques seguidos del mismo estilo (su nivel es la sangría, desde 0); un título o un párrafo reinicia la numeración.
|
|
416
|
+
*/
|
|
417
|
+
export type RichBlock = {
|
|
418
|
+
id: string;
|
|
419
|
+
type: 'paragraph';
|
|
420
|
+
align?: RichAlign;
|
|
421
|
+
locked?: boolean;
|
|
422
|
+
content: RichInline[];
|
|
423
|
+
} | {
|
|
424
|
+
id: string;
|
|
425
|
+
type: 'heading';
|
|
426
|
+
level: 1 | 2;
|
|
427
|
+
align?: RichAlign;
|
|
428
|
+
locked?: boolean;
|
|
429
|
+
content: RichInline[];
|
|
430
|
+
} | {
|
|
431
|
+
id: string;
|
|
432
|
+
type: 'listItem';
|
|
433
|
+
list: RichListStyle;
|
|
434
|
+
level: number;
|
|
435
|
+
locked?: boolean;
|
|
436
|
+
content: RichInline[];
|
|
437
|
+
}
|
|
438
|
+
/** `rows[fila][columna]`: el contenido de cada celda. */
|
|
439
|
+
| {
|
|
440
|
+
id: string;
|
|
441
|
+
type: 'table';
|
|
442
|
+
variant: RichTableVariant;
|
|
443
|
+
locked?: boolean;
|
|
444
|
+
rows: RichInline[][][];
|
|
445
|
+
} | {
|
|
446
|
+
id: string;
|
|
447
|
+
type: 'rule';
|
|
448
|
+
locked?: boolean;
|
|
449
|
+
} | {
|
|
450
|
+
id: string;
|
|
451
|
+
type: 'pageBreak';
|
|
452
|
+
locked?: boolean;
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* Campo de una plantilla, con el valor que le dio quien redacta. `materia` es el asunto del documento: no se escribe
|
|
456
|
+
* aparte.
|
|
457
|
+
*/
|
|
458
|
+
export interface RichField {
|
|
459
|
+
key: string;
|
|
460
|
+
label: string;
|
|
461
|
+
value: string;
|
|
462
|
+
required?: boolean;
|
|
463
|
+
}
|
|
393
464
|
/**
|
|
394
465
|
* Contenido de un documento redactado en el sistema. Cada plantilla tiene su estructura; los párrafos son texto
|
|
395
466
|
* (un salto de línea dentro de un párrafo se respeta). La materia es el asunto del documento.
|
|
@@ -426,6 +497,18 @@ export type DocumentComposition = {
|
|
|
426
497
|
title: string;
|
|
427
498
|
body: string[];
|
|
428
499
|
closing?: string | null;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Redactado con el editor del gestor: los bloques del texto, los campos de la plantilla con su valor y la
|
|
503
|
+
* distribución. `templateKey` y `templateVersion`: de qué plantilla salió, si salió de una.
|
|
504
|
+
*/
|
|
505
|
+
| {
|
|
506
|
+
template: 'Rich';
|
|
507
|
+
templateKey?: string | null;
|
|
508
|
+
templateVersion?: number | null;
|
|
509
|
+
blocks: RichBlock[];
|
|
510
|
+
fields: RichField[];
|
|
511
|
+
distribution: string[];
|
|
429
512
|
};
|
|
430
513
|
/** PDF armado con una plantilla: para la vista previa (`contentBase64`) o ya subido (`fileId`). */
|
|
431
514
|
export interface DocumentComposeResponseEntity {
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export type PdfSignatureStatus = 'Valid' | 'Invalid' | 'Indeterminate';
|
|
6
6
|
/** Una firma electrónica de un PDF, como se pudo comprobar. */
|
|
7
|
+
/** Si el certificado de una firma fue revocado, según su emisor (OCSP o lista de revocación). */
|
|
8
|
+
export interface PdfRevocationEntity {
|
|
9
|
+
/** `NotChecked`: la revisión está desactivada en el servidor. `Unknown`: no se pudo confirmar. */
|
|
10
|
+
status: 'Good' | 'Revoked' | 'Unknown' | 'NotChecked';
|
|
11
|
+
source: 'OCSP' | 'CRL' | null;
|
|
12
|
+
revokedAt: string | null;
|
|
13
|
+
/** Por qué no se pudo confirmar. */
|
|
14
|
+
detail: string | null;
|
|
15
|
+
}
|
|
7
16
|
export interface PdfSignatureEntity {
|
|
8
17
|
/** Orden en el archivo: 1 es la primera. */
|
|
9
18
|
index: number;
|
|
@@ -31,6 +40,8 @@ export interface PdfSignatureEntity {
|
|
|
31
40
|
certificateValidAtSigning: boolean | null;
|
|
32
41
|
/** Cadena hasta un certificado raíz de confianza. `null` si no hay raíces configuradas. */
|
|
33
42
|
trusted: boolean | null;
|
|
43
|
+
/** Si el certificado fue revocado. Falta en las revisiones anteriores a que se consultara. */
|
|
44
|
+
revocation?: PdfRevocationEntity;
|
|
34
45
|
status: PdfSignatureStatus;
|
|
35
46
|
/** Lo que no cuadra o no se pudo confirmar, en palabras. */
|
|
36
47
|
problems: string[];
|
package/package.json
CHANGED
package/src/base/entities.ts
CHANGED
|
@@ -864,6 +864,7 @@ export interface CaseFileEntity {
|
|
|
864
864
|
metadataChanges?: CaseFileMetadataChangeEntity[];
|
|
865
865
|
accesses?: CaseFileAccessEntity[];
|
|
866
866
|
shareLinks?: CaseFileShareLinkEntity[];
|
|
867
|
+
integratedPdf?: JsonValue | null;
|
|
867
868
|
createdAt: string;
|
|
868
869
|
updatedAt: string;
|
|
869
870
|
workFolder?: WorkFolderEntity | null;
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type CaseFileSharedResponseEntity,
|
|
20
20
|
type CaseFileUpdateResponseEntity,
|
|
21
21
|
type CaseFileVerifyExportResponseEntity,
|
|
22
|
+
type DocumentPublicFileResponseEntity,
|
|
22
23
|
} from '../entities';
|
|
23
24
|
import { type RpcPage } from './contract';
|
|
24
25
|
import { type DocumentActor } from './document.contract';
|
|
@@ -38,6 +39,7 @@ export const CaseFilePatterns = {
|
|
|
38
39
|
close: 'gestorDocumental.caseFile.close',
|
|
39
40
|
getEntryFile: 'gestorDocumental.caseFile.getEntryFile',
|
|
40
41
|
getExport: 'gestorDocumental.caseFile.getExport',
|
|
42
|
+
getIntegratedPdf: 'gestorDocumental.caseFile.getIntegratedPdf',
|
|
41
43
|
createShareLink: 'gestorDocumental.caseFile.createShareLink',
|
|
42
44
|
getShareLinks: 'gestorDocumental.caseFile.getShareLinks',
|
|
43
45
|
revokeShareLink: 'gestorDocumental.caseFile.revokeShareLink',
|
|
@@ -189,6 +191,15 @@ export interface CaseFileContract {
|
|
|
189
191
|
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
190
192
|
response: CaseFileExportResponseEntity;
|
|
191
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* PDF integrador: todas las actuaciones en un solo PDF, en orden de incorporación, con portada e índice. Queda en la
|
|
196
|
+
* trazabilidad y en el registro de accesos, como la exportación. Sin el sello de copia autorizada (necesita firma
|
|
197
|
+
* desatendida).
|
|
198
|
+
*/
|
|
199
|
+
[CaseFilePatterns.getIntegratedPdf]: {
|
|
200
|
+
payload: Pick<CaseFileEntity, 'id'> & CaseFileActorPayload;
|
|
201
|
+
response: DocumentPublicFileResponseEntity;
|
|
202
|
+
};
|
|
192
203
|
/** Crea un enlace temporal: solo su responsable. El token viaja solo en esta respuesta. */
|
|
193
204
|
[CaseFilePatterns.createShareLink]: {
|
|
194
205
|
payload: Pick<CaseFileEntity, 'id'> & CaseFileShareLinkPayload & { actor: DocumentActor };
|
|
@@ -439,6 +439,50 @@ export interface DocumentTrailExportEntity {
|
|
|
439
439
|
/** Plantilla oficial con que se redacta un documento en el sistema. */
|
|
440
440
|
export type DocumentTemplateKind = 'Decree' | 'Office' | 'Memorandum' | 'General';
|
|
441
441
|
|
|
442
|
+
/** Formato de un trozo de texto en el editor del gestor. */
|
|
443
|
+
export type RichMark = 'bold' | 'italic' | 'underline';
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Texto con su formato, o un campo de la plantilla (`field`: su clave), que se reemplaza por su valor al armar el PDF.
|
|
447
|
+
* Un salto de línea dentro del texto (`\n`) es un salto de línea del párrafo.
|
|
448
|
+
*/
|
|
449
|
+
export type RichInline = { text: string; marks?: RichMark[] } | { field: string };
|
|
450
|
+
|
|
451
|
+
export type RichAlign = 'left' | 'center' | 'right' | 'justify';
|
|
452
|
+
|
|
453
|
+
/** Numeración de una lista: viñetas, «1.» o la de los decretos, «1.-». */
|
|
454
|
+
export type RichListStyle = 'bullet' | 'decimal' | 'decree';
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Cómo se ve una tabla: con bordes (`grid`), o como las líneas «DE:», «A:», «MAT.:» de un oficio, con la etiqueta en
|
|
458
|
+
* negrita y sin bordes (`labels`, o `labelsRight`, en la mitad derecha, como «ANT.» y «MAT.» de un oficio).
|
|
459
|
+
*/
|
|
460
|
+
export type RichTableVariant = 'grid' | 'labels' | 'labelsRight';
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Un bloque del texto. Los de una plantilla pueden ser fijos (`locked`): quien redacta no los cambia. Las listas son
|
|
464
|
+
* bloques seguidos del mismo estilo (su nivel es la sangría, desde 0); un título o un párrafo reinicia la numeración.
|
|
465
|
+
*/
|
|
466
|
+
export type RichBlock =
|
|
467
|
+
| { id: string; type: 'paragraph'; align?: RichAlign; locked?: boolean; content: RichInline[] }
|
|
468
|
+
| { id: string; type: 'heading'; level: 1 | 2; align?: RichAlign; locked?: boolean; content: RichInline[] }
|
|
469
|
+
| { id: string; type: 'listItem'; list: RichListStyle; level: number; locked?: boolean; content: RichInline[] }
|
|
470
|
+
/** `rows[fila][columna]`: el contenido de cada celda. */
|
|
471
|
+
| { id: string; type: 'table'; variant: RichTableVariant; locked?: boolean; rows: RichInline[][][] }
|
|
472
|
+
| { id: string; type: 'rule'; locked?: boolean }
|
|
473
|
+
| { id: string; type: 'pageBreak'; locked?: boolean };
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Campo de una plantilla, con el valor que le dio quien redacta. `materia` es el asunto del documento: no se escribe
|
|
477
|
+
* aparte.
|
|
478
|
+
*/
|
|
479
|
+
export interface RichField {
|
|
480
|
+
key: string;
|
|
481
|
+
label: string;
|
|
482
|
+
value: string;
|
|
483
|
+
required?: boolean;
|
|
484
|
+
}
|
|
485
|
+
|
|
442
486
|
/**
|
|
443
487
|
* Contenido de un documento redactado en el sistema. Cada plantilla tiene su estructura; los párrafos son texto
|
|
444
488
|
* (un salto de línea dentro de un párrafo se respeta). La materia es el asunto del documento.
|
|
@@ -474,7 +518,19 @@ export type DocumentComposition =
|
|
|
474
518
|
closing?: string | null;
|
|
475
519
|
distribution: string[];
|
|
476
520
|
}
|
|
477
|
-
| { template: 'General'; title: string; body: string[]; closing?: string | null }
|
|
521
|
+
| { template: 'General'; title: string; body: string[]; closing?: string | null }
|
|
522
|
+
/**
|
|
523
|
+
* Redactado con el editor del gestor: los bloques del texto, los campos de la plantilla con su valor y la
|
|
524
|
+
* distribución. `templateKey` y `templateVersion`: de qué plantilla salió, si salió de una.
|
|
525
|
+
*/
|
|
526
|
+
| {
|
|
527
|
+
template: 'Rich';
|
|
528
|
+
templateKey?: string | null;
|
|
529
|
+
templateVersion?: number | null;
|
|
530
|
+
blocks: RichBlock[];
|
|
531
|
+
fields: RichField[];
|
|
532
|
+
distribution: string[];
|
|
533
|
+
};
|
|
478
534
|
|
|
479
535
|
/** PDF armado con una plantilla: para la vista previa (`contentBase64`) o ya subido (`fileId`). */
|
|
480
536
|
export interface DocumentComposeResponseEntity {
|
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
export type PdfSignatureStatus = 'Valid' | 'Invalid' | 'Indeterminate';
|
|
6
6
|
|
|
7
7
|
/** Una firma electrónica de un PDF, como se pudo comprobar. */
|
|
8
|
+
/** Si el certificado de una firma fue revocado, según su emisor (OCSP o lista de revocación). */
|
|
9
|
+
export interface PdfRevocationEntity {
|
|
10
|
+
/** `NotChecked`: la revisión está desactivada en el servidor. `Unknown`: no se pudo confirmar. */
|
|
11
|
+
status: 'Good' | 'Revoked' | 'Unknown' | 'NotChecked';
|
|
12
|
+
source: 'OCSP' | 'CRL' | null;
|
|
13
|
+
revokedAt: string | null;
|
|
14
|
+
/** Por qué no se pudo confirmar. */
|
|
15
|
+
detail: string | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
export interface PdfSignatureEntity {
|
|
9
19
|
/** Orden en el archivo: 1 es la primera. */
|
|
10
20
|
index: number;
|
|
@@ -32,6 +42,8 @@ export interface PdfSignatureEntity {
|
|
|
32
42
|
certificateValidAtSigning: boolean | null;
|
|
33
43
|
/** Cadena hasta un certificado raíz de confianza. `null` si no hay raíces configuradas. */
|
|
34
44
|
trusted: boolean | null;
|
|
45
|
+
/** Si el certificado fue revocado. Falta en las revisiones anteriores a que se consultara. */
|
|
46
|
+
revocation?: PdfRevocationEntity;
|
|
35
47
|
status: PdfSignatureStatus;
|
|
36
48
|
/** Lo que no cuadra o no se pudo confirmar, en palabras. */
|
|
37
49
|
problems: string[];
|