@uipath/uipath-typescript 1.3.6 → 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.
Files changed (44) hide show
  1. package/dist/assets/index.cjs +243 -6
  2. package/dist/assets/index.d.ts +113 -13
  3. package/dist/assets/index.mjs +243 -6
  4. package/dist/attachments/index.cjs +42 -6
  5. package/dist/attachments/index.d.ts +8 -0
  6. package/dist/attachments/index.mjs +42 -6
  7. package/dist/buckets/index.cjs +211 -6
  8. package/dist/buckets/index.d.ts +57 -12
  9. package/dist/buckets/index.mjs +211 -6
  10. package/dist/cases/index.cjs +180 -6
  11. package/dist/cases/index.d.ts +165 -3
  12. package/dist/cases/index.mjs +181 -7
  13. package/dist/conversational-agent/index.cjs +235 -85
  14. package/dist/conversational-agent/index.d.ts +327 -80
  15. package/dist/conversational-agent/index.mjs +234 -84
  16. package/dist/core/index.cjs +18 -6
  17. package/dist/core/index.d.ts +1 -1
  18. package/dist/core/index.mjs +18 -6
  19. package/dist/entities/index.cjs +74 -10
  20. package/dist/entities/index.d.ts +102 -11
  21. package/dist/entities/index.mjs +75 -11
  22. package/dist/feedback/index.cjs +293 -10
  23. package/dist/feedback/index.d.ts +425 -12
  24. package/dist/feedback/index.mjs +293 -10
  25. package/dist/index.cjs +463 -17
  26. package/dist/index.d.ts +885 -39
  27. package/dist/index.mjs +464 -18
  28. package/dist/index.umd.js +463 -17
  29. package/dist/jobs/index.cjs +211 -6
  30. package/dist/jobs/index.d.ts +68 -23
  31. package/dist/jobs/index.mjs +211 -6
  32. package/dist/maestro-processes/index.cjs +79 -6
  33. package/dist/maestro-processes/index.d.ts +8 -0
  34. package/dist/maestro-processes/index.mjs +79 -6
  35. package/dist/processes/index.cjs +279 -7
  36. package/dist/processes/index.d.ts +125 -2
  37. package/dist/processes/index.mjs +279 -7
  38. package/dist/queues/index.cjs +211 -6
  39. package/dist/queues/index.d.ts +57 -12
  40. package/dist/queues/index.mjs +211 -6
  41. package/dist/tasks/index.cjs +42 -6
  42. package/dist/tasks/index.d.ts +8 -0
  43. package/dist/tasks/index.mjs +42 -6
  44. package/package.json +1 -1
@@ -503,6 +503,8 @@ class ErrorFactory {
503
503
  }
504
504
  }
505
505
 
506
+ const FOLDER_KEY = 'X-UIPATH-FolderKey';
507
+ const FOLDER_PATH_ENCODED = 'X-UIPATH-FolderPath-Encoded';
506
508
  const FOLDER_ID = 'X-UIPATH-OrganizationUnitId';
507
509
  const TRACEPARENT = 'traceparent';
508
510
  const UIPATH_TRACEPARENT_ID = 'x-uipath-traceparent-id';
