@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.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
|
}
|
|
@@ -301,6 +302,7 @@ declare class BaseService {
|
|
|
301
302
|
/**
|
|
302
303
|
* Represents a category that can be associated with feedback.
|
|
303
304
|
* Default categories (Output, Agent Error, Agent Plan Execution) are auto-created per tenant.
|
|
305
|
+
* Used as nested objects inside {@link FeedbackResponse}.
|
|
304
306
|
*/
|
|
305
307
|
interface FeedbackCategory {
|
|
306
308
|
/** Unique identifier of the feedback category */
|
|
@@ -316,6 +318,24 @@ interface FeedbackCategory {
|
|
|
316
318
|
/** Whether this category applies to negative feedback */
|
|
317
319
|
isNegative: boolean;
|
|
318
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
|
+
}
|
|
319
339
|
/**
|
|
320
340
|
* Status of a feedback entry in the review workflow
|
|
321
341
|
*/
|
|
@@ -330,7 +350,7 @@ declare enum FeedbackStatus {
|
|
|
330
350
|
/**
|
|
331
351
|
* Complete feedback object returned from the API
|
|
332
352
|
*/
|
|
333
|
-
interface
|
|
353
|
+
interface FeedbackResponse {
|
|
334
354
|
/** Unique identifier of the feedback entry */
|
|
335
355
|
id: string;
|
|
336
356
|
/** Trace identifier linking feedback to a specific agent execution */
|
|
@@ -360,6 +380,12 @@ interface FeedbackGetResponse {
|
|
|
360
380
|
/** Timestamp when the feedback was last updated */
|
|
361
381
|
updatedTime: string;
|
|
362
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
|
+
}
|
|
363
389
|
/**
|
|
364
390
|
* Options shared across feedback operations
|
|
365
391
|
*/
|
|
@@ -367,6 +393,45 @@ interface FeedbackOptions {
|
|
|
367
393
|
/** Folder key for authorization */
|
|
368
394
|
folderKey: string;
|
|
369
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
|
+
}
|
|
370
435
|
/**
|
|
371
436
|
* Options for retrieving multiple feedback entries
|
|
372
437
|
*/
|
|
@@ -382,6 +447,32 @@ type FeedbackGetAllOptions = PaginationOptions & {
|
|
|
382
447
|
/** Filter by OpenTelemetry span identifier */
|
|
383
448
|
spanId?: string;
|
|
384
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
|
+
};
|
|
385
476
|
|
|
386
477
|
/**
|
|
387
478
|
* Service for managing UiPath Agent Feedback.
|
|
@@ -407,10 +498,10 @@ interface FeedbackServiceModel {
|
|
|
407
498
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
408
499
|
*
|
|
409
500
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
410
|
-
* 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.
|
|
411
502
|
*
|
|
412
503
|
* @param options - Optional query parameters for filtering and pagination
|
|
413
|
-
* @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.
|
|
414
505
|
* @example
|
|
415
506
|
* ```typescript
|
|
416
507
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -440,13 +531,13 @@ interface FeedbackServiceModel {
|
|
|
440
531
|
* });
|
|
441
532
|
* ```
|
|
442
533
|
*/
|
|
443
|
-
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>>;
|
|
444
535
|
/**
|
|
445
536
|
* Gets a single feedback entry by its feedback ID.
|
|
446
537
|
*
|
|
447
538
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
448
539
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
449
|
-
* @returns Promise resolving to {@link
|
|
540
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
450
541
|
* @example
|
|
451
542
|
* ```typescript
|
|
452
543
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -457,11 +548,169 @@ interface FeedbackServiceModel {
|
|
|
457
548
|
* const allFeedback = await feedback.getAll({ pageSize: 10 });
|
|
458
549
|
* const feedbackId = allFeedback.items[0].id;
|
|
459
550
|
* const folderKey = allFeedback.items[0].folderKey;
|
|
551
|
+
*
|
|
460
552
|
* const item = await feedback.getById(feedbackId, { folderKey });
|
|
461
553
|
* console.log(item.isPositive, item.comment, item.status);
|
|
462
554
|
* ```
|
|
463
555
|
*/
|
|
464
|
-
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>;
|
|
465
714
|
}
|
|
466
715
|
|
|
467
716
|
/**
|
|
@@ -472,10 +721,10 @@ declare class FeedbackService extends BaseService implements FeedbackServiceMode
|
|
|
472
721
|
* Gets all feedback across all agents in the tenant, with optional filters.
|
|
473
722
|
*
|
|
474
723
|
* Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version.
|
|
475
|
-
* 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.
|
|
476
725
|
*
|
|
477
726
|
* @param options - Optional query parameters for filtering and pagination
|
|
478
|
-
* @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.
|
|
479
728
|
* @example
|
|
480
729
|
* ```typescript
|
|
481
730
|
* import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
|
|
@@ -505,13 +754,13 @@ declare class FeedbackService extends BaseService implements FeedbackServiceMode
|
|
|
505
754
|
* });
|
|
506
755
|
* ```
|
|
507
756
|
*/
|
|
508
|
-
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>>;
|
|
509
758
|
/**
|
|
510
759
|
* Gets a single feedback entry by its feedback ID.
|
|
511
760
|
*
|
|
512
761
|
* @param id - Feedback ID (GUID) of the feedback entry
|
|
513
762
|
* @param options - Required options including folderKey for folder-level authorization {@link FeedbackOptions}
|
|
514
|
-
* @returns Promise resolving to {@link
|
|
763
|
+
* @returns Promise resolving to {@link FeedbackResponse}
|
|
515
764
|
* @example
|
|
516
765
|
* ```typescript
|
|
517
766
|
* import { Feedback } from '@uipath/uipath-typescript/feedback';
|
|
@@ -526,8 +775,165 @@ declare class FeedbackService extends BaseService implements FeedbackServiceMode
|
|
|
526
775
|
* console.log(item.isPositive, item.comment, item.status);
|
|
527
776
|
* ```
|
|
528
777
|
*/
|
|
529
|
-
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>;
|
|
530
936
|
}
|
|
531
937
|
|
|
532
938
|
export { FeedbackService as Feedback, FeedbackStatus };
|
|
533
|
-
export type { FeedbackCategory, FeedbackGetAllOptions, FeedbackGetResponse, FeedbackOptions, FeedbackServiceModel };
|
|
939
|
+
export type { FeedbackCategory, FeedbackCategoryInput, FeedbackCategoryResponse, FeedbackCreateCategoryOptions, FeedbackDeleteCategoryOptions, FeedbackGetAllOptions, FeedbackGetCategoriesOptions, FeedbackGetResponse, FeedbackOptions, FeedbackResponse, FeedbackServiceModel, FeedbackSubmitOptions, FeedbackUpdateOptions };
|