@thoughtspot/visual-embed-sdk 1.46.2 → 1.46.3
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.js +0 -3
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +1 -3
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.js +0 -1
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +2 -1
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +2 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.d.ts +41 -0
- package/cjs/src/embed/auto-frame-renderer.d.ts.map +1 -0
- package/cjs/src/embed/auto-frame-renderer.js +145 -0
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -0
- package/cjs/src/embed/auto-frame-renderer.spec.d.ts +2 -0
- package/cjs/src/embed/auto-frame-renderer.spec.d.ts.map +1 -0
- package/cjs/src/embed/auto-frame-renderer.spec.js +195 -0
- package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +4 -7
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +0 -2
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +2 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +4 -2
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.js +0 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search.spec.js +0 -2
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +3 -3
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +2 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +3 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/index.js +0 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +6 -3
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +56 -32
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +34 -18
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +5 -4
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +7 -11
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/preview-service.js +0 -1
- package/cjs/src/utils/graphql/preview-service.js.map +1 -1
- package/cjs/src/utils/processData.js +0 -5
- package/cjs/src/utils/processData.js.map +1 -1
- package/dist/{index-DkizS4xM.js → index-DyX-x6uN.js} +1 -1
- package/dist/src/embed/app.d.ts +2 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/auto-frame-renderer.d.ts +41 -0
- package/dist/src/embed/auto-frame-renderer.d.ts.map +1 -0
- package/dist/src/embed/auto-frame-renderer.spec.d.ts +2 -0
- package/dist/src/embed/auto-frame-renderer.spec.d.ts.map +1 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +2 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +56 -32
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +5 -4
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +55 -57
- package/dist/tsembed-react.js +54 -56
- package/dist/tsembed.es.js +194 -57
- package/dist/tsembed.js +193 -55
- package/dist/visual-embed-sdk-react-full.d.ts +54 -33
- package/dist/visual-embed-sdk-react.d.ts +54 -33
- package/dist/visual-embed-sdk.d.ts +103 -38
- package/lib/package.json +1 -1
- package/lib/src/auth.js +0 -3
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +1 -3
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.js +0 -1
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +2 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +2 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.d.ts +41 -0
- package/lib/src/embed/auto-frame-renderer.d.ts.map +1 -0
- package/lib/src/embed/auto-frame-renderer.js +141 -0
- package/lib/src/embed/auto-frame-renderer.js.map +1 -0
- package/lib/src/embed/auto-frame-renderer.spec.d.ts +2 -0
- package/lib/src/embed/auto-frame-renderer.spec.d.ts.map +1 -0
- package/lib/src/embed/auto-frame-renderer.spec.js +192 -0
- package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +4 -7
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +0 -2
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +2 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +5 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +4 -2
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.js +0 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search.spec.js +0 -2
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +3 -3
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +2 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +3 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -0
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.js +0 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +6 -3
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +56 -32
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +34 -18
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +5 -4
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +7 -11
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/preview-service.js +0 -1
- package/lib/src/utils/graphql/preview-service.js.map +1 -1
- package/lib/src/utils/processData.js +0 -5
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +11466 -0
- package/package.json +1 -1
- package/src/auth.spec.ts +1 -1
- package/src/auth.ts +3 -3
- package/src/authToken.spec.ts +2 -1
- package/src/authToken.ts +1 -1
- package/src/embed/app.ts +2 -1
- package/src/embed/auto-frame-renderer.spec.ts +266 -0
- package/src/embed/auto-frame-renderer.ts +152 -0
- package/src/embed/base.spec.ts +1 -1
- package/src/embed/base.ts +7 -8
- package/src/embed/hostEventClient/host-event-client.ts +2 -2
- package/src/embed/liveboard.spec.ts +4 -2
- package/src/embed/liveboard.ts +7 -4
- package/src/embed/sage.ts +1 -1
- package/src/embed/search.spec.ts +2 -2
- package/src/embed/ts-embed.spec.ts +2 -1
- package/src/embed/ts-embed.ts +3 -3
- package/src/index.ts +3 -0
- package/src/react/index.spec.tsx +6 -3
- package/src/react/index.tsx +1 -1
- package/src/types.ts +57 -32
- package/src/utils/graphql/answerService/answerService.ts +8 -7
- package/src/utils/graphql/preview-service.ts +1 -1
- package/src/utils/processData.ts +5 -5
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.46.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.3 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -833,7 +833,8 @@
|
|
|
833
833
|
EmbedEvent["Download"] = "download";
|
|
834
834
|
/**
|
|
835
835
|
* Emitted when the download action is triggered on an Answer.
|
|
836
|
-
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
836
|
+
* Use start:true to subscribe to when download is initiated, or end:true to
|
|
837
|
+
* subscribe to when download is completed. Default is end:true.
|
|
837
838
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
838
839
|
* @example
|
|
839
840
|
* ```js
|
|
@@ -848,7 +849,8 @@
|
|
|
848
849
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
849
850
|
/**
|
|
850
851
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
851
|
-
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
852
|
+
* Use start:true to subscribe to when download as PDF is initiated, or end:true to
|
|
853
|
+
* subscribe to when download as PDF is completed. Default is end:true.
|
|
852
854
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
853
855
|
* @example
|
|
854
856
|
* ```js
|
|
@@ -863,7 +865,8 @@
|
|
|
863
865
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
864
866
|
/**
|
|
865
867
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
866
|
-
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
868
|
+
* Use start:true to subscribe to when download as CSV is initiated, or end:true to
|
|
869
|
+
* subscribe to when download as CSV is completed. Default is end:true.
|
|
867
870
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
868
871
|
* @example
|
|
869
872
|
* ```js
|
|
@@ -878,7 +881,8 @@
|
|
|
878
881
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
879
882
|
/**
|
|
880
883
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
881
|
-
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
884
|
+
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to
|
|
885
|
+
* subscribe to when download as XLSX is completed. Default is end:true.
|
|
882
886
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
883
887
|
* @example
|
|
884
888
|
* ```js
|
|
@@ -893,7 +897,8 @@
|
|
|
893
897
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
894
898
|
/**
|
|
895
899
|
* Emitted when an Answer is deleted in the app
|
|
896
|
-
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe
|
|
900
|
+
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe
|
|
901
|
+
* to when delete is completed. Default is end:true.
|
|
897
902
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
898
903
|
* @example
|
|
899
904
|
* ```js
|
|
@@ -920,7 +925,8 @@
|
|
|
920
925
|
/**
|
|
921
926
|
* Emitted when a user initiates the Pin action to
|
|
922
927
|
* add an Answer to a Liveboard.
|
|
923
|
-
* Use start:true to subscribe to when pin is initiated, or end:true to subscribe to
|
|
928
|
+
* Use start:true to subscribe to when pin is initiated, or end:true to subscribe to
|
|
929
|
+
* when pin is completed. Default is end:true.
|
|
924
930
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
925
931
|
* @example
|
|
926
932
|
* ```js
|
|
@@ -1034,7 +1040,8 @@
|
|
|
1034
1040
|
/**
|
|
1035
1041
|
* Emitted when the **Export TML** action is triggered on an
|
|
1036
1042
|
* an embedded object in the app
|
|
1037
|
-
* Use start:true to subscribe to when export is initiated, or end:true to subscribe
|
|
1043
|
+
* Use start:true to subscribe to when export is initiated, or end:true to subscribe
|
|
1044
|
+
* to when export is completed. Default is end:true.
|
|
1038
1045
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1039
1046
|
* @example
|
|
1040
1047
|
* ```js
|
|
@@ -1060,7 +1067,8 @@
|
|
|
1060
1067
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
1061
1068
|
/**
|
|
1062
1069
|
* Emitted when the user creates a copy of an Answer.
|
|
1063
|
-
* Use start:true to subscribe to when copy and edit is initiated, or end:true to
|
|
1070
|
+
* Use start:true to subscribe to when copy and edit is initiated, or end:true to
|
|
1071
|
+
* subscribe to when copy and edit is completed. Default is end:true.
|
|
1064
1072
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1065
1073
|
* @example
|
|
1066
1074
|
* ```js
|
|
@@ -1824,7 +1832,8 @@
|
|
|
1824
1832
|
* - `autoDrillDown`: Optional. If `true`, the drill down will be done automatically
|
|
1825
1833
|
* on the most popular column.
|
|
1826
1834
|
* - `vizId` (TS >= 9.8.0): Optional. The GUID of the visualization to drill in case
|
|
1827
|
-
* of a Liveboard. In Spotter embed, `vizId` refers to the Answer ID and is
|
|
1835
|
+
* of a Liveboard. In Spotter embed, `vizId` refers to the Answer ID and is
|
|
1836
|
+
* **required**.
|
|
1828
1837
|
* @example
|
|
1829
1838
|
* ```js
|
|
1830
1839
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2020,7 +2029,8 @@
|
|
|
2020
2029
|
* the following parameters:
|
|
2021
2030
|
*
|
|
2022
2031
|
* @param - Includes the following keys:
|
|
2023
|
-
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2032
|
+
* - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
|
|
2033
|
+
* Liveboard.
|
|
2024
2034
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2025
2035
|
* **Required** in Spotter Embed.
|
|
2026
2036
|
* - `liveboardId`: GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
@@ -2276,7 +2286,8 @@
|
|
|
2276
2286
|
* This event is not supported in visualization embed and search embed.
|
|
2277
2287
|
* @param - Object parameter. Includes the following keys:
|
|
2278
2288
|
* - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
|
|
2279
|
-
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
2289
|
+
* pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
|
|
2290
|
+
* is **required**.
|
|
2280
2291
|
*
|
|
2281
2292
|
* @example
|
|
2282
2293
|
* ```js
|
|
@@ -2645,8 +2656,9 @@
|
|
|
2645
2656
|
/**
|
|
2646
2657
|
* Update one or several filters applied on a Liveboard.
|
|
2647
2658
|
* @param - Includes the following keys:
|
|
2648
|
-
* - `filter`: A single filter object containing column name, filter operator, and
|
|
2649
|
-
* - `filters`: Multiple filter objects with column name, filter operator,
|
|
2659
|
+
* - `filter`: A single filter object containing column name, filter operator, and
|
|
2660
|
+
* values. - `filters`: Multiple filter objects with column name, filter operator,
|
|
2661
|
+
* and values for each.
|
|
2650
2662
|
*
|
|
2651
2663
|
* Each filter object must include the following attributes:
|
|
2652
2664
|
*
|
|
@@ -2915,8 +2927,8 @@
|
|
|
2915
2927
|
* triggered with a modal to prompt users to
|
|
2916
2928
|
* add a name and description for the Answer.
|
|
2917
2929
|
* @param - Includes the following keys:
|
|
2918
|
-
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
2919
|
-
* - `name`: Optional. Name string for the Answer.
|
|
2930
|
+
* - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
|
|
2931
|
+
* embed. - `name`: Optional. Name string for the Answer.
|
|
2920
2932
|
* - `description`: Optional. Description text for the Answer.
|
|
2921
2933
|
* @example
|
|
2922
2934
|
* ```js
|
|
@@ -3111,8 +3123,9 @@
|
|
|
3111
3123
|
/**
|
|
3112
3124
|
* Triggers a new conversation in Spotter embed.
|
|
3113
3125
|
*
|
|
3114
|
-
* This feature is available only when chat history is enabled on your ThoughtSpot
|
|
3115
|
-
* Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
3126
|
+
* This feature is available only when chat history is enabled on your ThoughtSpot
|
|
3127
|
+
* instance. Contact your admin or ThoughtSpot Support to enable chat history on your
|
|
3128
|
+
* instance.
|
|
3116
3129
|
*
|
|
3117
3130
|
* @example
|
|
3118
3131
|
* ```js
|
|
@@ -3158,6 +3171,7 @@
|
|
|
3158
3171
|
*/
|
|
3159
3172
|
var Param;
|
|
3160
3173
|
(function (Param) {
|
|
3174
|
+
Param["Tsmcp"] = "tsmcp";
|
|
3161
3175
|
Param["EmbedApp"] = "embedApp";
|
|
3162
3176
|
Param["DataSources"] = "dataSources";
|
|
3163
3177
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
@@ -5052,7 +5066,9 @@
|
|
|
5052
5066
|
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
5053
5067
|
})(exports.ErrorDetailsTypes || (exports.ErrorDetailsTypes = {}));
|
|
5054
5068
|
/**
|
|
5055
|
-
* Error codes for identifying specific issues in embedded ThoughtSpot components. Use
|
|
5069
|
+
* Error codes for identifying specific issues in embedded ThoughtSpot components. Use
|
|
5070
|
+
* {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error
|
|
5071
|
+
* handling and debugging.
|
|
5056
5072
|
*
|
|
5057
5073
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
5058
5074
|
* @group Error Handling
|
|
@@ -8295,7 +8311,6 @@
|
|
|
8295
8311
|
}
|
|
8296
8312
|
if (cachedAuthToken && cachedAuthToken === authToken) {
|
|
8297
8313
|
if (!embedConfig.suppressErrorAlerts && !suppressAlert) {
|
|
8298
|
-
// eslint-disable-next-line no-alert
|
|
8299
8314
|
alert(ERROR_MESSAGE.DUPLICATE_TOKEN_ERR);
|
|
8300
8315
|
}
|
|
8301
8316
|
throw new Error(ERROR_MESSAGE.DUPLICATE_TOKEN_ERR);
|
|
@@ -8727,7 +8742,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
8727
8742
|
}`;
|
|
8728
8743
|
|
|
8729
8744
|
// import YAML from 'yaml';
|
|
8730
|
-
// eslint-disable-next-line no-shadow
|
|
8731
8745
|
var OperationType;
|
|
8732
8746
|
(function (OperationType) {
|
|
8733
8747
|
OperationType["GetChartWithData"] = "GetChartWithData";
|
|
@@ -8743,10 +8757,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
8743
8757
|
*
|
|
8744
8758
|
* You can use this service to:
|
|
8745
8759
|
*
|
|
8746
|
-
* - Add or remove columns from Answers (`addColumns`, `removeColumns`,
|
|
8747
|
-
* - Apply filters to Answers (`addFilter`)
|
|
8748
|
-
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
|
|
8749
|
-
* - Get data for specific points in visualizations
|
|
8760
|
+
* - Add or remove columns from Answers (`addColumns`, `removeColumns`,
|
|
8761
|
+
* `addColumnsByName`) - Apply filters to Answers (`addFilter`)
|
|
8762
|
+
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
|
|
8763
|
+
* `fetchCSVBlob`, `fetchPNGBlob`) - Get data for specific points in visualizations
|
|
8764
|
+
* (`getUnderlyingDataForPoint`)
|
|
8750
8765
|
* - Run custom queries (`executeQuery`)
|
|
8751
8766
|
* - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
|
|
8752
8767
|
*
|
|
@@ -9128,13 +9143,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
9128
9143
|
*/
|
|
9129
9144
|
function getDisplayedViz(visualizations, displayMode) {
|
|
9130
9145
|
if (displayMode === 'CHART_MODE') {
|
|
9131
|
-
return visualizations.find(
|
|
9132
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
9133
|
-
(viz) => viz.__typename === 'ChartViz');
|
|
9146
|
+
return visualizations.find((viz) => viz.__typename === 'ChartViz');
|
|
9134
9147
|
}
|
|
9135
|
-
return visualizations.find(
|
|
9136
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
9137
|
-
(viz) => viz.__typename === 'TableViz');
|
|
9148
|
+
return visualizations.find((viz) => viz.__typename === 'TableViz');
|
|
9138
9149
|
}
|
|
9139
9150
|
|
|
9140
9151
|
/** Built-in value references. */
|
|
@@ -17481,11 +17492,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17481
17492
|
resetCachedPreauthInfo();
|
|
17482
17493
|
}
|
|
17483
17494
|
|
|
17484
|
-
// eslint-disable-next-line import/no-mutable-exports
|
|
17485
17495
|
let loggedInStatus = false;
|
|
17486
|
-
// eslint-disable-next-line import/no-mutable-exports
|
|
17487
17496
|
let samlAuthWindow = null;
|
|
17488
|
-
// eslint-disable-next-line import/no-mutable-exports
|
|
17489
17497
|
let samlCompletionPromise = null;
|
|
17490
17498
|
let releaseVersion = '';
|
|
17491
17499
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
@@ -18040,8 +18048,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18040
18048
|
});
|
|
18041
18049
|
}
|
|
18042
18050
|
|
|
18043
|
-
/* eslint-disable camelcase */
|
|
18044
|
-
/* eslint-disable import/no-mutable-exports */
|
|
18045
18051
|
/**
|
|
18046
18052
|
* Copyright (c) 2022
|
|
18047
18053
|
*
|
|
@@ -18097,7 +18103,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18097
18103
|
const prefetch = (url, prefetchFeatures, additionalFlags) => {
|
|
18098
18104
|
var _a;
|
|
18099
18105
|
if (url === '') {
|
|
18100
|
-
// eslint-disable-next-line no-console
|
|
18101
18106
|
logger$3.warn('The prefetch method does not have a valid URL');
|
|
18102
18107
|
}
|
|
18103
18108
|
else {
|
|
@@ -18117,9 +18122,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18117
18122
|
iFrame.style.width = '0';
|
|
18118
18123
|
iFrame.style.height = '0';
|
|
18119
18124
|
iFrame.style.border = '0';
|
|
18120
|
-
// Make it 'fixed' to keep it in a different stacking
|
|
18121
|
-
//
|
|
18122
|
-
//
|
|
18125
|
+
// Make it 'fixed' to keep it in a different stacking
|
|
18126
|
+
// context. This should solve the focus behaviours inside
|
|
18127
|
+
// the iframe from interfering with main body.
|
|
18123
18128
|
iFrame.style.position = 'fixed';
|
|
18124
18129
|
// Push it out of viewport.
|
|
18125
18130
|
iFrame.style.top = '100vh';
|
|
@@ -18268,7 +18273,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18268
18273
|
return renderQueue;
|
|
18269
18274
|
}
|
|
18270
18275
|
// Sending an empty function to keep it consistent with the above usage.
|
|
18271
|
-
return fn(() => { });
|
|
18276
|
+
return fn(() => { });
|
|
18272
18277
|
};
|
|
18273
18278
|
/**
|
|
18274
18279
|
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
@@ -18461,10 +18466,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18461
18466
|
const { loginFailedMessage, suppressNoCookieAccessAlert, ignoreNoCookieAccess, suppressErrorAlerts, } = getEmbedConfig();
|
|
18462
18467
|
if (!ignoreNoCookieAccess) {
|
|
18463
18468
|
if (!suppressNoCookieAccessAlert && !suppressErrorAlerts) {
|
|
18464
|
-
// eslint-disable-next-line no-alert
|
|
18465
18469
|
alert(ERROR_MESSAGE.THIRD_PARTY_COOKIE_BLOCKED_ALERT);
|
|
18466
18470
|
}
|
|
18467
|
-
// eslint-disable-next-line no-param-reassign
|
|
18468
18471
|
containerEl.innerHTML = loginFailedMessage;
|
|
18469
18472
|
}
|
|
18470
18473
|
notifyAuthFailure(exports.AuthFailureType.NO_COOKIE_ACCESS);
|
|
@@ -18482,12 +18485,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18482
18485
|
const isTrustedAuth = authType === exports.AuthType.TrustedAuthToken || authType === exports.AuthType.TrustedAuthTokenCookieless;
|
|
18483
18486
|
const isEmbeddedSSOInfoFailure = isEmbeddedSSO && ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.type) === exports.AuthFailureType.UNAUTHENTICATED_FAILURE;
|
|
18484
18487
|
if (autoLogin && isTrustedAuth) {
|
|
18485
|
-
// eslint-disable-next-line no-param-reassign
|
|
18486
18488
|
containerEl.innerHTML = loginFailedMessage;
|
|
18487
18489
|
notifyAuthFailure(exports.AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
18488
18490
|
}
|
|
18489
18491
|
else if (authType !== exports.AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
|
|
18490
|
-
// eslint-disable-next-line no-param-reassign
|
|
18491
18492
|
containerEl.innerHTML = loginFailedMessage;
|
|
18492
18493
|
notifyAuthFailure(exports.AuthFailureType.OTHER);
|
|
18493
18494
|
}
|
|
@@ -18501,7 +18502,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18501
18502
|
*/
|
|
18502
18503
|
function processAuthLogout(e, containerEl) {
|
|
18503
18504
|
const { loginFailedMessage } = getEmbedConfig();
|
|
18504
|
-
// eslint-disable-next-line no-param-reassign
|
|
18505
18505
|
containerEl.innerHTML = loginFailedMessage;
|
|
18506
18506
|
resetCachedAuthToken();
|
|
18507
18507
|
disableAutoLogin();
|
|
@@ -18535,7 +18535,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18535
18535
|
return eventData;
|
|
18536
18536
|
}
|
|
18537
18537
|
|
|
18538
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.
|
|
18538
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.3";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next || echo 'Warning: Coveralls upload failed but not breaking the build.'","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",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.23","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.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":"^11.2.0","@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":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.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:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 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};
|
|
18539
18539
|
|
|
18540
18540
|
class HostEventClient {
|
|
18541
18541
|
constructor(iFrame) {
|
|
@@ -18559,14 +18559,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18559
18559
|
const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
18560
18560
|
if (!response) {
|
|
18561
18561
|
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
18562
|
-
// eslint-disable-next-line no-throw-literal
|
|
18563
18562
|
throw { error };
|
|
18564
18563
|
}
|
|
18565
18564
|
const errors = response.error
|
|
18566
18565
|
|| ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
|
|
18567
18566
|
|| ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
|
|
18568
18567
|
if (errors) {
|
|
18569
|
-
// eslint-disable-next-line no-throw-literal
|
|
18570
18568
|
throw { error: response.error };
|
|
18571
18569
|
}
|
|
18572
18570
|
return { ...response.value };
|
|
@@ -18908,7 +18906,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18908
18906
|
*/
|
|
18909
18907
|
this.updateAuthToken = async (_, responder) => {
|
|
18910
18908
|
const { authType, autoLogin: autoLoginConfig } = this.embedConfig;
|
|
18911
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
18909
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
18910
|
+
// false
|
|
18912
18911
|
const autoLogin = autoLoginConfig !== null && autoLoginConfig !== void 0 ? autoLoginConfig : (authType === exports.AuthType.TrustedAuthTokenCookieless);
|
|
18913
18912
|
try {
|
|
18914
18913
|
await this.refreshAuthTokenForCookieless(responder, exports.EmbedEvent.AuthExpire, false);
|
|
@@ -20813,7 +20812,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20813
20812
|
}
|
|
20814
20813
|
}
|
|
20815
20814
|
|
|
20816
|
-
/* eslint-disable quotes */
|
|
20817
20815
|
const getPreviewQuery = `
|
|
20818
20816
|
query GetEurekaVizSnapshots(
|
|
20819
20817
|
$vizId: String!, $liveboardId: String!) {
|
|
@@ -21099,8 +21097,9 @@ query GetEurekaVizSnapshots(
|
|
|
21099
21097
|
return params;
|
|
21100
21098
|
}
|
|
21101
21099
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
|
|
21102
|
-
// Extract view from liveboardId if passed along with it (legacy
|
|
21103
|
-
// View must be appended as query param at the end, not
|
|
21100
|
+
// Extract view from liveboardId if passed along with it (legacy
|
|
21101
|
+
// approach) View must be appended as query param at the end, not
|
|
21102
|
+
// embedded in path
|
|
21104
21103
|
let liveboardGuid = liveboardId;
|
|
21105
21104
|
let legacyViewId;
|
|
21106
21105
|
if (liveboardId === null || liveboardId === void 0 ? void 0 : liveboardId.includes('?')) {
|
|
@@ -21109,7 +21108,8 @@ query GetEurekaVizSnapshots(
|
|
|
21109
21108
|
const params = new URLSearchParams(query);
|
|
21110
21109
|
legacyViewId = params.get('view') || undefined;
|
|
21111
21110
|
}
|
|
21112
|
-
// personalizedViewId takes precedence over legacyViewId (when passed
|
|
21111
|
+
// personalizedViewId takes precedence over legacyViewId (when passed
|
|
21112
|
+
// as part of liveboardId)
|
|
21113
21113
|
const effectiveViewId = personalizedViewId || legacyViewId;
|
|
21114
21114
|
let suffix = `/embed/viz/${liveboardGuid}`;
|
|
21115
21115
|
if (activeTabId) {
|
|
@@ -22231,7 +22231,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22231
22231
|
* @group Embed components
|
|
22232
22232
|
*/
|
|
22233
22233
|
class SageEmbed extends V1Embed {
|
|
22234
|
-
// eslint-disable-next-line no-useless-constructor
|
|
22235
22234
|
constructor(domSelector, viewConfig) {
|
|
22236
22235
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
22237
22236
|
super(domSelector, viewConfig);
|
|
@@ -22820,6 +22819,144 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22820
22819
|
return result;
|
|
22821
22820
|
};
|
|
22822
22821
|
|
|
22822
|
+
/**
|
|
22823
|
+
* Starts an automatic renderer that watches the DOM for iframes containing
|
|
22824
|
+
* the `tsmcp=true` query parameter and replaces them with fully configured
|
|
22825
|
+
* ThoughtSpot embed iframes. The query parameter is automatically added by
|
|
22826
|
+
* the ThoughtSpot MCP server.
|
|
22827
|
+
*
|
|
22828
|
+
* A {@link MutationObserver} is set up on `document.body` to detect both
|
|
22829
|
+
* directly added iframes and iframes nested within added container elements.
|
|
22830
|
+
* Each matching iframe is replaced in-place with a new ThoughtSpot embed
|
|
22831
|
+
* iframe that merges the original iframe's query parameters with the SDK
|
|
22832
|
+
* embed parameters.
|
|
22833
|
+
*
|
|
22834
|
+
* Call {@link MutationObserver.disconnect | observer.disconnect()} on the
|
|
22835
|
+
* returned observer to stop monitoring the DOM.
|
|
22836
|
+
*
|
|
22837
|
+
* @param viewConfig - Optional configuration for the auto-rendered embeds.
|
|
22838
|
+
* Accepts all properties from {@link AutoMCPFrameRendererViewConfig}.
|
|
22839
|
+
* Defaults to an empty config.
|
|
22840
|
+
* @returns A {@link MutationObserver} instance that is actively observing
|
|
22841
|
+
* `document.body`. Disconnect it when monitoring is no longer needed.
|
|
22842
|
+
*
|
|
22843
|
+
* @example
|
|
22844
|
+
* ```js
|
|
22845
|
+
* import { startAutoMCPFrameRenderer } from '@thoughtspot/visual-embed-sdk';
|
|
22846
|
+
*
|
|
22847
|
+
* // Start watching the DOM for tsmcp iframes
|
|
22848
|
+
* const observer = startAutoMCPFrameRenderer({
|
|
22849
|
+
* // optional view config overrides
|
|
22850
|
+
* });
|
|
22851
|
+
*
|
|
22852
|
+
* // Later, stop watching
|
|
22853
|
+
* observer.disconnect();
|
|
22854
|
+
* ```
|
|
22855
|
+
*
|
|
22856
|
+
* @example
|
|
22857
|
+
* Detailed example of how to use the auto-frame renderer:
|
|
22858
|
+
* [Python React Agent Simple UI](https://github.com/thoughtspot/developer-examples/tree/main/mcp/python-react-agent-simple-ui)
|
|
22859
|
+
*/
|
|
22860
|
+
function startAutoMCPFrameRenderer(viewConfig = {}) {
|
|
22861
|
+
const replaceWithMCPIframe = (iframe) => {
|
|
22862
|
+
const autoMCPFrameRenderer = new AutoFrameRenderer(viewConfig);
|
|
22863
|
+
autoMCPFrameRenderer.replaceIframe(iframe);
|
|
22864
|
+
};
|
|
22865
|
+
const observer = new MutationObserver((mutations) => {
|
|
22866
|
+
for (const mutation of mutations) {
|
|
22867
|
+
for (const node of Array.from(mutation.addedNodes)) {
|
|
22868
|
+
if (node instanceof HTMLIFrameElement && isTSMCPIframe(node)) {
|
|
22869
|
+
replaceWithMCPIframe(node);
|
|
22870
|
+
}
|
|
22871
|
+
if (node instanceof HTMLElement) {
|
|
22872
|
+
node.querySelectorAll('iframe').forEach((iframe) => {
|
|
22873
|
+
if (isTSMCPIframe(iframe)) {
|
|
22874
|
+
replaceWithMCPIframe(iframe);
|
|
22875
|
+
}
|
|
22876
|
+
});
|
|
22877
|
+
}
|
|
22878
|
+
}
|
|
22879
|
+
}
|
|
22880
|
+
});
|
|
22881
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
22882
|
+
return observer;
|
|
22883
|
+
}
|
|
22884
|
+
function isTSMCPIframe(iframe) {
|
|
22885
|
+
try {
|
|
22886
|
+
const url = new URL(iframe.src);
|
|
22887
|
+
return url.searchParams.get(Param.Tsmcp) === 'true';
|
|
22888
|
+
}
|
|
22889
|
+
catch (e) {
|
|
22890
|
+
// The iframe src might not be a valid URL (e.g., 'about:blank').
|
|
22891
|
+
return false;
|
|
22892
|
+
}
|
|
22893
|
+
}
|
|
22894
|
+
/**
|
|
22895
|
+
* Embed component that automatically replaces a plain iframe with a
|
|
22896
|
+
* ThoughtSpot embed iframe. It merges the SDK's embed parameters with
|
|
22897
|
+
* the original iframe's query parameters (stripping the `tsmcp` marker)
|
|
22898
|
+
* and swaps the original iframe element in the DOM.
|
|
22899
|
+
*
|
|
22900
|
+
* This class is used internally by {@link startAutoMCPFrameRenderer} and
|
|
22901
|
+
* is not intended to be instantiated directly.
|
|
22902
|
+
*/
|
|
22903
|
+
class AutoFrameRenderer extends TsEmbed {
|
|
22904
|
+
constructor(viewConfig) {
|
|
22905
|
+
viewConfig.embedComponentType = 'auto-frame-renderer';
|
|
22906
|
+
const container = document.createElement('div');
|
|
22907
|
+
super(container, viewConfig);
|
|
22908
|
+
this.viewConfig = viewConfig;
|
|
22909
|
+
}
|
|
22910
|
+
/**
|
|
22911
|
+
* Builds the final iframe `src` by merging the SDK embed parameters
|
|
22912
|
+
* with the query parameters already present on the source iframe URL.
|
|
22913
|
+
* The `tsmcp` marker param is removed so it does not propagate to the
|
|
22914
|
+
* ThoughtSpot application.
|
|
22915
|
+
*
|
|
22916
|
+
* @param sourceSrc - The original iframe's `src` URL string.
|
|
22917
|
+
* @returns The constructed URL to use for the ThoughtSpot embed iframe.
|
|
22918
|
+
*/
|
|
22919
|
+
getMCPIframeSrc(sourceSrc) {
|
|
22920
|
+
const queryParams = this.getEmbedParamsObject();
|
|
22921
|
+
const sourceURL = new URL(sourceSrc);
|
|
22922
|
+
const existingQueryParams = sourceURL.searchParams;
|
|
22923
|
+
const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
|
|
22924
|
+
delete existingQueryParamsObject[Param.Tsmcp];
|
|
22925
|
+
const mergedQueryParams = { ...queryParams, ...existingQueryParamsObject };
|
|
22926
|
+
const mergedQueryParamsString = getQueryParamString(mergedQueryParams);
|
|
22927
|
+
const frameSrc = `${this.getEmbedBasePath(mergedQueryParamsString)}${sourceURL.hash.replace('#', '')}`;
|
|
22928
|
+
return frameSrc;
|
|
22929
|
+
}
|
|
22930
|
+
/**
|
|
22931
|
+
* Overrides the base insertion behavior so the new embed iframe
|
|
22932
|
+
* replaces the original iframe in-place rather than being appended
|
|
22933
|
+
* to a container element. Falls back to the default behavior when
|
|
22934
|
+
* no iframe has been set for replacement.
|
|
22935
|
+
*/
|
|
22936
|
+
handleInsertionIntoDOM(child) {
|
|
22937
|
+
if (this.frameToReplace) {
|
|
22938
|
+
this.frameToReplace.replaceWith(child);
|
|
22939
|
+
}
|
|
22940
|
+
else {
|
|
22941
|
+
super.handleInsertionIntoDOM(child);
|
|
22942
|
+
}
|
|
22943
|
+
}
|
|
22944
|
+
/**
|
|
22945
|
+
* Replaces the given iframe with a new ThoughtSpot embed iframe.
|
|
22946
|
+
*
|
|
22947
|
+
* The original iframe's `src` is used to derive the embed URL, and
|
|
22948
|
+
* once the new iframe is rendered it takes the original's place in
|
|
22949
|
+
* the DOM tree.
|
|
22950
|
+
*
|
|
22951
|
+
* @param iframe - The existing `<iframe>` element to replace.
|
|
22952
|
+
*/
|
|
22953
|
+
async replaceIframe(iframe) {
|
|
22954
|
+
this.frameToReplace = iframe;
|
|
22955
|
+
const src = this.getMCPIframeSrc(iframe.src);
|
|
22956
|
+
await this.renderIFrame(src);
|
|
22957
|
+
}
|
|
22958
|
+
}
|
|
22959
|
+
|
|
22823
22960
|
const ALIAS = Symbol.for('yaml.alias');
|
|
22824
22961
|
const DOC = Symbol.for('yaml.document');
|
|
22825
22962
|
const MAP = Symbol.for('yaml.map');
|
|
@@ -30245,6 +30382,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
30245
30382
|
exports.prefetch = prefetch;
|
|
30246
30383
|
exports.reloadIframe = reloadIframe;
|
|
30247
30384
|
exports.resetCachedAuthToken = resetCachedAuthToken;
|
|
30385
|
+
exports.startAutoMCPFrameRenderer = startAutoMCPFrameRenderer;
|
|
30248
30386
|
exports.tokenizedFetch = tokenizedFetch;
|
|
30249
30387
|
exports.uploadMixpanelEvent = uploadMixpanelEvent;
|
|
30250
30388
|
|