@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,598 @@
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
+ * Governance Service Types
305
+ *
306
+ * Public types exposed via `@uipath/uipath-typescript/governance`.
307
+ */
308
+
309
+ declare enum PolicyEvaluationResult {
310
+ /** Active policy permitted the action. */
311
+ Allow = "Allow",
312
+ /** Active policy blocked the action. */
313
+ Deny = "Deny",
314
+ /** Simulated (NoOp) policy would have permitted the action. */
315
+ SimulatedAllow = "SimulatedAllow",
316
+ /** Simulated (NoOp) policy would have blocked the action. */
317
+ SimulatedDeny = "SimulatedDeny"
318
+ }
319
+ /**
320
+ * Each trace row represents one policy's verdict within a governance
321
+ * enforcement event. One enforcement event can produce multiple trace rows
322
+ * when multiple policies contributed to the final verdict.
323
+ */
324
+ interface GovernancePolicyTrace {
325
+ /** Tenant the trace was recorded in. Present even when `fullOrganization` is `true`. */
326
+ tenantId?: string;
327
+ /** The start time of governance enforcement event. */
328
+ startTime: string;
329
+ /** Final enforcement verdict for the parent governance event. */
330
+ finalEnforcement?: string;
331
+ /** ID of the policy this trace row evaluates. */
332
+ policyId?: string;
333
+ /** This individual policy's enforcement contribution to the parent verdict. */
334
+ policyEnforcement?: string;
335
+ /** The outcome of one policy evaluation — whether it allowed or denied the action, and whether that decision was actively enforced or just simulated (NoOp). */
336
+ policyEvaluationResult?: string;
337
+ /** Display name of the policy. */
338
+ policyName?: string;
339
+ /** Enforcement mode of the policy at the time of evaluation. */
340
+ policyStatus?: string;
341
+ /** Opaque details payload describing the evaluation result. */
342
+ policyEvaluationDetails?: string;
343
+ /** Process or executable that triggered the evaluation. */
344
+ actorProcessId?: string;
345
+ /** Type of the actor process (e.g. coded agent, RPA process). */
346
+ actorProcessType?: string;
347
+ /** Identity (user/principal) that triggered the evaluation. */
348
+ actorIdentityId?: string;
349
+ /** Resource being acted on. */
350
+ resourceId?: string;
351
+ /** Type of the resource being acted on. */
352
+ resourceType?: string;
353
+ /** Orchestrator folder key associated with the evaluation, if any. */
354
+ folderKey?: string;
355
+ /** Distributed-tracing ID covering the governance enforcement event. */
356
+ traceId?: string;
357
+ /** Process key associated with the evaluation, if any. */
358
+ processKey?: string;
359
+ /** Job key associated with the evaluation, if any. */
360
+ jobKey?: string;
361
+ }
362
+ /**
363
+ * Common filter options shared across Governance APIs.
364
+ *
365
+ * Holds filters that are not specific to any single governance resource, so
366
+ * other governance endpoints can reuse them.
367
+ */
368
+ interface GovernanceFilterOptions {
369
+ /**
370
+ * Inclusive upper bound on trace start time. When omitted, the upper bound
371
+ * is open.
372
+ */
373
+ endTime?: Date;
374
+ /**
375
+ * Whether to query the whole organization instead of just the current tenant.
376
+ *
377
+ * Defaults to tenant-scoped:
378
+ * - omitted → tenant-scoped (default)
379
+ * - `false` → tenant-scoped (explicit, same result)
380
+ * - `true` → org-wide across all tenants; requires an organization admin,
381
+ * otherwise the request returns 403
382
+ *
383
+ * @default false
384
+ */
385
+ fullOrganization?: boolean;
386
+ }
387
+ /**
388
+ * Filter and pagination options for fetching policy traces.
389
+ *
390
+ * All filters combine with AND semantics. Array filters match any value in
391
+ * the array (OR within a single filter).
392
+ */
393
+ type GovernancePolicyTraceGetAllOptions = PaginationOptions & GovernanceFilterOptions & {
394
+ /** Filter by one or more policy evaluation results. */
395
+ evaluationResult?: PolicyEvaluationResult[];
396
+ /** Filter by one or more policy IDs. */
397
+ policyId?: string[];
398
+ /** Filter by one or more actor process IDs. */
399
+ actorProcessId?: string[];
400
+ /** Filter by one or more actor process types (e.g. coded agent, RPA process). */
401
+ actorProcessType?: string[];
402
+ /** Filter by one or more actor identity IDs. */
403
+ actorIdentityId?: string[];
404
+ /** Filter by one or more resource IDs. */
405
+ resourceId?: string[];
406
+ /** Filter by one or more resource types. */
407
+ resourceType?: string[];
408
+ /** Filter by one or more distributed-trace IDs. */
409
+ traceId?: string[];
410
+ };
411
+ /**
412
+ * Aggregate governance enforcement counts returned by
413
+ * {@link GovernanceServiceModel.getOperationSummary}, covering the requested
414
+ * time range.
415
+ */
416
+ interface GovernanceOperationSummary {
417
+ /** Total number of governance enforcement evaluations in range. */
418
+ totalEvaluations: number;
419
+ /** Number of evaluations that resolved to `Allow`. */
420
+ allowedCount: number;
421
+ /** Number of evaluations that resolved to `Deny`. */
422
+ deniedCount: number;
423
+ /** Number of evaluations that resolved to `NoOp` (simulated). */
424
+ noOpCount: number;
425
+ }
426
+
427
+ /**
428
+ * Service for inspecting governance policy enforcement on the UiPath platform.
429
+ *
430
+ * See [Define governance policies](https://docs.uipath.com/automation-ops/automation-cloud/latest/user-guide/define-governance-policies)
431
+ * for how governance policies are configured in Automation Ops.
432
+ *
433
+ * All methods require the caller to be an organization administrator.
434
+ *
435
+ * ### Usage
436
+ *
437
+ * Prerequisites: Initialize the SDK first - see [Getting Started](/uipath-typescript/getting-started/#import-initialize)
438
+ *
439
+ * ```typescript
440
+ * import { Governance } from '@uipath/uipath-typescript/governance';
441
+ *
442
+ * const governance = new Governance(sdk);
443
+ * const traces = await governance.getPolicyTraces(new Date('2024-01-01'));
444
+ * ```
445
+ */
446
+ interface GovernanceServiceModel {
447
+ /**
448
+ * Gets per-policy enforcement decisions across the requested time range.
449
+ *
450
+ * Each result row represents one policy's verdict within a single governance enforcement event.
451
+ * A single user action can produce multiple rows when multiple policies were consulted.
452
+ * Results are ordered by event start time, descending.
453
+ *
454
+ * @param startTime - Inclusive lower bound on the trace start time.
455
+ * @param options - Optional filters and pagination options
456
+ * @returns Promise resolving to {@link NonPaginatedResponse} of {@link GovernancePolicyTrace}
457
+ * without pagination options, or {@link PaginatedResponse} of
458
+ * {@link GovernancePolicyTrace} when pagination options are used.
459
+ *
460
+ * @example
461
+ * ```typescript
462
+ * import { Governance, PolicyEvaluationResult } from '@uipath/uipath-typescript/governance';
463
+ *
464
+ * const governance = new Governance(sdk);
465
+ *
466
+ * // Get all policy traces from the specified start time
467
+ * const recent = await governance.getPolicyTraces(new Date('2024-01-01'));
468
+ * console.log(recent.items.length);
469
+ *
470
+ * // Get all denied decisions across the whole organization
471
+ * const page1 = await governance.getPolicyTraces(
472
+ * new Date('2024-01-01'),
473
+ * {
474
+ * endTime: new Date(),
475
+ * evaluationResult: [PolicyEvaluationResult.Deny, PolicyEvaluationResult.SimulatedDeny],
476
+ * fullOrganization: true,
477
+ * pageSize: 25,
478
+ * },
479
+ * );
480
+ *
481
+ * if (page1.hasNextPage) {
482
+ * const page2 = await governance.getPolicyTraces(
483
+ * new Date('2024-01-01'),
484
+ * { cursor: page1.nextCursor },
485
+ * );
486
+ * }
487
+ * ```
488
+ */
489
+ getPolicyTraces<T extends GovernancePolicyTraceGetAllOptions = GovernancePolicyTraceGetAllOptions>(startTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<GovernancePolicyTrace> : NonPaginatedResponse<GovernancePolicyTrace>>;
490
+ /**
491
+ * Gets aggregate governance enforcement counts across the requested time range.
492
+ *
493
+ * Returns the total number of evaluations along with how many resolved to
494
+ * `Allow`, `Deny`, or `NoOp`.
495
+ *
496
+ * @param startTime - Inclusive lower bound on the evaluation time.
497
+ * @param options - Optional `endTime` upper bound and `fullOrganization` flag
498
+ * @returns Promise resolving to {@link GovernanceOperationSummary}
499
+ *
500
+ * @example
501
+ * ```typescript
502
+ * import { Governance } from '@uipath/uipath-typescript/governance';
503
+ *
504
+ * const governance = new Governance(sdk);
505
+ *
506
+ * // Get operation summary from the specified start time to right now
507
+ * const summary = await governance.getOperationSummary(new Date('2024-01-01'));
508
+ * console.log(summary.totalEvaluations, summary.allowedCount, summary.deniedCount, summary.noOpCount);
509
+ *
510
+ * // Bounded range across the whole organization
511
+ * const ranged = await governance.getOperationSummary(
512
+ * new Date('2024-01-01'),
513
+ * { endTime: new Date(), fullOrganization: true },
514
+ * );
515
+ * ```
516
+ */
517
+ getOperationSummary(startTime: Date, options?: GovernanceFilterOptions): Promise<GovernanceOperationSummary>;
518
+ }
519
+
520
+ /**
521
+ * Service for inspecting governance policy enforcement on the UiPath platform.
522
+ */
523
+ declare class GovernanceService extends BaseService implements GovernanceServiceModel {
524
+ /**
525
+ * Gets per-policy enforcement decisions across the requested time range.
526
+ *
527
+ * Each result row represents one policy's verdict within a single governance enforcement event.
528
+ * A single user action can produce multiple rows when multiple policies were consulted.
529
+ * Results are ordered by event start time, descending.
530
+ *
531
+ * @param startTime - Inclusive lower bound on the trace start time.
532
+ * @param options - Optional filters and pagination options
533
+ * @returns Promise resolving to {@link NonPaginatedResponse} of {@link GovernancePolicyTrace}
534
+ * without pagination options, or {@link PaginatedResponse} of
535
+ * {@link GovernancePolicyTrace} when pagination options are used.
536
+ *
537
+ * @example
538
+ * ```typescript
539
+ * import { Governance, PolicyEvaluationResult } from '@uipath/uipath-typescript/governance';
540
+ *
541
+ * const governance = new Governance(sdk);
542
+ *
543
+ * // Get all policy traces from the specified start time
544
+ * const recent = await governance.getPolicyTraces(new Date('2024-01-01'));
545
+ * console.log(recent.items.length);
546
+ *
547
+ * // Get all denied decisions across the whole organization
548
+ * const page1 = await governance.getPolicyTraces(
549
+ * new Date('2024-01-01'),
550
+ * {
551
+ * endTime: new Date(),
552
+ * evaluationResult: [PolicyEvaluationResult.Deny, PolicyEvaluationResult.SimulatedDeny],
553
+ * fullOrganization: true,
554
+ * pageSize: 25,
555
+ * },
556
+ * );
557
+ *
558
+ * if (page1.hasNextPage) {
559
+ * const page2 = await governance.getPolicyTraces(
560
+ * new Date('2024-01-01'),
561
+ * { cursor: page1.nextCursor },
562
+ * );
563
+ * }
564
+ * ```
565
+ */
566
+ getPolicyTraces<T extends GovernancePolicyTraceGetAllOptions = GovernancePolicyTraceGetAllOptions>(startTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<GovernancePolicyTrace> : NonPaginatedResponse<GovernancePolicyTrace>>;
567
+ /**
568
+ * Gets aggregate governance enforcement counts across the requested time range.
569
+ *
570
+ * Returns the total number of evaluations along with how many resolved to
571
+ * `Allow`, `Deny`, or `NoOp`.
572
+ *
573
+ * @param startTime - Inclusive lower bound on the evaluation time.
574
+ * @param options - Optional `endTime` upper bound and `fullOrganization` flag
575
+ * @returns Promise resolving to {@link GovernanceOperationSummary}
576
+ *
577
+ * @example
578
+ * ```typescript
579
+ * import { Governance } from '@uipath/uipath-typescript/governance';
580
+ *
581
+ * const governance = new Governance(sdk);
582
+ *
583
+ * // Get operation summary from the specified start time to right now
584
+ * const summary = await governance.getOperationSummary(new Date('2024-01-01'));
585
+ * console.log(summary.totalEvaluations, summary.allowedCount, summary.deniedCount, summary.noOpCount);
586
+ *
587
+ * // Bounded range across the whole organization
588
+ * const ranged = await governance.getOperationSummary(
589
+ * new Date('2024-01-01'),
590
+ * { endTime: new Date(), fullOrganization: true },
591
+ * );
592
+ * ```
593
+ */
594
+ getOperationSummary(startTime: Date, options?: GovernanceFilterOptions): Promise<GovernanceOperationSummary>;
595
+ }
596
+
597
+ export { GovernanceService as Governance, PolicyEvaluationResult };
598
+ export type { GovernanceFilterOptions, GovernanceOperationSummary, GovernancePolicyTrace, GovernancePolicyTraceGetAllOptions, GovernanceServiceModel };