@thoughtspot/visual-embed-sdk 1.42.3 → 1.43.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.
@@ -2644,7 +2644,7 @@ export declare enum EmbedEvent {
2644
2644
  */
2645
2645
  Load = "load",
2646
2646
  /**
2647
- * Data pertaining to an Answer or Liveboard is received.
2647
+ * Data pertaining to an Answer, Liveboard or Spotter visualization is received.
2648
2648
  * The event payload includes the raw data of the object.
2649
2649
  * @return data - Answer of Liveboard data
2650
2650
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
@@ -3063,6 +3063,17 @@ export declare enum EmbedEvent {
3063
3063
  *```
3064
3064
  */
3065
3065
  AnswerDelete = "answerDelete",
3066
+ /**
3067
+ * Emitted when the AI Highlights action is triggered on a Liveboard
3068
+ * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
3069
+ * @example
3070
+ *```js
3071
+ * liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
3072
+ * console.log('AI Highlights', payload);
3073
+ * })
3074
+ *```
3075
+ */
3076
+ AIHighlights = "AIHighlights",
3066
3077
  /**
3067
3078
  * Emitted when a user initiates the Pin action to
3068
3079
  * add an Answer to a Liveboard.
@@ -4012,7 +4023,7 @@ export declare enum HostEvent {
4012
4023
  * the following parameters:
4013
4024
  *
4014
4025
  * @param
4015
- * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
4026
+ * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
4016
4027
  * Optional when pinning a new chart or table generated from a Search query.
4017
4028
  * **Required** in Spotter Embed.
4018
4029
  * @param
@@ -4064,10 +4075,16 @@ export declare enum HostEvent {
4064
4075
  * ```
4065
4076
  * @example
4066
4077
  * ```js
4067
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
4068
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4069
- * });
4070
- * ```
4078
+
4079
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
4080
+ * let latestSpotterVizId = '';
4081
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4082
+ * latestSpotterVizId = payload.data.id;
4083
+ * });
4084
+ *
4085
+ * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
4086
+ * ```
4087
+ *
4071
4088
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4072
4089
  */
4073
4090
  Pin = "pin",
@@ -4142,14 +4159,29 @@ export declare enum HostEvent {
4142
4159
  * ```
4143
4160
  * @example
4144
4161
  * ```js
4145
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
4146
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4147
- * });
4148
- * ```
4162
+
4163
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
4164
+ * let latestSpotterVizId = '';
4165
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4166
+ * latestSpotterVizId = payload.data.id;
4167
+ * });
4168
+ *
4169
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
4170
+ * ```
4149
4171
  *
4150
4172
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4151
4173
  */
4152
4174
  DownloadAsPdf = "downloadAsPdf",
4175
+ /**
4176
+ * Trigger the **AI Highlights** action on an embedded Liveboard
4177
+ *
4178
+ * @example
4179
+ * ```js
4180
+ * liveboardEmbed.trigger(HostEvent.AIHighlights)
4181
+ * ```
4182
+ * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
4183
+ */
4184
+ AIHighlights = "AIHighlights",
4153
4185
  /**
4154
4186
  * Trigger the **Make a copy** action on a Liveboard,
4155
4187
  * visualization, or Answer page.
@@ -4172,10 +4204,14 @@ export declare enum HostEvent {
4172
4204
  * ```
4173
4205
  * @example
4174
4206
  * ```js
4175
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
4176
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4177
- * });
4178
- * ```
4207
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
4208
+ * let latestSpotterVizId = '';
4209
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4210
+ * latestSpotterVizId = payload.data.id;
4211
+ * });
4212
+ *
4213
+ * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
4214
+ * ```
4179
4215
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4180
4216
  */
4181
4217
  MakeACopy = "makeACopy",
@@ -4260,15 +4296,7 @@ export declare enum HostEvent {
4260
4296
  * ```
4261
4297
  * @example
4262
4298
  * ```js
4263
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
4264
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4265
- * });
4266
- * ```
4267
- * @example
4268
- * ```js
4269
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
4270
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4271
- * });
4299
+ * spotterEmbed.trigger(HostEvent.Edit);
4272
4300
  * ```
4273
4301
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4274
4302
  */
@@ -4317,16 +4345,23 @@ export declare enum HostEvent {
4317
4345
  * );
4318
4346
  * })
4319
4347
  * ```
