@uipath/uipath-typescript 1.0.0-beta.18 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +100 -40
- package/dist/assets/index.cjs +2068 -0
- package/dist/assets/index.d.ts +513 -0
- package/dist/assets/index.mjs +2065 -0
- package/dist/buckets/index.cjs +2342 -0
- package/dist/buckets/index.d.ts +819 -0
- package/dist/buckets/index.mjs +2339 -0
- package/dist/cases/index.cjs +3475 -0
- package/dist/cases/index.d.ts +1397 -0
- package/dist/cases/index.mjs +3469 -0
- package/dist/conversational-agent/index.cjs +6622 -0
- package/dist/conversational-agent/index.d.ts +6579 -0
- package/dist/conversational-agent/index.mjs +6575 -0
- package/dist/core/index.cjs +5305 -0
- package/dist/core/index.d.ts +398 -0
- package/dist/core/index.mjs +5279 -0
- package/dist/entities/index.cjs +2727 -0
- package/dist/entities/index.d.ts +1513 -0
- package/dist/entities/index.mjs +2721 -0
- package/dist/index.cjs +3651 -2935
- package/dist/index.d.ts +5341 -590
- package/dist/index.mjs +3644 -2935
- package/dist/index.umd.js +8118 -11244
- package/dist/maestro-processes/index.cjs +2587 -0
- package/dist/maestro-processes/index.d.ts +1127 -0
- package/dist/maestro-processes/index.mjs +2578 -0
- package/dist/processes/index.cjs +2247 -0
- package/dist/processes/index.d.ts +800 -0
- package/dist/processes/index.mjs +2244 -0
- package/dist/queues/index.cjs +2053 -0
- package/dist/queues/index.d.ts +504 -0
- package/dist/queues/index.mjs +2050 -0
- package/dist/tasks/index.cjs +2653 -0
- package/dist/tasks/index.d.ts +1122 -0
- package/dist/tasks/index.mjs +2649 -0
- package/package.json +118 -6
- package/dist/index.d.cts +0 -5463
- package/dist/index.d.mts +0 -5463
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
import { IUiPath } from '../core/index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Simplified universal pagination cursor
|
|
5
|
+
* Used to fetch next/previous pages
|
|
6
|
+
*/
|
|
7
|
+
interface PaginationCursor {
|
|
8
|
+
/** Opaque string containing all information needed to fetch next page */
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Discriminated union for pagination methods - ensures cursor and jumpToPage are mutually exclusive
|
|
13
|
+
*/
|
|
14
|
+
type PaginationMethodUnion = {
|
|
15
|
+
cursor?: PaginationCursor;
|
|
16
|
+
jumpToPage?: never;
|
|
17
|
+
} | {
|
|
18
|
+
cursor?: never;
|
|
19
|
+
jumpToPage?: number;
|
|
20
|
+
} | {
|
|
21
|
+
cursor?: never;
|
|
22
|
+
jumpToPage?: never;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Pagination options. Users cannot specify both cursor and jumpToPage.
|
|
26
|
+
*/
|
|
27
|
+
type PaginationOptions = {
|
|
28
|
+
/** Size of the page to fetch (items per page) */
|
|
29
|
+
pageSize?: number;
|
|
30
|
+
} & PaginationMethodUnion;
|
|
31
|
+
/**
|
|
32
|
+
* Paginated response containing items and navigation information
|
|
33
|
+
*/
|
|
34
|
+
interface PaginatedResponse<T> {
|
|
35
|
+
/** The items in the current page */
|
|
36
|
+
items: T[];
|
|
37
|
+
/** Total count of items across all pages (if available) */
|
|
38
|
+
totalCount?: number;
|
|
39
|
+
/** Whether more pages are available */
|
|
40
|
+
hasNextPage: boolean;
|
|
41
|
+
/** Cursor to fetch the next page (if available) */
|
|
42
|
+
nextCursor?: PaginationCursor;
|
|
43
|
+
/** Cursor to fetch the previous page (if available) */
|
|
44
|
+
previousCursor?: PaginationCursor;
|
|
45
|
+
/** Current page number (1-based, if available) */
|
|
46
|
+
currentPage?: number;
|
|
47
|
+
/** Total number of pages (if available) */
|
|
48
|
+
totalPages?: number;
|
|
49
|
+
/** Whether this pagination type supports jumping to arbitrary pages */
|
|
50
|
+
supportsPageJump: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Response for non-paginated calls that includes both data and total count
|
|
54
|
+
*/
|
|
55
|
+
interface NonPaginatedResponse<T> {
|
|
56
|
+
items: T[];
|
|
57
|
+
totalCount?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Helper type for defining paginated method overloads
|
|
61
|
+
* Creates a union type of all ways pagination can be triggered
|
|
62
|
+
*/
|
|
63
|
+
type HasPaginationOptions<T> = (T & {
|
|
64
|
+
pageSize: number;
|
|
65
|
+
}) | (T & {
|
|
66
|
+
cursor: PaginationCursor;
|
|
67
|
+
}) | (T & {
|
|
68
|
+
jumpToPage: number;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Pagination types supported by the SDK
|
|
73
|
+
*/
|
|
74
|
+
declare enum PaginationType {
|
|
75
|
+
OFFSET = "offset",
|
|
76
|
+
TOKEN = "token"
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Interface for service access methods needed by pagination helpers
|
|
80
|
+
*/
|
|
81
|
+
interface PaginationServiceAccess {
|
|
82
|
+
get<T>(path: string, options?: any): Promise<{
|
|
83
|
+
data: T;
|
|
84
|
+
}>;
|
|
85
|
+
post<T>(path: string, body?: any, options?: any): Promise<{
|
|
86
|
+
data: T;
|
|
87
|
+
}>;
|
|
88
|
+
requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Field names for extracting data from paginated responses.
|
|
92
|
+
*/
|
|
93
|
+
interface PaginationFieldNames {
|
|
94
|
+
itemsField?: string;
|
|
95
|
+
totalCountField?: string;
|
|
96
|
+
continuationTokenField?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Options for the requestWithPagination method in BaseService.
|
|
100
|
+
*/
|
|
101
|
+
interface RequestWithPaginationOptions extends RequestSpec {
|
|
102
|
+
pagination: PaginationFieldNames & {
|
|
103
|
+
paginationType: PaginationType;
|
|
104
|
+
paginationParams?: {
|
|
105
|
+
pageSizeParam?: string;
|
|
106
|
+
offsetParam?: string;
|
|
107
|
+
tokenParam?: string;
|
|
108
|
+
countParam?: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* HTTP methods supported by the API client
|
|
115
|
+
*/
|
|
116
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
117
|
+
/**
|
|
118
|
+
* Supported response types for API requests
|
|
119
|
+
*/
|
|
120
|
+
type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream';
|
|
121
|
+
/**
|
|
122
|
+
* Query parameters type with support for arrays and nested objects
|
|
123
|
+
*/
|
|
124
|
+
type QueryParams = Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
|
|
125
|
+
/**
|
|
126
|
+
* Standard HTTP headers type
|
|
127
|
+
*/
|
|
128
|
+
type Headers = Record<string, string>;
|
|
129
|
+
/**
|
|
130
|
+
* Options for request retries
|
|
131
|
+
*/
|
|
132
|
+
interface RetryOptions {
|
|
133
|
+
/** Maximum number of retry attempts */
|
|
134
|
+
maxRetries?: number;
|
|
135
|
+
/** Base delay between retries in milliseconds */
|
|
136
|
+
retryDelay?: number;
|
|
137
|
+
/** Whether to use exponential backoff */
|
|
138
|
+
useExponentialBackoff?: boolean;
|
|
139
|
+
/** Status codes that should trigger a retry */
|
|
140
|
+
retryableStatusCodes?: number[];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Options for request timeouts
|
|
144
|
+
*/
|
|
145
|
+
interface TimeoutOptions {
|
|
146
|
+
/** Request timeout in milliseconds */
|
|
147
|
+
timeout?: number;
|
|
148
|
+
/** Whether to abort the request on timeout */
|
|
149
|
+
abortOnTimeout?: boolean;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Options for request body transformation
|
|
153
|
+
*/
|
|
154
|
+
interface BodyOptions {
|
|
155
|
+
/** Whether to stringify the body */
|
|
156
|
+
stringify?: boolean;
|
|
157
|
+
/** Content type override */
|
|
158
|
+
contentType?: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Pagination metadata for API requests
|
|
162
|
+
*/
|
|
163
|
+
interface PaginationMetadata {
|
|
164
|
+
/** Type of pagination used by the API endpoint */
|
|
165
|
+
paginationType: PaginationType;
|
|
166
|
+
/** Response field containing items array (defaults to 'value') */
|
|
167
|
+
itemsField?: string;
|
|
168
|
+
/** Response field containing total count (defaults to '@odata.count') */
|
|
169
|
+
totalCountField?: string;
|
|
170
|
+
/** Response field containing continuation token (defaults to 'continuationToken') */
|
|
171
|
+
continuationTokenField?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Base interface for all API requests
|
|
175
|
+
*/
|
|
176
|
+
interface RequestSpec {
|
|
177
|
+
/** HTTP method for the request */
|
|
178
|
+
method?: HttpMethod;
|
|
179
|
+
/** URL endpoint for the request */
|
|
180
|
+
url?: string;
|
|
181
|
+
/** Query parameters to be appended to the URL */
|
|
182
|
+
params?: QueryParams;
|
|
183
|
+
/** HTTP headers to include with the request */
|
|
184
|
+
headers?: Headers;
|
|
185
|
+
/** Raw body content (takes precedence over data) */
|
|
186
|
+
body?: unknown;
|
|
187
|
+
/** Expected response type */
|
|
188
|
+
responseType?: ResponseType;
|
|
189
|
+
/** Request timeout options */
|
|
190
|
+
timeoutOptions?: TimeoutOptions;
|
|
191
|
+
/** Retry behavior options */
|
|
192
|
+
retryOptions?: RetryOptions;
|
|
193
|
+
/** Body transformation options */
|
|
194
|
+
bodyOptions?: BodyOptions;
|
|
195
|
+
/** AbortSignal for cancelling the request */
|
|
196
|
+
signal?: AbortSignal;
|
|
197
|
+
/** Pagination metadata for the request */
|
|
198
|
+
pagination?: PaginationMetadata;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
interface ApiResponse<T> {
|
|
202
|
+
data: T;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Base class for all UiPath SDK services.
|
|
206
|
+
*
|
|
207
|
+
* Provides common functionality for authentication, configuration, and API communication.
|
|
208
|
+
* All service classes extend this base to inherit dependency injection and HTTP client access.
|
|
209
|
+
*
|
|
210
|
+
* This class implements the dependency injection pattern where services receive a configured
|
|
211
|
+
* UiPath instance. The ApiClient is created internally and handles all HTTP operations
|
|
212
|
+
* including authentication token management.
|
|
213
|
+
*
|
|
214
|
+
* @remarks
|
|
215
|
+
* Service classes should extend this base and call `super(uiPath)` in their constructor.
|
|
216
|
+
* Protected HTTP methods (get, post, put, patch, delete) are available to all subclasses.
|
|
217
|
+
*
|
|
218
|
+
*/
|
|
219
|
+
declare class BaseService {
|
|
220
|
+
#private;
|
|
221
|
+
/**
|
|
222
|
+
* Creates a base service instance with dependency injection.
|
|
223
|
+
*
|
|
224
|
+
* Extracts configuration, execution context, and token manager from the UiPath instance
|
|
225
|
+
* to initialize an authenticated API client. The ApiClient handles all HTTP operations
|
|
226
|
+
* and token management internally.
|
|
227
|
+
*
|
|
228
|
+
* @param instance - UiPath SDK instance providing authentication and configuration.
|
|
229
|
+
* Services receive this via dependency injection in the modular pattern.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```typescript
|
|
233
|
+
* // Services automatically call this via super()
|
|
234
|
+
* export class EntityService extends BaseService {
|
|
235
|
+
* constructor(instance: IUiPath) {
|
|
236
|
+
* super(instance); // Initializes the internal ApiClient
|
|
237
|
+
* }
|
|
238
|
+
* }
|
|
239
|
+
*
|
|
240
|
+
* // Usage in modular pattern
|
|
241
|
+
* import { UiPath } from '@uipath/uipath-typescript/core';
|
|
242
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
243
|
+
*
|
|
244
|
+
* const sdk = new UiPath(config);
|
|
245
|
+
* await sdk.initialize();
|
|
246
|
+
* const entities = new Entities(sdk);
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
constructor(instance: IUiPath);
|
|
250
|
+
/**
|
|
251
|
+
* Gets a valid authentication token, refreshing if necessary.
|
|
252
|
+
* Use this when you need to manually add Authorization headers (e.g., direct uploads).
|
|
253
|
+
*
|
|
254
|
+
* @returns Promise resolving to a valid access token string
|
|
255
|
+
* @throws AuthenticationError if no token is available or refresh fails
|
|
256
|
+
*/
|
|
257
|
+
protected getValidAuthToken(): Promise<string>;
|
|
258
|
+
/**
|
|
259
|
+
* Creates a service accessor for pagination helpers
|
|
260
|
+
* This allows pagination helpers to access protected methods without making them public
|
|
261
|
+
*/
|
|
262
|
+
protected createPaginationServiceAccess(): PaginationServiceAccess;
|
|
263
|
+
protected request<T>(method: string, path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
264
|
+
protected requestWithSpec<T>(spec: RequestSpec): Promise<ApiResponse<T>>;
|
|
265
|
+
protected get<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
266
|
+
protected post<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
267
|
+
protected put<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
268
|
+
protected patch<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
269
|
+
protected delete<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
270
|
+
/**
|
|
271
|
+
* Execute a request with cursor-based pagination
|
|
272
|
+
*/
|
|
273
|
+
protected requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
274
|
+
/**
|
|
275
|
+
* Validates and prepares pagination parameters from options
|
|
276
|
+
*/
|
|
277
|
+
private validateAndPreparePaginationParams;
|
|
278
|
+
/**
|
|
279
|
+
* Prepares request parameters for pagination based on pagination type
|
|
280
|
+
*/
|
|
281
|
+
private preparePaginationRequestParams;
|
|
282
|
+
/**
|
|
283
|
+
* Creates a paginated response from API response
|
|
284
|
+
*/
|
|
285
|
+
private createPaginatedResponseFromResponse;
|
|
286
|
+
/**
|
|
287
|
+
* Determines if there are more pages based on pagination type and metadata
|
|
288
|
+
*/
|
|
289
|
+
private determineHasMorePages;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Common enum for job state used across services
|
|
294
|
+
*/
|
|
295
|
+
declare enum JobState {
|
|
296
|
+
Pending = "Pending",
|
|
297
|
+
Running = "Running",
|
|
298
|
+
Stopping = "Stopping",
|
|
299
|
+
Terminating = "Terminating",
|
|
300
|
+
Faulted = "Faulted",
|
|
301
|
+
Successful = "Successful",
|
|
302
|
+
Stopped = "Stopped",
|
|
303
|
+
Suspended = "Suspended",
|
|
304
|
+
Resumed = "Resumed"
|
|
305
|
+
}
|
|
306
|
+
interface BaseOptions {
|
|
307
|
+
expand?: string;
|
|
308
|
+
select?: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Common request options interface used across services for querying data
|
|
312
|
+
*/
|
|
313
|
+
interface RequestOptions extends BaseOptions {
|
|
314
|
+
filter?: string;
|
|
315
|
+
orderby?: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Enum for package types
|
|
320
|
+
*/
|
|
321
|
+
declare enum PackageType {
|
|
322
|
+
Undefined = "Undefined",
|
|
323
|
+
Process = "Process",
|
|
324
|
+
ProcessOrchestration = "ProcessOrchestration",
|
|
325
|
+
WebApp = "WebApp",
|
|
326
|
+
Agent = "Agent",
|
|
327
|
+
TestAutomationProcess = "TestAutomationProcess",
|
|
328
|
+
Api = "Api",
|
|
329
|
+
MCPServer = "MCPServer",
|
|
330
|
+
BusinessRules = "BusinessRules"
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Enum for job priority
|
|
334
|
+
*/
|
|
335
|
+
declare enum JobPriority {
|
|
336
|
+
Low = "Low",
|
|
337
|
+
Normal = "Normal",
|
|
338
|
+
High = "High"
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Enum for target framework
|
|
342
|
+
*/
|
|
343
|
+
declare enum TargetFramework {
|
|
344
|
+
Legacy = "Legacy",
|
|
345
|
+
Windows = "Windows",
|
|
346
|
+
Portable = "Portable"
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Enum for robot size
|
|
350
|
+
*/
|
|
351
|
+
declare enum RobotSize {
|
|
352
|
+
Small = "Small",
|
|
353
|
+
Standard = "Standard",
|
|
354
|
+
Medium = "Medium",
|
|
355
|
+
Large = "Large"
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Enum for remote control access
|
|
359
|
+
*/
|
|
360
|
+
declare enum RemoteControlAccess {
|
|
361
|
+
None = "None",
|
|
362
|
+
ReadOnly = "ReadOnly",
|
|
363
|
+
Full = "Full"
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Enum for process start strategy
|
|
367
|
+
*/
|
|
368
|
+
declare enum StartStrategy {
|
|
369
|
+
All = "All",
|
|
370
|
+
Specific = "Specific",
|
|
371
|
+
RobotCount = "RobotCount",
|
|
372
|
+
JobsCount = "JobsCount",
|
|
373
|
+
ModernJobsCount = "ModernJobsCount"
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Enum for package source type
|
|
377
|
+
*/
|
|
378
|
+
declare enum PackageSourceType {
|
|
379
|
+
Manual = "Manual",
|
|
380
|
+
Schedule = "Schedule",
|
|
381
|
+
Queue = "Queue",
|
|
382
|
+
StudioWeb = "StudioWeb",
|
|
383
|
+
IntegrationTrigger = "IntegrationTrigger",
|
|
384
|
+
StudioDesktop = "StudioDesktop",
|
|
385
|
+
AutomationOpsPipelines = "AutomationOpsPipelines",
|
|
386
|
+
Apps = "Apps",
|
|
387
|
+
SAP = "SAP",
|
|
388
|
+
HttpTrigger = "HttpTrigger",
|
|
389
|
+
HttpTriggerWithCallback = "HttpTriggerWithCallback",
|
|
390
|
+
RobotAPI = "RobotAPI",
|
|
391
|
+
Assistant = "Assistant",
|
|
392
|
+
CommandLine = "CommandLine",
|
|
393
|
+
RobotNetAPI = "RobotNetAPI",
|
|
394
|
+
Autopilot = "Autopilot",
|
|
395
|
+
TestManager = "TestManager",
|
|
396
|
+
AgentService = "AgentService",
|
|
397
|
+
ProcessOrchestration = "ProcessOrchestration",
|
|
398
|
+
PluginEcosystem = "PluginEcosystem",
|
|
399
|
+
PerformanceTesting = "PerformanceTesting",
|
|
400
|
+
AgentHub = "AgentHub",
|
|
401
|
+
ApiWorkflow = "ApiWorkflow"
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Enum for stop strategy
|
|
405
|
+
*/
|
|
406
|
+
declare enum StopStrategy {
|
|
407
|
+
SoftStop = "SoftStop",
|
|
408
|
+
Kill = "Kill"
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Interface for Job Attachment
|
|
412
|
+
*/
|
|
413
|
+
interface JobAttachment {
|
|
414
|
+
attachmentId: string;
|
|
415
|
+
jobKey?: string;
|
|
416
|
+
category?: string;
|
|
417
|
+
attachmentName?: string;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Interface for common process properties shared across multiple interfaces
|
|
421
|
+
*/
|
|
422
|
+
interface ProcessProperties {
|
|
423
|
+
jobPriority?: JobPriority;
|
|
424
|
+
specificPriorityValue?: number;
|
|
425
|
+
inputArguments?: string;
|
|
426
|
+
environmentVariables?: string;
|
|
427
|
+
entryPointPath?: string;
|
|
428
|
+
remoteControlAccess?: RemoteControlAccess;
|
|
429
|
+
requiresUserInteraction?: boolean;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Interface for common folder properties
|
|
433
|
+
*/
|
|
434
|
+
interface FolderProperties {
|
|
435
|
+
folderId?: number;
|
|
436
|
+
folderName?: string;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Base interface for process start request
|
|
440
|
+
*/
|
|
441
|
+
interface BaseProcessStartRequest extends ProcessProperties {
|
|
442
|
+
strategy?: StartStrategy;
|
|
443
|
+
robotIds?: number[];
|
|
444
|
+
machineSessionIds?: number[];
|
|
445
|
+
noOfRobots?: number;
|
|
446
|
+
jobsCount?: number;
|
|
447
|
+
source?: PackageSourceType;
|
|
448
|
+
runtimeType?: string;
|
|
449
|
+
inputFile?: string;
|
|
450
|
+
reference?: string;
|
|
451
|
+
attachments?: JobAttachment[];
|
|
452
|
+
targetFramework?: TargetFramework;
|
|
453
|
+
resumeOnSameContext?: boolean;
|
|
454
|
+
batchExecutionKey?: string;
|
|
455
|
+
stopProcessExpression?: string;
|
|
456
|
+
stopStrategy?: StopStrategy;
|
|
457
|
+
killProcessExpression?: string;
|
|
458
|
+
alertPendingExpression?: string;
|
|
459
|
+
alertRunningExpression?: string;
|
|
460
|
+
runAsMe?: boolean;
|
|
461
|
+
parentOperationId?: string;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Interface for start process request with processKey
|
|
465
|
+
*/
|
|
466
|
+
interface ProcessStartRequestWithKey extends BaseProcessStartRequest {
|
|
467
|
+
processKey: string;
|
|
468
|
+
processName?: string;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Interface for start process request with processName
|
|
472
|
+
*/
|
|
473
|
+
interface ProcessStartRequestWithName extends BaseProcessStartRequest {
|
|
474
|
+
processKey?: string;
|
|
475
|
+
processName: string;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Interface for start process request
|
|
479
|
+
* Either processKey or processName must be provided
|
|
480
|
+
*/
|
|
481
|
+
type ProcessStartRequest = ProcessStartRequestWithKey | ProcessStartRequestWithName;
|
|
482
|
+
/**
|
|
483
|
+
* Interface for robot metadata
|
|
484
|
+
*/
|
|
485
|
+
interface RobotMetadata {
|
|
486
|
+
id: number;
|
|
487
|
+
name?: string;
|
|
488
|
+
username?: string;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Interface for machine
|
|
492
|
+
*/
|
|
493
|
+
interface Machine {
|
|
494
|
+
id: number;
|
|
495
|
+
name?: string;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Interface for job error
|
|
499
|
+
*/
|
|
500
|
+
interface JobError {
|
|
501
|
+
code?: string;
|
|
502
|
+
title?: string;
|
|
503
|
+
detail?: string;
|
|
504
|
+
category?: string;
|
|
505
|
+
status?: number;
|
|
506
|
+
timestamp?: string;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Enum for job type
|
|
510
|
+
*/
|
|
511
|
+
declare enum JobType {
|
|
512
|
+
Unattended = "Unattended",
|
|
513
|
+
Attended = "Attended",
|
|
514
|
+
ServerlessGeneric = "ServerlessGeneric"
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Interface for argument metadata
|
|
518
|
+
*/
|
|
519
|
+
interface ArgumentMetadata {
|
|
520
|
+
input?: string;
|
|
521
|
+
output?: string;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Interface for job response
|
|
525
|
+
*/
|
|
526
|
+
interface ProcessStartResponse extends ProcessProperties, FolderProperties {
|
|
527
|
+
key: string;
|
|
528
|
+
startTime: string | null;
|
|
529
|
+
endTime: string | null;
|
|
530
|
+
state: JobState;
|
|
531
|
+
source: string;
|
|
532
|
+
sourceType: string;
|
|
533
|
+
batchExecutionKey: string;
|
|
534
|
+
info: string | null;
|
|
535
|
+
createdTime: string;
|
|
536
|
+
startingScheduleId: number | null;
|
|
537
|
+
processName: string;
|
|
538
|
+
type: JobType;
|
|
539
|
+
inputFile: string | null;
|
|
540
|
+
outputArguments: string | null;
|
|
541
|
+
outputFile: string | null;
|
|
542
|
+
hostMachineName: string | null;
|
|
543
|
+
persistenceId: string | null;
|
|
544
|
+
resumeVersion: number | null;
|
|
545
|
+
stopStrategy: StopStrategy | null;
|
|
546
|
+
runtimeType: string;
|
|
547
|
+
processVersionId: number | null;
|
|
548
|
+
reference: string;
|
|
549
|
+
packageType: PackageType;
|
|
550
|
+
machine?: Machine;
|
|
551
|
+
resumeOnSameContext: boolean;
|
|
552
|
+
localSystemAccount: string;
|
|
553
|
+
orchestratorUserIdentity: string | null;
|
|
554
|
+
startingTriggerId: string | null;
|
|
555
|
+
maxExpectedRunningTimeSeconds: number | null;
|
|
556
|
+
parentJobKey: string | null;
|
|
557
|
+
resumeTime: string | null;
|
|
558
|
+
lastModifiedTime: string | null;
|
|
559
|
+
jobError: JobError | null;
|
|
560
|
+
errorCode: string | null;
|
|
561
|
+
robot?: RobotMetadata;
|
|
562
|
+
id: number;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Interface for process response
|
|
566
|
+
*/
|
|
567
|
+
interface ProcessGetResponse extends ProcessProperties, FolderProperties {
|
|
568
|
+
key: string;
|
|
569
|
+
packageKey: string;
|
|
570
|
+
packageVersion: string;
|
|
571
|
+
isLatestVersion: boolean;
|
|
572
|
+
isPackageDeleted: boolean;
|
|
573
|
+
description: string;
|
|
574
|
+
name: string;
|
|
575
|
+
entryPointId: number;
|
|
576
|
+
packageType: PackageType;
|
|
577
|
+
supportsMultipleEntryPoints: boolean;
|
|
578
|
+
isConversational: boolean | null;
|
|
579
|
+
minRequiredRobotVersion: string | null;
|
|
580
|
+
isCompiled: boolean;
|
|
581
|
+
arguments: ArgumentMetadata;
|
|
582
|
+
autoUpdate: boolean;
|
|
583
|
+
hiddenForAttendedUser: boolean;
|
|
584
|
+
feedId: string;
|
|
585
|
+
folderKey: string;
|
|
586
|
+
targetFramework: TargetFramework;
|
|
587
|
+
robotSize: RobotSize | null;
|
|
588
|
+
lastModifiedTime: string | null;
|
|
589
|
+
lastModifierUserId: number | null;
|
|
590
|
+
createdTime: string;
|
|
591
|
+
creatorUserId: number;
|
|
592
|
+
id: number;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Options for getting processes across folders
|
|
596
|
+
*/
|
|
597
|
+
type ProcessGetAllOptions = RequestOptions & PaginationOptions & {
|
|
598
|
+
/**
|
|
599
|
+
* Optional folder ID to filter processes by folder
|
|
600
|
+
*/
|
|
601
|
+
folderId?: number;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Options for getting a single process by ID
|
|
605
|
+
*/
|
|
606
|
+
type ProcessGetByIdOptions = BaseOptions;
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Service for managing and executing UiPath Automation Processes.
|
|
610
|
+
*
|
|
611
|
+
* Processes (also known as automations or workflows) are the core units of automation in UiPath, representing sequences of activities that perform specific business tasks. [UiPath Processes Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-processes)
|
|
612
|
+
*
|
|
613
|
+
* ### Usage
|
|
614
|
+
*
|
|
615
|
+
* Prerequisites: Initialize the SDK first - see [Getting Started](/uipath-typescript/getting-started/#import-initialize)
|
|
616
|
+
*
|
|
617
|
+
* ```typescript
|
|
618
|
+
* import { Processes } from '@uipath/uipath-typescript/processes';
|
|
619
|
+
*
|
|
620
|
+
* const processes = new Processes(sdk);
|
|
621
|
+
* const allProcesses = await processes.getAll();
|
|
622
|
+
* ```
|
|
623
|
+
*/
|
|
624
|
+
interface ProcessServiceModel {
|
|
625
|
+
/**
|
|
626
|
+
* Gets all processes across folders with optional filtering
|
|
627
|
+
* Returns a NonPaginatedResponse with data and totalCount when no pagination parameters are provided,
|
|
628
|
+
* or a PaginatedResponse when any pagination parameter is provided
|
|
629
|
+
*
|
|
630
|
+
* @param options - Query options including optional folderId and pagination options
|
|
631
|
+
* @returns Promise resolving to either an array of processes NonPaginatedResponse<ProcessGetResponse> or a PaginatedResponse<ProcessGetResponse> when pagination options are used.
|
|
632
|
+
* {@link ProcessGetResponse}
|
|
633
|
+
* @example
|
|
634
|
+
* ```typescript
|
|
635
|
+
* // Standard array return
|
|
636
|
+
* const allProcesses = await processes.getAll();
|
|
637
|
+
*
|
|
638
|
+
* // Get processes within a specific folder
|
|
639
|
+
* const folderProcesses = await processes.getAll({
|
|
640
|
+
* folderId: <folderId>
|
|
641
|
+
* });
|
|
642
|
+
*
|
|
643
|
+
* // Get processes with filtering
|
|
644
|
+
* const filteredProcesses = await processes.getAll({
|
|
645
|
+
* filter: "name eq 'MyProcess'"
|
|
646
|
+
* });
|
|
647
|
+
*
|
|
648
|
+
* // First page with pagination
|
|
649
|
+
* const page1 = await processes.getAll({ pageSize: 10 });
|
|
650
|
+
*
|
|
651
|
+
* // Navigate using cursor
|
|
652
|
+
* if (page1.hasNextPage) {
|
|
653
|
+
* const page2 = await processes.getAll({ cursor: page1.nextCursor });
|
|
654
|
+
* }
|
|
655
|
+
*
|
|
656
|
+
* // Jump to specific page
|
|
657
|
+
* const page5 = await processes.getAll({
|
|
658
|
+
* jumpToPage: 5,
|
|
659
|
+
* pageSize: 10
|
|
660
|
+
* });
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
663
|
+
getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
|
|
664
|
+
/**
|
|
665
|
+
* Gets a single process by ID
|
|
666
|
+
*
|
|
667
|
+
* @param id - Process ID
|
|
668
|
+
* @param folderId - Required folder ID
|
|
669
|
+
* @param options - Optional query parameters
|
|
670
|
+
* @returns Promise resolving to a single process
|
|
671
|
+
* {@link ProcessGetResponse}
|
|
672
|
+
* @example
|
|
673
|
+
* ```typescript
|
|
674
|
+
* // Get process by ID
|
|
675
|
+
* const process = await processes.getById(<processId>, <folderId>);
|
|
676
|
+
* ```
|
|
677
|
+
*/
|
|
678
|
+
getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
|
|
679
|
+
/**
|
|
680
|
+
* Starts a process with the specified configuration
|
|
681
|
+
*
|
|
682
|
+
* @param request - Process start configuration
|
|
683
|
+
* @param folderId - Required folder ID
|
|
684
|
+
* @param options - Optional request options
|
|
685
|
+
* @returns Promise resolving to array of started process instances
|
|
686
|
+
* {@link ProcessStartResponse}
|
|
687
|
+
* @example
|
|
688
|
+
* ```typescript
|
|
689
|
+
* // Start a process by process key
|
|
690
|
+
* const result = await processes.start({
|
|
691
|
+
* processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
692
|
+
* }, <folderId>); // folderId is required
|
|
693
|
+
*
|
|
694
|
+
* // Start a process by name with specific robots
|
|
695
|
+
* const result = await processes.start({
|
|
696
|
+
* processName: "MyProcess"
|
|
697
|
+
* }, <folderId>); // folderId is required
|
|
698
|
+
* ```
|
|
699
|
+
*/
|
|
700
|
+
start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Service for interacting with UiPath Orchestrator Processes API
|
|
705
|
+
*/
|
|
706
|
+
declare class ProcessService extends BaseService implements ProcessServiceModel {
|
|
707
|
+
/**
|
|
708
|
+
* Gets all processes across folders with optional filtering and folder scoping
|
|
709
|
+
*
|
|
710
|
+
* The method returns either:
|
|
711
|
+
* - An array of processes (when no pagination parameters are provided)
|
|
712
|
+
* - A paginated result with navigation cursors (when any pagination parameter is provided)
|
|
713
|
+
*
|
|
714
|
+
* @param options - Query options including optional folderId
|
|
715
|
+
* @returns Promise resolving to an array of processes or paginated result
|
|
716
|
+
*
|
|
717
|
+
* @example
|
|
718
|
+
* ```typescript
|
|
719
|
+
* import { Processes } from '@uipath/uipath-typescript/processes';
|
|
720
|
+
*
|
|
721
|
+
* const processes = new Processes(sdk);
|
|
722
|
+
*
|
|
723
|
+
* // Standard array return
|
|
724
|
+
* const allProcesses = await processes.getAll();
|
|
725
|
+
*
|
|
726
|
+
* // Get processes within a specific folder
|
|
727
|
+
* const folderProcesses = await processes.getAll({
|
|
728
|
+
* folderId: 123
|
|
729
|
+
* });
|
|
730
|
+
*
|
|
731
|
+
* // Get processes with filtering
|
|
732
|
+
* const filteredProcesses = await processes.getAll({
|
|
733
|
+
* filter: "name eq 'MyProcess'"
|
|
734
|
+
* });
|
|
735
|
+
*
|
|
736
|
+
* // First page with pagination
|
|
737
|
+
* const page1 = await processes.getAll({ pageSize: 10 });
|
|
738
|
+
*
|
|
739
|
+
* // Navigate using cursor
|
|
740
|
+
* if (page1.hasNextPage) {
|
|
741
|
+
* const page2 = await processes.getAll({ cursor: page1.nextCursor });
|
|
742
|
+
* }
|
|
743
|
+
*
|
|
744
|
+
* // Jump to specific page
|
|
745
|
+
* const page5 = await processes.getAll({
|
|
746
|
+
* jumpToPage: 5,
|
|
747
|
+
* pageSize: 10
|
|
748
|
+
* });
|
|
749
|
+
* ```
|
|
750
|
+
*/
|
|
751
|
+
getAll<T extends ProcessGetAllOptions = ProcessGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessGetResponse> : NonPaginatedResponse<ProcessGetResponse>>;
|
|
752
|
+
/**
|
|
753
|
+
* Starts a process execution (job)
|
|
754
|
+
*
|
|
755
|
+
* @param request - Process start request body
|
|
756
|
+
* @param folderId - Required folder ID
|
|
757
|
+
* @param options - Optional query parameters
|
|
758
|
+
* @returns Promise resolving to the created jobs
|
|
759
|
+
*
|
|
760
|
+
* @example
|
|
761
|
+
* ```typescript
|
|
762
|
+
* import { Processes } from '@uipath/uipath-typescript/processes';
|
|
763
|
+
*
|
|
764
|
+
* const processes = new Processes(sdk);
|
|
765
|
+
*
|
|
766
|
+
* // Start a process by process key
|
|
767
|
+
* const jobs = await processes.start({
|
|
768
|
+
* processKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
769
|
+
* }, 123); // folderId is required
|
|
770
|
+
*
|
|
771
|
+
* // Start a process by name with specific robots
|
|
772
|
+
* const jobs = await processes.start({
|
|
773
|
+
* processName: "MyProcess"
|
|
774
|
+
* }, 123); // folderId is required
|
|
775
|
+
* ```
|
|
776
|
+
*/
|
|
777
|
+
start(request: ProcessStartRequest, folderId: number, options?: RequestOptions): Promise<ProcessStartResponse[]>;
|
|
778
|
+
/**
|
|
779
|
+
* Gets a single process by ID
|
|
780
|
+
*
|
|
781
|
+
* @param id - Process ID
|
|
782
|
+
* @param folderId - Required folder ID
|
|
783
|
+
* @param options - Optional query parameters
|
|
784
|
+
* @returns Promise resolving to a single process
|
|
785
|
+
*
|
|
786
|
+
* @example
|
|
787
|
+
* ```typescript
|
|
788
|
+
* import { Processes } from '@uipath/uipath-typescript/processes';
|
|
789
|
+
*
|
|
790
|
+
* const processes = new Processes(sdk);
|
|
791
|
+
*
|
|
792
|
+
* // Get process by ID
|
|
793
|
+
* const process = await processes.getById(123, 456);
|
|
794
|
+
* ```
|
|
795
|
+
*/
|
|
796
|
+
getById(id: number, folderId: number, options?: ProcessGetByIdOptions): Promise<ProcessGetResponse>;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export { JobPriority, JobType, PackageSourceType, PackageType, ProcessService, ProcessService as Processes, RemoteControlAccess, RobotSize, StartStrategy, StopStrategy, TargetFramework };
|
|
800
|
+
export type { ArgumentMetadata, BaseProcessStartRequest, FolderProperties, JobAttachment, JobError, Machine, ProcessGetAllOptions, ProcessGetByIdOptions, ProcessGetResponse, ProcessProperties, ProcessServiceModel, ProcessStartRequest, ProcessStartRequestWithKey, ProcessStartRequestWithName, ProcessStartResponse, RobotMetadata };
|