@thoughtspot/visual-embed-sdk 1.35.11 → 1.35.13

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 (143) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +3 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts.map +1 -1
  7. package/cjs/src/embed/app.js +2 -0
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/conversation.d.ts +44 -0
  10. package/cjs/src/embed/conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/conversation.js +10 -1
  12. package/cjs/src/embed/conversation.js.map +1 -1
  13. package/cjs/src/embed/conversation.spec.js +36 -0
  14. package/cjs/src/embed/conversation.spec.js.map +1 -1
  15. package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
  16. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  17. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  18. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -1
  19. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  20. package/cjs/src/embed/liveboard.d.ts +5 -4
  21. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  22. package/cjs/src/embed/liveboard.js +11 -4
  23. package/cjs/src/embed/liveboard.js.map +1 -1
  24. package/cjs/src/embed/liveboard.spec.js +1 -1
  25. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  26. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  27. package/cjs/src/embed/search-bar.js +4 -2
  28. package/cjs/src/embed/search-bar.js.map +1 -1
  29. package/cjs/src/embed/search.d.ts.map +1 -1
  30. package/cjs/src/embed/search.js +4 -2
  31. package/cjs/src/embed/search.js.map +1 -1
  32. package/cjs/src/embed/search.spec.js +56 -3
  33. package/cjs/src/embed/search.spec.js.map +1 -1
  34. package/cjs/src/embed/ts-embed.d.ts +6 -0
  35. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  36. package/cjs/src/embed/ts-embed.js +43 -15
  37. package/cjs/src/embed/ts-embed.js.map +1 -1
  38. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  39. package/cjs/src/embed/ts-embed.spec.js +193 -81
  40. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  41. package/cjs/src/types.d.ts +85 -20
  42. package/cjs/src/types.d.ts.map +1 -1
  43. package/cjs/src/types.js +80 -9
  44. package/cjs/src/types.js.map +1 -1
  45. package/cjs/src/utils/processData.d.ts.map +1 -1
  46. package/cjs/src/utils/processData.js +9 -2
  47. package/cjs/src/utils/processData.js.map +1 -1
  48. package/cjs/src/utils/processData.spec.js +51 -0
  49. package/cjs/src/utils/processData.spec.js.map +1 -1
  50. package/dist/index-B3hd6DTM.js +7370 -0
  51. package/dist/index-D-9WUCUl.js +7370 -0
  52. package/dist/src/auth.d.ts +2 -1
  53. package/dist/src/auth.d.ts.map +1 -1
  54. package/dist/src/embed/app.d.ts.map +1 -1
  55. package/dist/src/embed/conversation.d.ts +44 -0
  56. package/dist/src/embed/conversation.d.ts.map +1 -1
  57. package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
  58. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  59. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  60. package/dist/src/embed/liveboard.d.ts +5 -4
  61. package/dist/src/embed/liveboard.d.ts.map +1 -1
  62. package/dist/src/embed/search-bar.d.ts.map +1 -1
  63. package/dist/src/embed/search.d.ts.map +1 -1
  64. package/dist/src/embed/ts-embed.d.ts +6 -0
  65. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  66. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  67. package/dist/src/types.d.ts +85 -20
  68. package/dist/src/types.d.ts.map +1 -1
  69. package/dist/src/utils/processData.d.ts.map +1 -1
  70. package/dist/tsembed-react.es.js +175 -40
  71. package/dist/tsembed-react.js +174 -39
  72. package/dist/tsembed.es.js +175 -40
  73. package/dist/tsembed.js +174 -39
  74. package/dist/visual-embed-sdk-react-full.d.ts +138 -27
  75. package/dist/visual-embed-sdk-react.d.ts +138 -27
  76. package/dist/visual-embed-sdk.d.ts +138 -27
  77. package/lib/package.json +1 -1
  78. package/lib/src/auth.d.ts +2 -1
  79. package/lib/src/auth.d.ts.map +1 -1
  80. package/lib/src/auth.js +3 -1
  81. package/lib/src/auth.js.map +1 -1
  82. package/lib/src/embed/app.d.ts.map +1 -1
  83. package/lib/src/embed/app.js +2 -0
  84. package/lib/src/embed/app.js.map +1 -1
  85. package/lib/src/embed/conversation.d.ts +44 -0
  86. package/lib/src/embed/conversation.d.ts.map +1 -1
  87. package/lib/src/embed/conversation.js +10 -1
  88. package/lib/src/embed/conversation.js.map +1 -1
  89. package/lib/src/embed/conversation.spec.js +36 -0
  90. package/lib/src/embed/conversation.spec.js.map +1 -1
  91. package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
  92. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  93. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  94. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  95. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  96. package/lib/src/embed/liveboard.d.ts +5 -4
  97. package/lib/src/embed/liveboard.d.ts.map +1 -1
  98. package/lib/src/embed/liveboard.js +11 -4
  99. package/lib/src/embed/liveboard.js.map +1 -1
  100. package/lib/src/embed/liveboard.spec.js +1 -1
  101. package/lib/src/embed/liveboard.spec.js.map +1 -1
  102. package/lib/src/embed/search-bar.d.ts.map +1 -1
  103. package/lib/src/embed/search-bar.js +4 -2
  104. package/lib/src/embed/search-bar.js.map +1 -1
  105. package/lib/src/embed/search.d.ts.map +1 -1
  106. package/lib/src/embed/search.js +4 -2
  107. package/lib/src/embed/search.js.map +1 -1
  108. package/lib/src/embed/search.spec.js +56 -3
  109. package/lib/src/embed/search.spec.js.map +1 -1
  110. package/lib/src/embed/ts-embed.d.ts +6 -0
  111. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  112. package/lib/src/embed/ts-embed.js +43 -15
  113. package/lib/src/embed/ts-embed.js.map +1 -1
  114. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  115. package/lib/src/embed/ts-embed.spec.js +195 -83
  116. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  117. package/lib/src/types.d.ts +85 -20
  118. package/lib/src/types.d.ts.map +1 -1
  119. package/lib/src/types.js +80 -9
  120. package/lib/src/types.js.map +1 -1
  121. package/lib/src/utils/processData.d.ts.map +1 -1
  122. package/lib/src/utils/processData.js +9 -2
  123. package/lib/src/utils/processData.js.map +1 -1
  124. package/lib/src/utils/processData.spec.js +51 -0
  125. package/lib/src/utils/processData.spec.js.map +1 -1
  126. package/lib/src/visual-embed-sdk.d.ts +139 -28
  127. package/package.json +1 -1
  128. package/src/auth.ts +3 -1
  129. package/src/embed/app.ts +2 -0
  130. package/src/embed/conversation.spec.ts +52 -3
  131. package/src/embed/conversation.ts +60 -1
  132. package/src/embed/hostEventClient/contracts.ts +3 -3
  133. package/src/embed/hostEventClient/host-event-client.ts +7 -1
  134. package/src/embed/liveboard.spec.ts +1 -1
  135. package/src/embed/liveboard.ts +18 -12
  136. package/src/embed/search-bar.tsx +6 -4
  137. package/src/embed/search.spec.ts +71 -3
  138. package/src/embed/search.ts +6 -5
  139. package/src/embed/ts-embed.spec.ts +234 -102
  140. package/src/embed/ts-embed.ts +50 -34
  141. package/src/types.ts +89 -16
  142. package/src/utils/processData.spec.ts +63 -0
  143. package/src/utils/processData.ts +12 -2
