@thoughtspot/visual-embed-sdk 1.45.3 → 1.46.1

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 (81) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +2 -2
  3. package/cjs/src/auth.d.ts +35 -2
  4. package/cjs/src/auth.d.ts.map +1 -1
  5. package/cjs/src/auth.js +36 -3
  6. package/cjs/src/auth.js.map +1 -1
  7. package/cjs/src/embed/app.d.ts +1 -1
  8. package/cjs/src/embed/app.d.ts.map +1 -1
  9. package/cjs/src/embed/app.js +6 -6
  10. package/cjs/src/embed/app.js.map +1 -1
  11. package/cjs/src/embed/app.spec.js +87 -119
  12. package/cjs/src/embed/app.spec.js.map +1 -1
  13. package/cjs/src/embed/conversation.d.ts +1 -1
  14. package/cjs/src/embed/liveboard.d.ts +2 -2
  15. package/cjs/src/embed/liveboard.js +2 -2
  16. package/cjs/src/embed/search.d.ts +3 -2
  17. package/cjs/src/embed/search.d.ts.map +1 -1
  18. package/cjs/src/embed/search.js +3 -2
  19. package/cjs/src/embed/search.js.map +1 -1
  20. package/cjs/src/embed/ts-embed.d.ts +1 -1
  21. package/cjs/src/embed/ts-embed.js +1 -1
  22. package/cjs/src/react/index.d.ts +1 -1
  23. package/cjs/src/types.d.ts +408 -66
  24. package/cjs/src/types.d.ts.map +1 -1
  25. package/cjs/src/types.js +116 -52
  26. package/cjs/src/types.js.map +1 -1
  27. package/dist/{index-BuwECGdm.js → index-Vyh6Ha5f.js} +1 -1
  28. package/dist/src/auth.d.ts +35 -2
  29. package/dist/src/auth.d.ts.map +1 -1
  30. package/dist/src/embed/app.d.ts +1 -1
  31. package/dist/src/embed/app.d.ts.map +1 -1
  32. package/dist/src/embed/conversation.d.ts +1 -1
  33. package/dist/src/embed/liveboard.d.ts +2 -2
  34. package/dist/src/embed/search.d.ts +3 -2
  35. package/dist/src/embed/search.d.ts.map +1 -1
  36. package/dist/src/embed/ts-embed.d.ts +1 -1
  37. package/dist/src/react/index.d.ts +1 -1
  38. package/dist/src/types.d.ts +408 -66
  39. package/dist/src/types.d.ts.map +1 -1
  40. package/dist/tsembed-react.es.js +167 -69
  41. package/dist/tsembed-react.js +166 -68
  42. package/dist/tsembed.es.js +167 -69
  43. package/dist/tsembed.js +166 -68
  44. package/dist/visual-embed-sdk-react-full.d.ts +446 -71
  45. package/dist/visual-embed-sdk-react.d.ts +439 -67
  46. package/dist/visual-embed-sdk.d.ts +445 -70
  47. package/lib/package.json +2 -2
  48. package/lib/src/auth.d.ts +35 -2
  49. package/lib/src/auth.d.ts.map +1 -1
  50. package/lib/src/auth.js +36 -3
  51. package/lib/src/auth.js.map +1 -1
  52. package/lib/src/embed/app.d.ts +1 -1
  53. package/lib/src/embed/app.d.ts.map +1 -1
  54. package/lib/src/embed/app.js +6 -6
  55. package/lib/src/embed/app.js.map +1 -1
  56. package/lib/src/embed/app.spec.js +87 -119
  57. package/lib/src/embed/app.spec.js.map +1 -1
  58. package/lib/src/embed/conversation.d.ts +1 -1
  59. package/lib/src/embed/liveboard.d.ts +2 -2
  60. package/lib/src/embed/liveboard.js +2 -2
  61. package/lib/src/embed/search.d.ts +3 -2
  62. package/lib/src/embed/search.d.ts.map +1 -1
  63. package/lib/src/embed/search.js +3 -2
  64. package/lib/src/embed/search.js.map +1 -1
  65. package/lib/src/embed/ts-embed.d.ts +1 -1
  66. package/lib/src/embed/ts-embed.js +1 -1
  67. package/lib/src/react/index.d.ts +1 -1
  68. package/lib/src/types.d.ts +408 -66
  69. package/lib/src/types.d.ts.map +1 -1
  70. package/lib/src/types.js +116 -52
  71. package/lib/src/types.js.map +1 -1
  72. package/package.json +2 -2
  73. package/src/auth.ts +36 -3
  74. package/src/embed/app.spec.ts +171 -211
  75. package/src/embed/app.ts +16 -11
  76. package/src/embed/conversation.ts +1 -1
  77. package/src/embed/liveboard.ts +2 -2
  78. package/src/embed/search.ts +3 -2
  79. package/src/embed/ts-embed.ts +1 -1
  80. package/src/react/index.tsx +1 -1
  81. package/src/types.ts +409 -67
