Skip to content

Commit

Permalink
N21-1587 generate api and adjust tests (#2968)
Browse files Browse the repository at this point in the history
* generate api
* add isProtected parameter
* adjust tests
---------

Co-authored-by: Malte Berg <[email protected]>
  • Loading branch information
IgorCapCoder and MBergCap authored Dec 22, 2023
1 parent acd27f4 commit e88fa08
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe("useExternalToolValidation", () => {
name: "ToolParameter",
displayName: "Tool Parameter",
isOptional: true,
isProtected: false,
type: ToolParameterType.String,
regexComment: "comment",
location: ToolParameterLocation.PATH,
Expand Down
12 changes: 12 additions & 0 deletions src/serverApi/v3/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,12 @@ export interface CustomParameterPostParams {
* @memberof CustomParameterPostParams
*/
isOptional: boolean;
/**
*
* @type {boolean}
* @memberof CustomParameterPostParams
*/
isProtected: boolean;
}
/**
*
Expand Down Expand Up @@ -1375,6 +1381,12 @@ export interface CustomParameterResponse {
* @memberof CustomParameterResponse
*/
isOptional: boolean;
/**
*
* @type {boolean}
* @memberof CustomParameterResponse
*/
isProtected: boolean;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/store/context-external-tools.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/store/external-tool/mapper/external-tool.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 2 additions & 0 deletions src/store/external-tool/tool-parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ export interface ToolParameter {
type: ToolParameterType;

isOptional: boolean;

isProtected: boolean;
}
4 changes: 4 additions & 0 deletions src/store/school-external-tools.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/test-utils/factory/customParameterResponseFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export const customParameterResponseFactory =
location: CustomParameterResponseLocationEnum.Body,
name: `CustomParameter${sequence}`,
isOptional: false,
isProtected: false,
displayName: `Custom Parameter ${sequence}`,
}));
1 change: 1 addition & 0 deletions tests/test-utils/factory/toolParameterFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export const toolParameterFactory = Factory.define<ToolParameter>(
displayName: `Parameter ${sequence}`,
description: "test description",
isOptional: true,
isProtected: false,
})
);

0 comments on commit e88fa08

Please sign in to comment.