@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/cases/index.mjs
CHANGED
|
@@ -1621,12 +1621,18 @@ class PaginationHelpers {
|
|
|
1621
1621
|
* @returns Promise resolving to a paginated result
|
|
1622
1622
|
*/
|
|
1623
1623
|
static async getAllPaginated(params) {
|
|
1624
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1624
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1625
1625
|
const endpoint = getEndpoint(folderId);
|
|
1626
1626
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1627
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1628
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1629
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1630
|
+
const requestSpec = isPost
|
|
1631
|
+
? { body: additionalParams, params: queryParams }
|
|
1632
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1627
1633
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1628
1634
|
headers,
|
|
1629
|
-
|
|
1635
|
+
...requestSpec,
|
|
1630
1636
|
pagination: {
|
|
1631
1637
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1632
1638
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1651,7 +1657,7 @@ class PaginationHelpers {
|
|
|
1651
1657
|
* @returns Promise resolving to an object with data and totalCount
|
|
1652
1658
|
*/
|
|
1653
1659
|
static async getAllNonPaginated(params) {
|
|
1654
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1660
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1655
1661
|
// Set default field names
|
|
1656
1662
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1657
1663
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1661,11 +1667,11 @@ class PaginationHelpers {
|
|
|
1661
1667
|
// Make the API call based on method
|
|
1662
1668
|
let response;
|
|
1663
1669
|
if (method === HTTP_METHODS.POST) {
|
|
1664
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1670
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1665
1671
|
}
|
|
1666
1672
|
else {
|
|
1667
1673
|
response = await serviceAccess.get(endpoint, {
|
|
1668
|
-
params: additionalParams,
|
|
1674
|
+
params: { ...additionalParams, ...queryParams },
|
|
1669
1675
|
headers
|
|
1670
1676
|
});
|
|
1671
1677
|
}
|
|
@@ -1720,6 +1726,7 @@ class PaginationHelpers {
|
|
|
1720
1726
|
headers: config.headers,
|
|
1721
1727
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1722
1728
|
additionalParams: prefixedOptions,
|
|
1729
|
+
queryParams: config.queryParams,
|
|
1723
1730
|
transformFn: config.transformFn,
|
|
1724
1731
|
method: config.method,
|
|
1725
1732
|
options: {
|
|
@@ -1737,6 +1744,7 @@ class PaginationHelpers {
|
|
|
1737
1744
|
folderId,
|
|
1738
1745
|
headers: config.headers,
|
|
1739
1746
|
additionalParams: prefixedOptions,
|
|
1747
|
+
queryParams: config.queryParams,
|
|
1740
1748
|
transformFn: config.transformFn,
|
|
1741
1749
|
method: config.method,
|
|
1742
1750
|
options: {
|
|
@@ -1928,18 +1936,17 @@ class BaseService {
|
|
|
1928
1936
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1929
1937
|
// Prepare request parameters based on pagination type
|
|
1930
1938
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1931
|
-
//
|
|
1939
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1940
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1941
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1932
1942
|
if (method.toUpperCase() === 'POST') {
|
|
1933
1943
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1934
1944
|
options.body = {
|
|
1935
1945
|
...existingBody,
|
|
1936
|
-
...options.params,
|
|
1937
1946
|
...requestParams
|
|
1938
1947
|
};
|
|
1939
|
-
options.params = undefined;
|
|
1940
1948
|
}
|
|
1941
1949
|
else {
|
|
1942
|
-
// Merge pagination parameters with existing parameters
|
|
1943
1950
|
options.params = {
|
|
1944
1951
|
...options.params,
|
|
1945
1952
|
...requestParams
|
|
@@ -2826,6 +2833,24 @@ var TaskActivityType;
|
|
|
2826
2833
|
TaskActivityType["BulkCompleted"] = "BulkCompleted";
|
|
2827
2834
|
TaskActivityType["FirstOpened"] = "FirstOpened";
|
|
2828
2835
|
})(TaskActivityType || (TaskActivityType = {}));
|
|
2836
|
+
/**
|
|
2837
|
+
* Defines how a task assignment is distributed.
|
|
2838
|
+
*
|
|
2839
|
+
* Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
|
|
2840
|
+
* assignment) when not specified. The group-based criteria tell Action Center
|
|
2841
|
+
* how to distribute the task across the members of a directory group.
|
|
2842
|
+
*/
|
|
2843
|
+
var TaskAssignmentCriteria;
|
|
2844
|
+
(function (TaskAssignmentCriteria) {
|
|
2845
|
+
/** Assigned to a single user, like a direct assignment. */
|
|
2846
|
+
TaskAssignmentCriteria["SingleUser"] = "SingleUser";
|
|
2847
|
+
/** Assigned to the group member with the fewest pending tasks. */
|
|
2848
|
+
TaskAssignmentCriteria["Workload"] = "Workload";
|
|
2849
|
+
/** Assigned to all users in the group. */
|
|
2850
|
+
TaskAssignmentCriteria["AllUsers"] = "AllUsers";
|
|
2851
|
+
/** Assigned in a round-robin manner across the group's members. */
|
|
2852
|
+
TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
|
|
2853
|
+
})(TaskAssignmentCriteria || (TaskAssignmentCriteria = {}));
|
|
2829
2854
|
|
|
2830
2855
|
/**
|
|
2831
2856
|
* Maps numeric TaskStatus values (from API) to TaskStatus enum values.
|
|
@@ -2875,17 +2900,19 @@ function createTaskMethods(taskData, service) {
|
|
|
2875
2900
|
async assign(options) {
|
|
2876
2901
|
if (!taskData.id)
|
|
2877
2902
|
throw new Error('Task ID is undefined');
|
|
2903
|
+
const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
|
|
2878
2904
|
const assignmentOptions = 'userId' in options && options.userId !== undefined
|
|
2879
|
-
? { taskId: taskData.id, userId: options.userId }
|
|
2880
|
-
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
|
|
2905
|
+
? { taskId: taskData.id, userId: options.userId, ...criteria }
|
|
2906
|
+
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
|
|
2881
2907
|
return service.assign(assignmentOptions);
|
|
2882
2908
|
},
|
|
2883
2909
|
async reassign(options) {
|
|
2884
2910
|
if (!taskData.id)
|
|
2885
2911
|
throw new Error('Task ID is undefined');
|
|
2912
|
+
const criteria = options.assignmentCriteria !== undefined ? { assignmentCriteria: options.assignmentCriteria } : {};
|
|
2886
2913
|
const assignmentOptions = 'userId' in options && options.userId !== undefined
|
|
2887
|
-
? { taskId: taskData.id, userId: options.userId }
|
|
2888
|
-
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail };
|
|
2914
|
+
? { taskId: taskData.id, userId: options.userId, ...criteria }
|
|
2915
|
+
: { taskId: taskData.id, userNameOrEmail: options.userNameOrEmail, ...criteria };
|
|
2889
2916
|
return service.reassign(assignmentOptions);
|
|
2890
2917
|
},
|
|
2891
2918
|
async unassign() {
|
|
@@ -3198,6 +3225,26 @@ class TaskService extends BaseService {
|
|
|
3198
3225
|
* }
|
|
3199
3226
|
* ]);
|
|
3200
3227
|
* ```
|
|
3228
|
+
*
|
|
3229
|
+
* @example Group assignment
|
|
3230
|
+
* ```typescript
|
|
3231
|
+
* import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
|
|
3232
|
+
*
|
|
3233
|
+
* // Assign to a directory group by userId + criteria — Action Center
|
|
3234
|
+
* // distributes the task across the group's members based on the criteria
|
|
3235
|
+
* const result = await tasks.assign({
|
|
3236
|
+
* taskId: 123,
|
|
3237
|
+
* userId: 456, // a DirectoryGroup id from tasks.getUsers()
|
|
3238
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
3239
|
+
* });
|
|
3240
|
+
*
|
|
3241
|
+
* // ...or identify the group by name instead of id
|
|
3242
|
+
* const result2 = await tasks.assign({
|
|
3243
|
+
* taskId: 123,
|
|
3244
|
+
* userNameOrEmail: "My Group",
|
|
3245
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
3246
|
+
* });
|
|
3247
|
+
* ```
|
|
3201
3248
|
*/
|
|
3202
3249
|
async assign(taskAssignments) {
|
|
3203
3250
|
// Normalize input to array
|
|
@@ -3249,6 +3296,25 @@ class TaskService extends BaseService {
|
|
|
3249
3296
|
* }
|
|
3250
3297
|
* ]);
|
|
3251
3298
|
* ```
|
|
3299
|
+
*
|
|
3300
|
+
* @example Group reassignment
|
|
3301
|
+
* ```typescript
|
|
3302
|
+
* import { TaskAssignmentCriteria } from '@uipath/uipath-typescript/tasks';
|
|
3303
|
+
*
|
|
3304
|
+
* // Reassign to a directory group by userId + criteria
|
|
3305
|
+
* const result = await tasks.reassign({
|
|
3306
|
+
* taskId: 123,
|
|
3307
|
+
* userId: 456, // a DirectoryGroup id from tasks.getUsers()
|
|
3308
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
3309
|
+
* });
|
|
3310
|
+
*
|
|
3311
|
+
* // ...or identify the group by name instead of id
|
|
3312
|
+
* const result2 = await tasks.reassign({
|
|
3313
|
+
* taskId: 123,
|
|
3314
|
+
* userNameOrEmail: "My Group",
|
|
3315
|
+
* assignmentCriteria: TaskAssignmentCriteria.AllUsers
|
|
3316
|
+
* });
|
|
3317
|
+
* ```
|
|
3252
3318
|
*/
|
|
3253
3319
|
async reassign(taskAssignments) {
|
|
3254
3320
|
// Normalize input to array
|
|
@@ -1340,12 +1340,18 @@ class PaginationHelpers {
|
|
|
1340
1340
|
* @returns Promise resolving to a paginated result
|
|
1341
1341
|
*/
|
|
1342
1342
|
static async getAllPaginated(params) {
|
|
1343
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1343
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1344
1344
|
const endpoint = getEndpoint(folderId);
|
|
1345
1345
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1346
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1347
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1348
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1349
|
+
const requestSpec = isPost
|
|
1350
|
+
? { body: additionalParams, params: queryParams }
|
|
1351
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1346
1352
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1347
1353
|
headers,
|
|
1348
|
-
|
|
1354
|
+
...requestSpec,
|
|
1349
1355
|
pagination: {
|
|
1350
1356
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1351
1357
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1370,7 +1376,7 @@ class PaginationHelpers {
|
|
|
1370
1376
|
* @returns Promise resolving to an object with data and totalCount
|
|
1371
1377
|
*/
|
|
1372
1378
|
static async getAllNonPaginated(params) {
|
|
1373
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1379
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1374
1380
|
// Set default field names
|
|
1375
1381
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1376
1382
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1380,11 +1386,11 @@ class PaginationHelpers {
|
|
|
1380
1386
|
// Make the API call based on method
|
|
1381
1387
|
let response;
|
|
1382
1388
|
if (method === HTTP_METHODS.POST) {
|
|
1383
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1389
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1384
1390
|
}
|
|
1385
1391
|
else {
|
|
1386
1392
|
response = await serviceAccess.get(endpoint, {
|
|
1387
|
-
params: additionalParams,
|
|
1393
|
+
params: { ...additionalParams, ...queryParams },
|
|
1388
1394
|
headers
|
|
1389
1395
|
});
|
|
1390
1396
|
}
|
|
@@ -1439,6 +1445,7 @@ class PaginationHelpers {
|
|
|
1439
1445
|
headers: config.headers,
|
|
1440
1446
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1441
1447
|
additionalParams: prefixedOptions,
|
|
1448
|
+
queryParams: config.queryParams,
|
|
1442
1449
|
transformFn: config.transformFn,
|
|
1443
1450
|
method: config.method,
|
|
1444
1451
|
options: {
|
|
@@ -1456,6 +1463,7 @@ class PaginationHelpers {
|
|
|
1456
1463
|
folderId,
|
|
1457
1464
|
headers: config.headers,
|
|
1458
1465
|
additionalParams: prefixedOptions,
|
|
1466
|
+
queryParams: config.queryParams,
|
|
1459
1467
|
transformFn: config.transformFn,
|
|
1460
1468
|
method: config.method,
|
|
1461
1469
|
options: {
|
|
@@ -1647,18 +1655,17 @@ class BaseService {
|
|
|
1647
1655
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1648
1656
|
// Prepare request parameters based on pagination type
|
|
1649
1657
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1650
|
-
//
|
|
1658
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1659
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1660
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1651
1661
|
if (method.toUpperCase() === 'POST') {
|
|
1652
1662
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1653
1663
|
options.body = {
|
|
1654
1664
|
...existingBody,
|
|
1655
|
-
...options.params,
|
|
1656
1665
|
...requestParams
|
|
1657
1666
|
};
|
|
1658
|
-
options.params = undefined;
|
|
1659
1667
|
}
|
|
1660
1668
|
else {
|
|
1661
|
-
// Merge pagination parameters with existing parameters
|
|
1662
1669
|
options.params = {
|
|
1663
1670
|
...options.params,
|
|
1664
1671
|
...requestParams
|
|
@@ -1338,12 +1338,18 @@ class PaginationHelpers {
|
|
|
1338
1338
|
* @returns Promise resolving to a paginated result
|
|
1339
1339
|
*/
|
|
1340
1340
|
static async getAllPaginated(params) {
|
|
1341
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1341
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1342
1342
|
const endpoint = getEndpoint(folderId);
|
|
1343
1343
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1344
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1345
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1346
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1347
|
+
const requestSpec = isPost
|
|
1348
|
+
? { body: additionalParams, params: queryParams }
|
|
1349
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1344
1350
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1345
1351
|
headers,
|
|
1346
|
-
|
|
1352
|
+
...requestSpec,
|
|
1347
1353
|
pagination: {
|
|
1348
1354
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1349
1355
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1368,7 +1374,7 @@ class PaginationHelpers {
|
|
|
1368
1374
|
* @returns Promise resolving to an object with data and totalCount
|
|
1369
1375
|
*/
|
|
1370
1376
|
static async getAllNonPaginated(params) {
|
|
1371
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1377
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1372
1378
|
// Set default field names
|
|
1373
1379
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1374
1380
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1378,11 +1384,11 @@ class PaginationHelpers {
|
|
|
1378
1384
|
// Make the API call based on method
|
|
1379
1385
|
let response;
|
|
1380
1386
|
if (method === HTTP_METHODS.POST) {
|
|
1381
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1387
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1382
1388
|
}
|
|
1383
1389
|
else {
|
|
1384
1390
|
response = await serviceAccess.get(endpoint, {
|
|
1385
|
-
params: additionalParams,
|
|
1391
|
+
params: { ...additionalParams, ...queryParams },
|
|
1386
1392
|
headers
|
|
1387
1393
|
});
|
|
1388
1394
|
}
|
|
@@ -1437,6 +1443,7 @@ class PaginationHelpers {
|
|
|
1437
1443
|
headers: config.headers,
|
|
1438
1444
|
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1439
1445
|
additionalParams: prefixedOptions,
|
|
1446
|
+
queryParams: config.queryParams,
|
|
1440
1447
|
transformFn: config.transformFn,
|
|
1441
1448
|
method: config.method,
|
|
1442
1449
|
options: {
|
|
@@ -1454,6 +1461,7 @@ class PaginationHelpers {
|
|
|
1454
1461
|
folderId,
|
|
1455
1462
|
headers: config.headers,
|
|
1456
1463
|
additionalParams: prefixedOptions,
|
|
1464
|
+
queryParams: config.queryParams,
|
|
1457
1465
|
transformFn: config.transformFn,
|
|
1458
1466
|
method: config.method,
|
|
1459
1467
|
options: {
|
|
@@ -1645,18 +1653,17 @@ class BaseService {
|
|
|
1645
1653
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1646
1654
|
// Prepare request parameters based on pagination type
|
|
1647
1655
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1648
|
-
//
|
|
1656
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1657
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1658
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1649
1659
|
if (method.toUpperCase() === 'POST') {
|
|
1650
1660
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1651
1661
|
options.body = {
|
|
1652
1662
|
...existingBody,
|
|
1653
|
-
...options.params,
|
|
1654
1663
|
...requestParams
|
|
1655
1664
|
};
|
|
1656
|
-
options.params = undefined;
|
|
1657
1665
|
}
|
|
1658
1666
|
else {
|
|
1659
|
-
// Merge pagination parameters with existing parameters
|
|
1660
1667
|
options.params = {
|
|
1661
1668
|
...options.params,
|
|
1662
1669
|
...requestParams
|
package/dist/core/index.cjs
CHANGED
|
@@ -4477,6 +4477,24 @@ var TaskActivityType;
|
|
|
4477
4477
|
TaskActivityType["BulkCompleted"] = "BulkCompleted";
|
|
4478
4478
|
TaskActivityType["FirstOpened"] = "FirstOpened";
|
|
4479
4479
|
})(TaskActivityType || (TaskActivityType = {}));
|
|
4480
|
+
/**
|
|
4481
|
+
* Defines how a task assignment is distributed.
|
|
4482
|
+
*
|
|
4483
|
+
* Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
|
|
4484
|
+
* assignment) when not specified. The group-based criteria tell Action Center
|
|
4485
|
+
* how to distribute the task across the members of a directory group.
|
|
4486
|
+
*/
|
|
4487
|
+
var TaskAssignmentCriteria;
|
|
4488
|
+
(function (TaskAssignmentCriteria) {
|
|
4489
|
+
/** Assigned to a single user, like a direct assignment. */
|
|
4490
|
+
TaskAssignmentCriteria["SingleUser"] = "SingleUser";
|
|
4491
|
+
/** Assigned to the group member with the fewest pending tasks. */
|
|
4492
|
+
TaskAssignmentCriteria["Workload"] = "Workload";
|
|
4493
|
+
/** Assigned to all users in the group. */
|
|
4494
|
+
TaskAssignmentCriteria["AllUsers"] = "AllUsers";
|
|
4495
|
+
/** Assigned in a round-robin manner across the group's members. */
|
|
4496
|
+
TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
|
|
4497
|
+
})(TaskAssignmentCriteria || (TaskAssignmentCriteria = {}));
|
|
4480
4498
|
|
|
4481
4499
|
/**
|
|
4482
4500
|
* Base path constants for different services
|
|
@@ -4549,6 +4567,15 @@ function isTokenExpired(tokenInfo) {
|
|
|
4549
4567
|
return true;
|
|
4550
4568
|
return new Date() >= tokenInfo.expiresAt;
|
|
4551
4569
|
}
|
|
4570
|
+
/**
|
|
4571
|
+
* The validated host origin when the app is running as a trusted, generic
|
|
4572
|
+
* host-embedded app (`?host=embed&basedomain=<origin>` with an allowlisted
|
|
4573
|
+
* UiPath origin); otherwise null. Shared by TokenManager (to create the
|
|
4574
|
+
* EmbeddedTokenManager) and UiPath init (to seed an empty token so getValidToken
|
|
4575
|
+
* can bootstrap the postMessage token flow), which previously duplicated this
|
|
4576
|
+
* condition inline.
|
|
4577
|
+
*/
|
|
4578
|
+
const trustedEmbeddingOrigin = isHostEmbedded && embeddingOrigin && isValidHostOrigin(embeddingOrigin) ? embeddingOrigin : null;
|
|
4552
4579
|
/**
|
|
4553
4580
|
* Waits for the next window message that satisfies `filter`.
|
|
4554
4581
|
* Rejects if the AbortSignal fires before a matching message arrives.
|
|
@@ -4795,7 +4822,7 @@ class EmbeddedTokenManager {
|
|
|
4795
4822
|
* SDK's public API.
|
|
4796
4823
|
*/
|
|
4797
4824
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
4798
|
-
const SDK_VERSION = '1.4.
|
|
4825
|
+
const SDK_VERSION = '1.4.2';
|
|
4799
4826
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
4800
4827
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
4801
4828
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
|
@@ -4923,8 +4950,8 @@ class TokenManager {
|
|
|
4923
4950
|
this.actionCenterTokenManager = new ActionCenterTokenManager(config, (tokenInfo) => this.setToken(tokenInfo));
|
|
4924
4951
|
this.isOAuth = false;
|
|
4925
4952
|
}
|
|
4926
|
-
else if (
|
|
4927
|
-
this.embeddedTokenManager = new EmbeddedTokenManager(
|
|
4953
|
+
else if (trustedEmbeddingOrigin) {
|
|
4954
|
+
this.embeddedTokenManager = new EmbeddedTokenManager(trustedEmbeddingOrigin, config, tokenInfo => this.setToken(tokenInfo));
|
|
4928
4955
|
this.isOAuth = false;
|
|
4929
4956
|
}
|
|
4930
4957
|
}
|
|
@@ -5983,10 +6010,12 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
|
|
|
5983
6010
|
});
|
|
5984
6011
|
// Track SDK initialization
|
|
5985
6012
|
trackEvent('Sdk.Auth');
|
|
5986
|
-
/** Auto-initialize for secret-based auth
|
|
5987
|
-
* When viewed in Action Center
|
|
6013
|
+
/** Auto-initialize for secret-based auth, Action Center, and generic host-embedded apps.
|
|
6014
|
+
* When viewed in Action Center or embedded in a UiPath host frame via the UIP protocol,
|
|
6015
|
+
* initialize tokenInfo with an empty token so getValidToken() can bootstrap via postMessage.
|
|
6016
|
+
* When an sdk call is made, the host passes the token to the sdk.
|
|
5988
6017
|
*/
|
|
5989
|
-
if (hasSecretAuth || isInActionCenter) {
|
|
6018
|
+
if (hasSecretAuth || isInActionCenter || trustedEmbeddingOrigin) {
|
|
5990
6019
|
__classPrivateFieldGet(this, _UiPath_authService, "f").authenticateWithSecret(config.secret ?? '');
|
|
5991
6020
|
__classPrivateFieldSet(this, _UiPath_initialized, true, "f");
|
|
5992
6021
|
}
|
package/dist/core/index.mjs
CHANGED
|
@@ -4475,6 +4475,24 @@ var TaskActivityType;
|
|
|
4475
4475
|
TaskActivityType["BulkCompleted"] = "BulkCompleted";
|
|
4476
4476
|
TaskActivityType["FirstOpened"] = "FirstOpened";
|
|
4477
4477
|
})(TaskActivityType || (TaskActivityType = {}));
|
|
4478
|
+
/**
|
|
4479
|
+
* Defines how a task assignment is distributed.
|
|
4480
|
+
*
|
|
4481
|
+
* Defaults to {@link TaskAssignmentCriteria.SingleUser} (a direct single-user
|
|
4482
|
+
* assignment) when not specified. The group-based criteria tell Action Center
|
|
4483
|
+
* how to distribute the task across the members of a directory group.
|
|
4484
|
+
*/
|
|
4485
|
+
var TaskAssignmentCriteria;
|
|
4486
|
+
(function (TaskAssignmentCriteria) {
|
|
4487
|
+
/** Assigned to a single user, like a direct assignment. */
|
|
4488
|
+
TaskAssignmentCriteria["SingleUser"] = "SingleUser";
|
|
4489
|
+
/** Assigned to the group member with the fewest pending tasks. */
|
|
4490
|
+
TaskAssignmentCriteria["Workload"] = "Workload";
|
|
4491
|
+
/** Assigned to all users in the group. */
|
|
4492
|
+
TaskAssignmentCriteria["AllUsers"] = "AllUsers";
|
|
4493
|
+
/** Assigned in a round-robin manner across the group's members. */
|
|
4494
|
+
TaskAssignmentCriteria["RoundRobin"] = "RoundRobin";
|
|
4495
|
+
})(TaskAssignmentCriteria || (TaskAssignmentCriteria = {}));
|
|
4478
4496
|
|
|
4479
4497
|
/**
|
|
4480
4498
|
* Base path constants for different services
|
|
@@ -4547,6 +4565,15 @@ function isTokenExpired(tokenInfo) {
|
|
|
4547
4565
|
return true;
|
|
4548
4566
|
return new Date() >= tokenInfo.expiresAt;
|
|
4549
4567
|
}
|
|
4568
|
+
/**
|
|
4569
|
+
* The validated host origin when the app is running as a trusted, generic
|
|
4570
|
+
* host-embedded app (`?host=embed&basedomain=<origin>` with an allowlisted
|
|
4571
|
+
* UiPath origin); otherwise null. Shared by TokenManager (to create the
|
|
4572
|
+
* EmbeddedTokenManager) and UiPath init (to seed an empty token so getValidToken
|
|
4573
|
+
* can bootstrap the postMessage token flow), which previously duplicated this
|
|
4574
|
+
* condition inline.
|
|
4575
|
+
*/
|
|
4576
|
+
const trustedEmbeddingOrigin = isHostEmbedded && embeddingOrigin && isValidHostOrigin(embeddingOrigin) ? embeddingOrigin : null;
|
|
4550
4577
|
/**
|
|
4551
4578
|
* Waits for the next window message that satisfies `filter`.
|
|
4552
4579
|
* Rejects if the AbortSignal fires before a matching message arrives.
|
|
@@ -4793,7 +4820,7 @@ class EmbeddedTokenManager {
|
|
|
4793
4820
|
* SDK's public API.
|
|
4794
4821
|
*/
|
|
4795
4822
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
4796
|
-
const SDK_VERSION = '1.4.
|
|
4823
|
+
const SDK_VERSION = '1.4.2';
|
|
4797
4824
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
4798
4825
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
4799
4826
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
|
@@ -4921,8 +4948,8 @@ class TokenManager {
|
|
|
4921
4948
|
this.actionCenterTokenManager = new ActionCenterTokenManager(config, (tokenInfo) => this.setToken(tokenInfo));
|
|
4922
4949
|
this.isOAuth = false;
|
|
4923
4950
|
}
|
|
4924
|
-
else if (
|
|
4925
|
-
this.embeddedTokenManager = new EmbeddedTokenManager(
|
|
4951
|
+
else if (trustedEmbeddingOrigin) {
|
|
4952
|
+
this.embeddedTokenManager = new EmbeddedTokenManager(trustedEmbeddingOrigin, config, tokenInfo => this.setToken(tokenInfo));
|
|
4926
4953
|
this.isOAuth = false;
|
|
4927
4954
|
}
|
|
4928
4955
|
}
|
|
@@ -5981,10 +6008,12 @@ _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_ini
|
|
|
5981
6008
|
});
|
|
5982
6009
|
// Track SDK initialization
|
|
5983
6010
|
trackEvent('Sdk.Auth');
|
|
5984
|
-
/** Auto-initialize for secret-based auth
|
|
5985
|
-
* When viewed in Action Center
|
|
6011
|
+
/** Auto-initialize for secret-based auth, Action Center, and generic host-embedded apps.
|
|
6012
|
+
* When viewed in Action Center or embedded in a UiPath host frame via the UIP protocol,
|
|
6013
|
+
* initialize tokenInfo with an empty token so getValidToken() can bootstrap via postMessage.
|
|
6014
|
+
* When an sdk call is made, the host passes the token to the sdk.
|
|
5986
6015
|
*/
|
|
5987
|
-
if (hasSecretAuth || isInActionCenter) {
|
|
6016
|
+
if (hasSecretAuth || isInActionCenter || trustedEmbeddingOrigin) {
|
|
5988
6017
|
__classPrivateFieldGet(this, _UiPath_authService, "f").authenticateWithSecret(config.secret ?? '');
|
|
5989
6018
|
__classPrivateFieldSet(this, _UiPath_initialized, true, "f");
|
|
5990
6019
|
}
|