@cube-dev/embed-sdk
Advanced tools
+973
| /// <reference types="@/base-types" /> | ||
| /// <reference types="react" /> | ||
| import { Aggregate } from 'vega-lite/build/aggregate'; | ||
| import { AutoSizeParams } from 'vega-lite/build/spec/toplevel'; | ||
| import { AutosizeType } from 'vega-lite/build/spec/toplevel'; | ||
| import { CompositeAggregate } from 'vega-lite/build/compositemark'; | ||
| import { Config } from 'vega-lite/build'; | ||
| import { Data } from 'vega-lite/build/data'; | ||
| import { Datasets } from 'vega-lite/build/spec/toplevel'; | ||
| import { Dict } from 'vega-lite/build'; | ||
| import { ExprRef } from 'vega-lite/build/expr'; | ||
| import { Field } from 'vega-lite/build/channeldef'; | ||
| import { JSX } from 'react/jsx-runtime'; | ||
| import { LayoutAlign } from 'vega-typings/types'; | ||
| import { Padding } from 'vega-lite/build/spec/toplevel'; | ||
| import { Projection } from 'vega-lite/build/projection'; | ||
| import { default as React_2 } from 'react'; | ||
| import { ReactNode } from 'react'; | ||
| import { Resolve } from 'vega-lite/build/resolve'; | ||
| import { RowCol } from 'vega-lite/build/vega.schema'; | ||
| import { SignalRef } from 'vega-typings/types'; | ||
| import { StandardType } from 'vega-lite/build/type'; | ||
| import { Step } from 'vega-lite/build/spec/base'; | ||
| import { TCubeDimension } from '@cubejs-client/core'; | ||
| import { TCubeFolder } from '@cubejs-client/core'; | ||
| import { TCubeMeasure } from '@cubejs-client/core'; | ||
| import { TCubeMemberType } from '@cubejs-client/core'; | ||
| import { Text as Text_2 } from 'vega-typings/types'; | ||
| import { TitleParams } from 'vega-lite/build/title'; | ||
| import { TopLevelParameter } from 'vega-lite/build/spec/toplevel'; | ||
| import { TopLevelSpec } from 'vega-lite/build'; | ||
| import { TopLevelSpec as TopLevelSpec_2 } from 'vega-lite'; | ||
| import { TopLevelUnitSpec } from 'vega-lite/build/spec/unit'; | ||
| import { Transform } from 'vega-lite/build/transform'; | ||
| import { UseQueryResult } from '@tanstack/react-query'; | ||
| import { ViewBackground } from 'vega-lite/build/spec/base'; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare const applyChartTemplate: (chartTemplate: VegaChartTemplateType, vegaSpec: TopLevelUnitSpec<Field>, columns: ChartColumn[]) => TopLevelUnitSpec<Field> | { | ||
| mark: { | ||
| type: string; | ||
| }; | ||
| encoding: { | ||
| theta: { | ||
| axis?: { | ||
| format: string | undefined; | ||
| } | undefined; | ||
| sort?: "ascending" | "descending" | "null" | undefined; | ||
| timeUnit?: string | undefined; | ||
| stack?: "normalize" | "zero" | undefined; | ||
| aggregate?: "sum" | undefined; | ||
| field: string; | ||
| title: string; | ||
| type: "ordinal" | "quantitative" | "temporal" | "nominal"; | ||
| } | undefined; | ||
| color: { | ||
| axis?: { | ||
| format: string | undefined; | ||
| } | undefined; | ||
| sort?: "ascending" | "descending" | "null" | undefined; | ||
| timeUnit?: string | undefined; | ||
| stack?: "normalize" | "zero" | undefined; | ||
| aggregate?: "sum" | undefined; | ||
| field: string; | ||
| title: string; | ||
| type: "ordinal" | "quantitative" | "temporal" | "nominal"; | ||
| } | undefined; | ||
| tooltip: { | ||
| field: string; | ||
| aggregate: Aggregate | CompositeAggregate | undefined; | ||
| title: string; | ||
| type: StandardType; | ||
| format: string | undefined; | ||
| }[]; | ||
| }; | ||
| projection?: Projection<ExprRef> | undefined; | ||
| params?: TopLevelParameter[] | undefined; | ||
| title?: Text_2 | TitleParams<SignalRef | ExprRef> | undefined; | ||
| name?: string | undefined; | ||
| description?: string | undefined; | ||
| data: (Data | null | undefined) & Data; | ||
| transform?: Transform[] | undefined; | ||
| resolve?: Resolve | undefined; | ||
| align?: LayoutAlign | RowCol<LayoutAlign> | undefined; | ||
| center?: boolean | RowCol<boolean> | undefined; | ||
| spacing?: number | RowCol<number> | undefined; | ||
| bounds?: "full" | "flush" | undefined; | ||
| view?: ViewBackground<SignalRef | ExprRef> | undefined; | ||
| width?: number | "container" | Step | undefined; | ||
| height?: number | "container" | Step | undefined; | ||
| background?: string | SignalRef | ExprRef | undefined; | ||
| padding?: SignalRef | ExprRef | Padding | undefined; | ||
| autosize?: AutosizeType | AutoSizeParams | undefined; | ||
| $schema?: string | undefined; | ||
| config?: Config<SignalRef | ExprRef> | undefined; | ||
| datasets?: Datasets | undefined; | ||
| usermeta?: Dict<unknown> | undefined; | ||
| } | { | ||
| mark: { | ||
| type: string; | ||
| }; | ||
| encoding: { | ||
| x: { | ||
| axis?: { | ||
| format: string | undefined; | ||
| } | undefined; | ||
| sort?: "ascending" | "descending" | "null" | undefined; | ||
| timeUnit?: string | undefined; | ||
| stack?: "normalize" | "zero" | undefined; | ||
| aggregate?: "sum" | undefined; | ||
| field: string; | ||
| title: string; | ||
| type: "ordinal" | "quantitative" | "temporal" | "nominal"; | ||
| } | undefined; | ||
| y: { | ||
| axis?: { | ||
| format: string | undefined; | ||
| } | undefined; | ||
| sort?: "ascending" | "descending" | "null" | undefined; | ||
| timeUnit?: string | undefined; | ||
| stack?: "normalize" | "zero" | undefined; | ||
| aggregate?: "sum" | undefined; | ||
| field: string; | ||
| title: string; | ||
| type: "ordinal" | "quantitative" | "temporal" | "nominal"; | ||
| } | undefined; | ||
| tooltip: { | ||
| field: string; | ||
| aggregate: Aggregate | CompositeAggregate | undefined; | ||
| title: string; | ||
| type: StandardType; | ||
| format: string | undefined; | ||
| }[]; | ||
| }; | ||
| projection?: Projection<ExprRef> | undefined; | ||
| params?: TopLevelParameter[] | undefined; | ||
| title?: Text_2 | TitleParams<SignalRef | ExprRef> | undefined; | ||
| name?: string | undefined; | ||
| description?: string | undefined; | ||
| data: (Data | null | undefined) & Data; | ||
| transform?: Transform[] | undefined; | ||
| resolve?: Resolve | undefined; | ||
| align?: LayoutAlign | RowCol<LayoutAlign> | undefined; | ||
| center?: boolean | RowCol<boolean> | undefined; | ||
| spacing?: number | RowCol<number> | undefined; | ||
| bounds?: "full" | "flush" | undefined; | ||
| view?: ViewBackground<SignalRef | ExprRef> | undefined; | ||
| width?: number | "container" | Step | undefined; | ||
| height?: number | "container" | Step | undefined; | ||
| background?: string | SignalRef | ExprRef | undefined; | ||
| padding?: SignalRef | ExprRef | Padding | undefined; | ||
| autosize?: AutosizeType | AutoSizeParams | undefined; | ||
| $schema?: string | undefined; | ||
| config?: Config<SignalRef | ExprRef> | undefined; | ||
| datasets?: Datasets | undefined; | ||
| usermeta?: Dict<unknown> | undefined; | ||
| }; | ||
| declare interface BaseKpiChartItem { | ||
| id?: string; | ||
| title?: string; | ||
| description?: string; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare const blankVegaSpec: TopLevelSpec_2; | ||
| declare type CalculatedField = { | ||
| id?: string; | ||
| name: string; | ||
| expression: string; | ||
| semanticView?: string; | ||
| type: 'number' | 'string' | 'boolean' | 'time'; | ||
| memberType?: 'measure' | 'dimension'; | ||
| format?: 'currency' | 'percent' | 'number' | 'id' | 'link' | 'imageUrl' | null; | ||
| title?: string | null; | ||
| custom?: boolean; | ||
| shortTitle?: string | null; | ||
| description?: string | null; | ||
| aliasMember?: string | null; | ||
| }; | ||
| /** | ||
| * Checks if a chart template can be applied to the given columns | ||
| * @param templateType - The template type to check | ||
| * @param columns - The current chart columns | ||
| * @returns true if the template can be applied, false otherwise | ||
| * @public | ||
| */ | ||
| export declare const canApplyTemplate: (templateType: VegaChartTemplateType, columns: ChartColumn[]) => boolean; | ||
| /** | ||
| * | ||
| * @export | ||
| * @interface CertifiedQueryResponse | ||
| */ | ||
| export declare interface CertifiedQueryResponse { | ||
| /** | ||
| * Agent space ID this certified query belongs to | ||
| * @type {number} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'agentSpaceId': number; | ||
| /** | ||
| * | ||
| * @type {CertifiedQueryResponseCreatedAt} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'createdAt': CertifiedQueryResponseCreatedAt; | ||
| /** | ||
| * Description of the certified query | ||
| * @type {string} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'description'?: string; | ||
| /** | ||
| * Unique identifier of the certified query | ||
| * @type {number} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'id': number; | ||
| /** | ||
| * SQL query string | ||
| * @type {string} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'sqlQuery': string; | ||
| /** | ||
| * | ||
| * @type {CertifiedQueryResponseUpdatedAt} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'updatedAt': CertifiedQueryResponseUpdatedAt; | ||
| /** | ||
| * Original user request that generated this query | ||
| * @type {string} | ||
| * @memberof CertifiedQueryResponse | ||
| */ | ||
| 'userRequest': string; | ||
| } | ||
| /** | ||
| * @type CertifiedQueryResponseCreatedAt | ||
| * Creation timestamp | ||
| * @export | ||
| */ | ||
| declare type CertifiedQueryResponseCreatedAt = string; | ||
| /** | ||
| * @type CertifiedQueryResponseUpdatedAt | ||
| * Last update timestamp | ||
| * @export | ||
| */ | ||
| declare type CertifiedQueryResponseUpdatedAt = string; | ||
| declare interface ChartBuilderContextValue { | ||
| activeReport: any; | ||
| updateReportLocally: (reportId: number, update: any) => void; | ||
| chartColumns: ChartColumn[]; | ||
| tableData?: { | ||
| data: any; | ||
| columns: any; | ||
| pivots?: TablePivot[]; | ||
| } | null; | ||
| updateChartCategory: (chartCategory: ChartCategory) => void; | ||
| currentChartCategory: ChartCategory; | ||
| tableChartSpec: TableChartSpec; | ||
| updateTableChartSpec: (update: Partial<TableChartSpec>) => void; | ||
| kpiChartSpec: KpiChartSpec; | ||
| updateKpiChartSpec: (update: Partial<KpiChartSpec>) => void; | ||
| htmlChartSpec: HtmlChartSpec; | ||
| updateHtmlChartSpec: (update: Partial<HtmlChartSpec>) => void; | ||
| mapChartSpec: MapChartSpec; | ||
| updateMapChartSpec: (update: Partial<MapChartSpec>) => void; | ||
| applyChartTemplate: (chartCategory: ChartCategory, spec?: VegaChartTemplateType) => void; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare function ChartBuilderProvider({ children }: ChartBuilderProviderProps): JSX.Element; | ||
| declare interface ChartBuilderProviderProps { | ||
| children: ReactNode; | ||
| } | ||
| declare type ChartCategory = 'vega' | 'table' | 'kpi' | 'html' | 'map'; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type ChartColumn = { | ||
| name: string; | ||
| sqlSchemaName: string; | ||
| title: string; | ||
| memberType: 'measure' | 'dimension' | 'timeDimension'; | ||
| columnType: 'time' | 'number' | 'string' | 'boolean'; | ||
| /** | ||
| * When the column originates from a DATE_TRUNC expression we capture the selected grain | ||
| * (e.g. 'day', 'week', 'month', 'year', etc.). | ||
| * This allows downstream chart utilities to automatically set the appropriate | ||
| * Vega-Lite `timeUnit` so that the axis ticks and tooltips match the truncated value. | ||
| */ | ||
| grain?: string; | ||
| /** | ||
| * A function to format values for display | ||
| */ | ||
| format?: (value: string) => string; | ||
| formatString?: string; | ||
| hasDrillMembers?: boolean; | ||
| }; | ||
| declare type ChartKind = 'html' | 'kpi' | 'map' | 'table' | 'vega'; | ||
| declare type ColumnFormatOverride = { | ||
| type: ColumnFormatType; | ||
| decimalPlaces?: number; | ||
| } | string; | ||
| declare type ColumnFormatType = 'currency' | 'percent' | 'number'; | ||
| declare interface ColumnSchema { | ||
| name: string; | ||
| column_type: string; | ||
| } | ||
| declare type ColumnType = 'number' | 'string' | 'time' | 'boolean'; | ||
| declare type ColumnType_2 = 'time' | 'number' | 'string' | 'boolean'; | ||
| /** | ||
| * Helper to create default report | ||
| * @public | ||
| */ | ||
| export declare function createDefaultReport(): Report_2; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare const CubeApiContextProvider: React_2.NamedExoticComponent<StandaloneProps>; | ||
| declare interface CustomDimensionResult { | ||
| name: string; | ||
| sql: string; | ||
| title?: string; | ||
| format?: string; | ||
| alias?: string; | ||
| } | ||
| declare interface CustomMeasureResult { | ||
| name: string; | ||
| sql: string; | ||
| title?: string; | ||
| format?: string; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare interface DataAsset { | ||
| id: string; | ||
| name: string; | ||
| type: DataAssetType; | ||
| measures: Measure[]; | ||
| dimensions: Dimension[]; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| declare type DataAssetMember = (Dimension | Measure | CalculatedField) & { | ||
| isSelected?: boolean; | ||
| isCustom?: boolean; | ||
| }; | ||
| /** | ||
| * Minimal agent interface for DataAssetsContextProvider. | ||
| * Avoids importing full Agent type which chains to ai-engineer openapi-axios. | ||
| * @public | ||
| */ | ||
| export declare type DataAssetsAgent = { | ||
| accessibleViews?: string[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type DataAssetsContextContextType = { | ||
| selectedDataAssetId: string | null | undefined; | ||
| setSelectedDataAssetId: (id: string | null | undefined) => void; | ||
| isDataAssetsExpanded: boolean; | ||
| toggleDataAssetsExpanded: () => void; | ||
| dataAssets: DataAsset[] | null; | ||
| getDataAssetById: (id: string) => any; | ||
| selectedDataAsset: DataAsset | SemanticView | undefined; | ||
| dataAssetsLoading: boolean; | ||
| semanticViews: SemanticView[]; | ||
| cubeTitleMap: Record<string, string>; | ||
| refetchDataAssets: UseQueryResult<DataAssetsResponse | undefined>['refetch']; | ||
| hasFetchedAssets: boolean; | ||
| dataAssetsError: Error | null; | ||
| hasNoSemanticViews: boolean; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare function DataAssetsContextProvider({ agent, children }: DataAssetsContextProviderProps): JSX.Element; | ||
| /** | ||
| * @public | ||
| */ | ||
| declare type DataAssetsContextProviderProps = { | ||
| children: React_2.ReactNode; | ||
| agent?: DataAssetsAgent; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type DataAssetsResponse = { | ||
| dataAssets: DataAsset[]; | ||
| semanticViews: any[]; | ||
| cubeTitleMap: Record<string, string>; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type DataAssetType = 'cube:cube' | 'cube:view' | 'table'; | ||
| declare type DataBinding = { | ||
| type: 'column'; | ||
| column: string; | ||
| rowIndex?: number; | ||
| fallback?: string | number | boolean | null; | ||
| } | { | ||
| type: 'literal'; | ||
| value: string | number | boolean | null; | ||
| } | { | ||
| type: 'template'; | ||
| template: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type Dimension = TCubeDimension & { | ||
| memberType?: 'dimension'; | ||
| title?: string; | ||
| }; | ||
| declare interface DimensionResult { | ||
| name: string; | ||
| sql: string; | ||
| grain?: string; | ||
| alias?: string; | ||
| title?: string; | ||
| format?: string; | ||
| } | ||
| declare interface DrillDownContext { | ||
| /** The column/member that was clicked */ | ||
| memberName: string; | ||
| /** The data value that was clicked (optional) */ | ||
| value?: any; | ||
| /** Row data context (for table cells) */ | ||
| rowData?: any; | ||
| /** Chart data context (for chart clicks) */ | ||
| chartData?: any; | ||
| /** Optional KPI block identifier for block-level drilldowns */ | ||
| blockId?: string; | ||
| } | ||
| declare interface DrillDownHandler { | ||
| onDrillDown: (context: DrillDownContext) => void; | ||
| rendered: React_2.ReactNode; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type EqualityFn<T = unknown> = (a: T, b: T) => boolean; | ||
| declare type FilterItemType = 'equals' | 'not_equals' | 'greater_than' | 'greater_than_or_equal' | 'less_than' | 'less_than_or_equal' | 'contains' | 'not_contains' | 'starts_with' | 'not_starts_with' | 'ends_with' | 'not_ends_with' | 'is_null' | 'is_not_null' | 'between' | 'custom' | 'relative_date'; | ||
| declare type FilterResult = FilterResultItem | FilterResultGroup; | ||
| declare interface FilterResultGroup { | ||
| type: 'group'; | ||
| operator: 'or' | 'and'; | ||
| filters: FilterResult[]; | ||
| } | ||
| declare interface FilterResultItem { | ||
| name?: string; | ||
| type: FilterItemType; | ||
| memberType?: 'dimension' | 'measure'; | ||
| value?: FilterValue; | ||
| startInclusive?: boolean; | ||
| endInclusive?: boolean; | ||
| caseSensitive?: boolean; | ||
| grain?: string; | ||
| } | ||
| declare type FilterValue = string | number | (string | number)[] | { | ||
| period: string; | ||
| n?: number; | ||
| }; | ||
| declare interface HtmlChartSpec { | ||
| htmlContent?: string; | ||
| } | ||
| declare type KpiChartItemSpec = KpiNumberChartSpec | KpiComparisonChartSpec | KpiProgressBarChartSpec | KpiSparklineChartSpec | KpiHtmlChartSpec; | ||
| declare interface KpiChartSpec { | ||
| layout?: KpiLayoutSettings; | ||
| charts?: KpiChartItemSpec[]; | ||
| } | ||
| declare interface KpiComparisonChartSpec extends BaseKpiChartItem { | ||
| type: 'KpiComparison'; | ||
| current: DataBinding; | ||
| previous: DataBinding; | ||
| showDifference?: boolean; | ||
| decimals?: number; | ||
| positiveColor?: string; | ||
| negativeColor?: string; | ||
| neutralColor?: string; | ||
| size?: string; | ||
| weight?: string; | ||
| extraProps?: Record<string, string | number | boolean | null | undefined>; | ||
| } | ||
| declare interface KpiHtmlChartSpec extends BaseKpiChartItem { | ||
| type: 'KpiHtml'; | ||
| htmlContent?: string; | ||
| } | ||
| declare interface KpiLayoutSettings { | ||
| direction?: 'row' | 'column'; | ||
| align?: string; | ||
| justify?: string; | ||
| gap?: string; | ||
| wrap?: boolean; | ||
| style?: string; | ||
| } | ||
| declare interface KpiNumberChartSpec extends BaseKpiChartItem { | ||
| type: 'KpiNumber'; | ||
| value: DataBinding; | ||
| color?: string; | ||
| background?: string; | ||
| padding?: string; | ||
| size?: string; | ||
| align?: 'left' | 'center' | 'right'; | ||
| extraProps?: Record<string, string | number | boolean | null | undefined>; | ||
| } | ||
| declare interface KpiProgressBarChartSpec extends BaseKpiChartItem { | ||
| type: 'KpiProgressBar'; | ||
| value: DataBinding; | ||
| target?: DataBinding; | ||
| showPercent?: boolean; | ||
| showTarget?: boolean; | ||
| width?: string; | ||
| customGoalEnabled?: boolean; | ||
| customGoalValue?: string | number | null; | ||
| extraProps?: Record<string, string | number | boolean | null | undefined>; | ||
| } | ||
| declare interface KpiSparklineChartSpec extends BaseKpiChartItem { | ||
| type: 'KpiSparkline'; | ||
| /** | ||
| * Optional headline value shown above the sparkline. When omitted, the last data point from the | ||
| * sparkline series is used. | ||
| */ | ||
| value?: DataBinding; | ||
| /** | ||
| * Column name for the measure series rendered as a sparkline. | ||
| */ | ||
| seriesMeasure?: string; | ||
| /** | ||
| * Optional dimension or time dimension column used to show labels for the sparkline extremes. | ||
| */ | ||
| seriesDimension?: string; | ||
| /** | ||
| * When true (default), show the headline value. | ||
| */ | ||
| showValue?: boolean; | ||
| /** | ||
| * When true, display a textual trend indicator (e.g. +3.4%). | ||
| */ | ||
| showTrend?: boolean; | ||
| /** | ||
| * Hex color for the sparkline stroke. | ||
| */ | ||
| lineColor?: string; | ||
| /** | ||
| * Hex color for the sparkline fill/area. | ||
| */ | ||
| fillColor?: string; | ||
| /** | ||
| * Width of the sparkline stroke in pixels. | ||
| */ | ||
| lineWidth?: number; | ||
| /** | ||
| * Limits the maximum number of points rendered in the sparkline. | ||
| */ | ||
| maxPoints?: number; | ||
| /** | ||
| * When true, the headline number reuses the selected sparkline measure. | ||
| */ | ||
| headlineUsesSparklineMeasure?: boolean; | ||
| width?: string; | ||
| height?: string; | ||
| extraProps?: Record<string, string | number | boolean | null | undefined>; | ||
| } | ||
| declare type LogicalQuery = ParseSemanticSqlResult; | ||
| declare interface MapChartSpec { | ||
| mapType?: 'choropleth' | 'bubble'; | ||
| mapStyle?: string; | ||
| latitudeField?: string; | ||
| longitudeField?: string; | ||
| sizeField?: string; | ||
| colorField?: string; | ||
| colorMode?: 'default' | 'palette' | 'column'; | ||
| colorPalette?: string; | ||
| defaultColor?: string; | ||
| tooltipFields?: string[]; | ||
| sizeRange?: [number, number]; | ||
| center?: [number, number]; | ||
| zoom?: number; | ||
| projection?: 'globe' | 'mercator'; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type Measure = TCubeMeasure & { | ||
| memberType?: 'measure'; | ||
| title?: string; | ||
| }; | ||
| declare interface MeasureResult { | ||
| name: string; | ||
| sql?: string; | ||
| alias?: string; | ||
| title?: string; | ||
| format?: string; | ||
| } | ||
| declare interface MissingMemberResult { | ||
| name: string; | ||
| sql: string; | ||
| } | ||
| declare interface OrderByResult { | ||
| name: string; | ||
| direction: 'asc' | 'desc'; | ||
| } | ||
| declare interface ParseSemanticSqlResult { | ||
| semanticView: string; | ||
| measures?: MeasureResult[]; | ||
| dimensions?: DimensionResult[]; | ||
| customMeasures?: CustomMeasureResult[]; | ||
| customDimensions?: CustomDimensionResult[]; | ||
| orderBy?: OrderByResult[]; | ||
| filters?: FilterResult[]; | ||
| limit?: number; | ||
| distinct?: boolean; | ||
| missingMembers?: MissingMemberResult[]; | ||
| } | ||
| declare type PivotValuePathEntry = { | ||
| column: string; | ||
| label: string; | ||
| value: string | number | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare const prepareTableData: ({ data, schema, logicalQuery, columnWidths, columnFormats, columnOrder, useMemberTitles, pivots, isAutoRunEnabled, dataAssetMembers, }: PrepareTableDataParams) => { | ||
| data: TableDataItem[]; | ||
| columns: TableColumn[]; | ||
| pivots: { | ||
| title: string; | ||
| key: string; | ||
| columnType: ColumnType_2 | undefined; | ||
| isCustom: boolean; | ||
| actualMemberName: string; | ||
| }[]; | ||
| }; | ||
| declare interface PrepareTableDataParams { | ||
| data: any[]; | ||
| schema: ColumnSchema[]; | ||
| logicalQuery?: LogicalQuery; | ||
| columnWidths?: { | ||
| [id: string]: number; | ||
| } | null; | ||
| columnFormats?: Record<string, ColumnFormatOverride> | null; | ||
| columnOrder?: string[] | null; | ||
| useMemberTitles?: boolean; | ||
| pivots?: string[]; | ||
| isAutoRunEnabled?: boolean; | ||
| dataAssetMembers?: DataAssetMember[]; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| declare type Report_2 = { | ||
| id: number; | ||
| publicId: string; | ||
| persisted: boolean; | ||
| name: string; | ||
| title: string; | ||
| sqlQuery: string; | ||
| version?: number | null; | ||
| result?: { | ||
| data: any[]; | ||
| schema: SchemaColumn[]; | ||
| } | null; | ||
| error?: string | null; | ||
| vegaSpec?: TopLevelSpec | null; | ||
| createdFromMessageId?: string | null; | ||
| preferences?: { | ||
| activeTab?: 'table' | 'chart'; | ||
| shouldShowSql?: boolean; | ||
| columnWidths?: { | ||
| [id: string]: number; | ||
| } | null; | ||
| showColumnTotals?: boolean; | ||
| showRowTotals?: boolean; | ||
| columnFormats?: Record<string, ColumnFormatOverride> | null; | ||
| }; | ||
| isLoading?: boolean; | ||
| lastRunSchema?: string | null; | ||
| logicalQuery?: LogicalQuery | null; | ||
| isSourceReport?: boolean; | ||
| sourceName?: string | null; | ||
| cacheUpdatedAt?: number | null; | ||
| chartCategory?: ChartCategory; | ||
| tableChartSpec?: TableChartSpec | null; | ||
| kpiChartSpec?: KpiChartSpec | null; | ||
| htmlChartSpec?: HtmlChartSpec | null; | ||
| mapChartSpec?: MapChartSpec | null; | ||
| kind?: ChartKind | null; | ||
| spec?: string | Record<string, unknown> | TableChartSpec | KpiChartSpec | HtmlChartSpec | MapChartSpec | null; | ||
| pivots?: string[]; | ||
| parsedVegaSpec?: TopLevelSpec | null; | ||
| }; | ||
| export { Report_2 as Report } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare function ReportProvider({ children, report, onReportUpdate, isAutoRunEnabled, onToggleAutoRun, onError, }: ReportProviderProps): JSX.Element; | ||
| declare interface ReportProviderProps { | ||
| children: ReactNode; | ||
| report: UseReportProps['report']; | ||
| onReportUpdate: UseReportProps['onReportUpdate']; | ||
| isAutoRunEnabled?: UseReportProps['isAutoRunEnabled']; | ||
| onToggleAutoRun?: (value?: boolean) => void; | ||
| onError?: (message: string) => void; | ||
| } | ||
| declare type SchemaColumn = { | ||
| name: string; | ||
| column_type: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare interface SemanticView { | ||
| name: string; | ||
| title: string; | ||
| measures: SemanticViewMember[]; | ||
| dimensions: SemanticViewMember[]; | ||
| folders?: TCubeFolder[]; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare type SemanticViewMember = { | ||
| name: string; | ||
| type: TCubeMemberType; | ||
| title?: string; | ||
| format?: string; | ||
| aliasMember?: string; | ||
| drillMembers?: string[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| declare type StandaloneProps = { | ||
| children: React_2.ReactNode; | ||
| token: string; | ||
| apiUrl: string; | ||
| }; | ||
| declare type TableChartSpec = TableChartSpec_2 & { | ||
| pivotInitialized?: boolean; | ||
| }; | ||
| declare type TableChartSpec_2 = { | ||
| /** If true, render a leading row-number column. */ | ||
| showRowNumbers?: boolean | undefined; | ||
| /** If true, append a totals row using the current aggregation. */ | ||
| showColumnTotals?: boolean | undefined; | ||
| /** If true, append per-row totals across pivoted columns. */ | ||
| showRowTotals?: boolean | undefined; | ||
| /** If true, paginate rows instead of rendering all rows at once. */ | ||
| showPagination?: boolean | undefined; | ||
| /** Optional list to order/filter/label columns. */ | ||
| columns?: { | ||
| /** Column name as returned by the query. */ | ||
| key: string; | ||
| /** Optional display title instead of the raw key. */ | ||
| titleOverride?: string | undefined; | ||
| /** Extra per-column settings; forward compatible. */ | ||
| meta?: { | ||
| [x: string]: any; | ||
| } | undefined; | ||
| }[] | undefined; | ||
| /** Pivot configuration; null/omitted means no pivot. */ | ||
| pivot?: ({ | ||
| /** Fields to pivot into row groups (string or column config). */ | ||
| rows?: (string | { | ||
| /** Column name as returned by the query. */ | ||
| key: string; | ||
| /** Optional display title instead of the raw key. */ | ||
| titleOverride?: string | undefined; | ||
| /** Extra per-column settings; forward compatible. */ | ||
| meta?: { | ||
| [x: string]: any; | ||
| } | undefined; | ||
| })[]; | ||
| /** Fields to pivot into column groups (string or column config). */ | ||
| columns?: (string | { | ||
| /** Column name as returned by the query. */ | ||
| key: string; | ||
| /** Optional display title instead of the raw key. */ | ||
| titleOverride?: string | undefined; | ||
| /** Extra per-column settings; forward compatible. */ | ||
| meta?: { | ||
| [x: string]: any; | ||
| } | undefined; | ||
| })[]; | ||
| /** Values to aggregate in the pivot table. */ | ||
| values?: { | ||
| /** Column name as returned by the query. */ | ||
| key: string; | ||
| /** Optional display title instead of the raw key. */ | ||
| titleOverride?: string | undefined; | ||
| /** Extra per-column settings; forward compatible. */ | ||
| meta?: { | ||
| [x: string]: any; | ||
| } | undefined; | ||
| }[]; | ||
| } | null) | undefined; | ||
| }; | ||
| declare type TableColumn = { | ||
| title: string; | ||
| key: string; | ||
| render: (value: any) => string; | ||
| memberType: 'measure' | 'dimension' | 'timeDimension' | 'segment'; | ||
| width?: number; | ||
| actualMemberName?: string; | ||
| pivotValue?: string; | ||
| pivotKey?: string; | ||
| pivotPath?: PivotValuePathEntry[]; | ||
| columnType: ColumnType; | ||
| isCustom: boolean; | ||
| hasDrillMembers?: boolean; | ||
| isPivotPlaceholder?: boolean; | ||
| formatString?: string; | ||
| defaultFormatString?: string; | ||
| }; | ||
| declare interface TableDataItem { | ||
| [key: string]: any; | ||
| } | ||
| declare type TablePivot = { | ||
| title: string; | ||
| key: string; | ||
| columnType?: ColumnType; | ||
| isCustom: boolean; | ||
| actualMemberName?: string; | ||
| }; | ||
| export declare const useChartBuilderContext: <Selected = ChartBuilderContextValue>(selector?: ((value: ChartBuilderContextValue) => Selected) | undefined, eqlFn?: EqualityFn<Selected> | undefined) => Selected; | ||
| export declare const useDataAssetsContext: <Selected = DataAssetsContextContextType>(selector?: ((value: DataAssetsContextContextType) => Selected) | undefined, eqlFn?: EqualityFn<Selected> | undefined) => Selected; | ||
| export declare const useReportContext: <Selected = UseReportReturn>(selector?: ((value: UseReportReturn) => Selected) | undefined, eqlFn?: EqualityFn<Selected> | undefined) => Selected; | ||
| declare interface UseReportProps { | ||
| report: Report_2 | null | undefined; | ||
| onReportUpdate: (options: Partial<Report_2>) => void; | ||
| isAutoRunEnabled?: boolean; | ||
| onError?: (message: string) => void; | ||
| } | ||
| declare interface UseReportReturn { | ||
| report: Report_2 | null | undefined; | ||
| updateLogicalQueryAndRunQuery: (logicalQueryUpdates: Partial<LogicalQuery>, shouldRunQuery?: boolean) => void; | ||
| onReportUpdate: (options: Partial<Report_2>) => void; | ||
| updateReport: (options: Partial<Report_2>) => void; | ||
| runQuery: (sqlQuery?: string | null, forceRefresh?: boolean) => void; | ||
| fetchReportQuery: (options: { | ||
| sqlQuery: string; | ||
| signal?: AbortSignal; | ||
| cacheMode?: any; | ||
| }) => Promise<any>; | ||
| tableData: { | ||
| data: any; | ||
| columns: TableColumn[]; | ||
| pivots?: TablePivot[]; | ||
| } | null; | ||
| chartColumns: ChartColumn[] | undefined; | ||
| newFilter: FilterResultItem | null; | ||
| setNewFilter: (filter: FilterResultItem | null) => void; | ||
| handleAddFilter: (filter: FilterResultItem) => void; | ||
| addFilterForColumn: (columnId: string) => void; | ||
| removeFilterByIndexPath: (indexPath: number[]) => void; | ||
| removeFilterByColumnId: (columnId: string) => void; | ||
| handleFilterChange: (filterIndex: number[], newFilter: FilterResultItem) => void; | ||
| isAdvancedSqlMode: boolean; | ||
| isAutoRunEnabled: boolean; | ||
| clearReport: () => void; | ||
| setSelectedSemanticView: (viewId: string | null) => void; | ||
| selectedSemanticView: string | null; | ||
| } | ||
| /** | ||
| * @public | ||
| */ | ||
| export declare function VegaChart({ data, schema, vegaSpecProp, isLoading, containerRef, onDrillDown, }: VegaChartProps): JSX.Element; | ||
| declare interface VegaChartProps { | ||
| data?: any[]; | ||
| schema?: ChartColumn[]; | ||
| vegaSpecProp?: string | Record<string, any> | TopLevelSpec | null; | ||
| isLoading?: boolean; | ||
| containerRef?: React.RefObject<HTMLDivElement | null>; | ||
| onDrillDown?: DrillDownHandler['onDrillDown']; | ||
| } | ||
| /** | ||
| * Quick chart templates we display in UI as button for user to select | ||
| * @public | ||
| */ | ||
| export declare type VegaChartTemplateType = 'grouped_bar' | 'stacked_bar' | 'percent_stacked_bar' | 'horizontal_grouped_bar' | 'horizontal_stacked_bar' | 'percent_horizontal_stacked_bar' | 'line' | 'area' | 'circle' | 'scatter' | 'heatmap' | 'arc' | 'arc-donut' | 'boxplot' | 'composite'; | ||
| export { } |
+1
-1
| { | ||
| "name": "@cube-dev/embed-sdk", | ||
| "version": "0.0.4", | ||
| "version": "0.0.5", | ||
| "author": "Cube Dev, Inc.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
20123451
0.15%89
1.14%39399
2.31%2
-33.33%