@thoughtspot/visual-embed-sdk 1.45.1 → 1.45.3
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/authToken.d.ts +1 -1
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +2 -2
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +71 -0
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +48 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +37 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +37 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +24 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +127 -9
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +41 -18
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +96 -3
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +40 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +40 -12
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +180 -8
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +23 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +64 -22
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +138 -19
- package/cjs/src/embed/ts-embed.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/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/types.d.ts +356 -42
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +227 -20
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js +23 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +9 -1
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +73 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +3 -2
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +4 -2
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils.d.ts +20 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +40 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +49 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-Dgzjq7qH.js → index-BuwECGdm.js} +1 -1
- package/dist/src/authToken.d.ts +1 -1
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +48 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +37 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +127 -9
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +40 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +23 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.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/types.d.ts +356 -42
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +3 -2
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils.d.ts +20 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +501 -98
- package/dist/tsembed-react.js +500 -97
- package/dist/tsembed.es.js +516 -113
- package/dist/tsembed.js +29956 -29553
- package/dist/visual-embed-sdk-react-full.d.ts +819 -282
- package/dist/visual-embed-sdk-react.d.ts +818 -281
- package/dist/visual-embed-sdk.d.ts +882 -321
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts +1 -1
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +2 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +72 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +48 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +37 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +39 -3
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +127 -9
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +42 -19
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +96 -3
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +40 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +41 -13
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +180 -8
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +23 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +64 -22
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +139 -20
- package/lib/src/embed/ts-embed.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/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +356 -42
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +226 -19
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.js +22 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +9 -1
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +73 -0
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +3 -2
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +4 -2
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils.d.ts +20 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +36 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +50 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/authToken.spec.ts +91 -2
- package/src/authToken.ts +2 -2
- package/src/css-variables.ts +60 -0
- package/src/embed/app.spec.ts +32 -0
- package/src/embed/app.ts +97 -1
- package/src/embed/conversation.spec.ts +117 -3
- package/src/embed/conversation.ts +188 -29
- package/src/embed/hostEventClient/contracts.ts +4 -4
- package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
- package/src/embed/hostEventClient/host-event-client.ts +22 -11
- package/src/embed/liveboard.spec.ts +264 -10
- package/src/embed/liveboard.ts +105 -14
- package/src/embed/ts-embed.spec.ts +184 -8
- package/src/embed/ts-embed.ts +81 -24
- package/src/errors.ts +1 -0
- package/src/index.ts +7 -1
- package/src/types.ts +364 -40
- package/src/utils/graphql/answerService/answer-queries.ts +23 -0
- package/src/utils/graphql/answerService/answerService.spec.ts +87 -0
- package/src/utils/graphql/answerService/answerService.ts +13 -1
- package/src/utils/processTrigger.ts +6 -3
- package/src/utils.spec.ts +56 -0
- package/src/utils.ts +44 -0
package/src/types.ts
CHANGED
|
@@ -1120,6 +1120,47 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1120
1120
|
* ```
|
|
1121
1121
|
*/
|
|
1122
1122
|
customActions?: CustomAction[];
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Refresh the auth token when the token is near expiry.
|
|
1127
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
1128
|
+
* @example
|
|
1129
|
+
* ```js
|
|
1130
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1131
|
+
* ... // other embed view config
|
|
1132
|
+
* refreshAuthTokenOnNearExpiry: true,
|
|
1133
|
+
* })
|
|
1134
|
+
* ```
|
|
1135
|
+
*/
|
|
1136
|
+
refreshAuthTokenOnNearExpiry?: boolean;
|
|
1137
|
+
/**
|
|
1138
|
+
* This flag skips payload validation so events can be processed even if the payload is old, incomplete, or from a trusted system.
|
|
1139
|
+
* @default false
|
|
1140
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
1141
|
+
* @example
|
|
1142
|
+
* ```js
|
|
1143
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1144
|
+
* ... // other embed view config
|
|
1145
|
+
* shouldBypassPayloadValidation:true,
|
|
1146
|
+
* })
|
|
1147
|
+
* ```
|
|
1148
|
+
*/
|
|
1149
|
+
shouldBypassPayloadValidation?: boolean;
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* Flag to use host events v2. This is used to enable the new host events v2 API.
|
|
1153
|
+
* @default false
|
|
1154
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
1155
|
+
* @example
|
|
1156
|
+
* ```js
|
|
1157
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
1158
|
+
* ... // other embed view config
|
|
1159
|
+
* useHostEventsV2:true,
|
|
1160
|
+
* })
|
|
1161
|
+
* ```
|
|
1162
|
+
*/
|
|
1163
|
+
useHostEventsV2?: boolean;
|
|
1123
1164
|
}
|
|
1124
1165
|
|
|
1125
1166
|
/**
|
|
@@ -1558,7 +1599,7 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
1558
1599
|
* To enable this feature on your instance, contact ThoughtSpot Support.
|
|
1559
1600
|
*
|
|
1560
1601
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
1561
|
-
* @version SDK: 1.
|
|
1602
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
1562
1603
|
* @example
|
|
1563
1604
|
* ```js
|
|
1564
1605
|
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
@@ -3162,6 +3203,55 @@ export enum EmbedEvent {
|
|
|
3162
3203
|
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
3163
3204
|
*/
|
|
3164
3205
|
ApiIntercept = 'ApiIntercept',
|
|
3206
|
+
/**
|
|
3207
|
+
* Emitted when a Spotter conversation is renamed.
|
|
3208
|
+
* @example
|
|
3209
|
+
* ```js
|
|
3210
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationRenamed, (payload) => {
|
|
3211
|
+
* console.log('Conversation renamed', payload);
|
|
3212
|
+
* // payload: { convId: string, oldTitle: string, newTitle: string }
|
|
3213
|
+
* })
|
|
3214
|
+
* ```
|
|
3215
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3216
|
+
*/
|
|
3217
|
+
SpotterConversationRenamed = 'spotterConversationRenamed',
|
|
3218
|
+
/**
|
|
3219
|
+
* Emitted when a Spotter conversation is deleted.
|
|
3220
|
+
* @example
|
|
3221
|
+
* ```js
|
|
3222
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationDeleted, (payload) => {
|
|
3223
|
+
* console.log('Conversation deleted', payload);
|
|
3224
|
+
* // payload: { convId: string, title: string }
|
|
3225
|
+
* })
|
|
3226
|
+
* ```
|
|
3227
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3228
|
+
*/
|
|
3229
|
+
SpotterConversationDeleted = 'spotterConversationDeleted',
|
|
3230
|
+
/**
|
|
3231
|
+
* Emitted when a Spotter conversation is selected/clicked.
|
|
3232
|
+
* @example
|
|
3233
|
+
* ```js
|
|
3234
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationSelected, (payload) => {
|
|
3235
|
+
* console.log('Conversation selected', payload);
|
|
3236
|
+
* // payload: { convId: string, title: string, worksheetId: string }
|
|
3237
|
+
* })
|
|
3238
|
+
* ```
|
|
3239
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3240
|
+
*/
|
|
3241
|
+
SpotterConversationSelected = 'spotterConversationSelected',
|
|
3242
|
+
|
|
3243
|
+
/**
|
|
3244
|
+
* @hidden
|
|
3245
|
+
* Emitted when the auth token is about to get expired and needs to be refreshed.
|
|
3246
|
+
* @example
|
|
3247
|
+
* ```js
|
|
3248
|
+
* embed.on(EmbedEvent.RefreshAuthToken, (payload) => {
|
|
3249
|
+
* console.log('payload', payload);
|
|
3250
|
+
* })
|
|
3251
|
+
* ```
|
|
3252
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
3253
|
+
*/
|
|
3254
|
+
RefreshAuthToken = 'RefreshAuthToken',
|
|
3165
3255
|
}
|
|
3166
3256
|
|
|
3167
3257
|
/**
|
|
@@ -4547,6 +4637,18 @@ export enum HostEvent {
|
|
|
4547
4637
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
4548
4638
|
*/
|
|
4549
4639
|
StartNewSpotterConversation = 'StartNewSpotterConversation',
|
|
4640
|
+
|
|
4641
|
+
/**
|
|
4642
|
+
* @hidden
|
|
4643
|
+
* Get the current context of the embedded page.
|
|
4644
|
+
*
|
|
4645
|
+
* @example
|
|
4646
|
+
* ```js
|
|
4647
|
+
* const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
4648
|
+
* ```
|
|
4649
|
+
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
4650
|
+
*/
|
|
4651
|
+
GetPageContext = 'GetPageContext',
|
|
4550
4652
|
}
|
|
4551
4653
|
|
|
4552
4654
|
/**
|
|
@@ -4705,7 +4807,19 @@ export enum Param {
|
|
|
4705
4807
|
isLinkParametersEnabled = 'isLinkParametersEnabled',
|
|
4706
4808
|
EnablePastConversationsSidebar = 'enablePastConversationsSidebar',
|
|
4707
4809
|
UpdatedSpotterChatPrompt = 'updatedSpotterChatPrompt',
|
|
4810
|
+
SpotterSidebarTitle = 'spotterSidebarTitle',
|
|
4811
|
+
SpotterSidebarDefaultExpanded = 'spotterSidebarDefaultExpanded',
|
|
4812
|
+
SpotterChatRenameLabel = 'spotterChatRenameLabel',
|
|
4813
|
+
SpotterChatDeleteLabel = 'spotterChatDeleteLabel',
|
|
4814
|
+
SpotterDeleteConversationModalTitle = 'spotterDeleteConversationModalTitle',
|
|
4815
|
+
SpotterPastConversationAlertMessage = 'spotterPastConversationAlertMessage',
|
|
4816
|
+
SpotterDocumentationUrl = 'spotterDocumentationUrl',
|
|
4817
|
+
SpotterBestPracticesLabel = 'spotterBestPracticesLabel',
|
|
4818
|
+
SpotterConversationsBatchSize = 'spotterConversationsBatchSize',
|
|
4819
|
+
SpotterNewChatButtonTitle = 'spotterNewChatButtonTitle',
|
|
4708
4820
|
IsThisPeriodInDateFiltersEnabled = 'isThisPeriodInDateFiltersEnabled',
|
|
4821
|
+
HideToolResponseCardBranding = 'hideToolResponseCardBranding',
|
|
4822
|
+
ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel',
|
|
4709
4823
|
}
|
|
4710
4824
|
|
|
4711
4825
|
/**
|
|
@@ -6150,6 +6264,96 @@ export enum Action {
|
|
|
6150
6264
|
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
6151
6265
|
*/
|
|
6152
6266
|
UngroupLiveboardGroup = 'ungroupLiveboardGroup',
|
|
6267
|
+
/**
|
|
6268
|
+
* Controls visibility of the sidebar header (title and toggle button)
|
|
6269
|
+
* in the Spotter past conversations sidebar.
|
|
6270
|
+
* @example
|
|
6271
|
+
* ```js
|
|
6272
|
+
* hiddenActions: [Action.SpotterSidebarHeader]
|
|
6273
|
+
* ```
|
|
6274
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6275
|
+
*/
|
|
6276
|
+
SpotterSidebarHeader = 'spotterSidebarHeader',
|
|
6277
|
+
/**
|
|
6278
|
+
* Controls visibility of the sidebar footer (documentation link)
|
|
6279
|
+
* in the Spotter past conversations sidebar.
|
|
6280
|
+
* @example
|
|
6281
|
+
* ```js
|
|
6282
|
+
* hiddenActions: [Action.SpotterSidebarFooter]
|
|
6283
|
+
* ```
|
|
6284
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6285
|
+
*/
|
|
6286
|
+
SpotterSidebarFooter = 'spotterSidebarFooter',
|
|
6287
|
+
/**
|
|
6288
|
+
* Controls visibility and disable state of the sidebar toggle/expand button
|
|
6289
|
+
* in the Spotter past conversations sidebar.
|
|
6290
|
+
* @example
|
|
6291
|
+
* ```js
|
|
6292
|
+
* disabledActions: [Action.SpotterSidebarToggle]
|
|
6293
|
+
* ```
|
|
6294
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6295
|
+
*/
|
|
6296
|
+
SpotterSidebarToggle = 'spotterSidebarToggle',
|
|
6297
|
+
/**
|
|
6298
|
+
* Controls visibility and disable state of the "New Chat" button
|
|
6299
|
+
* in the Spotter past conversations sidebar.
|
|
6300
|
+
* @example
|
|
6301
|
+
* ```js
|
|
6302
|
+
* disabledActions: [Action.SpotterNewChat]
|
|
6303
|
+
* ```
|
|
6304
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6305
|
+
*/
|
|
6306
|
+
SpotterNewChat = 'spotterNewChat',
|
|
6307
|
+
/**
|
|
6308
|
+
* Controls visibility of the past conversation banner alert
|
|
6309
|
+
* in the Spotter interface.
|
|
6310
|
+
* @example
|
|
6311
|
+
* ```js
|
|
6312
|
+
* hiddenActions: [Action.SpotterPastChatBanner]
|
|
6313
|
+
* ```
|
|
6314
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6315
|
+
*/
|
|
6316
|
+
SpotterPastChatBanner = 'spotterPastChatBanner',
|
|
6317
|
+
/**
|
|
6318
|
+
* Controls visibility and disable state of the conversation edit menu
|
|
6319
|
+
* (three-dot menu) in the Spotter past conversations sidebar.
|
|
6320
|
+
* @example
|
|
6321
|
+
* ```js
|
|
6322
|
+
* disabledActions: [Action.SpotterChatMenu]
|
|
6323
|
+
* ```
|
|
6324
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6325
|
+
*/
|
|
6326
|
+
SpotterChatMenu = 'spotterChatMenu',
|
|
6327
|
+
/**
|
|
6328
|
+
* Controls visibility and disable state of the rename action
|
|
6329
|
+
* in the Spotter conversation edit menu.
|
|
6330
|
+
* @example
|
|
6331
|
+
* ```js
|
|
6332
|
+
* disabledActions: [Action.SpotterChatRename]
|
|
6333
|
+
* ```
|
|
6334
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6335
|
+
*/
|
|
6336
|
+
SpotterChatRename = 'spotterChatRename',
|
|
6337
|
+
/**
|
|
6338
|
+
* Controls visibility and disable state of the delete action
|
|
6339
|
+
* in the Spotter conversation edit menu.
|
|
6340
|
+
* @example
|
|
6341
|
+
* ```js
|
|
6342
|
+
* disabledActions: [Action.SpotterChatDelete]
|
|
6343
|
+
* ```
|
|
6344
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6345
|
+
*/
|
|
6346
|
+
SpotterChatDelete = 'spotterChatDelete',
|
|
6347
|
+
/**
|
|
6348
|
+
* Controls visibility and disable state of the documentation/best practices
|
|
6349
|
+
* link in the Spotter sidebar footer.
|
|
6350
|
+
* @example
|
|
6351
|
+
* ```js
|
|
6352
|
+
* disabledActions: [Action.SpotterDocs]
|
|
6353
|
+
* ```
|
|
6354
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6355
|
+
*/
|
|
6356
|
+
SpotterDocs = 'spotterDocs',
|
|
6153
6357
|
/**
|
|
6154
6358
|
* The **Include current period** checkbox for date filters.
|
|
6155
6359
|
* Controls the visibility and availability of the option to include
|
|
@@ -6360,13 +6564,30 @@ export enum LogLevel {
|
|
|
6360
6564
|
* Error types emitted by embedded components.
|
|
6361
6565
|
*
|
|
6362
6566
|
* These enum values categorize different types of errors that can occur during
|
|
6363
|
-
* the lifecycle of an embedded ThoughtSpot component.
|
|
6364
|
-
*
|
|
6365
|
-
*
|
|
6366
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
6367
|
-
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
6567
|
+
* the lifecycle of an embedded ThoughtSpot component.
|
|
6568
|
+
* Use {@link EmbedErrorDetailsEvent} and {@link EmbedErrorCodes} to handle specific errors.
|
|
6368
6569
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
6369
6570
|
* @group Error Handling
|
|
6571
|
+
*
|
|
6572
|
+
* @example
|
|
6573
|
+
* Handle specific error types
|
|
6574
|
+
* ```js
|
|
6575
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
6576
|
+
* switch (error.errorType) {
|
|
6577
|
+
* case ErrorDetailsTypes.API:
|
|
6578
|
+
* console.error('API error:', error.message);
|
|
6579
|
+
* break;
|
|
6580
|
+
* case ErrorDetailsTypes.VALIDATION_ERROR:
|
|
6581
|
+
* console.error('Validation error:', error.message);
|
|
6582
|
+
* break;
|
|
6583
|
+
* case ErrorDetailsTypes.NETWORK:
|
|
6584
|
+
* console.error('Network error:', error.message);
|
|
6585
|
+
* break;
|
|
6586
|
+
* default:
|
|
6587
|
+
* console.error('Unknown error:', error);
|
|
6588
|
+
* }
|
|
6589
|
+
* });
|
|
6590
|
+
* ```
|
|
6370
6591
|
*/
|
|
6371
6592
|
export enum ErrorDetailsTypes {
|
|
6372
6593
|
/** API call failure */
|
|
@@ -6378,26 +6599,34 @@ export enum ErrorDetailsTypes {
|
|
|
6378
6599
|
}
|
|
6379
6600
|
|
|
6380
6601
|
/**
|
|
6381
|
-
* Error codes for identifying specific issues in embedded ThoughtSpot components.
|
|
6382
|
-
*
|
|
6383
|
-
* Use these codes for precise error handling and debugging. Each code maps to a
|
|
6384
|
-
* distinct failure scenario, enabling targeted recovery strategies.
|
|
6602
|
+
* Error codes for identifying specific issues in embedded ThoughtSpot components. Use {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error handling and debugging.
|
|
6385
6603
|
*
|
|
6386
6604
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
6387
6605
|
* @group Error Handling
|
|
6388
|
-
|
|
6389
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
6390
|
-
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
6391
|
-
*
|
|
6606
|
+
|
|
6392
6607
|
* @example
|
|
6393
6608
|
* Handle specific error codes in the error event handler
|
|
6394
|
-
*
|
|
6609
|
+
* ```js
|
|
6395
6610
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
6396
|
-
*
|
|
6397
|
-
*
|
|
6611
|
+
* switch (error.code) {
|
|
6612
|
+
* case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
|
|
6613
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
6614
|
+
* break;
|
|
6615
|
+
* case EmbedErrorCodes.LIVEBOARD_ID_MISSING:
|
|
6616
|
+
* console.error('Liveboard ID is missing:', error.message);
|
|
6617
|
+
* break;
|
|
6618
|
+
* case EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG:
|
|
6619
|
+
* console.error('Conflicting actions configuration:', error.message);
|
|
6620
|
+
* break;
|
|
6621
|
+
* case EmbedErrorCodes.CONFLICTING_TABS_CONFIG:
|
|
6622
|
+
* console.error('Conflicting tabs configuration:', error.message);
|
|
6623
|
+
* break;
|
|
6624
|
+
* default:
|
|
6625
|
+
* console.error('Unknown error:', error);
|
|
6398
6626
|
* }
|
|
6399
6627
|
* });
|
|
6400
|
-
*
|
|
6628
|
+
* ```
|
|
6629
|
+
* */
|
|
6401
6630
|
export enum EmbedErrorCodes {
|
|
6402
6631
|
/** Worksheet ID not found or does not exist */
|
|
6403
6632
|
WORKSHEET_ID_NOT_FOUND = 'WORKSHEET_ID_NOT_FOUND',
|
|
@@ -6405,10 +6634,10 @@ export enum EmbedErrorCodes {
|
|
|
6405
6634
|
/** Required Liveboard ID is missing from configuration */
|
|
6406
6635
|
LIVEBOARD_ID_MISSING = 'LIVEBOARD_ID_MISSING',
|
|
6407
6636
|
|
|
6408
|
-
/** Conflicting action configuration detected
|
|
6637
|
+
/** Conflicting action configuration detected */
|
|
6409
6638
|
CONFLICTING_ACTIONS_CONFIG = 'CONFLICTING_ACTIONS_CONFIG',
|
|
6410
6639
|
|
|
6411
|
-
/** Conflicting tab configuration detected
|
|
6640
|
+
/** Conflicting tab configuration detected */
|
|
6412
6641
|
CONFLICTING_TABS_CONFIG = 'CONFLICTING_TABS_CONFIG',
|
|
6413
6642
|
|
|
6414
6643
|
/** Error during component initialization */
|
|
@@ -6434,6 +6663,9 @@ export enum EmbedErrorCodes {
|
|
|
6434
6663
|
|
|
6435
6664
|
/** Failed to update embed parameters during pre-render */
|
|
6436
6665
|
UPDATE_PARAMS_FAILED = 'UPDATE_PARAMS_FAILED',
|
|
6666
|
+
|
|
6667
|
+
/** Invalid URL provided in configuration */
|
|
6668
|
+
INVALID_URL = 'INVALID_URL',
|
|
6437
6669
|
}
|
|
6438
6670
|
|
|
6439
6671
|
/**
|
|
@@ -6447,7 +6679,7 @@ export enum EmbedErrorCodes {
|
|
|
6447
6679
|
*
|
|
6448
6680
|
* - **errorType**: One of the predefined {@link ErrorDetailsTypes} values
|
|
6449
6681
|
* - **message**: Human-readable error description (string or array of strings for multiple errors)
|
|
6450
|
-
* - **code**: Machine-readable error identifier
|
|
6682
|
+
* - **code**: Machine-readable error identifier {@link EmbedErrorCodes} values
|
|
6451
6683
|
* - **[key: string]**: Additional context-specific for backward compatibility
|
|
6452
6684
|
*
|
|
6453
6685
|
* ## Usage
|
|
@@ -6457,12 +6689,11 @@ export enum EmbedErrorCodes {
|
|
|
6457
6689
|
*
|
|
6458
6690
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
6459
6691
|
* @group Error Handling
|
|
6460
|
-
* @see {@link ErrorDetailsTypes} - Available error type values
|
|
6461
|
-
* @see {@link EmbedEvent.Error} - The event that emits this object
|
|
6462
6692
|
*
|
|
6463
6693
|
* @example
|
|
6464
6694
|
* Handle specific error types
|
|
6465
|
-
*
|
|
6695
|
+
*
|
|
6696
|
+
* ```js
|
|
6466
6697
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
6467
6698
|
* switch (error.code) {
|
|
6468
6699
|
* case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
|
|
@@ -6472,30 +6703,18 @@ export enum EmbedErrorCodes {
|
|
|
6472
6703
|
* console.error('Unknown error:', error);
|
|
6473
6704
|
* }
|
|
6474
6705
|
* });
|
|
6475
|
-
*
|
|
6706
|
+
* ```
|
|
6476
6707
|
* @example
|
|
6477
6708
|
* Handle multiple error messages
|
|
6478
|
-
*
|
|
6709
|
+
*
|
|
6710
|
+
* ```js
|
|
6479
6711
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
6480
6712
|
* const messages = Array.isArray(error.message)
|
|
6481
6713
|
* ? error.message
|
|
6482
6714
|
* : [error.message];
|
|
6483
|
-
*
|
|
6484
6715
|
* messages.forEach(msg => console.error(msg));
|
|
6485
6716
|
* });
|
|
6486
|
-
*
|
|
6487
|
-
* @example
|
|
6488
|
-
* Access additional error context
|
|
6489
|
-
*
|
|
6490
|
-
* embed.on(EmbedEvent.Error, (error) => {
|
|
6491
|
-
* console.error('Error Details:', {
|
|
6492
|
-
* type: error.errorType,
|
|
6493
|
-
* message: error.message,
|
|
6494
|
-
* code: error.code,
|
|
6495
|
-
* // Additional context fields vary by error type
|
|
6496
|
-
* ...error
|
|
6497
|
-
* });
|
|
6498
|
-
* });
|
|
6717
|
+
* ```
|
|
6499
6718
|
* */
|
|
6500
6719
|
export interface EmbedErrorDetailsEvent {
|
|
6501
6720
|
/** The type of error that occurred */
|
|
@@ -6507,6 +6726,26 @@ export interface EmbedErrorDetailsEvent {
|
|
|
6507
6726
|
/** Additional context-specific for backward compatibility */
|
|
6508
6727
|
[key: string]: any;
|
|
6509
6728
|
}
|
|
6729
|
+
|
|
6730
|
+
export enum ContextType {
|
|
6731
|
+
/**
|
|
6732
|
+
* Search answer context for search page or edit viz dialog on liveboard page.
|
|
6733
|
+
*/
|
|
6734
|
+
Search = 'search-answer',
|
|
6735
|
+
/**
|
|
6736
|
+
* Liveboard context for liveboard page.
|
|
6737
|
+
*/
|
|
6738
|
+
Liveboard = 'liveboard',
|
|
6739
|
+
/**
|
|
6740
|
+
* Answer context for explore modal/page on liveboard page.
|
|
6741
|
+
*/
|
|
6742
|
+
Answer = 'answer',
|
|
6743
|
+
/**
|
|
6744
|
+
* Spotter context for spotter modal/page.
|
|
6745
|
+
*/
|
|
6746
|
+
Spotter = 'spotter',
|
|
6747
|
+
}
|
|
6748
|
+
|
|
6510
6749
|
export interface DefaultAppInitData {
|
|
6511
6750
|
customisations: CustomisationsInterface;
|
|
6512
6751
|
authToken: string;
|
|
@@ -6584,3 +6823,88 @@ export type ApiInterceptFlags = {
|
|
|
6584
6823
|
*/
|
|
6585
6824
|
interceptTimeout?: number;
|
|
6586
6825
|
};
|
|
6826
|
+
|
|
6827
|
+
/**
|
|
6828
|
+
* Object IDs for the embedded component.
|
|
6829
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
6830
|
+
*/
|
|
6831
|
+
export interface ObjectIds {
|
|
6832
|
+
/**
|
|
6833
|
+
* Liveboard ID.
|
|
6834
|
+
*/
|
|
6835
|
+
liveboardId?: string;
|
|
6836
|
+
/**
|
|
6837
|
+
* Answer ID.
|
|
6838
|
+
*/
|
|
6839
|
+
answerId?: string;
|
|
6840
|
+
/**
|
|
6841
|
+
* Viz IDs.
|
|
6842
|
+
*/
|
|
6843
|
+
vizIds?: string[];
|
|
6844
|
+
/**
|
|
6845
|
+
* Data model IDs.
|
|
6846
|
+
*/
|
|
6847
|
+
dataModelIds?: string[];
|
|
6848
|
+
/**
|
|
6849
|
+
* Modal title.
|
|
6850
|
+
*/
|
|
6851
|
+
modalTitle?: string;
|
|
6852
|
+
}
|
|
6853
|
+
|
|
6854
|
+
/**
|
|
6855
|
+
* Context object for the embedded component.
|
|
6856
|
+
* @example
|
|
6857
|
+
* ```js
|
|
6858
|
+
* const context = await embed.getCurrentContext();
|
|
6859
|
+
* console.log(context);
|
|
6860
|
+
* {
|
|
6861
|
+
* stack: [
|
|
6862
|
+
* {
|
|
6863
|
+
* name: 'Liveboard',
|
|
6864
|
+
* type: ContextType.Liveboard,
|
|
6865
|
+
* objectIds: {
|
|
6866
|
+
* liveboardId: '123',
|
|
6867
|
+
* },
|
|
6868
|
+
* },
|
|
6869
|
+
* ],
|
|
6870
|
+
* currentContext: {
|
|
6871
|
+
* name: 'Liveboard',
|
|
6872
|
+
* type: ContextType.Liveboard,
|
|
6873
|
+
* objectIds: {
|
|
6874
|
+
* liveboardId: '123',
|
|
6875
|
+
* },
|
|
6876
|
+
* },
|
|
6877
|
+
* }
|
|
6878
|
+
* ```
|
|
6879
|
+
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
6880
|
+
*/
|
|
6881
|
+
export interface ContextObject {
|
|
6882
|
+
/**
|
|
6883
|
+
* Stack of context objects.
|
|
6884
|
+
*/
|
|
6885
|
+
stack: Array<{
|
|
6886
|
+
/**
|
|
6887
|
+
* Name of the context object.
|
|
6888
|
+
*/
|
|
6889
|
+
name: string;
|
|
6890
|
+
/**
|
|
6891
|
+
* Type of the context object.
|
|
6892
|
+
*/
|
|
6893
|
+
type: ContextType;
|
|
6894
|
+
/**
|
|
6895
|
+
* Object IDs of the context object.
|
|
6896
|
+
*/
|
|
6897
|
+
objectIds: ObjectIds;
|
|
6898
|
+
}>
|
|
6899
|
+
/**
|
|
6900
|
+
* Current context object.
|
|
6901
|
+
*/
|
|
6902
|
+
currentContext: {
|
|
6903
|
+
/**
|
|
6904
|
+
* Name of the current context object.
|
|
6905
|
+
*/
|
|
6906
|
+
name: string;
|
|
6907
|
+
type: ContextType;
|
|
6908
|
+
objectIds: ObjectIds;
|
|
6909
|
+
}
|
|
6910
|
+
}
|
|
@@ -176,6 +176,29 @@ export const getSQLQuery = `
|
|
|
176
176
|
}
|
|
177
177
|
`;
|
|
178
178
|
|
|
179
|
+
export const updateDisplayMode = `
|
|
180
|
+
mutation UpdateDisplayMode(
|
|
181
|
+
$session: BachSessionIdInput!
|
|
182
|
+
$displayMode: DisplayMode
|
|
183
|
+
) {
|
|
184
|
+
Answer__updateProperties(session: $session, displayMode: $displayMode) {
|
|
185
|
+
id {
|
|
186
|
+
sessionId
|
|
187
|
+
genNo
|
|
188
|
+
acSession {
|
|
189
|
+
sessionId
|
|
190
|
+
genNo
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
answer {
|
|
194
|
+
id
|
|
195
|
+
displayMode
|
|
196
|
+
suggestedDisplayMode
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`;
|
|
201
|
+
|
|
179
202
|
export const getAnswerTML = `
|
|
180
203
|
mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies: Boolean, $formatType: EDocFormatType, $exportPermissions: Boolean, $exportFqn: Boolean) {
|
|
181
204
|
UnsavedAnswer_getTML(
|
|
@@ -473,6 +473,93 @@ describe('Answer service tests', () => {
|
|
|
473
473
|
expect(sql).toBe('SELECT * FROM table');
|
|
474
474
|
});
|
|
475
475
|
|
|
476
|
+
test('Get SQL query with all columns should update display mode', async () => {
|
|
477
|
+
fetchMock.mockResponses(
|
|
478
|
+
JSON.stringify({
|
|
479
|
+
data: {
|
|
480
|
+
Answer__updateProperties: {
|
|
481
|
+
id: {
|
|
482
|
+
...defaultSession,
|
|
483
|
+
},
|
|
484
|
+
answer: {
|
|
485
|
+
id: 'answer1',
|
|
486
|
+
displayMode: 'TABLE_MODE',
|
|
487
|
+
suggestedDisplayMode: 'CHART_MODE',
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
}),
|
|
492
|
+
JSON.stringify({
|
|
493
|
+
data: {
|
|
494
|
+
Answer__getQuery: {
|
|
495
|
+
sql: 'SELECT * FROM table',
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
}),
|
|
499
|
+
);
|
|
500
|
+
const answerService = createAnswerService();
|
|
501
|
+
const sql = await answerService.getSQLQuery(true);
|
|
502
|
+
expect(fetchMock).toHaveBeenCalledWith(
|
|
503
|
+
'https://tshost/prism/?op=UpdateDisplayMode',
|
|
504
|
+
expect.objectContaining({
|
|
505
|
+
body: JSON.stringify({
|
|
506
|
+
operationName: 'UpdateDisplayMode',
|
|
507
|
+
query: queries.updateDisplayMode,
|
|
508
|
+
variables: {
|
|
509
|
+
session: defaultSession,
|
|
510
|
+
displayMode: 'TABLE_MODE',
|
|
511
|
+
},
|
|
512
|
+
}),
|
|
513
|
+
}),
|
|
514
|
+
);
|
|
515
|
+
expect(fetchMock).toHaveBeenCalledWith(
|
|
516
|
+
'https://tshost/prism/?op=GetSQLQuery',
|
|
517
|
+
expect.objectContaining({
|
|
518
|
+
body: JSON.stringify({
|
|
519
|
+
operationName: 'GetSQLQuery',
|
|
520
|
+
query: getSQLQuery,
|
|
521
|
+
variables: {
|
|
522
|
+
session: defaultSession,
|
|
523
|
+
},
|
|
524
|
+
}),
|
|
525
|
+
}),
|
|
526
|
+
);
|
|
527
|
+
expect(sql).toBe('SELECT * FROM table');
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
test('Update display mode should call the right API', async () => {
|
|
531
|
+
fetchMock.mockResponseOnce(JSON.stringify({
|
|
532
|
+
data: {
|
|
533
|
+
Answer__updateProperties: {
|
|
534
|
+
id: {
|
|
535
|
+
...defaultSession,
|
|
536
|
+
},
|
|
537
|
+
answer: {
|
|
538
|
+
id: 'answer1',
|
|
539
|
+
displayMode: 'CHART_MODE',
|
|
540
|
+
suggestedDisplayMode: 'TABLE_MODE',
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
}));
|
|
545
|
+
const answerService = createAnswerService();
|
|
546
|
+
const response = await answerService.updateDisplayMode('CHART_MODE');
|
|
547
|
+
expect(fetchMock).toHaveBeenCalledWith(
|
|
548
|
+
'https://tshost/prism/?op=UpdateDisplayMode',
|
|
549
|
+
expect.objectContaining({
|
|
550
|
+
body: JSON.stringify({
|
|
551
|
+
operationName: 'UpdateDisplayMode',
|
|
552
|
+
query: queries.updateDisplayMode,
|
|
553
|
+
variables: {
|
|
554
|
+
session: defaultSession,
|
|
555
|
+
displayMode: 'CHART_MODE',
|
|
556
|
+
},
|
|
557
|
+
}),
|
|
558
|
+
}),
|
|
559
|
+
);
|
|
560
|
+
expect(response.answer.displayMode).toBe('CHART_MODE');
|
|
561
|
+
});
|
|
562
|
+
|
|
476
563
|
test('Add displayed Viz should call the right API', async () => {
|
|
477
564
|
fetchMock.mockResponseOnce(JSON.stringify({
|
|
478
565
|
data: {
|
|
@@ -190,7 +190,19 @@ export class AnswerService {
|
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
public async
|
|
193
|
+
public async updateDisplayMode(displayMode = "TABLE_MODE") {
|
|
194
|
+
return this.executeQuery(
|
|
195
|
+
queries.updateDisplayMode,
|
|
196
|
+
{
|
|
197
|
+
displayMode,
|
|
198
|
+
},
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public async getSQLQuery(fetchSQLWithAllColumns = false): Promise<string> {
|
|
203
|
+
if (fetchSQLWithAllColumns) {
|
|
204
|
+
await this.updateDisplayMode("TABLE_MODE");
|
|
205
|
+
}
|
|
194
206
|
const { sql } = await this.executeQuery(
|
|
195
207
|
queries.getSQLQuery,
|
|
196
208
|
{},
|