@@ -649,6 +651,27 @@ var PaginationType;
649
651
  /**
650
652
  * Collection of utility functions for working with objects
651
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
+ }
652
675
  /**
653
676
  * Filters out undefined values from an object
654
677
  * @param obj The source object
@@ -889,6 +912,10 @@ const BUCKET_TOKEN_PARAMS = {
889
912
  TOKEN_PARAM: 'continuationToken'
890
913
  };
891
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
+ */
892
919
  /**
893
920
  * Transforms data by mapping fields according to the provided field mapping
894
921
  * @param data The source data to transform
@@ -1243,7 +1270,8 @@ class PaginationHelpers {
1243
1270
  // Extract and transform items from response
1244
1271
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1245
1272
  const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1246
- const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1273
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1274
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1247
1275
  // Parse items - automatically handle JSON string responses
1248
1276
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1249
1277
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1419,8 +1447,9 @@ class BaseService {
1419
1447
  constructor(instance, headers) {
1420
1448
  // Private field - not visible via Object.keys() or any reflection
1421
1449
  _BaseService_apiClient.set(this, void 0);
1422
- const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
1450
+ const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
1423
1451
  __classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
1452
+ this.config = { folderKey };
1424
1453
  }
1425
1454
  /**
1426
1455
  * Gets a valid authentication token, refreshing if necessary.
@@ -1539,9 +1568,17 @@ class BaseService {
1539
1568
  const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
1540
1569
  const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
1541
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;
1542
1574
  requestParams[pageSizeParam] = limitedPageSize;
1543
- if (params.pageNumber && params.pageNumber > 1) {
1544
- requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
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;
1545
1582
  }
1546
1583
  {
1547
1584
  requestParams[countParam] = true;
@@ -1572,7 +1609,8 @@ class BaseService {
1572
1609
  // Extract items and metadata
1573
1610
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1574
1611
  const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1575
- const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1612
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1613
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1576
1614
  const continuationToken = response.data[continuationTokenField];
1577
1615
  // Determine if there are more pages
1578
1616
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -1617,6 +1655,111 @@ class BaseService {
1617
1655
  }
1618
1656
  _BaseService_apiClient = new WeakMap();
1619
1657
 
1658
+ /**
1659
+ * Validates the `name` argument passed to a `getByName(name, ...)` method.
1660
+ * Trims whitespace and rejects empty/whitespace-only names.
1661
+ *
1662
+ * @param resourceType - Resource label used in error messages (e.g. 'Asset', 'Process')
1663
+ * @param name - Resource name to validate
1664
+ * @returns The trimmed name
1665
+ * @throws ValidationError when `name` is missing or empty after trimming
1666
+ */
1667
+ function validateName(resourceType, name) {
1668
+ if (!name) {
1669
+ throw new ValidationError({
1670
+ message: `${resourceType} name is required and cannot be empty.`,
1671
+ });
1672
+ }
1673
+ const trimmed = name.trim();
1674
+ if (!trimmed) {
1675
+ throw new ValidationError({
1676
+ message: `${resourceType} name is required and cannot be empty.`,
1677
+ });
1678
+ }
1679
+ return trimmed;
1680
+ }
1681
+
1682
+ /**
1683
+ * Encodes a folder path for the `X-UIPATH-FolderPath-Encoded` header.
1684
+ *
1685
+ * Orchestrator decodes this header as **base64-encoded UTF-16 LE bytes**
1686
+ * (see `HttpHeadersProviderExtensions.GetDecoded` + `OrganizationUnitProvider`
1687
+ * in the Orchestrator repo, which call `Encoding.Unicode.GetString(...)`).
1688
+ * URL-encoding is NOT what the server expects — it must be base64-of-UTF-16-LE
1689
+ * bytes.
1690
+ *
1691
+ * @param folderPath - The folder path (e.g. 'Shared/Finance')
1692
+ * @returns Base64 string suitable for the `X-UIPATH-FolderPath-Encoded` header
1693
+ */
1694
+ function encodeFolderPathHeader(folderPath) {
1695
+ // Force little-endian regardless of host byte order. `Uint16Array` viewed
1696
+ // as `Uint8Array` would use the host's native order — correct on LE hosts
1697
+ // (x86/ARM-LE) but wrong on BE hosts. `DataView.setUint16(..., true)`
1698
+ // pins LE.
1699
+ const buf = new ArrayBuffer(folderPath.length * 2);
1700
+ const view = new DataView(buf);
1701
+ for (let i = 0; i < folderPath.length; i++) {
1702
+ view.setUint16(i * 2, folderPath.charCodeAt(i), true);
1703
+ }
1704
+ const bytes = new Uint8Array(buf);
1705
+ let binary = '';
1706
+ for (let i = 0; i < bytes.byteLength; i++) {
1707
+ binary += String.fromCharCode(bytes[i]);
1708
+ }
1709
+ // btoa is browser-native; Node 16+ also has it as a global
1710
+ return btoa(binary);
1711
+ }
1712
+
1713
+ /**
1714
+ * Resolves folder context into the appropriate Orchestrator folder headers.
1715
+ *
1716
+ * Centralized so all folder-scoped methods (e.g. `assets.getByName`,
1717
+ * `processes.getByName`, future Queues/Buckets/Jobs) share one implementation.
1718
+ *
1719
+ * Each input field maps directly to its header — no auto-detection or type
1720
+ * coercion. When multiple fields are supplied, all corresponding headers
1721
+ * are forwarded and the server resolves precedence.
1722
+ *
1723
+ * Routing:
1724
+ * - `folderId` → `X-UIPATH-OrganizationUnitId`
1725
+ * - `folderKey` → `X-UIPATH-FolderKey`
1726
+ * - `folderPath` → `X-UIPATH-FolderPath-Encoded`
1727
+ * - none set + `fallbackFolderKey` → fallback used as `X-UIPATH-FolderKey`
1728
+ * - none set + no fallback → `ValidationError`
1729
+ *
1730
+ * @throws ValidationError when no folder context can be resolved.
1731
+ */
1732
+ function resolveFolderHeaders(input) {
1733
+ const { folderId, folderKey, folderPath, resourceType, fallbackFolderKey } = input;
1734
+ const trimmedKey = folderKey?.trim();
1735
+ const trimmedPath = folderPath?.trim();
1736
+ const headers = {};
1737
+ if (folderId !== undefined) {
1738
+ headers[FOLDER_ID] = folderId;
1739
+ }
1740
+ if (trimmedKey) {
1741
+ headers[FOLDER_KEY] = trimmedKey;
1742
+ }
1743
+ if (trimmedPath) {
1744
+ headers[FOLDER_PATH_ENCODED] = encodeFolderPathHeader(trimmedPath);
1745
+ }
1746
+ // No explicit folder context → meta-tag fallback or error.
1747
+ if (Object.keys(headers).length === 0) {
1748
+ if (!fallbackFolderKey) {
1749
+ throw new ValidationError({
1750
+ message: `${resourceType} requires folder context: pass \`folderId\`, \`folderKey\`, or \`folderPath\`, or initialize the SDK with a folder context.`,
1751
+ });
1752
+ }
1753
+ headers[FOLDER_KEY] = fallbackFolderKey;
1754
+ }
1755
+ return createHeaders(headers);
1756
+ }
1757
+
1758
+ /**
1759
+ * Matches single-quote characters in OData string literals — escaped to `''`
1760
+ * inside the `$filter=Name eq '…'` clause built by `getByNameLookup`.
1761
+ */
1762
+ const SINGLE_QUOTE_RE = /'/g;
1620
1763
  /**
1621
1764
  * Base service for services that need folder-specific functionality.
1622
1765
  *
@@ -1650,6 +1793,68 @@ class FolderScopedService extends BaseService {
1650
1793
  }
1651
1794
  return response.data?.value;
1652
1795
  }
1796
+ /**
1797
+ * Look up a single resource by name on a folder-scoped OData collection.
1798
+ *
1799
+ * Shared by `getByName` implementations across services (Assets, Processes, etc).
1800
+ * Handles:
1801
+ * - Name validation via `validateName`
1802
+ * - Folder header resolution via `resolveFolderHeaders` (folderId → ID/key
1803
+ * header by type, folderPath → encoded path header, falls back to
1804
+ * init-time `config.folderKey` from the `uipath:folder-key` meta tag)
1805
+ * - OData `$filter=Name eq '…'` with single-quote escaping + `$top=1`
1806
+ * - Empty-result → `NotFoundError` with folder context in the message
1807
+ *
1808
+ * The transform step is caller-provided because each resource has its own
1809
+ * PascalCase → camelCase field mapping.
1810
+ *
1811
+ * @param resourceType - Resource label used in validation + error messages (e.g. 'Asset', 'Process')
1812
+ * @param endpoint - Folder-scoped OData collection endpoint
1813
+ * @param name - Resource name to search for
1814
+ * @param options - Folder scoping (`folderId` / `folderKey` / `folderPath`) + OData query options (`expand`, `select`)
1815
+ * @param transform - Maps a raw OData item to the typed response (e.g. PascalCase → camelCase via field map)
1816
+ * @throws ValidationError when inputs are malformed; NotFoundError when no match
1817
+ */
1818
+ async getByNameLookup(resourceType, endpoint, name, options, transform) {
1819
+ const validatedName = validateName(resourceType, name);
1820
+ const { folderId, folderKey, folderPath, ...queryOptions } = options;
1821
+ const headers = resolveFolderHeaders({
1822
+ folderId,
1823
+ folderKey,
1824
+ folderPath,
1825
+ resourceType: `${resourceType}.getByName`,
1826
+ fallbackFolderKey: this.config.folderKey,
1827
+ });
1828
+ const apiOptions = {
1829
+ ...addPrefixToKeys(queryOptions, ODATA_PREFIX, Object.keys(queryOptions)),
1830
+ '$filter': `Name eq '${validatedName.replace(SINGLE_QUOTE_RE, "''")}'`,
1831
+ '$top': '1',
1832
+ };
1833
+ const response = await this.get(endpoint, {
1834
+ headers,
1835
+ params: apiOptions,
1836
+ });
1837
+ const items = response.data?.value;
1838
+ if (!items?.length) {
1839
+ const folderHint = describeFolderForError(folderId, folderKey, folderPath);
1840
+ throw new NotFoundError({
1841
+ message: `${resourceType} '${validatedName}' not found${folderHint}.`,
1842
+ });
1843
+ }
1844
+ return transform(items[0]);
1845
+ }
1846
+ }
1847
+ /** Renders the supplied folder for a NotFoundError message. */
1848
+ function describeFolderForError(folderId, folderKey, folderPath) {
1849
+ const path = folderPath?.trim();
1850
+ if (path)
1851
+ return ` in folder '${path}'`;
1852
+ const key = folderKey?.trim();
1853
+ if (key)
1854
+ return ` in folder (key: ${key})`;
1855
+ if (typeof folderId === 'number')
1856
+ return ` in folder (id: ${folderId})`;
1857
+ return '';
1653
1858
  }
