@uipath/uipath-typescript 1.5.0 → 1.5.1

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 (45) hide show
  1. package/README.md +7 -1
  2. package/dist/assets/index.cjs +107 -6
  3. package/dist/assets/index.d.ts +12 -1
  4. package/dist/assets/index.mjs +107 -6
  5. package/dist/attachments/index.cjs +95 -3
  6. package/dist/attachments/index.mjs +95 -3
  7. package/dist/buckets/index.cjs +111 -6
  8. package/dist/buckets/index.d.ts +12 -1
  9. package/dist/buckets/index.mjs +111 -6
  10. package/dist/cases/index.cjs +434 -266
  11. package/dist/cases/index.d.ts +140 -3
  12. package/dist/cases/index.mjs +434 -266
  13. package/dist/conversational-agent/index.cjs +23 -1
  14. package/dist/conversational-agent/index.d.ts +117 -6
  15. package/dist/conversational-agent/index.mjs +23 -1
  16. package/dist/core/index.cjs +1 -1
  17. package/dist/core/index.mjs +1 -1
  18. package/dist/entities/index.cjs +423 -0
  19. package/dist/entities/index.d.ts +441 -1
  20. package/dist/entities/index.mjs +422 -1
  21. package/dist/index.cjs +974 -293
  22. package/dist/index.d.ts +1150 -43
  23. package/dist/index.mjs +975 -294
  24. package/dist/index.umd.js +974 -293
  25. package/dist/jobs/index.cjs +12 -5
  26. package/dist/jobs/index.d.ts +12 -1
  27. package/dist/jobs/index.mjs +12 -5
  28. package/dist/maestro-processes/index.cjs +344 -243
  29. package/dist/maestro-processes/index.d.ts +189 -5
  30. package/dist/maestro-processes/index.mjs +344 -243
  31. package/dist/notifications/index.cjs +2012 -0
  32. package/dist/notifications/index.d.ts +615 -0
  33. package/dist/notifications/index.mjs +2010 -0
  34. package/dist/processes/index.cjs +93 -9
  35. package/dist/processes/index.d.ts +12 -1
  36. package/dist/processes/index.mjs +93 -9
  37. package/dist/queues/index.cjs +106 -5
  38. package/dist/queues/index.d.ts +12 -1
  39. package/dist/queues/index.mjs +106 -5
  40. package/dist/tasks/index.cjs +100 -4
  41. package/dist/tasks/index.mjs +100 -4
  42. package/dist/traces/index.cjs +218 -4
  43. package/dist/traces/index.d.ts +357 -22
  44. package/dist/traces/index.mjs +219 -5
  45. package/package.json +14 -4
