@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.
Files changed (38) hide show
  1. package/dist/assets/index.cjs +21 -8
  2. package/dist/assets/index.mjs +21 -8
  3. package/dist/attachments/index.cjs +21 -8
  4. package/dist/attachments/index.mjs +21 -8
  5. package/dist/buckets/index.cjs +21 -8
  6. package/dist/buckets/index.mjs +21 -8
  7. package/dist/cases/index.cjs +41 -13
  8. package/dist/cases/index.d.ts +15 -0
  9. package/dist/cases/index.mjs +41 -13
  10. package/dist/conversational-agent/index.cjs +39 -8
  11. package/dist/conversational-agent/index.d.ts +55 -2
  12. package/dist/conversational-agent/index.mjs +39 -8
  13. package/dist/core/index.cjs +16 -1
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/index.mjs +16 -1
  16. package/dist/entities/index.cjs +55 -8
  17. package/dist/entities/index.d.ts +54 -0
  18. package/dist/entities/index.mjs +55 -8
  19. package/dist/feedback/index.cjs +1911 -0
  20. package/dist/feedback/index.d.ts +475 -0
  21. package/dist/feedback/index.mjs +1909 -0
  22. package/dist/index.cjs +451 -189
  23. package/dist/index.d.ts +388 -13
  24. package/dist/index.mjs +452 -190
  25. package/dist/index.umd.js +451 -189
  26. package/dist/jobs/index.cjs +384 -8
  27. package/dist/jobs/index.d.ts +220 -2
  28. package/dist/jobs/index.mjs +385 -9
  29. package/dist/maestro-processes/index.cjs +21 -8
  30. package/dist/maestro-processes/index.mjs +21 -8
  31. package/dist/processes/index.cjs +21 -8
  32. package/dist/processes/index.mjs +21 -8
  33. package/dist/queues/index.cjs +21 -8
  34. package/dist/queues/index.mjs +21 -8
  35. package/dist/tasks/index.cjs +41 -13
  36. package/dist/tasks/index.d.ts +25 -10
  37. package/dist/tasks/index.mjs +42 -14
  38. package/package.json +13 -2
