@uipath/uipath-typescript 1.4.0 → 1.4.2
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/agent-memory/index.cjs +16 -9
- package/dist/agent-memory/index.mjs +16 -9
- package/dist/agents/index.cjs +278 -9
- package/dist/agents/index.d.ts +465 -6
- package/dist/agents/index.mjs +279 -10
- package/dist/assets/index.cjs +16 -9
- package/dist/assets/index.mjs +16 -9
- package/dist/attachments/index.cjs +16 -9
- package/dist/attachments/index.mjs +16 -9
- package/dist/buckets/index.cjs +114 -124
- package/dist/buckets/index.d.ts +197 -84
- package/dist/buckets/index.mjs +114 -124
- package/dist/cases/index.cjs +79 -13
- package/dist/cases/index.d.ts +30 -3
- package/dist/cases/index.mjs +79 -13
- package/dist/conversational-agent/index.cjs +16 -9
- package/dist/conversational-agent/index.mjs +16 -9
- package/dist/core/index.cjs +35 -6
- package/dist/core/index.mjs +35 -6
- package/dist/document-understanding/index.cjs +84 -84
- package/dist/document-understanding/index.d.ts +2 -1
- package/dist/document-understanding/index.mjs +1 -1
- package/dist/entities/index.cjs +253 -69
- package/dist/entities/index.d.ts +343 -116
- package/dist/entities/index.mjs +253 -69
- package/dist/feedback/index.cjs +16 -9
- package/dist/feedback/index.mjs +16 -9
- package/dist/governance/index.cjs +16 -9
- package/dist/governance/index.mjs +16 -9
- package/dist/index.cjs +529 -193
- package/dist/index.d.ts +2141 -750
- package/dist/index.mjs +529 -194
- package/dist/index.umd.js +529 -193
- package/dist/jobs/index.cjs +16 -9
- package/dist/jobs/index.mjs +16 -9
- package/dist/maestro-processes/index.cjs +16 -9
- package/dist/maestro-processes/index.mjs +16 -9
- package/dist/orchestrator-du-module/index.cjs +1788 -0
- package/dist/orchestrator-du-module/index.d.ts +757 -0
- package/dist/orchestrator-du-module/index.mjs +1785 -0
- package/dist/processes/index.cjs +16 -9
- package/dist/processes/index.mjs +16 -9
- package/dist/queues/index.cjs +16 -9
- package/dist/queues/index.mjs +16 -9
- package/dist/tasks/index.cjs +79 -13
- package/dist/tasks/index.d.ts +109 -4
- package/dist/tasks/index.mjs +80 -14
- package/dist/traces/index.cjs +303 -9
- package/dist/traces/index.d.ts +482 -2
- package/dist/traces/index.mjs +302 -10
- package/package.json +11 -1
package/dist/traces/index.d.ts
CHANGED
|
@@ -49,6 +49,24 @@ interface PaginatedResponse<T> {
|
|
|
49
49
|
/** Whether this pagination type supports jumping to arbitrary pages */
|
|
50
50
|
supportsPageJump: boolean;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Response for non-paginated calls that includes both data and total count
|
|
54
|
+
*/
|
|
55
|
+
interface NonPaginatedResponse<T> {
|
|
56
|
+
items: T[];
|
|
57
|
+
totalCount?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Helper type for defining paginated method overloads
|
|
61
|
+
* Creates a union type of all ways pagination can be triggered
|
|
62
|
+
*/
|
|
63
|
+
type HasPaginationOptions<T> = (T & {
|
|
64
|
+
pageSize: number;
|
|
65
|
+
}) | (T & {
|
|
66
|
+
cursor: PaginationCursor;
|
|
67
|
+
}) | (T & {
|
|
68
|
+
jumpToPage: number;
|
|
69
|
+
});
|
|
52
70
|
|
|
53
71
|
/**
|
|
54
72
|
* Pagination types supported by the SDK
|
|
@@ -562,5 +580,467 @@ declare class TracesService extends BaseService implements TracesServiceModel {
|
|
|
562
580
|
getSpansByIds(traceId: string, spanIds: string[]): Promise<SpanGetResponse[]>;
|
|
563
581
|
}
|
|
564
582
|
|
|
565
|
-
|
|
566
|
-
|
|
583
|
+
/**
|
|
584
|
+
* Filter fields shared by the trace-level agent endpoints
|
|
585
|
+
*/
|
|
586
|
+
interface AgentTraceFilterOptions {
|
|
587
|
+
/** Inclusive lower bound for the query window. Omit to use the server default (1 year ago). */
|
|
588
|
+
startTime?: Date;
|
|
589
|
+
/** Exclusive upper bound for the query window. Omit to use the server default (now). */
|
|
590
|
+
endTime?: Date;
|
|
591
|
+
/** Folder keys to scope the query. Intersected with the user's accessible folders. */
|
|
592
|
+
folderKeys?: string[];
|
|
593
|
+
/** Filter to a single agent by ID. */
|
|
594
|
+
agentId?: string;
|
|
595
|
+
/** Filter to a specific agent version. */
|
|
596
|
+
agentVersion?: string;
|
|
597
|
+
/** Filter to a specific execution type. */
|
|
598
|
+
executionType?: SpanExecutionType;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* One point on the trace-level errors timeline — error count for a single
|
|
602
|
+
* (error name, time bucket).
|
|
603
|
+
*/
|
|
604
|
+
interface AgentTraceGetErrorsTimelineResponse {
|
|
605
|
+
/** Error name / category for this time-slice. */
|
|
606
|
+
name: string;
|
|
607
|
+
/** Count of errors in this time bucket for this name. */
|
|
608
|
+
value: number;
|
|
609
|
+
/** Bucket timestamp. */
|
|
610
|
+
date: string;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Options for the trace-level errors timeline.
|
|
614
|
+
*/
|
|
615
|
+
interface AgentTraceGetErrorsTimelineOptions extends AgentTraceFilterOptions {
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* One point on the trace-level latency timeline — a latency value for a single
|
|
619
|
+
* (series, time bucket).
|
|
620
|
+
*/
|
|
621
|
+
interface AgentTraceGetLatencyTimelineResponse {
|
|
622
|
+
/** Series/grouping name for this latency point. */
|
|
623
|
+
name: string;
|
|
624
|
+
/** Latency value in decimal seconds for this series and time bucket. */
|
|
625
|
+
value: number;
|
|
626
|
+
/** Bucket timestamp. */
|
|
627
|
+
date: string;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Options for the trace-level latency timeline.
|
|
631
|
+
*/
|
|
632
|
+
interface AgentTraceGetLatencyTimelineOptions extends AgentTraceFilterOptions {
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Per-agent unit consumption totals over the requested window (trace-level) —
|
|
636
|
+
* a flat per-(agent, version, folder) breakdown of AGU and PLTU consumed.
|
|
637
|
+
*/
|
|
638
|
+
interface AgentTraceGetUnitConsumptionResponse {
|
|
639
|
+
/** Agent ID these totals belong to. */
|
|
640
|
+
agentId: string;
|
|
641
|
+
/** Folder key (GUID) the consumption was recorded in. */
|
|
642
|
+
folderKey: string;
|
|
643
|
+
/** Agent version these totals belong to. */
|
|
644
|
+
agentVersion: string;
|
|
645
|
+
/** Agent units consumed over the window. */
|
|
646
|
+
agentUnitsConsumed: number;
|
|
647
|
+
/** Platform units consumed over the window. */
|
|
648
|
+
platformUnitsConsumed: number;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Options for the trace-level per-agent unit consumption.
|
|
652
|
+
*/
|
|
653
|
+
interface AgentTraceGetUnitConsumptionOptions extends AgentTraceFilterOptions {
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* A single span record from the trace store.
|
|
657
|
+
*/
|
|
658
|
+
interface AgentSpanGetResponse {
|
|
659
|
+
/** Span ID. */
|
|
660
|
+
id: string;
|
|
661
|
+
/** ID of the trace this span belongs to. */
|
|
662
|
+
traceId: string;
|
|
663
|
+
/** Parent span ID. `null` for a root span. */
|
|
664
|
+
parentId: string | null;
|
|
665
|
+
/** Span name. */
|
|
666
|
+
name: string;
|
|
667
|
+
/** Span start time. */
|
|
668
|
+
startTime: string;
|
|
669
|
+
/** Span end time. `null` while the span is in progress. */
|
|
670
|
+
endTime: string | null;
|
|
671
|
+
/** Raw span attributes as a JSON string. */
|
|
672
|
+
attributes: string;
|
|
673
|
+
/** Span status. */
|
|
674
|
+
status: string;
|
|
675
|
+
/** Organization ID (GUID). */
|
|
676
|
+
organizationId: string;
|
|
677
|
+
/** Tenant ID (GUID). May be `null`. */
|
|
678
|
+
tenantId: string | null;
|
|
679
|
+
/** Span retention expiry time. May be `null`. */
|
|
680
|
+
expiredTime: string | null;
|
|
681
|
+
/** Folder key (GUID) the span was recorded in. May be `null`. */
|
|
682
|
+
folderKey: string | null;
|
|
683
|
+
/** Span source. May be `null`. */
|
|
684
|
+
source: string | null;
|
|
685
|
+
/** Span type. May be `null`. */
|
|
686
|
+
spanType: string | null;
|
|
687
|
+
/** Process key (GUID). May be `null`. */
|
|
688
|
+
processKey: string | null;
|
|
689
|
+
/** Job key (GUID). May be `null`. */
|
|
690
|
+
jobKey: string | null;
|
|
691
|
+
/** Reference ID (GUID). May be `null`. */
|
|
692
|
+
referenceId: string | null;
|
|
693
|
+
/** Verbosity level. May be `null`. */
|
|
694
|
+
verbosityLevel: string | null;
|
|
695
|
+
/** Record last-updated time. */
|
|
696
|
+
updatedAt: string;
|
|
697
|
+
/** Whether the span payload is stored as a large payload. */
|
|
698
|
+
isLargePayload: boolean;
|
|
699
|
+
/** Payload compression type. May be `null`. */
|
|
700
|
+
compressionType: string | null;
|
|
701
|
+
/** Agent version that produced the span. May be `null`. */
|
|
702
|
+
agentVersion: string | null;
|
|
703
|
+
/** Raw span context as a JSON string. May be `null`. */
|
|
704
|
+
context: string | null;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Options for the spans-by-reference query.
|
|
708
|
+
*
|
|
709
|
+
* Composes the optional hierarchy/time filters with pagination options.
|
|
710
|
+
*/
|
|
711
|
+
type AgentTraceGetSpansByReferenceOptions = PaginationOptions & {
|
|
712
|
+
/** Optional trace scope — narrows the scan to a single trace. */
|
|
713
|
+
traceId?: string;
|
|
714
|
+
/** Restrict matches to hierarchy entries with this service type. */
|
|
715
|
+
serviceType?: string;
|
|
716
|
+
/** Restrict matches to hierarchy entries with this version. */
|
|
717
|
+
version?: string;
|
|
718
|
+
/** Inclusive lower bound on span start time. */
|
|
719
|
+
startTime?: Date;
|
|
720
|
+
/** Exclusive upper bound on span end time. */
|
|
721
|
+
endTime?: Date;
|
|
722
|
+
/** Execution type filter */
|
|
723
|
+
executionType?: SpanExecutionType;
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Service for retrieving UiPath Agent trace metrics.
|
|
728
|
+
*/
|
|
729
|
+
interface AgentTracesServiceModel {
|
|
730
|
+
/**
|
|
731
|
+
* Retrieves a trace-level time-series of error counts grouped by error name.
|
|
732
|
+
*
|
|
733
|
+
* @param options - Optional window and filters
|
|
734
|
+
* @returns Promise resolving to an array of {@link AgentTraceGetErrorsTimelineResponse}
|
|
735
|
+
* @example
|
|
736
|
+
* ```typescript
|
|
737
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
738
|
+
*
|
|
739
|
+
* const trace = new AgentTraces(sdk);
|
|
740
|
+
*
|
|
741
|
+
* // Get the errors timeline
|
|
742
|
+
* const result = await trace.getErrorsTimeline();
|
|
743
|
+
* result.forEach((point) => {
|
|
744
|
+
* console.log(`${point.date} ${point.name}: ${point.value} errors`);
|
|
745
|
+
* });
|
|
746
|
+
* ```
|
|
747
|
+
* @example
|
|
748
|
+
* ```typescript
|
|
749
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
750
|
+
*
|
|
751
|
+
* // Get the errors timeline for an agent version within a time window
|
|
752
|
+
* const filtered = await trace.getErrorsTimeline({
|
|
753
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
754
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
755
|
+
* agentId: '<agentId>',
|
|
756
|
+
* agentVersion: '1.0.0',
|
|
757
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
758
|
+
* });
|
|
759
|
+
* ```
|
|
760
|
+
*/
|
|
761
|
+
getErrorsTimeline(options?: AgentTraceGetErrorsTimelineOptions): Promise<AgentTraceGetErrorsTimelineResponse[]>;
|
|
762
|
+
/**
|
|
763
|
+
* Retrieves a trace-level time-series of latency.
|
|
764
|
+
*
|
|
765
|
+
* @param options - Optional window and filters
|
|
766
|
+
* @returns Promise resolving to an array of {@link AgentTraceGetLatencyTimelineResponse}
|
|
767
|
+
* @example
|
|
768
|
+
* ```typescript
|
|
769
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
770
|
+
*
|
|
771
|
+
* const trace = new AgentTraces(sdk);
|
|
772
|
+
*
|
|
773
|
+
* // Get the latency timeline
|
|
774
|
+
* const result = await trace.getLatencyTimeline();
|
|
775
|
+
* result.forEach((point) => {
|
|
776
|
+
* console.log(`${point.date} ${point.name}: ${point.value}s`);
|
|
777
|
+
* });
|
|
778
|
+
* ```
|
|
779
|
+
* @example
|
|
780
|
+
* ```typescript
|
|
781
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
782
|
+
*
|
|
783
|
+
* // Get the latency timeline for an agent version within a time window
|
|
784
|
+
* const filtered = await trace.getLatencyTimeline({
|
|
785
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
786
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
787
|
+
* agentId: '<agentId>',
|
|
788
|
+
* agentVersion: '1.0.0',
|
|
789
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
790
|
+
* });
|
|
791
|
+
* ```
|
|
792
|
+
*/
|
|
793
|
+
getLatencyTimeline(options?: AgentTraceGetLatencyTimelineOptions): Promise<AgentTraceGetLatencyTimelineResponse[]>;
|
|
794
|
+
/**
|
|
795
|
+
* Retrieves trace-level per-agent unit consumption totals.
|
|
796
|
+
*
|
|
797
|
+
* @param options - Optional window and filters
|
|
798
|
+
* @returns Promise resolving to an array of {@link AgentTraceGetUnitConsumptionResponse}
|
|
799
|
+
* @example
|
|
800
|
+
* ```typescript
|
|
801
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
802
|
+
*
|
|
803
|
+
* const trace = new AgentTraces(sdk);
|
|
804
|
+
*
|
|
805
|
+
* // Get per-agent unit consumption
|
|
806
|
+
* const result = await trace.getUnitConsumption();
|
|
807
|
+
* result.forEach((row) => {
|
|
808
|
+
* console.log(`${row.agentId}: ${row.agentUnitsConsumed} AGU, ${row.platformUnitsConsumed} PLTU`);
|
|
809
|
+
* });
|
|
810
|
+
* ```
|
|
811
|
+
* @example
|
|
812
|
+
* ```typescript
|
|
813
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
814
|
+
*
|
|
815
|
+
* // Get per-agent unit consumption for an agent version within a time window
|
|
816
|
+
* const filtered = await trace.getUnitConsumption({
|
|
817
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
818
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
819
|
+
* agentId: '<agentId>',
|
|
820
|
+
* agentVersion: '1.0.0',
|
|
821
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
822
|
+
* });
|
|
823
|
+
* ```
|
|
824
|
+
*/
|
|
825
|
+
getUnitConsumption(options?: AgentTraceGetUnitConsumptionOptions): Promise<AgentTraceGetUnitConsumptionResponse[]>;
|
|
826
|
+
/**
|
|
827
|
+
* Retrieves every span belonging to a single trace.
|
|
828
|
+
*
|
|
829
|
+
* @param traceId - Identifier of the trace whose spans should be returned
|
|
830
|
+
* @returns Promise resolving to an array of {@link AgentSpanGetResponse}
|
|
831
|
+
* @example
|
|
832
|
+
* ```typescript
|
|
833
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
834
|
+
*
|
|
835
|
+
* const trace = new AgentTraces(sdk);
|
|
836
|
+
*
|
|
837
|
+
* const spans = await trace.getSpansByTraceId('<traceId>');
|
|
838
|
+
* spans.forEach((span) => {
|
|
839
|
+
* console.log(`${span.name} (${span.startTime} → ${span.endTime ?? 'in progress'})`);
|
|
840
|
+
* });
|
|
841
|
+
* ```
|
|
842
|
+
*/
|
|
843
|
+
getSpansByTraceId(traceId: string): Promise<AgentSpanGetResponse[]>;
|
|
844
|
+
/**
|
|
845
|
+
* Retrieves spans whose reference hierarchy contains the given reference id.
|
|
846
|
+
*
|
|
847
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
848
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
849
|
+
* {@link NonPaginatedResponse}.
|
|
850
|
+
*
|
|
851
|
+
* @param referenceId - Reference id matched against each span's reference hierarchy
|
|
852
|
+
* @param options - Optional pagination and hierarchy/time filters
|
|
853
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentSpanGetResponse}
|
|
854
|
+
* @example
|
|
855
|
+
* ```typescript
|
|
856
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
857
|
+
*
|
|
858
|
+
* const trace = new AgentTraces(sdk);
|
|
859
|
+
*
|
|
860
|
+
* // Get spans by referenceId
|
|
861
|
+
* const result = await trace.getSpansByReference('<referenceId>');
|
|
862
|
+
* result.items.forEach((span) => console.log(span.name));
|
|
863
|
+
* ```
|
|
864
|
+
* @example
|
|
865
|
+
* ```typescript
|
|
866
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
867
|
+
*
|
|
868
|
+
* // Get spans by referenceId within a trace and time window
|
|
869
|
+
* const page = await trace.getSpansByReference('<referenceId>', {
|
|
870
|
+
* traceId: '<traceId>',
|
|
871
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
872
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
873
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
874
|
+
* pageSize: 25,
|
|
875
|
+
* });
|
|
876
|
+
*
|
|
877
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
878
|
+
* const next = await trace.getSpansByReference('<referenceId>', { cursor: page.nextCursor });
|
|
879
|
+
* }
|
|
880
|
+
* ```
|
|
881
|
+
*/
|
|
882
|
+
getSpansByReference<T extends AgentTraceGetSpansByReferenceOptions = AgentTraceGetSpansByReferenceOptions>(referenceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentSpanGetResponse> : NonPaginatedResponse<AgentSpanGetResponse>>;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Service for retrieving UiPath Agent trace metrics.
|
|
887
|
+
*/
|
|
888
|
+
declare class AgentTracesService extends BaseService implements AgentTracesServiceModel {
|
|
889
|
+
/**
|
|
890
|
+
* Retrieves a trace-level time-series of error counts grouped by error name.
|
|
891
|
+
*
|
|
892
|
+
* @param options - Optional window and filters
|
|
893
|
+
* @returns Promise resolving to an array of {@link AgentTraceGetErrorsTimelineResponse}
|
|
894
|
+
* @example
|
|
895
|
+
* ```typescript
|
|
896
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
897
|
+
*
|
|
898
|
+
* const trace = new AgentTraces(sdk);
|
|
899
|
+
*
|
|
900
|
+
* // Get the errors timeline
|
|
901
|
+
* const result = await trace.getErrorsTimeline();
|
|
902
|
+
* result.forEach((point) => {
|
|
903
|
+
* console.log(`${point.date} ${point.name}: ${point.value} errors`);
|
|
904
|
+
* });
|
|
905
|
+
* ```
|
|
906
|
+
* @example
|
|
907
|
+
* ```typescript
|
|
908
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
909
|
+
*
|
|
910
|
+
* // Get the errors timeline for an agent version within a time window
|
|
911
|
+
* const filtered = await trace.getErrorsTimeline({
|
|
912
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
913
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
914
|
+
* agentId: '<agentId>',
|
|
915
|
+
* agentVersion: '1.0.0',
|
|
916
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
917
|
+
* });
|
|
918
|
+
* ```
|
|
919
|
+
*/
|
|
920
|
+
getErrorsTimeline(options?: AgentTraceGetErrorsTimelineOptions): Promise<AgentTraceGetErrorsTimelineResponse[]>;
|
|
921
|
+
/**
|
|
922
|
+
* Retrieves a trace-level time-series of latency.
|
|
923
|
+
*
|
|
924
|
+
* @param options - Optional window and filters
|
|
925
|
+
* @returns Promise resolving to an array of {@link AgentTraceGetLatencyTimelineResponse}
|
|
926
|
+
* @example
|
|
927
|
+
* ```typescript
|
|
928
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
929
|
+
*
|
|
930
|
+
* const trace = new AgentTraces(sdk);
|
|
931
|
+
*
|
|
932
|
+
* // Get the latency timeline
|
|
933
|
+
* const result = await trace.getLatencyTimeline();
|
|
934
|
+
* result.forEach((point) => {
|
|
935
|
+
* console.log(`${point.date} ${point.name}: ${point.value}s`);
|
|
936
|
+
* });
|
|
937
|
+
* ```
|
|
938
|
+
* @example
|
|
939
|
+
* ```typescript
|
|
940
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
941
|
+
*
|
|
942
|
+
* // Get the latency timeline for an agent version within a time window
|
|
943
|
+
* const filtered = await trace.getLatencyTimeline({
|
|
944
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
945
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
946
|
+
* agentId: '<agentId>',
|
|
947
|
+
* agentVersion: '1.0.0',
|
|
948
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
949
|
+
* });
|
|
950
|
+
* ```
|
|
951
|
+
*/
|
|
952
|
+
getLatencyTimeline(options?: AgentTraceGetLatencyTimelineOptions): Promise<AgentTraceGetLatencyTimelineResponse[]>;
|
|
953
|
+
/**
|
|
954
|
+
* Retrieves trace-level per-agent unit consumption totals.
|
|
955
|
+
*
|
|
956
|
+
* @param options - Optional window and filters
|
|
957
|
+
* @returns Promise resolving to an array of {@link AgentTraceGetUnitConsumptionResponse}
|
|
958
|
+
* @example
|
|
959
|
+
* ```typescript
|
|
960
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
961
|
+
*
|
|
962
|
+
* const trace = new AgentTraces(sdk);
|
|
963
|
+
*
|
|
964
|
+
* // Get per-agent unit consumption
|
|
965
|
+
* const result = await trace.getUnitConsumption();
|
|
966
|
+
* result.forEach((row) => {
|
|
967
|
+
* console.log(`${row.agentId}: ${row.agentUnitsConsumed} AGU, ${row.platformUnitsConsumed} PLTU`);
|
|
968
|
+
* });
|
|
969
|
+
* ```
|
|
970
|
+
* @example
|
|
971
|
+
* ```typescript
|
|
972
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
973
|
+
*
|
|
974
|
+
* // Get per-agent unit consumption for an agent version within a time window
|
|
975
|
+
* const filtered = await trace.getUnitConsumption({
|
|
976
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
977
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
978
|
+
* agentId: '<agentId>',
|
|
979
|
+
* agentVersion: '1.0.0',
|
|
980
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
981
|
+
* });
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
getUnitConsumption(options?: AgentTraceGetUnitConsumptionOptions): Promise<AgentTraceGetUnitConsumptionResponse[]>;
|
|
985
|
+
/**
|
|
986
|
+
* Retrieves every span belonging to a single trace.
|
|
987
|
+
*
|
|
988
|
+
* @param traceId - Identifier of the trace whose spans should be returned
|
|
989
|
+
* @returns Promise resolving to an array of {@link AgentSpanGetResponse}
|
|
990
|
+
* @example
|
|
991
|
+
* ```typescript
|
|
992
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
993
|
+
*
|
|
994
|
+
* const trace = new AgentTraces(sdk);
|
|
995
|
+
*
|
|
996
|
+
* const spans = await trace.getSpansByTraceId('<traceId>');
|
|
997
|
+
* spans.forEach((span) => {
|
|
998
|
+
* console.log(`${span.name} (${span.startTime} → ${span.endTime ?? 'in progress'})`);
|
|
999
|
+
* });
|
|
1000
|
+
* ```
|
|
1001
|
+
*/
|
|
1002
|
+
getSpansByTraceId(traceId: string): Promise<AgentSpanGetResponse[]>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Retrieves spans whose reference hierarchy contains the given reference id.
|
|
1005
|
+
*
|
|
1006
|
+
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
1007
|
+
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
1008
|
+
* {@link NonPaginatedResponse}.
|
|
1009
|
+
*
|
|
1010
|
+
* @param referenceId - Reference id matched against each span's reference hierarchy
|
|
1011
|
+
* @param options - Optional pagination and hierarchy/time filters
|
|
1012
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentSpanGetResponse}
|
|
1013
|
+
* @example
|
|
1014
|
+
* ```typescript
|
|
1015
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
1016
|
+
*
|
|
1017
|
+
* const trace = new AgentTraces(sdk);
|
|
1018
|
+
*
|
|
1019
|
+
* // Get spans by referenceId
|
|
1020
|
+
* const result = await trace.getSpansByReference('<referenceId>');
|
|
1021
|
+
* result.items.forEach((span) => console.log(span.name));
|
|
1022
|
+
* ```
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```typescript
|
|
1025
|
+
* import { AgentTraceExecutionType } from '@uipath/uipath-typescript/traces';
|
|
1026
|
+
*
|
|
1027
|
+
* // Get spans by referenceId within a trace and time window
|
|
1028
|
+
* const page = await trace.getSpansByReference('<referenceId>', {
|
|
1029
|
+
* traceId: '<traceId>',
|
|
1030
|
+
* executionType: AgentTraceExecutionType.Runtime,
|
|
1031
|
+
* startTime: new Date('2025-05-01T00:00:00Z'),
|
|
1032
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
1033
|
+
* pageSize: 25,
|
|
1034
|
+
* });
|
|
1035
|
+
*
|
|
1036
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
1037
|
+
* const next = await trace.getSpansByReference('<referenceId>', { cursor: page.nextCursor });
|
|
1038
|
+
* }
|
|
1039
|
+
* ```
|
|
1040
|
+
*/
|
|
1041
|
+
getSpansByReference<T extends AgentTraceGetSpansByReferenceOptions = AgentTraceGetSpansByReferenceOptions>(referenceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentSpanGetResponse> : NonPaginatedResponse<AgentSpanGetResponse>>;
|
|
1042
|
+
private buildTraceFilterBody;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
export { SpanExecutionType as AgentTraceExecutionType, AgentTracesService as AgentTraces, SpanAttachmentDirection, SpanAttachmentProvider, SpanExecutionType, SpanPermissionStatus, SpanSource, SpanStatus, SpanVerbosityLevel, TracesService as Traces };
|
|
1046
|
+
export type { AgentSpanGetResponse, AgentTraceFilterOptions, AgentTraceGetErrorsTimelineOptions, AgentTraceGetErrorsTimelineResponse, AgentTraceGetLatencyTimelineOptions, AgentTraceGetLatencyTimelineResponse, AgentTraceGetSpansByReferenceOptions, AgentTraceGetUnitConsumptionOptions, AgentTraceGetUnitConsumptionResponse, AgentTracesServiceModel, SpanAttachment, SpanContext, SpanGetResponse, SpanReferenceHierarchyEntry, TracesGetByIdOptions, TracesServiceModel };
|