prorm API Reference
    Preparing search index...

    Class DataClassifier

    Index
    Classify: (level: SensitivityLevel) => (target: Function) => void = Classify

    Type Declaration

      • (level: SensitivityLevel): (target: Function) => void
      • Classify the entire model (applies to all fields, use field-level for specifics).

          @Classify('CONFIDENTIAL')
        class FinancialRecord extends Model { ... }

        Parameters

        Returns (target: Function) => void

    FieldClassification: (
        field: string,
        category: DataCategory,
        options?: Partial<ClassificationMetadata>,
    ) => (target: Function) => void = FieldClassification

    Type Declaration

      • (
            field: string,
            category: DataCategory,
            options?: Partial<ClassificationMetadata>,
        ): (target: Function) => void
      • Classify a specific field.

          @FieldClassification('email', 'PII')
        @FieldClassification('ssn', 'PHI', { level: 'SECRET', regulations: ['HIPAA'] })
        @FieldClassification('creditCard', 'PCI_PAN', { level: 'TOP_SECRET' })

        Parameters

        Returns (target: Function) => void

    getClassification: (
        Model: any,
        field: string,
    ) => ClassificationMetadata | undefined = getClassification

    Type Declaration

    getClassifications: (Model: any) => Map<string, ClassificationMetadata> = getClassificationsForModel

    Type Declaration

    getFieldsByCategory: (Model: any, category: DataCategory) => string[] = getFieldsByCategory

    Type Declaration

      • (Model: any, category: DataCategory): string[]
      • Get all fields with a specific category (e.g., all PII fields).

        Parameters

        Returns string[]

    getPIIFields: (Model: any) => string[] = getPIIFields

    Type Declaration

      • (Model: any): string[]
      • Convenience: get all PII (Personally Identifiable Information) fields.

        Parameters

        • Model: any

        Returns string[]

    getPHIFields: (Model: any) => string[] = getPHIFields

    Type Declaration

      • (Model: any): string[]
      • Convenience: get all PHI (Protected Health Information) fields.

        Parameters

        • Model: any

        Returns string[]

    getPCIFields: (Model: any) => string[] = getPCIFields

    Type Declaration

      • (Model: any): string[]
      • Convenience: get all PCI (Payment Card Industry) fields.

        Parameters

        • Model: any

        Returns string[]

    getFinancialFields: (Model: any) => string[] = getFinancialFields

    Type Declaration

      • (Model: any): string[]
      • Convenience: get all financial data fields.

        Parameters

        • Model: any

        Returns string[]

    getFieldsByLevel: (Model: any, level: SensitivityLevel) => string[] = getFieldsByLevel

    Type Declaration

      • (Model: any, level: SensitivityLevel): string[]
      • Get all fields with a specific sensitivity level.

        Parameters

        Returns string[]

    getConfidentialFields: (Model: any) => string[] = getConfidentialFields

    Type Declaration

      • (Model: any): string[]
      • Get all fields classified as CONFIDENTIAL or higher.

        Parameters

        • Model: any

        Returns string[]

    isSensitive: (Model: any, field: string) => boolean = isSensitive

    Type Declaration

      • (Model: any, field: string): boolean
      • Check if a field contains sensitive data (PII, PHI, PCI, etc.).

        Parameters

        • Model: any
        • field: string

        Returns boolean

    autoDiscover: (Model: any, additionalPatterns?: (string | RegExp)[]) => void = autoDiscover

    Type Declaration

      • (Model: any, additionalPatterns?: (string | RegExp)[]): void
      • Automatically classify fields based on their names. Call this after model definition to tag common sensitive fields.

        Parameters

        • Model: any

          The model to scan

        • OptionaladditionalPatterns: (string | RegExp)[]

        Returns void

    inheritClassifications: (child: any, parent: any) => void = inheritClassifications

    Type Declaration

      • (child: any, parent: any): void
      • Merge classifications from another model (useful for inheritance).

        Parameters

        • child: any
        • parent: any

        Returns void