@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.mjs CHANGED
@@ -4621,6 +4621,7 @@ const MAESTRO_ENDPOINTS = {
4621
4621
  CANCEL: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/cancel`,
4622
4622
  PAUSE: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/pause`,
4623
4623
  RESUME: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/resume`,
4624
+ RETRY: (instanceId) => `${PIMS_BASE}/api/v1/instances/${instanceId}/retry`,
4624
4625
  },
4625
4626
  INCIDENTS: {
4626
4627
  GET_ALL: `${PIMS_BASE}/api/v1/incidents/summary`,
@@ -4654,6 +4655,8 @@ const MAESTRO_ENDPOINTS = {
4654
4655
  INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
4655
4656
  /** Element count by status for agentic instances (process and case) */
4656
4657
  ELEMENT_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/ElementCountByStatus`,
4658
+ /** Incident counts aggregated by time bucket for time-series charts */
4659
+ INCIDENTS_BY_TIME_WINDOW: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/IncidentsByTimeWindow`,
4657
4660
  },
4658
4661
  };
4659
4662
 
@@ -4703,6 +4706,14 @@ const DATA_FABRIC_ENDPOINTS = {
4703
4706
  UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
4704
4707
  DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`,
4705
4708
  },
4709
+ ROLES: {
4710
+ GET_ALL: `${DATAFABRIC_BASE}/api/v2/Role`,
4711
+ },
4712
+ DIRECTORY: {
4713
+ GET_ALL: `${DATAFABRIC_BASE}/api/Directory`,
4714
+ ASSIGN_ROLES: `${DATAFABRIC_BASE}/api/Directory/Role`,
4715
+ REVOKE_ROLES: `${DATAFABRIC_BASE}/api/Directory/RevokeRole`,
4716
+ },
4706
4717
  };
4707
4718
 
4708
4719
  /**
@@ -5013,7 +5024,7 @@ class EmbeddedTokenManager {
5013
5024
  * SDK's public API.
5014
5025
  */
5015
5026
  /** SDK version placeholder — patched by the SDK publish workflow. */
5016
- const SDK_VERSION = '1.5.0';
5027
+ const SDK_VERSION = '1.5.1';
5017
5028
  const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
5018
5029
  const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
5019
5030
  const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
@@ -9950,6 +9961,419 @@ __decorate([
9950
9961
  track('Choicesets.DeleteValuesById')
9951
9962
  ], ChoiceSetService.prototype, "deleteValuesById", null);
9952
9963
 
