drizzle-cube 0.1.11 → 0.1.13

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.
@@ -0,0 +1,119 @@
1
+ import { SemanticLayerCompiler, SemanticQuery, SecurityContext } from '../server';
2
+ /**
3
+ * Calculate query complexity based on query structure
4
+ */
5
+ export declare function calculateQueryComplexity(query: SemanticQuery): string;
6
+ /**
7
+ * Generate a unique request ID
8
+ */
9
+ export declare function generateRequestId(): string;
10
+ /**
11
+ * Build transformed query metadata for Cube.js compatibility
12
+ */
13
+ export declare function buildTransformedQuery(query: SemanticQuery): any;
14
+ /**
15
+ * Get database type from semantic layer
16
+ */
17
+ export declare function getDatabaseType(semanticLayer: SemanticLayerCompiler<any>): string;
18
+ /**
19
+ * Helper function to handle dry-run logic for all adapters
20
+ */
21
+ export declare function handleDryRun(query: SemanticQuery, securityContext: SecurityContext, semanticLayer: SemanticLayerCompiler<any>): Promise<{
22
+ queryType: string;
23
+ normalizedQueries: {
24
+ cube: string;
25
+ query: {
26
+ measures: string[];
27
+ dimensions: string[];
28
+ filters: import('../server').Filter[];
29
+ timeDimensions: import('../server').TimeDimension[];
30
+ order: Record<string, "asc" | "desc">;
31
+ limit: number | undefined;
32
+ offset: number | undefined;
33
+ };
34
+ }[];
35
+ queryOrder: string[];
36
+ transformedQueries: {
37
+ cube: string;
38
+ query: {
39
+ measures: string[];
40
+ dimensions: string[];
41
+ filters: import('../server').Filter[];
42
+ timeDimensions: import('../server').TimeDimension[];
43
+ order: Record<string, "asc" | "desc">;
44
+ limit: number | undefined;
45
+ offset: number | undefined;
46
+ };
47
+ }[];
48
+ pivotQuery: {
49
+ query: SemanticQuery;
50
+ cubes: string[];
51
+ };
52
+ sql: {
53
+ sql: string[];
54
+ params: any[];
55
+ };
56
+ complexity: string;
57
+ valid: boolean;
58
+ cubesUsed: string[];
59
+ joinType: string;
60
+ query: SemanticQuery;
61
+ }>;
62
+ /**
63
+ * Format standard Cube.js API response
64
+ */
65
+ export declare function formatCubeResponse(query: SemanticQuery, result: {
66
+ data: any[];
67
+ annotation?: any;
68
+ }, semanticLayer: SemanticLayerCompiler<any>): {
69
+ queryType: string;
70
+ results: {
71
+ query: SemanticQuery;
72
+ lastRefreshTime: string;
73
+ usedPreAggregations: {};
74
+ transformedQuery: any;
75
+ requestId: string;
76
+ annotation: any;
77
+ dataSource: string;
78
+ dbType: string;
79
+ extDbType: string;
80
+ external: boolean;
81
+ slowQuery: boolean;
82
+ data: any[];
83
+ }[];
84
+ pivotQuery: {
85
+ queryType: string;
86
+ measures?: string[];
87
+ dimensions?: string[];
88
+ filters?: Array<import('../server').Filter>;
89
+ timeDimensions?: Array<import('../server').TimeDimension>;
90
+ limit?: number;
91
+ offset?: number;
92
+ order?: Record<string, "asc" | "desc">;
93
+ };
94
+ slowQuery: boolean;
95
+ };
96
+ /**
97
+ * Format SQL generation response
98
+ */
99
+ export declare function formatSqlResponse(query: SemanticQuery, sqlResult: {
100
+ sql: string;
101
+ params?: any[];
102
+ }): {
103
+ sql: string;
104
+ params: any[];
105
+ query: SemanticQuery;
106
+ };
107
+ /**
108
+ * Format metadata response
109
+ */
110
+ export declare function formatMetaResponse(metadata: any): {
111
+ cubes: any;
112
+ };
113
+ /**
114
+ * Standard error response format
115
+ */
116
+ export declare function formatErrorResponse(error: string | Error, status?: number): {
117
+ error: string;
118
+ status: number;
119
+ };
@@ -15,6 +15,7 @@ interface AxisDropZoneProps {
15
15
  onDragStart: (e: React.DragEvent<HTMLDivElement>, field: string, fromKey: string) => void;
16
16
  onDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
17
17
  getFieldStyling: (field: string) => FieldStyling;
18
+ onReorder?: (fromIndex: number, toIndex: number, axisKey: string) => void;
18
19
  }
19
- export default function AxisDropZone({ config, fields, onDrop, onRemove, onDragStart, onDragOver, getFieldStyling }: AxisDropZoneProps): import("react/jsx-runtime").JSX.Element;
20
+ export default function AxisDropZone({ config, fields, onDrop, onRemove, onDragStart, onDragOver, getFieldStyling, onReorder }: AxisDropZoneProps): import("react/jsx-runtime").JSX.Element;
20
21
  export {};