Skip to content

SudoSOS Back-end API / internal/pdf / StoredPdfService

Abstract Class: StoredPdfService<T, S, P> ​

A PdfService whose output is a record we send to people. Once stored, the PDF is frozen (#141): it is returned as-is, and only re-rendered when force is set or its hash was cleared to mark it stale.

Extends ​

Extended by ​

Type Parameters ​

Type Parameter
T extends object
S extends Pdf
P extends PdfTemplateParameters

Constructors ​

Constructor ​

ts
new StoredPdfService<T, S, P>(manager?): StoredPdfService<T, S, P>;

Parameters ​

ParameterType
manager?EntityManager

Returns ​

StoredPdfService<T, S, P>

Inherited from ​

PdfService.constructor

Properties ​

PropertyModifierTypeInherited from
locationabstractstring-
managerprotectedEntityManagerPdfService.manager
pdfConstructorabstract() => S-

Methods ​

compile() ​

ts
protected compile(params): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
paramsP

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

PdfService.compile


configureLogger() ​

ts
protected configureLogger(logger): void;

Parameters ​

ParameterType
loggerLogger

Returns ​

void

Inherited from ​

PdfService.configureLogger


getOrCreate() ​

ts
getOrCreate(entity, force?): Promise<S>;

Parameters ​

ParameterTypeDefault value
entityTundefined
forcebooleanfalse

Returns ​

Promise<S>


getOwner() ​

ts
abstract getOwner(entity): User;

Parameters ​

ParameterType
entityT

Returns ​

User


getParameters() ​

ts
abstract getParameters(entity): Promise<P>;

Parameters ​

ParameterType
entityT

Returns ​

Promise<P>

Inherited from ​

PdfService.getParameters


html() ​

ts
html(entity): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityT

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

PdfService.html


output() ​

ts
output(entity, fileType): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityT
fileTypeReturnFileType

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

PdfService.output


pdf() ​

ts
pdf(entity): Promise<Buffer<ArrayBufferLike>>;

Parameters ​

ParameterType
entityT

Returns ​

Promise<Buffer<ArrayBufferLike>>

Inherited from ​

PdfService.pdf


render() ​

ts
abstract render(params): string;

Parameters ​

ParameterType
paramsP

Returns ​

string

Inherited from ​

PdfService.render