File tree Expand file tree Collapse file tree 12 files changed +154
-67
lines changed
cubejs-client-ws-transport/src Expand file tree Collapse file tree 12 files changed +154
-67
lines changed Original file line number Diff line number Diff line change
1
+ const uuid = require ( 'uuid/v4' ) ;
1
2
const UserError = require ( './UserError' ) ;
2
3
3
4
const methodParams = {
@@ -61,7 +62,8 @@ class SubscriptionServer {
61
62
throw new UserError ( `Unsupported method: ${ message . method } ` ) ;
62
63
}
63
64
64
- const requestId = message . requestId || `${ connectionId } -${ message . messageId } ` ;
65
+ const baseRequestId = message . requestId || `${ connectionId } -${ message . messageId } ` ;
66
+ const requestId = `${ baseRequestId } -span-${ uuid ( ) } ` ;
65
67
context = await this . apiGateway . contextByReq ( message , authContext . authInfo , requestId ) ;
66
68
67
69
const allowedParams = methodParams [ message . method ] ;
Original file line number Diff line number Diff line change @@ -450,7 +450,7 @@ class ApiGateway {
450
450
// TODO subscribe to refreshKeys instead of constantly firing load
451
451
await this . load ( {
452
452
query,
453
- context : { ... context , requestId : ` ${ context . requestId } - ${ uuid ( ) } ` } ,
453
+ context,
454
454
res : ( message , opts ) => {
455
455
if ( message . error ) {
456
456
error = { message, opts } ;
Original file line number Diff line number Diff line change 2
2
# yarn lockfile v1
3
3
4
4
5
- " @cubejs-backend/query-orchestrator@^0.17.9 " :
6
- version "0.17.9 "
7
- resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.17.9 .tgz#5da93cc1a47712c1510d63a326a3615fa7c8aa4c "
8
- integrity sha512-8VMxSPOp5XQbn3xsB9ncYDPyWIntTbFGPveDO3iwiQQEn2dBQm3JhcbRysxyq01IgdKRyJcHt01tFqtQOIKGvA ==
5
+ " @cubejs-backend/query-orchestrator@^0.18.3 " :
6
+ version "0.18.3 "
7
+ resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.18.3 .tgz#a05825432699ace9987457779d64f1bae3e7b196 "
8
+ integrity sha512-piqdLy2ni+x+B1WDydrM3FFWbS7Zc1ZkkaiRj9bHSPGyOaobuAnWZD/ps4/rRmgkE/57Dq9+I7lmkUQdbxDiJQ ==
9
9
dependencies :
10
- ramda "^0.24.1"
10
+ generic-pool "^3.7.1"
11
+ ramda "^0.27.0"
11
12
redis "^2.8.0"
12
13
13
14
aws-sdk@^2.403.0 :
@@ -49,6 +50,11 @@ events@1.1.1:
49
50
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
50
51
integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=
51
52
53
+ generic-pool@^3.7.1 :
54
+ version "3.7.1"
55
+ resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.7.1.tgz#36fe5bb83e7e0e032e5d32cd05dc00f5ff119aa8"
56
+ integrity sha512-ug6DAZoNgWm6q5KhPFA+hzXfBLFQu5sTXxPpv44DmE0A2g+CiHoq9LTVdkXpZMkYVMoGw83F6W+WT0h0MFMK/w==
57
+
52
58
ieee754@1.1.8 :
53
59
version "1.1.8"
54
60
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
@@ -79,10 +85,10 @@ querystring@0.2.0:
79
85
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
80
86
integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
81
87
82
- ramda@^0.24.1 :
83
- version "0.24.1 "
84
- resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1 .tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857 "
85
- integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc =
88
+ ramda@^0.27.0 :
89
+ version "0.27.0 "
90
+ resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0 .tgz#915dc29865c0800bf3f69b8fd6c279898b59de43 "
91
+ integrity sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA= =
86
92
87
93
redis-commands@^1.2.0 :
88
94
version "1.4.0"
Original file line number Diff line number Diff line change 2
2
# yarn lockfile v1
3
3
4
4
5
- " @cubejs-backend/query-orchestrator@^0.17.10 " :
6
- version "0.17.10 "
7
- resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.17.10 .tgz#44604f30acee7c65a4dde92af662aad605d195af "
8
- integrity sha512-hmNWfaFapKZPS4ePIYvjxMelUKd2KIPdLh0vikcdhVCj++M9+0fyFnEUvpoPdYjc8jciksVEfA7ehId0C6xE3Q ==
5
+ " @cubejs-backend/query-orchestrator@^0.18.3 " :
6
+ version "0.18.3 "
7
+ resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.18.3 .tgz#a05825432699ace9987457779d64f1bae3e7b196 "
8
+ integrity sha512-piqdLy2ni+x+B1WDydrM3FFWbS7Zc1ZkkaiRj9bHSPGyOaobuAnWZD/ps4/rRmgkE/57Dq9+I7lmkUQdbxDiJQ ==
9
9
dependencies :
10
- ramda "^0.24.1"
10
+ generic-pool "^3.7.1"
11
+ ramda "^0.27.0"
11
12
redis "^2.8.0"
12
13
13
14
" @google-cloud/bigquery@^4.1.4 " :
@@ -252,6 +253,11 @@ gcp-metadata@^2.0.0:
252
253
gaxios "^2.0.0"
253
254
json-bigint "^0.3.0"
254
255
256
+ generic-pool@^3.7.1 :
257
+ version "3.7.1"
258
+ resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.7.1.tgz#36fe5bb83e7e0e032e5d32cd05dc00f5ff119aa8"
259
+ integrity sha512-ug6DAZoNgWm6q5KhPFA+hzXfBLFQu5sTXxPpv44DmE0A2g+CiHoq9LTVdkXpZMkYVMoGw83F6W+WT0h0MFMK/w==
260
+
255
261
google-auth-library@^4.0.0 :
256
262
version "4.2.5"
257
263
resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-4.2.5.tgz#79b8ce6843525cb3a6e61cf97abef333d1386bd5"
@@ -381,11 +387,6 @@ process-nextick-args@~2.0.0:
381
387
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
382
388
integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
383
389
384
- ramda@^0.24.1 :
385
- version "0.24.1"
386
- resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857"
387
- integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc=
388
-
389
390
ramda@^0.27.0 :
390
391
version "0.27.0"
391
392
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0.tgz#915dc29865c0800bf3f69b8fd6c279898b59de43"
Original file line number Diff line number Diff line change @@ -723,6 +723,9 @@ var operators = {
723
723
title : '<='
724
724
} ]
725
725
} ;
726
+ /**
727
+ * Contains information about available cubes and it's members.
728
+ */
726
729
727
730
var Meta =
728
731
/*#__PURE__*/
@@ -749,6 +752,24 @@ function () {
749
752
return c [ memberType ] ;
750
753
} ) ) ;
751
754
}
755
+ /**
756
+ * Get meta information for member of a cube
757
+ * Member meta information contains:
758
+ * ```javascript
759
+ * {
760
+ * name,
761
+ * title,
762
+ * shortTitle,
763
+ * type,
764
+ * description,
765
+ * format
766
+ * }
767
+ * ```
768
+ * @param memberName - Fully qualified member name in a form `Cube.memberName`
769
+ * @param memberType - `measures`, `dimensions` or `segments`
770
+ * @return {Object } containing meta information about member
771
+ */
772
+
752
773
} , {
753
774
key : "resolveMember" ,
754
775
value : function resolveMember ( memberName , memberType ) {
@@ -1465,7 +1486,7 @@ function () {
1465
1486
* @name cubejs
1466
1487
* @param apiToken - [API token](security) is used to authorize requests and determine SQL database you're accessing.
1467
1488
* In the development mode, Cube.js Backend will print the API token to the console on on startup.
1468
- * Can be an async function without arguments that returns API token.
1489
+ * Can be an async function without arguments that returns API token. Optional.
1469
1490
* @param options - options object.
1470
1491
* @param options.apiUrl - URL of your Cube.js Backend.
1471
1492
* By default, in the development environment it is `http://localhost:4000/cubejs-api/v1`.
Original file line number Diff line number Diff line change @@ -729,6 +729,9 @@ var operators = {
729
729
title : '<='
730
730
} ]
731
731
} ;
732
+ /**
733
+ * Contains information about available cubes and it's members.
734
+ */
732
735
733
736
var Meta =
734
737
/*#__PURE__*/
@@ -755,6 +758,24 @@ function () {
755
758
return c [ memberType ] ;
756
759
} ) ) ;
757
760
}
761
+ /**
762
+ * Get meta information for member of a cube
763
+ * Member meta information contains:
764
+ * ```javascript
765
+ * {
766
+ * name,
767
+ * title,
768
+ * shortTitle,
769
+ * type,
770
+ * description,
771
+ * format
772
+ * }
773
+ * ```
774
+ * @param memberName - Fully qualified member name in a form `Cube.memberName`
775
+ * @param memberType - `measures`, `dimensions` or `segments`
776
+ * @return {Object } containing meta information about member
777
+ */
778
+
758
779
} , {
759
780
key : "resolveMember" ,
760
781
value : function resolveMember ( memberName , memberType ) {
@@ -1471,7 +1492,7 @@ function () {
1471
1492
* @name cubejs
1472
1493
* @param apiToken - [API token](security) is used to authorize requests and determine SQL database you're accessing.
1473
1494
* In the development mode, Cube.js Backend will print the API token to the console on on startup.
1474
- * Can be an async function without arguments that returns API token.
1495
+ * Can be an async function without arguments that returns API token. Optional.
1475
1496
* @param options - options object.
1476
1497
* @param options.apiUrl - URL of your Cube.js Backend.
1477
1498
* By default, in the development environment it is `http://localhost:4000/cubejs-api/v1`.
Original file line number Diff line number Diff line change 14244
14244
title : '<='
14245
14245
} ]
14246
14246
} ;
14247
+ /**
14248
+ * Contains information about available cubes and it's members.
14249
+ */
14247
14250
14248
14251
var Meta =
14249
14252
/*#__PURE__*/
14270
14273
return c [ memberType ] ;
14271
14274
} ) ) ;
14272
14275
}
14276
+ /**
14277
+ * Get meta information for member of a cube
14278
+ * Member meta information contains:
14279
+ * ```javascript
14280
+ * {
14281
+ * name,
14282
+ * title,
14283
+ * shortTitle,
14284
+ * type,
14285
+ * description,
14286
+ * format
14287
+ * }
14288
+ * ```
14289
+ * @param memberName - Fully qualified member name in a form `Cube.memberName`
14290
+ * @param memberType - `measures`, `dimensions` or `segments`
14291
+ * @return {Object } containing meta information about member
14292
+ */
14293
+
14273
14294
} , {
14274
14295
key : "resolveMember" ,
14275
14296
value : function resolveMember ( memberName , memberType ) {
15916
15937
* @name cubejs
15917
15938
* @param apiToken - [API token](security) is used to authorize requests and determine SQL database you're accessing.
15918
15939
* In the development mode, Cube.js Backend will print the API token to the console on on startup.
15919
- * Can be an async function without arguments that returns API token.
15940
+ * Can be an async function without arguments that returns API token. Optional.
15920
15941
* @param options - options object.
15921
15942
* @param options.apiUrl - URL of your Cube.js Backend.
15922
15943
* By default, in the development environment it is `http://localhost:4000/cubejs-api/v1`.
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ class WebSocketTransport {
126
126
request ( method , { baseRequestId, ...params } ) {
127
127
const message = {
128
128
messageId : this . messageCounter ++ ,
129
+ requestId : baseRequestId ,
129
130
method,
130
131
params
131
132
} ;
@@ -150,14 +151,9 @@ class WebSocketTransport {
150
151
151
152
const transport = this ;
152
153
153
- let spanCounter = 1 ;
154
-
155
154
return {
156
155
async subscribe ( callback ) {
157
- transport . sendMessage ( {
158
- requestId : baseRequestId && `${ baseRequestId } -span-${ spanCounter ++ } ` ,
159
- ...message
160
- } ) ;
156
+ transport . sendMessage ( message ) ;
161
157
const result = await new Promise ( ( resolve ) => {
162
158
nextMessage = resolve ;
163
159
if ( pendingResults . length ) {
Original file line number Diff line number Diff line change 2
2
# yarn lockfile v1
3
3
4
4
5
- " @cubejs-backend/query-orchestrator@^0.17.10 " :
6
- version "0.17.10 "
7
- resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.17.10 .tgz#44604f30acee7c65a4dde92af662aad605d195af "
8
- integrity sha512-hmNWfaFapKZPS4ePIYvjxMelUKd2KIPdLh0vikcdhVCj++M9+0fyFnEUvpoPdYjc8jciksVEfA7ehId0C6xE3Q ==
5
+ " @cubejs-backend/query-orchestrator@^0.18.3 " :
6
+ version "0.18.3 "
7
+ resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.18.3 .tgz#a05825432699ace9987457779d64f1bae3e7b196 "
8
+ integrity sha512-piqdLy2ni+x+B1WDydrM3FFWbS7Zc1ZkkaiRj9bHSPGyOaobuAnWZD/ps4/rRmgkE/57Dq9+I7lmkUQdbxDiJQ ==
9
9
dependencies :
10
- ramda "^0.24.1"
10
+ generic-pool "^3.7.1"
11
+ ramda "^0.27.0"
11
12
redis "^2.8.0"
12
13
13
14
abbrev@1 :
@@ -59,7 +60,7 @@ escape-string-regexp@~1.0.5:
59
60
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
60
61
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
61
62
62
- generic-pool@^3.6.0 :
63
+ generic-pool@^3.6.0, generic-pool@^3.7.1 :
63
64
version "3.7.1"
64
65
resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.7.1.tgz#36fe5bb83e7e0e032e5d32cd05dc00f5ff119aa8"
65
66
integrity sha512-ug6DAZoNgWm6q5KhPFA+hzXfBLFQu5sTXxPpv44DmE0A2g+CiHoq9LTVdkXpZMkYVMoGw83F6W+WT0h0MFMK/w==
@@ -208,10 +209,10 @@ q@1.0.x:
208
209
resolved "https://registry.yarnpkg.com/q/-/q-1.0.1.tgz#11872aeedee89268110b10a718448ffb10112a14"
209
210
integrity sha1-EYcq7t7okmgRCxCnGESP+xARKhQ=
210
211
211
- ramda@^0.24.1 :
212
- version "0.24.1 "
213
- resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1 .tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857 "
214
- integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc =
212
+ ramda@^0.27.0 :
213
+ version "0.27.0 "
214
+ resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0 .tgz#915dc29865c0800bf3f69b8fd6c279898b59de43 "
215
+ integrity sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA= =
215
216
216
217
redis-commands@^1.2.0 :
217
218
version "1.5.0"
Original file line number Diff line number Diff line change 2
2
# yarn lockfile v1
3
3
4
4
5
- " @cubejs-backend/query-orchestrator@^0.17.10 " :
6
- version "0.17.10 "
7
- resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.17.10 .tgz#44604f30acee7c65a4dde92af662aad605d195af "
8
- integrity sha512-hmNWfaFapKZPS4ePIYvjxMelUKd2KIPdLh0vikcdhVCj++M9+0fyFnEUvpoPdYjc8jciksVEfA7ehId0C6xE3Q ==
5
+ " @cubejs-backend/query-orchestrator@^0.18.3 " :
6
+ version "0.18.3 "
7
+ resolved "https://registry.yarnpkg.com/@cubejs-backend/query-orchestrator/-/query-orchestrator-0.18.3 .tgz#a05825432699ace9987457779d64f1bae3e7b196 "
8
+ integrity sha512-piqdLy2ni+x+B1WDydrM3FFWbS7Zc1ZkkaiRj9bHSPGyOaobuAnWZD/ps4/rRmgkE/57Dq9+I7lmkUQdbxDiJQ ==
9
9
dependencies :
10
- ramda "^0.24.1"
10
+ generic-pool "^3.7.1"
11
+ ramda "^0.27.0"
11
12
redis "^2.8.0"
12
13
13
14
ansicolors@~0.3.2 :
@@ -50,6 +51,11 @@ generic-pool@^3.6.0:
50
51
resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.6.0.tgz#34e3124d9af754c8bfee7c15906e7347dc543afc"
51
52
integrity sha512-9tRjIJzgW+ZyYeFBhfLRUefnQwF+IFfEsUkdZB5o75/gb4OZWnYb4ZjPcZc1bl9ofhWCN2rGhXa0SQwF64jTLw==
52
53
54
+ generic-pool@^3.7.1 :
55
+ version "3.7.1"
56
+ resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.7.1.tgz#36fe5bb83e7e0e032e5d32cd05dc00f5ff119aa8"
57
+ integrity sha512-ug6DAZoNgWm6q5KhPFA+hzXfBLFQu5sTXxPpv44DmE0A2g+CiHoq9LTVdkXpZMkYVMoGw83F6W+WT0h0MFMK/w==
58
+
53
59
iconv-lite@^0.5.0 :
54
60
version "0.5.1"
55
61
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.5.1.tgz#b2425d3c7b18f7219f2ca663d103bddb91718d64"
@@ -109,10 +115,10 @@ pseudomap@^1.0.2:
109
115
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
110
116
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
111
117
112
- ramda@^0.24.1 :
113
- version "0.24.1 "
114
- resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1 .tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857 "
115
- integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc =
118
+ ramda@^0.27.0 :
119
+ version "0.27.0 "
120
+ resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0 .tgz#915dc29865c0800bf3f69b8fd6c279898b59de43 "
121
+ integrity sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA= =
116
122
117
123
redeyed@~2.1.0 :
118
124
version "2.1.1"
You can’t perform that action at this time.
0 commit comments