@thoughtspot/visual-embed-sdk 1.47.3 → 1.49.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/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +11 -1
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +38 -0
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.d.ts +2 -0
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +7 -5
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/css-variables.d.ts +140 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +63 -2
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +57 -6
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +200 -1
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.js +7 -2
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
- package/cjs/src/embed/auto-frame-renderer.spec.js +385 -6
- package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +13 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +21 -0
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +86 -0
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +16 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +5 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +26 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +48 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +48 -7
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +139 -1
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/spotter-viz-utils.d.ts +85 -0
- package/cjs/src/embed/spotter-viz-utils.d.ts.map +1 -0
- package/cjs/src/embed/spotter-viz-utils.js +17 -0
- package/cjs/src/embed/spotter-viz-utils.js.map +1 -0
- package/cjs/src/embed/spotter-viz-utils.spec.d.ts +2 -0
- package/cjs/src/embed/spotter-viz-utils.spec.d.ts.map +1 -0
- package/cjs/src/embed/spotter-viz-utils.spec.js +31 -0
- package/cjs/src/embed/spotter-viz-utils.spec.js.map +1 -0
- package/cjs/src/embed/ts-embed.d.ts +58 -38
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +247 -151
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +397 -122
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +3 -0
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts.map +1 -1
- package/cjs/src/tokenizedFetch.js +12 -9
- package/cjs/src/tokenizedFetch.js.map +1 -1
- package/cjs/src/tokenizedFetch.spec.d.ts +2 -0
- package/cjs/src/tokenizedFetch.spec.d.ts.map +1 -0
- package/cjs/src/tokenizedFetch.spec.js +68 -0
- package/cjs/src/tokenizedFetch.spec.js.map +1 -0
- package/cjs/src/types.d.ts +309 -40
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +251 -23
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +6 -7
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/cjs/src/utils/logger.js +2 -1
- package/cjs/src/utils/logger.js.map +1 -1
- package/cjs/src/utils/logger.spec.d.ts +1 -0
- package/cjs/src/utils/logger.spec.d.ts.map +1 -1
- package/cjs/src/utils/logger.spec.js +10 -9
- package/cjs/src/utils/logger.spec.js.map +1 -1
- package/cjs/src/utils.d.ts +4 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +107 -10
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +163 -4
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-DZq20cR6.js → index-_UGCSSDR.js} +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/authToken.d.ts +2 -0
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +140 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +63 -2
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +16 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +48 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/spotter-viz-utils.d.ts +85 -0
- package/dist/src/embed/spotter-viz-utils.d.ts.map +1 -0
- package/dist/src/embed/spotter-viz-utils.spec.d.ts +2 -0
- package/dist/src/embed/spotter-viz-utils.spec.d.ts.map +1 -0
- package/dist/src/embed/ts-embed.d.ts +58 -38
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.spec.d.ts +2 -0
- package/dist/src/tokenizedFetch.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +309 -40
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/logger.spec.d.ts +1 -0
- package/dist/src/utils/logger.spec.d.ts.map +1 -1
- package/dist/src/utils.d.ts +4 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +3418 -2899
- package/dist/tsembed-react.js +3420 -2901
- package/dist/tsembed.es.js +3426 -2905
- package/dist/tsembed.js +3419 -2898
- package/dist/visual-embed-sdk-react-full.d.ts +687 -78
- package/dist/visual-embed-sdk-react.d.ts +687 -78
- package/dist/visual-embed-sdk.d.ts +702 -80
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +12 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +38 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.d.ts +2 -0
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +2 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/css-variables.d.ts +140 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +63 -2
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +58 -7
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +201 -2
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.js +7 -2
- package/lib/src/embed/auto-frame-renderer.js.map +1 -1
- package/lib/src/embed/auto-frame-renderer.spec.js +387 -8
- package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +11 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +22 -1
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +86 -0
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +16 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +27 -1
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +48 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +49 -8
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +139 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/spotter-viz-utils.d.ts +85 -0
- package/lib/src/embed/spotter-viz-utils.d.ts.map +1 -0
- package/lib/src/embed/spotter-viz-utils.js +13 -0
- package/lib/src/embed/spotter-viz-utils.js.map +1 -0
- package/lib/src/embed/spotter-viz-utils.spec.d.ts +2 -0
- package/lib/src/embed/spotter-viz-utils.spec.d.ts.map +1 -0
- package/lib/src/embed/spotter-viz-utils.spec.js +29 -0
- package/lib/src/embed/spotter-viz-utils.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts +58 -38
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +250 -154
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +397 -122
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +3 -0
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/tokenizedFetch.d.ts.map +1 -1
- package/lib/src/tokenizedFetch.js +13 -10
- package/lib/src/tokenizedFetch.js.map +1 -1
- package/lib/src/tokenizedFetch.spec.d.ts +2 -0
- package/lib/src/tokenizedFetch.spec.d.ts.map +1 -0
- package/lib/src/tokenizedFetch.spec.js +65 -0
- package/lib/src/tokenizedFetch.spec.js.map +1 -0
- package/lib/src/types.d.ts +309 -40
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +251 -23
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +6 -7
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
- package/lib/src/utils/logger.js +2 -1
- package/lib/src/utils/logger.js.map +1 -1
- package/lib/src/utils/logger.spec.d.ts +1 -0
- package/lib/src/utils/logger.spec.d.ts.map +1 -1
- package/lib/src/utils/logger.spec.js +10 -9
- package/lib/src/utils/logger.spec.js.map +1 -1
- package/lib/src/utils.d.ts +4 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +103 -9
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +164 -5
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +702 -80
- package/package.json +1 -1
- package/src/auth.spec.ts +55 -1
- package/src/auth.ts +11 -2
- package/src/authToken.ts +2 -2
- package/src/css-variables.ts +175 -1
- package/src/embed/app.spec.ts +260 -3
- package/src/embed/app.ts +127 -7
- package/src/embed/auto-frame-renderer.spec.ts +457 -58
- package/src/embed/auto-frame-renderer.ts +7 -2
- package/src/embed/base.spec.ts +25 -1
- package/src/embed/base.ts +19 -5
- package/src/embed/bodyless-conversation.spec.ts +93 -0
- package/src/embed/conversation.spec.ts +34 -0
- package/src/embed/conversation.ts +22 -1
- package/src/embed/liveboard.spec.ts +163 -1
- package/src/embed/liveboard.ts +106 -10
- package/src/embed/spotter-viz-utils.spec.ts +30 -0
- package/src/embed/spotter-viz-utils.ts +94 -0
- package/src/embed/ts-embed.spec.ts +564 -231
- package/src/embed/ts-embed.ts +384 -258
- package/src/index.ts +3 -0
- package/src/react/index.tsx +3 -0
- package/src/tokenizedFetch.spec.ts +81 -0
- package/src/tokenizedFetch.ts +14 -11
- package/src/types.ts +326 -36
- package/src/utils/authService/tokenizedAuthService.spec.ts +6 -6
- package/src/utils/logger.spec.ts +11 -9
- package/src/utils/logger.ts +2 -2
- package/src/utils.spec.ts +200 -4
- package/src/utils.ts +128 -9
package/src/index.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
|
33
33
|
import { SearchBarEmbed, SearchBarViewConfig } from './embed/search-bar';
|
|
34
34
|
import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversation, BodylessConversationViewConfig} from './embed/bodyless-conversation';
|
|
35
35
|
import { SpotterEmbed, SpotterEmbedViewConfig, SpotterChatViewConfig, SpotterSidebarViewConfig, ConversationEmbed, ConversationViewConfig } from './embed/conversation';
|
|
36
|
+
import { SpotterVizConfig, SpotterVizStarterPrompt } from './embed/spotter-viz-utils';
|
|
36
37
|
import {
|
|
37
38
|
AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter,
|
|
38
39
|
} from './auth';
|
|
@@ -140,6 +141,8 @@ export {
|
|
|
140
141
|
SearchViewConfig,
|
|
141
142
|
SearchBarViewConfig,
|
|
142
143
|
LiveboardViewConfig,
|
|
144
|
+
SpotterVizConfig,
|
|
145
|
+
SpotterVizStarterPrompt,
|
|
143
146
|
AppViewConfig,
|
|
144
147
|
PrefetchFeatures,
|
|
145
148
|
FrameParams,
|
package/src/react/index.tsx
CHANGED
|
@@ -95,6 +95,9 @@ const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V exte
|
|
|
95
95
|
|
|
96
96
|
const preRenderStyles = isPreRenderedComponent ? { display: 'none' } : {};
|
|
97
97
|
|
|
98
|
+
// We dont add any component for preRenderedComponent
|
|
99
|
+
if (isPreRenderedComponent) return <></>;
|
|
100
|
+
|
|
98
101
|
return viewConfig.insertAsSibling ? (
|
|
99
102
|
<span data-testid="tsEmbed" ref={ref} style={{ position: 'absolute', ...preRenderStyles }}></span>
|
|
100
103
|
) : (
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import 'jest-fetch-mock';
|
|
2
|
+
import * as embedConfigModule from './embed/embedConfig';
|
|
3
|
+
import * as authTokenModule from './authToken';
|
|
4
|
+
import { AuthType } from './types';
|
|
5
|
+
import { tokenizedFetch } from './tokenizedFetch';
|
|
6
|
+
|
|
7
|
+
jest.mock('./embed/embedConfig');
|
|
8
|
+
jest.mock('./authToken');
|
|
9
|
+
|
|
10
|
+
const mockGetEmbedConfig = embedConfigModule.getEmbedConfig as jest.Mock;
|
|
11
|
+
const mockGetAuthenticationToken = authTokenModule.getAuthenticationToken as jest.Mock;
|
|
12
|
+
const mockGetCacheAuthToken = authTokenModule.getCacheAuthToken as jest.Mock;
|
|
13
|
+
|
|
14
|
+
describe('tokenizedFetch', () => {
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
jest.clearAllMocks();
|
|
17
|
+
fetchMock.resetMocks();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('non-cookieless auth', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
mockGetEmbedConfig.mockReturnValue({ authType: AuthType.TrustedAuthToken });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should add Authorization Bearer header when cachedAuthToken exists', async () => {
|
|
26
|
+
mockGetCacheAuthToken.mockReturnValue('my-cached-token');
|
|
27
|
+
fetchMock.mockResponseOnce(JSON.stringify({}));
|
|
28
|
+
|
|
29
|
+
await tokenizedFetch('https://example.com/api', { method: 'GET' });
|
|
30
|
+
|
|
31
|
+
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
32
|
+
const request = fetchMock.mock.calls[0][0] as Request;
|
|
33
|
+
expect(request).toBeInstanceOf(Request);
|
|
34
|
+
expect(request.headers.get('Authorization')).toBe('Bearer my-cached-token');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should fetch with credentials include when no cachedAuthToken', async () => {
|
|
38
|
+
mockGetCacheAuthToken.mockReturnValue(null);
|
|
39
|
+
fetchMock.mockResponseOnce(JSON.stringify({}));
|
|
40
|
+
|
|
41
|
+
await tokenizedFetch('https://example.com/api', { method: 'GET' });
|
|
42
|
+
|
|
43
|
+
expect(fetchMock).toHaveBeenCalledWith('https://example.com/api', {
|
|
44
|
+
credentials: 'include',
|
|
45
|
+
method: 'GET',
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('cookieless auth (TrustedAuthTokenCookieless)', () => {
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
mockGetEmbedConfig.mockReturnValue({
|
|
53
|
+
authType: AuthType.TrustedAuthTokenCookieless,
|
|
54
|
+
thoughtSpotHost: 'https://example.com',
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should add Authorization Bearer header from getAuthenticationToken', async () => {
|
|
59
|
+
mockGetAuthenticationToken.mockResolvedValue('cookieless-token');
|
|
60
|
+
fetchMock.mockResponseOnce(JSON.stringify({}));
|
|
61
|
+
|
|
62
|
+
await tokenizedFetch('https://example.com/api', { method: 'POST' });
|
|
63
|
+
|
|
64
|
+
expect(mockGetAuthenticationToken).toHaveBeenCalled();
|
|
65
|
+
const request = fetchMock.mock.calls[0][0] as Request;
|
|
66
|
+
expect(request).toBeInstanceOf(Request);
|
|
67
|
+
expect(request.headers.get('Authorization')).toBe('Bearer cookieless-token');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should not add Authorization header when getAuthenticationToken returns null', async () => {
|
|
71
|
+
mockGetAuthenticationToken.mockResolvedValue(null);
|
|
72
|
+
fetchMock.mockResponseOnce(JSON.stringify({}));
|
|
73
|
+
|
|
74
|
+
await tokenizedFetch('https://example.com/api', { method: 'POST' });
|
|
75
|
+
|
|
76
|
+
const request = fetchMock.mock.calls[0][0] as Request;
|
|
77
|
+
expect(request).toBeInstanceOf(Request);
|
|
78
|
+
expect(request.headers.get('Authorization')).toBeNull();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
package/src/tokenizedFetch.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAuthenticationToken } from './authToken';
|
|
1
|
+
import { getAuthenticationToken, getCacheAuthToken } from './authToken';
|
|
2
2
|
import { getEmbedConfig } from './embed/embedConfig';
|
|
3
3
|
|
|
4
4
|
import { AuthType } from './types';
|
|
@@ -20,18 +20,21 @@ import { AuthType } from './types';
|
|
|
20
20
|
*/
|
|
21
21
|
export const tokenizedFetch: typeof fetch = async (input, init): Promise<Response> => {
|
|
22
22
|
const embedConfig = getEmbedConfig();
|
|
23
|
+
const options: RequestInit = { ...init };
|
|
24
|
+
let token: string | undefined;
|
|
23
25
|
if (embedConfig.authType !== AuthType.TrustedAuthTokenCookieless) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
credentials: 'include'
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
token = getCacheAuthToken();
|
|
27
|
+
if (!token) {
|
|
28
|
+
return fetch(input, { ...options, credentials: 'include' });
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
token = await getAuthenticationToken(embedConfig);
|
|
29
32
|
}
|
|
33
|
+
const req = new Request(input, options);
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (authToken) {
|
|
34
|
-
req.headers.append('Authorization', `Bearer ${authToken}`);
|
|
35
|
+
if (token) {
|
|
36
|
+
req.headers.append('Authorization', `Bearer ${token}`);
|
|
35
37
|
}
|
|
38
|
+
|
|
36
39
|
return fetch(req);
|
|
37
|
-
};
|
|
40
|
+
};
|
package/src/types.ts
CHANGED
|
@@ -926,9 +926,10 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
926
926
|
styleSheet__unstable?: string;
|
|
927
927
|
/**
|
|
928
928
|
* The list of actions to disable from the primary menu, more menu
|
|
929
|
-
* (...), and the contextual menu.
|
|
930
|
-
*
|
|
931
|
-
* Use this to disable
|
|
929
|
+
* (...), and the contextual menu. Disabled actions are grayed out
|
|
930
|
+
* and still visible to the user, but cannot be clicked.
|
|
931
|
+
* Use this when you want to disable an action (keep it visible but non-interactive).
|
|
932
|
+
* To completely remove an action from the UI, use {@link hiddenActions} instead.
|
|
932
933
|
*
|
|
933
934
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
934
935
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -959,9 +960,10 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
959
960
|
*/
|
|
960
961
|
disabledActionReason?: string;
|
|
961
962
|
/**
|
|
962
|
-
* The list of actions to
|
|
963
|
-
*
|
|
964
|
-
* Use this to
|
|
963
|
+
* The list of actions to completely remove from the embedded view.
|
|
964
|
+
* Hidden actions are not visible to the user at all (fully removed from the UI).
|
|
965
|
+
* Use this when you want to remove an action entirely.
|
|
966
|
+
* To keep an action visible but non-interactive (grayed out), use {@link disabledActions} instead.
|
|
965
967
|
*
|
|
966
968
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
967
969
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -980,9 +982,8 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
980
982
|
* The list of actions to display from the primary menu, more menu
|
|
981
983
|
* (...), and the contextual menu. These will be only actions that
|
|
982
984
|
* are visible to the user.
|
|
983
|
-
* Use this
|
|
984
|
-
*
|
|
985
|
-
* Use either this or hiddenActions.
|
|
985
|
+
* Use this as an allowlist — only the actions listed here will be shown.
|
|
986
|
+
* All other actions will be hidden. Use either this or {@link hiddenActions}, not both.
|
|
986
987
|
*
|
|
987
988
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
988
989
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -1139,6 +1140,14 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1139
1140
|
* This flag can be used to disable links inside the embedded app,
|
|
1140
1141
|
* and disable redirection of links in a new tab.
|
|
1141
1142
|
*
|
|
1143
|
+
* Note: When set to `true`, this flag automatically disables
|
|
1144
|
+
* {@link enableLinkOverridesV2} for the
|
|
1145
|
+
* embed session. The two features are mutually exclusive — link
|
|
1146
|
+
* overrides mutate anchors (delete `href`, attach a JS click handler),
|
|
1147
|
+
* which breaks native browser behavior (Cmd/Ctrl+Click, middle-click,
|
|
1148
|
+
* right-click "Open in new tab") when combined with the disable flag.
|
|
1149
|
+
* The disable flag preserves native anchor semantics instead.
|
|
1150
|
+
*
|
|
1142
1151
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
1143
1152
|
* @version SDK: 1.32.1 | ThoughtSpot: 10.3.0.cl
|
|
1144
1153
|
* @example
|
|
@@ -1174,8 +1183,13 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1174
1183
|
* Flag to override the *Open Link in New Tab* context
|
|
1175
1184
|
* menu option.
|
|
1176
1185
|
*
|
|
1177
|
-
*
|
|
1178
|
-
* {@link enableLinkOverridesV2}
|
|
1186
|
+
* Note: Setting this flag implicitly enables
|
|
1187
|
+
* {@link enableLinkOverridesV2}. V1 is auto-upgraded to
|
|
1188
|
+
* V2 to ensure consistent link-override behavior; the
|
|
1189
|
+
* legacy V1-only path is no longer used in isolation.
|
|
1190
|
+
*
|
|
1191
|
+
* Note: This flag is ignored when
|
|
1192
|
+
* {@link disableRedirectionLinksInNewTab} is `true`.
|
|
1179
1193
|
*
|
|
1180
1194
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`,
|
|
1181
1195
|
* `SearchEmbed`, `SpotterAgentEmbed`,
|
|
@@ -1201,6 +1215,9 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1201
1215
|
* alongside this flag for backward compatibility with
|
|
1202
1216
|
* older ThoughtSpot versions.
|
|
1203
1217
|
*
|
|
1218
|
+
* Note: This flag is ignored when
|
|
1219
|
+
* {@link disableRedirectionLinksInNewTab} is `true`.
|
|
1220
|
+
*
|
|
1204
1221
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`,
|
|
1205
1222
|
* `SearchEmbed`, `SpotterAgentEmbed`,
|
|
1206
1223
|
* `SpotterEmbed`, `SearchBarEmbed`
|
|
@@ -1437,6 +1454,7 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1437
1454
|
/**
|
|
1438
1455
|
* Refresh the auth token when the token is near expiry.
|
|
1439
1456
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
1457
|
+
* @default true
|
|
1440
1458
|
* @example
|
|
1441
1459
|
* ```js
|
|
1442
1460
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -1475,8 +1493,29 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1475
1493
|
useHostEventsV2?: boolean;
|
|
1476
1494
|
}
|
|
1477
1495
|
|
|
1478
|
-
|
|
1479
|
-
|
|
1496
|
+
/**
|
|
1497
|
+
* Configuration for {@link startAutoMCPFrameRenderer}.
|
|
1498
|
+
*
|
|
1499
|
+
* Extends {@link BaseViewConfig} but omits params that are not applicable
|
|
1500
|
+
* to the auto-frame renderer:
|
|
1501
|
+
* - `preRenderId` / `usePrerenderedIfAvailable` / `doNotTrackPreRenderSize` —
|
|
1502
|
+
* the renderer always replaces a live iframe in-place; prerender pools are not used.
|
|
1503
|
+
* - `insertAsSibling` — insertion is always a same-position `replaceWith`; the
|
|
1504
|
+
* container-append path is never taken.
|
|
1505
|
+
* - `primaryAction` — a Liveboard/AppEmbed-specific feature; the renderer renders
|
|
1506
|
+
* whatever route the MCP server specifies.
|
|
1507
|
+
* - `enableV2Shell_experimental` — the renderer always uses the v2 URL format;
|
|
1508
|
+
* this flag has no effect.
|
|
1509
|
+
*/
|
|
1510
|
+
export type AutoMCPFrameRendererViewConfig = Omit<
|
|
1511
|
+
BaseViewConfig,
|
|
1512
|
+
| 'preRenderId'
|
|
1513
|
+
| 'usePrerenderedIfAvailable'
|
|
1514
|
+
| 'doNotTrackPreRenderSize'
|
|
1515
|
+
| 'insertAsSibling'
|
|
1516
|
+
| 'primaryAction'
|
|
1517
|
+
| 'enableV2Shell_experimental'
|
|
1518
|
+
>;
|
|
1480
1519
|
|
|
1481
1520
|
/**
|
|
1482
1521
|
* The configuration object for Home page embeds configs.
|
|
@@ -2463,38 +2502,54 @@ export enum EmbedEvent {
|
|
|
2463
2502
|
*/
|
|
2464
2503
|
VizPointClick = 'vizPointClick',
|
|
2465
2504
|
/**
|
|
2466
|
-
*
|
|
2505
|
+
* Fired when an error occurs in the embedded component.
|
|
2467
2506
|
*
|
|
2507
|
+
* **Important:** This event fires for many reasons — including internal
|
|
2508
|
+
* validation warnings (e.g. `HOST_EVENT_VALIDATION`), configuration issues,
|
|
2509
|
+
* and transient errors that ThoughtSpot already handles gracefully inside the
|
|
2510
|
+
* iframe. **Do not call `embed.destroy()` or unmount the embed component on
|
|
2511
|
+
* every error.** Doing so will tear down the iframe and abort all in-flight
|
|
2512
|
+
* requests, causing the embed to fail entirely.
|
|
2513
|
+
*
|
|
2514
|
+
* Only treat the following codes as unrecoverable:
|
|
2515
|
+
* - `INIT_ERROR` — SDK was not initialised before render
|
|
2516
|
+
* - `LOGIN_FAILED` — authentication could not be completed
|
|
2517
|
+
*
|
|
2518
|
+
* All other error codes should be logged and inspected, not acted upon
|
|
2519
|
+
* destructively.
|
|
2520
|
+
*
|
|
2521
|
+
* **Note:** There is currently no dedicated event for a true unrecoverable
|
|
2522
|
+
* crash. A future `EmbedEvent.FatalError` event is planned to give customers
|
|
2523
|
+
* a clean signal for when the embed cannot recover and needs to be torn down.
|
|
2524
|
+
*
|
|
2525
|
+
* Error types include:
|
|
2468
2526
|
* `API` - API call failure.
|
|
2469
|
-
* `FULLSCREEN` - Error when presenting a Liveboard
|
|
2470
|
-
*
|
|
2471
|
-
* filter. `NON_EXIST_FILTER` - Error due to a non-existent filter.
|
|
2472
|
-
* `INVALID_DATE_VALUE` - Invalid date value error.
|
|
2473
|
-
* `INVALID_OPERATOR` - Use of invalid operator during filter application.
|
|
2527
|
+
* `FULLSCREEN` - Error when presenting a Liveboard in full screen mode.
|
|
2528
|
+
* `VALIDATION_ERROR` - Internal host event or configuration validation warning.
|
|
2474
2529
|
*
|
|
2475
2530
|
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
|
|
2476
2531
|
* @returns error - An error object or message
|
|
2477
2532
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
2478
2533
|
* @example
|
|
2479
2534
|
* ```js
|
|
2480
|
-
* //
|
|
2481
|
-
*
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2535
|
+
* // Recommended pattern — only destroy on truly fatal errors
|
|
2536
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
2537
|
+
* const FATAL_CODES = ['INIT_ERROR', 'LOGIN_FAILED'];
|
|
2538
|
+
* if (FATAL_CODES.includes(error.data?.code)) {
|
|
2539
|
+
* embed.destroy();
|
|
2540
|
+
* return;
|
|
2541
|
+
* }
|
|
2542
|
+
* // Log all other errors — do not destroy
|
|
2543
|
+
* console.warn('Embed error (non-fatal):', error);
|
|
2485
2544
|
* });
|
|
2486
2545
|
* ```
|
|
2487
2546
|
* @example
|
|
2488
2547
|
* ```js
|
|
2489
|
-
* //
|
|
2490
|
-
*
|
|
2548
|
+
* // API error
|
|
2549
|
+
* SearchEmbed.on(EmbedEvent.Error, (error) => {
|
|
2491
2550
|
* console.log(error);
|
|
2492
|
-
* // {
|
|
2493
|
-
*
|
|
2494
|
-
* // stack: "..."
|
|
2495
|
-
* // } }}
|
|
2496
|
-
* // { errorType: "FULLSCREEN", message: "Fullscreen API is not enabled", code: '...' } new format
|
|
2497
|
-
* })
|
|
2551
|
+
* // { errorType: "API", message: '...', code: '...' }
|
|
2552
|
+
* });
|
|
2498
2553
|
* ```
|
|
2499
2554
|
*/
|
|
2500
2555
|
Error = 'Error',
|
|
@@ -3702,6 +3757,109 @@ export enum EmbedEvent {
|
|
|
3702
3757
|
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
3703
3758
|
*/
|
|
3704
3759
|
SendTestScheduleEmail = 'sendTestScheduleEmail',
|
|
3760
|
+
|
|
3761
|
+
/**
|
|
3762
|
+
* Emitted when the SpotterViz panel mounts in embed mode.
|
|
3763
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3764
|
+
* @example
|
|
3765
|
+
* ```js
|
|
3766
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizInit, (payload) => {
|
|
3767
|
+
* console.log('SpotterViz initialized', payload);
|
|
3768
|
+
* // payload: { liveboardId: string }
|
|
3769
|
+
* })
|
|
3770
|
+
* ```
|
|
3771
|
+
*/
|
|
3772
|
+
SpotterVizInit = 'SpotterVizInit',
|
|
3773
|
+
|
|
3774
|
+
/**
|
|
3775
|
+
* Emitted when the user submits a prompt in the SpotterViz panel.
|
|
3776
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3777
|
+
* @example
|
|
3778
|
+
* ```js
|
|
3779
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizQueryTriggered, (payload) => {
|
|
3780
|
+
* console.log('SpotterViz query triggered', payload);
|
|
3781
|
+
* // payload: { query: string, sessionId: string }
|
|
3782
|
+
* })
|
|
3783
|
+
* ```
|
|
3784
|
+
*/
|
|
3785
|
+
SpotterVizQueryTriggered = 'SpotterVizQueryTriggered',
|
|
3786
|
+
|
|
3787
|
+
/**
|
|
3788
|
+
* Emitted when the SpotterViz agent finishes responding.
|
|
3789
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3790
|
+
* @example
|
|
3791
|
+
* ```js
|
|
3792
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizResponseComplete, (payload) => {
|
|
3793
|
+
* console.log('SpotterViz response complete', payload);
|
|
3794
|
+
* // payload: { sessionId: string, messageId: string }
|
|
3795
|
+
* })
|
|
3796
|
+
* ```
|
|
3797
|
+
*/
|
|
3798
|
+
SpotterVizResponseComplete = 'SpotterVizResponseComplete',
|
|
3799
|
+
|
|
3800
|
+
/**
|
|
3801
|
+
* Emitted when a checkpoint is created in the SpotterViz panel.
|
|
3802
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3803
|
+
* @example
|
|
3804
|
+
* ```js
|
|
3805
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizCheckpointCreated, (payload) => {
|
|
3806
|
+
* console.log('SpotterViz checkpoint created', payload);
|
|
3807
|
+
* // payload: { checkpointId: string, source: string, label: string }
|
|
3808
|
+
* })
|
|
3809
|
+
* ```
|
|
3810
|
+
*/
|
|
3811
|
+
SpotterVizCheckpointCreated = 'SpotterVizCheckpointCreated',
|
|
3812
|
+
|
|
3813
|
+
/**
|
|
3814
|
+
* Emitted when a checkpoint is restored in the SpotterViz panel.
|
|
3815
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3816
|
+
* @example
|
|
3817
|
+
* ```js
|
|
3818
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizCheckpointRestored, (payload) => {
|
|
3819
|
+
* console.log('SpotterViz checkpoint restored', payload);
|
|
3820
|
+
* // payload: { checkpointId: string, newGenNumber: number }
|
|
3821
|
+
* })
|
|
3822
|
+
* ```
|
|
3823
|
+
*/
|
|
3824
|
+
SpotterVizCheckpointRestored = 'SpotterVizCheckpointRestored',
|
|
3825
|
+
|
|
3826
|
+
/**
|
|
3827
|
+
* Emitted when an error occurs in the SpotterViz panel.
|
|
3828
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3829
|
+
* @example
|
|
3830
|
+
* ```js
|
|
3831
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizError, (payload) => {
|
|
3832
|
+
* console.log('SpotterViz error', payload);
|
|
3833
|
+
* })
|
|
3834
|
+
* ```
|
|
3835
|
+
*/
|
|
3836
|
+
SpotterVizError = 'SpotterVizError',
|
|
3837
|
+
|
|
3838
|
+
/**
|
|
3839
|
+
* Emitted when the SpotterViz panel is closed.
|
|
3840
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
3841
|
+
* @example
|
|
3842
|
+
* ```js
|
|
3843
|
+
* liveboardEmbed.on(EmbedEvent.SpotterVizClosed, (payload) => {
|
|
3844
|
+
* console.log('SpotterViz panel closed', payload);
|
|
3845
|
+
* })
|
|
3846
|
+
* ```
|
|
3847
|
+
*/
|
|
3848
|
+
SpotterVizClosed = 'SpotterVizClosed',
|
|
3849
|
+
/**
|
|
3850
|
+
* Emitted when a user clicks the **Refresh** button in the
|
|
3851
|
+
* Liveboard header. Requires `enableLiveboardDataCache`
|
|
3852
|
+
* to be enabled.
|
|
3853
|
+
* @example
|
|
3854
|
+
* ```js
|
|
3855
|
+
* liveboardEmbed.on(EmbedEvent.RefreshLiveboardBrowserCache, (payload) => {
|
|
3856
|
+
* console.log('Liveboard browser cache refreshed', payload);
|
|
3857
|
+
* // payload: { liveboardId: string }
|
|
3858
|
+
* })
|
|
3859
|
+
* ```
|
|
3860
|
+
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
|
|
3861
|
+
*/
|
|
3862
|
+
RefreshLiveboardBrowserCache = 'refreshLiveboardBrowserCache',
|
|
3705
3863
|
}
|
|
3706
3864
|
|
|
3707
3865
|
/**
|
|
@@ -5777,6 +5935,39 @@ export enum HostEvent {
|
|
|
5777
5935
|
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5778
5936
|
*/
|
|
5779
5937
|
SendTestScheduleEmail = 'sendTestScheduleEmail',
|
|
5938
|
+
|
|
5939
|
+
/**
|
|
5940
|
+
* Sends a user message (prompt) to the SpotterViz panel programmatically.
|
|
5941
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
5942
|
+
* @param query - the prompt text to send.
|
|
5943
|
+
* @example
|
|
5944
|
+
* ```js
|
|
5945
|
+
* liveboardEmbed.trigger(HostEvent.SpotterVizSendUserMessage, {
|
|
5946
|
+
* query: 'Show me revenue by region',
|
|
5947
|
+
* });
|
|
5948
|
+
* ```
|
|
5949
|
+
*/
|
|
5950
|
+
SpotterVizSendUserMessage = 'SpotterVizSendUserMessage',
|
|
5951
|
+
|
|
5952
|
+
/**
|
|
5953
|
+
* Initializes a new SpotterViz conversation.
|
|
5954
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
5955
|
+
* @example
|
|
5956
|
+
* ```js
|
|
5957
|
+
* liveboardEmbed.trigger(HostEvent.InitSpotterVizConversation);
|
|
5958
|
+
* ```
|
|
5959
|
+
*/
|
|
5960
|
+
InitSpotterVizConversation = 'InitSpotterVizConversation',
|
|
5961
|
+
/**
|
|
5962
|
+
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
5963
|
+
* Requires `enableLiveboardDataCache` to be enabled.
|
|
5964
|
+
* @example
|
|
5965
|
+
* ```js
|
|
5966
|
+
* liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
|
|
5967
|
+
* ```
|
|
5968
|
+
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
|
|
5969
|
+
*/
|
|
5970
|
+
RefreshLiveboardBrowserCache = 'refreshLiveboardBrowserCache',
|
|
5780
5971
|
}
|
|
5781
5972
|
|
|
5782
5973
|
/**
|
|
@@ -5819,6 +6010,7 @@ export enum Param {
|
|
|
5819
6010
|
HostAppUrl = 'hostAppUrl',
|
|
5820
6011
|
EnableVizTransformations = 'enableVizTransform',
|
|
5821
6012
|
EnableSearchAssist = 'enableSearchAssist',
|
|
6013
|
+
EnableConnectionNewExperience = 'newConnectionsExperience',
|
|
5822
6014
|
EnablePendoHelp = 'enablePendoHelp',
|
|
5823
6015
|
HideResult = 'hideResult',
|
|
5824
6016
|
UseLastSelectedDataSource = 'useLastSelectedSources',
|
|
@@ -5955,15 +6147,29 @@ export enum Param {
|
|
|
5955
6147
|
ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel',
|
|
5956
6148
|
EnableHomepageAnnouncement = 'enableHomepageAnnouncement',
|
|
5957
6149
|
EnableLiveboardDataCache = 'enableLiveboardDataCache',
|
|
6150
|
+
SpotterFileUploadEnabled = 'spotterFileUploadEnabled',
|
|
6151
|
+
SpotterFileUploadFileTypes = 'spotterFileUploadFileTypes',
|
|
5958
6152
|
}
|
|
5959
6153
|
|
|
6154
|
+
/**
|
|
6155
|
+
* Configuration for allowed file types in Spotter file upload.
|
|
6156
|
+
* @group Embed components
|
|
6157
|
+
*/
|
|
6158
|
+
export type SpotterFileUploadFileTypes = {
|
|
6159
|
+
types?: string[];
|
|
6160
|
+
};
|
|
6161
|
+
|
|
5960
6162
|
/**
|
|
5961
6163
|
* ThoughtSpot application pages include actions and menu commands
|
|
5962
6164
|
* for various user-initiated operations. These actions are represented
|
|
5963
|
-
* as enumeration members in the SDK. To
|
|
5964
|
-
*
|
|
5965
|
-
*
|
|
5966
|
-
*
|
|
6165
|
+
* as enumeration members in the SDK. To control actions in the embedded view:
|
|
6166
|
+
* - disabledActions — the action is grayed out and still visible, but non-interactive (user can see but not click).
|
|
6167
|
+
* - hiddenActions — the action is completely removed from the UI (user cannot see it at all).
|
|
6168
|
+
* - visibleActions — allowlist, only these actions are shown; all others are hidden.
|
|
6169
|
+
*
|
|
6170
|
+
* Use disabledActions to disable (gray out) an action.
|
|
6171
|
+
* Use hiddenActions to hide (fully remove) an action.
|
|
6172
|
+
* Use visibleActions to show only specific actions.
|
|
5967
6173
|
* @example
|
|
5968
6174
|
* ```js
|
|
5969
6175
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -6290,6 +6496,20 @@ export enum Action {
|
|
|
6290
6496
|
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
6291
6497
|
*/
|
|
6292
6498
|
DownloadLiveboardAsContinuousPDF = 'downloadLiveboardAsContinuousPDF',
|
|
6499
|
+
/**
|
|
6500
|
+
* The Download Liveboard as A4 PDF menu action on a Liveboard.
|
|
6501
|
+
* Allows downloading the entire Liveboard as an A4 PDF.
|
|
6502
|
+
* Requires {@link Action.DownloadLiveboard} as a parent action when
|
|
6503
|
+
* {@link LiveboardViewConfig.isLiveboardXLSXCSVDownloadEnabled} or
|
|
6504
|
+
* {@link LiveboardViewConfig.isContinuousLiveboardPDFEnabled} flags are enabled.
|
|
6505
|
+
* Use this instead of {@link Action.DownloadAsPdf} when either flag is on.
|
|
6506
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
6507
|
+
* @example
|
|
6508
|
+
* ```js
|
|
6509
|
+
* disabledActions: [Action.DownloadLiveboardAsA4Pdf]
|
|
6510
|
+
* ```
|
|
6511
|
+
*/
|
|
6512
|
+
DownloadLiveboardAsA4Pdf = 'downloadLiveboardAsA4Pdf',
|
|
6293
6513
|
/**
|
|
6294
6514
|
* The **Download Liveboard as XLSX** menu action on a Liveboard.
|
|
6295
6515
|
* Allows downloading the entire Liveboard as an XLSX file.
|
|
@@ -6814,6 +7034,26 @@ export enum Action {
|
|
|
6814
7034
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw
|
|
6815
7035
|
*/
|
|
6816
7036
|
AxisMenuRemove = 'axisMenuRemove',
|
|
7037
|
+
/**
|
|
7038
|
+
* The **Compare with** action in the chart axis customization menu.
|
|
7039
|
+
* Allows comparing data across dimensions or measures.
|
|
7040
|
+
* @example
|
|
7041
|
+
* ```js
|
|
7042
|
+
* disabledActions: [Action.AxisMenuCompare]
|
|
7043
|
+
* ```
|
|
7044
|
+
* @version SDK: 1.50.0 | ThoughtSpot: 26.7.0.cl
|
|
7045
|
+
*/
|
|
7046
|
+
AxisMenuCompare = 'axisMenuCompare',
|
|
7047
|
+
/**
|
|
7048
|
+
* The **Merge with** action in the chart axis customization menu.
|
|
7049
|
+
* Allows merging data across dimensions or measures.
|
|
7050
|
+
* @example
|
|
7051
|
+
* ```js
|
|
7052
|
+
* disabledActions: [Action.AxisMenuMerge]
|
|
7053
|
+
* ```
|
|
7054
|
+
* @version SDK: 1.50.0 | ThoughtSpot: 26.7.0.cl
|
|
7055
|
+
*/
|
|
7056
|
+
AxisMenuMerge = 'axisMenuMerge',
|
|
6817
7057
|
/**
|
|
6818
7058
|
* @hidden
|
|
6819
7059
|
*/
|
|
@@ -7603,6 +7843,53 @@ export enum Action {
|
|
|
7603
7843
|
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7604
7844
|
*/
|
|
7605
7845
|
SendTestScheduleEmail = 'sendTestScheduleEmail',
|
|
7846
|
+
|
|
7847
|
+
/**
|
|
7848
|
+
* The thumbs up/down feedback buttons in the SpotterViz panel.
|
|
7849
|
+
* Visible by default.
|
|
7850
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
7851
|
+
* @example
|
|
7852
|
+
* ```js
|
|
7853
|
+
* hiddenActions: [Action.SpotterVizFeedback]
|
|
7854
|
+
* disabledActions: [Action.SpotterVizFeedback]
|
|
7855
|
+
* ```
|
|
7856
|
+
*/
|
|
7857
|
+
SpotterVizFeedback = 'spotterVizFeedback',
|
|
7858
|
+
|
|
7859
|
+
/**
|
|
7860
|
+
* The version restore button on checkpoint cards in the SpotterViz panel.
|
|
7861
|
+
* Visible by default.
|
|
7862
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
7863
|
+
* @example
|
|
7864
|
+
* ```js
|
|
7865
|
+
* hiddenActions: [Action.SpotterVizCheckpointRestore]
|
|
7866
|
+
* disabledActions: [Action.SpotterVizCheckpointRestore]
|
|
7867
|
+
* ```
|
|
7868
|
+
*/
|
|
7869
|
+
SpotterVizCheckpointRestore = 'spotterVizCheckpointRestore',
|
|
7870
|
+
|
|
7871
|
+
/**
|
|
7872
|
+
* The **SpotterViz** button in the top edit header.
|
|
7873
|
+
* Visible by default.
|
|
7874
|
+
* @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
|
|
7875
|
+
* @example
|
|
7876
|
+
* ```js
|
|
7877
|
+
* hiddenActions: [Action.SpotterViz]
|
|
7878
|
+
* disabledActions: [Action.SpotterViz]
|
|
7879
|
+
* ```
|
|
7880
|
+
*/
|
|
7881
|
+
SpotterViz = 'spotterViz',
|
|
7882
|
+
/**
|
|
7883
|
+
* Clears browser cache and fetches new data for liveboard ChartViz Containers.
|
|
7884
|
+
* Requires `enableLiveboardDataCache` to be enabled.
|
|
7885
|
+
* @example
|
|
7886
|
+
* ```js
|
|
7887
|
+
* disabledActions: [Action.RefreshLiveboardBrowserCache]
|
|
7888
|
+
* hiddenActions: [Action.RefreshLiveboardBrowserCache]
|
|
7889
|
+
* ```
|
|
7890
|
+
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
|
|
7891
|
+
*/
|
|
7892
|
+
RefreshLiveboardBrowserCache = 'refreshLiveboardBrowserCache',
|
|
7606
7893
|
}
|
|
7607
7894
|
export interface AnswerServiceType {
|
|
7608
7895
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
@@ -8093,6 +8380,9 @@ export interface DefaultAppInitData {
|
|
|
8093
8380
|
customActions: CustomAction[];
|
|
8094
8381
|
interceptTimeout: number | undefined;
|
|
8095
8382
|
interceptUrls: (string | InterceptedApiType)[];
|
|
8383
|
+
embedExpiryInAuthToken:boolean;
|
|
8384
|
+
shouldBypassPayloadValidation?:boolean
|
|
8385
|
+
useHostEventsV2?:boolean
|
|
8096
8386
|
}
|
|
8097
8387
|
|
|
8098
8388
|
/**
|
|
@@ -79,8 +79,9 @@ describe('fetchPreauthInfoService', () => {
|
|
|
79
79
|
});
|
|
80
80
|
it('fetchPreauthInfoService if fetch fails', async () => {
|
|
81
81
|
const mockFetch = jest.spyOn(tokenizedFetchModule, 'tokenizedFetch');
|
|
82
|
+
// Prevent logger.error from reaching console.error (which throws in test env)
|
|
83
|
+
jest.spyOn(logger, 'error').mockImplementation(() => {});
|
|
82
84
|
|
|
83
|
-
// Mock for fetchPreauthInfoService
|
|
84
85
|
mockFetch.mockResolvedValueOnce({
|
|
85
86
|
ok: false,
|
|
86
87
|
status: 500,
|
|
@@ -89,11 +90,10 @@ describe('fetchPreauthInfoService', () => {
|
|
|
89
90
|
text: jest.fn().mockResolvedValue('Internal Server Error'),
|
|
90
91
|
} as any);
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
93
|
+
const response = await fetchPreauthInfoService(thoughtspotHost);
|
|
94
|
+
expect(response.ok).toBe(false);
|
|
95
|
+
expect(response.status).toBe(500);
|
|
96
|
+
expect(logger.error).toHaveBeenCalled();
|
|
97
97
|
expect(mockFetch).toHaveBeenCalledTimes(1);
|
|
98
98
|
expect(mockFetch).toHaveBeenCalledWith(`${thoughtspotHost}${EndPoints.PREAUTH_INFO}`, {});
|
|
99
99
|
});
|