9964
+ /**
9965
+ * @internal
9966
+ */
9967
+ var DataFabricRoleType;
9968
+ (function (DataFabricRoleType) {
9969
+ DataFabricRoleType["System"] = "System";
9970
+ DataFabricRoleType["UserDefined"] = "UserDefined";
9971
+ })(DataFabricRoleType || (DataFabricRoleType = {}));
9972
+
9973
+ function isRecord$1(value) {
9974
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
9975
+ }
9976
+ function isDataFabricRole(value) {
9977
+ if (!isRecord$1(value)) {
9978
+ return false;
9979
+ }
9980
+ const { id, name, type, directoryEntityCount, folderId } = value;
9981
+ const hasValidDirectoryEntityCount = directoryEntityCount === undefined ||
9982
+ directoryEntityCount === null ||
9983
+ typeof directoryEntityCount === 'number';
9984
+ const hasValidFolderId = folderId === undefined || typeof folderId === 'string';
9985
+ return typeof id === 'string' &&
9986
+ typeof name === 'string' &&
9987
+ (type === DataFabricRoleType.System || type === DataFabricRoleType.UserDefined) &&
9988
+ hasValidDirectoryEntityCount &&
9989
+ hasValidFolderId;
9990
+ }
9991
+ function validateRolesResponse(data) {
9992
+ if (Array.isArray(data) && data.every(isDataFabricRole)) {
9993
+ return data;
9994
+ }
9995
+ throw new ServerError({
9996
+ message: 'Invalid Data Fabric roles response format.',
9997
+ });
9998
+ }
9999
+ /**
10000
+ * @internal
10001
+ */
10002
+ class DataFabricRoleService extends BaseService {
10003
+ /**
10004
+ * Lists Data Fabric access roles.
10005
+ *
10006
+ * Returns tenant Data Fabric roles such as Admin, Designer, DataWriter, and
10007
+ * DataReader. Role IDs from this method can be passed to
10008
+ * `DataFabricDirectoryService.assignRoles()`.
10009
+ *
10010
+ * @param options - Optional query options
10011
+ * @returns Promise resolving to an array of {@link DataFabricRole}
10012
+ *
10013
+ * @example
10014
+ * ```typescript
10015
+ * import { DataFabricRoleService } from '@uipath/uipath-typescript/entities';
10016
+ *
10017
+ * const roles = new DataFabricRoleService(sdk);
10018
+ * const allRoles = await roles.getAll();
10019
+ * const dataWriter = allRoles.find(role => role.name === 'DataWriter');
10020
+ * ```
10021
+ *
10022
+ * @example
10023
+ * ```typescript
10024
+ * const rolesWithoutStats = await roles.getAll({ stats: false });
10025
+ * ```
10026
+ *
10027
+ * @example
10028
+ * ```typescript
10029
+ * const folderRoles = await roles.getAll({ folderKey: '<folder-key>' });
10030
+ * ```
10031
+ *
10032
+ * @internal
10033
+ */
10034
+ async getAll(options = {}) {
10035
+ const params = createParams({
10036
+ stats: options.stats ?? true,
10037
+ });
10038
+ const headers = createHeaders({ [FOLDER_KEY]: options.folderKey });
10039
+ const response = await this.get(DATA_FABRIC_ENDPOINTS.ROLES.GET_ALL, { params, headers });
10040
+ return validateRolesResponse(response.data);
10041
+ }
10042
+ }
10043
+ __decorate([
10044
+ track('DataFabricRoles.GetAll')
10045
+ ], DataFabricRoleService.prototype, "getAll", null);
10046
+
10047
+ /**
10048
+ * @internal
10049
+ */
10050
+ var DataFabricDirectoryEntityType;
10051
+ (function (DataFabricDirectoryEntityType) {
10052
+ /** Identity user, robot user, or directory robot principal. */
10053
+ DataFabricDirectoryEntityType[DataFabricDirectoryEntityType["User"] = 0] = "User";
10054
+ /** Identity group principal. */
10055
+ DataFabricDirectoryEntityType[DataFabricDirectoryEntityType["Group"] = 1] = "Group";
10056
+ /** External application principal. */
10057
+ DataFabricDirectoryEntityType[DataFabricDirectoryEntityType["Application"] = 2] = "Application";
10058
+ })(DataFabricDirectoryEntityType || (DataFabricDirectoryEntityType = {}));
10059
+ /**
10060
+ * @internal
10061
+ */
10062
+ var DataFabricDirectoryEntityTypeName;
10063
+ (function (DataFabricDirectoryEntityTypeName) {
10064
+ DataFabricDirectoryEntityTypeName["User"] = "User";
10065
+ DataFabricDirectoryEntityTypeName["Group"] = "Group";
10066
+ DataFabricDirectoryEntityTypeName["Application"] = "Application";
10067
+ })(DataFabricDirectoryEntityTypeName || (DataFabricDirectoryEntityTypeName = {}));
10068
+
10069
+ const DEFAULT_DIRECTORY_PAGE_SIZE = 100;
10070
+ const MAX_DIRECTORY_PAGE_SIZE = 100;
10071
+ function validateDirectoryListResponse(data) {
10072
+ if (data === null || typeof data !== 'object' || Array.isArray(data)) {
10073
+ throw new ServerError({
10074
+ message: 'Invalid Data Fabric directory response format.',
10075
+ });
10076
+ }
10077
+ const response = data;
10078
+ if (typeof response.totalCount !== 'number' || !Array.isArray(response.results)) {
10079
+ throw new ServerError({
10080
+ message: 'Invalid Data Fabric directory response format.',
10081
+ });
10082
+ }
10083
+ return {
10084
+ totalCount: response.totalCount,
10085
+ results: response.results,
10086
+ };
10087
+ }
10088
+ function isRecord(value) {
10089
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
10090
+ }
10091
+ function isDirectoryEntityTypeName(value) {
10092
+ return value === DataFabricDirectoryEntityTypeName.User ||
10093
+ value === DataFabricDirectoryEntityTypeName.Group ||
10094
+ value === DataFabricDirectoryEntityTypeName.Application;
10095
+ }
10096
+ function isDirectoryRole(value) {
10097
+ if (!isRecord(value)) {
10098
+ return false;
10099
+ }
10100
+ return typeof value.id === 'string' && typeof value.name === 'string';
10101
+ }
10102
+ function normalizeDirectoryEntry(entry) {
10103
+ if (!isRecord(entry) ||
10104
+ typeof entry.externalId !== 'string' ||
10105
+ typeof entry.name !== 'string' ||
10106
+ !isDirectoryEntityTypeName(entry.type) ||
10107
+ (entry.email !== undefined && entry.email !== null && typeof entry.email !== 'string') ||
10108
+ (entry.objectType !== undefined && entry.objectType !== null && typeof entry.objectType !== 'string') ||
10109
+ (entry.isUIEnabled !== undefined && typeof entry.isUIEnabled !== 'boolean') ||
10110
+ (entry.roles !== undefined && entry.roles !== null && (!Array.isArray(entry.roles) || !entry.roles.every(isDirectoryRole)))) {
10111
+ throw new ServerError({
10112
+ message: 'Invalid Data Fabric directory entry response format.',
10113
+ });
10114
+ }
10115
+ const normalized = {
10116
+ externalId: entry.externalId,
10117
+ name: entry.name,
10118
+ type: entry.type,
10119
+ roles: entry.roles ?? [],
10120
+ isUIEnabled: entry.isUIEnabled ?? true,
10121
+ };
10122
+ if (entry.email !== undefined) {
10123
+ normalized.email = entry.email;
10124
+ }
10125
+ if (entry.objectType !== undefined) {
10126
+ normalized.objectType = entry.objectType;
10127
+ }
10128
+ return normalized;
10129
+ }
10130
+ function normalizePrincipalIds(principalIds) {
10131
+ const ids = Array.isArray(principalIds) ? principalIds : [principalIds];
10132
+ return [...new Set(ids.map(id => id.trim()).filter(Boolean))];
10133
+ }
10134
+ function normalizeRoleIds(roleIds) {
10135
+ return [...new Set(roleIds.map(id => id.trim()).filter(Boolean))];
10136
+ }
10137
+ function normalizePrincipalType(type) {
10138
+ if (typeof type === 'number') {
10139
+ if (type === DataFabricDirectoryEntityType.User ||
10140
+ type === DataFabricDirectoryEntityType.Group ||
10141
+ type === DataFabricDirectoryEntityType.Application) {
10142
+ return type;
10143
+ }
10144
+ throw new ValidationError({
10145
+ message: 'Invalid Data Fabric principal type.',
10146
+ });
10147
+ }
10148
+ switch (type) {
10149
+ case DataFabricDirectoryEntityTypeName.User:
10150
+ return DataFabricDirectoryEntityType.User;
10151
+ case DataFabricDirectoryEntityTypeName.Group:
10152
+ return DataFabricDirectoryEntityType.Group;
10153
+ case DataFabricDirectoryEntityTypeName.Application:
10154
+ return DataFabricDirectoryEntityType.Application;
10155
+ default:
10156
+ throw new ValidationError({
10157
+ message: 'Invalid Data Fabric principal type.',
10158
+ });
10159
+ }
10160
+ }
10161
+ function roleIdsFromEntry(entry) {
10162
+ if (!entry) {
10163
+ return [];
10164
+ }
10165
+ return normalizeRoleIds(entry.roles.map(role => role.id));
10166
+ }
10167
+ function clampDirectoryPageSize(pageSize) {
10168
+ return Math.max(1, Math.min(pageSize ?? DEFAULT_DIRECTORY_PAGE_SIZE, MAX_DIRECTORY_PAGE_SIZE));
10169
+ }
10170
+ /**
10171
+ * @internal
10172
+ */
10173
+ class DataFabricDirectoryService extends BaseService {
10174
+ async fetchAllEntries(options = {}) {
10175
+ const top = clampDirectoryPageSize(options.pageSize);
10176
+ const entries = [];
10177
+ let skip = 0;
10178
+ while (true) {
10179
+ const page = await this.list(skip === 0 ? { top } : { top, skip });
10180
+ entries.push(...page.results);
10181
+ if (page.results.length < top || (page.totalCount !== undefined && entries.length >= page.totalCount)) {
10182
+ return entries;
10183
+ }
10184
+ skip += top;
10185
+ }
10186
+ }
10187
+ /**
10188
+ * Lists one page of Data Fabric directory principals and their current roles.
10189
+ *
10190
+ * Returns directory entries with external IDs, principal metadata, and
10191
+ * assigned Data Fabric roles.
10192
+ *
10193
+ * @param options - Optional offset paging options
10194
+ * @returns Promise resolving to {@link DataFabricDirectoryListResponse}
10195
+ *
10196
+ * @example
10197
+ * ```typescript
10198
+ * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities';
10199
+ *
10200
+ * const directory = new DataFabricDirectoryService(sdk);
10201
+ * const page = await directory.list({ skip: 0, top: 50 });
10202
+ * const firstPrincipal = page.results[0];
10203
+ * ```
10204
+ *
10205
+ * @internal
10206
+ */
10207
+ async list(options = {}) {
10208
+ const params = createParams({
10209
+ skip: options.skip,
10210
+ top: clampDirectoryPageSize(options.top),
10211
+ });
10212
+ const response = await this.get(DATA_FABRIC_ENDPOINTS.DIRECTORY.GET_ALL, { params });
10213
+ const data = validateDirectoryListResponse(response.data);
10214
+ const results = data.results.map(normalizeDirectoryEntry);
10215
+ return {
10216
+ totalCount: data.totalCount,
10217
+ results,
10218
+ };
10219
+ }
10220
+ /**
10221
+ * Lists all Data Fabric directory principals and their current roles.
10222
+ *
10223
+ * Follows the Data Fabric directory top/skip pagination and returns
10224
+ * normalized entries. Entries without assigned roles include an empty
10225
+ * `roles` array.
10226
+ *
10227
+ * @param options - Optional page-size options
10228
+ * @returns Promise resolving to an array of {@link DataFabricDirectoryEntry}
10229
+ *
10230
+ * @example
10231
+ * ```typescript
10232
+ * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities';
10233
+ *
10234
+ * const directory = new DataFabricDirectoryService(sdk);
10235
+ * const principals = await directory.getAll({ pageSize: 100 });
10236
+ * ```
10237
+ *
10238
+ * @internal
10239
+ */
10240
+ async getAll(options = {}) {
10241
+ return this.fetchAllEntries(options);
10242
+ }
10243
+ /**
10244
+ * Assigns Data Fabric roles to one or more principals.
10245
+ *
10246
+ * The Data Fabric API replaces the role set for each principal, so this
10247
+ * method preserves existing roles by default and posts the union of current
10248
+ * and requested role IDs.
10249
+ *
10250
+ * Role IDs can be discovered with `DataFabricRoleService.getAll()`. Set
10251
+ * `preserveExisting: false` only when intentionally replacing a principal's
10252
+ * Data Fabric role set.
10253
+ *
10254
+ * @param principalIds - Principal external ID or IDs
10255
+ * @param principalType - Principal type
10256
+ * @param roleIds - Data Fabric role IDs to assign
10257
+ * @param options - Optional assignment behavior
10258
+ * @returns Promise resolving to an array of {@link DataFabricDirectoryAssignmentResult}
10259
+ *
10260
+ * @example
10261
+ * ```typescript
10262
+ * import { DataFabricDirectoryEntityTypeName, DataFabricDirectoryService, DataFabricRoleService } from '@uipath/uipath-typescript/entities';
10263
+ *
10264
+ * const roles = new DataFabricRoleService(sdk);
10265
+ * const directory = new DataFabricDirectoryService(sdk);
10266
+ *
10267
+ * const dataWriter = (await roles.getAll()).find(role => role.name === 'DataWriter');
10268
+ * if (!dataWriter) {
10269
+ * throw new Error('DataWriter role not found');
10270
+ * }
10271
+ *
10272
+ * await directory.assignRoles('<identity-group-id>', DataFabricDirectoryEntityTypeName.Group, [dataWriter.id]);
10273
+ * ```
10274
+ *
10275
+ * @example
10276
+ * ```typescript
10277
+ * await directory.assignRoles('<identity-user-id>', DataFabricDirectoryEntityTypeName.User, ['<role-id>'], {
10278
+ * preserveExisting: false,
10279
+ * });
10280
+ * ```
10281
+ *
10282
+ * @internal
10283
+ */
10284
+ async assignRoles(principalIds, principalType, roleIds, options = {}) {
10285
+ const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
10286
+ const normalizedRoleIds = normalizeRoleIds(roleIds);
10287
+ if (normalizedPrincipalIds.length === 0) {
10288
+ throw new ValidationError({ message: 'At least one principal ID is required.' });
10289
+ }
10290
+ if (normalizedRoleIds.length === 0) {
10291
+ throw new ValidationError({ message: 'At least one Data Fabric role ID is required.' });
10292
+ }
10293
+ const type = normalizePrincipalType(principalType);
10294
+ const preserveExisting = options.preserveExisting ?? true;
10295
+ const existingById = new Map();
10296
+ if (preserveExisting) {
10297
+ for (const entry of await this.fetchAllEntries()) {
10298
+ existingById.set(entry.externalId.toLowerCase(), entry);
10299
+ }
10300
+ }
10301
+ return Promise.all(normalizedPrincipalIds.map(async (principalId) => {
10302
+ const existing = existingById.get(principalId.toLowerCase());
10303
+ const mergedRoleIds = preserveExisting
10304
+ ? normalizeRoleIds([...roleIdsFromEntry(existing), ...normalizedRoleIds])
10305
+ : normalizedRoleIds;
10306
+ const payload = {
10307
+ directoryEntities: [
10308
+ {
10309
+ externalId: principalId,
10310
+ type,
10311
+ resolved: true,
10312
+ },
10313
+ ],
10314
+ roles: mergedRoleIds,
10315
+ isUIEnabled: options.uiEnabled ?? true,
10316
+ };
10317
+ await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.ASSIGN_ROLES, payload);
10318
+ return {
10319
+ principalId,
10320
+ roleIds: mergedRoleIds,
10321
+ };
10322
+ }));
10323
+ }
10324
+ /**
10325
+ * Revokes all direct Data Fabric roles from one or more principals.
10326
+ *
10327
+ * The Data Fabric API removes all role assignments for each supplied external
10328
+ * ID. Use this when a principal should no longer have direct Data Fabric
10329
+ * access. Inherited access through groups is not changed.
10330
+ *
10331
+ * @param principalIds - Principal external ID or IDs
10332
+ * @returns Promise resolving when the roles are revoked
10333
+ *
10334
+ * @example
10335
+ * ```typescript
10336
+ * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities';
10337
+ *
10338
+ * const directory = new DataFabricDirectoryService(sdk);
10339
+ *
10340
+ * await directory.revokeRoles('<identity-user-id>');
10341
+ * ```
10342
+ *
10343
+ * @example
10344
+ * ```typescript
10345
+ * await directory.revokeRoles([
10346
+ * '<identity-user-id>',
10347
+ * '<identity-group-id>',
10348
+ * ]);
10349
+ * ```
10350
+ *
10351
+ * @internal
10352
+ */
10353
+ async revokeRoles(principalIds) {
10354
+ const normalizedPrincipalIds = normalizePrincipalIds(principalIds);
10355
+ if (normalizedPrincipalIds.length === 0) {
10356
+ throw new ValidationError({ message: 'At least one principal ID is required.' });
10357
+ }
10358
+ const payload = {
10359
+ externalIds: normalizedPrincipalIds,
10360
+ };
10361
+ await this.post(DATA_FABRIC_ENDPOINTS.DIRECTORY.REVOKE_ROLES, payload);
10362
+ }
10363
+ }
10364
+ __decorate([
10365
+ track('DataFabricDirectory.List')
10366
+ ], DataFabricDirectoryService.prototype, "list", null);
10367
+ __decorate([
10368
+ track('DataFabricDirectory.GetAll')
10369
+ ], DataFabricDirectoryService.prototype, "getAll", null);
10370
+ __decorate([
10371
+ track('DataFabricDirectory.AssignRoles')
10372
+ ], DataFabricDirectoryService.prototype, "assignRoles", null);
10373
+ __decorate([
10374
+ track('DataFabricDirectory.RevokeRoles')
10375
+ ], DataFabricDirectoryService.prototype, "revokeRoles", null);
10376
+
9953
10377
  /**
9954
10378
  * Maps API field names (countOf*) to SDK field names (*Count) for InstanceStats,
9955
10379
  * aligning naming with ElementStats and other count-suffixed conventions.
@@ -10010,6 +10434,16 @@ function createProcessMethods(processData, service) {
10010
10434
  startTime,
10011
10435
  endTime,
10012
10436
  });
10437
+ },
10438
+ getInstanceStatusTimeline(startTime, endTime, options) {
10439
+ if (!processData.processKey)
10440
+ throw new Error('Process key is undefined');
10441
+ return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
10442
+ },
10443
+ getIncidentsTimeline(startTime, endTime, options) {
10444
+ if (!processData.processKey)
10445
+ throw new Error('Process key is undefined');
10446
+ return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [processData.processKey] });
10013
10447
  }
10014
10448
  };
10015
10449
  }
@@ -10026,260 +10460,78 @@ function createProcessWithMethods(processData, service) {
10026
10460
  }
10027
10461
 
10028
10462
  /**
10029
- * Builds the request body for Insights RTM "top" endpoints.
10463
+ * Creates methods for a process instance
10030
10464
  *
10031
- * @param startTime - Start of the time range to query
10032
- * @param endTime - End of the time range to query
10033
- * @param isCaseManagement - Whether to filter for case management processes
10034
- * @param options - Optional filters (packageId, processKey, version)
10035
- * @returns Request body for the Insights RTM endpoint
10036
- * @internal
10465
+ * @param instanceData - The process instance data (response from API)
10466
+ * @param service - The process instance service instance
10467
+ * @returns Object containing process instance methods
10037
10468
  */
