@thoughtspot/visual-embed-sdk 1.45.1 → 1.45.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/authToken.d.ts +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +2 -2
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +71 -0
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +48 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +37 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +37 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +24 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +127 -9
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +41 -18
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +96 -3
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -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 +40 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +40 -12
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +180 -8
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +23 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +64 -22
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +138 -19
- 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 +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/types.d.ts +356 -42
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +227 -20
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js +23 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +9 -1
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +73 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.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 +20 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +40 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +49 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-Dgzjq7qH.js → index-BuwECGdm.js} +1 -1
- package/dist/src/authToken.d.ts +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +48 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +37 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +127 -9
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +3 -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 +40 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +23 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +356 -42
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/dist/src/utils/graphql/answerService/answerService.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 +20 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +501 -98
- package/dist/tsembed-react.js +500 -97
- package/dist/tsembed.es.js +516 -113
- package/dist/tsembed.js +29956 -29553
- package/dist/visual-embed-sdk-react-full.d.ts +819 -282
- package/dist/visual-embed-sdk-react.d.ts +818 -281
- package/dist/visual-embed-sdk.d.ts +882 -321
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +2 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +72 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +48 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +37 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +39 -3
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +127 -9
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +42 -19
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +96 -3
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- 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 +40 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +41 -13
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +180 -8
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +23 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +64 -22
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +139 -20
- 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 +3 -3
- 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 +356 -42
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +226 -19
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.js +22 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +9 -1
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +73 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.js.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 +20 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +36 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +50 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/authToken.spec.ts +91 -2
- package/src/authToken.ts +2 -2
- package/src/css-variables.ts +60 -0
- package/src/embed/app.spec.ts +32 -0
- package/src/embed/app.ts +97 -1
- package/src/embed/conversation.spec.ts +117 -3
- package/src/embed/conversation.ts +188 -29
- package/src/embed/hostEventClient/contracts.ts +4 -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 +264 -10
- package/src/embed/liveboard.ts +105 -14
- package/src/embed/ts-embed.spec.ts +184 -8
- package/src/embed/ts-embed.ts +81 -24
- package/src/errors.ts +1 -0
- package/src/index.ts +7 -1
- package/src/types.ts +364 -40
- package/src/utils/graphql/answerService/answer-queries.ts +23 -0
- package/src/utils/graphql/answerService/answerService.spec.ts +87 -0
- package/src/utils/graphql/answerService/answerService.ts +13 -1
- package/src/utils/processTrigger.ts +6 -3
- package/src/utils.spec.ts +56 -0
- package/src/utils.ts +44 -0
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.45.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.45.3 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1845,6 +1845,54 @@ var EmbedEvent;
|
|
|
1845
1845
|
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
1846
1846
|
*/
|
|
1847
1847
|
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1848
|
+
/**
|
|
1849
|
+
* Emitted when a Spotter conversation is renamed.
|
|
1850
|
+
* @example
|
|
1851
|
+
* ```js
|
|
1852
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationRenamed, (payload) => {
|
|
1853
|
+
* console.log('Conversation renamed', payload);
|
|
1854
|
+
* // payload: { convId: string, oldTitle: string, newTitle: string }
|
|
1855
|
+
* })
|
|
1856
|
+
* ```
|
|
1857
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1858
|
+
*/
|
|
1859
|
+
EmbedEvent["SpotterConversationRenamed"] = "spotterConversationRenamed";
|
|
1860
|
+
/**
|
|
1861
|
+
* Emitted when a Spotter conversation is deleted.
|
|
1862
|
+
* @example
|
|
1863
|
+
* ```js
|
|
1864
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationDeleted, (payload) => {
|
|
1865
|
+
* console.log('Conversation deleted', payload);
|
|
1866
|
+
* // payload: { convId: string, title: string }
|
|
1867
|
+
* })
|
|
1868
|
+
* ```
|
|
1869
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1870
|
+
*/
|
|
1871
|
+
EmbedEvent["SpotterConversationDeleted"] = "spotterConversationDeleted";
|
|
1872
|
+
/**
|
|
1873
|
+
* Emitted when a Spotter conversation is selected/clicked.
|
|
1874
|
+
* @example
|
|
1875
|
+
* ```js
|
|
1876
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationSelected, (payload) => {
|
|
1877
|
+
* console.log('Conversation selected', payload);
|
|
1878
|
+
* // payload: { convId: string, title: string, worksheetId: string }
|
|
1879
|
+
* })
|
|
1880
|
+
* ```
|
|
1881
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
1882
|
+
*/
|
|
1883
|
+
EmbedEvent["SpotterConversationSelected"] = "spotterConversationSelected";
|
|
1884
|
+
/**
|
|
1885
|
+
* @hidden
|
|
1886
|
+
* Emitted when the auth token is about to get expired and needs to be refreshed.
|
|
1887
|
+
* @example
|
|
1888
|
+
* ```js
|
|
1889
|
+
* embed.on(EmbedEvent.RefreshAuthToken, (payload) => {
|
|
1890
|
+
* console.log('payload', payload);
|
|
1891
|
+
* })
|
|
1892
|
+
* ```
|
|
1893
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
1894
|
+
*/
|
|
1895
|
+
EmbedEvent["RefreshAuthToken"] = "RefreshAuthToken";
|
|
1848
1896
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1849
1897
|
/**
|
|
1850
1898
|
* Event types that can be triggered by the host application
|
|
@@ -3228,6 +3276,17 @@ var HostEvent;
|
|
|
3228
3276
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3229
3277
|
*/
|
|
3230
3278
|
HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
|
|
3279
|
+
/**
|
|
3280
|
+
* @hidden
|
|
3281
|
+
* Get the current context of the embedded page.
|
|
3282
|
+
*
|
|
3283
|
+
* @example
|
|
3284
|
+
* ```js
|
|
3285
|
+
* const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
3286
|
+
* ```
|
|
3287
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
3288
|
+
*/
|
|
3289
|
+
HostEvent["GetPageContext"] = "GetPageContext";
|
|
3231
3290
|
})(HostEvent || (HostEvent = {}));
|
|
3232
3291
|
/**
|
|
3233
3292
|
* The different visual modes that the data sources panel within
|
|
@@ -3384,7 +3443,19 @@ var Param;
|
|
|
3384
3443
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3385
3444
|
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3386
3445
|
Param["UpdatedSpotterChatPrompt"] = "updatedSpotterChatPrompt";
|
|
3446
|
+
Param["SpotterSidebarTitle"] = "spotterSidebarTitle";
|
|
3447
|
+
Param["SpotterSidebarDefaultExpanded"] = "spotterSidebarDefaultExpanded";
|
|
3448
|
+
Param["SpotterChatRenameLabel"] = "spotterChatRenameLabel";
|
|
3449
|
+
Param["SpotterChatDeleteLabel"] = "spotterChatDeleteLabel";
|
|
3450
|
+
Param["SpotterDeleteConversationModalTitle"] = "spotterDeleteConversationModalTitle";
|
|
3451
|
+
Param["SpotterPastConversationAlertMessage"] = "spotterPastConversationAlertMessage";
|
|
3452
|
+
Param["SpotterDocumentationUrl"] = "spotterDocumentationUrl";
|
|
3453
|
+
Param["SpotterBestPracticesLabel"] = "spotterBestPracticesLabel";
|
|
3454
|
+
Param["SpotterConversationsBatchSize"] = "spotterConversationsBatchSize";
|
|
3455
|
+
Param["SpotterNewChatButtonTitle"] = "spotterNewChatButtonTitle";
|
|
3387
3456
|
Param["IsThisPeriodInDateFiltersEnabled"] = "isThisPeriodInDateFiltersEnabled";
|
|
3457
|
+
Param["HideToolResponseCardBranding"] = "hideToolResponseCardBranding";
|
|
3458
|
+
Param["ToolResponseCardBrandingLabel"] = "toolResponseCardBrandingLabel";
|
|
3388
3459
|
})(Param || (Param = {}));
|
|
3389
3460
|
/**
|
|
3390
3461
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4810,6 +4881,96 @@ var Action;
|
|
|
4810
4881
|
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4811
4882
|
*/
|
|
4812
4883
|
Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
|
|
4884
|
+
/**
|
|
4885
|
+
* Controls visibility of the sidebar header (title and toggle button)
|
|
4886
|
+
* in the Spotter past conversations sidebar.
|
|
4887
|
+
* @example
|
|
4888
|
+
* ```js
|
|
4889
|
+
* hiddenActions: [Action.SpotterSidebarHeader]
|
|
4890
|
+
* ```
|
|
4891
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4892
|
+
*/
|
|
4893
|
+
Action["SpotterSidebarHeader"] = "spotterSidebarHeader";
|
|
4894
|
+
/**
|
|
4895
|
+
* Controls visibility of the sidebar footer (documentation link)
|
|
4896
|
+
* in the Spotter past conversations sidebar.
|
|
4897
|
+
* @example
|
|
4898
|
+
* ```js
|
|
4899
|
+
* hiddenActions: [Action.SpotterSidebarFooter]
|
|
4900
|
+
* ```
|
|
4901
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4902
|
+
*/
|
|
4903
|
+
Action["SpotterSidebarFooter"] = "spotterSidebarFooter";
|
|
4904
|
+
/**
|
|
4905
|
+
* Controls visibility and disable state of the sidebar toggle/expand button
|
|
4906
|
+
* in the Spotter past conversations sidebar.
|
|
4907
|
+
* @example
|
|
4908
|
+
* ```js
|
|
4909
|
+
* disabledActions: [Action.SpotterSidebarToggle]
|
|
4910
|
+
* ```
|
|
4911
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4912
|
+
*/
|
|
4913
|
+
Action["SpotterSidebarToggle"] = "spotterSidebarToggle";
|
|
4914
|
+
/**
|
|
4915
|
+
* Controls visibility and disable state of the "New Chat" button
|
|
4916
|
+
* in the Spotter past conversations sidebar.
|
|
4917
|
+
* @example
|
|
4918
|
+
* ```js
|
|
4919
|
+
* disabledActions: [Action.SpotterNewChat]
|
|
4920
|
+
* ```
|
|
4921
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4922
|
+
*/
|
|
4923
|
+
Action["SpotterNewChat"] = "spotterNewChat";
|
|
4924
|
+
/**
|
|
4925
|
+
* Controls visibility of the past conversation banner alert
|
|
4926
|
+
* in the Spotter interface.
|
|
4927
|
+
* @example
|
|
4928
|
+
* ```js
|
|
4929
|
+
* hiddenActions: [Action.SpotterPastChatBanner]
|
|
4930
|
+
* ```
|
|
4931
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4932
|
+
*/
|
|
4933
|
+
Action["SpotterPastChatBanner"] = "spotterPastChatBanner";
|
|
4934
|
+
/**
|
|
4935
|
+
* Controls visibility and disable state of the conversation edit menu
|
|
4936
|
+
* (three-dot menu) in the Spotter past conversations sidebar.
|
|
4937
|
+
* @example
|
|
4938
|
+
* ```js
|
|
4939
|
+
* disabledActions: [Action.SpotterChatMenu]
|
|
4940
|
+
* ```
|
|
4941
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4942
|
+
*/
|
|
4943
|
+
Action["SpotterChatMenu"] = "spotterChatMenu";
|
|
4944
|
+
/**
|
|
4945
|
+
* Controls visibility and disable state of the rename action
|
|
4946
|
+
* in the Spotter conversation edit menu.
|
|
4947
|
+
* @example
|
|
4948
|
+
* ```js
|
|
4949
|
+
* disabledActions: [Action.SpotterChatRename]
|
|
4950
|
+
* ```
|
|
4951
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4952
|
+
*/
|
|
4953
|
+
Action["SpotterChatRename"] = "spotterChatRename";
|
|
4954
|
+
/**
|
|
4955
|
+
* Controls visibility and disable state of the delete action
|
|
4956
|
+
* in the Spotter conversation edit menu.
|
|
4957
|
+
* @example
|
|
4958
|
+
* ```js
|
|
4959
|
+
* disabledActions: [Action.SpotterChatDelete]
|
|
4960
|
+
* ```
|
|
4961
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4962
|
+
*/
|
|
4963
|
+
Action["SpotterChatDelete"] = "spotterChatDelete";
|
|
4964
|
+
/**
|
|
4965
|
+
* Controls visibility and disable state of the documentation/best practices
|
|
4966
|
+
* link in the Spotter sidebar footer.
|
|
4967
|
+
* @example
|
|
4968
|
+
* ```js
|
|
4969
|
+
* disabledActions: [Action.SpotterDocs]
|
|
4970
|
+
* ```
|
|
4971
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4972
|
+
*/
|
|
4973
|
+
Action["SpotterDocs"] = "spotterDocs";
|
|
4813
4974
|
/**
|
|
4814
4975
|
* The **Include current period** checkbox for date filters.
|
|
4815
4976
|
* Controls the visibility and availability of the option to include
|
|
@@ -4948,13 +5109,30 @@ var LogLevel;
|
|
|
4948
5109
|
* Error types emitted by embedded components.
|
|
4949
5110
|
*
|
|
4950
5111
|
* These enum values categorize different types of errors that can occur during
|
|
4951
|
-
* the lifecycle of an embedded ThoughtSpot component.
|
|
4952
|
-
*
|
|
4953
|
-
*
|
|
4954
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
4955
|
-
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
5112
|
+
* the lifecycle of an embedded ThoughtSpot component.
|
|
5113
|
+
* Use {@link EmbedErrorDetailsEvent} and {@link EmbedErrorCodes} to handle specific errors.
|
|
4956
5114
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4957
5115
|
* @group Error Handling
|
|
5116
|
+
*
|
|
5117
|
+
* @example
|
|
5118
|
+
* Handle specific error types
|
|
5119
|
+
* ```js
|
|
5120
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
5121
|
+
* switch (error.errorType) {
|
|
5122
|
+
* case ErrorDetailsTypes.API:
|
|
5123
|
+
* console.error('API error:', error.message);
|
|
5124
|
+
* break;
|
|
5125
|
+
* case ErrorDetailsTypes.VALIDATION_ERROR:
|
|
5126
|
+
* console.error('Validation error:', error.message);
|
|
5127
|
+
* break;
|
|
5128
|
+
* case ErrorDetailsTypes.NETWORK:
|
|
5129
|
+
* console.error('Network error:', error.message);
|
|
5130
|
+
* break;
|
|
5131
|
+
* default:
|
|
5132
|
+
* console.error('Unknown error:', error);
|
|
5133
|
+
* }
|
|
5134
|
+
* });
|
|
5135
|
+
* ```
|
|
4958
5136
|
*/
|
|
4959
5137
|
var ErrorDetailsTypes;
|
|
4960
5138
|
(function (ErrorDetailsTypes) {
|
|
@@ -4966,35 +5144,43 @@ var ErrorDetailsTypes;
|
|
|
4966
5144
|
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
4967
5145
|
})(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
|
|
4968
5146
|
/**
|
|
4969
|
-
* Error codes for identifying specific issues in embedded ThoughtSpot components.
|
|
4970
|
-
*
|
|
4971
|
-
* Use these codes for precise error handling and debugging. Each code maps to a
|
|
4972
|
-
* distinct failure scenario, enabling targeted recovery strategies.
|
|
5147
|
+
* Error codes for identifying specific issues in embedded ThoughtSpot components. Use {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error handling and debugging.
|
|
4973
5148
|
*
|
|
4974
5149
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4975
5150
|
* @group Error Handling
|
|
4976
|
-
|
|
4977
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
4978
|
-
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
4979
|
-
*
|
|
5151
|
+
|
|
4980
5152
|
* @example
|
|
4981
5153
|
* Handle specific error codes in the error event handler
|
|
4982
|
-
*
|
|
5154
|
+
* ```js
|
|
4983
5155
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
4984
|
-
*
|
|
4985
|
-
*
|
|
5156
|
+
* switch (error.code) {
|
|
5157
|
+
* case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
|
|
5158
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
5159
|
+
* break;
|
|
5160
|
+
* case EmbedErrorCodes.LIVEBOARD_ID_MISSING:
|
|
5161
|
+
* console.error('Liveboard ID is missing:', error.message);
|
|
5162
|
+
* break;
|
|
5163
|
+
* case EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG:
|
|
5164
|
+
* console.error('Conflicting actions configuration:', error.message);
|
|
5165
|
+
* break;
|
|
5166
|
+
* case EmbedErrorCodes.CONFLICTING_TABS_CONFIG:
|
|
5167
|
+
* console.error('Conflicting tabs configuration:', error.message);
|
|
5168
|
+
* break;
|
|
5169
|
+
* default:
|
|
5170
|
+
* console.error('Unknown error:', error);
|
|
4986
5171
|
* }
|
|
4987
5172
|
* });
|
|
4988
|
-
*
|
|
5173
|
+
* ```
|
|
5174
|
+
* */
|
|
4989
5175
|
var EmbedErrorCodes;
|
|
4990
5176
|
(function (EmbedErrorCodes) {
|
|
4991
5177
|
/** Worksheet ID not found or does not exist */
|
|
4992
5178
|
EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
|
|
4993
5179
|
/** Required Liveboard ID is missing from configuration */
|
|
4994
5180
|
EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
|
|
4995
|
-
/** Conflicting action configuration detected
|
|
5181
|
+
/** Conflicting action configuration detected */
|
|
4996
5182
|
EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
|
|
4997
|
-
/** Conflicting tab configuration detected
|
|
5183
|
+
/** Conflicting tab configuration detected */
|
|
4998
5184
|
EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
|
|
4999
5185
|
/** Error during component initialization */
|
|
5000
5186
|
EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
|
|
@@ -5012,7 +5198,28 @@ var EmbedErrorCodes;
|
|
|
5012
5198
|
EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
|
|
5013
5199
|
/** Failed to update embed parameters during pre-render */
|
|
5014
5200
|
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
5201
|
+
/** Invalid URL provided in configuration */
|
|
5202
|
+
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
5015
5203
|
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
5204
|
+
var ContextType;
|
|
5205
|
+
(function (ContextType) {
|
|
5206
|
+
/**
|
|
5207
|
+
* Search answer context for search page or edit viz dialog on liveboard page.
|
|
5208
|
+
*/
|
|
5209
|
+
ContextType["Search"] = "search-answer";
|
|
5210
|
+
/**
|
|
5211
|
+
* Liveboard context for liveboard page.
|
|
5212
|
+
*/
|
|
5213
|
+
ContextType["Liveboard"] = "liveboard";
|
|
5214
|
+
/**
|
|
5215
|
+
* Answer context for explore modal/page on liveboard page.
|
|
5216
|
+
*/
|
|
5217
|
+
ContextType["Answer"] = "answer";
|
|
5218
|
+
/**
|
|
5219
|
+
* Spotter context for spotter modal/page.
|
|
5220
|
+
*/
|
|
5221
|
+
ContextType["Spotter"] = "spotter";
|
|
5222
|
+
})(ContextType || (ContextType = {}));
|
|
5016
5223
|
/**
|
|
5017
5224
|
* Enum for the type of API intercepted
|
|
5018
5225
|
*/
|
|
@@ -5133,6 +5340,7 @@ const ERROR_MESSAGE = {
|
|
|
5133
5340
|
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
5134
5341
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
5135
5342
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
5343
|
+
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
5136
5344
|
};
|
|
5137
5345
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
5138
5346
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -5599,6 +5807,12 @@ const formatTemplate = (template, values) => {
|
|
|
5599
5807
|
return values[key] !== undefined ? String(values[key]) : match;
|
|
5600
5808
|
});
|
|
5601
5809
|
};
|
|
5810
|
+
const getHostEventsConfig = (viewConfig) => {
|
|
5811
|
+
return {
|
|
5812
|
+
shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
|
|
5813
|
+
useHostEventsV2: viewConfig.useHostEventsV2,
|
|
5814
|
+
};
|
|
5815
|
+
};
|
|
5602
5816
|
/**
|
|
5603
5817
|
* Check if the window is undefined
|
|
5604
5818
|
* If the window is undefined, it means the code is running in a SSR environment.
|
|
@@ -5611,6 +5825,36 @@ const isWindowUndefined = () => {
|
|
|
5611
5825
|
return true;
|
|
5612
5826
|
}
|
|
5613
5827
|
return false;
|
|
5828
|
+
};
|
|
5829
|
+
/**
|
|
5830
|
+
* Validates that a URL uses only http: or https: protocols.
|
|
5831
|
+
* Returns a tuple of [isValid, error] so the caller can handle validation errors.
|
|
5832
|
+
* @param url - The URL string to validate
|
|
5833
|
+
* @returns [true, null] if valid, [false, Error] if invalid
|
|
5834
|
+
*/
|
|
5835
|
+
const validateHttpUrl = (url) => {
|
|
5836
|
+
try {
|
|
5837
|
+
const parsedUrl = new URL(url);
|
|
5838
|
+
if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|
5839
|
+
return [false, new Error(`Invalid protocol: ${parsedUrl.protocol}. Only http: and https: are allowed.`)];
|
|
5840
|
+
}
|
|
5841
|
+
return [true, null];
|
|
5842
|
+
}
|
|
5843
|
+
catch (error) {
|
|
5844
|
+
return [false, error instanceof Error ? error : new Error(String(error))];
|
|
5845
|
+
}
|
|
5846
|
+
};
|
|
5847
|
+
/**
|
|
5848
|
+
* Sets a query parameter if the value is defined.
|
|
5849
|
+
* @param queryParams - The query params object to modify
|
|
5850
|
+
* @param param - The parameter key
|
|
5851
|
+
* @param value - The value to set
|
|
5852
|
+
* @param asBoolean - If true, coerces value to boolean
|
|
5853
|
+
*/
|
|
5854
|
+
const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
|
|
5855
|
+
if (value !== undefined) {
|
|
5856
|
+
queryParams[param] = asBoolean ? !!value : value;
|
|
5857
|
+
}
|
|
5614
5858
|
};
|
|
5615
5859
|
|
|
5616
5860
|
/**
|
|
@@ -8022,11 +8266,11 @@ const storeAuthTokenInCache = (token) => {
|
|
|
8022
8266
|
*
|
|
8023
8267
|
* @param embedConfig
|
|
8024
8268
|
*/
|
|
8025
|
-
async function getAuthenticationToken(embedConfig) {
|
|
8269
|
+
async function getAuthenticationToken(embedConfig, skipvalidation = false) {
|
|
8026
8270
|
const cachedAuthToken = getCacheAuthToken();
|
|
8027
8271
|
// Since we don't have token validation enabled , we cannot tell if the
|
|
8028
8272
|
// cached token is valid or not. So we will always fetch a new token.
|
|
8029
|
-
if (cachedAuthToken && !embedConfig.disableTokenVerification) {
|
|
8273
|
+
if (cachedAuthToken && !embedConfig.disableTokenVerification && !skipvalidation) {
|
|
8030
8274
|
let isCachedTokenStillValid;
|
|
8031
8275
|
try {
|
|
8032
8276
|
isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
@@ -8471,6 +8715,28 @@ const getSQLQuery = `
|
|
|
8471
8715
|
}
|
|
8472
8716
|
}
|
|
8473
8717
|
`;
|
|
8718
|
+
const updateDisplayMode = `
|
|
8719
|
+
mutation UpdateDisplayMode(
|
|
8720
|
+
$session: BachSessionIdInput!
|
|
8721
|
+
$displayMode: DisplayMode
|
|
8722
|
+
) {
|
|
8723
|
+
Answer__updateProperties(session: $session, displayMode: $displayMode) {
|
|
8724
|
+
id {
|
|
8725
|
+
sessionId
|
|
8726
|
+
genNo
|
|
8727
|
+
acSession {
|
|
8728
|
+
sessionId
|
|
8729
|
+
genNo
|
|
8730
|
+
}
|
|
8731
|
+
}
|
|
8732
|
+
answer {
|
|
8733
|
+
id
|
|
8734
|
+
displayMode
|
|
8735
|
+
suggestedDisplayMode
|
|
8736
|
+
}
|
|
8737
|
+
}
|
|
8738
|
+
}
|
|
8739
|
+
`;
|
|
8474
8740
|
const getAnswerTML = `
|
|
8475
8741
|
mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
|
|
8476
8742
|
UnsavedAnswer_getTML(
|
|
@@ -8638,7 +8904,15 @@ class AnswerService {
|
|
|
8638
8904
|
},
|
|
8639
8905
|
});
|
|
8640
8906
|
}
|
|
8641
|
-
async
|
|
8907
|
+
async updateDisplayMode(displayMode = "TABLE_MODE") {
|
|
8908
|
+
return this.executeQuery(updateDisplayMode, {
|
|
8909
|
+
displayMode,
|
|
8910
|
+
});
|
|
8911
|
+
}
|
|
8912
|
+
async getSQLQuery(fetchSQLWithAllColumns = false) {
|
|
8913
|
+
if (fetchSQLWithAllColumns) {
|
|
8914
|
+
await this.updateDisplayMode("TABLE_MODE");
|
|
8915
|
+
}
|
|
8642
8916
|
const { sql } = await this.executeQuery(getSQLQuery, {});
|
|
8643
8917
|
return sql;
|
|
8644
8918
|
}
|
|
@@ -8794,7 +9068,7 @@ class AnswerService {
|
|
|
8794
9068
|
async getTML() {
|
|
8795
9069
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8796
9070
|
const edoc = object[0].edoc;
|
|
8797
|
-
const YAML = await import('./index-
|
|
9071
|
+
const YAML = await import('./index-BuwECGdm.js');
|
|
8798
9072
|
const parsedDoc = YAML.parse(edoc);
|
|
8799
9073
|
return {
|
|
8800
9074
|
answer: {
|
|
@@ -17656,6 +17930,7 @@ const reload = (iFrame) => {
|
|
|
17656
17930
|
* @param message
|
|
17657
17931
|
* @param message.type
|
|
17658
17932
|
* @param message.data
|
|
17933
|
+
* @param message.context
|
|
17659
17934
|
* @param thoughtSpotHost
|
|
17660
17935
|
* @param channel
|
|
17661
17936
|
*/
|
|
@@ -17670,8 +17945,9 @@ const TRIGGER_TIMEOUT = 30000;
|
|
|
17670
17945
|
* @param messageType
|
|
17671
17946
|
* @param thoughtSpotHost
|
|
17672
17947
|
* @param data
|
|
17948
|
+
* @param context
|
|
17673
17949
|
*/
|
|
17674
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17950
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
17675
17951
|
return new Promise((res, rej) => {
|
|
17676
17952
|
var _a;
|
|
17677
17953
|
if (messageType === HostEvent.Reload) {
|
|
@@ -17705,7 +17981,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
17705
17981
|
channel.port1.close();
|
|
17706
17982
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17707
17983
|
}, TRIGGER_TIMEOUT);
|
|
17708
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17984
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
17709
17985
|
});
|
|
17710
17986
|
}
|
|
17711
17987
|
|
|
@@ -18051,7 +18327,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
18051
18327
|
return eventData;
|
|
18052
18328
|
}
|
|
18053
18329
|
|
|
18054
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.
|
|
18330
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.45.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={".":{"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.23","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,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};
|
|
18055
18331
|
|
|
18056
18332
|
class HostEventClient {
|
|
18057
18333
|
constructor(iFrame) {
|
|
@@ -18063,16 +18339,16 @@ class HostEventClient {
|
|
|
18063
18339
|
* @param {any} data Data to send with the host event
|
|
18064
18340
|
* @returns {Promise<any>} - the response from the process trigger
|
|
18065
18341
|
*/
|
|
18066
|
-
async processTrigger(message, data) {
|
|
18342
|
+
async processTrigger(message, data, context) {
|
|
18067
18343
|
if (!this.iFrame) {
|
|
18068
18344
|
throw new Error('Iframe element is not set');
|
|
18069
18345
|
}
|
|
18070
18346
|
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
18071
|
-
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
18347
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
|
|
18072
18348
|
}
|
|
18073
|
-
async handleHostEventWithParam(apiName, parameters) {
|
|
18349
|
+
async handleHostEventWithParam(apiName, parameters, context) {
|
|
18074
18350
|
var _a, _b, _c, _d;
|
|
18075
|
-
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];
|
|
18351
|
+
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];
|
|
18076
18352
|
if (!response) {
|
|
18077
18353
|
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
18078
18354
|
// eslint-disable-next-line no-throw-literal
|
|
@@ -18087,8 +18363,8 @@ class HostEventClient {
|
|
|
18087
18363
|
}
|
|
18088
18364
|
return { ...response.value };
|
|
18089
18365
|
}
|
|
18090
|
-
async hostEventFallback(hostEvent, data) {
|
|
18091
|
-
return this.processTrigger(hostEvent, data);
|
|
18366
|
+
async hostEventFallback(hostEvent, data, context) {
|
|
18367
|
+
return this.processTrigger(hostEvent, data, context);
|
|
18092
18368
|
}
|
|
18093
18369
|
/**
|
|
18094
18370
|
* Setter for the iframe element used for host events
|
|
@@ -18097,49 +18373,49 @@ class HostEventClient {
|
|
|
18097
18373
|
setIframeElement(iFrame) {
|
|
18098
18374
|
this.iFrame = iFrame;
|
|
18099
18375
|
}
|
|
18100
|
-
async triggerUIPassthroughApi(apiName, parameters) {
|
|
18376
|
+
async triggerUIPassthroughApi(apiName, parameters, context) {
|
|
18101
18377
|
const res = await this.processTrigger(HostEvent.UIPassthrough, {
|
|
18102
18378
|
type: apiName,
|
|
18103
18379
|
parameters,
|
|
18104
|
-
});
|
|
18380
|
+
}, context);
|
|
18105
18381
|
return res;
|
|
18106
18382
|
}
|
|
18107
|
-
async handlePinEvent(payload) {
|
|
18383
|
+
async handlePinEvent(payload, context) {
|
|
18108
18384
|
var _a, _b;
|
|
18109
18385
|
if (!payload || !('newVizName' in payload)) {
|
|
18110
|
-
return this.hostEventFallback(HostEvent.Pin, payload);
|
|
18386
|
+
return this.hostEventFallback(HostEvent.Pin, payload, context);
|
|
18111
18387
|
}
|
|
18112
18388
|
const formattedPayload = {
|
|
18113
18389
|
...payload,
|
|
18114
18390
|
pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
|
|
18115
18391
|
newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
|
|
18116
18392
|
};
|
|
18117
|
-
const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
|
|
18393
|
+
const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
|
|
18118
18394
|
return {
|
|
18119
18395
|
...data,
|
|
18120
18396
|
liveboardId: data.pinboardId,
|
|
18121
18397
|
};
|
|
18122
18398
|
}
|
|
18123
|
-
async handleSaveAnswerEvent(payload) {
|
|
18399
|
+
async handleSaveAnswerEvent(payload, context) {
|
|
18124
18400
|
var _a, _b, _c, _d;
|
|
18125
18401
|
if (!payload || !('name' in payload) || !('description' in payload)) {
|
|
18126
18402
|
// Save is the fallback for SaveAnswer
|
|
18127
|
-
return this.hostEventFallback(HostEvent.Save, payload);
|
|
18403
|
+
return this.hostEventFallback(HostEvent.Save, payload, context);
|
|
18128
18404
|
}
|
|
18129
|
-
const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
|
|
18405
|
+
const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
|
|
18130
18406
|
return {
|
|
18131
18407
|
...data,
|
|
18132
18408
|
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,
|
|
18133
18409
|
};
|
|
18134
18410
|
}
|
|
18135
|
-
async triggerHostEvent(hostEvent, payload) {
|
|
18411
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
18136
18412
|
switch (hostEvent) {
|
|
18137
18413
|
case HostEvent.Pin:
|
|
18138
|
-
return this.handlePinEvent(payload);
|
|
18414
|
+
return this.handlePinEvent(payload, context);
|
|
18139
18415
|
case HostEvent.SaveAnswer:
|
|
18140
|
-
return this.handleSaveAnswerEvent(payload);
|
|
18416
|
+
return this.handleSaveAnswerEvent(payload, context);
|
|
18141
18417
|
default:
|
|
18142
|
-
return this.hostEventFallback(hostEvent, payload);
|
|
18418
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
18143
18419
|
}
|
|
18144
18420
|
}
|
|
18145
18421
|
}
|
|
@@ -18400,31 +18676,39 @@ class TsEmbed {
|
|
|
18400
18676
|
logger$3.error(`AppInit failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
18401
18677
|
}
|
|
18402
18678
|
};
|
|
18679
|
+
this.handleAuthFailure = (error) => {
|
|
18680
|
+
logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${error === null || error === void 0 ? void 0 : error.message}`);
|
|
18681
|
+
processAuthFailure(error, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
18682
|
+
};
|
|
18683
|
+
/**
|
|
18684
|
+
* Refresh the auth token if the autoLogin is true and the authType is TrustedAuthTokenCookieless
|
|
18685
|
+
* @param _
|
|
18686
|
+
* @param responder
|
|
18687
|
+
*/
|
|
18688
|
+
this.tokenRefresh = async (_, responder) => {
|
|
18689
|
+
try {
|
|
18690
|
+
await this.refreshAuthTokenForCookieless(responder, EmbedEvent.RefreshAuthToken, true);
|
|
18691
|
+
}
|
|
18692
|
+
catch (e) {
|
|
18693
|
+
this.handleAuthFailure(e);
|
|
18694
|
+
}
|
|
18695
|
+
};
|
|
18403
18696
|
/**
|
|
18404
18697
|
* Sends updated auth token to the iFrame to avoid user logout
|
|
18405
18698
|
* @param _
|
|
18406
18699
|
* @param responder
|
|
18407
18700
|
*/
|
|
18408
18701
|
this.updateAuthToken = async (_, responder) => {
|
|
18409
|
-
const { authType } = this.embedConfig;
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18413
|
-
|
|
18414
|
-
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
responder({
|
|
18418
|
-
type: EmbedEvent.AuthExpire,
|
|
18419
|
-
data: { authToken },
|
|
18420
|
-
});
|
|
18421
|
-
}
|
|
18422
|
-
catch (e) {
|
|
18423
|
-
logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
18424
|
-
processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
18425
|
-
}
|
|
18702
|
+
const { authType, autoLogin: autoLoginConfig } = this.embedConfig;
|
|
18703
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
18704
|
+
const autoLogin = autoLoginConfig !== null && autoLoginConfig !== void 0 ? autoLoginConfig : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
18705
|
+
try {
|
|
18706
|
+
await this.refreshAuthTokenForCookieless(responder, EmbedEvent.AuthExpire, false);
|
|
18707
|
+
}
|
|
18708
|
+
catch (e) {
|
|
18709
|
+
this.handleAuthFailure(e);
|
|
18426
18710
|
}
|
|
18427
|
-
|
|
18711
|
+
if (autoLogin && authType !== AuthType.TrustedAuthTokenCookieless) {
|
|
18428
18712
|
handleAuth();
|
|
18429
18713
|
}
|
|
18430
18714
|
notifyAuthFailure(AuthFailureType.EXPIRY);
|
|
@@ -18445,8 +18729,7 @@ class TsEmbed {
|
|
|
18445
18729
|
});
|
|
18446
18730
|
}
|
|
18447
18731
|
catch (e) {
|
|
18448
|
-
|
|
18449
|
-
processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
18732
|
+
this.handleAuthFailure(e);
|
|
18450
18733
|
}
|
|
18451
18734
|
}).catch((e) => {
|
|
18452
18735
|
logger$3.error(`Auto Login failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
@@ -18464,6 +18747,7 @@ class TsEmbed {
|
|
|
18464
18747
|
this.on(EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
|
|
18465
18748
|
const authInitHandler = this.createEmbedContainerHandler(EmbedEvent.AuthInit);
|
|
18466
18749
|
this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
18750
|
+
this.on(EmbedEvent.RefreshAuthToken, this.tokenRefresh, { start: false }, true);
|
|
18467
18751
|
};
|
|
18468
18752
|
this.showPreRenderByDefault = false;
|
|
18469
18753
|
/**
|
|
@@ -18773,13 +19057,33 @@ class TsEmbed {
|
|
|
18773
19057
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18774
19058
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18775
19059
|
customActions: customActionsResult.actions,
|
|
19060
|
+
embedExpiryInAuthToken: this.viewConfig.refreshAuthTokenOnNearExpiry,
|
|
18776
19061
|
...getInterceptInitData(this.viewConfig),
|
|
19062
|
+
...getHostEventsConfig(this.viewConfig),
|
|
18777
19063
|
};
|
|
18778
19064
|
return baseInitData;
|
|
18779
19065
|
}
|
|
18780
19066
|
async getAppInitData() {
|
|
18781
19067
|
return this.getDefaultAppInitData();
|
|
18782
19068
|
}
|
|
19069
|
+
/**
|
|
19070
|
+
* Helper method to refresh/update auth token for TrustedAuthTokenCookieless auth type
|
|
19071
|
+
* @param responder - Function to send response back
|
|
19072
|
+
* @param eventType - The embed event type to send
|
|
19073
|
+
* @param forceRefresh - Whether to force refresh the token
|
|
19074
|
+
* @returns Promise that resolves if token was refreshed, rejects otherwise
|
|
19075
|
+
*/
|
|
19076
|
+
async refreshAuthTokenForCookieless(responder, eventType, forceRefresh = false) {
|
|
19077
|
+
const { authType, autoLogin } = this.embedConfig;
|
|
19078
|
+
const isAutoLoginTrue = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
19079
|
+
if (isAutoLoginTrue && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
19080
|
+
const authToken = await getAuthenticationToken(this.embedConfig, forceRefresh);
|
|
19081
|
+
responder({
|
|
19082
|
+
type: eventType,
|
|
19083
|
+
data: { authToken },
|
|
19084
|
+
});
|
|
19085
|
+
}
|
|
19086
|
+
}
|
|
18783
19087
|
/**
|
|
18784
19088
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
18785
19089
|
* @param query
|
|
@@ -19398,7 +19702,7 @@ class TsEmbed {
|
|
|
19398
19702
|
* @param {any} data The payload to send with the message
|
|
19399
19703
|
* @returns A promise that resolves with the response from the embedded app
|
|
19400
19704
|
*/
|
|
19401
|
-
async trigger(messageType, data = {}) {
|
|
19705
|
+
async trigger(messageType, data = {}, context) {
|
|
19402
19706
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
19403
19707
|
if (!this.isRendered) {
|
|
19404
19708
|
this.handleError({
|
|
@@ -19425,7 +19729,7 @@ class TsEmbed {
|
|
|
19425
19729
|
return null;
|
|
19426
19730
|
}
|
|
19427
19731
|
// send an empty object, this is needed for liveboard default handlers
|
|
19428
|
-
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
19732
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context);
|
|
19429
19733
|
}
|
|
19430
19734
|
/**
|
|
19431
19735
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19458,6 +19762,19 @@ class TsEmbed {
|
|
|
19458
19762
|
handleRenderForPrerender() {
|
|
19459
19763
|
return this.render();
|
|
19460
19764
|
}
|
|
19765
|
+
/**
|
|
19766
|
+
* Get the current context of the embedded TS component.
|
|
19767
|
+
* @returns The current context object containing the page type and object ids.
|
|
19768
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19769
|
+
*/
|
|
19770
|
+
async getCurrentContext() {
|
|
19771
|
+
return new Promise((resolve) => {
|
|
19772
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
19773
|
+
const context = await this.trigger(HostEvent.GetPageContext, {});
|
|
19774
|
+
resolve(context);
|
|
19775
|
+
});
|
|
19776
|
+
});
|
|
19777
|
+
}
|
|
19461
19778
|
/**
|
|
19462
19779
|
* Creates the preRender shell
|
|
19463
19780
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
@@ -20316,7 +20633,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20316
20633
|
* embedded Liveboard or visualization.
|
|
20317
20634
|
*/
|
|
20318
20635
|
getEmbedParams() {
|
|
20319
|
-
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20636
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20320
20637
|
let params = {};
|
|
20321
20638
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
20322
20639
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -20340,6 +20657,41 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
20340
20657
|
if (!isUndefined$1(updatedSpotterChatPrompt)) {
|
|
20341
20658
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
20342
20659
|
}
|
|
20660
|
+
// Handle spotterSidebarConfig params
|
|
20661
|
+
if (spotterSidebarConfig) {
|
|
20662
|
+
const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
|
|
20663
|
+
setParamIfDefined(params, Param.EnablePastConversationsSidebar, enablePastConversationsSidebar, true);
|
|
20664
|
+
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
20665
|
+
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
20666
|
+
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
20667
|
+
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
20668
|
+
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
20669
|
+
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
20670
|
+
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
20671
|
+
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
20672
|
+
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
20673
|
+
// URL param with validation
|
|
20674
|
+
if (spotterDocumentationUrl !== undefined) {
|
|
20675
|
+
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
20676
|
+
if (isValid) {
|
|
20677
|
+
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
20678
|
+
}
|
|
20679
|
+
else {
|
|
20680
|
+
this.handleError({
|
|
20681
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20682
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20683
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
20684
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20685
|
+
});
|
|
20686
|
+
}
|
|
20687
|
+
}
|
|
20688
|
+
}
|
|
20689
|
+
// Handle spotterChatConfig params
|
|
20690
|
+
if (spotterChatConfig) {
|
|
20691
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
20692
|
+
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
20693
|
+
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
20694
|
+
}
|
|
20343
20695
|
if (hideObjectSearch) {
|
|
20344
20696
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
20345
20697
|
}
|
|
@@ -20737,6 +21089,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20737
21089
|
liveboardId: this.viewConfig.liveboardId,
|
|
20738
21090
|
vizId: this.viewConfig.vizId,
|
|
20739
21091
|
activeTabId: this.viewConfig.activeTabId,
|
|
21092
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
20740
21093
|
};
|
|
20741
21094
|
if (this.viewConfig.fullHeight === true) {
|
|
20742
21095
|
if (this.viewConfig.vizId) {
|
|
@@ -20761,7 +21114,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20761
21114
|
getEmbedParamsObject() {
|
|
20762
21115
|
let params = {};
|
|
20763
21116
|
params = this.getBaseQueryParams(params);
|
|
20764
|
-
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
21117
|
+
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled = false, isGranularXLSXCSVSchedulesEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, spotterChatConfig, isThisPeriodInDateFiltersEnabled, } = this.viewConfig;
|
|
20765
21118
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20766
21119
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20767
21120
|
if (fullHeight === true) {
|
|
@@ -20835,6 +21188,12 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20835
21188
|
if (showSpotterLimitations !== undefined) {
|
|
20836
21189
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
20837
21190
|
}
|
|
21191
|
+
// Handle spotterChatConfig params
|
|
21192
|
+
if (spotterChatConfig) {
|
|
21193
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
21194
|
+
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
21195
|
+
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
21196
|
+
}
|
|
20838
21197
|
if (isLinkParametersEnabled !== undefined) {
|
|
20839
21198
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20840
21199
|
}
|
|
@@ -20858,15 +21217,31 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20858
21217
|
getQueryParamString(params, true);
|
|
20859
21218
|
return params;
|
|
20860
21219
|
}
|
|
20861
|
-
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
20862
|
-
|
|
21220
|
+
getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21221
|
+
// Extract view from liveboardId if passed along with it (legacy approach)
|
|
21222
|
+
// View must be appended as query param at the end, not embedded in path
|
|
21223
|
+
let liveboardGuid = liveboardId;
|
|
21224
|
+
let legacyViewId;
|
|
21225
|
+
if (liveboardId === null || liveboardId === void 0 ? void 0 : liveboardId.includes('?')) {
|
|
21226
|
+
const [id, query] = liveboardId.split('?');
|
|
21227
|
+
liveboardGuid = id;
|
|
21228
|
+
const params = new URLSearchParams(query);
|
|
21229
|
+
legacyViewId = params.get('view') || undefined;
|
|
21230
|
+
}
|
|
21231
|
+
// personalizedViewId takes precedence over legacyViewId (when passed as part of liveboardId)
|
|
21232
|
+
const effectiveViewId = personalizedViewId || legacyViewId;
|
|
21233
|
+
let suffix = `/embed/viz/${liveboardGuid}`;
|
|
20863
21234
|
if (activeTabId) {
|
|
20864
|
-
suffix = `${suffix}/tab/${activeTabId}
|
|
21235
|
+
suffix = `${suffix}/tab/${activeTabId}`;
|
|
20865
21236
|
}
|
|
20866
21237
|
if (vizId) {
|
|
20867
21238
|
suffix = `${suffix}/${vizId}`;
|
|
20868
21239
|
}
|
|
20869
|
-
const
|
|
21240
|
+
const additionalParams = {};
|
|
21241
|
+
if (effectiveViewId) {
|
|
21242
|
+
additionalParams.view = effectiveViewId;
|
|
21243
|
+
}
|
|
21244
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams(additionalParams);
|
|
20870
21245
|
suffix = `${suffix}${tsPostHashParams}`;
|
|
20871
21246
|
return suffix;
|
|
20872
21247
|
}
|
|
@@ -20876,7 +21251,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20876
21251
|
*/
|
|
20877
21252
|
getIFrameSrc() {
|
|
20878
21253
|
var _a;
|
|
20879
|
-
const { vizId, activeTabId } = this.viewConfig;
|
|
21254
|
+
const { vizId, activeTabId, personalizedViewId } = this.viewConfig;
|
|
20880
21255
|
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
20881
21256
|
if (!liveboardId) {
|
|
20882
21257
|
this.handleError({
|
|
@@ -20886,7 +21261,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20886
21261
|
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20887
21262
|
});
|
|
20888
21263
|
}
|
|
20889
|
-
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
|
|
21264
|
+
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId)}`;
|
|
20890
21265
|
}
|
|
20891
21266
|
setActiveTab(data) {
|
|
20892
21267
|
if (!this.viewConfig.vizId) {
|
|
@@ -20925,12 +21300,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20925
21300
|
beforePrerenderVisible() {
|
|
20926
21301
|
const embedObj = this.getPreRenderObj();
|
|
20927
21302
|
this.executeAfterEmbedContainerLoaded(() => {
|
|
20928
|
-
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
21303
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
|
|
20929
21304
|
if (embedObj) {
|
|
20930
21305
|
embedObj.currentLiveboardState = {
|
|
20931
21306
|
liveboardId: this.viewConfig.liveboardId,
|
|
20932
21307
|
vizId: this.viewConfig.vizId,
|
|
20933
21308
|
activeTabId: this.viewConfig.activeTabId,
|
|
21309
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
20934
21310
|
};
|
|
20935
21311
|
}
|
|
20936
21312
|
});
|
|
@@ -20947,7 +21323,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20947
21323
|
* @param {any} data The payload to send with the message
|
|
20948
21324
|
* @returns A promise that resolves with the response from the embedded app
|
|
20949
21325
|
*/
|
|
20950
|
-
trigger(messageType, data = {}) {
|
|
21326
|
+
trigger(messageType, data = {}, context) {
|
|
20951
21327
|
const dataWithVizId = data;
|
|
20952
21328
|
if (messageType === HostEvent.SetActiveTab) {
|
|
20953
21329
|
this.setActiveTab(data);
|
|
@@ -20956,7 +21332,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20956
21332
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
20957
21333
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
20958
21334
|
}
|
|
20959
|
-
return super.trigger(messageType, dataWithVizId);
|
|
21335
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
20960
21336
|
}
|
|
20961
21337
|
/**
|
|
20962
21338
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
@@ -20995,11 +21371,12 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20995
21371
|
this.postRender();
|
|
20996
21372
|
return this;
|
|
20997
21373
|
}
|
|
20998
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
20999
|
-
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
21374
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21375
|
+
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId);
|
|
21000
21376
|
this.viewConfig.liveboardId = liveboardId;
|
|
21001
21377
|
this.viewConfig.activeTabId = activeTabId;
|
|
21002
21378
|
this.viewConfig.vizId = vizId;
|
|
21379
|
+
this.viewConfig.personalizedViewId = personalizedViewId;
|
|
21003
21380
|
if (this.isRendered) {
|
|
21004
21381
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
21005
21382
|
}
|
|
@@ -21023,6 +21400,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
21023
21400
|
if (this.viewConfig.vizId) {
|
|
21024
21401
|
url = `${url}/${this.viewConfig.vizId}`;
|
|
21025
21402
|
}
|
|
21403
|
+
if (this.viewConfig.personalizedViewId) {
|
|
21404
|
+
url = `${url}?view=${this.viewConfig.personalizedViewId}`;
|
|
21405
|
+
}
|
|
21026
21406
|
return url;
|
|
21027
21407
|
}
|
|
21028
21408
|
};
|
|
@@ -21591,7 +21971,9 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
21591
21971
|
this.viewConfig = viewConfig;
|
|
21592
21972
|
}
|
|
21593
21973
|
getEmbedParamsObject() {
|
|
21594
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions,
|
|
21974
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterSidebarConfig, spotterChatConfig, } = this.viewConfig;
|
|
21975
|
+
// Extract sidebar config properties
|
|
21976
|
+
const { enablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
|
|
21595
21977
|
if (!worksheetId) {
|
|
21596
21978
|
this.handleError({
|
|
21597
21979
|
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
@@ -21602,30 +21984,51 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
21602
21984
|
}
|
|
21603
21985
|
const queryParams = this.getBaseQueryParams();
|
|
21604
21986
|
queryParams[Param.SpotterEnabled] = true;
|
|
21605
|
-
|
|
21606
|
-
|
|
21607
|
-
|
|
21608
|
-
|
|
21609
|
-
|
|
21610
|
-
|
|
21611
|
-
|
|
21612
|
-
|
|
21613
|
-
|
|
21614
|
-
|
|
21615
|
-
|
|
21616
|
-
|
|
21617
|
-
|
|
21618
|
-
|
|
21987
|
+
// Boolean params
|
|
21988
|
+
setParamIfDefined(queryParams, Param.DisableSourceSelection, disableSourceSelection, true);
|
|
21989
|
+
setParamIfDefined(queryParams, Param.HideSourceSelection, hideSourceSelection, true);
|
|
21990
|
+
setParamIfDefined(queryParams, Param.DataPanelV2Enabled, dataPanelV2, true);
|
|
21991
|
+
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
21992
|
+
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
21993
|
+
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
21994
|
+
setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
21995
|
+
// String params
|
|
21996
|
+
setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
21997
|
+
setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
21998
|
+
setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
21999
|
+
setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
22000
|
+
setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
22001
|
+
setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
22002
|
+
setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
22003
|
+
setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
22004
|
+
// URL param with validation
|
|
22005
|
+
if (spotterDocumentationUrl !== undefined) {
|
|
22006
|
+
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
22007
|
+
if (isValid) {
|
|
22008
|
+
queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
22009
|
+
}
|
|
22010
|
+
else {
|
|
22011
|
+
this.handleError({
|
|
22012
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
22013
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22014
|
+
code: EmbedErrorCodes.INVALID_URL,
|
|
22015
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22016
|
+
});
|
|
22017
|
+
}
|
|
21619
22018
|
}
|
|
21620
|
-
|
|
21621
|
-
|
|
22019
|
+
// Handle spotterChatConfig params
|
|
22020
|
+
if (spotterChatConfig) {
|
|
22021
|
+
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
22022
|
+
setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
22023
|
+
setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
21622
22024
|
}
|
|
21623
22025
|
return queryParams;
|
|
21624
22026
|
}
|
|
21625
22027
|
getIframeSrc() {
|
|
21626
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL,
|
|
22028
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, spotterSidebarConfig, } = this.viewConfig;
|
|
21627
22029
|
const path = 'insights/conv-assist';
|
|
21628
22030
|
const queryParams = this.getEmbedParamsObject();
|
|
22031
|
+
const enablePastConversationsSidebar = spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar;
|
|
21629
22032
|
if (!isUndefined_1(enablePastConversationsSidebar)) {
|
|
21630
22033
|
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
21631
22034
|
}
|