import { IUiPath } from '../core/index'; /** * Standardized result interface for all operation methods (pause, cancel, complete, update, upload, etc.) * Success responses include data from the request context or API response */ interface OperationResponse { /** * Whether the operation was successful */ success: boolean; /** * Response data (can contain error details in case of failure) */ data: TData; } /** * Common enum for job state used across services */ declare enum JobState { Pending = "Pending", Running = "Running", Stopping = "Stopping", Terminating = "Terminating", Faulted = "Faulted", Successful = "Successful", Stopped = "Stopped", Suspended = "Suspended", Resumed = "Resumed", Cancelled = "Cancelled", /** Server-side fallback for an unrecognized or missing job state. */ Unknown = "Unknown" } interface BaseOptions { expand?: string; select?: string; } /** * Common request options interface used across services for querying data */ interface RequestOptions extends BaseOptions { filter?: string; orderby?: string; } /** * Simplified universal pagination cursor * Used to fetch next/previous pages */ interface PaginationCursor { /** Opaque string containing all information needed to fetch next page */ value: string; } /** * Discriminated union for pagination methods - ensures cursor and jumpToPage are mutually exclusive */ type PaginationMethodUnion = { cursor?: PaginationCursor; jumpToPage?: never; } | { cursor?: never; jumpToPage?: number; } | { cursor?: never; jumpToPage?: never; }; /** * Pagination options. Users cannot specify both cursor and jumpToPage. */ type PaginationOptions = { /** Size of the page to fetch (items per page) */ pageSize?: number; } & PaginationMethodUnion; /** * Paginated response containing items and navigation information */ interface PaginatedResponse { /** The items in the current page */ items: T[]; /** Total count of items across all pages (if available) */ totalCount?: number; /** Whether more pages are available */ hasNextPage: boolean; /** Cursor to fetch the next page (if available) */ nextCursor?: PaginationCursor; /** Cursor to fetch the previous page (if available) */ previousCursor?: PaginationCursor; /** Current page number (1-based, if available) */ currentPage?: number; /** Total number of pages (if available) */ totalPages?: number; /** Whether this pagination type supports jumping to arbitrary pages */ supportsPageJump: boolean; } /** * Response for non-paginated calls that includes both data and total count */ interface NonPaginatedResponse { items: T[]; totalCount?: number; } /** * Helper type for defining paginated method overloads * Creates a union type of all ways pagination can be triggered */ type HasPaginationOptions = (T & { pageSize: number; }) | (T & { cursor: PaginationCursor; }) | (T & { jumpToPage: number; }); declare enum TaskUserType { /** A user of this type is supposed to be used by a human. */ User = "User", /** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */ Robot = "Robot", /** A user of type Directory User */ DirectoryUser = "DirectoryUser", /** A user of type Directory Group */ DirectoryGroup = "DirectoryGroup", /** A user of type Directory Robot Account */ DirectoryRobot = "DirectoryRobot", /** A user of type Directory External Application */ DirectoryExternalApplication = "DirectoryExternalApplication" } interface UserLoginInfo { name: string; surname: string; userName: string; emailAddress: string; displayName: string; id: number; type: TaskUserType; } /** * Types of tasks available in Action Center. * Each type determines the task's behavior, UI rendering, and completion requirements. */ declare enum TaskType { /** A form-based task that renders a UiPath form layout for user input */ Form = "FormTask", /** An externally managed task handled outside of Action Center */ External = "ExternalTask", /** A task powered by a UiPath App */ App = "AppTask", /** A document validation task for reviewing and correcting extracted document data */ DocumentValidation = "DocumentValidationTask", /** A document classification task for categorizing documents */ DocumentClassification = "DocumentClassificationTask", /** A data labeling task for annotating training data */ DataLabeling = "DataLabelingTask" } declare enum TaskPriority { Low = "Low", Medium = "Medium", High = "High", Critical = "Critical" } declare enum TaskStatus { Unassigned = "Unassigned", Pending = "Pending", Completed = "Completed" } declare enum TaskSlaCriteria { TaskCreated = "TaskCreated", TaskAssigned = "TaskAssigned", TaskCompleted = "TaskCompleted" } declare enum TaskSlaStatus { OverdueLater = "OverdueLater", OverdueSoon = "OverdueSoon", Overdue = "Overdue", CompletedInTime = "CompletedInTime" } declare enum TaskSourceName { Agent = "Agent", Workflow = "Workflow", Maestro = "Maestro", Default = "Default" } interface TaskSource { sourceName: TaskSourceName; sourceId: string; taskSourceMetadata: Record; } /** * Task activity types */ declare enum TaskActivityType { Created = "Created", Assigned = "Assigned", Reassigned = "Reassigned", Unassigned = "Unassigned", Saved = "Saved", Forwarded = "Forwarded", Completed = "Completed", Commented = "Commented", Deleted = "Deleted", BulkSaved = "BulkSaved", BulkCompleted = "BulkCompleted", FirstOpened = "FirstOpened" } /** * Tag information for tasks */ interface Tag { name: string; displayName: string; displayValue: string; } /** * Task activity information */ interface TaskActivity { task?: RawTaskGetResponse; organizationUnitId: number; taskId: number; taskKey: string; activityType: TaskActivityType; creatorUserId: number; targetUserId: number | null; createdTime: string; } interface TaskSlaDetail { expiryTime?: string; startCriteria?: TaskSlaCriteria; endCriteria?: TaskSlaCriteria; status?: TaskSlaStatus; } interface TaskAssignment { assignee?: UserLoginInfo; task?: RawTaskGetResponse; id?: number; } /** * Base interface containing common fields shared across all task response types */ interface TaskBaseResponse { status: TaskStatus; title: string; type: TaskType; priority: TaskPriority; folderId: number; key: string; isDeleted: boolean; createdTime: string; id: number; action: string | null; externalTag: string | null; lastAssignedTime: string | null; completedTime: string | null; parentOperationId: string | null; deleterUserId: number | null; deletedTime: string | null; lastModifiedTime: string | null; } interface TaskCreateOptions { title: string; data?: Record; priority?: TaskPriority; } interface RawTaskCreateResponse extends TaskBaseResponse { waitJobState: JobState | null; assignedToUser: UserLoginInfo | null; taskSlaDetails: TaskSlaDetail[] | null; completedByUser: UserLoginInfo | null; taskAssignees: UserLoginInfo[] | null; processingTime: number | null; data: Record | null; } interface RawTaskGetResponse extends TaskBaseResponse { isCompleted: boolean; encrypted: boolean; bulkFormLayoutId: number | null; formLayoutId: number | null; taskSlaDetail: TaskSlaDetail | null; taskAssigneeName: string | null; lastModifierUserId: number | null; assignedToUser: UserLoginInfo | null; creatorUser?: UserLoginInfo; lastModifierUser?: UserLoginInfo; taskAssignments?: TaskAssignment[]; activities?: TaskActivity[]; tags?: Tag[]; formLayout?: Record; actionLabel?: string | null; taskSlaDetails?: TaskSlaDetail[] | null; completedByUser?: UserLoginInfo | null; taskAssignmentCriteria?: TaskAssignmentCriteria; taskAssignees?: UserLoginInfo[] | null; taskSource?: TaskSource | null; processingTime?: number | null; data?: Record | null; } /** * Defines how a task assignment is distributed. * * Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user * assignment) when not specified. The group-based criteria tell Action Center * how to distribute the task across the members of a directory group. */ declare enum TaskAssignmentCriteria { /** Assigned to a single user, like a direct assignment. */ SingleUser = "SingleUser", /** Assigned to the group member with the fewest pending tasks. */ Workload = "Workload", /** Assigned to all users in the group. */ AllUsers = "AllUsers", /** Assigned in a round-robin manner across the group's members. */ RoundRobin = "RoundRobin" } /** * Options for task assignment operations when called from a task instance * Requires either userId or userNameOrEmail, but not both. Optionally accepts * an assignment criteria; defaults to a single-user assignment, set a group * criteria (e.g. {@link TaskAssignmentCriteria.AllUsers}) for a directory group. */ type TaskAssignOptions = ({ userId: number; userNameOrEmail?: never; } | { userId?: never; userNameOrEmail: string; }) & { /** * How the assignment is distributed. Optional — defaults to * {@link TaskAssignmentCriteria.SingleUser} (a direct single-user assignment). * Set a group criteria (e.g. {@link TaskAssignmentCriteria.AllUsers}) to * distribute the task across a directory group's members. */ assignmentCriteria?: TaskAssignmentCriteria; }; /** * Options for task assignment operations when called from the service * Extends TaskAssignOptions with the required taskId field */ type TaskAssignmentOptions = { taskId: number; } & TaskAssignOptions; interface TasksUnassignOptions { taskIds: number[]; } interface TaskAssignmentResponse { taskId?: number; userId?: number; errorCode?: number; errorMessage?: string; userNameOrEmail?: string; } /** * Options for completing a task */ type TaskCompleteOptions = { type: TaskType.External; data?: any; action?: string; } | { type: TaskType.DocumentValidation; data?: any; action?: string; } | { type: TaskType.DocumentClassification; data?: any; action?: string; } | { type: TaskType.DataLabeling; data?: any; action?: string; } | { type: TaskType.Form; data: any; action: string; } | { type: TaskType.App; data: any; action: string; }; /** * Options for completing a task when called from the service * Extends TaskCompleteOptions with the required taskId field */ type TaskCompletionOptions = TaskCompleteOptions & { taskId: number; }; /** * Options for getting tasks across folders */ type TaskGetAllOptions = RequestOptions & PaginationOptions & { /** * Optional folder ID to filter tasks by folder */ folderId?: number; /** * Optional flag to fetch tasks using admin permissions * When true, fetches tasks across folders * where the user has at least Task.View, Task.Edit and TaskAssignment.Create permissions * When false or omitted, fetches tasks across folders * where the user has at least Task.View and Task.Edit permissions */ asTaskAdmin?: boolean; }; /** * Query options for getting a task by ID */ interface TaskGetByIdOptions extends BaseOptions { /** * Optional task type. When not provided, method will automatically identify the * task type and resolve accordingly, but it will be slower. * When provided, it will skip the step to identify the task type, so it will be faster. */ taskType?: TaskType; } /** * Options for getting users with task permissions */ type TaskGetUsersOptions = RequestOptions & PaginationOptions; /** * Service for managing UiPath Action Center * * Tasks are task-based automation components that can be integrated into applications and processes. They represent discrete units of work that can be triggered and monitored through the UiPath API. [UiPath Action Center Guide](https://docs.uipath.com/automation-cloud/docs/actions) * * ### Usage * * Prerequisites: Initialize the SDK first - see [Getting Started](/uipath-typescript/getting-started/#import-initialize) * * ```typescript * import { Tasks } from '@uipath/uipath-typescript/tasks'; * * const tasks = new Tasks(sdk); * const allTasks = await tasks.getAll(); * ``` */ interface TaskServiceModel { /** * Gets all tasks across folders with optional filtering * * @param options - Query options including optional folderId, asTaskAdmin flag and pagination options * @returns Promise resolving to either an array of tasks NonPaginatedResponse or a PaginatedResponse when pagination options are used. * {@link TaskGetResponse} * @example * ```typescript * // Standard array return * const allTasks = await tasks.getAll(); * * // Get tasks within a specific folder * const folderTasks = await tasks.getAll({ * folderId: 123 * }); * * // Get tasks with admin permissions * // This fetches tasks across folders where the user has Task.View, Task.Edit and TaskAssignment.Create permissions * const adminTasks = await tasks.getAll({ * asTaskAdmin: true * }); * * // Get tasks without admin permissions (default) * // This fetches tasks across folders where the user has Task.View and Task.Edit permissions * const userTasks = await tasks.getAll({ * asTaskAdmin: false * }); * * // First page with pagination * const page1 = await tasks.getAll({ pageSize: 10 }); * * // Navigate using cursor * if (page1.hasNextPage) { * const page2 = await tasks.getAll({ cursor: page1.nextCursor }); * } * * // Jump to specific page * const page5 = await tasks.getAll({ * jumpToPage: 5, * pageSize: 10 * }); * ``` */ getAll(options?: T): Promise ? PaginatedResponse : NonPaginatedResponse>; /** * Gets a task by ID * @param id - The ID of the task to retrieve * @param options - Optional query parameters including taskType for faster retrieval {@link TaskGetByIdOptions} * @param folderId - Optional folder ID (REQUIRED when options.taskType is provided) * @returns Promise resolving to the task * {@link TaskGetResponse} * @example * ```typescript * // Get a task by ID * const task = await tasks.getById(); * * // Get a form task by ID * const formTask = await tasks.getById(, {}, ); * * // Access form task properties * console.log(formTask.formLayout); * * // Get a document validation task by ID (faster with taskType provided in the options) * const dvTask = await tasks.getById(, { taskType: TaskType.DocumentValidation }, ); * ``` */ getById(id: number, options?: TaskGetByIdOptions, folderId?: number): Promise; /** * Creates a new task * * @param options - The task to be created * @param folderId - Required folder ID * @returns Promise resolving to the created task * {@link TaskCreateResponse} * @example * ```typescript * import { TaskPriority } from '@uipath/uipath-typescript'; * const task = await tasks.create({ * title: "My Task", * priority: TaskPriority.Medium * }, ); // folderId is required * ``` */ create(options: TaskCreateOptions, folderId: number): Promise; /** * Assigns tasks to users * * @param options - Single task assignment or array of task assignments * @returns Promise resolving to array of task assignment results * {@link TaskAssignmentResponse} * @example * ```typescript * // Assign a single task to a user by ID * const result = await tasks.assign({ * taskId: , * userId: * }); * * // Or using instance method * const task = await tasks.getById(); * const result = await task.assign({ * userId: * }); * * // Assign a single task to a user by email * const result = await tasks.assign({ * taskId: , * userNameOrEmail: "user@example.com" * }); * * // Assign multiple tasks * const result = await tasks.assign([ * { taskId: , userId: }, * { taskId: , userNameOrEmail: "user@example.com" } * ]); * ``` * * @example Group assignment * ```typescript * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks'; * * // Assign to a directory group by userId + criteria — Action Center * // distributes the task across the group's members based on the criteria * const result = await tasks.assign({ * taskId: , * userId: , // a DirectoryGroup id from tasks.getUsers() * assignmentCriteria: TaskAssignmentCriteria.AllUsers * }); * * // ...or identify the group by name instead of id * const result2 = await tasks.assign({ * taskId: , * userNameOrEmail: "", * assignmentCriteria: TaskAssignmentCriteria.AllUsers * }); * ``` */ assign(options: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise>; /** * Reassigns tasks to new users * * @param options - Single task assignment or array of task assignments * @returns Promise resolving to array of task assignment results * {@link TaskAssignmentResponse} * @example * ```typescript * // Reassign a single task to a user by ID * const result = await tasks.reassign({ * taskId: , * userId: * }); * * // Or using instance method * const task = await tasks.getById(); * const result = await task.reassign({ * userId: * }); * * // Reassign a single task to a user by email * const result = await tasks.reassign({ * taskId: , * userNameOrEmail: "user@example.com" * }); * * // Reassign multiple tasks * const result = await tasks.reassign([ * { taskId: , userId: }, * { taskId: , userNameOrEmail: "user@example.com" } * ]); * ``` * * @example Group reassignment * ```typescript * import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks'; * * // Reassign to a directory group by userId + criteria * const result = await tasks.reassign({ * taskId: , * userId: , // a DirectoryGroup id from tasks.getUsers() * assignmentCriteria: TaskAssignmentCriteria.AllUsers * }); * * // ...or identify the group by name instead of id * const result2 = await tasks.reassign({ * taskId: , * userNameOrEmail: "", * assignmentCriteria: TaskAssignmentCriteria.AllUsers * }); * ``` */ reassign(options: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise>; /** * Unassigns tasks (removes current assignees) * * @param taskId - Single task ID or array of task IDs to unassign * @returns Promise resolving to array of task assignment results * {@link TaskAssignmentResponse} * @example * ```typescript * // Unassign a single task * const result = await tasks.unassign(); * * // Or using instance method * const task = await tasks.getById(); * const result = await task.unassign(); * * // Unassign multiple tasks * const result = await tasks.unassign([, , ]); * ``` */ unassign(taskId: number | number[]): Promise>; /** * Completes a task with the specified type and data * * @param options - The completion options including task type, taskId, data, and action * @param folderId - Required folder ID * @returns Promise resolving to completion result * {@link TaskCompleteOptions} * @example * ```typescript * // Complete an app task * await tasks.complete({ * type: TaskType.App, * taskId: , * data: {}, * action: "submit" * }, ); // folderId is required * * // Complete an external task * await tasks.complete({ * type: TaskType.External, * taskId: * }, ); // folderId is required * ``` */ complete(options: TaskCompletionOptions, folderId: number): Promise>; /** * Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions * Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided, * or a PaginatedResponse when any pagination parameter is provided * * @param folderId - The folder ID to get task users from * @param options - Optional query and pagination parameters * @returns Promise resolving to either an array of task users NonPaginatedResponse or a PaginatedResponse when pagination options are used. * {@link UserLoginInfo} * @example * ```typescript * // Get task users from a folder * const users = await tasks.getUsers(); * * // Access user properties * console.log(users.items[0].name); * console.log(users.items[0].emailAddress); * ``` */ getUsers(folderId: number, options?: T): Promise ? PaginatedResponse : NonPaginatedResponse>; } interface TaskMethods { /** * Assigns this task to a user or users * * @param options - Assignment options (requires at least one of: userId, userNameOrEmail) * @returns Promise resolving to task assignment results */ assign(options: TaskAssignOptions): Promise>; /** * Reassigns this task to a new user * * @param options - Assignment options (requires at least one of: userId, userNameOrEmail) * @returns Promise resolving to task assignment results */ reassign(options: TaskAssignOptions): Promise>; /** * Unassigns this task (removes current assignee) * * @returns Promise resolving to task assignment results */ unassign(): Promise>; /** * Completes this task with optional data and action * * @param options - Completion options * @returns Promise resolving to completion result */ complete(options: TaskCompleteOptions): Promise>; } type TaskGetResponse = RawTaskGetResponse & TaskMethods; type TaskCreateResponse = RawTaskCreateResponse & TaskMethods; /** * Creates an actionable task by combining API task data with operational methods. * * @param taskData - The task data from API * @param service - The task service instance * @returns A task object with added methods */ declare function createTaskWithMethods(taskData: RawTaskGetResponse | RawTaskCreateResponse, service: TaskServiceModel): TaskGetResponse | TaskCreateResponse; /** * Pagination types supported by the SDK */ declare enum PaginationType { OFFSET = "offset", TOKEN = "token" } /** * Interface for service access methods needed by pagination helpers */ interface PaginationServiceAccess { get(path: string, options?: any): Promise<{ data: T; }>; post(path: string, body?: any, options?: any): Promise<{ data: T; }>; requestWithPagination(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise>; } /** * Field names for extracting data from paginated responses. */ interface PaginationFieldNames { itemsField?: string; totalCountField?: string; continuationTokenField?: string; } /** * Options for the requestWithPagination method in BaseService. */ interface RequestWithPaginationOptions extends RequestSpec { pagination: PaginationFieldNames & { paginationType: PaginationType; paginationParams?: { pageSizeParam?: string; offsetParam?: string; tokenParam?: string; countParam?: string; convertToSkip?: boolean; zeroBased?: boolean; }; }; } /** * HTTP methods supported by the API client */ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS'; /** * Supported response types for API requests */ type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream'; /** * Query parameters type with support for arrays and nested objects */ type QueryParams = Record | null | undefined>; /** * Standard HTTP headers type */ type Headers = Record; /** * Options for request retries */ interface RetryOptions { /** Maximum number of retry attempts */ maxRetries?: number; /** Base delay between retries in milliseconds */ retryDelay?: number; /** Whether to use exponential backoff */ useExponentialBackoff?: boolean; /** Status codes that should trigger a retry */ retryableStatusCodes?: number[]; } /** * Options for request timeouts */ interface TimeoutOptions { /** Request timeout in milliseconds */ timeout?: number; /** Whether to abort the request on timeout */ abortOnTimeout?: boolean; } /** * Options for request body transformation */ interface BodyOptions { /** Whether to stringify the body */ stringify?: boolean; /** Content type override */ contentType?: string; } /** * Pagination metadata for API requests */ interface PaginationMetadata { /** Type of pagination used by the API endpoint */ paginationType: PaginationType; /** Response field containing items array (defaults to 'value') */ itemsField?: string; /** Response field containing total count (defaults to '@odata.count') */ totalCountField?: string; /** Response field containing continuation token (defaults to 'continuationToken') */ continuationTokenField?: string; } /** * Base interface for all API requests */ interface RequestSpec { /** HTTP method for the request */ method?: HttpMethod; /** URL endpoint for the request */ url?: string; /** Query parameters to be appended to the URL */ params?: QueryParams; /** HTTP headers to include with the request */ headers?: Headers; /** Raw body content (takes precedence over data) */ body?: unknown; /** Expected response type */ responseType?: ResponseType; /** Request timeout options */ timeoutOptions?: TimeoutOptions; /** Retry behavior options */ retryOptions?: RetryOptions; /** Body transformation options */ bodyOptions?: BodyOptions; /** AbortSignal for cancelling the request */ signal?: AbortSignal; /** Pagination metadata for the request */ pagination?: PaginationMetadata; } interface ApiResponse { data: T; } /** * Base class for all UiPath SDK services. * * Provides common functionality for authentication, configuration, and API communication. * All service classes extend this base to inherit dependency injection and HTTP client access. * * This class implements the dependency injection pattern where services receive a configured * UiPath instance. The ApiClient is created internally and handles all HTTP operations * including authentication token management. * * @remarks * Service classes should extend this base and call `super(uiPath)` in their constructor. * Protected HTTP methods (get, post, put, patch, delete) are available to all subclasses. * */ declare class BaseService { #private; /** * SDK configuration (read-only). Available to subclasses so they can * fall back to init-time defaults like `folderKey`. */ protected readonly config: { folderKey?: string; }; /** * Creates a base service instance with dependency injection. * * Extracts configuration, execution context, and token manager from the UiPath instance * to initialize an authenticated API client. The ApiClient handles all HTTP operations * and token management internally. * * @param instance - UiPath SDK instance providing authentication and configuration. * Services receive this via dependency injection in the modular pattern. * @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for * CAS external-app auth) * * @example * ```typescript * // Services automatically call this via super() * export class EntityService extends BaseService { * constructor(instance: IUiPath) { * super(instance); // Initializes the internal ApiClient * } * } * * // Usage in modular pattern * import { UiPath } from '@uipath/uipath-typescript/core'; * import { Entities } from '@uipath/uipath-typescript/entities'; * * const sdk = new UiPath(config); * await sdk.initialize(); * const entities = new Entities(sdk); * ``` */ constructor(instance: IUiPath, headers?: Record); /** * Gets a valid authentication token, refreshing if necessary. * Use this when you need to manually add Authorization headers (e.g., direct uploads). * * @returns Promise resolving to a valid access token string * @throws AuthenticationError if no token is available or refresh fails */ protected getValidAuthToken(): Promise; /** * Creates a service accessor for pagination helpers * This allows pagination helpers to access protected methods without making them public */ protected createPaginationServiceAccess(): PaginationServiceAccess; protected request(method: string, path: string, options?: RequestSpec): Promise>; protected requestWithSpec(spec: RequestSpec): Promise>; protected get(path: string, options?: RequestSpec): Promise>; protected post(path: string, data?: unknown, options?: RequestSpec): Promise>; protected put(path: string, data?: unknown, options?: RequestSpec): Promise>; protected patch(path: string, data?: unknown, options?: RequestSpec): Promise>; protected delete(path: string, options?: RequestSpec): Promise>; /** * Execute a request with cursor-based pagination */ protected requestWithPagination(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise>; /** * Validates and prepares pagination parameters from options */ private validateAndPreparePaginationParams; /** * Prepares request parameters for pagination based on pagination type */ private preparePaginationRequestParams; /** * Creates a paginated response from API response */ private createPaginatedResponseFromResponse; /** * Determines if there are more pages based on pagination type and metadata */ private determineHasMorePages; } /** * Service for interacting with UiPath Tasks API */ declare class TaskService extends BaseService implements TaskServiceModel { create(task: TaskCreateOptions, folderId: number): Promise; getUsers(folderId: number, options?: T): Promise ? PaginatedResponse : NonPaginatedResponse>; getAll(options?: T): Promise ? PaginatedResponse : NonPaginatedResponse>; getById(id: number, options?: TaskGetByIdOptions, folderId?: number): Promise; assign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise>; reassign(taskAssignments: TaskAssignmentOptions | TaskAssignmentOptions[]): Promise>; unassign(taskIds: number | number[]): Promise>; complete(options: TaskCompletionOptions, folderId: number): Promise>; /** * Routes to the type-specific endpoint based on task type. */ private getByTaskType; /** * Fetches a task from a type-specific endpoint. * * @param id - The task ID * @param folderId - Required folder ID * @param endpoint - The type-specific endpoint to call * @param extraParams - Additional query parameters (e.g. form options) * @returns Promise resolving to the task */ private getTaskByTypeEndpoint; /** * Process parameters for task queries with folder filtering * @param options - The REST API options to process * @param folderId - Optional folder ID to filter by * @returns Processed options with folder filtering applied if needed * @private */ private processTaskParameters; /** * Adds default expand parameters to options * @param options - The options object to add default expand to * @returns Options with default expand parameters added * @private */ private addDefaultExpand; } export { TaskActivityType, TaskAssignmentCriteria, TaskPriority, TaskService, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TaskService as Tasks, createTaskWithMethods }; export type { RawTaskCreateResponse, RawTaskGetResponse, Tag, TaskActivity, TaskAssignOptions, TaskAssignment, TaskAssignmentOptions, TaskAssignmentResponse, TaskBaseResponse, TaskCompleteOptions, TaskCompletionOptions, TaskCreateOptions, TaskCreateResponse, TaskGetAllOptions, TaskGetByIdOptions, TaskGetResponse, TaskGetUsersOptions, TaskMethods, TaskServiceModel, TaskSlaDetail, TaskSource, TasksUnassignOptions, UserLoginInfo };