ObjectStackObjectStack

Report

Report protocol schemas

Report Type Enum

Source: packages/spec/src/ui/report.zod.ts

TypeScript Usage

import { JoinedReportBlockSchema, ReportSchema, ReportChartSchema, ReportSortSchema, ReportType } from '@objectstack/spec/ui';
import type { JoinedReportBlock, Report, ReportChart, ReportSort, ReportType } from '@objectstack/spec/ui';

// Validate data
const result = JoinedReportBlockSchema.parse(data);

JoinedReportBlock

Properties

PropertyTypeRequiredDescription
namestringSnake case identifier (lowercase with underscores only)
labelstring | Record<string, string>optionalDisplay label — the default-language string, or an inline locale map ({ en, "zh-CN" }) resolved at render time
descriptionstring | Record<string, string>optionalDisplay label — the default-language string, or an inline locale map ({ en, "zh-CN" }) resolved at render time
typeEnum<'tabular' | 'summary' | 'matrix'>
chart{ type: Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | … +13 more>; title?: string | Record<string, string>; subtitle?: string | Record<string, string>; description?: string | Record<string, string>; … }optional
datasetstringoptionalDataset name to bind (ADR-0021)
rowsstring[]optionalDimension names down (dataset-bound)
columnsstring[]optionalDimension names across (matrix, dataset-bound)
valuesstring[]optionalMeasure names to show (dataset-bound)
runtimeFilteranyoptionalRender-time scope filter (dataset-bound)
order{ by: string; direction: Enum<'asc' | 'desc'> }[]optionalResult ordering, most significant key first

Report

Properties

PropertyTypeRequiredDescription
namestringReport unique name
labelstring | Record<string, string>Report label
descriptionstring | Record<string, string>optionalDisplay label — the default-language string, or an inline locale map ({ en, "zh-CN" }) resolved at render time
typeEnum<'tabular' | 'summary' | 'matrix' | 'joined'>Report format type
datasetstringoptionalDataset name to bind (ADR-0021)
rowsstring[]optionalDimension names down
columnsstring[]optionalDimension names across (matrix)
valuesstring[]optionalMeasure names to show
runtimeFilteranyoptionalRender-time scope filter
order{ by: string; direction: Enum<'asc' | 'desc'> }[]optionalResult ordering, most significant key first
drilldownbooleanClick-through to underlying records
chart{ type: Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | … +13 more>; title?: string | Record<string, string>; subtitle?: string | Record<string, string>; description?: string | Record<string, string>; … }optionalEmbedded chart configuration
blocks{ name: string; label?: string | Record<string, string>; description?: string | Record<string, string>; type: Enum<'tabular' | 'summary' | 'matrix'>; … }[]optionalSub-reports for type=joined
protection{ lock: Enum<'none' | 'no-overlay' | 'no-delete' | 'full'>; reason: string; docsUrl?: string }optionalPackage author protection block — lock policy for this report.
_lockEnum<'none' | 'no-overlay' | 'no-delete' | 'full'>optionalItem-level lock — controls overlay & delete (ADR-0010).
_lockReasonstringoptionalHuman-readable reason shown when a write is refused by _lock.
_lockSourceEnum<'artifact' | 'package' | 'env-forced'>optionalLayer that set _lock (artifact | package | env-forced).
_provenanceEnum<'package' | 'org' | 'env-forced'>optionalOrigin of the item (package | org | env-forced).
_packageIdstringoptionalOwning package machine id.
_packageVersionstringoptionalOwning package version.
_lockDocsUrlstringoptionalOptional documentation link surfaced next to _lockReason.

ReportChart

Properties

PropertyTypeRequiredDescription
typeEnum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | 'funnel' | 'scatter' | 'treemap' | 'sankey' | 'combo' | 'gauge' | 'solid-gauge' | … +6 more>
titlestring | Record<string, string>optionalChart title
subtitlestring | Record<string, string>optionalChart subtitle
descriptionstring | Record<string, string>optionalAccessibility description — announced to screen readers as the chart’s label
xAxisstringDataset dimension name for the X-axis (bound-dataset dimension, not a raw field)
yAxisstringDataset measure name for the Y-axis (bound-dataset measure, not a raw field)
series{ name: string; label?: string | Record<string, string>; type?: Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | … +13 more>; color?: string; … }[]optionalDefined series configuration
colorsstring[] | Record<string, string>optionalColor palette (string[]) or value→color map ({ value: color })
heightnumberoptionalFixed plot height in pixels (overrides the container default)
showLegendbooleanDisplay legend
showDataLabelsbooleanDisplay data labels
annotations{ type: Enum<'line' | 'region'>; axis: Enum<'x' | 'y'>; value: number | string; endValue?: number | string; … }[]optionalReference lines/bands drawn over the plot: { type: "line" | "region", axis: "x" | "y", value, endValue?, color?, label?, style? }
interaction{ tooltips: boolean; brush: boolean }optionalInteraction toggles: { tooltips?, brush? }
aria{ ariaLabel?: string | Record<string, string>; ariaDescribedBy?: string; role?: string }optionalARIA accessibility attributes

Allowed Values: ReportChart.type

  • bar
  • horizontal-bar
  • column
  • line
  • area
  • pie
  • donut
  • funnel
  • scatter
  • treemap
  • sankey
  • combo
  • gauge
  • solid-gauge
  • metric
  • kpi
  • bullet
  • radar
  • table
  • pivot

ReportSort

Properties

PropertyTypeRequiredDescription
bystringDimension or measure name to order by (must be selected by this report)
directionEnum<'asc' | 'desc'>Sort direction (default ascending)

ReportType

Allowed Values

  • tabular
  • summary
  • matrix
  • joined

On this page