4320
- * @example
4348
+ * * @example
4321
4349
  * ```js
4322
- * spotterEmbed.trigger(HostEvent.GetTML, {
4323
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
4350
+
4351
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
4352
+ * let latestSpotterVizId = '';
4353
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4354
+ * latestSpotterVizId = payload.data.id;
4355
+ * });
4356
+ *
4357
+ * spotterEmbed.trigger(HostEvent.GetTML, {
4358
+ * vizId: latestSpotterVizId
4324
4359
  * }).then((tml) => {
4325
4360
  * console.log(
4326
4361
  * tml.answer.search_query // TML representation of the search query
4327
4362
  * );
4328
4363
  * })
4329
- * ```
4364
+ * ```
4330
4365
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
4331
4366
  * @important
4332
4367
  */
@@ -4390,7 +4425,7 @@ export declare enum HostEvent {
4390
4425
  /**
4391
4426
  * Trigger the **Download** action on charts in
4392
4427
  * the embedded view.
4393
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4428
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
4394
4429
  * @example
4395
4430
  * ```js
4396
4431
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -4400,10 +4435,14 @@ export declare enum HostEvent {
4400
4435
  * embed.trigger(HostEvent.Download)
4401
4436
  * ```
4402
4437
  * ```js
4403
- * spotterEmbed.trigger(HostEvent.Download, {
4404
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4405
- * });
4406
- * ```
4438
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
4439
+ * let latestSpotterVizId = '';
4440
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4441
+ * latestSpotterVizId = payload.data.id;
4442
+ * });
4443
+ *
4444
+ * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
4445
+ * ```
4407
4446
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
4408
4447
  * Use {@link DownloadAsPng}
4409
4448
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -4421,9 +4460,13 @@ export declare enum HostEvent {
4421
4460
  *
4422
4461
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
4423
4462
  *
4424
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
4425
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
4426
- * })
4463
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
4464
+ * let latestSpotterVizId = '';
4465
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4466
+ * latestSpotterVizId = payload.data.id;
4467
+ * });
4468
+ *
4469
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
4427
4470
  * ```
4428
4471
  *
4429
4472
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
@@ -4432,7 +4475,7 @@ export declare enum HostEvent {
4432
4475
  /**
4433
4476
  * Trigger the **Download** > **CSV** action on tables in
4434
4477
  * the embedded view.
4435
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4478
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
4436
4479
  * @example
4437
4480
  * ```js
4438
4481
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -4445,9 +4488,13 @@ export declare enum HostEvent {
4445
4488
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
4446
4489
  * ```
4447
4490
  * ```js
4448
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
4449
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
4450
- * })
4491
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
4492
+ * let latestSpotterVizId = '';
4493
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4494
+ * latestSpotterVizId = payload.data.id;
4495
+ * });
4496
+ *
4497
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
4451
4498
  * ```
4452
4499
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
4453
4500
  */
@@ -4455,7 +4502,7 @@ export declare enum HostEvent {
4455
4502
  /**
4456
4503
  * Trigger the **Download** > **XLSX** action on tables
4457
4504
  * in the embedded view.
4458
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4505
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
4459
4506
  * @example
4460
4507
  * ```js
4461
4508
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -4468,9 +4515,13 @@ export declare enum HostEvent {
4468
4515
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
4469
4516
  * ```
4470
4517
  * ```js
4471
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
4472
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
4473
- * })
4518
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
4519
+ * let latestSpotterVizId = '';
4520
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4521
+ * latestSpotterVizId = payload.data.id;
4522
+ * });
4523
+ *
4524
+ * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
4474
4525
  * ```
4475
4526
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
4476
4527
  */
@@ -4507,7 +4558,7 @@ export declare enum HostEvent {
4507
4558
  * ```
4508
4559
  *
