@uipath/uipath-typescript 1.4.1 → 1.5.0

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 (46) hide show
  1. package/dist/agent-memory/index.d.ts +4 -1
  2. package/dist/agents/index.cjs +341 -6
  3. package/dist/agents/index.d.ts +717 -16
  4. package/dist/agents/index.mjs +342 -7
  5. package/dist/assets/index.cjs +25 -9
  6. package/dist/assets/index.mjs +25 -9
  7. package/dist/attachments/index.cjs +25 -9
  8. package/dist/attachments/index.mjs +25 -9
  9. package/dist/buckets/index.cjs +25 -9
  10. package/dist/buckets/index.mjs +25 -9
  11. package/dist/cases/index.cjs +621 -524
  12. package/dist/cases/index.d.ts +186 -43
  13. package/dist/cases/index.mjs +621 -524
  14. package/dist/conversational-agent/index.cjs +25 -9
  15. package/dist/conversational-agent/index.mjs +25 -9
  16. package/dist/core/index.cjs +1 -1
  17. package/dist/core/index.mjs +1 -1
  18. package/dist/document-understanding/index.cjs +84 -84
  19. package/dist/document-understanding/index.d.ts +2 -1
  20. package/dist/document-understanding/index.mjs +1 -1
  21. package/dist/entities/index.cjs +25 -9
  22. package/dist/entities/index.mjs +25 -9
  23. package/dist/feedback/index.cjs +25 -9
  24. package/dist/feedback/index.mjs +25 -9
  25. package/dist/index.cjs +332 -62
  26. package/dist/index.d.ts +827 -89
  27. package/dist/index.mjs +333 -63
  28. package/dist/index.umd.js +332 -62
  29. package/dist/jobs/index.cjs +129 -14
  30. package/dist/jobs/index.d.ts +10 -5
  31. package/dist/jobs/index.mjs +129 -14
  32. package/dist/maestro-processes/index.cjs +198 -100
  33. package/dist/maestro-processes/index.d.ts +188 -43
  34. package/dist/maestro-processes/index.mjs +198 -100
  35. package/dist/processes/index.cjs +25 -9
  36. package/dist/processes/index.d.ts +6 -1
  37. package/dist/processes/index.mjs +25 -9
  38. package/dist/queues/index.cjs +25 -9
  39. package/dist/queues/index.mjs +25 -9
  40. package/dist/tasks/index.cjs +25 -9
  41. package/dist/tasks/index.d.ts +4 -1
  42. package/dist/tasks/index.mjs +25 -9
  43. package/dist/traces/index.cjs +2 -2
  44. package/dist/traces/index.d.ts +3 -3
  45. package/dist/traces/index.mjs +2 -2
  46. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -4654,6 +4654,8 @@
4654
4654
  INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
4655
4655
  /** Top processes ranked by total duration */
4656
4656
  TOP_PROCESSES_BY_DURATION: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByDuration`,
4657
+ /** Instance stats (counts by status + duration percentiles) */
4658
+ INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
4657
4659
  /** Element count by status for agentic instances (process and case) */
4658
4660
  ELEMENT_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/ElementCountByStatus`,
4659
4661
  },
@@ -9111,7 +9113,7 @@
9111
9113
  * SDK's public API.
9112
9114
  */
9113
9115
  /** SDK version placeholder — patched by the SDK publish workflow. */
9114
- const SDK_VERSION = '1.4.1';
9116
+ const SDK_VERSION = '1.5.0';
9115
9117
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
9116
9118
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
9117
9119
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -11078,7 +11080,16 @@
11078
11080
  return isNaN(date.getTime()) ? value : date.toISOString();
11079
11081
  }