@@ -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
- return response.json();
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
- const rawItems = response.data?.[itemsField];
1236
- const totalCount = response.data?.[totalCountField];
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
- const items = response.data[itemsField] || [];
1564
- const totalCount = response.data[totalCountField];
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, {
@@ -1672,7 +1685,7 @@ const AssetMap = {
1672
1685
  // Connection string placeholder that will be replaced during build
1673
1686
  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";
1674
1687
  // SDK Version placeholder
1675
- const SDK_VERSION = "1.3.2";
1688
+ const SDK_VERSION = "1.3.4";
1676
1689
  const VERSION = "Version";
1677
1690
  const SERVICE = "Service";
1678
1691
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -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
- return response.json();
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
- const rawItems = response.data?.[itemsField];
1234
- const totalCount = response.data?.[totalCountField];
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
- const items = response.data[itemsField] || [];
1562
- const totalCount = response.data[totalCountField];
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, {
@@ -1670,7 +1683,7 @@ const AssetMap = {
1670
1683
  // Connection string placeholder that will be replaced during build
1671
1684
  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";
1672
1685
  // SDK Version placeholder
1673
- const SDK_VERSION = "1.3.2";
1686
+ const SDK_VERSION = "1.3.4";
1674
1687
  const VERSION = "Version";
1675
1688
  const SERVICE = "Service";
1676
1689
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -476,7 +476,7 @@ const BUCKET_TOKEN_PARAMS = {
476
476
  // Connection string placeholder that will be replaced during build
477
477
  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";
478
478
  // SDK Version placeholder
479
- const SDK_VERSION = "1.3.2";
479
+ const SDK_VERSION = "1.3.4";
480
480
  const VERSION = "Version";
481
481
  const SERVICE = "Service";
482
482
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -985,6 +985,8 @@ class ErrorFactory {
985
985
  }
986
986
 
987
987
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
988
+ const TRACEPARENT = 'traceparent';
989
+ const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
988
990
  /**
989
991
  * Content type constants for HTTP requests/responses
990
992
  */
@@ -1038,8 +1040,13 @@ class ApiClient {
1038
1040
  if (isFormData) {
1039
1041
  delete defaultHeaders['Content-Type'];
1040
1042
  }
1043
+ const traceId = crypto.randomUUID().replace(/-/g, '');
1044
+ const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
1045
+ const traceparentValue = `00-${traceId}-${spanId}-01`;
1041
1046
  const headers = {
1042
1047
  ...defaultHeaders,
1048
+ [TRACEPARENT]: traceparentValue,
1049
+ [UIPATH_TRACEPARENT_ID]: traceparentValue,
1043
1050
  ...options.headers
1044
1051
  };
1045
1052
  // Convert params to URLSearchParams
@@ -1079,7 +1086,11 @@ class ApiClient {
1079
1086
  const text = await response.text();
1080
1087
  return text;
1081
1088
  }
1082
- return response.json();
1089
+ const text = await response.text();
1090
+ if (!text) {
1091
+ return undefined;
1092
+ }
1093
+ return JSON.parse(text);
1083
1094
  }
1084
1095
  catch (error) {
1085
1096
  // If it's already one of our errors, re-throw it
@@ -1519,8 +1530,9 @@ class PaginationHelpers {
1519
1530
  });
1520
1531
  }
1521
1532
  // Extract and transform items from response
1522
- const rawItems = response.data?.[itemsField];
1523
- const totalCount = response.data?.[totalCountField];
1533
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1534
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1535
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1524
1536
  // Parse items - automatically handle JSON string responses
1525
1537
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1526
1538
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1771,7 +1783,7 @@ class BaseService {
1771
1783
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1772
1784
  // Prepare request parameters based on pagination type
1773
1785
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1774
- // For POST requests, merge pagination params into body; for GET, use query params
1786
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1775
1787
  if (method.toUpperCase() === 'POST') {
1776
1788
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1777
1789
  options.body = {
@@ -1779,6 +1791,7 @@ class BaseService {
1779
1791
  ...options.params,
1780
1792
  ...requestParams
1781
1793
  };
1794
+ options.params = undefined;
1782
1795
  }
1783
1796
  else {
1784
1797
  // Merge pagination parameters with existing parameters
@@ -1819,7 +1832,6 @@ class BaseService {
1819
1832
  if (params.pageNumber && params.pageNumber > 1) {
1820
1833
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1821
1834
  }
1822
- // Include total count for ODATA APIs
1823
1835
  {
1824
1836
  requestParams[countParam] = true;
1825
1837
  }
@@ -1847,8 +1859,9 @@ class BaseService {
1847
1859
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1848
1860
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1849
1861
  // Extract items and metadata
1850
- const items = response.data[itemsField] || [];
1851
- const totalCount = response.data[totalCountField];
1862
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1863
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1864
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1852
1865
  const continuationToken = response.data[continuationTokenField];
1853
1866
  // Determine if there are more pages
1854
1867
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -474,7 +474,7 @@ const BUCKET_TOKEN_PARAMS = {
474
474
  // Connection string placeholder that will be replaced during build
475
475
  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";
476
476
  // SDK Version placeholder
477
- const SDK_VERSION = "1.3.2";
477
+ const SDK_VERSION = "1.3.4";
478
478
  const VERSION = "Version";
479
479
  const SERVICE = "Service";
480
480
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -983,6 +983,8 @@ class ErrorFactory {
983
983
  }
984
984
 
985
985
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
986
+ const TRACEPARENT = 'traceparent';
987
+ const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
986
988
  /**
987
989
  * Content type constants for HTTP requests/responses
988
990
  */
@@ -1036,8 +1038,13 @@ class ApiClient {
1036
1038
  if (isFormData) {
1037
1039
  delete defaultHeaders['Content-Type'];
1038
1040
  }
1041
+ const traceId = crypto.randomUUID().replace(/-/g, '');
1042
+ const spanId = crypto.randomUUID().replace(/-/g, '').slice(0, 16);
1043
+ const traceparentValue = `00-${traceId}-${spanId}-01`;
1039
1044
  const headers = {
1040
1045
  ...defaultHeaders,
1046
+ [TRACEPARENT]: traceparentValue,
1047
+ [UIPATH_TRACEPARENT_ID]: traceparentValue,
1041
1048
  ...options.headers
1042
1049
  };
1043
1050
  // Convert params to URLSearchParams
@@ -1077,7 +1084,11 @@ class ApiClient {
1077
1084
  const text = await response.text();
1078
1085
  return text;
1079
1086
  }
1080
- return response.json();
1087
+ const text = await response.text();
1088
+ if (!text) {
1089
+ return undefined;
1090
+ }
1091
+ return JSON.parse(text);
1081
1092
  }
1082
1093
  catch (error) {
1083
1094
  // If it's already one of our errors, re-throw it
@@ -1517,8 +1528,9 @@ class PaginationHelpers {
1517
1528
  });
1518
1529
  }
1519
1530
  // Extract and transform items from response
1520
- const rawItems = response.data?.[itemsField];
1521
- const totalCount = response.data?.[totalCountField];
1531
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1532
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1533
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1522
1534
  // Parse items - automatically handle JSON string responses
1523
1535
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1524
1536
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1769,7 +1781,7 @@ class BaseService {
1769
1781
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1770
1782
  // Prepare request parameters based on pagination type
1771
1783
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1772
- // For POST requests, merge pagination params into body; for GET, use query params
1784
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1773
1785
  if (method.toUpperCase() === 'POST') {
1774
1786
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1775
1787
  options.body = {
@@ -1777,6 +1789,7 @@ class BaseService {
1777
1789
  ...options.params,
1778
1790
  ...requestParams
1779
1791
  };
1792
+ options.params = undefined;
1780
1793
  }
1781
1794
  else {
1782
1795
  // Merge pagination parameters with existing parameters
@@ -1817,7 +1830,6 @@ class BaseService {
1817
1830
  if (params.pageNumber && params.pageNumber > 1) {
1818
1831
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1819
1832
  }
1820
- // Include total count for ODATA APIs
1821
1833
  {
1822
1834
  requestParams[countParam] = true;
1823
1835
  }
@@ -1845,8 +1857,9 @@ class BaseService {
1845
1857
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1846
1858
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1847
1859
  // Extract items and metadata
1848
- const items = response.data[itemsField] || [];
1849
- const totalCount = response.data[totalCountField];
1860
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1861
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1862
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1850
1863
  const continuationToken = response.data[continuationTokenField];
1851
1864
  // Determine if there are more pages
1852
1865
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -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
- return response.json();
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
@@ -1275,8 +1286,9 @@ class PaginationHelpers {
1275
1286
  });
1276
1287
  }
1277
1288
  // Extract and transform items from response
1278
- const rawItems = response.data?.[itemsField];
1279
- const totalCount = response.data?.[totalCountField];
1289
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1290
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1291
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1280
1292
  // Parse items - automatically handle JSON string responses
1281
1293
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1282
1294
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1527,7 +1539,7 @@ class BaseService {
1527
1539
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1528
1540
  // Prepare request parameters based on pagination type
1529
1541
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1530
- // For POST requests, merge pagination params into body; for GET, use query params
1542
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1531
1543
  if (method.toUpperCase() === 'POST') {
1532
1544
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1533
1545
  options.body = {
@@ -1535,6 +1547,7 @@ class BaseService {
1535
1547
  ...options.params,
1536
1548
  ...requestParams
1537
1549
  };
1550
+ options.params = undefined;
1538
1551
  }
1539
1552
  else {
1540
1553
  // Merge pagination parameters with existing parameters
@@ -1575,7 +1588,6 @@ class BaseService {
1575
1588
  if (params.pageNumber && params.pageNumber > 1) {
1576
1589
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1577
1590
  }
1578
- // Include total count for ODATA APIs
1579
1591
  {
1580
1592
  requestParams[countParam] = true;
1581
1593
  }
@@ -1603,8 +1615,9 @@ class BaseService {
1603
1615
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1604
1616
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1605
1617
  // Extract items and metadata
1606
- const items = response.data[itemsField] || [];
1607
- const totalCount = response.data[totalCountField];
1618
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1619
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1620
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1608
1621
  const continuationToken = response.data[continuationTokenField];
1609
1622
  // Determine if there are more pages
1610
1623
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -1719,7 +1732,7 @@ const BucketMap = {
1719
1732
  // Connection string placeholder that will be replaced during build
1720
1733
  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";
1721
1734
  // SDK Version placeholder
1722
- const SDK_VERSION = "1.3.2";
1735
+ const SDK_VERSION = "1.3.4";
1723
1736
  const VERSION = "Version";
1724
1737
  const SERVICE = "Service";
1725
1738
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -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
- return response.json();
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
@@ -1273,8 +1284,9 @@ class PaginationHelpers {
1273
1284
  });
1274
1285
  }
1275
1286
  // Extract and transform items from response
1276
- const rawItems = response.data?.[itemsField];
1277
- const totalCount = response.data?.[totalCountField];
1287
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1288
+ const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1289
+ const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1278
1290
  // Parse items - automatically handle JSON string responses
1279
1291
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1280
1292
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1525,7 +1537,7 @@ class BaseService {
1525
1537
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1526
1538
  // Prepare request parameters based on pagination type
1527
1539
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1528
- // For POST requests, merge pagination params into body; for GET, use query params
1540
+ // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1529
1541
  if (method.toUpperCase() === 'POST') {
1530
1542
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1531
1543
  options.body = {
@@ -1533,6 +1545,7 @@ class BaseService {
1533
1545
  ...options.params,
1534
1546
  ...requestParams
1535
1547
  };
1548
+ options.params = undefined;
1536
1549
  }
1537
1550
  else {
1538
1551
  // Merge pagination parameters with existing parameters
@@ -1573,7 +1586,6 @@ class BaseService {
1573
1586
  if (params.pageNumber && params.pageNumber > 1) {
1574
1587
  requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1575
1588
  }
1576
- // Include total count for ODATA APIs
1577
1589
  {
1578
1590
  requestParams[countParam] = true;
1579
1591
  }
@@ -1601,8 +1613,9 @@ class BaseService {
1601
1613
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1602
1614
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1603
1615
  // Extract items and metadata
1604
- const items = response.data[itemsField] || [];
1605
- const totalCount = response.data[totalCountField];
1616
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1617
+ const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1618
+ const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1606
1619
  const continuationToken = response.data[continuationTokenField];
1607
1620
  // Determine if there are more pages
1608
1621
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -1717,7 +1730,7 @@ const BucketMap = {
1717
1730
  // Connection string placeholder that will be replaced during build
1718
1731
  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";
1719
1732
  // SDK Version placeholder
1720
- const SDK_VERSION = "1.3.2";
1733
+ const SDK_VERSION = "1.3.4";
1721
1734
  const VERSION = "Version";
1722
1735
  const SERVICE = "Service";
1723
1736
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";