@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.
@@ -2629,7 +2629,7 @@ export declare enum EmbedEvent {
2629
2629
  */
2630
2630
  Load = "load",
2631
2631
  /**
2632
- * Data pertaining to an Answer or Liveboard is received.
2632
+ * Data pertaining to an Answer, Liveboard or Spotter visualization is received.
2633
2633
  * The event payload includes the raw data of the object.
2634
2634
  * @return data - Answer of Liveboard data
2635
2635
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
@@ -3048,6 +3048,17 @@ export declare enum EmbedEvent {
3048
3048
  *```
3049
3049
  */
3050
3050
  AnswerDelete = "answerDelete",
3051
+ /**
3052
+ * Emitted when the AI Highlights action is triggered on a Liveboard
3053
+ * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
3054
+ * @example
3055
+ *```js
3056
+ * liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
3057
+ * console.log('AI Highlights', payload);
3058
+ * })
3059
+ *```
3060
+ */
3061
+ AIHighlights = "AIHighlights",
3051
3062
  /**
3052
3063
  * Emitted when a user initiates the Pin action to
3053
3064
  * add an Answer to a Liveboard.
@@ -3997,7 +4008,7 @@ export declare enum HostEvent {
3997
4008
  * the following parameters:
3998
4009
  *
3999
4010
  * @param
4000
- * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
4011
+ * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
4001
4012
  * Optional when pinning a new chart or table generated from a Search query.
4002
4013
  * **Required** in Spotter Embed.
4003
4014
  * @param
@@ -4049,10 +4060,16 @@ export declare enum HostEvent {
4049
4060
  * ```
4050
4061
  * @example
4051
4062
  * ```js
4052
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
4053
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4054
- * });
4055
- * ```
4063
+
4064
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
4065
+ * let latestSpotterVizId = '';
4066
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4067
+ * latestSpotterVizId = payload.data.id;
4068
+ * });
4069
+ *
4070
+ * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
4071
+ * ```
4072
+ *
4056
4073
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4057
4074
  */
4058
4075
  Pin = "pin",
@@ -4127,14 +4144,29 @@ export declare enum HostEvent {
4127
4144
  * ```
4128
4145
  * @example
4129
4146
  * ```js
4130
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
4131
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4132
- * });
4133
- * ```
4147
+
4148
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
4149
+ * let latestSpotterVizId = '';
4150
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4151
+ * latestSpotterVizId = payload.data.id;
4152
+ * });
4153
+ *
4154
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
4155
+ * ```
4134
4156
  *
4135
4157
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4136
4158
  */
4137
4159
  DownloadAsPdf = "downloadAsPdf",
4160
+ /**
4161
+ * Trigger the **AI Highlights** action on an embedded Liveboard
4162
+ *
4163
+ * @example
4164
+ * ```js
4165
+ * liveboardEmbed.trigger(HostEvent.AIHighlights)
4166
+ * ```
4167
+ * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
4168
+ */
4169
+ AIHighlights = "AIHighlights",
4138
4170
  /**
4139
4171
  * Trigger the **Make a copy** action on a Liveboard,
4140
4172
  * visualization, or Answer page.
@@ -4157,10 +4189,14 @@ export declare enum HostEvent {
4157
4189
  * ```
4158
4190
  * @example
4159
4191
  * ```js
4160
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
4161
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4162
- * });
4163
- * ```
4192
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
4193
+ * let latestSpotterVizId = '';
4194
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4195
+ * latestSpotterVizId = payload.data.id;
4196
+ * });
4197
+ *
4198
+ * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
4199
+ * ```
4164
4200
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4165
4201
  */
4166
4202
  MakeACopy = "makeACopy",
@@ -4245,15 +4281,7 @@ export declare enum HostEvent {
4245
4281
  * ```
4246
4282
  * @example
4247
4283
  * ```js
4248
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
4249
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4250
- * });
4251
- * ```
4252
- * @example
4253
- * ```js
4254
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
4255
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4256
- * });
4284
+ * spotterEmbed.trigger(HostEvent.Edit);
4257
4285
  * ```
4258
4286
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
4259
4287
  */
@@ -4302,16 +4330,23 @@ export declare enum HostEvent {
4302
4330
  * );
4303
4331
  * })
4304
4332
  * ```
