@uipath/uipath-typescript 1.2.0 → 1.2.2
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/dist/assets/index.cjs +1 -1
- package/dist/assets/index.d.ts +2 -1
- package/dist/assets/index.mjs +1 -1
- package/dist/attachments/index.cjs +1944 -0
- package/dist/attachments/index.d.ts +399 -0
- package/dist/attachments/index.mjs +1941 -0
- package/dist/buckets/index.cjs +1 -1
- package/dist/buckets/index.d.ts +4 -2
- package/dist/buckets/index.mjs +1 -1
- package/dist/cases/index.cjs +95 -48
- package/dist/cases/index.d.ts +31 -2
- package/dist/cases/index.mjs +95 -48
- package/dist/conversational-agent/index.cjs +38 -7
- package/dist/conversational-agent/index.d.ts +72 -6
- package/dist/conversational-agent/index.mjs +38 -7
- package/dist/core/index.cjs +118 -17
- package/dist/core/index.d.ts +26 -2
- package/dist/core/index.mjs +118 -17
- package/dist/entities/index.cjs +48 -1
- package/dist/entities/index.d.ts +106 -19
- package/dist/entities/index.mjs +48 -1
- package/dist/index.cjs +585 -267
- package/dist/index.d.ts +595 -67
- package/dist/index.mjs +586 -268
- package/dist/index.umd.js +582 -264
- package/dist/jobs/index.cjs +2036 -0
- package/dist/jobs/index.d.ts +724 -0
- package/dist/jobs/index.mjs +2033 -0
- package/dist/maestro-processes/index.cjs +1 -1
- package/dist/maestro-processes/index.mjs +1 -1
- package/dist/processes/index.cjs +67 -1
- package/dist/processes/index.d.ts +80 -15
- package/dist/processes/index.mjs +68 -2
- package/dist/queues/index.cjs +1 -1
- package/dist/queues/index.d.ts +2 -1
- package/dist/queues/index.mjs +1 -1
- package/dist/tasks/index.cjs +1319 -1272
- package/dist/tasks/index.d.ts +331 -287
- package/dist/tasks/index.mjs +1319 -1272
- package/package.json +25 -3
|
@@ -0,0 +1,724 @@
|
|
|
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
|
+
* Base service for services that need folder-specific functionality.
|
|
294
|
+
*
|
|
295
|
+
* Extends BaseService with additional methods for working with folder-scoped resources
|
|
296
|
+
* in UiPath Orchestrator. Services that work with folders (Assets, Queues) extend this class.
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* This class provides helper methods for making folder-scoped API calls, handling folder IDs
|
|
300
|
+
* in request headers, and managing cross-folder queries.
|
|
301
|
+
*/
|
|
302
|
+
declare class FolderScopedService extends BaseService {
|
|
303
|
+
/**
|
|
304
|
+
* Gets resources in a folder with optional query parameters
|
|
305
|
+
*
|
|
306
|
+
* @param endpoint - API endpoint to call
|
|
307
|
+
* @param folderId - required folder ID
|
|
308
|
+
* @param options - Query options
|
|
309
|
+
* @param transformFn - Optional function to transform the response data
|
|
310
|
+
* @returns Promise resolving to an array of resources
|
|
311
|
+
*/
|
|
312
|
+
protected _getByFolder<T, R = T>(endpoint: string, folderId: number, options?: Record<string, any>, transformFn?: (item: T) => R): Promise<R[]>;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Common enum for job state used across services
|
|
317
|
+
*/
|
|
318
|
+
declare enum JobState {
|
|
319
|
+
Pending = "Pending",
|
|
320
|
+
Running = "Running",
|
|
321
|
+
Stopping = "Stopping",
|
|
322
|
+
Terminating = "Terminating",
|
|
323
|
+
Faulted = "Faulted",
|
|
324
|
+
Successful = "Successful",
|
|
325
|
+
Stopped = "Stopped",
|
|
326
|
+
Suspended = "Suspended",
|
|
327
|
+
Resumed = "Resumed"
|
|
328
|
+
}
|
|
329
|
+
interface BaseOptions {
|
|
330
|
+
expand?: string;
|
|
331
|
+
select?: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Common request options interface used across services for querying data
|
|
335
|
+
*/
|
|
336
|
+
interface RequestOptions extends BaseOptions {
|
|
337
|
+
filter?: string;
|
|
338
|
+
orderby?: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Enum for package types
|
|
343
|
+
*/
|
|
344
|
+
declare enum PackageType {
|
|
345
|
+
Undefined = "Undefined",
|
|
346
|
+
Process = "Process",
|
|
347
|
+
ProcessOrchestration = "ProcessOrchestration",
|
|
348
|
+
WebApp = "WebApp",
|
|
349
|
+
Agent = "Agent",
|
|
350
|
+
TestAutomationProcess = "TestAutomationProcess",
|
|
351
|
+
Api = "Api",
|
|
352
|
+
MCPServer = "MCPServer",
|
|
353
|
+
BusinessRules = "BusinessRules",
|
|
354
|
+
CaseManagement = "CaseManagement",
|
|
355
|
+
Flow = "Flow",
|
|
356
|
+
Function = "Function"
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Enum for job priority
|
|
360
|
+
*/
|
|
361
|
+
declare enum JobPriority {
|
|
362
|
+
Low = "Low",
|
|
363
|
+
Normal = "Normal",
|
|
364
|
+
High = "High"
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Enum for remote control access
|
|
368
|
+
*/
|
|
369
|
+
declare enum RemoteControlAccess {
|
|
370
|
+
None = "None",
|
|
371
|
+
ReadOnly = "ReadOnly",
|
|
372
|
+
Full = "Full"
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Enum for job source type
|
|
376
|
+
*/
|
|
377
|
+
declare enum JobSourceType {
|
|
378
|
+
Manual = "Manual",
|
|
379
|
+
Schedule = "Schedule",
|
|
380
|
+
Agent = "Agent",
|
|
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
|
+
HttpTriggerCallback = "HttpTriggerCallback",
|
|
390
|
+
RobotAPI = "RobotAPI",
|
|
391
|
+
CommandLine = "CommandLine",
|
|
392
|
+
RobotNetAPI = "RobotNetAPI",
|
|
393
|
+
Autopilot = "Autopilot",
|
|
394
|
+
TestManager = "TestManager",
|
|
395
|
+
AgentService = "AgentService",
|
|
396
|
+
ProcessOrchestration = "ProcessOrchestration",
|
|
397
|
+
PluginEcosystem = "PluginEcosystem",
|
|
398
|
+
PerformanceTesting = "PerformanceTesting",
|
|
399
|
+
AgentHub = "AgentHub",
|
|
400
|
+
ApiWorkflow = "ApiWorkflow",
|
|
401
|
+
CaseManagement = "CaseManagement"
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Enum for stop strategy
|
|
405
|
+
*/
|
|
406
|
+
declare enum StopStrategy {
|
|
407
|
+
SoftStop = "SoftStop",
|
|
408
|
+
Kill = "Kill"
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Enum for runtime type
|
|
412
|
+
*/
|
|
413
|
+
declare enum RuntimeType {
|
|
414
|
+
NonProduction = "NonProduction",
|
|
415
|
+
Attended = "Attended",
|
|
416
|
+
Unattended = "Unattended",
|
|
417
|
+
Development = "Development",
|
|
418
|
+
Studio = "Studio",
|
|
419
|
+
RpaDeveloper = "RpaDeveloper",
|
|
420
|
+
StudioX = "StudioX",
|
|
421
|
+
CitizenDeveloper = "CitizenDeveloper",
|
|
422
|
+
Headless = "Headless",
|
|
423
|
+
StudioPro = "StudioPro",
|
|
424
|
+
RpaDeveloperPro = "RpaDeveloperPro",
|
|
425
|
+
TestAutomation = "TestAutomation",
|
|
426
|
+
AutomationCloud = "AutomationCloud",
|
|
427
|
+
Serverless = "Serverless",
|
|
428
|
+
AutomationKit = "AutomationKit",
|
|
429
|
+
ServerlessTestAutomation = "ServerlessTestAutomation",
|
|
430
|
+
AutomationCloudTestAutomation = "AutomationCloudTestAutomation",
|
|
431
|
+
AttendedStudioWeb = "AttendedStudioWeb",
|
|
432
|
+
Hosting = "Hosting",
|
|
433
|
+
AssistantWeb = "AssistantWeb",
|
|
434
|
+
ProcessOrchestration = "ProcessOrchestration",
|
|
435
|
+
AgentService = "AgentService",
|
|
436
|
+
AppTest = "AppTest",
|
|
437
|
+
PerformanceTest = "PerformanceTest",
|
|
438
|
+
BusinessRule = "BusinessRule",
|
|
439
|
+
CaseManagement = "CaseManagement",
|
|
440
|
+
Flow = "Flow"
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Interface for common folder properties
|
|
444
|
+
*/
|
|
445
|
+
interface FolderProperties {
|
|
446
|
+
folderId: number;
|
|
447
|
+
folderName: string | null;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Interface for robot metadata
|
|
451
|
+
*/
|
|
452
|
+
interface RobotMetadata {
|
|
453
|
+
id: number;
|
|
454
|
+
name?: string;
|
|
455
|
+
username?: string;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Interface for machine
|
|
459
|
+
*/
|
|
460
|
+
interface Machine {
|
|
461
|
+
id: number;
|
|
462
|
+
name?: string;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Interface for job error
|
|
466
|
+
*/
|
|
467
|
+
interface JobError {
|
|
468
|
+
code?: string;
|
|
469
|
+
title?: string;
|
|
470
|
+
detail?: string;
|
|
471
|
+
category?: string;
|
|
472
|
+
status?: number;
|
|
473
|
+
timestamp?: string;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Enum for job type
|
|
477
|
+
*/
|
|
478
|
+
declare enum JobType {
|
|
479
|
+
Unattended = "Unattended",
|
|
480
|
+
Attended = "Attended",
|
|
481
|
+
ServerlessGeneric = "ServerlessGeneric"
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Enum for job sub-state
|
|
486
|
+
*/
|
|
487
|
+
declare enum JobSubState {
|
|
488
|
+
WithFaults = "WITH_FAULTS",
|
|
489
|
+
Manually = "MANUALLY"
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Enum for serverless job type
|
|
493
|
+
*/
|
|
494
|
+
declare enum ServerlessJobType {
|
|
495
|
+
RobotJob = "RobotJob",
|
|
496
|
+
WebApp = "WebApp",
|
|
497
|
+
LoadTest = "LoadTest",
|
|
498
|
+
StudioWebDesigner = "StudioWebDesigner",
|
|
499
|
+
PublishStudioProject = "PublishStudioProject",
|
|
500
|
+
JsApi = "JsApi",
|
|
501
|
+
PythonCodedAgent = "PythonCodedAgent",
|
|
502
|
+
MCPServer = "MCPServer",
|
|
503
|
+
PythonCodedSystemAgent = "PythonCodedSystemAgent",
|
|
504
|
+
PythonAgent = "PythonAgent"
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Interface for process metadata associated with a job.
|
|
508
|
+
* Represents a lightweight summary of the process (release) linked to a job.
|
|
509
|
+
* Available when using 'expand: "Release"' in the query.
|
|
510
|
+
*/
|
|
511
|
+
interface ProcessMetadata {
|
|
512
|
+
/** The unique key of the release */
|
|
513
|
+
key?: string;
|
|
514
|
+
/** The process key identifying the package */
|
|
515
|
+
processKey?: string;
|
|
516
|
+
/** The version of the process package */
|
|
517
|
+
processVersion?: string;
|
|
518
|
+
/** Whether this is the latest version of the process */
|
|
519
|
+
isLatestVersion?: boolean;
|
|
520
|
+
/** The display name of the process */
|
|
521
|
+
name?: string;
|
|
522
|
+
/** The numeric ID of the release */
|
|
523
|
+
id?: number;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Interface for job response
|
|
527
|
+
*/
|
|
528
|
+
interface JobGetResponse extends FolderProperties {
|
|
529
|
+
/** The unique numeric identifier of the job */
|
|
530
|
+
id: number;
|
|
531
|
+
/** The unique job identifier (GUID) */
|
|
532
|
+
key: string;
|
|
533
|
+
/** The current execution state of the job */
|
|
534
|
+
state: JobState;
|
|
535
|
+
/** The date and time when the job was created */
|
|
536
|
+
createdTime: string;
|
|
537
|
+
/** The date and time when the job execution started, or null if the job hasn't started yet */
|
|
538
|
+
startTime: string | null;
|
|
539
|
+
/** The date and time when the job execution ended, or null if the job hasn't ended yet */
|
|
540
|
+
endTime: string | null;
|
|
541
|
+
/** The date and time when the job was last modified */
|
|
542
|
+
lastModifiedTime: string | null;
|
|
543
|
+
/** The date and time when the job was resumed after suspension */
|
|
544
|
+
resumeTime: string | null;
|
|
545
|
+
/** The name of the process (release) associated with the job */
|
|
546
|
+
processName: string | null;
|
|
547
|
+
/** Path to the entry point workflow (XAML) that will be executed by the robot */
|
|
548
|
+
entryPointPath: string | null;
|
|
549
|
+
/** The name of the machine where the robot ran the job */
|
|
550
|
+
hostMachineName: string | null;
|
|
551
|
+
/** Input parameters as a JSON string passed to job execution */
|
|
552
|
+
inputArguments: string | null;
|
|
553
|
+
/** Output parameters as a JSON string resulted from job execution */
|
|
554
|
+
outputArguments: string | null;
|
|
555
|
+
/** Environment variables as a JSON string passed to the job execution */
|
|
556
|
+
environmentVariables: string | null;
|
|
557
|
+
/** Additional information about the current job */
|
|
558
|
+
info: string | null;
|
|
559
|
+
/** The source name of the job, describing how the job was triggered */
|
|
560
|
+
source: string | null;
|
|
561
|
+
/** Reference identifier for the job, used for external correlation */
|
|
562
|
+
reference: string | null;
|
|
563
|
+
/** The execution priority of the job */
|
|
564
|
+
jobPriority: JobPriority | null;
|
|
565
|
+
/** Value for more granular control over execution priority (1-100) */
|
|
566
|
+
specificPriorityValue: number | null;
|
|
567
|
+
/** The type of the job - Attended if started via the robot, Unattended otherwise */
|
|
568
|
+
type: JobType;
|
|
569
|
+
/** The package type of the process associated with the job */
|
|
570
|
+
packageType: PackageType;
|
|
571
|
+
/** The runtime type of the robot which can pick up the job */
|
|
572
|
+
runtimeType: RuntimeType | null;
|
|
573
|
+
/** The source type indicating how the job was triggered */
|
|
574
|
+
sourceType: JobSourceType;
|
|
575
|
+
/** The type of the serverless job, or null for non-serverless jobs */
|
|
576
|
+
serverlessJobType: ServerlessJobType | null;
|
|
577
|
+
/** The stop strategy for the job */
|
|
578
|
+
stopStrategy: StopStrategy | null;
|
|
579
|
+
/** The remote control access level for the job */
|
|
580
|
+
remoteControlAccess: RemoteControlAccess;
|
|
581
|
+
/** The folder key (GUID) of the folder this job is part of */
|
|
582
|
+
folderKey: string | null;
|
|
583
|
+
/** The unique identifier grouping multiple jobs, usually generated when started by a schedule */
|
|
584
|
+
batchExecutionKey: string;
|
|
585
|
+
/** The parent job key (GUID), set when the job was started by another job */
|
|
586
|
+
parentJobKey: string | null;
|
|
587
|
+
/** The ID of the schedule that started the job, or null if started by the user */
|
|
588
|
+
startingScheduleId: number | null;
|
|
589
|
+
/** The starting trigger ID, can be ApiTriggerId or HttpTriggerId */
|
|
590
|
+
startingTriggerId: string | null;
|
|
591
|
+
/** The process version ID */
|
|
592
|
+
processVersionId: number | null;
|
|
593
|
+
/** Expected maximum running time in seconds before the job is flagged */
|
|
594
|
+
maxExpectedRunningTimeSeconds: number | null;
|
|
595
|
+
/** Whether the job requires user interaction */
|
|
596
|
+
requiresUserInteraction: boolean;
|
|
597
|
+
/** If set, the job will resume on the same robot-machine pair on which it initially ran */
|
|
598
|
+
resumeOnSameContext: boolean;
|
|
599
|
+
/** Distinguishes between multiple job suspend/resume cycles */
|
|
600
|
+
resumeVersion: number | null;
|
|
601
|
+
/** The sub-state in which the job is, providing more granular status information */
|
|
602
|
+
subState: JobSubState | null;
|
|
603
|
+
/** The target runtime for the job */
|
|
604
|
+
targetRuntime: string | null;
|
|
605
|
+
/** The trace ID for distributed tracing */
|
|
606
|
+
traceId: string | null;
|
|
607
|
+
/** The parent span ID for distributed tracing */
|
|
608
|
+
parentSpanId: string | null;
|
|
609
|
+
/** The error code associated with a failed job */
|
|
610
|
+
errorCode: string | null;
|
|
611
|
+
/** The machine associated with the job (available when using expand=Machine) */
|
|
612
|
+
machine?: Machine;
|
|
613
|
+
/** The robot associated with the job (available when using expand=Robot) */
|
|
614
|
+
robot?: RobotMetadata;
|
|
615
|
+
/** The process metadata associated with the job (available when using expand=Release) */
|
|
616
|
+
process?: ProcessMetadata | null;
|
|
617
|
+
/** Error details for the job, or null if the job has no errors */
|
|
618
|
+
jobError: JobError | null;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Options for getting all jobs
|
|
622
|
+
*/
|
|
623
|
+
type JobGetAllOptions = RequestOptions & PaginationOptions & {
|
|
624
|
+
/**
|
|
625
|
+
* Optional folder ID to filter jobs by folder
|
|
626
|
+
*/
|
|
627
|
+
folderId?: number;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Service for managing UiPath Orchestrator Jobs.
|
|
632
|
+
*
|
|
633
|
+
* Jobs represent the execution of a process (automation) on a UiPath Robot. Each job tracks the lifecycle of a single process run, including its state, timing, input/output arguments, and associated resources. [UiPath Jobs Guide](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-jobs)
|
|
634
|
+
*
|
|
635
|
+
* ### Usage
|
|
636
|
+
*
|
|
637
|
+
* Prerequisites: Initialize the SDK first - see [Getting Started](/uipath-typescript/getting-started/#import-initialize)
|
|
638
|
+
*
|
|
639
|
+
* ```typescript
|
|
640
|
+
* import { Jobs } from '@uipath/uipath-typescript/jobs';
|
|
641
|
+
*
|
|
642
|
+
* const jobs = new Jobs(sdk);
|
|
643
|
+
* const allJobs = await jobs.getAll();
|
|
644
|
+
* ```
|
|
645
|
+
*/
|
|
646
|
+
interface JobServiceModel {
|
|
647
|
+
/**
|
|
648
|
+
* Gets all jobs across folders with optional filtering
|
|
649
|
+
*
|
|
650
|
+
* @param options - Query options including optional folderId and pagination options
|
|
651
|
+
* @returns Promise resolving to either an array of jobs {@link NonPaginatedResponse}<{@link JobGetResponse}> or a {@link PaginatedResponse}<{@link JobGetResponse}> when pagination options are used.
|
|
652
|
+
* {@link JobGetResponse}
|
|
653
|
+
* @example
|
|
654
|
+
* ```typescript
|
|
655
|
+
* // Get all jobs
|
|
656
|
+
* const allJobs = await jobs.getAll();
|
|
657
|
+
*
|
|
658
|
+
* // Get all jobs in a specific folder
|
|
659
|
+
* const folderJobs = await jobs.getAll({ folderId: <folderId> });
|
|
660
|
+
*
|
|
661
|
+
* // With filtering
|
|
662
|
+
* const runningJobs = await jobs.getAll({
|
|
663
|
+
* filter: "state eq 'Running'"
|
|
664
|
+
* });
|
|
665
|
+
*
|
|
666
|
+
* // First page with pagination
|
|
667
|
+
* const page1 = await jobs.getAll({ pageSize: 10 });
|
|
668
|
+
*
|
|
669
|
+
* // Navigate using cursor
|
|
670
|
+
* if (page1.hasNextPage) {
|
|
671
|
+
* const page2 = await jobs.getAll({ cursor: page1.nextCursor });
|
|
672
|
+
* }
|
|
673
|
+
*
|
|
674
|
+
* // Jump to specific page
|
|
675
|
+
* const page5 = await jobs.getAll({
|
|
676
|
+
* jumpToPage: 5,
|
|
677
|
+
* pageSize: 10
|
|
678
|
+
* });
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
getAll<T extends JobGetAllOptions = JobGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<JobGetResponse> : NonPaginatedResponse<JobGetResponse>>;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Service for interacting with UiPath Orchestrator Jobs API
|
|
686
|
+
*/
|
|
687
|
+
declare class JobService extends FolderScopedService implements JobServiceModel {
|
|
688
|
+
/**
|
|
689
|
+
* Gets all jobs across folders with optional filtering
|
|
690
|
+
*
|
|
691
|
+
* @param options - Query options including optional folderId and pagination options
|
|
692
|
+
* @returns Promise resolving to array of jobs or paginated response
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* ```typescript
|
|
696
|
+
* import { Jobs } from '@uipath/uipath-typescript/jobs';
|
|
697
|
+
*
|
|
698
|
+
* const jobs = new Jobs(sdk);
|
|
699
|
+
*
|
|
700
|
+
* // Get all jobs
|
|
701
|
+
* const allJobs = await jobs.getAll();
|
|
702
|
+
*
|
|
703
|
+
* // Get all jobs in a specific folder
|
|
704
|
+
* const folderJobs = await jobs.getAll({ folderId: 123 });
|
|
705
|
+
*
|
|
706
|
+
* // With filtering
|
|
707
|
+
* const runningJobs = await jobs.getAll({
|
|
708
|
+
* filter: "state eq 'Running'"
|
|
709
|
+
* });
|
|
710
|
+
*
|
|
711
|
+
* // First page with pagination
|
|
712
|
+
* const page1 = await jobs.getAll({ pageSize: 10 });
|
|
713
|
+
*
|
|
714
|
+
* // Navigate using cursor
|
|
715
|
+
* if (page1.hasNextPage) {
|
|
716
|
+
* const page2 = await jobs.getAll({ cursor: page1.nextCursor });
|
|
717
|
+
* }
|
|
718
|
+
* ```
|
|
719
|
+
*/
|
|
720
|
+
getAll<T extends JobGetAllOptions = JobGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<JobGetResponse> : NonPaginatedResponse<JobGetResponse>>;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
export { JobService, JobSubState, JobService as Jobs, ServerlessJobType };
|
|
724
|
+
export type { JobGetAllOptions, JobGetResponse, JobServiceModel, ProcessMetadata };
|