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