ObjectStackObjectStack

Report schema — UI Protocol property reference

Report schemas of the ObjectStack UI Protocol: JoinedReportBlock, Report and 3 more — each property with its type, default and a TypeScript example.

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
namestring✅Snake 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'>optional (default: "tabular")
datasetstringoptionalDataset name to bind (ADR-0021); a joined report refuses a block without one
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

Nested Shape: JoinedReportBlock.order[number]

PropertyTypeRequiredDescription
bystring✅Dimension or measure name to order by (must be selected by this report)
directionEnum<'asc' | 'desc'>optional (default: "asc")Sort direction (default ascending)

Report

Properties

PropertyTypeRequiredDescription
namestring✅Report 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'>optional (default: "tabular")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
drilldownbooleanoptional (default: true)Click-through to underlying records
chart{ type: Enum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | …>; title?: string | Record<string, string>; subtitle?: string | Record<string, string>; description?: string | Record<string, string>; … }optionalEmbedded chart configuration (refused on a joined report, which draws tables only)
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.

Nested Shape: Report.order[number]

PropertyTypeRequiredDescription
bystring✅Dimension or measure name to order by (must be selected by this report)
directionEnum<'asc' | 'desc'>optional (default: "asc")Sort direction (default ascending)

Nested Shape: Report.chart

PropertyTypeRequiredDescription
typeEnum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | …>✅
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
xAxisstring✅Dataset dimension name for the X-axis (bound-dataset dimension, not a raw field)
yAxisstring✅Dataset 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' | …>; color?: string; … }[]optionalDefined series configuration. Structure, not appearance — authorable where the chart has inline data; refused by name on a dataset-bound dashboard widget, where the dataset decides it (ADR-0021).
colorsstring[] | Record<string, string>optionalColor palette (string[]) or value→color map ({ value: color })
heightnumberoptionalFixed plot height in pixels (overrides the container default)
showLegendbooleanoptional (default: true)Display legend
showDataLabelsbooleanoptional (default: false)Display 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? }
arianeveroptional[REMOVED] ChartConfig.aria — authored as dashboard.widgets[].chartConfig.aria, report.chart.aria and report.blocks[].chart.aria — was removed in @objectstack/spec 17 (ADR-0049 D2). No chart renderer ever applied it: the chart implementation declares no aria prop, the presentation lowering names it nowhere, and the react <ObjectChart> block never published it, so ARIA attributes declared here parsed and then silently did not reach the DOM. Delete the key. The accessible name that IS applied on this same chart config is its sibling description, which the chart renderer lowers onto the chart graphic as role="img" plus aria-label. The shared AriaProps shape is NOT gone — ariaLabel / ariaDescribedBy / role stay live in the aria block on page.aria, page.components[].aria and the list view aria. Run os migrate meta --from 17 to list the mechanical edits for existing sources; --write applies the ones it can prove, and you apply the rest by hand.

Nested Shape: Report.blocks[number]

PropertyTypeRequiredDescription
namestring✅Snake 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'>optional (default: "tabular")
datasetstringoptionalDataset name to bind (ADR-0021); a joined report refuses a block without one
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

Nested Shape: Report.protection

PropertyTypeRequiredDescription
lockEnum<'none' | 'no-overlay' | 'no-delete' | 'full'>✅Lock policy — none | no-overlay | no-delete | full.
reasonstring✅User-visible reason shown when the lock blocks an action.
docsUrlstringoptionalOptional URL the Studio banner links to for more context.

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
xAxisstring✅Dataset dimension name for the X-axis (bound-dataset dimension, not a raw field)
yAxisstring✅Dataset 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' | …>; color?: string; … }[]optionalDefined series configuration. Structure, not appearance — authorable where the chart has inline data; refused by name on a dataset-bound dashboard widget, where the dataset decides it (ADR-0021).
colorsstring[] | Record<string, string>optionalColor palette (string[]) or value→color map ({ value: color })
heightnumberoptionalFixed plot height in pixels (overrides the container default)
showLegendbooleanoptional (default: true)Display legend
showDataLabelsbooleanoptional (default: false)Display 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? }
arianeveroptional[REMOVED] ChartConfig.aria — authored as dashboard.widgets[].chartConfig.aria, report.chart.aria and report.blocks[].chart.aria — was removed in @objectstack/spec 17 (ADR-0049 D2). No chart renderer ever applied it: the chart implementation declares no aria prop, the presentation lowering names it nowhere, and the react <ObjectChart> block never published it, so ARIA attributes declared here parsed and then silently did not reach the DOM. Delete the key. The accessible name that IS applied on this same chart config is its sibling description, which the chart renderer lowers onto the chart graphic as role="img" plus aria-label. The shared AriaProps shape is NOT gone — ariaLabel / ariaDescribedBy / role stay live in the aria block on page.aria, page.components[].aria and the list view aria. Run os migrate meta --from 17 to list the mechanical edits for existing sources; --write applies the ones it can prove, and you apply the rest by hand.

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

Nested Shape: ReportChart.series[number]

PropertyTypeRequiredDescription
namestring✅Field name or series identifier
labelstring | Record<string, string>optionalSeries display label
typeEnum<'bar' | 'horizontal-bar' | 'column' | 'line' | 'area' | 'pie' | 'donut' | …>optionalOverride chart type for this series
colorstringoptionalSeries color (hex/rgb/token)
stackstringoptionalStack identifier to group series
yAxisEnum<'left' | 'right'>optional (default: "left")Bind to specific Y-Axis
variantEnum<'primary' | 'comparison'>optional (default: "primary")Series visual role
dashArraystringoptionalSVG stroke-dasharray override
opacitynumberoptionalSeries opacity override

Nested Shape: ReportChart.annotations[number]

PropertyTypeRequiredDescription
typeEnum<'line' | 'region'>optional (default: "line")
axisEnum<'x' | 'y'>optional (default: "y")
valuenumber | string✅Start value
endValuenumber | stringoptionalEnd value for regions
colorstringoptional
labelstring | Record<string, string>optionalDisplay label — the default-language string, or an inline locale map ({ en, "zh-CN" }) resolved at render time
styleEnum<'solid' | 'dashed' | 'dotted'>optional (default: "dashed")

Nested Shape: ReportChart.interaction

PropertyTypeRequiredDescription
tooltipsbooleanoptional (default: true)Show the hover tooltip
brushbooleanoptional (default: false)Show the range selector under the plot

ReportSort

Properties

PropertyTypeRequiredDescription
bystring✅Dimension or measure name to order by (must be selected by this report)
directionEnum<'asc' | 'desc'>optional (default: "asc")Sort direction (default ascending)

ReportType

Allowed Values

  • tabular
  • summary
  • matrix
  • joined

On this page