@uipath/uipath-typescript 1.3.11 → 1.4.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/dist/agent-memory/index.cjs +1765 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1763 -0
- package/dist/agents/index.cjs +1726 -0
- package/dist/agents/index.d.ts +502 -0
- package/dist/agents/index.mjs +1724 -0
- package/dist/assets/index.cjs +155 -30
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +155 -30
- package/dist/attachments/index.cjs +37 -6
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +37 -6
- package/dist/buckets/index.cjs +37 -6
- package/dist/buckets/index.d.ts +1 -0
- package/dist/buckets/index.mjs +37 -6
- package/dist/cases/index.cjs +141 -10
- package/dist/cases/index.d.ts +118 -7
- package/dist/cases/index.mjs +141 -11
- package/dist/conversational-agent/index.cjs +124 -57
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +124 -57
- package/dist/core/index.cjs +413 -105
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +413 -105
- package/dist/entities/index.cjs +122 -43
- package/dist/entities/index.d.ts +140 -35
- package/dist/entities/index.mjs +122 -43
- package/dist/feedback/index.cjs +37 -6
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +37 -6
- package/dist/governance/index.cjs +1782 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1780 -0
- package/dist/index.cjs +956 -283
- package/dist/index.d.ts +1138 -121
- package/dist/index.mjs +956 -284
- package/dist/index.umd.js +3113 -2423
- package/dist/jobs/index.cjs +37 -6
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +37 -6
- package/dist/maestro-processes/index.cjs +173 -18
- package/dist/maestro-processes/index.d.ts +131 -9
- package/dist/maestro-processes/index.mjs +173 -18
- package/dist/processes/index.cjs +37 -6
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +37 -6
- package/dist/queues/index.cjs +37 -6
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +37 -6
- package/dist/tasks/index.cjs +37 -6
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.mjs +37 -6
- package/dist/traces/index.cjs +37 -6
- package/dist/traces/index.d.ts +1 -0
- package/dist/traces/index.mjs +37 -6
- package/package.json +32 -2
|
@@ -0,0 +1,502 @@
|
|
|
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 {@link AgentServiceModel.getAll}.
|
|
382
|
+
*
|
|
383
|
+
* Composes filter, pagination, and sort options.
|
|
384
|
+
*/
|
|
385
|
+
type AgentListOptions = AgentFilterOptions & PaginationOptions & {
|
|
386
|
+
/** Sort order for the result set. */
|
|
387
|
+
orderBy?: AgentListOrderBy;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Service for retrieving runtime data for UiPath Agents.
|
|
392
|
+
*
|
|
393
|
+
* See [About Agents](https://docs.uipath.com/agents/automation-cloud/latest/user-guide/about-agents)
|
|
394
|
+
* for an overview of UiPath Agents.
|
|
395
|
+
*/
|
|
396
|
+
interface AgentServiceModel {
|
|
397
|
+
/**
|
|
398
|
+
* Retrieves the list of agents on the tenant with consumption and health
|
|
399
|
+
* metadata over the requested window.
|
|
400
|
+
*
|
|
401
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
402
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
403
|
+
* {@link NonPaginatedResponse}.
|
|
404
|
+
*
|
|
405
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
406
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
407
|
+
* @param options - Optional pagination, sort, and filters
|
|
408
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentListItem}
|
|
409
|
+
* @example
|
|
410
|
+
* ```typescript
|
|
411
|
+
* import { Agents, AgentListSortColumn } from '@uipath/uipath-typescript/agents';
|
|
412
|
+
*
|
|
413
|
+
* const agents = new Agents(sdk);
|
|
414
|
+
*
|
|
415
|
+
* // Non-paginated — returns the server default page
|
|
416
|
+
* const result = await agents.getAll(
|
|
417
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
418
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
419
|
+
* );
|
|
420
|
+
* result.items.forEach((agent) => {
|
|
421
|
+
* console.log(`${agent.agentName} — ${agent.unitsQuantity} units, health=${agent.healthScore}`);
|
|
422
|
+
* });
|
|
423
|
+
*
|
|
424
|
+
* // Paginated — sorted by health score descending
|
|
425
|
+
* const page = await agents.getAll(
|
|
426
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
427
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
428
|
+
* {
|
|
429
|
+
* pageSize: 25,
|
|
430
|
+
* orderBy: { column: AgentListSortColumn.HealthScore, desc: true },
|
|
431
|
+
* folderKeys: ['<folderKey1>'],
|
|
432
|
+
* },
|
|
433
|
+
* );
|
|
434
|
+
*
|
|
435
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
436
|
+
* const next = await agents.getAll(
|
|
437
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
438
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
439
|
+
* { cursor: page.nextCursor },
|
|
440
|
+
* );
|
|
441
|
+
* }
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
getAll<T extends AgentListOptions = AgentListOptions>(startTime: Date, endTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentListItem> : NonPaginatedResponse<AgentListItem>>;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Service for interacting with the UiPath Agents API.
|
|
449
|
+
*/
|
|
450
|
+
declare class AgentService extends BaseService implements AgentServiceModel {
|
|
451
|
+
/**
|
|
452
|
+
* Retrieves the list of agents on the tenant with consumption and health
|
|
453
|
+
* metadata over the requested window.
|
|
454
|
+
*
|
|
455
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
456
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
457
|
+
* {@link NonPaginatedResponse}.
|
|
458
|
+
*
|
|
459
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
460
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
461
|
+
* @param options - Optional pagination, sort, and filters
|
|
462
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentListItem}
|
|
463
|
+
* @example
|
|
464
|
+
* ```typescript
|
|
465
|
+
* import { Agents, AgentListSortColumn } from '@uipath/uipath-typescript/agents';
|
|
466
|
+
*
|
|
467
|
+
* const agents = new Agents(sdk);
|
|
468
|
+
*
|
|
469
|
+
* // Non-paginated — returns the server default page
|
|
470
|
+
* const result = await agents.getAll(
|
|
471
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
472
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
473
|
+
* );
|
|
474
|
+
* result.items.forEach((agent) => {
|
|
475
|
+
* console.log(`${agent.agentName} — ${agent.unitsQuantity} units, health=${agent.healthScore}`);
|
|
476
|
+
* });
|
|
477
|
+
*
|
|
478
|
+
* // Paginated — sorted by health score descending
|
|
479
|
+
* const page = await agents.getAll(
|
|
480
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
481
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
482
|
+
* {
|
|
483
|
+
* pageSize: 25,
|
|
484
|
+
* orderBy: { column: AgentListSortColumn.HealthScore, desc: true },
|
|
485
|
+
* folderKeys: ['<folderKey1>'],
|
|
486
|
+
* },
|
|
487
|
+
* );
|
|
488
|
+
*
|
|
489
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
490
|
+
* const next = await agents.getAll(
|
|
491
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
492
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
493
|
+
* { cursor: page.nextCursor },
|
|
494
|
+
* );
|
|
495
|
+
* }
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
getAll<T extends AgentListOptions = AgentListOptions>(startTime: Date, endTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentListItem> : NonPaginatedResponse<AgentListItem>>;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export { AgentListSortColumn, AgentService as Agents };
|
|
502
|
+
export type { AgentFilterOptions, AgentListItem, AgentListOptions, AgentListOrderBy, AgentServiceModel };
|