@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
package/dist/index.umd.js CHANGED
@@ -4625,6 +4625,7 @@
4625
4625
  CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4626
4626
  PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4627
4627
  RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4628
+ RETRY: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/retry`,
4628
4629
  },
4629
4630
  INCIDENTS: {
4630
4631
  GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
@@ -4658,6 +4659,8 @@
4658
4659
  INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
4659
4660
  /** Element count by status for agentic instances (process and case) */
4660
4661
  ELEMENT_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/ElementCountByStatus`,
4662
+ /** Incident counts aggregated by time bucket for time-series charts */
4663
+ INCIDENTS_BY_TIME_WINDOW: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/IncidentsByTimeWindow`,
4661
4664
  },
4662
4665
  };
4663
4666
 
@@ -4707,6 +4710,14 @@
4707
4710
  UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
4708
4711
  DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`,
4709
4712
  },
4713
+ ROLES: {
4714
+ GET_ALL: `${DATAFABRIC_BASE}/api/v2/Role`,
4715
+ },
4716
+ DIRECTORY: {
4717
+ GET_ALL: `${DATAFABRIC_BASE}/api/Directory`,
4718
+ ASSIGN_ROLES: `${DATAFABRIC_BASE}/api/Directory/Role`,
4719
+ REVOKE_ROLES: `${DATAFABRIC_BASE}/api/Directory/RevokeRole`,
4720
+ },
4710
4721
  };
4711
4722
 
4712
4723
  /**
@@ -9113,7 +9124,7 @@
9113
9124
  * SDK's public API.
9114
9125
  */
9115
9126
  /** SDK version placeholder — patched by the SDK publish workflow. */
9116
- const SDK_VERSION = '1.5.0';
9127
+ const SDK_VERSION = '1.5.1';
9117
9128
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
9118
9129
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
9119
9130
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -14050,6 +14061,419 @@
14050
14061
  track('Choicesets.DeleteValuesById')
14051
14062
  ], ChoiceSetService.prototype, "deleteValuesById", null);
14052
14063
 
