@thoughtspot/visual-embed-sdk 1.36.0 → 1.36.2
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.map +1 -1
- package/cjs/src/auth.js +2 -1
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/css-variables.d.ts +8 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +2 -2
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +24 -0
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +8 -3
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +54 -0
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +104 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- package/cjs/src/hostEventsTypeMapping.d.ts +2 -0
- package/cjs/src/hostEventsTypeMapping.d.ts.map +1 -0
- package/cjs/src/hostEventsTypeMapping.js +4 -0
- package/cjs/src/hostEventsTypeMapping.js.map +1 -0
- package/cjs/src/types.d.ts +72 -8
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +72 -8
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/embedApi/contracts.d.ts +101 -0
- package/cjs/src/utils/embedApi/contracts.d.ts.map +1 -0
- package/cjs/src/utils/embedApi/contracts.js +17 -0
- package/cjs/src/utils/embedApi/contracts.js.map +1 -0
- package/cjs/src/utils/embedApi/embedApiClient.d.ts +12 -0
- package/cjs/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
- package/cjs/src/utils/embedApi/embedApiClient.js +46 -0
- package/cjs/src/utils/embedApi/embedApiClient.js.map +1 -0
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts +9 -0
- package/cjs/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
- package/cjs/src/utils/embedApi/processEmbedApi.js +18 -0
- package/cjs/src/utils/embedApi/processEmbedApi.js.map +1 -0
- package/cjs/src/utils/resetServices.d.ts +8 -0
- package/cjs/src/utils/resetServices.d.ts.map +1 -0
- package/cjs/src/utils/resetServices.js +18 -0
- package/cjs/src/utils/resetServices.js.map +1 -0
- package/cjs/src/utils/resetServices.spec.d.ts +2 -0
- package/cjs/src/utils/resetServices.spec.d.ts.map +1 -0
- package/cjs/src/utils/resetServices.spec.js +18 -0
- package/cjs/src/utils/resetServices.spec.js.map +1 -0
- package/cjs/src/utils/sessionInfoService.d.ts +14 -2
- package/cjs/src/utils/sessionInfoService.d.ts.map +1 -1
- package/cjs/src/utils/sessionInfoService.js +18 -3
- package/cjs/src/utils/sessionInfoService.js.map +1 -1
- package/dist/{index-V2oBuwy6.js → index-B3hd6DTM.js} +1 -1
- package/dist/index-BBBimG1x.js +7370 -0
- package/dist/index-BGnxP5NY.js +7370 -0
- package/dist/index-CENLvayL.js +7370 -0
- package/dist/index-CR5u7BMC.js +7370 -0
- package/dist/index-CbltIawo.js +7370 -0
- package/dist/index-CoQfqaHj.js +7370 -0
- package/dist/index-CzwzS0P4.js +7370 -0
- package/dist/index-D-9WUCUl.js +7370 -0
- package/dist/index-DFwi_pV_.js +7370 -0
- package/dist/index-DOIjN0N_.js +7370 -0
- package/dist/index-DYBx8SuE.js +7370 -0
- package/dist/index-DaLHJaLd.js +7370 -0
- package/dist/index-DnJX-gN2.js +7370 -0
- package/dist/index-DpuhnTj2.js +7370 -0
- package/dist/index-IDmSUe93.js +7370 -0
- package/dist/index-nWevLycs.js +7370 -0
- package/dist/index-vxW97_xb.js +7370 -0
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +8 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/dist/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/dist/src/hostEventsTypeMapping.d.ts +2 -0
- package/dist/src/hostEventsTypeMapping.d.ts.map +1 -0
- package/dist/src/types.d.ts +72 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/embedApi/contracts.d.ts +101 -0
- package/dist/src/utils/embedApi/contracts.d.ts.map +1 -0
- package/dist/src/utils/embedApi/embedApiClient.d.ts +12 -0
- package/dist/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
- package/dist/src/utils/embedApi/processEmbedApi.d.ts +9 -0
- package/dist/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
- package/dist/src/utils/resetServices.d.ts +8 -0
- package/dist/src/utils/resetServices.d.ts.map +1 -0
- package/dist/src/utils/resetServices.spec.d.ts +2 -0
- package/dist/src/utils/resetServices.spec.d.ts.map +1 -0
- package/dist/src/utils/sessionInfoService.d.ts +14 -2
- package/dist/src/utils/sessionInfoService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +85 -15
- package/dist/tsembed-react.js +84 -14
- package/dist/tsembed.es.js +126 -18
- package/dist/tsembed.js +125 -17
- package/dist/visual-embed-sdk-react-full.d.ts +94 -10
- package/dist/visual-embed-sdk-react.d.ts +94 -10
- package/dist/visual-embed-sdk.d.ts +94 -10
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +3 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/css-variables.d.ts +8 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +2 -2
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +24 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +8 -3
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +54 -0
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +101 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- package/lib/src/hostEventsTypeMapping.d.ts +2 -0
- package/lib/src/hostEventsTypeMapping.d.ts.map +1 -0
- package/lib/src/hostEventsTypeMapping.js +2 -0
- package/lib/src/hostEventsTypeMapping.js.map +1 -0
- package/lib/src/types.d.ts +72 -8
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +72 -8
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/embedApi/contracts.d.ts +101 -0
- package/lib/src/utils/embedApi/contracts.d.ts.map +1 -0
- package/lib/src/utils/embedApi/contracts.js +14 -0
- package/lib/src/utils/embedApi/contracts.js.map +1 -0
- package/lib/src/utils/embedApi/embedApiClient.d.ts +12 -0
- package/lib/src/utils/embedApi/embedApiClient.d.ts.map +1 -0
- package/lib/src/utils/embedApi/embedApiClient.js +42 -0
- package/lib/src/utils/embedApi/embedApiClient.js.map +1 -0
- package/lib/src/utils/embedApi/processEmbedApi.d.ts +9 -0
- package/lib/src/utils/embedApi/processEmbedApi.d.ts.map +1 -0
- package/lib/src/utils/embedApi/processEmbedApi.js +14 -0
- package/lib/src/utils/embedApi/processEmbedApi.js.map +1 -0
- package/lib/src/utils/resetServices.d.ts +8 -0
- package/lib/src/utils/resetServices.d.ts.map +1 -0
- package/lib/src/utils/resetServices.js +14 -0
- package/lib/src/utils/resetServices.js.map +1 -0
- package/lib/src/utils/resetServices.spec.d.ts +2 -0
- package/lib/src/utils/resetServices.spec.d.ts.map +1 -0
- package/lib/src/utils/resetServices.spec.js +15 -0
- package/lib/src/utils/resetServices.spec.js.map +1 -0
- package/lib/src/utils/sessionInfoService.d.ts +14 -2
- package/lib/src/utils/sessionInfoService.d.ts.map +1 -1
- package/lib/src/utils/sessionInfoService.js +16 -2
- package/lib/src/utils/sessionInfoService.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +94 -10
- package/package.json +1 -1
- package/src/auth.ts +3 -2
- package/src/css-variables.ts +10 -0
- package/src/embed/base.spec.ts +26 -0
- package/src/embed/base.ts +2 -2
- package/src/embed/hostEventClient/host-event-client.spec.ts +61 -0
- package/src/embed/hostEventClient/host-event-client.ts +8 -3
- package/src/types.ts +72 -8
- package/src/utils/resetServices.spec.ts +15 -0
- package/src/utils/resetServices.ts +14 -0
- package/src/utils/sessionInfoService.ts +17 -2
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.36.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.36.2 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -1948,16 +1948,63 @@
|
|
|
1948
1948
|
*/
|
|
1949
1949
|
HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
|
|
1950
1950
|
/**
|
|
1951
|
-
* Trigger
|
|
1952
|
-
*
|
|
1953
|
-
*
|
|
1954
|
-
* a
|
|
1951
|
+
* Trigger **Pin** action on an embedded object.
|
|
1952
|
+
* If no parameters are defined, the pin action is triggered
|
|
1953
|
+
* for the Answer that the user is currently on
|
|
1954
|
+
* and a modal opens for Liveboard selection.
|
|
1955
|
+
* To add an Answer or visualization to a Liveboard programmatically without
|
|
1956
|
+
* showing requiring additional user input via *Pin to Liveboard* modal, define
|
|
1957
|
+
* the following parameters:
|
|
1958
|
+
*
|
|
1959
|
+
* @param
|
|
1960
|
+
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1961
|
+
* Optional when pinning a new chart or table generated from a Search query.
|
|
1962
|
+
* @param
|
|
1963
|
+
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
1964
|
+
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
1965
|
+
* @param
|
|
1966
|
+
* `tabId` - GUID of the Liveboard tab. Adds the Answer to the Liveboard tab
|
|
1967
|
+
* specified in the code.
|
|
1968
|
+
* @param
|
|
1969
|
+
* `newVizName` - Name string for the Answer or visualization. If defined,
|
|
1970
|
+
* this parameter adds a new visualization object or creates a copy of the
|
|
1971
|
+
* Answer or visualization specified in `vizId`.
|
|
1972
|
+
* Required attribute.
|
|
1973
|
+
* @param
|
|
1974
|
+
* `newLiveboardName` - Name string for the Liveboard.
|
|
1975
|
+
* Creates a new Liveboard object with the specified name.
|
|
1976
|
+
* @param
|
|
1977
|
+
* `newTabName` - Name of the tab. Adds a new tab Liveboard specified
|
|
1978
|
+
* in the code.
|
|
1979
|
+
*
|
|
1955
1980
|
* @example
|
|
1956
1981
|
* ```js
|
|
1957
|
-
* appEmbed.trigger(HostEvent.Pin
|
|
1982
|
+
* const pinResponse = await appEmbed.trigger(HostEvent.Pin, {
|
|
1983
|
+
* vizId: "123",
|
|
1984
|
+
* newVizName: "Sales by region",
|
|
1985
|
+
* liveboardId: "123",
|
|
1986
|
+
* tabId: "123"
|
|
1987
|
+
* });
|
|
1988
|
+
* ```
|
|
1989
|
+
* @example
|
|
1990
|
+
* ```js
|
|
1991
|
+
* const pinResponse = await appEmbed.trigger(HostEvent.Pin, {
|
|
1992
|
+
* newVizName: "Total sales of Jackets",
|
|
1993
|
+
* liveboardId: "123"
|
|
1994
|
+
* });
|
|
1995
|
+
* ```
|
|
1996
|
+
*
|
|
1997
|
+
* @example
|
|
1998
|
+
* ```js
|
|
1999
|
+
* const pinResponse = await searchEmbed.trigger(HostEvent.Pin, {
|
|
2000
|
+
* newVizName: "Sales by state",
|
|
2001
|
+
* newLiveboardName: "Sales",
|
|
2002
|
+
* newTabName: "Products"
|
|
2003
|
+
* });
|
|
1958
2004
|
* ```
|
|
2005
|
+
* @example
|
|
1959
2006
|
* ```js
|
|
1960
|
-
*
|
|
2007
|
+
* appEmbed.trigger(HostEvent.Pin)
|
|
1961
2008
|
* ```
|
|
1962
2009
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1963
2010
|
*/
|
|
@@ -2613,8 +2660,25 @@
|
|
|
2613
2660
|
*/
|
|
2614
2661
|
HostEvent["InfoSuccess"] = "InfoSuccess";
|
|
2615
2662
|
/**
|
|
2616
|
-
*
|
|
2617
|
-
*
|
|
2663
|
+
* Trigger the save action for an Answer.
|
|
2664
|
+
* To programmatically save an answer without opening the
|
|
2665
|
+
* *Describe your Answer* modal, define the `name` and `description`
|
|
2666
|
+
* properties.
|
|
2667
|
+
* If no parameters are specified, the save action is
|
|
2668
|
+
* triggered with a modal to prompt users to
|
|
2669
|
+
* add a name and description for the Answer.
|
|
2670
|
+
* @param - optional attributes to set Answer properties.
|
|
2671
|
+
* `name` - Name string for the Answer.
|
|
2672
|
+
* `description` - Description text for the Answer.
|
|
2673
|
+
*
|
|
2674
|
+
* @example
|
|
2675
|
+
* ```js
|
|
2676
|
+
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
2677
|
+
* name: "Sales by states",
|
|
2678
|
+
* description: "Total sales by states in MidWest"
|
|
2679
|
+
* });
|
|
2680
|
+
* ```
|
|
2681
|
+
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2618
2682
|
*/
|
|
2619
2683
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2620
2684
|
/**
|
|
@@ -14162,9 +14226,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14162
14226
|
return preauthInfo;
|
|
14163
14227
|
}
|
|
14164
14228
|
/**
|
|
14165
|
-
* Returns the session info object and caches it for future use.
|
|
14229
|
+
* Returns the cached session info object and caches it for future use.
|
|
14166
14230
|
* Once fetched the session info object is cached and returned from the cache on
|
|
14167
14231
|
* subsequent calls.
|
|
14232
|
+
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
14168
14233
|
* @example ```js
|
|
14169
14234
|
* const sessionInfo = await getSessionInfo();
|
|
14170
14235
|
* console.log(sessionInfo);
|
|
@@ -14207,7 +14272,45 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14207
14272
|
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
14208
14273
|
...sessionInfoResp,
|
|
14209
14274
|
};
|
|
14210
|
-
};
|
|
14275
|
+
};
|
|
14276
|
+
/**
|
|
14277
|
+
* Resets the cached session info object and forces a new fetch on the next call.
|
|
14278
|
+
* @example ```js
|
|
14279
|
+
* resetCachedSessionInfo();
|
|
14280
|
+
* const sessionInfo = await getSessionInfo();
|
|
14281
|
+
* console.log(sessionInfo);
|
|
14282
|
+
* ```
|
|
14283
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
14284
|
+
* @returns {void}
|
|
14285
|
+
*/
|
|
14286
|
+
function resetCachedSessionInfo() {
|
|
14287
|
+
sessionInfo = null;
|
|
14288
|
+
}
|
|
14289
|
+
/**
|
|
14290
|
+
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
14291
|
+
* @example ```js
|
|
14292
|
+
* resetCachedPreauthInfo();
|
|
14293
|
+
* const preauthInfo = await getPreauthInfo();
|
|
14294
|
+
* console.log(preauthInfo);
|
|
14295
|
+
* ```
|
|
14296
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
14297
|
+
* @returns {void}
|
|
14298
|
+
*/
|
|
14299
|
+
function resetCachedPreauthInfo() {
|
|
14300
|
+
preauthInfo = null;
|
|
14301
|
+
}
|
|
14302
|
+
|
|
14303
|
+
/**
|
|
14304
|
+
* This function resets all the services that are cached in the SDK.
|
|
14305
|
+
* This is to be called when the user logs out of the application and also
|
|
14306
|
+
* when init is called again.
|
|
14307
|
+
* @version SDK: 1.30.2 | ThoughtSpot: *
|
|
14308
|
+
*/
|
|
14309
|
+
function resetAllCachedServices() {
|
|
14310
|
+
resetCachedAuthToken();
|
|
14311
|
+
resetCachedSessionInfo();
|
|
14312
|
+
resetCachedPreauthInfo();
|
|
14313
|
+
}
|
|
14211
14314
|
|
|
14212
14315
|
// eslint-disable-next-line import/no-mutable-exports
|
|
14213
14316
|
let loggedInStatus = false;
|
|
@@ -14569,7 +14672,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14569
14672
|
const logout$1 = async (embedConfig) => {
|
|
14570
14673
|
const { thoughtSpotHost } = embedConfig;
|
|
14571
14674
|
await fetchLogoutService(thoughtSpotHost);
|
|
14572
|
-
|
|
14675
|
+
resetAllCachedServices();
|
|
14573
14676
|
const thoughtspotIframes = document.querySelectorAll("[data-ts-iframe='true']");
|
|
14574
14677
|
if (thoughtspotIframes === null || thoughtspotIframes === void 0 ? void 0 : thoughtspotIframes.length) {
|
|
14575
14678
|
thoughtspotIframes.forEach((el) => {
|
|
@@ -14734,7 +14837,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14734
14837
|
const init = (embedConfig) => {
|
|
14735
14838
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
14736
14839
|
sanity(embedConfig);
|
|
14737
|
-
|
|
14840
|
+
resetAllCachedServices();
|
|
14738
14841
|
embedConfig = setEmbedConfig(backwardCompat({
|
|
14739
14842
|
...CONFIG_DEFAULTS,
|
|
14740
14843
|
...embedConfig,
|
|
@@ -15027,7 +15130,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15027
15130
|
return e;
|
|
15028
15131
|
}
|
|
15029
15132
|
|
|
15030
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.
|
|
15133
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","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",docgen:"typedoc --tsconfig tsconfig.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 | 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",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3",lodash:"^4.17.21","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":"^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/lodash":"^4.17.0","@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",crypto:"^1.0.1","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","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"6.3.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:"4.24.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",vite:"^5.3.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$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 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};
|
|
15031
15134
|
|
|
15032
15135
|
/**
|
|
15033
15136
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15149,15 +15252,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15149
15252
|
return res;
|
|
15150
15253
|
}
|
|
15151
15254
|
async handlePinEvent(payload) {
|
|
15255
|
+
var _a, _b;
|
|
15152
15256
|
if (!payload || !('newVizName' in payload)) {
|
|
15153
15257
|
return this.hostEventFallback(exports.HostEvent.Pin, payload);
|
|
15154
15258
|
}
|
|
15155
15259
|
const formattedPayload = {
|
|
15156
15260
|
...payload,
|
|
15157
|
-
pinboardId: payload.liveboardId,
|
|
15158
|
-
newPinboardName: payload.newLiveboardName,
|
|
15261
|
+
pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
|
|
15262
|
+
newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
|
|
15263
|
+
};
|
|
15264
|
+
const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
|
|
15265
|
+
return {
|
|
15266
|
+
...data,
|
|
15267
|
+
liveboardId: data.pinboardId,
|
|
15159
15268
|
};
|
|
15160
|
-
return this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
|
|
15161
15269
|
}
|
|
15162
15270
|
async handleSaveAnswerEvent(payload) {
|
|
15163
15271
|
var _a, _b, _c, _d;
|
|
@@ -2245,9 +2245,10 @@ export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<Preaut
|
|
|
2245
2245
|
*/
|
|
2246
2246
|
export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
|
|
2247
2247
|
/**
|
|
2248
|
-
* Returns the session info object and caches it for future use.
|
|
2248
|
+
* Returns the cached session info object and caches it for future use.
|
|
2249
2249
|
* Once fetched the session info object is cached and returned from the cache on
|
|
2250
2250
|
* subsequent calls.
|
|
2251
|
+
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
2251
2252
|
* @example ```js
|
|
2252
2253
|
* const sessionInfo = await getSessionInfo();
|
|
2253
2254
|
* console.log(sessionInfo);
|
|
@@ -2290,10 +2291,21 @@ export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
|
2290
2291
|
* const sessionInfo = await getSessionInfo();
|
|
2291
2292
|
* console.log(sessionInfo);
|
|
2292
2293
|
* ```
|
|
2293
|
-
* @version SDK: 1.28.3 | ThoughtSpot
|
|
2294
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2294
2295
|
* @returns {void}
|
|
2295
2296
|
*/
|
|
2296
2297
|
export declare function resetCachedSessionInfo(): void;
|
|
2298
|
+
/**
|
|
2299
|
+
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
2300
|
+
* @example ```js
|
|
2301
|
+
* resetCachedPreauthInfo();
|
|
2302
|
+
* const preauthInfo = await getPreauthInfo();
|
|
2303
|
+
* console.log(preauthInfo);
|
|
2304
|
+
* ```
|
|
2305
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
2306
|
+
* @returns {void}
|
|
2307
|
+
*/
|
|
2308
|
+
export declare function resetCachedPreauthInfo(): void;
|
|
2297
2309
|
|
|
2298
2310
|
/**
|
|
2299
2311
|
* Copyright (c) 2023
|
|
@@ -4858,16 +4870,63 @@ export declare enum HostEvent {
|
|
|
4858
4870
|
*/
|
|
4859
4871
|
getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
|
|
4860
4872
|
/**
|
|
4861
|
-
* Trigger
|
|
4862
|
-
*
|
|
4863
|
-
*
|
|
4864
|
-
* a
|
|
4873
|
+
* Trigger **Pin** action on an embedded object.
|
|
4874
|
+
* If no parameters are defined, the pin action is triggered
|
|
4875
|
+
* for the Answer that the user is currently on
|
|
4876
|
+
* and a modal opens for Liveboard selection.
|
|
4877
|
+
* To add an Answer or visualization to a Liveboard programmatically without
|
|
4878
|
+
* showing requiring additional user input via *Pin to Liveboard* modal, define
|
|
4879
|
+
* the following parameters:
|
|
4880
|
+
*
|
|
4881
|
+
* @param
|
|
4882
|
+
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
4883
|
+
* Optional when pinning a new chart or table generated from a Search query.
|
|
4884
|
+
* @param
|
|
4885
|
+
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
4886
|
+
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
4887
|
+
* @param
|
|
4888
|
+
* `tabId` - GUID of the Liveboard tab. Adds the Answer to the Liveboard tab
|
|
4889
|
+
* specified in the code.
|
|
4890
|
+
* @param
|
|
4891
|
+
* `newVizName` - Name string for the Answer or visualization. If defined,
|
|
4892
|
+
* this parameter adds a new visualization object or creates a copy of the
|
|
4893
|
+
* Answer or visualization specified in `vizId`.
|
|
4894
|
+
* Required attribute.
|
|
4895
|
+
* @param
|
|
4896
|
+
* `newLiveboardName` - Name string for the Liveboard.
|
|
4897
|
+
* Creates a new Liveboard object with the specified name.
|
|
4898
|
+
* @param
|
|
4899
|
+
* `newTabName` - Name of the tab. Adds a new tab Liveboard specified
|
|
4900
|
+
* in the code.
|
|
4901
|
+
*
|
|
4865
4902
|
* @example
|
|
4866
4903
|
* ```js
|
|
4867
|
-
* appEmbed.trigger(HostEvent.Pin
|
|
4904
|
+
* const pinResponse = await appEmbed.trigger(HostEvent.Pin, {
|
|
4905
|
+
* vizId: "123",
|
|
4906
|
+
* newVizName: "Sales by region",
|
|
4907
|
+
* liveboardId: "123",
|
|
4908
|
+
* tabId: "123"
|
|
4909
|
+
* });
|
|
4868
4910
|
* ```
|
|
4911
|
+
* @example
|
|
4869
4912
|
* ```js
|
|
4870
|
-
*
|
|
4913
|
+
* const pinResponse = await appEmbed.trigger(HostEvent.Pin, {
|
|
4914
|
+
* newVizName: "Total sales of Jackets",
|
|
4915
|
+
* liveboardId: "123"
|
|
4916
|
+
* });
|
|
4917
|
+
* ```
|
|
4918
|
+
*
|
|
4919
|
+
* @example
|
|
4920
|
+
* ```js
|
|
4921
|
+
* const pinResponse = await searchEmbed.trigger(HostEvent.Pin, {
|
|
4922
|
+
* newVizName: "Sales by state",
|
|
4923
|
+
* newLiveboardName: "Sales",
|
|
4924
|
+
* newTabName: "Products"
|
|
4925
|
+
* });
|
|
4926
|
+
* ```
|
|
4927
|
+
* @example
|
|
4928
|
+
* ```js
|
|
4929
|
+
* appEmbed.trigger(HostEvent.Pin)
|
|
4871
4930
|
* ```
|
|
4872
4931
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
4873
4932
|
*/
|
|
@@ -5523,8 +5582,25 @@ export declare enum HostEvent {
|
|
|
5523
5582
|
*/
|
|
5524
5583
|
InfoSuccess = "InfoSuccess",
|
|
5525
5584
|
/**
|
|
5526
|
-
*
|
|
5527
|
-
*
|
|
5585
|
+
* Trigger the save action for an Answer.
|
|
5586
|
+
* To programmatically save an answer without opening the
|
|
5587
|
+
* *Describe your Answer* modal, define the `name` and `description`
|
|
5588
|
+
* properties.
|
|
5589
|
+
* If no parameters are specified, the save action is
|
|
5590
|
+
* triggered with a modal to prompt users to
|
|
5591
|
+
* add a name and description for the Answer.
|
|
5592
|
+
* @param - optional attributes to set Answer properties.
|
|
5593
|
+
* `name` - Name string for the Answer.
|
|
5594
|
+
* `description` - Description text for the Answer.
|
|
5595
|
+
*
|
|
5596
|
+
* @example
|
|
5597
|
+
* ```js
|
|
5598
|
+
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
5599
|
+
* name: "Sales by states",
|
|
5600
|
+
* description: "Total sales by states in MidWest"
|
|
5601
|
+
* });
|
|
5602
|
+
* ```
|
|
5603
|
+
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
5528
5604
|
*/
|
|
5529
5605
|
SaveAnswer = "saveAnswer",
|
|
5530
5606
|
/**
|
|
@@ -7107,6 +7183,14 @@ export interface CustomCssVariables {
|
|
|
7107
7183
|
* panel.
|
|
7108
7184
|
*/
|
|
7109
7185
|
'--ts-var-search-auto-complete-subtext-font-color'?: string;
|
|
7186
|
+
/**
|
|
7187
|
+
* Background color of the input box in the Spotter page.
|
|
7188
|
+
*/
|
|
7189
|
+
'--ts-var-spotter-input-background'?: string;
|
|
7190
|
+
/**
|
|
7191
|
+
* Background color of the previously asked prompt message in the Spotter page.
|
|
7192
|
+
*/
|
|
7193
|
+
'--ts-var-spotter-prompt-background': string;
|
|
7110
7194
|
/**
|
|
7111
7195
|
* Background color of the data panel.
|
|
7112
7196
|
*/
|
|
@@ -4414,16 +4414,63 @@ export declare enum HostEvent {
|
|
|
4414
4414
|
*/
|
|
4415
4415
|
getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
|
|
4416
4416
|
/**
|
|
4417
|
-
* Trigger
|
|
4418
|
-
*
|
|
4419
|
-
*
|
|
4420
|
-
* a
|
|
4417
|
+
* Trigger **Pin** action on an embedded object.
|
|
4418
|
+
* If no parameters are defined, the pin action is triggered
|
|
4419
|
+
* for the Answer that the user is currently on
|
|
4420
|
+
* and a modal opens for Liveboard selection.
|
|
4421
|
+
* To add an Answer or visualization to a Liveboard programmatically without
|
|
4422
|
+
* showing requiring additional user input via *Pin to Liveboard* modal, define
|
|
4423
|
+
* the following parameters:
|
|
4424
|
+
*
|
|
4425
|
+
* @param
|
|
4426
|
+
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
4427
|
+
* Optional when pinning a new chart or table generated from a Search query.
|
|
4428
|
+
* @param
|
|
4429
|
+
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
4430
|
+
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
4431
|
+
* @param
|
|
4432
|
+
* `tabId` - GUID of the Liveboard tab. Adds the Answer to the Liveboard tab
|
|
4433
|
+
* specified in the code.
|
|
4434
|
+
* @param
|
|
4435
|
+
* `newVizName` - Name string for the Answer or visualization. If defined,
|
|
4436
|
+
* this parameter adds a new visualization object or creates a copy of the
|
|
4437
|
+
* Answer or visualization specified in `vizId`.
|
|
4438
|
+
* Required attribute.
|
|
4439
|
+
* @param
|
|
4440
|
+
* `newLiveboardName` - Name string for the Liveboard.
|
|
4441
|
+
* Creates a new Liveboard object with the specified name.
|
|
4442
|
+
* @param
|
|
4443
|
+
* `newTabName` - Name of the tab. Adds a new tab Liveboard specified
|
|
4444
|
+
* in the code.
|
|
4445
|
+
*
|
|
4421
4446
|
* @example
|
|
4422
4447
|
* ```js
|
|
4423
|
-
* appEmbed.trigger(HostEvent.Pin
|
|
4448
|
+
* const pinResponse = await appEmbed.trigger(HostEvent.Pin, {
|
|
4449
|
+
* vizId: "123",
|
|
4450
|
+
* newVizName: "Sales by region",
|
|
4451
|
+
* liveboardId: "123",
|
|
4452
|
+
* tabId: "123"
|
|
4453
|
+
* });
|
|
4454
|
+
* ```
|
|
4455
|
+
* @example
|
|
4456
|
+
* ```js
|
|
4457
|
+
* const pinResponse = await appEmbed.trigger(HostEvent.Pin, {
|
|
4458
|
+
* newVizName: "Total sales of Jackets",
|
|
4459
|
+
* liveboardId: "123"
|
|
4460
|
+
* });
|
|
4461
|
+
* ```
|
|
4462
|
+
*
|
|
4463
|
+
* @example
|
|
4464
|
+
* ```js
|
|
4465
|
+
* const pinResponse = await searchEmbed.trigger(HostEvent.Pin, {
|
|
4466
|
+
* newVizName: "Sales by state",
|
|
4467
|
+
* newLiveboardName: "Sales",
|
|
4468
|
+
* newTabName: "Products"
|
|
4469
|
+
* });
|
|
4424
4470
|
* ```
|
|
4471
|
+
* @example
|
|
4425
4472
|
* ```js
|
|
4426
|
-
*
|
|
4473
|
+
* appEmbed.trigger(HostEvent.Pin)
|
|
4427
4474
|
* ```
|
|
4428
4475
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
4429
4476
|
*/
|
|
@@ -5079,8 +5126,25 @@ export declare enum HostEvent {
|
|
|
5079
5126
|
*/
|
|
5080
5127
|
InfoSuccess = "InfoSuccess",
|
|
5081
5128
|
/**
|
|
5082
|
-
*
|
|
5083
|
-
*
|
|
5129
|
+
* Trigger the save action for an Answer.
|
|
5130
|
+
* To programmatically save an answer without opening the
|
|
5131
|
+
* *Describe your Answer* modal, define the `name` and `description`
|
|
5132
|
+
* properties.
|
|
5133
|
+
* If no parameters are specified, the save action is
|
|
5134
|
+
* triggered with a modal to prompt users to
|
|
5135
|
+
* add a name and description for the Answer.
|
|
5136
|
+
* @param - optional attributes to set Answer properties.
|
|
5137
|
+
* `name` - Name string for the Answer.
|
|
5138
|
+
* `description` - Description text for the Answer.
|
|
5139
|
+
*
|
|
5140
|
+
* @example
|
|
5141
|
+
* ```js
|
|
5142
|
+
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
5143
|
+
* name: "Sales by states",
|
|
5144
|
+
* description: "Total sales by states in MidWest"
|
|
5145
|
+
* });
|
|
5146
|
+
* ```
|
|
5147
|
+
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
5084
5148
|
*/
|
|
5085
5149
|
SaveAnswer = "saveAnswer",
|
|
5086
5150
|
/**
|
|
@@ -7350,9 +7414,10 @@ export declare const formatPreauthInfo: (preauthInfoResp: any) => Promise<Preaut
|
|
|
7350
7414
|
*/
|
|
7351
7415
|
export declare function getPreauthInfo(allowCache?: boolean): Promise<PreauthInfo>;
|
|
7352
7416
|
/**
|
|
7353
|
-
* Returns the session info object and caches it for future use.
|
|
7417
|
+
* Returns the cached session info object and caches it for future use.
|
|
7354
7418
|
* Once fetched the session info object is cached and returned from the cache on
|
|
7355
7419
|
* subsequent calls.
|
|
7420
|
+
* This cache is cleared when inti is called OR resetCachedSessionInfo is called.
|
|
7356
7421
|
* @example ```js
|
|
7357
7422
|
* const sessionInfo = await getSessionInfo();
|
|
7358
7423
|
* console.log(sessionInfo);
|
|
@@ -7395,10 +7460,21 @@ export declare const getSessionDetails: (sessionInfoResp: any) => SessionInfo;
|
|
|
7395
7460
|
* const sessionInfo = await getSessionInfo();
|
|
7396
7461
|
* console.log(sessionInfo);
|
|
7397
7462
|
* ```
|
|
7398
|
-
* @version SDK: 1.28.3 | ThoughtSpot
|
|
7463
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7399
7464
|
* @returns {void}
|
|
7400
7465
|
*/
|
|
7401
7466
|
export declare function resetCachedSessionInfo(): void;
|
|
7467
|
+
/**
|
|
7468
|
+
* Resets the cached preauth info object and forces a new fetch on the next call.
|
|
7469
|
+
* @example ```js
|
|
7470
|
+
* resetCachedPreauthInfo();
|
|
7471
|
+
* const preauthInfo = await getPreauthInfo();
|
|
7472
|
+
* console.log(preauthInfo);
|
|
7473
|
+
* ```
|
|
7474
|
+
* @version SDK: 1.28.3 | ThoughtSpot: *
|
|
7475
|
+
* @returns {void}
|
|
7476
|
+
*/
|
|
7477
|
+
export declare function resetCachedPreauthInfo(): void;
|
|
7402
7478
|
|
|
7403
7479
|
/**
|
|
7404
7480
|
* The list of customization css variables. These
|
|
@@ -7493,6 +7569,14 @@ export interface CustomCssVariables {
|
|
|
7493
7569
|
* panel.
|
|
7494
7570
|
*/
|
|
7495
7571
|
'--ts-var-search-auto-complete-subtext-font-color'?: string;
|
|
7572
|
+
/**
|
|
7573
|
+
* Background color of the input box in the Spotter page.
|
|
7574
|
+
*/
|
|
7575
|
+
'--ts-var-spotter-input-background'?: string;
|
|
7576
|
+
/**
|
|
7577
|
+
* Background color of the previously asked prompt message in the Spotter page.
|
|
7578
|
+
*/
|
|
7579
|
+
'--ts-var-spotter-prompt-background': string;
|
|
7496
7580
|
/**
|
|
7497
7581
|
* Background color of the data panel.
|
|
7498
7582
|
*/
|