@@ -689,7 +689,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
689
689
  */
690
690
  import { DOMSelector, HostEvent, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
691
691
  import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
692
- import { HostEventRequest, HostEventResponse } from '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts';
692
+ import { TriggerPayload, TriggerResponse } from '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts';
693
693
  /**
694
694
  * The configuration for the embedded Liveboard or visualization page view.
695
695
  * @group Embed components
@@ -1067,10 +1067,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
1067
1067
  protected handleRenderForPrerender(): void;
1068
1068
  /**
1069
1069
  * Triggers an event to the embedded app
1070
- * @param messageType The event type
1071
- * @param data The payload to send with the message
1070
+ * @param {HostEvent} messageType The event type
1071
+ * @param {any} data The payload to send with the message
1072
+ * @returns A promise that resolves with the response from the embedded app
1072
1073
  */
1073
- trigger<HostEventT extends HostEvent>(messageType: HostEventT, data?: HostEventRequest<HostEventT>): Promise<HostEventResponse<HostEventT>>;
1074
+ trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
1074
1075
  /**
1075
1076
  * Render an embedded ThoughtSpot Liveboard or visualization
1076
1077
  * @param renderOptions An object specifying the Liveboard ID,
@@ -1563,6 +1564,10 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1563
1564
  */
1564
1565
  searchQuery: string;
1565
1566
  }
