Interface: MigrationRule
Defined in: electron/services/monitoring/MigrationSystem.ts:47
Describes a migration rule for a monitor type.
Remarks
Each migration rule transforms monitor configuration data from one version to another. Used by the migration system to upgrade or modify monitor configuration schemas.
Example
{
description: "Add timeout field",
fromVersion: "1.0.0",
toVersion: "1.1.0",
isBreaking: false,
transform: async (data) => ({ ...data, timeout: 30000 })
}
Properties
description
description:
string
Defined in: electron/services/monitoring/MigrationSystem.ts:54
Human-readable description of the migration.
Remarks
Used for logging and diagnostics.
fromVersion
fromVersion:
string
Defined in: electron/services/monitoring/MigrationSystem.ts:61
Source version for the migration.
Remarks
The version string this migration starts from (e.g., "1.0.0").
isBreaking
isBreaking:
boolean
Defined in: electron/services/monitoring/MigrationSystem.ts:68
Indicates if the migration is breaking.
Remarks
If true, migration may require user intervention or data review.
toVersion
toVersion:
string
Defined in: electron/services/monitoring/MigrationSystem.ts:75
Target version for the migration.
Remarks
The version string this migration upgrades to (e.g., "1.1.0").
transform()
transform: (
data:UnknownRecord) =>Promise<UnknownRecord>
Defined in: electron/services/monitoring/MigrationSystem.ts:93
Transformation function to migrate monitor configuration data.
Parameters
data
UnknownRecord
The UnknownRecord monitor configuration data to transform
Returns
Promise<UnknownRecord>
A promise resolving to the transformed UnknownRecord data
Remarks
Receives the monitor configuration data and returns a Promise resolving to the transformed data. Must handle all data validation and transformation logic for the version upgrade. May throw if transformation fails or data is invalid.
Throws
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error When transformation fails due to invalid data, missing required fields, or data validation errors