@uipath/uipath-typescript 1.3.7 → 1.3.8
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 +40 -5
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.mjs +40 -5
- package/dist/attachments/index.cjs +40 -5
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +40 -5
- package/dist/buckets/index.cjs +40 -5
- package/dist/buckets/index.d.ts +1 -0
- package/dist/buckets/index.mjs +40 -5
- package/dist/cases/index.cjs +178 -5
- package/dist/cases/index.d.ts +158 -3
- package/dist/cases/index.mjs +179 -6
- package/dist/conversational-agent/index.cjs +40 -5
- package/dist/conversational-agent/index.d.ts +1 -0
- package/dist/conversational-agent/index.mjs +40 -5
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +40 -5
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.mjs +40 -5
- package/dist/feedback/index.cjs +291 -9
- package/dist/feedback/index.d.ts +418 -12
- package/dist/feedback/index.mjs +291 -9
- package/dist/index.cjs +178 -5
- package/dist/index.d.ts +413 -10
- package/dist/index.mjs +179 -6
- package/dist/index.umd.js +178 -5
- package/dist/jobs/index.cjs +40 -5
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +40 -5
- package/dist/maestro-processes/index.cjs +77 -5
- package/dist/maestro-processes/index.d.ts +1 -0
- package/dist/maestro-processes/index.mjs +77 -5
- package/dist/processes/index.cjs +40 -5
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +40 -5
- package/dist/queues/index.cjs +40 -5
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +40 -5
- package/dist/tasks/index.cjs +40 -5
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.mjs +40 -5
- package/package.json +1 -1
package/dist/assets/index.cjs
CHANGED
|
@@ -653,6 +653,27 @@ var PaginationType;
|
|
|
653
653
|
/**
|
|
654
654
|
* Collection of utility functions for working with objects
|
|
655
655
|
*/
|
|
656
|
+
/**
|
|
657
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
658
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
659
|
+
* Direct key match takes priority over nested traversal.
|
|
660
|
+
*/
|
|
661
|
+
function resolveNestedField(data, fieldPath) {
|
|
662
|
+
if (!data) {
|
|
663
|
+
return undefined;
|
|
664
|
+
}
|
|
665
|
+
if (fieldPath in data) {
|
|
666
|
+
return data[fieldPath];
|
|
667
|
+
}
|
|
668
|
+
if (!fieldPath.includes('.')) {
|
|
669
|
+
return undefined;
|
|
670
|
+
}
|
|
671
|
+
let value = data;
|
|
672
|
+
for (const part of fieldPath.split('.')) {
|
|
673
|
+
value = value?.[part];
|
|
674
|
+
}
|
|
675
|
+
return value;
|
|
676
|
+
}
|
|
656
677
|
/**
|
|
657
678
|
* Filters out undefined values from an object
|
|
658
679
|
* @param obj The source object
|
|
@@ -893,6 +914,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
893
914
|
TOKEN_PARAM: 'continuationToken'
|
|
894
915
|
};
|
|
895
916
|
|
|
917
|
+
/**
|
|
918
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
919
|
+
* Returns the original value if parsing fails.
|
|
920
|
+
*/
|
|
896
921
|
/**
|
|
897
922
|
* Transforms data by mapping fields according to the provided field mapping
|
|
898
923
|
* @param data The source data to transform
|
|
@@ -1247,7 +1272,8 @@ class PaginationHelpers {
|
|
|
1247
1272
|
// Extract and transform items from response
|
|
1248
1273
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1249
1274
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1250
|
-
const
|
|
1275
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1276
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1251
1277
|
// Parse items - automatically handle JSON string responses
|
|
1252
1278
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1253
1279
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1544,9 +1570,17 @@ class BaseService {
|
|
|
1544
1570
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1545
1571
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1546
1572
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1573
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1574
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1575
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1547
1576
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1548
|
-
if (
|
|
1549
|
-
|
|
1577
|
+
if (convertToSkip) {
|
|
1578
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1579
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
else {
|
|
1583
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1550
1584
|
}
|
|
1551
1585
|
{
|
|
1552
1586
|
requestParams[countParam] = true;
|
|
@@ -1577,7 +1611,8 @@ class BaseService {
|
|
|
1577
1611
|
// Extract items and metadata
|
|
1578
1612
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1579
1613
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1580
|
-
const
|
|
1614
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1615
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1581
1616
|
const continuationToken = response.data[continuationTokenField];
|
|
1582
1617
|
// Determine if there are more pages
|
|
1583
1618
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1855,7 +1890,7 @@ const AssetMap = {
|
|
|
1855
1890
|
// Connection string placeholder that will be replaced during build
|
|
1856
1891
|
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";
|
|
1857
1892
|
// SDK Version placeholder
|
|
1858
|
-
const SDK_VERSION = "1.3.
|
|
1893
|
+
const SDK_VERSION = "1.3.8";
|
|
1859
1894
|
const VERSION = "Version";
|
|
1860
1895
|
const SERVICE = "Service";
|
|
1861
1896
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/assets/index.d.ts
CHANGED
package/dist/assets/index.mjs
CHANGED
|
@@ -651,6 +651,27 @@ var PaginationType;
|
|
|
651
651
|
/**
|
|
652
652
|
* Collection of utility functions for working with objects
|
|
653
653
|
*/
|
|
654
|
+
/**
|
|
655
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
656
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
657
|
+
* Direct key match takes priority over nested traversal.
|
|
658
|
+
*/
|
|
659
|
+
function resolveNestedField(data, fieldPath) {
|
|
660
|
+
if (!data) {
|
|
661
|
+
return undefined;
|
|
662
|
+
}
|
|
663
|
+
if (fieldPath in data) {
|
|
664
|
+
return data[fieldPath];
|
|
665
|
+
}
|
|
666
|
+
if (!fieldPath.includes('.')) {
|
|
667
|
+
return undefined;
|
|
668
|
+
}
|
|
669
|
+
let value = data;
|
|
670
|
+
for (const part of fieldPath.split('.')) {
|
|
671
|
+
value = value?.[part];
|
|
672
|
+
}
|
|
673
|
+
return value;
|
|
674
|
+
}
|
|
654
675
|
/**
|
|
655
676
|
* Filters out undefined values from an object
|
|
656
677
|
* @param obj The source object
|
|
@@ -891,6 +912,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
891
912
|
TOKEN_PARAM: 'continuationToken'
|
|
892
913
|
};
|
|
893
914
|
|
|
915
|
+
/**
|
|
916
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
917
|
+
* Returns the original value if parsing fails.
|
|
918
|
+
*/
|
|
894
919
|
/**
|
|
895
920
|
* Transforms data by mapping fields according to the provided field mapping
|
|
896
921
|
* @param data The source data to transform
|
|
@@ -1245,7 +1270,8 @@ class PaginationHelpers {
|
|
|
1245
1270
|
// Extract and transform items from response
|
|
1246
1271
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1247
1272
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1248
|
-
const
|
|
1273
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1274
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1249
1275
|
// Parse items - automatically handle JSON string responses
|
|
1250
1276
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1251
1277
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1542,9 +1568,17 @@ class BaseService {
|
|
|
1542
1568
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1543
1569
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1544
1570
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1571
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1572
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1573
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1545
1574
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1546
|
-
if (
|
|
1547
|
-
|
|
1575
|
+
if (convertToSkip) {
|
|
1576
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1577
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
else {
|
|
1581
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1548
1582
|
}
|
|
1549
1583
|
{
|
|
1550
1584
|
requestParams[countParam] = true;
|
|
@@ -1575,7 +1609,8 @@ class BaseService {
|
|
|
1575
1609
|
// Extract items and metadata
|
|
1576
1610
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1577
1611
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1578
|
-
const
|
|
1612
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1613
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1579
1614
|
const continuationToken = response.data[continuationTokenField];
|
|
1580
1615
|
// Determine if there are more pages
|
|
1581
1616
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1853,7 +1888,7 @@ const AssetMap = {
|
|
|
1853
1888
|
// Connection string placeholder that will be replaced during build
|
|
1854
1889
|
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";
|
|
1855
1890
|
// SDK Version placeholder
|
|
1856
|
-
const SDK_VERSION = "1.3.
|
|
1891
|
+
const SDK_VERSION = "1.3.8";
|
|
1857
1892
|
const VERSION = "Version";
|
|
1858
1893
|
const SERVICE = "Service";
|
|
1859
1894
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -272,6 +272,10 @@ class NetworkError extends UiPathError {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
+
/**
|
|
276
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
277
|
+
* Returns the original value if parsing fails.
|
|
278
|
+
*/
|
|
275
279
|
/**
|
|
276
280
|
* Transforms data by mapping fields according to the provided field mapping
|
|
277
281
|
* @param data The source data to transform
|
|
@@ -476,7 +480,7 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
476
480
|
// Connection string placeholder that will be replaced during build
|
|
477
481
|
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
482
|
// SDK Version placeholder
|
|
479
|
-
const SDK_VERSION = "1.3.
|
|
483
|
+
const SDK_VERSION = "1.3.8";
|
|
480
484
|
const VERSION = "Version";
|
|
481
485
|
const SERVICE = "Service";
|
|
482
486
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -1130,6 +1134,27 @@ var PaginationType;
|
|
|
1130
1134
|
/**
|
|
1131
1135
|
* Collection of utility functions for working with objects
|
|
1132
1136
|
*/
|
|
1137
|
+
/**
|
|
1138
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
1139
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
1140
|
+
* Direct key match takes priority over nested traversal.
|
|
1141
|
+
*/
|
|
1142
|
+
function resolveNestedField(data, fieldPath) {
|
|
1143
|
+
if (!data) {
|
|
1144
|
+
return undefined;
|
|
1145
|
+
}
|
|
1146
|
+
if (fieldPath in data) {
|
|
1147
|
+
return data[fieldPath];
|
|
1148
|
+
}
|
|
1149
|
+
if (!fieldPath.includes('.')) {
|
|
1150
|
+
return undefined;
|
|
1151
|
+
}
|
|
1152
|
+
let value = data;
|
|
1153
|
+
for (const part of fieldPath.split('.')) {
|
|
1154
|
+
value = value?.[part];
|
|
1155
|
+
}
|
|
1156
|
+
return value;
|
|
1157
|
+
}
|
|
1133
1158
|
/**
|
|
1134
1159
|
* Filters out undefined values from an object
|
|
1135
1160
|
* @param obj The source object
|
|
@@ -1532,7 +1557,8 @@ class PaginationHelpers {
|
|
|
1532
1557
|
// Extract and transform items from response
|
|
1533
1558
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1534
1559
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1535
|
-
const
|
|
1560
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1561
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1536
1562
|
// Parse items - automatically handle JSON string responses
|
|
1537
1563
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1538
1564
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1829,9 +1855,17 @@ class BaseService {
|
|
|
1829
1855
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1830
1856
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1831
1857
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1858
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1859
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1860
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1832
1861
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1833
|
-
if (
|
|
1834
|
-
|
|
1862
|
+
if (convertToSkip) {
|
|
1863
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1864
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
else {
|
|
1868
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1835
1869
|
}
|
|
1836
1870
|
{
|
|
1837
1871
|
requestParams[countParam] = true;
|
|
@@ -1862,7 +1896,8 @@ class BaseService {
|
|
|
1862
1896
|
// Extract items and metadata
|
|
1863
1897
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1864
1898
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1865
|
-
const
|
|
1899
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1900
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1866
1901
|
const continuationToken = response.data[continuationTokenField];
|
|
1867
1902
|
// Determine if there are more pages
|
|
1868
1903
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -270,6 +270,10 @@ class NetworkError extends UiPathError {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
275
|
+
* Returns the original value if parsing fails.
|
|
276
|
+
*/
|
|
273
277
|
/**
|
|
274
278
|
* Transforms data by mapping fields according to the provided field mapping
|
|
275
279
|
* @param data The source data to transform
|
|
@@ -474,7 +478,7 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
474
478
|
// Connection string placeholder that will be replaced during build
|
|
475
479
|
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
480
|
// SDK Version placeholder
|
|
477
|
-
const SDK_VERSION = "1.3.
|
|
481
|
+
const SDK_VERSION = "1.3.8";
|
|
478
482
|
const VERSION = "Version";
|
|
479
483
|
const SERVICE = "Service";
|
|
480
484
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -1128,6 +1132,27 @@ var PaginationType;
|
|
|
1128
1132
|
/**
|
|
1129
1133
|
* Collection of utility functions for working with objects
|
|
1130
1134
|
*/
|
|
1135
|
+
/**
|
|
1136
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
1137
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
1138
|
+
* Direct key match takes priority over nested traversal.
|
|
1139
|
+
*/
|
|
1140
|
+
function resolveNestedField(data, fieldPath) {
|
|
1141
|
+
if (!data) {
|
|
1142
|
+
return undefined;
|
|
1143
|
+
}
|
|
1144
|
+
if (fieldPath in data) {
|
|
1145
|
+
return data[fieldPath];
|
|
1146
|
+
}
|
|
1147
|
+
if (!fieldPath.includes('.')) {
|
|
1148
|
+
return undefined;
|
|
1149
|
+
}
|
|
1150
|
+
let value = data;
|
|
1151
|
+
for (const part of fieldPath.split('.')) {
|
|
1152
|
+
value = value?.[part];
|
|
1153
|
+
}
|
|
1154
|
+
return value;
|
|
1155
|
+
}
|
|
1131
1156
|
/**
|
|
1132
1157
|
* Filters out undefined values from an object
|
|
1133
1158
|
* @param obj The source object
|
|
@@ -1530,7 +1555,8 @@ class PaginationHelpers {
|
|
|
1530
1555
|
// Extract and transform items from response
|
|
1531
1556
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1532
1557
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1533
|
-
const
|
|
1558
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1559
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1534
1560
|
// Parse items - automatically handle JSON string responses
|
|
1535
1561
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1536
1562
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1827,9 +1853,17 @@ class BaseService {
|
|
|
1827
1853
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1828
1854
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1829
1855
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1856
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1857
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1858
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1830
1859
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1831
|
-
if (
|
|
1832
|
-
|
|
1860
|
+
if (convertToSkip) {
|
|
1861
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1862
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
else {
|
|
1866
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1833
1867
|
}
|
|
1834
1868
|
{
|
|
1835
1869
|
requestParams[countParam] = true;
|
|
@@ -1860,7 +1894,8 @@ class BaseService {
|
|
|
1860
1894
|
// Extract items and metadata
|
|
1861
1895
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1862
1896
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1863
|
-
const
|
|
1897
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1898
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1864
1899
|
const continuationToken = response.data[continuationTokenField];
|
|
1865
1900
|
// Determine if there are more pages
|
|
1866
1901
|
const hasMore = this.determineHasMorePages(paginationType, {
|
package/dist/buckets/index.cjs
CHANGED
|
@@ -653,6 +653,27 @@ var PaginationType;
|
|
|
653
653
|
/**
|
|
654
654
|
* Collection of utility functions for working with objects
|
|
655
655
|
*/
|
|
656
|
+
/**
|
|
657
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
658
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
659
|
+
* Direct key match takes priority over nested traversal.
|
|
660
|
+
*/
|
|
661
|
+
function resolveNestedField(data, fieldPath) {
|
|
662
|
+
if (!data) {
|
|
663
|
+
return undefined;
|
|
664
|
+
}
|
|
665
|
+
if (fieldPath in data) {
|
|
666
|
+
return data[fieldPath];
|
|
667
|
+
}
|
|
668
|
+
if (!fieldPath.includes('.')) {
|
|
669
|
+
return undefined;
|
|
670
|
+
}
|
|
671
|
+
let value = data;
|
|
672
|
+
for (const part of fieldPath.split('.')) {
|
|
673
|
+
value = value?.[part];
|
|
674
|
+
}
|
|
675
|
+
return value;
|
|
676
|
+
}
|
|
656
677
|
/**
|
|
657
678
|
* Filters out undefined values from an object
|
|
658
679
|
* @param obj The source object
|
|
@@ -902,6 +923,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
902
923
|
TOKEN_PARAM: 'continuationToken'
|
|
903
924
|
};
|
|
904
925
|
|
|
926
|
+
/**
|
|
927
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
928
|
+
* Returns the original value if parsing fails.
|
|
929
|
+
*/
|
|
905
930
|
/**
|
|
906
931
|
* Transforms data by mapping fields according to the provided field mapping
|
|
907
932
|
* @param data The source data to transform
|
|
@@ -1290,7 +1315,8 @@ class PaginationHelpers {
|
|
|
1290
1315
|
// Extract and transform items from response
|
|
1291
1316
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1292
1317
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1293
|
-
const
|
|
1318
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1319
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1294
1320
|
// Parse items - automatically handle JSON string responses
|
|
1295
1321
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1296
1322
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1587,9 +1613,17 @@ class BaseService {
|
|
|
1587
1613
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1588
1614
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1589
1615
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1616
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1617
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1618
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1590
1619
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1591
|
-
if (
|
|
1592
|
-
|
|
1620
|
+
if (convertToSkip) {
|
|
1621
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1622
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
else {
|
|
1626
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1593
1627
|
}
|
|
1594
1628
|
{
|
|
1595
1629
|
requestParams[countParam] = true;
|
|
@@ -1620,7 +1654,8 @@ class BaseService {
|
|
|
1620
1654
|
// Extract items and metadata
|
|
1621
1655
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1622
1656
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1623
|
-
const
|
|
1657
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1658
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1624
1659
|
const continuationToken = response.data[continuationTokenField];
|
|
1625
1660
|
// Determine if there are more pages
|
|
1626
1661
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1902,7 +1937,7 @@ const BucketMap = {
|
|
|
1902
1937
|
// Connection string placeholder that will be replaced during build
|
|
1903
1938
|
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";
|
|
1904
1939
|
// SDK Version placeholder
|
|
1905
|
-
const SDK_VERSION = "1.3.
|
|
1940
|
+
const SDK_VERSION = "1.3.8";
|
|
1906
1941
|
const VERSION = "Version";
|
|
1907
1942
|
const SERVICE = "Service";
|
|
1908
1943
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
package/dist/buckets/index.d.ts
CHANGED
package/dist/buckets/index.mjs
CHANGED
|
@@ -651,6 +651,27 @@ var PaginationType;
|
|
|
651
651
|
/**
|
|
652
652
|
* Collection of utility functions for working with objects
|
|
653
653
|
*/
|
|
654
|
+
/**
|
|
655
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
656
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
657
|
+
* Direct key match takes priority over nested traversal.
|
|
658
|
+
*/
|
|
659
|
+
function resolveNestedField(data, fieldPath) {
|
|
660
|
+
if (!data) {
|
|
661
|
+
return undefined;
|
|
662
|
+
}
|
|
663
|
+
if (fieldPath in data) {
|
|
664
|
+
return data[fieldPath];
|
|
665
|
+
}
|
|
666
|
+
if (!fieldPath.includes('.')) {
|
|
667
|
+
return undefined;
|
|
668
|
+
}
|
|
669
|
+
let value = data;
|
|
670
|
+
for (const part of fieldPath.split('.')) {
|
|
671
|
+
value = value?.[part];
|
|
672
|
+
}
|
|
673
|
+
return value;
|
|
674
|
+
}
|
|
654
675
|
/**
|
|
655
676
|
* Filters out undefined values from an object
|
|
656
677
|
* @param obj The source object
|
|
@@ -900,6 +921,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
900
921
|
TOKEN_PARAM: 'continuationToken'
|
|
901
922
|
};
|
|
902
923
|
|
|
924
|
+
/**
|
|
925
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
926
|
+
* Returns the original value if parsing fails.
|
|
927
|
+
*/
|
|
903
928
|
/**
|
|
904
929
|
* Transforms data by mapping fields according to the provided field mapping
|
|
905
930
|
* @param data The source data to transform
|
|
@@ -1288,7 +1313,8 @@ class PaginationHelpers {
|
|
|
1288
1313
|
// Extract and transform items from response
|
|
1289
1314
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1290
1315
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1291
|
-
const
|
|
1316
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1317
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1292
1318
|
// Parse items - automatically handle JSON string responses
|
|
1293
1319
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1294
1320
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1585,9 +1611,17 @@ class BaseService {
|
|
|
1585
1611
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1586
1612
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1587
1613
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
1614
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1615
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1616
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1588
1617
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1589
|
-
if (
|
|
1590
|
-
|
|
1618
|
+
if (convertToSkip) {
|
|
1619
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
1620
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
else {
|
|
1624
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
1591
1625
|
}
|
|
1592
1626
|
{
|
|
1593
1627
|
requestParams[countParam] = true;
|
|
@@ -1618,7 +1652,8 @@ class BaseService {
|
|
|
1618
1652
|
// Extract items and metadata
|
|
1619
1653
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1620
1654
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1621
|
-
const
|
|
1655
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1656
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1622
1657
|
const continuationToken = response.data[continuationTokenField];
|
|
1623
1658
|
// Determine if there are more pages
|
|
1624
1659
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1900,7 +1935,7 @@ const BucketMap = {
|
|
|
1900
1935
|
// Connection string placeholder that will be replaced during build
|
|
1901
1936
|
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";
|
|
1902
1937
|
// SDK Version placeholder
|
|
1903
|
-
const SDK_VERSION = "1.3.
|
|
1938
|
+
const SDK_VERSION = "1.3.8";
|
|
1904
1939
|
const VERSION = "Version";
|
|
1905
1940
|
const SERVICE = "Service";
|
|
1906
1941
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|