@thoughtspot/visual-embed-sdk 1.29.2 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/authToken.d.ts +1 -1
- package/cjs/src/authToken.js +1 -1
- package/cjs/src/embed/app.d.ts +1 -4
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +2 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +6 -6
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -5
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -4
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +9 -18
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +21 -54
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +20 -47
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -2
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +2 -2
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +43 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils/graphql/graphql-request.d.ts.map +1 -1
- package/cjs/src/utils/graphql/graphql-request.js +2 -1
- package/cjs/src/utils/graphql/graphql-request.js.map +1 -1
- package/dist/src/authToken.d.ts +1 -1
- package/dist/src/embed/app.d.ts +1 -4
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -5
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/types.d.ts +21 -54
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -2
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/graphql/graphql-request.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +26 -53
- package/dist/tsembed-react.js +26 -53
- package/dist/tsembed.es.js +1563 -1590
- package/dist/tsembed.js +3139 -3166
- package/dist/visual-embed-sdk-react-full.d.ts +24 -64
- package/dist/visual-embed-sdk-react.d.ts +24 -64
- package/dist/visual-embed-sdk.d.ts +24 -64
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts +1 -1
- package/lib/src/authToken.js +1 -1
- package/lib/src/embed/app.d.ts +1 -4
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +2 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +5 -5
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -5
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +5 -5
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +9 -18
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +21 -54
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +20 -47
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -2
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +2 -2
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +44 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils/graphql/graphql-request.d.ts.map +1 -1
- package/lib/src/utils/graphql/graphql-request.js +2 -1
- package/lib/src/utils/graphql/graphql-request.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +27 -67
- package/package.json +1 -1
- package/src/authToken.ts +1 -1
- package/src/embed/app.ts +14 -16
- package/src/embed/base.ts +14 -15
- package/src/embed/search.spec.ts +1 -2
- package/src/embed/search.ts +15 -21
- package/src/embed/ts-embed.spec.ts +24 -37
- package/src/types.ts +26 -60
- package/src/utils/graphql/answerService/answerService.spec.ts +53 -1
- package/src/utils/graphql/answerService/answerService.ts +2 -2
- package/src/utils/graphql/graphql-request.ts +2 -1
package/dist/tsembed.es.js
CHANGED
|
@@ -1,1620 +1,1912 @@
|
|
|
1
|
+
// istanbul ignore next
|
|
2
|
+
const isObject = (obj) => {
|
|
3
|
+
if (typeof obj === "object" && obj !== null) {
|
|
4
|
+
if (typeof Object.getPrototypeOf === "function") {
|
|
5
|
+
const prototype = Object.getPrototypeOf(obj);
|
|
6
|
+
return prototype === Object.prototype || prototype === null;
|
|
7
|
+
}
|
|
8
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
};
|
|
12
|
+
const merge = (...objects) => objects.reduce((result, current) => {
|
|
13
|
+
if (Array.isArray(current)) {
|
|
14
|
+
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
15
|
+
}
|
|
16
|
+
Object.keys(current).forEach((key) => {
|
|
17
|
+
if (["__proto__", "constructor", "prototype"].includes(key)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
21
|
+
result[key] = merge.options.mergeArrays
|
|
22
|
+
? Array.from(new Set(result[key].concat(current[key])))
|
|
23
|
+
: current[key];
|
|
24
|
+
}
|
|
25
|
+
else if (isObject(result[key]) && isObject(current[key])) {
|
|
26
|
+
result[key] = merge(result[key], current[key]);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
result[key] = current[key];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return result;
|
|
33
|
+
}, {});
|
|
34
|
+
const defaultOptions = {
|
|
35
|
+
mergeArrays: true,
|
|
36
|
+
};
|
|
37
|
+
merge.options = defaultOptions;
|
|
38
|
+
merge.withOptions = (options, ...objects) => {
|
|
39
|
+
merge.options = Object.assign({ mergeArrays: true }, options);
|
|
40
|
+
const result = merge(...objects);
|
|
41
|
+
merge.options = defaultOptions;
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
|
|
1
45
|
/**
|
|
2
46
|
* Copyright (c) 2023
|
|
3
47
|
*
|
|
4
|
-
*
|
|
5
|
-
* @summary
|
|
48
|
+
* Common utility functions for ThoughtSpot Visual Embed SDK
|
|
49
|
+
* @summary Utils
|
|
6
50
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
7
51
|
*/
|
|
8
52
|
/**
|
|
9
|
-
*
|
|
10
|
-
* the
|
|
11
|
-
*
|
|
53
|
+
* Construct a runtime filters query string from the given filters.
|
|
54
|
+
* Refer to the following docs for more details on runtime filter syntax:
|
|
55
|
+
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/apply-runtime-filter.html
|
|
56
|
+
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/runtime-filter-operators.html
|
|
57
|
+
* @param runtimeFilters
|
|
12
58
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
31
|
-
* if SSO is not configured on ThoughtSpot.
|
|
32
|
-
*
|
|
33
|
-
* To use this:
|
|
34
|
-
* Your SAML or OpenID provider must allow iframe redirects.
|
|
35
|
-
* For example, if you are using Okta as IdP, you can enable iframe embedding.
|
|
36
|
-
* @example
|
|
37
|
-
* ```js
|
|
38
|
-
* init({
|
|
39
|
-
* // ...
|
|
40
|
-
* authType: AuthType.EmbeddedSSO,
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
* @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
|
|
44
|
-
*/
|
|
45
|
-
AuthType["EmbeddedSSO"] = "EmbeddedSSO";
|
|
46
|
-
/**
|
|
47
|
-
* SSO using SAML
|
|
48
|
-
* @deprecated Use {@link SAMLRedirect} instead
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
AuthType["SSO"] = "SSO_SAML";
|
|
52
|
-
/**
|
|
53
|
-
* SSO using SAML
|
|
54
|
-
* @deprecated Use {@link SAMLRedirect} instead
|
|
55
|
-
* @hidden
|
|
56
|
-
*/
|
|
57
|
-
AuthType["SAML"] = "SSO_SAML";
|
|
58
|
-
/**
|
|
59
|
-
* SSO using SAML
|
|
60
|
-
* Makes the host application redirect to the SAML IdP. Use this
|
|
61
|
-
* if your IdP does not allow itself to be embedded.
|
|
62
|
-
*
|
|
63
|
-
* This redirects the host application to the SAML IdP. The host application
|
|
64
|
-
* will be redirected back to the ThoughtSpot app after authentication.
|
|
65
|
-
* @example
|
|
66
|
-
* ```js
|
|
67
|
-
* init({
|
|
68
|
-
* // ...
|
|
69
|
-
* authType: AuthType.SAMLRedirect,
|
|
70
|
-
* });
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* This opens the SAML IdP in a popup window. The popup is triggered
|
|
74
|
-
* when the user clicks the trigger button. The popup window will be
|
|
75
|
-
* closed automatically after authentication.
|
|
76
|
-
* @example
|
|
77
|
-
* ```js
|
|
78
|
-
* init({
|
|
79
|
-
* // ...
|
|
80
|
-
* authType: AuthType.SAMLRedirect,
|
|
81
|
-
* authTriggerText: 'Login with SAML',
|
|
82
|
-
* authTriggerContainer: '#embed-container',
|
|
83
|
-
* inPopup: true,
|
|
84
|
-
* });
|
|
85
|
-
* ```
|
|
86
|
-
*
|
|
87
|
-
* Can also use the event to trigger the popup flow. Works the same
|
|
88
|
-
* as the above example.
|
|
89
|
-
* @example
|
|
90
|
-
* ```js
|
|
91
|
-
* const authEE = init({
|
|
92
|
-
* // ...
|
|
93
|
-
* authType: AuthType.SAMLRedirect,
|
|
94
|
-
* inPopup: true,
|
|
95
|
-
* });
|
|
96
|
-
*
|
|
97
|
-
* someButtonOnYourPage.addEventListener('click', () => {
|
|
98
|
-
* authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
|
|
99
|
-
* });
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
103
|
-
/**
|
|
104
|
-
* SSO using OIDC
|
|
105
|
-
* @hidden
|
|
106
|
-
* @deprecated Use {@link OIDCRedirect} instead
|
|
107
|
-
*/
|
|
108
|
-
AuthType["OIDC"] = "SSO_OIDC";
|
|
109
|
-
/**
|
|
110
|
-
* SSO using OIDC
|
|
111
|
-
* Will make the host application redirect to the OIDC IdP.
|
|
112
|
-
* See code samples in {@link SAMLRedirect}.
|
|
113
|
-
*/
|
|
114
|
-
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
115
|
-
/**
|
|
116
|
-
* Trusted authentication server
|
|
117
|
-
* @hidden
|
|
118
|
-
* @deprecated Use {@link TrustedAuth} instead
|
|
119
|
-
*/
|
|
120
|
-
AuthType["AuthServer"] = "AuthServer";
|
|
121
|
-
/**
|
|
122
|
-
* Trusted authentication server. Use your own authentication server
|
|
123
|
-
* which returns a bearer token, generated using the `secret_key` obtained
|
|
124
|
-
* from ThoughtSpot.
|
|
125
|
-
* @example
|
|
126
|
-
* ```js
|
|
127
|
-
* init({
|
|
128
|
-
* // ...
|
|
129
|
-
* authType: AuthType.TrustedAuthToken,
|
|
130
|
-
* getAuthToken: () => {
|
|
131
|
-
* return fetch('https://my-backend.app/ts-token')
|
|
132
|
-
* .then((response) => response.json())
|
|
133
|
-
* .then((data) => data.token);
|
|
134
|
-
* }
|
|
135
|
-
* });
|
|
136
|
-
* });
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
140
|
-
/**
|
|
141
|
-
* Trusted authentication server Cookieless, Use your own authentication
|
|
142
|
-
* server which returns a bearer token, generated using the `secret_key`
|
|
143
|
-
* obtained from ThoughtSpot. This uses a cookieless authentication
|
|
144
|
-
* approach, recommended to bypass the third-party cookie-blocking restriction
|
|
145
|
-
* implemented by some browsers.
|
|
146
|
-
* @example
|
|
147
|
-
* ```js
|
|
148
|
-
* init({
|
|
149
|
-
* // ...
|
|
150
|
-
* authType: AuthType.TrustedAuthTokenCookieless,
|
|
151
|
-
* getAuthToken: () => {
|
|
152
|
-
* return fetch('https://my-backend.app/ts-token')
|
|
153
|
-
* .then((response) => response.json())
|
|
154
|
-
* .then((data) => data.token);
|
|
155
|
-
* }
|
|
156
|
-
* ```
|
|
157
|
-
* @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
|
|
158
|
-
*/
|
|
159
|
-
AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
|
|
160
|
-
/**
|
|
161
|
-
* Use the ThoughtSpot login API to authenticate to the cluster directly.
|
|
162
|
-
*
|
|
163
|
-
* Warning: This feature is primarily intended for developer testing. It is
|
|
164
|
-
* strongly advised not to use this authentication method in production.
|
|
165
|
-
*/
|
|
166
|
-
AuthType["Basic"] = "Basic";
|
|
167
|
-
})(AuthType || (AuthType = {}));
|
|
59
|
+
const getFilterQuery = (runtimeFilters) => {
|
|
60
|
+
if (runtimeFilters && runtimeFilters.length) {
|
|
61
|
+
const filters = runtimeFilters.map((filter, valueIndex) => {
|
|
62
|
+
const index = valueIndex + 1;
|
|
63
|
+
const filterExpr = [];
|
|
64
|
+
filterExpr.push(`col${index}=${encodeURIComponent(filter.columnName)}`);
|
|
65
|
+
filterExpr.push(`op${index}=${filter.operator}`);
|
|
66
|
+
filterExpr.push(filter.values.map((value) => {
|
|
67
|
+
const encodedValue = typeof value === 'bigint' ? value.toString() : value;
|
|
68
|
+
return `val${index}=${encodeURIComponent(String(encodedValue))}`;
|
|
69
|
+
}).join('&'));
|
|
70
|
+
return filterExpr.join('&');
|
|
71
|
+
});
|
|
72
|
+
return `${filters.join('&')}`;
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
168
76
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* To access the updated modular homepage,
|
|
172
|
-
* set `modularHomeExperience` to `true`
|
|
173
|
-
* (available as Early Access feature in 9.12.5.cl).
|
|
174
|
-
*
|
|
77
|
+
* Construct a runtime parameter override query string from the given option.
|
|
78
|
+
* @param runtimeParameters
|
|
175
79
|
*/
|
|
176
|
-
|
|
177
|
-
(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
HomeLeftNavItem["Liveboards"] = "liveboards";
|
|
190
|
-
/**
|
|
191
|
-
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
192
|
-
*/
|
|
193
|
-
HomeLeftNavItem["Answers"] = "answers";
|
|
194
|
-
/**
|
|
195
|
-
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
196
|
-
*/
|
|
197
|
-
HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
|
|
198
|
-
/**
|
|
199
|
-
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
200
|
-
*/
|
|
201
|
-
HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
|
|
202
|
-
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
80
|
+
const getRuntimeParameters = (runtimeParameters) => {
|
|
81
|
+
if (runtimeParameters && runtimeParameters.length) {
|
|
82
|
+
const params = runtimeParameters.map((param, valueIndex) => {
|
|
83
|
+
const index = valueIndex + 1;
|
|
84
|
+
const filterExpr = [];
|
|
85
|
+
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
86
|
+
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
87
|
+
return filterExpr.join('&');
|
|
88
|
+
});
|
|
89
|
+
return `${params.join('&')}`;
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
};
|
|
203
93
|
/**
|
|
204
|
-
*
|
|
94
|
+
* Convert a value to a string representation to be sent as a query
|
|
95
|
+
* parameter to the ThoughtSpot app.
|
|
96
|
+
* @param value Any parameter value
|
|
205
97
|
*/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Does not equal
|
|
215
|
-
*/
|
|
216
|
-
RuntimeFilterOp["NE"] = "NE";
|
|
217
|
-
/**
|
|
218
|
-
* Less than
|
|
219
|
-
*/
|
|
220
|
-
RuntimeFilterOp["LT"] = "LT";
|
|
221
|
-
/**
|
|
222
|
-
* Less than or equal to
|
|
223
|
-
*/
|
|
224
|
-
RuntimeFilterOp["LE"] = "LE";
|
|
225
|
-
/**
|
|
226
|
-
* Greater than
|
|
227
|
-
*/
|
|
228
|
-
RuntimeFilterOp["GT"] = "GT";
|
|
229
|
-
/**
|
|
230
|
-
* Greater than or equal to
|
|
231
|
-
*/
|
|
232
|
-
RuntimeFilterOp["GE"] = "GE";
|
|
233
|
-
/**
|
|
234
|
-
* Contains
|
|
235
|
-
*/
|
|
236
|
-
RuntimeFilterOp["CONTAINS"] = "CONTAINS";
|
|
237
|
-
/**
|
|
238
|
-
* Begins with
|
|
239
|
-
*/
|
|
240
|
-
RuntimeFilterOp["BEGINS_WITH"] = "BEGINS_WITH";
|
|
241
|
-
/**
|
|
242
|
-
* Ends with
|
|
243
|
-
*/
|
|
244
|
-
RuntimeFilterOp["ENDS_WITH"] = "ENDS_WITH";
|
|
245
|
-
/**
|
|
246
|
-
* Between, inclusive of higher value
|
|
247
|
-
*/
|
|
248
|
-
RuntimeFilterOp["BW_INC_MAX"] = "BW_INC_MAX";
|
|
249
|
-
/**
|
|
250
|
-
* Between, inclusive of lower value
|
|
251
|
-
*/
|
|
252
|
-
RuntimeFilterOp["BW_INC_MIN"] = "BW_INC_MIN";
|
|
253
|
-
/**
|
|
254
|
-
* Between, inclusive of both higher and lower value
|
|
255
|
-
*/
|
|
256
|
-
RuntimeFilterOp["BW_INC"] = "BW_INC";
|
|
257
|
-
/**
|
|
258
|
-
* Between, non-inclusive
|
|
259
|
-
*/
|
|
260
|
-
RuntimeFilterOp["BW"] = "BW";
|
|
261
|
-
/**
|
|
262
|
-
* Is included in this list of values
|
|
263
|
-
*/
|
|
264
|
-
RuntimeFilterOp["IN"] = "IN";
|
|
265
|
-
})(RuntimeFilterOp || (RuntimeFilterOp = {}));
|
|
98
|
+
const serializeParam = (value) => {
|
|
99
|
+
// do not serialize primitive types
|
|
100
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
return JSON.stringify(value);
|
|
104
|
+
};
|
|
266
105
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
* @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
|
|
106
|
+
* Convert a value to a string:
|
|
107
|
+
* in case of an array, we convert it to CSV.
|
|
108
|
+
* in case of any other type, we directly return the value.
|
|
109
|
+
* @param value
|
|
272
110
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
111
|
+
const paramToString = (value) => (Array.isArray(value) ? value.join(',') : value);
|
|
112
|
+
/**
|
|
113
|
+
* Return a query param string composed from the given params object
|
|
114
|
+
* @param queryParams
|
|
115
|
+
* @param shouldSerializeParamValues
|
|
116
|
+
*/
|
|
117
|
+
const getQueryParamString = (queryParams, shouldSerializeParamValues = false) => {
|
|
118
|
+
const qp = [];
|
|
119
|
+
const params = Object.keys(queryParams);
|
|
120
|
+
params.forEach((key) => {
|
|
121
|
+
const val = queryParams[key];
|
|
122
|
+
if (val !== undefined) {
|
|
123
|
+
const serializedValue = shouldSerializeParamValues
|
|
124
|
+
? serializeParam(val)
|
|
125
|
+
: paramToString(val);
|
|
126
|
+
qp.push(`${key}=${serializedValue}`);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
if (qp.length) {
|
|
130
|
+
return qp.join('&');
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Get a string representation of a dimension value in CSS
|
|
136
|
+
* If numeric, it is considered in pixels.
|
|
137
|
+
* @param value
|
|
138
|
+
*/
|
|
139
|
+
const getCssDimension = (value) => {
|
|
140
|
+
if (typeof value === 'number') {
|
|
141
|
+
return `${value}px`;
|
|
142
|
+
}
|
|
143
|
+
return value;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Append a string to a URL's hash fragment
|
|
147
|
+
* @param url A URL
|
|
148
|
+
* @param stringToAppend The string to append to the URL hash
|
|
149
|
+
*/
|
|
150
|
+
const appendToUrlHash = (url, stringToAppend) => {
|
|
151
|
+
let outputUrl = url;
|
|
152
|
+
const encStringToAppend = encodeURIComponent(stringToAppend);
|
|
153
|
+
if (url.indexOf('#') >= 0) {
|
|
154
|
+
outputUrl = `${outputUrl}${encStringToAppend}`;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
outputUrl = `${outputUrl}#${encStringToAppend}`;
|
|
158
|
+
}
|
|
159
|
+
return outputUrl;
|
|
160
|
+
};
|
|
301
161
|
/**
|
|
302
|
-
* Event types emitted by the embedded ThoughtSpot application.
|
|
303
|
-
*
|
|
304
|
-
* To add an event listener use the corresponding
|
|
305
|
-
* {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
|
|
306
|
-
* @example
|
|
307
|
-
* ```js
|
|
308
|
-
* import { EmbedEvent } from '@thoughtspot/visual-embed-sdk';
|
|
309
|
-
* // Or
|
|
310
|
-
* // const { EmbedEvent } = window.tsembed;
|
|
311
|
-
*
|
|
312
|
-
* // create the liveboard embed.
|
|
313
162
|
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* ```
|
|
318
|
-
* @group Events
|
|
163
|
+
* @param url
|
|
164
|
+
* @param stringToAppend
|
|
165
|
+
* @param path
|
|
319
166
|
*/
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
167
|
+
function getRedirectUrl(url, stringToAppend, path = '') {
|
|
168
|
+
const targetUrl = path ? new URL(path, window.location.origin).href : url;
|
|
169
|
+
return appendToUrlHash(targetUrl, stringToAppend);
|
|
170
|
+
}
|
|
171
|
+
const getEncodedQueryParamsString = (queryString) => {
|
|
172
|
+
if (!queryString) {
|
|
173
|
+
return queryString;
|
|
174
|
+
}
|
|
175
|
+
return btoa(queryString).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
176
|
+
};
|
|
177
|
+
const getOffsetTop = (element) => {
|
|
178
|
+
const rect = element.getBoundingClientRect();
|
|
179
|
+
return rect.top + window.scrollY;
|
|
180
|
+
};
|
|
181
|
+
const embedEventStatus = {
|
|
182
|
+
START: 'start',
|
|
183
|
+
END: 'end',
|
|
184
|
+
};
|
|
185
|
+
const setAttributes = (element, attributes) => {
|
|
186
|
+
Object.keys(attributes).forEach((key) => {
|
|
187
|
+
element.setAttribute(key, attributes[key].toString());
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
const isCloudRelease = (version) => version.endsWith('.cl');
|
|
191
|
+
/* For Search Embed: ReleaseVersionInBeta */
|
|
192
|
+
const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
|
|
193
|
+
if (releaseVersion !== '' && !isCloudRelease(releaseVersion)) {
|
|
194
|
+
const splittedReleaseVersion = releaseVersion.split('.');
|
|
195
|
+
const majorVersion = Number(splittedReleaseVersion[0]);
|
|
196
|
+
const isBetaVersion = majorVersion < 8;
|
|
197
|
+
return !suppressBetaWarning && isBetaVersion;
|
|
198
|
+
}
|
|
199
|
+
return false;
|
|
200
|
+
};
|
|
201
|
+
const getCustomisations = (embedConfig, viewConfig) => {
|
|
202
|
+
var _a, _b, _c, _d;
|
|
203
|
+
const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
|
|
204
|
+
const customizationsFromViewConfig = viewConfig.customizations;
|
|
205
|
+
const customizationsFromEmbedConfig = embedConfig.customizations
|
|
206
|
+
|| embedConfig.customisations;
|
|
207
|
+
const customizations = {
|
|
208
|
+
style: {
|
|
209
|
+
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
|
|
210
|
+
...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style,
|
|
211
|
+
customCSS: {
|
|
212
|
+
...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
|
|
213
|
+
...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
|
|
214
|
+
},
|
|
215
|
+
customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
|
|
216
|
+
|| ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl)
|
|
217
|
+
|| customCssUrlFromEmbedConfig,
|
|
218
|
+
},
|
|
219
|
+
content: {
|
|
220
|
+
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
|
|
221
|
+
...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.content,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
return customizations;
|
|
225
|
+
};
|
|
226
|
+
const getRuntimeFilters = (runtimefilters) => getFilterQuery(runtimefilters || []);
|
|
227
|
+
/**
|
|
228
|
+
* Gets a reference to the DOM node given
|
|
229
|
+
* a selector.
|
|
230
|
+
* @param domSelector
|
|
231
|
+
*/
|
|
232
|
+
function getDOMNode(domSelector) {
|
|
233
|
+
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
234
|
+
}
|
|
235
|
+
const deepMerge = (target, source) => merge(target, source);
|
|
236
|
+
const getOperationNameFromQuery = (query) => {
|
|
237
|
+
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
238
|
+
const matches = query.match(regex);
|
|
239
|
+
return matches === null || matches === void 0 ? void 0 : matches[1];
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @param obj
|
|
244
|
+
*/
|
|
245
|
+
function removeTypename(obj) {
|
|
246
|
+
if (!obj || typeof obj !== 'object')
|
|
247
|
+
return obj;
|
|
248
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
249
|
+
for (const key in obj) {
|
|
250
|
+
if (key === '__typename') {
|
|
251
|
+
delete obj[key];
|
|
252
|
+
}
|
|
253
|
+
else if (typeof obj[key] === 'object') {
|
|
254
|
+
removeTypename(obj[key]);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return obj;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Sets the specified style properties on an HTML element.
|
|
261
|
+
* @param {HTMLElement} element - The HTML element to which the styles should be applied.
|
|
262
|
+
* @param {Partial<CSSStyleDeclaration>} styleProperties - An object containing style
|
|
263
|
+
* property names and their values.
|
|
264
|
+
* @example
|
|
265
|
+
* // Apply styles to an element
|
|
266
|
+
* const element = document.getElementById('myElement');
|
|
267
|
+
* const styles = {
|
|
268
|
+
* backgroundColor: 'red',
|
|
269
|
+
* fontSize: '16px',
|
|
270
|
+
* };
|
|
271
|
+
* setStyleProperties(element, styles);
|
|
272
|
+
*/
|
|
273
|
+
const setStyleProperties = (element, styleProperties) => {
|
|
274
|
+
if (!(element === null || element === void 0 ? void 0 : element.style))
|
|
275
|
+
return;
|
|
276
|
+
Object.keys(styleProperties).forEach((styleProperty) => {
|
|
277
|
+
element.style[styleProperty] = styleProperties[styleProperty].toString();
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Removes specified style properties from an HTML element.
|
|
282
|
+
* @param {HTMLElement} element - The HTML element from which the styles should be removed.
|
|
283
|
+
* @param {string[]} styleProperties - An array of style property names to be removed.
|
|
284
|
+
* @example
|
|
285
|
+
* // Remove styles from an element
|
|
286
|
+
* const element = document.getElementById('myElement');
|
|
287
|
+
* element.style.backgroundColor = 'red';
|
|
288
|
+
* const propertiesToRemove = ['backgroundColor'];
|
|
289
|
+
* removeStyleProperties(element, propertiesToRemove);
|
|
290
|
+
*/
|
|
291
|
+
const removeStyleProperties = (element, styleProperties) => {
|
|
292
|
+
if (!(element === null || element === void 0 ? void 0 : element.style))
|
|
293
|
+
return;
|
|
294
|
+
styleProperties.forEach((styleProperty) => {
|
|
295
|
+
element.style.removeProperty(styleProperty);
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
const isUndefined = (value) => value === undefined;
|
|
299
|
+
// Return if the value is a string, double or boolean.
|
|
300
|
+
const getTypeFromValue = (value) => {
|
|
301
|
+
if (typeof value === 'string') {
|
|
302
|
+
return ['char', 'string'];
|
|
303
|
+
}
|
|
304
|
+
if (typeof value === 'number') {
|
|
305
|
+
return ['double', 'double'];
|
|
306
|
+
}
|
|
307
|
+
if (typeof value === 'boolean') {
|
|
308
|
+
return ['boolean', 'boolean'];
|
|
309
|
+
}
|
|
310
|
+
return ['', ''];
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Copyright (c) 2023
|
|
315
|
+
*
|
|
316
|
+
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
317
|
+
* @summary Type definitions for Embed SDK
|
|
318
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
319
|
+
*/
|
|
320
|
+
/**
|
|
321
|
+
* The authentication mechanism for allowing access to the
|
|
322
|
+
* the embedded app
|
|
323
|
+
* @group Authentication / Init
|
|
324
|
+
*/
|
|
325
|
+
// eslint-disable-next-line no-shadow
|
|
326
|
+
var AuthType;
|
|
327
|
+
(function (AuthType) {
|
|
426
328
|
/**
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
329
|
+
* No authentication on the SDK. Passthrough to the embedded App. Alias for
|
|
330
|
+
* `Passthrough`.
|
|
430
331
|
* @example
|
|
431
332
|
* ```js
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
333
|
+
* init({
|
|
334
|
+
* // ...
|
|
335
|
+
* authType: AuthType.None,
|
|
336
|
+
* });
|
|
435
337
|
* ```
|
|
436
338
|
*/
|
|
437
|
-
|
|
339
|
+
AuthType["None"] = "None";
|
|
438
340
|
/**
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
341
|
+
* Passthrough SSO to the embedded application within the iframe. Requires least
|
|
342
|
+
* configuration, but may not be supported by all IDPs. This will behave like `None`
|
|
343
|
+
* if SSO is not configured on ThoughtSpot.
|
|
344
|
+
*
|
|
345
|
+
* To use this:
|
|
346
|
+
* Your SAML or OpenID provider must allow iframe redirects.
|
|
347
|
+
* For example, if you are using Okta as IdP, you can enable iframe embedding.
|
|
442
348
|
* @example
|
|
443
349
|
* ```js
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
350
|
+
* init({
|
|
351
|
+
* // ...
|
|
352
|
+
* authType: AuthType.EmbeddedSSO,
|
|
353
|
+
* });
|
|
447
354
|
* ```
|
|
355
|
+
* @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
|
|
448
356
|
*/
|
|
449
|
-
|
|
357
|
+
AuthType["EmbeddedSSO"] = "EmbeddedSSO";
|
|
450
358
|
/**
|
|
451
|
-
*
|
|
452
|
-
* @
|
|
453
|
-
* @
|
|
454
|
-
* Answer or Liveboard data
|
|
455
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
456
|
-
* @example
|
|
457
|
-
* ```js
|
|
458
|
-
* appEmbed.on(EmbedEvent.customAction, payload => {
|
|
459
|
-
* const data = payload.data;
|
|
460
|
-
* if (data.id === 'insert Custom Action ID here') {
|
|
461
|
-
* console.log('Custom Action event:', data.embedAnswerData);
|
|
462
|
-
* }
|
|
463
|
-
* })
|
|
464
|
-
* ```
|
|
359
|
+
* SSO using SAML
|
|
360
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
361
|
+
* @hidden
|
|
465
362
|
*/
|
|
466
|
-
|
|
363
|
+
AuthType["SSO"] = "SSO_SAML";
|
|
467
364
|
/**
|
|
468
|
-
*
|
|
469
|
-
* @
|
|
470
|
-
* @
|
|
365
|
+
* SSO using SAML
|
|
366
|
+
* @deprecated Use {@link SAMLRedirect} instead
|
|
367
|
+
* @hidden
|
|
368
|
+
*/
|
|
369
|
+
AuthType["SAML"] = "SSO_SAML";
|
|
370
|
+
/**
|
|
371
|
+
* SSO using SAML
|
|
372
|
+
* Makes the host application redirect to the SAML IdP. Use this
|
|
373
|
+
* if your IdP does not allow itself to be embedded.
|
|
374
|
+
*
|
|
375
|
+
* This redirects the host application to the SAML IdP. The host application
|
|
376
|
+
* will be redirected back to the ThoughtSpot app after authentication.
|
|
471
377
|
* @example
|
|
472
378
|
* ```js
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
379
|
+
* init({
|
|
380
|
+
* // ...
|
|
381
|
+
* authType: AuthType.SAMLRedirect,
|
|
382
|
+
* });
|
|
476
383
|
* ```
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*
|
|
481
|
-
* @return viz, clickedPoint - metadata about the point that is clicked
|
|
482
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
483
|
-
* @important
|
|
384
|
+
*
|
|
385
|
+
* This opens the SAML IdP in a popup window. The popup is triggered
|
|
386
|
+
* when the user clicks the trigger button. The popup window will be
|
|
387
|
+
* closed automatically after authentication.
|
|
484
388
|
* @example
|
|
485
389
|
* ```js
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* data.clickedPoint.selectedMeasures[0].column.name,
|
|
493
|
-
* )
|
|
390
|
+
* init({
|
|
391
|
+
* // ...
|
|
392
|
+
* authType: AuthType.SAMLRedirect,
|
|
393
|
+
* authTriggerText: 'Login with SAML',
|
|
394
|
+
* authTriggerContainer: '#embed-container',
|
|
395
|
+
* inPopup: true,
|
|
494
396
|
* });
|
|
495
397
|
* ```
|
|
496
|
-
*/
|
|
497
|
-
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
498
|
-
/**
|
|
499
|
-
* An error has occurred. This event is fired for the following error types:
|
|
500
398
|
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* `FULLSCREEN`: Error when presenting a Liveboard or visualization in full screen
|
|
504
|
-
* mode.
|
|
505
|
-
*
|
|
506
|
-
* `SINGLE_VALUE_FILTER`: Error due to multiple values in the single value filter.
|
|
507
|
-
*
|
|
508
|
-
* `NON_EXIST_FILTER`: Error due to a non-existent filter.
|
|
509
|
-
*
|
|
510
|
-
* `INVALID_DATE_VALUE`: Invalid date value error.
|
|
511
|
-
*
|
|
512
|
-
* `INVALID_OPERATOR`: Use of invalid operator during filter application.
|
|
513
|
-
*
|
|
514
|
-
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType.
|
|
515
|
-
* @returns error - An error object or message
|
|
516
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
399
|
+
* Can also use the event to trigger the popup flow. Works the same
|
|
400
|
+
* as the above example.
|
|
517
401
|
* @example
|
|
518
402
|
* ```js
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
403
|
+
* const authEE = init({
|
|
404
|
+
* // ...
|
|
405
|
+
* authType: AuthType.SAMLRedirect,
|
|
406
|
+
* inPopup: true,
|
|
407
|
+
* });
|
|
408
|
+
*
|
|
409
|
+
* someButtonOnYourPage.addEventListener('click', () => {
|
|
410
|
+
* authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
|
|
523
411
|
* });
|
|
524
412
|
* ```
|
|
413
|
+
*/
|
|
414
|
+
AuthType["SAMLRedirect"] = "SSO_SAML";
|
|
415
|
+
/**
|
|
416
|
+
* SSO using OIDC
|
|
417
|
+
* @hidden
|
|
418
|
+
* @deprecated Use {@link OIDCRedirect} instead
|
|
419
|
+
*/
|
|
420
|
+
AuthType["OIDC"] = "SSO_OIDC";
|
|
421
|
+
/**
|
|
422
|
+
* SSO using OIDC
|
|
423
|
+
* Will make the host application redirect to the OIDC IdP.
|
|
424
|
+
* See code samples in {@link SAMLRedirect}.
|
|
425
|
+
*/
|
|
426
|
+
AuthType["OIDCRedirect"] = "SSO_OIDC";
|
|
427
|
+
/**
|
|
428
|
+
* Trusted authentication server
|
|
429
|
+
* @hidden
|
|
430
|
+
* @deprecated Use {@link TrustedAuth} instead
|
|
431
|
+
*/
|
|
432
|
+
AuthType["AuthServer"] = "AuthServer";
|
|
433
|
+
/**
|
|
434
|
+
* Trusted authentication server. Use your own authentication server
|
|
435
|
+
* which returns a bearer token, generated using the `secret_key` obtained
|
|
436
|
+
* from ThoughtSpot.
|
|
525
437
|
* @example
|
|
526
438
|
* ```js
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
439
|
+
* init({
|
|
440
|
+
* // ...
|
|
441
|
+
* authType: AuthType.TrustedAuthToken,
|
|
442
|
+
* getAuthToken: () => {
|
|
443
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
444
|
+
* .then((response) => response.json())
|
|
445
|
+
* .then((data) => data.token);
|
|
446
|
+
* }
|
|
447
|
+
* });
|
|
535
448
|
* ```
|
|
536
449
|
*/
|
|
537
|
-
|
|
450
|
+
AuthType["TrustedAuthToken"] = "AuthServer";
|
|
538
451
|
/**
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
452
|
+
* Trusted authentication server Cookieless, Use your own authentication
|
|
453
|
+
* server which returns a bearer token, generated using the `secret_key`
|
|
454
|
+
* obtained from ThoughtSpot. This uses a cookieless authentication
|
|
455
|
+
* approach, recommended to bypass the third-party cookie-blocking restriction
|
|
456
|
+
* implemented by some browsers.
|
|
542
457
|
* @example
|
|
543
458
|
* ```js
|
|
544
|
-
*
|
|
459
|
+
* init({
|
|
460
|
+
* // ...
|
|
461
|
+
* authType: AuthType.TrustedAuthTokenCookieless,
|
|
462
|
+
* getAuthToken: () => {
|
|
463
|
+
* return fetch('https://my-backend.app/ts-token')
|
|
464
|
+
* .then((response) => response.json())
|
|
465
|
+
* .then((data) => data.token);
|
|
466
|
+
* }
|
|
545
467
|
* ```
|
|
468
|
+
* @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
|
|
546
469
|
*/
|
|
547
|
-
|
|
470
|
+
AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
|
|
548
471
|
/**
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
|
|
553
|
-
* appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
|
|
554
|
-
* //show auth expired banner
|
|
555
|
-
* function showAuthExpired() {
|
|
556
|
-
* document.getElementById("authExpiredBanner");
|
|
557
|
-
* }
|
|
558
|
-
*```
|
|
472
|
+
* Use the ThoughtSpot login API to authenticate to the cluster directly.
|
|
473
|
+
*
|
|
474
|
+
* Warning: This feature is primarily intended for developer testing. It is
|
|
475
|
+
* strongly advised not to use this authentication method in production.
|
|
559
476
|
*/
|
|
560
|
-
|
|
477
|
+
AuthType["Basic"] = "Basic";
|
|
478
|
+
})(AuthType || (AuthType = {}));
|
|
479
|
+
/**
|
|
480
|
+
*
|
|
481
|
+
* This option does not apply to the classic homepage experience.
|
|
482
|
+
* To access the updated modular homepage,
|
|
483
|
+
* set `modularHomeExperience` to `true`
|
|
484
|
+
* (available as Early Access feature in 9.12.5.cl).
|
|
485
|
+
*
|
|
486
|
+
*/
|
|
487
|
+
var HomeLeftNavItem;
|
|
488
|
+
(function (HomeLeftNavItem) {
|
|
561
489
|
/**
|
|
562
|
-
*
|
|
563
|
-
* @hidden
|
|
490
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
564
491
|
*/
|
|
565
|
-
|
|
492
|
+
HomeLeftNavItem["SearchData"] = "search-data";
|
|
566
493
|
/**
|
|
567
|
-
*
|
|
568
|
-
* @hidden
|
|
494
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
569
495
|
*/
|
|
570
|
-
|
|
496
|
+
HomeLeftNavItem["Home"] = "insights-home";
|
|
571
497
|
/**
|
|
572
|
-
*
|
|
573
|
-
* @returns data - The height of the embedded Liveboard or visualization
|
|
574
|
-
* @hidden
|
|
498
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
575
499
|
*/
|
|
576
|
-
|
|
500
|
+
HomeLeftNavItem["Liveboards"] = "liveboards";
|
|
577
501
|
/**
|
|
578
|
-
*
|
|
579
|
-
* @returns data - The center of the visible Iframe viewport.
|
|
580
|
-
* @hidden
|
|
502
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
581
503
|
*/
|
|
582
|
-
|
|
504
|
+
HomeLeftNavItem["Answers"] = "answers";
|
|
583
505
|
/**
|
|
584
|
-
*
|
|
585
|
-
* Applicable to `SearchBarEmbed` only.
|
|
586
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
587
|
-
* @example
|
|
588
|
-
*```js
|
|
589
|
-
* searchbarEmbed.on(EmbedEvent.GetDataClick)
|
|
590
|
-
* .then(data => {
|
|
591
|
-
* console.log('Answer Data:', data);
|
|
592
|
-
* })
|
|
593
|
-
*```
|
|
506
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
594
507
|
*/
|
|
595
|
-
|
|
508
|
+
HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
|
|
596
509
|
/**
|
|
597
|
-
*
|
|
598
|
-
* @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
|
|
599
|
-
* @example
|
|
600
|
-
*```js
|
|
601
|
-
* searchEmbed.on(EmbedEvent.RouteChange, payload =>
|
|
602
|
-
* console.log('data', payload))
|
|
603
|
-
*```
|
|
510
|
+
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
604
511
|
*/
|
|
605
|
-
|
|
512
|
+
HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
|
|
513
|
+
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
514
|
+
/**
|
|
515
|
+
* A map of the supported runtime filter operations
|
|
516
|
+
*/
|
|
517
|
+
// eslint-disable-next-line no-shadow
|
|
518
|
+
var RuntimeFilterOp;
|
|
519
|
+
(function (RuntimeFilterOp) {
|
|
606
520
|
/**
|
|
607
|
-
*
|
|
608
|
-
* @hidden
|
|
521
|
+
* Equals
|
|
609
522
|
*/
|
|
610
|
-
|
|
523
|
+
RuntimeFilterOp["EQ"] = "EQ";
|
|
611
524
|
/**
|
|
612
|
-
*
|
|
613
|
-
* when Safari and other Web browsers block third-party cookies
|
|
614
|
-
* are blocked by default.
|
|
615
|
-
* @example
|
|
616
|
-
*```js
|
|
617
|
-
* appEmbed.on(EmbedEvent.NoCookieAccess)
|
|
618
|
-
*```
|
|
619
|
-
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
|
|
525
|
+
* Does not equal
|
|
620
526
|
*/
|
|
621
|
-
|
|
527
|
+
RuntimeFilterOp["NE"] = "NE";
|
|
622
528
|
/**
|
|
623
|
-
*
|
|
624
|
-
* @private
|
|
625
|
-
* @hidden
|
|
529
|
+
* Less than
|
|
626
530
|
*/
|
|
627
|
-
|
|
531
|
+
RuntimeFilterOp["LT"] = "LT";
|
|
628
532
|
/**
|
|
629
|
-
*
|
|
630
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
631
|
-
* @example
|
|
632
|
-
*```js
|
|
633
|
-
* appEmbed.on(EmbedEvent.DialogOpen, payload => {
|
|
634
|
-
* console.log('dialog open', payload);
|
|
635
|
-
* })
|
|
636
|
-
*```
|
|
533
|
+
* Less than or equal to
|
|
637
534
|
*/
|
|
638
|
-
|
|
535
|
+
RuntimeFilterOp["LE"] = "LE";
|
|
639
536
|
/**
|
|
640
|
-
*
|
|
641
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
642
|
-
* @example
|
|
643
|
-
*```js
|
|
644
|
-
* appEmbed.on(EmbedEvent.DialogClose, payload => {
|
|
645
|
-
* console.log('dialog close', payload);
|
|
646
|
-
* })
|
|
647
|
-
*```
|
|
537
|
+
* Greater than
|
|
648
538
|
*/
|
|
649
|
-
|
|
539
|
+
RuntimeFilterOp["GT"] = "GT";
|
|
650
540
|
/**
|
|
651
|
-
*
|
|
652
|
-
* You can use this event as a hook to trigger
|
|
653
|
-
* actions on the rendered Liveboard.
|
|
654
|
-
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
655
|
-
* @example
|
|
656
|
-
*```js
|
|
657
|
-
* liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
|
|
658
|
-
console.log('Liveboard is rendered', payload);
|
|
659
|
-
})
|
|
660
|
-
*```
|
|
661
|
-
* The following example shows how to trigger
|
|
662
|
-
* `SetVisibleVizs` event using LiveboardRendered embed event:
|
|
663
|
-
* @example
|
|
664
|
-
*```js
|
|
665
|
-
* const embedRef = useEmbedRef();
|
|
666
|
-
* const onLiveboardRendered = () => {
|
|
667
|
-
* embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
|
|
668
|
-
* };
|
|
669
|
-
*```
|
|
541
|
+
* Greater than or equal to
|
|
670
542
|
*/
|
|
671
|
-
|
|
543
|
+
RuntimeFilterOp["GE"] = "GE";
|
|
672
544
|
/**
|
|
673
|
-
*
|
|
674
|
-
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
675
|
-
* @example
|
|
676
|
-
*```js
|
|
677
|
-
* appEmbed.on(EmbedEvent.ALL, payload => {
|
|
678
|
-
* console.log('Embed Events', payload)
|
|
679
|
-
* })
|
|
680
|
-
*```
|
|
545
|
+
* Contains
|
|
681
546
|
*/
|
|
682
|
-
|
|
547
|
+
RuntimeFilterOp["CONTAINS"] = "CONTAINS";
|
|
683
548
|
/**
|
|
684
|
-
*
|
|
685
|
-
|
|
549
|
+
* Begins with
|
|
550
|
+
*/
|
|
551
|
+
RuntimeFilterOp["BEGINS_WITH"] = "BEGINS_WITH";
|
|
552
|
+
/**
|
|
553
|
+
* Ends with
|
|
554
|
+
*/
|
|
555
|
+
RuntimeFilterOp["ENDS_WITH"] = "ENDS_WITH";
|
|
556
|
+
/**
|
|
557
|
+
* Between, inclusive of higher value
|
|
558
|
+
*/
|
|
559
|
+
RuntimeFilterOp["BW_INC_MAX"] = "BW_INC_MAX";
|
|
560
|
+
/**
|
|
561
|
+
* Between, inclusive of lower value
|
|
562
|
+
*/
|
|
563
|
+
RuntimeFilterOp["BW_INC_MIN"] = "BW_INC_MIN";
|
|
564
|
+
/**
|
|
565
|
+
* Between, inclusive of both higher and lower value
|
|
566
|
+
*/
|
|
567
|
+
RuntimeFilterOp["BW_INC"] = "BW_INC";
|
|
568
|
+
/**
|
|
569
|
+
* Between, non-inclusive
|
|
570
|
+
*/
|
|
571
|
+
RuntimeFilterOp["BW"] = "BW";
|
|
572
|
+
/**
|
|
573
|
+
* Is included in this list of values
|
|
574
|
+
*/
|
|
575
|
+
RuntimeFilterOp["IN"] = "IN";
|
|
576
|
+
/**
|
|
577
|
+
* Is not included in this list of values
|
|
578
|
+
*/
|
|
579
|
+
RuntimeFilterOp["NOT_IN"] = "NOT_IN";
|
|
580
|
+
})(RuntimeFilterOp || (RuntimeFilterOp = {}));
|
|
581
|
+
/**
|
|
582
|
+
* Home page module that can be hidden.
|
|
583
|
+
* **Note**: This option does not apply to the classic homepage.
|
|
584
|
+
* To access the updated modular homepage, set
|
|
585
|
+
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
586
|
+
* @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
|
|
587
|
+
*/
|
|
588
|
+
// eslint-disable-next-line no-shadow
|
|
589
|
+
var HomepageModule;
|
|
590
|
+
(function (HomepageModule) {
|
|
591
|
+
/**
|
|
592
|
+
* Search bar
|
|
593
|
+
*/
|
|
594
|
+
HomepageModule["Search"] = "SEARCH";
|
|
595
|
+
/**
|
|
596
|
+
* kPI watchlist module
|
|
597
|
+
*/
|
|
598
|
+
HomepageModule["Watchlist"] = "WATCHLIST";
|
|
599
|
+
/**
|
|
600
|
+
* favorite objects
|
|
601
|
+
*/
|
|
602
|
+
HomepageModule["Favorite"] = "FAVORITE";
|
|
603
|
+
/**
|
|
604
|
+
* List of answers and Liveboards
|
|
605
|
+
*/
|
|
606
|
+
HomepageModule["MyLibrary"] = "MY_LIBRARY";
|
|
607
|
+
/**
|
|
608
|
+
* Trending list
|
|
609
|
+
*/
|
|
610
|
+
HomepageModule["Trending"] = "TRENDING";
|
|
611
|
+
/**
|
|
612
|
+
* Learning videos
|
|
613
|
+
*/
|
|
614
|
+
HomepageModule["Learning"] = "LEARNING";
|
|
615
|
+
})(HomepageModule || (HomepageModule = {}));
|
|
616
|
+
/**
|
|
617
|
+
* Event types emitted by the embedded ThoughtSpot application.
|
|
618
|
+
*
|
|
619
|
+
* To add an event listener use the corresponding
|
|
620
|
+
* {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
|
|
621
|
+
* @example
|
|
622
|
+
* ```js
|
|
623
|
+
* import { EmbedEvent } from '@thoughtspot/visual-embed-sdk';
|
|
624
|
+
* // Or
|
|
625
|
+
* // const { EmbedEvent } = window.tsembed;
|
|
626
|
+
*
|
|
627
|
+
* // create the liveboard embed.
|
|
628
|
+
*
|
|
629
|
+
* liveboardEmbed.on(EmbedEvent.Drilldown, (drilldown) => {
|
|
630
|
+
* console.log('Drilldown event', drilldown);
|
|
631
|
+
* }));
|
|
632
|
+
* ```
|
|
633
|
+
* @group Events
|
|
634
|
+
*/
|
|
635
|
+
// eslint-disable-next-line no-shadow
|
|
636
|
+
var EmbedEvent;
|
|
637
|
+
(function (EmbedEvent) {
|
|
638
|
+
/**
|
|
639
|
+
* Rendering has initialized.
|
|
686
640
|
* @example
|
|
687
641
|
*```js
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
* })
|
|
694
|
-
* //emit when action ends
|
|
695
|
-
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
696
|
-
* console.log('Save', payload)
|
|
697
|
-
* })
|
|
642
|
+
* liveboardEmbed.on(EmbedEvent.Init, showLoader)
|
|
643
|
+
* //show a loader
|
|
644
|
+
* function showLoader() {
|
|
645
|
+
* document.getElementById("loader");
|
|
646
|
+
* }
|
|
698
647
|
*```
|
|
648
|
+
* @returns timestamp - The timestamp when the event was generated.
|
|
699
649
|
*/
|
|
700
|
-
EmbedEvent["
|
|
650
|
+
EmbedEvent["Init"] = "init";
|
|
701
651
|
/**
|
|
702
|
-
*
|
|
703
|
-
*
|
|
704
|
-
* **Note**: This event is deprecated in v1.21.0.
|
|
705
|
-
* To fire an event when a download action is initiated on a chart or table,
|
|
706
|
-
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
|
|
707
|
-
* or `EmbedEvent.DownloadAsXLSX`
|
|
708
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
652
|
+
* Authentication has either succeeded or failed.
|
|
653
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
709
654
|
* @example
|
|
710
655
|
*```js
|
|
711
|
-
*
|
|
712
|
-
*
|
|
656
|
+
* appEmbed.on(EmbedEvent.AuthInit, payload => {
|
|
657
|
+
* console.log('AuthInit', payload);
|
|
713
658
|
* })
|
|
714
659
|
*```
|
|
660
|
+
* @returns isLoggedIn - A Boolean specifying whether authentication was successful.
|
|
715
661
|
*/
|
|
716
|
-
EmbedEvent["
|
|
662
|
+
EmbedEvent["AuthInit"] = "authInit";
|
|
717
663
|
/**
|
|
718
|
-
*
|
|
719
|
-
* @
|
|
664
|
+
* The embed object container has loaded.
|
|
665
|
+
* @returns timestamp - The timestamp when the event was generated.
|
|
666
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
720
667
|
* @example
|
|
721
668
|
*```js
|
|
722
|
-
*
|
|
723
|
-
*
|
|
724
|
-
*
|
|
725
|
-
*
|
|
726
|
-
*
|
|
727
|
-
* console.log('download PNG', payload)})
|
|
669
|
+
* liveboardEmbed.on(EmbedEvent.Load, hideLoader)
|
|
670
|
+
* //hide loader
|
|
671
|
+
* function hideLoader() {
|
|
672
|
+
* document.getElementById("loader");
|
|
673
|
+
* }
|
|
728
674
|
*```
|
|
729
675
|
*/
|
|
730
|
-
EmbedEvent["
|
|
676
|
+
EmbedEvent["Load"] = "load";
|
|
731
677
|
/**
|
|
732
|
-
*
|
|
733
|
-
* @
|
|
678
|
+
* Data pertaining to answer or Liveboard is received
|
|
679
|
+
* @return data - The answer or Liveboard data
|
|
680
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
734
681
|
* @example
|
|
735
682
|
*```js
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
* //emit when action ends
|
|
740
|
-
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
741
|
-
* console.log('download PDF', payload)})
|
|
683
|
+
* liveboardEmbed.on(EmbedEvent.Data, payload => {
|
|
684
|
+
* console.log('data', payload);
|
|
685
|
+
* })
|
|
742
686
|
*```
|
|
687
|
+
* @important
|
|
743
688
|
*/
|
|
744
|
-
EmbedEvent["
|
|
689
|
+
EmbedEvent["Data"] = "data";
|
|
745
690
|
/**
|
|
746
|
-
*
|
|
747
|
-
* @
|
|
748
|
-
* @example
|
|
749
|
-
*```js
|
|
750
|
-
* //emit when action starts
|
|
751
|
-
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
752
|
-
* console.log('download CSV', payload)}, {start: true })
|
|
753
|
-
* //emit when action ends
|
|
754
|
-
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
755
|
-
* console.log('download CSV', payload)})
|
|
756
|
-
*```
|
|
691
|
+
* Search/Answer/Liveboard filters have been applied/updated by the user.
|
|
692
|
+
* @hidden
|
|
757
693
|
*/
|
|
758
|
-
EmbedEvent["
|
|
694
|
+
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
759
695
|
/**
|
|
760
|
-
*
|
|
761
|
-
* @version SDK: 1.
|
|
696
|
+
* Search query has been updated by the user.
|
|
697
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
762
698
|
* @example
|
|
763
699
|
*```js
|
|
764
|
-
*
|
|
765
|
-
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
766
|
-
* console.log('download Xlsx', payload)}, { start: true })
|
|
767
|
-
* //emit when action ends
|
|
768
|
-
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
769
|
-
* console.log('download Xlsx', payload)})
|
|
700
|
+
* searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
|
|
770
701
|
*```
|
|
771
702
|
*/
|
|
772
|
-
EmbedEvent["
|
|
703
|
+
EmbedEvent["QueryChanged"] = "queryChanged";
|
|
773
704
|
/**
|
|
774
|
-
*
|
|
775
|
-
* @version SDK: 1.
|
|
705
|
+
* A drill-down operation has been performed.
|
|
706
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
707
|
+
* @returns additionalFilters - Any additional filters applied
|
|
708
|
+
* @returns drillDownColumns - The columns on which drill down was performed
|
|
709
|
+
* @returns nonFilteredColumns - The columns that were not filtered
|
|
776
710
|
* @example
|
|
777
711
|
*```js
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
712
|
+
* searchEmbed.on(EmbedEvent.DrillDown, {
|
|
713
|
+
* points: {
|
|
714
|
+
* clickedPoint,
|
|
715
|
+
* selectedPoints: selectedPoint
|
|
716
|
+
* },
|
|
717
|
+
* autoDrillDown: true,
|
|
718
|
+
* })
|
|
784
719
|
*```
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
* Emitted when an answer is pinned to a Liveboard
|
|
789
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
720
|
+
* In this example, `VizPointDoubleClick` event is used for
|
|
721
|
+
* triggering the `DrillDown` event when an area or specific
|
|
722
|
+
* data point on a table or chart is double-clicked.
|
|
790
723
|
* @example
|
|
791
724
|
*```js
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
725
|
+
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
726
|
+
* console.log(payload);
|
|
727
|
+
* const clickedPoint = payload.data.clickedPoint;
|
|
728
|
+
* const selectedPoint = payload.data.selectedPoints;
|
|
729
|
+
* console.log('>>> called', clickedPoint);
|
|
730
|
+
* embed.trigger(HostEvent.DrillDown, {
|
|
731
|
+
* points: {
|
|
732
|
+
* clickedPoint,
|
|
733
|
+
* selectedPoints: selectedPoint
|
|
734
|
+
* },
|
|
735
|
+
* autoDrillDown: true,
|
|
736
|
+
* })
|
|
801
737
|
* })
|
|
802
738
|
*```
|
|
803
739
|
*/
|
|
804
|
-
EmbedEvent["
|
|
740
|
+
EmbedEvent["Drilldown"] = "drillDown";
|
|
805
741
|
/**
|
|
806
|
-
*
|
|
807
|
-
* @
|
|
742
|
+
* One or more data sources have been selected.
|
|
743
|
+
* @returns dataSourceIds - the list of data sources
|
|
744
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
808
745
|
* @example
|
|
809
|
-
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
* console.log('SpotIQAnalyze', payload)
|
|
813
|
-
* }, {
|
|
814
|
-
* start: true
|
|
815
|
-
* })
|
|
816
|
-
* //emit when action ends
|
|
817
|
-
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
818
|
-
* console.log('SpotIQ analyze', payload)
|
|
746
|
+
* ```js
|
|
747
|
+
* searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
|
|
748
|
+
* console.log('DataSourceSelected', payload);
|
|
819
749
|
* })
|
|
820
|
-
|
|
750
|
+
* ```
|
|
821
751
|
*/
|
|
822
|
-
EmbedEvent["
|
|
752
|
+
EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
|
|
823
753
|
/**
|
|
824
|
-
*
|
|
825
|
-
* @
|
|
754
|
+
* One or more data columns have been selected.
|
|
755
|
+
* @returns columnIds - the list of columns
|
|
756
|
+
* @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
826
757
|
* @example
|
|
827
|
-
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
* console.log('Share', payload)
|
|
831
|
-
* }, {
|
|
832
|
-
* start: true
|
|
833
|
-
* })
|
|
834
|
-
* //emit when action ends
|
|
835
|
-
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
836
|
-
* console.log('Share', payload)
|
|
758
|
+
* ```js
|
|
759
|
+
* appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
|
|
760
|
+
* console.log('AddRemoveColumns', payload);
|
|
837
761
|
* })
|
|
838
|
-
|
|
762
|
+
* ```
|
|
839
763
|
*/
|
|
840
|
-
EmbedEvent["
|
|
764
|
+
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
|
|
841
765
|
/**
|
|
842
|
-
*
|
|
843
|
-
*
|
|
844
|
-
* @
|
|
766
|
+
* A custom action has been triggered.
|
|
767
|
+
* @returns actionId - ID of the custom action
|
|
768
|
+
* @returns payload {@link CustomActionPayload} - Response payload with the
|
|
769
|
+
* Answer or Liveboard data
|
|
770
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
845
771
|
* @example
|
|
846
|
-
|
|
847
|
-
* appEmbed.on(EmbedEvent.
|
|
848
|
-
*
|
|
772
|
+
* ```js
|
|
773
|
+
* appEmbed.on(EmbedEvent.customAction, payload => {
|
|
774
|
+
* const data = payload.data;
|
|
775
|
+
* if (data.id === 'insert Custom Action ID here') {
|
|
776
|
+
* console.log('Custom Action event:', data.embedAnswerData);
|
|
777
|
+
* }
|
|
849
778
|
* })
|
|
850
|
-
|
|
779
|
+
* ```
|
|
851
780
|
*/
|
|
852
|
-
EmbedEvent["
|
|
781
|
+
EmbedEvent["CustomAction"] = "customAction";
|
|
853
782
|
/**
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
* @version SDK: 1.
|
|
783
|
+
* Listen to double click actions on a visualization.
|
|
784
|
+
* @return ContextMenuInputPoints - Data point that is double-clicked
|
|
785
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
857
786
|
* @example
|
|
858
|
-
|
|
859
|
-
*
|
|
860
|
-
*
|
|
787
|
+
* ```js
|
|
788
|
+
* livebaordEmbed.on(EmbedEvent.VizPointDoubleClick, payload => {
|
|
789
|
+
* console.log('VizPointDoubleClick', payload);
|
|
861
790
|
* })
|
|
862
|
-
|
|
791
|
+
* ```
|
|
863
792
|
*/
|
|
864
|
-
EmbedEvent["
|
|
793
|
+
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
865
794
|
/**
|
|
866
|
-
*
|
|
795
|
+
* Listen to clicks on a visualization in a Liveboard or Search result.
|
|
796
|
+
* @return viz, clickedPoint - metadata about the point that is clicked
|
|
867
797
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
798
|
+
* @important
|
|
868
799
|
* @example
|
|
869
|
-
|
|
870
|
-
*
|
|
871
|
-
*
|
|
872
|
-
*
|
|
873
|
-
|
|
800
|
+
* ```js
|
|
801
|
+
* embed.on(EmbedEvent.VizPointClick, ({data}) => {
|
|
802
|
+
* console.log(
|
|
803
|
+
* data.vizId, // viz id
|
|
804
|
+
* data.clickedPoint.selectedAttributes[0].value,
|
|
805
|
+
* data.clickedPoint.selectedAttributes[0].column.name,
|
|
806
|
+
* data.clickedPoint.selectedMeasures[0].value,
|
|
807
|
+
* data.clickedPoint.selectedMeasures[0].column.name,
|
|
808
|
+
* )
|
|
809
|
+
* });
|
|
810
|
+
* ```
|
|
874
811
|
*/
|
|
875
|
-
EmbedEvent["
|
|
812
|
+
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
876
813
|
/**
|
|
877
|
-
*
|
|
878
|
-
* embedded Liveboard.
|
|
814
|
+
* An error has occurred. This event is fired for the following error types:
|
|
879
815
|
*
|
|
880
|
-
*
|
|
816
|
+
* `API` - API call failure error.
|
|
817
|
+
* `FULLSCREEN` - Error when presenting a Liveboard or visualization in full screen
|
|
818
|
+
* mode. `SINGLE_VALUE_FILTER` - Error due to multiple values in the single value
|
|
819
|
+
* filter. `NON_EXIST_FILTER` - Error due to a non-existent filter.
|
|
820
|
+
* `INVALID_DATE_VALUE` - Invalid date value error.
|
|
821
|
+
* `INVALID_OPERATOR` - Use of invalid operator during filter application.
|
|
822
|
+
*
|
|
823
|
+
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
|
|
824
|
+
* @returns error - An error object or message
|
|
825
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
881
826
|
* @example
|
|
882
|
-
|
|
883
|
-
*
|
|
827
|
+
* ```js
|
|
828
|
+
* // API error
|
|
829
|
+
* SearchEmbed.on(EmbedEvent.Error, (error) => {
|
|
830
|
+
* console.log(error);
|
|
831
|
+
* // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
|
|
832
|
+
* });
|
|
833
|
+
* ```
|
|
834
|
+
* @example
|
|
835
|
+
* ```js
|
|
836
|
+
* // Fullscreen error (Errors during presenting of a liveboard)
|
|
837
|
+
* LiveboardEmbed.on(EmbedEvent.Error, (error) => {
|
|
838
|
+
* console.log(error);
|
|
839
|
+
* // { type: "Error", data: { errorType: "FULLSCREEN", error: {
|
|
840
|
+
* // message: "Fullscreen API is not enabled",
|
|
841
|
+
* // stack: "..."
|
|
842
|
+
* // } }}
|
|
884
843
|
* })
|
|
885
|
-
|
|
844
|
+
* ```
|
|
886
845
|
*/
|
|
887
|
-
EmbedEvent["
|
|
846
|
+
EmbedEvent["Error"] = "Error";
|
|
888
847
|
/**
|
|
889
|
-
*
|
|
890
|
-
*
|
|
891
|
-
*
|
|
892
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
848
|
+
* The embedded object has sent an alert.
|
|
849
|
+
* @returns alert - An alert object
|
|
850
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
893
851
|
* @example
|
|
894
|
-
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
* })
|
|
898
|
-
*```
|
|
852
|
+
* ```js
|
|
853
|
+
* searchEmbed.on(EmbedEvent.Alert)
|
|
854
|
+
* ```
|
|
899
855
|
*/
|
|
900
|
-
EmbedEvent["
|
|
856
|
+
EmbedEvent["Alert"] = "alert";
|
|
901
857
|
/**
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
858
|
+
* The ThoughtSpot auth session has expired.
|
|
859
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
905
860
|
* @example
|
|
906
861
|
*```js
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
*
|
|
911
|
-
*
|
|
912
|
-
* console.log('Export TML', payload)})
|
|
862
|
+
* appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
|
|
863
|
+
* //show auth expired banner
|
|
864
|
+
* function showAuthExpired() {
|
|
865
|
+
* document.getElementById("authExpiredBanner");
|
|
866
|
+
* }
|
|
913
867
|
*```
|
|
914
868
|
*/
|
|
915
|
-
EmbedEvent["
|
|
869
|
+
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
916
870
|
/**
|
|
917
|
-
*
|
|
918
|
-
* @
|
|
919
|
-
* @example
|
|
920
|
-
*```js
|
|
921
|
-
* appEmbed.on(EmbedEvent.SaveAsView, payload => {
|
|
922
|
-
* console.log('View', payload);
|
|
923
|
-
* })
|
|
924
|
-
*```
|
|
871
|
+
* ThoughtSpot failed to validate the auth session.
|
|
872
|
+
* @hidden
|
|
925
873
|
*/
|
|
926
|
-
EmbedEvent["
|
|
874
|
+
EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
|
|
927
875
|
/**
|
|
928
|
-
*
|
|
929
|
-
* @
|
|
930
|
-
* @example
|
|
931
|
-
*```js
|
|
932
|
-
* //emit when action starts
|
|
933
|
-
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
934
|
-
* console.log('Copy and edit', payload)}, {start: true })
|
|
935
|
-
* //emit when action ends
|
|
936
|
-
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
937
|
-
* console.log('Copy and edit', payload)})
|
|
938
|
-
*```
|
|
876
|
+
* ThoughtSpot failed to validate the auth session.
|
|
877
|
+
* @hidden
|
|
939
878
|
*/
|
|
940
|
-
EmbedEvent["
|
|
879
|
+
EmbedEvent["AuthLogout"] = "ThoughtspotAuthLogout";
|
|
941
880
|
/**
|
|
942
|
-
*
|
|
943
|
-
* @
|
|
881
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
882
|
+
* @returns data - The height of the embedded Liveboard or visualization
|
|
883
|
+
* @hidden
|
|
884
|
+
*/
|
|
885
|
+
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
886
|
+
/**
|
|
887
|
+
* The center of visible iframe viewport is calculated.
|
|
888
|
+
* @returns data - The center of the visible Iframe viewport.
|
|
889
|
+
* @hidden
|
|
890
|
+
*/
|
|
891
|
+
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
892
|
+
/**
|
|
893
|
+
* Emitted when the **Get Data** action is initiated.
|
|
894
|
+
* Applicable to `SearchBarEmbed` only.
|
|
895
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
944
896
|
* @example
|
|
945
897
|
*```js
|
|
946
|
-
*
|
|
947
|
-
*
|
|
898
|
+
* searchbarEmbed.on(EmbedEvent.GetDataClick)
|
|
899
|
+
* .then(data => {
|
|
900
|
+
* console.log('Answer Data:', data);
|
|
948
901
|
* })
|
|
949
902
|
*```
|
|
950
903
|
*/
|
|
951
|
-
EmbedEvent["
|
|
904
|
+
EmbedEvent["GetDataClick"] = "getDataClick";
|
|
952
905
|
/**
|
|
953
|
-
*
|
|
954
|
-
* @version SDK: 1.
|
|
906
|
+
* Detects the route change.
|
|
907
|
+
* @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
|
|
955
908
|
* @example
|
|
956
909
|
*```js
|
|
957
|
-
* searchEmbed.on(EmbedEvent.
|
|
958
|
-
* console.log('
|
|
959
|
-
* })
|
|
910
|
+
* searchEmbed.on(EmbedEvent.RouteChange, payload =>
|
|
911
|
+
* console.log('data', payload))
|
|
960
912
|
*```
|
|
961
913
|
*/
|
|
962
|
-
EmbedEvent["
|
|
914
|
+
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
963
915
|
/**
|
|
964
|
-
*
|
|
916
|
+
* The v1 event type for Data
|
|
965
917
|
* @hidden
|
|
966
918
|
*/
|
|
967
|
-
EmbedEvent["
|
|
919
|
+
EmbedEvent["V1Data"] = "exportVizDataToParent";
|
|
968
920
|
/**
|
|
969
|
-
* Emitted when
|
|
970
|
-
*
|
|
971
|
-
*
|
|
921
|
+
* Emitted when the embed does not have cookie access. This happens
|
|
922
|
+
* when Safari and other Web browsers block third-party cookies
|
|
923
|
+
* are blocked by default. `NoCookieAccess` can trigger
|
|
924
|
+
* @example
|
|
972
925
|
*```js
|
|
973
|
-
*
|
|
974
|
-
* console.log('Liveboard details', payload);
|
|
975
|
-
* })
|
|
926
|
+
* appEmbed.on(EmbedEvent.NoCookieAccess)
|
|
976
927
|
*```
|
|
928
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
|
|
977
929
|
*/
|
|
978
|
-
EmbedEvent["
|
|
930
|
+
EmbedEvent["NoCookieAccess"] = "noCookieAccess";
|
|
979
931
|
/**
|
|
980
|
-
* Emitted when
|
|
981
|
-
* @
|
|
932
|
+
* Emitted when SAML is complete
|
|
933
|
+
* @private
|
|
934
|
+
* @hidden
|
|
935
|
+
*/
|
|
936
|
+
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
937
|
+
/**
|
|
938
|
+
* Emitted when any modal is opened in the app
|
|
939
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
982
940
|
* @example
|
|
983
941
|
*```js
|
|
984
|
-
*
|
|
985
|
-
* console.log('
|
|
986
|
-
*
|
|
942
|
+
* appEmbed.on(EmbedEvent.DialogOpen, payload => {
|
|
943
|
+
* console.log('dialog open', payload);
|
|
944
|
+
* })
|
|
987
945
|
*```
|
|
988
946
|
*/
|
|
989
|
-
EmbedEvent["
|
|
947
|
+
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
990
948
|
/**
|
|
991
|
-
* Emitted when
|
|
992
|
-
* @version SDK: 1.
|
|
949
|
+
* Emitted when any modal is closed in the app
|
|
950
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
993
951
|
* @example
|
|
994
952
|
*```js
|
|
995
|
-
*
|
|
996
|
-
*
|
|
953
|
+
* appEmbed.on(EmbedEvent.DialogClose, payload => {
|
|
954
|
+
* console.log('dialog close', payload);
|
|
997
955
|
* })
|
|
998
956
|
*```
|
|
999
957
|
*/
|
|
1000
|
-
EmbedEvent["
|
|
958
|
+
EmbedEvent["DialogClose"] = "dialog-close";
|
|
1001
959
|
/**
|
|
1002
|
-
* Emitted when
|
|
1003
|
-
*
|
|
960
|
+
* Emitted when the Liveboard shell loads.
|
|
961
|
+
* You can use this event as a hook to trigger
|
|
962
|
+
* other events on the rendered Liveboard.
|
|
963
|
+
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
1004
964
|
* @example
|
|
1005
965
|
*```js
|
|
1006
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1007
|
-
|
|
1008
|
-
|
|
966
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
|
|
967
|
+
console.log('Liveboard is rendered', payload);
|
|
968
|
+
})
|
|
969
|
+
*```
|
|
970
|
+
* The following example shows how to trigger
|
|
971
|
+
* `SetVisibleVizs` event using LiveboardRendered embed event:
|
|
972
|
+
* @example
|
|
973
|
+
*```js
|
|
974
|
+
* const embedRef = useEmbedRef();
|
|
975
|
+
* const onLiveboardRendered = () => {
|
|
976
|
+
* embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
|
|
977
|
+
* };
|
|
1009
978
|
*```
|
|
1010
979
|
*/
|
|
1011
|
-
EmbedEvent["
|
|
980
|
+
EmbedEvent["LiveboardRendered"] = "PinboardRendered";
|
|
1012
981
|
/**
|
|
1013
|
-
*
|
|
1014
|
-
* @
|
|
982
|
+
* Emits all events.
|
|
983
|
+
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
1015
984
|
* @example
|
|
1016
985
|
*```js
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
986
|
+
* appEmbed.on(EmbedEvent.ALL, payload => {
|
|
987
|
+
* console.log('Embed Events', payload)
|
|
1019
988
|
* })
|
|
1020
989
|
*```
|
|
1021
990
|
*/
|
|
1022
|
-
EmbedEvent["
|
|
991
|
+
EmbedEvent["ALL"] = "*";
|
|
1023
992
|
/**
|
|
1024
|
-
* Emitted when
|
|
1025
|
-
* @
|
|
993
|
+
* Emitted when an Answer is saved in the app
|
|
994
|
+
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1026
995
|
* @example
|
|
1027
996
|
*```js
|
|
1028
|
-
*
|
|
997
|
+
* //Emit when action starts
|
|
998
|
+
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
999
|
+
* console.log('Save', payload)
|
|
1000
|
+
* }, {
|
|
1001
|
+
* start: true
|
|
1002
|
+
* })
|
|
1003
|
+
* //emit when action ends
|
|
1004
|
+
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
1005
|
+
* console.log('Save', payload)
|
|
1006
|
+
* })
|
|
1029
1007
|
*```
|
|
1008
|
+
*/
|
|
1009
|
+
EmbedEvent["Save"] = "save";
|
|
1010
|
+
/**
|
|
1011
|
+
* Emitted when the download action is triggered on an answer
|
|
1012
|
+
*
|
|
1013
|
+
* **Note**: This event is deprecated in v1.21.0.
|
|
1014
|
+
* To fire an event when a download action is initiated on a chart or table,
|
|
1015
|
+
* use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
|
|
1016
|
+
* or `EmbedEvent.DownloadAsXLSX`
|
|
1017
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1030
1018
|
* @example
|
|
1031
1019
|
*```js
|
|
1032
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1033
|
-
*
|
|
1020
|
+
* liveboardEmbed.on(EmbedEvent.Download, {
|
|
1021
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1034
1022
|
* })
|
|
1035
1023
|
*```
|
|
1036
1024
|
*/
|
|
1037
|
-
EmbedEvent["
|
|
1025
|
+
EmbedEvent["Download"] = "download";
|
|
1038
1026
|
/**
|
|
1039
|
-
* Emitted when
|
|
1040
|
-
* @version SDK: 1.
|
|
1027
|
+
* Emitted when the download action is triggered on an answer
|
|
1028
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
1041
1029
|
* @example
|
|
1042
1030
|
*```js
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1031
|
+
* //emit when action starts
|
|
1032
|
+
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
1033
|
+
* console.log('download PNG', payload)}, {start: true })
|
|
1034
|
+
* //emit when action ends
|
|
1035
|
+
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
1036
|
+
* console.log('download PNG', payload)})
|
|
1045
1037
|
*```
|
|
1046
1038
|
*/
|
|
1047
|
-
EmbedEvent["
|
|
1039
|
+
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
1048
1040
|
/**
|
|
1049
|
-
* Emitted when
|
|
1050
|
-
* @version SDK: 1.
|
|
1041
|
+
* Emitted when the Download as PDF action is triggered on an answer
|
|
1042
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1051
1043
|
* @example
|
|
1052
1044
|
*```js
|
|
1053
|
-
*
|
|
1045
|
+
* //emit when action starts
|
|
1046
|
+
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
1047
|
+
* console.log('download PDF', payload)}, {start: true })
|
|
1048
|
+
* //emit when action ends
|
|
1049
|
+
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
1050
|
+
* console.log('download PDF', payload)})
|
|
1054
1051
|
*```
|
|
1055
1052
|
*/
|
|
1056
|
-
EmbedEvent["
|
|
1053
|
+
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
1057
1054
|
/**
|
|
1058
|
-
* Emitted when
|
|
1059
|
-
* @version SDK: 1.
|
|
1055
|
+
* Emitted when the Download as CSV action is triggered on an answer
|
|
1056
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1060
1057
|
* @example
|
|
1061
1058
|
*```js
|
|
1062
|
-
*
|
|
1059
|
+
* //emit when action starts
|
|
1060
|
+
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
1061
|
+
* console.log('download CSV', payload)}, {start: true })
|
|
1062
|
+
* //emit when action ends
|
|
1063
|
+
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
1064
|
+
* console.log('download CSV', payload)})
|
|
1063
1065
|
*```
|
|
1064
1066
|
*/
|
|
1065
|
-
EmbedEvent["
|
|
1067
|
+
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
1066
1068
|
/**
|
|
1067
|
-
* Emitted when
|
|
1068
|
-
* @version SDK: 1.
|
|
1069
|
+
* Emitted when the Download as XLSX action is triggered on an answer
|
|
1070
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1069
1071
|
* @example
|
|
1070
1072
|
*```js
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
+
* //emit when action starts
|
|
1074
|
+
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
1075
|
+
* console.log('download Xlsx', payload)}, { start: true })
|
|
1076
|
+
* //emit when action ends
|
|
1077
|
+
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
1078
|
+
* console.log('download Xlsx', payload)})
|
|
1073
1079
|
*```
|
|
1074
1080
|
*/
|
|
1075
|
-
EmbedEvent["
|
|
1081
|
+
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
1076
1082
|
/**
|
|
1077
|
-
* Emitted when
|
|
1078
|
-
* @version SDK: 1.
|
|
1083
|
+
* Emitted when an Answer is deleted in the app
|
|
1084
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1079
1085
|
* @example
|
|
1080
1086
|
*```js
|
|
1081
|
-
*
|
|
1082
|
-
*
|
|
1087
|
+
* //emit when action starts
|
|
1088
|
+
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
1089
|
+
* console.log('delete answer', payload)}, {start: true })
|
|
1090
|
+
* //trigger when action is completed
|
|
1091
|
+
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
1092
|
+
* console.log('delete answer', payload)})
|
|
1083
1093
|
*```
|
|
1084
1094
|
*/
|
|
1085
|
-
EmbedEvent["
|
|
1095
|
+
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
1086
1096
|
/**
|
|
1087
|
-
* Emitted when
|
|
1088
|
-
* @version SDK: 1.
|
|
1097
|
+
* Emitted when an answer is pinned to a Liveboard
|
|
1098
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1089
1099
|
* @example
|
|
1090
1100
|
*```js
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1101
|
+
* //emit when action starts
|
|
1102
|
+
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
1103
|
+
* console.log('pin', payload)
|
|
1104
|
+
* }, {
|
|
1105
|
+
* start: true
|
|
1106
|
+
* })
|
|
1107
|
+
* //emit when action ends
|
|
1108
|
+
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
1109
|
+
* console.log('pin', payload)
|
|
1110
|
+
* })
|
|
1093
1111
|
*```
|
|
1094
1112
|
*/
|
|
1095
|
-
EmbedEvent["
|
|
1113
|
+
EmbedEvent["Pin"] = "pin";
|
|
1096
1114
|
/**
|
|
1097
|
-
* Emitted when
|
|
1098
|
-
* @version SDK: 1.
|
|
1115
|
+
* Emitted when SpotIQ analysis is triggered
|
|
1116
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1099
1117
|
* @example
|
|
1100
1118
|
*```js
|
|
1101
|
-
*
|
|
1102
|
-
*
|
|
1119
|
+
* //emit when action starts
|
|
1120
|
+
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
1121
|
+
* console.log('SpotIQAnalyze', payload)
|
|
1122
|
+
* }, {
|
|
1123
|
+
* start: true
|
|
1124
|
+
* })
|
|
1125
|
+
* //emit when action ends
|
|
1126
|
+
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
1127
|
+
* console.log('SpotIQ analyze', payload)
|
|
1103
1128
|
* })
|
|
1104
1129
|
*```
|
|
1105
1130
|
*/
|
|
1106
|
-
EmbedEvent["
|
|
1107
|
-
/**
|
|
1108
|
-
* Emitted when a user clicks **Insert to slide** on a visualization
|
|
1109
|
-
* @hidden
|
|
1110
|
-
*/
|
|
1111
|
-
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
1131
|
+
EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
1112
1132
|
/**
|
|
1113
|
-
* Emitted when a user
|
|
1114
|
-
*
|
|
1115
|
-
* filter details.
|
|
1133
|
+
* Emitted when a user shares an object with another user or group
|
|
1134
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1116
1135
|
* @example
|
|
1117
|
-
*
|
|
1118
1136
|
*```js
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1137
|
+
* //emit when action starts
|
|
1138
|
+
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
1139
|
+
* console.log('Share', payload)
|
|
1140
|
+
* }, {
|
|
1141
|
+
* start: true
|
|
1121
1142
|
* })
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1143
|
+
* //emit when action ends
|
|
1144
|
+
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
1145
|
+
* console.log('Share', payload)
|
|
1146
|
+
* })
|
|
1147
|
+
*```
|
|
1148
|
+
*/
|
|
1149
|
+
EmbedEvent["Share"] = "share";
|
|
1150
|
+
/**
|
|
1151
|
+
* Emitted when a user clicks the **Include** action to include a specific value or
|
|
1152
|
+
* data on a chart or table.
|
|
1153
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1124
1154
|
* @example
|
|
1125
|
-
*
|
|
1126
1155
|
*```js
|
|
1127
|
-
*
|
|
1128
|
-
* console.log('
|
|
1156
|
+
* appEmbed.on(EmbedEvent.DrillInclude, payload => {
|
|
1157
|
+
* console.log('Drill include', payload);
|
|
1129
1158
|
* })
|
|
1130
1159
|
*```
|
|
1131
1160
|
*/
|
|
1132
|
-
EmbedEvent["
|
|
1161
|
+
EmbedEvent["DrillInclude"] = "context-menu-item-include";
|
|
1133
1162
|
/**
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1163
|
+
* Emitted when a user clicks the **Exclude** action to exclude a specific value or
|
|
1164
|
+
* data on a chart or table
|
|
1165
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1166
|
+
* @example
|
|
1167
|
+
*```js
|
|
1168
|
+
* appEmbed.on(EmbedEvent.DrillExclude, payload => {
|
|
1169
|
+
* console.log('Drill exclude', payload);
|
|
1170
|
+
* })
|
|
1171
|
+
*```
|
|
1136
1172
|
*/
|
|
1137
|
-
EmbedEvent["
|
|
1173
|
+
EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
|
|
1138
1174
|
/**
|
|
1139
|
-
* Emitted when a
|
|
1140
|
-
* @version SDK
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
*
|
|
1145
|
-
*
|
|
1175
|
+
* Emitted when a column value is copied in the embedded app.
|
|
1176
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1177
|
+
* @example
|
|
1178
|
+
*```js
|
|
1179
|
+
* seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
|
|
1180
|
+
* console.log('copy to clipboard', payload);
|
|
1181
|
+
* })
|
|
1182
|
+
*```
|
|
1146
1183
|
*/
|
|
1147
|
-
EmbedEvent["
|
|
1184
|
+
EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
|
|
1148
1185
|
/**
|
|
1149
|
-
* Emitted when a user
|
|
1150
|
-
*
|
|
1186
|
+
* Emitted when a user clicks the **Update TML** action on
|
|
1187
|
+
* embedded Liveboard.
|
|
1188
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1189
|
+
* @example
|
|
1190
|
+
*```js
|
|
1191
|
+
* liveboardEmbed.on(EmbedEvent.UpdateTML)
|
|
1192
|
+
* })
|
|
1193
|
+
*```
|
|
1151
1194
|
*/
|
|
1152
|
-
EmbedEvent["
|
|
1195
|
+
EmbedEvent["UpdateTML"] = "updateTSL";
|
|
1153
1196
|
/**
|
|
1154
|
-
* Emitted when
|
|
1155
|
-
*
|
|
1156
|
-
* @
|
|
1157
|
-
* @
|
|
1158
|
-
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1197
|
+
* Emitted when a user clicks the **Edit TML** action
|
|
1198
|
+
* on an embedded Liveboard.
|
|
1199
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1200
|
+
* @example
|
|
1201
|
+
*```js
|
|
1202
|
+
* appEmbed.on(EmbedEvent.EditTML, payload => {
|
|
1203
|
+
* console.log('Edit TML', payload);
|
|
1204
|
+
* })
|
|
1205
|
+
*```
|
|
1161
1206
|
*/
|
|
1162
|
-
EmbedEvent["
|
|
1207
|
+
EmbedEvent["EditTML"] = "editTSL";
|
|
1163
1208
|
/**
|
|
1164
|
-
* Emitted when
|
|
1165
|
-
*
|
|
1166
|
-
* @
|
|
1167
|
-
* @
|
|
1168
|
-
|
|
1169
|
-
*
|
|
1209
|
+
* Emitted when the **Export TML** action is triggered on an
|
|
1210
|
+
* an embedded object in the app
|
|
1211
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1212
|
+
* @example
|
|
1213
|
+
*```js
|
|
1214
|
+
* //emit when action starts
|
|
1215
|
+
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
1216
|
+
* console.log('Export TML', payload)}, { start: true })
|
|
1217
|
+
* //emit when action ends
|
|
1218
|
+
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
1219
|
+
* console.log('Export TML', payload)})
|
|
1220
|
+
*```
|
|
1170
1221
|
*/
|
|
1171
|
-
EmbedEvent["
|
|
1222
|
+
EmbedEvent["ExportTML"] = "exportTSL";
|
|
1172
1223
|
/**
|
|
1173
|
-
* Emitted when
|
|
1174
|
-
* @
|
|
1175
|
-
* @
|
|
1176
|
-
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1224
|
+
* Emitted when an Answer is saved as a View.
|
|
1225
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1226
|
+
* @example
|
|
1227
|
+
*```js
|
|
1228
|
+
* appEmbed.on(EmbedEvent.SaveAsView, payload => {
|
|
1229
|
+
* console.log('View', payload);
|
|
1230
|
+
* })
|
|
1231
|
+
*```
|
|
1179
1232
|
*/
|
|
1180
|
-
EmbedEvent["
|
|
1233
|
+
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
1181
1234
|
/**
|
|
1182
|
-
* Emitted when a
|
|
1183
|
-
* @
|
|
1184
|
-
* @
|
|
1185
|
-
|
|
1235
|
+
* Emitted when the user creates a copy of an Answer
|
|
1236
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1237
|
+
* @example
|
|
1238
|
+
*```js
|
|
1239
|
+
* //emit when action starts
|
|
1240
|
+
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
1241
|
+
* console.log('Copy and edit', payload)}, {start: true })
|
|
1242
|
+
* //emit when action ends
|
|
1243
|
+
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
1244
|
+
* console.log('Copy and edit', payload)})
|
|
1245
|
+
*```
|
|
1186
1246
|
*/
|
|
1187
|
-
EmbedEvent["
|
|
1247
|
+
EmbedEvent["CopyAEdit"] = "copyAEdit";
|
|
1188
1248
|
/**
|
|
1189
|
-
* Emitted when a user
|
|
1190
|
-
* @version SDK
|
|
1249
|
+
* Emitted when a user clicks Show underlying data on an Answer
|
|
1250
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1251
|
+
* @example
|
|
1252
|
+
*```js
|
|
1253
|
+
* liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => {
|
|
1254
|
+
* console.log('show data', payload);
|
|
1255
|
+
* })
|
|
1256
|
+
*```
|
|
1191
1257
|
*/
|
|
1192
|
-
EmbedEvent["
|
|
1258
|
+
EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
1193
1259
|
/**
|
|
1194
|
-
* Emitted when
|
|
1195
|
-
* @
|
|
1196
|
-
* @
|
|
1197
|
-
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1260
|
+
* Emitted when an answer is switched to a chart or table view.
|
|
1261
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1262
|
+
* @example
|
|
1263
|
+
*```js
|
|
1264
|
+
* searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
|
|
1265
|
+
* console.log('switch view', payload);
|
|
1266
|
+
* })
|
|
1267
|
+
*```
|
|
1200
1268
|
*/
|
|
1201
|
-
EmbedEvent["
|
|
1269
|
+
EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
1202
1270
|
/**
|
|
1203
|
-
*
|
|
1204
|
-
* @
|
|
1271
|
+
* Internal event to communicate the initial settings back to the ThoughtSpot app
|
|
1272
|
+
* @hidden
|
|
1205
1273
|
*/
|
|
1206
|
-
EmbedEvent["
|
|
1274
|
+
EmbedEvent["APP_INIT"] = "appInit";
|
|
1207
1275
|
/**
|
|
1208
|
-
* Emitted when user
|
|
1209
|
-
*
|
|
1210
|
-
*
|
|
1211
|
-
* event
|
|
1212
|
-
*
|
|
1276
|
+
* Emitted when a user clicks **Show Liveboard details** on a Liveboard
|
|
1277
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1278
|
+
* @example
|
|
1213
1279
|
*```js
|
|
1214
|
-
*
|
|
1215
|
-
*
|
|
1216
|
-
*
|
|
1217
|
-
* execute: true,
|
|
1218
|
-
* error: {errorText: "My own customised error"}
|
|
1219
|
-
* }})
|
|
1220
|
-
* })
|
|
1280
|
+
* liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
|
|
1281
|
+
* console.log('Liveboard details', payload);
|
|
1282
|
+
* })
|
|
1221
1283
|
*```
|
|
1222
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
|
|
1223
1284
|
*/
|
|
1224
|
-
EmbedEvent["
|
|
1285
|
+
EmbedEvent["LiveboardInfo"] = "pinboardInfo";
|
|
1225
1286
|
/**
|
|
1226
|
-
* Emitted when
|
|
1227
|
-
* @version SDK
|
|
1287
|
+
* Emitted when a user clicks on the Favorite icon on a Liveboard
|
|
1288
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1289
|
+
* @example
|
|
1290
|
+
*```js
|
|
1291
|
+
* liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
|
|
1292
|
+
* console.log('favorites', payload);
|
|
1293
|
+
* })
|
|
1294
|
+
*```
|
|
1228
1295
|
*/
|
|
1229
|
-
EmbedEvent["
|
|
1230
|
-
})(EmbedEvent || (EmbedEvent = {}));
|
|
1231
|
-
/**
|
|
1232
|
-
* Event types that can be triggered by the host application
|
|
1233
|
-
* to the embedded ThoughtSpot app
|
|
1234
|
-
*
|
|
1235
|
-
* To trigger an event use the corresponding
|
|
1236
|
-
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
|
|
1237
|
-
* SearchEmbed.trigger} method.
|
|
1238
|
-
* @example
|
|
1239
|
-
* ```js
|
|
1240
|
-
* import { HostEvent } from '@thoughtspot/visual-embed-sdk';
|
|
1241
|
-
* // Or
|
|
1242
|
-
* // const { HostEvent } = window.tsembed;
|
|
1243
|
-
*
|
|
1244
|
-
* // create the liveboard embed.
|
|
1245
|
-
*
|
|
1246
|
-
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1247
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
|
|
1248
|
-
* ]);
|
|
1249
|
-
* ```
|
|
1250
|
-
* @group Events
|
|
1251
|
-
*/
|
|
1252
|
-
// eslint-disable-next-line no-shadow
|
|
1253
|
-
var HostEvent;
|
|
1254
|
-
(function (HostEvent) {
|
|
1296
|
+
EmbedEvent["AddToFavorites"] = "addToFavorites";
|
|
1255
1297
|
/**
|
|
1256
|
-
*
|
|
1257
|
-
*
|
|
1258
|
-
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
1259
|
-
* Includes the following properties:
|
|
1260
|
-
* @param - `searchQuery` - query string with search tokens
|
|
1261
|
-
* @param - `dataSources` - Data source GUID to Search on
|
|
1262
|
-
* - Although an array, only a single source
|
|
1263
|
-
* is supported.
|
|
1264
|
-
* @param - `execute` - executes search and updates the existing query
|
|
1298
|
+
* Emitted when a user clicks **Schedule** on a Liveboard
|
|
1299
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1265
1300
|
* @example
|
|
1266
|
-
|
|
1267
|
-
*
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
});
|
|
1272
|
-
* ```
|
|
1301
|
+
*```js
|
|
1302
|
+
* liveboardEmbed.on(EmbedEvent.Schedule, payload => {
|
|
1303
|
+
* console.log(`Liveboard schedule', payload);
|
|
1304
|
+
* })
|
|
1305
|
+
*```
|
|
1273
1306
|
*/
|
|
1274
|
-
|
|
1307
|
+
EmbedEvent["Schedule"] = "subscription";
|
|
1275
1308
|
/**
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
* @param - points - an object containing selectedPoints/clickedPoints
|
|
1279
|
-
* to drill to. For example, { selectedPoints: []}
|
|
1280
|
-
* @param - columnGuid - Optional. GUID of the column to drill
|
|
1281
|
-
* by. If not provided it will auto drill by the configured
|
|
1282
|
-
* column.
|
|
1283
|
-
* @param - autoDrillDown - Optional. If true, the drill down will be
|
|
1284
|
-
* done automatically on the most popular column.
|
|
1285
|
-
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1286
|
-
* in case of a liveboard.
|
|
1309
|
+
* Emitted when a user clicks **Edit** on a Liveboard or visualization
|
|
1310
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1287
1311
|
* @example
|
|
1288
|
-
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
* const clickedPoint = payload.data.clickedPoint;
|
|
1292
|
-
* const selectedPoint = payload.data.selectedPoints;
|
|
1293
|
-
* console.log('>>> called', clickedPoint);
|
|
1294
|
-
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
1295
|
-
* points: {
|
|
1296
|
-
* clickedPoint,
|
|
1297
|
-
* selectedPoints: selectedPoint
|
|
1298
|
-
* },
|
|
1299
|
-
* autoDrillDown: true,
|
|
1300
|
-
* });
|
|
1312
|
+
*```js
|
|
1313
|
+
* liveboardEmbed.on(EmbedEvent.Edit, payload => {
|
|
1314
|
+
* console.log(`Liveboard edit', payload);
|
|
1301
1315
|
* })
|
|
1302
|
-
|
|
1316
|
+
*```
|
|
1317
|
+
*/
|
|
1318
|
+
EmbedEvent["Edit"] = "edit";
|
|
1319
|
+
/**
|
|
1320
|
+
* Emitted when a user clicks *Make a copy* on a Liveboard
|
|
1321
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1303
1322
|
* @example
|
|
1304
|
-
|
|
1305
|
-
*
|
|
1306
|
-
*
|
|
1307
|
-
*
|
|
1308
|
-
|
|
1309
|
-
* const clickedPoint = payload.data.clickedPoint;
|
|
1310
|
-
* const selectedPoint = payload.data.selectedPoints;
|
|
1311
|
-
* console.log('>>> called', clickedPoint);
|
|
1312
|
-
* liveboardEmbed.trigger(HostEvent.DrillDown, {
|
|
1313
|
-
* points: {
|
|
1314
|
-
* clickedPoint,
|
|
1315
|
-
* selectedPoints: selectedPoint
|
|
1316
|
-
* },
|
|
1317
|
-
* columnGuid: "<guid of the column to drill>",
|
|
1318
|
-
* vizId: payload.data.vizId
|
|
1319
|
-
* });
|
|
1320
|
-
* })
|
|
1321
|
-
* ```
|
|
1322
|
-
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
1323
|
-
*/
|
|
1324
|
-
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
1325
|
-
/**
|
|
1326
|
-
* Apply filters
|
|
1327
|
-
* @hidden
|
|
1328
|
-
*/
|
|
1329
|
-
HostEvent["Filter"] = "filter";
|
|
1330
|
-
/**
|
|
1331
|
-
* Reload the answer or visualization
|
|
1332
|
-
* @hidden
|
|
1323
|
+
*```js
|
|
1324
|
+
* liveboardEmbed.on(EmbedEvent.MakeACopy, payload => {
|
|
1325
|
+
* console.log(`Copy', payload);
|
|
1326
|
+
* })
|
|
1327
|
+
*```
|
|
1333
1328
|
*/
|
|
1334
|
-
|
|
1329
|
+
EmbedEvent["MakeACopy"] = "makeACopy";
|
|
1335
1330
|
/**
|
|
1336
|
-
*
|
|
1337
|
-
* @
|
|
1338
|
-
* in this parameter will be hidden.
|
|
1331
|
+
* Emitted when a user clicks **Present** on a Liveboard or visualization
|
|
1332
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1339
1333
|
* @example
|
|
1340
|
-
|
|
1341
|
-
* liveboardEmbed.
|
|
1342
|
-
|
|
1343
|
-
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
1344
|
-
* ```
|
|
1345
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
1346
|
-
*/
|
|
1347
|
-
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
1348
|
-
/**
|
|
1349
|
-
* Set a Liveboard tab as an active tab.
|
|
1350
|
-
* @param - tabId - string of id of Tab to show
|
|
1334
|
+
*```js
|
|
1335
|
+
* liveboardEmbed.on(EmbedEvent.Present)
|
|
1336
|
+
*```
|
|
1351
1337
|
* @example
|
|
1352
|
-
|
|
1353
|
-
* liveboardEmbed.
|
|
1354
|
-
*
|
|
1338
|
+
*```js
|
|
1339
|
+
* liveboardEmbed.on(EmbedEvent.Present, {
|
|
1340
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1355
1341
|
* })
|
|
1356
|
-
|
|
1357
|
-
* @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
|
|
1358
|
-
*/
|
|
1359
|
-
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
1360
|
-
/**
|
|
1361
|
-
* Update runtime filters applied on a Saved Answer or Liveboard. The
|
|
1362
|
-
* runtime filters passed here are appended to the existing runtime
|
|
1363
|
-
* filters.
|
|
1364
|
-
* Pass an array of runtime filters with the following attributes:
|
|
1365
|
-
*
|
|
1366
|
-
* `columnName`
|
|
1367
|
-
* _String_. The name of the column to filter on.
|
|
1368
|
-
*
|
|
1369
|
-
* `operator`
|
|
1370
|
-
* Runtime filter operator to apply. For information,
|
|
1371
|
-
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
1372
|
-
*
|
|
1373
|
-
* `values`
|
|
1374
|
-
* List of operands. Some operators such as EQ, LE allow a single value, whereas
|
|
1375
|
-
* operators such as BW and IN accept multiple operands.
|
|
1376
|
-
*
|
|
1377
|
-
* **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
|
|
1378
|
-
* Search embedding (SearchEmbed) and Natural Language Search
|
|
1379
|
-
* embedding (SageEmbed).
|
|
1380
|
-
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
1381
|
-
* @example
|
|
1382
|
-
* ```js
|
|
1383
|
-
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1384
|
-
* {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
|
|
1385
|
-
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
1386
|
-
* ])
|
|
1387
|
-
* ```
|
|
1388
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
1389
|
-
* @important
|
|
1342
|
+
*```
|
|
1390
1343
|
*/
|
|
1391
|
-
|
|
1344
|
+
EmbedEvent["Present"] = "present";
|
|
1392
1345
|
/**
|
|
1393
|
-
*
|
|
1394
|
-
*
|
|
1395
|
-
* @param - `path` - the path to navigate to to go forward or back. The path value can
|
|
1396
|
-
* be a number; for example, `1`, `-1`.
|
|
1346
|
+
* Emitted when a user clicks **Delete** on a visualization
|
|
1347
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1397
1348
|
* @example
|
|
1398
|
-
|
|
1399
|
-
*
|
|
1400
|
-
*
|
|
1401
|
-
|
|
1349
|
+
*```js
|
|
1350
|
+
* liveboardEmbed.on(EmbedEvent.Delete,
|
|
1351
|
+
* {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1352
|
+
*```
|
|
1402
1353
|
*/
|
|
1403
|
-
|
|
1354
|
+
EmbedEvent["Delete"] = "delete";
|
|
1404
1355
|
/**
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
1407
|
-
* @param - { columnId: string,
|
|
1408
|
-
* name: string,
|
|
1409
|
-
* type: INT64/CHAR/DATE,
|
|
1410
|
-
* dataType: ATTRIBUTE/MEASURE }
|
|
1356
|
+
* Emitted when a user clicks Manage schedules on a Liveboard
|
|
1357
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1411
1358
|
* @example
|
|
1412
|
-
|
|
1413
|
-
*
|
|
1414
|
-
|
|
1415
|
-
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
1416
|
-
* { columnId: '<column-GUID>'})
|
|
1417
|
-
* ```
|
|
1418
|
-
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1359
|
+
*```js
|
|
1360
|
+
* liveboardEmbed.on(EmbedEvent.SchedulesList)
|
|
1361
|
+
*```
|
|
1419
1362
|
*/
|
|
1420
|
-
|
|
1363
|
+
EmbedEvent["SchedulesList"] = "schedule-list";
|
|
1421
1364
|
/**
|
|
1422
|
-
*
|
|
1423
|
-
* @
|
|
1365
|
+
* Emitted when a user clicks **Cancel** in edit mode on a Liveboard
|
|
1366
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1424
1367
|
* @example
|
|
1425
|
-
|
|
1426
|
-
*
|
|
1427
|
-
|
|
1428
|
-
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1368
|
+
*```js
|
|
1369
|
+
* liveboardEmbed.on(EmbedEvent.Cancel)
|
|
1370
|
+
*```
|
|
1429
1371
|
*/
|
|
1430
|
-
|
|
1372
|
+
EmbedEvent["Cancel"] = "cancel";
|
|
1431
1373
|
/**
|
|
1432
|
-
*
|
|
1433
|
-
* @
|
|
1374
|
+
* Emitted when a user clicks **Explore** on a visualization
|
|
1375
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1434
1376
|
* @example
|
|
1435
|
-
|
|
1436
|
-
*
|
|
1437
|
-
*
|
|
1438
|
-
|
|
1377
|
+
*```js
|
|
1378
|
+
* liveboardEmbed.on(EmbedEvent.Explore, {
|
|
1379
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1380
|
+
*```
|
|
1439
1381
|
*/
|
|
1440
|
-
|
|
1382
|
+
EmbedEvent["Explore"] = "explore";
|
|
1441
1383
|
/**
|
|
1442
|
-
*
|
|
1443
|
-
*
|
|
1444
|
-
* Liveboard filters, runtime filters applied on visualizations on a
|
|
1445
|
-
* Liveboard, and Liveboard layout, changes to visualizations such as
|
|
1446
|
-
* sorting, toggling of legends, and data drill down.
|
|
1384
|
+
* Emitted when a user clicks **Copy link** action on a visualization
|
|
1385
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1447
1386
|
* @example
|
|
1448
|
-
|
|
1449
|
-
* liveboardEmbed.
|
|
1450
|
-
*
|
|
1451
|
-
|
|
1452
|
-
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
|
|
1387
|
+
*```js
|
|
1388
|
+
* liveboardEmbed.on(EmbedEvent.CopyLink, {
|
|
1389
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1390
|
+
*```
|
|
1453
1391
|
*/
|
|
1454
|
-
|
|
1392
|
+
EmbedEvent["CopyLink"] = "embedDocument";
|
|
1455
1393
|
/**
|
|
1456
|
-
*
|
|
1457
|
-
* @
|
|
1458
|
-
* key. Can be left undefined when embedding Search, full app, or
|
|
1459
|
-
* a visualization.
|
|
1394
|
+
* Emitted when a user interacts with cross filters on a visualization or Liveboard
|
|
1395
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
1460
1396
|
* @example
|
|
1461
|
-
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1464
|
-
|
|
1465
|
-
* searchEmbed.trigger(HostEvent.Pin)
|
|
1466
|
-
* ```
|
|
1467
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1397
|
+
*```js
|
|
1398
|
+
* liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
|
|
1399
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1400
|
+
*```
|
|
1468
1401
|
*/
|
|
1469
|
-
|
|
1402
|
+
EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
|
|
1470
1403
|
/**
|
|
1471
|
-
*
|
|
1472
|
-
*
|
|
1404
|
+
* Emitted when a user right clicks on a visualization (chart or table)
|
|
1405
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
|
|
1473
1406
|
* @example
|
|
1474
1407
|
*```js
|
|
1475
|
-
*
|
|
1408
|
+
* LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => {
|
|
1409
|
+
* console.log('VizPointClick', payload)
|
|
1410
|
+
* })
|
|
1476
1411
|
*```
|
|
1477
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1478
1412
|
*/
|
|
1479
|
-
|
|
1413
|
+
EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
|
|
1480
1414
|
/**
|
|
1481
|
-
*
|
|
1482
|
-
* @
|
|
1483
|
-
* ```js
|
|
1484
|
-
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
1485
|
-
* ```
|
|
1486
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1415
|
+
* Emitted when a user clicks **Insert to slide** on a visualization
|
|
1416
|
+
* @hidden
|
|
1487
1417
|
*/
|
|
1488
|
-
|
|
1418
|
+
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
1489
1419
|
/**
|
|
1490
|
-
*
|
|
1420
|
+
* Emitted when a user changes any filter on a Liveboard.
|
|
1421
|
+
* Returns filter type and name, column name and ID, and runtime
|
|
1422
|
+
* filter details.
|
|
1491
1423
|
* @example
|
|
1492
|
-
* ```js
|
|
1493
|
-
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
1494
|
-
* ```
|
|
1495
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1496
|
-
*/
|
|
1497
|
-
HostEvent["SchedulesList"] = "schedule-list";
|
|
1498
|
-
/**
|
|
1499
|
-
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
1500
|
-
* Answer.
|
|
1501
1424
|
*
|
|
1502
|
-
|
|
1503
|
-
*
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1425
|
+
*```js
|
|
1426
|
+
* LiveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
|
|
1427
|
+
* console.log('payload', payload);
|
|
1428
|
+
* })
|
|
1506
1429
|
*
|
|
1507
|
-
* @version SDK: 1.
|
|
1430
|
+
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
|
|
1508
1431
|
*/
|
|
1509
|
-
|
|
1432
|
+
EmbedEvent["FilterChanged"] = "filterChanged";
|
|
1510
1433
|
/**
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* @example
|
|
1516
|
-
* ```js
|
|
1517
|
-
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
1518
|
-
* ```
|
|
1519
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1434
|
+
* Emitted when a user clicks the **Go** button on the Search page
|
|
1435
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
1520
1436
|
*/
|
|
1521
|
-
|
|
1437
|
+
EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
|
|
1522
1438
|
/**
|
|
1523
|
-
*
|
|
1524
|
-
* @
|
|
1525
|
-
* ```js
|
|
1526
|
-
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
1527
|
-
* ```
|
|
1528
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1439
|
+
* Emitted when a user selects a data source.
|
|
1440
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
1529
1441
|
*/
|
|
1530
|
-
|
|
1442
|
+
EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
|
|
1531
1443
|
/**
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1444
|
+
* Emitted when a user updates a connection on the **Data** page
|
|
1445
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
1446
|
+
*/
|
|
1447
|
+
EmbedEvent["UpdateConnection"] = "updateConnection";
|
|
1448
|
+
/**
|
|
1449
|
+
* Emitted when a user updates a connection on the **Data** page
|
|
1450
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
1451
|
+
*/
|
|
1452
|
+
EmbedEvent["CreateConnection"] = "createConnection";
|
|
1453
|
+
/**
|
|
1454
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1455
|
+
* Personalised view is updated.
|
|
1456
|
+
* @returns viewName: string
|
|
1457
|
+
* @returns viewId: string
|
|
1458
|
+
* @returns liveboardId: string
|
|
1459
|
+
* @returns isPublic: boolean
|
|
1460
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
1461
|
+
*/
|
|
1462
|
+
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1463
|
+
/**
|
|
1464
|
+
* Emitted when a Personalised view is saved.
|
|
1465
|
+
* @returns viewName: string
|
|
1466
|
+
* @returns viewId: string
|
|
1467
|
+
* @returns liveboardId: string
|
|
1468
|
+
* @returns isPublic: boolean
|
|
1469
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
1470
|
+
*/
|
|
1471
|
+
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1472
|
+
/**
|
|
1473
|
+
* Emitted when a Liveboard is reset.
|
|
1474
|
+
* @returns viewName: string
|
|
1475
|
+
* @returns viewId: string
|
|
1476
|
+
* @returns liveboardId: string
|
|
1477
|
+
* @returns isPublic: boolean
|
|
1478
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
1479
|
+
*/
|
|
1480
|
+
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1481
|
+
/**
|
|
1482
|
+
* Emitted when a PersonalisedView is deleted.
|
|
1483
|
+
* @returns views: string[]
|
|
1484
|
+
* @returns liveboardId: string
|
|
1485
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
1486
|
+
*/
|
|
1487
|
+
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1488
|
+
/**
|
|
1489
|
+
* Emitted when a user creates a new worksheet
|
|
1490
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1491
|
+
*/
|
|
1492
|
+
EmbedEvent["CreateWorksheet"] = "createWorksheet";
|
|
1493
|
+
/**
|
|
1494
|
+
* Emitted when Ask Sage is initialized.
|
|
1495
|
+
* @returns viewName: string
|
|
1496
|
+
* @returns viewId: string
|
|
1497
|
+
* @returns liveboardId: string
|
|
1498
|
+
* @returns isPublic: boolean
|
|
1499
|
+
* @version SDK : 1.29.0 | Thoughtspot: 9.12.0.cl
|
|
1500
|
+
*/
|
|
1501
|
+
EmbedEvent["AskSageInit"] = "AskSageInit";
|
|
1502
|
+
/**
|
|
1503
|
+
* Emitted when a LB/viz is renamed
|
|
1504
|
+
* @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl
|
|
1505
|
+
*/
|
|
1506
|
+
EmbedEvent["Rename"] = "rename";
|
|
1507
|
+
/**
|
|
1508
|
+
* Emitted when user wants to intercept the search execution
|
|
1534
1509
|
*
|
|
1535
|
-
*
|
|
1536
|
-
*
|
|
1510
|
+
* Make isOnBeforeGetVizDataEnabled : true to use this embed
|
|
1511
|
+
* event
|
|
1537
1512
|
*
|
|
1513
|
+
*```js
|
|
1514
|
+
* searchEmbed.on(EmbedEvent.OnBeforeGetVizData, (payload, responder) => {
|
|
1515
|
+
* responder({
|
|
1516
|
+
* data: {
|
|
1517
|
+
* execute: true,
|
|
1518
|
+
* error: {errorText: "My own customised error"}
|
|
1519
|
+
* }})
|
|
1520
|
+
* })
|
|
1521
|
+
*```
|
|
1522
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
|
|
1523
|
+
*/
|
|
1524
|
+
EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
|
|
1525
|
+
/**
|
|
1526
|
+
* Emitted when runtime parameters changes
|
|
1527
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
|
|
1528
|
+
*/
|
|
1529
|
+
EmbedEvent["ParameterChanged"] = "ParameterChanged";
|
|
1530
|
+
})(EmbedEvent || (EmbedEvent = {}));
|
|
1531
|
+
/**
|
|
1532
|
+
* Event types that can be triggered by the host application
|
|
1533
|
+
* to the embedded ThoughtSpot app
|
|
1534
|
+
*
|
|
1535
|
+
* To trigger an event use the corresponding
|
|
1536
|
+
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
|
|
1537
|
+
* SearchEmbed.trigger} method.
|
|
1538
|
+
* @example
|
|
1539
|
+
* ```js
|
|
1540
|
+
* import { HostEvent } from '@thoughtspot/visual-embed-sdk';
|
|
1541
|
+
* // Or
|
|
1542
|
+
* // const { HostEvent } = window.tsembed;
|
|
1543
|
+
*
|
|
1544
|
+
* // create the liveboard embed.
|
|
1545
|
+
*
|
|
1546
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1547
|
+
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
|
|
1548
|
+
* ]);
|
|
1549
|
+
* ```
|
|
1550
|
+
* @group Events
|
|
1551
|
+
*/
|
|
1552
|
+
// eslint-disable-next-line no-shadow
|
|
1553
|
+
var HostEvent;
|
|
1554
|
+
(function (HostEvent) {
|
|
1555
|
+
/**
|
|
1556
|
+
* Triggers a search operation with the search tokens specified in
|
|
1557
|
+
* the search query string.
|
|
1558
|
+
* Supported in `AppEmbed` and `SearchEmbed` deployments.
|
|
1559
|
+
* Includes the following properties:
|
|
1560
|
+
* @param - `searchQuery` - query string with search tokens
|
|
1561
|
+
* @param - `dataSources` - Data source GUID to Search on
|
|
1562
|
+
* - Although an array, only a single source
|
|
1563
|
+
* is supported.
|
|
1564
|
+
* @param - `execute` - executes search and updates the existing query
|
|
1538
1565
|
* @example
|
|
1539
1566
|
* ```js
|
|
1540
|
-
*
|
|
1567
|
+
* searchembed.trigger(HostEvent.Search, {
|
|
1568
|
+
searchQuery: "[sales] by [item type]",
|
|
1569
|
+
dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
|
|
1570
|
+
execute: true
|
|
1571
|
+
});
|
|
1541
1572
|
* ```
|
|
1542
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1543
1573
|
*/
|
|
1544
|
-
HostEvent["
|
|
1574
|
+
HostEvent["Search"] = "search";
|
|
1545
1575
|
/**
|
|
1546
|
-
*
|
|
1547
|
-
*
|
|
1576
|
+
* Triggers a drill on certain points of the specified column
|
|
1577
|
+
* Includes the following properties:
|
|
1578
|
+
* @param - points - an object containing selectedPoints/clickedPoints
|
|
1579
|
+
* to drill to. For example, { selectedPoints: []}
|
|
1580
|
+
* @param - columnGuid - Optional. GUID of the column to drill
|
|
1581
|
+
* by. If not provided it will auto drill by the configured
|
|
1582
|
+
* column.
|
|
1583
|
+
* @param - autoDrillDown - Optional. If true, the drill down will be
|
|
1584
|
+
* done automatically on the most popular column.
|
|
1585
|
+
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1586
|
+
* in case of a liveboard.
|
|
1548
1587
|
* @example
|
|
1549
1588
|
* ```js
|
|
1550
|
-
*
|
|
1551
|
-
*
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1589
|
+
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
1590
|
+
* console.log(payload);
|
|
1591
|
+
* const clickedPoint = payload.data.clickedPoint;
|
|
1592
|
+
* const selectedPoint = payload.data.selectedPoints;
|
|
1593
|
+
* console.log('>>> called', clickedPoint);
|
|
1594
|
+
* searchEmbed.trigger(HostEvent.DrillDown, {
|
|
1595
|
+
* points: {
|
|
1596
|
+
* clickedPoint,
|
|
1597
|
+
* selectedPoints: selectedPoint
|
|
1598
|
+
* },
|
|
1599
|
+
* autoDrillDown: true,
|
|
1600
|
+
* });
|
|
1601
|
+
* })
|
|
1554
1602
|
* ```
|
|
1603
|
+
* @example
|
|
1555
1604
|
* ```js
|
|
1556
|
-
*
|
|
1605
|
+
* // Works with TS 9.8.0 and above
|
|
1606
|
+
*
|
|
1607
|
+
* liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
1608
|
+
* console.log(payload);
|
|
1609
|
+
* const clickedPoint = payload.data.clickedPoint;
|
|
1610
|
+
* const selectedPoint = payload.data.selectedPoints;
|
|
1611
|
+
* console.log('>>> called', clickedPoint);
|
|
1612
|
+
* liveboardEmbed.trigger(HostEvent.DrillDown, {
|
|
1613
|
+
* points: {
|
|
1614
|
+
* clickedPoint,
|
|
1615
|
+
* selectedPoints: selectedPoint
|
|
1616
|
+
* },
|
|
1617
|
+
* columnGuid: "<guid of the column to drill>",
|
|
1618
|
+
* vizId: payload.data.vizId
|
|
1619
|
+
* });
|
|
1620
|
+
* })
|
|
1557
1621
|
* ```
|
|
1558
|
-
* @version SDK: 1.
|
|
1622
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
1559
1623
|
*/
|
|
1560
|
-
HostEvent["
|
|
1624
|
+
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
1561
1625
|
/**
|
|
1562
|
-
*
|
|
1563
|
-
* @
|
|
1564
|
-
* ```js
|
|
1565
|
-
* appEmbed.trigger(HostEvent.Remove)
|
|
1566
|
-
* ```
|
|
1567
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1626
|
+
* Apply filters
|
|
1627
|
+
* @hidden
|
|
1568
1628
|
*/
|
|
1569
|
-
HostEvent["
|
|
1629
|
+
HostEvent["Filter"] = "filter";
|
|
1570
1630
|
/**
|
|
1571
|
-
*
|
|
1572
|
-
* @
|
|
1573
|
-
* @example
|
|
1574
|
-
* ```js
|
|
1575
|
-
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1576
|
-
* ```
|
|
1577
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1631
|
+
* Reload the answer or visualization
|
|
1632
|
+
* @hidden
|
|
1578
1633
|
*/
|
|
1579
|
-
HostEvent["
|
|
1634
|
+
HostEvent["Reload"] = "reload";
|
|
1580
1635
|
/**
|
|
1581
|
-
*
|
|
1582
|
-
* @param -
|
|
1636
|
+
* Display specific visualizations on a Liveboard.
|
|
1637
|
+
* @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
|
|
1638
|
+
* in this parameter will be hidden.
|
|
1583
1639
|
* @example
|
|
1584
1640
|
* ```js
|
|
1585
|
-
* liveboardEmbed.trigger(HostEvent.
|
|
1586
|
-
*
|
|
1587
|
-
*
|
|
1641
|
+
* liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
|
|
1642
|
+
* '730496d6-6903-4601-937e-2c691821af3c',
|
|
1643
|
+
* 'd547ec54-2a37-4516-a222-2b06719af726'])
|
|
1588
1644
|
* ```
|
|
1589
|
-
* @version SDK: 1.
|
|
1645
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
1590
1646
|
*/
|
|
1591
|
-
HostEvent["
|
|
1647
|
+
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
1592
1648
|
/**
|
|
1593
|
-
*
|
|
1594
|
-
* @param -
|
|
1649
|
+
* Set a Liveboard tab as an active tab.
|
|
1650
|
+
* @param - tabId - string of id of Tab to show
|
|
1595
1651
|
* @example
|
|
1596
1652
|
* ```js
|
|
1597
|
-
* liveboardEmbed.trigger(HostEvent.
|
|
1598
|
-
*
|
|
1653
|
+
* liveboardEmbed.trigger(HostEvent.SetActiveTab,{
|
|
1654
|
+
* tabId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
1599
1655
|
* })
|
|
1600
1656
|
* ```
|
|
1601
|
-
* @version SDK: 1.
|
|
1657
|
+
* @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
|
|
1602
1658
|
*/
|
|
1603
|
-
HostEvent["
|
|
1659
|
+
HostEvent["SetActiveTab"] = "SetActiveTab";
|
|
1604
1660
|
/**
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1661
|
+
* Update runtime filters applied on a Saved Answer or Liveboard. The
|
|
1662
|
+
* runtime filters passed here are appended to the existing runtime
|
|
1663
|
+
* filters.
|
|
1664
|
+
* Pass an array of runtime filters with the following attributes:
|
|
1607
1665
|
*
|
|
1608
|
-
*
|
|
1666
|
+
* `columnName`
|
|
1667
|
+
* _String_. The name of the column to filter on.
|
|
1609
1668
|
*
|
|
1610
|
-
*
|
|
1611
|
-
*
|
|
1669
|
+
* `operator`
|
|
1670
|
+
* Runtime filter operator to apply. For information,
|
|
1671
|
+
* see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
|
|
1672
|
+
*
|
|
1673
|
+
* `values`
|
|
1674
|
+
* List of operands. Some operators such as EQ, LE allow a single value, whereas
|
|
1675
|
+
* operators such as BW and IN accept multiple operands.
|
|
1612
1676
|
*
|
|
1677
|
+
* **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
|
|
1678
|
+
* Search embedding (SearchEmbed) and Natural Language Search
|
|
1679
|
+
* embedding (SageEmbed).
|
|
1680
|
+
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
1613
1681
|
* @example
|
|
1614
1682
|
* ```js
|
|
1615
|
-
* liveboardEmbed.trigger(HostEvent.
|
|
1616
|
-
*
|
|
1617
|
-
*
|
|
1683
|
+
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1684
|
+
* {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
|
|
1685
|
+
* {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
|
|
1686
|
+
* ])
|
|
1687
|
+
* ```
|
|
1688
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
|
|
1689
|
+
* @important
|
|
1690
|
+
*/
|
|
1691
|
+
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
1692
|
+
/**
|
|
1693
|
+
* Navigate to a specific page in the embedded ThoughtSpot application.
|
|
1694
|
+
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
1695
|
+
* @param - `path` - the path to navigate to to go forward or back. The path value can
|
|
1696
|
+
* be a number; for example, `1`, `-1`.
|
|
1697
|
+
* @example
|
|
1698
|
+
* ```js
|
|
1699
|
+
* appEmbed.navigateToPage(-1)
|
|
1700
|
+
* ```
|
|
1701
|
+
* @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1.sw
|
|
1702
|
+
*/
|
|
1703
|
+
HostEvent["Navigate"] = "Navigate";
|
|
1704
|
+
/**
|
|
1705
|
+
* Open the filter panel for a particular column.
|
|
1706
|
+
* Works with Search and Liveboard embed.
|
|
1707
|
+
* @param - { columnId: string,
|
|
1708
|
+
* name: string,
|
|
1709
|
+
* type: INT64/CHAR/DATE,
|
|
1710
|
+
* dataType: ATTRIBUTE/MEASURE }
|
|
1711
|
+
* @example
|
|
1712
|
+
* ```js
|
|
1713
|
+
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
1714
|
+
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
1715
|
+
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
1716
|
+
* { columnId: '<column-GUID>'})
|
|
1717
|
+
* ```
|
|
1718
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1719
|
+
*/
|
|
1720
|
+
HostEvent["OpenFilter"] = "openFilter";
|
|
1721
|
+
/**
|
|
1722
|
+
* Add columns to the current search query.
|
|
1723
|
+
* @param - { columnIds: string[] }
|
|
1724
|
+
* @example
|
|
1725
|
+
* ```js
|
|
1726
|
+
* searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
|
|
1727
|
+
* ```
|
|
1728
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1729
|
+
*/
|
|
1730
|
+
HostEvent["AddColumns"] = "addColumns";
|
|
1731
|
+
/**
|
|
1732
|
+
* Remove a column from the current search query.
|
|
1733
|
+
* @param - { columnId: string }
|
|
1734
|
+
* @example
|
|
1735
|
+
* ```js
|
|
1736
|
+
* searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
|
|
1737
|
+
* ```
|
|
1738
|
+
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
1739
|
+
*/
|
|
1740
|
+
HostEvent["RemoveColumn"] = "removeColumn";
|
|
1741
|
+
/**
|
|
1742
|
+
* Get the transient state of a Liveboard as encoded content.
|
|
1743
|
+
* This includes unsaved and ad hoc changes such as
|
|
1744
|
+
* Liveboard filters, runtime filters applied on visualizations on a
|
|
1745
|
+
* Liveboard, and Liveboard layout, changes to visualizations such as
|
|
1746
|
+
* sorting, toggling of legends, and data drill down.
|
|
1747
|
+
* @example
|
|
1748
|
+
* ```js
|
|
1749
|
+
* liveboardEmbed.trigger(HostEvent.getexportrequestforcurrentpinboard).then(
|
|
1750
|
+
* data=>console.log(data))
|
|
1751
|
+
* ```
|
|
1752
|
+
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
|
|
1753
|
+
*/
|
|
1754
|
+
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
1755
|
+
/**
|
|
1756
|
+
* Trigger the **Pin** action on an embedded object
|
|
1757
|
+
* @param - Liveboard embed takes the `vizId` as a
|
|
1758
|
+
* key. Can be left undefined when embedding Search, full app, or
|
|
1759
|
+
* a visualization.
|
|
1760
|
+
* @example
|
|
1761
|
+
* ```js
|
|
1762
|
+
* appEmbed.trigger(HostEvent.Pin)
|
|
1763
|
+
* ```
|
|
1764
|
+
* ```js
|
|
1765
|
+
* searchEmbed.trigger(HostEvent.Pin)
|
|
1766
|
+
* ```
|
|
1767
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1768
|
+
*/
|
|
1769
|
+
HostEvent["Pin"] = "pin";
|
|
1770
|
+
/**
|
|
1771
|
+
* Trigger the **Show Liveboard details** action
|
|
1772
|
+
* on an embedded Liveboard.
|
|
1773
|
+
* @example
|
|
1774
|
+
*```js
|
|
1775
|
+
* liveboardEmbed.trigger(HostEvent.LiveboardInfo)
|
|
1776
|
+
*```
|
|
1777
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1778
|
+
*/
|
|
1779
|
+
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
1780
|
+
/**
|
|
1781
|
+
* Trigger the **Schedule** action on an embedded Liveboard.
|
|
1782
|
+
* @example
|
|
1783
|
+
* ```js
|
|
1784
|
+
* liveboardEmbed.trigger(HostEvent.Schedule)
|
|
1785
|
+
* ```
|
|
1786
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1787
|
+
*/
|
|
1788
|
+
HostEvent["Schedule"] = "subscription";
|
|
1789
|
+
/**
|
|
1790
|
+
* Trigger the **Manage schedule** action on an embedded Liveboard
|
|
1791
|
+
* @example
|
|
1792
|
+
* ```js
|
|
1793
|
+
* liveboardEmbed.trigger(HostEvent.ScheduleList)
|
|
1794
|
+
* ```
|
|
1795
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1796
|
+
*/
|
|
1797
|
+
HostEvent["SchedulesList"] = "schedule-list";
|
|
1798
|
+
/**
|
|
1799
|
+
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
1800
|
+
* Answer.
|
|
1801
|
+
* @example
|
|
1802
|
+
* ```js
|
|
1803
|
+
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
1804
|
+
* ```
|
|
1805
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1806
|
+
*/
|
|
1807
|
+
HostEvent["ExportTML"] = "exportTSL";
|
|
1808
|
+
/**
|
|
1809
|
+
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
1810
|
+
* saved Answers in the full application embedding.
|
|
1811
|
+
* @example
|
|
1812
|
+
* ```js
|
|
1813
|
+
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
1814
|
+
* ```
|
|
1815
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1816
|
+
*/
|
|
1817
|
+
HostEvent["EditTML"] = "editTSL";
|
|
1818
|
+
/**
|
|
1819
|
+
* Trigger the **Update TML** action on an embedded Liveboard.
|
|
1820
|
+
* @example
|
|
1821
|
+
* ```js
|
|
1822
|
+
* liveboardEmbed.trigger(HostEvent.UpdateTML)
|
|
1823
|
+
* ```
|
|
1824
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1825
|
+
*/
|
|
1826
|
+
HostEvent["UpdateTML"] = "updateTSL";
|
|
1827
|
+
/**
|
|
1828
|
+
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
1829
|
+
* visualization or Answer.
|
|
1830
|
+
*
|
|
1831
|
+
* **NOTE**: The **Download** > **PDF** action is available on
|
|
1832
|
+
* visualizations and Answers if the data is in tabular format.
|
|
1833
|
+
* @example
|
|
1834
|
+
* ```js
|
|
1835
|
+
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
1836
|
+
* ```
|
|
1837
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1838
|
+
*/
|
|
1839
|
+
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
1840
|
+
/**
|
|
1841
|
+
* Trigger the **Make a copy** action on a Liveboard, Search, or
|
|
1842
|
+
* visualization page.
|
|
1843
|
+
* @example
|
|
1844
|
+
* ```js
|
|
1845
|
+
* liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1846
|
+
* ```
|
|
1847
|
+
* ```js
|
|
1848
|
+
* vizEmbed.trigger(HostEvent.MakeACopy)
|
|
1849
|
+
* ```
|
|
1850
|
+
* ```js
|
|
1851
|
+
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
1852
|
+
* ```
|
|
1853
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1854
|
+
*/
|
|
1855
|
+
HostEvent["MakeACopy"] = "makeACopy";
|
|
1856
|
+
/**
|
|
1857
|
+
* Trigger the **Delete** action for a Liveboard.
|
|
1858
|
+
* @example
|
|
1859
|
+
* ```js
|
|
1860
|
+
* appEmbed.trigger(HostEvent.Remove)
|
|
1861
|
+
* ```
|
|
1862
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1863
|
+
*/
|
|
1864
|
+
HostEvent["Remove"] = "delete";
|
|
1865
|
+
/**
|
|
1866
|
+
* Trigger the **Explore** action on a visualization.
|
|
1867
|
+
* @param - an object with `vizId` as a key
|
|
1868
|
+
* @example
|
|
1869
|
+
* ```js
|
|
1870
|
+
* liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1871
|
+
* ```
|
|
1872
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1873
|
+
*/
|
|
1874
|
+
HostEvent["Explore"] = "explore";
|
|
1875
|
+
/**
|
|
1876
|
+
* Trigger the **Create alert** action on a visualization
|
|
1877
|
+
* @param - an object with `vizId` as a key
|
|
1878
|
+
* @example
|
|
1879
|
+
* ```js
|
|
1880
|
+
* liveboardEmbed.trigger(HostEvent.CreateMonitor {
|
|
1881
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1882
|
+
* })
|
|
1883
|
+
* ```
|
|
1884
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1885
|
+
*/
|
|
1886
|
+
HostEvent["CreateMonitor"] = "createMonitor";
|
|
1887
|
+
/**
|
|
1888
|
+
* Trigger the **Manage alerts** action on a visualization
|
|
1889
|
+
* @param - an object with `vizId` as a key
|
|
1890
|
+
* @example
|
|
1891
|
+
* ```js
|
|
1892
|
+
* liveboardEmbed.trigger(HostEvent.ManageMonitor, {
|
|
1893
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1894
|
+
* })
|
|
1895
|
+
* ```
|
|
1896
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1897
|
+
*/
|
|
1898
|
+
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
1899
|
+
/**
|
|
1900
|
+
* Trigger the **Edit** action on a Liveboard or a visualization
|
|
1901
|
+
* on a Liveboard.
|
|
1902
|
+
*
|
|
1903
|
+
* This event is not supported in visualization embed and search embed.
|
|
1904
|
+
* @param - object - To trigger the action for a specific visualization
|
|
1905
|
+
* in Liveboard embed, pass in `vizId` as a key.
|
|
1906
|
+
* @example
|
|
1907
|
+
* ```js
|
|
1908
|
+
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
1909
|
+
* ```
|
|
1618
1910
|
* ```js
|
|
1619
1911
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
1620
1912
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
@@ -1877,7 +2169,6 @@ var HostEvent;
|
|
|
1877
2169
|
/**
|
|
1878
2170
|
* Get details of filters applied on the Liveboard.
|
|
1879
2171
|
* Returns arrays containing Liveboard filter and runtime filter elements.
|
|
1880
|
-
*
|
|
1881
2172
|
* @example
|
|
1882
2173
|
* ```js
|
|
1883
2174
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -1904,7 +2195,6 @@ var HostEvent;
|
|
|
1904
2195
|
* `values` - An array of one or several values. The value definition on the
|
|
1905
2196
|
* data type you choose to filter on. For a complete list of supported data types,
|
|
1906
2197
|
* see link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Developer Documentation].
|
|
1907
|
-
*
|
|
1908
2198
|
* @example
|
|
1909
2199
|
* ```js
|
|
1910
2200
|
*
|
|
@@ -2229,7 +2519,6 @@ var Action;
|
|
|
2229
2519
|
* The **Save as View** action on the Answer
|
|
2230
2520
|
* page. Saves an Answer as a View object in the full
|
|
2231
2521
|
* application embedding mode.
|
|
2232
|
-
*
|
|
2233
2522
|
* @example
|
|
2234
2523
|
* ```js
|
|
2235
2524
|
* disabledActions: [Action.SaveAsView]
|
|
@@ -2433,13 +2722,10 @@ var Action;
|
|
|
2433
2722
|
Action["DownloadAsPng"] = "downloadAsPng";
|
|
2434
2723
|
/**
|
|
2435
2724
|
*
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2725
|
+
*The **Download PDF** action that downloads a Liveboard,
|
|
2726
|
+
*visualization, or Answer as a PDF file.
|
|
2438
2727
|
*
|
|
2439
2728
|
*
|
|
2440
|
-
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2441
|
-
* visualizations and Answers if the data is in tabular format.
|
|
2442
|
-
*
|
|
2443
2729
|
***NOTE**: The **Download** > **PDF** action is available on
|
|
2444
2730
|
*visualizations and Answers if the data is in tabular format.
|
|
2445
2731
|
* @example
|
|
@@ -2689,7 +2975,6 @@ var Action;
|
|
|
2689
2975
|
/**
|
|
2690
2976
|
* The **Delete** action for Answers in the full application
|
|
2691
2977
|
* embedding mode.
|
|
2692
|
-
*
|
|
2693
2978
|
* @example
|
|
2694
2979
|
* ```js
|
|
2695
2980
|
* disabledActions: [Action.AnswerDelete]
|
|
@@ -3189,318 +3474,6 @@ var LogLevel;
|
|
|
3189
3474
|
LogLevel["TRACE"] = "TRACE";
|
|
3190
3475
|
})(LogLevel || (LogLevel = {}));
|
|
3191
3476
|
|
|
3192
|
-
// istanbul ignore next
|
|
3193
|
-
const isObject = (obj) => {
|
|
3194
|
-
if (typeof obj === "object" && obj !== null) {
|
|
3195
|
-
if (typeof Object.getPrototypeOf === "function") {
|
|
3196
|
-
const prototype = Object.getPrototypeOf(obj);
|
|
3197
|
-
return prototype === Object.prototype || prototype === null;
|
|
3198
|
-
}
|
|
3199
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
3200
|
-
}
|
|
3201
|
-
return false;
|
|
3202
|
-
};
|
|
3203
|
-
const merge = (...objects) => objects.reduce((result, current) => {
|
|
3204
|
-
if (Array.isArray(current)) {
|
|
3205
|
-
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
3206
|
-
}
|
|
3207
|
-
Object.keys(current).forEach((key) => {
|
|
3208
|
-
if (["__proto__", "constructor", "prototype"].includes(key)) {
|
|
3209
|
-
return;
|
|
3210
|
-
}
|
|
3211
|
-
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
3212
|
-
result[key] = merge.options.mergeArrays
|
|
3213
|
-
? Array.from(new Set(result[key].concat(current[key])))
|
|
3214
|
-
: current[key];
|
|
3215
|
-
}
|
|
3216
|
-
else if (isObject(result[key]) && isObject(current[key])) {
|
|
3217
|
-
result[key] = merge(result[key], current[key]);
|
|
3218
|
-
}
|
|
3219
|
-
else {
|
|
3220
|
-
result[key] = current[key];
|
|
3221
|
-
}
|
|
3222
|
-
});
|
|
3223
|
-
return result;
|
|
3224
|
-
}, {});
|
|
3225
|
-
const defaultOptions = {
|
|
3226
|
-
mergeArrays: true,
|
|
3227
|
-
};
|
|
3228
|
-
merge.options = defaultOptions;
|
|
3229
|
-
merge.withOptions = (options, ...objects) => {
|
|
3230
|
-
merge.options = Object.assign({ mergeArrays: true }, options);
|
|
3231
|
-
const result = merge(...objects);
|
|
3232
|
-
merge.options = defaultOptions;
|
|
3233
|
-
return result;
|
|
3234
|
-
};
|
|
3235
|
-
|
|
3236
|
-
/**
|
|
3237
|
-
* Copyright (c) 2023
|
|
3238
|
-
*
|
|
3239
|
-
* Common utility functions for ThoughtSpot Visual Embed SDK
|
|
3240
|
-
* @summary Utils
|
|
3241
|
-
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
3242
|
-
*/
|
|
3243
|
-
/**
|
|
3244
|
-
* Construct a runtime filters query string from the given filters.
|
|
3245
|
-
* Refer to the following docs for more details on runtime filter syntax:
|
|
3246
|
-
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/apply-runtime-filter.html
|
|
3247
|
-
* https://cloud-docs.thoughtspot.com/admin/ts-cloud/runtime-filter-operators.html
|
|
3248
|
-
* @param runtimeFilters
|
|
3249
|
-
*/
|
|
3250
|
-
const getFilterQuery = (runtimeFilters) => {
|
|
3251
|
-
if (runtimeFilters && runtimeFilters.length) {
|
|
3252
|
-
const filters = runtimeFilters.map((filter, valueIndex) => {
|
|
3253
|
-
const index = valueIndex + 1;
|
|
3254
|
-
const filterExpr = [];
|
|
3255
|
-
filterExpr.push(`col${index}=${encodeURIComponent(filter.columnName)}`);
|
|
3256
|
-
filterExpr.push(`op${index}=${filter.operator}`);
|
|
3257
|
-
filterExpr.push(filter.values.map((value) => {
|
|
3258
|
-
const encodedValue = typeof value === 'bigint' ? value.toString() : value;
|
|
3259
|
-
return `val${index}=${encodeURIComponent(String(encodedValue))}`;
|
|
3260
|
-
}).join('&'));
|
|
3261
|
-
return filterExpr.join('&');
|
|
3262
|
-
});
|
|
3263
|
-
return `${filters.join('&')}`;
|
|
3264
|
-
}
|
|
3265
|
-
return null;
|
|
3266
|
-
};
|
|
3267
|
-
/**
|
|
3268
|
-
* Construct a runtime parameter override query string from the given option.
|
|
3269
|
-
* @param runtimeParameters
|
|
3270
|
-
*/
|
|
3271
|
-
const getRuntimeParameters = (runtimeParameters) => {
|
|
3272
|
-
if (runtimeParameters && runtimeParameters.length) {
|
|
3273
|
-
const params = runtimeParameters.map((param, valueIndex) => {
|
|
3274
|
-
const index = valueIndex + 1;
|
|
3275
|
-
const filterExpr = [];
|
|
3276
|
-
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
3277
|
-
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
3278
|
-
return filterExpr.join('&');
|
|
3279
|
-
});
|
|
3280
|
-
return `${params.join('&')}`;
|
|
3281
|
-
}
|
|
3282
|
-
return null;
|
|
3283
|
-
};
|
|
3284
|
-
/**
|
|
3285
|
-
* Convert a value to a string representation to be sent as a query
|
|
3286
|
-
* parameter to the ThoughtSpot app.
|
|
3287
|
-
* @param value Any parameter value
|
|
3288
|
-
*/
|
|
3289
|
-
const serializeParam = (value) => {
|
|
3290
|
-
// do not serialize primitive types
|
|
3291
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
3292
|
-
return value;
|
|
3293
|
-
}
|
|
3294
|
-
return JSON.stringify(value);
|
|
3295
|
-
};
|
|
3296
|
-
/**
|
|
3297
|
-
* Convert a value to a string:
|
|
3298
|
-
* in case of an array, we convert it to CSV.
|
|
3299
|
-
* in case of any other type, we directly return the value.
|
|
3300
|
-
* @param value
|
|
3301
|
-
*/
|
|
3302
|
-
const paramToString = (value) => (Array.isArray(value) ? value.join(',') : value);
|
|
3303
|
-
/**
|
|
3304
|
-
* Return a query param string composed from the given params object
|
|
3305
|
-
* @param queryParams
|
|
3306
|
-
* @param shouldSerializeParamValues
|
|
3307
|
-
*/
|
|
3308
|
-
const getQueryParamString = (queryParams, shouldSerializeParamValues = false) => {
|
|
3309
|
-
const qp = [];
|
|
3310
|
-
const params = Object.keys(queryParams);
|
|
3311
|
-
params.forEach((key) => {
|
|
3312
|
-
const val = queryParams[key];
|
|
3313
|
-
if (val !== undefined) {
|
|
3314
|
-
const serializedValue = shouldSerializeParamValues
|
|
3315
|
-
? serializeParam(val)
|
|
3316
|
-
: paramToString(val);
|
|
3317
|
-
qp.push(`${key}=${serializedValue}`);
|
|
3318
|
-
}
|
|
3319
|
-
});
|
|
3320
|
-
if (qp.length) {
|
|
3321
|
-
return qp.join('&');
|
|
3322
|
-
}
|
|
3323
|
-
return null;
|
|
3324
|
-
};
|
|
3325
|
-
/**
|
|
3326
|
-
* Get a string representation of a dimension value in CSS
|
|
3327
|
-
* If numeric, it is considered in pixels.
|
|
3328
|
-
* @param value
|
|
3329
|
-
*/
|
|
3330
|
-
const getCssDimension = (value) => {
|
|
3331
|
-
if (typeof value === 'number') {
|
|
3332
|
-
return `${value}px`;
|
|
3333
|
-
}
|
|
3334
|
-
return value;
|
|
3335
|
-
};
|
|
3336
|
-
/**
|
|
3337
|
-
* Append a string to a URL's hash fragment
|
|
3338
|
-
* @param url A URL
|
|
3339
|
-
* @param stringToAppend The string to append to the URL hash
|
|
3340
|
-
*/
|
|
3341
|
-
const appendToUrlHash = (url, stringToAppend) => {
|
|
3342
|
-
let outputUrl = url;
|
|
3343
|
-
const encStringToAppend = encodeURIComponent(stringToAppend);
|
|
3344
|
-
if (url.indexOf('#') >= 0) {
|
|
3345
|
-
outputUrl = `${outputUrl}${encStringToAppend}`;
|
|
3346
|
-
}
|
|
3347
|
-
else {
|
|
3348
|
-
outputUrl = `${outputUrl}#${encStringToAppend}`;
|
|
3349
|
-
}
|
|
3350
|
-
return outputUrl;
|
|
3351
|
-
};
|
|
3352
|
-
/**
|
|
3353
|
-
*
|
|
3354
|
-
* @param url
|
|
3355
|
-
* @param stringToAppend
|
|
3356
|
-
* @param path
|
|
3357
|
-
*/
|
|
3358
|
-
function getRedirectUrl(url, stringToAppend, path = '') {
|
|
3359
|
-
const targetUrl = path ? new URL(path, window.location.origin).href : url;
|
|
3360
|
-
return appendToUrlHash(targetUrl, stringToAppend);
|
|
3361
|
-
}
|
|
3362
|
-
const getEncodedQueryParamsString = (queryString) => {
|
|
3363
|
-
if (!queryString) {
|
|
3364
|
-
return queryString;
|
|
3365
|
-
}
|
|
3366
|
-
return btoa(queryString).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
3367
|
-
};
|
|
3368
|
-
const getOffsetTop = (element) => {
|
|
3369
|
-
const rect = element.getBoundingClientRect();
|
|
3370
|
-
return rect.top + window.scrollY;
|
|
3371
|
-
};
|
|
3372
|
-
const embedEventStatus = {
|
|
3373
|
-
START: 'start',
|
|
3374
|
-
END: 'end',
|
|
3375
|
-
};
|
|
3376
|
-
const setAttributes = (element, attributes) => {
|
|
3377
|
-
Object.keys(attributes).forEach((key) => {
|
|
3378
|
-
element.setAttribute(key, attributes[key].toString());
|
|
3379
|
-
});
|
|
3380
|
-
};
|
|
3381
|
-
const isCloudRelease = (version) => version.endsWith('.cl');
|
|
3382
|
-
/* For Search Embed: ReleaseVersionInBeta */
|
|
3383
|
-
const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
|
|
3384
|
-
if (releaseVersion !== '' && !isCloudRelease(releaseVersion)) {
|
|
3385
|
-
const splittedReleaseVersion = releaseVersion.split('.');
|
|
3386
|
-
const majorVersion = Number(splittedReleaseVersion[0]);
|
|
3387
|
-
const isBetaVersion = majorVersion < 8;
|
|
3388
|
-
return !suppressBetaWarning && isBetaVersion;
|
|
3389
|
-
}
|
|
3390
|
-
return false;
|
|
3391
|
-
};
|
|
3392
|
-
const getCustomisations = (embedConfig, viewConfig) => {
|
|
3393
|
-
var _a, _b, _c, _d;
|
|
3394
|
-
const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
|
|
3395
|
-
const customizationsFromViewConfig = viewConfig.customizations;
|
|
3396
|
-
const customizationsFromEmbedConfig = embedConfig.customizations
|
|
3397
|
-
|| embedConfig.customisations;
|
|
3398
|
-
const customizations = {
|
|
3399
|
-
style: {
|
|
3400
|
-
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
|
|
3401
|
-
...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style,
|
|
3402
|
-
customCSS: {
|
|
3403
|
-
...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
|
|
3404
|
-
...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
|
|
3405
|
-
},
|
|
3406
|
-
customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
|
|
3407
|
-
|| ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl)
|
|
3408
|
-
|| customCssUrlFromEmbedConfig,
|
|
3409
|
-
},
|
|
3410
|
-
content: {
|
|
3411
|
-
...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
|
|
3412
|
-
...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.content,
|
|
3413
|
-
},
|
|
3414
|
-
};
|
|
3415
|
-
return customizations;
|
|
3416
|
-
};
|
|
3417
|
-
const getRuntimeFilters = (runtimefilters) => getFilterQuery(runtimefilters || []);
|
|
3418
|
-
/**
|
|
3419
|
-
* Gets a reference to the DOM node given
|
|
3420
|
-
* a selector.
|
|
3421
|
-
* @param domSelector
|
|
3422
|
-
*/
|
|
3423
|
-
function getDOMNode(domSelector) {
|
|
3424
|
-
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
3425
|
-
}
|
|
3426
|
-
const deepMerge = (target, source) => merge(target, source);
|
|
3427
|
-
const getOperationNameFromQuery = (query) => {
|
|
3428
|
-
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
3429
|
-
const matches = query.match(regex);
|
|
3430
|
-
return matches === null || matches === void 0 ? void 0 : matches[1];
|
|
3431
|
-
};
|
|
3432
|
-
/**
|
|
3433
|
-
*
|
|
3434
|
-
* @param obj
|
|
3435
|
-
*/
|
|
3436
|
-
function removeTypename(obj) {
|
|
3437
|
-
if (!obj || typeof obj !== 'object')
|
|
3438
|
-
return obj;
|
|
3439
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
3440
|
-
for (const key in obj) {
|
|
3441
|
-
if (key === '__typename') {
|
|
3442
|
-
delete obj[key];
|
|
3443
|
-
}
|
|
3444
|
-
else if (typeof obj[key] === 'object') {
|
|
3445
|
-
removeTypename(obj[key]);
|
|
3446
|
-
}
|
|
3447
|
-
}
|
|
3448
|
-
return obj;
|
|
3449
|
-
}
|
|
3450
|
-
/**
|
|
3451
|
-
* Sets the specified style properties on an HTML element.
|
|
3452
|
-
* @param {HTMLElement} element - The HTML element to which the styles should be applied.
|
|
3453
|
-
* @param {Partial<CSSStyleDeclaration>} styleProperties - An object containing style
|
|
3454
|
-
* property names and their values.
|
|
3455
|
-
* @example
|
|
3456
|
-
* // Apply styles to an element
|
|
3457
|
-
* const element = document.getElementById('myElement');
|
|
3458
|
-
* const styles = {
|
|
3459
|
-
* backgroundColor: 'red',
|
|
3460
|
-
* fontSize: '16px',
|
|
3461
|
-
* };
|
|
3462
|
-
* setStyleProperties(element, styles);
|
|
3463
|
-
*/
|
|
3464
|
-
const setStyleProperties = (element, styleProperties) => {
|
|
3465
|
-
if (!(element === null || element === void 0 ? void 0 : element.style))
|
|
3466
|
-
return;
|
|
3467
|
-
Object.keys(styleProperties).forEach((styleProperty) => {
|
|
3468
|
-
element.style[styleProperty] = styleProperties[styleProperty].toString();
|
|
3469
|
-
});
|
|
3470
|
-
};
|
|
3471
|
-
/**
|
|
3472
|
-
* Removes specified style properties from an HTML element.
|
|
3473
|
-
* @param {HTMLElement} element - The HTML element from which the styles should be removed.
|
|
3474
|
-
* @param {string[]} styleProperties - An array of style property names to be removed.
|
|
3475
|
-
* @example
|
|
3476
|
-
* // Remove styles from an element
|
|
3477
|
-
* const element = document.getElementById('myElement');
|
|
3478
|
-
* element.style.backgroundColor = 'red';
|
|
3479
|
-
* const propertiesToRemove = ['backgroundColor'];
|
|
3480
|
-
* removeStyleProperties(element, propertiesToRemove);
|
|
3481
|
-
*/
|
|
3482
|
-
const removeStyleProperties = (element, styleProperties) => {
|
|
3483
|
-
if (!(element === null || element === void 0 ? void 0 : element.style))
|
|
3484
|
-
return;
|
|
3485
|
-
styleProperties.forEach((styleProperty) => {
|
|
3486
|
-
element.style.removeProperty(styleProperty);
|
|
3487
|
-
});
|
|
3488
|
-
};
|
|
3489
|
-
const isUndefined = (value) => value === undefined;
|
|
3490
|
-
// Return if the value is a string, double or boolean.
|
|
3491
|
-
const getTypeFromValue = (value) => {
|
|
3492
|
-
if (typeof value === 'string') {
|
|
3493
|
-
return ['char', 'string'];
|
|
3494
|
-
}
|
|
3495
|
-
if (typeof value === 'number') {
|
|
3496
|
-
return ['double', 'double'];
|
|
3497
|
-
}
|
|
3498
|
-
if (typeof value === 'boolean') {
|
|
3499
|
-
return ['boolean', 'boolean'];
|
|
3500
|
-
}
|
|
3501
|
-
return ['', ''];
|
|
3502
|
-
};
|
|
3503
|
-
|
|
3504
3477
|
const logFunctions = {
|
|
3505
3478
|
[LogLevel.SILENT]: () => undefined,
|
|
3506
3479
|
[LogLevel.ERROR]: console.error,
|
|
@@ -5776,7 +5749,7 @@ function isEqual(value, other) {
|
|
|
5776
5749
|
|
|
5777
5750
|
var isEqual_1 = isEqual;
|
|
5778
5751
|
|
|
5779
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.
|
|
5752
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.30.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --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-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",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","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",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",tslib:"^2.5.3","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","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@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","current-git-branch":"^1.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"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","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"45 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
5780
5753
|
|
|
5781
5754
|
const EndPoints = {
|
|
5782
5755
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
@@ -5953,7 +5926,7 @@ const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
|
5953
5926
|
* ```js
|
|
5954
5927
|
* resetCachedAuthToken();
|
|
5955
5928
|
* ```
|
|
5956
|
-
* @version SDK: 1.28.
|
|
5929
|
+
* @version SDK: 1.28.0 | ThoughtSpot: *
|
|
5957
5930
|
* @group Authentication / Init
|
|
5958
5931
|
*/
|
|
5959
5932
|
const resetCachedAuthToken = () => {
|
|
@@ -12572,7 +12545,7 @@ const DEFAULT_EMBED_HEIGHT = '100%';
|
|
|
12572
12545
|
async function graphqlQuery({ query, variables, thoughtSpotHost, isCompositeQuery = false, }) {
|
|
12573
12546
|
const operationName = getOperationNameFromQuery(query);
|
|
12574
12547
|
try {
|
|
12575
|
-
const response = await
|
|
12548
|
+
const response = await tokenizedFetch(`${thoughtSpotHost}/prism/?op=${operationName}`, {
|
|
12576
12549
|
method: 'POST',
|
|
12577
12550
|
headers: {
|
|
12578
12551
|
'content-type': 'application/json;charset=UTF-8',
|
|
@@ -12887,14 +12860,14 @@ class AnswerService {
|
|
|
12887
12860
|
* ```js
|
|
12888
12861
|
* embed.on(EmbedEvent.Data, async (e) => {
|
|
12889
12862
|
* const service = await embed.getAnswerService();
|
|
12890
|
-
* await service.
|
|
12863
|
+
* await service.addColumnsByName([
|
|
12891
12864
|
* "col name 1",
|
|
12892
12865
|
* "col name 2"
|
|
12893
12866
|
* ]);
|
|
12894
12867
|
* console.log(await service.fetchData());
|
|
12895
12868
|
* });
|
|
12896
12869
|
*/
|
|
12897
|
-
async
|
|
12870
|
+
async addColumnsByName(columnNames) {
|
|
12898
12871
|
const sourceDetail = await this.getSourceDetail();
|
|
12899
12872
|
const columnGuids = getGuidsFromColumnNames(sourceDetail, columnNames);
|
|
12900
12873
|
return this.addColumns([...columnGuids]);
|
|
@@ -15449,7 +15422,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
15449
15422
|
}
|
|
15450
15423
|
getEmbedParams() {
|
|
15451
15424
|
var _a;
|
|
15452
|
-
const { hideResults,
|
|
15425
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
15453
15426
|
/* eslint-disable-next-line max-len */
|
|
15454
15427
|
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
15455
15428
|
const queryParams = this.getBaseQueryParams();
|