@thoughtspot/visual-embed-sdk 1.46.0 → 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 (61) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +2 -2
  3. package/cjs/src/auth.js +1 -1
  4. package/cjs/src/auth.js.map +1 -1
  5. package/cjs/src/embed/app.d.ts +1 -1
  6. package/cjs/src/embed/app.js +1 -1
  7. package/cjs/src/embed/liveboard.d.ts +2 -2
  8. package/cjs/src/embed/liveboard.js +2 -2
  9. package/cjs/src/embed/search.d.ts +3 -2
  10. package/cjs/src/embed/search.d.ts.map +1 -1
  11. package/cjs/src/embed/search.js +3 -2
  12. package/cjs/src/embed/search.js.map +1 -1
  13. package/cjs/src/embed/ts-embed.d.ts +1 -1
  14. package/cjs/src/embed/ts-embed.js +1 -1
  15. package/cjs/src/react/index.d.ts +1 -1
  16. package/cjs/src/types.d.ts +359 -21
  17. package/cjs/src/types.d.ts.map +1 -1
  18. package/cjs/src/types.js +68 -8
  19. package/cjs/src/types.js.map +1 -1
  20. package/dist/{index-BQvLEoxp.js → index-Vyh6Ha5f.js} +1 -1
  21. package/dist/src/embed/app.d.ts +1 -1
  22. package/dist/src/embed/liveboard.d.ts +2 -2
  23. package/dist/src/embed/search.d.ts +3 -2
  24. package/dist/src/embed/search.d.ts.map +1 -1
  25. package/dist/src/embed/ts-embed.d.ts +1 -1
  26. package/dist/src/react/index.d.ts +1 -1
  27. package/dist/src/types.d.ts +359 -21
  28. package/dist/src/types.d.ts.map +1 -1
  29. package/dist/tsembed-react.es.js +79 -18
  30. package/dist/tsembed-react.js +78 -17
  31. package/dist/tsembed.es.js +79 -18
  32. package/dist/tsembed.js +78 -17
  33. package/dist/visual-embed-sdk-react-full.d.ts +361 -23
  34. package/dist/visual-embed-sdk-react.d.ts +356 -21
  35. package/dist/visual-embed-sdk.d.ts +360 -22
  36. package/lib/package.json +2 -2
  37. package/lib/src/auth.js +1 -1
  38. package/lib/src/auth.js.map +1 -1
  39. package/lib/src/embed/app.d.ts +1 -1
  40. package/lib/src/embed/app.js +1 -1
  41. package/lib/src/embed/liveboard.d.ts +2 -2
  42. package/lib/src/embed/liveboard.js +2 -2
  43. package/lib/src/embed/search.d.ts +3 -2
  44. package/lib/src/embed/search.d.ts.map +1 -1
  45. package/lib/src/embed/search.js +3 -2
  46. package/lib/src/embed/search.js.map +1 -1
  47. package/lib/src/embed/ts-embed.d.ts +1 -1
  48. package/lib/src/embed/ts-embed.js +1 -1
  49. package/lib/src/react/index.d.ts +1 -1
  50. package/lib/src/types.d.ts +359 -21
  51. package/lib/src/types.d.ts.map +1 -1
  52. package/lib/src/types.js +68 -8
  53. package/lib/src/types.js.map +1 -1
  54. package/package.json +2 -2
  55. package/src/auth.ts +1 -1
  56. package/src/embed/app.ts +1 -1
  57. package/src/embed/liveboard.ts +2 -2
  58. package/src/embed/search.ts +3 -2
  59. package/src/embed/ts-embed.ts +1 -1
  60. package/src/react/index.tsx +1 -1
  61. package/src/types.ts +359 -21
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
 
@@ -2872,13 +3150,11 @@ export enum EmbedEvent {
2872
3150
  * - `payload`: The payload received from the embed related to the Data API call.
2873
3151
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
2874
3152
  * will run or block the search operation, and if blocked, which error message to provide.
2875
- *
2876
- * `execute` - When `execute` returns `true`, the search is run.
3153
+ * - `execute` - When `execute` returns `true`, the search is run.
2877
3154
  * When `execute` returns `false`, the search is not executed.
2878
- *
2879
- * `error` - Developers can customize the user-facing error message when `execute`
3155
+ * - `error` - Developers can customize the user-facing error message when `execute`
2880
3156
  * is `false` by using the `error` parameters in `responder`.
2881
- * `errorText` - The error message text shown to the user.
3157
+ * - `errorText` - The error message text shown to the user.
2882
3158
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
2883
3159
  * @example
2884
3160
  *
@@ -2894,7 +3170,7 @@ export enum EmbedEvent {
2894
3170
  * },
2895
3171
  * },
2896
3172
  * });
2897
- * });
3173
+ * })
2898
3174
  * ```
2899
3175
  * @example
2900
3176
  *
@@ -2920,7 +3196,7 @@ export enum EmbedEvent {
2920
3196
  * },
2921
3197
  * },
2922
3198
  * });
2923
- * });
3199
+ * })
2924
3200
  * ```
2925
3201
  */
2926
3202
  OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
@@ -6463,18 +6739,80 @@ export interface CustomAction {
6463
6739
  * positions in the application.
6464
6740
  */
6465
6741
  export enum CustomActionsPosition {
6742
+ /**
6743
+ * Shows the action as a primary button
6744
+ * in the toolbar area of the embed.
6745
+ */
6466
6746
  PRIMARY = 'PRIMARY',
6747
+ /**
6748
+ * Shows the action inside the "More" menu
6749
+ * (three-dot overflow menu).
6750
+ */
6467
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
+ */
6468
6759
  CONTEXTMENU = 'CONTEXTMENU',
6469
6760
  }
6470
6761
 
6471
6762
  /**
6472
- * 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.
6473
6767
  */
6474
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
+ */
6475
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
+ */
6476
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
+ */
6477
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
+ */
6478
6816
  SPOTTER = 'SPOTTER',
6479
6817
  }
6480
6818