14064
+ /**
14065
+ * @internal
14066
+ */
14067
+ var DataFabricRoleType;
14068
+ (function (DataFabricRoleType) {
14069
+ DataFabricRoleType["System"] = "System";
14070
+ DataFabricRoleType["UserDefined"] = "UserDefined";
14071
+ })(DataFabricRoleType || (DataFabricRoleType = {}));
14072
+
14073
+ function isRecord$1(value) {
14074
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
14075
+ }
14076
+ function isDataFabricRole(value) {
14077
+ if (!isRecord$1(value)) {
14078
+ return false;
14079
+ }
14080
+ const { id, name, type, directoryEntityCount, folderId } = value;
14081
+ const hasValidDirectoryEntityCount = directoryEntityCount === undefined ||
14082
+ directoryEntityCount === null ||
14083
+ typeof directoryEntityCount === 'number';
14084
+ const hasValidFolderId = folderId === undefined || typeof folderId === 'string';
14085
+ return typeof id === 'string' &&
14086
+ typeof name === 'string' &&
14087
+ (type === DataFabricRoleType.System || type === DataFabricRoleType.UserDefined) &&
14088
+ hasValidDirectoryEntityCount &&
14089
+ hasValidFolderId;
14090
+ }
14091
+ function validateRolesResponse(data) {
14092
+ if (Array.isArray(data) && data.every(isDataFabricRole)) {
14093
+ return data;
14094
+ }
14095
+ throw new ServerError({
14096
+ message: 'Invalid Data Fabric roles response format.',
14097
+ });
14098
+ }
14099
+ /**
14100
+ * @internal
14101
+ */
14102
+ class DataFabricRoleService extends BaseService {
14103
+ /**
14104
+ * Lists Data Fabric access roles.
14105
+ *
14106
+ * Returns tenant Data Fabric roles such as Admin, Designer, DataWriter, and
14107
+ * DataReader. Role IDs from this method can be passed to
14108
+ * `DataFabricDirectoryService.assignRoles()`.
14109
+ *
14110
+ * @param options - Optional query options
14111
+ * @returns Promise resolving to an array of {@link DataFabricRole}
14112
+ *
14113
+ * @example
14114
+ * ```typescript
14115
+ * import { DataFabricRoleService } from '@uipath/uipath-typescript/entities';
14116
+ *
14117
+ * const roles = new DataFabricRoleService(sdk);
14118
+ * const allRoles = await roles.getAll();
14119
+ * const dataWriter = allRoles.find(role => role.name === 'DataWriter');
14120
+ * ```
14121
+ *
14122
+ * @example
14123
+ * ```typescript
14124
+ * const rolesWithoutStats = await roles.getAll({ stats: false });
14125
+ * ```
14126
+ *
14127
+ * @example
14128
+ * ```typescript
14129
+ * const folderRoles = await roles.getAll({ folderKey: '<folder-key>' });
14130
+ * ```
14131
+ *
14132
+ * @internal
14133
+ */
14134
+ async getAll(options = {}) {
14135
+ const params = createParams({
14136
+ stats: options.stats ?? true,
14137
+ });
14138
+ const headers = createHeaders({ [FOLDER_KEY]: options.folderKey });
14139
+ const response = await this.get(DATA_FABRIC_ENDPOINTS.ROLES.GET_ALL, { params, headers });
14140
+ return validateRolesResponse(response.data);
14141
+ }
14142
+ }
14143
+ __decorate([
14144
+ track('DataFabricRoles.GetAll')
14145
+ ], DataFabricRoleService.prototype, "getAll", null);
14146
+
14147
+ /**
14148
+ * @internal
14149
+ */
14150
+ var DataFabricDirectoryEntityType;
14151
+ (function (DataFabricDirectoryEntityType) {
14152
+ /** Identity user, robot user, or directory robot principal. */
14153
+ DataFabricDirectoryEntityType[DataFabricDirectoryEntityType["User"] = 0] = "User";
14154
+ /** Identity group principal. */
14155
+ DataFabricDirectoryEntityType[DataFabricDirectoryEntityType["Group"] = 1] = "Group";
14156
+ /** External application principal. */
14157
+ DataFabricDirectoryEntityType[DataFabricDirectoryEntityType["Application"] = 2] = "Application";
14158
+ })(DataFabricDirectoryEntityType || (DataFabricDirectoryEntityType = {}));
14159
+ /**
14160
+ * @internal
14161
+ */
14162
+ var DataFabricDirectoryEntityTypeName;
14163
+ (function (DataFabricDirectoryEntityTypeName) {
14164
+ DataFabricDirectoryEntityTypeName["User"] = "User";
14165
+ DataFabricDirectoryEntityTypeName["Group"] = "Group";
14166
+ DataFabricDirectoryEntityTypeName["Application"] = "Application";
14167
+ })(DataFabricDirectoryEntityTypeName || (DataFabricDirectoryEntityTypeName = {}));
14168
+
14169
+ const DEFAULT_DIRECTORY_PAGE_SIZE = 100;
14170
+ const MAX_DIRECTORY_PAGE_SIZE = 100;
14171
+ function validateDirectoryListResponse(data) {
14172
+ if (data === null || typeof data !== 'object' || Array.isArray(data)) {
14173
+ throw new ServerError({
14174
+ message: 'Invalid Data Fabric directory response format.',
14175
+ });
14176
+ }
14177
+ const response = data;
14178
+ if (typeof response.totalCount !== 'number' || !Array.isArray(response.results)) {
14179
+ throw new ServerError({
14180
+ message: 'Invalid Data Fabric directory response format.',
14181
+ });
14182
+ }
14183
+ return {
14184
+ totalCount: response.totalCount,
14185
+ results: response.results,
14186
+ };
14187
+ }
14188
+ function isRecord(value) {
14189
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
14190
+ }
14191
+ function isDirectoryEntityTypeName(value) {
14192
+ return value === DataFabricDirectoryEntityTypeName.User ||
14193
+ value === DataFabricDirectoryEntityTypeName.Group ||
14194
+ value === DataFabricDirectoryEntityTypeName.Application;
14195
+ }
14196
+ function isDirectoryRole(value) {
14197
+ if (!isRecord(value)) {
14198
+ return false;
14199
+ }
14200
+ return typeof value.id === 'string' && typeof value.name === 'string';
14201
+ }
14202
+ function normalizeDirectoryEntry(entry) {
14203
+ if (!isRecord(entry) ||
14204
+ typeof entry.externalId !== 'string' ||
14205
+ typeof entry.name !== 'string' ||
14206
+ !isDirectoryEntityTypeName(entry.type) ||
14207
+ (entry.email !== undefined && entry.email !== null && typeof entry.email !== 'string') ||
14208
+ (entry.objectType !== undefined && entry.objectType !== null && typeof entry.objectType !== 'string') ||
14209
+ (entry.isUIEnabled !== undefined && typeof entry.isUIEnabled !== 'boolean') ||
14210
+ (entry.roles !== undefined && entry.roles !== null && (!Array.isArray(entry.roles) || !entry.roles.every(isDirectoryRole)))) {
14211
+ throw new ServerError({
14212
+ message: 'Invalid Data Fabric directory entry response format.',
14213
+ });
14214
+ }
14215
+ const normalized = {
14216
+ externalId: entry.externalId,
14217
+ name: entry.name,
14218
+ type: entry.type,
14219
+ roles: entry.roles ?? [],
14220
+ isUIEnabled: entry.isUIEnabled ?? true,
14221
+ };
14222
+ if (entry.email !== undefined) {
14223
+ normalized.email = entry.email;
14224
+ }
14225
+ if (entry.objectType !== undefined) {
14226
+ normalized.objectType = entry.objectType;
14227
+ }
14228
+ return normalized;
14229
+ }
14230
+ function normalizePrincipalIds(principalIds) {
14231
+ const ids = Array.isArray(principalIds) ? principalIds : [principalIds];
14232
+ return [...new Set(ids.map(id => id.trim()).filter(Boolean))];
14233
+ }
14234
+ function normalizeRoleIds(roleIds) {
14235
+ return [...new Set(roleIds.map(id => id.trim()).filter(Boolean))];
14236
+ }
14237
+ function normalizePrincipalType(type) {
14238
+ if (typeof type === 'number') {
14239
+ if (type === DataFabricDirectoryEntityType.User ||
14240
+ type === DataFabricDirectoryEntityType.Group ||
14241
+ type === DataFabricDirectoryEntityType.Application) {
14242
+ return type;
14243
+ }
14244
+ throw new ValidationError({
14245
+ message: 'Invalid Data Fabric principal type.',
14246
+ });
14247
+ }
14248
+ switch (type) {
14249
+ case DataFabricDirectoryEntityTypeName.User:
14250
+ return DataFabricDirectoryEntityType.User;
14251
+ case DataFabricDirectoryEntityTypeName.Group:
14252
+ return DataFabricDirectoryEntityType.Group;
14253
+ case DataFabricDirectoryEntityTypeName.Application:
14254
+ return DataFabricDirectoryEntityType.Application;
14255
+ default:
14256
+ throw new ValidationError({
14257
+ message: 'Invalid Data Fabric principal type.',
14258
+ });
14259
+ }
14260
+ }
14261
+ function roleIdsFromEntry(entry) {
14262
+ if (!entry) {
14263
+ return [];
14264
+ }
14265
+ return normalizeRoleIds(entry.roles.map(role => role.id));
14266
+ }
14267
+ function clampDirectoryPageSize(pageSize) {
14268
+ return Math.max(1, Math.min(pageSize ?? DEFAULT_DIRECTORY_PAGE_SIZE, MAX_DIRECTORY_PAGE_SIZE));
14269
+ }
14270
+ /**
14271
+ * @internal
14272
+ */
14273
+ class DataFabricDirectoryService extends BaseService {
14274
+ async fetchAllEntries(options = {}) {
14275
+ const top = clampDirectoryPageSize(options.pageSize);
14276
+ const entries = [];
14277
+ let skip = 0;
14278
+ while (true) {
14279
+ const page = await this.list(skip === 0 ? { top } : { top, skip });
14280
+ entries.push(...page.results);
14281
+ if (page.results.length < top || (page.totalCount !== undefined && entries.length >= page.totalCount)) {
14282
+ return entries;
14283
+ }
14284
+ skip += top;
14285
+ }
14286
+ }
14287
+ /**
14288
+ * Lists one page of Data Fabric directory principals and their current roles.
14289
+ *
14290
+ * Returns directory entries with external IDs, principal metadata, and
14291
+ * assigned Data Fabric roles.
14292
+ *
14293
+ * @param options - Optional offset paging options
14294
+ * @returns Promise resolving to {@link DataFabricDirectoryListResponse}
14295
+ *
14296
+ * @example
14297
+ * ```typescript
14298
+ * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities';
14299
+ *
14300
+ * const directory = new DataFabricDirectoryService(sdk);
14301
+ * const page = await directory.list({ skip: 0, top: 50 });
14302
+ * const firstPrincipal = page.results[0];
14303
+ * ```
14304
+ *
14305
+ * @internal
14306
+ */
14307
+ async list(options = {}) {
14308
+ const params = createParams({
14309
+ skip: options.skip,
14310
+ top: clampDirectoryPageSize(options.top),
14311
+ });
14312
+ const response = await this.get(DATA_FABRIC_ENDPOINTS.DIRECTORY.GET_ALL, { params });
14313
+ const data = validateDirectoryListResponse(response.data);
14314
+ const results = data.results.map(normalizeDirectoryEntry);
14315
+ return {
14316
+ totalCount: data.totalCount,
14317
+ results,
14318
+ };
14319
+ }
14320
+ /**
14321
+ * Lists all Data Fabric directory principals and their current roles.
14322
+ *
14323
+ * Follows the Data Fabric directory top/skip pagination and returns
14324
+ * normalized entries. Entries without assigned roles include an empty
14325
+ * `roles` array.
14326
+ *
14327
+ * @param options - Optional page-size options
14328
+ * @returns Promise resolving to an array of {@link DataFabricDirectoryEntry}
14329
+ *
14330
+ * @example
14331
+ * ```typescript
14332
+ * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities';
14333
+ *
14334
+ * const directory = new DataFabricDirectoryService(sdk);
14335
+ * const principals = await directory.getAll({ pageSize: 100 });
14336
+ * ```
14337
+ *
14338
+ * @internal
14339
+ */
14340
+ async getAll(options = {}) {
14341
+ return this.fetchAllEntries(options);
14342
+ }
14343
+ /**
14344
+ * Assigns Data Fabric roles to one or more principals.
14345
+ *
14346
+ * The Data Fabric API replaces the role set for each principal, so this
14347
+ * method preserves existing roles by default and posts the union of current
14348
+ * and requested role IDs.
14349
+ *
14350
+ * Role IDs can be discovered with `DataFabricRoleService.getAll()`. Set
14351
+ * `preserveExisting: false` only when intentionally replacing a principal's
14352
+ * Data Fabric role set.
14353
+ *
14354
+ * @param principalIds - Principal external ID or IDs
14355
+ * @param principalType - Principal type
14356
+ * @param roleIds - Data Fabric role IDs to assign
14357
+ * @param options - Optional assignment behavior
14358
+ * @returns Promise resolving to an array of {@link DataFabricDirectoryAssignmentResult}
14359
+ *
14360
+ * @example
14361
+ * ```typescript
14362
+ * import { DataFabricDirectoryEntityTypeName, DataFabricDirectoryService, DataFabricRoleService } from '@uipath/uipath-typescript/entities';
14363
+ *
14364
+ * const roles = new DataFabricRoleService(sdk);
14365
+ * const directory = new DataFabricDirectoryService(sdk);
14366
+ *
14367
+ * const dataWriter = (await roles.getAll()).find(role => role.name === 'DataWriter');
14368
+ * if (!dataWriter) {
14369
+ * throw new Error('DataWriter role not found');
14370
+ * }
14371
+ *
14372
+ * await directory.assignRoles('<identity-group-id>', DataFabricDirectoryEntityTypeName.Group, [dataWriter.id]);
14373
+ * ```
14374
+ *
14375
+ * @example
14376
+ * ```typescript
14377
+ * await directory.assignRoles('<identity-user-id>', DataFabricDirectoryEntityTypeName.User, ['<role-id>'], {
14378
+ * preserveExisting: false,
14379
+ * });
14380
+ * ```
14381
+ *
14382
+ * @internal
14383
+ */
14384
+ async assignRoles(principalIds, principalType, roleIds, options = {}) {
14385
+ const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
14386
+ const normalizedRoleIds = normalizeRoleIds(roleIds);
14387
+ if (normalizedPrincipalIds.length === 0) {
14388
+ throw new ValidationError({ message: 'At least one principal ID is required.' });
14389
+ }
14390
+ if (normalizedRoleIds.length === 0) {
14391
+ throw new ValidationError({ message: 'At least one Data Fabric role ID is required.' });
14392
+ }
14393
+ const type = normalizePrincipalType(principalType);
14394
+ const preserveExisting = options.preserveExisting ?? true;
14395
+ const existingById = new Map();
14396
+ if (preserveExisting) {
14397
+ for (const entry of await this.fetchAllEntries()) {
14398
+ existingById.set(entry.externalId.toLowerCase(), entry);
14399
+ }
14400
+ }
14401
+ return Promise.all(normalizedPrincipalIds.map(async (principalId) => {
14402
+ const existing = existingById.get(principalId.toLowerCase());
14403
+ const mergedRoleIds = preserveExisting
14404
+ ? normalizeRoleIds([...roleIdsFromEntry(existing), ...normalizedRoleIds])
14405
+ : normalizedRoleIds;
14406
+ const payload = {
14407
+ directoryEntities: [
14408
+ {
14409
+ externalId: principalId,
14410
+ type,
14411
+ resolved: true,
14412
+ },
14413
+ ],
14414
+ roles: mergedRoleIds,
14415
+ isUIEnabled: options.uiEnabled ?? true,
14416
+ };
14417
+ await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.ASSIGN_ROLES, payload);
14418
+ return {
14419
+ principalId,
14420
+ roleIds: mergedRoleIds,
14421
+ };
14422
+ }));
14423
+ }
14424
+ /**
14425
+ * Revokes all direct Data Fabric roles from one or more principals.
14426
+ *
14427
+ * The Data Fabric API removes all role assignments for each supplied external
14428
+ * ID. Use this when a principal should no longer have direct Data Fabric
14429
+ * access. Inherited access through groups is not changed.
14430
+ *
14431
+ * @param principalIds - Principal external ID or IDs
14432
+ * @returns Promise resolving when the roles are revoked
14433
+ *
14434
+ * @example
14435
+ * ```typescript
14436
+ * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities';
14437
+ *
14438
+ * const directory = new DataFabricDirectoryService(sdk);
14439
+ *
14440
+ * await directory.revokeRoles('<identity-user-id>');
14441
+ * ```
14442
+ *
14443
+ * @example
14444
+ * ```typescript
14445
+ * await directory.revokeRoles([
14446
+ * '<identity-user-id>',
14447
+ * '<identity-group-id>',
14448
+ * ]);
14449
+ * ```
14450
+ *
14451
+ * @internal
14452
+ */
14453
+ async revokeRoles(principalIds) {
14454
+ const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
14455
+ if (normalizedPrincipalIds.length === 0) {
14456
+ throw new ValidationError({ message: 'At least one principal ID is required.' });
14457
+ }
14458
+ const payload = {
14459
+ externalIds: normalizedPrincipalIds,
14460
+ };
14461
+ await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.REVOKE_ROLES, payload);
14462
+ }
14463
+ }
14464
+ __decorate([
14465
+ track('DataFabricDirectory.List')
14466
+ ], DataFabricDirectoryService.prototype, "list", null);
14467
+ __decorate([
14468
+ track('DataFabricDirectory.GetAll')
14469
+ ], DataFabricDirectoryService.prototype, "getAll", null);
14470
+ __decorate([
14471
+ track('DataFabricDirectory.AssignRoles')
14472
+ ], DataFabricDirectoryService.prototype, "assignRoles", null);
14473
+ __decorate([
14474
+ track('DataFabricDirectory.RevokeRoles')
14475
+ ], DataFabricDirectoryService.prototype, "revokeRoles", null);
14476
+
14053
14477
  /**
14054
14478
  * Maps API field names (countOf*) to SDK field names (*Count) for InstanceStats,
14055
14479
  * aligning naming with ElementStats and other count-suffixed conventions.
@@ -14110,6 +14534,16 @@
14110
14534
  startTime,
14111
14535
  endTime,
14112
14536
  });
14537
+ },
14538
+ getInstanceStatusTimeline(startTime, endTime, options) {
14539
+ if (!processData.processKey)
14540
+ throw new Error('Process key is undefined');
14541
+ return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
14542
+ },
14543
+ getIncidentsTimeline(startTime, endTime, options) {
14544
+ if (!processData.processKey)
14545
+ throw new Error('Process key is undefined');
14546
+ return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
14113
14547
  }
14114
14548
  };
14115
14549
  }
@@ -14126,260 +14560,78 @@
14126
14560
  }
14127
14561
 
14128
14562
  /**
14129
- * Builds the request body for Insights RTM "top" endpoints.
14563
+ * Creates methods for a process instance
14130
14564
  *
14131
- * @param startTime - Start of the time range to query
14132
- * @param endTime - End of the time range to query
14133
- * @param isCaseManagement - Whether to filter for case management processes
14134
- * @param options - Optional filters (packageId, processKey, version)
14135
- * @returns Request body for the Insights RTM endpoint
14136
- * @internal
14565
+ * @param instanceData - The process instance data (response from API)
14566
+ * @param service - The process instance service instance
14567
+ * @returns Object containing process instance methods
14137
14568
  */
