@uipath/uipath-typescript 1.3.10 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-memory/index.cjs +1765 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1763 -0
- package/dist/agents/index.cjs +1726 -0
- package/dist/agents/index.d.ts +502 -0
- package/dist/agents/index.mjs +1724 -0
- package/dist/assets/index.cjs +155 -30
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +155 -30
- package/dist/attachments/index.cjs +37 -6
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +37 -6
- package/dist/buckets/index.cjs +37 -6
- package/dist/buckets/index.d.ts +1 -0
- package/dist/buckets/index.mjs +37 -6
- package/dist/cases/index.cjs +192 -10
- package/dist/cases/index.d.ts +208 -7
- package/dist/cases/index.mjs +192 -11
- package/dist/conversational-agent/index.cjs +124 -57
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +124 -57
- package/dist/core/index.cjs +413 -105
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +413 -105
- package/dist/entities/index.cjs +135 -70
- package/dist/entities/index.d.ts +146 -45
- package/dist/entities/index.mjs +135 -70
- package/dist/feedback/index.cjs +37 -6
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +37 -6
- package/dist/governance/index.cjs +1782 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1780 -0
- package/dist/index.cjs +1050 -291
- package/dist/index.d.ts +1313 -134
- package/dist/index.mjs +1050 -292
- package/dist/index.umd.js +4546 -3770
- package/dist/jobs/index.cjs +37 -6
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +37 -6
- package/dist/maestro-processes/index.cjs +224 -18
- package/dist/maestro-processes/index.d.ts +221 -9
- package/dist/maestro-processes/index.mjs +224 -18
- package/dist/processes/index.cjs +37 -6
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +37 -6
- package/dist/queues/index.cjs +37 -6
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +37 -6
- package/dist/tasks/index.cjs +37 -6
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.mjs +37 -6
- package/dist/traces/index.cjs +1933 -0
- package/dist/traces/index.d.ts +566 -0
- package/dist/traces/index.mjs +1931 -0
- package/package.json +42 -2
|
@@ -958,6 +958,32 @@ function filterUndefined(obj) {
|
|
|
958
958
|
*/
|
|
959
959
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
960
960
|
isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
|
|
961
|
+
const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
|
|
962
|
+
/**
|
|
963
|
+
* True when the coded app has been loaded inside a host frame that explicitly
|
|
964
|
+
* opted into token delegation by adding `?host=embed` to the iframe src URL.
|
|
965
|
+
*/
|
|
966
|
+
const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
|
|
967
|
+
/**
|
|
968
|
+
* The validated parent origin, read from the `?basedomain=` query param set
|
|
969
|
+
* by the embedding host in the iframe src URL.
|
|
970
|
+
* Mirrors the same mechanism used by ActionCenterTokenManager.
|
|
971
|
+
* Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
|
|
972
|
+
*/
|
|
973
|
+
(() => {
|
|
974
|
+
if (!isHostEmbedded)
|
|
975
|
+
return null;
|
|
976
|
+
const basedomain = _params?.get('basedomain');
|
|
977
|
+
if (!basedomain)
|
|
978
|
+
return null;
|
|
979
|
+
try {
|
|
980
|
+
return new URL(basedomain).origin;
|
|
981
|
+
}
|
|
982
|
+
catch {
|
|
983
|
+
console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
|
|
984
|
+
return null;
|
|
985
|
+
}
|
|
986
|
+
})();
|
|
961
987
|
|
|
962
988
|
/**
|
|
963
989
|
* Base64 encoding/decoding
|
|
@@ -1322,8 +1348,9 @@ class PaginationHelpers {
|
|
|
1322
1348
|
});
|
|
1323
1349
|
}
|
|
1324
1350
|
// Extract and transform items from response
|
|
1325
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1326
|
-
|
|
1351
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1352
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1353
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1327
1354
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1328
1355
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1329
1356
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1369,7 +1396,7 @@ class PaginationHelpers {
|
|
|
1369
1396
|
getEndpoint: config.getEndpoint,
|
|
1370
1397
|
folderId,
|
|
1371
1398
|
headers: config.headers,
|
|
1372
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1399
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1373
1400
|
additionalParams: prefixedOptions,
|
|
1374
1401
|
transformFn: config.transformFn,
|
|
1375
1402
|
method: config.method,
|
|
@@ -1627,6 +1654,8 @@ class BaseService {
|
|
|
1627
1654
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1628
1655
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1629
1656
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1657
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1658
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1630
1659
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1631
1660
|
if (convertToSkip) {
|
|
1632
1661
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1634,7 +1663,8 @@ class BaseService {
|
|
|
1634
1663
|
}
|
|
1635
1664
|
}
|
|
1636
1665
|
else {
|
|
1637
|
-
|
|
1666
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1667
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1638
1668
|
}
|
|
1639
1669
|
{
|
|
1640
1670
|
requestParams[countParam] = true;
|
|
@@ -1663,8 +1693,9 @@ class BaseService {
|
|
|
1663
1693
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1664
1694
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1665
1695
|
// Extract items and metadata
|
|
1666
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1667
|
-
|
|
1696
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1697
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1698
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1668
1699
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1669
1700
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1670
1701
|
const continuationToken = response.data[continuationTokenField];
|
|
@@ -956,6 +956,32 @@ function filterUndefined(obj) {
|
|
|
956
956
|
*/
|
|
957
957
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
958
958
|
isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
|
|
959
|
+
const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
|
|
960
|
+
/**
|
|
961
|
+
* True when the coded app has been loaded inside a host frame that explicitly
|
|
962
|
+
* opted into token delegation by adding `?host=embed` to the iframe src URL.
|
|
963
|
+
*/
|
|
964
|
+
const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
|
|
965
|
+
/**
|
|
966
|
+
* The validated parent origin, read from the `?basedomain=` query param set
|
|
967
|
+
* by the embedding host in the iframe src URL.
|
|
968
|
+
* Mirrors the same mechanism used by ActionCenterTokenManager.
|
|
969
|
+
* Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
|
|
970
|
+
*/
|
|
971
|
+
(() => {
|
|
972
|
+
if (!isHostEmbedded)
|
|
973
|
+
return null;
|
|
974
|
+
const basedomain = _params?.get('basedomain');
|
|
975
|
+
if (!basedomain)
|
|
976
|
+
return null;
|
|
977
|
+
try {
|
|
978
|
+
return new URL(basedomain).origin;
|
|
979
|
+
}
|
|
980
|
+
catch {
|
|
981
|
+
console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
|
|
982
|
+
return null;
|
|
983
|
+
}
|
|
984
|
+
})();
|
|
959
985
|
|
|
960
986
|
/**
|
|
961
987
|
* Base64 encoding/decoding
|
|
@@ -1320,8 +1346,9 @@ class PaginationHelpers {
|
|
|
1320
1346
|
});
|
|
1321
1347
|
}
|
|
1322
1348
|
// Extract and transform items from response
|
|
1323
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1324
|
-
|
|
1349
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1350
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1351
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1325
1352
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1326
1353
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1327
1354
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1367,7 +1394,7 @@ class PaginationHelpers {
|
|
|
1367
1394
|
getEndpoint: config.getEndpoint,
|
|
1368
1395
|
folderId,
|
|
1369
1396
|
headers: config.headers,
|
|
1370
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1397
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1371
1398
|
additionalParams: prefixedOptions,
|
|
1372
1399
|
transformFn: config.transformFn,
|
|
1373
1400
|
method: config.method,
|
|
@@ -1625,6 +1652,8 @@ class BaseService {
|
|
|
1625
1652
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1626
1653
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1627
1654
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1655
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1656
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1628
1657
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1629
1658
|
if (convertToSkip) {
|
|
1630
1659
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1632,7 +1661,8 @@ class BaseService {
|
|
|
1632
1661
|
}
|
|
1633
1662
|
}
|
|
1634
1663
|
else {
|
|
1635
|
-
|
|
1664
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1665
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1636
1666
|
}
|
|
1637
1667
|
{
|
|
1638
1668
|
requestParams[countParam] = true;
|
|
@@ -1661,8 +1691,9 @@ class BaseService {
|
|
|
1661
1691
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1662
1692
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1663
1693
|
// Extract items and metadata
|
|
1664
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1665
|
-
|
|
1694
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1695
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1696
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1666
1697
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1667
1698
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1668
1699
|
const continuationToken = response.data[continuationTokenField];
|
package/dist/buckets/index.cjs
CHANGED
|
@@ -721,6 +721,32 @@ function filterUndefined(obj) {
|
|
|
721
721
|
*/
|
|
722
722
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
723
723
|
isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
|
|
724
|
+
const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
|
|
725
|
+
/**
|
|
726
|
+
* True when the coded app has been loaded inside a host frame that explicitly
|
|
727
|
+
* opted into token delegation by adding `?host=embed` to the iframe src URL.
|
|
728
|
+
*/
|
|
729
|
+
const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
|
|
730
|
+
/**
|
|
731
|
+
* The validated parent origin, read from the `?basedomain=` query param set
|
|
732
|
+
* by the embedding host in the iframe src URL.
|
|
733
|
+
* Mirrors the same mechanism used by ActionCenterTokenManager.
|
|
734
|
+
* Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
|
|
735
|
+
*/
|
|
736
|
+
(() => {
|
|
737
|
+
if (!isHostEmbedded)
|
|
738
|
+
return null;
|
|
739
|
+
const basedomain = _params?.get('basedomain');
|
|
740
|
+
if (!basedomain)
|
|
741
|
+
return null;
|
|
742
|
+
try {
|
|
743
|
+
return new URL(basedomain).origin;
|
|
744
|
+
}
|
|
745
|
+
catch {
|
|
746
|
+
console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
|
|
747
|
+
return null;
|
|
748
|
+
}
|
|
749
|
+
})();
|
|
724
750
|
|
|
725
751
|
/**
|
|
726
752
|
* Base64 encoding/decoding
|
|
@@ -1324,8 +1350,9 @@ class PaginationHelpers {
|
|
|
1324
1350
|
});
|
|
1325
1351
|
}
|
|
1326
1352
|
// Extract and transform items from response
|
|
1327
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1328
|
-
|
|
1353
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1354
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1355
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1329
1356
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1330
1357
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1331
1358
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1371,7 +1398,7 @@ class PaginationHelpers {
|
|
|
1371
1398
|
getEndpoint: config.getEndpoint,
|
|
1372
1399
|
folderId,
|
|
1373
1400
|
headers: config.headers,
|
|
1374
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1401
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1375
1402
|
additionalParams: prefixedOptions,
|
|
1376
1403
|
transformFn: config.transformFn,
|
|
1377
1404
|
method: config.method,
|
|
@@ -1629,6 +1656,8 @@ class BaseService {
|
|
|
1629
1656
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1630
1657
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1631
1658
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1659
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1660
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1632
1661
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1633
1662
|
if (convertToSkip) {
|
|
1634
1663
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1636,7 +1665,8 @@ class BaseService {
|
|
|
1636
1665
|
}
|
|
1637
1666
|
}
|
|
1638
1667
|
else {
|
|
1639
|
-
|
|
1668
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1669
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1640
1670
|
}
|
|
1641
1671
|
{
|
|
1642
1672
|
requestParams[countParam] = true;
|
|
@@ -1665,8 +1695,9 @@ class BaseService {
|
|
|
1665
1695
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1666
1696
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1667
1697
|
// Extract items and metadata
|
|
1668
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1669
|
-
|
|
1698
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1699
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1700
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1670
1701
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1671
1702
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1672
1703
|
const continuationToken = response.data[continuationTokenField];
|
package/dist/buckets/index.d.ts
CHANGED
package/dist/buckets/index.mjs
CHANGED
|
@@ -719,6 +719,32 @@ function filterUndefined(obj) {
|
|
|
719
719
|
*/
|
|
720
720
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
721
721
|
isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
|
|
722
|
+
const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
|
|
723
|
+
/**
|
|
724
|
+
* True when the coded app has been loaded inside a host frame that explicitly
|
|
725
|
+
* opted into token delegation by adding `?host=embed` to the iframe src URL.
|
|
726
|
+
*/
|
|
727
|
+
const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
|
|
728
|
+
/**
|
|
729
|
+
* The validated parent origin, read from the `?basedomain=` query param set
|
|
730
|
+
* by the embedding host in the iframe src URL.
|
|
731
|
+
* Mirrors the same mechanism used by ActionCenterTokenManager.
|
|
732
|
+
* Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
|
|
733
|
+
*/
|
|
734
|
+
(() => {
|
|
735
|
+
if (!isHostEmbedded)
|
|
736
|
+
return null;
|
|
737
|
+
const basedomain = _params?.get('basedomain');
|
|
738
|
+
if (!basedomain)
|
|
739
|
+
return null;
|
|
740
|
+
try {
|
|
741
|
+
return new URL(basedomain).origin;
|
|
742
|
+
}
|
|
743
|
+
catch {
|
|
744
|
+
console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
|
|
745
|
+
return null;
|
|
746
|
+
}
|
|
747
|
+
})();
|
|
722
748
|
|
|
723
749
|
/**
|
|
724
750
|
* Base64 encoding/decoding
|
|
@@ -1322,8 +1348,9 @@ class PaginationHelpers {
|
|
|
1322
1348
|
});
|
|
1323
1349
|
}
|
|
1324
1350
|
// Extract and transform items from response
|
|
1325
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1326
|
-
|
|
1351
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1352
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1353
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1327
1354
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1328
1355
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1329
1356
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1369,7 +1396,7 @@ class PaginationHelpers {
|
|
|
1369
1396
|
getEndpoint: config.getEndpoint,
|
|
1370
1397
|
folderId,
|
|
1371
1398
|
headers: config.headers,
|
|
1372
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1399
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1373
1400
|
additionalParams: prefixedOptions,
|
|
1374
1401
|
transformFn: config.transformFn,
|
|
1375
1402
|
method: config.method,
|
|
@@ -1627,6 +1654,8 @@ class BaseService {
|
|
|
1627
1654
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1628
1655
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1629
1656
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1657
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1658
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1630
1659
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1631
1660
|
if (convertToSkip) {
|
|
1632
1661
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1634,7 +1663,8 @@ class BaseService {
|
|
|
1634
1663
|
}
|
|
1635
1664
|
}
|
|
1636
1665
|
else {
|
|
1637
|
-
|
|
1666
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1667
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1638
1668
|
}
|
|
1639
1669
|
{
|
|
1640
1670
|
requestParams[countParam] = true;
|
|
@@ -1663,8 +1693,9 @@ class BaseService {
|
|
|
1663
1693
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1664
1694
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1665
1695
|
// Extract items and metadata
|
|
1666
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1667
|
-
|
|
1696
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1697
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1698
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1668
1699
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1669
1700
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1670
1701
|
const continuationToken = response.data[continuationTokenField];
|