@thoughtspot/visual-embed-sdk 1.44.3 → 1.44.4-HE-beta.1
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/README.md +1 -1
- package/cjs/package.json +1 -1
- package/cjs/src/embed/app.d.ts +44 -32
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +7 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +9 -0
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +20 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +6 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +10 -4
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +12 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +1 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +7 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +9 -0
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +7 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +9 -0
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +7 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +9 -0
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +9 -3
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +41 -8
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +156 -24
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/types.d.ts +142 -45
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +91 -16
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/logger.spec.d.ts +20 -5
- package/cjs/src/utils/logger.spec.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +3 -2
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +4 -2
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils.d.ts +5 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +10 -2
- package/cjs/src/utils.js.map +1 -1
- package/dist/index-BFdRRz03.js +7371 -0
- package/dist/index-BUfrYJ3w.js +7371 -0
- package/dist/index-CI6s4VMY.js +7371 -0
- package/dist/{index-D0n5LIka.js → index-CWQnMX2L.js} +1 -1
- package/dist/index-CaW-1mu5.js +7371 -0
- package/dist/index-CcSgNJVi.js +7371 -0
- package/dist/index-Djtv-y7A.js +7371 -0
- package/dist/index-UY-4yjBN.js +7371 -0
- package/dist/src/embed/app.d.ts +44 -32
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +7 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +20 -3
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +10 -4
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +7 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +7 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +7 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +9 -3
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +142 -45
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/logger.spec.d.ts +20 -5
- package/dist/src/utils/logger.spec.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +3 -2
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils.d.ts +5 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +218 -50
- package/dist/tsembed-react.js +217 -49
- package/dist/tsembed.es.js +219 -51
- package/dist/tsembed.js +244 -76
- package/dist/visual-embed-sdk-react-full.d.ts +245 -82
- package/dist/visual-embed-sdk-react.d.ts +251 -90
- package/dist/visual-embed-sdk.d.ts +298 -92
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +44 -32
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +7 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +9 -0
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +20 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +5 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +10 -4
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +12 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +1 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +7 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +9 -0
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +7 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +9 -0
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +7 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +9 -0
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +9 -3
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +41 -8
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +156 -24
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +142 -45
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +90 -15
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/logger.spec.d.ts +20 -5
- package/lib/src/utils/logger.spec.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +3 -2
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +4 -2
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils.d.ts +5 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +8 -1
- package/lib/src/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/embed/app.ts +45 -32
- package/src/embed/conversation.ts +11 -0
- package/src/embed/hostEventClient/contracts.ts +23 -4
- package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
- package/src/embed/hostEventClient/host-event-client.ts +22 -11
- package/src/embed/liveboard.spec.ts +1 -1
- package/src/embed/liveboard.ts +18 -5
- package/src/embed/sage.ts +11 -0
- package/src/embed/search-bar.tsx +11 -0
- package/src/embed/search.ts +11 -0
- package/src/embed/ts-embed.spec.ts +205 -18
- package/src/embed/ts-embed.ts +45 -9
- package/src/errors.ts +1 -0
- package/src/index.ts +6 -0
- package/src/types.ts +146 -43
- package/src/utils/processTrigger.ts +6 -3
- package/src/utils.ts +10 -1
package/src/types.ts
CHANGED
|
@@ -169,57 +169,71 @@ export enum AuthType {
|
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
171
|
*
|
|
172
|
-
* This
|
|
173
|
-
* To access the updated modular homepage,
|
|
174
|
-
* set `modularHomeExperience` to `true`
|
|
175
|
-
* (available as Early Access feature in 9.12.5.cl).
|
|
172
|
+
* **Note**: This attribute is not supported in the classic (V1) homepage experience.
|
|
176
173
|
*
|
|
177
174
|
*/
|
|
178
175
|
|
|
179
176
|
export enum HomeLeftNavItem {
|
|
180
177
|
/**
|
|
178
|
+
* The *Search data* option in
|
|
179
|
+
* the *Insights* left navigation panel.
|
|
181
180
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
182
181
|
*/
|
|
183
182
|
SearchData = 'search-data',
|
|
184
183
|
/**
|
|
184
|
+
* The *Home* menu option in
|
|
185
|
+
* the *Insights* left navigation panel.
|
|
185
186
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
186
187
|
*/
|
|
187
188
|
Home = 'insights-home',
|
|
188
189
|
/**
|
|
190
|
+
* The *Liveboards* menu option in
|
|
191
|
+
* the *Insights* left navigation panel.
|
|
189
192
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
190
193
|
*/
|
|
191
194
|
Liveboards = 'liveboards',
|
|
192
195
|
/**
|
|
196
|
+
* The *Answers* menu option in
|
|
197
|
+
* the *Insights* left navigation panel.
|
|
193
198
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
194
199
|
*/
|
|
195
200
|
Answers = 'answers',
|
|
196
201
|
/**
|
|
202
|
+
* The *Monitor subscriptions* menu option in
|
|
203
|
+
* the *Insights* left navigation panel.
|
|
197
204
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
198
205
|
*/
|
|
199
206
|
MonitorSubscription = 'monitor-alerts',
|
|
200
207
|
/**
|
|
208
|
+
* The *SpotIQ analysis* menu option in
|
|
209
|
+
* the *Insights* left navigation panel.
|
|
201
210
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
202
211
|
*/
|
|
203
212
|
SpotIQAnalysis = 'spotiq-analysis',
|
|
204
213
|
/**
|
|
214
|
+
* The *Liveboard schedules* menu option in
|
|
215
|
+
* the *Insights* left navigation panel.
|
|
205
216
|
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
206
217
|
*/
|
|
207
218
|
LiveboardSchedules = 'liveboard-schedules',
|
|
208
219
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
220
|
+
* The create option in the *Insights*
|
|
221
|
+
* left navigation panel.
|
|
222
|
+
* Available in the V3 navigation experience.
|
|
211
223
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
212
224
|
*/
|
|
213
225
|
Create = 'create',
|
|
214
226
|
/**
|
|
215
|
-
* Spotter option in the
|
|
216
|
-
*
|
|
227
|
+
* The *Spotter* menu option in the *Insights*
|
|
228
|
+
* left navigation panel.
|
|
229
|
+
* Available in the V3 navigation experience.
|
|
217
230
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
218
231
|
*/
|
|
219
232
|
Spotter = 'spotter',
|
|
220
233
|
/**
|
|
221
|
-
* Favorites
|
|
222
|
-
*
|
|
234
|
+
* The *Favorites* section in the *Insights*
|
|
235
|
+
* left navigation panel.
|
|
236
|
+
* Available in the V3 navigation experience.
|
|
223
237
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
224
238
|
*/
|
|
225
239
|
Favorites = 'favorites',
|
|
@@ -1106,6 +1120,34 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1106
1120
|
* ```
|
|
1107
1121
|
*/
|
|
1108
1122
|
customActions?: CustomAction[];
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Flag to bypass host events payload validation
|
|
1126
|
+
* @default false
|
|
1127
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1128
|
+
* @example
|
|
1129
|
+
* ```js
|
|
1130
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1131
|
+
* ... // other embed view config
|
|
1132
|
+
* shouldBypassPayloadValidation:true,
|
|
1133
|
+
* })
|
|
1134
|
+
* ```
|
|
1135
|
+
*/
|
|
1136
|
+
shouldBypassPayloadValidation?: boolean;
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* Flag to use host events v2. This is used to enable the new host events v2 API.
|
|
1140
|
+
* @default false
|
|
1141
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1142
|
+
* @example
|
|
1143
|
+
* ```js
|
|
1144
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1145
|
+
* ... // other embed view config
|
|
1146
|
+
* useHostEventsV2:true,
|
|
1147
|
+
* })
|
|
1148
|
+
* ```
|
|
1149
|
+
*/
|
|
1150
|
+
useHostEventsV2?: boolean;
|
|
1109
1151
|
}
|
|
1110
1152
|
|
|
1111
1153
|
/**
|
|
@@ -1113,11 +1155,13 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1113
1155
|
*/
|
|
1114
1156
|
export interface HomePageConfig {
|
|
1115
1157
|
/**
|
|
1116
|
-
* Hide list
|
|
1117
|
-
*
|
|
1158
|
+
* Hide columns on list pages such as
|
|
1159
|
+
* *Liveboards* and *Answers*.
|
|
1160
|
+
* For example: `hiddenListColumns = [ListPageColumns.Author]`
|
|
1118
1161
|
*
|
|
1119
|
-
* **Note**: This option is
|
|
1120
|
-
*
|
|
1162
|
+
* **Note**: This option is available only in full app embedding and requires importing the `ListPageColumns` enum.
|
|
1163
|
+
* Starting with version 10.14.0.cl, you can use this attribute to
|
|
1164
|
+
* hide the columns on all list pages in the *Insights* section.
|
|
1121
1165
|
*
|
|
1122
1166
|
* Supported embed types: `AppEmbed`
|
|
1123
1167
|
* @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
|
|
@@ -1133,13 +1177,11 @@ export interface HomePageConfig {
|
|
|
1133
1177
|
*/
|
|
1134
1178
|
hiddenListColumns?: ListPageColumns[];
|
|
1135
1179
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1180
|
+
* Control the visibility of home page modules.
|
|
1181
|
+
* To specify the modules, import the `HomepageModule` enum.
|
|
1182
|
+
* For example: `hiddenHomepageModules = [HomepageModule.MyLibrary]`
|
|
1138
1183
|
*
|
|
1139
|
-
* **Note**: This
|
|
1140
|
-
* To access the updated modular homepage, set
|
|
1141
|
-
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
1142
|
-
* To use it, you need to import `HomepageModule` enum.
|
|
1184
|
+
* **Note**: This attribute is not supported in the classic (v1) experience.
|
|
1143
1185
|
*
|
|
1144
1186
|
* Supported embed types: `AppEmbed`
|
|
1145
1187
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
@@ -1148,20 +1190,18 @@ export interface HomePageConfig {
|
|
|
1148
1190
|
* import { HomepageModule } from '@thoughtspot/visual-embed-sdk';
|
|
1149
1191
|
*
|
|
1150
1192
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
1151
|
-
* ... //
|
|
1193
|
+
* ... // V2/V3 navigation and home page experience attributes
|
|
1152
1194
|
* hiddenHomepageModules : [HomepageModule.Favorite,HomepageModule.Learning],
|
|
1195
|
+
* //...other embed view configuration attributes
|
|
1153
1196
|
* })
|
|
1154
1197
|
* ```
|
|
1155
1198
|
*/
|
|
1156
1199
|
hiddenHomepageModules?: HomepageModule[];
|
|
1157
1200
|
/**
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
* **Note**: This
|
|
1162
|
-
* To access the updated modular homepage, set
|
|
1163
|
-
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
1164
|
-
* To use it, you need to import `HomepageModule` enum.
|
|
1201
|
+
* Reorder home page modules.
|
|
1202
|
+
* To specify the modules, import the `HomepageModule` enum.
|
|
1203
|
+
* For example: `reorderedHomepageModules = [HomepageModule.MyLibrary, HomepageModule.Watchlist]`
|
|
1204
|
+
* **Note**: This attribute is not supported in the classic (v1) homepage.
|
|
1165
1205
|
*
|
|
1166
1206
|
* Supported embed types: `AppEmbed`
|
|
1167
1207
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
@@ -1170,16 +1210,19 @@ export interface HomePageConfig {
|
|
|
1170
1210
|
* import { HomepageModule } from '@thoughtspot/visual-embed-sdk';
|
|
1171
1211
|
*
|
|
1172
1212
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
1173
|
-
*
|
|
1213
|
+
* ...//V2/V3 navigation and home page experience attributes
|
|
1174
1214
|
* reorderedHomepageModules:[HomepageModule.Favorite,HomepageModule.MyLibrary],
|
|
1215
|
+
* //... other embed view configuration attributes
|
|
1175
1216
|
* })
|
|
1176
1217
|
* ```
|
|
1177
1218
|
*/
|
|
1178
1219
|
reorderedHomepageModules?: HomepageModule[];
|
|
1179
1220
|
/**
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1182
|
-
* To
|
|
1221
|
+
* Controls the visibility of the menu items
|
|
1222
|
+
* on the home page left navigation panel.
|
|
1223
|
+
* To specify the menu items, import the `HomeLeftNavItem` enum.
|
|
1224
|
+
*
|
|
1225
|
+
* **Note**: This attribute is not supported in the classic (v1) homepage.
|
|
1183
1226
|
*
|
|
1184
1227
|
* Supported embed types: `AppEmbed`
|
|
1185
1228
|
* @example
|
|
@@ -1187,15 +1230,11 @@ export interface HomePageConfig {
|
|
|
1187
1230
|
* import { HomeLeftNavItem } from '@thoughtspot/visual-embed-sdk';
|
|
1188
1231
|
*
|
|
1189
1232
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
1190
|
-
*
|
|
1233
|
+
* //... V2/V3 experience attributes
|
|
1191
1234
|
* hiddenHomeLeftNavItems : [HomeLeftNavItem.Home,HomeLeftNavItem.Answers],
|
|
1235
|
+
* ... //other embed view configuration attributes
|
|
1192
1236
|
* })
|
|
1193
1237
|
* ```
|
|
1194
|
-
*
|
|
1195
|
-
* **Note**: This option does not apply to the classic homepage.
|
|
1196
|
-
* To access the updated modular homepage, set
|
|
1197
|
-
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
1198
|
-
* To use it, you need to import `HomeLeftNavItem` enum.
|
|
1199
1238
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
1200
1239
|
*/
|
|
1201
1240
|
hiddenHomeLeftNavItems?: HomeLeftNavItem[];
|
|
@@ -1748,10 +1787,11 @@ export enum RuntimeFilterOp {
|
|
|
1748
1787
|
}
|
|
1749
1788
|
|
|
1750
1789
|
/**
|
|
1751
|
-
* Home page
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
1790
|
+
* Home page modules that can be hidden
|
|
1791
|
+
* via `hiddenHomepageModules` and reordered via
|
|
1792
|
+
* `reorderedHomepageModules`.
|
|
1793
|
+
*
|
|
1794
|
+
* **Note**: This option is not supported in the classic (v1) experience.
|
|
1755
1795
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
1756
1796
|
*/
|
|
1757
1797
|
|
|
@@ -1765,7 +1805,7 @@ export enum HomepageModule {
|
|
|
1765
1805
|
*/
|
|
1766
1806
|
Watchlist = 'WATCHLIST',
|
|
1767
1807
|
/**
|
|
1768
|
-
*
|
|
1808
|
+
* Favorite module
|
|
1769
1809
|
*/
|
|
1770
1810
|
Favorite = 'FAVORITE',
|
|
1771
1811
|
/**
|
|
@@ -2960,6 +3000,28 @@ export enum EmbedEvent {
|
|
|
2960
3000
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
2961
3001
|
*/
|
|
2962
3002
|
PreviewSpotterData = 'PreviewSpotterData',
|
|
3003
|
+
/**
|
|
3004
|
+
* Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
|
|
3005
|
+
* @example
|
|
3006
|
+
* ```js
|
|
3007
|
+
* spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
|
|
3008
|
+
* console.log('payload', payload);
|
|
3009
|
+
* })
|
|
3010
|
+
*```
|
|
3011
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3012
|
+
*/
|
|
3013
|
+
AddToCoaching = 'addToCoaching',
|
|
3014
|
+
/**
|
|
3015
|
+
* Emitted when user opens up the data model instructions modal in Spotter embed.
|
|
3016
|
+
* @example
|
|
3017
|
+
* ```js
|
|
3018
|
+
* spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
|
|
3019
|
+
* console.log('payload', payload);
|
|
3020
|
+
* })
|
|
3021
|
+
* ```
|
|
3022
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3023
|
+
*/
|
|
3024
|
+
DataModelInstructions = 'DataModelInstructions',
|
|
2963
3025
|
/**
|
|
2964
3026
|
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
2965
3027
|
* @example
|
|
@@ -4385,6 +4447,26 @@ export enum HostEvent {
|
|
|
4385
4447
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
4386
4448
|
*/
|
|
4387
4449
|
PreviewSpotterData = 'PreviewSpotterData',
|
|
4450
|
+
/**
|
|
4451
|
+
* Opens the Add to Coaching modal from a visualization in Spotter Embed.
|
|
4452
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
4453
|
+
* @example
|
|
4454
|
+
* ```js
|
|
4455
|
+
* spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
|
|
4456
|
+
*
|
|
4457
|
+
*```
|
|
4458
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
4459
|
+
*/
|
|
4460
|
+
AddToCoaching = 'addToCoaching',
|
|
4461
|
+
/**
|
|
4462
|
+
* Opens the data model instructions modal in Spotter Embed.
|
|
4463
|
+
* @example
|
|
4464
|
+
* ```js
|
|
4465
|
+
* spotterEmbed.trigger(HostEvent.DataModelInstructions);
|
|
4466
|
+
* ```
|
|
4467
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
4468
|
+
*/
|
|
4469
|
+
DataModelInstructions = 'DataModelInstructions',
|
|
4388
4470
|
/**
|
|
4389
4471
|
* Resets the Spotter Embed Conversation.
|
|
4390
4472
|
* @example
|
|
@@ -4488,6 +4570,16 @@ export enum HostEvent {
|
|
|
4488
4570
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
4489
4571
|
*/
|
|
4490
4572
|
StartNewSpotterConversation = 'StartNewSpotterConversation',
|
|
4573
|
+
|
|
4574
|
+
/**
|
|
4575
|
+
* Get the current context of the embedded page.
|
|
4576
|
+
* @example
|
|
4577
|
+
* ```js
|
|
4578
|
+
* const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
4579
|
+
* ```
|
|
4580
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
4581
|
+
*/
|
|
4582
|
+
GetPageContext = 'GetPageContext',
|
|
4491
4583
|
}
|
|
4492
4584
|
|
|
4493
4585
|
/**
|
|
@@ -6298,6 +6390,9 @@ export enum EmbedErrorCodes {
|
|
|
6298
6390
|
|
|
6299
6391
|
/** Error parsing api intercept body */
|
|
6300
6392
|
PARSING_API_INTERCEPT_BODY_ERROR = 'PARSING_API_INTERCEPT_BODY_ERROR',
|
|
6393
|
+
|
|
6394
|
+
/** Failed to update embed parameters during pre-render */
|
|
6395
|
+
UPDATE_PARAMS_FAILED = 'UPDATE_PARAMS_FAILED',
|
|
6301
6396
|
}
|
|
6302
6397
|
|
|
6303
6398
|
/**
|
|
@@ -6371,6 +6466,14 @@ export interface EmbedErrorDetailsEvent {
|
|
|
6371
6466
|
/** Additional context-specific for backward compatibility */
|
|
6372
6467
|
[key: string]: any;
|
|
6373
6468
|
}
|
|
6469
|
+
|
|
6470
|
+
export enum ContextType {
|
|
6471
|
+
Search = 'search-answer',
|
|
6472
|
+
Liveboard = 'liveboard',
|
|
6473
|
+
Answer = 'answer',
|
|
6474
|
+
Spotter = 'spotter',
|
|
6475
|
+
}
|
|
6476
|
+
|
|
6374
6477
|
export interface DefaultAppInitData {
|
|
6375
6478
|
customisations: CustomisationsInterface;
|
|
6376
6479
|
authToken: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ERROR_MESSAGE } from '../errors';
|
|
2
|
-
import { HostEvent, MessagePayload } from '../types';
|
|
2
|
+
import { ContextType, HostEvent, MessagePayload } from '../types';
|
|
3
3
|
import { logger } from '../utils/logger';
|
|
4
4
|
import { handlePresentEvent } from '../utils';
|
|
5
5
|
import { getEmbedConfig } from '../embed/embedConfig';
|
|
@@ -22,12 +22,13 @@ export const reload = (iFrame: HTMLIFrameElement) => {
|
|
|
22
22
|
* @param message
|
|
23
23
|
* @param message.type
|
|
24
24
|
* @param message.data
|
|
25
|
+
* @param message.context
|
|
25
26
|
* @param thoughtSpotHost
|
|
26
27
|
* @param channel
|
|
27
28
|
*/
|
|
28
29
|
function postIframeMessage(
|
|
29
30
|
iFrame: HTMLIFrameElement,
|
|
30
|
-
message: { type: HostEvent; data: any },
|
|
31
|
+
message: { type: HostEvent; data: any, context?: any },
|
|
31
32
|
thoughtSpotHost: string,
|
|
32
33
|
channel?: MessageChannel,
|
|
33
34
|
) {
|
|
@@ -42,12 +43,14 @@ export const TRIGGER_TIMEOUT = 30000;
|
|
|
42
43
|
* @param messageType
|
|
43
44
|
* @param thoughtSpotHost
|
|
44
45
|
* @param data
|
|
46
|
+
* @param context
|
|
45
47
|
*/
|
|
46
48
|
export function processTrigger(
|
|
47
49
|
iFrame: HTMLIFrameElement,
|
|
48
50
|
messageType: HostEvent,
|
|
49
51
|
thoughtSpotHost: string,
|
|
50
52
|
data: any,
|
|
53
|
+
context?: ContextType,
|
|
51
54
|
): Promise<any> {
|
|
52
55
|
return new Promise<any>((res, rej) => {
|
|
53
56
|
if (messageType === HostEvent.Reload) {
|
|
@@ -83,6 +86,6 @@ export function processTrigger(
|
|
|
83
86
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
84
87
|
}, TRIGGER_TIMEOUT);
|
|
85
88
|
|
|
86
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
89
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
87
90
|
});
|
|
88
91
|
}
|
package/src/utils.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
DOMSelector,
|
|
16
16
|
RuntimeParameter,
|
|
17
17
|
AllEmbedViewConfig,
|
|
18
|
+
BaseViewConfig,
|
|
18
19
|
} from './types';
|
|
19
20
|
import { logger } from './utils/logger';
|
|
20
21
|
import { ERROR_MESSAGE } from './errors';
|
|
@@ -147,7 +148,8 @@ export const isValidCssMargin = (value: string): boolean => {
|
|
|
147
148
|
return false;
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
// This pattern allows for an optional negative sign, and numbers
|
|
151
|
+
// This pattern allows for an optional negative sign, and numbers
|
|
152
|
+
// that can be integers or decimals (including leading dot).
|
|
151
153
|
const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
|
|
152
154
|
const parts = value.trim().split(/\s+/);
|
|
153
155
|
|
|
@@ -559,6 +561,13 @@ export const formatTemplate = (template: string, values: Record<string, any>): s
|
|
|
559
561
|
});
|
|
560
562
|
};
|
|
561
563
|
|
|
564
|
+
export const getHostEventsConfig = (viewConfig: BaseViewConfig) => {
|
|
565
|
+
return {
|
|
566
|
+
shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
|
|
567
|
+
useHostEventsV2: viewConfig.useHostEventsV2,
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
|
|
562
571
|
/**
|
|
563
572
|
* Check if the window is undefined
|
|
564
573
|
* If the window is undefined, it means the code is running in a SSR environment.
|