14138
- function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
14569
+ function createProcessInstanceMethods(instanceData, service) {
14139
14570
  return {
14140
- commonParams: {
14141
- startTime: startTime.getTime(),
14142
- endTime: endTime.getTime(),
14143
- isCaseManagement,
14144
- ...(options?.packageId ? { packageId: options.packageId } : {}),
14145
- ...(options?.processKey ? { processKey: options.processKey } : {}),
14146
- ...(options?.version ? { version: options.version } : {}),
14571
+ async cancel(options) {
14572
+ if (!instanceData.instanceId)
14573
+ throw new Error('Process instance ID is undefined');
14574
+ if (!instanceData.folderKey)
14575
+ throw new Error('Process instance folder key is undefined');
14576
+ return service.cancel(instanceData.instanceId, instanceData.folderKey, options);
14577
+ },
14578
+ async pause(options) {
14579
+ if (!instanceData.instanceId)
14580
+ throw new Error('Process instance ID is undefined');
14581
+ if (!instanceData.folderKey)
14582
+ throw new Error('Process instance folder key is undefined');
14583
+ return service.pause(instanceData.instanceId, instanceData.folderKey, options);
14584
+ },
14585
+ async resume(options) {
14586
+ if (!instanceData.instanceId)
14587
+ throw new Error('Process instance ID is undefined');
14588
+ if (!instanceData.folderKey)
14589
+ throw new Error('Process instance folder key is undefined');
14590
+ return service.resume(instanceData.instanceId, instanceData.folderKey, options);
14591
+ },
14592
+ async retry(options) {
14593
+ if (!instanceData.instanceId)
14594
+ throw new Error('Process instance ID is undefined');
14595
+ if (!instanceData.folderKey)
14596
+ throw new Error('Process instance folder key is undefined');
14597
+ return service.retry(instanceData.instanceId, instanceData.folderKey, options);
14598
+ },
14599
+ async getIncidents() {
14600
+ if (!instanceData.instanceId)
14601
+ throw new Error('Process instance ID is undefined');
14602
+ if (!instanceData.folderKey)
14603
+ throw new Error('Process instance folder key is undefined');
14604
+ return service.getIncidents(instanceData.instanceId, instanceData.folderKey);
14605
+ },
14606
+ async getExecutionHistory() {
14607
+ if (!instanceData.instanceId)
14608
+ throw new Error('Process instance ID is undefined');
14609
+ if (!instanceData.folderKey)
14610
+ throw new Error('Process instance folder key is undefined');
14611
+ return service.getExecutionHistory(instanceData.instanceId, instanceData.folderKey);
14612
+ },
14613
+ async getBpmn() {
14614
+ if (!instanceData.instanceId)
14615
+ throw new Error('Process instance ID is undefined');
14616
+ if (!instanceData.folderKey)
14617
+ throw new Error('Process instance folder key is undefined');
14618
+ return service.getBpmn(instanceData.instanceId, instanceData.folderKey);
14619
+ },
14620
+ async getVariables(options) {
14621
+ if (!instanceData.instanceId)
14622
+ throw new Error('Process instance ID is undefined');
14623
+ if (!instanceData.folderKey)
14624
+ throw new Error('Process instance folder key is undefined');
14625
+ return service.getVariables(instanceData.instanceId, instanceData.folderKey, options);
14147
14626
  }
14148
14627
  };
14149
14628
  }
14150
14629
  /**
14151
- * Fetches instance status timeline from the Insights API.
14152
- * Shared implementation used by both MaestroProcessesService and CasesService.
14630
+ * Creates an actionable process instance by combining API process instance data with operational methods.
14153
14631
  *
14154
- * @param postFn - Bound post method from a BaseService subclass
14155
- * @param startTime - Start of the time range to query
14156
- * @param endTime - End of the time range to query
14157
- * @param isCaseManagement - Whether to filter for case management processes
14158
- * @param options - Optional settings for time bucketing granularity
14159
- * @returns Promise resolving to an array of instance status timeline entries
14160
- * @internal
14161
- */
14162
- async function fetchInstanceStatusTimeline(postFn, startTime, endTime, isCaseManagement, options) {
14163
- const response = await postFn(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, {
14164
- commonParams: {
14165
- startTime: startTime.getTime(),
14166
- endTime: endTime.getTime(),
14167
- isCaseManagement,
14168
- },
14169
- timeSliceUnit: options?.groupBy,
14170
- timezoneOffset: new Date().getTimezoneOffset() * -1,
14171
- });
14172
- return response.data ?? [];
14173
- }
14174
- /**
14175
- * Builds the commonParams request body for Insights RTM endpoints
14176
- * that filter by process key, package, time range, and version.
14177
- *
14178
- * @param request - Process scope + time range to aggregate over
14179
- * @returns Request body with commonParams
14180
- * @internal
14181
- */
14182
- function buildInsightsCommonBody(request) {
14183
- return {
14184
- commonParams: {
14185
- processKey: request.processKey,
14186
- packageId: request.packageId,
14187
- startTime: request.startTime.getTime(),
14188
- endTime: request.endTime.getTime(),
14189
- version: request.packageVersion
14190
- }
14191
- };
14192
- }
14193
-
14194
- /**
14195
- * Maps fields for Incident entities
14196
- */
14197
- const ProcessIncidentMap = {
14198
- errorTimeUtc: 'errorTime'
14199
- };
14200
- /**
14201
- * Maps fields for Incident Summary entities
14202
- */
14203
- const ProcessIncidentSummaryMap = {
14204
- firstTimeUtc: 'firstOccuranceTime'
14205
- };
14206
-
14207
- /**
14208
- * Helpers for fetching BPMN XML and extracting element details used to annotate responses
14209
- */
14210
- class BpmnHelpers {
14211
- /**
14212
- * Parse BPMN XML and extract element id → {name,type} used for incidents
14213
- */
14214
- static parseBpmnElementsForIncidents(bpmnXml) {
14215
- const elementInfo = {};
14216
- try {
14217
- // Find <bpmn:...> start tags and capture the element type.
14218
- // Then read 'id' and 'name' attributes from each tag.
14219
- const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
14220
- for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
14221
- const [fullTag, elementType] = tagMatch;
14222
- // Extract attributes from the current tag text.
14223
- const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
14224
- if (!idMatch) {
14225
- continue;
14226
- }
14227
- const elementId = idMatch[1];
14228
- const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
14229
- const name = nameMatch ? nameMatch[1] : '';
14230
- // Convert BPMN element type to human-readable format
14231
- const activityType = this.formatActivityTypeForIncidents(elementType);
14232
- const activityName = name || elementId;
14233
- elementInfo[elementId] = {
14234
- type: activityType,
14235
- name: activityName
14236
- };
14237
- }
14238
- }
14239
- catch (error) {
14240
- console.warn('Failed to parse BPMN XML for incidents:', error);
14241
- }
14242
- return elementInfo;
14243
- }
14244
- /**
14245
- * Format BPMN element type to human-readable activity type for incidents
14246
- */
14247
- static formatActivityTypeForIncidents(elementType) {
14248
- // Convert camelCase BPMN element types to human-readable format
14249
- // e.g., "serviceTask" -> "Service Task", "exclusiveGateway" -> "Exclusive Gateway"
14250
- return elementType
14251
- .replace(/([A-Z])/g, ' $1') // Add space before uppercase letters
14252
- .replace(/^./, str => str.toUpperCase()) // Capitalize first letter
14253
- .trim(); // Remove any leading/trailing spaces
14254
- }
14255
- /**
14256
- * Fetch BPMN via getBpmn and add element name/type to each incident
14257
- */
14258
- static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
14259
- // Check if all incidents have the same instanceId
14260
- const uniqueInstanceIds = [...new Set(incidents.map(i => i.instanceId))];
14261
- if (uniqueInstanceIds.length === 1) {
14262
- // Single instance optimization (in case of process instance incidents)
14263
- const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
14264
- return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
14265
- }
14266
- else {
14267
- // Multiple instances optimization (in case of process incidents)
14268
- return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
14269
- }
14270
- }
14271
- /**
14272
- * When incidents span multiple instances, fetch BPMN per instance and annotate
14273
- */
14274
- static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
14275
- const groups = incidents.reduce((acc, incident) => {
14276
- const id = incident.instanceId || NO_INSTANCE;
14277
- (acc[id] = acc[id] || []).push(incident);
14278
- return acc;
14279
- }, {});
14280
- const results = await Promise.all(Object.entries(groups).map(async (entry) => {
14281
- const [instanceId, groupIncidents] = entry;
14282
- const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
14283
- return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
14284
- }));
14285
- return results.flat();
14286
- }
14287
- /**
14288
- * Retrieve BPMN XML for an instance and derive element id → {name,type}
14289
- */
14290
- static async getBpmnElementInfo(instanceId, folderKey, service) {
14291
- if (!instanceId || instanceId === NO_INSTANCE) {
14292
- return {};
14293
- }
14294
- try {
14295
- const bpmnXml = await service.getBpmn(instanceId, folderKey);
14296
- return this.parseBpmnElementsForIncidents(bpmnXml);
14297
- }
14298
- catch (error) {
14299
- console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
14300
- return {};
14301
- }
14302
- }
14303
- /**
14304
- * Transform a raw incident by attaching element name/type from BPMN
14305
- */
14306
- static transformIncidentWithBpmn(incident, elementInfo) {
14307
- const element = elementInfo[incident.elementId];
14308
- const transformed = transformData(incident, ProcessIncidentMap);
14309
- return {
14310
- ...transformed,
14311
- incidentElementActivityType: element?.type || UNKNOWN,
14312
- incidentElementActivityName: element?.name || UNKNOWN
14313
- };
14314
- }
14315
- }
14316
-
14317
- /**
14318
- * Creates methods for a process instance
14319
- *
14320
- * @param instanceData - The process instance data (response from API)
14321
- * @param service - The process instance service instance
14322
- * @returns Object containing process instance methods
14323
- */
14324
- function createProcessInstanceMethods(instanceData, service) {
14325
- return {
14326
- async cancel(options) {
14327
- if (!instanceData.instanceId)
14328
- throw new Error('Process instance ID is undefined');
14329
- if (!instanceData.folderKey)
14330
- throw new Error('Process instance folder key is undefined');
14331
- return service.cancel(instanceData.instanceId, instanceData.folderKey, options);
14332
- },
14333
- async pause(options) {
14334
- if (!instanceData.instanceId)
14335
- throw new Error('Process instance ID is undefined');
14336
- if (!instanceData.folderKey)
14337
- throw new Error('Process instance folder key is undefined');
14338
- return service.pause(instanceData.instanceId, instanceData.folderKey, options);
14339
- },
14340
- async resume(options) {
14341
- if (!instanceData.instanceId)
14342
- throw new Error('Process instance ID is undefined');
14343
- if (!instanceData.folderKey)
14344
- throw new Error('Process instance folder key is undefined');
14345
- return service.resume(instanceData.instanceId, instanceData.folderKey, options);
14346
- },
14347
- async getIncidents() {
14348
- if (!instanceData.instanceId)
14349
- throw new Error('Process instance ID is undefined');
14350
- if (!instanceData.folderKey)
14351
- throw new Error('Process instance folder key is undefined');
14352
- return service.getIncidents(instanceData.instanceId, instanceData.folderKey);
14353
- },
14354
- async getExecutionHistory() {
14355
- if (!instanceData.instanceId)
14356
- throw new Error('Process instance ID is undefined');
14357
- if (!instanceData.folderKey)
14358
- throw new Error('Process instance folder key is undefined');
14359
- return service.getExecutionHistory(instanceData.instanceId, instanceData.folderKey);
14360
- },
14361
- async getBpmn() {
14362
- if (!instanceData.instanceId)
14363
- throw new Error('Process instance ID is undefined');
14364
- if (!instanceData.folderKey)
14365
- throw new Error('Process instance folder key is undefined');
14366
- return service.getBpmn(instanceData.instanceId, instanceData.folderKey);
14367
- },
14368
- async getVariables(options) {
14369
- if (!instanceData.instanceId)
14370
- throw new Error('Process instance ID is undefined');
14371
- if (!instanceData.folderKey)
14372
- throw new Error('Process instance folder key is undefined');
14373
- return service.getVariables(instanceData.instanceId, instanceData.folderKey, options);
14374
- }
14375
- };
14376
- }
14377
- /**
14378
- * Creates an actionable process instance by combining API process instance data with operational methods.
14379
- *
14380
- * @param instanceData - The process instance data from API
14381
- * @param service - The process instance service instance
14382
- * @returns A process instance object with added methods
14632
+ * @param instanceData - The process instance data from API
14633
+ * @param service - The process instance service instance
14634
+ * @returns A process instance object with added methods
14383
14635
  */
