diff --git a/api/src/engine/connectors/datashield/main.connector.ts b/api/src/engine/connectors/datashield/main.connector.ts index 3ee3fbb9843478b3e0d048dc193537ca350d9364..829147fe9b985703be4868f6e12b8889884d8abe 100644 --- a/api/src/engine/connectors/datashield/main.connector.ts +++ b/api/src/engine/connectors/datashield/main.connector.ts @@ -47,33 +47,11 @@ export default class DataShieldService implements IEngineService { } getDomains(): Domain[] { - return [ - { - id: 'Dummy', - label: 'Dummy', - datasets: [{ id: 'DummyDataSet' }], - groups: [ - { - id: 'DummyGroup', - variables: ['DummyVar'], - groups: [], - }, - ], - rootGroup: { id: 'DummyGroup', variables: [], groups: [] }, - variables: [{ id: 'DummyVar', type: 'string' }], - }, - ]; + throw new Error('Method not implemented.'); } getActiveUser(): string { - const dummyUser = { - username: 'anonymous', - subjectId: 'anonymousId', - fullname: 'anonymous', - email: 'anonymous@anonymous.com', - agreeNDA: true, - }; - return JSON.stringify(dummyUser); + throw new Error('Method not implemented.'); } editActiveUser(): Observable<string> { @@ -101,10 +79,10 @@ export default class DataShieldService implements IEngineService { } getExperiments(): string { - return '[]'; + throw new Error('Method not implemented.'); } getAlgorithmsREST(): string { - return '[]'; + throw new Error('Method not implemented.'); } } diff --git a/api/src/engine/connectors/local/main.connector.ts b/api/src/engine/connectors/local/main.connector.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ff1a44faa75d436313c152256cfdcf46299121d --- /dev/null +++ b/api/src/engine/connectors/local/main.connector.ts @@ -0,0 +1,110 @@ +import { Observable } from 'rxjs'; +import { IEngineService } from 'src/engine/engine.interfaces'; +import { Domain } from 'src/engine/models/domain.model'; +import { ExperimentCreateInput } from 'src/engine/models/experiment/input/experiment-create.input'; +import { + Experiment, + PartialExperiment, +} from 'src/engine/models/experiment/experiment.model'; +import { ListExperiments } from 'src/engine/models/experiment/list-experiments.model'; +import { ExperimentEditInput } from 'src/engine/models/experiment/input/experiment-edit.input'; +import { Algorithm } from 'src/engine/models/experiment/algorithm.model'; + +export default class LocalService implements IEngineService { + getAlgorithms(): Algorithm[] | Promise<Algorithm[]> { + throw new Error('Method not implemented.'); + } + + createExperiment( + data: ExperimentCreateInput, + isTransient: boolean, + ): Experiment | Promise<Experiment> { + throw new Error('Method not implemented.'); + } + + listExperiments( + page: number, + name: string, + ): ListExperiments | Promise<ListExperiments> { + throw new Error('Method not implemented.'); + } + + getExperiment(uuid: string): Experiment | Promise<Experiment> { + throw new Error('Method not implemented.'); + } + + removeExperiment( + uuid: string, + ): PartialExperiment | Promise<PartialExperiment> { + throw new Error('Method not implemented.'); + } + + editExperient( + uuid: string, + expriment: ExperimentEditInput, + ): Experiment | Promise<Experiment> { + throw new Error('Method not implemented.'); + } + + getDomains(): Domain[] { + return [ + { + id: 'Dummy', + label: 'Dummy', + datasets: [{ id: 'DummyDataset', label: 'DummyDataset' }], + groups: [ + { + id: 'DummyGroup', + variables: ['DummyVar'], + groups: [], + }, + ], + rootGroup: { id: 'DummyGroup' }, + variables: [{ id: 'DummyVar', type: 'string' }], + }, + ]; + } + + getActiveUser(): string { + const dummyUser = { + username: 'anonymous', + subjectId: 'anonymousId', + fullname: 'anonymous', + email: 'anonymous@anonymous.com', + agreeNDA: true, + }; + return JSON.stringify(dummyUser); + } + + editActiveUser(): Observable<string> { + throw new Error('Method not implemented.'); + } + + getExperimentREST(): Observable<string> { + throw new Error('Method not implemented.'); + } + + deleteExperiment(): Observable<string> { + throw new Error('Method not implemented.'); + } + + editExperimentREST(): Observable<string> { + throw new Error('Method not implemented.'); + } + + startExperimentTransient(): Observable<string> { + throw new Error('Method not implemented.'); + } + + startExperiment(): Observable<string> { + throw new Error('Method not implemented.'); + } + + getExperiments(): string { + return '[]'; + } + + getAlgorithmsREST(): string { + return '[]'; + } +} diff --git a/api/src/engine/models/group.model.ts b/api/src/engine/models/group.model.ts index 0cb97a48fd77bb9300192429b034adb0505f5a9c..6c4880262e3a538114f3e4717d9c4ddabf7a061d 100644 --- a/api/src/engine/models/group.model.ts +++ b/api/src/engine/models/group.model.ts @@ -6,9 +6,13 @@ export class Group extends Entity { @Field({ nullable: true }) description?: string; - @Field(() => [Group]) - groups: Group[]; + @Field(() => [Group], { defaultValue: [], nullable: true }) + groups?: Group[]; - @Field(() => [String], { description: "List of variable's ids" }) - variables: string[]; + @Field(() => [String], { + description: "List of variable's ids", + defaultValue: [], + nullable: true, + }) + variables?: string[]; } diff --git a/api/src/schema.gql b/api/src/schema.gql index ee828b162f66ff407881a7c9cdce312b450770e7..c906a1951ce36cba5961ced0c2853ef6ddb2658c 100644 --- a/api/src/schema.gql +++ b/api/src/schema.gql @@ -11,10 +11,10 @@ type Group { id: String! label: String description: String - groups: [Group!]! + groups: [Group!] """List of variable's ids""" - variables: [String!]! + variables: [String!] } type Variable {