prorm API Reference
    Preparing search index...

    Class CrossBorderLog

    Index
    • Enable cross-border transfer logging on a model. Creates necessary tables and registers hooks.

      Parameters

      • prorm: any

        The Prorm instance

      • model: any

        The model class to track

      • options: TransferOptions = {}

        Optional configuration

      Returns void

    • Apply hooks to a model for automatic transfer logging. Called automatically by enable() when autoLog is true.

      Parameters

      • model: any

        The model class

      • Optionalconfig: TransferConfig

        The transfer configuration

      Returns void

    • Log a cross-border data transfer.

      Parameters

      • sourceRegion: string

        Source region code (e.g., 'EU', 'US')

      • targetRegion: string

        Target region code

      • dataType: DataTypeCategory

        Category of data being transferred

      • records: any[]

        Record IDs or array of record data

      • Optionaloptions: {
            recordId?: string | number;
            tableName?: string;
            initiatedBy?: string | number;
            purpose?: string;
            legalBasis?: string;
            status?: TransferStatus;
            metadata?: Record<string, any>;
        }

        Additional transfer details

      Returns Promise<TransferRecord>

    • Get transfer history for a specific record.

      Parameters

      • model: any

        The model class

      • recordId: string | number

        The record ID to get history for

      Returns Promise<TransferRecord[]>

    • Get all transfer records for a model.

      Parameters

      • model: any

        The model class

      • Optionaloptions: {
            sourceRegion?: string;
            targetRegion?: string;
            dataType?: DataTypeCategory;
            status?: TransferStatus;
            startDate?: Date;
            endDate?: Date;
            limit?: number;
            offset?: number;
        }

        Filter options (source, target, status, date range)

      Returns Promise<TransferRecord[]>

    • Check if a cross-border transfer is allowed. Evaluates based on source/target region configurations.

      Parameters

      • sourceRegion: string

        Source region code

      • targetRegion: string

        Target region code

      • OptionaldataType: DataTypeCategory

        Optional data type for additional checks

      Returns Promise<
          {
              allowed: boolean;
              reason?: string;
              requiresReview?: boolean;
              regulations?: string[];
          },
      >

    • Check if a model has transfer logging enabled.

      Parameters

      • model: any

        The model class

      Returns boolean