@arizeai/phoenix-client 7.5.0 → 7.7.0
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/CHANGELOG.md +781 -0
- package/README.md +27 -3
- package/dist/esm/__generated__/api/v1.d.ts +749 -203
- package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
- package/dist/esm/constants/serverRequirements.d.ts +2 -0
- package/dist/esm/constants/serverRequirements.d.ts.map +1 -1
- package/dist/esm/constants/serverRequirements.js +14 -0
- package/dist/esm/constants/serverRequirements.js.map +1 -1
- package/dist/esm/projects/index.d.ts +1 -0
- package/dist/esm/projects/index.d.ts.map +1 -1
- package/dist/esm/projects/index.js +1 -0
- package/dist/esm/projects/index.js.map +1 -1
- package/dist/esm/projects/setProjectRetentionPolicy.d.ts +49 -0
- package/dist/esm/projects/setProjectRetentionPolicy.d.ts.map +1 -0
- package/dist/esm/projects/setProjectRetentionPolicy.js +52 -0
- package/dist/esm/projects/setProjectRetentionPolicy.js.map +1 -0
- package/dist/esm/prompts/deletePrompt.d.ts +39 -0
- package/dist/esm/prompts/deletePrompt.d.ts.map +1 -0
- package/dist/esm/prompts/deletePrompt.js +52 -0
- package/dist/esm/prompts/deletePrompt.js.map +1 -0
- package/dist/esm/prompts/index.d.ts +1 -0
- package/dist/esm/prompts/index.d.ts.map +1 -1
- package/dist/esm/prompts/index.js +1 -0
- package/dist/esm/prompts/index.js.map +1 -1
- package/dist/esm/testing/reporter-format.d.ts.map +1 -1
- package/dist/esm/testing/reporter-format.js +13 -3
- package/dist/esm/testing/reporter-format.js.map +1 -1
- package/dist/esm/traces/getTraces.d.ts +1 -1
- package/dist/esm/traces/getTraces.d.ts.map +1 -1
- package/dist/esm/traces/index.d.ts +1 -0
- package/dist/esm/traces/index.d.ts.map +1 -1
- package/dist/esm/traces/index.js +1 -0
- package/dist/esm/traces/index.js.map +1 -1
- package/dist/esm/traces/transferTraces.d.ts +56 -0
- package/dist/esm/traces/transferTraces.d.ts.map +1 -0
- package/dist/esm/traces/transferTraces.js +56 -0
- package/dist/esm/traces/transferTraces.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types/prompts.d.ts +9 -0
- package/dist/esm/types/prompts.d.ts.map +1 -1
- package/dist/esm/types/prompts.js.map +1 -1
- package/dist/esm/users/getCurrentUser.d.ts +25 -0
- package/dist/esm/users/getCurrentUser.d.ts.map +1 -0
- package/dist/esm/users/getCurrentUser.js +30 -0
- package/dist/esm/users/getCurrentUser.js.map +1 -0
- package/dist/esm/users/index.d.ts +2 -0
- package/dist/esm/users/index.d.ts.map +1 -0
- package/dist/esm/users/index.js +2 -0
- package/dist/esm/users/index.js.map +1 -0
- package/dist/esm/utils/resolvePromptIdentifier.d.ts +17 -0
- package/dist/esm/utils/resolvePromptIdentifier.d.ts.map +1 -0
- package/dist/esm/utils/resolvePromptIdentifier.js +36 -0
- package/dist/esm/utils/resolvePromptIdentifier.js.map +1 -0
- package/dist/src/__generated__/api/v1.d.ts +749 -203
- package/dist/src/__generated__/api/v1.d.ts.map +1 -1
- package/dist/src/constants/serverRequirements.d.ts +2 -0
- package/dist/src/constants/serverRequirements.d.ts.map +1 -1
- package/dist/src/constants/serverRequirements.js +15 -1
- package/dist/src/constants/serverRequirements.js.map +1 -1
- package/dist/src/projects/index.d.ts +1 -0
- package/dist/src/projects/index.d.ts.map +1 -1
- package/dist/src/projects/index.js +1 -0
- package/dist/src/projects/index.js.map +1 -1
- package/dist/src/projects/setProjectRetentionPolicy.d.ts +49 -0
- package/dist/src/projects/setProjectRetentionPolicy.d.ts.map +1 -0
- package/dist/src/projects/setProjectRetentionPolicy.js +59 -0
- package/dist/src/projects/setProjectRetentionPolicy.js.map +1 -0
- package/dist/src/prompts/deletePrompt.d.ts +39 -0
- package/dist/src/prompts/deletePrompt.d.ts.map +1 -0
- package/dist/src/prompts/deletePrompt.js +55 -0
- package/dist/src/prompts/deletePrompt.js.map +1 -0
- package/dist/src/prompts/index.d.ts +1 -0
- package/dist/src/prompts/index.d.ts.map +1 -1
- package/dist/src/prompts/index.js +1 -0
- package/dist/src/prompts/index.js.map +1 -1
- package/dist/src/testing/reporter-format.d.ts.map +1 -1
- package/dist/src/testing/reporter-format.js +13 -3
- package/dist/src/testing/reporter-format.js.map +1 -1
- package/dist/src/traces/getTraces.d.ts +1 -1
- package/dist/src/traces/getTraces.d.ts.map +1 -1
- package/dist/src/traces/index.d.ts +1 -0
- package/dist/src/traces/index.d.ts.map +1 -1
- package/dist/src/traces/index.js +1 -0
- package/dist/src/traces/index.js.map +1 -1
- package/dist/src/traces/transferTraces.d.ts +56 -0
- package/dist/src/traces/transferTraces.d.ts.map +1 -0
- package/dist/src/traces/transferTraces.js +59 -0
- package/dist/src/traces/transferTraces.js.map +1 -0
- package/dist/src/types/prompts.d.ts +9 -0
- package/dist/src/types/prompts.d.ts.map +1 -1
- package/dist/src/types/prompts.js.map +1 -1
- package/dist/src/users/getCurrentUser.d.ts +25 -0
- package/dist/src/users/getCurrentUser.d.ts.map +1 -0
- package/dist/src/users/getCurrentUser.js +36 -0
- package/dist/src/users/getCurrentUser.js.map +1 -0
- package/dist/src/users/index.d.ts +2 -0
- package/dist/src/users/index.d.ts.map +1 -0
- package/dist/src/users/index.js +18 -0
- package/dist/src/users/index.js.map +1 -0
- package/dist/src/utils/resolvePromptIdentifier.d.ts +17 -0
- package/dist/src/utils/resolvePromptIdentifier.d.ts.map +1 -0
- package/dist/src/utils/resolvePromptIdentifier.js +39 -0
- package/dist/src/utils/resolvePromptIdentifier.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/overview.mdx +8 -4
- package/docs/projects.mdx +71 -0
- package/docs/prompts.mdx +19 -1
- package/docs/traces.mdx +28 -2
- package/docs/users.mdx +44 -0
- package/package.json +16 -12
- package/src/__generated__/api/v1.ts +749 -203
- package/src/constants/serverRequirements.ts +16 -0
- package/src/projects/index.ts +1 -0
- package/src/projects/setProjectRetentionPolicy.ts +80 -0
- package/src/prompts/deletePrompt.ts +70 -0
- package/src/prompts/index.ts +1 -0
- package/src/testing/reporter-format.ts +13 -3
- package/src/traces/getTraces.ts +1 -1
- package/src/traces/index.ts +1 -0
- package/src/traces/transferTraces.ts +89 -0
- package/src/types/prompts.ts +10 -0
- package/src/users/getCurrentUser.ts +39 -0
- package/src/users/index.ts +1 -0
- package/src/utils/resolvePromptIdentifier.ts +41 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ClientFn } from "../types/core.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for moving traces to another project.
|
|
4
|
+
*/
|
|
5
|
+
export interface TransferTracesParams extends ClientFn {
|
|
6
|
+
/**
|
|
7
|
+
* Trace GlobalIDs or OpenTelemetry trace IDs to move. All traces must
|
|
8
|
+
* currently belong to the same source project.
|
|
9
|
+
*/
|
|
10
|
+
traceIdentifiers: string[];
|
|
11
|
+
/**
|
|
12
|
+
* The destination project name or GlobalID.
|
|
13
|
+
*/
|
|
14
|
+
destinationProjectIdentifier: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The result of moving traces to another project.
|
|
18
|
+
*/
|
|
19
|
+
export interface TransferTracesResult {
|
|
20
|
+
/** The number of distinct traces moved. */
|
|
21
|
+
transferredTraceCount: number;
|
|
22
|
+
/** The destination project's GlobalID. */
|
|
23
|
+
destinationProjectId: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Move traces from one project to another.
|
|
27
|
+
*
|
|
28
|
+
* This operation re-parents the traces; it does not copy them. After the move,
|
|
29
|
+
* the traces no longer appear in their original project. Every trace must
|
|
30
|
+
* currently belong to the same source project.
|
|
31
|
+
*
|
|
32
|
+
* @param params - The parameters for moving traces.
|
|
33
|
+
* @param params.traceIdentifiers - Trace GlobalIDs or OpenTelemetry trace IDs to move.
|
|
34
|
+
* @param params.destinationProjectIdentifier - The destination project name or GlobalID.
|
|
35
|
+
* @returns The number of traces moved and the destination project's GlobalID.
|
|
36
|
+
* @throws {RangeError} If no trace identifiers are provided.
|
|
37
|
+
* @throws {HttpError} If a trace or destination project is missing, the traces
|
|
38
|
+
* belong to multiple source projects, or the transfer otherwise fails.
|
|
39
|
+
*
|
|
40
|
+
* @requires Phoenix server >= 20.4.0
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { transferTraces } from "@arizeai/phoenix-client/traces";
|
|
45
|
+
*
|
|
46
|
+
* const result = await transferTraces({
|
|
47
|
+
* traceIdentifiers: ["8f3a...", "VHJhY2U6Mg=="],
|
|
48
|
+
* destinationProjectIdentifier: "production",
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* console.log(result.transferredTraceCount);
|
|
52
|
+
* console.log(result.destinationProjectId);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function transferTraces({ client: _client, traceIdentifiers, destinationProjectIdentifier, }: TransferTracesParams): Promise<TransferTracesResult>;
|
|
56
|
+
//# sourceMappingURL=transferTraces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferTraces.d.ts","sourceRoot":"","sources":["../../../src/traces/transferTraces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,QAAQ;IACpD;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;OAEG;IACH,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,0CAA0C;IAC1C,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,cAAc,CAAC,EACnC,MAAM,EAAE,OAAO,EACf,gBAAgB,EAChB,4BAA4B,GAC7B,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAwBtD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createClient } from "../client.js";
|
|
2
|
+
import { TRANSFER_TRACES } from "../constants/serverRequirements.js";
|
|
3
|
+
import { ensureServerCapability } from "../utils/serverVersionUtils.js";
|
|
4
|
+
/**
|
|
5
|
+
* Move traces from one project to another.
|
|
6
|
+
*
|
|
7
|
+
* This operation re-parents the traces; it does not copy them. After the move,
|
|
8
|
+
* the traces no longer appear in their original project. Every trace must
|
|
9
|
+
* currently belong to the same source project.
|
|
10
|
+
*
|
|
11
|
+
* @param params - The parameters for moving traces.
|
|
12
|
+
* @param params.traceIdentifiers - Trace GlobalIDs or OpenTelemetry trace IDs to move.
|
|
13
|
+
* @param params.destinationProjectIdentifier - The destination project name or GlobalID.
|
|
14
|
+
* @returns The number of traces moved and the destination project's GlobalID.
|
|
15
|
+
* @throws {RangeError} If no trace identifiers are provided.
|
|
16
|
+
* @throws {HttpError} If a trace or destination project is missing, the traces
|
|
17
|
+
* belong to multiple source projects, or the transfer otherwise fails.
|
|
18
|
+
*
|
|
19
|
+
* @requires Phoenix server >= 20.4.0
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { transferTraces } from "@arizeai/phoenix-client/traces";
|
|
24
|
+
*
|
|
25
|
+
* const result = await transferTraces({
|
|
26
|
+
* traceIdentifiers: ["8f3a...", "VHJhY2U6Mg=="],
|
|
27
|
+
* destinationProjectIdentifier: "production",
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* console.log(result.transferredTraceCount);
|
|
31
|
+
* console.log(result.destinationProjectId);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export async function transferTraces({ client: _client, traceIdentifiers, destinationProjectIdentifier, }) {
|
|
35
|
+
if (traceIdentifiers.length === 0) {
|
|
36
|
+
throw new RangeError("At least one trace identifier is required");
|
|
37
|
+
}
|
|
38
|
+
const client = _client ?? createClient();
|
|
39
|
+
await ensureServerCapability({ client, requirement: TRANSFER_TRACES });
|
|
40
|
+
const { data, error } = await client.POST("/v1/traces/transfer", {
|
|
41
|
+
body: {
|
|
42
|
+
trace_identifiers: traceIdentifiers,
|
|
43
|
+
destination_project_identifier: destinationProjectIdentifier,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
if (error)
|
|
47
|
+
throw error;
|
|
48
|
+
if (!data?.data) {
|
|
49
|
+
throw new Error("Failed to transfer traces: no data returned");
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
transferredTraceCount: data.data.transferred_trace_count,
|
|
53
|
+
destinationProjectId: data.data.destination_project_id,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=transferTraces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transferTraces.js","sourceRoot":"","sources":["../../../src/traces/transferTraces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AA2BrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,MAAM,EAAE,OAAO,EACf,gBAAgB,EAChB,4BAA4B,GACP;IACrB,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAAC,2CAA2C,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,IAAI,YAAY,EAAE,CAAC;IACzC,MAAM,sBAAsB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAEvE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;QAC/D,IAAI,EAAE;YACJ,iBAAiB,EAAE,gBAAgB;YACnC,8BAA8B,EAAE,4BAA4B;SAC7D;KACF,CAAC,CAAC;IAEH,IAAI,KAAK;QAAE,MAAM,KAAK,CAAC;IACvB,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,OAAO;QACL,qBAAqB,EAAE,IAAI,CAAC,IAAI,CAAC,uBAAuB;QACxD,oBAAoB,EAAE,IAAI,CAAC,IAAI,CAAC,sBAAsB;KACvD,CAAC;AACJ,CAAC"}
|