@thoughtspot/visual-embed-sdk 1.33.0-alpha.2 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/cjs/package.json +6 -24
  2. package/cjs/src/css-variables.d.ts +46 -3
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts +47 -27
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +10 -1
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +32 -0
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/base.d.ts +35 -33
  11. package/cjs/src/embed/base.d.ts.map +1 -1
  12. package/cjs/src/embed/base.js +35 -33
  13. package/cjs/src/embed/base.js.map +1 -1
  14. package/cjs/src/embed/embed.spec.js +0 -19
  15. package/cjs/src/embed/embed.spec.js.map +1 -1
  16. package/cjs/src/embed/liveboard.d.ts +42 -0
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +6 -1
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/liveboard.spec.js +43 -0
  21. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  22. package/cjs/src/embed/search.d.ts +0 -26
  23. package/cjs/src/embed/search.d.ts.map +1 -1
  24. package/cjs/src/embed/search.js.map +1 -1
  25. package/cjs/src/embed/ts-embed.d.ts +0 -1
  26. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  27. package/cjs/src/embed/ts-embed.js +8 -12
  28. package/cjs/src/embed/ts-embed.js.map +1 -1
  29. package/cjs/src/embed/ts-embed.spec.js +0 -9
  30. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  31. package/cjs/src/mixpanel-service.d.ts +4 -0
  32. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  33. package/cjs/src/mixpanel-service.js +4 -0
  34. package/cjs/src/mixpanel-service.js.map +1 -1
  35. package/cjs/src/tokenizedFetch.d.ts.map +1 -1
  36. package/cjs/src/tokenizedFetch.js +5 -1
  37. package/cjs/src/tokenizedFetch.js.map +1 -1
  38. package/cjs/src/types.d.ts +179 -22
  39. package/cjs/src/types.d.ts.map +1 -1
  40. package/cjs/src/types.js +143 -12
  41. package/cjs/src/types.js.map +1 -1
  42. package/cjs/src/utils/authService/authService.spec.js +3 -1
  43. package/cjs/src/utils/authService/authService.spec.js.map +1 -1
  44. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  45. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  46. package/cjs/src/utils/graphql/answerService/answer-queries.js +9 -2
  47. package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  48. package/cjs/src/utils/graphql/answerService/answerService.d.ts +15 -0
  49. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  50. package/cjs/src/utils/graphql/answerService/answerService.js +25 -0
  51. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  52. package/cjs/src/utils/graphql/answerService/answerService.spec.js +53 -0
  53. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  54. package/cjs/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  55. package/cjs/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  56. package/cjs/src/utils/graphql/graphql-request.spec.js +36 -0
  57. package/cjs/src/utils/graphql/graphql-request.spec.js.map +1 -0
  58. package/cjs/src/utils/processData.js +2 -2
  59. package/cjs/src/utils/processData.js.map +1 -1
  60. package/cjs/src/utils/processData.spec.js +14 -0
  61. package/cjs/src/utils/processData.spec.js.map +1 -1
  62. package/cjs/src/utils/processTrigger.d.ts +1 -0
  63. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  64. package/cjs/src/utils/processTrigger.js +3 -3
  65. package/cjs/src/utils/processTrigger.js.map +1 -1
  66. package/cjs/src/utils/processTrigger.spec.js +10 -0
  67. package/cjs/src/utils/processTrigger.spec.js.map +1 -1
  68. package/cjs/src/utils.d.ts.map +1 -1
  69. package/cjs/src/utils.js +1 -3
  70. package/cjs/src/utils.js.map +1 -1
  71. package/dist/src/css-variables.d.ts +46 -3
  72. package/dist/src/css-variables.d.ts.map +1 -1
  73. package/dist/src/embed/app.d.ts +47 -27
  74. package/dist/src/embed/app.d.ts.map +1 -1
  75. package/dist/src/embed/base.d.ts +35 -33
  76. package/dist/src/embed/base.d.ts.map +1 -1
  77. package/dist/src/embed/liveboard.d.ts +42 -0
  78. package/dist/src/embed/liveboard.d.ts.map +1 -1
  79. package/dist/src/embed/search.d.ts +0 -26
  80. package/dist/src/embed/search.d.ts.map +1 -1
  81. package/dist/src/embed/ts-embed.d.ts +0 -1
  82. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  83. package/dist/src/mixpanel-service.d.ts +4 -0
  84. package/dist/src/mixpanel-service.d.ts.map +1 -1
  85. package/dist/src/tokenizedFetch.d.ts.map +1 -1
  86. package/dist/src/types.d.ts +179 -22
  87. package/dist/src/types.d.ts.map +1 -1
  88. package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  89. package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  90. package/dist/src/utils/graphql/answerService/answerService.d.ts +15 -0
  91. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  92. package/dist/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  93. package/dist/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  94. package/dist/src/utils/processTrigger.d.ts +1 -0
  95. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  96. package/dist/src/utils.d.ts.map +1 -1
  97. package/dist/tsembed-react.es.js +442 -107
  98. package/dist/tsembed-react.js +385 -106
  99. package/dist/tsembed.es.js +477 -140
  100. package/dist/tsembed.js +420 -139
  101. package/dist/visual-embed-sdk-react-full.d.ts +368 -112
  102. package/dist/visual-embed-sdk-react.d.ts +368 -112
  103. package/dist/visual-embed-sdk.d.ts +368 -112
  104. package/lib/package.json +6 -24
  105. package/lib/src/css-variables.d.ts +46 -3
  106. package/lib/src/css-variables.d.ts.map +1 -1
  107. package/lib/src/embed/app.d.ts +47 -27
  108. package/lib/src/embed/app.d.ts.map +1 -1
  109. package/lib/src/embed/app.js +10 -1
  110. package/lib/src/embed/app.js.map +1 -1
  111. package/lib/src/embed/app.spec.js +32 -0
  112. package/lib/src/embed/app.spec.js.map +1 -1
  113. package/lib/src/embed/base.d.ts +35 -33
  114. package/lib/src/embed/base.d.ts.map +1 -1
  115. package/lib/src/embed/base.js +35 -33
  116. package/lib/src/embed/base.js.map +1 -1
  117. package/lib/src/embed/embed.spec.js +0 -19
  118. package/lib/src/embed/embed.spec.js.map +1 -1
  119. package/lib/src/embed/liveboard.d.ts +42 -0
  120. package/lib/src/embed/liveboard.d.ts.map +1 -1
  121. package/lib/src/embed/liveboard.js +6 -1
  122. package/lib/src/embed/liveboard.js.map +1 -1
  123. package/lib/src/embed/liveboard.spec.js +43 -0
  124. package/lib/src/embed/liveboard.spec.js.map +1 -1
  125. package/lib/src/embed/search.d.ts +0 -26
  126. package/lib/src/embed/search.d.ts.map +1 -1
  127. package/lib/src/embed/search.js.map +1 -1
  128. package/lib/src/embed/ts-embed.d.ts +0 -1
  129. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  130. package/lib/src/embed/ts-embed.js +8 -12
  131. package/lib/src/embed/ts-embed.js.map +1 -1
  132. package/lib/src/embed/ts-embed.spec.js +0 -9
  133. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  134. package/lib/src/mixpanel-service.d.ts +4 -0
  135. package/lib/src/mixpanel-service.d.ts.map +1 -1
  136. package/lib/src/mixpanel-service.js +4 -0
  137. package/lib/src/mixpanel-service.js.map +1 -1
  138. package/lib/src/tokenizedFetch.d.ts.map +1 -1
  139. package/lib/src/tokenizedFetch.js +5 -1
  140. package/lib/src/tokenizedFetch.js.map +1 -1
  141. package/lib/src/types.d.ts +179 -22
  142. package/lib/src/types.d.ts.map +1 -1
  143. package/lib/src/types.js +143 -12
  144. package/lib/src/types.js.map +1 -1
  145. package/lib/src/utils/authService/authService.spec.js +3 -1
  146. package/lib/src/utils/authService/authService.spec.js.map +1 -1
  147. package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  148. package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  149. package/lib/src/utils/graphql/answerService/answer-queries.js +8 -1
  150. package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  151. package/lib/src/utils/graphql/answerService/answerService.d.ts +15 -0
  152. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  153. package/lib/src/utils/graphql/answerService/answerService.js +25 -0
  154. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  155. package/lib/src/utils/graphql/answerService/answerService.spec.js +54 -1
  156. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  157. package/lib/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  158. package/lib/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  159. package/lib/src/utils/graphql/graphql-request.spec.js +33 -0
  160. package/lib/src/utils/graphql/graphql-request.spec.js.map +1 -0
  161. package/lib/src/utils/processData.js +2 -2
  162. package/lib/src/utils/processData.js.map +1 -1
  163. package/lib/src/utils/processData.spec.js +14 -0
  164. package/lib/src/utils/processData.spec.js.map +1 -1
  165. package/lib/src/utils/processTrigger.d.ts +1 -0
  166. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  167. package/lib/src/utils/processTrigger.js +1 -1
  168. package/lib/src/utils/processTrigger.js.map +1 -1
  169. package/lib/src/utils/processTrigger.spec.js +10 -0
  170. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  171. package/lib/src/utils.d.ts.map +1 -1
  172. package/lib/src/utils.js +1 -3
  173. package/lib/src/utils.js.map +1 -1
  174. package/lib/src/visual-embed-sdk.d.ts +368 -112
  175. package/package.json +6 -24
  176. package/src/css-variables.ts +49 -3
  177. package/src/embed/app.spec.ts +47 -0
  178. package/src/embed/app.ts +54 -26
  179. package/src/embed/base.ts +35 -33
  180. package/src/embed/embed.spec.ts +0 -22
  181. package/src/embed/liveboard.spec.ts +62 -0
  182. package/src/embed/liveboard.ts +52 -0
  183. package/src/embed/search.ts +0 -26
  184. package/src/embed/ts-embed.spec.ts +0 -11
  185. package/src/embed/ts-embed.ts +9 -12
  186. package/src/mixpanel-service.ts +4 -0
  187. package/src/tokenizedFetch.ts +5 -1
  188. package/src/types.ts +180 -21
  189. package/src/utils/authService/authService.spec.ts +3 -1
  190. package/src/utils/graphql/answerService/answer-queries.ts +9 -1
  191. package/src/utils/graphql/answerService/answerService.spec.ts +69 -0
  192. package/src/utils/graphql/answerService/answerService.ts +35 -0
  193. package/src/utils/graphql/graphql-request.spec.ts +38 -0
  194. package/src/utils/processData.spec.ts +16 -0
  195. package/src/utils/processData.ts +2 -2
  196. package/src/utils/processTrigger.spec.ts +19 -0
  197. package/src/utils/processTrigger.ts +1 -1
  198. package/src/utils.ts +1 -3