1654
1859
 
1655
1860
  /**
@@ -1751,7 +1956,7 @@ const JobMap = {
1751
1956
  // Connection string placeholder that will be replaced during build
1752
1957
  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";
1753
1958
  // SDK Version placeholder
1754
- const SDK_VERSION = "1.3.6";
1959
+ const SDK_VERSION = "1.3.8";
1755
1960
  const VERSION = "Version";
1756
1961
  const SERVICE = "Service";
1757
1962
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -652,6 +652,27 @@ var PaginationType;
652
652
  /**
653
653
  * Collection of utility functions for working with objects
654
654
  */
655
+ /**
656
+ * Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
657
+ * and dot-separated nested paths (e.g., 'pagination.totalCount').
658
+ * Direct key match takes priority over nested traversal.
659
+ */
660
+ function resolveNestedField(data, fieldPath) {
661
+ if (!data) {
662
+ return undefined;
663
+ }
664
+ if (fieldPath in data) {
665
+ return data[fieldPath];
666
+ }
667
+ if (!fieldPath.includes('.')) {
668
+ return undefined;
669
+ }
670
+ let value = data;
671
+ for (const part of fieldPath.split('.')) {
672
+ value = value?.[part];
673
+ }
674
+ return value;
675
+ }
655
676
  /**
656
677
  * Filters out undefined values from an object
657
678
  * @param obj The source object
@@ -903,6 +924,10 @@ const PROCESS_INSTANCE_TOKEN_PARAMS = {
903
924
  TOKEN_PARAM: 'nextPage'
904
925
  };
905
926
 
927
+ /**
928
+ * Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
929
+ * Returns the original value if parsing fails.
930
+ */
906
931
  /**
907
932
  * Transforms data by mapping fields according to the provided field mapping
908
933
  * @param data The source data to transform
@@ -1175,7 +1200,8 @@ class PaginationHelpers {
1175
1200
  // Extract and transform items from response
1176
1201
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1177
1202
  const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1178
- const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1203
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1204
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1179
1205
  // Parse items - automatically handle JSON string responses
1180
1206
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1181
1207
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1351,8 +1377,9 @@ class BaseService {
1351
1377
  constructor(instance, headers) {
1352
1378
  // Private field - not visible via Object.keys() or any reflection
1353
1379
  _BaseService_apiClient.set(this, void 0);
1354
- const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
1380
+ const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
1355
1381
  __classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
1382
+ this.config = { folderKey };
1356
1383
  }
1357
1384
  /**
1358
1385
  * Gets a valid authentication token, refreshing if necessary.
@@ -1471,9 +1498,17 @@ class BaseService {
1471
1498
  const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
1472
1499
  const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
1473
1500
  const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
1501
+ // When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
1502
+ // When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
1503
+ const convertToSkip = paginationParams?.convertToSkip ?? true;
1474
1504
  requestParams[pageSizeParam] = limitedPageSize;
1475
- if (params.pageNumber && params.pageNumber > 1) {
1476
- requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1505
+ if (convertToSkip) {
1506
+ if (params.pageNumber && params.pageNumber > 1) {
1507
+ requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1508
+ }
1509
+ }
1510
+ else {
1511
+ requestParams[offsetParam] = params.pageNumber || 1;
1477
1512
  }
1478
1513
  {
1479
1514
  requestParams[countParam] = true;
@@ -1504,7 +1539,8 @@ class BaseService {
1504
1539
  // Extract items and metadata
1505
1540
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1506
1541
  const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1507
- const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1542
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1543
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1508
1544
  const continuationToken = response.data[continuationTokenField];
1509
1545
  // Determine if there are more pages
1510
1546
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -1742,7 +1778,7 @@ class BpmnHelpers {
1742
1778
  // Connection string placeholder that will be replaced during build
1743
1779
  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";
1744
1780
  // SDK Version placeholder
1745
- const SDK_VERSION = "1.3.6";
1781
+ const SDK_VERSION = "1.3.8";
1746
1782
  const VERSION = "Version";
1747
1783
  const SERVICE = "Service";
1748
1784
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -2120,6 +2156,41 @@ exports.DebugMode = void 0;
2120
2156
  * Case Instance Types
2121
2157
  * Types and interfaces for Maestro case instance management
2122
2158
  */
