@thoughtspot/visual-embed-sdk 1.37.0 → 1.37.1-spotter-embed
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 +3 -3
- package/cjs/src/auth.d.ts +9 -4
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +21 -0
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +48 -0
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +59 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +13 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +44 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +39 -9
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +32 -5
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +4 -4
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +38 -11
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +28 -4
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +7 -7
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +4 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/pages/embed-test.page.d.ts +8 -0
- package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
- package/cjs/src/pages/embed-test.page.js +20 -0
- package/cjs/src/pages/embed-test.page.js.map +1 -0
- package/cjs/src/pages/home.page.d.ts +6 -0
- package/cjs/src/pages/home.page.d.ts.map +1 -0
- package/cjs/src/pages/home.page.js +12 -0
- package/cjs/src/pages/home.page.js.map +1 -0
- package/cjs/src/pages/login.page.d.ts +15 -0
- package/cjs/src/pages/login.page.d.ts.map +1 -0
- package/cjs/src/pages/login.page.js +22 -0
- package/cjs/src/pages/login.page.js.map +1 -0
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +24 -5
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +21 -4
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/tests/auth.test.d.ts +1 -0
- package/cjs/src/tests/auth.test.d.ts.map +1 -0
- package/cjs/src/tests/auth.test.js +1 -0
- package/cjs/src/tests/auth.test.js.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.js +54 -0
- package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
- package/cjs/src/types.d.ts +95 -3
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +79 -0
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/processData.js +6 -4
- package/cjs/src/utils/processData.js.map +1 -1
- package/dist/index-Cj4BVGHL.js +7371 -0
- package/dist/index-DUaG1OG2.js +7447 -0
- package/dist/index-Fhk1V_Gw.js +7371 -0
- package/dist/index-OuiZF3zE.js +7371 -0
- package/dist/src/auth.d.ts +9 -4
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +59 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +39 -9
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +38 -11
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +24 -5
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +95 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +208 -31
- package/dist/tsembed-react.js +428 -174
- package/dist/tsembed.es.js +170 -32
- package/dist/tsembed.js +392 -176
- package/dist/visual-embed-sdk-react-full.d.ts +299 -47
- package/dist/visual-embed-sdk-react.d.ts +299 -47
- package/dist/visual-embed-sdk.d.ts +276 -43
- package/lib/package.json +3 -3
- package/lib/src/auth.d.ts +9 -4
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +21 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +48 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +59 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +13 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +44 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +39 -9
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +30 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +5 -5
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +38 -11
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +26 -3
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +8 -8
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +4 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +3 -3
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +24 -5
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +21 -4
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +95 -3
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +79 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +35 -15
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/processData.js +6 -4
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +278 -45
- package/package.json +3 -3
- package/src/auth.spec.ts +52 -0
- package/src/auth.ts +25 -3
- package/src/embed/app.spec.ts +64 -0
- package/src/embed/app.ts +80 -0
- package/src/embed/bodyless-conversation.spec.ts +6 -6
- package/src/embed/bodyless-conversation.ts +43 -8
- package/src/embed/conversation.spec.ts +16 -16
- package/src/embed/conversation.ts +42 -11
- package/src/embed/ts-embed.spec.ts +0 -2
- package/src/embed/ts-embed.ts +4 -0
- package/src/index.ts +8 -4
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.tsx +36 -10
- package/src/types.ts +99 -1
- package/src/utils/graphql/answerService/answerService.ts +35 -15
- package/src/utils/processData.ts +6 -6
|
@@ -15,10 +15,10 @@ export interface SearchOptions {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* The configuration for the embedded
|
|
18
|
+
* The configuration for the embedded spotterEmbed options.
|
|
19
19
|
* @group Embed components
|
|
20
20
|
*/
|
|
21
|
-
export interface
|
|
21
|
+
export interface SpotterEmbedViewConfig extends ViewConfig {
|
|
22
22
|
/**
|
|
23
23
|
* The ID of the worksheet to use for the conversation.
|
|
24
24
|
*/
|
|
@@ -32,7 +32,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
32
32
|
* but still display the selected data source.
|
|
33
33
|
* @example
|
|
34
34
|
* ```js
|
|
35
|
-
* const embed = new
|
|
35
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
36
36
|
* ... // other options
|
|
37
37
|
* disableSourceSelection : true,
|
|
38
38
|
* })
|
|
@@ -44,7 +44,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
44
44
|
* hideSourceSelection : Hide data source selection
|
|
45
45
|
* @example
|
|
46
46
|
* ```js
|
|
47
|
-
* const embed = new
|
|
47
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
48
48
|
* ... // other options
|
|
49
49
|
* hideSourceSelection : true,
|
|
50
50
|
* })
|
|
@@ -71,7 +71,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
71
71
|
* default is false.
|
|
72
72
|
* @example
|
|
73
73
|
* ```js
|
|
74
|
-
* const embed = new
|
|
74
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
75
75
|
* ... // other options
|
|
76
76
|
* showSpotterLimitations : true,
|
|
77
77
|
* })
|
|
@@ -84,7 +84,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
84
84
|
* the initial screen of the conversation.
|
|
85
85
|
* @example
|
|
86
86
|
* ```js
|
|
87
|
-
* const embed = new
|
|
87
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
88
88
|
* ... // other options
|
|
89
89
|
* hideSampleQuestions : true,
|
|
90
90
|
* })
|
|
@@ -94,12 +94,20 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
94
94
|
hideSampleQuestions?: boolean;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* The configuration for the embedded spotterEmbed options.
|
|
99
|
+
* @deprecated Renamed to SpotterEmbedViewConfig
|
|
100
|
+
* @group Embed components
|
|
101
|
+
*/
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
103
|
+
export interface ConversationViewConfig extends SpotterEmbedViewConfig {}
|
|
104
|
+
|
|
97
105
|
/**
|
|
98
106
|
* Embed ThoughtSpot AI Conversation.
|
|
99
107
|
* @group Embed components
|
|
100
108
|
* @example
|
|
101
109
|
* ```js
|
|
102
|
-
* const conversation = new
|
|
110
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
103
111
|
* worksheetId: 'worksheetId',
|
|
104
112
|
* searchOptions: {
|
|
105
113
|
* searchQuery: 'searchQuery',
|
|
@@ -107,10 +115,10 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
107
115
|
* });
|
|
108
116
|
* conversation.render();
|
|
109
117
|
* ```
|
|
110
|
-
* @version SDK: 1.
|
|
118
|
+
* @version SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
111
119
|
*/
|
|
112
|
-
export class
|
|
113
|
-
constructor(container: HTMLElement, protected viewConfig:
|
|
120
|
+
export class SpotterEmbed extends TsEmbed {
|
|
121
|
+
constructor(container: HTMLElement, protected viewConfig: SpotterEmbedViewConfig) {
|
|
114
122
|
viewConfig.embedComponentType = 'conversation';
|
|
115
123
|
super(container, viewConfig);
|
|
116
124
|
}
|
|
@@ -163,7 +171,7 @@ export class ConversationEmbed extends TsEmbed {
|
|
|
163
171
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
164
172
|
}
|
|
165
173
|
|
|
166
|
-
public async render(): Promise<
|
|
174
|
+
public async render(): Promise<SpotterEmbed> {
|
|
167
175
|
await super.render();
|
|
168
176
|
|
|
169
177
|
const src = this.getIframeSrc();
|
|
@@ -171,3 +179,26 @@ export class ConversationEmbed extends TsEmbed {
|
|
|
171
179
|
return this;
|
|
172
180
|
}
|
|
173
181
|
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Embed ThoughtSpot AI Conversation.
|
|
185
|
+
* @deprecated Renamed to SpotterEmbed
|
|
186
|
+
* @group Embed components
|
|
187
|
+
* @example
|
|
188
|
+
* ```js
|
|
189
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
190
|
+
* worksheetId: 'worksheetId',
|
|
191
|
+
* searchOptions: {
|
|
192
|
+
* searchQuery: 'searchQuery',
|
|
193
|
+
* },
|
|
194
|
+
* });
|
|
195
|
+
* conversation.render();
|
|
196
|
+
* ```
|
|
197
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
198
|
+
*/
|
|
199
|
+
export class ConversationEmbed extends SpotterEmbed {
|
|
200
|
+
constructor(container: HTMLElement, protected viewConfig: ConversationViewConfig) {
|
|
201
|
+
viewConfig.embedComponentType = 'conversation';
|
|
202
|
+
super(container, viewConfig);
|
|
203
|
+
}
|
|
204
|
+
}
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -540,6 +540,7 @@ export class TsEmbed {
|
|
|
540
540
|
disableRedirectionLinksInNewTab,
|
|
541
541
|
overrideOrgId,
|
|
542
542
|
exposeTranslationIDs,
|
|
543
|
+
primaryAction,
|
|
543
544
|
} = this.viewConfig;
|
|
544
545
|
|
|
545
546
|
const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
|
|
@@ -558,6 +559,9 @@ export class TsEmbed {
|
|
|
558
559
|
this.handleError('You cannot have both hidden Tabs and visible Tabs');
|
|
559
560
|
return queryParams;
|
|
560
561
|
}
|
|
562
|
+
if (primaryAction) {
|
|
563
|
+
queryParams[Param.PrimaryAction] = primaryAction;
|
|
564
|
+
}
|
|
561
565
|
|
|
562
566
|
if (disabledActions?.length) {
|
|
563
567
|
queryParams[Param.DisableActions] = disabledActions;
|
package/src/index.ts
CHANGED
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/liveboard';
|
|
24
24
|
import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
25
25
|
import { SearchBarEmbed, SearchBarViewConfig } from './embed/search-bar';
|
|
26
|
-
import { BodylessConversation, BodylessConversationViewConfig
|
|
27
|
-
import { ConversationEmbed, ConversationViewConfig } from './embed/conversation';
|
|
26
|
+
import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig, SpotterAgentEmbed as BodylessConversation, SpotterAgentEmbedViewConfig as BodylessConversationViewConfig} from './embed/bodyless-conversation';
|
|
27
|
+
import { SpotterEmbed, SpotterEmbedViewConfig, SpotterEmbed as ConversationEmbed, SpotterEmbedViewConfig as ConversationViewConfig } from './embed/conversation';
|
|
28
28
|
import {
|
|
29
29
|
AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter,
|
|
30
30
|
} from './auth';
|
|
@@ -85,10 +85,14 @@ export {
|
|
|
85
85
|
LiveboardEmbed,
|
|
86
86
|
SageEmbed,
|
|
87
87
|
AppEmbed,
|
|
88
|
-
|
|
88
|
+
SpotterAgentEmbed,
|
|
89
|
+
SpotterAgentEmbedViewConfig,
|
|
89
90
|
BodylessConversationViewConfig,
|
|
90
|
-
|
|
91
|
+
BodylessConversation,
|
|
92
|
+
SpotterEmbed,
|
|
93
|
+
SpotterEmbedViewConfig,
|
|
91
94
|
ConversationViewConfig,
|
|
95
|
+
ConversationEmbed,
|
|
92
96
|
AuthFailureType,
|
|
93
97
|
AuthStatus,
|
|
94
98
|
AuthEvent,
|
package/src/react/index.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import { TsEmbed } from '../embed/ts-embed';
|
|
|
13
13
|
|
|
14
14
|
import { EmbedConfig, EmbedEvent, ViewConfig } from '../types';
|
|
15
15
|
import { EmbedProps, getViewPropsAndListeners } from './util';
|
|
16
|
-
import { ConversationEmbed as _ConversationEmbed, ConversationViewConfig } from '../embed/conversation';
|
|
16
|
+
import { SpotterEmbed as _SpotterEmbed, SpotterEmbedViewConfig, ConversationEmbed as _ConversationEmbed, ConversationViewConfig as ConversationViewConfig } from '../embed/conversation';
|
|
17
17
|
import { init } from '../embed/base';
|
|
18
18
|
|
|
19
19
|
const componentFactory = <T extends typeof TsEmbed, U extends EmbedProps, V extends ViewConfig>(
|
|
@@ -334,6 +334,7 @@ export const PreRenderedSageEmbed = componentFactory<
|
|
|
334
334
|
SageViewConfig
|
|
335
335
|
>(_SageEmbed, true);
|
|
336
336
|
|
|
337
|
+
interface SpotterEmbedProps extends EmbedProps, SpotterEmbedViewConfig { }
|
|
337
338
|
interface ConversationEmbedProps extends EmbedProps, ConversationViewConfig { }
|
|
338
339
|
|
|
339
340
|
/**
|
|
@@ -341,6 +342,29 @@ interface ConversationEmbedProps extends EmbedProps, ConversationViewConfig { }
|
|
|
341
342
|
* @example
|
|
342
343
|
* ```tsx
|
|
343
344
|
* function Sage() {
|
|
345
|
+
* return <SpotterEmbed
|
|
346
|
+
* worksheetId="<worksheet-id-here>"
|
|
347
|
+
* searchOptions={{
|
|
348
|
+
* searchQuery: "<search query to start with>"
|
|
349
|
+
* }}
|
|
350
|
+
* ... other view config props or event listeners.
|
|
351
|
+
* />
|
|
352
|
+
* }
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
export const SpotterEmbed = componentFactory<
|
|
356
|
+
typeof _SpotterEmbed,
|
|
357
|
+
SpotterEmbedProps,
|
|
358
|
+
SpotterEmbedViewConfig
|
|
359
|
+
>(_SpotterEmbed);
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* React component for LLM based conversation BI.
|
|
364
|
+
* @deprecated This component is renamed to SpotterEmbed. Use {@link SpotterEmbed} instead.
|
|
365
|
+
* @example
|
|
366
|
+
* ```tsx
|
|
367
|
+
* function Sage() {
|
|
344
368
|
* return <ConversationEmbed
|
|
345
369
|
* worksheetId="<worksheet-id-here>"
|
|
346
370
|
* searchOptions={{
|
|
@@ -352,14 +376,15 @@ interface ConversationEmbedProps extends EmbedProps, ConversationViewConfig { }
|
|
|
352
376
|
* ```
|
|
353
377
|
*/
|
|
354
378
|
export const ConversationEmbed = componentFactory<
|
|
355
|
-
typeof _ConversationEmbed,
|
|
356
|
-
|
|
357
|
-
|
|
379
|
+
typeof _ConversationEmbed,
|
|
380
|
+
ConversationEmbedProps,
|
|
381
|
+
ConversationViewConfig
|
|
382
|
+
>(_ConversationEmbed);
|
|
358
383
|
|
|
359
384
|
/**
|
|
360
385
|
* React component for PreRendered Conversation embed.
|
|
361
386
|
*
|
|
362
|
-
* PreRenderedConversationEmbed will preRender the
|
|
387
|
+
* PreRenderedConversationEmbed will preRender the SpotterEmbed and will be hidden by
|
|
363
388
|
* default.
|
|
364
389
|
*
|
|
365
390
|
* SageEmbed with preRenderId passed will call showPreRender on the embed.
|
|
@@ -370,21 +395,22 @@ export const ConversationEmbed = componentFactory<
|
|
|
370
395
|
* }
|
|
371
396
|
* ```
|
|
372
397
|
* function MyComponent() {
|
|
373
|
-
* return <
|
|
398
|
+
* return <SpotterEmbed preRenderId="someId" worksheetId="id" />
|
|
374
399
|
* }
|
|
375
400
|
* ```
|
|
376
401
|
*/
|
|
377
402
|
export const PreRenderedConversationEmbed = componentFactory<
|
|
378
|
-
typeof
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
>(
|
|
403
|
+
typeof _SpotterEmbed,
|
|
404
|
+
SpotterEmbedProps & PreRenderProps,
|
|
405
|
+
SpotterEmbedViewConfig
|
|
406
|
+
>(_SpotterEmbed, true);
|
|
382
407
|
|
|
383
408
|
type EmbedComponent = typeof SearchEmbed
|
|
384
409
|
| typeof AppEmbed
|
|
385
410
|
| typeof LiveboardEmbed
|
|
386
411
|
| typeof SearchBarEmbed
|
|
387
412
|
| typeof SageEmbed
|
|
413
|
+
| typeof SpotterEmbed
|
|
388
414
|
| typeof ConversationEmbed;
|
|
389
415
|
|
|
390
416
|
/**
|
package/src/types.ts
CHANGED
|
@@ -204,7 +204,19 @@ export enum HomeLeftNavItem {
|
|
|
204
204
|
/**
|
|
205
205
|
* @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
|
|
206
206
|
*/
|
|
207
|
-
LiveboardSchedules = 'liveboard-schedules'
|
|
207
|
+
LiveboardSchedules = 'liveboard-schedules',
|
|
208
|
+
/**
|
|
209
|
+
* Create new options in the insights left navigation,
|
|
210
|
+
* available when new navigation V3 is enabled.
|
|
211
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
212
|
+
*/
|
|
213
|
+
Create = 'create',
|
|
214
|
+
/**
|
|
215
|
+
* Spotter option in the insights left navigation,
|
|
216
|
+
* available when new navigation V3 is enabled.
|
|
217
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
218
|
+
*/
|
|
219
|
+
Spotter = 'spotter',
|
|
208
220
|
}
|
|
209
221
|
export type DOMSelector = string | HTMLElement;
|
|
210
222
|
|
|
@@ -712,6 +724,19 @@ export interface ViewConfig {
|
|
|
712
724
|
* ```
|
|
713
725
|
*/
|
|
714
726
|
disabledActions?: Action[];
|
|
727
|
+
/**
|
|
728
|
+
* The primary action to display on top of the viz for Liveboard and App Embed.
|
|
729
|
+
* Use this to set the primary action.
|
|
730
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
731
|
+
* @example
|
|
732
|
+
* ```js
|
|
733
|
+
* const embed = new LiveboardEmbed('#embed', {
|
|
734
|
+
* ... // other liveboard view config
|
|
735
|
+
* primaryAction: Action.Download
|
|
736
|
+
* });
|
|
737
|
+
* ```
|
|
738
|
+
*/
|
|
739
|
+
primaryAction?: Action | string;
|
|
715
740
|
/**
|
|
716
741
|
* The tooltip to display for disabled actions.
|
|
717
742
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -3324,8 +3349,17 @@ export enum HostEvent {
|
|
|
3324
3349
|
/**
|
|
3325
3350
|
* Get the Answer session for a Search or
|
|
3326
3351
|
* Liveboard visualization.
|
|
3352
|
+
*
|
|
3353
|
+
* Note: This event is not typically used directly. Instead, use the
|
|
3354
|
+
* `getAnswerService()` method on the embed instance to get an AnswerService
|
|
3355
|
+
* object that provides a more convenient interface for working with answers.
|
|
3356
|
+
*
|
|
3327
3357
|
* @example
|
|
3328
3358
|
* ```js
|
|
3359
|
+
* // Preferred way to get an AnswerService
|
|
3360
|
+
* const service = await embed.getAnswerService();
|
|
3361
|
+
*
|
|
3362
|
+
* // Alternative direct usage (not recommended)
|
|
3329
3363
|
* const {session} = await embed.trigger(
|
|
3330
3364
|
* HostEvent.GetAnswerSession, {
|
|
3331
3365
|
* vizId: '123', // For Liveboard Visualization.
|
|
@@ -3333,6 +3367,10 @@ export enum HostEvent {
|
|
|
3333
3367
|
* ```
|
|
3334
3368
|
* @example
|
|
3335
3369
|
* ```js
|
|
3370
|
+
* // Preferred way to get an AnswerService
|
|
3371
|
+
* const service = await embed.getAnswerService();
|
|
3372
|
+
*
|
|
3373
|
+
* // Alternative direct usage (not recommended)
|
|
3336
3374
|
* const {session} = await embed.trigger( HostEvent.GetAnswerSession )
|
|
3337
3375
|
* ```
|
|
3338
3376
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
|
|
@@ -3461,6 +3499,60 @@ export enum HostEvent {
|
|
|
3461
3499
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
3462
3500
|
*/
|
|
3463
3501
|
TransformTableVizData = 'TransformTableVizData',
|
|
3502
|
+
|
|
3503
|
+
/**
|
|
3504
|
+
* Triggers the table visualization re-render with the updated data.
|
|
3505
|
+
* Includes the following properties:
|
|
3506
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
3507
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3508
|
+
* payload.For example, { columnDataLite: []}`.
|
|
3509
|
+
*/
|
|
3510
|
+
SpotterSearch = 'SpotterSearch',
|
|
3511
|
+
|
|
3512
|
+
/**
|
|
3513
|
+
* Triggers the table visualization re-render with the updated data.
|
|
3514
|
+
* Includes the following properties:
|
|
3515
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
3516
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3517
|
+
* payload.For example, { columnDataLite: []}`.
|
|
3518
|
+
*/
|
|
3519
|
+
EditLastPrompt = 'EditLastPrompt',
|
|
3520
|
+
|
|
3521
|
+
/**
|
|
3522
|
+
* Triggers the table visualization re-render with the updated data.
|
|
3523
|
+
* Includes the following properties:
|
|
3524
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
3525
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3526
|
+
* payload.For example, { columnDataLite: []}`.
|
|
3527
|
+
*/
|
|
3528
|
+
PreviewSpotterData = 'PreviewSpotterData',
|
|
3529
|
+
|
|
3530
|
+
/**
|
|
3531
|
+
* Triggers the table visualization re-render with the updated data.
|
|
3532
|
+
* Includes the following properties:
|
|
3533
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
3534
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3535
|
+
* payload.For example, { columnDataLite: []}`.
|
|
3536
|
+
*/
|
|
3537
|
+
ResetSpotterConversation = 'ResetSpotterConversation',
|
|
3538
|
+
|
|
3539
|
+
/**
|
|
3540
|
+
* Triggers the table visualization re-render with the updated data.
|
|
3541
|
+
* Includes the following properties:
|
|
3542
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
3543
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3544
|
+
* payload.For example, { columnDataLite: []}`.
|
|
3545
|
+
*/
|
|
3546
|
+
DeleteLastPrompt = 'DeleteLastPrompt',
|
|
3547
|
+
|
|
3548
|
+
/**
|
|
3549
|
+
* Triggers the table visualization re-render with the updated data.
|
|
3550
|
+
* Includes the following properties:
|
|
3551
|
+
* @param - `columnDataLite` - an array of object containing the
|
|
3552
|
+
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3553
|
+
* payload.For example, { columnDataLite: []}`.
|
|
3554
|
+
*/
|
|
3555
|
+
AnswerChartSwitcher = 'answerChartSwitcher',
|
|
3464
3556
|
}
|
|
3465
3557
|
|
|
3466
3558
|
/**
|
|
@@ -3541,6 +3633,10 @@ export enum Param {
|
|
|
3541
3633
|
ShowInsertToSlide = 'insertInToSlide',
|
|
3542
3634
|
PrimaryNavHidden = 'primaryNavHidden',
|
|
3543
3635
|
HideProfleAndHelp = 'profileAndHelpInNavBarHidden',
|
|
3636
|
+
NavigationVersion = 'navigationVersion',
|
|
3637
|
+
HideHamburger = 'hideHamburger',
|
|
3638
|
+
HideObjectSearch = 'hideObjectSearch',
|
|
3639
|
+
HideNotification = 'hideNotification',
|
|
3544
3640
|
HideApplicationSwitcher = 'applicationSwitcherHidden',
|
|
3545
3641
|
HideOrgSwitcher = 'orgSwitcherHidden',
|
|
3546
3642
|
IsSageEmbed = 'isSageEmbed',
|
|
@@ -3597,6 +3693,8 @@ export enum Param {
|
|
|
3597
3693
|
preAuthCache = 'preAuthCache',
|
|
3598
3694
|
ShowSpotterLimitations = 'showSpotterLimitations',
|
|
3599
3695
|
CoverAndFilterOptionInPDF = 'coverAndFilterOptionInPDF',
|
|
3696
|
+
PrimaryAction = 'primaryAction',
|
|
3697
|
+
isSpotterAgentEmbed = 'isSpotterAgentEmbed',
|
|
3600
3698
|
}
|
|
3601
3699
|
|
|
3602
3700
|
/**
|
|
@@ -26,29 +26,49 @@ export interface UnderlyingDataPoint {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* AnswerService provides a simple way to work with ThoughtSpot Answers.
|
|
30
|
+
*
|
|
31
|
+
* This service allows you to interact with ThoughtSpot Answers programmatically,
|
|
32
|
+
* making it easy to customize visualizations, filter data, and extract insights
|
|
33
|
+
* directly from your application.
|
|
34
|
+
*
|
|
35
|
+
* You can use this service to:
|
|
36
|
+
* - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
|
|
37
|
+
* - Apply filters to Answers (`addFilter`)
|
|
38
|
+
* - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
|
|
39
|
+
* - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
|
|
40
|
+
* - Run custom queries (`executeQuery`)
|
|
41
|
+
* - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
|
|
42
|
+
*
|
|
33
43
|
* @example
|
|
34
44
|
* ```js
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
45
|
+
* // Get the answer service
|
|
46
|
+
* embed.on(EmbedEvent.Data, async (e) => {
|
|
47
|
+
* const service = await embed.getAnswerService();
|
|
48
|
+
*
|
|
49
|
+
* // Add columns to the answer
|
|
50
|
+
* await service.addColumnsByName(["Sales", "Region"]);
|
|
51
|
+
*
|
|
52
|
+
* // Get the data
|
|
53
|
+
* const data = await service.fetchData();
|
|
54
|
+
* console.log(data);
|
|
55
|
+
* });
|
|
41
56
|
* ```
|
|
57
|
+
*
|
|
42
58
|
* @example
|
|
43
59
|
* ```js
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* await
|
|
47
|
-
*
|
|
60
|
+
* // Get data for a point in a visualization
|
|
61
|
+
* embed.on(EmbedEvent.CustomAction, async (e) => {
|
|
62
|
+
* const underlying = await e.answerService.getUnderlyingDataForPoint([
|
|
63
|
+
* 'Product Name',
|
|
64
|
+
* 'Sales Amount'
|
|
48
65
|
* ]);
|
|
49
|
-
*
|
|
66
|
+
*
|
|
67
|
+
* const data = await underlying.fetchData(0, 100);
|
|
68
|
+
* console.log(data);
|
|
50
69
|
* });
|
|
51
70
|
* ```
|
|
71
|
+
*
|
|
52
72
|
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
53
73
|
* @group Events
|
|
54
74
|
*/
|
package/src/utils/processData.ts
CHANGED
|
@@ -80,15 +80,15 @@ export function processAuthFailure(e: any, containerEl: Element) {
|
|
|
80
80
|
const {
|
|
81
81
|
loginFailedMessage, authType, disableLoginFailurePage, autoLogin,
|
|
82
82
|
} = getEmbedConfig();
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
) {
|
|
83
|
+
|
|
84
|
+
const isEmbeddedSSO = authType === AuthType.EmbeddedSSO;
|
|
85
|
+
const isTrustedAuth = authType === AuthType.TrustedAuthToken || authType === AuthType.TrustedAuthTokenCookieless;
|
|
86
|
+
const isEmbeddedSSOInfoFailure = isEmbeddedSSO && e?.data?.type === AuthFailureType.UNAUTHENTICATED_FAILURE;
|
|
87
|
+
if (autoLogin && isTrustedAuth) {
|
|
88
88
|
// eslint-disable-next-line no-param-reassign
|
|
89
89
|
containerEl.innerHTML = loginFailedMessage;
|
|
90
90
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
91
|
-
} else if (authType !== AuthType.None && !disableLoginFailurePage) {
|
|
91
|
+
} else if (authType !== AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
|
|
92
92
|
// eslint-disable-next-line no-param-reassign
|
|
93
93
|
containerEl.innerHTML = loginFailedMessage;
|
|
94
94
|
notifyAuthFailure(AuthFailureType.OTHER);
|