@uipath/uipath-typescript 1.4.0 → 1.4.2
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/document-understanding/index.cjs +84 -84
- package/dist/document-understanding/index.d.ts +2 -1
- package/dist/document-understanding/index.mjs +1 -1
- 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
package/dist/processes/index.cjs
CHANGED
|
@@ -1321,12 +1321,18 @@ class PaginationHelpers {
|
|
|
1321
1321
|
* @returns Promise resolving to a paginated result
|
|
1322
1322
|
*/
|
|
1323
1323
|
static async getAllPaginated(params) {
|
|
1324
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1324
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1325
1325
|
const endpoint = getEndpoint(folderId);
|
|
1326
1326
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1327
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1328
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1329
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1330
|
+
const requestSpec = isPost
|
|
1331
|
+
? { body: additionalParams, params: queryParams }
|
|
1332
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1327
1333
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1328
1334
|
headers,
|
|
1329
|
-
|
|
1335
|
+
...requestSpec,
|
|
1330
1336
|
pagination: {
|
|
1331
1337
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1332
1338
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1351,7 +1357,7 @@ class PaginationHelpers {
|
|
|
1351
1357
|
* @returns Promise resolving to an object with data and totalCount
|
|
1352
1358
|
*/
|
|
1353
1359
|
static async getAllNonPaginated(params) {
|
|
1354
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1360
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1355
1361
|
// Set default field names
|
|
1356
1362
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1357
1363
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1361,11 +1367,11 @@ class PaginationHelpers {
|
|
|
1361
1367
|
// Make the API call based on method
|
|
1362
1368
|
let response;
|
|
1363
1369
|
if (method === HTTP_METHODS.POST) {
|
|
1364
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1370
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1365
1371
|
}
|
|
1366
1372
|
else {
|
|
1367
1373
|
response = await serviceAccess.get(endpoint, {
|
|
1368
|
-
params: additionalParams,
|
|
1374
|
+
params: { ...additionalParams, ...queryParams },
|
|
1369
1375
|
headers
|
|
1370
1376
|
});
|
|
1371
1377
|
}
|
|
@@ -1420,6 +1426,7 @@ class PaginationHelpers {
|
|
|
1420
1426
|
headers: config.headers,
|
|
1421
1427
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1422
1428
|
additionalParams: prefixedOptions,
|
|
1429
|
+
queryParams: config.queryParams,
|
|
1423
1430
|
transformFn: config.transformFn,
|
|
1424
1431
|
method: config.method,
|
|
1425
1432
|
options: {
|
|
@@ -1437,6 +1444,7 @@ class PaginationHelpers {
|
|
|
1437
1444
|
folderId,
|
|
1438
1445
|
headers: config.headers,
|
|
1439
1446
|
additionalParams: prefixedOptions,
|
|
1447
|
+
queryParams: config.queryParams,
|
|
1440
1448
|
transformFn: config.transformFn,
|
|
1441
1449
|
method: config.method,
|
|
1442
1450
|
options: {
|
|
@@ -1628,18 +1636,17 @@ class BaseService {
|
|
|
1628
1636
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1629
1637
|
// Prepare request parameters based on pagination type
|
|
1630
1638
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1631
|
-
//
|
|
1639
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1640
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1641
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1632
1642
|
if (method.toUpperCase() === 'POST') {
|
|
1633
1643
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1634
1644
|
options.body = {
|
|
1635
1645
|
...existingBody,
|
|
1636
|
-
...options.params,
|
|
1637
1646
|
...requestParams
|
|
1638
1647
|
};
|
|
1639
|
-
options.params = undefined;
|
|
1640
1648
|
}
|
|
1641
1649
|
else {
|
|
1642
|
-
// Merge pagination parameters with existing parameters
|
|
1643
1650
|
options.params = {
|
|
1644
1651
|
...options.params,
|
|
1645
1652
|
...requestParams
|
package/dist/processes/index.mjs
CHANGED
|
@@ -1319,12 +1319,18 @@ class PaginationHelpers {
|
|
|
1319
1319
|
* @returns Promise resolving to a paginated result
|
|
1320
1320
|
*/
|
|
1321
1321
|
static async getAllPaginated(params) {
|
|
1322
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1322
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1323
1323
|
const endpoint = getEndpoint(folderId);
|
|
1324
1324
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1325
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1326
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1327
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1328
|
+
const requestSpec = isPost
|
|
1329
|
+
? { body: additionalParams, params: queryParams }
|
|
1330
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1325
1331
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1326
1332
|
headers,
|
|
1327
|
-
|
|
1333
|
+
...requestSpec,
|
|
1328
1334
|
pagination: {
|
|
1329
1335
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1330
1336
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1349,7 +1355,7 @@ class PaginationHelpers {
|
|
|
1349
1355
|
* @returns Promise resolving to an object with data and totalCount
|
|
1350
1356
|
*/
|
|
1351
1357
|
static async getAllNonPaginated(params) {
|
|
1352
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1358
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1353
1359
|
// Set default field names
|
|
1354
1360
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1355
1361
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1359,11 +1365,11 @@ class PaginationHelpers {
|
|
|
1359
1365
|
// Make the API call based on method
|
|
1360
1366
|
let response;
|
|
1361
1367
|
if (method === HTTP_METHODS.POST) {
|
|
1362
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1368
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1363
1369
|
}
|
|
1364
1370
|
else {
|
|
1365
1371
|
response = await serviceAccess.get(endpoint, {
|
|
1366
|
-
params: additionalParams,
|
|
1372
|
+
params: { ...additionalParams, ...queryParams },
|
|
1367
1373
|
headers
|
|
1368
1374
|
});
|
|
1369
1375
|
}
|
|
@@ -1418,6 +1424,7 @@ class PaginationHelpers {
|
|
|
1418
1424
|
headers: config.headers,
|
|
1419
1425
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1420
1426
|
additionalParams: prefixedOptions,
|
|
1427
|
+
queryParams: config.queryParams,
|
|
1421
1428
|
transformFn: config.transformFn,
|
|
1422
1429
|
method: config.method,
|
|
1423
1430
|
options: {
|
|
@@ -1435,6 +1442,7 @@ class PaginationHelpers {
|
|
|
1435
1442
|
folderId,
|
|
1436
1443
|
headers: config.headers,
|
|
1437
1444
|
additionalParams: prefixedOptions,
|
|
1445
|
+
queryParams: config.queryParams,
|
|
1438
1446
|
transformFn: config.transformFn,
|
|
1439
1447
|
method: config.method,
|
|
1440
1448
|
options: {
|
|
@@ -1626,18 +1634,17 @@ class BaseService {
|
|
|
1626
1634
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1627
1635
|
// Prepare request parameters based on pagination type
|
|
1628
1636
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1629
|
-
//
|
|
1637
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1638
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1639
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1630
1640
|
if (method.toUpperCase() === 'POST') {
|
|
1631
1641
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1632
1642
|
options.body = {
|
|
1633
1643
|
...existingBody,
|
|
1634
|
-
...options.params,
|
|
1635
1644
|
...requestParams
|
|
1636
1645
|
};
|
|
1637
|
-
options.params = undefined;
|
|
1638
1646
|
}
|
|
1639
1647
|
else {
|
|
1640
|
-
// Merge pagination parameters with existing parameters
|
|
1641
1648
|
options.params = {
|
|
1642
1649
|
...options.params,
|
|
1643
1650
|
...requestParams
|
package/dist/queues/index.cjs
CHANGED
|
@@ -1258,12 +1258,18 @@ class PaginationHelpers {
|
|
|
1258
1258
|
* @returns Promise resolving to a paginated result
|
|
1259
1259
|
*/
|
|
1260
1260
|
static async getAllPaginated(params) {
|
|
1261
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1261
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1262
1262
|
const endpoint = getEndpoint(folderId);
|
|
1263
1263
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1264
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1265
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1266
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1267
|
+
const requestSpec = isPost
|
|
1268
|
+
? { body: additionalParams, params: queryParams }
|
|
1269
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1264
1270
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1265
1271
|
headers,
|
|
1266
|
-
|
|
1272
|
+
...requestSpec,
|
|
1267
1273
|
pagination: {
|
|
1268
1274
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1269
1275
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1288,7 +1294,7 @@ class PaginationHelpers {
|
|
|
1288
1294
|
* @returns Promise resolving to an object with data and totalCount
|
|
1289
1295
|
*/
|
|
1290
1296
|
static async getAllNonPaginated(params) {
|
|
1291
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1297
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1292
1298
|
// Set default field names
|
|
1293
1299
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1294
1300
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1298,11 +1304,11 @@ class PaginationHelpers {
|
|
|
1298
1304
|
// Make the API call based on method
|
|
1299
1305
|
let response;
|
|
1300
1306
|
if (method === HTTP_METHODS.POST) {
|
|
1301
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1307
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1302
1308
|
}
|
|
1303
1309
|
else {
|
|
1304
1310
|
response = await serviceAccess.get(endpoint, {
|
|
1305
|
-
params: additionalParams,
|
|
1311
|
+
params: { ...additionalParams, ...queryParams },
|
|
1306
1312
|
headers
|
|
1307
1313
|
});
|
|
1308
1314
|
}
|
|
@@ -1357,6 +1363,7 @@ class PaginationHelpers {
|
|
|
1357
1363
|
headers: config.headers,
|
|
1358
1364
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1359
1365
|
additionalParams: prefixedOptions,
|
|
1366
|
+
queryParams: config.queryParams,
|
|
1360
1367
|
transformFn: config.transformFn,
|
|
1361
1368
|
method: config.method,
|
|
1362
1369
|
options: {
|
|
@@ -1374,6 +1381,7 @@ class PaginationHelpers {
|
|
|
1374
1381
|
folderId,
|
|
1375
1382
|
headers: config.headers,
|
|
1376
1383
|
additionalParams: prefixedOptions,
|
|
1384
|
+
queryParams: config.queryParams,
|
|
1377
1385
|
transformFn: config.transformFn,
|
|
1378
1386
|
method: config.method,
|
|
1379
1387
|
options: {
|
|
@@ -1565,18 +1573,17 @@ class BaseService {
|
|
|
1565
1573
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1566
1574
|
// Prepare request parameters based on pagination type
|
|
1567
1575
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1568
|
-
//
|
|
1576
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1577
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1578
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1569
1579
|
if (method.toUpperCase() === 'POST') {
|
|
1570
1580
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1571
1581
|
options.body = {
|
|
1572
1582
|
...existingBody,
|
|
1573
|
-
...options.params,
|
|
1574
1583
|
...requestParams
|
|
1575
1584
|
};
|
|
1576
|
-
options.params = undefined;
|
|
1577
1585
|
}
|
|
1578
1586
|
else {
|
|
1579
|
-
// Merge pagination parameters with existing parameters
|
|
1580
1587
|
options.params = {
|
|
1581
1588
|
...options.params,
|
|
1582
1589
|
...requestParams
|
package/dist/queues/index.mjs
CHANGED
|
@@ -1256,12 +1256,18 @@ class PaginationHelpers {
|
|
|
1256
1256
|
* @returns Promise resolving to a paginated result
|
|
1257
1257
|
*/
|
|
1258
1258
|
static async getAllPaginated(params) {
|
|
1259
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1259
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1260
1260
|
const endpoint = getEndpoint(folderId);
|
|
1261
1261
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1262
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1263
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1264
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1265
|
+
const requestSpec = isPost
|
|
1266
|
+
? { body: additionalParams, params: queryParams }
|
|
1267
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1262
1268
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1263
1269
|
headers,
|
|
1264
|
-
|
|
1270
|
+
...requestSpec,
|
|
1265
1271
|
pagination: {
|
|
1266
1272
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1267
1273
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1286,7 +1292,7 @@ class PaginationHelpers {
|
|
|
1286
1292
|
* @returns Promise resolving to an object with data and totalCount
|
|
1287
1293
|
*/
|
|
1288
1294
|
static async getAllNonPaginated(params) {
|
|
1289
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1295
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1290
1296
|
// Set default field names
|
|
1291
1297
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1292
1298
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1296,11 +1302,11 @@ class PaginationHelpers {
|
|
|
1296
1302
|
// Make the API call based on method
|
|
1297
1303
|
let response;
|
|
1298
1304
|
if (method === HTTP_METHODS.POST) {
|
|
1299
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1305
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1300
1306
|
}
|
|
1301
1307
|
else {
|
|
1302
1308
|
response = await serviceAccess.get(endpoint, {
|
|
1303
|
-
params: additionalParams,
|
|
1309
|
+
params: { ...additionalParams, ...queryParams },
|
|
1304
1310
|
headers
|
|
1305
1311
|
});
|
|
1306
1312
|
}
|
|
@@ -1355,6 +1361,7 @@ class PaginationHelpers {
|
|
|
1355
1361
|
headers: config.headers,
|
|
1356
1362
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1357
1363
|
additionalParams: prefixedOptions,
|
|
1364
|
+
queryParams: config.queryParams,
|
|
1358
1365
|
transformFn: config.transformFn,
|
|
1359
1366
|
method: config.method,
|
|
1360
1367
|
options: {
|
|
@@ -1372,6 +1379,7 @@ class PaginationHelpers {
|
|
|
1372
1379
|
folderId,
|
|
1373
1380
|
headers: config.headers,
|
|
1374
1381
|
additionalParams: prefixedOptions,
|
|
1382
|
+
queryParams: config.queryParams,
|
|
1375
1383
|
transformFn: config.transformFn,
|
|
1376
1384
|
method: config.method,
|
|
1377
1385
|
options: {
|
|
@@ -1563,18 +1571,17 @@ class BaseService {
|
|
|
1563
1571
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1564
1572
|
// Prepare request parameters based on pagination type
|
|
1565
1573
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1566
|
-
//
|
|
1574
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1575
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1576
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1567
1577
|
if (method.toUpperCase() === 'POST') {
|
|
1568
1578
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1569
1579
|
options.body = {
|
|
1570
1580
|
...existingBody,
|
|
1571
|
-
...options.params,
|
|
1572
1581
|
...requestParams
|
|
1573
1582
|
};
|
|
1574
|
-
options.params = undefined;
|
|
1575
1583
|
}
|
|
1576
1584
|
else {
|
|
1577
|
-
// Merge pagination parameters with existing parameters
|
|
1578
1585
|
options.params = {
|
|
1579
1586
|
...options.params,
|
|
1580
1587
|
...requestParams
|
package/dist/tasks/index.cjs
CHANGED
|
@@ -386,6 +386,24 @@ exports.TaskActivityType = void 0;
|
|
|
386
386
|
TaskActivityType["BulkCompleted"] = "BulkCompleted";
|
|
387
387
|
TaskActivityType["FirstOpened"] = "FirstOpened";
|
|
388
388
|
})(exports.TaskActivityType || (exports.TaskActivityType = {}));
|
|
389
|
+
/**
|
|
390
|
+
* Defines how a task assignment is distributed.
|
|
391
|
+
*
|
|
392
|
+
* Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
|
|
393
|
+
* assignment) when not specified. The group-based criteria tell Action Center
|
|
394
|
+
* how to distribute the task across the members of a directory group.
|
|
395
|
+
*/
|
|
396
|
+
exports.TaskAssignmentCriteria = void 0;
|
|
397
|
+
(function (TaskAssignmentCriteria) {
|
|
398
|
+
/** Assigned to a single user, like a direct assignment. */
|
|
399
|
+
TaskAssignmentCriteria["SingleUser"] = "SingleUser";
|
|
400
|
+
/** Assigned to the group member with the fewest pending tasks. */
|
|
401
|
+
TaskAssignmentCriteria["Workload"] = "Workload";
|
|
402
|
+
/** Assigned to all users in the group. */
|
|
403
|
+
TaskAssignmentCriteria["AllUsers"] = "AllUsers";
|
|
404
|
+
/** Assigned in a round-robin manner across the group's members. */
|
|
405
|
+
TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
|
|
406
|
+
})(exports.TaskAssignmentCriteria || (exports.TaskAssignmentCriteria = {}));
|
|
389
407
|
|
|
390
408
|
/**
|
|
391
409
|
* Maps numeric TaskStatus values (from API) to TaskStatus enum values.
|
|
@@ -463,17 +481,19 @@ function createTaskMethods(taskData, service) {
|
|
|
463
481
|
async assign(options) {
|
|
464
482
|
if (!taskData.id)
|
|
465
483
|
throw new Error('Task ID is undefined');
|
|
484
|
+
const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
|
|
466
485
|
const assignmentOptions = 'userId' in options && options.userId !== undefined
|
|
467
|
-
? { taskId: taskData.id, userId: options.userId }
|
|
468
|
-
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
|
|
486
|
+
? { taskId: taskData.id, userId: options.userId, ...criteria }
|
|
487
|
+
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
|
|
469
488
|
return service.assign(assignmentOptions);
|
|
470
489
|
},
|
|
471
490
|
async reassign(options) {
|
|
472
491
|
if (!taskData.id)
|
|
473
492
|
throw new Error('Task ID is undefined');
|
|
493
|
+
const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
|
|
474
494
|
const assignmentOptions = 'userId' in options && options.userId !== undefined
|
|
475
|
-
? { taskId: taskData.id, userId: options.userId }
|
|
476
|
-
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
|
|
495
|
+
? { taskId: taskData.id, userId: options.userId, ...criteria }
|
|
496
|
+
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
|
|
477
497
|
return service.reassign(assignmentOptions);
|
|
478
498
|
},
|
|
479
499
|
async unassign() {
|
|
@@ -1185,12 +1205,18 @@ class PaginationHelpers {
|
|
|
1185
1205
|
* @returns Promise resolving to a paginated result
|
|
1186
1206
|
*/
|
|
1187
1207
|
static async getAllPaginated(params) {
|
|
1188
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1208
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1189
1209
|
const endpoint = getEndpoint(folderId);
|
|
1190
1210
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1211
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1212
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1213
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1214
|
+
const requestSpec = isPost
|
|
1215
|
+
? { body: additionalParams, params: queryParams }
|
|
1216
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1191
1217
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1192
1218
|
headers,
|
|
1193
|
-
|
|
1219
|
+
...requestSpec,
|
|
1194
1220
|
pagination: {
|
|
1195
1221
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1196
1222
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1215,7 +1241,7 @@ class PaginationHelpers {
|
|
|
1215
1241
|
* @returns Promise resolving to an object with data and totalCount
|
|
1216
1242
|
*/
|
|
1217
1243
|
static async getAllNonPaginated(params) {
|
|
1218
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1244
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1219
1245
|
// Set default field names
|
|
1220
1246
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1221
1247
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1225,11 +1251,11 @@ class PaginationHelpers {
|
|
|
1225
1251
|
// Make the API call based on method
|
|
1226
1252
|
let response;
|
|
1227
1253
|
if (method === HTTP_METHODS.POST) {
|
|
1228
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1254
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1229
1255
|
}
|
|
1230
1256
|
else {
|
|
1231
1257
|
response = await serviceAccess.get(endpoint, {
|
|
1232
|
-
params: additionalParams,
|
|
1258
|
+
params: { ...additionalParams, ...queryParams },
|
|
1233
1259
|
headers
|
|
1234
1260
|
});
|
|
1235
1261
|
}
|
|
@@ -1284,6 +1310,7 @@ class PaginationHelpers {
|
|
|
1284
1310
|
headers: config.headers,
|
|
1285
1311
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1286
1312
|
additionalParams: prefixedOptions,
|
|
1313
|
+
queryParams: config.queryParams,
|
|
1287
1314
|
transformFn: config.transformFn,
|
|
1288
1315
|
method: config.method,
|
|
1289
1316
|
options: {
|
|
@@ -1301,6 +1328,7 @@ class PaginationHelpers {
|
|
|
1301
1328
|
folderId,
|
|
1302
1329
|
headers: config.headers,
|
|
1303
1330
|
additionalParams: prefixedOptions,
|
|
1331
|
+
queryParams: config.queryParams,
|
|
1304
1332
|
transformFn: config.transformFn,
|
|
1305
1333
|
method: config.method,
|
|
1306
1334
|
options: {
|
|
@@ -1923,18 +1951,17 @@ class BaseService {
|
|
|
1923
1951
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1924
1952
|
// Prepare request parameters based on pagination type
|
|
1925
1953
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1926
|
-
//
|
|
1954
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1955
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1956
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1927
1957
|
if (method.toUpperCase() === 'POST') {
|
|
1928
1958
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1929
1959
|
options.body = {
|
|
1930
1960
|
...existingBody,
|
|
1931
|
-
...options.params,
|
|
1932
1961
|
...requestParams
|
|
1933
1962
|
};
|
|
1934
|
-
options.params = undefined;
|
|
1935
1963
|
}
|
|
1936
1964
|
else {
|
|
1937
|
-
// Merge pagination parameters with existing parameters
|
|
1938
1965
|
options.params = {
|
|
1939
1966
|
...options.params,
|
|
1940
1967
|
...requestParams
|
|
@@ -2337,6 +2364,26 @@ class TaskService extends BaseService {
|
|
|
2337
2364
|
* }
|
|
2338
2365
|
* ]);
|
|
2339
2366
|
* ```
|
|
2367
|
+
*
|
|
2368
|
+
* @example Group assignment
|
|
2369
|
+
* ```typescript
|
|
2370
|
+
* import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
|
|
2371
|
+
*
|
|
2372
|
+
* // Assign to a directory group by userId + criteria — Action Center
|
|
2373
|
+
* // distributes the task across the group's members based on the criteria
|
|
2374
|
+
* const result = await tasks.assign({
|
|
2375
|
+
* taskId: 123,
|
|
2376
|
+
* userId: 456, // a DirectoryGroup id from tasks.getUsers()
|
|
2377
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
2378
|
+
* });
|
|
2379
|
+
*
|
|
2380
|
+
* // ...or identify the group by name instead of id
|
|
2381
|
+
* const result2 = await tasks.assign({
|
|
2382
|
+
* taskId: 123,
|
|
2383
|
+
* userNameOrEmail: "My Group",
|
|
2384
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
2385
|
+
* });
|
|
2386
|
+
* ```
|
|
2340
2387
|
*/
|
|
2341
2388
|
async assign(taskAssignments) {
|
|
2342
2389
|
// Normalize input to array
|
|
@@ -2388,6 +2435,25 @@ class TaskService extends BaseService {
|
|
|
2388
2435
|
* }
|
|
2389
2436
|
* ]);
|
|
2390
2437
|
* ```
|
|
2438
|
+
*
|
|
2439
|
+
* @example Group reassignment
|
|
2440
|
+
* ```typescript
|
|
2441
|
+
* import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
|
|
2442
|
+
*
|
|
2443
|
+
* // Reassign to a directory group by userId + criteria
|
|
2444
|
+
* const result = await tasks.reassign({
|
|
2445
|
+
* taskId: 123,
|
|
2446
|
+
* userId: 456, // a DirectoryGroup id from tasks.getUsers()
|
|
2447
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
2448
|
+
* });
|
|
2449
|
+
*
|
|
2450
|
+
* // ...or identify the group by name instead of id
|
|
2451
|
+
* const result2 = await tasks.reassign({
|
|
2452
|
+
* taskId: 123,
|
|
2453
|
+
* userNameOrEmail: "My Group",
|
|
2454
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
2455
|
+
* });
|
|
2456
|
+
* ```
|
|
2391
2457
|
*/
|
|
2392
2458
|
async reassign(taskAssignments) {
|
|
2393
2459
|
// Normalize input to array
|