@thoughtspot/visual-embed-sdk 1.13.0-alpha.4 → 1.14.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +9 -5
  2. package/dist/src/embed/app.d.ts +4 -3
  3. package/dist/src/embed/base.d.ts +1 -1
  4. package/dist/src/embed/liveboard.d.ts +10 -7
  5. package/dist/src/embed/pinboard.d.ts +91 -0
  6. package/dist/src/embed/search.d.ts +5 -1
  7. package/dist/src/embed/ts-embed.d.ts +4 -4
  8. package/dist/src/types.d.ts +84 -77
  9. package/dist/src/utils/authService.d.ts +1 -0
  10. package/dist/src/utils/plugin.d.ts +0 -0
  11. package/dist/src/v1/api.d.ts +19 -0
  12. package/dist/tsembed.es.js +106 -78
  13. package/dist/tsembed.js +106 -78
  14. package/lib/package.json +1 -1
  15. package/lib/src/auth.js +8 -2
  16. package/lib/src/auth.js.map +1 -1
  17. package/lib/src/auth.spec.js +18 -0
  18. package/lib/src/auth.spec.js.map +1 -1
  19. package/lib/src/embed/app.d.ts +4 -3
  20. package/lib/src/embed/app.js +2 -1
  21. package/lib/src/embed/app.js.map +1 -1
  22. package/lib/src/embed/base.d.ts +1 -1
  23. package/lib/src/embed/base.js +1 -1
  24. package/lib/src/embed/liveboard.d.ts +10 -7
  25. package/lib/src/embed/liveboard.js +7 -4
  26. package/lib/src/embed/liveboard.js.map +1 -1
  27. package/lib/src/embed/liveboard.spec.js +12 -0
  28. package/lib/src/embed/liveboard.spec.js.map +1 -1
  29. package/lib/src/embed/pinboard.d.ts +91 -0
  30. package/lib/src/embed/pinboard.js +110 -0
  31. package/lib/src/embed/pinboard.js.map +1 -0
  32. package/lib/src/embed/search.d.ts +5 -1
  33. package/lib/src/embed/search.js +1 -1
  34. package/lib/src/embed/search.js.map +1 -1
  35. package/lib/src/embed/ts-embed.d.ts +4 -4
  36. package/lib/src/types.d.ts +84 -77
  37. package/lib/src/types.js +74 -69
  38. package/lib/src/types.js.map +1 -1
  39. package/lib/src/utils/authService.d.ts +1 -0
  40. package/lib/src/utils/authService.js +13 -0
  41. package/lib/src/utils/authService.js.map +1 -1
  42. package/lib/src/utils/authService.spec.js +15 -1
  43. package/lib/src/utils/authService.spec.js.map +1 -1
  44. package/lib/src/utils/plugin.d.ts +0 -0
  45. package/lib/src/utils/plugin.js +1 -0
  46. package/lib/src/utils/plugin.js.map +1 -0
  47. package/lib/src/visual-embed-sdk.d.ts +108 -93
  48. package/package.json +1 -1
  49. package/src/auth.spec.ts +39 -0
  50. package/src/auth.ts +11 -5
  51. package/src/embed/app.ts +4 -3
  52. package/src/embed/base.ts +1 -1
  53. package/src/embed/liveboard.spec.ts +15 -0
  54. package/src/embed/liveboard.ts +22 -9
  55. package/src/embed/search.ts +6 -1
  56. package/src/embed/ts-embed.ts +4 -4
  57. package/src/types.ts +85 -77
  58. package/src/utils/authService.spec.ts +21 -0
  59. package/src/utils/authService.ts +20 -0
package/src/types.ts CHANGED
@@ -14,9 +14,13 @@
14
14
  // eslint-disable-next-line no-shadow
