@uipath/uipath-typescript 1.4.2 → 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/agent-memory/index.d.ts +4 -1
- package/dist/agents/index.cjs +341 -6
- package/dist/agents/index.d.ts +717 -16
- package/dist/agents/index.mjs +342 -7
- package/dist/assets/index.cjs +132 -15
- package/dist/assets/index.d.ts +12 -1
- package/dist/assets/index.mjs +132 -15
- package/dist/attachments/index.cjs +120 -12
- package/dist/attachments/index.mjs +120 -12
- package/dist/buckets/index.cjs +136 -15
- package/dist/buckets/index.d.ts +12 -1
- package/dist/buckets/index.mjs +136 -15
- package/dist/cases/index.cjs +1203 -938
- package/dist/cases/index.d.ts +325 -45
- package/dist/cases/index.mjs +1203 -938
- package/dist/conversational-agent/index.cjs +48 -10
- package/dist/conversational-agent/index.d.ts +117 -6
- package/dist/conversational-agent/index.mjs +48 -10
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +448 -9
- package/dist/entities/index.d.ts +441 -1
- package/dist/entities/index.mjs +447 -10
- package/dist/feedback/index.cjs +25 -9
- package/dist/feedback/index.mjs +25 -9
- package/dist/index.cjs +1281 -330
- package/dist/index.d.ts +1988 -143
- package/dist/index.mjs +1282 -331
- package/dist/index.umd.js +1230 -279
- package/dist/jobs/index.cjs +141 -19
- package/dist/jobs/index.d.ts +22 -6
- package/dist/jobs/index.mjs +141 -19
- package/dist/maestro-processes/index.cjs +553 -354
- package/dist/maestro-processes/index.d.ts +376 -47
- package/dist/maestro-processes/index.mjs +553 -354
- 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 +118 -18
- package/dist/processes/index.d.ts +18 -2
- package/dist/processes/index.mjs +118 -18
- package/dist/queues/index.cjs +131 -14
- package/dist/queues/index.d.ts +12 -1
- package/dist/queues/index.mjs +131 -14
- package/dist/tasks/index.cjs +125 -13
- package/dist/tasks/index.d.ts +4 -1
- package/dist/tasks/index.mjs +125 -13
- package/dist/traces/index.cjs +220 -6
- package/dist/traces/index.d.ts +360 -25
- package/dist/traces/index.mjs +221 -7
- 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`,
|
|
@@ -4652,8 +4653,12 @@ const MAESTRO_ENDPOINTS = {
|
|
|
4652
4653
|
INSTANCE_STATUS_BY_DATE: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceStatusByDate`,
|
|
4653
4654
|
/** Top processes ranked by total duration */
|
|
4654
4655
|
TOP_PROCESSES_BY_DURATION: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/TopProcessesByDuration`,
|
|
4656
|
+
/** Instance stats (counts by status + duration percentiles) */
|
|
4657
|
+
INSTANCE_COUNT_BY_STATUS: `${INSIGHTS_RTM_BASE}/agenticInstanceStatus/InstanceCountByStatus`,
|
|
4655
4658
|
/** Element count by status for agentic instances (process and case) */
|
|
4656
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`,
|
|
4657
4662
|
},
|
|
4658
4663
|
};
|
|
4659
4664
|
|
|
@@ -4703,6 +4708,14 @@ const DATA_FABRIC_ENDPOINTS = {
|
|
|
4703
4708
|
UPDATE_BY_NAME: (choiceSetName, valueId) => `${DATAFABRIC_BASE}/api/EntityService/${choiceSetName}/choiceset/${valueId}/update`,
|
|
4704
4709
|
DELETE_BY_ID: (choiceSetId) => `${DATAFABRIC_BASE}/api/EntityService/entity/${choiceSetId}/choiceset/delete`,
|
|
4705
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
|
+
},
|
|
4706
4719
|
};
|
|
4707
4720
|
|
|
4708
4721
|
/**
|
|
@@ -5013,7 +5026,7 @@ class EmbeddedTokenManager {
|
|
|
5013
5026
|
* SDK's public API.
|
|
5014
5027
|
*/
|
|
5015
5028
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
5016
|
-
const SDK_VERSION = '1.
|
|
5029
|
+
const SDK_VERSION = '1.5.1';
|
|
5017
5030
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
5018
5031
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
5019
5032
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
|
@@ -6980,7 +6993,16 @@ function toISOUtc(value) {
|
|
|
6980
6993
|
return isNaN(date.getTime()) ? value : date.toISOString();
|
|
6981
6994
|
}
|
|
6982
6995
|
/**
|
|
6983
|
-
* Transforms data by
|
|
6996
|
+
* Transforms data by renaming each key in `data` exactly once, using the
|
|
6997
|
+
* mapping (`sourceField → targetField`). Keys not present in the mapping
|
|
6998
|
+
* pass through unchanged. The original (pre-rename) key is dropped — the
|
|
6999
|
+
* result contains only the renamed key.
|
|
7000
|
+
*
|
|
7001
|
+
* Each rename is independent. If the mapping happens to contain chained
|
|
7002
|
+
* entries (`a → b` and `b → c`), they do NOT compose: a field named `a`
|
|
7003
|
+
* in `data` becomes `b` (not `c`), because the renames are applied based
|
|
7004
|
+
* on the original data's keys, not the running result.
|
|
7005
|
+
*
|
|
6984
7006
|
* @param data The source data to transform
|
|
6985
7007
|
* @param fieldMapping Object mapping source field names to target field names
|
|
6986
7008
|
* @returns Transformed data with mapped field names
|
|
@@ -7003,21 +7025,28 @@ function toISOUtc(value) {
|
|
|
7003
7025
|
* // { userId: '123', name: 'john' },
|
|
7004
7026
|
* // { userId: '456', name: 'jane' }
|
|
7005
7027
|
* // ]
|
|
7028
|
+
*
|
|
7029
|
+
* // No chaining — `a → b` does not become `a → c` even if the map has `b → c`.
|
|
7030
|
+
* transformData({ a: 1 }, { a: 'b', b: 'c' });
|
|
7031
|
+
* // result = { b: 1 }
|
|
7006
7032
|
* ```
|
|
7007
7033
|
*/
|
|
7008
7034
|
function transformData(data, fieldMapping) {
|
|
7035
|
+
// Pass null/undefined through unchanged — callers (e.g. AttachmentService.getById)
|
|
7036
|
+
// may invoke this on optional fields that an OData `select` excluded.
|
|
7037
|
+
if (data == null) {
|
|
7038
|
+
return data;
|
|
7039
|
+
}
|
|
7009
7040
|
// Handle array of objects
|
|
7010
7041
|
if (Array.isArray(data)) {
|
|
7011
7042
|
return data.map(item => transformData(item, fieldMapping));
|
|
7012
7043
|
}
|
|
7013
|
-
//
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
result[targetField] = value;
|
|
7020
|
-
}
|
|
7044
|
+
// Walk the ORIGINAL data's keys, look up each in the mapping. One rename
|
|
7045
|
+
// per data key — no mutation of an in-progress result, so chains can't form.
|
|
7046
|
+
const result = {};
|
|
7047
|
+
for (const [key, value] of Object.entries(data)) {
|
|
7048
|
+
const renamedKey = fieldMapping[key] ?? key;
|
|
7049
|
+
result[renamedKey] = value;
|
|
7021
7050
|
}
|
|
7022
7051
|
return result;
|
|
7023
7052
|
}
|
|
@@ -7295,6 +7324,79 @@ function transformRequest(data, responseMap) {
|
|
|
7295
7324
|
}
|
|
7296
7325
|
return result;
|
|
7297
7326
|
}
|
|
7327
|
+
/**
|
|
7328
|
+
* OData query-string keys whose values may contain field identifiers that
|
|
7329
|
+
* need rewriting from SDK names → API names.
|
|
7330
|
+
*/
|
|
7331
|
+
const ODATA_FIELD_PARAM_KEYS = ['filter', 'orderby', 'select', 'expand'];
|
|
7332
|
+
/**
|
|
7333
|
+
* Matches one token at a time in an OData expression:
|
|
7334
|
+
* 1. A single-quoted string literal, allowing the `''` escape sequence —
|
|
7335
|
+
* consumed atomically so identifiers inside the literal can't match.
|
|
7336
|
+
* 2. An OData identifier (`[A-Za-z_][A-Za-z0-9_]*`).
|
|
7337
|
+
* Anything else (whitespace, operators, parens, commas) is left alone by
|
|
7338
|
+
* `String.prototype.replace`, which only substitutes matched substrings.
|
|
7339
|
+
*/
|
|
7340
|
+
const ODATA_TOKEN_RE = /'(?:[^']|'')*'|[A-Za-z_][A-Za-z0-9_]*/g;
|
|
7341
|
+
/**
|
|
7342
|
+
* Rewrites SDK field identifiers to API field identifiers inside an OData
|
|
7343
|
+
* expression string (`$filter`, `$orderby`, `$select`, `$expand`).
|
|
7344
|
+
*
|
|
7345
|
+
* Field maps (e.g. `JobMap`) rename API fields → SDK fields on responses, so
|
|
7346
|
+
* SDK consumers see the renamed names. Without this rewrite, the same name
|
|
7347
|
+
* in a `filter` string would be forwarded verbatim and the API (which still
|
|
7348
|
+
* uses the original name) would reject it.
|
|
7349
|
+
*
|
|
7350
|
+
* Quoted string literals (with the OData `''` escape) are preserved exactly:
|
|
7351
|
+
* the token regex consumes them whole, so identifiers inside literals never
|
|
7352
|
+
* match. Identifier tokens are looked up in the reversed field map.
|
|
7353
|
+
*
|
|
7354
|
+
* @example
|
|
7355
|
+
* ```typescript
|
|
7356
|
+
* const requestMap = { processName: 'releaseName' };
|
|
7357
|
+
* rewriteODataIdentifiers("processName eq 'processName'", requestMap);
|
|
7358
|
+
* // "releaseName eq 'processName'" — identifier rewritten, literal preserved
|
|
7359
|
+
* ```
|
|
7360
|
+
*/
|
|
7361
|
+
function rewriteODataIdentifiers(expression, requestMap) {
|
|
7362
|
+
if (!expression)
|
|
7363
|
+
return expression;
|
|
7364
|
+
return expression.replace(ODATA_TOKEN_RE, (match) => match.startsWith("'") ? match : (requestMap[match] ?? match));
|
|
7365
|
+
}
|
|
7366
|
+
/**
|
|
7367
|
+
* Symmetric counterpart of {@link transformRequest} for OData query options:
|
|
7368
|
+
* rewrites SDK field identifiers inside the recognized OData string params
|
|
7369
|
+
* (`filter`, `orderby`, `select`, `expand`) to their API names using the
|
|
7370
|
+
* reversed form of a response field map. Returns a shallow copy with the
|
|
7371
|
+
* relevant values rewritten; other keys pass through unchanged.
|
|
7372
|
+
*
|
|
7373
|
+
* Use at the OData edge so SDK consumers can refer to renamed fields by
|
|
7374
|
+
* their SDK name throughout — for reading the response and for filtering /
|
|
7375
|
+
* sorting / projecting / expanding.
|
|
7376
|
+
*
|
|
7377
|
+
* @param options The OData query options as authored with SDK field names
|
|
7378
|
+
* @param responseMap The response field map (API → SDK); reversed internally
|
|
7379
|
+
*
|
|
7380
|
+
* @example
|
|
7381
|
+
* ```typescript
|
|
7382
|
+
* // JobMap renames releaseName → processName on responses.
|
|
7383
|
+
* transformOptions({ filter: "processName eq 'X'" }, JobMap);
|
|
7384
|
+
* // { filter: "releaseName eq 'X'" }
|
|
7385
|
+
* ```
|
|
7386
|
+
*/
|
|
7387
|
+
function transformOptions(options, responseMap) {
|
|
7388
|
+
const requestMap = reverseMap(responseMap);
|
|
7389
|
+
if (Object.keys(requestMap).length === 0)
|
|
7390
|
+
return options;
|
|
7391
|
+
const result = { ...options };
|
|
7392
|
+
for (const key of ODATA_FIELD_PARAM_KEYS) {
|
|
7393
|
+
const value = result[key];
|
|
7394
|
+
if (typeof value === 'string') {
|
|
7395
|
+
result[key] = rewriteODataIdentifiers(value, requestMap);
|
|
7396
|
+
}
|
|
7397
|
+
}
|
|
7398
|
+
return result;
|
|
7399
|
+
}
|
|
7298
7400
|
/**
|
|
7299
7401
|
* Transforms an array-based dictionary with separate keys and values arrays
|
|
7300
7402
|
* into a standard JavaScript object/record
|
|
@@ -9861,6 +9963,434 @@ __decorate([
|
|
|
9861
9963
|
track('Choicesets.DeleteValuesById')
|
|
9862
9964
|
], ChoiceSetService.prototype, "deleteValuesById", null);
|
|
9863
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
|
+
|
|
10379
|
+
/**
|
|
10380
|
+
* Maps API field names (countOf*) to SDK field names (*Count) for InstanceStats,
|
|
10381
|
+
* aligning naming with ElementStats and other count-suffixed conventions.
|
|
10382
|
+
*/
|
|
10383
|
+
const InstanceStatsMap = {
|
|
10384
|
+
countOfAllInstances: 'totalCount',
|
|
10385
|
+
countOfRunning: 'runningCount',
|
|
10386
|
+
countOfTransitioning: 'transitioningCount',
|
|
10387
|
+
countOfPaused: 'pausedCount',
|
|
10388
|
+
countOfFaulted: 'faultedCount',
|
|
10389
|
+
countOfCompleted: 'completedCount',
|
|
10390
|
+
countOfCancelled: 'cancelledCount',
|
|
10391
|
+
countOfDeleted: 'deletedCount'
|
|
10392
|
+
};
|
|
10393
|
+
|
|
9864
10394
|
/**
|
|
9865
10395
|
* Maestro Process Models
|
|
9866
10396
|
* Model classes for Maestro processes
|
|
@@ -9886,7 +10416,36 @@ function createProcessMethods(processData, service) {
|
|
|
9886
10416
|
throw new Error('Process key is undefined');
|
|
9887
10417
|
if (!processData.packageId)
|
|
9888
10418
|
throw new Error('Package ID is undefined');
|
|
9889
|
-
return service.getElementStats(
|
|
10419
|
+
return service.getElementStats({
|
|
10420
|
+
processKey: processData.processKey,
|
|
10421
|
+
packageId: processData.packageId,
|
|
10422
|
+
packageVersion,
|
|
10423
|
+
startTime,
|
|
10424
|
+
endTime,
|
|
10425
|
+
});
|
|
10426
|
+
},
|
|
10427
|
+
getInstanceStats(startTime, endTime, packageVersion) {
|
|
10428
|
+
if (!processData.processKey)
|
|
10429
|
+
throw new Error('Process key is undefined');
|
|
10430
|
+
if (!processData.packageId)
|
|
10431
|
+
throw new Error('Package ID is undefined');
|
|
10432
|
+
return service.getInstanceStats({
|
|
10433
|
+
processKey: processData.processKey,
|
|
10434
|
+
packageId: processData.packageId,
|
|
10435
|
+
packageVersion,
|
|
10436
|
+
startTime,
|
|
10437
|
+
endTime,
|
|
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] });
|
|
9890
10449
|
}
|
|
9891
10450
|
};
|
|
9892
10451
|
}
|
|
@@ -9903,226 +10462,41 @@ function createProcessWithMethods(processData, service) {
|
|
|
9903
10462
|
}
|
|
9904
10463
|
|
|
9905
10464
|
/**
|
|
9906
|
-
*
|
|
10465
|
+
* Creates methods for a process instance
|
|
9907
10466
|
*
|
|
9908
|
-
* @param
|
|
9909
|
-
* @param
|
|
9910
|
-
* @
|
|
9911
|
-
* @param options - Optional filters (packageId, processKey, version)
|
|
9912
|
-
* @returns Request body for the Insights RTM endpoint
|
|
9913
|
-
* @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
|
|
9914
10470
|
*/
|
|
9915
|
-
function
|
|
10471
|
+
function createProcessInstanceMethods(instanceData, service) {
|
|
9916
10472
|
return {
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
...(options?.version ? { version: options.version } : {}),
|
|
9924
|
-
}
|
|
9925
|
-
};
|
|
9926
|
-
}
|
|
9927
|
-
/**
|
|
9928
|
-
* Fetches instance status timeline from the Insights API.
|
|
9929
|
-
* Shared implementation used by both MaestroProcessesService and CasesService.
|
|
9930
|
-
*
|
|
9931
|
-
* @param postFn - Bound post method from a BaseService subclass
|
|
9932
|
-
* @param startTime - Start of the time range to query
|
|
9933
|
-
* @param endTime - End of the time range to query
|
|
9934
|
-
* @param isCaseManagement - Whether to filter for case management processes
|
|
9935
|
-
* @param options - Optional settings for time bucketing granularity
|
|
9936
|
-
* @returns Promise resolving to an array of instance status timeline entries
|
|
9937
|
-
* @internal
|
|
9938
|
-
*/
|
|
9939
|
-
async function fetchInstanceStatusTimeline(postFn, startTime, endTime, isCaseManagement, options) {
|
|
9940
|
-
const response = await postFn(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_STATUS_BY_DATE, {
|
|
9941
|
-
commonParams: {
|
|
9942
|
-
startTime: startTime.getTime(),
|
|
9943
|
-
endTime: endTime.getTime(),
|
|
9944
|
-
isCaseManagement,
|
|
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);
|
|
9945
10479
|
},
|
|
9946
|
-
|
|
9947
|
-
timezoneOffset: new Date().getTimezoneOffset() * -1,
|
|
9948
|
-
});
|
|
9949
|
-
return response.data ?? [];
|
|
9950
|
-
}
|
|
9951
|
-
/**
|
|
9952
|
-
* Builds the request body for the ElementCountByStatus endpoint.
|
|
9953
|
-
*
|
|
9954
|
-
* @param processKey - Process key to filter by
|
|
9955
|
-
* @param packageId - Package identifier
|
|
9956
|
-
* @param startTime - Start of the time range to query
|
|
9957
|
-
* @param endTime - End of the time range to query
|
|
9958
|
-
* @param packageVersion - Package version to filter by
|
|
9959
|
-
* @returns Request body for the ElementCountByStatus endpoint
|
|
9960
|
-
* @internal
|
|
9961
|
-
*/
|
|
9962
|
-
function buildElementCountByStatusBody(processKey, packageId, startTime, endTime, packageVersion) {
|
|
9963
|
-
return {
|
|
9964
|
-
commonParams: {
|
|
9965
|
-
processKey,
|
|
9966
|
-
packageId,
|
|
9967
|
-
startTime: startTime.getTime(),
|
|
9968
|
-
endTime: endTime.getTime(),
|
|
9969
|
-
version: packageVersion
|
|
9970
|
-
}
|
|
9971
|
-
};
|
|
9972
|
-
}
|
|
9973
|
-
|
|
9974
|
-
/**
|
|
9975
|
-
* Maps fields for Incident entities
|
|
9976
|
-
*/
|
|
9977
|
-
const ProcessIncidentMap = {
|
|
9978
|
-
errorTimeUtc: 'errorTime'
|
|
9979
|
-
};
|
|
9980
|
-
/**
|
|
9981
|
-
* Maps fields for Incident Summary entities
|
|
9982
|
-
*/
|
|
9983
|
-
const ProcessIncidentSummaryMap = {
|
|
9984
|
-
firstTimeUtc: 'firstOccuranceTime'
|
|
9985
|
-
};
|
|
9986
|
-
|
|
9987
|
-
/**
|
|
9988
|
-
* Helpers for fetching BPMN XML and extracting element details used to annotate responses
|
|
9989
|
-
*/
|
|
9990
|
-
class BpmnHelpers {
|
|
9991
|
-
/**
|
|
9992
|
-
* Parse BPMN XML and extract element id → {name,type} used for incidents
|
|
9993
|
-
*/
|
|
9994
|
-
static parseBpmnElementsForIncidents(bpmnXml) {
|
|
9995
|
-
const elementInfo = {};
|
|
9996
|
-
try {
|
|
9997
|
-
// Find <bpmn:...> start tags and capture the element type.
|
|
9998
|
-
// Then read 'id' and 'name' attributes from each tag.
|
|
9999
|
-
const bpmnOpenTagRegex = /<bpmn:([A-Za-z][\w.-]*)\b[^>]*>/g;
|
|
10000
|
-
for (const tagMatch of bpmnXml.matchAll(bpmnOpenTagRegex)) {
|
|
10001
|
-
const [fullTag, elementType] = tagMatch;
|
|
10002
|
-
// Extract attributes from the current tag text.
|
|
10003
|
-
const idMatch = /\bid\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
10004
|
-
if (!idMatch) {
|
|
10005
|
-
continue;
|
|
10006
|
-
}
|
|
10007
|
-
const elementId = idMatch[1];
|
|
10008
|
-
const nameMatch = /\bname\s*=\s*"([^"]*)"/.exec(fullTag);
|
|
10009
|
-
const name = nameMatch ? nameMatch[1] : '';
|
|
10010
|
-
// Convert BPMN element type to human-readable format
|
|
10011
|
-
const activityType = this.formatActivityTypeForIncidents(elementType);
|
|
10012
|
-
const activityName = name || elementId;
|
|
10013
|
-
elementInfo[elementId] = {
|
|
10014
|
-
type: activityType,
|
|
10015
|
-
name: activityName
|
|
10016
|
-
};
|
|
10017
|
-
}
|
|
10018
|
-
}
|
|
10019
|
-
catch (error) {
|
|
10020
|
-
console.warn('Failed to parse BPMN XML for incidents:', error);
|
|
10021
|
-
}
|
|
10022
|
-
return elementInfo;
|
|
10023
|
-
}
|
|
10024
|
-
/**
|
|
10025
|
-
* Format BPMN element type to human-readable activity type for incidents
|
|
10026
|
-
*/
|
|
10027
|
-
static formatActivityTypeForIncidents(elementType) {
|
|
10028
|
-
// Convert camelCase BPMN element types to human-readable format
|
|
10029
|
-
// e.g., "serviceTask" -> "Service Task", "exclusiveGateway" -> "Exclusive Gateway"
|
|
10030
|
-
return elementType
|
|
10031
|
-
.replace(/([A-Z])/g, ' $1') // Add space before uppercase letters
|
|
10032
|
-
.replace(/^./, str => str.toUpperCase()) // Capitalize first letter
|
|
10033
|
-
.trim(); // Remove any leading/trailing spaces
|
|
10034
|
-
}
|
|
10035
|
-
/**
|
|
10036
|
-
* Fetch BPMN via getBpmn and add element name/type to each incident
|
|
10037
|
-
*/
|
|
10038
|
-
static async enrichIncidentsWithBpmnData(incidents, folderKey, service) {
|
|
10039
|
-
// Check if all incidents have the same instanceId
|
|
10040
|
-
const uniqueInstanceIds = [...new Set(incidents.map(i => i.instanceId))];
|
|
10041
|
-
if (uniqueInstanceIds.length === 1) {
|
|
10042
|
-
// Single instance optimization (in case of process instance incidents)
|
|
10043
|
-
const elementInfo = await this.getBpmnElementInfo(uniqueInstanceIds[0], folderKey, service);
|
|
10044
|
-
return incidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
10045
|
-
}
|
|
10046
|
-
else {
|
|
10047
|
-
// Multiple instances optimization (in case of process incidents)
|
|
10048
|
-
return this.enrichMultipleInstanceIncidents(incidents, folderKey, service);
|
|
10049
|
-
}
|
|
10050
|
-
}
|
|
10051
|
-
/**
|
|
10052
|
-
* When incidents span multiple instances, fetch BPMN per instance and annotate
|
|
10053
|
-
*/
|
|
10054
|
-
static async enrichMultipleInstanceIncidents(incidents, folderKey, service) {
|
|
10055
|
-
const groups = incidents.reduce((acc, incident) => {
|
|
10056
|
-
const id = incident.instanceId || NO_INSTANCE;
|
|
10057
|
-
(acc[id] = acc[id] || []).push(incident);
|
|
10058
|
-
return acc;
|
|
10059
|
-
}, {});
|
|
10060
|
-
const results = await Promise.all(Object.entries(groups).map(async (entry) => {
|
|
10061
|
-
const [instanceId, groupIncidents] = entry;
|
|
10062
|
-
const elementInfo = await this.getBpmnElementInfo(instanceId, folderKey, service);
|
|
10063
|
-
return groupIncidents.map((incident) => this.transformIncidentWithBpmn(incident, elementInfo));
|
|
10064
|
-
}));
|
|
10065
|
-
return results.flat();
|
|
10066
|
-
}
|
|
10067
|
-
/**
|
|
10068
|
-
* Retrieve BPMN XML for an instance and derive element id → {name,type}
|
|
10069
|
-
*/
|
|
10070
|
-
static async getBpmnElementInfo(instanceId, folderKey, service) {
|
|
10071
|
-
if (!instanceId || instanceId === NO_INSTANCE) {
|
|
10072
|
-
return {};
|
|
10073
|
-
}
|
|
10074
|
-
try {
|
|
10075
|
-
const bpmnXml = await service.getBpmn(instanceId, folderKey);
|
|
10076
|
-
return this.parseBpmnElementsForIncidents(bpmnXml);
|
|
10077
|
-
}
|
|
10078
|
-
catch (error) {
|
|
10079
|
-
console.warn(`Failed to get BPMN for instance ${instanceId}:`, error);
|
|
10080
|
-
return {};
|
|
10081
|
-
}
|
|
10082
|
-
}
|
|
10083
|
-
/**
|
|
10084
|
-
* Transform a raw incident by attaching element name/type from BPMN
|
|
10085
|
-
*/
|
|
10086
|
-
static transformIncidentWithBpmn(incident, elementInfo) {
|
|
10087
|
-
const element = elementInfo[incident.elementId];
|
|
10088
|
-
const transformed = transformData(incident, ProcessIncidentMap);
|
|
10089
|
-
return {
|
|
10090
|
-
...transformed,
|
|
10091
|
-
incidentElementActivityType: element?.type || UNKNOWN,
|
|
10092
|
-
incidentElementActivityName: element?.name || UNKNOWN
|
|
10093
|
-
};
|
|
10094
|
-
}
|
|
10095
|
-
}
|
|
10096
|
-
|
|
10097
|
-
/**
|
|
10098
|
-
* Creates methods for a process instance
|
|
10099
|
-
*
|
|
10100
|
-
* @param instanceData - The process instance data (response from API)
|
|
10101
|
-
* @param service - The process instance service instance
|
|
10102
|
-
* @returns Object containing process instance methods
|
|
10103
|
-
*/
|
|
10104
|
-
function createProcessInstanceMethods(instanceData, service) {
|
|
10105
|
-
return {
|
|
10106
|
-
async cancel(options) {
|
|
10480
|
+
async pause(options) {
|
|
10107
10481
|
if (!instanceData.instanceId)
|
|
10108
10482
|
throw new Error('Process instance ID is undefined');
|
|
10109
10483
|
if (!instanceData.folderKey)
|
|
10110
10484
|
throw new Error('Process instance folder key is undefined');
|
|
10111
|
-
return service.
|
|
10485
|
+
return service.pause(instanceData.instanceId, instanceData.folderKey, options);
|
|
10112
10486
|
},
|
|
10113
|
-
async
|
|
10487
|
+
async resume(options) {
|
|
10114
10488
|
if (!instanceData.instanceId)
|
|
10115
10489
|
throw new Error('Process instance ID is undefined');
|
|
10116
10490
|
if (!instanceData.folderKey)
|
|
10117
10491
|
throw new Error('Process instance folder key is undefined');
|
|
10118
|
-
return service.
|
|
10492
|
+
return service.resume(instanceData.instanceId, instanceData.folderKey, options);
|
|
10119
10493
|
},
|
|
10120
|
-
async
|
|
10494
|
+
async retry(options) {
|
|
10121
10495
|
if (!instanceData.instanceId)
|
|
10122
10496
|
throw new Error('Process instance ID is undefined');
|
|
10123
10497
|
if (!instanceData.folderKey)
|
|
10124
10498
|
throw new Error('Process instance folder key is undefined');
|
|
10125
|
-
return service.
|
|
10499
|
+
return service.retry(instanceData.instanceId, instanceData.folderKey, options);
|
|
10126
10500
|
},
|
|
10127
10501
|
async getIncidents() {
|
|
10128
10502
|
if (!instanceData.instanceId)
|
|
@@ -10220,7 +10594,36 @@ function createCaseMethods(caseData, service) {
|
|
|
10220
10594
|
throw new Error('Process key is undefined');
|
|
10221
10595
|
if (!caseData.packageId)
|
|
10222
10596
|
throw new Error('Package ID is undefined');
|
|
10223
|
-
return service.getElementStats(
|
|
10597
|
+
return service.getElementStats({
|
|
10598
|
+
processKey: caseData.processKey,
|
|
10599
|
+
packageId: caseData.packageId,
|
|
10600
|
+
packageVersion,
|
|
10601
|
+
startTime,
|
|
10602
|
+
endTime,
|
|
10603
|
+
});
|
|
10604
|
+
},
|
|
10605
|
+
getInstanceStats(startTime, endTime, packageVersion) {
|
|
10606
|
+
if (!caseData.processKey)
|
|
10607
|
+
throw new Error('Process key is undefined');
|
|
10608
|
+
if (!caseData.packageId)
|
|
10609
|
+
throw new Error('Package ID is undefined');
|
|
10610
|
+
return service.getInstanceStats({
|
|
10611
|
+
processKey: caseData.processKey,
|
|
10612
|
+
packageId: caseData.packageId,
|
|
10613
|
+
packageVersion,
|
|
10614
|
+
startTime,
|
|
10615
|
+
endTime,
|
|
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] });
|
|
10224
10627
|
}
|
|
10225
10628
|
};
|
|
10226
10629
|
}
|
|
@@ -10389,54 +10792,244 @@ function createCaseInstanceMethods(instanceData, service) {
|
|
|
10389
10792
|
throw new Error('Case instance ID is undefined');
|
|
10390
10793
|
return service.getStagesSlaSummary({ caseInstanceId: instanceData.instanceId });
|
|
10391
10794
|
}
|
|
10392
|
-
};
|
|
10393
|
-
}
|
|
10394
|
-
/**
|
|
10395
|
-
* Creates an actionable case instance by combining API case instance data with operational methods.
|
|
10396
|
-
*
|
|
10397
|
-
* @param instanceData - The case instance data from API
|
|
10398
|
-
* @param service - The case instance service instance
|
|
10399
|
-
* @returns A case instance object with added methods
|
|
10400
|
-
*/
|
|
10401
|
-
function createCaseInstanceWithMethods(instanceData, service) {
|
|
10402
|
-
const methods = createCaseInstanceMethods(instanceData, service);
|
|
10403
|
-
return Object.assign({}, instanceData, methods);
|
|
10795
|
+
};
|
|
10796
|
+
}
|
|
10797
|
+
/**
|
|
10798
|
+
* Creates an actionable case instance by combining API case instance data with operational methods.
|
|
10799
|
+
*
|
|
10800
|
+
* @param instanceData - The case instance data from API
|
|
10801
|
+
* @param service - The case instance service instance
|
|
10802
|
+
* @returns A case instance object with added methods
|
|
10803
|
+
*/
|
|
10804
|
+
function createCaseInstanceWithMethods(instanceData, service) {
|
|
10805
|
+
const methods = createCaseInstanceMethods(instanceData, service);
|
|
10806
|
+
return Object.assign({}, instanceData, methods);
|
|
10807
|
+
}
|
|
10808
|
+
|
|
10809
|
+
/**
|
|
10810
|
+
* Insights Types
|
|
10811
|
+
* Shared types for Maestro insights analytics endpoints
|
|
10812
|
+
*/
|
|
10813
|
+
/**
|
|
10814
|
+
* Time bucketing granularity for insights time-series queries.
|
|
10815
|
+
*
|
|
10816
|
+
* Controls how data points are grouped on the time axis.
|
|
10817
|
+
*/
|
|
10818
|
+
exports.TimeInterval = void 0;
|
|
10819
|
+
(function (TimeInterval) {
|
|
10820
|
+
/** Group data points by hour */
|
|
10821
|
+
TimeInterval["Hour"] = "HOUR";
|
|
10822
|
+
/** Group data points by day */
|
|
10823
|
+
TimeInterval["Day"] = "DAY";
|
|
10824
|
+
/** Group data points by week */
|
|
10825
|
+
TimeInterval["Week"] = "WEEK";
|
|
10826
|
+
})(exports.TimeInterval || (exports.TimeInterval = {}));
|
|
10827
|
+
/**
|
|
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
|
|
10918
|
+
*/
|
|
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
|
+
}
|
|
10404
11031
|
}
|
|
10405
11032
|
|
|
10406
|
-
/**
|
|
10407
|
-
* Insights Types
|
|
10408
|
-
* Shared types for Maestro insights analytics endpoints
|
|
10409
|
-
*/
|
|
10410
|
-
/**
|
|
10411
|
-
* Time bucketing granularity for insights time-series queries.
|
|
10412
|
-
*
|
|
10413
|
-
* Controls how data points are grouped on the time axis.
|
|
10414
|
-
*/
|
|
10415
|
-
exports.TimeInterval = void 0;
|
|
10416
|
-
(function (TimeInterval) {
|
|
10417
|
-
/** Group data points by hour */
|
|
10418
|
-
TimeInterval["Hour"] = "HOUR";
|
|
10419
|
-
/** Group data points by day */
|
|
10420
|
-
TimeInterval["Day"] = "DAY";
|
|
10421
|
-
/** Group data points by week */
|
|
10422
|
-
TimeInterval["Week"] = "WEEK";
|
|
10423
|
-
})(exports.TimeInterval || (exports.TimeInterval = {}));
|
|
10424
|
-
/**
|
|
10425
|
-
* Final instance statuses returned by the instance status timeline endpoint.
|
|
10426
|
-
*
|
|
10427
|
-
* Only includes statuses where the instance has finished execution — Completed, Faulted, or Cancelled.
|
|
10428
|
-
* Active statuses like Running or Paused are not included.
|
|
10429
|
-
*/
|
|
10430
|
-
exports.InstanceFinalStatus = void 0;
|
|
10431
|
-
(function (InstanceFinalStatus) {
|
|
10432
|
-
/** Instance completed successfully */
|
|
10433
|
-
InstanceFinalStatus["Completed"] = "Completed";
|
|
10434
|
-
/** Instance encountered an error */
|
|
10435
|
-
InstanceFinalStatus["Faulted"] = "Faulted";
|
|
10436
|
-
/** Instance was cancelled */
|
|
10437
|
-
InstanceFinalStatus["Cancelled"] = "Cancelled";
|
|
10438
|
-
})(exports.InstanceFinalStatus || (exports.InstanceFinalStatus = {}));
|
|
10439
|
-
|
|
10440
11033
|
/**
|
|
10441
11034
|
* Maps fields for Process Instance entities to ensure consistent naming
|
|
10442
11035
|
*/
|
|
@@ -10512,7 +11105,7 @@ class ProcessInstancesService extends BaseService {
|
|
|
10512
11105
|
}, options);
|
|
10513
11106
|
}
|
|
10514
11107
|
/**
|
|
10515
|
-
* 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)
|
|
10516
11109
|
* @param id The ID of the instance to retrieve
|
|
10517
11110
|
* @param folderKey The folder key for authorization
|
|
10518
11111
|
* @returns Promise<ProcessInstanceGetResponse>
|
|
@@ -10651,6 +11244,25 @@ class ProcessInstancesService extends BaseService {
|
|
|
10651
11244
|
data: response.data
|
|
10652
11245
|
};
|
|
10653
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
|
+
}
|
|
10654
11266
|
/**
|
|
10655
11267
|
* Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
|
|
10656
11268
|
* @private
|
|
@@ -10801,6 +11413,9 @@ __decorate([
|
|
|
10801
11413
|
__decorate([
|
|
10802
11414
|
track('ProcessInstances.Resume')
|
|
10803
11415
|
], ProcessInstancesService.prototype, "resume", null);
|
|
11416
|
+
__decorate([
|
|
11417
|
+
track('ProcessInstances.Retry')
|
|
11418
|
+
], ProcessInstancesService.prototype, "retry", null);
|
|
10804
11419
|
__decorate([
|
|
10805
11420
|
track('ProcessInstances.GetVariables')
|
|
10806
11421
|
], ProcessInstancesService.prototype, "getVariables", null);
|
|
@@ -10957,7 +11572,7 @@ class MaestroProcessesService extends BaseService {
|
|
|
10957
11572
|
*
|
|
10958
11573
|
* @param startTime - Start of the time range to query
|
|
10959
11574
|
* @param endTime - End of the time range to query
|
|
10960
|
-
* @param options - Optional settings for time
|
|
11575
|
+
* @param options - Optional settings for filtering and time bucket granularity
|
|
10961
11576
|
* @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
|
|
10962
11577
|
*
|
|
10963
11578
|
* @example
|
|
@@ -10984,12 +11599,67 @@ class MaestroProcessesService extends BaseService {
|
|
|
10984
11599
|
*
|
|
10985
11600
|
* @example
|
|
10986
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
|
|
10987
11610
|
* // Get all-time data (from Unix epoch to now)
|
|
10988
11611
|
* const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
|
|
10989
11612
|
* ```
|
|
10990
11613
|
*/
|
|
10991
11614
|
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
10992
|
-
|
|
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 ?? [];
|
|
10993
11663
|
}
|
|
10994
11664
|
/**
|
|
10995
11665
|
* Get the top 10 processes ranked by failure count within a time range.
|
|
@@ -11084,22 +11754,22 @@ class MaestroProcessesService extends BaseService {
|
|
|
11084
11754
|
* Returns per-element execution counts (success, fail, terminated, paused, in-progress) and
|
|
11085
11755
|
* duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a process.
|
|
11086
11756
|
*
|
|
11087
|
-
* @param
|
|
11088
|
-
* @param packageId - Package identifier
|
|
11089
|
-
* @param startTime - Start of the time range to query
|
|
11090
|
-
* @param endTime - End of the time range to query
|
|
11091
|
-
* @param packageVersion - Package version to filter by
|
|
11757
|
+
* @param request - Process scope + time range to aggregate over
|
|
11092
11758
|
* @returns Promise resolving to an array of {@link ElementStats}
|
|
11093
11759
|
* @example
|
|
11094
11760
|
* ```typescript
|
|
11095
|
-
* //
|
|
11096
|
-
* const
|
|
11097
|
-
*
|
|
11098
|
-
*
|
|
11099
|
-
*
|
|
11100
|
-
*
|
|
11101
|
-
*
|
|
11102
|
-
*
|
|
11761
|
+
* // First, list processes to find the processKey, packageId, and available versions
|
|
11762
|
+
* const processes = await maestroProcesses.getAll();
|
|
11763
|
+
* const process = processes[0];
|
|
11764
|
+
*
|
|
11765
|
+
* // Get element metrics for that process
|
|
11766
|
+
* const elements = await maestroProcesses.getElementStats({
|
|
11767
|
+
* processKey: process.processKey,
|
|
11768
|
+
* packageId: process.packageId,
|
|
11769
|
+
* packageVersion: process.packageVersions[0],
|
|
11770
|
+
* startTime: new Date('2026-04-01'),
|
|
11771
|
+
* endTime: new Date(),
|
|
11772
|
+
* });
|
|
11103
11773
|
*
|
|
11104
11774
|
* // Analyze element performance
|
|
11105
11775
|
* for (const element of elements) {
|
|
@@ -11107,12 +11777,58 @@ class MaestroProcessesService extends BaseService {
|
|
|
11107
11777
|
* console.log(` Success: ${element.successCount}, Failed: ${element.failCount}`);
|
|
11108
11778
|
* console.log(` Avg duration: ${element.avgDurationMs}ms, P95: ${element.p95DurationMs}ms`);
|
|
11109
11779
|
* }
|
|
11780
|
+
*
|
|
11781
|
+
* // Using bound method on a process — auto-fills processKey and packageId
|
|
11782
|
+
* const boundElements = await process.getElementStats(
|
|
11783
|
+
* new Date('2026-04-01'),
|
|
11784
|
+
* new Date(),
|
|
11785
|
+
* process.packageVersions[0]
|
|
11786
|
+
* );
|
|
11110
11787
|
* ```
|
|
11111
11788
|
*/
|
|
11112
|
-
async getElementStats(
|
|
11113
|
-
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS,
|
|
11789
|
+
async getElementStats(request) {
|
|
11790
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
11114
11791
|
return data ?? [];
|
|
11115
11792
|
}
|
|
11793
|
+
/**
|
|
11794
|
+
* Get instance stats for a process.
|
|
11795
|
+
*
|
|
11796
|
+
* Returns total instance counts broken down by status (running, completed, faulted, etc.)
|
|
11797
|
+
* and the average execution duration for all instances of a process within a time range.
|
|
11798
|
+
*
|
|
11799
|
+
* @param request - Process scope + time range to aggregate over
|
|
11800
|
+
* @returns Promise resolving to {@link InstanceStats}
|
|
11801
|
+
* @example
|
|
11802
|
+
* ```typescript
|
|
11803
|
+
* // First, list processes to find the processKey, packageId, and available versions
|
|
11804
|
+
* const processes = await maestroProcesses.getAll();
|
|
11805
|
+
* const process = processes[0];
|
|
11806
|
+
*
|
|
11807
|
+
* // Get instance status breakdown for that process
|
|
11808
|
+
* const counts = await maestroProcesses.getInstanceStats({
|
|
11809
|
+
* processKey: process.processKey,
|
|
11810
|
+
* packageId: process.packageId,
|
|
11811
|
+
* packageVersion: process.packageVersions[0],
|
|
11812
|
+
* startTime: new Date('2026-04-01'),
|
|
11813
|
+
* endTime: new Date(),
|
|
11814
|
+
* });
|
|
11815
|
+
*
|
|
11816
|
+
* console.log(`Total: ${counts.totalCount}`);
|
|
11817
|
+
* console.log(`Running: ${counts.runningCount}, Completed: ${counts.completedCount}`);
|
|
11818
|
+
* console.log(`Faulted: ${counts.faultedCount}, Avg duration: ${counts.avgDurationMs}ms`);
|
|
11819
|
+
*
|
|
11820
|
+
* // Using bound method on a process — auto-fills processKey and packageId
|
|
11821
|
+
* const boundCounts = await process.getInstanceStats(
|
|
11822
|
+
* new Date('2026-04-01'),
|
|
11823
|
+
* new Date(),
|
|
11824
|
+
* process.packageVersions[0]
|
|
11825
|
+
* );
|
|
11826
|
+
* ```
|
|
11827
|
+
*/
|
|
11828
|
+
async getInstanceStats(request) {
|
|
11829
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
11830
|
+
return transformData(data, InstanceStatsMap);
|
|
11831
|
+
}
|
|
11116
11832
|
}
|
|
11117
11833
|
__decorate([
|
|
11118
11834
|
track('MaestroProcesses.GetAll')
|
|
@@ -11129,6 +11845,9 @@ __decorate([
|
|
|
11129
11845
|
__decorate([
|
|
11130
11846
|
track('MaestroProcesses.GetInstanceStatusTimeline')
|
|
11131
11847
|
], MaestroProcessesService.prototype, "getInstanceStatusTimeline", null);
|
|
11848
|
+
__decorate([
|
|
11849
|
+
track('MaestroProcesses.GetIncidentsTimeline')
|
|
11850
|
+
], MaestroProcessesService.prototype, "getIncidentsTimeline", null);
|
|
11132
11851
|
__decorate([
|
|
11133
11852
|
track('MaestroProcesses.GetTopFaultedCount')
|
|
11134
11853
|
], MaestroProcessesService.prototype, "getTopFaultedCount", null);
|
|
@@ -11138,6 +11857,9 @@ __decorate([
|
|
|
11138
11857
|
__decorate([
|
|
11139
11858
|
track('MaestroProcesses.GetElementStats')
|
|
11140
11859
|
], MaestroProcessesService.prototype, "getElementStats", null);
|
|
11860
|
+
__decorate([
|
|
11861
|
+
track('MaestroProcesses.GetInstanceStats')
|
|
11862
|
+
], MaestroProcessesService.prototype, "getInstanceStats", null);
|
|
11141
11863
|
|
|
11142
11864
|
/**
|
|
11143
11865
|
* Service class for Maestro Process Incidents
|
|
@@ -11318,7 +12040,7 @@ class CasesService extends BaseService {
|
|
|
11318
12040
|
*
|
|
11319
12041
|
* @param startTime - Start of the time range to query
|
|
11320
12042
|
* @param endTime - End of the time range to query
|
|
11321
|
-
* @param options - Optional settings for time
|
|
12043
|
+
* @param options - Optional settings for filtering and time bucket granularity
|
|
11322
12044
|
* @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
|
|
11323
12045
|
*
|
|
11324
12046
|
* @example
|
|
@@ -11345,12 +12067,67 @@ class CasesService extends BaseService {
|
|
|
11345
12067
|
*
|
|
11346
12068
|
* @example
|
|
11347
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
|
|
11348
12078
|
* // Get all-time data (from Unix epoch to now)
|
|
11349
12079
|
* const allTime = await cases.getInstanceStatusTimeline(new Date(0), new Date());
|
|
11350
12080
|
* ```
|
|
11351
12081
|
*/
|
|
11352
12082
|
async getInstanceStatusTimeline(startTime, endTime, options) {
|
|
11353
|
-
|
|
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 ?? [];
|
|
11354
12131
|
}
|
|
11355
12132
|
/**
|
|
11356
12133
|
* Get the top 10 case processes ranked by failure count within a time range.
|
|
@@ -11445,34 +12222,79 @@ class CasesService extends BaseService {
|
|
|
11445
12222
|
* Returns per-element execution counts (success, fail, terminated, paused, in-progress) and
|
|
11446
12223
|
* duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a case.
|
|
11447
12224
|
*
|
|
11448
|
-
* @param
|
|
11449
|
-
* @param packageId - Package identifier
|
|
11450
|
-
* @param startTime - Start of the time range to query
|
|
11451
|
-
* @param endTime - End of the time range to query
|
|
11452
|
-
* @param packageVersion - Package version to filter by
|
|
12225
|
+
* @param request - Process scope + time range to aggregate over
|
|
11453
12226
|
* @returns Promise resolving to an array of {@link ElementStats}
|
|
11454
12227
|
* @example
|
|
11455
12228
|
* ```typescript
|
|
11456
|
-
* //
|
|
11457
|
-
* const
|
|
11458
|
-
*
|
|
11459
|
-
*
|
|
11460
|
-
*
|
|
11461
|
-
*
|
|
11462
|
-
*
|
|
11463
|
-
*
|
|
12229
|
+
* // First, list cases to find the processKey, packageId, and available versions
|
|
12230
|
+
* const allCases = await cases.getAll();
|
|
12231
|
+
* const caseItem = allCases[0];
|
|
12232
|
+
*
|
|
12233
|
+
* // Get element metrics for that case
|
|
12234
|
+
* const elements = await cases.getElementStats({
|
|
12235
|
+
* processKey: caseItem.processKey,
|
|
12236
|
+
* packageId: caseItem.packageId,
|
|
12237
|
+
* packageVersion: caseItem.packageVersions[0],
|
|
12238
|
+
* startTime: new Date('2026-04-01'),
|
|
12239
|
+
* endTime: new Date(),
|
|
12240
|
+
* });
|
|
11464
12241
|
*
|
|
11465
12242
|
* // Find elements with failures
|
|
11466
12243
|
* const failedElements = elements.filter(e => e.failCount > 0);
|
|
11467
12244
|
* for (const element of failedElements) {
|
|
11468
12245
|
* console.log(`Failed element: ${element.elementId}, failures: ${element.failCount}`);
|
|
11469
12246
|
* }
|
|
12247
|
+
*
|
|
12248
|
+
* // Using bound method on a case — auto-fills processKey and packageId
|
|
12249
|
+
* const boundElements = await caseItem.getElementStats(
|
|
12250
|
+
* new Date('2026-04-01'),
|
|
12251
|
+
* new Date(),
|
|
12252
|
+
* caseItem.packageVersions[0]
|
|
12253
|
+
* );
|
|
11470
12254
|
* ```
|
|
11471
12255
|
*/
|
|
11472
|
-
async getElementStats(
|
|
11473
|
-
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS,
|
|
12256
|
+
async getElementStats(request) {
|
|
12257
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.ELEMENT_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
11474
12258
|
return data ?? [];
|
|
11475
12259
|
}
|
|
12260
|
+
/**
|
|
12261
|
+
* Get instance stats for a case.
|
|
12262
|
+
*
|
|
12263
|
+
* Returns total instance counts broken down by status (running, completed, faulted, etc.)
|
|
12264
|
+
* and the average execution duration for all instances of a case within a time range.
|
|
12265
|
+
*
|
|
12266
|
+
* @param request - Process scope + time range to aggregate over
|
|
12267
|
+
* @returns Promise resolving to {@link InstanceStats}
|
|
12268
|
+
* @example
|
|
12269
|
+
* ```typescript
|
|
12270
|
+
* // First, list cases to find the processKey, packageId, and available versions
|
|
12271
|
+
* const allCases = await cases.getAll();
|
|
12272
|
+
* const caseItem = allCases[0];
|
|
12273
|
+
*
|
|
12274
|
+
* // Get instance status breakdown for that case
|
|
12275
|
+
* const counts = await cases.getInstanceStats({
|
|
12276
|
+
* processKey: caseItem.processKey,
|
|
12277
|
+
* packageId: caseItem.packageId,
|
|
12278
|
+
* packageVersion: caseItem.packageVersions[0],
|
|
12279
|
+
* startTime: new Date('2026-04-01'),
|
|
12280
|
+
* endTime: new Date(),
|
|
12281
|
+
* });
|
|
12282
|
+
*
|
|
12283
|
+
* console.log(`Total: ${counts.totalCount}`);
|
|
12284
|
+
* console.log(`Completed: ${counts.completedCount}, Faulted: ${counts.faultedCount}`);
|
|
12285
|
+
*
|
|
12286
|
+
* // Using bound method on a case — auto-fills processKey and packageId
|
|
12287
|
+
* const boundCounts = await caseItem.getInstanceStats(
|
|
12288
|
+
* new Date('2026-04-01'),
|
|
12289
|
+
* new Date(),
|
|
12290
|
+
* caseItem.packageVersions[0]
|
|
12291
|
+
* );
|
|
12292
|
+
* ```
|
|
12293
|
+
*/
|
|
12294
|
+
async getInstanceStats(request) {
|
|
12295
|
+
const { data } = await this.post(MAESTRO_ENDPOINTS.INSIGHTS.INSTANCE_COUNT_BY_STATUS, buildInsightsCommonBody(request));
|
|
12296
|
+
return transformData(data, InstanceStatsMap);
|
|
12297
|
+
}
|
|
11476
12298
|
/**
|
|
11477
12299
|
* Extract a readable case name from the packageId
|
|
11478
12300
|
* @param packageId - The full package identifier
|
|
@@ -11504,6 +12326,9 @@ __decorate([
|
|
|
11504
12326
|
__decorate([
|
|
11505
12327
|
track('Cases.GetInstanceStatusTimeline')
|
|
11506
12328
|
], CasesService.prototype, "getInstanceStatusTimeline", null);
|
|
12329
|
+
__decorate([
|
|
12330
|
+
track('Cases.GetIncidentsTimeline')
|
|
12331
|
+
], CasesService.prototype, "getIncidentsTimeline", null);
|
|
11507
12332
|
__decorate([
|
|
11508
12333
|
track('Cases.GetTopFaultedCount')
|
|
11509
12334
|
], CasesService.prototype, "getTopFaultedCount", null);
|
|
@@ -11513,6 +12338,9 @@ __decorate([
|
|
|
11513
12338
|
__decorate([
|
|
11514
12339
|
track('Cases.GetElementStats')
|
|
11515
12340
|
], CasesService.prototype, "getElementStats", null);
|
|
12341
|
+
__decorate([
|
|
12342
|
+
track('Cases.GetInstanceStats')
|
|
12343
|
+
], CasesService.prototype, "getInstanceStats", null);
|
|
11516
12344
|
|
|
11517
12345
|
/**
|
|
11518
12346
|
* Maps fields for Case Instance entities to ensure consistent naming
|
|
@@ -11818,6 +12646,10 @@ class TaskService extends BaseService {
|
|
|
11818
12646
|
const transformedTask = transformData(pascalToCamelCaseKeys(task), TaskMap);
|
|
11819
12647
|
return createTaskWithMethods(applyDataTransforms(transformedTask, { field: 'status', valueMap: TaskStatusMap }), this);
|
|
11820
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;
|
|
11821
12653
|
return PaginationHelpers.getAll({
|
|
11822
12654
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
11823
12655
|
getEndpoint: () => endpoint,
|
|
@@ -11834,7 +12666,7 @@ class TaskService extends BaseService {
|
|
|
11834
12666
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM // OData OFFSET parameter
|
|
11835
12667
|
}
|
|
11836
12668
|
}
|
|
11837
|
-
},
|
|
12669
|
+
}, apiOptions);
|
|
11838
12670
|
}
|
|
11839
12671
|
/**
|
|
11840
12672
|
* Gets a task by ID
|
|
@@ -11870,9 +12702,10 @@ class TaskService extends BaseService {
|
|
|
11870
12702
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
11871
12703
|
// Add default expand parameters
|
|
11872
12704
|
const modifiedOptions = this.addDefaultExpand(restOptions);
|
|
11873
|
-
//
|
|
11874
|
-
|
|
11875
|
-
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));
|
|
11876
12709
|
const response = await this.get(TASK_ENDPOINTS.GET_BY_ID(id), {
|
|
11877
12710
|
params: apiOptions,
|
|
11878
12711
|
headers
|
|
@@ -12865,9 +13698,12 @@ class FolderScopedService extends BaseService {
|
|
|
12865
13698
|
* @param name - Resource name to search for
|
|
12866
13699
|
* @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) + OData query options (`expand`, `select`)
|
|
12867
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`)
|
|
12868
13704
|
* @throws ValidationError when inputs are malformed; NotFoundError when no match
|
|
12869
13705
|
*/
|
|
12870
|
-
async getByNameLookup(resourceType, endpoint, name, options, transform) {
|
|
13706
|
+
async getByNameLookup(resourceType, endpoint, name, options, transform, responseFieldMap) {
|
|
12871
13707
|
const validatedName = validateName(resourceType, name);
|
|
12872
13708
|
const { folderId, folderKey, folderPath, ...queryOptions } = options;
|
|
12873
13709
|
const headers = resolveFolderHeaders({
|
|
@@ -12877,8 +13713,11 @@ class FolderScopedService extends BaseService {
|
|
|
12877
13713
|
resourceType: `${resourceType}.getByName`,
|
|
12878
13714
|
fallbackFolderKey: this.config.folderKey,
|
|
12879
13715
|
});
|
|
13716
|
+
const apiFieldOptions = responseFieldMap
|
|
13717
|
+
? transformOptions(queryOptions, responseFieldMap)
|
|
13718
|
+
: queryOptions;
|
|
12880
13719
|
const apiOptions = {
|
|
12881
|
-
...addPrefixToKeys(
|
|
13720
|
+
...addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions)),
|
|
12882
13721
|
'$filter': `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
|
|
12883
13722
|
'$top': '1',
|
|
12884
13723
|
};
|
|
@@ -12978,6 +13817,10 @@ class AssetService extends FolderScopedService {
|
|
|
12978
13817
|
async getAll(options) {
|
|
12979
13818
|
// Transformation function for assets
|
|
12980
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;
|
|
12981
13824
|
return PaginationHelpers.getAll({
|
|
12982
13825
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
12983
13826
|
getEndpoint: (folderId) => folderId ? ASSET_ENDPOINTS.GET_BY_FOLDER : ASSET_ENDPOINTS.GET_ALL,
|
|
@@ -12993,7 +13836,7 @@ class AssetService extends FolderScopedService {
|
|
|
12993
13836
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
12994
13837
|
}
|
|
12995
13838
|
}
|
|
12996
|
-
},
|
|
13839
|
+
}, apiOptions);
|
|
12997
13840
|
}
|
|
12998
13841
|
/**
|
|
12999
13842
|
* Gets a single asset by ID
|
|
@@ -13015,8 +13858,8 @@ class AssetService extends FolderScopedService {
|
|
|
13015
13858
|
*/
|
|
13016
13859
|
async getById(id, folderId, options = {}) {
|
|
13017
13860
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
13018
|
-
const
|
|
13019
|
-
const apiOptions = addPrefixToKeys(
|
|
13861
|
+
const apiFieldOptions = transformOptions(options, AssetMap);
|
|
13862
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
13020
13863
|
const response = await this.get(ASSET_ENDPOINTS.GET_BY_ID(id), {
|
|
13021
13864
|
headers,
|
|
13022
13865
|
params: apiOptions
|
|
@@ -13051,7 +13894,7 @@ class AssetService extends FolderScopedService {
|
|
|
13051
13894
|
* ```
|
|
13052
13895
|
*/
|
|
13053
13896
|
async getByName(name, options = {}) {
|
|
13054
|
-
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);
|
|
13055
13898
|
}
|
|
13056
13899
|
/**
|
|
13057
13900
|
* Updates the value of an existing asset by ID.
|
|
@@ -13325,6 +14168,9 @@ class BucketService extends FolderScopedService {
|
|
|
13325
14168
|
});
|
|
13326
14169
|
// Transformation function for blob items
|
|
13327
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);
|
|
13328
14174
|
return PaginationHelpers.getAll({
|
|
13329
14175
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
13330
14176
|
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILE_META_DATA(bucketId),
|
|
@@ -13340,7 +14186,7 @@ class BucketService extends FolderScopedService {
|
|
|
13340
14186
|
},
|
|
13341
14187
|
excludeFromPrefix: ['prefix'], // Bucket-specific param, not OData
|
|
13342
14188
|
headers,
|
|
13343
|
-
},
|
|
14189
|
+
}, apiRestOptions);
|
|
13344
14190
|
}
|
|
13345
14191
|
async uploadFile(bucketIdOrOptions, path, content, options) {
|
|
13346
14192
|
// Normalize the two overload forms into a single internal shape.
|
|
@@ -13424,9 +14270,10 @@ class BucketService extends FolderScopedService {
|
|
|
13424
14270
|
resourceType: 'Buckets.getReadUri',
|
|
13425
14271
|
fallbackFolderKey: this.config.folderKey,
|
|
13426
14272
|
});
|
|
14273
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
13427
14274
|
const queryOptions = {
|
|
13428
14275
|
expiryInMinutes,
|
|
13429
|
-
...addPrefixToKeys(
|
|
14276
|
+
...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
|
|
13430
14277
|
};
|
|
13431
14278
|
return this._getUri(BUCKET_ENDPOINTS.GET_READ_URI(bucketId), bucketId, resolvedPath, headers, queryOptions);
|
|
13432
14279
|
}
|
|
@@ -13546,6 +14393,9 @@ class BucketService extends FolderScopedService {
|
|
|
13546
14393
|
fallbackFolderKey: this.config.folderKey,
|
|
13547
14394
|
});
|
|
13548
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);
|
|
13549
14399
|
return PaginationHelpers.getAll({
|
|
13550
14400
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
13551
14401
|
getEndpoint: () => BUCKET_ENDPOINTS.GET_FILES(bucketId),
|
|
@@ -13562,7 +14412,7 @@ class BucketService extends FolderScopedService {
|
|
|
13562
14412
|
},
|
|
13563
14413
|
excludeFromPrefix: ['directory', 'recursive', 'fileNameRegex'],
|
|
13564
14414
|
headers,
|
|
13565
|
-
}, { ...
|
|
14415
|
+
}, { ...apiRestOptions, directory: '/', recursive: true });
|
|
13566
14416
|
}
|
|
13567
14417
|
/**
|
|
13568
14418
|
* Deletes a file from a bucket
|
|
@@ -13609,9 +14459,10 @@ class BucketService extends FolderScopedService {
|
|
|
13609
14459
|
*/
|
|
13610
14460
|
async _getWriteUri(options) {
|
|
13611
14461
|
const { bucketId, path, expiryInMinutes, headers, ...restOptions } = options;
|
|
14462
|
+
const apiRestOptions = transformOptions(restOptions, BucketMap);
|
|
13612
14463
|
const queryOptions = {
|
|
13613
14464
|
expiryInMinutes,
|
|
13614
|
-
...addPrefixToKeys(
|
|
14465
|
+
...addPrefixToKeys(apiRestOptions, ODATA_PREFIX, Object.keys(apiRestOptions))
|
|
13615
14466
|
};
|
|
13616
14467
|
return this._getUri(BUCKET_ENDPOINTS.GET_WRITE_URI(bucketId), bucketId, path, headers, queryOptions);
|
|
13617
14468
|
}
|
|
@@ -13744,9 +14595,10 @@ class AttachmentService extends BaseService {
|
|
|
13744
14595
|
if (!id) {
|
|
13745
14596
|
throw new ValidationError({ message: 'id is required for getById' });
|
|
13746
14597
|
}
|
|
13747
|
-
//
|
|
13748
|
-
|
|
13749
|
-
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));
|
|
13750
14602
|
const response = await this.get(ORCHESTRATOR_ATTACHMENT_ENDPOINTS.GET_BY_ID(id), {
|
|
13751
14603
|
params: apiOptions,
|
|
13752
14604
|
});
|
|
@@ -13970,8 +14822,9 @@ class JobService extends FolderScopedService {
|
|
|
13970
14822
|
* const folderJobs = await jobs.getAll({ folderId: <folderId> });
|
|
13971
14823
|
*
|
|
13972
14824
|
* // With filtering
|
|
13973
|
-
* const
|
|
13974
|
-
* filter: "
|
|
14825
|
+
* const recentInvoiceJobs = await jobs.getAll({
|
|
14826
|
+
* filter: "processName eq 'InvoiceBot'",
|
|
14827
|
+
* orderby: 'createdTime desc',
|
|
13975
14828
|
* });
|
|
13976
14829
|
*
|
|
13977
14830
|
* // First page with pagination
|
|
@@ -13994,6 +14847,10 @@ class JobService extends FolderScopedService {
|
|
|
13994
14847
|
const rawJob = transformData(pascalToCamelCaseKeys(job), JobMap);
|
|
13995
14848
|
return createJobWithMethods(rawJob, this);
|
|
13996
14849
|
};
|
|
14850
|
+
// Rewrite renamed SDK field names → API names inside OData strings
|
|
14851
|
+
// before delegating, mirroring the transformRequest pattern used for
|
|
14852
|
+
// request bodies.
|
|
14853
|
+
const apiOptions = options ? transformOptions(options, JobMap) : options;
|
|
13997
14854
|
return PaginationHelpers.getAll({
|
|
13998
14855
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
13999
14856
|
getEndpoint: () => JOB_ENDPOINTS.GET_ALL,
|
|
@@ -14009,7 +14866,7 @@ class JobService extends FolderScopedService {
|
|
|
14009
14866
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM,
|
|
14010
14867
|
},
|
|
14011
14868
|
},
|
|
14012
|
-
},
|
|
14869
|
+
}, apiOptions);
|
|
14013
14870
|
}
|
|
14014
14871
|
/**
|
|
14015
14872
|
* Gets a job by its unique key (GUID).
|
|
@@ -14046,8 +14903,8 @@ class JobService extends FolderScopedService {
|
|
|
14046
14903
|
throw new ValidationError({ message: 'folderId is required for getById' });
|
|
14047
14904
|
}
|
|
14048
14905
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
14049
|
-
const
|
|
14050
|
-
const apiOptions =
|
|
14906
|
+
const apiFieldOptions = options ? transformOptions(options, JobMap) : {};
|
|
14907
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
14051
14908
|
const response = await this.get(JOB_ENDPOINTS.GET_BY_KEY(id), {
|
|
14052
14909
|
params: apiOptions,
|
|
14053
14910
|
headers,
|
|
@@ -14350,6 +15207,9 @@ exports.JobState = void 0;
|
|
|
14350
15207
|
JobState["Stopped"] = "Stopped";
|
|
14351
15208
|
JobState["Suspended"] = "Suspended";
|
|
14352
15209
|
JobState["Resumed"] = "Resumed";
|
|
15210
|
+
JobState["Cancelled"] = "Cancelled";
|
|
15211
|
+
/** Server-side fallback for an unrecognized or missing job state. */
|
|
15212
|
+
JobState["Unknown"] = "Unknown";
|
|
14353
15213
|
})(exports.JobState || (exports.JobState = {}));
|
|
14354
15214
|
|
|
14355
15215
|
/**
|
|
@@ -14420,6 +15280,10 @@ class ProcessService extends FolderScopedService {
|
|
|
14420
15280
|
async getAll(options) {
|
|
14421
15281
|
// Transformation function for processes
|
|
14422
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;
|
|
14423
15287
|
return PaginationHelpers.getAll({
|
|
14424
15288
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
14425
15289
|
getEndpoint: () => PROCESS_ENDPOINTS.GET_ALL,
|
|
@@ -14435,7 +15299,7 @@ class ProcessService extends FolderScopedService {
|
|
|
14435
15299
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
14436
15300
|
}
|
|
14437
15301
|
}
|
|
14438
|
-
},
|
|
15302
|
+
}, apiOptions);
|
|
14439
15303
|
}
|
|
14440
15304
|
async start(request, optionsOrFolderId, legacyOptions) {
|
|
14441
15305
|
// Normalize the two overload forms into a single internal shape.
|
|
@@ -14469,9 +15333,10 @@ class ProcessService extends FolderScopedService {
|
|
|
14469
15333
|
const requestBody = {
|
|
14470
15334
|
startInfo: apiRequest
|
|
14471
15335
|
};
|
|
14472
|
-
//
|
|
14473
|
-
|
|
14474
|
-
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));
|
|
14475
15340
|
const response = await this.post(PROCESS_ENDPOINTS.START_PROCESS, requestBody, {
|
|
14476
15341
|
params: apiOptions,
|
|
14477
15342
|
headers
|
|
@@ -14499,8 +15364,8 @@ class ProcessService extends FolderScopedService {
|
|
|
14499
15364
|
*/
|
|
14500
15365
|
async getById(id, folderId, options = {}) {
|
|
14501
15366
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
14502
|
-
const
|
|
14503
|
-
const apiOptions = addPrefixToKeys(
|
|
15367
|
+
const apiFieldOptions = transformOptions(options, ProcessMap);
|
|
15368
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
14504
15369
|
const response = await this.get(PROCESS_ENDPOINTS.GET_BY_ID(id), {
|
|
14505
15370
|
headers,
|
|
14506
15371
|
params: apiOptions
|
|
@@ -14535,7 +15400,7 @@ class ProcessService extends FolderScopedService {
|
|
|
14535
15400
|
* ```
|
|
14536
15401
|
*/
|
|
14537
15402
|
async getByName(name, options = {}) {
|
|
14538
|
-
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);
|
|
14539
15404
|
}
|
|
14540
15405
|
}
|
|
14541
15406
|
__decorate([
|
|
@@ -14611,6 +15476,10 @@ class QueueService extends FolderScopedService {
|
|
|
14611
15476
|
async getAll(options) {
|
|
14612
15477
|
// Transformation function for queues
|
|
14613
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;
|
|
14614
15483
|
return PaginationHelpers.getAll({
|
|
14615
15484
|
serviceAccess: this.createPaginationServiceAccess(),
|
|
14616
15485
|
getEndpoint: (folderId) => folderId ? QUEUE_ENDPOINTS.GET_BY_FOLDER : QUEUE_ENDPOINTS.GET_ALL,
|
|
@@ -14626,7 +15495,7 @@ class QueueService extends FolderScopedService {
|
|
|
14626
15495
|
countParam: ODATA_OFFSET_PARAMS.COUNT_PARAM
|
|
14627
15496
|
}
|
|
14628
15497
|
}
|
|
14629
|
-
},
|
|
15498
|
+
}, apiOptions);
|
|
14630
15499
|
}
|
|
14631
15500
|
/**
|
|
14632
15501
|
* Gets a single queue by ID
|
|
@@ -14647,8 +15516,8 @@ class QueueService extends FolderScopedService {
|
|
|
14647
15516
|
*/
|
|
14648
15517
|
async getById(id, folderId, options = {}) {
|
|
14649
15518
|
const headers = createHeaders({ [FOLDER_ID]: folderId });
|
|
14650
|
-
const
|
|
14651
|
-
const apiOptions = addPrefixToKeys(
|
|
15519
|
+
const apiFieldOptions = transformOptions(options, QueueMap);
|
|
15520
|
+
const apiOptions = addPrefixToKeys(apiFieldOptions, ODATA_PREFIX, Object.keys(apiFieldOptions));
|
|
14652
15521
|
const response = await this.get(QUEUE_ENDPOINTS.GET_BY_ID(id), {
|
|
14653
15522
|
headers,
|
|
14654
15523
|
params: apiOptions
|
|
@@ -14743,7 +15612,19 @@ class UiPath extends UiPath$1 {
|
|
|
14743
15612
|
/**
|
|
14744
15613
|
* Access to ChoiceSet service for managing choice sets
|
|
14745
15614
|
*/
|
|
14746
|
-
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)
|
|
14747
15628
|
});
|
|
14748
15629
|
}
|
|
14749
15630
|
/**
|
|
@@ -15071,9 +15952,9 @@ exports.AgentListSortColumn = void 0;
|
|
|
15071
15952
|
AgentListSortColumn["HealthScore"] = "HealthScore";
|
|
15072
15953
|
AgentListSortColumn["LastIncident"] = "LastIncident";
|
|
15073
15954
|
AgentListSortColumn["FolderName"] = "FolderName";
|
|
15074
|
-
/** Quantity of
|
|
15955
|
+
/** Quantity of Agent Units consumed */
|
|
15075
15956
|
AgentListSortColumn["QuantityAGU"] = "QuantityAGU";
|
|
15076
|
-
/** Quantity of
|
|
15957
|
+
/** Quantity of Platform Units consumed */
|
|
15077
15958
|
AgentListSortColumn["QuantityPLTU"] = "QuantityPLTU";
|
|
15078
15959
|
AgentListSortColumn["FolderPath"] = "FolderPath";
|
|
15079
15960
|
})(exports.AgentListSortColumn || (exports.AgentListSortColumn = {}));
|
|
@@ -15095,6 +15976,30 @@ exports.AgentErrorSortColumn = void 0;
|
|
|
15095
15976
|
AgentErrorSortColumn["LastSeenFolderName"] = "LastSeenFolderName";
|
|
15096
15977
|
AgentErrorSortColumn["LastSeenFolderPath"] = "LastSeenFolderPath";
|
|
15097
15978
|
})(exports.AgentErrorSortColumn || (exports.AgentErrorSortColumn = {}));
|
|
15979
|
+
/**
|
|
15980
|
+
* Agent type, used to filter consumption results.
|
|
15981
|
+
*
|
|
15982
|
+
* Wire format is the string name, per the API's `StringEnumConverter` serialization.
|
|
15983
|
+
*/
|
|
15984
|
+
exports.AgentType = void 0;
|
|
15985
|
+
(function (AgentType) {
|
|
15986
|
+
AgentType["Autonomous"] = "Autonomous";
|
|
15987
|
+
AgentType["Conversational"] = "Conversational";
|
|
15988
|
+
AgentType["Coded"] = "Coded";
|
|
15989
|
+
})(exports.AgentType || (exports.AgentType = {}));
|
|
15990
|
+
/**
|
|
15991
|
+
* Job execution mode filter accepted by the summary endpoints.
|
|
15992
|
+
*
|
|
15993
|
+
* Wire format is the string name (`"Debug"` / `"Runtime"`), per the API's
|
|
15994
|
+
* `StringEnumConverter` serialization.
|
|
15995
|
+
*/
|
|
15996
|
+
exports.AgentExecutionType = void 0;
|
|
15997
|
+
(function (AgentExecutionType) {
|
|
15998
|
+
/** Test runs */
|
|
15999
|
+
AgentExecutionType["Debug"] = "Debug";
|
|
16000
|
+
/** Production runs */
|
|
16001
|
+
AgentExecutionType["Runtime"] = "Runtime";
|
|
16002
|
+
})(exports.AgentExecutionType || (exports.AgentExecutionType = {}));
|
|
15098
16003
|
|
|
15099
16004
|
/**
|
|
15100
16005
|
* Types for the Agent Memory metrics service.
|
|
@@ -15479,6 +16384,52 @@ exports.SpanAttachmentDirection = void 0;
|
|
|
15479
16384
|
SpanAttachmentDirection["Out"] = "Out";
|
|
15480
16385
|
})(exports.SpanAttachmentDirection || (exports.SpanAttachmentDirection = {}));
|
|
15481
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
|
+
|
|
15482
16433
|
/**
|
|
15483
16434
|
* Asset resolution utilities for UiPath Coded Apps
|
|
15484
16435
|
*
|