14384
14636
  function createProcessInstanceWithMethods(instanceData, service) {
14385
14637
  const methods = createProcessInstanceMethods(instanceData, service);
@@ -14460,6 +14712,16 @@
14460
14712
  startTime,
14461
14713
  endTime,
14462
14714
  });
14715
+ },
14716
+ getInstanceStatusTimeline(startTime, endTime, options) {
14717
+ if (!caseData.processKey)
14718
+ throw new Error('Process key is undefined');
14719
+ return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
14720
+ },
14721
+ getIncidentsTimeline(startTime, endTime, options) {
14722
+ if (!caseData.processKey)
14723
+ throw new Error('Process key is undefined');
14724
+ return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
14463
14725
  }
14464
14726
  };
14465
14727
  }
@@ -14661,20 +14923,210 @@
14661
14923
  TimeInterval["Week"] = "WEEK";
14662
14924
  })(exports.TimeInterval || (exports.TimeInterval = {}));
14663
14925
  /**
14664
- * Final instance statuses returned by the instance status timeline endpoint.
14665
- *
14666
- * Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
14667
- * Active statuses like Running or Paused are not included.
14926
+ * Final instance statuses returned by the instance status timeline endpoint.
14927
+ *
14928
+ * Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
14929
+ * Active statuses like Running or Paused are not included.
14930
+ */
14931
+ exports.InstanceFinalStatus = void 0;
14932
+ (function (InstanceFinalStatus) {
14933
+ /** Instance completed successfully */
14934
+ InstanceFinalStatus["Completed"] = "Completed";
14935
+ /** Instance encountered an error */
14936
+ InstanceFinalStatus["Faulted"] = "Faulted";
14937
+ /** Instance was cancelled */
14938
+ InstanceFinalStatus["Cancelled"] = "Cancelled";
14939
+ })(exports.InstanceFinalStatus || (exports.InstanceFinalStatus = {}));
14940
+
14941
+ /**
14942
+ * Builds the request body for Insights RTM "top" endpoints.
14943
+ *
14944
+ * @param startTime - Start of the time range to query
14945
+ * @param endTime - End of the time range to query
14946
+ * @param isCaseManagement - Whether to filter for case management processes
14947
+ * @param options - Optional filters (packageId, processKey, version)
14948
+ * @returns Request body for the Insights RTM endpoint
14949
+ * @internal
14950
+ */
14951
+ function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
14952
+ return {
14953
+ commonParams: {
14954
+ startTime: startTime.getTime(),
14955
+ endTime: endTime.getTime(),
14956
+ isCaseManagement,
14957
+ ...(options?.packageId ? { packageId: options.packageId } : {}),
14958
+ ...(options?.processKey ? { processKey: options.processKey } : {}),
14959
+ ...(options?.version ? { version: options.version } : {}),
14960
+ }
14961
+ };
14962
+ }
14963
+ /**
14964
+ * Builds the request body for Insights RTM timeline endpoints
14965
+ * (`InstanceStatusByDate`, `IncidentsByTimeWindow`).
14966
+ *
14967
+ * @param startTime - Start of the time range to query
14968
+ * @param endTime - End of the time range to query
14969
+ * @param isCaseManagement - Whether to filter for case management processes
14970
+ * @param options - Optional time bucketing and filtering settings
14971
+ * @returns Request body for the Insights RTM timeline endpoint
14972
+ * @internal
14973
+ */
14974
+ function buildInsightsTimelineBody(startTime, endTime, isCaseManagement, options) {
14975
+ return {
14976
+ commonParams: {
14977
+ startTime: startTime.getTime(),
14978
+ endTime: endTime.getTime(),
14979
+ isCaseManagement,
14980
+ ...(options?.packageId ? { packageId: options.packageId } : {}),
14981
+ ...(options?.version ? { version: options.version } : {}),
14982
+ ...(options?.processKeys ? { processKeys: options.processKeys } : {}),
14983
+ },
14984
+ timeSliceUnit: options?.groupBy ?? exports.TimeInterval.Day,
14985
+ timezoneOffset: new Date().getTimezoneOffset() * -1,
14986
+ };
14987
+ }
14988
+ /**
14989
+ * Builds the commonParams request body for Insights RTM endpoints
14990
+ * that filter by process key, package, time range, and version.
14991
+ *
14992
+ * @param request - Process scope + time range to aggregate over
14993
+ * @returns Request body with commonParams
14994
+ * @internal
14995
+ */
14996
+ function buildInsightsCommonBody(request) {
14997
+ return {
14998
+ commonParams: {
14999
+ processKey: request.processKey,
15000
+ packageId: request.packageId,
15001
+ startTime: request.startTime.getTime(),
15002
+ endTime: request.endTime.getTime(),
15003
+ version: request.packageVersion
15004
+ }
15005
+ };
15006
+ }
15007
+
15008
+ /**
15009
+ * Maps fields for Incident entities
15010
+ */
15011
+ const ProcessIncidentMap = {
15012
+ errorTimeUtc: 'errorTime'
15013
+ };
15014
+ /**
15015
+ * Maps fields for Incident Summary entities
14668
15016
  */
