@thoughtspot/visual-embed-sdk 1.37.1 → 1.38.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/embed/bodyless-conversation.d.ts +44 -9
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +35 -5
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +290 -5
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +40 -11
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +29 -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 +4 -4
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -1
- 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 +3 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +53 -5
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +73 -4
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +94 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +2 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +1 -0
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-m9UtENc9.js → index-BIcnpmMY.js} +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +44 -9
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +40 -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 +4 -4
- 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 +53 -5
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +2 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +562 -10
- package/dist/tsembed-react.js +562 -8
- package/dist/tsembed.es.js +65 -11
- package/dist/tsembed.js +71 -15
- package/dist/visual-embed-sdk-react-full.d.ts +184 -72
- package/dist/visual-embed-sdk-react.d.ts +184 -72
- package/dist/visual-embed-sdk.d.ts +87 -22
- package/lib/package.json +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +44 -9
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +33 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +292 -7
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +40 -11
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +27 -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 +4 -4
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +4 -4
- 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 +53 -5
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +73 -4
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +96 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +2 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +1 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +90 -25
- package/package.json +1 -1
- package/src/embed/bodyless-conversation.spec.ts +314 -7
- package/src/embed/bodyless-conversation.ts +53 -8
- package/src/embed/conversation.spec.ts +16 -16
- package/src/embed/conversation.ts +44 -11
- package/src/embed/ts-embed.spec.ts +0 -2
- package/src/index.ts +16 -5
- package/src/react/all-types-export.ts +2 -0
- package/src/react/index.spec.tsx +157 -1
- package/src/react/index.tsx +98 -11
- package/src/types.ts +1 -0
|
@@ -195,6 +195,8 @@ export const SageEmbed: React.ForwardRefExoticComponent<SageEmbedProps & React.R
|
|
|
195
195
|
* ```
|
|
196
196
|
*/
|
|
197
197
|
export const PreRenderedSageEmbed: React.ForwardRefExoticComponent<SageEmbedProps & PreRenderProps & React.RefAttributes<_SageEmbed>>;
|
|
198
|
+
interface SpotterEmbedProps extends EmbedProps, SpotterEmbedViewConfig {
|
|
199
|
+
}
|
|
198
200
|
interface ConversationEmbedProps extends EmbedProps, ConversationViewConfig {
|
|
199
201
|
}
|
|
200
202
|
/**
|
|
@@ -202,6 +204,24 @@ interface ConversationEmbedProps extends EmbedProps, ConversationViewConfig {
|
|
|
202
204
|
* @example
|
|
203
205
|
* ```tsx
|
|
204
206
|
* function Sage() {
|
|
207
|
+
* return <SpotterEmbed
|
|
208
|
+
* worksheetId="<worksheet-id-here>"
|
|
209
|
+
* searchOptions={{
|
|
210
|
+
* searchQuery: "<search query to start with>"
|
|
211
|
+
* }}
|
|
212
|
+
* ... other view config props or event listeners.
|
|
213
|
+
* />
|
|
214
|
+
* }
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
export const SpotterEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & React.RefAttributes<_SpotterEmbed>>;
|
|
218
|
+
/**
|
|
219
|
+
* React component for LLM based conversation BI.
|
|
220
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
221
|
+
* Use {@link SpotterEmbed} instead
|
|
222
|
+
* @example
|
|
223
|
+
* ```tsx
|
|
224
|
+
* function Sage() {
|
|
205
225
|
* return <ConversationEmbed
|
|
206
226
|
* worksheetId="<worksheet-id-here>"
|
|
207
227
|
* searchOptions={{
|
|
@@ -213,10 +233,37 @@ interface ConversationEmbedProps extends EmbedProps, ConversationViewConfig {
|
|
|
213
233
|
* ```
|
|
214
234
|
*/
|
|
215
235
|
export const ConversationEmbed: React.ForwardRefExoticComponent<ConversationEmbedProps & React.RefAttributes<_ConversationEmbed>>;
|
|
236
|
+
interface SpotterAgentEmbedProps extends EmbedProps, SpotterAgentEmbedViewConfig {
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* React component for SpotterAgent embed, which can be integrated inside
|
|
240
|
+
* chatbots or other conversational interfaces.
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* function SpotterAgent() {
|
|
244
|
+
* const ref = useRef();
|
|
245
|
+
*
|
|
246
|
+
* const handleSendMessage = async () => {
|
|
247
|
+
* const { container, error } = await ref.current.sendMessage('show me sales by region');
|
|
248
|
+
* if (container) {
|
|
249
|
+
* document.body.appendChild(container);
|
|
250
|
+
* }
|
|
251
|
+
* };
|
|
252
|
+
*
|
|
253
|
+
* return (
|
|
254
|
+
* <div>
|
|
255
|
+
* <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
|
|
256
|
+
* <button onClick={handleSendMessage}>Send Message</button>
|
|
257
|
+
* </div>
|
|
258
|
+
* );
|
|
259
|
+
* }
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
export const SpotterAgentEmbed: React.ForwardRefExoticComponent<SpotterAgentEmbedProps & React.RefAttributes<_SpotterAgentEmbed>>;
|
|
216
263
|
/**
|
|
217
264
|
* React component for PreRendered Conversation embed.
|
|
218
265
|
*
|
|
219
|
-
* PreRenderedConversationEmbed will preRender the
|
|
266
|
+
* PreRenderedConversationEmbed will preRender the SpotterEmbed and will be hidden by
|
|
220
267
|
* default.
|
|
221
268
|
*
|
|
222
269
|
* SageEmbed with preRenderId passed will call showPreRender on the embed.
|
|
@@ -227,12 +274,12 @@ export const ConversationEmbed: React.ForwardRefExoticComponent<ConversationEmbe
|
|
|
227
274
|
* }
|
|
228
275
|
* ```
|
|
229
276
|
* function MyComponent() {
|
|
230
|
-
* return <
|
|
277
|
+
* return <SpotterEmbed preRenderId="someId" worksheetId="id" />
|
|
231
278
|
* }
|
|
232
279
|
* ```
|
|
233
280
|
*/
|
|
234
|
-
export const PreRenderedConversationEmbed: React.ForwardRefExoticComponent<
|
|
235
|
-
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof ConversationEmbed;
|
|
281
|
+
export const PreRenderedConversationEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & PreRenderProps & React.RefAttributes<_SpotterEmbed>>;
|
|
282
|
+
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof SpotterAgentEmbed | typeof SpotterEmbed | typeof ConversationEmbed;
|
|
236
283
|
/**
|
|
237
284
|
* Get a reference to the embed component to trigger events on the component.
|
|
238
285
|
* @example
|
|
@@ -2038,6 +2085,96 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
2038
2085
|
export declare class PinboardEmbed extends LiveboardEmbed {
|
|
2039
2086
|
}
|
|
2040
2087
|
|
|
2088
|
+
/**
|
|
2089
|
+
* Configuration for bodyless conversation options.
|
|
2090
|
+
* @group Embed components
|
|
2091
|
+
*/
|
|
2092
|
+
export interface SpotterAgentEmbedViewConfig extends ViewConfig {
|
|
2093
|
+
/**
|
|
2094
|
+
* The ID of the worksheet to use for the conversation.
|
|
2095
|
+
*/
|
|
2096
|
+
worksheetId: string;
|
|
2097
|
+
/**
|
|
2098
|
+
* Optional CSS class name to add to the container div.
|
|
2099
|
+
*/
|
|
2100
|
+
containerClassName?: string;
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Configuration for conversation options.
|
|
2104
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
2105
|
+
* Use {@link SpotterAgentEmbedViewConfig} instead
|
|
2106
|
+
* @group Embed components
|
|
2107
|
+
*/
|
|
2108
|
+
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2109
|
+
}
|
|
2110
|
+
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
2111
|
+
sessionId: string;
|
|
2112
|
+
genNo: number;
|
|
2113
|
+
acSessionId: string;
|
|
2114
|
+
acGenNo: number;
|
|
2115
|
+
}
|
|
2116
|
+
declare class ConversationMessage extends TsEmbed {
|
|
2117
|
+
protected viewConfig: SpotterAgentMessageViewConfig;
|
|
2118
|
+
constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
|
|
2119
|
+
getIframeSrc(): string;
|
|
2120
|
+
render(): Promise<ConversationMessage>;
|
|
2121
|
+
}
|
|
2122
|
+
/**
|
|
2123
|
+
* Create a conversation embed, which can be integrated inside
|
|
2124
|
+
* chatbots or other conversational interfaces.
|
|
2125
|
+
* @example
|
|
2126
|
+
* ```js
|
|
2127
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
2128
|
+
*
|
|
2129
|
+
* const conversation = new SpotterAgentEmbed({
|
|
2130
|
+
* worksheetId: 'worksheetId',
|
|
2131
|
+
* });
|
|
2132
|
+
*
|
|
2133
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
2134
|
+
*
|
|
2135
|
+
* // append the container to the DOM
|
|
2136
|
+
* document.body.appendChild(container); // or to any other element
|
|
2137
|
+
* ```
|
|
2138
|
+
* @group Embed components
|
|
2139
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
2140
|
+
*/
|
|
2141
|
+
export declare class SpotterAgentEmbed {
|
|
2142
|
+
constructor(viewConfig: SpotterAgentEmbedViewConfig);
|
|
2143
|
+
sendMessage(userMessage: string): Promise<{
|
|
2144
|
+
error: any;
|
|
2145
|
+
container?: undefined;
|
|
2146
|
+
viz?: undefined;
|
|
2147
|
+
} | {
|
|
2148
|
+
container: HTMLDivElement;
|
|
2149
|
+
viz: ConversationMessage;
|
|
2150
|
+
error?: undefined;
|
|
2151
|
+
}>;
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* Create a conversation embed, which can be integrated inside
|
|
2155
|
+
* chatbots or other conversational interfaces.
|
|
2156
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
2157
|
+
* Use {@link SpotterAgentEmbed} instead
|
|
2158
|
+
* @example
|
|
2159
|
+
* ```js
|
|
2160
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
2161
|
+
*
|
|
2162
|
+
* const conversation = new SpotterAgentEmbed({
|
|
2163
|
+
* worksheetId: 'worksheetId',
|
|
2164
|
+
* });
|
|
2165
|
+
*
|
|
2166
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
2167
|
+
*
|
|
2168
|
+
* // append the container to the DOM
|
|
2169
|
+
* document.body.appendChild(container); // or to any other element
|
|
2170
|
+
* ```
|
|
2171
|
+
* @group Embed components
|
|
2172
|
+
*/
|
|
2173
|
+
export declare class BodylessConversation extends SpotterAgentEmbed {
|
|
2174
|
+
constructor(viewConfig: BodylessConversationViewConfig);
|
|
2175
|
+
}
|
|
2176
|
+
export {};
|
|
2177
|
+
|
|
2041
2178
|
/**
|
|
2042
2179
|
* Copyright (c) 2023
|
|
2043
2180
|
*
|
|
@@ -5635,7 +5772,8 @@ export declare enum Param {
|
|
|
5635
5772
|
preAuthCache = "preAuthCache",
|
|
5636
5773
|
ShowSpotterLimitations = "showSpotterLimitations",
|
|
5637
5774
|
CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
|
|
5638
|
-
PrimaryAction = "primaryAction"
|
|
5775
|
+
PrimaryAction = "primaryAction",
|
|
5776
|
+
isSpotterAgentEmbed = "isSpotterAgentEmbed"
|
|
5639
5777
|
}
|
|
5640
5778
|
/**
|
|
5641
5779
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7040,10 +7178,10 @@ export interface SearchOptions {
|
|
|
7040
7178
|
searchQuery: string;
|
|
7041
7179
|
}
|
|
7042
7180
|
/**
|
|
7043
|
-
* The configuration for the embedded
|
|
7181
|
+
* The configuration for the embedded spotterEmbed options.
|
|
7044
7182
|
* @group Embed components
|
|
7045
7183
|
*/
|
|
7046
|
-
export interface
|
|
7184
|
+
export interface SpotterEmbedViewConfig extends ViewConfig {
|
|
7047
7185
|
/**
|
|
7048
7186
|
* The ID of the worksheet to use for the conversation.
|
|
7049
7187
|
*/
|
|
@@ -7057,7 +7195,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
7057
7195
|
* but still display the selected data source.
|
|
7058
7196
|
* @example
|
|
7059
7197
|
* ```js
|
|
7060
|
-
* const embed = new
|
|
7198
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
7061
7199
|
* ... // other options
|
|
7062
7200
|
* disableSourceSelection : true,
|
|
7063
7201
|
* })
|
|
@@ -7069,7 +7207,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
7069
7207
|
* hideSourceSelection : Hide data source selection
|
|
7070
7208
|
* @example
|
|
7071
7209
|
* ```js
|
|
7072
|
-
* const embed = new
|
|
7210
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
7073
7211
|
* ... // other options
|
|
7074
7212
|
* hideSourceSelection : true,
|
|
7075
7213
|
* })
|
|
@@ -7096,7 +7234,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
7096
7234
|
* default is false.
|
|
7097
7235
|
* @example
|
|
7098
7236
|
* ```js
|
|
7099
|
-
* const embed = new
|
|
7237
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
7100
7238
|
* ... // other options
|
|
7101
7239
|
* showSpotterLimitations : true,
|
|
7102
7240
|
* })
|
|
@@ -7109,7 +7247,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
7109
7247
|
* the initial screen of the conversation.
|
|
7110
7248
|
* @example
|
|
7111
7249
|
* ```js
|
|
7112
|
-
* const embed = new
|
|
7250
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
7113
7251
|
* ... // other options
|
|
7114
7252
|
* hideSampleQuestions : true,
|
|
7115
7253
|
* })
|
|
@@ -7118,12 +7256,20 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
7118
7256
|
*/
|
|
7119
7257
|
hideSampleQuestions?: boolean;
|
|
7120
7258
|
}
|
|
7259
|
+
/**
|
|
7260
|
+
* The configuration for the embedded spotterEmbed options.
|
|
7261
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
7262
|
+
* Use {@link SpotterEmbedViewConfig} instead
|
|
7263
|
+
* @group Embed components
|
|
7264
|
+
*/
|
|
7265
|
+
export interface ConversationViewConfig extends SpotterEmbedViewConfig {
|
|
7266
|
+
}
|
|
7121
7267
|
/**
|
|
7122
7268
|
* Embed ThoughtSpot AI Conversation.
|
|
7123
7269
|
* @group Embed components
|
|
7124
7270
|
* @example
|
|
7125
7271
|
* ```js
|
|
7126
|
-
* const conversation = new
|
|
7272
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
7127
7273
|
* worksheetId: 'worksheetId',
|
|
7128
7274
|
* searchOptions: {
|
|
7129
7275
|
* searchQuery: 'searchQuery',
|
|
@@ -7131,13 +7277,34 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
7131
7277
|
* });
|
|
7132
7278
|
* conversation.render();
|
|
7133
7279
|
* ```
|
|
7134
|
-
* @version SDK: 1.
|
|
7280
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
7135
7281
|
*/
|
|
7136
|
-
export declare class
|
|
7282
|
+
export declare class SpotterEmbed extends TsEmbed {
|
|
7283
|
+
protected viewConfig: SpotterEmbedViewConfig;
|
|
7284
|
+
constructor(container: HTMLElement, viewConfig: SpotterEmbedViewConfig);
|
|
7285
|
+
getIframeSrc(): string;
|
|
7286
|
+
render(): Promise<SpotterEmbed>;
|
|
7287
|
+
}
|
|
7288
|
+
/**
|
|
7289
|
+
* Embed ThoughtSpot AI Conversation.
|
|
7290
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
7291
|
+
* Use {@link SpotterEmbed} instead
|
|
7292
|
+
* @group Embed components
|
|
7293
|
+
* @example
|
|
7294
|
+
* ```js
|
|
7295
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
7296
|
+
* worksheetId: 'worksheetId',
|
|
7297
|
+
* searchOptions: {
|
|
7298
|
+
* searchQuery: 'searchQuery',
|
|
7299
|
+
* },
|
|
7300
|
+
* });
|
|
7301
|
+
* conversation.render();
|
|
7302
|
+
* ```
|
|
7303
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
7304
|
+
*/
|
|
7305
|
+
export declare class ConversationEmbed extends SpotterEmbed {
|
|
7137
7306
|
protected viewConfig: ConversationViewConfig;
|
|
7138
7307
|
constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
|
|
7139
|
-
getIframeSrc(): string;
|
|
7140
|
-
render(): Promise<ConversationEmbed>;
|
|
7141
7308
|
}
|
|
7142
7309
|
|
|
7143
7310
|
/**
|
|
@@ -7148,7 +7315,7 @@ export declare class ConversationEmbed extends TsEmbed {
|
|
|
7148
7315
|
* @summary ThoughtSpot Visual Embed SDK
|
|
7149
7316
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
7150
7317
|
*/
|
|
7151
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed,
|
|
7318
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversationViewConfig, BodylessConversation, SpotterEmbed, SpotterEmbedViewConfig, ConversationViewConfig, ConversationEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
|
|
7152
7319
|
|
|
7153
7320
|
/**
|
|
7154
7321
|
* Copyright (c) 2022
|
|
@@ -8264,61 +8431,6 @@ export declare const exportTML: (data: exportTMLInput) => Promise<any>;
|
|
|
8264
8431
|
*/
|
|
8265
8432
|
export declare function reset(): void;
|
|
8266
8433
|
|
|
8267
|
-
/**
|
|
8268
|
-
* Configuration for bodyless conversation options.
|
|
8269
|
-
* @group Embed components
|
|
8270
|
-
*/
|
|
8271
|
-
export interface BodylessConversationViewConfig extends ViewConfig {
|
|
8272
|
-
/**
|
|
8273
|
-
* The ID of the worksheet to use for the conversation.
|
|
8274
|
-
*/
|
|
8275
|
-
worksheetId: string;
|
|
8276
|
-
}
|
|
8277
|
-
interface ConversationMessageViewConfig extends BodylessConversationViewConfig {
|
|
8278
|
-
sessionId: string;
|
|
8279
|
-
genNo: number;
|
|
8280
|
-
acSessionId: string;
|
|
8281
|
-
acGenNo: number;
|
|
8282
|
-
}
|
|
8283
|
-
declare class ConversationMessage extends TsEmbed {
|
|
8284
|
-
protected viewConfig: ConversationMessageViewConfig;
|
|
8285
|
-
constructor(container: HTMLElement, viewConfig: ConversationMessageViewConfig);
|
|
8286
|
-
getIframeSrc(): string;
|
|
8287
|
-
render(): Promise<ConversationMessage>;
|
|
8288
|
-
}
|
|
8289
|
-
/**
|
|
8290
|
-
* Create a conversation embed, which can be integrated inside
|
|
8291
|
-
* chatbots or other conversational interfaces.
|
|
8292
|
-
* @example
|
|
8293
|
-
* ```js
|
|
8294
|
-
* import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
|
|
8295
|
-
*
|
|
8296
|
-
* const conversation = new BodylessConversation({
|
|
8297
|
-
* worksheetId: 'worksheetId',
|
|
8298
|
-
* });
|
|
8299
|
-
*
|
|
8300
|
-
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
8301
|
-
*
|
|
8302
|
-
* // append the container to the DOM
|
|
8303
|
-
* document.body.appendChild(container); // or to any other element
|
|
8304
|
-
* ```
|
|
8305
|
-
* @group Embed components
|
|
8306
|
-
* @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
|
|
8307
|
-
*/
|
|
8308
|
-
export declare class BodylessConversation {
|
|
8309
|
-
constructor(viewConfig: BodylessConversationViewConfig);
|
|
8310
|
-
sendMessage(userMessage: string): Promise<{
|
|
8311
|
-
error: any;
|
|
8312
|
-
container?: undefined;
|
|
8313
|
-
viz?: undefined;
|
|
8314
|
-
} | {
|
|
8315
|
-
container: HTMLDivElement;
|
|
8316
|
-
viz: ConversationMessage;
|
|
8317
|
-
error?: undefined;
|
|
8318
|
-
}>;
|
|
8319
|
-
}
|
|
8320
|
-
export {};
|
|
8321
|
-
|
|
8322
8434
|
export type SessionInfo = {
|
|
8323
8435
|
releaseVersion: string;
|
|
8324
8436
|
userGUID: string;
|
|
@@ -12,7 +12,7 @@ import EventEmitter from 'eventemitter3';
|
|
|
12
12
|
* @summary ThoughtSpot Visual Embed SDK
|
|
13
13
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
14
14
|
*/
|
|
15
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed,
|
|
15
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversationViewConfig, BodylessConversation, SpotterEmbed, SpotterEmbedViewConfig, ConversationViewConfig, ConversationEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Copyright (c) 2022
|
|
@@ -1606,21 +1606,33 @@ export class SearchBarEmbed extends TsEmbed {
|
|
|
1606
1606
|
* Configuration for bodyless conversation options.
|
|
1607
1607
|
* @group Embed components
|
|
1608
1608
|
*/
|
|
1609
|
-
export interface
|
|
1609
|
+
export interface SpotterAgentEmbedViewConfig extends ViewConfig {
|
|
1610
1610
|
/**
|
|
1611
1611
|
* The ID of the worksheet to use for the conversation.
|
|
1612
1612
|
*/
|
|
1613
1613
|
worksheetId: string;
|
|
1614
|
+
/**
|
|
1615
|
+
* Optional CSS class name to add to the container div.
|
|
1616
|
+
*/
|
|
1617
|
+
containerClassName?: string;
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* Configuration for conversation options.
|
|
1621
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1622
|
+
* Use {@link SpotterAgentEmbedViewConfig} instead
|
|
1623
|
+
* @group Embed components
|
|
1624
|
+
*/
|
|
1625
|
+
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
|
|
1614
1626
|
}
|
|
1615
|
-
interface
|
|
1627
|
+
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
1616
1628
|
sessionId: string;
|
|
1617
1629
|
genNo: number;
|
|
1618
1630
|
acSessionId: string;
|
|
1619
1631
|
acGenNo: number;
|
|
1620
1632
|
}
|
|
1621
1633
|
class ConversationMessage extends TsEmbed {
|
|
1622
|
-
protected viewConfig:
|
|
1623
|
-
constructor(container: HTMLElement, viewConfig:
|
|
1634
|
+
protected viewConfig: SpotterAgentMessageViewConfig;
|
|
1635
|
+
constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
|
|
1624
1636
|
getIframeSrc(): string;
|
|
1625
1637
|
render(): Promise<ConversationMessage>;
|
|
1626
1638
|
}
|
|
@@ -1629,9 +1641,9 @@ class ConversationMessage extends TsEmbed {
|
|
|
1629
1641
|
* chatbots or other conversational interfaces.
|
|
1630
1642
|
* @example
|
|
1631
1643
|
* ```js
|
|
1632
|
-
* import {
|
|
1644
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
1633
1645
|
*
|
|
1634
|
-
* const conversation = new
|
|
1646
|
+
* const conversation = new SpotterAgentEmbed({
|
|
1635
1647
|
* worksheetId: 'worksheetId',
|
|
1636
1648
|
* });
|
|
1637
1649
|
*
|
|
@@ -1641,10 +1653,10 @@ class ConversationMessage extends TsEmbed {
|
|
|
1641
1653
|
* document.body.appendChild(container); // or to any other element
|
|
1642
1654
|
* ```
|
|
1643
1655
|
* @group Embed components
|
|
1644
|
-
* @version SDK: 1.
|
|
1656
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
1645
1657
|
*/
|
|
1646
|
-
export class
|
|
1647
|
-
constructor(viewConfig:
|
|
1658
|
+
export class SpotterAgentEmbed {
|
|
1659
|
+
constructor(viewConfig: SpotterAgentEmbedViewConfig);
|
|
1648
1660
|
sendMessage(userMessage: string): Promise<{
|
|
1649
1661
|
error: any;
|
|
1650
1662
|
container?: undefined;
|
|
@@ -1655,6 +1667,29 @@ export class BodylessConversation {
|
|
|
1655
1667
|
error?: undefined;
|
|
1656
1668
|
}>;
|
|
1657
1669
|
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Create a conversation embed, which can be integrated inside
|
|
1672
|
+
* chatbots or other conversational interfaces.
|
|
1673
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1674
|
+
* Use {@link SpotterAgentEmbed} instead
|
|
1675
|
+
* @example
|
|
1676
|
+
* ```js
|
|
1677
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
1678
|
+
*
|
|
1679
|
+
* const conversation = new SpotterAgentEmbed({
|
|
1680
|
+
* worksheetId: 'worksheetId',
|
|
1681
|
+
* });
|
|
1682
|
+
*
|
|
1683
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
1684
|
+
*
|
|
1685
|
+
* // append the container to the DOM
|
|
1686
|
+
* document.body.appendChild(container); // or to any other element
|
|
1687
|
+
* ```
|
|
1688
|
+
* @group Embed components
|
|
1689
|
+
*/
|
|
1690
|
+
export class BodylessConversation extends SpotterAgentEmbed {
|
|
1691
|
+
constructor(viewConfig: BodylessConversationViewConfig);
|
|
1692
|
+
}
|
|
1658
1693
|
export {};
|
|
1659
1694
|
|
|
1660
1695
|
/**
|
|
@@ -1667,10 +1702,10 @@ export interface SearchOptions {
|
|
|
1667
1702
|
searchQuery: string;
|
|
1668
1703
|
}
|
|
1669
1704
|
/**
|
|
1670
|
-
* The configuration for the embedded
|
|
1705
|
+
* The configuration for the embedded spotterEmbed options.
|
|
1671
1706
|
* @group Embed components
|
|
1672
1707
|
*/
|
|
1673
|
-
export interface
|
|
1708
|
+
export interface SpotterEmbedViewConfig extends ViewConfig {
|
|
1674
1709
|
/**
|
|
1675
1710
|
* The ID of the worksheet to use for the conversation.
|
|
1676
1711
|
*/
|
|
@@ -1684,7 +1719,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
1684
1719
|
* but still display the selected data source.
|
|
1685
1720
|
* @example
|
|
1686
1721
|
* ```js
|
|
1687
|
-
* const embed = new
|
|
1722
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
1688
1723
|
* ... // other options
|
|
1689
1724
|
* disableSourceSelection : true,
|
|
1690
1725
|
* })
|
|
@@ -1696,7 +1731,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
1696
1731
|
* hideSourceSelection : Hide data source selection
|
|
1697
1732
|
* @example
|
|
1698
1733
|
* ```js
|
|
1699
|
-
* const embed = new
|
|
1734
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
1700
1735
|
* ... // other options
|
|
1701
1736
|
* hideSourceSelection : true,
|
|
1702
1737
|
* })
|
|
@@ -1723,7 +1758,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
1723
1758
|
* default is false.
|
|
1724
1759
|
* @example
|
|
1725
1760
|
* ```js
|
|
1726
|
-
* const embed = new
|
|
1761
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
1727
1762
|
* ... // other options
|
|
1728
1763
|
* showSpotterLimitations : true,
|
|
1729
1764
|
* })
|
|
@@ -1736,7 +1771,7 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
1736
1771
|
* the initial screen of the conversation.
|
|
1737
1772
|
* @example
|
|
1738
1773
|
* ```js
|
|
1739
|
-
* const embed = new
|
|
1774
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
1740
1775
|
* ... // other options
|
|
1741
1776
|
* hideSampleQuestions : true,
|
|
1742
1777
|
* })
|
|
@@ -1745,12 +1780,43 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
1745
1780
|
*/
|
|
1746
1781
|
hideSampleQuestions?: boolean;
|
|
1747
1782
|
}
|
|
1783
|
+
/**
|
|
1784
|
+
* The configuration for the embedded spotterEmbed options.
|
|
1785
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1786
|
+
* Use {@link SpotterEmbedViewConfig} instead
|
|
1787
|
+
* @group Embed components
|
|
1788
|
+
*/
|
|
1789
|
+
export interface ConversationViewConfig extends SpotterEmbedViewConfig {
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Embed ThoughtSpot AI Conversation.
|
|
1793
|
+
* @group Embed components
|
|
1794
|
+
* @example
|
|
1795
|
+
* ```js
|
|
1796
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
1797
|
+
* worksheetId: 'worksheetId',
|
|
1798
|
+
* searchOptions: {
|
|
1799
|
+
* searchQuery: 'searchQuery',
|
|
1800
|
+
* },
|
|
1801
|
+
* });
|
|
1802
|
+
* conversation.render();
|
|
1803
|
+
* ```
|
|
1804
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
1805
|
+
*/
|
|
1806
|
+
export class SpotterEmbed extends TsEmbed {
|
|
1807
|
+
protected viewConfig: SpotterEmbedViewConfig;
|
|
1808
|
+
constructor(container: HTMLElement, viewConfig: SpotterEmbedViewConfig);
|
|
1809
|
+
getIframeSrc(): string;
|
|
1810
|
+
render(): Promise<SpotterEmbed>;
|
|
1811
|
+
}
|
|
1748
1812
|
/**
|
|
1749
1813
|
* Embed ThoughtSpot AI Conversation.
|
|
1814
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1815
|
+
* Use {@link SpotterEmbed} instead
|
|
1750
1816
|
* @group Embed components
|
|
1751
1817
|
* @example
|
|
1752
1818
|
* ```js
|
|
1753
|
-
* const conversation = new
|
|
1819
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
1754
1820
|
* worksheetId: 'worksheetId',
|
|
1755
1821
|
* searchOptions: {
|
|
1756
1822
|
* searchQuery: 'searchQuery',
|
|
@@ -1758,13 +1824,11 @@ export interface ConversationViewConfig extends ViewConfig {
|
|
|
1758
1824
|
* });
|
|
1759
1825
|
* conversation.render();
|
|
1760
1826
|
* ```
|
|
1761
|
-
* @version SDK: 1.
|
|
1827
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
1762
1828
|
*/
|
|
1763
|
-
export class ConversationEmbed extends
|
|
1829
|
+
export class ConversationEmbed extends SpotterEmbed {
|
|
1764
1830
|
protected viewConfig: ConversationViewConfig;
|
|
1765
1831
|
constructor(container: HTMLElement, viewConfig: ConversationViewConfig);
|
|
1766
|
-
getIframeSrc(): string;
|
|
1767
|
-
render(): Promise<ConversationEmbed>;
|
|
1768
1832
|
}
|
|
1769
1833
|
|
|
1770
1834
|
export let loggedInStatus: boolean;
|
|
@@ -5648,7 +5712,8 @@ export enum Param {
|
|
|
5648
5712
|
preAuthCache = "preAuthCache",
|
|
5649
5713
|
ShowSpotterLimitations = "showSpotterLimitations",
|
|
5650
5714
|
CoverAndFilterOptionInPDF = "coverAndFilterOptionInPDF",
|
|
5651
|
-
PrimaryAction = "primaryAction"
|
|
5715
|
+
PrimaryAction = "primaryAction",
|
|
5716
|
+
isSpotterAgentEmbed = "isSpotterAgentEmbed"
|
|
5652
5717
|
}
|
|
5653
5718
|
/**
|
|
5654
5719
|
* ThoughtSpot application pages include actions and menu commands
|