11080
11082
  /**
11081
- * Transforms data by mapping fields according to the provided field mapping
11083
+ * Transforms data by renaming each key in `data` exactly once, using the
11084
+ * mapping (`sourceField → targetField`). Keys not present in the mapping
11085
+ * pass through unchanged. The original (pre-rename) key is dropped — the
11086
+ * result contains only the renamed key.
11087
+ *
11088
+ * Each rename is independent. If the mapping happens to contain chained
11089
+ * entries (`a → b` and `b → c`), they do NOT compose: a field named `a`
11090
+ * in `data` becomes `b` (not `c`), because the renames are applied based
11091
+ * on the original data's keys, not the running result.
11092
+ *
11082
11093
  * @param data The source data to transform
11083
11094
  * @param fieldMapping Object mapping source field names to target field names
11084
11095
  * @returns Transformed data with mapped field names
@@ -11101,21 +11112,28 @@
11101
11112
  * // { userId: '123', name: 'john' },
11102
11113
  * // { userId: '456', name: 'jane' }
11103
11114
  * // ]
11115
+ *
11116
+ * // No chaining — `a → b` does not become `a → c` even if the map has `b → c`.
11117
+ * transformData({ a: 1 }, { a: 'b', b: 'c' });
11118
+ * // result = { b: 1 }
11104
11119
  * ```
11105
11120
  */
11106
11121
  function transformData(data, fieldMapping) {
11122
+ // Pass null/undefined through unchanged — callers (e.g. AttachmentService.getById)
11123
+ // may invoke this on optional fields that an OData `select` excluded.
11124
+ if (data == null) {
11125
+ return data;
11126
+ }
11107
11127
  // Handle array of objects
11108
11128
  if (Array.isArray(data)) {
11109
11129
  return data.map(item => transformData(item, fieldMapping));
11110
11130
  }
11111
- // Handle single object
11112
- const result = { ...data };
11113
- for (const [sourceField, targetField] of Object.entries(fieldMapping)) {
11114
- if (sourceField in result) {
11115
- const value = result[sourceField];
11116
- delete result[sourceField];
11117
- result[targetField] = value;
11118
- }
11131
+ // Walk the ORIGINAL data's keys, look up each in the mapping. One rename
11132
+ // per data key — no mutation of an in-progress result, so chains can't form.
11133
+ const result = {};
11134
+ for (const [key, value] of Object.entries(data)) {
11135
+ const renamedKey = fieldMapping[key] ?? key;
11136
+ result[renamedKey] = value;
11119
11137
  }
11120
11138
  return result;
11121
11139
  }
@@ -11393,6 +11411,79 @@
11393
11411
  }
11394
11412
  return result;
11395
11413
  }
