Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions workspaces/orchestrator/.changeset/renovate-92d7eb2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch
---

Updated dependency `@openapitools/openapi-generator-cli` to `2.41.0`.
2 changes: 1 addition & 1 deletion workspaces/orchestrator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@changesets/cli": "^2.27.1",
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
"@jest/environment-jsdom-abstract": "^30.3.0",
"@playwright/test": "1.61.1",
"@playwright/test": "1.64.0",
"@types/jest": "^30.0.0",
"@types/jsdom": "^27.0.0",
"jest": "^30.3.0",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/orchestrator/packages/app-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@backstage/test-utils": "^1.7.21",
"@playwright/test": "1.60.0",
"@playwright/test": "1.64.0",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/orchestrator/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@backstage/test-utils": "^1.7.21",
"@playwright/test": "1.60.0",
"@playwright/test": "1.64.0",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"devDependencies": {
"@backstage/cli": "^0.36.5",
"@openapitools/openapi-generator-cli": "2.30.2",
"@openapitools/openapi-generator-cli": "2.41.0",
"@spotify/prettier-config": "^15.0.0",
"@types/js-yaml": "^4.0.0",
"@types/json-schema": "7.0.15",
Expand Down
28 changes: 14 additions & 14 deletions workspaces/orchestrator/plugins/orchestrator-common/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class DefaultApi extends BaseAPI {
abortWorkflow(
instanceId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<string, any, {}>>;
): Promise<AxiosResponse<string, any, {}, any>>;
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@summary" is not defined in this configuration
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
Expand All @@ -207,7 +207,7 @@ export class DefaultApi extends BaseAPI {
workflowId: string,
executeWorkflowRequestDTO: ExecuteWorkflowRequestDTO,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ExecuteWorkflowResponseDTO, any, {}>>;
): Promise<AxiosResponse<ExecuteWorkflowResponseDTO, any, {}, any>>;
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@summary" is not defined in this configuration
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
Expand All @@ -220,7 +220,7 @@ export class DefaultApi extends BaseAPI {
getInstanceById(
instanceId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ProcessInstanceDTO, any, {}>>;
): Promise<AxiosResponse<ProcessInstanceDTO, any, {}, any>>;
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@summary" is not defined in this configuration
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
Expand All @@ -234,7 +234,7 @@ export class DefaultApi extends BaseAPI {
getInstances(
searchRequest?: SearchRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ProcessInstanceListResultDTO, any, {}>>;
): Promise<AxiosResponse<ProcessInstanceListResultDTO, any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
Expand All @@ -250,7 +250,7 @@ export class DefaultApi extends BaseAPI {
workflowId: string,
instanceId?: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<InputSchemaResponseDTO, any, {}>>;
): Promise<AxiosResponse<InputSchemaResponseDTO, any, {}, any>>;
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@summary" is not defined in this configuration
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
Expand All @@ -267,7 +267,7 @@ export class DefaultApi extends BaseAPI {
workflowId: string,
searchRequest?: SearchRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ProcessInstanceListResultDTO, any, {}>>;
): Promise<AxiosResponse<ProcessInstanceListResultDTO, any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
Expand All @@ -283,7 +283,7 @@ export class DefaultApi extends BaseAPI {
instanceId: string,
rawlog?: boolean,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowLogsResponse, any, {}>>;
): Promise<AxiosResponse<WorkflowLogsResponse, any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
Expand All @@ -295,7 +295,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowOverviewById(
workflowId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowOverviewDTO, any, {}>>;
): Promise<AxiosResponse<WorkflowOverviewDTO, any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
Expand All @@ -307,7 +307,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowSourceById(
workflowId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<string, any, {}>>;
): Promise<AxiosResponse<string, any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
Expand All @@ -320,7 +320,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowsOverview(
searchRequest?: SearchRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, any, {}>>;
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
Expand All @@ -333,7 +333,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowsOverviewForEntity(
getWorkflowsOverviewForEntityRequest?: GetWorkflowsOverviewForEntityRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, any, {}>>;
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, any, {}, any>>;
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@summary" is not defined in this configuration
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
Expand All @@ -343,7 +343,7 @@ export class DefaultApi extends BaseAPI {
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@memberof" is not defined in this configuration
getWorkflowStatuses(
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowRunStatusDTO[], any, {}>>;
): Promise<AxiosResponse<WorkflowRunStatusDTO[], any, {}, any>>;
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
Expand All @@ -355,7 +355,7 @@ export class DefaultApi extends BaseAPI {
pingWorkflowServiceById(
workflowId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<boolean, any, {}>>;
): Promise<AxiosResponse<boolean, any, {}, any>>;
// Warning: (tsdoc-undefined-tag) The TSDoc tag "@summary" is not defined in this configuration
// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
Expand All @@ -374,7 +374,7 @@ export class DefaultApi extends BaseAPI {
instanceId: string,
retriggerInstanceRequestDTO: RetriggerInstanceRequestDTO,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<object, any, {}>>;
): Promise<AxiosResponse<object, any, {}, any>>;
}

// Warning: (tsdoc-undefined-tag) The TSDoc tag "@export" is not defined in this configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ openapi_generate() {
# TypeScript Client generation
rm -rf ${CLIENT_FOLDER}
openapi-generator-cli generate -g typescript-axios -i ${OPENAPI_SPEC_FILE} -o ${CLIENT_FOLDER}
node ./scripts/patch-openapi-client.js

# Docs generation
rm -rf ./src/generated/docs/markdown ./src/generated/docs/html ./src/generated/docs/api-doc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const fs = require('node:fs');
const path = require('node:path');

if (process.argv.length > 2) {
throw new Error('patch-openapi-client.js does not accept arguments');
}

const generatedFile = path.join(__dirname, '../src/generated/client/common.ts');
const source = fs.readFileSync(generatedFile, 'utf8');
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
const unpatched = 'return axios.request<T, R>(axiosRequestArgs);';
const patched = 'return axios.request<T, R>(axiosRequestArgs) as Promise<R>;';
const matches = source.split(unpatched).length - 1;

if (matches === 0 && source.includes(patched)) {
process.exit(0);
}
if (matches !== 1) {
throw new Error(
`Expected exactly one unpatched createRequestFunction return in ${generatedFile}`,
);
}

fs.writeFileSync(generatedFile, source.replace(unpatched, patched));
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ export const toPathString = function (url: URL) {
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
};
}
Loading
Loading