10038
- function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
10469
+ function createProcessInstanceMethods(instanceData, service) {
10039
10470
  return {
10040
- commonParams: {
10041
- startTime: startTime.getTime(),
10042
- endTime: endTime.getTime(),
10043
- isCaseManagement,
10044
- ...(options?.packageId ? { packageId: options.packageId } : {}),
10045
- ...(options?.processKey ? { processKey: options.processKey } : {}),
10046
- ...(options?.version ? { version: options.version } : {}),
10471
+ async cancel(options) {
10472
+ if (!instanceData.instanceId)
10473
+ throw new Error('Process instance ID is undefined');
10474
+ if (!instanceData.folderKey)
10475
+ throw new Error('Process instance folder key is undefined');
10476
+ return service.cancel(instanceData.instanceId, instanceData.folderKey, options);
10477
+ },
10478
+ async pause(options) {
10479
+ if (!instanceData.instanceId)
10480
+ throw new Error('Process instance ID is undefined');
10481
+ if (!instanceData.folderKey)
10482
+ throw new Error('Process instance folder key is undefined');
10483
+ return service.pause(instanceData.instanceId, instanceData.folderKey, options);
10484
+ },
10485
+ async resume(options) {
10486
+ if (!instanceData.instanceId)
10487
+ throw new Error('Process instance ID is undefined');
10488
+ if (!instanceData.folderKey)
10489
+ throw new Error('Process instance folder key is undefined');
10490
+ return service.resume(instanceData.instanceId, instanceData.folderKey, options);
10491
+ },
10492
+ async retry(options) {
10493
+ if (!instanceData.instanceId)
10494
+ throw new Error('Process instance ID is undefined');
10495
+ if (!instanceData.folderKey)
10496
+ throw new Error('Process instance folder key is undefined');
10497
+ return service.retry(instanceData.instanceId, instanceData.folderKey, options);
10498
+ },
10499
+ async getIncidents() {
10500
+ if (!instanceData.instanceId)
10501
+ throw new Error('Process instance ID is undefined');
10502
+ if (!instanceData.folderKey)
10503
+ throw new Error('Process instance folder key is undefined');
10504
+ return service.getIncidents(instanceData.instanceId, instanceData.folderKey);
10505
+ },
10506
+ async getExecutionHistory() {
10507
+ if (!instanceData.instanceId)
10508
+ throw new Error('Process instance ID is undefined');
10509
+ if (!instanceData.folderKey)
10510
+ throw new Error('Process instance folder key is undefined');
10511
+ return service.getExecutionHistory(instanceData.instanceId, instanceData.folderKey);
10512
+ },
10513
+ async getBpmn() {
10514
+ if (!instanceData.instanceId)
10515
+ throw new Error('Process instance ID is undefined');
10516
+ if (!instanceData.folderKey)
10517
+ throw new Error('Process instance folder key is undefined');
10518
+ return service.getBpmn(instanceData.instanceId, instanceData.folderKey);
10519
+ },
10520
+ async getVariables(options) {
10521
+ if (!instanceData.instanceId)
10522
+ throw new Error('Process instance ID is undefined');
10523
+ if (!instanceData.folderKey)
10524
+ throw new Error('Process instance folder key is undefined');
10525
+ return service.getVariables(instanceData.instanceId, instanceData.folderKey, options);
10047
10526
  }
10048
10527
  };
10049
10528
  }
10050
10529
  /**
10051
- * Fetches instance status timeline from the Insights API.
10052
- * Shared implementation used by both MaestroProcessesService and CasesService.
10530
+ * Creates an actionable process instance by combining API process instance data with operational methods.
10053
10531
  *
10054
- * @param postFn - Bound post method from a BaseService subclass
10055
- * @param startTime - Start of the time range to query
10056
- * @param endTime - End of the time range to query
10057
- * @param isCaseManagement - Whether to filter for case management processes
10058
- * @param options - Optional settings for time bucketing granularity
10059
- * @returns Promise resolving to an array of instance status timeline entries
10060
- * @internal
10061
- */
10062
- async function fetchInstanceStatusTimeline(postFn, startTime, endTime, isCaseManagement, options) {
10063
- const response = await postFn(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, {
10064
- commonParams: {
10065
- startTime: startTime.getTime(),
10066
- endTime: endTime.getTime(),
10067
- isCaseManagement,
10068
- },
10069
- timeSliceUnit: options?.groupBy,
10070
- timezoneOffset: new Date().getTimezoneOffset() * -1,
10071
- });
10072
- return response.data ?? [];
10073
- }
10074
- /**
10075
- * Builds the commonParams request body for Insights RTM endpoints
10076
- * that filter by process key, package, time range, and version.
10077
- *
10078
- * @param request - Process scope + time range to aggregate over
10079
- * @returns Request body with commonParams
10080
- * @internal
10081
- */
10082
- function buildInsightsCommonBody(request) {
10083
- return {
10084
- commonParams: {
10085
- processKey: request.processKey,
10086
- packageId: request.packageId,
10087
- startTime: request.startTime.getTime(),
10088
- endTime: request.endTime.getTime(),
10089
- version: request.packageVersion
10090
- }
10091
- };
10092
- }
10093
-
10094
- /**
10095
- * Maps fields for Incident entities
10096
- */
10097
- const ProcessIncidentMap = {
10098
- errorTimeUtc: 'errorTime'
10099
- };
10100
- /**
10101
- * Maps fields for Incident Summary entities
10102
- */
10103
- const ProcessIncidentSummaryMap = {
10104
- firstTimeUtc: 'firstOccuranceTime'
10105
- };
10106
-
10107
- /**
10108
- * Helpers for fetching BPMN XML and extracting element details used to annotate responses
10109
- */
10110
- class BpmnHelpers {
10111
- /**
10112
- * Parse BPMN XML and extract element id → {name,type} used for incidents
10113
- */
10114
- static parseBpmnElementsForIncidents(bpmnXml) {
10115
- const elementInfo = {};
10116
- try {
10117
- // Find <bpmn:...> start tags and capture the element type.
10118
- // Then read 'id' and 'name' attributes from each tag.
10119
- const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
10120
- for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
10121
- const [fullTag, elementType] = tagMatch;
10122
- // Extract attributes from the current tag text.
10123
- const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
10124
- if (!idMatch) {
10125
- continue;
10126
- }
10127
- const elementId = idMatch[1];
10128
- const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
10129
- const name = nameMatch ? nameMatch[1] : '';
10130
- // Convert BPMN element type to human-readable format
10131
- const activityType = this.formatActivityTypeForIncidents(elementType);
10132
- const activityName = name || elementId;
10133
- elementInfo[elementId] = {
10134
- type: activityType,
10135
- name: activityName
10136
- };
10137
- }
10138
- }
10139
- catch (error) {
10140
- console.warn('Failed to parse BPMN XML for incidents:', error);
10141
- }
10142
- return elementInfo;
10143
- }
10144
- /**
10145
- * Format BPMN element type to human-readable activity type for incidents
10146
- */
10147
- static formatActivityTypeForIncidents(elementType) {
10148
- // Convert camelCase BPMN element types to human-readable format
10149
- // e.g., "serviceTask" -> "Service Task", "exclusiveGateway" -> "Exclusive Gateway"
10150
- return elementType
10151
- .replace(/([A-Z])/g, ' $1') // Add space before uppercase letters
10152
- .replace(/^./, str => str.toUpperCase()) // Capitalize first letter
10153
- .trim(); // Remove any leading/trailing spaces
10154
- }
10155
- /**
10156
- * Fetch BPMN via getBpmn and add element name/type to each incident
10157
- */
10158
- static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
10159
- // Check if all incidents have the same instanceId
10160
- const uniqueInstanceIds = [...new Set(incidents.map(i => i.instanceId))];
10161
- if (uniqueInstanceIds.length === 1) {
10162
- // Single instance optimization (in case of process instance incidents)
10163
- const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
10164
- return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
10165
- }
10166
- else {
10167
- // Multiple instances optimization (in case of process incidents)
10168
- return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
10169
- }
10170
- }
10171
- /**
10172
- * When incidents span multiple instances, fetch BPMN per instance and annotate
10173
- */
10174
- static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
10175
- const groups = incidents.reduce((acc, incident) => {
10176
- const id = incident.instanceId || NO_INSTANCE;
10177
- (acc[id] = acc[id] || []).push(incident);
10178
- return acc;
10179
- }, {});
10180
- const results = await Promise.all(Object.entries(groups).map(async (entry) => {
10181
- const [instanceId, groupIncidents] = entry;
10182
- const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
10183
- return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
10184
- }));
10185
- return results.flat();
10186
- }
10187
- /**
10188
- * Retrieve BPMN XML for an instance and derive element id → {name,type}
10189
- */
10190
- static async getBpmnElementInfo(instanceId, folderKey, service) {
10191
- if (!instanceId || instanceId === NO_INSTANCE) {
10192
- return {};
10193
- }
10194
- try {
10195
- const bpmnXml = await service.getBpmn(instanceId, folderKey);
10196
- return this.parseBpmnElementsForIncidents(bpmnXml);
10197
- }
10198
- catch (error) {
10199
- console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
10200
- return {};
10201
- }
10202
- }
10203
- /**
10204
- * Transform a raw incident by attaching element name/type from BPMN
10205
- */
10206
- static transformIncidentWithBpmn(incident, elementInfo) {
10207
- const element = elementInfo[incident.elementId];
10208
- const transformed = transformData(incident, ProcessIncidentMap);
10209
- return {
10210
- ...transformed,
10211
- incidentElementActivityType: element?.type || UNKNOWN,
10212
- incidentElementActivityName: element?.name || UNKNOWN
10213
- };
10214
- }
10215
- }
10216
-
10217
- /**
10218
- * Creates methods for a process instance
10219
- *
10220
- * @param instanceData - The process instance data (response from API)
10221
- * @param service - The process instance service instance
10222
- * @returns Object containing process instance methods
10223
- */
10224
- function createProcessInstanceMethods(instanceData, service) {
10225
- return {
10226
- async cancel(options) {
10227
- if (!instanceData.instanceId)
10228
- throw new Error('Process instance ID is undefined');
10229
- if (!instanceData.folderKey)
10230
- throw new Error('Process instance folder key is undefined');
10231
- return service.cancel(instanceData.instanceId, instanceData.folderKey, options);
10232
- },
10233
- async pause(options) {
10234
- if (!instanceData.instanceId)
10235
- throw new Error('Process instance ID is undefined');
10236
- if (!instanceData.folderKey)
10237
- throw new Error('Process instance folder key is undefined');
10238
- return service.pause(instanceData.instanceId, instanceData.folderKey, options);
10239
- },
10240
- async resume(options) {
10241
- if (!instanceData.instanceId)
10242
- throw new Error('Process instance ID is undefined');
10243
- if (!instanceData.folderKey)
10244
- throw new Error('Process instance folder key is undefined');
10245
- return service.resume(instanceData.instanceId, instanceData.folderKey, options);
10246
- },
10247
- async getIncidents() {
10248
- if (!instanceData.instanceId)
10249
- throw new Error('Process instance ID is undefined');
10250
- if (!instanceData.folderKey)
10251
- throw new Error('Process instance folder key is undefined');
10252
- return service.getIncidents(instanceData.instanceId, instanceData.folderKey);
10253
- },
10254
- async getExecutionHistory() {
10255
- if (!instanceData.instanceId)
10256
- throw new Error('Process instance ID is undefined');
10257
- if (!instanceData.folderKey)
10258
- throw new Error('Process instance folder key is undefined');
10259
- return service.getExecutionHistory(instanceData.instanceId, instanceData.folderKey);
10260
- },
10261
- async getBpmn() {
10262
- if (!instanceData.instanceId)
10263
- throw new Error('Process instance ID is undefined');
10264
- if (!instanceData.folderKey)
10265
- throw new Error('Process instance folder key is undefined');
10266
- return service.getBpmn(instanceData.instanceId, instanceData.folderKey);
10267
- },
10268
- async getVariables(options) {
10269
- if (!instanceData.instanceId)
10270
- throw new Error('Process instance ID is undefined');
10271
- if (!instanceData.folderKey)
10272
- throw new Error('Process instance folder key is undefined');
10273
- return service.getVariables(instanceData.instanceId, instanceData.folderKey, options);
10274
- }
10275
- };
10276
- }
10277
- /**
10278
- * Creates an actionable process instance by combining API process instance data with operational methods.
10279
- *
10280
- * @param instanceData - The process instance data from API
10281
- * @param service - The process instance service instance
10282
- * @returns A process instance object with added methods
10532
+ * @param instanceData - The process instance data from API
10533
+ * @param service - The process instance service instance
10534
+ * @returns A process instance object with added methods
10283
10535
  */