11414
+ /**
11415
+ * OData query-string keys whose values may contain field identifiers that
11416
+ * need rewriting from SDK names → API names.
11417
+ */
11418
+ const ODATA_FIELD_PARAM_KEYS = ['filter', 'orderby', 'select', 'expand'];
11419
+ /**
11420
+ * Matches one token at a time in an OData expression:
11421
+ * 1. A single-quoted string literal, allowing the `''` escape sequence —
11422
+ * consumed atomically so identifiers inside the literal can't match.
11423
+ * 2. An OData identifier (`[A-Za-z_][A-Za-z0-9_]*`).
11424
+ * Anything else (whitespace, operators, parens, commas) is left alone by
11425
+ * `String.prototype.replace`, which only substitutes matched substrings.
11426
+ */
11427
+ const ODATA_TOKEN_RE = /'(?:[^']|'')*'|[A-Za-z_][A-Za-z0-9_]*/g;
11428
+ /**
11429
+ * Rewrites SDK field identifiers to API field identifiers inside an OData
11430
+ * expression string (`$filter`, `$orderby`, `$select`, `$expand`).
11431
+ *
11432
+ * Field maps (e.g. `JobMap`) rename API fields → SDK fields on responses, so
11433
+ * SDK consumers see the renamed names. Without this rewrite, the same name
11434
+ * in a `filter` string would be forwarded verbatim and the API (which still
11435
+ * uses the original name) would reject it.
11436
+ *
11437
+ * Quoted string literals (with the OData `''` escape) are preserved exactly:
11438
+ * the token regex consumes them whole, so identifiers inside literals never
11439
+ * match. Identifier tokens are looked up in the reversed field map.
11440
+ *
11441
+ * @example
11442
+ * ```typescript
11443
+ * const requestMap = { processName: 'releaseName' };
11444
+ * rewriteODataIdentifiers("processName eq 'processName'", requestMap);
11445
+ * // "releaseName eq 'processName'" — identifier rewritten, literal preserved
11446
+ * ```
11447
+ */
11448
+ function rewriteODataIdentifiers(expression, requestMap) {
11449
+ if (!expression)
11450
+ return expression;
11451
+ return expression.replace(ODATA_TOKEN_RE, (match) => match.startsWith("'") ? match : (requestMap[match] ?? match));
11452
+ }
11453
+ /**
11454
+ * Symmetric counterpart of {@link transformRequest} for OData query options:
11455
+ * rewrites SDK field identifiers inside the recognized OData string params
11456
+ * (`filter`, `orderby`, `select`, `expand`) to their API names using the
11457
+ * reversed form of a response field map. Returns a shallow copy with the
11458
+ * relevant values rewritten; other keys pass through unchanged.
11459
+ *
11460
+ * Use at the OData edge so SDK consumers can refer to renamed fields by
11461
+ * their SDK name throughout — for reading the response and for filtering /
11462
+ * sorting / projecting / expanding.
11463
+ *
11464
+ * @param options The OData query options as authored with SDK field names
11465
+ * @param responseMap The response field map (API → SDK); reversed internally
11466
+ *
11467
+ * @example
11468
+ * ```typescript
11469
+ * // JobMap renames releaseName → processName on responses.
11470
+ * transformOptions({ filter: "processName eq 'X'" }, JobMap);
11471
+ * // { filter: "releaseName eq 'X'" }
11472
+ * ```
11473
+ */
11474
+ function transformOptions(options, responseMap) {
11475
+ const requestMap = reverseMap(responseMap);
11476
+ if (Object.keys(requestMap).length === 0)
11477
+ return options;
11478
+ const result = { ...options };
11479
+ for (const key of ODATA_FIELD_PARAM_KEYS) {
11480
+ const value = result[key];
11481
+ if (typeof value === 'string') {
11482
+ result[key] = rewriteODataIdentifiers(value, requestMap);
11483
+ }
11484
+ }
11485
+ return result;
11486
+ }
11396
11487
  /**
11397
11488
  * Transforms an array-based dictionary with separate keys and values arrays
11398
11489
  * into a standard JavaScript object/record
@@ -13959,6 +14050,21 @@
13959
14050
  track('Choicesets.DeleteValuesById')
13960
14051
  ], ChoiceSetService.prototype, "deleteValuesById", null);
13961
14052
 
14053
+ /**
14054
+ * Maps API field names (countOf*) to SDK field names (*Count) for InstanceStats,
14055
+ * aligning naming with ElementStats and other count-suffixed conventions.
14056
+ */
14057
+ const InstanceStatsMap = {
14058
+ countOfAllInstances: 'totalCount',
14059
+ countOfRunning: 'runningCount',
14060
+ countOfTransitioning: 'transitioningCount',
14061
+ countOfPaused: 'pausedCount',
14062
+ countOfFaulted: 'faultedCount',
14063
+ countOfCompleted: 'completedCount',
14064
+ countOfCancelled: 'cancelledCount',
14065
+ countOfDeleted: 'deletedCount'
14066
+ };
14067
+
13962
14068
  /**
13963
14069
  * Maestro Process Models
13964
14070
  * Model classes for Maestro processes
@@ -13984,7 +14090,26 @@
13984
14090
  throw new Error('Process key is undefined');
13985
14091
  if (!processData.packageId)
13986
14092
  throw new Error('Package ID is undefined');
13987
- return service.getElementStats(processData.processKey, processData.packageId, startTime, endTime, packageVersion);
14093
+ return service.getElementStats({
14094
+ processKey: processData.processKey,
14095
+ packageId: processData.packageId,
14096
+ packageVersion,
14097
+ startTime,
14098
+ endTime,
14099
+ });
14100
+ },
14101
+ getInstanceStats(startTime, endTime, packageVersion) {
14102
+ if (!processData.processKey)
14103
+ throw new Error('Process key is undefined');
14104
+ if (!processData.packageId)
14105
+ throw new Error('Package ID is undefined');
14106
+ return service.getInstanceStats({
14107
+ processKey: processData.processKey,
14108
+ packageId: processData.packageId,
14109
+ packageVersion,
14110
+ startTime,
14111
+ endTime,
14112
+ });
13988
14113
  }
13989
14114
  };
13990
14115
  }
@@ -14047,24 +14172,21 @@
14047
14172
  return response.data ?? [];
14048
14173
  }
14049
14174
  /**
14050
- * Builds the request body for the ElementCountByStatus endpoint.
14175
+ * Builds the commonParams request body for Insights RTM endpoints
14176
+ * that filter by process key, package, time range, and version.
14051
14177
  *
14052
- * @param processKey - Process key to filter by
14053
- * @param packageId - Package identifier
14054
- * @param startTime - Start of the time range to query
14055
- * @param endTime - End of the time range to query
14056
- * @param packageVersion - Package version to filter by
14057
- * @returns Request body for the ElementCountByStatus endpoint
14178
+ * @param request - Process scope + time range to aggregate over
14179
+ * @returns Request body with commonParams
14058
14180
  * @internal
14059
14181
  */