package/dist/tsembed.js CHANGED
@@ -206,7 +206,6 @@
206
206
  };
207
207
  const getCustomisations = (embedConfig, viewConfig) => {
208
208
  var _a, _b, _c, _d;
209
- const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
210
209
  const customizationsFromViewConfig = viewConfig.customizations;
211
210
  const customizationsFromEmbedConfig = embedConfig.customizations
212
211
  || embedConfig.customisations;
@@ -219,8 +218,7 @@
219
218
  ...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
220
219
  },
221
220
  customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
222
- || ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl)
223
- || customCssUrlFromEmbedConfig,
221
+ || ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl),
224
222
  },
225
223
  content: {
226
224
  ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
@@ -1459,21 +1457,61 @@
1459
1457
  */
1460
1458
  EmbedEvent["Rename"] = "rename";
1461
1459
  /**
1462
- * Emitted when user wants to intercept the search execution
1460
+ * Emitted if the user wants to intercept the search execution
1461
+ * and implement logic to decide whether to run the search or not
1463
1462
  *
1464
- * Set IsOnBeforeGetVizDataInterceptEnabled : true to use
1465
- * this embed event
1463
+ * Prerequisite: Set isOnBeforeGetVizDataInterceptEnabled : true
1464
+ * for this embed event to get emitted.
1466
1465
  *
1466
+ * @param: payload
1467
+ * @param: responder
1468
+ * Contains elements that lets developers define whether ThoughtSpot
1469
+ * will run the search or not, and if not, which error message to provide.
1470
+ *
1471
+ * execute: When execute returns true, the search will be run.
1472
+ * When execute returns false, the search will not be executed.
1473
+ *
1474
+ * error: Developers can customize the user facing message when execute is
1475
+ * set to false using the error parameter in responder
1476
+ *
1477
+ * @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
1478
+ *
1479
+ * @example
1467
1480
  *```js
1468
- * searchEmbed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
1481
+ * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1469
1482
  * (payload, responder) => {
1470
1483
  * responder({
1471
1484
  * data: {
1472
- * execute: true,
1473
- * }})
1485
+ * execute:false,
1486
+ * error: {
1487
+ * //Provide a custom error message to explain to your end user
1488
+ * //why their search did not run
1489
+ * errorText: "This search query cannot be run.
1490
+ * Please contact your administrator for more details."
1491
+ * }
1492
+ * }})
1493
+ * })
1494
+ * ```
1495
+ *
1496
+ *```js
1497
+ * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1498
+ * (payload, responder) => {
1499
+ * const query = payload.data.data.answer.search_query
1500
+ * responder({
1501
+ * data: {
1502
+ * // returns true as long as the query does not include
1503
+ * // both the 'sales' AND the 'county' column
1504
+ * execute: !(query.includes("sales")&&query.includes("county")),
1505
+ * error: {
1506
+ * //Provide a custom error message to explain to your end user
1507
+ * // why their search did not run, and which searches are accepted by your custom logic.
1508
+ * errorText: "You can't use this query :" + query + ".
1509
+ * The 'sales' measures can never be used at the 'county' level.
1510
+ * Please try another measure, or remove 'county' from your search."
1511
+ * }
1512
+ * }})
1474
1513
  * })
1475
1514
  *```
1476
- * @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
1477
1515
  */
1478
1516
  EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
1479
1517
  /**
@@ -1570,6 +1608,15 @@
1570
1608
  * @hidden
1571
1609
  */
1572
1610
  HostEvent["Reload"] = "reload";
1611
+ /**
1612
+ * Get current iframe src
1613
+ * @example
1614
+ * ```js
1615
+ * const frameUrl = AppEmbed.trigger(HostEvent.GetIframeUrl)
1616
+ * ```
1617
+ * @version SDK: 1.35.0 | Thoughtspot: 10.4.0.cl
1618
+ */
1619
+ HostEvent["GetIframeUrl"] = "GetIframeUrl";
1573
1620
  /**
1574
1621
  * Display specific visualizations on a Liveboard.
1575
1622
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
@@ -2171,10 +2218,23 @@
2171
2218
  * filter: {
2172
2219
  * column: "item type",
2173
2220
  * oper: "IN",
2174
- * values: ["bags","shirts"],
2221
+ * values: ["bags","shirts"]
2222
+ * }
2223
+ * });
2224
+ * ```
2225
+ * @example
2226
+ * ```js
2227
+ *
2228
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2229
+ * filter: {
2230
+ * column: "date",
2231
+ * oper: "EQ",
2232
+ * values: ["JULY","2023"],
2233
+ * type: "MONTH_YEAR"
2175
2234
  * }
2176
2235
  * });
2177
2236
  * ```
2237
+ *
2178
2238
  * @example
2179
2239
  *
2180
2240
  * ```js
@@ -2192,7 +2252,8 @@
2192
2252
  * {
2193
2253
  * column: "Date",
2194
2254
  * oper: 'EQ',
2195
- * values: ["1656680400"]
2255
+ * values: ["2023-07-31"],
2256
+ * types: "EXACT_DATE"
2196
2257
  * }]
2197
2258
  * });
2198
2259
  * ```
@@ -2376,7 +2437,6 @@
2376
2437
  Param["ViewPortHeight"] = "viewPortHeight";
2377
2438
  Param["ViewPortWidth"] = "viewPortWidth";
2378
2439
  Param["VisibleActions"] = "visibleAction";
2379
- Param["CustomCSSUrl"] = "customCssUrl";
2380
2440
  Param["DisableLoginRedirect"] = "disableLoginRedirect";
2381
2441
  Param["visibleVizs"] = "pinboardVisibleVizs";
2382
2442
  Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
@@ -2435,6 +2495,9 @@
2435
2495
  Param["FocusSearchBarOnRender"] = "focusSearchBarOnRender";
2436
2496
  Param["DisableRedirectionLinksInNewTab"] = "disableRedirectionLinksInNewTab";
2437
2497
  Param["HomePageSearchBarMode"] = "homePageSearchBarMode";
2498
+ Param["ShowLiveboardVerifiedBadge"] = "showLiveboardVerifiedBadge";
2499
+ Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
2500
+ Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
2438
2501
  })(Param || (Param = {}));
2439
2502
  (function (Action) {
2440
2503
  /**
@@ -3330,7 +3393,7 @@
3330
3393
  *
3331
3394
  * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
3332
3395
  */
3333
- Action["CreateLiveboard"] = "CreateLiveboard";
3396
+ Action["CreateLiveboard"] = "createLiveboard";
3334
3397
  /**
3335
3398
  * Action ID for to hide Verified Liveboard Banner
3336
3399
  * @example
@@ -3421,6 +3484,16 @@
3421
3484
  * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3422
3485
  */
3423
3486
  Action["UnsubscribeScheduleHomepage"] = "unsubscribeScheduleHomepage";
3487
+ /**
3488
+ * The **Manage Tags** action on Homepage Favourite Module.
3489
+ *
3490
+ * @example
3491
+ * ```js
3492
+ * disabledActions: [Action.ManageTags]
3493
+ * ```
3494
+ * @version SDK : 1.34.0 | Thoughtspot: 10.3.0.cl
3495
+ */
3496
+ Action["ManageTags"] = "manageTags";
3424
3497
  /**
3425
3498
  * Action ID for delete schedule action on schedule on homepage
3426
3499
  * @example
@@ -6044,7 +6117,11 @@
6044
6117
  const tokenizedFetch = async (input, init) => {
6045
6118
  const embedConfig = getEmbedConfig();
6046
6119
  if (embedConfig.authType !== exports.AuthType.TrustedAuthTokenCookieless) {
6047
- return fetch(input, init);
6120
+ return fetch(input, {
6121
+ // ensure cookies are included for the non cookie-less api calls.
6122
+ credentials: 'include',
6123
+ ...init,
6124
+ });
6048
6125
  }
6049
6126
  const req = new Request(input, init);
6050
6127
  const authToken = await getAuthenticationToken(embedConfig);
@@ -6253,7 +6330,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6253
6330
  isDiscoverable
6254
6331
  isHidden
6255
6332
  modifiedAt
6256
- tags
6257
6333
  }
6258
6334
  visualizations {
6259
6335
  ... on TableViz {
@@ -6298,6 +6374,14 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6298
6374
  }
6299
6375
  }
6300
6376
  }
6377
+ `;
6378
+ const getSQLQuery = `
6379
+ mutation GetSQLQuery($session: BachSessionIdInput!) {
6380
+ Answer__getQuery(session: $session) {
6381
+ ${bachSessionId}
6382
+ sql
6383
+ }
6384
+ }
6301
6385
  `;
6302
6386
 
6303
6387
  // eslint-disable-next-line no-shadow
@@ -6429,6 +6513,10 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6429
6513
  },
6430
6514
  });
6431
6515
  }
6516
+ async getSQLQuery() {
6517
+ const { sql } = await this.executeQuery(getSQLQuery, {});
6518
+ return sql;
6519
+ }
6432
6520
  /**
6433
6521
  * Fetch data from the answer.
6434
6522
  * @param offset
@@ -6463,6 +6551,20 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6463
6551
  credentials: 'include',
6464
6552
  });
6465
6553
  }
6554
+ /**
6555
+ * Fetch the data for the answer as a PNG blob. This might be
6556
+ * quicker for larger data.
6557
+ * @param userLocale
6558
+ * @param omitBackground Omit the background in the PNG
6559
+ * @param deviceScaleFactor The scale factor for the PNG
6560
+ * @return Response
6561
+ */
6562
+ async fetchPNGBlob(userLocale = 'en-us', omitBackground = false, deviceScaleFactor = 2) {
6563
+ const fetchUrl = this.getFetchPNGBlobUrl(userLocale, omitBackground, deviceScaleFactor);
6564
+ return tokenizedFetch(fetchUrl, {
6565
+ credentials: 'include',
6566
+ });
6567
+ }
6466
6568
  /**
6467
6569
  * Just get the internal URL for this answer's data
6468
6570
  * as a CSV blob.
@@ -6473,6 +6575,13 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6473
6575
  getFetchCSVBlobUrl(userLocale = 'en-us', includeInfo = false) {
6474
6576
  return `${this.thoughtSpotHost}/prism/download/answer/csv?sessionId=${this.session.sessionId}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data&hideCsvHeader=${!includeInfo}`;
6475
6577
  }
6578
+ /**
6579
+ * Just get the internal URL for this answer's data
6580
+ * as a PNG blob.
6581
+ */
6582
+ getFetchPNGBlobUrl(userLocale = 'en-us', omitBackground = false, deviceScaleFactor = 2) {
6583
+ return `${this.thoughtSpotHost}/prism/download/answer/png?sessionId=${this.session.sessionId}&deviceScaleFactor=${deviceScaleFactor}&omitBackground=${omitBackground}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data`;
6584
+ }
6476
6585
  /**
6477
6586
  * Get underlying data given a point and the output column names.
6478
6587
  * In case of a context menu action, the selectedPoints are
@@ -6679,7 +6788,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
6679
6788
 
6680
6789
  var Config = {
6681
6790
  DEBUG: false,
6682
- LIB_VERSION: '2.45.0'
6791
+ LIB_VERSION: '2.47.0'
6683
6792
  };
6684
6793
 
6685
6794
  // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
@@ -7509,20 +7618,24 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
7509
7618
 
7510
7619
  _.UUID = (function() {
7511
7620
 
7512
- // Time/ticks information
7513
- // 1*new Date() is a cross browser version of Date.now()
7621
+ // Time-based entropy
7514
7622
  var T = function() {
7515
- var d = 1 * new Date(),
7516
- i = 0;
7517
-
7518
- // this while loop figures how many browser ticks go by
7519
- // before 1*new Date() returns a new number, ie the amount
7520
- // of ticks that go by per millisecond
7521
- while (d == 1 * new Date()) {
7522
- i++;
7623
+ var time = 1 * new Date(); // cross-browser version of Date.now()
7624
+ var ticks;
7625
+ if (window$1.performance && window$1.performance.now) {
7626
+ ticks = window$1.performance.now();
7627
+ } else {
7628
+ // fall back to busy loop
7629
+ ticks = 0;
7630
+
7631
+ // this while loop figures how many browser ticks go by
7632
+ // before 1*new Date() returns a new number, ie the amount
7633
+ // of ticks that go by per millisecond
7634
+ while (time == 1 * new Date()) {
7635
+ ticks++;
7636
+ }
7523
7637
  }
7524
-
7525
- return d.toString(16) + i.toString(16);
7638
+ return time.toString(16) + Math.floor(ticks).toString(16);
7526
7639
  };
7527
7640
 
7528
7641
  // Math.Random entropy
@@ -8089,21 +8202,42 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
8089
8202
  };
8090
8203
  })();
8091
8204
 
8205
+ var CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
8206
+ var CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'ttclid', 'twclid', 'wbraid'];
8207
+
8092
8208
  _.info = {
8093
- campaignParams: function() {
8094
- var campaign_keywords = 'utm_source utm_medium utm_campaign utm_content utm_term'.split(' '),
8095
- kw = '',
8209
+ campaignParams: function(default_value) {
8210
+ var kw = '',
8096
8211
  params = {};
8097
- _.each(campaign_keywords, function(kwkey) {
8212
+ _.each(CAMPAIGN_KEYWORDS, function(kwkey) {
8098
8213
  kw = _.getQueryParam(document$1.URL, kwkey);
8099
8214
  if (kw.length) {
8100
8215
  params[kwkey] = kw;
8216
+ } else if (default_value !== undefined) {
8217
+ params[kwkey] = default_value;
8101
8218
  }
8102
8219
  });
8103
8220
 
8104
8221
  return params;
8105
8222
  },
8106
8223
 
8224
+ clickParams: function() {
8225
+ var id = '',
8226
+ params = {};
8227
+ _.each(CLICK_IDS, function(idkey) {
8228
+ id = _.getQueryParam(document$1.URL, idkey);
8229
+ if (id.length) {
8230
+ params[idkey] = id;
8231
+ }
8232
+ });
8233
+
8234
+ return params;
8235
+ },
8236
+
8237
+ marketingParams: function() {
8238
+ return _.extend(_.info.campaignParams(), _.info.clickParams());
8239
+ },
8240
+
8107
8241
  searchEngine: function(referrer) {
8108
8242
  if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {
8109
8243
  return 'google';
@@ -8300,12 +8434,13 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
8300
8434
  });
8301
8435
  },
8302
8436
 
8303
- pageviewInfo: function(page) {
8437
+ mpPageViewProperties: function() {
8304
8438
  return _.strip_empty_properties({
8305
- 'mp_page': page,
8306
- 'mp_referrer': document$1.referrer,
8307
- 'mp_browser': _.info.browser(userAgent, navigator.vendor, windowOpera),
8308
- 'mp_platform': _.info.os()
8439
+ 'current_page_title': document$1.title,
8440
+ 'current_domain': window$1.location.hostname,
8441
+ 'current_url_path': window$1.location.pathname,
8442
+ 'current_url_protocol': window$1.location.protocol,
8443
+ 'current_url_search': window$1.location.search
8309
8444
  });
8310
8445
  }
8311
8446
  };
@@ -8972,6 +9107,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
8972
9107
 
8973
9108
  this.stopped = !this.libConfig['batch_autostart'];
8974
9109
  this.consecutiveRemovalFailures = 0;
9110
+
9111
+ // extra client-side dedupe
9112
+ this.itemIdsSentSuccessfully = {};
8975
9113
  };
8976
9114
 
8977
9115
  /**
@@ -9064,7 +9202,34 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
9064
9202
  payload = this.beforeSendHook(payload);
9065
9203
  }
9066
9204
  if (payload) {
9067
- dataForRequest.push(payload);
9205
+ // mp_sent_by_lib_version prop captures which lib version actually
9206
+ // sends each event (regardless of which version originally queued
9207
+ // it for sending)
9208
+ if (payload['event'] && payload['properties']) {
9209
+ payload['properties'] = _.extend(
9210
+ {},
9211
+ payload['properties'],
9212
+ {'mp_sent_by_lib_version': Config.LIB_VERSION}
9213
+ );
9214
+ }
9215
+ var addPayload = true;
9216
+ var itemId = item['id'];
9217
+ if (itemId) {
9218
+ if ((this.itemIdsSentSuccessfully[itemId] || 0) > 5) {
9219
+ this.reportError('[dupe] item ID sent too many times, not sending', {
9220
+ item: item,
9221
+ batchSize: batch.length,
9222
+ timesSent: this.itemIdsSentSuccessfully[itemId]
9223
+ });
9224
+ addPayload = false;
9225
+ }
9226
+ } else {
9227
+ this.reportError('[dupe] found item with no ID', {item: item});
9228
+ }
9229
+
9230
+ if (addPayload) {
9231
+ dataForRequest.push(payload);
9232
+ }
9068
9233
  }
9069
9234
  transformedItems[item['id']] = payload;
9070
9235
  }, this);
@@ -9147,6 +9312,24 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
9147
9312
  }
9148
9313
  }, this)
9149
9314
  );
9315
+
9316
+ // client-side dedupe
9317
+ _.each(batch, _.bind(function(item) {
9318
+ var itemId = item['id'];
9319
+ if (itemId) {
9320
+ this.itemIdsSentSuccessfully[itemId] = this.itemIdsSentSuccessfully[itemId] || 0;
9321
+ this.itemIdsSentSuccessfully[itemId]++;
9322
+ if (this.itemIdsSentSuccessfully[itemId] > 5) {
9323
+ this.reportError('[dupe] item ID sent too many times', {
9324
+ item: item,
9325
+ batchSize: batch.length,
9326
+ timesSent: this.itemIdsSentSuccessfully[itemId]
9327
+ });
9328
+ }
9329
+ } else {
9330
+ this.reportError('[dupe] found item with no ID while removing', {item: item});
9331
+ }
9332
+ }, this));
9150
9333
  }
9151
9334
 
9152
9335
  } catch(err) {
@@ -9992,24 +10175,25 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
9992
10175
  });
9993
10176
 
9994
10177
  /*
9995
- * Record that you have charged the current user a certain amount
9996
- * of money. Charges recorded with track_charge() will appear in the
9997
- * Mixpanel revenue report.
9998
- *
9999
- * ### Usage:
10000
- *
10001
- * // charge a user $50
10002
- * mixpanel.people.track_charge(50);
10003
- *
10004
- * // charge a user $30.50 on the 2nd of january
10005
- * mixpanel.people.track_charge(30.50, {
10006
- * '$time': new Date('jan 1 2012')
10007
- * });
10008
- *
10009
- * @param {Number} amount The amount of money charged to the current user
10010
- * @param {Object} [properties] An associative array of properties associated with the charge
10011
- * @param {Function} [callback] If provided, the callback will be called when the server responds
10012
- */
10178
+ * Record that you have charged the current user a certain amount
10179
+ * of money. Charges recorded with track_charge() will appear in the
10180
+ * Mixpanel revenue report.
10181
+ *
10182
+ * ### Usage:
10183
+ *
10184
+ * // charge a user $50
10185
+ * mixpanel.people.track_charge(50);
10186
+ *
10187
+ * // charge a user $30.50 on the 2nd of january
10188
+ * mixpanel.people.track_charge(30.50, {
10189
+ * '$time': new Date('jan 1 2012')
10190
+ * });
10191
+ *
10192
+ * @param {Number} amount The amount of money charged to the current user
10193
+ * @param {Object} [properties] An associative array of properties associated with the charge
10194
+ * @param {Function} [callback] If provided, the callback will be called when the server responds
10195
+ * @deprecated
10196
+ */
10013
10197
  MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {
10014
10198
  if (!_.isNumber(amount)) {
10015
10199
  amount = parseFloat(amount);
@@ -10025,15 +10209,16 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10025
10209
  });
10026
10210
 
10027
10211
  /*
10028
- * Permanently clear all revenue report transactions from the
10029
- * current user's people analytics profile.
10030
- *
10031
- * ### Usage:
10032
- *
10033
- * mixpanel.people.clear_charges();
10034
- *
10035
- * @param {Function} [callback] If provided, the callback will be called after tracking the event.
10036
- */
10212
+ * Permanently clear all revenue report transactions from the
10213
+ * current user's people analytics profile.
10214
+ *
10215
+ * ### Usage:
10216
+ *
10217
+ * mixpanel.people.clear_charges();
10218
+ *
10219
+ * @param {Function} [callback] If provided, the callback will be called after tracking the event.
10220
+ * @deprecated
10221
+ */
10037
10222
  MixpanelPeople.prototype.clear_charges = function(callback) {
10038
10223
  return this.set('$transactions', [], callback);
10039
10224
  };
@@ -10433,13 +10618,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10433
10618
  }
