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