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
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 @@ -190,7 +190,7 @@ export class DefaultApi extends BaseAPI {
abortWorkflow(
instanceId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<string, any, {}, any>>;
): Promise<AxiosResponse<string, 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 @@ -206,7 +206,7 @@ export class DefaultApi extends BaseAPI {
workflowId: string,
executeWorkflowRequestDTO: ExecuteWorkflowRequestDTO,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ExecuteWorkflowResponseDTO, any, {}, any>>;
): Promise<AxiosResponse<ExecuteWorkflowResponseDTO, 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 @@ -219,7 +219,7 @@ export class DefaultApi extends BaseAPI {
getInstanceById(
instanceId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ProcessInstanceDTO, any, {}, any>>;
): Promise<AxiosResponse<ProcessInstanceDTO, 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 @@ -233,7 +233,7 @@ export class DefaultApi extends BaseAPI {
getInstances(
searchRequest?: SearchRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ProcessInstanceListResultDTO, any, {}, any>>;
): Promise<AxiosResponse<ProcessInstanceListResultDTO, 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 @@ -249,7 +249,7 @@ export class DefaultApi extends BaseAPI {
workflowId: string,
instanceId?: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<InputSchemaResponseDTO, any, {}, any>>;
): Promise<AxiosResponse<InputSchemaResponseDTO, 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 @@ -266,7 +266,7 @@ export class DefaultApi extends BaseAPI {
workflowId: string,
searchRequest?: SearchRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<ProcessInstanceListResultDTO, any, {}, any>>;
): Promise<AxiosResponse<ProcessInstanceListResultDTO, 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 @@ -282,7 +282,7 @@ export class DefaultApi extends BaseAPI {
instanceId: string,
rawlog?: boolean,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowLogsResponse, any, {}, any>>;
): Promise<AxiosResponse<WorkflowLogsResponse, 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 @@ -294,7 +294,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowOverviewById(
workflowId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowOverviewDTO, any, {}, any>>;
): Promise<AxiosResponse<WorkflowOverviewDTO, 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 @@ -306,7 +306,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowSourceById(
workflowId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<string, any, {}, any>>;
): Promise<AxiosResponse<string, 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 @@ -319,7 +319,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowsOverview(
searchRequest?: SearchRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, any, {}, any>>;
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, 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 @@ -332,7 +332,7 @@ export class DefaultApi extends BaseAPI {
getWorkflowsOverviewForEntity(
getWorkflowsOverviewForEntityRequest?: GetWorkflowsOverviewForEntityRequest,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, any, {}, any>>;
): Promise<AxiosResponse<WorkflowOverviewListResultDTO, 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 @@ -342,7 +342,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, {}, any>>;
): Promise<AxiosResponse<WorkflowRunStatusDTO[], 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 @@ -354,7 +354,7 @@ export class DefaultApi extends BaseAPI {
pingWorkflowServiceById(
workflowId: string,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<boolean, any, {}, any>>;
): Promise<AxiosResponse<boolean, 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 @@ -373,7 +373,7 @@ export class DefaultApi extends BaseAPI {
instanceId: string,
retriggerInstanceRequestDTO: RetriggerInstanceRequestDTO,
options?: RawAxiosRequestConfig,
): Promise<AxiosResponse<object, any, {}, any>>;
): Promise<AxiosResponse<object, 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 @@ -11,37 +11,10 @@ CLIENT_FOLDER="${GENERATED_FOLDER}/client"
APIDOC_TEMPLATE_FILE="./src/openapi/api-doc-template.yaml"
APIDOC_GENERATED_FILE=${GENERATED_FOLDER}/docs/api-doc/orchestrator-api.yaml

# axios >=1.19 infers an unexported unique symbol on createRequestFunction,
# which fails declaration emit (TS2527). The typescript-axios template fix is
# https://github.com/OpenAPITools/openapi-generator/pull/24526 — reapply it
# until this workspace's generator includes that change.
patch_axios_ts2527() {
node -e '
const fs = require("fs");
const file = process.argv[1];
const source = fs.readFileSync(file, "utf8");
const patched = source
.replace(
"(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {",
"(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {",
)
.replace(
"return axios.request<T, R>(axiosRequestArgs);",
"return axios.request<T, R>(axiosRequestArgs) as Promise<R>;",
);
if (patched === source) {
console.error("Failed to patch createRequestFunction for axios TS2527 in", file);
process.exit(1);
}
fs.writeFileSync(file, patched);
' "${CLIENT_FOLDER}/common.ts"
}

openapi_generate() {
# TypeScript Client generation
rm -rf ${CLIENT_FOLDER}
openapi-generator-cli generate -g typescript-axios -i ${OPENAPI_SPEC_FILE} -o ${CLIENT_FOLDER}
patch_axios_ts2527

# 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
Expand Up @@ -143,8 +143,8 @@ export const toPathString = function (url: URL) {
* @export
*/
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): Promise<R> => {
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) as Promise<R>;
return axios.request<T, R>(axiosRequestArgs);
};
}
Loading
Loading