10434
10619
  };
10435
10620
 
10436
- MixpanelPersistence.prototype.update_campaign_params = function() {
10437
- if (!this.campaign_params_saved) {
10438
- this.register_once(_.info.campaignParams());
10439
- this.campaign_params_saved = true;
10440
- }
10441
- };
10442
-
10443
10621
  MixpanelPersistence.prototype.update_search_keyword = function(referrer) {
10444
10622
  this.register(_.info.searchInfo(referrer));
10445
10623
  };
@@ -10722,6 +10900,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10722
10900
  /** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel';
10723
10901
  /** @const */ var PAYLOAD_TYPE_BASE64 = 'base64';
10724
10902
  /** @const */ var PAYLOAD_TYPE_JSON = 'json';
10903
+ /** @const */ var DEVICE_ID_PREFIX = '$device:';
10725
10904
 
10726
10905
 
10727
10906
  /*
@@ -10763,6 +10942,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10763
10942
  'cookie_domain': '',
10764
10943
  'cookie_name': '',
10765
10944
  'loaded': NOOP_FUNC,
10945
+ 'track_marketing': true,
10946
+ 'track_pageview': false,
10947
+ 'skip_first_touch_marketing': false,
10766
10948
  'store_google': true,
10767
10949
  'save_referrer': true,
10768
10950
  'test': false,
@@ -10829,6 +11011,25 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10829
11011
  instance['people'] = new MixpanelPeople();
10830
11012
  instance['people']._init(instance);
10831
11013
 
11014
+ if (!instance.get_config('skip_first_touch_marketing')) {
11015
+ // We need null UTM params in the object because
11016
+ // UTM parameters act as a tuple. If any UTM param
11017
+ // is present, then we set all UTM params including
11018
+ // empty ones together
11019
+ var utm_params = _.info.campaignParams(null);
11020
+ var initial_utm_params = {};
11021
+ var has_utm = false;
11022
+ _.each(utm_params, function(utm_value, utm_key) {
11023
+ initial_utm_params['initial_' + utm_key] = utm_value;
11024
+ if (utm_value) {
11025
+ has_utm = true;
11026
+ }
11027
+ });
11028
+ if (has_utm) {
11029
+ instance['people'].set_once(initial_utm_params);
11030
+ }
11031
+ }
11032
+
10832
11033
  // if any instance on the page has debug = true, we set the
10833
11034
  // global debug to be true
10834
11035
  Config.DEBUG = Config.DEBUG || instance.get_config('debug');
@@ -10860,7 +11061,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10860
11061
  * mixpanel.library_name.track(...);
10861
11062
  *
10862
11063
  * @param {String} token Your Mixpanel API token
10863
- * @param {Object} [config] A dictionary of config options to override. <a href="https://github.com/mixpanel/mixpanel-js/blob/8b2e1f7b/src/mixpanel-core.js#L87-L110">See a list of default config options</a>.
11064
+ * @param {Object} [config] A dictionary of config options to override. <a href="https://github.com/mixpanel/mixpanel-js/blob/v2.46.0/src/mixpanel-core.js#L88-L127">See a list of default config options</a>.
10864
11065
  * @param {String} [name] The name for the new mixpanel instance that you want created
10865
11066
  */
