Member Junction
    Preparing search index...

    Abstract base class for archive drivers. Concrete implementations handle the specifics of how records are archived and restored.

    Use @RegisterClass(BaseArchiveDriver, 'YourDriverName') on concrete subclasses to make them discoverable via the MJ ClassFactory.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get SupportsPurge(): boolean

      Whether this driver can run when StorageMode is 'Purge', where the context has no storage driver and no copy is kept. False by default. DefaultArchiveDriver returns true, and its subclasses inherit that unless they override it.

      Returns boolean

    Methods

    • Archives a single record and applies the configured mode to the source record. On a Store run context.StorageDriver is set, and the driver writes the archive document before it applies the mode. On a Purge run context.StorageDriver is null, and the driver must write nothing and only apply the mode.

      Parameters

      Returns Promise<ArchiveRecordResult>

      Result indicating success/failure and storage details

    • Builds a storage path for an archive document. Format: {basePath}/{SanitizedEntityName}/{RecordID}/{VersionStamp}.json

      Parameters

      • basePath: string

        The configured base path prefix

      • entityName: string

        The entity name (will be sanitized)

      • recordId: string

        The primary key value of the record

      • versionStamp: Date

        The timestamp for this archive version

      Returns string

      The full storage path string

    • Formats a Date as an ISO 8601 string safe for use in file paths. Colons are replaced with underscores.

      Parameters

      • date: Date

      Returns string

    • Sanitizes a string for use as a storage path segment by replacing spaces, colons, and other problematic characters with underscores.

      Parameters

      • value: string

      Returns string