@mastra/core
Version:
74 lines • 2.92 kB
TypeScript
/**
* A saved view: a named copy of an observability list page's URL state.
*
* `savedViewStateSchema` validates the whole state (used by the page that applies it).
* `savedViewStateEnvelopeSchema` checks only what storage needs (version, page, size), so a page
* can add state without a server deploy.
*/
import { z } from 'zod/v4';
export declare const SAVED_VIEW_SCHEMA_VERSION = 1;
export declare const SAVED_VIEW_PAGES: readonly ['traces', 'spans', 'threads', 'logs'];
/** Max size of a saved view's state, as UTF-8 JSON. */
export declare const SAVED_VIEW_STATE_MAX_BYTES: number;
export type SavedViewPage = (typeof SAVED_VIEW_PAGES)[number];
export declare const savedViewDateRangeSchema: z.ZodUnion<readonly [z.ZodObject<{
preset: z.ZodString;
}, z.core.$strict>, z.ZodObject<{
from: z.ZodString;
to: z.ZodOptional<z.ZodString>;
}, z.core.$strict>]>;
export declare const savedViewSortSchema: z.ZodObject<{
field: z.ZodString;
direction: z.ZodEnum<{
asc: "asc";
desc: "desc";
}>;
}, z.core.$strip>;
export declare const savedViewColumnSchema: z.ZodObject<{
id: z.ZodString;
visible: z.ZodBoolean;
}, z.core.$strip>;
export declare const savedViewStateSchema: z.ZodObject<{
schemaVersion: z.ZodLiteral<1>;
page: z.ZodEnum<{
logs: "logs";
spans: "spans";
threads: "threads";
traces: "traces";
}>;
filters: z.ZodArray<z.ZodType<import("./filter-node").FilterNode, unknown, z.core.$ZodTypeInternals<import("./filter-node").FilterNode, unknown>>>;
dateRange: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
preset: z.ZodString;
}, z.core.$strict>, z.ZodObject<{
from: z.ZodString;
to: z.ZodOptional<z.ZodString>;
}, z.core.$strict>]>>;
sort: z.ZodOptional<z.ZodObject<{
field: z.ZodString;
direction: z.ZodEnum<{
asc: "asc";
desc: "desc";
}>;
}, z.core.$strip>>;
columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodString;
visible: z.ZodBoolean;
}, z.core.$strip>>>;
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
export type SavedViewState = z.infer<typeof savedViewStateSchema>;
export type SavedViewDateRange = z.infer<typeof savedViewDateRangeSchema>;
export type SavedViewSort = z.infer<typeof savedViewSortSchema>;
export type SavedViewColumn = z.infer<typeof savedViewColumnSchema>;
/** What a store checks before saving: a known version and page, within the size limit. */
export declare const savedViewStateEnvelopeSchema: z.ZodObject<{
schemaVersion: z.ZodLiteral<1>;
page: z.ZodEnum<{
logs: "logs";
spans: "spans";
threads: "threads";
traces: "traces";
}>;
}, z.core.$loose>;
export type SavedViewStateEnvelope = z.infer<typeof savedViewStateEnvelopeSchema>;
//# sourceMappingURL=saved-view.d.ts.map