@thoughtspot/visual-embed-sdk 1.36.8 → 1.36.9-primaryAction

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 (130) hide show
  1. package/cjs/package.json +15 -12
  2. package/cjs/src/embed/bodyless-conversation.d.ts +16 -0
  3. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  4. package/cjs/src/embed/bodyless-conversation.js +1 -1
  5. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  6. package/cjs/src/embed/search-bar.d.ts +1 -1
  7. package/cjs/src/embed/search.d.ts +1 -1
  8. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  9. package/cjs/src/embed/ts-embed.js +14 -2
  10. package/cjs/src/embed/ts-embed.js.map +1 -1
  11. package/cjs/src/embed/ts-embed.spec.js +111 -0
  12. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  13. package/cjs/src/index.d.ts +2 -2
  14. package/cjs/src/index.d.ts.map +1 -1
  15. package/cjs/src/index.js +2 -1
  16. package/cjs/src/index.js.map +1 -1
  17. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  18. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  19. package/cjs/src/pages/embed-test.page.js +20 -0
  20. package/cjs/src/pages/embed-test.page.js.map +1 -0
  21. package/cjs/src/pages/home.page.d.ts +6 -0
  22. package/cjs/src/pages/home.page.d.ts.map +1 -0
  23. package/cjs/src/pages/home.page.js +12 -0
  24. package/cjs/src/pages/home.page.js.map +1 -0
  25. package/cjs/src/pages/login.page.d.ts +15 -0
  26. package/cjs/src/pages/login.page.d.ts.map +1 -0
  27. package/cjs/src/pages/login.page.js +22 -0
  28. package/cjs/src/pages/login.page.js.map +1 -0
  29. package/cjs/src/react/index.d.ts +1 -1
  30. package/cjs/src/react/index.d.ts.map +1 -1
  31. package/cjs/src/react/index.js +2 -1
  32. package/cjs/src/react/index.js.map +1 -1
  33. package/cjs/src/tests/auth.test.d.ts +1 -0
  34. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  35. package/cjs/src/tests/auth.test.js +1 -0
  36. package/cjs/src/tests/auth.test.js.map +1 -0
  37. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  38. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  39. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  40. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  41. package/cjs/src/types.d.ts +83 -10
  42. package/cjs/src/types.d.ts.map +1 -1
  43. package/cjs/src/types.js +45 -9
  44. package/cjs/src/types.js.map +1 -1
  45. package/dist/index-BEyovSez.js +7370 -0
  46. package/dist/{index-BnVGyY5S.js → index-BJx3m5_V.js} +1 -1
  47. package/dist/index-Dg18PU5Z.js +7370 -0
  48. package/dist/index-Do_T8J8z.js +7370 -0
  49. package/dist/src/embed/bodyless-conversation.d.ts +16 -0
  50. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  51. package/dist/src/embed/search-bar.d.ts +1 -1
  52. package/dist/src/embed/search.d.ts +1 -1
  53. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  54. package/dist/src/index.d.ts +2 -2
  55. package/dist/src/index.d.ts.map +1 -1
  56. package/dist/src/pages/embed-test.page.d.ts +8 -0
  57. package/dist/src/pages/embed-test.page.d.ts.map +1 -0
  58. package/dist/src/pages/home.page.d.ts +6 -0
  59. package/dist/src/pages/home.page.d.ts.map +1 -0
  60. package/dist/src/pages/login.page.d.ts +15 -0
  61. package/dist/src/pages/login.page.d.ts.map +1 -0
  62. package/dist/src/react/index.d.ts +1 -1
  63. package/dist/src/react/index.d.ts.map +1 -1
  64. package/dist/src/tests/auth.test.d.ts +1 -0
  65. package/dist/src/tests/auth.test.d.ts.map +1 -0
  66. package/dist/src/tests/e2e/auth.spec.d.ts +2 -0
  67. package/dist/src/tests/e2e/auth.spec.d.ts.map +1 -0
  68. package/dist/src/types.d.ts +83 -10
  69. package/dist/src/types.d.ts.map +1 -1
  70. package/dist/tsembed-react.es.js +62 -14
  71. package/dist/tsembed-react.js +60 -12
  72. package/dist/tsembed.es.js +63 -15
  73. package/dist/tsembed.js +61 -13
  74. package/dist/visual-embed-sdk-react-full.d.ts +101 -13
  75. package/dist/visual-embed-sdk-react.d.ts +101 -13
  76. package/dist/visual-embed-sdk.d.ts +101 -13
  77. package/lib/package.json +15 -12
  78. package/lib/src/embed/bodyless-conversation.d.ts +16 -0
  79. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  80. package/lib/src/embed/bodyless-conversation.js +1 -1
  81. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  82. package/lib/src/embed/search-bar.d.ts +1 -1
  83. package/lib/src/embed/search.d.ts +1 -1
  84. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  85. package/lib/src/embed/ts-embed.js +14 -2
  86. package/lib/src/embed/ts-embed.js.map +1 -1
  87. package/lib/src/embed/ts-embed.spec.js +111 -0
  88. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  89. package/lib/src/index.d.ts +2 -2
  90. package/lib/src/index.d.ts.map +1 -1
  91. package/lib/src/index.js +2 -2
  92. package/lib/src/index.js.map +1 -1
  93. package/lib/src/pages/embed-test.page.d.ts +8 -0
  94. package/lib/src/pages/embed-test.page.d.ts.map +1 -0
  95. package/lib/src/pages/embed-test.page.js +16 -0
  96. package/lib/src/pages/embed-test.page.js.map +1 -0
  97. package/lib/src/pages/home.page.d.ts +6 -0
  98. package/lib/src/pages/home.page.d.ts.map +1 -0
  99. package/lib/src/pages/home.page.js +8 -0
  100. package/lib/src/pages/home.page.js.map +1 -0
  101. package/lib/src/pages/login.page.d.ts +15 -0
  102. package/lib/src/pages/login.page.d.ts.map +1 -0
  103. package/lib/src/pages/login.page.js +18 -0
  104. package/lib/src/pages/login.page.js.map +1 -0
  105. package/lib/src/react/index.d.ts +1 -1
  106. package/lib/src/react/index.d.ts.map +1 -1
  107. package/lib/src/react/index.js +1 -1
  108. package/lib/src/react/index.js.map +1 -1
  109. package/lib/src/tests/auth.test.d.ts +1 -0
  110. package/lib/src/tests/auth.test.d.ts.map +1 -0
  111. package/lib/src/tests/auth.test.js +1 -0
  112. package/lib/src/tests/auth.test.js.map +1 -0
  113. package/lib/src/tests/e2e/auth.spec.d.ts +2 -0
  114. package/lib/src/tests/e2e/auth.spec.d.ts.map +1 -0
  115. package/lib/src/tests/e2e/auth.spec.js +52 -0
  116. package/lib/src/tests/e2e/auth.spec.js.map +1 -0
  117. package/lib/src/types.d.ts +83 -10
  118. package/lib/src/types.d.ts.map +1 -1
  119. package/lib/src/types.js +44 -8
  120. package/lib/src/types.js.map +1 -1
  121. package/lib/src/visual-embed-sdk.d.ts +103 -14
  122. package/package.json +15 -12
  123. package/src/embed/bodyless-conversation.ts +1 -1
  124. package/src/embed/search-bar.tsx +1 -1
  125. package/src/embed/search.ts +1 -1
  126. package/src/embed/ts-embed.spec.ts +118 -0
  127. package/src/embed/ts-embed.ts +16 -0
  128. package/src/index.ts +2 -0
  129. package/src/react/index.tsx +1 -0
  130. package/src/types.ts +89 -10
