@thoughtspot/visual-embed-sdk 1.20.2 → 1.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/package.json +171 -0
- package/cjs/src/auth.d.ts +183 -0
- package/cjs/src/auth.d.ts.map +1 -0
- package/cjs/src/auth.js +457 -0
- package/cjs/src/auth.js.map +1 -0
- package/cjs/src/auth.spec.d.ts +13 -0
- package/cjs/src/auth.spec.d.ts.map +1 -0
- package/cjs/src/auth.spec.js +397 -0
- package/cjs/src/auth.spec.js.map +1 -0
- package/cjs/src/config.d.ts +22 -0
- package/cjs/src/config.d.ts.map +1 -0
- package/cjs/src/config.js +70 -0
- package/cjs/src/config.js.map +1 -0
- package/cjs/src/config.spec.d.ts +5 -0
- package/cjs/src/config.spec.d.ts.map +1 -0
- package/cjs/src/config.spec.js +65 -0
- package/cjs/src/config.spec.js.map +1 -0
- package/cjs/src/embed/app.d.ts +168 -0
- package/cjs/src/embed/app.d.ts.map +1 -0
- package/cjs/src/embed/app.js +215 -0
- package/cjs/src/embed/app.js.map +1 -0
- package/cjs/src/embed/app.spec.d.ts +2 -0
- package/cjs/src/embed/app.spec.d.ts.map +1 -0
- package/cjs/src/embed/app.spec.js +239 -0
- package/cjs/src/embed/app.spec.js.map +1 -0
- package/cjs/src/embed/base.d.ts +79 -0
- package/cjs/src/embed/base.d.ts.map +1 -0
- package/cjs/src/embed/base.js +229 -0
- package/cjs/src/embed/base.js.map +1 -0
- package/cjs/src/embed/base.spec.d.ts +2 -0
- package/cjs/src/embed/base.spec.d.ts.map +1 -0
- package/cjs/src/embed/base.spec.js +198 -0
- package/cjs/src/embed/base.spec.js.map +1 -0
- package/cjs/src/embed/embed.spec.d.ts +2 -0
- package/cjs/src/embed/embed.spec.d.ts.map +1 -0
- package/cjs/src/embed/embed.spec.js +74 -0
- package/cjs/src/embed/embed.spec.js.map +1 -0
- package/cjs/src/embed/events.spec.d.ts +2 -0
- package/cjs/src/embed/events.spec.d.ts.map +1 -0
- package/cjs/src/embed/events.spec.js +238 -0
- package/cjs/src/embed/events.spec.js.map +1 -0
- package/cjs/src/embed/liveboard.d.ts +150 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -0
- package/cjs/src/embed/liveboard.js +168 -0
- package/cjs/src/embed/liveboard.js.map +1 -0
- package/cjs/src/embed/liveboard.spec.d.ts +2 -0
- package/cjs/src/embed/liveboard.spec.d.ts.map +1 -0
- package/cjs/src/embed/liveboard.spec.js +229 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -0
- package/cjs/src/embed/pinboard.spec.d.ts +2 -0
- package/cjs/src/embed/pinboard.spec.d.ts.map +1 -0
- package/cjs/src/embed/pinboard.spec.js +148 -0
- package/cjs/src/embed/pinboard.spec.js.map +1 -0
- package/cjs/src/embed/search-bar.d.ts +50 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -0
- package/cjs/src/embed/search-bar.js +63 -0
- package/cjs/src/embed/search-bar.js.map +1 -0
- package/cjs/src/embed/search.d.ts +129 -0
- package/cjs/src/embed/search.d.ts.map +1 -0
- package/cjs/src/embed/search.js +121 -0
- package/cjs/src/embed/search.js.map +1 -0
- package/cjs/src/embed/search.spec.d.ts +2 -0
- package/cjs/src/embed/search.spec.d.ts.map +1 -0
- package/cjs/src/embed/search.spec.js +238 -0
- package/cjs/src/embed/search.spec.js.map +1 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +103 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts +323 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -0
- package/cjs/src/embed/ts-embed.js +719 -0
- package/cjs/src/embed/ts-embed.js.map +1 -0
- package/cjs/src/embed/ts-embed.spec.d.ts +2 -0
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -0
- package/cjs/src/embed/ts-embed.spec.js +771 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -0
- package/cjs/src/errors.d.ts +7 -0
- package/cjs/src/errors.d.ts.map +1 -0
- package/cjs/src/errors.js +10 -0
- package/cjs/src/errors.js.map +1 -0
- package/cjs/src/index.d.ts +18 -0
- package/cjs/src/index.d.ts.map +1 -0
- package/cjs/src/index.js +42 -0
- package/cjs/src/index.js.map +1 -0
- package/cjs/src/mixpanel-service.d.ts +29 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -0
- package/cjs/src/mixpanel-service.js +76 -0
- package/cjs/src/mixpanel-service.js.map +1 -0
- package/cjs/src/mixpanel-service.spec.d.ts +2 -0
- package/cjs/src/mixpanel-service.spec.d.ts.map +1 -0
- package/cjs/src/mixpanel-service.spec.js +63 -0
- package/cjs/src/mixpanel-service.spec.js.map +1 -0
- package/cjs/src/react/all-types-export.d.ts +3 -0
- package/cjs/src/react/all-types-export.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.js +29 -0
- package/cjs/src/react/all-types-export.js.map +1 -0
- package/cjs/src/react/all-types-export.spec.d.ts +2 -0
- package/cjs/src/react/all-types-export.spec.d.ts.map +1 -0
- package/cjs/src/react/all-types-export.spec.js +13 -0
- package/cjs/src/react/all-types-export.spec.js.map +1 -0
- package/cjs/src/react/index.d.ts +95 -0
- package/cjs/src/react/index.d.ts.map +1 -0
- package/cjs/src/react/index.js +121 -0
- package/cjs/src/react/index.js.map +1 -0
- package/cjs/src/react/index.spec.d.ts +3 -0
- package/cjs/src/react/index.spec.d.ts.map +1 -0
- package/cjs/src/react/index.spec.js +138 -0
- package/cjs/src/react/index.spec.js.map +1 -0
- package/cjs/src/react/util.d.ts +19 -0
- package/cjs/src/react/util.d.ts.map +1 -0
- package/cjs/src/react/util.js +25 -0
- package/cjs/src/react/util.js.map +1 -0
- package/cjs/src/test/test-utils.d.ts +48 -0
- package/cjs/src/test/test-utils.d.ts.map +1 -0
- package/cjs/src/test/test-utils.js +108 -0
- package/cjs/src/test/test-utils.js.map +1 -0
- package/cjs/src/types.d.ts +2020 -0
- package/cjs/src/types.d.ts.map +1 -0
- package/cjs/src/types.js +1543 -0
- package/cjs/src/types.js.map +1 -0
- package/cjs/src/utils/answerService.d.ts +10 -0
- package/cjs/src/utils/answerService.d.ts.map +1 -0
- package/cjs/src/utils/answerService.js +61 -0
- package/cjs/src/utils/answerService.js.map +1 -0
- package/cjs/src/utils/answerService.spec.d.ts +2 -0
- package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
- package/cjs/src/utils/answerService.spec.js +31 -0
- package/cjs/src/utils/answerService.spec.js.map +1 -0
- package/cjs/src/utils/authService.d.ts +37 -0
- package/cjs/src/utils/authService.d.ts.map +1 -0
- package/cjs/src/utils/authService.js +106 -0
- package/cjs/src/utils/authService.js.map +1 -0
- package/cjs/src/utils/authService.spec.d.ts +2 -0
- package/cjs/src/utils/authService.spec.d.ts.map +1 -0
- package/cjs/src/utils/authService.spec.js +72 -0
- package/cjs/src/utils/authService.spec.js.map +1 -0
- package/cjs/src/utils/processData.d.ts +16 -0
- package/cjs/src/utils/processData.d.ts.map +1 -0
- package/cjs/src/utils/processData.js +110 -0
- package/cjs/src/utils/processData.js.map +1 -0
- package/cjs/src/utils/processData.spec.d.ts +2 -0
- package/cjs/src/utils/processData.spec.d.ts.map +1 -0
- package/cjs/src/utils/processData.spec.js +142 -0
- package/cjs/src/utils/processData.spec.js.map +1 -0
- package/cjs/src/utils/processTrigger.d.ts +10 -0
- package/cjs/src/utils/processTrigger.d.ts.map +1 -0
- package/cjs/src/utils/processTrigger.js +63 -0
- package/cjs/src/utils/processTrigger.js.map +1 -0
- package/cjs/src/utils/processTrigger.spec.d.ts +2 -0
- package/cjs/src/utils/processTrigger.spec.d.ts.map +1 -0
- package/cjs/src/utils/processTrigger.spec.js +58 -0
- package/cjs/src/utils/processTrigger.spec.js.map +1 -0
- package/cjs/src/utils.d.ts +68 -0
- package/cjs/src/utils.d.ts.map +1 -0
- package/cjs/src/utils.js +196 -0
- package/cjs/src/utils.js.map +1 -0
- package/cjs/src/utils.spec.d.ts +5 -0
- package/cjs/src/utils.spec.d.ts.map +1 -0
- package/cjs/src/utils.spec.js +98 -0
- package/cjs/src/utils.spec.js.map +1 -0
- package/dist/src/auth.d.ts +54 -5
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/auth.spec.d.ts +3 -0
- package/dist/src/auth.spec.d.ts.map +1 -1
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +35 -6
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +20 -9
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +17 -5
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +3 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +9 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +65 -7
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +8 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +3 -0
- package/dist/src/react/all-types-export.d.ts.map +1 -0
- package/dist/src/react/all-types-export.spec.d.ts +2 -0
- package/dist/src/react/all-types-export.spec.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +72 -0
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +4 -0
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/test/test-utils.d.ts +11 -2
- package/dist/src/test/test-utils.d.ts.map +1 -1
- package/dist/src/types.d.ts +499 -96
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/answerService.d.ts +7 -0
- package/dist/src/utils/answerService.d.ts.map +1 -1
- package/dist/src/utils/authService.d.ts +30 -0
- package/dist/src/utils/authService.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +12 -0
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +7 -0
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils.d.ts +12 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +28024 -0
- package/dist/tsembed-react.js +27966 -0
- package/dist/tsembed.es.js +18114 -305
- package/dist/tsembed.js +18088 -327
- package/dist/visual-embed-sdk-react-full.d.ts +3092 -0
- package/dist/visual-embed-sdk-react.d.ts +2781 -0
- package/dist/visual-embed-sdk.d.ts +2944 -0
- package/lib/package.json +15 -14
- package/lib/src/auth.d.ts +54 -5
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +91 -31
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.d.ts +3 -0
- package/lib/src/auth.spec.d.ts.map +1 -1
- package/lib/src/auth.spec.js +37 -6
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/config.d.ts +1 -0
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +5 -3
- package/lib/src/config.js.map +1 -1
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +35 -6
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +55 -16
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +41 -12
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +20 -9
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +31 -15
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/embed.spec.js +1 -1
- package/lib/src/embed/embed.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +17 -5
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +49 -37
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +37 -30
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +14 -26
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +3 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +5 -6
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +9 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +18 -14
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +16 -19
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +4 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +65 -7
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +154 -77
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +46 -24
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +4 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +8 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +13 -1
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +3 -0
- package/lib/src/react/all-types-export.d.ts.map +1 -0
- package/lib/src/react/all-types-export.js +5 -0
- package/lib/src/react/all-types-export.js.map +1 -0
- package/lib/src/react/all-types-export.spec.d.ts +2 -0
- package/lib/src/react/all-types-export.spec.d.ts.map +1 -0
- package/lib/src/react/all-types-export.spec.js +10 -0
- package/lib/src/react/all-types-export.spec.js.map +1 -0
- package/lib/src/react/index.d.ts +72 -0
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -7
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +27 -6
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/react/util.d.ts +4 -0
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/react/util.js +4 -0
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/test/test-utils.d.ts +11 -2
- package/lib/src/test/test-utils.d.ts.map +1 -1
- package/lib/src/test/test-utils.js +36 -25
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/types.d.ts +499 -96
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +374 -68
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/answerService.d.ts +7 -0
- package/lib/src/utils/answerService.d.ts.map +1 -1
- package/lib/src/utils/answerService.js +7 -0
- package/lib/src/utils/answerService.js.map +1 -1
- package/lib/src/utils/answerService.spec.js.map +1 -1
- package/lib/src/utils/authService.d.ts +30 -0
- package/lib/src/utils/authService.d.ts.map +1 -1
- package/lib/src/utils/authService.js +39 -2
- package/lib/src/utils/authService.js.map +1 -1
- package/lib/src/utils/authService.spec.js.map +1 -1
- package/lib/src/utils/processData.d.ts +12 -0
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +33 -5
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +7 -0
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +17 -3
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils/processTrigger.spec.js.map +1 -1
- package/lib/src/utils.d.ts +12 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +24 -19
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/package.json +15 -14
- package/src/auth.spec.ts +83 -133
- package/src/auth.ts +148 -115
- package/src/config.spec.ts +2 -4
- package/src/config.ts +5 -3
- package/src/embed/app.spec.ts +57 -14
- package/src/embed/app.ts +91 -36
- package/src/embed/base.spec.ts +3 -9
- package/src/embed/base.ts +51 -53
- package/src/embed/embed.spec.ts +5 -6
- package/src/embed/liveboard.spec.ts +56 -37
- package/src/embed/liveboard.ts +66 -64
- package/src/embed/pinboard.spec.ts +26 -29
- package/src/embed/search-bar.tsx +10 -8
- package/src/embed/search.spec.ts +31 -21
- package/src/embed/search.ts +26 -20
- package/src/embed/searchEmbed-basic-auth.spec.ts +22 -28
- package/src/embed/ts-embed.spec.ts +99 -144
- package/src/embed/ts-embed.ts +188 -162
- package/src/errors.ts +3 -6
- package/src/index.ts +6 -10
- package/src/mixpanel-service.spec.ts +1 -3
- package/src/mixpanel-service.ts +13 -1
- package/src/react/index.spec.tsx +66 -13
- package/src/react/index.tsx +111 -62
- package/src/react/util.ts +8 -4
- package/src/test/test-utils.ts +43 -39
- package/src/types.ts +498 -98
- package/src/utils/answerService.spec.ts +3 -5
- package/src/utils/answerService.ts +21 -17
- package/src/utils/authService.spec.ts +26 -41
- package/src/utils/authService.ts +47 -21
- package/src/utils/processData.spec.ts +26 -59
- package/src/utils/processData.ts +36 -14
- package/src/utils/processTrigger.spec.ts +1 -6
- package/src/utils/processTrigger.ts +18 -9
- package/src/utils.spec.ts +8 -12
- package/src/utils.ts +25 -26
- package/lib/src/visual-embed-sdk.d.ts +0 -2419
|
@@ -0,0 +1,2944 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
// Dependencies for this module:
|
|
3
|
+
// ../../eventemitter3
|
|
4
|
+
|
|
5
|
+
import EventEmitter from 'eventemitter3';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) 2023
|
|
9
|
+
*
|
|
10
|
+
* ThoughtSpot Visual Embed SDK for embedding ThoughtSpot analytics
|
|
11
|
+
* in other web applications.
|
|
12
|
+
*
|
|
13
|
+
* @summary ThoughtSpot Visual Embed SDK
|
|
14
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
15
|
+
*/
|
|
16
|
+
export { init, logout, prefetch, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, };
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Copyright (c) 2022
|
|
20
|
+
*
|
|
21
|
+
* Full application embedding
|
|
22
|
+
* https://developers.thoughtspot.com/docs/?pageid=full-embed
|
|
23
|
+
*
|
|
24
|
+
* @summary Full app embed
|
|
25
|
+
* @module
|
|
26
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Pages within the ThoughtSpot app that can be embedded.
|
|
30
|
+
*/
|
|
31
|
+
export enum Page {
|
|
32
|
+
/**
|
|
33
|
+
* Home page
|
|
34
|
+
*/
|
|
35
|
+
Home = "home",
|
|
36
|
+
/**
|
|
37
|
+
* Search page
|
|
38
|
+
*/
|
|
39
|
+
Search = "search",
|
|
40
|
+
/**
|
|
41
|
+
* Saved answers listing page
|
|
42
|
+
*/
|
|
43
|
+
Answers = "answers",
|
|
44
|
+
/**
|
|
45
|
+
* Liveboards listing page
|
|
46
|
+
*/
|
|
47
|
+
Liveboards = "liveboards",
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
*/
|
|
51
|
+
Pinboards = "pinboards",
|
|
52
|
+
/**
|
|
53
|
+
* Data management page
|
|
54
|
+
*/
|
|
55
|
+
Data = "data",
|
|
56
|
+
/**
|
|
57
|
+
* SpotIQ listing page
|
|
58
|
+
*/
|
|
59
|
+
SpotIQ = "spotiq"
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The view configuration for full app embedding.
|
|
63
|
+
*
|
|
64
|
+
* @group Embed components
|
|
65
|
+
*/
|
|
66
|
+
export interface AppViewConfig extends ViewConfig {
|
|
67
|
+
/**
|
|
68
|
+
* If true, the main navigation bar within the ThoughtSpot app
|
|
69
|
+
* is displayed. By default, the navigation bar is hidden.
|
|
70
|
+
*/
|
|
71
|
+
showPrimaryNavbar?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* If true, help and profile buttons will hide on NavBar. By default,
|
|
74
|
+
* they are shown.
|
|
75
|
+
*/
|
|
76
|
+
disableProfileAndHelp?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* A URL path within the app that is to be embedded.
|
|
79
|
+
* If both path and pageId attributes are defined, the path definition
|
|
80
|
+
* takes precedence.
|
|
81
|
+
*/
|
|
82
|
+
path?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The application page to set as the start page
|
|
85
|
+
* in the embedded view.
|
|
86
|
+
*/
|
|
87
|
+
pageId?: Page;
|
|
88
|
+
/**
|
|
89
|
+
* This puts a filter tag on the application. All metadata lists in the
|
|
90
|
+
* application, such as Liveboards and answers, would be filtered by this
|
|
91
|
+
* tag.
|
|
92
|
+
*/
|
|
93
|
+
tag?: string;
|
|
94
|
+
/**
|
|
95
|
+
* The array of GUIDs to be hidden
|
|
96
|
+
*/
|
|
97
|
+
hideObjects?: string[];
|
|
98
|
+
/**
|
|
99
|
+
* Render liveboards using the new v2 rendering mode
|
|
100
|
+
* This is a transient flag which is primarily meant for internal use
|
|
101
|
+
*
|
|
102
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
103
|
+
* @hidden
|
|
104
|
+
*/
|
|
105
|
+
liveboardV2?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* If set to true, the Search Assist feature is enabled.
|
|
108
|
+
*
|
|
109
|
+
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
110
|
+
*/
|
|
111
|
+
enableSearchAssist?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* If set to true, the embedded object container dynamically resizes
|
|
114
|
+
* according to the height of the pages which support fullHeight mode.
|
|
115
|
+
*
|
|
116
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
|
|
117
|
+
*/
|
|
118
|
+
fullHeight?: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Embeds full ThoughtSpot experience in a host application.
|
|
122
|
+
*
|
|
123
|
+
* @group Embed components
|
|
124
|
+
*/
|
|
125
|
+
export class AppEmbed extends V1Embed {
|
|
126
|
+
protected viewConfig: AppViewConfig;
|
|
127
|
+
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
|
|
128
|
+
/**
|
|
129
|
+
* Constructs a map of parameters to be passed on to the
|
|
130
|
+
* embedded Liveboard or visualization.
|
|
131
|
+
*/
|
|
132
|
+
protected getEmbedParams(): string;
|
|
133
|
+
/**
|
|
134
|
+
* Set the iframe height as per the computed height received
|
|
135
|
+
* from the ThoughtSpot app.
|
|
136
|
+
*
|
|
137
|
+
* @param data The event payload
|
|
138
|
+
*/
|
|
139
|
+
protected updateIFrameHeight: (data: MessagePayload) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
142
|
+
* This is used for embedding answers, pinboards, visualizations and full application
|
|
143
|
+
* only.
|
|
144
|
+
*
|
|
145
|
+
* @param path string | number The string, set to iframe src and navigate to new page
|
|
146
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
147
|
+
* When used with `noReload` (default: true) this can also be a number
|
|
148
|
+
* like 1/-1 to go forward/back.
|
|
149
|
+
* @param noReload boolean Trigger the navigation without reloading the page
|
|
150
|
+
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
151
|
+
*/
|
|
152
|
+
navigateToPage(path: string | number, noReload?: boolean): void;
|
|
153
|
+
/**
|
|
154
|
+
* Renders the embedded application pages in the ThoughtSpot app.
|
|
155
|
+
*
|
|
156
|
+
* @param renderOptions An object containing the page ID
|
|
157
|
+
* to be embedded.
|
|
158
|
+
*/
|
|
159
|
+
render(): AppEmbed;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export let authPromise: Promise<boolean>;
|
|
163
|
+
/**
|
|
164
|
+
* Gets the configuration embed was initialized with.
|
|
165
|
+
*
|
|
166
|
+
* @returns {@link EmbedConfig} The configuration embed was initialized with.
|
|
167
|
+
* @version SDK: 1.19.0 | ThoughtSpot: *
|
|
168
|
+
* @group Global methods
|
|
169
|
+
*/
|
|
170
|
+
export const getEmbedConfig: () => EmbedConfig;
|
|
171
|
+
export const getAuthPromise: () => Promise<boolean>;
|
|
172
|
+
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
|
|
173
|
+
/**
|
|
174
|
+
* Perform authentication on the ThoughtSpot app as applicable.
|
|
175
|
+
*/
|
|
176
|
+
export const handleAuth: () => Promise<boolean>;
|
|
177
|
+
/**
|
|
178
|
+
* Prefetches static resources from the specified URL. Web browsers can then cache the
|
|
179
|
+
* prefetched resources and serve them from the user's local disk to provide faster access
|
|
180
|
+
* to your app.
|
|
181
|
+
*
|
|
182
|
+
* @param url The URL provided for prefetch
|
|
183
|
+
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
184
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
185
|
+
* @group Global methods
|
|
186
|
+
*/
|
|
187
|
+
export const prefetch: (url?: string, prefetchFeatures?: PrefetchFeatures[]) => void;
|
|
188
|
+
/**
|
|
189
|
+
* Initializes the Visual Embed SDK globally and perform
|
|
190
|
+
* authentication if applicable. This function needs to be called before any ThoughtSpot
|
|
191
|
+
* component like liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS
|
|
192
|
+
* to actually embed. That is handled internally.
|
|
193
|
+
*
|
|
194
|
+
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
195
|
+
* authentication mechanism and so on.
|
|
196
|
+
* @example
|
|
197
|
+
* ```js
|
|
198
|
+
* const authStatus = init({
|
|
199
|
+
* thoughtSpotHost: 'https://my.thoughtspot.cloud',
|
|
200
|
+
* authType: AuthType.None,
|
|
201
|
+
* });
|
|
202
|
+
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
203
|
+
* ```
|
|
204
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success,
|
|
205
|
+
* failure and logout. See {@link AuthStatus}
|
|
206
|
+
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
207
|
+
* @group Authentication / Init
|
|
208
|
+
*/
|
|
209
|
+
export const init: (embedConfig: EmbedConfig) => AuthEventEmitter;
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
*/
|
|
213
|
+
export function disableAutoLogin(): void;
|
|
214
|
+
/**
|
|
215
|
+
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
216
|
+
* prevent the SDK from automatically logging in again.
|
|
217
|
+
*
|
|
218
|
+
* You can call the `init` method again to re login, if autoLogin is set to
|
|
219
|
+
* true in this second call it will be honored.
|
|
220
|
+
*
|
|
221
|
+
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
222
|
+
* @returns Promise which resolves when logout completes.
|
|
223
|
+
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
224
|
+
* @group Global methods
|
|
225
|
+
*/
|
|
226
|
+
export const logout: (doNotDisableAutoLogin?: boolean) => Promise<boolean>;
|
|
227
|
+
/**
|
|
228
|
+
* Renders functions in a queue, resolves to next function only after the callback next
|
|
229
|
+
* is called
|
|
230
|
+
*
|
|
231
|
+
* @param fn The function being registered
|
|
232
|
+
*/
|
|
233
|
+
export const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) => Promise<any>;
|
|
234
|
+
/**
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
237
|
+
export function reset(): void;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Copyright (c) 2022
|
|
241
|
+
*
|
|
242
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
243
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
244
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
245
|
+
*
|
|
246
|
+
* @summary Liveboard & visualization embed
|
|
247
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
248
|
+
*/
|
|
249
|
+
/**
|
|
250
|
+
* The configuration for the embedded Liveboard or visualization page view.
|
|
251
|
+
*
|
|
252
|
+
* @group Embed components
|
|
253
|
+
*/
|
|
254
|
+
export interface LiveboardViewConfig extends ViewConfig {
|
|
255
|
+
/**
|
|
256
|
+
* If set to true, the embedded object container dynamically resizes
|
|
257
|
+
* according to the height of the Liveboard.
|
|
258
|
+
*
|
|
259
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
260
|
+
*/
|
|
261
|
+
fullHeight?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
264
|
+
* Setting this height helps resolves issues with empty Liveboards and
|
|
265
|
+
* other screens navigable from a Liveboard.
|
|
266
|
+
*
|
|
267
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
268
|
+
* @default 500
|
|
269
|
+
*/
|
|
270
|
+
defaultHeight?: number;
|
|
271
|
+
/**
|
|
272
|
+
* @Deprecated If set to true, the context menu in visualizations will be enabled.
|
|
273
|
+
*/
|
|
274
|
+
enableVizTransformations?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* The Liveboard to display in the embedded view.
|
|
277
|
+
* Use either of liveboardId or pinboardId to reference the Liveboard to embed.
|
|
278
|
+
*
|
|
279
|
+
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
|
|
280
|
+
*/
|
|
281
|
+
liveboardId?: string;
|
|
282
|
+
/**
|
|
283
|
+
* To support backward compatibility
|
|
284
|
+
*
|
|
285
|
+
* @hidden
|
|
286
|
+
*/
|
|
287
|
+
pinboardId?: string;
|
|
288
|
+
/**
|
|
289
|
+
* The visualization within the Liveboard to display.
|
|
290
|
+
*/
|
|
291
|
+
vizId?: string;
|
|
292
|
+
/**
|
|
293
|
+
* If set to true, all filter chips from a
|
|
294
|
+
* Liveboard page will be read-only (no X buttons)
|
|
295
|
+
*
|
|
296
|
+
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
|
|
297
|
+
*/
|
|
298
|
+
preventLiveboardFilterRemoval?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Array of viz ids which should be visible when the liveboard
|
|
301
|
+
* first renders. This can be changed by triggering the "SetVisibleVizs"
|
|
302
|
+
* event.
|
|
303
|
+
*
|
|
304
|
+
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
305
|
+
*/
|
|
306
|
+
visibleVizs?: string[];
|
|
307
|
+
/**
|
|
308
|
+
* To support backward compatibilty
|
|
309
|
+
*
|
|
310
|
+
* @hidden
|
|
311
|
+
*/
|
|
312
|
+
preventPinboardFilterRemoval?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Render embedded Liveboards and visualizations in the new Liveboard experience mode
|
|
315
|
+
*
|
|
316
|
+
* @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw
|
|
317
|
+
*/
|
|
318
|
+
liveboardV2?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Tab Id of the Liveboard that is supposed to be active
|
|
321
|
+
*
|
|
322
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
323
|
+
*/
|
|
324
|
+
activeTabId?: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Embed a ThoughtSpot Liveboard or a Thoughtspot visualization. When rendered it already
|
|
328
|
+
* waits for the authentication to complete, so no need to wait for AuthStatus.SUCCESS.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```js
|
|
332
|
+
* import { .. } from '@thoughtspot/visual-embed-sdk';
|
|
333
|
+
* init({ ... });
|
|
334
|
+
* const embed = new LiveboardEmbed("#container", {
|
|
335
|
+
* liveboardId: <your-id-here>,
|
|
336
|
+
* // .. other params here.
|
|
337
|
+
* })
|
|
338
|
+
* ```
|
|
339
|
+
* @group Embed components
|
|
340
|
+
*/
|
|
341
|
+
export class LiveboardEmbed extends V1Embed {
|
|
342
|
+
protected viewConfig: LiveboardViewConfig;
|
|
343
|
+
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
|
|
344
|
+
/**
|
|
345
|
+
* Construct a map of params to be passed on to the
|
|
346
|
+
* embedded Liveboard or visualization.
|
|
347
|
+
*/
|
|
348
|
+
protected getEmbedParams(): string;
|
|
349
|
+
/**
|
|
350
|
+
* Triggers an event to the embedded app
|
|
351
|
+
*
|
|
352
|
+
* @param messageType The event type
|
|
353
|
+
* @param data The payload to send with the message
|
|
354
|
+
*/
|
|
355
|
+
trigger(messageType: HostEvent, data?: any): Promise<any>;
|
|
356
|
+
/**
|
|
357
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
358
|
+
*
|
|
359
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
360
|
+
* visualization ID and the runtime filters.
|
|
361
|
+
*/
|
|
362
|
+
render(): LiveboardEmbed;
|
|
363
|
+
navigateToLiveboard(liveboardId: string, vizId?: string, activeTabId?: string): void;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* @hidden
|
|
367
|
+
*/
|
|
368
|
+
export class PinboardEmbed extends LiveboardEmbed {
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Copyright (c) 2022
|
|
373
|
+
*
|
|
374
|
+
* Embed ThoughtSpot search or a saved answer
|
|
375
|
+
*
|
|
376
|
+
* @summary Search embed
|
|
377
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
378
|
+
*/
|
|
379
|
+
/**
|
|
380
|
+
* Configuration for search options
|
|
381
|
+
*/
|
|
382
|
+
export interface SearchOptions {
|
|
383
|
+
/**
|
|
384
|
+
* The tml string to load the answer
|
|
385
|
+
*/
|
|
386
|
+
searchTokenString: string;
|
|
387
|
+
/**
|
|
388
|
+
* Boolean to determine if the search should be executed or not.
|
|
389
|
+
* if it is executed, put the focus on the results.
|
|
390
|
+
* if it’s not executed, put the focus in the search bar - at the end of
|
|
391
|
+
* the tokens
|
|
392
|
+
*/
|
|
393
|
+
executeSearch?: boolean;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* The configuration attributes for the embedded search view.
|
|
397
|
+
*
|
|
398
|
+
* @group Embed components
|
|
399
|
+
*/
|
|
400
|
+
export interface SearchViewConfig extends ViewConfig {
|
|
401
|
+
/**
|
|
402
|
+
* If set to true, the data sources panel is collapsed on load,
|
|
403
|
+
* but can be expanded manually.
|
|
404
|
+
*/
|
|
405
|
+
collapseDataSources?: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* If set to true, hides the data sources panel.
|
|
408
|
+
*/
|
|
409
|
+
hideDataSources?: boolean;
|
|
410
|
+
/**
|
|
411
|
+
* If set to true, hides the charts and tables in search answers.
|
|
412
|
+
* This attribute can be used to create a custom visualization
|
|
413
|
+
* using raw answer data.
|
|
414
|
+
*/
|
|
415
|
+
hideResults?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* If set to true, expands all the data sources panel.
|
|
418
|
+
*/
|
|
419
|
+
expandAllDataSource?: boolean;
|
|
420
|
+
/**
|
|
421
|
+
* If set to true, the Search Assist feature is enabled.
|
|
422
|
+
*
|
|
423
|
+
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
424
|
+
*/
|
|
425
|
+
enableSearchAssist?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* If set to true, the tabular view is set as the default
|
|
428
|
+
* format for presenting search data.
|
|
429
|
+
*/
|
|
430
|
+
forceTable?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* The array of data source GUIDs to set on load.
|
|
433
|
+
* Only a single dataSource supported currently.
|
|
434
|
+
*
|
|
435
|
+
* @deprecated Use dataSource instead
|
|
436
|
+
*/
|
|
437
|
+
dataSources?: string[];
|
|
438
|
+
/**
|
|
439
|
+
* The array of data source GUIDs to set on load.
|
|
440
|
+
*
|
|
441
|
+
* @version: SDK: 1.19.0
|
|
442
|
+
*/
|
|
443
|
+
dataSource?: string;
|
|
444
|
+
/**
|
|
445
|
+
* The initial search query to load the answer with.
|
|
446
|
+
*
|
|
447
|
+
* @deprecated Use {@link searchOptions} instead
|
|
448
|
+
*/
|
|
449
|
+
searchQuery?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Configuration for search options
|
|
452
|
+
*/
|
|
453
|
+
searchOptions?: SearchOptions;
|
|
454
|
+
/**
|
|
455
|
+
* The GUID of a saved answer to load initially.
|
|
456
|
+
*/
|
|
457
|
+
answerId?: string;
|
|
458
|
+
/**
|
|
459
|
+
* If set to true, search page will render without the Search Bar
|
|
460
|
+
* The chart/table should still be visible.
|
|
461
|
+
*
|
|
462
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
463
|
+
*/
|
|
464
|
+
hideSearchBar?: boolean;
|
|
465
|
+
}
|
|
466
|
+
export const HiddenActionItemByDefaultForSearchEmbed: Action[];
|
|
467
|
+
/**
|
|
468
|
+
* Embed ThoughtSpot search
|
|
469
|
+
*
|
|
470
|
+
* @group Embed components
|
|
471
|
+
*/
|
|
472
|
+
export class SearchEmbed extends TsEmbed {
|
|
473
|
+
/**
|
|
474
|
+
* The view configuration for the embedded ThoughtSpot search.
|
|
475
|
+
*/
|
|
476
|
+
protected viewConfig: SearchViewConfig;
|
|
477
|
+
constructor(domSelector: DOMSelector, viewConfig: SearchViewConfig);
|
|
478
|
+
protected getEmbedParams(): string;
|
|
479
|
+
/**
|
|
480
|
+
* Render the embedded ThoughtSpot search
|
|
481
|
+
*/
|
|
482
|
+
render(): SearchEmbed;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @group Embed components
|
|
487
|
+
*/
|
|
488
|
+
export interface SearchBarViewConfig extends Omit<ViewConfig, 'runtimeFilters' | 'showAlerts'> {
|
|
489
|
+
/**
|
|
490
|
+
* The array of data source GUIDs to set on load.
|
|
491
|
+
* Only a single dataSource supported currently.
|
|
492
|
+
*
|
|
493
|
+
* @deprecated Use dataSource instead
|
|
494
|
+
*/
|
|
495
|
+
dataSources?: string[];
|
|
496
|
+
/**
|
|
497
|
+
* The array of data source GUIDs to set on load.
|
|
498
|
+
*
|
|
499
|
+
* @version: SDK: 1.19.0
|
|
500
|
+
*/
|
|
501
|
+
dataSource?: string;
|
|
502
|
+
/**
|
|
503
|
+
* Configuration for search options
|
|
504
|
+
*/
|
|
505
|
+
searchOptions?: SearchOptions;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Embed ThoughtSpot search bar
|
|
509
|
+
*
|
|
510
|
+
* @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
511
|
+
* @group Embed components
|
|
512
|
+
*/
|
|
513
|
+
export class SearchBarEmbed extends TsEmbed {
|
|
514
|
+
/**
|
|
515
|
+
* The view configuration for the embedded ThoughtSpot search bar.
|
|
516
|
+
*/
|
|
517
|
+
protected viewConfig: SearchBarViewConfig;
|
|
518
|
+
constructor(domSelector: string, viewConfig: SearchBarViewConfig);
|
|
519
|
+
/**
|
|
520
|
+
* Render the embedded ThoughtSpot search
|
|
521
|
+
*/
|
|
522
|
+
render(): SearchBarEmbed;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export let loggedInStatus: boolean;
|
|
526
|
+
export let samlAuthWindow: Window;
|
|
527
|
+
export let samlCompletionPromise: Promise<void>;
|
|
528
|
+
export const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
529
|
+
export const EndPoints: {
|
|
530
|
+
AUTH_VERIFICATION: string;
|
|
531
|
+
SAML_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
532
|
+
OIDC_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
533
|
+
TOKEN_LOGIN: string;
|
|
534
|
+
BASIC_LOGIN: string;
|
|
535
|
+
LOGOUT: string;
|
|
536
|
+
};
|
|
537
|
+
interface sessionInfoInterface {
|
|
538
|
+
userGUID: any;
|
|
539
|
+
isPublicUser: any;
|
|
540
|
+
mixpanelToken: any;
|
|
541
|
+
[key: string]: any;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Enum for auth failure types. This is the parameter passed to the listner
|
|
545
|
+
* of {@link AuthStatus.FAILURE}.
|
|
546
|
+
*
|
|
547
|
+
* @group Authentication / Init
|
|
548
|
+
*/
|
|
549
|
+
export enum AuthFailureType {
|
|
550
|
+
SDK = "SDK",
|
|
551
|
+
NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
|
|
552
|
+
EXPIRY = "EXPIRY",
|
|
553
|
+
OTHER = "OTHER"
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
557
|
+
*
|
|
558
|
+
* @group Authentication / Init
|
|
559
|
+
*/
|
|
560
|
+
export enum AuthStatus {
|
|
561
|
+
/**
|
|
562
|
+
* Emits when the SDK fails to authenticate
|
|
563
|
+
*/
|
|
564
|
+
FAILURE = "FAILURE",
|
|
565
|
+
/**
|
|
566
|
+
* Emits when the SDK authenticates successfully
|
|
567
|
+
*/
|
|
568
|
+
SDK_SUCCESS = "SDK_SUCCESS",
|
|
569
|
+
/**
|
|
570
|
+
* Emits when the app sends an authentication success message
|
|
571
|
+
*/
|
|
572
|
+
SUCCESS = "SUCCESS",
|
|
573
|
+
/**
|
|
574
|
+
* Emits when a user logs out
|
|
575
|
+
*/
|
|
576
|
+
LOGOUT = "LOGOUT",
|
|
577
|
+
/**
|
|
578
|
+
* Emitted when inPopup: true in the SAMLRedirect flow.
|
|
579
|
+
* And, we are waiting for popup to be triggered either programatically
|
|
580
|
+
* or by the trigger button.
|
|
581
|
+
*
|
|
582
|
+
* @version SDK: 1.19.0
|
|
583
|
+
*/
|
|
584
|
+
WAITING_FOR_POPUP = "WAITING_FOR_POPUP"
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Event emitter returned from {@link init}.
|
|
588
|
+
*
|
|
589
|
+
* @group Authentication / Init
|
|
590
|
+
*/
|
|
591
|
+
export interface AuthEventEmitter {
|
|
592
|
+
/**
|
|
593
|
+
* Register a listener on Auth failure.
|
|
594
|
+
*
|
|
595
|
+
* @param event
|
|
596
|
+
* @param listener
|
|
597
|
+
*/
|
|
598
|
+
on(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
599
|
+
/**
|
|
600
|
+
* Register a listener on Auth SDK success.
|
|
601
|
+
*
|
|
602
|
+
* @param event
|
|
603
|
+
* @param listener
|
|
604
|
+
*/
|
|
605
|
+
on(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
606
|
+
on(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
607
|
+
once(event: AuthStatus.FAILURE, listener: (failureType: AuthFailureType) => void): this;
|
|
608
|
+
once(event: AuthStatus.SDK_SUCCESS | AuthStatus.LOGOUT | AuthStatus.WAITING_FOR_POPUP, listener: () => void): this;
|
|
609
|
+
once(event: AuthStatus.SUCCESS, listener: (sessionInfo: any) => void): this;
|
|
610
|
+
/**
|
|
611
|
+
* Trigger an event on the emitter returned from init.
|
|
612
|
+
*
|
|
613
|
+
* @param {@link AuthEvent}
|
|
614
|
+
*/
|
|
615
|
+
emit(event: AuthEvent): void;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Events which can be triggered on the emitter returned from {@link init}.
|
|
619
|
+
*
|
|
620
|
+
* @group Authentication / Init
|
|
621
|
+
*/
|
|
622
|
+
export enum AuthEvent {
|
|
623
|
+
/**
|
|
624
|
+
* Manually trigger the SSO popup. This is useful with
|
|
625
|
+
* authStatus: SAMLRedirect/OIDCRedicre and inPopup: true
|
|
626
|
+
*/
|
|
627
|
+
TRIGGER_SSO_POPUP = "TRIGGER_SSO_POPUP"
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
*
|
|
631
|
+
*/
|
|
632
|
+
export function getAuthEE(): EventEmitter<AuthStatus | AuthEvent>;
|
|
633
|
+
/**
|
|
634
|
+
*
|
|
635
|
+
* @param eventEmitter
|
|
636
|
+
*/
|
|
637
|
+
export function setAuthEE(eventEmitter: EventEmitter<AuthStatus | AuthEvent>): void;
|
|
638
|
+
/**
|
|
639
|
+
*
|
|
640
|
+
*/
|
|
641
|
+
export function notifyAuthSDKSuccess(): void;
|
|
642
|
+
/**
|
|
643
|
+
*
|
|
644
|
+
*/
|
|
645
|
+
export function notifyAuthSuccess(): void;
|
|
646
|
+
/**
|
|
647
|
+
*
|
|
648
|
+
* @param failureType
|
|
649
|
+
*/
|
|
650
|
+
export function notifyAuthFailure(failureType: AuthFailureType): void;
|
|
651
|
+
/**
|
|
652
|
+
*
|
|
653
|
+
*/
|
|
654
|
+
export function notifyLogout(): void;
|
|
655
|
+
export const initSession: (sessionDetails: sessionInfoInterface) => void;
|
|
656
|
+
export const getSessionDetails: (sessionInfoResp: any) => sessionInfoInterface;
|
|
657
|
+
/**
|
|
658
|
+
* Return releaseVersion if available
|
|
659
|
+
*/
|
|
660
|
+
export function getReleaseVersion(): string;
|
|
661
|
+
/**
|
|
662
|
+
* Return a promise that resolves with the session information when
|
|
663
|
+
* authentication is successful. And info is available.
|
|
664
|
+
*
|
|
665
|
+
* @group Global methods
|
|
666
|
+
*/
|
|
667
|
+
export function getSessionInfo(): Promise<sessionInfoInterface>;
|
|
668
|
+
export const getAuthenticaionToken: (embedConfig: EmbedConfig) => Promise<any>;
|
|
669
|
+
/**
|
|
670
|
+
* Perform token based authentication
|
|
671
|
+
*
|
|
672
|
+
* @param embedConfig The embed configuration
|
|
673
|
+
*/
|
|
674
|
+
export const doTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
675
|
+
/**
|
|
676
|
+
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
677
|
+
*
|
|
678
|
+
* @param embedConfig The embed configuration
|
|
679
|
+
*/
|
|
680
|
+
export const doCookielessTokenAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
681
|
+
/**
|
|
682
|
+
* Perform basic authentication to the ThoughtSpot cluster using the cluster
|
|
683
|
+
* credentials.
|
|
684
|
+
*
|
|
685
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
686
|
+
* strongly advised not to use this authentication method in production.
|
|
687
|
+
*
|
|
688
|
+
* @param embedConfig The embed configuration
|
|
689
|
+
*/
|
|
690
|
+
export const doBasicAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
691
|
+
export const doSamlAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
692
|
+
export const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
693
|
+
export const logout: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
694
|
+
/**
|
|
695
|
+
* Perform authentication on the ThoughtSpot cluster
|
|
696
|
+
*
|
|
697
|
+
* @param embedConfig The embed configuration
|
|
698
|
+
*/
|
|
699
|
+
export const authenticate: (embedConfig: EmbedConfig) => Promise<boolean>;
|
|
700
|
+
/**
|
|
701
|
+
* Check if we are authenticated to the ThoughtSpot cluster
|
|
702
|
+
*/
|
|
703
|
+
export const isAuthenticated: () => boolean;
|
|
704
|
+
export {};
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* The authentication mechanism for allowing access to the
|
|
708
|
+
* the embedded app
|
|
709
|
+
*
|
|
710
|
+
* @group Authentication / Init
|
|
711
|
+
*/
|
|
712
|
+
export enum AuthType {
|
|
713
|
+
/**
|
|
714
|
+
* No authentication on the SDK. Passthrough to the embedded App. Alias for
|
|
715
|
+
* `Passthrough`.
|
|
716
|
+
*
|
|
717
|
+
* @example
|
|
718
|
+
* ```js
|
|
719
|
+
* init({
|
|
720
|
+
* // ...
|
|
721
|
+
* authType: AuthType.None,
|
|
722
|
+
* });
|
|
723
|
+
* ```
|
|
724
|
+
*/
|
|
725
|
+
None = "None",
|
|
726
|
+
/**
|
|
727
|
+
* Passthrough SSO to the embedded App within the iframe. Requires least
|
|
728
|
+
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
729
|
+
* if SSO is not configured on ThoughtSpot.
|
|
730
|
+
*
|
|
731
|
+
* @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
|
|
732
|
+
*/
|
|
733
|
+
EmbeddedSSO = "EmbeddedSSO",
|
|
734
|
+
/**
|
|
735
|
+
* SSO using SAML
|
|
736
|
+
*
|
|
737
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
738
|
+
* @hidden
|
|
739
|
+
*/
|
|
740
|
+
SSO = "SSO_SAML",
|
|
741
|
+
/**
|
|
742
|
+
* SSO using SAML
|
|
743
|
+
*
|
|
744
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
745
|
+
* @hidden
|
|
746
|
+
*/
|
|
747
|
+
SAML = "SSO_SAML",
|
|
748
|
+
/**
|
|
749
|
+
* SSO using SAML
|
|
750
|
+
* Will make the host application redirect to the SAML Idp. Use this
|
|
751
|
+
* when the idp does not allow itself to be embedded.
|
|
752
|
+
*
|
|
753
|
+
* This redirects the host application to the SAML Idp. The host application
|
|
754
|
+
* will be redirected back to the ThoughtSpot app after authentication.
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
757
|
+
* ```js
|
|
758
|
+
* init({
|
|
759
|
+
* // ...
|
|
760
|
+
* authType: AuthType.SAMLRedirect,
|
|
761
|
+
* });
|
|
762
|
+
* ```
|
|
763
|
+
*
|
|
764
|
+
* This opens the SAML Idp in a popup window. The popup is triggered
|
|
765
|
+
* when the user clicks the trigger button. The popup window will be
|
|
766
|
+
* closed automatically after authentication.
|
|
767
|
+
* @example
|
|
768
|
+
* ```js
|
|
769
|
+
* init({
|
|
770
|
+
* // ...
|
|
771
|
+
* authType: AuthType.SAMLRedirect,
|
|
772
|
+
* authTriggerText: 'Login with SAML',
|
|
773
|
+
* authTriggerContainer: '#embed-container',
|
|
774
|
+
* inPopup: true,
|
|
775
|
+
* });
|
|
776
|
+
* ```
|
|
777
|
+
*
|
|
778
|
+
* Can also use event to trigger the popup flow. Works the same
|
|
779
|
+
* as above example.
|
|
780
|
+
* @example
|
|
781
|
+
* ```js
|
|
782
|
+
* const authEE = init({
|
|
783
|
+
* // ...
|
|
784
|
+
* authType: AuthType.SAMLRedirect,
|
|
785
|
+
* inPopup: true,
|
|
786
|
+
* });
|
|
787
|
+
*
|
|
788
|
+
* someButtonOnYourPage.addEventListener('click', () => {
|
|
789
|
+
* authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
|
|
790
|
+
* });
|
|
791
|
+
* ```
|
|
792
|
+
*/
|
|
793
|
+
SAMLRedirect = "SSO_SAML",
|
|
794
|
+
/**
|
|
795
|
+
* SSO using OIDC
|
|
796
|
+
*
|
|
797
|
+
* @hidden
|
|
798
|
+
* @deprecated Use {@link OIDCRedirect} instead
|
|
799
|
+
*/
|
|
800
|
+
OIDC = "SSO_OIDC",
|
|
801
|
+
/**
|
|
802
|
+
* SSO using OIDC
|
|
803
|
+
* Will make the host application redirect to the OIDC Idp.
|
|
804
|
+
* See code samples in {@link SAMLRedirect}.
|
|
805
|
+
*/
|
|
806
|
+
OIDCRedirect = "SSO_OIDC",
|
|
807
|
+
/**
|
|
808
|
+
* Trusted authentication server
|
|
809
|
+
*
|
|
810
|
+
* @hidden
|
|
811
|
+
* @deprecated Use {@link TrustedAuth} instead
|
|
812
|
+
*/
|
|
813
|
+
AuthServer = "AuthServer",
|
|
814
|
+
/**
|
|
815
|
+
* Trusted authentication server, Use your own authentication server
|
|
816
|
+
* which returns a bearer token, generated using the secret_key obtained
|
|
817
|
+
* from ThoughtSpot.
|
|
818
|
+
*
|
|
819
|
+
* @example
|
|
820
|
+
* ```js
|
|
821
|
+
* init({
|
|
822
|
+
* // ...
|
|
823
|
+
* authType: AuthType.TrustedAuthToken,
|
|
824
|
+
* getAuthToken: () => {
|
|
825
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
826
|
+
* .then((response) => response.json())
|
|
827
|
+
* .then((data) => data.token);
|
|
828
|
+
* }
|
|
829
|
+
* ```
|
|
830
|
+
*/
|
|
831
|
+
TrustedAuthToken = "AuthServer",
|
|
832
|
+
/**
|
|
833
|
+
* Trusted authentication server Cookieless, Use you own authentication
|
|
834
|
+
* server which returns a bearer token, generated using the secret_key
|
|
835
|
+
* obtained from ThoughtSpot. This uses a cookieless authentication
|
|
836
|
+
* approach, recommended to by pass third-party cookie-blocking restriction
|
|
837
|
+
* implemented by some browsers
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* ```js
|
|
841
|
+
* init({
|
|
842
|
+
* // ...
|
|
843
|
+
* authType: AuthType.TrustedAuthTokenCookieless,
|
|
844
|
+
* getAuthToken: () => {
|
|
845
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
846
|
+
* .then((response) => response.json())
|
|
847
|
+
* .then((data) => data.token);
|
|
848
|
+
* }
|
|
849
|
+
* ```
|
|
850
|
+
* @version SDK: 1.22.0| ThouhgtSpot: 9.3.0.cl, 9.5.1-sw
|
|
851
|
+
*/
|
|
852
|
+
TrustedAuthTokenCookieless = "AuthServerCookieless",
|
|
853
|
+
/**
|
|
854
|
+
* Use the ThoughtSpot login API to authenticate to the cluster directly.
|
|
855
|
+
*
|
|
856
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
857
|
+
* strongly advised not to use this authentication method in production.
|
|
858
|
+
*/
|
|
859
|
+
Basic = "Basic"
|
|
860
|
+
}
|
|
861
|
+
export type DOMSelector = string | HTMLElement;
|
|
862
|
+
/**
|
|
863
|
+
* inline customCSS within the {@link CustomisationsInterface}.
|
|
864
|
+
*/
|
|
865
|
+
export interface customCssInterface {
|
|
866
|
+
variables?: {
|
|
867
|
+
[variableName: string]: string;
|
|
868
|
+
};
|
|
869
|
+
rules_UNSTABLE?: {
|
|
870
|
+
[selector: string]: {
|
|
871
|
+
[declaration: string]: string;
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Styles within the {@link CustomisationsInterface}.
|
|
877
|
+
*/
|
|
878
|
+
export interface CustomStyles {
|
|
879
|
+
customCSSUrl?: string;
|
|
880
|
+
customCSS?: customCssInterface;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Configuration to define the customization on the Embedded
|
|
884
|
+
* Thoughtspot components.
|
|
885
|
+
*
|
|
886
|
+
* @example
|
|
887
|
+
* ```js
|
|
888
|
+
* init({
|
|
889
|
+
* // ...
|
|
890
|
+
* customizations: {
|
|
891
|
+
* style: {
|
|
892
|
+
* customCSS: {
|
|
893
|
+
* variables: {},
|
|
894
|
+
* rules_UNSTABLE: {}
|
|
895
|
+
* }
|
|
896
|
+
* },
|
|
897
|
+
* content: {
|
|
898
|
+
* strings: {
|
|
899
|
+
* 'LIVEBOARDS': 'Dashboards'
|
|
900
|
+
* }
|
|
901
|
+
* },
|
|
902
|
+
* iconSpriteUrl: 'https://my-custom-icon-sprite.svg'
|
|
903
|
+
* }
|
|
904
|
+
* })
|
|
905
|
+
* ```
|
|
906
|
+
*/
|
|
907
|
+
export interface CustomisationsInterface {
|
|
908
|
+
style?: CustomStyles;
|
|
909
|
+
content?: {
|
|
910
|
+
strings?: Record<string, any>;
|
|
911
|
+
[key: string]: any;
|
|
912
|
+
};
|
|
913
|
+
iconSpriteUrl?: string;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* The configuration object for embedding ThoughtSpot content.
|
|
917
|
+
* It includes the ThoughtSpot hostname or IP address,
|
|
918
|
+
* the type of authentication, and the authentication endpoint
|
|
919
|
+
* if a trusted authentication server is used.
|
|
920
|
+
*
|
|
921
|
+
* @group Authentication / Init
|
|
922
|
+
*/
|
|
923
|
+
export interface EmbedConfig {
|
|
924
|
+
/**
|
|
925
|
+
* The ThoughtSpot cluster hostname or IP address.
|
|
926
|
+
*/
|
|
927
|
+
thoughtSpotHost: string;
|
|
928
|
+
/**
|
|
929
|
+
* The authentication mechanism to use.
|
|
930
|
+
*/
|
|
931
|
+
authType: AuthType;
|
|
932
|
+
/**
|
|
933
|
+
* [AuthServer] The trusted authentication endpoint to use to get the
|
|
934
|
+
* authentication token. A GET request is made to the
|
|
935
|
+
* authentication API endpoint, which returns the token
|
|
936
|
+
* as a plaintext response. For trusted authentication,
|
|
937
|
+
* the `authEndpoint` or `getAuthToken` attribute is required.
|
|
938
|
+
*/
|
|
939
|
+
authEndpoint?: string;
|
|
940
|
+
/**
|
|
941
|
+
* [AuthServer] A function that invokes the trusted authentication endpoint
|
|
942
|
+
* and returns a Promise that resolves to the `auth token` string.
|
|
943
|
+
* For trusted authentication, the `authEndpoint` or `getAuthToken`
|
|
944
|
+
* attribute is required.
|
|
945
|
+
*
|
|
946
|
+
* It is advisable to fetch a new token inside this method and not
|
|
947
|
+
* reuse and older issued token, as because when auth expires this is
|
|
948
|
+
* called again and if it is called with an older token the authentication
|
|
949
|
+
* will not succeed.
|
|
950
|
+
*/
|
|
951
|
+
getAuthToken?: () => Promise<string>;
|
|
952
|
+
/**
|
|
953
|
+
* [AuthServer / Basic] The user name of the ThoughtSpot user. This
|
|
954
|
+
* attribute is required for trusted authentication.
|
|
955
|
+
*/
|
|
956
|
+
username?: string;
|
|
957
|
+
/**
|
|
958
|
+
* [Basic] The ThoughtSpot login password corresponding to the user name
|
|
959
|
+
*
|
|
960
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
961
|
+
* strongly advised not to use this authentication method in production.
|
|
962
|
+
*/
|
|
963
|
+
password?: string;
|
|
964
|
+
/**
|
|
965
|
+
* [SSO] For SSO Authentication, if `noRedirect` is set to true, it will
|
|
966
|
+
* open the SAML auth flow in a popup, instead of redirecting browser in
|
|
967
|
+
* place.
|
|
968
|
+
*
|
|
969
|
+
* @default false
|
|
970
|
+
* @deprecated
|
|
971
|
+
*/
|
|
972
|
+
noRedirect?: boolean;
|
|
973
|
+
/**
|
|
974
|
+
* [SSO] For SSO Authentication, if `inPopup` is set to true, it will open
|
|
975
|
+
* the SAML auth flow in a popup, instead of redirecting browser in place.
|
|
976
|
+
*
|
|
977
|
+
* Need to use this with authTriggerContainer. Or manually trigger
|
|
978
|
+
* the AuthEvent.TRIGGER_SSO_POPUP event on a user interaction.
|
|
979
|
+
*
|
|
980
|
+
* @default false
|
|
981
|
+
* @version SDK: 1.18.0
|
|
982
|
+
*/
|
|
983
|
+
inPopup?: boolean;
|
|
984
|
+
/**
|
|
985
|
+
* [SSO] For SSO Authentication, one can supply an optional path param,
|
|
986
|
+
* this will be the path on the host origin where the SAML flow will be
|
|
987
|
+
* terminated.
|
|
988
|
+
*
|
|
989
|
+
* Eg: "/dashboard", "#/foo" [Do not include the host]
|
|
990
|
+
*
|
|
991
|
+
* @version SDK: 1.10.2 | 8.2.0.cl, 8.4.1-sw
|
|
992
|
+
*/
|
|
993
|
+
redirectPath?: string;
|
|
994
|
+
/** @internal */
|
|
995
|
+
basepath?: string;
|
|
996
|
+
/**
|
|
997
|
+
* Should we encode URL Query Params using base64 encoding which thoughtspot
|
|
998
|
+
* will generate for embedding. This provides additional security to
|
|
999
|
+
* thoughtspot clusters against Cross site scripting attacks.
|
|
1000
|
+
*
|
|
1001
|
+
* @default false
|
|
1002
|
+
*/
|
|
1003
|
+
shouldEncodeUrlQueryParams?: boolean;
|
|
1004
|
+
/**
|
|
1005
|
+
* Suppress cookie access alert when third party cookies are blocked by the
|
|
1006
|
+
* user's browser. Third party cookie blocking is the default behaviour on
|
|
1007
|
+
* Safari and opt-in for Firefox/Chrome. If you set this to `true`, you are
|
|
1008
|
+
* encouraged to handle `noCookieAccess` event, to show your own treatment
|
|
1009
|
+
* in this case.
|
|
1010
|
+
*
|
|
1011
|
+
* @default false
|
|
1012
|
+
*/
|
|
1013
|
+
suppressNoCookieAccessAlert?: boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* Re-login when session expires with the previous login options
|
|
1016
|
+
*
|
|
1017
|
+
* @default false
|
|
1018
|
+
*/
|
|
1019
|
+
autoLogin?: boolean;
|
|
1020
|
+
/**
|
|
1021
|
+
* Disable redirection to the login page when the embedded session expires
|
|
1022
|
+
* This flag is typically used alongside the combination of auth modes such as {@link
|
|
1023
|
+
* AuthType.AuthServer} and auto login behavior {@link EmbedConfig.autoLogin}
|
|
1024
|
+
*
|
|
1025
|
+
* @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
1026
|
+
* @default false
|
|
1027
|
+
*/
|
|
1028
|
+
disableLoginRedirect?: boolean;
|
|
1029
|
+
/**
|
|
1030
|
+
* This message is displayed on the embed view when the login fails.
|
|
1031
|
+
*
|
|
1032
|
+
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
1033
|
+
*/
|
|
1034
|
+
loginFailedMessage?: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Calls the prefetch method internally when set to true
|
|
1037
|
+
*
|
|
1038
|
+
* @default false
|
|
1039
|
+
*/
|
|
1040
|
+
callPrefetch?: boolean;
|
|
1041
|
+
/**
|
|
1042
|
+
* When there are multiple embeds, queue the render of embed to start
|
|
1043
|
+
* after the previous embed's render is complete. This helps in the load
|
|
1044
|
+
* performance by decreasing the load on the browser.
|
|
1045
|
+
*
|
|
1046
|
+
* @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
1047
|
+
* @default false
|
|
1048
|
+
*/
|
|
1049
|
+
queueMultiRenders?: boolean;
|
|
1050
|
+
/**
|
|
1051
|
+
* Dynamic CSS Url to be injected in the loaded application.
|
|
1052
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
1053
|
+
*
|
|
1054
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
1055
|
+
* @default ''
|
|
1056
|
+
*/
|
|
1057
|
+
customCssUrl?: string;
|
|
1058
|
+
/**
|
|
1059
|
+
* [AuthServer|Basic] Detect if 3rd party cookies are enabled by doing an
|
|
1060
|
+
* additional call. This is slower and should be avoided. Listen to the
|
|
1061
|
+
* NO_COOKIE_ACCESS event to handle the situation.
|
|
1062
|
+
*
|
|
1063
|
+
* This is slightly slower than letting the browser handle the cookie check, as it
|
|
1064
|
+
* involves an extra network call.
|
|
1065
|
+
*
|
|
1066
|
+
* @version SDK: 1.10.4 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
1067
|
+
*/
|
|
1068
|
+
detectCookieAccessSlow?: boolean;
|
|
1069
|
+
/**
|
|
1070
|
+
* Hide beta alert warning message for SearchEmbed.
|
|
1071
|
+
*
|
|
1072
|
+
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw*
|
|
1073
|
+
*/
|
|
1074
|
+
suppressSearchEmbedBetaWarning?: boolean;
|
|
1075
|
+
/**
|
|
1076
|
+
* Custom style params for embed Config.
|
|
1077
|
+
*
|
|
1078
|
+
* @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
|
|
1079
|
+
*/
|
|
1080
|
+
customizations?: CustomisationsInterface;
|
|
1081
|
+
/**
|
|
1082
|
+
* For inPopup SAMLRedirect or OIDCRedirect Auth, we need a button which the user
|
|
1083
|
+
* click to trigger the flow. This is the containing element
|
|
1084
|
+
* for that button.
|
|
1085
|
+
*
|
|
1086
|
+
* @example
|
|
1087
|
+
* ```js
|
|
1088
|
+
* init({
|
|
1089
|
+
* authType: AuthType.SAMLRedirect,
|
|
1090
|
+
* inPopup: true,
|
|
1091
|
+
* authTriggerContainer: '#auth-trigger-container'
|
|
1092
|
+
* })
|
|
1093
|
+
* ```
|
|
1094
|
+
* @version SDK: 1.17.0 | ThoughtSpot: *
|
|
1095
|
+
*/
|
|
1096
|
+
authTriggerContainer?: string | HTMLElement;
|
|
1097
|
+
/**
|
|
1098
|
+
* Specify that we want to use the AuthEvent.TRIGGER_SSO_POPUP event to trigger
|
|
1099
|
+
* SAML popup. This is useful when you want to trigger the popup on a custom user
|
|
1100
|
+
* action.
|
|
1101
|
+
*
|
|
1102
|
+
*/
|
|
1103
|
+
useEventForSAMLPopup?: boolean;
|
|
1104
|
+
/**
|
|
1105
|
+
* Text to show in the button which triggers the popup auth flow.
|
|
1106
|
+
* Default: "Authorize".
|
|
1107
|
+
*
|
|
1108
|
+
* @version SDK: 1.17.0 | ThoughtSpot: *
|
|
1109
|
+
*/
|
|
1110
|
+
authTriggerText?: string;
|
|
1111
|
+
}
|
|
1112
|
+
export interface LayoutConfig {
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Embedded iFrame configuration
|
|
1116
|
+
*
|
|
1117
|
+
* @group Embed components
|
|
1118
|
+
*/
|
|
1119
|
+
export interface FrameParams {
|
|
1120
|
+
/**
|
|
1121
|
+
* The width of the iFrame (unit is pixels if numeric).
|
|
1122
|
+
*/
|
|
1123
|
+
width?: number | string;
|
|
1124
|
+
/**
|
|
1125
|
+
* The height of the iFrame (unit is pixels if numeric).
|
|
1126
|
+
*/
|
|
1127
|
+
height?: number | string;
|
|
1128
|
+
/**
|
|
1129
|
+
* Set to 'lazy' to enable lazy loading of the embedded TS frame.
|
|
1130
|
+
* This will defer loading of the frame until it comes into the
|
|
1131
|
+
* viewport. This is useful for performance optimization.
|
|
1132
|
+
*/
|
|
1133
|
+
loading?: 'lazy' | 'eager' | 'auto';
|
|
1134
|
+
/**
|
|
1135
|
+
* This parameters will be passed on the iframe
|
|
1136
|
+
* as is.
|
|
1137
|
+
*/
|
|
1138
|
+
[key: string]: string | number | boolean | undefined;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* The configuration object for an embedded view.
|
|
1142
|
+
*/
|
|
1143
|
+
export interface ViewConfig {
|
|
1144
|
+
/**
|
|
1145
|
+
* @hidden
|
|
1146
|
+
*/
|
|
1147
|
+
layoutConfig?: LayoutConfig;
|
|
1148
|
+
/**
|
|
1149
|
+
* The <b>width</b> and <b>height</b> dimensions to render an embedded
|
|
1150
|
+
* object inside your app. Specify the values in pixels or percentage.
|
|
1151
|
+
*/
|
|
1152
|
+
frameParams?: FrameParams;
|
|
1153
|
+
/**
|
|
1154
|
+
* @hidden
|
|
1155
|
+
*/
|
|
1156
|
+
theme?: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* @hidden
|
|
1159
|
+
*/
|
|
1160
|
+
styleSheet__unstable?: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* The list of actions to disable from the primary menu, more menu
|
|
1163
|
+
* (...), and the contextual menu. These actions will be disabled
|
|
1164
|
+
* for the user.
|
|
1165
|
+
* Use this to disable actions.
|
|
1166
|
+
*
|
|
1167
|
+
* @example
|
|
1168
|
+
* ```js
|
|
1169
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
1170
|
+
* ... // other liveboard view config
|
|
1171
|
+
* disabledActions: [Action.Download, Action.Save]
|
|
1172
|
+
* });
|
|
1173
|
+
* ```
|
|
1174
|
+
*/
|
|
1175
|
+
disabledActions?: Action[];
|
|
1176
|
+
/**
|
|
1177
|
+
* The tooltip to display for disabled actions.
|
|
1178
|
+
*/
|
|
1179
|
+
disabledActionReason?: string;
|
|
1180
|
+
/**
|
|
1181
|
+
* The list of actions to hide from the embedded.
|
|
1182
|
+
* This actions will be hidden from the user.
|
|
1183
|
+
* Use this to hide an action.
|
|
1184
|
+
*
|
|
1185
|
+
* @example
|
|
1186
|
+
* ```js
|
|
1187
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
1188
|
+
* ... // other liveboard view config
|
|
1189
|
+
* hiddenActions: [Action.Download, Action.Export]
|
|
1190
|
+
* });
|
|
1191
|
+
* ```
|
|
1192
|
+
* @important
|
|
1193
|
+
*/
|
|
1194
|
+
hiddenActions?: Action[];
|
|
1195
|
+
/**
|
|
1196
|
+
* The list of actions to display from the primary menu, more menu
|
|
1197
|
+
* (...), and the contextual menu. These will be only actions that
|
|
1198
|
+
* are visible to the user.
|
|
1199
|
+
* Use this to hide all actions except the ones you want to show.
|
|
1200
|
+
*
|
|
1201
|
+
* Use either this or hiddenActions.
|
|
1202
|
+
*
|
|
1203
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
1204
|
+
* @important
|
|
1205
|
+
*/
|
|
1206
|
+
visibleActions?: Action[];
|
|
1207
|
+
/**
|
|
1208
|
+
* Show alert messages and toast messages in the embedded view.
|
|
1209
|
+
*
|
|
1210
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1211
|
+
*/
|
|
1212
|
+
showAlerts?: boolean;
|
|
1213
|
+
/**
|
|
1214
|
+
* The list of runtime filters to apply to a search answer,
|
|
1215
|
+
* visualization, or Liveboard.
|
|
1216
|
+
*/
|
|
1217
|
+
runtimeFilters?: RuntimeFilter[];
|
|
1218
|
+
/**
|
|
1219
|
+
* The locale/language to use for the embedded view.
|
|
1220
|
+
*
|
|
1221
|
+
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
|
|
1222
|
+
*/
|
|
1223
|
+
locale?: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* This is an object (key/val) of override flags which will be applied
|
|
1226
|
+
* to the internal embedded object. This can be used to add any
|
|
1227
|
+
* URL flag.
|
|
1228
|
+
* Warning: This option is for advanced use only and is used internally
|
|
1229
|
+
* to control embed behavior in non-regular ways. We do not publish the
|
|
1230
|
+
* list of supported keys and values associated with each.
|
|
1231
|
+
*
|
|
1232
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
1233
|
+
*/
|
|
1234
|
+
additionalFlags?: {
|
|
1235
|
+
[key: string]: string | number | boolean;
|
|
1236
|
+
};
|
|
1237
|
+
/**
|
|
1238
|
+
* Dynamic CSSUrl and customCSS to be injected in the loaded application.
|
|
1239
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
1240
|
+
*
|
|
1241
|
+
* @version SDK: 1.17.2 | ThoughtSpot: 8.4.1-sw, 8.4.0.cl
|
|
1242
|
+
* @default ''
|
|
1243
|
+
*/
|
|
1244
|
+
customizations?: CustomisationsInterface;
|
|
1245
|
+
/**
|
|
1246
|
+
* Insert as a sibling of the target container, instead of appending to a
|
|
1247
|
+
* child inside it.
|
|
1248
|
+
*/
|
|
1249
|
+
insertAsSibling?: boolean;
|
|
1250
|
+
/**
|
|
1251
|
+
* flag to set ContextMenu Trigger to either left or right click.
|
|
1252
|
+
*
|
|
1253
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1254
|
+
*/
|
|
1255
|
+
contextMenuTrigger?: ContextMenuTriggerOptions;
|
|
1256
|
+
/**
|
|
1257
|
+
* flag to override openNew tab context menu link
|
|
1258
|
+
*
|
|
1259
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1260
|
+
*/
|
|
1261
|
+
linkOverride?: boolean;
|
|
1262
|
+
/**
|
|
1263
|
+
* flag to enable insert into slides action
|
|
1264
|
+
*
|
|
1265
|
+
* @hidden
|
|
1266
|
+
* @private
|
|
1267
|
+
*/
|
|
1268
|
+
insertInToSlide?: boolean;
|
|
1269
|
+
/**
|
|
1270
|
+
* Use a pre-rendered iframe from a pool of pre-rendered iframes
|
|
1271
|
+
* if available and matches the configuration.
|
|
1272
|
+
*
|
|
1273
|
+
* @version SDK: 1.22.0
|
|
1274
|
+
* @hidden
|
|
1275
|
+
*
|
|
1276
|
+
* See [docs]() on how to create a prerender pool.
|
|
1277
|
+
*/
|
|
1278
|
+
usePrerenderedIfAvailable?: boolean;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* MessagePayload: Embed event payload: message type, data and status (start/end)
|
|
1282
|
+
*
|
|
1283
|
+
* @group Events
|
|
1284
|
+
*/
|
|
1285
|
+
export type MessagePayload = {
|
|
1286
|
+
type: string;
|
|
1287
|
+
data: any;
|
|
1288
|
+
status?: string;
|
|
1289
|
+
};
|
|
1290
|
+
/**
|
|
1291
|
+
* MessageOptions: By Providing options, getting specific event start / end based on
|
|
1292
|
+
* option
|
|
1293
|
+
*
|
|
1294
|
+
* @group Events
|
|
1295
|
+
*/
|
|
1296
|
+
export type MessageOptions = {
|
|
1297
|
+
/**
|
|
1298
|
+
* A boolean value indicating that start status events of this type
|
|
1299
|
+
* will be dispatched
|
|
1300
|
+
*/
|
|
1301
|
+
start?: boolean;
|
|
1302
|
+
};
|
|
1303
|
+
/**
|
|
1304
|
+
* MessageCallback: Embed event message callback
|
|
1305
|
+
*
|
|
1306
|
+
* @group Events
|
|
1307
|
+
*/
|
|
1308
|
+
export type MessageCallback = (payload: MessagePayload,
|
|
1309
|
+
/**
|
|
1310
|
+
* responder: Message callback function triggered when embed event
|
|
1311
|
+
* initiated
|
|
1312
|
+
*/
|
|
1313
|
+
responder?: (data: any) => void) => void;
|
|
1314
|
+
/**
|
|
1315
|
+
* MessageCallbackObj: contains message options & callback function
|
|
1316
|
+
*/
|
|
1317
|
+
export type MessageCallbackObj = {
|
|
1318
|
+
/**
|
|
1319
|
+
* options: It contains start, A boolean value indicating that start
|
|
1320
|
+
* status events of this type will be dispatched
|
|
1321
|
+
*/
|
|
1322
|
+
options: MessageOptions;
|
|
1323
|
+
callback: MessageCallback;
|
|
1324
|
+
};
|
|
1325
|
+
export type GenericCallbackFn = (...args: any[]) => any;
|
|
1326
|
+
export type QueryParams = {
|
|
1327
|
+
[key: string]: string;
|
|
1328
|
+
};
|
|
1329
|
+
/**
|
|
1330
|
+
* A map of the supported runtime filter operations
|
|
1331
|
+
*/
|
|
1332
|
+
export enum RuntimeFilterOp {
|
|
1333
|
+
/**
|
|
1334
|
+
* Equals
|
|
1335
|
+
*/
|
|
1336
|
+
EQ = "EQ",
|
|
1337
|
+
/**
|
|
1338
|
+
* Does not equal
|
|
1339
|
+
*/
|
|
1340
|
+
NE = "NE",
|
|
1341
|
+
/**
|
|
1342
|
+
* Less than
|
|
1343
|
+
*/
|
|
1344
|
+
LT = "LT",
|
|
1345
|
+
/**
|
|
1346
|
+
* Less than or equal to
|
|
1347
|
+
*/
|
|
1348
|
+
LE = "LE",
|
|
1349
|
+
/**
|
|
1350
|
+
* Greater than
|
|
1351
|
+
*/
|
|
1352
|
+
GT = "GT",
|
|
1353
|
+
/**
|
|
1354
|
+
* Greater than or equal to
|
|
1355
|
+
*/
|
|
1356
|
+
GE = "GE",
|
|
1357
|
+
/**
|
|
1358
|
+
* Contains
|
|
1359
|
+
*/
|
|
1360
|
+
CONTAINS = "CONTAINS",
|
|
1361
|
+
/**
|
|
1362
|
+
* Begins with
|
|
1363
|
+
*/
|
|
1364
|
+
BEGINS_WITH = "BEGINS_WITH",
|
|
1365
|
+
/**
|
|
1366
|
+
* Ends with
|
|
1367
|
+
*/
|
|
1368
|
+
ENDS_WITH = "ENDS_WITH",
|
|
1369
|
+
/**
|
|
1370
|
+
* Between, inclusive of higher value
|
|
1371
|
+
*/
|
|
1372
|
+
BW_INC_MAX = "BW_INC_MAX",
|
|
1373
|
+
/**
|
|
1374
|
+
* Between, inclusive of lower value
|
|
1375
|
+
*/
|
|
1376
|
+
BW_INC_MIN = "BW_INC_MIN",
|
|
1377
|
+
/**
|
|
1378
|
+
* Between, inclusive of both higher and lower value
|
|
1379
|
+
*/
|
|
1380
|
+
BW_INC = "BW_INC",
|
|
1381
|
+
/**
|
|
1382
|
+
* Between, non-inclusive
|
|
1383
|
+
*/
|
|
1384
|
+
BW = "BW",
|
|
1385
|
+
/**
|
|
1386
|
+
* Is included in this list of values
|
|
1387
|
+
*/
|
|
1388
|
+
IN = "IN"
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* A filter that can be applied to ThoughtSpot answers, Liveboards, or
|
|
1392
|
+
* visualizations at runtime.
|
|
1393
|
+
*/
|
|
1394
|
+
export interface RuntimeFilter {
|
|
1395
|
+
/**
|
|
1396
|
+
* The name of the column to filter on (case-sensitive)
|
|
1397
|
+
*/
|
|
1398
|
+
columnName: string;
|
|
1399
|
+
/**
|
|
1400
|
+
* The operator to apply
|
|
1401
|
+
*/
|
|
1402
|
+
operator: RuntimeFilterOp;
|
|
1403
|
+
/**
|
|
1404
|
+
* The list of operands. Some operators like EQ, LE accept
|
|
1405
|
+
* a single operand, whereas other operators like BW and IN accept multiple
|
|
1406
|
+
* operands.
|
|
1407
|
+
*/
|
|
1408
|
+
values: (number | boolean | string)[];
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* Event types emitted by the embedded ThoughtSpot application.
|
|
1412
|
+
*
|
|
1413
|
+
* To add an event listener use the corresponding
|
|
1414
|
+
* {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
|
|
1415
|
+
*
|
|
1416
|
+
* @example
|
|
1417
|
+
* ```js
|
|
1418
|
+
* import { EmbedEvent } from '@thoughtspot/visual-embed-sdk';
|
|
1419
|
+
* // Or
|
|
1420
|
+
* // const { EmbedEvent } = window.tsembed;
|
|
1421
|
+
*
|
|
1422
|
+
* // create the liveboard embed.
|
|
1423
|
+
*
|
|
1424
|
+
* liveboardEmbed.on(EmbedEvent.Drilldown, (drilldown) => {
|
|
1425
|
+
* console.log('Drilldown event', drilldown);
|
|
1426
|
+
* }));
|
|
1427
|
+
* ```
|
|
1428
|
+
* @group Events
|
|
1429
|
+
*/
|
|
1430
|
+
export enum EmbedEvent {
|
|
1431
|
+
/**
|
|
1432
|
+
* Rendering has initialized.
|
|
1433
|
+
*
|
|
1434
|
+
* @returns timestamp - The timestamp when the event was generated.
|
|
1435
|
+
*/
|
|
1436
|
+
Init = "init",
|
|
1437
|
+
/**
|
|
1438
|
+
* Authentication has either succeeded or failed.
|
|
1439
|
+
*
|
|
1440
|
+
* @returns isLoggedIn - A Boolean specifying whether authentication was successful.
|
|
1441
|
+
*/
|
|
1442
|
+
AuthInit = "authInit",
|
|
1443
|
+
/**
|
|
1444
|
+
* The embed object container has loaded.
|
|
1445
|
+
*
|
|
1446
|
+
* @returns timestamp - The timestamp when the event was generated.
|
|
1447
|
+
*/
|
|
1448
|
+
Load = "load",
|
|
1449
|
+
/**
|
|
1450
|
+
* Data pertaining to answer or Liveboard is received
|
|
1451
|
+
*
|
|
1452
|
+
* @return data - The answer or Liveboard data
|
|
1453
|
+
* @important
|
|
1454
|
+
*/
|
|
1455
|
+
Data = "data",
|
|
1456
|
+
/**
|
|
1457
|
+
* Search/answer/Liveboard filters have been applied/updated by the user.
|
|
1458
|
+
*
|
|
1459
|
+
* @hidden
|
|
1460
|
+
*/
|
|
1461
|
+
FiltersChanged = "filtersChanged",
|
|
1462
|
+
/**
|
|
1463
|
+
* Search query has been updated by the user.
|
|
1464
|
+
*/
|
|
1465
|
+
QueryChanged = "queryChanged",
|
|
1466
|
+
/**
|
|
1467
|
+
* A drill down operation has been performed.
|
|
1468
|
+
*
|
|
1469
|
+
* @returns additionalFilters - Any additional filters applied
|
|
1470
|
+
* @returns drillDownColumns - The columns on which drill down was performed
|
|
1471
|
+
* @returns nonFilteredColumns - The columns that were not filtered
|
|
1472
|
+
*/
|
|
1473
|
+
Drilldown = "drillDown",
|
|
1474
|
+
/**
|
|
1475
|
+
* One or more data sources have been selected.
|
|
1476
|
+
*
|
|
1477
|
+
* @returns dataSourceIds - the list of data sources
|
|
1478
|
+
*/
|
|
1479
|
+
DataSourceSelected = "dataSourceSelected",
|
|
1480
|
+
/**
|
|
1481
|
+
* One or more data columns have been selected.
|
|
1482
|
+
*
|
|
1483
|
+
* @returns columnIds - the list of columns
|
|
1484
|
+
* @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
1485
|
+
*/
|
|
1486
|
+
AddRemoveColumns = "addRemoveColumns",
|
|
1487
|
+
/**
|
|
1488
|
+
* A custom action has been triggered
|
|
1489
|
+
*
|
|
1490
|
+
* @returns actionId - The id of the custom action
|
|
1491
|
+
* @returns data - The answer or Liveboard data
|
|
1492
|
+
*/
|
|
1493
|
+
CustomAction = "customAction",
|
|
1494
|
+
/**
|
|
1495
|
+
* Listen to double clicks on a visualization
|
|
1496
|
+
*
|
|
1497
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
1498
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
1499
|
+
*/
|
|
1500
|
+
VizPointDoubleClick = "vizPointDoubleClick",
|
|
1501
|
+
/**
|
|
1502
|
+
* Listen to clicks on a visualization in a liveboard or Search result.
|
|
1503
|
+
*
|
|
1504
|
+
* @example
|
|
1505
|
+
* ```js
|
|
1506
|
+
* embed.on(ThoughtSpotEmbed.Event.VizPointClick, ({data}) => {
|
|
1507
|
+
* console.log(
|
|
1508
|
+
* data.vizId, // viz id
|
|
1509
|
+
* data.clickedPoint.selectedAttributes[0].value,
|
|
1510
|
+
* data.clickedPoint.selectedAttributes[0].column.name,
|
|
1511
|
+
* data.clickedPoint.selectedMeasures[0].value,
|
|
1512
|
+
* data.clickedPoint.selectedMeasures[0].column.name,
|
|
1513
|
+
* )
|
|
1514
|
+
* });
|
|
1515
|
+
* ```
|
|
1516
|
+
* @return viz, clickedPoint - metadata about point that is clicked
|
|
1517
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1518
|
+
* @important
|
|
1519
|
+
*/
|
|
1520
|
+
VizPointClick = "vizPointClick",
|
|
1521
|
+
/**
|
|
1522
|
+
* An error has occurred.
|
|
1523
|
+
*
|
|
1524
|
+
* @returns error - An error object or message
|
|
1525
|
+
*/
|
|
1526
|
+
Error = "Error",
|
|
1527
|
+
/**
|
|
1528
|
+
* The embedded object has sent an alert
|
|
1529
|
+
*
|
|
1530
|
+
* @returns alert - An alert object
|
|
1531
|
+
*/
|
|
1532
|
+
Alert = "alert",
|
|
1533
|
+
/**
|
|
1534
|
+
* The ThoughtSpot auth session has expired.
|
|
1535
|
+
*/
|
|
1536
|
+
AuthExpire = "ThoughtspotAuthExpired",
|
|
1537
|
+
/**
|
|
1538
|
+
* ThoughtSpot failed to validate the auth session.
|
|
1539
|
+
*
|
|
1540
|
+
* @hidden
|
|
1541
|
+
*/
|
|
1542
|
+
AuthFailure = "ThoughtspotAuthFailure",
|
|
1543
|
+
/**
|
|
1544
|
+
* ThoughtSpot failed to validate the auth session.
|
|
1545
|
+
*
|
|
1546
|
+
* @hidden
|
|
1547
|
+
*/
|
|
1548
|
+
AuthLogout = "ThoughtspotAuthLogout",
|
|
1549
|
+
/**
|
|
1550
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
1551
|
+
*
|
|
1552
|
+
* @returns data - The height of the embedded Liveboard or visualization
|
|
1553
|
+
* @hidden
|
|
1554
|
+
*/
|
|
1555
|
+
EmbedHeight = "EMBED_HEIGHT",
|
|
1556
|
+
/**
|
|
1557
|
+
* The center of visible iframe viewport is calculated.
|
|
1558
|
+
*
|
|
1559
|
+
* @returns data - The center of the visible Iframe viewport.
|
|
1560
|
+
* @hidden
|
|
1561
|
+
*/
|
|
1562
|
+
EmbedIframeCenter = "EmbedIframeCenter",
|
|
1563
|
+
/**
|
|
1564
|
+
* Emitted when the "Get Data" button in Search Bar embed
|
|
1565
|
+
* is clicked.
|
|
1566
|
+
*
|
|
1567
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0-sw
|
|
1568
|
+
*/
|
|
1569
|
+
GetDataClick = "getDataClick",
|
|
1570
|
+
/**
|
|
1571
|
+
* Detects the route change.
|
|
1572
|
+
*/
|
|
1573
|
+
RouteChange = "ROUTE_CHANGE",
|
|
1574
|
+
/**
|
|
1575
|
+
* The v1 event type for Data
|
|
1576
|
+
*
|
|
1577
|
+
* @hidden
|
|
1578
|
+
*/
|
|
1579
|
+
V1Data = "exportVizDataToParent",
|
|
1580
|
+
/**
|
|
1581
|
+
* Emitted when the embed does not have cookie access. This
|
|
1582
|
+
* happens on Safari where third-party cookies are blocked by default.
|
|
1583
|
+
*
|
|
1584
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
1585
|
+
*/
|
|
1586
|
+
NoCookieAccess = "noCookieAccess",
|
|
1587
|
+
/**
|
|
1588
|
+
* Emitted when SAML is complete
|
|
1589
|
+
*
|
|
1590
|
+
* @private
|
|
1591
|
+
* @hidden
|
|
1592
|
+
*/
|
|
1593
|
+
SAMLComplete = "samlComplete",
|
|
1594
|
+
/**
|
|
1595
|
+
* Emitted when any modal is opened in the app
|
|
1596
|
+
*
|
|
1597
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
1598
|
+
*/
|
|
1599
|
+
DialogOpen = "dialog-open",
|
|
1600
|
+
/**
|
|
1601
|
+
* Emitted when any modal is closed in the app
|
|
1602
|
+
*
|
|
1603
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
1604
|
+
*/
|
|
1605
|
+
DialogClose = "dialog-close",
|
|
1606
|
+
/**
|
|
1607
|
+
* Emitted when the Liveboard shell loads.
|
|
1608
|
+
* You can use this event as a hook to trigger
|
|
1609
|
+
* other events on the rendered Liveboard.
|
|
1610
|
+
*
|
|
1611
|
+
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
1612
|
+
*/
|
|
1613
|
+
LiveboardRendered = "PinboardRendered",
|
|
1614
|
+
/**
|
|
1615
|
+
* This can be used to register an event listener which
|
|
1616
|
+
* is triggered on all events.
|
|
1617
|
+
*
|
|
1618
|
+
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
1619
|
+
*/
|
|
1620
|
+
ALL = "*",
|
|
1621
|
+
/**
|
|
1622
|
+
* Emitted when answer is saved in the app
|
|
1623
|
+
*
|
|
1624
|
+
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1625
|
+
*/
|
|
1626
|
+
Save = "save",
|
|
1627
|
+
/**
|
|
1628
|
+
* Emitted when the download action is triggered on an answer
|
|
1629
|
+
*
|
|
1630
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1631
|
+
*/
|
|
1632
|
+
Download = "download",
|
|
1633
|
+
/**
|
|
1634
|
+
* Emitted when the download action is triggered on an answer
|
|
1635
|
+
*
|
|
1636
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0-sw
|
|
1637
|
+
*/
|
|
1638
|
+
DownloadAsPng = "downloadAsPng",
|
|
1639
|
+
/**
|
|
1640
|
+
* Emitted when the Download as PDF action is triggered on an answer
|
|
1641
|
+
*
|
|
1642
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1643
|
+
*/
|
|
1644
|
+
DownloadAsPdf = "downloadAsPdf",
|
|
1645
|
+
/**
|
|
1646
|
+
* Emitted when the Download as CSV action is triggered on an answer
|
|
1647
|
+
*
|
|
1648
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1649
|
+
*/
|
|
1650
|
+
DownloadAsCsv = "downloadAsCsv",
|
|
1651
|
+
/**
|
|
1652
|
+
* Emitted when the Download as XLSX action is triggered on an answer
|
|
1653
|
+
*
|
|
1654
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1655
|
+
*/
|
|
1656
|
+
DownloadAsXlsx = "downloadAsXlsx",
|
|
1657
|
+
/**
|
|
1658
|
+
* Emitted when an answer is deleted in the app
|
|
1659
|
+
*
|
|
1660
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1661
|
+
*/
|
|
1662
|
+
AnswerDelete = "answerDelete",
|
|
1663
|
+
/**
|
|
1664
|
+
* Emitted when an answer is pinned to a Liveboard
|
|
1665
|
+
*
|
|
1666
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1667
|
+
*/
|
|
1668
|
+
Pin = "pin",
|
|
1669
|
+
/**
|
|
1670
|
+
* Emitted when SpotIQ analysis is triggered
|
|
1671
|
+
*
|
|
1672
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1673
|
+
*/
|
|
1674
|
+
SpotIQAnalyze = "spotIQAnalyze",
|
|
1675
|
+
/**
|
|
1676
|
+
* Emitted when a user shares an object with another user or group
|
|
1677
|
+
*
|
|
1678
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1679
|
+
*/
|
|
1680
|
+
Share = "share",
|
|
1681
|
+
/**
|
|
1682
|
+
* Emitted when a user clicks the Include action to include a specific value or data
|
|
1683
|
+
* on a chart or table
|
|
1684
|
+
*
|
|
1685
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1686
|
+
*/
|
|
1687
|
+
DrillInclude = "context-menu-item-include",
|
|
1688
|
+
/**
|
|
1689
|
+
* Emitted when a user clicks the Exclude action to exclude a specific value or data
|
|
1690
|
+
* on a chart or table
|
|
1691
|
+
*
|
|
1692
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1693
|
+
*/
|
|
1694
|
+
DrillExclude = "context-menu-item-exclude",
|
|
1695
|
+
/**
|
|
1696
|
+
* Emitted when copied column value on the app
|
|
1697
|
+
*
|
|
1698
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1699
|
+
*/
|
|
1700
|
+
CopyToClipboard = "context-menu-item-copy-to-clipboard",
|
|
1701
|
+
/**
|
|
1702
|
+
* Emitted when a user clicks the Update TML action
|
|
1703
|
+
*
|
|
1704
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1705
|
+
*/
|
|
1706
|
+
UpdateTML = "updateTSL",
|
|
1707
|
+
/**
|
|
1708
|
+
* Emitted when a user clicks the Edit TML action
|
|
1709
|
+
*
|
|
1710
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1711
|
+
*/
|
|
1712
|
+
EditTML = "editTSL",
|
|
1713
|
+
/**
|
|
1714
|
+
* Emitted when ExportTML trigger in answer on the app
|
|
1715
|
+
*
|
|
1716
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1717
|
+
*/
|
|
1718
|
+
ExportTML = "exportTSL",
|
|
1719
|
+
/**
|
|
1720
|
+
* Emitted when an answer is saved as a view
|
|
1721
|
+
*
|
|
1722
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1723
|
+
*/
|
|
1724
|
+
SaveAsView = "saveAsView",
|
|
1725
|
+
/**
|
|
1726
|
+
* Emitted when copy of existing answer on the app
|
|
1727
|
+
*
|
|
1728
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1729
|
+
*/
|
|
1730
|
+
CopyAEdit = "copyAEdit",
|
|
1731
|
+
/**
|
|
1732
|
+
* Emitted when a user clicks Show underlying data on an answe
|
|
1733
|
+
*
|
|
1734
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1735
|
+
*/
|
|
1736
|
+
ShowUnderlyingData = "showUnderlyingData",
|
|
1737
|
+
/**
|
|
1738
|
+
* Emitted when an answer is switched to a chart or table view
|
|
1739
|
+
*
|
|
1740
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
1741
|
+
*/
|
|
1742
|
+
AnswerChartSwitcher = "answerChartSwitcher",
|
|
1743
|
+
/**
|
|
1744
|
+
* Internal event to communicate the initial settings back to the TS APP
|
|
1745
|
+
*
|
|
1746
|
+
* @hidden
|
|
1747
|
+
*/
|
|
1748
|
+
APP_INIT = "appInit",
|
|
1749
|
+
/**
|
|
1750
|
+
* Emitted when a user clicks Show Liveboard details on a Liveboard
|
|
1751
|
+
*
|
|
1752
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1753
|
+
*/
|
|
1754
|
+
LiveboardInfo = "pinboardInfo",
|
|
1755
|
+
/**
|
|
1756
|
+
* Emitted when a user clicks on the Favorite icon on a Liveboard
|
|
1757
|
+
*
|
|
1758
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1759
|
+
*/
|
|
1760
|
+
AddToFavorites = "addToFavorites",
|
|
1761
|
+
/**
|
|
1762
|
+
* Emitted when a user clicks Schedule on a Liveboard
|
|
1763
|
+
*
|
|
1764
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1765
|
+
*/
|
|
1766
|
+
Schedule = "subscription",
|
|
1767
|
+
/**
|
|
1768
|
+
* Emitted when a user clicks Edit on a Liveboard or visualization
|
|
1769
|
+
*
|
|
1770
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1771
|
+
*/
|
|
1772
|
+
Edit = "edit",
|
|
1773
|
+
/**
|
|
1774
|
+
* Emitted when a user clicks Make a copy on a Liveboard
|
|
1775
|
+
*
|
|
1776
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1777
|
+
*/
|
|
1778
|
+
MakeACopy = "makeACopy",
|
|
1779
|
+
/**
|
|
1780
|
+
* Emitted when a user clicks Present on a Liveboard or visualization
|
|
1781
|
+
*
|
|
1782
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1783
|
+
*/
|
|
1784
|
+
Present = "present",
|
|
1785
|
+
/**
|
|
1786
|
+
* Emitted when a user clicks Delete on a Liveboard
|
|
1787
|
+
*
|
|
1788
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1789
|
+
*/
|
|
1790
|
+
Delete = "delete",
|
|
1791
|
+
/**
|
|
1792
|
+
* Emitted when a user clicks Manage schedules on a Liveboard
|
|
1793
|
+
*
|
|
1794
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1795
|
+
*/
|
|
1796
|
+
SchedulesList = "schedule-list",
|
|
1797
|
+
/**
|
|
1798
|
+
* Emitted when a user clicks Cancel in edit mode on a Liveboard
|
|
1799
|
+
*
|
|
1800
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1801
|
+
*/
|
|
1802
|
+
Cancel = "cancel",
|
|
1803
|
+
/**
|
|
1804
|
+
* Emitted when a user clicks Explore on a visualization
|
|
1805
|
+
*
|
|
1806
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1807
|
+
*/
|
|
1808
|
+
Explore = "explore",
|
|
1809
|
+
/**
|
|
1810
|
+
* Emitted when a user clicks Copy link action on a visualization
|
|
1811
|
+
*
|
|
1812
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1813
|
+
*/
|
|
1814
|
+
CopyLink = "embedDocument",
|
|
1815
|
+
/**
|
|
1816
|
+
* Emitted when a user interacts with cross filters on a visualization or liveboard
|
|
1817
|
+
*
|
|
1818
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1819
|
+
*/
|
|
1820
|
+
CrossFilterChanged = "cross-filter-changed",
|
|
1821
|
+
/**
|
|
1822
|
+
* Emitted when a user right clicks on a visualization (chart or table)
|
|
1823
|
+
*
|
|
1824
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1825
|
+
*/
|
|
1826
|
+
VizPointRightClick = "vizPointRightClick",
|
|
1827
|
+
/**
|
|
1828
|
+
* Emitted when a user clicks on Insert to slide on a visualization
|
|
1829
|
+
*
|
|
1830
|
+
* @hidden
|
|
1831
|
+
*/
|
|
1832
|
+
InsertIntoSlide = "insertInToSlide"
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Event types that can be triggered by the host application
|
|
1836
|
+
* to the embedded ThoughtSpot app
|
|
1837
|
+
*
|
|
1838
|
+
* To trigger an event use the corresponding
|
|
1839
|
+
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
|
|
1840
|
+
* SearchEmbed.trigger} method.
|
|
1841
|
+
*
|
|
1842
|
+
* @example
|
|
1843
|
+
* ```js
|
|
1844
|
+
* import { HostEvent } from '@thoughtspot/visual-embed-sdk';
|
|
1845
|
+
* // Or
|
|
1846
|
+
* // const { HostEvent } = window.tsembed;
|
|
1847
|
+
*
|
|
1848
|
+
* // create the liveboard embed.
|
|
1849
|
+
*
|
|
1850
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1851
|
+
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
|
|
1852
|
+
* ]);
|
|
1853
|
+
* ```
|
|
1854
|
+
* @group Events
|
|
1855
|
+
*/
|
|
1856
|
+
export enum HostEvent {
|
|
1857
|
+
/**
|
|
1858
|
+
* Trigger a search
|
|
1859
|
+
*
|
|
1860
|
+
* @param - dataSourceIds - The data source GUID to Search on
|
|
1861
|
+
* - Although an array, only a single source
|
|
1862
|
+
* is supported at this time.
|
|
1863
|
+
* @param - searchQuery - The search query
|
|
1864
|
+
* @param - execute - execute the existing / updated query
|
|
1865
|
+
* @example
|
|
1866
|
+
* ```js
|
|
1867
|
+
* searchEmbed.trigger(HostEvent.Search, {
|
|
1868
|
+
* searchQuery: "[sales] by [item type],
|
|
1869
|
+
* dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"]
|
|
1870
|
+
* execute: true
|
|
1871
|
+
* })
|
|
1872
|
+
* ```
|
|
1873
|
+
*/
|
|
1874
|
+
Search = "search",
|
|
1875
|
+
/**
|
|
1876
|
+
* Trigger a drill on certain points by certain column
|
|
1877
|
+
*
|
|
1878
|
+
* @param - points - an object containing selectedPoints/clickedPoints
|
|
1879
|
+
* eg. { selectedPoints: []}
|
|
1880
|
+
* @param - columnGuid - a string guid of the column to drill by. This is optional,
|
|
1881
|
+
* if not provided it will auto drill by the configured
|
|
1882
|
+
* column.
|
|
1883
|
+
* @example
|
|
1884
|
+
* ```js
|
|
1885
|
+
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
1886
|
+
* console.log(payload);
|
|
1887
|
+
* const clickedPoint = payload.data.clickedPoint;
|
|
1888
|
+
* const selectedPoint = payload.data.selectedPoints;
|
|
1889
|
+
* console.log('>>> called', clickedPoint);
|
|
1890
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
1891
|
+
* points: {
|
|
1892
|
+
* clickedPoint,
|
|
1893
|
+
* selectedPoints: selectedPoint
|
|
1894
|
+
* },
|
|
1895
|
+
* autoDrillDown: true,
|
|
1896
|
+
* });
|
|
1897
|
+
* })
|
|
1898
|
+
* ```
|
|
1899
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
1900
|
+
*/
|
|
1901
|
+
DrillDown = "triggerDrillDown",
|
|
1902
|
+
/**
|
|
1903
|
+
* Apply filters
|
|
1904
|
+
*
|
|
1905
|
+
* @hidden
|
|
1906
|
+
*/
|
|
1907
|
+
Filter = "filter",
|
|
1908
|
+
/**
|
|
1909
|
+
* Reload the answer or visualization
|
|
1910
|
+
*
|
|
1911
|
+
* @hidden
|
|
1912
|
+
*/
|
|
1913
|
+
Reload = "reload",
|
|
1914
|
+
/**
|
|
1915
|
+
* Set the visible visualizations on a Liveboard.
|
|
1916
|
+
*
|
|
1917
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
1918
|
+
* will be hidden.
|
|
1919
|
+
* @example
|
|
1920
|
+
* ```js
|
|
1921
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
1922
|
+
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
1923
|
+
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
1924
|
+
* ```
|
|
1925
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
1926
|
+
*/
|
|
1927
|
+
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
1928
|
+
/**
|
|
1929
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
1930
|
+
* on to the existing runtime filters if they exist.
|
|
1931
|
+
*
|
|
1932
|
+
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
1933
|
+
* @example
|
|
1934
|
+
* ```js
|
|
1935
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1936
|
+
* {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
|
|
1937
|
+
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
1938
|
+
* ])
|
|
1939
|
+
* ```
|
|
1940
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
1941
|
+
* @important
|
|
1942
|
+
*/
|
|
1943
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters",
|
|
1944
|
+
/**
|
|
1945
|
+
* Navigate to a specific page in App embed without any reload.
|
|
1946
|
+
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
1947
|
+
*
|
|
1948
|
+
* @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```js
|
|
1951
|
+
* appEmbed.navigateToPage(-1)
|
|
1952
|
+
* ```
|
|
1953
|
+
* @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
|
|
1954
|
+
*/
|
|
1955
|
+
Navigate = "Navigate",
|
|
1956
|
+
/**
|
|
1957
|
+
* Opens the filter panel for a particular column.
|
|
1958
|
+
* Works with Search embed.
|
|
1959
|
+
*
|
|
1960
|
+
* @param - { columnId: string,
|
|
1961
|
+
* name: string,
|
|
1962
|
+
* type: INT64/CHAR/DATE,
|
|
1963
|
+
* dataType: ATTRIBUTE/MEASURE }
|
|
1964
|
+
* @example
|
|
1965
|
+
* ```js
|
|
1966
|
+
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
1967
|
+
* { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
1968
|
+
* ```
|
|
1969
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1970
|
+
*/
|
|
1971
|
+
OpenFilter = "openFilter",
|
|
1972
|
+
/**
|
|
1973
|
+
* Adds the columns to the current Search.
|
|
1974
|
+
*
|
|
1975
|
+
* @param - { columnIds: string[] }
|
|
1976
|
+
* @example
|
|
1977
|
+
* ```js
|
|
1978
|
+
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['123', '456'] })
|
|
1979
|
+
* ```
|
|
1980
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1981
|
+
*/
|
|
1982
|
+
AddColumns = "addColumns",
|
|
1983
|
+
/**
|
|
1984
|
+
* Removes a column from the current Search.
|
|
1985
|
+
*
|
|
1986
|
+
* @param - { columnId: string }
|
|
1987
|
+
* @example
|
|
1988
|
+
* ```js
|
|
1989
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '123' })
|
|
1990
|
+
* ```
|
|
1991
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1992
|
+
*/
|
|
1993
|
+
RemoveColumn = "removeColumn",
|
|
1994
|
+
/**
|
|
1995
|
+
* Gets the current pinboard content.
|
|
1996
|
+
*
|
|
1997
|
+
* @example
|
|
1998
|
+
* ```js
|
|
1999
|
+
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
|
|
2000
|
+
* ```
|
|
2001
|
+
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
2002
|
+
*/
|
|
2003
|
+
getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
|
|
2004
|
+
/**
|
|
2005
|
+
* Triggers the Pin action on an embedded object
|
|
2006
|
+
*
|
|
2007
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
2008
|
+
* can be left empty for search and visualization embeds
|
|
2009
|
+
* @example
|
|
2010
|
+
* ```js
|
|
2011
|
+
* liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2012
|
+
* vizEmbed.trigger(HostEvent.Pin)
|
|
2013
|
+
* searchEmbed.trigger(HostEvent.Pin)
|
|
2014
|
+
* ```
|
|
2015
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2016
|
+
*/
|
|
2017
|
+
Pin = "pin",
|
|
2018
|
+
/**
|
|
2019
|
+
* Triggers the Show Liveboard details action on a Liveboard
|
|
2020
|
+
*
|
|
2021
|
+
* @example
|
|
2022
|
+
* ```js
|
|
2023
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
2024
|
+
* ```
|
|
2025
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2026
|
+
*/
|
|
2027
|
+
LiveboardInfo = "pinboardInfo",
|
|
2028
|
+
/**
|
|
2029
|
+
* Triggers the Schedule action on a Liveboard
|
|
2030
|
+
*
|
|
2031
|
+
* @example
|
|
2032
|
+
* ```js
|
|
2033
|
+
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
2034
|
+
* ```
|
|
2035
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2036
|
+
*/
|
|
2037
|
+
Schedule = "subscription",
|
|
2038
|
+
/**
|
|
2039
|
+
* Triggers the Manage schedule action on a Liveboard
|
|
2040
|
+
*
|
|
2041
|
+
* @example
|
|
2042
|
+
* ```js
|
|
2043
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
2044
|
+
* ```
|
|
2045
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2046
|
+
*/
|
|
2047
|
+
SchedulesList = "schedule-list",
|
|
2048
|
+
/**
|
|
2049
|
+
* Triggers the Export TML action on a Liveboard
|
|
2050
|
+
*
|
|
2051
|
+
* @example
|
|
2052
|
+
* ```js
|
|
2053
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
2054
|
+
* ```
|
|
2055
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2056
|
+
*/
|
|
2057
|
+
ExportTML = "exportTSL",
|
|
2058
|
+
/**
|
|
2059
|
+
* Triggers the Edit TML action on a Liveboard
|
|
2060
|
+
*
|
|
2061
|
+
* @example
|
|
2062
|
+
* ```js
|
|
2063
|
+
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
2064
|
+
* ```
|
|
2065
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2066
|
+
*/
|
|
2067
|
+
EditTML = "editTSL",
|
|
2068
|
+
/**
|
|
2069
|
+
* Triggers the Update TML action on a Liveboard
|
|
2070
|
+
*
|
|
2071
|
+
* @example
|
|
2072
|
+
* ```js
|
|
2073
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
2074
|
+
* ```
|
|
2075
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2076
|
+
*/
|
|
2077
|
+
UpdateTML = "updateTSL",
|
|
2078
|
+
/**
|
|
2079
|
+
* Triggers the Download PDF action on a Liveboard
|
|
2080
|
+
*
|
|
2081
|
+
* @example
|
|
2082
|
+
* ```js
|
|
2083
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2084
|
+
* ```
|
|
2085
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2086
|
+
*/
|
|
2087
|
+
DownloadAsPdf = "downloadAsPdf",
|
|
2088
|
+
/**
|
|
2089
|
+
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
2090
|
+
*
|
|
2091
|
+
* @example
|
|
2092
|
+
* ```js
|
|
2093
|
+
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2094
|
+
* vizEmbed.trigger(HostEvent.MakeACopy)
|
|
2095
|
+
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2096
|
+
* ```
|
|
2097
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2098
|
+
*/
|
|
2099
|
+
MakeACopy = "makeACopy",
|
|
2100
|
+
/**
|
|
2101
|
+
* Triggers the Delete action on a Liveboard
|
|
2102
|
+
*
|
|
2103
|
+
* @example
|
|
2104
|
+
* ```js
|
|
2105
|
+
* appEmbed.trigger(HostEvent.Remove)
|
|
2106
|
+
* ```
|
|
2107
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2108
|
+
*/
|
|
2109
|
+
Remove = "delete",
|
|
2110
|
+
/**
|
|
2111
|
+
* Triggers the Explore action on a visualization
|
|
2112
|
+
*
|
|
2113
|
+
* @param - an object with vizId as a key
|
|
2114
|
+
* @example
|
|
2115
|
+
* ```js
|
|
2116
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2117
|
+
* ```
|
|
2118
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2119
|
+
*/
|
|
2120
|
+
Explore = "explore",
|
|
2121
|
+
/**
|
|
2122
|
+
* Triggers the Create alert action on a visualization
|
|
2123
|
+
*
|
|
2124
|
+
* @param - an object with vizId as a key
|
|
2125
|
+
* @example
|
|
2126
|
+
* ```js
|
|
2127
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor {
|
|
2128
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2129
|
+
* })
|
|
2130
|
+
* ```
|
|
2131
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2132
|
+
*/
|
|
2133
|
+
CreateMonitor = "createMonitor",
|
|
2134
|
+
/**
|
|
2135
|
+
* Triggers the Manage alert action on a visualization
|
|
2136
|
+
*
|
|
2137
|
+
* @param - an object with vizId as a key
|
|
2138
|
+
* @example
|
|
2139
|
+
* ```js
|
|
2140
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
2141
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2142
|
+
* })
|
|
2143
|
+
* ```
|
|
2144
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2145
|
+
*/
|
|
2146
|
+
ManageMonitor = "manageMonitor",
|
|
2147
|
+
/**
|
|
2148
|
+
* Triggers the Edit action on a Liveboard or visualization
|
|
2149
|
+
*
|
|
2150
|
+
* @param - object - to trigger the action for a specfic visualization
|
|
2151
|
+
* in Liveboard embed, pass in vizId as a key
|
|
2152
|
+
* @example
|
|
2153
|
+
* ```js
|
|
2154
|
+
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
2155
|
+
*
|
|
2156
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2157
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2158
|
+
*
|
|
2159
|
+
* vizEmbed.trigger((HostEvent.Edit)
|
|
2160
|
+
* ```
|
|
2161
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2162
|
+
*/
|
|
2163
|
+
Edit = "edit",
|
|
2164
|
+
/**
|
|
2165
|
+
* Triggers the Copy link action on a Liveboard or visualization
|
|
2166
|
+
*
|
|
2167
|
+
* @param - object - to trigger the action for a s
|
|
2168
|
+
* pecfic visualization in Liveboard embed, pass in vizId as a key
|
|
2169
|
+
* @example
|
|
2170
|
+
* ```js
|
|
2171
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
2172
|
+
* liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2173
|
+
* vizEmbed.trigger((HostEvent.CopyLink)
|
|
2174
|
+
* ```
|
|
2175
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2176
|
+
*/
|
|
2177
|
+
CopyLink = "embedDocument",
|
|
2178
|
+
/**
|
|
2179
|
+
* Triggers the Present action on a Liveboard or visualization
|
|
2180
|
+
*
|
|
2181
|
+
* @param - object - to trigger the action for a specfic visualization
|
|
2182
|
+
* in Liveboard embed, pass in vizId as a key
|
|
2183
|
+
* @example
|
|
2184
|
+
* ```js
|
|
2185
|
+
* liveboardEmbed.trigger(HostEvent.Present)
|
|
2186
|
+
* liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2187
|
+
* vizEmbed.trigger((HostEvent.Present)
|
|
2188
|
+
* ```
|
|
2189
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
2190
|
+
*/
|
|
2191
|
+
Present = "present",
|
|
2192
|
+
/**
|
|
2193
|
+
* Get TML for the current search.
|
|
2194
|
+
*
|
|
2195
|
+
* @example
|
|
2196
|
+
* ```js
|
|
2197
|
+
* searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
|
|
2198
|
+
* console.log(
|
|
2199
|
+
* tml.search_query // TML representation of the search query
|
|
2200
|
+
* );
|
|
2201
|
+
* })
|
|
2202
|
+
* ```
|
|
2203
|
+
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
2204
|
+
* @important
|
|
2205
|
+
*/
|
|
2206
|
+
GetTML = "getTML",
|
|
2207
|
+
/**
|
|
2208
|
+
* Triggers the ShowUnderlyingData action on visualization or search
|
|
2209
|
+
*
|
|
2210
|
+
* @param - an object with vizId as a key
|
|
2211
|
+
* @example
|
|
2212
|
+
* ```js
|
|
2213
|
+
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId:
|
|
2214
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2215
|
+
*
|
|
2216
|
+
* vizEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
2217
|
+
*
|
|
2218
|
+
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
2219
|
+
* ```
|
|
2220
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2221
|
+
*/
|
|
2222
|
+
ShowUnderlyingData = "showUnderlyingData",
|
|
2223
|
+
/**
|
|
2224
|
+
* Triggers the Delete action on visualization or search
|
|
2225
|
+
*
|
|
2226
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
2227
|
+
* can be left empty for search and visualization embeds
|
|
2228
|
+
* @example
|
|
2229
|
+
* ```js
|
|
2230
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {vizId:
|
|
2231
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2232
|
+
*
|
|
2233
|
+
* vizEmbed.trigger(HostEvent.Delete)
|
|
2234
|
+
*
|
|
2235
|
+
* searchEmbed.trigger(HostEvent.Delete)
|
|
2236
|
+
* ```
|
|
2237
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2238
|
+
*/
|
|
2239
|
+
Delete = "onDeleteAnswer",
|
|
2240
|
+
/**
|
|
2241
|
+
* Triggers the SpotIQAnalyze action on visualization or search
|
|
2242
|
+
*
|
|
2243
|
+
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
2244
|
+
* can be left empty for search and visualization embeds
|
|
2245
|
+
* @example
|
|
2246
|
+
* ```js
|
|
2247
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId:
|
|
2248
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2249
|
+
*
|
|
2250
|
+
* vizEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
2251
|
+
*
|
|
2252
|
+
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
2253
|
+
* ```
|
|
2254
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2255
|
+
*/
|
|
2256
|
+
SpotIQAnalyze = "spotIQAnalyze",
|
|
2257
|
+
/**
|
|
2258
|
+
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
2259
|
+
*
|
|
2260
|
+
* @example
|
|
2261
|
+
* ```js
|
|
2262
|
+
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
2263
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2264
|
+
*
|
|
2265
|
+
* vizEmbed.trigger(HostEvent.Download)
|
|
2266
|
+
*
|
|
2267
|
+
* searchEmbed.trigger(HostEvent.Download)
|
|
2268
|
+
* ```
|
|
2269
|
+
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1-sw ,Use {@link DownloadAsPng}
|
|
2270
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2271
|
+
*/
|
|
2272
|
+
Download = "downloadAsPng",
|
|
2273
|
+
/**
|
|
2274
|
+
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
2275
|
+
*
|
|
2276
|
+
* @example
|
|
2277
|
+
* ```js
|
|
2278
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPng,
|
|
2279
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2280
|
+
*
|
|
2281
|
+
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2282
|
+
*
|
|
2283
|
+
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2284
|
+
* ```
|
|
2285
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1-sw
|
|
2286
|
+
*/
|
|
2287
|
+
DownloadAsPng = "downloadAsPng",
|
|
2288
|
+
/**
|
|
2289
|
+
* Triggers the downloadAsCSV action on visualization or search
|
|
2290
|
+
*
|
|
2291
|
+
* @example
|
|
2292
|
+
* ```js
|
|
2293
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
2294
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2295
|
+
*
|
|
2296
|
+
* vizEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2297
|
+
*
|
|
2298
|
+
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2299
|
+
* ```
|
|
2300
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2301
|
+
*/
|
|
2302
|
+
DownloadAsCsv = "downloadAsCSV",
|
|
2303
|
+
/**
|
|
2304
|
+
* Triggers the downloadAsXLSX action on visualization or search
|
|
2305
|
+
*
|
|
2306
|
+
* @example
|
|
2307
|
+
* ```js
|
|
2308
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
2309
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2310
|
+
*
|
|
2311
|
+
* vizEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2312
|
+
*
|
|
2313
|
+
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2314
|
+
* ```
|
|
2315
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2316
|
+
*/
|
|
2317
|
+
DownloadAsXlsx = "downloadAsXLSX",
|
|
2318
|
+
/**
|
|
2319
|
+
* Triggers the Share action on a liveboard or answer
|
|
2320
|
+
*
|
|
2321
|
+
* @example
|
|
2322
|
+
* ```js
|
|
2323
|
+
* liveboardEmbed.trigger(HostEvent.Share)
|
|
2324
|
+
*
|
|
2325
|
+
* searchEmbed.trigger(HostEvent.Share)
|
|
2326
|
+
* ```
|
|
2327
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2328
|
+
*/
|
|
2329
|
+
Share = "share",
|
|
2330
|
+
/**
|
|
2331
|
+
* Trigger the Save action on a liveboard or answer
|
|
2332
|
+
*
|
|
2333
|
+
* @example
|
|
2334
|
+
* ```js
|
|
2335
|
+
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2336
|
+
*
|
|
2337
|
+
* searchEmbed.trigger(HostEvent.Save)
|
|
2338
|
+
* ```
|
|
2339
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2340
|
+
*/
|
|
2341
|
+
Save = "save",
|
|
2342
|
+
/**
|
|
2343
|
+
* Triggers the SyncToSheets action on visualization
|
|
2344
|
+
*
|
|
2345
|
+
* @param - an object with vizId as a key
|
|
2346
|
+
* @example
|
|
2347
|
+
* ```js
|
|
2348
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId:
|
|
2349
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2350
|
+
*
|
|
2351
|
+
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
2352
|
+
* ```
|
|
2353
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2354
|
+
*/
|
|
2355
|
+
SyncToSheets = "sync-to-sheets",
|
|
2356
|
+
/**
|
|
2357
|
+
* Triggers the SyncToOtherApps action on visualization
|
|
2358
|
+
*
|
|
2359
|
+
* @param - an object with vizId as a key
|
|
2360
|
+
* @example
|
|
2361
|
+
* ```js
|
|
2362
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId:
|
|
2363
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2364
|
+
*
|
|
2365
|
+
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
2366
|
+
* ```
|
|
2367
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2368
|
+
*/
|
|
2369
|
+
SyncToOtherApps = "sync-to-other-apps",
|
|
2370
|
+
/**
|
|
2371
|
+
* Triggers the ManagePipelines action on visualization
|
|
2372
|
+
*
|
|
2373
|
+
* @param - an object with vizId as a key
|
|
2374
|
+
* @example
|
|
2375
|
+
* ```js
|
|
2376
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId:
|
|
2377
|
+
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2378
|
+
*
|
|
2379
|
+
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
2380
|
+
* ```
|
|
2381
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
2382
|
+
*/
|
|
2383
|
+
ManagePipelines = "manage-pipeline",
|
|
2384
|
+
/**
|
|
2385
|
+
* Triggers the Reset search in answer
|
|
2386
|
+
*
|
|
2387
|
+
* @example
|
|
2388
|
+
* ```js
|
|
2389
|
+
* searchEmbed.trigger(HostEvent.ResetSearch)
|
|
2390
|
+
* ```
|
|
2391
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1-sw
|
|
2392
|
+
*/
|
|
2393
|
+
ResetSearch = "resetSearch"
|
|
2394
|
+
}
|
|
2395
|
+
/**
|
|
2396
|
+
* The different visual modes that the data sources panel within
|
|
2397
|
+
* search could appear in, i.e., hidden, collapsed, or expanded.
|
|
2398
|
+
*/
|
|
2399
|
+
export enum DataSourceVisualMode {
|
|
2400
|
+
/**
|
|
2401
|
+
* Data source panel is hidden.
|
|
2402
|
+
*/
|
|
2403
|
+
Hidden = "hide",
|
|
2404
|
+
/**
|
|
2405
|
+
* Data source panel is collapsed, but the user can manually expand it.
|
|
2406
|
+
*/
|
|
2407
|
+
Collapsed = "collapse",
|
|
2408
|
+
/**
|
|
2409
|
+
* Data source panel is expanded, but the user can manually collapse it.
|
|
2410
|
+
*/
|
|
2411
|
+
Expanded = "expand"
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* The query params passed down to the embedded ThoughtSpot app
|
|
2415
|
+
* containing configuration and/or visual information.
|
|
2416
|
+
*/
|
|
2417
|
+
export enum Param {
|
|
2418
|
+
EmbedApp = "embedApp",
|
|
2419
|
+
DataSources = "dataSources",
|
|
2420
|
+
DataSourceMode = "dataSourceMode",
|
|
2421
|
+
DisableActions = "disableAction",
|
|
2422
|
+
DisableActionReason = "disableHint",
|
|
2423
|
+
ForceTable = "forceTable",
|
|
2424
|
+
preventLiveboardFilterRemoval = "preventPinboardFilterRemoval",
|
|
2425
|
+
SearchQuery = "searchQuery",
|
|
2426
|
+
HideActions = "hideAction",
|
|
2427
|
+
HideObjects = "hideObjects",
|
|
2428
|
+
HostAppUrl = "hostAppUrl",
|
|
2429
|
+
EnableVizTransformations = "enableVizTransform",
|
|
2430
|
+
EnableSearchAssist = "enableSearchAssist",
|
|
2431
|
+
HideResult = "hideResult",
|
|
2432
|
+
UseLastSelectedDataSource = "useLastSelectedSources",
|
|
2433
|
+
Tag = "tag",
|
|
2434
|
+
searchTokenString = "searchTokenString",
|
|
2435
|
+
executeSearch = "executeSearch",
|
|
2436
|
+
fullHeight = "isFullHeightPinboard",
|
|
2437
|
+
livedBoardEmbed = "isLiveboardEmbed",
|
|
2438
|
+
searchEmbed = "isSearchEmbed",
|
|
2439
|
+
vizEmbed = "isVizEmbed",
|
|
2440
|
+
Version = "sdkVersion",
|
|
2441
|
+
ViewPortHeight = "viewPortHeight",
|
|
2442
|
+
ViewPortWidth = "viewPortWidth",
|
|
2443
|
+
VisibleActions = "visibleAction",
|
|
2444
|
+
CustomCSSUrl = "customCssUrl",
|
|
2445
|
+
DisableLoginRedirect = "disableLoginRedirect",
|
|
2446
|
+
visibleVizs = "pinboardVisibleVizs",
|
|
2447
|
+
LiveboardV2Enabled = "isPinboardV2Enabled",
|
|
2448
|
+
ShowAlerts = "showAlerts",
|
|
2449
|
+
Locale = "locale",
|
|
2450
|
+
CustomStyle = "customStyle",
|
|
2451
|
+
ForceSAMLAutoRedirect = "forceSAMLAutoRedirect",
|
|
2452
|
+
AuthType = "authType",
|
|
2453
|
+
IconSpriteUrl = "iconSprite",
|
|
2454
|
+
cookieless = "cookieless",
|
|
2455
|
+
ContextMenuTrigger = "isContextMenuEnabledOnLeftClick",
|
|
2456
|
+
LinkOverride = "linkOverride",
|
|
2457
|
+
ShowInsertToSlide = "insertInToSlide",
|
|
2458
|
+
PrimaryNavHidden = "primaryNavHidden",
|
|
2459
|
+
HideProfleAndHelp = "profileAndHelpInNavBarHidden"
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* The list of actions that can be performed on visual ThoughtSpot
|
|
2463
|
+
* entities, such as answers and Liveboards.
|
|
2464
|
+
*
|
|
2465
|
+
* This enum is used to specify the actions that could be disabled,
|
|
2466
|
+
* hidden or made visible.
|
|
2467
|
+
*
|
|
2468
|
+
* @example
|
|
2469
|
+
* ```js
|
|
2470
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
2471
|
+
* ... // other options
|
|
2472
|
+
* visibleActions: [Action.Save, Action.Explore],
|
|
2473
|
+
* disableActions: [Action.Save],
|
|
2474
|
+
* hiddenActions: [Action.Download], // Set either this or visibleActions
|
|
2475
|
+
* })
|
|
2476
|
+
* ```
|
|
2477
|
+
*/
|
|
2478
|
+
export enum Action {
|
|
2479
|
+
Save = "save",
|
|
2480
|
+
/**
|
|
2481
|
+
* @hidden
|
|
2482
|
+
*/
|
|
2483
|
+
Update = "update",
|
|
2484
|
+
/**
|
|
2485
|
+
* @hidden
|
|
2486
|
+
*/
|
|
2487
|
+
SaveUntitled = "saveUntitled",
|
|
2488
|
+
SaveAsView = "saveAsView",
|
|
2489
|
+
MakeACopy = "makeACopy",
|
|
2490
|
+
EditACopy = "editACopy",
|
|
2491
|
+
CopyLink = "embedDocument",
|
|
2492
|
+
/**
|
|
2493
|
+
* @hidden
|
|
2494
|
+
*/
|
|
2495
|
+
ResetLayout = "resetLayout",
|
|
2496
|
+
Schedule = "subscription",
|
|
2497
|
+
SchedulesList = "schedule-list",
|
|
2498
|
+
Share = "share",
|
|
2499
|
+
AddFilter = "addFilter",
|
|
2500
|
+
ConfigureFilter = "configureFilter",
|
|
2501
|
+
CollapseDataSources = "collapseDataSources",
|
|
2502
|
+
ChooseDataSources = "chooseDataSources",
|
|
2503
|
+
AddFormula = "addFormula",
|
|
2504
|
+
AddParameter = "addParameter",
|
|
2505
|
+
/**
|
|
2506
|
+
* @hidden
|
|
2507
|
+
*/
|
|
2508
|
+
SearchOnTop = "searchOnTop",
|
|
2509
|
+
SpotIQAnalyze = "spotIQAnalyze",
|
|
2510
|
+
/**
|
|
2511
|
+
* @hidden
|
|
2512
|
+
*/
|
|
2513
|
+
ExplainInsight = "explainInsight",
|
|
2514
|
+
/**
|
|
2515
|
+
* @hidden
|
|
2516
|
+
*/
|
|
2517
|
+
SpotIQFollow = "spotIQFollow",
|
|
2518
|
+
ShareViz = "shareViz",
|
|
2519
|
+
/**
|
|
2520
|
+
* @hidden
|
|
2521
|
+
*/
|
|
2522
|
+
ReplaySearch = "replaySearch",
|
|
2523
|
+
ShowUnderlyingData = "showUnderlyingData",
|
|
2524
|
+
Download = "download",
|
|
2525
|
+
DownloadAsPng = "downloadAsPng",
|
|
2526
|
+
DownloadAsPdf = "downloadAsPdf",
|
|
2527
|
+
DownloadAsCsv = "downloadAsCSV",
|
|
2528
|
+
DownloadAsXlsx = "downloadAsXLSX",
|
|
2529
|
+
/**
|
|
2530
|
+
* @hidden
|
|
2531
|
+
*/
|
|
2532
|
+
DownloadTrace = "downloadTrace",
|
|
2533
|
+
ExportTML = "exportTSL",
|
|
2534
|
+
ImportTML = "importTSL",
|
|
2535
|
+
UpdateTML = "updateTSL",
|
|
2536
|
+
EditTML = "editTSL",
|
|
2537
|
+
Present = "present",
|
|
2538
|
+
ToggleSize = "toggleSize",
|
|
2539
|
+
Edit = "edit",
|
|
2540
|
+
EditTitle = "editTitle",
|
|
2541
|
+
Remove = "delete",
|
|
2542
|
+
/**
|
|
2543
|
+
* @hidden
|
|
2544
|
+
*/
|
|
2545
|
+
Ungroup = "ungroup",
|
|
2546
|
+
/**
|
|
2547
|
+
* @hidden
|
|
2548
|
+
*/
|
|
2549
|
+
Describe = "describe",
|
|
2550
|
+
/**
|
|
2551
|
+
* @hidden
|
|
2552
|
+
*/
|
|
2553
|
+
Relate = "relate",
|
|
2554
|
+
/**
|
|
2555
|
+
* @hidden
|
|
2556
|
+
*/
|
|
2557
|
+
CustomizeHeadlines = "customizeHeadlines",
|
|
2558
|
+
/**
|
|
2559
|
+
* @hidden
|
|
2560
|
+
*/
|
|
2561
|
+
PinboardInfo = "pinboardInfo",
|
|
2562
|
+
LiveboardInfo = "pinboardInfo",
|
|
2563
|
+
/**
|
|
2564
|
+
* @hidden
|
|
2565
|
+
*/
|
|
2566
|
+
SendAnswerFeedback = "sendFeedback",
|
|
2567
|
+
/**
|
|
2568
|
+
* @hidden
|
|
2569
|
+
*/
|
|
2570
|
+
DownloadEmbraceQueries = "downloadEmbraceQueries",
|
|
2571
|
+
/**
|
|
2572
|
+
* Pin action.
|
|
2573
|
+
*/
|
|
2574
|
+
Pin = "pin",
|
|
2575
|
+
/**
|
|
2576
|
+
* @hidden
|
|
2577
|
+
*/
|
|
2578
|
+
AnalysisInfo = "analysisInfo",
|
|
2579
|
+
Subscription = "subscription",
|
|
2580
|
+
/**
|
|
2581
|
+
* Explore action.
|
|
2582
|
+
*/
|
|
2583
|
+
Explore = "explore",
|
|
2584
|
+
DrillInclude = "context-menu-item-include",
|
|
2585
|
+
DrillExclude = "context-menu-item-exclude",
|
|
2586
|
+
CopyToClipboard = "context-menu-item-copy-to-clipboard",
|
|
2587
|
+
CopyAndEdit = "context-menu-item-copy-and-edit",
|
|
2588
|
+
/**
|
|
2589
|
+
* @hidden
|
|
2590
|
+
*/
|
|
2591
|
+
DrillEdit = "context-menu-item-edit",
|
|
2592
|
+
EditMeasure = "context-menu-item-edit-measure",
|
|
2593
|
+
Separator = "context-menu-item-separator",
|
|
2594
|
+
DrillDown = "DRILL",
|
|
2595
|
+
RequestAccess = "requestAccess",
|
|
2596
|
+
QueryDetailsButtons = "queryDetailsButtons",
|
|
2597
|
+
/**
|
|
2598
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
2599
|
+
*/
|
|
2600
|
+
AnswerDelete = "onDeleteAnswer",
|
|
2601
|
+
/**
|
|
2602
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
2603
|
+
*/
|
|
2604
|
+
AnswerChartSwitcher = "answerChartSwitcher",
|
|
2605
|
+
/**
|
|
2606
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
2607
|
+
*/
|
|
2608
|
+
AddToFavorites = "addToFavorites",
|
|
2609
|
+
/**
|
|
2610
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
2611
|
+
*/
|
|
2612
|
+
EditDetails = "editDetails",
|
|
2613
|
+
/**
|
|
2614
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
2615
|
+
*/
|
|
2616
|
+
CreateMonitor = "createMonitor",
|
|
2617
|
+
/**
|
|
2618
|
+
* @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
2619
|
+
*/
|
|
2620
|
+
ReportError = "reportError",
|
|
2621
|
+
SyncToSheets = "sync-to-sheets",
|
|
2622
|
+
SyncToOtherApps = "sync-to-other-apps",
|
|
2623
|
+
ManagePipelines = "manage-pipeline",
|
|
2624
|
+
/**
|
|
2625
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2626
|
+
*/
|
|
2627
|
+
CrossFilter = "context-menu-item-cross-filter",
|
|
2628
|
+
/**
|
|
2629
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2630
|
+
*/
|
|
2631
|
+
RemoveCrossFilter = "context-menu-item-remove-cross-filter",
|
|
2632
|
+
/**
|
|
2633
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2634
|
+
*/
|
|
2635
|
+
AxisMenuAggregate = "axisMenuAggregate",
|
|
2636
|
+
/**
|
|
2637
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2638
|
+
*/
|
|
2639
|
+
AxisMenuTimeBucket = "axisMenuTimeBucket",
|
|
2640
|
+
/**
|
|
2641
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2642
|
+
*/
|
|
2643
|
+
AxisMenuFilter = "axisMenuFilter",
|
|
2644
|
+
/**
|
|
2645
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2646
|
+
*/
|
|
2647
|
+
AxisMenuConditionalFormat = "axisMenuConditionalFormat",
|
|
2648
|
+
/**
|
|
2649
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2650
|
+
*/
|
|
2651
|
+
AxisMenuSort = "axisMenuSort",
|
|
2652
|
+
/**
|
|
2653
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2654
|
+
*/
|
|
2655
|
+
AxisMenuGroup = "axisMenuGroup",
|
|
2656
|
+
/**
|
|
2657
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2658
|
+
*/
|
|
2659
|
+
AxisMenuPosition = "axisMenuPosition",
|
|
2660
|
+
/**
|
|
2661
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2662
|
+
*/
|
|
2663
|
+
AxisMenuRename = "axisMenuRename",
|
|
2664
|
+
/**
|
|
2665
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2666
|
+
*/
|
|
2667
|
+
AxisMenuEdit = "axisMenuEdit",
|
|
2668
|
+
/**
|
|
2669
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2670
|
+
*/
|
|
2671
|
+
AxisMenuNumberFormat = "axisMenuNumberFormat",
|
|
2672
|
+
/**
|
|
2673
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2674
|
+
*/
|
|
2675
|
+
AxisMenuTextWrapping = "axisMenuTextWrapping",
|
|
2676
|
+
/**
|
|
2677
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2678
|
+
*/
|
|
2679
|
+
AxisMenuRemove = "axisMenuRemove",
|
|
2680
|
+
/**
|
|
2681
|
+
* @hidden
|
|
2682
|
+
*/
|
|
2683
|
+
InsertInToSlide = "insertInToSlide",
|
|
2684
|
+
/**
|
|
2685
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2686
|
+
*/
|
|
2687
|
+
RenameModalTitleDescription = "renameModalTitleDescription"
|
|
2688
|
+
}
|
|
2689
|
+
export interface SessionInterface {
|
|
2690
|
+
sessionId: string;
|
|
2691
|
+
genNo: number;
|
|
2692
|
+
acSession: {
|
|
2693
|
+
sessionId: string;
|
|
2694
|
+
genNo: number;
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
export enum OperationType {
|
|
2698
|
+
GetChartWithData = "GetChartWithData",
|
|
2699
|
+
GetTableWithHeadlineData = "GetTableWithHeadlineData"
|
|
2700
|
+
}
|
|
2701
|
+
export interface AnswerServiceType {
|
|
2702
|
+
getAnswer?: (offset: number, batchSize: number) => any;
|
|
2703
|
+
}
|
|
2704
|
+
export enum PrefetchFeatures {
|
|
2705
|
+
FullApp = "FullApp",
|
|
2706
|
+
SearchEmbed = "SearchEmbed",
|
|
2707
|
+
LiveboardEmbed = "LiveboardEmbed",
|
|
2708
|
+
VizEmbed = "VizEmbed"
|
|
2709
|
+
}
|
|
2710
|
+
/**
|
|
2711
|
+
* Enum for options to change context trigger
|
|
2712
|
+
*/
|
|
2713
|
+
export enum ContextMenuTriggerOptions {
|
|
2714
|
+
LEFT_CLICK = "left-click",
|
|
2715
|
+
RIGHT_CLICK = "right-click"
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
/**
|
|
2719
|
+
* Copyright (c) 2022
|
|
2720
|
+
*
|
|
2721
|
+
* Base classes
|
|
2722
|
+
*
|
|
2723
|
+
* @summary Base classes
|
|
2724
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
2725
|
+
*/
|
|
2726
|
+
/**
|
|
2727
|
+
* Global prefix for all Thoughtspot postHash Params.
|
|
2728
|
+
*/
|
|
2729
|
+
export const THOUGHTSPOT_PARAM_PREFIX = "ts-";
|
|
2730
|
+
/**
|
|
2731
|
+
* Base class for embedding v2 experience
|
|
2732
|
+
* Note: the v2 version of ThoughtSpot Blink is built on the new stack:
|
|
2733
|
+
* React+GraphQL
|
|
2734
|
+
*/
|
|
2735
|
+
export class TsEmbed {
|
|
2736
|
+
protected isAppInitialized: boolean;
|
|
2737
|
+
/**
|
|
2738
|
+
* A reference to the iframe within which the ThoughtSpot app
|
|
2739
|
+
* will be rendered.
|
|
2740
|
+
*/
|
|
2741
|
+
protected iFrame: HTMLIFrameElement;
|
|
2742
|
+
protected viewConfig: ViewConfig;
|
|
2743
|
+
protected embedConfig: EmbedConfig;
|
|
2744
|
+
/**
|
|
2745
|
+
* The ThoughtSpot hostname or IP address
|
|
2746
|
+
*/
|
|
2747
|
+
protected thoughtSpotHost: string;
|
|
2748
|
+
protected thoughtSpotV2Base: string;
|
|
2749
|
+
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
2750
|
+
/**
|
|
2751
|
+
* Handles errors within the SDK
|
|
2752
|
+
*
|
|
2753
|
+
* @param error The error message or object
|
|
2754
|
+
*/
|
|
2755
|
+
protected handleError(error: string | Record<string, unknown>): void;
|
|
2756
|
+
/**
|
|
2757
|
+
* Constructs the base URL string to load the ThoughtSpot app.
|
|
2758
|
+
*
|
|
2759
|
+
* @param query
|
|
2760
|
+
*/
|
|
2761
|
+
protected getEmbedBasePath(query: string): string;
|
|
2762
|
+
/**
|
|
2763
|
+
* Common query params set for all the embed modes.
|
|
2764
|
+
*
|
|
2765
|
+
* @param queryParams
|
|
2766
|
+
* @returns queryParams
|
|
2767
|
+
*/
|
|
2768
|
+
protected getBaseQueryParams(queryParams?: {}): {};
|
|
2769
|
+
/**
|
|
2770
|
+
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
2771
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
2772
|
+
*
|
|
2773
|
+
* @param queryString The query string to append to the URL.
|
|
2774
|
+
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
2775
|
+
* the full application.
|
|
2776
|
+
*/
|
|
2777
|
+
protected getV1EmbedBasePath(queryString: string): string;
|
|
2778
|
+
protected getEmbedParams(): string;
|
|
2779
|
+
protected getRootIframeSrc(): string;
|
|
2780
|
+
protected createIframeEl(frameSrc: string): HTMLIFrameElement;
|
|
2781
|
+
/**
|
|
2782
|
+
* Renders the embedded ThoughtSpot app in an iframe and sets up
|
|
2783
|
+
* event listeners.
|
|
2784
|
+
*
|
|
2785
|
+
* @param url
|
|
2786
|
+
* @param frameOptions
|
|
2787
|
+
*/
|
|
2788
|
+
protected renderIFrame(url: string): Promise<any>;
|
|
2789
|
+
protected insertIntoDOM(child: string | Node): void;
|
|
2790
|
+
/**
|
|
2791
|
+
* Sets the height of the iframe
|
|
2792
|
+
*
|
|
2793
|
+
* @param height The height in pixels
|
|
2794
|
+
*/
|
|
2795
|
+
protected setIFrameHeight(height: number | string): void;
|
|
2796
|
+
/**
|
|
2797
|
+
* Executes all registered event handlers for a particular event type
|
|
2798
|
+
*
|
|
2799
|
+
* @param eventType The event type
|
|
2800
|
+
* @param data The payload invoked with the event handler
|
|
2801
|
+
* @param eventPort The event Port for a specific MessageChannel
|
|
2802
|
+
*/
|
|
2803
|
+
protected executeCallbacks(eventType: EmbedEvent, data: any, eventPort?: MessagePort | void): void;
|
|
2804
|
+
/**
|
|
2805
|
+
* Returns the ThoughtSpot hostname or IP address.
|
|
2806
|
+
*/
|
|
2807
|
+
protected getThoughtSpotHost(): string;
|
|
2808
|
+
/**
|
|
2809
|
+
* Gets the v1 event type (if applicable) for the EmbedEvent type
|
|
2810
|
+
*
|
|
2811
|
+
* @param eventType The v2 event type
|
|
2812
|
+
* @returns The corresponding v1 event type if one exists
|
|
2813
|
+
* or else the v2 event type itself
|
|
2814
|
+
*/
|
|
2815
|
+
protected getCompatibleEventType(eventType: EmbedEvent): EmbedEvent;
|
|
2816
|
+
/**
|
|
2817
|
+
* Calculates the iframe center for the current visible viewPort
|
|
2818
|
+
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
2819
|
+
* in Host app. ViewPort height of the tab.
|
|
2820
|
+
*
|
|
2821
|
+
* @returns iframe Center in visible viewport,
|
|
2822
|
+
* Iframe height,
|
|
2823
|
+
* View port height.
|
|
2824
|
+
*/
|
|
2825
|
+
protected getIframeCenter(): {
|
|
2826
|
+
iframeCenter: number;
|
|
2827
|
+
iframeScrolled: number;
|
|
2828
|
+
iframeHeight: number;
|
|
2829
|
+
viewPortHeight: number;
|
|
2830
|
+
iframeVisibleViewPort: number;
|
|
2831
|
+
};
|
|
2832
|
+
/**
|
|
2833
|
+
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
2834
|
+
* sends an event of a particular message type to the host application.
|
|
2835
|
+
*
|
|
2836
|
+
* @param messageType The message type
|
|
2837
|
+
* @param callback A callback as a function
|
|
2838
|
+
* @param options The message options
|
|
2839
|
+
* @example
|
|
2840
|
+
* ```js
|
|
2841
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
2842
|
+
* console.error(data);
|
|
2843
|
+
* });
|
|
2844
|
+
* ```
|
|
2845
|
+
* @example
|
|
2846
|
+
* ```js
|
|
2847
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
2848
|
+
* console.log("Answer save clicked", data);
|
|
2849
|
+
* }, {
|
|
2850
|
+
* start: true // This will trigger the callback on start of save
|
|
2851
|
+
* });
|
|
2852
|
+
* ```
|
|
2853
|
+
*/
|
|
2854
|
+
on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
|
|
2855
|
+
/**
|
|
2856
|
+
* Removes an event listener for a particular event type.
|
|
2857
|
+
*
|
|
2858
|
+
* @param messageType The message type
|
|
2859
|
+
* @param callback The callback to remove
|
|
2860
|
+
* @example
|
|
2861
|
+
* ```js
|
|
2862
|
+
* const errorHandler = (data) => { console.error(data); };
|
|
2863
|
+
* tsEmbed.on(EmbedEvent.Error, errorHandler);
|
|
2864
|
+
* tsEmbed.off(EmbedEvent.Error, errorHandler);
|
|
2865
|
+
* ```
|
|
2866
|
+
*/
|
|
2867
|
+
off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
2868
|
+
/**
|
|
2869
|
+
* Triggers an event to the embedded app
|
|
2870
|
+
*
|
|
2871
|
+
* @param messageType The event type
|
|
2872
|
+
* @param data The payload to send with the message
|
|
2873
|
+
*/
|
|
2874
|
+
trigger(messageType: HostEvent, data?: any): Promise<any>;
|
|
2875
|
+
/**
|
|
2876
|
+
* Marks the ThoughtSpot object to have been rendered
|
|
2877
|
+
* Needs to be overridden by subclasses to do the actual
|
|
2878
|
+
* rendering of the iframe.
|
|
2879
|
+
*
|
|
2880
|
+
* @param args
|
|
2881
|
+
*/
|
|
2882
|
+
render(): TsEmbed;
|
|
2883
|
+
/**
|
|
2884
|
+
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
2885
|
+
* host app URL.
|
|
2886
|
+
* THOUGHTSPOT URL params starts with a prefix "ts-"
|
|
2887
|
+
*
|
|
2888
|
+
* @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
2889
|
+
*/
|
|
2890
|
+
getThoughtSpotPostUrlParams(): string;
|
|
2891
|
+
/**
|
|
2892
|
+
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
2893
|
+
*
|
|
2894
|
+
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
2895
|
+
*/
|
|
2896
|
+
destroy(): void;
|
|
2897
|
+
getUnderlyingFrameElement(): HTMLIFrameElement;
|
|
2898
|
+
/**
|
|
2899
|
+
* Prerenders a generic instance of the TS component.
|
|
2900
|
+
* This means without the path but with the flags already applied.
|
|
2901
|
+
* This is useful for prerendering the component in the background.
|
|
2902
|
+
*
|
|
2903
|
+
* @version SDK: 1.22.0
|
|
2904
|
+
* @returns
|
|
2905
|
+
*/
|
|
2906
|
+
prerenderGeneric(): Promise<any>;
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* Base class for embedding v1 experience
|
|
2910
|
+
* Note: The v1 version of ThoughtSpot Blink works on the AngularJS stack
|
|
2911
|
+
* which is currently under migration to v2
|
|
2912
|
+
*
|
|
2913
|
+
* @inheritdoc
|
|
2914
|
+
*/
|
|
2915
|
+
export class V1Embed extends TsEmbed {
|
|
2916
|
+
protected viewConfig: ViewConfig;
|
|
2917
|
+
constructor(domSelector: DOMSelector, viewConfig: ViewConfig);
|
|
2918
|
+
/**
|
|
2919
|
+
* Render the ap p in an iframe and set up event handlers
|
|
2920
|
+
*
|
|
2921
|
+
* @param iframeSrc
|
|
2922
|
+
*/
|
|
2923
|
+
protected renderV1Embed(iframeSrc: string): any;
|
|
2924
|
+
protected getRootIframeSrc(): string;
|
|
2925
|
+
/**
|
|
2926
|
+
* @inheritdoc
|
|
2927
|
+
* @example
|
|
2928
|
+
* ```js
|
|
2929
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
2930
|
+
* console.error(data);
|
|
2931
|
+
* });
|
|
2932
|
+
* ```
|
|
2933
|
+
* @example
|
|
2934
|
+
* ```js
|
|
2935
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
2936
|
+
* console.log("Answer save clicked", data);
|
|
2937
|
+
* }, {
|
|
2938
|
+
* start: true // This will trigger the callback on start of save
|
|
2939
|
+
* });
|
|
2940
|
+
* ```
|
|
2941
|
+
*/
|
|
2942
|
+
on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
|
|
2943
|
+
}
|
|
2944
|
+
|