prorm API Reference
    Preparing search index...

    Class WORMStorage

    Index
    • Enable WORM storage on a model. Creates necessary metadata tables and registers hooks.

      Parameters

      • model: any

        The model class to protect

      • prorm: Prorm

        The Prorm instance

      • options: WORMOptions

        WORM configuration options

      Returns void

    • Apply hooks to a model for WORM protection. Called automatically by enable().

      Parameters

      • model: any

        The model class

      • Optionalconfig: WORMConfig

        The WORM configuration

      Returns void

    • Archive a record (moves to archived state). Archived records are read-only but can still be queried.

      Parameters

      • record: any

        The record instance to archive

      Returns Promise<void>

    • Freeze a record (fully immutable). Frozen records cannot be modified or deleted.

      Parameters

      • record: any

        The record instance to freeze

      Returns Promise<void>

    • Get the tamper evidence log for a record.

      Parameters

      • recordId: string | number

        The record ID

      • tableName: string

        The table name

      Returns Promise<WORMTamperLog[]>

    • Verify the integrity of a record's tamper chain.

      Parameters

      • recordId: string | number

        The record ID

      • tableName: string

        The table name

      Returns Promise<boolean>

      True if chain is valid, false if tampering detected

    • Check if WORM is enabled on a model.

      Parameters

      • model: any

        The model class

      Returns boolean

    • Enforce retention policy on a model. This will delete or anonymize records that have exceeded their retention period.

      Parameters

      • model: any

        The model class

      • prorm: any

        The Prorm instance

      Returns Promise<{ affected: number; mode: string }>

    • Get the archive state of a record.

      Parameters

      • recordId: string | number

        The record ID

      • tableName: string

        The table name

      Returns Promise<ArchiveState | null>

    • Disable WORM storage for a model.

      Parameters

      • model: any

        The model class

      Returns void