@uipath/uipath-typescript 1.3.6 → 1.3.8

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 (44) hide show
  1. package/dist/assets/index.cjs +243 -6
  2. package/dist/assets/index.d.ts +113 -13
  3. package/dist/assets/index.mjs +243 -6
  4. package/dist/attachments/index.cjs +42 -6
  5. package/dist/attachments/index.d.ts +8 -0
  6. package/dist/attachments/index.mjs +42 -6
  7. package/dist/buckets/index.cjs +211 -6
  8. package/dist/buckets/index.d.ts +57 -12
  9. package/dist/buckets/index.mjs +211 -6
  10. package/dist/cases/index.cjs +180 -6
  11. package/dist/cases/index.d.ts +165 -3
  12. package/dist/cases/index.mjs +181 -7
  13. package/dist/conversational-agent/index.cjs +235 -85
  14. package/dist/conversational-agent/index.d.ts +327 -80
  15. package/dist/conversational-agent/index.mjs +234 -84
  16. package/dist/core/index.cjs +18 -6
  17. package/dist/core/index.d.ts +1 -1
  18. package/dist/core/index.mjs +18 -6
  19. package/dist/entities/index.cjs +74 -10
  20. package/dist/entities/index.d.ts +102 -11
  21. package/dist/entities/index.mjs +75 -11
  22. package/dist/feedback/index.cjs +293 -10
  23. package/dist/feedback/index.d.ts +425 -12
  24. package/dist/feedback/index.mjs +293 -10
  25. package/dist/index.cjs +463 -17
  26. package/dist/index.d.ts +885 -39
  27. package/dist/index.mjs +464 -18
  28. package/dist/index.umd.js +463 -17
  29. package/dist/jobs/index.cjs +211 -6
  30. package/dist/jobs/index.d.ts +68 -23
  31. package/dist/jobs/index.mjs +211 -6
  32. package/dist/maestro-processes/index.cjs +79 -6
  33. package/dist/maestro-processes/index.d.ts +8 -0
  34. package/dist/maestro-processes/index.mjs +79 -6
  35. package/dist/processes/index.cjs +279 -7
  36. package/dist/processes/index.d.ts +125 -2
  37. package/dist/processes/index.mjs +279 -7
  38. package/dist/queues/index.cjs +211 -6
  39. package/dist/queues/index.d.ts +57 -12
  40. package/dist/queues/index.mjs +211 -6
  41. package/dist/tasks/index.cjs +42 -6
  42. package/dist/tasks/index.d.ts +8 -0
  43. package/dist/tasks/index.mjs +42 -6
  44. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -4478,6 +4478,7 @@ const ORCHESTRATOR_BASE = 'orchestrator_';
4478
4478
  const PIMS_BASE = 'pims_';
4479
4479
  const DATAFABRIC_BASE = 'datafabric_';
4480
4480
  const IDENTITY_BASE = 'identity_';
4481
+ const INSIGHTS_RTM_BASE = 'insightsrtm_';
4481
4482
 
4482
4483
  /**
4483
4484
  * Orchestrator Service Endpoints
@@ -4584,6 +4585,10 @@ const MAESTRO_ENDPOINTS = {
4584
4585
  GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
4585
4586
  REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
4586
4587
  },
4588
+ INSIGHTS: {
4589
+ /** SLA summary for case instances */
4590
+ SLA_SUMMARY: `${INSIGHTS_RTM_BASE}/caseManagement/slaSummary`,
4591
+ },
4587
4592
  };
4588
4593
 
