From c46edc5712a4a2ba79ba69a3b6594ef19e4f602c Mon Sep 17 00:00:00 2001 From: Dylan Hughes Date: Tue, 12 Nov 2024 15:56:13 -0500 Subject: [PATCH 1/2] ensure all types are updated for workpoolworker --- src/models/WorkPoolWorker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 9622411a5ca71e39426d7369151031a9bc25ff0b Mon Sep 17 00:00:00 2001 From: Dylan Hughes Date: Tue, 12 Nov 2024 16:04:11 -0500 Subject: [PATCH 2/2] update mock --- src/mocks/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, })