@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/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.44.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.44.4-HE-beta.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -188,57 +188,71 @@
|
|
|
188
188
|
})(exports.AuthType || (exports.AuthType = {}));
|
|
189
189
|
/**
|
|
190
190
|
*
|
|
191
|
-
* This
|
|
192
|
-
* To access the updated modular homepage,
|
|
193
|
-
* set `modularHomeExperience` to `true`
|
|
194
|
-
* (available as Early Access feature in 9.12.5.cl).
|
|
191
|
+
* **Note**: This attribute is not supported in the classic (V1) homepage experience.
|
|
195
192
|
*
|
|
196
193
|
*/
|
|
197
194
|
exports.HomeLeftNavItem = void 0;
|
|
198
195
|
(function (HomeLeftNavItem) {
|
|
199
196
|
/**
|
|
197
|
+
* The *Search data* option in
|
|
198
|
+
* the *Insights* left navigation panel.
|
|
200
199
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
201
200
|
*/
|
|
202
201
|
HomeLeftNavItem["SearchData"] = "search-data";
|
|
203
202
|
/**
|
|
203
|
+
* The *Home* menu option in
|
|
204
|
+
* the *Insights* left navigation panel.
|
|
204
205
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
205
206
|
*/
|
|
206
207
|
HomeLeftNavItem["Home"] = "insights-home";
|
|
207
208
|
/**
|
|
209
|
+
* The *Liveboards* menu option in
|
|
210
|
+
* the *Insights* left navigation panel.
|
|
208
211
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
209
212
|
*/
|
|
210
213
|
HomeLeftNavItem["Liveboards"] = "liveboards";
|
|
211
214
|
/**
|
|
215
|
+
* The *Answers* menu option in
|
|
216
|
+
* the *Insights* left navigation panel.
|
|
212
217
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
213
218
|
*/
|
|
214
219
|
HomeLeftNavItem["Answers"] = "answers";
|
|
215
220
|
/**
|
|
221
|
+
* The *Monitor subscriptions* menu option in
|
|
222
|
+
* the *Insights* left navigation panel.
|
|
216
223
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
217
224
|
*/
|
|
218
225
|
HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
|
|
219
226
|
/**
|
|
227
|
+
* The *SpotIQ analysis* menu option in
|
|
228
|
+
* the *Insights* left navigation panel.
|
|
220
229
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
221
230
|
*/
|
|
222
231
|
HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
|
|
223
232
|
/**
|
|
233
|
+
* The *Liveboard schedules* menu option in
|
|
234
|
+
* the *Insights* left navigation panel.
|
|
224
235
|
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
225
236
|
*/
|
|
226
237
|
HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
|
|
227
238
|
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
239
|
+
* The create option in the *Insights*
|
|
240
|
+
* left navigation panel.
|
|
241
|
+
* Available in the V3 navigation experience.
|
|
230
242
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
231
243
|
*/
|
|
232
244
|
HomeLeftNavItem["Create"] = "create";
|
|
233
245
|
/**
|
|
234
|
-
* Spotter option in the
|
|
235
|
-
*
|
|
246
|
+
* The *Spotter* menu option in the *Insights*
|
|
247
|
+
* left navigation panel.
|
|
248
|
+
* Available in the V3 navigation experience.
|
|
236
249
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
237
250
|
*/
|
|
238
251
|
HomeLeftNavItem["Spotter"] = "spotter";
|
|
239
252
|
/**
|
|
240
|
-
* Favorites
|
|
241
|
-
*
|
|
253
|
+
* The *Favorites* section in the *Insights*
|
|
254
|
+
* left navigation panel.
|
|
255
|
+
* Available in the V3 navigation experience.
|
|
242
256
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
243
257
|
*/
|
|
244
258
|
HomeLeftNavItem["Favorites"] = "favorites";
|
|
@@ -310,10 +324,11 @@
|
|
|
310
324
|
RuntimeFilterOp["NOT_IN"] = "NOT_IN";
|
|
311
325
|
})(exports.RuntimeFilterOp || (exports.RuntimeFilterOp = {}));
|
|
312
326
|
/**
|
|
313
|
-
* Home page
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
327
|
+
* Home page modules that can be hidden
|
|
328
|
+
* via `hiddenHomepageModules` and reordered via
|
|
329
|
+
* `reorderedHomepageModules`.
|
|
330
|
+
*
|
|
331
|
+
* **Note**: This option is not supported in the classic (v1) experience.
|
|
317
332
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
318
333
|
*/
|
|
319
334
|
exports.HomepageModule = void 0;
|
|
@@ -327,7 +342,7 @@
|
|
|
327
342
|
*/
|
|
328
343
|
HomepageModule["Watchlist"] = "WATCHLIST";
|
|
329
344
|
/**
|
|
330
|
-
*
|
|
345
|
+
* Favorite module
|
|
331
346
|
*/
|
|
332
347
|
HomepageModule["Favorite"] = "FAVORITE";
|
|
333
348
|
/**
|
|
@@ -1483,6 +1498,28 @@
|
|
|
1483
1498
|
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1484
1499
|
*/
|
|
1485
1500
|
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1501
|
+
/**
|
|
1502
|
+
* Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
|
|
1503
|
+
* @example
|
|
1504
|
+
* ```js
|
|
1505
|
+
* spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
|
|
1506
|
+
* console.log('payload', payload);
|
|
1507
|
+
* })
|
|
1508
|
+
*```
|
|
1509
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
1510
|
+
*/
|
|
1511
|
+
EmbedEvent["AddToCoaching"] = "addToCoaching";
|
|
1512
|
+
/**
|
|
1513
|
+
* Emitted when user opens up the data model instructions modal in Spotter embed.
|
|
1514
|
+
* @example
|
|
1515
|
+
* ```js
|
|
1516
|
+
* spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
|
|
1517
|
+
* console.log('payload', payload);
|
|
1518
|
+
* })
|
|
1519
|
+
* ```
|
|
1520
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
1521
|
+
*/
|
|
1522
|
+
EmbedEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
1486
1523
|
/**
|
|
1487
1524
|
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1488
1525
|
* @example
|
|
@@ -2907,6 +2944,26 @@
|
|
|
2907
2944
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2908
2945
|
*/
|
|
2909
2946
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2947
|
+
/**
|
|
2948
|
+
* Opens the Add to Coaching modal from a visualization in Spotter Embed.
|
|
2949
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
2950
|
+
* @example
|
|
2951
|
+
* ```js
|
|
2952
|
+
* spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
|
|
2953
|
+
*
|
|
2954
|
+
*```
|
|
2955
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
2956
|
+
*/
|
|
2957
|
+
HostEvent["AddToCoaching"] = "addToCoaching";
|
|
2958
|
+
/**
|
|
2959
|
+
* Opens the data model instructions modal in Spotter Embed.
|
|
2960
|
+
* @example
|
|
2961
|
+
* ```js
|
|
2962
|
+
* spotterEmbed.trigger(HostEvent.DataModelInstructions);
|
|
2963
|
+
* ```
|
|
2964
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
2965
|
+
*/
|
|
2966
|
+
HostEvent["DataModelInstructions"] = "DataModelInstructions";
|
|
2910
2967
|
/**
|
|
2911
2968
|
* Resets the Spotter Embed Conversation.
|
|
2912
2969
|
* @example
|
|
@@ -3009,6 +3066,15 @@
|
|
|
3009
3066
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3010
3067
|
*/
|
|
3011
3068
|
HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
|
|
3069
|
+
/**
|
|
3070
|
+
* Get the current context of the embedded page.
|
|
3071
|
+
* @example
|
|
3072
|
+
* ```js
|
|
3073
|
+
* const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
3074
|
+
* ```
|
|
3075
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3076
|
+
*/
|
|
3077
|
+
HostEvent["GetPageContext"] = "GetPageContext";
|
|
3012
3078
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3013
3079
|
/**
|
|
3014
3080
|
* The different visual modes that the data sources panel within
|
|
@@ -4652,7 +4718,7 @@
|
|
|
4652
4718
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4653
4719
|
* @group Error Handling
|
|
4654
4720
|
*/
|
|
4655
|
-
|
|
4721
|
+
exports.ErrorDetailsTypes = void 0;
|
|
4656
4722
|
(function (ErrorDetailsTypes) {
|
|
4657
4723
|
/** API call failure */
|
|
4658
4724
|
ErrorDetailsTypes["API"] = "API";
|
|
@@ -4660,7 +4726,7 @@
|
|
|
4660
4726
|
ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
4661
4727
|
/** Network connectivity or request error */
|
|
4662
4728
|
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
4663
|
-
})(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
|
|
4729
|
+
})(exports.ErrorDetailsTypes || (exports.ErrorDetailsTypes = {}));
|
|
4664
4730
|
/**
|
|
4665
4731
|
* Specific error codes for embedded component errors.
|
|
4666
4732
|
*
|
|
@@ -4694,7 +4760,7 @@
|
|
|
4694
4760
|
* }
|
|
4695
4761
|
* });
|
|
4696
4762
|
* */
|
|
4697
|
-
|
|
4763
|
+
exports.EmbedErrorCodes = void 0;
|
|
4698
4764
|
(function (EmbedErrorCodes) {
|
|
4699
4765
|
/** Worksheet ID not found or does not exist */
|
|
4700
4766
|
EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
|
|
@@ -4718,7 +4784,16 @@
|
|
|
4718
4784
|
EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
|
|
4719
4785
|
/** Error parsing api intercept body */
|
|
4720
4786
|
EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
|
|
4721
|
-
|
|
4787
|
+
/** Failed to update embed parameters during pre-render */
|
|
4788
|
+
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
4789
|
+
})(exports.EmbedErrorCodes || (exports.EmbedErrorCodes = {}));
|
|
4790
|
+
exports.ContextType = void 0;
|
|
4791
|
+
(function (ContextType) {
|
|
4792
|
+
ContextType["Search"] = "search-answer";
|
|
4793
|
+
ContextType["Liveboard"] = "liveboard";
|
|
4794
|
+
ContextType["Answer"] = "answer";
|
|
4795
|
+
ContextType["Spotter"] = "spotter";
|
|
4796
|
+
})(exports.ContextType || (exports.ContextType = {}));
|
|
4722
4797
|
/**
|
|
4723
4798
|
* Enum for the type of API intercepted
|
|
4724
4799
|
*/
|
|
@@ -4891,6 +4966,7 @@
|
|
|
4891
4966
|
LOGIN_FAILED: 'Login failed',
|
|
4892
4967
|
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
4893
4968
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
4969
|
+
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
4894
4970
|
};
|
|
4895
4971
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
4896
4972
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -5016,7 +5092,8 @@
|
|
|
5016
5092
|
logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
|
|
5017
5093
|
return false;
|
|
5018
5094
|
}
|
|
5019
|
-
// This pattern allows for an optional negative sign, and numbers
|
|
5095
|
+
// This pattern allows for an optional negative sign, and numbers
|
|
5096
|
+
// that can be integers or decimals (including leading dot).
|
|
5020
5097
|
const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
|
|
5021
5098
|
const parts = value.trim().split(/\s+/);
|
|
5022
5099
|
if (parts.length > 4) {
|
|
@@ -5356,6 +5433,12 @@
|
|
|
5356
5433
|
return values[key] !== undefined ? String(values[key]) : match;
|
|
5357
5434
|
});
|
|
5358
5435
|
};
|
|
5436
|
+
const getHostEventsConfig = (viewConfig) => {
|
|
5437
|
+
return {
|
|
5438
|
+
shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
|
|
5439
|
+
useHostEventsV2: viewConfig.useHostEventsV2,
|
|
5440
|
+
};
|
|
5441
|
+
};
|
|
5359
5442
|
/**
|
|
5360
5443
|
* Check if the window is undefined
|
|
5361
5444
|
* If the window is undefined, it means the code is running in a SSR environment.
|
|
@@ -7653,7 +7736,12 @@
|
|
|
7653
7736
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7654
7737
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7655
7738
|
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7656
|
-
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
7739
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
7740
|
+
var PageType;
|
|
7741
|
+
(function (PageType) {
|
|
7742
|
+
PageType["PAGE"] = "page";
|
|
7743
|
+
PageType["DIALOG"] = "dialog";
|
|
7744
|
+
})(PageType || (PageType = {}));
|
|
7657
7745
|
|
|
7658
7746
|
const EndPoints = {
|
|
7659
7747
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -17440,6 +17528,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17440
17528
|
* @param message
|
|
17441
17529
|
* @param message.type
|
|
17442
17530
|
* @param message.data
|
|
17531
|
+
* @param message.context
|
|
17443
17532
|
* @param thoughtSpotHost
|
|
17444
17533
|
* @param channel
|
|
17445
17534
|
*/
|
|
@@ -17454,8 +17543,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17454
17543
|
* @param messageType
|
|
17455
17544
|
* @param thoughtSpotHost
|
|
17456
17545
|
* @param data
|
|
17546
|
+
* @param context
|
|
17457
17547
|
*/
|
|
17458
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17548
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
17459
17549
|
return new Promise((res, rej) => {
|
|
17460
17550
|
var _a;
|
|
17461
17551
|
if (messageType === exports.HostEvent.Reload) {
|
|
@@ -17489,7 +17579,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17489
17579
|
channel.port1.close();
|
|
17490
17580
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17491
17581
|
}, TRIGGER_TIMEOUT);
|
|
17492
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17582
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
17493
17583
|
});
|
|
17494
17584
|
}
|
|
17495
17585
|
|
|
@@ -17988,7 +18078,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17988
18078
|
return eventData;
|
|
17989
18079
|
}
|
|
17990
18080
|
|
|
17991
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.
|
|
18081
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.4-HE-beta.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
17992
18082
|
|
|
17993
18083
|
class HostEventClient {
|
|
17994
18084
|
constructor(iFrame) {
|
|
@@ -18000,16 +18090,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18000
18090
|
* @param {any} data Data to send with the host event
|
|
18001
18091
|
* @returns {Promise<any>} - the response from the process trigger
|
|
18002
18092
|
*/
|
|
18003
|
-
async processTrigger(message, data) {
|
|
18093
|
+
async processTrigger(message, data, context) {
|
|
18004
18094
|
if (!this.iFrame) {
|
|
18005
18095
|
throw new Error('Iframe element is not set');
|
|
18006
18096
|
}
|
|
18007
18097
|
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
18008
|
-
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
18098
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
|
|
18009
18099
|
}
|
|
18010
|
-
async handleHostEventWithParam(apiName, parameters) {
|
|
18100
|
+
async handleHostEventWithParam(apiName, parameters, context) {
|
|
18011
18101
|
var _a, _b, _c, _d;
|
|
18012
|
-
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
18102
|
+
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
18013
18103
|
if (!response) {
|
|
18014
18104
|
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
18015
18105
|
// eslint-disable-next-line no-throw-literal
|
|
@@ -18024,8 +18114,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18024
18114
|
}
|
|
18025
18115
|
return { ...response.value };
|
|
18026
18116
|
}
|
|
18027
|
-
async hostEventFallback(hostEvent, data) {
|
|
18028
|
-
return this.processTrigger(hostEvent, data);
|
|
18117
|
+
async hostEventFallback(hostEvent, data, context) {
|
|
18118
|
+
return this.processTrigger(hostEvent, data, context);
|
|
18029
18119
|
}
|
|
18030
18120
|
/**
|
|
18031
18121
|
* Setter for the iframe element used for host events
|
|
@@ -18034,49 +18124,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18034
18124
|
setIframeElement(iFrame) {
|
|
18035
18125
|
this.iFrame = iFrame;
|
|
18036
18126
|
}
|
|
18037
|
-
async triggerUIPassthroughApi(apiName, parameters) {
|
|
18127
|
+
async triggerUIPassthroughApi(apiName, parameters, context) {
|
|
18038
18128
|
const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
|
|
18039
18129
|
type: apiName,
|
|
18040
18130
|
parameters,
|
|
18041
|
-
});
|
|
18131
|
+
}, context);
|
|
18042
18132
|
return res;
|
|
18043
18133
|
}
|
|
18044
|
-
async handlePinEvent(payload) {
|
|
18134
|
+
async handlePinEvent(payload, context) {
|
|
18045
18135
|
var _a, _b;
|
|
18046
18136
|
if (!payload || !('newVizName' in payload)) {
|
|
18047
|
-
return this.hostEventFallback(exports.HostEvent.Pin, payload);
|
|
18137
|
+
return this.hostEventFallback(exports.HostEvent.Pin, payload, context);
|
|
18048
18138
|
}
|
|
18049
18139
|
const formattedPayload = {
|
|
18050
18140
|
...payload,
|
|
18051
18141
|
pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
|
|
18052
18142
|
newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
|
|
18053
18143
|
};
|
|
18054
|
-
const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
|
|
18144
|
+
const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
|
|
18055
18145
|
return {
|
|
18056
18146
|
...data,
|
|
18057
18147
|
liveboardId: data.pinboardId,
|
|
18058
18148
|
};
|
|
18059
18149
|
}
|
|
18060
|
-
async handleSaveAnswerEvent(payload) {
|
|
18150
|
+
async handleSaveAnswerEvent(payload, context) {
|
|
18061
18151
|
var _a, _b, _c, _d;
|
|
18062
18152
|
if (!payload || !('name' in payload) || !('description' in payload)) {
|
|
18063
18153
|
// Save is the fallback for SaveAnswer
|
|
18064
|
-
return this.hostEventFallback(exports.HostEvent.Save, payload);
|
|
18154
|
+
return this.hostEventFallback(exports.HostEvent.Save, payload, context);
|
|
18065
18155
|
}
|
|
18066
|
-
const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.SaveAnswer, payload);
|
|
18156
|
+
const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.SaveAnswer, payload, context);
|
|
18067
18157
|
return {
|
|
18068
18158
|
...data,
|
|
18069
18159
|
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
18070
18160
|
};
|
|
18071
18161
|
}
|
|
18072
|
-
async triggerHostEvent(hostEvent, payload) {
|
|
18162
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
18073
18163
|
switch (hostEvent) {
|
|
18074
18164
|
case exports.HostEvent.Pin:
|
|
18075
|
-
return this.handlePinEvent(payload);
|
|
18165
|
+
return this.handlePinEvent(payload, context);
|
|
18076
18166
|
case exports.HostEvent.SaveAnswer:
|
|
18077
|
-
return this.handleSaveAnswerEvent(payload);
|
|
18167
|
+
return this.handleSaveAnswerEvent(payload, context);
|
|
18078
18168
|
default:
|
|
18079
|
-
return this.hostEventFallback(hostEvent, payload);
|
|
18169
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
18080
18170
|
}
|
|
18081
18171
|
}
|
|
18082
18172
|
}
|
|
@@ -18187,9 +18277,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18187
18277
|
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
18188
18278
|
if (bodyParseError) {
|
|
18189
18279
|
const errorDetails = {
|
|
18190
|
-
errorType: ErrorDetailsTypes.API,
|
|
18280
|
+
errorType: exports.ErrorDetailsTypes.API,
|
|
18191
18281
|
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18192
|
-
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
18282
|
+
code: exports.EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
18193
18283
|
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18194
18284
|
};
|
|
18195
18285
|
executeEvent(exports.EmbedEvent.Error, errorDetails);
|
|
@@ -18505,9 +18595,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18505
18595
|
*/
|
|
18506
18596
|
throwInitError() {
|
|
18507
18597
|
this.handleError({
|
|
18508
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18598
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18509
18599
|
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18510
|
-
code: EmbedErrorCodes.INIT_ERROR,
|
|
18600
|
+
code: exports.EmbedErrorCodes.INIT_ERROR,
|
|
18511
18601
|
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18512
18602
|
});
|
|
18513
18603
|
}
|
|
@@ -18600,9 +18690,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18600
18690
|
window.addEventListener('online', onlineEventListener);
|
|
18601
18691
|
const offlineEventListener = (e) => {
|
|
18602
18692
|
const errorDetails = {
|
|
18603
|
-
errorType: ErrorDetailsTypes.NETWORK,
|
|
18693
|
+
errorType: exports.ErrorDetailsTypes.NETWORK,
|
|
18604
18694
|
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18605
|
-
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
18695
|
+
code: exports.EmbedErrorCodes.NETWORK_ERROR,
|
|
18606
18696
|
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18607
18697
|
};
|
|
18608
18698
|
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
@@ -18686,10 +18776,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18686
18776
|
]);
|
|
18687
18777
|
if (customActionsResult.errors.length > 0) {
|
|
18688
18778
|
this.handleError({
|
|
18689
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18779
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18690
18780
|
message: customActionsResult.errors,
|
|
18691
|
-
code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
|
|
18692
|
-
error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
|
|
18781
|
+
code: exports.EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
|
|
18782
|
+
error: { type: exports.EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
|
|
18693
18783
|
});
|
|
18694
18784
|
}
|
|
18695
18785
|
const baseInitData = {
|
|
@@ -18711,6 +18801,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18711
18801
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18712
18802
|
customActions: customActionsResult.actions,
|
|
18713
18803
|
...getInterceptInitData(this.viewConfig),
|
|
18804
|
+
...getHostEventsConfig(this.viewConfig),
|
|
18714
18805
|
};
|
|
18715
18806
|
return baseInitData;
|
|
18716
18807
|
}
|
|
@@ -18731,9 +18822,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18731
18822
|
.join('/');
|
|
18732
18823
|
return `${basePath}#`;
|
|
18733
18824
|
}
|
|
18734
|
-
getUpdateEmbedParamsObject() {
|
|
18825
|
+
async getUpdateEmbedParamsObject() {
|
|
18735
18826
|
let queryParams = this.getEmbedParamsObject();
|
|
18736
|
-
|
|
18827
|
+
const appInitData = await this.getAppInitData();
|
|
18828
|
+
queryParams = { ...this.viewConfig, ...queryParams, ...appInitData };
|
|
18737
18829
|
return queryParams;
|
|
18738
18830
|
}
|
|
18739
18831
|
/**
|
|
@@ -18787,18 +18879,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18787
18879
|
};
|
|
18788
18880
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
18789
18881
|
this.handleError({
|
|
18790
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18882
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18791
18883
|
message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18792
|
-
code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
|
|
18884
|
+
code: exports.EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
|
|
18793
18885
|
error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18794
18886
|
});
|
|
18795
18887
|
return queryParams;
|
|
18796
18888
|
}
|
|
18797
18889
|
if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
|
|
18798
18890
|
this.handleError({
|
|
18799
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18891
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18800
18892
|
message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18801
|
-
code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
|
|
18893
|
+
code: exports.EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
|
|
18802
18894
|
error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18803
18895
|
});
|
|
18804
18896
|
return queryParams;
|
|
@@ -19026,9 +19118,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19026
19118
|
});
|
|
19027
19119
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
19028
19120
|
this.handleError({
|
|
19029
|
-
errorType: ErrorDetailsTypes.API,
|
|
19121
|
+
errorType: exports.ErrorDetailsTypes.API,
|
|
19030
19122
|
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
19031
|
-
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
19123
|
+
code: exports.EmbedErrorCodes.LOGIN_FAILED,
|
|
19032
19124
|
error: error,
|
|
19033
19125
|
});
|
|
19034
19126
|
});
|
|
@@ -19042,6 +19134,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19042
19134
|
preRenderWrapper.id = preRenderIds.wrapper;
|
|
19043
19135
|
const initialPreRenderWrapperStyle = {
|
|
19044
19136
|
position: 'absolute',
|
|
19137
|
+
top: '0',
|
|
19138
|
+
left: '0',
|
|
19045
19139
|
width: '100vw',
|
|
19046
19140
|
height: '100vh',
|
|
19047
19141
|
};
|
|
@@ -19332,22 +19426,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19332
19426
|
* @param {any} data The payload to send with the message
|
|
19333
19427
|
* @returns A promise that resolves with the response from the embedded app
|
|
19334
19428
|
*/
|
|
19335
|
-
async trigger(messageType, data = {}) {
|
|
19429
|
+
async trigger(messageType, data = {}, context) {
|
|
19336
19430
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
19337
19431
|
if (!this.isRendered) {
|
|
19338
19432
|
this.handleError({
|
|
19339
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19433
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19340
19434
|
message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19341
|
-
code: EmbedErrorCodes.RENDER_NOT_CALLED,
|
|
19435
|
+
code: exports.EmbedErrorCodes.RENDER_NOT_CALLED,
|
|
19342
19436
|
error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19343
19437
|
});
|
|
19344
19438
|
return null;
|
|
19345
19439
|
}
|
|
19346
19440
|
if (!messageType) {
|
|
19347
19441
|
this.handleError({
|
|
19348
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19442
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19349
19443
|
message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19350
|
-
code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
|
|
19444
|
+
code: exports.EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
|
|
19351
19445
|
error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19352
19446
|
});
|
|
19353
19447
|
return null;
|
|
@@ -19359,7 +19453,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19359
19453
|
return null;
|
|
19360
19454
|
}
|
|
19361
19455
|
// send an empty object, this is needed for liveboard default handlers
|
|
19362
|
-
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
19456
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context);
|
|
19363
19457
|
}
|
|
19364
19458
|
/**
|
|
19365
19459
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19392,6 +19486,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19392
19486
|
handleRenderForPrerender() {
|
|
19393
19487
|
return this.render();
|
|
19394
19488
|
}
|
|
19489
|
+
/**
|
|
19490
|
+
* Get the current context of the embedded TS component.
|
|
19491
|
+
* @returns The current context object containing the page type and object ids.
|
|
19492
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
19493
|
+
*/
|
|
19494
|
+
async getCurrentContext() {
|
|
19495
|
+
return new Promise((resolve) => {
|
|
19496
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
19497
|
+
const context = await this.trigger(exports.HostEvent.GetPageContext, {});
|
|
19498
|
+
resolve(context);
|
|
19499
|
+
});
|
|
19500
|
+
});
|
|
19501
|
+
}
|
|
19395
19502
|
/**
|
|
19396
19503
|
* Creates the preRender shell
|
|
19397
19504
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
@@ -19506,8 +19613,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19506
19613
|
}
|
|
19507
19614
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
19508
19615
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
19509
|
-
this.executeAfterEmbedContainerLoaded(() => {
|
|
19510
|
-
|
|
19616
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
19617
|
+
try {
|
|
19618
|
+
const params = await this.getUpdateEmbedParamsObject();
|
|
19619
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, params);
|
|
19620
|
+
}
|
|
19621
|
+
catch (error) {
|
|
19622
|
+
logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
|
|
19623
|
+
this.handleError({
|
|
19624
|
+
errorType: exports.ErrorDetailsTypes.API,
|
|
19625
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
|
|
19626
|
+
code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
|
|
19627
|
+
error: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
19628
|
+
});
|
|
19629
|
+
}
|
|
19511
19630
|
});
|
|
19512
19631
|
}
|
|
19513
19632
|
this.beforePrerenderVisible();
|
|
@@ -19527,7 +19646,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19527
19646
|
this.resizeObserver.observe(this.el);
|
|
19528
19647
|
}
|
|
19529
19648
|
}
|
|
19530
|
-
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
19649
|
+
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events', 'overflow']);
|
|
19531
19650
|
this.subscribeToEvents();
|
|
19532
19651
|
// Setup fullscreen change handler for prerendered components
|
|
19533
19652
|
if (this.iFrame) {
|
|
@@ -19570,7 +19689,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19570
19689
|
opacity: '0',
|
|
19571
19690
|
pointerEvents: 'none',
|
|
19572
19691
|
zIndex: '-1000',
|
|
19573
|
-
position: 'absolute
|
|
19692
|
+
position: 'absolute',
|
|
19693
|
+
top: '0',
|
|
19694
|
+
left: '0',
|
|
19695
|
+
overflow: 'hidden',
|
|
19574
19696
|
};
|
|
19575
19697
|
setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
|
|
19576
19698
|
if (this.resizeObserver) {
|
|
@@ -20250,6 +20372,7 @@ query GetEurekaVizSnapshots(
|
|
|
20250
20372
|
super(domSelector, viewConfig);
|
|
20251
20373
|
this.defaultHeight = 500;
|
|
20252
20374
|
this.sendFullHeightLazyLoadData = () => {
|
|
20375
|
+
console.log('sendFullHeightLazyLoadData', this.iFrame);
|
|
20253
20376
|
const data = calculateVisibleElementData(this.iFrame);
|
|
20254
20377
|
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
20255
20378
|
};
|
|
@@ -20443,9 +20566,9 @@ query GetEurekaVizSnapshots(
|
|
|
20443
20566
|
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
20444
20567
|
if (!liveboardId) {
|
|
20445
20568
|
this.handleError({
|
|
20446
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20569
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20447
20570
|
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20448
|
-
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
20571
|
+
code: exports.EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
20449
20572
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20450
20573
|
});
|
|
20451
20574
|
}
|
|
@@ -20510,7 +20633,7 @@ query GetEurekaVizSnapshots(
|
|
|
20510
20633
|
* @param {any} data The payload to send with the message
|
|
20511
20634
|
* @returns A promise that resolves with the response from the embedded app
|
|
20512
20635
|
*/
|
|
20513
|
-
trigger(messageType, data = {}) {
|
|
20636
|
+
trigger(messageType, data = {}, context) {
|
|
20514
20637
|
const dataWithVizId = data;
|
|
20515
20638
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
20516
20639
|
this.setActiveTab(data);
|
|
@@ -20519,7 +20642,7 @@ query GetEurekaVizSnapshots(
|
|
|
20519
20642
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
20520
20643
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
20521
20644
|
}
|
|
20522
|
-
return super.trigger(messageType, dataWithVizId);
|
|
20645
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
20523
20646
|
}
|
|
20524
20647
|
/**
|
|
20525
20648
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
@@ -20588,6 +20711,15 @@ query GetEurekaVizSnapshots(
|
|
|
20588
20711
|
}
|
|
20589
20712
|
return url;
|
|
20590
20713
|
}
|
|
20714
|
+
/**
|
|
20715
|
+
* Get the current context of the embedded liveboard.
|
|
20716
|
+
* @returns The current context object containing the page type and object ids.
|
|
20717
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
20718
|
+
*/
|
|
20719
|
+
async getCurrentContext() {
|
|
20720
|
+
const context = await super.getCurrentContext();
|
|
20721
|
+
return context;
|
|
20722
|
+
}
|
|
20591
20723
|
}
|
|
20592
20724
|
/**
|
|
20593
20725
|
* @hidden
|
|
@@ -20768,6 +20900,15 @@ query GetEurekaVizSnapshots(
|
|
|
20768
20900
|
});
|
|
20769
20901
|
return this;
|
|
20770
20902
|
}
|
|
20903
|
+
/**
|
|
20904
|
+
* Get the current context of the embedded search.
|
|
20905
|
+
* @returns The current context object containing the page type and object ids.
|
|
20906
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
20907
|
+
*/
|
|
20908
|
+
async getCurrentContext() {
|
|
20909
|
+
const context = await super.getCurrentContext();
|
|
20910
|
+
return context;
|
|
20911
|
+
}
|
|
20771
20912
|
}
|
|
20772
20913
|
|
|
20773
20914
|
/**
|
|
@@ -20843,6 +20984,15 @@ query GetEurekaVizSnapshots(
|
|
|
20843
20984
|
const defaultAppInitData = await super.getAppInitData();
|
|
20844
20985
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
20845
20986
|
}
|
|
20987
|
+
/**
|
|
20988
|
+
* Get the current context of the embedded search bar.
|
|
20989
|
+
* @returns The current context object containing the page type and object ids.
|
|
20990
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
20991
|
+
*/
|
|
20992
|
+
async getCurrentContext() {
|
|
20993
|
+
const context = await super.getCurrentContext();
|
|
20994
|
+
return context;
|
|
20995
|
+
}
|
|
20846
20996
|
}
|
|
20847
20997
|
|
|
20848
20998
|
const createConversation = `
|
|
@@ -21412,9 +21562,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21412
21562
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
21413
21563
|
if (!worksheetId) {
|
|
21414
21564
|
this.handleError({
|
|
21415
|
-
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21565
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21416
21566
|
message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21417
|
-
code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
|
|
21567
|
+
code: exports.EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
|
|
21418
21568
|
error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21419
21569
|
});
|
|
21420
21570
|
}
|
|
@@ -21472,6 +21622,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21472
21622
|
await this.renderIFrame(src);
|
|
21473
21623
|
return this;
|
|
21474
21624
|
}
|
|
21625
|
+
/**
|
|
21626
|
+
* Get the current context of the embedded SpotterEmbed.
|
|
21627
|
+
* @returns The current context object containing the page type and object ids.
|
|
21628
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
21629
|
+
*/
|
|
21630
|
+
async getCurrentContext() {
|
|
21631
|
+
const context = await super.getCurrentContext();
|
|
21632
|
+
return context;
|
|
21633
|
+
}
|
|
21475
21634
|
}
|
|
21476
21635
|
/**
|
|
21477
21636
|
* Embed ThoughtSpot AI Conversation.
|
|
@@ -21578,6 +21737,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21578
21737
|
await this.renderV1Embed(src);
|
|
21579
21738
|
return this;
|
|
21580
21739
|
}
|
|
21740
|
+
/**
|
|
21741
|
+
* Get the current context of the embedded SageEmbed.
|
|
21742
|
+
* @returns The current context object containing the page type and object ids.
|
|
21743
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
21744
|
+
*/
|
|
21745
|
+
async getCurrentContext() {
|
|
21746
|
+
const context = await super.getCurrentContext();
|
|
21747
|
+
return context;
|
|
21748
|
+
}
|
|
21581
21749
|
}
|
|
21582
21750
|
|
|
21583
21751
|
const getAnswerSessionFromQuery = `
|