@@ -20,7 +20,7 @@ declare module '@thoughtspot/visual-embed-sdk' {
20
20
  import { ConversationEmbed, ConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/conversation';
21
21
  import { AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter } from '@thoughtspot/visual-embed-sdk/auth';
22
22
  import { getSessionInfo } from '@thoughtspot/visual-embed-sdk/utils/sessionInfoService';
23
- import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, PrefetchFeatures, FrameParams, DOMSelector, HomeLeftNavItem, HomepageModule, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, ContextMenuTriggerOptions, RuntimeParameter, LogLevel, VizPoint, CustomActionPayload } from '@thoughtspot/visual-embed-sdk/types';
23
+ import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, PrefetchFeatures, FrameParams, DOMSelector, HomeLeftNavItem, HomepageModule, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, ContextMenuTriggerOptions, RuntimeParameter, LogLevel, VizPoint, CustomActionPayload, ListPageColumns } from '@thoughtspot/visual-embed-sdk/types';
24
24
  import { CustomCssVariables } from '@thoughtspot/visual-embed-sdk/css-variables';
25
25
  import { SageEmbed, SageViewConfig } from '@thoughtspot/visual-embed-sdk/embed/sage';
26
26
  import { AnswerService, SessionInterface, UnderlyingDataPoint } from '@thoughtspot/visual-embed-sdk/utils/graphql/answerService/answerService';
@@ -30,7 +30,7 @@ declare module '@thoughtspot/visual-embed-sdk' {
30
30
  import { getAnswerFromQuery } from '@thoughtspot/visual-embed-sdk/utils/graphql/nlsService/nls-answer-service';
31
31
  import { createLiveboardWithAnswers } from '@thoughtspot/visual-embed-sdk/utils/liveboardService/liveboardService';
32
32
  import { UIPassthroughEvent } from '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts';
33
- export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, };
33
+ export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, BodylessConversation, BodylessConversationViewConfig, ConversationEmbed, ConversationViewConfig, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
34
34
  export { resetCachedAuthToken } from '@thoughtspot/visual-embed-sdk/authToken';