14669
- exports.InstanceFinalStatus = void 0;
14670
- (function (InstanceFinalStatus) {
14671
- /** Instance completed successfully */
14672
- InstanceFinalStatus["Completed"] = "Completed";
14673
- /** Instance encountered an error */
14674
- InstanceFinalStatus["Faulted"] = "Faulted";
14675
- /** Instance was cancelled */
14676
- InstanceFinalStatus["Cancelled"] = "Cancelled";
14677
- })(exports.InstanceFinalStatus || (exports.InstanceFinalStatus = {}));
15017
+ const ProcessIncidentSummaryMap = {
15018
+ firstTimeUtc: 'firstOccuranceTime'
15019
+ };
15020
+
15021
+ /**
15022
+ * Helpers for fetching BPMN XML and extracting element details used to annotate responses
15023
+ */
15024
+ class BpmnHelpers {
15025
+ /**
15026
+ * Parse BPMN XML and extract element id → {name,type} used for incidents
15027
+ */
15028
+ static parseBpmnElementsForIncidents(bpmnXml) {
15029
+ const elementInfo = {};
15030
+ try {
15031
+ // Find <bpmn:...> start tags and capture the element type.
15032
+ // Then read 'id' and 'name' attributes from each tag.
15033
+ const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
15034
+ for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
15035
+ const [fullTag, elementType] = tagMatch;
15036
+ // Extract attributes from the current tag text.
15037
+ const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
15038
+ if (!idMatch) {
15039
+ continue;
15040
+ }
15041
+ const elementId = idMatch[1];
15042
+ const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
15043
+ const name = nameMatch ? nameMatch[1] : '';
15044
+ // Convert BPMN element type to human-readable format
15045
+ const activityType = this.formatActivityTypeForIncidents(elementType);
15046
+ const activityName = name || elementId;
15047
+ elementInfo[elementId] = {
15048
+ type: activityType,
15049
+ name: activityName
15050
+ };
15051
+ }
15052
+ }
15053
+ catch (error) {
15054
+ console.warn('Failed to parse BPMN XML for incidents:', error);
15055
+ }
15056
+ return elementInfo;
15057
+ }
15058
+ /**
15059
+ * Format BPMN element type to human-readable activity type for incidents
15060
+ */
15061
+ static formatActivityTypeForIncidents(elementType) {
15062
+ // Convert camelCase BPMN element types to human-readable format
15063
+ // e.g., "serviceTask" -> "Service Task", "exclusiveGateway" -> "Exclusive Gateway"
15064
+ return elementType
15065
+ .replace(/([A-Z])/g, ' $1') // Add space before uppercase letters
15066
+ .replace(/^./, str => str.toUpperCase()) // Capitalize first letter
15067
+ .trim(); // Remove any leading/trailing spaces
15068
+ }
15069
+ /**
15070
+ * Fetch BPMN via getBpmn and add element name/type to each incident
15071
+ */
15072
+ static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
15073
+ // Check if all incidents have the same instanceId
15074
+ const uniqueInstanceIds = [...new Set(incidents.map(i => i.instanceId))];
15075
+ if (uniqueInstanceIds.length === 1) {
15076
+ // Single instance optimization (in case of process instance incidents)
15077
+ const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
15078
+ return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
15079
+ }
15080
+ else {
15081
+ // Multiple instances optimization (in case of process incidents)
15082
+ return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
15083
+ }
15084
+ }
15085
+ /**
15086
+ * When incidents span multiple instances, fetch BPMN per instance and annotate
15087
+ */
15088
+ static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
15089
+ const groups = incidents.reduce((acc, incident) => {
15090
+ const id = incident.instanceId || NO_INSTANCE;
15091
+ (acc[id] = acc[id] || []).push(incident);
15092
+ return acc;
15093
+ }, {});
15094
+ const results = await Promise.all(Object.entries(groups).map(async (entry) => {
15095
+ const [instanceId, groupIncidents] = entry;
15096
+ const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
15097
+ return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
15098
+ }));
15099
+ return results.flat();
15100
+ }
15101
+ /**
15102
+ * Retrieve BPMN XML for an instance and derive element id → {name,type}
15103
+ */
15104
+ static async getBpmnElementInfo(instanceId, folderKey, service) {
15105
+ if (!instanceId || instanceId === NO_INSTANCE) {
15106
+ return {};
15107
+ }
15108
+ try {
15109
+ const bpmnXml = await service.getBpmn(instanceId, folderKey);
15110
+ return this.parseBpmnElementsForIncidents(bpmnXml);
15111
+ }
15112
+ catch (error) {
15113
+ console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
15114
+ return {};
15115
+ }
15116
+ }
15117
+ /**
15118
+ * Transform a raw incident by attaching element name/type from BPMN
15119
+ */
15120
+ static transformIncidentWithBpmn(incident, elementInfo) {
15121
+ const element = elementInfo[incident.elementId];
15122
+ const transformed = transformData(incident, ProcessIncidentMap);
15123
+ return {
15124
+ ...transformed,
15125
+ incidentElementActivityType: element?.type || UNKNOWN,
15126
+ incidentElementActivityName: element?.name || UNKNOWN
15127
+ };
15128
+ }
15129
+ }
14678
15130
 