10284
10536
  function createProcessInstanceWithMethods(instanceData, service) {
10285
10537
  const methods = createProcessInstanceMethods(instanceData, service);
@@ -10360,6 +10612,16 @@ function createCaseMethods(caseData, service) {
10360
10612
  startTime,
10361
10613
  endTime,
10362
10614
  });
10615
+ },
10616
+ getInstanceStatusTimeline(startTime, endTime, options) {
10617
+ if (!caseData.processKey)
10618
+ throw new Error('Process key is undefined');
10619
+ return service.getInstanceStatusTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
10620
+ },
10621
+ getIncidentsTimeline(startTime, endTime, options) {
10622
+ if (!caseData.processKey)
10623
+ throw new Error('Process key is undefined');
10624
+ return service.getIncidentsTimeline(startTime, endTime, { ...options, processKeys: [caseData.processKey] });
10363
10625
  }
10364
10626
  };
10365
10627
  }
@@ -10561,20 +10823,210 @@ var TimeInterval;
10561
10823
  TimeInterval["Week"] = "WEEK";
10562
10824
  })(TimeInterval || (TimeInterval = {}));
10563
10825
  /**
10564
- * Final instance statuses returned by the instance status timeline endpoint.
10565
- *
10566
- * Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
10567
- * Active statuses like Running or Paused are not included.
10826
+ * Final instance statuses returned by the instance status timeline endpoint.
10827
+ *
10828
+ * Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
10829
+ * Active statuses like Running or Paused are not included.
10830
+ */
10831
+ var InstanceFinalStatus;
10832
+ (function (InstanceFinalStatus) {
10833
+ /** Instance completed successfully */
10834
+ InstanceFinalStatus["Completed"] = "Completed";
10835
+ /** Instance encountered an error */
10836
+ InstanceFinalStatus["Faulted"] = "Faulted";
10837
+ /** Instance was cancelled */
10838
+ InstanceFinalStatus["Cancelled"] = "Cancelled";
10839
+ })(InstanceFinalStatus || (InstanceFinalStatus = {}));
10840
+
10841
+ /**
10842
+ * Builds the request body for Insights RTM "top" endpoints.
10843
+ *
10844
+ * @param startTime - Start of the time range to query
10845
+ * @param endTime - End of the time range to query
10846
+ * @param isCaseManagement - Whether to filter for case management processes
10847
+ * @param options - Optional filters (packageId, processKey, version)
10848
+ * @returns Request body for the Insights RTM endpoint
10849
+ * @internal
10850
+ */
10851
+ function buildInsightsTopBody(startTime, endTime, isCaseManagement, options) {
10852
+ return {
10853
+ commonParams: {
10854
+ startTime: startTime.getTime(),
10855
+ endTime: endTime.getTime(),
10856
+ isCaseManagement,
10857
+ ...(options?.packageId ? { packageId: options.packageId } : {}),
10858
+ ...(options?.processKey ? { processKey: options.processKey } : {}),
10859
+ ...(options?.version ? { version: options.version } : {}),
10860
+ }
10861
+ };
10862
+ }
10863
+ /**
10864
+ * Builds the request body for Insights RTM timeline endpoints
10865
+ * (`InstanceStatusByDate`, `IncidentsByTimeWindow`).
10866
+ *
10867
+ * @param startTime - Start of the time range to query
10868
+ * @param endTime - End of the time range to query
10869
+ * @param isCaseManagement - Whether to filter for case management processes
10870
+ * @param options - Optional time bucketing and filtering settings
10871
+ * @returns Request body for the Insights RTM timeline endpoint
10872
+ * @internal
10873
+ */
10874
+ function buildInsightsTimelineBody(startTime, endTime, isCaseManagement, options) {
10875
+ return {
10876
+ commonParams: {
10877
+ startTime: startTime.getTime(),
10878
+ endTime: endTime.getTime(),
10879
+ isCaseManagement,
10880
+ ...(options?.packageId ? { packageId: options.packageId } : {}),
10881
+ ...(options?.version ? { version: options.version } : {}),
10882
+ ...(options?.processKeys ? { processKeys: options.processKeys } : {}),
10883
+ },
10884
+ timeSliceUnit: options?.groupBy ?? TimeInterval.Day,
10885
+ timezoneOffset: new Date().getTimezoneOffset() * -1,
10886
+ };
10887
+ }
10888
+ /**
10889
+ * Builds the commonParams request body for Insights RTM endpoints
10890
+ * that filter by process key, package, time range, and version.
10891
+ *
10892
+ * @param request - Process scope + time range to aggregate over
10893
+ * @returns Request body with commonParams
10894
+ * @internal
10895
+ */
10896
+ function buildInsightsCommonBody(request) {
10897
+ return {
10898
+ commonParams: {
10899
+ processKey: request.processKey,
10900
+ packageId: request.packageId,
10901
+ startTime: request.startTime.getTime(),
10902
+ endTime: request.endTime.getTime(),
10903
+ version: request.packageVersion
10904
+ }
10905
+ };
10906
+ }
10907
+
10908
+ /**
10909
+ * Maps fields for Incident entities
10910
+ */
10911
+ const ProcessIncidentMap = {
10912
+ errorTimeUtc: 'errorTime'
10913
+ };
10914
+ /**
10915
+ * Maps fields for Incident Summary entities
10568
10916
  */
