@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.js
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* Refer to the following docs for more details on runtime filter syntax:
|
|
18
18
|
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/apply-runtime-filter.html
|
|
19
19
|
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/runtime-filter-operators.html
|
|
20
|
-
*
|
|
21
20
|
* @param runtimeFilters
|
|
22
21
|
*/
|
|
23
22
|
const getFilterQuery = (runtimeFilters) => {
|
|
@@ -37,12 +36,13 @@
|
|
|
37
36
|
/**
|
|
38
37
|
* Convert a value to a string representation to be sent as a query
|
|
39
38
|
* parameter to the ThoughtSpot app.
|
|
40
|
-
*
|
|
41
39
|
* @param value Any parameter value
|
|
42
40
|
*/
|
|
43
41
|
const serializeParam = (value) => {
|
|
44
42
|
// do not serialize primitive types
|
|
45
|
-
if (typeof value === 'string' ||
|
|
43
|
+
if (typeof value === 'string' ||
|
|
44
|
+
typeof value === 'number' ||
|
|
45
|
+
typeof value === 'boolean') {
|
|
46
46
|
return value;
|
|
47
47
|
}
|
|
48
48
|
return JSON.stringify(value);
|
|
@@ -51,15 +51,12 @@
|
|
|
51
51
|
* Convert a value to a string:
|
|
52
52
|
* in case of an array, we convert it to CSV.
|
|
53
53
|
* in case of any other type, we directly return the value.
|
|
54
|
-
*
|
|
55
54
|
* @param value
|
|
56
55
|
*/
|
|
57
|
-
const paramToString = (value) =>
|
|
56
|
+
const paramToString = (value) => Array.isArray(value) ? value.join(',') : value;
|
|
58
57
|
/**
|
|
59
58
|
* Return a query param string composed from the given params object
|
|
60
|
-
*
|
|
61
59
|
* @param queryParams
|
|
62
|
-
* @param shouldSerializeParamValues
|
|
63
60
|
*/
|
|
64
61
|
const getQueryParamString = (queryParams, shouldSerializeParamValues = false) => {
|
|
65
62
|
const qp = [];
|
|
@@ -81,7 +78,6 @@
|
|
|
81
78
|
/**
|
|
82
79
|
* Get a string representation of a dimension value in CSS
|
|
83
80
|
* If numeric, it is considered in pixels.
|
|
84
|
-
*
|
|
85
81
|
* @param value
|
|
86
82
|
*/
|
|
87
83
|
const getCssDimension = (value) => {
|
|
@@ -92,7 +88,6 @@
|
|
|
92
88
|
};
|
|
93
89
|
/**
|
|
94
90
|
* Append a string to a URL's hash fragment
|
|
95
|
-
*
|
|
96
91
|
* @param url A URL
|
|
97
92
|
* @param stringToAppend The string to append to the URL hash
|
|
98
93
|
*/
|
|
@@ -107,12 +102,6 @@
|
|
|
107
102
|
}
|
|
108
103
|
return outputUrl;
|
|
109
104
|
};
|
|
110
|
-
/**
|
|
111
|
-
*
|
|
112
|
-
* @param url
|
|
113
|
-
* @param stringToAppend
|
|
114
|
-
* @param path
|
|
115
|
-
*/
|
|
116
105
|
function getRedirectUrl(url, stringToAppend, path = '') {
|
|
117
106
|
const targetUrl = path ? new URL(path, window.location.origin).href : url;
|
|
118
107
|
return appendToUrlHash(targetUrl, stringToAppend);
|
|
@@ -121,7 +110,10 @@
|
|
|
121
110
|
if (!queryString) {
|
|
122
111
|
return queryString;
|
|
123
112
|
}
|
|
124
|
-
return btoa(queryString)
|
|
113
|
+
return btoa(queryString)
|
|
114
|
+
.replace(/\+/g, '-')
|
|
115
|
+
.replace(/\//g, '_')
|
|
116
|
+
.replace(/=+$/, '');
|
|
125
117
|
};
|
|
126
118
|
const getOffsetTop = (element) => {
|
|
127
119
|
const rect = element.getBoundingClientRect();
|
|
@@ -151,8 +143,8 @@
|
|
|
151
143
|
var _a, _b, _c, _d;
|
|
152
144
|
const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
|
|
153
145
|
const customizationsFromViewConfig = viewConfig.customizations;
|
|
154
|
-
const customizationsFromEmbedConfig = embedConfig.customizations
|
|
155
|
-
|
|
146
|
+
const customizationsFromEmbedConfig = embedConfig.customizations ||
|
|
147
|
+
embedConfig.customisations;
|
|
156
148
|
const customizations = {
|
|
157
149
|
style: {
|
|
158
150
|
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
|
|
@@ -161,9 +153,9 @@
|
|
|
161
153
|
...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
|
|
162
154
|
...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
|
|
163
155
|
},
|
|
164
|
-
customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
|
|
165
|
-
|
|
166
|
-
|
|
156
|
+
customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) ||
|
|
157
|
+
((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl) ||
|
|
158
|
+
customCssUrlFromEmbedConfig,
|
|
167
159
|
},
|
|
168
160
|
content: {
|
|
169
161
|
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
|
|
@@ -175,11 +167,12 @@
|
|
|
175
167
|
/**
|
|
176
168
|
* Gets a reference to the DOM node given
|
|
177
169
|
* a selector.
|
|
178
|
-
*
|
|
179
170
|
* @param domSelector
|
|
180
171
|
*/
|
|
181
172
|
function getDOMNode(domSelector) {
|
|
182
|
-
return typeof domSelector === 'string'
|
|
173
|
+
return typeof domSelector === 'string'
|
|
174
|
+
? document.querySelector(domSelector)
|
|
175
|
+
: domSelector;
|
|
183
176
|
}
|
|
184
177
|
|
|
185
178
|
/**
|
|
@@ -192,28 +185,23 @@
|
|
|
192
185
|
*/
|
|
193
186
|
(function (AuthType) {
|
|
194
187
|
/**
|
|
195
|
-
* No authentication on the SDK. Passthrough to the embedded App. Alias for
|
|
196
|
-
* `Passthrough`.
|
|
188
|
+
* No authentication on the SDK. Passthrough to the embedded App. Alias for `Passthrough`.
|
|
197
189
|
*/
|
|
198
190
|
AuthType["None"] = "None";
|
|
199
191
|
/**
|
|
200
|
-
* Passthrough SSO to the embedded App within the iframe. Requires least
|
|
201
|
-
*
|
|
202
|
-
* if SSO is not configured on ThoughtSpot.
|
|
203
|
-
*
|
|
192
|
+
* Passthrough SSO to the embedded App within the iframe. Requires least configuration, but may not
|
|
193
|
+
* be supported by all IDPs. This will behave like `None` if SSO is not configured on ThoughtSpot.
|
|
204
194
|
* @version: SDK: 1.15.0 | ThouhgtSpot: 8.8.0.cl
|
|
205
195
|
*/
|
|
206
196
|
AuthType["EmbeddedSSO"] = "EmbeddedSSO";
|
|
207
197
|
/**
|
|
208
198
|
* SSO using SAML
|
|
209
|
-
*
|
|
210
199
|
* @deprecated Use {@link SAMLRedirect} instead
|
|
211
200
|
* @hidden
|
|
212
201
|
*/
|
|
213
202
|
AuthType["SSO"] = "SSO_SAML";
|
|
214
203
|
/**
|
|
215
204
|
* SSO using SAML
|
|
216
|
-
*
|
|
217
205
|
* @deprecated Use {@link SAMLRedirect} instead
|
|
218
206
|
* @hidden
|
|
219
207
|
*/
|
|
@@ -221,7 +209,6 @@
|
|
|
221
209
|
/**
|
|
222
210
|
* SSO using SAML
|
|
223
211
|
* Will make the host application redirect to the SAML Idp.
|
|
224
|
-
*
|
|
225
212
|
* @example
|
|
226
213
|
* ```js
|
|
227
214
|
* init({
|
|
@@ -235,7 +222,6 @@
|
|
|
235
222
|
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
236
223
|
/**
|
|
237
224
|
* SSO using OIDC
|
|
238
|
-
*
|
|
239
225
|
* @hidden
|
|
240
226
|
* @deprecated Use {@link OIDCRedirect} instead
|
|
241
227
|
*/
|
|
@@ -247,15 +233,14 @@
|
|
|
247
233
|
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
248
234
|
/**
|
|
249
235
|
* Trusted authentication server
|
|
250
|
-
*
|
|
251
236
|
* @hidden
|
|
252
237
|
* @deprecated Use {@link TrustedAuth} instead
|
|
253
238
|
*/
|
|
254
239
|
AuthType["AuthServer"] = "AuthServer";
|
|
255
240
|
/**
|
|
256
241
|
* Trusted authentication server, Use your own authentication server
|
|
257
|
-
* which returns a bearer token, generated using the secret_key obtained
|
|
258
|
-
*
|
|
242
|
+
* which returns a bearer token, generated using the secret_key obtained from
|
|
243
|
+
* ThoughtSpot.
|
|
259
244
|
*
|
|
260
245
|
* @example
|
|
261
246
|
* ```js
|
|
@@ -271,11 +256,10 @@
|
|
|
271
256
|
*/
|
|
272
257
|
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
273
258
|
/**
|
|
274
|
-
* Trusted authentication server Cookieless, Use you own authentication
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
* implemented by some browsers
|
|
259
|
+
* Trusted authentication server Cookieless, Use you own authentication server
|
|
260
|
+
* which returns a bearer token, generated using the secret_key obtained from
|
|
261
|
+
* ThoughtSpot. This uses a cookieless authentication approach, recommended
|
|
262
|
+
* to by pass third-party cookie-blocking restriction implemented by some browsers
|
|
279
263
|
*/
|
|
280
264
|
AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
|
|
281
265
|
/**
|
|
@@ -347,31 +331,26 @@
|
|
|
347
331
|
(function (EmbedEvent) {
|
|
348
332
|
/**
|
|
349
333
|
* Rendering has initialized.
|
|
350
|
-
*
|
|
351
|
-
* @returns timestamp - The timestamp when the event was generated.
|
|
334
|
+
* @return timestamp - The timestamp when the event was generated.
|
|
352
335
|
*/
|
|
353
336
|
EmbedEvent["Init"] = "init";
|
|
354
337
|
/**
|
|
355
338
|
* Authentication has either succeeded or failed.
|
|
356
|
-
*
|
|
357
|
-
* @returns isLoggedIn - A Boolean specifying whether authentication was successful.
|
|
339
|
+
* @return isLoggedIn - A Boolean specifying whether authentication was successful.
|
|
358
340
|
*/
|
|
359
341
|
EmbedEvent["AuthInit"] = "authInit";
|
|
360
342
|
/**
|
|
361
343
|
* The embed object container has loaded.
|
|
362
|
-
*
|
|
363
|
-
* @returns timestamp - The timestamp when the event was generated.
|
|
344
|
+
* @return timestamp - The timestamp when the event was generated.
|
|
364
345
|
*/
|
|
365
346
|
EmbedEvent["Load"] = "load";
|
|
366
347
|
/**
|
|
367
348
|
* Data pertaining to answer or Liveboard is received
|
|
368
|
-
*
|
|
369
|
-
* @returns data - The answer or Liveboard data
|
|
349
|
+
* @return data - The answer or Liveboard data
|
|
370
350
|
*/
|
|
371
351
|
EmbedEvent["Data"] = "data";
|
|
372
352
|
/**
|
|
373
353
|
* Search/answer/Liveboard filters have been applied/updated
|
|
374
|
-
*
|
|
375
354
|
* @hidden
|
|
376
355
|
*/
|
|
377
356
|
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
@@ -381,56 +360,48 @@
|
|
|
381
360
|
EmbedEvent["QueryChanged"] = "queryChanged";
|
|
382
361
|
/**
|
|
383
362
|
* A drill down operation has been performed.
|
|
384
|
-
*
|
|
385
|
-
* @
|
|
386
|
-
* @
|
|
387
|
-
* @returns nonFilteredColumns - The columns that were not filtered
|
|
363
|
+
* @return additionalFilters - Any additional filters applied
|
|
364
|
+
* @return drillDownColumns - The columns on which drill down was performed
|
|
365
|
+
* @return nonFilteredColumns - The columns that were not filtered
|
|
388
366
|
*/
|
|
389
367
|
EmbedEvent["Drilldown"] = "drillDown";
|
|
390
368
|
/**
|
|
391
369
|
* One or more data sources have been selected.
|
|
392
|
-
*
|
|
393
|
-
* @returns dataSourceIds - the list of data sources
|
|
370
|
+
* @return dataSourceIds - the list of data sources
|
|
394
371
|
*/
|
|
395
372
|
EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
|
|
396
373
|
/**
|
|
397
374
|
* One or more data columns have been selected.
|
|
398
|
-
*
|
|
399
|
-
* @returns columnIds - the list of columns
|
|
375
|
+
* @return columnIds - the list of columns
|
|
400
376
|
* @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
401
377
|
*/
|
|
402
378
|
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
|
|
403
379
|
/**
|
|
404
380
|
* A custom action has been triggered
|
|
405
|
-
*
|
|
406
|
-
* @
|
|
407
|
-
* @returns data - The answer or Liveboard data
|
|
381
|
+
* @return actionId - The id of the custom action
|
|
382
|
+
* @return data - The answer or Liveboard data
|
|
408
383
|
*/
|
|
409
384
|
EmbedEvent["CustomAction"] = "customAction";
|
|
410
385
|
/**
|
|
411
386
|
* A double click has been triggered on table/chart
|
|
412
|
-
*
|
|
413
|
-
* @returns ContextMenuInputPoints - data point that is double clicked
|
|
387
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
414
388
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
415
389
|
*/
|
|
416
390
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
417
391
|
/**
|
|
418
392
|
* A click has been triggered on table/chart
|
|
419
|
-
*
|
|
420
|
-
* @returns ContextMenuInputPoints - data point that is clicked
|
|
393
|
+
* @return ContextMenuInputPoints - data point that is clicked
|
|
421
394
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
422
395
|
*/
|
|
423
396
|
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
424
397
|
/**
|
|
425
398
|
* An error has occurred.
|
|
426
|
-
*
|
|
427
|
-
* @returns error - An error object or message
|
|
399
|
+
* @return error - An error object or message
|
|
428
400
|
*/
|
|
429
401
|
EmbedEvent["Error"] = "Error";
|
|
430
402
|
/**
|
|
431
403
|
* The embedded object has sent an alert
|
|
432
|
-
*
|
|
433
|
-
* @returns alert - An alert object
|
|
404
|
+
* @return alert - An alert object
|
|
434
405
|
*/
|
|
435
406
|
EmbedEvent["Alert"] = "alert";
|
|
436
407
|
/**
|
|
@@ -439,34 +410,29 @@
|
|
|
439
410
|
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
440
411
|
/**
|
|
441
412
|
* ThoughtSpot failed to validate the auth session.
|
|
442
|
-
*
|
|
443
413
|
* @hidden
|
|
444
414
|
*/
|
|
445
415
|
EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
|
|
446
416
|
/**
|
|
447
417
|
* ThoughtSpot failed to validate the auth session.
|
|
448
|
-
*
|
|
449
418
|
* @hidden
|
|
450
419
|
*/
|
|
451
420
|
EmbedEvent["AuthLogout"] = "ThoughtspotAuthLogout";
|
|
452
421
|
/**
|
|
453
422
|
* The height of the embedded Liveboard or visualization has been computed.
|
|
454
|
-
*
|
|
455
|
-
* @returns data - The height of the embedded Liveboard or visualization
|
|
423
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
456
424
|
* @hidden
|
|
457
425
|
*/
|
|
458
426
|
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
459
427
|
/**
|
|
460
428
|
* The center of visible iframe viewport is calculated.
|
|
461
|
-
*
|
|
462
|
-
* @returns data - The center of the visible Iframe viewport.
|
|
429
|
+
* @return data - The center of the visible Iframe viewport.
|
|
463
430
|
* @hidden
|
|
464
431
|
*/
|
|
465
432
|
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
466
433
|
/**
|
|
467
434
|
* Emitted when the "Get Data" button in Search Bar embed
|
|
468
435
|
* is clicked.
|
|
469
|
-
*
|
|
470
436
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.0-sw
|
|
471
437
|
*/
|
|
472
438
|
EmbedEvent["GetDataClick"] = "getDataClick";
|
|
@@ -476,7 +442,6 @@
|
|
|
476
442
|
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
477
443
|
/**
|
|
478
444
|
* The v1 event type for Data
|
|
479
|
-
*
|
|
480
445
|
* @hidden
|
|
481
446
|
*/
|
|
482
447
|
EmbedEvent["V1Data"] = "exportVizDataToParent";
|
|
@@ -489,20 +454,17 @@
|
|
|
489
454
|
EmbedEvent["NoCookieAccess"] = "noCookieAccess";
|
|
490
455
|
/**
|
|
491
456
|
* Emitted when SAML is complete
|
|
492
|
-
*
|
|
493
457
|
* @private
|
|
494
458
|
* @hidden
|
|
495
459
|
*/
|
|
496
460
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
497
461
|
/**
|
|
498
462
|
* Emitted when any modal is opened in the app
|
|
499
|
-
*
|
|
500
463
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
501
464
|
*/
|
|
502
465
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
503
466
|
/**
|
|
504
467
|
* Emitted when any modal is closed in the app
|
|
505
|
-
*
|
|
506
468
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
507
469
|
*/
|
|
508
470
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
@@ -510,228 +472,184 @@
|
|
|
510
472
|
* Emitted when the Liveboard shell loads.
|
|
511
473
|
* You can use this event as a hook to trigger
|
|
512
474
|
* other events on the rendered Liveboard.
|
|
513
|
-
*
|
|
514
475
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
515
476
|
*/
|
|
516
477
|
EmbedEvent["LiveboardRendered"] = "PinboardRendered";
|
|
517
478
|
/**
|
|
518
479
|
* This can be used to register an event listener which
|
|
519
480
|
* is triggered on all events.
|
|
520
|
-
*
|
|
521
481
|
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
522
482
|
*/
|
|
523
483
|
EmbedEvent["ALL"] = "*";
|
|
524
484
|
/**
|
|
525
485
|
* Emitted when answer is saved in the app
|
|
526
|
-
*
|
|
527
486
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
528
487
|
*/
|
|
529
488
|
EmbedEvent["Save"] = "save";
|
|
530
489
|
/**
|
|
531
490
|
* Emitted when the download action is triggered on an answer
|
|
532
|
-
*
|
|
533
491
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
534
492
|
*/
|
|
535
493
|
EmbedEvent["Download"] = "download";
|
|
536
494
|
/**
|
|
537
495
|
* Emitted when the Download as PDF action is triggered on an answer
|
|
538
|
-
*
|
|
539
496
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
540
497
|
*/
|
|
541
498
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
542
499
|
/**
|
|
543
500
|
* Emitted when the Download as CSV action is triggered on an answer
|
|
544
|
-
*
|
|
545
501
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
546
502
|
*/
|
|
547
503
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
548
504
|
/**
|
|
549
505
|
* Emitted when the Download as XLSX action is triggered on an answer
|
|
550
|
-
*
|
|
551
506
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
552
507
|
*/
|
|
553
508
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
554
509
|
/**
|
|
555
510
|
* Emitted when an answer is deleted in the app
|
|
556
|
-
*
|
|
557
511
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
558
512
|
*/
|
|
559
513
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
560
514
|
/**
|
|
561
515
|
* Emitted when an answer is pinned to a Liveboard
|
|
562
|
-
*
|
|
563
516
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
564
517
|
*/
|
|
565
518
|
EmbedEvent["Pin"] = "pin";
|
|
566
519
|
/**
|
|
567
520
|
* Emitted when SpotIQ analysis is triggered
|
|
568
|
-
*
|
|
569
521
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
570
522
|
*/
|
|
571
523
|
EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
572
524
|
/**
|
|
573
525
|
* Emitted when a user shares an object with another user or group
|
|
574
|
-
*
|
|
575
526
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
576
527
|
*/
|
|
577
528
|
EmbedEvent["Share"] = "share";
|
|
578
529
|
/**
|
|
579
|
-
* Emitted when a user clicks the Include action to include a specific value or data
|
|
580
|
-
* on a chart or table
|
|
581
|
-
*
|
|
530
|
+
* Emitted when a user clicks the Include action to include a specific value or data on a chart or table
|
|
582
531
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
583
532
|
*/
|
|
584
533
|
EmbedEvent["DrillInclude"] = "context-menu-item-include";
|
|
585
534
|
/**
|
|
586
|
-
* Emitted when a user clicks the Exclude action to exclude a specific value or data
|
|
587
|
-
* on a chart or table
|
|
588
|
-
*
|
|
535
|
+
* Emitted when a user clicks the Exclude action to exclude a specific value or data on a chart or table
|
|
589
536
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
590
537
|
*/
|
|
591
538
|
EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
|
|
592
539
|
/**
|
|
593
540
|
* Emitted when copied column value on the app
|
|
594
|
-
*
|
|
595
541
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
596
542
|
*/
|
|
597
543
|
EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
|
|
598
544
|
/**
|
|
599
545
|
* Emitted when a user clicks the Update TML action
|
|
600
|
-
*
|
|
601
546
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
602
547
|
*/
|
|
603
548
|
EmbedEvent["UpdateTML"] = "updateTSL";
|
|
604
549
|
/**
|
|
605
550
|
* Emitted when a user clicks the Edit TML action
|
|
606
|
-
*
|
|
607
551
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
608
552
|
*/
|
|
609
553
|
EmbedEvent["EditTML"] = "editTSL";
|
|
610
554
|
/**
|
|
611
555
|
* Emitted when ExportTML trigger in answer on the app
|
|
612
|
-
*
|
|
613
556
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
614
557
|
*/
|
|
615
558
|
EmbedEvent["ExportTML"] = "exportTSL";
|
|
616
559
|
/**
|
|
617
560
|
* Emitted when an answer is saved as a view
|
|
618
|
-
*
|
|
619
561
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
620
562
|
*/
|
|
621
563
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
622
564
|
/**
|
|
623
565
|
* Emitted when copy of existing answer on the app
|
|
624
|
-
*
|
|
625
566
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
626
567
|
*/
|
|
627
568
|
EmbedEvent["CopyAEdit"] = "copyAEdit";
|
|
628
569
|
/**
|
|
629
570
|
* Emitted when a user clicks Show underlying data on an answe
|
|
630
|
-
*
|
|
631
571
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
632
572
|
*/
|
|
633
573
|
EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
634
574
|
/**
|
|
635
575
|
* Emitted when an answer is switched to a chart or table view
|
|
636
|
-
*
|
|
637
576
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
638
577
|
*/
|
|
639
578
|
EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
640
579
|
/**
|
|
641
580
|
* Internal event to communicate the initial settings back to the TS APP
|
|
642
|
-
*
|
|
643
581
|
* @hidden
|
|
644
582
|
*/
|
|
645
583
|
EmbedEvent["APP_INIT"] = "appInit";
|
|
646
584
|
/**
|
|
647
585
|
* Emitted when a user clicks Show Liveboard details on a Liveboard
|
|
648
|
-
*
|
|
649
586
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
650
587
|
*/
|
|
651
588
|
EmbedEvent["LiveboardInfo"] = "pinboardInfo";
|
|
652
589
|
/**
|
|
653
590
|
* Emitted when a user clicks on the Favorite icon on a Liveboard
|
|
654
|
-
*
|
|
655
591
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
656
592
|
*/
|
|
657
593
|
EmbedEvent["AddToFavorites"] = "addToFavorites";
|
|
658
594
|
/**
|
|
659
595
|
* Emitted when a user clicks Schedule on a Liveboard
|
|
660
|
-
*
|
|
661
596
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
662
597
|
*/
|
|
663
598
|
EmbedEvent["Schedule"] = "subscription";
|
|
664
599
|
/**
|
|
665
600
|
* Emitted when a user clicks Edit on a Liveboard or visualization
|
|
666
|
-
*
|
|
667
601
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
668
602
|
*/
|
|
669
603
|
EmbedEvent["Edit"] = "edit";
|
|
670
604
|
/**
|
|
671
605
|
* Emitted when a user clicks Make a copy on a Liveboard
|
|
672
|
-
*
|
|
673
606
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
674
607
|
*/
|
|
675
608
|
EmbedEvent["MakeACopy"] = "makeACopy";
|
|
676
609
|
/**
|
|
677
610
|
* Emitted when a user clicks Present on a Liveboard or visualization
|
|
678
|
-
*
|
|
679
611
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
680
612
|
*/
|
|
681
613
|
EmbedEvent["Present"] = "present";
|
|
682
614
|
/**
|
|
683
615
|
* Emitted when a user clicks Delete on a Liveboard
|
|
684
|
-
*
|
|
685
616
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
686
617
|
*/
|
|
687
618
|
EmbedEvent["Delete"] = "delete";
|
|
688
619
|
/**
|
|
689
620
|
* Emitted when a user clicks Manage schedules on a Liveboard
|
|
690
|
-
*
|
|
691
621
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
692
622
|
*/
|
|
693
623
|
EmbedEvent["SchedulesList"] = "schedule-list";
|
|
694
624
|
/**
|
|
695
625
|
* Emitted when a user clicks Cancel in edit mode on a Liveboard
|
|
696
|
-
*
|
|
697
626
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
698
627
|
*/
|
|
699
628
|
EmbedEvent["Cancel"] = "cancel";
|
|
700
629
|
/**
|
|
701
630
|
* Emitted when a user clicks Explore on a visualization
|
|
702
|
-
*
|
|
703
631
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
704
632
|
*/
|
|
705
633
|
EmbedEvent["Explore"] = "explore";
|
|
706
634
|
/**
|
|
707
635
|
* Emitted when a user clicks Copy link action on a visualization
|
|
708
|
-
*
|
|
709
636
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
710
637
|
*/
|
|
711
638
|
EmbedEvent["CopyLink"] = "embedDocument";
|
|
712
639
|
/**
|
|
713
640
|
* Emitted when a user interacts with cross filters on a visualization or liveboard
|
|
714
|
-
*
|
|
715
641
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
716
642
|
*/
|
|
717
643
|
EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
|
|
718
644
|
/**
|
|
719
645
|
* Emitted when a user right clicks on chart or table
|
|
720
|
-
*
|
|
721
646
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
722
647
|
*/
|
|
723
648
|
EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
|
|
724
|
-
/**
|
|
725
|
-
* Emitted when a user clicks on Insert to slide on a visualization
|
|
726
|
-
*
|
|
727
|
-
* @hidden
|
|
728
|
-
*/
|
|
729
|
-
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
730
649
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
731
650
|
(function (HostEvent) {
|
|
732
651
|
/**
|
|
733
652
|
* Trigger a search
|
|
734
|
-
*
|
|
735
653
|
* @param - dataSourceIds - The data source GUID to Search on
|
|
736
654
|
* - Although an array, only a single source
|
|
737
655
|
* is supported at this time.
|
|
@@ -749,12 +667,10 @@
|
|
|
749
667
|
HostEvent["Search"] = "search";
|
|
750
668
|
/**
|
|
751
669
|
* Trigger a drill on certain points by certain column
|
|
752
|
-
*
|
|
753
670
|
* @param - points - an object containing selectedPoints/clickedPoints
|
|
754
671
|
* eg. { selectedPoints: []}
|
|
755
672
|
* @param - columnGuid - a string guid of the column to drill by. This is optional,
|
|
756
|
-
* if not provided it will auto drill by the configured
|
|
757
|
-
* column.
|
|
673
|
+
* if not provided it will auto drill by the configured column.
|
|
758
674
|
* @example
|
|
759
675
|
* ```js
|
|
760
676
|
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
@@ -762,50 +678,44 @@
|
|
|
762
678
|
* autoDrillDown: true,
|
|
763
679
|
* })
|
|
764
680
|
* ```
|
|
681
|
+
*
|
|
765
682
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
766
683
|
*/
|
|
767
684
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
768
685
|
/**
|
|
769
686
|
* Apply filters
|
|
770
|
-
*
|
|
771
687
|
* @hidden
|
|
772
688
|
*/
|
|
773
689
|
HostEvent["Filter"] = "filter";
|
|
774
690
|
/**
|
|
775
691
|
* Reload the answer or visualization
|
|
776
|
-
*
|
|
777
692
|
* @hidden
|
|
778
693
|
*/
|
|
779
694
|
HostEvent["Reload"] = "reload";
|
|
780
695
|
/**
|
|
781
696
|
* Set the visible visualizations on a Liveboard.
|
|
782
|
-
*
|
|
783
697
|
* @param - an array of ids of visualizations to show, the ids not passed
|
|
784
698
|
* will be hidden.
|
|
785
699
|
* @example
|
|
786
|
-
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
787
|
-
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
788
|
-
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
700
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, ['730496d6-6903-4601-937e-2c691821af3c', 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
789
701
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
790
702
|
*/
|
|
791
703
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
792
704
|
/**
|
|
793
705
|
* Update the runtime filters. The runtime filters passed here are extended
|
|
794
706
|
* on to the existing runtime filters if they exist.
|
|
795
|
-
*
|
|
796
707
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
797
708
|
* @example
|
|
798
709
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
799
710
|
* {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
|
|
800
|
-
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values:
|
|
801
|
-
*
|
|
711
|
+
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
712
|
+
* ])
|
|
802
713
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
803
714
|
*/
|
|
804
715
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
805
716
|
/**
|
|
806
717
|
* Navigate to a specific page in App embed without any reload.
|
|
807
718
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
808
|
-
*
|
|
809
719
|
* @param - path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
810
720
|
* @example
|
|
811
721
|
* ```js
|
|
@@ -817,22 +727,16 @@
|
|
|
817
727
|
/**
|
|
818
728
|
* Opens the filter panel for a particular column.
|
|
819
729
|
* Works with Search embed.
|
|
820
|
-
*
|
|
821
|
-
* @param - { columnId: string,
|
|
822
|
-
* name: string,
|
|
823
|
-
* type: INT64/CHAR/DATE,
|
|
824
|
-
* dataType: ATTRIBUTE/MEASURE }
|
|
730
|
+
* @param - { columnId: string, name: string, type: INT64/CHAR/DATE, dataType: ATTRIBUTE/MEASURE }
|
|
825
731
|
* @example
|
|
826
732
|
* ```js
|
|
827
|
-
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
828
|
-
* { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
733
|
+
* searchEmbed.trigger(HostEvent.OpenFilter, { columnId: '123', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE' })
|
|
829
734
|
* ```
|
|
830
735
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
831
736
|
*/
|
|
832
737
|
HostEvent["OpenFilter"] = "openFilter";
|
|
833
738
|
/**
|
|
834
739
|
* Adds the columns to the current Search.
|
|
835
|
-
*
|
|
836
740
|
* @param - { columnIds: string[] }
|
|
837
741
|
* @example
|
|
838
742
|
* ```js
|
|
@@ -843,7 +747,6 @@
|
|
|
843
747
|
HostEvent["AddColumns"] = "addColumns";
|
|
844
748
|
/**
|
|
845
749
|
* Removes a column from the current Search.
|
|
846
|
-
*
|
|
847
750
|
* @param - { columnId: string }
|
|
848
751
|
* @example
|
|
849
752
|
* ```js
|
|
@@ -854,7 +757,6 @@
|
|
|
854
757
|
HostEvent["RemoveColumn"] = "removeColumn";
|
|
855
758
|
/**
|
|
856
759
|
* Gets the current pinboard content.
|
|
857
|
-
*
|
|
858
760
|
* @example
|
|
859
761
|
* ```js
|
|
860
762
|
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard)
|
|
@@ -864,7 +766,6 @@
|
|
|
864
766
|
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
865
767
|
/**
|
|
866
768
|
* Triggers the Pin action on an embedded object
|
|
867
|
-
*
|
|
868
769
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
869
770
|
* can be left empty for search and visualization embeds
|
|
870
771
|
* @example
|
|
@@ -878,7 +779,6 @@
|
|
|
878
779
|
HostEvent["Pin"] = "pin";
|
|
879
780
|
/**
|
|
880
781
|
* Triggers the Show Liveboard details action on a Liveboard
|
|
881
|
-
*
|
|
882
782
|
* @example
|
|
883
783
|
* ```js
|
|
884
784
|
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
@@ -888,7 +788,6 @@
|
|
|
888
788
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
889
789
|
/**
|
|
890
790
|
* Triggers the Schedule action on a Liveboard
|
|
891
|
-
*
|
|
892
791
|
* @example
|
|
893
792
|
* ```js
|
|
894
793
|
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
@@ -898,7 +797,6 @@
|
|
|
898
797
|
HostEvent["Schedule"] = "subscription";
|
|
899
798
|
/**
|
|
900
799
|
* Triggers the Manage schedule action on a Liveboard
|
|
901
|
-
*
|
|
902
800
|
* @example
|
|
903
801
|
* ```js
|
|
904
802
|
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
@@ -908,7 +806,6 @@
|
|
|
908
806
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
909
807
|
/**
|
|
910
808
|
* Triggers the Export TML action on a Liveboard
|
|
911
|
-
*
|
|
912
809
|
* @example
|
|
913
810
|
* ```js
|
|
914
811
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
@@ -918,7 +815,6 @@
|
|
|
918
815
|
HostEvent["ExportTML"] = "exportTSL";
|
|
919
816
|
/**
|
|
920
817
|
* Triggers the Edit TML action on a Liveboard
|
|
921
|
-
*
|
|
922
818
|
* @example
|
|
923
819
|
* ```js
|
|
924
820
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -928,7 +824,6 @@
|
|
|
928
824
|
HostEvent["EditTML"] = "editTSL";
|
|
929
825
|
/**
|
|
930
826
|
* Triggers the Update TML action on a Liveboard
|
|
931
|
-
*
|
|
932
827
|
* @example
|
|
933
828
|
* ```js
|
|
934
829
|
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
@@ -938,7 +833,6 @@
|
|
|
938
833
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
939
834
|
/**
|
|
940
835
|
* Triggers the Download PDF action on a Liveboard
|
|
941
|
-
*
|
|
942
836
|
* @example
|
|
943
837
|
* ```js
|
|
944
838
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPDF)
|
|
@@ -948,7 +842,6 @@
|
|
|
948
842
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
949
843
|
/**
|
|
950
844
|
* Triggers the Make a copy action on a Liveboard, search or visualization
|
|
951
|
-
*
|
|
952
845
|
* @example
|
|
953
846
|
* ```js
|
|
954
847
|
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
@@ -960,7 +853,6 @@
|
|
|
960
853
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
961
854
|
/**
|
|
962
855
|
* Triggers the Delete action on a Liveboard
|
|
963
|
-
*
|
|
964
856
|
* @example
|
|
965
857
|
* ```js
|
|
966
858
|
* appEmbed.trigger(HostEvent.Remove)
|
|
@@ -970,7 +862,6 @@
|
|
|
970
862
|
HostEvent["Remove"] = "delete";
|
|
971
863
|
/**
|
|
972
864
|
* Triggers the Explore action on a visualization
|
|
973
|
-
*
|
|
974
865
|
* @param - an object with vizId as a key
|
|
975
866
|
* @example
|
|
976
867
|
* ```js
|
|
@@ -981,48 +872,37 @@
|
|
|
981
872
|
HostEvent["Explore"] = "explore";
|
|
982
873
|
/**
|
|
983
874
|
* Triggers the Create alert action on a visualization
|
|
984
|
-
*
|
|
985
875
|
* @param - an object with vizId as a key
|
|
986
876
|
* @example
|
|
987
877
|
* ```js
|
|
988
|
-
* liveboardEmbed.trigger(HostEvent.CreateMonitor {
|
|
989
|
-
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
990
|
-
* })
|
|
878
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
991
879
|
* ```
|
|
992
880
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
993
881
|
*/
|
|
994
882
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
995
883
|
/**
|
|
996
884
|
* Triggers the Manage alert action on a visualization
|
|
997
|
-
*
|
|
998
885
|
* @param - an object with vizId as a key
|
|
999
886
|
* @example
|
|
1000
887
|
* ```js
|
|
1001
|
-
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
1002
|
-
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1003
|
-
* })
|
|
888
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1004
889
|
* ```
|
|
1005
890
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1006
891
|
*/
|
|
1007
892
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
1008
893
|
/**
|
|
1009
894
|
* Triggers the Edit action on a Liveboard or visualization
|
|
1010
|
-
*
|
|
1011
|
-
* @param - object - to trigger the action for a specfic visualization
|
|
1012
|
-
* in Liveboard embed, pass in vizId as a key
|
|
895
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
1013
896
|
* @example
|
|
1014
897
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
1015
|
-
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
1016
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
898
|
+
* liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1017
899
|
* vizEmbed.trigger((HostEvent.Edit)
|
|
1018
900
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
1019
901
|
*/
|
|
1020
902
|
HostEvent["Edit"] = "edit";
|
|
1021
903
|
/**
|
|
1022
904
|
* Triggers the Copy link action on a Liveboard or visualization
|
|
1023
|
-
*
|
|
1024
|
-
* @param - object - to trigger the action for a s
|
|
1025
|
-
* pecfic visualization in Liveboard embed, pass in vizId as a key
|
|
905
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
1026
906
|
* @example
|
|
1027
907
|
* ```js
|
|
1028
908
|
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
@@ -1034,9 +914,7 @@
|
|
|
1034
914
|
HostEvent["CopyLink"] = "embedDocument";
|
|
1035
915
|
/**
|
|
1036
916
|
* Triggers the Present action on a Liveboard or visualization
|
|
1037
|
-
*
|
|
1038
|
-
* @param - object - to trigger the action for a specfic visualization
|
|
1039
|
-
* in Liveboard embed, pass in vizId as a key
|
|
917
|
+
* @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
|
|
1040
918
|
* @example
|
|
1041
919
|
* ```js
|
|
1042
920
|
* liveboardEmbed.trigger(HostEvent.Present)
|
|
@@ -1048,21 +926,18 @@
|
|
|
1048
926
|
HostEvent["Present"] = "present";
|
|
1049
927
|
/**
|
|
1050
928
|
* Get TML for the current search.
|
|
1051
|
-
*
|
|
1052
929
|
* @example
|
|
1053
930
|
* ```js
|
|
1054
931
|
* searchEmbed.trigger(HostEvent.GetTML)
|
|
1055
932
|
* ```
|
|
1056
|
-
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
|
|
933
|
+
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
|
|
1057
934
|
*/
|
|
1058
935
|
HostEvent["GetTML"] = "getTML";
|
|
1059
936
|
/**
|
|
1060
937
|
* Triggers the ShowUnderlyingData action on visualization or search
|
|
1061
|
-
*
|
|
1062
938
|
* @param - an object with vizId as a key
|
|
1063
939
|
* @example
|
|
1064
|
-
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId:
|
|
1065
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
940
|
+
* liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1066
941
|
* vizEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
1067
942
|
* searchEmbed.trigger(HostEvent.ShowUnderlyingData)
|
|
1068
943
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1070,12 +945,10 @@
|
|
|
1070
945
|
HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
1071
946
|
/**
|
|
1072
947
|
* Triggers the Delete action on visualization or search
|
|
1073
|
-
*
|
|
1074
948
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
1075
949
|
* can be left empty for search and visualization embeds
|
|
1076
950
|
* @example
|
|
1077
|
-
* liveboardEmbed.trigger(HostEvent.Delete, {vizId:
|
|
1078
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
951
|
+
* liveboardEmbed.trigger(HostEvent.Delete, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1079
952
|
* vizEmbed.trigger(HostEvent.Delete)
|
|
1080
953
|
* searchEmbed.trigger(HostEvent.Delete)
|
|
1081
954
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1083,12 +956,10 @@
|
|
|
1083
956
|
HostEvent["Delete"] = "delete";
|
|
1084
957
|
/**
|
|
1085
958
|
* Triggers the SpotIQAnalyze action on visualization or search
|
|
1086
|
-
*
|
|
1087
959
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
1088
960
|
* can be left empty for search and visualization embeds
|
|
1089
961
|
* @example
|
|
1090
|
-
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId:
|
|
1091
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
962
|
+
* liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1092
963
|
* vizEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
1093
964
|
* searchEmbed.trigger(HostEvent.SpotIQAnalyze)
|
|
1094
965
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1096,34 +967,26 @@
|
|
|
1096
967
|
HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
1097
968
|
/**
|
|
1098
969
|
* Triggers the Download action on visualization or search when Displaymode is Chart
|
|
1099
|
-
*
|
|
1100
970
|
* @example
|
|
1101
|
-
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
1102
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
971
|
+
* liveboardEmbed.trigger(HostEvent.Download, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1103
972
|
* vizEmbed.trigger(HostEvent.Download)
|
|
1104
973
|
* searchEmbed.trigger(HostEvent.Download)
|
|
1105
974
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1106
975
|
*/
|
|
1107
976
|
HostEvent["Download"] = "download";
|
|
1108
977
|
/**
|
|
1109
|
-
* Triggers the downloadAsCSV action on visualization or search when Displaymode is
|
|
1110
|
-
* Table
|
|
1111
|
-
*
|
|
978
|
+
* Triggers the downloadAsCSV action on visualization or search when Displaymode is Table
|
|
1112
979
|
* @example
|
|
1113
|
-
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
1114
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
980
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1115
981
|
* vizEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
1116
982
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
1117
983
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1118
984
|
*/
|
|
1119
985
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
1120
986
|
/**
|
|
1121
|
-
* Triggers the downloadAsXLSX action on visualization or search when Displaymode is
|
|
1122
|
-
* Table
|
|
1123
|
-
*
|
|
987
|
+
* Triggers the downloadAsXLSX action on visualization or search when Displaymode is Table
|
|
1124
988
|
* @example
|
|
1125
|
-
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
1126
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
989
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1127
990
|
* vizEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
1128
991
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
1129
992
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
@@ -1131,7 +994,6 @@
|
|
|
1131
994
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
1132
995
|
/**
|
|
1133
996
|
* Triggers the Share action on a liveboard or answer
|
|
1134
|
-
*
|
|
1135
997
|
* @example
|
|
1136
998
|
* liveboardEmbed.trigger(HostEvent.Share)
|
|
1137
999
|
* searchEmbed.trigger(HostEvent.Share)
|
|
@@ -1140,7 +1002,6 @@
|
|
|
1140
1002
|
HostEvent["Share"] = "share";
|
|
1141
1003
|
/**
|
|
1142
1004
|
* Trigger the Save action on a liveboard or answer
|
|
1143
|
-
*
|
|
1144
1005
|
* @example
|
|
1145
1006
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
1146
1007
|
* searchEmbed.trigger(HostEvent.Save)
|
|
@@ -1149,40 +1010,33 @@
|
|
|
1149
1010
|
HostEvent["Save"] = "save";
|
|
1150
1011
|
/**
|
|
1151
1012
|
* Triggers the SyncToSheets action on visualization
|
|
1152
|
-
*
|
|
1153
1013
|
* @param - an object with vizId as a key
|
|
1154
1014
|
* @example
|
|
1155
|
-
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId:
|
|
1156
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1015
|
+
* liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1157
1016
|
* vizEmbed.trigger(HostEvent.SyncToSheets)
|
|
1158
1017
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1159
1018
|
*/
|
|
1160
1019
|
HostEvent["SyncToSheets"] = "sync-to-sheets";
|
|
1161
1020
|
/**
|
|
1162
1021
|
* Triggers the SyncToOtherApps action on visualization
|
|
1163
|
-
*
|
|
1164
1022
|
* @param - an object with vizId as a key
|
|
1165
1023
|
* @example
|
|
1166
|
-
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId:
|
|
1167
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1024
|
+
* liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1168
1025
|
* vizEmbed.trigger(HostEvent.SyncToOtherApps)
|
|
1169
1026
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1170
1027
|
*/
|
|
1171
1028
|
HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
|
|
1172
1029
|
/**
|
|
1173
1030
|
* Triggers the ManagePipelines action on visualization
|
|
1174
|
-
*
|
|
1175
1031
|
* @param - an object with vizId as a key
|
|
1176
1032
|
* @example
|
|
1177
|
-
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId:
|
|
1178
|
-
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1033
|
+
* liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1179
1034
|
* vizEmbed.trigger(HostEvent.ManagePipelines)
|
|
1180
1035
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
|
|
1181
1036
|
*/
|
|
1182
1037
|
HostEvent["ManagePipelines"] = "manage-pipeline";
|
|
1183
1038
|
/**
|
|
1184
1039
|
* Triggers the Reset search in answer
|
|
1185
|
-
*
|
|
1186
1040
|
* @example
|
|
1187
1041
|
* searchEmbed.trigger(HostEvent.SearchReset
|
|
1188
1042
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1-sw
|
|
@@ -1210,7 +1064,6 @@
|
|
|
1210
1064
|
// eslint-disable-next-line no-shadow
|
|
1211
1065
|
var Param;
|
|
1212
1066
|
(function (Param) {
|
|
1213
|
-
Param["EmbedApp"] = "embedApp";
|
|
1214
1067
|
Param["DataSources"] = "dataSources";
|
|
1215
1068
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
1216
1069
|
Param["DisableActions"] = "disableAction";
|
|
@@ -1251,8 +1104,6 @@
|
|
|
1251
1104
|
Param["ContextMenuTrigger"] = "isContextMenuEnabledOnLeftClick";
|
|
1252
1105
|
Param["LinkOverride"] = "linkOverride";
|
|
1253
1106
|
Param["ShowInsertToSlide"] = "insertInToSlide";
|
|
1254
|
-
Param["PrimaryNavHidden"] = "primaryNavHidden";
|
|
1255
|
-
Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
|
|
1256
1107
|
})(Param || (Param = {}));
|
|
1257
1108
|
(function (Action) {
|
|
1258
1109
|
Action["Save"] = "save";
|
|
@@ -1500,7 +1351,6 @@
|
|
|
1500
1351
|
/**
|
|
1501
1352
|
* Parse and construct the ThoughtSpot hostname or IP address
|
|
1502
1353
|
* from the embed configuration object.
|
|
1503
|
-
*
|
|
1504
1354
|
* @param config
|
|
1505
1355
|
*/
|
|
1506
1356
|
const getThoughtSpotHost = (config) => {
|
|
@@ -1524,10 +1374,9 @@
|
|
|
1524
1374
|
return config.basepath;
|
|
1525
1375
|
}
|
|
1526
1376
|
const tsHost = getThoughtSpotHost(config);
|
|
1527
|
-
// This is to handle when e2e's. Search is run on pods for
|
|
1528
|
-
//
|
|
1529
|
-
// This is to handle when the developer is developing in their local
|
|
1530
|
-
// environment.
|
|
1377
|
+
// This is to handle when e2e's. Search is run on pods for comp-blink-test-pipeline
|
|
1378
|
+
// with baseUrl=https://localhost:8443.
|
|
1379
|
+
// This is to handle when the developer is developing in their local environment.
|
|
1531
1380
|
if (tsHost.includes('://localhost') && !tsHost.includes(':8443')) {
|
|
1532
1381
|
return '';
|
|
1533
1382
|
}
|
|
@@ -7537,7 +7386,6 @@
|
|
|
7537
7386
|
let eventQueue = [];
|
|
7538
7387
|
/**
|
|
7539
7388
|
* Pushes the event with its Property key-value map to mixpanel.
|
|
7540
|
-
*
|
|
7541
7389
|
* @param eventId
|
|
7542
7390
|
* @param eventProps
|
|
7543
7391
|
*/
|
|
@@ -7548,9 +7396,6 @@
|
|
|
7548
7396
|
}
|
|
7549
7397
|
mixpanel_cjs.track(eventId, eventProps);
|
|
7550
7398
|
}
|
|
7551
|
-
/**
|
|
7552
|
-
*
|
|
7553
|
-
*/
|
|
7554
7399
|
function emptyQueue() {
|
|
7555
7400
|
if (!isMixpanelInitialized) {
|
|
7556
7401
|
return;
|
|
@@ -7560,16 +7405,11 @@
|
|
|
7560
7405
|
});
|
|
7561
7406
|
eventQueue = [];
|
|
7562
7407
|
}
|
|
7563
|
-
/**
|
|
7564
|
-
*
|
|
7565
|
-
* @param sessionInfo
|
|
7566
|
-
*/
|
|
7567
7408
|
function initMixpanel(sessionInfo) {
|
|
7568
7409
|
if (!sessionInfo || !sessionInfo.mixpanelToken) {
|
|
7569
7410
|
return;
|
|
7570
7411
|
}
|
|
7571
|
-
// On a public cluster the user is anonymous, so don't set the identify to
|
|
7572
|
-
// userGUID
|
|
7412
|
+
// On a public cluster the user is anonymous, so don't set the identify to userGUID
|
|
7573
7413
|
const isPublicCluster = !!sessionInfo.isPublicUser;
|
|
7574
7414
|
const token = sessionInfo.mixpanelToken;
|
|
7575
7415
|
if (token) {
|
|
@@ -9048,11 +8888,6 @@
|
|
|
9048
8888
|
var uniq_1 = uniq;
|
|
9049
8889
|
|
|
9050
8890
|
// eslint-disable-next-line import/no-cycle
|
|
9051
|
-
/**
|
|
9052
|
-
*
|
|
9053
|
-
* @param url
|
|
9054
|
-
* @param options
|
|
9055
|
-
*/
|
|
9056
8891
|
function failureLoggedFetch(url, options = {}) {
|
|
9057
8892
|
return fetch(url, options).then(async (r) => {
|
|
9058
8893
|
var _a;
|
|
@@ -9062,42 +8897,21 @@
|
|
|
9062
8897
|
return r;
|
|
9063
8898
|
});
|
|
9064
8899
|
}
|
|
9065
|
-
/**
|
|
9066
|
-
*
|
|
9067
|
-
* @param authVerificationUrl
|
|
9068
|
-
*/
|
|
9069
8900
|
function fetchSessionInfoService(authVerificationUrl) {
|
|
9070
8901
|
return failureLoggedFetch(authVerificationUrl, {
|
|
9071
8902
|
credentials: 'include',
|
|
9072
8903
|
});
|
|
9073
8904
|
}
|
|
9074
|
-
/**
|
|
9075
|
-
*
|
|
9076
|
-
* @param authEndpoint
|
|
9077
|
-
*/
|
|
9078
8905
|
async function fetchAuthTokenService(authEndpoint) {
|
|
9079
8906
|
return fetch(authEndpoint);
|
|
9080
8907
|
}
|
|
9081
|
-
/**
|
|
9082
|
-
*
|
|
9083
|
-
* @param thoughtSpotHost
|
|
9084
|
-
* @param username
|
|
9085
|
-
* @param authToken
|
|
9086
|
-
*/
|
|
9087
8908
|
async function fetchAuthService(thoughtSpotHost, username, authToken) {
|
|
9088
8909
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}?username=${username}&auth_token=${authToken}`, {
|
|
9089
8910
|
credentials: 'include',
|
|
9090
|
-
// We do not want to follow the redirect, as it starts giving a CORS
|
|
9091
|
-
// error
|
|
8911
|
+
// We do not want to follow the redirect, as it starts giving a CORS error
|
|
9092
8912
|
redirect: 'manual',
|
|
9093
8913
|
});
|
|
9094
8914
|
}
|
|
9095
|
-
/**
|
|
9096
|
-
*
|
|
9097
|
-
* @param thoughtSpotHost
|
|
9098
|
-
* @param username
|
|
9099
|
-
* @param authToken
|
|
9100
|
-
*/
|
|
9101
8915
|
async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
|
|
9102
8916
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
|
|
9103
8917
|
method: 'POST',
|
|
@@ -9107,17 +8921,10 @@
|
|
|
9107
8921
|
},
|
|
9108
8922
|
body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
|
|
9109
8923
|
credentials: 'include',
|
|
9110
|
-
// We do not want to follow the redirect, as it starts giving a CORS
|
|
9111
|
-
// error
|
|
8924
|
+
// We do not want to follow the redirect, as it starts giving a CORS error
|
|
9112
8925
|
redirect: 'manual',
|
|
9113
8926
|
});
|
|
9114
8927
|
}
|
|
9115
|
-
/**
|
|
9116
|
-
*
|
|
9117
|
-
* @param thoughtSpotHost
|
|
9118
|
-
* @param username
|
|
9119
|
-
* @param password
|
|
9120
|
-
*/
|
|
9121
8928
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
9122
8929
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
9123
8930
|
method: 'POST',
|
|
@@ -9129,10 +8936,6 @@
|
|
|
9129
8936
|
credentials: 'include',
|
|
9130
8937
|
});
|
|
9131
8938
|
}
|
|
9132
|
-
/**
|
|
9133
|
-
*
|
|
9134
|
-
* @param thoughtSpotHost
|
|
9135
|
-
*/
|
|
9136
8939
|
async function fetchLogoutService(thoughtSpotHost) {
|
|
9137
8940
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.LOGOUT}`, {
|
|
9138
8941
|
credentials: 'include',
|
|
@@ -9191,7 +8994,6 @@
|
|
|
9191
8994
|
* Emitted when inPopup: true in the SAMLRedirect flow.
|
|
9192
8995
|
* And, we are waiting for popup to be triggered either programatically
|
|
9193
8996
|
* or by the trigger button.
|
|
9194
|
-
*
|
|
9195
8997
|
* @version SDK: 1.19.0
|
|
9196
8998
|
*/
|
|
9197
8999
|
AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
|
|
@@ -9204,16 +9006,9 @@
|
|
|
9204
9006
|
AuthEvent["TRIGGER_SSO_POPUP"] = "TRIGGER_SSO_POPUP";
|
|
9205
9007
|
})(exports.AuthEvent || (exports.AuthEvent = {}));
|
|
9206
9008
|
let authEE;
|
|
9207
|
-
/**
|
|
9208
|
-
*
|
|
9209
|
-
* @param eventEmitter
|
|
9210
|
-
*/
|
|
9211
9009
|
function setAuthEE(eventEmitter) {
|
|
9212
9010
|
authEE = eventEmitter;
|
|
9213
9011
|
}
|
|
9214
|
-
/**
|
|
9215
|
-
*
|
|
9216
|
-
*/
|
|
9217
9012
|
function notifyAuthSDKSuccess() {
|
|
9218
9013
|
if (!authEE) {
|
|
9219
9014
|
console.error('SDK not initialized');
|
|
@@ -9221,9 +9016,6 @@
|
|
|
9221
9016
|
}
|
|
9222
9017
|
authEE.emit(exports.AuthStatus.SDK_SUCCESS);
|
|
9223
9018
|
}
|
|
9224
|
-
/**
|
|
9225
|
-
*
|
|
9226
|
-
*/
|
|
9227
9019
|
function notifyAuthSuccess() {
|
|
9228
9020
|
if (!authEE) {
|
|
9229
9021
|
console.error('SDK not initialized');
|
|
@@ -9231,10 +9023,6 @@
|
|
|
9231
9023
|
}
|
|
9232
9024
|
authEE.emit(exports.AuthStatus.SUCCESS, sessionInfo);
|
|
9233
9025
|
}
|
|
9234
|
-
/**
|
|
9235
|
-
*
|
|
9236
|
-
* @param failureType
|
|
9237
|
-
*/
|
|
9238
9026
|
function notifyAuthFailure(failureType) {
|
|
9239
9027
|
if (!authEE) {
|
|
9240
9028
|
console.error('SDK not initialized');
|
|
@@ -9242,9 +9030,6 @@
|
|
|
9242
9030
|
}
|
|
9243
9031
|
authEE.emit(exports.AuthStatus.FAILURE, failureType);
|
|
9244
9032
|
}
|
|
9245
|
-
/**
|
|
9246
|
-
*
|
|
9247
|
-
*/
|
|
9248
9033
|
function notifyLogout() {
|
|
9249
9034
|
if (!authEE) {
|
|
9250
9035
|
console.error('SDK not initialized');
|
|
@@ -9254,7 +9039,6 @@
|
|
|
9254
9039
|
}
|
|
9255
9040
|
/**
|
|
9256
9041
|
* Check if we are logged into the ThoughtSpot cluster
|
|
9257
|
-
*
|
|
9258
9042
|
* @param thoughtSpotHost The ThoughtSpot cluster hostname or IP
|
|
9259
9043
|
*/
|
|
9260
9044
|
async function isLoggedIn(thoughtSpotHost) {
|
|
@@ -9277,30 +9061,21 @@
|
|
|
9277
9061
|
return releaseVersion;
|
|
9278
9062
|
}
|
|
9279
9063
|
/**
|
|
9280
|
-
* Return a promise that resolves with the session information when
|
|
9281
|
-
*
|
|
9282
|
-
*
|
|
9064
|
+
* Return a promise that resolves with the session information when authentication is
|
|
9065
|
+
* successful. And info is available.
|
|
9283
9066
|
* @group Global methods
|
|
9284
9067
|
*/
|
|
9285
9068
|
function getSessionInfo() {
|
|
9286
9069
|
return sessionInfoPromise;
|
|
9287
9070
|
}
|
|
9288
|
-
/**
|
|
9289
|
-
*
|
|
9290
|
-
* @param sessionDetails
|
|
9291
|
-
*/
|
|
9292
9071
|
function initSession(sessionDetails) {
|
|
9293
9072
|
sessionInfo = sessionDetails;
|
|
9294
9073
|
initMixpanel(sessionInfo);
|
|
9295
9074
|
sessionInfoResolver(sessionInfo);
|
|
9296
9075
|
}
|
|
9297
|
-
const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.'
|
|
9298
|
-
|
|
9076
|
+
const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every time getAuthToken callback is called.' +
|
|
9077
|
+
'See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.';
|
|
9299
9078
|
let prevAuthToken = null;
|
|
9300
|
-
/**
|
|
9301
|
-
*
|
|
9302
|
-
* @param authtoken
|
|
9303
|
-
*/
|
|
9304
9079
|
function alertForDuplicateToken(authtoken) {
|
|
9305
9080
|
if (prevAuthToken === authtoken) {
|
|
9306
9081
|
// eslint-disable-next-line no-alert
|
|
@@ -9320,10 +9095,9 @@
|
|
|
9320
9095
|
*/
|
|
9321
9096
|
function removeSSORedirectUrlMarker() {
|
|
9322
9097
|
// Note (sunny): This will leave a # around even if it was not in the URL
|
|
9323
|
-
// to begin with. Trying to remove the hash by changing window.location will
|
|
9324
|
-
//
|
|
9325
|
-
//
|
|
9326
|
-
// that creates an issue.
|
|
9098
|
+
// to begin with. Trying to remove the hash by changing window.location will reload
|
|
9099
|
+
// the page which we don't want. We'll live with adding an unnecessary hash to the
|
|
9100
|
+
// parent page URL until we find any use case where that creates an issue.
|
|
9327
9101
|
window.location.hash = window.location.hash.replace(SSO_REDIRECTION_MARKER_GUID, '');
|
|
9328
9102
|
}
|
|
9329
9103
|
const getAuthenticaionToken = async (embedConfig) => {
|
|
@@ -9341,7 +9115,6 @@
|
|
|
9341
9115
|
};
|
|
9342
9116
|
/**
|
|
9343
9117
|
* Perform token based authentication
|
|
9344
|
-
*
|
|
9345
9118
|
* @param embedConfig The embed configuration
|
|
9346
9119
|
*/
|
|
9347
9120
|
const doTokenAuth = async (embedConfig) => {
|
|
@@ -9362,8 +9135,8 @@
|
|
|
9362
9135
|
// token login issues a 302 when successful
|
|
9363
9136
|
loggedInStatus = resp.ok || resp.type === 'opaqueredirect';
|
|
9364
9137
|
if (loggedInStatus && embedConfig.detectCookieAccessSlow) {
|
|
9365
|
-
// When 3rd party cookie access is blocked, this will fail because
|
|
9366
|
-
//
|
|
9138
|
+
// When 3rd party cookie access is blocked, this will fail because cookies will
|
|
9139
|
+
// not be sent with the call.
|
|
9367
9140
|
loggedInStatus = await isLoggedIn(thoughtSpotHost);
|
|
9368
9141
|
}
|
|
9369
9142
|
}
|
|
@@ -9371,7 +9144,6 @@
|
|
|
9371
9144
|
};
|
|
9372
9145
|
/**
|
|
9373
9146
|
* Validate embedConfig parameters required for cookielessTokenAuth
|
|
9374
|
-
*
|
|
9375
9147
|
* @param embedConfig The embed configuration
|
|
9376
9148
|
*/
|
|
9377
9149
|
const doCookielessTokenAuth = async (embedConfig) => {
|
|
@@ -9387,7 +9159,6 @@
|
|
|
9387
9159
|
*
|
|
9388
9160
|
* Warning: This feature is primarily intended for developer testing. It is
|
|
9389
9161
|
* strongly advised not to use this authentication method in production.
|
|
9390
|
-
*
|
|
9391
9162
|
* @param embedConfig The embed configuration
|
|
9392
9163
|
*/
|
|
9393
9164
|
const doBasicAuth = async (embedConfig) => {
|
|
@@ -9405,12 +9176,6 @@
|
|
|
9405
9176
|
}
|
|
9406
9177
|
return loggedInStatus;
|
|
9407
9178
|
};
|
|
9408
|
-
/**
|
|
9409
|
-
*
|
|
9410
|
-
* @param ssoURL
|
|
9411
|
-
* @param triggerContainer
|
|
9412
|
-
* @param triggerText
|
|
9413
|
-
*/
|
|
9414
9179
|
async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
|
|
9415
9180
|
const openPopup = () => {
|
|
9416
9181
|
if (samlAuthWindow === null || samlAuthWindow.closed) {
|
|
@@ -9423,28 +9188,28 @@
|
|
|
9423
9188
|
authEE === null || authEE === void 0 ? void 0 : authEE.emit(exports.AuthStatus.WAITING_FOR_POPUP);
|
|
9424
9189
|
const containerEl = getDOMNode(triggerContainer);
|
|
9425
9190
|
if (containerEl) {
|
|
9426
|
-
containerEl.innerHTML =
|
|
9191
|
+
containerEl.innerHTML =
|
|
9192
|
+
'<button id="ts-auth-btn" class="ts-auth-btn" style="margin: auto;"></button>';
|
|
9427
9193
|
const authElem = document.getElementById('ts-auth-btn');
|
|
9428
9194
|
authElem.textContent = triggerText;
|
|
9429
9195
|
authElem.addEventListener('click', openPopup, { once: true });
|
|
9430
9196
|
}
|
|
9431
|
-
samlCompletionPromise =
|
|
9432
|
-
||
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
e.
|
|
9436
|
-
|
|
9437
|
-
|
|
9197
|
+
samlCompletionPromise =
|
|
9198
|
+
samlCompletionPromise ||
|
|
9199
|
+
new Promise((resolve, reject) => {
|
|
9200
|
+
window.addEventListener('message', (e) => {
|
|
9201
|
+
if (e.data.type === exports.EmbedEvent.SAMLComplete) {
|
|
9202
|
+
e.source.close();
|
|
9203
|
+
resolve();
|
|
9204
|
+
}
|
|
9205
|
+
});
|
|
9438
9206
|
});
|
|
9439
|
-
});
|
|
9440
9207
|
authEE === null || authEE === void 0 ? void 0 : authEE.once(exports.AuthEvent.TRIGGER_SSO_POPUP, openPopup);
|
|
9441
9208
|
return samlCompletionPromise;
|
|
9442
9209
|
}
|
|
9443
9210
|
/**
|
|
9444
9211
|
* Perform SAML authentication
|
|
9445
|
-
*
|
|
9446
9212
|
* @param embedConfig The embed configuration
|
|
9447
|
-
* @param ssoEndPoint
|
|
9448
9213
|
*/
|
|
9449
9214
|
const doSSOAuth = async (embedConfig, ssoEndPoint) => {
|
|
9450
9215
|
const { thoughtSpotHost } = embedConfig;
|
|
@@ -9473,8 +9238,8 @@
|
|
|
9473
9238
|
};
|
|
9474
9239
|
const doSamlAuth = async (embedConfig) => {
|
|
9475
9240
|
const { thoughtSpotHost } = embedConfig;
|
|
9476
|
-
// redirect for SSO, when the SSO authentication is done, this page will be
|
|
9477
|
-
//
|
|
9241
|
+
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
9242
|
+
// again and the same JS will execute again.
|
|
9478
9243
|
const ssoRedirectUrl = embedConfig.inPopup
|
|
9479
9244
|
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
9480
9245
|
: getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
|
|
@@ -9485,8 +9250,8 @@
|
|
|
9485
9250
|
};
|
|
9486
9251
|
const doOIDCAuth = async (embedConfig) => {
|
|
9487
9252
|
const { thoughtSpotHost } = embedConfig;
|
|
9488
|
-
// redirect for SSO, when the SSO authentication is done, this page will be
|
|
9489
|
-
//
|
|
9253
|
+
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
9254
|
+
// again and the same JS will execute again.
|
|
9490
9255
|
const ssoRedirectUrl = embedConfig.noRedirect || embedConfig.inPopup
|
|
9491
9256
|
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
9492
9257
|
: getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
|
|
@@ -9503,7 +9268,6 @@
|
|
|
9503
9268
|
};
|
|
9504
9269
|
/**
|
|
9505
9270
|
* Perform authentication on the ThoughtSpot cluster
|
|
9506
|
-
*
|
|
9507
9271
|
* @param embedConfig The embed configuration
|
|
9508
9272
|
*/
|
|
9509
9273
|
const authenticate = async (embedConfig) => {
|
|
@@ -9569,10 +9333,7 @@
|
|
|
9569
9333
|
[exports.PrefetchFeatures.VizEmbed]: (url) => url,
|
|
9570
9334
|
};
|
|
9571
9335
|
/**
|
|
9572
|
-
* Prefetches static resources from the specified URL. Web browsers can then cache the
|
|
9573
|
-
* prefetched resources and serve them from the user's local disk to provide faster access
|
|
9574
|
-
* to your app.
|
|
9575
|
-
*
|
|
9336
|
+
* 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.
|
|
9576
9337
|
* @param url The URL provided for prefetch
|
|
9577
9338
|
* @param prefetchFeatures Specify features which needs to be prefetched.
|
|
9578
9339
|
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1
|
|
@@ -9599,10 +9360,6 @@
|
|
|
9599
9360
|
});
|
|
9600
9361
|
}
|
|
9601
9362
|
};
|
|
9602
|
-
/**
|
|
9603
|
-
*
|
|
9604
|
-
* @param embedConfig
|
|
9605
|
-
*/
|
|
9606
9363
|
function sanity(embedConfig) {
|
|
9607
9364
|
if (embedConfig.thoughtSpotHost === undefined) {
|
|
9608
9365
|
throw new Error('ThoughtSpot host not provided');
|
|
@@ -9611,18 +9368,16 @@
|
|
|
9611
9368
|
if (!embedConfig.username) {
|
|
9612
9369
|
throw new Error('Username not provided with Trusted auth');
|
|
9613
9370
|
}
|
|
9614
|
-
if (!embedConfig.authEndpoint &&
|
|
9371
|
+
if (!embedConfig.authEndpoint &&
|
|
9372
|
+
typeof embedConfig.getAuthToken !== 'function') {
|
|
9615
9373
|
throw new Error('Trusted auth should provide either authEndpoint or getAuthToken');
|
|
9616
9374
|
}
|
|
9617
9375
|
}
|
|
9618
9376
|
}
|
|
9619
|
-
/**
|
|
9620
|
-
*
|
|
9621
|
-
* @param embedConfig
|
|
9622
|
-
*/
|
|
9623
9377
|
function backwardCompat(embedConfig) {
|
|
9624
9378
|
const newConfig = { ...embedConfig };
|
|
9625
|
-
if (embedConfig.noRedirect !== undefined &&
|
|
9379
|
+
if (embedConfig.noRedirect !== undefined &&
|
|
9380
|
+
embedConfig.inPopup === undefined) {
|
|
9626
9381
|
newConfig.inPopup = embedConfig.noRedirect;
|
|
9627
9382
|
}
|
|
9628
9383
|
return newConfig;
|
|
@@ -9630,9 +9385,9 @@
|
|
|
9630
9385
|
/**
|
|
9631
9386
|
* Initializes the Visual Embed SDK globally and perform
|
|
9632
9387
|
* authentication if applicable.
|
|
9633
|
-
*
|
|
9634
9388
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
9635
9389
|
* authentication mechanism and so on.
|
|
9390
|
+
*
|
|
9636
9391
|
* @example
|
|
9637
9392
|
* ```js
|
|
9638
9393
|
* const authStatus = init({
|
|
@@ -9641,8 +9396,8 @@
|
|
|
9641
9396
|
* });
|
|
9642
9397
|
* authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
|
|
9643
9398
|
* ```
|
|
9644
|
-
*
|
|
9645
|
-
*
|
|
9399
|
+
*
|
|
9400
|
+
* @returns {@link AuthEventEmitter} event emitter which emits events on authentication success, failure and logout. See {@link AuthStatus}
|
|
9646
9401
|
* @version SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1
|
|
9647
9402
|
* @group Authentication / Init
|
|
9648
9403
|
*/
|
|
@@ -9663,7 +9418,8 @@
|
|
|
9663
9418
|
host: config.thoughtSpotHost,
|
|
9664
9419
|
usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
|
|
9665
9420
|
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,
|
|
9666
|
-
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) !=
|
|
9421
|
+
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) !=
|
|
9422
|
+
null,
|
|
9667
9423
|
usedCustomizationStrings: !!((_k = (_j = embedConfig.customizations) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.strings),
|
|
9668
9424
|
usedCustomizationIconSprite: !!((_l = embedConfig.customizations) === null || _l === void 0 ? void 0 : _l.iconSpriteUrl),
|
|
9669
9425
|
});
|
|
@@ -9672,18 +9428,15 @@
|
|
|
9672
9428
|
}
|
|
9673
9429
|
return authEE;
|
|
9674
9430
|
};
|
|
9675
|
-
/**
|
|
9676
|
-
*
|
|
9677
|
-
*/
|
|
9678
9431
|
function disableAutoLogin() {
|
|
9679
9432
|
config.autoLogin = false;
|
|
9680
9433
|
}
|
|
9681
9434
|
/**
|
|
9682
|
-
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to
|
|
9683
|
-
*
|
|
9435
|
+
* Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to prevent
|
|
9436
|
+
* the SDK from automatically logging in again.
|
|
9684
9437
|
*
|
|
9685
|
-
* You can call the `init` method again to re login, if autoLogin is set to
|
|
9686
|
-
*
|
|
9438
|
+
* You can call the `init` method again to re login, if autoLogin is set to true in this
|
|
9439
|
+
* second call it will be honored.
|
|
9687
9440
|
*
|
|
9688
9441
|
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
9689
9442
|
* @returns Promise which resolves when logout completes.
|
|
@@ -9701,9 +9454,7 @@
|
|
|
9701
9454
|
};
|
|
9702
9455
|
let renderQueue = Promise.resolve();
|
|
9703
9456
|
/**
|
|
9704
|
-
* Renders functions in a queue, resolves to next function only after the callback next
|
|
9705
|
-
* is called
|
|
9706
|
-
*
|
|
9457
|
+
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
9707
9458
|
* @param fn The function being registered
|
|
9708
9459
|
*/
|
|
9709
9460
|
const renderInQueue = (fn) => {
|
|
@@ -9716,13 +9467,6 @@
|
|
|
9716
9467
|
return fn(() => { }); // eslint-disable-line @typescript-eslint/no-empty-function
|
|
9717
9468
|
};
|
|
9718
9469
|
|
|
9719
|
-
/**
|
|
9720
|
-
*
|
|
9721
|
-
* @param session
|
|
9722
|
-
* @param query
|
|
9723
|
-
* @param operation
|
|
9724
|
-
* @param thoughtSpotHost
|
|
9725
|
-
*/
|
|
9726
9470
|
function getAnswerServiceInstance(session, query, operation, thoughtSpotHost) {
|
|
9727
9471
|
let variable;
|
|
9728
9472
|
const fetchQuery = async (variables) => {
|
|
@@ -9772,14 +9516,12 @@
|
|
|
9772
9516
|
};
|
|
9773
9517
|
}
|
|
9774
9518
|
|
|
9775
|
-
/**
|
|
9776
|
-
*
|
|
9777
|
-
* @param e
|
|
9778
|
-
* @param thoughtSpotHost
|
|
9779
|
-
*/
|
|
9780
9519
|
function processCustomAction(e, thoughtSpotHost) {
|
|
9781
9520
|
var _a;
|
|
9782
|
-
if ([
|
|
9521
|
+
if ([
|
|
9522
|
+
OperationType.GetChartWithData,
|
|
9523
|
+
OperationType.GetTableWithHeadlineData,
|
|
9524
|
+
].includes((_a = e.data) === null || _a === void 0 ? void 0 : _a.operation)) {
|
|
9783
9525
|
const { session, query, operation } = e.data;
|
|
9784
9526
|
const answerService = getAnswerServiceInstance(session, query, operation, thoughtSpotHost);
|
|
9785
9527
|
return {
|
|
@@ -9789,10 +9531,6 @@
|
|
|
9789
9531
|
}
|
|
9790
9532
|
return e;
|
|
9791
9533
|
}
|
|
9792
|
-
/**
|
|
9793
|
-
*
|
|
9794
|
-
* @param e
|
|
9795
|
-
*/
|
|
9796
9534
|
function processAuthInit(e) {
|
|
9797
9535
|
var _a, _b;
|
|
9798
9536
|
// Store user session details sent by app.
|
|
@@ -9806,13 +9544,8 @@
|
|
|
9806
9544
|
},
|
|
9807
9545
|
};
|
|
9808
9546
|
}
|
|
9809
|
-
/**
|
|
9810
|
-
*
|
|
9811
|
-
* @param e
|
|
9812
|
-
* @param containerEl
|
|
9813
|
-
*/
|
|
9814
9547
|
function processNoCookieAccess(e, containerEl) {
|
|
9815
|
-
const { loginFailedMessage, suppressNoCookieAccessAlert } = getEmbedConfig();
|
|
9548
|
+
const { loginFailedMessage, suppressNoCookieAccessAlert, } = getEmbedConfig();
|
|
9816
9549
|
if (!suppressNoCookieAccessAlert) {
|
|
9817
9550
|
// eslint-disable-next-line no-alert
|
|
9818
9551
|
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.');
|
|
@@ -9822,11 +9555,6 @@
|
|
|
9822
9555
|
notifyAuthFailure(exports.AuthFailureType.NO_COOKIE_ACCESS);
|
|
9823
9556
|
return e;
|
|
9824
9557
|
}
|
|
9825
|
-
/**
|
|
9826
|
-
*
|
|
9827
|
-
* @param e
|
|
9828
|
-
* @param containerEl
|
|
9829
|
-
*/
|
|
9830
9558
|
function processAuthFailure(e, containerEl) {
|
|
9831
9559
|
const { loginFailedMessage, authType } = getEmbedConfig();
|
|
9832
9560
|
if (authType !== exports.AuthType.None) {
|
|
@@ -9836,11 +9564,6 @@
|
|
|
9836
9564
|
}
|
|
9837
9565
|
return e;
|
|
9838
9566
|
}
|
|
9839
|
-
/**
|
|
9840
|
-
*
|
|
9841
|
-
* @param e
|
|
9842
|
-
* @param containerEl
|
|
9843
|
-
*/
|
|
9844
9567
|
function processAuthLogout(e, containerEl) {
|
|
9845
9568
|
const { loginFailedMessage } = getEmbedConfig();
|
|
9846
9569
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -9849,13 +9572,6 @@
|
|
|
9849
9572
|
notifyLogout();
|
|
9850
9573
|
return e;
|
|
9851
9574
|
}
|
|
9852
|
-
/**
|
|
9853
|
-
*
|
|
9854
|
-
* @param type
|
|
9855
|
-
* @param e
|
|
9856
|
-
* @param thoughtSpotHost
|
|
9857
|
-
* @param containerEl
|
|
9858
|
-
*/
|
|
9859
9575
|
function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
9860
9576
|
switch (type) {
|
|
9861
9577
|
case exports.EmbedEvent.CustomAction:
|
|
@@ -9874,8 +9590,6 @@
|
|
|
9874
9590
|
|
|
9875
9591
|
/**
|
|
9876
9592
|
* Reloads the ThoughtSpot iframe.
|
|
9877
|
-
*
|
|
9878
|
-
* @param iFrame
|
|
9879
9593
|
*/
|
|
9880
9594
|
function reload(iFrame) {
|
|
9881
9595
|
const oldFrame = iFrame.cloneNode();
|
|
@@ -9885,25 +9599,13 @@
|
|
|
9885
9599
|
}
|
|
9886
9600
|
/**
|
|
9887
9601
|
* Post Iframe message.
|
|
9888
|
-
*
|
|
9889
|
-
* @param iFrame
|
|
9890
|
-
* @param message
|
|
9891
|
-
* @param message.type
|
|
9892
|
-
* @param message.data
|
|
9893
|
-
* @param thoughtSpotHost
|
|
9894
|
-
* @param channel
|
|
9895
9602
|
*/
|
|
9896
9603
|
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
9897
|
-
return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [
|
|
9604
|
+
return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [
|
|
9605
|
+
channel === null || channel === void 0 ? void 0 : channel.port2,
|
|
9606
|
+
]);
|
|
9898
9607
|
}
|
|
9899
9608
|
const TRIGGER_TIMEOUT = 30000;
|
|
9900
|
-
/**
|
|
9901
|
-
*
|
|
9902
|
-
* @param iFrame
|
|
9903
|
-
* @param messageType
|
|
9904
|
-
* @param thoughtSpotHost
|
|
9905
|
-
* @param data
|
|
9906
|
-
*/
|
|
9907
9609
|
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
9908
9610
|
return new Promise((res, rej) => {
|
|
9909
9611
|
if (messageType === exports.HostEvent.Reload) {
|
|
@@ -9929,7 +9631,7 @@
|
|
|
9929
9631
|
});
|
|
9930
9632
|
}
|
|
9931
9633
|
|
|
9932
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.20.
|
|
9634
|
+
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$1={".":"./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$1,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};
|
|
9933
9635
|
|
|
9934
9636
|
/**
|
|
9935
9637
|
* Copyright (c) 2022
|
|
@@ -9949,7 +9651,6 @@
|
|
|
9949
9651
|
* The event id map from v2 event names to v1 event id
|
|
9950
9652
|
* v1 events are the classic embed events implemented in Blink v1
|
|
9951
9653
|
* We cannot rename v1 event types to maintain backward compatibility
|
|
9952
|
-
*
|
|
9953
9654
|
* @internal
|
|
9954
9655
|
*/
|
|
9955
9656
|
const V1EventMap = {};
|
|
@@ -9960,28 +9661,22 @@
|
|
|
9960
9661
|
*/
|
|
9961
9662
|
class TsEmbed {
|
|
9962
9663
|
constructor(domSelector, viewConfig) {
|
|
9963
|
-
this.isAppInitialized = false;
|
|
9964
9664
|
/**
|
|
9965
9665
|
* Should we encode URL Query Params using base64 encoding which thoughtspot
|
|
9966
9666
|
* will generate for embedding. This provides additional security to
|
|
9967
9667
|
* thoughtspot clusters against Cross site scripting attacks.
|
|
9968
|
-
*
|
|
9969
9668
|
* @default false
|
|
9970
9669
|
*/
|
|
9971
9670
|
this.shouldEncodeUrlQueryParams = false;
|
|
9972
9671
|
this.defaultHiddenActions = [exports.Action.ReportError];
|
|
9973
9672
|
/**
|
|
9974
9673
|
* Send Custom style as part of payload of APP_INIT
|
|
9975
|
-
*
|
|
9976
|
-
* @param _
|
|
9977
|
-
* @param responder
|
|
9978
9674
|
*/
|
|
9979
9675
|
this.appInitCb = async (_, responder) => {
|
|
9980
9676
|
let authToken = '';
|
|
9981
9677
|
if (this.embedConfig.authType === exports.AuthType.TrustedAuthTokenCookieless) {
|
|
9982
9678
|
authToken = await getAuthenticaionToken(this.embedConfig);
|
|
9983
9679
|
}
|
|
9984
|
-
this.isAppInitialized = true;
|
|
9985
9680
|
responder({
|
|
9986
9681
|
type: exports.EmbedEvent.APP_INIT,
|
|
9987
9682
|
data: {
|
|
@@ -9992,9 +9687,6 @@
|
|
|
9992
9687
|
};
|
|
9993
9688
|
/**
|
|
9994
9689
|
* Sends updated auth token to the iFrame to avoid user logout
|
|
9995
|
-
*
|
|
9996
|
-
* @param _
|
|
9997
|
-
* @param responder
|
|
9998
9690
|
*/
|
|
9999
9691
|
this.updateAuthToken = async (_, responder) => {
|
|
10000
9692
|
const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
|
|
@@ -10036,7 +9728,6 @@
|
|
|
10036
9728
|
}
|
|
10037
9729
|
/**
|
|
10038
9730
|
* Handles errors within the SDK
|
|
10039
|
-
*
|
|
10040
9731
|
* @param error The error message or object
|
|
10041
9732
|
*/
|
|
10042
9733
|
handleError(error) {
|
|
@@ -10049,7 +9740,6 @@
|
|
|
10049
9740
|
}
|
|
10050
9741
|
/**
|
|
10051
9742
|
* Extracts the type field from the event payload
|
|
10052
|
-
*
|
|
10053
9743
|
* @param event The window message event
|
|
10054
9744
|
*/
|
|
10055
9745
|
getEventType(event) {
|
|
@@ -10059,7 +9749,6 @@
|
|
|
10059
9749
|
}
|
|
10060
9750
|
/**
|
|
10061
9751
|
* Extracts the port field from the event payload
|
|
10062
|
-
*
|
|
10063
9752
|
* @param event The window message event
|
|
10064
9753
|
* @returns
|
|
10065
9754
|
*/
|
|
@@ -10072,9 +9761,6 @@
|
|
|
10072
9761
|
/**
|
|
10073
9762
|
* fix for ts7.sep.cl
|
|
10074
9763
|
* will be removed for ts7.oct.cl
|
|
10075
|
-
*
|
|
10076
|
-
* @param event
|
|
10077
|
-
* @param eventType
|
|
10078
9764
|
* @hidden
|
|
10079
9765
|
*/
|
|
10080
9766
|
formatEventData(event, eventType) {
|
|
@@ -10105,31 +9791,33 @@
|
|
|
10105
9791
|
}
|
|
10106
9792
|
/**
|
|
10107
9793
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
10108
|
-
*
|
|
10109
|
-
* @param query
|
|
10110
9794
|
*/
|
|
10111
9795
|
getEmbedBasePath(query) {
|
|
10112
9796
|
let queryString = query;
|
|
10113
9797
|
if (this.shouldEncodeUrlQueryParams) {
|
|
10114
9798
|
queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
|
|
10115
9799
|
}
|
|
10116
|
-
const basePath = [
|
|
9800
|
+
const basePath = [
|
|
9801
|
+
this.thoughtSpotHost,
|
|
9802
|
+
this.thoughtSpotV2Base,
|
|
9803
|
+
queryString,
|
|
9804
|
+
]
|
|
10117
9805
|
.filter((x) => x.length > 0)
|
|
10118
9806
|
.join('/');
|
|
10119
|
-
return `${basePath}
|
|
9807
|
+
return `${basePath}#/embed`;
|
|
10120
9808
|
}
|
|
10121
9809
|
/**
|
|
10122
9810
|
* Common query params set for all the embed modes.
|
|
10123
|
-
*
|
|
10124
|
-
* @param queryParams
|
|
10125
9811
|
* @returns queryParams
|
|
10126
9812
|
*/
|
|
10127
|
-
getBaseQueryParams(
|
|
9813
|
+
getBaseQueryParams() {
|
|
10128
9814
|
var _a, _b;
|
|
9815
|
+
const queryParams = {};
|
|
10129
9816
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
10130
|
-
// The below check is needed because TS Cloud firewall, blocks
|
|
10131
|
-
//
|
|
10132
|
-
if (hostAppUrl.includes('localhost') ||
|
|
9817
|
+
// The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
|
|
9818
|
+
// in any url param.
|
|
9819
|
+
if (hostAppUrl.includes('localhost') ||
|
|
9820
|
+
hostAppUrl.includes('127.0.0.1')) {
|
|
10133
9821
|
hostAppUrl = 'local-host';
|
|
10134
9822
|
}
|
|
10135
9823
|
queryParams[Param.HostAppUrl] = encodeURIComponent(hostAppUrl);
|
|
@@ -10137,7 +9825,8 @@
|
|
|
10137
9825
|
queryParams[Param.ViewPortWidth] = window.innerWidth;
|
|
10138
9826
|
queryParams[Param.Version] = version$1;
|
|
10139
9827
|
queryParams[Param.AuthType] = this.embedConfig.authType;
|
|
10140
|
-
if (this.embedConfig.disableLoginRedirect === true ||
|
|
9828
|
+
if (this.embedConfig.disableLoginRedirect === true ||
|
|
9829
|
+
this.embedConfig.autoLogin === true) {
|
|
10141
9830
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
10142
9831
|
}
|
|
10143
9832
|
if (this.embedConfig.authType === exports.AuthType.EmbeddedSSO) {
|
|
@@ -10152,7 +9841,8 @@
|
|
|
10152
9841
|
return queryParams;
|
|
10153
9842
|
}
|
|
10154
9843
|
// TODO remove embedConfig.customCssUrl
|
|
10155
|
-
const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
|
|
9844
|
+
const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
|
|
9845
|
+
this.embedConfig.customCssUrl;
|
|
10156
9846
|
if (cssUrlParam) {
|
|
10157
9847
|
queryParams[Param.CustomCSSUrl] = cssUrlParam;
|
|
10158
9848
|
}
|
|
@@ -10162,14 +9852,15 @@
|
|
|
10162
9852
|
if (disabledActionReason) {
|
|
10163
9853
|
queryParams[Param.DisableActionReason] = disabledActionReason;
|
|
10164
9854
|
}
|
|
10165
|
-
queryParams[Param.HideActions] = [
|
|
9855
|
+
queryParams[Param.HideActions] = [
|
|
9856
|
+
...this.defaultHiddenActions,
|
|
9857
|
+
...(hiddenActions !== null && hiddenActions !== void 0 ? hiddenActions : []),
|
|
9858
|
+
];
|
|
10166
9859
|
if (Array.isArray(visibleActions)) {
|
|
10167
9860
|
queryParams[Param.VisibleActions] = visibleActions;
|
|
10168
9861
|
}
|
|
10169
|
-
/**
|
|
10170
|
-
*
|
|
10171
|
-
* from version 9.2.0.cl the user have an option to override context
|
|
10172
|
-
* menu click
|
|
9862
|
+
/** Default behavior for context menu will be left-click
|
|
9863
|
+
* from version 9.2.0.cl the user have an option to override context menu click
|
|
10173
9864
|
*/
|
|
10174
9865
|
if (contextMenuTrigger === ContextMenuTriggerOptions.LEFT_CLICK) {
|
|
10175
9866
|
queryParams[Param.ContextMenuTrigger] = true;
|
|
@@ -10201,61 +9892,32 @@
|
|
|
10201
9892
|
/**
|
|
10202
9893
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
10203
9894
|
* This is used for embedding Liveboards, visualizations, and full application.
|
|
10204
|
-
*
|
|
10205
9895
|
* @param queryString The query string to append to the URL.
|
|
10206
9896
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
10207
9897
|
* the full application.
|
|
10208
9898
|
*/
|
|
10209
|
-
getV1EmbedBasePath(queryString) {
|
|
10210
|
-
const
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
const
|
|
9899
|
+
getV1EmbedBasePath(queryString, showPrimaryNavbar = false, disableProfileAndHelp = false, isAppEmbed = false, enableSearchAssist = false) {
|
|
9900
|
+
const queryStringFrag = queryString ? `&${queryString}` : '';
|
|
9901
|
+
const primaryNavParam = `&primaryNavHidden=${!showPrimaryNavbar}`;
|
|
9902
|
+
const disableProfileAndHelpParam = `&profileAndHelpInNavBarHidden=${disableProfileAndHelp}`;
|
|
9903
|
+
const enableSearchAssistParam = `&${Param.EnableSearchAssist}=${enableSearchAssist}`;
|
|
9904
|
+
let queryParams = `?embedApp=true${isAppEmbed ? primaryNavParam : ''}${isAppEmbed ? disableProfileAndHelpParam : ''}${enableSearchAssist ? enableSearchAssistParam : ''}${queryStringFrag}`;
|
|
9905
|
+
if (this.shouldEncodeUrlQueryParams) {
|
|
9906
|
+
queryParams = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryParams.substr(1))}`;
|
|
9907
|
+
}
|
|
9908
|
+
let path = `${this.thoughtSpotHost}/${queryParams}#`;
|
|
9909
|
+
if (!isAppEmbed) {
|
|
9910
|
+
path = `${path}/embed`;
|
|
9911
|
+
}
|
|
10214
9912
|
return path;
|
|
10215
9913
|
}
|
|
10216
|
-
getEmbedParams() {
|
|
10217
|
-
const queryParams = this.getBaseQueryParams();
|
|
10218
|
-
return getQueryParamString(queryParams);
|
|
10219
|
-
}
|
|
10220
|
-
getRootIframeSrc() {
|
|
10221
|
-
const query = this.getEmbedParams();
|
|
10222
|
-
return this.getEmbedBasePath(query);
|
|
10223
|
-
}
|
|
10224
|
-
createIframeEl(frameSrc) {
|
|
10225
|
-
const iFrame = document.createElement('iframe');
|
|
10226
|
-
iFrame.src = frameSrc;
|
|
10227
|
-
iFrame.id = TS_EMBED_ID;
|
|
10228
|
-
// according to screenfull.js documentation
|
|
10229
|
-
// allowFullscreen, webkitallowfullscreen and mozallowfullscreen must be
|
|
10230
|
-
// true
|
|
10231
|
-
iFrame.allowFullscreen = true;
|
|
10232
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10233
|
-
// @ts-ignore
|
|
10234
|
-
iFrame.webkitallowfullscreen = true;
|
|
10235
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10236
|
-
// @ts-ignore
|
|
10237
|
-
iFrame.mozallowfullscreen = true;
|
|
10238
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10239
|
-
// @ts-ignore
|
|
10240
|
-
iFrame.allow = 'clipboard-read; clipboard-write';
|
|
10241
|
-
const { height: frameHeight, width: frameWidth, ...restParams } = this.viewConfig.frameParams || {};
|
|
10242
|
-
const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
|
|
10243
|
-
const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
|
|
10244
|
-
setAttributes(iFrame, restParams);
|
|
10245
|
-
iFrame.style.width = `${width}`;
|
|
10246
|
-
iFrame.style.height = `${height}`;
|
|
10247
|
-
iFrame.style.border = '0';
|
|
10248
|
-
iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
10249
|
-
return iFrame;
|
|
10250
|
-
}
|
|
10251
9914
|
/**
|
|
10252
9915
|
* Renders the embedded ThoughtSpot app in an iframe and sets up
|
|
10253
9916
|
* event listeners.
|
|
10254
|
-
*
|
|
10255
9917
|
* @param url
|
|
10256
9918
|
* @param frameOptions
|
|
10257
9919
|
*/
|
|
10258
|
-
async renderIFrame(url) {
|
|
9920
|
+
async renderIFrame(url, frameOptions = {}) {
|
|
10259
9921
|
if (this.isError) {
|
|
10260
9922
|
return null;
|
|
10261
9923
|
}
|
|
@@ -10279,7 +9941,30 @@
|
|
|
10279
9941
|
return;
|
|
10280
9942
|
}
|
|
10281
9943
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
10282
|
-
this.iFrame =
|
|
9944
|
+
this.iFrame =
|
|
9945
|
+
this.iFrame || document.createElement('iframe');
|
|
9946
|
+
this.iFrame.src = url;
|
|
9947
|
+
this.iFrame.id = TS_EMBED_ID;
|
|
9948
|
+
// according to screenfull.js documentation
|
|
9949
|
+
// allowFullscreen, webkitallowfullscreen and mozallowfullscreen must be true
|
|
9950
|
+
this.iFrame.allowFullscreen = true;
|
|
9951
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9952
|
+
// @ts-ignore
|
|
9953
|
+
this.iFrame.webkitallowfullscreen = true;
|
|
9954
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9955
|
+
// @ts-ignore
|
|
9956
|
+
this.iFrame.mozallowfullscreen = true;
|
|
9957
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9958
|
+
// @ts-ignore
|
|
9959
|
+
this.iFrame.allow = 'clipboard-read; clipboard-write';
|
|
9960
|
+
const { height: frameHeight, width: frameWidth, ...restParams } = frameOptions;
|
|
9961
|
+
const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
|
|
9962
|
+
const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
|
|
9963
|
+
setAttributes(this.iFrame, restParams);
|
|
9964
|
+
this.iFrame.style.width = `${width}`;
|
|
9965
|
+
this.iFrame.style.height = `${height}`;
|
|
9966
|
+
this.iFrame.style.border = '0';
|
|
9967
|
+
this.iFrame.name = 'ThoughtSpot Embedded Analytics';
|
|
10283
9968
|
this.iFrame.addEventListener('load', () => {
|
|
10284
9969
|
nextInQueue();
|
|
10285
9970
|
const loadTimestamp = Date.now();
|
|
@@ -10306,9 +9991,7 @@
|
|
|
10306
9991
|
this.subscribeToEvents();
|
|
10307
9992
|
}).catch((error) => {
|
|
10308
9993
|
nextInQueue();
|
|
10309
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
10310
|
-
error: JSON.stringify(error),
|
|
10311
|
-
});
|
|
9994
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, { error: JSON.stringify(error) });
|
|
10312
9995
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
10313
9996
|
this.handleError(error);
|
|
10314
9997
|
});
|
|
@@ -10342,7 +10025,6 @@
|
|
|
10342
10025
|
}
|
|
10343
10026
|
/**
|
|
10344
10027
|
* Sets the height of the iframe
|
|
10345
|
-
*
|
|
10346
10028
|
* @param height The height in pixels
|
|
10347
10029
|
*/
|
|
10348
10030
|
setIFrameHeight(height) {
|
|
@@ -10350,7 +10032,6 @@
|
|
|
10350
10032
|
}
|
|
10351
10033
|
/**
|
|
10352
10034
|
* Executes all registered event handlers for a particular event type
|
|
10353
|
-
*
|
|
10354
10035
|
* @param eventType The event type
|
|
10355
10036
|
* @param data The payload invoked with the event handler
|
|
10356
10037
|
* @param eventPort The event Port for a specific MessageChannel
|
|
@@ -10361,13 +10042,11 @@
|
|
|
10361
10042
|
callbacks.push(...allHandlers);
|
|
10362
10043
|
const dataStatus = (data === null || data === void 0 ? void 0 : data.status) || embedEventStatus.END;
|
|
10363
10044
|
callbacks.forEach((callbackObj) => {
|
|
10364
|
-
if (
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
// payload
|
|
10370
|
-
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
10045
|
+
if ((callbackObj.options.start &&
|
|
10046
|
+
dataStatus === embedEventStatus.START) || // When start status is true it trigger only start releated payload
|
|
10047
|
+
(!callbackObj.options.start &&
|
|
10048
|
+
dataStatus === embedEventStatus.END) // When start status is false it trigger only end releated payload
|
|
10049
|
+
) {
|
|
10371
10050
|
callbackObj.callback(data, (payload) => {
|
|
10372
10051
|
this.triggerEventOnPort(eventPort, payload);
|
|
10373
10052
|
});
|
|
@@ -10382,7 +10061,6 @@
|
|
|
10382
10061
|
}
|
|
10383
10062
|
/**
|
|
10384
10063
|
* Gets the v1 event type (if applicable) for the EmbedEvent type
|
|
10385
|
-
*
|
|
10386
10064
|
* @param eventType The v2 event type
|
|
10387
10065
|
* @returns The corresponding v1 event type if one exists
|
|
10388
10066
|
* or else the v2 event type itself
|
|
@@ -10394,7 +10072,6 @@
|
|
|
10394
10072
|
* Calculates the iframe center for the current visible viewPort
|
|
10395
10073
|
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
10396
10074
|
* in Host app. ViewPort height of the tab.
|
|
10397
|
-
*
|
|
10398
10075
|
* @returns iframe Center in visible viewport,
|
|
10399
10076
|
* Iframe height,
|
|
10400
10077
|
* View port height.
|
|
@@ -10408,7 +10085,8 @@
|
|
|
10408
10085
|
let iframeVisibleViewPort;
|
|
10409
10086
|
let iframeOffset;
|
|
10410
10087
|
if (iframeScrolled < 0) {
|
|
10411
|
-
iframeVisibleViewPort =
|
|
10088
|
+
iframeVisibleViewPort =
|
|
10089
|
+
viewPortHeight - (offsetTopClient - scrollTopClient);
|
|
10412
10090
|
iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
|
|
10413
10091
|
iframeOffset = 0;
|
|
10414
10092
|
}
|
|
@@ -10459,11 +10137,8 @@
|
|
|
10459
10137
|
/**
|
|
10460
10138
|
* Triggers an event on specific Port registered against
|
|
10461
10139
|
* for the EmbedEvent
|
|
10462
|
-
*
|
|
10463
10140
|
* @param eventType The message type
|
|
10464
10141
|
* @param data The payload to send
|
|
10465
|
-
* @param eventPort
|
|
10466
|
-
* @param payload
|
|
10467
10142
|
*/
|
|
10468
10143
|
triggerEventOnPort(eventPort, payload) {
|
|
10469
10144
|
if (eventPort) {
|
|
@@ -10484,7 +10159,6 @@
|
|
|
10484
10159
|
}
|
|
10485
10160
|
/**
|
|
10486
10161
|
* Triggers an event to the embedded app
|
|
10487
|
-
*
|
|
10488
10162
|
* @param messageType The event type
|
|
10489
10163
|
* @param data The payload to send with the message
|
|
10490
10164
|
*/
|
|
@@ -10496,7 +10170,6 @@
|
|
|
10496
10170
|
* Marks the ThoughtSpot object to have been rendered
|
|
10497
10171
|
* Needs to be overridden by subclasses to do the actual
|
|
10498
10172
|
* rendering of the iframe.
|
|
10499
|
-
*
|
|
10500
10173
|
* @param args
|
|
10501
10174
|
*/
|
|
10502
10175
|
render() {
|
|
@@ -10507,7 +10180,6 @@
|
|
|
10507
10180
|
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
10508
10181
|
* host app URL.
|
|
10509
10182
|
* THOUGHTSPOT URL params starts with a prefix "ts-"
|
|
10510
|
-
*
|
|
10511
10183
|
* @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
10512
10184
|
*/
|
|
10513
10185
|
getThoughtSpotPostUrlParams() {
|
|
@@ -10531,7 +10203,6 @@
|
|
|
10531
10203
|
}
|
|
10532
10204
|
/**
|
|
10533
10205
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
10534
|
-
*
|
|
10535
10206
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
10536
10207
|
*/
|
|
10537
10208
|
destroy() {
|
|
@@ -10542,13 +10213,6 @@
|
|
|
10542
10213
|
console.log('Error destroying TS Embed', e);
|
|
10543
10214
|
}
|
|
10544
10215
|
}
|
|
10545
|
-
getUnderlyingFrameElement() {
|
|
10546
|
-
return this.iFrame;
|
|
10547
|
-
}
|
|
10548
|
-
async prerenderGeneric() {
|
|
10549
|
-
const prerenderFrameSrc = this.getRootIframeSrc();
|
|
10550
|
-
return this.renderIFrame(prerenderFrameSrc);
|
|
10551
|
-
}
|
|
10552
10216
|
}
|
|
10553
10217
|
/**
|
|
10554
10218
|
* Base class for embedding v1 experience
|
|
@@ -10564,21 +10228,14 @@
|
|
|
10564
10228
|
}
|
|
10565
10229
|
/**
|
|
10566
10230
|
* Render the ap p in an iframe and set up event handlers
|
|
10567
|
-
*
|
|
10568
10231
|
* @param iframeSrc
|
|
10569
10232
|
*/
|
|
10570
10233
|
renderV1Embed(iframeSrc) {
|
|
10571
|
-
return this.renderIFrame(iframeSrc);
|
|
10572
|
-
}
|
|
10573
|
-
getRootIframeSrc() {
|
|
10574
|
-
const runtimeFilters = this.viewConfig.runtimeFilters;
|
|
10575
|
-
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10576
|
-
const queryParams = this.getEmbedParams();
|
|
10577
|
-
const queryString = [filterQuery, queryParams].filter(Boolean).join('&');
|
|
10578
|
-
return this.getV1EmbedBasePath(queryString);
|
|
10234
|
+
return this.renderIFrame(iframeSrc, this.viewConfig.frameParams);
|
|
10579
10235
|
}
|
|
10580
10236
|
/**
|
|
10581
|
-
* @inheritdoc
|
|
10237
|
+
* @inheritdoc TsEmbed.on
|
|
10238
|
+
*
|
|
10582
10239
|
* @example
|
|
10583
10240
|
* ```js
|
|
10584
10241
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -10643,7 +10300,6 @@
|
|
|
10643
10300
|
})(exports.Page || (exports.Page = {}));
|
|
10644
10301
|
/**
|
|
10645
10302
|
* Embeds full ThoughtSpot experience in a host application.
|
|
10646
|
-
*
|
|
10647
10303
|
* @group Embed components
|
|
10648
10304
|
*/
|
|
10649
10305
|
class AppEmbed extends V1Embed {
|
|
@@ -10656,12 +10312,8 @@
|
|
|
10656
10312
|
* embedded Liveboard or visualization.
|
|
10657
10313
|
*/
|
|
10658
10314
|
getEmbedParams() {
|
|
10659
|
-
const
|
|
10660
|
-
|
|
10661
|
-
params[Param.EmbedApp] = true;
|
|
10662
|
-
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
10663
|
-
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
10664
|
-
params = this.getBaseQueryParams(params);
|
|
10315
|
+
const params = this.getBaseQueryParams();
|
|
10316
|
+
const { tag, hideObjects, liveboardV2 } = this.viewConfig;
|
|
10665
10317
|
if (tag) {
|
|
10666
10318
|
params[Param.Tag] = tag;
|
|
10667
10319
|
}
|
|
@@ -10671,28 +10323,26 @@
|
|
|
10671
10323
|
if (liveboardV2 !== undefined) {
|
|
10672
10324
|
params[Param.LiveboardV2Enabled] = liveboardV2;
|
|
10673
10325
|
}
|
|
10674
|
-
if (enableSearchAssist !== undefined) {
|
|
10675
|
-
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
10676
|
-
}
|
|
10677
10326
|
const queryParams = getQueryParamString(params, true);
|
|
10678
10327
|
return queryParams;
|
|
10679
10328
|
}
|
|
10680
10329
|
/**
|
|
10681
10330
|
* Constructs the URL of the ThoughtSpot app page to be rendered.
|
|
10682
|
-
*
|
|
10683
10331
|
* @param pageId The ID of the page to be embedded.
|
|
10684
10332
|
*/
|
|
10685
|
-
getIFrameSrc() {
|
|
10686
|
-
const
|
|
10687
|
-
const
|
|
10688
|
-
|
|
10333
|
+
getIFrameSrc(pageId, runtimeFilters) {
|
|
10334
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10335
|
+
const queryParams = this.getEmbedParams();
|
|
10336
|
+
const queryString = [filterQuery, queryParams]
|
|
10337
|
+
.filter(Boolean)
|
|
10338
|
+
.join('&');
|
|
10339
|
+
let url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true, this.viewConfig.enableSearchAssist)}/${pageId}`;
|
|
10689
10340
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
10690
10341
|
url = `${url}${tsPostHashParams}`;
|
|
10691
10342
|
return url;
|
|
10692
10343
|
}
|
|
10693
10344
|
/**
|
|
10694
10345
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
10695
|
-
*
|
|
10696
10346
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
10697
10347
|
*/
|
|
10698
10348
|
getPageRoute(pageId) {
|
|
@@ -10716,7 +10366,6 @@
|
|
|
10716
10366
|
}
|
|
10717
10367
|
/**
|
|
10718
10368
|
* Formats the path provided by the user.
|
|
10719
|
-
*
|
|
10720
10369
|
* @param path The URL path.
|
|
10721
10370
|
* @returns The URL path that the embedded app understands.
|
|
10722
10371
|
*/
|
|
@@ -10732,13 +10381,10 @@
|
|
|
10732
10381
|
}
|
|
10733
10382
|
/**
|
|
10734
10383
|
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
10735
|
-
* This is used for embedding answers, pinboards, visualizations and full application
|
|
10736
|
-
* only.
|
|
10737
|
-
*
|
|
10384
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
10738
10385
|
* @param path string | number The string, set to iframe src and navigate to new page
|
|
10739
10386
|
* eg: appEmbed.navigateToPage('pinboards')
|
|
10740
|
-
* When used with `noReload`
|
|
10741
|
-
* like 1/-1 to go forward/back.
|
|
10387
|
+
* When used with `noReload` this can also be a number like 1/-1 to go forward/back.
|
|
10742
10388
|
* @param noReload boolean Trigger the navigation without reloading the page
|
|
10743
10389
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
10744
10390
|
*/
|
|
@@ -10763,13 +10409,14 @@
|
|
|
10763
10409
|
}
|
|
10764
10410
|
/**
|
|
10765
10411
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
10766
|
-
*
|
|
10767
10412
|
* @param renderOptions An object containing the page ID
|
|
10768
10413
|
* to be embedded.
|
|
10769
10414
|
*/
|
|
10770
10415
|
render() {
|
|
10771
10416
|
super.render();
|
|
10772
|
-
const
|
|
10417
|
+
const { pageId, runtimeFilters, path } = this.viewConfig;
|
|
10418
|
+
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId);
|
|
10419
|
+
const src = this.getIFrameSrc(pageRoute, runtimeFilters);
|
|
10773
10420
|
this.renderV1Embed(src);
|
|
10774
10421
|
return this;
|
|
10775
10422
|
}
|
|
@@ -10787,7 +10434,6 @@
|
|
|
10787
10434
|
*/
|
|
10788
10435
|
/**
|
|
10789
10436
|
* Embed a ThoughtSpot Liveboard or visualization
|
|
10790
|
-
*
|
|
10791
10437
|
* @group Embed components
|
|
10792
10438
|
*/
|
|
10793
10439
|
class LiveboardEmbed extends V1Embed {
|
|
@@ -10798,7 +10444,6 @@
|
|
|
10798
10444
|
/**
|
|
10799
10445
|
* Set the iframe height as per the computed height received
|
|
10800
10446
|
* from the ThoughtSpot app.
|
|
10801
|
-
*
|
|
10802
10447
|
* @param data The event payload
|
|
10803
10448
|
*/
|
|
10804
10449
|
this.updateIFrameHeight = (data) => {
|
|
@@ -10813,23 +10458,16 @@
|
|
|
10813
10458
|
this.setIFrameHeight(this.defaultHeight);
|
|
10814
10459
|
}
|
|
10815
10460
|
};
|
|
10816
|
-
if (this.viewConfig.fullHeight === true) {
|
|
10817
|
-
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
10818
|
-
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
10819
|
-
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
10820
|
-
}
|
|
10821
10461
|
}
|
|
10822
10462
|
/**
|
|
10823
10463
|
* Construct a map of params to be passed on to the
|
|
10824
10464
|
* embedded Liveboard or visualization.
|
|
10825
10465
|
*/
|
|
10826
10466
|
getEmbedParams() {
|
|
10827
|
-
|
|
10828
|
-
params[Param.EmbedApp] = true;
|
|
10829
|
-
params = this.getBaseQueryParams(params);
|
|
10467
|
+
const params = this.getBaseQueryParams();
|
|
10830
10468
|
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, activeTabId, } = this.viewConfig;
|
|
10831
|
-
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
10832
|
-
|
|
10469
|
+
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
|
|
10470
|
+
this.viewConfig.preventPinboardFilterRemoval;
|
|
10833
10471
|
if (fullHeight === true) {
|
|
10834
10472
|
params[Param.fullHeight] = true;
|
|
10835
10473
|
}
|
|
@@ -10855,68 +10493,65 @@
|
|
|
10855
10493
|
const queryParams = getQueryParamString(params, true);
|
|
10856
10494
|
return queryParams;
|
|
10857
10495
|
}
|
|
10858
|
-
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
10859
|
-
let suffix = `/embed/viz/${liveboardId}`;
|
|
10860
|
-
if (activeTabId) {
|
|
10861
|
-
suffix = `${suffix}/tab/${activeTabId} `;
|
|
10862
|
-
}
|
|
10863
|
-
if (vizId) {
|
|
10864
|
-
suffix = `${suffix}/${vizId}`;
|
|
10865
|
-
}
|
|
10866
|
-
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
10867
|
-
suffix = `${suffix}${tsPostHashParams}`;
|
|
10868
|
-
return suffix;
|
|
10869
|
-
}
|
|
10870
10496
|
/**
|
|
10871
10497
|
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
10872
10498
|
* to be loaded within the iframe.
|
|
10499
|
+
* @param liveboardId The GUID of the Liveboard.
|
|
10500
|
+
* @param vizId The optional GUID of a visualization within the Liveboard.
|
|
10501
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
10502
|
+
* the Liveboard or visualization on load.
|
|
10873
10503
|
*/
|
|
10874
|
-
getIFrameSrc() {
|
|
10875
|
-
|
|
10876
|
-
const
|
|
10877
|
-
const
|
|
10878
|
-
|
|
10879
|
-
|
|
10504
|
+
getIFrameSrc(liveboardId, vizId, runtimeFilters, activeTabId) {
|
|
10505
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
10506
|
+
const queryParams = this.getEmbedParams();
|
|
10507
|
+
const queryString = [filterQuery, queryParams]
|
|
10508
|
+
.filter(Boolean)
|
|
10509
|
+
.join('&');
|
|
10510
|
+
let url = `${this.getV1EmbedBasePath(queryString, true, false, false)}/viz/${liveboardId}`;
|
|
10511
|
+
if (activeTabId) {
|
|
10512
|
+
url = `${url}/tab/${activeTabId}`;
|
|
10513
|
+
}
|
|
10514
|
+
if (vizId) {
|
|
10515
|
+
url = `${url}/${vizId}`;
|
|
10880
10516
|
}
|
|
10881
|
-
|
|
10517
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
10518
|
+
url = `${url}${tsPostHashParams}`;
|
|
10519
|
+
return url;
|
|
10882
10520
|
}
|
|
10883
10521
|
/**
|
|
10884
10522
|
* Triggers an event to the embedded app
|
|
10885
|
-
*
|
|
10886
10523
|
* @param messageType The event type
|
|
10887
10524
|
* @param data The payload to send with the message
|
|
10888
10525
|
*/
|
|
10889
10526
|
trigger(messageType, data = {}) {
|
|
10890
10527
|
const dataWithVizId = data;
|
|
10891
|
-
if (
|
|
10528
|
+
if (this.viewConfig.vizId) {
|
|
10892
10529
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
10893
10530
|
}
|
|
10894
10531
|
return super.trigger(messageType, dataWithVizId);
|
|
10895
10532
|
}
|
|
10896
10533
|
/**
|
|
10897
10534
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
10898
|
-
*
|
|
10899
10535
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
10900
10536
|
* visualization ID and the runtime filters.
|
|
10901
10537
|
*/
|
|
10902
10538
|
render() {
|
|
10539
|
+
var _a;
|
|
10540
|
+
const { vizId, activeTabId, runtimeFilters } = this.viewConfig;
|
|
10541
|
+
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
10542
|
+
if (!liveboardId) {
|
|
10543
|
+
this.handleError(ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION);
|
|
10544
|
+
}
|
|
10545
|
+
if (this.viewConfig.fullHeight === true) {
|
|
10546
|
+
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
10547
|
+
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
10548
|
+
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
10549
|
+
}
|
|
10903
10550
|
super.render();
|
|
10904
|
-
const src = this.getIFrameSrc();
|
|
10551
|
+
const src = this.getIFrameSrc(liveboardId, vizId, runtimeFilters, activeTabId);
|
|
10905
10552
|
this.renderV1Embed(src);
|
|
10906
10553
|
return this;
|
|
10907
10554
|
}
|
|
10908
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
10909
|
-
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
10910
|
-
this.viewConfig.liveboardId = liveboardId;
|
|
10911
|
-
this.viewConfig.activeTabId = activeTabId;
|
|
10912
|
-
this.viewConfig.vizId = vizId;
|
|
10913
|
-
if (this.isAppInitialized) {
|
|
10914
|
-
this.trigger(exports.HostEvent.Navigate, path.substring(1));
|
|
10915
|
-
}
|
|
10916
|
-
else {
|
|
10917
|
-
this.render();
|
|
10918
|
-
}
|
|
10919
|
-
}
|
|
10920
10555
|
}
|
|
10921
10556
|
/**
|
|
10922
10557
|
* @hidden
|
|
@@ -10963,9 +10598,16 @@
|
|
|
10963
10598
|
}
|
|
10964
10599
|
return dataSourceMode;
|
|
10965
10600
|
}
|
|
10966
|
-
|
|
10601
|
+
/**
|
|
10602
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
10603
|
+
* loaded in the iframe
|
|
10604
|
+
* @param answerId The GUID of a saved answer
|
|
10605
|
+
* @param dataSources A list of data source GUIDs
|
|
10606
|
+
*/
|
|
10607
|
+
getIFrameSrc(answerId, dataSources) {
|
|
10967
10608
|
var _a;
|
|
10968
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource,
|
|
10609
|
+
const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, } = this.viewConfig;
|
|
10610
|
+
const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
|
|
10969
10611
|
const queryParams = this.getBaseQueryParams();
|
|
10970
10612
|
queryParams[Param.HideActions] = [
|
|
10971
10613
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -11004,28 +10646,17 @@
|
|
|
11004
10646
|
if (filterQuery) {
|
|
11005
10647
|
query += `&${filterQuery}`;
|
|
11006
10648
|
}
|
|
11007
|
-
return query;
|
|
11008
|
-
}
|
|
11009
|
-
/**
|
|
11010
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
11011
|
-
* loaded in the iframe
|
|
11012
|
-
*
|
|
11013
|
-
* @param answerId The GUID of a saved answer
|
|
11014
|
-
* @param dataSources A list of data source GUIDs
|
|
11015
|
-
*/
|
|
11016
|
-
getIFrameSrc(answerId) {
|
|
11017
|
-
const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
|
|
11018
10649
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11019
|
-
return `${this.
|
|
10650
|
+
return `${this.getEmbedBasePath(query)}/${answerPath}${tsPostHashParams}`;
|
|
11020
10651
|
}
|
|
11021
10652
|
/**
|
|
11022
10653
|
* Render the embedded ThoughtSpot search
|
|
11023
10654
|
*/
|
|
11024
10655
|
render() {
|
|
11025
10656
|
super.render();
|
|
11026
|
-
const { answerId } = this.viewConfig;
|
|
11027
|
-
const src = this.getIFrameSrc(answerId);
|
|
11028
|
-
this.renderIFrame(src);
|
|
10657
|
+
const { answerId, dataSources } = this.viewConfig;
|
|
10658
|
+
const src = this.getIFrameSrc(answerId, dataSources);
|
|
10659
|
+
this.renderIFrame(src, this.viewConfig.frameParams);
|
|
11029
10660
|
getAuthPromise().then(() => {
|
|
11030
10661
|
if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSearchEmbedBetaWarning)) {
|
|
11031
10662
|
alert(ERROR_MESSAGE.SEARCHEMBED_BETA_WRANING_MESSAGE);
|
|
@@ -11049,7 +10680,6 @@
|
|
|
11049
10680
|
/**
|
|
11050
10681
|
* Construct the URL of the embedded ThoughtSpot search to be
|
|
11051
10682
|
* loaded in the iframe
|
|
11052
|
-
*
|
|
11053
10683
|
* @param dataSources A list of data source GUIDs
|
|
11054
10684
|
*/
|
|
11055
10685
|
getIFrameSrc() {
|
|
@@ -11057,7 +10687,9 @@
|
|
|
11057
10687
|
const { searchOptions, dataSource, dataSources } = this.viewConfig;
|
|
11058
10688
|
const path = 'search-bar-embed';
|
|
11059
10689
|
const queryParams = this.getBaseQueryParams();
|
|
11060
|
-
queryParams[Param.HideActions] = [
|
|
10690
|
+
queryParams[Param.HideActions] = [
|
|
10691
|
+
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
10692
|
+
];
|
|
11061
10693
|
if (dataSources && dataSources.length) {
|
|
11062
10694
|
queryParams[Param.DataSources] = JSON.stringify(dataSources);
|
|
11063
10695
|
}
|
|
@@ -11078,7 +10710,7 @@
|
|
|
11078
10710
|
query = `?${queryParamsString}`;
|
|
11079
10711
|
}
|
|
11080
10712
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
11081
|
-
return `${this.getEmbedBasePath(query)}
|
|
10713
|
+
return `${this.getEmbedBasePath(query)}/${path}${tsPostHashParams}`;
|
|
11082
10714
|
}
|
|
11083
10715
|
/**
|
|
11084
10716
|
* Render the embedded ThoughtSpot search
|
|
@@ -11086,7 +10718,7 @@
|
|
|
11086
10718
|
render() {
|
|
11087
10719
|
super.render();
|
|
11088
10720
|
const src = this.getIFrameSrc();
|
|
11089
|
-
this.renderIFrame(src);
|
|
10721
|
+
this.renderIFrame(src, this.viewConfig.frameParams);
|
|
11090
10722
|
return this;
|
|
11091
10723
|
}
|
|
11092
10724
|
}
|