@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.
- package/dist/assets/index.cjs +243 -6
- package/dist/assets/index.d.ts +113 -13
- package/dist/assets/index.mjs +243 -6
- package/dist/attachments/index.cjs +42 -6
- package/dist/attachments/index.d.ts +8 -0
- package/dist/attachments/index.mjs +42 -6
- package/dist/buckets/index.cjs +211 -6
- package/dist/buckets/index.d.ts +57 -12
- package/dist/buckets/index.mjs +211 -6
- package/dist/cases/index.cjs +180 -6
- package/dist/cases/index.d.ts +165 -3
- package/dist/cases/index.mjs +181 -7
- package/dist/conversational-agent/index.cjs +235 -85
- package/dist/conversational-agent/index.d.ts +327 -80
- package/dist/conversational-agent/index.mjs +234 -84
- package/dist/core/index.cjs +18 -6
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.mjs +18 -6
- package/dist/entities/index.cjs +74 -10
- package/dist/entities/index.d.ts +102 -11
- package/dist/entities/index.mjs +75 -11
- package/dist/feedback/index.cjs +293 -10
- package/dist/feedback/index.d.ts +425 -12
- package/dist/feedback/index.mjs +293 -10
- package/dist/index.cjs +463 -17
- package/dist/index.d.ts +885 -39
- package/dist/index.mjs +464 -18
- package/dist/index.umd.js +463 -17
- package/dist/jobs/index.cjs +211 -6
- package/dist/jobs/index.d.ts +68 -23
- package/dist/jobs/index.mjs +211 -6
- package/dist/maestro-processes/index.cjs +79 -6
- package/dist/maestro-processes/index.d.ts +8 -0
- package/dist/maestro-processes/index.mjs +79 -6
- package/dist/processes/index.cjs +279 -7
- package/dist/processes/index.d.ts +125 -2
- package/dist/processes/index.mjs +279 -7
- package/dist/queues/index.cjs +211 -6
- package/dist/queues/index.d.ts +57 -12
- package/dist/queues/index.mjs +211 -6
- package/dist/tasks/index.cjs +42 -6
- package/dist/tasks/index.d.ts +8 -0
- package/dist/tasks/index.mjs +42 -6
- package/package.json +1 -1
package/dist/feedback/index.cjs
CHANGED
|
@@ -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
|
|
@@ -873,6 +894,15 @@ const ODATA_OFFSET_PARAMS = {
|
|
|
873
894
|
/** OData count parameter name */
|
|
874
895
|
COUNT_PARAM: '$count'
|
|
875
896
|
};
|
|
897
|
+
/**
|
|
898
|
+
* Feedback category pagination response shape constants
|
|
899
|
+
*/
|
|
900
|
+
const FEEDBACK_CATEGORY_PAGINATION = {
|
|
901
|
+
/** Field name for items in feedback category response */
|
|
902
|
+
ITEMS_FIELD: 'categories',
|
|
903
|
+
/** Field name for total count in feedback category response */
|
|
904
|
+
TOTAL_COUNT_FIELD: 'totalCount'
|
|
905
|
+
};
|
|
876
906
|
/**
|
|
877
907
|
* Feedback OFFSET pagination parameter names (take/skip style)
|
|
878
908
|
*/
|
|
@@ -894,6 +924,10 @@ const BUCKET_TOKEN_PARAMS = {
|
|
|
894
924
|
TOKEN_PARAM: 'continuationToken'
|
|
895
925
|
};
|
|
896
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
|
+
*/
|
|
897
931
|
/**
|
|
898
932
|
* Transforms data by mapping fields according to the provided field mapping
|
|
899
933
|
* @param data The source data to transform
|
|
@@ -1166,7 +1200,8 @@ class PaginationHelpers {
|
|
|
1166
1200
|
// Extract and transform items from response
|
|
1167
1201
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1168
1202
|
const rawItems = Array.isArray(response.data) ? response.data : response.data?.[itemsField];
|
|
1169
|
-
const
|
|
1203
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1204
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1170
1205
|
// Parse items - automatically handle JSON string responses
|
|
1171
1206
|
const parsedItems = typeof rawItems === 'string' ? JSON.parse(rawItems) : (rawItems || []);
|
|
1172
1207
|
const items = transformFn ? parsedItems.map(transformFn) : parsedItems;
|
|
@@ -1342,8 +1377,9 @@ class BaseService {
|
|
|
1342
1377
|
constructor(instance, headers) {
|
|
1343
1378
|
// Private field - not visible via Object.keys() or any reflection
|
|
1344
1379
|
_BaseService_apiClient.set(this, void 0);
|
|
1345
|
-
const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
|
|
1380
|
+
const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
|
|
1346
1381
|
__classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
|
|
1382
|
+
this.config = { folderKey };
|
|
1347
1383
|
}
|
|
1348
1384
|
/**
|
|
1349
1385
|
* Gets a valid authentication token, refreshing if necessary.
|
|
@@ -1462,9 +1498,17 @@ class BaseService {
|
|
|
1462
1498
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1463
1499
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1464
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;
|
|
1465
1504
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1466
|
-
if (
|
|
1467
|
-
|
|
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;
|
|
1468
1512
|
}
|
|
1469
1513
|
{
|
|
1470
1514
|
requestParams[countParam] = true;
|
|
@@ -1495,7 +1539,8 @@ class BaseService {
|
|
|
1495
1539
|
// Extract items and metadata
|
|
1496
1540
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1497
1541
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1498
|
-
const
|
|
1542
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1543
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1499
1544
|
const continuationToken = response.data[continuationTokenField];
|
|
1500
1545
|
// Determine if there are more pages
|
|
1501
1546
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1559,6 +1604,14 @@ const LLMOPS_BASE = 'llmopstenant_';
|
|
|
1559
1604
|
const FEEDBACK_ENDPOINTS = {
|
|
1560
1605
|
GET_ALL: `${LLMOPS_BASE}/api/Feedback`,
|
|
1561
1606
|
GET_BY_ID: (id) => `${LLMOPS_BASE}/api/Feedback/${id}`,
|
|
1607
|
+
SUBMIT: `${LLMOPS_BASE}/api/Feedback`,
|
|
1608
|
+
UPDATE: (id) => `${LLMOPS_BASE}/api/Feedback/${id}`,
|
|
1609
|
+
DELETE: (id) => `${LLMOPS_BASE}/api/Feedback/${id}`,
|
|
1610
|
+
CATEGORY: {
|
|
1611
|
+
GET_ALL: `${LLMOPS_BASE}/api/Feedback/category`,
|
|
1612
|
+
CREATE: `${LLMOPS_BASE}/api/Feedback/category`,
|
|
1613
|
+
DELETE: (id) => `${LLMOPS_BASE}/api/Feedback/category/${id}`,
|
|
1614
|
+
},
|
|
1562
1615
|
};
|
|
1563
1616
|
|
|
1564
1617
|
/**
|
|
@@ -1567,7 +1620,7 @@ const FEEDBACK_ENDPOINTS = {
|
|
|
1567
1620
|
// Connection string placeholder that will be replaced during build
|
|
1568
1621
|
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";
|
|
1569
1622
|
// SDK Version placeholder
|
|
1570
|
-
const SDK_VERSION = "1.3.
|
|
1623
|
+
const SDK_VERSION = "1.3.8";
|
|
1571
1624
|
const VERSION = "Version";
|
|
1572
1625
|
const SERVICE = "Service";
|
|
1573
1626
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -1843,10 +1896,10 @@ class FeedbackService extends BaseService {
|
|
|
1843
1896
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
1844
1897
|
*
|
|
1845
1898
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
1846
|
-
* When no pagination options are provided, the
|
|
1899
|
+
* 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.
|
|
1847
1900
|
*
|
|
1848
1901
|
* @param options - Optional query parameters for filtering and pagination
|
|
1849
|
-
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link
|
|
1902
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackResponse} when pagination options are used.
|
|
1850
1903
|
* @example
|
|
1851
1904
|
* ```typescript
|
|
1852
1905
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -1898,7 +1951,7 @@ class FeedbackService extends BaseService {
|
|
|
1898
1951
|
*
|
|
1899
1952
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
1900
1953
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
1901
|
-
* @returns Promise resolving to {@link
|
|
1954
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
1902
1955
|
* @example
|
|
1903
1956
|
* ```typescript
|
|
1904
1957
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -1916,11 +1969,223 @@ class FeedbackService extends BaseService {
|
|
|
1916
1969
|
async getById(id, options) {
|
|
1917
1970
|
if (!id)
|
|
1918
1971
|
throw new ValidationError({ message: 'Feedback ID is required for getById' });
|
|
1919
|
-
if (!options
|
|
1972
|
+
if (!options.folderKey)
|
|
1920
1973
|
throw new ValidationError({ message: 'folderKey is required for getById' });
|
|
1921
1974
|
const response = await this.get(FEEDBACK_ENDPOINTS.GET_BY_ID(id), { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
|
|
1922
1975
|
return transformData(response.data, FeedbackMap);
|
|
1923
1976
|
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Submits a feedback entry.
|
|
1979
|
+
*
|
|
1980
|
+
* @param traceId - Trace identifier linking feedback to a specific agent execution
|
|
1981
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
1982
|
+
* @param options - Additional feedback data and folderKey for authorization {@link FeedbackSubmitOptions}
|
|
1983
|
+
* @returns Promise resolving to the submitted {@link FeedbackResponse}
|
|
1984
|
+
* @example
|
|
1985
|
+
* ```typescript
|
|
1986
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
1987
|
+
*
|
|
1988
|
+
* const feedback = new Feedback(sdk);
|
|
1989
|
+
*
|
|
1990
|
+
* // Obtain traceId and folderKey from an existing feedback entry
|
|
1991
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
1992
|
+
* const traceId = allFeedback.items[0].traceId;
|
|
1993
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
1994
|
+
*
|
|
1995
|
+
* const item = await feedback.submit(traceId, true, { folderKey });
|
|
1996
|
+
* console.log(item.id, item.status);
|
|
1997
|
+
* ```
|
|
1998
|
+
*/
|
|
1999
|
+
async submit(traceId, isPositive, options) {
|
|
2000
|
+
if (!traceId)
|
|
2001
|
+
throw new ValidationError({ message: 'traceId is required for submit' });
|
|
2002
|
+
if (!options.folderKey)
|
|
2003
|
+
throw new ValidationError({ message: 'folderKey is required for submit' });
|
|
2004
|
+
const { folderKey, ...rest } = options;
|
|
2005
|
+
const response = await this.post(FEEDBACK_ENDPOINTS.SUBMIT, { traceId, isPositive, ...rest }, { headers: createHeaders({ [FOLDER_KEY]: folderKey }) });
|
|
2006
|
+
return transformData(response.data, FeedbackMap);
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Updates already submitted feedback.
|
|
2010
|
+
*
|
|
2011
|
+
* @param id - Feedback ID (GUID) of the entry to update
|
|
2012
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
2013
|
+
* @param options - Updated feedback data and folderKey for authorization {@link FeedbackUpdateOptions}
|
|
2014
|
+
* @returns Promise resolving to the updated {@link FeedbackResponse}
|
|
2015
|
+
* @example
|
|
2016
|
+
* ```typescript
|
|
2017
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2018
|
+
*
|
|
2019
|
+
* const feedback = new Feedback(sdk);
|
|
2020
|
+
*
|
|
2021
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
2022
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
2023
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
2024
|
+
*
|
|
2025
|
+
* const updated = await feedback.updateById(feedbackId, false, {
|
|
2026
|
+
* comment: 'On reflection, not great.',
|
|
2027
|
+
* folderKey,
|
|
2028
|
+
* });
|
|
2029
|
+
* console.log(updated.isPositive, updated.comment);
|
|
2030
|
+
* ```
|
|
2031
|
+
*/
|
|
2032
|
+
async updateById(id, isPositive, options) {
|
|
2033
|
+
if (!id)
|
|
2034
|
+
throw new ValidationError({ message: 'Feedback ID is required for updateById' });
|
|
2035
|
+
if (!options.folderKey)
|
|
2036
|
+
throw new ValidationError({ message: 'folderKey is required for updateById' });
|
|
2037
|
+
const { folderKey, ...rest } = options;
|
|
2038
|
+
const response = await this.post(FEEDBACK_ENDPOINTS.UPDATE(id), { isPositive, ...rest }, { headers: createHeaders({ [FOLDER_KEY]: folderKey }) });
|
|
2039
|
+
return transformData(response.data, FeedbackMap);
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Deletes a feedback entry by its ID.
|
|
2043
|
+
*
|
|
2044
|
+
* @param id - Feedback ID (GUID) of the entry to delete
|
|
2045
|
+
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
2046
|
+
* @returns Promise resolving to void on success
|
|
2047
|
+
* @example
|
|
2048
|
+
* ```typescript
|
|
2049
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2050
|
+
*
|
|
2051
|
+
* const feedback = new Feedback(sdk);
|
|
2052
|
+
*
|
|
2053
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
2054
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
2055
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
2056
|
+
*
|
|
2057
|
+
* await feedback.deleteById(feedbackId, { folderKey });
|
|
2058
|
+
* ```
|
|
2059
|
+
*/
|
|
2060
|
+
async deleteById(id, options) {
|
|
2061
|
+
if (!id)
|
|
2062
|
+
throw new ValidationError({ message: 'Feedback ID is required for deleteById' });
|
|
2063
|
+
if (!options.folderKey)
|
|
2064
|
+
throw new ValidationError({ message: 'folderKey is required for deleteById' });
|
|
2065
|
+
await this.delete(FEEDBACK_ENDPOINTS.DELETE(id), { headers: createHeaders({ [FOLDER_KEY]: options.folderKey }) });
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Creates a new feedback category.
|
|
2069
|
+
*
|
|
2070
|
+
* Custom categories can be used to label feedback entries beyond the default system categories.
|
|
2071
|
+
* Once created, reference the category by its `id` when submitting or updating feedback.
|
|
2072
|
+
* If `isPositive` and `isNegative` are omitted, the backend defaults both to `true`.
|
|
2073
|
+
*
|
|
2074
|
+
* @param category - Name of the category to create (max 256 characters, unique per tenant)
|
|
2075
|
+
* @param options - Optional flags controlling whether the category applies to positive and/or negative feedback {@link FeedbackCreateCategoryOptions}
|
|
2076
|
+
* @returns Promise resolving to the created {@link FeedbackCategoryResponse}
|
|
2077
|
+
* @example
|
|
2078
|
+
* ```typescript
|
|
2079
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2080
|
+
*
|
|
2081
|
+
* const feedback = new Feedback(sdk);
|
|
2082
|
+
*
|
|
2083
|
+
* // Minimum — applies to both positive and negative feedback by default
|
|
2084
|
+
* const category = await feedback.createCategory('Hallucination');
|
|
2085
|
+
* console.log(category.id, category.category);
|
|
2086
|
+
*
|
|
2087
|
+
* // With explicit flags
|
|
2088
|
+
* const negativeOnly = await feedback.createCategory('Off-topic', {
|
|
2089
|
+
* isPositive: false,
|
|
2090
|
+
* isNegative: true,
|
|
2091
|
+
* });
|
|
2092
|
+
* ```
|
|
2093
|
+
*/
|
|
2094
|
+
async createCategory(category, options) {
|
|
2095
|
+
if (!category)
|
|
2096
|
+
throw new ValidationError({ message: 'category name is required for createCategory' });
|
|
2097
|
+
const body = { category };
|
|
2098
|
+
if (options?.isPositive !== undefined)
|
|
2099
|
+
body.isPositive = options.isPositive;
|
|
2100
|
+
if (options?.isNegative !== undefined)
|
|
2101
|
+
body.isNegative = options.isNegative;
|
|
2102
|
+
const response = await this.post(FEEDBACK_ENDPOINTS.CATEGORY.CREATE, body);
|
|
2103
|
+
return transformData(response.data, FeedbackMap);
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Gets all feedback categories for the tenant.
|
|
2107
|
+
*
|
|
2108
|
+
* Returns both system default categories (Output, Agent Error, Agent Plan Execution)
|
|
2109
|
+
* and any custom categories created for this tenant.
|
|
2110
|
+
* 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.
|
|
2111
|
+
*
|
|
2112
|
+
* @param options - Optional filters and pagination options {@link FeedbackGetCategoriesOptions}
|
|
2113
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackCategoryResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackCategoryResponse} when pagination options are used.
|
|
2114
|
+
* @example
|
|
2115
|
+
* ```typescript
|
|
2116
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2117
|
+
*
|
|
2118
|
+
* const feedback = new Feedback(sdk);
|
|
2119
|
+
*
|
|
2120
|
+
* // Get all categories
|
|
2121
|
+
* const categories = await feedback.getCategories();
|
|
2122
|
+
* console.log(categories.items.map(c => c.category));
|
|
2123
|
+
*
|
|
2124
|
+
* // Get only categories applicable to negative feedback
|
|
2125
|
+
* const negativeCategories = await feedback.getCategories({ isNegative: true });
|
|
2126
|
+
*
|
|
2127
|
+
* // Paginated
|
|
2128
|
+
* const page1 = await feedback.getCategories({ pageSize: 10 });
|
|
2129
|
+
* ```
|
|
2130
|
+
*/
|
|
2131
|
+
async getCategories(options) {
|
|
2132
|
+
const transformCategory = (item) => transformData(item, FeedbackMap);
|
|
2133
|
+
return PaginationHelpers.getAll({
|
|
2134
|
+
serviceAccess: this.createPaginationServiceAccess(),
|
|
2135
|
+
getEndpoint: () => FEEDBACK_ENDPOINTS.CATEGORY.GET_ALL,
|
|
2136
|
+
transformFn: transformCategory,
|
|
2137
|
+
pagination: {
|
|
2138
|
+
paginationType: PaginationType.OFFSET,
|
|
2139
|
+
itemsField: FEEDBACK_CATEGORY_PAGINATION.ITEMS_FIELD,
|
|
2140
|
+
totalCountField: FEEDBACK_CATEGORY_PAGINATION.TOTAL_COUNT_FIELD,
|
|
2141
|
+
paginationParams: {
|
|
2142
|
+
pageSizeParam: FEEDBACK_OFFSET_PARAMS.PAGE_SIZE_PARAM,
|
|
2143
|
+
offsetParam: FEEDBACK_OFFSET_PARAMS.OFFSET_PARAM,
|
|
2144
|
+
countParam: FEEDBACK_OFFSET_PARAMS.COUNT_PARAM,
|
|
2145
|
+
},
|
|
2146
|
+
},
|
|
2147
|
+
excludeFromPrefix: Object.keys(options || {}),
|
|
2148
|
+
}, options);
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Deletes a feedback category by its ID.
|
|
2152
|
+
*
|
|
2153
|
+
* System default categories (Output, Agent Error, Agent Plan Execution) cannot be deleted —
|
|
2154
|
+
* attempting to do so throws a `409 Conflict` error.
|
|
2155
|
+
* Use `forceDelete` to delete a custom category that already has feedback entries associated with it.
|
|
2156
|
+
*
|
|
2157
|
+
* @param id - Category ID (GUID) of the category to delete
|
|
2158
|
+
* @param options - Optional deletion options {@link FeedbackDeleteCategoryOptions}
|
|
2159
|
+
* @returns Promise resolving to void on success
|
|
2160
|
+
* @example
|
|
2161
|
+
* ```typescript
|
|
2162
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
2163
|
+
*
|
|
2164
|
+
* const feedback = new Feedback(sdk);
|
|
2165
|
+
*
|
|
2166
|
+
* // Only custom categories (isDefault: false) can be deleted
|
|
2167
|
+
* const categories = await feedback.getCategories();
|
|
2168
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
2169
|
+
* if (customCategory) {
|
|
2170
|
+
* await feedback.deleteCategory(customCategory.id);
|
|
2171
|
+
* }
|
|
2172
|
+
* ```
|
|
2173
|
+
* @example
|
|
2174
|
+
* ```typescript
|
|
2175
|
+
* // Force-delete a custom category that has associated feedback entries
|
|
2176
|
+
* const categories = await feedback.getCategories();
|
|
2177
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
2178
|
+
* if (customCategory) {
|
|
2179
|
+
* await feedback.deleteCategory(customCategory.id, { forceDelete: true });
|
|
2180
|
+
* }
|
|
2181
|
+
* ```
|
|
2182
|
+
*/
|
|
2183
|
+
async deleteCategory(id, options) {
|
|
2184
|
+
if (!id)
|
|
2185
|
+
throw new ValidationError({ message: 'Category ID is required for deleteCategory' });
|
|
2186
|
+
const params = options?.forceDelete !== undefined ? { forceDelete: options.forceDelete } : undefined;
|
|
2187
|
+
await this.delete(FEEDBACK_ENDPOINTS.CATEGORY.DELETE(id), { params });
|
|
2188
|
+
}
|
|
1924
2189
|
}
|
|
1925
2190
|
__decorate([
|
|
1926
2191
|
track('Feedback.GetAll')
|
|
@@ -1928,6 +2193,24 @@ __decorate([
|
|
|
1928
2193
|
__decorate([
|
|
1929
2194
|
track('Feedback.GetById')
|
|
1930
2195
|
], FeedbackService.prototype, "getById", null);
|
|
2196
|
+
__decorate([
|
|
2197
|
+
track('Feedback.Submit')
|
|
2198
|
+
], FeedbackService.prototype, "submit", null);
|
|
2199
|
+
__decorate([
|
|
2200
|
+
track('Feedback.UpdateById')
|
|
2201
|
+
], FeedbackService.prototype, "updateById", null);
|
|
2202
|
+
__decorate([
|
|
2203
|
+
track('Feedback.DeleteById')
|
|
2204
|
+
], FeedbackService.prototype, "deleteById", null);
|
|
2205
|
+
__decorate([
|
|
2206
|
+
track('Feedback.CreateCategory')
|
|
2207
|
+
], FeedbackService.prototype, "createCategory", null);
|
|
2208
|
+
__decorate([
|
|
2209
|
+
track('Feedback.GetCategories')
|
|
2210
|
+
], FeedbackService.prototype, "getCategories", null);
|
|
2211
|
+
__decorate([
|
|
2212
|
+
track('Feedback.DeleteCategory')
|
|
2213
|
+
], FeedbackService.prototype, "deleteCategory", null);
|
|
1931
2214
|
|
|
1932
2215
|
/**
|
|
1933
2216
|
* Status of a feedback entry in the review workflow
|