10569
- var InstanceFinalStatus;
10570
- (function (InstanceFinalStatus) {
10571
- /** Instance completed successfully */
10572
- InstanceFinalStatus["Completed"] = "Completed";
10573
- /** Instance encountered an error */
10574
- InstanceFinalStatus["Faulted"] = "Faulted";
10575
- /** Instance was cancelled */
10576
- InstanceFinalStatus["Cancelled"] = "Cancelled";
10577
- })(InstanceFinalStatus || (InstanceFinalStatus = {}));
10917
+ const ProcessIncidentSummaryMap = {
10918
+ firstTimeUtc: 'firstOccuranceTime'
10919
+ };
10920
+
10921
+ /**
10922
+ * Helpers for fetching BPMN XML and extracting element details used to annotate responses
10923
+ */
10924
+ class BpmnHelpers {
10925
+ /**
10926
+ * Parse BPMN XML and extract element id → {name,type} used for incidents
10927
+ */
10928
+ static parseBpmnElementsForIncidents(bpmnXml) {
10929
+ const elementInfo = {};
10930
+ try {
10931
+ // Find <bpmn:...> start tags and capture the element type.
10932
+ // Then read 'id' and 'name' attributes from each tag.
10933
+ const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
10934
+ for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
10935
+ const [fullTag, elementType] = tagMatch;
10936
+ // Extract attributes from the current tag text.
10937
+ const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
10938
+ if (!idMatch) {
10939
+ continue;
10940
+ }
10941
+ const elementId = idMatch[1];
10942
+ const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
10943
+ const name = nameMatch ? nameMatch[1] : '';
10944
+ // Convert BPMN element type to human-readable format
10945
+ const activityType = this.formatActivityTypeForIncidents(elementType);
10946
+ const activityName = name || elementId;
10947
+ elementInfo[elementId] = {
10948
+ type: activityType,
10949
+ name: activityName
10950
+ };
10951
+ }
10952
+ }
10953
+ catch (error) {
10954
+ console.warn('Failed to parse BPMN XML for incidents:', error);
10955
+ }
10956
+ return elementInfo;
10957
+ }
10958
+ /**
10959
+ * Format BPMN element type to human-readable activity type for incidents
10960
+ */
10961
+ static formatActivityTypeForIncidents(elementType) {
10962
+ // Convert camelCase BPMN element types to human-readable format
10963
+ // e.g., "serviceTask" -> "Service Task", "exclusiveGateway" -> "Exclusive Gateway"
10964
+ return elementType
10965
+ .replace(/([A-Z])/g, ' $1') // Add space before uppercase letters
10966
+ .replace(/^./, str => str.toUpperCase()) // Capitalize first letter
10967
+ .trim(); // Remove any leading/trailing spaces
10968
+ }
10969
+ /**
10970
+ * Fetch BPMN via getBpmn and add element name/type to each incident
10971
+ */
10972
+ static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
10973
+ // Check if all incidents have the same instanceId
10974
+ const uniqueInstanceIds = [...new Set(incidents.map(i => i.instanceId))];
10975
+ if (uniqueInstanceIds.length === 1) {
10976
+ // Single instance optimization (in case of process instance incidents)
10977
+ const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
10978
+ return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
10979
+ }
10980
+ else {
10981
+ // Multiple instances optimization (in case of process incidents)
10982
+ return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
10983
+ }
10984
+ }
10985
+ /**
10986
+ * When incidents span multiple instances, fetch BPMN per instance and annotate
10987
+ */
10988
+ static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
10989
+ const groups = incidents.reduce((acc, incident) => {
10990
+ const id = incident.instanceId || NO_INSTANCE;
10991
+ (acc[id] = acc[id] || []).push(incident);
10992
+ return acc;
10993
+ }, {});
10994
+ const results = await Promise.all(Object.entries(groups).map(async (entry) => {
10995
+ const [instanceId, groupIncidents] = entry;
10996
+ const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
10997
+ return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
10998
+ }));
10999
+ return results.flat();
11000
+ }
11001
+ /**
11002
+ * Retrieve BPMN XML for an instance and derive element id → {name,type}
11003
+ */
11004
+ static async getBpmnElementInfo(instanceId, folderKey, service) {
11005
+ if (!instanceId || instanceId === NO_INSTANCE) {
11006
+ return {};
11007
+ }
11008
+ try {
11009
+ const bpmnXml = await service.getBpmn(instanceId, folderKey);
11010
+ return this.parseBpmnElementsForIncidents(bpmnXml);
11011
+ }
11012
+ catch (error) {
11013
+ console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
11014
+ return {};
11015
+ }
11016
+ }
11017
+ /**
11018
+ * Transform a raw incident by attaching element name/type from BPMN
11019
+ */
11020
+ static transformIncidentWithBpmn(incident, elementInfo) {
11021
+ const element = elementInfo[incident.elementId];
11022
+ const transformed = transformData(incident, ProcessIncidentMap);
11023
+ return {
11024
+ ...transformed,
11025
+ incidentElementActivityType: element?.type || UNKNOWN,
11026
+ incidentElementActivityName: element?.name || UNKNOWN
11027
+ };
11028
+ }
11029
+ }
10578
11030
 
10579
11031
  /**
10580
11032
  * Maps fields for Process Instance entities to ensure consistent naming
@@ -10651,7 +11103,7 @@ class ProcessInstancesService extends BaseService {
10651
11103
  }, options);
10652
11104
  }
10653
11105
  /**
10654
- * Get a process instance by ID with operation methods (cancel, pause, resume)
11106
+ * Get a process instance by ID with operation methods (cancel, pause, resume, retry)
10655
11107
  * @param id The ID of the instance to retrieve
10656
11108
  * @param folderKey The folder key for authorization
10657
11109
  * @returns Promise<ProcessInstanceGetResponse>
@@ -10790,6 +11242,25 @@ class ProcessInstancesService extends BaseService {
10790
11242
  data: response.data
10791
11243
  };
10792
11244
  }
11245
+ /**
11246
+ * Retry a faulted process instance
11247
+ *
11248
+ * Re-runs the failed elements of the instance (and the elements that follow) within
11249
+ * the same instance, spawning new jobs. Use to recover from transient/flaky failures.
11250
+ * @param instanceId The ID of the instance to retry
11251
+ * @param folderKey The folder key for authorization
11252
+ * @param options Optional retry options with comment
11253
+ * @returns Promise resolving to operation result with updated instance data
11254
+ */
11255
+ async retry(instanceId, folderKey, options) {
11256
+ const response = await this.post(MAESTRO_ENDPOINTS.INSTANCES.RETRY(instanceId), options || {}, {
11257
+ headers: createHeaders({ [FOLDER_KEY]: folderKey })
11258
+ });
11259
+ return {
11260
+ success: true,
11261
+ data: response.data
11262
+ };
11263
+ }
10793
11264
  /**
10794
11265
  * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
10795
11266
  * @private
@@ -10940,6 +11411,9 @@ __decorate([
10940
11411
  __decorate([
10941
11412
  track('ProcessInstances.Resume')
10942
11413
  ], ProcessInstancesService.prototype, "resume", null);
11414
+ __decorate([
11415
+ track('ProcessInstances.Retry')
11416
+ ], ProcessInstancesService.prototype, "retry", null);
10943
11417
  __decorate([
10944
11418
  track('ProcessInstances.GetVariables')
10945
11419
  ], ProcessInstancesService.prototype, "getVariables", null);
@@ -11096,7 +11570,7 @@ class MaestroProcessesService extends BaseService {
11096
11570
  *
11097
11571
  * @param startTime - Start of the time range to query
11098
11572
  * @param endTime - End of the time range to query
11099
- * @param options - Optional settings for time bucketing granularity
11573
+ * @param options - Optional settings for filtering and time bucket granularity
11100
11574
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
11101
11575
  *
11102
11576
  * @example
@@ -11123,12 +11597,67 @@ class MaestroProcessesService extends BaseService {
11123
11597
  *
11124
11598
  * @example
11125
11599
  * ```typescript
11600
+ * // Filter to a specific process
11601
+ * const filtered = await maestroProcesses.getInstanceStatusTimeline(startTime, endTime, {
11602
+ * processKeys: ['<processKey>'],
11603
+ * });
11604
+ * ```
11605
+ *
11606
+ * @example
11607
+ * ```typescript
11126
11608
  * // Get all-time data (from Unix epoch to now)
11127
11609
  * const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
11128
11610
  * ```
11129
11611
  */