@@ -661,18 +661,154 @@ export interface EmbedConfig {
661
661
  * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl
662
662
  * @example
663
663
  * ```js
664
- * import { CustomActionPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
664
+ * import { CustomActionsPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
665
665
  * init({
666
666
  * ... // other embed config options
667
667
  * customActions: [
668
668
  * {
669
- * name: 'customAction',
670
- * id: 'customAction',
669
+ * // Unique identifier for the custom action
670
+ * id: 'my-custom-action',
671
+ *
672
+ * // Display name shown to users in the UI
673
+ * name: 'My Custom Action',
674
+ *
675
+ * // Where the action appears in the UI
676
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
677
+ * // MENU: Shows in the "More" menu (three dots menu)
678
+ * // CONTEXTMENU: Shows in the right-click context menu
679
+ * position: CustomActionsPosition.PRIMARY,
680
+ *
681
+ * // What type of content this action applies to
682
+ * // ANSWER: Available on answer pages
683
+ * target: CustomActionTarget.ANSWER,
684
+ *
685
+ * // Optional: Restrict where this action appears based on data models
686
+ * // dataModelIds: {
687
+ * // // Restrict to specific data models
688
+ * // modelIds: ['model-id-1', 'model-id-2'],
689
+ * // // Restrict to specific columns within models
690
+ * // modelColumnNames: ['model-id::column-name']
691
+ * // },
692
+ *
693
+ * // Optional: Restrict where this action appears based on metadata
694
+ * // metadataIds: {
695
+ * // // Restrict to specific answers
696
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
697
+ * // },
698
+ * // // Restrict to specific groups (for group-based access control)
699
+ * // groupIds: ['group-id-1', 'group-id-2'],
700
+ * // // Restrict to specific organizations (for multi-org deployments)
701
+ * // orgIds: ['org-id-1', 'org-id-2'],
702
+ * }
703
+ * ],
704
+ * })
705
+ * ```
706
+ * @example
707
+ * ```js
708
+ * import { CustomActionsPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
709
+ * init({
710
+ * ... // other embed config options
711
+ * customActions: [
712
+ * {
713
+ * // Unique identifier for the custom action
714
+ * id: 'my-custom-action',
715
+ *
716
+ * // Display name shown to users in the UI
717
+ * name: 'My Custom Action',
718
+ *
719
+ * // Where the action appears in the UI
720
+ * // MENU: Shows in the "More" menu (three dots menu)
721
+ * // CONTEXTMENU: Shows in the right-click context menu
722
+ * position: CustomActionsPosition.MENU,
723
+ *
724
+ * // What type of content this action applies to
725
+ * // SPOTTER: Available in Spotter (AI-powered search)
726
+ * target: CustomActionTarget.SPOTTER,
727
+ *
728
+ * // Optional: Restrict where this action appears based on data models
729
+ * // dataModelIds: {
730
+ * // // Restrict to specific data models
731
+ * // modelIds: ['model-id-1', 'model-id-2'],
732
+ * // },
733
+ * // // Restrict to specific groups (for group-based access control)
734
+ * // groupIds: ['group-id-1'],
735
+ * // // Restrict to specific organizations (for multi-org deployments)
736
+ * // orgIds: ['org-id-1'],
737
+ * }
738
+ * ],
739
+ * })
740
+ * ```
741
+ * @example
742
+ * ```js
743
+ * import { CustomActionsPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
744
+ * init({
745
+ * ... // other embed config options
746
+ * customActions: [
747
+ * {
748
+ * // Unique identifier for the custom action
749
+ * id: 'my-liveboard-custom-action',
750
+ *
751
+ * // Display name shown to users in the UI
752
+ * name: 'My Liveboard Custom Action',
753
+ *
754
+ * // Where the action appears in the UI
755
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
756
+ * // MENU: Shows in the "More" menu (three dots menu)
757
+ * position: CustomActionsPosition.PRIMARY,
758
+ *
759
+ * // What type of content this action applies to
760
+ * // LIVEBOARD: Available on liveboard pages
761
+ * target: CustomActionTarget.LIVEBOARD,
762
+ *
763
+ * // Optional: Restrict where this action appears based on metadata
764
+ * // metadataIds: {
765
+ * // // Restrict to specific liveboards
766
+ * // liveboardIds: ['liveboard-id-1', 'liveboard-id-2'],
767
+ * // },
768
+ * // // Restrict to specific groups (for group-based access control)
769
+ * // groupIds: ['group-id-1', 'group-id-2'],
770
+ * // // Restrict to specific organizations (for multi-org deployments)
771
+ * // orgIds: ['org-id-1', 'org-id-2'],
772
+ * },
773
+ * {
774
+ * // Unique identifier for the custom action
775
+ * id: 'my-viz-custom-action',
776
+ *
777
+ * // Display name shown to users in the UI
778
+ * name: 'My Viz Custom Action',
779
+ *
780
+ * // Where the action appears in the UI
781
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
782
+ * // MENU: Shows in the "More" menu (three dots menu)
783
+ * // CONTEXTMENU: Shows in the right-click context menu
784
+ * position: CustomActionsPosition.PRIMARY,
785
+ *
786
+ * // What type of content this action applies to
787
+ * // VIZ: Available on individual visualizations
671
788
  * target: CustomActionTarget.VIZ,
672
- * position: CustomActionPosition.PRIMARY,
673
- * }
789
+ *
790
+ * // Optional: Restrict where this action appears based on metadata
791
+ * // metadataIds: {
792
+ * // // Restrict to specific answers
793
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
794
+ * // // Restrict to specific liveboard. If liveboardId is
795
+ * // // passed, custom actions will appear on all vizzes of liveboard
796
+ * // liveboardIds: ['liveboard-id-1'],
797
+ * // // Restrict to specific vizIds
798
+ * // vizIds: ['viz-id-1']
799
+ * // },
800
+ * // dataModelIds: {
801
+ * // // Restrict to specific data models
802
+ * // modelIds: ['model-id-1', 'model-id-2'],
803
+ * // // Restrict to specific columns within models
804
+ * // modelColumnNames: ['model-id::column-name']
805
+ * // },
806
+ * // // Restrict to specific groups (for group-based access control)
807
+ * // groupIds: ['group-id-1', 'group-id-2'],
808
+ * // // Restrict to specific organizations (for multi-org deployments)
809
+ * // orgIds: ['org-id-1', 'org-id-2'],
674
810
  * }
675
- * ]
811
+ * ],
676
812
  * })
677
813
  * ```
678
814
  */
@@ -1062,7 +1198,7 @@ export interface BaseViewConfig extends ApiInterceptFlags {
1062
1198
  * ```ts
1063
1199
  * import {
1064
1200
  * CustomActionPayload,
1065
- * CustomActionPosition,
1201
+ * CustomActionsPosition,
1066
1202
  * CustomActionTarget,
1067
1203
  * } from '@thoughtspot/visual-embed-sdk';
1068
1204
  * // Use supported embed types such as AppEmbed or LiveboardEmbed
@@ -1070,13 +1206,41 @@ export interface BaseViewConfig extends ApiInterceptFlags {
1070
1206
  * ... // other embed config options
1071
1207
  * customActions: [
1072
1208
  * {
1073
- * name: 'customAction',
1074
- * id: 'customAction',
1075
- * target: CustomActionTarget.VIZ,
1076
- * position: CustomActionPosition.PRIMARY,
1077
- * }
1209
+ * // Unique identifier for the custom action
1210
+ * id: 'my-custom-action',
1211
+ *
1212
+ * // Display name shown to users in the UI
1213
+ * name: 'My Custom Action',
1214
+ *
1215
+ * // Where the action appears in the UI
1216
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
1217
+ * // MENU: Shows in the "More" menu (three dots menu)
1218
+ * // CONTEXTMENU: Shows in the right-click context menu
1219
+ * position: CustomActionsPosition.PRIMARY,
1220
+ *
1221
+ * // What type of content this action applies to
1222
+ * // ANSWER: Available on answer pages
1223
+ * target: CustomActionTarget.ANSWER,
1224
+ *
1225
+ * // Optional: Restrict where this action appears based on data models
1226
+ * // dataModelIds: {
1227
+ * // // Restrict to specific data models
1228
+ * // modelIds: ['model-id-1', 'model-id-2'],
1229
+ * // // Restrict to specific columns within models
1230
+ * // modelColumnNames: ['model-id::column-name']
1231
+ * // },
1232
+ *
1233
+ * // Optional: Restrict where this action appears based on metadata
1234
+ * // metadataIds: {
1235
+ * // // Restrict to specific answers
1236
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
1237
+ * // },
1238
+ * // // Restrict to specific groups (for group-based access control)
1239
+ * // groupIds: ['group-id-1', 'group-id-2'],
1240
+ * // // Restrict to specific organizations (for multi-org deployments)
1241
+ * // orgIds: ['org-id-1', 'org-id-2'],
1078
1242
  * }
1079
- * ]
1243
+ * ],
1080
1244
  * })
1081
1245
  *
1082
1246
  * // to trigger a custom flow on custom action click listen to Custom action embed event
@@ -1084,6 +1248,120 @@ export interface BaseViewConfig extends ApiInterceptFlags {
1084
1248
  * console.log('Custom Action event:', payload);
1085
1249
  * })
1086
1250
  * ```
1251
+ * @example
1252
+ * ```ts
1253
+ * import {
1254
+ * CustomActionsPosition,
1255
+ * CustomActionTarget,
1256
+ * } from '@thoughtspot/visual-embed-sdk';
1257
+ * const embed = new LiveboardEmbed('#tsEmbed', {
1258
+ * ... // other embed config options
1259
+ * customActions: [
1260
+ * {
1261
+ * // Unique identifier for the custom action
1262
+ * id: 'my-custom-action',
1263
+ *
1264
+ * // Display name shown to users in the UI
1265
+ * name: 'My Custom Action',
1266
+ *
1267
+ * // Where the action appears in the UI
1268
+ * // MENU: Shows in the "More" menu (three dots menu)
1269
+ * // CONTEXTMENU: Shows in the right-click context menu
1270
+ * position: CustomActionsPosition.MENU,
1271
+ *
1272
+ * // What type of content this action applies to
1273
+ * // SPOTTER: Available in Spotter (AI-powered search)
1274
+ * target: CustomActionTarget.SPOTTER,
1275
+ *
1276
+ * // Optional: Restrict where this action appears based on data models
1277
+ * // dataModelIds: {
1278
+ * // // Restrict to specific data models
1279
+ * // modelIds: ['model-id-1', 'model-id-2'],
1280
+ * // },
1281
+ * // // Restrict to specific groups (for group-based access control)
1282
+ * // groupIds: ['group-id-1'],
1283
+ * // // Restrict to specific organizations (for multi-org deployments)
1284
+ * // orgIds: ['org-id-1'],
1285
+ * }
1286
+ * ],
1287
+ * })
1288
+ * ```
1289
+ * @example
1290
+ * ```ts
1291
+ * import {
1292
+ * CustomActionsPosition,
1293
+ * CustomActionTarget,
1294
+ * } from '@thoughtspot/visual-embed-sdk';
1295
+ * const embed = new LiveboardEmbed('#tsEmbed', {
1296
+ * ... // other embed config options
1297
+ * customActions: [
1298
+ * {
1299
+ * // Unique identifier for the custom action
1300
+ * id: 'my-liveboard-custom-action',
1301
+ *
1302
+ * // Display name shown to users in the UI
1303
+ * name: 'My Liveboard Custom Action',
1304
+ *
1305
+ * // Where the action appears in the UI
1306
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
1307
+ * // MENU: Shows in the "More" menu (three dots menu)
1308
+ * position: CustomActionsPosition.PRIMARY,
1309
+ *
1310
+ * // What type of content this action applies to
1311
+ * // LIVEBOARD: Available on liveboard pages
1312
+ * target: CustomActionTarget.LIVEBOARD,
1313
+ *
1314
+ * // Optional: Restrict where this action appears based on metadata
1315
+ * // metadataIds: {
1316
+ * // // Restrict to specific liveboards
1317
+ * // liveboardIds: ['liveboard-id-1', 'liveboard-id-2'],
1318
+ * // },
1319
+ * // // Restrict to specific groups (for group-based access control)
1320
+ * // groupIds: ['group-id-1', 'group-id-2'],
1321
+ * // // Restrict to specific organizations (for multi-org deployments)
1322
+ * // orgIds: ['org-id-1', 'org-id-2'],
1323
+ * },
1324
+ * {
1325
+ * // Unique identifier for the custom action
1326
+ * id: 'my-viz-custom-action',
1327
+ *
1328
+ * // Display name shown to users in the UI
1329
+ * name: 'My Viz Custom Action',
1330
+ *
1331
+ * // Where the action appears in the UI
1332
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
1333
+ * // MENU: Shows in the "More" menu (three dots menu)
1334
+ * // CONTEXTMENU: Shows in the right-click context menu
1335
+ * position: CustomActionsPosition.PRIMARY,
1336
+ *
1337
+ * // What type of content this action applies to
1338
+ * // VIZ: Available on individual visualizations
1339
+ * target: CustomActionTarget.VIZ,
1340
+ *
1341
+ * // Optional: Restrict where this action appears based on metadata
1342
+ * // metadataIds: {
1343
+ * // // Restrict to specific answers
1344
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
1345
+ * // // Restrict to specific liveboard. If liveboardId is
1346
+ * // // passed, custom actions will appear on all vizzes of liveboard
1347
+ * // liveboardIds: ['liveboard-id-1'],
1348
+ * // // Restrict to specific vizIds
1349
+ * // vizIds: ['viz-id-1']
1350
+ * // },
1351
+ * // dataModelIds: {
1352
+ * // // Restrict to specific data models
1353
+ * // modelIds: ['model-id-1', 'model-id-2'],
1354
+ * // // Restrict to specific columns within models
1355
+ * // modelColumnNames: ['model-id::column-name']
1356
+ * // },
1357
+ * // // Restrict to specific groups (for group-based access control)
1358
+ * // groupIds: ['group-id-1', 'group-id-2'],
1359
+ * // // Restrict to specific organizations (for multi-org deployments)
1360
+ * // orgIds: ['org-id-1', 'org-id-2'],
1361
+ * }
1362
+ * ],
1363
+ * })
1364
+ * ```
1087
1365
  */
1088
1366
  customActions?: CustomAction[];
1089
1367
  /**
@@ -1322,7 +1600,7 @@ export interface SearchLiveboardCommonViewConfig {
1322
1600
  *
1323
1601
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
1324
1602
  * @default true
1325
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
1603
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
1326
1604
  * @example
1327
1605
  * ```js
1328
1606
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -2793,65 +3071,67 @@ export declare enum EmbedEvent {
2793
3071
  Rename = "rename",
2794
3072
  /**
2795
3073
  *
2796
- * This event can be emitted to intercept search execution initiated by
2797
- * users and implement logic to allow or restrict search execution.
2798
- * You can also show custom error text if the search query must be
2799
- * restricted due to your application or business requirements.
2800
-
2801
- * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
2802
- * for this embed event to get emitted.
2803
- * @param - Includes the following event listener parameters:
2804
- * - `payload`: The payload received from the embed related to the Data API call.
2805
- * - `responder`: Contains elements that let developers define whether ThoughtSpot
2806
- * should run the search, and if not, what error message
2807
- * should be shown to the user.
3074
+ * This event allows developers to intercept search execution
3075
+ * and implement logic that decides whether Search Data should return
3076
+ * data or block the search operation.
2808
3077
  *
2809
- * `execute` - When `execute` returns `true`, the search will be run.
2810
- * When `execute` returns `false`, the search will not be executed.
3078
+ * **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
3079
+ * to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
3080
+ * when the embedding application user tries to run a search query.
2811
3081
  *
2812
- * `error` - Developers can customize the error message text when `execute`
2813
- * is `false` using the `errorText` and `errorDescription` parameters in responder.
2814
- *
2815
- * `errorText` - The error message text to be shown to the user.
2816
- * `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
3082
+ * This framework applies only to `AppEmbed` and `SearchEmbed`.
3083
+ * @param - Includes the following parameters:
3084
+ * - `payload`: The payload received from the embed related to the Data API call.
3085
+ * - `responder`: Contains elements that let developers define whether ThoughtSpot
3086
+ * will run or block the search operation, and if blocked, which error message to provide.
3087
+ * - `execute` - When `execute` returns `true`, the search is run.
3088
+ * When `execute` returns `false`, the search is not executed.
3089
+ * - `error` - Developers can customize the user-facing error message when `execute`
3090
+ * is `false` by using the `error` parameters in `responder`.
3091
+ * - `errorText` - The error message text shown to the user.
2817
3092
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
2818
3093
  * @example
2819
- *```js
2820
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
2821
- * (payload, responder) => {
2822
- * responder({
2823
- * data: {
2824
- * execute:false,
2825
- * error: {
2826
- * //Provide a custom error message to explain to your end user
2827
- * //why their search did not run
2828
- * errorText: "This search query cannot be run.
2829
- * Please contact your administrator for more details."
2830
- * }
2831
- * }})
3094
+ *
3095
+ * This example blocks search operation and returns a custom error message:
3096
+ * ```js
3097
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3098
+ * responder({
3099
+ * data: {
3100
+ * execute: false,
3101
+ * error: {
3102
+ * // Provide a custom error message to explain why the search did not run.
3103
+ * errorText: 'This search query cannot be run. Please contact your administrator for more details.',
3104
+ * },
3105
+ * },
3106
+ * });
2832
3107
  * })
2833
3108
  * ```
3109
+ * @example
2834
3110
  *
2835
- *```js
2836
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
2837
- * (payload, responder) => {
2838
- * const query = payload.data.data.answer.search_query
2839
- * responder({
2840
- * data: {
2841
- * // returns true as long as the query does not include
2842
- * // both the 'sales' AND the 'county' column
2843
- * execute: !(query.includes("sales")&&query.includes("county")),
2844
- * error: {
2845
- * //Provide a custom error message to explain to your end user
2846
- * // why their search did not run, and which searches are accepted by your custom logic.
2847
- * errorText: "Error Occurred",
2848
- * errorDescription: "You can't use this query :" + query + ".
2849
- * The 'sales' measures can never be used at the 'county' level.
2850
- * Please try another measure, or remove 'county' from your search."
2851
- * }
2852
- * }})
3111
+ * This example allows the search operation to run
3112
+ * unless the query contains both `sales` and `county`,
3113
+ * and returns a custom error message if the query is rejected:
3114
+ * ```js
3115
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3116
+ * // Record the search query submitted by the end user.
3117
+ * const query = payload.data.data.answer.search_query;
3118
+ *
3119
+ * responder({
3120
+ * data: {
3121
+ * // Returns true as long as the query does not include both `sales` and `county`.
3122
+ * execute: !(query.includes('sales') && query.includes('county')),
3123
+ * error: {
3124
+ * // Provide a custom error message when the query is blocked by your logic.
3125
+ * errorText:
3126
+ * "You can't use this query: "
3127
+ * + query
3128
+ * + ". The 'sales' measure can never be used at the 'county' level. "
3129
+ * + "Please try another measure or remove 'county' from your search.",
3130
+ * },
3131
+ * },
3132
+ * });
2853
3133
  * })
2854
- *```
3134
+ * ```
2855
3135
  */
2856
3136
  OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
2857
3137
  /**
@@ -6347,17 +6627,79 @@ export interface CustomAction {
6347
6627
  * positions in the application.
6348
6628
  */
6349
6629
  export declare enum CustomActionsPosition {
6630
+ /**
6631
+ * Shows the action as a primary button
6632
+ * in the toolbar area of the embed.
6633
+ */
6350
6634
  PRIMARY = "PRIMARY",
6635
+ /**
6636
+ * Shows the action inside the "More" menu
6637
+ * (three-dot overflow menu).
6638
+ */
6351
6639
  MENU = "MENU",
6640
+ /**
6641
+ * Shows the action in the right-click
6642
+ * context menu. Only supported for
6643
+ * {@link CustomActionTarget.VIZ},
6644
+ * {@link CustomActionTarget.ANSWER}, and
6645
+ * {@link CustomActionTarget.SPOTTER} targets.
6646
+ */
6352
6647
  CONTEXTMENU = "CONTEXTMENU"
6353
6648
  }
6354
6649
  /**
6355
- * Enum options to mention the target of the custom action.
6650
+ * Enum options to mention the target of the code-based custom action.
6651
+ * The target determines which type of ThoughtSpot object the action is
6652
+ * associated with, and also controls which positions and scoping options
6653
+ * are available.
6356
6654
  */
6357
6655
  export declare enum CustomActionTarget {
6656
+ /**
6657
+ * Action applies at the Liveboard level.
6658
+ * Supported positions:
6659
+ * {@link CustomActionsPosition.PRIMARY},
6660
+ * {@link CustomActionsPosition.MENU}.
6661
+ * Can be scoped with
6662
+ * `metadataIds.liveboardIds`,
6663
+ * `orgIds`, and `groupIds`.
6664
+ */
6358
6665
  LIVEBOARD = "LIVEBOARD",
6666
+ /**
6667
+ * Action applies to individual
6668
+ * visualizations (charts/tables).
6669
+ * Supported positions:
6670
+ * {@link CustomActionsPosition.PRIMARY},
6671
+ * {@link CustomActionsPosition.MENU},
6672
+ * {@link CustomActionsPosition.CONTEXTMENU}.
6673
+ * Can be scoped with `metadataIds`
6674
+ * (answerIds, liveboardIds, vizIds),
6675
+ * `dataModelIds` (modelIds,
6676
+ * modelColumnNames), `orgIds`,
6677
+ * and `groupIds`.
6678
+ */
6359
6679
  VIZ = "VIZ",
6680
+ /**
6681
+ * Action applies to saved or unsaved
6682
+ * Answers. Supported positions:
6683
+ * {@link CustomActionsPosition.PRIMARY},
6684
+ * {@link CustomActionsPosition.MENU},
6685
+ * {@link CustomActionsPosition.CONTEXTMENU}.
6686
+ * Can be scoped with
6687
+ * `metadataIds.answerIds`,
6688
+ * `dataModelIds` (modelIds,
6689
+ * modelColumnNames), `orgIds`,
6690
+ * and `groupIds`.
6691
+ */
6360
6692
  ANSWER = "ANSWER",
6693
+ /**
6694
+ * Action applies to Spotter
6695
+ * (AI-powered search).
6696
+ * Supported positions:
6697
+ * {@link CustomActionsPosition.MENU},
6698
+ * {@link CustomActionsPosition.CONTEXTMENU}.
6699
+ * Can be scoped with
6700
+ * `dataModelIds.modelIds`,
6701
+ * `orgIds`, and `groupIds`.
6702
+ */
6361
6703
  SPOTTER = "SPOTTER"
6362
6704
  }
6363
6705
  /**