@thoughtspot/visual-embed-sdk 1.37.0-temp-nav → 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 +7 -3
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +20 -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 +2 -19
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +3 -8
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +4 -10
- 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.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/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/types.d.ts +51 -2
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +49 -0
- package/cjs/src/types.js.map +1 -1
- package/dist/index-DUaG1OG2.js +7447 -0
- package/dist/index-DnIvX1FR.js +7371 -0
- package/dist/index-OuiZF3zE.js +7371 -0
- package/dist/src/auth.d.ts +7 -3
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +2 -19
- 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.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 +51 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +122 -18
- package/dist/tsembed-react.js +342 -161
- package/dist/tsembed.es.js +84 -19
- package/dist/tsembed.js +306 -163
- package/dist/visual-embed-sdk-react-full.d.ts +161 -49
- package/dist/visual-embed-sdk-react.d.ts +161 -49
- package/dist/visual-embed-sdk.d.ts +138 -45
- package/lib/package.json +3 -3
- package/lib/src/auth.d.ts +7 -3
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +20 -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 +2 -19
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +3 -8
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +4 -10
- 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.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 +51 -2
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +49 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +140 -47
- package/package.json +3 -3
- package/src/auth.spec.ts +52 -0
- package/src/auth.ts +23 -2
- package/src/embed/app.spec.ts +4 -10
- package/src/embed/app.ts +6 -30
- 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/index.ts +8 -4
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.tsx +36 -10
- package/src/types.ts +55 -0
|
@@ -8,14 +8,22 @@ import { getQueryParamString } from '../utils';
|
|
|
8
8
|
* Configuration for bodyless conversation options.
|
|
9
9
|
* @group Embed components
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
11
|
+
export interface SpotterAgentEmbedViewConfig extends ViewConfig {
|
|
12
12
|
/**
|
|
13
13
|
* The ID of the worksheet to use for the conversation.
|
|
14
14
|
*/
|
|
15
15
|
worksheetId: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for conversation options.
|
|
20
|
+
* @deprecated Renamed to SpotterAgentEmbedViewConfig
|
|
21
|
+
* @group Embed components
|
|
22
|
+
*/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
24
|
+
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {}
|
|
25
|
+
|
|
26
|
+
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
19
27
|
sessionId: string;
|
|
20
28
|
genNo: number;
|
|
21
29
|
acSessionId: string;
|
|
@@ -23,7 +31,7 @@ interface ConversationMessageViewConfig extends BodylessConversationViewConfig {
|
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
class ConversationMessage extends TsEmbed {
|
|
26
|
-
constructor(container: HTMLElement, protected viewConfig:
|
|
34
|
+
constructor(container: HTMLElement, protected viewConfig: SpotterAgentMessageViewConfig) {
|
|
27
35
|
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
28
36
|
super(container, viewConfig);
|
|
29
37
|
}
|
|
@@ -39,6 +47,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
39
47
|
const queryParams = this.getBaseQueryParams();
|
|
40
48
|
|
|
41
49
|
queryParams[Param.HideActions] = [...(queryParams[Param.HideActions] ?? [])];
|
|
50
|
+
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
42
51
|
let query = '';
|
|
43
52
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
44
53
|
if (queryParamsString) {
|
|
@@ -68,9 +77,9 @@ class ConversationMessage extends TsEmbed {
|
|
|
68
77
|
* chatbots or other conversational interfaces.
|
|
69
78
|
* @example
|
|
70
79
|
* ```js
|
|
71
|
-
* import {
|
|
80
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
72
81
|
*
|
|
73
|
-
* const conversation = new
|
|
82
|
+
* const conversation = new SpotterAgentEmbed({
|
|
74
83
|
* worksheetId: 'worksheetId',
|
|
75
84
|
* });
|
|
76
85
|
*
|
|
@@ -80,12 +89,12 @@ class ConversationMessage extends TsEmbed {
|
|
|
80
89
|
* document.body.appendChild(container); // or to any other element
|
|
81
90
|
* ```
|
|
82
91
|
* @group Embed components
|
|
83
|
-
* @version SDK: 1.
|
|
92
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
84
93
|
*/
|
|
85
|
-
export class
|
|
94
|
+
export class SpotterAgentEmbed {
|
|
86
95
|
private conversationService: ConversationService;
|
|
87
96
|
|
|
88
|
-
constructor(private viewConfig:
|
|
97
|
+
constructor(private viewConfig: SpotterAgentEmbedViewConfig) {
|
|
89
98
|
const embedConfig = getEmbedConfig();
|
|
90
99
|
|
|
91
100
|
this.conversationService = new ConversationService(
|
|
@@ -112,3 +121,29 @@ export class BodylessConversation {
|
|
|
112
121
|
return { container, viz: embed };
|
|
113
122
|
}
|
|
114
123
|
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Create a conversation embed, which can be integrated inside
|
|
127
|
+
* chatbots or other conversational interfaces.
|
|
128
|
+
* @deprecated Renamed to SpotterAgentEmbed
|
|
129
|
+
* @example
|
|
130
|
+
* ```js
|
|
131
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
132
|
+
*
|
|
133
|
+
* const conversation = new SpotterAgentEmbed({
|
|
134
|
+
* worksheetId: 'worksheetId',
|
|
135
|
+
* });
|
|
136
|
+
*
|
|
137
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
138
|
+
*
|
|
139
|
+
* // append the container to the DOM
|
|
140
|
+
* document.body.appendChild(container); // or to any other element
|
|
141
|
+
* ```
|
|
142
|
+
* @group Embed components
|
|
143
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
144
|
+
*/
|
|
145
|
+
export class BodylessConversation extends SpotterAgentEmbed {
|
|
146
|
+
constructor(viewConfig: BodylessConversationViewConfig) {
|
|
147
|
+
super(viewConfig);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
SpotterEmbed,
|
|
3
|
+
SpotterEmbedViewConfig,
|
|
4
4
|
} from './conversation';
|
|
5
5
|
import * as authInstance from '../auth';
|
|
6
6
|
import { init } from '../index';
|
|
@@ -28,14 +28,14 @@ beforeAll(() => {
|
|
|
28
28
|
|
|
29
29
|
describe('ConversationEmbed', () => {
|
|
30
30
|
it('should render the conversation embed', async () => {
|
|
31
|
-
const viewConfig:
|
|
31
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
32
32
|
worksheetId: 'worksheetId',
|
|
33
33
|
searchOptions: {
|
|
34
34
|
searchQuery: 'searchQuery',
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const conversationEmbed = new
|
|
38
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
39
39
|
await conversationEmbed.render();
|
|
40
40
|
expectUrlMatchesWithParams(
|
|
41
41
|
getIFrameSrc(),
|
|
@@ -44,7 +44,7 @@ describe('ConversationEmbed', () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it('should render the conversation embed with worksheets disabled', async () => {
|
|
47
|
-
const viewConfig:
|
|
47
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
48
48
|
worksheetId: 'worksheetId',
|
|
49
49
|
searchOptions: {
|
|
50
50
|
searchQuery: 'searchQuery',
|
|
@@ -52,7 +52,7 @@ describe('ConversationEmbed', () => {
|
|
|
52
52
|
disableSourceSelection: true,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const conversationEmbed = new
|
|
55
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
56
56
|
await conversationEmbed.render();
|
|
57
57
|
expectUrlMatchesWithParams(
|
|
58
58
|
getIFrameSrc(),
|
|
@@ -61,7 +61,7 @@ describe('ConversationEmbed', () => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
it('should render the conversation embed with spotter limitations text if flag is set', async () => {
|
|
64
|
-
const viewConfig:
|
|
64
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
65
65
|
worksheetId: 'worksheetId',
|
|
66
66
|
searchOptions: {
|
|
67
67
|
searchQuery: 'searchQuery',
|
|
@@ -69,7 +69,7 @@ describe('ConversationEmbed', () => {
|
|
|
69
69
|
showSpotterLimitations: true,
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
const conversationEmbed = new
|
|
72
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
73
73
|
await conversationEmbed.render();
|
|
74
74
|
expectUrlMatchesWithParams(
|
|
75
75
|
getIFrameSrc(),
|
|
@@ -78,7 +78,7 @@ describe('ConversationEmbed', () => {
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('should render the conversation embed with sample questions hidden', async () => {
|
|
81
|
-
const viewConfig:
|
|
81
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
82
82
|
worksheetId: 'worksheetId',
|
|
83
83
|
searchOptions: {
|
|
84
84
|
searchQuery: 'searchQuery',
|
|
@@ -86,7 +86,7 @@ describe('ConversationEmbed', () => {
|
|
|
86
86
|
hideSampleQuestions: true,
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
const conversationEmbed = new
|
|
89
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
90
90
|
await conversationEmbed.render();
|
|
91
91
|
expectUrlMatchesWithParams(
|
|
92
92
|
getIFrameSrc(),
|
|
@@ -95,7 +95,7 @@ describe('ConversationEmbed', () => {
|
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
it('should render the conversation embed with worksheets hidden', async () => {
|
|
98
|
-
const viewConfig:
|
|
98
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
99
99
|
worksheetId: 'worksheetId',
|
|
100
100
|
searchOptions: {
|
|
101
101
|
searchQuery: 'searchQuery',
|
|
@@ -103,7 +103,7 @@ describe('ConversationEmbed', () => {
|
|
|
103
103
|
hideSourceSelection: true,
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
const conversationEmbed = new
|
|
106
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
107
107
|
await conversationEmbed.render();
|
|
108
108
|
expectUrlMatchesWithParams(
|
|
109
109
|
getIFrameSrc(),
|
|
@@ -112,13 +112,13 @@ describe('ConversationEmbed', () => {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
it('should handle error when worksheetId is not provided', async () => {
|
|
115
|
-
const viewConfig:
|
|
115
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
116
116
|
worksheetId: '',
|
|
117
117
|
searchOptions: {
|
|
118
118
|
searchQuery: 'searchQuery',
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
|
-
const conversationEmbed = new
|
|
121
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
122
122
|
(conversationEmbed as any).handleError = jest.fn();
|
|
123
123
|
await conversationEmbed.render();
|
|
124
124
|
expect((conversationEmbed as any).handleError).toHaveBeenCalledWith(
|
|
@@ -127,7 +127,7 @@ describe('ConversationEmbed', () => {
|
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
it('should render the conversation embed if data panel v2 flag is true', async () => {
|
|
130
|
-
const viewConfig:
|
|
130
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
131
131
|
worksheetId: 'worksheetId',
|
|
132
132
|
searchOptions: {
|
|
133
133
|
searchQuery: 'searchQuery',
|
|
@@ -135,7 +135,7 @@ describe('ConversationEmbed', () => {
|
|
|
135
135
|
dataPanelV2: true,
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
const conversationEmbed = new
|
|
138
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
139
139
|
await conversationEmbed.render();
|
|
140
140
|
expectUrlMatchesWithParams(
|
|
141
141
|
getIFrameSrc(),
|
|
@@ -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/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
|
@@ -3499,6 +3499,60 @@ export enum HostEvent {
|
|
|
3499
3499
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
3500
3500
|
*/
|
|
3501
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',
|
|
3502
3556
|
}
|
|
3503
3557
|
|
|
3504
3558
|
/**
|
|
@@ -3640,6 +3694,7 @@ export enum Param {
|
|
|
3640
3694
|
ShowSpotterLimitations = 'showSpotterLimitations',
|
|
3641
3695
|
CoverAndFilterOptionInPDF = 'coverAndFilterOptionInPDF',
|
|
3642
3696
|
PrimaryAction = 'primaryAction',
|
|
3697
|
+
isSpotterAgentEmbed = 'isSpotterAgentEmbed',
|
|
3643
3698
|
}
|
|
3644
3699
|
|
|
3645
3700
|
/**
|