11130
11612
  async getInstanceStatusTimeline(startTime, endTime, options) {
11131
- return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, false, options);
11613
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, false, options));
11614
+ return data ?? [];
11615
+ }
11616
+ /**
11617
+ * Get incident counts aggregated by time bucket for maestro processes.
11618
+ *
11619
+ * Returns time-grouped counts of incidents that occurred within each bucket,
11620
+ * useful for rendering incident time-series charts. Use `groupBy` to control
11621
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
11622
+ *
11623
+ * @param startTime - Start of the time range to query
11624
+ * @param endTime - End of the time range to query
11625
+ * @param options - Optional settings for filtering and time bucket granularity
11626
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
11627
+ *
11628
+ * @example
11629
+ * ```typescript
11630
+ * // Get daily incident counts for the last 7 days
11631
+ * const now = new Date();
11632
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
11633
+ * const incidents = await maestroProcesses.getIncidentsTimeline(sevenDaysAgo, now);
11634
+ *
11635
+ * for (const incident of incidents) {
11636
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
11637
+ * }
11638
+ * ```
11639
+ *
11640
+ * @example
11641
+ * ```typescript
11642
+ * import { TimeInterval } from '@uipath/uipath-typescript/maestro-processes';
11643
+ *
11644
+ * // Get weekly breakdown
11645
+ * const incidents = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
11646
+ * groupBy: TimeInterval.Week,
11647
+ * });
11648
+ * ```
11649
+ *
11650
+ * @example
11651
+ * ```typescript
11652
+ * // Filter to a specific process
11653
+ * const filtered = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
11654
+ * processKeys: ['<processKey>'],
11655
+ * });
11656
+ * ```
11657
+ */
11658
+ async getIncidentsTimeline(startTime, endTime, options) {
11659
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, false, options));
11660
+ return data?.dataPoints ?? [];
11132
11661
  }
11133
11662
  /**
11134
11663
  * Get the top 10 processes ranked by failure count within a time range.
@@ -11314,6 +11843,9 @@ __decorate([
11314
11843
  __decorate([
11315
11844
  track('MaestroProcesses.GetInstanceStatusTimeline')
11316
11845
  ], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
11846
+ __decorate([
11847
+ track('MaestroProcesses.GetIncidentsTimeline')
11848
+ ], MaestroProcessesService.prototype, "getIncidentsTimeline", null);
11317
11849
  __decorate([
11318
11850
  track('MaestroProcesses.GetTopFaultedCount')
11319
11851
  ], MaestroProcessesService.prototype, "getTopFaultedCount", null);
@@ -11506,7 +12038,7 @@ class CasesService extends BaseService {
11506
12038
  *
11507
12039
  * @param startTime - Start of the time range to query
11508
12040
  * @param endTime - End of the time range to query
11509
- * @param options - Optional settings for time bucketing granularity
12041
+ * @param options - Optional settings for filtering and time bucket granularity
11510
12042
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
11511
12043
  *
11512
12044
  * @example
@@ -11533,12 +12065,67 @@ class CasesService extends BaseService {
11533
12065
  *
11534
12066
  * @example
11535
12067
  * ```typescript
12068
+ * // Filter to a specific case process
12069
+ * const filtered = await cases.getInstanceStatusTimeline(startTime, endTime, {
12070
+ * processKeys: ['<processKey>'],
12071
+ * });
12072
+ * ```
12073
+ *
12074
+ * @example
12075
+ * ```typescript
11536
12076
  * // Get all-time data (from Unix epoch to now)
11537
12077
  * const allTime = await cases.getInstanceStatusTimeline(new Date(0), new Date());
11538
12078
  * ```
11539
12079
  */
11540
12080
  async getInstanceStatusTimeline(startTime, endTime, options) {
11541
- return fetchInstanceStatusTimeline(this.post.bind(this), startTime, endTime, true, options);
12081
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, buildInsightsTimelineBody(startTime, endTime, true, options));
12082
+ return data ?? [];
12083
+ }
12084
+ /**
12085
+ * Get incident counts aggregated by time bucket for case management processes.
12086
+ *
12087
+ * Returns time-grouped counts of incidents that occurred within each bucket,
12088
+ * useful for rendering incident time-series charts. Use `groupBy` to control
12089
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
12090
+ *
12091
+ * @param startTime - Start of the time range to query
12092
+ * @param endTime - End of the time range to query
12093
+ * @param options - Optional settings for filtering and time bucket granularity
12094
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
12095
+ *
12096
+ * @example
12097
+ * ```typescript
12098
+ * // Get daily incident counts for the last 7 days
12099
+ * const now = new Date();
12100
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
12101
+ * const incidents = await cases.getIncidentsTimeline(sevenDaysAgo, now);
12102
+ *
12103
+ * for (const incident of incidents) {
12104
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
12105
+ * }
12106
+ * ```
12107
+ *
12108
+ * @example
12109
+ * ```typescript
12110
+ * import { TimeInterval } from '@uipath/uipath-typescript/cases';
12111
+ *
12112
+ * // Get weekly breakdown
12113
+ * const incidents = await cases.getIncidentsTimeline(startTime, endTime, {
12114
+ * groupBy: TimeInterval.Week,
12115
+ * });
12116
+ * ```
12117
+ *
12118
+ * @example
12119
+ * ```typescript
12120
+ * // Filter to a specific case process
12121
+ * const filtered = await cases.getIncidentsTimeline(startTime, endTime, {
12122
+ * processKeys: ['<processKey>'],
12123
+ * });
12124
+ * ```
12125
+ */
12126
+ async getIncidentsTimeline(startTime, endTime, options) {
12127
+ const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INCIDENTS_BY_TIME_WINDOW, buildInsightsTimelineBody(startTime, endTime, true, options));
12128
+ return data?.dataPoints ?? [];
11542
12129
  }
11543
12130
  /**
11544
12131
  * Get the top 10 case processes ranked by failure count within a time range.
@@ -11737,6 +12324,9 @@ __decorate([
11737
12324
  __decorate([
11738
12325
  track('Cases.GetInstanceStatusTimeline')
11739
12326
  ], CasesService.prototype, "getInstanceStatusTimeline", null);
12327
+ __decorate([
12328
+ track('Cases.GetIncidentsTimeline')
12329
+ ], CasesService.prototype, "getIncidentsTimeline", null);
11740
12330
  __decorate([
11741
12331
  track('Cases.GetTopFaultedCount')
11742
12332
  ], CasesService.prototype, "getTopFaultedCount", null);
@@ -12054,6 +12644,10 @@ class TaskService extends BaseService {
12054
12644
  const transformedTask = transformData(pascalToCamelCaseKeys(task), TaskMap);
12055
12645
  return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
12056
12646
  };
12647
+ // Rewrite renamed SDK field names → API names inside OData strings
12648
+ // before delegating, mirroring the transformRequest pattern used for
12649
+ // request bodies.
12650
+ const apiOptions = options ? transformOptions(options, TaskMap) : options;
12057
12651
  return PaginationHelpers.getAll({
12058
12652
  serviceAccess: this.createPaginationServiceAccess(),
12059
12653
  getEndpoint: () => endpoint,
@@ -12070,7 +12664,7 @@ class TaskService extends BaseService {
12070
12664
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM // OData OFFSET parameter
12071
12665
  }
12072
12666
  }
12073
- }, options);
12667
+ }, apiOptions);
12074
12668
  }
12075
12669
  /**
12076
12670
  * Gets a task by ID
@@ -12106,9 +12700,10 @@ class TaskService extends BaseService {
12106
12700
  const headers = createHeaders({ [FOLDER_ID]: folderId });
12107
12701
  // Add default expand parameters
12108
12702
  const modifiedOptions = this.addDefaultExpand(restOptions);
12109
- // prefix all keys in options
12110
- const keysToPrefix = Object.keys(modifiedOptions);
12111
- const apiOptions = addPrefixToKeys(modifiedOptions, ODATA_PREFIX, keysToPrefix);
12703
+ // Rewrite renamed SDK field names → API names inside OData strings,
12704
+ // then prefix all keys for OData.
12705
+ const apiFieldOptions = transformOptions(modifiedOptions, TaskMap);
12706
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
12112
12707
  const response = await this.get(TASK_ENDPOINTS.GET_BY_ID(id), {
12113
12708
  params: apiOptions,
12114
12709
  headers
@@ -13101,9 +13696,12 @@ class FolderScopedService extends BaseService {
13101
13696
  * @param name - Resource name to search for
13102
13697
  * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) + OData query options (`expand`, `select`)
13103
13698
  * @param transform - Maps a raw OData item to the typed response (e.g. PascalCase → camelCase via field map)
13699
+ * @param responseFieldMap - Optional response field map (API → SDK), reversed internally by
13700
+ * `transformOptions` to rewrite SDK field names back to API names in user-supplied
13701
+ * `expand` / `select` (symmetric counterpart to `transform`)
13104
13702
  * @throws ValidationError when inputs are malformed; NotFoundError when no match
13105
13703
  */
