@uipath/uipath-typescript 1.3.10 → 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.
@@ -77,6 +77,8 @@ const MAESTRO_ENDPOINTS = {
77
77
  TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
78
78
  /** Top processes ranked by failure count */
79
79
  TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
80
+ /** Top elements ranked by failure count */
81
+ TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
80
82
  /** Instance status aggregated by date for time-series charts */
81
83
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
82
84
  /** Top processes ranked by total duration */
@@ -2514,6 +2516,52 @@ class MaestroProcessesService extends BaseService {
2514
2516
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
2515
2517
  return (data ?? []).map(process => ({ ...process, name: process.packageId }));
2516
2518
  }
2519
+ /**
2520
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
2521
+ *
2522
+ * Returns an array of up to 10 elements sorted by how many times they failed,
2523
+ * useful for identifying the most error-prone activities in processes.
2524
+ *
2525
+ * @param startTime - Start of the time range to query
2526
+ * @param endTime - End of the time range to query
2527
+ * @param options - Optional filters (packageId, processKey, version)
2528
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
2529
+ * @example
2530
+ * ```typescript
2531
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
2532
+ *
2533
+ * const maestroProcesses = new MaestroProcesses(sdk);
2534
+ *
2535
+ * // Get top failing elements for the last 7 days
2536
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
2537
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
2538
+ * new Date()
2539
+ * );
2540
+ *
2541
+ * for (const element of topFailing) {
2542
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
2543
+ * }
2544
+ * ```
2545
+ *
2546
+ * @example
2547
+ * ```typescript
2548
+ * // Get top failing elements for a specific process
2549
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
2550
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
2551
+ * new Date(),
2552
+ * { processKey: '<processKey>' }
2553
+ * );
2554
+ * ```
2555
+ */
2556
+ async getTopElementFailedCount(startTime, endTime, options) {
2557
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
2558
+ return (data ?? []).map(item => ({
2559
+ elementName: item.elementName,
2560
+ elementType: item.elementType,
2561
+ processKey: item.processKey,
2562
+ failedCount: item.count,
2563
+ }));
2564
+ }
2517
2565
  /**
2518
2566
  * Get all instances status counts aggregated by date for maestro processes.
2519
2567
  *
@@ -2654,6 +2702,9 @@ __decorate([
2654
2702
  __decorate([
2655
2703
  track('MaestroProcesses.GetTopRunCount')
2656
2704
  ], MaestroProcessesService.prototype, "getTopRunCount", null);
2705
+ __decorate([
2706
+ track('MaestroProcesses.GetTopElementFailedCount')
2707
+ ], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
2657
2708
  __decorate([
2658
2709
  track('MaestroProcesses.GetInstanceStatusTimeline')
2659
2710
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);