10866
11067
  MixpanelLib.prototype.init = function (token, config, name) {
@@ -10898,7 +11099,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10898
11099
  // default to JSON payload for standard mixpanel.com API hosts
10899
11100
  if (!('api_payload_format' in config)) {
10900
11101
  var api_host = config['api_host'] || DEFAULT_CONFIG['api_host'];
10901
- if (api_host.match(/\.mixpanel\.com$/)) {
11102
+ if (api_host.match(/\.mixpanel\.com/)) {
10902
11103
  variable_features['api_payload_format'] = PAYLOAD_TYPE_JSON;
10903
11104
  }
10904
11105
  }
@@ -10969,10 +11170,14 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10969
11170
  // or the device id if something was already stored
10970
11171
  // in the persitence
10971
11172
  this.register_once({
10972
- 'distinct_id': uuid,
11173
+ 'distinct_id': DEVICE_ID_PREFIX + uuid,
10973
11174
  '$device_id': uuid
10974
11175
  }, '');
10975
11176
  }
11177
+
11178
+ if (this.get_config('track_pageview')) {
11179
+ this.track_pageview();
11180
+ }
10976
11181
  };
10977
11182
 
10978
11183
  // Private methods
@@ -10986,7 +11191,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
10986
11191
  MixpanelLib.prototype._set_default_superprops = function() {
10987
11192
  this['persistence'].update_search_keyword(document$1.referrer);
10988
11193
  if (this.get_config('store_google')) {
10989
- this['persistence'].update_campaign_params();
11194
+ this.register(_.info.campaignParams(), {persistent: false});
10990
11195
  }
10991
11196
  if (this.get_config('save_referrer')) {
10992
11197
  this['persistence'].update_referrer_info(document$1.referrer);
@@ -11468,6 +11673,10 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11468
11673
 
11469
11674
  this._set_default_superprops();
11470
11675
 
11676
+ var marketing_properties = this.get_config('track_marketing')
11677
+ ? _.info.marketingParams()
11678
+ : {};
11679
+
11471
11680
  // note: extend writes to the first object, so lets make sure we
11472
11681
  // don't write to the persistence properties object and info
11473
11682
  // properties object by passing in a new object
@@ -11476,6 +11685,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11476
11685
  properties = _.extend(
11477
11686
  {},
11478
11687
  _.info.properties(),
11688
+ marketing_properties,
11479
11689
  this['persistence'].properties(),
11480
11690
  this.unpersisted_superprops,
11481
11691
  properties
@@ -11636,17 +11846,54 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11636
11846
  };
11637
11847
 
11638
11848
  /**
11639
- * Track mp_page_view event. This is now ignored by the server.
11849
+ * Track a default Mixpanel page view event, which includes extra default event properties to
11850
+ * improve page view data. The `config.track_pageview` option for <a href="#mixpanelinit">mixpanel.init()</a>
11851
+ * may be turned on for tracking page loads automatically.
11640
11852
  *
11641
- * @param {String} [page] The url of the page to record. If you don't include this, it defaults to the current url.
11642
- * @deprecated
11853
+ * ### Usage
11854
+ *
11855
+ * // track a default $mp_web_page_view event
11856
+ * mixpanel.track_pageview();
11857
+ *
11858
+ * // track a page view event with additional event properties
11859
+ * mixpanel.track_pageview({'ab_test_variant': 'card-layout-b'});
11860
+ *
11861
+ * // example approach to track page views on different page types as event properties
11862
+ * mixpanel.track_pageview({'page': 'pricing'});
11863
+ * mixpanel.track_pageview({'page': 'homepage'});
11864
+ *
11865
+ * // UNCOMMON: Tracking a page view event with a custom event_name option. NOT expected to be used for
11866
+ * // individual pages on the same site or product. Use cases for custom event_name may be page
11867
+ * // views on different products or internal applications that are considered completely separate
11868
+ * mixpanel.track_pageview({'page': 'customer-search'}, {'event_name': '[internal] Admin Page View'});
11869
+ *
11870
+ * @param {Object} [properties] An optional set of additional properties to send with the page view event
11871
+ * @param {Object} [options] Page view tracking options
11872
+ * @param {String} [options.event_name] - Alternate name for the tracking event
11873
+ * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object
11874
+ * with the tracking payload sent to the API server is returned; otherwise false.
11643
11875
  */
11644
- MixpanelLib.prototype.track_pageview = function(page) {
11645
- if (_.isUndefined(page)) {
11646
- page = document$1.location.href;
11876
+ MixpanelLib.prototype.track_pageview = addOptOutCheckMixpanelLib(function(properties, options) {
11877
+ if (typeof properties !== 'object') {
11878
+ properties = {};
11647
11879
  }
11648
- this.track('mp_page_view', _.info.pageviewInfo(page));
11649
- };
11880
+ options = options || {};
11881
+ var event_name = options['event_name'] || '$mp_web_page_view';
11882
+
11883
+ var default_page_properties = _.extend(
11884
+ _.info.mpPageViewProperties(),
11885
+ _.info.campaignParams(),
11886
+ _.info.clickParams()
11887
+ );
11888
+
11889
+ var event_properties = _.extend(
11890
+ {},
11891
+ default_page_properties,
11892
+ properties
11893
+ );
11894
+
11895
+ return this.track(event_name, event_properties);
11896
+ });
11650
11897
 
11651
11898
  /**
11652
11899
  * Track clicks on a set of document elements. Selector must be a
@@ -11895,7 +12142,15 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11895
12142
  // _unset_callback:function A callback to be run if and when the People unset queue is flushed
11896
12143
 
11897
12144
  var previous_distinct_id = this.get_distinct_id();
11898
- this.register({'$user_id': new_distinct_id});
12145
+ if (new_distinct_id && previous_distinct_id !== new_distinct_id) {
12146
+ // we allow the following condition if previous distinct_id is same as new_distinct_id
12147
+ // so that you can force flush people updates for anonymous profiles.
12148
+ if (typeof new_distinct_id === 'string' && new_distinct_id.indexOf(DEVICE_ID_PREFIX) === 0) {
12149
+ this.report_error('distinct_id cannot have $device: prefix');
12150
+ return -1;
12151
+ }
12152
+ this.register({'$user_id': new_distinct_id});
12153
+ }
11899
12154
 
11900
12155
  if (!this.get_property('$device_id')) {
11901
12156
  // The persisted distinct id might not actually be a device id at all
@@ -11936,7 +12191,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
11936
12191
  this._flags.identify_called = false;
11937
12192
  var uuid = _.UUID();
11938
12193
  this.register_once({
11939
- 'distinct_id': uuid,
12194
+ 'distinct_id': DEVICE_ID_PREFIX + uuid,
11940
12195
  '$device_id': uuid
11941
12196
  }, '');
11942
12197
  };
@@ -12061,8 +12316,8 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12061
12316
  * // batching or retry mechanisms.
12062
12317
  * api_transport: 'XHR'
12063
12318
  *
12064
- * // turn on request-batching/queueing/retry
12065
- * batch_requests: false,
12319
+ * // request-batching/queueing/retry
12320
+ * batch_requests: true,
12066
12321
  *
12067
12322
  * // maximum number of events/updates to send in a single
12068
12323
  * // network request
@@ -12134,10 +12389,20 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12134
12389
  * // secure, meaning they will only be transmitted over https
12135
12390
  * secure_cookie: false
12136
12391
  *
12392
+ * // disables enriching user profiles with first touch marketing data
12393
+ * skip_first_touch_marketing: false
12394
+ *
12137
12395
  * // the amount of time track_links will
12138
12396
  * // wait for Mixpanel's servers to respond
12139
12397
  * track_links_timeout: 300
12140
12398
  *
12399
+ * // adds any UTM parameters and click IDs present on the page to any events fired
12400
+ * track_marketing: true
12401
+ *
12402
+ * // enables automatic page view tracking using default page view events through
12403
+ * // the track_pageview() method
12404
+ * track_pageview: false
12405
+ *
12141
12406
  * // if you set upgrade to be true, the library will check for
12142
12407
  * // a cookie from our old js library and import super
12143
12408
  * // properties from it, then the old cookie is deleted
@@ -12662,6 +12927,10 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
12662
12927
  // Needed to avoid error in CJS builds on some bundlers.
12663
12928
  const mixpanelLib = mixpanel_cjs || mixpanel$1;
12664
12929
  let mixpanelInstance;
12930
+ /**
12931
+ * Enum of mixpanel events
12932
+ * @hidden
12933
+ */
12665
12934
  const MIXPANEL_EVENT = {
12666
12935
  VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
12667
12936
  VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
@@ -13793,22 +14062,23 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
13793
14062
  /**
13794
14063
  * Imports TML representation of the metadata objects into ThoughtSpot.
13795
14064
  * @param data
14065
+ * @returns imports TML data into ThoughtSpot
13796
14066
  * @example
13797
14067
  * ```js
13798
- * executeTML({
13799
- * //Array of metadata Tmls
13800
- metadata_tmls: [
13801
- "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
13802
- \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
13803
- ],
13804
- import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
13805
- create_new: false, // If selected, creates TML objects with new GUIDs.
13806
- }).then(result => {
13807
- console.log(result);
13808
- }).catch(error => {
13809
- console.error(error);
13810
- });
13811
- *
14068
+ * executeTML({
14069
+ * //Array of metadata Tmls in string format
14070
+ * metadata_tmls: [
14071
+ * "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
14072
+ * \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
14073
+ * ],
14074
+ * import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
14075
+ * create_new: false, // If selected, creates TML objects with new GUIDs.
14076
+ * }).then(result => {
14077
+ * console.log(result);
14078
+ * }).catch(error => {
14079
+ * console.error(error);
14080
+ * });
14081
+ *```
13812
14082
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
13813
14083
  * @group Global methods
13814
14084
  */
@@ -13849,27 +14119,28 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
13849
14119
  * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
13850
14120
  * format.
13851
14121
  * @param data
14122
+ * @returns exports TML data
13852
14123
  * @example
13853
14124
  * ```js
13854
- exportTML({
13855
- metadata: [
13856
- {
13857
- type: "LIVEBOARD", //Metadata Type
13858
- identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
13859
- }
13860
- ],
13861
- export_associated: false,//indicates whether to export associated metadata objects
13862
- export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
13863
- //exporting a Liveboard and its associated objects, the API
13864
- //returns the Liveboard TML data with the FQNs of the referenced
13865
- //worksheet. If the exported TML data includes FQNs, you don't need
13866
- //to manually add FQNs of the referenced objects during TML import.
13867
- edoc_format: "JSON" //It takes JSON or YAML value
13868
- }).then(result => {
13869
- console.log(result);
13870
- }).catch(error => {
13871
- console.error(error);
13872
- });
14125
+ * exportTML({
14126
+ * metadata: [
14127
+ * {
14128
+ * type: "LIVEBOARD", //Metadata Type
14129
+ * identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
14130
+ * }
14131
+ * ],
14132
+ * export_associated: false,//indicates whether to export associated metadata objects
14133
+ * export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
14134
+ * //exporting a Liveboard and its associated objects, the API
14135
+ * //returns the Liveboard TML data with the FQNs of the referenced
14136
+ * //worksheet. If the exported TML data includes FQNs, you don't need
14137
+ * //to manually add FQNs of the referenced objects during TML import.
14138
+ * edoc_format: "JSON" //It takes JSON or YAML value
14139
+ * }).then(result => {
14140
+ * console.log(result);
14141
+ * }).catch(error => {
14142
+ * console.error(error);
14143
+ * });
13873
14144
  * ```
13874
14145
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
13875
14146
  * @group Global methods
@@ -13963,8 +14234,8 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
13963
14234
  * @param containerEl
13964
14235
  */
13965
14236
  function processAuthFailure(e, containerEl) {
13966
- const { loginFailedMessage, authType } = getEmbedConfig();
13967
- if (authType !== exports.AuthType.None) {
14237
+ const { loginFailedMessage, authType, disableLoginFailurePage } = getEmbedConfig();
14238
+ if (authType !== exports.AuthType.None && !disableLoginFailurePage) {
13968
14239
  // eslint-disable-next-line no-param-reassign
13969
14240
  containerEl.innerHTML = loginFailedMessage;
13970
14241
  notifyAuthFailure(exports.AuthFailureType.OTHER);
@@ -14065,7 +14336,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14065
14336
  });
14066
14337
  }
14067
14338
 
14068
- var name="@thoughtspot/visual-embed-sdk";var version="1.33.0-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
14339
+ var name="@thoughtspot/visual-embed-sdk";var version="1.33.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"49 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};
14069
14340
 
14070
14341
  /**
14071
14342
  * Copyright (c) 2022
@@ -14337,7 +14608,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14337
14608
  * @returns queryParams
14338
14609
  */
14339
14610
  getBaseQueryParams(queryParams = {}) {
14340
- var _a, _b, _c, _d;
14611
+ var _a, _b, _c;
14341
14612
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
14342
14613
  // The below check is needed because TS Cloud firewall, blocks
14343
14614
  // localhost/127.0.0.1 in any url param.
@@ -14380,11 +14651,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14380
14651
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
14381
14652
  return queryParams;
14382
14653
  }
14383
- // TODO remove embedConfig.customCssUrl
14384
- const cssUrlParam = ((_c = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) || this.embedConfig.customCssUrl;
14385
- if (cssUrlParam) {
14386
- queryParams[Param.CustomCSSUrl] = cssUrlParam;
14387
- }
14388
14654
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
14389
14655
  queryParams[Param.DisableActions] = disabledActions;
14390
14656
  }
@@ -14413,7 +14679,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14413
14679
  queryParams[Param.ContextMenuTrigger] = false;
14414
14680
  }
14415
14681
  const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl)
14416
- || ((_d = this.embedConfig.customizations) === null || _d === void 0 ? void 0 : _d.iconSpriteUrl);
14682
+ || ((_c = this.embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.iconSpriteUrl);
14417
14683
  if (spriteUrl) {
14418
14684
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
14419
14685
  }
@@ -14423,9 +14689,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14423
14689
  if (locale !== undefined) {
14424
14690
  queryParams[Param.Locale] = locale;
14425
14691
  }
14426
- if (additionalFlags && additionalFlags.constructor.name === 'Object') {
14427
- Object.assign(queryParams, additionalFlags);
14428
- }
14429
14692
  if (linkOverride) {
14430
14693
  queryParams[Param.LinkOverride] = linkOverride;
14431
14694
  }
@@ -14437,6 +14700,11 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14437
14700
  }
14438
14701
  queryParams[Param.OverrideNativeConsole] = true;
14439
14702
  queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
14703
+ if (additionalFlags && additionalFlags.constructor.name === 'Object') {
14704
+ Object.assign(queryParams, additionalFlags);
14705
+ }
14706
+ // Do not add any flags below this, as we want additional flags to
14707
+ // override other flags
14440
14708
  return queryParams;
14441
14709
  }