14060
- function buildElementCountByStatusBody(processKey, packageId, startTime, endTime, packageVersion) {
14182
+ function buildInsightsCommonBody(request) {
14061
14183
  return {
14062
14184
  commonParams: {
14063
- processKey,
14064
- packageId,
14065
- startTime: startTime.getTime(),
14066
- endTime: endTime.getTime(),
14067
- version: packageVersion
14185
+ processKey: request.processKey,
14186
+ packageId: request.packageId,
14187
+ startTime: request.startTime.getTime(),
14188
+ endTime: request.endTime.getTime(),
14189
+ version: request.packageVersion
14068
14190
  }
14069
14191
  };
14070
14192
  }
@@ -14318,7 +14440,26 @@
14318
14440
  throw new Error('Process key is undefined');
14319
14441
  if (!caseData.packageId)
14320
14442
  throw new Error('Package ID is undefined');
14321
- return service.getElementStats(caseData.processKey, caseData.packageId, startTime, endTime, packageVersion);
14443
+ return service.getElementStats({
14444
+ processKey: caseData.processKey,
14445
+ packageId: caseData.packageId,
14446
+ packageVersion,
14447
+ startTime,
14448
+ endTime,
14449
+ });
14450
+ },
14451
+ getInstanceStats(startTime, endTime, packageVersion) {
14452
+ if (!caseData.processKey)
14453
+ throw new Error('Process key is undefined');
14454
+ if (!caseData.packageId)
14455
+ throw new Error('Package ID is undefined');
14456
+ return service.getInstanceStats({
14457
+ processKey: caseData.processKey,
14458
+ packageId: caseData.packageId,
14459
+ packageVersion,
14460
+ startTime,
14461
+ endTime,
14462
+ });
14322
14463
  }
14323
14464
  };
14324
14465
  }
@@ -15182,22 +15323,22 @@
15182
15323
  * Returns per-element execution counts (success, fail, terminated, paused, in-progress) and
15183
15324
  * duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a process.
15184
15325
  *
15185
- * @param processKey - Process key to filter by
15186
- * @param packageId - Package identifier
15187
- * @param startTime - Start of the time range to query
15188
- * @param endTime - End of the time range to query
15189
- * @param packageVersion - Package version to filter by
15326
+ * @param request - Process scope + time range to aggregate over
15190
15327
  * @returns Promise resolving to an array of {@link ElementStats}
15191
15328
  * @example
15192
15329
  * ```typescript
15193
- * // Get element metrics for a process
15194
- * const elements = await maestroProcesses.getElementStats(
15195
- * '<processKey>',
15196
- * '<packageId>',
15197
- * new Date('2026-04-01'),
15198
- * new Date(),
15199
- * '1.0.1'
15200
- * );
15330
+ * // First, list processes to find the processKey, packageId, and available versions
15331
+ * const processes = await maestroProcesses.getAll();
15332
+ * const process = processes[0];
15333
+ *
15334
+ * // Get element metrics for that process
15335
+ * const elements = await maestroProcesses.getElementStats({
15336
+ * processKey: process.processKey,
15337
+ * packageId: process.packageId,
15338
+ * packageVersion: process.packageVersions[0],
15339
+ * startTime: new Date('2026-04-01'),
15340
+ * endTime: new Date(),
15341
+ * });
15201
15342
  *
15202
15343
  * // Analyze element performance
15203
15344
  * for (const element of elements) {
@@ -15205,12 +15346,58 @@
15205
15346
  * console.log(` Success: ${element.successCount}, Failed: ${element.failCount}`);
15206
15347
  * console.log(` Avg duration: ${element.avgDurationMs}ms, P95: ${element.p95DurationMs}ms`);
15207
15348
  * }
15349
+ *
15350
+ * // Using bound method on a process — auto-fills processKey and packageId
15351
+ * const boundElements = await process.getElementStats(
15352
+ * new Date('2026-04-01'),
15353
+ * new Date(),
15354
+ * process.packageVersions[0]
15355
+ * );
15208
15356
  * ```
