UNPKG

typeorm-pii-compliance

Version:

TypeORM PII Compliance Service: Cascading Personally Identifiable Information Disposal

18 lines (17 loc) 979 B
import { BaseEntity, ObjectLiteral } from 'typeorm'; import { PiiMaskingMethod, PiiMetadataEntityType } from './types/pii.type'; export declare type EntityId = string | symbol | number | EntityId[]; export declare type BeforeDisposalFunc = (type: PiiMetadataEntityType, entity: ObjectLiteral | BaseEntity) => Promise<void> | void; export interface PiiComplianceServiceOptions { replaceChar?: '*' | '-' | string; beforeDisposal?: BeforeDisposalFunc; } export declare class PiiComplianceService { protected readonly options?: PiiComplianceServiceOptions | undefined; constructor(options?: PiiComplianceServiceOptions | undefined); private _sorted?; private entities; process(entityId: EntityId, beforeDisposal?: BeforeDisposalFunc): Promise<void>; process(group: string, entityId: EntityId, beforeDisposal?: BeforeDisposalFunc): Promise<void>; static transform(value: any, maskingMethod: PiiMaskingMethod, replaceChar?: string): Promise<any>; }