The state of one Cube page (PLAN §7.8). The document is immutable: every edit makes a new one through applyDocument, which keeps the previous one for undo. Domain and port values are held by reference, never observed deeply.

Implements

  • CommandRegistrar

Constructors

Properties

copiedNode: undefined | { context: undefined | CubeContext; node: QueryNode }

The step copied last, as it was, with the cube's context then, which a pasted source needs; kept for the page, across cubes

dataProductRuntime: CubeDataProductRuntimeState

Where a lakehouse cube runs, a data product's or an ingest one's: its class and warehouse

devSettings: CubeDevSettingsState

The Dev Settings, at the top left (PLAN §11.16)

document: CubeDocument
examples: CubeExamplesState
execution: CubeExecutionState
export: CubeExportState

The results' export (spec §12.5)

grid: CubeGridState

The grid's mode and its server-side levels (PLAN §11.10)

gridFetcher: CubeGridFetcher

The grid's server-side levels (PLAN §11.10)

history: readonly CubeDocument[] = []

Earlier documents, oldest first

host: CubeHost
hostIssues: ReadonlyMap<string, CubeHostIssue> = ...

Engine errors by node id: shown with the node's own errors, never part of inference

isPaletteCollapsed: boolean

The palette shows icons only; kept per user, never in the cube

jsonExplorer: CubeJsonExplorerState

Explore JSON: a Variant column's fields, and the columns they can become (PLAN §11.20)

jsonViewer: CubeJsonViewerState = ...

Open JSON: a Variant cell's document as a tree (PLAN §11.20)

lambdaImport: CubeLambdaImportState

Import Pure: the lambda the page opened on, read into the cube (PLAN §11.18)

nodeEditor: CubeNodeEditorState
readOnly: boolean = false

The cube was saved by a newer version of Cube: it can be viewed and run, but not changed, undone or exported (Settled before M1.8)

redoStack: readonly {
    document: CubeDocument;
    opensAnotherCube: boolean;
    readOnly: boolean;
}[] = []

The changes undone, the latest last, to redo; a new change clears them. Each keeps whether it was read-only and whether undoing it left another cube (an import), so a redo restores both

registry: NodeRegistry

One registry for inference, emission and the saved spec

rowLimit: number

The rows a run returns; kept per user, never in the cube

runStats: CubeRunStatsState

The latest runs, fetches and exports (spec §12.6)

showPure: CubeShowPureState
sourcePicker: CubeSourcePickerState
specTransfer: CubeSpecTransferState
tour: CubeTourState

The editor's guided tour (PLAN §11.21)

warnings: ReadonlyMap<number, readonly string[]> = ...

Warnings by node key, e.g. a table that changed since the cube was saved: shown on the node, never errors, and gone once the node is replaced

Accessors

  • get analysis(): SchemaInferenceResult

    Each node's schema and errors, query-level rules included, as the emitter sees them; an Extend or a Filter by Expression checked for another input than its own waiting, and a filter its database would misread refused, which only the editor can tell

    Returns SchemaInferenceResult

  • get derivedWarnings(): ReadonlyMap<string, readonly string[]>

    Warnings worked out from the query, by node id: a Sort whose order is lost before it is used (PLAN §11.4). Never stored and never errors, so Execute stays enabled; they go as soon as the query no longer loses it. A partial loss names each node that removes some of the Sort's columns, then the columns that came after a removed one. A loss waits until the Sort and every node it names have no errors, e.g. a Restrict just added, with no column yet: their own errors come first.

    Returns ReadonlyMap<string, readonly string[]>

  • get nodesToCheck(): readonly CubeEngineCheckedNode[]

    The Extends and Filters by Expression of the cube shown that wait for the engine, their input valid, and that aren't being checked (PLAN §11.7, §11.11): new expressions, or an input that changed

    Returns readonly CubeEngineCheckedNode[]

  • get offeredSources(): readonly SourceDefinition<SourceNode>[]

    The kinds of source the host serves: data products, ingest data sets and services only with their catalogs, tables and functions only with a tab that reads them (Studio offers ingest data sets alone). The cube's kind may still disable one (canAddNode)

    Returns readonly SourceDefinition<SourceNode>[]

