@thoughtspot/visual-embed-sdk 1.39.2 → 1.39.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +19 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +23 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +56 -8
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +23 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +31 -5
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +28 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +9 -7
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +9 -7
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +0 -17
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +2 -4
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +12 -11
- package/cjs/src/embed/liveboard.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 +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +73 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +438 -100
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +262 -6
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +228 -2
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/global-styles.js +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +7 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils.spec.js +25 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CmEQfuE3.js → index-ZrE8YYq8.js} +1 -1
- package/dist/src/embed/app.d.ts +19 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +23 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +9 -7
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +0 -17
- package/dist/src/embed/liveboard.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/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +73 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +262 -6
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +385 -71
- package/dist/tsembed-react.js +385 -69
- package/dist/tsembed.es.js +303 -24
- package/dist/tsembed.js +301 -22
- package/dist/visual-embed-sdk-react-full.d.ts +386 -72
- package/dist/visual-embed-sdk-react.d.ts +386 -72
- package/dist/visual-embed-sdk.d.ts +314 -53
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +19 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +58 -10
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +23 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +30 -5
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +30 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +9 -7
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +9 -7
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +0 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +2 -4
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +12 -11
- package/lib/src/embed/liveboard.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/react/all-types-export.d.ts +1 -1
- 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 +73 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +441 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +262 -6
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +228 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/global-styles.js +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +7 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils.spec.js +26 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +315 -54
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +90 -23
- package/src/embed/app.ts +27 -15
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +34 -10
- package/src/embed/conversation.spec.ts +40 -2
- package/src/embed/embedConfig.ts +10 -8
- package/src/embed/liveboard.spec.ts +5 -4
- package/src/embed/liveboard.ts +2 -22
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +558 -157
- package/src/react/index.tsx +117 -51
- package/src/types.ts +301 -44
- package/src/utils/global-styles.ts +1 -1
- package/src/utils/graphql/nlsService/conversation-service.ts +7 -1
- package/src/utils.spec.ts +29 -0
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.39.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.39.3 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -421,6 +421,12 @@
|
|
|
421
421
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
422
422
|
*/
|
|
423
423
|
HomeLeftNavItem["Spotter"] = "spotter";
|
|
424
|
+
/**
|
|
425
|
+
* Favorites option in the insights left navigation,
|
|
426
|
+
* available when new navigation V3 is enabled.
|
|
427
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
428
|
+
*/
|
|
429
|
+
HomeLeftNavItem["Favorites"] = "favorites";
|
|
424
430
|
})(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
|
|
425
431
|
/**
|
|
426
432
|
* A map of the supported runtime filter operations
|
|
@@ -1607,6 +1613,83 @@
|
|
|
1607
1613
|
* @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
1608
1614
|
*/
|
|
1609
1615
|
EmbedEvent["ExitPresentMode"] = "exitPresentMode";
|
|
1616
|
+
/**
|
|
1617
|
+
* Emitted when spotter response is text data
|
|
1618
|
+
* @example
|
|
1619
|
+
* ```js
|
|
1620
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1621
|
+
* console.log('payload', payload);
|
|
1622
|
+
* })
|
|
1623
|
+
*```
|
|
1624
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1625
|
+
*/
|
|
1626
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1627
|
+
/**
|
|
1628
|
+
* Emitted when user opens up the worksheet preview modal in spotter embed.
|
|
1629
|
+
* @example
|
|
1630
|
+
* ```js
|
|
1631
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1632
|
+
* console.log('payload', payload);
|
|
1633
|
+
* })
|
|
1634
|
+
*```
|
|
1635
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1636
|
+
*/
|
|
1637
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1638
|
+
/**
|
|
1639
|
+
* Emitted when the spotter query is triggered in spotter embed.
|
|
1640
|
+
* @example
|
|
1641
|
+
* ```js
|
|
1642
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1643
|
+
* console.log('payload', payload);
|
|
1644
|
+
* })
|
|
1645
|
+
*```
|
|
1646
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1647
|
+
*/
|
|
1648
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1649
|
+
/**
|
|
1650
|
+
* Emitted when the last spotter query is edited in spotter embed.
|
|
1651
|
+
* @example
|
|
1652
|
+
* ```js
|
|
1653
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1654
|
+
* console.log('payload', payload);
|
|
1655
|
+
* })
|
|
1656
|
+
*```
|
|
1657
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1658
|
+
*/
|
|
1659
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1660
|
+
/**
|
|
1661
|
+
* Emitted when the last spotter query is deleted in spotter embed.
|
|
1662
|
+
* @example
|
|
1663
|
+
* ```js
|
|
1664
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1665
|
+
* console.log('payload', payload);
|
|
1666
|
+
* })
|
|
1667
|
+
*```
|
|
1668
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1669
|
+
*/
|
|
1670
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1671
|
+
/**
|
|
1672
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1673
|
+
* @example
|
|
1674
|
+
* ```js
|
|
1675
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1676
|
+
* console.log('payload', payload);
|
|
1677
|
+
* })
|
|
1678
|
+
*```
|
|
1679
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1680
|
+
*/
|
|
1681
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1682
|
+
/**
|
|
1683
|
+
* Emitted when the *Spotter* is initialized.
|
|
1684
|
+
* @example
|
|
1685
|
+
* ```js
|
|
1686
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1687
|
+
* console.log('payload', payload);
|
|
1688
|
+
* })
|
|
1689
|
+
*```
|
|
1690
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1691
|
+
*/
|
|
1692
|
+
EmbedEvent["SpotterInit"] = "SpotterInit";
|
|
1610
1693
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1611
1694
|
/**
|
|
1612
1695
|
* Event types that can be triggered by the host application
|
|
@@ -1897,6 +1980,7 @@
|
|
|
1897
1980
|
* @param
|
|
1898
1981
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1899
1982
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1983
|
+
* **Required** in Spotter Embed.
|
|
1900
1984
|
* @param
|
|
1901
1985
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
1902
1986
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -1944,6 +2028,12 @@
|
|
|
1944
2028
|
* ```js
|
|
1945
2029
|
* appEmbed.trigger(HostEvent.Pin)
|
|
1946
2030
|
* ```
|
|
2031
|
+
* @example
|
|
2032
|
+
* ```js
|
|
2033
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2034
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2035
|
+
* });
|
|
2036
|
+
* ```
|
|
1947
2037
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1948
2038
|
*/
|
|
1949
2039
|
HostEvent["Pin"] = "pin";
|
|
@@ -2037,6 +2127,12 @@
|
|
|
2037
2127
|
* ```js
|
|
2038
2128
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2039
2129
|
* ```
|
|
2130
|
+
* @example
|
|
2131
|
+
* ```js
|
|
2132
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2133
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2134
|
+
* });
|
|
2135
|
+
* ```
|
|
2040
2136
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2041
2137
|
*/
|
|
2042
2138
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2109,6 +2205,7 @@
|
|
|
2109
2205
|
* This event is not supported in visualization embed and search embed.
|
|
2110
2206
|
* @param - object - To trigger the action for a specific visualization
|
|
2111
2207
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2208
|
+
* **Required** in Spotter embed.
|
|
2112
2209
|
* @example
|
|
2113
2210
|
* ```js
|
|
2114
2211
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2117,6 +2214,12 @@
|
|
|
2117
2214
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2118
2215
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2119
2216
|
* ```
|
|
2217
|
+
* @example
|
|
2218
|
+
* ```js
|
|
2219
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2220
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2221
|
+
* });
|
|
2222
|
+
* ```
|
|
2120
2223
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2121
2224
|
*/
|
|
2122
2225
|
HostEvent["Edit"] = "edit";
|
|
@@ -2164,6 +2267,16 @@
|
|
|
2164
2267
|
* );
|
|
2165
2268
|
* })
|
|
2166
2269
|
* ```
|
|
2270
|
+
* @example
|
|
2271
|
+
* ```js
|
|
2272
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2273
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2274
|
+
* }).then((tml) => {
|
|
2275
|
+
* console.log(
|
|
2276
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2277
|
+
* );
|
|
2278
|
+
* })
|
|
2279
|
+
* ```
|
|
2167
2280
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2168
2281
|
* @important
|
|
2169
2282
|
*/
|
|
@@ -2251,7 +2364,12 @@
|
|
|
2251
2364
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2252
2365
|
*
|
|
2253
2366
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2367
|
+
*
|
|
2368
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2369
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2370
|
+
* })
|
|
2254
2371
|
* ```
|
|
2372
|
+
*
|
|
2255
2373
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2256
2374
|
*/
|
|
2257
2375
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
@@ -2269,6 +2387,11 @@
|
|
|
2269
2387
|
* ```js
|
|
2270
2388
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2271
2389
|
* ```
|
|
2390
|
+
* ```js
|
|
2391
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2392
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2393
|
+
* })
|
|
2394
|
+
* ```
|
|
2272
2395
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2273
2396
|
*/
|
|
2274
2397
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2286,6 +2409,11 @@
|
|
|
2286
2409
|
* ```js
|
|
2287
2410
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2288
2411
|
* ```
|
|
2412
|
+
* ```js
|
|
2413
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2414
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2415
|
+
* })
|
|
2416
|
+
* ```
|
|
2289
2417
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2290
2418
|
*/
|
|
2291
2419
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2305,6 +2433,7 @@
|
|
|
2305
2433
|
/**
|
|
2306
2434
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2307
2435
|
* Saves the changes.
|
|
2436
|
+
* @param - `vizId` is required in Spotter Embed.
|
|
2308
2437
|
* @example
|
|
2309
2438
|
* ```js
|
|
2310
2439
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2312,6 +2441,11 @@
|
|
|
2312
2441
|
* ```js
|
|
2313
2442
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2314
2443
|
* ```
|
|
2444
|
+
* ```js
|
|
2445
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2446
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2447
|
+
* })
|
|
2448
|
+
* ```
|
|
2315
2449
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2316
2450
|
*/
|
|
2317
2451
|
HostEvent["Save"] = "save";
|
|
@@ -2595,7 +2729,7 @@
|
|
|
2595
2729
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2596
2730
|
/**
|
|
2597
2731
|
* Triggers an action to update Parameter values on embedded
|
|
2598
|
-
* Answers and
|
|
2732
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2599
2733
|
*
|
|
2600
2734
|
* @example
|
|
2601
2735
|
* ```js
|
|
@@ -2614,6 +2748,13 @@
|
|
|
2614
2748
|
* console.log('parameters', parameter);
|
|
2615
2749
|
* });
|
|
2616
2750
|
*```
|
|
2751
|
+
*```js
|
|
2752
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
2753
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2754
|
+
* }).then((parameter) => {
|
|
2755
|
+
* console.log('parameters', parameter);
|
|
2756
|
+
* });
|
|
2757
|
+
*```
|
|
2617
2758
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2618
2759
|
*/
|
|
2619
2760
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2681,6 +2822,64 @@
|
|
|
2681
2822
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2682
2823
|
*/
|
|
2683
2824
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2825
|
+
/**
|
|
2826
|
+
* Triggers a search operation with the search tokens specified in
|
|
2827
|
+
* the search query string in spotter embed.
|
|
2828
|
+
* @param - `queryString`: Text string in Natural Language format
|
|
2829
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2830
|
+
* @example
|
|
2831
|
+
* ```js
|
|
2832
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
2833
|
+
* query: 'revenue per year',
|
|
2834
|
+
* executeSearch: true,
|
|
2835
|
+
* })
|
|
2836
|
+
* ```
|
|
2837
|
+
*/
|
|
2838
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2839
|
+
/**
|
|
2840
|
+
* Edits the last prompt in spotter embed.
|
|
2841
|
+
* @param - `query`: Text string
|
|
2842
|
+
* @example
|
|
2843
|
+
* ```js
|
|
2844
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2845
|
+
* ```
|
|
2846
|
+
*/
|
|
2847
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2848
|
+
/**
|
|
2849
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
2850
|
+
* @example
|
|
2851
|
+
* ```js
|
|
2852
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2853
|
+
* ```
|
|
2854
|
+
*/
|
|
2855
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2856
|
+
/**
|
|
2857
|
+
* Resets the Spotter Embed Conversation.
|
|
2858
|
+
* @example
|
|
2859
|
+
* ```js
|
|
2860
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2861
|
+
* ```
|
|
2862
|
+
*/
|
|
2863
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2864
|
+
/**
|
|
2865
|
+
* Deletes the last prompt in spotter embed.
|
|
2866
|
+
* @example
|
|
2867
|
+
* ```js
|
|
2868
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2869
|
+
* ```
|
|
2870
|
+
*/
|
|
2871
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2872
|
+
/**
|
|
2873
|
+
* Toggle the visualization to chart or table view.
|
|
2874
|
+
* @param - `vizId ` In Spotter Embed, vizId is required.
|
|
2875
|
+
* @example
|
|
2876
|
+
* ```js
|
|
2877
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2878
|
+
* vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
|
|
2879
|
+
* });
|
|
2880
|
+
*```
|
|
2881
|
+
*/
|
|
2882
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2684
2883
|
/**
|
|
2685
2884
|
* @hidden
|
|
2686
2885
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2691,6 +2890,16 @@
|
|
|
2691
2890
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2692
2891
|
*/
|
|
2693
2892
|
HostEvent["ExitPresentMode"] = "exitPresentMode";
|
|
2893
|
+
/**
|
|
2894
|
+
* Trigger the *Ask Sage* action for visualizations
|
|
2895
|
+
* @example
|
|
2896
|
+
* ```js
|
|
2897
|
+
* liveboardEmbed.trigger(HostEvent.AskSpotter,
|
|
2898
|
+
* {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2899
|
+
* ```
|
|
2900
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2901
|
+
*/
|
|
2902
|
+
HostEvent["AskSpotter"] = "askSpotter";
|
|
2694
2903
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2695
2904
|
/**
|
|
2696
2905
|
* The different visual modes that the data sources panel within
|
|
@@ -2796,6 +3005,7 @@
|
|
|
2796
3005
|
Param["Query"] = "query";
|
|
2797
3006
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
2798
3007
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
3008
|
+
Param["ListPageVersion"] = "listpageVersion";
|
|
2799
3009
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
2800
3010
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
2801
3011
|
Param["IsProductTour"] = "isProductTour";
|
|
@@ -2830,7 +3040,7 @@
|
|
|
2830
3040
|
Param["DataSourceId"] = "dataSourceId";
|
|
2831
3041
|
Param["preAuthCache"] = "preAuthCache";
|
|
2832
3042
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2833
|
-
Param["CoverAndFilterOptionInPDF"] = "
|
|
3043
|
+
Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
|
|
2834
3044
|
Param["PrimaryAction"] = "primaryAction";
|
|
2835
3045
|
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
2836
3046
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
@@ -4056,6 +4266,22 @@
|
|
|
4056
4266
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4057
4267
|
*/
|
|
4058
4268
|
Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
4269
|
+
/**
|
|
4270
|
+
* Action ID for hide or disable the
|
|
4271
|
+
* Spotter in conversation training widget.
|
|
4272
|
+
* The Add to Coaching feature is currently in beta
|
|
4273
|
+
* and is disabled by default on embed deployments.
|
|
4274
|
+
* To enable this feature on your instance,
|
|
4275
|
+
* contact ThoughtSpot Support.
|
|
4276
|
+
* @example
|
|
4277
|
+
* ```js
|
|
4278
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
4279
|
+
* disabledActions: [Action.InConversationTraining]
|
|
4280
|
+
*
|
|
4281
|
+
* ```
|
|
4282
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4283
|
+
*/
|
|
4284
|
+
Action["InConversationTraining"] = "InConversationTraining";
|
|
4059
4285
|
})(exports.Action || (exports.Action = {}));
|
|
4060
4286
|
var PrefetchFeatures;
|
|
4061
4287
|
(function (PrefetchFeatures) {
|
|
@@ -6891,6 +7117,7 @@
|
|
|
6891
7117
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6892
7118
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6893
7119
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7120
|
+
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
6894
7121
|
};
|
|
6895
7122
|
|
|
6896
7123
|
const EndPoints = {
|
|
@@ -7098,13 +7325,14 @@
|
|
|
7098
7325
|
*
|
|
7099
7326
|
* @example
|
|
7100
7327
|
* ```js
|
|
7328
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
7329
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
7101
7330
|
* const config = getInitConfig();
|
|
7331
|
+
* // Log the configuration settings
|
|
7102
7332
|
* console.log(config);
|
|
7103
7333
|
* ```
|
|
7104
|
-
*
|
|
7105
|
-
*
|
|
7106
|
-
* Returns the `EmbedConfig` object, which
|
|
7107
|
-
* contains the configuration settings used to
|
|
7334
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
7335
|
+
* object, which contains the configuration settings used to
|
|
7108
7336
|
* initialize the SDK, including the following:
|
|
7109
7337
|
*
|
|
7110
7338
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -7113,9 +7341,10 @@
|
|
|
7113
7341
|
* - `customizations` - Style, text, and icon customization settings
|
|
7114
7342
|
* that were applied during the SDK initialization.
|
|
7115
7343
|
*
|
|
7116
|
-
*
|
|
7117
|
-
*
|
|
7344
|
+
* The following JSON output shows the embed configuration
|
|
7345
|
+
* settings returned from the code in the previous example:
|
|
7118
7346
|
*
|
|
7347
|
+
* @example
|
|
7119
7348
|
* ```json
|
|
7120
7349
|
* {
|
|
7121
7350
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -7137,7 +7366,7 @@
|
|
|
7137
7366
|
* "authTriggerContainer": "#your-own-div"
|
|
7138
7367
|
* }
|
|
7139
7368
|
* ```
|
|
7140
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
7369
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
7141
7370
|
* @group Global methods
|
|
7142
7371
|
*/
|
|
7143
7372
|
const getEmbedConfig = () => getValueFromWindow(configKey) || {};
|
|
@@ -15513,7 +15742,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15513
15742
|
return e;
|
|
15514
15743
|
}
|
|
15515
15744
|
|
|
15516
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.
|
|
15745
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.3";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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":"^8.2.6","@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":"^22.2.3","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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":"^1.1.1",jest:"^26.6.3","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":"^26.5.5","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:"31 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};
|
|
15517
15746
|
|
|
15518
15747
|
/**
|
|
15519
15748
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17335,6 +17564,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17335
17564
|
*/
|
|
17336
17565
|
HomePage["Modular"] = "v2";
|
|
17337
17566
|
})(HomePage || (HomePage = {}));
|
|
17567
|
+
/**
|
|
17568
|
+
* Define the version of the list page
|
|
17569
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
17570
|
+
*/
|
|
17571
|
+
var ListPage;
|
|
17572
|
+
(function (ListPage) {
|
|
17573
|
+
/**
|
|
17574
|
+
* List (v2) is the traditional List Experience.
|
|
17575
|
+
* It serves as the foundational version of the list page.
|
|
17576
|
+
*/
|
|
17577
|
+
ListPage["List"] = "v2";
|
|
17578
|
+
/**
|
|
17579
|
+
* ListWithUXChanges (v3) introduces the new updated list page with UX changes.
|
|
17580
|
+
*/
|
|
17581
|
+
ListPage["ListWithUXChanges"] = "v3";
|
|
17582
|
+
})(ListPage || (ListPage = {}));
|
|
17338
17583
|
/**
|
|
17339
17584
|
* Embeds full ThoughtSpot experience in a host application.
|
|
17340
17585
|
* @group Embed components
|
|
@@ -17391,7 +17636,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17391
17636
|
getEmbedParams() {
|
|
17392
17637
|
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17393
17638
|
/* eslint-disable-next-line max-len */
|
|
17394
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17639
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17395
17640
|
let params = {};
|
|
17396
17641
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17397
17642
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17407,6 +17652,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17407
17652
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17408
17653
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17409
17654
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17655
|
+
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
17410
17656
|
params = this.getBaseQueryParams(params);
|
|
17411
17657
|
if (hideObjectSearch) {
|
|
17412
17658
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17477,6 +17723,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17477
17723
|
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17478
17724
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17479
17725
|
}
|
|
17726
|
+
// listPageVersion v3 will enable the new list page
|
|
17727
|
+
if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
|
|
17728
|
+
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
17729
|
+
}
|
|
17480
17730
|
}
|
|
17481
17731
|
const queryParams = getQueryParamString(params, true);
|
|
17482
17732
|
return queryParams;
|
|
@@ -17614,7 +17864,7 @@ query GetEurekaVizSnapshots(
|
|
|
17614
17864
|
return;
|
|
17615
17865
|
}
|
|
17616
17866
|
const previewStyles = `
|
|
17617
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
17867
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
|
|
17618
17868
|
<style id="ts-preview-style">
|
|
17619
17869
|
.ts-viz-preview-loader {
|
|
17620
17870
|
position: absolute;
|
|
@@ -17726,7 +17976,7 @@ query GetEurekaVizSnapshots(
|
|
|
17726
17976
|
getEmbedParams() {
|
|
17727
17977
|
let params = {};
|
|
17728
17978
|
params = this.getBaseQueryParams(params);
|
|
17729
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17979
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17730
17980
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
17731
17981
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
17732
17982
|
if (fullHeight === true) {
|
|
@@ -17778,9 +18028,6 @@ query GetEurekaVizSnapshots(
|
|
|
17778
18028
|
if (dataSourceId !== undefined) {
|
|
17779
18029
|
params[Param.DataSourceId] = dataSourceId;
|
|
17780
18030
|
}
|
|
17781
|
-
if (coverAndFilterOptionInPDF !== undefined) {
|
|
17782
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17783
|
-
}
|
|
17784
18031
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17785
18032
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17786
18033
|
}
|
|
@@ -17791,6 +18038,7 @@ query GetEurekaVizSnapshots(
|
|
|
17791
18038
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17792
18039
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17793
18040
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18041
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17794
18042
|
const queryParams = getQueryParamString(params, true);
|
|
17795
18043
|
return queryParams;
|
|
17796
18044
|
}
|
|
@@ -18294,7 +18542,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18294
18542
|
});
|
|
18295
18543
|
const data = responses[0].data;
|
|
18296
18544
|
return {
|
|
18297
|
-
|
|
18545
|
+
convId: this.conversationId,
|
|
18546
|
+
messageId: responses[0].msgId,
|
|
18547
|
+
data: {
|
|
18548
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18549
|
+
convId: this.conversationId,
|
|
18550
|
+
messageId: responses[0].msgId,
|
|
18551
|
+
},
|
|
18298
18552
|
error: null,
|
|
18299
18553
|
};
|
|
18300
18554
|
}
|
|
@@ -18312,7 +18566,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18312
18566
|
}
|
|
18313
18567
|
}
|
|
18314
18568
|
|
|
18315
|
-
class ConversationMessage extends TsEmbed {
|
|
18569
|
+
let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
18316
18570
|
constructor(container, viewConfig) {
|
|
18317
18571
|
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18318
18572
|
super(container, viewConfig);
|
|
@@ -18320,7 +18574,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18320
18574
|
}
|
|
18321
18575
|
getIframeSrc() {
|
|
18322
18576
|
var _a;
|
|
18323
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18577
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18324
18578
|
const path = 'conv-assist-answer';
|
|
18325
18579
|
const queryParams = this.getBaseQueryParams();
|
|
18326
18580
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
@@ -18335,6 +18589,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18335
18589
|
genNo,
|
|
18336
18590
|
acSessionId,
|
|
18337
18591
|
acGenNo,
|
|
18592
|
+
convId,
|
|
18593
|
+
messageId,
|
|
18338
18594
|
});
|
|
18339
18595
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18340
18596
|
}
|
|
@@ -18344,7 +18600,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18344
18600
|
await this.renderIFrame(src);
|
|
18345
18601
|
return this;
|
|
18346
18602
|
}
|
|
18347
|
-
}
|
|
18603
|
+
};
|
|
18348
18604
|
/**
|
|
18349
18605
|
* Create a conversation embed, which can be integrated inside
|
|
18350
18606
|
* chatbots or other conversational interfaces.
|
|
@@ -18364,7 +18620,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18364
18620
|
* @group Embed components
|
|
18365
18621
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18366
18622
|
*/
|
|
18367
|
-
|
|
18623
|
+
class SpotterAgentEmbed {
|
|
18368
18624
|
constructor(viewConfig) {
|
|
18369
18625
|
this.viewConfig = viewConfig;
|
|
18370
18626
|
const embedConfig = getEmbedConfig();
|
|
@@ -18376,11 +18632,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18376
18632
|
return { error };
|
|
18377
18633
|
}
|
|
18378
18634
|
const container = document.createElement('div');
|
|
18379
|
-
|
|
18380
|
-
container.className = this.viewConfig.containerClassName;
|
|
18381
|
-
}
|
|
18382
|
-
const embed = new ConversationMessage(container, {
|
|
18635
|
+
const embed = new ConversationMessage$1(container, {
|
|
18383
18636
|
...this.viewConfig,
|
|
18637
|
+
convId: data.convId,
|
|
18638
|
+
messageId: data.messageId,
|
|
18384
18639
|
sessionId: data.sessionId,
|
|
18385
18640
|
genNo: data.genNo,
|
|
18386
18641
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18389,7 +18644,31 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18389
18644
|
await embed.render();
|
|
18390
18645
|
return { container, viz: embed };
|
|
18391
18646
|
}
|
|
18392
|
-
|
|
18647
|
+
/**
|
|
18648
|
+
* Send a message to the conversation service and return only the data.
|
|
18649
|
+
* @param userMessage - The message to send to the conversation service.
|
|
18650
|
+
* @returns The data from the conversation service.
|
|
18651
|
+
*/
|
|
18652
|
+
async sendMessageData(userMessage) {
|
|
18653
|
+
try {
|
|
18654
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18655
|
+
if (error) {
|
|
18656
|
+
return { error };
|
|
18657
|
+
}
|
|
18658
|
+
return { data: {
|
|
18659
|
+
convId: data.convId,
|
|
18660
|
+
messageId: data.messageId,
|
|
18661
|
+
sessionId: data.sessionId,
|
|
18662
|
+
genNo: data.genNo,
|
|
18663
|
+
acSessionId: data.stateKey.transactionId,
|
|
18664
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18665
|
+
} };
|
|
18666
|
+
}
|
|
18667
|
+
catch (error) {
|
|
18668
|
+
return { error: error };
|
|
18669
|
+
}
|
|
18670
|
+
}
|
|
18671
|
+
}
|
|
18393
18672
|
|
|
18394
18673
|
/**
|
|
18395
18674
|
*
|
|
@@ -18764,55 +19043,34 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18764
19043
|
* ```
|
|
18765
19044
|
*/
|
|
18766
19045
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
19046
|
+
const ConversationMessage = componentFactory(ConversationMessage$1);
|
|
18767
19047
|
/**
|
|
18768
|
-
* React component for
|
|
18769
|
-
*
|
|
19048
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
19049
|
+
*
|
|
19050
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
19051
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
19052
|
+
*
|
|
18770
19053
|
* @example
|
|
18771
19054
|
* ```tsx
|
|
18772
|
-
*
|
|
18773
|
-
*
|
|
19055
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
19056
|
+
* const result = await sendMessage('show me sales by region');
|
|
18774
19057
|
*
|
|
18775
|
-
*
|
|
18776
|
-
*
|
|
18777
|
-
*
|
|
18778
|
-
* document.body.appendChild(container);
|
|
18779
|
-
* }
|
|
18780
|
-
* };
|
|
19058
|
+
* if (!result.error) {
|
|
19059
|
+
* // Simple usage - just pass the message data
|
|
19060
|
+
* <SpotterMessage message={result.message} />
|
|
18781
19061
|
*
|
|
18782
|
-
*
|
|
18783
|
-
*
|
|
18784
|
-
*
|
|
18785
|
-
*
|
|
18786
|
-
*
|
|
18787
|
-
* );
|
|
19062
|
+
* // With optional query for context
|
|
19063
|
+
* <SpotterMessage
|
|
19064
|
+
* message={result.message}
|
|
19065
|
+
* query={result.query}
|
|
19066
|
+
* />
|
|
18788
19067
|
* }
|
|
18789
19068
|
* ```
|
|
19069
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
18790
19070
|
*/
|
|
18791
|
-
const
|
|
18792
|
-
const {
|
|
18793
|
-
|
|
18794
|
-
useDeepCompareEffect(() => {
|
|
18795
|
-
if (serviceRef.current) {
|
|
18796
|
-
serviceRef.current = null;
|
|
18797
|
-
}
|
|
18798
|
-
const configProps = {
|
|
18799
|
-
...restProps,
|
|
18800
|
-
...(className ? { containerClassName: className } : {})
|
|
18801
|
-
};
|
|
18802
|
-
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18803
|
-
if (ref) {
|
|
18804
|
-
if (typeof ref === 'function') {
|
|
18805
|
-
ref(serviceRef.current);
|
|
18806
|
-
}
|
|
18807
|
-
else {
|
|
18808
|
-
ref.current = serviceRef.current;
|
|
18809
|
-
}
|
|
18810
|
-
}
|
|
18811
|
-
return () => {
|
|
18812
|
-
serviceRef.current = null;
|
|
18813
|
-
};
|
|
18814
|
-
}, [props]);
|
|
18815
|
-
return null;
|
|
19071
|
+
const SpotterMessage = React.forwardRef((props, ref) => {
|
|
19072
|
+
const { message, query: _, ...otherProps } = props;
|
|
19073
|
+
return (React.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
18816
19074
|
});
|
|
18817
19075
|
/**
|
|
18818
19076
|
* React component for PreRendered Conversation embed.
|
|
@@ -18872,6 +19130,62 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18872
19130
|
ref.current = authEE;
|
|
18873
19131
|
}, [config]);
|
|
18874
19132
|
return ref;
|
|
19133
|
+
}
|
|
19134
|
+
/**
|
|
19135
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
19136
|
+
*
|
|
19137
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
19138
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
19139
|
+
*
|
|
19140
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
19141
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
19142
|
+
* @example
|
|
19143
|
+
* ```tsx
|
|
19144
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
19145
|
+
*
|
|
19146
|
+
* const handleQuery = async () => {
|
|
19147
|
+
* const result = await sendMessage('show me sales by region');
|
|
19148
|
+
*
|
|
19149
|
+
* if (!result.error) {
|
|
19150
|
+
* // Display the message response
|
|
19151
|
+
* <SpotterMessage message={result.message} />
|
|
19152
|
+
* } else {
|
|
19153
|
+
* console.error('Error:', result.error);
|
|
19154
|
+
* }
|
|
19155
|
+
* };
|
|
19156
|
+
* ```
|
|
19157
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
19158
|
+
*/
|
|
19159
|
+
function useSpotterAgent(config) {
|
|
19160
|
+
const serviceRef = React.useRef(null);
|
|
19161
|
+
useDeepCompareEffect(() => {
|
|
19162
|
+
if (serviceRef.current) {
|
|
19163
|
+
serviceRef.current = null;
|
|
19164
|
+
}
|
|
19165
|
+
serviceRef.current = new SpotterAgentEmbed(config);
|
|
19166
|
+
return () => {
|
|
19167
|
+
serviceRef.current = null;
|
|
19168
|
+
};
|
|
19169
|
+
}, [config]);
|
|
19170
|
+
const sendMessage = React.useCallback(async (query) => {
|
|
19171
|
+
if (!serviceRef.current) {
|
|
19172
|
+
return { error: new Error(ERROR_MESSAGE.SPOTTER_AGENT_NOT_INITIALIZED) };
|
|
19173
|
+
}
|
|
19174
|
+
const result = await serviceRef.current.sendMessageData(query);
|
|
19175
|
+
if (result.error) {
|
|
19176
|
+
return { error: result.error };
|
|
19177
|
+
}
|
|
19178
|
+
return {
|
|
19179
|
+
query: query,
|
|
19180
|
+
message: {
|
|
19181
|
+
...result.data,
|
|
19182
|
+
worksheetId: config.worksheetId,
|
|
19183
|
+
},
|
|
19184
|
+
};
|
|
19185
|
+
}, [config.worksheetId]);
|
|
19186
|
+
return {
|
|
19187
|
+
sendMessage,
|
|
19188
|
+
};
|
|
18875
19189
|
}
|
|
18876
19190
|
|
|
18877
19191
|
const ALIAS = Symbol.for('yaml.alias');
|
|
@@ -26278,6 +26592,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26278
26592
|
|
|
26279
26593
|
exports.AppEmbed = AppEmbed;
|
|
26280
26594
|
exports.ConversationEmbed = ConversationEmbed;
|
|
26595
|
+
exports.ConversationMessage = ConversationMessage;
|
|
26281
26596
|
exports.LiveboardEmbed = LiveboardEmbed;
|
|
26282
26597
|
exports.PinboardEmbed = PinboardEmbed;
|
|
26283
26598
|
exports.PreRenderedAppEmbed = PreRenderedAppEmbed;
|
|
@@ -26290,10 +26605,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26290
26605
|
exports.SageEmbed = SageEmbed;
|
|
26291
26606
|
exports.SearchBarEmbed = SearchBarEmbed;
|
|
26292
26607
|
exports.SearchEmbed = SearchEmbed;
|
|
26293
|
-
exports.SpotterAgentEmbed = SpotterAgentEmbed;
|
|
26294
26608
|
exports.SpotterEmbed = SpotterEmbed;
|
|
26609
|
+
exports.SpotterMessage = SpotterMessage;
|
|
26295
26610
|
exports.getSessionInfo = getSessionInfo;
|
|
26296
26611
|
exports.useEmbedRef = useEmbedRef;
|
|
26297
26612
|
exports.useInit = useInit;
|
|
26613
|
+
exports.useSpotterAgent = useSpotterAgent;
|
|
26298
26614
|
|
|
26299
26615
|
}));
|