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