@thoughtspot/visual-embed-sdk 1.32.0-alpha.2 → 1.32.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/cjs/package.json +2 -2
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +6 -5
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +5 -7
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/embed/app.d.ts +8 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +2 -2
- package/cjs/src/embed/app.js.map +1 -1
- 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/search.d.ts +28 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +8 -3
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +13 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +10 -6
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/errors.d.ts +11 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +11 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +2 -1
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/react/index.spec.js +1 -1
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +169 -12
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +142 -9
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/global-styles.js +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js +9 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +2 -1
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/reporting.d.ts +16 -0
- package/cjs/src/utils/reporting.d.ts.map +1 -0
- package/cjs/src/utils/reporting.js +68 -0
- package/cjs/src/utils/reporting.js.map +1 -0
- package/cjs/src/utils/reporting.spec.d.ts +2 -0
- package/cjs/src/utils/reporting.spec.d.ts.map +1 -0
- package/cjs/src/utils/reporting.spec.js +76 -0
- package/cjs/src/utils/reporting.spec.js.map +1 -0
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +8 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +28 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +11 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/types.d.ts +169 -12
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/src/utils/reporting.d.ts +16 -0
- package/dist/src/utils/reporting.d.ts.map +1 -0
- package/dist/src/utils/reporting.spec.d.ts +2 -0
- package/dist/src/utils/reporting.spec.d.ts.map +1 -0
- package/dist/tsembed-react.es.js +208 -43
- package/dist/tsembed-react.js +208 -43
- package/dist/tsembed.es.js +255 -44
- package/dist/tsembed.js +255 -44
- package/dist/visual-embed-sdk-react-full.d.ts +206 -14
- package/dist/visual-embed-sdk-react.d.ts +206 -14
- package/dist/visual-embed-sdk.d.ts +206 -14
- package/lib/package.json +2 -2
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +6 -5
- package/lib/src/auth.js.map +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +5 -7
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/embed/app.d.ts +8 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +2 -2
- package/lib/src/embed/app.js.map +1 -1
- 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/search.d.ts +28 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +8 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +13 -0
- 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.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +10 -6
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/errors.d.ts +11 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +11 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +2 -1
- package/lib/src/mixpanel-service.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 +169 -12
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +142 -9
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/global-styles.js +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.js +9 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +2 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/reporting.d.ts +16 -0
- package/lib/src/utils/reporting.d.ts.map +1 -0
- package/lib/src/utils/reporting.js +62 -0
- package/lib/src/utils/reporting.js.map +1 -0
- package/lib/src/utils/reporting.spec.d.ts +2 -0
- package/lib/src/utils/reporting.spec.d.ts.map +1 -0
- package/lib/src/utils/reporting.spec.js +74 -0
- package/lib/src/utils/reporting.spec.js.map +1 -0
- package/lib/src/visual-embed-sdk.d.ts +206 -14
- package/package.json +2 -2
- package/src/auth.ts +6 -5
- package/src/authToken.ts +5 -9
- package/src/embed/app.ts +16 -5
- package/src/embed/base.ts +3 -1
- package/src/embed/search.spec.ts +17 -0
- package/src/embed/search.ts +38 -2
- package/src/embed/ts-embed.ts +13 -6
- package/src/errors.ts +11 -0
- package/src/mixpanel-service.ts +2 -1
- package/src/react/index.spec.tsx +1 -1
- package/src/types.ts +182 -19
- package/src/utils/global-styles.ts +1 -1
- package/src/utils/graphql/answerService/answer-queries.ts +9 -0
- package/src/utils/processData.ts +2 -3
- package/src/utils/reporting.spec.ts +91 -0
- package/src/utils/reporting.ts +71 -0
package/src/embed/search.ts
CHANGED
|
@@ -88,6 +88,19 @@ export interface SearchViewConfig
|
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
90
|
collapseDataSources?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* If set to true, the data panel is collapsed on load,
|
|
93
|
+
* but can be expanded manually.
|
|
94
|
+
* @version: SDK: 1.34.0 | ThoughtSpot: 10.3.0.cl
|
|
95
|
+
* @example
|
|
96
|
+
* ```js
|
|
97
|
+
* const embed = new SearchEmbed('#tsEmbed', {
|
|
98
|
+
* ... // other options
|
|
99
|
+
* collapseDataPanel:true,
|
|
100
|
+
* })
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
collapseDataPanel?: boolean;
|
|
91
104
|
/**
|
|
92
105
|
* Show or hide the data sources panel.
|
|
93
106
|
* @version: SDK: 1.2.0 | ThoughtSpot: 9.1.0.sw
|
|
@@ -236,6 +249,7 @@ export interface SearchViewConfig
|
|
|
236
249
|
* To set the initial state of the search bar in case of saved-answers.
|
|
237
250
|
* @default false
|
|
238
251
|
* @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
|
|
252
|
+
* @deprecated Use {@link collapseSearchBar} instead
|
|
239
253
|
*/
|
|
240
254
|
collapseSearchBarInitially?: boolean;
|
|
241
255
|
/**
|
|
@@ -275,6 +289,20 @@ export interface SearchViewConfig
|
|
|
275
289
|
* ```
|
|
276
290
|
*/
|
|
277
291
|
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState;
|
|
292
|
+
/**
|
|
293
|
+
* Flag to remove focus from search bar initially when user
|
|
294
|
+
* lands on search embed page.
|
|
295
|
+
* @version SDK: 1.32.0 | Thoughtspot: 10.3.0.cl
|
|
296
|
+
* @default true
|
|
297
|
+
* @example
|
|
298
|
+
* ```js
|
|
299
|
+
* const embed = new SearchEmbed('#tsEmbed', {
|
|
300
|
+
* ... // other options
|
|
301
|
+
* focusSearchBarOnRender: false,
|
|
302
|
+
* });
|
|
303
|
+
* ```
|
|
304
|
+
*/
|
|
305
|
+
focusSearchBarOnRender?: boolean;
|
|
278
306
|
}
|
|
279
307
|
|
|
280
308
|
export const HiddenActionItemByDefaultForSearchEmbed = [
|
|
@@ -306,7 +334,8 @@ export class SearchEmbed extends TsEmbed {
|
|
|
306
334
|
*/
|
|
307
335
|
private getDataSourceMode() {
|
|
308
336
|
let dataSourceMode = DataSourceVisualMode.Expanded;
|
|
309
|
-
if (this.viewConfig.collapseDataSources === true
|
|
337
|
+
if (this.viewConfig.collapseDataSources === true
|
|
338
|
+
|| this.viewConfig.collapseDataPanel === true) {
|
|
310
339
|
dataSourceMode = DataSourceVisualMode.Collapsed;
|
|
311
340
|
}
|
|
312
341
|
if (this.viewConfig.hideDataSources === true) {
|
|
@@ -335,7 +364,9 @@ export class SearchEmbed extends TsEmbed {
|
|
|
335
364
|
isOnBeforeGetVizDataInterceptEnabled = false,
|
|
336
365
|
/* eslint-disable-next-line max-len */
|
|
337
366
|
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
|
|
367
|
+
focusSearchBarOnRender = true,
|
|
338
368
|
excludeRuntimeParametersfromURL,
|
|
369
|
+
collapseSearchBar = true,
|
|
339
370
|
} = this.viewConfig;
|
|
340
371
|
const queryParams = this.getBaseQueryParams();
|
|
341
372
|
|
|
@@ -378,6 +409,10 @@ export class SearchEmbed extends TsEmbed {
|
|
|
378
409
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
379
410
|
}
|
|
380
411
|
|
|
412
|
+
if (!focusSearchBarOnRender) {
|
|
413
|
+
queryParams[Param.FocusSearchBarOnRender] = focusSearchBarOnRender;
|
|
414
|
+
}
|
|
415
|
+
|
|
381
416
|
queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
382
417
|
queryParams[Param.DataSourceMode] = this.getDataSourceMode();
|
|
383
418
|
|
|
@@ -387,7 +422,8 @@ export class SearchEmbed extends TsEmbed {
|
|
|
387
422
|
}
|
|
388
423
|
|
|
389
424
|
queryParams[Param.searchEmbed] = true;
|
|
390
|
-
|
|
425
|
+
/* eslint-disable-next-line max-len */
|
|
426
|
+
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
391
427
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
392
428
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
393
429
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -59,6 +59,7 @@ import {
|
|
|
59
59
|
} from './base';
|
|
60
60
|
import { AuthFailureType } from '../auth';
|
|
61
61
|
import { getEmbedConfig } from './embedConfig';
|
|
62
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
62
63
|
|
|
63
64
|
const { version } = pkgInfo;
|
|
64
65
|
|
|
@@ -347,7 +348,7 @@ export class TsEmbed {
|
|
|
347
348
|
data: { authToken },
|
|
348
349
|
});
|
|
349
350
|
} catch (e) {
|
|
350
|
-
logger.error(
|
|
351
|
+
logger.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e?.message}`);
|
|
351
352
|
processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
352
353
|
}
|
|
353
354
|
} else if (autoLogin) {
|
|
@@ -387,7 +388,9 @@ export class TsEmbed {
|
|
|
387
388
|
* @param queryParams
|
|
388
389
|
* @returns queryParams
|
|
389
390
|
*/
|
|
390
|
-
protected getBaseQueryParams(
|
|
391
|
+
protected getBaseQueryParams(
|
|
392
|
+
queryParams: Record<any, any> = {},
|
|
393
|
+
) {
|
|
391
394
|
let hostAppUrl = window?.location?.host || '';
|
|
392
395
|
|
|
393
396
|
// The below check is needed because TS Cloud firewall, blocks
|
|
@@ -438,6 +441,7 @@ export class TsEmbed {
|
|
|
438
441
|
contextMenuTrigger,
|
|
439
442
|
linkOverride,
|
|
440
443
|
insertInToSlide,
|
|
444
|
+
disableRedirectionLinksInNewTab,
|
|
441
445
|
} = this.viewConfig;
|
|
442
446
|
|
|
443
447
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
@@ -505,6 +509,9 @@ export class TsEmbed {
|
|
|
505
509
|
if (insertInToSlide) {
|
|
506
510
|
queryParams[Param.ShowInsertToSlide] = insertInToSlide;
|
|
507
511
|
}
|
|
512
|
+
if (disableRedirectionLinksInNewTab) {
|
|
513
|
+
queryParams[Param.DisableRedirectionLinksInNewTab] = disableRedirectionLinksInNewTab;
|
|
514
|
+
}
|
|
508
515
|
|
|
509
516
|
queryParams[Param.OverrideNativeConsole] = true;
|
|
510
517
|
queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
|
|
@@ -557,7 +564,7 @@ export class TsEmbed {
|
|
|
557
564
|
iFrame.mozallowfullscreen = true;
|
|
558
565
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
559
566
|
// @ts-ignore
|
|
560
|
-
iFrame.allow = 'clipboard-read; clipboard-write';
|
|
567
|
+
iFrame.allow = 'clipboard-read; clipboard-write fullscreen';
|
|
561
568
|
|
|
562
569
|
const {
|
|
563
570
|
height: frameHeight,
|
|
@@ -1000,7 +1007,7 @@ export class TsEmbed {
|
|
|
1000
1007
|
*/
|
|
1001
1008
|
public preRender(showPreRenderByDefault = false): TsEmbed {
|
|
1002
1009
|
if (!this.viewConfig.preRenderId) {
|
|
1003
|
-
logger.error(
|
|
1010
|
+
logger.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
1004
1011
|
return this;
|
|
1005
1012
|
}
|
|
1006
1013
|
this.isPreRendered = true;
|
|
@@ -1107,7 +1114,7 @@ export class TsEmbed {
|
|
|
1107
1114
|
*/
|
|
1108
1115
|
public showPreRender(): void {
|
|
1109
1116
|
if (!this.viewConfig.preRenderId) {
|
|
1110
|
-
logger.error(
|
|
1117
|
+
logger.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
1111
1118
|
return;
|
|
1112
1119
|
}
|
|
1113
1120
|
if (!this.isPreRenderAvailable()) {
|
|
@@ -1155,7 +1162,7 @@ export class TsEmbed {
|
|
|
1155
1162
|
*/
|
|
1156
1163
|
public syncPreRenderStyle(): void {
|
|
1157
1164
|
if (!this.isPreRenderAvailable() || !this.el) {
|
|
1158
|
-
logger.error(
|
|
1165
|
+
logger.error(ERROR_MESSAGE.SYNC_STYLE_CALLED_BEFORE_RENDER);
|
|
1159
1166
|
return;
|
|
1160
1167
|
}
|
|
1161
1168
|
const elBoundingClient = this.el.getBoundingClientRect();
|
package/src/errors.ts
CHANGED
|
@@ -4,4 +4,15 @@ export const ERROR_MESSAGE = {
|
|
|
4
4
|
TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
|
|
5
5
|
SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
|
|
6
6
|
SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
|
|
7
|
+
THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
|
|
8
|
+
DUPLICATE_TOKEN_ERR: 'Duplicate token, please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
|
|
9
|
+
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
10
|
+
SESSION_INFO_FAILED: 'Failed to get session info',
|
|
11
|
+
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
12
|
+
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
13
|
+
PRERENDER_ID_MISSING: 'PreRender id is required for preRender',
|
|
14
|
+
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
15
|
+
CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
|
|
16
|
+
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please setup CSP Correctly for the Application to start working. You can know more about setting CSP Correctly here: https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n In case you are still facing error, please read: https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
17
|
+
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7
18
|
};
|
package/src/mixpanel-service.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as mixpanel from 'mixpanel-browser';
|
|
2
2
|
import { logger } from './utils/logger';
|
|
3
3
|
import { SessionInfo } from './utils/sessionInfoService';
|
|
4
|
+
import { ERROR_MESSAGE } from './errors';
|
|
4
5
|
|
|
5
6
|
export const EndPoints = {
|
|
6
7
|
CONFIG: '/callosum/v1/system/config',
|
|
@@ -57,7 +58,7 @@ function emptyQueue() {
|
|
|
57
58
|
*/
|
|
58
59
|
export function initMixpanel(sessionInfo: SessionInfo): void {
|
|
59
60
|
if (!sessionInfo || !sessionInfo.mixpanelToken) {
|
|
60
|
-
logger.error(
|
|
61
|
+
logger.error(ERROR_MESSAGE.MIXPANEL_TOKEN_NOT_FOUND);
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
64
|
// On a public cluster the user is anonymous, so don't set the identify to
|
package/src/react/index.spec.tsx
CHANGED
|
@@ -56,7 +56,7 @@ describe('React Components', () => {
|
|
|
56
56
|
),
|
|
57
57
|
).toBe(true);
|
|
58
58
|
expect(getIFrameSrc(container)).toBe(
|
|
59
|
-
`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&overrideConsoleLogs=true&clientLogLevel=ERROR&enableDataPanelV2=false&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true&collapseSearchBarInitially=
|
|
59
|
+
`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&overrideConsoleLogs=true&clientLogLevel=ERROR&enableDataPanelV2=false&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true&collapseSearchBarInitially=true&enableCustomColumnGroups=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_ALL#/embed/answer`,
|
|
60
60
|
);
|
|
61
61
|
});
|
|
62
62
|
|
package/src/types.ts
CHANGED
|
@@ -201,6 +201,10 @@ export enum HomeLeftNavItem {
|
|
|
201
201
|
* @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
|
|
202
202
|
*/
|
|
203
203
|
SpotIQAnalysis = 'spotiq-analysis',
|
|
204
|
+
/**
|
|
205
|
+
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
206
|
+
*/
|
|
207
|
+
LiveboardSchedules = 'liveboard-schedules'
|
|
204
208
|
}
|
|
205
209
|
export type DOMSelector = string | HTMLElement;
|
|
206
210
|
|
|
@@ -588,7 +592,7 @@ export interface EmbedConfig {
|
|
|
588
592
|
}
|
|
589
593
|
|
|
590
594
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
591
|
-
export interface LayoutConfig {}
|
|
595
|
+
export interface LayoutConfig { }
|
|
592
596
|
|
|
593
597
|
/**
|
|
594
598
|
* Embedded iframe configuration
|
|
@@ -1012,6 +1016,30 @@ export interface ViewConfig {
|
|
|
1012
1016
|
*/
|
|
1013
1017
|
// eslint-disable-next-line camelcase
|
|
1014
1018
|
enableV2Shell_experimental?: boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* To set the initial state of the search bar in case of saved-answers.
|
|
1021
|
+
* @default true
|
|
1022
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```js
|
|
1025
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
1026
|
+
* liveboardId: '123',
|
|
1027
|
+
* collapseSearchBar: true
|
|
1028
|
+
* });
|
|
1029
|
+
*/
|
|
1030
|
+
collapseSearchBar?: boolean;
|
|
1031
|
+
/**
|
|
1032
|
+
* This flag can be used to disable links inside the embedded app,
|
|
1033
|
+
* and disables redirection of links in a new tab.
|
|
1034
|
+
* @example
|
|
1035
|
+
* ```js
|
|
1036
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
1037
|
+
* disableRedirectionLinksInNewTab: true
|
|
1038
|
+
* });
|
|
1039
|
+
* ```
|
|
1040
|
+
* @version SDK: 1.32.1 | ThoughtSpot: 10.3.0.cl
|
|
1041
|
+
*/
|
|
1042
|
+
disableRedirectionLinksInNewTab?: boolean;
|
|
1015
1043
|
}
|
|
1016
1044
|
|
|
1017
1045
|
/**
|
|
@@ -1280,11 +1308,6 @@ export enum EmbedEvent {
|
|
|
1280
1308
|
* @important
|
|
1281
1309
|
*/
|
|
1282
1310
|
Data = 'data',
|
|
1283
|
-
/**
|
|
1284
|
-
* Search/Answer/Liveboard filters have been applied/updated by the user.
|
|
1285
|
-
* @hidden
|
|
1286
|
-
*/
|
|
1287
|
-
FiltersChanged = 'filtersChanged',
|
|
1288
1311
|
/**
|
|
1289
1312
|
* Search query has been updated by the user.
|
|
1290
1313
|
* @version SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
|
|
@@ -1778,6 +1801,7 @@ export enum EmbedEvent {
|
|
|
1778
1801
|
/**
|
|
1779
1802
|
* Emitted when a user clicks the **Update TML** action on
|
|
1780
1803
|
* embedded Liveboard.
|
|
1804
|
+
*
|
|
1781
1805
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1782
1806
|
* @example
|
|
1783
1807
|
*```js
|
|
@@ -1789,6 +1813,7 @@ export enum EmbedEvent {
|
|
|
1789
1813
|
/**
|
|
1790
1814
|
* Emitted when a user clicks the **Edit TML** action
|
|
1791
1815
|
* on an embedded Liveboard.
|
|
1816
|
+
*
|
|
1792
1817
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1793
1818
|
* @example
|
|
1794
1819
|
*```js
|
|
@@ -2398,16 +2423,20 @@ export enum HostEvent {
|
|
|
2398
2423
|
/**
|
|
2399
2424
|
* Trigger the **Export TML** action on an embedded Liveboard or
|
|
2400
2425
|
* Answer.
|
|
2426
|
+
*
|
|
2401
2427
|
* @example
|
|
2402
2428
|
* ```js
|
|
2403
2429
|
* liveboardEmbed.trigger(HostEvent.ExportTML)
|
|
2404
2430
|
* ```
|
|
2431
|
+
*
|
|
2405
2432
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2406
2433
|
*/
|
|
2407
2434
|
ExportTML = 'exportTSL',
|
|
2408
2435
|
/**
|
|
2409
2436
|
* Trigger the **Edit TML** action on an embedded Liveboard or
|
|
2410
2437
|
* saved Answers in the full application embedding.
|
|
2438
|
+
*
|
|
2439
|
+
*
|
|
2411
2440
|
* @example
|
|
2412
2441
|
* ```js
|
|
2413
2442
|
* liveboardEmbed.trigger(HostEvent.EditTML)
|
|
@@ -2498,13 +2527,15 @@ export enum HostEvent {
|
|
|
2498
2527
|
*
|
|
2499
2528
|
* @example
|
|
2500
2529
|
* ```js
|
|
2501
|
-
*
|
|
2530
|
+
* searchEmbed.trigger(HostEvent.CreateMonitor)
|
|
2502
2531
|
* ```
|
|
2503
2532
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2504
2533
|
*/
|
|
2505
2534
|
CreateMonitor = 'createMonitor',
|
|
2506
2535
|
/**
|
|
2507
|
-
* Trigger the **Manage alerts** action on a
|
|
2536
|
+
* Trigger the **Manage alerts** action on a KPI chart
|
|
2537
|
+
* in a visualization or saved Answer.
|
|
2538
|
+
*
|
|
2508
2539
|
* @param - an object with `vizId` as a key
|
|
2509
2540
|
* @example
|
|
2510
2541
|
* ```js
|
|
@@ -2512,6 +2543,16 @@ export enum HostEvent {
|
|
|
2512
2543
|
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2513
2544
|
* })
|
|
2514
2545
|
* ```
|
|
2546
|
+
*
|
|
2547
|
+
* @example
|
|
2548
|
+
* ```js
|
|
2549
|
+
* searchEmbed.trigger(HostEvent.ManageMonitor)
|
|
2550
|
+
* ```
|
|
2551
|
+
*
|
|
2552
|
+
* @example
|
|
2553
|
+
* ```js
|
|
2554
|
+
* vizEmbed.trigger(HostEvent.ManageMonitor)
|
|
2555
|
+
* ```
|
|
2515
2556
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2516
2557
|
*/
|
|
2517
2558
|
ManageMonitor = 'manageMonitor',
|
|
@@ -2522,6 +2563,7 @@ export enum HostEvent {
|
|
|
2522
2563
|
* This event is not supported in visualization embed and search embed.
|
|
2523
2564
|
* @param - object - To trigger the action for a specific visualization
|
|
2524
2565
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2566
|
+
*
|
|
2525
2567
|
* @example
|
|
2526
2568
|
* ```js
|
|
2527
2569
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2788,6 +2830,7 @@ export enum HostEvent {
|
|
|
2788
2830
|
/**
|
|
2789
2831
|
* Get details of filters applied on the Liveboard.
|
|
2790
2832
|
* Returns arrays containing Liveboard filter and runtime filter elements.
|
|
2833
|
+
*
|
|
2791
2834
|
* @example
|
|
2792
2835
|
* ```js
|
|
2793
2836
|
* const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
|
|
@@ -3088,6 +3131,8 @@ export enum Param {
|
|
|
3088
3131
|
Enable2ColumnLayout = 'enable2ColumnLayout',
|
|
3089
3132
|
IsFullAppEmbed = 'isFullAppEmbed',
|
|
3090
3133
|
IsOnBeforeGetVizDataInterceptEnabled = 'isOnBeforeGetVizDataInterceptEnabled',
|
|
3134
|
+
FocusSearchBarOnRender = 'focusSearchBarOnRender',
|
|
3135
|
+
DisableRedirectionLinksInNewTab = 'disableRedirectionLinksInNewTab',
|
|
3091
3136
|
}
|
|
3092
3137
|
|
|
3093
3138
|
/**
|
|
@@ -3139,6 +3184,7 @@ export enum Action {
|
|
|
3139
3184
|
* The **Save as View** action on the Answer
|
|
3140
3185
|
* page. Saves an Answer as a View object in the full
|
|
3141
3186
|
* application embedding mode.
|
|
3187
|
+
*
|
|
3142
3188
|
* @example
|
|
3143
3189
|
* ```js
|
|
3144
3190
|
* disabledActions: [Action.SaveAsView]
|
|
@@ -3238,6 +3284,7 @@ export enum Action {
|
|
|
3238
3284
|
*/
|
|
3239
3285
|
ConfigureFilter = 'configureFilter',
|
|
3240
3286
|
CollapseDataSources = 'collapseDataSources',
|
|
3287
|
+
CollapseDataPanel = 'collapseDataPanel',
|
|
3241
3288
|
/**
|
|
3242
3289
|
* The **Choose sources** button on Search page.
|
|
3243
3290
|
* Allows selecting data sources for search queries.
|
|
@@ -3596,6 +3643,7 @@ export enum Action {
|
|
|
3596
3643
|
/**
|
|
3597
3644
|
* The **Delete** action for Answers in the full application
|
|
3598
3645
|
* embedding mode.
|
|
3646
|
+
*
|
|
3599
3647
|
* @example
|
|
3600
3648
|
* ```js
|
|
3601
3649
|
* disabledActions: [Action.AnswerDelete]
|
|
@@ -3634,12 +3682,15 @@ export enum Action {
|
|
|
3634
3682
|
* The Create alert action on KPI charts.
|
|
3635
3683
|
* @example
|
|
3636
3684
|
* ```js
|
|
3637
|
-
* disabledActions: [Action.CreateMonitor
|
|
3685
|
+
* disabledActions: [Action.CreateMonitor]
|
|
3638
3686
|
* ```
|
|
3639
3687
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
3640
3688
|
*/
|
|
3641
3689
|
CreateMonitor = 'createMonitor',
|
|
3642
3690
|
/**
|
|
3691
|
+
* @deprecated
|
|
3692
|
+
* Reports errors
|
|
3693
|
+
*
|
|
3643
3694
|
* @example
|
|
3644
3695
|
* ```js
|
|
3645
3696
|
* disabledActions: [Action.ReportError]
|
|
@@ -3864,35 +3915,87 @@ export enum Action {
|
|
|
3864
3915
|
*/
|
|
3865
3916
|
RenameModalTitleDescription = 'renameModalTitleDescription',
|
|
3866
3917
|
/**
|
|
3918
|
+
*
|
|
3919
|
+
* The **Request Verification** action on the Liveboard.
|
|
3920
|
+
* Triggers a Liveboard verification request.
|
|
3921
|
+
*
|
|
3922
|
+
* @example
|
|
3923
|
+
* ```js
|
|
3924
|
+
* disabledActions: [Action.RequestVerification]
|
|
3925
|
+
* ```
|
|
3867
3926
|
*
|
|
3868
3927
|
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
|
|
3869
3928
|
*/
|
|
3870
3929
|
RequestVerification = 'requestVerification',
|
|
3871
3930
|
/**
|
|
3931
|
+
*
|
|
3932
|
+
* Allows users to mark a Liveboard as verified.
|
|
3933
|
+
*
|
|
3934
|
+
* @example
|
|
3935
|
+
* ```js
|
|
3936
|
+
* disabledActions: [Action.MarkAsVerified]
|
|
3937
|
+
* ```
|
|
3872
3938
|
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
|
|
3873
3939
|
*/
|
|
3874
3940
|
MarkAsVerified = 'markAsVerified',
|
|
3875
3941
|
/**
|
|
3942
|
+
* The **Add Tab** action on a Liveboard.
|
|
3943
|
+
* Allows adding a new tab to a Liveboard view.
|
|
3944
|
+
*
|
|
3945
|
+
* @example
|
|
3946
|
+
* ```js
|
|
3947
|
+
* disabledActions: [Action.AddTab]
|
|
3948
|
+
* ```
|
|
3876
3949
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
3877
3950
|
*/
|
|
3878
3951
|
AddTab = 'addTab',
|
|
3879
3952
|
/**
|
|
3953
|
+
*
|
|
3954
|
+
* Initiates contextual change analysis on KPI charts.
|
|
3955
|
+
*
|
|
3956
|
+
* @example
|
|
3957
|
+
* ```js
|
|
3958
|
+
* disabledActions: [Action.EnableContextualChangeAnalysis]
|
|
3959
|
+
* ```
|
|
3880
3960
|
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
|
|
3881
3961
|
*/
|
|
3882
3962
|
EnableContextualChangeAnalysis = 'enableContextualChangeAnalysis',
|
|
3883
3963
|
/**
|
|
3964
|
+
*
|
|
3965
|
+
* @example
|
|
3966
|
+
* ```js
|
|
3967
|
+
* disabledActions: [Action.ShowSageQuery]
|
|
3968
|
+
* ```
|
|
3969
|
+
*
|
|
3884
3970
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
3885
3971
|
*/
|
|
3886
3972
|
ShowSageQuery = 'showSageQuery',
|
|
3887
3973
|
/**
|
|
3974
|
+
*
|
|
3975
|
+
* @example
|
|
3976
|
+
* ```js
|
|
3977
|
+
* disabledActions: [Action.EditSageAnswer]
|
|
3978
|
+
* ```
|
|
3888
3979
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
3889
3980
|
*/
|
|
3890
3981
|
EditSageAnswer = 'editSageAnswer',
|
|
3891
3982
|
/**
|
|
3983
|
+
*
|
|
3984
|
+
* This action allows users to send feedback on AI-generated Answers.
|
|
3985
|
+
*
|
|
3986
|
+
* @example
|
|
3987
|
+
* ```js
|
|
3988
|
+
* disabledActions: [Action.SageAnswerFeedback]
|
|
3989
|
+
* ```
|
|
3892
3990
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
3893
3991
|
*/
|
|
3894
3992
|
SageAnswerFeedback = 'sageAnswerFeedback',
|
|
3895
3993
|
/**
|
|
3994
|
+
*
|
|
3995
|
+
* @example
|
|
3996
|
+
* ```js
|
|
3997
|
+
* disabledActions: [Action.ModifySageAnswer]
|
|
3998
|
+
* ```
|
|
3896
3999
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
3897
4000
|
*/
|
|
3898
4001
|
ModifySageAnswer = 'modifySageAnswer',
|
|
@@ -3912,7 +4015,7 @@ export enum Action {
|
|
|
3912
4015
|
* disabledActions: [Action.ManageMonitor]
|
|
3913
4016
|
* ```
|
|
3914
4017
|
*/
|
|
3915
|
-
ManageMonitor = '
|
|
4018
|
+
ManageMonitor = 'manageMonitor',
|
|
3916
4019
|
/**
|
|
3917
4020
|
* Action ID for Liveboard Personalised Views dropdown
|
|
3918
4021
|
* @example
|
|
@@ -4022,6 +4125,66 @@ export enum Action {
|
|
|
4022
4125
|
* @version SDK: 1.27.10 | Thoughtspot: 9.12.5.cl
|
|
4023
4126
|
*/
|
|
4024
4127
|
AIHighlights = 'AIHighlights',
|
|
4128
|
+
|
|
4129
|
+
/**
|
|
4130
|
+
* Action ID for edit schedule action on schedule on homepage
|
|
4131
|
+
* @example
|
|
4132
|
+
* ```js
|
|
4133
|
+
* disabledActions: [Action.EditScheduleHomepage]
|
|
4134
|
+
* ```
|
|
4135
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4136
|
+
*/
|
|
4137
|
+
EditScheduleHomepage = 'editScheduleHomepage',
|
|
4138
|
+
|
|
4139
|
+
/**
|
|
4140
|
+
* Action ID for pause schedule action on schedule on homepage
|
|
4141
|
+
* @example
|
|
4142
|
+
* ```js
|
|
4143
|
+
* disabledActions: [Action.PauseScheduleHomepage]
|
|
4144
|
+
* ```
|
|
4145
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4146
|
+
*/
|
|
4147
|
+
PauseScheduleHomepage = 'pauseScheduleHomepage',
|
|
4148
|
+
|
|
4149
|
+
/**
|
|
4150
|
+
* Action ID for view schedule run action on schedule on homepage
|
|
4151
|
+
* @example
|
|
4152
|
+
* ```js
|
|
4153
|
+
* disabledActions: [Action.ViewScheduleRunHomepage]
|
|
4154
|
+
* ```
|
|
4155
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4156
|
+
*/
|
|
4157
|
+
ViewScheduleRunHomepage = 'viewScheduleRunHomepage',
|
|
4158
|
+
|
|
4159
|
+
/**
|
|
4160
|
+
* Action ID for unsubscribe schedule action on schedule on homepage
|
|
4161
|
+
* @example
|
|
4162
|
+
* ```js
|
|
4163
|
+
* disabledActions: [Action.UnsubscribeScheduleHomepage]
|
|
4164
|
+
* ```
|
|
4165
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4166
|
+
*/
|
|
4167
|
+
UnsubscribeScheduleHomepage = 'unsubscribeScheduleHomepage',
|
|
4168
|
+
|
|
4169
|
+
/**
|
|
4170
|
+
* Action ID for delete schedule action on schedule on homepage
|
|
4171
|
+
* @example
|
|
4172
|
+
* ```js
|
|
4173
|
+
* disabledActions: [Action.DeleteScheduleHomepage]
|
|
4174
|
+
* ```
|
|
4175
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4176
|
+
*/
|
|
4177
|
+
DeleteScheduleHomepage = 'deleteScheduleHomepage',
|
|
4178
|
+
|
|
4179
|
+
/**
|
|
4180
|
+
* The **Analyze CTA** action on KPI chart.
|
|
4181
|
+
* @example
|
|
4182
|
+
* ```js
|
|
4183
|
+
* disabledActions: [Action.KPIAnalysisCTA]
|
|
4184
|
+
* ```
|
|
4185
|
+
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
4186
|
+
*/
|
|
4187
|
+
KPIAnalysisCTA = 'kpiAnalysisCTA',
|
|
4025
4188
|
}
|
|
4026
4189
|
|
|
4027
4190
|
export interface AnswerServiceType {
|
|
@@ -4051,15 +4214,15 @@ export interface ColumnValue {
|
|
|
4051
4214
|
[key: string]: any;
|
|
4052
4215
|
};
|
|
4053
4216
|
value:
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4217
|
+
| string
|
|
4218
|
+
| number
|
|
4219
|
+
| boolean
|
|
4220
|
+
| {
|
|
4221
|
+
v: {
|
|
4222
|
+
s: number;
|
|
4223
|
+
e: number;
|
|
4224
|
+
};
|
|
4225
|
+
};
|
|
4063
4226
|
}
|
|
4064
4227
|
|
|
4065
4228
|
export interface VizPoint {
|
package/src/utils/processData.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { AuthFailureType } from '../auth';
|
|
|
9
9
|
import { AuthType, CustomActionPayload, EmbedEvent } from '../types';
|
|
10
10
|
import { AnswerService } from './graphql/answerService/answerService';
|
|
11
11
|
import { resetCachedAuthToken } from '../authToken';
|
|
12
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
@@ -62,9 +63,7 @@ function processNoCookieAccess(e: any, containerEl: Element) {
|
|
|
62
63
|
if (!ignoreNoCookieAccess) {
|
|
63
64
|
if (!suppressNoCookieAccessAlert && !suppressErrorAlerts) {
|
|
64
65
|
// eslint-disable-next-line no-alert
|
|
65
|
-
alert(
|
|
66
|
-
'Third party cookie access is blocked on this browser, please allow third party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
|
|
67
|
-
);
|
|
66
|
+
alert(ERROR_MESSAGE.THIRD_PARTY_COOKIE_BLOCKED_ALERT);
|
|
68
67
|
}
|
|
69
68
|
// eslint-disable-next-line no-param-reassign
|
|
70
69
|
containerEl.innerHTML = loginFailedMessage;
|