diff --git a/src/mocks/worker.ts b/src/mocks/worker.ts index 16032116d..3066e755d 100644 --- a/src/mocks/worker.ts +++ b/src/mocks/worker.ts @@ -11,7 +11,7 @@ export const randomWorker: MockFunction lastHeartbeatTime: this.create('date'), status: this.create('workerStatus'), clientVersion: this.create('string'), - metadata: { 'integrations': [this.create('string'), this.create('string')] }, + metadata: { integrations: [{ name: this.create('string'), version: this.create('string') }], 'foo': 'bar' }, heartbeatIntervalSeconds: this.create('number'), ...overrides, }) diff --git a/src/models/WorkPoolWorker.ts b/src/models/WorkPoolWorker.ts index 09071096e..2518eae30 100644 --- a/src/models/WorkPoolWorker.ts +++ b/src/models/WorkPoolWorker.ts @@ -1,7 +1,7 @@ import { WorkPoolWorkerStatus } from '@/models/WorkPoolWorkerStatus' -type Integration = { name: string, version: string } -type Metadata = Record & { integrations?: Integration[] } +export type Integration = { name: string, version: string } +export type Metadata = { integrations?: Integration[] } & Record export interface IWorkPoolWorker { readonly id: string, @@ -27,7 +27,7 @@ export class WorkPoolWorker implements IWorkPoolWorker { public status: WorkPoolWorkerStatus public heartbeatIntervalSeconds: number public clientVersion: string | null - public metadata: Record | null + public metadata: Metadata | null public constructor(workPoolWorker: IWorkPoolWorker) { this.id = workPoolWorker.id