@uipath/uipath-typescript 1.4.0 → 1.4.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/dist/agent-memory/index.cjs +16 -9
- package/dist/agent-memory/index.mjs +16 -9
- package/dist/agents/index.cjs +278 -9
- package/dist/agents/index.d.ts +465 -6
- package/dist/agents/index.mjs +279 -10
- package/dist/assets/index.cjs +16 -9
- package/dist/assets/index.mjs +16 -9
- package/dist/attachments/index.cjs +16 -9
- package/dist/attachments/index.mjs +16 -9
- package/dist/buckets/index.cjs +114 -124
- package/dist/buckets/index.d.ts +197 -84
- package/dist/buckets/index.mjs +114 -124
- package/dist/cases/index.cjs +79 -13
- package/dist/cases/index.d.ts +30 -3
- package/dist/cases/index.mjs +79 -13
- package/dist/conversational-agent/index.cjs +16 -9
- package/dist/conversational-agent/index.mjs +16 -9
- package/dist/core/index.cjs +35 -6
- package/dist/core/index.mjs +35 -6
- package/dist/entities/index.cjs +253 -69
- package/dist/entities/index.d.ts +343 -116
- package/dist/entities/index.mjs +253 -69
- package/dist/feedback/index.cjs +16 -9
- package/dist/feedback/index.mjs +16 -9
- package/dist/governance/index.cjs +16 -9
- package/dist/governance/index.mjs +16 -9
- package/dist/index.cjs +529 -193
- package/dist/index.d.ts +2141 -750
- package/dist/index.mjs +529 -194
- package/dist/index.umd.js +529 -193
- package/dist/jobs/index.cjs +16 -9
- package/dist/jobs/index.mjs +16 -9
- package/dist/maestro-processes/index.cjs +16 -9
- package/dist/maestro-processes/index.mjs +16 -9
- package/dist/orchestrator-du-module/index.cjs +1788 -0
- package/dist/orchestrator-du-module/index.d.ts +757 -0
- package/dist/orchestrator-du-module/index.mjs +1785 -0
- package/dist/processes/index.cjs +16 -9
- package/dist/processes/index.mjs +16 -9
- package/dist/queues/index.cjs +16 -9
- package/dist/queues/index.mjs +16 -9
- package/dist/tasks/index.cjs +79 -13
- package/dist/tasks/index.d.ts +109 -4
- package/dist/tasks/index.mjs +80 -14
- package/dist/traces/index.cjs +303 -9
- package/dist/traces/index.d.ts +482 -2
- package/dist/traces/index.mjs +302 -10
- package/package.json +11 -1
|
@@ -1123,12 +1123,18 @@ class PaginationHelpers {
|
|
|
1123
1123
|
* @returns Promise resolving to a paginated result
|
|
1124
1124
|
*/
|
|
1125
1125
|
static async getAllPaginated(params) {
|
|
1126
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1126
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1127
1127
|
const endpoint = getEndpoint(folderId);
|
|
1128
1128
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1129
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1130
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1131
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1132
|
+
const requestSpec = isPost
|
|
1133
|
+
? { body: additionalParams, params: queryParams }
|
|
1134
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1129
1135
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1130
1136
|
headers,
|
|
1131
|
-
|
|
1137
|
+
...requestSpec,
|
|
1132
1138
|
pagination: {
|
|
1133
1139
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1134
1140
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1153,7 +1159,7 @@ class PaginationHelpers {
|
|
|
1153
1159
|
* @returns Promise resolving to an object with data and totalCount
|
|
1154
1160
|
*/
|
|
1155
1161
|
static async getAllNonPaginated(params) {
|
|
1156
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1162
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1157
1163
|
// Set default field names
|
|
1158
1164
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1159
1165
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1163,11 +1169,11 @@ class PaginationHelpers {
|
|
|
1163
1169
|
// Make the API call based on method
|
|
1164
1170
|
let response;
|
|
1165
1171
|
if (method === HTTP_METHODS.POST) {
|
|
1166
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1172
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1167
1173
|
}
|
|
1168
1174
|
else {
|
|
1169
1175
|
response = await serviceAccess.get(endpoint, {
|
|
1170
|
-
params: additionalParams,
|
|
1176
|
+
params: { ...additionalParams, ...queryParams },
|
|
1171
1177
|
headers
|
|
1172
1178
|
});
|
|
1173
1179
|
}
|
|
@@ -1222,6 +1228,7 @@ class PaginationHelpers {
|
|
|
1222
1228
|
headers: config.headers,
|
|
1223
1229
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1224
1230
|
additionalParams: prefixedOptions,
|
|
1231
|
+
queryParams: config.queryParams,
|
|
1225
1232
|
transformFn: config.transformFn,
|
|
1226
1233
|
method: config.method,
|
|
1227
1234
|
options: {
|
|
@@ -1239,6 +1246,7 @@ class PaginationHelpers {
|
|
|
1239
1246
|
folderId,
|
|
1240
1247
|
headers: config.headers,
|
|
1241
1248
|
additionalParams: prefixedOptions,
|
|
1249
|
+
queryParams: config.queryParams,
|
|
1242
1250
|
transformFn: config.transformFn,
|
|
1243
1251
|
method: config.method,
|
|
1244
1252
|
options: {
|
|
@@ -1430,18 +1438,17 @@ class BaseService {
|
|
|
1430
1438
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1431
1439
|
// Prepare request parameters based on pagination type
|
|
1432
1440
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1433
|
-
//
|
|
1441
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1442
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1443
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1434
1444
|
if (method.toUpperCase() === 'POST') {
|
|
1435
1445
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1436
1446
|
options.body = {
|
|
1437
1447
|
...existingBody,
|
|
1438
|
-
...options.params,
|
|
1439
1448
|
...requestParams
|
|
1440
1449
|
};
|
|
1441
|
-
options.params = undefined;
|
|
1442
1450
|
}
|
|
1443
1451
|
else {
|
|
1444
|
-
// Merge pagination parameters with existing parameters
|
|
1445
1452
|
options.params = {
|
|
1446
1453
|
...options.params,
|
|
1447
1454
|
...requestParams
|
|
@@ -1121,12 +1121,18 @@ class PaginationHelpers {
|
|
|
1121
1121
|
* @returns Promise resolving to a paginated result
|
|
1122
1122
|
*/
|
|
1123
1123
|
static async getAllPaginated(params) {
|
|
1124
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1124
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1125
1125
|
const endpoint = getEndpoint(folderId);
|
|
1126
1126
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1127
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1128
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1129
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1130
|
+
const requestSpec = isPost
|
|
1131
|
+
? { body: additionalParams, params: queryParams }
|
|
1132
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1127
1133
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1128
1134
|
headers,
|
|
1129
|
-
|
|
1135
|
+
...requestSpec,
|
|
1130
1136
|
pagination: {
|
|
1131
1137
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1132
1138
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1151,7 +1157,7 @@ class PaginationHelpers {
|
|
|
1151
1157
|
* @returns Promise resolving to an object with data and totalCount
|
|
1152
1158
|
*/
|
|
1153
1159
|
static async getAllNonPaginated(params) {
|
|
1154
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1160
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1155
1161
|
// Set default field names
|
|
1156
1162
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1157
1163
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1161,11 +1167,11 @@ class PaginationHelpers {
|
|
|
1161
1167
|
// Make the API call based on method
|
|
1162
1168
|
let response;
|
|
1163
1169
|
if (method === HTTP_METHODS.POST) {
|
|
1164
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1170
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1165
1171
|
}
|
|
1166
1172
|
else {
|
|
1167
1173
|
response = await serviceAccess.get(endpoint, {
|
|
1168
|
-
params: additionalParams,
|
|
1174
|
+
params: { ...additionalParams, ...queryParams },
|
|
1169
1175
|
headers
|
|
1170
1176
|
});
|
|
1171
1177
|
}
|
|
@@ -1220,6 +1226,7 @@ class PaginationHelpers {
|
|
|
1220
1226
|
headers: config.headers,
|
|
1221
1227
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1222
1228
|
additionalParams: prefixedOptions,
|
|
1229
|
+
queryParams: config.queryParams,
|
|
1223
1230
|
transformFn: config.transformFn,
|
|
1224
1231
|
method: config.method,
|
|
1225
1232
|
options: {
|
|
@@ -1237,6 +1244,7 @@ class PaginationHelpers {
|
|
|
1237
1244
|
folderId,
|
|
1238
1245
|
headers: config.headers,
|
|
1239
1246
|
additionalParams: prefixedOptions,
|
|
1247
|
+
queryParams: config.queryParams,
|
|
1240
1248
|
transformFn: config.transformFn,
|
|
1241
1249
|
method: config.method,
|
|
1242
1250
|
options: {
|
|
@@ -1428,18 +1436,17 @@ class BaseService {
|
|
|
1428
1436
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1429
1437
|
// Prepare request parameters based on pagination type
|
|
1430
1438
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1431
|
-
//
|
|
1439
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1440
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1441
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1432
1442
|
if (method.toUpperCase() === 'POST') {
|
|
1433
1443
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1434
1444
|
options.body = {
|
|
1435
1445
|
...existingBody,
|
|
1436
|
-
...options.params,
|
|
1437
1446
|
...requestParams
|
|
1438
1447
|
};
|
|
1439
|
-
options.params = undefined;
|
|
1440
1448
|
}
|
|
1441
1449
|
else {
|
|
1442
|
-
// Merge pagination parameters with existing parameters
|
|
1443
1450
|
options.params = {
|
|
1444
1451
|
...options.params,
|
|
1445
1452
|
...requestParams
|
package/dist/agents/index.cjs
CHANGED
|
@@ -939,6 +939,17 @@ const AGENTS_OFFSET_PARAMS = {
|
|
|
939
939
|
/** No count param needed */
|
|
940
940
|
COUNT_PARAM: undefined
|
|
941
941
|
};
|
|
942
|
+
/**
|
|
943
|
+
* Agents incidents pagination constants — the items array is the `data` field
|
|
944
|
+
* itself, total count is nested under the response envelope. Reuses
|
|
945
|
+
* AGENTS_OFFSET_PARAMS for request params (same 0-based page-number style).
|
|
946
|
+
*/
|
|
947
|
+
const AGENTS_INCIDENTS_PAGINATION = {
|
|
948
|
+
/** Dotted path to the items array in the incidents response envelope */
|
|
949
|
+
ITEMS_FIELD: 'data',
|
|
950
|
+
/** Total count path — same envelope location as the agents list. */
|
|
951
|
+
TOTAL_COUNT_FIELD: AGENTS_PAGINATION.TOTAL_COUNT_FIELD
|
|
952
|
+
};
|
|
942
953
|
/**
|
|
943
954
|
* OData OFFSET pagination parameter names (ODATA-style)
|
|
944
955
|
*/
|
|
@@ -1143,12 +1154,18 @@ class PaginationHelpers {
|
|
|
1143
1154
|
* @returns Promise resolving to a paginated result
|
|
1144
1155
|
*/
|
|
1145
1156
|
static async getAllPaginated(params) {
|
|
1146
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1157
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1147
1158
|
const endpoint = getEndpoint(folderId);
|
|
1148
1159
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1160
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1161
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1162
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1163
|
+
const requestSpec = isPost
|
|
1164
|
+
? { body: additionalParams, params: queryParams }
|
|
1165
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1149
1166
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1150
1167
|
headers,
|
|
1151
|
-
|
|
1168
|
+
...requestSpec,
|
|
1152
1169
|
pagination: {
|
|
1153
1170
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1154
1171
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1173,7 +1190,7 @@ class PaginationHelpers {
|
|
|
1173
1190
|
* @returns Promise resolving to an object with data and totalCount
|
|
1174
1191
|
*/
|
|
1175
1192
|
static async getAllNonPaginated(params) {
|
|
1176
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1193
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1177
1194
|
// Set default field names
|
|
1178
1195
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1179
1196
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1183,11 +1200,11 @@ class PaginationHelpers {
|
|
|
1183
1200
|
// Make the API call based on method
|
|
1184
1201
|
let response;
|
|
1185
1202
|
if (method === HTTP_METHODS.POST) {
|
|
1186
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1203
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1187
1204
|
}
|
|
1188
1205
|
else {
|
|
1189
1206
|
response = await serviceAccess.get(endpoint, {
|
|
1190
|
-
params: additionalParams,
|
|
1207
|
+
params: { ...additionalParams, ...queryParams },
|
|
1191
1208
|
headers
|
|
1192
1209
|
});
|
|
1193
1210
|
}
|
|
@@ -1242,6 +1259,7 @@ class PaginationHelpers {
|
|
|
1242
1259
|
headers: config.headers,
|
|
1243
1260
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1244
1261
|
additionalParams: prefixedOptions,
|
|
1262
|
+
queryParams: config.queryParams,
|
|
1245
1263
|
transformFn: config.transformFn,
|
|
1246
1264
|
method: config.method,
|
|
1247
1265
|
options: {
|
|
@@ -1259,6 +1277,7 @@ class PaginationHelpers {
|
|
|
1259
1277
|
folderId,
|
|
1260
1278
|
headers: config.headers,
|
|
1261
1279
|
additionalParams: prefixedOptions,
|
|
1280
|
+
queryParams: config.queryParams,
|
|
1262
1281
|
transformFn: config.transformFn,
|
|
1263
1282
|
method: config.method,
|
|
1264
1283
|
options: {
|
|
@@ -1450,18 +1469,17 @@ class BaseService {
|
|
|
1450
1469
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1451
1470
|
// Prepare request parameters based on pagination type
|
|
1452
1471
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1453
|
-
//
|
|
1472
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1473
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1474
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1454
1475
|
if (method.toUpperCase() === 'POST') {
|
|
1455
1476
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1456
1477
|
options.body = {
|
|
1457
1478
|
...existingBody,
|
|
1458
|
-
...options.params,
|
|
1459
1479
|
...requestParams
|
|
1460
1480
|
};
|
|
1461
|
-
options.params = undefined;
|
|
1462
1481
|
}
|
|
1463
1482
|
else {
|
|
1464
|
-
// Merge pagination parameters with existing parameters
|
|
1465
1483
|
options.params = {
|
|
1466
1484
|
...options.params,
|
|
1467
1485
|
...requestParams
|
|
@@ -1597,6 +1615,14 @@ const INSIGHTS_RTM_BASE = 'insightsrtm_';
|
|
|
1597
1615
|
const AGENTS_ENDPOINTS = {
|
|
1598
1616
|
/** Paginated list of agents with consumption and health metadata. */
|
|
1599
1617
|
GET_AGENTS: `${INSIGHTS_RTM_BASE}/Agents/agents`,
|
|
1618
|
+
/** Paginated list of agent incidents (errors) over the requested window. */
|
|
1619
|
+
GET_INCIDENTS: `${INSIGHTS_RTM_BASE}/Agents/incidents`,
|
|
1620
|
+
/** Time-series of error counts grouped by agent over the requested window. */
|
|
1621
|
+
GET_ERRORS_TIMELINE: `${INSIGHTS_RTM_BASE}/Agents/errors`,
|
|
1622
|
+
/** Time-series of AGU consumption over the requested window. */
|
|
1623
|
+
GET_CONSUMPTION_TIMELINE: `${INSIGHTS_RTM_BASE}/Agents/consumptionTimeline`,
|
|
1624
|
+
/** Time-series of agent latency (per-percentile) over the requested window. */
|
|
1625
|
+
GET_LATENCY_TIMELINE: `${INSIGHTS_RTM_BASE}/Agents/latencyTimeline`,
|
|
1600
1626
|
};
|
|
1601
1627
|
|
|
1602
1628
|
/**
|
|
@@ -1700,10 +1726,235 @@ class AgentService extends BaseService {
|
|
|
1700
1726
|
},
|
|
1701
1727
|
}, apiOptions);
|
|
1702
1728
|
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Retrieves agent errors (error-classes observed for agents) over the
|
|
1731
|
+
* requested window.
|
|
1732
|
+
*
|
|
1733
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
1734
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
1735
|
+
* {@link NonPaginatedResponse}.
|
|
1736
|
+
*
|
|
1737
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1738
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
1739
|
+
* @param options - Optional pagination, sort/group, and filters
|
|
1740
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentError}
|
|
1741
|
+
* @example
|
|
1742
|
+
* ```typescript
|
|
1743
|
+
* import { Agents, AgentErrorSortColumn } from '@uipath/uipath-typescript/agents';
|
|
1744
|
+
*
|
|
1745
|
+
* const agents = new Agents(sdk);
|
|
1746
|
+
*
|
|
1747
|
+
* // Non-paginated — errors in the window
|
|
1748
|
+
* const result = await agents.getErrors(
|
|
1749
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1750
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
1751
|
+
* );
|
|
1752
|
+
* result.items.forEach((error) => {
|
|
1753
|
+
* console.log(`${error.type}: ${error.description} (count=${error.count})`);
|
|
1754
|
+
* });
|
|
1755
|
+
*
|
|
1756
|
+
* // Paginated — sorted by execution count descending
|
|
1757
|
+
* const page = await agents.getErrors(
|
|
1758
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1759
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
1760
|
+
* {
|
|
1761
|
+
* pageSize: 25,
|
|
1762
|
+
* orderBy: { column: AgentErrorSortColumn.ExecutionCount, desc: true },
|
|
1763
|
+
* },
|
|
1764
|
+
* );
|
|
1765
|
+
*
|
|
1766
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
1767
|
+
* const next = await agents.getErrors(
|
|
1768
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1769
|
+
* new Date('2026-05-14T00:00:00Z'),
|
|
1770
|
+
* { cursor: page.nextCursor },
|
|
1771
|
+
* );
|
|
1772
|
+
* }
|
|
1773
|
+
* ```
|
|
1774
|
+
*/
|
|
1775
|
+
async getErrors(startTime, endTime, options) {
|
|
1776
|
+
const apiOptions = { ...options, startTime: startTime.toISOString(), endTime: endTime.toISOString() };
|
|
1777
|
+
return PaginationHelpers.getAll({
|
|
1778
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
1779
|
+
getEndpoint: () => AGENTS_ENDPOINTS.GET_INCIDENTS,
|
|
1780
|
+
method: HTTP_METHODS.POST,
|
|
1781
|
+
excludeFromPrefix: Object.keys(apiOptions),
|
|
1782
|
+
pagination: {
|
|
1783
|
+
paginationType: PaginationType.OFFSET,
|
|
1784
|
+
itemsField: AGENTS_INCIDENTS_PAGINATION.ITEMS_FIELD,
|
|
1785
|
+
totalCountField: AGENTS_INCIDENTS_PAGINATION.TOTAL_COUNT_FIELD,
|
|
1786
|
+
paginationParams: {
|
|
1787
|
+
pageSizeParam: AGENTS_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
1788
|
+
offsetParam: AGENTS_OFFSET_PARAMS.OFFSET_PARAM,
|
|
1789
|
+
countParam: AGENTS_OFFSET_PARAMS.COUNT_PARAM,
|
|
1790
|
+
convertToSkip: false,
|
|
1791
|
+
zeroBased: true,
|
|
1792
|
+
},
|
|
1793
|
+
},
|
|
1794
|
+
}, apiOptions);
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Retrieves a time-series of error counts grouped by agent over the requested window.
|
|
1798
|
+
*
|
|
1799
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1800
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
1801
|
+
* @param options - Optional filters
|
|
1802
|
+
* @returns Promise resolving to an array of {@link AgentGetErrorsTimelineResponse}
|
|
1803
|
+
* @example
|
|
1804
|
+
* ```typescript
|
|
1805
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
1806
|
+
*
|
|
1807
|
+
* const agents = new Agents(sdk);
|
|
1808
|
+
*
|
|
1809
|
+
* // All errors in May 2025
|
|
1810
|
+
* const result = await agents.getErrorsTimeline(
|
|
1811
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1812
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
1813
|
+
* );
|
|
1814
|
+
* result.forEach((point) => {
|
|
1815
|
+
* console.log(`${point.date} ${point.name}: ${point.value} errors`);
|
|
1816
|
+
* });
|
|
1817
|
+
* ```
|
|
1818
|
+
* @example
|
|
1819
|
+
* ```typescript
|
|
1820
|
+
* // Scope to specific folders and top 5 agents
|
|
1821
|
+
* const result = await agents.getErrorsTimeline(
|
|
1822
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1823
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
1824
|
+
* {
|
|
1825
|
+
* folderKeys: ['<folderKey1>'],
|
|
1826
|
+
* agentNames: ['JokeAgent', 'StoryAgent'],
|
|
1827
|
+
* limit: 5,
|
|
1828
|
+
* },
|
|
1829
|
+
* );
|
|
1830
|
+
* ```
|
|
1831
|
+
*/
|
|
1832
|
+
async getErrorsTimeline(startTime, endTime, options) {
|
|
1833
|
+
const body = this.buildAgentFilterBody(startTime, endTime, options);
|
|
1834
|
+
const response = await this.post(AGENTS_ENDPOINTS.GET_ERRORS_TIMELINE, body);
|
|
1835
|
+
return response.data.data;
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Retrieves a time-series of AGU (Agent Units) consumption over the requested window.
|
|
1839
|
+
*
|
|
1840
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1841
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
1842
|
+
* @param options - Optional filters
|
|
1843
|
+
* @returns Promise resolving to an array of {@link AgentGetConsumptionTimelineResponse}
|
|
1844
|
+
* @example
|
|
1845
|
+
* ```typescript
|
|
1846
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
1847
|
+
*
|
|
1848
|
+
* const agents = new Agents(sdk);
|
|
1849
|
+
*
|
|
1850
|
+
* // AGU consumption timeline in May 2025
|
|
1851
|
+
* const result = await agents.getConsumptionTimeline(
|
|
1852
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1853
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
1854
|
+
* );
|
|
1855
|
+
* result.forEach((point) => {
|
|
1856
|
+
* console.log(`${point.timeSlice}: ${point.aguConsumption} AGU`);
|
|
1857
|
+
* });
|
|
1858
|
+
* ```
|
|
1859
|
+
* @example
|
|
1860
|
+
* ```typescript
|
|
1861
|
+
* // Scope to specific folders and agents
|
|
1862
|
+
* const result = await agents.getConsumptionTimeline(
|
|
1863
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1864
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
1865
|
+
* {
|
|
1866
|
+
* folderKeys: ['<folderKey1>'],
|
|
1867
|
+
* agentNames: ['JokeAgent'],
|
|
1868
|
+
* },
|
|
1869
|
+
* );
|
|
1870
|
+
* ```
|
|
1871
|
+
*/
|
|
1872
|
+
async getConsumptionTimeline(startTime, endTime, options) {
|
|
1873
|
+
const body = this.buildAgentFilterBody(startTime, endTime, options);
|
|
1874
|
+
const response = await this.post(AGENTS_ENDPOINTS.GET_CONSUMPTION_TIMELINE, body);
|
|
1875
|
+
return response.data.data;
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* Retrieves a time-series of agent latency (milliseconds) over the requested
|
|
1879
|
+
* window.
|
|
1880
|
+
*
|
|
1881
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1882
|
+
* @param endTime - Exclusive upper bound for the query window
|
|
1883
|
+
* @param options - Optional filters
|
|
1884
|
+
* @returns Promise resolving to an array of {@link AgentGetLatencyTimelineResponse}
|
|
1885
|
+
* @example
|
|
1886
|
+
* ```typescript
|
|
1887
|
+
* import { Agents } from '@uipath/uipath-typescript/agents';
|
|
1888
|
+
*
|
|
1889
|
+
* const agents = new Agents(sdk);
|
|
1890
|
+
*
|
|
1891
|
+
* // Latency timeline in May 2025
|
|
1892
|
+
* const result = await agents.getLatencyTimeline(
|
|
1893
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1894
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
1895
|
+
* );
|
|
1896
|
+
* result.forEach((point) => {
|
|
1897
|
+
* console.log(`${point.date} ${point.name}: ${point.value} ms`);
|
|
1898
|
+
* });
|
|
1899
|
+
* ```
|
|
1900
|
+
* @example
|
|
1901
|
+
* ```typescript
|
|
1902
|
+
* // Scope to specific folders and a single agent
|
|
1903
|
+
* const result = await agents.getLatencyTimeline(
|
|
1904
|
+
* new Date('2025-05-01T00:00:00Z'),
|
|
1905
|
+
* new Date('2025-06-01T00:00:00Z'),
|
|
1906
|
+
* {
|
|
1907
|
+
* folderKeys: ['<folderKey1>'],
|
|
1908
|
+
* agentId: '<agentId>',
|
|
1909
|
+
* },
|
|
1910
|
+
* );
|
|
1911
|
+
* ```
|
|
1912
|
+
*/
|
|
1913
|
+
async getLatencyTimeline(startTime, endTime, options) {
|
|
1914
|
+
const body = this.buildAgentFilterBody(startTime, endTime, options);
|
|
1915
|
+
const response = await this.post(AGENTS_ENDPOINTS.GET_LATENCY_TIMELINE, body);
|
|
1916
|
+
return response.data.data;
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Builds the common POST request body shared by the agent filter endpoints —
|
|
1920
|
+
* the required time window plus any optional folder/agent/project/process
|
|
1921
|
+
* filters. Undefined options are omitted so the server applies its defaults.
|
|
1922
|
+
*/
|
|
1923
|
+
buildAgentFilterBody(startTime, endTime, options) {
|
|
1924
|
+
const body = {
|
|
1925
|
+
startTime: startTime.toISOString(),
|
|
1926
|
+
endTime: endTime.toISOString(),
|
|
1927
|
+
};
|
|
1928
|
+
if (options?.folderKeys !== undefined)
|
|
1929
|
+
body.folderKeys = options.folderKeys;
|
|
1930
|
+
if (options?.agentNames !== undefined)
|
|
1931
|
+
body.agentNames = options.agentNames;
|
|
1932
|
+
if (options?.projectKeys !== undefined)
|
|
1933
|
+
body.projectKeys = options.projectKeys;
|
|
1934
|
+
if (options?.agentId !== undefined)
|
|
1935
|
+
body.agentId = options.agentId;
|
|
1936
|
+
if (options?.processVersion !== undefined)
|
|
1937
|
+
body.processVersion = options.processVersion;
|
|
1938
|
+
if (options?.limit !== undefined)
|
|
1939
|
+
body.limit = options.limit;
|
|
1940
|
+
return body;
|
|
1941
|
+
}
|
|
1703
1942
|
}
|
|
1704
1943
|
__decorate([
|
|
1705
1944
|
track('Agents.GetAll')
|
|
1706
1945
|
], AgentService.prototype, "getAll", null);
|
|
1946
|
+
__decorate([
|
|
1947
|
+
track('Agents.GetErrors')
|
|
1948
|
+
], AgentService.prototype, "getErrors", null);
|
|
1949
|
+
__decorate([
|
|
1950
|
+
track('Agents.GetErrorsTimeline')
|
|
1951
|
+
], AgentService.prototype, "getErrorsTimeline", null);
|
|
1952
|
+
__decorate([
|
|
1953
|
+
track('Agents.GetConsumptionTimeline')
|
|
1954
|
+
], AgentService.prototype, "getConsumptionTimeline", null);
|
|
1955
|
+
__decorate([
|
|
1956
|
+
track('Agents.GetLatencyTimeline')
|
|
1957
|
+
], AgentService.prototype, "getLatencyTimeline", null);
|
|
1707
1958
|
|
|
1708
1959
|
/**
|
|
1709
1960
|
* Columns available for ordering results.
|
|
@@ -1722,5 +1973,23 @@ exports.AgentListSortColumn = void 0;
|
|
|
1722
1973
|
AgentListSortColumn["QuantityPLTU"] = "QuantityPLTU";
|
|
1723
1974
|
AgentListSortColumn["FolderPath"] = "FolderPath";
|
|
1724
1975
|
})(exports.AgentListSortColumn || (exports.AgentListSortColumn = {}));
|
|
1976
|
+
/**
|
|
1977
|
+
* Columns available for ordering / grouping the agent errors list.
|
|
1978
|
+
*/
|
|
1979
|
+
exports.AgentErrorSortColumn = void 0;
|
|
1980
|
+
(function (AgentErrorSortColumn) {
|
|
1981
|
+
AgentErrorSortColumn["AgentId"] = "AgentId";
|
|
1982
|
+
AgentErrorSortColumn["AgentName"] = "AgentName";
|
|
1983
|
+
AgentErrorSortColumn["ParentProcessName"] = "ParentProcessName";
|
|
1984
|
+
AgentErrorSortColumn["ErrorTitle"] = "ErrorTitle";
|
|
1985
|
+
AgentErrorSortColumn["FirstSeenStartTime"] = "FirstSeenStartTime";
|
|
1986
|
+
AgentErrorSortColumn["ExecutionCount"] = "ExecutionCount";
|
|
1987
|
+
AgentErrorSortColumn["Type"] = "Type";
|
|
1988
|
+
AgentErrorSortColumn["FirstSeenFolderName"] = "FirstSeenFolderName";
|
|
1989
|
+
AgentErrorSortColumn["FirstSeenFolderPath"] = "FirstSeenFolderPath";
|
|
1990
|
+
AgentErrorSortColumn["LastSeenStartTime"] = "LastSeenStartTime";
|
|
1991
|
+
AgentErrorSortColumn["LastSeenFolderName"] = "LastSeenFolderName";
|
|
1992
|
+
AgentErrorSortColumn["LastSeenFolderPath"] = "LastSeenFolderPath";
|
|
1993
|
+
})(exports.AgentErrorSortColumn || (exports.AgentErrorSortColumn = {}));
|
|
1725
1994
|
|
|
1726
1995
|
exports.Agents = AgentService;
|