Kaizen
Browse modulesInsightsinsights/sharedSchemas and constants

Variable: reportDefinitionSchema

const reportDefinitionSchema: ZodObject<{
  aggregations: ZodOptional<ZodArray<ZodObject<{
     alias: ZodString;
     field: ZodOptional<ZodString>;
     fn: ZodEnum<{
        avg: "avg";
        count: "count";
        max: "max";
        min: "min";
        sum: "sum";
     }>;
  }, $strip>>>;
  columns: ZodArray<ZodString>;
  filter: ZodOptional<ZodType<FilterNode, unknown, $ZodTypeInternals<FilterNode, unknown>>>;
  groupBy: ZodOptional<ZodArray<ZodObject<{
     bucket: ZodOptional<ZodEnum<{
        day: "day";
        month: "month";
        quarter: "quarter";
        week: "week";
        year: "year";
     }>>;
     field: ZodString;
  }, $strip>>>;
  schemaVersion: ZodLiteral<1>;
  sort: ZodDefault<ZodArray<ZodObject<{
     by: ZodString;
     direction: ZodDefault<ZodEnum<{
        asc: "asc";
        desc: "desc";
     }>>;
  }, $strip>>>;
  subject: ZodString;
  timezone: ZodString;
  totals: ZodOptional<ZodBoolean>;
}, $strip>;

Defined in: shared/insights/types/definition.ts:242

The single portable report contract. Every surface — builder, saved report, dashboard tile, and Ask — produces one of these; the compiler treats every field as a lookup key into the server registry, never as SQL text. Logical field keys only; no physical table/column names.