4305
- * @example
4333
+ * * @example
4306
4334
  * ```js
4307
- * spotterEmbed.trigger(HostEvent.GetTML, {
4308
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
4335
+
4336
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
4337
+ * let latestSpotterVizId = '';
4338
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4339
+ * latestSpotterVizId = payload.data.id;
4340
+ * });
4341
+ *
4342
+ * spotterEmbed.trigger(HostEvent.GetTML, {
4343
+ * vizId: latestSpotterVizId
4309
4344
  * }).then((tml) => {
4310
4345
  * console.log(
4311
4346
  * tml.answer.search_query // TML representation of the search query
4312
4347
  * );
4313
4348
  * })
4314
- * ```
4349
+ * ```
4315
4350
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
4316
4351
  * @important
4317
4352
  */
@@ -4375,7 +4410,7 @@ export declare enum HostEvent {
4375
4410
  /**
4376
4411
  * Trigger the **Download** action on charts in
4377
4412
  * the embedded view.
4378
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4413
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
4379
4414
  * @example
4380
4415
  * ```js
4381
4416
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -4385,10 +4420,14 @@ export declare enum HostEvent {
4385
4420
  * embed.trigger(HostEvent.Download)
4386
4421
  * ```
4387
4422
  * ```js
4388
- * spotterEmbed.trigger(HostEvent.Download, {
4389
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
4390
- * });
4391
- * ```
4423
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
4424
+ * let latestSpotterVizId = '';
4425
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4426
+ * latestSpotterVizId = payload.data.id;
4427
+ * });
4428
+ *
4429
+ * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
4430
+ * ```
4392
4431
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
4393
4432
  * Use {@link DownloadAsPng}
4394
4433
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -4406,9 +4445,13 @@ export declare enum HostEvent {
4406
4445
  *
4407
4446
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
4408
4447
  *
4409
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
4410
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
4411
- * })
4448
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
4449
+ * let latestSpotterVizId = '';
4450
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4451
+ * latestSpotterVizId = payload.data.id;
4452
+ * });
4453
+ *
4454
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
4412
4455
  * ```
4413
4456
  *
4414
4457
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
@@ -4417,7 +4460,7 @@ export declare enum HostEvent {
4417
4460
  /**
4418
4461
  * Trigger the **Download** > **CSV** action on tables in
4419
4462
  * the embedded view.
4420
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4463
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
4421
4464
  * @example
4422
4465
  * ```js
4423
4466
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -4430,9 +4473,13 @@ export declare enum HostEvent {
4430
4473
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
4431
4474
  * ```
4432
4475
  * ```js
4433
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
4434
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
4435
- * })
4476
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
4477
+ * let latestSpotterVizId = '';
4478
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4479
+ * latestSpotterVizId = payload.data.id;
4480
+ * });
4481
+ *
4482
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
4436
4483
  * ```
4437
4484
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
4438
4485
  */
@@ -4440,7 +4487,7 @@ export declare enum HostEvent {
4440
4487
  /**
4441
4488
  * Trigger the **Download** > **XLSX** action on tables
4442
4489
  * in the embedded view.
4443
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4490
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
4444
4491
  * @example
4445
4492
  * ```js
4446
4493
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -4453,9 +4500,13 @@ export declare enum HostEvent {
4453
4500
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
4454
4501
  * ```
4455
4502
  * ```js
4456
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
4457
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
4458
- * })
4503
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
4504
+ * let latestSpotterVizId = '';
4505
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4506
+ * latestSpotterVizId = payload.data.id;
4507
+ * });
4508
+ *
4509
+ * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
4459
4510
  * ```
4460
4511
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
4461
4512
  */
@@ -4492,7 +4543,7 @@ export declare enum HostEvent {
4492
4543
  * ```
4493
4544
  *