35
35
  }
36
36
 
@@ -1309,7 +1309,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
1309
1309
  /**
1310
1310
  * Exclude the search token string from the URL.
1311
1311
  * If set to true, the search token string is not appended to the URL.
1312
- * @version: SDK: 1.35.7 | ThoughtSpot: 10.7.0.cl
1312
+ * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
1313
1313
  * @example
1314
1314
  * ```js
1315
1315
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -1505,7 +1505,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search-bar' {
1505
1505
  /**
1506
1506
  * Exclude the search token string from the URL.
1507
1507
  * If set to true, the search token string is not appended to the URL.
1508
- * @version: SDK: 1.35.7 | ThoughtSpot: 10.7.0.cl
1508
+ * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
1509
1509
  * @example
1510
1510
  * ```js
1511
1511
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -1547,6 +1547,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search-bar' {
1547
1547
 
1548
1548
  declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1549
1549
  import { ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
1550
+ import { TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
1550
1551
  /**
1551
1552
  * Configuration for bodyless conversation options.
1552
1553
  * @group Embed components
@@ -1557,6 +1558,18 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1557
1558
  */
1558
1559
  worksheetId: string;
1559
1560
  }
1561
+ interface ConversationMessageViewConfig extends BodylessConversationViewConfig {
1562
+ sessionId: string;
1563
+ genNo: number;
1564
+ acSessionId: string;
1565
+ acGenNo: number;
1566
+ }
1567
+ class ConversationMessage extends TsEmbed {
1568
+ protected viewConfig: ConversationMessageViewConfig;
1569
+ constructor(container: HTMLElement, viewConfig: ConversationMessageViewConfig);
1570
+ getIframeSrc(): string;
1571
+ render(): Promise<ConversationMessage>;
1572
+ }
1560
1573
  /**
1561
1574
  * Create a conversation embed, which can be integrated inside
1562
1575
  * chatbots or other conversational interfaces.
@@ -1581,11 +1594,14 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
1581
1594
  sendMessage(userMessage: string): Promise<{
1582
1595
  error: any;
1583
1596
  container?: undefined;
1597
+ viz?: undefined;
1584
1598
  } | {
1585
1599
  container: HTMLDivElement;
1600
+ viz: ConversationMessage;
1586
1601
  error?: undefined;
1587
1602
  }>;
1588
1603
  }
1604
+ export {};
1589
1605
  }
1590
1606
 
1591
1607
  declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
@@ -2280,6 +2296,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2280
2296
  * @version SDK: 1.26.0 | 9.7.0.cl
2281
2297
  */
2282
2298
  strings?: Record<string, any>;
2299
+ stringIDs?: Record<string, string>;
2300
+ stringIDsUrl?: string;
2283
2301
  [key: string]: any;
2284
2302
  };
2285
2303
  iconSpriteUrl?: string;
@@ -2590,7 +2608,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2590
2608
  * }
2591
2609
  * });
