diff --git a/src/common/open-api/models/HumanTaskDefinition.ts b/src/common/open-api/models/HumanTaskDefinition.ts index 3a3316e..f36c16e 100644 --- a/src/common/open-api/models/HumanTaskDefinition.ts +++ b/src/common/open-api/models/HumanTaskDefinition.ts @@ -2,14 +2,15 @@ /* tslint:disable */ /* eslint-disable */ -import type { HumanTaskAssignment } from './HumanTaskAssignment'; -import type { HumanTaskTrigger } from './HumanTaskTrigger'; -import type { UserFormTemplate } from './UserFormTemplate'; +import type { HumanTaskAssignment } from "./HumanTaskAssignment"; +import type { HumanTaskTemplate } from "./HumanTaskTemplate"; +import type { HumanTaskTrigger } from "./HumanTaskTrigger"; +import type { UserFormTemplate } from "./UserFormTemplate"; export type HumanTaskDefinition = { - assignmentCompletionStrategy?: 'LEAVE_OPEN' | 'TERMINATE'; + assignmentCompletionStrategy?: "LEAVE_OPEN" | "TERMINATE"; assignments?: Array; taskTriggers?: Array; userFormTemplate?: UserFormTemplate; + fullTemplate?: HumanTaskTemplate; }; - diff --git a/src/common/open-api/models/HumanTaskSearch.ts b/src/common/open-api/models/HumanTaskSearch.ts index 80405a0..acd21dd 100644 --- a/src/common/open-api/models/HumanTaskSearch.ts +++ b/src/common/open-api/models/HumanTaskSearch.ts @@ -15,6 +15,7 @@ export type HumanTaskSearch = { start?: number; states?: Array<'PENDING' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'TIMED_OUT' | 'DELETED'>; taskRefNames?: Array; + workflowIds?: Array; workflowNames?: Array; }; diff --git a/src/common/open-api/services/HumanTaskService.ts b/src/common/open-api/services/HumanTaskService.ts index fc53f67..1df7e13 100644 --- a/src/common/open-api/services/HumanTaskService.ts +++ b/src/common/open-api/services/HumanTaskService.ts @@ -1,17 +1,16 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { HumanTaskAssignment } from '../models/HumanTaskAssignment'; -import type { HumanTaskEntry } from '../models/HumanTaskEntry'; -import type { HumanTaskSearch } from '../models/HumanTaskSearch'; -import type { HumanTaskSearchResult } from '../models/HumanTaskSearchResult'; -import type { HumanTaskTemplate } from '../models/HumanTaskTemplate'; +import type { HumanTaskAssignment } from "../models/HumanTaskAssignment"; +import type { HumanTaskEntry } from "../models/HumanTaskEntry"; +import type { HumanTaskSearch } from "../models/HumanTaskSearch"; +import type { HumanTaskSearchResult } from "../models/HumanTaskSearchResult"; +import type { HumanTaskTemplate } from "../models/HumanTaskTemplate"; -import type { CancelablePromise } from '../core/CancelablePromise'; -import type { BaseHttpRequest } from '../core/BaseHttpRequest'; +import type { CancelablePromise } from "../core/CancelablePromise"; +import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class HumanTaskService { - constructor(public readonly httpRequest: BaseHttpRequest) {} /** @@ -105,12 +104,16 @@ export class HumanTaskService { */ public getTask1( taskId: string, + withTemplate: boolean = false ): CancelablePromise { return this.httpRequest.request({ method: 'GET', url: '/human/tasks/{taskId}', path: { - 'taskId': taskId, + taskId: taskId, + }, + query: { + withTemplate, }, }); } @@ -245,8 +248,8 @@ export class HumanTaskService { complete: boolean = false, ): CancelablePromise { return this.httpRequest.request({ - method: 'POST', - url: '/human/tasks/{taskId}/update', + method: "POST", + url: "/human/tasks/{taskId}/update", path: { 'taskId': taskId, }, diff --git a/src/core/human.ts b/src/core/human.ts index e89fd4a..eb6fbb7 100644 --- a/src/core/human.ts +++ b/src/core/human.ts @@ -30,6 +30,11 @@ type PollIntervalOptions = { pollInterval: number; maxPollTimes: number; }; + +type ClaimOptions = { + overrideAssignment: boolean; + withTemplate: boolean; +}; export class HumanExecutor { public readonly _client: ConductorClient; @@ -60,7 +65,7 @@ export class HumanExecutor { claimedBy?: string, taskName?: string, taskInputQuery?: string, - taskOutputQuery?: string, + taskOutputQuery?: string ): Promise { const [claimedUserType, claimedUser] = claimedBy?.split(":") ?? []; @@ -76,7 +81,7 @@ export class HumanExecutor { : [], taskRefNames: taskName ? [taskName] : [], taskInputQuery, - taskOutputQuery + taskOutputQuery, }); return response; @@ -141,8 +146,13 @@ export class HumanExecutor { * @param taskId * @returns */ - public getTaskById(taskId: string): Promise { - return tryCatchReThrow(() => this._client.humanTask.getTask1(taskId!)); + public getTaskById( + taskId: string, + withTemplate: boolean = false + ): Promise { + return tryCatchReThrow(() => + this._client.humanTask.getTask1(taskId!, withTemplate) + ); } /** @@ -154,10 +164,15 @@ export class HumanExecutor { public async claimTaskAsExternalUser( taskId: string, assignee: string, - options?:Record + options?: ClaimOptions ): Promise { return tryCatchReThrow(() => - this._client.humanTask.assignAndClaim(taskId, assignee,options?.overrideAssignment,options?.withTemplate) + this._client.humanTask.assignAndClaim( + taskId, + assignee, + options?.overrideAssignment, + options?.withTemplate + ) ); } @@ -168,9 +183,15 @@ export class HumanExecutor { */ public async claimTaskAsConductorUser( taskId: string, - options?:Record + options?: ClaimOptions ): Promise { - return tryCatchReThrow(() => this._client.humanTask.claimTask(taskId,options?.overrideAssignment,options?.withTemplate)); + return tryCatchReThrow(() => + this._client.humanTask.claimTask( + taskId, + options?.overrideAssignment, + options?.withTemplate + ) + ); } /**