@thoughtspot/visual-embed-sdk 1.24.0-dev → 1.24.0-preRender.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 +2 -3
- package/cjs/src/embed/TsEmbed.d.ts +302 -0
- package/cjs/src/embed/TsEmbed.d.ts.map +1 -0
- package/cjs/src/embed/TsEmbed.js +851 -0
- package/cjs/src/embed/TsEmbed.js.map +1 -0
- package/cjs/src/embed/app.d.ts +4 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +9 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/base.d.ts +2 -0
- 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/liveboard.d.ts +3 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +6 -5
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +4 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +9 -2
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +1 -0
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +5 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +10 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +14 -7
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +94 -63
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +47 -0
- 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/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +2 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +1 -0
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +5 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +8 -8
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +60 -19
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +7 -13
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +5 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.js +80 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -0
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +61 -0
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -0
- package/cjs/src/utils/graphql/answerService/answerService.js +182 -0
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.d.ts +2 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.d.ts.map +1 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +201 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -0
- package/cjs/src/utils/graphql/graphql-request.d.ts +15 -0
- package/cjs/src/utils/graphql/graphql-request.d.ts.map +1 -0
- package/cjs/src/utils/graphql/graphql-request.js +40 -0
- package/cjs/src/utils/graphql/graphql-request.js.map +1 -0
- package/cjs/src/utils/graphql/sourceService.d.ts +8 -0
- package/cjs/src/utils/graphql/sourceService.d.ts.map +1 -0
- package/cjs/src/utils/graphql/sourceService.js +69 -0
- package/cjs/src/utils/graphql/sourceService.js.map +1 -0
- package/cjs/src/utils/graphql/sourceService.spec.d.ts +2 -0
- package/cjs/src/utils/graphql/sourceService.spec.d.ts.map +1 -0
- package/cjs/src/utils/graphql/sourceService.spec.js +12 -0
- package/cjs/src/utils/graphql/sourceService.spec.js.map +1 -0
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +7 -11
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +13 -17
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +6 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +26 -1
- package/cjs/src/utils.js.map +1 -1
- package/dist/src/embed/app.d.ts +4 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +2 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +3 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +4 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +5 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +14 -7
- 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/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +5 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +60 -19
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts +5 -0
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -0
- package/dist/src/utils/graphql/answerService/answerService.d.ts +61 -0
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -0
- package/dist/src/utils/graphql/answerService/answerService.spec.d.ts +2 -0
- package/dist/src/utils/graphql/answerService/answerService.spec.d.ts.map +1 -0
- package/dist/src/utils/graphql/graphql-request.d.ts +15 -0
- package/dist/src/utils/graphql/graphql-request.d.ts.map +1 -0
- package/dist/src/utils/graphql/sourceService.d.ts +8 -0
- package/dist/src/utils/graphql/sourceService.d.ts.map +1 -0
- package/dist/src/utils/graphql/sourceService.spec.d.ts +2 -0
- package/dist/src/utils/graphql/sourceService.spec.d.ts.map +1 -0
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils.d.ts +6 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +513 -150
- package/dist/tsembed-react.js +516 -149
- package/dist/tsembed.es.js +556 -146
- package/dist/tsembed.js +556 -145
- package/dist/visual-embed-sdk-react-full.d.ts +152 -33
- package/dist/visual-embed-sdk-react.d.ts +152 -33
- package/dist/visual-embed-sdk.d.ts +147 -32
- package/lib/package.json +2 -3
- package/lib/src/embed/TsEmbed.d.ts +302 -0
- package/lib/src/embed/TsEmbed.d.ts.map +1 -0
- package/lib/src/embed/TsEmbed.js +847 -0
- package/lib/src/embed/TsEmbed.js.map +1 -0
- package/lib/src/embed/app.d.ts +4 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +9 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/base.d.ts +2 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +2 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +3 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -5
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/sage.d.ts +4 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +9 -2
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +1 -0
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +5 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +10 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +14 -7
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +94 -63
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +47 -0
- 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 +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +2 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +1 -0
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +5 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +7 -7
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +60 -19
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +6 -12
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts +5 -0
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js +77 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -0
- package/lib/src/utils/graphql/answerService/answerService.d.ts +61 -0
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -0
- package/lib/src/utils/graphql/answerService/answerService.js +177 -0
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.d.ts +2 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.d.ts.map +1 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.js +199 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -0
- package/lib/src/utils/graphql/graphql-request.d.ts +15 -0
- package/lib/src/utils/graphql/graphql-request.d.ts.map +1 -0
- package/lib/src/utils/graphql/graphql-request.js +36 -0
- package/lib/src/utils/graphql/graphql-request.js.map +1 -0
- package/lib/src/utils/graphql/sourceService.d.ts +8 -0
- package/lib/src/utils/graphql/sourceService.d.ts.map +1 -0
- package/lib/src/utils/graphql/sourceService.js +65 -0
- package/lib/src/utils/graphql/sourceService.js.map +1 -0
- package/lib/src/utils/graphql/sourceService.spec.d.ts +2 -0
- package/lib/src/utils/graphql/sourceService.spec.d.ts.map +1 -0
- package/lib/src/utils/graphql/sourceService.spec.js +10 -0
- package/lib/src/utils/graphql/sourceService.spec.js.map +1 -0
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -12
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +14 -18
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils.d.ts +6 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +23 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +153 -33
- package/package.json +2 -3
- package/src/embed/app.ts +13 -6
- package/src/embed/base.ts +2 -0
- package/src/embed/liveboard.ts +7 -5
- package/src/embed/sage.ts +13 -2
- package/src/embed/search-bar.tsx +2 -0
- package/src/embed/search.ts +14 -2
- package/src/embed/ts-embed.spec.ts +49 -0
- package/src/embed/ts-embed.ts +116 -64
- package/src/index.ts +5 -0
- package/src/mixpanel-service.spec.ts +1 -0
- package/src/mixpanel-service.ts +1 -0
- package/src/react/index.tsx +50 -45
- package/src/types.ts +64 -21
- package/src/utils/graphql/answerService/answer-queries.ts +80 -0
- package/src/utils/graphql/answerService/answerService.spec.ts +231 -0
- package/src/utils/graphql/answerService/answerService.ts +234 -0
- package/src/utils/graphql/graphql-request.ts +45 -0
- package/src/utils/graphql/sourceService.spec.ts +10 -0
- package/src/utils/graphql/sourceService.ts +71 -0
- package/src/utils/processData.spec.ts +15 -25
- package/src/utils/processData.ts +13 -15
- package/src/utils.ts +24 -0
- package/src/utils/answerService.spec.ts +0 -41
- package/src/utils/answerService.ts +0 -63
|
@@ -13,7 +13,7 @@ import EventEmitter from 'eventemitter3';
|
|
|
13
13
|
* @summary ThoughtSpot Visual Embed SDK
|
|
14
14
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
15
15
|
*/
|
|
16
|
-
export { init, logout, prefetch, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, };
|
|
16
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, };
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Copyright (c) 2022
|
|
@@ -172,6 +172,7 @@ export interface AppViewConfig extends ViewConfig {
|
|
|
172
172
|
*/
|
|
173
173
|
export class AppEmbed extends V1Embed {
|
|
174
174
|
protected viewConfig: AppViewConfig;
|
|
175
|
+
protected embedComponentType: string;
|
|
175
176
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
|
|
176
177
|
/**
|
|
177
178
|
* Constructs a map of parameters to be passed on to the
|
|
@@ -203,8 +204,10 @@ export class AppEmbed extends V1Embed {
|
|
|
203
204
|
*
|
|
204
205
|
* @param renderOptions An object containing the page ID
|
|
205
206
|
* to be embedded.
|
|
207
|
+
* @param showPreRenderByDefault
|
|
206
208
|
*/
|
|
207
|
-
render(): AppEmbed;
|
|
209
|
+
render(showPreRenderByDefault?: boolean): AppEmbed;
|
|
210
|
+
preRender(showPreRenderByDefault?: boolean): AppEmbed;
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
export interface executeTMLInput {
|
|
@@ -298,6 +301,7 @@ export const renderInQueue: (fn: (next?: (val?: any) => void) => Promise<any>) =
|
|
|
298
301
|
*
|
|
299
302
|
* @param data
|
|
300
303
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
304
|
+
* @group Global methods
|
|
301
305
|
*/
|
|
302
306
|
export const executeTML: (data: executeTMLInput) => Promise<any>;
|
|
303
307
|
/**
|
|
@@ -306,6 +310,7 @@ export const executeTML: (data: executeTMLInput) => Promise<any>;
|
|
|
306
310
|
*
|
|
307
311
|
* @param data
|
|
308
312
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
313
|
+
* @group Global methods
|
|
309
314
|
*/
|
|
310
315
|
export const exportTML: (data: exportTMLInput) => Promise<any>;
|
|
311
316
|
/**
|
|
@@ -427,6 +432,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
427
432
|
*/
|
|
428
433
|
export class LiveboardEmbed extends V1Embed {
|
|
429
434
|
protected viewConfig: LiveboardViewConfig;
|
|
435
|
+
protected embedComponentType: string;
|
|
430
436
|
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
|
|
431
437
|
/**
|
|
432
438
|
* Construct a map of params to be passed on to the
|
|
@@ -446,8 +452,8 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
446
452
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
447
453
|
* visualization ID and the runtime filters.
|
|
448
454
|
*/
|
|
449
|
-
render(): LiveboardEmbed;
|
|
450
|
-
preRender(): LiveboardEmbed;
|
|
455
|
+
render(showPreRenderByDefault?: boolean): LiveboardEmbed;
|
|
456
|
+
preRender(showPreRenderByDefault?: boolean): LiveboardEmbed;
|
|
451
457
|
navigateToLiveboard(liveboardId: string, vizId?: string, activeTabId?: string): void;
|
|
452
458
|
}
|
|
453
459
|
/**
|
|
@@ -575,12 +581,16 @@ export class SearchEmbed extends TsEmbed {
|
|
|
575
581
|
* The view configuration for the embedded ThoughtSpot search.
|
|
576
582
|
*/
|
|
577
583
|
protected viewConfig: SearchViewConfig;
|
|
584
|
+
protected embedComponentType: string;
|
|
578
585
|
constructor(domSelector: DOMSelector, viewConfig: SearchViewConfig);
|
|
579
586
|
protected getEmbedParams(): string;
|
|
580
587
|
/**
|
|
581
588
|
* Render the embedded ThoughtSpot search
|
|
589
|
+
*
|
|
590
|
+
* @param showPreRenderByDefault
|
|
582
591
|
*/
|
|
583
|
-
render(): SearchEmbed;
|
|
592
|
+
render(showPreRenderByDefault?: boolean): SearchEmbed;
|
|
593
|
+
preRender(showPreRenderByDefault?: boolean): SearchEmbed;
|
|
584
594
|
}
|
|
585
595
|
|
|
586
596
|
/**
|
|
@@ -622,6 +632,7 @@ export class SearchBarEmbed extends TsEmbed {
|
|
|
622
632
|
* The view configuration for the embedded ThoughtSpot search bar.
|
|
623
633
|
*/
|
|
624
634
|
protected viewConfig: SearchBarViewConfig;
|
|
635
|
+
protected embedComponentType: string;
|
|
625
636
|
constructor(domSelector: string, viewConfig: SearchBarViewConfig);
|
|
626
637
|
/**
|
|
627
638
|
* Render the embedded ThoughtSpot search
|
|
@@ -1543,6 +1554,13 @@ export interface ViewConfig {
|
|
|
1543
1554
|
* @version SDK: 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1544
1555
|
*/
|
|
1545
1556
|
hiddenHomepageModules?: HomepageModule[];
|
|
1557
|
+
/**
|
|
1558
|
+
* reordering the home page modules
|
|
1559
|
+
* eg: reorderedHomepageModules = [HomepageModule.MyLibrary, HomepageModule.Watchlist]
|
|
1560
|
+
*
|
|
1561
|
+
* @version SDK: 1.28.0 | Thoughtspot: 9.9.0.cl
|
|
1562
|
+
*/
|
|
1563
|
+
reorderedHomepageModules?: HomepageModule[];
|
|
1546
1564
|
/**
|
|
1547
1565
|
* The list of tab IDs to show in the embedded.
|
|
1548
1566
|
* Only this Tabs will be shown in their respective LBs.
|
|
@@ -1572,7 +1590,19 @@ export interface ViewConfig {
|
|
|
1572
1590
|
*/
|
|
1573
1591
|
hiddenHomeLeftNavItems?: HomeLeftNavItem[];
|
|
1574
1592
|
/**
|
|
1575
|
-
*
|
|
1593
|
+
* PreRender id to be used for PreRendering the embed.
|
|
1594
|
+
* Use PreRender to render the embed in the background and then
|
|
1595
|
+
* show or hide the rendered embed using showPreRender or hidePreRender respectively.
|
|
1596
|
+
*
|
|
1597
|
+
* @example
|
|
1598
|
+
* ```js
|
|
1599
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
1600
|
+
* ... // other liveboard view config
|
|
1601
|
+
* preRenderId: "preRenderId-123"
|
|
1602
|
+
* });
|
|
1603
|
+
* embed.showPreRender();
|
|
1604
|
+
* ```
|
|
1605
|
+
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
|
|
1576
1606
|
*/
|
|
1577
1607
|
preRenderId?: string;
|
|
1578
1608
|
}
|
|
@@ -1693,27 +1723,27 @@ export enum HomepageModule {
|
|
|
1693
1723
|
/**
|
|
1694
1724
|
* Search bar
|
|
1695
1725
|
*/
|
|
1696
|
-
Search = "
|
|
1726
|
+
Search = "SEARCH",
|
|
1697
1727
|
/**
|
|
1698
1728
|
* kPI watchlist module
|
|
1699
1729
|
*/
|
|
1700
|
-
Watchlist = "
|
|
1730
|
+
Watchlist = "WATCHLIST",
|
|
1701
1731
|
/**
|
|
1702
1732
|
* favorite objects
|
|
1703
1733
|
*/
|
|
1704
|
-
Favorite = "
|
|
1734
|
+
Favorite = "FAVORITE",
|
|
1705
1735
|
/**
|
|
1706
1736
|
* List of answers and liveboards
|
|
1707
1737
|
*/
|
|
1708
|
-
MyLibrary = "
|
|
1738
|
+
MyLibrary = "MY_LIBRARY",
|
|
1709
1739
|
/**
|
|
1710
1740
|
* Trending list
|
|
1711
1741
|
*/
|
|
1712
|
-
Trending = "
|
|
1742
|
+
Trending = "TRENDING",
|
|
1713
1743
|
/**
|
|
1714
1744
|
* Learning videos
|
|
1715
1745
|
*/
|
|
1716
|
-
Learning = "
|
|
1746
|
+
Learning = "LEARNING"
|
|
1717
1747
|
}
|
|
1718
1748
|
/**
|
|
1719
1749
|
* A filter that can be applied to ThoughtSpot answers, Liveboards, or
|
|
@@ -3884,18 +3914,6 @@ export enum Action {
|
|
|
3884
3914
|
*/
|
|
3885
3915
|
PersonalisedViewsDropdown = "personalisedViewsDropdown"
|
|
3886
3916
|
}
|
|
3887
|
-
export interface SessionInterface {
|
|
3888
|
-
sessionId: string;
|
|
3889
|
-
genNo: number;
|
|
3890
|
-
acSession: {
|
|
3891
|
-
sessionId: string;
|
|
3892
|
-
genNo: number;
|
|
3893
|
-
};
|
|
3894
|
-
}
|
|
3895
|
-
export enum OperationType {
|
|
3896
|
-
GetChartWithData = "GetChartWithData",
|
|
3897
|
-
GetTableWithHeadlineData = "GetTableWithHeadlineData"
|
|
3898
|
-
}
|
|
3899
3917
|
export interface AnswerServiceType {
|
|
3900
3918
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
3901
3919
|
}
|
|
@@ -3912,6 +3930,39 @@ export enum ContextMenuTriggerOptions {
|
|
|
3912
3930
|
LEFT_CLICK = "left-click",
|
|
3913
3931
|
RIGHT_CLICK = "right-click"
|
|
3914
3932
|
}
|
|
3933
|
+
export interface ColumnValue {
|
|
3934
|
+
column: {
|
|
3935
|
+
id: string;
|
|
3936
|
+
name: string;
|
|
3937
|
+
dataType: string;
|
|
3938
|
+
[key: string]: any;
|
|
3939
|
+
};
|
|
3940
|
+
value: string | number | boolean;
|
|
3941
|
+
}
|
|
3942
|
+
export interface VizPoint {
|
|
3943
|
+
selectedAttributes: ColumnValue[];
|
|
3944
|
+
selectedMeasures: ColumnValue[];
|
|
3945
|
+
}
|
|
3946
|
+
export interface CustomActionPayload {
|
|
3947
|
+
contextMenuPoints?: {
|
|
3948
|
+
clickedPoint: VizPoint;
|
|
3949
|
+
selectedPoints: VizPoint[];
|
|
3950
|
+
};
|
|
3951
|
+
embedAnswerData: {
|
|
3952
|
+
name: string;
|
|
3953
|
+
id: string;
|
|
3954
|
+
sources: {
|
|
3955
|
+
header: {
|
|
3956
|
+
guid: string;
|
|
3957
|
+
};
|
|
3958
|
+
};
|
|
3959
|
+
columns: any[];
|
|
3960
|
+
data: any[];
|
|
3961
|
+
[key: string]: any;
|
|
3962
|
+
};
|
|
3963
|
+
session: SessionInterface;
|
|
3964
|
+
vizId?: string;
|
|
3965
|
+
}
|
|
3915
3966
|
|
|
3916
3967
|
/**
|
|
3917
3968
|
* The list of customization css variables. These
|
|
@@ -4337,6 +4388,7 @@ export class SageEmbed extends V1Embed {
|
|
|
4337
4388
|
*
|
|
4338
4389
|
*/
|
|
4339
4390
|
protected viewConfig: SageViewConfig;
|
|
4391
|
+
protected embedComponentType: string;
|
|
4340
4392
|
constructor(domSelector: DOMSelector, viewConfig: SageViewConfig);
|
|
4341
4393
|
/**
|
|
4342
4394
|
* Constructs a map of parameters to be passed on to the
|
|
@@ -4348,10 +4400,68 @@ export class SageEmbed extends V1Embed {
|
|
|
4348
4400
|
/**
|
|
4349
4401
|
* Render the embedded ThoughtSpot Sage
|
|
4350
4402
|
*
|
|
4403
|
+
* @param showPreRenderByDefault
|
|
4351
4404
|
* @returns {SageEmbed} Eureka/Sage embed
|
|
4352
4405
|
*/
|
|
4353
|
-
render(): SageEmbed;
|
|
4406
|
+
render(showPreRenderByDefault?: boolean): SageEmbed;
|
|
4407
|
+
preRender(showPreRenderByDefault?: boolean): SageEmbed;
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
export interface SessionInterface {
|
|
4411
|
+
sessionId: string;
|
|
4412
|
+
genNo: number;
|
|
4413
|
+
acSession: {
|
|
4414
|
+
sessionId: string;
|
|
4415
|
+
genNo: number;
|
|
4416
|
+
};
|
|
4354
4417
|
}
|
|
4418
|
+
export enum OperationType {
|
|
4419
|
+
GetChartWithData = "GetChartWithData",
|
|
4420
|
+
GetTableWithHeadlineData = "GetTableWithHeadlineData"
|
|
4421
|
+
}
|
|
4422
|
+
interface UnderlyingDataPoint {
|
|
4423
|
+
columnId: string;
|
|
4424
|
+
dataValue: any;
|
|
4425
|
+
}
|
|
4426
|
+
/**
|
|
4427
|
+
* Class representing the answer service provided with the
|
|
4428
|
+
* custom action payload. This service could be used to run
|
|
4429
|
+
* graphql queries in the context of the answer on which the
|
|
4430
|
+
* custom action was triggered.
|
|
4431
|
+
*
|
|
4432
|
+
* @example
|
|
4433
|
+
* ```js
|
|
4434
|
+
* embed.on(EmbedEvent.CustomAction, e => {
|
|
4435
|
+
* const underlying = await e.answerService.getUnderlyingDataForPoint([
|
|
4436
|
+
* 'col name 1'
|
|
4437
|
+
* ]);
|
|
4438
|
+
* const data = await underlying.fetchData(0, 100);
|
|
4439
|
+
* })
|
|
4440
|
+
* ```
|
|
4441
|
+
* @version
|
|
4442
|
+
* ThoughtSpot: 9.9.0.cl / SDK: 1.25.0
|
|
4443
|
+
*/
|
|
4444
|
+
export class AnswerService {
|
|
4445
|
+
constructor(session: SessionInterface, answer: any, thoughtSpotHost: string, selectedPoints?: VizPoint[]);
|
|
4446
|
+
getSourceDetail(): Promise<any>;
|
|
4447
|
+
removeColumns(columnIds: string[]): Promise<any>;
|
|
4448
|
+
addColumns(columnIds: string[]): Promise<any>;
|
|
4449
|
+
fetchData(offset?: number, size?: number): Promise<{
|
|
4450
|
+
columns: any;
|
|
4451
|
+
data: any;
|
|
4452
|
+
}>;
|
|
4453
|
+
/**
|
|
4454
|
+
*
|
|
4455
|
+
* @param userLocale
|
|
4456
|
+
* @param omitInfo Omit the download Info on top of the CSV
|
|
4457
|
+
* @returns Response
|
|
4458
|
+
*/
|
|
4459
|
+
fetchCSVBlob(userLocale?: string, omitInfo?: boolean): Promise<Response>;
|
|
4460
|
+
getUnderlyingDataForPoint(outputColumnNames: string[], selectedPoints?: UnderlyingDataPoint[]): Promise<AnswerService>;
|
|
4461
|
+
executeQuery(query: string, variables: any): Promise<any>;
|
|
4462
|
+
getSession(): SessionInterface;
|
|
4463
|
+
}
|
|
4464
|
+
export {};
|
|
4355
4465
|
|
|
4356
4466
|
/**
|
|
4357
4467
|
* Copyright (c) 2022
|
|
@@ -4384,6 +4494,7 @@ export class TsEmbed {
|
|
|
4384
4494
|
*/
|
|
4385
4495
|
protected thoughtSpotHost: string;
|
|
4386
4496
|
protected thoughtSpotV2Base: string;
|
|
4497
|
+
protected embedComponentType: string;
|
|
4387
4498
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
4388
4499
|
/**
|
|
4389
4500
|
* Handles errors within the SDK
|
|
@@ -4416,14 +4527,15 @@ export class TsEmbed {
|
|
|
4416
4527
|
protected getEmbedParams(): string;
|
|
4417
4528
|
protected getRootIframeSrc(): string;
|
|
4418
4529
|
protected createIframeEl(frameSrc: string): HTMLIFrameElement;
|
|
4530
|
+
protected handleInsertionIntoDOM(child: string | Node, showPreRenderByDefault?: boolean): void;
|
|
4419
4531
|
/**
|
|
4420
4532
|
* Renders the embedded ThoughtSpot app in an iframe and sets up
|
|
4421
4533
|
* event listeners.
|
|
4422
4534
|
*
|
|
4423
|
-
* @param url
|
|
4424
|
-
* @param
|
|
4535
|
+
* @param url - The URL of the embedded ThoughtSpot app.
|
|
4536
|
+
* @param showPreRenderByDefault - The flag to show the preRender by default.
|
|
4425
4537
|
*/
|
|
4426
|
-
protected renderIFrame(url: string): Promise<any>;
|
|
4538
|
+
protected renderIFrame(url: string, showPreRenderByDefault?: boolean): Promise<any>;
|
|
4427
4539
|
getPreRenderIds(): {
|
|
4428
4540
|
wrapper: string;
|
|
4429
4541
|
shield: string;
|
|
@@ -4431,10 +4543,10 @@ export class TsEmbed {
|
|
|
4431
4543
|
};
|
|
4432
4544
|
protected createPreRenderWrapper(child: HTMLElement): HTMLDivElement;
|
|
4433
4545
|
protected preRenderWrapper: HTMLElement;
|
|
4434
|
-
protected preRenderShield: HTMLElement;
|
|
4435
4546
|
protected preRenderChild: HTMLElement;
|
|
4547
|
+
protected connectPreRendered(): boolean;
|
|
4436
4548
|
protected isPreRenderAvailable(): boolean;
|
|
4437
|
-
protected insertIntoDOMForPreRender(child: string | HTMLElement): void;
|
|
4549
|
+
protected insertIntoDOMForPreRender(child: string | HTMLElement, showPreRenderByDefault?: boolean): void;
|
|
4438
4550
|
hidePreRender(): void;
|
|
4439
4551
|
showPreRender(): void;
|
|
4440
4552
|
syncPreRenderStyle(): void;
|
|
@@ -4536,8 +4648,10 @@ export class TsEmbed {
|
|
|
4536
4648
|
render(): TsEmbed;
|
|
4537
4649
|
/**
|
|
4538
4650
|
* Creates the preRender shell
|
|
4651
|
+
*
|
|
4652
|
+
* @param showPreRenderByDefault
|
|
4539
4653
|
*/
|
|
4540
|
-
preRender(): TsEmbed;
|
|
4654
|
+
preRender(showPreRenderByDefault?: boolean): TsEmbed;
|
|
4541
4655
|
/**
|
|
4542
4656
|
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
4543
4657
|
* host app URL.
|
|
@@ -4577,8 +4691,9 @@ export class V1Embed extends TsEmbed {
|
|
|
4577
4691
|
* Render the app in an iframe and set up event handlers
|
|
4578
4692
|
*
|
|
4579
4693
|
* @param iframeSrc
|
|
4694
|
+
* @param showPreRenderByDefault - if true the preRender will be shown by default
|
|
4580
4695
|
*/
|
|
4581
|
-
protected renderV1Embed(iframeSrc: string): any;
|
|
4696
|
+
protected renderV1Embed(iframeSrc: string, showPreRenderByDefault?: boolean): any;
|
|
4582
4697
|
protected getRootIframeSrc(): string;
|
|
4583
4698
|
/**
|
|
4584
4699
|
* @inheritdoc
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.24.0-
|
|
3
|
+
"version": "1.24.0-preRender.1",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -139,11 +139,10 @@
|
|
|
139
139
|
"identity-obj-proxy": "^3.0.0",
|
|
140
140
|
"istanbul-merge": "^1.1.1",
|
|
141
141
|
"jest": "^26.6.3",
|
|
142
|
-
"jest-
|
|
142
|
+
"jest-fetch-mock": "^3.0.3",
|
|
143
143
|
"jsdom": "^17.0.0",
|
|
144
144
|
"node-sass": "^8.0.0",
|
|
145
145
|
"prettier": "2.1.2",
|
|
146
|
-
"puppeteer": "^7.0.1",
|
|
147
146
|
"react": "^16.14.0",
|
|
148
147
|
"react-dom": "^16.14.0",
|
|
149
148
|
"react-resizable": "^1.11.0",
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, EmbedConfig, MessageOptions, ViewConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for embedding v2 experience
|
|
4
|
+
* Note: the v2 version of ThoughtSpot Blink is built on the new stack:
|
|
5
|
+
* React+GraphQL
|
|
6
|
+
*/
|
|
7
|
+
export declare class TsEmbed {
|
|
8
|
+
/**
|
|
9
|
+
* The DOM node which was inserted by the SDK to either
|
|
10
|
+
* render the iframe or display an error message.
|
|
11
|
+
* This is useful for removing the DOM node when the
|
|
12
|
+
* embed instance is destroyed.
|
|
13
|
+
*/
|
|
14
|
+
private insertedDomEl;
|
|
15
|
+
/**
|
|
16
|
+
* The DOM node where the ThoughtSpot app is to be embedded.
|
|
17
|
+
*/
|
|
18
|
+
private el;
|
|
19
|
+
protected isAppInitialized: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* A reference to the iframe within which the ThoughtSpot app
|
|
22
|
+
* will be rendered.
|
|
23
|
+
*/
|
|
24
|
+
protected iFrame: HTMLIFrameElement;
|
|
25
|
+
protected viewConfig: ViewConfig;
|
|
26
|
+
protected embedConfig: EmbedConfig;
|
|
27
|
+
/**
|
|
28
|
+
* The ThoughtSpot hostname or IP address
|
|
29
|
+
*/
|
|
30
|
+
protected thoughtSpotHost: string;
|
|
31
|
+
protected thoughtSpotV2Base: string;
|
|
32
|
+
protected embedComponentType: string;
|
|
33
|
+
/**
|
|
34
|
+
* A map of event handlers for particular message types triggered
|
|
35
|
+
* by the embedded app; multiple event handlers can be registered
|
|
36
|
+
* against a particular message type.
|
|
37
|
+
*/
|
|
38
|
+
private eventHandlerMap;
|
|
39
|
+
/**
|
|
40
|
+
* A flag that is set to true post render.
|
|
41
|
+
*/
|
|
42
|
+
private isRendered;
|
|
43
|
+
/**
|
|
44
|
+
* A flag to mark if an error has occurred.
|
|
45
|
+
*/
|
|
46
|
+
private isError;
|
|
47
|
+
/**
|
|
48
|
+
* Should we encode URL Query Params using base64 encoding which thoughtspot
|
|
49
|
+
* will generate for embedding. This provides additional security to
|
|
50
|
+
* thoughtspot clusters against Cross site scripting attacks.
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
private shouldEncodeUrlQueryParams;
|
|
55
|
+
private defaultHiddenActions;
|
|
56
|
+
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Throws error encountered during initialization.
|
|
59
|
+
*/
|
|
60
|
+
private throwInitError;
|
|
61
|
+
/**
|
|
62
|
+
* Handles errors within the SDK
|
|
63
|
+
*
|
|
64
|
+
* @param error The error message or object
|
|
65
|
+
*/
|
|
66
|
+
protected handleError(error: string | Record<string, unknown>): void;
|
|
67
|
+
/**
|
|
68
|
+
* Extracts the type field from the event payload
|
|
69
|
+
*
|
|
70
|
+
* @param event The window message event
|
|
71
|
+
*/
|
|
72
|
+
private getEventType;
|
|
73
|
+
/**
|
|
74
|
+
* Extracts the port field from the event payload
|
|
75
|
+
*
|
|
76
|
+
* @param event The window message event
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
private getEventPort;
|
|
80
|
+
/**
|
|
81
|
+
* fix for ts7.sep.cl
|
|
82
|
+
* will be removed for ts7.oct.cl
|
|
83
|
+
*
|
|
84
|
+
* @param event
|
|
85
|
+
* @param eventType
|
|
86
|
+
* @hidden
|
|
87
|
+
*/
|
|
88
|
+
private formatEventData;
|
|
89
|
+
private subscribedListeners;
|
|
90
|
+
/**
|
|
91
|
+
* Adds a global event listener to window for "message" events.
|
|
92
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
93
|
+
* embed instance through an identifier contained in the payload,
|
|
94
|
+
* and executes the registered callbacks accordingly.
|
|
95
|
+
*/
|
|
96
|
+
private subscribeToEvents;
|
|
97
|
+
private unsubscribeToEvents;
|
|
98
|
+
/**
|
|
99
|
+
* Send Custom style as part of payload of APP_INIT
|
|
100
|
+
*
|
|
101
|
+
* @param _
|
|
102
|
+
* @param responder
|
|
103
|
+
*/
|
|
104
|
+
private appInitCb;
|
|
105
|
+
/**
|
|
106
|
+
* Sends updated auth token to the iFrame to avoid user logout
|
|
107
|
+
*
|
|
108
|
+
* @param _
|
|
109
|
+
* @param responder
|
|
110
|
+
*/
|
|
111
|
+
private updateAuthToken;
|
|
112
|
+
/**
|
|
113
|
+
* Register APP_INIT event and sendback init payload
|
|
114
|
+
*/
|
|
115
|
+
private registerAppInit;
|
|
116
|
+
/**
|
|
117
|
+
* Constructs the base URL string to load the ThoughtSpot app.
|
|
118
|
+
*
|
|
119
|
+
* @param query
|
|
120
|
+
*/
|
|
121
|
+
protected getEmbedBasePath(query: string): string;
|
|
122
|
+
/**
|
|
123
|
+
* Common query params set for all the embed modes.
|
|
124
|
+
*
|
|
125
|
+
* @param queryParams
|
|
126
|
+
* @returns queryParams
|
|
127
|
+
*/
|
|
128
|
+
protected getBaseQueryParams(queryParams?: {}): {};
|
|
129
|
+
/**
|
|
130
|
+
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
131
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
132
|
+
*
|
|
133
|
+
* @param queryString The query string to append to the URL.
|
|
134
|
+
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
135
|
+
* the full application.
|
|
136
|
+
*/
|
|
137
|
+
protected getV1EmbedBasePath(queryString: string): string;
|
|
138
|
+
protected getEmbedParams(): string;
|
|
139
|
+
protected getRootIframeSrc(): string;
|
|
140
|
+
protected createIframeEl(frameSrc: string): HTMLIFrameElement;
|
|
141
|
+
protected handleInsertionIntoDOM(child: string | Node, showPreRenderByDefault?: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* Renders the embedded ThoughtSpot app in an iframe and sets up
|
|
144
|
+
* event listeners.
|
|
145
|
+
*
|
|
146
|
+
* @param url - The URL of the embedded ThoughtSpot app.
|
|
147
|
+
* @param showPreRenderByDefault - The flag to show the preRender by default.
|
|
148
|
+
*/
|
|
149
|
+
protected renderIFrame(url: string, showPreRenderByDefault?: boolean): Promise<any>;
|
|
150
|
+
getPreRenderIds(): {
|
|
151
|
+
wrapper: string;
|
|
152
|
+
shield: string;
|
|
153
|
+
child: string;
|
|
154
|
+
};
|
|
155
|
+
protected createPreRenderWrapper(child: HTMLElement): HTMLDivElement;
|
|
156
|
+
protected preRenderWrapper: HTMLElement;
|
|
157
|
+
protected preRenderChild: HTMLElement;
|
|
158
|
+
protected connectPreRendered(): boolean;
|
|
159
|
+
protected isPreRenderAvailable(): boolean;
|
|
160
|
+
protected insertIntoDOMForPreRender(child: string | HTMLElement, showPreRenderByDefault?: boolean): void;
|
|
161
|
+
hidePreRender(): void;
|
|
162
|
+
showPreRender(): void;
|
|
163
|
+
syncPreRenderStyle(): void;
|
|
164
|
+
protected insertIntoDOM(child: string | Node): void;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the height of the iframe
|
|
167
|
+
*
|
|
168
|
+
* @param height The height in pixels
|
|
169
|
+
*/
|
|
170
|
+
protected setIFrameHeight(height: number | string): void;
|
|
171
|
+
/**
|
|
172
|
+
* Executes all registered event handlers for a particular event type
|
|
173
|
+
*
|
|
174
|
+
* @param eventType The event type
|
|
175
|
+
* @param data The payload invoked with the event handler
|
|
176
|
+
* @param eventPort The event Port for a specific MessageChannel
|
|
177
|
+
*/
|
|
178
|
+
protected executeCallbacks(eventType: EmbedEvent, data: any, eventPort?: MessagePort | void): void;
|
|
179
|
+
/**
|
|
180
|
+
* Returns the ThoughtSpot hostname or IP address.
|
|
181
|
+
*/
|
|
182
|
+
protected getThoughtSpotHost(): string;
|
|
183
|
+
/**
|
|
184
|
+
* Gets the v1 event type (if applicable) for the EmbedEvent type
|
|
185
|
+
*
|
|
186
|
+
* @param eventType The v2 event type
|
|
187
|
+
* @returns The corresponding v1 event type if one exists
|
|
188
|
+
* or else the v2 event type itself
|
|
189
|
+
*/
|
|
190
|
+
protected getCompatibleEventType(eventType: EmbedEvent): EmbedEvent;
|
|
191
|
+
/**
|
|
192
|
+
* Calculates the iframe center for the current visible viewPort
|
|
193
|
+
* of iframe using Scroll position of Host App, offsetTop for iframe
|
|
194
|
+
* in Host app. ViewPort height of the tab.
|
|
195
|
+
*
|
|
196
|
+
* @returns iframe Center in visible viewport,
|
|
197
|
+
* Iframe height,
|
|
198
|
+
* View port height.
|
|
199
|
+
*/
|
|
200
|
+
protected getIframeCenter(): {
|
|
201
|
+
iframeCenter: number;
|
|
202
|
+
iframeScrolled: number;
|
|
203
|
+
iframeHeight: number;
|
|
204
|
+
viewPortHeight: number;
|
|
205
|
+
iframeVisibleViewPort: number;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Registers an event listener to trigger an alert when the ThoughtSpot app
|
|
209
|
+
* sends an event of a particular message type to the host application.
|
|
210
|
+
*
|
|
211
|
+
* @param messageType The message type
|
|
212
|
+
* @param callback A callback as a function
|
|
213
|
+
* @param options The message options
|
|
214
|
+
* @param isSelf
|
|
215
|
+
* @param isRegisteredBySDK
|
|
216
|
+
* @example
|
|
217
|
+
* ```js
|
|
218
|
+
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
219
|
+
* console.error(data);
|
|
220
|
+
* });
|
|
221
|
+
* ```
|
|
222
|
+
* @example
|
|
223
|
+
* ```js
|
|
224
|
+
* tsEmbed.on(EmbedEvent.Save, (data) => {
|
|
225
|
+
* console.log("Answer save clicked", data);
|
|
226
|
+
* }, {
|
|
227
|
+
* start: true // This will trigger the callback on start of save
|
|
228
|
+
* });
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions, isRegisteredBySDK?: boolean): typeof TsEmbed.prototype;
|
|
232
|
+
/**
|
|
233
|
+
* Removes an event listener for a particular event type.
|
|
234
|
+
*
|
|
235
|
+
* @param messageType The message type
|
|
236
|
+
* @param callback The callback to remove
|
|
237
|
+
* @example
|
|
238
|
+
* ```js
|
|
239
|
+
* const errorHandler = (data) => { console.error(data); };
|
|
240
|
+
* tsEmbed.on(EmbedEvent.Error, errorHandler);
|
|
241
|
+
* tsEmbed.off(EmbedEvent.Error, errorHandler);
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
off(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
245
|
+
/**
|
|
246
|
+
* Triggers an event on specific Port registered against
|
|
247
|
+
* for the EmbedEvent
|
|
248
|
+
*
|
|
249
|
+
* @param eventType The message type
|
|
250
|
+
* @param data The payload to send
|
|
251
|
+
* @param eventPort
|
|
252
|
+
* @param payload
|
|
253
|
+
*/
|
|
254
|
+
private triggerEventOnPort;
|
|
255
|
+
/**
|
|
256
|
+
* Triggers an event to the embedded app
|
|
257
|
+
*
|
|
258
|
+
* @param messageType The event type
|
|
259
|
+
* @param data The payload to send with the message
|
|
260
|
+
*/
|
|
261
|
+
trigger(messageType: HostEvent, data?: any): Promise<any>;
|
|
262
|
+
/**
|
|
263
|
+
* Marks the ThoughtSpot object to have been rendered
|
|
264
|
+
* Needs to be overridden by subclasses to do the actual
|
|
265
|
+
* rendering of the iframe.
|
|
266
|
+
*
|
|
267
|
+
* @param args
|
|
268
|
+
*/
|
|
269
|
+
render(): TsEmbed;
|
|
270
|
+
private isPreRendered;
|
|
271
|
+
/**
|
|
272
|
+
* Creates the preRender shell
|
|
273
|
+
*
|
|
274
|
+
* @param showPreRenderByDefault
|
|
275
|
+
*/
|
|
276
|
+
preRender(showPreRenderByDefault?: boolean): TsEmbed;
|
|
277
|
+
/**
|
|
278
|
+
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
279
|
+
* host app URL.
|
|
280
|
+
* THOUGHTSPOT URL params starts with a prefix "ts-"
|
|
281
|
+
*
|
|
282
|
+
* @version SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
|
|
283
|
+
*/
|
|
284
|
+
getThoughtSpotPostUrlParams(): string;
|
|
285
|
+
/**
|
|
286
|
+
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
287
|
+
*
|
|
288
|
+
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
289
|
+
*/
|
|
290
|
+
destroy(): void;
|
|
291
|
+
getUnderlyingFrameElement(): HTMLIFrameElement;
|
|
292
|
+
/**
|
|
293
|
+
* Prerenders a generic instance of the TS component.
|
|
294
|
+
* This means without the path but with the flags already applied.
|
|
295
|
+
* This is useful for prerendering the component in the background.
|
|
296
|
+
*
|
|
297
|
+
* @version SDK: 1.22.0
|
|
298
|
+
* @returns
|
|
299
|
+
*/
|
|
300
|
+
prerenderGeneric(): Promise<any>;
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=TsEmbed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsEmbed.d.ts","sourceRoot":"","sources":["../../../src/embed/TsEmbed.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,WAAW,EACX,SAAS,EACT,UAAU,EACV,eAAe,EAGf,WAAW,EACX,cAAc,EACd,UAAU,EACX,MAAM,UAAU,CAAC;AAclB;;;;GAIG;AAEH,qBAAa,OAAO;IAClB;;;;;OAKG;IACH,OAAO,CAAC,aAAa,CAAO;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAU;IAEpB,SAAS,CAAC,gBAAgB,UAAS;IAEnC;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAEpC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IAEnC;;OAEG;IACH,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC;IAKlC,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAEpC,SAAS,CAAC,kBAAkB,SAAa;IAEzC;;;;OAIG;IACH,OAAO,CAAC,eAAe,CAAoC;IAE3D;;OAEG;IACH,OAAO,CAAC,UAAU,CAAU;IAE5B;;OAEG;IACH,OAAO,CAAC,OAAO,CAAU;IAEzB;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B,CAAS;IAE3C,OAAO,CAAC,oBAAoB,CAAwB;gBAExC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,UAAU;IAoB7D;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAS7D;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAKpB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAOpB;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,mBAAmB,CAAM;IAEjC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAqCzB,OAAO,CAAC,mBAAmB;IAM3B;;;;;OAKG;IACH,OAAO,CAAC,SAAS,CAsBf;IAEF;;;;;OAKG;IACH,OAAO,CAAC,eAAe,CAYrB;IAEF;;OAEG;IACH,OAAO,CAAC,eAAe,CAGrB;IAEF;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAcjD;;;;;OAKG;IACH,SAAS,CAAC,kBAAkB,CAAC,WAAW,KAAK;IA8G7C;;;;;;;OAOG;IACH,SAAS,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAQzD,SAAS,CAAC,cAAc;IAKxB,SAAS,CAAC,gBAAgB;IAK1B,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAkC7D,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,sBAAsB,UAAQ,GAAG,IAAI;IAU5F;;;;;;OAMG;cACa,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,sBAAsB,UAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAwEhF,eAAe;;;;;IAQtB,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc;IA8BpE,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAGxC,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC;IAEtC,SAAS,CAAC,kBAAkB,IAAI,OAAO;IAiBvC,SAAS,CAAC,oBAAoB,IAAI,OAAO;IAIzC,SAAS,CAAC,yBAAyB,CACjC,KAAK,EAAE,MAAM,GAAG,WAAW,EAC3B,sBAAsB,UAAQ,GAC7B,IAAI;IAqBA,aAAa,IAAI,IAAI;IAgCrB,aAAa,IAAI,IAAI;IAqBrB,kBAAkB,IAAI,IAAI;IAWjC,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAwBnD;;;;OAIG;IACH,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIxD;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,CACxB,SAAS,EAAE,UAAU,EACrB,IAAI,EAAE,GAAG,EACT,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,GAC7B,IAAI;IAoBP;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,MAAM;IAItC;;;;;;OAMG;IACH,SAAS,CAAC,sBAAsB,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU;IAInE;;;;;;;;OAQG;IACH,SAAS,CAAC,eAAe;;;;;;;IA2BzB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACI,EAAE,CACP,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,eAAe,EACzB,OAAO,GAAE,cAAiC,EAC1C,iBAAiB,UAAQ,GACxB,OAAO,OAAO,CAAC,SAAS;IAa3B;;;;;;;;;;;OAWG;IACI,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,OAAO,CAAC,SAAS;IASxF;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;;OAKG;IACI,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAKpE;;;;;;OAMG;IACI,MAAM,IAAI,OAAO;IAMxB,OAAO,CAAC,aAAa,CAAU;IAE/B;;;;OAIG;IACI,SAAS,CAAC,sBAAsB,UAAQ,GAAG,OAAO;IAKzD;;;;;;OAMG;IACI,2BAA2B,IAAI,MAAM;IAuB5C;;;;OAIG;IACI,OAAO,IAAI,IAAI;IASf,yBAAyB,IAAI,iBAAiB;IAIrD;;;;;;;OAOG;IACU,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;CAI9C"}
|