2592
2610
  * ```
2593
- * @version SDK 1.37.0 | ThoughtSpot: 10.7.0.cl
2611
+ * @version SDK 1.37.0 | ThoughtSpot: 10.8.0.cl
2594
2612
  */
2595
2613
  customVariablesForThirdPartyTools?: Record<string, any>;
2596
2614
  disablePreauthCache?: boolean;
@@ -2697,6 +2715,21 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
2697
2715
  * @important
2698
2716
  */
2699
2717
  hiddenActions?: Action[];
2718
+ /**
2719
+ * The primary action to display from the embedded.
2720
+ * This action will be displayed from the embedded.
2721
+ * Use this to set the primary action.
2722
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
2723
+ * @example
2724
+ * ```js
2725
+ * const embed = new LiveboardEmbed('#embed', {
2726
+ * ... // other liveboard view config
2727
+ * primaryAction: 'download'
2728
+ * });
2729
+ * ```
2730
+ * @important
2731
+ */
2732
+ primaryAction?: string;
2700
2733
  /**
2701
2734
  * The list of actions to display from the primary menu, more menu
2702
2735
  * (...), and the contextual menu. These will be only actions that
@@ -3031,6 +3064,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3031
3064
  * });
3032
3065
  */
3033
3066
  collapseSearchBar?: boolean;
3067
+ /**
3068
+ * This flag can be used to expose translation IDs on the embedded app.
3069
+ * @default false
3070
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
3071
+ */
3072
+ exposeTranslationIDs?: boolean;
3034
3073
  /**
3035
3074
  * This flag can be used to disable links inside the embedded app,
3036
3075
  * and disable redirection of links in a new tab.
@@ -3085,6 +3124,21 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3085
3124
  * @version SDK: 1.35.0 | ThoughtSpot: 10.5.0.cl
3086
3125
  */
3087
3126
  overrideOrgId?: number;
3127
+ /**
3128
+ * Hide list page columns
3129
+ * For example: hiddenListColumns = [ListPageColumns.Author]
3130
+ *
3131
+ * **Note**: This option is appplicable only in full app embedding.
3132
+ * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
3133
+ * @example
3134
+ * ```js
3135
+ * const embed = new AppEmbed('#tsEmbed', {
3136
+ * ... // other options
3137
+ * hiddenListColumns : [ListPageColumns.Favorite,ListPageColumns.Author],
3138
+ * })
3139
+ * ```
3140
+ */
3141
+ hiddenListColumns?: ListPageColumns[];
3088
3142
  }
3089
3143
  /**
3090
3144
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -3230,6 +3284,33 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
3230
3284
  */
3231
3285
  Learning = "LEARNING"
3232
3286
  }
3287
+ /**
3288
+ * List page columns that can be hidden.
3289
+ * **Note**: This option is applicable only in full app embedding.
3290
+ * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
3291
+ */
3292
+ export enum ListPageColumns {
3293
+ /**
3294
+ * Favourite
3295
+ */
3296
+ Favourite = "FAVOURITE",
3297
+ /**
3298
+ * Tags
3299
+ */
3300
+ Tags = "TAGS",
3301
+ /**
3302
+ * Author
3303
+ */
3304
+ Author = "AUTHOR",
3305
+ /**
3306
+ * Last viewed/Last modified
3307
+ */
3308
+ DateSort = "DATE_SORT",
3309
+ /**
3310
+ * Share
3311
+ */
3312
+ Share = "SHARE"
3313
+ }
3233
3314
  /**
3234
3315
  * A filter that can be applied to ThoughtSpot answers, Liveboards, or
3235
3316
  * visualizations at runtime.
@@ -4252,16 +4333,19 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4252
4333
  /**
4253
4334
  * Emits when a table visualization is rendered in
4254
4335
  * the ThoughtSpot embedded app.
4336
+ *
4255
4337
  * You can also use this event as a hook to trigger host events
4256
4338
  * such as `HostEvent.TransformTableVizData` on the table visualization.
4257
4339
  * The event payload contains the data used in the rendered table.
4258
4340
  * You can extract the relevant data from the payload
4259
4341
  * stored in `payload.data.data.columnDataLite`.
4342
+ *
4260
4343
  * `columnDataLite` is a multidimensional array that contains
4261
4344
  * data values for each column, which was used in the query to
4262
4345
  * generate the table visualization. To find and modify specific cell data,
4263
4346
  * you can either loop through the array or directly access a cell if
4264
4347
  * you know its position and data index.
4348
+ *
4265
4349
  * In the following code sample, the first cell in the first column
4266
4350
  * (`columnDataLite[0].dataValue[0]`) is set to `new fob`.
4267
4351
  * Note that any changes made to the data in the payload will only update the
@@ -4271,6 +4355,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4271
4355
  * payload in the `columnDataLite` is passed on to
4272
4356
  * `HostEvent.TransformTableVizData` and trigger an update to
4273
4357
  * the table visualization.
4358
+ *
4274
4359
  * If the Row-Level Security (RLS) rules are applied on the
4275
4360
  * Worksheet or Model, exercise caution when changing column
4276
4361
  * or table cell values to maintain data security.
@@ -4285,7 +4370,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4285
4370
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
4286
4371
  * })
4287
4372
  * ```
4288
- * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
4373
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
4289
4374
  */
4290
4375
  TableVizRendered = "TableVizRendered",
4291
4376
  /**
@@ -4298,7 +4383,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4298
4383
  * console.log('payload', payload);
4299
4384
  * })
4300
4385
  *```
4301
- * @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
4386
+ * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
4302
4387
  */
4303
4388
  CreateLiveboard = "createLiveboard",
4304
4389
  /**
@@ -4745,7 +4830,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
4745
4830
  * ```js
4746
4831
  * liveboardEmbed.trigger(HostEvent.Remove)
4747
4832
  * ```
4748
- * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4833
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
4749
4834
  */
4750
4835
  Remove = "delete",
4751
4836
  /**
@@ -5293,7 +5378,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5293
5378
  * ```js
5294
5379
  * liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
5295
5380
  *```
5296
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
5381
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
5297
5382
  */
5298
5383
  InfoSuccess = "InfoSuccess",
5299
5384
  /**
@@ -5340,7 +5425,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5340
5425
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
5341
5426
  * })
5342
5427
  * ```
5343
- * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
5428
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
5344
5429
  */