2159
+ /**
2160
+ * SLA status for a case instance
2161
+ */
2162
+ var SlaSummaryStatus;
2163
+ (function (SlaSummaryStatus) {
2164
+ /** Case is within SLA deadline */
2165
+ SlaSummaryStatus["ON_TRACK"] = "On Track";
2166
+ /** Case is approaching SLA deadline based on at-risk percentage threshold */
2167
+ SlaSummaryStatus["AT_RISK"] = "At Risk";
2168
+ /** Case has exceeded SLA deadline */
2169
+ SlaSummaryStatus["OVERDUE"] = "Overdue";
2170
+ /** Case instance has completed */
2171
+ SlaSummaryStatus["COMPLETED"] = "Completed";
2172
+ /** SLA status cannot be determined (no SLA deadline defined) */
2173
+ SlaSummaryStatus["UNKNOWN"] = "Unknown";
2174
+ })(SlaSummaryStatus || (SlaSummaryStatus = {}));
2175
+ /**
2176
+ * Instance status values for case instances and process instances
2177
+ */
2178
+ var InstanceStatus;
2179
+ (function (InstanceStatus) {
2180
+ /** Instance status not yet populated by the backend */
2181
+ InstanceStatus["UNKNOWN"] = "";
2182
+ InstanceStatus["CANCELLED"] = "Cancelled";
2183
+ InstanceStatus["CANCELING"] = "Canceling";
2184
+ InstanceStatus["COMPLETED"] = "Completed";
2185
+ InstanceStatus["FAULTED"] = "Faulted";
2186
+ InstanceStatus["PAUSED"] = "Paused";
2187
+ InstanceStatus["PAUSING"] = "Pausing";
2188
+ InstanceStatus["PENDING"] = "Pending";
2189
+ InstanceStatus["RESUMING"] = "Resuming";
2190
+ InstanceStatus["RETRYING"] = "Retrying";
2191
+ InstanceStatus["RUNNING"] = "Running";
2192
+ InstanceStatus["UPGRADING"] = "Upgrading";
2193
+ })(InstanceStatus || (InstanceStatus = {}));
2123
2194
  /**
2124
2195
  * Case stage task type
2125
2196
  */
