@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.
Files changed (59) hide show
  1. package/dist/agent-memory/index.cjs +1772 -0
  2. package/dist/agent-memory/index.d.ts +588 -0
  3. package/dist/agent-memory/index.mjs +1770 -0
  4. package/dist/agents/index.cjs +1995 -0
  5. package/dist/agents/index.d.ts +961 -0
  6. package/dist/agents/index.mjs +1993 -0
  7. package/dist/assets/index.cjs +171 -39
  8. package/dist/assets/index.d.ts +84 -5
  9. package/dist/assets/index.mjs +171 -39
  10. package/dist/attachments/index.cjs +53 -15
  11. package/dist/attachments/index.d.ts +1 -0
  12. package/dist/attachments/index.mjs +53 -15
  13. package/dist/buckets/index.cjs +151 -130
  14. package/dist/buckets/index.d.ts +198 -84
  15. package/dist/buckets/index.mjs +151 -130
  16. package/dist/cases/index.cjs +220 -23
  17. package/dist/cases/index.d.ts +148 -10
  18. package/dist/cases/index.mjs +220 -24
  19. package/dist/conversational-agent/index.cjs +140 -66
  20. package/dist/conversational-agent/index.d.ts +190 -122
  21. package/dist/conversational-agent/index.mjs +140 -66
  22. package/dist/core/index.cjs +445 -108
  23. package/dist/core/index.d.ts +15 -0
  24. package/dist/core/index.mjs +445 -108
  25. package/dist/entities/index.cjs +365 -102
  26. package/dist/entities/index.d.ts +446 -114
  27. package/dist/entities/index.mjs +365 -102
  28. package/dist/feedback/index.cjs +53 -15
  29. package/dist/feedback/index.d.ts +1 -0
  30. package/dist/feedback/index.mjs +53 -15
  31. package/dist/governance/index.cjs +1789 -0
  32. package/dist/governance/index.d.ts +598 -0
  33. package/dist/governance/index.mjs +1787 -0
  34. package/dist/index.cjs +1453 -444
  35. package/dist/index.d.ts +4150 -1742
  36. package/dist/index.mjs +1452 -445
  37. package/dist/index.umd.js +5035 -4009
  38. package/dist/jobs/index.cjs +53 -15
  39. package/dist/jobs/index.d.ts +1 -0
  40. package/dist/jobs/index.mjs +53 -15
  41. package/dist/maestro-processes/index.cjs +189 -27
  42. package/dist/maestro-processes/index.d.ts +131 -9
  43. package/dist/maestro-processes/index.mjs +189 -27
  44. package/dist/orchestrator-du-module/index.cjs +1788 -0
  45. package/dist/orchestrator-du-module/index.d.ts +757 -0
  46. package/dist/orchestrator-du-module/index.mjs +1785 -0
  47. package/dist/processes/index.cjs +53 -15
  48. package/dist/processes/index.d.ts +1 -0
  49. package/dist/processes/index.mjs +53 -15
  50. package/dist/queues/index.cjs +53 -15
  51. package/dist/queues/index.d.ts +1 -0
  52. package/dist/queues/index.mjs +53 -15
  53. package/dist/tasks/index.cjs +116 -19
  54. package/dist/tasks/index.d.ts +110 -4
  55. package/dist/tasks/index.mjs +117 -20
  56. package/dist/traces/index.cjs +340 -15
  57. package/dist/traces/index.d.ts +483 -2
  58. package/dist/traces/index.mjs +339 -16
  59. package/package.json +42 -2