4589
4594
  /**
@@ -5462,7 +5467,7 @@ function normalizeBaseUrl(url) {
5462
5467
  // Connection string placeholder that will be replaced during build
5463
5468
  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";
5464
5469
  // SDK Version placeholder
5465
- const SDK_VERSION = "1.3.6";
5470
+ const SDK_VERSION = "1.3.8";
5466
5471
  const VERSION = "Version";
5467
5472
  const SERVICE = "Service";
5468
5473
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -5809,6 +5814,8 @@ var UiPathMetaTags;
5809
5814
  // Asset resolution and routing
5810
5815
  UiPathMetaTags["CDN_BASE"] = "uipath:cdn-base";
5811
5816
  UiPathMetaTags["APP_BASE"] = "uipath:app-base";
5817
+ // Folder context (injected during coded-app deployment)
5818
+ UiPathMetaTags["FOLDER_KEY"] = "uipath:folder-key";
5812
5819
  })(UiPathMetaTags || (UiPathMetaTags = {}));
5813
5820
 
5814
5821
  /**
@@ -5837,12 +5844,13 @@ function loadFromMetaTags() {
5837
5844
  tenantName: getMetaTagContent(UiPathMetaTags.TENANT_NAME),
5838
5845
  baseUrl: getMetaTagContent(UiPathMetaTags.BASE_URL),
5839
5846
  redirectUri: getMetaTagContent(UiPathMetaTags.REDIRECT_URI),
5847
+ folderKey: getMetaTagContent(UiPathMetaTags.FOLDER_KEY),
5840
5848
  };
5841
5849
  const hasAnyValue = Object.values(config).some(Boolean);
5842
5850
  return hasAnyValue ? config : null;
5843
5851
  }
5844
5852
 
5845
- var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_multiLogin, _UiPath_initializeWithConfig, _UiPath_loadConfig;
5853
+ var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized, _UiPath_partialConfig, _UiPath_multiLogin, _UiPath_metaFolderKey, _UiPath_initializeWithConfig, _UiPath_loadConfig;
5846
5854
  /**
5847
5855
  * UiPath - Core SDK class for authentication and configuration management.
5848
5856
  *
@@ -5883,8 +5891,13 @@ let UiPath$1 = class UiPath {
5883
5891
  _UiPath_initialized.set(this, false);
5884
5892
  _UiPath_partialConfig.set(this, void 0);
5885
5893
  _UiPath_multiLogin.set(this, false);
5894
+ // Folder key sourced only from `<meta name="uipath:folder-key">` (coded-app
5895
+ // deployments). Not accepted via the public constructor; lives here so the
5896
+ // SDK can flow it through to BaseService.config without polluting BaseConfig.
5897
+ _UiPath_metaFolderKey.set(this, void 0);
5886
5898
  // Load configuration from meta tags
5887
5899
  const configFromMetaTags = loadFromMetaTags();
5900
+ __classPrivateFieldSet(this, _UiPath_metaFolderKey, configFromMetaTags?.folderKey, "f");
5888
5901
  // Merge configuration: constructor config overrides meta tags
5889
5902
  const mergedConfig = config ? { ...configFromMetaTags, ...config } : configFromMetaTags;
5890
5903
  if (mergedConfig && isCompleteConfig(mergedConfig)) {
@@ -6013,7 +6026,7 @@ let UiPath$1 = class UiPath {
6013
6026
  __classPrivateFieldGet(this, _UiPath_authService, "f")?.updateToken(tokenInfo);
6014
6027
  }
6015
6028
  };
6016
- _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_multiLogin = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
6029
+ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap(), _UiPath_partialConfig = new WeakMap(), _UiPath_multiLogin = new WeakMap(), _UiPath_metaFolderKey = new WeakMap(), _UiPath_instances = new WeakSet(), _UiPath_initializeWithConfig = function _UiPath_initializeWithConfig(config) {
6017
6030
  // Validate and normalize the configuration
6018
6031
  validateConfig(config);
6019
6032
  const hasSecretAuth = hasSecretConfig(config);
@@ -6026,7 +6039,7 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
6026
6039
  secret: hasSecretAuth ? config.secret : undefined,
6027
6040
  clientId: hasOAuthAuth ? config.clientId : undefined,
6028
6041
  redirectUri: hasOAuthAuth ? config.redirectUri : undefined,
6029
- scope: hasOAuthAuth ? config.scope : undefined
6042
+ scope: hasOAuthAuth ? config.scope : undefined,
6030
6043
  });
6031
6044
  const executionContext = new ExecutionContext();
6032
6045
  __classPrivateFieldSet(this, _UiPath_authService, new AuthService(internalConfig, executionContext), "f");
@@ -6034,11 +6047,14 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
6034
6047
  __classPrivateFieldGet(this, _UiPath_authService, "f").setMultiLogin();
6035
6048
  }
6036
6049
  __classPrivateFieldSet(this, _UiPath_config, internalConfig, "f");
6037
- // Store internals in SDKInternalsRegistry (not visible on instance)
6050
+ // Store internals in SDKInternalsRegistry (not visible on instance).
6051
+ // `folderKey` is meta-tag-only — kept off `UiPathConfig` (which mirrors
6052
+ // user-passed values) and lives here on the runtime registry instead.
6038
6053
  SDKInternalsRegistry.set(this, {
6039
6054
  config: internalConfig,
6040
6055
  context: executionContext,
6041
- tokenManager: __classPrivateFieldGet(this, _UiPath_authService, "f").getTokenManager()
6056
+ tokenManager: __classPrivateFieldGet(this, _UiPath_authService, "f").getTokenManager(),
6057
+ folderKey: __classPrivateFieldGet(this, _UiPath_metaFolderKey, "f"),
6042
6058
  });
6043
6059
  // Expose read-only config for user convenience
6044
6060
  this.config = {
@@ -6066,6 +6082,7 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
6066
6082
  }, _UiPath_loadConfig = function _UiPath_loadConfig() {
6067
6083
  // Load from meta tags
6068
6084
  const metaConfig = loadFromMetaTags();
6085
+ __classPrivateFieldSet(this, _UiPath_metaFolderKey, metaConfig?.folderKey, "f");
6069
6086
  // Merge with any partial config from constructor (constructor overrides meta tags)
6070
6087
  const merged = { ...metaConfig, ...__classPrivateFieldGet(this, _UiPath_partialConfig, "f") };
6071
6088
  if (!isCompleteConfig(merged)) {
@@ -6309,6 +6326,7 @@ class ErrorFactory {
6309
6326
  }
6310
6327
 
6311
6328
  const FOLDER_KEY = 'X-UIPATH-FolderKey';
6329
+ const FOLDER_PATH_ENCODED = 'X-UIPATH-FolderPath-Encoded';
6312
6330
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
6313
6331
  const TRACEPARENT = 'traceparent';
6314
6332
  const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
@@ -6455,6 +6473,27 @@ var PaginationType;
6455
6473
  /**
6456
6474
  * Collection of utility functions for working with objects
6457
6475
  */