4509
4560
  * ```js
4510
- * // Save an Answer in Spotter (requires vizId)
4561
+ * // Save a Visualization in Spotter (requires vizId)
4511
4562
  * spotterEmbed.trigger(HostEvent.Save, {
4512
4563
  * vizId: "730496d6-6903-4601-937e-2c691821af3c"
4513
4564
  * })
@@ -4808,15 +4859,21 @@ export declare enum HostEvent {
4808
4859
  ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView",
4809
4860
  /**
4810
4861
  * Triggers an action to update Parameter values on embedded
4811
- * Answers, Liveboard and Spotter answer in Edit mode.
4862
+ * Answers, Liveboard, and Spotter answer in Edit mode.
4863
+ * @param - `name` - Name of the Parameter
4864
+ * @param - `value` - The value to set for the Parameter.
4865
+ *
4866
+ * Optionally, to control the visibility of the Parameter chip,
4867
+ * use the `isVisibleToUser` attribute when applying an override.
4812
4868
  *
4813
4869
  * @example
4814
4870
  * ```js
4815
4871
  * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
4816
- * name: "Color",
4817
- * value: "almond"
4872
+ * name: "Integer Range Param",
4873
+ * value: 10,
4874
+ * isVisibleToUser: false
4818
4875
  * }])
4819
- *
4876
+ * ```
4820
4877
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
4821
4878
  */
4822
4879
  UpdateParameters = "UpdateParameters",
@@ -4829,11 +4886,13 @@ export declare enum HostEvent {
4829
4886
  * });
4830
4887
  *```
4831
4888
  *```js
4832
- * spotterEmbed.trigger(HostEvent.GetParameters, {
4833
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
4834
- * }).then((parameter) => {
4835
- * console.log('parameters', parameter);
4836
- * });
4889
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
4890
+ * let latestSpotterVizId = '';
4891
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4892
+ * latestSpotterVizId = payload.data.id;
4893
+ * });
4894
+ *
4895
+ * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
4837
4896
  *```
4838
4897
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
4839
4898
  */
@@ -4863,10 +4922,11 @@ export declare enum HostEvent {
4863
4922
  * If no parameters are specified, the save action is
4864
4923
  * triggered with a modal to prompt users to
4865
4924
  * add a name and description for the Answer.
4866
- * @param - optional attributes to set Answer properties.
4867
- * `name` - Name string for the Answer.
4868
- * `description` - Description text for the Answer.
4869
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4925
+ * @param - `vizId` refers to the Answer ID in Spotter embed
4926
+ * and is required in Spotter embed.
4927
+ * Optional attributes to set Answer properties include:
4928
+ * @param - `name` - Name string for the Answer.
4929
+ * @param - `description` - Description text for the Answer.
4870
4930
  * @example
4871
4931
  * ```js
4872
4932
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -4876,11 +4936,13 @@ export declare enum HostEvent {
4876
4936
  * ```
4877
4937
  * @example
4878
4938
  * ```js
4879
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
4880
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
4881
- * name: "Sales by states",
4882
- * description: "Total sales by states in MidWest"
4939
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
4940
+ * let latestSpotterVizId = '';
4941
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4942
+ * latestSpotterVizId = payload.data.id;
4883
4943
  * });
4944
+ *
4945
+ * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
4884
4946
  * ```
4885
4947
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
4886
4948
  */
@@ -4964,12 +5026,15 @@ export declare enum HostEvent {
4964
5026
  DeleteLastPrompt = "DeleteLastPrompt",
4965
5027
  /**
4966
5028
  * Toggle the visualization to chart or table view.
4967
- * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
5029
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
4968
5030
  * @example
4969
5031
  * ```js
4970
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
4971
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
5032
+ * let latestSpotterVizId = '';
5033
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
5034
+ * latestSpotterVizId = payload.data.id;
4972
5035
  * });
5036
+ *
5037
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
4973
5038
  *```
4974
5039
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
4975
5040
  */
@@ -4998,12 +5063,16 @@ export declare enum HostEvent {
4998
5063
  */
4999
5064
  VisibleEmbedCoordinates = "visibleEmbedCoordinates",
5000
5065
  /**
5001
- * Trigger the *Ask Spotter* action for visualizations
5002
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
5066
+ * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
5067
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
5003
5068
  * @example
5004
5069
  * ```js
5005
- * spotterEmbed.trigger(HostEvent.AskSpotter,
5006
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
5070
+ * let latestSpotterVizId = '';
5071
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
5072
+ * latestSpotterVizId = payload.data.id;
5073
+ * });
5074
+ *
5075
+ * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
5007
5076
  * ```
5008
5077
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
5009
5078
  */