@thoughtspot/visual-embed-sdk 1.35.0 → 1.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/cjs/package.json +15 -3
  2. package/cjs/src/embed/base.native.d.ts +1 -0
  3. package/cjs/src/embed/base.native.d.ts.map +1 -0
  4. package/cjs/src/embed/base.native.js +1 -0
  5. package/cjs/src/embed/base.native.js.map +1 -0
  6. package/cjs/src/embed/hello.d.ts +2 -0
  7. package/cjs/src/embed/hello.d.ts.map +1 -0
  8. package/cjs/src/embed/hello.js +6 -0
  9. package/cjs/src/embed/hello.js.map +1 -0
  10. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  11. package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  12. package/cjs/src/embed/searchEmbed-basic-auth.spec.js +104 -0
  13. package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  14. package/cjs/src/native/LiveboardEmbed.d.ts +13 -0
  15. package/cjs/src/native/LiveboardEmbed.d.ts.map +1 -0
  16. package/cjs/src/native/LiveboardEmbed.js +146 -0
  17. package/cjs/src/native/LiveboardEmbed.js.map +1 -0
  18. package/cjs/src/native/commonUtils.d.ts +20 -0
  19. package/cjs/src/native/commonUtils.d.ts.map +1 -0
  20. package/cjs/src/native/commonUtils.js +175 -0
  21. package/cjs/src/native/commonUtils.js.map +1 -0
  22. package/cjs/src/native/commonUtils.spec.d.ts +2 -0
  23. package/cjs/src/native/commonUtils.spec.d.ts.map +1 -0
  24. package/cjs/src/native/commonUtils.spec.js +127 -0
  25. package/cjs/src/native/commonUtils.spec.js.map +1 -0
  26. package/cjs/src/native/embedConfig.d.ts +10 -0
  27. package/cjs/src/native/embedConfig.d.ts.map +1 -0
  28. package/cjs/src/native/embedConfig.js +12 -0
  29. package/cjs/src/native/embedConfig.js.map +1 -0
  30. package/cjs/src/native/index.d.ts +2 -0
  31. package/cjs/src/native/index.d.ts.map +1 -0
  32. package/cjs/src/native/index.js +7 -0
  33. package/cjs/src/native/index.js.map +1 -0
  34. package/cjs/src/native/types.d.ts +10 -0
  35. package/cjs/src/native/types.d.ts.map +1 -0
  36. package/cjs/src/native/types.js +3 -0
  37. package/cjs/src/native/types.js.map +1 -0
  38. package/cjs/src/parsers/filtersToRuntimeFilters.d.ts +6 -0
  39. package/cjs/src/parsers/filtersToRuntimeFilters.d.ts.map +1 -0
  40. package/cjs/src/parsers/filtersToRuntimeFilters.js +60 -0
  41. package/cjs/src/parsers/filtersToRuntimeFilters.js.map +1 -0
  42. package/cjs/src/parsers/filtersToRuntimeFilters.spec.d.ts +2 -0
  43. package/cjs/src/parsers/filtersToRuntimeFilters.spec.d.ts.map +1 -0
  44. package/cjs/src/parsers/filtersToRuntimeFilters.spec.js +205 -0
  45. package/cjs/src/parsers/filtersToRuntimeFilters.spec.js.map +1 -0
  46. package/cjs/src/parsers/index.d.ts +2 -0
  47. package/cjs/src/parsers/index.d.ts.map +1 -0
  48. package/cjs/src/parsers/index.js +6 -0
  49. package/cjs/src/parsers/index.js.map +1 -0
  50. package/cjs/src/parsers/index.spec.d.ts +2 -0
  51. package/cjs/src/parsers/index.spec.d.ts.map +1 -0
  52. package/cjs/src/parsers/index.spec.js +9 -0
  53. package/cjs/src/parsers/index.spec.js.map +1 -0
  54. package/cjs/src/react-native/Liveboard.d.ts +1 -0
  55. package/cjs/src/react-native/Liveboard.d.ts.map +1 -0
  56. package/cjs/src/react-native/Liveboard.js +1 -0
  57. package/cjs/src/react-native/Liveboard.js.map +1 -0
  58. package/cjs/src/utils/processData.spec.js +33 -0
  59. package/cjs/src/utils/processData.spec.js.map +1 -1
  60. package/cjs/src/utils.d.ts +15 -0
  61. package/cjs/src/utils.d.ts.map +1 -1
  62. package/cjs/src/utils.js +24 -3
  63. package/cjs/src/utils.js.map +1 -1
  64. package/cjs/src/utils.spec.js +132 -0
  65. package/cjs/src/utils.spec.js.map +1 -1
  66. package/dist/{index-A4UOqx43.js → index-BXczdQc7.js} +1 -1
  67. package/dist/index-Bh8kjZh8.js +7370 -0
  68. package/dist/src/embed/hello.d.ts +2 -0
  69. package/dist/src/embed/hello.d.ts.map +1 -0
  70. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  71. package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  72. package/dist/src/native/LiveboardEmbed.d.ts +13 -0
  73. package/dist/src/native/LiveboardEmbed.d.ts.map +1 -0
  74. package/dist/src/native/commonUtils.d.ts +20 -0
  75. package/dist/src/native/commonUtils.d.ts.map +1 -0
  76. package/dist/src/native/commonUtils.spec.d.ts +2 -0
  77. package/dist/src/native/commonUtils.spec.d.ts.map +1 -0
  78. package/dist/src/native/embedConfig.d.ts +10 -0
  79. package/dist/src/native/embedConfig.d.ts.map +1 -0
  80. package/dist/src/native/index.d.ts +2 -0
  81. package/dist/src/native/index.d.ts.map +1 -0
  82. package/dist/src/native/types.d.ts +10 -0
  83. package/dist/src/native/types.d.ts.map +1 -0
  84. package/dist/src/parsers/filtersToRuntimeFilters.d.ts +6 -0
  85. package/dist/src/parsers/filtersToRuntimeFilters.d.ts.map +1 -0
  86. package/dist/src/parsers/filtersToRuntimeFilters.spec.d.ts +2 -0
  87. package/dist/src/parsers/filtersToRuntimeFilters.spec.d.ts.map +1 -0
  88. package/dist/src/parsers/index.d.ts +2 -0
  89. package/dist/src/parsers/index.d.ts.map +1 -0
  90. package/dist/src/parsers/index.spec.d.ts +2 -0
  91. package/dist/src/parsers/index.spec.d.ts.map +1 -0
  92. package/dist/src/utils.d.ts +15 -0
  93. package/dist/src/utils.d.ts.map +1 -1
  94. package/dist/tsembed-parsers.es.js +3831 -0
  95. package/dist/tsembed-parsers.js +3840 -0
  96. package/dist/tsembed-react.es.js +3 -3
  97. package/dist/tsembed-react.js +2 -2
  98. package/dist/tsembed.es.js +3 -3
  99. package/dist/tsembed.js +2 -2
  100. package/lib/package.json +15 -3
  101. package/lib/src/embed/base.native.d.ts +1 -0
  102. package/lib/src/embed/base.native.d.ts.map +1 -0
  103. package/lib/src/embed/base.native.js +1 -0
  104. package/lib/src/embed/base.native.js.map +1 -0
  105. package/lib/src/embed/hello.d.ts +2 -0
  106. package/lib/src/embed/hello.d.ts.map +1 -0
  107. package/lib/src/embed/hello.js +2 -0
  108. package/lib/src/embed/hello.js.map +1 -0
  109. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
  110. package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
  111. package/lib/src/embed/searchEmbed-basic-auth.spec.js +101 -0
  112. package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
  113. package/lib/src/native/LiveboardEmbed.d.ts +13 -0
  114. package/lib/src/native/LiveboardEmbed.d.ts.map +1 -0
  115. package/lib/src/native/LiveboardEmbed.js +141 -0
  116. package/lib/src/native/LiveboardEmbed.js.map +1 -0
  117. package/lib/src/native/commonUtils.d.ts +20 -0
  118. package/lib/src/native/commonUtils.d.ts.map +1 -0
  119. package/lib/src/native/commonUtils.js +169 -0
  120. package/lib/src/native/commonUtils.js.map +1 -0
  121. package/lib/src/native/commonUtils.spec.d.ts +2 -0
  122. package/lib/src/native/commonUtils.spec.d.ts.map +1 -0
  123. package/lib/src/native/commonUtils.spec.js +124 -0
  124. package/lib/src/native/commonUtils.spec.js.map +1 -0
  125. package/lib/src/native/embedConfig.d.ts +10 -0
  126. package/lib/src/native/embedConfig.d.ts.map +1 -0
  127. package/lib/src/native/embedConfig.js +7 -0
  128. package/lib/src/native/embedConfig.js.map +1 -0
  129. package/lib/src/native/index.d.ts +2 -0
  130. package/lib/src/native/index.d.ts.map +1 -0
  131. package/lib/src/native/index.js +2 -0
  132. package/lib/src/native/index.js.map +1 -0
  133. package/lib/src/native/types.d.ts +10 -0
  134. package/lib/src/native/types.d.ts.map +1 -0
  135. package/lib/src/native/types.js +2 -0
  136. package/lib/src/native/types.js.map +1 -0
  137. package/lib/src/parsers/filtersToRuntimeFilters.d.ts +6 -0
  138. package/lib/src/parsers/filtersToRuntimeFilters.d.ts.map +1 -0
  139. package/lib/src/parsers/filtersToRuntimeFilters.js +55 -0
  140. package/lib/src/parsers/filtersToRuntimeFilters.js.map +1 -0
  141. package/lib/src/parsers/filtersToRuntimeFilters.spec.d.ts +2 -0
  142. package/lib/src/parsers/filtersToRuntimeFilters.spec.d.ts.map +1 -0
  143. package/lib/src/parsers/filtersToRuntimeFilters.spec.js +203 -0
  144. package/lib/src/parsers/filtersToRuntimeFilters.spec.js.map +1 -0
  145. package/lib/src/parsers/index.d.ts +2 -0
  146. package/lib/src/parsers/index.d.ts.map +1 -0
  147. package/lib/src/parsers/index.js +2 -0
  148. package/lib/src/parsers/index.js.map +1 -0
  149. package/lib/src/parsers/index.spec.d.ts +2 -0
  150. package/lib/src/parsers/index.spec.d.ts.map +1 -0
  151. package/lib/src/parsers/index.spec.js +7 -0
  152. package/lib/src/parsers/index.spec.js.map +1 -0
  153. package/lib/src/react-native/Liveboard.d.ts +1 -0
  154. package/lib/src/react-native/Liveboard.d.ts.map +1 -0
  155. package/lib/src/react-native/Liveboard.js +1 -0
  156. package/lib/src/react-native/Liveboard.js.map +1 -0
  157. package/lib/src/utils/processData.spec.js +33 -0
  158. package/lib/src/utils/processData.spec.js.map +1 -1
  159. package/lib/src/utils.d.ts +15 -0
  160. package/lib/src/utils.d.ts.map +1 -1
  161. package/lib/src/utils.js +20 -2
  162. package/lib/src/utils.js.map +1 -1
  163. package/lib/src/utils.spec.js +133 -1
  164. package/lib/src/utils.spec.js.map +1 -1
  165. package/package.json +15 -3
  166. package/src/native/commonUtils.spec.tsx +161 -0
  167. package/src/native/commonUtils.ts +183 -0
  168. package/src/native/index.ts +1 -0
  169. package/src/native/types.ts +10 -0
  170. package/src/utils/processData.spec.ts +42 -0
  171. package/src/utils.spec.ts +147 -1
  172. package/src/utils.ts +25 -2