15
15
  export enum AuthType {
16
16
  /**
17
- * No authentication. Use this only for testing purposes.
17
+ * No authentication on the SDK. Passthrough to the embedded App. Alias for `Passthrough`.
18
18
  */
19
19
  None = 'None',
20
+ /**
21
+ * No authentication on the SDK. Passthrough to the embedded App.
22
+ */
23
+ Passthrough = 'None',
20
24
  /**
21
25
  * SSO using SAML
22
26
  * @deprecated Use {@link SAML} instead
@@ -130,7 +134,7 @@ export interface EmbedConfig {
130
134
  * terminated.
131
135
  *
132
136
  * Eg: "/dashboard", "#/foo" [Do not include the host]
133
- * @version SDK: 1.10.2 | ThoughtSpot: *
137
+ * @version SDK: 1.10.2 | 8.2.0.cl, 8.4.1-sw
134
138
  */
135
139
  redirectPath?: string;
136
140
 
@@ -163,14 +167,14 @@ export interface EmbedConfig {
163
167
  /**
164
168
  * Disable redirection to the login page when the embedded session expires
165
169
  * This flag is typically used alongside the combination of auth modes such as {@link AuthType.AuthServer} and auto login behavior {@link EmbedConfig.autoLogin}
166
- * @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl
170
+ * @version SDK: 1.9.3 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
167
171
  * @default false
168
172
  */
169
173
  disableLoginRedirect?: boolean;
170
174
 
171
175
  /**
172
176
  * This message is displayed on the embed view when the login fails.
173
- * @version 1.10.1 | ThoughtSpot: *
177
+ * @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
174
178
  */
175
179
  loginFailedMessage?: string;
176
180
 
@@ -184,7 +188,7 @@ export interface EmbedConfig {
184
188
  * When there are multiple embeds, queue the render of embed to start
185
189
  * after the previous embed's render is complete. This helps in the load performance
186
190
  * by decreasing the load on the browser.
187
- * @version 1.5.0 or later
191
+ * @Version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
188
192
  * @default false
189
193
  */
190
194
  queueMultiRenders?: boolean;
@@ -192,7 +196,7 @@ export interface EmbedConfig {
192
196
  /**
193
197
  * Dynamic CSS Url to be injected in the loaded application.
194
198
  * You would also need to set `style-src` in the CSP settings.
195
- * @version 1.6.0 or later
199
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
196
200
  * @default ''
197
201
  */
198
202
  customCssUrl?: string;
@@ -201,17 +205,20 @@ export interface EmbedConfig {
201
205
  * and should be avoided. Listen to the NO_COOKIE_ACCESS event to handle the situation.
202
206
  *
203
207
  * This is slightly slower than letting the browser handle the cookie check, as it involves an extra network call.
204
- * @version SDK: 1.10.4 | ThoughtSpot: *
208
+ * @version SDK: 1.10.4 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
205
209
  */
206
210
  detectCookieAccessSlow?: boolean;
207
211
  /**
208
212
  * Hide beta alert warning message for SearchEmbed.
209
213
  *
210
- * @version SDK: 1.12.0 | ThoughtSpot: *
214
+ * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw*
211
215
  */
212
216
  suppressSearchEmbedBetaWarning?: boolean;
217
+
213
218
  /**
214
- * Custom style params for embed Config
219
+ * Custom style params for embed Config.
220
+ *
221
+ * @version SDK: 1.16.0 | ThoughtSpot: 8.8.0.cl, 8.8.1-sw
215
222
  */
216
223
  customisations?: CustomisationsInterface;
217
224
  }
@@ -391,7 +398,7 @@ export enum EmbedEvent {
391
398
  /**
392
399
  * One or more data columns have been selected.
393
400
  * @return columnIds - the list of columns
394
- * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl
401
+ * @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
395
402
  */
396
403
  AddRemoveColumns = 'addRemoveColumns',
397
404
  /**
@@ -403,13 +410,13 @@ export enum EmbedEvent {
403
410
  /**
404
411
  * A double click has been triggered on table/chart
405
412
  * @return ContextMenuInputPoints - data point that is double clicked
406
- * @version 1.5.0 or later
413
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
407
414
  */
408
415
  VizPointDoubleClick = 'vizPointDoubleClick',
409
416
  /**
410
417
  * A click has been triggered on table/chart
411
418
  * @return ContextMenuInputPoints - data point that is clicked
412
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
419
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
413
420
  */
414
421
  VizPointClick = 'vizPointClick',
415
422
  /**
@@ -461,7 +468,7 @@ export enum EmbedEvent {
461
468
  * Emitted when the embed does not have cookie access. This
462
469
  * happens on Safari where third-party cookies are blocked by default.
463
470
  *
464
- * @version 1.1.0 or later
471
+ * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
465
472
  */
466
473
  NoCookieAccess = 'noCookieAccess',
467
474
  /**
@@ -472,181 +479,182 @@ export enum EmbedEvent {
472
479
  SAMLComplete = 'samlComplete',
473
480
  /**
474
481
  * Emitted when any modal is opened in the app
475
- * @version 1.6.0 or later
482
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
476
483
  */
477
484
  DialogOpen = 'dialog-open',
478
485
  /**
479
486
  * Emitted when any modal is closed in the app
480
- * @version 1.6.0 or later
487
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
481
488
  */
482
489
  DialogClose = 'dialog-close',
483
490
  /**
484
491
  * Emitted when a liveboard has completed rendering,
485
492
  * this event can be used as a hook to trigger events on the
486
493
  * rendered liveboard
487
- * @version 1.9.1 or later
494
+ * @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
488
495
  */
489
496
  LiveboardRendered = 'PinboardRendered',
490
497
  /**
491
498
  * This can be used to register an event listener which
492
499
  * is triggered on all events.
493
- * @version SDK: 1.10.0 | ThoughtSpot: any
500
+ * @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
494
501
  */
495
502
  ALL = '*',
496
503
  /**
497
504
  * Emitted when answer is saved in the app
498
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
505
+ * @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
499
506
  */
500
507
  Save = 'save',
501
508
  /**
502
509
  * Emitted when the download action is triggered on an answer
503
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
510
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
504
511
  */
505
512
  Download = 'download',
506
513
  /**
507
514
  * Emitted when the Download as PDF action is triggered on an answer
508
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
515
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
509
516
  */
510
517
  DownloadAsPdf = 'downloadAsPdf',
511
518
  /**
512
519
  * Emitted when the Download as CSV action is triggered on an answer
513
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
520
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
514
521
  */
515
522
  DownloadAsCsv = 'downloadAsCsv',
516
523
  /**
517
524
  * Emitted when the Download as XLSX action is triggered on an answer
518
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
525
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
519
526
  */
520
527
  DownloadAsXlsx = 'downloadAsXlsx',
521
528
  /**
522
529
  * Emitted when an answer is deleted in the app
523
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
530
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
524
531
  */
525
532
  AnswerDelete = 'answerDelete',
526
533
  /**
527
534
  * Emitted when an answer is pinned to a Liveboard
528
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
535
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
529
536
  */
530
537
  Pin = 'pin',
531
538
  /**
532
539
  * Emitted when SpotIQ analysis is triggered
533
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
540
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
534
541
  */
535
542
  SpotIQAnalyze = 'spotIQAnalyze',
536
543
  /**
537
544
  * Emitted when a user shares an object with another user or group
538
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
545
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
539
546
  */
540
547
  Share = 'share',
541
548
  /**
542
549
  * Emitted when a user clicks the Include action to include a specific value or data on a chart or table
543
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
550
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
544
551
  */
545
552
  DrillInclude = 'context-menu-item-include',
546
553
  /**
547
554
  * Emitted when a user clicks the Exclude action to exclude a specific value or data on a chart or table
548
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
555
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
549
556
  */
550
557
  DrillExclude = 'context-menu-item-exclude',
551
558
  /**
552
559
  * Emitted when copied column value on the app
553
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
560
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
554
561
  */
555
562
  CopyToClipboard = 'context-menu-item-copy-to-clipboard',
556
563
  /**
557
564
  * Emitted when a user clicks the Update TML action
558
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
565
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
559
566
  */
560
567
  UpdateTML = 'updateTSL',
561
568
  /**
562
569
  * Emitted when a user clicks the Edit TML action
563
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
570
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
564
571
  */
565
572
  EditTML = 'editTSL',
566
573
  /**
567
574
  * Emitted when ExportTML trigger in answer on the app
568
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
575
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
569
576
  */
570
577
  ExportTML = 'exportTSL',
571
578
  /**
572
579
  * Emitted when an answer is saved as a view
573
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
580
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
574
581
  */
575
582
  SaveAsView = 'saveAsView',
576
583
  /**
577
584
  * Emitted when copy of existing answer on the app
578
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
585
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
579
586
  */
580
587
  CopyAEdit = 'copyAEdit',
581
588
  /**
582
589
  * Emitted when a user clicks Show underlying data on an answe
583
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
590
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
584
591
  */
585
592
  ShowUnderlyingData = 'showUnderlyingData',
586
593
  /**
587
594
  * Emitted when an answer is switched to a chart or table view
588
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
595
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
589
596
  */
590
597
  AnswerChartSwitcher = 'answerChartSwitcher',
591
598
  /**
592
- *
599
+ * Internal event to communicate the initial settings back to the TS APP
600
+ * @hidden
593
601
  */
594
602
  APP_INIT = 'appInit',
595
603
  /**
596
604
  * Emitted when a user clicks Show Liveboard details on a Liveboard
597
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
605
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
598
606
  */
599
607
  LiveboardInfo = 'pinboardInfo',
600
608
  /**
601
609
  * Emitted when a user clicks on the Favorite icon on a Liveboard
602
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
610
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
603
611
  */
604
612
  AddToFavorites = 'addToFavorites',
605
613
  /**
606
614
  * Emitted when a user clicks Schedule on a Liveboard
607
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
615
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
608
616
  */
609
617
  Schedule = 'subscription',
610
618
  /**
611
619
  * Emitted when a user clicks Edit on a Liveboard or visualization
612
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
620
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
613
621
  */
614
622
  Edit = 'edit',
615
623
  /**
616
624
  * Emitted when a user clicks Make a copy on a Liveboard
617
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
625
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
618
626
  */
619
627
  MakeACopy = 'makeACopy',
620
628
  /**
621
629
  * Emitted when a user clicks Present on a Liveboard or visualization
622
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
630
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
623
631
  */
624
632
  Present = 'present',
625
633
  /**
626
634
  * Emitted when a user clicks Delete on a Liveboard
627
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
635
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
628
636
  */
629
637
  Delete = 'delete',
630
638
  /**
631
639
  * Emitted when a user clicks Manage schedules on a Liveboard
632
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
640
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
633
641
  */
634
642
  SchedulesList = 'schedule-list',
635
643
  /**
636
644
  * Emitted when a user clicks Cancel in edit mode on a Liveboard
637
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
645
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
638
646
  */
639
647
  Cancel = 'cancel',
640
648
  /**
641
649
  * Emitted when a user clicks Explore on a visualization
642
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
650
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
643
651
  */
644
652
  Explore = 'explore',
645
653
  /**
646
654
  * Emitted when a user clicks Copy link action on a visualization
647
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
655
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
648
656
  */
649
- CopyLink = 'copyLink',
657
+ CopyLink = 'embedDocument',
650
658
  }
651
659
 
652
660
  /**
@@ -669,8 +677,8 @@ export enum HostEvent {
669
677
  * @param points - an object containing selectedPoints/clickedPoints
670
678
  * eg. { selectedPoints: []}
671
679
  * @param columnGuid - a string guid of the column to drill by. This is optional,
672
- * if not provided it will auto drill by the configured column. \
673
- * @version 1.5.0 or later
680
+ * if not provided it will auto drill by the configured column.
681
+ * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
674
682
  */
675
683
  DrillDown = 'triggerDrillDown',
676
684
  /**
@@ -687,97 +695,97 @@ export enum HostEvent {
687
695
  * Set the visible visualizations on a Liveboard.
688
696
  * @param - an array of ids of visualizations to show, the ids not passed
689
697
  * will be hidden.
690
- * @version 1.6.0 or later
698
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
691
699
  */
692
700
  SetVisibleVizs = 'SetPinboardVisibleVizs',
693
701
  /**
694
702
  * Update the runtime filters. The runtime filters passed here are extended
695
703
  * on to the existing runtime filters if they exist.
696
704
  * @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
697
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
705
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
698
706
  */
699
707
  UpdateRuntimeFilters = 'UpdateRuntimeFilters',
700
708
  /**
701
709
  * Navigate to a specific page in App embed without any reload.
702
710
  * This is the same as calling `appEmbed.navigateToPage(path, true)`
703
711
  * @param path - the path to navigate to (can be a number[1/-1] to go forward/back)
704
- * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl
712
+ * @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
705
713
  */
706
714
  Navigate = 'Navigate',
707
715
  /**
708
716
  * Gets the current pinboard content.
709
- * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl
717
+ * @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
710
718
  */
711
719
  getExportRequestForCurrentPinboard = 'getExportRequestForCurrentPinboard',
712
720
  /**
713
721
  * Triggers the Pin action on an embedded object
714
722
  * @param - incase of Liveboard embed, takes in an object with vizId as a key
715
723
  * can be left empty for search and visualization embeds
716
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
724
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
717
725
  */
718
726
  Pin = 'pin',
719
727
  /**
720
728
  * Triggers the Show Liveboard details action on a Liveboard
721
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
729
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
722
730
  */
723
731
  LiveboardInfo = 'pinboardInfo',
724
732
  /**
725
733
  * Triggers the Schedule action on a Liveboard
726
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
734
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
727
735
  */
728
736
  Schedule = 'subscription',
729
737
  /**
730
738
  * Triggers the Manage schedule action on a Liveboard
731
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
739
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
732
740
  */
733
741
  SchedulesList = 'schedule-list',
734
742
  /**
735
743
  * Triggers the Export TML action on a Liveboard
736
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
744
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
737
745
  */
738
746
  ExportTML = 'exportTSL',
739
747
  /**
740
748
  * Triggers the Edit TML action on a Liveboard
741
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
749
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
742
750
  */
743
751
  EditTML = 'editTSL',
744
752
  /**
745
753
  * Triggers the Update TML action on a Liveboard
746
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
754
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
747
755
  */
748
756
  UpdateTML = 'updateTSL',
749
757
  /**
750
758
  * Triggers the Download PDF action on a Liveboard
751
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
759
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
752
760
  */
753
761
  DownloadAsPdf = 'downloadAsPdf',
754
762
  /**
755
763
  * Triggers the Make a copy action on a Liveboard
756
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
764
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
757
765
  */
758
766
  MakeACopy = 'makeACopy',
759
767
  /**
760
768
  * Triggers the Delete action on a Liveboard
761
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
769
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
762
770
  */
763
771
  Remove = 'delete',
764
772
  /**
765
773
  * Triggers the Explore action on a visualization
766
774
  * @param - an object with vizId as a key
767
775
  * eg: {vizId: '730496d6-6903-4601-937e-2c691821af3c'}
768
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
776
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
769
777
  */
770
778
  Explore = 'explore',
771
779
  /**
772
780
  * Triggers the Create alert action on a visualization
773
781
  * @param - an object with vizId as a key
774
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
782
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
775
783
  */
776
784
  CreateMonitor = 'createMonitor',
777
785
  /**
778
786
  * Triggers the Manage alert action on a visualization
779
787
  * @param - an object with vizId as a key
780
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
788
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
781
789
  */
782
790
  ManageMonitor = 'manageMonitor',
783
791
  /**
@@ -787,7 +795,7 @@ export enum HostEvent {
787
795
  * liveboardEmbed.trigger(HostEvent.Edit)
788
796
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
789
797
  * vizEmbed.trigger((HostEvent.Edit)
790
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
798
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
791
799
  */
792
800
  Edit = 'edit',
793
801
  /**
@@ -797,7 +805,7 @@ export enum HostEvent {
797
805
  * liveboardEmbed.trigger(HostEvent.CopyLink)
798
806
  * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
799
807
  * vizEmbed.trigger((HostEvent.CopyLink)
800
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
808
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
801
809
  */
802
810
  CopyLink = 'embedDocument',
803
811
  /**
@@ -807,7 +815,7 @@ export enum HostEvent {
807
815
  * liveboardEmbed.trigger(HostEvent.Present)
808
816
  * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
809
817
  * vizEmbed.trigger((HostEvent.Present)
810
- * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
818
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
811
819
  */
812
820
  Present = 'present',
813
821
  }
@@ -993,27 +1001,27 @@ export enum Action {
993
1001
  RequestAccess = 'requestAccess',
994
1002
  QueryDetailsButtons = 'queryDetailsButtons',
995
1003
  /**
996
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
1004
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
997
1005
  */
998
1006
  AnswerDelete = 'onDeleteAnswer',
999
1007
  /**
1000
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
1008
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1001
1009
  */
1002
1010
  AnswerChartSwitcher = 'answerChartSwitcher',
1003
1011
  /**
1004
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
1012
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1005
1013
  */
1006
1014
  AddToFavorites = 'addToFavorites',
1007
1015
  /**
1008
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
1016
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1009
1017
  */
1010
1018
  EditDetails = 'editDetails',
1011
1019
  /**
1012
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
1020
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1013
1021
  */
1014
1022
  CreateMonitor = 'createMonitor',
1015
1023
  /**
1016
- * @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl
1024
+ * @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1017
1025
  */
1018
1026
  ReportError = 'reportError',
1019
1027
  }
@@ -3,6 +3,7 @@ import {
3
3
  fetchAuthTokenService,
4
4
  fetchAuthService,
5
5
  fetchBasicAuthService,
6
+ fetchAuthPostService,
6
7
  } from './authService';
7
8
  import { EndPoints } from '../auth';
8
9
 
@@ -56,6 +57,26 @@ describe('Unit test for authService', () => {
56
57
  );
57
58
  });
58
59
 
60
+ test('fetchAuthPostService', async () => {
61
+ global.fetch = jest.fn(() =>
62
+ Promise.resolve({ success: true, ok: true }),
63
+ );
64
+ await fetchAuthPostService(thoughtSpotHost, username, authToken);
65
+ expect(fetch).toBeCalledWith(
66
+ `${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`,
67
+ {
68
+ method: 'POST',
69
+ credentials: 'include',
70
+ redirect: 'manual',
71
+ body: 'username=tsuser&auth_token=token',
72
+ headers: {
73
+ 'content-type': 'application/x-www-form-urlencoded',
74
+ 'x-requested-by': 'ThoughtSpot',
75
+ },
76
+ },
77
+ );
78
+ });
79
+
59
80
  test('fetchBasicAuthService called with manual redirect', async () => {
60
81
  global.fetch = jest.fn(() =>
61
82
  Promise.resolve({ success: true, ok: true }),
@@ -42,6 +42,26 @@ export async function fetchAuthService(
42
42
  );
43
43
  }
44
44
 
45
+ export async function fetchAuthPostService(
46
+ thoughtSpotHost: string,
47
+ username: string,
48
+ authToken: string,
49
+ ): Promise<any> {
50
+ return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
51
+ method: 'POST',
52
+ headers: {
53
+ 'content-type': 'application/x-www-form-urlencoded',
54
+ 'x-requested-by': 'ThoughtSpot',
55
+ },
56
+ body: `username=${encodeURIComponent(
57
+ username,
58
+ )}&auth_token=${encodeURIComponent(authToken)}`,
59
+ credentials: 'include',
60
+ // We do not want to follow the redirect, as it starts giving a CORS error
61
+ redirect: 'manual',
62
+ });
63
+ }
64
+
45
65
  export async function fetchBasicAuthService(
46
66
  thoughtSpotHost: string,
47
67
  username: string,