@@ -2154,6 +2225,8 @@ var EscalationTriggerType;
2154
2225
  (function (EscalationTriggerType) {
2155
2226
  EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
2156
2227
  EscalationTriggerType["AT_RISK"] = "at-risk";
2228
+ /** Default value when no escalation rule is defined */
2229
+ EscalationTriggerType["NONE"] = "None";
2157
2230
  })(EscalationTriggerType || (EscalationTriggerType = {}));
2158
2231
  /**
2159
2232
  * SLA duration unit
@@ -750,6 +750,7 @@ interface RequestWithPaginationOptions extends RequestSpec {
750
750
  offsetParam?: string;
751
751
  tokenParam?: string;
752
752
  countParam?: string;
753
+ convertToSkip?: boolean;
753
754
  };
754
755
  };
755
756
  }
@@ -862,6 +863,13 @@ interface ApiResponse<T> {
862
863
  */
863
864
  declare class BaseService {
864
865
  #private;
866
+ /**
867
+ * SDK configuration (read-only). Available to subclasses so they can
868
+ * fall back to init-time defaults like `folderKey`.
869
+ */
870
+ protected readonly config: {
871
+ folderKey?: string;
872
+ };
865
873
  /**
866
874
  * Creates a base service instance with dependency injection.
867
875
  *
@@ -650,6 +650,27 @@ var PaginationType;
650
650
  /**
651
651
  * Collection of utility functions for working with objects
652
652
  */
653
+ /**
654
+ * Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
655
+ * and dot-separated nested paths (e.g., 'pagination.totalCount').
656
+ * Direct key match takes priority over nested traversal.
657
+ */
658
+ function resolveNestedField(data, fieldPath) {
659
+ if (!data) {
660
+ return undefined;
661
+ }
662
+ if (fieldPath in data) {
663
+ return data[fieldPath];
664
+ }
665
+ if (!fieldPath.includes('.')) {
666
+ return undefined;
667
+ }
668
+ let value = data;
669
+ for (const part of fieldPath.split('.')) {
670
+ value = value?.[part];
671
+ }
672
+ return value;
673
+ }
653
674
  /**
654
675
  * Filters out undefined values from an object
655
676
  * @param obj The source object
@@ -901,6 +922,10 @@ const PROCESS_INSTANCE_TOKEN_PARAMS = {
901
922
  TOKEN_PARAM: 'nextPage'
902
923
  };
903
924
 
925
+ /**
926
+ * Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
927
+ * Returns the original value if parsing fails.
928
+ */
904
929
  /**
905
930
  * Transforms data by mapping fields according to the provided field mapping
906
931
  * @param data The source data to transform
@@ -1173,7 +1198,8 @@ class PaginationHelpers {
1173
1198
  // Extract and transform items from response
1174
1199
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1175
1200
  const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
1176
- const totalCount = Array.isArray(response.data) ? undefined : response.data?.[totalCountField];
1201
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1202
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1177
1203
  // Parse items - automatically handle JSON string responses
1178
1204
  const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
1179
1205
  const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
@@ -1349,8 +1375,9 @@ class BaseService {
1349
1375
  constructor(instance, headers) {
1350
1376
  // Private field - not visible via Object.keys() or any reflection
1351
1377
  _BaseService_apiClient.set(this, void 0);
1352
- const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
1378
+ const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
1353
1379
  __classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
1380
+ this.config = { folderKey };
1354
1381
  }
1355
1382
  /**
1356
1383
  * Gets a valid authentication token, refreshing if necessary.
@@ -1469,9 +1496,17 @@ class BaseService {
1469
1496
  const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
1470
1497
  const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
1471
1498
  const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
1499
+ // When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
1500
+ // When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
1501
+ const convertToSkip = paginationParams?.convertToSkip ?? true;
1472
1502
  requestParams[pageSizeParam] = limitedPageSize;
1473
- if (params.pageNumber && params.pageNumber > 1) {
1474
- requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1503
+ if (convertToSkip) {
1504
+ if (params.pageNumber && params.pageNumber > 1) {
1505
+ requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
1506
+ }
1507
+ }
1508
+ else {
1509
+ requestParams[offsetParam] = params.pageNumber || 1;
1475
1510
  }
1476
1511
  {
1477
1512
  requestParams[countParam] = true;
@@ -1502,7 +1537,8 @@ class BaseService {
1502
1537
  // Extract items and metadata
1503
1538
  // Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
1504
1539
  const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
1505
- const totalCount = Array.isArray(response.data) ? undefined : response.data[totalCountField];
1540
+ const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
1541
+ const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
1506
1542
  const continuationToken = response.data[continuationTokenField];
1507
1543
  // Determine if there are more pages
1508
1544
  const hasMore = this.determineHasMorePages(paginationType, {
@@ -1740,7 +1776,7 @@ class BpmnHelpers {
1740
1776
  // Connection string placeholder that will be replaced during build
1741
1777
  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";
1742
1778
  // SDK Version placeholder
1743
- const SDK_VERSION = "1.3.6";
1779
+ const SDK_VERSION = "1.3.8";
1744
1780
  const VERSION = "Version";
1745
1781
  const SERVICE = "Service";
1746
1782
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -2118,6 +2154,41 @@ var DebugMode;
2118
2154
  * Case Instance Types
2119
2155
  * Types and interfaces for Maestro case instance management
2120
2156
  */
2157
+ /**
2158
+ * SLA status for a case instance
2159
+ */
2160
+ var SlaSummaryStatus;
2161
+ (function (SlaSummaryStatus) {
2162
+ /** Case is within SLA deadline */
2163
+ SlaSummaryStatus["ON_TRACK"] = "On Track";
2164
+ /** Case is approaching SLA deadline based on at-risk percentage threshold */
2165
+ SlaSummaryStatus["AT_RISK"] = "At Risk";
2166
+ /** Case has exceeded SLA deadline */
2167
+ SlaSummaryStatus["OVERDUE"] = "Overdue";
2168
+ /** Case instance has completed */
2169
+ SlaSummaryStatus["COMPLETED"] = "Completed";
2170
+ /** SLA status cannot be determined (no SLA deadline defined) */
2171
+ SlaSummaryStatus["UNKNOWN"] = "Unknown";
2172
+ })(SlaSummaryStatus || (SlaSummaryStatus = {}));
2173
+ /**
2174
+ * Instance status values for case instances and process instances
2175
+ */
2176
+ var InstanceStatus;
2177
+ (function (InstanceStatus) {
2178
+ /** Instance status not yet populated by the backend */
2179
+ InstanceStatus["UNKNOWN"] = "";
2180
+ InstanceStatus["CANCELLED"] = "Cancelled";
2181
+ InstanceStatus["CANCELING"] = "Canceling";
2182
+ InstanceStatus["COMPLETED"] = "Completed";
2183
+ InstanceStatus["FAULTED"] = "Faulted";
2184
+ InstanceStatus["PAUSED"] = "Paused";
2185
+ InstanceStatus["PAUSING"] = "Pausing";
2186
+ InstanceStatus["PENDING"] = "Pending";
2187
+ InstanceStatus["RESUMING"] = "Resuming";
2188
+ InstanceStatus["RETRYING"] = "Retrying";
2189
+ InstanceStatus["RUNNING"] = "Running";
2190
+ InstanceStatus["UPGRADING"] = "Upgrading";
2191
+ })(InstanceStatus || (InstanceStatus = {}));
2121
2192
  /**
2122
2193
  * Case stage task type
2123
2194
  */
@@ -2152,6 +2223,8 @@ var EscalationTriggerType;
2152
2223
  (function (EscalationTriggerType) {
2153
2224
  EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
2154
2225
  EscalationTriggerType["AT_RISK"] = "at-risk";
2226
+ /** Default value when no escalation rule is defined */
2227
+ EscalationTriggerType["NONE"] = "None";
2155
2228
  })(EscalationTriggerType || (EscalationTriggerType = {}));
2156
2229
  /**
2157
2230
  * SLA duration unit