@uipath/uipath-typescript 1.3.11 → 1.4.1
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/agent-memory/index.cjs +1772 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1770 -0
- package/dist/agents/index.cjs +1995 -0
- package/dist/agents/index.d.ts +961 -0
- package/dist/agents/index.mjs +1993 -0
- package/dist/assets/index.cjs +171 -39
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +171 -39
- package/dist/attachments/index.cjs +53 -15
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +53 -15
- package/dist/buckets/index.cjs +151 -130
- package/dist/buckets/index.d.ts +198 -84
- package/dist/buckets/index.mjs +151 -130
- package/dist/cases/index.cjs +220 -23
- package/dist/cases/index.d.ts +148 -10
- package/dist/cases/index.mjs +220 -24
- package/dist/conversational-agent/index.cjs +140 -66
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +140 -66
- package/dist/core/index.cjs +445 -108
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +445 -108
- package/dist/entities/index.cjs +365 -102
- package/dist/entities/index.d.ts +446 -114
- package/dist/entities/index.mjs +365 -102
- package/dist/feedback/index.cjs +53 -15
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +53 -15
- package/dist/governance/index.cjs +1789 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1787 -0
- package/dist/index.cjs +1453 -444
- package/dist/index.d.ts +4150 -1742
- package/dist/index.mjs +1452 -445
- package/dist/index.umd.js +5035 -4009
- package/dist/jobs/index.cjs +53 -15
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +53 -15
- package/dist/maestro-processes/index.cjs +189 -27
- package/dist/maestro-processes/index.d.ts +131 -9
- package/dist/maestro-processes/index.mjs +189 -27
- package/dist/orchestrator-du-module/index.cjs +1788 -0
- package/dist/orchestrator-du-module/index.d.ts +757 -0
- package/dist/orchestrator-du-module/index.mjs +1785 -0
- package/dist/processes/index.cjs +53 -15
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +53 -15
- package/dist/queues/index.cjs +53 -15
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +53 -15
- package/dist/tasks/index.cjs +116 -19
- package/dist/tasks/index.d.ts +110 -4
- package/dist/tasks/index.mjs +117 -20
- package/dist/traces/index.cjs +340 -15
- package/dist/traces/index.d.ts +483 -2
- package/dist/traces/index.mjs +339 -16
- package/package.json +42 -2
|
@@ -0,0 +1,961 @@
|
|
|
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
|
+
convertToSkip?: boolean;
|
|
110
|
+
zeroBased?: boolean;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* HTTP methods supported by the API client
|
|
117
|
+
*/
|
|
118
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
119
|
+
/**
|
|
120
|
+
* Supported response types for API requests
|
|
121
|
+
*/
|
|
122
|
+
type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream';
|
|
123
|
+
/**
|
|
124
|
+
* Query parameters type with support for arrays and nested objects
|
|
125
|
+
*/
|
|
126
|
+
type QueryParams = Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
|
|
127
|
+
/**
|
|
128
|
+
* Standard HTTP headers type
|
|
129
|
+
*/
|
|
130
|
+
type Headers = Record<string, string>;
|
|
131
|
+
/**
|
|
132
|
+
* Options for request retries
|
|
133
|
+
*/
|
|
134
|
+
interface RetryOptions {
|
|
135
|
+
/** Maximum number of retry attempts */
|
|
136
|
+
maxRetries?: number;
|
|
137
|
+
/** Base delay between retries in milliseconds */
|
|
138
|
+
retryDelay?: number;
|
|
139
|
+
/** Whether to use exponential backoff */
|
|
140
|
+
useExponentialBackoff?: boolean;
|
|
141
|
+
/** Status codes that should trigger a retry */
|
|
142
|
+
retryableStatusCodes?: number[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Options for request timeouts
|
|
146
|
+
*/
|
|
147
|
+
interface TimeoutOptions {
|
|
148
|
+
/** Request timeout in milliseconds */
|
|
149
|
+
timeout?: number;
|
|
150
|
+
/** Whether to abort the request on timeout */
|
|
151
|
+
abortOnTimeout?: boolean;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Options for request body transformation
|
|
155
|
+
*/
|
|
156
|
+
interface BodyOptions {
|
|
157
|
+
/** Whether to stringify the body */
|
|
158
|
+
stringify?: boolean;
|
|
159
|
+
/** Content type override */
|
|
160
|
+
contentType?: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Pagination metadata for API requests
|
|
164
|
+
*/
|
|
165
|
+
interface PaginationMetadata {
|
|
166
|
+
/** Type of pagination used by the API endpoint */
|
|
167
|
+
paginationType: PaginationType;
|
|
168
|
+
/** Response field containing items array (defaults to 'value') */
|
|
169
|
+
itemsField?: string;
|
|
170
|
+
/** Response field containing total count (defaults to '@odata.count') */
|
|
171
|
+
totalCountField?: string;
|
|
172
|
+
/** Response field containing continuation token (defaults to 'continuationToken') */
|
|
173
|
+
continuationTokenField?: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Base interface for all API requests
|
|
177
|
+
*/
|
|
178
|
+
interface RequestSpec {
|
|
179
|
+
/** HTTP method for the request */
|
|
180
|
+
method?: HttpMethod;
|
|
181
|
+
/** URL endpoint for the request */
|
|
182
|
+
url?: string;
|
|
183
|
+
/** Query parameters to be appended to the URL */
|
|
184
|
+
params?: QueryParams;
|
|
185
|
+
/** HTTP headers to include with the request */
|
|
186
|
+
headers?: Headers;
|
|
187
|
+
/** Raw body content (takes precedence over data) */
|
|
188
|
+
body?: unknown;
|
|
189
|
+
/** Expected response type */
|
|
190
|
+
responseType?: ResponseType;
|
|
191
|
+
/** Request timeout options */
|
|
192
|
+
timeoutOptions?: TimeoutOptions;
|
|
193
|
+
/** Retry behavior options */
|
|
194
|
+
retryOptions?: RetryOptions;
|
|
195
|
+
/** Body transformation options */
|
|
196
|
+
bodyOptions?: BodyOptions;
|
|
197
|
+
/** AbortSignal for cancelling the request */
|
|
198
|
+
signal?: AbortSignal;
|
|
199
|
+
/** Pagination metadata for the request */
|
|
200
|
+
pagination?: PaginationMetadata;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface ApiResponse<T> {
|
|
204
|
+
data: T;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Base class for all UiPath SDK services.
|
|
208
|
+
*
|
|
209
|
+
* Provides common functionality for authentication, configuration, and API communication.
|
|
210
|
+
* All service classes extend this base to inherit dependency injection and HTTP client access.
|
|
211
|
+
*
|
|
212
|
+
* This class implements the dependency injection pattern where services receive a configured
|
|
213
|
+
* UiPath instance. The ApiClient is created internally and handles all HTTP operations
|
|
214
|
+
* including authentication token management.
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* Service classes should extend this base and call `super(uiPath)` in their constructor.
|
|
218
|
+
* Protected HTTP methods (get, post, put, patch, delete) are available to all subclasses.
|
|
219
|
+
*
|
|
220
|
+
*/
|
|
221
|
+
declare class BaseService {
|
|
222
|
+
#private;
|
|
223
|
+
/**
|
|
224
|
+
* SDK configuration (read-only). Available to subclasses so they can
|
|
225
|
+
* fall back to init-time defaults like `folderKey`.
|
|
226
|
+
*/
|
|
227
|
+
protected readonly config: {
|
|
228
|
+
folderKey?: string;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Creates a base service instance with dependency injection.
|
|
232
|
+
*
|
|
233
|
+
* Extracts configuration, execution context, and token manager from the UiPath instance
|
|
234
|
+
* to initialize an authenticated API client. The ApiClient handles all HTTP operations
|
|
235
|
+
* and token management internally.
|
|
236
|
+
*
|
|
237
|
+
* @param instance - UiPath SDK instance providing authentication and configuration.
|
|
238
|
+
* Services receive this via dependency injection in the modular pattern.
|
|
239
|
+
* @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for
|
|
240
|
+
* CAS external-app auth)
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* // Services automatically call this via super()
|
|
245
|
+
* export class EntityService extends BaseService {
|
|
246
|
+
* constructor(instance: IUiPath) {
|
|
247
|
+
* super(instance); // Initializes the internal ApiClient
|
|
248
|
+
* }
|
|
249
|
+
* }
|
|
250
|
+
*
|
|
251
|
+
* // Usage in modular pattern
|
|
252
|
+
* import { UiPath } from '@uipath/uipath-typescript/core';
|
|
253
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
254
|
+
*
|
|
255
|
+
* const sdk = new UiPath(config);
|
|
256
|
+
* await sdk.initialize();
|
|
257
|
+
* const entities = new Entities(sdk);
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
constructor(instance: IUiPath, headers?: Record<string, string>);
|
|
261
|
+
/**
|
|
262
|
+
* Gets a valid authentication token, refreshing if necessary.
|
|
263
|
+
* Use this when you need to manually add Authorization headers (e.g., direct uploads).
|
|
264
|
+
*
|
|
265
|
+
* @returns Promise resolving to a valid access token string
|
|
266
|
+
* @throws AuthenticationError if no token is available or refresh fails
|
|
267
|
+
*/
|
|
268
|
+
protected getValidAuthToken(): Promise<string>;
|
|
269
|
+
/**
|
|
270
|
+
* Creates a service accessor for pagination helpers
|
|
271
|
+
* This allows pagination helpers to access protected methods without making them public
|
|
272
|
+
*/
|
|
273
|
+
protected createPaginationServiceAccess(): PaginationServiceAccess;
|
|
274
|
+
protected request<T>(method: string, path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
275
|
+
protected requestWithSpec<T>(spec: RequestSpec): Promise<ApiResponse<T>>;
|
|
276
|
+
protected get<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
277
|
+
protected post<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
278
|
+
protected put<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
279
|
+
protected patch<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
280
|
+
protected delete<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
281
|
+
/**
|
|
282
|
+
* Execute a request with cursor-based pagination
|
|
283
|
+
*/
|
|
284
|
+
protected requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
285
|
+
/**
|
|
286
|
+
* Validates and prepares pagination parameters from options
|
|
287
|
+
*/
|
|
288
|
+
private validateAndPreparePaginationParams;
|
|
289
|
+
/**
|
|
290
|
+
* Prepares request parameters for pagination based on pagination type
|
|
291
|
+
*/
|
|
292
|
+
private preparePaginationRequestParams;
|
|
293
|
+
/**
|
|
294
|
+
* Creates a paginated response from API response
|
|
295
|
+
*/
|
|
296
|
+
private createPaginatedResponseFromResponse;
|
|
297
|
+
/**
|
|
298
|
+
* Determines if there are more pages based on pagination type and metadata
|
|
299
|
+
*/
|
|
300
|
+
private determineHasMorePages;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Filter fields shared by agent endpoints that accept a
|
|
305
|
+
* folder/agent/project scope (`/Agents/agents`, `/Agents/errors`, etc.).
|
|
306
|
+
*/
|
|
307
|
+
interface AgentFilterOptions {
|
|
308
|
+
/** Optional folder keys to scope the lookup. Intersected with the user's accessible folders. */
|
|
309
|
+
folderKeys?: string[];
|
|
310
|
+
/** Filter to specific agent names. */
|
|
311
|
+
agentNames?: string[];
|
|
312
|
+
/** Filter to specific project keys. */
|
|
313
|
+
projectKeys?: string[];
|
|
314
|
+
/** Filter to a single agent by ID. */
|
|
315
|
+
agentId?: string;
|
|
316
|
+
/** Filter to a specific process version. */
|
|
317
|
+
processVersion?: string;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Columns available for ordering results.
|
|
321
|
+
*/
|
|
322
|
+
declare enum AgentListSortColumn {
|
|
323
|
+
AgentName = "AgentName",
|
|
324
|
+
ParentProcess = "ParentProcess",
|
|
325
|
+
LastRun = "LastRun",
|
|
326
|
+
HealthScore = "HealthScore",
|
|
327
|
+
LastIncident = "LastIncident",
|
|
328
|
+
FolderName = "FolderName",
|
|
329
|
+
/** Quantity of AGU (Agent Units) consumed */
|
|
330
|
+
QuantityAGU = "QuantityAGU",
|
|
331
|
+
/** Quantity of PLTU (Platform Units) consumed */
|
|
332
|
+
QuantityPLTU = "QuantityPLTU",
|
|
333
|
+
FolderPath = "FolderPath"
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Ordering directive for the agents list.
|
|
337
|
+
*/
|
|
338
|
+
interface AgentListOrderBy {
|
|
339
|
+
/** Column to sort by */
|
|
340
|
+
column: AgentListSortColumn;
|
|
341
|
+
/** Sort descending. Defaults to false. */
|
|
342
|
+
desc?: boolean;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* One row in the agents list - agent identity plus consumption and health metadata aggregated over the
|
|
346
|
+
* requested time window.
|
|
347
|
+
*/
|
|
348
|
+
interface AgentListItem {
|
|
349
|
+
/** Agent ID */
|
|
350
|
+
agentId: string;
|
|
351
|
+
/** Agent display name */
|
|
352
|
+
agentName: string;
|
|
353
|
+
/** Parent process name. May be `null` or `""` for jobs not bound to a parent process. */
|
|
354
|
+
parentProcess: string | null;
|
|
355
|
+
/** Folder key of the folder the agent runs in. May be `null` or `""`. */
|
|
356
|
+
folderKey: string | null;
|
|
357
|
+
/** Folder display name. May be `null` or `""`. */
|
|
358
|
+
folderName: string | null;
|
|
359
|
+
/** Fully qualified folder path. May be `null` or `""`. */
|
|
360
|
+
folderPath: string | null;
|
|
361
|
+
/** Last run timestamp */
|
|
362
|
+
lastRun: string;
|
|
363
|
+
/** Process key. May be `null` or `""` for ad-hoc jobs. */
|
|
364
|
+
processKey: string | null;
|
|
365
|
+
/** Process version. May be `null` or `""`. */
|
|
366
|
+
processVersion: string | null;
|
|
367
|
+
/** Health score (0-100) */
|
|
368
|
+
healthScore: number;
|
|
369
|
+
/** Last incident type label. May be `null` or `""`. */
|
|
370
|
+
lastIncidentType: string | null;
|
|
371
|
+
/** Total units consumed by this agent in the window */
|
|
372
|
+
unitsQuantity: number;
|
|
373
|
+
/** Display name of the units (if any). May be `null` or `""`. */
|
|
374
|
+
unitsName: string | null;
|
|
375
|
+
/** Quantity of AGU (Agent Units) consumed by this agent */
|
|
376
|
+
quantityAGU: number;
|
|
377
|
+
/** Quantity of PLTU (Platform Units) consumed by this agent */
|
|
378
|
+
quantityPLTU: number;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Options for getting the list of agents.
|
|
382
|
+
*
|
|
383
|
+
* Composes filter, pagination, and sort options.
|
|
384
|
+
*/
|
|
385
|
+
type AgentGetAllOptions = AgentFilterOptions & PaginationOptions & {
|
|
386
|
+
/** Sort order for the result set. */
|
|
387
|
+
orderBy?: AgentListOrderBy;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Summary information about a single job execution — included on every
|
|
391
|
+
* error entry to anchor the window.
|
|
392
|
+
*/
|
|
393
|
+
interface AgentJobInfo {
|
|
394
|
+
/** Job key */
|
|
395
|
+
jobKey: string;
|
|
396
|
+
/** Folder key the job ran in */
|
|
397
|
+
folderKey: string;
|
|
398
|
+
/** Display name of the folder */
|
|
399
|
+
folderName: string;
|
|
400
|
+
/** Fully qualified folder path */
|
|
401
|
+
folderPath: string;
|
|
402
|
+
/** Job start time */
|
|
403
|
+
startTime: string;
|
|
404
|
+
/** Job end time. `null` while the job is still running. */
|
|
405
|
+
endTime: string | null;
|
|
406
|
+
/** Process key the job was launched from. `null` for ad-hoc jobs. */
|
|
407
|
+
processKey: string | null;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Columns available for ordering / grouping the agent errors list.
|
|
411
|
+
*/
|
|
412
|
+
declare enum AgentErrorSortColumn {
|
|
413
|
+
AgentId = "AgentId",
|
|
414
|
+
AgentName = "AgentName",
|
|
415
|
+
ParentProcessName = "ParentProcessName",
|
|
416
|
+
ErrorTitle = "ErrorTitle",
|
|
417
|
+
FirstSeenStartTime = "FirstSeenStartTime",
|
|
418
|
+
ExecutionCount = "ExecutionCount",
|
|
419
|
+
Type = "Type",
|
|
420
|
+
FirstSeenFolderName = "FirstSeenFolderName",
|
|
421
|
+
FirstSeenFolderPath = "FirstSeenFolderPath",
|
|
422
|
+
LastSeenStartTime = "LastSeenStartTime",
|
|
423
|
+
LastSeenFolderName = "LastSeenFolderName",
|
|
424
|
+
LastSeenFolderPath = "LastSeenFolderPath"
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Ordering directive for the agent errors list.
|
|
428
|
+
*/
|
|
429
|
+
interface AgentErrorOrderBy {
|
|
430
|
+
/** Column to sort by */
|
|
431
|
+
column: AgentErrorSortColumn;
|
|
432
|
+
/** Sort descending. Defaults to false (ascending) server-side. */
|
|
433
|
+
desc?: boolean;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* One error in the agent errors list — an error/error-class observed
|
|
437
|
+
* for an agent over the requested window.
|
|
438
|
+
*/
|
|
439
|
+
interface AgentError {
|
|
440
|
+
/** Error type */
|
|
441
|
+
type: string;
|
|
442
|
+
/** Error description */
|
|
443
|
+
description: string;
|
|
444
|
+
/** Agent ID */
|
|
445
|
+
agentId: string;
|
|
446
|
+
/** Agent display name. `null` if the agent has no display name set. */
|
|
447
|
+
agentName: string | null;
|
|
448
|
+
/** Job key where the error was first seen */
|
|
449
|
+
jobKey: string;
|
|
450
|
+
/** Parent process name. `null` for jobs not bound to a parent process. */
|
|
451
|
+
parentProcess: string | null;
|
|
452
|
+
/** First-seen timestamp */
|
|
453
|
+
firstSeen: string;
|
|
454
|
+
/** Folder key where the error was first observed */
|
|
455
|
+
folderKey: string;
|
|
456
|
+
/** Folder display name */
|
|
457
|
+
folderName: string;
|
|
458
|
+
/** Fully qualified folder path */
|
|
459
|
+
folderPath: string;
|
|
460
|
+
/** Number of error executions counted for this error */
|
|
461
|
+
count: number;
|
|
462
|
+
/** First job in the window where this error was observed */
|
|
463
|
+
firstSeenJob: AgentJobInfo;
|
|
464
|
+
/** Last job in the window where this error was observed */
|
|
465
|
+
lastSeenJob: AgentJobInfo;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Options for the agent errors list.
|
|
469
|
+
*
|
|
470
|
+
* Composes filter, pagination, and sort/group options.
|
|
471
|
+
*/
|
|
472
|
+
type AgentGetErrorsOptions = AgentFilterOptions & PaginationOptions & {
|
|
473
|
+
/** Sort order for the result set. */
|
|
474
|
+
orderBy?: AgentErrorOrderBy;
|
|
475
|
+
/** Group results by one or more columns. */
|
|
476
|
+
groupBy?: AgentErrorSortColumn[];
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* A single point on the agent errors timeline
|
|
480
|
+
*/
|
|
481
|
+
interface AgentGetErrorsTimelineResponse {
|
|
482
|
+
/** Agent name */
|
|
483
|
+
name: string;
|
|
484
|
+
/** Error count in this time bucket */
|
|
485
|
+
value: number;
|
|
486
|
+
/** Bucket timestamp (ISO 8601, UTC) */
|
|
487
|
+
date: string;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Options for getting the agent errors timeline.
|
|
491
|
+
*/
|
|
492
|
+
interface AgentGetErrorsTimelineOptions extends AgentFilterOptions {
|
|
493
|
+
/** Max number of agents to return. Defaults to 10 server-side. */
|
|
494
|
+
limit?: number;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* A single point on the agent consumption timeline
|
|
498
|
+
*/
|
|
499
|
+
interface AgentGetConsumptionTimelineResponse {
|
|
500
|
+
/** Bucket timestamp (ISO 8601, UTC) */
|
|
501
|
+
timeSlice: string;
|
|
502
|
+
/** AGU quantity consumed in this time bucket */
|
|
503
|
+
aguConsumption: number;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Options for getting the agent consumption timeline.
|
|
507
|
+
*/
|
|
508
|
+
interface AgentGetConsumptionTimelineOptions extends AgentFilterOptions {
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* A single point on the agent latency timeline
|
|
512
|
+
*/
|
|
513
|
+
interface AgentGetLatencyTimelineResponse {
|
|
514
|
+
/**
|
|
515
|
+
* Percentile label for this point — observed values: `"P50"`, `"P95"`.
|
|
516
|
+
*/
|
|
517
|
+
name: string;
|
|
518
|
+
/** Latency value in milliseconds. */
|
|
519
|
+
value: number;
|
|
520
|
+
/** Bucket timestamp (ISO 8601, UTC) */
|
|
521
|
+
date: string;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Options for getting the agent latency timeline.
|
|
525
|
+
*/
|
|
526
|
+
interface AgentGetLatencyTimelineOptions extends AgentFilterOptions {
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Service for retrieving runtime data for UiPath Agents.
|
|
531
|
+
*
|
|
532
|
+
* See [About Agents](https://docs.uipath.com/agents/automation-cloud/latest/user-guide/about-agents)
|
|
533
|
+
* for an overview of UiPath Agents.
|
|
534
|
+
*/
|
|
535
|
+
interface AgentServiceModel {
|
|
536
|
+
/**
|
|
537
|
+
* Retrieves the list of agents on the tenant with consumption and health
|
|
538
|
+
* metadata over the requested window.
|
|
539
|
+
*
|
|
540
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
541
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
542
|
+
* {@link NonPaginatedResponse}.
|
|
543
|
+
*
|
|
544
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
545
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
546
|
+
* @param options - Optional pagination, sort, and filters
|
|
547
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentListItem}
|
|
548
|
+
* @example
|
|
549
|
+
* ```typescript
|
|
550
|
+
* import { Agents, AgentListSortColumn } from '@uipath/uipath-typescript/agents';
|
|
551
|
+
*
|
|
552
|
+
* const agents = new Agents(sdk);
|
|
553
|
+
*
|
|
554
|
+
* // Non-paginated — returns the server default page
|
|
555
|
+
* const result = await agents.getAll(
|
|
556
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
557
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
558
|
+
* );
|
|
559
|
+
* result.items.forEach((agent) => {
|
|
560
|
+
* console.log(`${agent.agentName} — ${agent.unitsQuantity} units, health=${agent.healthScore}`);
|
|
561
|
+
* });
|
|
562
|
+
*
|
|
563
|
+
* // Paginated — sorted by health score descending
|
|
564
|
+
* const page = await agents.getAll(
|
|
565
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
566
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
567
|
+
* {
|
|
568
|
+
* pageSize: 25,
|
|
569
|
+
* orderBy: { column: AgentListSortColumn.HealthScore, desc: true },
|
|
570
|
+
* folderKeys: ['<folderKey1>'],
|
|
571
|
+
* },
|
|
572
|
+
* );
|
|
573
|
+
*
|
|
574
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
575
|
+
* const next = await agents.getAll(
|
|
576
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
577
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
578
|
+
* { cursor: page.nextCursor },
|
|
579
|
+
* );
|
|
580
|
+
* }
|
|
581
|
+
* ```
|
|
582
|
+
*/
|
|
583
|
+
getAll<T extends AgentGetAllOptions = AgentGetAllOptions>(startTime: Date, endTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentListItem> : NonPaginatedResponse<AgentListItem>>;
|
|
584
|
+
/**
|
|
585
|
+
* Retrieves agent errors (error-classes observed for agents) over the
|
|
586
|
+
* requested window.
|
|
587
|
+
*
|
|
588
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
589
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
590
|
+
* {@link NonPaginatedResponse}.
|
|
591
|
+
*
|
|
592
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
593
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
594
|
+
* @param options - Optional pagination, sort/group, and filters
|
|
595
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentError}
|
|
596
|
+
* @example
|
|
597
|
+
* ```typescript
|
|
598
|
+
* import { Agents, AgentErrorSortColumn } from '@uipath/uipath-typescript/agents';
|
|
599
|
+
*
|
|
600
|
+
* const agents = new Agents(sdk);
|
|
601
|
+
*
|
|
602
|
+
* // Non-paginated — errors in the window
|
|
603
|
+
* const result = await agents.getErrors(
|
|
604
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
605
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
606
|
+
* );
|
|
607
|
+
* result.items.forEach((error) => {
|
|
608
|
+
* console.log(`${error.type}: ${error.description} (count=${error.count})`);
|
|
609
|
+
* });
|
|
610
|
+
*
|
|
611
|
+
* // Paginated — sorted by execution count descending
|
|
612
|
+
* const page = await agents.getErrors(
|
|
613
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
614
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
615
|
+
* {
|
|
616
|
+
* pageSize: 25,
|
|
617
|
+
* orderBy: { column: AgentErrorSortColumn.ExecutionCount, desc: true },
|
|
618
|
+
* },
|
|
619
|
+
* );
|
|
620
|
+
*
|
|
621
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
622
|
+
* const next = await agents.getErrors(
|
|
623
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
624
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
625
|
+
* { cursor: page.nextCursor },
|
|
626
|
+
* );
|
|
627
|
+
* }
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
getErrors<T extends AgentGetErrorsOptions = AgentGetErrorsOptions>(startTime: Date, endTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentError> : NonPaginatedResponse<AgentError>>;
|
|
631
|
+
/**
|
|
632
|
+
* Retrieves a time-series of error counts grouped by agent over the requested window.
|
|
633
|
+
*
|
|
634
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
635
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
636
|
+
* @param options - Optional filters
|
|
637
|
+
* @returns Promise resolving to an array of {@link AgentGetErrorsTimelineResponse}
|
|
638
|
+
* @example
|
|
639
|
+
* ```typescript
|
|
640
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
641
|
+
*
|
|
642
|
+
* const agents = new Agents(sdk);
|
|
643
|
+
*
|
|
644
|
+
* // All errors in May 2025
|
|
645
|
+
* const result = await agents.getErrorsTimeline(
|
|
646
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
647
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
648
|
+
* );
|
|
649
|
+
* result.forEach((point) => {
|
|
650
|
+
* console.log(`${point.date} ${point.name}: ${point.value} errors`);
|
|
651
|
+
* });
|
|
652
|
+
* ```
|
|
653
|
+
* @example
|
|
654
|
+
* ```typescript
|
|
655
|
+
* // Scope to specific folders and top 5 agents
|
|
656
|
+
* const result = await agents.getErrorsTimeline(
|
|
657
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
658
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
659
|
+
* {
|
|
660
|
+
* folderKeys: ['<folderKey1>'],
|
|
661
|
+
* agentNames: ['JokeAgent', 'StoryAgent'],
|
|
662
|
+
* limit: 5,
|
|
663
|
+
* },
|
|
664
|
+
* );
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
getErrorsTimeline(startTime: Date, endTime: Date, options?: AgentGetErrorsTimelineOptions): Promise<AgentGetErrorsTimelineResponse[]>;
|
|
668
|
+
/**
|
|
669
|
+
* Retrieves a time-series of AGU (Agent Units) consumption over the requested window.
|
|
670
|
+
*
|
|
671
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
672
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
673
|
+
* @param options - Optional filters
|
|
674
|
+
* @returns Promise resolving to an array of {@link AgentGetConsumptionTimelineResponse}
|
|
675
|
+
* @example
|
|
676
|
+
* ```typescript
|
|
677
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
678
|
+
*
|
|
679
|
+
* const agents = new Agents(sdk);
|
|
680
|
+
*
|
|
681
|
+
* // AGU consumption timeline in May 2025
|
|
682
|
+
* const result = await agents.getConsumptionTimeline(
|
|
683
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
684
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
685
|
+
* );
|
|
686
|
+
* result.forEach((point) => {
|
|
687
|
+
* console.log(`${point.timeSlice}: ${point.aguConsumption} AGU`);
|
|
688
|
+
* });
|
|
689
|
+
* ```
|
|
690
|
+
* @example
|
|
691
|
+
* ```typescript
|
|
692
|
+
* // Scope to specific folders and agents
|
|
693
|
+
* const result = await agents.getConsumptionTimeline(
|
|
694
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
695
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
696
|
+
* {
|
|
697
|
+
* folderKeys: ['<folderKey1>'],
|
|
698
|
+
* agentNames: ['JokeAgent'],
|
|
699
|
+
* },
|
|
700
|
+
* );
|
|
701
|
+
* ```
|
|
702
|
+
*/
|
|
703
|
+
getConsumptionTimeline(startTime: Date, endTime: Date, options?: AgentGetConsumptionTimelineOptions): Promise<AgentGetConsumptionTimelineResponse[]>;
|
|
704
|
+
/**
|
|
705
|
+
* Retrieves a time-series of agent latency (milliseconds) over the requested
|
|
706
|
+
* window.
|
|
707
|
+
*
|
|
708
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
709
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
710
|
+
* @param options - Optional filters
|
|
711
|
+
* @returns Promise resolving to an array of {@link AgentGetLatencyTimelineResponse}
|
|
712
|
+
* @example
|
|
713
|
+
* ```typescript
|
|
714
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
715
|
+
*
|
|
716
|
+
* const agents = new Agents(sdk);
|
|
717
|
+
*
|
|
718
|
+
* // Latency timeline in May 2025
|
|
719
|
+
* const result = await agents.getLatencyTimeline(
|
|
720
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
721
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
722
|
+
* );
|
|
723
|
+
* result.forEach((point) => {
|
|
724
|
+
* console.log(`${point.date} ${point.name}: ${point.value} ms`);
|
|
725
|
+
* });
|
|
726
|
+
* ```
|
|
727
|
+
* @example
|
|
728
|
+
* ```typescript
|
|
729
|
+
* // Scope to specific folders and a single agent
|
|
730
|
+
* const result = await agents.getLatencyTimeline(
|
|
731
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
732
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
733
|
+
* {
|
|
734
|
+
* folderKeys: ['<folderKey1>'],
|
|
735
|
+
* agentId: '<agentId>',
|
|
736
|
+
* },
|
|
737
|
+
* );
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
getLatencyTimeline(startTime: Date, endTime: Date, options?: AgentGetLatencyTimelineOptions): Promise<AgentGetLatencyTimelineResponse[]>;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Service for interacting with the UiPath Agents API.
|
|
745
|
+
*/
|
|
746
|
+
declare class AgentService extends BaseService implements AgentServiceModel {
|
|
747
|
+
/**
|
|
748
|
+
* Retrieves the list of agents on the tenant with consumption and health
|
|
749
|
+
* metadata over the requested window.
|
|
750
|
+
*
|
|
751
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
752
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
753
|
+
* {@link NonPaginatedResponse}.
|
|
754
|
+
*
|
|
755
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
756
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
757
|
+
* @param options - Optional pagination, sort, and filters
|
|
758
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentListItem}
|
|
759
|
+
* @example
|
|
760
|
+
* ```typescript
|
|
761
|
+
* import { Agents, AgentListSortColumn } from '@uipath/uipath-typescript/agents';
|
|
762
|
+
*
|
|
763
|
+
* const agents = new Agents(sdk);
|
|
764
|
+
*
|
|
765
|
+
* // Non-paginated — returns the server default page
|
|
766
|
+
* const result = await agents.getAll(
|
|
767
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
768
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
769
|
+
* );
|
|
770
|
+
* result.items.forEach((agent) => {
|
|
771
|
+
* console.log(`${agent.agentName} — ${agent.unitsQuantity} units, health=${agent.healthScore}`);
|
|
772
|
+
* });
|
|
773
|
+
*
|
|
774
|
+
* // Paginated — sorted by health score descending
|
|
775
|
+
* const page = await agents.getAll(
|
|
776
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
777
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
778
|
+
* {
|
|
779
|
+
* pageSize: 25,
|
|
780
|
+
* orderBy: { column: AgentListSortColumn.HealthScore, desc: true },
|
|
781
|
+
* folderKeys: ['<folderKey1>'],
|
|
782
|
+
* },
|
|
783
|
+
* );
|
|
784
|
+
*
|
|
785
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
786
|
+
* const next = await agents.getAll(
|
|
787
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
788
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
789
|
+
* { cursor: page.nextCursor },
|
|
790
|
+
* );
|
|
791
|
+
* }
|
|
792
|
+
* ```
|
|
793
|
+
*/
|
|
794
|
+
getAll<T extends AgentGetAllOptions = AgentGetAllOptions>(startTime: Date, endTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentListItem> : NonPaginatedResponse<AgentListItem>>;
|
|
795
|
+
/**
|
|
796
|
+
* Retrieves agent errors (error-classes observed for agents) over the
|
|
797
|
+
* requested window.
|
|
798
|
+
*
|
|
799
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
800
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
801
|
+
* {@link NonPaginatedResponse}.
|
|
802
|
+
*
|
|
803
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
804
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
805
|
+
* @param options - Optional pagination, sort/group, and filters
|
|
806
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentError}
|
|
807
|
+
* @example
|
|
808
|
+
* ```typescript
|
|
809
|
+
* import { Agents, AgentErrorSortColumn } from '@uipath/uipath-typescript/agents';
|
|
810
|
+
*
|
|
811
|
+
* const agents = new Agents(sdk);
|
|
812
|
+
*
|
|
813
|
+
* // Non-paginated — errors in the window
|
|
814
|
+
* const result = await agents.getErrors(
|
|
815
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
816
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
817
|
+
* );
|
|
818
|
+
* result.items.forEach((error) => {
|
|
819
|
+
* console.log(`${error.type}: ${error.description} (count=${error.count})`);
|
|
820
|
+
* });
|
|
821
|
+
*
|
|
822
|
+
* // Paginated — sorted by execution count descending
|
|
823
|
+
* const page = await agents.getErrors(
|
|
824
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
825
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
826
|
+
* {
|
|
827
|
+
* pageSize: 25,
|
|
828
|
+
* orderBy: { column: AgentErrorSortColumn.ExecutionCount, desc: true },
|
|
829
|
+
* },
|
|
830
|
+
* );
|
|
831
|
+
*
|
|
832
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
833
|
+
* const next = await agents.getErrors(
|
|
834
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
835
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
836
|
+
* { cursor: page.nextCursor },
|
|
837
|
+
* );
|
|
838
|
+
* }
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
841
|
+
getErrors<T extends AgentGetErrorsOptions = AgentGetErrorsOptions>(startTime: Date, endTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentError> : NonPaginatedResponse<AgentError>>;
|
|
842
|
+
/**
|
|
843
|
+
* Retrieves a time-series of error counts grouped by agent over the requested window.
|
|
844
|
+
*
|
|
845
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
846
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
847
|
+
* @param options - Optional filters
|
|
848
|
+
* @returns Promise resolving to an array of {@link AgentGetErrorsTimelineResponse}
|
|
849
|
+
* @example
|
|
850
|
+
* ```typescript
|
|
851
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
852
|
+
*
|
|
853
|
+
* const agents = new Agents(sdk);
|
|
854
|
+
*
|
|
855
|
+
* // All errors in May 2025
|
|
856
|
+
* const result = await agents.getErrorsTimeline(
|
|
857
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
858
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
859
|
+
* );
|
|
860
|
+
* result.forEach((point) => {
|
|
861
|
+
* console.log(`${point.date} ${point.name}: ${point.value} errors`);
|
|
862
|
+
* });
|
|
863
|
+
* ```
|
|
864
|
+
* @example
|
|
865
|
+
* ```typescript
|
|
866
|
+
* // Scope to specific folders and top 5 agents
|
|
867
|
+
* const result = await agents.getErrorsTimeline(
|
|
868
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
869
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
870
|
+
* {
|
|
871
|
+
* folderKeys: ['<folderKey1>'],
|
|
872
|
+
* agentNames: ['JokeAgent', 'StoryAgent'],
|
|
873
|
+
* limit: 5,
|
|
874
|
+
* },
|
|
875
|
+
* );
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
getErrorsTimeline(startTime: Date, endTime: Date, options?: AgentGetErrorsTimelineOptions): Promise<AgentGetErrorsTimelineResponse[]>;
|
|
879
|
+
/**
|
|
880
|
+
* Retrieves a time-series of AGU (Agent Units) consumption over the requested window.
|
|
881
|
+
*
|
|
882
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
883
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
884
|
+
* @param options - Optional filters
|
|
885
|
+
* @returns Promise resolving to an array of {@link AgentGetConsumptionTimelineResponse}
|
|
886
|
+
* @example
|
|
887
|
+
* ```typescript
|
|
888
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
889
|
+
*
|
|
890
|
+
* const agents = new Agents(sdk);
|
|
891
|
+
*
|
|
892
|
+
* // AGU consumption timeline in May 2025
|
|
893
|
+
* const result = await agents.getConsumptionTimeline(
|
|
894
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
895
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
896
|
+
* );
|
|
897
|
+
* result.forEach((point) => {
|
|
898
|
+
* console.log(`${point.timeSlice}: ${point.aguConsumption} AGU`);
|
|
899
|
+
* });
|
|
900
|
+
* ```
|
|
901
|
+
* @example
|
|
902
|
+
* ```typescript
|
|
903
|
+
* // Scope to specific folders and agents
|
|
904
|
+
* const result = await agents.getConsumptionTimeline(
|
|
905
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
906
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
907
|
+
* {
|
|
908
|
+
* folderKeys: ['<folderKey1>'],
|
|
909
|
+
* agentNames: ['JokeAgent'],
|
|
910
|
+
* },
|
|
911
|
+
* );
|
|
912
|
+
* ```
|
|
913
|
+
*/
|
|
914
|
+
getConsumptionTimeline(startTime: Date, endTime: Date, options?: AgentGetConsumptionTimelineOptions): Promise<AgentGetConsumptionTimelineResponse[]>;
|
|
915
|
+
/**
|
|
916
|
+
* Retrieves a time-series of agent latency (milliseconds) over the requested
|
|
917
|
+
* window.
|
|
918
|
+
*
|
|
919
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
920
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
921
|
+
* @param options - Optional filters
|
|
922
|
+
* @returns Promise resolving to an array of {@link AgentGetLatencyTimelineResponse}
|
|
923
|
+
* @example
|
|
924
|
+
* ```typescript
|
|
925
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
926
|
+
*
|
|
927
|
+
* const agents = new Agents(sdk);
|
|
928
|
+
*
|
|
929
|
+
* // Latency timeline in May 2025
|
|
930
|
+
* const result = await agents.getLatencyTimeline(
|
|
931
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
932
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
933
|
+
* );
|
|
934
|
+
* result.forEach((point) => {
|
|
935
|
+
* console.log(`${point.date} ${point.name}: ${point.value} ms`);
|
|
936
|
+
* });
|
|
937
|
+
* ```
|
|
938
|
+
* @example
|
|
939
|
+
* ```typescript
|
|
940
|
+
* // Scope to specific folders and a single agent
|
|
941
|
+
* const result = await agents.getLatencyTimeline(
|
|
942
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
943
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
944
|
+
* {
|
|
945
|
+
* folderKeys: ['<folderKey1>'],
|
|
946
|
+
* agentId: '<agentId>',
|
|
947
|
+
* },
|
|
948
|
+
* );
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
951
|
+
getLatencyTimeline(startTime: Date, endTime: Date, options?: AgentGetLatencyTimelineOptions): Promise<AgentGetLatencyTimelineResponse[]>;
|
|
952
|
+
/**
|
|
953
|
+
* Builds the common POST request body shared by the agent filter endpoints —
|
|
954
|
+
* the required time window plus any optional folder/agent/project/process
|
|
955
|
+
* filters. Undefined options are omitted so the server applies its defaults.
|
|
956
|
+
*/
|
|
957
|
+
private buildAgentFilterBody;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
export { AgentErrorSortColumn, AgentListSortColumn, AgentService as Agents };
|
|
961
|
+
export type { AgentError, AgentErrorOrderBy, AgentFilterOptions, AgentGetAllOptions, AgentGetConsumptionTimelineOptions, AgentGetConsumptionTimelineResponse, AgentGetErrorsOptions, AgentGetErrorsTimelineOptions, AgentGetErrorsTimelineResponse, AgentGetLatencyTimelineOptions, AgentGetLatencyTimelineResponse, AgentJobInfo, AgentListItem, AgentListOrderBy, AgentServiceModel };
|