@thoughtspot/visual-embed-sdk 1.39.2-alpha.1 → 1.39.2-spotter-agent
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/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +24 -4
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +2 -60
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +1 -9
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +0 -102
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.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 +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +71 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +436 -100
- package/cjs/src/react/index.spec.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/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils.spec.js +25 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/index-2QHwuA-G.js +7371 -0
- package/dist/{index-DeFzsyFF.js → index-Cj4BVGHL.js} +1 -1
- package/dist/{index-UuEbsISo.js → index-DUaG1OG2.js} +1 -1
- package/dist/{index-CmEQfuE3.js → index-DnIvX1FR.js} +1 -1
- package/dist/{index-Dpf0rd6w.js → index-Fhk1V_Gw.js} +1 -1
- package/dist/index-OuiZF3zE.js +7371 -0
- package/dist/src/embed/bodyless-conversation.d.ts +19 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +2 -60
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.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 +71 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +112 -63
- package/dist/tsembed-react.js +112 -61
- package/dist/tsembed.es.js +29 -15
- package/dist/tsembed.js +28 -14
- package/dist/visual-embed-sdk-react-full.d.ts +90 -85
- package/dist/visual-embed-sdk-react.d.ts +90 -85
- package/dist/visual-embed-sdk.d.ts +20 -66
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +19 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +23 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +2 -60
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +2 -10
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +2 -104
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.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 +71 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +439 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils.spec.js +26 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +21 -67
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +24 -10
- package/src/embed/conversation.spec.ts +5 -131
- package/src/embed/conversation.ts +10 -82
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +556 -157
- package/src/react/index.tsx +117 -51
- package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
- package/src/utils.spec.ts +29 -0
|
@@ -9,10 +9,6 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
|
|
|
9
9
|
* The ID of the worksheet to use for the conversation.
|
|
10
10
|
*/
|
|
11
11
|
worksheetId: string;
|
|
12
|
-
/**
|
|
13
|
-
* Optional CSS class name to add to the container div.
|
|
14
|
-
*/
|
|
15
|
-
containerClassName?: string;
|
|
16
12
|
}
|
|
17
13
|
/**
|
|
18
14
|
* Configuration for conversation options.
|
|
@@ -22,13 +18,13 @@ export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'prima
|
|
|
22
18
|
*/
|
|
23
19
|
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
|
|
24
20
|
}
|
|
25
|
-
interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
21
|
+
export interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConfig {
|
|
26
22
|
sessionId: string;
|
|
27
23
|
genNo: number;
|
|
28
24
|
acSessionId: string;
|
|
29
25
|
acGenNo: number;
|
|
30
26
|
}
|
|
31
|
-
declare class ConversationMessage extends TsEmbed {
|
|
27
|
+
export declare class ConversationMessage extends TsEmbed {
|
|
32
28
|
protected viewConfig: SpotterAgentMessageViewConfig;
|
|
33
29
|
constructor(container: HTMLElement, viewConfig: SpotterAgentMessageViewConfig);
|
|
34
30
|
getIframeSrc(): string;
|
|
@@ -66,6 +62,23 @@ export declare class SpotterAgentEmbed {
|
|
|
66
62
|
viz: ConversationMessage;
|
|
67
63
|
error?: undefined;
|
|
68
64
|
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Send a message to the conversation service and return only the data.
|
|
67
|
+
* @param userMessage - The message to send to the conversation service.
|
|
68
|
+
* @returns The data from the conversation service.
|
|
69
|
+
*/
|
|
70
|
+
sendMessageData(userMessage: string): Promise<{
|
|
71
|
+
error: any;
|
|
72
|
+
data?: undefined;
|
|
73
|
+
} | {
|
|
74
|
+
data: {
|
|
75
|
+
sessionId: any;
|
|
76
|
+
genNo: any;
|
|
77
|
+
acSessionId: any;
|
|
78
|
+
acGenNo: any;
|
|
79
|
+
};
|
|
80
|
+
error?: undefined;
|
|
81
|
+
}>;
|
|
69
82
|
}
|
|
70
83
|
/**
|
|
71
84
|
* Create a conversation embed, which can be integrated inside
|
|
@@ -90,5 +103,4 @@ export declare class SpotterAgentEmbed {
|
|
|
90
103
|
export declare class BodylessConversation extends SpotterAgentEmbed {
|
|
91
104
|
constructor(viewConfig: BodylessConversationViewConfig);
|
|
92
105
|
}
|
|
93
|
-
export {};
|
|
94
106
|
//# sourceMappingURL=bodyless-conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodyless-conversation.d.ts","sourceRoot":"","sources":["bodyless-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC;IACtF;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"bodyless-conversation.d.ts","sourceRoot":"","sources":["bodyless-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC;IACtF;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AAEH,MAAM,WAAW,8BAA+B,SAAQ,2BAA2B;CAAG;AAEtF,MAAM,WAAW,6BAA8B,SAAQ,2BAA2B;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,mBAAoB,SAAQ,OAAO;IACR,SAAS,CAAC,UAAU,EAAE,6BAA6B;gBAA3E,SAAS,EAAE,WAAW,EAAY,UAAU,EAAE,6BAA6B;IAKhF,YAAY;IA2BN,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAOtD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAiB;IAGd,OAAO,CAAC,UAAU;IAF9B,OAAO,CAAC,mBAAmB,CAAsB;gBAE7B,UAAU,EAAE,2BAA2B;IAS9C,WAAW,CAAC,WAAW,EAAE,MAAM;;;;;;;;;IAmB5C;;;;OAIG;IACU,eAAe,CAAC,WAAW,EAAE,MAAM;;;;;;;;;;;;CAgBnD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;gBAC3C,UAAU,EAAE,8BAA8B;CAGzD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseViewConfig
|
|
1
|
+
import { BaseViewConfig } from '../types';
|
|
2
2
|
import { TsEmbed } from './ts-embed';
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for search options
|
|
@@ -15,8 +15,7 @@ export interface SearchOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAction'> {
|
|
17
17
|
/**
|
|
18
|
-
* The ID of the data source object. For example, Model, View, or Table. Spotter uses
|
|
19
|
-
* this object to query data and generate Answers.
|
|
18
|
+
* The ID of the data source object. For example, Model, View, or Table. Spotter uses this object to query data and generate Answers.
|
|
20
19
|
*/
|
|
21
20
|
worksheetId: string;
|
|
22
21
|
/**
|
|
@@ -99,63 +98,6 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
99
98
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
100
99
|
*/
|
|
101
100
|
hideSampleQuestions?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* The list of runtime filters to apply to a search Answer,
|
|
104
|
-
* visualization, or Liveboard.
|
|
105
|
-
*
|
|
106
|
-
* Supported embed types: `SpotterEmbed`
|
|
107
|
-
* @example
|
|
108
|
-
* ```js
|
|
109
|
-
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
110
|
-
* ... // other embed view config
|
|
111
|
-
* runtimeFilters: [
|
|
112
|
-
* {
|
|
113
|
-
* columnName: 'value',
|
|
114
|
-
* operator: RuntimeFilterOp.EQ,
|
|
115
|
-
* values: ['string' | 123 | true],
|
|
116
|
-
* },
|
|
117
|
-
* ],
|
|
118
|
-
* })
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
runtimeFilters?: RuntimeFilter[];
|
|
122
|
-
/**
|
|
123
|
-
* Flag to control whether runtime filters should be included in the URL.
|
|
124
|
-
* If true, filters will be passed via app initialization payload instead.
|
|
125
|
-
* If false/undefined, filters will be added to URL (default behavior).
|
|
126
|
-
*
|
|
127
|
-
* Supported embed types: `SpotterEmbed`
|
|
128
|
-
* @default false
|
|
129
|
-
*/
|
|
130
|
-
excludeRuntimeFiltersfromURL?: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* The list of runtime parameters to apply to the conversation.
|
|
133
|
-
*
|
|
134
|
-
* Supported embed types: `SpotterEmbed`
|
|
135
|
-
* @example
|
|
136
|
-
* ```js
|
|
137
|
-
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
138
|
-
* ... // other embed view config
|
|
139
|
-
* runtimeParameters: [
|
|
140
|
-
* {
|
|
141
|
-
* name: 'Parameter Name',
|
|
142
|
-
* value: 'Parameter Value',
|
|
143
|
-
* },
|
|
144
|
-
* ],
|
|
145
|
-
* })
|
|
146
|
-
* ```
|
|
147
|
-
*/
|
|
148
|
-
runtimeParameters?: RuntimeParameter[];
|
|
149
|
-
/**
|
|
150
|
-
* Flag to control whether runtime parameters should be included in the URL.
|
|
151
|
-
* If true, parameters will be passed via app initialization payload instead.
|
|
152
|
-
* If false/undefined, parameters will be added to URL (default behavior).
|
|
153
|
-
*
|
|
154
|
-
* Supported embed types: `SpotterEmbed`
|
|
155
|
-
* @default false
|
|
156
|
-
*
|
|
157
|
-
*/
|
|
158
|
-
excludeRuntimeParametersfromURL?: boolean;
|
|
159
101
|
}
|
|
160
102
|
/**
|
|
161
103
|
* The configuration for the embedded spotterEmbed options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,cAAc,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC;IACjF;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;;OAcG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;GAKG;AAEH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;CAAG;AAEzE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACD,SAAS,CAAC,UAAU,EAAE,sBAAsB;gBAApE,SAAS,EAAE,WAAW,EAAY,UAAU,EAAE,sBAAsB;IAKzE,YAAY,IAAI,MAAM;IAgDhB,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;CAO/C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACX,SAAS,CAAC,UAAU,EAAE,sBAAsB;gBAApE,SAAS,EAAE,WAAW,EAAY,UAAU,EAAE,sBAAsB;CAInF"}
|
package/dist/src/errors.d.ts
CHANGED
package/dist/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;CAoBzB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { SearchEmbed, PreRenderedSearchEmbed, LiveboardEmbed, PreRenderedLiveboardEmbed, SearchBarEmbed, PreRenderedSearchBarEmbed, AppEmbed, PreRenderedAppEmbed, SageEmbed, PreRenderedSageEmbed, SpotterEmbed, ConversationEmbed, PreRenderedConversationEmbed,
|
|
1
|
+
export { SearchEmbed, PreRenderedSearchEmbed, LiveboardEmbed, PreRenderedLiveboardEmbed, SearchBarEmbed, PreRenderedSearchBarEmbed, AppEmbed, PreRenderedAppEmbed, SageEmbed, PreRenderedSageEmbed, SpotterEmbed, ConversationEmbed, PreRenderedConversationEmbed, SpotterMessage, useSpotterAgent, useEmbedRef, useInit, } from './index';
|
|
2
2
|
export { init, logout, prefetch, getInitConfig, getSessionInfo, uploadMixpanelEvent, PinboardEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, resetCachedAuthToken, UIPassthroughEvent, DataPanelCustomColumnGroupsAccordionState, } from '../index';
|
|
3
3
|
//# sourceMappingURL=all-types-export.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-types-export.d.ts","sourceRoot":"","sources":["all-types-export.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EACzB,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,4BAA4B,EAC5B,
|
|
1
|
+
{"version":3,"file":"all-types-export.d.ts","sourceRoot":"","sources":["all-types-export.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EACzB,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,4BAA4B,EAC5B,cAAc,EACd,eAAe,EACf,WAAW,EACX,OAAO,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,UAAU,EACV,SAAS,EACT,gBAAgB,EAEhB,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,cAAc,EACd,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,yCAAyC,GAC5C,MAAM,UAAU,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { SageEmbed as _SageEmbed, SageViewConfig } from '../embed/sage';
|
|
|
5
5
|
import { SearchEmbed as _SearchEmbed, SearchViewConfig } from '../embed/search';
|
|
6
6
|
import { AppEmbed as _AppEmbed, AppViewConfig } from '../embed/app';
|
|
7
7
|
import { LiveboardEmbed as _LiveboardEmbed, LiveboardViewConfig } from '../embed/liveboard';
|
|
8
|
-
import {
|
|
8
|
+
import { SpotterAgentEmbedViewConfig, ConversationMessage as _ConversationMessage, SpotterAgentMessageViewConfig } from '../embed/bodyless-conversation';
|
|
9
9
|
import { EmbedConfig } from '../types';
|
|
10
10
|
import { EmbedProps } from './util';
|
|
11
11
|
import { SpotterEmbed as _SpotterEmbed, SpotterEmbedViewConfig, ConversationEmbed as _ConversationEmbed, ConversationViewConfig } from '../embed/conversation';
|
|
@@ -236,33 +236,42 @@ export declare const SpotterEmbed: React.ForwardRefExoticComponent<SpotterEmbedP
|
|
|
236
236
|
* ```
|
|
237
237
|
*/
|
|
238
238
|
export declare const ConversationEmbed: React.ForwardRefExoticComponent<ConversationEmbedProps & React.RefAttributes<_ConversationEmbed>>;
|
|
239
|
-
|
|
239
|
+
/**
|
|
240
|
+
* React component for individual conversation messages from SpotterAgent.
|
|
241
|
+
* This component is used internally by the useSpotterAgent hook.
|
|
242
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
243
|
+
*/
|
|
244
|
+
interface ConversationMessageProps extends EmbedProps, SpotterAgentMessageViewConfig {
|
|
240
245
|
}
|
|
246
|
+
export declare const ConversationMessage: React.ForwardRefExoticComponent<ConversationMessageProps & React.RefAttributes<_ConversationMessage>>;
|
|
241
247
|
/**
|
|
242
|
-
* React component for
|
|
243
|
-
*
|
|
248
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
249
|
+
*
|
|
250
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
251
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
252
|
+
*
|
|
244
253
|
* @example
|
|
245
254
|
* ```tsx
|
|
246
|
-
*
|
|
247
|
-
*
|
|
255
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
256
|
+
* const result = await sendMessage('show me sales by region');
|
|
248
257
|
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* document.body.appendChild(container);
|
|
253
|
-
* }
|
|
254
|
-
* };
|
|
258
|
+
* if (!result.error) {
|
|
259
|
+
* // Simple usage - just pass the message data
|
|
260
|
+
* <SpotterMessage message={result.message} />
|
|
255
261
|
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
* );
|
|
262
|
+
* // With optional query for context
|
|
263
|
+
* <SpotterMessage
|
|
264
|
+
* message={result.message}
|
|
265
|
+
* query={result.query}
|
|
266
|
+
* />
|
|
262
267
|
* }
|
|
263
268
|
* ```
|
|
269
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
264
270
|
*/
|
|
265
|
-
export declare const
|
|
271
|
+
export declare const SpotterMessage: React.ForwardRefExoticComponent<{
|
|
272
|
+
message: SpotterAgentMessageViewConfig;
|
|
273
|
+
query?: string;
|
|
274
|
+
} & Omit<EmbedProps, keyof SpotterAgentMessageViewConfig> & React.RefAttributes<_ConversationMessage>>;
|
|
266
275
|
/**
|
|
267
276
|
* React component for PreRendered Conversation embed.
|
|
268
277
|
*
|
|
@@ -282,7 +291,7 @@ export declare const SpotterAgentEmbed: React.ForwardRefExoticComponent<SpotterA
|
|
|
282
291
|
* ```
|
|
283
292
|
*/
|
|
284
293
|
export declare const PreRenderedConversationEmbed: React.ForwardRefExoticComponent<SpotterEmbedProps & PreRenderProps & React.RefAttributes<_SpotterEmbed>>;
|
|
285
|
-
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof
|
|
294
|
+
type EmbedComponent = typeof SearchEmbed | typeof AppEmbed | typeof LiveboardEmbed | typeof SearchBarEmbed | typeof SageEmbed | typeof ConversationMessage | typeof SpotterMessage | typeof SpotterEmbed | typeof ConversationEmbed;
|
|
286
295
|
/**
|
|
287
296
|
* Get a reference to the embed component to trigger events on the component.
|
|
288
297
|
* @example
|
|
@@ -314,5 +323,47 @@ export declare function useEmbedRef<T extends EmbedComponent>(): React.MutableRe
|
|
|
314
323
|
* @version SDK: 1.36.2 | ThoughtSpot: *
|
|
315
324
|
*/
|
|
316
325
|
export declare function useInit(config: EmbedConfig): React.MutableRefObject<AuthEventEmitter>;
|
|
326
|
+
/**
|
|
327
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
328
|
+
*
|
|
329
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
330
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
331
|
+
*
|
|
332
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
333
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
334
|
+
* @example
|
|
335
|
+
* ```tsx
|
|
336
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
337
|
+
*
|
|
338
|
+
* const handleQuery = async () => {
|
|
339
|
+
* const result = await sendMessage('show me sales by region');
|
|
340
|
+
*
|
|
341
|
+
* if (!result.error) {
|
|
342
|
+
* // Display the message response
|
|
343
|
+
* <SpotterMessage message={result.message} />
|
|
344
|
+
* } else {
|
|
345
|
+
* console.error('Error:', result.error);
|
|
346
|
+
* }
|
|
347
|
+
* };
|
|
348
|
+
* ```
|
|
349
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
350
|
+
*/
|
|
351
|
+
export declare function useSpotterAgent(config: SpotterAgentEmbedViewConfig): {
|
|
352
|
+
sendMessage: (query: string) => Promise<{
|
|
353
|
+
error: any;
|
|
354
|
+
query?: undefined;
|
|
355
|
+
message?: undefined;
|
|
356
|
+
} | {
|
|
357
|
+
query: string;
|
|
358
|
+
message: {
|
|
359
|
+
worksheetId: string;
|
|
360
|
+
sessionId: any;
|
|
361
|
+
genNo: any;
|
|
362
|
+
acSessionId: any;
|
|
363
|
+
acGenNo: any;
|
|
364
|
+
};
|
|
365
|
+
error?: undefined;
|
|
366
|
+
}>;
|
|
367
|
+
};
|
|
317
368
|
export { LiveboardViewConfig, SearchViewConfig, AppViewConfig, Page, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, Action, FrameParams, HomeLeftNavItem, HomepageModule, LogLevel, getSessionInfo, ListPageColumns, } from '../index';
|
|
318
369
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-service.d.ts","sourceRoot":"","sources":["conversation-service.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IAKT,OAAO,CAAC,eAAe;IAAU,OAAO,CAAC,WAAW;IAJhE,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,UAAU,CAA6B;gBAE3B,eAAe,EAAE,MAAM,EAAU,WAAW,EAAE,MAAM;IAIlE,IAAI;IAKV,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC;IAqBrB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation-service.d.ts","sourceRoot":"","sources":["conversation-service.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IAKT,OAAO,CAAC,eAAe;IAAU,OAAO,CAAC,WAAW;IAJhE,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,UAAU,CAA6B;gBAE3B,eAAe,EAAE,MAAM,EAAU,WAAW,EAAE,MAAM;IAIlE,IAAI;IAKV,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC;IAqBrB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAsC9C,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG;CAQ1D"}
|
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.39.2-
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.39.2-spotter-agent */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { useRef } from 'react';
|
|
4
|
+
import React__default, { useRef, useCallback } from 'react';
|
|
5
5
|
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
m.forEach(function (e) {
|
|
@@ -6885,6 +6885,7 @@ const ERROR_MESSAGE = {
|
|
|
6885
6885
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6886
6886
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6887
6887
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
6888
|
+
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
6888
6889
|
};
|
|
6889
6890
|
|
|
6890
6891
|
const EndPoints = {
|
|
@@ -7775,7 +7776,7 @@ class AnswerService {
|
|
|
7775
7776
|
async getTML() {
|
|
7776
7777
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7777
7778
|
const edoc = object[0].edoc;
|
|
7778
|
-
const YAML = await import('./index-
|
|
7779
|
+
const YAML = await import('./index-2QHwuA-G.js');
|
|
7779
7780
|
const parsedDoc = YAML.parse(edoc);
|
|
7780
7781
|
return {
|
|
7781
7782
|
answer: {
|
|
@@ -15509,7 +15510,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15509
15510
|
return e;
|
|
15510
15511
|
}
|
|
15511
15512
|
|
|
15512
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-
|
|
15513
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-spotter-agent";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15513
15514
|
|
|
15514
15515
|
/**
|
|
15515
15516
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -18289,6 +18290,8 @@ class Conversation {
|
|
|
18289
18290
|
});
|
|
18290
18291
|
const data = responses[0].data;
|
|
18291
18292
|
return {
|
|
18293
|
+
convId: this.conversationId,
|
|
18294
|
+
messageId: responses[0].msgId,
|
|
18292
18295
|
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18293
18296
|
error: null,
|
|
18294
18297
|
};
|
|
@@ -18307,7 +18310,7 @@ class Conversation {
|
|
|
18307
18310
|
}
|
|
18308
18311
|
}
|
|
18309
18312
|
|
|
18310
|
-
class ConversationMessage extends TsEmbed {
|
|
18313
|
+
let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
18311
18314
|
constructor(container, viewConfig) {
|
|
18312
18315
|
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18313
18316
|
super(container, viewConfig);
|
|
@@ -18339,7 +18342,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18339
18342
|
await this.renderIFrame(src);
|
|
18340
18343
|
return this;
|
|
18341
18344
|
}
|
|
18342
|
-
}
|
|
18345
|
+
};
|
|
18343
18346
|
/**
|
|
18344
18347
|
* Create a conversation embed, which can be integrated inside
|
|
18345
18348
|
* chatbots or other conversational interfaces.
|
|
@@ -18359,7 +18362,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18359
18362
|
* @group Embed components
|
|
18360
18363
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18361
18364
|
*/
|
|
18362
|
-
|
|
18365
|
+
class SpotterAgentEmbed {
|
|
18363
18366
|
constructor(viewConfig) {
|
|
18364
18367
|
this.viewConfig = viewConfig;
|
|
18365
18368
|
const embedConfig = getEmbedConfig();
|
|
@@ -18371,10 +18374,7 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
|
18371
18374
|
return { error };
|
|
18372
18375
|
}
|
|
18373
18376
|
const container = document.createElement('div');
|
|
18374
|
-
|
|
18375
|
-
container.className = this.viewConfig.containerClassName;
|
|
18376
|
-
}
|
|
18377
|
-
const embed = new ConversationMessage(container, {
|
|
18377
|
+
const embed = new ConversationMessage$1(container, {
|
|
18378
18378
|
...this.viewConfig,
|
|
18379
18379
|
sessionId: data.sessionId,
|
|
18380
18380
|
genNo: data.genNo,
|
|
@@ -18384,7 +18384,29 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
|
18384
18384
|
await embed.render();
|
|
18385
18385
|
return { container, viz: embed };
|
|
18386
18386
|
}
|
|
18387
|
-
|
|
18387
|
+
/**
|
|
18388
|
+
* Send a message to the conversation service and return only the data.
|
|
18389
|
+
* @param userMessage - The message to send to the conversation service.
|
|
18390
|
+
* @returns The data from the conversation service.
|
|
18391
|
+
*/
|
|
18392
|
+
async sendMessageData(userMessage) {
|
|
18393
|
+
try {
|
|
18394
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18395
|
+
if (error) {
|
|
18396
|
+
return { error };
|
|
18397
|
+
}
|
|
18398
|
+
return { data: {
|
|
18399
|
+
sessionId: data.sessionId,
|
|
18400
|
+
genNo: data.genNo,
|
|
18401
|
+
acSessionId: data.stateKey.transactionId,
|
|
18402
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18403
|
+
} };
|
|
18404
|
+
}
|
|
18405
|
+
catch (error) {
|
|
18406
|
+
return { error: error };
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18409
|
+
}
|
|
18388
18410
|
|
|
18389
18411
|
/**
|
|
18390
18412
|
*
|
|
@@ -18451,7 +18473,7 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18451
18473
|
this.viewConfig = viewConfig;
|
|
18452
18474
|
}
|
|
18453
18475
|
getIframeSrc() {
|
|
18454
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions,
|
|
18476
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18455
18477
|
const path = 'insights/conv-assist';
|
|
18456
18478
|
if (!worksheetId) {
|
|
18457
18479
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
@@ -18478,14 +18500,6 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18478
18500
|
if (queryParamsString) {
|
|
18479
18501
|
query = `?${queryParamsString}`;
|
|
18480
18502
|
}
|
|
18481
|
-
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
18482
|
-
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
18483
|
-
query += `&${filterQuery}`;
|
|
18484
|
-
}
|
|
18485
|
-
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
18486
|
-
if (parameterQuery && !excludeRuntimeParametersfromURL) {
|
|
18487
|
-
query += `&${parameterQuery}`;
|
|
18488
|
-
}
|
|
18489
18503
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18490
18504
|
worksheet: worksheetId,
|
|
18491
18505
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|
|
@@ -18767,55 +18781,34 @@ const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
|
18767
18781
|
* ```
|
|
18768
18782
|
*/
|
|
18769
18783
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
18784
|
+
const ConversationMessage = componentFactory(ConversationMessage$1);
|
|
18770
18785
|
/**
|
|
18771
|
-
* React component for
|
|
18772
|
-
*
|
|
18786
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
18787
|
+
*
|
|
18788
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
18789
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
18790
|
+
*
|
|
18773
18791
|
* @example
|
|
18774
18792
|
* ```tsx
|
|
18775
|
-
*
|
|
18776
|
-
*
|
|
18793
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
18794
|
+
* const result = await sendMessage('show me sales by region');
|
|
18777
18795
|
*
|
|
18778
|
-
*
|
|
18779
|
-
*
|
|
18780
|
-
*
|
|
18781
|
-
* document.body.appendChild(container);
|
|
18782
|
-
* }
|
|
18783
|
-
* };
|
|
18796
|
+
* if (!result.error) {
|
|
18797
|
+
* // Simple usage - just pass the message data
|
|
18798
|
+
* <SpotterMessage message={result.message} />
|
|
18784
18799
|
*
|
|
18785
|
-
*
|
|
18786
|
-
*
|
|
18787
|
-
*
|
|
18788
|
-
*
|
|
18789
|
-
*
|
|
18790
|
-
* );
|
|
18800
|
+
* // With optional query for context
|
|
18801
|
+
* <SpotterMessage
|
|
18802
|
+
* message={result.message}
|
|
18803
|
+
* query={result.query}
|
|
18804
|
+
* />
|
|
18791
18805
|
* }
|
|
18792
18806
|
* ```
|
|
18807
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
18793
18808
|
*/
|
|
18794
|
-
const
|
|
18795
|
-
const {
|
|
18796
|
-
|
|
18797
|
-
useDeepCompareEffect(() => {
|
|
18798
|
-
if (serviceRef.current) {
|
|
18799
|
-
serviceRef.current = null;
|
|
18800
|
-
}
|
|
18801
|
-
const configProps = {
|
|
18802
|
-
...restProps,
|
|
18803
|
-
...(className ? { containerClassName: className } : {})
|
|
18804
|
-
};
|
|
18805
|
-
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18806
|
-
if (ref) {
|
|
18807
|
-
if (typeof ref === 'function') {
|
|
18808
|
-
ref(serviceRef.current);
|
|
18809
|
-
}
|
|
18810
|
-
else {
|
|
18811
|
-
ref.current = serviceRef.current;
|
|
18812
|
-
}
|
|
18813
|
-
}
|
|
18814
|
-
return () => {
|
|
18815
|
-
serviceRef.current = null;
|
|
18816
|
-
};
|
|
18817
|
-
}, [props]);
|
|
18818
|
-
return null;
|
|
18809
|
+
const SpotterMessage = React__default.forwardRef((props, ref) => {
|
|
18810
|
+
const { message, query: _, ...otherProps } = props;
|
|
18811
|
+
return (React__default.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
18819
18812
|
});
|
|
18820
18813
|
/**
|
|
18821
18814
|
* React component for PreRendered Conversation embed.
|
|
@@ -18875,6 +18868,62 @@ function useInit(config) {
|
|
|
18875
18868
|
ref.current = authEE;
|
|
18876
18869
|
}, [config]);
|
|
18877
18870
|
return ref;
|
|
18871
|
+
}
|
|
18872
|
+
/**
|
|
18873
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
18874
|
+
*
|
|
18875
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
18876
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
18877
|
+
*
|
|
18878
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
18879
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
18880
|
+
* @example
|
|
18881
|
+
* ```tsx
|
|
18882
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
18883
|
+
*
|
|
18884
|
+
* const handleQuery = async () => {
|
|
18885
|
+
* const result = await sendMessage('show me sales by region');
|
|
18886
|
+
*
|
|
18887
|
+
* if (!result.error) {
|
|
18888
|
+
* // Display the message response
|
|
18889
|
+
* <SpotterMessage message={result.message} />
|
|
18890
|
+
* } else {
|
|
18891
|
+
* console.error('Error:', result.error);
|
|
18892
|
+
* }
|
|
18893
|
+
* };
|
|
18894
|
+
* ```
|
|
18895
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
18896
|
+
*/
|
|
18897
|
+
function useSpotterAgent(config) {
|
|
18898
|
+
const serviceRef = useRef(null);
|
|
18899
|
+
useDeepCompareEffect(() => {
|
|
18900
|
+
if (serviceRef.current) {
|
|
18901
|
+
serviceRef.current = null;
|
|
18902
|
+
}
|
|
18903
|
+
serviceRef.current = new SpotterAgentEmbed(config);
|
|
18904
|
+
return () => {
|
|
18905
|
+
serviceRef.current = null;
|
|
18906
|
+
};
|
|
18907
|
+
}, [config]);
|
|
18908
|
+
const sendMessage = useCallback(async (query) => {
|
|
18909
|
+
if (!serviceRef.current) {
|
|
18910
|
+
return { error: new Error(ERROR_MESSAGE.SPOTTER_AGENT_NOT_INITIALIZED) };
|
|
18911
|
+
}
|
|
18912
|
+
const result = await serviceRef.current.sendMessageData(query);
|
|
18913
|
+
if (result.error) {
|
|
18914
|
+
return { error: result.error };
|
|
18915
|
+
}
|
|
18916
|
+
return {
|
|
18917
|
+
query: query,
|
|
18918
|
+
message: {
|
|
18919
|
+
...result.data,
|
|
18920
|
+
worksheetId: config.worksheetId,
|
|
18921
|
+
},
|
|
18922
|
+
};
|
|
18923
|
+
}, [config.worksheetId]);
|
|
18924
|
+
return {
|
|
18925
|
+
sendMessage,
|
|
18926
|
+
};
|
|
18878
18927
|
}
|
|
18879
18928
|
|
|
18880
|
-
export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed,
|
|
18929
|
+
export { Action, AppEmbed, ConversationEmbed, ConversationMessage, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, SpotterMessage, getSessionInfo, useEmbedRef, useInit, useSpotterAgent };
|