@@ -720,6 +720,32 @@ function filterUndefined(obj) {
720
720
  */
721
721
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
722
722
  isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
723
+ const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
724
+ /**
725
+ * True when the coded app has been loaded inside a host frame that explicitly
726
+ * opted into token delegation by adding `?host=embed` to the iframe src URL.
727
+ */
728
+ const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
729
+ /**
730
+ * The validated parent origin, read from the `?basedomain=` query param set
731
+ * by the embedding host in the iframe src URL.
732
+ * Mirrors the same mechanism used by ActionCenterTokenManager.
733
+ * Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
734
+ */
735
+ (() => {
736
+ if (!isHostEmbedded)
737
+ return null;
738
+ const basedomain = _params?.get('basedomain');
739
+ if (!basedomain)
740
+ return null;
741
+ try {
742
+ return new URL(basedomain).origin;
743
+ }
744
+ catch {
745
+ console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
746
+ return null;
747
+ }
748
+ })();
723
749
 
724
750
  /**
725
751
  * Base64 encoding/decoding
@@ -1160,12 +1186,18 @@ class PaginationHelpers {
1160
1186
  * @returns Promise resolving to a paginated result
1161
1187
  */
1162
1188
  static async getAllPaginated(params) {
1163
- const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1189
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1164
1190
  const endpoint = getEndpoint(folderId);
1165
1191
  const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
1192
+ // On POST, the caller's options go in the body; queryParams stays in the URL.
1193
+ // On GET, everything is URL — queryParams merges with additionalParams.
1194
+ const isPost = method === HTTP_METHODS.POST;
1195
+ const requestSpec = isPost
1196
+ ? { body: additionalParams, params: queryParams }
1197
+ : { params: { ...additionalParams, ...queryParams } };
1166
1198
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
1167
1199
  headers,
1168
- params: additionalParams,
1200
+ ...requestSpec,
1169
1201
  pagination: {
1170
1202
  paginationType: options.paginationType || PaginationType.OFFSET,
1171
1203
  itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
@@ -1190,7 +1222,7 @@ class PaginationHelpers {
1190
1222
  * @returns Promise resolving to an object with data and totalCount
1191
1223
  */
1192
1224
  static async getAllNonPaginated(params) {
1193
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1225
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1194
1226
  // Set default field names
1195
1227
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
1196
1228
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
@@ -1200,17 +1232,18 @@ class PaginationHelpers {
1200
1232
  // Make the API call based on method
1201
1233
  let response;
1202
1234
  if (method === HTTP_METHODS.POST) {
1203
- response = await serviceAccess.post(endpoint, additionalParams, { headers });
1235
+ response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
1204
1236
  }
1205
1237
  else {
1206
1238
  response = await serviceAccess.get(endpoint, {
1207
- params: additionalParams,
1239
+ params: { ...additionalParams, ...queryParams },
1208
1240
  headers
1209
1241
  });
1210
1242
  }
1211
1243
  // Extract and transform items from response
1212
- // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1213
- const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1244
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
1245
+ // itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
1246
+ const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
1214
1247
  const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1215
1248
  const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1216
1249
  // Parse items - automatically handle JSON string responses
@@ -1256,8 +1289,9 @@ class PaginationHelpers {
1256
1289
  getEndpoint: config.getEndpoint,
1257
1290
  folderId,
1258
1291
  headers: config.headers,
1259
- paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
1292
+ paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
1260
1293
  additionalParams: prefixedOptions,
1294
+ queryParams: config.queryParams,
1261
1295
  transformFn: config.transformFn,
1262
1296
  method: config.method,
1263
1297
  options: {
@@ -1275,6 +1309,7 @@ class PaginationHelpers {
1275
1309
  folderId,
1276
1310
  headers: config.headers,
1277
1311
  additionalParams: prefixedOptions,
1312
+ queryParams: config.queryParams,
1278
1313
  transformFn: config.transformFn,
1279
1314
  method: config.method,
1280
1315
  options: {
@@ -1466,18 +1501,17 @@ class BaseService {
1466
1501
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1467
1502
  // Prepare request parameters based on pagination type
1468
1503
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1469
- // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1504
+ // Route pagination state to wherever the API expects it (body for POST, URL for GET).
1505
+ // Caller-supplied options.body / options.params are respected as-is — the api-client
1506
+ // already handles params (URL) and body (request body) independently for every method.
1470
1507
  if (method.toUpperCase() === 'POST') {
1471
1508
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1472
1509
  options.body = {
1473
1510
  ...existingBody,
1474
- ...options.params,
1475
1511
  ...requestParams
1476
1512
  };
1477
- options.params = undefined;
1478
1513
  }
1479
1514
  else {
1480
- // Merge pagination parameters with existing parameters
1481
1515
  options.params = {
1482
1516
  ...options.params,
1483
1517
  ...requestParams
@@ -1514,6 +1548,8 @@ class BaseService {
1514
1548
  // When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
1515
1549
  // When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
1516
1550
  const convertToSkip = paginationParams?.convertToSkip ?? true;
1551
+ // When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
1552
+ const zeroBased = paginationParams?.zeroBased ?? false;
1517
1553
  requestParams[pageSizeParam] = limitedPageSize;
1518
1554
  if (convertToSkip) {
1519
1555
  if (params.pageNumber && params.pageNumber > 1) {
@@ -1521,7 +1557,8 @@ class BaseService {
1521
1557
  }
1522
1558
  }
1523
1559
  else {
1524
- requestParams[offsetParam] = params.pageNumber || 1;
1560
+ const sdkPageNumber = params.pageNumber || 1;
1561
+ requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
1525
1562
  }
1526
1563
  {
1527
1564
  requestParams[countParam] = true;
@@ -1550,8 +1587,9 @@ class BaseService {
1550
1587
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1551
1588
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1552
1589
  // Extract items and metadata
1553
- // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1554
- const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1590
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
1591
+ // itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
1592
+ const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
1555
1593
  const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1556
1594
  const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1557
1595
  const continuationToken = response.data[continuationTokenField];
@@ -107,6 +107,7 @@ interface RequestWithPaginationOptions extends RequestSpec {
107
107
  tokenParam?: string;
108
108
  countParam?: string;
109
109
  convertToSkip?: boolean;
110
+ zeroBased?: boolean;
110
111
  };
111
112
  };
112
113
  }
@@ -718,6 +718,32 @@ function filterUndefined(obj) {
718
718
  */
719
719
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
720
720
  isBrowser && window.self != window.top && window.location.href.includes('source=ActionCenter');
721
+ const _params = isBrowser ? new URLSearchParams(window.location.search) : null;
722
+ /**
723
+ * True when the coded app has been loaded inside a host frame that explicitly
724
+ * opted into token delegation by adding `?host=embed` to the iframe src URL.
725
+ */
726
+ const isHostEmbedded = isBrowser && window.self !== window.top && _params?.get('host') === 'embed';
727
+ /**
728
+ * The validated parent origin, read from the `?basedomain=` query param set
729
+ * by the embedding host in the iframe src URL.
730
+ * Mirrors the same mechanism used by ActionCenterTokenManager.
731
+ * Non-null only when `?host=embed` is present and `?basedomain=` is a valid URL.
732
+ */
733
+ (() => {
734
+ if (!isHostEmbedded)
735
+ return null;
736
+ const basedomain = _params?.get('basedomain');
737
+ if (!basedomain)
738
+ return null;
739
+ try {
740
+ return new URL(basedomain).origin;
741
+ }
742
+ catch {
743
+ console.warn('embeddingOrigin: basedomain query param is not a valid URL', basedomain);
744
+ return null;
745
+ }
746
+ })();
721
747
 
722
748
  /**
723
749
  * Base64 encoding/decoding
@@ -1158,12 +1184,18 @@ class PaginationHelpers {
1158
1184
  * @returns Promise resolving to a paginated result
1159
1185
  */
1160
1186
  static async getAllPaginated(params) {
1161
- const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1187
+ const { serviceAccess, getEndpoint, folderId, headers: providedHeaders, paginationParams, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1162
1188
  const endpoint = getEndpoint(folderId);
1163
1189
  const headers = providedHeaders ?? (folderId ? createHeaders({ [FOLDER_ID]: folderId }) : {});
1190
+ // On POST, the caller's options go in the body; queryParams stays in the URL.
1191
+ // On GET, everything is URL — queryParams merges with additionalParams.
1192
+ const isPost = method === HTTP_METHODS.POST;
1193
+ const requestSpec = isPost
1194
+ ? { body: additionalParams, params: queryParams }
1195
+ : { params: { ...additionalParams, ...queryParams } };
1164
1196
  const paginatedResponse = await serviceAccess.requestWithPagination(method, endpoint, paginationParams, {
1165
1197
  headers,
1166
- params: additionalParams,
1198
+ ...requestSpec,
1167
1199
  pagination: {
1168
1200
  paginationType: options.paginationType || PaginationType.OFFSET,
1169
1201
  itemsField: options.itemsField || DEFAULT_ITEMS_FIELD,
@@ -1188,7 +1220,7 @@ class PaginationHelpers {
1188
1220
  * @returns Promise resolving to an object with data and totalCount
1189
1221
  */
1190
1222
  static async getAllNonPaginated(params) {
1191
- const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1223
+ const { serviceAccess, getAllEndpoint, getByFolderEndpoint, folderId, headers: providedHeaders, additionalParams, queryParams, transformFn, method = HTTP_METHODS.GET, options = {} } = params;
1192
1224
  // Set default field names
1193
1225
  const itemsField = options.itemsField || DEFAULT_ITEMS_FIELD;
1194
1226
  const totalCountField = options.totalCountField || DEFAULT_TOTAL_COUNT_FIELD;
@@ -1198,17 +1230,18 @@ class PaginationHelpers {
1198
1230
  // Make the API call based on method
1199
1231
  let response;
1200
1232
  if (method === HTTP_METHODS.POST) {
1201
- response = await serviceAccess.post(endpoint, additionalParams, { headers });
1233
+ response = await serviceAccess.post(endpoint, additionalParams, { headers, params: queryParams });
1202
1234
  }
1203
1235
  else {
1204
1236
  response = await serviceAccess.get(endpoint, {
1205
- params: additionalParams,
1237
+ params: { ...additionalParams, ...queryParams },
1206
1238
  headers
1207
1239
  });
1208
1240
  }
1209
1241
  // Extract and transform items from response
1210
- // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1211
- const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1242
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
1243
+ // itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
1244
+ const rawItems = Array.isArray(response.data) ? response.data : resolveNestedField(response.data, itemsField);
1212
1245
  const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1213
1246
  const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1214
1247
  // Parse items - automatically handle JSON string responses
@@ -1254,8 +1287,9 @@ class PaginationHelpers {
1254
1287
  getEndpoint: config.getEndpoint,
1255
1288
  folderId,
1256
1289
  headers: config.headers,
1257
- paginationParams: cursor ? { cursor, pageSize } : jumpToPage ? { jumpToPage, pageSize } : { pageSize },
1290
+ paginationParams: cursor ? { cursor, pageSize } : jumpToPage !== undefined ? { jumpToPage, pageSize } : { pageSize },
1258
1291
  additionalParams: prefixedOptions,
1292
+ queryParams: config.queryParams,
1259
1293
  transformFn: config.transformFn,
1260
1294
  method: config.method,
1261
1295
  options: {
@@ -1273,6 +1307,7 @@ class PaginationHelpers {
1273
1307
  folderId,
1274
1308
  headers: config.headers,
1275
1309
  additionalParams: prefixedOptions,
1310
+ queryParams: config.queryParams,
1276
1311
  transformFn: config.transformFn,
1277
1312
  method: config.method,
1278
1313
  options: {
@@ -1464,18 +1499,17 @@ class BaseService {
1464
1499
  const params = this.validateAndPreparePaginationParams(paginationType, paginationOptions);
1465
1500
  // Prepare request parameters based on pagination type
1466
1501
  const requestParams = this.preparePaginationRequestParams(paginationType, params, options.pagination);
1467
- // For POST requests, merge pagination params into body and set params to undefined; for GET, use query params
1502
+ // Route pagination state to wherever the API expects it (body for POST, URL for GET).
1503
+ // Caller-supplied options.body / options.params are respected as-is — the api-client
1504
+ // already handles params (URL) and body (request body) independently for every method.
1468
1505
  if (method.toUpperCase() === 'POST') {
1469
1506
  const existingBody = (options.body && typeof options.body === 'object') ? options.body : {};
1470
1507
  options.body = {
1471
1508
  ...existingBody,
1472
- ...options.params,
1473
1509
  ...requestParams
1474
1510
  };
1475
- options.params = undefined;
1476
1511
  }
1477
1512
  else {
1478
- // Merge pagination parameters with existing parameters
1479
1513
  options.params = {
1480
1514
  ...options.params,
1481
1515
  ...requestParams
@@ -1512,6 +1546,8 @@ class BaseService {
1512
1546
  // When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
1513
1547
  // When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
1514
1548
  const convertToSkip = paginationParams?.convertToSkip ?? true;
1549
+ // When true, sends pageNumber - 1 (for 0-based APIs). Default false (1-based).
1550
+ const zeroBased = paginationParams?.zeroBased ?? false;
1515
1551
  requestParams[pageSizeParam] = limitedPageSize;
1516
1552
  if (convertToSkip) {
1517
1553
  if (params.pageNumber && params.pageNumber > 1) {
@@ -1519,7 +1555,8 @@ class BaseService {
1519
1555
  }
1520
1556
  }
1521
1557
  else {
1522
- requestParams[offsetParam] = params.pageNumber || 1;
1558
+ const sdkPageNumber = params.pageNumber || 1;
1559
+ requestParams[offsetParam] = zeroBased ? sdkPageNumber - 1 : sdkPageNumber;
1523
1560
  }
1524
1561
  {
1525
1562
  requestParams[countParam] = true;
@@ -1548,8 +1585,9 @@ class BaseService {
1548
1585
  const totalCountField = fields.totalCountField || 'totalRecordCount';
1549
1586
  const continuationTokenField = fields.continuationTokenField || 'continuationToken';
1550
1587
  // Extract items and metadata
1551
- // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1552
- const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1588
+ // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N }).
1589
+ // itemsField may be a dotted path (e.g. 'data.agents') for nested envelopes.
1590
+ const items = Array.isArray(response.data) ? response.data : (resolveNestedField(response.data, itemsField) || []);
1553
1591
  const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1554
1592
  const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1555
1593
  const continuationToken = response.data[continuationTokenField];