5345
5430
  TransformTableVizData = "TransformTableVizData"
5346
5431
  }
@@ -5391,6 +5476,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5391
5476
  livedBoardEmbed = "isLiveboardEmbed",
5392
5477
  searchEmbed = "isSearchEmbed",
5393
5478
  vizEmbed = "isVizEmbed",
5479
+ StringIDsUrl = "overrideStringIDsUrl",
5394
5480
  Version = "sdkVersion",
5395
5481
  ViewPortHeight = "viewPortHeight",
5396
5482
  ViewPortWidth = "viewPortWidth",
@@ -5440,6 +5526,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5440
5526
  HideSageAnswerHeader = "hideSageAnswerHeader",
5441
5527
  HideSearchBar = "hideSearchBar",
5442
5528
  ClientLogLevel = "clientLogLevel",
5529
+ ExposeTranslationIDs = "exposeTranslationIDs",
5443
5530
  OverrideNativeConsole = "overrideConsoleLogs",
5444
5531
  enableAskSage = "enableAskSage",
5445
5532
  CollapseSearchBarInitially = "collapseSearchBarInitially",
@@ -5466,7 +5553,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5466
5553
  DataSourceId = "dataSourceId",
5467
5554
  preAuthCache = "preAuthCache",
5468
5555
  ShowSpotterLimitations = "showSpotterLimitations",
5469
- CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF"
5556
+ CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
5557
+ PrimaryAction = "primaryAction"
5470
5558
  }
5471
5559
  /**
5472
5560
  * ThoughtSpot application pages include actions and menu commands
@@ -5631,7 +5719,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
5631
5719
  * The **Collapse data panel** icon on the Search page.
5632
5720
  * Collapses the data panel view.
5633
5721
  *
5634
- * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl, 10.7.0.sw
5722
+ * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
5635
5723
  *
5636
5724
  * @example
5637
5725
  * ```js
@@ -6697,8 +6785,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6697
6785
  VizEmbed = "VizEmbed"
6698
6786
  }
6699
6787
  /**
6700
- * Enum for options to change context trigger
6701
- * BOTH_CLICKS option is introduced in 10.7
6788
+ * Enum for options to change context trigger.
6789
+ * The `BOTH_CLICKS` option is available from 10.8.0.cl.
6702
6790
  */
6703
6791
  export enum ContextMenuTriggerOptions {
6704
6792
  LEFT_CLICK = "left-click",
@@ -6839,6 +6927,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
6839
6927
  hostConfig: Record<string, any>;
6840
6928
  hiddenHomeLeftNavItems: string[];
6841
6929
  customVariablesForThirdPartyTools: Record<string, any>;
6930
+ hiddenListColumns: ListPageColumns[];
6842
6931
  }
6843
6932
  }
6844
6933
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.36.8",
3
+ "version": "1.36.9-primaryAction",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -94,8 +94,8 @@
94
94
  "@types/lodash": "^4.17.0",
95
95
  "@types/mixpanel-browser": "^2.35.6",
96
96
  "@types/react-test-renderer": "^17.0.1",
97
- "@typescript-eslint/eslint-plugin": "^4.6.0",
98
- "@typescript-eslint/parser": "^4.6.0",
97
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
98
+ "@typescript-eslint/parser": "^8.28.0",
99
99
  "asciidoctor": "^2.2.1",
100
100
  "babel-jest": "^26.6.3",
101
101
  "babel-preset-gatsby": "^1.10.0",
@@ -104,17 +104,19 @@
104
104
  "crypto": "^1.0.1",
105
105
  "current-git-branch": "^1.1.0",
106
106
  "dts-bundle": "^0.7.3",
107
- "eslint": "^7.12.1",
108
- "eslint-config-airbnb-base": "^14.2.0",
109
- "eslint-config-prettier": "^6.15.0",
110
- "eslint-import-resolver-typescript": "^2.3.0",
111
- "eslint-plugin-import": "^2.22.1",
112
- "eslint-plugin-prettier": "^3.1.4",
113
- "eslint-plugin-react-hooks": "^4.2.0",
114
- "eslint-plugin-comment-length": "1.7.3",
115
- "eslint-plugin-jsdoc": "^46.9.0",
107
+ "eslint": "^9.23.0",
108
+ "eslint-config-airbnb-base": "^15.0.0",
109
+ "eslint-config-prettier": "^10.1.1",
110
+ "eslint-import-resolver-typescript": "^4.2.5",
111
+ "eslint-plugin-comment-length": "2.2.1",
112
+ "eslint-plugin-import": "^2.31.0",
113
+ "eslint-plugin-jsdoc": "^50.6.9",
114
+ "eslint-plugin-prettier": "^5.2.5",
115
+ "eslint-plugin-react": "^7.37.5",
116
+ "eslint-plugin-react-hooks": "^5.2.0",
116
117
  "fs-extra": "^10.0.0",