6476
+ /**
6477
+ * Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
6478
+ * and dot-separated nested paths (e.g., 'pagination.totalCount').
6479
+ * Direct key match takes priority over nested traversal.
6480
+ */
6481
+ function resolveNestedField(data, fieldPath) {
6482
+ if (!data) {
6483
+ return undefined;
6484
+ }
6485
+ if (fieldPath in data) {
6486
+ return data[fieldPath];
6487
+ }
6488
+ if (!fieldPath.includes('.')) {
6489
+ return undefined;
6490
+ }
6491
+ let value = data;
6492
+ for (const part of fieldPath.split('.')) {
6493
+ value = value?.[part];
6494
+ }
6495
+ return value;
6496
+ }
6458
6497
  /**
6459
6498
  * Filters out undefined values from an object
6460
6499
  * @param obj The source object
@@ -6714,6 +6753,26 @@ const BUCKET_PAGINATION = {
6714
6753
  /** Field name for continuation token in bucket file metadata response */
6715
6754
  CONTINUATION_TOKEN_FIELD: 'continuationToken'
6716
6755
  };
6756
+ /**
6757
+ * SLA Summary pagination constants for page-number-based pagination
6758
+ */
6759
+ const SLA_SUMMARY_PAGINATION = {
6760
+ /** Field name for items in SLA summary response */
6761
+ ITEMS_FIELD: 'data',
6762
+ /** Dot-notation path for total count in nested pagination object */
6763
+ TOTAL_COUNT_FIELD: 'pagination.totalCount'
6764
+ };
6765
+ /**
6766
+ * SLA Summary OFFSET pagination parameter names (page-number style, no skip conversion)
6767
+ */
6768
+ const SLA_SUMMARY_OFFSET_PARAMS = {
6769
+ /** Page size parameter name */
6770
+ PAGE_SIZE_PARAM: 'PageSize',
6771
+ /** Page number parameter name (sent directly, not converted to skip) */
6772
+ OFFSET_PARAM: 'PageNumber',
6773
+ /** No count param needed */
6774
+ COUNT_PARAM: undefined
6775
+ };
6717
6776
  /**
6718
6777
  * Process Instance pagination constants for token-based pagination
6719
6778
  */
@@ -6764,6 +6823,14 @@ const PROCESS_INSTANCE_TOKEN_PARAMS = {
6764
6823
  TOKEN_PARAM: 'nextPage'
6765
6824
  };
6766
6825
 
6826
+ /**
6827
+ * Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
6828
+ * Returns the original value if parsing fails.
6829
+ */
6830
+ function toISOUtc(value) {
6831
+ const date = new Date(value + ' UTC');
6832
+ return isNaN(date.getTime()) ? value : date.toISOString();
6833
+ }
6767
6834
  /**
6768
6835
  * Transforms data by mapping fields according to the provided field mapping
6769
6836
  * @param data The source data to transform
@@ -7320,7 +7387,8 @@ class PaginationHelpers {
7320
7387
  // Extract and transform items from response
7321
7388
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
7322
7389
  const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
7323
- const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
7390
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
7391
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
7324
7392
  // Parse items - automatically handle JSON string responses
7325
7393
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
7326
7394
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -7441,8 +7509,9 @@ class BaseService {
7441
7509
  constructor(instance, headers) {
7442
7510
  // Private field - not visible via Object.keys() or any reflection
7443
7511
  _BaseService_apiClient.set(this, void 0);
7444
- const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
7512
+ const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
7445
7513
  __classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
7514
+ this.config = { folderKey };
7446
7515
  }
7447
7516
  /**
7448
7517
  * Gets a valid authentication token, refreshing if necessary.
@@ -7561,9 +7630,17 @@ class BaseService {
7561
7630
  const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
7562
7631
  const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
7563
7632
  const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
7633
+ // When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
7634
+ // When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
7635
+ const convertToSkip = paginationParams?.convertToSkip ?? true;
7564
7636
  requestParams[pageSizeParam] = limitedPageSize;
7565
- if (params.pageNumber && params.pageNumber > 1) {
7566
- requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
7637
+ if (convertToSkip) {
7638
+ if (params.pageNumber && params.pageNumber > 1) {
7639
+ requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
7640
+ }
7641
+ }
7642
+ else {
7643
+ requestParams[offsetParam] = params.pageNumber || 1;
7567
7644
  }
7568
7645
  {
7569
7646
  requestParams[countParam] = true;
@@ -7594,7 +7671,8 @@ class BaseService {
7594
7671
  // Extract items and metadata
7595
7672
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
7596
7673
  const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
7597
- const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
7674
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
7675
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
7598
7676
  const continuationToken = response.data[continuationTokenField];
7599
7677
  // Determine if there are more pages
7600
7678
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -7804,6 +7882,17 @@ var QueryFilterOperator;
7804
7882
  QueryFilterOperator["In"] = "in";
7805
7883
  QueryFilterOperator["NotIn"] = "not in";
7806
7884
  })(QueryFilterOperator || (QueryFilterOperator = {}));
7885
+ /**
7886
+ * Aggregate functions supported by the Data Fabric query API.
7887
+ */
7888
+ var EntityAggregateFunction;
7889
+ (function (EntityAggregateFunction) {
7890
+ EntityAggregateFunction["Count"] = "COUNT";
7891
+ EntityAggregateFunction["Sum"] = "SUM";
7892
+ EntityAggregateFunction["Avg"] = "AVG";
7893
+ EntityAggregateFunction["Min"] = "MIN";
7894
+ EntityAggregateFunction["Max"] = "MAX";
7895
+ })(EntityAggregateFunction || (EntityAggregateFunction = {}));
7807
7896
  /**
7808
7897
  * Entity type enum
7809
7898
  */
