@uipath/uipath-typescript 1.3.9 → 1.3.11
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 +19 -6
- package/dist/assets/index.mjs +19 -6
- package/dist/attachments/index.cjs +19 -6
- package/dist/attachments/index.mjs +19 -6
- package/dist/buckets/index.cjs +141 -6
- package/dist/buckets/index.d.ts +164 -1
- package/dist/buckets/index.mjs +141 -6
- package/dist/cases/index.cjs +70 -6
- package/dist/cases/index.d.ts +91 -1
- package/dist/cases/index.mjs +70 -6
- package/dist/conversational-agent/index.cjs +19 -6
- package/dist/conversational-agent/index.mjs +19 -6
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +239 -34
- package/dist/entities/index.d.ts +311 -12
- package/dist/entities/index.mjs +239 -34
- package/dist/feedback/index.cjs +19 -6
- package/dist/feedback/index.mjs +19 -6
- package/dist/index.cjs +490 -64
- package/dist/index.d.ts +714 -36
- package/dist/index.mjs +490 -64
- package/dist/index.umd.js +491 -65
- package/dist/jobs/index.cjs +19 -6
- package/dist/jobs/index.mjs +19 -6
- package/dist/maestro-processes/index.cjs +70 -6
- package/dist/maestro-processes/index.d.ts +91 -1
- package/dist/maestro-processes/index.mjs +70 -6
- package/dist/processes/index.cjs +47 -35
- package/dist/processes/index.d.ts +76 -26
- package/dist/processes/index.mjs +47 -35
- package/dist/queues/index.cjs +19 -6
- package/dist/queues/index.mjs +19 -6
- package/dist/tasks/index.cjs +19 -6
- package/dist/tasks/index.mjs +19 -6
- package/dist/traces/index.cjs +1902 -0
- package/dist/traces/index.d.ts +565 -0
- package/dist/traces/index.mjs +1900 -0
- package/package.json +12 -2
|
@@ -0,0 +1,565 @@
|
|
|
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
|
+
/**
|
|
54
|
+
* Pagination types supported by the SDK
|
|
55
|
+
*/
|
|
56
|
+
declare enum PaginationType {
|
|
57
|
+
OFFSET = "offset",
|
|
58
|
+
TOKEN = "token"
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Interface for service access methods needed by pagination helpers
|
|
62
|
+
*/
|
|
63
|
+
interface PaginationServiceAccess {
|
|
64
|
+
get<T>(path: string, options?: any): Promise<{
|
|
65
|
+
data: T;
|
|
66
|
+
}>;
|
|
67
|
+
post<T>(path: string, body?: any, options?: any): Promise<{
|
|
68
|
+
data: T;
|
|
69
|
+
}>;
|
|
70
|
+
requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Field names for extracting data from paginated responses.
|
|
74
|
+
*/
|
|
75
|
+
interface PaginationFieldNames {
|
|
76
|
+
itemsField?: string;
|
|
77
|
+
totalCountField?: string;
|
|
78
|
+
continuationTokenField?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Options for the requestWithPagination method in BaseService.
|
|
82
|
+
*/
|
|
83
|
+
interface RequestWithPaginationOptions extends RequestSpec {
|
|
84
|
+
pagination: PaginationFieldNames & {
|
|
85
|
+
paginationType: PaginationType;
|
|
86
|
+
paginationParams?: {
|
|
87
|
+
pageSizeParam?: string;
|
|
88
|
+
offsetParam?: string;
|
|
89
|
+
tokenParam?: string;
|
|
90
|
+
countParam?: string;
|
|
91
|
+
convertToSkip?: boolean;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* HTTP methods supported by the API client
|
|
98
|
+
*/
|
|
99
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
100
|
+
/**
|
|
101
|
+
* Supported response types for API requests
|
|
102
|
+
*/
|
|
103
|
+
type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream';
|
|
104
|
+
/**
|
|
105
|
+
* Query parameters type with support for arrays and nested objects
|
|
106
|
+
*/
|
|
107
|
+
type QueryParams = Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* Standard HTTP headers type
|
|
110
|
+
*/
|
|
111
|
+
type Headers = Record<string, string>;
|
|
112
|
+
/**
|
|
113
|
+
* Options for request retries
|
|
114
|
+
*/
|
|
115
|
+
interface RetryOptions {
|
|
116
|
+
/** Maximum number of retry attempts */
|
|
117
|
+
maxRetries?: number;
|
|
118
|
+
/** Base delay between retries in milliseconds */
|
|
119
|
+
retryDelay?: number;
|
|
120
|
+
/** Whether to use exponential backoff */
|
|
121
|
+
useExponentialBackoff?: boolean;
|
|
122
|
+
/** Status codes that should trigger a retry */
|
|
123
|
+
retryableStatusCodes?: number[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Options for request timeouts
|
|
127
|
+
*/
|
|
128
|
+
interface TimeoutOptions {
|
|
129
|
+
/** Request timeout in milliseconds */
|
|
130
|
+
timeout?: number;
|
|
131
|
+
/** Whether to abort the request on timeout */
|
|
132
|
+
abortOnTimeout?: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Options for request body transformation
|
|
136
|
+
*/
|
|
137
|
+
interface BodyOptions {
|
|
138
|
+
/** Whether to stringify the body */
|
|
139
|
+
stringify?: boolean;
|
|
140
|
+
/** Content type override */
|
|
141
|
+
contentType?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Pagination metadata for API requests
|
|
145
|
+
*/
|
|
146
|
+
interface PaginationMetadata {
|
|
147
|
+
/** Type of pagination used by the API endpoint */
|
|
148
|
+
paginationType: PaginationType;
|
|
149
|
+
/** Response field containing items array (defaults to 'value') */
|
|
150
|
+
itemsField?: string;
|
|
151
|
+
/** Response field containing total count (defaults to '@odata.count') */
|
|
152
|
+
totalCountField?: string;
|
|
153
|
+
/** Response field containing continuation token (defaults to 'continuationToken') */
|
|
154
|
+
continuationTokenField?: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Base interface for all API requests
|
|
158
|
+
*/
|
|
159
|
+
interface RequestSpec {
|
|
160
|
+
/** HTTP method for the request */
|
|
161
|
+
method?: HttpMethod;
|
|
162
|
+
/** URL endpoint for the request */
|
|
163
|
+
url?: string;
|
|
164
|
+
/** Query parameters to be appended to the URL */
|
|
165
|
+
params?: QueryParams;
|
|
166
|
+
/** HTTP headers to include with the request */
|
|
167
|
+
headers?: Headers;
|
|
168
|
+
/** Raw body content (takes precedence over data) */
|
|
169
|
+
body?: unknown;
|
|
170
|
+
/** Expected response type */
|
|
171
|
+
responseType?: ResponseType;
|
|
172
|
+
/** Request timeout options */
|
|
173
|
+
timeoutOptions?: TimeoutOptions;
|
|
174
|
+
/** Retry behavior options */
|
|
175
|
+
retryOptions?: RetryOptions;
|
|
176
|
+
/** Body transformation options */
|
|
177
|
+
bodyOptions?: BodyOptions;
|
|
178
|
+
/** AbortSignal for cancelling the request */
|
|
179
|
+
signal?: AbortSignal;
|
|
180
|
+
/** Pagination metadata for the request */
|
|
181
|
+
pagination?: PaginationMetadata;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
interface ApiResponse<T> {
|
|
185
|
+
data: T;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Base class for all UiPath SDK services.
|
|
189
|
+
*
|
|
190
|
+
* Provides common functionality for authentication, configuration, and API communication.
|
|
191
|
+
* All service classes extend this base to inherit dependency injection and HTTP client access.
|
|
192
|
+
*
|
|
193
|
+
* This class implements the dependency injection pattern where services receive a configured
|
|
194
|
+
* UiPath instance. The ApiClient is created internally and handles all HTTP operations
|
|
195
|
+
* including authentication token management.
|
|
196
|
+
*
|
|
197
|
+
* @remarks
|
|
198
|
+
* Service classes should extend this base and call `super(uiPath)` in their constructor.
|
|
199
|
+
* Protected HTTP methods (get, post, put, patch, delete) are available to all subclasses.
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
declare class BaseService {
|
|
203
|
+
#private;
|
|
204
|
+
/**
|
|
205
|
+
* SDK configuration (read-only). Available to subclasses so they can
|
|
206
|
+
* fall back to init-time defaults like `folderKey`.
|
|
207
|
+
*/
|
|
208
|
+
protected readonly config: {
|
|
209
|
+
folderKey?: string;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Creates a base service instance with dependency injection.
|
|
213
|
+
*
|
|
214
|
+
* Extracts configuration, execution context, and token manager from the UiPath instance
|
|
215
|
+
* to initialize an authenticated API client. The ApiClient handles all HTTP operations
|
|
216
|
+
* and token management internally.
|
|
217
|
+
*
|
|
218
|
+
* @param instance - UiPath SDK instance providing authentication and configuration.
|
|
219
|
+
* Services receive this via dependency injection in the modular pattern.
|
|
220
|
+
* @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for
|
|
221
|
+
* CAS external-app auth)
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* // Services automatically call this via super()
|
|
226
|
+
* export class EntityService extends BaseService {
|
|
227
|
+
* constructor(instance: IUiPath) {
|
|
228
|
+
* super(instance); // Initializes the internal ApiClient
|
|
229
|
+
* }
|
|
230
|
+
* }
|
|
231
|
+
*
|
|
232
|
+
* // Usage in modular pattern
|
|
233
|
+
* import { UiPath } from '@uipath/uipath-typescript/core';
|
|
234
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
235
|
+
*
|
|
236
|
+
* const sdk = new UiPath(config);
|
|
237
|
+
* await sdk.initialize();
|
|
238
|
+
* const entities = new Entities(sdk);
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
constructor(instance: IUiPath, headers?: Record<string, string>);
|
|
242
|
+
/**
|
|
243
|
+
* Gets a valid authentication token, refreshing if necessary.
|
|
244
|
+
* Use this when you need to manually add Authorization headers (e.g., direct uploads).
|
|
245
|
+
*
|
|
246
|
+
* @returns Promise resolving to a valid access token string
|
|
247
|
+
* @throws AuthenticationError if no token is available or refresh fails
|
|
248
|
+
*/
|
|
249
|
+
protected getValidAuthToken(): Promise<string>;
|
|
250
|
+
/**
|
|
251
|
+
* Creates a service accessor for pagination helpers
|
|
252
|
+
* This allows pagination helpers to access protected methods without making them public
|
|
253
|
+
*/
|
|
254
|
+
protected createPaginationServiceAccess(): PaginationServiceAccess;
|
|
255
|
+
protected request<T>(method: string, path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
256
|
+
protected requestWithSpec<T>(spec: RequestSpec): Promise<ApiResponse<T>>;
|
|
257
|
+
protected get<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
258
|
+
protected post<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
259
|
+
protected put<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
260
|
+
protected patch<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
261
|
+
protected delete<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
262
|
+
/**
|
|
263
|
+
* Execute a request with cursor-based pagination
|
|
264
|
+
*/
|
|
265
|
+
protected requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
266
|
+
/**
|
|
267
|
+
* Validates and prepares pagination parameters from options
|
|
268
|
+
*/
|
|
269
|
+
private validateAndPreparePaginationParams;
|
|
270
|
+
/**
|
|
271
|
+
* Prepares request parameters for pagination based on pagination type
|
|
272
|
+
*/
|
|
273
|
+
private preparePaginationRequestParams;
|
|
274
|
+
/**
|
|
275
|
+
* Creates a paginated response from API response
|
|
276
|
+
*/
|
|
277
|
+
private createPaginatedResponseFromResponse;
|
|
278
|
+
/**
|
|
279
|
+
* Determines if there are more pages based on pagination type and metadata
|
|
280
|
+
*/
|
|
281
|
+
private determineHasMorePages;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Status of a span: whether it completed successfully, with an error, or was not set. */
|
|
285
|
+
declare enum SpanStatus {
|
|
286
|
+
Unset = "Unset",
|
|
287
|
+
Ok = "Ok",
|
|
288
|
+
Error = "Error",
|
|
289
|
+
/** Span is still in progress. */
|
|
290
|
+
Running = "Running",
|
|
291
|
+
/** Span data is hidden from the caller due to tenant/folder permission rules. */
|
|
292
|
+
Restricted = "Restricted",
|
|
293
|
+
/** Span was cancelled before completion. */
|
|
294
|
+
Cancelled = "Cancelled"
|
|
295
|
+
}
|
|
296
|
+
/** Platform source that produced the span. */
|
|
297
|
+
declare enum SpanSource {
|
|
298
|
+
Testing = "Testing",
|
|
299
|
+
Agents = "Agents",
|
|
300
|
+
ProcessOrchestration = "ProcessOrchestration",
|
|
301
|
+
ApiWorkflows = "ApiWorkflows",
|
|
302
|
+
Robots = "Robots",
|
|
303
|
+
ConversationalAgentsService = "ConversationalAgentsService",
|
|
304
|
+
IntegrationServiceTrigger = "IntegrationServiceTrigger",
|
|
305
|
+
Playground = "Playground",
|
|
306
|
+
Governance = "Governance",
|
|
307
|
+
/** Intelligent Experience Platform — unstructured and complex document processing source. */
|
|
308
|
+
IXPUnstructuredAndComplexDocuments = "IXPUnstructuredAndComplexDocuments",
|
|
309
|
+
/** Agents authored in code (as opposed to visual/no-code designers). */
|
|
310
|
+
CodedAgents = "CodedAgents",
|
|
311
|
+
/** Intelligent Experience Platform — communications mining source. */
|
|
312
|
+
IXPCommunicationsMining = "IXPCommunicationsMining",
|
|
313
|
+
/** UiPath Context Grounding — span produced by the Enterprise Context Service for RAG/knowledge-base operations. */
|
|
314
|
+
EnterpriseContextService = "EnterpriseContextService",
|
|
315
|
+
/** Model Context Protocol — span produced by an MCP server integration. */
|
|
316
|
+
MCP = "MCP",
|
|
317
|
+
/** Agent-to-Agent — span produced by an A2A protocol call between agents. */
|
|
318
|
+
A2A = "A2A",
|
|
319
|
+
/** Serverless — span produced by a serverless function execution. */
|
|
320
|
+
Serverless = "Serverless"
|
|
321
|
+
}
|
|
322
|
+
/** Minimum severity level of events captured in the span. */
|
|
323
|
+
declare enum SpanVerbosityLevel {
|
|
324
|
+
Verbose = "Verbose",
|
|
325
|
+
Trace = "Trace",
|
|
326
|
+
Information = "Information",
|
|
327
|
+
Warning = "Warning",
|
|
328
|
+
Error = "Error",
|
|
329
|
+
Critical = "Critical",
|
|
330
|
+
Off = "Off"
|
|
331
|
+
}
|
|
332
|
+
/** Whether the span was produced during a debug or production runtime. */
|
|
333
|
+
declare enum SpanExecutionType {
|
|
334
|
+
Debug = "Debug",
|
|
335
|
+
Runtime = "Runtime"
|
|
336
|
+
}
|
|
337
|
+
/** Whether the caller has permission to read this span's data. */
|
|
338
|
+
declare enum SpanPermissionStatus {
|
|
339
|
+
Allow = "Allow",
|
|
340
|
+
/** Some span fields are redacted due to permission constraints (e.g. attributes visible but payload hidden). */
|
|
341
|
+
PartialBlock = "PartialBlock",
|
|
342
|
+
Block = "Block"
|
|
343
|
+
}
|
|
344
|
+
/** Storage provider that created or manages the attachment. */
|
|
345
|
+
declare enum SpanAttachmentProvider {
|
|
346
|
+
Orchestrator = "Orchestrator",
|
|
347
|
+
/** Span attachment stored by the observability platform. */
|
|
348
|
+
LLMOps = "LLMOps"
|
|
349
|
+
}
|
|
350
|
+
/** Whether the attachment is an input, output, or neither. */
|
|
351
|
+
declare enum SpanAttachmentDirection {
|
|
352
|
+
None = "None",
|
|
353
|
+
In = "In",
|
|
354
|
+
Out = "Out"
|
|
355
|
+
}
|
|
356
|
+
/** One level in the reference hierarchy that produced this span. */
|
|
357
|
+
interface SpanReferenceHierarchyEntry {
|
|
358
|
+
serviceType: string;
|
|
359
|
+
referenceId: string;
|
|
360
|
+
version: string | null;
|
|
361
|
+
}
|
|
362
|
+
/** Contextual lineage attached to the span (reference hierarchy). */
|
|
363
|
+
interface SpanContext {
|
|
364
|
+
referenceHierarchy: SpanReferenceHierarchyEntry[];
|
|
365
|
+
}
|
|
366
|
+
/** File or payload attachment linked to the span. */
|
|
367
|
+
interface SpanAttachment {
|
|
368
|
+
provider: SpanAttachmentProvider;
|
|
369
|
+
id: string;
|
|
370
|
+
fileName: string;
|
|
371
|
+
mimeType: string;
|
|
372
|
+
direction: SpanAttachmentDirection;
|
|
373
|
+
}
|
|
374
|
+
/** A single execution span returned by the Traces API. */
|
|
375
|
+
interface SpanGetResponse {
|
|
376
|
+
/** Unique identifier of this span (GUID). */
|
|
377
|
+
id: string;
|
|
378
|
+
/** Trace this span belongs to (GUID). */
|
|
379
|
+
traceId: string;
|
|
380
|
+
/** Parent span ID, or null for root spans. */
|
|
381
|
+
parentId: string | null;
|
|
382
|
+
/** Human-readable name of the operation, or null if the span has no name. */
|
|
383
|
+
name: string | null;
|
|
384
|
+
/** ISO-8601 UTC timestamp when the span started. */
|
|
385
|
+
startTime: string;
|
|
386
|
+
/** ISO-8601 UTC timestamp when the span ended, or null if still running. */
|
|
387
|
+
endTime: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* Span attributes (user-defined schema — do not transform keys).
|
|
390
|
+
* Values depend on the span type and the agent that produced them.
|
|
391
|
+
*/
|
|
392
|
+
attributes: Record<string, unknown>;
|
|
393
|
+
/** Completion status of the span. */
|
|
394
|
+
status: SpanStatus;
|
|
395
|
+
/** Platform source that produced the span. */
|
|
396
|
+
source: SpanSource | null;
|
|
397
|
+
/** Span type tag (e.g. `"agentRun"`, `"llmCall"`). */
|
|
398
|
+
spanType: string | null;
|
|
399
|
+
/** Minimum verbosity level captured in this span. */
|
|
400
|
+
verbosityLevel: SpanVerbosityLevel | null;
|
|
401
|
+
/** Whether this span was from a debug or runtime execution. */
|
|
402
|
+
executionType: SpanExecutionType | null;
|
|
403
|
+
/** Folder key (GUID) scoping this span. */
|
|
404
|
+
folderKey: string | null;
|
|
405
|
+
/** Identifier of the entity (agent, process, etc.) that produced the span. */
|
|
406
|
+
referenceId: string | null;
|
|
407
|
+
/** Version of the entity that produced the span. */
|
|
408
|
+
referenceVersion: string | null;
|
|
409
|
+
/** Version of the agent runtime. */
|
|
410
|
+
agentVersion: string | null;
|
|
411
|
+
/** Organization (account) GUID. */
|
|
412
|
+
organizationId: string;
|
|
413
|
+
/** Tenant GUID. */
|
|
414
|
+
tenantId: string | null;
|
|
415
|
+
/** Key of the process associated with this span. */
|
|
416
|
+
processKey: string | null;
|
|
417
|
+
/** Key of the job associated with this span. */
|
|
418
|
+
jobKey: string | null;
|
|
419
|
+
/** ISO-8601 UTC timestamp of last update. */
|
|
420
|
+
updatedAt: string;
|
|
421
|
+
/** Expiry timestamp, or null if the span does not expire. */
|
|
422
|
+
expiredTime: string | null;
|
|
423
|
+
/** Reference hierarchy context for this span. */
|
|
424
|
+
context: SpanContext | null;
|
|
425
|
+
/** File or payload attachments linked to this span. */
|
|
426
|
+
attachments: SpanAttachment[] | null;
|
|
427
|
+
/** Whether the caller can read this span's data. */
|
|
428
|
+
permissionStatus: SpanPermissionStatus | null;
|
|
429
|
+
}
|
|
430
|
+
/** Options for retrieving all spans belonging to a trace. */
|
|
431
|
+
interface TracesGetByIdOptions {
|
|
432
|
+
/** Maximum number of spans to return. */
|
|
433
|
+
pageSize?: number;
|
|
434
|
+
/** Filter spans to those produced by a specific agent ID. */
|
|
435
|
+
agentId?: string;
|
|
436
|
+
/** When true, include expired spans that are outside the default retention window. */
|
|
437
|
+
includeExpiredSpans?: boolean;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Service for querying UiPath execution traces (spans).
|
|
442
|
+
*
|
|
443
|
+
* Traces are OpenTelemetry-compatible execution records generated by agents, robots,
|
|
444
|
+
* Maestro processes, conversational agents, and other UiPath execution sources.
|
|
445
|
+
* The `source` field on each {@link SpanGetResponse} identifies the originating platform.
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* import { UiPath } from '@uipath/uipath-typescript/core';
|
|
450
|
+
* import { Traces } from '@uipath/uipath-typescript/traces';
|
|
451
|
+
*
|
|
452
|
+
* const sdk = new UiPath(config);
|
|
453
|
+
* await sdk.initialize();
|
|
454
|
+
*
|
|
455
|
+
* const traces = new Traces(sdk);
|
|
456
|
+
* const spans = await traces.getById('<traceId>');
|
|
457
|
+
* ```
|
|
458
|
+
*/
|
|
459
|
+
interface TracesServiceModel {
|
|
460
|
+
/**
|
|
461
|
+
* Gets all spans for a specific trace ID.
|
|
462
|
+
*
|
|
463
|
+
* Returns up to `pageSize` spans (default 1000) in a single fetch.
|
|
464
|
+
* Accepts both GUID format and OTEL 32-char hex format — the API normalizes both.
|
|
465
|
+
*
|
|
466
|
+
* @param traceId - Trace identifier
|
|
467
|
+
* @param options - Optional filters {@link TracesGetByIdOptions}
|
|
468
|
+
* @returns Promise resolving to an array of {@link SpanGetResponse}, each containing span identity, timing, status, source platform, attributes, verbosity, execution type, lineage context, and any file attachments.
|
|
469
|
+
* @example
|
|
470
|
+
* ```typescript
|
|
471
|
+
* import { Traces } from '@uipath/uipath-typescript/traces';
|
|
472
|
+
*
|
|
473
|
+
* const traces = new Traces(sdk);
|
|
474
|
+
* const spans = await traces.getById('<traceId>');
|
|
475
|
+
* console.log(spans.length, spans[0].spanType, spans[0].status);
|
|
476
|
+
* ```
|
|
477
|
+
* @example
|
|
478
|
+
* ```typescript
|
|
479
|
+
* // Filter to a specific agent's spans
|
|
480
|
+
* const agentSpans = await traces.getById('<traceId>', {
|
|
481
|
+
* agentId: '<agentId>',
|
|
482
|
+
* pageSize: 500,
|
|
483
|
+
* });
|
|
484
|
+
* ```
|
|
485
|
+
*/
|
|
486
|
+
getById(traceId: string, options?: TracesGetByIdOptions): Promise<SpanGetResponse[]>;
|
|
487
|
+
/**
|
|
488
|
+
* Gets specific spans by trace ID and span IDs.
|
|
489
|
+
*
|
|
490
|
+
* Accepts OTEL 16-char hex or GUID format for span IDs.
|
|
491
|
+
*
|
|
492
|
+
* @param traceId - Trace identifier
|
|
493
|
+
* @param spanIds - List of span IDs to retrieve
|
|
494
|
+
* @returns Promise resolving to an array of matching {@link SpanGetResponse}, each containing span identity, timing, status, source platform, attributes, verbosity, execution type, lineage context, and any file attachments.
|
|
495
|
+
* @example
|
|
496
|
+
* ```typescript
|
|
497
|
+
* import { Traces } from '@uipath/uipath-typescript/traces';
|
|
498
|
+
*
|
|
499
|
+
* const traces = new Traces(sdk);
|
|
500
|
+
*
|
|
501
|
+
* // First retrieve all spans to find the IDs you want
|
|
502
|
+
* const allSpans = await traces.getById('<traceId>');
|
|
503
|
+
* const spanIds = allSpans.slice(0, 3).map(s => s.id);
|
|
504
|
+
*
|
|
505
|
+
* const subset = await traces.getSpansByIds('<traceId>', spanIds);
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
getSpansByIds(traceId: string, spanIds: string[]): Promise<SpanGetResponse[]>;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
declare class TracesService extends BaseService implements TracesServiceModel {
|
|
512
|
+
private transformOtelSpan;
|
|
513
|
+
/**
|
|
514
|
+
* Gets all spans for a specific trace ID.
|
|
515
|
+
*
|
|
516
|
+
* Returns up to `pageSize` spans (default 1000) in a single fetch.
|
|
517
|
+
* Accepts both GUID format and OTEL 32-char hex format — the API normalizes both.
|
|
518
|
+
*
|
|
519
|
+
* @param traceId - Trace identifier
|
|
520
|
+
* @param options - Optional filters {@link TracesGetByIdOptions}
|
|
521
|
+
* @returns Promise resolving to an array of {@link SpanGetResponse}, each containing span identity, timing, status, source platform, attributes, verbosity, execution type, lineage context, and any file attachments.
|
|
522
|
+
* @example
|
|
523
|
+
* ```typescript
|
|
524
|
+
* import { Traces } from '@uipath/uipath-typescript/traces';
|
|
525
|
+
*
|
|
526
|
+
* const traces = new Traces(sdk);
|
|
527
|
+
* const spans = await traces.getById('<traceId>');
|
|
528
|
+
* console.log(spans.length, spans[0].spanType, spans[0].status);
|
|
529
|
+
* ```
|
|
530
|
+
* @example
|
|
531
|
+
* ```typescript
|
|
532
|
+
* // Filter to a specific agent's spans
|
|
533
|
+
* const agentSpans = await traces.getById('<traceId>', {
|
|
534
|
+
* agentId: '<agentId>',
|
|
535
|
+
* pageSize: 500,
|
|
536
|
+
* });
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
getById(traceId: string, options?: TracesGetByIdOptions): Promise<SpanGetResponse[]>;
|
|
540
|
+
/**
|
|
541
|
+
* Gets specific spans by trace ID and span IDs.
|
|
542
|
+
*
|
|
543
|
+
* Accepts OTEL 16-char hex or GUID format for span IDs.
|
|
544
|
+
*
|
|
545
|
+
* @param traceId - Trace identifier
|
|
546
|
+
* @param spanIds - List of span IDs to retrieve
|
|
547
|
+
* @returns Promise resolving to an array of matching {@link SpanGetResponse}
|
|
548
|
+
* @example
|
|
549
|
+
* ```typescript
|
|
550
|
+
* import { Traces } from '@uipath/uipath-typescript/traces';
|
|
551
|
+
*
|
|
552
|
+
* const traces = new Traces(sdk);
|
|
553
|
+
*
|
|
554
|
+
* // First retrieve all spans to find the IDs you want
|
|
555
|
+
* const allSpans = await traces.getById('<traceId>');
|
|
556
|
+
* const spanIds = allSpans.slice(0, 3).map(s => s.id);
|
|
557
|
+
*
|
|
558
|
+
* const subset = await traces.getSpansByIds('<traceId>', spanIds);
|
|
559
|
+
* ```
|
|
560
|
+
*/
|
|
561
|
+
getSpansByIds(traceId: string, spanIds: string[]): Promise<SpanGetResponse[]>;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export { SpanAttachmentDirection, SpanAttachmentProvider, SpanExecutionType, SpanPermissionStatus, SpanSource, SpanStatus, SpanVerbosityLevel, TracesService as Traces };
|
|
565
|
+
export type { SpanAttachment, SpanContext, SpanGetResponse, SpanReferenceHierarchyEntry, TracesGetByIdOptions, TracesServiceModel };
|