@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.
package/dist/index.mjs CHANGED
@@ -4596,6 +4596,8 @@ const MAESTRO_ENDPOINTS = {
4596
4596
  TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
4597
4597
  /** Top processes ranked by failure count */
4598
4598
  TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
4599
+ /** Top elements ranked by failure count */
4600
+ TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
4599
4601
  /** Instance status aggregated by date for time-series charts */
4600
4602
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
4601
4603
  /** Top processes ranked by total duration */
@@ -5490,7 +5492,7 @@ function normalizeBaseUrl(url) {
5490
5492
  * SDK's public API.
5491
5493
  */
5492
5494
  /** SDK version placeholder — patched by the SDK publish workflow. */
5493
- const SDK_VERSION = '1.3.10';
5495
+ const SDK_VERSION = '1.3.11';
5494
5496
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
5495
5497
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
5496
5498
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -8536,10 +8538,6 @@ class EntityService extends BaseService {
8536
8538
  * @internal
8537
8539
  */
8538
8540
  async create(name, fields, options) {
8539
- this.validateName(name, 'entity');
8540
- for (const field of fields) {
8541
- this.validateName(field.fieldName, 'field');
8542
- }
8543
8541
  const opts = options ?? {};
8544
8542
  const payload = {
8545
8543
  ...(opts.description !== undefined && { description: opts.description }),
@@ -8682,6 +8680,7 @@ class EntityService extends BaseService {
8682
8680
  ...(update.isUnique !== undefined && { isUnique: update.isUnique }),
8683
8681
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
8684
8682
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
8683
+ ...(update.isHiddenField !== undefined && { isHiddenField: update.isHiddenField }),
8685
8684
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
8686
8685
  ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
8687
8686
  };
@@ -8690,9 +8689,6 @@ class EntityService extends BaseService {
8690
8689
  // Build and append new fields
8691
8690
  const newFields = [];
8692
8691
  if (options.addFields?.length) {
8693
- for (const field of options.addFields) {
8694
- this.validateName(field.fieldName, 'field');
8695
- }
8696
8692
  newFields.push(...options.addFields.map(f => this.buildSchemaFieldPayload(f)));
8697
8693
  }
8698
8694
  await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPSERT, {
@@ -8793,9 +8789,15 @@ class EntityService extends BaseService {
8793
8789
  }
8794
8790
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
8795
8791
  buildSchemaFieldPayload(field) {
8796
- this.validateName(field.fieldName, 'field');
8797
8792
  const fieldType = field.type ?? EntityFieldDataType.STRING;
8798
8793
  this.validateFieldConstraints(fieldType, field, field.fieldName);
8794
+ const isRelationship = fieldType === EntityFieldDataType.RELATIONSHIP;
8795
+ const isFile = fieldType === EntityFieldDataType.FILE;
8796
+ if ((isRelationship || isFile) && (!field.referenceEntityId || !field.referenceFieldId)) {
8797
+ throw new ValidationError({
8798
+ message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`,
8799
+ });
8800
+ }
8799
8801
  const mapping = EntitySchemaFieldTypeMap[fieldType];
8800
8802
  return {
8801
8803
  name: field.fieldName,
@@ -8810,10 +8812,13 @@ class EntityService extends BaseService {
8810
8812
  isUnique: field.isUnique ?? false,
8811
8813
  isRbacEnabled: field.isRbacEnabled ?? false,
8812
8814
  isEncrypted: field.isEncrypted ?? false,
8815
+ isHiddenField: field.isHiddenField ?? false,
8813
8816
  ...(field.defaultValue !== undefined && { defaultValue: field.defaultValue }),
8814
8817
  ...(field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId }),
8815
- ...(field.referenceEntityName !== undefined && { referenceEntityName: field.referenceEntityName }),
8816
- ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
8818
+ ...((isRelationship || isFile) && { isForeignKey: true }),
8819
+ ...(isRelationship && { referenceType: ReferenceType.ManyToOne }),
8820
+ ...(field.referenceEntityId !== undefined && { referenceEntity: { id: field.referenceEntityId } }),
8821
+ ...(field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }),
8817
8822
  };
8818
8823
  }
8819
8824
  /**
@@ -8917,24 +8922,7 @@ class EntityService extends BaseService {
8917
8922
  return {};
8918
8923
  }
8919
8924
  }
8920
- validateName(name, context) {
8921
- if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
8922
- const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
8923
- const defaultName = `My${context.charAt(0).toUpperCase() + context.slice(1)}`;
8924
- throw new ValidationError({
8925
- message: `Invalid ${context} name '${name}'. Must start with a letter, contain only letters, numbers, and underscores, 3–100 characters (e.g., "${suggestion || defaultName}").`
8926
- });
8927
- }
8928
- if (context === 'field' && EntityService.RESERVED_FIELD_NAMES.has(name)) {
8929
- throw new ValidationError({
8930
- message: `Field name '${name}' is reserved. Reserved names: ${[...EntityService.RESERVED_FIELD_NAMES].join(', ')}.`
8931
- });
8932
- }
8933
- }
8934
8925
  }
8935
- EntityService.RESERVED_FIELD_NAMES = new Set([
8936
- 'Id', 'CreatedBy', 'CreateTime', 'UpdatedBy', 'UpdateTime'
8937
- ]);
8938
8926
  __decorate([
8939
8927
  track('Entities.GetById')
8940
8928
  ], EntityService.prototype, "getById", null);
@@ -10215,6 +10203,52 @@ class MaestroProcessesService extends BaseService {
10215
10203
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
10216
10204
  return (data ?? []).map(process => ({ ...process, name: process.packageId }));
10217
10205
  }
10206
+ /**
10207
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
10208
+ *
10209
+ * Returns an array of up to 10 elements sorted by how many times they failed,
10210
+ * useful for identifying the most error-prone activities in processes.
10211
+ *
10212
+ * @param startTime - Start of the time range to query
10213
+ * @param endTime - End of the time range to query
10214
+ * @param options - Optional filters (packageId, processKey, version)
10215
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
10216
+ * @example
10217
+ * ```typescript
10218
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
10219
+ *
10220
+ * const maestroProcesses = new MaestroProcesses(sdk);
10221
+ *
10222
+ * // Get top failing elements for the last 7 days
10223
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
10224
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10225
+ * new Date()
10226
+ * );
10227
+ *
10228
+ * for (const element of topFailing) {
10229
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
10230
+ * }
10231
+ * ```
10232
+ *
10233
+ * @example
10234
+ * ```typescript
10235
+ * // Get top failing elements for a specific process
10236
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
10237
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10238
+ * new Date(),
10239
+ * { processKey: '<processKey>' }
10240
+ * );
10241
+ * ```
10242
+ */
10243
+ async getTopElementFailedCount(startTime, endTime, options) {
10244
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
10245
+ return (data ?? []).map(item => ({
10246
+ elementName: item.elementName,
10247
+ elementType: item.elementType,
10248
+ processKey: item.processKey,
10249
+ failedCount: item.count,
10250
+ }));
10251
+ }
10218
10252
  /**
10219
10253
  * Get all instances status counts aggregated by date for maestro processes.
10220
10254
  *
@@ -10355,6 +10389,9 @@ __decorate([
10355
10389
  __decorate([
10356
10390
  track('MaestroProcesses.GetTopRunCount')
10357
10391
  ], MaestroProcessesService.prototype, "getTopRunCount", null);
10392
+ __decorate([
10393
+ track('MaestroProcesses.GetTopElementFailedCount')
10394
+ ], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
10358
10395
  __decorate([
10359
10396
  track('MaestroProcesses.GetInstanceStatusTimeline')
10360
10397
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
@@ -10489,6 +10526,52 @@ class CasesService extends BaseService {
10489
10526
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, true, options));
10490
10527
  return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
10491
10528
  }
10529
+ /**
10530
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
10531
+ *
10532
+ * Returns an array of up to 10 elements sorted by how many times they failed,
10533
+ * useful for identifying the most error-prone activities in case processes.
10534
+ *
10535
+ * @param startTime - Start of the time range to query
10536
+ * @param endTime - End of the time range to query
10537
+ * @param options - Optional filters (packageId, processKey, version)
10538
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
10539
+ * @example
10540
+ * ```typescript
10541
+ * import { Cases } from '@uipath/uipath-typescript/cases';
10542
+ *
10543
+ * const cases = new Cases(sdk);
10544
+ *
10545
+ * // Get top failing elements for the last 7 days
10546
+ * const topFailing = await cases.getTopElementFailedCount(
10547
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10548
+ * new Date()
10549
+ * );
10550
+ *
10551
+ * for (const element of topFailing) {
10552
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
10553
+ * }
10554
+ * ```
10555
+ *
10556
+ * @example
10557
+ * ```typescript
10558
+ * // Get top failing elements for a specific process
10559
+ * const filtered = await cases.getTopElementFailedCount(
10560
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
10561
+ * new Date(),
10562
+ * { processKey: '<processKey>' }
10563
+ * );
10564
+ * ```
10565
+ */
10566
+ async getTopElementFailedCount(startTime, endTime, options) {
10567
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
10568
+ return (data ?? []).map(item => ({
10569
+ elementName: item.elementName,
10570
+ elementType: item.elementType,
10571
+ processKey: item.processKey,
10572
+ failedCount: item.count,
10573
+ }));
10574
+ }
10492
10575
  /**
10493
10576
  * Get all instances status counts aggregated by date for case management processes.
10494
10577
  *
@@ -10644,6 +10727,9 @@ __decorate([
10644
10727
  __decorate([
10645
10728
  track('Cases.GetTopRunCount')
10646
10729
  ], CasesService.prototype, "getTopRunCount", null);
10730
+ __decorate([
10731
+ track('Cases.GetTopElementFailedCount')
10732
+ ], CasesService.prototype, "getTopElementFailedCount", null);
10647
10733
  __decorate([
10648
10734
  track('Cases.GetInstanceStatusTimeline')
10649
10735
  ], CasesService.prototype, "getInstanceStatusTimeline", null);
package/dist/index.umd.js CHANGED
@@ -4600,6 +4600,8 @@
4600
4600
  TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
4601
4601
  /** Top processes ranked by failure count */
4602
4602
  TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
4603
+ /** Top elements ranked by failure count */
4604
+ TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
4603
4605
  /** Instance status aggregated by date for time-series charts */
4604
4606
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
4605
4607
  /** Top processes ranked by total duration */
@@ -9247,7 +9249,7 @@
9247
9249
  * shared across all consumers and is patched into this file at publish time.
9248
9250
  */
9249
9251
  // Connection string placeholder that will be replaced during build
9250
- const CONNECTION_STRING = '$CONNECTION_STRING';
9252
+ const CONNECTION_STRING = 'InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037';
9251
9253
  const VERSION = 'Version';
9252
9254
  const SERVICE = 'Service';
9253
9255
  const CLOUD_ORGANIZATION_NAME = 'CloudOrganizationName';
@@ -9573,7 +9575,7 @@
9573
9575
  * SDK's public API.
9574
9576
  */
9575
9577
  /** SDK version placeholder — patched by the SDK publish workflow. */
9576
- const SDK_VERSION = '1.3.10';
9578
+ const SDK_VERSION = '1.3.11';
9577
9579
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
9578
9580
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
9579
9581
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -12619,10 +12621,6 @@
12619
12621
  * @internal
12620
12622
  */
12621
12623
  async create(name, fields, options) {
12622
- this.validateName(name, 'entity');
12623
- for (const field of fields) {
12624
- this.validateName(field.fieldName, 'field');
12625
- }
12626
12624
  const opts = options ?? {};
12627
12625
  const payload = {
12628
12626
  ...(opts.description !== undefined && { description: opts.description }),
@@ -12765,6 +12763,7 @@
12765
12763
  ...(update.isUnique !== undefined && { isUnique: update.isUnique }),
12766
12764
  ...(update.isRbacEnabled !== undefined && { isRbacEnabled: update.isRbacEnabled }),
12767
12765
  ...(update.isEncrypted !== undefined && { isEncrypted: update.isEncrypted }),
12766
+ ...(update.isHiddenField !== undefined && { isHiddenField: update.isHiddenField }),
12768
12767
  ...(update.defaultValue !== undefined && { defaultValue: update.defaultValue }),
12769
12768
  ...(hasConstraintUpdate && f.sqlType && { sqlType: { ...f.sqlType, ...constraintUpdate } }),
12770
12769
  };
@@ -12773,9 +12772,6 @@
12773
12772
  // Build and append new fields
12774
12773
  const newFields = [];
12775
12774
  if (options.addFields?.length) {
12776
- for (const field of options.addFields) {
12777
- this.validateName(field.fieldName, 'field');
12778
- }
12779
12775
  newFields.push(...options.addFields.map(f => this.buildSchemaFieldPayload(f)));
12780
12776
  }
12781
12777
  await this.post(DATA_FABRIC_ENDPOINTS.ENTITY.UPSERT, {
@@ -12876,9 +12872,15 @@
12876
12872
  }
12877
12873
  /** Converts a user-facing EntityCreateFieldOptions to the raw API field payload */
12878
12874
  buildSchemaFieldPayload(field) {
12879
- this.validateName(field.fieldName, 'field');
12880
12875
  const fieldType = field.type ?? exports.EntityFieldDataType.STRING;
12881
12876
  this.validateFieldConstraints(fieldType, field, field.fieldName);
12877
+ const isRelationship = fieldType === exports.EntityFieldDataType.RELATIONSHIP;
12878
+ const isFile = fieldType === exports.EntityFieldDataType.FILE;
12879
+ if ((isRelationship || isFile) && (!field.referenceEntityId || !field.referenceFieldId)) {
12880
+ throw new ValidationError({
12881
+ message: `Field '${field.fieldName}' of type ${fieldType} requires both referenceEntityId and referenceFieldId (UUIDs of the target entity and field).`,
12882
+ });
12883
+ }
12882
12884
  const mapping = EntitySchemaFieldTypeMap[fieldType];
12883
12885
  return {
12884
12886
  name: field.fieldName,
@@ -12893,10 +12895,13 @@
12893
12895
  isUnique: field.isUnique ?? false,
12894
12896
  isRbacEnabled: field.isRbacEnabled ?? false,
12895
12897
  isEncrypted: field.isEncrypted ?? false,
12898
+ isHiddenField: field.isHiddenField ?? false,
12896
12899
  ...(field.defaultValue !== undefined && { defaultValue: field.defaultValue }),
12897
12900
  ...(field.choiceSetId !== undefined && { choiceSetId: field.choiceSetId }),
12898
- ...(field.referenceEntityName !== undefined && { referenceEntityName: field.referenceEntityName }),
12899
- ...(field.referenceFieldName !== undefined && { referenceFieldName: field.referenceFieldName }),
12901
+ ...((isRelationship || isFile) && { isForeignKey: true }),
12902
+ ...(isRelationship && { referenceType: exports.ReferenceType.ManyToOne }),
12903
+ ...(field.referenceEntityId !== undefined && { referenceEntity: { id: field.referenceEntityId } }),
12904
+ ...(field.referenceFieldId !== undefined && { referenceField: { id: field.referenceFieldId } }),
12900
12905
  };
12901
12906
  }
12902
12907
  /**
@@ -13000,24 +13005,7 @@
13000
13005
  return {};
13001
13006
  }
13002
13007
  }
13003
- validateName(name, context) {
13004
- if (name.length < 3 || name.length > 100 || !/^[a-zA-Z]\w*$/.test(name)) {
13005
- const suggestion = name.replace(/\W/g, '').replace(/^[0-9_]+/, '');
13006
- const defaultName = `My${context.charAt(0).toUpperCase() + context.slice(1)}`;
13007
- throw new ValidationError({
13008
- message: `Invalid ${context} name '${name}'. Must start with a letter, contain only letters, numbers, and underscores, 3–100 characters (e.g., "${suggestion || defaultName}").`
13009
- });
13010
- }
13011
- if (context === 'field' && EntityService.RESERVED_FIELD_NAMES.has(name)) {
13012
- throw new ValidationError({
13013
- message: `Field name '${name}' is reserved. Reserved names: ${[...EntityService.RESERVED_FIELD_NAMES].join(', ')}.`
13014
- });
13015
- }
13016
- }
13017
13008
  }
13018
- EntityService.RESERVED_FIELD_NAMES = new Set([
13019
- 'Id', 'CreatedBy', 'CreateTime', 'UpdatedBy', 'UpdateTime'
13020
- ]);
13021
13009
  __decorate([
13022
13010
  track('Entities.GetById')
13023
13011
  ], EntityService.prototype, "getById", null);
@@ -14298,6 +14286,52 @@
14298
14286
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
14299
14287
  return (data ?? []).map(process => ({ ...process, name: process.packageId }));
14300
14288
  }
14289
+ /**
14290
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
14291
+ *
14292
+ * Returns an array of up to 10 elements sorted by how many times they failed,
14293
+ * useful for identifying the most error-prone activities in processes.
14294
+ *
14295
+ * @param startTime - Start of the time range to query
14296
+ * @param endTime - End of the time range to query
14297
+ * @param options - Optional filters (packageId, processKey, version)
14298
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
14299
+ * @example
14300
+ * ```typescript
14301
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
14302
+ *
14303
+ * const maestroProcesses = new MaestroProcesses(sdk);
14304
+ *
14305
+ * // Get top failing elements for the last 7 days
14306
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
14307
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14308
+ * new Date()
14309
+ * );
14310
+ *
14311
+ * for (const element of topFailing) {
14312
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
14313
+ * }
14314
+ * ```
14315
+ *
14316
+ * @example
14317
+ * ```typescript
14318
+ * // Get top failing elements for a specific process
14319
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
14320
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14321
+ * new Date(),
14322
+ * { processKey: '<processKey>' }
14323
+ * );
14324
+ * ```
14325
+ */
14326
+ async getTopElementFailedCount(startTime, endTime, options) {
14327
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
14328
+ return (data ?? []).map(item => ({
14329
+ elementName: item.elementName,
14330
+ elementType: item.elementType,
14331
+ processKey: item.processKey,
14332
+ failedCount: item.count,
14333
+ }));
14334
+ }
14301
14335
  /**
14302
14336
  * Get all instances status counts aggregated by date for maestro processes.
14303
14337
  *
@@ -14438,6 +14472,9 @@
14438
14472
  __decorate([
14439
14473
  track('MaestroProcesses.GetTopRunCount')
14440
14474
  ], MaestroProcessesService.prototype, "getTopRunCount", null);
14475
+ __decorate([
14476
+ track('MaestroProcesses.GetTopElementFailedCount')
14477
+ ], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
14441
14478
  __decorate([
14442
14479
  track('MaestroProcesses.GetInstanceStatusTimeline')
14443
14480
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
@@ -14572,6 +14609,52 @@
14572
14609
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, true, options));
14573
14610
  return (data ?? []).map(process => ({ ...process, name: this.extractCaseName(process.packageId) }));
14574
14611
  }
14612
+ /**
14613
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
14614
+ *
14615
+ * Returns an array of up to 10 elements sorted by how many times they failed,
14616
+ * useful for identifying the most error-prone activities in case processes.
14617
+ *
14618
+ * @param startTime - Start of the time range to query
14619
+ * @param endTime - End of the time range to query
14620
+ * @param options - Optional filters (packageId, processKey, version)
14621
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
14622
+ * @example
14623
+ * ```typescript
14624
+ * import { Cases } from '@uipath/uipath-typescript/cases';
14625
+ *
14626
+ * const cases = new Cases(sdk);
14627
+ *
14628
+ * // Get top failing elements for the last 7 days
14629
+ * const topFailing = await cases.getTopElementFailedCount(
14630
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14631
+ * new Date()
14632
+ * );
14633
+ *
14634
+ * for (const element of topFailing) {
14635
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
14636
+ * }
14637
+ * ```
14638
+ *
14639
+ * @example
14640
+ * ```typescript
14641
+ * // Get top failing elements for a specific process
14642
+ * const filtered = await cases.getTopElementFailedCount(
14643
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
14644
+ * new Date(),
14645
+ * { processKey: '<processKey>' }
14646
+ * );
14647
+ * ```
14648
+ */
14649
+ async getTopElementFailedCount(startTime, endTime, options) {
14650
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, true, options));
14651
+ return (data ?? []).map(item => ({
14652
+ elementName: item.elementName,
14653
+ elementType: item.elementType,
14654
+ processKey: item.processKey,
14655
+ failedCount: item.count,
14656
+ }));
14657
+ }
14575
14658
  /**
14576
14659
  * Get all instances status counts aggregated by date for case management processes.
14577
14660
  *
@@ -14727,6 +14810,9 @@
14727
14810
  __decorate([
14728
14811
  track('Cases.GetTopRunCount')
14729
14812
  ], CasesService.prototype, "getTopRunCount", null);
14813
+ __decorate([
14814
+ track('Cases.GetTopElementFailedCount')
14815
+ ], CasesService.prototype, "getTopElementFailedCount", null);
14730
14816
  __decorate([
14731
14817
  track('Cases.GetInstanceStatusTimeline')
14732
14818
  ], CasesService.prototype, "getInstanceStatusTimeline", null);
@@ -79,6 +79,8 @@ const MAESTRO_ENDPOINTS = {
79
79
  TOP_PROCESSES_BY_RUN_COUNT: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByRunCount`,
80
80
  /** Top processes ranked by failure count */
81
81
  TOP_PROCESSES_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcesseswithFailure`,
82
+ /** Top elements ranked by failure count */
83
+ TOP_ELEMENTS_WITH_FAILURE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopElementswithFailure`,
82
84
  /** Instance status aggregated by date for time-series charts */
83
85
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
84
86
  /** Top processes ranked by total duration */
@@ -2516,6 +2518,52 @@ class MaestroProcessesService extends BaseService {
2516
2518
  const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_PROCESSES_BY_RUN_COUNT, buildInsightsTopBody(startTime, endTime, false, options));
2517
2519
  return (data ?? []).map(process => ({ ...process, name: process.packageId }));
2518
2520
  }
2521
+ /**
2522
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
2523
+ *
2524
+ * Returns an array of up to 10 elements sorted by how many times they failed,
2525
+ * useful for identifying the most error-prone activities in processes.
2526
+ *
2527
+ * @param startTime - Start of the time range to query
2528
+ * @param endTime - End of the time range to query
2529
+ * @param options - Optional filters (packageId, processKey, version)
2530
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
2531
+ * @example
2532
+ * ```typescript
2533
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
2534
+ *
2535
+ * const maestroProcesses = new MaestroProcesses(sdk);
2536
+ *
2537
+ * // Get top failing elements for the last 7 days
2538
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
2539
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
2540
+ * new Date()
2541
+ * );
2542
+ *
2543
+ * for (const element of topFailing) {
2544
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
2545
+ * }
2546
+ * ```
2547
+ *
2548
+ * @example
2549
+ * ```typescript
2550
+ * // Get top failing elements for a specific process
2551
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
2552
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
2553
+ * new Date(),
2554
+ * { processKey: '<processKey>' }
2555
+ * );
2556
+ * ```
2557
+ */
2558
+ async getTopElementFailedCount(startTime, endTime, options) {
2559
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.TOP_ELEMENTS_WITH_FAILURE, buildInsightsTopBody(startTime, endTime, false, options));
2560
+ return (data ?? []).map(item => ({
2561
+ elementName: item.elementName,
2562
+ elementType: item.elementType,
2563
+ processKey: item.processKey,
2564
+ failedCount: item.count,
2565
+ }));
2566
+ }
2519
2567
  /**
2520
2568
  * Get all instances status counts aggregated by date for maestro processes.
2521
2569
  *
@@ -2656,6 +2704,9 @@ __decorate([
2656
2704
  __decorate([
2657
2705
  track('MaestroProcesses.GetTopRunCount')
2658
2706
  ], MaestroProcessesService.prototype, "getTopRunCount", null);
2707
+ __decorate([
2708
+ track('MaestroProcesses.GetTopElementFailedCount')
2709
+ ], MaestroProcessesService.prototype, "getTopElementFailedCount", null);
2659
2710
  __decorate([
2660
2711
  track('MaestroProcesses.GetInstanceStatusTimeline')
2661
2712
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
@@ -39,6 +39,20 @@ interface GetTopFaultedCountResponse extends GetTopBaseResponse {
39
39
  /** Number of faulted instances in the given time range */
40
40
  faultedCount: number;
41
41
  }
42
+ /**
43
+ * SDK response for top elements with failure.
44
+ * Shared by both MaestroProcesses and Cases — no service-specific enrichment.
45
+ */
46
+ interface ElementGetTopFailedCountResponse {
47
+ /** BPMN element name (falls back to element ID if name is empty) */
48
+ elementName: string;
49
+ /** BPMN element type (e.g. ServiceTask, ReceiveTask, IntermediateCatchEvent) */
50
+ elementType: string;
51
+ /** The unique process key this element belongs to */
52
+ processKey: string;
53
+ /** Number of failed executions of this element in the given time range */
54
+ failedCount: number;
55
+ }
42
56
  /**
43
57
  * Time bucketing granularity for insights time-series queries.
44
58
  *
@@ -364,6 +378,44 @@ interface MaestroProcessesServiceModel {
364
378
  * ```
365
379
  */
366
380
  getTopFaultedCount(startTime: Date, endTime: Date, options?: TopQueryOptions): Promise<ProcessGetTopFaultedCountResponse[]>;
381
+ /**
382
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
383
+ *
384
+ * Returns an array of up to 10 elements sorted by how many times they failed,
385
+ * useful for identifying the most error-prone activities in processes.
386
+ *
387
+ * @param startTime - Start of the time range to query
388
+ * @param endTime - End of the time range to query
389
+ * @param options - Optional filters (packageId, processKey, version)
390
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
391
+ * @example
392
+ * ```typescript
393
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
394
+ *
395
+ * const maestroProcesses = new MaestroProcesses(sdk);
396
+ *
397
+ * // Get top failing elements for the last 7 days
398
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
399
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
400
+ * new Date()
401
+ * );
402
+ *
403
+ * for (const element of topFailing) {
404
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
405
+ * }
406
+ * ```
407
+ *
408
+ * @example
409
+ * ```typescript
410
+ * // Get top failing elements for a specific process
411
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
412
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
413
+ * new Date(),
414
+ * { processKey: '<processKey>' }
415
+ * );
416
+ * ```
417
+ */
418
+ getTopElementFailedCount(startTime: Date, endTime: Date, options?: TopQueryOptions): Promise<ElementGetTopFailedCountResponse[]>;
367
419
  /**
368
420
  * Get all instances status counts aggregated by date for maestro processes.
369
421
  *
@@ -1289,6 +1341,44 @@ declare class MaestroProcessesService extends BaseService implements MaestroProc
1289
1341
  * ```
1290
1342
  */
1291
1343
  getTopRunCount(startTime: Date, endTime: Date, options?: TopQueryOptions): Promise<ProcessGetTopRunCountResponse[]>;
1344
+ /**
1345
+ * Get the top 10 BPMN elements ranked by failure count within a time range.
1346
+ *
1347
+ * Returns an array of up to 10 elements sorted by how many times they failed,
1348
+ * useful for identifying the most error-prone activities in processes.
1349
+ *
1350
+ * @param startTime - Start of the time range to query
1351
+ * @param endTime - End of the time range to query
1352
+ * @param options - Optional filters (packageId, processKey, version)
1353
+ * @returns Promise resolving to an array of {@link ElementGetTopFailedCountResponse}
1354
+ * @example
1355
+ * ```typescript
1356
+ * import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
1357
+ *
1358
+ * const maestroProcesses = new MaestroProcesses(sdk);
1359
+ *
1360
+ * // Get top failing elements for the last 7 days
1361
+ * const topFailing = await maestroProcesses.getTopElementFailedCount(
1362
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
1363
+ * new Date()
1364
+ * );
1365
+ *
1366
+ * for (const element of topFailing) {
1367
+ * console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
1368
+ * }
1369
+ * ```
1370
+ *
1371
+ * @example
1372
+ * ```typescript
1373
+ * // Get top failing elements for a specific process
1374
+ * const filtered = await maestroProcesses.getTopElementFailedCount(
1375
+ * new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
1376
+ * new Date(),
1377
+ * { processKey: '<processKey>' }
1378
+ * );
1379
+ * ```
1380
+ */
1381
+ getTopElementFailedCount(startTime: Date, endTime: Date, options?: TopQueryOptions): Promise<ElementGetTopFailedCountResponse[]>;
1292
1382
  /**
1293
1383
  * Get all instances status counts aggregated by date for maestro processes.
1294
1384
  *
@@ -1562,4 +1652,4 @@ declare class ProcessIncidentsService extends BaseService implements ProcessInci
1562
1652
  }
1563
1653
 
1564
1654
  export { DebugMode, InstanceFinalStatus, MaestroProcessesService as MaestroProcesses, MaestroProcessesService, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, ProcessIncidentsService as ProcessIncidents, ProcessIncidentsService, ProcessInstancesService as ProcessInstances, ProcessInstancesService, TimeInterval, createProcessInstanceWithMethods, createProcessWithMethods };
1565
- export type { BpmnXmlString, ElementMetaData, GetTopBaseResponse, GetTopDurationResponse, GetTopFaultedCountResponse, GetTopRunCountResponse, GlobalVariableMetaData, InstanceStatusTimelineResponse, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, ProcessGetTopDurationResponse, ProcessGetTopFaultedCountResponse, ProcessGetTopRunCountResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, TimelineOptions, TopQueryOptions };
1655
+ export type { BpmnXmlString, ElementGetTopFailedCountResponse, ElementMetaData, GetTopBaseResponse, GetTopDurationResponse, GetTopFaultedCountResponse, GetTopRunCountResponse, GlobalVariableMetaData, InstanceStatusTimelineResponse, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, ProcessGetTopDurationResponse, ProcessGetTopFaultedCountResponse, ProcessGetTopRunCountResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, TimelineOptions, TopQueryOptions };