File tree Expand file tree Collapse file tree 4 files changed +60
-48
lines changed Expand file tree Collapse file tree 4 files changed +60
-48
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ CubejsServerCore.create({
289
289
const user = authInfo .u ;
290
290
if (user .filterByRegion ) {
291
291
query .filters .push ({
292
- dimension : ' Regions.id' ,
292
+ member : ' Regions.id' ,
293
293
operator: ' equals' ,
294
294
values: [user .regionId ]
295
295
})
Original file line number Diff line number Diff line change
1
+ declare module "@cubejs-backend/api-gateway" {
2
+ export interface QueryFilter {
3
+ member : string ;
4
+ operator :
5
+ | "equals"
6
+ | "notEquals"
7
+ | "contains"
8
+ | "notContains"
9
+ | "gt"
10
+ | "gte"
11
+ | "lt"
12
+ | "lte"
13
+ | "set"
14
+ | "notSet"
15
+ | "inDateRange"
16
+ | "notInDateRange"
17
+ | "beforeDate"
18
+ | "afterDate" ;
19
+ values ?: string [ ] ;
20
+ }
21
+
22
+ export type QueryTimeDimensionGranularity =
23
+ | "hour"
24
+ | "day"
25
+ | "week"
26
+ | "month"
27
+ | "year" ;
28
+
29
+ export interface QueryTimeDimension {
30
+ dimension : string ;
31
+ dateRange ?: string [ ] | string ;
32
+ granularity ?: QueryTimeDimensionGranularity ;
33
+ }
34
+
35
+ export interface Query {
36
+ measures : string [ ] ;
37
+ dimensions ?: string [ ] ;
38
+ filters ?: QueryFilter [ ] ;
39
+ timeDimensions ?: QueryTimeDimension [ ] ;
40
+ segments ?: string [ ] ;
41
+ limit ?: number ;
42
+ offset ?: number ;
43
+ order ?: "asc" | "desc" ;
44
+ timezone ?: string ;
45
+ renewQuery ?: boolean ;
46
+ ungrouped ?: boolean ;
47
+ }
48
+
49
+ export interface NormalizedQuery extends Query {
50
+ filters ?: NormalizedQueryFilter [ ] ;
51
+ rowLimit ?: number ;
52
+ }
53
+
54
+ export interface NormalizedQueryFilter extends QueryFilter {
55
+ dimension ?: string ;
56
+ }
57
+ }
Original file line number Diff line number Diff line change 15
15
"test" : " jest"
16
16
},
17
17
"main" : " index.js" ,
18
+ "types" : " index.d.ts" ,
18
19
"dependencies" : {
19
20
"@hapi/joi" : " ^15.1.1" ,
20
21
"chrono-node" : " ^1.3.11" ,
Original file line number Diff line number Diff line change 3
3
Response as ExpressResponse ,
4
4
NextFunction as ExpressNextFunction
5
5
} from "express" ;
6
+ import { NormalizedQuery as Query } from "@cubejs-backend/api-gateway" ;
6
7
7
8
declare module "@cubejs-backend/server-core" {
8
9
export function create ( options ?: CreateOptions ) : any ;
@@ -99,51 +100,4 @@ declare module "@cubejs-backend/server-core" {
99
100
| "redshift"
100
101
| "snowflake"
101
102
| "sqlite" ;
102
-
103
- export interface QueryFilter {
104
- member : string ;
105
- operator :
106
- | "equals"
107
- | "notEquals"
108
- | "contains"
109
- | "notContains"
110
- | "gt"
111
- | "gte"
112
- | "lt"
113
- | "lte"
114
- | "set"
115
- | "notSet"
116
- | "inDateRange"
117
- | "notInDateRange"
118
- | "beforeDate"
119
- | "afterDate" ;
120
- values ?: string [ ] ;
121
- }
122
-
123
- export type QueryTimeDimensionGranularity =
124
- | "hour"
125
- | "day"
126
- | "week"
127
- | "month"
128
- | "year" ;
129
-
130
- export interface QueryTimeDimension {
131
- dimension : string ;
132
- dateRange ?: string [ ] | string ;
133
- granularity ?: QueryTimeDimensionGranularity ;
134
- }
135
-
136
- export interface Query {
137
- measures : string [ ] ;
138
- dimensions ?: string [ ] ;
139
- filters ?: QueryFilter [ ] ;
140
- timeDimensions ?: QueryTimeDimension [ ] ;
141
- segments ?: string [ ] ;
142
- limit ?: number ;
143
- offset ?: number ;
144
- order ?: "asc" | "desc" ;
145
- timezone ?: string ;
146
- renewQuery ?: boolean ;
147
- ungrouped ?: boolean ;
148
- }
149
103
}
You can’t perform that action at this time.
0 commit comments