15209
15357
  */
15210
- async getElementStats(processKey, packageId, startTime, endTime, packageVersion) {
15211
- const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildElementCountByStatusBody(processKey, packageId, startTime, endTime, packageVersion));
15358
+ async getElementStats(request) {
15359
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
15212
15360
  return data ?? [];
15213
15361
  }
15362
+ /**
15363
+ * Get instance stats for a process.
15364
+ *
15365
+ * Returns total instance counts broken down by status (running, completed, faulted, etc.)
15366
+ * and the average execution duration for all instances of a process within a time range.
15367
+ *
15368
+ * @param request - Process scope + time range to aggregate over
15369
+ * @returns Promise resolving to {@link InstanceStats}
15370
+ * @example
15371
+ * ```typescript
15372
+ * // First, list processes to find the processKey, packageId, and available versions
15373
+ * const processes = await maestroProcesses.getAll();
15374
+ * const process = processes[0];
15375
+ *
15376
+ * // Get instance status breakdown for that process
15377
+ * const counts = await maestroProcesses.getInstanceStats({
15378
+ * processKey: process.processKey,
15379
+ * packageId: process.packageId,
15380
+ * packageVersion: process.packageVersions[0],
15381
+ * startTime: new Date('2026-04-01'),
15382
+ * endTime: new Date(),
15383
+ * });
15384
+ *
15385
+ * console.log(`Total: ${counts.totalCount}`);
15386
+ * console.log(`Running: ${counts.runningCount}, Completed: ${counts.completedCount}`);
15387
+ * console.log(`Faulted: ${counts.faultedCount}, Avg duration: ${counts.avgDurationMs}ms`);
15388
+ *
15389
+ * // Using bound method on a process — auto-fills processKey and packageId
15390
+ * const boundCounts = await process.getInstanceStats(
15391
+ * new Date('2026-04-01'),
15392
+ * new Date(),
15393
+ * process.packageVersions[0]
15394
+ * );
15395
+ * ```
15396
+ */
15397
+ async getInstanceStats(request) {
15398
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
15399
+ return transformData(data, InstanceStatsMap);
15400
+ }
15214
15401
  }