@@ -8393,16 +8482,16 @@ class EntityService extends BaseService {
8393
8482
  return entities;
8394
8483
  }
8395
8484
  /**
8396
- * Queries entity records with filters, sorting, and pagination
8485
+ * Queries entity records with filters, sorting, aggregates, and pagination
8397
8486
  *
8398
8487
  * @param id - UUID of the entity
8399
- * @param options - Query options including filterGroup, selectedFields, sortOptions, and pagination
8488
+ * @param options - Query options including filterGroup, selectedFields, sortOptions, aggregates, groupBy, and pagination
8400
8489
  * @returns Promise resolving to {@link NonPaginatedResponse} without pagination options,
8401
8490
  * or {@link PaginatedResponse} when `pageSize`, `cursor`, or `jumpToPage` are provided
8402
8491
  *
8403
8492
  * @example
8404
8493
  * ```typescript
8405
- * import { Entities, LogicalOperator, QueryFilterOperator } from '@uipath/uipath-typescript/entities';
8494
+ * import { Entities, LogicalOperator, QueryFilterOperator, EntityAggregateFunction } from '@uipath/uipath-typescript/entities';
8406
8495
  *
8407
8496
  * const entities = new Entities(sdk);
8408
8497
  *
@@ -8426,6 +8515,23 @@ class EntityService extends BaseService {
8426
8515
  * if (page1.hasNextPage) {
8427
8516
  * const page2 = await entities.queryRecordsById("<entityId>", { cursor: page1.nextCursor });
8428
8517
  * }
8518
+ *
8519
+ * // Aggregate: count of records per status
8520
+ * await entities.queryRecordsById("<entityId>", {
8521
+ * selectedFields: ["status"],
8522
+ * groupBy: ["status"],
8523
+ * aggregates: [
8524
+ * { function: EntityAggregateFunction.Count, field: "Id", alias: "total" },
8525
+ * ],
8526
+ * });
8527
+ *
8528
+ * // Aggregate: total sum and average across all records (no grouping)
8529
+ * await entities.queryRecordsById("<entityId>", {
8530
+ * aggregates: [
8531
+ * { function: EntityAggregateFunction.Sum, field: "amount", alias: "totalAmount" },
8532
+ * { function: EntityAggregateFunction.Avg, field: "amount", alias: "avgAmount" },
8533
+ * ],
8534
+ * });
8429
8535
  * ```
8430
8536
  */
8431
8537
  async queryRecordsById(id, options) {
@@ -8443,7 +8549,7 @@ class EntityService extends BaseService {
8443
8549
  countParam: ENTITY_OFFSET_PARAMS.COUNT_PARAM
8444
8550
  }
8445
8551
  },
8446
- excludeFromPrefix: ['expansionLevel', 'filterGroup', 'selectedFields', 'sortOptions']
8552
+ excludeFromPrefix: ['expansionLevel', 'filterGroup', 'selectedFields', 'sortOptions', 'aggregates', 'groupBy']
8447
8553
  }, options);
8448
8554
  }
8449
8555
  /**
@@ -9453,6 +9559,41 @@ var DebugMode;
9453
9559
  * Case Instance Types
9454
9560
  * Types and interfaces for Maestro case instance management
9455
9561
  */
9562
+ /**
9563
+ * SLA status for a case instance
9564
+ */
9565
+ var SlaSummaryStatus;
9566
+ (function (SlaSummaryStatus) {
9567
+ /** Case is within SLA deadline */
9568
+ SlaSummaryStatus["ON_TRACK"] = "On Track";
9569
+ /** Case is approaching SLA deadline based on at-risk percentage threshold */
9570
+ SlaSummaryStatus["AT_RISK"] = "At Risk";
9571
+ /** Case has exceeded SLA deadline */
9572
+ SlaSummaryStatus["OVERDUE"] = "Overdue";
9573
+ /** Case instance has completed */
9574
+ SlaSummaryStatus["COMPLETED"] = "Completed";
9575
+ /** SLA status cannot be determined (no SLA deadline defined) */
9576
+ SlaSummaryStatus["UNKNOWN"] = "Unknown";
9577
+ })(SlaSummaryStatus || (SlaSummaryStatus = {}));
9578
+ /**
9579
+ * Instance status values for case instances and process instances
9580
+ */
9581
+ var InstanceStatus;
9582
+ (function (InstanceStatus) {
9583
+ /** Instance status not yet populated by the backend */
9584
+ InstanceStatus["UNKNOWN"] = "";
9585
+ InstanceStatus["CANCELLED"] = "Cancelled";
9586
+ InstanceStatus["CANCELING"] = "Canceling";
9587
+ InstanceStatus["COMPLETED"] = "Completed";
9588
+ InstanceStatus["FAULTED"] = "Faulted";
9589
+ InstanceStatus["PAUSED"] = "Paused";
9590
+ InstanceStatus["PAUSING"] = "Pausing";
9591
+ InstanceStatus["PENDING"] = "Pending";
9592
+ InstanceStatus["RESUMING"] = "Resuming";
9593
+ InstanceStatus["RETRYING"] = "Retrying";
9594
+ InstanceStatus["RUNNING"] = "Running";
9595
+ InstanceStatus["UPGRADING"] = "Upgrading";
9596
+ })(InstanceStatus || (InstanceStatus = {}));
9456
9597
  /**
9457
9598
  * Case stage task type
9458
9599
  */
