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