@@ -169,6 +169,7 @@ const MAESTRO_ENDPOINTS = {
169
169
  CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
170
170
  PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
171
171
  RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
172
+ RETRY: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/retry`,
172
173
  },
173
174
  INCIDENTS: {
174
175
  GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
@@ -193,6 +194,8 @@ const MAESTRO_ENDPOINTS = {
193
194
  INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
194
195
  /** Element count by status for agentic instances (process and case) */
195
196
  ELEMENT_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/ElementCountByStatus`,
197
+ /** Incident counts aggregated by time bucket for time-series charts */
198
+ INCIDENTS_BY_TIME_WINDOW: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/IncidentsByTimeWindow`,
196
199
  },
197
200
  };
198
201
 
@@ -241,6 +244,16 @@ function createProcessMethods(processData, service) {
241
244
  startTime,
242
245
  endTime,
243
246
  });
247
+ },
248
+ getInstanceStatusTimeline(startTime, endTime, options) {
249
+ if (!processData.processKey)
250
+ throw new Error('Process key is undefined');
251
+ return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
252
+ },
253
+ getIncidentsTimeline(startTime, endTime, options) {
254
+ if (!processData.processKey)
255
+ throw new Error('Process key is undefined');
256
+ return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
244
257
  }
245
258
  };
246
259
  }
@@ -256,6 +269,242 @@ function createProcessWithMethods(processData, service) {
256
269
  return Object.assign({}, processData, methods);
257
270
  }
258
271
 
272
+ /**
273
+ * Creates methods for a process instance
274
+ *
275
+ * @param instanceData - The process instance data (response from API)
276
+ * @param service - The process instance service instance
277
+ * @returns Object containing process instance methods
278
+ */
279
+ function createProcessInstanceMethods(instanceData, service) {
280
+ return {
281
+ async cancel(options) {
282
+ if (!instanceData.instanceId)
283
+ throw new Error('Process instance ID is undefined');
284
+ if (!instanceData.folderKey)
285
+ throw new Error('Process instance folder key is undefined');
286
+ return service.cancel(instanceData.instanceId, instanceData.folderKey, options);
287
+ },
288
+ async pause(options) {
289
+ if (!instanceData.instanceId)
290
+ throw new Error('Process instance ID is undefined');
291
+ if (!instanceData.folderKey)
292
+ throw new Error('Process instance folder key is undefined');
293
+ return service.pause(instanceData.instanceId, instanceData.folderKey, options);
294
+ },
295
+ async resume(options) {
296
+ if (!instanceData.instanceId)
297
+ throw new Error('Process instance ID is undefined');
298
+ if (!instanceData.folderKey)
299
+ throw new Error('Process instance folder key is undefined');
300
+ return service.resume(instanceData.instanceId, instanceData.folderKey, options);
301
+ },
302
+ async retry(options) {
303
+ if (!instanceData.instanceId)
304
+ throw new Error('Process instance ID is undefined');
305
+ if (!instanceData.folderKey)
306
+ throw new Error('Process instance folder key is undefined');
307
+ return service.retry(instanceData.instanceId, instanceData.folderKey, options);
308
+ },
309
+ async getIncidents() {
310
+ if (!instanceData.instanceId)
311
+ throw new Error('Process instance ID is undefined');
312
+ if (!instanceData.folderKey)
313
+ throw new Error('Process instance folder key is undefined');
314
+ return service.getIncidents(instanceData.instanceId, instanceData.folderKey);
315
+ },
316
+ async getExecutionHistory() {
317
+ if (!instanceData.instanceId)
318
+ throw new Error('Process instance ID is undefined');
319
+ if (!instanceData.folderKey)
320
+ throw new Error('Process instance folder key is undefined');
321
+ return service.getExecutionHistory(instanceData.instanceId, instanceData.folderKey);
322
+ },
323
+ async getBpmn() {
324
+ if (!instanceData.instanceId)
325
+ throw new Error('Process instance ID is undefined');
326
+ if (!instanceData.folderKey)
327
+ throw new Error('Process instance folder key is undefined');
328
+ return service.getBpmn(instanceData.instanceId, instanceData.folderKey);
329
+ },
330
+ async getVariables(options) {
331
+ if (!instanceData.instanceId)
332
+ throw new Error('Process instance ID is undefined');
333
+ if (!instanceData.folderKey)
334
+ throw new Error('Process instance folder key is undefined');
335
+ return service.getVariables(instanceData.instanceId, instanceData.folderKey, options);
336
+ }
337
+ };
338
+ }
339
+ /**
340
+ * Creates an actionable process instance by combining API process instance data with operational methods.
341
+ *
342
+ * @param instanceData - The process instance data from API
343
+ * @param service - The process instance service instance
344
+ * @returns A process instance object with added methods
345
+ */
346
+ function createProcessInstanceWithMethods(instanceData, service) {
347
+ const methods = createProcessInstanceMethods(instanceData, service);
348
+ return Object.assign({}, instanceData, methods);
349
+ }
350
+
351
+ /**
352
+ * Process Incident Status
353
+ */
354
+ var ProcessIncidentStatus;
355
+ (function (ProcessIncidentStatus) {
356
+ ProcessIncidentStatus["Open"] = "Open";
357
+ ProcessIncidentStatus["Closed"] = "Closed";
358
+ })(ProcessIncidentStatus || (ProcessIncidentStatus = {}));
359
+ /**
360
+ * Process Incident Type
361
+ */
362
+ var ProcessIncidentType;
363
+ (function (ProcessIncidentType) {
364
+ ProcessIncidentType["System"] = "System";
365
+ ProcessIncidentType["User"] = "User";
366
+ ProcessIncidentType["Deployment"] = "Deployment";
367
+ })(ProcessIncidentType || (ProcessIncidentType = {}));
368
+ /**
369
+ * Process Incident Severity
370
+ */
371
+ var ProcessIncidentSeverity;
372
+ (function (ProcessIncidentSeverity) {
373
+ ProcessIncidentSeverity["Error"] = "Error";
374
+ ProcessIncidentSeverity["Warning"] = "Warning";
375
+ })(ProcessIncidentSeverity || (ProcessIncidentSeverity = {}));
376
+ /**
377
+ * Process Incident Debug Mode
378
+ */
379
+ var DebugMode;
380
+ (function (DebugMode) {
381
+ DebugMode["None"] = "None";
382
+ DebugMode["Default"] = "Default";
383
+ DebugMode["StepByStep"] = "StepByStep";
384
+ DebugMode["SingleStep"] = "SingleStep";
385
+ })(DebugMode || (DebugMode = {}));
386
+
387
+ /**
388
+ * Case Instance Types
389
+ * Types and interfaces for Maestro case instance management
390
+ */
391
+ /**
392
+ * SLA status for a case instance
393
+ */
394
+ var SlaSummaryStatus;
395
+ (function (SlaSummaryStatus) {
396
+ /** Case is within SLA deadline */
397
+ SlaSummaryStatus["ON_TRACK"] = "On Track";
398
+ /** Case is approaching SLA deadline based on at-risk percentage threshold */
399
+ SlaSummaryStatus["AT_RISK"] = "At Risk";
400
+ /** Case has exceeded SLA deadline */
401
+ SlaSummaryStatus["OVERDUE"] = "Overdue";
402
+ /** Case instance has completed */
403
+ SlaSummaryStatus["COMPLETED"] = "Completed";
404
+ /** SLA status cannot be determined (no SLA deadline defined) */
405
+ SlaSummaryStatus["UNKNOWN"] = "Unknown";
406
+ })(SlaSummaryStatus || (SlaSummaryStatus = {}));
407
+ /**
408
+ * Instance status values for case instances and process instances
409
+ */
410
+ var InstanceStatus;
411
+ (function (InstanceStatus) {
412
+ /** Instance status not yet populated by the backend */
413
+ InstanceStatus["UNKNOWN"] = "";
414
+ InstanceStatus["CANCELLED"] = "Cancelled";
415
+ InstanceStatus["CANCELING"] = "Canceling";
416
+ InstanceStatus["COMPLETED"] = "Completed";
417
+ InstanceStatus["FAULTED"] = "Faulted";
418
+ InstanceStatus["PAUSED"] = "Paused";
419
+ InstanceStatus["PAUSING"] = "Pausing";
420
+ InstanceStatus["PENDING"] = "Pending";
421
+ InstanceStatus["RESUMING"] = "Resuming";
422
+ InstanceStatus["RETRYING"] = "Retrying";
423
+ InstanceStatus["RUNNING"] = "Running";
424
+ InstanceStatus["UPGRADING"] = "Upgrading";
425
+ })(InstanceStatus || (InstanceStatus = {}));
426
+ /**
427
+ * Case stage task type
428
+ */
429
+ var StageTaskType;
430
+ (function (StageTaskType) {
431
+ StageTaskType["EXTERNAL_AGENT"] = "external-agent";
432
+ StageTaskType["RPA"] = "rpa";
433
+ StageTaskType["AGENTIC_PROCESS"] = "process";
434
+ StageTaskType["AGENT"] = "agent";
435
+ StageTaskType["ACTION"] = "action";
436
+ StageTaskType["API_WORKFLOW"] = "api-workflow";
437
+ })(StageTaskType || (StageTaskType = {}));
438
+ /**
439
+ * Escalation recipient scope
440
+ */
441
+ var EscalationRecipientScope;
442
+ (function (EscalationRecipientScope) {
443
+ EscalationRecipientScope["USER"] = "user";
444
+ EscalationRecipientScope["USER_GROUP"] = "usergroup";
445
+ })(EscalationRecipientScope || (EscalationRecipientScope = {}));
446
+ /**
447
+ * Escalation action type
448
+ */
449
+ var EscalationActionType;
450
+ (function (EscalationActionType) {
451
+ EscalationActionType["NOTIFICATION"] = "notification";
452
+ })(EscalationActionType || (EscalationActionType = {}));
453
+ /**
454
+ * Escalation rule trigger type
455
+ */
456
+ var EscalationTriggerType;
457
+ (function (EscalationTriggerType) {
458
+ EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
459
+ EscalationTriggerType["AT_RISK"] = "at-risk";
460
+ /** Default value when no escalation rule is defined */
461
+ EscalationTriggerType["NONE"] = "None";
462
+ })(EscalationTriggerType || (EscalationTriggerType = {}));
463
+ /**
464
+ * SLA duration unit
465
+ */
466
+ var SLADurationUnit;
467
+ (function (SLADurationUnit) {
468
+ SLADurationUnit["HOURS"] = "h";
469
+ SLADurationUnit["DAYS"] = "d";
470
+ SLADurationUnit["WEEKS"] = "w";
471
+ SLADurationUnit["MONTHS"] = "m";
472
+ })(SLADurationUnit || (SLADurationUnit = {}));
473
+
474
+ /**
475
+ * Insights Types
476
+ * Shared types for Maestro insights analytics endpoints
477
+ */
478
+ /**
479
+ * Time bucketing granularity for insights time-series queries.
480
+ *
481
+ * Controls how data points are grouped on the time axis.
482
+ */
483
+ var TimeInterval;
484
+ (function (TimeInterval) {
485
+ /** Group data points by hour */
486
+ TimeInterval["Hour"] = "HOUR";
487
+ /** Group data points by day */
488
+ TimeInterval["Day"] = "DAY";
489
+ /** Group data points by week */
490
+ TimeInterval["Week"] = "WEEK";
491
+ })(TimeInterval || (TimeInterval = {}));
492
+ /**
493
+ * Final instance statuses returned by the instance status timeline endpoint.
494
+ *
495
+ * Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
496
+ * Active statuses like Running or Paused are not included.
497
+ */
498
+ var InstanceFinalStatus;
499
+ (function (InstanceFinalStatus) {
500
+ /** Instance completed successfully */
501
+ InstanceFinalStatus["Completed"] = "Completed";
502
+ /** Instance encountered an error */
503
+ InstanceFinalStatus["Faulted"] = "Faulted";
504
+ /** Instance was cancelled */
505
+ InstanceFinalStatus["Cancelled"] = "Cancelled";
506
+ })(InstanceFinalStatus || (InstanceFinalStatus = {}));
507
+
259
508
  /**
260
509
  * Builds the request body for Insights RTM "top" endpoints.
261
510
  *
@@ -279,28 +528,29 @@ function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
279
528
  };
280
529
  }
281
530
  /**
282
- * Fetches instance status timeline from the Insights API.
283
- * Shared implementation used by both MaestroProcessesService and CasesService.
531
+ * Builds the request body for Insights RTM timeline endpoints
532
+ * (`InstanceStatusByDate`, `IncidentsByTimeWindow`).
284
533
  *
285
- * @param postFn - Bound post method from a BaseService subclass
286
534
  * @param startTime - Start of the time range to query
287
535
  * @param endTime - End of the time range to query
288
536
  * @param isCaseManagement - Whether to filter for case management processes
289
- * @param options - Optional settings for time bucketing granularity
290
- * @returns Promise resolving to an array of instance status timeline entries
537
+ * @param options - Optional time bucketing and filtering settings
538
+ * @returns Request body for the Insights RTM timeline endpoint
291
539
  * @internal
292
540
  */
293
- async function fetchInstanceStatusTimeline(postFn, startTime, endTime, isCaseManagement, options) {
294
- const response = await postFn(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, {
541
+ function buildInsightsTimelineBody(startTime, endTime, isCaseManagement, options) {
542
+ return {
295
543
  commonParams: {
296
544
  startTime: startTime.getTime(),
297
545
  endTime: endTime.getTime(),
298
546
  isCaseManagement,
547
+ ...(options?.packageId ? { packageId: options.packageId } : {}),
548
+ ...(options?.version ? { version: options.version } : {}),
549
+ ...(options?.processKeys ? { processKeys: options.processKeys } : {}),
299
550
  },
300
- timeSliceUnit: options?.groupBy,
551
+ timeSliceUnit: options?.groupBy ?? TimeInterval.Day,
301
552
  timezoneOffset: new Date().getTimezoneOffset() * -1,
302
- });
303
- return response.data ?? [];
553
+ };
304
554
  }
305
555
  /**
306
556
  * Builds the commonParams request body for Insights RTM endpoints
@@ -1996,236 +2246,7 @@ class BaseService {
1996
2246
  _BaseService_apiClient = new WeakMap();
1997
2247
 
1998
2248
  /**
1999
- * Creates methods for a process instance
2000
- *
2001
- * @param instanceData - The process instance data (response from API)
2002
- * @param service - The process instance service instance
2003
- * @returns Object containing process instance methods
2004
- */
2005
- function createProcessInstanceMethods(instanceData, service) {
2006
- return {
2007
- async cancel(options) {
2008
- if (!instanceData.instanceId)
2009
- throw new Error('Process instance ID is undefined');
2010
- if (!instanceData.folderKey)
2011
- throw new Error('Process instance folder key is undefined');
2012
- return service.cancel(instanceData.instanceId, instanceData.folderKey, options);
2013
- },
2014
- async pause(options) {
2015
- if (!instanceData.instanceId)
2016
- throw new Error('Process instance ID is undefined');
2017
- if (!instanceData.folderKey)
2018
- throw new Error('Process instance folder key is undefined');
2019
- return service.pause(instanceData.instanceId, instanceData.folderKey, options);
2020
- },
2021
- async resume(options) {
2022
- if (!instanceData.instanceId)
2023
- throw new Error('Process instance ID is undefined');
2024
- if (!instanceData.folderKey)
2025
- throw new Error('Process instance folder key is undefined');
2026
- return service.resume(instanceData.instanceId, instanceData.folderKey, options);
2027
- },
2028
- async getIncidents() {
2029
- if (!instanceData.instanceId)
2030
- throw new Error('Process instance ID is undefined');
2031
- if (!instanceData.folderKey)
2032
- throw new Error('Process instance folder key is undefined');
2033
- return service.getIncidents(instanceData.instanceId, instanceData.folderKey);
2034
- },
2035
- async getExecutionHistory() {
2036
- if (!instanceData.instanceId)
2037
- throw new Error('Process instance ID is undefined');
2038
- if (!instanceData.folderKey)
2039
- throw new Error('Process instance folder key is undefined');
2040
- return service.getExecutionHistory(instanceData.instanceId, instanceData.folderKey);
2041
- },
2042
- async getBpmn() {
2043
- if (!instanceData.instanceId)
2044
- throw new Error('Process instance ID is undefined');
2045
- if (!instanceData.folderKey)
2046
- throw new Error('Process instance folder key is undefined');
2047
- return service.getBpmn(instanceData.instanceId, instanceData.folderKey);
2048
- },
2049
- async getVariables(options) {
2050
- if (!instanceData.instanceId)
2051
- throw new Error('Process instance ID is undefined');
2052
- if (!instanceData.folderKey)
2053
- throw new Error('Process instance folder key is undefined');
2054
- return service.getVariables(instanceData.instanceId, instanceData.folderKey, options);
2055
- }
2056
- };
2057
- }
2058
- /**
2059
- * Creates an actionable process instance by combining API process instance data with operational methods.
2060
- *
2061
- * @param instanceData - The process instance data from API
2062
- * @param service - The process instance service instance
2063
- * @returns A process instance object with added methods
2064
- */
2065
- function createProcessInstanceWithMethods(instanceData, service) {
2066
- const methods = createProcessInstanceMethods(instanceData, service);
2067
- return Object.assign({}, instanceData, methods);
2068
- }
2069
-
2070
- /**
2071
- * Process Incident Status
2072
- */
2073
- var ProcessIncidentStatus;
2074
- (function (ProcessIncidentStatus) {
2075
- ProcessIncidentStatus["Open"] = "Open";
2076
- ProcessIncidentStatus["Closed"] = "Closed";
2077
- })(ProcessIncidentStatus || (ProcessIncidentStatus = {}));
2078
- /**
2079
- * Process Incident Type
2080
- */
2081
- var ProcessIncidentType;
2082
- (function (ProcessIncidentType) {
2083
- ProcessIncidentType["System"] = "System";
2084
- ProcessIncidentType["User"] = "User";
2085
- ProcessIncidentType["Deployment"] = "Deployment";
2086
- })(ProcessIncidentType || (ProcessIncidentType = {}));
2087
- /**
2088
- * Process Incident Severity
2089
- */
2090
- var ProcessIncidentSeverity;
2091
- (function (ProcessIncidentSeverity) {
2092
- ProcessIncidentSeverity["Error"] = "Error";
2093
- ProcessIncidentSeverity["Warning"] = "Warning";
2094
- })(ProcessIncidentSeverity || (ProcessIncidentSeverity = {}));
2095
- /**
2096
- * Process Incident Debug Mode
2097
- */
2098
- var DebugMode;
2099
- (function (DebugMode) {
2100
- DebugMode["None"] = "None";
2101
- DebugMode["Default"] = "Default";
2102
- DebugMode["StepByStep"] = "StepByStep";
2103
- DebugMode["SingleStep"] = "SingleStep";
2104
- })(DebugMode || (DebugMode = {}));
2105
-
2106
- /**
2107
- * Case Instance Types
2108
- * Types and interfaces for Maestro case instance management
2109
- */
2110
- /**
2111
- * SLA status for a case instance
2112
- */
2113
- var SlaSummaryStatus;
2114
- (function (SlaSummaryStatus) {
2115
- /** Case is within SLA deadline */
2116
- SlaSummaryStatus["ON_TRACK"] = "On Track";
2117
- /** Case is approaching SLA deadline based on at-risk percentage threshold */
2118
- SlaSummaryStatus["AT_RISK"] = "At Risk";
2119
- /** Case has exceeded SLA deadline */
2120
- SlaSummaryStatus["OVERDUE"] = "Overdue";
2121
- /** Case instance has completed */
2122
- SlaSummaryStatus["COMPLETED"] = "Completed";
2123
- /** SLA status cannot be determined (no SLA deadline defined) */
2124
- SlaSummaryStatus["UNKNOWN"] = "Unknown";
2125
- })(SlaSummaryStatus || (SlaSummaryStatus = {}));
2126
- /**
2127
- * Instance status values for case instances and process instances
2128
- */
2129
- var InstanceStatus;
2130
- (function (InstanceStatus) {
2131
- /** Instance status not yet populated by the backend */
2132
- InstanceStatus["UNKNOWN"] = "";
2133
- InstanceStatus["CANCELLED"] = "Cancelled";
2134
- InstanceStatus["CANCELING"] = "Canceling";
2135
- InstanceStatus["COMPLETED"] = "Completed";
2136
- InstanceStatus["FAULTED"] = "Faulted";
2137
- InstanceStatus["PAUSED"] = "Paused";
2138
- InstanceStatus["PAUSING"] = "Pausing";
2139
- InstanceStatus["PENDING"] = "Pending";
2140
- InstanceStatus["RESUMING"] = "Resuming";
2141
- InstanceStatus["RETRYING"] = "Retrying";
2142
- InstanceStatus["RUNNING"] = "Running";
2143
- InstanceStatus["UPGRADING"] = "Upgrading";
2144
- })(InstanceStatus || (InstanceStatus = {}));
2145
- /**
2146
- * Case stage task type
2147
- */
2148
- var StageTaskType;
2149
- (function (StageTaskType) {
2150
- StageTaskType["EXTERNAL_AGENT"] = "external-agent";
2151
- StageTaskType["RPA"] = "rpa";
2152
- StageTaskType["AGENTIC_PROCESS"] = "process";
2153
- StageTaskType["AGENT"] = "agent";
2154
- StageTaskType["ACTION"] = "action";
2155
- StageTaskType["API_WORKFLOW"] = "api-workflow";
2156
- })(StageTaskType || (StageTaskType = {}));
2157
- /**
2158
- * Escalation recipient scope
2159
- */
2160
- var EscalationRecipientScope;
2161
- (function (EscalationRecipientScope) {
2162
- EscalationRecipientScope["USER"] = "user";
2163
- EscalationRecipientScope["USER_GROUP"] = "usergroup";
2164
- })(EscalationRecipientScope || (EscalationRecipientScope = {}));
2165
- /**
2166
- * Escalation action type
2167
- */
2168
- var EscalationActionType;
2169
- (function (EscalationActionType) {
2170
- EscalationActionType["NOTIFICATION"] = "notification";
2171
- })(EscalationActionType || (EscalationActionType = {}));
2172
- /**
2173
- * Escalation rule trigger type
2174
- */
2175
- var EscalationTriggerType;
2176
- (function (EscalationTriggerType) {
2177
- EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
2178
- EscalationTriggerType["AT_RISK"] = "at-risk";
2179
- /** Default value when no escalation rule is defined */
2180
- EscalationTriggerType["NONE"] = "None";
2181
- })(EscalationTriggerType || (EscalationTriggerType = {}));
2182
- /**
2183
- * SLA duration unit
2184
- */
2185
- var SLADurationUnit;
2186
- (function (SLADurationUnit) {
2187
- SLADurationUnit["HOURS"] = "h";
2188
- SLADurationUnit["DAYS"] = "d";
2189
- SLADurationUnit["WEEKS"] = "w";
2190
- SLADurationUnit["MONTHS"] = "m";
2191
- })(SLADurationUnit || (SLADurationUnit = {}));
2192
-
2193
- /**
2194
- * Insights Types
2195
- * Shared types for Maestro insights analytics endpoints
2196
- */
2197
- /**
2198
- * Time bucketing granularity for insights time-series queries.
2199
- *
2200
- * Controls how data points are grouped on the time axis.
2201
- */
2202
- var TimeInterval;
2203
- (function (TimeInterval) {
2204
- /** Group data points by hour */
2205
- TimeInterval["Hour"] = "HOUR";
2206
- /** Group data points by day */
2207
- TimeInterval["Day"] = "DAY";
2208
- /** Group data points by week */
2209
- TimeInterval["Week"] = "WEEK";
2210
- })(TimeInterval || (TimeInterval = {}));
2211
- /**
2212
- * Final instance statuses returned by the instance status timeline endpoint.
2213
- *
2214
- * Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
2215
- * Active statuses like Running or Paused are not included.
2216
- */
2217
- var InstanceFinalStatus;
2218
- (function (InstanceFinalStatus) {
2219
- /** Instance completed successfully */
2220
- InstanceFinalStatus["Completed"] = "Completed";
2221
- /** Instance encountered an error */
2222
- InstanceFinalStatus["Faulted"] = "Faulted";
2223
- /** Instance was cancelled */
2224
- InstanceFinalStatus["Cancelled"] = "Cancelled";
2225
- })(InstanceFinalStatus || (InstanceFinalStatus = {}));
2226
-
2227
- /**
2228
- * Maps fields for Process Instance entities to ensure consistent naming
2249
+ * Maps fields for Process Instance entities to ensure consistent naming
2229
2250
  */
2230
2251
  const ProcessInstanceMap = {
2231
2252
  startedTimeUtc: 'startedTime',
@@ -2299,7 +2320,7 @@ class ProcessInstancesService extends BaseService {
2299
2320
  }, options);
2300
2321
  }
2301
2322
  /**
2302
- * Get a process instance by ID with operation methods (cancel, pause, resume)
2323
+ * Get a process instance by ID with operation methods (cancel, pause, resume, retry)
2303
2324
  * @param id The ID of the instance to retrieve
2304
2325
  * @param folderKey The folder key for authorization
2305
2326
  * @returns Promise<ProcessInstanceGetResponse>
@@ -2438,6 +2459,25 @@ class ProcessInstancesService extends BaseService {
2438
2459
  data: response.data
2439
2460
  };
2440
2461
  }
2462
+ /**
2463
+ * Retry a faulted process instance
2464
+ *
2465
+ * Re-runs the failed elements of the instance (and the elements that follow) within
2466
+ * the same instance, spawning new jobs. Use to recover from transient/flaky failures.
2467
+ * @param instanceId The ID of the instance to retry
2468
+ * @param folderKey The folder key for authorization
2469
+ * @param options Optional retry options with comment
2470
+ * @returns Promise resolving to operation result with updated instance data
2471
+ */
2472
+ async retry(instanceId, folderKey, options) {
2473
+ const response = await this.post(MAESTRO_ENDPOINTS.INSTANCES.RETRY(instanceId), options || {}, {
2474
+ headers: createHeaders({ [FOLDER_KEY]: folderKey })
2475
+ });
2476
+ return {
2477
+ success: true,
2478
+ data: response.data
2479
+ };
2480
+ }
2441
2481
  /**
2442
2482
  * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
2443
2483
  * @private
@@ -2588,6 +2628,9 @@ __decorate([
2588
2628
  __decorate([
2589
2629
  track('ProcessInstances.Resume')
2590
2630
  ], ProcessInstancesService.prototype, "resume", null);
2631
+ __decorate([
2632
+ track('ProcessInstances.Retry')
2633
+ ], ProcessInstancesService.prototype, "retry", null);
2591
2634
  __decorate([
2592
2635
  track('ProcessInstances.GetVariables')
2593
2636
  ], ProcessInstancesService.prototype, "getVariables", null);
@@ -2744,7 +2787,7 @@ class MaestroProcessesService extends BaseService {
2744
2787
  *
2745
2788
  * @param startTime - Start of the time range to query
2746
2789
  * @param endTime - End of the time range to query
2747
- * @param options - Optional settings for time bucketing granularity
2790
+ * @param options - Optional settings for filtering and time bucket granularity
2748
2791
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
2749
2792
  *
2750
2793
  * @example
@@ -2771,12 +2814,67 @@ class MaestroProcessesService extends BaseService {
2771
2814
  *
2772
2815
  * @example
2773
2816
  * ```typescript
2817
+ * // Filter to a specific process
2818
+ * const filtered = await maestroProcesses.getInstanceStatusTimeline(startTime, endTime, {
2819
+ * processKeys: ['<processKey>'],
2820
+ * });
2821
+ * ```
2822
+ *
2823
+ * @example
2824
+ * ```typescript
2774
2825
  * // Get all-time data (from Unix epoch to now)
2775
2826
  * const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
2776
2827
  * ```
2777
2828
  */
2778
2829
  async getInstanceStatusTimeline(startTime, endTime, options) {
2779
- return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, false, options);
2830
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, false, options));
2831
+ return data ?? [];
2832
+ }
2833
+ /**
2834
+ * Get incident counts aggregated by time bucket for maestro processes.
2835
+ *
2836
+ * Returns time-grouped counts of incidents that occurred within each bucket,
2837
+ * useful for rendering incident time-series charts. Use `groupBy` to control
2838
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
2839
+ *
2840
+ * @param startTime - Start of the time range to query
2841
+ * @param endTime - End of the time range to query
2842
+ * @param options - Optional settings for filtering and time bucket granularity
2843
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
2844
+ *
2845
+ * @example
2846
+ * ```typescript
2847
+ * // Get daily incident counts for the last 7 days
2848
+ * const now = new Date();
2849
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
2850
+ * const incidents = await maestroProcesses.getIncidentsTimeline(sevenDaysAgo, now);
2851
+ *
2852
+ * for (const incident of incidents) {
2853
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
2854
+ * }
2855
+ * ```
2856
+ *
2857
+ * @example
2858
+ * ```typescript
2859
+ * import { TimeInterval } from '@uipath/uipath-typescript/maestro-processes';
2860
+ *
2861
+ * // Get weekly breakdown
2862
+ * const incidents = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
2863
+ * groupBy: TimeInterval.Week,
2864
+ * });
2865
+ * ```
2866
+ *
2867
+ * @example
2868
+ * ```typescript
2869
+ * // Filter to a specific process
2870
+ * const filtered = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
2871
+ * processKeys: ['<processKey>'],
2872
+ * });
2873
+ * ```
2874
+ */
2875
+ async getIncidentsTimeline(startTime, endTime, options) {
2876
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, false, options));
2877
+ return data?.dataPoints ?? [];
2780
2878
  }
2781
2879
  /**
2782
2880
  * Get the top 10 processes ranked by failure count within a time range.
@@ -2962,6 +3060,9 @@ __decorate([
2962
3060
  __decorate([
2963
3061
  track('MaestroProcesses.GetInstanceStatusTimeline')
2964
3062
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
3063
+ __decorate([
3064
+ track('MaestroProcesses.GetIncidentsTimeline')
3065
+ ], MaestroProcessesService.prototype, "getIncidentsTimeline", null);
2965
3066
  __decorate([
2966
3067
  track('MaestroProcesses.GetTopFaultedCount')
2967
3068
  ], MaestroProcessesService.prototype, "getTopFaultedCount", null);