14679
15131
  /**
14680
15132
  * Maps fields for Process Instance entities to ensure consistent naming
@@ -14751,7 +15203,7 @@
14751
15203
  }, options);
14752
15204
  }
14753
15205
  /**
14754
- * Get a process instance by ID with operation methods (cancel, pause, resume)
15206
+ * Get a process instance by ID with operation methods (cancel, pause, resume, retry)
14755
15207
  * @param id The ID of the instance to retrieve
14756
15208
  * @param folderKey The folder key for authorization
14757
15209
  * @returns Promise<ProcessInstanceGetResponse>
@@ -14890,6 +15342,25 @@
14890
15342
  data: response.data
14891
15343
  };
14892
15344
  }
15345
+ /**
15346
+ * Retry a faulted process instance
15347
+ *
15348
+ * Re-runs the failed elements of the instance (and the elements that follow) within
15349
+ * the same instance, spawning new jobs. Use to recover from transient/flaky failures.
15350
+ * @param instanceId The ID of the instance to retry
15351
+ * @param folderKey The folder key for authorization
15352
+ * @param options Optional retry options with comment
15353
+ * @returns Promise resolving to operation result with updated instance data
15354
+ */
15355
+ async retry(instanceId, folderKey, options) {
15356
+ const response = await this.post(MAESTRO_ENDPOINTS.INSTANCES.RETRY(instanceId), options || {}, {
15357
+ headers: createHeaders({ [FOLDER_KEY]: folderKey })
15358
+ });
15359
+ return {
15360
+ success: true,
15361
+ data: response.data
15362
+ };
15363
+ }
14893
15364
  /**
14894
15365
  * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
14895
15366
  * @private
@@ -15040,6 +15511,9 @@
15040
15511
  __decorate([
15041
15512
  track('ProcessInstances.Resume')
15042
15513
  ], ProcessInstancesService.prototype, "resume", null);
15514
+ __decorate([
15515
+ track('ProcessInstances.Retry')
15516
+ ], ProcessInstancesService.prototype, "retry", null);
15043
15517
  __decorate([
15044
15518
  track('ProcessInstances.GetVariables')
15045
15519
  ], ProcessInstancesService.prototype, "getVariables", null);
@@ -15196,7 +15670,7 @@
15196
15670
  *
15197
15671
  * @param startTime - Start of the time range to query
15198
15672
  * @param endTime - End of the time range to query
15199
- * @param options - Optional settings for time bucketing granularity
15673
+ * @param options - Optional settings for filtering and time bucket granularity
15200
15674
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
15201
15675
  *
15202
15676
  * @example
@@ -15223,12 +15697,67 @@
15223
15697
  *
15224
15698
  * @example
15225
15699
  * ```typescript
15700
+ * // Filter to a specific process
15701
+ * const filtered = await maestroProcesses.getInstanceStatusTimeline(startTime, endTime, {
15702
+ * processKeys: ['<processKey>'],
15703
+ * });
15704
+ * ```
15705
+ *
15706
+ * @example
15707
+ * ```typescript
15226
15708
  * // Get all-time data (from Unix epoch to now)
15227
15709
  * const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
15228
15710
  * ```
15229
15711
  */
15230
15712
  async getInstanceStatusTimeline(startTime, endTime, options) {
15231
- return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, false, options);
15713
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, false, options));
15714
+ return data ?? [];
15715
+ }
15716
+ /**
15717
+ * Get incident counts aggregated by time bucket for maestro processes.
15718
+ *
15719
+ * Returns time-grouped counts of incidents that occurred within each bucket,
15720
+ * useful for rendering incident time-series charts. Use `groupBy` to control
15721
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
15722
+ *
15723
+ * @param startTime - Start of the time range to query
15724
+ * @param endTime - End of the time range to query
15725
+ * @param options - Optional settings for filtering and time bucket granularity
15726
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
15727
+ *
15728
+ * @example
15729
+ * ```typescript
15730
+ * // Get daily incident counts for the last 7 days
15731
+ * const now = new Date();
15732
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
15733
+ * const incidents = await maestroProcesses.getIncidentsTimeline(sevenDaysAgo, now);
15734
+ *
15735
+ * for (const incident of incidents) {
15736
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
15737
+ * }
15738
+ * ```
15739
+ *
15740
+ * @example
15741
+ * ```typescript
15742
+ * import { TimeInterval } from '@uipath/uipath-typescript/maestro-processes';
15743
+ *
15744
+ * // Get weekly breakdown
15745
+ * const incidents = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
15746
+ * groupBy: TimeInterval.Week,
15747
+ * });
15748
+ * ```
15749
+ *
15750
+ * @example
15751
+ * ```typescript
15752
+ * // Filter to a specific process
15753
+ * const filtered = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
15754
+ * processKeys: ['<processKey>'],
15755
+ * });
15756
+ * ```
15757
+ */
15758
+ async getIncidentsTimeline(startTime, endTime, options) {
15759
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, false, options));
15760
+ return data?.dataPoints ?? [];
15232
15761
  }
15233
15762
  /**
15234
15763
  * Get the top 10 processes ranked by failure count within a time range.
@@ -15414,6 +15943,9 @@
15414
15943
  __decorate([
15415
15944
  track('MaestroProcesses.GetInstanceStatusTimeline')
15416
15945
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
15946
+ __decorate([
15947
+ track('MaestroProcesses.GetIncidentsTimeline')
15948
+ ], MaestroProcessesService.prototype, "getIncidentsTimeline", null);
15417
15949
  __decorate([
15418
15950
  track('MaestroProcesses.GetTopFaultedCount')
15419
15951
  ], MaestroProcessesService.prototype, "getTopFaultedCount", null);
@@ -15606,7 +16138,7 @@
15606
16138
  *
15607
16139
  * @param startTime - Start of the time range to query
15608
16140
  * @param endTime - End of the time range to query
15609
- * @param options - Optional settings for time bucketing granularity
16141
+ * @param options - Optional settings for filtering and time bucket granularity
15610
16142
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
15611
16143
  *
15612
16144
  * @example
@@ -15633,12 +16165,67 @@
15633
16165
  *
15634
16166
  * @example
15635
16167
  * ```typescript
16168
+ * // Filter to a specific case process
16169
+ * const filtered = await cases.getInstanceStatusTimeline(startTime, endTime, {
16170
+ * processKeys: ['<processKey>'],
16171
+ * });
16172
+ * ```
16173
+ *
16174
+ * @example
16175
+ * ```typescript
15636
16176
  * // Get all-time data (from Unix epoch to now)
15637
16177
  * const allTime = await cases.getInstanceStatusTimeline(new Date(0), new Date());
15638
16178
  * ```
15639
16179
  */
15640
16180
  async getInstanceStatusTimeline(startTime, endTime, options) {
15641
- return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, true, options);
16181
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, true, options));
16182
+ return data ?? [];
16183
+ }
16184
+ /**
16185
+ * Get incident counts aggregated by time bucket for case management processes.
16186
+ *
16187
+ * Returns time-grouped counts of incidents that occurred within each bucket,
16188
+ * useful for rendering incident time-series charts. Use `groupBy` to control
16189
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
16190
+ *
16191
+ * @param startTime - Start of the time range to query
16192
+ * @param endTime - End of the time range to query
16193
+ * @param options - Optional settings for filtering and time bucket granularity
16194
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
16195
+ *
16196
+ * @example
16197
+ * ```typescript
16198
+ * // Get daily incident counts for the last 7 days
16199
+ * const now = new Date();
16200
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
16201
+ * const incidents = await cases.getIncidentsTimeline(sevenDaysAgo, now);
16202
+ *
16203
+ * for (const incident of incidents) {
16204
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
16205
+ * }
16206
+ * ```
16207
+ *
16208
+ * @example
16209
+ * ```typescript
16210
+ * import { TimeInterval } from '@uipath/uipath-typescript/cases';
16211
+ *
16212
+ * // Get weekly breakdown
16213
+ * const incidents = await cases.getIncidentsTimeline(startTime, endTime, {
16214
+ * groupBy: TimeInterval.Week,
16215
+ * });
16216
+ * ```
16217
+ *
16218
+ * @example
16219
+ * ```typescript
16220
+ * // Filter to a specific case process
16221
+ * const filtered = await cases.getIncidentsTimeline(startTime, endTime, {
16222
+ * processKeys: ['<processKey>'],
16223
+ * });
16224
+ * ```
16225
+ */
16226
+ async getIncidentsTimeline(startTime, endTime, options) {
16227
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, true, options));
16228
+ return data?.dataPoints ?? [];
15642
16229
  }
