@uipath/uipath-typescript 1.3.11 → 1.4.1
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 +1772 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1770 -0
- package/dist/agents/index.cjs +1995 -0
- package/dist/agents/index.d.ts +961 -0
- package/dist/agents/index.mjs +1993 -0
- package/dist/assets/index.cjs +171 -39
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +171 -39
- package/dist/attachments/index.cjs +53 -15
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +53 -15
- package/dist/buckets/index.cjs +151 -130
- package/dist/buckets/index.d.ts +198 -84
- package/dist/buckets/index.mjs +151 -130
- package/dist/cases/index.cjs +220 -23
- package/dist/cases/index.d.ts +148 -10
- package/dist/cases/index.mjs +220 -24
- package/dist/conversational-agent/index.cjs +140 -66
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +140 -66
- package/dist/core/index.cjs +445 -108
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +445 -108
- package/dist/entities/index.cjs +365 -102
- package/dist/entities/index.d.ts +446 -114
- package/dist/entities/index.mjs +365 -102
- package/dist/feedback/index.cjs +53 -15
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +53 -15
- package/dist/governance/index.cjs +1789 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1787 -0
- package/dist/index.cjs +1453 -444
- package/dist/index.d.ts +4150 -1742
- package/dist/index.mjs +1452 -445
- package/dist/index.umd.js +5035 -4009
- package/dist/jobs/index.cjs +53 -15
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +53 -15
- package/dist/maestro-processes/index.cjs +189 -27
- package/dist/maestro-processes/index.d.ts +131 -9
- package/dist/maestro-processes/index.mjs +189 -27
- package/dist/orchestrator-du-module/index.cjs +1788 -0
- package/dist/orchestrator-du-module/index.d.ts +757 -0
- package/dist/orchestrator-du-module/index.mjs +1785 -0
- package/dist/processes/index.cjs +53 -15
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +53 -15
- package/dist/queues/index.cjs +53 -15
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +53 -15
- package/dist/tasks/index.cjs +116 -19
- package/dist/tasks/index.d.ts +110 -4
- package/dist/tasks/index.mjs +117 -20
- package/dist/traces/index.cjs +340 -15
- package/dist/traces/index.d.ts +483 -2
- package/dist/traces/index.mjs +339 -16
- package/package.json +42 -2
package/dist/jobs/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
|
|
@@ -1232,12 +1258,18 @@ class PaginationHelpers {
|
|
|
1232
1258
|
* @returns Promise resolving to a paginated result
|
|
1233
1259
|
*/
|
|
1234
1260
|
static async getAllPaginated(params) {
|
|
1235
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1261
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1236
1262
|
const endpoint = getEndpoint(folderId);
|
|
1237
1263
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1264
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1265
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1266
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1267
|
+
const requestSpec = isPost
|
|
1268
|
+
? { body: additionalParams, params: queryParams }
|
|
1269
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1238
1270
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1239
1271
|
headers,
|
|
1240
|
-
|
|
1272
|
+
...requestSpec,
|
|
1241
1273
|
pagination: {
|
|
1242
1274
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1243
1275
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1262,7 +1294,7 @@ class PaginationHelpers {
|
|
|
1262
1294
|
* @returns Promise resolving to an object with data and totalCount
|
|
1263
1295
|
*/
|
|
1264
1296
|
static async getAllNonPaginated(params) {
|
|
1265
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1297
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1266
1298
|
// Set default field names
|
|
1267
1299
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1268
1300
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1272,17 +1304,18 @@ class PaginationHelpers {
|
|
|
1272
1304
|
// Make the API call based on method
|
|
1273
1305
|
let response;
|
|
1274
1306
|
if (method === HTTP_METHODS.POST) {
|
|
1275
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1307
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1276
1308
|
}
|
|
1277
1309
|
else {
|
|
1278
1310
|
response = await serviceAccess.get(endpoint, {
|
|
1279
|
-
params: additionalParams,
|
|
1311
|
+
params: { ...additionalParams, ...queryParams },
|
|
1280
1312
|
headers
|
|
1281
1313
|
});
|
|
1282
1314
|
}
|
|
1283
1315
|
// Extract and transform items from response
|
|
1284
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1285
|
-
|
|
1316
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1317
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1318
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1286
1319
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1287
1320
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1288
1321
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1328,8 +1361,9 @@ class PaginationHelpers {
|
|
|
1328
1361
|
getEndpoint: config.getEndpoint,
|
|
1329
1362
|
folderId,
|
|
1330
1363
|
headers: config.headers,
|
|
1331
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1364
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1332
1365
|
additionalParams: prefixedOptions,
|
|
1366
|
+
queryParams: config.queryParams,
|
|
1333
1367
|
transformFn: config.transformFn,
|
|
1334
1368
|
method: config.method,
|
|
1335
1369
|
options: {
|
|
@@ -1347,6 +1381,7 @@ class PaginationHelpers {
|
|
|
1347
1381
|
folderId,
|
|
1348
1382
|
headers: config.headers,
|
|
1349
1383
|
additionalParams: prefixedOptions,
|
|
1384
|
+
queryParams: config.queryParams,
|
|
1350
1385
|
transformFn: config.transformFn,
|
|
1351
1386
|
method: config.method,
|
|
1352
1387
|
options: {
|
|
@@ -1538,18 +1573,17 @@ class BaseService {
|
|
|
1538
1573
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1539
1574
|
// Prepare request parameters based on pagination type
|
|
1540
1575
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1541
|
-
//
|
|
1576
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1577
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1578
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1542
1579
|
if (method.toUpperCase() === 'POST') {
|
|
1543
1580
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1544
1581
|
options.body = {
|
|
1545
1582
|
...existingBody,
|
|
1546
|
-
...options.params,
|
|
1547
1583
|
...requestParams
|
|
1548
1584
|
};
|
|
1549
|
-
options.params = undefined;
|
|
1550
1585
|
}
|
|
1551
1586
|
else {
|
|
1552
|
-
// Merge pagination parameters with existing parameters
|
|
1553
1587
|
options.params = {
|
|
1554
1588
|
...options.params,
|
|
1555
1589
|
...requestParams
|
|
@@ -1586,6 +1620,8 @@ class BaseService {
|
|
|
1586
1620
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1587
1621
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1588
1622
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1623
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1624
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1589
1625
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1590
1626
|
if (convertToSkip) {
|
|
1591
1627
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1593,7 +1629,8 @@ class BaseService {
|
|
|
1593
1629
|
}
|
|
1594
1630
|
}
|
|
1595
1631
|
else {
|
|
1596
|
-
|
|
1632
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1633
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1597
1634
|
}
|
|
1598
1635
|
{
|
|
1599
1636
|
requestParams[countParam] = true;
|
|
@@ -1622,8 +1659,9 @@ class BaseService {
|
|
|
1622
1659
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1623
1660
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1624
1661
|
// Extract items and metadata
|
|
1625
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1626
|
-
|
|
1662
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1663
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1664
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1627
1665
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1628
1666
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1629
1667
|
const continuationToken = response.data[continuationTokenField];
|
package/dist/jobs/index.d.ts
CHANGED
package/dist/jobs/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
|
|
@@ -1230,12 +1256,18 @@ class PaginationHelpers {
|
|
|
1230
1256
|
* @returns Promise resolving to a paginated result
|
|
1231
1257
|
*/
|
|
1232
1258
|
static async getAllPaginated(params) {
|
|
1233
|
-
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1259
|
+
const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1234
1260
|
const endpoint = getEndpoint(folderId);
|
|
1235
1261
|
const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
|
|
1262
|
+
// On POST, the caller's options go in the body; queryParams stays in the URL.
|
|
1263
|
+
// On GET, everything is URL — queryParams merges with additionalParams.
|
|
1264
|
+
const isPost = method === HTTP_METHODS.POST;
|
|
1265
|
+
const requestSpec = isPost
|
|
1266
|
+
? { body: additionalParams, params: queryParams }
|
|
1267
|
+
: { params: { ...additionalParams, ...queryParams } };
|
|
1236
1268
|
const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
|
|
1237
1269
|
headers,
|
|
1238
|
-
|
|
1270
|
+
...requestSpec,
|
|
1239
1271
|
pagination: {
|
|
1240
1272
|
paginationType: options.paginationType || PaginationType.OFFSET,
|
|
1241
1273
|
itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
|
|
@@ -1260,7 +1292,7 @@ class PaginationHelpers {
|
|
|
1260
1292
|
* @returns Promise resolving to an object with data and totalCount
|
|
1261
1293
|
*/
|
|
1262
1294
|
static async getAllNonPaginated(params) {
|
|
1263
|
-
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1295
|
+
const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
|
|
1264
1296
|
// Set default field names
|
|
1265
1297
|
const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
|
|
1266
1298
|
const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
|
|
@@ -1270,17 +1302,18 @@ class PaginationHelpers {
|
|
|
1270
1302
|
// Make the API call based on method
|
|
1271
1303
|
let response;
|
|
1272
1304
|
if (method === HTTP_METHODS.POST) {
|
|
1273
|
-
response = await serviceAccess.post(endpoint, additionalParams, { headers });
|
|
1305
|
+
response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
|
|
1274
1306
|
}
|
|
1275
1307
|
else {
|
|
1276
1308
|
response = await serviceAccess.get(endpoint, {
|
|
1277
|
-
params: additionalParams,
|
|
1309
|
+
params: { ...additionalParams, ...queryParams },
|
|
1278
1310
|
headers
|
|
1279
1311
|
});
|
|
1280
1312
|
}
|
|
1281
1313
|
// Extract and transform items from response
|
|
1282
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1283
|
-
|
|
1314
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1315
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1316
|
+
const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
|
|
1284
1317
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1285
1318
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1286
1319
|
// Parse items - automatically handle JSON string responses
|
|
@@ -1326,8 +1359,9 @@ class PaginationHelpers {
|
|
|
1326
1359
|
getEndpoint: config.getEndpoint,
|
|
1327
1360
|
folderId,
|
|
1328
1361
|
headers: config.headers,
|
|
1329
|
-
paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
|
|
1362
|
+
paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
|
|
1330
1363
|
additionalParams: prefixedOptions,
|
|
1364
|
+
queryParams: config.queryParams,
|
|
1331
1365
|
transformFn: config.transformFn,
|
|
1332
1366
|
method: config.method,
|
|
1333
1367
|
options: {
|
|
@@ -1345,6 +1379,7 @@ class PaginationHelpers {
|
|
|
1345
1379
|
folderId,
|
|
1346
1380
|
headers: config.headers,
|
|
1347
1381
|
additionalParams: prefixedOptions,
|
|
1382
|
+
queryParams: config.queryParams,
|
|
1348
1383
|
transformFn: config.transformFn,
|
|
1349
1384
|
method: config.method,
|
|
1350
1385
|
options: {
|
|
@@ -1536,18 +1571,17 @@ class BaseService {
|
|
|
1536
1571
|
const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
|
|
1537
1572
|
// Prepare request parameters based on pagination type
|
|
1538
1573
|
const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
|
|
1539
|
-
//
|
|
1574
|
+
// Route pagination state to wherever the API expects it (body for POST, URL for GET).
|
|
1575
|
+
// Caller-supplied options.body / options.params are respected as-is — the api-client
|
|
1576
|
+
// already handles params (URL) and body (request body) independently for every method.
|
|
1540
1577
|
if (method.toUpperCase() === 'POST') {
|
|
1541
1578
|
const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
|
|
1542
1579
|
options.body = {
|
|
1543
1580
|
...existingBody,
|
|
1544
|
-
...options.params,
|
|
1545
1581
|
...requestParams
|
|
1546
1582
|
};
|
|
1547
|
-
options.params = undefined;
|
|
1548
1583
|
}
|
|
1549
1584
|
else {
|
|
1550
|
-
// Merge pagination parameters with existing parameters
|
|
1551
1585
|
options.params = {
|
|
1552
1586
|
...options.params,
|
|
1553
1587
|
...requestParams
|
|
@@ -1584,6 +1618,8 @@ class BaseService {
|
|
|
1584
1618
|
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
1585
1619
|
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
1586
1620
|
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
1621
|
+
// When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
|
|
1622
|
+
const zeroBased = paginationParams?.zeroBased ?? false;
|
|
1587
1623
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1588
1624
|
if (convertToSkip) {
|
|
1589
1625
|
if (params.pageNumber && params.pageNumber > 1) {
|
|
@@ -1591,7 +1627,8 @@ class BaseService {
|
|
|
1591
1627
|
}
|
|
1592
1628
|
}
|
|
1593
1629
|
else {
|
|
1594
|
-
|
|
1630
|
+
const sdkPageNumber = params.pageNumber || 1;
|
|
1631
|
+
requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
|
|
1595
1632
|
}
|
|
1596
1633
|
{
|
|
1597
1634
|
requestParams[countParam] = true;
|
|
@@ -1620,8 +1657,9 @@ class BaseService {
|
|
|
1620
1657
|
const totalCountField = fields.totalCountField || 'totalRecordCount';
|
|
1621
1658
|
const continuationTokenField = fields.continuationTokenField || 'continuationToken';
|
|
1622
1659
|
// Extract items and metadata
|
|
1623
|
-
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1624
|
-
|
|
1660
|
+
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
|
|
1661
|
+
// itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
|
|
1662
|
+
const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
|
|
1625
1663
|
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1626
1664
|
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1627
1665
|
const continuationToken = response.data[continuationTokenField];
|