From 15113196fd9a09246d181bd721a64b31900c05c2 Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Wed, 27 Nov 2024 17:12:47 -0600 Subject: [PATCH] fix: release pipeline (#2574) Signed-off-by: Paul Schultz --- .changeset/cyan-tigers-jam.md | 7 - .changeset/spicy-owls-smoke.md | 7 - .../src/service/router.ts | 828 -- .../src/generated/.METADATA.sha1 | 1 - .../src/generated/api/definition.ts | 5 - .../src/generated/client/api.ts | 1706 ---- .../src/generated/docs/html/index.html | 8068 ----------------- .../docs/markdown/Apis/DefaultApi.md | 319 - .../src/openapi/openapi.yaml | 733 -- .../src/api/OrchestratorClient.test.ts | 624 -- .../src/api/OrchestratorClient.ts | 229 - .../ExecuteWorkflowPage.tsx | 137 - 12 files changed, 12664 deletions(-) delete mode 100644 .changeset/cyan-tigers-jam.md delete mode 100644 .changeset/spicy-owls-smoke.md delete mode 100644 plugins/orchestrator-backend/src/service/router.ts delete mode 100644 plugins/orchestrator-common/src/generated/.METADATA.sha1 delete mode 100644 plugins/orchestrator-common/src/generated/api/definition.ts delete mode 100644 plugins/orchestrator-common/src/generated/client/api.ts delete mode 100644 plugins/orchestrator-common/src/generated/docs/html/index.html delete mode 100644 plugins/orchestrator-common/src/generated/docs/markdown/Apis/DefaultApi.md delete mode 100644 plugins/orchestrator-common/src/openapi/openapi.yaml delete mode 100644 plugins/orchestrator/src/api/OrchestratorClient.test.ts delete mode 100644 plugins/orchestrator/src/api/OrchestratorClient.ts delete mode 100644 plugins/orchestrator/src/components/ExecuteWorkflowPage/ExecuteWorkflowPage.tsx diff --git a/.changeset/cyan-tigers-jam.md b/.changeset/cyan-tigers-jam.md deleted file mode 100644 index 40cad27e35..0000000000 --- a/.changeset/cyan-tigers-jam.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@janus-idp/backstage-plugin-orchestrator-form-react": patch -"@janus-idp/backstage-plugin-orchestrator-form-api": patch -"@janus-idp/backstage-plugin-orchestrator": patch ---- - -pass also initial form data to custom decorator diff --git a/.changeset/spicy-owls-smoke.md b/.changeset/spicy-owls-smoke.md deleted file mode 100644 index 0b48edd175..0000000000 --- a/.changeset/spicy-owls-smoke.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@janus-idp/backstage-plugin-orchestrator-backend": patch -"@janus-idp/backstage-plugin-orchestrator-common": patch -"@janus-idp/backstage-plugin-orchestrator": patch ---- - -The parent assessment link is shown again thanks to fixing passing of the businessKey when "execute" action is trigerred. diff --git a/plugins/orchestrator-backend/src/service/router.ts b/plugins/orchestrator-backend/src/service/router.ts deleted file mode 100644 index 6e3e1eee2a..0000000000 --- a/plugins/orchestrator-backend/src/service/router.ts +++ /dev/null @@ -1,828 +0,0 @@ -import { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter'; -import { - HttpAuthService, - LoggerService, - PermissionsService, - resolvePackagePath, - SchedulerService, -} from '@backstage/backend-plugin-api'; -import type { Config } from '@backstage/config'; -import type { DiscoveryApi } from '@backstage/core-plugin-api'; -import { - AuthorizeResult, - BasicPermission, -} from '@backstage/plugin-permission-common'; -import { createPermissionIntegrationRouter } from '@backstage/plugin-permission-node'; -import type { JsonObject, JsonValue } from '@backstage/types'; - -import { fullFormats } from 'ajv-formats/dist/formats'; -import express, { Router } from 'express'; -import { Request as HttpRequest } from 'express-serve-static-core'; -import { OpenAPIBackend, Request } from 'openapi-backend'; - -import { - AuditLogger, - DefaultAuditLogger, -} from '@janus-idp/backstage-plugin-audit-log-node'; -import { - Filter, - openApiDocument, - orchestratorPermissions, - orchestratorWorkflowExecutePermission, - orchestratorWorkflowInstanceAbortPermission, - orchestratorWorkflowInstanceReadPermission, - orchestratorWorkflowInstancesReadPermission, - orchestratorWorkflowReadPermission, - QUERY_PARAM_BUSINESS_KEY, - QUERY_PARAM_INCLUDE_ASSESSMENT, -} from '@janus-idp/backstage-plugin-orchestrator-common'; -import { UnauthorizedError } from '@janus-idp/backstage-plugin-rbac-common'; - -import * as pkg from '../../package.json'; -import { RouterOptions } from '../routerWrapper'; -import { buildPagination } from '../types/pagination'; -import { V2 } from './api/v2'; -import { INTERNAL_SERVER_ERROR_MESSAGE } from './constants'; -import { DataIndexService } from './DataIndexService'; -import { DataInputSchemaService } from './DataInputSchemaService'; -import { OrchestratorService } from './OrchestratorService'; -import { ScaffolderService } from './ScaffolderService'; -import { SonataFlowService } from './SonataFlowService'; -import { WorkflowCacheService } from './WorkflowCacheService'; - -interface PublicServices { - dataInputSchemaService: DataInputSchemaService; - orchestratorService: OrchestratorService; -} - -interface RouterApi { - openApiBackend: OpenAPIBackend; - v2: V2; -} - -const authorize = async ( - request: HttpRequest, - permission: BasicPermission, - permissionsSvc: PermissionsService, - httpAuth: HttpAuthService, -) => { - const decision = ( - await permissionsSvc.authorize([{ permission: permission }], { - credentials: await httpAuth.credentials(request), - }) - )[0]; - - return decision; -}; - -export async function createBackendRouter( - options: RouterOptions, -): Promise { - const { - config, - logger, - discovery, - catalogApi, - urlReader, - scheduler, - permissions, - auth, - httpAuth, - } = options; - const publicServices = initPublicServices(logger, config, scheduler); - - const routerApi = await initRouterApi(publicServices.orchestratorService); - - const auditLogger = new DefaultAuditLogger({ - logger: logger, - authService: auth, - httpAuthService: httpAuth, - }); - - const router = Router(); - const permissionsIntegrationRouter = createPermissionIntegrationRouter({ - permissions: orchestratorPermissions, - }); - router.use(express.json()); - router.use(permissionsIntegrationRouter); - router.use('/workflows', express.text()); - router.use('/static', express.static(resolvePackagePath(pkg.name, 'static'))); - router.get('/health', (_, response) => { - logger.info('PONG!'); - response.json({ status: 'ok' }); - }); - - const scaffolderService: ScaffolderService = new ScaffolderService( - logger, - config, - catalogApi, - urlReader, - ); - - setupInternalRoutes( - publicServices, - routerApi, - permissions, - httpAuth, - auditLogger, - ); - setupExternalRoutes(router, discovery, scaffolderService, auditLogger); - - router.use((req, res, next) => { - if (!next) { - throw new Error('next is undefined'); - } - - return routerApi.openApiBackend.handleRequest( - req as Request, - req, - res, - next, - ); - }); - - const middleware = MiddlewareFactory.create({ logger, config }); - - router.use(middleware.error()); - - return router; -} - -function initPublicServices( - logger: LoggerService, - config: Config, - scheduler: SchedulerService, -): PublicServices { - const dataIndexUrl = config.getString('orchestrator.dataIndexService.url'); - const dataIndexService = new DataIndexService(dataIndexUrl, logger); - const sonataFlowService = new SonataFlowService(dataIndexService, logger); - - const workflowCacheService = new WorkflowCacheService( - logger, - dataIndexService, - sonataFlowService, - ); - workflowCacheService.schedule({ scheduler: scheduler }); - - const orchestratorService = new OrchestratorService( - sonataFlowService, - dataIndexService, - workflowCacheService, - ); - - const dataInputSchemaService = new DataInputSchemaService(); - - return { - orchestratorService, - dataInputSchemaService, - }; -} - -async function initRouterApi( - orchestratorService: OrchestratorService, -): Promise { - const openApiBackend = new OpenAPIBackend({ - definition: openApiDocument, - strict: false, - ajvOpts: { - strict: false, - strictSchema: false, - verbose: true, - addUsedSchema: false, - formats: fullFormats, // open issue: https://github.com/openapistack/openapi-backend/issues/280 - }, - handlers: { - validationFail: async ( - c, - _req: express.Request, - res: express.Response, - ) => { - console.log('validationFail', c.operation); - res.status(400).json({ err: c.validation.errors }); - }, - notFound: async (_c, req: express.Request, res: express.Response) => { - res.status(404).json({ err: `${req.path} path not found` }); - }, - notImplemented: async (_c, req: express.Request, res: express.Response) => - res.status(500).json({ err: `${req.path} not implemented` }), - }, - }); - await openApiBackend.init(); - const v2 = new V2(orchestratorService); - return { v2, openApiBackend }; -} - -// ====================================================== -// Internal Backstage API calls to delegate to SonataFlow -// ====================================================== -function setupInternalRoutes( - services: PublicServices, - routerApi: RouterApi, - permissions: PermissionsService, - httpAuth: HttpAuthService, - auditLogger: AuditLogger, -) { - function manageDenyAuthorization( - endpointName: string, - endpoint: string, - req: HttpRequest, - ) { - const error = new UnauthorizedError(); - auditLogger.auditLog({ - eventName: `${endpointName}EndpointHit`, - stage: 'authorization', - status: 'failed', - level: 'error', - request: req, - response: { - status: 403, - body: { - errors: [ - { - name: error.name, - message: error.message, - }, - ], - }, - }, - errors: [error], - message: `Not authorize to request the ${endpoint} endpoint`, - }); - throw error; - } - - function auditLogRequestError( - error: any, - endpointName: string, - endpoint: string, - req: HttpRequest, - ) { - auditLogger.auditLog({ - eventName: `${endpointName}EndpointHit`, - stage: 'completion', - status: 'failed', - level: 'error', - request: req, - response: { - status: 500, - body: { - errors: [ - { - name: error.name, - message: error.message || INTERNAL_SERVER_ERROR_MESSAGE, - }, - ], - }, - }, - errors: [error], - message: `Error occured while requesting the '${endpoint}' endpoint`, - }); - } - - // v2 - routerApi.openApiBackend.register( - 'getWorkflowsOverview', - async (_c, req, res: express.Response, next) => { - const endpointName = 'getWorkflowsOverview'; - const endpoint = '/v2/workflows/overview'; - - auditLogger.auditLog({ - eventName: 'getWorkflowsOverview', - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '${endpoint}' endpoint`, - }); - const decision = await authorize( - req, - orchestratorWorkflowInstancesReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, req); - } - return routerApi.v2 - .getWorkflowsOverview(buildPagination(req), getRequestFilters(req)) - .then(result => res.json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getWorkflowSourceById', - async (c, _req, res, next) => { - const workflowId = c.request.params.workflowId as string; - const endpointName = 'getWorkflowSourceById'; - const endpoint = `/v2/workflows/${workflowId}/source`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: _req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - _req, - orchestratorWorkflowReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, _req); - } - - try { - const result = await routerApi.v2.getWorkflowSourceById(workflowId); - res.status(200).contentType('text/plain').send(result); - } catch (error) { - auditLogRequestError(error, endpointName, endpoint, _req); - next(error); - } - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'executeWorkflow', - async (c, req: express.Request, res: express.Response, next) => { - const workflowId = c.request.params.workflowId as string; - const endpointName = 'executeWorkflow'; - const endpoint = `/v2/workflows/${workflowId}/execute`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - req, - orchestratorWorkflowExecutePermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, req); - } - - const businessKey = routerApi.v2.extractQueryParam( - c.request, - QUERY_PARAM_BUSINESS_KEY, - ); - - const executeWorkflowRequestDTO = req.body; - - return routerApi.v2 - .executeWorkflow(executeWorkflowRequestDTO, workflowId, businessKey) - .then(result => res.status(200).json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'retriggerInstance', - async (c, req: express.Request, res: express.Response, next) => { - const workflowId = c.request.params.workflowId as string; - const instanceId = c.request.params.instanceId as string; - const endpointName = 'retriggerInstance'; - const endpoint = `/v2/workflows/${workflowId}/${instanceId}/retrigger`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - req, - orchestratorWorkflowExecutePermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, req); - } - - await routerApi.v2 - .retriggerInstance(workflowId, instanceId) - .then(result => res.status(200).json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getWorkflowOverviewById', - async (c, _req: express.Request, res: express.Response, next) => { - const workflowId = c.request.params.workflowId as string; - const endpointName = 'getWorkflowOverviewById'; - const endpoint = `/v2/workflows/${workflowId}/overview`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: _req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - _req, - orchestratorWorkflowReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, _req); - } - return routerApi.v2 - .getWorkflowOverviewById(workflowId) - .then(result => res.json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, _req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getWorkflowStatuses', - async (_c, _req: express.Request, res: express.Response, next) => { - const endpointName = 'getWorkflowStatuses'; - const endpoint = '/v2/workflows/instances/statuses'; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: _req, - message: `Received request to '${endpoint}' endpoint`, - }); - const decision = await authorize( - _req, - orchestratorWorkflowInstanceReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, _req); - } - return routerApi.v2 - .getWorkflowStatuses() - .then(result => res.status(200).json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, _req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getWorkflowInputSchemaById', - async (c, req: express.Request, res: express.Response, next) => { - const workflowId = c.request.params.workflowId as string; - const instanceId = c.request.query.instanceId as string; - const endpointName = 'getWorkflowInputSchemaById'; - const endpoint = `/v2/workflows/${workflowId}/inputSchema`; - try { - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '${endpoint}' endpoint`, - }); - const decision = await authorize( - req, - orchestratorWorkflowInstanceReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, req); - } - - const workflowDefinition = - await services.orchestratorService.fetchWorkflowInfo({ - definitionId: workflowId, - cacheHandler: 'throw', - }); - - if (!workflowDefinition) { - throw new Error( - `Failed to fetch workflow info for workflow ${workflowId}`, - ); - } - const serviceUrl = workflowDefinition.serviceUrl; - if (!serviceUrl) { - throw new Error( - `Service URL is not defined for workflow ${workflowId}`, - ); - } - - const definition = - await services.orchestratorService.fetchWorkflowDefinition({ - definitionId: workflowId, - cacheHandler: 'throw', - }); - - if (!definition) { - throw new Error( - 'Failed to fetch workflow definition for workflow ${workflowId}', - ); - } - - if (!definition.dataInputSchema) { - res.status(200).json({}); - return; - } - - const instanceVariables = instanceId - ? await services.orchestratorService.fetchInstanceVariables({ - instanceId, - cacheHandler: 'throw', - }) - : undefined; - - const workflowData = instanceVariables - ? services.dataInputSchemaService.extractWorkflowData( - instanceVariables, - ) - : undefined; - - const workflowInfo = await routerApi.v2 - .getWorkflowInputSchemaById(workflowId, serviceUrl) - .catch((error: { message: string }) => { - auditLogRequestError(error, endpointName, endpoint, req); - res.status(500).json({ - message: error.message || INTERNAL_SERVER_ERROR_MESSAGE, - }); - }); - - if ( - !workflowInfo || - !workflowInfo.inputSchema || - !workflowInfo.inputSchema.properties - ) { - res.status(200).json({}); - return; - } - - const inputSchemaProps = workflowInfo.inputSchema.properties; - let inputData; - - if (workflowData) { - inputData = Object.keys(inputSchemaProps) - .filter(k => k in workflowData) - .reduce((result, k) => { - if (!workflowData[k]) { - return result; - } - result[k] = workflowData[k]; - return result; - }, {} as JsonObject); - } - - res.status(200).json({ - inputSchema: workflowInfo.inputSchema, - data: inputData, - }); - } catch (err) { - auditLogRequestError(err, endpointName, endpoint, req); - next(err); - } - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getWorkflowInstances', - async (c, req: express.Request, res: express.Response, next) => { - const endpointName = 'getWorkflowInstances'; - const workflowId = c.request.params.workflowId as string; - const endpoint = `/v2/workflows/${workflowId}/instances`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - req, - orchestratorWorkflowInstancesReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, req); - } - return routerApi.v2 - .getInstances(buildPagination(req), getRequestFilters(req), workflowId) - .then(result => res.json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getInstances', - async (_c, req: express.Request, res: express.Response, next) => { - const endpointName = 'getInstances'; - const endpoint = `/v2/workflows/instances`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - req, - orchestratorWorkflowInstancesReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, req); - } - return routerApi.v2 - .getInstances(buildPagination(req), getRequestFilters(req)) - .then(result => res.json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'getInstanceById', - async (c, _req: express.Request, res: express.Response, next) => { - const instanceId = c.request.params.instanceId as string; - const endpointName = 'getInstanceById'; - const endpoint = `/v2/workflows/instances/${instanceId}`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: _req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - _req, - orchestratorWorkflowInstanceReadPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, _req); - } - - const includeAssessment = routerApi.v2.extractQueryParam( - c.request, - QUERY_PARAM_INCLUDE_ASSESSMENT, - ); - - return routerApi.v2 - .getInstanceById(instanceId, !!includeAssessment) - .then(result => res.status(200).json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, _req); - next(error); - }); - }, - ); - - // v2 - routerApi.openApiBackend.register( - 'abortWorkflow', - async (c, _req, res, next) => { - const instanceId = c.request.params.instanceId as string; - const endpointName = 'abortWorkflow'; - const endpoint = `/v2/workflows/instances/${instanceId}/abort`; - - auditLogger.auditLog({ - eventName: endpointName, - stage: 'start', - status: 'succeeded', - level: 'debug', - request: _req, - message: `Received request to '${endpoint}' endpoint`, - }); - - const decision = await authorize( - _req, - orchestratorWorkflowInstanceAbortPermission, - permissions, - httpAuth, - ); - if (decision.result === AuthorizeResult.DENY) { - manageDenyAuthorization(endpointName, endpoint, _req); - } - return routerApi.v2 - .abortWorkflow(instanceId) - .then(result => res.json(result)) - .catch(error => { - auditLogRequestError(error, endpointName, endpoint, _req); - next(error); - }); - }, - ); -} - -// ====================================================== -// External SonataFlow API calls to delegate to Backstage -// ====================================================== -function setupExternalRoutes( - router: express.Router, - discovery: DiscoveryApi, - scaffolderService: ScaffolderService, - auditLogger: AuditLogger, -) { - router.get('/actions', async (req, res) => { - auditLogger.auditLog({ - eventName: 'ActionsEndpointHit', - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '/actions' endpoint`, - }); - const scaffolderUrl = await discovery.getBaseUrl('scaffolder'); - const response = await fetch(`${scaffolderUrl}/v2/actions`); - const json = await response.json(); - res.status(response.status).json(json); - }); - - router.post('/actions/:actionId', async (req, res) => { - const { actionId } = req.params; - auditLogger.auditLog({ - eventName: 'ActionsActionIdEndpointHit', - stage: 'start', - status: 'succeeded', - level: 'debug', - request: req, - message: `Received request to '/actions/${actionId}' endpoint`, - }); - const instanceId: string | undefined = req.header('kogitoprocinstanceid'); - const body: JsonObject = (await req.body) as JsonObject; - - const filteredBody = Object.fromEntries( - Object.entries(body).filter( - ([, value]) => value !== undefined && value !== null, - ), - ); - - const result: JsonValue = await scaffolderService.executeAction({ - actionId, - instanceId, - input: filteredBody, - }); - res.status(200).json(result); - }); -} - -function getRequestFilters(req: HttpRequest): Filter | undefined { - return req.body.filters ? (req.body.filters as Filter) : undefined; -} diff --git a/plugins/orchestrator-common/src/generated/.METADATA.sha1 b/plugins/orchestrator-common/src/generated/.METADATA.sha1 deleted file mode 100644 index 2e3e08124d..0000000000 --- a/plugins/orchestrator-common/src/generated/.METADATA.sha1 +++ /dev/null @@ -1 +0,0 @@ -b87c7d385fe5965d9eb4cc87056d13f92070965f diff --git a/plugins/orchestrator-common/src/generated/api/definition.ts b/plugins/orchestrator-common/src/generated/api/definition.ts deleted file mode 100644 index b82ccbb251..0000000000 --- a/plugins/orchestrator-common/src/generated/api/definition.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable */ -/* prettier-ignore */ -// GENERATED FILE DO NOT EDIT. -const OPENAPI = `{"openapi":"3.1.0","info":{"title":"Orchestratorplugin","description":"APItointeractwithorchestratorplugin","license":{"name":"Apache2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"version":"0.0.1"},"servers":[{"url":"/"}],"paths":{"/v2/workflows/overview":{"post":{"operationId":"getWorkflowsOverview","description":"Returnsthekeyfieldsoftheworkflowincludingdataonthelastruninstance","requestBody":{"required":false,"description":"Paginationandfilters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowOverviewListResultDTO"}}}},"500":{"description":"Errorfetchingworkflowoverviews","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/{workflowId}/overview":{"get":{"operationId":"getWorkflowOverviewById","description":"Returnsthekeyfieldsoftheworkflowincludingdataonthelastruninstance","parameters":[{"name":"workflowId","in":"path","required":true,"description":"Uniqueidentifieroftheworkflow","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowOverviewDTO"}}}},"500":{"description":"Errorfetchingworkflowoverview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/{workflowId}/source":{"get":{"operationId":"getWorkflowSourceById","description":"Gettheworkflow'sdefinition","parameters":[{"name":"workflowId","in":"path","description":"IDoftheworkflowtofetch","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Errorfetchingworkflowsourcebyid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/{workflowId}/inputSchema":{"get":{"operationId":"getWorkflowInputSchemaById","description":"Gettheworkflowinputschema.Itdefinestheinputfieldsoftheworkflow","parameters":[{"name":"workflowId","in":"path","description":"IDoftheworkflowtofetch","required":true,"schema":{"type":"string"}},{"name":"instanceId","in":"query","description":"IDofinstance","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InputSchemaResponseDTO"}}}},"500":{"description":"Errorfetchingworkflowinputschemabyid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/instances":{"post":{"operationId":"getInstances","summary":"Getinstances","description":"Retrieveanarrayofworkflowexecutions(instances)","requestBody":{"required":false,"description":"Parametersforretrievinginstances","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInstancesRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessInstanceListResultDTO"}}}},"500":{"description":"Errorfetchinginstances","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/{workflowId}/instances":{"post":{"operationId":"getWorkflowInstances","summary":"Getinstancesforaspecificworkflow","description":"Retrieveanarrayofworkflowexecutions(instances)forthegivenworkflow","parameters":[{"name":"workflowId","in":"path","required":true,"description":"IDoftheworkflow","schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Parametersforretrievingworkflowinstances","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessInstanceListResultDTO"}}}},"500":{"description":"Errorfetchinginstances","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/instances/{instanceId}":{"get":{"summary":"GetWorkflowInstancebyID","description":"Getaworkflowexecution/run(instance)","operationId":"getInstanceById","parameters":[{"name":"instanceId","in":"path","required":true,"description":"IDoftheworkflowinstance","schema":{"type":"string"}},{"name":"includeAssessment","in":"query","required":false,"description":"Whethertoincludeassessment","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successfulresponse","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssessedProcessInstanceDTO"}}}},"500":{"description":"Errorfetchinginstance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/instances/statuses":{"get":{"operationId":"getWorkflowStatuses","summary":"Getworkflowstatuslist","description":"Retrievearraywiththestatusofallinstances","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunStatusDTO"}}}}},"500":{"description":"Errorfetchingworkflowstatuses","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/{workflowId}/execute":{"post":{"summary":"Executeaworkflow","description":"Executeaworkflow","operationId":"executeWorkflow","parameters":[{"name":"workflowId","in":"path","description":"IDoftheworkflowtoexecute","required":true,"schema":{"type":"string"}},{"name":"businessKey","in":"query","description":"IDoftheparentworkflow","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteWorkflowRequestDTO"}}}},"responses":{"200":{"description":"Successfulexecution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteWorkflowResponseDTO"}}}},"500":{"description":"InternalServerError","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/{workflowId}/{instanceId}/retrigger":{"post":{"summary":"Retriggeraninstance","description":"Retriggeraninstance","operationId":"retriggerInstance","parameters":[{"name":"workflowId","in":"path","description":"IDoftheworkflow","required":true,"schema":{"type":"string"}},{"name":"instanceId","in":"path","description":"IDoftheinstancetoretrigger","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"InternalServerError","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/workflows/instances/{instanceId}/abort":{"delete":{"summary":"Abortaworkflowinstance","operationId":"abortWorkflow","description":"AbortsaworkflowinstanceidentifiedbytheprovidedinstanceId.","parameters":[{"name":"instanceId","in":"path","required":true,"description":"Theidentifieroftheworkflowinstancetoabort.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfuloperation","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Errorabortingworkflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"description":"TheErrorResponseobjectrepresentsacommonstructureforhandlingerrorsinAPIresponses.Itincludesessentialinformationabouttheerror,suchastheerrormessageandadditionaloptionaldetails.","type":"object","properties":{"message":{"description":"Astringprovidingaconciseandhuman-readabledescriptionoftheencounterederror.ThisfieldisrequiredintheErrorResponseobject.","type":"string","default":"internalservererror"},"additionalInfo":{"description":"Anoptionalfieldthatcancontainadditionalinformationorcontextabouttheerror.Itprovidesflexibilityforincludingextradetailsbasedonspecificerrorscenarios.","type":"string"}},"required":["message"]},"GetInstancesRequest":{"type":"object","properties":{"paginationInfo":{"$ref":"#/components/schemas/PaginationInfoDTO"},"filters":{"$ref":"#/components/schemas/SearchRequest"}}},"GetOverviewsRequestParams":{"type":"object","properties":{"paginationInfo":{"$ref":"#/components/schemas/PaginationInfoDTO"},"filters":{"$ref":"#/components/schemas/SearchRequest"}}},"WorkflowOverviewListResultDTO":{"type":"object","properties":{"overviews":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowOverviewDTO"},"minItems":0},"paginationInfo":{"$ref":"#/components/schemas/PaginationInfoDTO"}}},"WorkflowOverviewDTO":{"type":"object","properties":{"workflowId":{"type":"string","description":"Workflowuniqueidentifier","minLength":1},"name":{"type":"string","description":"Workflowname","minLength":1},"format":{"$ref":"#/components/schemas/WorkflowFormatDTO"},"lastRunId":{"type":"string"},"lastTriggeredMs":{"type":"number","minimum":0},"lastRunStatus":{"$ref":"#/components/schemas/ProcessInstanceStatusDTO"},"category":{"$ref":"#/components/schemas/WorkflowCategoryDTO"},"avgDurationMs":{"type":"number","minimum":0},"description":{"type":"string"}},"required":["workflowId","format"]},"PaginationInfoDTO":{"type":"object","properties":{"pageSize":{"type":"number"},"offset":{"type":"number"},"totalCount":{"type":"number"},"orderDirection":{"enum":["ASC","DESC"]},"orderBy":{"type":"string"}},"additionalProperties":false},"WorkflowFormatDTO":{"type":"string","description":"Formatoftheworkflowdefinition","enum":["yaml","json"]},"WorkflowCategoryDTO":{"type":"string","description":"Categoryoftheworkflow","enum":["assessment","infrastructure"]},"WorkflowListResultDTO":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowDTO"}},"paginationInfo":{"$ref":"#/components/schemas/PaginationInfoDTO"}},"required":["items","paginationInfo"]},"WorkflowDTO":{"type":"object","properties":{"id":{"type":"string","description":"Workflowuniqueidentifier","minLength":1},"name":{"type":"string","description":"Workflowname","minLength":1},"format":{"$ref":"#/components/schemas/WorkflowFormatDTO"},"category":{"$ref":"#/components/schemas/WorkflowCategoryDTO"},"description":{"type":"string","description":"Descriptionoftheworkflow"},"annotations":{"type":"array","items":{"type":"string"}}},"required":["id","category","format"]},"ProcessInstanceListResultDTO":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProcessInstanceDTO"}},"paginationInfo":{"$ref":"#/components/schemas/PaginationInfoDTO"}}},"AssessedProcessInstanceDTO":{"type":"object","properties":{"instance":{"$ref":"#/components/schemas/ProcessInstanceDTO"},"assessedBy":{"$ref":"#/components/schemas/ProcessInstanceDTO"}},"required":["instance"]},"ProcessInstanceDTO":{"type":"object","properties":{"id":{"type":"string"},"processId":{"type":"string"},"processName":{"type":"string"},"status":{"$ref":"#/components/schemas/ProcessInstanceStatusDTO"},"endpoint":{"type":"string"},"serviceUrl":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"duration":{"type":"string"},"category":{"$ref":"#/components/schemas/WorkflowCategoryDTO"},"description":{"type":"string"},"workflowdata":{"$ref":"#/components/schemas/WorkflowDataDTO"},"businessKey":{"type":"string"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/NodeInstanceDTO"}},"error":{"$ref":"#/components/schemas/ProcessInstanceErrorDTO"}},"required":["id","processId","nodes"]},"WorkflowDataDTO":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/WorkflowResultDTO"}},"additionalProperties":true},"WorkflowResultDTO":{"description":"Resultofaworkflowexecution","type":"object","properties":{"completedWith":{"description":"Thestateofworkflowcompletion.","type":"string","enum":["error","success"]},"message":{"description":"High-levelsummaryofthecurrentstatus,free-formtext,humanreadable.","type":"string"},"nextWorkflows":{"description":"Listofworkflowssuggestedtorunnext.Itemsatlowerindexesareofhigherpriority.","type":"array","items":{"type":"object","properties":{"id":{"description":"Workflowidentifier","type":"string"},"name":{"description":"Humanreadabletitledescribingtheworkflow.","type":"string"}},"required":["id","name"]}},"outputs":{"description":"Additionalstructuredoutputofworkflowprocessing.Thiscancontainidentifiersofcreatedresources,linkstoresources,logsorotheroutput.","type":"array","items":{"type":"object","properties":{"key":{"description":"Uniqueidentifieroftheoption.Preferablyhuman-readable.","type":"string"},"value":{"description":"Freeformvalueoftheoption.","anyOf":[{"type":"string"},{"type":"number"}]},"format":{"description":"Moredetailedtypeofthe'value'property.Defaultsto'text'.","enum":["text","number","link"]}},"required":["key","value"]}}}},"ProcessInstanceStatusDTO":{"type":"string","description":"Statusoftheworkflowrun","enum":["Active","Error","Completed","Aborted","Suspended","Pending"]},"WorkflowRunStatusDTO":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"ExecuteWorkflowRequestDTO":{"type":"object","properties":{"inputData":{"type":"object","additionalProperties":true}},"required":["inputData"]},"ExecuteWorkflowResponseDTO":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"WorkflowProgressDTO":{"allOf":[{"$ref":"#/components/schemas/NodeInstanceDTO"},{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ProcessInstanceStatusDTO"},"error":{"$ref":"#/components/schemas/ProcessInstanceErrorDTO"}}}]},"NodeInstanceDTO":{"type":"object","properties":{"__typename":{"type":"string","default":"NodeInstance","description":"Typename"},"id":{"type":"string","description":"NodeinstanceID"},"name":{"type":"string","description":"Nodename"},"type":{"type":"string","description":"Nodetype"},"enter":{"type":"string","description":"Datewhenthenodewasentered"},"exit":{"type":"string","description":"Datewhenthenodewasexited(optional)"},"definitionId":{"type":"string","description":"DefinitionID"},"nodeId":{"type":"string","description":"NodeID"}},"required":["id"]},"ProcessInstanceErrorDTO":{"type":"object","properties":{"__typename":{"type":"string","default":"ProcessInstanceError","description":"Typename"},"nodeDefinitionId":{"type":"string","description":"NodedefinitionID"},"message":{"type":"string","description":"Errormessage(optional)"}},"required":["nodeDefinitionId"]},"SearchRequest":{"type":"object","properties":{"filters":{"$ref":"#/components/schemas/Filter"},"paginationInfo":{"$ref":"#/components/schemas/PaginationInfoDTO"}}},"Filter":{"oneOf":[{"$ref":"#/components/schemas/LogicalFilter"},{"$ref":"#/components/schemas/FieldFilter"}]},"LogicalFilter":{"type":"object","required":["operator","filters"],"properties":{"operator":{"type":"string","enum":["AND","OR","NOT"]},"filters":{"type":"array","items":{"$ref":"#/components/schemas/Filter"}}}},"FieldFilter":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string"},"operator":{"type":"string","enum":["EQ","GT","GTE","LT","LTE","IN","IS_NULL","CONTAINS","CONTAINS_ALL","CONTAINS_ANY","LIKE","BETWEEN"]},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}},"InputSchemaResponseDTO":{"type":"object","properties":{"inputSchema":{"type":"object"},"data":{"type":"object"}}}}}}`; -export const openApiDocument = JSON.parse(OPENAPI); diff --git a/plugins/orchestrator-common/src/generated/client/api.ts b/plugins/orchestrator-common/src/generated/client/api.ts deleted file mode 100644 index 6ea8b87c79..0000000000 --- a/plugins/orchestrator-common/src/generated/client/api.ts +++ /dev/null @@ -1,1706 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Orchestrator plugin - * API to interact with orchestrator plugin - * - * The version of the OpenAPI document: 0.0.1 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from './configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; -import type { RequestArgs } from './base'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; - -/** - * - * @export - * @interface AssessedProcessInstanceDTO - */ -export interface AssessedProcessInstanceDTO { - /** - * - * @type {ProcessInstanceDTO} - * @memberof AssessedProcessInstanceDTO - */ - 'instance': ProcessInstanceDTO; - /** - * - * @type {ProcessInstanceDTO} - * @memberof AssessedProcessInstanceDTO - */ - 'assessedBy'?: ProcessInstanceDTO; -} -/** - * The ErrorResponse object represents a common structure for handling errors in API responses. It includes essential information about the error, such as the error message and additional optional details. - * @export - * @interface ErrorResponse - */ -export interface ErrorResponse { - /** - * A string providing a concise and human-readable description of the encountered error. This field is required in the ErrorResponse object. - * @type {string} - * @memberof ErrorResponse - */ - 'message': string; - /** - * An optional field that can contain additional information or context about the error. It provides flexibility for including extra details based on specific error scenarios. - * @type {string} - * @memberof ErrorResponse - */ - 'additionalInfo'?: string; -} -/** - * - * @export - * @interface ExecuteWorkflowRequestDTO - */ -export interface ExecuteWorkflowRequestDTO { - /** - * - * @type {object} - * @memberof ExecuteWorkflowRequestDTO - */ - 'inputData': object; -} -/** - * - * @export - * @interface ExecuteWorkflowResponseDTO - */ -export interface ExecuteWorkflowResponseDTO { - /** - * - * @type {string} - * @memberof ExecuteWorkflowResponseDTO - */ - 'id': string; -} -/** - * - * @export - * @interface FieldFilter - */ -export interface FieldFilter { - /** - * - * @type {string} - * @memberof FieldFilter - */ - 'field': string; - /** - * - * @type {string} - * @memberof FieldFilter - */ - 'operator': FieldFilterOperatorEnum; - /** - * - * @type {FieldFilterValue} - * @memberof FieldFilter - */ - 'value': FieldFilterValue; -} - -export const FieldFilterOperatorEnum = { - Eq: 'EQ', - Gt: 'GT', - Gte: 'GTE', - Lt: 'LT', - Lte: 'LTE', - In: 'IN', - IsNull: 'IS_NULL', - Contains: 'CONTAINS', - ContainsAll: 'CONTAINS_ALL', - ContainsAny: 'CONTAINS_ANY', - Like: 'LIKE', - Between: 'BETWEEN' -} as const; - -export type FieldFilterOperatorEnum = typeof FieldFilterOperatorEnum[keyof typeof FieldFilterOperatorEnum]; - -/** - * @type FieldFilterValue - * @export - */ -export type FieldFilterValue = any | boolean | number | string; - -/** - * @type Filter - * @export - */ -export type Filter = FieldFilter | LogicalFilter; - -/** - * - * @export - * @interface GetInstancesRequest - */ -export interface GetInstancesRequest { - /** - * - * @type {PaginationInfoDTO} - * @memberof GetInstancesRequest - */ - 'paginationInfo'?: PaginationInfoDTO; - /** - * - * @type {SearchRequest} - * @memberof GetInstancesRequest - */ - 'filters'?: SearchRequest; -} -/** - * - * @export - * @interface GetOverviewsRequestParams - */ -export interface GetOverviewsRequestParams { - /** - * - * @type {PaginationInfoDTO} - * @memberof GetOverviewsRequestParams - */ - 'paginationInfo'?: PaginationInfoDTO; - /** - * - * @type {SearchRequest} - * @memberof GetOverviewsRequestParams - */ - 'filters'?: SearchRequest; -} -/** - * - * @export - * @interface InputSchemaResponseDTO - */ -export interface InputSchemaResponseDTO { - /** - * - * @type {object} - * @memberof InputSchemaResponseDTO - */ - 'inputSchema'?: object; - /** - * - * @type {object} - * @memberof InputSchemaResponseDTO - */ - 'data'?: object; -} -/** - * - * @export - * @interface LogicalFilter - */ -export interface LogicalFilter { - /** - * - * @type {string} - * @memberof LogicalFilter - */ - 'operator': LogicalFilterOperatorEnum; - /** - * - * @type {Array} - * @memberof LogicalFilter - */ - 'filters': Array; -} - -export const LogicalFilterOperatorEnum = { - And: 'AND', - Or: 'OR', - Not: 'NOT' -} as const; - -export type LogicalFilterOperatorEnum = typeof LogicalFilterOperatorEnum[keyof typeof LogicalFilterOperatorEnum]; - -/** - * - * @export - * @interface NodeInstanceDTO - */ -export interface NodeInstanceDTO { - /** - * Type name - * @type {string} - * @memberof NodeInstanceDTO - */ - '__typename'?: string; - /** - * Node instance ID - * @type {string} - * @memberof NodeInstanceDTO - */ - 'id': string; - /** - * Node name - * @type {string} - * @memberof NodeInstanceDTO - */ - 'name'?: string; - /** - * Node type - * @type {string} - * @memberof NodeInstanceDTO - */ - 'type'?: string; - /** - * Date when the node was entered - * @type {string} - * @memberof NodeInstanceDTO - */ - 'enter'?: string; - /** - * Date when the node was exited (optional) - * @type {string} - * @memberof NodeInstanceDTO - */ - 'exit'?: string; - /** - * Definition ID - * @type {string} - * @memberof NodeInstanceDTO - */ - 'definitionId'?: string; - /** - * Node ID - * @type {string} - * @memberof NodeInstanceDTO - */ - 'nodeId'?: string; -} -/** - * - * @export - * @interface PaginationInfoDTO - */ -export interface PaginationInfoDTO { - /** - * - * @type {number} - * @memberof PaginationInfoDTO - */ - 'pageSize'?: number; - /** - * - * @type {number} - * @memberof PaginationInfoDTO - */ - 'offset'?: number; - /** - * - * @type {number} - * @memberof PaginationInfoDTO - */ - 'totalCount'?: number; - /** - * - * @type {string} - * @memberof PaginationInfoDTO - */ - 'orderDirection'?: PaginationInfoDTOOrderDirectionEnum; - /** - * - * @type {string} - * @memberof PaginationInfoDTO - */ - 'orderBy'?: string; -} - -export const PaginationInfoDTOOrderDirectionEnum = { - Asc: 'ASC', - Desc: 'DESC' -} as const; - -export type PaginationInfoDTOOrderDirectionEnum = typeof PaginationInfoDTOOrderDirectionEnum[keyof typeof PaginationInfoDTOOrderDirectionEnum]; - -/** - * - * @export - * @interface ProcessInstanceDTO - */ -export interface ProcessInstanceDTO { - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'id': string; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'processId': string; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'processName'?: string; - /** - * - * @type {ProcessInstanceStatusDTO} - * @memberof ProcessInstanceDTO - */ - 'status'?: ProcessInstanceStatusDTO; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'endpoint'?: string; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'serviceUrl'?: string; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'start'?: string; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'end'?: string; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'duration'?: string; - /** - * - * @type {WorkflowCategoryDTO} - * @memberof ProcessInstanceDTO - */ - 'category'?: WorkflowCategoryDTO; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'description'?: string; - /** - * - * @type {WorkflowDataDTO} - * @memberof ProcessInstanceDTO - */ - 'workflowdata'?: WorkflowDataDTO; - /** - * - * @type {string} - * @memberof ProcessInstanceDTO - */ - 'businessKey'?: string; - /** - * - * @type {Array} - * @memberof ProcessInstanceDTO - */ - 'nodes': Array; - /** - * - * @type {ProcessInstanceErrorDTO} - * @memberof ProcessInstanceDTO - */ - 'error'?: ProcessInstanceErrorDTO; -} - - -/** - * - * @export - * @interface ProcessInstanceErrorDTO - */ -export interface ProcessInstanceErrorDTO { - /** - * Type name - * @type {string} - * @memberof ProcessInstanceErrorDTO - */ - '__typename'?: string; - /** - * Node definition ID - * @type {string} - * @memberof ProcessInstanceErrorDTO - */ - 'nodeDefinitionId': string; - /** - * Error message (optional) - * @type {string} - * @memberof ProcessInstanceErrorDTO - */ - 'message'?: string; -} -/** - * - * @export - * @interface ProcessInstanceListResultDTO - */ -export interface ProcessInstanceListResultDTO { - /** - * - * @type {Array} - * @memberof ProcessInstanceListResultDTO - */ - 'items'?: Array; - /** - * - * @type {PaginationInfoDTO} - * @memberof ProcessInstanceListResultDTO - */ - 'paginationInfo'?: PaginationInfoDTO; -} -/** - * Status of the workflow run - * @export - * @enum {string} - */ - -export const ProcessInstanceStatusDTO = { - Active: 'Active', - Error: 'Error', - Completed: 'Completed', - Aborted: 'Aborted', - Suspended: 'Suspended', - Pending: 'Pending' -} as const; - -export type ProcessInstanceStatusDTO = typeof ProcessInstanceStatusDTO[keyof typeof ProcessInstanceStatusDTO]; - - -/** - * - * @export - * @interface SearchRequest - */ -export interface SearchRequest { - /** - * - * @type {Filter} - * @memberof SearchRequest - */ - 'filters'?: Filter; - /** - * - * @type {PaginationInfoDTO} - * @memberof SearchRequest - */ - 'paginationInfo'?: PaginationInfoDTO; -} -/** - * Category of the workflow - * @export - * @enum {string} - */ - -export const WorkflowCategoryDTO = { - Assessment: 'assessment', - Infrastructure: 'infrastructure' -} as const; - -export type WorkflowCategoryDTO = typeof WorkflowCategoryDTO[keyof typeof WorkflowCategoryDTO]; - - -/** - * - * @export - * @interface WorkflowDTO - */ -export interface WorkflowDTO { - /** - * Workflow unique identifier - * @type {string} - * @memberof WorkflowDTO - */ - 'id': string; - /** - * Workflow name - * @type {string} - * @memberof WorkflowDTO - */ - 'name'?: string; - /** - * - * @type {WorkflowFormatDTO} - * @memberof WorkflowDTO - */ - 'format': WorkflowFormatDTO; - /** - * - * @type {WorkflowCategoryDTO} - * @memberof WorkflowDTO - */ - 'category': WorkflowCategoryDTO; - /** - * Description of the workflow - * @type {string} - * @memberof WorkflowDTO - */ - 'description'?: string; - /** - * - * @type {Array} - * @memberof WorkflowDTO - */ - 'annotations'?: Array; -} - - -/** - * - * @export - * @interface WorkflowDataDTO - */ -export interface WorkflowDataDTO { - /** - * - * @type {WorkflowResultDTO} - * @memberof WorkflowDataDTO - */ - 'result'?: WorkflowResultDTO; -} -/** - * Format of the workflow definition - * @export - * @enum {string} - */ - -export const WorkflowFormatDTO = { - Yaml: 'yaml', - Json: 'json' -} as const; - -export type WorkflowFormatDTO = typeof WorkflowFormatDTO[keyof typeof WorkflowFormatDTO]; - - -/** - * - * @export - * @interface WorkflowListResultDTO - */ -export interface WorkflowListResultDTO { - /** - * - * @type {Array} - * @memberof WorkflowListResultDTO - */ - 'items': Array; - /** - * - * @type {PaginationInfoDTO} - * @memberof WorkflowListResultDTO - */ - 'paginationInfo': PaginationInfoDTO; -} -/** - * - * @export - * @interface WorkflowOverviewDTO - */ -export interface WorkflowOverviewDTO { - /** - * Workflow unique identifier - * @type {string} - * @memberof WorkflowOverviewDTO - */ - 'workflowId': string; - /** - * Workflow name - * @type {string} - * @memberof WorkflowOverviewDTO - */ - 'name'?: string; - /** - * - * @type {WorkflowFormatDTO} - * @memberof WorkflowOverviewDTO - */ - 'format': WorkflowFormatDTO; - /** - * - * @type {string} - * @memberof WorkflowOverviewDTO - */ - 'lastRunId'?: string; - /** - * - * @type {number} - * @memberof WorkflowOverviewDTO - */ - 'lastTriggeredMs'?: number; - /** - * - * @type {ProcessInstanceStatusDTO} - * @memberof WorkflowOverviewDTO - */ - 'lastRunStatus'?: ProcessInstanceStatusDTO; - /** - * - * @type {WorkflowCategoryDTO} - * @memberof WorkflowOverviewDTO - */ - 'category'?: WorkflowCategoryDTO; - /** - * - * @type {number} - * @memberof WorkflowOverviewDTO - */ - 'avgDurationMs'?: number; - /** - * - * @type {string} - * @memberof WorkflowOverviewDTO - */ - 'description'?: string; -} - - -/** - * - * @export - * @interface WorkflowOverviewListResultDTO - */ -export interface WorkflowOverviewListResultDTO { - /** - * - * @type {Array} - * @memberof WorkflowOverviewListResultDTO - */ - 'overviews'?: Array; - /** - * - * @type {PaginationInfoDTO} - * @memberof WorkflowOverviewListResultDTO - */ - 'paginationInfo'?: PaginationInfoDTO; -} -/** - * - * @export - * @interface WorkflowProgressDTO - */ -export interface WorkflowProgressDTO { - /** - * Type name - * @type {any} - * @memberof WorkflowProgressDTO - */ - '__typename'?: any; - /** - * Node instance ID - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'id': any; - /** - * Node name - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'name'?: any; - /** - * Node type - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'type'?: any; - /** - * Date when the node was entered - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'enter'?: any; - /** - * Date when the node was exited (optional) - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'exit'?: any; - /** - * Definition ID - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'definitionId'?: any; - /** - * Node ID - * @type {any} - * @memberof WorkflowProgressDTO - */ - 'nodeId'?: any; - /** - * - * @type {ProcessInstanceStatusDTO} - * @memberof WorkflowProgressDTO - */ - 'status'?: ProcessInstanceStatusDTO; - /** - * - * @type {ProcessInstanceErrorDTO} - * @memberof WorkflowProgressDTO - */ - 'error'?: ProcessInstanceErrorDTO; -} - - -/** - * Result of a workflow execution - * @export - * @interface WorkflowResultDTO - */ -export interface WorkflowResultDTO { - /** - * The state of workflow completion. - * @type {string} - * @memberof WorkflowResultDTO - */ - 'completedWith'?: WorkflowResultDTOCompletedWithEnum; - /** - * High-level summary of the current status, free-form text, human readable. - * @type {string} - * @memberof WorkflowResultDTO - */ - 'message'?: string; - /** - * List of workflows suggested to run next. Items at lower indexes are of higher priority. - * @type {Array} - * @memberof WorkflowResultDTO - */ - 'nextWorkflows'?: Array; - /** - * Additional structured output of workflow processing. This can contain identifiers of created resources, links to resources, logs or other output. - * @type {Array} - * @memberof WorkflowResultDTO - */ - 'outputs'?: Array; -} - -export const WorkflowResultDTOCompletedWithEnum = { - Error: 'error', - Success: 'success' -} as const; - -export type WorkflowResultDTOCompletedWithEnum = typeof WorkflowResultDTOCompletedWithEnum[keyof typeof WorkflowResultDTOCompletedWithEnum]; - -/** - * - * @export - * @interface WorkflowResultDTONextWorkflowsInner - */ -export interface WorkflowResultDTONextWorkflowsInner { - /** - * Workflow identifier - * @type {string} - * @memberof WorkflowResultDTONextWorkflowsInner - */ - 'id': string; - /** - * Human readable title describing the workflow. - * @type {string} - * @memberof WorkflowResultDTONextWorkflowsInner - */ - 'name': string; -} -/** - * - * @export - * @interface WorkflowResultDTOOutputsInner - */ -export interface WorkflowResultDTOOutputsInner { - /** - * Unique identifier of the option. Preferably human-readable. - * @type {string} - * @memberof WorkflowResultDTOOutputsInner - */ - 'key': string; - /** - * - * @type {WorkflowResultDTOOutputsInnerValue} - * @memberof WorkflowResultDTOOutputsInner - */ - 'value': WorkflowResultDTOOutputsInnerValue; - /** - * More detailed type of the \'value\' property. Defaults to \'text\'. - * @type {string} - * @memberof WorkflowResultDTOOutputsInner - */ - 'format'?: WorkflowResultDTOOutputsInnerFormatEnum; -} - -export const WorkflowResultDTOOutputsInnerFormatEnum = { - Text: 'text', - Number: 'number', - Link: 'link' -} as const; - -export type WorkflowResultDTOOutputsInnerFormatEnum = typeof WorkflowResultDTOOutputsInnerFormatEnum[keyof typeof WorkflowResultDTOOutputsInnerFormatEnum]; - -/** - * Free form value of the option. - * @export - * @interface WorkflowResultDTOOutputsInnerValue - */ -export interface WorkflowResultDTOOutputsInnerValue { -} -/** - * - * @export - * @interface WorkflowRunStatusDTO - */ -export interface WorkflowRunStatusDTO { - /** - * - * @type {string} - * @memberof WorkflowRunStatusDTO - */ - 'key'?: string; - /** - * - * @type {string} - * @memberof WorkflowRunStatusDTO - */ - 'value'?: string; -} - -/** - * DefaultApi - axios parameter creator - * @export - */ -export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Aborts a workflow instance identified by the provided instanceId. - * @summary Abort a workflow instance - * @param {string} instanceId The identifier of the workflow instance to abort. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - abortWorkflow: async (instanceId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instanceId' is not null or undefined - assertParamExists('abortWorkflow', 'instanceId', instanceId) - const localVarPath = `/v2/workflows/instances/{instanceId}/abort` - .replace(`{${"instanceId"}}`, encodeURIComponent(String(instanceId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Execute a workflow - * @summary Execute a workflow - * @param {string} workflowId ID of the workflow to execute - * @param {ExecuteWorkflowRequestDTO} executeWorkflowRequestDTO - * @param {string} [businessKey] ID of the parent workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - executeWorkflow: async (workflowId: string, executeWorkflowRequestDTO: ExecuteWorkflowRequestDTO, businessKey?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'workflowId' is not null or undefined - assertParamExists('executeWorkflow', 'workflowId', workflowId) - // verify required parameter 'executeWorkflowRequestDTO' is not null or undefined - assertParamExists('executeWorkflow', 'executeWorkflowRequestDTO', executeWorkflowRequestDTO) - const localVarPath = `/v2/workflows/{workflowId}/execute` - .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (businessKey !== undefined) { - localVarQueryParameter['businessKey'] = businessKey; - } - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(executeWorkflowRequestDTO, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a workflow execution/run (instance) - * @summary Get Workflow Instance by ID - * @param {string} instanceId ID of the workflow instance - * @param {boolean} [includeAssessment] Whether to include assessment - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstanceById: async (instanceId: string, includeAssessment?: boolean, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'instanceId' is not null or undefined - assertParamExists('getInstanceById', 'instanceId', instanceId) - const localVarPath = `/v2/workflows/instances/{instanceId}` - .replace(`{${"instanceId"}}`, encodeURIComponent(String(instanceId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (includeAssessment !== undefined) { - localVarQueryParameter['includeAssessment'] = includeAssessment; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve an array of workflow executions (instances) - * @summary Get instances - * @param {GetInstancesRequest} [getInstancesRequest] Parameters for retrieving instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstances: async (getInstancesRequest?: GetInstancesRequest, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v2/workflows/instances`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(getInstancesRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get the workflow input schema. It defines the input fields of the workflow - * @param {string} workflowId ID of the workflow to fetch - * @param {string} [instanceId] ID of instance - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowInputSchemaById: async (workflowId: string, instanceId?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'workflowId' is not null or undefined - assertParamExists('getWorkflowInputSchemaById', 'workflowId', workflowId) - const localVarPath = `/v2/workflows/{workflowId}/inputSchema` - .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (instanceId !== undefined) { - localVarQueryParameter['instanceId'] = instanceId; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve an array of workflow executions (instances) for the given workflow - * @summary Get instances for a specific workflow - * @param {string} workflowId ID of the workflow - * @param {SearchRequest} [searchRequest] Parameters for retrieving workflow instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowInstances: async (workflowId: string, searchRequest?: SearchRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'workflowId' is not null or undefined - assertParamExists('getWorkflowInstances', 'workflowId', workflowId) - const localVarPath = `/v2/workflows/{workflowId}/instances` - .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(searchRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {string} workflowId Unique identifier of the workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowOverviewById: async (workflowId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'workflowId' is not null or undefined - assertParamExists('getWorkflowOverviewById', 'workflowId', workflowId) - const localVarPath = `/v2/workflows/{workflowId}/overview` - .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get the workflow\'s definition - * @param {string} workflowId ID of the workflow to fetch - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowSourceById: async (workflowId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'workflowId' is not null or undefined - assertParamExists('getWorkflowSourceById', 'workflowId', workflowId) - const localVarPath = `/v2/workflows/{workflowId}/source` - .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve array with the status of all instances - * @summary Get workflow status list - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowStatuses: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v2/workflows/instances/statuses`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {SearchRequest} [searchRequest] Pagination and filters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowsOverview: async (searchRequest?: SearchRequest, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v2/workflows/overview`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(searchRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrigger an instance - * @summary Retrigger an instance - * @param {string} workflowId ID of the workflow - * @param {string} instanceId ID of the instance to retrigger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - retriggerInstance: async (workflowId: string, instanceId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'workflowId' is not null or undefined - assertParamExists('retriggerInstance', 'workflowId', workflowId) - // verify required parameter 'instanceId' is not null or undefined - assertParamExists('retriggerInstance', 'instanceId', instanceId) - const localVarPath = `/v2/workflows/{workflowId}/{instanceId}/retrigger` - .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))) - .replace(`{${"instanceId"}}`, encodeURIComponent(String(instanceId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DefaultApi - functional programming interface - * @export - */ -export const DefaultApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) - return { - /** - * Aborts a workflow instance identified by the provided instanceId. - * @summary Abort a workflow instance - * @param {string} instanceId The identifier of the workflow instance to abort. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async abortWorkflow(instanceId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.abortWorkflow(instanceId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.abortWorkflow']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Execute a workflow - * @summary Execute a workflow - * @param {string} workflowId ID of the workflow to execute - * @param {ExecuteWorkflowRequestDTO} executeWorkflowRequestDTO - * @param {string} [businessKey] ID of the parent workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async executeWorkflow(workflowId: string, executeWorkflowRequestDTO: ExecuteWorkflowRequestDTO, businessKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.executeWorkflow']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Get a workflow execution/run (instance) - * @summary Get Workflow Instance by ID - * @param {string} instanceId ID of the workflow instance - * @param {boolean} [includeAssessment] Whether to include assessment - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstanceById(instanceId: string, includeAssessment?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstanceById(instanceId, includeAssessment, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getInstanceById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieve an array of workflow executions (instances) - * @summary Get instances - * @param {GetInstancesRequest} [getInstancesRequest] Parameters for retrieving instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInstances(getInstancesRequest?: GetInstancesRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInstances(getInstancesRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getInstances']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Get the workflow input schema. It defines the input fields of the workflow - * @param {string} workflowId ID of the workflow to fetch - * @param {string} [instanceId] ID of instance - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getWorkflowInputSchemaById(workflowId: string, instanceId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflowInputSchemaById(workflowId, instanceId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getWorkflowInputSchemaById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieve an array of workflow executions (instances) for the given workflow - * @summary Get instances for a specific workflow - * @param {string} workflowId ID of the workflow - * @param {SearchRequest} [searchRequest] Parameters for retrieving workflow instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getWorkflowInstances(workflowId: string, searchRequest?: SearchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflowInstances(workflowId, searchRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getWorkflowInstances']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {string} workflowId Unique identifier of the workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getWorkflowOverviewById(workflowId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflowOverviewById(workflowId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getWorkflowOverviewById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Get the workflow\'s definition - * @param {string} workflowId ID of the workflow to fetch - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getWorkflowSourceById(workflowId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflowSourceById(workflowId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getWorkflowSourceById']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieve array with the status of all instances - * @summary Get workflow status list - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getWorkflowStatuses(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflowStatuses(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getWorkflowStatuses']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {SearchRequest} [searchRequest] Pagination and filters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getWorkflowsOverview(searchRequest?: SearchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflowsOverview(searchRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getWorkflowsOverview']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrigger an instance - * @summary Retrigger an instance - * @param {string} workflowId ID of the workflow - * @param {string} instanceId ID of the instance to retrigger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async retriggerInstance(workflowId: string, instanceId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.retriggerInstance(workflowId, instanceId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.retriggerInstance']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DefaultApi - factory interface - * @export - */ -export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DefaultApiFp(configuration) - return { - /** - * Aborts a workflow instance identified by the provided instanceId. - * @summary Abort a workflow instance - * @param {string} instanceId The identifier of the workflow instance to abort. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - abortWorkflow(instanceId: string, options?: any): AxiosPromise { - return localVarFp.abortWorkflow(instanceId, options).then((request) => request(axios, basePath)); - }, - /** - * Execute a workflow - * @summary Execute a workflow - * @param {string} workflowId ID of the workflow to execute - * @param {ExecuteWorkflowRequestDTO} executeWorkflowRequestDTO - * @param {string} [businessKey] ID of the parent workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - executeWorkflow(workflowId: string, executeWorkflowRequestDTO: ExecuteWorkflowRequestDTO, businessKey?: string, options?: any): AxiosPromise { - return localVarFp.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey, options).then((request) => request(axios, basePath)); - }, - /** - * Get a workflow execution/run (instance) - * @summary Get Workflow Instance by ID - * @param {string} instanceId ID of the workflow instance - * @param {boolean} [includeAssessment] Whether to include assessment - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstanceById(instanceId: string, includeAssessment?: boolean, options?: any): AxiosPromise { - return localVarFp.getInstanceById(instanceId, includeAssessment, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve an array of workflow executions (instances) - * @summary Get instances - * @param {GetInstancesRequest} [getInstancesRequest] Parameters for retrieving instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInstances(getInstancesRequest?: GetInstancesRequest, options?: any): AxiosPromise { - return localVarFp.getInstances(getInstancesRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Get the workflow input schema. It defines the input fields of the workflow - * @param {string} workflowId ID of the workflow to fetch - * @param {string} [instanceId] ID of instance - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowInputSchemaById(workflowId: string, instanceId?: string, options?: any): AxiosPromise { - return localVarFp.getWorkflowInputSchemaById(workflowId, instanceId, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve an array of workflow executions (instances) for the given workflow - * @summary Get instances for a specific workflow - * @param {string} workflowId ID of the workflow - * @param {SearchRequest} [searchRequest] Parameters for retrieving workflow instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowInstances(workflowId: string, searchRequest?: SearchRequest, options?: any): AxiosPromise { - return localVarFp.getWorkflowInstances(workflowId, searchRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {string} workflowId Unique identifier of the workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowOverviewById(workflowId: string, options?: any): AxiosPromise { - return localVarFp.getWorkflowOverviewById(workflowId, options).then((request) => request(axios, basePath)); - }, - /** - * Get the workflow\'s definition - * @param {string} workflowId ID of the workflow to fetch - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowSourceById(workflowId: string, options?: any): AxiosPromise { - return localVarFp.getWorkflowSourceById(workflowId, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve array with the status of all instances - * @summary Get workflow status list - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowStatuses(options?: any): AxiosPromise> { - return localVarFp.getWorkflowStatuses(options).then((request) => request(axios, basePath)); - }, - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {SearchRequest} [searchRequest] Pagination and filters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getWorkflowsOverview(searchRequest?: SearchRequest, options?: any): AxiosPromise { - return localVarFp.getWorkflowsOverview(searchRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Retrigger an instance - * @summary Retrigger an instance - * @param {string} workflowId ID of the workflow - * @param {string} instanceId ID of the instance to retrigger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - retriggerInstance(workflowId: string, instanceId: string, options?: any): AxiosPromise { - return localVarFp.retriggerInstance(workflowId, instanceId, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DefaultApi - object-oriented interface - * @export - * @class DefaultApi - * @extends {BaseAPI} - */ -export class DefaultApi extends BaseAPI { - /** - * Aborts a workflow instance identified by the provided instanceId. - * @summary Abort a workflow instance - * @param {string} instanceId The identifier of the workflow instance to abort. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public abortWorkflow(instanceId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).abortWorkflow(instanceId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Execute a workflow - * @summary Execute a workflow - * @param {string} workflowId ID of the workflow to execute - * @param {ExecuteWorkflowRequestDTO} executeWorkflowRequestDTO - * @param {string} [businessKey] ID of the parent workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public executeWorkflow(workflowId: string, executeWorkflowRequestDTO: ExecuteWorkflowRequestDTO, businessKey?: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a workflow execution/run (instance) - * @summary Get Workflow Instance by ID - * @param {string} instanceId ID of the workflow instance - * @param {boolean} [includeAssessment] Whether to include assessment - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getInstanceById(instanceId: string, includeAssessment?: boolean, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getInstanceById(instanceId, includeAssessment, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve an array of workflow executions (instances) - * @summary Get instances - * @param {GetInstancesRequest} [getInstancesRequest] Parameters for retrieving instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getInstances(getInstancesRequest?: GetInstancesRequest, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getInstances(getInstancesRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Get the workflow input schema. It defines the input fields of the workflow - * @param {string} workflowId ID of the workflow to fetch - * @param {string} [instanceId] ID of instance - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getWorkflowInputSchemaById(workflowId: string, instanceId?: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getWorkflowInputSchemaById(workflowId, instanceId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve an array of workflow executions (instances) for the given workflow - * @summary Get instances for a specific workflow - * @param {string} workflowId ID of the workflow - * @param {SearchRequest} [searchRequest] Parameters for retrieving workflow instances - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getWorkflowInstances(workflowId: string, searchRequest?: SearchRequest, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getWorkflowInstances(workflowId, searchRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {string} workflowId Unique identifier of the workflow - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getWorkflowOverviewById(workflowId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getWorkflowOverviewById(workflowId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Get the workflow\'s definition - * @param {string} workflowId ID of the workflow to fetch - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getWorkflowSourceById(workflowId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getWorkflowSourceById(workflowId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve array with the status of all instances - * @summary Get workflow status list - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getWorkflowStatuses(options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getWorkflowStatuses(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the key fields of the workflow including data on the last run instance - * @param {SearchRequest} [searchRequest] Pagination and filters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getWorkflowsOverview(searchRequest?: SearchRequest, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getWorkflowsOverview(searchRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrigger an instance - * @summary Retrigger an instance - * @param {string} workflowId ID of the workflow - * @param {string} instanceId ID of the instance to retrigger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public retriggerInstance(workflowId: string, instanceId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).retriggerInstance(workflowId, instanceId, options).then((request) => request(this.axios, this.basePath)); - } -} - - - diff --git a/plugins/orchestrator-common/src/generated/docs/html/index.html b/plugins/orchestrator-common/src/generated/docs/html/index.html deleted file mode 100644 index 044ab5f915..0000000000 --- a/plugins/orchestrator-common/src/generated/docs/html/index.html +++ /dev/null @@ -1,8068 +0,0 @@ - - - - - Orchestrator plugin - - - - - - - - - - - - - - - - - -
-
- -
-
-
-

Orchestrator plugin

-
-
-
- -
-
-

Default

-
-
-
-

abortWorkflow

-

Abort a workflow instance

-
-
-
-

-

Aborts a workflow instance identified by the provided instanceId.

-

-
-
/v2/workflows/instances/{instanceId}/abort
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X DELETE \
- -H "Accept: text/plain,application/json" \
- "http://localhost/v2/workflows/instances/{instanceId}/abort"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String instanceId = instanceId_example; // String | The identifier of the workflow instance to abort.
-
-        try {
-            'String' result = apiInstance.abortWorkflow(instanceId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#abortWorkflow");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String instanceId = new String(); // String | The identifier of the workflow instance to abort.
-
-try {
-    final result = await api_instance.abortWorkflow(instanceId);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->abortWorkflow: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String instanceId = instanceId_example; // String | The identifier of the workflow instance to abort.
-
-        try {
-            'String' result = apiInstance.abortWorkflow(instanceId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#abortWorkflow");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *instanceId = instanceId_example; // The identifier of the workflow instance to abort. (default to null)
-
-// Abort a workflow instance
-[apiInstance abortWorkflowWith:instanceId
-              completionHandler: ^('String' output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var instanceId = instanceId_example; // {String} The identifier of the workflow instance to abort.
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.abortWorkflow(instanceId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class abortWorkflowExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var instanceId = instanceId_example;  // String | The identifier of the workflow instance to abort. (default to null)
-
-            try {
-                // Abort a workflow instance
-                'String' result = apiInstance.abortWorkflow(instanceId);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.abortWorkflow: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$instanceId = instanceId_example; // String | The identifier of the workflow instance to abort.
-
-try {
-    $result = $api_instance->abortWorkflow($instanceId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->abortWorkflow: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $instanceId = instanceId_example; # String | The identifier of the workflow instance to abort.
-
-eval {
-    my $result = $api_instance->abortWorkflow(instanceId => $instanceId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->abortWorkflow: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-instanceId = instanceId_example # String | The identifier of the workflow instance to abort. (default to null)
-
-try:
-    # Abort a workflow instance
-    api_response = api_instance.abort_workflow(instanceId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->abortWorkflow: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let instanceId = instanceId_example; // String
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.abortWorkflow(instanceId, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
instanceId* - - -
-
-
- - String - - -
-The identifier of the workflow instance to abort. -
-
-
- Required -
-
-
-
- - - - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

executeWorkflow

-

Execute a workflow

-
-
-
-

-

Execute a workflow

-

-
-
/v2/workflows/{workflowId}/execute
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X POST \
- -H "Accept: application/json" \
- -H "Content-Type: application/json" \
- "http://localhost/v2/workflows/{workflowId}/execute?businessKey=businessKey_example" \
- -d '{
-  "inputData" : "{}"
-}'
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow to execute
-        ExecuteWorkflowRequestDTO executeWorkflowRequestDTO = ; // ExecuteWorkflowRequestDTO | 
-        String businessKey = businessKey_example; // String | ID of the parent workflow
-
-        try {
-            ExecuteWorkflowResponseDTO result = apiInstance.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#executeWorkflow");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String workflowId = new String(); // String | ID of the workflow to execute
-final ExecuteWorkflowRequestDTO executeWorkflowRequestDTO = new ExecuteWorkflowRequestDTO(); // ExecuteWorkflowRequestDTO | 
-final String businessKey = new String(); // String | ID of the parent workflow
-
-try {
-    final result = await api_instance.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->executeWorkflow: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow to execute
-        ExecuteWorkflowRequestDTO executeWorkflowRequestDTO = ; // ExecuteWorkflowRequestDTO | 
-        String businessKey = businessKey_example; // String | ID of the parent workflow
-
-        try {
-            ExecuteWorkflowResponseDTO result = apiInstance.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#executeWorkflow");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *workflowId = workflowId_example; // ID of the workflow to execute (default to null)
-ExecuteWorkflowRequestDTO *executeWorkflowRequestDTO = ; // 
-String *businessKey = businessKey_example; // ID of the parent workflow (optional) (default to null)
-
-// Execute a workflow
-[apiInstance executeWorkflowWith:workflowId
-    executeWorkflowRequestDTO:executeWorkflowRequestDTO
-    businessKey:businessKey
-              completionHandler: ^(ExecuteWorkflowResponseDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var workflowId = workflowId_example; // {String} ID of the workflow to execute
-var executeWorkflowRequestDTO = ; // {ExecuteWorkflowRequestDTO} 
-var opts = {
-  'businessKey': businessKey_example // {String} ID of the parent workflow
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.executeWorkflow(workflowId, executeWorkflowRequestDTO, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class executeWorkflowExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var workflowId = workflowId_example;  // String | ID of the workflow to execute (default to null)
-            var executeWorkflowRequestDTO = new ExecuteWorkflowRequestDTO(); // ExecuteWorkflowRequestDTO | 
-            var businessKey = businessKey_example;  // String | ID of the parent workflow (optional)  (default to null)
-
-            try {
-                // Execute a workflow
-                ExecuteWorkflowResponseDTO result = apiInstance.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.executeWorkflow: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$workflowId = workflowId_example; // String | ID of the workflow to execute
-$executeWorkflowRequestDTO = ; // ExecuteWorkflowRequestDTO | 
-$businessKey = businessKey_example; // String | ID of the parent workflow
-
-try {
-    $result = $api_instance->executeWorkflow($workflowId, $executeWorkflowRequestDTO, $businessKey);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->executeWorkflow: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $workflowId = workflowId_example; # String | ID of the workflow to execute
-my $executeWorkflowRequestDTO = WWW::OPenAPIClient::Object::ExecuteWorkflowRequestDTO->new(); # ExecuteWorkflowRequestDTO | 
-my $businessKey = businessKey_example; # String | ID of the parent workflow
-
-eval {
-    my $result = $api_instance->executeWorkflow(workflowId => $workflowId, executeWorkflowRequestDTO => $executeWorkflowRequestDTO, businessKey => $businessKey);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->executeWorkflow: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-workflowId = workflowId_example # String | ID of the workflow to execute (default to null)
-executeWorkflowRequestDTO =  # ExecuteWorkflowRequestDTO | 
-businessKey = businessKey_example # String | ID of the parent workflow (optional) (default to null)
-
-try:
-    # Execute a workflow
-    api_response = api_instance.execute_workflow(workflowId, executeWorkflowRequestDTO, businessKey=businessKey)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->executeWorkflow: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let workflowId = workflowId_example; // String
-    let executeWorkflowRequestDTO = ; // ExecuteWorkflowRequestDTO
-    let businessKey = businessKey_example; // String
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.executeWorkflow(workflowId, executeWorkflowRequestDTO, businessKey, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
workflowId* - - -
-
-
- - String - - -
-ID of the workflow to execute -
-
-
- Required -
-
-
-
- - -
Body parameters
- - - - - - - - - -
NameDescription
executeWorkflowRequestDTO * -

- -
-
- - -
Query parameters
- - - - - - - - - -
NameDescription
businessKey - - -
-
-
- - String - - -
-ID of the parent workflow -
-
-
-
-
- -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getInstanceById

-

Get Workflow Instance by ID

-
-
-
-

-

Get a workflow execution/run (instance)

-

-
-
/v2/workflows/instances/{instanceId}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X GET \
- -H "Accept: application/json" \
- "http://localhost/v2/workflows/instances/{instanceId}?includeAssessment=true"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String instanceId = instanceId_example; // String | ID of the workflow instance
-        Boolean includeAssessment = true; // Boolean | Whether to include assessment
-
-        try {
-            AssessedProcessInstanceDTO result = apiInstance.getInstanceById(instanceId, includeAssessment);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getInstanceById");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String instanceId = new String(); // String | ID of the workflow instance
-final Boolean includeAssessment = new Boolean(); // Boolean | Whether to include assessment
-
-try {
-    final result = await api_instance.getInstanceById(instanceId, includeAssessment);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getInstanceById: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String instanceId = instanceId_example; // String | ID of the workflow instance
-        Boolean includeAssessment = true; // Boolean | Whether to include assessment
-
-        try {
-            AssessedProcessInstanceDTO result = apiInstance.getInstanceById(instanceId, includeAssessment);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getInstanceById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *instanceId = instanceId_example; // ID of the workflow instance (default to null)
-Boolean *includeAssessment = true; // Whether to include assessment (optional) (default to false)
-
-// Get Workflow Instance by ID
-[apiInstance getInstanceByIdWith:instanceId
-    includeAssessment:includeAssessment
-              completionHandler: ^(AssessedProcessInstanceDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var instanceId = instanceId_example; // {String} ID of the workflow instance
-var opts = {
-  'includeAssessment': true // {Boolean} Whether to include assessment
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getInstanceById(instanceId, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getInstanceByIdExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var instanceId = instanceId_example;  // String | ID of the workflow instance (default to null)
-            var includeAssessment = true;  // Boolean | Whether to include assessment (optional)  (default to false)
-
-            try {
-                // Get Workflow Instance by ID
-                AssessedProcessInstanceDTO result = apiInstance.getInstanceById(instanceId, includeAssessment);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getInstanceById: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$instanceId = instanceId_example; // String | ID of the workflow instance
-$includeAssessment = true; // Boolean | Whether to include assessment
-
-try {
-    $result = $api_instance->getInstanceById($instanceId, $includeAssessment);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getInstanceById: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $instanceId = instanceId_example; # String | ID of the workflow instance
-my $includeAssessment = true; # Boolean | Whether to include assessment
-
-eval {
-    my $result = $api_instance->getInstanceById(instanceId => $instanceId, includeAssessment => $includeAssessment);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getInstanceById: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-instanceId = instanceId_example # String | ID of the workflow instance (default to null)
-includeAssessment = true # Boolean | Whether to include assessment (optional) (default to false)
-
-try:
-    # Get Workflow Instance by ID
-    api_response = api_instance.get_instance_by_id(instanceId, includeAssessment=includeAssessment)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getInstanceById: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let instanceId = instanceId_example; // String
-    let includeAssessment = true; // Boolean
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getInstanceById(instanceId, includeAssessment, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
instanceId* - - -
-
-
- - String - - -
-ID of the workflow instance -
-
-
- Required -
-
-
-
- - - - -
Query parameters
- - - - - - - - - -
NameDescription
includeAssessment - - -
-
-
- - Boolean - - -
-Whether to include assessment -
-
-
-
-
- -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getInstances

-

Get instances

-
-
-
-

-

Retrieve an array of workflow executions (instances)

-

-
-
/v2/workflows/instances
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X POST \
- -H "Accept: application/json" \
- -H "Content-Type: application/json" \
- "http://localhost/v2/workflows/instances" \
- -d '{
-  "paginationInfo" : {
-    "offset" : 5.962133916683182,
-    "pageSize" : 1.4658129805029452,
-    "orderDirection" : "ASC",
-    "orderBy" : "orderBy",
-    "totalCount" : 5.637376656633329
-  },
-  "filters" : {
-    "paginationInfo" : {
-      "offset" : 5.962133916683182,
-      "pageSize" : 1.4658129805029452,
-      "orderDirection" : "ASC",
-      "orderBy" : "orderBy",
-      "totalCount" : 5.637376656633329
-    },
-    "filters" : {
-      "filters" : [ null, null ],
-      "operator" : "AND"
-    }
-  }
-}'
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        GetInstancesRequest getInstancesRequest = ; // GetInstancesRequest | 
-
-        try {
-            ProcessInstanceListResultDTO result = apiInstance.getInstances(getInstancesRequest);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getInstances");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final GetInstancesRequest getInstancesRequest = new GetInstancesRequest(); // GetInstancesRequest | 
-
-try {
-    final result = await api_instance.getInstances(getInstancesRequest);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getInstances: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        GetInstancesRequest getInstancesRequest = ; // GetInstancesRequest | 
-
-        try {
-            ProcessInstanceListResultDTO result = apiInstance.getInstances(getInstancesRequest);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getInstances");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-GetInstancesRequest *getInstancesRequest = ; //  (optional)
-
-// Get instances
-[apiInstance getInstancesWith:getInstancesRequest
-              completionHandler: ^(ProcessInstanceListResultDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var opts = {
-  'getInstancesRequest':  // {GetInstancesRequest} 
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getInstances(opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getInstancesExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var getInstancesRequest = new GetInstancesRequest(); // GetInstancesRequest |  (optional) 
-
-            try {
-                // Get instances
-                ProcessInstanceListResultDTO result = apiInstance.getInstances(getInstancesRequest);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getInstances: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$getInstancesRequest = ; // GetInstancesRequest | 
-
-try {
-    $result = $api_instance->getInstances($getInstancesRequest);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getInstances: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $getInstancesRequest = WWW::OPenAPIClient::Object::GetInstancesRequest->new(); # GetInstancesRequest | 
-
-eval {
-    my $result = $api_instance->getInstances(getInstancesRequest => $getInstancesRequest);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getInstances: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-getInstancesRequest =  # GetInstancesRequest |  (optional)
-
-try:
-    # Get instances
-    api_response = api_instance.get_instances(getInstancesRequest=getInstancesRequest)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getInstances: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let getInstancesRequest = ; // GetInstancesRequest
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getInstances(getInstancesRequest, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- - - -
Body parameters
- - - - - - - - - -
NameDescription
getInstancesRequest -

Parameters for retrieving instances

- -
-
- - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getWorkflowInputSchemaById

-

-
-
-
-

-

Get the workflow input schema. It defines the input fields of the workflow

-

-
-
/v2/workflows/{workflowId}/inputSchema
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X GET \
- -H "Accept: application/json" \
- "http://localhost/v2/workflows/{workflowId}/inputSchema?instanceId=instanceId_example"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow to fetch
-        String instanceId = instanceId_example; // String | ID of instance
-
-        try {
-            InputSchemaResponseDTO result = apiInstance.getWorkflowInputSchemaById(workflowId, instanceId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowInputSchemaById");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String workflowId = new String(); // String | ID of the workflow to fetch
-final String instanceId = new String(); // String | ID of instance
-
-try {
-    final result = await api_instance.getWorkflowInputSchemaById(workflowId, instanceId);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getWorkflowInputSchemaById: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow to fetch
-        String instanceId = instanceId_example; // String | ID of instance
-
-        try {
-            InputSchemaResponseDTO result = apiInstance.getWorkflowInputSchemaById(workflowId, instanceId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowInputSchemaById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *workflowId = workflowId_example; // ID of the workflow to fetch (default to null)
-String *instanceId = instanceId_example; // ID of instance (optional) (default to null)
-
-[apiInstance getWorkflowInputSchemaByIdWith:workflowId
-    instanceId:instanceId
-              completionHandler: ^(InputSchemaResponseDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var workflowId = workflowId_example; // {String} ID of the workflow to fetch
-var opts = {
-  'instanceId': instanceId_example // {String} ID of instance
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getWorkflowInputSchemaById(workflowId, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getWorkflowInputSchemaByIdExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var workflowId = workflowId_example;  // String | ID of the workflow to fetch (default to null)
-            var instanceId = instanceId_example;  // String | ID of instance (optional)  (default to null)
-
-            try {
-                InputSchemaResponseDTO result = apiInstance.getWorkflowInputSchemaById(workflowId, instanceId);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getWorkflowInputSchemaById: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$workflowId = workflowId_example; // String | ID of the workflow to fetch
-$instanceId = instanceId_example; // String | ID of instance
-
-try {
-    $result = $api_instance->getWorkflowInputSchemaById($workflowId, $instanceId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getWorkflowInputSchemaById: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $workflowId = workflowId_example; # String | ID of the workflow to fetch
-my $instanceId = instanceId_example; # String | ID of instance
-
-eval {
-    my $result = $api_instance->getWorkflowInputSchemaById(workflowId => $workflowId, instanceId => $instanceId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getWorkflowInputSchemaById: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-workflowId = workflowId_example # String | ID of the workflow to fetch (default to null)
-instanceId = instanceId_example # String | ID of instance (optional) (default to null)
-
-try:
-    api_response = api_instance.get_workflow_input_schema_by_id(workflowId, instanceId=instanceId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getWorkflowInputSchemaById: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let workflowId = workflowId_example; // String
-    let instanceId = instanceId_example; // String
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getWorkflowInputSchemaById(workflowId, instanceId, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
workflowId* - - -
-
-
- - String - - -
-ID of the workflow to fetch -
-
-
- Required -
-
-
-
- - - - -
Query parameters
- - - - - - - - - -
NameDescription
instanceId - - -
-
-
- - String - - -
-ID of instance -
-
-
-
-
- -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getWorkflowInstances

-

Get instances for a specific workflow

-
-
-
-

-

Retrieve an array of workflow executions (instances) for the given workflow

-

-
-
/v2/workflows/{workflowId}/instances
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X POST \
- -H "Accept: application/json" \
- -H "Content-Type: application/json" \
- "http://localhost/v2/workflows/{workflowId}/instances" \
- -d '{
-  "paginationInfo" : {
-    "offset" : 5.962133916683182,
-    "pageSize" : 1.4658129805029452,
-    "orderDirection" : "ASC",
-    "orderBy" : "orderBy",
-    "totalCount" : 5.637376656633329
-  },
-  "filters" : {
-    "filters" : [ null, null ],
-    "operator" : "AND"
-  }
-}'
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow
-        SearchRequest searchRequest = ; // SearchRequest | 
-
-        try {
-            ProcessInstanceListResultDTO result = apiInstance.getWorkflowInstances(workflowId, searchRequest);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowInstances");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String workflowId = new String(); // String | ID of the workflow
-final SearchRequest searchRequest = new SearchRequest(); // SearchRequest | 
-
-try {
-    final result = await api_instance.getWorkflowInstances(workflowId, searchRequest);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getWorkflowInstances: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow
-        SearchRequest searchRequest = ; // SearchRequest | 
-
-        try {
-            ProcessInstanceListResultDTO result = apiInstance.getWorkflowInstances(workflowId, searchRequest);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowInstances");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *workflowId = workflowId_example; // ID of the workflow (default to null)
-SearchRequest *searchRequest = ; //  (optional)
-
-// Get instances for a specific workflow
-[apiInstance getWorkflowInstancesWith:workflowId
-    searchRequest:searchRequest
-              completionHandler: ^(ProcessInstanceListResultDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var workflowId = workflowId_example; // {String} ID of the workflow
-var opts = {
-  'searchRequest':  // {SearchRequest} 
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getWorkflowInstances(workflowId, opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getWorkflowInstancesExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var workflowId = workflowId_example;  // String | ID of the workflow (default to null)
-            var searchRequest = new SearchRequest(); // SearchRequest |  (optional) 
-
-            try {
-                // Get instances for a specific workflow
-                ProcessInstanceListResultDTO result = apiInstance.getWorkflowInstances(workflowId, searchRequest);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getWorkflowInstances: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$workflowId = workflowId_example; // String | ID of the workflow
-$searchRequest = ; // SearchRequest | 
-
-try {
-    $result = $api_instance->getWorkflowInstances($workflowId, $searchRequest);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getWorkflowInstances: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $workflowId = workflowId_example; # String | ID of the workflow
-my $searchRequest = WWW::OPenAPIClient::Object::SearchRequest->new(); # SearchRequest | 
-
-eval {
-    my $result = $api_instance->getWorkflowInstances(workflowId => $workflowId, searchRequest => $searchRequest);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getWorkflowInstances: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-workflowId = workflowId_example # String | ID of the workflow (default to null)
-searchRequest =  # SearchRequest |  (optional)
-
-try:
-    # Get instances for a specific workflow
-    api_response = api_instance.get_workflow_instances(workflowId, searchRequest=searchRequest)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getWorkflowInstances: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let workflowId = workflowId_example; // String
-    let searchRequest = ; // SearchRequest
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getWorkflowInstances(workflowId, searchRequest, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
workflowId* - - -
-
-
- - String - - -
-ID of the workflow -
-
-
- Required -
-
-
-
- - -
Body parameters
- - - - - - - - - -
NameDescription
searchRequest -

Parameters for retrieving workflow instances

- -
-
- - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getWorkflowOverviewById

-

-
-
-
-

-

Returns the key fields of the workflow including data on the last run instance

-

-
-
/v2/workflows/{workflowId}/overview
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X GET \
- -H "Accept: application/json" \
- "http://localhost/v2/workflows/{workflowId}/overview"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | Unique identifier of the workflow
-
-        try {
-            WorkflowOverviewDTO result = apiInstance.getWorkflowOverviewById(workflowId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowOverviewById");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String workflowId = new String(); // String | Unique identifier of the workflow
-
-try {
-    final result = await api_instance.getWorkflowOverviewById(workflowId);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getWorkflowOverviewById: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | Unique identifier of the workflow
-
-        try {
-            WorkflowOverviewDTO result = apiInstance.getWorkflowOverviewById(workflowId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowOverviewById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *workflowId = workflowId_example; // Unique identifier of the workflow (default to null)
-
-[apiInstance getWorkflowOverviewByIdWith:workflowId
-              completionHandler: ^(WorkflowOverviewDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var workflowId = workflowId_example; // {String} Unique identifier of the workflow
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getWorkflowOverviewById(workflowId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getWorkflowOverviewByIdExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var workflowId = workflowId_example;  // String | Unique identifier of the workflow (default to null)
-
-            try {
-                WorkflowOverviewDTO result = apiInstance.getWorkflowOverviewById(workflowId);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getWorkflowOverviewById: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$workflowId = workflowId_example; // String | Unique identifier of the workflow
-
-try {
-    $result = $api_instance->getWorkflowOverviewById($workflowId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getWorkflowOverviewById: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $workflowId = workflowId_example; # String | Unique identifier of the workflow
-
-eval {
-    my $result = $api_instance->getWorkflowOverviewById(workflowId => $workflowId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getWorkflowOverviewById: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-workflowId = workflowId_example # String | Unique identifier of the workflow (default to null)
-
-try:
-    api_response = api_instance.get_workflow_overview_by_id(workflowId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getWorkflowOverviewById: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let workflowId = workflowId_example; // String
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getWorkflowOverviewById(workflowId, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
workflowId* - - -
-
-
- - String - - -
-Unique identifier of the workflow -
-
-
- Required -
-
-
-
- - - - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getWorkflowSourceById

-

-
-
-
-

-

Get the workflow's definition

-

-
-
/v2/workflows/{workflowId}/source
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X GET \
- -H "Accept: text/plain,application/json" \
- "http://localhost/v2/workflows/{workflowId}/source"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow to fetch
-
-        try {
-            'String' result = apiInstance.getWorkflowSourceById(workflowId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowSourceById");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String workflowId = new String(); // String | ID of the workflow to fetch
-
-try {
-    final result = await api_instance.getWorkflowSourceById(workflowId);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getWorkflowSourceById: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow to fetch
-
-        try {
-            'String' result = apiInstance.getWorkflowSourceById(workflowId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowSourceById");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *workflowId = workflowId_example; // ID of the workflow to fetch (default to null)
-
-[apiInstance getWorkflowSourceByIdWith:workflowId
-              completionHandler: ^('String' output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var workflowId = workflowId_example; // {String} ID of the workflow to fetch
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getWorkflowSourceById(workflowId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getWorkflowSourceByIdExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var workflowId = workflowId_example;  // String | ID of the workflow to fetch (default to null)
-
-            try {
-                'String' result = apiInstance.getWorkflowSourceById(workflowId);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getWorkflowSourceById: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$workflowId = workflowId_example; // String | ID of the workflow to fetch
-
-try {
-    $result = $api_instance->getWorkflowSourceById($workflowId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getWorkflowSourceById: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $workflowId = workflowId_example; # String | ID of the workflow to fetch
-
-eval {
-    my $result = $api_instance->getWorkflowSourceById(workflowId => $workflowId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getWorkflowSourceById: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-workflowId = workflowId_example # String | ID of the workflow to fetch (default to null)
-
-try:
-    api_response = api_instance.get_workflow_source_by_id(workflowId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getWorkflowSourceById: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let workflowId = workflowId_example; // String
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getWorkflowSourceById(workflowId, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - -
NameDescription
workflowId* - - -
-
-
- - String - - -
-ID of the workflow to fetch -
-
-
- Required -
-
-
-
- - - - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getWorkflowStatuses

-

Get workflow status list

-
-
-
-

-

Retrieve array with the status of all instances

-

-
-
/v2/workflows/instances/statuses
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X GET \
- -H "Accept: application/json" \
- "http://localhost/v2/workflows/instances/statuses"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-
-        try {
-            array[WorkflowRunStatusDTO] result = apiInstance.getWorkflowStatuses();
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowStatuses");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-
-try {
-    final result = await api_instance.getWorkflowStatuses();
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getWorkflowStatuses: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-
-        try {
-            array[WorkflowRunStatusDTO] result = apiInstance.getWorkflowStatuses();
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowStatuses");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-
-// Get workflow status list
-[apiInstance getWorkflowStatusesWithCompletionHandler: 
-              ^(array[WorkflowRunStatusDTO] output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getWorkflowStatuses(callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getWorkflowStatusesExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-
-            try {
-                // Get workflow status list
-                array[WorkflowRunStatusDTO] result = apiInstance.getWorkflowStatuses();
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getWorkflowStatuses: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-
-try {
-    $result = $api_instance->getWorkflowStatuses();
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getWorkflowStatuses: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-
-eval {
-    my $result = $api_instance->getWorkflowStatuses();
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getWorkflowStatuses: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-
-try:
-    # Get workflow status list
-    api_response = api_instance.get_workflow_statuses()
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getWorkflowStatuses: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getWorkflowStatuses(&context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- - - - - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

getWorkflowsOverview

-

-
-
-
-

-

Returns the key fields of the workflow including data on the last run instance

-

-
-
/v2/workflows/overview
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X POST \
- -H "Accept: application/json" \
- -H "Content-Type: application/json" \
- "http://localhost/v2/workflows/overview" \
- -d '{
-  "paginationInfo" : {
-    "offset" : 5.962133916683182,
-    "pageSize" : 1.4658129805029452,
-    "orderDirection" : "ASC",
-    "orderBy" : "orderBy",
-    "totalCount" : 5.637376656633329
-  },
-  "filters" : {
-    "filters" : [ null, null ],
-    "operator" : "AND"
-  }
-}'
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        SearchRequest searchRequest = ; // SearchRequest | 
-
-        try {
-            WorkflowOverviewListResultDTO result = apiInstance.getWorkflowsOverview(searchRequest);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowsOverview");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final SearchRequest searchRequest = new SearchRequest(); // SearchRequest | 
-
-try {
-    final result = await api_instance.getWorkflowsOverview(searchRequest);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->getWorkflowsOverview: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        SearchRequest searchRequest = ; // SearchRequest | 
-
-        try {
-            WorkflowOverviewListResultDTO result = apiInstance.getWorkflowsOverview(searchRequest);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#getWorkflowsOverview");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-SearchRequest *searchRequest = ; //  (optional)
-
-[apiInstance getWorkflowsOverviewWith:searchRequest
-              completionHandler: ^(WorkflowOverviewListResultDTO output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var opts = {
-  'searchRequest':  // {SearchRequest} 
-};
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.getWorkflowsOverview(opts, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class getWorkflowsOverviewExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var searchRequest = new SearchRequest(); // SearchRequest |  (optional) 
-
-            try {
-                WorkflowOverviewListResultDTO result = apiInstance.getWorkflowsOverview(searchRequest);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.getWorkflowsOverview: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$searchRequest = ; // SearchRequest | 
-
-try {
-    $result = $api_instance->getWorkflowsOverview($searchRequest);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->getWorkflowsOverview: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $searchRequest = WWW::OPenAPIClient::Object::SearchRequest->new(); # SearchRequest | 
-
-eval {
-    my $result = $api_instance->getWorkflowsOverview(searchRequest => $searchRequest);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->getWorkflowsOverview: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-searchRequest =  # SearchRequest |  (optional)
-
-try:
-    api_response = api_instance.get_workflows_overview(searchRequest=searchRequest)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->getWorkflowsOverview: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let searchRequest = ; // SearchRequest
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.getWorkflowsOverview(searchRequest, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- - - -
Body parameters
- - - - - - - - - -
NameDescription
searchRequest -

Pagination and filters

- -
-
- - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
-
-

retriggerInstance

-

Retrigger an instance

-
-
-
-

-

Retrigger an instance

-

-
-
/v2/workflows/{workflowId}/{instanceId}/retrigger
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X POST \
- -H "Accept: application/json" \
- "http://localhost/v2/workflows/{workflowId}/{instanceId}/retrigger"
-
-
-
-
import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DefaultApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-
-        // Create an instance of the API class
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow
-        String instanceId = instanceId_example; // String | ID of the instance to retrigger
-
-        try {
-            Object result = apiInstance.retriggerInstance(workflowId, instanceId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#retriggerInstance");
-            e.printStackTrace();
-        }
-    }
-}
-
-
- -
-
import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final String workflowId = new String(); // String | ID of the workflow
-final String instanceId = new String(); // String | ID of the instance to retrigger
-
-try {
-    final result = await api_instance.retriggerInstance(workflowId, instanceId);
-    print(result);
-} catch (e) {
-    print('Exception when calling DefaultApi->retriggerInstance: $e\n');
-}
-
-
-
- -
-
import org.openapitools.client.api.DefaultApi;
-
-public class DefaultApiExample {
-    public static void main(String[] args) {
-        DefaultApi apiInstance = new DefaultApi();
-        String workflowId = workflowId_example; // String | ID of the workflow
-        String instanceId = instanceId_example; // String | ID of the instance to retrigger
-
-        try {
-            Object result = apiInstance.retriggerInstance(workflowId, instanceId);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling DefaultApi#retriggerInstance");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-

-
-// Create an instance of the API class
-DefaultApi *apiInstance = [[DefaultApi alloc] init];
-String *workflowId = workflowId_example; // ID of the workflow (default to null)
-String *instanceId = instanceId_example; // ID of the instance to retrigger (default to null)
-
-// Retrigger an instance
-[apiInstance retriggerInstanceWith:workflowId
-    instanceId:instanceId
-              completionHandler: ^(Object output, NSError* error) {
-    if (output) {
-        NSLog(@"%@", output);
-    }
-    if (error) {
-        NSLog(@"Error: %@", error);
-    }
-}];
-
-
- -
-
var OrchestratorPlugin = require('orchestrator_plugin');
-
-// Create an instance of the API class
-var api = new OrchestratorPlugin.DefaultApi()
-var workflowId = workflowId_example; // {String} ID of the workflow
-var instanceId = instanceId_example; // {String} ID of the instance to retrigger
-
-var callback = function(error, data, response) {
-  if (error) {
-    console.error(error);
-  } else {
-    console.log('API called successfully. Returned data: ' + data);
-  }
-};
-api.retriggerInstance(workflowId, instanceId, callback);
-
-
- - -
-
using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
-    public class retriggerInstanceExample
-    {
-        public void main()
-        {
-
-            // Create an instance of the API class
-            var apiInstance = new DefaultApi();
-            var workflowId = workflowId_example;  // String | ID of the workflow (default to null)
-            var instanceId = instanceId_example;  // String | ID of the instance to retrigger (default to null)
-
-            try {
-                // Retrigger an instance
-                Object result = apiInstance.retriggerInstance(workflowId, instanceId);
-                Debug.WriteLine(result);
-            } catch (Exception e) {
-                Debug.Print("Exception when calling DefaultApi.retriggerInstance: " + e.Message );
-            }
-        }
-    }
-}
-
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DefaultApi();
-$workflowId = workflowId_example; // String | ID of the workflow
-$instanceId = instanceId_example; // String | ID of the instance to retrigger
-
-try {
-    $result = $api_instance->retriggerInstance($workflowId, $instanceId);
-    print_r($result);
-} catch (Exception $e) {
-    echo 'Exception when calling DefaultApi->retriggerInstance: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- -
-
use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DefaultApi;
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
-my $workflowId = workflowId_example; # String | ID of the workflow
-my $instanceId = instanceId_example; # String | ID of the instance to retrigger
-
-eval {
-    my $result = $api_instance->retriggerInstance(workflowId => $workflowId, instanceId => $instanceId);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling DefaultApi->retriggerInstance: $@\n";
-}
-
- -
-
from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Create an instance of the API class
-api_instance = openapi_client.DefaultApi()
-workflowId = workflowId_example # String | ID of the workflow (default to null)
-instanceId = instanceId_example # String | ID of the instance to retrigger (default to null)
-
-try:
-    # Retrigger an instance
-    api_response = api_instance.retrigger_instance(workflowId, instanceId)
-    pprint(api_response)
-except ApiException as e:
-    print("Exception when calling DefaultApi->retriggerInstance: %s\n" % e)
-
- -
-
extern crate DefaultApi;
-
-pub fn main() {
-    let workflowId = workflowId_example; // String
-    let instanceId = instanceId_example; // String
-
-    let mut context = DefaultApi::Context::default();
-    let result = client.retriggerInstance(workflowId, instanceId, &context).wait();
-
-    println!("{:?}", result);
-}
-
-
-
- -

Scopes

- - -
- -

Parameters

- -
Path parameters
- - - - - - - - - - - - - -
NameDescription
workflowId* - - -
-
-
- - String - - -
-ID of the workflow -
-
-
- Required -
-
-
-
instanceId* - - -
-
-
- - String - - -
-ID of the instance to retrigger -
-
-
- Required -
-
-
-
- - - - - -

Responses

-

-

- - - - - - -
-
-
- -
- -
-
-

-

- - - - - - -
-
-
- -
- -
-
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - - - diff --git a/plugins/orchestrator-common/src/generated/docs/markdown/Apis/DefaultApi.md b/plugins/orchestrator-common/src/generated/docs/markdown/Apis/DefaultApi.md deleted file mode 100644 index 24e594da9b..0000000000 --- a/plugins/orchestrator-common/src/generated/docs/markdown/Apis/DefaultApi.md +++ /dev/null @@ -1,319 +0,0 @@ -# DefaultApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**abortWorkflow**](DefaultApi.md#abortWorkflow) | **DELETE** /v2/workflows/instances/{instanceId}/abort | Abort a workflow instance | -| [**executeWorkflow**](DefaultApi.md#executeWorkflow) | **POST** /v2/workflows/{workflowId}/execute | Execute a workflow | -| [**getInstanceById**](DefaultApi.md#getInstanceById) | **GET** /v2/workflows/instances/{instanceId} | Get Workflow Instance by ID | -| [**getInstances**](DefaultApi.md#getInstances) | **POST** /v2/workflows/instances | Get instances | -| [**getWorkflowInputSchemaById**](DefaultApi.md#getWorkflowInputSchemaById) | **GET** /v2/workflows/{workflowId}/inputSchema | | -| [**getWorkflowInstances**](DefaultApi.md#getWorkflowInstances) | **POST** /v2/workflows/{workflowId}/instances | Get instances for a specific workflow | -| [**getWorkflowOverviewById**](DefaultApi.md#getWorkflowOverviewById) | **GET** /v2/workflows/{workflowId}/overview | | -| [**getWorkflowSourceById**](DefaultApi.md#getWorkflowSourceById) | **GET** /v2/workflows/{workflowId}/source | | -| [**getWorkflowStatuses**](DefaultApi.md#getWorkflowStatuses) | **GET** /v2/workflows/instances/statuses | Get workflow status list | -| [**getWorkflowsOverview**](DefaultApi.md#getWorkflowsOverview) | **POST** /v2/workflows/overview | | -| [**retriggerInstance**](DefaultApi.md#retriggerInstance) | **POST** /v2/workflows/{workflowId}/{instanceId}/retrigger | Retrigger an instance | - - - -# **abortWorkflow** -> String abortWorkflow(instanceId) - -Abort a workflow instance - - Aborts a workflow instance identified by the provided instanceId. - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **instanceId** | **String**| The identifier of the workflow instance to abort. | [default to null] | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - - -# **executeWorkflow** -> ExecuteWorkflowResponseDTO executeWorkflow(workflowId, ExecuteWorkflowRequestDTO, businessKey) - -Execute a workflow - - Execute a workflow - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflowId** | **String**| ID of the workflow to execute | [default to null] | -| **ExecuteWorkflowRequestDTO** | [**ExecuteWorkflowRequestDTO**](../Models/ExecuteWorkflowRequestDTO.md)| | | -| **businessKey** | **String**| ID of the parent workflow | [optional] [default to null] | - -### Return type - -[**ExecuteWorkflowResponseDTO**](../Models/ExecuteWorkflowResponseDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -# **getInstanceById** -> AssessedProcessInstanceDTO getInstanceById(instanceId, includeAssessment) - -Get Workflow Instance by ID - - Get a workflow execution/run (instance) - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **instanceId** | **String**| ID of the workflow instance | [default to null] | -| **includeAssessment** | **Boolean**| Whether to include assessment | [optional] [default to false] | - -### Return type - -[**AssessedProcessInstanceDTO**](../Models/AssessedProcessInstanceDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **getInstances** -> ProcessInstanceListResultDTO getInstances(GetInstancesRequest) - -Get instances - - Retrieve an array of workflow executions (instances) - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **GetInstancesRequest** | [**GetInstancesRequest**](../Models/GetInstancesRequest.md)| Parameters for retrieving instances | [optional] | - -### Return type - -[**ProcessInstanceListResultDTO**](../Models/ProcessInstanceListResultDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -# **getWorkflowInputSchemaById** -> InputSchemaResponseDTO getWorkflowInputSchemaById(workflowId, instanceId) - - - - Get the workflow input schema. It defines the input fields of the workflow - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflowId** | **String**| ID of the workflow to fetch | [default to null] | -| **instanceId** | **String**| ID of instance | [optional] [default to null] | - -### Return type - -[**InputSchemaResponseDTO**](../Models/InputSchemaResponseDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **getWorkflowInstances** -> ProcessInstanceListResultDTO getWorkflowInstances(workflowId, SearchRequest) - -Get instances for a specific workflow - - Retrieve an array of workflow executions (instances) for the given workflow - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflowId** | **String**| ID of the workflow | [default to null] | -| **SearchRequest** | [**SearchRequest**](../Models/SearchRequest.md)| Parameters for retrieving workflow instances | [optional] | - -### Return type - -[**ProcessInstanceListResultDTO**](../Models/ProcessInstanceListResultDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -# **getWorkflowOverviewById** -> WorkflowOverviewDTO getWorkflowOverviewById(workflowId) - - - - Returns the key fields of the workflow including data on the last run instance - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflowId** | **String**| Unique identifier of the workflow | [default to null] | - -### Return type - -[**WorkflowOverviewDTO**](../Models/WorkflowOverviewDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **getWorkflowSourceById** -> String getWorkflowSourceById(workflowId) - - - - Get the workflow's definition - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflowId** | **String**| ID of the workflow to fetch | [default to null] | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: text/plain, application/json - - -# **getWorkflowStatuses** -> List getWorkflowStatuses() - -Get workflow status list - - Retrieve array with the status of all instances - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List**](../Models/WorkflowRunStatusDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -# **getWorkflowsOverview** -> WorkflowOverviewListResultDTO getWorkflowsOverview(SearchRequest) - - - - Returns the key fields of the workflow including data on the last run instance - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **SearchRequest** | [**SearchRequest**](../Models/SearchRequest.md)| Pagination and filters | [optional] | - -### Return type - -[**WorkflowOverviewListResultDTO**](../Models/WorkflowOverviewListResultDTO.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -# **retriggerInstance** -> Object retriggerInstance(workflowId, instanceId) - -Retrigger an instance - - Retrigger an instance - -### Parameters - -|Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **workflowId** | **String**| ID of the workflow | [default to null] | -| **instanceId** | **String**| ID of the instance to retrigger | [default to null] | - -### Return type - -**Object** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - diff --git a/plugins/orchestrator-common/src/openapi/openapi.yaml b/plugins/orchestrator-common/src/openapi/openapi.yaml deleted file mode 100644 index 7ef9c0f2b6..0000000000 --- a/plugins/orchestrator-common/src/openapi/openapi.yaml +++ /dev/null @@ -1,733 +0,0 @@ -openapi: 3.1.0 -info: - title: Orchestrator plugin - description: API to interact with orchestrator plugin - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 0.0.1 -servers: - - url: / -paths: - /v2/workflows/overview: - post: - operationId: getWorkflowsOverview - description: Returns the key fields of the workflow including data on the last run instance - requestBody: - required: false - description: Pagination and filters - content: - application/json: - schema: - $ref: '#/components/schemas/SearchRequest' - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowOverviewListResultDTO' - '500': - description: Error fetching workflow overviews - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/{workflowId}/overview: - get: - operationId: getWorkflowOverviewById - description: Returns the key fields of the workflow including data on the last run instance - parameters: - - name: workflowId - in: path - required: true - description: Unique identifier of the workflow - schema: - type: string - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowOverviewDTO' - '500': - description: Error fetching workflow overview - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/{workflowId}/source: - get: - operationId: getWorkflowSourceById - description: Get the workflow's definition - parameters: - - name: workflowId - in: path - description: ID of the workflow to fetch - required: true - schema: - type: string - responses: - '200': - description: Success - content: - text/plain: - schema: - type: string - '500': - description: Error fetching workflow source by id - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/{workflowId}/inputSchema: - get: - operationId: getWorkflowInputSchemaById - description: Get the workflow input schema. It defines the input fields of the workflow - parameters: - - name: workflowId - in: path - description: ID of the workflow to fetch - required: true - schema: - type: string - - name: instanceId - in: query - description: ID of instance - schema: - type: string - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/InputSchemaResponseDTO' - '500': - description: Error fetching workflow input schema by id - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/instances: - post: - operationId: getInstances - summary: Get instances - description: Retrieve an array of workflow executions (instances) - requestBody: - required: false - description: Parameters for retrieving instances - content: - application/json: - schema: - $ref: '#/components/schemas/GetInstancesRequest' - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/ProcessInstanceListResultDTO' - '500': - description: Error fetching instances - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/{workflowId}/instances: - post: - operationId: getWorkflowInstances - summary: Get instances for a specific workflow - description: Retrieve an array of workflow executions (instances) for the given workflow - parameters: - - name: workflowId - in: path - required: true - description: ID of the workflow - schema: - type: string - requestBody: - required: false - description: Parameters for retrieving workflow instances - content: - application/json: - schema: - $ref: '#/components/schemas/SearchRequest' - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/ProcessInstanceListResultDTO' - '500': - description: Error fetching instances - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/instances/{instanceId}: - get: - summary: Get Workflow Instance by ID - description: Get a workflow execution/run (instance) - operationId: getInstanceById - parameters: - - name: instanceId - in: path - required: true - description: ID of the workflow instance - schema: - type: string - - name: includeAssessment - in: query - required: false - description: Whether to include assessment - schema: - type: boolean - default: false - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/AssessedProcessInstanceDTO' - '500': - description: Error fetching instance - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/instances/statuses: - get: - operationId: getWorkflowStatuses - summary: Get workflow status list - description: Retrieve array with the status of all instances - responses: - '200': - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WorkflowRunStatusDTO' - '500': - description: Error fetching workflow statuses - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/{workflowId}/execute: - post: - summary: Execute a workflow - description: Execute a workflow - operationId: executeWorkflow - parameters: - - name: workflowId - in: path - description: ID of the workflow to execute - required: true - schema: - type: string - - name: businessKey - in: query - description: ID of the parent workflow - required: false - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ExecuteWorkflowRequestDTO' - responses: - '200': - description: Successful execution - content: - application/json: - schema: - $ref: '#/components/schemas/ExecuteWorkflowResponseDTO' - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/{workflowId}/{instanceId}/retrigger: - post: - summary: Retrigger an instance - description: Retrigger an instance - operationId: retriggerInstance - parameters: - - name: workflowId - in: path - description: ID of the workflow - required: true - schema: - type: string - - name: instanceId - in: path - description: ID of the instance to retrigger - required: true - schema: - type: string - responses: - '200': - description: Success - content: - application/json: - schema: - type: object - '500': - description: Internal Server Error - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /v2/workflows/instances/{instanceId}/abort: - delete: - summary: Abort a workflow instance - operationId: abortWorkflow - description: Aborts a workflow instance identified by the provided instanceId. - parameters: - - name: instanceId - in: path - required: true - description: The identifier of the workflow instance to abort. - schema: - type: string - responses: - '200': - description: Successful operation - content: - text/plain: - schema: - type: string - '500': - description: Error aborting workflow - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' -components: - schemas: - ErrorResponse: - description: - The ErrorResponse object represents a common structure for handling errors in API responses. - It includes essential information about the error, such as the error message and additional optional details. - type: object - properties: - message: - description: - A string providing a concise and human-readable description of the encountered error. - This field is required in the ErrorResponse object. - type: string - default: internal server error - additionalInfo: - description: - An optional field that can contain additional information or context about the error. - It provides flexibility for including extra details based on specific error scenarios. - type: string - required: - - message - GetInstancesRequest: - type: object - properties: - paginationInfo: - $ref: '#/components/schemas/PaginationInfoDTO' - filters: - $ref: '#/components/schemas/SearchRequest' - GetOverviewsRequestParams: - type: object - properties: - paginationInfo: - $ref: '#/components/schemas/PaginationInfoDTO' - filters: - $ref: '#/components/schemas/SearchRequest' - WorkflowOverviewListResultDTO: - type: object - properties: - overviews: - type: array - items: - $ref: '#/components/schemas/WorkflowOverviewDTO' - minItems: 0 - paginationInfo: - $ref: '#/components/schemas/PaginationInfoDTO' - WorkflowOverviewDTO: - type: object - properties: - workflowId: - type: string - description: Workflow unique identifier - minLength: 1 - name: - type: string - description: Workflow name - minLength: 1 - format: - $ref: '#/components/schemas/WorkflowFormatDTO' - lastRunId: - type: string - lastTriggeredMs: - type: number - minimum: 0 - lastRunStatus: - $ref: '#/components/schemas/ProcessInstanceStatusDTO' - category: - $ref: '#/components/schemas/WorkflowCategoryDTO' - avgDurationMs: - type: number - minimum: 0 - description: - type: string - required: - - workflowId - - format - PaginationInfoDTO: - type: object - properties: - pageSize: - type: number - offset: - type: number - totalCount: - type: number - orderDirection: - enum: - - ASC - - DESC - orderBy: - type: string - additionalProperties: false - WorkflowFormatDTO: - type: string - description: Format of the workflow definition - enum: - - yaml - - json - WorkflowCategoryDTO: - type: string - description: Category of the workflow - enum: - - assessment - - infrastructure - WorkflowListResultDTO: - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/WorkflowDTO' - paginationInfo: - $ref: '#/components/schemas/PaginationInfoDTO' - required: - - items - - paginationInfo - WorkflowDTO: - type: object - properties: - id: - type: string - description: Workflow unique identifier - minLength: 1 - name: - type: string - description: Workflow name - minLength: 1 - format: - $ref: '#/components/schemas/WorkflowFormatDTO' - category: - $ref: '#/components/schemas/WorkflowCategoryDTO' - description: - type: string - description: Description of the workflow - annotations: - type: array - items: - type: string - required: - - id - - category - - format - ProcessInstanceListResultDTO: - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ProcessInstanceDTO' - paginationInfo: - $ref: '#/components/schemas/PaginationInfoDTO' - AssessedProcessInstanceDTO: - type: object - properties: - instance: - $ref: '#/components/schemas/ProcessInstanceDTO' - assessedBy: - $ref: '#/components/schemas/ProcessInstanceDTO' - required: - - instance - ProcessInstanceDTO: - type: object - properties: - id: - type: string - processId: - type: string - processName: - type: string - status: - $ref: '#/components/schemas/ProcessInstanceStatusDTO' - endpoint: - type: string - serviceUrl: - type: string - start: - type: string - end: - type: string - duration: - type: string - category: - $ref: '#/components/schemas/WorkflowCategoryDTO' - description: - type: string - workflowdata: - $ref: '#/components/schemas/WorkflowDataDTO' - businessKey: - type: string - nodes: - type: array - items: - $ref: '#/components/schemas/NodeInstanceDTO' - error: - $ref: '#/components/schemas/ProcessInstanceErrorDTO' - required: - - id - - processId - - nodes - WorkflowDataDTO: - type: object - properties: - result: - $ref: '#/components/schemas/WorkflowResultDTO' - additionalProperties: true - WorkflowResultDTO: - # Based on https://github.com/parodos-dev/serverless-workflows/blob/main/shared/schemas/workflow-result-schema.json - description: Result of a workflow execution - type: object - properties: - completedWith: - description: The state of workflow completion. - type: string - enum: - - error - - success - message: - description: High-level summary of the current status, free-form text, human readable. - type: string - nextWorkflows: - description: List of workflows suggested to run next. Items at lower indexes are of higher priority. - type: array - items: - type: object - properties: - id: - description: Workflow identifier - type: string - name: - description: Human readable title describing the workflow. - type: string - required: - - id - - name - outputs: - description: Additional structured output of workflow processing. This can contain identifiers of created resources, links to resources, logs or other output. - type: array - items: - type: object - properties: - key: - description: Unique identifier of the option. Preferably human-readable. - type: string - value: - description: Free form value of the option. - anyOf: - - type: string - - type: number - format: - description: More detailed type of the 'value' property. Defaults to 'text'. - enum: - - text - - number - - link - required: - - key - - value - ProcessInstanceStatusDTO: - type: string - description: Status of the workflow run - enum: - - Active - - Error - - Completed - - Aborted - - Suspended - - Pending - WorkflowRunStatusDTO: - type: object - properties: - key: - type: string - value: - type: string - ExecuteWorkflowRequestDTO: - type: object - properties: - inputData: - type: object - additionalProperties: true - required: - - inputData - ExecuteWorkflowResponseDTO: - type: object - properties: - id: - type: string - required: - - id - WorkflowProgressDTO: - allOf: - - $ref: '#/components/schemas/NodeInstanceDTO' - - type: object - properties: - status: - $ref: '#/components/schemas/ProcessInstanceStatusDTO' - error: - $ref: '#/components/schemas/ProcessInstanceErrorDTO' - NodeInstanceDTO: - type: object - properties: - __typename: - type: string - default: 'NodeInstance' - description: Type name - id: - type: string - description: Node instance ID - name: - type: string - description: Node name - type: - type: string - description: Node type - enter: - type: string - description: Date when the node was entered - exit: - type: string - description: Date when the node was exited (optional) - definitionId: - type: string - description: Definition ID - nodeId: - type: string - description: Node ID - required: - - id - ProcessInstanceErrorDTO: - type: object - properties: - __typename: - type: string - default: 'ProcessInstanceError' - description: Type name - nodeDefinitionId: - type: string - description: Node definition ID - message: - type: string - description: Error message (optional) - required: - - nodeDefinitionId - SearchRequest: - type: object - properties: - filters: - $ref: '#/components/schemas/Filter' - paginationInfo: - $ref: '#/components/schemas/PaginationInfoDTO' - Filter: - oneOf: - - $ref: '#/components/schemas/LogicalFilter' - - $ref: '#/components/schemas/FieldFilter' - LogicalFilter: - type: object - required: - - operator - - filters - properties: - operator: - type: string - enum: [AND, OR, NOT] - filters: - type: array - items: - $ref: '#/components/schemas/Filter' - - FieldFilter: - type: object - required: - - field - - operator - - value - properties: - field: - type: string - operator: - type: string - enum: - [ - EQ, - GT, - GTE, - LT, - LTE, - IN, - IS_NULL, - CONTAINS, - CONTAINS_ALL, - CONTAINS_ANY, - LIKE, - BETWEEN, - ] - # The `value` field should be defined as follows. However, due to a bug (open since May 2023), - # https://github.com/OpenAPITools/openapi-generator/issues/15701 - # using `oneOf` to specify enum values for a property in the schema doesn't generate the enums correctly. - value: - oneOf: - - type: string - - type: number - - type: boolean - - type: array - items: - oneOf: - - type: string - - type: number - - type: boolean - # - type: string - # enum: - # - A - # - B - - InputSchemaResponseDTO: - type: object - properties: - inputSchema: - type: object - data: - type: object diff --git a/plugins/orchestrator/src/api/OrchestratorClient.test.ts b/plugins/orchestrator/src/api/OrchestratorClient.test.ts deleted file mode 100644 index f50a2261b4..0000000000 --- a/plugins/orchestrator/src/api/OrchestratorClient.test.ts +++ /dev/null @@ -1,624 +0,0 @@ -import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; -import type { JsonObject } from '@backstage/types'; - -import axios, { - AxiosRequestConfig, - AxiosResponse, - InternalAxiosRequestConfig, - RawAxiosResponseHeaders, -} from 'axios'; - -import { - AssessedProcessInstanceDTO, - DefaultApi, - ExecuteWorkflowResponseDTO, - PaginationInfoDTO, - ProcessInstanceListResultDTO, - QUERY_PARAM_INCLUDE_ASSESSMENT, - WorkflowFormatDTO, - WorkflowOverviewDTO, - WorkflowOverviewListResultDTO, -} from '@janus-idp/backstage-plugin-orchestrator-common'; - -import { - OrchestratorClient, - OrchestratorClientOptions, -} from './OrchestratorClient'; - -jest.mock('axios'); - -describe('OrchestratorClient', () => { - let mockDiscoveryApi: jest.Mocked; - let mockIdentityApi: jest.Mocked; - let orchestratorClientOptions: jest.Mocked; - let orchestratorClient: OrchestratorClient; - const baseUrl = 'https://api.example.com'; - const mockToken = 'test-token'; - const defaultAuthHeaders = { Authorization: `Bearer ${mockToken}` }; - - const mockFetch = jest.fn(); - (global as any).fetch = mockFetch; // Cast global to any to avoid TypeScript errors - - beforeEach(() => { - jest.clearAllMocks(); - // Create a mock DiscoveryApi with a mocked implementation of getBaseUrl - mockDiscoveryApi = { - getBaseUrl: jest.fn().mockResolvedValue(baseUrl), - } as jest.Mocked; - mockIdentityApi = { - getCredentials: jest.fn().mockResolvedValue({ token: mockToken }), - getProfileInfo: jest - .fn() - .mockResolvedValue({ displayName: 'test', email: 'test@test' }), - getBackstageIdentity: jest - .fn() - .mockResolvedValue({ userEntityRef: 'default/test' }), - signOut: jest.fn().mockImplementation(), - } as jest.Mocked; - - // Create OrchestratorClientOptions with the mocked DiscoveryApi - orchestratorClientOptions = { - discoveryApi: mockDiscoveryApi, - identityApi: mockIdentityApi, - axiosInstance: axios, - }; - orchestratorClient = new OrchestratorClient(orchestratorClientOptions); - }); - - describe('executeWorkflow', () => { - const workflowId = 'workflow123'; - - const setupTest = ( - executionId: string, - parameters: JsonObject, - businessKey?: string, - ) => { - const mockExecResponse: ExecuteWorkflowResponseDTO = { id: executionId }; - const mockResponse: AxiosResponse = { - data: mockExecResponse, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - - const executeWorkflowSpy = jest.spyOn( - DefaultApi.prototype, - 'executeWorkflow', - ); - axios.request = jest.fn().mockResolvedValueOnce(mockResponse); - - const args = { workflowId, parameters, businessKey }; - - return { mockExecResponse, executeWorkflowSpy, args }; - }; - - const getExpectations = ( - result: any, - mockExecResponse: ExecuteWorkflowResponseDTO, - executeWorkflowSpy: jest.SpyInstance, - parameters: JsonObject, - businessKey?: string, - ) => { - return () => { - expect(result).toBeDefined(); - expect(result.data).toEqual(mockExecResponse); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith({ - ...getAxiosTestRequest( - `/v2/workflows/${workflowId}/execute${businessKey ? `?businessKey=${businessKey}` : ''}`, - ), - data: JSON.stringify({ inputData: parameters }), - method: 'POST', - headers: { - 'Content-Type': 'application/json', - ...defaultAuthHeaders, - }, - }); - expect(executeWorkflowSpy).toHaveBeenCalledTimes(1); - expect(executeWorkflowSpy).toHaveBeenCalledWith( - workflowId, - { inputData: parameters }, - businessKey, - getDefaultTestRequestConfig(), - ); - }; - }; - - it('should execute workflow with empty parameters', async () => { - // Given - const { mockExecResponse, executeWorkflowSpy, args } = setupTest( - 'execId001', - {}, - ); - - // When - const result = await orchestratorClient.executeWorkflow(args); - - // Then - expect( - getExpectations(result, mockExecResponse, executeWorkflowSpy, {}), - ).not.toThrow(); - }); - it('should execute workflow with business key', async () => { - // Given - const businessKey = 'business123'; - const { mockExecResponse, executeWorkflowSpy, args } = setupTest( - 'execId001', - {}, - businessKey, - ); - - const result = await orchestratorClient.executeWorkflow(args); - - expect( - getExpectations( - result, - mockExecResponse, - executeWorkflowSpy, - {}, - businessKey, - ), - ).not.toThrow(); - }); - it('should execute workflow with parameters and business key', async () => { - // Given - const businessKey = 'business123'; - const parameters = { param1: 'one', param2: 2, param3: true }; - const { mockExecResponse, executeWorkflowSpy, args } = setupTest( - 'execId001', - parameters, - businessKey, - ); - - const result = await orchestratorClient.executeWorkflow(args); - - expect( - getExpectations( - result, - mockExecResponse, - executeWorkflowSpy, - parameters, - businessKey, - ), - ).not.toThrow(); - }); - }); - describe('abortWorkflow', () => { - it('should abort a workflow instance successfully', async () => { - // Given - const instanceId = 'instance123'; - - const mockResponse: AxiosResponse = { - data: instanceId, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - - const abortWorkflowSpy = jest.spyOn( - DefaultApi.prototype, - 'abortWorkflow', - ); - axios.request = jest.fn().mockResolvedValueOnce(mockResponse); - // When - const result = await orchestratorClient.abortWorkflowInstance(instanceId); - - // Then - expect(result).toBeDefined(); - expect(result.data).toEqual(instanceId); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith({ - ...getAxiosTestRequest(`/v2/workflows/instances/${instanceId}/abort`), - method: 'DELETE', - headers: { - ...defaultAuthHeaders, - }, - }); - expect(abortWorkflowSpy).toHaveBeenCalledTimes(1); - expect(abortWorkflowSpy).toHaveBeenCalledWith( - instanceId, - getDefaultTestRequestConfig(), - ); - }); - - it('should throw a ResponseError if aborting the workflow instance fails', async () => { - // Given - const instanceId = 'instance123'; - - // Mock fetch to simulate a failure - axios.request = jest - .fn() - .mockRejectedValueOnce(new Error('Simulated error')); - // When - const promise = orchestratorClient.abortWorkflowInstance(instanceId); - - // Then - await expect(promise).rejects.toThrow(); - }); - }); - describe('getWorkflowSource', () => { - it('should return workflow source when successful', async () => { - // Given - const workflowId = 'workflow123'; - const mockWorkflowSource = 'test workflow source'; - const responseConfigOptions = getDefaultTestRequestConfig(); - responseConfigOptions.responseType = 'text'; - const mockResponse: AxiosResponse = { - data: mockWorkflowSource, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - // Mock axios request to simulate a successful response - jest.spyOn(axios, 'request').mockResolvedValueOnce(mockResponse); - - // Spy DefaultApi - const getSourceSpy = jest.spyOn( - DefaultApi.prototype, - 'getWorkflowSourceById', - ); - - // When - const result = await orchestratorClient.getWorkflowSource(workflowId); - - // Then - expect(result).toBeDefined(); - expect(result.data).toEqual(mockWorkflowSource); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith({ - ...getAxiosTestRequest(`/v2/workflows/${workflowId}/source`), - method: 'GET', - headers: { - ...defaultAuthHeaders, - }, - responseType: 'text', - }); - expect(getSourceSpy).toHaveBeenCalledTimes(1); - expect(getSourceSpy).toHaveBeenCalledWith( - workflowId, - responseConfigOptions, - ); - }); - - it('should throw a ResponseError when fetching the workflow source fails', async () => { - // Given - const workflowId = 'workflow123'; - - // Mock fetch to simulate a failure - axios.request = jest - .fn() - .mockRejectedValueOnce(new Error('Simulated error')); - // When - const promise = orchestratorClient.getWorkflowSource(workflowId); - - // Then - await expect(promise).rejects.toThrow(); - }); - }); - describe('listWorkflowOverviews', () => { - it('should return workflow overviews when successful', async () => { - // Given - const paginationInfo: PaginationInfoDTO = { - offset: 1, - pageSize: 5, - orderBy: 'name', - orderDirection: 'ASC', - }; - const mockWorkflowOverviews: WorkflowOverviewListResultDTO = { - overviews: [ - { - workflowId: 'workflow123', - name: 'Workflow 1', - format: WorkflowFormatDTO.Yaml, - }, - { - workflowId: 'workflow456', - name: 'Workflow 2', - format: WorkflowFormatDTO.Yaml, - }, - ], - paginationInfo: paginationInfo, - }; - - const mockResponse: AxiosResponse = { - data: mockWorkflowOverviews, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - - // Spy DefaultApi - const getWorkflowsOverviewSpy = jest.spyOn( - DefaultApi.prototype, - 'getWorkflowsOverview', - ); - - // Mock axios request to simulate a successful response - jest.spyOn(axios, 'request').mockResolvedValueOnce(mockResponse); - - // When - const result = - await orchestratorClient.listWorkflowOverviews(paginationInfo); - - // Then - expect(result).toBeDefined(); - expect(result.data).toEqual(mockWorkflowOverviews); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith({ - ...getAxiosTestRequest('v2/workflows/overview'), - data: JSON.stringify({ paginationInfo }), - method: 'POST', - headers: { - 'Content-Type': 'application/json', - ...defaultAuthHeaders, - }, - }); - expect(getWorkflowsOverviewSpy).toHaveBeenCalledTimes(1); - expect(getWorkflowsOverviewSpy).toHaveBeenCalledWith( - { paginationInfo }, - getDefaultTestRequestConfig(), - ); - }); - it('should throw a ResponseError when listing workflow overviews fails', async () => { - // Given - - // Mock fetch to simulate a failure - axios.request = jest - .fn() - .mockRejectedValueOnce(new Error('Simulated error')); - - // When - const promise = orchestratorClient.listWorkflowOverviews(); - - // Then - await expect(promise).rejects.toThrow(); - }); - }); - describe('listInstances', () => { - it('should return instances when successful', async () => { - // Given - const paginationInfo: PaginationInfoDTO = { - offset: 1, - pageSize: 5, - orderBy: 'name', - orderDirection: 'ASC', - }; - - const mockInstances: ProcessInstanceListResultDTO = { - items: [{ id: 'instance123', processId: 'process001', nodes: [] }], - paginationInfo, - }; - - const mockResponse: AxiosResponse = { - data: mockInstances, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - - // Spy DefaultApi - const getInstancesSpy = jest.spyOn(DefaultApi.prototype, 'getInstances'); - - // Mock axios request to simulate a successful response - jest.spyOn(axios, 'request').mockResolvedValueOnce(mockResponse); - - // When - const result = await orchestratorClient.listInstances({ paginationInfo }); - // Then - expect(result).toBeDefined(); - expect(result.data).toEqual(mockInstances); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith({ - ...getAxiosTestRequest('v2/workflows/instances'), - data: JSON.stringify({ paginationInfo }), - headers: { - 'Content-Type': 'application/json', - ...defaultAuthHeaders, - }, - method: 'POST', - }); - expect(getInstancesSpy).toHaveBeenCalledTimes(1); - expect(getInstancesSpy).toHaveBeenCalledWith( - { paginationInfo }, - getDefaultTestRequestConfig(), - ); - }); - - it('should throw a ResponseError when listing instances fails', async () => { - // Given - axios.request = jest - .fn() - .mockRejectedValueOnce(new Error('Simulated error')); - // When - const promise = orchestratorClient.listInstances({}); - - // Then - await expect(promise).rejects.toThrow(); - }); - }); - describe('getInstance', () => { - it('should return instance when successful', async () => { - // Given - const instanceId = 'instance123'; - const instanceIdParent = 'instance000'; - const includeAssessment = false; - const mockInstance: AssessedProcessInstanceDTO = { - instance: { id: instanceId, processId: 'process002', nodes: [] }, - assessedBy: { - id: instanceIdParent, - processId: 'process001', - nodes: [], - }, - }; - - const mockResponse: AxiosResponse = { - data: mockInstance, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - // Mock axios request to simulate a successful response - jest.spyOn(axios, 'request').mockResolvedValueOnce(mockResponse); - - // Spy DefaultApi - const getInstanceSpy = jest.spyOn( - DefaultApi.prototype, - 'getInstanceById', - ); - // When - const result = await orchestratorClient.getInstance( - instanceId, - includeAssessment, - ); - - // Then - expect(result).toBeDefined(); - expect(result.data).toEqual(mockInstance); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith( - getAxiosTestRequest( - `v2/workflows/instances/${instanceId}`, - includeAssessment, - ), - ); - expect(getInstanceSpy).toHaveBeenCalledTimes(1); - expect(getInstanceSpy).toHaveBeenCalledWith( - instanceId, - includeAssessment, - getDefaultTestRequestConfig(), - ); - }); - - it('should throw a ResponseError when fetching the instance fails', async () => { - // Given - const instanceId = 'instance123'; - - axios.request = jest - .fn() - .mockRejectedValueOnce(new Error('Simulated error')); - // When - const promise = orchestratorClient.getInstance(instanceId); - - // Then - await expect(promise).rejects.toThrow(); - }); - }); - describe('getWorkflowOverview', () => { - it('should return workflow overview when successful', async () => { - // Given - const workflowId = 'workflow123'; - const mockOverview = { - workflowId: workflowId, - name: 'Workflow 1', - format: WorkflowFormatDTO.Yaml, - }; - - const mockResponse: AxiosResponse = { - data: mockOverview, - status: 200, - statusText: 'OK', - headers: {} as RawAxiosResponseHeaders, - config: {} as InternalAxiosRequestConfig, - }; - - // Spy DefaultApi - const getWorkflowOverviewByIdSpy = jest.spyOn( - DefaultApi.prototype, - 'getWorkflowOverviewById', - ); - - // Mock axios request to simulate a successful response - jest.spyOn(axios, 'request').mockResolvedValueOnce(mockResponse); - - // When - const result = await orchestratorClient.getWorkflowOverview(workflowId); - - // Then - expect(result).toBeDefined(); - expect(result.data).toEqual(mockOverview); - expect(axios.request).toHaveBeenCalledTimes(1); - expect(axios.request).toHaveBeenCalledWith( - getAxiosTestRequest(`v2/workflows/${workflowId}/overview`), - ); - expect(getWorkflowOverviewByIdSpy).toHaveBeenCalledTimes(1); - expect(getWorkflowOverviewByIdSpy).toHaveBeenCalledWith( - workflowId, - getDefaultTestRequestConfig(), - ); - }); - - it('should throw a ResponseError when fetching the workflow overview fails', async () => { - // Given - const workflowId = 'workflow123'; - - // Given - // Mock fetch to simulate a failure - axios.request = jest - .fn() - .mockRejectedValueOnce(new Error('Simulated error')); - - // When - const promise = orchestratorClient.getWorkflowOverview(workflowId); - - // Then - await expect(promise).rejects.toThrow(); - }); - }); - function getDefaultTestRequestConfig(): AxiosRequestConfig { - return { - baseURL: baseUrl, - headers: { Authorization: `Bearer ${mockToken}` }, - }; - } - - function getAxiosTestRequest( - endpoint: string, - includeAssessment?: boolean, - paginationInfo?: PaginationInfoDTO, - method: string = 'GET', - ): AxiosRequestConfig { - const req = getDefaultTestRequestConfig(); - - return { - ...req, - method, - url: buildURLWithPagination(endpoint, includeAssessment, paginationInfo), - }; - } - - function buildURLWithPagination( - endpoint: string, - includeAssessment?: boolean, - paginationInfo?: PaginationInfoDTO, - ): string { - const url = new URL(endpoint, baseUrl); - if (includeAssessment !== undefined) { - url.searchParams.append( - QUERY_PARAM_INCLUDE_ASSESSMENT, - String(includeAssessment), - ); - } - if (paginationInfo?.offset !== undefined) { - url.searchParams.append('page', paginationInfo.offset.toString()); - } - - if (paginationInfo?.pageSize !== undefined) { - url.searchParams.append('pageSize', paginationInfo.pageSize.toString()); - } - - if (paginationInfo?.orderBy !== undefined) { - url.searchParams.append('orderBy', paginationInfo.orderBy); - } - - if (paginationInfo?.orderDirection !== undefined) { - url.searchParams.append('orderDirection', paginationInfo.orderDirection); - } - return url.toString(); - } -}); diff --git a/plugins/orchestrator/src/api/OrchestratorClient.ts b/plugins/orchestrator/src/api/OrchestratorClient.ts deleted file mode 100644 index 30256b15b5..0000000000 --- a/plugins/orchestrator/src/api/OrchestratorClient.ts +++ /dev/null @@ -1,229 +0,0 @@ -import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; -import type { JsonObject } from '@backstage/types'; - -import axios, { - AxiosInstance, - AxiosRequestConfig, - AxiosResponse, - isAxiosError, - RawAxiosRequestHeaders, -} from 'axios'; - -import { - AssessedProcessInstanceDTO, - Configuration, - DefaultApi, - ExecuteWorkflowResponseDTO, - Filter, - GetInstancesRequest, - InputSchemaResponseDTO, - PaginationInfoDTO, - ProcessInstanceListResultDTO, - WorkflowOverviewDTO, - WorkflowOverviewListResultDTO, -} from '@janus-idp/backstage-plugin-orchestrator-common'; - -import { OrchestratorApi } from './api'; - -const getError = (err: unknown): Error => { - if ( - isAxiosError<{ error: { message: string; name: string } }>(err) && - err.response?.data?.error?.message - ) { - const error = new Error(err.response?.data?.error?.message); - error.name = err.response?.data?.error?.name || 'Error'; - return error; - } - return err as Error; -}; - -export interface OrchestratorClientOptions { - discoveryApi: DiscoveryApi; - identityApi: IdentityApi; - axiosInstance?: AxiosInstance; -} -export class OrchestratorClient implements OrchestratorApi { - private readonly discoveryApi: DiscoveryApi; - private readonly identityApi: IdentityApi; - private axiosInstance?: AxiosInstance; - - private baseUrl: string | null = null; - constructor(options: OrchestratorClientOptions) { - this.discoveryApi = options.discoveryApi; - this.identityApi = options.identityApi; - this.axiosInstance = options.axiosInstance; - } - - async getDefaultAPI(): Promise { - const baseUrl = await this.getBaseUrl(); - const { token: idToken } = await this.identityApi.getCredentials(); - - // Fixme: Following makes mocking of global axios complicated in the tests, ideally there should be just one axios instance: - this.axiosInstance = - this.axiosInstance || - axios.create({ - baseURL: baseUrl, - headers: { - ...(idToken && { Authorization: `Bearer ${idToken}` }), - }, - withCredentials: true, - }); - const config = new Configuration({ - basePath: baseUrl, - }); - - return new DefaultApi(config, baseUrl, this.axiosInstance); - } - private async getBaseUrl(): Promise { - if (!this.baseUrl) { - this.baseUrl = await this.discoveryApi.getBaseUrl('orchestrator'); - } - - return this.baseUrl; - } - - async executeWorkflow(args: { - workflowId: string; - parameters: JsonObject; - businessKey?: string; - }): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.executeWorkflow( - args.workflowId, - { inputData: args.parameters }, - args.businessKey, - reqConfigOption, - ); - } catch (err) { - throw getError(err); - } - } - - async abortWorkflowInstance( - instanceId: string, - ): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.abortWorkflow(instanceId, reqConfigOption); - } catch (err) { - throw getError(err); - } - } - - async getWorkflowSource(workflowId: string): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - reqConfigOption.responseType = 'text'; - try { - return await defaultApi.getWorkflowSourceById( - workflowId, - reqConfigOption, - ); - } catch (err) { - throw getError(err); - } - } - - async listWorkflowOverviews( - paginationInfo?: PaginationInfoDTO, - filters?: Filter, - ): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.getWorkflowsOverview( - { paginationInfo, filters }, - reqConfigOption, - ); - } catch (err) { - throw getError(err); - } - } - - async listInstances( - args: GetInstancesRequest, - ): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.getInstances(args, reqConfigOption); - } catch (err) { - throw getError(err); - } - } - - async getInstance( - instanceId: string, - includeAssessment = false, - ): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.getInstanceById( - instanceId, - includeAssessment, - reqConfigOption, - ); - } catch (err) { - throw getError(err); - } - } - - async getWorkflowDataInputSchema( - workflowId: string, - instanceId?: string, - ): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.getWorkflowInputSchemaById( - workflowId, - instanceId, - reqConfigOption, - ); - } catch (err) { - throw getError(err); - } - } - - async getWorkflowOverview( - workflowId: string, - ): Promise> { - const defaultApi = await this.getDefaultAPI(); - const reqConfigOption: AxiosRequestConfig = - await this.getDefaultReqConfig(); - try { - return await defaultApi.getWorkflowOverviewById( - workflowId, - reqConfigOption, - ); - } catch (err) { - throw getError(err); - } - } - - // getDefaultReqConfig is a convenience wrapper that includes authentication and other necessary headers - private async getDefaultReqConfig( - additionalHeaders?: RawAxiosRequestHeaders, - ): Promise { - const idToken = await this.identityApi.getCredentials(); - const reqConfigOption: AxiosRequestConfig = { - baseURL: await this.getBaseUrl(), - headers: { - Authorization: `Bearer ${idToken.token}`, - ...additionalHeaders, - }, - }; - return reqConfigOption; - } -} diff --git a/plugins/orchestrator/src/components/ExecuteWorkflowPage/ExecuteWorkflowPage.tsx b/plugins/orchestrator/src/components/ExecuteWorkflowPage/ExecuteWorkflowPage.tsx deleted file mode 100644 index 65af687a42..0000000000 --- a/plugins/orchestrator/src/components/ExecuteWorkflowPage/ExecuteWorkflowPage.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import React, { useCallback, useState } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { useAsync } from 'react-use'; - -import { - InfoCard, - Progress, - ResponseErrorPanel, - useQueryParamState, -} from '@backstage/core-components'; -import { - useApi, - useRouteRef, - useRouteRefParams, -} from '@backstage/core-plugin-api'; -import type { JsonObject } from '@backstage/types'; - -import { Grid } from '@material-ui/core'; - -import { - InputSchemaResponseDTO, - QUERY_PARAM_ASSESSMENT_INSTANCE_ID, - QUERY_PARAM_INSTANCE_ID, -} from '@janus-idp/backstage-plugin-orchestrator-common'; -import { OrchestratorForm } from '@janus-idp/backstage-plugin-orchestrator-form-react'; - -import { orchestratorApiRef } from '../../api'; -import { - executeWorkflowRouteRef, - workflowInstanceRouteRef, -} from '../../routes'; -import { getErrorObject } from '../../utils/ErrorUtils'; -import { BaseOrchestratorPage } from '../BaseOrchestratorPage'; -import JsonTextAreaForm from './JsonTextAreaForm'; - -export const ExecuteWorkflowPage = () => { - const orchestratorApi = useApi(orchestratorApiRef); - const { workflowId } = useRouteRefParams(executeWorkflowRouteRef); - const [isExecuting, setIsExecuting] = useState(false); - const [updateError, setUpdateError] = React.useState(); - const [instanceId] = useQueryParamState(QUERY_PARAM_INSTANCE_ID); - const [assessmentInstanceId] = useQueryParamState( - QUERY_PARAM_ASSESSMENT_INSTANCE_ID, - ); - const effectiveInstanceId = assessmentInstanceId || instanceId; - const navigate = useNavigate(); - const instanceLink = useRouteRef(workflowInstanceRouteRef); - const { - value, - loading, - error: responseError, - } = useAsync(async (): Promise => { - const res = await orchestratorApi.getWorkflowDataInputSchema( - workflowId, - effectiveInstanceId, - ); - return res.data; - }, [orchestratorApi, workflowId]); - const schema = value?.inputSchema; - const data = value?.data; - const { - value: workflowName, - loading: workflowNameLoading, - error: workflowNameError, - } = useAsync(async (): Promise => { - const res = await orchestratorApi.getWorkflowOverview(workflowId); - return res.data.name || ''; - }, [orchestratorApi, workflowId]); - - const handleExecute = useCallback( - async (parameters: JsonObject) => { - setUpdateError(undefined); - try { - setIsExecuting(true); - const response = await orchestratorApi.executeWorkflow({ - workflowId, - parameters, - businessKey: effectiveInstanceId, - }); - navigate(instanceLink({ instanceId: response.data.id })); - } catch (err) { - setUpdateError(getErrorObject(err)); - } finally { - setIsExecuting(false); - } - }, - [orchestratorApi, workflowId, navigate, instanceLink, effectiveInstanceId], - ); - - const error = responseError || workflowNameError; - let pageContent; - - if (loading || workflowNameLoading) { - pageContent = ; - } else if (error) { - pageContent = ; - } else { - pageContent = ( - - {updateError && ( - - - - )} - - - {!!schema ? ( - - ) : ( - - )} - - - - ); - } - - return ( - - {pageContent} - - ); -};