15215
15402
  __decorate([
15216
15403
  track('MaestroProcesses.GetAll')
@@ -15236,6 +15423,9 @@
15236
15423
  __decorate([
15237
15424
  track('MaestroProcesses.GetElementStats')
15238
15425
  ], MaestroProcessesService.prototype, "getElementStats", null);
15426
+ __decorate([
15427
+ track('MaestroProcesses.GetInstanceStats')
15428
+ ], MaestroProcessesService.prototype, "getInstanceStats", null);
15239
15429
 
15240
15430
  /**
15241
15431
  * Service class for Maestro Process Incidents
@@ -15543,34 +15733,79 @@
15543
15733
  * Returns per-element execution counts (success, fail, terminated, paused, in-progress) and
15544
15734
  * duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a case.
15545
15735
  *
15546
- * @param processKey - Process key to filter by
15547
- * @param packageId - Package identifier
15548
- * @param startTime - Start of the time range to query
15549
- * @param endTime - End of the time range to query
15550
- * @param packageVersion - Package version to filter by
15736
+ * @param request - Process scope + time range to aggregate over
15551
15737
  * @returns Promise resolving to an array of {@link ElementStats}
15552
15738
  * @example
15553
15739
  * ```typescript
15554
- * // Get element metrics for a case
15555
- * const elements = await cases.getElementStats(
15556
- * '<processKey>',
15557
- * '<packageId>',
15558
- * new Date('2026-04-01'),
15559
- * new Date(),
15560
- * '1.0.1'
15561
- * );
15740
+ * // First, list cases to find the processKey, packageId, and available versions
15741
+ * const allCases = await cases.getAll();
15742
+ * const caseItem = allCases[0];
15743
+ *
15744
+ * // Get element metrics for that case
15745
+ * const elements = await cases.getElementStats({
15746
+ * processKey: caseItem.processKey,
15747
+ * packageId: caseItem.packageId,
15748
+ * packageVersion: caseItem.packageVersions[0],
15749
+ * startTime: new Date('2026-04-01'),
15750
+ * endTime: new Date(),
15751
+ * });
15562
15752
  *
15563
15753
  * // Find elements with failures
15564
15754
  * const failedElements = elements.filter(e => e.failCount > 0);
15565
15755
  * for (const element of failedElements) {
15566
15756
  * console.log(`Failed element: ${element.elementId}, failures: ${element.failCount}`);
15567
15757
  * }
15758
+ *
15759
+ * // Using bound method on a case — auto-fills processKey and packageId
15760
+ * const boundElements = await caseItem.getElementStats(
15761
+ * new Date('2026-04-01'),
15762
+ * new Date(),
15763
+ * caseItem.packageVersions[0]
15764
+ * );
15568
15765
  * ```
15569
15766
  */
15570
- async getElementStats(processKey, packageId, startTime, endTime, packageVersion) {
15571
- const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildElementCountByStatusBody(processKey, packageId, startTime, endTime, packageVersion));
15767
+ async getElementStats(request) {
15768
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
15572
15769
  return data ?? [];
15573
15770
  }
15771
+ /**
15772
+ * Get instance stats for a case.
15773
+ *
15774
+ * Returns total instance counts broken down by status (running, completed, faulted, etc.)
15775
+ * and the average execution duration for all instances of a case within a time range.
15776
+ *
15777
+ * @param request - Process scope + time range to aggregate over
15778
+ * @returns Promise resolving to {@link InstanceStats}
15779
+ * @example
15780
+ * ```typescript
15781
+ * // First, list cases to find the processKey, packageId, and available versions
15782
+ * const allCases = await cases.getAll();
15783
+ * const caseItem = allCases[0];
15784
+ *
15785
+ * // Get instance status breakdown for that case
15786
+ * const counts = await cases.getInstanceStats({
15787
+ * processKey: caseItem.processKey,
15788
+ * packageId: caseItem.packageId,
15789
+ * packageVersion: caseItem.packageVersions[0],
15790
+ * startTime: new Date('2026-04-01'),
15791
+ * endTime: new Date(),
15792
+ * });
15793
+ *
15794
+ * console.log(`Total: ${counts.totalCount}`);
15795
+ * console.log(`Completed: ${counts.completedCount}, Faulted: ${counts.faultedCount}`);
15796
+ *
15797
+ * // Using bound method on a case — auto-fills processKey and packageId
15798
+ * const boundCounts = await caseItem.getInstanceStats(
15799
+ * new Date('2026-04-01'),
15800
+ * new Date(),
15801
+ * caseItem.packageVersions[0]
15802
+ * );
15803
+ * ```
15804
+ */
15805
+ async getInstanceStats(request) {
15806
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
15807
+ return transformData(data, InstanceStatsMap);
15808
+ }
15574
15809
  /**
15575
15810
  * Extract a readable case name from the packageId
15576
15811
  * @param packageId - The full package identifier
@@ -15611,6 +15846,9 @@
15611
15846
  __decorate([
15612
15847
  track('Cases.GetElementStats')
15613
15848
  ], CasesService.prototype, "getElementStats", null);
15849
+ __decorate([
15850
+ track('Cases.GetInstanceStats')
15851
+ ], CasesService.prototype, "getInstanceStats", null);
15614
15852
 
15615
15853
  /**
15616
15854
  * Maps fields for Case Instance entities to ensure consistent naming
@@ -18068,8 +18306,9 @@
18068
18306
  * const folderJobs = await jobs.getAll({ folderId: <folderId> });
18069
18307
  *
18070
18308
  * // With filtering
18071
- * const runningJobs = await jobs.getAll({
18072
- * filter: "state eq 'Running'"
18309
+ * const recentInvoiceJobs = await jobs.getAll({
18310
+ * filter: "processName eq 'InvoiceBot'",
18311
+ * orderby: 'createdTime desc',
18073
18312
  * });
18074
18313
  *
18075
18314
  * // First page with pagination
@@ -18092,6 +18331,10 @@
18092
18331
  const rawJob = transformData(pascalToCamelCaseKeys(job), JobMap);
18093
18332
  return createJobWithMethods(rawJob, this);
18094
18333
  };
18334
+ // Rewrite renamed SDK field names → API names inside OData strings
18335
+ // before delegating, mirroring the transformRequest pattern used for
18336
+ // request bodies.
18337
+ const apiOptions = options ? transformOptions(options, JobMap) : options;
18095
18338
  return PaginationHelpers.getAll({
18096
18339
  serviceAccess: this.createPaginationServiceAccess(),
18097
18340
  getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
@@ -18107,7 +18350,7 @@
18107
18350
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
18108
18351
  },
18109
18352
  },
18110
- }, options);
18353
+ }, apiOptions);
18111
18354
  }
18112
18355
  /**
18113
18356
  * Gets a job by its unique key (GUID).
@@ -18144,8 +18387,8 @@
18144
18387
  throw new ValidationError({ message: 'folderId is required for getById' });
18145
18388
  }
18146
18389
  const headers = createHeaders({ [FOLDER_ID]: folderId });
18147
- const keysToPrefix = Object.keys(options ?? {});
18148
- const apiOptions = options ? addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix) : {};
18390
+ const apiFieldOptions = options ? transformOptions(options, JobMap) : {};
18391
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
18149
18392
  const response = await this.get(JOB_ENDPOINTS.GET_BY_KEY(id), {
18150
18393
  params: apiOptions,
18151
18394
  headers,
@@ -18448,6 +18691,9 @@
18448
18691
  JobState["Stopped"] = "Stopped";
18449
18692
  JobState["Suspended"] = "Suspended";
18450
18693
  JobState["Resumed"] = "Resumed";
18694
+ JobState["Cancelled"] = "Cancelled";
18695
+ /** Server-side fallback for an unrecognized or missing job state. */
18696
+ JobState["Unknown"] = "Unknown";
18451
18697
  })(exports.JobState || (exports.JobState = {}));
