@thoughtspot/visual-embed-sdk 1.7.0-alpha.1 → 1.8.0-alpha.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/README.md +1 -1
- package/dist/src/auth.d.ts +3 -5
- package/dist/src/embed/app.d.ts +1 -1
- package/dist/src/embed/liveboard.d.ts +1 -1
- package/dist/src/embed/pinboard.d.ts +85 -0
- package/dist/src/embed/search.d.ts +1 -1
- package/dist/src/embed/ts-embed.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/types.d.ts +37 -3
- package/dist/src/utils.d.ts +1 -1
- package/dist/tsembed.es.js +73 -18
- package/dist/tsembed.js +70 -18
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +3 -5
- package/lib/src/auth.js +27 -9
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +2 -2
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/config.js +1 -1
- package/lib/src/embed/app.d.ts +1 -1
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/base.js +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -1
- package/lib/src/embed/liveboard.js +1 -1
- package/lib/src/embed/pinboard.d.ts +85 -0
- package/lib/src/embed/pinboard.js +107 -0
- package/lib/src/embed/pinboard.js.map +1 -0
- package/lib/src/embed/search.d.ts +1 -1
- package/lib/src/embed/search.js +5 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +13 -12
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -1
- package/lib/src/embed/ts-embed.js +1 -1
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.js +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 +37 -3
- package/lib/src/types.js +35 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/fetchAnswers.d.ts +3 -0
- package/lib/src/utils/fetchAnswers.js +49 -0
- package/lib/src/utils/fetchAnswers.js.map +1 -0
- package/lib/src/utils.d.ts +1 -1
- package/lib/src/utils.js +1 -1
- package/lib/src/visual-embed-sdk.d.ts +41 -7
- package/package.json +1 -1
- package/src/auth.spec.ts +2 -2
- package/src/auth.ts +37 -9
- package/src/config.ts +1 -1
- package/src/embed/app.ts +1 -1
- package/src/embed/base.ts +1 -1
- package/src/embed/liveboard.ts +1 -1
- package/src/embed/search.spec.ts +13 -12
- package/src/embed/search.ts +5 -2
- package/src/embed/ts-embed.ts +1 -1
- package/src/index.ts +1 -1
- package/src/react/index.spec.tsx +1 -1
- package/src/types.ts +35 -1
- package/src/utils.ts +1 -1
package/README.md
CHANGED
package/dist/src/auth.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export declare let sessionInfo: any;
|
|
|
6
6
|
export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
7
7
|
export declare const EndPoints: {
|
|
8
8
|
AUTH_VERIFICATION: string;
|
|
9
|
-
|
|
9
|
+
SAML_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
10
|
+
OIDC_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
10
11
|
TOKEN_LOGIN: string;
|
|
11
12
|
BASIC_LOGIN: string;
|
|
12
13
|
};
|
|
@@ -29,11 +30,8 @@ export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<void>;
|
|
|
29
30
|
* @param embedConfig The embed configuration
|
|
30
31
|
*/
|
|
31
32
|
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Perform SAML authentication
|
|
34
|
-
* @param embedConfig The embed configuration
|
|
35
|
-
*/
|
|
36
33
|
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<void>;
|
|
34
|
+
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<void>;
|
|
37
35
|
/**
|
|
38
36
|
* Perform authentication on the ThoughtSpot cluster
|
|
39
37
|
* @param embedConfig The embed configuration
|
package/dist/src/embed/app.d.ts
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021
|
|
3
|
+
*
|
|
4
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
5
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
|
+
*
|
|
8
|
+
* @summary Pinboard & visualization embed
|
|
9
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
|
+
*/
|
|
11
|
+
import { DOMSelector } from '../types';
|
|
12
|
+
import { V1Embed, ViewConfig } from './ts-embed';
|
|
13
|
+
/**
|
|
14
|
+
* The configuration for the embedded pinboard or visualization page view.
|
|
15
|
+
* @Category Pinboards and Charts
|
|
16
|
+
*/
|
|
17
|
+
export interface PinboardViewConfig extends ViewConfig {
|
|
18
|
+
/**
|
|
19
|
+
* If set to true, the embedded object container dynamically resizes
|
|
20
|
+
* according to the height of the pinboard.
|
|
21
|
+
*/
|
|
22
|
+
fullHeight?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* This is the minimum height(in pixels) for a full height pinboard.
|
|
25
|
+
* Setting this height helps resolves issues with empty pinboards and
|
|
26
|
+
* other screens navigable from a pinboard.
|
|
27
|
+
* @default 500
|
|
28
|
+
* * _since 1.5.0_
|
|
29
|
+
*/
|
|
30
|
+
defaultHeight?: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set to true, the context menu in visualizations will be enabled.
|
|
33
|
+
*/
|
|
34
|
+
enableVizTransformations?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The pinboard to display in the embedded view.
|
|
37
|
+
*/
|
|
38
|
+
pinboardId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The visualization within the pinboard to display.
|
|
41
|
+
*/
|
|
42
|
+
vizId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* If set to true, all filter chips from a
|
|
45
|
+
* pinboard page will be read-only (no X buttons)
|
|
46
|
+
*/
|
|
47
|
+
preventPinboardFilterRemoval?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
51
|
+
* @Category Pinboards and Charts
|
|
52
|
+
*/
|
|
53
|
+
export declare class PinboardEmbed extends V1Embed {
|
|
54
|
+
protected viewConfig: PinboardViewConfig;
|
|
55
|
+
private defaultHeight;
|
|
56
|
+
constructor(domSelector: DOMSelector, viewConfig: PinboardViewConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Construct a map of params to be passed on to the
|
|
59
|
+
* embedded pinboard or visualization.
|
|
60
|
+
*/
|
|
61
|
+
private getEmbedParams;
|
|
62
|
+
/**
|
|
63
|
+
* Construct the URL of the embedded ThoughtSpot pinboard or visualization
|
|
64
|
+
* to be loaded within the iframe.
|
|
65
|
+
* @param pinboardId The GUID of the pinboard.
|
|
66
|
+
* @param vizId The optional GUID of a visualization within the pinboard.
|
|
67
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
68
|
+
* the pinboard or visualization on load.
|
|
69
|
+
*/
|
|
70
|
+
private getIFrameSrc;
|
|
71
|
+
/**
|
|
72
|
+
* Set the iframe height as per the computed height received
|
|
73
|
+
* from the ThoughtSpot app.
|
|
74
|
+
* @param data The event payload
|
|
75
|
+
*/
|
|
76
|
+
private updateIFrameHeight;
|
|
77
|
+
private embedIframeCenter;
|
|
78
|
+
private handleRouteChangeFullHeightPinboard;
|
|
79
|
+
/**
|
|
80
|
+
* Render an embedded ThoughtSpot pinboard or visualization
|
|
81
|
+
* @param renderOptions An object specifying the pinboard ID,
|
|
82
|
+
* visualization ID and the runtime filters.
|
|
83
|
+
*/
|
|
84
|
+
render(): PinboardEmbed;
|
|
85
|
+
}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2022
|
|
3
3
|
*
|
|
4
4
|
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
5
5
|
*
|
|
@@ -19,6 +19,10 @@ export declare enum AuthType {
|
|
|
19
19
|
* SSO using SAML
|
|
20
20
|
*/
|
|
21
21
|
SSO = "SSO_SAML",
|
|
22
|
+
/**
|
|
23
|
+
* SSO using OIDC
|
|
24
|
+
*/
|
|
25
|
+
OIDC = "SSO_OIDC",
|
|
22
26
|
/**
|
|
23
27
|
* Trusted authentication server
|
|
24
28
|
*/
|
|
@@ -331,6 +335,9 @@ export declare enum EmbedEvent {
|
|
|
331
335
|
/**
|
|
332
336
|
* Event types that can be triggered by the host application
|
|
333
337
|
* to the embedded ThoughtSpot app
|
|
338
|
+
*
|
|
339
|
+
* To trigger an event use the corresponding
|
|
340
|
+
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link SearchEmbed.trigger} method.
|
|
334
341
|
*/
|
|
335
342
|
export declare enum HostEvent {
|
|
336
343
|
/**
|
|
@@ -364,7 +371,13 @@ export declare enum HostEvent {
|
|
|
364
371
|
* will be hidden.
|
|
365
372
|
* @version 1.6.0 or later
|
|
366
373
|
*/
|
|
367
|
-
SetVisibleVizs = "SetPinboardVisibleVizs"
|
|
374
|
+
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
375
|
+
/**
|
|
376
|
+
* Update the runtime filters
|
|
377
|
+
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
378
|
+
* @version 1.8.0 or later
|
|
379
|
+
*/
|
|
380
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
368
381
|
}
|
|
369
382
|
/**
|
|
370
383
|
* The different visual modes that the data sources panel within
|
|
@@ -408,6 +421,7 @@ export declare enum Param {
|
|
|
408
421
|
executeSearch = "executeSearch",
|
|
409
422
|
fullHeight = "isFullHeightPinboard",
|
|
410
423
|
livedBoardEmbed = "isLiveboardEmbed",
|
|
424
|
+
searchEmbed = "isSearchEmbed",
|
|
411
425
|
Version = "sdkVersion",
|
|
412
426
|
ViewPortHeight = "viewPortHeight",
|
|
413
427
|
ViewPortWidth = "viewPortWidth",
|
|
@@ -482,7 +496,27 @@ export declare enum Action {
|
|
|
482
496
|
Separator = "context-menu-item-separator",
|
|
483
497
|
DrillDown = "DRILL",
|
|
484
498
|
RequestAccess = "requestAccess",
|
|
485
|
-
QueryDetailsButtons = "queryDetailsButtons"
|
|
499
|
+
QueryDetailsButtons = "queryDetailsButtons",
|
|
500
|
+
/**
|
|
501
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
502
|
+
*/
|
|
503
|
+
Monitor = "createMonitor",
|
|
504
|
+
/**
|
|
505
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
506
|
+
*/
|
|
507
|
+
AnswerDelete = "onDeleteAnswer",
|
|
508
|
+
/**
|
|
509
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
510
|
+
*/
|
|
511
|
+
AnswerChartSwitcher = "answerChartSwitcher",
|
|
512
|
+
/**
|
|
513
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
514
|
+
*/
|
|
515
|
+
AddToFavorites = "addToFavorites",
|
|
516
|
+
/**
|
|
517
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
518
|
+
*/
|
|
519
|
+
EditDetails = "editDetails"
|
|
486
520
|
}
|
|
487
521
|
export interface SessionInterface {
|
|
488
522
|
sessionId: string;
|
package/dist/src/utils.d.ts
CHANGED
package/dist/tsembed.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2022
|
|
3
3
|
*
|
|
4
4
|
* Common utility functions for ThoughtSpot Visual Embed SDK
|
|
5
5
|
*
|
|
@@ -111,7 +111,7 @@ const getOffsetTop = (element) => {
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* Copyright (c)
|
|
114
|
+
* Copyright (c) 2022
|
|
115
115
|
*
|
|
116
116
|
* TypeScript type definitions for ThoughtSpot Visual Embed SDK
|
|
117
117
|
*
|
|
@@ -133,6 +133,10 @@ var AuthType;
|
|
|
133
133
|
* SSO using SAML
|
|
134
134
|
*/
|
|
135
135
|
AuthType["SSO"] = "SSO_SAML";
|
|
136
|
+
/**
|
|
137
|
+
* SSO using OIDC
|
|
138
|
+
*/
|
|
139
|
+
AuthType["OIDC"] = "SSO_OIDC";
|
|
136
140
|
/**
|
|
137
141
|
* Trusted authentication server
|
|
138
142
|
*/
|
|
@@ -329,6 +333,9 @@ var EmbedEvent;
|
|
|
329
333
|
/**
|
|
330
334
|
* Event types that can be triggered by the host application
|
|
331
335
|
* to the embedded ThoughtSpot app
|
|
336
|
+
*
|
|
337
|
+
* To trigger an event use the corresponding
|
|
338
|
+
* {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link SearchEmbed.trigger} method.
|
|
332
339
|
*/
|
|
333
340
|
// eslint-disable-next-line no-shadow
|
|
334
341
|
var HostEvent;
|
|
@@ -365,6 +372,12 @@ var HostEvent;
|
|
|
365
372
|
* @version 1.6.0 or later
|
|
366
373
|
*/
|
|
367
374
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
375
|
+
/**
|
|
376
|
+
* Update the runtime filters
|
|
377
|
+
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
378
|
+
* @version 1.8.0 or later
|
|
379
|
+
*/
|
|
380
|
+
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
368
381
|
})(HostEvent || (HostEvent = {}));
|
|
369
382
|
/**
|
|
370
383
|
* The different visual modes that the data sources panel within
|
|
@@ -412,6 +425,7 @@ var Param;
|
|
|
412
425
|
Param["executeSearch"] = "executeSearch";
|
|
413
426
|
Param["fullHeight"] = "isFullHeightPinboard";
|
|
414
427
|
Param["livedBoardEmbed"] = "isLiveboardEmbed";
|
|
428
|
+
Param["searchEmbed"] = "isSearchEmbed";
|
|
415
429
|
Param["Version"] = "sdkVersion";
|
|
416
430
|
Param["ViewPortHeight"] = "viewPortHeight";
|
|
417
431
|
Param["ViewPortWidth"] = "viewPortWidth";
|
|
@@ -489,6 +503,26 @@ var Action;
|
|
|
489
503
|
Action["DrillDown"] = "DRILL";
|
|
490
504
|
Action["RequestAccess"] = "requestAccess";
|
|
491
505
|
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
506
|
+
/**
|
|
507
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
508
|
+
*/
|
|
509
|
+
Action["Monitor"] = "createMonitor";
|
|
510
|
+
/**
|
|
511
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
512
|
+
*/
|
|
513
|
+
Action["AnswerDelete"] = "onDeleteAnswer";
|
|
514
|
+
/**
|
|
515
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
516
|
+
*/
|
|
517
|
+
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
518
|
+
/**
|
|
519
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
520
|
+
*/
|
|
521
|
+
Action["AddToFavorites"] = "addToFavorites";
|
|
522
|
+
/**
|
|
523
|
+
* @version SDK: 1.8.0 | ThoughtSpot: 8.1.0.cl
|
|
524
|
+
*/
|
|
525
|
+
Action["EditDetails"] = "editDetails";
|
|
492
526
|
})(Action || (Action = {}));
|
|
493
527
|
// eslint-disable-next-line no-shadow
|
|
494
528
|
var OperationType;
|
|
@@ -503,7 +537,7 @@ const ERROR_MESSAGE = {
|
|
|
503
537
|
};
|
|
504
538
|
|
|
505
539
|
/**
|
|
506
|
-
* Copyright (c)
|
|
540
|
+
* Copyright (c) 2022
|
|
507
541
|
*
|
|
508
542
|
* Utilities related to reading configuration objects
|
|
509
543
|
*
|
|
@@ -8497,7 +8531,8 @@ let sessionInfo = null;
|
|
|
8497
8531
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
8498
8532
|
const EndPoints = {
|
|
8499
8533
|
AUTH_VERIFICATION: '/callosum/v1/session/info',
|
|
8500
|
-
|
|
8534
|
+
SAML_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/saml/login?targetURLPath=${targetUrl}`,
|
|
8535
|
+
OIDC_LOGIN_TEMPLATE: (targetUrl) => `/callosum/v1/oidc/login?targetURLPath=${targetUrl}`,
|
|
8501
8536
|
TOKEN_LOGIN: '/callosum/v1/session/login/token',
|
|
8502
8537
|
BASIC_LOGIN: '/callosum/v1/session/login',
|
|
8503
8538
|
};
|
|
@@ -8605,7 +8640,7 @@ async function samlPopupFlow(ssoURL) {
|
|
|
8605
8640
|
* Perform SAML authentication
|
|
8606
8641
|
* @param embedConfig The embed configuration
|
|
8607
8642
|
*/
|
|
8608
|
-
const
|
|
8643
|
+
const doSSOAuth = async (embedConfig, ssoEndPoint) => {
|
|
8609
8644
|
const { thoughtSpotHost } = embedConfig;
|
|
8610
8645
|
const loggedIn = await isLoggedIn(thoughtSpotHost);
|
|
8611
8646
|
if (loggedIn) {
|
|
@@ -8622,13 +8657,6 @@ const doSamlAuth = async (embedConfig) => {
|
|
|
8622
8657
|
loggedInStatus = false;
|
|
8623
8658
|
return;
|
|
8624
8659
|
}
|
|
8625
|
-
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
8626
|
-
// again and the same JS will execute again.
|
|
8627
|
-
const ssoRedirectUrl = embedConfig.noRedirect
|
|
8628
|
-
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
8629
|
-
: appendToUrlHash(window.location.href, SSO_REDIRECTION_MARKER_GUID);
|
|
8630
|
-
// bring back the page to the same URL
|
|
8631
|
-
const ssoEndPoint = `${EndPoints.SSO_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8632
8660
|
const ssoURL = `${thoughtSpotHost}${ssoEndPoint}`;
|
|
8633
8661
|
if (embedConfig.noRedirect) {
|
|
8634
8662
|
await samlPopupFlow(ssoURL);
|
|
@@ -8636,6 +8664,28 @@ const doSamlAuth = async (embedConfig) => {
|
|
|
8636
8664
|
}
|
|
8637
8665
|
window.location.href = ssoURL;
|
|
8638
8666
|
};
|
|
8667
|
+
const doSamlAuth = async (embedConfig) => {
|
|
8668
|
+
const { thoughtSpotHost } = embedConfig;
|
|
8669
|
+
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
8670
|
+
// again and the same JS will execute again.
|
|
8671
|
+
const ssoRedirectUrl = embedConfig.noRedirect
|
|
8672
|
+
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
8673
|
+
: appendToUrlHash(window.location.href, SSO_REDIRECTION_MARKER_GUID);
|
|
8674
|
+
// bring back the page to the same URL
|
|
8675
|
+
const ssoEndPoint = `${EndPoints.SAML_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8676
|
+
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
8677
|
+
};
|
|
8678
|
+
const doOIDCAuth = async (embedConfig) => {
|
|
8679
|
+
const { thoughtSpotHost } = embedConfig;
|
|
8680
|
+
// redirect for SSO, when the SSO authentication is done, this page will be loaded
|
|
8681
|
+
// again and the same JS will execute again.
|
|
8682
|
+
const ssoRedirectUrl = embedConfig.noRedirect
|
|
8683
|
+
? `${thoughtSpotHost}/v2/#/embed/saml-complete`
|
|
8684
|
+
: appendToUrlHash(window.location.href, SSO_REDIRECTION_MARKER_GUID);
|
|
8685
|
+
// bring back the page to the same URL
|
|
8686
|
+
const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
|
|
8687
|
+
await doSSOAuth(embedConfig, ssoEndPoint);
|
|
8688
|
+
};
|
|
8639
8689
|
/**
|
|
8640
8690
|
* Perform authentication on the ThoughtSpot cluster
|
|
8641
8691
|
* @param embedConfig The embed configuration
|
|
@@ -8645,6 +8695,8 @@ const authenticate = async (embedConfig) => {
|
|
|
8645
8695
|
switch (authType) {
|
|
8646
8696
|
case AuthType.SSO:
|
|
8647
8697
|
return doSamlAuth(embedConfig);
|
|
8698
|
+
case AuthType.OIDC:
|
|
8699
|
+
return doOIDCAuth(embedConfig);
|
|
8648
8700
|
case AuthType.AuthServer:
|
|
8649
8701
|
return doTokenAuth(embedConfig);
|
|
8650
8702
|
case AuthType.Basic:
|
|
@@ -8840,10 +8892,10 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
8840
8892
|
}
|
|
8841
8893
|
}
|
|
8842
8894
|
|
|
8843
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.
|
|
8895
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];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","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};
|
|
8844
8896
|
|
|
8845
8897
|
/**
|
|
8846
|
-
* Copyright (c)
|
|
8898
|
+
* Copyright (c) 2022
|
|
8847
8899
|
*
|
|
8848
8900
|
* Base classes
|
|
8849
8901
|
*
|
|
@@ -9274,7 +9326,7 @@ class V1Embed extends TsEmbed {
|
|
|
9274
9326
|
}
|
|
9275
9327
|
|
|
9276
9328
|
/**
|
|
9277
|
-
* Copyright (c)
|
|
9329
|
+
* Copyright (c) 2022
|
|
9278
9330
|
*
|
|
9279
9331
|
* Full application embedding
|
|
9280
9332
|
* https://developers.thoughtspot.com/docs/?pageid=full-embed
|
|
@@ -9421,7 +9473,7 @@ class AppEmbed extends V1Embed {
|
|
|
9421
9473
|
}
|
|
9422
9474
|
|
|
9423
9475
|
/**
|
|
9424
|
-
* Copyright (c)
|
|
9476
|
+
* Copyright (c) 2022
|
|
9425
9477
|
*
|
|
9426
9478
|
* Embed a ThoughtSpot Liveboard or visualization
|
|
9427
9479
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
@@ -9532,7 +9584,7 @@ class PinboardEmbed extends LiveboardEmbed {
|
|
|
9532
9584
|
}
|
|
9533
9585
|
|
|
9534
9586
|
/**
|
|
9535
|
-
* Copyright (c)
|
|
9587
|
+
* Copyright (c) 2022
|
|
9536
9588
|
*
|
|
9537
9589
|
* Embed ThoughtSpot search or a saved answer
|
|
9538
9590
|
*
|
|
@@ -9541,8 +9593,10 @@ class PinboardEmbed extends LiveboardEmbed {
|
|
|
9541
9593
|
*/
|
|
9542
9594
|
const HiddenActionItemByDefaultForSearchEmbed = [
|
|
9543
9595
|
Action.EditACopy,
|
|
9544
|
-
Action.SpotIQAnalyze,
|
|
9545
9596
|
Action.SaveAsView,
|
|
9597
|
+
Action.UpdateTML,
|
|
9598
|
+
Action.EditTML,
|
|
9599
|
+
Action.AnswerDelete,
|
|
9546
9600
|
];
|
|
9547
9601
|
/**
|
|
9548
9602
|
* Embed ThoughtSpot search
|
|
@@ -9603,6 +9657,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
9603
9657
|
}
|
|
9604
9658
|
queryParams[Param.DataSourceMode] = this.getDataSourceMode();
|
|
9605
9659
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
9660
|
+
queryParams[Param.searchEmbed] = true;
|
|
9606
9661
|
let query = '';
|
|
9607
9662
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
9608
9663
|
if (queryParamsString) {
|