@uipath/uipath-typescript 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.cjs +40 -5
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.mjs +40 -5
- package/dist/attachments/index.cjs +40 -5
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +40 -5
- package/dist/buckets/index.cjs +40 -5
- package/dist/buckets/index.d.ts +1 -0
- package/dist/buckets/index.mjs +40 -5
- package/dist/cases/index.cjs +178 -5
- package/dist/cases/index.d.ts +158 -3
- package/dist/cases/index.mjs +179 -6
- package/dist/conversational-agent/index.cjs +40 -5
- package/dist/conversational-agent/index.d.ts +1 -0
- package/dist/conversational-agent/index.mjs +40 -5
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +40 -5
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.mjs +40 -5
- package/dist/feedback/index.cjs +291 -9
- package/dist/feedback/index.d.ts +418 -12
- package/dist/feedback/index.mjs +291 -9
- package/dist/index.cjs +178 -5
- package/dist/index.d.ts +413 -10
- package/dist/index.mjs +179 -6
- package/dist/index.umd.js +178 -5
- package/dist/jobs/index.cjs +40 -5
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +40 -5
- package/dist/maestro-processes/index.cjs +77 -5
- package/dist/maestro-processes/index.d.ts +1 -0
- package/dist/maestro-processes/index.mjs +77 -5
- package/dist/processes/index.cjs +40 -5
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +40 -5
- package/dist/queues/index.cjs +40 -5
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +40 -5
- package/dist/tasks/index.cjs +40 -5
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.mjs +40 -5
- package/package.json +1 -1
package/dist/feedback/index.mjs
CHANGED
|
@@ -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
|
|
@@ -871,6 +892,15 @@ const ODATA_OFFSET_PARAMS = {
|
|
|
871
892
|
/** OData count parameter name */
|
|
872
893
|
COUNT_PARAM: '$count'
|
|
873
894
|
};
|
|
895
|
+
/**
|
|
896
|
+
* Feedback category pagination response shape constants
|
|
897
|
+
*/
|
|
898
|
+
const FEEDBACK_CATEGORY_PAGINATION = {
|
|
899
|
+
/** Field name for items in feedback category response */
|
|
900
|
+
ITEMS_FIELD: 'categories',
|
|
901
|
+
/** Field name for total count in feedback category response */
|
|
902
|
+
TOTAL_COUNT_FIELD: 'totalCount'
|
|
903
|
+
};
|
|
874
904
|
/**
|
|
875
905
|
* Feedback OFFSET pagination parameter names (take/skip style)
|
|
876
906
|
*/
|
|
@@ -892,6 +922,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
892
922
|
TOKEN_PARAM: 'continuationToken'
|
|
893
923
|
};
|
|
894
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
|
+
*/
|
|
895
929
|
/**
|
|
896
930
|
* Transforms data by mapping fields according to the provided field mapping
|
|
897
931
|
* @param data The source data to transform
|
|
@@ -1164,7 +1198,8 @@ class PaginationHelpers {
|
|
|
1164
1198
|
// Extract and transform items from response
|
|
1165
1199
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1166
1200
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1167
|
-
const
|
|
1201
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1202
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1168
1203
|
// Parse items - automatically handle JSON string responses
|
|
1169
1204
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1170
1205
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1461,9 +1496,17 @@ class BaseService {
|
|
|
1461
1496
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1462
1497
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1463
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;
|
|
1464
1502
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
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;
|
|
1467
1510
|
}
|
|
1468
1511
|
{
|
|
1469
1512
|
requestParams[countParam] = true;
|
|
@@ -1494,7 +1537,8 @@ class BaseService {
|
|
|
1494
1537
|
// Extract items and metadata
|
|
1495
1538
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1496
1539
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1497
|
-
const
|
|
1540
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1541
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1498
1542
|
const continuationToken = response.data[continuationTokenField];
|
|
1499
1543
|
// Determine if there are more pages
|
|
1500
1544
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1558,6 +1602,14 @@ const LLMOPS_BASE = 'llmopstenant_';
|
|
|
1558
1602
|
const FEEDBACK_ENDPOINTS = {
|
|
1559
1603
|
GET_ALL: `${LLMOPS_BASE}/api/Feedback`,
|
|
1560
1604
|
GET_BY_ID: (id) => `${LLMOPS_BASE}/api/Feedback/${id}`,
|
|
1605
|
+
SUBMIT: `${LLMOPS_BASE}/api/Feedback`,
|
|
1606
|
+
UPDATE: (id) => `${LLMOPS_BASE}/api/Feedback/${id}`,
|
|
1607
|
+
DELETE: (id) => `${LLMOPS_BASE}/api/Feedback/${id}`,
|
|
1608
|
+
CATEGORY: {
|
|
1609
|
+
GET_ALL: `${LLMOPS_BASE}/api/Feedback/category`,
|
|
1610
|
+
CREATE: `${LLMOPS_BASE}/api/Feedback/category`,
|
|
1611
|
+
DELETE: (id) => `${LLMOPS_BASE}/api/Feedback/category/${id}`,
|
|
1612
|
+
},
|
|
1561
1613
|
};
|
|
1562
1614
|
|
|
1563
1615
|
/**
|
|
@@ -1566,7 +1618,7 @@ const FEEDBACK_ENDPOINTS = {
|
|
|
1566
1618
|
// Connection string placeholder that will be replaced during build
|
|
1567
1619
|
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";
|
|
1568
1620
|
// SDK Version placeholder
|
|
1569
|
-
const SDK_VERSION = "1.3.
|
|
1621
|
+
const SDK_VERSION = "1.3.8";
|
|
1570
1622
|
const VERSION = "Version";
|
|
1571
1623
|
const SERVICE = "Service";
|
|
1572
1624
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -1842,10 +1894,10 @@ class FeedbackService extends BaseService {
|
|
|
1842
1894
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
1843
1895
|
*
|
|
1844
1896
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
1845
|
-
* When no pagination options are provided, the
|
|
1897
|
+
* When no pagination options are provided, the SDK returns up to 100 items. When pagination options are provided without a pageSize, the SDK defaults to 50 items per page.
|
|
1846
1898
|
*
|
|
1847
1899
|
* @param options - Optional query parameters for filtering and pagination
|
|
1848
|
-
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link
|
|
1900
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackResponse} when pagination options are used.
|
|
1849
1901
|
* @example
|
|
1850
1902
|
* ```typescript
|
|
1851
1903
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -1897,7 +1949,7 @@ class FeedbackService extends BaseService {
|
|
|
1897
1949
|
*
|
|
1898
1950
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
1899
1951
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
1900
|
-
* @returns Promise resolving to {@link
|
|
1952
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
1901
1953
|
* @example
|
|
1902
1954
|
* ```typescript
|
|
1903
1955
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -1915,11 +1967,223 @@ class FeedbackService extends BaseService {
|
|
|
1915
1967
|
async getById(id, options) {
|
|
1916
1968
|
if (!id)
|
|
1917
1969
|
throw new ValidationError({ message: 'Feedback ID is required for getById' });
|
|
1918
|
-
if (!options
|
|
1970
|
+
if (!options.folderKey)
|
|
1919
1971
|
throw new ValidationError({ message: 'folderKey is required for getById' });
|
|
1920
1972
|
const response = await this.get(FEEDBACK_ENDPOINTS.GET_BY_ID(id), { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
|
|
1921
1973
|
return transformData(response.data, FeedbackMap);
|
|
1922
1974
|
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Submits a feedback entry.
|
|
1977
|
+
*
|
|
1978
|
+
* @param traceId - Trace identifier linking feedback to a specific agent execution
|
|
1979
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
1980
|
+
* @param options - Additional feedback data and folderKey for authorization {@link FeedbackSubmitOptions}
|
|
1981
|
+
* @returns Promise resolving to the submitted {@link FeedbackResponse}
|
|
1982
|
+
* @example
|
|
1983
|
+
* ```typescript
|
|
1984
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
1985
|
+
*
|
|
1986
|
+
* const feedback = new Feedback(sdk);
|
|
1987
|
+
*
|
|
1988
|
+
* // Obtain traceId and folderKey from an existing feedback entry
|
|
1989
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
1990
|
+
* const traceId = allFeedback.items[0].traceId;
|
|
1991
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
1992
|
+
*
|
|
1993
|
+
* const item = await feedback.submit(traceId, true, { folderKey });
|
|
1994
|
+
* console.log(item.id, item.status);
|
|
1995
|
+
* ```
|
|
1996
|
+
*/
|
|
1997
|
+
async submit(traceId, isPositive, options) {
|
|
1998
|
+
if (!traceId)
|
|
1999
|
+
throw new ValidationError({ message: 'traceId is required for submit' });
|
|
2000
|
+
if (!options.folderKey)
|
|
2001
|
+
throw new ValidationError({ message: 'folderKey is required for submit' });
|
|
2002
|
+
const { folderKey, ...rest } = options;
|
|
2003
|
+
const response = await this.post(FEEDBACK_ENDPOINTS.SUBMIT, { traceId, isPositive, ...rest }, { headers: createHeaders({ [FOLDER_KEY]: folderKey }) });
|
|
2004
|
+
return transformData(response.data, FeedbackMap);
|
|
2005
|
+
}
|
|
2006
|
+
/**
|
|
2007
|
+
* Updates already submitted feedback.
|
|
2008
|
+
*
|
|
2009
|
+
* @param id - Feedback ID (GUID) of the entry to update
|
|
2010
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
2011
|
+
* @param options - Updated feedback data and folderKey for authorization {@link FeedbackUpdateOptions}
|
|
2012
|
+
* @returns Promise resolving to the updated {@link FeedbackResponse}
|
|
2013
|
+
* @example
|
|
2014
|
+
* ```typescript
|
|
2015
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2016
|
+
*
|
|
2017
|
+
* const feedback = new Feedback(sdk);
|
|
2018
|
+
*
|
|
2019
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
2020
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
2021
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
2022
|
+
*
|
|
2023
|
+
* const updated = await feedback.updateById(feedbackId, false, {
|
|
2024
|
+
* comment: 'On reflection, not great.',
|
|
2025
|
+
* folderKey,
|
|
2026
|
+
* });
|
|
2027
|
+
* console.log(updated.isPositive, updated.comment);
|
|
2028
|
+
* ```
|
|
2029
|
+
*/
|
|
2030
|
+
async updateById(id, isPositive, options) {
|
|
2031
|
+
if (!id)
|
|
2032
|
+
throw new ValidationError({ message: 'Feedback ID is required for updateById' });
|
|
2033
|
+
if (!options.folderKey)
|
|
2034
|
+
throw new ValidationError({ message: 'folderKey is required for updateById' });
|
|
2035
|
+
const { folderKey, ...rest } = options;
|
|
2036
|
+
const response = await this.post(FEEDBACK_ENDPOINTS.UPDATE(id), { isPositive, ...rest }, { headers: createHeaders({ [FOLDER_KEY]: folderKey }) });
|
|
2037
|
+
return transformData(response.data, FeedbackMap);
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Deletes a feedback entry by its ID.
|
|
2041
|
+
*
|
|
2042
|
+
* @param id - Feedback ID (GUID) of the entry to delete
|
|
2043
|
+
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
2044
|
+
* @returns Promise resolving to void on success
|
|
2045
|
+
* @example
|
|
2046
|
+
* ```typescript
|
|
2047
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2048
|
+
*
|
|
2049
|
+
* const feedback = new Feedback(sdk);
|
|
2050
|
+
*
|
|
2051
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
2052
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
2053
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
2054
|
+
*
|
|
2055
|
+
* await feedback.deleteById(feedbackId, { folderKey });
|
|
2056
|
+
* ```
|
|
2057
|
+
*/
|
|
2058
|
+
async deleteById(id, options) {
|
|
2059
|
+
if (!id)
|
|
2060
|
+
throw new ValidationError({ message: 'Feedback ID is required for deleteById' });
|
|
2061
|
+
if (!options.folderKey)
|
|
2062
|
+
throw new ValidationError({ message: 'folderKey is required for deleteById' });
|
|
2063
|
+
await this.delete(FEEDBACK_ENDPOINTS.DELETE(id), { headers: createHeaders({ [FOLDER_KEY]: options.folderKey }) });
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
* Creates a new feedback category.
|
|
2067
|
+
*
|
|
2068
|
+
* Custom categories can be used to label feedback entries beyond the default system categories.
|
|
2069
|
+
* Once created, reference the category by its `id` when submitting or updating feedback.
|
|
2070
|
+
* If `isPositive` and `isNegative` are omitted, the backend defaults both to `true`.
|
|
2071
|
+
*
|
|
2072
|
+
* @param category - Name of the category to create (max 256 characters, unique per tenant)
|
|
2073
|
+
* @param options - Optional flags controlling whether the category applies to positive and/or negative feedback {@link FeedbackCreateCategoryOptions}
|
|
2074
|
+
* @returns Promise resolving to the created {@link FeedbackCategoryResponse}
|
|
2075
|
+
* @example
|
|
2076
|
+
* ```typescript
|
|
2077
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2078
|
+
*
|
|
2079
|
+
* const feedback = new Feedback(sdk);
|
|
2080
|
+
*
|
|
2081
|
+
* // Minimum — applies to both positive and negative feedback by default
|
|
2082
|
+
* const category = await feedback.createCategory('Hallucination');
|
|
2083
|
+
* console.log(category.id, category.category);
|
|
2084
|
+
*
|
|
2085
|
+
* // With explicit flags
|
|
2086
|
+
* const negativeOnly = await feedback.createCategory('Off-topic', {
|
|
2087
|
+
* isPositive: false,
|
|
2088
|
+
* isNegative: true,
|
|
2089
|
+
* });
|
|
2090
|
+
* ```
|
|
2091
|
+
*/
|
|
2092
|
+
async createCategory(category, options) {
|
|
2093
|
+
if (!category)
|
|
2094
|
+
throw new ValidationError({ message: 'category name is required for createCategory' });
|
|
2095
|
+
const body = { category };
|
|
2096
|
+
if (options?.isPositive !== undefined)
|
|
2097
|
+
body.isPositive = options.isPositive;
|
|
2098
|
+
if (options?.isNegative !== undefined)
|
|
2099
|
+
body.isNegative = options.isNegative;
|
|
2100
|
+
const response = await this.post(FEEDBACK_ENDPOINTS.CATEGORY.CREATE, body);
|
|
2101
|
+
return transformData(response.data, FeedbackMap);
|
|
2102
|
+
}
|
|
2103
|
+
/**
|
|
2104
|
+
* Gets all feedback categories for the tenant.
|
|
2105
|
+
*
|
|
2106
|
+
* Returns both system default categories (Output, Agent Error, Agent Plan Execution)
|
|
2107
|
+
* and any custom categories created for this tenant.
|
|
2108
|
+
* When no pagination options are provided, the SDK returns up to 100 items. When pagination options are provided without a pageSize, the SDK defaults to 50 items per page.
|
|
2109
|
+
*
|
|
2110
|
+
* @param options - Optional filters and pagination options {@link FeedbackGetCategoriesOptions}
|
|
2111
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackCategoryResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackCategoryResponse} when pagination options are used.
|
|
2112
|
+
* @example
|
|
2113
|
+
* ```typescript
|
|
2114
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2115
|
+
*
|
|
2116
|
+
* const feedback = new Feedback(sdk);
|
|
2117
|
+
*
|
|
2118
|
+
* // Get all categories
|
|
2119
|
+
* const categories = await feedback.getCategories();
|
|
2120
|
+
* console.log(categories.items.map(c => c.category));
|
|
2121
|
+
*
|
|
2122
|
+
* // Get only categories applicable to negative feedback
|
|
2123
|
+
* const negativeCategories = await feedback.getCategories({ isNegative: true });
|
|
2124
|
+
*
|
|
2125
|
+
* // Paginated
|
|
2126
|
+
* const page1 = await feedback.getCategories({ pageSize: 10 });
|
|
2127
|
+
* ```
|
|
2128
|
+
*/
|
|
2129
|
+
async getCategories(options) {
|
|
2130
|
+
const transformCategory = (item) => transformData(item, FeedbackMap);
|
|
2131
|
+
return PaginationHelpers.getAll({
|
|
2132
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
2133
|
+
getEndpoint: () => FEEDBACK_ENDPOINTS.CATEGORY.GET_ALL,
|
|
2134
|
+
transformFn: transformCategory,
|
|
2135
|
+
pagination: {
|
|
2136
|
+
paginationType: PaginationType.OFFSET,
|
|
2137
|
+
itemsField: FEEDBACK_CATEGORY_PAGINATION.ITEMS_FIELD,
|
|
2138
|
+
totalCountField: FEEDBACK_CATEGORY_PAGINATION.TOTAL_COUNT_FIELD,
|
|
2139
|
+
paginationParams: {
|
|
2140
|
+
pageSizeParam: FEEDBACK_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
2141
|
+
offsetParam: FEEDBACK_OFFSET_PARAMS.OFFSET_PARAM,
|
|
2142
|
+
countParam: FEEDBACK_OFFSET_PARAMS.COUNT_PARAM,
|
|
2143
|
+
},
|
|
2144
|
+
},
|
|
2145
|
+
excludeFromPrefix: Object.keys(options || {}),
|
|
2146
|
+
}, options);
|
|
2147
|
+
}
|
|
2148
|
+
/**
|
|
2149
|
+
* Deletes a feedback category by its ID.
|
|
2150
|
+
*
|
|
2151
|
+
* System default categories (Output, Agent Error, Agent Plan Execution) cannot be deleted —
|
|
2152
|
+
* attempting to do so throws a `409 Conflict` error.
|
|
2153
|
+
* Use `forceDelete` to delete a custom category that already has feedback entries associated with it.
|
|
2154
|
+
*
|
|
2155
|
+
* @param id - Category ID (GUID) of the category to delete
|
|
2156
|
+
* @param options - Optional deletion options {@link FeedbackDeleteCategoryOptions}
|
|
2157
|
+
* @returns Promise resolving to void on success
|
|
2158
|
+
* @example
|
|
2159
|
+
* ```typescript
|
|
2160
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2161
|
+
*
|
|
2162
|
+
* const feedback = new Feedback(sdk);
|
|
2163
|
+
*
|
|
2164
|
+
* // Only custom categories (isDefault: false) can be deleted
|
|
2165
|
+
* const categories = await feedback.getCategories();
|
|
2166
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
2167
|
+
* if (customCategory) {
|
|
2168
|
+
* await feedback.deleteCategory(customCategory.id);
|
|
2169
|
+
* }
|
|
2170
|
+
* ```
|
|
2171
|
+
* @example
|
|
2172
|
+
* ```typescript
|
|
2173
|
+
* // Force-delete a custom category that has associated feedback entries
|
|
2174
|
+
* const categories = await feedback.getCategories();
|
|
2175
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
2176
|
+
* if (customCategory) {
|
|
2177
|
+
* await feedback.deleteCategory(customCategory.id, { forceDelete: true });
|
|
2178
|
+
* }
|
|
2179
|
+
* ```
|
|
2180
|
+
*/
|
|
2181
|
+
async deleteCategory(id, options) {
|
|
2182
|
+
if (!id)
|
|
2183
|
+
throw new ValidationError({ message: 'Category ID is required for deleteCategory' });
|
|
2184
|
+
const params = options?.forceDelete !== undefined ? { forceDelete: options.forceDelete } : undefined;
|
|
2185
|
+
await this.delete(FEEDBACK_ENDPOINTS.CATEGORY.DELETE(id), { params });
|
|
2186
|
+
}
|
|
1923
2187
|
}
|
|
1924
2188
|
__decorate([
|
|
1925
2189
|
track('Feedback.GetAll')
|
|
@@ -1927,6 +2191,24 @@ __decorate([
|
|
|
1927
2191
|
__decorate([
|
|
1928
2192
|
track('Feedback.GetById')
|
|
1929
2193
|
], FeedbackService.prototype, "getById", null);
|
|
2194
|
+
__decorate([
|
|
2195
|
+
track('Feedback.Submit')
|
|
2196
|
+
], FeedbackService.prototype, "submit", null);
|
|
2197
|
+
__decorate([
|
|
2198
|
+
track('Feedback.UpdateById')
|
|
2199
|
+
], FeedbackService.prototype, "updateById", null);
|
|
2200
|
+
__decorate([
|
|
2201
|
+
track('Feedback.DeleteById')
|
|
2202
|
+
], FeedbackService.prototype, "deleteById", null);
|
|
2203
|
+
__decorate([
|
|
2204
|
+
track('Feedback.CreateCategory')
|
|
2205
|
+
], FeedbackService.prototype, "createCategory", null);
|
|
2206
|
+
__decorate([
|
|
2207
|
+
track('Feedback.GetCategories')
|
|
2208
|
+
], FeedbackService.prototype, "getCategories", null);
|
|
2209
|
+
__decorate([
|
|
2210
|
+
track('Feedback.DeleteCategory')
|
|
2211
|
+
], FeedbackService.prototype, "deleteCategory", null);
|
|
1930
2212
|
|
|
1931
2213
|
/**
|
|
1932
2214
|
* Status of a feedback entry in the review workflow
|
package/dist/index.cjs
CHANGED
|
@@ -4480,6 +4480,7 @@ const ORCHESTRATOR_BASE = 'orchestrator_';
|
|
|
4480
4480
|
const PIMS_BASE = 'pims_';
|
|
4481
4481
|
const DATAFABRIC_BASE = 'datafabric_';
|
|
4482
4482
|
const IDENTITY_BASE = 'identity_';
|
|
4483
|
+
const INSIGHTS_RTM_BASE = 'insightsrtm_';
|
|
4483
4484
|
|
|
4484
4485
|
/**
|
|
4485
4486
|
* Orchestrator Service Endpoints
|
|
@@ -4586,6 +4587,10 @@ const MAESTRO_ENDPOINTS = {
|
|
|
4586
4587
|
GET_ELEMENT_EXECUTIONS: (instanceId) => `${PIMS_BASE}/api/v1/element-executions/case-instances/${instanceId}`,
|
|
4587
4588
|
REOPEN: (instanceId) => `${PIMS_BASE}/api/v1/cases/${instanceId}/reopen`,
|
|
4588
4589
|
},
|
|
4590
|
+
INSIGHTS: {
|
|
4591
|
+
/** SLA summary for case instances */
|
|
4592
|
+
SLA_SUMMARY: `${INSIGHTS_RTM_BASE}/caseManagement/slaSummary`,
|
|
4593
|
+
},
|
|
4589
4594
|
};
|
|
4590
4595
|
|
|
4591
4596
|
/**
|
|
@@ -5464,7 +5469,7 @@ function normalizeBaseUrl(url) {
|
|
|
5464
5469
|
// Connection string placeholder that will be replaced during build
|
|
5465
5470
|
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";
|
|
5466
5471
|
// SDK Version placeholder
|
|
5467
|
-
const SDK_VERSION = "1.3.
|
|
5472
|
+
const SDK_VERSION = "1.3.8";
|
|
5468
5473
|
const VERSION = "Version";
|
|
5469
5474
|
const SERVICE = "Service";
|
|
5470
5475
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -6470,6 +6475,27 @@ var PaginationType;
|
|
|
6470
6475
|
/**
|
|
6471
6476
|
* Collection of utility functions for working with objects
|
|
6472
6477
|
*/
|
|
6478
|
+
/**
|
|
6479
|
+
* Resolves a field value from an object, supporting both direct keys (e.g., '@odata.count')
|
|
6480
|
+
* and dot-separated nested paths (e.g., 'pagination.totalCount').
|
|
6481
|
+
* Direct key match takes priority over nested traversal.
|
|
6482
|
+
*/
|
|
6483
|
+
function resolveNestedField(data, fieldPath) {
|
|
6484
|
+
if (!data) {
|
|
6485
|
+
return undefined;
|
|
6486
|
+
}
|
|
6487
|
+
if (fieldPath in data) {
|
|
6488
|
+
return data[fieldPath];
|
|
6489
|
+
}
|
|
6490
|
+
if (!fieldPath.includes('.')) {
|
|
6491
|
+
return undefined;
|
|
6492
|
+
}
|
|
6493
|
+
let value = data;
|
|
6494
|
+
for (const part of fieldPath.split('.')) {
|
|
6495
|
+
value = value?.[part];
|
|
6496
|
+
}
|
|
6497
|
+
return value;
|
|
6498
|
+
}
|
|
6473
6499
|
/**
|
|
6474
6500
|
* Filters out undefined values from an object
|
|
6475
6501
|
* @param obj The source object
|
|
@@ -6729,6 +6755,26 @@ const BUCKET_PAGINATION = {
|
|
|
6729
6755
|
/** Field name for continuation token in bucket file metadata response */
|
|
6730
6756
|
CONTINUATION_TOKEN_FIELD: 'continuationToken'
|
|
6731
6757
|
};
|
|
6758
|
+
/**
|
|
6759
|
+
* SLA Summary pagination constants for page-number-based pagination
|
|
6760
|
+
*/
|
|
6761
|
+
const SLA_SUMMARY_PAGINATION = {
|
|
6762
|
+
/** Field name for items in SLA summary response */
|
|
6763
|
+
ITEMS_FIELD: 'data',
|
|
6764
|
+
/** Dot-notation path for total count in nested pagination object */
|
|
6765
|
+
TOTAL_COUNT_FIELD: 'pagination.totalCount'
|
|
6766
|
+
};
|
|
6767
|
+
/**
|
|
6768
|
+
* SLA Summary OFFSET pagination parameter names (page-number style, no skip conversion)
|
|
6769
|
+
*/
|
|
6770
|
+
const SLA_SUMMARY_OFFSET_PARAMS = {
|
|
6771
|
+
/** Page size parameter name */
|
|
6772
|
+
PAGE_SIZE_PARAM: 'PageSize',
|
|
6773
|
+
/** Page number parameter name (sent directly, not converted to skip) */
|
|
6774
|
+
OFFSET_PARAM: 'PageNumber',
|
|
6775
|
+
/** No count param needed */
|
|
6776
|
+
COUNT_PARAM: undefined
|
|
6777
|
+
};
|
|
6732
6778
|
/**
|
|
6733
6779
|
* Process Instance pagination constants for token-based pagination
|
|
6734
6780
|
*/
|
|
@@ -6779,6 +6825,14 @@ const PROCESS_INSTANCE_TOKEN_PARAMS = {
|
|
|
6779
6825
|
TOKEN_PARAM: 'nextPage'
|
|
6780
6826
|
};
|
|
6781
6827
|
|
|
6828
|
+
/**
|
|
6829
|
+
* Converts a UTC timestamp string (e.g., "5/8/2026 11:20:17 AM") to ISO 8601 UTC format.
|
|
6830
|
+
* Returns the original value if parsing fails.
|
|
6831
|
+
*/
|
|
6832
|
+
function toISOUtc(value) {
|
|
6833
|
+
const date = new Date(value + ' UTC');
|
|
6834
|
+
return isNaN(date.getTime()) ? value : date.toISOString();
|
|
6835
|
+
}
|
|
6782
6836
|
/**
|
|
6783
6837
|
* Transforms data by mapping fields according to the provided field mapping
|
|
6784
6838
|
* @param data The source data to transform
|
|
@@ -7335,7 +7389,8 @@ class PaginationHelpers {
|
|
|
7335
7389
|
// Extract and transform items from response
|
|
7336
7390
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
7337
7391
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
7338
|
-
const
|
|
7392
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
7393
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
7339
7394
|
// Parse items - automatically handle JSON string responses
|
|
7340
7395
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
7341
7396
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -7577,9 +7632,17 @@ class BaseService {
|
|
|
7577
7632
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
7578
7633
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
7579
7634
|
const countParam = paginationParams?.countParam || ODATA_OFFSET_PARAMS.COUNT_PARAM;
|
|
7635
|
+
// When true (default), converts pageNumber to a skip/offset value (e.g., page 3 with pageSize 10 → skip 20).
|
|
7636
|
+
// When false, passes pageNumber directly as the offset param — used by APIs that accept a page number instead of a record offset.
|
|
7637
|
+
const convertToSkip = paginationParams?.convertToSkip ?? true;
|
|
7580
7638
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
7581
|
-
if (
|
|
7582
|
-
|
|
7639
|
+
if (convertToSkip) {
|
|
7640
|
+
if (params.pageNumber && params.pageNumber > 1) {
|
|
7641
|
+
requestParams[offsetParam] = (params.pageNumber - 1) * limitedPageSize;
|
|
7642
|
+
}
|
|
7643
|
+
}
|
|
7644
|
+
else {
|
|
7645
|
+
requestParams[offsetParam] = params.pageNumber || 1;
|
|
7583
7646
|
}
|
|
7584
7647
|
{
|
|
7585
7648
|
requestParams[countParam] = true;
|
|
@@ -7610,7 +7673,8 @@ class BaseService {
|
|
|
7610
7673
|
// Extract items and metadata
|
|
7611
7674
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
7612
7675
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
7613
|
-
const
|
|
7676
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
7677
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
7614
7678
|
const continuationToken = response.data[continuationTokenField];
|
|
7615
7679
|
// Determine if there are more pages
|
|
7616
7680
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -9497,6 +9561,41 @@ exports.DebugMode = void 0;
|
|
|
9497
9561
|
* Case Instance Types
|
|
9498
9562
|
* Types and interfaces for Maestro case instance management
|
|
9499
9563
|
*/
|
|
9564
|
+
/**
|
|
9565
|
+
* SLA status for a case instance
|
|
9566
|
+
*/
|
|
9567
|
+
exports.SlaSummaryStatus = void 0;
|
|
9568
|
+
(function (SlaSummaryStatus) {
|
|
9569
|
+
/** Case is within SLA deadline */
|
|
9570
|
+
SlaSummaryStatus["ON_TRACK"] = "On Track";
|
|
9571
|
+
/** Case is approaching SLA deadline based on at-risk percentage threshold */
|
|
9572
|
+
SlaSummaryStatus["AT_RISK"] = "At Risk";
|
|
9573
|
+
/** Case has exceeded SLA deadline */
|
|
9574
|
+
SlaSummaryStatus["OVERDUE"] = "Overdue";
|
|
9575
|
+
/** Case instance has completed */
|
|
9576
|
+
SlaSummaryStatus["COMPLETED"] = "Completed";
|
|
9577
|
+
/** SLA status cannot be determined (no SLA deadline defined) */
|
|
9578
|
+
SlaSummaryStatus["UNKNOWN"] = "Unknown";
|
|
9579
|
+
})(exports.SlaSummaryStatus || (exports.SlaSummaryStatus = {}));
|
|
9580
|
+
/**
|
|
9581
|
+
* Instance status values for case instances and process instances
|
|
9582
|
+
*/
|
|
9583
|
+
exports.InstanceStatus = void 0;
|
|
9584
|
+
(function (InstanceStatus) {
|
|
9585
|
+
/** Instance status not yet populated by the backend */
|
|
9586
|
+
InstanceStatus["UNKNOWN"] = "";
|
|
9587
|
+
InstanceStatus["CANCELLED"] = "Cancelled";
|
|
9588
|
+
InstanceStatus["CANCELING"] = "Canceling";
|
|
9589
|
+
InstanceStatus["COMPLETED"] = "Completed";
|
|
9590
|
+
InstanceStatus["FAULTED"] = "Faulted";
|
|
9591
|
+
InstanceStatus["PAUSED"] = "Paused";
|
|
9592
|
+
InstanceStatus["PAUSING"] = "Pausing";
|
|
9593
|
+
InstanceStatus["PENDING"] = "Pending";
|
|
9594
|
+
InstanceStatus["RESUMING"] = "Resuming";
|
|
9595
|
+
InstanceStatus["RETRYING"] = "Retrying";
|
|
9596
|
+
InstanceStatus["RUNNING"] = "Running";
|
|
9597
|
+
InstanceStatus["UPGRADING"] = "Upgrading";
|
|
9598
|
+
})(exports.InstanceStatus || (exports.InstanceStatus = {}));
|
|
9500
9599
|
/**
|
|
9501
9600
|
* Case stage task type
|
|
9502
9601
|
*/
|
|
@@ -9531,6 +9630,8 @@ exports.EscalationTriggerType = void 0;
|
|
|
9531
9630
|
(function (EscalationTriggerType) {
|
|
9532
9631
|
EscalationTriggerType["SLA_BREACHED"] = "sla-breached";
|
|
9533
9632
|
EscalationTriggerType["AT_RISK"] = "at-risk";
|
|
9633
|
+
/** Default value when no escalation rule is defined */
|
|
9634
|
+
EscalationTriggerType["NONE"] = "None";
|
|
9534
9635
|
})(exports.EscalationTriggerType || (exports.EscalationTriggerType = {}));
|
|
9535
9636
|
/**
|
|
9536
9637
|
* SLA duration unit
|
|
@@ -9598,6 +9699,11 @@ function createCaseInstanceMethods(instanceData, service) {
|
|
|
9598
9699
|
if (!instanceData.instanceId)
|
|
9599
9700
|
throw new Error('Case instance ID is undefined');
|
|
9600
9701
|
return service.getActionTasks(instanceData.instanceId, options);
|
|
9702
|
+
},
|
|
9703
|
+
async getSlaSummary(options) {
|
|
9704
|
+
if (!instanceData.instanceId)
|
|
9705
|
+
throw new Error('Case instance ID is undefined');
|
|
9706
|
+
return service.getSlaSummary({ ...options, caseInstanceId: instanceData.instanceId });
|
|
9601
9707
|
}
|
|
9602
9708
|
};
|
|
9603
9709
|
}
|
|
@@ -11152,6 +11258,70 @@ class CaseInstancesService extends BaseService {
|
|
|
11152
11258
|
};
|
|
11153
11259
|
return await this.taskService.getAll(enhancedOptions);
|
|
11154
11260
|
}
|
|
11261
|
+
/**
|
|
11262
|
+
* Get SLA summary for all case instances across folders.
|
|
11263
|
+
*
|
|
11264
|
+
* Returns SLA status, due times, escalation info, and instance metadata for each case instance.
|
|
11265
|
+
* The default page size is 50, so only the top 50 items are returned when no pagination options are provided.
|
|
11266
|
+
*
|
|
11267
|
+
* @param options - Optional filtering and pagination options
|
|
11268
|
+
* @returns Promise resolving to {@link SlaSummaryResponse}, paginated or non-paginated based on options
|
|
11269
|
+
* @example
|
|
11270
|
+
* ```typescript
|
|
11271
|
+
* // Non-paginated (returns top 50 items by default)
|
|
11272
|
+
* const summary = await caseInstances.getSlaSummary();
|
|
11273
|
+
* console.log(`Found ${summary.totalCount} cases`);
|
|
11274
|
+
*
|
|
11275
|
+
* // Filter by case instance ID
|
|
11276
|
+
* const filtered = await caseInstances.getSlaSummary({
|
|
11277
|
+
* caseInstanceId: '<caseInstanceId>'
|
|
11278
|
+
* });
|
|
11279
|
+
*
|
|
11280
|
+
* // Filter by time range
|
|
11281
|
+
* const timeFiltered = await caseInstances.getSlaSummary({
|
|
11282
|
+
* startTimeUtc: new Date('2026-01-01'),
|
|
11283
|
+
* endTimeUtc: new Date('2026-01-31')
|
|
11284
|
+
* });
|
|
11285
|
+
*
|
|
11286
|
+
* // With pagination
|
|
11287
|
+
* const page1 = await caseInstances.getSlaSummary({ pageSize: 25 });
|
|
11288
|
+
* if (page1.hasNextPage) {
|
|
11289
|
+
* const page2 = await caseInstances.getSlaSummary({ cursor: page1.nextCursor });
|
|
11290
|
+
* }
|
|
11291
|
+
*
|
|
11292
|
+
* // Jump to specific page
|
|
11293
|
+
* const page3 = await caseInstances.getSlaSummary({ jumpToPage: 3, pageSize: 25 });
|
|
11294
|
+
* ```
|
|
11295
|
+
*/
|
|
11296
|
+
async getSlaSummary(options) {
|
|
11297
|
+
const apiOptions = options ? {
|
|
11298
|
+
...options,
|
|
11299
|
+
startTimeUtc: options.startTimeUtc?.toISOString(),
|
|
11300
|
+
endTimeUtc: options.endTimeUtc?.toISOString()
|
|
11301
|
+
} : undefined;
|
|
11302
|
+
return PaginationHelpers.getAll({
|
|
11303
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
11304
|
+
getEndpoint: () => MAESTRO_ENDPOINTS.INSIGHTS.SLA_SUMMARY,
|
|
11305
|
+
method: HTTP_METHODS.POST,
|
|
11306
|
+
excludeFromPrefix: ['caseInstanceId', 'startTimeUtc', 'endTimeUtc'],
|
|
11307
|
+
transformFn: (item) => ({
|
|
11308
|
+
...item,
|
|
11309
|
+
slaDueTime: toISOUtc(item.slaDueTime),
|
|
11310
|
+
lastModifiedTime: toISOUtc(item.lastModifiedTime)
|
|
11311
|
+
}),
|
|
11312
|
+
pagination: {
|
|
11313
|
+
paginationType: PaginationType.OFFSET,
|
|
11314
|
+
itemsField: SLA_SUMMARY_PAGINATION.ITEMS_FIELD,
|
|
11315
|
+
totalCountField: SLA_SUMMARY_PAGINATION.TOTAL_COUNT_FIELD,
|
|
11316
|
+
paginationParams: {
|
|
11317
|
+
pageSizeParam: SLA_SUMMARY_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
11318
|
+
offsetParam: SLA_SUMMARY_OFFSET_PARAMS.OFFSET_PARAM,
|
|
11319
|
+
countParam: SLA_SUMMARY_OFFSET_PARAMS.COUNT_PARAM,
|
|
11320
|
+
convertToSkip: false
|
|
11321
|
+
}
|
|
11322
|
+
}
|
|
11323
|
+
}, apiOptions);
|
|
11324
|
+
}
|
|
11155
11325
|
}
|
|
11156
11326
|
__decorate([
|
|
11157
11327
|
track('CaseInstances.GetAll')
|
|
@@ -11180,6 +11350,9 @@ __decorate([
|
|
|
11180
11350
|
__decorate([
|
|
11181
11351
|
track('CaseInstances.GetActionTasks')
|
|
11182
11352
|
], CaseInstancesService.prototype, "getActionTasks", null);
|
|
11353
|
+
__decorate([
|
|
11354
|
+
track('CaseInstances.GetSlaSummary')
|
|
11355
|
+
], CaseInstancesService.prototype, "getSlaSummary", null);
|
|
11183
11356
|
|
|
11184
11357
|
/**
|
|
11185
11358
|
* Validates the `name` argument passed to a `getByName(name, ...)` method.
|