1567
+ /**
1568
+ * The configuration for the embedded conversationEmbed options.
1569
+ * @group Embed components
1570
+ */
1566
1571
  export interface ConversationViewConfig extends ViewConfig {
1567
1572
  /**
1568
1573
  * The ID of the worksheet to use for the conversation.
@@ -1597,6 +1602,46 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
1597
1602
  * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
1598
1603
  */
1599
1604
  hideSourceSelection?: boolean;
1605
+ /**
1606
+ * Flag to control Data panel experience
1607
+ * @default false
1608
+ * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
1609
+ * @example
1610
+ * ```js
1611
+ * const embed = new AppEmbed('#tsEmbed', {
1612
+ * ... // other options
1613
+ * dataPanelV2: true,
1614
+ * })
1615
+ * ```
1616
+ */
1617
+ dataPanelV2?: boolean;
1618
+ /**
1619
+ * showSpotterLimitations : show limitation text
1620
+ * of the spotter underneath the chat input.
1621
+ * default is false.
1622
+ * @example
1623
+ * ```js
1624
+ * const embed = new ConversationEmbed('#tsEmbed', {
1625
+ * ... // other options
1626
+ * showSpotterLimitations : true,
1627
+ * })
1628
+ * ```
1629
+ * @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
1630
+ */
1631
+ showSpotterLimitations?: boolean;
1632
+ /**
1633
+ * hideSampleQuestions : Hide sample questions on
1634
+ * the initial screen of the conversation.
1635
+ * @example
1636
+ * ```js
1637
+ * const embed = new ConversationEmbed('#tsEmbed', {
1638
+ * ... // other options
1639
+ * hideSampleQuestions : true,
1640
+ * })
1641
+ * ```
1642
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
1643
+ */
1644
+ hideSampleQuestions?: boolean;
1600
1645
  }
1601
1646
  /**
1602
1647
  * Embed ThoughtSpot AI Conversation.
@@ -1637,7 +1682,8 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
1637
1682
  SDK = "SDK",
1638
1683
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
1639
1684
  EXPIRY = "EXPIRY",
1640
- OTHER = "OTHER"
1685
+ OTHER = "OTHER",
1686
+ IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT"
1641
1687
  }
1642
1688
  /**
1643
1689
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -2370,7 +2416,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2370
2416
  */
2371
2417
  suppressErrorAlerts?: boolean;
2372
2418
  /**
2373
- * Log level for the SDK.
2419
+ * Suppress or show specific types of logs in the console output.
2420
+ * For example, `LogLevel.ERROR` shows only Visual Embed SDK and
2421
+ * ThoughtSpot application errors and suppresses
2422
+ * other logs such as warnings, information alerts,
2423
+ * and debug messages in the console output.
2424
+ *
2374
2425
  * @default LogLevel.ERROR
2375
2426
  * @example
2376
2427
  * ```js
@@ -2950,12 +3001,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2950
3001
  * @version SDK: 1.35.0 | ThoughtSpot: 10.5.0.cl
2951
3002
  */
2952
3003
  overrideOrgId?: number;
2953
- /**
2954
- * Flag to control new flip tooltip context menu experience
2955
- * @default false
2956
- * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2957
- */
2958
- enableFlipTooltipToContextMenu?: boolean;
2959
3004
  }
2960
3005
  /**
2961
3006
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -3407,6 +3452,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3407
3452
  * @hidden
3408
3453
  */
3409
3454
  AuthFailure = "ThoughtspotAuthFailure",
3455
+ /**
3456
+ * ThoughtSpot failed to re validate the auth session.
3457
+ * @hidden
3458
+ */
3459
+ IdleSessionTimeout = "IdleSessionTimeout",
3410
3460
  /**
3411
3461
  * ThoughtSpot failed to validate the auth session.
3412
3462
  * @hidden
@@ -4112,7 +4162,37 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4112
4162
  *```
4113
4163
  * @version SDK : 1.29.0 | ThoughtSpot : 10.3.0.cl
4114
4164
  */
