@thoughtspot/visual-embed-sdk 1.46.4 → 1.46.5
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 +3 -3
- package/cjs/src/auth.d.ts +2 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +2 -1
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/css-variables.d.ts +87 -17
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +41 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +25 -36
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +35 -23
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +23 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +18 -33
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +129 -97
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +72 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +105 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +9 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +28 -0
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +106 -9
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +327 -6
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/utils.d.ts +22 -0
- package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.js +51 -0
- package/cjs/src/embed/hostEventClient/utils.js.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/cjs/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js +115 -0
- package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +18 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +54 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +20 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.js +52 -0
- package/cjs/src/embed/spotter-utils.js.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-utils.spec.js +54 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts +41 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +54 -3
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/errors.d.ts +2 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +2 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +58 -53
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +832 -33
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +835 -3
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +4 -2
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/preview-service.js.map +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils.d.ts +0 -9
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +1 -10
- package/cjs/src/utils.js.map +1 -1
- package/dist/index-ChNydfIz.js +7371 -0
- package/dist/index-DW2wEHqy.js +7371 -0
- package/dist/src/auth.d.ts +2 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +87 -17
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +41 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +23 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +105 -3
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +28 -0
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/utils.d.ts +22 -0
- package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/dist/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/dist/src/embed/liveboard.d.ts +18 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +20 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts +41 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +832 -33
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/graphql/preview-service.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -9
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1208 -154
- package/dist/tsembed-react.js +1206 -152
- package/dist/tsembed.es.js +1150 -101
- package/dist/tsembed.js +1148 -99
- package/dist/visual-embed-sdk-react-full.d.ts +1156 -55
- package/dist/visual-embed-sdk-react.d.ts +1156 -55
- package/dist/visual-embed-sdk.d.ts +1179 -60
- package/lib/package.json +3 -3
- package/lib/src/auth.d.ts +2 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +2 -1
- package/lib/src/auth.js.map +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/css-variables.d.ts +87 -17
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +41 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +27 -38
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +35 -23
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +23 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +19 -34
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +131 -99
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +73 -1
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +105 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +9 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +28 -0
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +106 -9
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +327 -6
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/utils.d.ts +22 -0
- package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.js +43 -0
- package/lib/src/embed/hostEventClient/utils.js.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts +2 -0
- package/lib/src/embed/hostEventClient/utils.spec.d.ts.map +1 -0
- package/lib/src/embed/hostEventClient/utils.spec.js +113 -0
- package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -0
- package/lib/src/embed/liveboard.d.ts +18 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +10 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +54 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +20 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.js +47 -0
- package/lib/src/embed/spotter-utils.js.map +1 -0
- package/lib/src/embed/spotter-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-utils.spec.js +52 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts +41 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +55 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/errors.d.ts +2 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +2 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +58 -53
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +832 -33
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +835 -3
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +4 -2
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/preview-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/preview-service.js.map +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils.d.ts +0 -9
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +0 -8
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +1179 -60
- package/package.json +3 -3
- package/src/auth.spec.ts +1 -1
- package/src/auth.ts +2 -1
- package/src/authToken.ts +0 -1
- package/src/css-variables.ts +96 -17
- package/src/embed/app.spec.ts +48 -30
- package/src/embed/app.ts +59 -54
- package/src/embed/base.spec.ts +1 -2
- package/src/embed/base.ts +1 -4
- package/src/embed/conversation.spec.ts +150 -119
- package/src/embed/conversation.ts +30 -54
- package/src/embed/events.spec.ts +88 -0
- package/src/embed/hostEventClient/contracts.ts +105 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +504 -6
- package/src/embed/hostEventClient/host-event-client.ts +146 -15
- package/src/embed/hostEventClient/utils.spec.ts +137 -0
- package/src/embed/hostEventClient/utils.ts +61 -0
- package/src/embed/liveboard.spec.ts +71 -2
- package/src/embed/liveboard.ts +29 -2
- package/src/embed/sage.ts +0 -1
- package/src/embed/search.spec.ts +0 -2
- package/src/embed/spotter-utils.spec.ts +56 -0
- package/src/embed/spotter-utils.ts +65 -0
- package/src/embed/ts-embed.ts +58 -4
- package/src/errors.ts +2 -0
- package/src/react/index.tsx +76 -72
- package/src/types.ts +843 -31
- package/src/utils/graphql/answerService/answerService.ts +4 -5
- package/src/utils/graphql/preview-service.ts +0 -1
- package/src/utils/processData.ts +0 -5
- package/src/utils.ts +0 -14
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.46.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.5 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
* @deprecated This option is deprecated.
|
|
77
77
|
* @hidden
|
|
78
78
|
*/
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
79
80
|
AuthType["SAML"] = "SSO_SAML";
|
|
80
81
|
/**
|
|
81
82
|
* SSO using SAML
|
|
@@ -121,6 +122,7 @@
|
|
|
121
122
|
* });
|
|
122
123
|
* ```
|
|
123
124
|
*/
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
124
126
|
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
125
127
|
/**
|
|
126
128
|
* SSO using OIDC
|
|
@@ -134,6 +136,7 @@
|
|
|
134
136
|
* Will make the host application redirect to the OIDC IdP.
|
|
135
137
|
* See code samples in {@link SAMLRedirect}.
|
|
136
138
|
*/
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
137
140
|
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
138
141
|
/**
|
|
139
142
|
* Trusted authentication server
|
|
@@ -159,6 +162,7 @@
|
|
|
159
162
|
* });
|
|
160
163
|
* ```
|
|
161
164
|
*/
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
162
166
|
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
163
167
|
/**
|
|
164
168
|
* Trusted authentication server Cookieless, Use your own authentication
|
|
@@ -895,6 +899,17 @@
|
|
|
895
899
|
* ```
|
|
896
900
|
*/
|
|
897
901
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
902
|
+
/**
|
|
903
|
+
* Emitted when the Download Liveboard as Continuous PDF action is triggered
|
|
904
|
+
* on a Liveboard.
|
|
905
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
906
|
+
* @example
|
|
907
|
+
* ```js
|
|
908
|
+
* liveboardEmbed.on(EmbedEvent.DownloadLiveboardAsContinuousPDF, payload => {
|
|
909
|
+
* console.log('download liveboard as continuous PDF', payload)})
|
|
910
|
+
* ```
|
|
911
|
+
*/
|
|
912
|
+
EmbedEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
898
913
|
/**
|
|
899
914
|
* Emitted when an Answer is deleted in the app
|
|
900
915
|
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe
|
|
@@ -1298,22 +1313,45 @@
|
|
|
1298
1313
|
/**
|
|
1299
1314
|
* Emitted when name, status (private or public) or filter values of a
|
|
1300
1315
|
* Personalised view is updated.
|
|
1316
|
+
* This event is deprecated. Use {@link EmbedEvent.UpdatePersonalizedView} instead.
|
|
1301
1317
|
* @returns viewName: string
|
|
1302
1318
|
* @returns viewId: string
|
|
1303
1319
|
* @returns liveboardId: string
|
|
1304
1320
|
* @returns isPublic: boolean
|
|
1305
1321
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1322
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1306
1323
|
*/
|
|
1307
1324
|
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1325
|
+
/**
|
|
1326
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1327
|
+
* Personalized view is updated.
|
|
1328
|
+
* @returns viewName: string
|
|
1329
|
+
* @returns viewId: string
|
|
1330
|
+
* @returns liveboardId: string
|
|
1331
|
+
* @returns isPublic: boolean
|
|
1332
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1333
|
+
*/
|
|
1334
|
+
EmbedEvent["UpdatePersonalizedView"] = "updatePersonalisedView";
|
|
1308
1335
|
/**
|
|
1309
1336
|
* Emitted when a Personalised view is saved.
|
|
1337
|
+
* This event is deprecated. Use {@link EmbedEvent.SavePersonalizedView} instead.
|
|
1310
1338
|
* @returns viewName: string
|
|
1311
1339
|
* @returns viewId: string
|
|
1312
1340
|
* @returns liveboardId: string
|
|
1313
1341
|
* @returns isPublic: boolean
|
|
1314
1342
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1343
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1315
1344
|
*/
|
|
1316
1345
|
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1346
|
+
/**
|
|
1347
|
+
* Emitted when a Personalized view is saved.
|
|
1348
|
+
* @returns viewName: string
|
|
1349
|
+
* @returns viewId: string
|
|
1350
|
+
* @returns liveboardId: string
|
|
1351
|
+
* @returns isPublic: boolean
|
|
1352
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1353
|
+
*/
|
|
1354
|
+
EmbedEvent["SavePersonalizedView"] = "savePersonalisedView";
|
|
1317
1355
|
/**
|
|
1318
1356
|
* Emitted when a Liveboard is reset.
|
|
1319
1357
|
* @returns viewName: string
|
|
@@ -1325,11 +1363,41 @@
|
|
|
1325
1363
|
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1326
1364
|
/**
|
|
1327
1365
|
* Emitted when a PersonalisedView is deleted.
|
|
1366
|
+
* This event is deprecated. Use {@link EmbedEvent.DeletePersonalizedView} instead.
|
|
1328
1367
|
* @returns views: string[]
|
|
1329
1368
|
* @returns liveboardId: string
|
|
1330
1369
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
1370
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1331
1371
|
*/
|
|
1332
1372
|
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1373
|
+
/**
|
|
1374
|
+
* Emitted when a PersonalizedView is deleted.
|
|
1375
|
+
* @returns views: string[]
|
|
1376
|
+
* @returns liveboardId: string
|
|
1377
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1378
|
+
*/
|
|
1379
|
+
EmbedEvent["DeletePersonalizedView"] = "deletePersonalisedView";
|
|
1380
|
+
/**
|
|
1381
|
+
* Emitted when a user selects a different Personalized View or
|
|
1382
|
+
* resets to the original/default view on a Liveboard.
|
|
1383
|
+
* @example
|
|
1384
|
+
* ```js
|
|
1385
|
+
* liveboardEmbed.on(EmbedEvent.ChangePersonalizedView, (data) => {
|
|
1386
|
+
* console.log(data.viewName); // 'Q4 Revenue' or 'Original View'
|
|
1387
|
+
* console.log(data.viewId); // '2a021a12-...' or null (default)
|
|
1388
|
+
* console.log(data.liveboardId); // 'abc123...'
|
|
1389
|
+
* console.log(data.isPublic); // true | false
|
|
1390
|
+
* })
|
|
1391
|
+
* ```
|
|
1392
|
+
* @returns viewName: string - Name of the selected view,
|
|
1393
|
+
* or 'Original View' when reset to default.
|
|
1394
|
+
* @returns viewId: string | null - GUID of the selected view,
|
|
1395
|
+
* or null when reset to default.
|
|
1396
|
+
* @returns liveboardId: string
|
|
1397
|
+
* @returns isPublic: boolean
|
|
1398
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
1399
|
+
*/
|
|
1400
|
+
EmbedEvent["ChangePersonalizedView"] = "changePersonalisedView";
|
|
1333
1401
|
/**
|
|
1334
1402
|
* Emitted when a user creates a Worksheet.
|
|
1335
1403
|
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
@@ -1363,7 +1431,8 @@
|
|
|
1363
1431
|
* @param - Includes the following parameters:
|
|
1364
1432
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1365
1433
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1366
|
-
* will run or block the search operation, and if blocked, which error message to
|
|
1434
|
+
* will run or block the search operation, and if blocked, which error message to
|
|
1435
|
+
* provide.
|
|
1367
1436
|
* - `execute` - When `execute` returns `true`, the search is run.
|
|
1368
1437
|
* When `execute` returns `false`, the search is not executed.
|
|
1369
1438
|
* - `error` - Developers can customize the user-facing error message when `execute`
|
|
@@ -1797,6 +1866,25 @@
|
|
|
1797
1866
|
* );
|
|
1798
1867
|
* }
|
|
1799
1868
|
* ```
|
|
1869
|
+
*
|
|
1870
|
+
* **Context Parameter (SDK: 1.45.2+)**
|
|
1871
|
+
*
|
|
1872
|
+
* Starting from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl, you can optionally pass a
|
|
1873
|
+
* `ContextType` as the third parameter to the `trigger` method to specify the context
|
|
1874
|
+
* from which the event is triggered. This helps ThoughtSpot understand the current page
|
|
1875
|
+
* context (Search, Answer, Liveboard, or Spotter) for better event handling.
|
|
1876
|
+
*
|
|
1877
|
+
* @example
|
|
1878
|
+
* ```js
|
|
1879
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
1880
|
+
*
|
|
1881
|
+
* // Trigger Pin event with Search context
|
|
1882
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
1883
|
+
* vizId: "123",
|
|
1884
|
+
* liveboardId: "456"
|
|
1885
|
+
* }, ContextType.Search);
|
|
1886
|
+
* ```
|
|
1887
|
+
*
|
|
1800
1888
|
* @group Events
|
|
1801
1889
|
*/
|
|
1802
1890
|
exports.HostEvent = void 0;
|
|
@@ -1819,6 +1907,16 @@
|
|
|
1819
1907
|
execute: true
|
|
1820
1908
|
});
|
|
1821
1909
|
* ```
|
|
1910
|
+
* @example
|
|
1911
|
+
* ```js
|
|
1912
|
+
* // Trigger search from search context
|
|
1913
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
1914
|
+
* appEmbed.trigger(HostEvent.Search, {
|
|
1915
|
+
* searchQuery: "[revenue] by [region]",
|
|
1916
|
+
* dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
|
|
1917
|
+
* execute: true
|
|
1918
|
+
* }, ContextType.Search);
|
|
1919
|
+
* ```
|
|
1822
1920
|
*/
|
|
1823
1921
|
HostEvent["Search"] = "search";
|
|
1824
1922
|
/**
|
|
@@ -1869,6 +1967,24 @@
|
|
|
1869
1967
|
* });
|
|
1870
1968
|
* })
|
|
1871
1969
|
* ```
|
|
1970
|
+
* @example
|
|
1971
|
+
* ```js
|
|
1972
|
+
* // Drill down from answer context
|
|
1973
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
1974
|
+
* appEmbed.trigger(HostEvent.DrillDown, {
|
|
1975
|
+
* points: { clickedPoint, selectedPoints },
|
|
1976
|
+
* autoDrillDown: true
|
|
1977
|
+
* }, ContextType.Answer);
|
|
1978
|
+
* ```
|
|
1979
|
+
* @example
|
|
1980
|
+
* ```js
|
|
1981
|
+
* // Drill down from search context
|
|
1982
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
1983
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
1984
|
+
* points: { clickedPoint, selectedPoints },
|
|
1985
|
+
* columnGuid: "column-guid"
|
|
1986
|
+
* }, ContextType.Search);
|
|
1987
|
+
* ```
|
|
1872
1988
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
1873
1989
|
*/
|
|
1874
1990
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
@@ -1889,6 +2005,13 @@
|
|
|
1889
2005
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
1890
2006
|
* console.log("iFrameURL",url);
|
|
1891
2007
|
* ```
|
|
2008
|
+
* @example
|
|
2009
|
+
* ```js
|
|
2010
|
+
* // Get iframe URL from specific context
|
|
2011
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2012
|
+
* const url = await appEmbed.trigger(HostEvent.GetIframeUrl, {}, ContextType.Answer);
|
|
2013
|
+
* console.log("iFrameURL", url);
|
|
2014
|
+
* ```
|
|
1892
2015
|
* @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl
|
|
1893
2016
|
*/
|
|
1894
2017
|
HostEvent["GetIframeUrl"] = "GetIframeUrl";
|
|
@@ -1902,6 +2025,15 @@
|
|
|
1902
2025
|
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
1903
2026
|
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
1904
2027
|
* ```
|
|
2028
|
+
* @example
|
|
2029
|
+
* ```js
|
|
2030
|
+
* // Set visible vizs from liveboard context
|
|
2031
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2032
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
2033
|
+
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
2034
|
+
* 'd547ec54-2a37-4516-a222-2b06719af726'
|
|
2035
|
+
* ], ContextType.Liveboard);
|
|
2036
|
+
* ```
|
|
1905
2037
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
1906
2038
|
*/
|
|
1907
2039
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
@@ -1914,6 +2046,14 @@
|
|
|
1914
2046
|
* tabId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
1915
2047
|
* })
|
|
1916
2048
|
* ```
|
|
2049
|
+
* @example
|
|
2050
|
+
* ```js
|
|
2051
|
+
* // Set active tab from liveboard context
|
|
2052
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2053
|
+
* liveboardEmbed.trigger(HostEvent.SetActiveTab, {
|
|
2054
|
+
* tabId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2055
|
+
* }, ContextType.Liveboard);
|
|
2056
|
+
* ```
|
|
1917
2057
|
* @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
|
|
1918
2058
|
*/
|
|
1919
2059
|
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
@@ -1947,6 +2087,15 @@
|
|
|
1947
2087
|
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
1948
2088
|
* ])
|
|
1949
2089
|
* ```
|
|
2090
|
+
* @example
|
|
2091
|
+
* ```js
|
|
2092
|
+
* // Update runtime filters from liveboard context
|
|
2093
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2094
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
2095
|
+
* {columnName: "region", operator: RuntimeFilterOp.EQ, values: ["west"]},
|
|
2096
|
+
* {columnName: "product", operator: RuntimeFilterOp.IN, values: ["shoes", "boots"]}
|
|
2097
|
+
* ], ContextType.Liveboard);
|
|
2098
|
+
* ```
|
|
1950
2099
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
1951
2100
|
* @important
|
|
1952
2101
|
*/
|
|
@@ -1980,6 +2129,14 @@
|
|
|
1980
2129
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
1981
2130
|
* { column: {columnId: '<column-GUID>'}})
|
|
1982
2131
|
* ```
|
|
2132
|
+
* @example
|
|
2133
|
+
* ```js
|
|
2134
|
+
* // Open filter from search context
|
|
2135
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2136
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, {
|
|
2137
|
+
* column: { columnId: '<column-GUID>', name: 'region', type: 'ATTRIBUTE', dataType: 'CHAR'}
|
|
2138
|
+
* }, ContextType.Search);
|
|
2139
|
+
* ```
|
|
1983
2140
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1984
2141
|
*/
|
|
1985
2142
|
HostEvent["OpenFilter"] = "openFilter";
|
|
@@ -1990,6 +2147,14 @@
|
|
|
1990
2147
|
* ```js
|
|
1991
2148
|
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
|
|
1992
2149
|
* ```
|
|
2150
|
+
* @example
|
|
2151
|
+
* ```js
|
|
2152
|
+
* // Add columns from search context
|
|
2153
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2154
|
+
* searchEmbed.trigger(HostEvent.AddColumns, {
|
|
2155
|
+
* columnIds: ['col-guid-1', 'col-guid-2']
|
|
2156
|
+
* }, ContextType.Search);
|
|
2157
|
+
* ```
|
|
1993
2158
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1994
2159
|
*/
|
|
1995
2160
|
HostEvent["AddColumns"] = "addColumns";
|
|
@@ -2000,6 +2165,14 @@
|
|
|
2000
2165
|
* ```js
|
|
2001
2166
|
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
|
|
2002
2167
|
* ```
|
|
2168
|
+
* @example
|
|
2169
|
+
* ```js
|
|
2170
|
+
* // Remove column from search context
|
|
2171
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2172
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, {
|
|
2173
|
+
* columnId: 'column-guid'
|
|
2174
|
+
* }, ContextType.Search);
|
|
2175
|
+
* ```
|
|
2003
2176
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2004
2177
|
*/
|
|
2005
2178
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
@@ -2086,6 +2259,37 @@
|
|
|
2086
2259
|
*
|
|
2087
2260
|
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2088
2261
|
* ```
|
|
2262
|
+
* @example
|
|
2263
|
+
* ```js
|
|
2264
|
+
* // Using context parameter to specify the context type (SDK: 1.45.2+)
|
|
2265
|
+
* // Pin from a search answer context
|
|
2266
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2267
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2268
|
+
* vizId: "123",
|
|
2269
|
+
* newVizName: "Sales by region",
|
|
2270
|
+
* liveboardId: "456"
|
|
2271
|
+
* }, ContextType.Search);
|
|
2272
|
+
* ```
|
|
2273
|
+
* @example
|
|
2274
|
+
* ```js
|
|
2275
|
+
* // Pin from an answer context (explore modal/page) (SDK: 1.45.2+)
|
|
2276
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2277
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2278
|
+
* vizId: "789",
|
|
2279
|
+
* newVizName: "Revenue trends",
|
|
2280
|
+
* liveboardId: "456"
|
|
2281
|
+
* }, ContextType.Answer);
|
|
2282
|
+
* ```
|
|
2283
|
+
* @example
|
|
2284
|
+
* ```js
|
|
2285
|
+
* // Pin from a spotter context (SDK: 1.45.2+)
|
|
2286
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2287
|
+
* appEmbed.trigger(HostEvent.Pin, {
|
|
2288
|
+
* vizId: latestSpotterVizId,
|
|
2289
|
+
* newVizName: "AI-generated insights",
|
|
2290
|
+
* liveboardId: "456"
|
|
2291
|
+
* }, ContextType.Spotter);
|
|
2292
|
+
* ```
|
|
2089
2293
|
*
|
|
2090
2294
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2091
2295
|
*/
|
|
@@ -2096,6 +2300,12 @@
|
|
|
2096
2300
|
* @example
|
|
2097
2301
|
* ```js
|
|
2098
2302
|
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
2303
|
+
*```
|
|
2304
|
+
* @example
|
|
2305
|
+
* ```js
|
|
2306
|
+
* // Show liveboard info from liveboard context
|
|
2307
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2308
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo, {}, ContextType.Liveboard);
|
|
2099
2309
|
* ```
|
|
2100
2310
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2101
2311
|
*/
|
|
@@ -2106,6 +2316,12 @@
|
|
|
2106
2316
|
* ```js
|
|
2107
2317
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
2108
2318
|
* ```
|
|
2319
|
+
* @example
|
|
2320
|
+
* ```js
|
|
2321
|
+
* // Schedule from liveboard context
|
|
2322
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2323
|
+
* liveboardEmbed.trigger(HostEvent.Schedule, {}, ContextType.Liveboard);
|
|
2324
|
+
* ```
|
|
2109
2325
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2110
2326
|
*/
|
|
2111
2327
|
HostEvent["Schedule"] = "subscription";
|
|
@@ -2115,6 +2331,12 @@
|
|
|
2115
2331
|
* ```js
|
|
2116
2332
|
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
2117
2333
|
* ```
|
|
2334
|
+
* @example
|
|
2335
|
+
* ```js
|
|
2336
|
+
* // Manage schedules from liveboard context
|
|
2337
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2338
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList, {}, ContextType.Liveboard);
|
|
2339
|
+
* ```
|
|
2118
2340
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2119
2341
|
*/
|
|
2120
2342
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
@@ -2125,6 +2347,18 @@
|
|
|
2125
2347
|
* ```js
|
|
2126
2348
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
2127
2349
|
* ```
|
|
2350
|
+
* @example
|
|
2351
|
+
* ```js
|
|
2352
|
+
* // Export TML from liveboard context
|
|
2353
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2354
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Liveboard);
|
|
2355
|
+
* ```
|
|
2356
|
+
* @example
|
|
2357
|
+
* ```js
|
|
2358
|
+
* // Export TML from search-answer context
|
|
2359
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2360
|
+
* appEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Search);
|
|
2361
|
+
* ```
|
|
2128
2362
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2129
2363
|
*/
|
|
2130
2364
|
HostEvent["ExportTML"] = "exportTSL";
|
|
@@ -2135,6 +2369,18 @@
|
|
|
2135
2369
|
* ```js
|
|
2136
2370
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
2137
2371
|
* ```
|
|
2372
|
+
* @example
|
|
2373
|
+
* ```js
|
|
2374
|
+
* // Edit TML from liveboard context
|
|
2375
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2376
|
+
* liveboardEmbed.trigger(HostEvent.EditTML, {}, ContextType.Liveboard);
|
|
2377
|
+
* ```
|
|
2378
|
+
* @example
|
|
2379
|
+
* ```js
|
|
2380
|
+
* // Edit TML from search-answer context
|
|
2381
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2382
|
+
* appEmbed.trigger(HostEvent.EditTML, {}, ContextType.Search);
|
|
2383
|
+
* ```
|
|
2138
2384
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2139
2385
|
*/
|
|
2140
2386
|
HostEvent["EditTML"] = "editTSL";
|
|
@@ -2144,6 +2390,12 @@
|
|
|
2144
2390
|
* ```js
|
|
2145
2391
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
2146
2392
|
* ```
|
|
2393
|
+
* @example
|
|
2394
|
+
* ```js
|
|
2395
|
+
* // Update TML from liveboard context
|
|
2396
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2397
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML, {}, ContextType.Liveboard);
|
|
2398
|
+
* ```
|
|
2147
2399
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2148
2400
|
*/
|
|
2149
2401
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
@@ -2170,10 +2422,34 @@
|
|
|
2170
2422
|
*
|
|
2171
2423
|
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2172
2424
|
* ```
|
|
2425
|
+
* @example
|
|
2426
|
+
* ```js
|
|
2427
|
+
* // Download as PDF from search-answer context
|
|
2428
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2429
|
+
* appEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Search);
|
|
2430
|
+
* ```
|
|
2431
|
+
* @example
|
|
2432
|
+
* ```js
|
|
2433
|
+
* // Download as PDF from liveboard context
|
|
2434
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2435
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Liveboard);
|
|
2436
|
+
* ```
|
|
2173
2437
|
*
|
|
2174
2438
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2175
2439
|
*/
|
|
2176
2440
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2441
|
+
/**
|
|
2442
|
+
* Trigger the **Download Liveboard as Continuous PDF** action on an
|
|
2443
|
+
* embedded Liveboard.
|
|
2444
|
+
*
|
|
2445
|
+
* @example
|
|
2446
|
+
* ```js
|
|
2447
|
+
* liveboardEmbed.trigger(HostEvent.DownloadLiveboardAsContinuousPDF)
|
|
2448
|
+
* ```
|
|
2449
|
+
*
|
|
2450
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
2451
|
+
*/
|
|
2452
|
+
HostEvent["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
2177
2453
|
/**
|
|
2178
2454
|
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2179
2455
|
*
|
|
@@ -2214,6 +2490,18 @@
|
|
|
2214
2490
|
*
|
|
2215
2491
|
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2216
2492
|
* ```
|
|
2493
|
+
* @example
|
|
2494
|
+
* ```js
|
|
2495
|
+
* // Make a copy from answer context
|
|
2496
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2497
|
+
* appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Answer);
|
|
2498
|
+
* ```
|
|
2499
|
+
* @example
|
|
2500
|
+
* ```js
|
|
2501
|
+
* // Make a copy from search context
|
|
2502
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2503
|
+
* appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Search);
|
|
2504
|
+
* ```
|
|
2217
2505
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2218
2506
|
*/
|
|
2219
2507
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2238,6 +2526,14 @@
|
|
|
2238
2526
|
* ```js
|
|
2239
2527
|
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2240
2528
|
* ```
|
|
2529
|
+
* @example
|
|
2530
|
+
* ```js
|
|
2531
|
+
* // Explore from liveboard context
|
|
2532
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2533
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {
|
|
2534
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2535
|
+
* }, ContextType.Liveboard);
|
|
2536
|
+
* ```
|
|
2241
2537
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2242
2538
|
*/
|
|
2243
2539
|
HostEvent["Explore"] = "explore";
|
|
@@ -2255,6 +2551,20 @@
|
|
|
2255
2551
|
* ```js
|
|
2256
2552
|
* searchEmbed.trigger(HostEvent.CreateMonitor)
|
|
2257
2553
|
* ```
|
|
2554
|
+
* @example
|
|
2555
|
+
* ```js
|
|
2556
|
+
* // Create monitor from answer context
|
|
2557
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2558
|
+
* appEmbed.trigger(HostEvent.CreateMonitor, {}, ContextType.Answer);
|
|
2559
|
+
* ```
|
|
2560
|
+
* @example
|
|
2561
|
+
* ```js
|
|
2562
|
+
* // Create monitor from liveboard context
|
|
2563
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2564
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor, {
|
|
2565
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2566
|
+
* }, ContextType.Liveboard);
|
|
2567
|
+
* ```
|
|
2258
2568
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2259
2569
|
*/
|
|
2260
2570
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
@@ -2276,6 +2586,20 @@
|
|
|
2276
2586
|
* ```js
|
|
2277
2587
|
* vizEmbed.trigger(HostEvent.ManageMonitor)
|
|
2278
2588
|
* ```
|
|
2589
|
+
* @example
|
|
2590
|
+
* ```js
|
|
2591
|
+
* // Manage monitor from answer context
|
|
2592
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2593
|
+
* appEmbed.trigger(HostEvent.ManageMonitor, {}, ContextType.Answer);
|
|
2594
|
+
* ```
|
|
2595
|
+
* @example
|
|
2596
|
+
* ```js
|
|
2597
|
+
* // Manage monitor from liveboard context
|
|
2598
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2599
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
2600
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2601
|
+
* }, ContextType.Liveboard);
|
|
2602
|
+
* ```
|
|
2279
2603
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2280
2604
|
*/
|
|
2281
2605
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
@@ -2301,6 +2625,26 @@
|
|
|
2301
2625
|
* ```js
|
|
2302
2626
|
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2303
2627
|
* ```
|
|
2628
|
+
* @example
|
|
2629
|
+
* ```js
|
|
2630
|
+
* // Using context parameter to edit liveboard context
|
|
2631
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2632
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {}, ContextType.Liveboard);
|
|
2633
|
+
* ```
|
|
2634
|
+
* @example
|
|
2635
|
+
* ```js
|
|
2636
|
+
* // Edit from search context
|
|
2637
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2638
|
+
* appEmbed.trigger(HostEvent.Edit, {}, ContextType.Search);
|
|
2639
|
+
* ```
|
|
2640
|
+
* * @example
|
|
2641
|
+
* ```js
|
|
2642
|
+
* // Edit from spotter context
|
|
2643
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2644
|
+
* appEmbed.trigger(HostEvent.Edit, {
|
|
2645
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2646
|
+
* }, ContextType.Spotter);
|
|
2647
|
+
* ```
|
|
2304
2648
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2305
2649
|
*/
|
|
2306
2650
|
HostEvent["Edit"] = "edit";
|
|
@@ -2318,6 +2662,34 @@
|
|
|
2318
2662
|
* ```js
|
|
2319
2663
|
* vizEmbed.trigger(HostEvent.CopyLink)
|
|
2320
2664
|
* ```
|
|
2665
|
+
* @example
|
|
2666
|
+
* ```js
|
|
2667
|
+
* // Copy link from liveboard context
|
|
2668
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2669
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2670
|
+
* ```
|
|
2671
|
+
* @example
|
|
2672
|
+
* ```js
|
|
2673
|
+
* // Copy link from liveboard visualization context
|
|
2674
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2675
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2676
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2677
|
+
* }, ContextType.Liveboard);
|
|
2678
|
+
* ```
|
|
2679
|
+
* @example
|
|
2680
|
+
* ```js
|
|
2681
|
+
* // Copy link from liveboard context
|
|
2682
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2683
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
|
|
2684
|
+
* ```
|
|
2685
|
+
* @example
|
|
2686
|
+
* ```js
|
|
2687
|
+
* // Copy link from liveboard visualization context
|
|
2688
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2689
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {
|
|
2690
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2691
|
+
* }, ContextType.Liveboard);
|
|
2692
|
+
* ```
|
|
2321
2693
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2322
2694
|
*/
|
|
2323
2695
|
HostEvent["CopyLink"] = "embedDocument";
|
|
@@ -2335,6 +2707,34 @@
|
|
|
2335
2707
|
* ```js
|
|
2336
2708
|
* vizEmbed.trigger(HostEvent.Present)
|
|
2337
2709
|
* ```
|
|
2710
|
+
* @example
|
|
2711
|
+
* ```js
|
|
2712
|
+
* // Present from liveboard visualization context
|
|
2713
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2714
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2715
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2716
|
+
* }, ContextType.Liveboard);
|
|
2717
|
+
* ```
|
|
2718
|
+
* @example
|
|
2719
|
+
* ```js
|
|
2720
|
+
* // Present from liveboard context
|
|
2721
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2722
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2723
|
+
* ```
|
|
2724
|
+
* @example
|
|
2725
|
+
* ```js
|
|
2726
|
+
* // Present from liveboard visualization context
|
|
2727
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2728
|
+
* liveboardEmbed.trigger(HostEvent.Present, {
|
|
2729
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2730
|
+
* }, ContextType.Liveboard);
|
|
2731
|
+
* ```
|
|
2732
|
+
* @example
|
|
2733
|
+
* ```js
|
|
2734
|
+
* // Present from liveboard context
|
|
2735
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2736
|
+
* liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
|
|
2737
|
+
* ```
|
|
2338
2738
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2339
2739
|
*/
|
|
2340
2740
|
HostEvent["Present"] = "present";
|
|
@@ -2363,6 +2763,22 @@
|
|
|
2363
2763
|
* tml.answer.search_query // TML representation of the search query
|
|
2364
2764
|
* );
|
|
2365
2765
|
* })
|
|
2766
|
+
* ```
|
|
2767
|
+
* @example
|
|
2768
|
+
* ```js
|
|
2769
|
+
* // Get TML from search context
|
|
2770
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2771
|
+
* appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
|
|
2772
|
+
* console.log(tml.answer.search_query);
|
|
2773
|
+
* });
|
|
2774
|
+
* ```
|
|
2775
|
+
* @example
|
|
2776
|
+
* ```js
|
|
2777
|
+
* // Get TML from search-answer context
|
|
2778
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2779
|
+
* appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
|
|
2780
|
+
* console.log(tml.answer);
|
|
2781
|
+
* });
|
|
2366
2782
|
* ```
|
|
2367
2783
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2368
2784
|
* @important
|
|
@@ -2384,6 +2800,20 @@
|
|
|
2384
2800
|
* ```js
|
|
2385
2801
|
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
2386
2802
|
* ```
|
|
2803
|
+
* @example
|
|
2804
|
+
* ```js
|
|
2805
|
+
* // Show underlying data from liveboard visualization context
|
|
2806
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2807
|
+
* appEmbed.trigger(HostEvent.ShowUnderlyingData, {
|
|
2808
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2809
|
+
* }, ContextType.Liveboard);
|
|
2810
|
+
* ```
|
|
2811
|
+
* @example
|
|
2812
|
+
* ```js
|
|
2813
|
+
* // Show underlying data from search context
|
|
2814
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2815
|
+
* appEmbed.trigger(HostEvent.ShowUnderlyingData, {}, ContextType.Search);
|
|
2816
|
+
* ```
|
|
2387
2817
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2388
2818
|
*/
|
|
2389
2819
|
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
@@ -2401,6 +2831,18 @@
|
|
|
2401
2831
|
* ```js
|
|
2402
2832
|
* searchEmbed.trigger(HostEvent.Delete)
|
|
2403
2833
|
* ```
|
|
2834
|
+
* @example
|
|
2835
|
+
* ```js
|
|
2836
|
+
* // Delete from liveboard context
|
|
2837
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2838
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {}, ContextType.Liveboard);
|
|
2839
|
+
* ```
|
|
2840
|
+
* @example
|
|
2841
|
+
* ```js
|
|
2842
|
+
* // Delete from search context
|
|
2843
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2844
|
+
* appEmbed.trigger(HostEvent.Delete, {}, ContextType.Search);
|
|
2845
|
+
* ```
|
|
2404
2846
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2405
2847
|
*/
|
|
2406
2848
|
HostEvent["Delete"] = "onDeleteAnswer";
|
|
@@ -2421,6 +2863,20 @@
|
|
|
2421
2863
|
* ```js
|
|
2422
2864
|
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
2423
2865
|
* ```
|
|
2866
|
+
* @example
|
|
2867
|
+
* ```js
|
|
2868
|
+
* // SpotIQ analyze from search-answer context
|
|
2869
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2870
|
+
* appEmbed.trigger(HostEvent.SpotIQAnalyze, { vizId: '730496d6-6903-4601-937e-2c691821af3c' }, ContextType.Search);
|
|
2871
|
+
* ```
|
|
2872
|
+
* @example
|
|
2873
|
+
* ```js
|
|
2874
|
+
* // SpotIQ analyze from search context
|
|
2875
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2876
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {
|
|
2877
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2878
|
+
* }, ContextType.Liveboard);
|
|
2879
|
+
* ```
|
|
2424
2880
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2425
2881
|
*/
|
|
2426
2882
|
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
@@ -2472,9 +2928,16 @@
|
|
|
2472
2928
|
*
|
|
2473
2929
|
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2474
2930
|
* ```
|
|
2931
|
+
* @example
|
|
2932
|
+
* ```js
|
|
2933
|
+
* // Download as PNG from search-answer context
|
|
2934
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2935
|
+
* appEmbed.trigger(HostEvent.DownloadAsPng, {}, ContextType.Search);
|
|
2936
|
+
* ```
|
|
2475
2937
|
*
|
|
2476
2938
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2477
2939
|
*/
|
|
2940
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
2478
2941
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
2479
2942
|
/**
|
|
2480
2943
|
* Trigger the **Download** > **CSV** action on tables in
|
|
@@ -2500,6 +2963,18 @@
|
|
|
2500
2963
|
*
|
|
2501
2964
|
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2502
2965
|
* ```
|
|
2966
|
+
* @example
|
|
2967
|
+
* ```js
|
|
2968
|
+
* // Download as CSV from search-answer context
|
|
2969
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2970
|
+
* appEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
|
|
2971
|
+
* ```
|
|
2972
|
+
* @example
|
|
2973
|
+
* ```js
|
|
2974
|
+
* // Download as CSV from search context
|
|
2975
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
2976
|
+
* searchEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
|
|
2977
|
+
* ```
|
|
2503
2978
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2504
2979
|
*/
|
|
2505
2980
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2527,6 +3002,18 @@
|
|
|
2527
3002
|
*
|
|
2528
3003
|
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2529
3004
|
* ```
|
|
3005
|
+
* @example
|
|
3006
|
+
* ```js
|
|
3007
|
+
* // Download as XLSX from answer context
|
|
3008
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3009
|
+
* appEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Answer);
|
|
3010
|
+
* ```
|
|
3011
|
+
* @example
|
|
3012
|
+
* ```js
|
|
3013
|
+
* // Download as XLSX from search context
|
|
3014
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3015
|
+
* searchEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Search);
|
|
3016
|
+
* ```
|
|
2530
3017
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2531
3018
|
*/
|
|
2532
3019
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2540,6 +3027,18 @@
|
|
|
2540
3027
|
* ```js
|
|
2541
3028
|
* searchEmbed.trigger(HostEvent.Share)
|
|
2542
3029
|
* ```
|
|
3030
|
+
* @example
|
|
3031
|
+
* ```js
|
|
3032
|
+
* // Share from Liveboard context
|
|
3033
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3034
|
+
* liveboardEmbed.trigger(HostEvent.Share, {}, ContextType.Liveboard);
|
|
3035
|
+
* ```
|
|
3036
|
+
* @example
|
|
3037
|
+
* ```js
|
|
3038
|
+
* // Share from search-answer context
|
|
3039
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3040
|
+
* appEmbed.trigger(HostEvent.Share, {}, ContextType.Search);
|
|
3041
|
+
* ```
|
|
2543
3042
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2544
3043
|
*/
|
|
2545
3044
|
HostEvent["Share"] = "share";
|
|
@@ -2579,6 +3078,18 @@
|
|
|
2579
3078
|
*
|
|
2580
3079
|
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2581
3080
|
* ```
|
|
3081
|
+
* @example
|
|
3082
|
+
* ```js
|
|
3083
|
+
* // Save from answer context
|
|
3084
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3085
|
+
* appEmbed.trigger(HostEvent.Save, {}, ContextType.Answer);
|
|
3086
|
+
* ```
|
|
3087
|
+
* @example
|
|
3088
|
+
* ```js
|
|
3089
|
+
* // Save from search context
|
|
3090
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3091
|
+
* searchEmbed.trigger(HostEvent.Save, {}, ContextType.Search);
|
|
3092
|
+
* ```
|
|
2582
3093
|
*
|
|
2583
3094
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2584
3095
|
*/
|
|
@@ -2595,6 +3106,20 @@
|
|
|
2595
3106
|
* ```js
|
|
2596
3107
|
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
2597
3108
|
* ```
|
|
3109
|
+
* @example
|
|
3110
|
+
* ```js
|
|
3111
|
+
* // Sync to sheets from answer context
|
|
3112
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3113
|
+
* appEmbed.trigger(HostEvent.SyncToSheets, {}, ContextType.Answer);
|
|
3114
|
+
* ```
|
|
3115
|
+
* @example
|
|
3116
|
+
* ```js
|
|
3117
|
+
* // Sync to sheets from liveboard context
|
|
3118
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3119
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {
|
|
3120
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3121
|
+
* }, ContextType.Liveboard);
|
|
3122
|
+
* ```
|
|
2598
3123
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2599
3124
|
*/
|
|
2600
3125
|
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
@@ -2611,6 +3136,20 @@
|
|
|
2611
3136
|
* ```js
|
|
2612
3137
|
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
2613
3138
|
* ```
|
|
3139
|
+
* @example
|
|
3140
|
+
* ```js
|
|
3141
|
+
* // Sync to other apps from answer context
|
|
3142
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3143
|
+
* appEmbed.trigger(HostEvent.SyncToOtherApps, {}, ContextType.Answer);
|
|
3144
|
+
* ```
|
|
3145
|
+
* @example
|
|
3146
|
+
* ```js
|
|
3147
|
+
* // Sync to other apps from liveboard context
|
|
3148
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3149
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {
|
|
3150
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3151
|
+
* }, ContextType.Liveboard);
|
|
3152
|
+
* ```
|
|
2614
3153
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2615
3154
|
*/
|
|
2616
3155
|
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
@@ -2627,6 +3166,20 @@
|
|
|
2627
3166
|
* ```js
|
|
2628
3167
|
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
2629
3168
|
* ```
|
|
3169
|
+
* @example
|
|
3170
|
+
* ```js
|
|
3171
|
+
* // Manage pipelines from answer context
|
|
3172
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3173
|
+
* appEmbed.trigger(HostEvent.ManagePipelines, {}, ContextType.Answer);
|
|
3174
|
+
* ```
|
|
3175
|
+
* @example
|
|
3176
|
+
* ```js
|
|
3177
|
+
* // Manage pipelines from liveboard context
|
|
3178
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3179
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {
|
|
3180
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3181
|
+
* }, ContextType.Liveboard);
|
|
3182
|
+
* ```
|
|
2630
3183
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2631
3184
|
*/
|
|
2632
3185
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
@@ -2639,6 +3192,12 @@
|
|
|
2639
3192
|
* ```js
|
|
2640
3193
|
* appEmbed.trigger(HostEvent.ResetSearch)
|
|
2641
3194
|
* ```
|
|
3195
|
+
* @example
|
|
3196
|
+
* ```js
|
|
3197
|
+
* // Reset search from search context
|
|
3198
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3199
|
+
* searchEmbed.trigger(HostEvent.ResetSearch, {}, ContextType.Search);
|
|
3200
|
+
* ```
|
|
2642
3201
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
|
|
2643
3202
|
*/
|
|
2644
3203
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
@@ -2650,6 +3209,13 @@
|
|
|
2650
3209
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
2651
3210
|
* console.log('data', data);
|
|
2652
3211
|
* ```
|
|
3212
|
+
* @example
|
|
3213
|
+
* ```js
|
|
3214
|
+
* // Get filters from liveboard context
|
|
3215
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3216
|
+
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters, {}, ContextType.Liveboard);
|
|
3217
|
+
* console.log('filters', data);
|
|
3218
|
+
* ```
|
|
2653
3219
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2654
3220
|
*/
|
|
2655
3221
|
HostEvent["GetFilters"] = "getFilters";
|
|
@@ -2657,7 +3223,8 @@
|
|
|
2657
3223
|
* Update one or several filters applied on a Liveboard.
|
|
2658
3224
|
* @param - Includes the following keys:
|
|
2659
3225
|
* - `filter`: A single filter object containing column name, filter operator, and
|
|
2660
|
-
* values.
|
|
3226
|
+
* values.
|
|
3227
|
+
* - `filters`: Multiple filter objects with column name, filter operator,
|
|
2661
3228
|
* and values for each.
|
|
2662
3229
|
*
|
|
2663
3230
|
* Each filter object must include the following attributes:
|
|
@@ -2740,6 +3307,18 @@
|
|
|
2740
3307
|
* }]
|
|
2741
3308
|
* });
|
|
2742
3309
|
* ```
|
|
3310
|
+
* @example
|
|
3311
|
+
* ```js
|
|
3312
|
+
* // Update filters from liveboard context
|
|
3313
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3314
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
3315
|
+
* filter: {
|
|
3316
|
+
* column: "item type",
|
|
3317
|
+
* oper: "IN",
|
|
3318
|
+
* values: ["shoes", "boots"]
|
|
3319
|
+
* }
|
|
3320
|
+
* }, ContextType.Liveboard);
|
|
3321
|
+
* ```
|
|
2743
3322
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2744
3323
|
*/
|
|
2745
3324
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2753,6 +3332,14 @@
|
|
|
2753
3332
|
* );
|
|
2754
3333
|
* })
|
|
2755
3334
|
* ```
|
|
3335
|
+
* @example
|
|
3336
|
+
* ```js
|
|
3337
|
+
* // Get tabs from liveboard context
|
|
3338
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3339
|
+
* liveboardEmbed.trigger(HostEvent.GetTabs, {}, ContextType.Liveboard).then((tabDetails) => {
|
|
3340
|
+
* console.log('tabs', tabDetails);
|
|
3341
|
+
* });
|
|
3342
|
+
* ```
|
|
2756
3343
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
|
|
2757
3344
|
*/
|
|
2758
3345
|
HostEvent["GetTabs"] = "getTabs";
|
|
@@ -2766,6 +3353,15 @@
|
|
|
2766
3353
|
* '430496d6-6903-4601-937e-2c691821af3c',
|
|
2767
3354
|
* 'f547ec54-2a37-4516-a222-2b06719af726'])
|
|
2768
3355
|
* ```
|
|
3356
|
+
* @example
|
|
3357
|
+
* ```js
|
|
3358
|
+
* // Set visible tabs from liveboard context
|
|
3359
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3360
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
|
|
3361
|
+
* '430496d6-6903-4601-937e-2c691821af3c',
|
|
3362
|
+
* 'f547ec54-2a37-4516-a222-2b06719af726'
|
|
3363
|
+
* ], ContextType.Liveboard);
|
|
3364
|
+
* ```
|
|
2769
3365
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
2770
3366
|
*/
|
|
2771
3367
|
HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
|
|
@@ -2779,6 +3375,15 @@
|
|
|
2779
3375
|
* '630496d6-6903-4601-937e-2c691821af3c',
|
|
2780
3376
|
* 'i547ec54-2a37-4516-a222-2b06719af726'])
|
|
2781
3377
|
* ```
|
|
3378
|
+
* @example
|
|
3379
|
+
* ```js
|
|
3380
|
+
* // Set hidden tabs from liveboard context
|
|
3381
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3382
|
+
* liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
|
|
3383
|
+
* '630496d6-6903-4601-937e-2c691821af3c',
|
|
3384
|
+
* 'i547ec54-2a37-4516-a222-2b06719af726'
|
|
3385
|
+
* ], ContextType.Liveboard);
|
|
3386
|
+
* ```
|
|
2782
3387
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
|
|
2783
3388
|
*/
|
|
2784
3389
|
HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
|
|
@@ -2855,13 +3460,24 @@
|
|
|
2855
3460
|
HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
|
|
2856
3461
|
/**
|
|
2857
3462
|
* Trigger reset action for a personalized Liveboard view.
|
|
3463
|
+
* This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
|
|
2858
3464
|
* @example
|
|
2859
3465
|
* ```js
|
|
2860
3466
|
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
|
|
2861
3467
|
* ```
|
|
2862
3468
|
* @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw
|
|
3469
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
2863
3470
|
*/
|
|
2864
3471
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
3472
|
+
/**
|
|
3473
|
+
* Trigger reset action for a personalized Liveboard view.
|
|
3474
|
+
* @example
|
|
3475
|
+
* ```js
|
|
3476
|
+
* liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalizedView);
|
|
3477
|
+
* ```
|
|
3478
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3479
|
+
*/
|
|
3480
|
+
HostEvent["ResetLiveboardPersonalizedView"] = "ResetLiveboardPersonalisedView";
|
|
2865
3481
|
/**
|
|
2866
3482
|
* Triggers an action to update Parameter values on embedded
|
|
2867
3483
|
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
@@ -2878,6 +3494,16 @@
|
|
|
2878
3494
|
* isVisibleToUser: false
|
|
2879
3495
|
* }])
|
|
2880
3496
|
* ```
|
|
3497
|
+
* @example
|
|
3498
|
+
* ```js
|
|
3499
|
+
* // Update parameters from liveboard context
|
|
3500
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3501
|
+
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
3502
|
+
* name: "Region Param",
|
|
3503
|
+
* value: "West",
|
|
3504
|
+
* isVisibleToUser: true
|
|
3505
|
+
* }], ContextType.Liveboard);
|
|
3506
|
+
* ```
|
|
2881
3507
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2882
3508
|
*/
|
|
2883
3509
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -2897,18 +3523,77 @@
|
|
|
2897
3523
|
* });
|
|
2898
3524
|
*
|
|
2899
3525
|
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
3526
|
+
*```
|
|
3527
|
+
* @example
|
|
3528
|
+
* ```js
|
|
3529
|
+
* // Get parameters from liveboard context
|
|
3530
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3531
|
+
* liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
|
|
3532
|
+
* console.log('parameters', parameters);
|
|
3533
|
+
* });
|
|
2900
3534
|
* ```
|
|
2901
3535
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2902
3536
|
*/
|
|
2903
3537
|
HostEvent["GetParameters"] = "GetParameters";
|
|
2904
3538
|
/**
|
|
2905
3539
|
* Triggers an event to update a personalized view of a Liveboard.
|
|
3540
|
+
* This event is deprecated. Use {@link HostEvent.UpdatePersonalizedView} instead.
|
|
2906
3541
|
* ```js
|
|
2907
3542
|
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
2908
3543
|
* ```
|
|
3544
|
+
* @example
|
|
3545
|
+
* ```js
|
|
3546
|
+
* // Update personalized view from liveboard context
|
|
3547
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3548
|
+
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {
|
|
3549
|
+
* viewId: '1234'
|
|
3550
|
+
* }, ContextType.Liveboard);
|
|
3551
|
+
* ```
|
|
2909
3552
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3553
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
2910
3554
|
*/
|
|
2911
3555
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
3556
|
+
/**
|
|
3557
|
+
* Triggers an event to update a personalized view of a Liveboard.
|
|
3558
|
+
* ```js
|
|
3559
|
+
* liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
|
|
3560
|
+
* ```
|
|
3561
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3562
|
+
*/
|
|
3563
|
+
HostEvent["UpdatePersonalizedView"] = "UpdatePersonalisedView";
|
|
3564
|
+
/**
|
|
3565
|
+
* Triggers selection of a specific Personalized View on a
|
|
3566
|
+
* Liveboard without reloading the embed. Pass either a
|
|
3567
|
+
* `viewId` (GUID) or `viewName`. If both are provided, `viewId` takes precedence.
|
|
3568
|
+
* If neither is provided, the Liveboard resets to the original/default view.
|
|
3569
|
+
* When a `viewName` is provided and multiple views share
|
|
3570
|
+
* the same name, the first match is selected.
|
|
3571
|
+
* @example
|
|
3572
|
+
* ```js
|
|
3573
|
+
* liveboardEmbed.trigger(
|
|
3574
|
+
* HostEvent.SelectPersonalizedView,
|
|
3575
|
+
* { viewId: '2a021a12-1aed-425d-984b-141ee916ce72' },
|
|
3576
|
+
* )
|
|
3577
|
+
* ```
|
|
3578
|
+
* @example
|
|
3579
|
+
* ```js
|
|
3580
|
+
* // Select by name
|
|
3581
|
+
* liveboardEmbed.trigger(
|
|
3582
|
+
* HostEvent.SelectPersonalizedView,
|
|
3583
|
+
* { viewName: 'Dr Smith Cardiology' },
|
|
3584
|
+
* )
|
|
3585
|
+
* ```
|
|
3586
|
+
* @example
|
|
3587
|
+
* ```js
|
|
3588
|
+
* // Reset to default view
|
|
3589
|
+
* liveboardEmbed.trigger(
|
|
3590
|
+
* HostEvent.SelectPersonalizedView,
|
|
3591
|
+
* {},
|
|
3592
|
+
* )
|
|
3593
|
+
* ```
|
|
3594
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
3595
|
+
*/
|
|
3596
|
+
HostEvent["SelectPersonalizedView"] = "SelectPersonalisedView";
|
|
2912
3597
|
/**
|
|
2913
3598
|
* @hidden
|
|
2914
3599
|
* Notify when info call is completed successfully
|
|
@@ -2928,7 +3613,8 @@
|
|
|
2928
3613
|
* add a name and description for the Answer.
|
|
2929
3614
|
* @param - Includes the following keys:
|
|
2930
3615
|
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
2931
|
-
* embed.
|
|
3616
|
+
* embed.
|
|
3617
|
+
* - `name`: Optional. Name string for the Answer.
|
|
2932
3618
|
* - `description`: Optional. Description text for the Answer.
|
|
2933
3619
|
* @example
|
|
2934
3620
|
* ```js
|
|
@@ -2947,6 +3633,34 @@
|
|
|
2947
3633
|
*
|
|
2948
3634
|
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
2949
3635
|
* ```
|
|
3636
|
+
* @example
|
|
3637
|
+
* ```js
|
|
3638
|
+
* // Using context parameter to save answer from search context
|
|
3639
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3640
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3641
|
+
* name: "Regional sales analysis",
|
|
3642
|
+
* description: "Sales breakdown by region"
|
|
3643
|
+
* }, ContextType.Search);
|
|
3644
|
+
* ```
|
|
3645
|
+
* @example
|
|
3646
|
+
* ```js
|
|
3647
|
+
* // Save answer from answer context (explore modal)
|
|
3648
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3649
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3650
|
+
* name: "Modified analysis",
|
|
3651
|
+
* description: "Updated from explore view"
|
|
3652
|
+
* }, ContextType.Answer);
|
|
3653
|
+
* ```
|
|
3654
|
+
* @example
|
|
3655
|
+
* ```js
|
|
3656
|
+
* // Save answer from spotter context
|
|
3657
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3658
|
+
* const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3659
|
+
* vizId: latestSpotterVizId,
|
|
3660
|
+
* name: "AI insights",
|
|
3661
|
+
* description: "Generated from Spotter"
|
|
3662
|
+
* }, ContextType.Spotter);
|
|
3663
|
+
* ```
|
|
2950
3664
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2951
3665
|
*/
|
|
2952
3666
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -2988,6 +3702,15 @@
|
|
|
2988
3702
|
* executeSearch: true,
|
|
2989
3703
|
* })
|
|
2990
3704
|
* ```
|
|
3705
|
+
* @example
|
|
3706
|
+
* ```js
|
|
3707
|
+
* // Spotter search from spotter context
|
|
3708
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3709
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
3710
|
+
* query: 'sales by region',
|
|
3711
|
+
* executeSearch: true
|
|
3712
|
+
* }, ContextType.Spotter);
|
|
3713
|
+
* ```
|
|
2991
3714
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2992
3715
|
*/
|
|
2993
3716
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
@@ -2998,6 +3721,12 @@
|
|
|
2998
3721
|
* ```js
|
|
2999
3722
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3000
3723
|
* ```
|
|
3724
|
+
* @example
|
|
3725
|
+
* ```js
|
|
3726
|
+
* // Edit last prompt from spotter context
|
|
3727
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3728
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "sales by region", ContextType.Spotter);
|
|
3729
|
+
* ```
|
|
3001
3730
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3002
3731
|
*/
|
|
3003
3732
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
@@ -3007,6 +3736,12 @@
|
|
|
3007
3736
|
* ```js
|
|
3008
3737
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3009
3738
|
* ```
|
|
3739
|
+
* @example
|
|
3740
|
+
* ```js
|
|
3741
|
+
* // Preview spotter data from spotter context
|
|
3742
|
+
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
3743
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData, {}, ContextType.Spotter);
|
|
3744
|
+
* ```
|
|
3010
3745
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3011
3746
|
*/
|
|
3012
3747
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
@@ -3297,6 +4032,7 @@
|
|
|
3297
4032
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3298
4033
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3299
4034
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
4035
|
+
Param["IsWYSIWYGLiveboardPDFEnabled"] = "isWYSIWYGLiveboardPDFEnabled";
|
|
3300
4036
|
Param["isLiveboardXLSXCSVDownloadEnabled"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3301
4037
|
Param["isGranularXLSXCSVSchedulesEnabled"] = "isGranularXLSXCSVSchedulesEnabled";
|
|
3302
4038
|
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
@@ -3641,6 +4377,16 @@
|
|
|
3641
4377
|
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3642
4378
|
*/
|
|
3643
4379
|
Action["DownloadLiveboard"] = "downloadLiveboard";
|
|
4380
|
+
/**
|
|
4381
|
+
* The **Download Liveboard as Continuous PDF** menu action on a Liveboard.
|
|
4382
|
+
* Allows downloading the entire Liveboard as a continuous PDF.
|
|
4383
|
+
* @example
|
|
4384
|
+
* ```js
|
|
4385
|
+
* disabledActions: [Action.DownloadLiveboardAsContinuousPDF]
|
|
4386
|
+
* ```
|
|
4387
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4388
|
+
*/
|
|
4389
|
+
Action["DownloadLiveboardAsContinuousPDF"] = "downloadLiveboardAsContinuousPDF";
|
|
3644
4390
|
/**
|
|
3645
4391
|
* @hidden
|
|
3646
4392
|
*/
|
|
@@ -3765,6 +4511,7 @@
|
|
|
3765
4511
|
* disabledActions: [Action.LiveboardInfo]
|
|
3766
4512
|
* ```
|
|
3767
4513
|
*/
|
|
4514
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
3768
4515
|
Action["LiveboardInfo"] = "pinboardInfo";
|
|
3769
4516
|
/**
|
|
3770
4517
|
* @hidden
|
|
@@ -3795,6 +4542,7 @@
|
|
|
3795
4542
|
* disabledActions: [Action.Subscription]
|
|
3796
4543
|
* ```
|
|
3797
4544
|
*/
|
|
4545
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
|
3798
4546
|
Action["Subscription"] = "subscription";
|
|
3799
4547
|
/**
|
|
3800
4548
|
* The **Explore** action on Liveboard visualizations
|
|
@@ -4274,13 +5022,25 @@
|
|
|
4274
5022
|
/**
|
|
4275
5023
|
* The Liveboard Personalised Views dropdown.
|
|
4276
5024
|
* Allows navigating to a personalized Liveboard View.
|
|
5025
|
+
* This action is deprecated. Use {@link Action.PersonalizedViewsDropdown} instead.
|
|
4277
5026
|
* @example
|
|
4278
5027
|
* ```js
|
|
4279
5028
|
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
4280
5029
|
* ```
|
|
4281
5030
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
|
|
5031
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4282
5032
|
*/
|
|
4283
5033
|
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
5034
|
+
/**
|
|
5035
|
+
* The Liveboard Personalized Views dropdown.
|
|
5036
|
+
* Allows navigating to a personalized Liveboard View.
|
|
5037
|
+
* @example
|
|
5038
|
+
* ```js
|
|
5039
|
+
* disabledActions: [Action.PersonalizedViewsDropdown]
|
|
5040
|
+
* ```
|
|
5041
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
5042
|
+
*/
|
|
5043
|
+
Action["PersonalizedViewsDropdown"] = "personalisedViewsDropdown";
|
|
4284
5044
|
/**
|
|
4285
5045
|
* Action ID for show or hide the user details on a
|
|
4286
5046
|
* Liveboard (Recently visited / social proof)
|
|
@@ -4368,14 +5128,27 @@
|
|
|
4368
5128
|
/**
|
|
4369
5129
|
* The **Organize Favourites** action on Homepage
|
|
4370
5130
|
* *Favorites* module.
|
|
5131
|
+
* This action is deprecated. Use {@link Action.OrganizeFavorites} instead.
|
|
4371
5132
|
*
|
|
4372
5133
|
* @example
|
|
4373
5134
|
* ```js
|
|
4374
5135
|
* disabledActions: [Action.OrganiseFavourites]
|
|
4375
5136
|
* ```
|
|
4376
5137
|
* @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
|
|
5138
|
+
* @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
4377
5139
|
*/
|
|
4378
5140
|
Action["OrganiseFavourites"] = "organiseFavourites";
|
|
5141
|
+
/**
|
|
5142
|
+
* The **Organize Favorites** action on Homepage
|
|
5143
|
+
* *Favorites* module.
|
|
5144
|
+
*
|
|
5145
|
+
* @example
|
|
5146
|
+
* ```js
|
|
5147
|
+
* disabledActions: [Action.OrganizeFavorites]
|
|
5148
|
+
* ```
|
|
5149
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
5150
|
+
*/
|
|
5151
|
+
Action["OrganizeFavorites"] = "organiseFavourites";
|
|
4379
5152
|
/**
|
|
4380
5153
|
* The **AI Highlights** action on a Liveboard.
|
|
4381
5154
|
*
|
|
@@ -4831,6 +5604,39 @@
|
|
|
4831
5604
|
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
4832
5605
|
*/
|
|
4833
5606
|
Action["SpotterDocs"] = "spotterDocs";
|
|
5607
|
+
/**
|
|
5608
|
+
* Controls visibility and disable state of the connector resources
|
|
5609
|
+
* section in the Spotter chat interface.
|
|
5610
|
+
* @example
|
|
5611
|
+
* ```js
|
|
5612
|
+
* hiddenActions: [Action.SpotterChatConnectorResources]
|
|
5613
|
+
* disabledActions: [Action.SpotterChatConnectorResources]
|
|
5614
|
+
* ```
|
|
5615
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5616
|
+
*/
|
|
5617
|
+
Action["SpotterChatConnectorResources"] = "spotterChatConnectorResources";
|
|
5618
|
+
/**
|
|
5619
|
+
* Controls visibility and disable state of the connectors
|
|
5620
|
+
* in the Spotter chat interface.
|
|
5621
|
+
* @example
|
|
5622
|
+
* ```js
|
|
5623
|
+
* hiddenActions: [Action.SpotterChatConnectors]
|
|
5624
|
+
* disabledActions: [Action.SpotterChatConnectors]
|
|
5625
|
+
* ```
|
|
5626
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5627
|
+
*/
|
|
5628
|
+
Action["SpotterChatConnectors"] = "spotterChatConnectors";
|
|
5629
|
+
/**
|
|
5630
|
+
* Controls visibility and disable state of the mode switcher
|
|
5631
|
+
* in the Spotter chat interface.
|
|
5632
|
+
* @example
|
|
5633
|
+
* ```js
|
|
5634
|
+
* hiddenActions: [Action.SpotterChatModeSwitcher]
|
|
5635
|
+
* disabledActions: [Action.SpotterChatModeSwitcher]
|
|
5636
|
+
* ```
|
|
5637
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5638
|
+
*/
|
|
5639
|
+
Action["SpotterChatModeSwitcher"] = "spotterChatModeSwitcher";
|
|
4834
5640
|
/**
|
|
4835
5641
|
* The **Include current period** checkbox for date filters.
|
|
4836
5642
|
* Controls the visibility and availability of the option to include
|
|
@@ -5124,7 +5930,29 @@
|
|
|
5124
5930
|
EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
|
|
5125
5931
|
/** Invalid URL provided in configuration */
|
|
5126
5932
|
EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
|
|
5933
|
+
/** Host event payload validation failed */
|
|
5934
|
+
EmbedErrorCodes["HOST_EVENT_VALIDATION"] = "HOST_EVENT_VALIDATION";
|
|
5935
|
+
/** UpdateFilters payload is invalid - missing or malformed filter/filters */
|
|
5936
|
+
EmbedErrorCodes["UPDATEFILTERS_INVALID_PAYLOAD"] = "UPDATEFILTERS_INVALID_PAYLOAD";
|
|
5937
|
+
/** DrillDown payload is invalid - missing or malformed points */
|
|
5938
|
+
EmbedErrorCodes["DRILLDOWN_INVALID_PAYLOAD"] = "DRILLDOWN_INVALID_PAYLOAD";
|
|
5127
5939
|
})(exports.EmbedErrorCodes || (exports.EmbedErrorCodes = {}));
|
|
5940
|
+
/**
|
|
5941
|
+
* Context types for specifying the page context when triggering host events.
|
|
5942
|
+
* Used as the third parameter in the `trigger` method to help ThoughtSpot
|
|
5943
|
+
* understand the current page context for better event handling.
|
|
5944
|
+
*
|
|
5945
|
+
* @example
|
|
5946
|
+
* ```js
|
|
5947
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
5948
|
+
*
|
|
5949
|
+
* // Trigger an event with specific context
|
|
5950
|
+
* embed.trigger(HostEvent.Pin, { vizId: "123", liveboardId: "456" }, ContextType.Search);
|
|
5951
|
+
* ```
|
|
5952
|
+
*
|
|
5953
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
5954
|
+
* @group Events
|
|
5955
|
+
*/
|
|
5128
5956
|
exports.ContextType = void 0;
|
|
5129
5957
|
(function (ContextType) {
|
|
5130
5958
|
/**
|
|
@@ -5143,6 +5971,10 @@
|
|
|
5143
5971
|
* Spotter context for spotter modal/page.
|
|
5144
5972
|
*/
|
|
5145
5973
|
ContextType["Spotter"] = "spotter";
|
|
5974
|
+
/**
|
|
5975
|
+
* Other context for any other generic page.
|
|
5976
|
+
*/
|
|
5977
|
+
ContextType["Other"] = "other";
|
|
5146
5978
|
})(exports.ContextType || (exports.ContextType = {}));
|
|
5147
5979
|
/**
|
|
5148
5980
|
* Enum for the type of API intercepted
|
|
@@ -5318,6 +6150,8 @@
|
|
|
5318
6150
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
5319
6151
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
5320
6152
|
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
6153
|
+
UPDATEFILTERS_INVALID_PAYLOAD: 'UpdateFilters requires a valid filter or filters array. Expected: { filter: { column, oper, values } } or { filters: [{ column, oper, values }, ...] }',
|
|
6154
|
+
DRILLDOWN_INVALID_PAYLOAD: 'DrillDown requires a valid points object. Expected: { points: { clickedPoint?, selectedPoints? }, autoDrillDown?, vizId? }',
|
|
5321
6155
|
};
|
|
5322
6156
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
5323
6157
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -5821,14 +6655,6 @@
|
|
|
5821
6655
|
return [false, error instanceof Error ? error : new Error(String(error))];
|
|
5822
6656
|
}
|
|
5823
6657
|
};
|
|
5824
|
-
/**
|
|
5825
|
-
* Resolves enablePastConversationsSidebar with
|
|
5826
|
-
* spotterSidebarConfig taking precedence over the
|
|
5827
|
-
* standalone flag.
|
|
5828
|
-
*/
|
|
5829
|
-
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
5830
|
-
? params.spotterSidebarConfigValue
|
|
5831
|
-
: params.standaloneValue);
|
|
5832
6658
|
/**
|
|
5833
6659
|
* Sets a query parameter if the value is defined.
|
|
5834
6660
|
* @param queryParams - The query params object to modify
|
|
@@ -8125,6 +8951,15 @@
|
|
|
8125
8951
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
8126
8952
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
8127
8953
|
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
8954
|
+
UIPassthroughEvent["UpdateFilters"] = "updateFilters";
|
|
8955
|
+
UIPassthroughEvent["Drilldown"] = "drillDown";
|
|
8956
|
+
UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
|
|
8957
|
+
UIPassthroughEvent["GetFilters"] = "getFilters";
|
|
8958
|
+
UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
|
|
8959
|
+
UIPassthroughEvent["GetParameters"] = "getParameters";
|
|
8960
|
+
UIPassthroughEvent["GetTML"] = "getTML";
|
|
8961
|
+
UIPassthroughEvent["GetTabs"] = "getTabs";
|
|
8962
|
+
UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
8128
8963
|
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
8129
8964
|
|
|
8130
8965
|
const EndPoints = {
|
|
@@ -8758,9 +9593,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
8758
9593
|
* You can use this service to:
|
|
8759
9594
|
*
|
|
8760
9595
|
* - Add or remove columns from Answers (`addColumns`, `removeColumns`,
|
|
8761
|
-
* `addColumnsByName`)
|
|
9596
|
+
* `addColumnsByName`)
|
|
9597
|
+
* - Apply filters to Answers (`addFilter`)
|
|
8762
9598
|
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
|
|
8763
|
-
* `fetchCSVBlob`, `fetchPNGBlob`)
|
|
9599
|
+
* `fetchCSVBlob`, `fetchPNGBlob`)
|
|
9600
|
+
* - Get data for specific points in visualizations
|
|
8764
9601
|
* (`getUnderlyingDataForPoint`)
|
|
8765
9602
|
* - Run custom queries (`executeQuery`)
|
|
8766
9603
|
* - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
|
|
@@ -17522,7 +18359,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17522
18359
|
/**
|
|
17523
18360
|
* The current authentication token or session has expired.
|
|
17524
18361
|
*
|
|
17525
|
-
* Emitted when the embed receives an auth-expiry signal and starts auth refresh
|
|
18362
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh
|
|
18363
|
+
* handling.
|
|
17526
18364
|
*/
|
|
17527
18365
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17528
18366
|
/**
|
|
@@ -18535,11 +19373,79 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18535
19373
|
return eventData;
|
|
18536
19374
|
}
|
|
18537
19375
|
|
|
18538
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.
|
|
19376
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js && node dts-config/wrap-ambient-module.mjs","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 || echo 'Warning: Coveralls upload failed but not breaking the build.'","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.59.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"34 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};
|
|
19377
|
+
|
|
19378
|
+
function isValidUpdateFiltersPayload(payload) {
|
|
19379
|
+
if (!payload)
|
|
19380
|
+
return false;
|
|
19381
|
+
const isValidFilter = (f) => !!f && typeof f.column === 'string' && typeof f.oper === 'string' && Array.isArray(f.values);
|
|
19382
|
+
const hasValidFilter = payload.filter && isValidFilter(payload.filter);
|
|
19383
|
+
const hasValidFilters = Array.isArray(payload.filters) && payload.filters.length > 0 && payload.filters.every(isValidFilter);
|
|
19384
|
+
return !!(hasValidFilter || hasValidFilters);
|
|
19385
|
+
}
|
|
19386
|
+
function isValidDrillDownPayload(payload) {
|
|
19387
|
+
if (!payload)
|
|
19388
|
+
return false;
|
|
19389
|
+
const points = payload.points;
|
|
19390
|
+
if (!points || typeof points !== 'object')
|
|
19391
|
+
return false;
|
|
19392
|
+
const hasClickedPoint = 'clickedPoint' in points && points.clickedPoint != null;
|
|
19393
|
+
const hasSelectedPoints = Array.isArray(points.selectedPoints) && points.selectedPoints.length > 0;
|
|
19394
|
+
return hasClickedPoint || hasSelectedPoints;
|
|
19395
|
+
}
|
|
19396
|
+
function createValidationError(message) {
|
|
19397
|
+
const err = new Error(message);
|
|
19398
|
+
err.isValidationError = true;
|
|
19399
|
+
err.embedErrorDetails = {
|
|
19400
|
+
type: exports.EmbedEvent.Error,
|
|
19401
|
+
data: {
|
|
19402
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19403
|
+
message,
|
|
19404
|
+
code: exports.EmbedErrorCodes.HOST_EVENT_VALIDATION,
|
|
19405
|
+
error: message
|
|
19406
|
+
},
|
|
19407
|
+
status: embedEventStatus.END
|
|
19408
|
+
};
|
|
19409
|
+
throw err;
|
|
19410
|
+
}
|
|
19411
|
+
function throwUpdateFiltersValidationError() {
|
|
19412
|
+
createValidationError(ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD);
|
|
19413
|
+
}
|
|
19414
|
+
function throwDrillDownValidationError() {
|
|
19415
|
+
createValidationError(ERROR_MESSAGE.DRILLDOWN_INVALID_PAYLOAD);
|
|
19416
|
+
}
|
|
18539
19417
|
|
|
19418
|
+
/**
|
|
19419
|
+
* Maps HostEvent to its corresponding UIPassthroughEvent.
|
|
19420
|
+
* Includes both custom-handler events (Pin, SaveAnswer, UpdateFilters, DrillDown)
|
|
19421
|
+
* and getter events (GetAnswerSession, GetFilters, etc.) that use getDataWithPassthroughFallback.
|
|
19422
|
+
*/
|
|
19423
|
+
const PASSTHROUGH_MAP = {
|
|
19424
|
+
// Custom handlers (setters with special logic)
|
|
19425
|
+
[exports.HostEvent.Pin]: exports.UIPassthroughEvent.PinAnswerToLiveboard,
|
|
19426
|
+
[exports.HostEvent.SaveAnswer]: exports.UIPassthroughEvent.SaveAnswer,
|
|
19427
|
+
[exports.HostEvent.UpdateFilters]: exports.UIPassthroughEvent.UpdateFilters,
|
|
19428
|
+
[exports.HostEvent.DrillDown]: exports.UIPassthroughEvent.Drilldown,
|
|
19429
|
+
// Getters (use getDataWithPassthroughFallback)
|
|
19430
|
+
[exports.HostEvent.GetAnswerSession]: exports.UIPassthroughEvent.GetAnswerSession,
|
|
19431
|
+
[exports.HostEvent.GetFilters]: exports.UIPassthroughEvent.GetFilters,
|
|
19432
|
+
[exports.HostEvent.GetIframeUrl]: exports.UIPassthroughEvent.GetIframeUrl,
|
|
19433
|
+
[exports.HostEvent.GetParameters]: exports.UIPassthroughEvent.GetParameters,
|
|
19434
|
+
[exports.HostEvent.GetTML]: exports.UIPassthroughEvent.GetTML,
|
|
19435
|
+
[exports.HostEvent.GetTabs]: exports.UIPassthroughEvent.GetTabs,
|
|
19436
|
+
[exports.HostEvent.getExportRequestForCurrentPinboard]: exports.UIPassthroughEvent.GetExportRequestForCurrentPinboard,
|
|
19437
|
+
};
|
|
18540
19438
|
class HostEventClient {
|
|
18541
19439
|
constructor(iFrame) {
|
|
19440
|
+
/** Cached list of available UI passthrough keys from the embedded app */
|
|
19441
|
+
this.availablePassthroughKeysCache = null;
|
|
18542
19442
|
this.iFrame = iFrame;
|
|
19443
|
+
this.customHandlers = {
|
|
19444
|
+
[exports.HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
|
|
19445
|
+
[exports.HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
|
|
19446
|
+
[exports.HostEvent.UpdateFilters]: (p, c) => this.handleUpdateFiltersEvent(p, c),
|
|
19447
|
+
[exports.HostEvent.DrillDown]: (p, c) => this.handleDrillDownEvent(p, c),
|
|
19448
|
+
};
|
|
18543
19449
|
}
|
|
18544
19450
|
/**
|
|
18545
19451
|
* A wrapper over process trigger to
|
|
@@ -18556,7 +19462,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18556
19462
|
}
|
|
18557
19463
|
async handleHostEventWithParam(apiName, parameters, context) {
|
|
18558
19464
|
var _a, _b, _c, _d;
|
|
18559
|
-
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.
|
|
19465
|
+
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value);
|
|
18560
19466
|
if (!response) {
|
|
18561
19467
|
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
18562
19468
|
throw { error };
|
|
@@ -18565,13 +19471,35 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18565
19471
|
|| ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
|
|
18566
19472
|
|| ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
|
|
18567
19473
|
if (errors) {
|
|
18568
|
-
|
|
19474
|
+
const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
|
|
19475
|
+
throw { error: message };
|
|
18569
19476
|
}
|
|
18570
19477
|
return { ...response.value };
|
|
18571
19478
|
}
|
|
18572
19479
|
async hostEventFallback(hostEvent, data, context) {
|
|
18573
19480
|
return this.processTrigger(hostEvent, data, context);
|
|
18574
19481
|
}
|
|
19482
|
+
/**
|
|
19483
|
+
* For getter events that return data. Tries UI passthrough first;
|
|
19484
|
+
* if the app doesn't support it (no response data), falls back to
|
|
19485
|
+
* the legacy host event channel. Real errors are thrown as-is.
|
|
19486
|
+
*/
|
|
19487
|
+
async getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context) {
|
|
19488
|
+
var _a, _b, _c;
|
|
19489
|
+
const response = await this.triggerUIPassthroughApi(passthroughEvent, payload || {}, context);
|
|
19490
|
+
const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.error || r.value);
|
|
19491
|
+
if (!matched) {
|
|
19492
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
19493
|
+
}
|
|
19494
|
+
const errors = matched.error
|
|
19495
|
+
|| ((_b = matched.value) === null || _b === void 0 ? void 0 : _b.errors)
|
|
19496
|
+
|| ((_c = matched.value) === null || _c === void 0 ? void 0 : _c.error);
|
|
19497
|
+
if (errors) {
|
|
19498
|
+
const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
|
|
19499
|
+
throw new Error(message);
|
|
19500
|
+
}
|
|
19501
|
+
return { ...matched.value };
|
|
19502
|
+
}
|
|
18575
19503
|
/**
|
|
18576
19504
|
* Setter for the iframe element used for host events
|
|
18577
19505
|
* @param {HTMLIFrameElement} iFrame - the iframe element to set
|
|
@@ -18579,6 +19507,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18579
19507
|
setIframeElement(iFrame) {
|
|
18580
19508
|
this.iFrame = iFrame;
|
|
18581
19509
|
}
|
|
19510
|
+
/**
|
|
19511
|
+
* Fetches the list of available UI passthrough keys from the embedded app.
|
|
19512
|
+
* Result is cached for the session. Returns empty array on failure.
|
|
19513
|
+
*/
|
|
19514
|
+
async getAvailableUIPassthroughKeys(context) {
|
|
19515
|
+
var _a, _b;
|
|
19516
|
+
if (this.availablePassthroughKeysCache !== null) {
|
|
19517
|
+
return this.availablePassthroughKeysCache;
|
|
19518
|
+
}
|
|
19519
|
+
try {
|
|
19520
|
+
const response = await this.triggerUIPassthroughApi(exports.UIPassthroughEvent.GetAvailableUIPassthroughs, {}, context);
|
|
19521
|
+
const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.value && !r.error);
|
|
19522
|
+
const keys = (_b = matched === null || matched === void 0 ? void 0 : matched.value) === null || _b === void 0 ? void 0 : _b.keys;
|
|
19523
|
+
this.availablePassthroughKeysCache = Array.isArray(keys) ? keys : [];
|
|
19524
|
+
return this.availablePassthroughKeysCache;
|
|
19525
|
+
}
|
|
19526
|
+
catch {
|
|
19527
|
+
return [];
|
|
19528
|
+
}
|
|
19529
|
+
}
|
|
18582
19530
|
async triggerUIPassthroughApi(apiName, parameters, context) {
|
|
18583
19531
|
const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
|
|
18584
19532
|
type: apiName,
|
|
@@ -18614,15 +19562,41 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18614
19562
|
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,
|
|
18615
19563
|
};
|
|
18616
19564
|
}
|
|
19565
|
+
handleUpdateFiltersEvent(payload, context) {
|
|
19566
|
+
if (!isValidUpdateFiltersPayload(payload)) {
|
|
19567
|
+
throwUpdateFiltersValidationError();
|
|
19568
|
+
}
|
|
19569
|
+
return this.handleHostEventWithParam(exports.UIPassthroughEvent.UpdateFilters, payload, context);
|
|
19570
|
+
}
|
|
19571
|
+
handleDrillDownEvent(payload, context) {
|
|
19572
|
+
if (!isValidDrillDownPayload(payload)) {
|
|
19573
|
+
throwDrillDownValidationError();
|
|
19574
|
+
}
|
|
19575
|
+
return this.handleHostEventWithParam(exports.UIPassthroughEvent.Drilldown, payload, context);
|
|
19576
|
+
}
|
|
19577
|
+
/**
|
|
19578
|
+
* Dispatches a host event using the appropriate channel:
|
|
19579
|
+
* 1. If the embedded app supports UI passthrough for this event, use it (custom handler or getter).
|
|
19580
|
+
* 2. Otherwise fall back to the legacy host event channel.
|
|
19581
|
+
*
|
|
19582
|
+
* @param hostEvent - The host event to trigger
|
|
19583
|
+
* @param payload - Optional payload for the event
|
|
19584
|
+
* @param context - Optional context (e.g. vizId) for scoped operations
|
|
19585
|
+
*/
|
|
18617
19586
|
async triggerHostEvent(hostEvent, payload, context) {
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
return this.hostEventFallback(hostEvent, payload, context);
|
|
19587
|
+
const customHandler = this.customHandlers[hostEvent];
|
|
19588
|
+
const passthroughEvent = PASSTHROUGH_MAP[hostEvent];
|
|
19589
|
+
// If embedded app supports passthrough but not this event, use legacy channel
|
|
19590
|
+
const keys = passthroughEvent ? await this.getAvailableUIPassthroughKeys(context) : [];
|
|
19591
|
+
if (passthroughEvent && keys.length > 0 && !keys.includes(passthroughEvent)) {
|
|
19592
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
18625
19593
|
}
|
|
19594
|
+
// Custom handler (setters) > getter passthrough > legacy fallback
|
|
19595
|
+
return (customHandler
|
|
19596
|
+
? customHandler(payload, context)
|
|
19597
|
+
: passthroughEvent
|
|
19598
|
+
? this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context)
|
|
19599
|
+
: this.hostEventFallback(hostEvent, payload, context));
|
|
18626
19600
|
}
|
|
18627
19601
|
}
|
|
18628
19602
|
|
|
@@ -19913,7 +20887,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19913
20887
|
* Triggers an event to the embedded app
|
|
19914
20888
|
* @param {HostEvent} messageType The event type
|
|
19915
20889
|
* @param {any} data The payload to send with the message
|
|
20890
|
+
* @param {ContextType} context Optional context type to specify the context from which the event is triggered.
|
|
20891
|
+
* Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
|
|
20892
|
+
* ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
|
|
20893
|
+
* Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19916
20894
|
* @returns A promise that resolves with the response from the embedded app
|
|
20895
|
+
* @example
|
|
20896
|
+
* ```js
|
|
20897
|
+
* // Trigger Pin event with context (SDK: 1.45.2+)
|
|
20898
|
+
* import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
20899
|
+
* embed.trigger(HostEvent.Pin, {
|
|
20900
|
+
* vizId: "123",
|
|
20901
|
+
* liveboardId: "456"
|
|
20902
|
+
* }, ContextType.Search);
|
|
20903
|
+
* ```
|
|
20904
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
|
|
19917
20905
|
*/
|
|
19918
20906
|
async trigger(messageType, data = {}, context) {
|
|
19919
20907
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
@@ -19942,7 +20930,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19942
20930
|
return null;
|
|
19943
20931
|
}
|
|
19944
20932
|
// send an empty object, this is needed for liveboard default handlers
|
|
19945
|
-
return this.hostEventClient.triggerHostEvent(messageType, data, context)
|
|
20933
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context).catch((err) => {
|
|
20934
|
+
var _a;
|
|
20935
|
+
if (err === null || err === void 0 ? void 0 : err.isValidationError) {
|
|
20936
|
+
const errorDetails = (_a = err.embedErrorDetails) !== null && _a !== void 0 ? _a : {
|
|
20937
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20938
|
+
message: err.message || ERROR_MESSAGE.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20939
|
+
code: exports.EmbedErrorCodes.UPDATEFILTERS_INVALID_PAYLOAD,
|
|
20940
|
+
error: err.message,
|
|
20941
|
+
};
|
|
20942
|
+
this.handleError(errorDetails);
|
|
20943
|
+
}
|
|
20944
|
+
throw err;
|
|
20945
|
+
});
|
|
19946
20946
|
}
|
|
19947
20947
|
/**
|
|
19948
20948
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19976,8 +20976,33 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19976
20976
|
return this.render();
|
|
19977
20977
|
}
|
|
19978
20978
|
/**
|
|
19979
|
-
|
|
19980
|
-
|
|
20979
|
+
* Context object for the embedded component.
|
|
20980
|
+
* @returns {ContextObject} The current context object containing the page type and object ids.
|
|
20981
|
+
* @example
|
|
20982
|
+
* ```js
|
|
20983
|
+
* const context = await embed.getCurrentContext();
|
|
20984
|
+
* console.log(context);
|
|
20985
|
+
*
|
|
20986
|
+
* // Example output
|
|
20987
|
+
* {
|
|
20988
|
+
* stack: [
|
|
20989
|
+
* {
|
|
20990
|
+
* name: 'Liveboard',
|
|
20991
|
+
* type: ContextType.Liveboard,
|
|
20992
|
+
* objectIds: {
|
|
20993
|
+
* liveboardId: '123',
|
|
20994
|
+
* },
|
|
20995
|
+
* },
|
|
20996
|
+
* ],
|
|
20997
|
+
* currentContext: {
|
|
20998
|
+
* name: 'Liveboard',
|
|
20999
|
+
* type: ContextType.Liveboard,
|
|
21000
|
+
* objectIds: {
|
|
21001
|
+
* liveboardId: '123',
|
|
21002
|
+
* },
|
|
21003
|
+
* },
|
|
21004
|
+
* }
|
|
21005
|
+
* ```
|
|
19981
21006
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
19982
21007
|
*/
|
|
19983
21008
|
async getCurrentContext() {
|
|
@@ -20319,6 +21344,50 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20319
21344
|
}
|
|
20320
21345
|
}
|
|
20321
21346
|
|
|
21347
|
+
/**
|
|
21348
|
+
* Resolves enablePastConversationsSidebar with
|
|
21349
|
+
* spotterSidebarConfig taking precedence over the
|
|
21350
|
+
* standalone flag.
|
|
21351
|
+
*/
|
|
21352
|
+
const resolveEnablePastConversationsSidebar = (params) => (params.spotterSidebarConfigValue !== undefined
|
|
21353
|
+
? params.spotterSidebarConfigValue
|
|
21354
|
+
: params.standaloneValue);
|
|
21355
|
+
function buildSpotterSidebarAppInitData(defaultAppInitData, viewConfig, handleError) {
|
|
21356
|
+
const { spotterSidebarConfig, enablePastConversationsSidebar } = viewConfig;
|
|
21357
|
+
const resolvedEnablePastConversations = resolveEnablePastConversationsSidebar({
|
|
21358
|
+
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
21359
|
+
standaloneValue: enablePastConversationsSidebar,
|
|
21360
|
+
});
|
|
21361
|
+
const hasConfig = spotterSidebarConfig || resolvedEnablePastConversations !== undefined;
|
|
21362
|
+
if (!hasConfig)
|
|
21363
|
+
return defaultAppInitData;
|
|
21364
|
+
const resolvedSidebarConfig = {
|
|
21365
|
+
...spotterSidebarConfig,
|
|
21366
|
+
...(resolvedEnablePastConversations !== undefined && {
|
|
21367
|
+
enablePastConversationsSidebar: resolvedEnablePastConversations,
|
|
21368
|
+
}),
|
|
21369
|
+
};
|
|
21370
|
+
if (resolvedSidebarConfig.spotterDocumentationUrl !== undefined) {
|
|
21371
|
+
const [isValid, validationError] = validateHttpUrl(resolvedSidebarConfig.spotterDocumentationUrl);
|
|
21372
|
+
if (!isValid) {
|
|
21373
|
+
handleError({
|
|
21374
|
+
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21375
|
+
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21376
|
+
code: exports.EmbedErrorCodes.INVALID_URL,
|
|
21377
|
+
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
21378
|
+
});
|
|
21379
|
+
delete resolvedSidebarConfig.spotterDocumentationUrl;
|
|
21380
|
+
}
|
|
21381
|
+
}
|
|
21382
|
+
return {
|
|
21383
|
+
...defaultAppInitData,
|
|
21384
|
+
embedParams: {
|
|
21385
|
+
...(defaultAppInitData.embedParams || {}),
|
|
21386
|
+
spotterSidebarConfig: resolvedSidebarConfig,
|
|
21387
|
+
},
|
|
21388
|
+
};
|
|
21389
|
+
}
|
|
21390
|
+
|
|
20322
21391
|
/**
|
|
20323
21392
|
* Copyright (c) 2022
|
|
20324
21393
|
*
|
|
@@ -20448,7 +21517,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20448
21517
|
this.defaultHeight = 500;
|
|
20449
21518
|
this.sendFullHeightLazyLoadData = () => {
|
|
20450
21519
|
const data = calculateVisibleElementData(this.iFrame);
|
|
20451
|
-
this
|
|
21520
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
21521
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
21522
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
21523
|
+
}
|
|
20452
21524
|
};
|
|
20453
21525
|
/**
|
|
20454
21526
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -20501,12 +21573,28 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20501
21573
|
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
20502
21574
|
}
|
|
20503
21575
|
}
|
|
21576
|
+
/**
|
|
21577
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
21578
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
21579
|
+
*
|
|
21580
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
21581
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
21582
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
21583
|
+
* is absent the latter is used as a fallback.
|
|
21584
|
+
*
|
|
21585
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
21586
|
+
* excluded from the payload rather than forwarded to the app.
|
|
21587
|
+
*/
|
|
21588
|
+
async getAppInitData() {
|
|
21589
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
21590
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
21591
|
+
}
|
|
20504
21592
|
/**
|
|
20505
21593
|
* Constructs a map of parameters to be passed on to the
|
|
20506
21594
|
* embedded Liveboard or visualization.
|
|
20507
21595
|
*/
|
|
20508
21596
|
getEmbedParams() {
|
|
20509
|
-
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 = exports.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,
|
|
21597
|
+
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 = exports.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, spotterChatConfig, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
20510
21598
|
let params = {};
|
|
20511
21599
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
20512
21600
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -20530,39 +21618,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20530
21618
|
if (!isUndefined(updatedSpotterChatPrompt)) {
|
|
20531
21619
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
20532
21620
|
}
|
|
20533
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
20534
|
-
spotterSidebarConfigValue: spotterSidebarConfig === null || spotterSidebarConfig === void 0 ? void 0 : spotterSidebarConfig.enablePastConversationsSidebar,
|
|
20535
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
20536
|
-
});
|
|
20537
|
-
setParamIfDefined(params, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
20538
|
-
// Handle spotterSidebarConfig params
|
|
20539
|
-
if (spotterSidebarConfig) {
|
|
20540
|
-
const { spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig;
|
|
20541
|
-
setParamIfDefined(params, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
20542
|
-
setParamIfDefined(params, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
20543
|
-
setParamIfDefined(params, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
20544
|
-
setParamIfDefined(params, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
20545
|
-
setParamIfDefined(params, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
20546
|
-
setParamIfDefined(params, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
20547
|
-
setParamIfDefined(params, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
20548
|
-
setParamIfDefined(params, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
20549
|
-
setParamIfDefined(params, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
20550
|
-
// URL param with validation
|
|
20551
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
20552
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
20553
|
-
if (isValid) {
|
|
20554
|
-
params[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
20555
|
-
}
|
|
20556
|
-
else {
|
|
20557
|
-
this.handleError({
|
|
20558
|
-
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20559
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20560
|
-
code: exports.EmbedErrorCodes.INVALID_URL,
|
|
20561
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
20562
|
-
});
|
|
20563
|
-
}
|
|
20564
|
-
}
|
|
20565
|
-
}
|
|
20566
21621
|
// Handle spotterChatConfig params
|
|
20567
21622
|
if (spotterChatConfig) {
|
|
20568
21623
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|
|
@@ -20638,6 +21693,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20638
21693
|
if (enableHomepageAnnouncement !== undefined) {
|
|
20639
21694
|
params[Param.EnableHomepageAnnouncement] = enableHomepageAnnouncement;
|
|
20640
21695
|
}
|
|
21696
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
21697
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
21698
|
+
}
|
|
20641
21699
|
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
20642
21700
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20643
21701
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
@@ -20913,7 +21971,10 @@ query GetEurekaVizSnapshots(
|
|
|
20913
21971
|
this.defaultHeight = 500;
|
|
20914
21972
|
this.sendFullHeightLazyLoadData = () => {
|
|
20915
21973
|
const data = calculateVisibleElementData(this.iFrame);
|
|
20916
|
-
this
|
|
21974
|
+
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
|
|
21975
|
+
if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
|
|
21976
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
21977
|
+
}
|
|
20917
21978
|
};
|
|
20918
21979
|
/**
|
|
20919
21980
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -20993,7 +22054,7 @@ query GetEurekaVizSnapshots(
|
|
|
20993
22054
|
getEmbedParamsObject() {
|
|
20994
22055
|
let params = {};
|
|
20995
22056
|
params = this.getBaseQueryParams(params);
|
|
20996
|
-
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;
|
|
22057
|
+
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, isContinuousLiveboardPDFEnabled, } = this.viewConfig;
|
|
20997
22058
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20998
22059
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20999
22060
|
if (fullHeight === true) {
|
|
@@ -21082,6 +22143,9 @@ query GetEurekaVizSnapshots(
|
|
|
21082
22143
|
if (isThisPeriodInDateFiltersEnabled !== undefined) {
|
|
21083
22144
|
params[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
|
|
21084
22145
|
}
|
|
22146
|
+
if (isContinuousLiveboardPDFEnabled !== undefined) {
|
|
22147
|
+
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
22148
|
+
}
|
|
21085
22149
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
21086
22150
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
21087
22151
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -21098,7 +22162,8 @@ query GetEurekaVizSnapshots(
|
|
|
21098
22162
|
}
|
|
21099
22163
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21100
22164
|
// Extract view from liveboardId if passed along with it (legacy
|
|
21101
|
-
// approach)
|
|
22165
|
+
// approach)
|
|
22166
|
+
// View must be appended as query param at the end, not
|
|
21102
22167
|
// embedded in path
|
|
21103
22168
|
let liveboardGuid = liveboardId;
|
|
21104
22169
|
let legacyViewId;
|
|
@@ -22097,14 +23162,24 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22097
23162
|
super(container, viewConfig);
|
|
22098
23163
|
this.viewConfig = viewConfig;
|
|
22099
23164
|
}
|
|
23165
|
+
/**
|
|
23166
|
+
* Extends the default APP_INIT payload with `embedParams.spotterSidebarConfig`
|
|
23167
|
+
* so the conv-assist app can read sidebar configuration on initialisation.
|
|
23168
|
+
*
|
|
23169
|
+
* Precedence for `enablePastConversationsSidebar`:
|
|
23170
|
+
* `spotterSidebarConfig.enablePastConversationsSidebar` wins over the
|
|
23171
|
+
* deprecated top-level `enablePastConversationsSidebar` flag; if the former
|
|
23172
|
+
* is absent the latter is used as a fallback.
|
|
23173
|
+
*
|
|
23174
|
+
* An invalid `spotterDocumentationUrl` triggers a validation error and is
|
|
23175
|
+
* excluded from the payload rather than forwarded to the app.
|
|
23176
|
+
*/
|
|
23177
|
+
async getAppInitData() {
|
|
23178
|
+
const defaultAppInitData = await super.getAppInitData();
|
|
23179
|
+
return buildSpotterSidebarAppInitData(defaultAppInitData, this.viewConfig, this.handleError.bind(this));
|
|
23180
|
+
}
|
|
22100
23181
|
getEmbedParamsObject() {
|
|
22101
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt,
|
|
22102
|
-
// Extract sidebar config properties
|
|
22103
|
-
const { enablePastConversationsSidebar: sidebarEnablePastConversationsSidebar, spotterSidebarTitle, spotterSidebarDefaultExpanded, spotterChatRenameLabel, spotterChatDeleteLabel, spotterDeleteConversationModalTitle, spotterPastConversationAlertMessage, spotterDocumentationUrl, spotterBestPracticesLabel, spotterConversationsBatchSize, spotterNewChatButtonTitle, } = spotterSidebarConfig || {};
|
|
22104
|
-
const resolvedEnablePastConversationsSidebar = resolveEnablePastConversationsSidebar({
|
|
22105
|
-
spotterSidebarConfigValue: sidebarEnablePastConversationsSidebar,
|
|
22106
|
-
standaloneValue: this.viewConfig.enablePastConversationsSidebar,
|
|
22107
|
-
});
|
|
23182
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, spotterChatConfig, } = this.viewConfig;
|
|
22108
23183
|
if (!worksheetId) {
|
|
22109
23184
|
this.handleError({
|
|
22110
23185
|
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
@@ -22122,32 +23197,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22122
23197
|
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
22123
23198
|
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
22124
23199
|
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
22125
|
-
setParamIfDefined(queryParams, Param.EnablePastConversationsSidebar, resolvedEnablePastConversationsSidebar, true);
|
|
22126
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarDefaultExpanded, spotterSidebarDefaultExpanded, true);
|
|
22127
|
-
// String params
|
|
22128
|
-
setParamIfDefined(queryParams, Param.SpotterSidebarTitle, spotterSidebarTitle);
|
|
22129
|
-
setParamIfDefined(queryParams, Param.SpotterChatRenameLabel, spotterChatRenameLabel);
|
|
22130
|
-
setParamIfDefined(queryParams, Param.SpotterChatDeleteLabel, spotterChatDeleteLabel);
|
|
22131
|
-
setParamIfDefined(queryParams, Param.SpotterDeleteConversationModalTitle, spotterDeleteConversationModalTitle);
|
|
22132
|
-
setParamIfDefined(queryParams, Param.SpotterPastConversationAlertMessage, spotterPastConversationAlertMessage);
|
|
22133
|
-
setParamIfDefined(queryParams, Param.SpotterBestPracticesLabel, spotterBestPracticesLabel);
|
|
22134
|
-
setParamIfDefined(queryParams, Param.SpotterConversationsBatchSize, spotterConversationsBatchSize);
|
|
22135
|
-
setParamIfDefined(queryParams, Param.SpotterNewChatButtonTitle, spotterNewChatButtonTitle);
|
|
22136
|
-
// URL param with validation
|
|
22137
|
-
if (spotterDocumentationUrl !== undefined) {
|
|
22138
|
-
const [isValid, validationError] = validateHttpUrl(spotterDocumentationUrl);
|
|
22139
|
-
if (isValid) {
|
|
22140
|
-
queryParams[Param.SpotterDocumentationUrl] = spotterDocumentationUrl;
|
|
22141
|
-
}
|
|
22142
|
-
else {
|
|
22143
|
-
this.handleError({
|
|
22144
|
-
errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
|
|
22145
|
-
message: ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22146
|
-
code: exports.EmbedErrorCodes.INVALID_URL,
|
|
22147
|
-
error: (validationError === null || validationError === void 0 ? void 0 : validationError.message) || ERROR_MESSAGE.INVALID_SPOTTER_DOCUMENTATION_URL,
|
|
22148
|
-
});
|
|
22149
|
-
}
|
|
22150
|
-
}
|
|
22151
23200
|
// Handle spotterChatConfig params
|
|
22152
23201
|
if (spotterChatConfig) {
|
|
22153
23202
|
const { hideToolResponseCardBranding, toolResponseCardBrandingLabel, } = spotterChatConfig;
|