@thoughtspot/visual-embed-sdk 1.20.0-prerender.2 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/auth.d.ts +2 -38
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/config.d.ts +0 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +5 -17
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +9 -20
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +5 -17
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +0 -3
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +5 -9
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +6 -43
- 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.map +1 -1
- package/dist/src/mixpanel-service.d.ts +0 -8
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +0 -4
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/test/test-utils.d.ts +2 -11
- package/dist/src/test/test-utils.d.ts.map +1 -1
- package/dist/src/types.d.ts +76 -273
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/answerService.d.ts +0 -7
- package/dist/src/utils/answerService.d.ts.map +1 -1
- package/dist/src/utils/authService.d.ts +0 -30
- package/dist/src/utils/authService.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +0 -12
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +0 -7
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils.d.ts +0 -12
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed.es.js +262 -637
- package/dist/tsembed.js +261 -629
- package/lib/package.json +8 -3
- package/lib/src/auth.d.ts +2 -38
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +25 -70
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +5 -14
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/config.d.ts +0 -1
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +3 -5
- package/lib/src/config.js.map +1 -1
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +5 -17
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +15 -25
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +12 -12
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +9 -20
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +15 -31
- 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 +5 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +37 -49
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +30 -37
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +26 -14
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +0 -3
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +6 -5
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +5 -9
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +14 -18
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +19 -16
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -4
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +6 -43
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +72 -117
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +24 -23
- 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.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +0 -8
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +1 -13
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +6 -6
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +6 -15
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/react/util.d.ts +0 -4
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/react/util.js +0 -4
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/test/test-utils.d.ts +2 -11
- package/lib/src/test/test-utils.d.ts.map +1 -1
- package/lib/src/test/test-utils.js +25 -36
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/types.d.ts +76 -273
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +54 -200
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/answerService.d.ts +0 -7
- package/lib/src/utils/answerService.d.ts.map +1 -1
- package/lib/src/utils/answerService.js +0 -7
- 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 +0 -30
- package/lib/src/utils/authService.d.ts.map +1 -1
- package/lib/src/utils/authService.js +2 -39
- 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 +0 -12
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +5 -33
- 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 +0 -7
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +3 -17
- 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 +0 -12
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +19 -24
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +102 -406
- package/package.json +8 -3
- package/src/auth.spec.ts +150 -68
- package/src/auth.ts +108 -102
- package/src/config.spec.ts +4 -2
- package/src/config.ts +3 -5
- package/src/embed/app.spec.ts +14 -25
- package/src/embed/app.ts +35 -47
- package/src/embed/base.spec.ts +9 -3
- package/src/embed/base.ts +53 -51
- package/src/embed/embed.spec.ts +6 -5
- package/src/embed/liveboard.spec.ts +37 -56
- package/src/embed/liveboard.ts +64 -66
- package/src/embed/pinboard.spec.ts +29 -26
- package/src/embed/search-bar.tsx +8 -10
- package/src/embed/search.spec.ts +21 -31
- package/src/embed/search.ts +25 -26
- package/src/embed/searchEmbed-basic-auth.spec.ts +28 -22
- package/src/embed/ts-embed.spec.ts +148 -70
- package/src/embed/ts-embed.ts +157 -147
- package/src/errors.ts +6 -3
- package/src/index.ts +10 -4
- package/src/mixpanel-service.spec.ts +3 -1
- package/src/mixpanel-service.ts +1 -13
- package/src/react/index.spec.tsx +13 -37
- package/src/react/index.tsx +57 -38
- package/src/react/util.ts +4 -8
- package/src/test/test-utils.ts +39 -43
- package/src/types.ts +78 -270
- package/src/utils/answerService.spec.ts +5 -3
- package/src/utils/answerService.ts +17 -21
- package/src/utils/authService.spec.ts +41 -26
- package/src/utils/authService.ts +21 -47
- package/src/utils/processData.spec.ts +59 -26
- package/src/utils/processData.ts +14 -36
- package/src/utils/processTrigger.spec.ts +6 -1
- package/src/utils/processTrigger.ts +9 -18
- package/src/utils.spec.ts +12 -8
- package/src/utils.ts +26 -25
package/dist/tsembed.es.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
* Refer to the following docs for more details on runtime filter syntax:
|
|
12
12
|
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/apply-runtime-filter.html
|
|
13
13
|
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/runtime-filter-operators.html
|
|
14
|
-
*
|
|
15
14
|
* @param runtimeFilters
|
|
16
15
|
*/
|
|
17
16
|
const getFilterQuery = (runtimeFilters) => {
|
|
@@ -31,12 +30,13 @@ const getFilterQuery = (runtimeFilters) => {
|
|
|
31
30
|
/**
|
|
32
31
|
* Convert a value to a string representation to be sent as a query
|
|
33
32
|
* parameter to the ThoughtSpot app.
|
|
34
|
-
*
|
|
35
33
|
* @param value Any parameter value
|
|
36
34
|
*/
|
|
37
35
|
const serializeParam = (value) => {
|
|
38
36
|
// do not serialize primitive types
|
|
39
|
-
if (typeof value === 'string' ||
|
|
37
|
+
if (typeof value === 'string' ||
|
|
38
|
+
typeof value === 'number' ||
|
|
39
|
+
typeof value === 'boolean') {
|
|
40
40
|
return value;
|
|
41
41
|
}
|
|
42
42
|
return JSON.stringify(value);
|
|
@@ -45,15 +45,12 @@ const serializeParam = (value) => {
|
|
|
45
45
|
* Convert a value to a string:
|
|
46
46
|
* in case of an array, we convert it to CSV.
|
|
47
47
|
* in case of any other type, we directly return the value.
|
|
48
|
-
*
|
|
49
48
|
* @param value
|
|
50
49
|
*/
|
|
51
|
-
const paramToString = (value) =>
|
|
50
|
+
const paramToString = (value) => Array.isArray(value) ? value.join(',') : value;
|
|
52
51
|
/**
|
|
53
52
|
* Return a query param string composed from the given params object
|
|
54
|
-
*
|
|
55
53
|
* @param queryParams
|
|
56
|
-
* @param shouldSerializeParamValues
|
|
57
54
|
*/
|
|
58
55
|
const getQueryParamString = (queryParams, shouldSerializeParamValues = false) => {
|
|
59
56
|
const qp = [];
|
|
@@ -75,7 +72,6 @@ const getQueryParamString = (queryParams, shouldSerializeParamValues = false) =>
|
|
|
75
72
|
/**
|
|
76
73
|
* Get a string representation of a dimension value in CSS
|
|
77
74
|
* If numeric, it is considered in pixels.
|
|
78
|
-
*
|
|
79
75
|
* @param value
|
|
80
76
|
*/
|
|
81
77
|
const getCssDimension = (value) => {
|
|
@@ -86,7 +82,6 @@ const getCssDimension = (value) => {
|
|
|
86
82
|
};
|
|
87
83
|
/**
|
|
88
84
|
* Append a string to a URL's hash fragment
|
|
89
|
-
*
|
|
90
85
|
* @param url A URL
|
|
91
86
|
* @param stringToAppend The string to append to the URL hash
|
|
92
87
|
*/
|
|
@@ -101,12 +96,6 @@ const appendToUrlHash = (url, stringToAppend) => {
|
|
|
101
96
|
}
|
|
102
97
|
return outputUrl;
|
|
103
98
|
};
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @param url
|
|
107
|
-
* @param stringToAppend
|
|
108
|
-
* @param path
|
|
109
|
-
*/
|
|
110
99
|
function getRedirectUrl(url, stringToAppend, path = '') {
|
|
111
100
|
const targetUrl = path ? new URL(path, window.location.origin).href : url;
|
|
112
101
|
return appendToUrlHash(targetUrl, stringToAppend);
|
|
@@ -115,7 +104,10 @@ const getEncodedQueryParamsString = (queryString) => {
|
|
|
115
104
|
if (!queryString) {
|
|
116
105
|
return queryString;
|
|
117
106
|
}
|
|
118
|
-
return btoa(queryString)
|
|
107
|
+
return btoa(queryString)
|
|
108
|
+
.replace(/\+/g, '-')
|
|
109
|
+
.replace(/\//g, '_')
|
|
110
|
+
.replace(/=+$/, '');
|
|
119
111
|
};
|
|
120
112
|
const getOffsetTop = (element) => {
|
|
121
113
|
const rect = element.getBoundingClientRect();
|
|
@@ -145,8 +137,8 @@ const getCustomisations = (embedConfig, viewConfig) => {
|
|
|
145
137
|
var _a, _b, _c, _d;
|
|
146
138
|
const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
|
|
147
139
|
const customizationsFromViewConfig = viewConfig.customizations;
|
|
148
|
-
const customizationsFromEmbedConfig = embedConfig.customizations
|
|
149
|
-
|
|
140
|
+
const customizationsFromEmbedConfig = embedConfig.customizations ||
|
|
141
|
+
embedConfig.customisations;
|
|
150
142
|
const customizations = {
|
|
151
143
|
style: {
|
|
152
144
|
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
|
|
@@ -155,9 +147,9 @@ const getCustomisations = (embedConfig, viewConfig) => {
|
|
|
155
147
|
...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
|
|
156
148
|
...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
|
|
157
149
|
},
|
|
158
|
-
customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
|
|
159
|
-
|
|
160
|
-
|
|
150
|
+
customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) ||
|
|
151
|
+
((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl) ||
|
|
152
|
+
customCssUrlFromEmbedConfig,
|
|
161
153
|
},
|
|
162
154
|
content: {
|
|
163
155
|
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
|
|
@@ -169,11 +161,12 @@ const getCustomisations = (embedConfig, viewConfig) => {
|
|
|
169
161
|
/**
|
|
170
162
|
* Gets a reference to the DOM node given
|
|
171
163
|
* a selector.
|
|
172
|
-
*
|
|
173
164
|
* @param domSelector
|
|
174
165
|
*/
|
|
175
166
|
function getDOMNode(domSelector) {
|
|
176
|
-
return typeof domSelector === 'string'
|
|
167
|
+
return typeof domSelector === 'string'
|
|
168
|
+
? document.querySelector(domSelector)
|
|
169
|
+
: domSelector;
|
|
177
170
|
}
|
|
178
171
|
|
|
179
172
|
/**
|
|
@@ -187,35 +180,29 @@ function getDOMNode(domSelector) {
|
|
|
187
180
|
/**
|
|
188
181
|
* The authentication mechanism for allowing access to the
|
|
189
182
|
* the embedded app
|
|
190
|
-
*
|
|
191
183
|
* @group Authentication / Init
|
|
192
184
|
*/
|
|
193
185
|
// eslint-disable-next-line no-shadow
|
|
194
186
|
var AuthType;
|
|
195
187
|
(function (AuthType) {
|
|
196
188
|
/**
|
|
197
|
-
* No authentication on the SDK. Passthrough to the embedded App. Alias for
|
|
198
|
-
* `Passthrough`.
|
|
189
|
+
* No authentication on the SDK. Passthrough to the embedded App. Alias for `Passthrough`.
|
|
199
190
|
*/
|
|
200
191
|
AuthType["None"] = "None";
|
|
201
192
|
/**
|
|
202
|
-
* Passthrough SSO to the embedded App within the iframe. Requires least
|
|
203
|
-
*
|
|
204
|
-
* if SSO is not configured on ThoughtSpot.
|
|
205
|
-
*
|
|
193
|
+
* Passthrough SSO to the embedded App within the iframe. Requires least configuration, but may not
|
|
194
|
+
* be supported by all IDPs. This will behave like `None` if SSO is not configured on ThoughtSpot.
|
|
206
195
|
* @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
|
|
207
196
|
*/
|
|
208
197
|
AuthType["EmbeddedSSO"] = "EmbeddedSSO";
|
|
209
198
|
/**
|
|
210
199
|
* SSO using SAML
|
|
211
|
-
*
|
|
212
200
|
* @deprecated Use {@link SAMLRedirect} instead
|
|
213
201
|
* @hidden
|
|
214
202
|
*/
|
|
215
203
|
AuthType["SSO"] = "SSO_SAML";
|
|
216
204
|
/**
|
|
217
205
|
* SSO using SAML
|
|
218
|
-
*
|
|
219
206
|
* @deprecated Use {@link SAMLRedirect} instead
|
|
220
207
|
* @hidden
|
|
221
208
|
*/
|
|
@@ -223,7 +210,6 @@ var AuthType;
|
|
|
223
210
|
/**
|
|
224
211
|
* SSO using SAML
|
|
225
212
|
* Will make the host application redirect to the SAML Idp.
|
|
226
|
-
*
|
|
227
213
|
* @example
|
|
228
214
|
* ```js
|
|
229
215
|
* init({
|
|
@@ -237,7 +223,6 @@ var AuthType;
|
|
|
237
223
|
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
238
224
|
/**
|
|
239
225
|
* SSO using OIDC
|
|
240
|
-
*
|
|
241
226
|
* @hidden
|
|
242
227
|
* @deprecated Use {@link OIDCRedirect} instead
|
|
243
228
|
*/
|
|
@@ -249,15 +234,14 @@ var AuthType;
|
|
|
249
234
|
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
250
235
|
/**
|
|
251
236
|
* Trusted authentication server
|
|
252
|
-
*
|
|
253
237
|
* @hidden
|
|
254
238
|
* @deprecated Use {@link TrustedAuth} instead
|
|
255
239
|
*/
|
|
256
240
|
AuthType["AuthServer"] = "AuthServer";
|
|
257
241
|
/**
|
|
258
242
|
* Trusted authentication server, Use your own authentication server
|
|
259
|
-
* which returns a bearer token, generated using the secret_key obtained
|
|
260
|
-
*
|
|
243
|
+
* which returns a bearer token, generated using the secret_key obtained from
|
|
244
|
+
* ThoughtSpot.
|
|
261
245
|
*
|
|
262
246
|
* @example
|
|
263
247
|
* ```js
|
|
@@ -273,11 +257,10 @@ var AuthType;
|
|
|
273
257
|
*/
|
|
274
258
|
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
275
259
|
/**
|
|
276
|
-
* Trusted authentication server Cookieless, Use you own authentication
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
* implemented by some browsers
|
|
260
|
+
* Trusted authentication server Cookieless, Use you own authentication server
|
|
261
|
+
* which returns a bearer token, generated using the secret_key obtained from
|
|
262
|
+
* ThoughtSpot. This uses a cookieless authentication approach, recommended
|
|
263
|
+
* to by pass third-party cookie-blocking restriction implemented by some browsers
|
|
281
264
|
*/
|
|
282
265
|
AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
|
|
283
266
|
/**
|
|
@@ -356,7 +339,6 @@ var RuntimeFilterOp;
|
|
|
356
339
|
*
|
|
357
340
|
* To add an event listener use the corresponding
|
|
358
341
|
* {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
|
|
359
|
-
*
|
|
360
342
|
* @group Events
|
|
361
343
|
*/
|
|
362
344
|
// eslint-disable-next-line no-shadow
|
|
@@ -364,31 +346,26 @@ var EmbedEvent;
|
|
|
364
346
|
(function (EmbedEvent) {
|
|
365
347
|
/**
|
|
366
348
|
* Rendering has initialized.
|
|
367
|
-
*
|
|
368
|
-
* @returns timestamp - The timestamp when the event was generated.
|
|
349
|
+
* @return timestamp - The timestamp when the event was generated.
|
|
369
350
|
*/
|
|
370
351
|
EmbedEvent["Init"] = "init";
|
|
371
352
|
/**
|
|
372
353
|
* Authentication has either succeeded or failed.
|
|
373
|
-
*
|
|
374
|
-
* @returns isLoggedIn - A Boolean specifying whether authentication was successful.
|
|
354
|
+
* @return isLoggedIn - A Boolean specifying whether authentication was successful.
|
|
375
355
|
*/
|
|
376
356
|
EmbedEvent["AuthInit"] = "authInit";
|
|
377
357
|
/**
|
|
378
358
|
* The embed object container has loaded.
|
|
379
|
-
*
|
|
380
|
-
* @returns timestamp - The timestamp when the event was generated.
|
|
359
|
+
* @return timestamp - The timestamp when the event was generated.
|
|
381
360
|
*/
|
|
382
361
|
EmbedEvent["Load"] = "load";
|
|
383
362
|
/**
|
|
384
363
|
* Data pertaining to answer or Liveboard is received
|
|
385
|
-
*
|
|
386
|
-
* @returns data - The answer or Liveboard data
|
|
364
|
+
* @return data - The answer or Liveboard data
|
|
387
365
|
*/
|
|
388
366
|
EmbedEvent["Data"] = "data";
|
|
389
367
|
/**
|
|
390
368
|
* Search/answer/Liveboard filters have been applied/updated
|
|
391
|
-
*
|
|
392
369
|
* @hidden
|
|
393
370
|
*/
|
|
394
371
|
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
@@ -398,56 +375,48 @@ var EmbedEvent;
|
|
|
398
375
|
EmbedEvent["QueryChanged"] = "queryChanged";
|
|
399
376
|
/**
|
|
400
377
|
* A drill down operation has been performed.
|
|
401
|
-
*
|
|
402
|
-
* @
|
|
403
|
-
* @
|
|
404
|
-
* @returns nonFilteredColumns - The columns that were not filtered
|
|
378
|
+
* @return additionalFilters - Any additional filters applied
|
|
379
|
+
* @return drillDownColumns - The columns on which drill down was performed
|
|
380
|
+
* @return nonFilteredColumns - The columns that were not filtered
|
|
405
381
|
*/
|
|
406
382
|
EmbedEvent["Drilldown"] = "drillDown";
|
|
407
383
|
/**
|
|
408
384
|
* One or more data sources have been selected.
|
|
409
|
-
*
|
|
410
|
-
* @returns dataSourceIds - the list of data sources
|
|
385
|
+
* @return dataSourceIds - the list of data sources
|
|
411
386
|
*/
|
|
412
387
|
EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
|
|
413
388
|
/**
|
|
414
389
|
* One or more data columns have been selected.
|
|
415
|
-
*
|
|
416
|
-
* @returns columnIds - the list of columns
|
|
390
|
+
* @return columnIds - the list of columns
|
|
417
391
|
* @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
418
392
|
*/
|
|
419
393
|
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
|
|
420
394
|
/**
|
|
421
395
|
* A custom action has been triggered
|
|
422
|
-
*
|
|
423
|
-
* @
|
|
424
|
-
* @returns data - The answer or Liveboard data
|
|
396
|
+
* @return actionId - The id of the custom action
|
|
397
|
+
* @return data - The answer or Liveboard data
|
|
425
398
|
*/
|
|
426
399
|
EmbedEvent["CustomAction"] = "customAction";
|
|
427
400
|
/**
|
|
428
401
|
* A double click has been triggered on table/chart
|
|
429
|
-
*
|
|
430
|
-
* @returns ContextMenuInputPoints - data point that is double clicked
|
|
402
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
431
403
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
432
404
|
*/
|
|
433
405
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
434
406
|
/**
|
|
435
407
|
* A click has been triggered on table/chart
|
|
436
|
-
*
|
|
437
|
-
* @returns ContextMenuInputPoints - data point that is clicked
|
|
408
|
+
* @return ContextMenuInputPoints - data point that is clicked
|
|
438
409
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
439
410
|
*/
|
|
440
411
|
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
441
412
|
/**
|
|
442
413
|
* An error has occurred.
|
|
443
|
-
*
|
|
444
|
-
* @returns error - An error object or message
|
|
414
|
+
* @return error - An error object or message
|
|
445
415
|
*/
|
|
446
416
|
EmbedEvent["Error"] = "Error";
|
|
447
417
|
/**
|
|
448
418
|
* The embedded object has sent an alert
|
|
449
|
-
*
|
|
450
|
-
* @returns alert - An alert object
|
|
419
|
+
* @return alert - An alert object
|
|
451
420
|
*/
|
|
452
421
|
EmbedEvent["Alert"] = "alert";
|
|
453
422
|
/**
|
|
@@ -456,34 +425,29 @@ var EmbedEvent;
|
|
|
456
425
|
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
457
426
|
/**
|
|
458
427
|
* ThoughtSpot failed to validate the auth session.
|
|
459
|
-
*
|
|
460
428
|
* @hidden
|
|
461
429
|
*/
|
|
462
430
|
EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
|
|
463
431
|
/**
|
|
464
432
|
* ThoughtSpot failed to validate the auth session.
|
|
465
|
-
*
|
|
466
433
|
* @hidden
|
|
467
434
|
*/
|
|
468
435
|
EmbedEvent["AuthLogout"] = "ThoughtspotAuthLogout";
|
|
469
436
|
/**
|
|
470
437
|
* The height of the embedded Liveboard or visualization has been computed.
|
|
471
|
-
*
|
|
472
|
-
* @returns data - The height of the embedded Liveboard or visualization
|
|
438
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
473
439
|
* @hidden
|
|
474
440
|
*/
|
|
475
441
|
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
476
442
|
/**
|
|
477
443
|
* The center of visible iframe viewport is calculated.
|
|
478
|
-
*
|
|
479
|
-
* @returns data - The center of the visible Iframe viewport.
|
|
444
|
+
* @return data - The center of the visible Iframe viewport.
|
|
480
445
|
* @hidden
|
|
481
446
|
*/
|
|
482
447
|
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
483
448
|
/**
|
|
484
449
|
* Emitted when the "Get Data" button in Search Bar embed
|
|
485
450
|
* is clicked.
|
|
486
|
-
*
|
|
487
451
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0-sw
|
|
488
452
|
*/
|
|
489
453
|
EmbedEvent["GetDataClick"] = "getDataClick";
|
|
@@ -493,7 +457,6 @@ var EmbedEvent;
|
|
|
493
457
|
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
494
458
|
/**
|
|
495
459
|
* The v1 event type for Data
|
|
496
|
-
*
|
|
497
460
|
* @hidden
|
|
498
461
|
*/
|
|
499
462
|
EmbedEvent["V1Data"] = "exportVizDataToParent";
|
|
@@ -506,20 +469,17 @@ var EmbedEvent;
|
|
|
506
469
|
EmbedEvent["NoCookieAccess"] = "noCookieAccess";
|
|
507
470
|
/**
|
|
508
471
|
* Emitted when SAML is complete
|
|
509
|
-
*
|
|
510
472
|
* @private
|
|
511
473
|
* @hidden
|
|
512
474
|
*/
|
|
513
475
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
514
476
|
/**
|
|
515
477
|
* Emitted when any modal is opened in the app
|
|
516
|
-
*
|
|
517
478
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
518
479
|
*/
|
|
519
480
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
520
481
|
/**
|
|
521
482
|
* Emitted when any modal is closed in the app
|
|
522
|
-
*
|
|
523
483
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
524
484
|
*/
|
|
525
485
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
@@ -527,232 +487,187 @@ var EmbedEvent;
|
|
|
527
487
|
* Emitted when the Liveboard shell loads.
|
|
528
488
|
* You can use this event as a hook to trigger
|
|
529
489
|
* other events on the rendered Liveboard.
|
|
530
|
-
*
|
|
531
490
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
532
491
|
*/
|
|
533
492
|
EmbedEvent["LiveboardRendered"] = "PinboardRendered";
|
|
534
493
|
/**
|
|
535
494
|
* This can be used to register an event listener which
|
|
536
495
|
* is triggered on all events.
|
|
537
|
-
*
|
|
538
496
|
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
539
497
|
*/
|
|
540
498
|
EmbedEvent["ALL"] = "*";
|
|
541
499
|
/**
|
|
542
500
|
* Emitted when answer is saved in the app
|
|
543
|
-
*
|
|
544
501
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
545
502
|
*/
|
|
546
503
|
EmbedEvent["Save"] = "save";
|
|
547
504
|
/**
|
|
548
505
|
* Emitted when the download action is triggered on an answer
|
|
549
|
-
*
|
|
550
506
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
551
507
|
*/
|
|
552
508
|
EmbedEvent["Download"] = "download";
|
|
553
509
|
/**
|
|
554
510
|
* Emitted when the Download as PDF action is triggered on an answer
|
|
555
|
-
*
|
|
556
511
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
557
512
|
*/
|
|
558
513
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
559
514
|
/**
|
|
560
515
|
* Emitted when the Download as CSV action is triggered on an answer
|
|
561
|
-
*
|
|
562
516
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
563
517
|
*/
|
|
564
518
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
565
519
|
/**
|
|
566
520
|
* Emitted when the Download as XLSX action is triggered on an answer
|
|
567
|
-
*
|
|
568
521
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
569
522
|
*/
|
|
570
523
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
571
524
|
/**
|
|
572
525
|
* Emitted when an answer is deleted in the app
|
|
573
|
-
*
|
|
574
526
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
575
527
|
*/
|
|
576
528
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
577
529
|
/**
|
|
578
530
|
* Emitted when an answer is pinned to a Liveboard
|
|
579
|
-
*
|
|
580
531
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
581
532
|
*/
|
|
582
533
|
EmbedEvent["Pin"] = "pin";
|
|
583
534
|
/**
|
|
584
535
|
* Emitted when SpotIQ analysis is triggered
|
|
585
|
-
*
|
|
586
536
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
587
537
|
*/
|
|
588
538
|
EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
589
539
|
/**
|
|
590
540
|
* Emitted when a user shares an object with another user or group
|
|
591
|
-
*
|
|
592
541
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
593
542
|
*/
|
|
594
543
|
EmbedEvent["Share"] = "share";
|
|
595
544
|
/**
|
|
596
|
-
* Emitted when a user clicks the Include action to include a specific value or data
|
|
597
|
-
* on a chart or table
|
|
598
|
-
*
|
|
545
|
+
* Emitted when a user clicks the Include action to include a specific value or data on a chart or table
|
|
599
546
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
600
547
|
*/
|
|
601
548
|
EmbedEvent["DrillInclude"] = "context-menu-item-include";
|
|
602
549
|
/**
|
|
603
|
-
* Emitted when a user clicks the Exclude action to exclude a specific value or data
|
|
604
|
-
* on a chart or table
|
|
605
|
-
*
|
|
550
|
+
* Emitted when a user clicks the Exclude action to exclude a specific value or data on a chart or table
|
|
606
551
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
607
552
|
*/
|
|
608
553
|
EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
|
|
609
554
|
/**
|
|
610
555
|
* Emitted when copied column value on the app
|
|
611
|
-
*
|
|
612
556
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
613
557
|
*/
|
|
614
558
|
EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
|
|
615
559
|
/**
|
|
616
560
|
* Emitted when a user clicks the Update TML action
|
|
617
|
-
*
|
|
618
561
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
619
562
|
*/
|
|
620
563
|
EmbedEvent["UpdateTML"] = "updateTSL";
|
|
621
564
|
/**
|
|
622
565
|
* Emitted when a user clicks the Edit TML action
|
|
623
|
-
*
|
|
624
566
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
625
567
|
*/
|
|
626
568
|
EmbedEvent["EditTML"] = "editTSL";
|
|
627
569
|
/**
|
|
628
570
|
* Emitted when ExportTML trigger in answer on the app
|
|
629
|
-
*
|
|
630
571
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
631
572
|
*/
|
|
632
573
|
EmbedEvent["ExportTML"] = "exportTSL";
|
|
633
574
|
/**
|
|
634
575
|
* Emitted when an answer is saved as a view
|
|
635
|
-
*
|
|
636
576
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
637
577
|
*/
|
|
638
578
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
639
579
|
/**
|
|
640
580
|
* Emitted when copy of existing answer on the app
|
|
641
|
-
*
|
|
642
581
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
643
582
|
*/
|
|
644
583
|
EmbedEvent["CopyAEdit"] = "copyAEdit";
|
|
645
584
|
/**
|
|
646
585
|
* Emitted when a user clicks Show underlying data on an answe
|
|
647
|
-
*
|
|
648
586
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
649
587
|
*/
|
|
650
588
|
EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
651
589
|
/**
|
|
652
590
|
* Emitted when an answer is switched to a chart or table view
|
|
653
|
-
*
|
|
654
591
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
655
592
|
*/
|
|
656
593
|
EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
657
594
|
/**
|
|
658
595
|
* Internal event to communicate the initial settings back to the TS APP
|
|
659
|
-
*
|
|
660
596
|
* @hidden
|
|
661
597
|
*/
|
|
662
598
|
EmbedEvent["APP_INIT"] = "appInit";
|
|
663
599
|
/**
|
|
664
600
|
* Emitted when a user clicks Show Liveboard details on a Liveboard
|
|
665
|
-
*
|
|
666
601
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
667
602
|
*/
|
|
668
603
|
EmbedEvent["LiveboardInfo"] = "pinboardInfo";
|
|
669
604
|
/**
|
|
670
605
|
* Emitted when a user clicks on the Favorite icon on a Liveboard
|
|
671
|
-
*
|
|
672
606
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
673
607
|
*/
|
|
674
608
|
EmbedEvent["AddToFavorites"] = "addToFavorites";
|
|
675
609
|
/**
|
|
676
610
|
* Emitted when a user clicks Schedule on a Liveboard
|
|
677
|
-
*
|
|
678
611
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
679
612
|
*/
|
|
680
613
|
EmbedEvent["Schedule"] = "subscription";
|
|
681
614
|
/**
|
|
682
615
|
* Emitted when a user clicks Edit on a Liveboard or visualization
|
|
683
|
-
*
|
|
684
616
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
685
617
|
*/
|
|
686
618
|
EmbedEvent["Edit"] = "edit";
|
|
687
619
|
/**
|
|
688
620
|
* Emitted when a user clicks Make a copy on a Liveboard
|
|
689
|
-
*
|
|
690
621
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
691
622
|
*/
|
|
692
623
|
EmbedEvent["MakeACopy"] = "makeACopy";
|
|
693
624
|
/**
|
|
694
625
|
* Emitted when a user clicks Present on a Liveboard or visualization
|
|
695
|
-
*
|
|
696
626
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
697
627
|
*/
|
|
698
628
|
EmbedEvent["Present"] = "present";
|
|
699
629
|
/**
|
|
700
630
|
* Emitted when a user clicks Delete on a Liveboard
|
|
701
|
-
*
|
|
702
631
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
703
632
|
*/
|
|
704
633
|
EmbedEvent["Delete"] = "delete";
|
|
705
634
|
/**
|
|
706
635
|
* Emitted when a user clicks Manage schedules on a Liveboard
|
|
707
|
-
*
|
|
708
636
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
709
637
|
*/
|
|
710
638
|
EmbedEvent["SchedulesList"] = "schedule-list";
|
|
711
639
|
/**
|
|
712
640
|
* Emitted when a user clicks Cancel in edit mode on a Liveboard
|
|
713
|
-
*
|
|
714
641
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
715
642
|
*/
|
|
716
643
|
EmbedEvent["Cancel"] = "cancel";
|
|
717
644
|
/**
|
|
718
645
|
* Emitted when a user clicks Explore on a visualization
|
|
719
|
-
*
|
|
720
646
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
721
647
|
*/
|
|
722
648
|
EmbedEvent["Explore"] = "explore";
|
|
723
649
|
/**
|
|
724
650
|
* Emitted when a user clicks Copy link action on a visualization
|
|
725
|
-
*
|
|
726
651
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
727
652
|
*/
|
|
728
653
|
EmbedEvent["CopyLink"] = "embedDocument";
|
|
729
654
|
/**
|
|
730
655
|
* Emitted when a user interacts with cross filters on a visualization or liveboard
|
|
731
|
-
*
|
|
732
656
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
733
657
|
*/
|
|
734
658
|
EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
|
|
735
659
|
/**
|
|
736
660
|
* Emitted when a user right clicks on chart or table
|
|
737
|
-
*
|
|
738
661
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
739
662
|
*/
|
|
740
663
|
EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
|
|
741
|
-
/**
|
|
742
|
-
* Emitted when a user clicks on Insert to slide on a visualization
|
|
743
|
-
*
|
|
744
|
-
* @hidden
|
|
745
|
-
*/
|
|
746
|
-
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
747
664
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
748
665
|
/**
|
|
749
666
|
* Event types that can be triggered by the host application
|
|
750
667
|
* to the embedded ThoughtSpot app
|
|
751
668
|
*
|
|
752
669
|
* To trigger an event use the corresponding
|
|
753
|
-
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
|
|
754
|
-
* SearchEmbed.trigger} method.
|
|
755
|
-
*
|
|
670
|
+
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link SearchEmbed.trigger} method.
|
|
756
671
|
* @group Events
|
|
757
672
|
*/
|
|
758
673
|
// eslint-disable-next-line no-shadow
|
|
@@ -760,7 +675,6 @@ var HostEvent;
|
|
|
760
675
|
(function (HostEvent) {
|
|
761
676
|
/**
|
|
762
677
|
* Trigger a search
|
|
763
|
-
*
|
|
764
678
|
* @param - dataSourceIds - The data source GUID to Search on
|
|
765
679
|
* - Although an array, only a single source
|
|
766
680
|
* is supported at this time.
|
|
@@ -778,12 +692,10 @@ var HostEvent;
|
|
|
778
692
|
HostEvent["Search"] = "search";
|
|
779
693
|
/**
|
|
780
694
|
* Trigger a drill on certain points by certain column
|
|
781
|
-
*
|
|
782
695
|
* @param - points - an object containing selectedPoints/clickedPoints
|
|
783
696
|
* eg. { selectedPoints: []}
|
|
784
697
|
* @param - columnGuid - a string guid of the column to drill by. This is optional,
|
|
785
|
-
* if not provided it will auto drill by the configured
|
|
786
|
-
* column.
|
|
698
|
+
* if not provided it will auto drill by the configured column.
|
|
787
699
|
* @example
|
|
788
700
|
* ```js
|
|
789
701
|
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
@@ -791,50 +703,44 @@ var HostEvent;
|
|
|
791
703
|
* autoDrillDown: true,
|
|
792
704
|
* })
|
|
793
705
|
* ```
|
|
706
|
+
*
|
|
794
707
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
795
708
|
*/
|
|
796
709
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
797
710
|
/**
|
|
798
711
|
* Apply filters
|
|
799
|
-
*
|
|
800
712
|
* @hidden
|
|
801
713
|
*/
|
|
802
714
|
HostEvent["Filter"] = "filter";
|
|
803
715
|
/**
|
|
804
716
|
* Reload the answer or visualization
|
|
805
|
-
*
|
|
806
717
|
* @hidden
|
|
807
718
|
*/
|
|
808
719
|
HostEvent["Reload"] = "reload";
|
|
809
720
|
/**
|
|
810
721
|
* Set the visible visualizations on a Liveboard.
|
|
811
|
-
*
|
|
812
722
|
* @param - an array of ids of visualizations to show, the ids not passed
|
|
813
723
|
* will be hidden.
|
|
814
724
|
* @example
|
|
815
|
-
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
816
|
-
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
817
|
-
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
725
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, ['730496d6-6903-4601-937e-2c691821af3c', 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
818
726
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
819
727
|
*/
|
|
820
728
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
821
729
|
/**
|
|
822
730
|
* Update the runtime filters. The runtime filters passed here are extended
|
|
823
731
|
* on to the existing runtime filters if they exist.
|
|
824
|
-
*
|
|
825
732
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
826
733
|
* @example
|
|
827
734
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
828
735
|
* {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
|
|
829
|
-
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values:
|
|
830
|
-
*
|
|
736
|
+
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
737
|
+
* ])
|
|
831
738
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
832
739
|
*/
|
|
833
740
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
834
741
|
/**
|
|
835
742
|
* Navigate to a specific page in App embed without any reload.
|
|
836
743
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
837
|
-
*
|
|
838
744
|
* @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
839
745
|
* @example
|
|
840
746
|
* ```js
|
|
@@ -846,22 +752,16 @@ var HostEvent;
|
|
|
846
752
|
/**
|
|
847
753
|
* Opens the filter panel for a particular column.
|
|
848
754
|
* Works with Search embed.
|
|
849
|
-
*
|
|
850
|
-
* @param - { columnId: string,
|
|
851
|
-
* name: string,
|
|
852
|
-
* type: INT64/CHAR/DATE,
|
|
853
|
-
* dataType: ATTRIBUTE/MEASURE }
|
|
755
|
+
* @param - { columnId: string, name: string, type: INT64/CHAR/DATE, dataType: ATTRIBUTE/MEASURE }
|
|
854
756
|
* @example
|
|
855
757
|
* ```js
|
|
856
|
-
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
857
|
-
* { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
758
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
858
759
|
* ```
|
|
859
760
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
860
761
|
*/
|
|
861
762
|
HostEvent["OpenFilter"] = "openFilter";
|
|
862
763
|
/**
|
|
863
764
|
* Adds the columns to the current Search.
|
|
864
|
-
*
|
|
865
765
|
* @param - { columnIds: string[] }
|
|
866
766
|
* @example
|
|
867
767
|
* ```js
|
|
@@ -872,7 +772,6 @@ var HostEvent;
|
|
|
872
772
|
HostEvent["AddColumns"] = "addColumns";
|
|
873
773
|
/**
|
|
874
774
|
* Removes a column from the current Search.
|
|
875
|
-
*
|
|
876
775
|
* @param - { columnId: string }
|
|
877
776
|
* @example
|
|
878
777
|
* ```js
|
|
@@ -883,7 +782,6 @@ var HostEvent;
|
|
|
883
782
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
884
783
|
/**
|
|
885
784
|
* Gets the current pinboard content.
|
|
886
|
-
*
|
|
887
785
|
* @example
|
|
888
786
|
* ```js
|
|
889
787
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
|
|
@@ -893,7 +791,6 @@ var HostEvent;
|
|
|
893
791
|
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
894
792
|
/**
|
|
895
793
|
* Triggers the Pin action on an embedded object
|
|
896
|
-
*
|
|
897
794
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
898
795
|
* can be left empty for search and visualization embeds
|
|
899
796
|
* @example
|
|
@@ -907,7 +804,6 @@ var HostEvent;
|
|
|
907
804
|
HostEvent["Pin"] = "pin";
|
|
908
805
|
/**
|
|
909
806
|
* Triggers the Show Liveboard details action on a Liveboard
|
|
910
|
-
*
|
|
911
807
|
* @example
|
|
912
808
|
* ```js
|
|
913
809
|
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
@@ -917,7 +813,6 @@ var HostEvent;
|
|
|
917
813
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
918
814
|
/**
|
|
919
815
|
* Triggers the Schedule action on a Liveboard
|
|
920
|
-
*
|
|
921
816
|
* @example
|
|
922
817
|
* ```js
|
|
923
818
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -927,7 +822,6 @@ var HostEvent;
|
|
|
927
822
|
HostEvent["Schedule"] = "subscription";
|
|
928
823
|
/**
|
|
929
824
|
* Triggers the Manage schedule action on a Liveboard
|
|
930
|
-
*
|
|
931
825
|
* @example
|
|
932
826
|
* ```js
|
|
933
827
|
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
@@ -937,7 +831,6 @@ var HostEvent;
|
|
|
937
831
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
938
832
|
/**
|
|
939
833
|
* Triggers the Export TML action on a Liveboard
|
|
940
|
-
*
|
|
941
834
|
* @example
|
|
942
835
|
* ```js
|
|
943
836
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -947,7 +840,6 @@ var HostEvent;
|
|
|
947
840
|
HostEvent["ExportTML"] = "exportTSL";
|
|
948
841
|
/**
|
|
949
842
|
* Triggers the Edit TML action on a Liveboard
|
|
950
|
-
*
|
|
951
843
|
* @example
|
|
952
844
|
* ```js
|
|
953
845
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -957,7 +849,6 @@ var HostEvent;
|
|
|
957
849
|
HostEvent["EditTML"] = "editTSL";
|
|
958
850
|
/**
|
|
959
851
|
* Triggers the Update TML action on a Liveboard
|
|
960
|
-
*
|
|
961
852
|
* @example
|
|
962
853
|
* ```js
|
|
963
854
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -967,7 +858,6 @@ var HostEvent;
|
|
|
967
858
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
968
859
|
/**
|
|
969
860
|
* Triggers the Download PDF action on a Liveboard
|
|
970
|
-
*
|
|
971
861
|
* @example
|
|
972
862
|
* ```js
|
|
973
863
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
|
|
@@ -977,7 +867,6 @@ var HostEvent;
|
|
|
977
867
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
978
868
|
/**
|
|
979
869
|
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
980
|
-
*
|
|
981
870
|
* @example
|
|
982
871
|
* ```js
|
|
983
872
|
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
@@ -989,7 +878,6 @@ var HostEvent;
|
|
|
989
878
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
990
879
|
/**
|
|
991
880
|
* Triggers the Delete action on a Liveboard
|
|
992
|
-
*
|
|
993
881
|
* @example
|
|
994
882
|
* ```js
|
|
995
883
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -999,7 +887,6 @@ var HostEvent;
|
|
|
999
887
|
HostEvent["Remove"] = "delete";
|
|
1000
888
|
/**
|
|
1001
889
|
* Triggers the Explore action on a visualization
|
|
1002
|
-
*
|
|
1003
890
|
* @param - an object with vizId as a key
|
|
1004
891
|
* @example
|
|
1005
892
|
* ```js
|
|
@@ -1010,48 +897,37 @@ var HostEvent;
|
|
|
1010
897
|
HostEvent["Explore"] = "explore";
|
|
1011
898
|
/**
|
|
1012
899
|
* Triggers the Create alert action on a visualization
|
|
1013
|
-
*
|
|
1014
900
|
* @param - an object with vizId as a key
|
|
1015
901
|
* @example
|
|
1016
902
|
* ```js
|
|
1017
|
-
* liveboardEmbed.trigger(HostEvent.CreateMonitor {
|
|
1018
|
-
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1019
|
-
* })
|
|
903
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1020
904
|
* ```
|
|
1021
905
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1022
906
|
*/
|
|
1023
907
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
1024
908
|
/**
|
|
1025
909
|
* Triggers the Manage alert action on a visualization
|
|
1026
|
-
*
|
|
1027
910
|
* @param - an object with vizId as a key
|
|
1028
911
|
* @example
|
|
1029
912
|
* ```js
|
|
1030
|
-
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
1031
|
-
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1032
|
-
* })
|
|
913
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1033
914
|
* ```
|
|
1034
915
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1035
916
|
*/
|
|
1036
917
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
1037
918
|
/**
|
|
1038
919
|
* Triggers the Edit action on a Liveboard or visualization
|
|
1039
|
-
*
|
|
1040
|
-
* @param - object - to trigger the action for a specfic visualization
|
|
1041
|
-
* in Liveboard embed, pass in vizId as a key
|
|
920
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
1042
921
|
* @example
|
|
1043
922
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
1044
|
-
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
1045
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
923
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1046
924
|
* vizEmbed.trigger((HostEvent.Edit)
|
|
1047
925
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1048
926
|
*/
|
|
1049
927
|
HostEvent["Edit"] = "edit";
|
|
1050
928
|
/**
|
|
1051
929
|
* Triggers the Copy link action on a Liveboard or visualization
|
|
1052
|
-
*
|
|
1053
|
-
* @param - object - to trigger the action for a s
|
|
1054
|
-
* pecfic visualization in Liveboard embed, pass in vizId as a key
|
|
930
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
1055
931
|
* @example
|
|
1056
932
|
* ```js
|
|
1057
933
|
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
@@ -1063,9 +939,7 @@ var HostEvent;
|
|
|
1063
939
|
HostEvent["CopyLink"] = "embedDocument";
|
|
1064
940
|
/**
|
|
1065
941
|
* Triggers the Present action on a Liveboard or visualization
|
|
1066
|
-
*
|
|
1067
|
-
* @param - object - to trigger the action for a specfic visualization
|
|
1068
|
-
* in Liveboard embed, pass in vizId as a key
|
|
942
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
1069
943
|
* @example
|
|
1070
944
|
* ```js
|
|
1071
945
|
* liveboardEmbed.trigger(HostEvent.Present)
|
|
@@ -1077,21 +951,18 @@ var HostEvent;
|
|
|
1077
951
|
HostEvent["Present"] = "present";
|
|
1078
952
|
/**
|
|
1079
953
|
* Get TML for the current search.
|
|
1080
|
-
*
|
|
1081
954
|
* @example
|
|
1082
955
|
* ```js
|
|
1083
956
|
* searchEmbed.trigger(HostEvent.GetTML)
|
|
1084
957
|
* ```
|
|
1085
|
-
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
958
|
+
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
1086
959
|
*/
|
|
1087
960
|
HostEvent["GetTML"] = "getTML";
|
|
1088
961
|
/**
|
|
1089
962
|
* Triggers the ShowUnderlyingData action on visualization or search
|
|
1090
|
-
*
|
|
1091
963
|
* @param - an object with vizId as a key
|
|
1092
964
|
* @example
|
|
1093
|
-
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId:
|
|
1094
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
965
|
+
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1095
966
|
* vizEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
1096
967
|
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
1097
968
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1099,12 +970,10 @@ var HostEvent;
|
|
|
1099
970
|
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
1100
971
|
/**
|
|
1101
972
|
* Triggers the Delete action on visualization or search
|
|
1102
|
-
*
|
|
1103
973
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
1104
974
|
* can be left empty for search and visualization embeds
|
|
1105
975
|
* @example
|
|
1106
|
-
* liveboardEmbed.trigger(HostEvent.Delete, {vizId:
|
|
1107
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
976
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1108
977
|
* vizEmbed.trigger(HostEvent.Delete)
|
|
1109
978
|
* searchEmbed.trigger(HostEvent.Delete)
|
|
1110
979
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1112,12 +981,10 @@ var HostEvent;
|
|
|
1112
981
|
HostEvent["Delete"] = "delete";
|
|
1113
982
|
/**
|
|
1114
983
|
* Triggers the SpotIQAnalyze action on visualization or search
|
|
1115
|
-
*
|
|
1116
984
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
1117
985
|
* can be left empty for search and visualization embeds
|
|
1118
986
|
* @example
|
|
1119
|
-
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId:
|
|
1120
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
987
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1121
988
|
* vizEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
1122
989
|
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
1123
990
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1125,34 +992,26 @@ var HostEvent;
|
|
|
1125
992
|
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
1126
993
|
/**
|
|
1127
994
|
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
1128
|
-
*
|
|
1129
995
|
* @example
|
|
1130
|
-
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
1131
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
996
|
+
* liveboardEmbed.trigger(HostEvent.Download, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1132
997
|
* vizEmbed.trigger(HostEvent.Download)
|
|
1133
998
|
* searchEmbed.trigger(HostEvent.Download)
|
|
1134
999
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1135
1000
|
*/
|
|
1136
1001
|
HostEvent["Download"] = "download";
|
|
1137
1002
|
/**
|
|
1138
|
-
* Triggers the downloadAsCSV action on visualization or search when Displaymode is
|
|
1139
|
-
* Table
|
|
1140
|
-
*
|
|
1003
|
+
* Triggers the downloadAsCSV action on visualization or search when Displaymode is Table
|
|
1141
1004
|
* @example
|
|
1142
|
-
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
1143
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1005
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1144
1006
|
* vizEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
1145
1007
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
1146
1008
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1147
1009
|
*/
|
|
1148
1010
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
1149
1011
|
/**
|
|
1150
|
-
* Triggers the downloadAsXLSX action on visualization or search when Displaymode is
|
|
1151
|
-
* Table
|
|
1152
|
-
*
|
|
1012
|
+
* Triggers the downloadAsXLSX action on visualization or search when Displaymode is Table
|
|
1153
1013
|
* @example
|
|
1154
|
-
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
1155
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1014
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1156
1015
|
* vizEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
1157
1016
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
1158
1017
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1160,7 +1019,6 @@ var HostEvent;
|
|
|
1160
1019
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
1161
1020
|
/**
|
|
1162
1021
|
* Triggers the Share action on a liveboard or answer
|
|
1163
|
-
*
|
|
1164
1022
|
* @example
|
|
1165
1023
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
1166
1024
|
* searchEmbed.trigger(HostEvent.Share)
|
|
@@ -1169,7 +1027,6 @@ var HostEvent;
|
|
|
1169
1027
|
HostEvent["Share"] = "share";
|
|
1170
1028
|
/**
|
|
1171
1029
|
* Trigger the Save action on a liveboard or answer
|
|
1172
|
-
*
|
|
1173
1030
|
* @example
|
|
1174
1031
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
1175
1032
|
* searchEmbed.trigger(HostEvent.Save)
|
|
@@ -1178,40 +1035,33 @@ var HostEvent;
|
|
|
1178
1035
|
HostEvent["Save"] = "save";
|
|
1179
1036
|
/**
|
|
1180
1037
|
* Triggers the SyncToSheets action on visualization
|
|
1181
|
-
*
|
|
1182
1038
|
* @param - an object with vizId as a key
|
|
1183
1039
|
* @example
|
|
1184
|
-
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId:
|
|
1185
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1040
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1186
1041
|
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
1187
1042
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1188
1043
|
*/
|
|
1189
1044
|
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
1190
1045
|
/**
|
|
1191
1046
|
* Triggers the SyncToOtherApps action on visualization
|
|
1192
|
-
*
|
|
1193
1047
|
* @param - an object with vizId as a key
|
|
1194
1048
|
* @example
|
|
1195
|
-
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId:
|
|
1196
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1049
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1197
1050
|
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
1198
1051
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1199
1052
|
*/
|
|
1200
1053
|
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
1201
1054
|
/**
|
|
1202
1055
|
* Triggers the ManagePipelines action on visualization
|
|
1203
|
-
*
|
|
1204
1056
|
* @param - an object with vizId as a key
|
|
1205
1057
|
* @example
|
|
1206
|
-
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId:
|
|
1207
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1058
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1208
1059
|
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
1209
1060
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1210
1061
|
*/
|
|
1211
1062
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
1212
1063
|
/**
|
|
1213
1064
|
* Triggers the Reset search in answer
|
|
1214
|
-
*
|
|
1215
1065
|
* @example
|
|
1216
1066
|
* searchEmbed.trigger(HostEvent.SearchReset
|
|
1217
1067
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1-sw
|
|
@@ -1245,7 +1095,6 @@ var DataSourceVisualMode;
|
|
|
1245
1095
|
// eslint-disable-next-line no-shadow
|
|
1246
1096
|
var Param;
|
|
1247
1097
|
(function (Param) {
|
|
1248
|
-
Param["EmbedApp"] = "embedApp";
|
|
1249
1098
|
Param["DataSources"] = "dataSources";
|
|
1250
1099
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
1251
1100
|
Param["DisableActions"] = "disableAction";
|
|
@@ -1286,8 +1135,6 @@ var Param;
|
|
|
1286
1135
|
Param["ContextMenuTrigger"] = "isContextMenuEnabledOnLeftClick";
|
|
1287
1136
|
Param["LinkOverride"] = "linkOverride";
|
|
1288
1137
|
Param["ShowInsertToSlide"] = "insertInToSlide";
|
|
1289
|
-
Param["PrimaryNavHidden"] = "primaryNavHidden";
|
|
1290
|
-
Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
|
|
1291
1138
|
})(Param || (Param = {}));
|
|
1292
1139
|
/**
|
|
1293
1140
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -1542,7 +1389,6 @@ const urlRegex = new RegExp([
|
|
|
1542
1389
|
/**
|
|
1543
1390
|
* Parse and construct the ThoughtSpot hostname or IP address
|
|
1544
1391
|
* from the embed configuration object.
|
|
1545
|
-
*
|
|
1546
1392
|
* @param config
|
|
1547
1393
|
*/
|
|
1548
1394
|
const getThoughtSpotHost = (config) => {
|
|
@@ -1566,10 +1412,9 @@ const getV2BasePath = (config) => {
|
|
|
1566
1412
|
return config.basepath;
|
|
1567
1413
|
}
|
|
1568
1414
|
const tsHost = getThoughtSpotHost(config);
|
|
1569
|
-
// This is to handle when e2e's. Search is run on pods for
|
|
1570
|
-
//
|
|
1571
|
-
// This is to handle when the developer is developing in their local
|
|
1572
|
-
// environment.
|
|
1415
|
+
// This is to handle when e2e's. Search is run on pods for comp-blink-test-pipeline
|
|
1416
|
+
// with baseUrl=https://localhost:8443.
|
|
1417
|
+
// This is to handle when the developer is developing in their local environment.
|
|
1573
1418
|
if (tsHost.includes('://localhost') && !tsHost.includes(':8443')) {
|
|
1574
1419
|
return '';
|
|
1575
1420
|
}
|
|
@@ -7579,7 +7424,6 @@ let isMixpanelInitialized = false;
|
|
|
7579
7424
|
let eventQueue = [];
|
|
7580
7425
|
/**
|
|
7581
7426
|
* Pushes the event with its Property key-value map to mixpanel.
|
|
7582
|
-
*
|
|
7583
7427
|
* @param eventId
|
|
7584
7428
|
* @param eventProps
|
|
7585
7429
|
*/
|
|
@@ -7590,9 +7434,6 @@ function uploadMixpanelEvent(eventId, eventProps = {}) {
|
|
|
7590
7434
|
}
|
|
7591
7435
|
mixpanel_cjs.track(eventId, eventProps);
|
|
7592
7436
|
}
|
|
7593
|
-
/**
|
|
7594
|
-
*
|
|
7595
|
-
*/
|
|
7596
7437
|
function emptyQueue() {
|
|
7597
7438
|
if (!isMixpanelInitialized) {
|
|
7598
7439
|
return;
|
|
@@ -7602,16 +7443,11 @@ function emptyQueue() {
|
|
|
7602
7443
|
});
|
|
7603
7444
|
eventQueue = [];
|
|
7604
7445
|
}
|
|
7605
|
-
/**
|
|
7606
|
-
*
|
|
7607
|
-
* @param sessionInfo
|
|
7608
|
-
*/
|
|
7609
7446
|
function initMixpanel(sessionInfo) {
|
|
7610
7447
|
if (!sessionInfo || !sessionInfo.mixpanelToken) {
|
|
7611
7448
|
return;
|
|
7612
7449
|
}
|
|
7613
|
-
// On a public cluster the user is anonymous, so don't set the identify to
|
|
7614
|
-
// userGUID
|
|
7450
|
+
// On a public cluster the user is anonymous, so don't set the identify to userGUID
|
|
7615
7451
|
const isPublicCluster = !!sessionInfo.isPublicUser;
|
|
7616
7452
|
const token = sessionInfo.mixpanelToken;
|
|
7617
7453
|
if (token) {
|
|
@@ -9090,11 +8926,6 @@ function uniq(array) {
|
|
|
9090
8926
|
var uniq_1 = uniq;
|
|
9091
8927
|
|
|
9092
8928
|
// eslint-disable-next-line import/no-cycle
|
|
9093
|
-
/**
|
|
9094
|
-
*
|
|
9095
|
-
* @param url
|
|
9096
|
-
* @param options
|
|
9097
|
-
*/
|
|
9098
8929
|
function failureLoggedFetch(url, options = {}) {
|
|
9099
8930
|
return fetch(url, options).then(async (r) => {
|
|
9100
8931
|
var _a;
|
|
@@ -9104,42 +8935,21 @@ function failureLoggedFetch(url, options = {}) {
|
|
|
9104
8935
|
return r;
|
|
9105
8936
|
});
|
|
9106
8937
|
}
|
|
9107
|
-
/**
|
|
9108
|
-
*
|
|
9109
|
-
* @param authVerificationUrl
|
|
9110
|
-
*/
|
|
9111
8938
|
function fetchSessionInfoService(authVerificationUrl) {
|
|
9112
8939
|
return failureLoggedFetch(authVerificationUrl, {
|
|
9113
8940
|
credentials: 'include',
|
|
9114
8941
|
});
|
|
9115
8942
|
}
|
|
9116
|
-
/**
|
|
9117
|
-
*
|
|
9118
|
-
* @param authEndpoint
|
|
9119
|
-
*/
|
|
9120
8943
|
async function fetchAuthTokenService(authEndpoint) {
|
|
9121
8944
|
return fetch(authEndpoint);
|
|
9122
8945
|
}
|
|
9123
|
-
/**
|
|
9124
|
-
*
|
|
9125
|
-
* @param thoughtSpotHost
|
|
9126
|
-
* @param username
|
|
9127
|
-
* @param authToken
|
|
9128
|
-
*/
|
|
9129
8946
|
async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
9130
8947
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
9131
8948
|
credentials: 'include',
|
|
9132
|
-
// We do not want to follow the redirect, as it starts giving a CORS
|
|
9133
|
-
// error
|
|
8949
|
+
// We do not want to follow the redirect, as it starts giving a CORS error
|
|
9134
8950
|
redirect: 'manual',
|
|
9135
8951
|
});
|
|
9136
8952
|
}
|
|
9137
|
-
/**
|
|
9138
|
-
*
|
|
9139
|
-
* @param thoughtSpotHost
|
|
9140
|
-
* @param username
|
|
9141
|
-
* @param authToken
|
|
9142
|
-
*/
|
|
9143
8953
|
async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
|
|
9144
8954
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
|
|
9145
8955
|
method: 'POST',
|
|
@@ -9149,17 +8959,10 @@ async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
|
|
|
9149
8959
|
},
|
|
9150
8960
|
body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
|
|
9151
8961
|
credentials: 'include',
|
|
9152
|
-
// We do not want to follow the redirect, as it starts giving a CORS
|
|
9153
|
-
// error
|
|
8962
|
+
// We do not want to follow the redirect, as it starts giving a CORS error
|
|
9154
8963
|
redirect: 'manual',
|
|
9155
8964
|
});
|
|
9156
8965
|
}
|
|
9157
|
-
/**
|
|
9158
|
-
*
|
|
9159
|
-
* @param thoughtSpotHost
|
|
9160
|
-
* @param username
|
|
9161
|
-
* @param password
|
|
9162
|
-
*/
|
|
9163
8966
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
9164
8967
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
9165
8968
|
method: 'POST',
|
|
@@ -9171,10 +8974,6 @@ async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
|
9171
8974
|
credentials: 'include',
|
|
9172
8975
|
});
|
|
9173
8976
|
}
|
|
9174
|
-
/**
|
|
9175
|
-
*
|
|
9176
|
-
* @param thoughtSpotHost
|
|
9177
|
-
*/
|
|
9178
8977
|
async function fetchLogoutService(thoughtSpotHost) {
|
|
9179
8978
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.LOGOUT}`, {
|
|
9180
8979
|
credentials: 'include',
|
|
@@ -9209,7 +9008,6 @@ const EndPoints = {
|
|
|
9209
9008
|
/**
|
|
9210
9009
|
* Enum for auth failure types. This is the parameter passed to the listner
|
|
9211
9010
|
* of {@link AuthStatus.FAILURE}.
|
|
9212
|
-
*
|
|
9213
9011
|
* @group Authentication / Init
|
|
9214
9012
|
*/
|
|
9215
9013
|
var AuthFailureType;
|
|
@@ -9221,7 +9019,6 @@ var AuthFailureType;
|
|
|
9221
9019
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
9222
9020
|
/**
|
|
9223
9021
|
* Enum for auth status emitted by the emitter returned from {@link init}.
|
|
9224
|
-
*
|
|
9225
9022
|
* @group Authentication / Init
|
|
9226
9023
|
*/
|
|
9227
9024
|
var AuthStatus;
|
|
@@ -9246,14 +9043,12 @@ var AuthStatus;
|
|
|
9246
9043
|
* Emitted when inPopup: true in the SAMLRedirect flow.
|
|
9247
9044
|
* And, we are waiting for popup to be triggered either programatically
|
|
9248
9045
|
* or by the trigger button.
|
|
9249
|
-
*
|
|
9250
9046
|
* @version SDK: 1.19.0
|
|
9251
9047
|
*/
|
|
9252
9048
|
AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
|
|
9253
9049
|
})(AuthStatus || (AuthStatus = {}));
|
|
9254
9050
|
/**
|
|
9255
9051
|
* Events which can be triggered on the emitter returned from {@link init}.
|
|
9256
|
-
*
|
|
9257
9052
|
* @group Authentication / Init
|
|
9258
9053
|
*/
|
|
9259
9054
|
var AuthEvent;
|
|
@@ -9265,16 +9060,9 @@ var AuthEvent;
|
|
|
9265
9060
|
AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
|
|
9266
9061
|
})(AuthEvent || (AuthEvent = {}));
|
|
9267
9062
|
let authEE;
|
|
9268
|
-
/**
|
|
9269
|
-
*
|
|
9270
|
-
* @param eventEmitter
|
|
9271
|
-
*/
|
|
9272
9063
|
function setAuthEE(eventEmitter) {
|
|
9273
9064
|
authEE = eventEmitter;
|
|
9274
9065
|
}
|
|
9275
|
-
/**
|
|
9276
|
-
*
|
|
9277
|
-
*/
|
|
9278
9066
|
function notifyAuthSDKSuccess() {
|
|
9279
9067
|
if (!authEE) {
|
|
9280
9068
|
console.error('SDK not initialized');
|
|
@@ -9282,9 +9070,6 @@ function notifyAuthSDKSuccess() {
|
|
|
9282
9070
|
}
|
|
9283
9071
|
authEE.emit(AuthStatus.SDK_SUCCESS);
|
|
9284
9072
|
}
|
|
9285
|
-
/**
|
|
9286
|
-
*
|
|
9287
|
-
*/
|
|
9288
9073
|
function notifyAuthSuccess() {
|
|
9289
9074
|
if (!authEE) {
|
|
9290
9075
|
console.error('SDK not initialized');
|
|
@@ -9292,10 +9077,6 @@ function notifyAuthSuccess() {
|
|
|
9292
9077
|
}
|
|
9293
9078
|
authEE.emit(AuthStatus.SUCCESS, sessionInfo);
|
|
9294
9079
|
}
|
|
9295
|
-
/**
|
|
9296
|
-
*
|
|
9297
|
-
* @param failureType
|
|
9298
|
-
*/
|
|
9299
9080
|
function notifyAuthFailure(failureType) {
|
|
9300
9081
|
if (!authEE) {
|
|
9301
9082
|
console.error('SDK not initialized');
|
|
@@ -9303,9 +9084,6 @@ function notifyAuthFailure(failureType) {
|
|
|
9303
9084
|
}
|
|
9304
9085
|
authEE.emit(AuthStatus.FAILURE, failureType);
|
|
9305
9086
|
}
|
|
9306
|
-
/**
|
|
9307
|
-
*
|
|
9308
|
-
*/
|
|
9309
9087
|
function notifyLogout() {
|
|
9310
9088
|
if (!authEE) {
|
|
9311
9089
|
console.error('SDK not initialized');
|
|
@@ -9315,7 +9093,6 @@ function notifyLogout() {
|
|
|
9315
9093
|
}
|
|
9316
9094
|
/**
|
|
9317
9095
|
* Check if we are logged into the ThoughtSpot cluster
|
|
9318
|
-
*
|
|
9319
9096
|
* @param thoughtSpotHost The ThoughtSpot cluster hostname or IP
|
|
9320
9097
|
*/
|
|
9321
9098
|
async function isLoggedIn(thoughtSpotHost) {
|
|
@@ -9338,30 +9115,21 @@ function getReleaseVersion() {
|
|
|
9338
9115
|
return releaseVersion;
|
|
9339
9116
|
}
|
|
9340
9117
|
/**
|
|
9341
|
-
* Return a promise that resolves with the session information when
|
|
9342
|
-
*
|
|
9343
|
-
*
|
|
9118
|
+
* Return a promise that resolves with the session information when authentication is
|
|
9119
|
+
* successful. And info is available.
|
|
9344
9120
|
* @group Global methods
|
|
9345
9121
|
*/
|
|
9346
9122
|
function getSessionInfo() {
|
|
9347
9123
|
return sessionInfoPromise;
|
|
9348
9124
|
}
|
|
9349
|
-
/**
|
|
9350
|
-
*
|
|
9351
|
-
* @param sessionDetails
|
|
9352
|
-
*/
|
|
9353
9125
|
function initSession(sessionDetails) {
|
|
9354
9126
|
sessionInfo = sessionDetails;
|
|
9355
9127
|
initMixpanel(sessionInfo);
|
|
9356
9128
|
sessionInfoResolver(sessionInfo);
|
|
9357
9129
|
}
|
|
9358
|
-
const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
|
|
9359
|
-
|
|
9130
|
+
const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.' +
|
|
9131
|
+
'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
|
|
9360
9132
|
let prevAuthToken = null;
|
|
9361
|
-
/**
|
|
9362
|
-
*
|
|
9363
|
-
* @param authtoken
|
|
9364
|
-
*/
|
|
9365
9133
|
function alertForDuplicateToken(authtoken) {
|
|
9366
9134
|
if (prevAuthToken === authtoken) {
|
|
9367
9135
|
// eslint-disable-next-line no-alert
|
|
@@ -9381,10 +9149,9 @@ function isAtSSORedirectUrl() {
|
|
|
9381
9149
|
*/
|
|
9382
9150
|
function removeSSORedirectUrlMarker() {
|
|
9383
9151
|
// Note (sunny): This will leave a # around even if it was not in the URL
|
|
9384
|
-
// to begin with. Trying to remove the hash by changing window.location will
|
|
9385
|
-
//
|
|
9386
|
-
//
|
|
9387
|
-
// that creates an issue.
|
|
9152
|
+
// to begin with. Trying to remove the hash by changing window.location will reload
|
|
9153
|
+
// the page which we don't want. We'll live with adding an unnecessary hash to the
|
|
9154
|
+
// parent page URL until we find any use case where that creates an issue.
|
|
9388
9155
|
window.location.hash = window.location.hash.replace(SSO_REDIRECTION_MARKER_GUID, '');
|
|
9389
9156
|
}
|
|
9390
9157
|
const getAuthenticaionToken = async (embedConfig) => {
|
|
@@ -9402,7 +9169,6 @@ const getAuthenticaionToken = async (embedConfig) => {
|
|
|
9402
9169
|
};
|
|
9403
9170
|
/**
|
|
9404
9171
|
* Perform token based authentication
|
|
9405
|
-
*
|
|
9406
9172
|
* @param embedConfig The embed configuration
|
|
9407
9173
|
*/
|
|
9408
9174
|
const doTokenAuth = async (embedConfig) => {
|
|
@@ -9423,8 +9189,8 @@ const doTokenAuth = async (embedConfig) => {
|
|
|
9423
9189
|
// token login issues a 302 when successful
|
|
9424
9190
|
loggedInStatus = resp.ok || resp.type === 'opaqueredirect';
|
|
9425
9191
|
if (loggedInStatus && embedConfig.detectCookieAccessSlow) {
|
|
9426
|
-
// When 3rd party cookie access is blocked, this will fail because
|
|
9427
|
-
//
|
|
9192
|
+
// When 3rd party cookie access is blocked, this will fail because cookies will
|
|
9193
|
+
// not be sent with the call.
|
|
9428
9194
|
loggedInStatus = await isLoggedIn(thoughtSpotHost);
|
|
9429
9195
|
}
|
|
9430
9196
|
}
|
|
@@ -9432,7 +9198,6 @@ const doTokenAuth = async (embedConfig) => {
|
|
|
9432
9198
|
};
|
|
9433
9199
|
/**
|
|
9434
9200
|
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
9435
|
-
*
|
|
9436
9201
|
* @param embedConfig The embed configuration
|
|
9437
9202
|
*/
|
|
9438
9203
|
const doCookielessTokenAuth = async (embedConfig) => {
|
|
@@ -9448,7 +9213,6 @@ const doCookielessTokenAuth = async (embedConfig) => {
|
|
|
9448
9213
|
*
|
|
9449
9214
|
* Warning: This feature is primarily intended for developer testing. It is
|
|
9450
9215
|
* strongly advised not to use this authentication method in production.
|
|
9451
|
-
*
|
|
9452
9216
|
* @param embedConfig The embed configuration
|
|
9453
9217
|
*/
|
|
9454
9218
|
const doBasicAuth = async (embedConfig) => {
|
|
@@ -9466,12 +9230,6 @@ const doBasicAuth = async (embedConfig) => {
|
|
|
9466
9230
|
}
|
|
9467
9231
|
return loggedInStatus;
|
|
9468
9232
|
};
|
|
9469
|
-
/**
|
|
9470
|
-
*
|
|
9471
|
-
* @param ssoURL
|
|
9472
|
-
* @param triggerContainer
|
|
9473
|
-
* @param triggerText
|
|
9474
|
-
*/
|
|
9475
9233
|
async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
9476
9234
|
const openPopup = () => {
|
|
9477
9235
|
if (samlAuthWindow === null || samlAuthWindow.closed) {
|
|
@@ -9484,28 +9242,28 @@ async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
|
9484
9242
|
authEE === null || authEE === void 0 ? void 0 : authEE.emit(AuthStatus.WAITING_FOR_POPUP);
|
|
9485
9243
|
const containerEl = getDOMNode(triggerContainer);
|
|
9486
9244
|
if (containerEl) {
|
|
9487
|
-
containerEl.innerHTML =
|
|
9245
|
+
containerEl.innerHTML =
|
|
9246
|
+
'<button id="ts-auth-btn" class="ts-auth-btn" style="margin: auto;"></button>';
|
|
9488
9247
|
const authElem = document.getElementById('ts-auth-btn');
|
|
9489
9248
|
authElem.textContent = triggerText;
|
|
9490
9249
|
authElem.addEventListener('click', openPopup, { once: true });
|
|
9491
9250
|
}
|
|
9492
|
-
samlCompletionPromise =
|
|
9493
|
-
||
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
e.
|
|
9497
|
-
|
|
9498
|
-
|
|
9251
|
+
samlCompletionPromise =
|
|
9252
|
+
samlCompletionPromise ||
|
|
9253
|
+
new Promise((resolve, reject) => {
|
|
9254
|
+
window.addEventListener('message', (e) => {
|
|
9255
|
+
if (e.data.type === EmbedEvent.SAMLComplete) {
|
|
9256
|
+
e.source.close();
|
|
9257
|
+
resolve();
|
|
9258
|
+
}
|
|
9259
|
+
});
|
|
9499
9260
|
});
|
|
9500
|
-
});
|
|
9501
9261
|
authEE === null || authEE === void 0 ? void 0 : authEE.once(AuthEvent.TRIGGER_SSO_POPUP, openPopup);
|
|
9502
9262
|
return samlCompletionPromise;
|
|
9503
9263
|
}
|
|
9504
9264
|
/**
|
|
9505
9265
|
* Perform SAML authentication
|
|
9506
|
-
*
|
|
9507
9266
|
* @param embedConfig The embed configuration
|
|
9508
|
-
* @param ssoEndPoint
|
|
9509
9267
|
*/
|
|
9510
9268
|
const doSSOAuth = async (embedConfig, ssoEndPoint) => {
|
|
9511
9269
|
const { thoughtSpotHost } = embedConfig;
|
|
@@ -9534,8 +9292,8 @@ const doSSOAuth = async (embedConfig, ssoEndPoint) => {
|
|
|
9534
9292
|
};
|
|
9535
9293
|
const doSamlAuth = async (embedConfig) => {
|
|
9536
9294
|
const { thoughtSpotHost } = embedConfig;
|
|
9537
|
-
// redirect for SSO, when the SSO authentication is done, this page will be
|
|
9538
|
-
//
|
|
9295
|
+
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
9296
|
+
// again and the same JS will execute again.
|
|
9539
9297
|
const ssoRedirectUrl = embedConfig.inPopup
|
|
9540
9298
|
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
9541
9299
|
: getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
|
|
@@ -9546,8 +9304,8 @@ const doSamlAuth = async (embedConfig) => {
|
|
|
9546
9304
|
};
|
|
9547
9305
|
const doOIDCAuth = async (embedConfig) => {
|
|
9548
9306
|
const { thoughtSpotHost } = embedConfig;
|
|
9549
|
-
// redirect for SSO, when the SSO authentication is done, this page will be
|
|
9550
|
-
//
|
|
9307
|
+
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
9308
|
+
// again and the same JS will execute again.
|
|
9551
9309
|
const ssoRedirectUrl = embedConfig.noRedirect || embedConfig.inPopup
|
|
9552
9310
|
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
9553
9311
|
: getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
|
|
@@ -9564,7 +9322,6 @@ const logout = async (embedConfig) => {
|
|
|
9564
9322
|
};
|
|
9565
9323
|
/**
|
|
9566
9324
|
* Perform authentication on the ThoughtSpot cluster
|
|
9567
|
-
*
|
|
9568
9325
|
* @param embedConfig The embed configuration
|
|
9569
9326
|
*/
|
|
9570
9327
|
const authenticate = async (embedConfig) => {
|
|
@@ -9630,10 +9387,7 @@ const hostUrlToFeatureUrl = {
|
|
|
9630
9387
|
[PrefetchFeatures.VizEmbed]: (url) => url,
|
|
9631
9388
|
};
|
|
9632
9389
|
/**
|
|
9633
|
-
* Prefetches static resources from the specified URL. Web browsers can then cache the
|
|
9634
|
-
* prefetched resources and serve them from the user's local disk to provide faster access
|
|
9635
|
-
* to your app.
|
|
9636
|
-
*
|
|
9390
|
+
* Prefetches static resources from the specified URL. Web browsers can then cache the prefetched resources and serve them from the user's local disk to provide faster access to your app.
|
|
9637
9391
|
* @param url The URL provided for prefetch
|
|
9638
9392
|
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
9639
9393
|
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
@@ -9660,10 +9414,6 @@ const prefetch = (url, prefetchFeatures) => {
|
|
|
9660
9414
|
});
|
|
9661
9415
|
}
|
|
9662
9416
|
};
|
|
9663
|
-
/**
|
|
9664
|
-
*
|
|
9665
|
-
* @param embedConfig
|
|
9666
|
-
*/
|
|
9667
9417
|
function sanity(embedConfig) {
|
|
9668
9418
|
if (embedConfig.thoughtSpotHost === undefined) {
|
|
9669
9419
|
throw new Error('ThoughtSpot host not provided');
|
|
@@ -9672,18 +9422,16 @@ function sanity(embedConfig) {
|
|
|
9672
9422
|
if (!embedConfig.username) {
|
|
9673
9423
|
throw new Error('Username not provided with Trusted auth');
|
|
9674
9424
|
}
|
|
9675
|
-
if (!embedConfig.authEndpoint &&
|
|
9425
|
+
if (!embedConfig.authEndpoint &&
|
|
9426
|
+
typeof embedConfig.getAuthToken !== 'function') {
|
|
9676
9427
|
throw new Error('Trusted auth should provide either authEndpoint or getAuthToken');
|
|
9677
9428
|
}
|
|
9678
9429
|
}
|
|
9679
9430
|
}
|
|
9680
|
-
/**
|
|
9681
|
-
*
|
|
9682
|
-
* @param embedConfig
|
|
9683
|
-
*/
|
|
9684
9431
|
function backwardCompat(embedConfig) {
|
|
9685
9432
|
const newConfig = { ...embedConfig };
|
|
9686
|
-
if (embedConfig.noRedirect !== undefined &&
|
|
9433
|
+
if (embedConfig.noRedirect !== undefined &&
|
|
9434
|
+
embedConfig.inPopup === undefined) {
|
|
9687
9435
|
newConfig.inPopup = embedConfig.noRedirect;
|
|
9688
9436
|
}
|
|
9689
9437
|
return newConfig;
|
|
@@ -9691,9 +9439,9 @@ function backwardCompat(embedConfig) {
|
|
|
9691
9439
|
/**
|
|
9692
9440
|
* Initializes the Visual Embed SDK globally and perform
|
|
9693
9441
|
* authentication if applicable.
|
|
9694
|
-
*
|
|
9695
9442
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
9696
9443
|
* authentication mechanism and so on.
|
|
9444
|
+
*
|
|
9697
9445
|
* @example
|
|
9698
9446
|
* ```js
|
|
9699
9447
|
* const authStatus = init({
|
|
@@ -9702,8 +9450,8 @@ function backwardCompat(embedConfig) {
|
|
|
9702
9450
|
* });
|
|
9703
9451
|
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
9704
9452
|
* ```
|
|
9705
|
-
*
|
|
9706
|
-
*
|
|
9453
|
+
*
|
|
9454
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
|
|
9707
9455
|
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
9708
9456
|
* @group Authentication / Init
|
|
9709
9457
|
*/
|
|
@@ -9724,7 +9472,8 @@ const init = (embedConfig) => {
|
|
|
9724
9472
|
host: config.thoughtSpotHost,
|
|
9725
9473
|
usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
|
|
9726
9474
|
usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
|
|
9727
|
-
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
|
|
9475
|
+
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
|
|
9476
|
+
null,
|
|
9728
9477
|
usedCustomizationStrings: !!((_k = (_j = embedConfig.customizations) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.strings),
|
|
9729
9478
|
usedCustomizationIconSprite: !!((_l = embedConfig.customizations) === null || _l === void 0 ? void 0 : _l.iconSpriteUrl),
|
|
9730
9479
|
});
|
|
@@ -9733,18 +9482,15 @@ const init = (embedConfig) => {
|
|
|
9733
9482
|
}
|
|
9734
9483
|
return authEE;
|
|
9735
9484
|
};
|
|
9736
|
-
/**
|
|
9737
|
-
*
|
|
9738
|
-
*/
|
|
9739
9485
|
function disableAutoLogin() {
|
|
9740
9486
|
config.autoLogin = false;
|
|
9741
9487
|
}
|
|
9742
9488
|
/**
|
|
9743
|
-
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
9744
|
-
*
|
|
9489
|
+
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to prevent
|
|
9490
|
+
* the SDK from automatically logging in again.
|
|
9745
9491
|
*
|
|
9746
|
-
* You can call the `init` method again to re login, if autoLogin is set to
|
|
9747
|
-
*
|
|
9492
|
+
* You can call the `init` method again to re login, if autoLogin is set to true in this
|
|
9493
|
+
* second call it will be honored.
|
|
9748
9494
|
*
|
|
9749
9495
|
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
9750
9496
|
* @returns Promise which resolves when logout completes.
|
|
@@ -9762,9 +9508,7 @@ const logout$1 = (doNotDisableAutoLogin = false) => {
|
|
|
9762
9508
|
};
|
|
9763
9509
|
let renderQueue = Promise.resolve();
|
|
9764
9510
|
/**
|
|
9765
|
-
* Renders functions in a queue, resolves to next function only after the callback next
|
|
9766
|
-
* is called
|
|
9767
|
-
*
|
|
9511
|
+
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
9768
9512
|
* @param fn The function being registered
|
|
9769
9513
|
*/
|
|
9770
9514
|
const renderInQueue = (fn) => {
|
|
@@ -9777,13 +9521,6 @@ const renderInQueue = (fn) => {
|
|
|
9777
9521
|
return fn(() => { }); // eslint-disable-line @typescript-eslint/no-empty-function
|
|
9778
9522
|
};
|
|
9779
9523
|
|
|
9780
|
-
/**
|
|
9781
|
-
*
|
|
9782
|
-
* @param session
|
|
9783
|
-
* @param query
|
|
9784
|
-
* @param operation
|
|
9785
|
-
* @param thoughtSpotHost
|
|
9786
|
-
*/
|
|
9787
9524
|
function getAnswerServiceInstance(session, query, operation, thoughtSpotHost) {
|
|
9788
9525
|
let variable;
|
|
9789
9526
|
const fetchQuery = async (variables) => {
|
|
@@ -9833,14 +9570,12 @@ function getAnswerServiceInstance(session, query, operation, thoughtSpotHost) {
|
|
|
9833
9570
|
};
|
|
9834
9571
|
}
|
|
9835
9572
|
|
|
9836
|
-
/**
|
|
9837
|
-
*
|
|
9838
|
-
* @param e
|
|
9839
|
-
* @param thoughtSpotHost
|
|
9840
|
-
*/
|
|
9841
9573
|
function processCustomAction(e, thoughtSpotHost) {
|
|
9842
9574
|
var _a;
|
|
9843
|
-
if ([
|
|
9575
|
+
if ([
|
|
9576
|
+
OperationType.GetChartWithData,
|
|
9577
|
+
OperationType.GetTableWithHeadlineData,
|
|
9578
|
+
].includes((_a = e.data) === null || _a === void 0 ? void 0 : _a.operation)) {
|
|
9844
9579
|
const { session, query, operation } = e.data;
|
|
9845
9580
|
const answerService = getAnswerServiceInstance(session, query, operation, thoughtSpotHost);
|
|
9846
9581
|
return {
|
|
@@ -9850,10 +9585,6 @@ function processCustomAction(e, thoughtSpotHost) {
|
|
|
9850
9585
|
}
|
|
9851
9586
|
return e;
|
|
9852
9587
|
}
|
|
9853
|
-
/**
|
|
9854
|
-
*
|
|
9855
|
-
* @param e
|
|
9856
|
-
*/
|
|
9857
9588
|
function processAuthInit(e) {
|
|
9858
9589
|
var _a, _b;
|
|
9859
9590
|
// Store user session details sent by app.
|
|
@@ -9867,13 +9598,8 @@ function processAuthInit(e) {
|
|
|
9867
9598
|
},
|
|
9868
9599
|
};
|
|
9869
9600
|
}
|
|
9870
|
-
/**
|
|
9871
|
-
*
|
|
9872
|
-
* @param e
|
|
9873
|
-
* @param containerEl
|
|
9874
|
-
*/
|
|
9875
9601
|
function processNoCookieAccess(e, containerEl) {
|
|
9876
|
-
const { loginFailedMessage, suppressNoCookieAccessAlert } = getEmbedConfig();
|
|
9602
|
+
const { loginFailedMessage, suppressNoCookieAccessAlert, } = getEmbedConfig();
|
|
9877
9603
|
if (!suppressNoCookieAccessAlert) {
|
|
9878
9604
|
// eslint-disable-next-line no-alert
|
|
9879
9605
|
alert('Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.');
|
|
@@ -9883,11 +9609,6 @@ function processNoCookieAccess(e, containerEl) {
|
|
|
9883
9609
|
notifyAuthFailure(AuthFailureType.NO_COOKIE_ACCESS);
|
|
9884
9610
|
return e;
|
|
9885
9611
|
}
|
|
9886
|
-
/**
|
|
9887
|
-
*
|
|
9888
|
-
* @param e
|
|
9889
|
-
* @param containerEl
|
|
9890
|
-
*/
|
|
9891
9612
|
function processAuthFailure(e, containerEl) {
|
|
9892
9613
|
const { loginFailedMessage, authType } = getEmbedConfig();
|
|
9893
9614
|
if (authType !== AuthType.None) {
|
|
@@ -9897,11 +9618,6 @@ function processAuthFailure(e, containerEl) {
|
|
|
9897
9618
|
}
|
|
9898
9619
|
return e;
|
|
9899
9620
|
}
|
|
9900
|
-
/**
|
|
9901
|
-
*
|
|
9902
|
-
* @param e
|
|
9903
|
-
* @param containerEl
|
|
9904
|
-
*/
|
|
9905
9621
|
function processAuthLogout(e, containerEl) {
|
|
9906
9622
|
const { loginFailedMessage } = getEmbedConfig();
|
|
9907
9623
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -9910,13 +9626,6 @@ function processAuthLogout(e, containerEl) {
|
|
|
9910
9626
|
notifyLogout();
|
|
9911
9627
|
return e;
|
|
9912
9628
|
}
|
|
9913
|
-
/**
|
|
9914
|
-
*
|
|
9915
|
-
* @param type
|
|
9916
|
-
* @param e
|
|
9917
|
-
* @param thoughtSpotHost
|
|
9918
|
-
* @param containerEl
|
|
9919
|
-
*/
|
|
9920
9629
|
function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
9921
9630
|
switch (type) {
|
|
9922
9631
|
case EmbedEvent.CustomAction:
|
|
@@ -9935,8 +9644,6 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
9935
9644
|
|
|
9936
9645
|
/**
|
|
9937
9646
|
* Reloads the ThoughtSpot iframe.
|
|
9938
|
-
*
|
|
9939
|
-
* @param iFrame
|
|
9940
9647
|
*/
|
|
9941
9648
|
function reload(iFrame) {
|
|
9942
9649
|
const oldFrame = iFrame.cloneNode();
|
|
@@ -9946,25 +9653,13 @@ function reload(iFrame) {
|
|
|
9946
9653
|
}
|
|
9947
9654
|
/**
|
|
9948
9655
|
* Post Iframe message.
|
|
9949
|
-
*
|
|
9950
|
-
* @param iFrame
|
|
9951
|
-
* @param message
|
|
9952
|
-
* @param message.type
|
|
9953
|
-
* @param message.data
|
|
9954
|
-
* @param thoughtSpotHost
|
|
9955
|
-
* @param channel
|
|
9956
9656
|
*/
|
|
9957
9657
|
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
9958
|
-
return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [
|
|
9658
|
+
return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [
|
|
9659
|
+
channel === null || channel === void 0 ? void 0 : channel.port2,
|
|
9660
|
+
]);
|
|
9959
9661
|
}
|
|
9960
9662
|
const TRIGGER_TIMEOUT = 30000;
|
|
9961
|
-
/**
|
|
9962
|
-
*
|
|
9963
|
-
* @param iFrame
|
|
9964
|
-
* @param messageType
|
|
9965
|
-
* @param thoughtSpotHost
|
|
9966
|
-
* @param data
|
|
9967
|
-
*/
|
|
9968
9663
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
9969
9664
|
return new Promise((res, rej) => {
|
|
9970
9665
|
if (messageType === HostEvent.Reload) {
|
|
@@ -9990,7 +9685,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9990
9685
|
});
|
|
9991
9686
|
}
|
|
9992
9687
|
|
|
9993
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.20.
|
|
9688
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.20.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports={".":"./lib/src/index.js","./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
9994
9689
|
|
|
9995
9690
|
/**
|
|
9996
9691
|
* Copyright (c) 2022
|
|
@@ -10010,7 +9705,6 @@ const TS_EMBED_ID = '_thoughtspot-embed';
|
|
|
10010
9705
|
* The event id map from v2 event names to v1 event id
|
|
10011
9706
|
* v1 events are the classic embed events implemented in Blink v1
|
|
10012
9707
|
* We cannot rename v1 event types to maintain backward compatibility
|
|
10013
|
-
*
|
|
10014
9708
|
* @internal
|
|
10015
9709
|
*/
|
|
10016
9710
|
const V1EventMap = {};
|
|
@@ -10021,28 +9715,22 @@ const V1EventMap = {};
|
|
|
10021
9715
|
*/
|
|
10022
9716
|
class TsEmbed {
|
|
10023
9717
|
constructor(domSelector, viewConfig) {
|
|
10024
|
-
this.isAppInitialized = false;
|
|
10025
9718
|
/**
|
|
10026
9719
|
* Should we encode URL Query Params using base64 encoding which thoughtspot
|
|
10027
9720
|
* will generate for embedding. This provides additional security to
|
|
10028
9721
|
* thoughtspot clusters against Cross site scripting attacks.
|
|
10029
|
-
*
|
|
10030
9722
|
* @default false
|
|
10031
9723
|
*/
|
|
10032
9724
|
this.shouldEncodeUrlQueryParams = false;
|
|
10033
9725
|
this.defaultHiddenActions = [Action.ReportError];
|
|
10034
9726
|
/**
|
|
10035
9727
|
* Send Custom style as part of payload of APP_INIT
|
|
10036
|
-
*
|
|
10037
|
-
* @param _
|
|
10038
|
-
* @param responder
|
|
10039
9728
|
*/
|
|
10040
9729
|
this.appInitCb = async (_, responder) => {
|
|
10041
9730
|
let authToken = '';
|
|
10042
9731
|
if (this.embedConfig.authType === AuthType.TrustedAuthTokenCookieless) {
|
|
10043
9732
|
authToken = await getAuthenticaionToken(this.embedConfig);
|
|
10044
9733
|
}
|
|
10045
|
-
this.isAppInitialized = true;
|
|
10046
9734
|
responder({
|
|
10047
9735
|
type: EmbedEvent.APP_INIT,
|
|
10048
9736
|
data: {
|
|
@@ -10053,9 +9741,6 @@ class TsEmbed {
|
|
|
10053
9741
|
};
|
|
10054
9742
|
/**
|
|
10055
9743
|
* Sends updated auth token to the iFrame to avoid user logout
|
|
10056
|
-
*
|
|
10057
|
-
* @param _
|
|
10058
|
-
* @param responder
|
|
10059
9744
|
*/
|
|
10060
9745
|
this.updateAuthToken = async (_, responder) => {
|
|
10061
9746
|
const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
|
|
@@ -10097,7 +9782,6 @@ class TsEmbed {
|
|
|
10097
9782
|
}
|
|
10098
9783
|
/**
|
|
10099
9784
|
* Handles errors within the SDK
|
|
10100
|
-
*
|
|
10101
9785
|
* @param error The error message or object
|
|
10102
9786
|
*/
|
|
10103
9787
|
handleError(error) {
|
|
@@ -10110,7 +9794,6 @@ class TsEmbed {
|
|
|
10110
9794
|
}
|
|
10111
9795
|
/**
|
|
10112
9796
|
* Extracts the type field from the event payload
|
|
10113
|
-
*
|
|
10114
9797
|
* @param event The window message event
|
|
10115
9798
|
*/
|
|
10116
9799
|
getEventType(event) {
|
|
@@ -10120,7 +9803,6 @@ class TsEmbed {
|
|
|
10120
9803
|
}
|
|
10121
9804
|
/**
|
|
10122
9805
|
* Extracts the port field from the event payload
|
|
10123
|
-
*
|
|
10124
9806
|
* @param event The window message event
|
|
10125
9807
|
* @returns
|
|
10126
9808
|
*/
|
|
@@ -10133,9 +9815,6 @@ class TsEmbed {
|
|
|
10133
9815
|
/**
|
|
10134
9816
|
* fix for ts7.sep.cl
|
|
10135
9817
|
* will be removed for ts7.oct.cl
|
|
10136
|
-
*
|
|
10137
|
-
* @param event
|
|
10138
|
-
* @param eventType
|
|
10139
9818
|
* @hidden
|
|
10140
9819
|
*/
|
|
10141
9820
|
formatEventData(event, eventType) {
|
|
@@ -10166,31 +9845,33 @@ class TsEmbed {
|
|
|
10166
9845
|
}
|
|
10167
9846
|
/**
|
|
10168
9847
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
10169
|
-
*
|
|
10170
|
-
* @param query
|
|
10171
9848
|
*/
|
|
10172
9849
|
getEmbedBasePath(query) {
|
|
10173
9850
|
let queryString = query;
|
|
10174
9851
|
if (this.shouldEncodeUrlQueryParams) {
|
|
10175
9852
|
queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
|
|
10176
9853
|
}
|
|
10177
|
-
const basePath = [
|
|
9854
|
+
const basePath = [
|
|
9855
|
+
this.thoughtSpotHost,
|
|
9856
|
+
this.thoughtSpotV2Base,
|
|
9857
|
+
queryString,
|
|
9858
|
+
]
|
|
10178
9859
|
.filter((x) => x.length > 0)
|
|
10179
9860
|
.join('/');
|
|
10180
|
-
return `${basePath}
|
|
9861
|
+
return `${basePath}#/embed`;
|
|
10181
9862
|
}
|
|
10182
9863
|
/**
|
|
10183
9864
|
* Common query params set for all the embed modes.
|
|
10184
|
-
*
|
|
10185
|
-
* @param queryParams
|
|
10186
9865
|
* @returns queryParams
|
|
10187
9866
|
*/
|
|
10188
|
-
getBaseQueryParams(
|
|
9867
|
+
getBaseQueryParams() {
|
|
10189
9868
|
var _a, _b;
|
|
9869
|
+
const queryParams = {};
|
|
10190
9870
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
10191
|
-
// The below check is needed because TS Cloud firewall, blocks
|
|
10192
|
-
//
|
|
10193
|
-
if (hostAppUrl.includes('localhost') ||
|
|
9871
|
+
// The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
|
|
9872
|
+
// in any url param.
|
|
9873
|
+
if (hostAppUrl.includes('localhost') ||
|
|
9874
|
+
hostAppUrl.includes('127.0.0.1')) {
|
|
10194
9875
|
hostAppUrl = 'local-host';
|
|
10195
9876
|
}
|
|
10196
9877
|
queryParams[Param.HostAppUrl] = encodeURIComponent(hostAppUrl);
|
|
@@ -10198,7 +9879,8 @@ class TsEmbed {
|
|
|
10198
9879
|
queryParams[Param.ViewPortWidth] = window.innerWidth;
|
|
10199
9880
|
queryParams[Param.Version] = version$1;
|
|
10200
9881
|
queryParams[Param.AuthType] = this.embedConfig.authType;
|
|
10201
|
-
if (this.embedConfig.disableLoginRedirect === true ||
|
|
9882
|
+
if (this.embedConfig.disableLoginRedirect === true ||
|
|
9883
|
+
this.embedConfig.autoLogin === true) {
|
|
10202
9884
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
10203
9885
|
}
|
|
10204
9886
|
if (this.embedConfig.authType === AuthType.EmbeddedSSO) {
|
|
@@ -10213,7 +9895,8 @@ class TsEmbed {
|
|
|
10213
9895
|
return queryParams;
|
|
10214
9896
|
}
|
|
10215
9897
|
// TODO remove embedConfig.customCssUrl
|
|
10216
|
-
const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
|
|
9898
|
+
const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
|
|
9899
|
+
this.embedConfig.customCssUrl;
|
|
10217
9900
|
if (cssUrlParam) {
|
|
10218
9901
|
queryParams[Param.CustomCSSUrl] = cssUrlParam;
|
|
10219
9902
|
}
|
|
@@ -10223,14 +9906,15 @@ class TsEmbed {
|
|
|
10223
9906
|
if (disabledActionReason) {
|
|
10224
9907
|
queryParams[Param.DisableActionReason] = disabledActionReason;
|
|
10225
9908
|
}
|
|
10226
|
-
queryParams[Param.HideActions] = [
|
|
9909
|
+
queryParams[Param.HideActions] = [
|
|
9910
|
+
...this.defaultHiddenActions,
|
|
9911
|
+
...(hiddenActions !== null && hiddenActions !== void 0 ? hiddenActions : []),
|
|
9912
|
+
];
|
|
10227
9913
|
if (Array.isArray(visibleActions)) {
|
|
10228
9914
|
queryParams[Param.VisibleActions] = visibleActions;
|
|
10229
9915
|
}
|
|
10230
|
-
/**
|
|
10231
|
-
*
|
|
10232
|
-
* from version 9.2.0.cl the user have an option to override context
|
|
10233
|
-
* menu click
|
|
9916
|
+
/** Default behavior for context menu will be left-click
|
|
9917
|
+
* from version 9.2.0.cl the user have an option to override context menu click
|
|
10234
9918
|
*/
|
|
10235
9919
|
if (contextMenuTrigger === ContextMenuTriggerOptions.LEFT_CLICK) {
|
|
10236
9920
|
queryParams[Param.ContextMenuTrigger] = true;
|
|
@@ -10262,61 +9946,32 @@ class TsEmbed {
|
|
|
10262
9946
|
/**
|
|
10263
9947
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
10264
9948
|
* This is used for embedding Liveboards, visualizations, and full application.
|
|
10265
|
-
*
|
|
10266
9949
|
* @param queryString The query string to append to the URL.
|
|
10267
9950
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
10268
9951
|
* the full application.
|
|
10269
9952
|
*/
|
|
10270
|
-
getV1EmbedBasePath(queryString) {
|
|
10271
|
-
const
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
const
|
|
9953
|
+
getV1EmbedBasePath(queryString, showPrimaryNavbar = false, disableProfileAndHelp = false, isAppEmbed = false, enableSearchAssist = false) {
|
|
9954
|
+
const queryStringFrag = queryString ? `&${queryString}` : '';
|
|
9955
|
+
const primaryNavParam = `&primaryNavHidden=${!showPrimaryNavbar}`;
|
|
9956
|
+
const disableProfileAndHelpParam = `&profileAndHelpInNavBarHidden=${disableProfileAndHelp}`;
|
|
9957
|
+
const enableSearchAssistParam = `&${Param.EnableSearchAssist}=${enableSearchAssist}`;
|
|
9958
|
+
let queryParams = `?embedApp=true${isAppEmbed ? primaryNavParam : ''}${isAppEmbed ? disableProfileAndHelpParam : ''}${enableSearchAssist ? enableSearchAssistParam : ''}${queryStringFrag}`;
|
|
9959
|
+
if (this.shouldEncodeUrlQueryParams) {
|
|
9960
|
+
queryParams = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryParams.substr(1))}`;
|
|
9961
|
+
}
|
|
9962
|
+
let path = `${this.thoughtSpotHost}/${queryParams}#`;
|
|
9963
|
+
if (!isAppEmbed) {
|
|
9964
|
+
path = `${path}/embed`;
|
|
9965
|
+
}
|
|
10275
9966
|
return path;
|
|
10276
9967
|
}
|
|
10277
|
-
getEmbedParams() {
|
|
10278
|
-
const queryParams = this.getBaseQueryParams();
|
|
10279
|
-
return getQueryParamString(queryParams);
|
|
10280
|
-
}
|
|
10281
|
-
getRootIframeSrc() {
|
|
10282
|
-
const query = this.getEmbedParams();
|
|
10283
|
-
return this.getEmbedBasePath(query);
|
|
10284
|
-
}
|
|
10285
|
-
createIframeEl(frameSrc) {
|
|
10286
|
-
const iFrame = document.createElement('iframe');
|
|
10287
|
-
iFrame.src = frameSrc;
|
|
10288
|
-
iFrame.id = TS_EMBED_ID;
|
|
10289
|
-
// according to screenfull.js documentation
|
|
10290
|
-
// allowFullscreen, webkitallowfullscreen and mozallowfullscreen must be
|
|
10291
|
-
// true
|
|
10292
|
-
iFrame.allowFullscreen = true;
|
|
10293
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10294
|
-
// @ts-ignore
|
|
10295
|
-
iFrame.webkitallowfullscreen = true;
|
|
10296
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10297
|
-
// @ts-ignore
|
|
10298
|
-
iFrame.mozallowfullscreen = true;
|
|
10299
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10300
|
-
// @ts-ignore
|
|
10301
|
-
iFrame.allow = 'clipboard-read; clipboard-write';
|
|
10302
|
-
const { height: frameHeight, width: frameWidth, ...restParams } = this.viewConfig.frameParams || {};
|
|
10303
|
-
const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
|
|
10304
|
-
const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
|
|
10305
|
-
setAttributes(iFrame, restParams);
|
|
10306
|
-
iFrame.style.width = `${width}`;
|
|
10307
|
-
iFrame.style.height = `${height}`;
|
|
10308
|
-
iFrame.style.border = '0';
|
|
10309
|
-
iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
10310
|
-
return iFrame;
|
|
10311
|
-
}
|
|
10312
9968
|
/**
|
|
10313
9969
|
* Renders the embedded ThoughtSpot app in an iframe and sets up
|
|
10314
9970
|
* event listeners.
|
|
10315
|
-
*
|
|
10316
9971
|
* @param url
|
|
10317
9972
|
* @param frameOptions
|
|
10318
9973
|
*/
|
|
10319
|
-
async renderIFrame(url) {
|
|
9974
|
+
async renderIFrame(url, frameOptions = {}) {
|
|
10320
9975
|
if (this.isError) {
|
|
10321
9976
|
return null;
|
|
10322
9977
|
}
|
|
@@ -10340,7 +9995,30 @@ class TsEmbed {
|
|
|
10340
9995
|
return;
|
|
10341
9996
|
}
|
|
10342
9997
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
10343
|
-
this.iFrame =
|
|
9998
|
+
this.iFrame =
|
|
9999
|
+
this.iFrame || document.createElement('iframe');
|
|
10000
|
+
this.iFrame.src = url;
|
|
10001
|
+
this.iFrame.id = TS_EMBED_ID;
|
|
10002
|
+
// according to screenfull.js documentation
|
|
10003
|
+
// allowFullscreen, webkitallowfullscreen and mozallowfullscreen must be true
|
|
10004
|
+
this.iFrame.allowFullscreen = true;
|
|
10005
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10006
|
+
// @ts-ignore
|
|
10007
|
+
this.iFrame.webkitallowfullscreen = true;
|
|
10008
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10009
|
+
// @ts-ignore
|
|
10010
|
+
this.iFrame.mozallowfullscreen = true;
|
|
10011
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10012
|
+
// @ts-ignore
|
|
10013
|
+
this.iFrame.allow = 'clipboard-read; clipboard-write';
|
|
10014
|
+
const { height: frameHeight, width: frameWidth, ...restParams } = frameOptions;
|
|
10015
|
+
const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
|
|
10016
|
+
const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
|
|
10017
|
+
setAttributes(this.iFrame, restParams);
|
|
10018
|
+
this.iFrame.style.width = `${width}`;
|
|
10019
|
+
this.iFrame.style.height = `${height}`;
|
|
10020
|
+
this.iFrame.style.border = '0';
|
|
10021
|
+
this.iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
10344
10022
|
this.iFrame.addEventListener('load', () => {
|
|
10345
10023
|
nextInQueue();
|
|
10346
10024
|
const loadTimestamp = Date.now();
|
|
@@ -10367,9 +10045,7 @@ class TsEmbed {
|
|
|
10367
10045
|
this.subscribeToEvents();
|
|
10368
10046
|
}).catch((error) => {
|
|
10369
10047
|
nextInQueue();
|
|
10370
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
10371
|
-
error: JSON.stringify(error),
|
|
10372
|
-
});
|
|
10048
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, { error: JSON.stringify(error) });
|
|
10373
10049
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
10374
10050
|
this.handleError(error);
|
|
10375
10051
|
});
|
|
@@ -10403,7 +10079,6 @@ class TsEmbed {
|
|
|
10403
10079
|
}
|
|
10404
10080
|
/**
|
|
10405
10081
|
* Sets the height of the iframe
|
|
10406
|
-
*
|
|
10407
10082
|
* @param height The height in pixels
|
|
10408
10083
|
*/
|
|
10409
10084
|
setIFrameHeight(height) {
|
|
@@ -10411,7 +10086,6 @@ class TsEmbed {
|
|
|
10411
10086
|
}
|
|
10412
10087
|
/**
|
|
10413
10088
|
* Executes all registered event handlers for a particular event type
|
|
10414
|
-
*
|
|
10415
10089
|
* @param eventType The event type
|
|
10416
10090
|
* @param data The payload invoked with the event handler
|
|
10417
10091
|
* @param eventPort The event Port for a specific MessageChannel
|
|
@@ -10422,13 +10096,11 @@ class TsEmbed {
|
|
|
10422
10096
|
callbacks.push(...allHandlers);
|
|
10423
10097
|
const dataStatus = (data === null || data === void 0 ? void 0 : data.status) || embedEventStatus.END;
|
|
10424
10098
|
callbacks.forEach((callbackObj) => {
|
|
10425
|
-
if (
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
// payload
|
|
10431
|
-
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
10099
|
+
if ((callbackObj.options.start &&
|
|
10100
|
+
dataStatus === embedEventStatus.START) || // When start status is true it trigger only start releated payload
|
|
10101
|
+
(!callbackObj.options.start &&
|
|
10102
|
+
dataStatus === embedEventStatus.END) // When start status is false it trigger only end releated payload
|
|
10103
|
+
) {
|
|
10432
10104
|
callbackObj.callback(data, (payload) => {
|
|
10433
10105
|
this.triggerEventOnPort(eventPort, payload);
|
|
10434
10106
|
});
|
|
@@ -10443,7 +10115,6 @@ class TsEmbed {
|
|
|
10443
10115
|
}
|
|
10444
10116
|
/**
|
|
10445
10117
|
* Gets the v1 event type (if applicable) for the EmbedEvent type
|
|
10446
|
-
*
|
|
10447
10118
|
* @param eventType The v2 event type
|
|
10448
10119
|
* @returns The corresponding v1 event type if one exists
|
|
10449
10120
|
* or else the v2 event type itself
|
|
@@ -10455,7 +10126,6 @@ class TsEmbed {
|
|
|
10455
10126
|
* Calculates the iframe center for the current visible viewPort
|
|
10456
10127
|
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
10457
10128
|
* in Host app. ViewPort height of the tab.
|
|
10458
|
-
*
|
|
10459
10129
|
* @returns iframe Center in visible viewport,
|
|
10460
10130
|
* Iframe height,
|
|
10461
10131
|
* View port height.
|
|
@@ -10469,7 +10139,8 @@ class TsEmbed {
|
|
|
10469
10139
|
let iframeVisibleViewPort;
|
|
10470
10140
|
let iframeOffset;
|
|
10471
10141
|
if (iframeScrolled < 0) {
|
|
10472
|
-
iframeVisibleViewPort =
|
|
10142
|
+
iframeVisibleViewPort =
|
|
10143
|
+
viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
10473
10144
|
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
10474
10145
|
iframeOffset = 0;
|
|
10475
10146
|
}
|
|
@@ -10520,11 +10191,8 @@ class TsEmbed {
|
|
|
10520
10191
|
/**
|
|
10521
10192
|
* Triggers an event on specific Port registered against
|
|
10522
10193
|
* for the EmbedEvent
|
|
10523
|
-
*
|
|
10524
10194
|
* @param eventType The message type
|
|
10525
10195
|
* @param data The payload to send
|
|
10526
|
-
* @param eventPort
|
|
10527
|
-
* @param payload
|
|
10528
10196
|
*/
|
|
10529
10197
|
triggerEventOnPort(eventPort, payload) {
|
|
10530
10198
|
if (eventPort) {
|
|
@@ -10545,7 +10213,6 @@ class TsEmbed {
|
|
|
10545
10213
|
}
|
|
10546
10214
|
/**
|
|
10547
10215
|
* Triggers an event to the embedded app
|
|
10548
|
-
*
|
|
10549
10216
|
* @param messageType The event type
|
|
10550
10217
|
* @param data The payload to send with the message
|
|
10551
10218
|
*/
|
|
@@ -10557,7 +10224,6 @@ class TsEmbed {
|
|
|
10557
10224
|
* Marks the ThoughtSpot object to have been rendered
|
|
10558
10225
|
* Needs to be overridden by subclasses to do the actual
|
|
10559
10226
|
* rendering of the iframe.
|
|
10560
|
-
*
|
|
10561
10227
|
* @param args
|
|
10562
10228
|
*/
|
|
10563
10229
|
render() {
|
|
@@ -10568,7 +10234,6 @@ class TsEmbed {
|
|
|
10568
10234
|
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
10569
10235
|
* host app URL.
|
|
10570
10236
|
* THOUGHTSPOT URL params starts with a prefix "ts-"
|
|
10571
|
-
*
|
|
10572
10237
|
* @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
10573
10238
|
*/
|
|
10574
10239
|
getThoughtSpotPostUrlParams() {
|
|
@@ -10592,7 +10257,6 @@ class TsEmbed {
|
|
|
10592
10257
|
}
|
|
10593
10258
|
/**
|
|
10594
10259
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
10595
|
-
*
|
|
10596
10260
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
10597
10261
|
*/
|
|
10598
10262
|
destroy() {
|
|
@@ -10603,13 +10267,6 @@ class TsEmbed {
|
|
|
10603
10267
|
console.log('Error destroying TS Embed', e);
|
|
10604
10268
|
}
|
|
10605
10269
|
}
|
|
10606
|
-
getUnderlyingFrameElement() {
|
|
10607
|
-
return this.iFrame;
|
|
10608
|
-
}
|
|
10609
|
-
async prerenderGeneric() {
|
|
10610
|
-
const prerenderFrameSrc = this.getRootIframeSrc();
|
|
10611
|
-
return this.renderIFrame(prerenderFrameSrc);
|
|
10612
|
-
}
|
|
10613
10270
|
}
|
|
10614
10271
|
/**
|
|
10615
10272
|
* Base class for embedding v1 experience
|
|
@@ -10625,21 +10282,14 @@ class V1Embed extends TsEmbed {
|
|
|
10625
10282
|
}
|
|
10626
10283
|
/**
|
|
10627
10284
|
* Render the ap p in an iframe and set up event handlers
|
|
10628
|
-
*
|
|
10629
10285
|
* @param iframeSrc
|
|
10630
10286
|
*/
|
|
10631
10287
|
renderV1Embed(iframeSrc) {
|
|
10632
|
-
return this.renderIFrame(iframeSrc);
|
|
10633
|
-
}
|
|
10634
|
-
getRootIframeSrc() {
|
|
10635
|
-
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
10636
|
-
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10637
|
-
const queryParams = this.getEmbedParams();
|
|
10638
|
-
const queryString = [filterQuery, queryParams].filter(Boolean).join('&');
|
|
10639
|
-
return this.getV1EmbedBasePath(queryString);
|
|
10288
|
+
return this.renderIFrame(iframeSrc, this.viewConfig.frameParams);
|
|
10640
10289
|
}
|
|
10641
10290
|
/**
|
|
10642
|
-
* @inheritdoc
|
|
10291
|
+
* @inheritdoc TsEmbed.on
|
|
10292
|
+
*
|
|
10643
10293
|
* @example
|
|
10644
10294
|
* ```js
|
|
10645
10295
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -10709,7 +10359,6 @@ var Page;
|
|
|
10709
10359
|
})(Page || (Page = {}));
|
|
10710
10360
|
/**
|
|
10711
10361
|
* Embeds full ThoughtSpot experience in a host application.
|
|
10712
|
-
*
|
|
10713
10362
|
* @group Embed components
|
|
10714
10363
|
*/
|
|
10715
10364
|
class AppEmbed extends V1Embed {
|
|
@@ -10722,12 +10371,8 @@ class AppEmbed extends V1Embed {
|
|
|
10722
10371
|
* embedded Liveboard or visualization.
|
|
10723
10372
|
*/
|
|
10724
10373
|
getEmbedParams() {
|
|
10725
|
-
const
|
|
10726
|
-
|
|
10727
|
-
params[Param.EmbedApp] = true;
|
|
10728
|
-
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
10729
|
-
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
10730
|
-
params = this.getBaseQueryParams(params);
|
|
10374
|
+
const params = this.getBaseQueryParams();
|
|
10375
|
+
const { tag, hideObjects, liveboardV2 } = this.viewConfig;
|
|
10731
10376
|
if (tag) {
|
|
10732
10377
|
params[Param.Tag] = tag;
|
|
10733
10378
|
}
|
|
@@ -10737,28 +10382,26 @@ class AppEmbed extends V1Embed {
|
|
|
10737
10382
|
if (liveboardV2 !== undefined) {
|
|
10738
10383
|
params[Param.LiveboardV2Enabled] = liveboardV2;
|
|
10739
10384
|
}
|
|
10740
|
-
if (enableSearchAssist !== undefined) {
|
|
10741
|
-
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
10742
|
-
}
|
|
10743
10385
|
const queryParams = getQueryParamString(params, true);
|
|
10744
10386
|
return queryParams;
|
|
10745
10387
|
}
|
|
10746
10388
|
/**
|
|
10747
10389
|
* Constructs the URL of the ThoughtSpot app page to be rendered.
|
|
10748
|
-
*
|
|
10749
10390
|
* @param pageId The ID of the page to be embedded.
|
|
10750
10391
|
*/
|
|
10751
|
-
getIFrameSrc() {
|
|
10752
|
-
const
|
|
10753
|
-
const
|
|
10754
|
-
|
|
10392
|
+
getIFrameSrc(pageId, runtimeFilters) {
|
|
10393
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10394
|
+
const queryParams = this.getEmbedParams();
|
|
10395
|
+
const queryString = [filterQuery, queryParams]
|
|
10396
|
+
.filter(Boolean)
|
|
10397
|
+
.join('&');
|
|
10398
|
+
let url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true, this.viewConfig.enableSearchAssist)}/${pageId}`;
|
|
10755
10399
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
10756
10400
|
url = `${url}${tsPostHashParams}`;
|
|
10757
10401
|
return url;
|
|
10758
10402
|
}
|
|
10759
10403
|
/**
|
|
10760
10404
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
10761
|
-
*
|
|
10762
10405
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
10763
10406
|
*/
|
|
10764
10407
|
getPageRoute(pageId) {
|
|
@@ -10782,7 +10425,6 @@ class AppEmbed extends V1Embed {
|
|
|
10782
10425
|
}
|
|
10783
10426
|
/**
|
|
10784
10427
|
* Formats the path provided by the user.
|
|
10785
|
-
*
|
|
10786
10428
|
* @param path The URL path.
|
|
10787
10429
|
* @returns The URL path that the embedded app understands.
|
|
10788
10430
|
*/
|
|
@@ -10798,13 +10440,10 @@ class AppEmbed extends V1Embed {
|
|
|
10798
10440
|
}
|
|
10799
10441
|
/**
|
|
10800
10442
|
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
10801
|
-
* This is used for embedding answers, pinboards, visualizations and full application
|
|
10802
|
-
* only.
|
|
10803
|
-
*
|
|
10443
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
10804
10444
|
* @param path string | number The string, set to iframe src and navigate to new page
|
|
10805
10445
|
* eg: appEmbed.navigateToPage('pinboards')
|
|
10806
|
-
* When used with `noReload`
|
|
10807
|
-
* like 1/-1 to go forward/back.
|
|
10446
|
+
* When used with `noReload` this can also be a number like 1/-1 to go forward/back.
|
|
10808
10447
|
* @param noReload boolean Trigger the navigation without reloading the page
|
|
10809
10448
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
10810
10449
|
*/
|
|
@@ -10829,13 +10468,14 @@ class AppEmbed extends V1Embed {
|
|
|
10829
10468
|
}
|
|
10830
10469
|
/**
|
|
10831
10470
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
10832
|
-
*
|
|
10833
10471
|
* @param renderOptions An object containing the page ID
|
|
10834
10472
|
* to be embedded.
|
|
10835
10473
|
*/
|
|
10836
10474
|
render() {
|
|
10837
10475
|
super.render();
|
|
10838
|
-
const
|
|
10476
|
+
const { pageId, runtimeFilters, path } = this.viewConfig;
|
|
10477
|
+
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId);
|
|
10478
|
+
const src = this.getIFrameSrc(pageRoute, runtimeFilters);
|
|
10839
10479
|
this.renderV1Embed(src);
|
|
10840
10480
|
return this;
|
|
10841
10481
|
}
|
|
@@ -10853,7 +10493,6 @@ class AppEmbed extends V1Embed {
|
|
|
10853
10493
|
*/
|
|
10854
10494
|
/**
|
|
10855
10495
|
* Embed a ThoughtSpot Liveboard or visualization
|
|
10856
|
-
*
|
|
10857
10496
|
* @group Embed components
|
|
10858
10497
|
*/
|
|
10859
10498
|
class LiveboardEmbed extends V1Embed {
|
|
@@ -10864,7 +10503,6 @@ class LiveboardEmbed extends V1Embed {
|
|
|
10864
10503
|
/**
|
|
10865
10504
|
* Set the iframe height as per the computed height received
|
|
10866
10505
|
* from the ThoughtSpot app.
|
|
10867
|
-
*
|
|
10868
10506
|
* @param data The event payload
|
|
10869
10507
|
*/
|
|
10870
10508
|
this.updateIFrameHeight = (data) => {
|
|
@@ -10879,23 +10517,16 @@ class LiveboardEmbed extends V1Embed {
|
|
|
10879
10517
|
this.setIFrameHeight(this.defaultHeight);
|
|
10880
10518
|
}
|
|
10881
10519
|
};
|
|
10882
|
-
if (this.viewConfig.fullHeight === true) {
|
|
10883
|
-
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
10884
|
-
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
10885
|
-
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
10886
|
-
}
|
|
10887
10520
|
}
|
|
10888
10521
|
/**
|
|
10889
10522
|
* Construct a map of params to be passed on to the
|
|
10890
10523
|
* embedded Liveboard or visualization.
|
|
10891
10524
|
*/
|
|
10892
10525
|
getEmbedParams() {
|
|
10893
|
-
|
|
10894
|
-
params[Param.EmbedApp] = true;
|
|
10895
|
-
params = this.getBaseQueryParams(params);
|
|
10526
|
+
const params = this.getBaseQueryParams();
|
|
10896
10527
|
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, activeTabId, } = this.viewConfig;
|
|
10897
|
-
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
10898
|
-
|
|
10528
|
+
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
|
|
10529
|
+
this.viewConfig.preventPinboardFilterRemoval;
|
|
10899
10530
|
if (fullHeight === true) {
|
|
10900
10531
|
params[Param.fullHeight] = true;
|
|
10901
10532
|
}
|
|
@@ -10921,68 +10552,65 @@ class LiveboardEmbed extends V1Embed {
|
|
|
10921
10552
|
const queryParams = getQueryParamString(params, true);
|
|
10922
10553
|
return queryParams;
|
|
10923
10554
|
}
|
|
10924
|
-
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
10925
|
-
let suffix = `/embed/viz/${liveboardId}`;
|
|
10926
|
-
if (activeTabId) {
|
|
10927
|
-
suffix = `${suffix}/tab/${activeTabId} `;
|
|
10928
|
-
}
|
|
10929
|
-
if (vizId) {
|
|
10930
|
-
suffix = `${suffix}/${vizId}`;
|
|
10931
|
-
}
|
|
10932
|
-
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
10933
|
-
suffix = `${suffix}${tsPostHashParams}`;
|
|
10934
|
-
return suffix;
|
|
10935
|
-
}
|
|
10936
10555
|
/**
|
|
10937
10556
|
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
10938
10557
|
* to be loaded within the iframe.
|
|
10558
|
+
* @param liveboardId The GUID of the Liveboard.
|
|
10559
|
+
* @param vizId The optional GUID of a visualization within the Liveboard.
|
|
10560
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
10561
|
+
* the Liveboard or visualization on load.
|
|
10939
10562
|
*/
|
|
10940
|
-
getIFrameSrc() {
|
|
10941
|
-
|
|
10942
|
-
const
|
|
10943
|
-
const
|
|
10944
|
-
|
|
10945
|
-
|
|
10563
|
+
getIFrameSrc(liveboardId, vizId, runtimeFilters, activeTabId) {
|
|
10564
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10565
|
+
const queryParams = this.getEmbedParams();
|
|
10566
|
+
const queryString = [filterQuery, queryParams]
|
|
10567
|
+
.filter(Boolean)
|
|
10568
|
+
.join('&');
|
|
10569
|
+
let url = `${this.getV1EmbedBasePath(queryString, true, false, false)}/viz/${liveboardId}`;
|
|
10570
|
+
if (activeTabId) {
|
|
10571
|
+
url = `${url}/tab/${activeTabId}`;
|
|
10946
10572
|
}
|
|
10947
|
-
|
|
10573
|
+
if (vizId) {
|
|
10574
|
+
url = `${url}/${vizId}`;
|
|
10575
|
+
}
|
|
10576
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
10577
|
+
url = `${url}${tsPostHashParams}`;
|
|
10578
|
+
return url;
|
|
10948
10579
|
}
|
|
10949
10580
|
/**
|
|
10950
10581
|
* Triggers an event to the embedded app
|
|
10951
|
-
*
|
|
10952
10582
|
* @param messageType The event type
|
|
10953
10583
|
* @param data The payload to send with the message
|
|
10954
10584
|
*/
|
|
10955
10585
|
trigger(messageType, data = {}) {
|
|
10956
10586
|
const dataWithVizId = data;
|
|
10957
|
-
if (
|
|
10587
|
+
if (this.viewConfig.vizId) {
|
|
10958
10588
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
10959
10589
|
}
|
|
10960
10590
|
return super.trigger(messageType, dataWithVizId);
|
|
10961
10591
|
}
|
|
10962
10592
|
/**
|
|
10963
10593
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
10964
|
-
*
|
|
10965
10594
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
10966
10595
|
* visualization ID and the runtime filters.
|
|
10967
10596
|
*/
|
|
10968
10597
|
render() {
|
|
10598
|
+
var _a;
|
|
10599
|
+
const { vizId, activeTabId, runtimeFilters } = this.viewConfig;
|
|
10600
|
+
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
10601
|
+
if (!liveboardId) {
|
|
10602
|
+
this.handleError(ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION);
|
|
10603
|
+
}
|
|
10604
|
+
if (this.viewConfig.fullHeight === true) {
|
|
10605
|
+
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
10606
|
+
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
10607
|
+
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
10608
|
+
}
|
|
10969
10609
|
super.render();
|
|
10970
|
-
const src = this.getIFrameSrc();
|
|
10610
|
+
const src = this.getIFrameSrc(liveboardId, vizId, runtimeFilters, activeTabId);
|
|
10971
10611
|
this.renderV1Embed(src);
|
|
10972
10612
|
return this;
|
|
10973
10613
|
}
|
|
10974
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
10975
|
-
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
10976
|
-
this.viewConfig.liveboardId = liveboardId;
|
|
10977
|
-
this.viewConfig.activeTabId = activeTabId;
|
|
10978
|
-
this.viewConfig.vizId = vizId;
|
|
10979
|
-
if (this.isAppInitialized) {
|
|
10980
|
-
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
10981
|
-
}
|
|
10982
|
-
else {
|
|
10983
|
-
this.render();
|
|
10984
|
-
}
|
|
10985
|
-
}
|
|
10986
10614
|
}
|
|
10987
10615
|
/**
|
|
10988
10616
|
* @hidden
|
|
@@ -11029,9 +10657,16 @@ class SearchEmbed extends TsEmbed {
|
|
|
11029
10657
|
}
|
|
11030
10658
|
return dataSourceMode;
|
|
11031
10659
|
}
|
|
11032
|
-
|
|
10660
|
+
/**
|
|
10661
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
10662
|
+
* loaded in the iframe
|
|
10663
|
+
* @param answerId The GUID of a saved answer
|
|
10664
|
+
* @param dataSources A list of data source GUIDs
|
|
10665
|
+
*/
|
|
10666
|
+
getIFrameSrc(answerId, dataSources) {
|
|
11033
10667
|
var _a;
|
|
11034
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource,
|
|
10668
|
+
const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, } = this.viewConfig;
|
|
10669
|
+
const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
|
|
11035
10670
|
const queryParams = this.getBaseQueryParams();
|
|
11036
10671
|
queryParams[Param.HideActions] = [
|
|
11037
10672
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -11070,28 +10705,17 @@ class SearchEmbed extends TsEmbed {
|
|
|
11070
10705
|
if (filterQuery) {
|
|
11071
10706
|
query += `&${filterQuery}`;
|
|
11072
10707
|
}
|
|
11073
|
-
return query;
|
|
11074
|
-
}
|
|
11075
|
-
/**
|
|
11076
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
11077
|
-
* loaded in the iframe
|
|
11078
|
-
*
|
|
11079
|
-
* @param answerId The GUID of a saved answer
|
|
11080
|
-
* @param dataSources A list of data source GUIDs
|
|
11081
|
-
*/
|
|
11082
|
-
getIFrameSrc(answerId) {
|
|
11083
|
-
const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
|
|
11084
10708
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11085
|
-
return `${this.
|
|
10709
|
+
return `${this.getEmbedBasePath(query)}/${answerPath}${tsPostHashParams}`;
|
|
11086
10710
|
}
|
|
11087
10711
|
/**
|
|
11088
10712
|
* Render the embedded ThoughtSpot search
|
|
11089
10713
|
*/
|
|
11090
10714
|
render() {
|
|
11091
10715
|
super.render();
|
|
11092
|
-
const { answerId } = this.viewConfig;
|
|
11093
|
-
const src = this.getIFrameSrc(answerId);
|
|
11094
|
-
this.renderIFrame(src);
|
|
10716
|
+
const { answerId, dataSources } = this.viewConfig;
|
|
10717
|
+
const src = this.getIFrameSrc(answerId, dataSources);
|
|
10718
|
+
this.renderIFrame(src, this.viewConfig.frameParams);
|
|
11095
10719
|
getAuthPromise().then(() => {
|
|
11096
10720
|
if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning)) {
|
|
11097
10721
|
alert(ERROR_MESSAGE.SEARCHEMBED_BETA_WRANING_MESSAGE);
|
|
@@ -11115,7 +10739,6 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
11115
10739
|
/**
|
|
11116
10740
|
* Construct the URL of the embedded ThoughtSpot search to be
|
|
11117
10741
|
* loaded in the iframe
|
|
11118
|
-
*
|
|
11119
10742
|
* @param dataSources A list of data source GUIDs
|
|
11120
10743
|
*/
|
|
11121
10744
|
getIFrameSrc() {
|
|
@@ -11123,7 +10746,9 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
11123
10746
|
const { searchOptions, dataSource, dataSources } = this.viewConfig;
|
|
11124
10747
|
const path = 'search-bar-embed';
|
|
11125
10748
|
const queryParams = this.getBaseQueryParams();
|
|
11126
|
-
queryParams[Param.HideActions] = [
|
|
10749
|
+
queryParams[Param.HideActions] = [
|
|
10750
|
+
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
10751
|
+
];
|
|
11127
10752
|
if (dataSources && dataSources.length) {
|
|
11128
10753
|
queryParams[Param.DataSources] = JSON.stringify(dataSources);
|
|
11129
10754
|
}
|
|
@@ -11144,7 +10769,7 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
11144
10769
|
query = `?${queryParamsString}`;
|
|
11145
10770
|
}
|
|
11146
10771
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11147
|
-
return `${this.getEmbedBasePath(query)}
|
|
10772
|
+
return `${this.getEmbedBasePath(query)}/${path}${tsPostHashParams}`;
|
|
11148
10773
|
}
|
|
11149
10774
|
/**
|
|
11150
10775
|
* Render the embedded ThoughtSpot search
|
|
@@ -11152,7 +10777,7 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
11152
10777
|
render() {
|
|
11153
10778
|
super.render();
|
|
11154
10779
|
const src = this.getIFrameSrc();
|
|
11155
|
-
this.renderIFrame(src);
|
|
10780
|
+
this.renderIFrame(src, this.viewConfig.frameParams);
|
|
11156
10781
|
return this;
|
|
11157
10782
|
}
|
|
11158
10783
|
}
|