13106
- async getByNameLookup(resourceType, endpoint, name, options, transform) {
13704
+ async getByNameLookup(resourceType, endpoint, name, options, transform, responseFieldMap) {
13107
13705
  const validatedName = validateName(resourceType, name);
13108
13706
  const { folderId, folderKey, folderPath, ...queryOptions } = options;
13109
13707
  const headers = resolveFolderHeaders({
@@ -13113,8 +13711,11 @@ class FolderScopedService extends BaseService {
13113
13711
  resourceType: `${resourceType}.getByName`,
13114
13712
  fallbackFolderKey: this.config.folderKey,
13115
13713
  });
13714
+ const apiFieldOptions = responseFieldMap
13715
+ ? transformOptions(queryOptions, responseFieldMap)
13716
+ : queryOptions;
13116
13717
  const apiOptions = {
13117
- ...addPrefixToKeys(queryOptions, ODATA_PREFIX, Object.keys(queryOptions)),
13718
+ ...addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions)),
13118
13719
  '$filter': `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
13119
13720
  '$top': '1',
13120
13721
  };
@@ -13214,6 +13815,10 @@ class AssetService extends FolderScopedService {
13214
13815
  async getAll(options) {
13215
13816
  // Transformation function for assets
13216
13817
  const transformAssetResponse = (asset) => transformData(pascalToCamelCaseKeys(asset), AssetMap);
13818
+ // Rewrite renamed SDK field names → API names inside OData strings
13819
+ // before delegating, mirroring the transformRequest pattern used for
13820
+ // request bodies.
13821
+ const apiOptions = options ? transformOptions(options, AssetMap) : options;
13217
13822
  return PaginationHelpers.getAll({
13218
13823
  serviceAccess: this.createPaginationServiceAccess(),
13219
13824
  getEndpoint: (folderId) => folderId ? ASSET_ENDPOINTS.GET_BY_FOLDER : ASSET_ENDPOINTS.GET_ALL,
@@ -13229,7 +13834,7 @@ class AssetService extends FolderScopedService {
13229
13834
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
13230
13835
  }
13231
13836
  }
13232
- }, options);
13837
+ }, apiOptions);
13233
13838
  }
13234
13839
  /**
13235
13840
  * Gets a single asset by ID
@@ -13251,8 +13856,8 @@ class AssetService extends FolderScopedService {
13251
13856
  */
13252
13857
  async getById(id, folderId, options = {}) {
13253
13858
  const headers = createHeaders({ [FOLDER_ID]: folderId });
13254
- const keysToPrefix = Object.keys(options);
13255
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
13859
+ const apiFieldOptions = transformOptions(options, AssetMap);
13860
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
13256
13861
  const response = await this.get(ASSET_ENDPOINTS.GET_BY_ID(id), {
13257
13862
  headers,
13258
13863
  params: apiOptions
@@ -13287,7 +13892,7 @@ class AssetService extends FolderScopedService {
13287
13892
  * ```
13288
13893
  */
13289
13894
  async getByName(name, options = {}) {
13290
- return this.getByNameLookup('Asset', ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap));
13895
+ return this.getByNameLookup('Asset', ASSET_ENDPOINTS.GET_BY_FOLDER, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), AssetMap), AssetMap);
13291
13896
  }
13292
13897
  /**
13293
13898
  * Updates the value of an existing asset by ID.
@@ -13561,6 +14166,9 @@ class BucketService extends FolderScopedService {
13561
14166
  });
13562
14167
  // Transformation function for blob items
13563
14168
  const transformBlobItem = (item) => transformData(item, BucketMap);
14169
+ // Rewrite renamed SDK field names → API names inside OData strings
14170
+ // before delegating.
14171
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
13564
14172
  return PaginationHelpers.getAll({
13565
14173
  serviceAccess: this.createPaginationServiceAccess(),
13566
14174
  getEndpoint: () => BUCKET_ENDPOINTS.GET_FILE_META_DATA(bucketId),
@@ -13576,7 +14184,7 @@ class BucketService extends FolderScopedService {
13576
14184
  },
13577
14185
  excludeFromPrefix: ['prefix'], // Bucket-specific param, not OData
13578
14186
  headers,
13579
- }, restOptions);
14187
+ }, apiRestOptions);
13580
14188
  }
13581
14189
  async uploadFile(bucketIdOrOptions, path, content, options) {
13582
14190
  // Normalize the two overload forms into a single internal shape.
@@ -13660,9 +14268,10 @@ class BucketService extends FolderScopedService {
13660
14268
  resourceType: 'Buckets.getReadUri',
13661
14269
  fallbackFolderKey: this.config.folderKey,
13662
14270
  });
14271
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
13663
14272
  const queryOptions = {
13664
14273
  expiryInMinutes,
13665
- ...addPrefixToKeys(restOptions, ODATA_PREFIX, Object.keys(restOptions))
14274
+ ...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
13666
14275
  };
13667
14276
  return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, resolvedPath, headers, queryOptions);
13668
14277
  }
@@ -13782,6 +14391,9 @@ class BucketService extends FolderScopedService {
13782
14391
  fallbackFolderKey: this.config.folderKey,
13783
14392
  });
13784
14393
  const transformBucketFile = (file) => transformData(pascalToCamelCaseKeys(file), BucketMap);
14394
+ // Rewrite renamed SDK field names → API names inside OData strings
14395
+ // before delegating.
14396
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
13785
14397
  return PaginationHelpers.getAll({
13786
14398
  serviceAccess: this.createPaginationServiceAccess(),
13787
14399
  getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
@@ -13798,7 +14410,7 @@ class BucketService extends FolderScopedService {
13798
14410
  },
13799
14411
  excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
13800
14412
  headers,
13801
- }, { ...restOptions, directory: '/', recursive: true });
14413
+ }, { ...apiRestOptions, directory: '/', recursive: true });
13802
14414
  }
13803
14415
  /**
13804
14416
  * Deletes a file from a bucket
@@ -13845,9 +14457,10 @@ class BucketService extends FolderScopedService {
13845
14457
  */
13846
14458
  async _getWriteUri(options) {
13847
14459
  const { bucketId, path, expiryInMinutes, headers, ...restOptions } = options;
14460
+ const apiRestOptions = transformOptions(restOptions, BucketMap);
13848
14461
  const queryOptions = {
13849
14462
  expiryInMinutes,
13850
- ...addPrefixToKeys(restOptions, ODATA_PREFIX, Object.keys(restOptions))
14463
+ ...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
13851
14464
  };
13852
14465
  return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, path, headers, queryOptions);
13853
14466
  }
@@ -13980,9 +14593,10 @@ class AttachmentService extends BaseService {
13980
14593
  if (!id) {
13981
14594
  throw new ValidationError({ message: 'id is required for getById' });
13982
14595
  }
13983
- // Prefix all keys in options with $ for OData
13984
- const keysToPrefix = Object.keys(options);
13985
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
14596
+ // Response applies both maps (BucketMap on blobFileAccess, AttachmentsMap on top-level);
14597
+ // merge so SDK names from either are rewritten in one pass.
14598
+ const apiFieldOptions = transformOptions(options, { ...AttachmentsMap, ...BucketMap });
14599
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
13986
14600
  const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
13987
14601
  params: apiOptions,
13988
14602
  });
@@ -14664,6 +15278,10 @@ class ProcessService extends FolderScopedService {
14664
15278
  async getAll(options) {
14665
15279
  // Transformation function for processes
14666
15280
  const transformProcessResponse = (process) => transformData(pascalToCamelCaseKeys(process), ProcessMap);
15281
+ // Rewrite renamed SDK field names → API names inside OData strings
15282
+ // before delegating, mirroring the transformRequest pattern used for
15283
+ // request bodies.
15284
+ const apiOptions = options ? transformOptions(options, ProcessMap) : options;
14667
15285
  return PaginationHelpers.getAll({
14668
15286
  serviceAccess: this.createPaginationServiceAccess(),
14669
15287
  getEndpoint: () => PROCESS_ENDPOINTS.GET_ALL,
@@ -14679,7 +15297,7 @@ class ProcessService extends FolderScopedService {
14679
15297
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
14680
15298
  }
14681
15299
  }
14682
- }, options);
15300
+ }, apiOptions);
14683
15301
  }