@@ -9487,6 +9628,8 @@ var EscalationTriggerType;
9487
9628
  (function (EscalationTriggerType) {
9488
9629
  EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
9489
9630
  EscalationTriggerType["AT_RISK"] = "at-risk";
9631
+ /** Default value when no escalation rule is defined */
9632
+ EscalationTriggerType["NONE"] = "None";
9490
9633
  })(EscalationTriggerType || (EscalationTriggerType = {}));
9491
9634
  /**
9492
9635
  * SLA duration unit
@@ -9554,6 +9697,11 @@ function createCaseInstanceMethods(instanceData, service) {
9554
9697
  if (!instanceData.instanceId)
9555
9698
  throw new Error('Case instance ID is undefined');
9556
9699
  return service.getActionTasks(instanceData.instanceId, options);
9700
+ },
9701
+ async getSlaSummary(options) {
9702
+ if (!instanceData.instanceId)
9703
+ throw new Error('Case instance ID is undefined');
9704
+ return service.getSlaSummary({ ...options, caseInstanceId: instanceData.instanceId });
9557
9705
  }
9558
9706
  };
9559
9707
  }
@@ -11108,6 +11256,70 @@ class CaseInstancesService extends BaseService {
11108
11256
  };
11109
11257
  return await this.taskService.getAll(enhancedOptions);
11110
11258
  }
11259
+ /**
11260
+ * Get SLA summary for all case instances across folders.
11261
+ *
11262
+ * Returns SLA status, due times, escalation info, and instance metadata for each case instance.
11263
+ * The default page size is 50, so only the top 50 items are returned when no pagination options are provided.
11264
+ *
11265
+ * @param options - Optional filtering and pagination options
11266
+ * @returns Promise resolving to {@link SlaSummaryResponse}, paginated or non-paginated based on options
11267
+ * @example
11268
+ * ```typescript
11269
+ * // Non-paginated (returns top 50 items by default)
11270
+ * const summary = await caseInstances.getSlaSummary();
11271
+ * console.log(`Found ${summary.totalCount} cases`);
11272
+ *
11273
+ * // Filter by case instance ID
11274
+ * const filtered = await caseInstances.getSlaSummary({
11275
+ * caseInstanceId: '<caseInstanceId>'
11276
+ * });
11277
+ *
11278
+ * // Filter by time range
11279
+ * const timeFiltered = await caseInstances.getSlaSummary({
11280
+ * startTimeUtc: new Date('2026-01-01'),
11281
+ * endTimeUtc: new Date('2026-01-31')
11282
+ * });
11283
+ *
11284
+ * // With pagination
11285
+ * const page1 = await caseInstances.getSlaSummary({ pageSize: 25 });
11286
+ * if (page1.hasNextPage) {
11287
+ * const page2 = await caseInstances.getSlaSummary({ cursor: page1.nextCursor });
11288
+ * }
11289
+ *
11290
+ * // Jump to specific page
11291
+ * const page3 = await caseInstances.getSlaSummary({ jumpToPage: 3, pageSize: 25 });
11292
+ * ```
11293
+ */
11294
+ async getSlaSummary(options) {
11295
+ const apiOptions = options ? {
11296
+ ...options,
11297
+ startTimeUtc: options.startTimeUtc?.toISOString(),
11298
+ endTimeUtc: options.endTimeUtc?.toISOString()
11299
+ } : undefined;
11300
+ return PaginationHelpers.getAll({
11301
+ serviceAccess: this.createPaginationServiceAccess(),
11302
+ getEndpoint: () => MAESTRO_ENDPOINTS.INSIGHTS.SLA_SUMMARY,
11303
+ method: HTTP_METHODS.POST,
11304
+ excludeFromPrefix: ['caseInstanceId', 'startTimeUtc', 'endTimeUtc'],
11305
+ transformFn: (item) => ({
11306
+ ...item,
11307
+ slaDueTime: toISOUtc(item.slaDueTime),
11308
+ lastModifiedTime: toISOUtc(item.lastModifiedTime)
11309
+ }),
11310
+ pagination: {
11311
+ paginationType: PaginationType.OFFSET,
11312
+ itemsField: SLA_SUMMARY_PAGINATION.ITEMS_FIELD,
11313
+ totalCountField: SLA_SUMMARY_PAGINATION.TOTAL_COUNT_FIELD,
11314
+ paginationParams: {
11315
+ pageSizeParam: SLA_SUMMARY_OFFSET_PARAMS.PAGE_SIZE_PARAM,
11316
+ offsetParam: SLA_SUMMARY_OFFSET_PARAMS.OFFSET_PARAM,
11317
+ countParam: SLA_SUMMARY_OFFSET_PARAMS.COUNT_PARAM,
11318
+ convertToSkip: false
11319
+ }
11320
+ }
11321
+ }, apiOptions);
11322
+ }
11111
11323
  }