14442
14710
  /**
@@ -15030,7 +15298,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15030
15298
  * @version SDK: 1.25.0 / ThoughtSpot 9.10.0
15031
15299
  */
15032
15300
  async getAnswerService(vizId) {
15033
- const { session } = await this.trigger(exports.HostEvent.GetAnswerSession, vizId);
15301
+ const { session } = await this.trigger(exports.HostEvent.GetAnswerSession, vizId ? { vizId } : {});
15034
15302
  return new AnswerService(session, null, this.embedConfig.thoughtSpotHost);
15035
15303
  }
15036
15304
  }
@@ -15045,7 +15313,6 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15045
15313
  super(domSelector, viewConfig);
15046
15314
  /**
15047
15315
  * Only for testing purposes.
15048
- *
15049
15316
  * @hidden
15050
15317
  */
15051
15318
  // eslint-disable-next-line camelcase
@@ -15137,6 +15404,10 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15137
15404
  * SpotIQ listing page
15138
15405
  */
15139
15406
  Page["SpotIQ"] = "insights";
15407
+ /**
15408
+ * Monitor Alerts Page
15409
+ */
15410
+ Page["Monitor"] = "monitor";
15140
15411
  })(exports.Page || (exports.Page = {}));
15141
15412
  /**
15142
15413
  * Define the initial state os column custom group accordions
@@ -15205,7 +15476,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15205
15476
  getEmbedParams() {
15206
15477
  const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
15207
15478
  /* eslint-disable-next-line max-len */
