drizzle-cube 0.2.26 → 0.2.28
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/dist/client/charts.js +2 -2
- package/dist/client/chunks/{charts-BsXrHSCm.js → charts-BfXEKIrq.js} +44 -44
- package/dist/client/chunks/{charts-BsXrHSCm.js.map → charts-BfXEKIrq.js.map} +1 -1
- package/dist/client/chunks/charts-DQuOI5HA.js +9465 -0
- package/dist/client/chunks/charts-DQuOI5HA.js.map +1 -0
- package/dist/client/chunks/components-CWMeA5e-.js +14872 -0
- package/dist/client/chunks/components-CWMeA5e-.js.map +1 -0
- package/dist/client/chunks/core-DrhYtHHa.js +6 -0
- package/dist/client/chunks/core-DrhYtHHa.js.map +1 -0
- package/dist/client/chunks/hooks-CAKGR-w0.js +828 -0
- package/dist/client/chunks/hooks-CAKGR-w0.js.map +1 -0
- package/dist/client/components/AIAssistant/index.d.ts +5 -2
- package/dist/client/components/AnalysisBuilder/index.d.ts +6 -0
- package/dist/client/components/AnalysisBuilder/types.d.ts +9 -7
- package/dist/client/components/AnalysisBuilder/utils/fieldUtils.d.ts +46 -0
- package/dist/client/components/AnalysisBuilder/utils/filterUtils.d.ts +19 -0
- package/dist/client/components/AnalysisBuilder/utils/idUtils.d.ts +11 -0
- package/dist/client/components/AnalysisBuilder/utils/index.d.ts +11 -0
- package/dist/client/components/AnalysisBuilder/utils/queryUtils.d.ts +11 -0
- package/dist/client/components/AnalysisBuilder/utils/recentFieldsUtils.d.ts +14 -0
- package/dist/client/components/AnalysisBuilder/utils/storageUtils.d.ts +42 -0
- package/dist/client/components/ConfirmModal.d.ts +30 -0
- package/dist/client/components/DashboardFilters/DashboardFilterConfigModal.d.ts +20 -0
- package/dist/client/components/DashboardFilters/DashboardFilterItem.d.ts +14 -0
- package/dist/client/components/DashboardPortletCard.d.ts +13 -34
- package/dist/client/components/PortletAnalysisModal.d.ts +4 -2
- package/dist/client/components/QueryBuilder/types.d.ts +0 -17
- package/dist/client/components/shared/utils.d.ts +2 -112
- package/dist/client/components.d.ts +0 -1
- package/dist/client/components.js +12 -13
- package/dist/client/hooks/queries/index.d.ts +15 -0
- package/dist/client/hooks/queries/useCubeLoadQuery.d.ts +67 -0
- package/dist/client/hooks/queries/useCubeMetaQuery.d.ts +51 -0
- package/dist/client/hooks/queries/useDryRunQuery.d.ts +103 -0
- package/dist/client/hooks/queries/useMultiCubeLoadQuery.d.ts +68 -0
- package/dist/client/hooks/useAnalysisAI.d.ts +44 -0
- package/dist/client/hooks/useAnalysisBuilderHook.d.ts +113 -0
- package/dist/client/hooks/useAnalysisChartDefaults.d.ts +35 -0
- package/dist/client/hooks/useAnalysisCombinedFields.d.ts +18 -0
- package/dist/client/hooks/useAnalysisInitialization.d.ts +25 -0
- package/dist/client/hooks/useAnalysisQueryBuilder.d.ts +32 -0
- package/dist/client/hooks/useAnalysisQueryExecution.d.ts +38 -0
- package/dist/client/hooks/useAnalysisShare.d.ts +23 -0
- package/dist/client/hooks/useAnalysisUIState.d.ts +24 -0
- package/dist/client/hooks/useDashboardHook.d.ts +108 -0
- package/dist/client/hooks/useDebounceQuery.d.ts +48 -0
- package/dist/client/hooks/useDirtyStateTracking.d.ts +37 -0
- package/dist/client/hooks/useFilterValues.d.ts +4 -1
- package/dist/client/hooks.d.ts +4 -2
- package/dist/client/hooks.js +13 -170
- package/dist/client/hooks.js.map +1 -1
- package/dist/client/icons.js +1 -1
- package/dist/client/index.d.ts +11 -4
- package/dist/client/index.js +100 -70
- package/dist/client/providers/CubeMetaProvider.d.ts +1 -1
- package/dist/client/providers/CubeProvider.d.ts +7 -3
- package/dist/client/providers.js +1 -1
- package/dist/client/shared/queryKey.d.ts +1 -0
- package/dist/client/shared/utils.d.ts +5 -0
- package/dist/client/stores/analysisBuilderStore.d.ts +271 -0
- package/dist/client/stores/dashboardStore.d.ts +267 -0
- package/dist/client/stores/index.d.ts +13 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +27 -1
- package/dist/client/utils/chartUtils.d.ts +1 -2
- package/dist/client/utils/filterUtils.d.ts +15 -10
- package/dist/client/utils/pivotUtils.d.ts +1 -2
- package/dist/client-bundle-stats.html +1 -1
- package/package.json +14 -20
- package/dist/client/chunks/charts-BvLb1eub.js +0 -7427
- package/dist/client/chunks/charts-BvLb1eub.js.map +0 -1
- package/dist/client/chunks/components-BGWiuXqQ.js +0 -15831
- package/dist/client/chunks/components-BGWiuXqQ.js.map +0 -1
- package/dist/client/chunks/core-CX7kEAYO.js +0 -6
- package/dist/client/chunks/core-CX7kEAYO.js.map +0 -1
- package/dist/client/chunks/index-9x0R-Fme.js +0 -551
- package/dist/client/chunks/index-9x0R-Fme.js.map +0 -1
- package/dist/client/components/AIAssistant/AIAssistantModal.d.ts +0 -10
- package/dist/client/components/AnalysisBuilder/utils.d.ts +0 -103
- package/dist/client/components/CubeRelationshipDiagram/CubeNode.d.ts +0 -13
- package/dist/client/components/CubeRelationshipDiagram/ERDControls.d.ts +0 -7
- package/dist/client/components/CubeRelationshipDiagram/RelationshipEdge.d.ts +0 -11
- package/dist/client/components/CubeRelationshipDiagram/index.d.ts +0 -10
- package/dist/client/components/CubeRelationshipDiagram/useERDLayout.d.ts +0 -21
- package/dist/client/components/PortletEditModal.d.ts +0 -12
- package/dist/client/components/shared/CubeMetaExplorer.d.ts +0 -4
- package/dist/client/hooks/useCubeMeta.d.ts +0 -39
- package/dist/client/hooks/useCubeQuery.d.ts +0 -9
- package/dist/client/hooks/useMultiCubeQuery.d.ts +0 -36
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface AIAssistantModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
schema?: any;
|
|
6
|
-
onQueryLoad?: (query: any) => void;
|
|
7
|
-
aiEndpoint?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const AIAssistantModal: React.FC<AIAssistantModalProps>;
|
|
10
|
-
export default AIAssistantModal;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { MetricItem, BreakdownItem, FieldOption, FieldType, RecentFieldsStorage } from './types';
|
|
2
|
-
import { MetaResponse, MetaField } from '../../shared/types';
|
|
3
|
-
import { CubeQuery, Filter } from '../../types';
|
|
4
|
-
/**
|
|
5
|
-
* Generate a unique ID for items
|
|
6
|
-
*/
|
|
7
|
-
export declare function generateId(): string;
|
|
8
|
-
/**
|
|
9
|
-
* Generate letter label for metrics (A, B, C, ..., AA, AB, ...)
|
|
10
|
-
*/
|
|
11
|
-
export declare function generateMetricLabel(index: number): string;
|
|
12
|
-
/**
|
|
13
|
-
* Convert metrics and breakdowns to CubeQuery format
|
|
14
|
-
*/
|
|
15
|
-
export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[]): CubeQuery;
|
|
16
|
-
/**
|
|
17
|
-
* Check if a query has any content
|
|
18
|
-
*/
|
|
19
|
-
export declare function hasQueryContent(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[]): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Get cube name from a field name (e.g., "Employees.count" -> "Employees")
|
|
22
|
-
*/
|
|
23
|
-
export declare function getCubeNameFromField(fieldName: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Get field short name from full name (e.g., "Employees.count" -> "count")
|
|
26
|
-
*/
|
|
27
|
-
export declare function getFieldShortName(fieldName: string): string;
|
|
28
|
-
/**
|
|
29
|
-
* Find field metadata from schema
|
|
30
|
-
*/
|
|
31
|
-
export declare function findFieldInSchema(fieldName: string, schema: MetaResponse | null): {
|
|
32
|
-
field: MetaField;
|
|
33
|
-
cubeName: string;
|
|
34
|
-
fieldType: FieldType;
|
|
35
|
-
} | null;
|
|
36
|
-
/**
|
|
37
|
-
* Get display title for a field
|
|
38
|
-
*/
|
|
39
|
-
export declare function getFieldTitle(fieldName: string, schema: MetaResponse | null): string;
|
|
40
|
-
/**
|
|
41
|
-
* Determine field type from metadata
|
|
42
|
-
*/
|
|
43
|
-
export declare function getFieldType(field: MetaField): FieldType;
|
|
44
|
-
/**
|
|
45
|
-
* Convert schema to flat list of field options
|
|
46
|
-
*/
|
|
47
|
-
export declare function schemaToFieldOptions(schema: MetaResponse | null, mode: 'metrics' | 'breakdown' | 'filter'): FieldOption[];
|
|
48
|
-
/**
|
|
49
|
-
* Filter field options by search term
|
|
50
|
-
*/
|
|
51
|
-
export declare function filterFieldOptions(options: FieldOption[], searchTerm: string, selectedCube?: string | null): FieldOption[];
|
|
52
|
-
/**
|
|
53
|
-
* Group field options by cube
|
|
54
|
-
*/
|
|
55
|
-
export declare function groupFieldsByCube(options: FieldOption[]): Map<string, FieldOption[]>;
|
|
56
|
-
/**
|
|
57
|
-
* Get recent fields from localStorage
|
|
58
|
-
*/
|
|
59
|
-
export declare function getRecentFields(): RecentFieldsStorage;
|
|
60
|
-
/**
|
|
61
|
-
* Add a field to recent fields
|
|
62
|
-
*/
|
|
63
|
-
export declare function addRecentField(fieldName: string, mode: 'metrics' | 'breakdowns'): void;
|
|
64
|
-
/**
|
|
65
|
-
* Get recent field options from schema
|
|
66
|
-
*/
|
|
67
|
-
export declare function getRecentFieldOptions(schema: MetaResponse | null, mode: 'metrics' | 'breakdown' | 'filter', recentFieldNames: string[]): FieldOption[];
|
|
68
|
-
/**
|
|
69
|
-
* Get list of cube names from schema
|
|
70
|
-
*/
|
|
71
|
-
export declare function getCubeNames(schema: MetaResponse | null): string[];
|
|
72
|
-
/**
|
|
73
|
-
* Get cube title by name
|
|
74
|
-
*/
|
|
75
|
-
export declare function getCubeTitle(cubeName: string, schema: MetaResponse | null): string;
|
|
76
|
-
/**
|
|
77
|
-
* Save state to localStorage
|
|
78
|
-
*/
|
|
79
|
-
export declare function saveStateToStorage(state: {
|
|
80
|
-
metrics: MetricItem[];
|
|
81
|
-
breakdowns: BreakdownItem[];
|
|
82
|
-
filters: Filter[];
|
|
83
|
-
chartType: string;
|
|
84
|
-
chartConfig: object;
|
|
85
|
-
displayConfig: object;
|
|
86
|
-
activeView: string;
|
|
87
|
-
}): void;
|
|
88
|
-
/**
|
|
89
|
-
* Load state from localStorage
|
|
90
|
-
*/
|
|
91
|
-
export declare function loadStateFromStorage(): {
|
|
92
|
-
metrics: MetricItem[];
|
|
93
|
-
breakdowns: BreakdownItem[];
|
|
94
|
-
filters: Filter[];
|
|
95
|
-
chartType: string;
|
|
96
|
-
chartConfig: object;
|
|
97
|
-
displayConfig: object;
|
|
98
|
-
activeView: string;
|
|
99
|
-
} | null;
|
|
100
|
-
/**
|
|
101
|
-
* Clear state from localStorage
|
|
102
|
-
*/
|
|
103
|
-
export declare function clearStateFromStorage(): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CubeMetaCube } from '../../hooks/useCubeMeta';
|
|
2
|
-
interface CubeNodeProps {
|
|
3
|
-
data: {
|
|
4
|
-
cube: CubeMetaCube;
|
|
5
|
-
onCubeClick?: (cubeName: string) => void;
|
|
6
|
-
onFieldClick?: (cubeName: string, fieldName: string, fieldType: 'measure' | 'dimension') => void;
|
|
7
|
-
isHighlighted: boolean;
|
|
8
|
-
highlightedFields: string[];
|
|
9
|
-
searchTerm?: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export declare function CubeNode({ data }: CubeNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export default CubeNode;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface ERDControlsProps {
|
|
2
|
-
onLayoutChange?: (layout: 'auto' | 'manual') => void;
|
|
3
|
-
onAutoLayout?: () => void;
|
|
4
|
-
currentLayout?: 'auto' | 'manual';
|
|
5
|
-
}
|
|
6
|
-
export declare function ERDControls({ onAutoLayout }: ERDControlsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default ERDControls;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EdgeProps } from 'reactflow';
|
|
2
|
-
import { CubeMetaRelationship } from '../../hooks/useCubeMeta';
|
|
3
|
-
interface RelationshipEdgeData {
|
|
4
|
-
relationship: CubeMetaRelationship;
|
|
5
|
-
joinFields: Array<{
|
|
6
|
-
sourceField: string;
|
|
7
|
-
targetField: string;
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
10
|
-
export declare function RelationshipEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, data, markerEnd, }: EdgeProps<RelationshipEdgeData>): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
export default RelationshipEdge;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface CubeRelationshipDiagramProps {
|
|
2
|
-
className?: string;
|
|
3
|
-
onCubeClick?: (cubeName: string) => void;
|
|
4
|
-
onFieldClick?: (cubeName: string, fieldName: string, fieldType: 'measure' | 'dimension') => void;
|
|
5
|
-
highlightedCubes?: string[];
|
|
6
|
-
highlightedFields?: string[];
|
|
7
|
-
searchTerm?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function CubeRelationshipDiagram({ className, onCubeClick, onFieldClick, highlightedCubes, highlightedFields, searchTerm, }: CubeRelationshipDiagramProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default CubeRelationshipDiagram;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Node, Edge } from 'reactflow';
|
|
2
|
-
export interface LayoutOptions {
|
|
3
|
-
direction: 'TB' | 'BT' | 'LR' | 'RL';
|
|
4
|
-
nodeWidth: number;
|
|
5
|
-
nodeHeight: number;
|
|
6
|
-
nodeSep: number;
|
|
7
|
-
rankSep: number;
|
|
8
|
-
ranker: 'network-simplex' | 'tight-tree' | 'longest-path';
|
|
9
|
-
}
|
|
10
|
-
export declare function useERDLayout(nodes: Node[], edges: Edge[], options?: Partial<LayoutOptions>): {
|
|
11
|
-
nodes: Node[];
|
|
12
|
-
edges: Edge[];
|
|
13
|
-
};
|
|
14
|
-
export declare function useManualLayout(nodes: Node[], edges: Edge[], spacing?: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
}): {
|
|
18
|
-
nodes: Node[];
|
|
19
|
-
edges: Edge[];
|
|
20
|
-
};
|
|
21
|
-
export default useERDLayout;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PortletConfig, ColorPalette } from '../types';
|
|
2
|
-
interface PortletEditModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
onSave: (portlet: PortletConfig | Omit<PortletConfig, 'id' | 'x' | 'y'>) => void;
|
|
6
|
-
portlet?: PortletConfig | null;
|
|
7
|
-
title: string;
|
|
8
|
-
submitText: string;
|
|
9
|
-
colorPalette?: ColorPalette;
|
|
10
|
-
}
|
|
11
|
-
export default function PortletEditModal({ isOpen, onClose, onSave, portlet, title, submitText, colorPalette }: PortletEditModalProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { CubeClient } from '../client/CubeClient';
|
|
2
|
-
export interface CubeMetaField {
|
|
3
|
-
name: string;
|
|
4
|
-
title: string;
|
|
5
|
-
shortTitle: string;
|
|
6
|
-
type: string;
|
|
7
|
-
}
|
|
8
|
-
export interface CubeMetaRelationship {
|
|
9
|
-
targetCube: string;
|
|
10
|
-
relationship: 'belongsTo' | 'hasOne' | 'hasMany';
|
|
11
|
-
joinFields: Array<{
|
|
12
|
-
sourceField: string;
|
|
13
|
-
targetField: string;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
export interface CubeMetaCube {
|
|
17
|
-
name: string;
|
|
18
|
-
title: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
measures: CubeMetaField[];
|
|
21
|
-
dimensions: CubeMetaField[];
|
|
22
|
-
segments: CubeMetaField[];
|
|
23
|
-
relationships?: CubeMetaRelationship[];
|
|
24
|
-
}
|
|
25
|
-
export interface CubeMeta {
|
|
26
|
-
cubes: CubeMetaCube[];
|
|
27
|
-
}
|
|
28
|
-
export type FieldLabelMap = Record<string, string>;
|
|
29
|
-
interface UseCubeMetaResult {
|
|
30
|
-
meta: CubeMeta | null;
|
|
31
|
-
labelMap: FieldLabelMap;
|
|
32
|
-
loading: boolean;
|
|
33
|
-
error: string | null;
|
|
34
|
-
refetch: () => void;
|
|
35
|
-
getFieldLabel: (fieldName: string) => string;
|
|
36
|
-
}
|
|
37
|
-
export declare function clearMetaCache(): void;
|
|
38
|
-
export declare function useCubeMeta(cubeApi: CubeClient): UseCubeMetaResult;
|
|
39
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CubeQuery, CubeQueryOptions, CubeResultSet } from '../types';
|
|
2
|
-
interface UseCubeQueryResult {
|
|
3
|
-
resultSet: CubeResultSet | null;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
error: Error | null;
|
|
6
|
-
queryId: string | null;
|
|
7
|
-
}
|
|
8
|
-
export declare function useCubeQuery(query: CubeQuery | null, options?: CubeQueryOptions): UseCubeQueryResult;
|
|
9
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CubeQueryOptions, CubeResultSet, MultiQueryConfig } from '../types';
|
|
2
|
-
export interface UseMultiCubeQueryResult {
|
|
3
|
-
/** Merged data from all queries (null while loading) */
|
|
4
|
-
data: unknown[] | null;
|
|
5
|
-
/** Individual result sets from each query */
|
|
6
|
-
resultSets: CubeResultSet[] | null;
|
|
7
|
-
/** Whether any query is still loading */
|
|
8
|
-
isLoading: boolean;
|
|
9
|
-
/** First error encountered (null if all succeeded) */
|
|
10
|
-
error: Error | null;
|
|
11
|
-
/** Per-query errors (null for successful queries) */
|
|
12
|
-
errors: (Error | null)[];
|
|
13
|
-
/** Unique identifier for this query execution */
|
|
14
|
-
queryId: string | null;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Hook for executing multiple Cube queries with merged results
|
|
18
|
-
*
|
|
19
|
-
* @param config - MultiQueryConfig containing queries and merge settings
|
|
20
|
-
* @param options - Query options (skip, resetResultSetOnChange)
|
|
21
|
-
* @returns Query results with merged data and per-query error tracking
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* const { data, isLoading, error } = useMultiCubeQuery({
|
|
26
|
-
* queries: [
|
|
27
|
-
* { measures: ['Sales.revenue'] },
|
|
28
|
-
* { measures: ['Costs.total'] }
|
|
29
|
-
* ],
|
|
30
|
-
* mergeStrategy: 'merge',
|
|
31
|
-
* mergeKey: 'Sales.date',
|
|
32
|
-
* queryLabels: ['Revenue', 'Costs']
|
|
33
|
-
* })
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function useMultiCubeQuery(config: MultiQueryConfig | null, options?: CubeQueryOptions): UseMultiCubeQueryResult;
|