11112
11324
  __decorate([
11113
11325
  track('CaseInstances.GetAll')
@@ -11136,7 +11348,115 @@ __decorate([
11136
11348
  __decorate([
11137
11349
  track('CaseInstances.GetActionTasks')
11138
11350
  ], CaseInstancesService.prototype, "getActionTasks", null);
11351
+ __decorate([
11352
+ track('CaseInstances.GetSlaSummary')
11353
+ ], CaseInstancesService.prototype, "getSlaSummary", null);
11354
+
11355
+ /**
11356
+ * Validates the `name` argument passed to a `getByName(name, ...)` method.
11357
+ * Trims whitespace and rejects empty/whitespace-only names.
11358
+ *
11359
+ * @param resourceType - Resource label used in error messages (e.g. 'Asset', 'Process')
11360
+ * @param name - Resource name to validate
11361
+ * @returns The trimmed name
11362
+ * @throws ValidationError when `name` is missing or empty after trimming
11363
+ */
11364
+ function validateName(resourceType, name) {
11365
+ if (!name) {
11366
+ throw new ValidationError({
11367
+ message: `${resourceType} name is required and cannot be empty.`,
11368
+ });
11369
+ }
11370
+ const trimmed = name.trim();
11371
+ if (!trimmed) {
11372
+ throw new ValidationError({
11373
+ message: `${resourceType} name is required and cannot be empty.`,
11374
+ });
11375
+ }
11376
+ return trimmed;
11377
+ }
11139
11378
 
11379
+ /**
11380
+ * Encodes a folder path for the `X-UIPATH-FolderPath-Encoded` header.
11381
+ *
11382
+ * Orchestrator decodes this header as **base64-encoded UTF-16 LE bytes**
11383
+ * (see `HttpHeadersProviderExtensions.GetDecoded` + `OrganizationUnitProvider`
11384
+ * in the Orchestrator repo, which call `Encoding.Unicode.GetString(...)`).
11385
+ * URL-encoding is NOT what the server expects — it must be base64-of-UTF-16-LE
11386
+ * bytes.
11387
+ *
11388
+ * @param folderPath - The folder path (e.g. 'Shared/Finance')
11389
+ * @returns Base64 string suitable for the `X-UIPATH-FolderPath-Encoded` header
11390
+ */
11391
+ function encodeFolderPathHeader(folderPath) {
11392
+ // Force little-endian regardless of host byte order. `Uint16Array` viewed
11393
+ // as `Uint8Array` would use the host's native order — correct on LE hosts
11394
+ // (x86/ARM-LE) but wrong on BE hosts. `DataView.setUint16(..., true)`
11395
+ // pins LE.
11396
+ const buf = new ArrayBuffer(folderPath.length * 2);
11397
+ const view = new DataView(buf);
11398
+ for (let i = 0; i < folderPath.length; i++) {
11399
+ view.setUint16(i * 2, folderPath.charCodeAt(i), true);
11400
+ }
11401
+ const bytes = new Uint8Array(buf);
11402
+ let binary = '';
11403
+ for (let i = 0; i < bytes.byteLength; i++) {
11404
+ binary += String.fromCharCode(bytes[i]);
11405
+ }
11406
+ // btoa is browser-native; Node 16+ also has it as a global
11407
+ return btoa(binary);
11408
+ }
11409
+
11410
+ /**
11411
+ * Resolves folder context into the appropriate Orchestrator folder headers.
11412
+ *
11413
+ * Centralized so all folder-scoped methods (e.g. `assets.getByName`,
11414
+ * `processes.getByName`, future Queues/Buckets/Jobs) share one implementation.
11415
+ *
11416
+ * Each input field maps directly to its header — no auto-detection or type
11417
+ * coercion. When multiple fields are supplied, all corresponding headers
11418
+ * are forwarded and the server resolves precedence.
11419
+ *
11420
+ * Routing:
11421
+ * - `folderId` → `X-UIPATH-OrganizationUnitId`
11422
+ * - `folderKey` → `X-UIPATH-FolderKey`
11423
+ * - `folderPath` → `X-UIPATH-FolderPath-Encoded`
11424
+ * - none set + `fallbackFolderKey` → fallback used as `X-UIPATH-FolderKey`
11425
+ * - none set + no fallback → `ValidationError`
11426
+ *
11427
+ * @throws ValidationError when no folder context can be resolved.
11428
+ */
11429
+ function resolveFolderHeaders(input) {
11430
+ const { folderId, folderKey, folderPath, resourceType, fallbackFolderKey } = input;
11431
+ const trimmedKey = folderKey?.trim();
11432
+ const trimmedPath = folderPath?.trim();
11433
+ const headers = {};
11434
+ if (folderId !== undefined) {
11435
+ headers[FOLDER_ID] = folderId;
11436
+ }
11437
+ if (trimmedKey) {
11438
+ headers[FOLDER_KEY] = trimmedKey;
11439
+ }
11440
+ if (trimmedPath) {
11441
+ headers[FOLDER_PATH_ENCODED] = encodeFolderPathHeader(trimmedPath);
11442
+ }
11443
+ // No explicit folder context → meta-tag fallback or error.
11444
+ if (Object.keys(headers).length === 0) {
11445
+ if (!fallbackFolderKey) {
11446
+ throw new ValidationError({
11447
+ message: `${resourceType} requires folder context: pass \`folderId\`, \`folderKey\`, or \`folderPath\`, or initialize the SDK with a folder context.`,
11448
+ });
11449
+ }
11450
+ headers[FOLDER_KEY] = fallbackFolderKey;
11451
+ }
11452
+ return createHeaders(headers);
11453
+ }
11454
+
11455
+ /**
11456
+ * Matches single-quote characters in OData string literals — escaped to `''`
11457
+ * inside the `$filter=Name eq '…'` clause built by `getByNameLookup`.
11458
+ */
11459
+ const SINGLE_QUOTE_RE = /'/g;
11140
11460
  /**
11141
11461
  * Base service for services that need folder-specific functionality.
11142
11462
  *
@@ -11170,6 +11490,68 @@ class FolderScopedService extends BaseService {
11170
11490
  }
11171
11491
  return response.data?.value;
11172
11492
  }
11493
+ /**
11494
+ * Look up a single resource by name on a folder-scoped OData collection.
11495
+ *
11496
+ * Shared by `getByName` implementations across services (Assets, Processes, etc).
11497
+ * Handles:
11498
+ * - Name validation via `validateName`
11499
+ * - Folder header resolution via `resolveFolderHeaders` (folderId → ID/key
11500
+ * header by type, folderPath → encoded path header, falls back to
11501
+ * init-time `config.folderKey` from the `uipath:folder-key` meta tag)
11502
+ * - OData `$filter=Name eq '…'` with single-quote escaping + `$top=1`
11503
+ * - Empty-result → `NotFoundError` with folder context in the message
11504
+ *
11505
+ * The transform step is caller-provided because each resource has its own
11506
+ * PascalCase → camelCase field mapping.
11507
+ *
11508
+ * @param resourceType - Resource label used in validation + error messages (e.g. 'Asset', 'Process')
11509
+ * @param endpoint - Folder-scoped OData collection endpoint
11510
+ * @param name - Resource name to search for
11511
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) + OData query options (`expand`, `select`)
11512
+ * @param transform - Maps a raw OData item to the typed response (e.g. PascalCase → camelCase via field map)
11513
+ * @throws ValidationError when inputs are malformed; NotFoundError when no match
11514
+ */
11515
+ async getByNameLookup(resourceType, endpoint, name, options, transform) {
11516
+ const validatedName = validateName(resourceType, name);
11517
+ const { folderId, folderKey, folderPath, ...queryOptions } = options;
11518
+ const headers = resolveFolderHeaders({
11519
+ folderId,
11520
+ folderKey,
11521
+ folderPath,
11522
+ resourceType: `${resourceType}.getByName`,
11523
+ fallbackFolderKey: this.config.folderKey,
11524
+ });
11525
+ const apiOptions = {
11526
+ ...addPrefixToKeys(queryOptions, ODATA_PREFIX, Object.keys(queryOptions)),
11527
+ '$filter': `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
11528
+ '$top': '1',
11529
+ };
11530
+ const response = await this.get(endpoint, {
11531
+ headers,
11532
+ params: apiOptions,
11533
+ });
11534
+ const items = response.data?.value;
11535
+ if (!items?.length) {
11536
+ const folderHint = describeFolderForError(folderId, folderKey, folderPath);
11537
+ throw new NotFoundError({
11538
+ message: `${resourceType} '${validatedName}' not found${folderHint}.`,
11539
+ });
11540
+ }
11541
+ return transform(items[0]);
11542
+ }
11543
+ }
11544
+ /** Renders the supplied folder for a NotFoundError message. */
11545
+ function describeFolderForError(folderId, folderKey, folderPath) {
11546
+ const path = folderPath?.trim();
11547
+ if (path)
11548
+ return ` in folder '${path}'`;
11549
+ const key = folderKey?.trim();
11550
+ if (key)
11551
+ return ` in folder (key: ${key})`;
11552
+ if (typeof folderId === 'number')
11553
+ return ` in folder (id: ${folderId})`;
11554
+ return '';
11173
11555
  }
11174
11556
 
11175
11557
  /**
@@ -11267,6 +11649,35 @@ class AssetService extends FolderScopedService {
11267
11649
  const transformedAsset = transformData(pascalToCamelCaseKeys(response.data), AssetMap);
11268
11650
  return transformedAsset;
11269
11651
  }
11652
+ /**
11653
+ * Retrieves a single asset by name.
11654
+ *
11655
+ * @param name - Asset name to search for
11656
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional query parameters (`expand`, `select`)
11657
+ * @returns Promise resolving to a single asset
11658
+ * {@link AssetGetResponse}
11659
+ * @example
11660
+ * ```typescript
11661
+ * import { Assets } from '@uipath/uipath-typescript/assets';
11662
+ *
11663
+ * const assets = new Assets(sdk);
11664
+ *
11665
+ * // By folder ID
11666
+ * await assets.getByName('ApiKey', { folderId: 123 });
11667
+ *
11668
+ * // By folder key (GUID)
11669
+ * await assets.getByName('ApiKey', { folderKey: '5f6dadf1-3677-49dc-8aca-c2999dd4b3ba' });
11670
+ *
11671
+ * // By folder path
11672
+ * await assets.getByName('ApiKey', { folderPath: 'Shared/Finance' });
11673
+ *
11674
+ * // With expand
11675
+ * await assets.getByName('ApiKey', { folderPath: 'Shared/Finance', expand: 'keyValueList' });
11676
+ * ```
11677
+ */
11678
+ async getByName(name, options = {}) {
11679
+ return this.getByNameLookup('Asset', ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap));
11680
+ }
11270
11681
  }
11271
11682
  __decorate([
11272
11683
  track('Assets.GetAll')
@@ -11274,6 +11685,9 @@ __decorate([
11274
11685
  __decorate([
11275
11686
  track('Assets.GetById')
11276
11687
  ], AssetService.prototype, "getById", null);
11688
+ __decorate([
11689
+ track('Assets.GetByName')
11690
+ ], AssetService.prototype, "getByName", null);
11277
11691
 
11278
11692
  /**
11279
11693
  * Enum for Asset Value Scope
@@ -12377,7 +12791,7 @@ const ProcessMap = {
12377
12791
  /**
12378
12792
  * Service for interacting with UiPath Orchestrator Processes API
12379
12793
  */
12380
- class ProcessService extends BaseService {
12794
+ class ProcessService extends FolderScopedService {
12381
12795
  /**
12382
12796
  * Gets all processes across folders with optional filtering and folder scoping
12383
12797
  *
@@ -12514,6 +12928,35 @@ class ProcessService extends BaseService {
12514
12928
  const transformedProcess = transformData(pascalToCamelCaseKeys(response.data), ProcessMap);
12515
12929
  return transformedProcess;
12516
12930
  }
12931
+ /**
12932
+ * Retrieves a single process by name.
12933
+ *
12934
+ * @param name - Process name to search for
12935
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) and optional query parameters (`expand`, `select`)
12936
+ * @returns Promise resolving to a single process
12937
+ * {@link ProcessGetResponse}
12938
+ * @example
12939
+ * ```typescript
12940
+ * import { Processes } from '@uipath/uipath-typescript/processes';
12941
+ *
12942
+ * const processes = new Processes(sdk);
12943
+ *
12944
+ * // By folder ID
12945
+ * await processes.getByName('MyProcess', { folderId: 123 });
12946
+ *
12947
+ * // By folder key (GUID)
12948
+ * await processes.getByName('MyProcess', { folderKey: '5f6dadf1-3677-49dc-8aca-c2999dd4b3ba' });
12949
+ *
12950
+ * // By folder path
12951
+ * await processes.getByName('MyProcess', { folderPath: 'Shared/Finance' });
12952
+ *
12953
+ * // With expand
12954
+ * await processes.getByName('MyProcess', { folderPath: 'Shared/Finance', expand: 'entryPoints' });
12955
+ * ```
12956
+ */
12957
+ async getByName(name, options = {}) {
12958
+ return this.getByNameLookup('Process', PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap));
12959
+ }
12517
12960
  }
12518
12961
  __decorate([
12519
12962
  track('Processes.GetAll')
@@ -12524,6 +12967,9 @@ __decorate([
12524
12967
  __decorate([
12525
12968
  track('Processes.GetById')
12526
12969
  ], ProcessService.prototype, "getById", null);
12970
+ __decorate([
12971
+ track('Processes.GetByName')
12972
+ ], ProcessService.prototype, "getByName", null);
12527
12973
 
12528
12974
  /**
12529
12975
  * Maps fields for Queue entities to ensure consistent naming
@@ -13001,7 +13447,7 @@ const AgentMap = {
13001
13447
  };
13002
13448
 
13003
13449
  /**
13004
- * Constants for User Service
13450
+ * Constants for User Settings Service
13005
13451
  */
13006
13452
  /**
13007
13453
  * Maps fields for User Settings entities to ensure consistent SDK naming
@@ -13352,4 +13798,4 @@ function getAppBase() {
13352
13798
  return getMetaTagContent(UiPathMetaTags.APP_BASE) || '/';
13353
13799
  }
13354
13800
 
13355
- export { APP_NAME, AgentMap, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, CitationErrorType, ConversationMap, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, index as DuFramework, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, ExchangeMap, FeedbackRating, FeedbackStatus, FieldDisplayType, HttpStatus, InputStreamSpeechSensitivity, InterruptType, JobPriority, JobSourceType, JobState, JobSubState, JobType, JoinType, LogicalOperator$1 as LogicalOperator, MAX_PAGE_SIZE, MessageMap, MessageRole, NetworkError, NotFoundError, PackageSourceType, PackageType, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, QueryFilterOperator, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, RuntimeType, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, SLADurationUnit, ServerError, ServerlessJobType, SortOrder, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, UNKNOWN$1 as UNKNOWN, UiPath, UiPathError, UiPathMetaTags, UserSettingsMap, VERSION, ValidationError, createAgentWithMethods, createCaseInstanceWithMethods, createConversationWithMethods, createEntityWithMethods, createJobWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getAppBase, getAsset, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, loadFromMetaTags, telemetryClient, track, trackEvent };
13801
+ export { APP_NAME, AgentMap, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, CitationErrorType, ConversationMap, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, index as DuFramework, EntityAggregateFunction, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, ExchangeMap, FeedbackRating, FeedbackStatus, FieldDisplayType, HttpStatus, InputStreamSpeechSensitivity, InstanceStatus, InterruptType, JobPriority, JobSourceType, JobState, JobSubState, JobType, JoinType, LogicalOperator$1 as LogicalOperator, MAX_PAGE_SIZE, MessageMap, MessageRole, NetworkError, NotFoundError, PackageSourceType, PackageType, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, QueryFilterOperator, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, RuntimeType, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, SLADurationUnit, ServerError, ServerlessJobType, SlaSummaryStatus, SortOrder, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, UNKNOWN$1 as UNKNOWN, UiPath, UiPathError, UiPathMetaTags, UserSettingsMap, VERSION, ValidationError, createAgentWithMethods, createCaseInstanceWithMethods, createConversationWithMethods, createEntityWithMethods, createJobWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getAppBase, getAsset, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, loadFromMetaTags, telemetryClient, track, trackEvent };