14684
15302
  async start(request, optionsOrFolderId, legacyOptions) {
14685
15303
  // Normalize the two overload forms into a single internal shape.
@@ -14713,9 +15331,10 @@ class ProcessService extends FolderScopedService {
14713
15331
  const requestBody = {
14714
15332
  startInfo: apiRequest
14715
15333
  };
14716
- // Prefix all query parameter keys with '$' for OData
14717
- const keysToPrefix = Object.keys(queryOptions);
14718
- const apiOptions = addPrefixToKeys(queryOptions, ODATA_PREFIX, keysToPrefix);
15334
+ // Rewrite renamed SDK field names API names inside OData strings,
15335
+ // then prefix all query parameter keys with '$' for OData.
15336
+ const apiFieldOptions = transformOptions(queryOptions, ProcessMap);
15337
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
14719
15338
  const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
14720
15339
  params: apiOptions,
14721
15340
  headers
@@ -14743,8 +15362,8 @@ class ProcessService extends FolderScopedService {
14743
15362
  */
14744
15363
  async getById(id, folderId, options = {}) {
14745
15364
  const headers = createHeaders({ [FOLDER_ID]: folderId });
14746
- const keysToPrefix = Object.keys(options);
14747
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
15365
+ const apiFieldOptions = transformOptions(options, ProcessMap);
15366
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
14748
15367
  const response = await this.get(PROCESS_ENDPOINTS.GET_BY_ID(id), {
14749
15368
  headers,
14750
15369
  params: apiOptions
@@ -14779,7 +15398,7 @@ class ProcessService extends FolderScopedService {
14779
15398
  * ```
14780
15399
  */
14781
15400
  async getByName(name, options = {}) {
14782
- return this.getByNameLookup('Process', PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap));
15401
+ return this.getByNameLookup('Process', PROCESS_ENDPOINTS.GET_ALL, name, options, (raw) => transformData(pascalToCamelCaseKeys(raw), ProcessMap), ProcessMap);
14783
15402
  }
14784
15403
  }
14785
15404
  __decorate([
@@ -14855,6 +15474,10 @@ class QueueService extends FolderScopedService {
14855
15474
  async getAll(options) {
14856
15475
  // Transformation function for queues
14857
15476
  const transformQueueResponse = (queue) => transformData(pascalToCamelCaseKeys(queue), QueueMap);
15477
+ // Rewrite renamed SDK field names → API names inside OData strings
15478
+ // before delegating, mirroring the transformRequest pattern used for
15479
+ // request bodies.
15480
+ const apiOptions = options ? transformOptions(options, QueueMap) : options;
14858
15481
  return PaginationHelpers.getAll({
14859
15482
  serviceAccess: this.createPaginationServiceAccess(),
14860
15483
  getEndpoint: (folderId) => folderId ? QUEUE_ENDPOINTS.GET_BY_FOLDER : QUEUE_ENDPOINTS.GET_ALL,
@@ -14870,7 +15493,7 @@ class QueueService extends FolderScopedService {
14870
15493
  countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
14871
15494
  }
14872
15495
  }
14873
- }, options);
15496
+ }, apiOptions);
14874
15497
  }
14875
15498
  /**
14876
15499
  * Gets a single queue by ID
@@ -14891,8 +15514,8 @@ class QueueService extends FolderScopedService {
14891
15514
  */
14892
15515
  async getById(id, folderId, options = {}) {
14893
15516
  const headers = createHeaders({ [FOLDER_ID]: folderId });
14894
- const keysToPrefix = Object.keys(options);
14895
- const apiOptions = addPrefixToKeys(options, ODATA_PREFIX, keysToPrefix);
15517
+ const apiFieldOptions = transformOptions(options, QueueMap);
15518
+ const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
14896
15519
  const response = await this.get(QUEUE_ENDPOINTS.GET_BY_ID(id), {
14897
15520
  headers,
14898
15521
  params: apiOptions
@@ -14987,7 +15610,19 @@ class UiPath extends UiPath$1 {
14987
15610
  /**
14988
15611
  * Access to ChoiceSet service for managing choice sets
14989
15612
  */
14990
- choicesets: this.getService(ChoiceSetService)
15613
+ choicesets: this.getService(ChoiceSetService),
15614
+ /**
15615
+ * Access to Data Fabric roles for manage-access flows
15616
+ *
15617
+ * @internal
15618
+ */
15619
+ roles: this.getService(DataFabricRoleService),
15620
+ /**
15621
+ * Access to Data Fabric directory principals and role assignments
15622
+ *
15623
+ * @internal
15624
+ */
15625
+ directory: this.getService(DataFabricDirectoryService)
14991
15626
  });
14992
15627
  }
14993
15628
  /**
@@ -15747,6 +16382,52 @@ var SpanAttachmentDirection;
15747
16382
  SpanAttachmentDirection["Out"] = "Out";
15748
16383
  })(SpanAttachmentDirection || (SpanAttachmentDirection = {}));
15749
16384
 
16385
+ // ─── Governance ─────────────────────────────────────────────────────
16386
+ /**
16387
+ * Evaluation mode of a governance decision.
16388
+ */
16389
+ var AgentGovernanceMode;
16390
+ (function (AgentGovernanceMode) {
16391
+ /** Policy evaluated and logged, but not enforced. */
16392
+ AgentGovernanceMode["Audit"] = "AUDIT";
16393
+ /** Policy evaluated and enforced. */
16394
+ AgentGovernanceMode["Enforce"] = "ENFORCE";
16395
+ /** Unrecognized or missing mode. */
16396
+ AgentGovernanceMode["Unknown"] = "Unknown";
16397
+ })(AgentGovernanceMode || (AgentGovernanceMode = {}));
16398
+ /**
16399
+ * Verdict of a governance decision (`Deny` = violation).
16400
+ */
16401
+ var AgentGovernanceVerdict;
16402
+ (function (AgentGovernanceVerdict) {
16403
+ /** Allowed — not a violation. */
16404
+ AgentGovernanceVerdict["Allow"] = "ALLOW";
16405
+ /** Denied — counts as a violation. */
16406
+ AgentGovernanceVerdict["Deny"] = "DENY";
16407
+ /** Unrecognized or missing verdict. */
16408
+ AgentGovernanceVerdict["Unknown"] = "Unknown";
16409
+ })(AgentGovernanceVerdict || (AgentGovernanceVerdict = {}));
16410
+ /**
16411
+ * Sections the governance summary can compute. `action` and `mode` are opt-in.
16412
+ */
16413
+ var AgentGovernanceSection;
16414
+ (function (AgentGovernanceSection) {
16415
+ /** Scalar totals (`total`, `violations`). */
16416
+ AgentGovernanceSection["Totals"] = "totals";
16417
+ /** Breakdown by governance hook. */
16418
+ AgentGovernanceSection["Hook"] = "hook";
16419
+ /** Breakdown by agent. */
16420
+ AgentGovernanceSection["Agent"] = "agent";
16421
+ /** Breakdown by policy. */
16422
+ AgentGovernanceSection["Policy"] = "policy";
16423
+ /** Breakdown by governance pack. */
16424
+ AgentGovernanceSection["Pack"] = "pack";
16425
+ /** Breakdown by enforcement action (opt-in). */
16426
+ AgentGovernanceSection["Action"] = "action";
16427
+ /** Breakdown by evaluation mode (opt-in). */
16428
+ AgentGovernanceSection["Mode"] = "mode";
16429
+ })(AgentGovernanceSection || (AgentGovernanceSection = {}));
16430
+
15750
16431
  /**
15751
16432
  * Asset resolution utilities for UiPath Coded Apps
15752
16433
  *
@@ -15822,4 +16503,4 @@ function getAppBase() {
15822
16503
  return getMetaTagContent(UiPathMetaTags.APP_BASE) || '/';
15823
16504
  }
15824
16505
 
15825
- export { AgentErrorSortColumn, AgentExecutionType, AgentListSortColumn, AgentMap, AgentMemoryExecutionType, SpanExecutionType as AgentTraceExecutionType, AgentType, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CitationErrorType, ConversationGetAllFilterMap, ConversationMap, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, index as DuFramework, EntityAggregateFunction, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, ExchangeMap, FeedbackRating, FeedbackStatus, FieldDisplayType, HttpStatus, InputStreamSpeechSensitivity, InstanceFinalStatus, InstanceStatus, InterruptType, JobPriority, JobSourceType, JobState, JobSubState, JobType, JoinType, LogicalOperator$1 as LogicalOperator, MAX_PAGE_SIZE, MessageMap, MessageRole, NetworkError, NotFoundError, PackageSourceType, PackageType, PolicyEvaluationResult, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, QueryFilterOperator, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, RuntimeType, SLADurationUnit, ServerError, ServerlessJobType, SlaSummaryStatus, SortOrder, SpanAttachmentDirection, SpanAttachmentProvider, SpanExecutionType, SpanPermissionStatus, SpanSource, SpanStatus, SpanVerbosityLevel, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskAssignmentCriteria, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TimeInterval, UiPath, UiPathError, UiPathMetaTags, UserSettingsMap, ValidationError, createAgentWithMethods, createCaseInstanceWithMethods, createCaseWithMethods, createConversationWithMethods, createEntityWithMethods, createJobWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getAppBase, getAsset, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, loadFromMetaTags, telemetryClient, track, trackEvent };
16506
+ export { AgentErrorSortColumn, AgentExecutionType, AgentGovernanceMode, AgentGovernanceSection, AgentGovernanceVerdict, AgentListSortColumn, AgentMap, AgentMemoryExecutionType, SpanExecutionType as AgentTraceExecutionType, AgentType, AssetValueScope, AssetValueType, AuthenticationError, AuthorizationError, BucketOptions, CitationErrorType, ConversationGetAllFilterMap, ConversationMap, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, DataDirectionType, DebugMode, index as DuFramework, EntityAggregateFunction, EntityFieldDataType, EntityType, ErrorType, EscalationActionType, EscalationRecipientScope, EscalationTriggerType, ExchangeMap, FeedbackRating, FeedbackStatus, FieldDisplayType, HttpStatus, InputStreamSpeechSensitivity, InstanceFinalStatus, InstanceStatus, InterruptType, JobPriority, JobSourceType, JobState, JobSubState, JobType, JoinType, LogicalOperator$1 as LogicalOperator, MAX_PAGE_SIZE, MessageMap, MessageRole, NetworkError, NotFoundError, PackageSourceType, PackageType, PolicyEvaluationResult, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, QueryFilterOperator, RateLimitError, ReferenceType, RemoteControlAccess, RobotSize, RuntimeType, SLADurationUnit, ServerError, ServerlessJobType, SlaSummaryStatus, SortOrder, SpanAttachmentDirection, SpanAttachmentProvider, SpanExecutionType, SpanPermissionStatus, SpanSource, SpanStatus, SpanVerbosityLevel, StageTaskType, StartStrategy, StopStrategy, TargetFramework, TaskActivityType, TaskAssignmentCriteria, TaskPriority, TaskSlaCriteria, TaskSlaStatus, TaskSourceName, TaskStatus, TaskType, TaskUserType, TimeInterval, UiPath, UiPathError, UiPathMetaTags, UserSettingsMap, ValidationError, createAgentWithMethods, createCaseInstanceWithMethods, createCaseWithMethods, createConversationWithMethods, createEntityWithMethods, createJobWithMethods, createProcessInstanceWithMethods, createProcessWithMethods, createTaskWithMethods, getAppBase, getAsset, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, loadFromMetaTags, telemetryClient, track, trackEvent };