15643
16230
  /**
15644
16231
  * Get the top 10 case processes ranked by failure count within a time range.
@@ -15837,6 +16424,9 @@
15837
16424
  __decorate([
15838
16425
  track('Cases.GetInstanceStatusTimeline')
15839
16426
  ], CasesService.prototype, "getInstanceStatusTimeline", null);
16427
+ __decorate([
16428
+ track('Cases.GetIncidentsTimeline')
16429
+ ], CasesService.prototype, "getIncidentsTimeline", null);
15840
16430
  __decorate([
15841
16431
  track('Cases.GetTopFaultedCount')
15842
16432
  ], CasesService.prototype, "getTopFaultedCount", null);
@@ -16154,6 +16744,10 @@
16154
16744
  const transformedTask = transformData(pascalToCamelCaseKeys(task), TaskMap);
16155
16745
  return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
16156
16746
  };
16747
+ // Rewrite renamed SDK field names → API names inside OData strings
16748
+ // before delegating, mirroring the transformRequest pattern used for
16749
+ // request bodies.
16750
+ const apiOptions = options ? transformOptions(options, TaskMap) : options;
16157
16751
  return PaginationHelpers.getAll({
16158
16752
  serviceAccess: this.createPaginationServiceAccess(),
16159
16753
  getEndpoint: () => endpoint,
@@ -16170,7 +16764,7 @@
16170
16764
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM // OData OFFSET parameter
16171
16765
  }
16172
16766
  }
16173
- }, options);
16767
+ }, apiOptions);
16174
16768
  }
16175
16769
  /**
16176
16770
  * Gets a task by ID
@@ -16206,9 +16800,10 @@
16206
16800
  const headers = createHeaders({ [FOLDER_ID]: folderId });
16207
16801
  // Add default expand parameters
16208
16802
  const modifiedOptions = this.addDefaultExpand(restOptions);
16209
- // prefix all keys in options
16210
- const keysToPrefix = Object.keys(modifiedOptions);
16211
- const apiOptions = addPrefixToKeys(modifiedOptions, ODATA_PREFIX, keysToPrefix);
16803
+ // Rewrite renamed SDK field names → API names inside OData strings,
16804
+ // then prefix all keys for OData.
16805
+ const apiFieldOptions = transformOptions(modifiedOptions, TaskMap);
16806
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
16212
16807
  const response = await this.get(TASK_ENDPOINTS.GET_BY_ID(id), {
16213
16808
  params: apiOptions,
16214
16809
  headers
@@ -17201,9 +17796,12 @@
17201
17796
  * @param name - Resource name to search for
17202
17797
  * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) + OData query options (`expand`, `select`)
17203
17798
  * @param transform - Maps a raw OData item to the typed response (e.g. PascalCase → camelCase via field map)
17799
+ * @param responseFieldMap - Optional response field map (API → SDK), reversed internally by
17800
+ * `transformOptions` to rewrite SDK field names back to API names in user-supplied
17801
+ * `expand` / `select` (symmetric counterpart to `transform`)
17204
17802
  * @throws ValidationError when inputs are malformed; NotFoundError when no match
17205
17803
  */
17206
- async getByNameLookup(resourceType, endpoint, name, options, transform) {
17804
+ async getByNameLookup(resourceType, endpoint, name, options, transform, responseFieldMap) {
17207
17805
  const validatedName = validateName(resourceType, name);
17208
17806
  const { folderId, folderKey, folderPath, ...queryOptions } = options;
17209
17807
  const headers = resolveFolderHeaders({
@@ -17213,8 +17811,11 @@
17213
17811
  resourceType: `${resourceType}.getByName`,
17214
17812
  fallbackFolderKey: this.config.folderKey,
17215
17813
  });
17814
+ const apiFieldOptions = responseFieldMap
17815
+ ? transformOptions(queryOptions, responseFieldMap)
17816
+ : queryOptions;
17216
17817
  const apiOptions = {
17217
- ...addPrefixToKeys(queryOptions, ODATA_PREFIX, Object.keys(queryOptions)),
17818
+ ...addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions)),
17218
17819
  '$filter': `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
17219
17820
  '$top': '1',
17220
17821
  };
@@ -17314,6 +17915,10 @@
17314
17915
  async getAll(options) {
17315
17916
  // Transformation function for assets
17316
17917
  const transformAssetResponse = (asset) => transformData(pascalToCamelCaseKeys(asset), AssetMap);
17918
+ // Rewrite renamed SDK field names → API names inside OData strings
17919
+ // before delegating, mirroring the transformRequest pattern used for
17920
+ // request bodies.
17921
+ const apiOptions = options ? transformOptions(options, AssetMap) : options;
17317
17922
  return PaginationHelpers.getAll({
17318
17923
  serviceAccess: this.createPaginationServiceAccess(),
17319
17924
  getEndpoint: (folderId) => folderId ? ASSET_ENDPOINTS.GET_BY_FOLDER : ASSET_ENDPOINTS.GET_ALL,
@@ -17329,7 +17934,7 @@
17329
17934
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
17330
17935
  }
17331
17936
  }
17332
- }, options);
17937
+ }, apiOptions);
17333
17938
  }
17334
17939
  /**
17335
17940
  * Gets a single asset by ID
@@ -17351,8 +17956,8 @@
17351
17956
  */
17352
17957
  async getById(id, folderId, options = {}) {
17353
17958
  const headers = createHeaders({ [FOLDER_ID]: folderId });
17354
- const keysToPrefix = Object.keys(options);
17355
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
17959
+ const apiFieldOptions = transformOptions(options, AssetMap);
17960
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
17356
17961
  const response = await this.get(ASSET_ENDPOINTS.GET_BY_ID(id), {
17357
17962
  headers,
17358
17963
  params: apiOptions
@@ -17387,7 +17992,7 @@
17387
17992
  * ```
17388
17993
  */
17389
17994
  async getByName(name, options = {}) {
17390
- return this.getByNameLookup('Asset', ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap));
17995
+ return this.getByNameLookup('Asset', ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap), AssetMap);
17391
17996
  }
17392
17997
  /**
17393
17998
  * Updates the value of an existing asset by ID.
@@ -17661,6 +18266,9 @@
17661
18266
  });
17662
18267
  // Transformation function for blob items
17663
18268
  const transformBlobItem = (item) => transformData(item, BucketMap);
18269
+ // Rewrite renamed SDK field names → API names inside OData strings
18270
+ // before delegating.
18271
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
17664
18272
  return PaginationHelpers.getAll({
17665
18273
  serviceAccess: this.createPaginationServiceAccess(),
17666
18274
  getEndpoint: () => BUCKET_ENDPOINTS.GET_FILE_META_DATA(bucketId),
@@ -17676,7 +18284,7 @@
17676
18284
  },
17677
18285
  excludeFromPrefix: ['prefix'], // Bucket-specific param, not OData
17678
18286
  headers,
17679
- }, restOptions);
18287
+ }, apiRestOptions);
17680
18288
  }
17681
18289
  async uploadFile(bucketIdOrOptions, path, content, options) {
17682
18290
  // Normalize the two overload forms into a single internal shape.
@@ -17760,9 +18368,10 @@
17760
18368
  resourceType: 'Buckets.getReadUri',
17761
18369
  fallbackFolderKey: this.config.folderKey,
17762
18370
  });
18371
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
17763
18372
  const queryOptions = {
17764
18373
  expiryInMinutes,
17765
- ...addPrefixToKeys(restOptions, ODATA_PREFIX, Object.keys(restOptions))
18374
+ ...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
17766
18375
  };
17767
18376
  return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, resolvedPath, headers, queryOptions);
17768
18377
  }
@@ -17882,6 +18491,9 @@
17882
18491
  fallbackFolderKey: this.config.folderKey,
17883
18492
  });
17884
18493
  const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
18494
+ // Rewrite renamed SDK field names → API names inside OData strings
18495
+ // before delegating.
18496
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
17885
18497
  return PaginationHelpers.getAll({
17886
18498
  serviceAccess: this.createPaginationServiceAccess(),
17887
18499
  getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
@@ -17898,7 +18510,7 @@
17898
18510
  },
17899
18511
  excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
17900
18512
  headers,
17901
- }, { ...restOptions, directory: '/', recursive: true });
18513
+ }, { ...apiRestOptions, directory: '/', recursive: true });
17902
18514
  }
17903
18515
  /**
17904
18516
  * Deletes a file from a bucket
@@ -17945,9 +18557,10 @@
17945
18557
  */
17946
18558
  async _getWriteUri(options) {
17947
18559
  const { bucketId, path, expiryInMinutes, headers, ...restOptions } = options;
18560
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
17948
18561
  const queryOptions = {
17949
18562
  expiryInMinutes,
17950
- ...addPrefixToKeys(restOptions, ODATA_PREFIX, Object.keys(restOptions))
18563
+ ...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
17951
18564
  };
17952
18565
  return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, path, headers, queryOptions);
