@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.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;
|
|
@@ -1340,8 +1375,9 @@ class BaseService {
|
|
|
1340
1375
|
constructor(instance, headers) {
|
|
1341
1376
|
// Private field - not visible via Object.keys() or any reflection
|
|
1342
1377
|
_BaseService_apiClient.set(this, void 0);
|
|
1343
|
-
const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
|
|
1378
|
+
const { config, context, tokenManager, folderKey } = SDKInternalsRegistry.get(instance);
|
|
1344
1379
|
__classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
|
|
1380
|
+
this.config = { folderKey };
|
|
1345
1381
|
}
|
|
1346
1382
|
/**
|
|
1347
1383
|
* Gets a valid authentication token, refreshing if necessary.
|
|
@@ -1460,9 +1496,17 @@ class BaseService {
|
|
|
1460
1496
|
const pageSizeParam = paginationParams?.pageSizeParam || ODATA_OFFSET_PARAMS.PAGE_SIZE_PARAM;
|
|
1461
1497
|
const offsetParam = paginationParams?.offsetParam || ODATA_OFFSET_PARAMS.OFFSET_PARAM;
|
|
1462
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;
|
|
1463
1502
|
requestParams[pageSizeParam] = limitedPageSize;
|
|
1464
|
-
if (
|
|
1465
|
-
|
|
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;
|
|
1466
1510
|
}
|
|
1467
1511
|
{
|
|
1468
1512
|
requestParams[countParam] = true;
|
|
@@ -1493,7 +1537,8 @@ class BaseService {
|
|
|
1493
1537
|
// Extract items and metadata
|
|
1494
1538
|
// Handle both plain array responses and envelope responses ({ value: [...], totalRecordCount: N })
|
|
1495
1539
|
const items = Array.isArray(response.data) ? response.data : (response.data[itemsField] || []);
|
|
1496
|
-
const
|
|
1540
|
+
const rawTotalCount = Array.isArray(response.data) ? undefined : resolveNestedField(response.data, totalCountField);
|
|
1541
|
+
const totalCount = typeof rawTotalCount === 'number' ? rawTotalCount : undefined;
|
|
1497
1542
|
const continuationToken = response.data[continuationTokenField];
|
|
1498
1543
|
// Determine if there are more pages
|
|
1499
1544
|
const hasMore = this.determineHasMorePages(paginationType, {
|
|
@@ -1557,6 +1602,14 @@ const LLMOPS_BASE = 'llmopstenant_';
|
|
|
1557
1602
|
const FEEDBACK_ENDPOINTS = {
|
|
1558
1603
|
GET_ALL: `${LLMOPS_BASE}/api/Feedback`,
|
|
1559
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
|
+
},
|
|
1560
1613
|
};
|
|
1561
1614
|
|
|
1562
1615
|
/**
|
|
@@ -1565,7 +1618,7 @@ const FEEDBACK_ENDPOINTS = {
|
|
|
1565
1618
|
// Connection string placeholder that will be replaced during build
|
|
1566
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";
|
|
1567
1620
|
// SDK Version placeholder
|
|
1568
|
-
const SDK_VERSION = "1.3.
|
|
1621
|
+
const SDK_VERSION = "1.3.8";
|
|
1569
1622
|
const VERSION = "Version";
|
|
1570
1623
|
const SERVICE = "Service";
|
|
1571
1624
|
const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
|
|
@@ -1841,10 +1894,10 @@ class FeedbackService extends BaseService {
|
|
|
1841
1894
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
1842
1895
|
*
|
|
1843
1896
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
1844
|
-
* 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.
|
|
1845
1898
|
*
|
|
1846
1899
|
* @param options - Optional query parameters for filtering and pagination
|
|
1847
|
-
* @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.
|
|
1848
1901
|
* @example
|
|
1849
1902
|
* ```typescript
|
|
1850
1903
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -1896,7 +1949,7 @@ class FeedbackService extends BaseService {
|
|
|
1896
1949
|
*
|
|
1897
1950
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
1898
1951
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
1899
|
-
* @returns Promise resolving to {@link
|
|
1952
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
1900
1953
|
* @example
|
|
1901
1954
|
* ```typescript
|
|
1902
1955
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -1914,11 +1967,223 @@ class FeedbackService extends BaseService {
|
|
|
1914
1967
|
async getById(id, options) {
|
|
1915
1968
|
if (!id)
|
|
1916
1969
|
throw new ValidationError({ message: 'Feedback ID is required for getById' });
|
|
1917
|
-
if (!options
|
|
1970
|
+
if (!options.folderKey)
|
|
1918
1971
|
throw new ValidationError({ message: 'folderKey is required for getById' });
|
|
1919
1972
|
const response = await this.get(FEEDBACK_ENDPOINTS.GET_BY_ID(id), { headers: createHeaders({ [FOLDER_KEY]: options?.folderKey }) });
|
|
1920
1973
|
return transformData(response.data, FeedbackMap);
|
|
1921
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
|
+
}
|
|
1922
2187
|
}
|
|
1923
2188
|
__decorate([
|
|
1924
2189
|
track('Feedback.GetAll')
|
|
@@ -1926,6 +2191,24 @@ __decorate([
|
|
|
1926
2191
|
__decorate([
|
|
1927
2192
|
track('Feedback.GetById')
|
|
1928
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);
|
|
1929
2212
|
|
|
1930
2213
|
/**
|
|
1931
2214
|
* Status of a feedback entry in the review workflow
|