15208
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, homePageSearchBarMode, } = this.viewConfig;
15479
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, homePageSearchBarMode, } = this.viewConfig;
15209
15480
  let params = {};
15210
15481
  params[Param.EmbedApp] = true;
15211
15482
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
@@ -15217,6 +15488,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15217
15488
  params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
15218
15489
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
15219
15490
  params[Param.IsFullAppEmbed] = true;
15491
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
15492
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
15493
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
15220
15494
  params = this.getBaseQueryParams(params);
15221
15495
  if (fullHeight === true) {
15222
15496
  params[Param.fullHeight] = true;
@@ -15296,6 +15570,8 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15296
15570
  return 'data/tables';
15297
15571
  case exports.Page.SpotIQ:
15298
15572
  return modularHomeExperience ? 'home/spotiq-analysis' : 'insights/results';
15573
+ case exports.Page.Monitor:
15574
+ return modularHomeExperience ? 'home/monitor-alerts' : 'insights/monitor-alerts';
15299
15575
  case exports.Page.Home:
15300
15576
  default:
15301
15577
  return 'home';
@@ -15487,7 +15763,7 @@ query GetEurekaVizSnapshots(
15487
15763
  let params = {};
15488
15764
  params[Param.EmbedApp] = true;
15489
15765
  params = this.getBaseQueryParams(params);
15490
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, enableAskSage, enable2ColumnLayout, } = this.viewConfig;
15766
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, } = this.viewConfig;
15491
15767
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
15492
15768
  || this.viewConfig.preventPinboardFilterRemoval;
15493
15769
  if (fullHeight === true) {
@@ -15531,6 +15807,11 @@ query GetEurekaVizSnapshots(
15531
15807
  params[Param.enableAskSage] = enableAskSage;
15532
15808
  }
15533
15809
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
15810
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
15811
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
15812
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
15813
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
15814
+ params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
15534
15815
  const queryParams = getQueryParamString(params, true);
15535
15816
  return queryParams;
15536
15817
  }