@altertable/data-app 0.78.0 → 0.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -10,6 +10,9 @@ task needs a pattern that source does not cover. Search [REFERENCE.md](REFERENCE
10
10
 
11
11
  Read [Contributing](CONTRIBUTING.md) before changing packages or contributor
12
12
  tooling. App authoring guides teach agents how to build apps with the SDK.
13
+ For every breaking SDK change, include the migration in the same PR.
14
+ Follow [SDK migrations](https://github.com/altertable-ai/data-app/blob/main/.github/RELEASING.md#sdk-migrations).
15
+
13
16
  Keep reusable behavior in components, defaults, types, and tests. Add authoring
14
17
  documentation only when an app author must make a decision or take an action;
15
18
  do not restate patterns already handled by the SDK.
package/CONTRIBUTING.md CHANGED
@@ -135,7 +135,8 @@ a nonzero status; rerun the command to reconnect.
135
135
  ## Preview UI changes
136
136
 
137
137
  For SDK UI work, `bun run dev:gallery` starts the example gallery at
138
- `http://127.0.0.1:27418/gallery`, `/playground`, and a Docker-backed mock API.
138
+ `http://127.0.0.1:27418/gallery`, `/playground`, the `/cost-dashboard` example, and a
139
+ Docker-backed mock API.
139
140
  Package and fixture edits reload. Restart after changing `dev/server.ts`; add
140
141
  `?delay=2000` to inspect loading states.
141
142
 
package/REFERENCE.md CHANGED
@@ -1,14 +1,17 @@
1
1
  # Data app API reference
2
2
 
3
- Search an export to find its import paths, signature, and props:
3
+ Search an export or method to find its import paths, signature, and props:
4
4
 
5
5
  ```sh
6
- rg '^LineChart\b' REFERENCE.md
6
+ rg '(^|\.)LineChart\b' REFERENCE.md
7
+ rg '(^|\.)defineView\b' REFERENCE.md
7
8
  ```
8
9
 
9
10
  Each export and field has its own line. `?` marks optional fields;
10
11
  `[variant 2 of 3]` identifies union-specific fields.
11
12
  `= props listed as Name.*` points to a component's prop definitions.
13
+ Methods are listed under the function that returns them, such as
14
+ `createDataHooks().defineView().dataset`.
12
15
 
13
16
  ```text
14
17
  AboutData (component, @altertable/data-app-react/ui): (props: AboutDataProps)
@@ -310,11 +313,11 @@ createDataHooks().defineView: <Name extends ViewOperationName<Operations>, const
310
313
  createDataHooks().defineView.definition.operation: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown)
311
314
  createDataHooks().defineView.definition.dataContext: DataContext & Context
312
315
  createDataHooks().defineView.definition.describeInput?: ((input: FilterInput<FiltersOf<Operations[Name]>>) => string) — Describe the displayed scope in prose. Defaults to the reporting period and each narrowed filter, such as `Mar 1–7, 2026 UTC · group Alpha`, or `all data`.
313
- createDataHooks().defineView.definition.isEmpty?: ((data: OutputOf<Operations[Name]>) => boolean) — App-owned semantics: measured zero need not mean an empty result. Defaults to never empty.
316
+ createDataHooks().defineView.definition.isEmpty?: ((data: OutputOf<Operations[Name]>) => boolean) — App-owned semantics: measured zero need not mean an empty result. Default: A result with no rows is empty; any other result never is.
314
317
  createDataHooks().defineView.definition.emptyFallback?: EmptyContent — Inherited by DataSection unless it supplies its own copy.
315
318
  createDataHooks().defineView().filter: (): FilterTarget<Partial<{ [Key in keyof FiltersOf<Operations[Name]>]: Extract<FiltersOf<Operations[Name]>[Key]['presentation'], { group: 'display'; }> extends never ? FilterValues<...>[Key] : never; }>>
316
319
  createDataHooks().defineView().breakdown: <Key extends DisplayChoiceName<Filters>>(key: Key): FiltersOf<Operations[Name]>[Key] extends ChoiceFilter<infer Value extends string> ? BreakdownTarget<Value> : never
317
- createDataHooks().defineView().dataset: <Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, FilterInput<Filters>, Row, Parameters<Context['evidence']>[0]> & { columns: Columns & NonEmptyColumns<Columns>; }): Dataset<OutputOf<Operations[Name]>, FilterInput<FiltersOf<Operations[N…
320
+ createDataHooks().defineView().dataset: <Row = DatasetRows<Data>, const Columns extends Record<string, object> = Record<string, object>>(definition: BoundDatasetDefinition<Data, FilterInput<Filters>, Row, Columns, Context>): Dataset<OutputOf<Operations[Name]>, FilterInput<FiltersOf<Operations[Name]>>, Row>
318
321
  createDataHooks().defineView().metric: (definition: Parameters<Context['metric']>[0], select: (data: Data, input: FilterInput<Filters>) => HasPeriod<Filters> extends true ? MetricValues : { current: number; previous?: never; }): Metric<OutputOf<Operations[Name]>, FilterInput<FiltersOf<Operations[Name]>>>
319
322
  createDataHooks().defineView().scope: (snapshot: DisplayedSnapshot<Data, FilterInput<Filters>>): string
320
323
  createDataHooks().defineView().content: (render: (state: DataContentState<Data, FilterInput<Filters>>) => ReactNode): ViewContent<OutputOf<Operations[Name]>, FilterInput<FiltersOf<Operations[Name]>>>
@@ -323,13 +326,13 @@ createDataHooks().defineDetailView.definition.id: string
323
326
  createDataHooks().defineDetailView.definition.title: ReactNode
324
327
  createDataHooks().defineDetailView.definition.parseInput: (input: unknown) => InputOf<Operations[Name]> — Validates untrusted navigation input before a detail operation can run.
325
328
  createDataHooks().defineDetailView.definition.describeInput?: ((input: InputOf<Operations[Name]>) => string) — Describe the destination's scope. Defaults to the filters its operation reads; supply it to name the record, such as `orders for Customer 042`.
326
- createDataHooks().defineDetailView.definition.isEmpty?: ((data: OutputOf<Operations[Name]>) => boolean) — App-owned semantics: measured zero need not mean an empty result. Defaults to never empty.
329
+ createDataHooks().defineDetailView.definition.isEmpty?: ((data: OutputOf<Operations[Name]>) => boolean) — App-owned semantics: measured zero need not mean an empty result. Default: A result with no rows is empty; any other result never is.
327
330
  createDataHooks().defineDetailView.definition.emptyFallback?: EmptyContent — Inherited by DataSection unless it supplies its own copy.
328
331
  createDataHooks().defineDetailView.definition.operation: Name
329
332
  createDataHooks().defineDetailView.definition.dataContext: Context
330
333
  createDataHooks().defineDetailView().useResult: (input: Input): ViewResult<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>
331
334
  createDataHooks().defineDetailView().content: (render: (state: DataContentState<Data, Input>) => ReactNode): DetailContent<OutputOf<Operations[Name]>, InputOf<Operations[Name]>> — Render like view content: displayed data, its input, and the derived scope.
332
- createDataHooks().defineDetailView().dataset: <Row, const Columns extends Record<string, object> = Record<string, object>>(definition: DatasetDefinition<Data, Input, Row, Parameters<Context['evidence']>[0]> & { columns: Columns & NonEmptyColumns<Columns>; }): Dataset<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Row>
335
+ createDataHooks().defineDetailView().dataset: <Row = DatasetRows<Data>, const Columns extends Record<string, object> = Record<string, object>>(definition: BoundDatasetDefinition<Data, Input, Row, Columns, Context>): Dataset<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Row>
333
336
  createDataHooks().defineDetailView().metric: (definition: Parameters<Context['metric']>[0], select: (data: Data, input: Input) => { current: number; previous?: never; }): Metric<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>
334
337
  CsvCell (type, @altertable/data-app-react): = string | number | boolean | null | undefined
335
338
  CsvExport (type, @altertable/data-app-react/ui): All distinct datasets in the displayed result; filename names the download.
@@ -339,31 +342,22 @@ CsvTable (type, @altertable/data-app-react/ui): One named dataset with ordered c
339
342
  CsvTable.name: string
340
343
  CsvTable.columns: readonly string[]
341
344
  CsvTable.rows: readonly (readonly CsvCell[])[]
342
- DataApp (component, @altertable/data-app-react): <Data, Input, const SummaryViews extends readonly AnyView[] = [ ]>(props: DataAppProps<Data, Input, SummaryViews>) — Executes the primary view and its summary views, and owns controls, inspection, exports, and stories.
343
- DataApp.children: ReactNode
344
- DataApp.description?: ReactNode — Override the declared subtitle; null hides it.
345
- DataApp.showToolbar?: boolean — Show page actions. Defaults to true; does not hide filters or data states. Embedded surfaces have no toolbar: the host runs page actions through its bridge.
346
- DataApp.toolbarActions?: ReactNode — Standalone toolbar controls; embedded surfaces omit them.
347
- DataApp.footerActions?: ReactNode — Standalone footer controls; embedded surfaces omit them.
348
- DataApp.footer?: ReactNode — Optional source, coverage, or methodology note below the app content. Compose prose and inline components; typography and spacing are provided.
349
- DataApp.showSearch?: boolean — Show declared search controls. Defaults to true; hiding preserves their values.
350
- DataApp.showFilters?: boolean — Show declared filter controls, including display options. Defaults to true; hiding preserves their values.
351
- DataApp.view: DataAppView<Data, Input> — The headline view. `<DataApp>` renders the controls for every filter its client's operations read and owns their URL state.
352
- DataApp.summaryViews?: SummaryViews — Other views that the story and CSV export read, sharing `view`’s data context. They load with `view` instead of waiting for their sections to near the viewport.
353
- DataApp.showSearchSuggestions?: boolean — Show supplied datasets’ record suggestions on the first declared search. Defaults to true.
354
- DataApp.story?: ((snapshot: DisplayedSnapshot<Data, Input>, ...summaries: { [Index in keyof SummaryViews]: SnapshotOf<SummaryViews[Index]>; }) => StoryFindings) — Omit to leave presentation out of the toolbar. Receives `view`’s displayed snapshot, then one per summary view in `summaryViews` order.
355
- DataApp.datasets?: readonly [ExportDataset<Data, Input> | ExportOf<SummaryViews[number]>, ...(ExportDataset<Data, Input> | ExportOf<...>)[]] — Omit to leave CSV export out of the toolbar. Datasets may belong to `view` or a summary view.
356
- DataApp.details?: readonly DetailContent<any, any>[] — Detail destinations available to dataset actions and metric record inspection.
357
- DataApp (component, @altertable/data-app-react/ui): (props: DataAppProps) — Setup and static screens; fetched data uses the declared-view DataApp.
358
- DataApp.children: ReactNode
359
- DataApp.dataContext: DataContext
360
- DataApp.description?: ReactNode — Override the declared subtitle; null hides it.
361
- DataApp.showToolbar?: boolean — Show page actions. Defaults to true; does not hide filters or data states. Embedded surfaces have no toolbar: the host runs page actions through its bridge.
362
- DataApp.toolbarActions?: ReactNode — Standalone toolbar controls; embedded surfaces omit them.
363
- DataApp.footerActions?: ReactNode — Standalone footer controls; embedded surfaces omit them.
364
- DataApp.footer?: ReactNode — Optional source, coverage, or methodology note below the app content. Compose prose and inline components; typography and spacing are provided.
365
- DataApp.csvExport?: CsvExport
366
- DataApp.queries?: DisclosedQuery[]
345
+ DataApp (component, @altertable/data-app-react): (props: DataAppScreenProps); <Data, Input, const SummaryViews extends readonly AnyView[] = [ ]>(props: DataAppProps<Data, Input, SummaryViews>) — Renders a setup or static screen from its `dataContext` and children. Executes the primary view and its summary views, and owns controls, inspection, exports, and stories.
346
+ DataApp.props.children: ReactNode
347
+ DataApp.props.dataContext: DataContext
348
+ DataApp.props.description?: ReactNode — Override the declared subtitle; null hides it.
349
+ DataApp.props.showToolbar?: boolean — Show page actions. Defaults to true; does not hide filters or data states. Embedded surfaces have no toolbar: the host runs page actions through its bridge.
350
+ DataApp.props.toolbarActions?: ReactNode — Standalone toolbar controls; embedded surfaces omit them.
351
+ DataApp.props.footerActions?: ReactNode — Standalone footer controls; embedded surfaces omit them.
352
+ DataApp.props.footer?: ReactNode — Optional source, coverage, or methodology note below the app content. Compose prose and inline components; typography and spacing are provided.
353
+ DataApp.props.showSearch?: boolean — Show declared search controls. Defaults to true; hiding preserves their values.
354
+ DataApp.props.showFilters?: boolean — Show declared filter controls, including display options. Defaults to true; hiding preserves their values.
355
+ DataApp.props.view: DataAppView<Data, Input> — The headline view. `<DataApp>` renders the controls for every filter its client's operations read and owns their URL state.
356
+ DataApp.props.summaryViews?: SummaryViews — Other views that the story and CSV export read, sharing `view`’s data context. They load with `view` instead of waiting for their sections to near the viewport.
357
+ DataApp.props.showSearchSuggestions?: boolean — Show supplied datasets’ record suggestions on the first declared search. Defaults to true.
358
+ DataApp.props.story?: ((snapshot: DisplayedSnapshot<Data, Input>, ...summaries: { [Index in keyof SummaryViews]: SnapshotOf<SummaryViews[Index]>; }) => StoryFindings) — Omit to leave presentation out of the toolbar. Receives `view`’s displayed snapshot, then one per summary view in `summaryViews` order.
359
+ DataApp.props.datasets?: readonly [ExportDataset<Data, Input> | ExportOf<SummaryViews[number]>, ...(ExportDataset<Data, Input> | ExportOf<...>)[]] — Omit to leave CSV export out of the toolbar. Datasets may belong to `view` or a summary view.
360
+ DataApp.props.details?: readonly DetailContent<any, any>[] — Detail destinations available to dataset actions and metric record inspection.
367
361
  DataAppConfig (type, @altertable/data-app, @altertable/data-app/config): <Queries>
368
362
  DataAppConfig.title: string
369
363
  DataAppConfig.scope: { organization: string; environment: string; } — Display labels; scope does not grant data access.
@@ -378,6 +372,7 @@ DataAppDefinition.description: string — Explain what the app helps readers exp
378
372
  DataAppDefinition.appearance?: AppearanceOptions — Omit to use the standard appearance.
379
373
  DataAppDefinition.dateFormatting?: { locale?: string | undefined; timeZone?: string | undefined; } — Shared date display defaults. Reporting views and individual fields may override the time zone.
380
374
  DataAppDefinition.queries: QuerySnapshot<Queries>
375
+ DataAppDefinition.queryNames: { readonly [Name in keyof Queries & string]: Name; } — Every registered query name, keyed by itself. Pass it to `createDataContext()`, then cite the queries behind each glossary entry.
381
376
  DataAppDefinition.defineDimension: <const Type extends 'string' | 'number'>(config: DimensionSourceConfig<Type> & { source: { query: DimensionSourceQueryName<Queries, NoInfer<Type>>; }; }) => SourceDimensionFilter<...>
382
377
  DataAppDefinition.defineOperation: <Input, Output, const Filters extends FilterCollection = {}>(operation: InputOperationDefinition<Input, Output, Queries, Filters>): DefinedOperation<WithFilterInput<Filters, Input>, Output, Queries, keyof Filters extends never ? undefined : Filters> — Parse a destination's own input, such as a record id, and list valid `checks`. Declare `filters` too when it reads the displayed scope.
383
378
  DataAppDefinition.defineOperation: <const Filters extends FilterCollection = {}, Output = unknown>(operation: FilterOperationDefinition<Filters, Output, Queries>): DefinedOperation<FilterInput<Filters>, Output, Queries, Filters>
@@ -388,17 +383,7 @@ DataAppError.requestId?: string
388
383
  DataAppError.…: plus props inherited from built-in
389
384
  DataAppOperationRegistry (type, @altertable/data-app, @altertable/data-app/config): <Operations>
390
385
  DataAppOperationRegistry.createDataClient: () => DataClient<Operations> — Run operations in the browser using its installed query bridge.
391
- DataAppProps (type, @altertable/data-app-react): <Data, Input, SummaryViews> = props listed as DataApp.*
392
- DataAppProps (type, @altertable/data-app-react/ui)
393
- DataAppProps.children: ReactNode
394
- DataAppProps.dataContext: DataContext
395
- DataAppProps.description?: ReactNode — Override the declared subtitle; null hides it.
396
- DataAppProps.showToolbar?: boolean — Show page actions. Defaults to true; does not hide filters or data states. Embedded surfaces have no toolbar: the host runs page actions through its bridge.
397
- DataAppProps.toolbarActions?: ReactNode — Standalone toolbar controls; embedded surfaces omit them.
398
- DataAppProps.footerActions?: ReactNode — Standalone footer controls; embedded surfaces omit them.
399
- DataAppProps.footer?: ReactNode — Optional source, coverage, or methodology note below the app content. Compose prose and inline components; typography and spacing are provided.
400
- DataAppProps.csvExport?: CsvExport
401
- DataAppProps.queries?: DisclosedQuery[]
386
+ DataAppProps (type, @altertable/data-app-react): <Data, Input, SummaryViews> = props listed as DataApp.props.*
402
387
  DataAppProvider (component, @altertable/data-app-react/ui): <const Queries extends QueryDefinitions>(props: {…}) — Provide one app identity and shared requests to a custom React root.
403
388
  DataAppProvider.app: DataAppDefinition<Queries>
404
389
  DataAppProvider.children: ReactNode
@@ -461,7 +446,7 @@ Dataset.readSearchSuggestions: (source: ViewSource<Data, Input>) => DataReading<
461
446
  Dataset.read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, readonly Row[]>
462
447
  Dataset.assertSource: (source: object) => void
463
448
  Dataset.name: string
464
- DatasetColumn (type, @altertable/data-app-react): <Row> — Keys supply IDs; accessors supply raw CSV values. Formats affect display only.
449
+ DatasetColumn (type, @altertable/data-app-react): <Row> — Keys supply IDs; accessors supply raw CSV values. Formats affect display only. A column named after a row field reads that field; set `value` for computed columns.
465
450
  DatasetColumn.label?: string
466
451
  DatasetColumn.value: (row: Row) => CsvCell [variant 1 of 4]
467
452
  DatasetColumn.format?: ((row: Row) => ReactNode) [variant 1 of 4]
@@ -473,8 +458,8 @@ DatasetColumn.value: (row: Row) => string | null | undefined [variant 4 of 4]
473
458
  DatasetColumn.format: { kind: 'date'; } & DateFormatOptions [variant 4 of 4]
474
459
  DatasetDefinition (type, @altertable/data-app-react): <Data, Input, Row> — Authoring references are registered by the owning view.
475
460
  DatasetDefinition.name: string
476
- DatasetDefinition.select: (data: Data, input: Input) => readonly Row[]
477
- DatasetDefinition.columns: Record<string, DatasetColumn<NoInfer<Row>>>
461
+ DatasetDefinition.select?: ((data: Data, input: Input) => readonly Row[]) — Rows to bind. Omit when the operation returns the rows themselves.
462
+ DatasetDefinition.columns: Record<string, DatasetFieldColumn<NoInfer<Row>> | DatasetColumn<NoInfer<Row>>>
478
463
  DatasetDefinition.rowKey: (row: NoInfer<Row>) => string | number
479
464
  DatasetDefinition.evidence: EvidenceDeclaration
480
465
  DatasetDefinition.emptyFallback?: EmptyContent
@@ -520,13 +505,7 @@ DataValue.children?: ((values: MetricValues) => ReactNode) [variant 2 of 3]
520
505
  DataValue.dataset: Dataset<Data, Input, Row> [variant 3 of 3]
521
506
  DataValue.children: (rows: readonly Row[]) => ReactNode [variant 3 of 3]
522
507
  DataValue.…: plus props inherited from React
523
- DataValue (component, @altertable/data-app-react/ui): <Value>(props: DataValueProps<Value>) — Bind inline content to displayed data. Keep static wording outside this span.
524
- DataValue.reading: DataReading<Value>
525
- DataValue.loadingFallback: ReactNode
526
- DataValue.children: (value: Value) => ReactNode
527
- DataValue.…: plus props inherited from React
528
508
  DataValueProps (type, @altertable/data-app-react): <Data, Input, Row> = props listed as DataValue.*
529
- DataValueProps (type, @altertable/data-app-react/ui): <Value> = props listed as DataValue.*
530
509
  DataWidget (component, @altertable/data-app-react/ui): <Data>(props: DataWidgetProps<Data>)
531
510
  DataWidget.title: ReactNode
532
511
  DataWidget.headingLevel?: 2 | 3 | 4 | 5 | 6 — Document outline level. The widget title keeps the shared widget-heading appearance.
@@ -679,7 +658,7 @@ defineOperation (function, @altertable/data-app/contract): <Input, Output, const
679
658
  defineOperation.operation.filters?: CheckedOperationFilters<Filters> — Filters the operation reads beside its own input; they are parsed for it.
680
659
  defineOperation.operation.input: (value: unknown) => Input — Parses the operation's own fields, without the filters.
681
660
  defineOperation.operation.checks: readonly [Input, ...Input[]] — Representative valid own inputs; each must pass `input`.
682
- defineOperation.operation.policy: { maxQueryRows: number; maxDurationMs: number; maxResponseBytes?: number | undefined; }
661
+ defineOperation.operation.policy: OperationPolicy
683
662
  defineOperation.operation.run: OperationRun<WithFilterInput<Filters, Input>, Output, Queries>
684
663
  defineOperation.operation.queries: CheckedQueries<Queries>
685
664
  defineOperation.operation.filters?: CheckedOperationFilters<Filters> — The filters `run` reads. Omit for an operation without inputs.
@@ -703,7 +682,7 @@ DetailViewDefinition.id: string
703
682
  DetailViewDefinition.title: ReactNode
704
683
  DetailViewDefinition.parseInput: (input: unknown) => Input — Validates untrusted navigation input before a detail operation can run.
705
684
  DetailViewDefinition.describeInput?: ((input: Input) => string) — Describe the destination's scope. Defaults to the filters its operation reads; supply it to name the record, such as `orders for Customer 042`.
706
- DetailViewDefinition.isEmpty?: ((data: Data) => boolean) — App-owned semantics: measured zero need not mean an empty result. Defaults to never empty.
685
+ DetailViewDefinition.isEmpty?: ((data: Data) => boolean) — App-owned semantics: measured zero need not mean an empty result. Default: A result with no rows is empty; any other result never is.
707
686
  DetailViewDefinition.emptyFallback?: EmptyContent — Inherited by DataSection unless it supplies its own copy.
708
687
  dimensionFilter (function, @altertable/data-app/contract): <const T extends string>(config: DimensionFilterOptions<T>): DimensionFilter<T>; <const T extends number>(config: DimensionFilterOptions<T>): DimensionFilter<T> — A bounded categorical filter with app-owned fixed options.
709
688
  dimensionFilter.config.key: string
@@ -853,7 +832,7 @@ FilterCollection (type, @altertable/data-app/contract): = { [x: string]: SearchF
853
832
  FilterInput (type, @altertable/data-app/contract): <Filters> = keyof Filters extends never ? Record<string, never> : { [Name in keyof Filters]: FilterInputValue<Filters[Name]>; } — An operation's input: one flat field per declared filter.
854
833
  FilterOperationDefinition (type, @altertable/data-app/contract): <Filters, Output, Queries> — An operation that reads app filters. Its input has one field per filter, validated by the filters themselves; views derive their filters, scope, and period from it.
855
834
  FilterOperationDefinition.filters?: CheckedOperationFilters<Filters> — The filters `run` reads. Omit for an operation without inputs.
856
- FilterOperationDefinition.policy: { maxQueryRows: number; maxDurationMs: number; maxResponseBytes?: number | undefined; }
835
+ FilterOperationDefinition.policy: OperationPolicy
857
836
  FilterOperationDefinition.run: OperationRun<FilterInput<Filters>, Output, Queries>
858
837
  FilterPresentation (type, @altertable/data-app/contract): Where a filter's or display option's control renders.
859
838
  FilterPresentation.control?: 'toolbar' | 'widget' — Widget controls render beside their visualization instead of in the toolbar. Scope filters remain available in the Filters sheet and active summaries.
@@ -992,12 +971,11 @@ InputOperationDefinition (type, @altertable/data-app/contract): <Input, Output,
992
971
  InputOperationDefinition.filters?: CheckedOperationFilters<Filters> — Filters the operation reads beside its own input; they are parsed for it.
993
972
  InputOperationDefinition.input: (value: unknown) => Input — Parses the operation's own fields, without the filters.
994
973
  InputOperationDefinition.checks: readonly [Input, ...Input[]] — Representative valid own inputs; each must pass `input`.
995
- InputOperationDefinition.policy: { maxQueryRows: number; maxDurationMs: number; maxResponseBytes?: number | undefined; }
974
+ InputOperationDefinition.policy: OperationPolicy
996
975
  InputOperationDefinition.run: OperationRun<WithFilterInput<Filters, Input>, Output, Queries>
997
976
  isPlainKeyEvent (function, @altertable/data-app-react/ui): (event: KeyEvent, options: {…}): boolean — Keep local key actions separate from shortcuts and IME composition. Pass React's nativeEvent.
998
977
  isPlainKeyEvent.event.…: plus props inherited from built-in
999
978
  isPlainKeyEvent.options.allowShift?: boolean
1000
- isPlainKeyEvent().valueOf: (): boolean — Returns the primitive value of the specified object.
1001
979
  ItemActions (type, @altertable/data-app-react/ui): <Row> = (row: Row) => readonly ExplorationAction[] — Resolves the actions available for a displayed domain row.
1002
980
  JourneyChart (component, @altertable/data-app-react/ui): (props: JourneyChartProps) — Path exploration with two initial steps, expandable prefixes, and three events per depth. Counts and flows use the Step 1 population. Compose inside VisualizationWidget.
1003
981
  JourneyChart.ariaLabel: string — Accessible measure and scope description.
@@ -1085,27 +1063,7 @@ MetricWidget.source: ViewSource<NoInfer<Data>, NoInfer<Input>>
1085
1063
  MetricWidget.records?: MetricRecords<Data, Input, any, any>
1086
1064
  MetricWidget.actions?: ExplorationActions<void, NoInfer<Input>>
1087
1065
  MetricWidget.…: plus props inherited from React
1088
- MetricWidget (component, @altertable/data-app-react/ui): (props: MetricWidgetProps)
1089
- MetricWidget.headingLevel?: 2 | 3 | 4 | 5 | 6 — Document outline level. The label keeps the shared widget-heading appearance.
1090
- MetricWidget.annotationId?: string
1091
- MetricWidget.description?: ReactNode
1092
- MetricWidget.records?: InspectionRecords
1093
- MetricWidget.action?: ReactNode
1094
- MetricWidget.status?: WidgetStatus
1095
- MetricWidget.visual?: ReactNode
1096
- MetricWidget.metric: MetricDefinition [variant 1 of 4]
1097
- MetricWidget.reading: MetricReading [variant 1 of 4]
1098
- MetricWidget.label: string [variants 2, 3, 4 of 4]
1099
- MetricWidget.comparison?: MetricComparison [variants 2, 3, 4 of 4]
1100
- MetricWidget.evidence?: WidgetEvidence [variants 2, 3, 4 of 4]
1101
- MetricWidget.loading: true [variant 2 of 4]
1102
- MetricWidget.loading?: false [variants 3, 4 of 4]
1103
- MetricWidget.value: number [variant 3 of 4]
1104
- MetricWidget.format: MetricFormat [variant 3 of 4]
1105
- MetricWidget.content: string | (string & Iterable<ReactNode>) | (string & Promise<AwaitedReactNode>) | (string & ReactElement<unknown, string | JSXElementConstructor<any>>) | (string & ReactPortal) | undefined [variant 4 of 4]
1106
- MetricWidget.…: plus props inherited from React
1107
1066
  MetricWidgetProps (type, @altertable/data-app-react): <Data, Input> = props listed as MetricWidget.*
1108
- MetricWidgetProps (type, @altertable/data-app-react/ui): = props listed as MetricWidget.* — VisualizationWidget with a formatted metric, optional comparison, and evidence.
1109
1067
  mountDataApp (function, @altertable/data-app-react): <const Queries extends QueryDefinitions>(options: {…}): void — Mount once per browser document; server imports do not mount.
1110
1068
  mountDataApp.options.app: DataAppDefinition<Queries>
1111
1069
  mountDataApp.options.component: ComponentType
@@ -1200,13 +1158,6 @@ parseBooleanSelection.filter.write: (value: BooleanSelection) => Record<string,
1200
1158
  parseBooleanSelection.filter.valid: (value: BooleanSelection) => boolean
1201
1159
  parseBooleanSelection.filter.same: (left: BooleanSelection, right: BooleanSelection) => boolean
1202
1160
  parseCount (function, @altertable/data-app/contract): (value: unknown): number — Accepts numeric strings from DuckDB; rejects negative, fractional, and unsafe integers.
1203
- parseCount().toString: (radix: number): string — Returns a string representation of an object.
1204
- parseCount().toFixed: (fractionDigits: number): string — Returns a string representing a number in fixed-point notation.
1205
- parseCount().toExponential: (fractionDigits: number): string — Returns a string containing a number represented in exponential notation.
1206
- parseCount().toPrecision: (precision: number): string — Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
1207
- parseCount().valueOf: (): number — Returns the primitive value of the specified object.
1208
- parseCount().toLocaleString: (locales: string | string[], options: Intl.NumberFormatOptions): string; (locales: Intl.LocalesArgument, options: Intl.NumberFormatOptions): string — Converts a number to a string by using the current or specified locale.
1209
- parseCount().toLocaleString.options.…: plus props inherited from built-in
1210
1161
  parseDateTime (function, @altertable/data-app/format): (value: DateTimeValue): Date | null — Parse only unambiguous instants. String values must include `Z` or an explicit offset.
1211
1162
  parseDateTimeBound (function, @altertable/data-app/contract): (text: string): AbsoluteOrRelativeDateTime | null — Parse one bound without resolving relative anchors or offsets.
1212
1163
  parseDateTimeRange (function, @altertable/data-app/contract): (value: unknown, options: {…}): DateTimeRange — Validate and restore UTC-rebased dates from JSON, without resolving relative bounds.
@@ -1279,7 +1230,6 @@ parseNumberSelection.filter.same: (left: NumberSelection, right: NumberSelection
1279
1230
  parseNumberSelection.filter.min?: number
1280
1231
  parseNumberSelection.filter.max?: number
1281
1232
  parseTrue (function, @altertable/data-app/contract): (value: unknown): true
1282
- parseTrue().valueOf: (): boolean — Returns the primitive value of the specified object.
1283
1233
  PeriodComparison (type, @altertable/data-app-react)
1284
1234
  PeriodComparison.kind: 'previous' [variant 1 of 2]
1285
1235
  PeriodComparison.kind: 'period' [variant 2 of 2]
@@ -1603,36 +1553,12 @@ TableWidget.title?: ReactNode
1603
1553
  TableWidget.actions?: ExplorationActions<NoInfer<Row>, NoInfer<Input>>
1604
1554
  TableWidget.pagination?: false | { pageSize: number; } [variant 2 of 2] — Local pagination after search: 10 rows by default, false shows all supplied rows. pageSize must be a positive integer. Counts refer only to supplied rows.
1605
1555
  TableWidget.…: plus props inherited from React
1606
- TableWidget (component, @altertable/data-app-react/ui): <Row>(props: TableWidgetProps<Row>)
1607
- TableWidget.title: ReactNode
1608
- TableWidget.headingLevel?: 2 | 3 | 4 | 5 | 6
1609
- TableWidget.annotationId?: string
1610
- TableWidget.showCount?: boolean — Show the matching supplied-row count before pagination or limits. Defaults to true.
1611
- TableWidget.count?: number — Override the derived count, for example with a server total. Hidden when showCount is false or loading.
1612
- TableWidget.onClearFilters?: (() => void) — Clear only filters affecting this dataset. Supply only while those filters are active; enables empty-result recovery.
1613
- TableWidget.description?: ReactNode
1614
- TableWidget.columns: readonly [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]]
1615
- TableWidget.rowKey: (row: Row) => string | number — Unique, nonempty row identity. Numeric keys must be finite; 1 and "1" collide.
1616
- TableWidget.status?: WidgetStatus
1617
- TableWidget.action?: ReactNode
1618
- TableWidget.evidence?: WidgetEvidence [variants 1, 3 of 4]
1619
- TableWidget.search?: TableWidgetSearch<Row>
1620
- TableWidget.emptyFallback: EmptyContent — Valid result with no rows; the header remains visible.
1621
- TableWidget.noMatchesFallback?: EmptyContent — No local search matches or explicitly filtered results. Defaults to “No matching results” with recovery guidance.
1622
- TableWidget.limit: number [variants 1, 2 of 4] — Positive integer preview cap after search; disables pagination.
1623
- TableWidget.rows: readonly Row[] [variants 1, 3 of 4]
1624
- TableWidget.evidence: (WidgetEvidence | undefined) & WidgetEvidence [variants 2, 4 of 4]
1625
- TableWidget.reading: DataReading<readonly Row[]> [variants 2, 4 of 4]
1626
- TableWidget.skeletonRows?: number [variants 2, 4 of 4]
1627
- TableWidget.pagination?: false | { pageSize: number; } [variants 3, 4 of 4] — Local pagination after search: 10 rows by default, false shows all supplied rows. pageSize must be a positive integer. Counts refer only to supplied rows.
1628
- TableWidget.…: plus props inherited from React
1629
1556
  TableWidgetColumn (type, @altertable/data-app-react/ui): <Row>
1630
1557
  TableWidgetColumn.id: string — Stable, nonempty identity; unique within this table.
1631
1558
  TableWidgetColumn.header: ReactNode
1632
1559
  TableWidgetColumn.type?: 'datetime' | 'number'
1633
1560
  TableWidgetColumn.cell: (row: Row, hit?: SearchHit<Row> | undefined) => ReactNode — Render this column's value for one row. The table owns its cell element and semantics.
1634
1561
  TableWidgetProps (type, @altertable/data-app-react): <Row, Data, Input> = props listed as TableWidget.*
1635
- TableWidgetProps (type, @altertable/data-app-react/ui): <Row> = props listed as TableWidget.* — Composes VisualizationWidget with DataTable, search, and local pagination. Columns own header and body semantics; the first column is the row header.
1636
1562
  TableWidgetSearch (type, @altertable/data-app-react): <Row>
1637
1563
  TableWidgetSearch.label: string
1638
1564
  TableWidgetSearch.value: string
@@ -1671,25 +1597,7 @@ TextWidget.title?: ReactNode
1671
1597
  TextWidget.dataset: Dataset<Data, Input, Row> [variant 2 of 2]
1672
1598
  TextWidget.children: (rows: readonly Row[]) => ReactNode [variant 2 of 2]
1673
1599
  TextWidget.…: plus props inherited from React
1674
- TextWidget (component, @altertable/data-app-react/ui): <Data>(props: TextWidgetProps<Data>)
1675
- TextWidget.title: ReactNode
1676
- TextWidget.headingLevel?: 2 | 3 | 4 | 5 | 6 — Document outline level. The widget title keeps the shared widget-heading appearance.
1677
- TextWidget.annotationId?: string — Unique stable target for persisted feedback; overrides automatic evidence identity.
1678
- TextWidget.count?: number — Result count beside the heading. Derive from the displayed result; zero is visible.
1679
- TextWidget.description?: ReactNode
1680
- TextWidget.evidence: (WidgetEvidence | undefined) & WidgetEvidence [variant 1 of 2]
1681
- TextWidget.records?: InspectionRecords — Lazy detail records rendered as the first inspection tab.
1682
- TextWidget.action?: ReactNode
1683
- TextWidget.status?: WidgetStatus — Reserved feedback slot; retain displayed content while refreshing or after failure.
1684
- TextWidget.footer?: ReactNode
1685
- TextWidget.emptyFallback?: EmptyContent
1686
- TextWidget.reading: DataReading<Data> [variant 1 of 2]
1687
- TextWidget.children: (data: Data) => ReactNode [variant 1 of 2]
1688
- TextWidget.evidence?: WidgetEvidence [variant 2 of 2]
1689
- TextWidget.children: ReactNode [variant 2 of 2]
1690
- TextWidget.…: plus props inherited from React
1691
1600
  TextWidgetProps (type, @altertable/data-app-react): <Data, Input, Row> = props listed as TextWidget.*
1692
- TextWidgetProps (type, @altertable/data-app-react/ui): <Data> = props listed as TextWidget.* — Narrative sibling of VisualizationWidget, composing DataWidget with TextContent. Use TextContent directly for borderless prose. Bind claims and scope to the same displayed reading.
1693
1601
  Theme (type, @altertable/data-app/appearance): = 'dark' | 'light' — Appearance configured by app authors.
1694
1602
  ThemePreference (type, @altertable/data-app/appearance): = 'system' | Theme
1695
1603
  Tooltip (component, @altertable/data-app-react, @altertable/data-app-react/ui): (props: TooltipProps) — Supplemental, non-interactive description for one already labeled control. Supply a single child that forwards aria-describedby to its focusable DOM element.
@@ -1754,33 +1662,7 @@ VisualizationWidget.views: readonly VisualizationWidgetView<Row>[] [variant 2 of
1754
1662
  VisualizationWidget.viewLabel: string [variant 2 of 2]
1755
1663
  VisualizationWidget.initialView?: string [variant 2 of 2]
1756
1664
  VisualizationWidget.…: plus props inherited from React
1757
- VisualizationWidget (component, @altertable/data-app-react/ui): <Data>(props: VisualizationWidgetProps<Data>) — Compose an unframed visual with the shared heading and inspection.
1758
- VisualizationWidget.title: ReactNode
1759
- VisualizationWidget.headingLevel?: 2 | 3 | 4 | 5 | 6 — Document outline level. The widget title keeps the shared widget-heading appearance.
1760
- VisualizationWidget.annotationId?: string — Unique stable target for persisted feedback; overrides automatic evidence identity.
1761
- VisualizationWidget.count?: number — Result count beside the heading. Derive from the displayed result; zero is visible.
1762
- VisualizationWidget.description?: ReactNode
1763
- VisualizationWidget.evidence?: (Omit<AboutSubject, 'description' | 'id' | 'references' | 'title' | 'visual' | 'visualKind'> & { id: string; } & { glossaryIds: [string, ...string[]]; queryNames?: string[] | undefined; }) | (Omit<...> & ... 1 more ... & { ...; }) | (Omit<...> & ... 2 more ... & { ...; }) | (Omit<...> & ... 2 more… [variants 1, 2 of 4]
1764
- VisualizationWidget.records?: InspectionRecords — Lazy detail records rendered as the first inspection tab.
1765
- VisualizationWidget.action?: ReactNode
1766
- VisualizationWidget.status?: WidgetStatus — Reserved feedback slot; retain displayed content while refreshing or after failure.
1767
- VisualizationWidget.emptyFallback?: EmptyContent
1768
- VisualizationWidget.footer?: ReactNode — Footer controls, such as table pagination.
1769
- VisualizationWidget.loading: true [variant 1 of 4]
1770
- VisualizationWidget.loadingContent?: ReactNode [variant 1 of 4]
1771
- VisualizationWidget.loading?: false [variant 2 of 4]
1772
- VisualizationWidget.visual: ReactNode [variant 2 of 4]
1773
- VisualizationWidget.evidence: ((Omit<AboutSubject, 'description' | 'id' | 'references' | 'title' | 'visual' | 'visualKind'> & { id: string; } & { glossaryIds: [string, ...string[]]; queryNames?: string[] | undefined; }) | (Omit<...> & ... 1 more ... & { ...; }) | (Omit<...> & ... 2 more ... & { ...; }) | (Omit<...> & ... 2 more… [variants 3, 4 of 4]
1774
- VisualizationWidget.reading: DataReading<Data> [variants 3, 4 of 4]
1775
- VisualizationWidget.isEmpty: (data: Data) => boolean [variants 3, 4 of 4]
1776
- VisualizationWidget.skeleton?: SkeletonContent [variants 3, 4 of 4]
1777
- VisualizationWidget.children: (data: Data) => ReactNode [variant 3 of 4]
1778
- VisualizationWidget.views: readonly VisualizationWidgetView<Data>[] [variant 4 of 4]
1779
- VisualizationWidget.viewLabel: string [variant 4 of 4]
1780
- VisualizationWidget.initialView?: string [variant 4 of 4] — An existing view ID; defaults to the first view. Validated while loading too.
1781
- VisualizationWidget.…: plus props inherited from React
1782
1665
  VisualizationWidgetProps (type, @altertable/data-app-react): <Row, Data, Input> = props listed as VisualizationWidget.*
1783
- VisualizationWidgetProps (type, @altertable/data-app-react/ui): <Data> = props listed as VisualizationWidget.* — DataWidget frame for charts, DataTable, metrics, or a custom data display. Owns alternate-view selection and shares it with inspection.
1784
1666
  VisualizationWidgetView (type, @altertable/data-app-react): <Row>
1785
1667
  VisualizationWidgetView.id: string — Stable, nonempty identity; unique within this widget.
1786
1668
  VisualizationWidgetView.label: ReactNode
@@ -1097,8 +1097,12 @@ function defineQueryNames(names) {
1097
1097
  invariant(values.every((name) => !!name.trim()) && new Set(values).size === values.length, "Query names must be nonempty and unique.");
1098
1098
  return names;
1099
1099
  }
1100
+ const DEFAULT_MAX_DURATION_MS = 15e3;
1100
1101
  function defineOperation(operation) {
1101
- const { policy } = operation;
1102
+ const policy = {
1103
+ ...operation.policy,
1104
+ maxDurationMs: operation.policy.maxDurationMs ?? DEFAULT_MAX_DURATION_MS
1105
+ };
1102
1106
  invariant(Number.isInteger(policy.maxQueryRows) && policy.maxQueryRows > 0 && policy.maxQueryRows <= 1e4 && Number.isInteger(policy.maxDurationMs) && policy.maxDurationMs > 0 && (policy.maxResponseBytes === void 0 || Number.isInteger(policy.maxResponseBytes) && policy.maxResponseBytes > 0), `Each data operation needs positive row and duration limits, with at most ${MAX_QUERY_ROWS.toLocaleString("en-US")} rows.`);
1103
1107
  const contract = operationInputContract(operation);
1104
1108
  const queries = snapshotQueries(operation.queries);
@@ -1177,10 +1181,7 @@ function connectionCheck(queries) {
1177
1181
  const connection = queries.connection;
1178
1182
  return defineOperation({
1179
1183
  queries: { connection },
1180
- policy: {
1181
- maxQueryRows: 1,
1182
- maxDurationMs: 15e3
1183
- },
1184
+ policy: { maxQueryRows: 1 },
1184
1185
  async run({ query }) {
1185
1186
  await query("connection");
1186
1187
  return true;
@@ -1585,4 +1586,4 @@ var DataSourceError = class extends Error {
1585
1586
  //#endregion
1586
1587
  export { snapshotQueries as $, resolvedDateTimeRangeParams as A, resolveFilterInput as B, parseCount as C, dateTimeRangePresets as D, dateTimeRangeFilter as E, numberOperatorLabels as F, searchFilter as G, defineAppFilters as H, parseBooleanSelection as I, bindDimensionSource as J, validateChoiceOptions as K, parseNumberSelection as L, facetSource as M, booleanFilter as N, queryDateTimeRangeParams as O, numberFilter as P, REGISTERED_QUERY_ID_PATTERN as Q, combineOperationFilters as R, defineQueryNames as S, parseTrue as T, displayChoice as U, choiceFilter as V, multiChoiceFilter as W, withDimensionSelectors as X, dimensionSource as Y, MAX_QUERY_ROWS as Z, navigationUpdateRoute as _, annotationDraftRoute as a, parseDimensionSelection as at, connectionCheck as b, annotationSendRoute as c, parseDataAppAnnotationDraft as d, unsupportedParameterReference as et, MessageRoutingError as f, defineMessageRoute as g, defineDataOperationRoute as h, resolveExternalLinkTarget as i, dimensionPredicate as it, facetFilter as j, dateTimeRangeSql as k, annotationUpdateRoute as l, dataAppRoutes as m, openExternalLinkRoute as n, dimensionFilter as nt, annotationEditorStateRoute as o, parseFacetOptions as ot, createMessageRouter as p, DimensionMembershipError as q, parseExternalUrl as r, dimensionMemberKey as rt, annotationModeRoute as s, KEY_SEPARATOR as st, DataSourceError as t, createDimensionFilter as tt, isAnnotationPresentation as u, registeredQueryRoute as v, parseLabel as w, defineOperation as x, validLocation as y, dateFilterName as z };
1587
1588
 
1588
- //# sourceMappingURL=contract-gu1rDsV0.js.map
1589
+ //# sourceMappingURL=contract-BTG-BUwW.js.map