117
118
  "gh-pages": "6.3.0",
119
+ "globals": "^16.0.0",
118
120
  "highlight.js": "^10.6.0",
119
121
  "html-to-text": "^8.0.0",
120
122
  "identity-obj-proxy": "^3.0.0",
@@ -136,6 +138,7 @@
136
138
  "typedoc": "0.21.6",
137
139
  "typedoc-plugin-toc-group": "thoughtspot/typedoc-plugin-toc-group",
138
140
  "typescript": "^4.9.4",
141
+ "typescript-eslint": "^8.29.1",
139
142
  "url-search-params-polyfill": "^8.1.0",
140
143
  "util": "^0.12.4",
141
144
  "vite": "^5.3.4"
@@ -109,6 +109,6 @@ export class BodylessConversation {
109
109
  acGenNo: data.stateKey.generationNumber,
110
110
  });
111
111
  await embed.render();
112
- return { container };
112
+ return { container, viz: embed };
113
113
  }
114
114
  }
@@ -82,7 +82,7 @@ export interface SearchBarViewConfig
82
82
  /**
83
83
  * Exclude the search token string from the URL.
84
84
  * If set to true, the search token string is not appended to the URL.
85
- * @version: SDK: 1.35.7 | ThoughtSpot: 10.7.0.cl
85
+ * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
86
86
  * @example
87
87
  * ```js
88
88
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -206,7 +206,7 @@ export interface SearchViewConfig
206
206
  /**
207
207
  * Exclude the search token string from the URL.
208
208
  * If set to true, the search token string is not appended to the URL.
209
- * @version: SDK: 1.35.7 | ThoughtSpot: 10.7.0.cl
209
+ * @version: SDK: 1.35.7 | ThoughtSpot: 10.8.0.cl
210
210
  * @example
211
211
  * ```js
212
212
  * const embed = new SearchEmbed('#tsEmbed', {
@@ -346,6 +346,7 @@ describe('Unit test case for ts embed', () => {
346
346
  runtimeParameterParams: null,
347
347
  hiddenHomeLeftNavItems: [],
348
348
  hiddenHomepageModules: [],
349
+ hiddenListColumns: [],
349
350
  hostConfig: undefined,
350
351
  reorderedHomepageModules: [],
351
352
  customVariablesForThirdPartyTools,
@@ -381,6 +382,7 @@ describe('Unit test case for ts embed', () => {
381
382
  runtimeParameterParams: null,
382
383
  hiddenHomeLeftNavItems: [],
383
384
  hiddenHomepageModules: [],
385
+ hiddenListColumns: [],
384
386
  hostConfig: undefined,
385
387
  reorderedHomepageModules: [],
386
388
  customVariablesForThirdPartyTools,
@@ -422,6 +424,7 @@ describe('Unit test case for ts embed', () => {
422
424
  runtimeParameterParams: null,
423
425
  hiddenHomeLeftNavItems: [],
424
426
  hiddenHomepageModules: [HomepageModule.MyLibrary, HomepageModule.Learning],
427
+ hiddenListColumns: [],
425
428
  reorderedHomepageModules: [],
426
429
  customVariablesForThirdPartyTools,
427
430
  },
@@ -459,6 +462,7 @@ describe('Unit test case for ts embed', () => {
459
462
  runtimeParameterParams: null,
460
463
  hiddenHomeLeftNavItems: [],
461
464
  hiddenHomepageModules: [],
465
+ hiddenListColumns: [],
462
466
  reorderedHomepageModules: [],
463
467
  customVariablesForThirdPartyTools,
464
468
  },
@@ -499,6 +503,7 @@ describe('Unit test case for ts embed', () => {
499
503
  runtimeParameterParams: null,
500
504
  hiddenHomeLeftNavItems: [],
501
505
  hiddenHomepageModules: [],
506
+ hiddenListColumns: [],
502
507
  reorderedHomepageModules:
503
508
  [HomepageModule.MyLibrary, HomepageModule.Watchlist],
504
509
  customVariablesForThirdPartyTools,
@@ -542,6 +547,7 @@ describe('Unit test case for ts embed', () => {
542
547
  runtimeParameterParams: 'param1=color&paramVal1=blue',
543
548
  hiddenHomeLeftNavItems: [],
544
549
  hiddenHomepageModules: [],
550
+ hiddenListColumns: [],
545
551
  hostConfig: undefined,
546
552
  reorderedHomepageModules: [],
547
553
  customVariablesForThirdPartyTools,
@@ -586,6 +592,7 @@ describe('Unit test case for ts embed', () => {
586
592
  runtimeParameterParams: null,
587
593
  hiddenHomeLeftNavItems: [],
588
594
  hiddenHomepageModules: [],
595
+ hiddenListColumns: [],
589
596
  hostConfig: undefined,
590
597
  reorderedHomepageModules: [],
591
598
  customVariablesForThirdPartyTools,
@@ -629,6 +636,7 @@ describe('Unit test case for ts embed', () => {
629
636
  runtimeParameterParams: null,
630
637
  hiddenHomeLeftNavItems: [],
631
638
  hiddenHomepageModules: [],
639
+ hiddenListColumns: [],
632
640
  hostConfig: undefined,
633
641
  reorderedHomepageModules: [],
634
642
  customVariablesForThirdPartyTools,
@@ -673,6 +681,7 @@ describe('Unit test case for ts embed', () => {
673
681
  runtimeParameterParams: null,
674
682
  hiddenHomeLeftNavItems: [],
675
683
  hiddenHomepageModules: [],
684
+ hiddenListColumns: [],
676
685
  hostConfig: undefined,
677
686
  reorderedHomepageModules: [],
678
687
  customVariablesForThirdPartyTools,
@@ -716,6 +725,7 @@ describe('Unit test case for ts embed', () => {
716
725
  hiddenHomeLeftNavItems:
717
726
  [HomeLeftNavItem.Home, HomeLeftNavItem.MonitorSubscription],
718
727
  hiddenHomepageModules: [],
728
+ hiddenListColumns: [],
719
729
  reorderedHomepageModules: [],
720
730
  customVariablesForThirdPartyTools,
721
731
  },
@@ -883,6 +893,7 @@ describe('Unit test case for ts embed', () => {
883
893
  runtimeParameterParams: null,
884
894
  hiddenHomeLeftNavItems: [],
885
895
  hiddenHomepageModules: [],
896
+ hiddenListColumns: [],
886
897
  hostConfig: undefined,
887
898
  reorderedHomepageModules: [],
888
899
  customVariablesForThirdPartyTools: {},
@@ -894,6 +905,113 @@ describe('Unit test case for ts embed', () => {
894
905
  });
895
906
  });
896
907
 
908
+ describe('StringIDs and StringIDsUrl in customisations', () => {
909
+ const customisationWithStringIds = {
910
+ style: {
911
+ customCSS: {},
912
+ },
913
+ content: {
914
+ strings: {
915
+ Liveboard: 'Dashboard',
916
+ },
917
+ stringIDsUrl: 'https://sample-string-ids-url.com',
918
+ stringIDs: {
919
+ 'liveboard.header.title': 'Dashboard name',
920
+ },
921
+ },
922
+ };
923
+ beforeEach(() => {
924
+ jest.spyOn(authInstance, 'doCookielessTokenAuth').mockResolvedValueOnce(true);
925
+ jest.spyOn(authService, 'verifyTokenService').mockResolvedValue(true);
926
+ init({
927
+ thoughtSpotHost: 'tshost',
928
+ customizations: customisationWithStringIds,
929
+ authType: AuthType.TrustedAuthTokenCookieless,
930
+ getAuthToken: () => Promise.resolve('test_auth_token1'),
931
+ });
932
+ });
933
+
934
+ afterEach(() => {
935
+ baseInstance.reset();
936
+ jest.clearAllMocks();
937
+ });
938
+
939
+ test('should pass stringIDsUrl and stringIDs in customisations during APP_INIT', async () => {
940
+ const mockEmbedEventPayload = {
941
+ type: EmbedEvent.APP_INIT,
942
+ data: {},
943
+ };
944
+ const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
945
+ searchEmbed.render();
946
+ const mockPort: any = {
947
+ postMessage: jest.fn(),
948
+ };
949
+
950
+ await executeAfterWait(() => {
951
+ const iframe = getIFrameEl();
952
+ expect(iframe.src).toContain('overrideStringIDsUrl=https://sample-string-ids-url.com');
953
+ postMessageToParent(iframe.contentWindow, mockEmbedEventPayload, mockPort);
954
+ });
955
+
956
+ await executeAfterWait(() => {
957
+ expect(mockPort.postMessage).toHaveBeenCalledWith({
958
+ type: EmbedEvent.APP_INIT,
959
+ data: {
960
+ customisations: {
961
+ content: {
962
+ strings: {
963
+ Liveboard: 'Dashboard',
964
+ },
965
+ stringIDsUrl: 'https://sample-string-ids-url.com',
966
+ stringIDs: {
967
+ 'liveboard.header.title': 'Dashboard name',
968
+ },
969
+ },
970
+ style: {
971
+ customCSS: {},
972
+ customCSSUrl: undefined,
973
+ },
974
+ },
975
+ authToken: 'test_auth_token1',
976
+ runtimeFilterParams: null,
977
+ runtimeParameterParams: null,
978
+ hiddenHomeLeftNavItems: [],
979
+ hiddenHomepageModules: [],
980
+ hiddenListColumns: [],
981
+ hostConfig: undefined,
982
+ reorderedHomepageModules: [],
983
+ customVariablesForThirdPartyTools: {},
984
+ },
985
+ });
986
+ const customisationContent = mockPort.postMessage.mock.calls[0][0].data.customisations.content;
987
+ expect(customisationContent.stringIDsUrl)
988
+ .toBe('https://sample-string-ids-url.com');
989
+ expect(customisationContent.stringIDs)
990
+ .toEqual({
991
+ 'liveboard.header.title': 'Dashboard name',
992
+ });
993
+ });
994
+ });
995
+
996
+ test('should allow passing exposeTranslationIDs in viewConfig', async () => {
997
+ const mockEmbedEventPayload = {
998
+ type: EmbedEvent.APP_INIT,
999
+ data: {},
1000
+ };
1001
+ const searchEmbed = new SearchEmbed(getRootEl(), { ...defaultViewConfig, exposeTranslationIDs: true });
1002
+ searchEmbed.render();
1003
+ const mockPort: any = {
1004
+ postMessage: jest.fn(),
1005
+ };
1006
+
1007
+ await executeAfterWait(() => {
1008
+ const iframe = getIFrameEl();
1009
+ expect(iframe.src).toContain('exposeTranslationIDs=true');
1010
+ postMessageToParent(iframe.contentWindow, mockEmbedEventPayload, mockPort);
1011
+ });
1012
+ });
1013
+ });
1014
+
897
1015
  describe('Token fetch fails in cookieless authentication authType', () => {
898
1016
  beforeEach(() => {
899
1017
  jest.spyOn(authInstance, 'doCookielessTokenAuth').mockResolvedValueOnce(true);
@@ -377,6 +377,7 @@ export class TsEmbed {
377
377
  : [],
378
378
  customVariablesForThirdPartyTools:
379
379
  this.embedConfig.customVariablesForThirdPartyTools || {},
380
+ hiddenListColumns: this.viewConfig.hiddenListColumns || [],
380
381
  };
381
382
  }
382
383
 
@@ -538,6 +539,8 @@ export class TsEmbed {
538
539
  insertInToSlide,
539
540
  disableRedirectionLinksInNewTab,
540
541
  overrideOrgId,
542
+ exposeTranslationIDs,
543
+ primaryAction,
541
544
  } = this.viewConfig;
542
545
 
543
546
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
@@ -552,6 +555,10 @@ export class TsEmbed {
552
555
  return queryParams;
553
556
  }
554
557
 
558
+ if (primaryAction) {
559
+ queryParams[Param.PrimaryAction] = primaryAction;
560
+ }
561
+
555
562
  if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
556
563
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
557
564
  return queryParams;
@@ -563,6 +570,9 @@ export class TsEmbed {
563
570
  if (disabledActionReason) {
564
571
  queryParams[Param.DisableActionReason] = disabledActionReason;
565
572
  }
573
+ if (exposeTranslationIDs) {
574
+ queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
575
+ }
566
576
  queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions ?? [])];
567
577
  if (Array.isArray(visibleActions)) {
568
578
  queryParams[Param.VisibleActions] = visibleActions;
@@ -592,6 +602,12 @@ export class TsEmbed {
592
602
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
593
603
  }
594
604
 
605
+ const stringIDsUrl = customizations?.content?.stringIDsUrl
606
+ || embedCustomizations?.content?.stringIDsUrl;
607
+ if (stringIDsUrl) {
608
+ queryParams[Param.StringIDsUrl] = stringIDsUrl;
609
+ }
610
+
595
611
  if (showAlerts !== undefined) {
596
612
  queryParams[Param.ShowAlerts] = showAlerts;
597
613
  }
package/src/index.ts CHANGED
@@ -52,6 +52,7 @@ import {
52
52
  LogLevel,
53
53
  VizPoint,
54
54
  CustomActionPayload,
55
+ ListPageColumns,
55
56
  } from './types';
56
57
  import { CustomCssVariables } from './css-variables';
57
58
  import { SageEmbed, SageViewConfig } from './embed/sage';
@@ -129,6 +130,7 @@ export {
129
130
  VizPoint,
130
131
  CustomActionPayload,
131
132
  UIPassthroughEvent,
133
+ ListPageColumns,
132
134
  };
133
135
 
134
136
  export { resetCachedAuthToken } from './authToken';
@@ -444,4 +444,5 @@ export {
444
444
  HomepageModule,
445
445
  LogLevel,
446
446
  getSessionInfo,
447
+ ListPageColumns,
447
448
  } from '../index';