18452
18698
 
18453
18699
  /**
@@ -19169,9 +19415,9 @@
19169
19415
  AgentListSortColumn["HealthScore"] = "HealthScore";
19170
19416
  AgentListSortColumn["LastIncident"] = "LastIncident";
19171
19417
  AgentListSortColumn["FolderName"] = "FolderName";
19172
- /** Quantity of AGU (Agent Units) consumed */
19418
+ /** Quantity of Agent Units consumed */
19173
19419
  AgentListSortColumn["QuantityAGU"] = "QuantityAGU";
19174
- /** Quantity of PLTU (Platform Units) consumed */
19420
+ /** Quantity of Platform Units consumed */
19175
19421
  AgentListSortColumn["QuantityPLTU"] = "QuantityPLTU";
19176
19422
  AgentListSortColumn["FolderPath"] = "FolderPath";
19177
19423
  })(exports.AgentListSortColumn || (exports.AgentListSortColumn = {}));
@@ -19193,6 +19439,30 @@
19193
19439
  AgentErrorSortColumn["LastSeenFolderName"] = "LastSeenFolderName";
19194
19440
  AgentErrorSortColumn["LastSeenFolderPath"] = "LastSeenFolderPath";
19195
19441
  })(exports.AgentErrorSortColumn || (exports.AgentErrorSortColumn = {}));
19442
+ /**
19443
+ * Agent type, used to filter consumption results.
19444
+ *
19445
+ * Wire format is the string name, per the API's `StringEnumConverter` serialization.
19446
+ */
19447
+ exports.AgentType = void 0;
19448
+ (function (AgentType) {
19449
+ AgentType["Autonomous"] = "Autonomous";
19450
+ AgentType["Conversational"] = "Conversational";
19451
+ AgentType["Coded"] = "Coded";
19452
+ })(exports.AgentType || (exports.AgentType = {}));
19453
+ /**
19454
+ * Job execution mode filter accepted by the summary endpoints.
19455
+ *
19456
+ * Wire format is the string name (`"Debug"` / `"Runtime"`), per the API's
19457
+ * `StringEnumConverter` serialization.
19458
+ */
19459
+ exports.AgentExecutionType = void 0;
19460
+ (function (AgentExecutionType) {
19461
+ /** Test runs */
19462
+ AgentExecutionType["Debug"] = "Debug";
19463
+ /** Production runs */
19464
+ AgentExecutionType["Runtime"] = "Runtime";
19465
+ })(exports.AgentExecutionType || (exports.AgentExecutionType = {}));
19196
19466
 
19197
19467
  /**
19198
19468
  * Types for the Agent Memory metrics service.