@thoughtspot/visual-embed-sdk 1.46.5-beta.1 → 1.47.0
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 +4 -4
- package/cjs/src/css-variables.d.ts +36 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +41 -17
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +26 -47
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +36 -79
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +24 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +18 -33
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +129 -97
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +2 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +69 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +22 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.js +57 -0
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js +190 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +18 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +9 -11
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +29 -71
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +20 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.js +52 -0
- package/cjs/src/embed/spotter-utils.js.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.js +54 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +25 -5
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +28 -67
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +2 -1
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +2 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +1 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -4
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +2 -2
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +1 -3
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -36
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +1 -34
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +143 -76
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +118 -47
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +0 -9
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +1 -10
- package/cjs/src/utils.js.map +1 -1
- package/dist/{index-DW2wEHqy.js → index-Bm2Hck8q.js} +1 -1
- package/dist/src/css-variables.d.ts +36 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +41 -17
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +24 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +22 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +18 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +20 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +2 -2
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -36
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +143 -76
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +378 -304
- package/dist/tsembed-react.js +366 -294
- package/dist/tsembed.es.js +393 -285
- package/dist/tsembed.js +30798 -30691
- package/dist/visual-embed-sdk-react-full.d.ts +310 -273
- package/dist/visual-embed-sdk-react.d.ts +310 -273
- package/dist/visual-embed-sdk.d.ts +308 -243
- package/lib/package.json +4 -4
- package/lib/src/css-variables.d.ts +36 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +41 -17
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +28 -49
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +36 -79
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +24 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +19 -34
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +131 -99
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +31 -0
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +2 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +18 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +69 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +185 -19
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +22 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.js +49 -0
- package/lib/src/embed/hostEventClient/utils.js.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.js +188 -0
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +18 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +9 -11
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +29 -71
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +20 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.js +47 -0
- package/lib/src/embed/spotter-utils.js.map +1 -0
- package/lib/src/embed/spotter-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.spec.js +52 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +25 -5
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +30 -69
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +2 -1
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +2 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +1 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +2 -2
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -36
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +0 -33
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +143 -76
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +118 -47
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +0 -9
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +0 -8
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +308 -243
- package/package.json +4 -4
- package/src/css-variables.ts +45 -0
- package/src/embed/app.spec.ts +51 -107
- package/src/embed/app.ts +60 -82
- package/src/embed/conversation.spec.ts +150 -119
- package/src/embed/conversation.ts +34 -58
- package/src/embed/hostEventClient/contracts.ts +31 -0
- package/src/embed/hostEventClient/host-event-client.spec.ts +260 -19
- package/src/embed/hostEventClient/host-event-client.ts +87 -11
- package/src/embed/hostEventClient/utils.spec.ts +225 -0
- package/src/embed/hostEventClient/utils.ts +74 -0
- package/src/embed/liveboard.spec.ts +38 -93
- package/src/embed/liveboard.ts +28 -10
- package/src/embed/spotter-utils.spec.ts +56 -0
- package/src/embed/spotter-utils.ts +65 -0
- package/src/embed/ts-embed.spec.ts +56 -108
- package/src/embed/ts-embed.ts +25 -4
- package/src/errors.ts +2 -1
- package/src/index.ts +2 -5
- package/src/react/all-types-export.ts +0 -3
- package/src/react/index.tsx +15 -59
- package/src/types.ts +206 -138
- package/src/utils.ts +0 -14
- package/cjs/src/embed/sage.d.ts +0 -164
- package/cjs/src/embed/sage.d.ts.map +0 -1
- package/cjs/src/embed/sage.js +0 -88
- package/cjs/src/embed/sage.js.map +0 -1
- package/cjs/src/embed/sage.spec.d.ts +0 -2
- package/cjs/src/embed/sage.spec.d.ts.map +0 -1
- package/cjs/src/embed/sage.spec.js +0 -151
- package/cjs/src/embed/sage.spec.js.map +0 -1
- package/dist/src/embed/sage.d.ts +0 -164
- package/dist/src/embed/sage.d.ts.map +0 -1
- package/dist/src/embed/sage.spec.d.ts +0 -2
- package/dist/src/embed/sage.spec.d.ts.map +0 -1
- package/lib/src/embed/sage.d.ts +0 -164
- package/lib/src/embed/sage.d.ts.map +0 -1
- package/lib/src/embed/sage.js +0 -84
- package/lib/src/embed/sage.js.map +0 -1
- package/lib/src/embed/sage.spec.d.ts +0 -2
- package/lib/src/embed/sage.spec.d.ts.map +0 -1
- package/lib/src/embed/sage.spec.js +0 -148
- package/lib/src/embed/sage.spec.js.map +0 -1
- package/src/embed/sage.spec.ts +0 -206
- package/src/embed/sage.ts +0 -231
package/lib/src/embed/sage.d.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023
|
|
3
|
-
*
|
|
4
|
-
* Embed ThoughtSpot Sage
|
|
5
|
-
* @summary TS Sage embed
|
|
6
|
-
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
7
|
-
*/
|
|
8
|
-
import { DOMSelector, BaseViewConfig, SearchLiveboardCommonViewConfig } from '../types';
|
|
9
|
-
import { V1Embed } from './ts-embed';
|
|
10
|
-
/**
|
|
11
|
-
* Configuration for search options
|
|
12
|
-
*/
|
|
13
|
-
export interface SearchOptions {
|
|
14
|
-
/**
|
|
15
|
-
* The query string to pass for Natural Language Search.
|
|
16
|
-
*/
|
|
17
|
-
searchQuery: string;
|
|
18
|
-
/**
|
|
19
|
-
* Boolean to define if the search should be executed or not.
|
|
20
|
-
* If it is executed, the focus is placed on the results.
|
|
21
|
-
* If it’s not executed, the focus is placed at the end of
|
|
22
|
-
* the token string in the search bar.
|
|
23
|
-
*/
|
|
24
|
-
executeSearch?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The configuration attributes for the embedded Natural language search view. Based on
|
|
28
|
-
* GPT and LLM.
|
|
29
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
30
|
-
*
|
|
31
|
-
* Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl
|
|
32
|
-
* @group Embed components
|
|
33
|
-
*/
|
|
34
|
-
export interface SageViewConfig extends SearchLiveboardCommonViewConfig, Omit<BaseViewConfig, 'primaryAction' | 'runtimeFilters' | 'runtimeParameters' | 'excludeRuntimeFiltersfromURL' | 'excludeRuntimeParametersfromURL'> {
|
|
35
|
-
/**
|
|
36
|
-
* If set to true, a list of Liveboard and Answers related
|
|
37
|
-
* to the natural language search will be shown below the
|
|
38
|
-
* AI generated answer.
|
|
39
|
-
* @deprecated Currently Liveboard and Answers related
|
|
40
|
-
* to the natural language search will not be shown for sage
|
|
41
|
-
* embed
|
|
42
|
-
*/
|
|
43
|
-
showObjectResults?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* flag used by the TS product tour page to show the blue search bar
|
|
46
|
-
* even after the search is completed. This is different from ThoughtSpot Embedded
|
|
47
|
-
* Sage Embed experience where it mimics closer to the non-embed case.
|
|
48
|
-
* The Sample questions container is collapsed when this value is set after
|
|
49
|
-
* does a search.
|
|
50
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
isProductTour?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Show or hide the search bar title.
|
|
56
|
-
* @version SDK: 1.29.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
57
|
-
* @deprecated ThoughtSpot: 9.10.0.cl | search bar doesn't have the title from 9.10.0.cl
|
|
58
|
-
*/
|
|
59
|
-
hideSearchBarTitle?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Show or hide the Answer header, that is, the `AI Answer` title
|
|
62
|
-
* at the top of the Answer page.
|
|
63
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl
|
|
64
|
-
*/
|
|
65
|
-
hideSageAnswerHeader?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Disable the data source selection option.
|
|
68
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
69
|
-
*/
|
|
70
|
-
disableWorksheetChange?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Hide the data source selection panel.
|
|
73
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
74
|
-
*/
|
|
75
|
-
hideWorksheetSelector?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Show or hide autocomplete suggestions for the search query string.
|
|
78
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
79
|
-
*/
|
|
80
|
-
hideAutocompleteSuggestions?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Show or hide autocomplete suggestions for the search query string.
|
|
83
|
-
* You can use {@link hideAutocompleteSuggestions} instead.
|
|
84
|
-
* @deprecated
|
|
85
|
-
* Currently, the object suggestions will not be shown for Natural Language Search.
|
|
86
|
-
*/
|
|
87
|
-
showObjectSuggestions?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Show or hide sample questions.
|
|
90
|
-
* The sample questions are autogenerated based on the data model
|
|
91
|
-
* selected for the search operation.
|
|
92
|
-
*
|
|
93
|
-
* Supported embed types: `SageEmbed`
|
|
94
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
95
|
-
* @example
|
|
96
|
-
* ```js
|
|
97
|
-
* const embed = new SageEmbed('#tsEmbed', {
|
|
98
|
-
* ... //other embed view config
|
|
99
|
-
* hideSampleQuestions : true,
|
|
100
|
-
* })
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
hideSampleQuestions?: boolean;
|
|
104
|
-
/**
|
|
105
|
-
* The data source GUID (Model GUID) to set on load.
|
|
106
|
-
*/
|
|
107
|
-
dataSource?: string;
|
|
108
|
-
/**
|
|
109
|
-
* Includes the following properties:
|
|
110
|
-
*
|
|
111
|
-
* `searchQuery`: The search query string to pass in the search bar.
|
|
112
|
-
* Supports Natural Language Search queries.
|
|
113
|
-
*
|
|
114
|
-
* `executeSearch`: Boolean to define if the search should be executed or not.
|
|
115
|
-
* If it is executed, the focus is placed on the results.
|
|
116
|
-
* If it’s not executed, the focus is placed at the end of
|
|
117
|
-
* the token string in the search bar.
|
|
118
|
-
*
|
|
119
|
-
* Supported embed types: `SageEmbed`
|
|
120
|
-
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
121
|
-
* @example
|
|
122
|
-
* ```js
|
|
123
|
-
* searchOptions: {
|
|
124
|
-
* searchQuery: 'average sales by country and product type',
|
|
125
|
-
* executeSearch: true,
|
|
126
|
-
* }
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
searchOptions?: SearchOptions;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
|
|
133
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
|
|
134
|
-
*
|
|
135
|
-
* Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl
|
|
136
|
-
* @group Embed components
|
|
137
|
-
*/
|
|
138
|
-
export declare class SageEmbed extends V1Embed {
|
|
139
|
-
/**
|
|
140
|
-
* The view configuration for the embedded ThoughtSpot sage.
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
protected viewConfig: SageViewConfig;
|
|
144
|
-
constructor(domSelector: DOMSelector, viewConfig: SageViewConfig);
|
|
145
|
-
protected getEmbedParamsObject(): Record<any, any>;
|
|
146
|
-
/**
|
|
147
|
-
* Constructs a map of parameters to be passed on to the
|
|
148
|
-
* embedded Eureka or Sage search page.
|
|
149
|
-
* @returns {string} query string
|
|
150
|
-
*/
|
|
151
|
-
protected getEmbedParams(): string;
|
|
152
|
-
/**
|
|
153
|
-
* Construct the URL of the embedded ThoughtSpot sage to be
|
|
154
|
-
* loaded in the iframe
|
|
155
|
-
* @returns {string} iframe url
|
|
156
|
-
*/
|
|
157
|
-
getIFrameSrc(): string;
|
|
158
|
-
/**
|
|
159
|
-
* Render the embedded ThoughtSpot Sage
|
|
160
|
-
* @returns {SageEmbed} Eureka/Sage embed
|
|
161
|
-
*/
|
|
162
|
-
render(): Promise<SageEmbed>;
|
|
163
|
-
}
|
|
164
|
-
//# sourceMappingURL=sage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sage.d.ts","sourceRoot":"","sources":["../../../src/embed/sage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAS,cAAc,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAE/F,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cACb,SAAQ,+BAA+B,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,8BAA8B,GAAG,iCAAiC,CAAC;IAC5L;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;OAcG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;CACjC;AACD;;;;;;GAMG;AACH,qBAAa,SAAU,SAAQ,OAAO;IAClC;;;OAGG;IACH,SAAS,CAAC,UAAU,EAAE,cAAc,CAAC;gBAEzB,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc;IAKhE,SAAS,CAAC,oBAAoB;IA6B9B;;;;OAIG;IACH,SAAS,CAAC,cAAc,IAAI,MAAM;IAKlC;;;;OAIG;IACI,YAAY,IAAI,MAAM;IAqB7B;;;OAGG;IACU,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;CAO5C"}
|
package/lib/src/embed/sage.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023
|
|
3
|
-
*
|
|
4
|
-
* Embed ThoughtSpot Sage
|
|
5
|
-
* @summary TS Sage embed
|
|
6
|
-
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
7
|
-
*/
|
|
8
|
-
import { Param } from '../types';
|
|
9
|
-
import { getQueryParamString } from '../utils';
|
|
10
|
-
import { V1Embed } from './ts-embed';
|
|
11
|
-
/**
|
|
12
|
-
* Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
|
|
13
|
-
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
|
|
14
|
-
*
|
|
15
|
-
* Note: This embed will be deprecated from SDK: 1.40.0 | ThoughtSpot: 10.13.0.cl
|
|
16
|
-
* @group Embed components
|
|
17
|
-
*/
|
|
18
|
-
export class SageEmbed extends V1Embed {
|
|
19
|
-
constructor(domSelector, viewConfig) {
|
|
20
|
-
viewConfig.embedComponentType = 'SageEmbed';
|
|
21
|
-
super(domSelector, viewConfig);
|
|
22
|
-
}
|
|
23
|
-
getEmbedParamsObject() {
|
|
24
|
-
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
25
|
-
const params = this.getBaseQueryParams();
|
|
26
|
-
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
27
|
-
params[Param.IsSageEmbed] = true;
|
|
28
|
-
params[Param.DisableWorksheetChange] = !!disableWorksheetChange;
|
|
29
|
-
params[Param.HideWorksheetSelector] = !!hideWorksheetSelector;
|
|
30
|
-
params[Param.HideEurekaSuggestions] = !!hideAutocompleteSuggestions;
|
|
31
|
-
if (showObjectSuggestions) {
|
|
32
|
-
params[Param.HideEurekaSuggestions] = !showObjectSuggestions;
|
|
33
|
-
// support backwards compatibility
|
|
34
|
-
}
|
|
35
|
-
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
36
|
-
params[Param.IsProductTour] = !!isProductTour;
|
|
37
|
-
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
38
|
-
return params;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Constructs a map of parameters to be passed on to the
|
|
42
|
-
* embedded Eureka or Sage search page.
|
|
43
|
-
* @returns {string} query string
|
|
44
|
-
*/
|
|
45
|
-
getEmbedParams() {
|
|
46
|
-
const params = this.getEmbedParamsObject();
|
|
47
|
-
return getQueryParamString(params, true);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Construct the URL of the embedded ThoughtSpot sage to be
|
|
51
|
-
* loaded in the iframe
|
|
52
|
-
* @returns {string} iframe url
|
|
53
|
-
*/
|
|
54
|
-
getIFrameSrc() {
|
|
55
|
-
const path = 'eureka';
|
|
56
|
-
const postHashObj = {};
|
|
57
|
-
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
58
|
-
const { dataSource, searchOptions, } = this.viewConfig;
|
|
59
|
-
if (dataSource)
|
|
60
|
-
postHashObj[Param.WorksheetId] = dataSource;
|
|
61
|
-
if ((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) && searchOptions.executeSearch) {
|
|
62
|
-
postHashObj[Param.executeSearch] = true;
|
|
63
|
-
}
|
|
64
|
-
let sagePostHashParams = new URLSearchParams(postHashObj).toString();
|
|
65
|
-
if (sagePostHashParams)
|
|
66
|
-
sagePostHashParams = `${tsPostHashParams ? '&' : '?'}${sagePostHashParams}`;
|
|
67
|
-
if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery)
|
|
68
|
-
sagePostHashParams += `${sagePostHashParams ? '&' : '?'}${[Param.Query]}=${encodeURIComponent(searchOptions.searchQuery)}`;
|
|
69
|
-
// use encodeURIComponent for query instead of URLSearchParams
|
|
70
|
-
// as it adds + instead of %20 for spaces
|
|
71
|
-
return `${this.getRootIframeSrc()}/embed/${path}${tsPostHashParams}${sagePostHashParams}`;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Render the embedded ThoughtSpot Sage
|
|
75
|
-
* @returns {SageEmbed} Eureka/Sage embed
|
|
76
|
-
*/
|
|
77
|
-
async render() {
|
|
78
|
-
await super.render();
|
|
79
|
-
const src = this.getIFrameSrc();
|
|
80
|
-
await this.renderV1Embed(src);
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=sage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sage.js","sourceRoot":"","sources":["../../../src/embed/sage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAe,KAAK,EAAmD,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA6HrC;;;;;;GAMG;AACH,MAAM,OAAO,SAAU,SAAQ,OAAO;IAOlC,YAAY,WAAwB,EAAE,UAA0B;QAC5D,UAAU,CAAC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AE9B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sage.spec.d.ts","sourceRoot":"","sources":["../../../src/embed/sage.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { SageEmbed } from './sage';
|
|
2
|
-
import { init } from '../index';
|
|
3
|
-
import { AuthType } from '../types';
|
|
4
|
-
import { executeAfterWait, expectUrlMatch, getDocumentBody, getIFrameSrc, getRootEl, } from '../test/test-utils';
|
|
5
|
-
import * as authInstance from '../auth';
|
|
6
|
-
const defaultConfig = {
|
|
7
|
-
disableWorksheetChange: false,
|
|
8
|
-
hideWorksheetSelector: false,
|
|
9
|
-
hideSageAnswerHeader: false,
|
|
10
|
-
hideAutocompleteSuggestions: false,
|
|
11
|
-
hideSampleQuestions: false,
|
|
12
|
-
isProductTour: false,
|
|
13
|
-
dataPanelV2: true,
|
|
14
|
-
};
|
|
15
|
-
const thoughtSpotHost = 'tshost';
|
|
16
|
-
beforeAll(() => {
|
|
17
|
-
init({
|
|
18
|
-
thoughtSpotHost,
|
|
19
|
-
authType: AuthType.None,
|
|
20
|
-
});
|
|
21
|
-
jest.spyOn(window, 'alert');
|
|
22
|
-
jest.spyOn(authInstance, 'postLoginService').mockImplementation(() => Promise.resolve(true));
|
|
23
|
-
});
|
|
24
|
-
describe('Sage embed tests', () => {
|
|
25
|
-
beforeEach(() => {
|
|
26
|
-
document.body.innerHTML = getDocumentBody();
|
|
27
|
-
});
|
|
28
|
-
test('should render sage', async () => {
|
|
29
|
-
const sageEmbed = new SageEmbed(getRootEl(), defaultConfig);
|
|
30
|
-
await sageEmbed.render();
|
|
31
|
-
await executeAfterWait(() => {
|
|
32
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
test('should render sage with product tour flag set', async () => {
|
|
36
|
-
const sageEmbed = new SageEmbed(getRootEl(), { ...defaultConfig, isProductTour: true });
|
|
37
|
-
await sageEmbed.render();
|
|
38
|
-
await executeAfterWait(() => {
|
|
39
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=true&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
test('should render sage with disable worksheet change flag', async () => {
|
|
43
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
44
|
-
...defaultConfig,
|
|
45
|
-
disableWorksheetChange: true,
|
|
46
|
-
});
|
|
47
|
-
await sageEmbed.render();
|
|
48
|
-
await executeAfterWait(() => {
|
|
49
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=true&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
test('should render sage with hide worksheet selector flag', async () => {
|
|
53
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
54
|
-
...defaultConfig,
|
|
55
|
-
hideWorksheetSelector: true,
|
|
56
|
-
});
|
|
57
|
-
await sageEmbed.render();
|
|
58
|
-
await executeAfterWait(() => {
|
|
59
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
test('should render sage with hide Sage Answer Header flag', async () => {
|
|
63
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
64
|
-
...defaultConfig,
|
|
65
|
-
hideSageAnswerHeader: true,
|
|
66
|
-
});
|
|
67
|
-
await sageEmbed.render();
|
|
68
|
-
await executeAfterWait(() => {
|
|
69
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=true&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
test('should render sage with hide Autocomplete suggestions flag', async () => {
|
|
73
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
74
|
-
...defaultConfig,
|
|
75
|
-
hideAutocompleteSuggestions: true,
|
|
76
|
-
});
|
|
77
|
-
await sageEmbed.render();
|
|
78
|
-
await executeAfterWait(() => {
|
|
79
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=true&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
test('should render sage with deprecated showObjectSuggestions flag', async () => {
|
|
83
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
84
|
-
showObjectSuggestions: true,
|
|
85
|
-
});
|
|
86
|
-
await sageEmbed.render();
|
|
87
|
-
await executeAfterWait(() => {
|
|
88
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
test('embed url include pre-seed dataSource without populating searchOptions', async () => {
|
|
92
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
93
|
-
...defaultConfig,
|
|
94
|
-
dataSource: 'worksheet-id',
|
|
95
|
-
});
|
|
96
|
-
await sageEmbed.render();
|
|
97
|
-
await executeAfterWait(() => {
|
|
98
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?worksheet=worksheet-id`);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
test('embed url include pre-seed dataSource and query', async () => {
|
|
102
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
103
|
-
...defaultConfig,
|
|
104
|
-
dataSource: 'worksheet-id',
|
|
105
|
-
searchOptions: {
|
|
106
|
-
searchQuery: 'test query', // also tests for query with spaces
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
await sageEmbed.render();
|
|
110
|
-
await executeAfterWait(() => {
|
|
111
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?worksheet=worksheet-id&query=test%20query`);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
test('embed url include pre-seed execute flag with query', async () => {
|
|
115
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
116
|
-
...defaultConfig,
|
|
117
|
-
searchOptions: {
|
|
118
|
-
searchQuery: 'test-query',
|
|
119
|
-
executeSearch: true,
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
await sageEmbed.render();
|
|
123
|
-
await executeAfterWait(() => {
|
|
124
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?executeSearch=true&query=test-query`);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
test('should set enableDataPanelV2 to true if data panel v2 flag is true', async () => {
|
|
128
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
129
|
-
...defaultConfig,
|
|
130
|
-
dataPanelV2: true,
|
|
131
|
-
});
|
|
132
|
-
await sageEmbed.render();
|
|
133
|
-
await executeAfterWait(() => {
|
|
134
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
test('should set enableDataPanelV2 to false if data panel v2 flag is false', async () => {
|
|
138
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
139
|
-
...defaultConfig,
|
|
140
|
-
dataPanelV2: false,
|
|
141
|
-
});
|
|
142
|
-
await sageEmbed.render();
|
|
143
|
-
await executeAfterWait(() => {
|
|
144
|
-
expectUrlMatch(getIFrameSrc(), `http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`);
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
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E,EAAE,KAAK,IAAI,EAAE;QAClF,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE;YACzC,GAAG,aAAa;YAChB,WAAW,EAAE,IAAI;SACpB,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,gBAAgB,CAAC,GAAG,EAAE;YACxB,cAAc,CACV,YAAY,EAAE,EACd,UAAU,eAAe,8OAA8O,CAC1Q,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;QACpF,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,SAAS,EAAE,EAAE;YACzC,GAAG,aAAa;YAChB,WAAW,EAAE,KAAK;SACrB,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,gBAAgB,CAAC,GAAG,EAAE;YACxB,cAAc,CACV,YAAY,EAAE,EACd,UAAU,eAAe,+OAA+O,CAC3Q,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/src/embed/sage.spec.ts
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { SageEmbed, SageViewConfig } from './sage';
|
|
2
|
-
import { init } from '../index';
|
|
3
|
-
import { AuthType } from '../types';
|
|
4
|
-
import {
|
|
5
|
-
executeAfterWait,
|
|
6
|
-
expectUrlMatch,
|
|
7
|
-
getDocumentBody,
|
|
8
|
-
getIFrameSrc,
|
|
9
|
-
getRootEl,
|
|
10
|
-
} from '../test/test-utils';
|
|
11
|
-
|
|
12
|
-
import * as authInstance from '../auth';
|
|
13
|
-
|
|
14
|
-
const defaultConfig: SageViewConfig = {
|
|
15
|
-
disableWorksheetChange: false,
|
|
16
|
-
hideWorksheetSelector: false,
|
|
17
|
-
hideSageAnswerHeader: false,
|
|
18
|
-
hideAutocompleteSuggestions: false,
|
|
19
|
-
hideSampleQuestions: false,
|
|
20
|
-
isProductTour: false,
|
|
21
|
-
dataPanelV2: true,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const thoughtSpotHost = 'tshost';
|
|
25
|
-
|
|
26
|
-
beforeAll(() => {
|
|
27
|
-
init({
|
|
28
|
-
thoughtSpotHost,
|
|
29
|
-
authType: AuthType.None,
|
|
30
|
-
});
|
|
31
|
-
jest.spyOn(window, 'alert');
|
|
32
|
-
jest.spyOn(authInstance, 'postLoginService').mockImplementation(() => Promise.resolve(true as any));
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
describe('Sage embed tests', () => {
|
|
36
|
-
beforeEach(() => {
|
|
37
|
-
document.body.innerHTML = getDocumentBody();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test('should render sage', async () => {
|
|
41
|
-
const sageEmbed = new SageEmbed(getRootEl(), defaultConfig);
|
|
42
|
-
await sageEmbed.render();
|
|
43
|
-
await executeAfterWait(() => {
|
|
44
|
-
expectUrlMatch(
|
|
45
|
-
getIFrameSrc(),
|
|
46
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('should render sage with product tour flag set', async () => {
|
|
52
|
-
const sageEmbed = new SageEmbed(getRootEl(), { ...defaultConfig, isProductTour: true });
|
|
53
|
-
await sageEmbed.render();
|
|
54
|
-
await executeAfterWait(() => {
|
|
55
|
-
expectUrlMatch(
|
|
56
|
-
getIFrameSrc(),
|
|
57
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=true&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
58
|
-
);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test('should render sage with disable worksheet change flag', async () => {
|
|
63
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
64
|
-
...defaultConfig,
|
|
65
|
-
disableWorksheetChange: true,
|
|
66
|
-
});
|
|
67
|
-
await sageEmbed.render();
|
|
68
|
-
await executeAfterWait(() => {
|
|
69
|
-
expectUrlMatch(
|
|
70
|
-
getIFrameSrc(),
|
|
71
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=true&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test('should render sage with hide worksheet selector flag', async () => {
|
|
77
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
78
|
-
...defaultConfig,
|
|
79
|
-
hideWorksheetSelector: true,
|
|
80
|
-
});
|
|
81
|
-
await sageEmbed.render();
|
|
82
|
-
await executeAfterWait(() => {
|
|
83
|
-
expectUrlMatch(
|
|
84
|
-
getIFrameSrc(),
|
|
85
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
86
|
-
);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test('should render sage with hide Sage Answer Header flag', async () => {
|
|
91
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
92
|
-
...defaultConfig,
|
|
93
|
-
hideSageAnswerHeader: true,
|
|
94
|
-
});
|
|
95
|
-
await sageEmbed.render();
|
|
96
|
-
await executeAfterWait(() => {
|
|
97
|
-
expectUrlMatch(
|
|
98
|
-
getIFrameSrc(),
|
|
99
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=true&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
100
|
-
);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test('should render sage with hide Autocomplete suggestions flag', async () => {
|
|
105
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
106
|
-
...defaultConfig,
|
|
107
|
-
hideAutocompleteSuggestions: true,
|
|
108
|
-
});
|
|
109
|
-
await sageEmbed.render();
|
|
110
|
-
await executeAfterWait(() => {
|
|
111
|
-
expectUrlMatch(
|
|
112
|
-
getIFrameSrc(),
|
|
113
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=true&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
114
|
-
);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
test('should render sage with deprecated showObjectSuggestions flag', async () => {
|
|
119
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
120
|
-
showObjectSuggestions: true,
|
|
121
|
-
});
|
|
122
|
-
await sageEmbed.render();
|
|
123
|
-
await executeAfterWait(() => {
|
|
124
|
-
expectUrlMatch(
|
|
125
|
-
getIFrameSrc(),
|
|
126
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
127
|
-
);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
test('embed url include pre-seed dataSource without populating searchOptions', async () => {
|
|
132
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
133
|
-
...defaultConfig,
|
|
134
|
-
dataSource: 'worksheet-id',
|
|
135
|
-
});
|
|
136
|
-
await sageEmbed.render();
|
|
137
|
-
await executeAfterWait(() => {
|
|
138
|
-
expectUrlMatch(
|
|
139
|
-
getIFrameSrc(),
|
|
140
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?worksheet=worksheet-id`,
|
|
141
|
-
);
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
test('embed url include pre-seed dataSource and query', async () => {
|
|
146
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
147
|
-
...defaultConfig,
|
|
148
|
-
dataSource: 'worksheet-id',
|
|
149
|
-
searchOptions: {
|
|
150
|
-
searchQuery: 'test query', // also tests for query with spaces
|
|
151
|
-
},
|
|
152
|
-
});
|
|
153
|
-
await sageEmbed.render();
|
|
154
|
-
await executeAfterWait(() => {
|
|
155
|
-
expectUrlMatch(
|
|
156
|
-
getIFrameSrc(),
|
|
157
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?worksheet=worksheet-id&query=test%20query`,
|
|
158
|
-
);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
test('embed url include pre-seed execute flag with query', async () => {
|
|
163
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
164
|
-
...defaultConfig,
|
|
165
|
-
searchOptions: {
|
|
166
|
-
searchQuery: 'test-query',
|
|
167
|
-
executeSearch: true,
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
await sageEmbed.render();
|
|
171
|
-
await executeAfterWait(() => {
|
|
172
|
-
expectUrlMatch(
|
|
173
|
-
getIFrameSrc(),
|
|
174
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?executeSearch=true&query=test-query`,
|
|
175
|
-
);
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
test('should set enableDataPanelV2 to true if data panel v2 flag is true', async () => {
|
|
180
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
181
|
-
...defaultConfig,
|
|
182
|
-
dataPanelV2: true,
|
|
183
|
-
});
|
|
184
|
-
await sageEmbed.render();
|
|
185
|
-
await executeAfterWait(() => {
|
|
186
|
-
expectUrlMatch(
|
|
187
|
-
getIFrameSrc(),
|
|
188
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
test('should set enableDataPanelV2 to false if data panel v2 flag is false', async () => {
|
|
194
|
-
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
195
|
-
...defaultConfig,
|
|
196
|
-
dataPanelV2: false,
|
|
197
|
-
});
|
|
198
|
-
await sageEmbed.render();
|
|
199
|
-
await executeAfterWait(() => {
|
|
200
|
-
expectUrlMatch(
|
|
201
|
-
getIFrameSrc(),
|
|
202
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
203
|
-
);
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
});
|