@thoughtspot/visual-embed-sdk 1.29.0-alpha.7 → 1.29.0-alpha.SCAL-205893-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.
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts +14 -17
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +45 -59
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.d.ts +12 -0
- package/cjs/src/auth.spec.d.ts.map +1 -1
- package/cjs/src/auth.spec.js +89 -67
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.d.ts +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +18 -5
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.d.ts +2 -0
- package/cjs/src/authToken.spec.d.ts.map +1 -0
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -0
- package/cjs/src/embed/app.spec.js +4 -2
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +2 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +1 -0
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/embed.spec.js +3 -0
- package/cjs/src/embed/embed.spec.js.map +1 -1
- package/cjs/src/embed/events.spec.js +3 -0
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +2 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/pinboard.spec.js +3 -0
- package/cjs/src/embed/pinboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.spec.js +3 -0
- package/cjs/src/embed/sage.spec.js.map +1 -1
- package/cjs/src/embed/search.spec.js +1 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed-trigger.spec.js +3 -0
- package/cjs/src/embed/ts-embed-trigger.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +7 -0
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +7 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +2 -1
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +1 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +7 -0
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +6 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +79 -47
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +61 -46
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/authService.d.ts +1 -0
- package/cjs/src/utils/authService/authService.d.ts.map +1 -1
- package/cjs/src/utils/authService/authService.js +1 -0
- package/cjs/src/utils/authService/authService.js.map +1 -1
- package/cjs/src/utils/authService/authService.spec.js +18 -5
- package/cjs/src/utils/authService/authService.spec.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts +15 -2
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.js +39 -9
- package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts +2 -0
- package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts.map +1 -0
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +32 -0
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -0
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +10 -0
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +10 -0
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/processData.js +2 -2
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +3 -2
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils/sessionInfoService.d.ts +66 -0
- package/cjs/src/utils/sessionInfoService.d.ts.map +1 -0
- package/cjs/src/utils/sessionInfoService.js +92 -0
- package/cjs/src/utils/sessionInfoService.js.map +1 -0
- package/cjs/src/utils.d.ts +1 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +4 -1
- package/cjs/src/utils.js.map +1 -1
- package/dist/src/auth.d.ts +14 -17
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/auth.spec.d.ts +12 -0
- package/dist/src/auth.spec.d.ts.map +1 -1
- package/dist/src/authToken.d.ts +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/authToken.spec.d.ts +2 -0
- package/dist/src/authToken.spec.d.ts.map +1 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +2 -1
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +79 -47
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/authService/authService.d.ts +1 -0
- package/dist/src/utils/authService/authService.d.ts.map +1 -1
- package/dist/src/utils/authService/tokenizedAuthService.d.ts +15 -2
- package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts +2 -0
- package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts.map +1 -0
- package/dist/src/utils/graphql/answerService/answerService.d.ts +10 -0
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/sessionInfoService.d.ts +66 -0
- package/dist/src/utils/sessionInfoService.d.ts.map +1 -0
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +225 -105
- package/dist/tsembed-react.js +225 -104
- package/dist/tsembed.es.js +233 -116
- package/dist/tsembed.js +233 -116
- package/dist/visual-embed-sdk-react-full.d.ts +171 -66
- package/dist/visual-embed-sdk-react.d.ts +171 -66
- package/dist/visual-embed-sdk.d.ts +171 -66
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +14 -17
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +44 -56
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.d.ts +12 -0
- package/lib/src/auth.spec.d.ts.map +1 -1
- package/lib/src/auth.spec.js +88 -66
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.d.ts +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +18 -5
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.d.ts +2 -0
- package/lib/src/authToken.spec.d.ts.map +1 -0
- package/lib/src/authToken.spec.js +26 -0
- package/lib/src/authToken.spec.js.map +1 -0
- package/lib/src/embed/app.spec.js +4 -2
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +3 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +1 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/embed.spec.js +2 -0
- package/lib/src/embed/embed.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +2 -0
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +2 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +2 -0
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/sage.spec.js +2 -0
- package/lib/src/embed/sage.spec.js.map +1 -1
- package/lib/src/embed/search.spec.js +1 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed-trigger.spec.js +2 -0
- package/lib/src/embed/ts-embed-trigger.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +7 -0
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +7 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +2 -1
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +1 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +7 -0
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +1 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +6 -0
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +79 -47
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +61 -46
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/authService.d.ts +1 -0
- package/lib/src/utils/authService/authService.d.ts.map +1 -1
- package/lib/src/utils/authService/authService.js +1 -0
- package/lib/src/utils/authService/authService.js.map +1 -1
- package/lib/src/utils/authService/authService.spec.js +18 -5
- package/lib/src/utils/authService/authService.spec.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.d.ts +15 -2
- package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.js +37 -8
- package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts +2 -0
- package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts.map +1 -0
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +29 -0
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -0
- package/lib/src/utils/graphql/answerService/answerService.d.ts +10 -0
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +10 -0
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/processData.js +3 -3
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +3 -2
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils/sessionInfoService.d.ts +66 -0
- package/lib/src/utils/sessionInfoService.d.ts.map +1 -0
- package/lib/src/utils/sessionInfoService.js +85 -0
- package/lib/src/utils/sessionInfoService.js.map +1 -0
- package/lib/src/utils.d.ts +1 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +4 -1
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +176 -67
- package/package.json +1 -1
- package/src/auth.spec.ts +92 -72
- package/src/auth.ts +46 -68
- package/src/authToken.spec.ts +31 -0
- package/src/authToken.ts +17 -5
- package/src/embed/app.spec.ts +4 -2
- package/src/embed/base.spec.ts +1 -0
- package/src/embed/base.ts +3 -0
- package/src/embed/embed.spec.ts +2 -0
- package/src/embed/events.spec.ts +2 -0
- package/src/embed/liveboard.spec.ts +2 -0
- package/src/embed/pinboard.spec.ts +2 -0
- package/src/embed/sage.spec.ts +3 -0
- package/src/embed/search.spec.ts +1 -0
- package/src/embed/ts-embed-trigger.spec.ts +3 -0
- package/src/embed/ts-embed.spec.ts +8 -0
- package/src/embed/ts-embed.ts +7 -0
- package/src/index.ts +2 -1
- package/src/mixpanel-service.spec.ts +12 -3
- package/src/mixpanel-service.ts +3 -1
- package/src/react/index.spec.tsx +7 -0
- package/src/react/index.tsx +1 -0
- package/src/types.ts +80 -47
- package/src/utils/authService/authService.spec.ts +18 -5
- package/src/utils/authService/authService.ts +1 -0
- package/src/utils/authService/tokenizedAuthService.spec.ts +36 -0
- package/src/utils/authService/tokenizedAuthService.ts +38 -8
- package/src/utils/graphql/answerService/answerService.ts +10 -0
- package/src/utils/processData.spec.ts +3 -2
- package/src/utils/processData.ts +3 -3
- package/src/utils/sessionInfoService.ts +101 -0
- package/src/utils.ts +7 -2
package/dist/tsembed.js
CHANGED
|
@@ -342,6 +342,8 @@
|
|
|
342
342
|
/**
|
|
343
343
|
* Authentication has either succeeded or failed.
|
|
344
344
|
*
|
|
345
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
346
|
+
*
|
|
345
347
|
* @example
|
|
346
348
|
*```js
|
|
347
349
|
* appEmbed.on(EmbedEvent.AuthInit, payload => {
|
|
@@ -355,6 +357,8 @@
|
|
|
355
357
|
* The embed object container has loaded.
|
|
356
358
|
*
|
|
357
359
|
* @returns timestamp - The timestamp when the event was generated.
|
|
360
|
+
*
|
|
361
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
358
362
|
* @example
|
|
359
363
|
*```js
|
|
360
364
|
* liveboardEmbed.on(EmbedEvent.Load, hideLoader)
|
|
@@ -369,6 +373,8 @@
|
|
|
369
373
|
* Data pertaining to answer or Liveboard is received
|
|
370
374
|
*
|
|
371
375
|
* @return data - The answer or Liveboard data
|
|
376
|
+
*
|
|
377
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
372
378
|
* @example
|
|
373
379
|
*```js
|
|
374
380
|
* liveboardEmbed.on(EmbedEvent.Data, payload => {
|
|
@@ -387,6 +393,7 @@
|
|
|
387
393
|
/**
|
|
388
394
|
* Search query has been updated by the user.
|
|
389
395
|
*
|
|
396
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
390
397
|
* @example
|
|
391
398
|
*```js
|
|
392
399
|
* searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
|
|
@@ -396,12 +403,14 @@
|
|
|
396
403
|
/**
|
|
397
404
|
* A drill-down operation has been performed.
|
|
398
405
|
*
|
|
406
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
407
|
+
*
|
|
399
408
|
* @returns additionalFilters - Any additional filters applied
|
|
400
409
|
* @returns drillDownColumns - The columns on which drill down was performed
|
|
401
410
|
* @returns nonFilteredColumns - The columns that were not filtered
|
|
402
411
|
* @example
|
|
403
412
|
*```js
|
|
404
|
-
* searchEmbed.
|
|
413
|
+
* searchEmbed.on(EmbedEvent.DrillDown, {
|
|
405
414
|
* points: {
|
|
406
415
|
* clickedPoint,
|
|
407
416
|
* selectedPoints: selectedPoint
|
|
@@ -434,6 +443,8 @@
|
|
|
434
443
|
* One or more data sources have been selected.
|
|
435
444
|
*
|
|
436
445
|
* @returns dataSourceIds - the list of data sources
|
|
446
|
+
*
|
|
447
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
437
448
|
* @example
|
|
438
449
|
* ```js
|
|
439
450
|
* searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
|
|
@@ -461,6 +472,8 @@
|
|
|
461
472
|
* @returns actionId - ID of the custom action
|
|
462
473
|
* @returns payload {@link CustomActionPayload} - Response payload with the
|
|
463
474
|
* Answer or Liveboard data
|
|
475
|
+
*
|
|
476
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
464
477
|
* @example
|
|
465
478
|
* ```js
|
|
466
479
|
* appEmbed.on(EmbedEvent.customAction, payload => {
|
|
@@ -508,21 +521,18 @@
|
|
|
508
521
|
/**
|
|
509
522
|
* An error has occurred. This event is fired for the following error types:
|
|
510
523
|
*
|
|
511
|
-
* API - API call failure error.
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
524
|
+
* `API` - API call failure error.
|
|
525
|
+
* `FULLSCREEN` - Error when presenting a Liveboard or visualization in full screen mode.
|
|
526
|
+
* `SINGLE_VALUE_FILTER` - Error due to multiple values in the single value filter.
|
|
527
|
+
* `NON_EXIST_FILTER` - Error due to a non-existent filter.
|
|
528
|
+
* `INVALID_DATE_VALUE` - Invalid date value error.
|
|
529
|
+
* `INVALID_OPERATOR` - Use of invalid operator during filter application.
|
|
516
530
|
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
* INVALID_DATE_VALUE - Invalid date value error.
|
|
520
|
-
*
|
|
521
|
-
* INVALID_OPERATOR - Use of invalid operator during filter application.
|
|
522
|
-
*
|
|
523
|
-
* For more information, see [Developer Documentation](https://developers.thoughtspot.com/docs/events-app-integration#errorType)
|
|
531
|
+
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
|
|
524
532
|
*
|
|
525
533
|
* @returns error - An error object or message
|
|
534
|
+
*
|
|
535
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
526
536
|
* @example
|
|
527
537
|
* ```js
|
|
528
538
|
* // API error
|
|
@@ -548,6 +558,9 @@
|
|
|
548
558
|
* The embedded object has sent an alert.
|
|
549
559
|
*
|
|
550
560
|
* @returns alert - An alert object
|
|
561
|
+
*
|
|
562
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
563
|
+
*
|
|
551
564
|
* @example
|
|
552
565
|
* ```js
|
|
553
566
|
* searchEmbed.on(EmbedEvent.Alert)
|
|
@@ -557,6 +570,8 @@
|
|
|
557
570
|
/**
|
|
558
571
|
* The ThoughtSpot auth session has expired.
|
|
559
572
|
*
|
|
573
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
574
|
+
*
|
|
560
575
|
* @example
|
|
561
576
|
*```js
|
|
562
577
|
* appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
|
|
@@ -610,6 +625,7 @@
|
|
|
610
625
|
/**
|
|
611
626
|
* Detects the route change.
|
|
612
627
|
*
|
|
628
|
+
* @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
|
|
613
629
|
* @example
|
|
614
630
|
*```js
|
|
615
631
|
* searchEmbed.on(EmbedEvent.RouteChange, payload =>
|
|
@@ -690,8 +706,7 @@
|
|
|
690
706
|
*/
|
|
691
707
|
EmbedEvent["LiveboardRendered"] = "PinboardRendered";
|
|
692
708
|
/**
|
|
693
|
-
*
|
|
694
|
-
* is triggered on all events.
|
|
709
|
+
* Emits all events.
|
|
695
710
|
*
|
|
696
711
|
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
697
712
|
* @example
|
|
@@ -708,13 +723,13 @@
|
|
|
708
723
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
709
724
|
* @example
|
|
710
725
|
*```js
|
|
711
|
-
* //
|
|
726
|
+
* //Emit when action starts
|
|
712
727
|
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
713
728
|
* console.log('Save', payload)
|
|
714
729
|
* }, {
|
|
715
730
|
* start: true
|
|
716
731
|
* })
|
|
717
|
-
* //
|
|
732
|
+
* //emit when action ends
|
|
718
733
|
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
719
734
|
* console.log('Save', payload)
|
|
720
735
|
* })
|
|
@@ -732,7 +747,7 @@
|
|
|
732
747
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
733
748
|
* @example
|
|
734
749
|
*```js
|
|
735
|
-
* liveboardEmbed.
|
|
750
|
+
* liveboardEmbed.on(EmbedEvent.Download, {
|
|
736
751
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
737
752
|
* })
|
|
738
753
|
*```
|
|
@@ -744,10 +759,10 @@
|
|
|
744
759
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
745
760
|
* @example
|
|
746
761
|
*```js
|
|
747
|
-
* //
|
|
762
|
+
* //emit when action starts
|
|
748
763
|
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
749
764
|
* console.log('download PNG', payload)}, {start: true })
|
|
750
|
-
* //
|
|
765
|
+
* //emit when action ends
|
|
751
766
|
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
752
767
|
* console.log('download PNG', payload)})
|
|
753
768
|
*```
|
|
@@ -759,10 +774,10 @@
|
|
|
759
774
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
760
775
|
* @example
|
|
761
776
|
*```js
|
|
762
|
-
* //
|
|
777
|
+
* //emit when action starts
|
|
763
778
|
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
764
779
|
* console.log('download PDF', payload)}, {start: true })
|
|
765
|
-
* //
|
|
780
|
+
* //emit when action ends
|
|
766
781
|
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
767
782
|
* console.log('download PDF', payload)})
|
|
768
783
|
*```
|
|
@@ -774,10 +789,10 @@
|
|
|
774
789
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
775
790
|
* @example
|
|
776
791
|
*```js
|
|
777
|
-
* //
|
|
792
|
+
* //emit when action starts
|
|
778
793
|
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
779
794
|
* console.log('download CSV', payload)}, {start: true })
|
|
780
|
-
* //
|
|
795
|
+
* //emit when action ends
|
|
781
796
|
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
782
797
|
* console.log('download CSV', payload)})
|
|
783
798
|
*```
|
|
@@ -789,10 +804,10 @@
|
|
|
789
804
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
790
805
|
* @example
|
|
791
806
|
*```js
|
|
792
|
-
* //
|
|
807
|
+
* //emit when action starts
|
|
793
808
|
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
794
809
|
* console.log('download Xlsx', payload)}, { start: true })
|
|
795
|
-
* //
|
|
810
|
+
* //emit when action ends
|
|
796
811
|
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
797
812
|
* console.log('download Xlsx', payload)})
|
|
798
813
|
*```
|
|
@@ -804,7 +819,7 @@
|
|
|
804
819
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
805
820
|
* @example
|
|
806
821
|
*```js
|
|
807
|
-
* //
|
|
822
|
+
* //emit when action starts
|
|
808
823
|
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
809
824
|
* console.log('delete answer', payload)}, {start: true })
|
|
810
825
|
* //trigger when action is completed
|
|
@@ -819,13 +834,13 @@
|
|
|
819
834
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
820
835
|
* @example
|
|
821
836
|
*```js
|
|
822
|
-
* //
|
|
837
|
+
* //emit when action starts
|
|
823
838
|
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
824
839
|
* console.log('pin', payload)
|
|
825
840
|
* }, {
|
|
826
841
|
* start: true
|
|
827
842
|
* })
|
|
828
|
-
* //
|
|
843
|
+
* //emit when action ends
|
|
829
844
|
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
830
845
|
* console.log('pin', payload)
|
|
831
846
|
* })
|
|
@@ -838,13 +853,13 @@
|
|
|
838
853
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
839
854
|
* @example
|
|
840
855
|
*```js
|
|
841
|
-
* //
|
|
856
|
+
* //emit when action starts
|
|
842
857
|
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
843
858
|
* console.log('SpotIQAnalyze', payload)
|
|
844
859
|
* }, {
|
|
845
860
|
* start: true
|
|
846
861
|
* })
|
|
847
|
-
* //
|
|
862
|
+
* //emit when action ends
|
|
848
863
|
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
849
864
|
* console.log('SpotIQ analyze', payload)
|
|
850
865
|
* })
|
|
@@ -857,13 +872,13 @@
|
|
|
857
872
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
858
873
|
* @example
|
|
859
874
|
*```js
|
|
860
|
-
* //
|
|
875
|
+
* //emit when action starts
|
|
861
876
|
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
862
877
|
* console.log('Share', payload)
|
|
863
878
|
* }, {
|
|
864
879
|
* start: true
|
|
865
880
|
* })
|
|
866
|
-
* //
|
|
881
|
+
* //emit when action ends
|
|
867
882
|
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
868
883
|
* console.log('Share', payload)
|
|
869
884
|
* })
|
|
@@ -938,10 +953,10 @@
|
|
|
938
953
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
939
954
|
* @example
|
|
940
955
|
*```js
|
|
941
|
-
* //
|
|
956
|
+
* //emit when action starts
|
|
942
957
|
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
943
958
|
* console.log('Export TML', payload)}, { start: true })
|
|
944
|
-
* //
|
|
959
|
+
* //emit when action ends
|
|
945
960
|
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
946
961
|
* console.log('Export TML', payload)})
|
|
947
962
|
*```
|
|
@@ -965,10 +980,10 @@
|
|
|
965
980
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
966
981
|
* @example
|
|
967
982
|
*```js
|
|
968
|
-
* //
|
|
983
|
+
* //emit when action starts
|
|
969
984
|
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
970
985
|
* console.log('Copy and edit', payload)}, {start: true })
|
|
971
|
-
* //
|
|
986
|
+
* //emit when action ends
|
|
972
987
|
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
973
988
|
* console.log('Copy and edit', payload)})
|
|
974
989
|
*```
|
|
@@ -1070,7 +1085,7 @@
|
|
|
1070
1085
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1071
1086
|
* @example
|
|
1072
1087
|
*```js
|
|
1073
|
-
* liveboardEmbed.
|
|
1088
|
+
* liveboardEmbed.on(EmbedEvent.Present)
|
|
1074
1089
|
*```
|
|
1075
1090
|
* @example
|
|
1076
1091
|
*```js
|
|
@@ -1086,7 +1101,7 @@
|
|
|
1086
1101
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1087
1102
|
* @example
|
|
1088
1103
|
*```js
|
|
1089
|
-
* liveboardEmbed.
|
|
1104
|
+
* liveboardEmbed.on(EmbedEvent.Delete,
|
|
1090
1105
|
* {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1091
1106
|
*```
|
|
1092
1107
|
*/
|
|
@@ -1097,7 +1112,7 @@
|
|
|
1097
1112
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1098
1113
|
* @example
|
|
1099
1114
|
*```js
|
|
1100
|
-
* liveboardEmbed.
|
|
1115
|
+
* liveboardEmbed.on(EmbedEvent.SchedulesList)
|
|
1101
1116
|
*```
|
|
1102
1117
|
*/
|
|
1103
1118
|
EmbedEvent["SchedulesList"] = "schedule-list";
|
|
@@ -1107,7 +1122,7 @@
|
|
|
1107
1122
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1108
1123
|
* @example
|
|
1109
1124
|
*```js
|
|
1110
|
-
* liveboardEmbed.
|
|
1125
|
+
* liveboardEmbed.on(EmbedEvent.Cancel)
|
|
1111
1126
|
*```
|
|
1112
1127
|
*/
|
|
1113
1128
|
EmbedEvent["Cancel"] = "cancel";
|
|
@@ -1117,7 +1132,7 @@
|
|
|
1117
1132
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1118
1133
|
* @example
|
|
1119
1134
|
*```js
|
|
1120
|
-
* liveboardEmbed.
|
|
1135
|
+
* liveboardEmbed.on(EmbedEvent.Explore, {
|
|
1121
1136
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1122
1137
|
*```
|
|
1123
1138
|
*/
|
|
@@ -1128,7 +1143,7 @@
|
|
|
1128
1143
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1129
1144
|
* @example
|
|
1130
1145
|
*```js
|
|
1131
|
-
* liveboardEmbed.
|
|
1146
|
+
* liveboardEmbed.on(EmbedEvent.CopyLink, {
|
|
1132
1147
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1133
1148
|
*```
|
|
1134
1149
|
*/
|
|
@@ -1484,7 +1499,7 @@
|
|
|
1484
1499
|
*
|
|
1485
1500
|
* @example
|
|
1486
1501
|
* ```js
|
|
1487
|
-
* liveboardEmbed.trigger(HostEvent.
|
|
1502
|
+
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
1488
1503
|
* data=>console.log(data))
|
|
1489
1504
|
* ```
|
|
1490
1505
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
|
|
@@ -1948,7 +1963,7 @@
|
|
|
1948
1963
|
*
|
|
1949
1964
|
* ```js
|
|
1950
1965
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
1951
|
-
* filter: { column: 'column name', oper: 'IN', values: [1,2,3]
|
|
1966
|
+
* filter: { column: 'column name', oper: 'IN', values: [1,2,3]}
|
|
1952
1967
|
* })
|
|
1953
1968
|
* ```
|
|
1954
1969
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
@@ -3070,7 +3085,7 @@
|
|
|
3070
3085
|
* disabledActions: [Action.TML] // to disable all TML actions
|
|
3071
3086
|
* ```
|
|
3072
3087
|
*
|
|
3073
|
-
* @version SDK : 1.28.
|
|
3088
|
+
* @version SDK : 1.28.3 | Thoughtspot: 9.12.0.cl
|
|
3074
3089
|
*/
|
|
3075
3090
|
Action["TML"] = "tml";
|
|
3076
3091
|
/**
|
|
@@ -3362,7 +3377,10 @@
|
|
|
3362
3377
|
const filterExpr = [];
|
|
3363
3378
|
filterExpr.push(`col${index}=${encodeURIComponent(filter.columnName)}`);
|
|
3364
3379
|
filterExpr.push(`op${index}=${filter.operator}`);
|
|
3365
|
-
filterExpr.push(filter.values.map((value) =>
|
|
3380
|
+
filterExpr.push(filter.values.map((value) => {
|
|
3381
|
+
const encodedValue = typeof value === 'bigint' ? value.toString() : value;
|
|
3382
|
+
return `val${index}=${encodeURIComponent(String(encodedValue))}`;
|
|
3383
|
+
}).join('&'));
|
|
3366
3384
|
return filterExpr.join('&');
|
|
3367
3385
|
});
|
|
3368
3386
|
return `${filters.join('&')}`;
|
|
@@ -5809,6 +5827,7 @@
|
|
|
5809
5827
|
|
|
5810
5828
|
const EndPoints = {
|
|
5811
5829
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
5830
|
+
SESSION_INFO: '/callosum/v1/session/info',
|
|
5812
5831
|
SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
|
|
5813
5832
|
OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
|
|
5814
5833
|
TOKEN_LOGIN: '/callosum/v1/session/login/token',
|
|
@@ -5925,8 +5944,10 @@
|
|
|
5925
5944
|
const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authToken endpoint.';
|
|
5926
5945
|
let cachedAuthToken = null;
|
|
5927
5946
|
// This method can be used to get the authToken using the embedConfig
|
|
5928
|
-
|
|
5929
|
-
if
|
|
5947
|
+
async function getAuthenticationToken(embedConfig) {
|
|
5948
|
+
// Since we don't have token validation enabled , we cannot tell if the
|
|
5949
|
+
// cached token is valid or not. So we will always fetch a new token.
|
|
5950
|
+
if (cachedAuthToken && !embedConfig.disableTokenVerification) {
|
|
5930
5951
|
let isCachedTokenStillValid;
|
|
5931
5952
|
try {
|
|
5932
5953
|
isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
@@ -5946,12 +5967,22 @@
|
|
|
5946
5967
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
5947
5968
|
authToken = await response.text();
|
|
5948
5969
|
}
|
|
5949
|
-
|
|
5950
|
-
|
|
5970
|
+
try {
|
|
5971
|
+
// this will throw error if the token is not valid
|
|
5972
|
+
await validateAuthToken(embedConfig, authToken);
|
|
5973
|
+
}
|
|
5974
|
+
catch (e) {
|
|
5975
|
+
logger.error(`Received invalid token from getAuthToken callback or authToken endpoint. Error : ${e.message}`);
|
|
5976
|
+
throw e;
|
|
5977
|
+
}
|
|
5951
5978
|
cachedAuthToken = authToken;
|
|
5952
5979
|
return authToken;
|
|
5953
|
-
}
|
|
5980
|
+
}
|
|
5954
5981
|
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
5982
|
+
if (embedConfig.disableTokenVerification) {
|
|
5983
|
+
logger.info('Token verification is disabled. Assuming token is valid.');
|
|
5984
|
+
return true;
|
|
5985
|
+
}
|
|
5955
5986
|
try {
|
|
5956
5987
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
5957
5988
|
if (isTokenValid)
|
|
@@ -6228,6 +6259,16 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
6228
6259
|
* const data = await underlying.fetchData(0, 100);
|
|
6229
6260
|
* })
|
|
6230
6261
|
* ```
|
|
6262
|
+
* @example
|
|
6263
|
+
* ```js
|
|
6264
|
+
* embed.on(EmbedEvent.Data, async (e) => {
|
|
6265
|
+
* const service = await embed.getAnswerService();
|
|
6266
|
+
* await service.addColumns([
|
|
6267
|
+
* "<column guid>"
|
|
6268
|
+
* ]);
|
|
6269
|
+
* console.log(await service.fetchData());
|
|
6270
|
+
* });
|
|
6271
|
+
* ```
|
|
6231
6272
|
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
6232
6273
|
* @group Events
|
|
6233
6274
|
*/
|
|
@@ -12568,6 +12609,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
12568
12609
|
function initMixpanel(sessionInfo) {
|
|
12569
12610
|
var _a;
|
|
12570
12611
|
if (!sessionInfo || !sessionInfo.mixpanelToken) {
|
|
12612
|
+
logger.error('Mixpanel token not found in session info');
|
|
12571
12613
|
return;
|
|
12572
12614
|
}
|
|
12573
12615
|
// On a public cluster the user is anonymous, so don't set the identify to
|
|
@@ -13162,49 +13204,124 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13162
13204
|
* @param url
|
|
13163
13205
|
* @param options
|
|
13164
13206
|
*/
|
|
13165
|
-
function
|
|
13207
|
+
function tokenizedFailureLoggedFetch(url, options = {}) {
|
|
13166
13208
|
return tokenizedFetch(url, options).then(async (r) => {
|
|
13167
13209
|
var _a;
|
|
13168
13210
|
if (!r.ok && r.type !== 'opaqueredirect' && r.type !== 'opaque') {
|
|
13169
|
-
logger.error(
|
|
13211
|
+
logger.error(`Failed to fetch ${url}`, await ((_a = r.text) === null || _a === void 0 ? void 0 : _a.call(r)));
|
|
13170
13212
|
}
|
|
13171
13213
|
return r;
|
|
13172
13214
|
});
|
|
13173
13215
|
}
|
|
13174
13216
|
/**
|
|
13217
|
+
* Fetches the session info from the ThoughtSpot server.
|
|
13175
13218
|
*
|
|
13176
|
-
* @param
|
|
13219
|
+
* @param thoughtspotHost
|
|
13220
|
+
* @returns {Promise<any>}
|
|
13221
|
+
* @example
|
|
13222
|
+
* ```js
|
|
13223
|
+
* const response = await sessionInfoService();
|
|
13224
|
+
* ```
|
|
13177
13225
|
*/
|
|
13178
|
-
function fetchSessionInfoService(
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13226
|
+
async function fetchSessionInfoService(thoughtspotHost) {
|
|
13227
|
+
const sessionInfoPath = `${thoughtspotHost}${EndPoints.SESSION_INFO}`;
|
|
13228
|
+
const response = await tokenizedFailureLoggedFetch(sessionInfoPath);
|
|
13229
|
+
if (!response.ok) {
|
|
13230
|
+
throw new Error(`Failed to fetch session info: ${response.statusText}`);
|
|
13231
|
+
}
|
|
13232
|
+
const data = await response.json();
|
|
13233
|
+
return data;
|
|
13182
13234
|
}
|
|
13183
13235
|
/**
|
|
13184
13236
|
*
|
|
13185
13237
|
* @param thoughtSpotHost
|
|
13186
13238
|
*/
|
|
13187
13239
|
async function fetchLogoutService(thoughtSpotHost) {
|
|
13188
|
-
return
|
|
13240
|
+
return tokenizedFailureLoggedFetch(`${thoughtSpotHost}${EndPoints.LOGOUT}`, {
|
|
13189
13241
|
credentials: 'include',
|
|
13190
13242
|
method: 'POST',
|
|
13191
13243
|
headers: {
|
|
13192
13244
|
'x-requested-by': 'ThoughtSpot',
|
|
13193
13245
|
},
|
|
13194
13246
|
});
|
|
13247
|
+
}
|
|
13248
|
+
/**
|
|
13249
|
+
* Is active service to check if the user is logged in.
|
|
13250
|
+
*
|
|
13251
|
+
* @param thoughtSpotHost
|
|
13252
|
+
* @version SDK: 1.28.4 | ThoughtSpot: *
|
|
13253
|
+
*/
|
|
13254
|
+
async function isActiveService(thoughtSpotHost) {
|
|
13255
|
+
const isActiveUrl = `${thoughtSpotHost}${EndPoints.IS_ACTIVE}`;
|
|
13256
|
+
try {
|
|
13257
|
+
const res = await tokenizedFetch(isActiveUrl, {
|
|
13258
|
+
credentials: 'include',
|
|
13259
|
+
});
|
|
13260
|
+
return res.ok;
|
|
13261
|
+
}
|
|
13262
|
+
catch (e) {
|
|
13263
|
+
logger.warn(`Is Logged In Service failed : ${e.message}`);
|
|
13264
|
+
}
|
|
13265
|
+
return false;
|
|
13195
13266
|
}
|
|
13196
13267
|
|
|
13268
|
+
let sessionInfo = null;
|
|
13269
|
+
/**
|
|
13270
|
+
* Returns the session info object and caches it for future use.
|
|
13271
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
13272
|
+
* subsequent calls.
|
|
13273
|
+
*
|
|
13274
|
+
* @example ```js
|
|
13275
|
+
* const sessionInfo = await getSessionInfo();
|
|
13276
|
+
* console.log(sessionInfo);
|
|
13277
|
+
* ```
|
|
13278
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
13279
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
13280
|
+
*/
|
|
13281
|
+
async function getSessionInfo() {
|
|
13282
|
+
if (!sessionInfo) {
|
|
13283
|
+
const host = getEmbedConfig().thoughtSpotHost;
|
|
13284
|
+
const sessionResponse = await fetchSessionInfoService(host);
|
|
13285
|
+
const processedSessionInfo = getSessionDetails(sessionResponse);
|
|
13286
|
+
sessionInfo = processedSessionInfo;
|
|
13287
|
+
}
|
|
13288
|
+
return sessionInfo;
|
|
13289
|
+
}
|
|
13290
|
+
/**
|
|
13291
|
+
* Processes the session info response and returns the session info object.
|
|
13292
|
+
*
|
|
13293
|
+
* @param sessionInfoResp {any} Response from the session info API.
|
|
13294
|
+
* @returns {SessionInfo} The session info object.
|
|
13295
|
+
* @example ```js
|
|
13296
|
+
* const sessionInfoResp = await fetch(sessionInfoPath);
|
|
13297
|
+
* const sessionInfo = getSessionDetails(sessionInfoResp);
|
|
13298
|
+
* console.log(sessionInfo);
|
|
13299
|
+
* ```
|
|
13300
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
13301
|
+
*/
|
|
13302
|
+
const getSessionDetails = (sessionInfoResp) => {
|
|
13303
|
+
const devMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.devSdkKey;
|
|
13304
|
+
const prodMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.prodSdkKey;
|
|
13305
|
+
const mixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.production
|
|
13306
|
+
? prodMixpanelToken
|
|
13307
|
+
: devMixpanelToken;
|
|
13308
|
+
return {
|
|
13309
|
+
userGUID: sessionInfoResp.userGUID,
|
|
13310
|
+
mixpanelToken,
|
|
13311
|
+
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
13312
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
13313
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
13314
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
13315
|
+
...sessionInfoResp,
|
|
13316
|
+
};
|
|
13317
|
+
};
|
|
13318
|
+
|
|
13197
13319
|
// eslint-disable-next-line import/no-mutable-exports
|
|
13198
13320
|
let loggedInStatus = false;
|
|
13199
13321
|
// eslint-disable-next-line import/no-mutable-exports
|
|
13200
13322
|
let samlAuthWindow = null;
|
|
13201
13323
|
// eslint-disable-next-line import/no-mutable-exports
|
|
13202
13324
|
let samlCompletionPromise = null;
|
|
13203
|
-
let sessionInfo = null;
|
|
13204
|
-
let sessionInfoResolver = null;
|
|
13205
|
-
const sessionInfoPromise = new Promise((resolve) => {
|
|
13206
|
-
sessionInfoResolver = resolve;
|
|
13207
|
-
});
|
|
13208
13325
|
let releaseVersion = '';
|
|
13209
13326
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
13210
13327
|
(function (AuthFailureType) {
|
|
@@ -13267,12 +13384,18 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13267
13384
|
/**
|
|
13268
13385
|
*
|
|
13269
13386
|
*/
|
|
13270
|
-
function notifyAuthSuccess() {
|
|
13387
|
+
async function notifyAuthSuccess() {
|
|
13271
13388
|
if (!authEE) {
|
|
13272
13389
|
logger.error('SDK not initialized');
|
|
13273
13390
|
return;
|
|
13274
13391
|
}
|
|
13275
|
-
|
|
13392
|
+
try {
|
|
13393
|
+
const sessionInfo = await getSessionInfo();
|
|
13394
|
+
authEE.emit(exports.AuthStatus.SUCCESS, sessionInfo);
|
|
13395
|
+
}
|
|
13396
|
+
catch (e) {
|
|
13397
|
+
logger.error('Failed to get session info');
|
|
13398
|
+
}
|
|
13276
13399
|
}
|
|
13277
13400
|
/**
|
|
13278
13401
|
*
|
|
@@ -13295,67 +13418,45 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13295
13418
|
}
|
|
13296
13419
|
authEE.emit(exports.AuthStatus.LOGOUT);
|
|
13297
13420
|
}
|
|
13298
|
-
const initSession = (sessionDetails) => {
|
|
13299
|
-
const embedConfig = getEmbedConfig();
|
|
13300
|
-
if (sessionInfo == null) {
|
|
13301
|
-
sessionInfo = sessionDetails;
|
|
13302
|
-
if (!embedConfig.disableSDKTracking) {
|
|
13303
|
-
initMixpanel(sessionInfo);
|
|
13304
|
-
}
|
|
13305
|
-
sessionInfoResolver(sessionInfo);
|
|
13306
|
-
}
|
|
13307
|
-
};
|
|
13308
|
-
const getSessionDetails = (sessionInfoResp) => {
|
|
13309
|
-
const devMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.devSdkKey;
|
|
13310
|
-
const prodMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.prodSdkKey;
|
|
13311
|
-
const mixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.production
|
|
13312
|
-
? prodMixpanelToken
|
|
13313
|
-
: devMixpanelToken;
|
|
13314
|
-
return {
|
|
13315
|
-
userGUID: sessionInfoResp.userGUID,
|
|
13316
|
-
mixpanelToken,
|
|
13317
|
-
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
13318
|
-
releaseVersion: sessionInfoResp.releaseVersion,
|
|
13319
|
-
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
13320
|
-
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
13321
|
-
...sessionInfoResp,
|
|
13322
|
-
};
|
|
13323
|
-
};
|
|
13324
13421
|
/**
|
|
13325
13422
|
* Check if we are logged into the ThoughtSpot cluster
|
|
13326
13423
|
*
|
|
13327
13424
|
* @param thoughtSpotHost The ThoughtSpot cluster hostname or IP
|
|
13328
13425
|
*/
|
|
13329
13426
|
async function isLoggedIn(thoughtSpotHost) {
|
|
13330
|
-
const authVerificationUrl = `${thoughtSpotHost}${EndPoints.AUTH_VERIFICATION}`;
|
|
13331
|
-
let response = null;
|
|
13332
13427
|
try {
|
|
13333
|
-
response = await
|
|
13334
|
-
|
|
13335
|
-
const sessionDetails = getSessionDetails(sessionInfoResp);
|
|
13336
|
-
// Store user session details from session info
|
|
13337
|
-
initSession(sessionDetails);
|
|
13338
|
-
releaseVersion = sessionInfoResp.releaseVersion;
|
|
13428
|
+
const response = await isActiveService(thoughtSpotHost);
|
|
13429
|
+
return response;
|
|
13339
13430
|
}
|
|
13340
13431
|
catch (e) {
|
|
13341
13432
|
return false;
|
|
13342
13433
|
}
|
|
13343
|
-
return response.status === 200;
|
|
13344
13434
|
}
|
|
13345
13435
|
/**
|
|
13346
|
-
*
|
|
13436
|
+
* Services to be called after the login is successful,
|
|
13437
|
+
* This should be called after the cookie is set for cookie auth or
|
|
13438
|
+
* after the token is set for cookieless.
|
|
13439
|
+
*
|
|
13440
|
+
* @return {Promise<void>}
|
|
13441
|
+
* @example
|
|
13442
|
+
* ```js
|
|
13443
|
+
* await postLoginService();
|
|
13444
|
+
* ```
|
|
13445
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
13347
13446
|
*/
|
|
13348
|
-
function
|
|
13349
|
-
|
|
13447
|
+
async function postLoginService() {
|
|
13448
|
+
const sessionInfo = await getSessionInfo();
|
|
13449
|
+
releaseVersion = sessionInfo.releaseVersion;
|
|
13450
|
+
const embedConfig = getEmbedConfig();
|
|
13451
|
+
if (!embedConfig.disableSDKTracking) {
|
|
13452
|
+
initMixpanel(sessionInfo);
|
|
13453
|
+
}
|
|
13350
13454
|
}
|
|
13351
13455
|
/**
|
|
13352
|
-
* Return
|
|
13353
|
-
* authentication is successful. And info is available.
|
|
13354
|
-
*
|
|
13355
|
-
* @group Global methods
|
|
13456
|
+
* Return releaseVersion if available
|
|
13356
13457
|
*/
|
|
13357
|
-
function
|
|
13358
|
-
return
|
|
13458
|
+
function getReleaseVersion() {
|
|
13459
|
+
return releaseVersion;
|
|
13359
13460
|
}
|
|
13360
13461
|
/**
|
|
13361
13462
|
* Check if we are stuck at the SSO redirect URL
|
|
@@ -13386,7 +13487,14 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13386
13487
|
}
|
|
13387
13488
|
loggedInStatus = await isLoggedIn(thoughtSpotHost);
|
|
13388
13489
|
if (!loggedInStatus) {
|
|
13389
|
-
|
|
13490
|
+
let authToken;
|
|
13491
|
+
try {
|
|
13492
|
+
authToken = await getAuthenticationToken(embedConfig);
|
|
13493
|
+
}
|
|
13494
|
+
catch (e) {
|
|
13495
|
+
loggedInStatus = false;
|
|
13496
|
+
throw e;
|
|
13497
|
+
}
|
|
13390
13498
|
let resp;
|
|
13391
13499
|
try {
|
|
13392
13500
|
resp = await fetchAuthPostService(thoughtSpotHost, username, authToken);
|
|
@@ -13544,7 +13652,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13544
13652
|
const { thoughtSpotHost } = embedConfig;
|
|
13545
13653
|
await fetchLogoutService(thoughtSpotHost);
|
|
13546
13654
|
resetCachedAuthToken();
|
|
13547
|
-
const thoughtspotIframes = document.querySelectorAll(
|
|
13655
|
+
const thoughtspotIframes = document.querySelectorAll("[data-ts-iframe='true']");
|
|
13548
13656
|
if (thoughtspotIframes === null || thoughtspotIframes === void 0 ? void 0 : thoughtspotIframes.length) {
|
|
13549
13657
|
thoughtspotIframes.forEach((el) => {
|
|
13550
13658
|
el.parentElement.innerHTML = embedConfig.loginFailedMessage;
|
|
@@ -13599,6 +13707,8 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13599
13707
|
notifyAuthFailure(exports.AuthFailureType.SDK);
|
|
13600
13708
|
}
|
|
13601
13709
|
else {
|
|
13710
|
+
// Post login service is called after successful login.
|
|
13711
|
+
postLoginService();
|
|
13602
13712
|
notifyAuthSDKSuccess();
|
|
13603
13713
|
}
|
|
13604
13714
|
}, () => {
|
|
@@ -13894,13 +14004,13 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
13894
14004
|
};
|
|
13895
14005
|
}
|
|
13896
14006
|
/**
|
|
14007
|
+
* Responds to AuthInit sent from host signifying successful authentication in host.
|
|
13897
14008
|
*
|
|
13898
14009
|
* @param e
|
|
14010
|
+
* @returns {any}
|
|
13899
14011
|
*/
|
|
13900
14012
|
function processAuthInit(e) {
|
|
13901
14013
|
var _a, _b;
|
|
13902
|
-
// Store user session details sent by app.
|
|
13903
|
-
initSession(e.data);
|
|
13904
14014
|
notifyAuthSuccess();
|
|
13905
14015
|
// Expose only allowed details (eg: userGUID) back to SDK users.
|
|
13906
14016
|
return {
|
|
@@ -14038,7 +14148,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
14038
14148
|
});
|
|
14039
14149
|
}
|
|
14040
14150
|
|
|
14041
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.29.0-alpha.
|
|
14151
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.29.0-alpha.SCAL-205893-1";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/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",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-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",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 --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","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",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","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","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@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","current-git-branch":"^1.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.13.1","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":"6.7.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",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-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","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","embedded","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,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"45 kB"}],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};
|
|
14042
14152
|
|
|
14043
14153
|
/**
|
|
14044
14154
|
* Copyright (c) 2022
|
|
@@ -14138,6 +14248,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
14138
14248
|
});
|
|
14139
14249
|
}
|
|
14140
14250
|
catch (e) {
|
|
14251
|
+
logger.error(`Received invalid token. Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
14141
14252
|
processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
14142
14253
|
}
|
|
14143
14254
|
}
|
|
@@ -14482,6 +14593,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
14482
14593
|
* @param url - The URL of the embedded ThoughtSpot app.
|
|
14483
14594
|
*/
|
|
14484
14595
|
async renderIFrame(url) {
|
|
14596
|
+
console.log('here 7');
|
|
14485
14597
|
if (this.isError) {
|
|
14486
14598
|
return null;
|
|
14487
14599
|
}
|
|
@@ -14489,8 +14601,10 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
14489
14601
|
this.throwInitError();
|
|
14490
14602
|
}
|
|
14491
14603
|
if (url.length > URL_MAX_LENGTH) ;
|
|
14604
|
+
console.log('here 8');
|
|
14492
14605
|
return renderInQueue((nextInQueue) => {
|
|
14493
14606
|
var _a;
|
|
14607
|
+
console.log('here 6');
|
|
14494
14608
|
const initTimestamp = Date.now();
|
|
14495
14609
|
this.executeCallbacks(exports.EmbedEvent.Init, {
|
|
14496
14610
|
data: {
|
|
@@ -14500,6 +14614,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
14500
14614
|
});
|
|
14501
14615
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
14502
14616
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
14617
|
+
console.log('here 9', isLoggedIn);
|
|
14503
14618
|
if (!isLoggedIn) {
|
|
14504
14619
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
14505
14620
|
return;
|
|
@@ -14523,7 +14638,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
|
|
|
14523
14638
|
this.iFrame.addEventListener('error', () => {
|
|
14524
14639
|
nextInQueue();
|
|
14525
14640
|
});
|
|
14641
|
+
console.log('here 10', this.iFrame);
|
|
14526
14642
|
this.handleInsertionIntoDOM(this.iFrame);
|
|
14643
|
+
console.log('here 11', document.body.innerHTML);
|
|
14527
14644
|
const prefetchIframe = document.querySelectorAll('.prefetchIframe');
|
|
14528
14645
|
if (prefetchIframe.length) {
|
|
14529
14646
|
prefetchIframe.forEach((el) => {
|