Skip to main content

Variable: exampleMigrations

const exampleMigrations: { httpV1_0_to_1_1: MigrationRule; portV1_0_to_1_1: MigrationRule; }

Defined in: electron/services/monitoring/MigrationSystem.ts:698

Example migration definitions for reference and testing.

Type Declaration

httpV1_0_to_1_1

httpV1_0_to_1_1: MigrationRule

HTTP monitor migration: Adds a timeout field with default value.

Remarks

Non-breaking migration. Adds timeout field if missing.

Example

const migrated = await exampleMigrations.httpV1_0_to_1_1.transform({
url: "https://...",
});

Default Value

timeout = 30000;

Param

The monitor configuration data.

Returns

Promise resolving to data with timeout field set.

portV1_0_to_1_1

portV1_0_to_1_1: MigrationRule

Port monitor migration: Ensures port is numeric and valid.

Remarks

Converts string port numbers to integers. Validates port range.

Example

const migrated = await exampleMigrations.portV1_0_to_1_1.transform({
port: "8080",
});

Param

The monitor configuration data.

Returns

Promise resolving to data with numeric port.

Throws

Throws if port is invalid or not in range 1-65535.

Remarks

Provides templates for common migration scenarios. These are not registered by default; register as needed for tests or new monitor types.

Example

migrationRegistry.registerMigration("http", exampleMigrations.httpV1_0_to_1_1);
migrationRegistry.registerMigration("port", exampleMigrations.portV1_0_to_1_1);