ObjectStackObjectStack

Report

Report protocol schemas

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'>optional (default: "tabular")
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>; … }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

Nested Shape: JoinedReportBlock.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
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' | …>; 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)
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? }
aria{ ariaLabel?: string | Record<string, string>; ariaDescribedBy?: string; role?: string }optionalARIA accessibility attributes

Nested Shape: JoinedReportBlock.order[number]

PropertyTypeRequiredDescription
bystringDimension 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
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'>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
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
bystringDimension 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
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' | …>; 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)
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? }
aria{ ariaLabel?: string | Record<string, string>; ariaDescribedBy?: string; role?: string }optionalARIA accessibility attributes

Nested Shape: Report.blocks[number]

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'>optional (default: "tabular")
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>; … }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

Nested Shape: Report.protection

PropertyTypeRequiredDescription
lockEnum<'none' | 'no-overlay' | 'no-delete' | 'full'>Lock policy — none | no-overlay | no-delete | full.
reasonstringUser-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
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' | …>; 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)
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? }
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

Nested Shape: ReportChart.series[number]

PropertyTypeRequiredDescription
namestringField 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 | stringStart 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

Nested Shape: ReportChart.aria

PropertyTypeRequiredDescription
ariaLabelstring | Record<string, string>optionalAccessible label for screen readers (WAI-ARIA aria-label). Plain string, or an inline locale map — no translation-bundle slot addresses this key, so a plain string is announced in the source language.
ariaDescribedBystringoptionalID of element providing additional description (WAI-ARIA aria-describedby)
rolestringoptionalWAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")

ReportSort

Properties

PropertyTypeRequiredDescription
bystringDimension 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