@thoughtspot/visual-embed-sdk 1.14.0-alpha.0 → 1.15.0-alpha.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.
- package/CHANGELOG.md +5 -2
- package/dist/src/embed/app.d.ts +4 -3
- package/dist/src/embed/base.d.ts +1 -1
- package/dist/src/embed/liveboard.d.ts +6 -8
- package/dist/src/embed/pinboard.d.ts +91 -0
- package/dist/src/embed/search.d.ts +1 -1
- package/dist/src/embed/ts-embed.d.ts +4 -4
- package/dist/src/types.d.ts +79 -76
- package/dist/src/utils/authService.d.ts +1 -0
- package/dist/src/utils/plugin.d.ts +0 -0
- package/dist/src/v1/api.d.ts +19 -0
- package/dist/tsembed.es.js +99 -76
- package/dist/tsembed.js +99 -76
- package/lib/package.json +1 -1
- package/lib/src/auth.js +8 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +18 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +4 -3
- package/lib/src/embed/app.js +2 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/liveboard.d.ts +6 -8
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/pinboard.d.ts +91 -0
- package/lib/src/embed/pinboard.js +110 -0
- package/lib/src/embed/pinboard.js.map +1 -0
- package/lib/src/embed/search.d.ts +1 -1
- package/lib/src/embed/ts-embed.d.ts +4 -4
- package/lib/src/types.d.ts +79 -76
- package/lib/src/types.js +69 -68
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService.d.ts +1 -0
- package/lib/src/utils/authService.js +13 -0
- package/lib/src/utils/authService.js.map +1 -1
- package/lib/src/utils/authService.spec.js +15 -1
- package/lib/src/utils/authService.spec.js.map +1 -1
- package/lib/src/utils/plugin.d.ts +0 -0
- package/lib/src/utils/plugin.js +1 -0
- package/lib/src/utils/plugin.js.map +1 -0
- package/lib/src/utils/processData.js +7 -5
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +14 -0
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +95 -93
- package/package.json +2 -2
- package/src/auth.spec.ts +39 -0
- package/src/auth.ts +11 -5
- package/src/embed/app.ts +4 -3
- package/src/embed/base.ts +1 -1
- package/src/embed/liveboard.ts +6 -8
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.ts +4 -4
- package/src/types.ts +79 -76
- package/src/utils/authService.spec.ts +21 -0
- package/src/utils/authService.ts +20 -0
- package/src/utils/processData.spec.ts +17 -0
- package/src/utils/processData.ts +7 -5
package/dist/tsembed.js
CHANGED
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
*/
|
|
160
160
|
(function (AuthType) {
|
|
161
161
|
/**
|
|
162
|
-
* No authentication.
|
|
162
|
+
* No authentication on the SDK. Passthrough to the embedded App. Alias for `Passthrough`.
|
|
163
163
|
*/
|
|
164
164
|
AuthType["None"] = "None";
|
|
165
165
|
/**
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
/**
|
|
291
291
|
* One or more data columns have been selected.
|
|
292
292
|
* @return columnIds - the list of columns
|
|
293
|
-
* @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl
|
|
293
|
+
* @version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
294
294
|
*/
|
|
295
295
|
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
|
|
296
296
|
/**
|
|
@@ -302,13 +302,13 @@
|
|
|
302
302
|
/**
|
|
303
303
|
* A double click has been triggered on table/chart
|
|
304
304
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
305
|
-
* @version 1.5.0
|
|
305
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
306
306
|
*/
|
|
307
307
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
308
308
|
/**
|
|
309
309
|
* A click has been triggered on table/chart
|
|
310
310
|
* @return ContextMenuInputPoints - data point that is clicked
|
|
311
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
311
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
312
312
|
*/
|
|
313
313
|
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
314
314
|
/**
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
* Emitted when the embed does not have cookie access. This
|
|
361
361
|
* happens on Safari where third-party cookies are blocked by default.
|
|
362
362
|
*
|
|
363
|
-
* @version 1.1.0
|
|
363
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
364
364
|
*/
|
|
365
365
|
EmbedEvent["NoCookieAccess"] = "noCookieAccess";
|
|
366
366
|
/**
|
|
@@ -371,179 +371,180 @@
|
|
|
371
371
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
372
372
|
/**
|
|
373
373
|
* Emitted when any modal is opened in the app
|
|
374
|
-
* @version 1.6.0
|
|
374
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
375
375
|
*/
|
|
376
376
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
377
377
|
/**
|
|
378
378
|
* Emitted when any modal is closed in the app
|
|
379
|
-
* @version 1.6.0
|
|
379
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
380
380
|
*/
|
|
381
381
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
382
382
|
/**
|
|
383
383
|
* Emitted when a liveboard has completed rendering,
|
|
384
384
|
* this event can be used as a hook to trigger events on the
|
|
385
385
|
* rendered liveboard
|
|
386
|
-
* @version 1.9.1
|
|
386
|
+
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
387
387
|
*/
|
|
388
388
|
EmbedEvent["LiveboardRendered"] = "PinboardRendered";
|
|
389
389
|
/**
|
|
390
390
|
* This can be used to register an event listener which
|
|
391
391
|
* is triggered on all events.
|
|
392
|
-
* @
|
|
392
|
+
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
393
393
|
*/
|
|
394
394
|
EmbedEvent["ALL"] = "*";
|
|
395
395
|
/**
|
|
396
396
|
* Emitted when answer is saved in the app
|
|
397
|
-
* @
|
|
397
|
+
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
398
398
|
*/
|
|
399
399
|
EmbedEvent["Save"] = "save";
|
|
400
400
|
/**
|
|
401
401
|
* Emitted when the download action is triggered on an answer
|
|
402
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
402
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
403
403
|
*/
|
|
404
404
|
EmbedEvent["Download"] = "download";
|
|
405
405
|
/**
|
|
406
406
|
* Emitted when the Download as PDF action is triggered on an answer
|
|
407
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
407
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
408
408
|
*/
|
|
409
409
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
410
410
|
/**
|
|
411
411
|
* Emitted when the Download as CSV action is triggered on an answer
|
|
412
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
412
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
413
413
|
*/
|
|
414
414
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
415
415
|
/**
|
|
416
416
|
* Emitted when the Download as XLSX action is triggered on an answer
|
|
417
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
417
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
418
418
|
*/
|
|
419
419
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
420
420
|
/**
|
|
421
421
|
* Emitted when an answer is deleted in the app
|
|
422
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
422
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
423
423
|
*/
|
|
424
424
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
425
425
|
/**
|
|
426
426
|
* Emitted when an answer is pinned to a Liveboard
|
|
427
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
427
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
428
428
|
*/
|
|
429
429
|
EmbedEvent["Pin"] = "pin";
|
|
430
430
|
/**
|
|
431
431
|
* Emitted when SpotIQ analysis is triggered
|
|
432
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
432
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
433
433
|
*/
|
|
434
434
|
EmbedEvent["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
435
435
|
/**
|
|
436
436
|
* Emitted when a user shares an object with another user or group
|
|
437
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
437
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
438
438
|
*/
|
|
439
439
|
EmbedEvent["Share"] = "share";
|
|
440
440
|
/**
|
|
441
441
|
* Emitted when a user clicks the Include action to include a specific value or data on a chart or table
|
|
442
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
442
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
443
443
|
*/
|
|
444
444
|
EmbedEvent["DrillInclude"] = "context-menu-item-include";
|
|
445
445
|
/**
|
|
446
446
|
* Emitted when a user clicks the Exclude action to exclude a specific value or data on a chart or table
|
|
447
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
447
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
448
448
|
*/
|
|
449
449
|
EmbedEvent["DrillExclude"] = "context-menu-item-exclude";
|
|
450
450
|
/**
|
|
451
451
|
* Emitted when copied column value on the app
|
|
452
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
452
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
453
453
|
*/
|
|
454
454
|
EmbedEvent["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
|
|
455
455
|
/**
|
|
456
456
|
* Emitted when a user clicks the Update TML action
|
|
457
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
457
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
458
458
|
*/
|
|
459
459
|
EmbedEvent["UpdateTML"] = "updateTSL";
|
|
460
460
|
/**
|
|
461
461
|
* Emitted when a user clicks the Edit TML action
|
|
462
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
462
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
463
463
|
*/
|
|
464
464
|
EmbedEvent["EditTML"] = "editTSL";
|
|
465
465
|
/**
|
|
466
466
|
* Emitted when ExportTML trigger in answer on the app
|
|
467
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
467
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
468
468
|
*/
|
|
469
469
|
EmbedEvent["ExportTML"] = "exportTSL";
|
|
470
470
|
/**
|
|
471
471
|
* Emitted when an answer is saved as a view
|
|
472
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
472
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
473
473
|
*/
|
|
474
474
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
475
475
|
/**
|
|
476
476
|
* Emitted when copy of existing answer on the app
|
|
477
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
477
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
478
478
|
*/
|
|
479
479
|
EmbedEvent["CopyAEdit"] = "copyAEdit";
|
|
480
480
|
/**
|
|
481
481
|
* Emitted when a user clicks Show underlying data on an answe
|
|
482
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
482
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
483
483
|
*/
|
|
484
484
|
EmbedEvent["ShowUnderlyingData"] = "showUnderlyingData";
|
|
485
485
|
/**
|
|
486
486
|
* Emitted when an answer is switched to a chart or table view
|
|
487
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
487
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
488
488
|
*/
|
|
489
489
|
EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
490
490
|
/**
|
|
491
|
-
*
|
|
491
|
+
* Internal event to communicate the initial settings back to the TS APP
|
|
492
|
+
* @hidden
|
|
492
493
|
*/
|
|
493
494
|
EmbedEvent["APP_INIT"] = "appInit";
|
|
494
495
|
/**
|
|
495
496
|
* Emitted when a user clicks Show Liveboard details on a Liveboard
|
|
496
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
497
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
497
498
|
*/
|
|
498
499
|
EmbedEvent["LiveboardInfo"] = "pinboardInfo";
|
|
499
500
|
/**
|
|
500
501
|
* Emitted when a user clicks on the Favorite icon on a Liveboard
|
|
501
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
502
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
502
503
|
*/
|
|
503
504
|
EmbedEvent["AddToFavorites"] = "addToFavorites";
|
|
504
505
|
/**
|
|
505
506
|
* Emitted when a user clicks Schedule on a Liveboard
|
|
506
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
507
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
507
508
|
*/
|
|
508
509
|
EmbedEvent["Schedule"] = "subscription";
|
|
509
510
|
/**
|
|
510
511
|
* Emitted when a user clicks Edit on a Liveboard or visualization
|
|
511
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
512
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
512
513
|
*/
|
|
513
514
|
EmbedEvent["Edit"] = "edit";
|
|
514
515
|
/**
|
|
515
516
|
* Emitted when a user clicks Make a copy on a Liveboard
|
|
516
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
517
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
517
518
|
*/
|
|
518
519
|
EmbedEvent["MakeACopy"] = "makeACopy";
|
|
519
520
|
/**
|
|
520
521
|
* Emitted when a user clicks Present on a Liveboard or visualization
|
|
521
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
522
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
522
523
|
*/
|
|
523
524
|
EmbedEvent["Present"] = "present";
|
|
524
525
|
/**
|
|
525
526
|
* Emitted when a user clicks Delete on a Liveboard
|
|
526
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
527
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
527
528
|
*/
|
|
528
529
|
EmbedEvent["Delete"] = "delete";
|
|
529
530
|
/**
|
|
530
531
|
* Emitted when a user clicks Manage schedules on a Liveboard
|
|
531
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
532
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
532
533
|
*/
|
|
533
534
|
EmbedEvent["SchedulesList"] = "schedule-list";
|
|
534
535
|
/**
|
|
535
536
|
* Emitted when a user clicks Cancel in edit mode on a Liveboard
|
|
536
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
537
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
537
538
|
*/
|
|
538
539
|
EmbedEvent["Cancel"] = "cancel";
|
|
539
540
|
/**
|
|
540
541
|
* Emitted when a user clicks Explore on a visualization
|
|
541
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
542
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
542
543
|
*/
|
|
543
544
|
EmbedEvent["Explore"] = "explore";
|
|
544
545
|
/**
|
|
545
546
|
* Emitted when a user clicks Copy link action on a visualization
|
|
546
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
547
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
547
548
|
*/
|
|
548
549
|
EmbedEvent["CopyLink"] = "embedDocument";
|
|
549
550
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
@@ -559,8 +560,8 @@
|
|
|
559
560
|
* @param points - an object containing selectedPoints/clickedPoints
|
|
560
561
|
* eg. { selectedPoints: []}
|
|
561
562
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
562
|
-
* if not provided it will auto drill by the configured column.
|
|
563
|
-
* @version 1.5.0
|
|
563
|
+
* if not provided it will auto drill by the configured column.
|
|
564
|
+
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
564
565
|
*/
|
|
565
566
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
566
567
|
/**
|
|
@@ -577,97 +578,97 @@
|
|
|
577
578
|
* Set the visible visualizations on a Liveboard.
|
|
578
579
|
* @param - an array of ids of visualizations to show, the ids not passed
|
|
579
580
|
* will be hidden.
|
|
580
|
-
* @version 1.6.0
|
|
581
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
581
582
|
*/
|
|
582
583
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
583
584
|
/**
|
|
584
585
|
* Update the runtime filters. The runtime filters passed here are extended
|
|
585
586
|
* on to the existing runtime filters if they exist.
|
|
586
587
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
587
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
588
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
588
589
|
*/
|
|
589
590
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
590
591
|
/**
|
|
591
592
|
* Navigate to a specific page in App embed without any reload.
|
|
592
593
|
* This is the same as calling `appEmbed.navigateToPage(path, true)`
|
|
593
594
|
* @param path - the path to navigate to (can be a number[1/-1] to go forward/back)
|
|
594
|
-
* @version SDK: 1.12.0 | ThoughtSpot
|
|
595
|
+
* @version SDK: 1.12.0 | ThoughtSpot 8.4.0.cl, 8.4.1-sw
|
|
595
596
|
*/
|
|
596
597
|
HostEvent["Navigate"] = "Navigate";
|
|
597
598
|
/**
|
|
598
599
|
* Gets the current pinboard content.
|
|
599
|
-
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl
|
|
600
|
+
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
600
601
|
*/
|
|
601
602
|
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
602
603
|
/**
|
|
603
604
|
* Triggers the Pin action on an embedded object
|
|
604
605
|
* @param - incase of Liveboard embed, takes in an object with vizId as a key
|
|
605
606
|
* can be left empty for search and visualization embeds
|
|
606
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
607
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
607
608
|
*/
|
|
608
609
|
HostEvent["Pin"] = "pin";
|
|
609
610
|
/**
|
|
610
611
|
* Triggers the Show Liveboard details action on a Liveboard
|
|
611
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
612
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
612
613
|
*/
|
|
613
614
|
HostEvent["LiveboardInfo"] = "pinboardInfo";
|
|
614
615
|
/**
|
|
615
616
|
* Triggers the Schedule action on a Liveboard
|
|
616
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
617
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
617
618
|
*/
|
|
618
619
|
HostEvent["Schedule"] = "subscription";
|
|
619
620
|
/**
|
|
620
621
|
* Triggers the Manage schedule action on a Liveboard
|
|
621
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
622
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
622
623
|
*/
|
|
623
624
|
HostEvent["SchedulesList"] = "schedule-list";
|
|
624
625
|
/**
|
|
625
626
|
* Triggers the Export TML action on a Liveboard
|
|
626
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
627
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
627
628
|
*/
|
|
628
629
|
HostEvent["ExportTML"] = "exportTSL";
|
|
629
630
|
/**
|
|
630
631
|
* Triggers the Edit TML action on a Liveboard
|
|
631
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
632
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
632
633
|
*/
|
|
633
634
|
HostEvent["EditTML"] = "editTSL";
|
|
634
635
|
/**
|
|
635
636
|
* Triggers the Update TML action on a Liveboard
|
|
636
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
637
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
637
638
|
*/
|
|
638
639
|
HostEvent["UpdateTML"] = "updateTSL";
|
|
639
640
|
/**
|
|
640
641
|
* Triggers the Download PDF action on a Liveboard
|
|
641
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
642
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
642
643
|
*/
|
|
643
644
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
644
645
|
/**
|
|
645
646
|
* Triggers the Make a copy action on a Liveboard
|
|
646
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
647
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
647
648
|
*/
|
|
648
649
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
649
650
|
/**
|
|
650
651
|
* Triggers the Delete action on a Liveboard
|
|
651
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
652
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
652
653
|
*/
|
|
653
654
|
HostEvent["Remove"] = "delete";
|
|
654
655
|
/**
|
|
655
656
|
* Triggers the Explore action on a visualization
|
|
656
657
|
* @param - an object with vizId as a key
|
|
657
658
|
* eg: {vizId: '730496d6-6903-4601-937e-2c691821af3c'}
|
|
658
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
659
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
659
660
|
*/
|
|
660
661
|
HostEvent["Explore"] = "explore";
|
|
661
662
|
/**
|
|
662
663
|
* Triggers the Create alert action on a visualization
|
|
663
664
|
* @param - an object with vizId as a key
|
|
664
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
665
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
665
666
|
*/
|
|
666
667
|
HostEvent["CreateMonitor"] = "createMonitor";
|
|
667
668
|
/**
|
|
668
669
|
* Triggers the Manage alert action on a visualization
|
|
669
670
|
* @param - an object with vizId as a key
|
|
670
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
671
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
671
672
|
*/
|
|
672
673
|
HostEvent["ManageMonitor"] = "manageMonitor";
|
|
673
674
|
/**
|
|
@@ -677,7 +678,7 @@
|
|
|
677
678
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
678
679
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
679
680
|
* vizEmbed.trigger((HostEvent.Edit)
|
|
680
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
681
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
681
682
|
*/
|
|
682
683
|
HostEvent["Edit"] = "edit";
|
|
683
684
|
/**
|
|
@@ -687,7 +688,7 @@
|
|
|
687
688
|
* liveboardEmbed.trigger(HostEvent.CopyLink)
|
|
688
689
|
* liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
689
690
|
* vizEmbed.trigger((HostEvent.CopyLink)
|
|
690
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
691
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
691
692
|
*/
|
|
692
693
|
HostEvent["CopyLink"] = "embedDocument";
|
|
693
694
|
/**
|
|
@@ -697,7 +698,7 @@
|
|
|
697
698
|
* liveboardEmbed.trigger(HostEvent.Present)
|
|
698
699
|
* liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
699
700
|
* vizEmbed.trigger((HostEvent.Present)
|
|
700
|
-
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
|
|
701
|
+
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
701
702
|
*/
|
|
702
703
|
HostEvent["Present"] = "present";
|
|
703
704
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
@@ -871,27 +872,27 @@
|
|
|
871
872
|
Action["RequestAccess"] = "requestAccess";
|
|
872
873
|
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
873
874
|
/**
|
|
874
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
875
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
875
876
|
*/
|
|
876
877
|
Action["AnswerDelete"] = "onDeleteAnswer";
|
|
877
878
|
/**
|
|
878
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
879
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
879
880
|
*/
|
|
880
881
|
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
881
882
|
/**
|
|
882
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
883
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
883
884
|
*/
|
|
884
885
|
Action["AddToFavorites"] = "addToFavorites";
|
|
885
886
|
/**
|
|
886
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
887
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
887
888
|
*/
|
|
888
889
|
Action["EditDetails"] = "editDetails";
|
|
889
890
|
/**
|
|
890
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
891
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
891
892
|
*/
|
|
892
893
|
Action["CreateMonitor"] = "createMonitor";
|
|
893
894
|
/**
|
|
894
|
-
* @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl
|
|
895
|
+
* @version SDK: 1.11.1 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
895
896
|
*/
|
|
896
897
|
Action["ReportError"] = "reportError";
|
|
897
898
|
})(exports.Action || (exports.Action = {}));
|
|
@@ -7367,6 +7368,19 @@
|
|
|
7367
7368
|
redirect: 'manual',
|
|
7368
7369
|
});
|
|
7369
7370
|
}
|
|
7371
|
+
async function fetchAuthPostService(thoughtSpotHost, username, authToken) {
|
|
7372
|
+
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.TOKEN_LOGIN}`, {
|
|
7373
|
+
method: 'POST',
|
|
7374
|
+
headers: {
|
|
7375
|
+
'content-type': 'application/x-www-form-urlencoded',
|
|
7376
|
+
'x-requested-by': 'ThoughtSpot',
|
|
7377
|
+
},
|
|
7378
|
+
body: `username=${encodeURIComponent(username)}&auth_token=${encodeURIComponent(authToken)}`,
|
|
7379
|
+
credentials: 'include',
|
|
7380
|
+
// We do not want to follow the redirect, as it starts giving a CORS error
|
|
7381
|
+
redirect: 'manual',
|
|
7382
|
+
});
|
|
7383
|
+
}
|
|
7370
7384
|
async function fetchBasicAuthService(thoughtSpotHost, username, password) {
|
|
7371
7385
|
return failureLoggedFetch(`${thoughtSpotHost}${EndPoints.BASIC_LOGIN}`, {
|
|
7372
7386
|
method: 'POST',
|
|
@@ -7503,7 +7517,13 @@
|
|
|
7503
7517
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
7504
7518
|
authToken = await response.text();
|
|
7505
7519
|
}
|
|
7506
|
-
|
|
7520
|
+
let resp;
|
|
7521
|
+
try {
|
|
7522
|
+
resp = await fetchAuthPostService(thoughtSpotHost, username, authToken);
|
|
7523
|
+
}
|
|
7524
|
+
catch (e) {
|
|
7525
|
+
resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
7526
|
+
}
|
|
7507
7527
|
// token login issues a 302 when successful
|
|
7508
7528
|
loggedInStatus = resp.ok || resp.type === 'opaqueredirect';
|
|
7509
7529
|
if (loggedInStatus && embedConfig.detectCookieAccessSlow) {
|
|
@@ -7755,7 +7775,7 @@
|
|
|
7755
7775
|
*
|
|
7756
7776
|
* @param doNotDisableAutoLogin This flag when passed will not disable autoLogin
|
|
7757
7777
|
* @returns Promise which resolves when logout completes.
|
|
7758
|
-
* @version SDK: 1.10.1 | ThoughtSpot:
|
|
7778
|
+
* @version SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw
|
|
7759
7779
|
*/
|
|
7760
7780
|
const logout$1 = (doNotDisableAutoLogin = false) => {
|
|
7761
7781
|
if (!doNotDisableAutoLogin) {
|
|
@@ -7879,10 +7899,12 @@
|
|
|
7879
7899
|
return e;
|
|
7880
7900
|
}
|
|
7881
7901
|
function processAuthFailure(e, containerEl) {
|
|
7882
|
-
const { loginFailedMessage } = getEmbedConfig();
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7902
|
+
const { loginFailedMessage, authType } = getEmbedConfig();
|
|
7903
|
+
if (authType !== exports.AuthType.None) {
|
|
7904
|
+
// eslint-disable-next-line no-param-reassign
|
|
7905
|
+
containerEl.innerHTML = loginFailedMessage;
|
|
7906
|
+
notifyAuthFailure(exports.AuthFailureType.OTHER);
|
|
7907
|
+
}
|
|
7886
7908
|
return e;
|
|
7887
7909
|
}
|
|
7888
7910
|
function processAuthLogout(e, containerEl) {
|
|
@@ -7954,7 +7976,7 @@
|
|
|
7954
7976
|
});
|
|
7955
7977
|
}
|
|
7956
7978
|
|
|
7957
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.
|
|
7979
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.15.0-alpha.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports$1={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","html-react-parser":"^1.4.12","mixpanel-browser":"^2.45.0","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports$1,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
7958
7980
|
|
|
7959
7981
|
/**
|
|
7960
7982
|
* Copyright (c) 2022
|
|
@@ -8588,7 +8610,8 @@
|
|
|
8588
8610
|
* @param path string | number The string, set to iframe src and navigate to new page
|
|
8589
8611
|
* eg: appEmbed.navigateToPage('pinboards')
|
|
8590
8612
|
* When used with `noReload` this can also be a number like 1/-1 to go forward/back.
|
|
8591
|
-
* @param noReload boolean Trigger the navigation without reloading the page
|
|
8613
|
+
* @param noReload boolean Trigger the navigation without reloading the page
|
|
8614
|
+
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
8592
8615
|
*/
|
|
8593
8616
|
navigateToPage(path, noReload = false) {
|
|
8594
8617
|
if (!this.iFrame) {
|
package/lib/package.json
CHANGED
package/lib/src/auth.js
CHANGED
|
@@ -2,7 +2,7 @@ import { initMixpanel } from './mixpanel-service';
|
|
|
2
2
|
import { AuthType, EmbedEvent } from './types';
|
|
3
3
|
import { getRedirectUrl } from './utils';
|
|
4
4
|
// eslint-disable-next-line import/no-cycle
|
|
5
|
-
import { fetchSessionInfoService, fetchAuthTokenService, fetchAuthService, fetchBasicAuthService, fetchLogoutService, } from './utils/authService';
|
|
5
|
+
import { fetchSessionInfoService, fetchAuthTokenService, fetchAuthService, fetchBasicAuthService, fetchLogoutService, fetchAuthPostService, } from './utils/authService';
|
|
6
6
|
// eslint-disable-next-line import/no-mutable-exports
|
|
7
7
|
export let loggedInStatus = false;
|
|
8
8
|
// eslint-disable-next-line import/no-mutable-exports
|
|
@@ -126,7 +126,13 @@ export const doTokenAuth = async (embedConfig) => {
|
|
|
126
126
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
127
127
|
authToken = await response.text();
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
let resp;
|
|
130
|
+
try {
|
|
131
|
+
resp = await fetchAuthPostService(thoughtSpotHost, username, authToken);
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
resp = await fetchAuthService(thoughtSpotHost, username, authToken);
|
|
135
|
+
}
|
|
130
136
|
// token login issues a 302 when successful
|
|
131
137
|
loggedInStatus = resp.ok || resp.type === 'opaqueredirect';
|
|
132
138
|
if (loggedInStatus && embedConfig.detectCookieAccessSlow) {
|
package/lib/src/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAe,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,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B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,EAAE,WAAwB,EAAoB,EAAE;IACvE,MAAM,EAAE,eAAe,EAAE,GAAG,WAAW,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAC3D,cAAc,GAAG,KAAK,CAAC;IACvB,OAAO,cAAc,CAAC;AAC1B,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC7B,WAAwB,EACR,EAAE;IAClB,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IACjC,QAAQ,QAAQ,EAAE;QACd,KAAK,QAAQ,CAAC,GAAG,CAAC;QAClB,KAAK,QAAQ,CAAC,IAAI;YACd,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;QACnC,KAAK,QAAQ,CAAC,IAAI;YACd,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;QACnC,KAAK,QAAQ,CAAC,UAAU;YACpB,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;QACpC,KAAK,QAAQ,CAAC,KAAK;YACf,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;QACpC;YACI,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,EAAE,CAAC,cAAc,CAAC"}
|
package/lib/src/auth.spec.js
CHANGED
|
@@ -175,6 +175,24 @@ describe('Unit test for auth', () => {
|
|
|
175
175
|
expect(authService.fetchSessionInfoService).toHaveBeenCalledTimes(2);
|
|
176
176
|
expect(isLoggedIn).toBe(false);
|
|
177
177
|
});
|
|
178
|
+
test('doTokenAuth: when user is not loggedIn & fetchAuthPostService failed than fetchAuthService should call', async () => {
|
|
179
|
+
jest.spyOn(window, 'alert').mockImplementation(() => undefined);
|
|
180
|
+
jest.spyOn(authService, 'fetchSessionInfoService').mockImplementation(() => false);
|
|
181
|
+
jest.spyOn(authService, 'fetchAuthTokenService').mockImplementation(() => ({ text: () => Promise.resolve('abc') }));
|
|
182
|
+
jest.spyOn(authService, 'fetchAuthPostService').mockImplementation(() =>
|
|
183
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
184
|
+
Promise.reject({
|
|
185
|
+
status: 500,
|
|
186
|
+
}));
|
|
187
|
+
jest.spyOn(authService, 'fetchAuthService').mockImplementation(() => Promise.resolve({
|
|
188
|
+
status: 200,
|
|
189
|
+
type: 'opaqueredirect',
|
|
190
|
+
}));
|
|
191
|
+
expect(await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess('authToken2'))).toBe(true);
|
|
192
|
+
expect(authService.fetchSessionInfoService).toBeCalled();
|
|
193
|
+
expect(authService.fetchAuthPostService).toBeCalledWith(thoughtSpotHost, username, 'authToken2');
|
|
194
|
+
expect(authService.fetchAuthService).toBeCalledWith(thoughtSpotHost, username, 'authToken2');
|
|
195
|
+
});
|
|
178
196
|
describe('doBasicAuth', () => {
|
|
179
197
|
beforeEach(() => {
|
|
180
198
|
global.fetch = window.fetch;
|