4115
- ParameterChanged = "parameterChanged"
4165
+ ParameterChanged = "parameterChanged",
4166
+ /**
4167
+ * Emitted when the table viz renders.
4168
+ * You can use this event as a hook to trigger
4169
+ * other events on the rendered table viz data.
4170
+ * @example
4171
+ * ```js
4172
+ * searchEmbed.on(EmbedEvent.TableVizRendered, (payload) => {
4173
+ * console.log(payload);
4174
+ * const columnDataLite = payload.data.data.columnDataLite;
4175
+ * columnDataLite[0].dataValue[0]="new fob";
4176
+ * console.log('>>> new Data', columnDataLite);
4177
+ * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
4178
+ * })
4179
+ * ```
4180
+ * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
4181
+ */
4182
+ TableVizRendered = "TableVizRendered",
4183
+ /**
4184
+ * Emitted when the liveboard is created from pin modal or liveboard list page.
4185
+ * You can use this event as a hook to trigger
4186
+ * other events on liveboard creation.
4187
+ *
4188
+ * ```js
4189
+ * liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
4190
+ * console.log('payload', payload);
4191
+ * })
4192
+ *```
4193
+ * @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
4194
+ */
4195
+ CreateLiveboard = "createLiveboard"
4116
4196
  }
4117
4197
  /**
4118
4198
  * Event types that can be triggered by the host application
@@ -4521,7 +4601,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4521
4601
  * @param - an object with `vizId` as a key
4522
4602
  * @example
4523
4603
  * ```js
4524
- * liveboardEmbed.trigger(HostEvent.CreateMonitor {
4604
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor, {
4525
4605
  * vizId: '730496d6-6903-4601-937e-2c691821af3c'
4526
4606
  * })
4527
4607
  * ```
@@ -5053,7 +5133,26 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5053
5133
  * EmbedApi
5054
5134
  * @hidden
5055
5135
  */
5056
- UIPassthrough = "UiPassthrough"
5136
+ UIPassthrough = "UiPassthrough",
5137
+ /**
5138
+ * Triggers the table viz rerender with the updated data.
5139
+ * Includes the following properties:
5140
+ * @param - columnDataLite - an array of object containing data
5141
+ * transformed from data picked from TableVizRendered event.
5142
+ * For example, { columnDataLite: []}
5143
+ * @example
5144
+ * ```js
5145
+ * searchEmbed.on(EmbedEvent.TableVizRendered, (payload) => {
5146
+ * console.log(payload);
5147
+ * const columnDataLite = payload.data.data.columnDataLite;
5148
+ * columnDataLite[0].dataValue[0]="new fob";
5149
+ * console.log('>>> new Data', columnDataLite);
5150
+ * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
5151
+ * })
5152
+ * ```
5153
+ * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
5154
+ */
5155
+ TransformTableVizData = "TransformTableVizData"
5057
5156
  }
5058
5157
  /**
5059
5158
  * The different visual modes that the data sources panel within
@@ -5094,6 +5193,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5094
5193
  HideResult = "hideResult",
5095
5194
  UseLastSelectedDataSource = "useLastSelectedSources",
5096
5195
  Tag = "tag",
5196
+ AutoLogin = "autoLogin",
5097
5197
  searchTokenString = "searchTokenString",
5098
5198
  executeSearch = "executeSearch",
5099
5199
  fullHeight = "isFullHeightPinboard",
@@ -5115,7 +5215,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5115
5215
  AuthType = "authType",
5116
5216
  IconSpriteUrl = "iconSprite",
5117
5217
  cookieless = "cookieless",
5118
- ContextMenuTrigger = "isContextMenuEnabledOnLeftClick",
5218
+ ContextMenuTrigger = "contextMenuEnabledOnWhichClick",
5119
5219
  LinkOverride = "linkOverride",
5120
5220
  blockNonEmbedFullAppAccess = "blockNonEmbedFullAppAccess",
5121
5221
  ShowInsertToSlide = "insertInToSlide",
@@ -5170,10 +5270,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5170
5270
  SpotterEnabled = "isSpotterExperienceEnabled",
5171
5271
  IsUnifiedSearchExperienceEnabled = "isUnifiedSearchExperienceEnabled",
5172
5272
  OverrideOrgId = "orgId",
5173
- EnableFlipTooltipToContextMenu = "flipTooltipToContextMenuEnabled",
5174
5273
  OauthPollingInterval = "oAuthPollingInterval",
5175
5274
  IsForceRedirect = "isForceRedirect",
5176
- DataSourceId = "dataSourceId"
5275
+ DataSourceId = "dataSourceId",
5276
+ ShowSpotterLimitations = "showSpotterLimitations"
5177
5277
  }
5178
5278
  /**
5179
5279
  * ThoughtSpot application pages include actions and menu commands
@@ -6372,10 +6472,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6372
6472
  }
6373
6473
  /**
6374
6474
  * Enum for options to change context trigger
6475
+ * BOTH_CLICKS option is introduced in 10.7
6375
6476
  */
