From e88fa085789eecb8b3943e787dbab0f960d72470 Mon Sep 17 00:00:00 2001 From: Igor Richter <93926487+IgorCapCoder@users.noreply.github.com> Date: Fri, 22 Dec 2023 11:45:47 +0100 Subject: [PATCH] N21-1587 generate api and adjust tests (#2968) * generate api * add isProtected parameter * adjust tests --------- Co-authored-by: Malte Berg --- .../external-tool-validation.composable.unit.ts | 1 + src/serverApi/v3/api.ts | 12 ++++++++++++ src/store/context-external-tools.unit.ts | 4 ++++ .../external-tool/mapper/external-tool.mapper.ts | 1 + src/store/external-tool/tool-parameter.ts | 2 ++ src/store/school-external-tools.unit.ts | 4 ++++ .../factory/customParameterResponseFactory.ts | 1 + tests/test-utils/factory/toolParameterFactory.ts | 1 + 8 files changed, 26 insertions(+) diff --git a/src/components/external-tools/configuration/external-tool-validation.composable.unit.ts b/src/components/external-tools/configuration/external-tool-validation.composable.unit.ts index 2b00dc823c..d8609e87d9 100644 --- a/src/components/external-tools/configuration/external-tool-validation.composable.unit.ts +++ b/src/components/external-tools/configuration/external-tool-validation.composable.unit.ts @@ -16,6 +16,7 @@ describe("useExternalToolValidation", () => { name: "ToolParameter", displayName: "Tool Parameter", isOptional: true, + isProtected: false, type: ToolParameterType.String, regexComment: "comment", location: ToolParameterLocation.PATH, diff --git a/src/serverApi/v3/api.ts b/src/serverApi/v3/api.ts index 53abfc2244..87a5f305ab 100644 --- a/src/serverApi/v3/api.ts +++ b/src/serverApi/v3/api.ts @@ -1308,6 +1308,12 @@ export interface CustomParameterPostParams { * @memberof CustomParameterPostParams */ isOptional: boolean; + /** + * + * @type {boolean} + * @memberof CustomParameterPostParams + */ + isProtected: boolean; } /** * @@ -1375,6 +1381,12 @@ export interface CustomParameterResponse { * @memberof CustomParameterResponse */ isOptional: boolean; + /** + * + * @type {boolean} + * @memberof CustomParameterResponse + */ + isProtected: boolean; } /** diff --git a/src/store/context-external-tools.unit.ts b/src/store/context-external-tools.unit.ts index 34dee97160..553538f9f0 100644 --- a/src/store/context-external-tools.unit.ts +++ b/src/store/context-external-tools.unit.ts @@ -462,6 +462,8 @@ describe("ContextExternalToolsModule", () => { toolConfigurationTemplate.parameters[0].description, isOptional: toolConfigurationTemplate.parameters[0].isOptional, + isProtected: + toolConfigurationTemplate.parameters[0].isProtected, regex: toolConfigurationTemplate.parameters[0].regex, regexComment: toolConfigurationTemplate.parameters[0].regexComment, @@ -569,6 +571,8 @@ describe("ContextExternalToolsModule", () => { toolConfigurationTemplate.parameters[0].description, isOptional: toolConfigurationTemplate.parameters[0].isOptional, + isProtected: + toolConfigurationTemplate.parameters[0].isProtected, regex: toolConfigurationTemplate.parameters[0].regex, regexComment: toolConfigurationTemplate.parameters[0].regexComment, diff --git a/src/store/external-tool/mapper/external-tool.mapper.ts b/src/store/external-tool/mapper/external-tool.mapper.ts index 896f8fa7dc..e6bf4e368c 100644 --- a/src/store/external-tool/mapper/external-tool.mapper.ts +++ b/src/store/external-tool/mapper/external-tool.mapper.ts @@ -26,6 +26,7 @@ export class ExternalToolMapper { description: response.description, displayName: response.displayName, isOptional: response.isOptional, + isProtected: response.isProtected, regex: response.regex, regexComment: response.regexComment, }; diff --git a/src/store/external-tool/tool-parameter.ts b/src/store/external-tool/tool-parameter.ts index 2b4e4c8c31..3cd7a7e423 100644 --- a/src/store/external-tool/tool-parameter.ts +++ b/src/store/external-tool/tool-parameter.ts @@ -22,4 +22,6 @@ export interface ToolParameter { type: ToolParameterType; isOptional: boolean; + + isProtected: boolean; } diff --git a/src/store/school-external-tools.unit.ts b/src/store/school-external-tools.unit.ts index af888b1559..5250b4038c 100644 --- a/src/store/school-external-tools.unit.ts +++ b/src/store/school-external-tools.unit.ts @@ -342,6 +342,8 @@ describe("SchoolExternalToolsModule", () => { toolConfigurationTemplate.parameters[0].description, isOptional: toolConfigurationTemplate.parameters[0].isOptional, + isProtected: + toolConfigurationTemplate.parameters[0].isProtected, regex: toolConfigurationTemplate.parameters[0].regex, regexComment: toolConfigurationTemplate.parameters[0].regexComment, @@ -444,6 +446,8 @@ describe("SchoolExternalToolsModule", () => { toolConfigurationTemplate.parameters[0].description, isOptional: toolConfigurationTemplate.parameters[0].isOptional, + isProtected: + toolConfigurationTemplate.parameters[0].isProtected, regex: toolConfigurationTemplate.parameters[0].regex, regexComment: toolConfigurationTemplate.parameters[0].regexComment, diff --git a/tests/test-utils/factory/customParameterResponseFactory.ts b/tests/test-utils/factory/customParameterResponseFactory.ts index da4bc86814..37cc79cc71 100644 --- a/tests/test-utils/factory/customParameterResponseFactory.ts +++ b/tests/test-utils/factory/customParameterResponseFactory.ts @@ -13,5 +13,6 @@ export const customParameterResponseFactory = location: CustomParameterResponseLocationEnum.Body, name: `CustomParameter${sequence}`, isOptional: false, + isProtected: false, displayName: `Custom Parameter ${sequence}`, })); diff --git a/tests/test-utils/factory/toolParameterFactory.ts b/tests/test-utils/factory/toolParameterFactory.ts index dbf79f5c81..5ddd27ad44 100644 --- a/tests/test-utils/factory/toolParameterFactory.ts +++ b/tests/test-utils/factory/toolParameterFactory.ts @@ -14,5 +14,6 @@ export const toolParameterFactory = Factory.define( displayName: `Parameter ${sequence}`, description: "test description", isOptional: true, + isProtected: false, }) );