@byte_fluffy/nexra-sdk 0.1.0-alpha.4 → 0.1.0-alpha.41

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.
@@ -0,0 +1,33 @@
1
+ import { J as JsonValue } from './json-Cz0MkWQn.js';
2
+
3
+ type PublicUpstreamUnavailableReason = "no_response" | "not_retained" | "unsupported_capture" | "error_not_emitted" | "size_limit";
4
+ /** Network errors retain unknown codes from older or newer servers. */
5
+ type NexraError = {
6
+ code: string;
7
+ message: string;
8
+ param?: string;
9
+ };
10
+ type PublicErrorContext = {
11
+ nexraRequestId?: string;
12
+ nexraHttpStatus?: number;
13
+ };
14
+ type PublicErrorFields = PublicErrorContext & {
15
+ nexraError?: NexraError;
16
+ upstreamHttpStatus?: number;
17
+ upstreamRequestId?: string;
18
+ upstreamError?: JsonValue;
19
+ upstreamErrorMessage?: string;
20
+ upstreamRedacted?: true;
21
+ upstreamTruncated?: true;
22
+ upstreamUnavailableReason?: PublicUpstreamUnavailableReason;
23
+ upstreamFormat?: "sse" | "decoded";
24
+ upstreamEvent?: string;
25
+ };
26
+ type PublicError = PublicErrorFields & {
27
+ nexraError: NexraError;
28
+ };
29
+ type ApiErrorPayload = PublicError;
30
+ /** Extracts text only from known provider error fields, never arbitrary metadata. */
31
+ declare function extractUpstreamErrorMessage(value: unknown): string | undefined;
32
+
33
+ export { type ApiErrorPayload as A, type NexraError as N, type PublicErrorFields as P, type PublicError as a, type PublicErrorContext as b, extractUpstreamErrorMessage as e };