@arizeai/phoenix-client 6.5.1 → 6.5.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/README.md +194 -0
- package/dist/esm/constants/serverRequirements.d.ts +1 -0
- package/dist/esm/constants/serverRequirements.d.ts.map +1 -1
- package/dist/esm/constants/serverRequirements.js +7 -0
- package/dist/esm/constants/serverRequirements.js.map +1 -1
- package/dist/esm/traces/getTraces.d.ts +78 -0
- package/dist/esm/traces/getTraces.d.ts.map +1 -0
- package/dist/esm/traces/getTraces.js +96 -0
- package/dist/esm/traces/getTraces.js.map +1 -0
- package/dist/esm/traces/index.d.ts +2 -0
- package/dist/esm/traces/index.d.ts.map +1 -0
- package/dist/esm/traces/index.js +2 -0
- package/dist/esm/traces/index.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/src/constants/serverRequirements.d.ts +1 -0
- package/dist/src/constants/serverRequirements.d.ts.map +1 -1
- package/dist/src/constants/serverRequirements.js +8 -1
- package/dist/src/constants/serverRequirements.js.map +1 -1
- package/dist/src/traces/getTraces.d.ts +78 -0
- package/dist/src/traces/getTraces.d.ts.map +1 -0
- package/dist/src/traces/getTraces.js +100 -0
- package/dist/src/traces/getTraces.js.map +1 -0
- package/dist/src/traces/index.d.ts +2 -0
- package/dist/src/traces/index.d.ts.map +1 -0
- package/dist/src/traces/index.js +18 -0
- package/dist/src/traces/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -1
- package/src/constants/serverRequirements.ts +8 -0
- package/src/traces/getTraces.ts +156 -0
- package/src/traces/index.ts +1 -0
|
@@ -19,6 +19,7 @@ export declare const LIST_PROJECT_SESSIONS: RouteRequirement;
|
|
|
19
19
|
export declare const ANNOTATE_SESSIONS: RouteRequirement;
|
|
20
20
|
export declare const GET_SPANS_TRACE_IDS: ParameterRequirement;
|
|
21
21
|
export declare const GET_SPANS_FILTERS: ParameterRequirement;
|
|
22
|
+
export declare const LIST_PROJECT_TRACES: RouteRequirement;
|
|
22
23
|
/**
|
|
23
24
|
* Aggregate list of every known capability requirement.
|
|
24
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverRequirements.d.ts","sourceRoot":"","sources":["../../../src/constants/serverRequirements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,gBAKzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAK5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,gBAK7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,gBAKnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAK/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,oBAMjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,oBAM/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,qBAAqB,
|
|
1
|
+
{"version":3,"file":"serverRequirements.d.ts","sourceRoot":"","sources":["../../../src/constants/serverRequirements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,gBAKzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAK5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,gBAK7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,gBAKnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAK/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,oBAMjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,oBAM/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,gBAKjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,qBAAqB,EASnD,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* function that uses it.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.ALL_REQUIREMENTS = exports.GET_SPANS_FILTERS = exports.GET_SPANS_TRACE_IDS = exports.ANNOTATE_SESSIONS = exports.LIST_PROJECT_SESSIONS = exports.DELETE_SESSIONS = exports.DELETE_SESSION = exports.GET_SESSION = void 0;
|
|
16
|
+
exports.ALL_REQUIREMENTS = exports.LIST_PROJECT_TRACES = exports.GET_SPANS_FILTERS = exports.GET_SPANS_TRACE_IDS = exports.ANNOTATE_SESSIONS = exports.LIST_PROJECT_SESSIONS = exports.DELETE_SESSIONS = exports.DELETE_SESSION = exports.GET_SESSION = void 0;
|
|
17
17
|
exports.GET_SESSION = {
|
|
18
18
|
kind: "route",
|
|
19
19
|
method: "GET",
|
|
@@ -58,6 +58,12 @@ exports.GET_SPANS_FILTERS = {
|
|
|
58
58
|
route: "GET /v1/projects/{id}/spans",
|
|
59
59
|
minServerVersion: [13, 15, 0],
|
|
60
60
|
};
|
|
61
|
+
exports.LIST_PROJECT_TRACES = {
|
|
62
|
+
kind: "route",
|
|
63
|
+
method: "GET",
|
|
64
|
+
path: "/v1/projects/{project_identifier}/traces",
|
|
65
|
+
minServerVersion: [13, 15, 0],
|
|
66
|
+
};
|
|
61
67
|
/**
|
|
62
68
|
* Aggregate list of every known capability requirement.
|
|
63
69
|
*
|
|
@@ -72,5 +78,6 @@ exports.ALL_REQUIREMENTS = [
|
|
|
72
78
|
exports.ANNOTATE_SESSIONS,
|
|
73
79
|
exports.GET_SPANS_TRACE_IDS,
|
|
74
80
|
exports.GET_SPANS_FILTERS,
|
|
81
|
+
exports.LIST_PROJECT_TRACES,
|
|
75
82
|
];
|
|
76
83
|
//# sourceMappingURL=serverRequirements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverRequirements.js","sourceRoot":"","sources":["../../../src/constants/serverRequirements.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAQU,QAAA,WAAW,GAAqB;IAC3C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,cAAc,GAAqB;IAC9C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,2BAA2B;IACjC,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEW,QAAA,eAAe,GAAqB;IAC/C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,qBAAqB;IAC3B,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEW,QAAA,qBAAqB,GAAqB;IACrD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oCAAoC;IAC1C,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,iBAAiB,GAAqB;IACjD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,yBAAyB;IAC/B,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,mBAAmB,GAAyB;IACvD,IAAI,EAAE,WAAW;IACjB,aAAa,EAAE,UAAU;IACzB,iBAAiB,EAAE,OAAO;IAC1B,KAAK,EAAE,6BAA6B;IACpC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,iBAAiB,GAAyB;IACrD,IAAI,EAAE,WAAW;IACjB,aAAa,EAAE,WAAW;IAC1B,iBAAiB,EAAE,OAAO;IAC1B,KAAK,EAAE,6BAA6B;IACpC,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACU,QAAA,gBAAgB,GAAqC;IAChE,mBAAW;IACX,sBAAc;IACd,uBAAe;IACf,6BAAqB;IACrB,yBAAiB;IACjB,2BAAmB;IACnB,yBAAiB;
|
|
1
|
+
{"version":3,"file":"serverRequirements.js","sourceRoot":"","sources":["../../../src/constants/serverRequirements.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAQU,QAAA,WAAW,GAAqB;IAC3C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,cAAc,GAAqB;IAC9C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,2BAA2B;IACjC,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEW,QAAA,eAAe,GAAqB;IAC/C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,qBAAqB;IAC3B,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEW,QAAA,qBAAqB,GAAqB;IACrD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oCAAoC;IAC1C,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,iBAAiB,GAAqB;IACjD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,yBAAyB;IAC/B,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,mBAAmB,GAAyB;IACvD,IAAI,EAAE,WAAW;IACjB,aAAa,EAAE,UAAU;IACzB,iBAAiB,EAAE,OAAO;IAC1B,KAAK,EAAE,6BAA6B;IACpC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEW,QAAA,iBAAiB,GAAyB;IACrD,IAAI,EAAE,WAAW;IACjB,aAAa,EAAE,WAAW;IAC1B,iBAAiB,EAAE,OAAO;IAC1B,KAAK,EAAE,6BAA6B;IACpC,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEW,QAAA,mBAAmB,GAAqB;IACnD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,0CAA0C;IAChD,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACU,QAAA,gBAAgB,GAAqC;IAChE,mBAAW;IACX,sBAAc;IACd,uBAAe;IACf,6BAAqB;IACrB,yBAAiB;IACjB,2BAAmB;IACnB,yBAAiB;IACjB,2BAAmB;CACX,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { operations } from "../__generated__/api/v1";
|
|
2
|
+
import type { ClientFn } from "../types/core";
|
|
3
|
+
import type { ProjectIdentifier } from "../types/projects";
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for getting traces from a project.
|
|
6
|
+
*/
|
|
7
|
+
export interface GetTracesParams extends ClientFn {
|
|
8
|
+
/** The project to get traces from */
|
|
9
|
+
project: ProjectIdentifier;
|
|
10
|
+
/** Inclusive lower bound time. Must be a valid ISO 8601 string or Date object. */
|
|
11
|
+
startTime?: Date | string | null;
|
|
12
|
+
/** Exclusive upper bound time. Must be a valid ISO 8601 string or Date object. */
|
|
13
|
+
endTime?: Date | string | null;
|
|
14
|
+
/** Sort field */
|
|
15
|
+
sort?: "start_time" | "latency_ms";
|
|
16
|
+
/** Sort direction */
|
|
17
|
+
order?: "asc" | "desc";
|
|
18
|
+
/** Maximum number of traces to return */
|
|
19
|
+
limit?: number;
|
|
20
|
+
/** Pagination cursor (Trace GlobalID) */
|
|
21
|
+
cursor?: string | null;
|
|
22
|
+
/** If true, include full span details for each trace */
|
|
23
|
+
includeSpans?: boolean;
|
|
24
|
+
/** Filter traces by session identifier(s) (session_id strings or GlobalIDs) */
|
|
25
|
+
sessionId?: string | string[] | null;
|
|
26
|
+
}
|
|
27
|
+
export type GetTracesResponse = operations["listProjectTraces"]["responses"]["200"];
|
|
28
|
+
export type GetTracesResult = {
|
|
29
|
+
traces: GetTracesResponse["content"]["application/json"]["data"];
|
|
30
|
+
nextCursor: GetTracesResponse["content"]["application/json"]["next_cursor"];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Get traces from a project with filtering and sorting options.
|
|
34
|
+
*
|
|
35
|
+
* This method fetches traces from a project with support for time range filtering,
|
|
36
|
+
* sorting, session filtering, and cursor-based pagination.
|
|
37
|
+
*
|
|
38
|
+
* @requires Phoenix server >= 13.15.0
|
|
39
|
+
*
|
|
40
|
+
* @param params - The parameters to get traces
|
|
41
|
+
* @returns A paginated response containing traces and optional next cursor
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* // Get recent traces from a project
|
|
46
|
+
* const result = await getTraces({
|
|
47
|
+
* client,
|
|
48
|
+
* project: { projectName: "my-project" },
|
|
49
|
+
* limit: 50,
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* // Get traces in a time range with spans included
|
|
53
|
+
* const result = await getTraces({
|
|
54
|
+
* client,
|
|
55
|
+
* project: { projectName: "my-project" },
|
|
56
|
+
* startTime: new Date("2024-01-01"),
|
|
57
|
+
* endTime: new Date("2024-01-02"),
|
|
58
|
+
* includeSpans: true,
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // Paginate through results
|
|
62
|
+
* let cursor: string | undefined;
|
|
63
|
+
* do {
|
|
64
|
+
* const result = await getTraces({
|
|
65
|
+
* client,
|
|
66
|
+
* project: { projectName: "my-project" },
|
|
67
|
+
* cursor,
|
|
68
|
+
* limit: 100,
|
|
69
|
+
* });
|
|
70
|
+
* result.traces.forEach(trace => {
|
|
71
|
+
* console.log(`Trace: ${trace.trace_id}`);
|
|
72
|
+
* });
|
|
73
|
+
* cursor = result.nextCursor || undefined;
|
|
74
|
+
* } while (cursor);
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function getTraces({ client: _client, project, cursor, limit, startTime, endTime, sort, order, includeSpans, sessionId, }: GetTracesParams): Promise<GetTracesResult>;
|
|
78
|
+
//# sourceMappingURL=getTraces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTraces.d.ts","sourceRoot":"","sources":["../../../src/traces/getTraces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,qCAAqC;IACrC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,kFAAkF;IAClF,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,kFAAkF;IAClF,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB;IACjB,IAAI,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACnC,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,MAAM,iBAAiB,GAC3B,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;IACjE,UAAU,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,aAAa,CAAC,CAAC;CAC7E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,SAAS,CAAC,EAC9B,MAAM,EAAE,OAAO,EACf,OAAO,EACP,MAAM,EACN,KAAW,EACX,SAAS,EACT,OAAO,EACP,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,SAAS,GACV,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA2D5C"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTraces = getTraces;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
const serverRequirements_1 = require("../constants/serverRequirements");
|
|
6
|
+
const projects_1 = require("../types/projects");
|
|
7
|
+
const serverVersionUtils_1 = require("../utils/serverVersionUtils");
|
|
8
|
+
/**
|
|
9
|
+
* Get traces from a project with filtering and sorting options.
|
|
10
|
+
*
|
|
11
|
+
* This method fetches traces from a project with support for time range filtering,
|
|
12
|
+
* sorting, session filtering, and cursor-based pagination.
|
|
13
|
+
*
|
|
14
|
+
* @requires Phoenix server >= 13.15.0
|
|
15
|
+
*
|
|
16
|
+
* @param params - The parameters to get traces
|
|
17
|
+
* @returns A paginated response containing traces and optional next cursor
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* // Get recent traces from a project
|
|
22
|
+
* const result = await getTraces({
|
|
23
|
+
* client,
|
|
24
|
+
* project: { projectName: "my-project" },
|
|
25
|
+
* limit: 50,
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Get traces in a time range with spans included
|
|
29
|
+
* const result = await getTraces({
|
|
30
|
+
* client,
|
|
31
|
+
* project: { projectName: "my-project" },
|
|
32
|
+
* startTime: new Date("2024-01-01"),
|
|
33
|
+
* endTime: new Date("2024-01-02"),
|
|
34
|
+
* includeSpans: true,
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Paginate through results
|
|
38
|
+
* let cursor: string | undefined;
|
|
39
|
+
* do {
|
|
40
|
+
* const result = await getTraces({
|
|
41
|
+
* client,
|
|
42
|
+
* project: { projectName: "my-project" },
|
|
43
|
+
* cursor,
|
|
44
|
+
* limit: 100,
|
|
45
|
+
* });
|
|
46
|
+
* result.traces.forEach(trace => {
|
|
47
|
+
* console.log(`Trace: ${trace.trace_id}`);
|
|
48
|
+
* });
|
|
49
|
+
* cursor = result.nextCursor || undefined;
|
|
50
|
+
* } while (cursor);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
async function getTraces({ client: _client, project, cursor, limit = 100, startTime, endTime, sort, order, includeSpans, sessionId, }) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const client = _client !== null && _client !== void 0 ? _client : (0, client_1.createClient)();
|
|
56
|
+
await (0, serverVersionUtils_1.ensureServerCapability)({ client, requirement: serverRequirements_1.LIST_PROJECT_TRACES });
|
|
57
|
+
const projectIdentifier = (0, projects_1.resolveProjectIdentifier)(project);
|
|
58
|
+
const params = {
|
|
59
|
+
limit,
|
|
60
|
+
};
|
|
61
|
+
if (cursor) {
|
|
62
|
+
params.cursor = cursor;
|
|
63
|
+
}
|
|
64
|
+
if (startTime) {
|
|
65
|
+
params.start_time =
|
|
66
|
+
startTime instanceof Date ? startTime.toISOString() : startTime;
|
|
67
|
+
}
|
|
68
|
+
if (endTime) {
|
|
69
|
+
params.end_time = endTime instanceof Date ? endTime.toISOString() : endTime;
|
|
70
|
+
}
|
|
71
|
+
if (sort) {
|
|
72
|
+
params.sort = sort;
|
|
73
|
+
}
|
|
74
|
+
if (order) {
|
|
75
|
+
params.order = order;
|
|
76
|
+
}
|
|
77
|
+
if (includeSpans) {
|
|
78
|
+
params.include_spans = true;
|
|
79
|
+
}
|
|
80
|
+
if (sessionId) {
|
|
81
|
+
params.session_identifier = Array.isArray(sessionId)
|
|
82
|
+
? sessionId
|
|
83
|
+
: [sessionId];
|
|
84
|
+
}
|
|
85
|
+
const { data, error } = await client.GET("/v1/projects/{project_identifier}/traces", {
|
|
86
|
+
params: {
|
|
87
|
+
path: {
|
|
88
|
+
project_identifier: projectIdentifier,
|
|
89
|
+
},
|
|
90
|
+
query: params,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
if (error)
|
|
94
|
+
throw error;
|
|
95
|
+
return {
|
|
96
|
+
traces: (_a = data === null || data === void 0 ? void 0 : data.data) !== null && _a !== void 0 ? _a : [],
|
|
97
|
+
nextCursor: (_b = data === null || data === void 0 ? void 0 : data.next_cursor) !== null && _b !== void 0 ? _b : null,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=getTraces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTraces.js","sourceRoot":"","sources":["../../../src/traces/getTraces.ts"],"names":[],"mappings":";;AAqFA,8BAsEC;AA1JD,sCAAyC;AACzC,wEAAsE;AAGtE,gDAA6D;AAC7D,oEAAqE;AAkCrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACI,KAAK,UAAU,SAAS,CAAC,EAC9B,MAAM,EAAE,OAAO,EACf,OAAO,EACP,MAAM,EACN,KAAK,GAAG,GAAG,EACX,SAAS,EACT,OAAO,EACP,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,SAAS,GACO;;IAChB,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAA,qBAAY,GAAE,CAAC;IACzC,MAAM,IAAA,2CAAsB,EAAC,EAAE,MAAM,EAAE,WAAW,EAAE,wCAAmB,EAAE,CAAC,CAAC;IAC3E,MAAM,iBAAiB,GAAG,IAAA,mCAAwB,EAAC,OAAO,CAAC,CAAC;IAE5D,MAAM,MAAM,GAER;QACF,KAAK;KACN,CAAC;IAEF,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,CAAC,UAAU;YACf,SAAS,YAAY,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,CAAC,QAAQ,GAAG,OAAO,YAAY,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAC9E,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YAClD,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CACtC,0CAA0C,EAC1C;QACE,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,kBAAkB,EAAE,iBAAiB;aACtC;YACD,KAAK,EAAE,MAAM;SACd;KACF,CACF,CAAC;IAEF,IAAI,KAAK;QAAE,MAAM,KAAK,CAAC;IACvB,OAAO;QACL,MAAM,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,mCAAI,EAAE;QACxB,UAAU,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,IAAI;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/traces/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getTraces"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/traces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
|