@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
package/src/types.ts CHANGED
@@ -690,18 +690,154 @@ export interface EmbedConfig {
690
690
  * @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl
691
691
  * @example
692
692
  * ```js
693
- * import { CustomActionPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
693
+ * import { CustomActionsPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
694
694
  * init({
695
695
  * ... // other embed config options
696
696
  * customActions: [
697
697
  * {
698
- * name: 'customAction',
699
- * id: 'customAction',
698
+ * // Unique identifier for the custom action
699
+ * id: 'my-custom-action',
700
+ *
701
+ * // Display name shown to users in the UI
702
+ * name: 'My Custom Action',
703
+ *
704
+ * // Where the action appears in the UI
705
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
706
+ * // MENU: Shows in the "More" menu (three dots menu)
707
+ * // CONTEXTMENU: Shows in the right-click context menu
708
+ * position: CustomActionsPosition.PRIMARY,
709
+ *
710
+ * // What type of content this action applies to
711
+ * // ANSWER: Available on answer pages
712
+ * target: CustomActionTarget.ANSWER,
713
+ *
714
+ * // Optional: Restrict where this action appears based on data models
715
+ * // dataModelIds: {
716
+ * // // Restrict to specific data models
717
+ * // modelIds: ['model-id-1', 'model-id-2'],
718
+ * // // Restrict to specific columns within models
719
+ * // modelColumnNames: ['model-id::column-name']
720
+ * // },
721
+ *
722
+ * // Optional: Restrict where this action appears based on metadata
723
+ * // metadataIds: {
724
+ * // // Restrict to specific answers
725
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
726
+ * // },
727
+ * // // Restrict to specific groups (for group-based access control)
728
+ * // groupIds: ['group-id-1', 'group-id-2'],
729
+ * // // Restrict to specific organizations (for multi-org deployments)
730
+ * // orgIds: ['org-id-1', 'org-id-2'],
731
+ * }
732
+ * ],
733
+ * })
734
+ * ```
735
+ * @example
736
+ * ```js
737
+ * import { CustomActionsPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
738
+ * init({
739
+ * ... // other embed config options
740
+ * customActions: [
741
+ * {
742
+ * // Unique identifier for the custom action
743
+ * id: 'my-custom-action',
744
+ *
745
+ * // Display name shown to users in the UI
746
+ * name: 'My Custom Action',
747
+ *
748
+ * // Where the action appears in the UI
749
+ * // MENU: Shows in the "More" menu (three dots menu)
750
+ * // CONTEXTMENU: Shows in the right-click context menu
751
+ * position: CustomActionsPosition.MENU,
752
+ *
753
+ * // What type of content this action applies to
754
+ * // SPOTTER: Available in Spotter (AI-powered search)
755
+ * target: CustomActionTarget.SPOTTER,
756
+ *
757
+ * // Optional: Restrict where this action appears based on data models
758
+ * // dataModelIds: {
759
+ * // // Restrict to specific data models
760
+ * // modelIds: ['model-id-1', 'model-id-2'],
761
+ * // },
762
+ * // // Restrict to specific groups (for group-based access control)
763
+ * // groupIds: ['group-id-1'],
764
+ * // // Restrict to specific organizations (for multi-org deployments)
765
+ * // orgIds: ['org-id-1'],
766
+ * }
767
+ * ],
768
+ * })
769
+ * ```
770
+ * @example
771
+ * ```js
772
+ * import { CustomActionsPosition, CustomActionTarget } from '@thoughtspot/visual-embed-sdk';
773
+ * init({
774
+ * ... // other embed config options
775
+ * customActions: [
776
+ * {
777
+ * // Unique identifier for the custom action
778
+ * id: 'my-liveboard-custom-action',
779
+ *
780
+ * // Display name shown to users in the UI
781
+ * name: 'My Liveboard Custom Action',
782
+ *
783
+ * // Where the action appears in the UI
784
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
785
+ * // MENU: Shows in the "More" menu (three dots menu)
786
+ * position: CustomActionsPosition.PRIMARY,
787
+ *
788
+ * // What type of content this action applies to
789
+ * // LIVEBOARD: Available on liveboard pages
790
+ * target: CustomActionTarget.LIVEBOARD,
791
+ *
792
+ * // Optional: Restrict where this action appears based on metadata
793
+ * // metadataIds: {
794
+ * // // Restrict to specific liveboards
795
+ * // liveboardIds: ['liveboard-id-1', 'liveboard-id-2'],
796
+ * // },
797
+ * // // Restrict to specific groups (for group-based access control)
798
+ * // groupIds: ['group-id-1', 'group-id-2'],
799
+ * // // Restrict to specific organizations (for multi-org deployments)
800
+ * // orgIds: ['org-id-1', 'org-id-2'],
801
+ * },
802
+ * {
803
+ * // Unique identifier for the custom action
804
+ * id: 'my-viz-custom-action',
805
+ *
806
+ * // Display name shown to users in the UI
807
+ * name: 'My Viz Custom Action',
808
+ *
809
+ * // Where the action appears in the UI
810
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
811
+ * // MENU: Shows in the "More" menu (three dots menu)
812
+ * // CONTEXTMENU: Shows in the right-click context menu
813
+ * position: CustomActionsPosition.PRIMARY,
814
+ *
815
+ * // What type of content this action applies to
816
+ * // VIZ: Available on individual visualizations
700
817
  * target: CustomActionTarget.VIZ,
701
- * position: CustomActionPosition.PRIMARY,
702
- * }
818
+ *
819
+ * // Optional: Restrict where this action appears based on metadata
820
+ * // metadataIds: {
821
+ * // // Restrict to specific answers
822
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
823
+ * // // Restrict to specific liveboard. If liveboardId is
824
+ * // // passed, custom actions will appear on all vizzes of liveboard
825
+ * // liveboardIds: ['liveboard-id-1'],
826
+ * // // Restrict to specific vizIds
827
+ * // vizIds: ['viz-id-1']
828
+ * // },
829
+ * // dataModelIds: {
830
+ * // // Restrict to specific data models
831
+ * // modelIds: ['model-id-1', 'model-id-2'],
832
+ * // // Restrict to specific columns within models
833
+ * // modelColumnNames: ['model-id::column-name']
834
+ * // },
835
+ * // // Restrict to specific groups (for group-based access control)
836
+ * // groupIds: ['group-id-1', 'group-id-2'],
837
+ * // // Restrict to specific organizations (for multi-org deployments)
838
+ * // orgIds: ['org-id-1', 'org-id-2'],
703
839
  * }
704
- * ]
840
+ * ],
705
841
  * })
706
842
  * ```
707
843
  */
@@ -1096,7 +1232,7 @@ export interface BaseViewConfig extends ApiInterceptFlags {
1096
1232
  * ```ts
1097
1233
  * import {
1098
1234
  * CustomActionPayload,
1099
- * CustomActionPosition,
1235
+ * CustomActionsPosition,
1100
1236
  * CustomActionTarget,
1101
1237
  * } from '@thoughtspot/visual-embed-sdk';
1102
1238
  * // Use supported embed types such as AppEmbed or LiveboardEmbed
@@ -1104,13 +1240,41 @@ export interface BaseViewConfig extends ApiInterceptFlags {
1104
1240
  * ... // other embed config options
1105
1241
  * customActions: [
1106
1242
  * {
1107
- * name: 'customAction',
1108
- * id: 'customAction',
1109
- * target: CustomActionTarget.VIZ,
1110
- * position: CustomActionPosition.PRIMARY,
1111
- * }
1243
+ * // Unique identifier for the custom action
1244
+ * id: 'my-custom-action',
1245
+ *
1246
+ * // Display name shown to users in the UI
1247
+ * name: 'My Custom Action',
1248
+ *
1249
+ * // Where the action appears in the UI
1250
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
1251
+ * // MENU: Shows in the "More" menu (three dots menu)
1252
+ * // CONTEXTMENU: Shows in the right-click context menu
1253
+ * position: CustomActionsPosition.PRIMARY,
1254
+ *
1255
+ * // What type of content this action applies to
1256
+ * // ANSWER: Available on answer pages
1257
+ * target: CustomActionTarget.ANSWER,
1258
+ *
1259
+ * // Optional: Restrict where this action appears based on data models
1260
+ * // dataModelIds: {
1261
+ * // // Restrict to specific data models
1262
+ * // modelIds: ['model-id-1', 'model-id-2'],
1263
+ * // // Restrict to specific columns within models
1264
+ * // modelColumnNames: ['model-id::column-name']
1265
+ * // },
1266
+ *
1267
+ * // Optional: Restrict where this action appears based on metadata
1268
+ * // metadataIds: {
1269
+ * // // Restrict to specific answers
1270
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
1271
+ * // },
1272
+ * // // Restrict to specific groups (for group-based access control)
1273
+ * // groupIds: ['group-id-1', 'group-id-2'],
1274
+ * // // Restrict to specific organizations (for multi-org deployments)
1275
+ * // orgIds: ['org-id-1', 'org-id-2'],
1112
1276
  * }
1113
- * ]
1277
+ * ],
1114
1278
  * })
1115
1279
  *
1116
1280
  * // to trigger a custom flow on custom action click listen to Custom action embed event
@@ -1118,6 +1282,120 @@ export interface BaseViewConfig extends ApiInterceptFlags {
1118
1282
  * console.log('Custom Action event:', payload);
1119
1283
  * })
1120
1284
  * ```
1285
+ * @example
1286
+ * ```ts
1287
+ * import {
1288
+ * CustomActionsPosition,
1289
+ * CustomActionTarget,
1290
+ * } from '@thoughtspot/visual-embed-sdk';
1291
+ * const embed = new LiveboardEmbed('#tsEmbed', {
1292
+ * ... // other embed config options
1293
+ * customActions: [
1294
+ * {
1295
+ * // Unique identifier for the custom action
1296
+ * id: 'my-custom-action',
1297
+ *
1298
+ * // Display name shown to users in the UI
1299
+ * name: 'My Custom Action',
1300
+ *
1301
+ * // Where the action appears in the UI
1302
+ * // MENU: Shows in the "More" menu (three dots menu)
1303
+ * // CONTEXTMENU: Shows in the right-click context menu
1304
+ * position: CustomActionsPosition.MENU,
1305
+ *
1306
+ * // What type of content this action applies to
1307
+ * // SPOTTER: Available in Spotter (AI-powered search)
1308
+ * target: CustomActionTarget.SPOTTER,
1309
+ *
1310
+ * // Optional: Restrict where this action appears based on data models
1311
+ * // dataModelIds: {
1312
+ * // // Restrict to specific data models
1313
+ * // modelIds: ['model-id-1', 'model-id-2'],
1314
+ * // },
1315
+ * // // Restrict to specific groups (for group-based access control)
1316
+ * // groupIds: ['group-id-1'],
1317
+ * // // Restrict to specific organizations (for multi-org deployments)
1318
+ * // orgIds: ['org-id-1'],
1319
+ * }
1320
+ * ],
1321
+ * })
1322
+ * ```
1323
+ * @example
1324
+ * ```ts
1325
+ * import {
1326
+ * CustomActionsPosition,
1327
+ * CustomActionTarget,
1328
+ * } from '@thoughtspot/visual-embed-sdk';
1329
+ * const embed = new LiveboardEmbed('#tsEmbed', {
1330
+ * ... // other embed config options
1331
+ * customActions: [
1332
+ * {
1333
+ * // Unique identifier for the custom action
1334
+ * id: 'my-liveboard-custom-action',
1335
+ *
1336
+ * // Display name shown to users in the UI
1337
+ * name: 'My Liveboard Custom Action',
1338
+ *
1339
+ * // Where the action appears in the UI
1340
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
1341
+ * // MENU: Shows in the "More" menu (three dots menu)
1342
+ * position: CustomActionsPosition.PRIMARY,
1343
+ *
1344
+ * // What type of content this action applies to
1345
+ * // LIVEBOARD: Available on liveboard pages
1346
+ * target: CustomActionTarget.LIVEBOARD,
1347
+ *
1348
+ * // Optional: Restrict where this action appears based on metadata
1349
+ * // metadataIds: {
1350
+ * // // Restrict to specific liveboards
1351
+ * // liveboardIds: ['liveboard-id-1', 'liveboard-id-2'],
1352
+ * // },
1353
+ * // // Restrict to specific groups (for group-based access control)
1354
+ * // groupIds: ['group-id-1', 'group-id-2'],
1355
+ * // // Restrict to specific organizations (for multi-org deployments)
1356
+ * // orgIds: ['org-id-1', 'org-id-2'],
1357
+ * },
1358
+ * {
1359
+ * // Unique identifier for the custom action
1360
+ * id: 'my-viz-custom-action',
1361
+ *
1362
+ * // Display name shown to users in the UI
1363
+ * name: 'My Viz Custom Action',
1364
+ *
1365
+ * // Where the action appears in the UI
1366
+ * // PRIMARY: Shows as a primary button (e.g., in the toolbar)
1367
+ * // MENU: Shows in the "More" menu (three dots menu)
1368
+ * // CONTEXTMENU: Shows in the right-click context menu
1369
+ * position: CustomActionsPosition.PRIMARY,
1370
+ *
1371
+ * // What type of content this action applies to
1372
+ * // VIZ: Available on individual visualizations
1373
+ * target: CustomActionTarget.VIZ,
1374
+ *
1375
+ * // Optional: Restrict where this action appears based on metadata
1376
+ * // metadataIds: {
1377
+ * // // Restrict to specific answers
1378
+ * // answerIds: ['answer-id-1', 'answer-id-2'],
1379
+ * // // Restrict to specific liveboard. If liveboardId is
1380
+ * // // passed, custom actions will appear on all vizzes of liveboard
1381
+ * // liveboardIds: ['liveboard-id-1'],
1382
+ * // // Restrict to specific vizIds
1383
+ * // vizIds: ['viz-id-1']
1384
+ * // },
1385
+ * // dataModelIds: {
1386
+ * // // Restrict to specific data models
1387
+ * // modelIds: ['model-id-1', 'model-id-2'],
1388
+ * // // Restrict to specific columns within models
1389
+ * // modelColumnNames: ['model-id::column-name']
1390
+ * // },
1391
+ * // // Restrict to specific groups (for group-based access control)
1392
+ * // groupIds: ['group-id-1', 'group-id-2'],
1393
+ * // // Restrict to specific organizations (for multi-org deployments)
1394
+ * // orgIds: ['org-id-1', 'org-id-2'],
1395
+ * }
1396
+ * ],
1397
+ * })
1398
+ * ```
1121
1399
  */
1122
1400
  customActions?: CustomAction[];
1123
1401
 
@@ -1361,7 +1639,7 @@ export interface SearchLiveboardCommonViewConfig {
1361
1639
  *
1362
1640
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
1363
1641
  * @default true
1364
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
1642
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
1365
1643
  * @example
1366
1644
  * ```js
1367
1645
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -2859,65 +3137,67 @@ export enum EmbedEvent {
2859
3137
  Rename = 'rename',
2860
3138
  /**
2861
3139
  *
2862
- * This event can be emitted to intercept search execution initiated by
2863
- * users and implement logic to allow or restrict search execution.
2864
- * You can also show custom error text if the search query must be
2865
- * restricted due to your application or business requirements.
2866
-
2867
- * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
2868
- * for this embed event to get emitted.
2869
- * @param - Includes the following event listener parameters:
3140
+ * This event allows developers to intercept search execution
3141
+ * and implement logic that decides whether Search Data should return
3142
+ * data or block the search operation.
3143
+ *
3144
+ * **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
3145
+ * to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
3146
+ * when the embedding application user tries to run a search query.
3147
+ *
3148
+ * This framework applies only to `AppEmbed` and `SearchEmbed`.
3149
+ * @param - Includes the following parameters:
2870
3150
  * - `payload`: The payload received from the embed related to the Data API call.
2871
3151
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
2872
- * should run the search, and if not, what error message
2873
- * should be shown to the user.
2874
- *
2875
- * `execute` - When `execute` returns `true`, the search will be run.
2876
- * When `execute` returns `false`, the search will not be executed.
2877
- *
2878
- * `error` - Developers can customize the error message text when `execute`
2879
- * is `false` using the `errorText` and `errorDescription` parameters in responder.
2880
- *
2881
- * `errorText` - The error message text to be shown to the user.
2882
- * `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
3152
+ * will run or block the search operation, and if blocked, which error message to provide.
3153
+ * - `execute` - When `execute` returns `true`, the search is run.
3154
+ * When `execute` returns `false`, the search is not executed.
3155
+ * - `error` - Developers can customize the user-facing error message when `execute`
3156
+ * is `false` by using the `error` parameters in `responder`.
3157
+ * - `errorText` - The error message text shown to the user.
2883
3158
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
2884
3159
  * @example
2885
- *```js
2886
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
2887
- * (payload, responder) => {
2888
- * responder({
2889
- * data: {
2890
- * execute:false,
2891
- * error: {
2892
- * //Provide a custom error message to explain to your end user
2893
- * //why their search did not run
2894
- * errorText: "This search query cannot be run.
2895
- * Please contact your administrator for more details."
2896
- * }
2897
- * }})
3160
+ *
3161
+ * This example blocks search operation and returns a custom error message:
3162
+ * ```js
3163
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3164
+ * responder({
3165
+ * data: {
3166
+ * execute: false,
3167
+ * error: {
3168
+ * // Provide a custom error message to explain why the search did not run.
3169
+ * errorText: 'This search query cannot be run. Please contact your administrator for more details.',
3170
+ * },
3171
+ * },
3172
+ * });
2898
3173
  * })
2899
3174
  * ```
3175
+ * @example
2900
3176
  *
2901
- *```js
2902
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
2903
- * (payload, responder) => {
2904
- * const query = payload.data.data.answer.search_query
2905
- * responder({
2906
- * data: {
2907
- * // returns true as long as the query does not include
2908
- * // both the 'sales' AND the 'county' column
2909
- * execute: !(query.includes("sales")&&query.includes("county")),
2910
- * error: {
2911
- * //Provide a custom error message to explain to your end user
2912
- * // why their search did not run, and which searches are accepted by your custom logic.
2913
- * errorText: "Error Occurred",
2914
- * errorDescription: "You can't use this query :" + query + ".
2915
- * The 'sales' measures can never be used at the 'county' level.
2916
- * Please try another measure, or remove 'county' from your search."
2917
- * }
2918
- * }})
3177
+ * This example allows the search operation to run
3178
+ * unless the query contains both `sales` and `county`,
3179
+ * and returns a custom error message if the query is rejected:
3180
+ * ```js
3181
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3182
+ * // Record the search query submitted by the end user.
3183
+ * const query = payload.data.data.answer.search_query;
3184
+ *
3185
+ * responder({
3186
+ * data: {
3187
+ * // Returns true as long as the query does not include both `sales` and `county`.
3188
+ * execute: !(query.includes('sales') && query.includes('county')),
3189
+ * error: {
3190
+ * // Provide a custom error message when the query is blocked by your logic.
3191
+ * errorText:
3192
+ * "You can't use this query: "
3193
+ * + query
3194
+ * + ". The 'sales' measure can never be used at the 'county' level. "
3195
+ * + "Please try another measure or remove 'county' from your search.",
3196
+ * },
3197
+ * },
3198
+ * });
2919
3199
  * })
2920
- *```
3200
+ * ```
2921
3201
  */
2922
3202
  OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
2923
3203
  /**
@@ -6459,18 +6739,80 @@ export interface CustomAction {
6459
6739
  * positions in the application.
6460
6740
  */
6461
6741
  export enum CustomActionsPosition {
6742
+ /**
6743
+ * Shows the action as a primary button
6744
+ * in the toolbar area of the embed.
6745
+ */
6462
6746
  PRIMARY = 'PRIMARY',
6747
+ /**
6748
+ * Shows the action inside the "More" menu
6749
+ * (three-dot overflow menu).
6750
+ */
6463
6751
  MENU = 'MENU',
6752
+ /**
6753
+ * Shows the action in the right-click
6754
+ * context menu. Only supported for
6755
+ * {@link CustomActionTarget.VIZ},
6756
+ * {@link CustomActionTarget.ANSWER}, and
6757
+ * {@link CustomActionTarget.SPOTTER} targets.
6758
+ */
6464
6759
  CONTEXTMENU = 'CONTEXTMENU',
6465
6760
  }
6466
6761
 
6467
6762
  /**
6468
- * Enum options to mention the target of the custom action.
6763
+ * Enum options to mention the target of the code-based custom action.
6764
+ * The target determines which type of ThoughtSpot object the action is
6765
+ * associated with, and also controls which positions and scoping options
6766
+ * are available.
6469
6767
  */
6470
6768
  export enum CustomActionTarget {
6769
+ /**
6770
+ * Action applies at the Liveboard level.
6771
+ * Supported positions:
6772
+ * {@link CustomActionsPosition.PRIMARY},
6773
+ * {@link CustomActionsPosition.MENU}.
6774
+ * Can be scoped with
6775
+ * `metadataIds.liveboardIds`,
6776
+ * `orgIds`, and `groupIds`.
6777
+ */
6471
6778
  LIVEBOARD = 'LIVEBOARD',
6779
+ /**
6780
+ * Action applies to individual
6781
+ * visualizations (charts/tables).
6782
+ * Supported positions:
6783
+ * {@link CustomActionsPosition.PRIMARY},
6784
+ * {@link CustomActionsPosition.MENU},
6785
+ * {@link CustomActionsPosition.CONTEXTMENU}.
6786
+ * Can be scoped with `metadataIds`
6787
+ * (answerIds, liveboardIds, vizIds),
6788
+ * `dataModelIds` (modelIds,
6789
+ * modelColumnNames), `orgIds`,
6790
+ * and `groupIds`.
6791
+ */
6472
6792
  VIZ = 'VIZ',
6793
+ /**
6794
+ * Action applies to saved or unsaved
6795
+ * Answers. Supported positions:
6796
+ * {@link CustomActionsPosition.PRIMARY},
6797
+ * {@link CustomActionsPosition.MENU},
6798
+ * {@link CustomActionsPosition.CONTEXTMENU}.
6799
+ * Can be scoped with
6800
+ * `metadataIds.answerIds`,
6801
+ * `dataModelIds` (modelIds,
6802
+ * modelColumnNames), `orgIds`,
6803
+ * and `groupIds`.
6804
+ */
6473
6805
  ANSWER = 'ANSWER',
6806
+ /**
6807
+ * Action applies to Spotter
6808
+ * (AI-powered search).
6809
+ * Supported positions:
6810
+ * {@link CustomActionsPosition.MENU},
6811
+ * {@link CustomActionsPosition.CONTEXTMENU}.
6812
+ * Can be scoped with
6813
+ * `dataModelIds.modelIds`,
6814
+ * `orgIds`, and `groupIds`.
6815
+ */
6474
6816
  SPOTTER = 'SPOTTER',
6475
6817
  }
6476
6818
 
@@ -6907,4 +7249,4 @@ export interface ContextObject {
6907
7249
  type: ContextType;
6908
7250
  objectIds: ObjectIds;
6909
7251
  }
6910
- }
7252
+ }