@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.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ interface RequestWithPaginationOptions extends RequestSpec {
|
|
|
106
106
|
offsetParam?: string;
|
|
107
107
|
tokenParam?: string;
|
|
108
108
|
countParam?: string;
|
|
109
|
+
convertToSkip?: boolean;
|
|
109
110
|
};
|
|
110
111
|
};
|
|
111
112
|
}
|
|
@@ -218,6 +219,13 @@ interface ApiResponse<T> {
|
|
|
218
219
|
*/
|
|
219
220
|
declare class BaseService {
|
|
220
221
|
#private;
|
|
222
|
+
/**
|
|
223
|
+
* SDK configuration (read-only). Available to subclasses so they can
|
|
224
|
+
* fall back to init-time defaults like `folderKey`.
|
|
225
|
+
*/
|
|
226
|
+
protected readonly config: {
|
|
227
|
+
folderKey?: string;
|
|
228
|
+
};
|
|
221
229
|
/**
|
|
222
230
|
* Creates a base service instance with dependency injection.
|
|
223
231
|
*
|
|
@@ -294,6 +302,7 @@ declare class BaseService {
|
|
|
294
302
|
/**
|
|
295
303
|
* Represents a category that can be associated with feedback.
|
|
296
304
|
* Default categories (Output, Agent Error, Agent Plan Execution) are auto-created per tenant.
|
|
305
|
+
* Used as nested objects inside {@link FeedbackResponse}.
|
|
297
306
|
*/
|
|
298
307
|
interface FeedbackCategory {
|
|
299
308
|
/** Unique identifier of the feedback category */
|
|
@@ -309,6 +318,24 @@ interface FeedbackCategory {
|
|
|
309
318
|
/** Whether this category applies to negative feedback */
|
|
310
319
|
isNegative: boolean;
|
|
311
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* A feedback category returned by {@link FeedbackServiceModel.getCategories}, {@link FeedbackServiceModel.createCategory}.
|
|
323
|
+
* Fields are transformed to camelCase SDK conventions (createdAt → createdTime).
|
|
324
|
+
*/
|
|
325
|
+
interface FeedbackCategoryResponse {
|
|
326
|
+
/** Unique identifier of the feedback category */
|
|
327
|
+
id: string;
|
|
328
|
+
/** Category name (max 256 characters, unique per tenant) */
|
|
329
|
+
category: string;
|
|
330
|
+
/** Timestamp when the category was created */
|
|
331
|
+
createdTime: string;
|
|
332
|
+
/** Whether this is a system default category (e.g., Output, Agent Error, Agent Plan Execution) */
|
|
333
|
+
isDefault: boolean;
|
|
334
|
+
/** Whether this category applies to positive feedback */
|
|
335
|
+
isPositive: boolean;
|
|
336
|
+
/** Whether this category applies to negative feedback */
|
|
337
|
+
isNegative: boolean;
|
|
338
|
+
}
|
|
312
339
|
/**
|
|
313
340
|
* Status of a feedback entry in the review workflow
|
|
314
341
|
*/
|
|
@@ -323,7 +350,7 @@ declare enum FeedbackStatus {
|
|
|
323
350
|
/**
|
|
324
351
|
* Complete feedback object returned from the API
|
|
325
352
|
*/
|
|
326
|
-
interface
|
|
353
|
+
interface FeedbackResponse {
|
|
327
354
|
/** Unique identifier of the feedback entry */
|
|
328
355
|
id: string;
|
|
329
356
|
/** Trace identifier linking feedback to a specific agent execution */
|
|
@@ -353,6 +380,12 @@ interface FeedbackGetResponse {
|
|
|
353
380
|
/** Timestamp when the feedback was last updated */
|
|
354
381
|
updatedTime: string;
|
|
355
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Feedback object returned by getAll and getById.
|
|
385
|
+
* Extends {@link FeedbackResponse} — use this type for getAll/getById return values.
|
|
386
|
+
*/
|
|
387
|
+
interface FeedbackGetResponse extends FeedbackResponse {
|
|
388
|
+
}
|
|
356
389
|
/**
|
|
357
390
|
* Options shared across feedback operations
|
|
358
391
|
*/
|
|
@@ -360,6 +393,45 @@ interface FeedbackOptions {
|
|
|
360
393
|
/** Folder key for authorization */
|
|
361
394
|
folderKey: string;
|
|
362
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* A category reference used when creating or updating feedback
|
|
398
|
+
*/
|
|
399
|
+
interface FeedbackCategoryInput {
|
|
400
|
+
/** Unique identifier of the category */
|
|
401
|
+
id: string;
|
|
402
|
+
/** Category name (e.g., 'Output', 'Agent Error', 'Agent Plan Execution') */
|
|
403
|
+
category: string;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Options for submitting a new feedback entry
|
|
407
|
+
*/
|
|
408
|
+
interface FeedbackSubmitOptions extends FeedbackOptions {
|
|
409
|
+
/** Span identifier representing a specific operation within the trace */
|
|
410
|
+
spanId?: string;
|
|
411
|
+
/** Identifier of the agent that generated the response being reviewed */
|
|
412
|
+
agentId?: string;
|
|
413
|
+
/** Version of the agent at the time the feedback was given (max 100 characters) */
|
|
414
|
+
agentVersion?: string;
|
|
415
|
+
/** Span type (e.g., 'agentRun', 'llm', 'tool', 'retriever') (max 100 characters) */
|
|
416
|
+
spanType?: string;
|
|
417
|
+
/** Optional text comment provided by the user (max 4000 characters) */
|
|
418
|
+
comment?: string;
|
|
419
|
+
/** Optional metadata string associated with the feedback (max 4000 characters) */
|
|
420
|
+
metadata?: string;
|
|
421
|
+
/** Categories to associate with this feedback entry */
|
|
422
|
+
categories?: FeedbackCategoryInput[];
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Options for updating an existing feedback entry
|
|
426
|
+
*/
|
|
427
|
+
interface FeedbackUpdateOptions extends FeedbackOptions {
|
|
428
|
+
/** Optional text comment provided by the user (max 4000 characters) */
|
|
429
|
+
comment?: string;
|
|
430
|
+
/** Optional metadata string associated with the feedback (max 4000 characters) */
|
|
431
|
+
metadata?: string;
|
|
432
|
+
/** Categories to associate with this feedback entry */
|
|
433
|
+
categories?: FeedbackCategoryInput[];
|
|
434
|
+
}
|
|
363
435
|
/**
|
|
364
436
|
* Options for retrieving multiple feedback entries
|
|
365
437
|
*/
|
|
@@ -375,6 +447,32 @@ type FeedbackGetAllOptions = PaginationOptions & {
|
|
|
375
447
|
/** Filter by OpenTelemetry span identifier */
|
|
376
448
|
spanId?: string;
|
|
377
449
|
};
|
|
450
|
+
/**
|
|
451
|
+
* Options for creating a new feedback category
|
|
452
|
+
*/
|
|
453
|
+
interface FeedbackCreateCategoryOptions {
|
|
454
|
+
/** Whether the category applies to positive feedback (defaults to true) */
|
|
455
|
+
isPositive?: boolean;
|
|
456
|
+
/** Whether the category applies to negative feedback (defaults to true) */
|
|
457
|
+
isNegative?: boolean;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Options for deleting a feedback category.
|
|
461
|
+
* Note: system default categories (Output, Agent Error, Agent Plan Execution) cannot be deleted — attempting to do so returns a 409 Conflict.
|
|
462
|
+
*/
|
|
463
|
+
interface FeedbackDeleteCategoryOptions {
|
|
464
|
+
/** When true, deletes the category even if it has associated feedback entries */
|
|
465
|
+
forceDelete?: boolean;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Options for retrieving feedback categories
|
|
469
|
+
*/
|
|
470
|
+
type FeedbackGetCategoriesOptions = PaginationOptions & {
|
|
471
|
+
/** Filter by whether the category applies to positive feedback */
|
|
472
|
+
isPositive?: boolean;
|
|
473
|
+
/** Filter by whether the category applies to negative feedback */
|
|
474
|
+
isNegative?: boolean;
|
|
475
|
+
};
|
|
378
476
|
|
|
379
477
|
/**
|
|
380
478
|
* Service for managing UiPath Agent Feedback.
|
|
@@ -400,10 +498,10 @@ interface FeedbackServiceModel {
|
|
|
400
498
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
401
499
|
*
|
|
402
500
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
403
|
-
* When no pagination options are provided, the
|
|
501
|
+
* 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.
|
|
404
502
|
*
|
|
405
503
|
* @param options - Optional query parameters for filtering and pagination
|
|
406
|
-
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link
|
|
504
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackResponse} when pagination options are used.
|
|
407
505
|
* @example
|
|
408
506
|
* ```typescript
|
|
409
507
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -433,13 +531,13 @@ interface FeedbackServiceModel {
|
|
|
433
531
|
* });
|
|
434
532
|
* ```
|
|
435
533
|
*/
|
|
436
|
-
getAll<T extends FeedbackGetAllOptions = FeedbackGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<
|
|
534
|
+
getAll<T extends FeedbackGetAllOptions = FeedbackGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FeedbackResponse> : NonPaginatedResponse<FeedbackResponse>>;
|
|
437
535
|
/**
|
|
438
536
|
* Gets a single feedback entry by its feedback ID.
|
|
439
537
|
*
|
|
440
538
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
441
539
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
442
|
-
* @returns Promise resolving to {@link
|
|
540
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
443
541
|
* @example
|
|
444
542
|
* ```typescript
|
|
445
543
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -450,11 +548,169 @@ interface FeedbackServiceModel {
|
|
|
450
548
|
* const allFeedback = await feedback.getAll({ pageSize: 10 });
|
|
451
549
|
* const feedbackId = allFeedback.items[0].id;
|
|
452
550
|
* const folderKey = allFeedback.items[0].folderKey;
|
|
551
|
+
*
|
|
453
552
|
* const item = await feedback.getById(feedbackId, { folderKey });
|
|
454
553
|
* console.log(item.isPositive, item.comment, item.status);
|
|
455
554
|
* ```
|
|
456
555
|
*/
|
|
457
|
-
getById(id: string, options: FeedbackOptions): Promise<
|
|
556
|
+
getById(id: string, options: FeedbackOptions): Promise<FeedbackResponse>;
|
|
557
|
+
/**
|
|
558
|
+
* Submits a feedback entry.
|
|
559
|
+
*
|
|
560
|
+
* @param traceId - Trace identifier linking feedback to a specific agent execution
|
|
561
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
562
|
+
* @param options - Additional feedback data and folderKey for authorization {@link FeedbackSubmitOptions}
|
|
563
|
+
* @returns Promise resolving to the submitted {@link FeedbackResponse}
|
|
564
|
+
* @example
|
|
565
|
+
* ```typescript
|
|
566
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
567
|
+
*
|
|
568
|
+
* const feedback = new Feedback(sdk);
|
|
569
|
+
*
|
|
570
|
+
* // Obtain traceId and folderKey from an existing feedback entry
|
|
571
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
572
|
+
* const traceId = allFeedback.items[0].traceId;
|
|
573
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
574
|
+
*
|
|
575
|
+
* const item = await feedback.submit(traceId, true, { folderKey });
|
|
576
|
+
* console.log(item.id, item.status);
|
|
577
|
+
* ```
|
|
578
|
+
*/
|
|
579
|
+
submit(traceId: string, isPositive: boolean, options: FeedbackSubmitOptions): Promise<FeedbackResponse>;
|
|
580
|
+
/**
|
|
581
|
+
* Updates already submitted feedback.
|
|
582
|
+
*
|
|
583
|
+
* @param id - Feedback ID (GUID) of the entry to update
|
|
584
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
585
|
+
* @param options - Updated feedback data and folderKey for authorization {@link FeedbackUpdateOptions}
|
|
586
|
+
* @returns Promise resolving to the updated {@link FeedbackResponse}
|
|
587
|
+
* @example
|
|
588
|
+
* ```typescript
|
|
589
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
590
|
+
*
|
|
591
|
+
* const feedback = new Feedback(sdk);
|
|
592
|
+
*
|
|
593
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
594
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
595
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
596
|
+
*
|
|
597
|
+
* const updated = await feedback.updateById(feedbackId, false, {
|
|
598
|
+
* comment: 'On reflection, not great.',
|
|
599
|
+
* folderKey,
|
|
600
|
+
* });
|
|
601
|
+
* console.log(updated.isPositive, updated.comment);
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
updateById(id: string, isPositive: boolean, options: FeedbackUpdateOptions): Promise<FeedbackResponse>;
|
|
605
|
+
/**
|
|
606
|
+
* Deletes a feedback entry by its ID.
|
|
607
|
+
*
|
|
608
|
+
* @param id - Feedback ID (GUID) of the entry to delete
|
|
609
|
+
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
610
|
+
* @returns Promise resolving to void on success
|
|
611
|
+
* @example
|
|
612
|
+
* ```typescript
|
|
613
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
614
|
+
*
|
|
615
|
+
* const feedback = new Feedback(sdk);
|
|
616
|
+
*
|
|
617
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
618
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
619
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
620
|
+
*
|
|
621
|
+
* await feedback.deleteById(feedbackId, { folderKey });
|
|
622
|
+
* ```
|
|
623
|
+
*/
|
|
624
|
+
deleteById(id: string, options: FeedbackOptions): Promise<void>;
|
|
625
|
+
/**
|
|
626
|
+
* Creates a new feedback category.
|
|
627
|
+
*
|
|
628
|
+
* Custom categories can be used to label feedback entries beyond the default system categories.
|
|
629
|
+
* Once created, reference the category by its `id` when submitting or updating feedback.
|
|
630
|
+
* If `isPositive` and `isNegative` are omitted, the backend defaults both to `true`.
|
|
631
|
+
*
|
|
632
|
+
* @param category - Name of the category to create (max 256 characters, unique per tenant)
|
|
633
|
+
* @param options - Optional flags controlling whether the category applies to positive and/or negative feedback {@link FeedbackCreateCategoryOptions}
|
|
634
|
+
* @returns Promise resolving to the created {@link FeedbackCategoryResponse}
|
|
635
|
+
* @example
|
|
636
|
+
* ```typescript
|
|
637
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
638
|
+
*
|
|
639
|
+
* const feedback = new Feedback(sdk);
|
|
640
|
+
*
|
|
641
|
+
* // Minimum — applies to both positive and negative feedback by default
|
|
642
|
+
* const category = await feedback.createCategory('Hallucination');
|
|
643
|
+
* console.log(category.id, category.category);
|
|
644
|
+
*
|
|
645
|
+
* // With explicit flags
|
|
646
|
+
* const negativeOnly = await feedback.createCategory('Off-topic', {
|
|
647
|
+
* isPositive: false,
|
|
648
|
+
* isNegative: true,
|
|
649
|
+
* });
|
|
650
|
+
* ```
|
|
651
|
+
*/
|
|
652
|
+
createCategory(category: string, options?: FeedbackCreateCategoryOptions): Promise<FeedbackCategoryResponse>;
|
|
653
|
+
/**
|
|
654
|
+
* Gets all feedback categories for the tenant.
|
|
655
|
+
*
|
|
656
|
+
* Returns both system default categories (Output, Agent Error, Agent Plan Execution)
|
|
657
|
+
* and any custom categories created for this tenant.
|
|
658
|
+
* 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.
|
|
659
|
+
*
|
|
660
|
+
* @param options - Optional filters and pagination options {@link FeedbackGetCategoriesOptions}
|
|
661
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackCategoryResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackCategoryResponse} when pagination options are used.
|
|
662
|
+
* @example
|
|
663
|
+
* ```typescript
|
|
664
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
665
|
+
*
|
|
666
|
+
* const feedback = new Feedback(sdk);
|
|
667
|
+
*
|
|
668
|
+
* // Get all categories
|
|
669
|
+
* const categories = await feedback.getCategories();
|
|
670
|
+
* console.log(categories.items.map(c => c.category));
|
|
671
|
+
*
|
|
672
|
+
* // Get only categories applicable to negative feedback
|
|
673
|
+
* const negativeCategories = await feedback.getCategories({ isNegative: true });
|
|
674
|
+
*
|
|
675
|
+
* // Paginated
|
|
676
|
+
* const page1 = await feedback.getCategories({ pageSize: 10 });
|
|
677
|
+
* ```
|
|
678
|
+
*/
|
|
679
|
+
getCategories<T extends FeedbackGetCategoriesOptions = FeedbackGetCategoriesOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FeedbackCategoryResponse> : NonPaginatedResponse<FeedbackCategoryResponse>>;
|
|
680
|
+
/**
|
|
681
|
+
* Deletes a feedback category by its ID.
|
|
682
|
+
*
|
|
683
|
+
* System default categories (Output, Agent Error, Agent Plan Execution) cannot be deleted —
|
|
684
|
+
* attempting to do so throws a `409 Conflict` error.
|
|
685
|
+
* Use `forceDelete` to delete a custom category that already has feedback entries associated with it.
|
|
686
|
+
*
|
|
687
|
+
* @param id - Category ID (GUID) of the category to delete
|
|
688
|
+
* @param options - Optional deletion options {@link FeedbackDeleteCategoryOptions}
|
|
689
|
+
* @returns Promise resolving to void on success
|
|
690
|
+
* @example
|
|
691
|
+
* ```typescript
|
|
692
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
693
|
+
*
|
|
694
|
+
* const feedback = new Feedback(sdk);
|
|
695
|
+
*
|
|
696
|
+
* // Only custom categories (isDefault: false) can be deleted
|
|
697
|
+
* const categories = await feedback.getCategories();
|
|
698
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
699
|
+
* if (customCategory) {
|
|
700
|
+
* await feedback.deleteCategory(customCategory.id);
|
|
701
|
+
* }
|
|
702
|
+
* ```
|
|
703
|
+
* @example
|
|
704
|
+
* ```typescript
|
|
705
|
+
* // Force-delete a custom category that has associated feedback entries
|
|
706
|
+
* const categories = await feedback.getCategories();
|
|
707
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
708
|
+
* if (customCategory) {
|
|
709
|
+
* await feedback.deleteCategory(customCategory.id, { forceDelete: true });
|
|
710
|
+
* }
|
|
711
|
+
* ```
|
|
712
|
+
*/
|
|
713
|
+
deleteCategory(id: string, options?: FeedbackDeleteCategoryOptions): Promise<void>;
|
|
458
714
|
}
|
|
459
715
|
|
|
460
716
|
/**
|
|
@@ -465,10 +721,10 @@ declare class FeedbackService extends BaseService implements FeedbackServiceMode
|
|
|
465
721
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
466
722
|
*
|
|
467
723
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
468
|
-
* When no pagination options are provided, the
|
|
724
|
+
* 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.
|
|
469
725
|
*
|
|
470
726
|
* @param options - Optional query parameters for filtering and pagination
|
|
471
|
-
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link
|
|
727
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackResponse} when pagination options are used.
|
|
472
728
|
* @example
|
|
473
729
|
* ```typescript
|
|
474
730
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -498,13 +754,13 @@ declare class FeedbackService extends BaseService implements FeedbackServiceMode
|
|
|
498
754
|
* });
|
|
499
755
|
* ```
|
|
500
756
|
*/
|
|
501
|
-
getAll<T extends FeedbackGetAllOptions = FeedbackGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<
|
|
757
|
+
getAll<T extends FeedbackGetAllOptions = FeedbackGetAllOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FeedbackResponse> : NonPaginatedResponse<FeedbackResponse>>;
|
|
502
758
|
/**
|
|
503
759
|
* Gets a single feedback entry by its feedback ID.
|
|
504
760
|
*
|
|
505
761
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
506
762
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
507
|
-
* @returns Promise resolving to {@link
|
|
763
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
508
764
|
* @example
|
|
509
765
|
* ```typescript
|
|
510
766
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -519,8 +775,165 @@ declare class FeedbackService extends BaseService implements FeedbackServiceMode
|
|
|
519
775
|
* console.log(item.isPositive, item.comment, item.status);
|
|
520
776
|
* ```
|
|
521
777
|
*/
|
|
522
|
-
getById(id: string, options: FeedbackOptions): Promise<
|
|
778
|
+
getById(id: string, options: FeedbackOptions): Promise<FeedbackResponse>;
|
|
779
|
+
/**
|
|
780
|
+
* Submits a feedback entry.
|
|
781
|
+
*
|
|
782
|
+
* @param traceId - Trace identifier linking feedback to a specific agent execution
|
|
783
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
784
|
+
* @param options - Additional feedback data and folderKey for authorization {@link FeedbackSubmitOptions}
|
|
785
|
+
* @returns Promise resolving to the submitted {@link FeedbackResponse}
|
|
786
|
+
* @example
|
|
787
|
+
* ```typescript
|
|
788
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
789
|
+
*
|
|
790
|
+
* const feedback = new Feedback(sdk);
|
|
791
|
+
*
|
|
792
|
+
* // Obtain traceId and folderKey from an existing feedback entry
|
|
793
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
794
|
+
* const traceId = allFeedback.items[0].traceId;
|
|
795
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
796
|
+
*
|
|
797
|
+
* const item = await feedback.submit(traceId, true, { folderKey });
|
|
798
|
+
* console.log(item.id, item.status);
|
|
799
|
+
* ```
|
|
800
|
+
*/
|
|
801
|
+
submit(traceId: string, isPositive: boolean, options: FeedbackSubmitOptions): Promise<FeedbackResponse>;
|
|
802
|
+
/**
|
|
803
|
+
* Updates already submitted feedback.
|
|
804
|
+
*
|
|
805
|
+
* @param id - Feedback ID (GUID) of the entry to update
|
|
806
|
+
* @param isPositive - Whether the feedback is positive (thumbs up) or negative (thumbs down)
|
|
807
|
+
* @param options - Updated feedback data and folderKey for authorization {@link FeedbackUpdateOptions}
|
|
808
|
+
* @returns Promise resolving to the updated {@link FeedbackResponse}
|
|
809
|
+
* @example
|
|
810
|
+
* ```typescript
|
|
811
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
812
|
+
*
|
|
813
|
+
* const feedback = new Feedback(sdk);
|
|
814
|
+
*
|
|
815
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
816
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
817
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
818
|
+
*
|
|
819
|
+
* const updated = await feedback.updateById(feedbackId, false, {
|
|
820
|
+
* comment: 'On reflection, not great.',
|
|
821
|
+
* folderKey,
|
|
822
|
+
* });
|
|
823
|
+
* console.log(updated.isPositive, updated.comment);
|
|
824
|
+
* ```
|
|
825
|
+
*/
|
|
826
|
+
updateById(id: string, isPositive: boolean, options: FeedbackUpdateOptions): Promise<FeedbackResponse>;
|
|
827
|
+
/**
|
|
828
|
+
* Deletes a feedback entry by its ID.
|
|
829
|
+
*
|
|
830
|
+
* @param id - Feedback ID (GUID) of the entry to delete
|
|
831
|
+
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
832
|
+
* @returns Promise resolving to void on success
|
|
833
|
+
* @example
|
|
834
|
+
* ```typescript
|
|
835
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
836
|
+
*
|
|
837
|
+
* const feedback = new Feedback(sdk);
|
|
838
|
+
*
|
|
839
|
+
* const allFeedback = await feedback.getAll({ pageSize: 1 });
|
|
840
|
+
* const feedbackId = allFeedback.items[0].id;
|
|
841
|
+
* const folderKey = allFeedback.items[0].folderKey!;
|
|
842
|
+
*
|
|
843
|
+
* await feedback.deleteById(feedbackId, { folderKey });
|
|
844
|
+
* ```
|
|
845
|
+
*/
|
|
846
|
+
deleteById(id: string, options: FeedbackOptions): Promise<void>;
|
|
847
|
+
/**
|
|
848
|
+
* Creates a new feedback category.
|
|
849
|
+
*
|
|
850
|
+
* Custom categories can be used to label feedback entries beyond the default system categories.
|
|
851
|
+
* Once created, reference the category by its `id` when submitting or updating feedback.
|
|
852
|
+
* If `isPositive` and `isNegative` are omitted, the backend defaults both to `true`.
|
|
853
|
+
*
|
|
854
|
+
* @param category - Name of the category to create (max 256 characters, unique per tenant)
|
|
855
|
+
* @param options - Optional flags controlling whether the category applies to positive and/or negative feedback {@link FeedbackCreateCategoryOptions}
|
|
856
|
+
* @returns Promise resolving to the created {@link FeedbackCategoryResponse}
|
|
857
|
+
* @example
|
|
858
|
+
* ```typescript
|
|
859
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
860
|
+
*
|
|
861
|
+
* const feedback = new Feedback(sdk);
|
|
862
|
+
*
|
|
863
|
+
* // Minimum — applies to both positive and negative feedback by default
|
|
864
|
+
* const category = await feedback.createCategory('Hallucination');
|
|
865
|
+
* console.log(category.id, category.category);
|
|
866
|
+
*
|
|
867
|
+
* // With explicit flags
|
|
868
|
+
* const negativeOnly = await feedback.createCategory('Off-topic', {
|
|
869
|
+
* isPositive: false,
|
|
870
|
+
* isNegative: true,
|
|
871
|
+
* });
|
|
872
|
+
* ```
|
|
873
|
+
*/
|
|
874
|
+
createCategory(category: string, options?: FeedbackCreateCategoryOptions): Promise<FeedbackCategoryResponse>;
|
|
875
|
+
/**
|
|
876
|
+
* Gets all feedback categories for the tenant.
|
|
877
|
+
*
|
|
878
|
+
* Returns both system default categories (Output, Agent Error, Agent Plan Execution)
|
|
879
|
+
* and any custom categories created for this tenant.
|
|
880
|
+
* 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.
|
|
881
|
+
*
|
|
882
|
+
* @param options - Optional filters and pagination options {@link FeedbackGetCategoriesOptions}
|
|
883
|
+
* @returns Promise resolving to {@link NonPaginatedResponse} of {@link FeedbackCategoryResponse} without pagination options, or {@link PaginatedResponse} of {@link FeedbackCategoryResponse} when pagination options are used.
|
|
884
|
+
* @example
|
|
885
|
+
* ```typescript
|
|
886
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
887
|
+
*
|
|
888
|
+
* const feedback = new Feedback(sdk);
|
|
889
|
+
*
|
|
890
|
+
* // Get all categories
|
|
891
|
+
* const categories = await feedback.getCategories();
|
|
892
|
+
* console.log(categories.items.map(c => c.category));
|
|
893
|
+
*
|
|
894
|
+
* // Get only categories applicable to negative feedback
|
|
895
|
+
* const negativeCategories = await feedback.getCategories({ isNegative: true });
|
|
896
|
+
*
|
|
897
|
+
* // Paginated
|
|
898
|
+
* const page1 = await feedback.getCategories({ pageSize: 10 });
|
|
899
|
+
* ```
|
|
900
|
+
*/
|
|
901
|
+
getCategories<T extends FeedbackGetCategoriesOptions = FeedbackGetCategoriesOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FeedbackCategoryResponse> : NonPaginatedResponse<FeedbackCategoryResponse>>;
|
|
902
|
+
/**
|
|
903
|
+
* Deletes a feedback category by its ID.
|
|
904
|
+
*
|
|
905
|
+
* System default categories (Output, Agent Error, Agent Plan Execution) cannot be deleted —
|
|
906
|
+
* attempting to do so throws a `409 Conflict` error.
|
|
907
|
+
* Use `forceDelete` to delete a custom category that already has feedback entries associated with it.
|
|
908
|
+
*
|
|
909
|
+
* @param id - Category ID (GUID) of the category to delete
|
|
910
|
+
* @param options - Optional deletion options {@link FeedbackDeleteCategoryOptions}
|
|
911
|
+
* @returns Promise resolving to void on success
|
|
912
|
+
* @example
|
|
913
|
+
* ```typescript
|
|
914
|
+
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
915
|
+
*
|
|
916
|
+
* const feedback = new Feedback(sdk);
|
|
917
|
+
*
|
|
918
|
+
* // Only custom categories (isDefault: false) can be deleted
|
|
919
|
+
* const categories = await feedback.getCategories();
|
|
920
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
921
|
+
* if (customCategory) {
|
|
922
|
+
* await feedback.deleteCategory(customCategory.id);
|
|
923
|
+
* }
|
|
924
|
+
* ```
|
|
925
|
+
* @example
|
|
926
|
+
* ```typescript
|
|
927
|
+
* // Force-delete a custom category that has associated feedback entries
|
|
928
|
+
* const categories = await feedback.getCategories();
|
|
929
|
+
* const customCategory = categories.items.find(c => !c.isDefault);
|
|
930
|
+
* if (customCategory) {
|
|
931
|
+
* await feedback.deleteCategory(customCategory.id, { forceDelete: true });
|
|
932
|
+
* }
|
|
933
|
+
* ```
|
|
934
|
+
*/
|
|
935
|
+
deleteCategory(id: string, options?: FeedbackDeleteCategoryOptions): Promise<void>;
|
|
523
936
|
}
|
|
524
937
|
|
|
525
938
|
export { FeedbackService as Feedback, FeedbackStatus };
|
|
526
|
-
export type { FeedbackCategory, FeedbackGetAllOptions, FeedbackGetResponse, FeedbackOptions, FeedbackServiceModel };
|
|
939
|
+
export type { FeedbackCategory, FeedbackCategoryInput, FeedbackCategoryResponse, FeedbackCreateCategoryOptions, FeedbackDeleteCategoryOptions, FeedbackGetAllOptions, FeedbackGetCategoriesOptions, FeedbackGetResponse, FeedbackOptions, FeedbackResponse, FeedbackServiceModel, FeedbackSubmitOptions, FeedbackUpdateOptions };
|