@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-react.es.js
CHANGED
|
@@ -179,7 +179,10 @@ const getFilterQuery = (runtimeFilters) => {
|
|
|
179
179
|
const filterExpr = [];
|
|
180
180
|
filterExpr.push(`col${index}=${encodeURIComponent(filter.columnName)}`);
|
|
181
181
|
filterExpr.push(`op${index}=${filter.operator}`);
|
|
182
|
-
filterExpr.push(filter.values.map((value) =>
|
|
182
|
+
filterExpr.push(filter.values.map((value) => {
|
|
183
|
+
const encodedValue = typeof value === 'bigint' ? value.toString() : value;
|
|
184
|
+
return `val${index}=${encodeURIComponent(String(encodedValue))}`;
|
|
185
|
+
}).join('&'));
|
|
183
186
|
return filterExpr.join('&');
|
|
184
187
|
});
|
|
185
188
|
return `${filters.join('&')}`;
|
|
@@ -770,6 +773,8 @@ var EmbedEvent;
|
|
|
770
773
|
/**
|
|
771
774
|
* Authentication has either succeeded or failed.
|
|
772
775
|
*
|
|
776
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
777
|
+
*
|
|
773
778
|
* @example
|
|
774
779
|
*```js
|
|
775
780
|
* appEmbed.on(EmbedEvent.AuthInit, payload => {
|
|
@@ -783,6 +788,8 @@ var EmbedEvent;
|
|
|
783
788
|
* The embed object container has loaded.
|
|
784
789
|
*
|
|
785
790
|
* @returns timestamp - The timestamp when the event was generated.
|
|
791
|
+
*
|
|
792
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
786
793
|
* @example
|
|
787
794
|
*```js
|
|
788
795
|
* liveboardEmbed.on(EmbedEvent.Load, hideLoader)
|
|
@@ -797,6 +804,8 @@ var EmbedEvent;
|
|
|
797
804
|
* Data pertaining to answer or Liveboard is received
|
|
798
805
|
*
|
|
799
806
|
* @return data - The answer or Liveboard data
|
|
807
|
+
*
|
|
808
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
800
809
|
* @example
|
|
801
810
|
*```js
|
|
802
811
|
* liveboardEmbed.on(EmbedEvent.Data, payload => {
|
|
@@ -815,6 +824,7 @@ var EmbedEvent;
|
|
|
815
824
|
/**
|
|
816
825
|
* Search query has been updated by the user.
|
|
817
826
|
*
|
|
827
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
818
828
|
* @example
|
|
819
829
|
*```js
|
|
820
830
|
* searchEmbed.on(EmbedEvent.QueryChanged, payload => console.log('data', payload))
|
|
@@ -824,12 +834,14 @@ var EmbedEvent;
|
|
|
824
834
|
/**
|
|
825
835
|
* A drill-down operation has been performed.
|
|
826
836
|
*
|
|
837
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
838
|
+
*
|
|
827
839
|
* @returns additionalFilters - Any additional filters applied
|
|
828
840
|
* @returns drillDownColumns - The columns on which drill down was performed
|
|
829
841
|
* @returns nonFilteredColumns - The columns that were not filtered
|
|
830
842
|
* @example
|
|
831
843
|
*```js
|
|
832
|
-
* searchEmbed.
|
|
844
|
+
* searchEmbed.on(EmbedEvent.DrillDown, {
|
|
833
845
|
* points: {
|
|
834
846
|
* clickedPoint,
|
|
835
847
|
* selectedPoints: selectedPoint
|
|
@@ -862,6 +874,8 @@ var EmbedEvent;
|
|
|
862
874
|
* One or more data sources have been selected.
|
|
863
875
|
*
|
|
864
876
|
* @returns dataSourceIds - the list of data sources
|
|
877
|
+
*
|
|
878
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
865
879
|
* @example
|
|
866
880
|
* ```js
|
|
867
881
|
* searchEmbed.on(EmbedEvent.DataSourceSelected, payload => {
|
|
@@ -889,6 +903,8 @@ var EmbedEvent;
|
|
|
889
903
|
* @returns actionId - ID of the custom action
|
|
890
904
|
* @returns payload {@link CustomActionPayload} - Response payload with the
|
|
891
905
|
* Answer or Liveboard data
|
|
906
|
+
*
|
|
907
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
892
908
|
* @example
|
|
893
909
|
* ```js
|
|
894
910
|
* appEmbed.on(EmbedEvent.customAction, payload => {
|
|
@@ -936,21 +952,18 @@ var EmbedEvent;
|
|
|
936
952
|
/**
|
|
937
953
|
* An error has occurred. This event is fired for the following error types:
|
|
938
954
|
*
|
|
939
|
-
* API - API call failure error.
|
|
940
|
-
*
|
|
941
|
-
*
|
|
955
|
+
* `API` - API call failure error.
|
|
956
|
+
* `FULLSCREEN` - Error when presenting a Liveboard or visualization in full screen mode.
|
|
957
|
+
* `SINGLE_VALUE_FILTER` - Error due to multiple values in the single value filter.
|
|
958
|
+
* `NON_EXIST_FILTER` - Error due to a non-existent filter.
|
|
959
|
+
* `INVALID_DATE_VALUE` - Invalid date value error.
|
|
960
|
+
* `INVALID_OPERATOR` - Use of invalid operator during filter application.
|
|
942
961
|
*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
* NON_EXIST_FILTER - Error due to a non-existent filter.
|
|
946
|
-
*
|
|
947
|
-
* INVALID_DATE_VALUE - Invalid date value error.
|
|
948
|
-
*
|
|
949
|
-
* INVALID_OPERATOR - Use of invalid operator during filter application.
|
|
950
|
-
*
|
|
951
|
-
* For more information, see [Developer Documentation](https://developers.thoughtspot.com/docs/events-app-integration#errorType)
|
|
962
|
+
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
|
|
952
963
|
*
|
|
953
964
|
* @returns error - An error object or message
|
|
965
|
+
*
|
|
966
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
954
967
|
* @example
|
|
955
968
|
* ```js
|
|
956
969
|
* // API error
|
|
@@ -976,6 +989,9 @@ var EmbedEvent;
|
|
|
976
989
|
* The embedded object has sent an alert.
|
|
977
990
|
*
|
|
978
991
|
* @returns alert - An alert object
|
|
992
|
+
*
|
|
993
|
+
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
994
|
+
*
|
|
979
995
|
* @example
|
|
980
996
|
* ```js
|
|
981
997
|
* searchEmbed.on(EmbedEvent.Alert)
|
|
@@ -985,6 +1001,8 @@ var EmbedEvent;
|
|
|
985
1001
|
/**
|
|
986
1002
|
* The ThoughtSpot auth session has expired.
|
|
987
1003
|
*
|
|
1004
|
+
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
1005
|
+
*
|
|
988
1006
|
* @example
|
|
989
1007
|
*```js
|
|
990
1008
|
* appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
|
|
@@ -1038,6 +1056,7 @@ var EmbedEvent;
|
|
|
1038
1056
|
/**
|
|
1039
1057
|
* Detects the route change.
|
|
1040
1058
|
*
|
|
1059
|
+
* @version SDK: 1.7.0 | ThoughtSpot: 8.0.0.cl, 8.4.1.sw
|
|
1041
1060
|
* @example
|
|
1042
1061
|
*```js
|
|
1043
1062
|
* searchEmbed.on(EmbedEvent.RouteChange, payload =>
|
|
@@ -1118,8 +1137,7 @@ var EmbedEvent;
|
|
|
1118
1137
|
*/
|
|
1119
1138
|
EmbedEvent["LiveboardRendered"] = "PinboardRendered";
|
|
1120
1139
|
/**
|
|
1121
|
-
*
|
|
1122
|
-
* is triggered on all events.
|
|
1140
|
+
* Emits all events.
|
|
1123
1141
|
*
|
|
1124
1142
|
* @Version SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
|
|
1125
1143
|
* @example
|
|
@@ -1136,13 +1154,13 @@ var EmbedEvent;
|
|
|
1136
1154
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1137
1155
|
* @example
|
|
1138
1156
|
*```js
|
|
1139
|
-
* //
|
|
1157
|
+
* //Emit when action starts
|
|
1140
1158
|
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
1141
1159
|
* console.log('Save', payload)
|
|
1142
1160
|
* }, {
|
|
1143
1161
|
* start: true
|
|
1144
1162
|
* })
|
|
1145
|
-
* //
|
|
1163
|
+
* //emit when action ends
|
|
1146
1164
|
* searchEmbed.on(EmbedEvent.Save, payload => {
|
|
1147
1165
|
* console.log('Save', payload)
|
|
1148
1166
|
* })
|
|
@@ -1160,7 +1178,7 @@ var EmbedEvent;
|
|
|
1160
1178
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1161
1179
|
* @example
|
|
1162
1180
|
*```js
|
|
1163
|
-
* liveboardEmbed.
|
|
1181
|
+
* liveboardEmbed.on(EmbedEvent.Download, {
|
|
1164
1182
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
1165
1183
|
* })
|
|
1166
1184
|
*```
|
|
@@ -1172,10 +1190,10 @@ var EmbedEvent;
|
|
|
1172
1190
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
1173
1191
|
* @example
|
|
1174
1192
|
*```js
|
|
1175
|
-
* //
|
|
1193
|
+
* //emit when action starts
|
|
1176
1194
|
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
1177
1195
|
* console.log('download PNG', payload)}, {start: true })
|
|
1178
|
-
* //
|
|
1196
|
+
* //emit when action ends
|
|
1179
1197
|
* searchEmbed.on(EmbedEvent.DownloadAsPng, payload => {
|
|
1180
1198
|
* console.log('download PNG', payload)})
|
|
1181
1199
|
*```
|
|
@@ -1187,10 +1205,10 @@ var EmbedEvent;
|
|
|
1187
1205
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1188
1206
|
* @example
|
|
1189
1207
|
*```js
|
|
1190
|
-
* //
|
|
1208
|
+
* //emit when action starts
|
|
1191
1209
|
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
1192
1210
|
* console.log('download PDF', payload)}, {start: true })
|
|
1193
|
-
* //
|
|
1211
|
+
* //emit when action ends
|
|
1194
1212
|
* searchEmbed.on(EmbedEvent.DownloadAsPdf, payload => {
|
|
1195
1213
|
* console.log('download PDF', payload)})
|
|
1196
1214
|
*```
|
|
@@ -1202,10 +1220,10 @@ var EmbedEvent;
|
|
|
1202
1220
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1203
1221
|
* @example
|
|
1204
1222
|
*```js
|
|
1205
|
-
* //
|
|
1223
|
+
* //emit when action starts
|
|
1206
1224
|
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
1207
1225
|
* console.log('download CSV', payload)}, {start: true })
|
|
1208
|
-
* //
|
|
1226
|
+
* //emit when action ends
|
|
1209
1227
|
* searchEmbed.on(EmbedEvent.DownloadAsCSV, payload => {
|
|
1210
1228
|
* console.log('download CSV', payload)})
|
|
1211
1229
|
*```
|
|
@@ -1217,10 +1235,10 @@ var EmbedEvent;
|
|
|
1217
1235
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1218
1236
|
* @example
|
|
1219
1237
|
*```js
|
|
1220
|
-
* //
|
|
1238
|
+
* //emit when action starts
|
|
1221
1239
|
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
1222
1240
|
* console.log('download Xlsx', payload)}, { start: true })
|
|
1223
|
-
* //
|
|
1241
|
+
* //emit when action ends
|
|
1224
1242
|
* searchEmbed.on(EmbedEvent.DownloadAsXlsx, payload => {
|
|
1225
1243
|
* console.log('download Xlsx', payload)})
|
|
1226
1244
|
*```
|
|
@@ -1232,7 +1250,7 @@ var EmbedEvent;
|
|
|
1232
1250
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1233
1251
|
* @example
|
|
1234
1252
|
*```js
|
|
1235
|
-
* //
|
|
1253
|
+
* //emit when action starts
|
|
1236
1254
|
* appEmbed.on(EmbedEvent.AnswerDelete, payload => {
|
|
1237
1255
|
* console.log('delete answer', payload)}, {start: true })
|
|
1238
1256
|
* //trigger when action is completed
|
|
@@ -1247,13 +1265,13 @@ var EmbedEvent;
|
|
|
1247
1265
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1248
1266
|
* @example
|
|
1249
1267
|
*```js
|
|
1250
|
-
* //
|
|
1268
|
+
* //emit when action starts
|
|
1251
1269
|
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
1252
1270
|
* console.log('pin', payload)
|
|
1253
1271
|
* }, {
|
|
1254
1272
|
* start: true
|
|
1255
1273
|
* })
|
|
1256
|
-
* //
|
|
1274
|
+
* //emit when action ends
|
|
1257
1275
|
* searchEmbed.on(EmbedEvent.Pin, payload => {
|
|
1258
1276
|
* console.log('pin', payload)
|
|
1259
1277
|
* })
|
|
@@ -1266,13 +1284,13 @@ var EmbedEvent;
|
|
|
1266
1284
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1267
1285
|
* @example
|
|
1268
1286
|
*```js
|
|
1269
|
-
* //
|
|
1287
|
+
* //emit when action starts
|
|
1270
1288
|
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
1271
1289
|
* console.log('SpotIQAnalyze', payload)
|
|
1272
1290
|
* }, {
|
|
1273
1291
|
* start: true
|
|
1274
1292
|
* })
|
|
1275
|
-
* //
|
|
1293
|
+
* //emit when action ends
|
|
1276
1294
|
* searchEmbed.on(EmbedEvent.SpotIQAnalyze, payload => {
|
|
1277
1295
|
* console.log('SpotIQ analyze', payload)
|
|
1278
1296
|
* })
|
|
@@ -1285,13 +1303,13 @@ var EmbedEvent;
|
|
|
1285
1303
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1286
1304
|
* @example
|
|
1287
1305
|
*```js
|
|
1288
|
-
* //
|
|
1306
|
+
* //emit when action starts
|
|
1289
1307
|
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
1290
1308
|
* console.log('Share', payload)
|
|
1291
1309
|
* }, {
|
|
1292
1310
|
* start: true
|
|
1293
1311
|
* })
|
|
1294
|
-
* //
|
|
1312
|
+
* //emit when action ends
|
|
1295
1313
|
* searchEmbed.on(EmbedEvent.Share, payload => {
|
|
1296
1314
|
* console.log('Share', payload)
|
|
1297
1315
|
* })
|
|
@@ -1366,10 +1384,10 @@ var EmbedEvent;
|
|
|
1366
1384
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1367
1385
|
* @example
|
|
1368
1386
|
*```js
|
|
1369
|
-
* //
|
|
1387
|
+
* //emit when action starts
|
|
1370
1388
|
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
1371
1389
|
* console.log('Export TML', payload)}, { start: true })
|
|
1372
|
-
* //
|
|
1390
|
+
* //emit when action ends
|
|
1373
1391
|
* searchEmbed.on(EmbedEvent.ExportTML, payload => {
|
|
1374
1392
|
* console.log('Export TML', payload)})
|
|
1375
1393
|
*```
|
|
@@ -1393,10 +1411,10 @@ var EmbedEvent;
|
|
|
1393
1411
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1394
1412
|
* @example
|
|
1395
1413
|
*```js
|
|
1396
|
-
* //
|
|
1414
|
+
* //emit when action starts
|
|
1397
1415
|
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
1398
1416
|
* console.log('Copy and edit', payload)}, {start: true })
|
|
1399
|
-
* //
|
|
1417
|
+
* //emit when action ends
|
|
1400
1418
|
* appEmbed.on(EmbedEvent.CopyAEdit, payload => {
|
|
1401
1419
|
* console.log('Copy and edit', payload)})
|
|
1402
1420
|
*```
|
|
@@ -1498,7 +1516,7 @@ var EmbedEvent;
|
|
|
1498
1516
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1499
1517
|
* @example
|
|
1500
1518
|
*```js
|
|
1501
|
-
* liveboardEmbed.
|
|
1519
|
+
* liveboardEmbed.on(EmbedEvent.Present)
|
|
1502
1520
|
*```
|
|
1503
1521
|
* @example
|
|
1504
1522
|
*```js
|
|
@@ -1514,7 +1532,7 @@ var EmbedEvent;
|
|
|
1514
1532
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1515
1533
|
* @example
|
|
1516
1534
|
*```js
|
|
1517
|
-
* liveboardEmbed.
|
|
1535
|
+
* liveboardEmbed.on(EmbedEvent.Delete,
|
|
1518
1536
|
* {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1519
1537
|
*```
|
|
1520
1538
|
*/
|
|
@@ -1525,7 +1543,7 @@ var EmbedEvent;
|
|
|
1525
1543
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1526
1544
|
* @example
|
|
1527
1545
|
*```js
|
|
1528
|
-
* liveboardEmbed.
|
|
1546
|
+
* liveboardEmbed.on(EmbedEvent.SchedulesList)
|
|
1529
1547
|
*```
|
|
1530
1548
|
*/
|
|
1531
1549
|
EmbedEvent["SchedulesList"] = "schedule-list";
|
|
@@ -1535,7 +1553,7 @@ var EmbedEvent;
|
|
|
1535
1553
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1536
1554
|
* @example
|
|
1537
1555
|
*```js
|
|
1538
|
-
* liveboardEmbed.
|
|
1556
|
+
* liveboardEmbed.on(EmbedEvent.Cancel)
|
|
1539
1557
|
*```
|
|
1540
1558
|
*/
|
|
1541
1559
|
EmbedEvent["Cancel"] = "cancel";
|
|
@@ -1545,7 +1563,7 @@ var EmbedEvent;
|
|
|
1545
1563
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1546
1564
|
* @example
|
|
1547
1565
|
*```js
|
|
1548
|
-
* liveboardEmbed.
|
|
1566
|
+
* liveboardEmbed.on(EmbedEvent.Explore, {
|
|
1549
1567
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1550
1568
|
*```
|
|
1551
1569
|
*/
|
|
@@ -1556,7 +1574,7 @@ var EmbedEvent;
|
|
|
1556
1574
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1557
1575
|
* @example
|
|
1558
1576
|
*```js
|
|
1559
|
-
* liveboardEmbed.
|
|
1577
|
+
* liveboardEmbed.on(EmbedEvent.CopyLink, {
|
|
1560
1578
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'})
|
|
1561
1579
|
*```
|
|
1562
1580
|
*/
|
|
@@ -1936,7 +1954,7 @@ var HostEvent;
|
|
|
1936
1954
|
*
|
|
1937
1955
|
* @example
|
|
1938
1956
|
* ```js
|
|
1939
|
-
* liveboardEmbed.trigger(HostEvent.
|
|
1957
|
+
* liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
|
|
1940
1958
|
* data=>console.log(data))
|
|
1941
1959
|
* ```
|
|
1942
1960
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1.sw
|
|
@@ -2400,7 +2418,7 @@ var HostEvent;
|
|
|
2400
2418
|
*
|
|
2401
2419
|
* ```js
|
|
2402
2420
|
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2403
|
-
* filter: { column: 'column name', oper: 'IN', values: [1,2,3]
|
|
2421
|
+
* filter: { column: 'column name', oper: 'IN', values: [1,2,3]}
|
|
2404
2422
|
* })
|
|
2405
2423
|
* ```
|
|
2406
2424
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
@@ -3557,7 +3575,7 @@ var Action;
|
|
|
3557
3575
|
* disabledActions: [Action.TML] // to disable all TML actions
|
|
3558
3576
|
* ```
|
|
3559
3577
|
*
|
|
3560
|
-
* @version SDK : 1.28.
|
|
3578
|
+
* @version SDK : 1.28.3 | Thoughtspot: 9.12.0.cl
|
|
3561
3579
|
*/
|
|
3562
3580
|
Action["TML"] = "tml";
|
|
3563
3581
|
/**
|
|
@@ -6033,6 +6051,7 @@ const logger = new Logger();
|
|
|
6033
6051
|
|
|
6034
6052
|
const EndPoints = {
|
|
6035
6053
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
6054
|
+
SESSION_INFO: '/callosum/v1/session/info',
|
|
6036
6055
|
SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
|
|
6037
6056
|
OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
|
|
6038
6057
|
TOKEN_LOGIN: '/callosum/v1/session/login/token',
|
|
@@ -6149,8 +6168,10 @@ const DUPLICATE_TOKEN_ERR = 'Duplicate token, please issue a new token every tim
|
|
|
6149
6168
|
const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authToken endpoint.';
|
|
6150
6169
|
let cachedAuthToken = null;
|
|
6151
6170
|
// This method can be used to get the authToken using the embedConfig
|
|
6152
|
-
|
|
6153
|
-
if
|
|
6171
|
+
async function getAuthenticationToken(embedConfig) {
|
|
6172
|
+
// Since we don't have token validation enabled , we cannot tell if the
|
|
6173
|
+
// cached token is valid or not. So we will always fetch a new token.
|
|
6174
|
+
if (cachedAuthToken && !embedConfig.disableTokenVerification) {
|
|
6154
6175
|
let isCachedTokenStillValid;
|
|
6155
6176
|
try {
|
|
6156
6177
|
isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
@@ -6170,12 +6191,22 @@ const getAuthenticationToken = async (embedConfig) => {
|
|
|
6170
6191
|
const response = await fetchAuthTokenService(authEndpoint);
|
|
6171
6192
|
authToken = await response.text();
|
|
6172
6193
|
}
|
|
6173
|
-
|
|
6174
|
-
|
|
6194
|
+
try {
|
|
6195
|
+
// this will throw error if the token is not valid
|
|
6196
|
+
await validateAuthToken(embedConfig, authToken);
|
|
6197
|
+
}
|
|
6198
|
+
catch (e) {
|
|
6199
|
+
logger.error(`Received invalid token from getAuthToken callback or authToken endpoint. Error : ${e.message}`);
|
|
6200
|
+
throw e;
|
|
6201
|
+
}
|
|
6175
6202
|
cachedAuthToken = authToken;
|
|
6176
6203
|
return authToken;
|
|
6177
|
-
}
|
|
6204
|
+
}
|
|
6178
6205
|
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
6206
|
+
if (embedConfig.disableTokenVerification) {
|
|
6207
|
+
logger.info('Token verification is disabled. Assuming token is valid.');
|
|
6208
|
+
return true;
|
|
6209
|
+
}
|
|
6179
6210
|
try {
|
|
6180
6211
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
6181
6212
|
if (isTokenValid)
|
|
@@ -6440,6 +6471,16 @@ var OperationType;
|
|
|
6440
6471
|
* const data = await underlying.fetchData(0, 100);
|
|
6441
6472
|
* })
|
|
6442
6473
|
* ```
|
|
6474
|
+
* @example
|
|
6475
|
+
* ```js
|
|
6476
|
+
* embed.on(EmbedEvent.Data, async (e) => {
|
|
6477
|
+
* const service = await embed.getAnswerService();
|
|
6478
|
+
* await service.addColumns([
|
|
6479
|
+
* "<column guid>"
|
|
6480
|
+
* ]);
|
|
6481
|
+
* console.log(await service.fetchData());
|
|
6482
|
+
* });
|
|
6483
|
+
* ```
|
|
6443
6484
|
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
6444
6485
|
* @group Events
|
|
6445
6486
|
*/
|
|
@@ -12780,6 +12821,7 @@ function emptyQueue() {
|
|
|
12780
12821
|
function initMixpanel(sessionInfo) {
|
|
12781
12822
|
var _a;
|
|
12782
12823
|
if (!sessionInfo || !sessionInfo.mixpanelToken) {
|
|
12824
|
+
logger.error('Mixpanel token not found in session info');
|
|
12783
12825
|
return;
|
|
12784
12826
|
}
|
|
12785
12827
|
// On a public cluster the user is anonymous, so don't set the identify to
|
|
@@ -13164,36 +13206,111 @@ var createSet = !(_Set && (1 / _setToArray(new _Set([,-0]))[1]) == INFINITY) ? n
|
|
|
13164
13206
|
* @param url
|
|
13165
13207
|
* @param options
|
|
13166
13208
|
*/
|
|
13167
|
-
function
|
|
13209
|
+
function tokenizedFailureLoggedFetch(url, options = {}) {
|
|
13168
13210
|
return tokenizedFetch(url, options).then(async (r) => {
|
|
13169
13211
|
var _a;
|
|
13170
13212
|
if (!r.ok && r.type !== 'opaqueredirect' && r.type !== 'opaque') {
|
|
13171
|
-
logger.error(
|
|
13213
|
+
logger.error(`Failed to fetch ${url}`, await ((_a = r.text) === null || _a === void 0 ? void 0 : _a.call(r)));
|
|
13172
13214
|
}
|
|
13173
13215
|
return r;
|
|
13174
13216
|
});
|
|
13175
13217
|
}
|
|
13176
13218
|
/**
|
|
13219
|
+
* Fetches the session info from the ThoughtSpot server.
|
|
13177
13220
|
*
|
|
13178
|
-
* @param
|
|
13221
|
+
* @param thoughtspotHost
|
|
13222
|
+
* @returns {Promise<any>}
|
|
13223
|
+
* @example
|
|
13224
|
+
* ```js
|
|
13225
|
+
* const response = await sessionInfoService();
|
|
13226
|
+
* ```
|
|
13179
13227
|
*/
|
|
13180
|
-
function fetchSessionInfoService(
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13228
|
+
async function fetchSessionInfoService(thoughtspotHost) {
|
|
13229
|
+
const sessionInfoPath = `${thoughtspotHost}${EndPoints.SESSION_INFO}`;
|
|
13230
|
+
const response = await tokenizedFailureLoggedFetch(sessionInfoPath);
|
|
13231
|
+
if (!response.ok) {
|
|
13232
|
+
throw new Error(`Failed to fetch session info: ${response.statusText}`);
|
|
13233
|
+
}
|
|
13234
|
+
const data = await response.json();
|
|
13235
|
+
return data;
|
|
13236
|
+
}
|
|
13237
|
+
/**
|
|
13238
|
+
* Is active service to check if the user is logged in.
|
|
13239
|
+
*
|
|
13240
|
+
* @param thoughtSpotHost
|
|
13241
|
+
* @version SDK: 1.28.4 | ThoughtSpot: *
|
|
13242
|
+
*/
|
|
13243
|
+
async function isActiveService(thoughtSpotHost) {
|
|
13244
|
+
const isActiveUrl = `${thoughtSpotHost}${EndPoints.IS_ACTIVE}`;
|
|
13245
|
+
try {
|
|
13246
|
+
const res = await tokenizedFetch(isActiveUrl, {
|
|
13247
|
+
credentials: 'include',
|
|
13248
|
+
});
|
|
13249
|
+
return res.ok;
|
|
13250
|
+
}
|
|
13251
|
+
catch (e) {
|
|
13252
|
+
logger.warn(`Is Logged In Service failed : ${e.message}`);
|
|
13253
|
+
}
|
|
13254
|
+
return false;
|
|
13184
13255
|
}
|
|
13185
13256
|
|
|
13257
|
+
let sessionInfo = null;
|
|
13258
|
+
/**
|
|
13259
|
+
* Returns the session info object and caches it for future use.
|
|
13260
|
+
* Once fetched the session info object is cached and returned from the cache on
|
|
13261
|
+
* subsequent calls.
|
|
13262
|
+
*
|
|
13263
|
+
* @example ```js
|
|
13264
|
+
* const sessionInfo = await getSessionInfo();
|
|
13265
|
+
* console.log(sessionInfo);
|
|
13266
|
+
* ```
|
|
13267
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
13268
|
+
* @returns {Promise<SessionInfo>} The session info object.
|
|
13269
|
+
*/
|
|
13270
|
+
async function getSessionInfo() {
|
|
13271
|
+
if (!sessionInfo) {
|
|
13272
|
+
const host = getEmbedConfig().thoughtSpotHost;
|
|
13273
|
+
const sessionResponse = await fetchSessionInfoService(host);
|
|
13274
|
+
const processedSessionInfo = getSessionDetails(sessionResponse);
|
|
13275
|
+
sessionInfo = processedSessionInfo;
|
|
13276
|
+
}
|
|
13277
|
+
return sessionInfo;
|
|
13278
|
+
}
|
|
13279
|
+
/**
|
|
13280
|
+
* Processes the session info response and returns the session info object.
|
|
13281
|
+
*
|
|
13282
|
+
* @param sessionInfoResp {any} Response from the session info API.
|
|
13283
|
+
* @returns {SessionInfo} The session info object.
|
|
13284
|
+
* @example ```js
|
|
13285
|
+
* const sessionInfoResp = await fetch(sessionInfoPath);
|
|
13286
|
+
* const sessionInfo = getSessionDetails(sessionInfoResp);
|
|
13287
|
+
* console.log(sessionInfo);
|
|
13288
|
+
* ```
|
|
13289
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
13290
|
+
*/
|
|
13291
|
+
const getSessionDetails = (sessionInfoResp) => {
|
|
13292
|
+
const devMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.devSdkKey;
|
|
13293
|
+
const prodMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.prodSdkKey;
|
|
13294
|
+
const mixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.production
|
|
13295
|
+
? prodMixpanelToken
|
|
13296
|
+
: devMixpanelToken;
|
|
13297
|
+
return {
|
|
13298
|
+
userGUID: sessionInfoResp.userGUID,
|
|
13299
|
+
mixpanelToken,
|
|
13300
|
+
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
13301
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
13302
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
13303
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
13304
|
+
...sessionInfoResp,
|
|
13305
|
+
};
|
|
13306
|
+
};
|
|
13307
|
+
|
|
13186
13308
|
// eslint-disable-next-line import/no-mutable-exports
|
|
13187
13309
|
let loggedInStatus = false;
|
|
13188
13310
|
// eslint-disable-next-line import/no-mutable-exports
|
|
13189
13311
|
let samlAuthWindow = null;
|
|
13190
13312
|
// eslint-disable-next-line import/no-mutable-exports
|
|
13191
13313
|
let samlCompletionPromise = null;
|
|
13192
|
-
let sessionInfo = null;
|
|
13193
|
-
let sessionInfoResolver = null;
|
|
13194
|
-
const sessionInfoPromise = new Promise((resolve) => {
|
|
13195
|
-
sessionInfoResolver = resolve;
|
|
13196
|
-
});
|
|
13197
13314
|
let releaseVersion = '';
|
|
13198
13315
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
13199
13316
|
/**
|
|
@@ -13266,7 +13383,7 @@ function notifyAuthSDKSuccess() {
|
|
|
13266
13383
|
/**
|
|
13267
13384
|
*
|
|
13268
13385
|
*/
|
|
13269
|
-
function notifyAuthSuccess() {
|
|
13386
|
+
async function notifyAuthSuccess() {
|
|
13270
13387
|
{
|
|
13271
13388
|
logger.error('SDK not initialized');
|
|
13272
13389
|
return;
|
|
@@ -13291,52 +13408,39 @@ function notifyLogout() {
|
|
|
13291
13408
|
return;
|
|
13292
13409
|
}
|
|
13293
13410
|
}
|
|
13294
|
-
const initSession = (sessionDetails) => {
|
|
13295
|
-
const embedConfig = getEmbedConfig();
|
|
13296
|
-
if (sessionInfo == null) {
|
|
13297
|
-
sessionInfo = sessionDetails;
|
|
13298
|
-
if (!embedConfig.disableSDKTracking) {
|
|
13299
|
-
initMixpanel(sessionInfo);
|
|
13300
|
-
}
|
|
13301
|
-
sessionInfoResolver(sessionInfo);
|
|
13302
|
-
}
|
|
13303
|
-
};
|
|
13304
|
-
const getSessionDetails = (sessionInfoResp) => {
|
|
13305
|
-
const devMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.devSdkKey;
|
|
13306
|
-
const prodMixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.prodSdkKey;
|
|
13307
|
-
const mixpanelToken = sessionInfoResp.configInfo.mixpanelConfig.production
|
|
13308
|
-
? prodMixpanelToken
|
|
13309
|
-
: devMixpanelToken;
|
|
13310
|
-
return {
|
|
13311
|
-
userGUID: sessionInfoResp.userGUID,
|
|
13312
|
-
mixpanelToken,
|
|
13313
|
-
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
13314
|
-
releaseVersion: sessionInfoResp.releaseVersion,
|
|
13315
|
-
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
13316
|
-
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
13317
|
-
...sessionInfoResp,
|
|
13318
|
-
};
|
|
13319
|
-
};
|
|
13320
13411
|
/**
|
|
13321
13412
|
* Check if we are logged into the ThoughtSpot cluster
|
|
13322
13413
|
*
|
|
13323
13414
|
* @param thoughtSpotHost The ThoughtSpot cluster hostname or IP
|
|
13324
13415
|
*/
|
|
13325
13416
|
async function isLoggedIn(thoughtSpotHost) {
|
|
13326
|
-
const authVerificationUrl = `${thoughtSpotHost}${EndPoints.AUTH_VERIFICATION}`;
|
|
13327
|
-
let response = null;
|
|
13328
13417
|
try {
|
|
13329
|
-
response = await
|
|
13330
|
-
|
|
13331
|
-
const sessionDetails = getSessionDetails(sessionInfoResp);
|
|
13332
|
-
// Store user session details from session info
|
|
13333
|
-
initSession(sessionDetails);
|
|
13334
|
-
releaseVersion = sessionInfoResp.releaseVersion;
|
|
13418
|
+
const response = await isActiveService(thoughtSpotHost);
|
|
13419
|
+
return response;
|
|
13335
13420
|
}
|
|
13336
13421
|
catch (e) {
|
|
13337
13422
|
return false;
|
|
13338
13423
|
}
|
|
13339
|
-
|
|
13424
|
+
}
|
|
13425
|
+
/**
|
|
13426
|
+
* Services to be called after the login is successful,
|
|
13427
|
+
* This should be called after the cookie is set for cookie auth or
|
|
13428
|
+
* after the token is set for cookieless.
|
|
13429
|
+
*
|
|
13430
|
+
* @return {Promise<void>}
|
|
13431
|
+
* @example
|
|
13432
|
+
* ```js
|
|
13433
|
+
* await postLoginService();
|
|
13434
|
+
* ```
|
|
13435
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
13436
|
+
*/
|
|
13437
|
+
async function postLoginService() {
|
|
13438
|
+
const sessionInfo = await getSessionInfo();
|
|
13439
|
+
releaseVersion = sessionInfo.releaseVersion;
|
|
13440
|
+
const embedConfig = getEmbedConfig();
|
|
13441
|
+
if (!embedConfig.disableSDKTracking) {
|
|
13442
|
+
initMixpanel(sessionInfo);
|
|
13443
|
+
}
|
|
13340
13444
|
}
|
|
13341
13445
|
/**
|
|
13342
13446
|
* Return releaseVersion if available
|
|
@@ -13373,7 +13477,14 @@ const doTokenAuth = async (embedConfig) => {
|
|
|
13373
13477
|
}
|
|
13374
13478
|
loggedInStatus = await isLoggedIn(thoughtSpotHost);
|
|
13375
13479
|
if (!loggedInStatus) {
|
|
13376
|
-
|
|
13480
|
+
let authToken;
|
|
13481
|
+
try {
|
|
13482
|
+
authToken = await getAuthenticationToken(embedConfig);
|
|
13483
|
+
}
|
|
13484
|
+
catch (e) {
|
|
13485
|
+
loggedInStatus = false;
|
|
13486
|
+
throw e;
|
|
13487
|
+
}
|
|
13377
13488
|
let resp;
|
|
13378
13489
|
try {
|
|
13379
13490
|
resp = await fetchAuthPostService(thoughtSpotHost, username, authToken);
|
|
@@ -13571,6 +13682,8 @@ const handleAuth = () => {
|
|
|
13571
13682
|
notifyAuthFailure(AuthFailureType.SDK);
|
|
13572
13683
|
}
|
|
13573
13684
|
else {
|
|
13685
|
+
// Post login service is called after successful login.
|
|
13686
|
+
postLoginService();
|
|
13574
13687
|
notifyAuthSDKSuccess();
|
|
13575
13688
|
}
|
|
13576
13689
|
}, () => {
|
|
@@ -13621,13 +13734,13 @@ function processCustomAction(e, thoughtSpotHost) {
|
|
|
13621
13734
|
};
|
|
13622
13735
|
}
|
|
13623
13736
|
/**
|
|
13737
|
+
* Responds to AuthInit sent from host signifying successful authentication in host.
|
|
13624
13738
|
*
|
|
13625
13739
|
* @param e
|
|
13740
|
+
* @returns {any}
|
|
13626
13741
|
*/
|
|
13627
13742
|
function processAuthInit(e) {
|
|
13628
13743
|
var _a, _b;
|
|
13629
|
-
// Store user session details sent by app.
|
|
13630
|
-
initSession(e.data);
|
|
13631
13744
|
notifyAuthSuccess();
|
|
13632
13745
|
// Expose only allowed details (eg: userGUID) back to SDK users.
|
|
13633
13746
|
return {
|
|
@@ -13765,7 +13878,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
13765
13878
|
});
|
|
13766
13879
|
}
|
|
13767
13880
|
|
|
13768
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.29.0-alpha.
|
|
13881
|
+
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={".":{"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,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};
|
|
13769
13882
|
|
|
13770
13883
|
/**
|
|
13771
13884
|
* Copyright (c) 2022
|
|
@@ -13865,6 +13978,7 @@ class TsEmbed {
|
|
|
13865
13978
|
});
|
|
13866
13979
|
}
|
|
13867
13980
|
catch (e) {
|
|
13981
|
+
logger.error(`Received invalid token. Error : ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
13868
13982
|
processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
13869
13983
|
}
|
|
13870
13984
|
}
|
|
@@ -14209,6 +14323,7 @@ class TsEmbed {
|
|
|
14209
14323
|
* @param url - The URL of the embedded ThoughtSpot app.
|
|
14210
14324
|
*/
|
|
14211
14325
|
async renderIFrame(url) {
|
|
14326
|
+
console.log('here 7');
|
|
14212
14327
|
if (this.isError) {
|
|
14213
14328
|
return null;
|
|
14214
14329
|
}
|
|
@@ -14216,8 +14331,10 @@ class TsEmbed {
|
|
|
14216
14331
|
this.throwInitError();
|
|
14217
14332
|
}
|
|
14218
14333
|
if (url.length > URL_MAX_LENGTH) ;
|
|
14334
|
+
console.log('here 8');
|
|
14219
14335
|
return renderInQueue((nextInQueue) => {
|
|
14220
14336
|
var _a;
|
|
14337
|
+
console.log('here 6');
|
|
14221
14338
|
const initTimestamp = Date.now();
|
|
14222
14339
|
this.executeCallbacks(EmbedEvent.Init, {
|
|
14223
14340
|
data: {
|
|
@@ -14227,6 +14344,7 @@ class TsEmbed {
|
|
|
14227
14344
|
});
|
|
14228
14345
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
14229
14346
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
14347
|
+
console.log('here 9', isLoggedIn);
|
|
14230
14348
|
if (!isLoggedIn) {
|
|
14231
14349
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
14232
14350
|
return;
|
|
@@ -14250,7 +14368,9 @@ class TsEmbed {
|
|
|
14250
14368
|
this.iFrame.addEventListener('error', () => {
|
|
14251
14369
|
nextInQueue();
|
|
14252
14370
|
});
|
|
14371
|
+
console.log('here 10', this.iFrame);
|
|
14253
14372
|
this.handleInsertionIntoDOM(this.iFrame);
|
|
14373
|
+
console.log('here 11', document.body.innerHTML);
|
|
14254
14374
|
const prefetchIframe = document.querySelectorAll('.prefetchIframe');
|
|
14255
14375
|
if (prefetchIframe.length) {
|
|
14256
14376
|
prefetchIframe.forEach((el) => {
|
|
@@ -15845,4 +15965,4 @@ function useEmbedRef() {
|
|
|
15845
15965
|
return React.useRef(null);
|
|
15846
15966
|
}
|
|
15847
15967
|
|
|
15848
|
-
export { Action, AppEmbed$1 as AppEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, LiveboardEmbed$1 as LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed$1 as SageEmbed, SearchBarEmbed$1 as SearchBarEmbed, SearchEmbed$1 as SearchEmbed, useEmbedRef };
|
|
15968
|
+
export { Action, AppEmbed$1 as AppEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, LiveboardEmbed$1 as LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed$1 as SageEmbed, SearchBarEmbed$1 as SearchBarEmbed, SearchEmbed$1 as SearchEmbed, getSessionInfo, useEmbedRef };
|