diff --git a/src/case.ts b/src/case.ts index 7e305b4..ab6edd4 100644 --- a/src/case.ts +++ b/src/case.ts @@ -5,6 +5,7 @@ import { ExperimentId, FmuId, WorkspaceId, + CaseMeta, } from './types' import Api from './api' import ModelExecutable from './model-executable' @@ -15,6 +16,7 @@ class Case { private fmuId?: FmuId id: CaseId runInfo: CaseRunInfo + meta: CaseMeta private workspaceId: WorkspaceId constructor({ @@ -23,6 +25,7 @@ class Case { fmuId, id, runInfo, + meta, workspaceId, }: { api: Api @@ -30,12 +33,14 @@ class Case { fmuId?: FmuId experimentId: ExperimentId runInfo: CaseRunInfo + meta: CaseMeta workspaceId: WorkspaceId }) { this.api = api this.fmuId = fmuId this.id = id this.runInfo = runInfo + this.meta = meta this.experimentId = experimentId this.workspaceId = workspaceId } diff --git a/src/experiment.ts b/src/experiment.ts index ba499f6..42c3230 100644 --- a/src/experiment.ts +++ b/src/experiment.ts @@ -57,6 +57,7 @@ class Experiment { fmuId: caseResponse.input.fmu_id, id: caseResponse.id || i.toString(), runInfo: caseResponse.run_info, + meta: caseResponse.meta, workspaceId: this.workspaceId, }) ) diff --git a/src/types/index.ts b/src/types/index.ts index 228acb4..168b5a2 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -68,6 +68,8 @@ export type CaseRunInfo = NonNullable< >['items'] >[0]['run_info'] +export type CaseMeta = Case["meta"]; + export type ExperimentRunInfo = components['schemas']['ExperimentItemV3']['run_info'] diff --git a/tests/integration/integration.test.ts b/tests/integration/integration.test.ts index 6e5a479..bbf0c88 100644 --- a/tests/integration/integration.test.ts +++ b/tests/integration/integration.test.ts @@ -103,6 +103,7 @@ test( } expect(cases[0].runInfo).toMatchObject({ status: 'successful' }) + expect(cases[0].meta).toMatchObject({ label: null, orchestrator: false }) const log = await cases[0].getLog() expect(typeof log).toBe('string')