@thoughtspot/visual-embed-sdk 1.24.1 → 1.24.2
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/cjs/package.json +1 -1
- package/cjs/src/embed/app.d.ts +22 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -4
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +1 -4
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +22 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +1 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +1 -10
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +2 -2
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +0 -21
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.js +1 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +10 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/src/embed/app.d.ts +22 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -4
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +22 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +1 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +0 -21
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +17 -14
- package/dist/tsembed-react.js +17 -14
- package/dist/tsembed.es.js +18 -18
- package/dist/tsembed.js +18 -18
- package/dist/visual-embed-sdk-react-full.d.ts +48 -30
- package/dist/visual-embed-sdk-react.d.ts +48 -30
- package/dist/visual-embed-sdk.d.ts +48 -30
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +22 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -4
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +1 -4
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +22 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +10 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/sage.d.ts +1 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +1 -10
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +2 -2
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +0 -21
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.js +1 -1
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +10 -0
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +48 -30
- package/package.json +1 -1
- package/src/embed/app.ts +28 -1
- package/src/embed/base.ts +1 -4
- package/src/embed/liveboard.ts +34 -1
- package/src/embed/sage.ts +7 -4
- package/src/embed/search-bar.tsx +10 -1
- package/src/embed/search.ts +5 -1
- package/src/embed/ts-embed.spec.ts +2 -2
- package/src/embed/ts-embed.ts +0 -12
- package/src/types.ts +0 -21
- package/src/utils.spec.ts +13 -0
- package/src/utils.ts +1 -1
- package/cjs/src/utils/answerService/answerService.d.ts +0 -34
- package/cjs/src/utils/answerService/answerService.d.ts.map +0 -1
- package/cjs/src/utils/answerService/answerService.js +0 -142
- package/cjs/src/utils/answerService/answerService.js.map +0 -1
- package/cjs/src/utils/answerService/answerService.spec.d.ts +0 -1
- package/cjs/src/utils/answerService/answerService.spec.d.ts.map +0 -1
- package/cjs/src/utils/answerService/answerService.spec.js +0 -1
- package/cjs/src/utils/answerService/answerService.spec.js.map +0 -1
- package/cjs/src/utils/answerService/graphql-queries.d.ts +0 -6
- package/cjs/src/utils/answerService/graphql-queries.d.ts.map +0 -1
- package/cjs/src/utils/answerService/graphql-queries.js +0 -123
- package/cjs/src/utils/answerService/graphql-queries.js.map +0 -1
- package/cjs/src/utils/answerService.d.ts +0 -10
- package/cjs/src/utils/answerService.d.ts.map +0 -1
- package/cjs/src/utils/answerService.js +0 -61
- package/cjs/src/utils/answerService.js.map +0 -1
- package/cjs/src/utils/answerService.spec.d.ts +0 -2
- package/cjs/src/utils/answerService.spec.d.ts.map +0 -1
- package/cjs/src/utils/answerService.spec.js +0 -31
- package/cjs/src/utils/answerService.spec.js.map +0 -1
- package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts +0 -5
- package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts.map +0 -1
- package/cjs/src/utils/graphql/answerService/graphql-queries.js +0 -80
- package/cjs/src/utils/graphql/answerService/graphql-queries.js.map +0 -1
- package/dist/src/utils/answerService.d.ts +0 -10
- package/dist/src/utils/answerService.d.ts.map +0 -1
- package/dist/src/utils/answerService.spec.d.ts +0 -2
- package/dist/src/utils/answerService.spec.d.ts.map +0 -1
- package/lib/src/.index.d.ts.swp +0 -0
- package/lib/src/utils/answerService/answerService.d.ts +0 -34
- package/lib/src/utils/answerService/answerService.d.ts.map +0 -1
- package/lib/src/utils/answerService/answerService.js +0 -137
- package/lib/src/utils/answerService/answerService.js.map +0 -1
- package/lib/src/utils/answerService/answerService.spec.d.ts +0 -1
- package/lib/src/utils/answerService/answerService.spec.d.ts.map +0 -1
- package/lib/src/utils/answerService/answerService.spec.js +0 -1
- package/lib/src/utils/answerService/answerService.spec.js.map +0 -1
- package/lib/src/utils/answerService/graphql-queries.d.ts +0 -6
- package/lib/src/utils/answerService/graphql-queries.d.ts.map +0 -1
- package/lib/src/utils/answerService/graphql-queries.js +0 -120
- package/lib/src/utils/answerService/graphql-queries.js.map +0 -1
- package/lib/src/utils/answerService.d.ts +0 -10
- package/lib/src/utils/answerService.d.ts.map +0 -1
- package/lib/src/utils/answerService.js +0 -57
- package/lib/src/utils/answerService.js.map +0 -1
- package/lib/src/utils/answerService.spec.d.ts +0 -2
- package/lib/src/utils/answerService.spec.d.ts.map +0 -1
- package/lib/src/utils/answerService.spec.js +0 -29
- package/lib/src/utils/answerService.spec.js.map +0 -1
- package/lib/src/utils/graphql/answerService/graphql-queries.d.ts +0 -5
- package/lib/src/utils/graphql/answerService/graphql-queries.d.ts.map +0 -1
- package/lib/src/utils/graphql/answerService/graphql-queries.js +0 -77
- package/lib/src/utils/graphql/answerService/graphql-queries.js.map +0 -1
package/src/embed/base.ts
CHANGED
|
@@ -258,7 +258,6 @@ export const renderInQueue = (fn: (next?: (val?: any) => void) => Promise<any>):
|
|
|
258
258
|
|
|
259
259
|
/**
|
|
260
260
|
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
261
|
-
*
|
|
262
261
|
* @param data
|
|
263
262
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
264
263
|
* @group Global methods
|
|
@@ -307,9 +306,7 @@ export const executeTML = async (data: executeTMLInput): Promise<any> => {
|
|
|
307
306
|
};
|
|
308
307
|
|
|
309
308
|
/**
|
|
310
|
-
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
311
|
-
* format.
|
|
312
|
-
*
|
|
309
|
+
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML format.
|
|
313
310
|
* @param data
|
|
314
311
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
315
312
|
* @group Global methods
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -29,7 +29,7 @@ import { V1Embed } from './ts-embed';
|
|
|
29
29
|
*
|
|
30
30
|
* @group Embed components
|
|
31
31
|
*/
|
|
32
|
-
export interface LiveboardViewConfig extends ViewConfig {
|
|
32
|
+
export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageModules' | 'hiddenHomeLeftNavItems'> {
|
|
33
33
|
/**
|
|
34
34
|
* If set to true, the embedded object container dynamically resizes
|
|
35
35
|
* according to the height of the Liveboard.
|
|
@@ -106,6 +106,27 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
106
106
|
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
|
|
107
107
|
*/
|
|
108
108
|
hideTabPanel?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Boolean to hide liveboard header
|
|
111
|
+
*
|
|
112
|
+
* @version SDK: 1.23.0 | Thoughtspot: 9.6.0.cl
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
hideLiveboardHeader?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Boolean to show liveboard title
|
|
118
|
+
*
|
|
119
|
+
* @version SDK: 1.23.0 | Thoughtspot: 9.6.0.cl
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
showLiveboardTitle?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Boolean to show liveboard description
|
|
125
|
+
*
|
|
126
|
+
* @version SDK: 1.23.0 | Thoughtspot: 9.6.0.cl
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
showLiveboardDescription?: boolean;
|
|
109
130
|
/**
|
|
110
131
|
* The list of parameter override to apply to a Liveboard.
|
|
111
132
|
*/
|
|
@@ -161,6 +182,9 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
161
182
|
vizId,
|
|
162
183
|
hideTabPanel,
|
|
163
184
|
activeTabId,
|
|
185
|
+
hideLiveboardHeader,
|
|
186
|
+
showLiveboardDescription,
|
|
187
|
+
showLiveboardTitle,
|
|
164
188
|
runtimeParameters,
|
|
165
189
|
} = this.viewConfig;
|
|
166
190
|
|
|
@@ -192,6 +216,15 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
192
216
|
if (hideTabPanel) {
|
|
193
217
|
params[Param.HideTabPanel] = hideTabPanel;
|
|
194
218
|
}
|
|
219
|
+
if (hideLiveboardHeader) {
|
|
220
|
+
params[Param.HideLiveboardHeader] = hideLiveboardHeader;
|
|
221
|
+
}
|
|
222
|
+
if (showLiveboardDescription) {
|
|
223
|
+
params[Param.ShowLiveboardDescription] = showLiveboardDescription;
|
|
224
|
+
}
|
|
225
|
+
if (showLiveboardTitle) {
|
|
226
|
+
params[Param.ShowLiveboardTitle] = showLiveboardTitle;
|
|
227
|
+
}
|
|
195
228
|
let queryParams = getQueryParamString(params, true);
|
|
196
229
|
|
|
197
230
|
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
package/src/embed/sage.ts
CHANGED
|
@@ -37,7 +37,11 @@ export interface SearchOptions {
|
|
|
37
37
|
* @version: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
|
|
38
38
|
* @group Embed components
|
|
39
39
|
*/
|
|
40
|
-
export interface SageViewConfig
|
|
40
|
+
export interface SageViewConfig
|
|
41
|
+
extends Omit<
|
|
42
|
+
ViewConfig,
|
|
43
|
+
'hiddenHomepageModules' | 'hiddenHomeLeftNavItems' | 'hiddenTabs' | 'visibleTabs'
|
|
44
|
+
> {
|
|
41
45
|
/**
|
|
42
46
|
* If set to true, a list of liveboard and answers related
|
|
43
47
|
* to the natural language search will be shown below the
|
|
@@ -47,11 +51,11 @@ export interface SageViewConfig extends ViewConfig {
|
|
|
47
51
|
/**
|
|
48
52
|
* flag to disable changing worksheet. default false.
|
|
49
53
|
*/
|
|
50
|
-
disableWorksheetChange?: boolean
|
|
54
|
+
disableWorksheetChange?: boolean;
|
|
51
55
|
/**
|
|
52
56
|
* flag to hide worksheet selector. default false.
|
|
53
57
|
*/
|
|
54
|
-
hideWorksheetSelector?: boolean
|
|
58
|
+
hideWorksheetSelector?: boolean;
|
|
55
59
|
/**
|
|
56
60
|
* If set to true, the search suggestions will contain existing
|
|
57
61
|
* liveboards and answers in addition with the autocomplete
|
|
@@ -75,7 +79,6 @@ export interface SageViewConfig extends ViewConfig {
|
|
|
75
79
|
* Configuration for search options
|
|
76
80
|
*/
|
|
77
81
|
searchOptions?: SearchOptions;
|
|
78
|
-
|
|
79
82
|
}
|
|
80
83
|
export const HiddenActionItemByDefaultForSageEmbed = [
|
|
81
84
|
Action.Save,
|
package/src/embed/search-bar.tsx
CHANGED
|
@@ -7,7 +7,16 @@ import { SearchOptions } from './search';
|
|
|
7
7
|
* @group Embed components
|
|
8
8
|
*/
|
|
9
9
|
export interface SearchBarViewConfig
|
|
10
|
-
extends Omit<
|
|
10
|
+
extends Omit<
|
|
11
|
+
ViewConfig,
|
|
12
|
+
| 'runtimeFilters'
|
|
13
|
+
| 'showAlerts'
|
|
14
|
+
| 'dataPanelV2'
|
|
15
|
+
| 'hiddenHomepageModules'
|
|
16
|
+
| 'hiddenHomeLeftNavItems'
|
|
17
|
+
| 'hiddenTabs'
|
|
18
|
+
| 'visibleTabs'
|
|
19
|
+
> {
|
|
11
20
|
/**
|
|
12
21
|
* The array of data source GUIDs to set on load.
|
|
13
22
|
* Only a single dataSource supported currently.
|
package/src/embed/search.ts
CHANGED
|
@@ -50,7 +50,11 @@ export interface SearchOptions {
|
|
|
50
50
|
*
|
|
51
51
|
* @group Embed components
|
|
52
52
|
*/
|
|
53
|
-
export interface SearchViewConfig
|
|
53
|
+
export interface SearchViewConfig
|
|
54
|
+
extends Omit<
|
|
55
|
+
ViewConfig,
|
|
56
|
+
'hiddenHomepageModules' | 'hiddenHomeLeftNavItems' | 'hiddenTabs' | 'visibleTabs'
|
|
57
|
+
> {
|
|
54
58
|
/**
|
|
55
59
|
* If set to true, the data sources panel is collapsed on load,
|
|
56
60
|
* but can be expanded manually.
|
|
@@ -163,7 +163,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
163
163
|
HomepageModule.Learning,
|
|
164
164
|
];
|
|
165
165
|
|
|
166
|
-
const searchEmbed = new
|
|
166
|
+
const searchEmbed = new AppEmbed(getRootEl(), {
|
|
167
167
|
...defaultViewConfig,
|
|
168
168
|
hiddenHomepageModules: mockedHiddenHomepageModules,
|
|
169
169
|
});
|
|
@@ -317,7 +317,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
317
317
|
HomeLeftNavItem.Documentation,
|
|
318
318
|
];
|
|
319
319
|
|
|
320
|
-
const searchEmbed = new
|
|
320
|
+
const searchEmbed = new AppEmbed(getRootEl(), {
|
|
321
321
|
...defaultViewConfig,
|
|
322
322
|
hiddenHomeLeftNavItems: mockedHiddenHomeLeftNavItems,
|
|
323
323
|
});
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -384,9 +384,6 @@ export class TsEmbed {
|
|
|
384
384
|
contextMenuTrigger,
|
|
385
385
|
linkOverride,
|
|
386
386
|
insertInToSlide,
|
|
387
|
-
hideLiveboardHeader,
|
|
388
|
-
showLiveboardDescription,
|
|
389
|
-
showLiveboardTitle,
|
|
390
387
|
} = this.viewConfig;
|
|
391
388
|
|
|
392
389
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
@@ -454,15 +451,6 @@ export class TsEmbed {
|
|
|
454
451
|
if (insertInToSlide) {
|
|
455
452
|
queryParams[Param.ShowInsertToSlide] = insertInToSlide;
|
|
456
453
|
}
|
|
457
|
-
if (hideLiveboardHeader) {
|
|
458
|
-
queryParams[Param.HideLiveboardHeader] = hideLiveboardHeader;
|
|
459
|
-
}
|
|
460
|
-
if (showLiveboardDescription) {
|
|
461
|
-
queryParams[Param.ShowLiveboardDescription] = showLiveboardDescription;
|
|
462
|
-
}
|
|
463
|
-
if (showLiveboardTitle) {
|
|
464
|
-
queryParams[Param.ShowLiveboardTitle] = showLiveboardTitle;
|
|
465
|
-
}
|
|
466
454
|
|
|
467
455
|
return queryParams;
|
|
468
456
|
}
|
package/src/types.ts
CHANGED
|
@@ -713,27 +713,6 @@ export interface ViewConfig {
|
|
|
713
713
|
* @hidden
|
|
714
714
|
*/
|
|
715
715
|
excludeRuntimeFiltersfromURL?: boolean;
|
|
716
|
-
/**
|
|
717
|
-
* Boolean to hide liveboard header
|
|
718
|
-
*
|
|
719
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
720
|
-
* @default false
|
|
721
|
-
*/
|
|
722
|
-
hideLiveboardHeader?: boolean;
|
|
723
|
-
/**
|
|
724
|
-
* Boolean to show liveboard title
|
|
725
|
-
*
|
|
726
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
727
|
-
* @default false
|
|
728
|
-
*/
|
|
729
|
-
showLiveboardTitle?: boolean;
|
|
730
|
-
/**
|
|
731
|
-
* Boolean to show liveboard description
|
|
732
|
-
*
|
|
733
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
734
|
-
* @default false
|
|
735
|
-
*/
|
|
736
|
-
showLiveboardDescription?: boolean;
|
|
737
716
|
/**
|
|
738
717
|
* The list of tab IDs to hide from the embedded.
|
|
739
718
|
* This Tabs will be hidden from their respective LBs.
|
package/src/utils.spec.ts
CHANGED
|
@@ -32,6 +32,19 @@ describe('unit test for utils', () => {
|
|
|
32
32
|
).toBe('bar=baz');
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
test('getFilterQuery should encode URL params', () => {
|
|
36
|
+
expect(getFilterQuery([])).toBe(null);
|
|
37
|
+
|
|
38
|
+
expect(
|
|
39
|
+
getFilterQuery([
|
|
40
|
+
{
|
|
41
|
+
columnName: 'foo',
|
|
42
|
+
operator: RuntimeFilterOp.NE,
|
|
43
|
+
values: ['bar+'],
|
|
44
|
+
},
|
|
45
|
+
]),
|
|
46
|
+
).toBe('col1=foo&op1=NE&val1=bar%2B');
|
|
47
|
+
});
|
|
35
48
|
test('getFilterQuery', () => {
|
|
36
49
|
expect(getFilterQuery([])).toBe(null);
|
|
37
50
|
|
package/src/utils.ts
CHANGED
|
@@ -33,7 +33,7 @@ export const getFilterQuery = (runtimeFilters: RuntimeFilter[]): string => {
|
|
|
33
33
|
const filterExpr = [];
|
|
34
34
|
filterExpr.push(`col${index}=${filter.columnName}`);
|
|
35
35
|
filterExpr.push(`op${index}=${filter.operator}`);
|
|
36
|
-
filterExpr.push(filter.values.map((value) => `val${index}=${value}`).join('&'));
|
|
36
|
+
filterExpr.push(filter.values.map((value) => `val${index}=${encodeURIComponent(value)}`).join('&'));
|
|
37
37
|
|
|
38
38
|
return filterExpr.join('&');
|
|
39
39
|
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface SessionInterface {
|
|
2
|
-
sessionId: string;
|
|
3
|
-
genNo: number;
|
|
4
|
-
acSession: {
|
|
5
|
-
sessionId: string;
|
|
6
|
-
genNo: number;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare enum OperationType {
|
|
10
|
-
GetChartWithData = "GetChartWithData",
|
|
11
|
-
GetTableWithHeadlineData = "GetTableWithHeadlineData"
|
|
12
|
-
}
|
|
13
|
-
export declare class AnswerService {
|
|
14
|
-
private session;
|
|
15
|
-
private answer;
|
|
16
|
-
private thoughtSpotHost;
|
|
17
|
-
constructor(session: SessionInterface, answer: any, thoughtSpotHost: string);
|
|
18
|
-
getSourceDetail(): Promise<any>;
|
|
19
|
-
removeColumns(columnIds: string[]): Promise<any>;
|
|
20
|
-
addColumns(columnIds: string[]): Promise<any>;
|
|
21
|
-
fetchData(offset?: number, size?: number): Promise<{
|
|
22
|
-
columns: any;
|
|
23
|
-
data: any;
|
|
24
|
-
}>;
|
|
25
|
-
getUnderlyingDataForPoint(selectedPoint: {
|
|
26
|
-
columnId: string;
|
|
27
|
-
dataValue: any;
|
|
28
|
-
}[], outputColumnNames: string[], offset: number, size: number): Promise<{
|
|
29
|
-
columns: any;
|
|
30
|
-
data: any;
|
|
31
|
-
}>;
|
|
32
|
-
executeQuery(query: string, variables: any): Promise<any>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=answerService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"answerService.d.ts","sourceRoot":"","sources":["../../../../src/utils/answerService/answerService.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAGD,oBAAY,aAAa;IACrB,gBAAgB,qBAAqB;IACrC,wBAAwB,6BAA6B;CACxD;AAED,qBAAa,aAAa;IAElB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,eAAe;gBAFf,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,GAAG,EACX,eAAe,EAAE,MAAM;IAKtB,eAAe;IAWf,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE;IASjC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE;IAS9B,SAAS,CAAC,MAAM,SAAI,EAAE,IAAI,SAAO;;;;IAmBjC,yBAAyB,CAClC,aAAa,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,GAAG,CAAA;KAAE,EAAE,EACrD,iBAAiB,EAAE,MAAM,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM;;;;IA4BH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG;CAa1D"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnswerService = exports.OperationType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
const queries = tslib_1.__importStar(require("./graphql-queries"));
|
|
7
|
-
// eslint-disable-next-line no-shadow
|
|
8
|
-
var OperationType;
|
|
9
|
-
(function (OperationType) {
|
|
10
|
-
OperationType["GetChartWithData"] = "GetChartWithData";
|
|
11
|
-
OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
|
|
12
|
-
})(OperationType = exports.OperationType || (exports.OperationType = {}));
|
|
13
|
-
class AnswerService {
|
|
14
|
-
constructor(session, answer, thoughtSpotHost) {
|
|
15
|
-
this.session = session;
|
|
16
|
-
this.answer = answer;
|
|
17
|
-
this.thoughtSpotHost = thoughtSpotHost;
|
|
18
|
-
this.session = (0, utils_1.removeTypename)(session);
|
|
19
|
-
}
|
|
20
|
-
async getSourceDetail() {
|
|
21
|
-
const details = await graphqlQuery({
|
|
22
|
-
query: queries.getSourceDetail,
|
|
23
|
-
variables: {
|
|
24
|
-
ids: [this.answer.sources[0].header.guid],
|
|
25
|
-
},
|
|
26
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
27
|
-
});
|
|
28
|
-
return details[0];
|
|
29
|
-
}
|
|
30
|
-
async removeColumns(columnIds) {
|
|
31
|
-
return this.executeQuery(queries.removeColumns, {
|
|
32
|
-
logicalColumnIds: columnIds,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
async addColumns(columnIds) {
|
|
36
|
-
return this.executeQuery(queries.addColumns, {
|
|
37
|
-
columns: columnIds.map((colId) => ({ logicalColumnId: colId })),
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
async fetchData(offset = 0, size = 1000) {
|
|
41
|
-
const { answer } = await this.executeQuery(queries.getAnswerData, {
|
|
42
|
-
deadline: 0,
|
|
43
|
-
dataPaginationParams: {
|
|
44
|
-
isClientPaginated: true,
|
|
45
|
-
offset,
|
|
46
|
-
size,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
const { columns, data } = answer.visualizations[0];
|
|
50
|
-
return {
|
|
51
|
-
columns,
|
|
52
|
-
data,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
async getUnderlyingDataForPoint(selectedPoint, outputColumnNames, offset, size) {
|
|
56
|
-
const sourceDetail = await this.getSourceDetail();
|
|
57
|
-
const ouputColumnGuids = getGuidsFromColumnNames(sourceDetail, outputColumnNames);
|
|
58
|
-
const unAggAnswer = await graphqlQuery({
|
|
59
|
-
query: queries.getUnaggregatedAnswerSession,
|
|
60
|
-
variables: {
|
|
61
|
-
session: this.session,
|
|
62
|
-
columns: selectedPoint,
|
|
63
|
-
},
|
|
64
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
65
|
-
});
|
|
66
|
-
const unaggAnswerSession = new AnswerService(unAggAnswer.id, unAggAnswer.answer, this.thoughtSpotHost);
|
|
67
|
-
const currentColumns = new Set(unAggAnswer.answer.visualizations[0].columns.map((c) => c.column.referencedColumns[0].guid));
|
|
68
|
-
const columnsToAdd = [...ouputColumnGuids].filter((col) => !currentColumns.has(col));
|
|
69
|
-
if (columnsToAdd.length) {
|
|
70
|
-
await unaggAnswerSession.addColumns(columnsToAdd);
|
|
71
|
-
}
|
|
72
|
-
const columnsToRemove = [...currentColumns].filter((col) => !ouputColumnGuids.has(col));
|
|
73
|
-
if (columnsToRemove.length) {
|
|
74
|
-
await unaggAnswerSession.removeColumns(columnsToRemove);
|
|
75
|
-
}
|
|
76
|
-
return unaggAnswerSession.fetchData(offset, size);
|
|
77
|
-
}
|
|
78
|
-
async executeQuery(query, variables) {
|
|
79
|
-
const data = await graphqlQuery({
|
|
80
|
-
query,
|
|
81
|
-
variables: {
|
|
82
|
-
session: this.session,
|
|
83
|
-
...variables,
|
|
84
|
-
},
|
|
85
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
86
|
-
isCompositeQuery: false,
|
|
87
|
-
});
|
|
88
|
-
this.session = (0, utils_1.deepMerge)(this.session, data.id);
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.AnswerService = AnswerService;
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
* @param root0
|
|
96
|
-
* @param root0.query
|
|
97
|
-
* @param root0.variables
|
|
98
|
-
* @param root0.thoughtSpotHost
|
|
99
|
-
* @param root0.isCompositeQuery
|
|
100
|
-
*/
|
|
101
|
-
async function graphqlQuery({ query, variables, thoughtSpotHost, isCompositeQuery = false, }) {
|
|
102
|
-
const operationName = (0, utils_1.getOperationNameFromQuery)(query);
|
|
103
|
-
try {
|
|
104
|
-
const response = await fetch(`${thoughtSpotHost}/prism/?op=${operationName}`, {
|
|
105
|
-
method: 'POST',
|
|
106
|
-
headers: {
|
|
107
|
-
'content-type': 'application/json;charset=UTF-8',
|
|
108
|
-
'x-requested-by': 'ThoughtSpot',
|
|
109
|
-
accept: '*/*',
|
|
110
|
-
'accept-language': 'en-us',
|
|
111
|
-
},
|
|
112
|
-
body: JSON.stringify({
|
|
113
|
-
operationName,
|
|
114
|
-
query,
|
|
115
|
-
variables,
|
|
116
|
-
}),
|
|
117
|
-
credentials: 'include',
|
|
118
|
-
});
|
|
119
|
-
const result = await response.json();
|
|
120
|
-
const dataValues = Object.values(result.data);
|
|
121
|
-
return (isCompositeQuery) ? result.data : dataValues[0];
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
return error;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @param sourceDetail
|
|
130
|
-
* @param colNames
|
|
131
|
-
*/
|
|
132
|
-
function getGuidsFromColumnNames(sourceDetail, colNames) {
|
|
133
|
-
const cols = sourceDetail.columns.reduce((colSet, col) => {
|
|
134
|
-
colSet[col.name] = col;
|
|
135
|
-
return colSet;
|
|
136
|
-
}, {});
|
|
137
|
-
return new Set(colNames.map((colName) => {
|
|
138
|
-
const col = cols[colName];
|
|
139
|
-
return col.id;
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=answerService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"answerService.js","sourceRoot":"","sources":["../../../../src/utils/answerService/answerService.ts"],"names":[],"mappings":";;;;AAAA,uCAAmF;AACnF,mEAA6C;AAQ7C,qCAAqC;AACrC,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sDAAqC,CAAA;IACrC,sEAAqD,CAAA;AACzD,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,MAAa,aAAa;IACtB,YACY,OAAyB,EACzB,MAAW,EACX,eAAuB;QAFvB,YAAO,GAAP,OAAO,CAAkB;QACzB,WAAM,GAAN,MAAM,CAAK;QACX,oBAAe,GAAf,eAAe,CAAQ;QAE/B,IAAI,CAAC,OAAO,GAAG,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,eAAe;QACxB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC;YAC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;KAC3D;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,YAAiB,EAAE,QAAkB;IAClE,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,GAAQ,EAAE,EAAE;QAC/D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QACvB,OAAO,MAAM,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,CAAC,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=answerService.spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"answerService.spec.d.ts","sourceRoot":"","sources":["../../../../src/utils/answerService/answerService.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=answerService.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"answerService.spec.js","sourceRoot":"","sources":["../../../../src/utils/answerService/answerService.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const getUnaggregatedAnswerSession: string;
|
|
2
|
-
export declare const removeColumns: string;
|
|
3
|
-
export declare const addColumns: string;
|
|
4
|
-
export declare const getAnswerData: string;
|
|
5
|
-
export declare const getSourceDetail = "\n query GetSourceDetail($ids: [GUID!]!) {\n getSourceDetailById(ids: $ids, type: LOGICAL_TABLE) {\n id\n name\n description\n authorName\n authorDisplayName\n isExternal\n type\n created\n modified\n columns {\n id\n name\n author\n authorDisplayName\n description\n dataType\n type\n modified\n ownerName\n owner\n dataRecency\n sources {\n tableId\n tableName\n columnId\n columnName\n __typename\n }\n synonyms\n cohortAnswerId\n __typename\n }\n relationships\n destinationRelationships\n dataSourceId\n __typename\n }\n } \n";
|
|
6
|
-
//# sourceMappingURL=graphql-queries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-queries.d.ts","sourceRoot":"","sources":["../../../../src/utils/answerService/graphql-queries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,4BAA4B,QAsBxC,CAAC;AAEF,eAAO,MAAM,aAAa,QAUrB,CAAC;AAEN,eAAO,MAAM,UAAU,QAMlB,CAAC;AAEN,eAAO,MAAM,aAAa,QAwBzB,CAAC;AAEF,eAAO,MAAM,eAAe,43BAyC3B,CAAC"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSourceDetail = exports.getAnswerData = exports.addColumns = exports.removeColumns = exports.getUnaggregatedAnswerSession = void 0;
|
|
4
|
-
const bachSessionId = `
|
|
5
|
-
id {
|
|
6
|
-
sessionId
|
|
7
|
-
genNo
|
|
8
|
-
acSession {
|
|
9
|
-
sessionId
|
|
10
|
-
genNo
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
exports.getUnaggregatedAnswerSession = `
|
|
15
|
-
mutation GetUnAggregatedAnswerSession($session: BachSessionIdInput!, $columns: [UserPointSelectionInput!]!) {
|
|
16
|
-
Answer__getUnaggregatedAnswer(session: $session, columns: $columns) {
|
|
17
|
-
${bachSessionId}
|
|
18
|
-
answer {
|
|
19
|
-
visualizations {
|
|
20
|
-
... on TableViz {
|
|
21
|
-
columns {
|
|
22
|
-
column {
|
|
23
|
-
id
|
|
24
|
-
name
|
|
25
|
-
referencedColumns {
|
|
26
|
-
guid
|
|
27
|
-
displayName
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
exports.removeColumns = `
|
|
38
|
-
mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!], $columnIds: [GUID!]) {
|
|
39
|
-
Answer__removeColumns(
|
|
40
|
-
session: $session
|
|
41
|
-
logicalColumnIds: $logicalColumnIds
|
|
42
|
-
columnIds: $columnIds
|
|
43
|
-
) {
|
|
44
|
-
${bachSessionId}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
exports.addColumns = `
|
|
49
|
-
mutation AddColumns($session: BachSessionIdInput!, $columns: [AnswerColumnInfo!]!) {
|
|
50
|
-
Answer__addColumn(session: $session, columns: $columns) {
|
|
51
|
-
${bachSessionId}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
exports.getAnswerData = `
|
|
56
|
-
query GetTableWithHeadlineData($session: BachSessionIdInput!, $deadline: Int!, $dataPaginationParams: DataPaginationParamsInput!) {
|
|
57
|
-
getAnswer(session: $session) {
|
|
58
|
-
${bachSessionId}
|
|
59
|
-
answer {
|
|
60
|
-
id
|
|
61
|
-
visualizations {
|
|
62
|
-
id
|
|
63
|
-
... on TableViz {
|
|
64
|
-
columns {
|
|
65
|
-
column {
|
|
66
|
-
id
|
|
67
|
-
name
|
|
68
|
-
type
|
|
69
|
-
aggregationType
|
|
70
|
-
dataType
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
data(deadline: $deadline, pagination: $dataPaginationParams)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
`;
|
|
80
|
-
exports.getSourceDetail = `
|
|
81
|
-
query GetSourceDetail($ids: [GUID!]!) {
|
|
82
|
-
getSourceDetailById(ids: $ids, type: LOGICAL_TABLE) {
|
|
83
|
-
id
|
|
84
|
-
name
|
|
85
|
-
description
|
|
86
|
-
authorName
|
|
87
|
-
authorDisplayName
|
|
88
|
-
isExternal
|
|
89
|
-
type
|
|
90
|
-
created
|
|
91
|
-
modified
|
|
92
|
-
columns {
|
|
93
|
-
id
|
|
94
|
-
name
|
|
95
|
-
author
|
|
96
|
-
authorDisplayName
|
|
97
|
-
description
|
|
98
|
-
dataType
|
|
99
|
-
type
|
|
100
|
-
modified
|
|
101
|
-
ownerName
|
|
102
|
-
owner
|
|
103
|
-
dataRecency
|
|
104
|
-
sources {
|
|
105
|
-
tableId
|
|
106
|
-
tableName
|
|
107
|
-
columnId
|
|
108
|
-
columnName
|
|
109
|
-
__typename
|
|
110
|
-
}
|
|
111
|
-
synonyms
|
|
112
|
-
cohortAnswerId
|
|
113
|
-
__typename
|
|
114
|
-
}
|
|
115
|
-
relationships
|
|
116
|
-
destinationRelationships
|
|
117
|
-
dataSourceId
|
|
118
|
-
__typename
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
`;
|
|
122
|
-
const operations = {};
|
|
123
|
-
//# sourceMappingURL=graphql-queries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-queries.js","sourceRoot":"","sources":["../../../../src/utils/answerService/graphql-queries.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa,GAAG;;;;;;;;;CASrB,CAAC;AAEW,QAAA,4BAA4B,GAAG;;;UAGlC,aAAa;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;AAEW,QAAA,aAAa,GAAG;;;;;;;cAOf,aAAa;;;KAGtB,CAAC;AAEO,QAAA,UAAU,GAAG;;;cAGZ,aAAa;;;KAGtB,CAAC;AAEO,QAAA,aAAa,GAAG;;;cAGf,aAAa;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAC;AAEW,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC9B,CAAC;AAEF,MAAM,UAAU,GAAG,EAElB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SessionInterface } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param session
|
|
5
|
-
* @param query
|
|
6
|
-
* @param operation
|
|
7
|
-
* @param thoughtSpotHost
|
|
8
|
-
*/
|
|
9
|
-
export declare function getAnswerServiceInstance(session: SessionInterface, query: string, operation: string, thoughtSpotHost: string): any;
|
|
10
|
-
//# sourceMappingURL=answerService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"answerService.d.ts","sourceRoot":"","sources":["../../../src/utils/answerService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,UAAU,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACxB,GAAG,CAgDL"}
|