@thoughtspot/visual-embed-sdk 1.8.0-plugins.6 → 1.8.0
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/dist/src/embed/base.d.ts +4 -2
- package/dist/src/embed/liveboard.d.ts +1 -1
- package/dist/src/embed/search.d.ts +4 -0
- package/dist/src/embed/ts-embed.d.ts +2 -20
- package/dist/src/index.d.ts +2 -2
- package/dist/src/types.d.ts +15 -57
- package/dist/tsembed.es.js +15 -75
- package/dist/tsembed.js +15 -75
- package/lib/package.json +3 -2
- package/lib/src/embed/base.d.ts +4 -2
- package/lib/src/embed/base.js +4 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -1
- package/lib/src/embed/search.d.ts +4 -0
- package/lib/src/embed/search.js +1 -4
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +2 -20
- package/lib/src/embed/ts-embed.js +2 -24
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +5 -24
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +15 -57
- package/lib/src/types.js +6 -46
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.js +1 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +28 -81
- package/package.json +3 -2
- package/src/embed/base.ts +6 -2
- package/src/embed/liveboard.ts +1 -1
- package/src/embed/search.ts +5 -3
- package/src/embed/ts-embed.spec.ts +6 -29
- package/src/embed/ts-embed.ts +2 -45
- package/src/index.ts +0 -2
- package/src/react/index.spec.tsx +1 -1
- package/src/types.ts +12 -58
- package/src/utils/processData.ts +1 -1
- package/src/utils/plugin.ts +0 -2
package/dist/src/embed/base.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare let authPromise: Promise<void>;
|
|
|
3
3
|
/**
|
|
4
4
|
* Perform authentication on the ThoughtSpot app as applicable.
|
|
5
5
|
*/
|
|
6
|
-
export declare const handleAuth: () => void
|
|
6
|
+
export declare const handleAuth: () => Promise<void>;
|
|
7
7
|
export declare const getEmbedConfig: () => EmbedConfig;
|
|
8
8
|
export declare const getAuthPromise: () => Promise<void>;
|
|
9
9
|
/**
|
|
@@ -16,8 +16,10 @@ export declare const prefetch: (url?: string) => void;
|
|
|
16
16
|
* authentication if applicable.
|
|
17
17
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
18
18
|
* authentication mechanism and so on.
|
|
19
|
+
*
|
|
20
|
+
* @returns authPromise Promise which resolves when authentication is complete.
|
|
19
21
|
*/
|
|
20
|
-
export declare const init: (embedConfig: EmbedConfig) => void
|
|
22
|
+
export declare const init: (embedConfig: EmbedConfig) => Promise<void>;
|
|
21
23
|
/**
|
|
22
24
|
* Renders functions in a queue, resolves to next function only after the callback next is called
|
|
23
25
|
* @param fn The function being registered
|
|
@@ -24,7 +24,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
24
24
|
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
25
25
|
* Setting this height helps resolves issues with empty Liveboards and
|
|
26
26
|
* other screens navigable from a Liveboard.
|
|
27
|
-
*
|
|
27
|
+
* *_since 1.5.0_
|
|
28
28
|
* @default 500
|
|
29
29
|
*/
|
|
30
30
|
defaultHeight?: number;
|
|
@@ -44,6 +44,10 @@ export interface SearchViewConfig extends ViewConfig {
|
|
|
44
44
|
* using raw answer data.
|
|
45
45
|
*/
|
|
46
46
|
hideResults?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* If set to true, expands all the data sources panel.
|
|
49
|
+
*/
|
|
50
|
+
expandAllDataSource?: boolean;
|
|
47
51
|
/**
|
|
48
52
|
* If set to true, the Search Assist feature is enabled.
|
|
49
53
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @summary Base classes
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig
|
|
9
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig } from '../types';
|
|
10
10
|
export interface LayoutConfig {
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -59,7 +59,7 @@ export interface ViewConfig {
|
|
|
59
59
|
/**
|
|
60
60
|
* The list of actions to display from the primary menu, more menu
|
|
61
61
|
* (...), and the contextual menu.
|
|
62
|
-
*
|
|
62
|
+
* * _since 1.6.0_
|
|
63
63
|
*/
|
|
64
64
|
visibleActions?: Action[];
|
|
65
65
|
/**
|
|
@@ -67,22 +67,6 @@ export interface ViewConfig {
|
|
|
67
67
|
* visualization, or Liveboard.
|
|
68
68
|
*/
|
|
69
69
|
runtimeFilters?: RuntimeFilter[];
|
|
70
|
-
/**
|
|
71
|
-
* This is an object (key/val) of override flags which will be applied
|
|
72
|
-
* to the internal embedded object. This can be used to add any
|
|
73
|
-
* URL flag.
|
|
74
|
-
* @version 1.8.0
|
|
75
|
-
*/
|
|
76
|
-
additionalFlags?: {
|
|
77
|
-
[key: string]: string | number | boolean;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Provide a list of plugins, the plugins are executed in the order
|
|
81
|
-
* provided below,
|
|
82
|
-
*
|
|
83
|
-
* @version alpha
|
|
84
|
-
*/
|
|
85
|
-
plugins?: Plugin[];
|
|
86
70
|
}
|
|
87
71
|
/**
|
|
88
72
|
* Base class for embedding v2 experience
|
|
@@ -101,7 +85,6 @@ export declare class TsEmbed {
|
|
|
101
85
|
protected iFrame: HTMLIFrameElement;
|
|
102
86
|
protected viewConfig: ViewConfig;
|
|
103
87
|
protected embedConfig: EmbedConfig;
|
|
104
|
-
protected hasVizConfigOverride: boolean;
|
|
105
88
|
/**
|
|
106
89
|
* The ThoughtSpot hostname or IP address
|
|
107
90
|
*/
|
|
@@ -129,7 +112,6 @@ export declare class TsEmbed {
|
|
|
129
112
|
*/
|
|
130
113
|
private shouldEncodeUrlQueryParams;
|
|
131
114
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
132
|
-
private registerPlugins;
|
|
133
115
|
/**
|
|
134
116
|
* Gets a reference to the root DOM node where
|
|
135
117
|
* the embedded content will appear.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ import { AppEmbed, Page, AppViewConfig } from './embed/app';
|
|
|
11
11
|
import { init, prefetch } from './embed/base';
|
|
12
12
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/liveboard';
|
|
13
13
|
import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
14
|
-
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig
|
|
15
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig,
|
|
14
|
+
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from './types';
|
|
15
|
+
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
package/dist/src/types.d.ts
CHANGED
|
@@ -64,6 +64,11 @@ export interface EmbedConfig {
|
|
|
64
64
|
* and returns a Promise that resolves to the `auth token` string.
|
|
65
65
|
* For trusted authentication, the `authEndpoint` or `getAuthToken`
|
|
66
66
|
* attribute is required.
|
|
67
|
+
*
|
|
68
|
+
* It is advisable to fetch a new token inside this method and not
|
|
69
|
+
* reuse and older issued token, as because when auth expires this is
|
|
70
|
+
* called again and if it is called with an older token the authentication
|
|
71
|
+
* will not succeed.
|
|
67
72
|
*/
|
|
68
73
|
getAuthToken?: () => Promise<string>;
|
|
69
74
|
/**
|
|
@@ -104,7 +109,7 @@ export interface EmbedConfig {
|
|
|
104
109
|
suppressNoCookieAccessAlert?: boolean;
|
|
105
110
|
/**
|
|
106
111
|
* Re-login when session expires with the previous login options
|
|
107
|
-
* @default
|
|
112
|
+
* @default false
|
|
108
113
|
*/
|
|
109
114
|
autoLogin?: boolean;
|
|
110
115
|
/**
|
|
@@ -122,7 +127,6 @@ export interface EmbedConfig {
|
|
|
122
127
|
queueMultiRenders?: boolean;
|
|
123
128
|
/**
|
|
124
129
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
125
|
-
* You would also need to set `style-src` in the CSP settings.
|
|
126
130
|
* @version 1.6.0 or later
|
|
127
131
|
* @default ''
|
|
128
132
|
*/
|
|
@@ -262,36 +266,18 @@ export declare enum EmbedEvent {
|
|
|
262
266
|
* @return dataSourceIds - the list of data sources
|
|
263
267
|
*/
|
|
264
268
|
DataSourceSelected = "dataSourceSelected",
|
|
265
|
-
/**
|
|
266
|
-
* One or more data columns have been selected.
|
|
267
|
-
* @return columnIds - the list of columns
|
|
268
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.2.0.cl
|
|
269
|
-
*/
|
|
270
|
-
AddRemoveColumns = "addRemoveColumns",
|
|
271
269
|
/**
|
|
272
270
|
* A custom action has been triggered
|
|
273
271
|
* @return actionId - The id of the custom action
|
|
274
272
|
* @return data - The answer or Liveboard data
|
|
275
273
|
*/
|
|
276
274
|
CustomAction = "customAction",
|
|
277
|
-
/**
|
|
278
|
-
* A click has been triggered on table/chart
|
|
279
|
-
* @return ContextMenuInputPoints - data point that is double clicked
|
|
280
|
-
* @version 1.10.0
|
|
281
|
-
*/
|
|
282
|
-
VizPointClick = "vizPointClick",
|
|
283
275
|
/**
|
|
284
276
|
* A double click has been triggered on table/chart
|
|
285
277
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
286
278
|
* @version 1.5.0 or later
|
|
287
279
|
*/
|
|
288
280
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
289
|
-
/**
|
|
290
|
-
* Event troggered when rendering a chart, call the supplied
|
|
291
|
-
* callback with the config overrides.
|
|
292
|
-
* @version 1.10.0
|
|
293
|
-
*/
|
|
294
|
-
GetVizConfigOverrides = "getVizConfigOverrides",
|
|
295
281
|
/**
|
|
296
282
|
* An error has occurred.
|
|
297
283
|
* @return error - An error object or message
|
|
@@ -392,17 +378,11 @@ export declare enum HostEvent {
|
|
|
392
378
|
*/
|
|
393
379
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
394
380
|
/**
|
|
395
|
-
* Update the runtime filters
|
|
396
|
-
* on to the existing runtime filters if they exist.
|
|
381
|
+
* Update the runtime filters
|
|
397
382
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
398
383
|
* @version 1.8.0 or later
|
|
399
384
|
*/
|
|
400
|
-
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
401
|
-
/**
|
|
402
|
-
* Highlight the point in the chart defined by the InputPoint passed.
|
|
403
|
-
* @verion 1.10.0
|
|
404
|
-
*/
|
|
405
|
-
HighlightPoint = "HighlightPoint"
|
|
385
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
406
386
|
}
|
|
407
387
|
/**
|
|
408
388
|
* The different visual modes that the data sources panel within
|
|
@@ -429,6 +409,7 @@ export declare enum DataSourceVisualMode {
|
|
|
429
409
|
export declare enum Param {
|
|
430
410
|
DataSources = "dataSources",
|
|
431
411
|
DataSourceMode = "dataSourceMode",
|
|
412
|
+
ExpandAllDataSource = "expandAllDataSource",
|
|
432
413
|
DisableActions = "disableAction",
|
|
433
414
|
DisableActionReason = "disableHint",
|
|
434
415
|
ForceTable = "forceTable",
|
|
@@ -451,8 +432,7 @@ export declare enum Param {
|
|
|
451
432
|
ViewPortHeight = "viewPortHeight",
|
|
452
433
|
ViewPortWidth = "viewPortWidth",
|
|
453
434
|
VisibleActions = "visibleAction",
|
|
454
|
-
CustomCSSUrl = "customCssUrl"
|
|
455
|
-
hasVizConfigOverride = "hasVizConfigOverride"
|
|
435
|
+
CustomCSSUrl = "customCssUrl"
|
|
456
436
|
}
|
|
457
437
|
/**
|
|
458
438
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -504,6 +484,10 @@ export declare enum Action {
|
|
|
504
484
|
PinboardInfo = "pinboardInfo",
|
|
505
485
|
LiveboardInfo = "pinboardInfo",
|
|
506
486
|
SendAnswerFeedback = "sendFeedback",
|
|
487
|
+
/**
|
|
488
|
+
* @deprecated Will be removed in next version
|
|
489
|
+
*/
|
|
490
|
+
CustomAction = "customAction",
|
|
507
491
|
DownloadEmbraceQueries = "downloadEmbraceQueries",
|
|
508
492
|
Pin = "pin",
|
|
509
493
|
AnalysisInfo = "analysisInfo",
|
|
@@ -518,27 +502,7 @@ export declare enum Action {
|
|
|
518
502
|
Separator = "context-menu-item-separator",
|
|
519
503
|
DrillDown = "DRILL",
|
|
520
504
|
RequestAccess = "requestAccess",
|
|
521
|
-
QueryDetailsButtons = "queryDetailsButtons"
|
|
522
|
-
/**
|
|
523
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
524
|
-
*/
|
|
525
|
-
Monitor = "createMonitor",
|
|
526
|
-
/**
|
|
527
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
528
|
-
*/
|
|
529
|
-
AnswerDelete = "onDeleteAnswer",
|
|
530
|
-
/**
|
|
531
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
532
|
-
*/
|
|
533
|
-
AnswerChartSwitcher = "answerChartSwitcher",
|
|
534
|
-
/**
|
|
535
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
536
|
-
*/
|
|
537
|
-
AddToFavorites = "addToFavorites",
|
|
538
|
-
/**
|
|
539
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
540
|
-
*/
|
|
541
|
-
EditDetails = "editDetails"
|
|
505
|
+
QueryDetailsButtons = "queryDetailsButtons"
|
|
542
506
|
}
|
|
543
507
|
export interface SessionInterface {
|
|
544
508
|
sessionId: string;
|
|
@@ -555,9 +519,3 @@ export declare enum OperationType {
|
|
|
555
519
|
export interface AnswerServiceType {
|
|
556
520
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
557
521
|
}
|
|
558
|
-
export interface Plugin {
|
|
559
|
-
name: string;
|
|
560
|
-
handlers: {
|
|
561
|
-
[key in EmbedEvent]?: (payload: any, cb: (data: any) => void) => void;
|
|
562
|
-
};
|
|
563
|
-
}
|
package/dist/tsembed.es.js
CHANGED
|
@@ -259,36 +259,18 @@ var EmbedEvent;
|
|
|
259
259
|
* @return dataSourceIds - the list of data sources
|
|
260
260
|
*/
|
|
261
261
|
EmbedEvent["DataSourceSelected"] = "dataSourceSelected";
|
|
262
|
-
/**
|
|
263
|
-
* One or more data columns have been selected.
|
|
264
|
-
* @return columnIds - the list of columns
|
|
265
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.2.0.cl
|
|
266
|
-
*/
|
|
267
|
-
EmbedEvent["AddRemoveColumns"] = "addRemoveColumns";
|
|
268
262
|
/**
|
|
269
263
|
* A custom action has been triggered
|
|
270
264
|
* @return actionId - The id of the custom action
|
|
271
265
|
* @return data - The answer or Liveboard data
|
|
272
266
|
*/
|
|
273
267
|
EmbedEvent["CustomAction"] = "customAction";
|
|
274
|
-
/**
|
|
275
|
-
* A click has been triggered on table/chart
|
|
276
|
-
* @return ContextMenuInputPoints - data point that is double clicked
|
|
277
|
-
* @version 1.10.0
|
|
278
|
-
*/
|
|
279
|
-
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
280
268
|
/**
|
|
281
269
|
* A double click has been triggered on table/chart
|
|
282
270
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
283
271
|
* @version 1.5.0 or later
|
|
284
272
|
*/
|
|
285
273
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
286
|
-
/**
|
|
287
|
-
* Event troggered when rendering a chart, call the supplied
|
|
288
|
-
* callback with the config overrides.
|
|
289
|
-
* @version 1.10.0
|
|
290
|
-
*/
|
|
291
|
-
EmbedEvent["GetVizConfigOverrides"] = "getVizConfigOverrides";
|
|
292
274
|
/**
|
|
293
275
|
* An error has occurred.
|
|
294
276
|
* @return error - An error object or message
|
|
@@ -391,17 +373,11 @@ var HostEvent;
|
|
|
391
373
|
*/
|
|
392
374
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
393
375
|
/**
|
|
394
|
-
* Update the runtime filters
|
|
395
|
-
* on to the existing runtime filters if they exist.
|
|
376
|
+
* Update the runtime filters
|
|
396
377
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
397
378
|
* @version 1.8.0 or later
|
|
398
379
|
*/
|
|
399
380
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
400
|
-
/**
|
|
401
|
-
* Highlight the point in the chart defined by the InputPoint passed.
|
|
402
|
-
* @verion 1.10.0
|
|
403
|
-
*/
|
|
404
|
-
HostEvent["HighlightPoint"] = "HighlightPoint";
|
|
405
381
|
})(HostEvent || (HostEvent = {}));
|
|
406
382
|
/**
|
|
407
383
|
* The different visual modes that the data sources panel within
|
|
@@ -432,6 +408,7 @@ var Param;
|
|
|
432
408
|
(function (Param) {
|
|
433
409
|
Param["DataSources"] = "dataSources";
|
|
434
410
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
411
|
+
Param["ExpandAllDataSource"] = "expandAllDataSource";
|
|
435
412
|
Param["DisableActions"] = "disableAction";
|
|
436
413
|
Param["DisableActionReason"] = "disableHint";
|
|
437
414
|
Param["ForceTable"] = "forceTable";
|
|
@@ -455,7 +432,6 @@ var Param;
|
|
|
455
432
|
Param["ViewPortWidth"] = "viewPortWidth";
|
|
456
433
|
Param["VisibleActions"] = "visibleAction";
|
|
457
434
|
Param["CustomCSSUrl"] = "customCssUrl";
|
|
458
|
-
Param["hasVizConfigOverride"] = "hasVizConfigOverride";
|
|
459
435
|
})(Param || (Param = {}));
|
|
460
436
|
/**
|
|
461
437
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -509,6 +485,10 @@ var Action;
|
|
|
509
485
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
510
486
|
Action["LiveboardInfo"] = "pinboardInfo";
|
|
511
487
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
488
|
+
/**
|
|
489
|
+
* @deprecated Will be removed in next version
|
|
490
|
+
*/
|
|
491
|
+
Action["CustomAction"] = "customAction";
|
|
512
492
|
Action["DownloadEmbraceQueries"] = "downloadEmbraceQueries";
|
|
513
493
|
Action["Pin"] = "pin";
|
|
514
494
|
Action["AnalysisInfo"] = "analysisInfo";
|
|
@@ -524,26 +504,6 @@ var Action;
|
|
|
524
504
|
Action["DrillDown"] = "DRILL";
|
|
525
505
|
Action["RequestAccess"] = "requestAccess";
|
|
526
506
|
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
527
|
-
/**
|
|
528
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
529
|
-
*/
|
|
530
|
-
Action["Monitor"] = "createMonitor";
|
|
531
|
-
/**
|
|
532
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
533
|
-
*/
|
|
534
|
-
Action["AnswerDelete"] = "onDeleteAnswer";
|
|
535
|
-
/**
|
|
536
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
537
|
-
*/
|
|
538
|
-
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
539
|
-
/**
|
|
540
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
541
|
-
*/
|
|
542
|
-
Action["AddToFavorites"] = "addToFavorites";
|
|
543
|
-
/**
|
|
544
|
-
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
545
|
-
*/
|
|
546
|
-
Action["EditDetails"] = "editDetails";
|
|
547
507
|
})(Action || (Action = {}));
|
|
548
508
|
// eslint-disable-next-line no-shadow
|
|
549
509
|
var OperationType;
|
|
@@ -8739,6 +8699,7 @@ const handleAuth = () => {
|
|
|
8739
8699
|
thoughtSpotHost: getThoughtSpotHost(config),
|
|
8740
8700
|
};
|
|
8741
8701
|
authPromise = authenticate(authConfig);
|
|
8702
|
+
return authPromise;
|
|
8742
8703
|
};
|
|
8743
8704
|
const getEmbedConfig = () => config;
|
|
8744
8705
|
const getAuthPromise = () => authPromise;
|
|
@@ -8766,6 +8727,8 @@ const prefetch = (url) => {
|
|
|
8766
8727
|
* authentication if applicable.
|
|
8767
8728
|
* @param embedConfig The configuration object containing ThoughtSpot host,
|
|
8768
8729
|
* authentication mechanism and so on.
|
|
8730
|
+
*
|
|
8731
|
+
* @returns authPromise Promise which resolves when authentication is complete.
|
|
8769
8732
|
*/
|
|
8770
8733
|
const init = (embedConfig) => {
|
|
8771
8734
|
config = embedConfig;
|
|
@@ -8777,6 +8740,7 @@ const init = (embedConfig) => {
|
|
|
8777
8740
|
if (config.callPrefetch) {
|
|
8778
8741
|
prefetch(config.thoughtSpotHost);
|
|
8779
8742
|
}
|
|
8743
|
+
return authPromise;
|
|
8780
8744
|
};
|
|
8781
8745
|
let renderQueue = Promise.resolve();
|
|
8782
8746
|
/**
|
|
@@ -8871,7 +8835,7 @@ function processAuthInit(e) {
|
|
|
8871
8835
|
};
|
|
8872
8836
|
}
|
|
8873
8837
|
function processAuthExpire(e) {
|
|
8874
|
-
const { autoLogin =
|
|
8838
|
+
const { autoLogin = false } = getEmbedConfig(); // Set default to false
|
|
8875
8839
|
if (autoLogin) {
|
|
8876
8840
|
handleAuth();
|
|
8877
8841
|
}
|
|
@@ -8913,7 +8877,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
8913
8877
|
}
|
|
8914
8878
|
}
|
|
8915
8879
|
|
|
8916
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0
|
|
8880
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0";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/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1","mixpanel-browser":"^2.41.0"};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","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0",classnames:"^2.3.1","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,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};
|
|
8917
8881
|
|
|
8918
8882
|
/**
|
|
8919
8883
|
* Copyright (c) 2022
|
|
@@ -8956,7 +8920,6 @@ class TsEmbed {
|
|
|
8956
8920
|
this.isError = false;
|
|
8957
8921
|
this.viewConfig = viewConfig;
|
|
8958
8922
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
8959
|
-
this.registerPlugins(viewConfig === null || viewConfig === void 0 ? void 0 : viewConfig.plugins);
|
|
8960
8923
|
if (!this.embedConfig.suppressNoCookieAccessAlert) {
|
|
8961
8924
|
this.on(EmbedEvent.NoCookieAccess, () => {
|
|
8962
8925
|
// eslint-disable-next-line no-alert
|
|
@@ -8964,17 +8927,6 @@ class TsEmbed {
|
|
|
8964
8927
|
});
|
|
8965
8928
|
}
|
|
8966
8929
|
}
|
|
8967
|
-
registerPlugins(plugins) {
|
|
8968
|
-
if (!plugins) {
|
|
8969
|
-
return;
|
|
8970
|
-
}
|
|
8971
|
-
plugins.forEach((plugin) => {
|
|
8972
|
-
Object.keys(plugin.handlers).forEach((eventName) => {
|
|
8973
|
-
const listener = plugin.handlers[eventName];
|
|
8974
|
-
this.on(eventName, listener);
|
|
8975
|
-
});
|
|
8976
|
-
});
|
|
8977
|
-
}
|
|
8978
8930
|
/**
|
|
8979
8931
|
* Gets a reference to the root DOM node where
|
|
8980
8932
|
* the embedded content will appear.
|
|
@@ -9091,7 +9043,7 @@ class TsEmbed {
|
|
|
9091
9043
|
if (this.embedConfig.customCssUrl) {
|
|
9092
9044
|
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
9093
9045
|
}
|
|
9094
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions,
|
|
9046
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, } = this.viewConfig;
|
|
9095
9047
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
9096
9048
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
9097
9049
|
return queryParams;
|
|
@@ -9108,12 +9060,6 @@ class TsEmbed {
|
|
|
9108
9060
|
if (Array.isArray(visibleActions)) {
|
|
9109
9061
|
queryParams[Param.VisibleActions] = visibleActions;
|
|
9110
9062
|
}
|
|
9111
|
-
if (this.hasVizConfigOverride) {
|
|
9112
|
-
queryParams[Param.hasVizConfigOverride] = true;
|
|
9113
|
-
}
|
|
9114
|
-
if (additionalFlags && additionalFlags.constructor.name === 'Object') {
|
|
9115
|
-
Object.assign(queryParams, additionalFlags);
|
|
9116
|
-
}
|
|
9117
9063
|
return queryParams;
|
|
9118
9064
|
}
|
|
9119
9065
|
/**
|
|
@@ -9226,7 +9172,7 @@ class TsEmbed {
|
|
|
9226
9172
|
*/
|
|
9227
9173
|
executeCallbacks(eventType, data, eventPort) {
|
|
9228
9174
|
const callbacks = this.eventHandlerMap.get(eventType) || [];
|
|
9229
|
-
callbacks.forEach((callback) => callback
|
|
9175
|
+
callbacks.forEach((callback) => callback(data, (payload) => {
|
|
9230
9176
|
this.triggerEventOnPort(eventPort, payload);
|
|
9231
9177
|
}));
|
|
9232
9178
|
}
|
|
@@ -9291,9 +9237,6 @@ class TsEmbed {
|
|
|
9291
9237
|
if (this.isRendered) {
|
|
9292
9238
|
this.handleError('Please register event handlers before calling render');
|
|
9293
9239
|
}
|
|
9294
|
-
if (messageType === EmbedEvent.GetVizConfigOverrides) {
|
|
9295
|
-
this.hasVizConfigOverride = true;
|
|
9296
|
-
}
|
|
9297
9240
|
const callbacks = this.eventHandlerMap.get(messageType) || [];
|
|
9298
9241
|
callbacks.push(callback);
|
|
9299
9242
|
this.eventHandlerMap.set(messageType, callbacks);
|
|
@@ -9636,9 +9579,6 @@ class PinboardEmbed extends LiveboardEmbed {
|
|
|
9636
9579
|
const HiddenActionItemByDefaultForSearchEmbed = [
|
|
9637
9580
|
Action.EditACopy,
|
|
9638
9581
|
Action.SaveAsView,
|
|
9639
|
-
Action.UpdateTML,
|
|
9640
|
-
Action.EditTML,
|
|
9641
|
-
Action.AnswerDelete,
|
|
9642
9582
|
];
|
|
9643
9583
|
/**
|
|
9644
9584
|
* Embed ThoughtSpot search
|
|
@@ -9672,7 +9612,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
9672
9612
|
*/
|
|
9673
9613
|
getIFrameSrc(answerId, dataSources) {
|
|
9674
9614
|
var _a;
|
|
9675
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
|
|
9615
|
+
const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
|
|
9676
9616
|
const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
|
|
9677
9617
|
const queryParams = this.getBaseQueryParams();
|
|
9678
9618
|
queryParams[Param.HideActions] = [
|