4494
4545
  * ```js
4495
- * // Save an Answer in Spotter (requires vizId)
4546
+ * // Save a Visualization in Spotter (requires vizId)
4496
4547
  * spotterEmbed.trigger(HostEvent.Save, {
4497
4548
  * vizId: "730496d6-6903-4601-937e-2c691821af3c"
4498
4549
  * })
@@ -4793,15 +4844,21 @@ export declare enum HostEvent {
4793
4844
  ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView",
4794
4845
  /**
4795
4846
  * Triggers an action to update Parameter values on embedded
4796
- * Answers, Liveboard and Spotter answer in Edit mode.
4847
+ * Answers, Liveboard, and Spotter answer in Edit mode.
4848
+ * @param - `name` - Name of the Parameter
4849
+ * @param - `value` - The value to set for the Parameter.
4850
+ *
4851
+ * Optionally, to control the visibility of the Parameter chip,
4852
+ * use the `isVisibleToUser` attribute when applying an override.
4797
4853
  *
4798
4854
  * @example
4799
4855
  * ```js
4800
4856
  * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
4801
- * name: "Color",
4802
- * value: "almond"
4857
+ * name: "Integer Range Param",
4858
+ * value: 10,
4859
+ * isVisibleToUser: false
4803
4860
  * }])
4804
- *
4861
+ * ```
4805
4862
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
4806
4863
  */
4807
4864
  UpdateParameters = "UpdateParameters",
@@ -4814,11 +4871,13 @@ export declare enum HostEvent {
4814
4871
  * });
4815
4872
  *```
4816
4873
  *```js
4817
- * spotterEmbed.trigger(HostEvent.GetParameters, {
4818
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
4819
- * }).then((parameter) => {
4820
- * console.log('parameters', parameter);
4821
- * });
4874
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
4875
+ * let latestSpotterVizId = '';
4876
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4877
+ * latestSpotterVizId = payload.data.id;
4878
+ * });
4879
+ *
4880
+ * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
4822
4881
  *```
4823
4882
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
4824
4883
  */
@@ -4848,10 +4907,11 @@ export declare enum HostEvent {
4848
4907
  * If no parameters are specified, the save action is
4849
4908
  * triggered with a modal to prompt users to
4850
4909
  * add a name and description for the Answer.
4851
- * @param - optional attributes to set Answer properties.
4852
- * `name` - Name string for the Answer.
4853
- * `description` - Description text for the Answer.
4854
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4910
+ * @param - `vizId` refers to the Answer ID in Spotter embed
4911
+ * and is required in Spotter embed.
4912
+ * Optional attributes to set Answer properties include:
4913
+ * @param - `name` - Name string for the Answer.
4914
+ * @param - `description` - Description text for the Answer.
4855
4915
  * @example
4856
4916
  * ```js
4857
4917
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -4861,11 +4921,13 @@ export declare enum HostEvent {
4861
4921
  * ```
4862
4922
  * @example
4863
4923
  * ```js
4864
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
4865
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
4866
- * name: "Sales by states",
4867
- * description: "Total sales by states in MidWest"
4924
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
4925
+ * let latestSpotterVizId = '';
4926
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
4927
+ * latestSpotterVizId = payload.data.id;
4868
4928
  * });
4929
+ *
4930
+ * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
4869
4931
  * ```
4870
4932
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
4871
4933
  */
@@ -4949,12 +5011,15 @@ export declare enum HostEvent {
4949
5011
  DeleteLastPrompt = "DeleteLastPrompt",
4950
5012
  /**
4951
5013
  * Toggle the visualization to chart or table view.
4952
- * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
5014
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
4953
5015
  * @example
4954
5016
  * ```js
4955
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
4956
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
5017
+ * let latestSpotterVizId = '';
5018
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
5019
+ * latestSpotterVizId = payload.data.id;
4957
5020
  * });
5021
+ *
5022
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
4958
5023
  *```
4959
5024
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
4960
5025
  */
@@ -4983,12 +5048,16 @@ export declare enum HostEvent {
4983
5048
  */
4984
5049
  VisibleEmbedCoordinates = "visibleEmbedCoordinates",
4985
5050
  /**
4986
- * Trigger the *Ask Spotter* action for visualizations
4987
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
5051
+ * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
5052
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
4988
5053
  * @example
4989
5054
  * ```js
4990
- * spotterEmbed.trigger(HostEvent.AskSpotter,
4991
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
5055
+ * let latestSpotterVizId = '';
5056
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
5057
+ * latestSpotterVizId = payload.data.id;
5058
+ * });
5059
+ *
5060
+ * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
4992
5061
  * ```
4993
5062
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4994
5063
  */