@camunda8/sdk
Version:
[](https://www.npmjs.com/package/@camunda8/sdk)
148 lines (147 loc) • 5.37 kB
TypeScript
import { LosslessDto } from '../../lib';
export type TaskState = 'COMPLETED' | 'CREATED' | 'CANCELED' | 'FAILED';
export interface DraftSearchVariableValue {
value: string;
isValueTruncated: boolean;
previewValue: string;
}
export interface VariableSearchResponseWithoutDraft {
id: string;
name: string;
value: string;
previewValue: string;
}
export interface VariableSearchResponse extends VariableSearchResponseWithoutDraft {
draft: DraftSearchVariableValue;
}
export interface Variable {
id: string;
name: string;
value: string;
tenantId: string;
draft: DraftSearchVariableValue;
}
export interface DateFilter {
from: Date | string;
to: Date | string;
}
export interface TaskByVariables {
name: string;
value: string;
operator: 'eq';
}
interface TaskOrderBy {
field: 'completionTime' | 'creationTime' | 'followUpDate' | 'dueDate';
order: 'ASC' | 'DESC';
}
interface IncludeVariable {
name: string;
alwaysReturnFullValue?: boolean;
}
export interface TaskSearchRequestBase {
state: TaskState;
assigned: boolean;
assignee: string;
assignees: string[];
taskDefinitionId: string;
candidateGroup: string;
candidateGroups: string[];
candidateUser: string;
candidateUsers: string[];
processDefinitionKey: string;
processInstanceKey: string;
pageSize: number;
followUpDate: DateFilter;
dueDate: DateFilter;
/** An array of filter clauses specifying the variables to filter for.
* If defined, the query returns only tasks to which all clauses apply.
* However, it's important to note that this filtering mechanism is
* designed to work exclusively with truncated variables. This means
* variables of a larger size are not compatible with this filter, and
* attempts to use them may result in inaccurate or incomplete query results.
*/
taskVariables: TaskByVariables[];
tenantIds: string[];
sort: TaskOrderBy[];
/**
* An array used to specify a list of variable names that should be included in the response when querying tasks.
* This field allows users to selectively retrieve specific variables associated with the tasks returned in the search results.
*/
includeVariables: IncludeVariable[];
implementation: 'JOB_WORKER' | 'ZEEBE_USER_TASK';
}
export interface TaskSearchAfterRequest extends Partial<TaskSearchRequestBase> {
/**
* Used to return a paginated result. Array of values that should be copied from sortValues of one of the tasks from the current search results page.
* It enables the API to return a page of tasks that directly follow the task identified by the provided values, with respect to the sorting order.
*/
searchAfter: string[];
}
export interface TaskSearchAfterOrEqualRequest extends Partial<TaskSearchRequestBase> {
/**
* Used to return a paginated result. Array of values that should be copied from sortValues of one of the tasks from the current search results page.
* It enables the API to return a page of tasks that directly follow or are equal to the task identified by the provided values, with respect to the sorting order.
*/
searchAfterOrEqual: string[];
}
export interface TaskSearchBeforeRequest extends Partial<TaskSearchRequestBase> {
/**
* Used to return a paginated result. Array of values that should be copied from sortValues of one of the tasks from the current search results page.
* It enables the API to return a page of tasks that directly precede the task identified by the provided values, with respect to the sorting order.
*/
searchBefore: string[];
}
export interface TaskSearchBeforeOrEqualRequest extends Partial<TaskSearchRequestBase> {
/**
* Used to return a paginated result. Array of values that should be copied from sortValues of one of the tasks from the current search results page.
* It enables the API to return a page of tasks that directly precede or are equal to the task identified by the provided values, with respect to the sorting order.
*/
searchBeforeOrEqual: string[];
}
export declare class TaskResponse extends LosslessDto {
id: string;
name: string;
taskDefinitionId: string;
processName: string;
creationDate: string;
completionDate: string;
assignee: string;
taskState: 'COMPLETED' | 'CREATED' | 'CANCELED' | 'FAILED';
formKey: string;
formId: string;
formVersion?: string;
isFormEmbedded?: boolean;
processDefinitionKey: string;
processInstanceKey: string;
tenantId: string;
dueDate: string;
followUpDate: string;
candidateGroups: string[];
candidateUsers: string[];
implementation: 'JOB_WORKER' | 'ZEEBE_USER_TASK';
}
export declare class TaskSearchResponse extends TaskResponse {
sortValues: string[];
isFirst: boolean;
variables: VariableSearchResponseWithoutDraft[];
}
export interface VariableInput {
name: string;
value: string;
}
export interface User {
userId: string;
displayName: string;
permissions: string[];
roles: string[];
salesPlanType: string;
}
export declare class Form extends LosslessDto {
id: string;
processDefinitionId: string;
schema: string;
version: string;
tenantId: string;
isDeleted: boolean;
}
export {};