diff --git a/scripts/src/commands/load/all.ts b/scripts/src/commands/load/all.ts index f59516d..531e0c7 100644 --- a/scripts/src/commands/load/all.ts +++ b/scripts/src/commands/load/all.ts @@ -92,7 +92,6 @@ export default class LoadDatabase extends Command { async insertServices(services: any[]): Promise> { /** Maps the ID as defined in the JSON file to the ID in the database */ const serviceMap = new Map(); - // For each of the services, save the info not including // the allowed connections for (const service of services) { diff --git a/scripts/src/commands/reset/index.ts b/scripts/src/commands/reset/index.ts index f4a3914..e20977e 100644 --- a/scripts/src/commands/reset/index.ts +++ b/scripts/src/commands/reset/index.ts @@ -17,6 +17,7 @@ export default class Reset extends Command { const { flags } = await this.parse(Reset); // Connect to the database + console.log(`${flags.db} connection url`); const client = await MongoClient.connect(flags.db); await client.connect(); diff --git a/src/reset/dtos/service.dto.ts b/src/reset/dtos/service.dto.ts index 025d0b7..f28abb5 100644 --- a/src/reset/dtos/service.dto.ts +++ b/src/reset/dtos/service.dto.ts @@ -29,4 +29,7 @@ export class ServiceInput { @Field(() => [String], { nullable: true }) resultParams?: string[]; + + @Field(() => JSON, { nullable: true }) + paramGroups?: any[]; } diff --git a/src/reset/reset.service.ts b/src/reset/reset.service.ts index 92f3469..92f1dcc 100644 --- a/src/reset/reset.service.ts +++ b/src/reset/reset.service.ts @@ -60,7 +60,8 @@ export class ResetService { allowedConnections: [], result: service.result, description: service.description, - resultParams: service.resultParams + resultParams: service.resultParams, + paramGroups: service.paramGroups }); // Update the map diff --git a/src/services/models/damplab-service.model.ts b/src/services/models/damplab-service.model.ts index 9ee825f..a79fb0e 100644 --- a/src/services/models/damplab-service.model.ts +++ b/src/services/models/damplab-service.model.ts @@ -29,6 +29,10 @@ export class DampLabService { @Field(() => JSON, { description: 'Parameters that are part of the service' }) parameters: any; + @Prop({ type: mongoose.Schema.Types.Mixed, required: false }) + @Field(() => JSON, { description: 'If there are grouped parameters', nullable: true }) + paramGroups: any[]; + @Prop({ type: [{ type: mongoose.Schema.Types.ObjectId, ref: DampLabService.name }] }) @Field(() => [DampLabService], { description: 'List of services this service can connect to' }) allowedConnections: mongoose.Types.ObjectId[];