6376
6477
  export enum ContextMenuTriggerOptions {
6377
6478
  LEFT_CLICK = "left-click",
6378
- RIGHT_CLICK = "right-click"
6479
+ RIGHT_CLICK = "right-click",
6480
+ BOTH_CLICKS = "both-clicks"
6379
6481
  }
6380
6482
  export interface ColumnValue {
6381
6483
  column: {
@@ -6418,9 +6520,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6418
6520
  session: SessionInterface;
6419
6521
  vizId?: string;
6420
6522
  }
6523
+ /**
6524
+ * Enum options to show or suppress Visual Embed SDK and
6525
+ * ThoughtSpot application logs in the console output.
6526
+ * This attribute doesn't support suppressing
6527
+ * browser warnings or errors.
6528
+ */
6421
6529
  export enum LogLevel {
6422
6530
  /**
6423
- * No logs will be logged in the console.
6531
+ * No application or SDK-related logs will be logged
6532
+ * in the console output.
6424
6533
  * @example
6425
6534
  * ```js
6426
6535
  * init({
@@ -6432,7 +6541,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6432
6541
  */
6433
6542
  SILENT = "SILENT",
6434
6543
  /**
6435
- * Only ERROR logs will be logged in the console.
6544
+ * Log only errors in the console output.
6436
6545
  * @example
6437
6546
  * ```js
6438
6547
  * init({
@@ -6444,7 +6553,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6444
6553
  */
6445
6554
  ERROR = "ERROR",
6446
6555
  /**
6447
- * Only WARN and ERROR logs will be logged in the console.
6556
+ * Log only warnings and errors in the console output.
6448
6557
  * @example
6449
6558
  * ```js
6450
6559
  * init({
@@ -6456,7 +6565,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6456
6565
  */
6457
6566
  WARN = "WARN",
6458
6567
  /**
6459
- * Only INFO, WARN, and ERROR logs will be logged in the console.
6568
+ * Log only the information alerts, warnings, and errors
6569
+ * in the console output.
6460
6570
  * @example
6461
6571
  * ```js
6462
6572
  * init({
@@ -6468,7 +6578,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6468
6578
  */
6469
6579
  INFO = "INFO",
6470
6580
  /**
6471
- * Only DEBUG, INFO, WARN, and ERROR logs will be logged in the console.
6581
+ * Log debug messages, warnings, information alerts,
6582
+ * and errors in the console output.
6472
6583
  * @example
6473
6584
  * ```js
6474
6585
  * init({
@@ -6480,7 +6591,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6480
6591
  */
6481
6592
  DEBUG = "DEBUG",
6482
6593
  /**
6483
- * All logs will be logged in the console.
6594
+ * All logs will be logged in the browser console.
6484
6595
  * @example
6485
6596
  * ```js
6486
6597
  * init({
@@ -7346,13 +7457,13 @@ declare module '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts' {
7346
7457
  vizId?: string;
7347
7458
  newVizName: string;
7348
7459
  newVizDescription?: string;
7349
- pinboardId?: string;
7460
+ liveboardId?: string;
7350
7461
  tabId?: string;
7351
- newPinboardName?: string;
7462
+ newLiveboardName?: string;
7352
7463
  newTabName?: string;
7353
7464
  };
7354
7465
  response: {
7355
- pinboardId: string;
7466
+ liveboardId: string;
7356
7467
  tabId: string;
7357
7468
  vizId: string;
7358
7469
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.35.11",
3
+ "version": "1.35.13",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/src/auth.ts CHANGED
@@ -39,6 +39,7 @@ export enum AuthFailureType {
39
39
  NO_COOKIE_ACCESS = 'NO_COOKIE_ACCESS',
40
40
  EXPIRY = 'EXPIRY',
41
41
  OTHER = 'OTHER',
42
+ IDLE_SESSION_TIMEOUT = 'IDLE_SESSION_TIMEOUT'
42
43
  }
43
44
 
44
45
  /**
@@ -452,7 +453,8 @@ export const doOIDCAuth = async (embedConfig: EmbedConfig) => {
452
453
  );
453
454
 
454
455
  // bring back the page to the same URL
455
- const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
456
+ const baseEndpoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
457
+ const ssoEndPoint = `${baseEndpoint}${baseEndpoint.includes('?') ? '&' : '?'}forceSAMLAutoRedirect=true`;
456
458
 
457
459
  await doSSOAuth(embedConfig, ssoEndPoint);
458
460
  return loggedInStatus;
package/src/embed/app.ts CHANGED
@@ -646,6 +646,8 @@ export class AppEmbed extends V1Embed {
646
646
  '/embed/insights/viz/',
647
647
  '/liveboard/',
648
648
  '/insights/liveboard/',
649
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
650
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
649
651
  ];
650
652
 
651
653
  if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
@@ -4,13 +4,11 @@ import {
4
4
  } from './conversation';
5
5
  import * as authInstance from '../auth';
6
6
  import { init } from '../index';
7
- import { Action, AuthType, RuntimeFilterOp } from '../types';
7
+ import { AuthType } from '../types';
8
8
  import {
9
- executeAfterWait,
10
9
  getDocumentBody,
11
10
  getIFrameSrc,
12
11
  getRootEl,
13
- fixedEncodeURI,
14
12
  defaultParamsWithoutHiddenActions as defaultParams,
15
13
  expectUrlMatchesWithParams,
16
14
  } from '../test/test-utils';
@@ -62,6 +60,40 @@ describe('ConversationEmbed', () => {
62
60
  );
63
61
  });
64
62
 
63
+ it('should render the conversation embed with spotter limitations text if flag is set', async () => {
64
+ const viewConfig: ConversationViewConfig = {
65
+ worksheetId: 'worksheetId',
66
+ searchOptions: {
67
+ searchQuery: 'searchQuery',
68
+ },
69
+ showSpotterLimitations: true,
70
+ };
71
+
72
+ const conversationEmbed = new ConversationEmbed(getRootEl(), viewConfig);
73
+ await conversationEmbed.render();
74
+ expectUrlMatchesWithParams(
75
+ getIFrameSrc(),
76
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&showSpotterLimitations=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
77
+ );
78
+ });
79
+
80
+ it('should render the conversation embed with sample questions hidden', async () => {
81
+ const viewConfig: ConversationViewConfig = {
82
+ worksheetId: 'worksheetId',
83
+ searchOptions: {
84
+ searchQuery: 'searchQuery',
85
+ },
86
+ hideSampleQuestions: true,
87
+ };
88
+
89
+ const conversationEmbed = new ConversationEmbed(getRootEl(), viewConfig);
90
+ await conversationEmbed.render();
91
+ expectUrlMatchesWithParams(
92
+ getIFrameSrc(),
93
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&hideSampleQuestions=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
94
+ );
95
+ });
96
+
65
97
  it('should render the conversation embed with worksheets hidden', async () => {
66
98
  const viewConfig: ConversationViewConfig = {
67
99
  worksheetId: 'worksheetId',
@@ -93,4 +125,21 @@ describe('ConversationEmbed', () => {
93
125
  ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
94
126
  );
95
127
  });
128
+
129
+ it('should render the conversation embed if data panel v2 flag is true', async () => {
130
+ const viewConfig: ConversationViewConfig = {
131
+ worksheetId: 'worksheetId',
132
+ searchOptions: {
133
+ searchQuery: 'searchQuery',
134
+ },
135
+ dataPanelV2: true,
136
+ };
137
+
138
+ const conversationEmbed = new ConversationEmbed(getRootEl(), viewConfig);
139
+ await conversationEmbed.render();
140
+ expectUrlMatchesWithParams(
141
+ getIFrameSrc(),
142
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&enableDataPanelV2=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
143
+ );
144
+ });
96
145
  });
@@ -14,6 +14,10 @@ export interface SearchOptions {
14
14
  searchQuery: string;
15
15
  }
16
16
 
17
+ /**
18
+ * The configuration for the embedded conversationEmbed options.
19
+ * @group Embed components
20
+ */
17
21
  export interface ConversationViewConfig extends ViewConfig {
18
22
  /**
19
23
  * The ID of the worksheet to use for the conversation.
@@ -48,6 +52,46 @@ export interface ConversationViewConfig extends ViewConfig {
48
52
  * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
49
53
  */
50
54
  hideSourceSelection?: boolean;
55
+ /**
56
+ * Flag to control Data panel experience
57
+ * @default false
58
+ * @version SDK: 1.36.0 | ThoughtSpot Cloud: 10.4.0.cl
59
+ * @example
60
+ * ```js
61
+ * const embed = new AppEmbed('#tsEmbed', {
62
+ * ... // other options
63
+ * dataPanelV2: true,
64
+ * })
65
+ * ```
66
+ */
67
+ dataPanelV2?: boolean;
68
+ /**
69
+ * showSpotterLimitations : show limitation text
70
+ * of the spotter underneath the chat input.
71
+ * default is false.
72
+ * @example
73
+ * ```js
74
+ * const embed = new ConversationEmbed('#tsEmbed', {
75
+ * ... // other options
76
+ * showSpotterLimitations : true,
77
+ * })
78
+ * ```
79
+ * @version SDK: 1.36.0 | Thoughtspot: 10.5.0.cl
80
+ */
81
+ showSpotterLimitations?: boolean;
82
+ /**
83
+ * hideSampleQuestions : Hide sample questions on
84
+ * the initial screen of the conversation.
85
+ * @example
86
+ * ```js
87
+ * const embed = new ConversationEmbed('#tsEmbed', {
88
+ * ... // other options
89
+ * hideSampleQuestions : true,
90
+ * })
91
+ * ```
92
+ * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
93
+ */
94
+ hideSampleQuestions?: boolean;
51
95
  }
52
96
 
53
97
  /**
@@ -71,12 +115,15 @@ export class ConversationEmbed extends TsEmbed {
71
115
  super(container, viewConfig);
72
116
  }
73
117
 
74
- public getIframeSrc() {
118
+ public getIframeSrc(): string {
75
119
  const {
76
120
  worksheetId,
77
121
  searchOptions,
78
122
  disableSourceSelection,
79
123
  hideSourceSelection,
124
+ dataPanelV2,
125
+ showSpotterLimitations,
126
+ hideSampleQuestions,
80
127
  } = this.viewConfig;
81
128
  const path = 'insights/conv-assist';
82
129
  if (!worksheetId) {
@@ -91,6 +138,18 @@ export class ConversationEmbed extends TsEmbed {
91
138
  queryParams[Param.HideSourceSelection] = !!hideSourceSelection;
92
139
  }
93
140
 
141
+ if (!isUndefined(dataPanelV2)) {
142
+ queryParams[Param.DataPanelV2Enabled] = !!dataPanelV2;
143
+ }
144
+
145
+ if (!isUndefined(showSpotterLimitations)) {
146
+ queryParams[Param.ShowSpotterLimitations] = !!showSpotterLimitations;
147
+ }
148
+
149
+ if (!isUndefined(hideSampleQuestions)) {
150
+ queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
151
+ }
152
+
94
153
  let query = '';
95
154
  const queryParamsString = getQueryParamString(queryParams, true);
96
155
  if (queryParamsString) {
@@ -16,13 +16,13 @@ export type UIPassthroughContractBase = {
16
16
  vizId?: string;
17
17
  newVizName: string;
18
18
  newVizDescription?: string;
19
- pinboardId?: string;
19
+ liveboardId?: string;
20
20
  tabId?: string;
21
- newPinboardName?: string;
21
+ newLiveboardName?: string;
22
22
  newTabName?: string;
23
23
  };
24
24
  response: {
25
- pinboardId: string;
25
+ liveboardId: string;
26
26
  tabId: string;
27
27
  vizId: string;
28
28
  };
@@ -96,8 +96,14 @@ export class HostEventClient {
96
96
  return this.hostEventFallback(HostEvent.Pin, payload);
97
97
  }
98
98
 
99
+ const formattedPayload = {
100
+ ...payload,
101
+ pinboardId: payload.liveboardId,
102
+ newPinboardName: payload.newLiveboardName,
103
+ };
104
+
99
105
  return this.handleHostEventWithParam(
100
- UIPassthroughEvent.PinAnswerToLiveboard, payload,
106
+ UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload,
101
107
  );
102
108
  }
103
109
 
@@ -532,7 +532,7 @@ describe('Liveboard/viz embed tests', () => {
532
532
  await executeAfterWait(() => {
533
533
  expectUrlMatchesWithParams(
534
534
  getIFrameSrc(),
535
- `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isContextMenuEnabledOnLeftClick=true&isLiveboardEmbed=true&isPinboardV2Enabled=true#/embed/viz/${liveboardId}/tab/${activeTabId}`,
535
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&contextMenuEnabledOnWhichClick=left&isLiveboardEmbed=true&isPinboardV2Enabled=true#/embed/viz/${liveboardId}/tab/${activeTabId}`,
536
536
  );
537
537
  });
538
538
  });
@@ -23,7 +23,14 @@ import { getQueryParamString, isUndefined } from '../utils';
23
23
  import { getAuthPromise } from './base';
24
24
  import { V1Embed } from './ts-embed';
25
25
  import { addPreviewStylesIfNotPresent } from '../utils/global-styles';
26
- import { HostEventRequest, HostEventResponse } from './hostEventClient/contracts';
26
+ import { TriggerPayload, TriggerResponse } from './hostEventClient/contracts';
27
+
28
+ const liveboardHeightWhitelistedRoutes = [
29
+ '/embed/viz/',
30
+ '/embed/insights/viz/',
31
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
32
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
33
+ ];
27
34
 
28
35
  /**
29
36
  * The configuration for the embedded Liveboard or visualization page view.
@@ -562,10 +569,8 @@ export class LiveboardEmbed extends V1Embed {
562
569
  };
563
570
 
564
571
  private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
565
- if (
566
- data.data.currentPath.startsWith('/embed/viz/')
567
- || data.data.currentPath.startsWith('/embed/insights/viz/')
568
- ) {
572
+ const routePath = data.data.currentPath;
573
+ if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
569
574
  return;
570
575
  }
571
576
  this.setIFrameHeight(this.defaultHeight);
@@ -637,16 +642,17 @@ export class LiveboardEmbed extends V1Embed {
637
642
 
638
643
  /**
639
644
  * Triggers an event to the embedded app
640
- * @param messageType The event type
641
- * @param data The payload to send with the message
645
+ * @param {HostEvent} messageType The event type
646
+ * @param {any} data The payload to send with the message
647
+ * @returns A promise that resolves with the response from the embedded app
642
648
  */
643
- public trigger<HostEventT extends HostEvent>(
649
+ public trigger<HostEventT extends HostEvent, PayloadT>(
644
650
  messageType: HostEventT,
645
- data: HostEventRequest<HostEventT> = ({} as any),
646
- ): Promise<HostEventResponse<HostEventT>> {
647
- const dataWithVizId = data;
651
+ data: TriggerPayload<PayloadT, HostEventT> = ({} as any),
652
+ ): Promise<TriggerResponse<PayloadT, HostEventT>> {
653
+ const dataWithVizId: any = data;
648
654
  if (messageType === HostEvent.SetActiveTab) {
649
- this.setActiveTab(data);
655
+ this.setActiveTab(data as { tabId: string });
650
656
  return Promise.resolve(null);
651
657
  }
652
658
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
@@ -143,10 +143,12 @@ export class SearchBarEmbed extends TsEmbed {
143
143
  if (dataSource) {
144
144
  queryParams[Param.DataSources] = `["${dataSource}"]`;
145
145
  }
146
- if (searchOptions?.searchTokenString && !excludeSearchTokenStringFromURL) {
147
- queryParams[Param.searchTokenString] = encodeURIComponent(
148
- searchOptions.searchTokenString,
149
- );
146
+ if (searchOptions?.searchTokenString) {
147
+ if (!excludeSearchTokenStringFromURL) {
148
+ queryParams[Param.searchTokenString] = encodeURIComponent(
149
+ searchOptions.searchTokenString,
150
+ );
151
+ }
150
152
 
151
153
  if (searchOptions.executeSearch) {
152
154
  queryParams[Param.executeSearch] = true;