From 857252bc80c2c1961c6de9519a4d37414dbec0a2 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Wed, 20 Dec 2023 11:21:02 +0100 Subject: [PATCH 1/8] extend ctl - customParameter model with isProtected --- .../src/modules/tool/common/domain/custom-parameter.do.ts | 3 +++ .../controller/dto/request/custom-parameter.params.ts | 4 ++++ .../controller/dto/response/custom-parameter.response.ts | 4 ++++ .../entity/custom-parameter/custom-parameter.entity.ts | 4 ++++ .../tool/external-tool/mapper/external-tool-request.mapper.ts | 1 + .../external-tool/mapper/external-tool-response.mapper.ts | 1 + .../src/shared/repo/externaltool/external-tool.repo.mapper.ts | 2 ++ .../factory/domainobject/tool/external-tool.factory.ts | 1 + .../shared/testing/factory/external-tool-entity.factory.ts | 1 + 9 files changed, 21 insertions(+) diff --git a/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts b/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts index fcad4784f43..6e34fabe86c 100644 --- a/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts +++ b/apps/server/src/modules/tool/common/domain/custom-parameter.do.ts @@ -21,6 +21,8 @@ export class CustomParameter { isOptional: boolean; + isProtected: boolean; + constructor(props: CustomParameter) { this.name = props.name; this.displayName = props.displayName; @@ -32,5 +34,6 @@ export class CustomParameter { this.regex = props.regex; this.regexComment = props.regexComment; this.isOptional = props.isOptional; + this.isProtected = props.isProtected; } } diff --git a/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts b/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts index c996183b5ba..2ab070d46a3 100644 --- a/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts +++ b/apps/server/src/modules/tool/external-tool/controller/dto/request/custom-parameter.params.ts @@ -52,4 +52,8 @@ export class CustomParameterPostParams { @IsBoolean() @ApiProperty() isOptional!: boolean; + + @IsBoolean() + @ApiProperty() + isProtected!: boolean; } diff --git a/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts b/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts index 058bbdb5d0d..604d4f9cba7 100644 --- a/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts +++ b/apps/server/src/modules/tool/external-tool/controller/dto/response/custom-parameter.response.ts @@ -36,6 +36,9 @@ export class CustomParameterResponse { @ApiProperty() isOptional: boolean; + @ApiProperty() + isProtected: boolean; + constructor(props: CustomParameterResponse) { this.name = props.name; this.displayName = props.displayName; @@ -47,5 +50,6 @@ export class CustomParameterResponse { this.regex = props.regex; this.regexComment = props.regexComment; this.isOptional = props.isOptional; + this.isProtected = props.isProtected; } } diff --git a/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts b/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts index 3f99cfe52b5..e9d4833d0bc 100644 --- a/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts +++ b/apps/server/src/modules/tool/external-tool/entity/custom-parameter/custom-parameter.entity.ts @@ -33,6 +33,9 @@ export class CustomParameterEntity { @Property() isOptional: boolean; + @Property({ default: false }) + isProtected: boolean; + constructor(props: CustomParameterEntity) { this.name = props.name; this.displayName = props.displayName; @@ -44,5 +47,6 @@ export class CustomParameterEntity { this.regex = props.regex; this.regexComment = props.regexComment; this.isOptional = props.isOptional; + this.isProtected = props.isProtected; } } diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts index 916e1c734a8..c57e0ee457a 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.ts @@ -153,6 +153,7 @@ export class ExternalToolRequestMapper { location: locationMapping[customParameterParam.location], type: typeMapping[customParameterParam.type], isOptional: customParameterParam.isOptional, + isProtected: customParameterParam.isProtected, }; }); } diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts index eadbc20c50a..7be202132ef 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.ts @@ -94,6 +94,7 @@ export class ExternalToolResponseMapper { location: locationMapping[customParameterDO.location], type: typeMapping[customParameterDO.type], isOptional: customParameterDO.isOptional, + isProtected: customParameterDO.isProtected, }; }); } diff --git a/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts b/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts index a5710bc3a81..7740647ea9f 100644 --- a/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts +++ b/apps/server/src/shared/repo/externaltool/external-tool.repo.mapper.ts @@ -149,6 +149,7 @@ export class ExternalToolRepoMapper { location: param.location, type: param.type, isOptional: param.isOptional, + isProtected: param.isProtected, }) ); } @@ -167,6 +168,7 @@ export class ExternalToolRepoMapper { location: param.location, type: param.type, isOptional: param.isOptional, + isProtected: param.isProtected, }) ); } diff --git a/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts b/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts index 7815d863a69..d5ec2ee7371 100644 --- a/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts +++ b/apps/server/src/shared/testing/factory/domainobject/tool/external-tool.factory.ts @@ -79,6 +79,7 @@ export const customParameterFactory = CustomParameterFactory.define(CustomParame scope: CustomParameterScope.SCHOOL, location: CustomParameterLocation.BODY, isOptional: false, + isProtected: false, }; }); diff --git a/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts b/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts index 39ff2662cf7..8f7c22247fd 100644 --- a/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts +++ b/apps/server/src/shared/testing/factory/external-tool-entity.factory.ts @@ -85,6 +85,7 @@ export const customParameterEntityFactory = BaseFactory.define Date: Wed, 20 Dec 2023 11:44:51 +0100 Subject: [PATCH 2/8] update seed data (external tools) --- backup/setup/external-tools.json | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/backup/setup/external-tools.json b/backup/setup/external-tools.json index 1bcd7d1c045..87764bd724d 100644 --- a/backup/setup/external-tools.json +++ b/backup/setup/external-tools.json @@ -24,7 +24,8 @@ "scope": "global", "location": "query", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false }, { "name": "search", @@ -34,7 +35,8 @@ "scope": "global", "location": "path", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false }, { "name": "param1", @@ -43,7 +45,8 @@ "scope": "school", "location": "path", "type": "string", - "isOptional": true + "isOptional": true, + "isProtected": false }, { "name": "contextParam", @@ -54,7 +57,8 @@ "scope": "context", "location": "query", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false } ], "isHidden": false, @@ -93,7 +97,8 @@ "scope": "global", "location": "body", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false } ], "isHidden": false, @@ -142,7 +147,8 @@ "scope": "school", "location": "path", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false }], "isHidden": false, "openNewTab": false, @@ -168,7 +174,8 @@ "scope": "context", "location": "path", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false }], "isHidden": false, "openNewTab": false, @@ -194,7 +201,8 @@ "scope": "school", "location": "path", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false }, { "name": "contextparammm", "displayName": "cypress test context", @@ -202,7 +210,8 @@ "scope": "context", "location": "path", "type": "string", - "isOptional": false + "isOptional": false, + "isProtected": false }], "isHidden": false, "openNewTab": false, From b62386664b09533e22c8373faf4a5e450778ade8 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Wed, 20 Dec 2023 13:52:32 +0100 Subject: [PATCH 3/8] migration script WIP --- ...add-protected-field-to-custom-paramters.js | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 migrations/1703072644729-add-protected-field-to-custom-paramters.js diff --git a/migrations/1703072644729-add-protected-field-to-custom-paramters.js b/migrations/1703072644729-add-protected-field-to-custom-paramters.js new file mode 100644 index 00000000000..697dde907af --- /dev/null +++ b/migrations/1703072644729-add-protected-field-to-custom-paramters.js @@ -0,0 +1,53 @@ +const mongoose = require('mongoose'); + +const { connect, close } = require('../src/utils/database'); + +// use your own name for your model, otherwise other migrations may fail. +// The third parameter is the actually relevent one for what collection to write to. +const ExternalTools = mongoose.model( + 'external_tools1703072644729', + new mongoose.Schema( + { + parameters: [ + { + isProtected: { type: Boolean, required: true }, + }, + ], + }, + { + timestamps: true, + } + ), + 'external_tools' +); + +// How to use more than one schema per collection on mongodb +// https://stackoverflow.com/questions/14453864/use-more-than-one-schema-per-collection-on-mongodb + +module.exports = { + up: async function up() { + await connect(); + + await ExternalTools.updateMany( + { parameters: '$exists' }, + { + isProtected: false, + } + ) + .lean() + .exec(); + + await close(); + }, + + down: async function down() { + await connect(); + + await ExternalTools.updateMany({ parameters: '$exists' }, { $unset: { isProtected: '' } }) + .lean() + .exec(); + + await close(); + }, +}; +// TODO N21-1587 build filter, should work on all parameters in paraters array From 8fe5e79fd48332408c310fb9c0c6680a88c5ba79 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Wed, 20 Dec 2023 16:29:18 +0100 Subject: [PATCH 4/8] migrations script needs testing, needs execution --- .../mapper/external-tool-request.mapper.spec.ts | 6 ++++++ ...72644729-add-protected-field-to-custom-paramters.js | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts index 72f5d35de5c..cf29d8e874c 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-request.mapper.spec.ts @@ -71,6 +71,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolCreateParams = new ExternalToolCreateParams(); externalToolCreateParams.name = 'mockName'; @@ -159,6 +160,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolCreateParams = new ExternalToolCreateParams(); externalToolCreateParams.name = 'mockName'; @@ -244,6 +246,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolCreateParams = new ExternalToolCreateParams(); externalToolCreateParams.name = 'mockName'; @@ -312,6 +315,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolUpdateParams = new ExternalToolUpdateParams(); externalToolUpdateParams.id = 'id'; @@ -404,6 +408,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolUpdateParams = new ExternalToolUpdateParams(); externalToolUpdateParams.id = 'id'; @@ -493,6 +498,7 @@ describe('ExternalToolRequestMapper', () => { customParameterPostParams.regex = 'mockRegex'; customParameterPostParams.regexComment = 'mockComment'; customParameterPostParams.isOptional = false; + customParameterPostParams.isProtected = false; const externalToolUpdateParams = new ExternalToolUpdateParams(); externalToolUpdateParams.id = 'id'; diff --git a/migrations/1703072644729-add-protected-field-to-custom-paramters.js b/migrations/1703072644729-add-protected-field-to-custom-paramters.js index 697dde907af..af95e6c1ebf 100644 --- a/migrations/1703072644729-add-protected-field-to-custom-paramters.js +++ b/migrations/1703072644729-add-protected-field-to-custom-paramters.js @@ -27,11 +27,12 @@ const ExternalTools = mongoose.model( module.exports = { up: async function up() { await connect(); - await ExternalTools.updateMany( - { parameters: '$exists' }, + { parameters: { $exists: true } }, { - isProtected: false, + $set: { + 'parameters.$[].isProtected': false, + }, } ) .lean() @@ -43,11 +44,10 @@ module.exports = { down: async function down() { await connect(); - await ExternalTools.updateMany({ parameters: '$exists' }, { $unset: { isProtected: '' } }) + await ExternalTools.updateMany({ parameters: { $exists: true } }, { $unset: { 'parameters.$[].isProtected': '' } }) .lean() .exec(); await close(); }, }; -// TODO N21-1587 build filter, should work on all parameters in paraters array From fd3d8eff4ec46e37fc4ad1081d124440ded2070d Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Thu, 21 Dec 2023 13:57:10 +0100 Subject: [PATCH 5/8] migration script WIP added to migrations.json --- backup/setup/migrations.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backup/setup/migrations.json b/backup/setup/migrations.json index b0288b2b975..93da7824804 100644 --- a/backup/setup/migrations.json +++ b/backup/setup/migrations.json @@ -372,5 +372,16 @@ "$date": "2023-12-11T09:52:27.346Z" }, "__v": 0 + }, + { + "_id": { + "$oid": "658434b45fcf755f84d80cb6" + }, + "state": "up", + "name": "add-protected-field-to-custom-paramters", + "createdAt": { + "$date": "2023-12-20T11:44:04.729Z" + }, + "__v": 0 } ] From 0aeced7160f75be86a128d68675bb07fb401060b Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Thu, 21 Dec 2023 14:10:59 +0100 Subject: [PATCH 6/8] migration fix --- .../1703072644729-add-protected-field-to-custom-paramters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/1703072644729-add-protected-field-to-custom-paramters.js b/migrations/1703072644729-add-protected-field-to-custom-paramters.js index af95e6c1ebf..86d324f214c 100644 --- a/migrations/1703072644729-add-protected-field-to-custom-paramters.js +++ b/migrations/1703072644729-add-protected-field-to-custom-paramters.js @@ -5,7 +5,7 @@ const { connect, close } = require('../src/utils/database'); // use your own name for your model, otherwise other migrations may fail. // The third parameter is the actually relevent one for what collection to write to. const ExternalTools = mongoose.model( - 'external_tools1703072644729', + 'external-tools1703072644729', new mongoose.Schema( { parameters: [ @@ -18,7 +18,7 @@ const ExternalTools = mongoose.model( timestamps: true, } ), - 'external_tools' + 'external-tools' ); // How to use more than one schema per collection on mongodb From 25371cb6f2e6739d14a8b74e88c5008504e7cc88 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Thu, 21 Dec 2023 15:47:03 +0100 Subject: [PATCH 7/8] fix unit tests, merge main --- .../controller/api-test/tool-configuration.api.spec.ts | 4 ++++ .../service/external-tool-version.service.spec.ts | 1 + .../entity/school-external-tool.entity.spec.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts b/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts index 1207c326ea8..812836a99da 100644 --- a/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts +++ b/apps/server/src/modules/tool/external-tool/controller/api-test/tool-configuration.api.spec.ts @@ -203,6 +203,7 @@ describe('ToolConfigurationController (API)', () => { name: contextParameter.name, displayName: contextParameter.displayName, isOptional: contextParameter.isOptional, + isProtected: contextParameter.isProtected, defaultValue: contextParameter.default, description: contextParameter.description, regex: contextParameter.regex, @@ -361,6 +362,7 @@ describe('ToolConfigurationController (API)', () => { name: schoolParameter.name, displayName: schoolParameter.displayName, isOptional: schoolParameter.isOptional, + isProtected: schoolParameter.isProtected, defaultValue: schoolParameter.default, description: schoolParameter.description, regex: schoolParameter.regex, @@ -489,6 +491,7 @@ describe('ToolConfigurationController (API)', () => { name: schoolParameter.name, displayName: schoolParameter.displayName, isOptional: schoolParameter.isOptional, + isProtected: schoolParameter.isProtected, defaultValue: schoolParameter.default, description: schoolParameter.description, regex: schoolParameter.regex, @@ -644,6 +647,7 @@ describe('ToolConfigurationController (API)', () => { name: contextParameter.name, displayName: contextParameter.displayName, isOptional: contextParameter.isOptional, + isProtected: contextParameter.isProtected, defaultValue: contextParameter.default, description: contextParameter.description, regex: contextParameter.regex, diff --git a/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts b/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts index dabfd70996e..f19eaeabe04 100644 --- a/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts +++ b/apps/server/src/modules/tool/external-tool/service/external-tool-version.service.spec.ts @@ -17,6 +17,7 @@ describe('ExternalToolVersionService', () => { displayName: 'displayName', default: 'defaulValueParam1', isOptional: false, + isProtected: false, location: CustomParameterLocation.PATH, regex: '*', regexComment: '', diff --git a/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts b/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts index 17344cd0579..c3b03b2d0cd 100644 --- a/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts +++ b/apps/server/src/modules/tool/school-external-tool/entity/school-external-tool.entity.spec.ts @@ -41,6 +41,7 @@ describe('SchoolExternalToolEntity', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolEntity: ExternalToolEntity = new ExternalToolEntity({ name: 'toolName', From 90ab64e9e3602cf127d42e1b229b32911d838f06 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Thu, 21 Dec 2023 16:25:34 +0100 Subject: [PATCH 8/8] fix unit tests --- .../entity/context-external-tool.entity.spec.ts | 1 + .../tool/external-tool/controller/api-test/tool.api.spec.ts | 4 ++++ .../tool/external-tool/entity/external-tool.entity.spec.ts | 1 + .../mapper/external-tool-response.mapper.spec.ts | 3 +++ .../repo/externaltool/external-tool.repo.integration.spec.ts | 1 + 5 files changed, 10 insertions(+) diff --git a/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts b/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts index 29f2b3080d1..b41519bbef5 100644 --- a/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts +++ b/apps/server/src/modules/tool/context-external-tool/entity/context-external-tool.entity.spec.ts @@ -43,6 +43,7 @@ describe('ExternalToolEntity', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolEntity: ExternalToolEntity = externalToolEntityFactory.buildWithId({ name: 'toolName', diff --git a/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts b/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts index 27f7e7825e4..93da1d956b2 100644 --- a/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts +++ b/apps/server/src/modules/tool/external-tool/controller/api-test/tool.api.spec.ts @@ -74,6 +74,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', @@ -137,6 +138,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', @@ -367,6 +369,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', @@ -433,6 +436,7 @@ describe('ToolController (API)', () => { displayName: 'User Friendly Name', defaultValue: 'abc', isOptional: false, + isProtected: false, type: CustomParameterTypeParams.STRING, regex: 'abc', regexComment: 'Regex accepts "abc" as value.', diff --git a/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts b/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts index 933f007c440..9d037046942 100644 --- a/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts +++ b/apps/server/src/modules/tool/external-tool/entity/external-tool.entity.spec.ts @@ -48,6 +48,7 @@ describe('ExternalToolEntity', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolEntity: ExternalToolEntity = new ExternalToolEntity({ name: 'toolName', diff --git a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts index bdf612f944c..0a491222081 100644 --- a/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts +++ b/apps/server/src/modules/tool/external-tool/mapper/external-tool-response.mapper.spec.ts @@ -43,6 +43,7 @@ describe('ExternalToolResponseMapper', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const basicToolConfigResponse: BasicToolConfigResponse = new BasicToolConfigResponse({ @@ -143,6 +144,7 @@ describe('ExternalToolResponseMapper', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolResponse: ExternalToolResponse = new ExternalToolResponse({ @@ -230,6 +232,7 @@ describe('ExternalToolResponseMapper', () => { regex: 'mockRegex', regexComment: 'mockComment', isOptional: false, + isProtected: false, }); const externalToolResponse: ExternalToolResponse = new ExternalToolResponse({ diff --git a/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts b/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts index 75fa86597fb..e3e2949d5c1 100644 --- a/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/externaltool/external-tool.repo.integration.spec.ts @@ -152,6 +152,7 @@ describe('ExternalToolRepo', () => { location: CustomParameterLocation.BODY, regexComment: 'mockComment', isOptional: false, + isProtected: false, }), ], isHidden: true,