@uipath/uipath-typescript 1.3.2 → 1.3.4
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/assets/index.cjs +21 -8
- package/dist/assets/index.mjs +21 -8
- package/dist/attachments/index.cjs +21 -8
- package/dist/attachments/index.mjs +21 -8
- package/dist/buckets/index.cjs +21 -8
- package/dist/buckets/index.mjs +21 -8
- package/dist/cases/index.cjs +41 -13
- package/dist/cases/index.d.ts +15 -0
- package/dist/cases/index.mjs +41 -13
- package/dist/conversational-agent/index.cjs +39 -8
- package/dist/conversational-agent/index.d.ts +55 -2
- package/dist/conversational-agent/index.mjs +39 -8
- package/dist/core/index.cjs +16 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +16 -1
- package/dist/entities/index.cjs +55 -8
- package/dist/entities/index.d.ts +54 -0
- package/dist/entities/index.mjs +55 -8
- package/dist/feedback/index.cjs +1911 -0
- package/dist/feedback/index.d.ts +475 -0
- package/dist/feedback/index.mjs +1909 -0
- package/dist/index.cjs +451 -189
- package/dist/index.d.ts +388 -13
- package/dist/index.mjs +452 -190
- package/dist/index.umd.js +451 -189
- package/dist/jobs/index.cjs +384 -8
- package/dist/jobs/index.d.ts +220 -2
- package/dist/jobs/index.mjs +385 -9
- package/dist/maestro-processes/index.cjs +21 -8
- package/dist/maestro-processes/index.mjs +21 -8
- package/dist/processes/index.cjs +21 -8
- package/dist/processes/index.mjs +21 -8
- package/dist/queues/index.cjs +21 -8
- package/dist/queues/index.mjs +21 -8
- package/dist/tasks/index.cjs +41 -13
- package/dist/tasks/index.d.ts +25 -10
- package/dist/tasks/index.mjs +42 -14
- package/package.json +13 -2
|
@@ -505,6 +505,8 @@ class ErrorFactory {
|
|
|
505
505
|
|
|
506
506
|
const FOLDER_KEY = 'X-UIPATH-FolderKey';
|
|
507
507
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
508
|
+
const TRACEPARENT = 'traceparent';
|
|
509
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
508
510
|
/**
|
|
509
511
|
* Content type constants for HTTP requests/responses
|
|
510
512
|
*/
|
|
@@ -558,8 +560,13 @@ class ApiClient {
|
|
|
558
560
|
if (isFormData) {
|
|
559
561
|
delete defaultHeaders['Content-Type'];
|
|
560
562
|
}
|
|
563
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
564
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
565
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
561
566
|
const headers = {
|
|
562
567
|
...defaultHeaders,
|
|
568
|
+
[TRACEPARENT]: traceparentValue,
|
|
569
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
563
570
|
...options.headers
|
|
564
571
|
};
|
|
565
572
|
// Convert params to URLSearchParams
|
|
@@ -599,7 +606,11 @@ class ApiClient {
|
|
|
599
606
|
const text = await response.text();
|
|
600
607
|
return text;
|
|
601
608
|
}
|
|
602
|
-
|
|
609
|
+
const text = await response.text();
|
|
610
|
+
if (!text) {
|
|
611
|
+
return undefined;
|
|
612
|
+
}
|
|
613
|
+
return JSON.parse(text);
|
|
603
614
|
}
|
|
604
615
|
catch (error) {
|
|
605
616
|
// If it's already one of our errors, re-throw it
|
|
@@ -1160,8 +1171,9 @@ class PaginationHelpers {
|
|
|
1160
1171
|
});
|
|
1161
1172
|
}
|
|
1162
1173
|
// Extract and transform items from response
|
|
1163
|
-
|
|
1164
|
-
const
|
|
1174
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1175
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1176
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1165
1177
|
// Parse items - automatically handle JSON string responses
|
|
1166
1178
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1167
1179
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1412,7 +1424,7 @@ class BaseService {
|
|
|
1412
1424
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1413
1425
|
// Prepare request parameters based on pagination type
|
|
1414
1426
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1415
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1427
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1416
1428
|
if (method.toUpperCase() === 'POST') {
|
|
1417
1429
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1418
1430
|
options.body = {
|
|
@@ -1420,6 +1432,7 @@ class BaseService {
|
|
|
1420
1432
|
...options.params,
|
|
1421
1433
|
...requestParams
|
|
1422
1434
|
};
|
|
1435
|
+
options.params = undefined;
|
|
1423
1436
|
}
|
|
1424
1437
|
else {
|
|
1425
1438
|
// Merge pagination parameters with existing parameters
|
|
@@ -1460,7 +1473,6 @@ class BaseService {
|
|
|
1460
1473
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1461
1474
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1462
1475
|
}
|
|
1463
|
-
// Include total count for ODATA APIs
|
|
1464
1476
|
{
|
|
1465
1477
|
requestParams[countParam] = true;
|
|
1466
1478
|
}
|
|
@@ -1488,8 +1500,9 @@ class BaseService {
|
|
|
1488
1500
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1489
1501
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1490
1502
|
// Extract items and metadata
|
|
1491
|
-
|
|
1492
|
-
const
|
|
1503
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1504
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1505
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1493
1506
|
const continuationToken = response.data[continuationTokenField];
|
|
1494
1507
|
// Determine if there are more pages
|
|
1495
1508
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1727,7 +1740,7 @@ class BpmnHelpers {
|
|
|
1727
1740
|
// Connection string placeholder that will be replaced during build
|
|
1728
1741
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
1729
1742
|
// SDK Version placeholder
|
|
1730
|
-
const SDK_VERSION = "1.3.
|
|
1743
|
+
const SDK_VERSION = "1.3.4";
|
|
1731
1744
|
const VERSION = "Version";
|
|
1732
1745
|
const SERVICE = "Service";
|
|
1733
1746
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/processes/index.cjs
CHANGED
|
@@ -506,6 +506,8 @@ class ErrorFactory {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
509
|
+
const TRACEPARENT = 'traceparent';
|
|
510
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
509
511
|
/**
|
|
510
512
|
* Content type constants for HTTP requests/responses
|
|
511
513
|
*/
|
|
@@ -559,8 +561,13 @@ class ApiClient {
|
|
|
559
561
|
if (isFormData) {
|
|
560
562
|
delete defaultHeaders['Content-Type'];
|
|
561
563
|
}
|
|
564
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
565
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
566
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
562
567
|
const headers = {
|
|
563
568
|
...defaultHeaders,
|
|
569
|
+
[TRACEPARENT]: traceparentValue,
|
|
570
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
564
571
|
...options.headers
|
|
565
572
|
};
|
|
566
573
|
// Convert params to URLSearchParams
|
|
@@ -600,7 +607,11 @@ class ApiClient {
|
|
|
600
607
|
const text = await response.text();
|
|
601
608
|
return text;
|
|
602
609
|
}
|
|
603
|
-
|
|
610
|
+
const text = await response.text();
|
|
611
|
+
if (!text) {
|
|
612
|
+
return undefined;
|
|
613
|
+
}
|
|
614
|
+
return JSON.parse(text);
|
|
604
615
|
}
|
|
605
616
|
catch (error) {
|
|
606
617
|
// If it's already one of our errors, re-throw it
|
|
@@ -1295,8 +1306,9 @@ class PaginationHelpers {
|
|
|
1295
1306
|
});
|
|
1296
1307
|
}
|
|
1297
1308
|
// Extract and transform items from response
|
|
1298
|
-
|
|
1299
|
-
const
|
|
1309
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1310
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1311
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1300
1312
|
// Parse items - automatically handle JSON string responses
|
|
1301
1313
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1302
1314
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1547,7 +1559,7 @@ class BaseService {
|
|
|
1547
1559
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1548
1560
|
// Prepare request parameters based on pagination type
|
|
1549
1561
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1550
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1562
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1551
1563
|
if (method.toUpperCase() === 'POST') {
|
|
1552
1564
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1553
1565
|
options.body = {
|
|
@@ -1555,6 +1567,7 @@ class BaseService {
|
|
|
1555
1567
|
...options.params,
|
|
1556
1568
|
...requestParams
|
|
1557
1569
|
};
|
|
1570
|
+
options.params = undefined;
|
|
1558
1571
|
}
|
|
1559
1572
|
else {
|
|
1560
1573
|
// Merge pagination parameters with existing parameters
|
|
@@ -1595,7 +1608,6 @@ class BaseService {
|
|
|
1595
1608
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1596
1609
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1597
1610
|
}
|
|
1598
|
-
// Include total count for ODATA APIs
|
|
1599
1611
|
{
|
|
1600
1612
|
requestParams[countParam] = true;
|
|
1601
1613
|
}
|
|
@@ -1623,8 +1635,9 @@ class BaseService {
|
|
|
1623
1635
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1624
1636
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1625
1637
|
// Extract items and metadata
|
|
1626
|
-
|
|
1627
|
-
const
|
|
1638
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1639
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1640
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1628
1641
|
const continuationToken = response.data[continuationTokenField];
|
|
1629
1642
|
// Determine if there are more pages
|
|
1630
1643
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1709,7 +1722,7 @@ const PROCESS_ENDPOINTS = {
|
|
|
1709
1722
|
// Connection string placeholder that will be replaced during build
|
|
1710
1723
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
1711
1724
|
// SDK Version placeholder
|
|
1712
|
-
const SDK_VERSION = "1.3.
|
|
1725
|
+
const SDK_VERSION = "1.3.4";
|
|
1713
1726
|
const VERSION = "Version";
|
|
1714
1727
|
const SERVICE = "Service";
|
|
1715
1728
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/processes/index.mjs
CHANGED
|
@@ -504,6 +504,8 @@ class ErrorFactory {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
507
|
+
const TRACEPARENT = 'traceparent';
|
|
508
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
507
509
|
/**
|
|
508
510
|
* Content type constants for HTTP requests/responses
|
|
509
511
|
*/
|
|
@@ -557,8 +559,13 @@ class ApiClient {
|
|
|
557
559
|
if (isFormData) {
|
|
558
560
|
delete defaultHeaders['Content-Type'];
|
|
559
561
|
}
|
|
562
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
563
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
564
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
560
565
|
const headers = {
|
|
561
566
|
...defaultHeaders,
|
|
567
|
+
[TRACEPARENT]: traceparentValue,
|
|
568
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
562
569
|
...options.headers
|
|
563
570
|
};
|
|
564
571
|
// Convert params to URLSearchParams
|
|
@@ -598,7 +605,11 @@ class ApiClient {
|
|
|
598
605
|
const text = await response.text();
|
|
599
606
|
return text;
|
|
600
607
|
}
|
|
601
|
-
|
|
608
|
+
const text = await response.text();
|
|
609
|
+
if (!text) {
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
return JSON.parse(text);
|
|
602
613
|
}
|
|
603
614
|
catch (error) {
|
|
604
615
|
// If it's already one of our errors, re-throw it
|
|
@@ -1293,8 +1304,9 @@ class PaginationHelpers {
|
|
|
1293
1304
|
});
|
|
1294
1305
|
}
|
|
1295
1306
|
// Extract and transform items from response
|
|
1296
|
-
|
|
1297
|
-
const
|
|
1307
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1308
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1309
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1298
1310
|
// Parse items - automatically handle JSON string responses
|
|
1299
1311
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1300
1312
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1545,7 +1557,7 @@ class BaseService {
|
|
|
1545
1557
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1546
1558
|
// Prepare request parameters based on pagination type
|
|
1547
1559
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1548
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1560
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1549
1561
|
if (method.toUpperCase() === 'POST') {
|
|
1550
1562
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1551
1563
|
options.body = {
|
|
@@ -1553,6 +1565,7 @@ class BaseService {
|
|
|
1553
1565
|
...options.params,
|
|
1554
1566
|
...requestParams
|
|
1555
1567
|
};
|
|
1568
|
+
options.params = undefined;
|
|
1556
1569
|
}
|
|
1557
1570
|
else {
|
|
1558
1571
|
// Merge pagination parameters with existing parameters
|
|
@@ -1593,7 +1606,6 @@ class BaseService {
|
|
|
1593
1606
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1594
1607
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1595
1608
|
}
|
|
1596
|
-
// Include total count for ODATA APIs
|
|
1597
1609
|
{
|
|
1598
1610
|
requestParams[countParam] = true;
|
|
1599
1611
|
}
|
|
@@ -1621,8 +1633,9 @@ class BaseService {
|
|
|
1621
1633
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1622
1634
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1623
1635
|
// Extract items and metadata
|
|
1624
|
-
|
|
1625
|
-
const
|
|
1636
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1637
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1638
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1626
1639
|
const continuationToken = response.data[continuationTokenField];
|
|
1627
1640
|
// Determine if there are more pages
|
|
1628
1641
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1707,7 +1720,7 @@ const PROCESS_ENDPOINTS = {
|
|
|
1707
1720
|
// Connection string placeholder that will be replaced during build
|
|
1708
1721
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
1709
1722
|
// SDK Version placeholder
|
|
1710
|
-
const SDK_VERSION = "1.3.
|
|
1723
|
+
const SDK_VERSION = "1.3.4";
|
|
1711
1724
|
const VERSION = "Version";
|
|
1712
1725
|
const SERVICE = "Service";
|
|
1713
1726
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/queues/index.cjs
CHANGED
|
@@ -506,6 +506,8 @@ class ErrorFactory {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
509
|
+
const TRACEPARENT = 'traceparent';
|
|
510
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
509
511
|
/**
|
|
510
512
|
* Content type constants for HTTP requests/responses
|
|
511
513
|
*/
|
|
@@ -559,8 +561,13 @@ class ApiClient {
|
|
|
559
561
|
if (isFormData) {
|
|
560
562
|
delete defaultHeaders['Content-Type'];
|
|
561
563
|
}
|
|
564
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
565
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
566
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
562
567
|
const headers = {
|
|
563
568
|
...defaultHeaders,
|
|
569
|
+
[TRACEPARENT]: traceparentValue,
|
|
570
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
564
571
|
...options.headers
|
|
565
572
|
};
|
|
566
573
|
// Convert params to URLSearchParams
|
|
@@ -600,7 +607,11 @@ class ApiClient {
|
|
|
600
607
|
const text = await response.text();
|
|
601
608
|
return text;
|
|
602
609
|
}
|
|
603
|
-
|
|
610
|
+
const text = await response.text();
|
|
611
|
+
if (!text) {
|
|
612
|
+
return undefined;
|
|
613
|
+
}
|
|
614
|
+
return JSON.parse(text);
|
|
604
615
|
}
|
|
605
616
|
catch (error) {
|
|
606
617
|
// If it's already one of our errors, re-throw it
|
|
@@ -1232,8 +1243,9 @@ class PaginationHelpers {
|
|
|
1232
1243
|
});
|
|
1233
1244
|
}
|
|
1234
1245
|
// Extract and transform items from response
|
|
1235
|
-
|
|
1236
|
-
const
|
|
1246
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1247
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1248
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1237
1249
|
// Parse items - automatically handle JSON string responses
|
|
1238
1250
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1239
1251
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1484,7 +1496,7 @@ class BaseService {
|
|
|
1484
1496
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1485
1497
|
// Prepare request parameters based on pagination type
|
|
1486
1498
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1487
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1499
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1488
1500
|
if (method.toUpperCase() === 'POST') {
|
|
1489
1501
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1490
1502
|
options.body = {
|
|
@@ -1492,6 +1504,7 @@ class BaseService {
|
|
|
1492
1504
|
...options.params,
|
|
1493
1505
|
...requestParams
|
|
1494
1506
|
};
|
|
1507
|
+
options.params = undefined;
|
|
1495
1508
|
}
|
|
1496
1509
|
else {
|
|
1497
1510
|
// Merge pagination parameters with existing parameters
|
|
@@ -1532,7 +1545,6 @@ class BaseService {
|
|
|
1532
1545
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1533
1546
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1534
1547
|
}
|
|
1535
|
-
// Include total count for ODATA APIs
|
|
1536
1548
|
{
|
|
1537
1549
|
requestParams[countParam] = true;
|
|
1538
1550
|
}
|
|
@@ -1560,8 +1572,9 @@ class BaseService {
|
|
|
1560
1572
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1561
1573
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1562
1574
|
// Extract items and metadata
|
|
1563
|
-
|
|
1564
|
-
const
|
|
1575
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1576
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1577
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1565
1578
|
const continuationToken = response.data[continuationTokenField];
|
|
1566
1579
|
// Determine if there are more pages
|
|
1567
1580
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1673,7 +1686,7 @@ const QueueMap = {
|
|
|
1673
1686
|
// Connection string placeholder that will be replaced during build
|
|
1674
1687
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
1675
1688
|
// SDK Version placeholder
|
|
1676
|
-
const SDK_VERSION = "1.3.
|
|
1689
|
+
const SDK_VERSION = "1.3.4";
|
|
1677
1690
|
const VERSION = "Version";
|
|
1678
1691
|
const SERVICE = "Service";
|
|
1679
1692
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/queues/index.mjs
CHANGED
|
@@ -504,6 +504,8 @@ class ErrorFactory {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
507
|
+
const TRACEPARENT = 'traceparent';
|
|
508
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
507
509
|
/**
|
|
508
510
|
* Content type constants for HTTP requests/responses
|
|
509
511
|
*/
|
|
@@ -557,8 +559,13 @@ class ApiClient {
|
|
|
557
559
|
if (isFormData) {
|
|
558
560
|
delete defaultHeaders['Content-Type'];
|
|
559
561
|
}
|
|
562
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
563
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
564
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
560
565
|
const headers = {
|
|
561
566
|
...defaultHeaders,
|
|
567
|
+
[TRACEPARENT]: traceparentValue,
|
|
568
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
562
569
|
...options.headers
|
|
563
570
|
};
|
|
564
571
|
// Convert params to URLSearchParams
|
|
@@ -598,7 +605,11 @@ class ApiClient {
|
|
|
598
605
|
const text = await response.text();
|
|
599
606
|
return text;
|
|
600
607
|
}
|
|
601
|
-
|
|
608
|
+
const text = await response.text();
|
|
609
|
+
if (!text) {
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
return JSON.parse(text);
|
|
602
613
|
}
|
|
603
614
|
catch (error) {
|
|
604
615
|
// If it's already one of our errors, re-throw it
|
|
@@ -1230,8 +1241,9 @@ class PaginationHelpers {
|
|
|
1230
1241
|
});
|
|
1231
1242
|
}
|
|
1232
1243
|
// Extract and transform items from response
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1244
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1245
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1246
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1235
1247
|
// Parse items - automatically handle JSON string responses
|
|
1236
1248
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1237
1249
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1482,7 +1494,7 @@ class BaseService {
|
|
|
1482
1494
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1483
1495
|
// Prepare request parameters based on pagination type
|
|
1484
1496
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1485
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
1497
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
1486
1498
|
if (method.toUpperCase() === 'POST') {
|
|
1487
1499
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1488
1500
|
options.body = {
|
|
@@ -1490,6 +1502,7 @@ class BaseService {
|
|
|
1490
1502
|
...options.params,
|
|
1491
1503
|
...requestParams
|
|
1492
1504
|
};
|
|
1505
|
+
options.params = undefined;
|
|
1493
1506
|
}
|
|
1494
1507
|
else {
|
|
1495
1508
|
// Merge pagination parameters with existing parameters
|
|
@@ -1530,7 +1543,6 @@ class BaseService {
|
|
|
1530
1543
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
1531
1544
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1532
1545
|
}
|
|
1533
|
-
// Include total count for ODATA APIs
|
|
1534
1546
|
{
|
|
1535
1547
|
requestParams[countParam] = true;
|
|
1536
1548
|
}
|
|
@@ -1558,8 +1570,9 @@ class BaseService {
|
|
|
1558
1570
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1559
1571
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1560
1572
|
// Extract items and metadata
|
|
1561
|
-
|
|
1562
|
-
const
|
|
1573
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1574
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1575
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
1563
1576
|
const continuationToken = response.data[continuationTokenField];
|
|
1564
1577
|
// Determine if there are more pages
|
|
1565
1578
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1671,7 +1684,7 @@ const QueueMap = {
|
|
|
1671
1684
|
// Connection string placeholder that will be replaced during build
|
|
1672
1685
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
1673
1686
|
// SDK Version placeholder
|
|
1674
|
-
const SDK_VERSION = "1.3.
|
|
1687
|
+
const SDK_VERSION = "1.3.4";
|
|
1675
1688
|
const VERSION = "Version";
|
|
1676
1689
|
const SERVICE = "Service";
|
|
1677
1690
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/tasks/index.cjs
CHANGED
|
@@ -278,7 +278,7 @@ class NetworkError extends UiPathError {
|
|
|
278
278
|
// Connection string placeholder that will be replaced during build
|
|
279
279
|
const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
|
|
280
280
|
// SDK Version placeholder
|
|
281
|
-
const SDK_VERSION = "1.3.
|
|
281
|
+
const SDK_VERSION = "1.3.4";
|
|
282
282
|
const VERSION = "Version";
|
|
283
283
|
const SERVICE = "Service";
|
|
284
284
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -546,6 +546,21 @@ function track(nameOrOptions, options) {
|
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
548
|
|
|
549
|
+
exports.TaskUserType = void 0;
|
|
550
|
+
(function (TaskUserType) {
|
|
551
|
+
/** A user of this type is supposed to be used by a human. */
|
|
552
|
+
TaskUserType["User"] = "User";
|
|
553
|
+
/** A user of this type is automatically created when adding a robot, is associated with Robot role and it is used by a robot when communicating with Orchestrator. */
|
|
554
|
+
TaskUserType["Robot"] = "Robot";
|
|
555
|
+
/** A user of type Directory User */
|
|
556
|
+
TaskUserType["DirectoryUser"] = "DirectoryUser";
|
|
557
|
+
/** A user of type Directory Group */
|
|
558
|
+
TaskUserType["DirectoryGroup"] = "DirectoryGroup";
|
|
559
|
+
/** A user of type Directory Robot Account */
|
|
560
|
+
TaskUserType["DirectoryRobot"] = "DirectoryRobot";
|
|
561
|
+
/** A user of type Directory External Application */
|
|
562
|
+
TaskUserType["DirectoryExternalApplication"] = "DirectoryExternalApplication";
|
|
563
|
+
})(exports.TaskUserType || (exports.TaskUserType = {}));
|
|
549
564
|
/**
|
|
550
565
|
* Types of tasks available in Action Center.
|
|
551
566
|
* Each type determines the task's behavior, UI rendering, and completion requirements.
|
|
@@ -782,6 +797,8 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
782
797
|
};
|
|
783
798
|
|
|
784
799
|
const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
|
|
800
|
+
const TRACEPARENT = 'traceparent';
|
|
801
|
+
const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
|
|
785
802
|
/**
|
|
786
803
|
* Content type constants for HTTP requests/responses
|
|
787
804
|
*/
|
|
@@ -1411,8 +1428,9 @@ class PaginationHelpers {
|
|
|
1411
1428
|
});
|
|
1412
1429
|
}
|
|
1413
1430
|
// Extract and transform items from response
|
|
1414
|
-
|
|
1415
|
-
const
|
|
1431
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1432
|
+
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1433
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
|
|
1416
1434
|
// Parse items - automatically handle JSON string responses
|
|
1417
1435
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1418
1436
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1751,8 +1769,13 @@ class ApiClient {
|
|
|
1751
1769
|
if (isFormData) {
|
|
1752
1770
|
delete defaultHeaders['Content-Type'];
|
|
1753
1771
|
}
|
|
1772
|
+
const traceId = crypto.randomUUID().replace(/-/g, '');
|
|
1773
|
+
const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
|
|
1774
|
+
const traceparentValue = `00-${traceId}-${spanId}-01`;
|
|
1754
1775
|
const headers = {
|
|
1755
1776
|
...defaultHeaders,
|
|
1777
|
+
[TRACEPARENT]: traceparentValue,
|
|
1778
|
+
[UIPATH_TRACEPARENT_ID]: traceparentValue,
|
|
1756
1779
|
...options.headers
|
|
1757
1780
|
};
|
|
1758
1781
|
// Convert params to URLSearchParams
|
|
@@ -1792,7 +1815,11 @@ class ApiClient {
|
|
|
1792
1815
|
const text = await response.text();
|
|
1793
1816
|
return text;
|
|
1794
1817
|
}
|
|
1795
|
-
|
|
1818
|
+
const text = await response.text();
|
|
1819
|
+
if (!text) {
|
|
1820
|
+
return undefined;
|
|
1821
|
+
}
|
|
1822
|
+
return JSON.parse(text);
|
|
1796
1823
|
}
|
|
1797
1824
|
catch (error) {
|
|
1798
1825
|
// If it's already one of our errors, re-throw it
|
|
@@ -2074,7 +2101,7 @@ class BaseService {
|
|
|
2074
2101
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
2075
2102
|
// Prepare request parameters based on pagination type
|
|
2076
2103
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
2077
|
-
// For POST requests, merge pagination params into body; for GET, use query params
|
|
2104
|
+
// For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
|
|
2078
2105
|
if (method.toUpperCase() === 'POST') {
|
|
2079
2106
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
2080
2107
|
options.body = {
|
|
@@ -2082,6 +2109,7 @@ class BaseService {
|
|
|
2082
2109
|
...options.params,
|
|
2083
2110
|
...requestParams
|
|
2084
2111
|
};
|
|
2112
|
+
options.params = undefined;
|
|
2085
2113
|
}
|
|
2086
2114
|
else {
|
|
2087
2115
|
// Merge pagination parameters with existing parameters
|
|
@@ -2122,7 +2150,6 @@ class BaseService {
|
|
|
2122
2150
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
2123
2151
|
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
2124
2152
|
}
|
|
2125
|
-
// Include total count for ODATA APIs
|
|
2126
2153
|
{
|
|
2127
2154
|
requestParams[countParam] = true;
|
|
2128
2155
|
}
|
|
@@ -2150,8 +2177,9 @@ class BaseService {
|
|
|
2150
2177
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
2151
2178
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
2152
2179
|
// Extract items and metadata
|
|
2153
|
-
|
|
2154
|
-
const
|
|
2180
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
2181
|
+
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
2182
|
+
const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
|
|
2155
2183
|
const continuationToken = response.data[continuationTokenField];
|
|
2156
2184
|
// Determine if there are more pages
|
|
2157
2185
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -2255,15 +2283,15 @@ class TaskService extends BaseService {
|
|
|
2255
2283
|
return createTaskWithMethods(transformedData, this);
|
|
2256
2284
|
}
|
|
2257
2285
|
/**
|
|
2258
|
-
* Gets users in the given folder who have Tasks.View and Tasks.Edit permissions
|
|
2286
|
+
* Gets task users (users, robots, groups etc) in the given folder who have Tasks.View and Tasks.Edit permissions
|
|
2259
2287
|
*
|
|
2260
2288
|
* The method returns either:
|
|
2261
|
-
* - An array of users (when no pagination parameters are provided)
|
|
2289
|
+
* - An array of task users (when no pagination parameters are provided)
|
|
2262
2290
|
* - A paginated result with navigation cursors (when any pagination parameter is provided)
|
|
2263
2291
|
*
|
|
2264
|
-
* @param folderId - The folder ID to get users from
|
|
2292
|
+
* @param folderId - The folder ID to get task users from
|
|
2265
2293
|
* @param options - Optional query and pagination parameters
|
|
2266
|
-
* @returns Promise resolving to an array of users or paginated result
|
|
2294
|
+
* @returns Promise resolving to an array of task users or paginated result
|
|
2267
2295
|
*
|
|
2268
2296
|
* @example
|
|
2269
2297
|
* ```typescript
|
|
@@ -2274,7 +2302,7 @@ class TaskService extends BaseService {
|
|
|
2274
2302
|
* // Standard array return
|
|
2275
2303
|
* const users = await tasks.getUsers(123);
|
|
2276
2304
|
*
|
|
2277
|
-
* // Get users with filtering
|
|
2305
|
+
* // Get task users with filtering
|
|
2278
2306
|
* const users = await tasks.getUsers(123, {
|
|
2279
2307
|
* filter: "name eq 'abc'"
|
|
2280
2308
|
* });
|