@@ -0,0 +1,3840 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.tsembed = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ /**
8
+ * Copyright (c) 2023
9
+ *
10
+ * Common utility functions for ThoughtSpot Visual Embed SDK
11
+ * @summary Utils
12
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
13
+ */
14
+ /**
15
+ * Convert a value to a string representation to be sent as a query
16
+ * parameter to the ThoughtSpot app.
17
+ * @param value Any parameter value
18
+ */
19
+ const serializeParam = (value) => {
20
+ // do not serialize primitive types
21
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
22
+ return value;
23
+ }
24
+ return JSON.stringify(value);
25
+ };
26
+ /**
27
+ * Convert a value to a string:
28
+ * in case of an array, we convert it to CSV.
29
+ * in case of any other type, we directly return the value.
30
+ * @param value
31
+ */
32
+ const paramToString = (value) => (Array.isArray(value) ? value.join(',') : value);
33
+ /**
34
+ * Return a query param string composed from the given params object
35
+ * @param queryParams
36
+ * @param shouldSerializeParamValues
37
+ */
38
+ const getQueryParamString = (queryParams, shouldSerializeParamValues = false) => {
39
+ const qp = [];
40
+ const params = Object.keys(queryParams);
41
+ params.forEach((key) => {
42
+ const val = queryParams[key];
43
+ if (val !== undefined) {
44
+ const serializedValue = shouldSerializeParamValues
45
+ ? serializeParam(val)
46
+ : paramToString(val);
47
+ qp.push(`${key}=${serializedValue}`);
48
+ }
49
+ });
50
+ if (qp.length) {
51
+ return qp.join('&');
52
+ }
53
+ return null;
54
+ };
55
+ const getCustomisationsMobileEmbed = (embedConfig) => {
56
+ var _a, _b;
57
+ const customizationsFromEmbedConfig = embedConfig.customizations
58
+ || embedConfig.customisations;
59
+ const customizations = {
60
+ style: {
61
+ ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
62
+ customCSS: {
63
+ ...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
64
+ },
65
+ customCSSUrl: (_b = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl,
66
+ },
67
+ content: {
68
+ ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
69
+ },
70
+ };
71
+ return customizations;
72
+ };
73
+ const isUndefined = (value) => value === undefined;
74
+
75
+ /**
76
+ * Copyright (c) 2023
77
+ *
78
+ * TypeScript type definitions for ThoughtSpot Visual Embed SDK
79
+ * @summary Type definitions for Embed SDK
80
+ * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
81
+ */
82
+ /**
83
+ * The authentication mechanism for allowing access to the
84
+ * the embedded app
85
+ * @group Authentication / Init
86
+ */
87
+ // eslint-disable-next-line no-shadow
88
+ var AuthType;
89
+ (function (AuthType) {
90
+ /**
91
+ * No authentication on the SDK. Passthrough to the embedded App. Alias for
92
+ * `Passthrough`.
93
+ * @example
94
+ * ```js
95
+ * init({
96
+ * // ...
97
+ * authType: AuthType.None,
98
+ * });
99
+ * ```
100
+ */
101
+ AuthType["None"] = "None";
102
+ /**
103
+ * Passthrough SSO to the embedded application within the iframe. Requires least
104
+ * configuration, but may not be supported by all IDPs. This will behave like `None`
105
+ * if SSO is not configured on ThoughtSpot.
106
+ *
107
+ * To use this:
108
+ * Your SAML or OpenID provider must allow iframe redirects.
109
+ * For example, if you are using Okta as IdP, you can enable iframe embedding.
110
+ * @example
111
+ * ```js
112
+ * init({
113
+ * // ...
114
+ * authType: AuthType.EmbeddedSSO,
115
+ * });
116
+ * ```
117
+ * @version: SDK: 1.15.0 | ThoughtSpot: 8.8.0.cl
118
+ */
119
+ AuthType["EmbeddedSSO"] = "EmbeddedSSO";
120
+ /**
121
+ * SSO using SAML
122
+ * @deprecated Use {@link SAMLRedirect} instead
123
+ * @hidden
124
+ */
125
+ AuthType["SSO"] = "SSO_SAML";
126
+ /**
127
+ * SSO using SAML
128
+ * @deprecated Use {@link SAMLRedirect} instead
129
+ * @hidden
130
+ */
131
+ AuthType["SAML"] = "SSO_SAML";
132
+ /**
133
+ * SSO using SAML
134
+ * Makes the host application redirect to the SAML IdP. Use this
135
+ * if your IdP does not allow itself to be embedded.
136
+ *
137
+ * This redirects the host application to the SAML IdP. The host application
138
+ * will be redirected back to the ThoughtSpot app after authentication.
139
+ * @example
140
+ * ```js
141
+ * init({
142
+ * // ...
143
+ * authType: AuthType.SAMLRedirect,
144
+ * });
145
+ * ```
146
+ *
147
+ * This opens the SAML IdP in a popup window. The popup is triggered
148
+ * when the user clicks the trigger button. The popup window will be
149
+ * closed automatically after authentication.
150
+ * @example
151
+ * ```js
152
+ * init({
153
+ * // ...
154
+ * authType: AuthType.SAMLRedirect,
155
+ * authTriggerText: 'Login with SAML',
156
+ * authTriggerContainer: '#embed-container',
157
+ * inPopup: true,
158
+ * });
159
+ * ```
160
+ *
161
+ * Can also use the event to trigger the popup flow. Works the same
162
+ * as the above example.
163
+ * @example
164
+ * ```js
165
+ * const authEE = init({
166
+ * // ...
167
+ * authType: AuthType.SAMLRedirect,
168
+ * inPopup: true,
169
+ * });
170
+ *
171
+ * someButtonOnYourPage.addEventListener('click', () => {
172
+ * authEE.emit(AuthEvent.TRIGGER_SSO_POPUP);
173
+ * });
174
+ * ```
175
+ */
176
+ AuthType["SAMLRedirect"] = "SSO_SAML";
177
+ /**
178
+ * SSO using OIDC
179
+ * @hidden
180
+ * @deprecated Use {@link OIDCRedirect} instead
181
+ */
182
+ AuthType["OIDC"] = "SSO_OIDC";
183
+ /**
184
+ * SSO using OIDC
185
+ * Will make the host application redirect to the OIDC IdP.
186
+ * See code samples in {@link SAMLRedirect}.
187
+ */
188
+ AuthType["OIDCRedirect"] = "SSO_OIDC";
189
+ /**
190
+ * Trusted authentication server
191
+ * @hidden
192
+ * @deprecated Use {@link TrustedAuth} instead
193
+ */
194
+ AuthType["AuthServer"] = "AuthServer";
195
+ /**
196
+ * Trusted authentication server. Use your own authentication server
197
+ * which returns a bearer token, generated using the `secret_key` obtained
198
+ * from ThoughtSpot.
199
+ * @example
200
+ * ```js
201
+ * init({
202
+ * // ...
203
+ * authType: AuthType.TrustedAuthToken,
204
+ * getAuthToken: () => {
205
+ * return fetch('https://my-backend.app/ts-token')
206
+ * .then((response) => response.json())
207
+ * .then((data) => data.token);
208
+ * }
209
+ * });
210
+ * ```
211
+ */
212
+ AuthType["TrustedAuthToken"] = "AuthServer";
213
+ /**
214
+ * Trusted authentication server Cookieless, Use your own authentication
215
+ * server which returns a bearer token, generated using the `secret_key`
216
+ * obtained from ThoughtSpot. This uses a cookieless authentication
217
+ * approach, recommended to bypass the third-party cookie-blocking restriction
218
+ * implemented by some browsers.
219
+ * @example
220
+ * ```js
221
+ * init({
222
+ * // ...
223
+ * authType: AuthType.TrustedAuthTokenCookieless,
224
+ * getAuthToken: () => {
225
+ * return fetch('https://my-backend.app/ts-token')
226
+ * .then((response) => response.json())
227
+ * .then((data) => data.token);
228
+ * }
229
+ * ```
230
+ * @version SDK: 1.22.0| ThoughtSpot: 9.3.0.cl, 9.5.1.sw
231
+ */
232
+ AuthType["TrustedAuthTokenCookieless"] = "AuthServerCookieless";
233
+ /**
234
+ * Use the ThoughtSpot login API to authenticate to the cluster directly.
235
+ *
236
+ * Warning: This feature is primarily intended for developer testing. It is
237
+ * strongly advised not to use this authentication method in production.
238
+ */
239
+ AuthType["Basic"] = "Basic";
240
+ })(AuthType || (AuthType = {}));
241
+ /**
242
+ *
243
+ * This option does not apply to the classic homepage experience.
244
+ * To access the updated modular homepage,
245
+ * set `modularHomeExperience` to `true`
246
+ * (available as Early Access feature in 9.12.5.cl).
247
+ *
248
+ */
249
+ var HomeLeftNavItem;
250
+ (function (HomeLeftNavItem) {
251
+ /**
252
+ * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
253
+ */
254
+ HomeLeftNavItem["SearchData"] = "search-data";
255
+ /**
256
+ * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
257
+ */
258
+ HomeLeftNavItem["Home"] = "insights-home";
259
+ /**
260
+ * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
261
+ */
262
+ HomeLeftNavItem["Liveboards"] = "liveboards";
263
+ /**
264
+ * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
265
+ */
266
+ HomeLeftNavItem["Answers"] = "answers";
267
+ /**
268
+ * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
269
+ */
270
+ HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
271
+ /**
272
+ * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
273
+ */
274
+ HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
275
+ /**
276
+ * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
277
+ */
278
+ HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
279
+ })(HomeLeftNavItem || (HomeLeftNavItem = {}));
280
+ /**
281
+ * A map of the supported runtime filter operations
282
+ */
283
+ // eslint-disable-next-line no-shadow
284
+ var RuntimeFilterOp;
285
+ (function (RuntimeFilterOp) {
286
+ /**
287
+ * Equals
288
+ */
289
+ RuntimeFilterOp["EQ"] = "EQ";
290
+ /**
291
+ * Does not equal
292
+ */
293
+ RuntimeFilterOp["NE"] = "NE";
294
+ /**
295
+ * Less than
296
+ */
297
+ RuntimeFilterOp["LT"] = "LT";
298
+ /**
299
+ * Less than or equal to
300
+ */
301
+ RuntimeFilterOp["LE"] = "LE";
302
+ /**
303
+ * Greater than
304
+ */
305
+ RuntimeFilterOp["GT"] = "GT";
306
+ /**
307
+ * Greater than or equal to
308
+ */
309
+ RuntimeFilterOp["GE"] = "GE";
310
+ /**
311
+ * Contains
312
+ */
313
+ RuntimeFilterOp["CONTAINS"] = "CONTAINS";
314
+ /**
315
+ * Begins with
316
+ */
317
+ RuntimeFilterOp["BEGINS_WITH"] = "BEGINS_WITH";
318
+ /**
319
+ * Ends with
320
+ */
321
+ RuntimeFilterOp["ENDS_WITH"] = "ENDS_WITH";
322
+ /**
323
+ * Between, inclusive of higher value
324
+ */
325
+ RuntimeFilterOp["BW_INC_MAX"] = "BW_INC_MAX";
326
+ /**
327
+ * Between, inclusive of lower value
328
+ */
329
+ RuntimeFilterOp["BW_INC_MIN"] = "BW_INC_MIN";
330
+ /**
331
+ * Between, inclusive of both higher and lower value
332
+ */
333
+ RuntimeFilterOp["BW_INC"] = "BW_INC";
334
+ /**
335
+ * Between, non-inclusive
336
+ */
337
+ RuntimeFilterOp["BW"] = "BW";
338
+ /**
339
+ * Is included in this list of values
340
+ */
341
+ RuntimeFilterOp["IN"] = "IN";
342
+ /**
343
+ * Is not included in this list of values
344
+ */
345
+ RuntimeFilterOp["NOT_IN"] = "NOT_IN";
346
+ })(RuntimeFilterOp || (RuntimeFilterOp = {}));
347
+ /**
348
+ * Home page module that can be hidden.
349
+ * **Note**: This option does not apply to the classic homepage.
350
+ * To access the updated modular homepage, set
351
+ * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
352
+ * @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
353
+ */
354
+ // eslint-disable-next-line no-shadow
355
+ var HomepageModule;
356
+ (function (HomepageModule) {
357
+ /**
358
+ * Search bar
359
+ */
360
+ HomepageModule["Search"] = "SEARCH";
361
+ /**
362
+ * kPI watchlist module
363
+ */
364
+ HomepageModule["Watchlist"] = "WATCHLIST";
365
+ /**
366
+ * favorite objects
367
+ */
368
+ HomepageModule["Favorite"] = "FAVORITE";
369
+ /**
370
+ * List of answers and Liveboards
371
+ */
372
+ HomepageModule["MyLibrary"] = "MY_LIBRARY";
373
+ /**
374
+ * Trending list
375
+ */
376
+ HomepageModule["Trending"] = "TRENDING";
377
+ /**
378
+ * Learning videos
379
+ */
380
+ HomepageModule["Learning"] = "LEARNING";
381
+ })(HomepageModule || (HomepageModule = {}));
382
+ /**
383
+ * Event types emitted by the embedded ThoughtSpot application.
384
+ *
385
+ * To add an event listener use the corresponding
386
+ * {@link LiveboardEmbed.on} or {@link AppEmbed.on} or {@link SearchEmbed.on} method.
387
+ * @example
388
+ * ```js
389
+ * import { EmbedEvent } from '@thoughtspot/visual-embed-sdk';
390
+ * // Or
391
+ * // const { EmbedEvent } = window.tsembed;
392
+ *
393
+ * // create the liveboard embed.
394
+ *
395
+ * liveboardEmbed.on(EmbedEvent.Drilldown, (drilldown) => {
396
+ * console.log('Drilldown event', drilldown);
397
+ * }));
398
+ * ```
399
+ *
400
+ * If you are using React components for embedding, you can register to any
401
+ * events from the `EmbedEvent` list by using the `on<EventName>` convention.
402
+ * For example,`onAlert`, `onCopyToClipboard` and so on.
403
+ * @example
404
+ * ```js
405
+ * // ...
406
+ * const MyComponent = ({ dataSources }) => {
407
+ * const onLoad = () => {
408
+ * console.log(EmbedEvent.Load, {});
409
+ * };
410
+ *
411
+ * return (
412
+ * <SearchEmbed
413
+ * dataSources={dataSources}
414
+ * onLoad = {logEvent("Load")}
415
+ * />
416
+ * );
417
+ * };
418
+ * ```
419
+ * @group Events
420
+ */
421
+ // eslint-disable-next-line no-shadow
422
+ var EmbedEvent;
423
+ (function (EmbedEvent) {
424
+ /**
425
+ * Rendering has initialized.
426
+ * @example
427
+ *```js
428
+ * liveboardEmbed.on(EmbedEvent.Init, showLoader)
429
+ * //show a loader
430
+ * function showLoader() {
431
+ * document.getElementById("loader");
432
+ * }
433
+ *```
434
+ * @returns timestamp - The timestamp when the event was generated.
435
+ */
436
+ EmbedEvent["Init"] = "init";
437
+ /**
438
+ * Authentication has either succeeded or failed.
439
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
440
+ * @example
441
+ *```js
442
+ * appEmbed.on(EmbedEvent.AuthInit, payload => {
443
+ * console.log('AuthInit', payload);
444
+ * })
445
+ *```
446
+ * @returns isLoggedIn - A Boolean specifying whether authentication was successful.
447
+ */
448
+ EmbedEvent["AuthInit"] = "authInit";
449
+ /**
450
+ * The embed object container has loaded.
451
+ * @returns timestamp - The timestamp when the event was generated.
452
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
453
+ * @example
454
+ *```js
455
+ * liveboardEmbed.on(EmbedEvent.Load, hideLoader)
456
+ * //hide loader
457
+ * function hideLoader() {
458
+ * document.getElementById("loader");
459
+ * }
460
+ *```
461
+ */
462
+ EmbedEvent["Load"] = "load";
463
+ /**
464
+ * Data pertaining to answer or Liveboard is received
465
+ * @return data - The answer or Liveboard data
466
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
467
+ * @example
468
+ *```js
469
+ * liveboardEmbed.on(EmbedEvent.Data, payload => {
470
+ * console.log('data', payload);
471
+ * })
472
+ *```
473
+ * @important
474
+ */
475
+ EmbedEvent["Data"] = "data";
476
+ /**
477
+ * Search query has been updated by the user.
478
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
479
+ * @example
480
+ *```js
481
+ * searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
482
+ *```
483
+ */
484
+ EmbedEvent["QueryChanged"] = "queryChanged";
485
+ /**
486
+ * A drill-down operation has been performed.
487
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
488
+ * @returns additionalFilters - Any additional filters applied
489
+ * @returns drillDownColumns - The columns on which drill down was performed
490
+ * @returns nonFilteredColumns - The columns that were not filtered
491
+ * @example
492
+ *```js
493
+ * searchEmbed.on(EmbedEvent.DrillDown, {
494
+ * points: {
495
+ * clickedPoint,
496
+ * selectedPoints: selectedPoint
497
+ * },
498
+ * autoDrillDown: true,
499
+ * })
500
+ *```
501
+ * In this example, `VizPointDoubleClick` event is used for
502
+ * triggering the `DrillDown` event when an area or specific
503
+ * data point on a table or chart is double-clicked.
504
+ * @example
505
+ *```js
506
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
507
+ * console.log(payload);
508
+ * const clickedPoint = payload.data.clickedPoint;
509
+ * const selectedPoint = payload.data.selectedPoints;
510
+ * console.log('>>> called', clickedPoint);
511
+ * embed.trigger(HostEvent.DrillDown, {
512
+ * points: {
513
+ * clickedPoint,
514
+ * selectedPoints: selectedPoint
515
+ * },
516
+ * autoDrillDown: true,
517
+ * })
518
+ * })
519
+ *```
520
+ */
521
+ EmbedEvent["Drilldown"] = "drillDown";
522
+ /**
523
+ * One or more data sources have been selected.
524
+ * @returns dataSourceIds - the list of data sources
525
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
526
+ * @example
527
+ * ```js
528
+ * searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
529
+ * console.log('DataSourceSelected', payload);
530
+ * })
531
+ * ```
532
+ */
533
+ EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
534
+ /**
535
+ * One or more data columns have been selected.
536
+ * @returns columnIds - the list of columns
537
+ * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
538
+ * @example
539
+ * ```js
540
+ * appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
541
+ * console.log('AddRemoveColumns', payload);
542
+ * })
543
+ * ```
544
+ */
545
+ EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
546
+ /**
547
+ * A custom action has been triggered.
548
+ * @returns actionId - ID of the custom action
549
+ * @returns payload {@link CustomActionPayload} - Response payload with the
550
+ * Answer or Liveboard data
551
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
552
+ * @example
553
+ * ```js
554
+ * appEmbed.on(EmbedEvent.customAction, payload => {
555
+ * const data = payload.data;
556
+ * if (data.id === 'insert Custom Action ID here') {
557
+ * console.log('Custom Action event:', data.embedAnswerData);
558
+ * }
559
+ * })
560
+ * ```
561
+ */
562
+ EmbedEvent["CustomAction"] = "customAction";
563
+ /**
564
+ * Listen to double click actions on a visualization.
565
+ * @return ContextMenuInputPoints - Data point that is double-clicked
566
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
567
+ * @example
568
+ * ```js
569
+ * livebaordEmbed.on(EmbedEvent.VizPointDoubleClick, payload => {
570
+ * console.log('VizPointDoubleClick', payload);
571
+ * })
572
+ * ```
573
+ */
574
+ EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
575
+ /**
576
+ * Listen to clicks on a visualization in a Liveboard or Search result.
577
+ * @return viz, clickedPoint - metadata about the point that is clicked
578
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
579
+ * @important
580
+ * @example
581
+ * ```js
582
+ * embed.on(EmbedEvent.VizPointClick, ({data}) => {
583
+ * console.log(
584
+ * data.vizId, // viz id
585
+ * data.clickedPoint.selectedAttributes[0].value,
586
+ * data.clickedPoint.selectedAttributes[0].column.name,
587
+ * data.clickedPoint.selectedMeasures[0].value,
588
+ * data.clickedPoint.selectedMeasures[0].column.name,
589
+ * )
590
+ * });
591
+ * ```
592
+ */
593
+ EmbedEvent["VizPointClick"] = "vizPointClick";
594
+ /**
595
+ * An error has occurred. This event is fired for the following error types:
596
+ *
597
+ * `API` - API call failure error.
598
+ * `FULLSCREEN` - Error when presenting a Liveboard or visualization in full screen
599
+ * mode. `SINGLE_VALUE_FILTER` - Error due to multiple values in the single value
600
+ * filter. `NON_EXIST_FILTER` - Error due to a non-existent filter.
601
+ * `INVALID_DATE_VALUE` - Invalid date value error.
602
+ * `INVALID_OPERATOR` - Use of invalid operator during filter application.
603
+ *
604
+ * For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
605
+ * @returns error - An error object or message
606
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
607
+ * @example
608
+ * ```js
609
+ * // API error
610
+ * SearchEmbed.on(EmbedEvent.Error, (error) => {
611
+ * console.log(error);
612
+ * // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
613
+ * });
614
+ * ```
615
+ * @example
616
+ * ```js
617
+ * // Fullscreen error (Errors during presenting of a liveboard)
618
+ * LiveboardEmbed.on(EmbedEvent.Error, (error) => {
619
+ * console.log(error);
620
+ * // { type: "Error", data: { errorType: "FULLSCREEN", error: {
621
+ * // message: "Fullscreen API is not enabled",
622
+ * // stack: "..."
623
+ * // } }}
624
+ * })
625
+ * ```
626
+ */
627
+ EmbedEvent["Error"] = "Error";
628
+ /**
629
+ * The embedded object has sent an alert.
630
+ * @returns alert - An alert object
631
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
632
+ * @example
633
+ * ```js
634
+ * searchEmbed.on(EmbedEvent.Alert)
635
+ * ```
636
+ */
637
+ EmbedEvent["Alert"] = "alert";
638
+ /**
639
+ * The ThoughtSpot auth session has expired.
640
+ * @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
641
+ * @example
642
+ *```js
643
+ * appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
644
+ * //show auth expired banner
645
+ * function showAuthExpired() {
646
+ * document.getElementById("authExpiredBanner");
647
+ * }
648
+ *```
649
+ */
650
+ EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
651
+ /**
652
+ * ThoughtSpot failed to validate the auth session.
653
+ * @hidden
654
+ */
655
+ EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
656
+ /**
657
+ * ThoughtSpot failed to validate the auth session.
658
+ * @hidden
659
+ */
660
+ EmbedEvent["AuthLogout"] = "ThoughtspotAuthLogout";
661
+ /**
662
+ * The height of the embedded Liveboard or visualization has been computed.
663
+ * @returns data - The height of the embedded Liveboard or visualization
664
+ * @hidden
665
+ */
666
+ EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
667
+ /**
668
+ * The center of visible iframe viewport is calculated.
669
+ * @returns data - The center of the visible Iframe viewport.
670
+ * @hidden
671
+ */
672
+ EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
673
+ /**
674
+ * Emitted when the **Get Data** action is initiated.
675
+ * Applicable to `SearchBarEmbed` only.
676
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
677
+ * @example
678
+ *```js
679
+ * searchbarEmbed.on(EmbedEvent.GetDataClick)
680
+ * .then(data => {
681
+ * console.log('Answer Data:', data);
682
+ * })
683
+ *```
684
+ */
685
+ EmbedEvent["GetDataClick"] = "getDataClick";
686
+ /**
687
+ * Detects the route change.
688
+ * @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
689
+ * @example
690
+ *```js
691
+ * searchEmbed.on(EmbedEvent.RouteChange, payload =>
692
+ * console.log('data', payload))
693
+ *```
694
+ */
695
+ EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
696
+ /**
697
+ * The v1 event type for Data
698
+ * @hidden
699
+ */
700
+ EmbedEvent["V1Data"] = "exportVizDataToParent";
701
+ /**
702
+ * Emitted when the embed does not have cookie access. This happens
703
+ * when Safari and other Web browsers block third-party cookies
704
+ * are blocked by default. `NoCookieAccess` can trigger
705
+ * @example
706
+ *```js
707
+ * appEmbed.on(EmbedEvent.NoCookieAccess)
708
+ *```
709
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1.sw
710
+ */
711
+ EmbedEvent["NoCookieAccess"] = "noCookieAccess";
712
+ /**
713
+ * Emitted when SAML is complete
714
+ * @private
715
+ * @hidden
716
+ */
717
+ EmbedEvent["SAMLComplete"] = "samlComplete";
718
+ /**
719
+ * Emitted when any modal is opened in the app
720
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
721
+ * @example
722
+ *```js
723
+ * appEmbed.on(EmbedEvent.DialogOpen, payload => {
724
+ * console.log('dialog open', payload);
725
+ * })
726
+ *```
727
+ */
728
+ EmbedEvent["DialogOpen"] = "dialog-open";
729
+ /**
730
+ * Emitted when any modal is closed in the app
731
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
732
+ * @example
733
+ *```js
734
+ * appEmbed.on(EmbedEvent.DialogClose, payload => {
735
+ * console.log('dialog close', payload);
736
+ * })
737
+ *```
738
+ */
739
+ EmbedEvent["DialogClose"] = "dialog-close";
740
+ /**
741
+ * Emitted when the Liveboard shell loads.
742
+ * You can use this event as a hook to trigger
743
+ * other events on the rendered Liveboard.
744
+ * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
745
+ * @example
746
+ *```js
747
+ * liveboardEmbed.on(EmbedEvent.LiveboardRendered, payload => {
748
+ console.log('Liveboard is rendered', payload);
749
+ })
750
+ *```
751
+ * The following example shows how to trigger
752
+ * `SetVisibleVizs` event using LiveboardRendered embed event:
753
+ * @example
754
+ *```js
755
+ * const embedRef = useEmbedRef();
756
+ * const onLiveboardRendered = () => {
757
+ * embed.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
758
+ * };
759
+ *```
760
+ */
761
+ EmbedEvent["LiveboardRendered"] = "PinboardRendered";
762
+ /**
763
+ * Emits all events.
764
+ * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
765
+ * @example
766
+ *```js
767
+ * appEmbed.on(EmbedEvent.ALL, payload => {
768
+ * console.log('Embed Events', payload)
769
+ * })
770
+ *```
771
+ */
772
+ EmbedEvent["ALL"] = "*";
773
+ /**
774
+ * Emitted when an Answer is saved in the app
775
+ * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
776
+ * @example
777
+ *```js
778
+ * //Emit when action starts
779
+ * searchEmbed.on(EmbedEvent.Save, payload => {
780
+ * console.log('Save', payload)
781
+ * }, {
782
+ * start: true
783
+ * })
784
+ * //emit when action ends
785
+ * searchEmbed.on(EmbedEvent.Save, payload => {
786
+ * console.log('Save', payload)
787
+ * })
788
+ *```
789
+ */
790
+ EmbedEvent["Save"] = "save";
791
+ /**
792
+ * Emitted when the download action is triggered on an answer
793
+ *
794
+ * **Note**: This event is deprecated in v1.21.0.
795
+ * To fire an event when a download action is initiated on a chart or table,
796
+ * use `EmbedEvent.DownloadAsPng`, `EmbedEvent.DownloadAsPDF`, `EmbedEvent.DownloadAsCSV`,
797
+ * or `EmbedEvent.DownloadAsXLSX`
798
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
799
+ * @example
800
+ *```js
801
+ * liveboardEmbed.on(EmbedEvent.Download, {
802
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
803
+ * })
804
+ *```
805
+ */
806
+ EmbedEvent["Download"] = "download";
807
+ /**
808
+ * Emitted when the download action is triggered on an answer
809
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
810
+ * @example
811
+ *```js
812
+ * //emit when action starts
813
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
814
+ * console.log('download PNG', payload)}, {start: true })
815
+ * //emit when action ends
816
+ * searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
817
+ * console.log('download PNG', payload)})
818
+ *```
819
+ */
820
+ EmbedEvent["DownloadAsPng"] = "downloadAsPng";
821
+ /**
822
+ * Emitted when the Download as PDF action is triggered on an answer
823
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
824
+ * @example
825
+ *```js
826
+ * //emit when action starts
827
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
828
+ * console.log('download PDF', payload)}, {start: true })
829
+ * //emit when action ends
830
+ * searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
831
+ * console.log('download PDF', payload)})
832
+ *```
833
+ */
834
+ EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
835
+ /**
836
+ * Emitted when the Download as CSV action is triggered on an answer
837
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
838
+ * @example
839
+ *```js
840
+ * //emit when action starts
841
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
842
+ * console.log('download CSV', payload)}, {start: true })
843
+ * //emit when action ends
844
+ * searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
845
+ * console.log('download CSV', payload)})
846
+ *```
847
+ */
848
+ EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
849
+ /**
850
+ * Emitted when the Download as XLSX action is triggered on an answer
851
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
852
+ * @example
853
+ *```js
854
+ * //emit when action starts
855
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
856
+ * console.log('download Xlsx', payload)}, { start: true })
857
+ * //emit when action ends
858
+ * searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
859
+ * console.log('download Xlsx', payload)})
860
+ *```
861
+ */
862
+ EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
863
+ /**
864
+ * Emitted when an Answer is deleted in the app
865
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
866
+ * @example
867
+ *```js
868
+ * //emit when action starts
869
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
870
+ * console.log('delete answer', payload)}, {start: true })
871
+ * //trigger when action is completed
872
+ * appEmbed.on(EmbedEvent.AnswerDelete, payload => {
873
+ * console.log('delete answer', payload)})
874
+ *```
875
+ */
876
+ EmbedEvent["AnswerDelete"] = "answerDelete";
877
+ /**
878
+ * Emitted when an answer is pinned to a Liveboard
879
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
880
+ * @example
881
+ *```js
882
+ * //emit when action starts
883
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
884
+ * console.log('pin', payload)
885
+ * }, {
886
+ * start: true
887
+ * })
888
+ * //emit when action ends
889
+ * searchEmbed.on(EmbedEvent.Pin, payload => {
890
+ * console.log('pin', payload)
891
+ * })
892
+ *```
893
+ */
894
+ EmbedEvent["Pin"] = "pin";
895
+ /**
896
+ * Emitted when SpotIQ analysis is triggered
897
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
898
+ * @example
899
+ *```js
900
+ * //emit when action starts
901
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
902
+ * console.log('SpotIQAnalyze', payload)
903
+ * }, {
904
+ * start: true
905
+ * })
906
+ * //emit when action ends
907
+ * searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
908
+ * console.log('SpotIQ analyze', payload)
909
+ * })
910
+ *```
911
+ */
912
+ EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
913
+ /**
914
+ * Emitted when a user shares an object with another user or group
915
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
916
+ * @example
917
+ *```js
918
+ * //emit when action starts
919
+ * searchEmbed.on(EmbedEvent.Share, payload => {
920
+ * console.log('Share', payload)
921
+ * }, {
922
+ * start: true
923
+ * })
924
+ * //emit when action ends
925
+ * searchEmbed.on(EmbedEvent.Share, payload => {
926
+ * console.log('Share', payload)
927
+ * })
928
+ *```
929
+ */
930
+ EmbedEvent["Share"] = "share";
931
+ /**
932
+ * Emitted when a user clicks the **Include** action to include a specific value or
933
+ * data on a chart or table.
934
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
935
+ * @example
936
+ *```js
937
+ * appEmbed.on(EmbedEvent.DrillInclude, payload => {
938
+ * console.log('Drill include', payload);
939
+ * })
940
+ *```
941
+ */
942
+ EmbedEvent["DrillInclude"] = "context-menu-item-include";
943
+ /**
944
+ * Emitted when a user clicks the **Exclude** action to exclude a specific value or
945
+ * data on a chart or table
946
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
947
+ * @example
948
+ *```js
949
+ * appEmbed.on(EmbedEvent.DrillExclude, payload => {
950
+ * console.log('Drill exclude', payload);
951
+ * })
952
+ *```
953
+ */
954
+ EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
955
+ /**
956
+ * Emitted when a column value is copied in the embedded app.
957
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
958
+ * @example
959
+ *```js
960
+ * seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
961
+ * console.log('copy to clipboard', payload);
962
+ * })
963
+ *```
964
+ */
965
+ EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
966
+ /**
967
+ * Emitted when a user clicks the **Update TML** action on
968
+ * embedded Liveboard.
969
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
970
+ * @example
971
+ *```js
972
+ * liveboardEmbed.on(EmbedEvent.UpdateTML)
973
+ * })
974
+ *```
975
+ */
976
+ EmbedEvent["UpdateTML"] = "updateTSL";
977
+ /**
978
+ * Emitted when a user clicks the **Edit TML** action
979
+ * on an embedded Liveboard.
980
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
981
+ * @example
982
+ *```js
983
+ * appEmbed.on(EmbedEvent.EditTML, payload => {
984
+ * console.log('Edit TML', payload);
985
+ * })
986
+ *```
987
+ */
988
+ EmbedEvent["EditTML"] = "editTSL";
989
+ /**
990
+ * Emitted when the **Export TML** action is triggered on an
991
+ * an embedded object in the app
992
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
993
+ * @example
994
+ *```js
995
+ * //emit when action starts
996
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
997
+ * console.log('Export TML', payload)}, { start: true })
998
+ * //emit when action ends
999
+ * searchEmbed.on(EmbedEvent.ExportTML, payload => {
1000
+ * console.log('Export TML', payload)})
1001
+ *```
1002
+ */
1003
+ EmbedEvent["ExportTML"] = "exportTSL";
1004
+ /**
1005
+ * Emitted when an Answer is saved as a View.
1006
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1007
+ * @example
1008
+ *```js
1009
+ * appEmbed.on(EmbedEvent.SaveAsView, payload => {
1010
+ * console.log('View', payload);
1011
+ * })
1012
+ *```
1013
+ */
1014
+ EmbedEvent["SaveAsView"] = "saveAsView";
1015
+ /**
1016
+ * Emitted when the user creates a copy of an Answer
1017
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1018
+ * @example
1019
+ *```js
1020
+ * //emit when action starts
1021
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1022
+ * console.log('Copy and edit', payload)}, {start: true })
1023
+ * //emit when action ends
1024
+ * appEmbed.on(EmbedEvent.CopyAEdit, payload => {
1025
+ * console.log('Copy and edit', payload)})
1026
+ *```
1027
+ */
1028
+ EmbedEvent["CopyAEdit"] = "copyAEdit";
1029
+ /**
1030
+ * Emitted when a user clicks Show underlying data on an Answer
1031
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1032
+ * @example
1033
+ *```js
1034
+ * liveboardEmbed.on(EmbedEvent.ShowUnderlyingData, payload => {
1035
+ * console.log('show data', payload);
1036
+ * })
1037
+ *```
1038
+ */
1039
+ EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
1040
+ /**
1041
+ * Emitted when an answer is switched to a chart or table view.
1042
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
1043
+ * @example
1044
+ *```js
1045
+ * searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1046
+ * console.log('switch view', payload);
1047
+ * })
1048
+ *```
1049
+ */
1050
+ EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
1051
+ /**
1052
+ * Internal event to communicate the initial settings back to the ThoughtSpot app
1053
+ * @hidden
1054
+ */
1055
+ EmbedEvent["APP_INIT"] = "appInit";
1056
+ /**
1057
+ * Emitted when a user clicks **Show Liveboard details** on a Liveboard
1058
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1059
+ * @example
1060
+ *```js
1061
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1062
+ * console.log('Liveboard details', payload);
1063
+ * })
1064
+ *```
1065
+ */
1066
+ EmbedEvent["LiveboardInfo"] = "pinboardInfo";
1067
+ /**
1068
+ * Emitted when a user clicks on the Favorite icon on a Liveboard
1069
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1070
+ * @example
1071
+ *```js
1072
+ * liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
1073
+ * console.log('favorites', payload);
1074
+ * })
1075
+ *```
1076
+ */
1077
+ EmbedEvent["AddToFavorites"] = "addToFavorites";
1078
+ /**
1079
+ * Emitted when a user clicks **Schedule** on a Liveboard
1080
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1081
+ * @example
1082
+ *```js
1083
+ * liveboardEmbed.on(EmbedEvent.Schedule, payload => {
1084
+ * console.log(`Liveboard schedule', payload);
1085
+ * })
1086
+ *```
1087
+ */
1088
+ EmbedEvent["Schedule"] = "subscription";
1089
+ /**
1090
+ * Emitted when a user clicks **Edit** on a Liveboard or visualization
1091
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1092
+ * @example
1093
+ *```js
1094
+ * liveboardEmbed.on(EmbedEvent.Edit, payload => {
1095
+ * console.log(`Liveboard edit', payload);
1096
+ * })
1097
+ *```
1098
+ */
1099
+ EmbedEvent["Edit"] = "edit";
1100
+ /**
1101
+ * Emitted when a user clicks *Make a copy* on a Liveboard
1102
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1103
+ * @example
1104
+ *```js
1105
+ * liveboardEmbed.on(EmbedEvent.MakeACopy, payload => {
1106
+ * console.log(`Copy', payload);
1107
+ * })
1108
+ *```
1109
+ */
1110
+ EmbedEvent["MakeACopy"] = "makeACopy";
1111
+ /**
1112
+ * Emitted when a user clicks **Present** on a Liveboard or visualization
1113
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1114
+ * @example
1115
+ *```js
1116
+ * liveboardEmbed.on(EmbedEvent.Present)
1117
+ *```
1118
+ * @example
1119
+ *```js
1120
+ * liveboardEmbed.on(EmbedEvent.Present, {
1121
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1122
+ * })
1123
+ *```
1124
+ */
1125
+ EmbedEvent["Present"] = "present";
1126
+ /**
1127
+ * Emitted when a user clicks **Delete** on a visualization
1128
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1129
+ * @example
1130
+ *```js
1131
+ * liveboardEmbed.on(EmbedEvent.Delete,
1132
+ * {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1133
+ *```
1134
+ */
1135
+ EmbedEvent["Delete"] = "delete";
1136
+ /**
1137
+ * Emitted when a user clicks Manage schedules on a Liveboard
1138
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1139
+ * @example
1140
+ *```js
1141
+ * liveboardEmbed.on(EmbedEvent.SchedulesList)
1142
+ *```
1143
+ */
1144
+ EmbedEvent["SchedulesList"] = "schedule-list";
1145
+ /**
1146
+ * Emitted when a user clicks **Cancel** in edit mode on a Liveboard
1147
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1148
+ * @example
1149
+ *```js
1150
+ * liveboardEmbed.on(EmbedEvent.Cancel)
1151
+ *```
1152
+ */
1153
+ EmbedEvent["Cancel"] = "cancel";
1154
+ /**
1155
+ * Emitted when a user clicks **Explore** on a visualization
1156
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1157
+ * @example
1158
+ *```js
1159
+ * liveboardEmbed.on(EmbedEvent.Explore, {
1160
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1161
+ *```
1162
+ */
1163
+ EmbedEvent["Explore"] = "explore";
1164
+ /**
1165
+ * Emitted when a user clicks **Copy link** action on a visualization
1166
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1167
+ * @example
1168
+ *```js
1169
+ * liveboardEmbed.on(EmbedEvent.CopyLink, {
1170
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1171
+ *```
1172
+ */
1173
+ EmbedEvent["CopyLink"] = "embedDocument";
1174
+ /**
1175
+ * Emitted when a user interacts with cross filters on a visualization or Liveboard
1176
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1177
+ * @example
1178
+ *```js
1179
+ * liveboardEmbed.trigger(HostEvent.CrossFilterChanged, {
1180
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1181
+ *```
1182
+ */
1183
+ EmbedEvent["CrossFilterChanged"] = "cross-filter-changed";
1184
+ /**
1185
+ * Emitted when a user right clicks on a visualization (chart or table)
1186
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
1187
+ * @example
1188
+ *```js
1189
+ * LiveboardEmbed.on(EmbedEvent.VizPointRightClick, payload => {
1190
+ * console.log('VizPointClick', payload)
1191
+ * })
1192
+ *```
1193
+ */
1194
+ EmbedEvent["VizPointRightClick"] = "vizPointRightClick";
1195
+ /**
1196
+ * Emitted when a user clicks **Insert to slide** on a visualization
1197
+ * @hidden
1198
+ */
1199
+ EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
1200
+ /**
1201
+ * Emitted when a user changes any filter on a Liveboard.
1202
+ * Returns filter type and name, column name and ID, and runtime
1203
+ * filter details.
1204
+ * @example
1205
+ *
1206
+ *```js
1207
+ * LiveboardEmbed.on(EmbedEvent.FilterChanged, (payload) => {
1208
+ * console.log('payload', payload);
1209
+ * })
1210
+ *
1211
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.0.sw
1212
+ */
1213
+ EmbedEvent["FilterChanged"] = "filterChanged";
1214
+ /**
1215
+ * Emitted when a user clicks the **Go** button on the sage embed
1216
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1217
+ */
1218
+ EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
1219
+ /**
1220
+ * Emitted when a user selects a data source on the sage embed
1221
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1222
+ */
1223
+ EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
1224
+ /**
1225
+ * Emitted when a user updates a connection on the **Data** page
1226
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1227
+ */
1228
+ EmbedEvent["UpdateConnection"] = "updateConnection";
1229
+ /**
1230
+ * Emitted when a user updates a connection on the **Data** page
1231
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
1232
+ */
1233
+ EmbedEvent["CreateConnection"] = "createConnection";
1234
+ /**
1235
+ * Emitted when name, status (private or public) or filter values of a
1236
+ * Personalised view is updated.
1237
+ * @returns viewName: string
1238
+ * @returns viewId: string
1239
+ * @returns liveboardId: string
1240
+ * @returns isPublic: boolean
1241
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1242
+ */
1243
+ EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
1244
+ /**
1245
+ * Emitted when a Personalised view is saved.
1246
+ * @returns viewName: string
1247
+ * @returns viewId: string
1248
+ * @returns liveboardId: string
1249
+ * @returns isPublic: boolean
1250
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1251
+ */
1252
+ EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
1253
+ /**
1254
+ * Emitted when a Liveboard is reset.
1255
+ * @returns viewName: string
1256
+ * @returns viewId: string
1257
+ * @returns liveboardId: string
1258
+ * @returns isPublic: boolean
1259
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1260
+ */
1261
+ EmbedEvent["ResetLiveboard"] = "resetLiveboard";
1262
+ /**
1263
+ * Emitted when a PersonalisedView is deleted.
1264
+ * @returns views: string[]
1265
+ * @returns liveboardId: string
1266
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
1267
+ */
1268
+ EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
1269
+ /**
1270
+ * Emitted when a user creates a new worksheet
1271
+ * @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
1272
+ */
1273
+ EmbedEvent["CreateWorksheet"] = "createWorksheet";
1274
+ /**
1275
+ * Emitted when Ask Sage is initialized.
1276
+ * @returns viewName: string
1277
+ * @returns viewId: string
1278
+ * @returns liveboardId: string
1279
+ * @returns isPublic: boolean
1280
+ * @version SDK : 1.29.0 | Thoughtspot: 9.12.0.cl
1281
+ */
1282
+ EmbedEvent["AskSageInit"] = "AskSageInit";
1283
+ /**
1284
+ * Emitted when a LB/viz is renamed
1285
+ * @version SDK : 1.28.0 | ThoughtSpot: 9.10.5.cl
1286
+ */
1287
+ EmbedEvent["Rename"] = "rename";
1288
+ /**
1289
+ *
1290
+ * This event can be emitted to intercept search execution initiated by
1291
+ * the users and implement the logic to allow or restrict search execution.
1292
+ * You can can also show custom error text if the search query must be
1293
+ * restricted due to your application or business requirements.
1294
+
1295
+ * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
1296
+ * for this embed event to get emitted.
1297
+ * @param: payload
1298
+ * @param: responder
1299
+ * Contains elements that lets developers define whether ThoughtSpot
1300
+ * should run the search, and if not, what error message
1301
+ * should be shown to the user.
1302
+ *
1303
+ * execute: When execute returns `true`, the search will be run.
1304
+ * When execute returns `false`, the search will not be executed.
1305
+ *
1306
+ * error: Developers can customize the error message text when `execute`
1307
+ * returns `false` using the error parameter in responder.
1308
+ * @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
1309
+ * @example
1310
+ *```js
1311
+ * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1312
+ * (payload, responder) => {
1313
+ * responder({
1314
+ * data: {
1315
+ * execute:false,
1316
+ * error: {
1317
+ * //Provide a custom error message to explain to your end user
1318
+ * //why their search did not run
1319
+ * errorText: "This search query cannot be run.
1320
+ * Please contact your administrator for more details."
1321
+ * }
1322
+ * }})
1323
+ * })
1324
+ * ```
1325
+ *
1326
+ *```js
1327
+ * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1328
+ * (payload, responder) => {
1329
+ * const query = payload.data.data.answer.search_query
1330
+ * responder({
1331
+ * data: {
1332
+ * // returns true as long as the query does not include
1333
+ * // both the 'sales' AND the 'county' column
1334
+ * execute: !(query.includes("sales")&&query.includes("county")),
1335
+ * error: {
1336
+ * //Provide a custom error message to explain to your end user
1337
+ * // why their search did not run, and which searches are accepted by your custom logic.
1338
+ * errorText: "You can't use this query :" + query + ".
1339
+ * The 'sales' measures can never be used at the 'county' level.
1340
+ * Please try another measure, or remove 'county' from your search."
1341
+ * }
1342
+ * }})
1343
+ * })
1344
+ *```
1345
+ */
1346
+ EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
1347
+ /**
1348
+ * Emitted when parameter changes in an Answer
1349
+ * or Liveboard
1350
+ *
1351
+ * ```js
1352
+ * liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
1353
+ * console.log('payload', payload);
1354
+ * })
1355
+ *```
1356
+ * @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
1357
+ */
1358
+ EmbedEvent["ParameterChanged"] = "parameterChanged";
1359
+ })(EmbedEvent || (EmbedEvent = {}));
1360
+ /**
1361
+ * Event types that can be triggered by the host application
1362
+ * to the embedded ThoughtSpot app.
1363
+ *
1364
+ * To trigger an event use the corresponding
1365
+ * {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
1366
+ * SearchEmbed.trigger} method.
1367
+ * @example
1368
+ * ```js
1369
+ * import { HostEvent } from '@thoughtspot/visual-embed-sdk';
1370
+ * // Or
1371
+ * // const { HostEvent } = window.tsembed;
1372
+ *
1373
+ * // create the liveboard embed.
1374
+ *
1375
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1376
+ * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1377
+ * ]);
1378
+ * ```
1379
+ * @example
1380
+ * If using React components to embed, use the format shown in this example:
1381
+ *
1382
+ * ```js
1383
+ * const selectVizs = () => {
1384
+ * embedRef.current.trigger(HostEvent.SetVisibleVizs, [
1385
+ * "715e4613-c891-4884-be44-aa8d13701c06",
1386
+ * "3f84d633-e325-44b2-be25-c6650e5a49cf"
1387
+ * ]);
1388
+ * };
1389
+ * ```
1390
+ *
1391
+ *
1392
+ * You can also attach an Embed event to a Host event to trigger
1393
+ * a specific action as shown in this example:
1394
+ * @example
1395
+ * ```js
1396
+ * const EmbeddedComponent = () => {
1397
+ * const embedRef = useRef(null); // import { useRef } from react
1398
+ * const onLiveboardRendered = () => {
1399
+ * embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
1400
+ * };
1401
+ *
1402
+ * return (
1403
+ * <LiveboardEmbed
1404
+ * ref={embedRef}
1405
+ * liveboardId="<liveboard-guid>"
1406
+ * onLiveboardRendered={onLiveboardRendered}
1407
+ * />
1408
+ * );
1409
+ * }
1410
+ * ```
1411
+ * @group Events
1412
+ */
1413
+ // eslint-disable-next-line no-shadow
1414
+ var HostEvent;
1415
+ (function (HostEvent) {
1416
+ /**
1417
+ * Triggers a search operation with the search tokens specified in
1418
+ * the search query string.
1419
+ * Supported in `AppEmbed` and `SearchEmbed` deployments.
1420
+ * Includes the following properties:
1421
+ * @param - `searchQuery` - query string with search tokens
1422
+ * @param - `dataSources` - Data source GUID to Search on
1423
+ * - Although an array, only a single source
1424
+ * is supported.
1425
+ * @param - `execute` - executes search and updates the existing query
1426
+ * @example
1427
+ * ```js
1428
+ * searchembed.trigger(HostEvent.Search, {
1429
+ searchQuery: "[sales] by [item type]",
1430
+ dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
1431
+ execute: true
1432
+ });
1433
+ * ```
1434
+ */
1435
+ HostEvent["Search"] = "search";
1436
+ /**
1437
+ * Triggers a drill on certain points of the specified column
1438
+ * Includes the following properties:
1439
+ * @param - points - an object containing selectedPoints/clickedPoints
1440
+ * to drill to. For example, { selectedPoints: []}
1441
+ * @param - columnGuid - Optional. GUID of the column to drill
1442
+ * by. If not provided it will auto drill by the configured
1443
+ * column.
1444
+ * @param - autoDrillDown - Optional. If true, the drill down will be
1445
+ * done automatically on the most popular column.
1446
+ * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1447
+ * in case of a liveboard.
1448
+ * @example
1449
+ * ```js
1450
+ * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
1451
+ * console.log(payload);
1452
+ * const clickedPoint = payload.data.clickedPoint;
1453
+ * const selectedPoint = payload.data.selectedPoints;
1454
+ * console.log('>>> called', clickedPoint);
1455
+ * searchEmbed.trigger(HostEvent.DrillDown, {
1456
+ * points: {
1457
+ * clickedPoint,
1458
+ * selectedPoints: selectedPoint
1459
+ * },
1460
+ * autoDrillDown: true,
1461
+ * });
1462
+ * })
1463
+ * ```
1464
+ * @example
1465
+ * ```js
1466
+ * // Works with TS 9.8.0 and above
1467
+ *
1468
+ * liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
1469
+ * console.log(payload);
1470
+ * const clickedPoint = payload.data.clickedPoint;
1471
+ * const selectedPoint = payload.data.selectedPoints;
1472
+ * console.log('>>> called', clickedPoint);
1473
+ * liveboardEmbed.trigger(HostEvent.DrillDown, {
1474
+ * points: {
1475
+ * clickedPoint,
1476
+ * selectedPoints: selectedPoint
1477
+ * },
1478
+ * columnGuid: "<guid of the column to drill>",
1479
+ * vizId: payload.data.vizId
1480
+ * });
1481
+ * })
1482
+ * ```
1483
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1484
+ */
1485
+ HostEvent["DrillDown"] = "triggerDrillDown";
1486
+ /**
1487
+ * Apply filters
1488
+ * @hidden
1489
+ */
1490
+ HostEvent["Filter"] = "filter";
1491
+ /**
1492
+ * Reload the answer or visualization
1493
+ * @hidden
1494
+ */
1495
+ HostEvent["Reload"] = "reload";
1496
+ /**
1497
+ * Get iframe URL for the current embed view on the playground.
1498
+ * Developers can use this URL to embed a ThoughtSpot object
1499
+ * in apps like Salesforce or Sharepoint.
1500
+ * @example
1501
+ * ```js
1502
+ * const url = embed.trigger(HostEvent.GetIframeUrl);
1503
+ * console.log("iFrameURL",url);
1504
+ * ```
1505
+ * @version SDK: 1.35.0 | Thoughtspot: 10.4.0.cl
1506
+ */
1507
+ HostEvent["GetIframeUrl"] = "GetIframeUrl";
1508
+ /**
1509
+ * Display specific visualizations on a Liveboard.
1510
+ * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
1511
+ * in this parameter will be hidden.
1512
+ * @example
1513
+ * ```js
1514
+ * liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
1515
+ * '730496d6-6903-4601-937e-2c691821af3c',
1516
+ * 'd547ec54-2a37-4516-a222-2b06719af726'])
1517
+ * ```
1518
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1519
+ */
1520
+ HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
1521
+ /**
1522
+ * Set a Liveboard tab as an active tab.
1523
+ * @param - tabId - string of id of Tab to show
1524
+ * @example
1525
+ * ```js
1526
+ * liveboardEmbed.trigger(HostEvent.SetActiveTab,{
1527
+ * tabId:'730496d6-6903-4601-937e-2c691821af3c'
1528
+ * })
1529
+ * ```
1530
+ * @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
1531
+ */
1532
+ HostEvent["SetActiveTab"] = "SetActiveTab";
1533
+ /**
1534
+ * Update runtime filters applied on a Saved Answer or Liveboard. The
1535
+ * runtime filters passed here are appended to the existing runtime
1536
+ * filters.
1537
+ * Pass an array of runtime filters with the following attributes:
1538
+ *
1539
+ * `columnName`
1540
+ * _String_. The name of the column to filter on.
1541
+ *
1542
+ * `operator`
1543
+ * Runtime filter operator to apply. For information,
1544
+ * see link:https://developers.thoughtspot.com/docs/?pageid=runtime-filters#rtOperator[Developer Documentation].
1545
+ *
1546
+ * `values`
1547
+ * List of operands. Some operators such as EQ, LE allow a single value, whereas
1548
+ * operators such as BW and IN accept multiple operands.
1549
+ *
1550
+ * **Note**: `HostEvent.UpdateRuntimeFilters` is not supported in
1551
+ * Search embedding (SearchEmbed) and Natural Language Search
1552
+ * embedding (SageEmbed).
1553
+ * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
1554
+ * @example
1555
+ * ```js
1556
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1557
+ * {columnName: "state",operator: RuntimeFilterOp.EQ,values: ["michigan"]},
1558
+ * {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
1559
+ * ])
1560
+ * ```
1561
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
1562
+ * @important
1563
+ */
1564
+ HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
1565
+ /**
1566
+ * Navigate to a specific page in the embedded ThoughtSpot application.
1567
+ * This is the same as calling `appEmbed.navigateToPage(path, true)`
1568
+ * @param - `path` - the path to navigate to to go forward or back. The path value can
1569
+ * be a number; for example, `1`, `-1`.
1570
+ * @example
1571
+ * ```js
1572
+ * appEmbed.navigateToPage(-1)
1573
+ * ```
1574
+ * @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1.sw
1575
+ */
1576
+ HostEvent["Navigate"] = "Navigate";
1577
+ /**
1578
+ * Open the filter panel for a particular column.
1579
+ * Works with Search and Liveboard embed.
1580
+ * @param - { columnId: string,
1581
+ * name: string,
1582
+ * type: INT64/CHAR/DATE,
1583
+ * dataType: ATTRIBUTE/MEASURE }
1584
+ * @example
1585
+ * ```js
1586
+ * searchEmbed.trigger(HostEvent.OpenFilter,
1587
+ * { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
1588
+ * LiveboardEmbed.trigger(HostEvent.OpenFilter,
1589
+ * { columnId: '<column-GUID>'})
1590
+ * ```
1591
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1592
+ */
1593
+ HostEvent["OpenFilter"] = "openFilter";
1594
+ /**
1595
+ * Add columns to the current search query.
1596
+ * @param - { columnIds: string[] }
1597
+ * @example
1598
+ * ```js
1599
+ * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
1600
+ * ```
1601
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1602
+ */
1603
+ HostEvent["AddColumns"] = "addColumns";
1604
+ /**
1605
+ * Remove a column from the current search query.
1606
+ * @param - { columnId: string }
1607
+ * @example
1608
+ * ```js
1609
+ * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
1610
+ * ```
1611
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1612
+ */
1613
+ HostEvent["RemoveColumn"] = "removeColumn";
1614
+ /**
1615
+ * Get the transient state of a Liveboard as encoded content.
1616
+ * This includes unsaved and ad hoc changes such as
1617
+ * Liveboard filters, runtime filters applied on visualizations on a
1618
+ * Liveboard, and Liveboard layout, changes to visualizations such as
1619
+ * sorting, toggling of legends, and data drill down.
1620
+ * For more information, see
1621
+ * link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
1622
+ * @example
1623
+ * ```js
1624
+ * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
1625
+ * data=>console.log(data))
1626
+ * ```
1627
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
1628
+ */
1629
+ HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
1630
+ /**
1631
+ * Trigger the **Pin** action on an embedded object
1632
+ * @param - Liveboard embed takes the `vizId` as a
1633
+ * key. Can be left undefined when embedding Search, full app, or
1634
+ * a visualization.
1635
+ * @example
1636
+ * ```js
1637
+ * appEmbed.trigger(HostEvent.Pin)
1638
+ * ```
1639
+ * ```js
1640
+ * searchEmbed.trigger(HostEvent.Pin)
1641
+ * ```
1642
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1643
+ */
1644
+ HostEvent["Pin"] = "pin";
1645
+ /**
1646
+ * Trigger the **Show Liveboard details** action
1647
+ * on an embedded Liveboard.
1648
+ * @example
1649
+ *```js
1650
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
1651
+ *```
1652
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1653
+ */
1654
+ HostEvent["LiveboardInfo"] = "pinboardInfo";
1655
+ /**
1656
+ * Trigger the **Schedule** action on an embedded Liveboard.
1657
+ * @example
1658
+ * ```js
1659
+ * liveboardEmbed.trigger(HostEvent.Schedule)
1660
+ * ```
1661
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1662
+ */
1663
+ HostEvent["Schedule"] = "subscription";
1664
+ /**
1665
+ * Trigger the **Manage schedule** action on an embedded Liveboard
1666
+ * @example
1667
+ * ```js
1668
+ * liveboardEmbed.trigger(HostEvent.ScheduleList)
1669
+ * ```
1670
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1671
+ */
1672
+ HostEvent["SchedulesList"] = "schedule-list";
1673
+ /**
1674
+ * Trigger the **Export TML** action on an embedded Liveboard or
1675
+ * Answer.
1676
+ * @example
1677
+ * ```js
1678
+ * liveboardEmbed.trigger(HostEvent.ExportTML)
1679
+ * ```
1680
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1681
+ */
1682
+ HostEvent["ExportTML"] = "exportTSL";
1683
+ /**
1684
+ * Trigger the **Edit TML** action on an embedded Liveboard or
1685
+ * saved Answers in the full application embedding.
1686
+ * @example
1687
+ * ```js
1688
+ * liveboardEmbed.trigger(HostEvent.EditTML)
1689
+ * ```
1690
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1691
+ */
1692
+ HostEvent["EditTML"] = "editTSL";
1693
+ /**
1694
+ * Trigger the **Update TML** action on an embedded Liveboard.
1695
+ * @example
1696
+ * ```js
1697
+ * liveboardEmbed.trigger(HostEvent.UpdateTML)
1698
+ * ```
1699
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1700
+ */
1701
+ HostEvent["UpdateTML"] = "updateTSL";
1702
+ /**
1703
+ * Trigger the **Download PDF** action on an embedded Liveboard,
1704
+ * visualization or Answer.
1705
+ *
1706
+ * **NOTE**: The **Download** > **PDF** action is available on
1707
+ * visualizations and Answers if the data is in tabular format.
1708
+ * @example
1709
+ * ```js
1710
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
1711
+ * ```
1712
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1713
+ */
1714
+ HostEvent["DownloadAsPdf"] = "downloadAsPdf";
1715
+ /**
1716
+ * Trigger the **Make a copy** action on a Liveboard,
1717
+ * visualization, or Answer page.
1718
+ * @example
1719
+ * ```js
1720
+ * liveboardEmbed.trigger(HostEvent.MakeACopy)
1721
+ * ```
1722
+ * @example
1723
+ * ```js
1724
+ * liveboardEmbed.trigger(HostEvent.MakeACopy, {
1725
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1726
+ * ```
1727
+ * @example
1728
+ * ```js
1729
+ * vizEmbed.trigger(HostEvent.MakeACopy)
1730
+ * ```
1731
+ * @example
1732
+ * ```js
1733
+ * searchEmbed.trigger(HostEvent.MakeACopy)
1734
+ * ```
1735
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1736
+ */
1737
+ HostEvent["MakeACopy"] = "makeACopy";
1738
+ /**
1739
+ * Trigger the **Delete** action for a Liveboard.
1740
+ * @example
1741
+ * ```js
1742
+ * appEmbed.trigger(HostEvent.Remove)
1743
+ * ```
1744
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1745
+ */
1746
+ HostEvent["Remove"] = "delete";
1747
+ /**
1748
+ * Trigger the **Explore** action on a visualization.
1749
+ * @param - an object with `vizId` as a key
1750
+ * @example
1751
+ * ```js
1752
+ * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1753
+ * ```
1754
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1755
+ */
1756
+ HostEvent["Explore"] = "explore";
1757
+ /**
1758
+ * Trigger the **Create alert** action on a KPI chart
1759
+ * in a Liveboard or saved Answer.
1760
+ * @param - an object with `vizId` as a key
1761
+ * @example
1762
+ * ```js
1763
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor {
1764
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
1765
+ * })
1766
+ * ```
1767
+ * @example
1768
+ * ```js
1769
+ * searchEmbed.trigger(HostEvent.CreateMonitor)
1770
+ * ```
1771
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1772
+ */
1773
+ HostEvent["CreateMonitor"] = "createMonitor";
1774
+ /**
1775
+ * Trigger the **Manage alerts** action on a KPI chart
1776
+ * in a visualization or saved Answer.
1777
+ * @param - an object with `vizId` as a key
1778
+ * @example
1779
+ * ```js
1780
+ * liveboardEmbed.trigger(HostEvent.ManageMonitor, {
1781
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
1782
+ * })
1783
+ * ```
1784
+ * @example
1785
+ * ```js
1786
+ * searchEmbed.trigger(HostEvent.ManageMonitor)
1787
+ * ```
1788
+ * @example
1789
+ * ```js
1790
+ * vizEmbed.trigger(HostEvent.ManageMonitor)
1791
+ * ```
1792
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1793
+ */
1794
+ HostEvent["ManageMonitor"] = "manageMonitor";
1795
+ /**
1796
+ * Trigger the **Edit** action on a Liveboard or a visualization
1797
+ * on a Liveboard.
1798
+ *
1799
+ * This event is not supported in visualization embed and search embed.
1800
+ * @param - object - To trigger the action for a specific visualization
1801
+ * in Liveboard embed, pass in `vizId` as a key.
1802
+ * @example
1803
+ * ```js
1804
+ * liveboardEmbed.trigger(HostEvent.Edit)
1805
+ * ```
1806
+ * ```js
1807
+ * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
1808
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1809
+ * ```
1810
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1811
+ */
1812
+ HostEvent["Edit"] = "edit";
1813
+ /**
1814
+ * Trigger the **Copy link** action on a Liveboard or visualization
1815
+ * @param - object - to trigger the action for a
1816
+ * specific visualization in Liveboard embed, pass in `vizId` as a key
1817
+ * @example
1818
+ * ```js
1819
+ * liveboardEmbed.trigger(HostEvent.CopyLink)
1820
+ * ```
1821
+ * ```js
1822
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1823
+ * ```
1824
+ * ```js
1825
+ * vizEmbed.trigger((HostEvent.CopyLink)
1826
+ * ```
1827
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1828
+ */
1829
+ HostEvent["CopyLink"] = "embedDocument";
1830
+ /**
1831
+ * Trigger the **Present** action on a Liveboard or visualization
1832
+ * @param - object - to trigger the action for a specific visualization
1833
+ * in Liveboard embed, pass in `vizId` as a key
1834
+ * @example
1835
+ * ```js
1836
+ * liveboardEmbed.trigger(HostEvent.Present)
1837
+ * ```
1838
+ * ```js
1839
+ * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
1840
+ * ```
1841
+ * ```js
1842
+ * vizEmbed.trigger((HostEvent.Present)
1843
+ * ```
1844
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1845
+ */
1846
+ HostEvent["Present"] = "present";
1847
+ /**
1848
+ * Get TML for the current search.
1849
+ * @example
1850
+ * ```js
1851
+ * searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
1852
+ * console.log(
1853
+ * tml.answer.search_query // TML representation of the search query
1854
+ * );
1855
+ * })
1856
+ * ```
1857
+ * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
1858
+ * @important
1859
+ */
1860
+ HostEvent["GetTML"] = "getTML";
1861
+ /**
1862
+ * Trigger the **Show underlying data** action on visualization or search
1863
+ * @param - an object with vizId as a key
1864
+ * @example
1865
+ * ```js
1866
+ * liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId:
1867
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1868
+ * ```
1869
+ * ```js
1870
+ * vizEmbed.trigger(HostEvent.ShowUnderlyingData)
1871
+ * ```
1872
+ * ```js
1873
+ * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
1874
+ * ```
1875
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1876
+ */
1877
+ HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
1878
+ /**
1879
+ * Trigger the **Delete** action for a visualization
1880
+ * in an embedded Liveboard, or a chart or table
1881
+ * generated from Search.
1882
+ * @param - Liveboard embed takes an object with `vizId` as a key.
1883
+ * Can be left empty if embedding Search or visualization.
1884
+ * @example
1885
+ * ```js
1886
+ * liveboardEmbed.trigger(HostEvent.Delete, {vizId:
1887
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1888
+ * ```
1889
+ * ```js
1890
+ * searchEmbed.trigger(HostEvent.Delete)
1891
+ * ```
1892
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1893
+ */
1894
+ HostEvent["Delete"] = "onDeleteAnswer";
1895
+ /**
1896
+ * Trigger the **SpotIQ analyze** action on visualization
1897
+ * or search.
1898
+ * @param - Liveboard embed takes `vizId` as a
1899
+ * key. Can be left undefined when embedding Search or
1900
+ * visualization.
1901
+ * @example
1902
+ * ```js
1903
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId:
1904
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1905
+ * ```
1906
+ * ```js
1907
+ * vizEmbed.trigger(HostEvent.SpotIQAnalyze)
1908
+ * ```
1909
+ * ```js
1910
+ * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
1911
+ * ```
1912
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1913
+ */
1914
+ HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
1915
+ /**
1916
+ * Trigger the **Download** action on charts in
1917
+ * the embedded view.
1918
+ * @example
1919
+ * ```js
1920
+ * liveboardEmbed.trigger(HostEvent.Download, {vizId:
1921
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1922
+ * ```
1923
+ * ```js
1924
+ * embed.trigger(HostEvent.Download)
1925
+ * ```
1926
+ * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
1927
+ * Use {@link DownloadAsPng}
1928
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1929
+ */
1930
+ HostEvent["Download"] = "downloadAsPng";
1931
+ /**
1932
+ * Trigger the **Download** > **PNG** action on
1933
+ * charts in the embedded view.
1934
+ * @example
1935
+ * ```js
1936
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPng,
1937
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
1938
+ *
1939
+ * vizEmbed.trigger(HostEvent.DownloadAsPng)
1940
+ *
1941
+ * searchEmbed.trigger(HostEvent.DownloadAsPng)
1942
+ * ```
1943
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
1944
+ */
1945
+ HostEvent["DownloadAsPng"] = "downloadAsPng";
1946
+ /**
1947
+ * Trigger the **Download** > **CSV** action on tables in
1948
+ * the embedded view.
1949
+ * @example
1950
+ * ```js
1951
+ * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
1952
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1953
+ * ```
1954
+ * ```js
1955
+ * vizEmbed.trigger(HostEvent.DownloadAsCsv)
1956
+ * ```
1957
+ * ```js
1958
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv)
1959
+ * ```
1960
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1961
+ */
1962
+ HostEvent["DownloadAsCsv"] = "downloadAsCSV";
1963
+ /**
1964
+ * Trigger the **Download** > **XLSX** action on tables
1965
+ * in the embedded view.
1966
+ * @example
1967
+ * ```js
1968
+ * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
1969
+ * '730496d6-6903-4601-937e-2c691821af3c'})
1970
+ * ```
1971
+ * ```js
1972
+ * vizEmbed.trigger(HostEvent.DownloadAsXlsx)
1973
+ * ```
1974
+ * ```js
1975
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
1976
+ * ```
1977
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1978
+ */
1979
+ HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
1980
+ /**
1981
+ * Trigger the **Share** action on an embedded
1982
+ * Liveboard or Answer.
1983
+ * @example
1984
+ * ```js
1985
+ * liveboardEmbed.trigger(HostEvent.Share)
1986
+ * ```
1987
+ * ```js
1988
+ * searchEmbed.trigger(HostEvent.Share)
1989
+ * ```
1990
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
1991
+ */
1992
+ HostEvent["Share"] = "share";
1993
+ /**
1994
+ * Trigger the **Save** action on a Liveboard or Answer.
1995
+ * Saves the changes.
1996
+ * @example
1997
+ * ```js
1998
+ * liveboardEmbed.trigger(HostEvent.Save)
1999
+ * ```
2000
+ * ```js
2001
+ * searchEmbed.trigger(HostEvent.Save)
2002
+ * ```
2003
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2004
+ */
2005
+ HostEvent["Save"] = "save";
2006
+ /**
2007
+ * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
2008
+ * Sends data from an Answer or Liveboard visualization to a Google sheet.
2009
+ * @param - an object with `vizId` as a key
2010
+ * @example
2011
+ * ```js
2012
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId:
2013
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2014
+ * ```
2015
+ * ```js
2016
+ * vizEmbed.trigger(HostEvent.SyncToSheets)
2017
+ * ```
2018
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2019
+ */
2020
+ HostEvent["SyncToSheets"] = "sync-to-sheets";
2021
+ /**
2022
+ * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
2023
+ * Sends data from an Answer or Liveboard visualization to third-party apps such
2024
+ * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
2025
+ * @param - an object with vizId as a key
2026
+ * @example
2027
+ * ```js
2028
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId:
2029
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2030
+ * ```
2031
+ * ```js
2032
+ * vizEmbed.trigger(HostEvent.SyncToOtherApps)
2033
+ * ```
2034
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2035
+ */
2036
+ HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
2037
+ /**
2038
+ * Trigger the **Manage pipelines** action on an embedded
2039
+ * visualization or Answer.
2040
+ * Allows users to manage ThoughtSpot Sync pipelines.
2041
+ * @param - an object with `vizId` as a key
2042
+ * @example
2043
+ * ```js
2044
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId:
2045
+ * '730496d6-6903-4601-937e-2c691821af3c'})
2046
+ * ```
2047
+ * ```js
2048
+ * vizEmbed.trigger(HostEvent.ManagePipelines)
2049
+ * ```
2050
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2051
+ */
2052
+ HostEvent["ManagePipelines"] = "manage-pipeline";
2053
+ /**
2054
+ * Reset search operation on the Search or Answer page.
2055
+ * @example
2056
+ * ```js
2057
+ * searchEmbed.trigger(HostEvent.ResetSearch)
2058
+ * ```
2059
+ * ```js
2060
+ * appEmbed.trigger(HostEvent.ResetSearch)
2061
+ * ```
2062
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
2063
+ */
2064
+ HostEvent["ResetSearch"] = "resetSearch";
2065
+ /**
2066
+ * Get details of filters applied on the Liveboard.
2067
+ * Returns arrays containing Liveboard filter and runtime filter elements.
2068
+ * @example
2069
+ * ```js
2070
+ * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
2071
+ * console.log('data', data);
2072
+ * ```
2073
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2074
+ */
2075
+ HostEvent["GetFilters"] = "getFilters";
2076
+ /**
2077
+ * Update one or several filters applied on a Liveboard.
2078
+ * @param - `filter`: a single filter object containing column name,
2079
+ * filter operator, and values.
2080
+ * @param - `filters`: multiple filter objects with column name, filter operator,
2081
+ * and values for each.
2082
+ *
2083
+ * Each filter object must include the following attributes:
2084
+ *
2085
+ * `column` - Name of the column to filter on.
2086
+ *
2087
+ * `oper` - Filter operator, for example, EQ, IN, CONTAINS.
2088
+ * For information about the supported filter operators,
2089
+ * see link:https://developers.thoughtspot.com/docs/runtime-filters#rtOperator[Developer Documentation].
2090
+ *
2091
+ * `values` - An array of one or several values. The value definition on the
2092
+ * data type you choose to filter on. For a complete list of supported data types,
2093
+ * see
2094
+ * link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported
2095
+ * data types].
2096
+ *
2097
+ * `type` - To update filters for date time, specify the date format type.
2098
+ * For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
2099
+ * @example
2100
+ * ```js
2101
+ *
2102
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2103
+ * filter: {
2104
+ * column: "item type",
2105
+ * oper: "IN",
2106
+ * values: ["bags","shirts"]
2107
+ * }
2108
+ * });
2109
+ * ```
2110
+ * @example
2111
+ * ```js
2112
+ *
2113
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2114
+ * filter: {
2115
+ * column: "date",
2116
+ * oper: "EQ",
2117
+ * values: ["JULY","2023"],
2118
+ * type: "MONTH_YEAR"
2119
+ * }
2120
+ * });
2121
+ * ```
2122
+ * @example
2123
+ *
2124
+ * ```js
2125
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2126
+ * filters: [{
2127
+ * column: "Item Type",
2128
+ * oper: 'IN',
2129
+ * values: ["bags","shirts"]
2130
+ * },
2131
+ * {
2132
+ * column: "Region",
2133
+ * oper: 'IN',
2134
+ * values: ["West","Midwest"]
2135
+ * },
2136
+ * {
2137
+ * column: "Date",
2138
+ * oper: 'EQ',
2139
+ * values: ["2023-07-31"],
2140
+ * types: "EXACT_DATE"
2141
+ * }]
2142
+ * });
2143
+ * ```
2144
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2145
+ */
2146
+ HostEvent["UpdateFilters"] = "updateFilters";
2147
+ /**
2148
+ * Get tab details for the current Liveboard.
2149
+ * @example
2150
+ * ```js
2151
+ * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
2152
+ * console.log(
2153
+ * tabDetails // TabDetails of current LB
2154
+ * );
2155
+ * })
2156
+ * ```
2157
+ * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
2158
+ */
2159
+ HostEvent["GetTabs"] = "getTabs";
2160
+ /**
2161
+ * Set the visible tabs on a Liveboard.
2162
+ * @param - an array of ids of tabs to show, the IDs not passed
2163
+ * will be hidden.
2164
+ * @example
2165
+ * ```js
2166
+ * liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
2167
+ * '430496d6-6903-4601-937e-2c691821af3c',
2168
+ * 'f547ec54-2a37-4516-a222-2b06719af726'])
2169
+ * ```
2170
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2171
+ */
2172
+ HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
2173
+ /**
2174
+ * Set the hidden tabs on a Liveboard.
2175
+ * @param - an array of the IDs of the tabs to hide.
2176
+ * The IDs not passed will be shown.
2177
+ * @example
2178
+ * ```js
2179
+ * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
2180
+ * '630496d6-6903-4601-937e-2c691821af3c',
2181
+ * 'i547ec54-2a37-4516-a222-2b06719af726'])
2182
+ * ```
2183
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
2184
+ */
2185
+ HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
2186
+ /**
2187
+ * Updates the search query string for Natural Language Search operations.
2188
+ * @param - `queryString`: Text string in Natural Language format
2189
+ * @param - `executeSearch`: Boolean to execute search and update search query
2190
+ * @example
2191
+ * ```js
2192
+ * sageEmbed.trigger(HostEvent.UpdateSageQuery, {
2193
+ * queryString: 'revenue per year',
2194
+ * executeSearch: true,
2195
+ * })
2196
+ * ```
2197
+ * @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
2198
+ */
2199
+ HostEvent["UpdateSageQuery"] = "updateSageQuery";
2200
+ /**
2201
+ * Get the answer session for a Search or
2202
+ * Liveboard visualization.
2203
+ * @example
2204
+ * ```js
2205
+ * const {session} = await embed.trigger(
2206
+ * HostEvent.GetAnswerSession, {
2207
+ * vizId: '123', // For Liveboard Visualization.
2208
+ * })
2209
+ * ```
2210
+ * @example
2211
+ * ```js
2212
+ * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
2213
+ * ```
2214
+ * @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
2215
+ */
2216
+ HostEvent["GetAnswerSession"] = "getAnswerSession";
2217
+ /**
2218
+ * Trigger Ask Sage for viz
2219
+ * @example
2220
+ * ```js
2221
+ * liveboardEmbed.trigger(HostEvent.AskSage,
2222
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
2223
+ * ```
2224
+ * @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
2225
+ */
2226
+ HostEvent["AskSage"] = "AskSage";
2227
+ /**
2228
+ * Trigger cross filter update action on a Liveboard
2229
+ * @example
2230
+ * ```js
2231
+ * liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
2232
+ * vizId: 'b535c760-8bbe-4e6f-bb26-af56b4129a1e',
2233
+ * conditions: [
2234
+ * { columnName: 'Category', values: ['mfgr#12','mfgr#14'] },
2235
+ * { columnName: 'color', values: ['mint','hot'] },
2236
+ * ],
2237
+ * });
2238
+ * ```
2239
+ * @version SDK: 1.29.0 | Thoughtspot: 10.0.0.cl
2240
+ */
2241
+ HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
2242
+ /**
2243
+ * Trigger reset action for a personalized Liveboard view.
2244
+ * @example
2245
+ * ```js
2246
+ * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
2247
+ * ```
2248
+ * @version SDK: 1.29.0 | Thoughtspot: 10.1.0.cl
2249
+ */
2250
+ HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2251
+ /**
2252
+ * Triggers Update RuntimeParameters for answers and liveboard
2253
+ * @example
2254
+ * ```js
2255
+ * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
2256
+ * name: "Color",
2257
+ * value: "almond"
2258
+ * }])
2259
+ *
2260
+ * @version SDK: 1.29.0 | Thoughtspot: 10.1.0.cl
2261
+ */
2262
+ HostEvent["UpdateParameters"] = "UpdateParameters";
2263
+ /**
2264
+ * Triggers GetParameters to fetch the runtime parameters
2265
+ * ```js
2266
+ * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
2267
+ * console.log('parameters', parameter);
2268
+ * });
2269
+ *```
2270
+ * @version SDK: 1.29.0 | Thoughtspot: 10.1.0.cl
2271
+ */
2272
+ HostEvent["GetParameters"] = "GetParameters";
2273
+ /**
2274
+ * Triggers update of persoanlised view for a liveboard
2275
+ * ```js
2276
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
2277
+ * ```
2278
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2279
+ */
2280
+ HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
2281
+ })(HostEvent || (HostEvent = {}));
2282
+ /**
2283
+ * The different visual modes that the data sources panel within
2284
+ * search could appear in, such as hidden, collapsed, or expanded.
2285
+ */
2286
+ // eslint-disable-next-line no-shadow
2287
+ var DataSourceVisualMode;
2288
+ (function (DataSourceVisualMode) {
2289
+ /**
2290
+ * The data source panel is hidden.
2291
+ */
2292
+ DataSourceVisualMode["Hidden"] = "hide";
2293
+ /**
2294
+ * The data source panel is collapsed, but the user can manually expand it.
2295
+ */
2296
+ DataSourceVisualMode["Collapsed"] = "collapse";
2297
+ /**
2298
+ * The data source panel is expanded, but the user can manually collapse it.
2299
+ */
2300
+ DataSourceVisualMode["Expanded"] = "expand";
2301
+ })(DataSourceVisualMode || (DataSourceVisualMode = {}));
2302
+ /**
2303
+ * The query params passed down to the embedded ThoughtSpot app
2304
+ * containing configuration and/or visual information.
2305
+ */
2306
+ // eslint-disable-next-line no-shadow
2307
+ var Param;
2308
+ (function (Param) {
2309
+ Param["EmbedApp"] = "embedApp";
2310
+ Param["DataSources"] = "dataSources";
2311
+ Param["DataSourceMode"] = "dataSourceMode";
2312
+ Param["DisableActions"] = "disableAction";
2313
+ Param["DisableActionReason"] = "disableHint";
2314
+ Param["ForceTable"] = "forceTable";
2315
+ Param["preventLiveboardFilterRemoval"] = "preventPinboardFilterRemoval";
2316
+ Param["SearchQuery"] = "searchQuery";
2317
+ Param["HideActions"] = "hideAction";
2318
+ Param["HideObjects"] = "hideObjects";
2319
+ Param["HostAppUrl"] = "hostAppUrl";
2320
+ Param["EnableVizTransformations"] = "enableVizTransform";
2321
+ Param["EnableSearchAssist"] = "enableSearchAssist";
2322
+ Param["HideResult"] = "hideResult";
2323
+ Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
2324
+ Param["Tag"] = "tag";
2325
+ Param["searchTokenString"] = "searchTokenString";
2326
+ Param["executeSearch"] = "executeSearch";
2327
+ Param["fullHeight"] = "isFullHeightPinboard";
2328
+ Param["livedBoardEmbed"] = "isLiveboardEmbed";
2329
+ Param["searchEmbed"] = "isSearchEmbed";
2330
+ Param["vizEmbed"] = "isVizEmbed";
2331
+ Param["Version"] = "sdkVersion";
2332
+ Param["ViewPortHeight"] = "viewPortHeight";
2333
+ Param["ViewPortWidth"] = "viewPortWidth";
2334
+ Param["VisibleActions"] = "visibleAction";
2335
+ Param["DisableLoginRedirect"] = "disableLoginRedirect";
2336
+ Param["visibleVizs"] = "pinboardVisibleVizs";
2337
+ Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
2338
+ Param["DataPanelV2Enabled"] = "enableDataPanelV2";
2339
+ Param["ShowAlerts"] = "showAlerts";
2340
+ Param["Locale"] = "locale";
2341
+ Param["CustomStyle"] = "customStyle";
2342
+ Param["ForceSAMLAutoRedirect"] = "forceSAMLAutoRedirect";
2343
+ // eslint-disable-next-line @typescript-eslint/no-shadow
2344
+ Param["AuthType"] = "authType";
2345
+ Param["IconSpriteUrl"] = "iconSprite";
2346
+ Param["cookieless"] = "cookieless";
2347
+ Param["ContextMenuTrigger"] = "isContextMenuEnabledOnLeftClick";
2348
+ Param["LinkOverride"] = "linkOverride";
2349
+ Param["blockNonEmbedFullAppAccess"] = "blockNonEmbedFullAppAccess";
2350
+ Param["ShowInsertToSlide"] = "insertInToSlide";
2351
+ Param["PrimaryNavHidden"] = "primaryNavHidden";
2352
+ Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
2353
+ Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
2354
+ Param["HideOrgSwitcher"] = "orgSwitcherHidden";
2355
+ Param["IsSageEmbed"] = "isSageEmbed";
2356
+ Param["HideWorksheetSelector"] = "hideWorksheetSelector";
2357
+ Param["DisableWorksheetChange"] = "disableWorksheetChange";
2358
+ Param["HideSourceSelection"] = "hideSourceSelection";
2359
+ Param["DisableSourceSelection"] = "disableSourceSelection";
2360
+ Param["HideEurekaResults"] = "hideEurekaResults";
2361
+ Param["HideEurekaSuggestions"] = "hideEurekaSuggestions";
2362
+ Param["HideAutocompleteSuggestions"] = "hideAutocompleteSuggestions";
2363
+ Param["HideLiveboardHeader"] = "hideLiveboardHeader";
2364
+ Param["ShowLiveboardDescription"] = "showLiveboardDescription";
2365
+ Param["ShowLiveboardTitle"] = "showLiveboardTitle";
2366
+ Param["HiddenTabs"] = "hideTabs";
2367
+ Param["VisibleTabs"] = "visibleTabs";
2368
+ Param["HideTabPanel"] = "hideTabPanel";
2369
+ Param["HideSampleQuestions"] = "hideSampleQuestions";
2370
+ Param["WorksheetId"] = "worksheet";
2371
+ Param["Query"] = "query";
2372
+ Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
2373
+ Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
2374
+ Param["PendoTrackingKey"] = "additionalPendoKey";
2375
+ Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
2376
+ Param["IsProductTour"] = "isProductTour";
2377
+ Param["HideSearchBarTitle"] = "hideSearchBarTitle";
2378
+ Param["HideSageAnswerHeader"] = "hideSageAnswerHeader";
2379
+ Param["HideSearchBar"] = "hideSearchBar";
2380
+ Param["ClientLogLevel"] = "clientLogLevel";
2381
+ Param["OverrideNativeConsole"] = "overrideConsoleLogs";
2382
+ Param["enableAskSage"] = "enableAskSage";
2383
+ Param["CollapseSearchBarInitially"] = "collapseSearchBarInitially";
2384
+ Param["DataPanelCustomGroupsAccordionInitialState"] = "dataPanelCustomGroupsAccordionInitialState";
2385
+ Param["EnableCustomColumnGroups"] = "enableCustomColumnGroups";
2386
+ Param["DateFormatLocale"] = "dateFormatLocale";
2387
+ Param["NumberFormatLocale"] = "numberFormatLocale";
2388
+ Param["CurrencyFormat"] = "currencyFormat";
2389
+ Param["Enable2ColumnLayout"] = "enable2ColumnLayout";
2390
+ Param["IsFullAppEmbed"] = "isFullAppEmbed";
2391
+ Param["IsOnBeforeGetVizDataInterceptEnabled"] = "isOnBeforeGetVizDataInterceptEnabled";
2392
+ Param["FocusSearchBarOnRender"] = "focusSearchBarOnRender";
2393
+ Param["DisableRedirectionLinksInNewTab"] = "disableRedirectionLinksInNewTab";
2394
+ Param["HomePageSearchBarMode"] = "homePageSearchBarMode";
2395
+ Param["ShowLiveboardVerifiedBadge"] = "showLiveboardVerifiedBadge";
2396
+ Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
2397
+ Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
2398
+ Param["HideIrrelevantFiltersInTab"] = "hideIrrelevantFiltersAtTabLevel";
2399
+ Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
2400
+ Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
2401
+ Param["OverrideOrgId"] = "orgId";
2402
+ Param["EnableFlipTooltipToContextMenu"] = "flipTooltipToContextMenuEnabled";
2403
+ Param["OauthPollingInterval"] = "oAuthPollingInterval";
2404
+ Param["IsForceRedirect"] = "isForceRedirect";
2405
+ Param["DataSourceId"] = "dataSourceId";
2406
+ })(Param || (Param = {}));
2407
+ /**
2408
+ * ThoughtSpot application pages include actions and menu commands
2409
+ * for various user-initiated operations. These actions are represented
2410
+ * as enumeration members in the SDK. To show, hide, or disable
2411
+ * specific actions in the embedded view, define the Action
2412
+ * enumeration members in the `disabledActions`, `visibleActions`,
2413
+ * or `hiddenActions` array.
2414
+ * @example
2415
+ * ```js
2416
+ * const embed = new LiveboardEmbed('#embed-container', {
2417
+ * ... // other options
2418
+ * visibleActions: [Action.Save, Action.Edit, Action.Present, ActionAction.Explore],
2419
+ * disabledActions: [Action.Download],
2420
+ * //hiddenActions: [], // Set either this or visibleActions
2421
+ * })
2422
+ * ```
2423
+ * @example
2424
+ * ```js
2425
+ * const embed = new LiveboardEmbed('#embed-container', {
2426
+ * ... // other options
2427
+ * //visibleActions: [],
2428
+ * disabledActions: [Action.Download],
2429
+ * hiddenActions: [Action.Edit, ActionAction.Explore],
2430
+ * })
2431
+ * ```
2432
+ */
2433
+ // eslint-disable-next-line no-shadow
2434
+ var Action;
2435
+ (function (Action) {
2436
+ /**
2437
+ * The **Save** action on an Answer or Liveboard.
2438
+ * Allows users to save the changes.
2439
+ * @example
2440
+ * ```js
2441
+ * disabledActions: [Action.Save]
2442
+ * ```
2443
+ */
2444
+ Action["Save"] = "save";
2445
+ /**
2446
+ * @hidden
2447
+ */
2448
+ Action["Update"] = "update";
2449
+ /**
2450
+ * @hidden
2451
+ */
2452
+ Action["SaveUntitled"] = "saveUntitled";
2453
+ /**
2454
+ * The **Save as View** action on the Answer
2455
+ * page. Saves an Answer as a View object in the full
2456
+ * application embedding mode.
2457
+ * @example
2458
+ * ```js
2459
+ * disabledActions: [Action.SaveAsView]
2460
+ * ```
2461
+ */
2462
+ Action["SaveAsView"] = "saveAsView";
2463
+ /**
2464
+ * The **Make a copy** action on a Liveboard or Answer
2465
+ * page. Creates a copy of the Liveboard.
2466
+ * In LiveboardEmbed, the **Make a copy** action is not available for
2467
+ * visualizations in the embedded Liveboard view.
2468
+ * In AppEmbed, the **Make a copy** action is available on both
2469
+ * Liveboards and visualizations.
2470
+ * @example
2471
+ * ```js
2472
+ * disabledActions: [Action.MakeACopy]
2473
+ * ```
2474
+ */
2475
+ Action["MakeACopy"] = "makeACopy";
2476
+ /**
2477
+ * The **Copy and Edit** action on a Liveboard.
2478
+ * This action is now replaced with `Action.MakeACopy`.
2479
+ * @example
2480
+ * ```js
2481
+ * disabledActions: [Action.EditACopy]
2482
+ * ```
2483
+ */
2484
+ Action["EditACopy"] = "editACopy";
2485
+ /**
2486
+ * The **Copy link** menu action on a Liveboard visualization.
2487
+ * Copies the visualization URL
2488
+ * @example
2489
+ * ```js
2490
+ * disabledActions: [Action.CopyLink]
2491
+ * ```
2492
+ */
2493
+ Action["CopyLink"] = "embedDocument";
2494
+ /**
2495
+ * @hidden
2496
+ */
2497
+ Action["ResetLayout"] = "resetLayout";
2498
+ /**
2499
+ * The **Schedule** menu action on a Liveboard.
2500
+ * Allows scheduling a Liveboard notification.
2501
+ * @example
2502
+ * ```js
2503
+ * disabledActions: [Action.Schedule]
2504
+ * ```
2505
+ */
2506
+ Action["Schedule"] = "subscription";
2507
+ /**
2508
+ * The **Manage schedules** menu action on a Liveboard.
2509
+ * Allows users to manage scheduled Liveboard jobs.
2510
+ * @example
2511
+ * ```js
2512
+ * disabledActions: [Action.SchedulesList]
2513
+ * ```
2514
+ */
2515
+ Action["SchedulesList"] = "schedule-list";
2516
+ /**
2517
+ * The **Share** action on a Liveboard, Answer, or Worksheet.
2518
+ * Allows users to share an object with other users and groups.
2519
+ * @example
2520
+ * ```js
2521
+ * disabledActions: [Action.Share]
2522
+ * ```
2523
+ */
2524
+ Action["Share"] = "share";
2525
+ /**
2526
+ * The **Add filter** action on a Liveboard page.
2527
+ * Allows adding filters to visualizations on a Liveboard.
2528
+ * @example
2529
+ * ```js
2530
+ * disabledActions: [Action.AddFilter]
2531
+ * ```
2532
+ */
2533
+ Action["AddFilter"] = "addFilter";
2534
+ /**
2535
+ * The **Add Data Panel Objects** action on the data panel v2.
2536
+ * Allows to show action menu to add different objects (such as
2537
+ * formulas, Parameters) in data panel new experience.
2538
+ * @example
2539
+ * ```js
2540
+ * disabledActions: [Action.AddDataPanelObjects]
2541
+ * ```
2542
+ * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
2543
+ */
2544
+ Action["AddDataPanelObjects"] = "addDataPanelObjects";
2545
+ /**
2546
+ * Filter configuration options on a Liveboard page.
2547
+ * Allows configuring filters on a
2548
+ * Liveboard.
2549
+ * @example
2550
+ * ```js
2551
+ * disabledActions: [Action.ConfigureFilter]
2552
+ * ```
2553
+ */
2554
+ Action["ConfigureFilter"] = "configureFilter";
2555
+ Action["CollapseDataSources"] = "collapseDataSources";
2556
+ Action["CollapseDataPanel"] = "collapseDataPanel";
2557
+ /**
2558
+ * The **Choose sources** button on Search page.
2559
+ * Allows selecting data sources for search queries.
2560
+ * @example
2561
+ * ```js
2562
+ * disabledActions: [Action.ChooseDataSources]
2563
+ * ```
2564
+ */
2565
+ Action["ChooseDataSources"] = "chooseDataSources";
2566
+ /**
2567
+ * The **Create formula** action on a Search or Answer page.
2568
+ * Allows adding formulas to an Answer.
2569
+ * @example
2570
+ * ```js
2571
+ * disabledActions: [Action.AddFormula]
2572
+ * ```
2573
+ */
2574
+ Action["AddFormula"] = "addFormula";
2575
+ /**
2576
+ * The **Add parameter** action on a Liveboard or Answer.
2577
+ * Allows adding Parameters to a Liveboard or Answer.
2578
+ * @example
2579
+ * ```js
2580
+ * disabledActions: [Action.AddParameter]
2581
+ * ```
2582
+ */
2583
+ Action["AddParameter"] = "addParameter";
2584
+ /**
2585
+ * The **Add Column Set** action on a Answer.
2586
+ * Allows adding column sets to a Answer.
2587
+ * @example
2588
+ * ```js
2589
+ * disabledActions: [Action.AddColumnSet]
2590
+ * ```
2591
+ * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
2592
+ */
2593
+ Action["AddColumnSet"] = "addSimpleCohort";
2594
+ /**
2595
+ * The **Add Query Set** action on a Answer.
2596
+ * Allows adding query sets to a Answer.
2597
+ * @example
2598
+ * ```js
2599
+ * disabledActions: [Action.AddQuerySet]
2600
+ * ```
2601
+ * @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
2602
+ */
2603
+ Action["AddQuerySet"] = "addAdvancedCohort";
2604
+ /**
2605
+ * @hidden
2606
+ */
2607
+ Action["SearchOnTop"] = "searchOnTop";
2608
+ /**
2609
+ * The **SpotIQ analyze** menu action on a visualization or
2610
+ * Answer page.
2611
+ * @example
2612
+ * ```js
2613
+ * disabledActions: [Action.SpotIQAnalyze]
2614
+ * ```
2615
+ */
2616
+ Action["SpotIQAnalyze"] = "spotIQAnalyze";
2617
+ /**
2618
+ * @hidden
2619
+ */
2620
+ Action["ExplainInsight"] = "explainInsight";
2621
+ /**
2622
+ * @hidden
2623
+ */
2624
+ Action["SpotIQFollow"] = "spotIQFollow";
2625
+ Action["ShareViz"] = "shareViz";
2626
+ /**
2627
+ * @hidden
2628
+ */
2629
+ Action["ReplaySearch"] = "replaySearch";
2630
+ /**
2631
+ * The **Show underlying data** menu action on a visualization or
2632
+ * Answer page.
2633
+ * @example
2634
+ * ```js
2635
+ * disabledActions: [Action.ShowUnderlyingData]
2636
+ * ```
2637
+ */
2638
+ Action["ShowUnderlyingData"] = "showUnderlyingData";
2639
+ /**
2640
+ * The **Download** menu action on Liveboard visualizations
2641
+ * and Answers.
2642
+ * Allows downloading a visualization or Answer.
2643
+ * @example
2644
+ * ```js
2645
+ * disabledActions: [Action.DownloadAsPng]
2646
+ * ```
2647
+ */
2648
+ Action["Download"] = "download";
2649
+ /**
2650
+ * The **Download** > **PNG** menu action for charts on a Liveboard
2651
+ * or Answer page.
2652
+ * Downloads a visualization or Answer as a PNG file.
2653
+ * @example
2654
+ * ```js
2655
+ * disabledActions: [Action.DownloadAsPng]
2656
+ * ```
2657
+ */
2658
+ Action["DownloadAsPng"] = "downloadAsPng";
2659
+ /**
2660
+ *
2661
+ *The **Download PDF** action that downloads a Liveboard,
2662
+ *visualization, or Answer as a PDF file.
2663
+ *
2664
+ *
2665
+ ***NOTE**: The **Download** > **PDF** action is available on
2666
+ *visualizations and Answers if the data is in tabular format.
2667
+ * @example
2668
+ * ```js
2669
+ * disabledActions: [Action.DownloadAsPdf]
2670
+ * ```
2671
+ */
2672
+ Action["DownloadAsPdf"] = "downloadAsPdf";
2673
+ /**
2674
+ * The **Download** > **CSV** menu action for tables on a Liveboard
2675
+ * or Answer page.
2676
+ * Downloads a visualization or Answer in the XLSX format.
2677
+ * @example
2678
+ * ```js
2679
+ * disabledActions: [Action.DownloadAsCsv]
2680
+ * ```
2681
+ */
2682
+ Action["DownloadAsCsv"] = "downloadAsCSV";
2683
+ /**
2684
+ * The **Download** > **XLSX** menu action for tables on a Liveboard
2685
+ * or Answer page.
2686
+ * Downloads a visualization or Answer in the XLSX format.
2687
+ * @example
2688
+ * ```js
2689
+ * disabledActions: [Action.DownloadAsXlsx]
2690
+ * ```
2691
+ */
2692
+ Action["DownloadAsXlsx"] = "downloadAsXLSX";
2693
+ /**
2694
+ * @hidden
2695
+ */
2696
+ Action["DownloadTrace"] = "downloadTrace";
2697
+ /**
2698
+ * The **Export TML** menu action on Liveboard, Answers
2699
+ * Worksheets and Data Connections page.
2700
+ * Exports an object as a TML file.
2701
+ * @example
2702
+ * ```js
2703
+ * disabledActions: [Action.ExportTML]
2704
+ * ```
2705
+ */
2706
+ Action["ExportTML"] = "exportTSL";
2707
+ /**
2708
+ * The **Import TML** menu action for Liveboards and Answers.
2709
+ * Imports TML representation of ThoughtSpot objects.
2710
+ * @example
2711
+ * ```js
2712
+ * disabledActions: [Action.ImportTML]
2713
+ * ```
2714
+ */
2715
+ Action["ImportTML"] = "importTSL";
2716
+ /**
2717
+ * The **Update TML** menu action for Liveboards and Answers.
2718
+ * Update TML representation of ThoughtSpot objects.
2719
+ * @example
2720
+ * ```js
2721
+ * disabledActions: [Action.UpdateTML]
2722
+ * ```
2723
+ */
2724
+ Action["UpdateTML"] = "updateTSL";
2725
+ /**
2726
+ * The **Edit TML** menu action for Liveboards and Answers.
2727
+ * Opens the TML editor.
2728
+ * @example
2729
+ * ```js
2730
+ * disabledActions: [Action.EditTML]
2731
+ * ```
2732
+ */
2733
+ Action["EditTML"] = "editTSL";
2734
+ /**
2735
+ * The **Present** menu action for Liveboards and Answers.
2736
+ * Allows presenting a Liveboard or visualization in
2737
+ * slideshow mode.
2738
+ * @example
2739
+ * ```js
2740
+ * disabledActions: [Action.Present]
2741
+ * ```
2742
+ */
2743
+ Action["Present"] = "present";
2744
+ /**
2745
+ * The tile resize options in the visualization menu.
2746
+ * Allows switching between different preset layouts.
2747
+ * @example
2748
+ * ```js
2749
+ * disabledActions: [Action.ToggleSize]
2750
+ * ```
2751
+ */
2752
+ Action["ToggleSize"] = "toggleSize";
2753
+ /**
2754
+ * The *Edit* action on the Liveboard page and in the
2755
+ * visualization menu.
2756
+ * Opens a Liveboard or visualization in edit mode.
2757
+ * @example
2758
+ * ```js
2759
+ * disabledActions: [Action.Edit]
2760
+ * ```
2761
+ */
2762
+ Action["Edit"] = "edit";
2763
+ /**
2764
+ * The text edit option for Liveboard and visualization titles.
2765
+ * @example
2766
+ * ```js
2767
+ * disabledActions: [Action.EditTitle]
2768
+ * ```
2769
+ */
2770
+ Action["EditTitle"] = "editTitle";
2771
+ /**
2772
+ * The **Delete** menu action on Liveboards and visualizations.
2773
+ * Deletes a Liveboard or a visualization from a Liveboard.
2774
+ * @example
2775
+ * ```js
2776
+ * disabledActions: [Action.Remove]
2777
+ * ```
2778
+ */
2779
+ Action["Remove"] = "delete";
2780
+ /**
2781
+ * @hidden
2782
+ */
2783
+ Action["Ungroup"] = "ungroup";
2784
+ /**
2785
+ * @hidden
2786
+ */
2787
+ Action["Describe"] = "describe";
2788
+ /**
2789
+ * @hidden
2790
+ */
2791
+ Action["Relate"] = "relate";
2792
+ /**
2793
+ * @hidden
2794
+ */
2795
+ Action["CustomizeHeadlines"] = "customizeHeadlines";
2796
+ /**
2797
+ * @hidden
2798
+ */
2799
+ Action["PinboardInfo"] = "pinboardInfo";
2800
+ /**
2801
+ * The **Show Liveboard details** menu action on a Liveboard.
2802
+ * Displays details such as the name, description, and
2803
+ * author of the Liveboard, and timestamp of Liveboard creation
2804
+ * and update.
2805
+ * @example
2806
+ * ```js
2807
+ * disabledActions: [Action.LiveboardInfo]
2808
+ * ```
2809
+ */
2810
+ Action["LiveboardInfo"] = "pinboardInfo";
2811
+ /**
2812
+ * @hidden
2813
+ */
2814
+ Action["SendAnswerFeedback"] = "sendFeedback";
2815
+ /**
2816
+ * @hidden
2817
+ */
2818
+ Action["DownloadEmbraceQueries"] = "downloadEmbraceQueries";
2819
+ /**
2820
+ * The **Pin** menu action on an Answer or
2821
+ * Search results page.
2822
+ * @example
2823
+ * ```js
2824
+ * disabledActions: [Action.Pin]
2825
+ * ```
2826
+ */
2827
+ Action["Pin"] = "pin";
2828
+ /**
2829
+ * @hidden
2830
+ */
2831
+ Action["AnalysisInfo"] = "analysisInfo";
2832
+ /**
2833
+ * The **Schedule** menu action on a Liveboard.
2834
+ * @example
2835
+ * ```js
2836
+ * disabledActions: [Action.Subscription]
2837
+ * ```
2838
+ */
2839
+ Action["Subscription"] = "subscription";
2840
+ /**
2841
+ * The **Explore** action on Liveboard visualizations
2842
+ * @example
2843
+ * ```js
2844
+ * disabledActions: [Action.Explore]
2845
+ * ```
2846
+ */
2847
+ Action["Explore"] = "explore";
2848
+ /**
2849
+ * The action to include data points on a drilled-down Answer
2850
+ * or visualization
2851
+ * @example
2852
+ * ```js
2853
+ * disabledActions: [Action.DrillInclude]
2854
+ * ```
2855
+ */
2856
+ Action["DrillInclude"] = "context-menu-item-include";
2857
+ /**
2858
+ * The action to exclude data points on a drilled-down Answer
2859
+ * or visualization
2860
+ * @example
2861
+ * ```js
2862
+ * disabledActions: [Action.DrillInclude]
2863
+ * ```
2864
+ */
2865
+ Action["DrillExclude"] = "context-menu-item-exclude";
2866
+ /**
2867
+ * The **Copy to clipboard** menu action on tables in an Answer
2868
+ * or Liveboard.
2869
+ * Copies the selected data point.
2870
+ * @example
2871
+ * ```js
2872
+ * disabledActions: [Action.CopyToClipboard]
2873
+ * ```
2874
+ */
2875
+ Action["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
2876
+ Action["CopyAndEdit"] = "context-menu-item-copy-and-edit";
2877
+ /**
2878
+ * @hidden
2879
+ */
2880
+ Action["DrillEdit"] = "context-menu-item-edit";
2881
+ Action["EditMeasure"] = "context-menu-item-edit-measure";
2882
+ Action["Separator"] = "context-menu-item-separator";
2883
+ /**
2884
+ * The **Drill down** menu action on Answers and Liveboard
2885
+ * visualizations.
2886
+ * Allows drilling down to a specific data point on a chart or table.
2887
+ * @example
2888
+ * ```js
2889
+ * disabledActions: [Action.DrillDown]
2890
+ * ```
2891
+ */
2892
+ Action["DrillDown"] = "DRILL";
2893
+ /**
2894
+ * The request access action on Liveboards.
2895
+ * Allows users with view permissions to request edit access to a Liveboard.
2896
+ * @example
2897
+ * ```js
2898
+ * disabledActions: [Action.RequestAccess]
2899
+ * ```
2900
+ */
2901
+ Action["RequestAccess"] = "requestAccess";
2902
+ /**
2903
+ * The **Query visualizer** and **Query SQL** buttons in Query details panel
2904
+ * of the Answer page
2905
+ * @example
2906
+ * ```js
2907
+ * disabledActions: [Action.QueryDetailsButtons]
2908
+ * ```
2909
+ */
2910
+ Action["QueryDetailsButtons"] = "queryDetailsButtons";
2911
+ /**
2912
+ * The **Delete** action for Answers in the full application
2913
+ * embedding mode.
2914
+ * @example
2915
+ * ```js
2916
+ * disabledActions: [Action.AnswerDelete]
2917
+ * ```
2918
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
2919
+ */
2920
+ Action["AnswerDelete"] = "onDeleteAnswer";
2921
+ /**
2922
+ * The Chart switcher icon on Answer and visualization pages.
2923
+ * @example
2924
+ * ```js
2925
+ * disabledActions: [Action.AnswerChartSwitcher]
2926
+ * ```
2927
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
2928
+ */
2929
+ Action["AnswerChartSwitcher"] = "answerChartSwitcher";
2930
+ /**
2931
+ * Favorites icon (*) on Answers, Liveboard, and Data pages
2932
+ * @example
2933
+ * ```js
2934
+ * disabledActions: [Action.AddToFavorites]
2935
+ * ```
2936
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
2937
+ */
2938
+ Action["AddToFavorites"] = "addToFavorites";
2939
+ /**
2940
+ * The edit icon on Liveboards (Classic experience).
2941
+ * @example
2942
+ * ```js
2943
+ * disabledActions: [Action.EditDetails]
2944
+ * ```
2945
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
2946
+ */
2947
+ Action["EditDetails"] = "editDetails";
2948
+ /**
2949
+ * The Create alert action on KPI charts.
2950
+ * @example
2951
+ * ```js
2952
+ * disabledActions: [Action.CreateMonitor]
2953
+ * ```
2954
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
2955
+ */
2956
+ Action["CreateMonitor"] = "createMonitor";
2957
+ /**
2958
+ * @deprecated
2959
+ * Reports errors
2960
+ * @example
2961
+ * ```js
2962
+ * disabledActions: [Action.ReportError]
2963
+ * ```
2964
+ * @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
2965
+ */
2966
+ Action["ReportError"] = "reportError";
2967
+ /**
2968
+ * The **Sync to sheets** action on Answers and Liveboard visualizations.
2969
+ * Allows sending data to a Google Sheet.
2970
+ * @example
2971
+ * ```js
2972
+ * disabledActions: [Action.SyncToSheets]
2973
+ * ```
2974
+ * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2975
+ */
2976
+ Action["SyncToSheets"] = "sync-to-sheets";
2977
+ /**
2978
+ * The **Sync to other apps** action on Answers and Liveboard visualizations.
2979
+ * Allows sending data to third-party apps like Slack, Salesforce,
2980
+ * Microsoft Teams, and so on.
2981
+ * @example
2982
+ * ```js
2983
+ * disabledActions: [Action.SyncToOtherApps]
2984
+ * ```
2985
+ * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2986
+ */
2987
+ Action["SyncToOtherApps"] = "sync-to-other-apps";
2988
+ /**
2989
+ * The **Manage pipelines** action on Answers and Liveboard visualizations.
2990
+ * Allows users to manage data sync pipelines to third-party apps.
2991
+ * @example
2992
+ * ```js
2993
+ * disabledActions: [Action.SyncToOtherApps]
2994
+ * ```
2995
+ * @version SDK: 1.18.0| ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2996
+ */
2997
+ Action["ManagePipelines"] = "manage-pipeline";
2998
+ /**
2999
+ * The **Filter** action on Liveboard visualizations.
3000
+ * Allows users to apply cross-filters on a Liveboard.
3001
+ * @example
3002
+ * ```js
3003
+ * disabledActions: [Action.CrossFilter]
3004
+ * ```
3005
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3006
+ */
3007
+ Action["CrossFilter"] = "context-menu-item-cross-filter";
3008
+ /**
3009
+ * The **Sync to Slack** action on Liveboard visualizations.
3010
+ * Allows sending data to third-party apps Slack
3011
+ * @example
3012
+ * ```js
3013
+ * disabledActions: [Action.SyncToSlack]
3014
+ * ```
3015
+ * @version @version SDK : 1.32.0 | Thoughtspot: 10.1.0.cl
3016
+ */
3017
+ Action["SyncToSlack"] = "syncToSlack";
3018
+ /**
3019
+ * The **Sync to Teams** action on Liveboard visualizations.
3020
+ * Allows sending data to third-party apps Team
3021
+ * @example
3022
+ * ```js
3023
+ * disabledActions: [Action.SyncToTeams]
3024
+ * ```
3025
+ * @version @version SDK : 1.32.0 | Thoughtspot: 10.1.0.cl
3026
+ */
3027
+ Action["SyncToTeams"] = "syncToTeams";
3028
+ /**
3029
+ * The **Remove** action that appears when cross filters are applied
3030
+ * on a Liveboard.
3031
+ * Removes filters applied o a visualization.
3032
+ * @example
3033
+ * ```js
3034
+ * disabledActions: [Action.RemoveCrossFilter]
3035
+ * ```
3036
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3037
+ */
3038
+ Action["RemoveCrossFilter"] = "context-menu-item-remove-cross-filter";
3039
+ /**
3040
+ * The **Aggregate** option in the chart axis or the
3041
+ * table column customization menu.
3042
+ * Provides aggregation options to analyze the data on a chart or table.
3043
+ * @example
3044
+ * ```js
3045
+ * disabledActions: [Action.AxisMenuAggregate]
3046
+ * ```
3047
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3048
+ */
3049
+ Action["AxisMenuAggregate"] = "axisMenuAggregate";
3050
+ /**
3051
+ * The **Time bucket** option in the chart axis or table column
3052
+ * customization menu.
3053
+ * Allows defining time metric for date comparison.
3054
+ * @example
3055
+ * ```js
3056
+ * disabledActions: [Action.AxisMenuTimeBucket]
3057
+ * ```
3058
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3059
+ */
3060
+ Action["AxisMenuTimeBucket"] = "axisMenuTimeBucket";
3061
+ /**
3062
+ * The **Filter** action in the chart axis or table column
3063
+ * customization menu.
3064
+ * @example
3065
+ * ```js
3066
+ * disabledActions: [Action.AxisMenuFilter]
3067
+ * ```
3068
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3069
+ */
3070
+ Action["AxisMenuFilter"] = "axisMenuFilter";
3071
+ /**
3072
+ * The **Conditional formatting** action on chart or table.
3073
+ * Allows adding rules for conditional formatting of data
3074
+ * points on a chart or table.
3075
+ * @example
3076
+ * ```js
3077
+ * disabledActions: [Action.AxisMenuConditionalFormat]
3078
+ * ```
3079
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3080
+ */
3081
+ Action["AxisMenuConditionalFormat"] = "axisMenuConditionalFormat";
3082
+ /**
3083
+ * The **Sort** menu action on a table or chart axis
3084
+ * Sorts data in ascending or descending order.
3085
+ * Allows adding, editing, or removing filters.
3086
+ * @example
3087
+ * ```js
3088
+ * disabledActions: [Action.AxisMenuConditionalFormat]
3089
+ * ```
3090
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3091
+ */
3092
+ Action["AxisMenuSort"] = "axisMenuSort";
3093
+ /**
3094
+ * The **Group** option in the chart axis or table column
3095
+ * customization menu.
3096
+ * Allows grouping data points if the axes use the same
3097
+ * unit of measurement and a similar scale.
3098
+ * @example
3099
+ * ```js
3100
+ * disabledActions: [Action.AxisMenuGroup]
3101
+ * ```
3102
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3103
+ */
3104
+ Action["AxisMenuGroup"] = "axisMenuGroup";
3105
+ /**
3106
+ * The **Position** option in the axis customization menu.
3107
+ * Allows changing the position of the axis to the
3108
+ * left or right side of the chart.
3109
+ * @example
3110
+ * ```js
3111
+ * disabledActions: [Action.AxisMenuPosition]
3112
+ * ```
3113
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3114
+ */
3115
+ Action["AxisMenuPosition"] = "axisMenuPosition";
3116
+ /**
3117
+ * The **Rename** option in the chart axis or table column customization menu.
3118
+ * Renames the axis label on a chart or the column header on a table.
3119
+ * @example
3120
+ * ```js
3121
+ * disabledActions: [Action.AxisMenuRename]
3122
+ * ```
3123
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3124
+ */
3125
+ Action["AxisMenuRename"] = "axisMenuRename";
3126
+ /**
3127
+ * The **Edit** action in the axis customization menu.
3128
+ * Allows editing the axis name, position, minimum and maximum values,
3129
+ * and format of a column.
3130
+ * @example
3131
+ * ```js
3132
+ * disabledActions: [Action.AxisMenuEdit]
3133
+ * ```
3134
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3135
+ */
3136
+ Action["AxisMenuEdit"] = "axisMenuEdit";
3137
+ /**
3138
+ * The **Number format** action to customize the format of
3139
+ * the data labels on a chart or table.
3140
+ * @example
3141
+ * ```js
3142
+ * disabledActions: [Action.AxisMenuNumberFormat]
3143
+ * ```
3144
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3145
+ */
3146
+ Action["AxisMenuNumberFormat"] = "axisMenuNumberFormat";
3147
+ /**
3148
+ * The **Text wrapping** action on a table.
3149
+ * Wraps or clips column text on a table.
3150
+ * @example
3151
+ * ```js
3152
+ * disabledActions: [Action.AxisMenuTextWrapping]
3153
+ * ```
3154
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3155
+ */
3156
+ Action["AxisMenuTextWrapping"] = "axisMenuTextWrapping";
3157
+ /**
3158
+ * The **Remove** action in the chart axis or table column
3159
+ * customization menu.
3160
+ * Removes the data labels from a chart or the column of a
3161
+ * table visualization.
3162
+ * @example
3163
+ * ```js
3164
+ * disabledActions: [Action.AxisMenuRemove]
3165
+ * ```
3166
+ * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
3167
+ */
3168
+ Action["AxisMenuRemove"] = "axisMenuRemove";
3169
+ /**
3170
+ * @hidden
3171
+ */
3172
+ Action["InsertInToSlide"] = "insertInToSlide";
3173
+ /**
3174
+ * The **Rename** menu action on Liveboards and visualizations.
3175
+ * Allows renaming a Liveboard or visualization.
3176
+ * @example
3177
+ * ```js
3178
+ * disabledActions: [Action.RenameModalTitleDescription]
3179
+ * ```
3180
+ * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
3181
+ */
3182
+ Action["RenameModalTitleDescription"] = "renameModalTitleDescription";
3183
+ /**
3184
+ *
3185
+ * @example
3186
+ * ```js
3187
+ * disabledActions: [Action.RequestVerification]
3188
+ * ```
3189
+ * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
3190
+ */
3191
+ Action["RequestVerification"] = "requestVerification";
3192
+ /**
3193
+ *
3194
+ *Allows users to mark a Liveboard as verified.
3195
+ * @example
3196
+ * ```js
3197
+ * disabledActions: [Action.MarkAsVerified]
3198
+ * ```
3199
+ * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
3200
+ */
3201
+ Action["MarkAsVerified"] = "markAsVerified";
3202
+ /**
3203
+ * The **Add Tab** action on a Liveboard.
3204
+ * Allows adding a new tab to a Liveboard view.
3205
+ * @example
3206
+ * ```js
3207
+ * disabledActions: [Action.AddTab]
3208
+ * ```
3209
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
3210
+ */
3211
+ Action["AddTab"] = "addTab";
3212
+ /**
3213
+ *
3214
+ *Initiates contextual change analysis on KPI charts.
3215
+ * @example
3216
+ * ```js
3217
+ * disabledActions: [Action.EnableContextualChangeAnalysis]
3218
+ * ```
3219
+ * @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
3220
+ */
3221
+ Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
3222
+ /**
3223
+ *
3224
+ * @example
3225
+ * ```js
3226
+ * disabledActions: [Action.ShowSageQuery]
3227
+ * ```
3228
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
3229
+ */
3230
+ Action["ShowSageQuery"] = "showSageQuery";
3231
+ /**
3232
+ *
3233
+ * @example
3234
+ * ```js
3235
+ * disabledActions: [Action.EditSageAnswer]
3236
+ * ```
3237
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
3238
+ */
3239
+ Action["EditSageAnswer"] = "editSageAnswer";
3240
+ /**
3241
+ *
3242
+ *This action allows users to send feedback on AI-generated Answers.
3243
+ * @example
3244
+ * ```js
3245
+ * disabledActions: [Action.SageAnswerFeedback]
3246
+ * ```
3247
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
3248
+ */
3249
+ Action["SageAnswerFeedback"] = "sageAnswerFeedback";
3250
+ /**
3251
+ *
3252
+ * @example
3253
+ * ```js
3254
+ * disabledActions: [Action.ModifySageAnswer]
3255
+ * ```
3256
+ * @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
3257
+ */
3258
+ Action["ModifySageAnswer"] = "modifySageAnswer";
3259
+ /**
3260
+ * The **Move to Tab** menu action on visualizations in liveboard edit mode.
3261
+ * Allows moving a visualization to a different tab.
3262
+ * @example
3263
+ * ```js
3264
+ * disabledActions: [Action.MoveToTab]
3265
+ * ```
3266
+ */
3267
+ Action["MoveToTab"] = "onContainerMove";
3268
+ /**
3269
+ * The **Manage Alertsb** menu action on KPI visualizations.
3270
+ * @example
3271
+ * ```js
3272
+ * disabledActions: [Action.ManageMonitor]
3273
+ * ```
3274
+ */
3275
+ Action["ManageMonitor"] = "manageMonitor";
3276
+ /**
3277
+ * Action ID for Liveboard Personalised Views dropdown
3278
+ * @example
3279
+ * ```js
3280
+ * disabledActions: [Action.PersonalisedViewsDropdown]
3281
+ * ```
3282
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
3283
+ */
3284
+ Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
3285
+ /**
3286
+ * Action ID for Liveboard Users ( Recently Visited / social proof )
3287
+ * @example
3288
+ * ```js
3289
+ * disabledActions: [Action.LiveboardUsers]
3290
+ * ```
3291
+ * @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
3292
+ */
3293
+ Action["LiveboardUsers"] = "liveboardUsers";
3294
+ /**
3295
+ * Action ID for the Parent TML action
3296
+ * The parent action **TML** must be included to access TML-related options
3297
+ * within the cascading menu (specific to the answer page)
3298
+ * @example
3299
+ * ```js
3300
+ * // to include specific TML actions
3301
+ * visibleActions: [Action.TML, Action.ExportTML, Action.EditTML]
3302
+ *
3303
+ * ```
3304
+ * @example
3305
+ * ```js
3306
+ * hiddenAction: [Action.TML] // hide all TML actions
3307
+ * disabledActions: [Action.TML] // to disable all TML actions
3308
+ * ```
3309
+ * @version SDK : 1.28.3 | Thoughtspot: 9.12.0.cl
3310
+ */
3311
+ Action["TML"] = "tml";
3312
+ /**
3313
+ * Action Id for CreateLiveboard for liveboard list page & Pin Modal
3314
+ * @example
3315
+ * ```js
3316
+ * hiddenAction: [Action.CreateLiveboard]
3317
+ * disabledActions: [Action.CreateLiveboard]
3318
+ * ```
3319
+ * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
3320
+ */
3321
+ Action["CreateLiveboard"] = "createLiveboard";
3322
+ /**
3323
+ * Action ID for to hide Verified Liveboard Banner
3324
+ * @example
3325
+ * ```js
3326
+ * hiddenAction: [Action.VerifiedLiveboard]
3327
+ * ```
3328
+ * @version SDK: 1.29.0 | Thoughtspot: 9.10.0.cl
3329
+ */
3330
+ Action["VerifiedLiveboard"] = "verifiedLiveboard";
3331
+ /**
3332
+ * Action ID for ask sage button
3333
+ * @example
3334
+ * ```js
3335
+ * hiddenAction: [Action.AskAi]
3336
+ * ```
3337
+ * @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
3338
+ */
3339
+ Action["AskAi"] = "AskAi";
3340
+ /**
3341
+ * The **Add KPI to Watchlist** action on Home page watchlist.
3342
+ * @example
3343
+ * ```js
3344
+ * disabledActions: [Action.AddToWatchlist]
3345
+ * ```
3346
+ * @version SDK : 1.27.9 | Thoughtspot: 9.12.5.cl
3347
+ */
3348
+ Action["AddToWatchlist"] = "addToWatchlist";
3349
+ /**
3350
+ * The **Remove from watchlist** menu action on KPI watchlist.
3351
+ * @example
3352
+ * ```js
3353
+ * disabledActions: [Action.RemoveFromWatchlist]
3354
+ * ```
3355
+ * @version SDK : 1.27.9 | Thoughtspot: 9.12.5.cl
3356
+ */
3357
+ Action["RemoveFromWatchlist"] = "removeFromWatchlist";
3358
+ /**
3359
+ * The **Organise Favourites** action on Homepage Favourite Module.
3360
+ * @example
3361
+ * ```js
3362
+ * disabledActions: [Action.OrganiseFavourites]
3363
+ * ```
3364
+ * @version SDK : 1.32.0 | Thoughtspot: 10.0.0.cl
3365
+ */
3366
+ Action["OrganiseFavourites"] = "organiseFavourites";
3367
+ /**
3368
+ * Action ID for AI Highlights button
3369
+ * @example
3370
+ * ```js
3371
+ * hiddenAction: [Action.AIHighlights]
3372
+ * ```
3373
+ * @version SDK: 1.27.10 | Thoughtspot: 9.12.5.cl
3374
+ */
3375
+ Action["AIHighlights"] = "AIHighlights";
3376
+ /**
3377
+ * Action ID for edit the schedule action on schedule on homepage
3378
+ * @example
3379
+ * ```js
3380
+ * disabledActions: [Action.EditScheduleHomepage]
3381
+ * ```
3382
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3383
+ */
3384
+ Action["EditScheduleHomepage"] = "editScheduleHomepage";
3385
+ /**
3386
+ * Action ID for pause schedule action on schedule on homepage
3387
+ * @example
3388
+ * ```js
3389
+ * disabledActions: [Action.PauseScheduleHomepage]
3390
+ * ```
3391
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3392
+ */
3393
+ Action["PauseScheduleHomepage"] = "pauseScheduleHomepage";
3394
+ /**
3395
+ * Action ID for view schedule run action on schedule on homepage
3396
+ * @example
3397
+ * ```js
3398
+ * disabledActions: [Action.ViewScheduleRunHomepage]
3399
+ * ```
3400
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3401
+ */
3402
+ Action["ViewScheduleRunHomepage"] = "viewScheduleRunHomepage";
3403
+ /**
3404
+ * Action ID for unsubscribe schedule action on schedule on homepage
3405
+ * @example
3406
+ * ```js
3407
+ * disabledActions: [Action.UnsubscribeScheduleHomepage]
3408
+ * ```
3409
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3410
+ */
3411
+ Action["UnsubscribeScheduleHomepage"] = "unsubscribeScheduleHomepage";
3412
+ /**
3413
+ * The **Manage Tags** action on Homepage Favourite Module.
3414
+ * @example
3415
+ * ```js
3416
+ * disabledActions: [Action.ManageTags]
3417
+ * ```
3418
+ * @version SDK : 1.34.0 | Thoughtspot: 10.3.0.cl
3419
+ */
3420
+ Action["ManageTags"] = "manageTags";
3421
+ /**
3422
+ * Action ID for delete schedule action on schedule on homepage
3423
+ * @example
3424
+ * ```js
3425
+ * disabledActions: [Action.DeleteScheduleHomepage]
3426
+ * ```
3427
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3428
+ */
3429
+ Action["DeleteScheduleHomepage"] = "deleteScheduleHomepage";
3430
+ /**
3431
+ * The **Analyze CTA** action on KPI chart.
3432
+ * @example
3433
+ * ```js
3434
+ * disabledActions: [Action.KPIAnalysisCTA]
3435
+ * ```
3436
+ * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3437
+ */
3438
+ Action["KPIAnalysisCTA"] = "kpiAnalysisCTA";
3439
+ /**
3440
+ * Action ID for disabling chip reorder in Answer and Liveboard
3441
+ * @example
3442
+ * ```js
3443
+ * const disabledActions = [Action.DisableChipReorder]
3444
+ * ```
3445
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3446
+ */
3447
+ Action["DisableChipReorder"] = "disableChipReorder";
3448
+ /**
3449
+ * Action ID for Hide Irrelevant filters button
3450
+ * @example
3451
+ * ```js
3452
+ * hiddenAction: [Action.ChangeFilterVisibilityInTab]
3453
+ * ```
3454
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3455
+ */
3456
+ Action["ChangeFilterVisibilityInTab"] = "changeFilterVisibilityInTab";
3457
+ /**
3458
+ * Action ID for hide/disable Preview data button in spotter
3459
+ * @example
3460
+ * ```js
3461
+ * hiddenAction: [Action.PreviewDataSpotter]
3462
+ * ```
3463
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3464
+ */
3465
+ Action["PreviewDataSpotter"] = "previewDataSpotter";
3466
+ /**
3467
+ * Action ID for hide/disable reset button in spotter
3468
+ * @example
3469
+ * ```js
3470
+ * hiddenAction: [Action.ResetSpotterChat]
3471
+ * ```
3472
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3473
+ */
3474
+ Action["ResetSpotterChat"] = "resetSpotterChat";
3475
+ /**
3476
+ * Action ID for hide/disable feedback in spotter
3477
+ * @example
3478
+ * ```js
3479
+ * hiddenAction: [Action.SpotterFeedback]
3480
+ * ```
3481
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3482
+ */
3483
+ Action["SpotterFeedback"] = "spotterFeedback";
3484
+ /**
3485
+ * Action ID for hide/disable editing previous prompt in spotter
3486
+ * @example
3487
+ * ```js
3488
+ * hiddenAction: [Action.EditPreviousPrompt]
3489
+ * ```
3490
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3491
+ */
3492
+ Action["EditPreviousPrompt"] = "editPreviousPrompt";
3493
+ /**
3494
+ * Action ID for hide/disable deleting previous prompt in spotter
3495
+ * @example
3496
+ * ```js
3497
+ * hiddenAction: [Action.DeletePreviousPrompt]
3498
+ * ```
3499
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3500
+ */
3501
+ Action["DeletePreviousPrompt"] = "deletePreviousPrompt";
3502
+ /**
3503
+ * Action ID for hide/disable edit of tokens on spotter results.
3504
+ * @example
3505
+ * ```js
3506
+ * hiddenAction: [Action.EditTokens]
3507
+ * ```
3508
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
3509
+ */
3510
+ Action["EditTokens"] = "editTokens";
3511
+ })(Action || (Action = {}));
3512
+ var PrefetchFeatures;
3513
+ (function (PrefetchFeatures) {
3514
+ PrefetchFeatures["FullApp"] = "FullApp";
3515
+ PrefetchFeatures["SearchEmbed"] = "SearchEmbed";
3516
+ PrefetchFeatures["LiveboardEmbed"] = "LiveboardEmbed";
3517
+ PrefetchFeatures["VizEmbed"] = "VizEmbed";
3518
+ })(PrefetchFeatures || (PrefetchFeatures = {}));
3519
+ /**
3520
+ * Enum for options to change context trigger
3521
+ */
3522
+ var ContextMenuTriggerOptions;
3523
+ (function (ContextMenuTriggerOptions) {
3524
+ ContextMenuTriggerOptions["LEFT_CLICK"] = "left-click";
3525
+ ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
3526
+ })(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
3527
+ var LogLevel;
3528
+ (function (LogLevel) {
3529
+ /**
3530
+ * No logs will be logged in the console.
3531
+ * @example
3532
+ * ```js
3533
+ * init({
3534
+ * ... // other options,
3535
+ * logLevel: LogLevel.SILENT,
3536
+ * })
3537
+ * ```
3538
+ * @version SDK: 1.26.7 | Thoughtspot: 9.10.0.cl
3539
+ */
3540
+ LogLevel["SILENT"] = "SILENT";
3541
+ /**
3542
+ * Only ERROR logs will be logged in the console.
3543
+ * @example
3544
+ * ```js
3545
+ * init({
3546
+ * ... // other options,
3547
+ * logLevel: LogLevel.ERROR,
3548
+ * })
3549
+ * ```
3550
+ * @version SDK: 1.26.7 | Thoughtspot: 9.10.0.cl
3551
+ */
3552
+ LogLevel["ERROR"] = "ERROR";
3553
+ /**
3554
+ * Only WARN and ERROR logs will be logged in the console.
3555
+ * @example
3556
+ * ```js
3557
+ * init({
3558
+ * ... // other options,
3559
+ * logLevel: LogLevel.WARN,
3560
+ * })
3561
+ * ```
3562
+ * @version SDK: 1.26.7 | Thoughtspot: 9.10.0.cl
3563
+ */
3564
+ LogLevel["WARN"] = "WARN";
3565
+ /**
3566
+ * Only INFO, WARN, and ERROR logs will be logged in the console.
3567
+ * @example
3568
+ * ```js
3569
+ * init({
3570
+ * ... // other options,
3571
+ * logLevel: LogLevel.INFO,
3572
+ * })
3573
+ * ```
3574
+ * @version SDK: 1.26.7 | Thoughtspot: 9.10.0.cl
3575
+ */
3576
+ LogLevel["INFO"] = "INFO";
3577
+ /**
3578
+ * Only DEBUG, INFO, WARN, and ERROR logs will be logged in the console.
3579
+ * @example
3580
+ * ```js
3581
+ * init({
3582
+ * ... // other options,
3583
+ * logLevel: LogLevel.DEBUG,
3584
+ * })
3585
+ * ```
3586
+ * @version SDK: 1.26.7 | Thoughtspot: 9.10.0.cl
3587
+ */
3588
+ LogLevel["DEBUG"] = "DEBUG";
3589
+ /**
3590
+ * All logs will be logged in the console.
3591
+ * @example
3592
+ * ```js
3593
+ * init({
3594
+ * ... // other options,
3595
+ * logLevel: LogLevel.TRACE,
3596
+ * })
3597
+ * ```
3598
+ * @version SDK: 1.26.7 | Thoughtspot: 9.10.0.cl
3599
+ */
3600
+ LogLevel["TRACE"] = "TRACE";
3601
+ })(LogLevel || (LogLevel = {}));
3602
+
3603
+ var name="@thoughtspot/visual-embed-sdk";var version="1.35.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./native":{"import":"./lib/src/native/index.js",require:"./cjs/src/native/index.js",types:"./lib/src/native/index.d.ts"},"./lib/src/native":{"import":"./lib/src/native/index.js",require:"./cjs/src/native/index.js",types:"./lib/src/native/index.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","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",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | 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",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","react-native":"^0.76.3","react-native-webview":"^13.12.4","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^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/lodash":"^4.17.0","@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",crypto:"^1.0.1","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-comment-length":"1.7.3","eslint-plugin-import":"^2.22.1","eslint-plugin-jsdoc":"^46.9.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.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:"4.24.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",vite:"^5.3.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$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 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};
3604
+
3605
+ const logFunctions = {
3606
+ [LogLevel.SILENT]: () => undefined,
3607
+ [LogLevel.ERROR]: console.error,
3608
+ [LogLevel.WARN]: console.warn,
3609
+ [LogLevel.INFO]: console.info,
3610
+ [LogLevel.DEBUG]: console.debug,
3611
+ [LogLevel.TRACE]: console.trace,
3612
+ };
3613
+ let globalLogLevelOverride = LogLevel.TRACE;
3614
+ const logLevelToNumber = {
3615
+ [LogLevel.SILENT]: 0,
3616
+ [LogLevel.ERROR]: 1,
3617
+ [LogLevel.WARN]: 2,
3618
+ [LogLevel.INFO]: 3,
3619
+ [LogLevel.DEBUG]: 4,
3620
+ [LogLevel.TRACE]: 5,
3621
+ };
3622
+ const compareLogLevels = (logLevel1, logLevel2) => {
3623
+ const logLevel1Index = logLevelToNumber[logLevel1];
3624
+ const logLevel2Index = logLevelToNumber[logLevel2];
3625
+ return logLevel1Index - logLevel2Index;
3626
+ };
3627
+ class Logger {
3628
+ constructor() {
3629
+ this.logLevel = LogLevel.ERROR;
3630
+ this.setLogLevel = (newLogLevel) => {
3631
+ this.logLevel = newLogLevel;
3632
+ };
3633
+ this.getLogLevel = () => this.logLevel;
3634
+ }
3635
+ canLog(logLevel) {
3636
+ if (logLevel === LogLevel.SILENT)
3637
+ return false;
3638
+ if (!isUndefined(globalLogLevelOverride)) {
3639
+ return compareLogLevels(globalLogLevelOverride, logLevel) >= 0;
3640
+ }
3641
+ return compareLogLevels(this.logLevel, logLevel) >= 0;
3642
+ }
3643
+ logMessages(args, logLevel) {
3644
+ if (this.canLog(logLevel)) {
3645
+ const logFn = logFunctions[logLevel];
3646
+ if (logFn) {
3647
+ logFn(...args);
3648
+ }
3649
+ }
3650
+ }
3651
+ log(...args) {
3652
+ this.info(args);
3653
+ }
3654
+ info(...args) {
3655
+ this.logMessages(args, LogLevel.INFO);
3656
+ }
3657
+ debug(...args) {
3658
+ this.logMessages(args, LogLevel.DEBUG);
3659
+ }
3660
+ trace(...args) {
3661
+ this.logMessages(args, LogLevel.TRACE);
3662
+ }
3663
+ error(...args) {
3664
+ this.logMessages(args, LogLevel.ERROR);
3665
+ }
3666
+ warn(...args) {
3667
+ this.logMessages(args, LogLevel.WARN);
3668
+ }
3669
+ }
3670
+ const logger = new Logger();
3671
+
3672
+ /**
3673
+ * This method constructs the webview URL with given config.
3674
+ * @param config To get the webviewURL pass the necessary config options.
3675
+ * host: string;
3676
+ * authType: AuthType;
3677
+ * liveboardId: string;
3678
+ * getAuthToken: () => Promise<string>;
3679
+ * These four are necessary arguments.
3680
+ * @returns The Promise for WebView URL.
3681
+ */
3682
+ const getWebViewUrl = async (config) => {
3683
+ if (typeof config.getAuthToken !== 'function') {
3684
+ throw new Error('`getAuthToken` must be a function that returns a Promise.');
3685
+ }
3686
+ const authToken = await config.getAuthToken();
3687
+ if (!authToken) {
3688
+ throw new Error('Failed to fetch initial authentication token.');
3689
+ }
3690
+ const hostAppUrl = encodeURIComponent(config.host.includes('localhost')
3691
+ || config.host.includes('127.0.0.1')
3692
+ || config.host.includes('10.0.2.2')
3693
+ ? 'local-host'
3694
+ : config.host);
3695
+ const queryParams = {
3696
+ [Param.EmbedApp]: true,
3697
+ [Param.HostAppUrl]: hostAppUrl,
3698
+ [Param.Version]: pkgInfo.version,
3699
+ [Param.AuthType]: config.authType,
3700
+ [Param.livedBoardEmbed]: true,
3701
+ [Param.EnableFlipTooltipToContextMenu]: true,
3702
+ [Param.ContextMenuTrigger]: true,
3703
+ };
3704
+ const queryString = getQueryParamString(queryParams);
3705
+ const webViewUrl = `${config.host}/embed?${queryString}#/embed/viz/${encodeURIComponent(config.liveboardId)}`;
3706
+ return webViewUrl;
3707
+ };
3708
+ /**
3709
+ * setting up message handling for the message replies to TS instances.
3710
+ * @param config The webview config
3711
+ * @param event The message event from the WebView.
3712
+ * @param WebViewRef Ref to use and inject javascript
3713
+ */
3714
+ const setupWebViewMessageHandler = async (config, event, webViewRef) => {
3715
+ const message = JSON.parse(event.nativeEvent.data);
3716
+ const injectJavaScript = (codeSnip) => {
3717
+ if (webViewRef === null || webViewRef === void 0 ? void 0 : webViewRef.current) {
3718
+ webViewRef.current.injectJavaScript(codeSnip);
3719
+ }
3720
+ else {
3721
+ logger.error('Reference for Webview not found!!');
3722
+ }
3723
+ };
3724
+ const defaultHandleMessage = async () => {
3725
+ switch (message.type) {
3726
+ case 'appInit': {
3727
+ try {
3728
+ const authToken = await config.getAuthToken();
3729
+ const initPayload = {
3730
+ type: 'appInit',
3731
+ data: {
3732
+ host: config.host,
3733
+ authToken,
3734
+ customisations: getCustomisationsMobileEmbed(config),
3735
+ },
3736
+ };
3737
+ injectJavaScript(jsCodeToHandleInteractionsForContextMenu);
3738
+ injectJavaScript(`window.postMessage(${JSON.stringify(initPayload)}, '*');`);
3739
+ }
3740
+ catch (error) {
3741
+ console.error('Error handling appInit:', error);
3742
+ }
3743
+ break;
3744
+ }
3745
+ case 'ThoughtspotAuthExpired': {
3746
+ try {
3747
+ const newAuthToken = await config.getAuthToken();
3748
+ if (newAuthToken) {
3749
+ const authExpirePayload = {
3750
+ type: 'ThoughtspotAuthExpired',
3751
+ data: { authToken: newAuthToken },
3752
+ };
3753
+ injectJavaScript(`window.postMessage(${JSON.stringify(authExpirePayload)}, '*');`);
3754
+ }
3755
+ }
3756
+ catch (error) {
3757
+ console.error('Error refreshing token on expiry:', error);
3758
+ }
3759
+ break;
3760
+ }
3761
+ case 'ThoughtspotAuthFailure': {
3762
+ try {
3763
+ const newAuthToken = await config.getAuthToken();
3764
+ if (newAuthToken) {
3765
+ const authFailurePayload = {
3766
+ type: 'ThoughtspotAuthFailure',
3767
+ data: { authToken: newAuthToken },
3768
+ };
3769
+ injectJavaScript(`window.postMessage(${JSON.stringify(authFailurePayload)}, '*');`);
3770
+ }
3771
+ }
3772
+ catch (error) {
3773
+ console.error('Error refreshing token on failure:', error);
3774
+ }
3775
+ break;
3776
+ }
3777
+ default:
3778
+ console.warn('Unhandled message type:', message.type);
3779
+ }
3780
+ };
3781
+ if (config.handleMessage) {
3782
+ await config.handleMessage(event);
3783
+ }
3784
+ else {
3785
+ await defaultHandleMessage();
3786
+ }
3787
+ };
3788
+ const jsCodeToHandleInteractionsForContextMenu = `
3789
+ // Disabling auofocus
3790
+ document.querySelectorAll('input[autofocus], textarea[autofocus]').forEach(el => el.removeAttribute('autofocus'));
3791
+
3792
+ // adding meta tag to keep fixed viewport scalign
3793
+ const meta = document.createElement('meta');
3794
+ meta.name = 'viewport';
3795
+ meta.content = 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no';
3796
+ document.head.appendChild(meta);
3797
+
3798
+ // input focus problem. -> we can just force it inside our view.
3799
+ document.addEventListener('focusin', (event) => {
3800
+ const target = event.target;
3801
+
3802
+ if (
3803
+ target.tagName === 'INPUT' ||
3804
+ target.tagName === 'TEXTAREA'
3805
+ ) {
3806
+ const rect = target.getBoundingClientRect();
3807
+ if (
3808
+ rect.top < 0 ||
3809
+ rect.bottom > window.innerHeight ||
3810
+ rect.left < 0 ||
3811
+ rect.right > window.innerWidth
3812
+ ) {
3813
+ event.preventDefault();
3814
+ // target.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'end' });
3815
+ const horizontalPadding = 10;
3816
+
3817
+ let scrollX = 0;
3818
+
3819
+ if (rect.left < horizontalPadding) {
3820
+ scrollX = rect.left - horizontalPadding;
3821
+ }
3822
+ if (rect.right > window.innerWidth - horizontalPadding) {
3823
+ scrollX = rect.right - window.innerWidth + horizontalPadding;
3824
+ }
3825
+ const scrollY = rect.top - (window.innerHeight / 2 - rect.height / 2);
3826
+
3827
+ window.scrollBy({
3828
+ top: scrollY,
3829
+ left: scrollX,
3830
+ behavior: 'smooth',
3831
+ })
3832
+ }
3833
+ }
3834
+ });
3835
+ `;
3836
+
3837
+ exports.getWebViewUrl = getWebViewUrl;
3838
+ exports.setupWebViewMessageHandler = setupWebViewMessageHandler;
3839
+
3840
+ }));