Methods

  • Adds a node made elsewhere, with its settings, as the grid's quick actions do (spec §12.4): spliced in after afterId, so it becomes the node that runs when that one did, as one undo step. Does nothing in a read-only cube, or when the query can't take it.

    Parameters

    Returns void

  • Adds nodes made elsewhere one after another, the first spliced in after afterId, as one undo step, the last then running when that one did (Explore JSON's Extend then Explode Array). Does nothing in a read-only cube, or when the query can't take one of them.

    Parameters

    • nodes: readonly QueryNode[]
    • OptionalafterId: string

    Returns void

  • Adds a Join after afterId with rightId as its Right input, as one step to undo (user, 2026-10-16), after the node editor's edits are applied: it takes the join columns that are clearly it, the model's outline read first for the database's joins, and its editor opens. Gives the Join's id, or nothing when it can't be added any more.

    Parameters

    • afterId: string
    • rightId: string

    Returns GeneratorFn<undefined | string>

  • Adds a node of the type (spec §17.4), the low-level add that CubeAddPlacement places for the palette, drops and menus: a transform with its default settings, unconnected or spliced in after afterId; a source opens the source picker, which adds it once the engine has typed it. Does nothing canAddNode refuses.

    Parameters

    • type: string
    • OptionalafterId: string

    Returns undefined | string

  • Whether a node of the type can be added: a transform, unconnected or spliced in after afterId, when the query allows it; a source only unconnected, through the source picker. Never while the cube is read-only. The low-level rule: the palette, drops and menus place nodes through CubeAddPlacement (PLAN §11.8).

    Parameters

    • type: string
    • OptionalafterId: string

    Returns boolean

  • Checks expressions with the engine, in one call, outside the undo history (PLAN §11.7 Q4, §11.11): an Extend's columns typed, a Filter by Expression's condition checked, each for the input it has now, after its input's relation, as typing types any node. The check goes in place of the very nodes sent, in the cube shown and the undo snapshots that give the engine the same input; one the user changed meanwhile is left to check again. Each check records the input as the engine was given it (upstream). A check the engine couldn't give says why; when the engine can't be reached, a check still current for the input is kept, with a warning, as a source's saved columns are.

    Parameters

    • nodes: readonly CubeEngineCheckedNode[]

    Returns GeneratorFn<void>

  • Feeds a node into another, on the port if given, else the first free one. Does nothing when the query doesn't allow it or the cube is read-only.

    Parameters

    • sourceId: string
    • targetId: string
    • Optionalport: string

    Returns void

  • Execute, as its button and F9 do (spec §17.5): finishes the node editor first, so the edits run, then runs the query if it can; runs nothing when the edits had to be dropped, since the run would not be what the user edited

    Returns void

  • Why a node of the type can't be added after the node, on the database the query up to that node runs on (PLAN §11.12): a Pivot where it can't run. undefined when it can, or the database isn't known.

    Parameters

    • type: string
    • afterId: undefined | string

    Returns undefined | string

  • The join columns to suggest for two nodes joined, strongest first (user, 2026-10-16), from their output schemas, the tables their columns come from and the model's outline, when loaded; none until both are typed

    Parameters

    • leftId: string
    • rightId: string

    Returns CubeJoinKeySuggestion[]

  • A node's problems on the database the query up to it runs on, with the cube's runtime (getRunDatabaseType): a Pivot where it can't run (PLAN §11.12); a filter giving % or _ to a pattern on DuckDB, which would match them as wildcards (§11.11). None when the database isn't known.

    Parameters

    Returns string[]

  • The database type a run of the query up to the node needs, with the model's runtime (PLAN §11.4): for a data product or ingest cube, the database its lakehouse runtime routes to (§11.12); else, from the model's outline once it is loaded (loadModelOutline), the type of the runtime's connections to the databases the node reads. None without an outline, which writes every operation the native way.

    Parameters

    Returns undefined | string

  • Loads the outline of a model, the cube's by default, once per model: a load already on its way is waited for, not started again, e.g. a run's while the cube's opening load is still out. It only adds warnings, database types and a database's refusals (PLAN §11.11, §11.12), so a model that fails to load shows none and runs every operation the native way.

    Parameters

    Returns GeneratorFn<void>

  • Types a source again, from its Source panel (spec §17.6), as a re-check after an import does: a table with the engine, an access point through the catalog. No undo step, nothing changes when its columns are the same, and a warning lists any change.

    Parameters

    • nodeId: string

    Returns GeneratorFn<void>

  • The page's keyboard shortcuts, while it is open (spec §17.12). Each does nothing when its button can't be used, and nothing while a Cube dialog is open, since a dialog doesn't stop the app's shortcuts (user's choice, 2026-10-07), or while something opened from the node editor holds it open. Like their buttons, they finish the node editor first (PLAN §11.8): F9 runs the edited query, and Ctrl+Z undoes what finishing applied. Undo leaves Ctrl+Z to a text field that has the focus.

    Returns void

  • Removes a node, healing the chain around it. Removing the last node also clears the cube's model and runtime, in the same undo step, so the next table can come from any model (user's choice, 2026-10-07).

    Parameters

    • nodeId: string

    Returns void

  • Types the cube's sources again, outside the undo history (PLAN §10.3, Settled before M1.8): its tables in one engine call, a data product cube's access points through the catalog, from the deployed artifact at the cube's version (PLAN §6.8). Warnings name the kind of source:

    • a table whose columns are the saved ones is left as it is;
    • a table that changed takes its new columns, with a warning listing the changes;
    • a table with saved columns that can't be typed keeps them, with a warning; one without them shows the engine's error.

    Then filter values saved as invalid text are read again against the columns. The answer goes to every document holding the very source objects that were typed: the cube shown and the undo snapshots taken meanwhile, so undoing an edit made while the tables were typed keeps them typed. A source the user changed meanwhile is a new object, and is left alone.

    only types just these sources of the cube shown, e.g. one Refresh. A table found unchanged loses any earlier warning. fresh reads a data product's artifact again rather than what this page visit read.

    Parameters

    • Optionalonly: readonly RecheckedSource[]
    • fresh: boolean = false

    Returns GeneratorFn<void>

  • Keeps a grid column's width, which the cube saves (PLAN §11.10): by the column's name, in any case. Presentation the user sets by dragging, so no undo step, and the rows stay current.

    Parameters

    • column: string
    • width: number

    Returns void

  • Restores the document before the last edit; does nothing when there is no history. A restored query is a new object (PLAN §4.3), so rows that ran before the edit show as stale. An edit that left the query and the context alone, such as a rename, keeps them, with the rows and engine errors; undoing a warehouse edit brings back the context the rows ran with. Undoing an import closes the node editor and the picker, as the import did.

    Returns void