17953
18566
  }
@@ -18080,9 +18693,10 @@
18080
18693
  if (!id) {
18081
18694
  throw new ValidationError({ message: 'id is required for getById' });
18082
18695
  }
18083
- // Prefix all keys in options with $ for OData
18084
- const keysToPrefix = Object.keys(options);
18085
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
18696
+ // Response applies both maps (BucketMap on blobFileAccess, AttachmentsMap on top-level);
18697
+ // merge so SDK names from either are rewritten in one pass.
18698
+ const apiFieldOptions = transformOptions(options, { ...AttachmentsMap, ...BucketMap });
18699
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
18086
18700
  const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
18087
18701
  params: apiOptions,
18088
18702
  });
@@ -18764,6 +19378,10 @@
18764
19378
  async getAll(options) {
18765
19379
  // Transformation function for processes
18766
19380
  const transformProcessResponse = (process) => transformData(pascalToCamelCaseKeys(process), ProcessMap);
19381
+ // Rewrite renamed SDK field names → API names inside OData strings
19382
+ // before delegating, mirroring the transformRequest pattern used for
19383
+ // request bodies.
19384
+ const apiOptions = options ? transformOptions(options, ProcessMap) : options;
18767
19385
  return PaginationHelpers.getAll({
18768
19386
  serviceAccess: this.createPaginationServiceAccess(),
18769
19387
  getEndpoint: () => PROCESS_ENDPOINTS.GET_ALL,
@@ -18779,7 +19397,7 @@
18779
19397
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
18780
19398
  }
18781
19399
  }
18782
- }, options);
19400
+ }, apiOptions);
18783
19401
  }
18784
19402
  async start(request, optionsOrFolderId, legacyOptions) {
18785
19403
  // Normalize the two overload forms into a single internal shape.
@@ -18813,9 +19431,10 @@
18813
19431
  const requestBody = {
18814
19432
  startInfo: apiRequest
18815
19433
  };
18816
- // Prefix all query parameter keys with '$' for OData
18817
- const keysToPrefix = Object.keys(queryOptions);
18818
- const apiOptions = addPrefixToKeys(queryOptions, ODATA_PREFIX, keysToPrefix);
19434
+ // Rewrite renamed SDK field names API names inside OData strings,
19435
+ // then prefix all query parameter keys with '$' for OData.
19436
+ const apiFieldOptions = transformOptions(queryOptions, ProcessMap);
19437
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
18819
19438
  const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
18820
19439
  params: apiOptions,
18821
19440
  headers
@@ -18843,8 +19462,8 @@
18843
19462
  */
18844
19463
  async getById(id, folderId, options = {}) {
18845
19464
  const headers = createHeaders({ [FOLDER_ID]: folderId });
18846
- const keysToPrefix = Object.keys(options);
18847
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
19465
+ const apiFieldOptions = transformOptions(options, ProcessMap);
19466
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
18848
19467
  const response = await this.get(PROCESS_ENDPOINTS.GET_BY_ID(id), {
18849
19468
  headers,
18850
19469
  params: apiOptions
@@ -18879,7 +19498,7 @@
18879
19498
  * ```
18880
19499
  */
18881
19500
  async getByName(name, options = {}) {
18882
- return this.getByNameLookup('Process', PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap));
19501
+ return this.getByNameLookup('Process', PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap), ProcessMap);
18883
19502
  }
18884
19503
  }
18885
19504
  __decorate([
@@ -18955,6 +19574,10 @@
18955
19574
  async getAll(options) {
18956
19575
  // Transformation function for queues
18957
19576
  const transformQueueResponse = (queue) => transformData(pascalToCamelCaseKeys(queue), QueueMap);
19577
+ // Rewrite renamed SDK field names → API names inside OData strings
19578
+ // before delegating, mirroring the transformRequest pattern used for
19579
+ // request bodies.
19580
+ const apiOptions = options ? transformOptions(options, QueueMap) : options;
18958
19581
  return PaginationHelpers.getAll({
18959
19582
  serviceAccess: this.createPaginationServiceAccess(),
18960
19583
  getEndpoint: (folderId) => folderId ? QUEUE_ENDPOINTS.GET_BY_FOLDER : QUEUE_ENDPOINTS.GET_ALL,
@@ -18970,7 +19593,7 @@
18970
19593
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
18971
19594
  }
18972
19595
  }
18973
- }, options);
19596
+ }, apiOptions);
18974
19597
  }
18975
19598
  /**
18976
19599
  * Gets a single queue by ID
@@ -18991,8 +19614,8 @@
18991
19614
  */
18992
19615
  async getById(id, folderId, options = {}) {
18993
19616
  const headers = createHeaders({ [FOLDER_ID]: folderId });
18994
- const keysToPrefix = Object.keys(options);
18995
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
19617
+ const apiFieldOptions = transformOptions(options, QueueMap);
19618
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
18996
19619
  const response = await this.get(QUEUE_ENDPOINTS.GET_BY_ID(id), {
18997
19620
  headers,
18998
19621
  params: apiOptions
@@ -19087,7 +19710,19 @@
19087
19710
  /**
19088
19711
  * Access to ChoiceSet service for managing choice sets
19089
19712
  */
19090
- choicesets: this.getService(ChoiceSetService)
19713
+ choicesets: this.getService(ChoiceSetService),
19714
+ /**
19715
+ * Access to Data Fabric roles for manage-access flows
19716
+ *
19717
+ * @internal
19718
+ */
19719
+ roles: this.getService(DataFabricRoleService),
19720
+ /**
19721
+ * Access to Data Fabric directory principals and role assignments
19722
+ *
19723
+ * @internal
19724
+ */
19725
+ directory: this.getService(DataFabricDirectoryService)
19091
19726
  });
19092
19727
  }
19093
19728
  /**
@@ -19847,6 +20482,52 @@
19847
20482
  SpanAttachmentDirection["Out"] = "Out";
19848
20483
  })(exports.SpanAttachmentDirection || (exports.SpanAttachmentDirection = {}));
19849
20484
 
20485
+ // ─── Governance ─────────────────────────────────────────────────────
20486
+ /**
20487
+ * Evaluation mode of a governance decision.
20488
+ */
20489
+ exports.AgentGovernanceMode = void 0;
20490
+ (function (AgentGovernanceMode) {
20491
+ /** Policy evaluated and logged, but not enforced. */
20492
+ AgentGovernanceMode["Audit"] = "AUDIT";
20493
+ /** Policy evaluated and enforced. */
20494
+ AgentGovernanceMode["Enforce"] = "ENFORCE";
20495
+ /** Unrecognized or missing mode. */
20496
+ AgentGovernanceMode["Unknown"] = "Unknown";
20497
+ })(exports.AgentGovernanceMode || (exports.AgentGovernanceMode = {}));
20498
+ /**
20499
+ * Verdict of a governance decision (`Deny` = violation).
20500
+ */
20501
+ exports.AgentGovernanceVerdict = void 0;
20502
+ (function (AgentGovernanceVerdict) {
20503
+ /** Allowed — not a violation. */
20504
+ AgentGovernanceVerdict["Allow"] = "ALLOW";
20505
+ /** Denied — counts as a violation. */
20506
+ AgentGovernanceVerdict["Deny"] = "DENY";
20507
+ /** Unrecognized or missing verdict. */
20508
+ AgentGovernanceVerdict["Unknown"] = "Unknown";
20509
+ })(exports.AgentGovernanceVerdict || (exports.AgentGovernanceVerdict = {}));
20510
+ /**
20511
+ * Sections the governance summary can compute. `action` and `mode` are opt-in.
20512
+ */
20513
+ exports.AgentGovernanceSection = void 0;
20514
+ (function (AgentGovernanceSection) {
20515
+ /** Scalar totals (`total`, `violations`). */
20516
+ AgentGovernanceSection["Totals"] = "totals";
20517
+ /** Breakdown by governance hook. */
20518
+ AgentGovernanceSection["Hook"] = "hook";
20519
+ /** Breakdown by agent. */
20520
+ AgentGovernanceSection["Agent"] = "agent";
20521
+ /** Breakdown by policy. */
20522
+ AgentGovernanceSection["Policy"] = "policy";
20523
+ /** Breakdown by governance pack. */
20524
+ AgentGovernanceSection["Pack"] = "pack";
20525
+ /** Breakdown by enforcement action (opt-in). */
20526
+ AgentGovernanceSection["Action"] = "action";
20527
+ /** Breakdown by evaluation mode (opt-in). */
20528
+ AgentGovernanceSection["Mode"] = "mode";
20529
+ })(exports.AgentGovernanceSection || (exports.AgentGovernanceSection = {}));
20530
+
19850
20531
  /**
19851
20532
  * Asset resolution utilities for UiPath Coded Apps
19852
20533
  *