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 ​
PdfService<T,P>
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 ​
| Parameter | Type |
|---|---|
manager? | EntityManager |
Returns ​
StoredPdfService<T, S, P>
Inherited from ​
Properties ​
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
location | abstract | string | - |
manager | protected | EntityManager | PdfService.manager |
pdfConstructor | abstract | () => S | - |
Methods ​
compile() ​
ts
protected compile(params): Promise<Buffer<ArrayBufferLike>>;Parameters ​
| Parameter | Type |
|---|---|
params | P |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
configureLogger() ​
ts
protected configureLogger(logger): void;Parameters ​
| Parameter | Type |
|---|---|
logger | Logger |
Returns ​
void
Inherited from ​
getOrCreate() ​
ts
getOrCreate(entity, force?): Promise<S>;Parameters ​
| Parameter | Type | Default value |
|---|---|---|
entity | T | undefined |
force | boolean | false |
Returns ​
Promise<S>
getOwner() ​
ts
abstract getOwner(entity): User;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
getParameters() ​
ts
abstract getParameters(entity): Promise<P>;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<P>
Inherited from ​
html() ​
ts
html(entity): Promise<Buffer<ArrayBufferLike>>;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
output() ​
ts
output(entity, fileType): Promise<Buffer<ArrayBufferLike>>;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
fileType | ReturnFileType |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
pdf() ​
ts
pdf(entity): Promise<Buffer<ArrayBufferLike>>;Parameters ​
| Parameter | Type |
|---|---|
entity | T |
Returns ​
Promise<Buffer<ArrayBufferLike>>
Inherited from ​
render() ​
ts
abstract render(params): string;Parameters ​
| Parameter | Type |
|---|---|
params | P |
Returns ​
string