@thoughtspot/visual-embed-sdk 1.45.2 → 1.45.3-mcp.2
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 +2 -2
- 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/auto-frame-renderer.d.ts +3 -0
- package/cjs/src/embed/auto-frame-renderer.d.ts.map +1 -0
- package/cjs/src/embed/auto-frame-renderer.js +70 -0
- package/cjs/src/embed/auto-frame-renderer.js.map +1 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +128 -10
- 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/liveboard.d.ts +38 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +38 -10
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +179 -7
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +104 -0
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- 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 +4 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/types.d.ts +196 -41
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +185 -19
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/answerService/answerService.d.ts +34 -0
- package/cjs/src/utils/answerService/answerService.d.ts.map +1 -0
- package/cjs/src/utils/answerService/answerService.js +142 -0
- package/cjs/src/utils/answerService/answerService.js.map +1 -0
- package/cjs/src/utils/answerService/answerService.spec.d.ts +1 -0
- package/cjs/src/utils/answerService/answerService.spec.d.ts.map +1 -0
- package/cjs/src/utils/answerService/answerService.spec.js +1 -0
- package/cjs/src/utils/answerService/answerService.spec.js.map +1 -0
- package/cjs/src/utils/answerService/graphql-queries.d.ts +6 -0
- package/cjs/src/utils/answerService/graphql-queries.d.ts.map +1 -0
- package/cjs/src/utils/answerService/graphql-queries.js +123 -0
- package/cjs/src/utils/answerService/graphql-queries.js.map +1 -0
- package/cjs/src/utils/answerService.d.ts +10 -0
- package/cjs/src/utils/answerService.d.ts.map +1 -0
- package/cjs/src/utils/answerService.js +61 -0
- package/cjs/src/utils/answerService.js.map +1 -0
- package/cjs/src/utils/answerService.spec.d.ts +2 -0
- package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
- package/cjs/src/utils/answerService.spec.js +31 -0
- package/cjs/src/utils/answerService.spec.js.map +1 -0
- package/cjs/src/utils/authService.d.ts +37 -0
- package/cjs/src/utils/authService.d.ts.map +1 -0
- package/cjs/src/utils/authService.js +106 -0
- package/cjs/src/utils/authService.js.map +1 -0
- package/cjs/src/utils/authService.spec.d.ts +2 -0
- package/cjs/src/utils/authService.spec.d.ts.map +1 -0
- package/cjs/src/utils/authService.spec.js +72 -0
- package/cjs/src/utils/authService.spec.js.map +1 -0
- 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/graphql/answerService/graphql-queries.d.ts +5 -0
- package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/answerService/graphql-queries.js +80 -0
- package/cjs/src/utils/graphql/answerService/graphql-queries.js.map +1 -0
- package/cjs/src/utils/graphql/conversationService/conversation-queries.d.ts +3 -0
- package/cjs/src/utils/graphql/conversationService/conversation-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/conversationService/conversation-queries.js +318 -0
- package/cjs/src/utils/graphql/conversationService/conversation-queries.js.map +1 -0
- package/cjs/src/utils/graphql/conversationService/conversation-service.d.ts +12 -0
- package/cjs/src/utils/graphql/conversationService/conversation-service.d.ts.map +1 -0
- package/cjs/src/utils/graphql/conversationService/conversation-service.js +89 -0
- package/cjs/src/utils/graphql/conversationService/conversation-service.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.d.ts +3 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.js +318 -0
- package/cjs/src/utils/graphql/spotterService/conversation-queries.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.d.ts +12 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.js +89 -0
- package/cjs/src/utils/graphql/spotterService/conversation-service.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.d.ts +2 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.js +403 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.js.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.d.ts +12 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +1 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.js +55 -0
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.js.map +1 -0
- package/cjs/src/utils.d.ts +15 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +33 -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-BdkKLLo1.js → index-0serzuii.js} +1 -1
- package/dist/index-CqrIh3Vj.js +7370 -0
- package/dist/index-aFN9fe8V.js +7371 -0
- 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/auto-frame-renderer.d.ts +3 -0
- package/dist/src/embed/auto-frame-renderer.d.ts.map +1 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +128 -10
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +38 -1
- package/dist/src/embed/liveboard.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 +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +196 -41
- 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.d.ts +15 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +365 -52
- package/dist/tsembed-react.js +364 -51
- package/dist/tsembed.es.js +429 -53
- package/dist/tsembed.js +428 -51
- package/dist/visual-embed-sdk-react-full.d.ts +697 -343
- package/dist/visual-embed-sdk-react.d.ts +686 -332
- package/dist/visual-embed-sdk.d.ts +761 -380
- package/lib/package.json +2 -2
- 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/auto-frame-renderer.d.ts +3 -0
- package/lib/src/embed/auto-frame-renderer.d.ts.map +1 -0
- package/lib/src/embed/auto-frame-renderer.js +66 -0
- package/lib/src/embed/auto-frame-renderer.js.map +1 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +128 -10
- 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/liveboard.d.ts +38 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +39 -11
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +179 -7
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +2 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +1 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +101 -0
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -0
- 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 +4 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -0
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +196 -41
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +185 -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/graphql/conversationService/conversation-queries.d.ts +3 -0
- package/lib/src/utils/graphql/conversationService/conversation-queries.d.ts.map +1 -0
- package/lib/src/utils/graphql/conversationService/conversation-queries.js +315 -0
- package/lib/src/utils/graphql/conversationService/conversation-queries.js.map +1 -0
- package/lib/src/utils/graphql/conversationService/conversation-service.d.ts +12 -0
- package/lib/src/utils/graphql/conversationService/conversation-service.d.ts.map +1 -0
- package/lib/src/utils/graphql/conversationService/conversation-service.js +84 -0
- package/lib/src/utils/graphql/conversationService/conversation-service.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.d.ts +3 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.js +315 -0
- package/lib/src/utils/graphql/spotterService/conversation-queries.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.d.ts +12 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.js +84 -0
- package/lib/src/utils/graphql/spotterService/conversation-service.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.d.ts +2 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.js +400 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.js.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.d.ts +12 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +1 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.js +50 -0
- package/lib/src/utils/graphql/spotterService/nls-answer-service.js.map +1 -0
- package/lib/src/utils.d.ts +15 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +30 -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/lib/src/visual-embed-sdk.d.ts +7186 -0
- package/package.json +3 -3
- 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/auto-frame-renderer.ts +78 -0
- package/src/embed/base.ts +1 -0
- package/src/embed/conversation.spec.ts +117 -3
- package/src/embed/conversation.ts +189 -30
- package/src/embed/liveboard.spec.ts +264 -10
- package/src/embed/liveboard.ts +100 -11
- package/src/errors.ts +1 -0
- package/src/index.ts +8 -1
- package/src/types.ts +198 -42
- 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.spec.ts +56 -0
- package/src/utils.ts +36 -0
package/src/embed/liveboard.ts
CHANGED
|
@@ -24,12 +24,13 @@ import {
|
|
|
24
24
|
EmbedErrorCodes,
|
|
25
25
|
ContextType,
|
|
26
26
|
} from '../types';
|
|
27
|
-
import { calculateVisibleElementData, getQueryParamString, isUndefined, isValidCssMargin } from '../utils';
|
|
27
|
+
import { calculateVisibleElementData, getQueryParamString, isUndefined, isValidCssMargin, setParamIfDefined } from '../utils';
|
|
28
28
|
import { getAuthPromise } from './base';
|
|
29
29
|
import { TsEmbed, V1Embed } from './ts-embed';
|
|
30
30
|
import { addPreviewStylesIfNotPresent } from '../utils/global-styles';
|
|
31
31
|
import { TriggerPayload, TriggerResponse } from './hostEventClient/contracts';
|
|
32
32
|
import { logger } from '../utils/logger';
|
|
33
|
+
import { SpotterChatViewConfig } from './conversation';
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -209,6 +210,23 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
209
210
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
210
211
|
*/
|
|
211
212
|
activeTabId?: string;
|
|
213
|
+
/**
|
|
214
|
+
* The GUID of a saved personalized view to load.
|
|
215
|
+
* A personalized view is a saved configuration of a Liveboard
|
|
216
|
+
* that includes specific filter selections.
|
|
217
|
+
*
|
|
218
|
+
* Supported embed types: `LiveboardEmbed`
|
|
219
|
+
* @example
|
|
220
|
+
* ```js
|
|
221
|
+
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
222
|
+
* liveboardId: 'liveboard-guid',
|
|
223
|
+
* personalizedViewId: 'view-guid',
|
|
224
|
+
* activeTabId: 'tab-guid',
|
|
225
|
+
* })
|
|
226
|
+
* ```
|
|
227
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
228
|
+
*/
|
|
229
|
+
personalizedViewId?: string;
|
|
212
230
|
/**
|
|
213
231
|
* Show or hide the tab panel of the embedded Liveboard.
|
|
214
232
|
*
|
|
@@ -464,6 +482,24 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
464
482
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
465
483
|
*/
|
|
466
484
|
updatedSpotterChatPrompt?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* Configuration for customizing Spotter chat UI
|
|
487
|
+
* branding in tool response cards.
|
|
488
|
+
*
|
|
489
|
+
* Supported embed types: `LiveboardEmbed`
|
|
490
|
+
* @example
|
|
491
|
+
* ```js
|
|
492
|
+
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
493
|
+
* ... //other embed view config
|
|
494
|
+
* spotterChatConfig: {
|
|
495
|
+
* hideToolResponseCardBranding: true,
|
|
496
|
+
* toolResponseCardBrandingLabel: 'MyBrand',
|
|
497
|
+
* },
|
|
498
|
+
* })
|
|
499
|
+
* ```
|
|
500
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
501
|
+
*/
|
|
502
|
+
spotterChatConfig?: SpotterChatViewConfig;
|
|
467
503
|
}
|
|
468
504
|
|
|
469
505
|
/**
|
|
@@ -553,6 +589,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
553
589
|
isCentralizedLiveboardFilterUXEnabled = false,
|
|
554
590
|
isLinkParametersEnabled,
|
|
555
591
|
updatedSpotterChatPrompt,
|
|
592
|
+
spotterChatConfig,
|
|
556
593
|
isThisPeriodInDateFiltersEnabled,
|
|
557
594
|
} = this.viewConfig;
|
|
558
595
|
|
|
@@ -619,7 +656,6 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
619
656
|
params[Param.DataSourceId] = dataSourceId;
|
|
620
657
|
}
|
|
621
658
|
|
|
622
|
-
|
|
623
659
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
624
660
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
625
661
|
}
|
|
@@ -640,6 +676,17 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
640
676
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
641
677
|
}
|
|
642
678
|
|
|
679
|
+
// Handle spotterChatConfig params
|
|
680
|
+
if (spotterChatConfig) {
|
|
681
|
+
const {
|
|
682
|
+
hideToolResponseCardBranding,
|
|
683
|
+
toolResponseCardBrandingLabel,
|
|
684
|
+
} = spotterChatConfig;
|
|
685
|
+
|
|
686
|
+
setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
|
|
687
|
+
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
|
|
688
|
+
}
|
|
689
|
+
|
|
643
690
|
if (isLinkParametersEnabled !== undefined) {
|
|
644
691
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
645
692
|
}
|
|
@@ -671,15 +718,39 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
671
718
|
return params;
|
|
672
719
|
}
|
|
673
720
|
|
|
674
|
-
private getIframeSuffixSrc(
|
|
675
|
-
|
|
721
|
+
private getIframeSuffixSrc(
|
|
722
|
+
liveboardId: string,
|
|
723
|
+
vizId: string,
|
|
724
|
+
activeTabId: string,
|
|
725
|
+
personalizedViewId?: string,
|
|
726
|
+
) {
|
|
727
|
+
// Extract view from liveboardId if passed along with it (legacy approach)
|
|
728
|
+
// View must be appended as query param at the end, not embedded in path
|
|
729
|
+
let liveboardGuid = liveboardId;
|
|
730
|
+
let legacyViewId: string | undefined;
|
|
731
|
+
|
|
732
|
+
if (liveboardId?.includes('?')) {
|
|
733
|
+
const [id, query] = liveboardId.split('?');
|
|
734
|
+
liveboardGuid = id;
|
|
735
|
+
const params = new URLSearchParams(query);
|
|
736
|
+
legacyViewId = params.get('view') || undefined;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// personalizedViewId takes precedence over legacyViewId (when passed as part of liveboardId)
|
|
740
|
+
const effectiveViewId = personalizedViewId || legacyViewId;
|
|
741
|
+
|
|
742
|
+
let suffix = `/embed/viz/${liveboardGuid}`;
|
|
676
743
|
if (activeTabId) {
|
|
677
|
-
suffix = `${suffix}/tab/${activeTabId}
|
|
744
|
+
suffix = `${suffix}/tab/${activeTabId}`;
|
|
678
745
|
}
|
|
679
746
|
if (vizId) {
|
|
680
747
|
suffix = `${suffix}/${vizId}`;
|
|
681
748
|
}
|
|
682
|
-
const
|
|
749
|
+
const additionalParams: { [key: string]: string } = {};
|
|
750
|
+
if (effectiveViewId) {
|
|
751
|
+
additionalParams.view = effectiveViewId;
|
|
752
|
+
}
|
|
753
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams(additionalParams);
|
|
683
754
|
suffix = `${suffix}${tsPostHashParams}`;
|
|
684
755
|
return suffix;
|
|
685
756
|
}
|
|
@@ -687,7 +758,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
687
758
|
private sendFullHeightLazyLoadData = () => {
|
|
688
759
|
const data = calculateVisibleElementData(this.iFrame);
|
|
689
760
|
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
|
|
690
|
-
}
|
|
761
|
+
};
|
|
691
762
|
|
|
692
763
|
/**
|
|
693
764
|
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
@@ -706,7 +777,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
706
777
|
* to be loaded within the iFrame.
|
|
707
778
|
*/
|
|
708
779
|
private getIFrameSrc(): string {
|
|
709
|
-
const { vizId, activeTabId } = this.viewConfig;
|
|
780
|
+
const { vizId, activeTabId, personalizedViewId } = this.viewConfig;
|
|
710
781
|
const liveboardId = this.viewConfig.liveboardId ?? this.viewConfig.pinboardId;
|
|
711
782
|
|
|
712
783
|
if (!liveboardId) {
|
|
@@ -721,6 +792,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
721
792
|
liveboardId,
|
|
722
793
|
vizId,
|
|
723
794
|
activeTabId,
|
|
795
|
+
personalizedViewId,
|
|
724
796
|
)}`;
|
|
725
797
|
}
|
|
726
798
|
|
|
@@ -813,18 +885,25 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
813
885
|
liveboardId: this.viewConfig.liveboardId,
|
|
814
886
|
vizId: this.viewConfig.vizId,
|
|
815
887
|
activeTabId: this.viewConfig.activeTabId,
|
|
888
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
816
889
|
};
|
|
817
890
|
|
|
818
891
|
protected beforePrerenderVisible(): void {
|
|
819
892
|
const embedObj = this.getPreRenderObj<LiveboardEmbed>();
|
|
820
893
|
|
|
821
894
|
this.executeAfterEmbedContainerLoaded(() => {
|
|
822
|
-
this.navigateToLiveboard(
|
|
895
|
+
this.navigateToLiveboard(
|
|
896
|
+
this.viewConfig.liveboardId,
|
|
897
|
+
this.viewConfig.vizId,
|
|
898
|
+
this.viewConfig.activeTabId,
|
|
899
|
+
this.viewConfig.personalizedViewId,
|
|
900
|
+
);
|
|
823
901
|
if (embedObj) {
|
|
824
902
|
embedObj.currentLiveboardState = {
|
|
825
903
|
liveboardId: this.viewConfig.liveboardId,
|
|
826
904
|
vizId: this.viewConfig.vizId,
|
|
827
905
|
activeTabId: this.viewConfig.activeTabId,
|
|
906
|
+
personalizedViewId: this.viewConfig.personalizedViewId,
|
|
828
907
|
};
|
|
829
908
|
}
|
|
830
909
|
});
|
|
@@ -902,11 +981,17 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
902
981
|
return this;
|
|
903
982
|
}
|
|
904
983
|
|
|
905
|
-
public navigateToLiveboard(
|
|
906
|
-
|
|
984
|
+
public navigateToLiveboard(
|
|
985
|
+
liveboardId: string,
|
|
986
|
+
vizId?: string,
|
|
987
|
+
activeTabId?: string,
|
|
988
|
+
personalizedViewId?: string,
|
|
989
|
+
) {
|
|
990
|
+
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId);
|
|
907
991
|
this.viewConfig.liveboardId = liveboardId;
|
|
908
992
|
this.viewConfig.activeTabId = activeTabId;
|
|
909
993
|
this.viewConfig.vizId = vizId;
|
|
994
|
+
this.viewConfig.personalizedViewId = personalizedViewId;
|
|
910
995
|
if (this.isRendered) {
|
|
911
996
|
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
912
997
|
} else if (this.viewConfig.preRenderId) {
|
|
@@ -931,6 +1016,10 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
931
1016
|
url = `${url}/${this.viewConfig.vizId}`;
|
|
932
1017
|
}
|
|
933
1018
|
|
|
1019
|
+
if (this.viewConfig.personalizedViewId) {
|
|
1020
|
+
url = `${url}?view=${this.viewConfig.personalizedViewId}`;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
934
1023
|
return url;
|
|
935
1024
|
}
|
|
936
1025
|
}
|
package/src/errors.ts
CHANGED
|
@@ -29,6 +29,7 @@ export const ERROR_MESSAGE = {
|
|
|
29
29
|
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
30
30
|
SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
|
|
31
31
|
UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
|
|
32
|
+
INVALID_SPOTTER_DOCUMENTATION_URL: 'Invalid spotterDocumentationUrl. Please provide a valid http or https URL.',
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
export const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/live
|
|
|
32
32
|
import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
33
33
|
import { SearchBarEmbed, SearchBarViewConfig } from './embed/search-bar';
|
|
34
34
|
import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversation, BodylessConversationViewConfig} from './embed/bodyless-conversation';
|
|
35
|
-
import { SpotterEmbed, SpotterEmbedViewConfig, ConversationEmbed, ConversationViewConfig } from './embed/conversation';
|
|
35
|
+
import { SpotterEmbed, SpotterEmbedViewConfig, SpotterChatViewConfig, SpotterSidebarViewConfig, ConversationEmbed, ConversationViewConfig } from './embed/conversation';
|
|
36
36
|
import {
|
|
37
37
|
AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter,
|
|
38
38
|
} from './auth';
|
|
@@ -67,8 +67,10 @@ import {
|
|
|
67
67
|
CustomActionTarget,
|
|
68
68
|
InterceptedApiType,
|
|
69
69
|
EmbedErrorCodes,
|
|
70
|
+
EmbedErrorDetailsEvent,
|
|
70
71
|
ErrorDetailsTypes,
|
|
71
72
|
ContextType,
|
|
73
|
+
AutoMCPFrameRendererViewConfig,
|
|
72
74
|
} from './types';
|
|
73
75
|
import { CustomCssVariables } from './css-variables';
|
|
74
76
|
import { SageEmbed, SageViewConfig } from './embed/sage';
|
|
@@ -106,6 +108,8 @@ export {
|
|
|
106
108
|
BodylessConversation,
|
|
107
109
|
SpotterEmbed,
|
|
108
110
|
SpotterEmbedViewConfig,
|
|
111
|
+
SpotterChatViewConfig,
|
|
112
|
+
SpotterSidebarViewConfig,
|
|
109
113
|
ConversationViewConfig,
|
|
110
114
|
ConversationEmbed,
|
|
111
115
|
AuthFailureType,
|
|
@@ -161,7 +165,10 @@ export {
|
|
|
161
165
|
CustomActionTarget,
|
|
162
166
|
InterceptedApiType,
|
|
163
167
|
EmbedErrorCodes,
|
|
168
|
+
EmbedErrorDetailsEvent,
|
|
164
169
|
ErrorDetailsTypes,
|
|
170
|
+
AutoMCPFrameRendererViewConfig,
|
|
165
171
|
};
|
|
166
172
|
|
|
167
173
|
export { resetCachedAuthToken } from './authToken';
|
|
174
|
+
export { startAutoMCPFrameRenderer } from './embed/auto-frame-renderer';
|
package/src/types.ts
CHANGED
|
@@ -1163,6 +1163,8 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1163
1163
|
useHostEventsV2?: boolean;
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
|
+
export interface AutoMCPFrameRendererViewConfig extends BaseViewConfig {}
|
|
1167
|
+
|
|
1166
1168
|
/**
|
|
1167
1169
|
* The configuration object for Home page embeds configs.
|
|
1168
1170
|
*/
|
|
@@ -1361,7 +1363,7 @@ export interface SearchLiveboardCommonViewConfig {
|
|
|
1361
1363
|
*
|
|
1362
1364
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
1363
1365
|
* @default true
|
|
1364
|
-
* @
|
|
1366
|
+
* @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
1365
1367
|
* @example
|
|
1366
1368
|
* ```js
|
|
1367
1369
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -1599,7 +1601,7 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
1599
1601
|
* To enable this feature on your instance, contact ThoughtSpot Support.
|
|
1600
1602
|
*
|
|
1601
1603
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
1602
|
-
* @version SDK: 1.
|
|
1604
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.4.0.cl
|
|
1603
1605
|
* @example
|
|
1604
1606
|
* ```js
|
|
1605
1607
|
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
@@ -3203,6 +3205,42 @@ export enum EmbedEvent {
|
|
|
3203
3205
|
* @version SDK: 1.43.0 | ThoughtSpot: 10.15.0.cl
|
|
3204
3206
|
*/
|
|
3205
3207
|
ApiIntercept = 'ApiIntercept',
|
|
3208
|
+
/**
|
|
3209
|
+
* Emitted when a Spotter conversation is renamed.
|
|
3210
|
+
* @example
|
|
3211
|
+
* ```js
|
|
3212
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationRenamed, (payload) => {
|
|
3213
|
+
* console.log('Conversation renamed', payload);
|
|
3214
|
+
* // payload: { convId: string, oldTitle: string, newTitle: string }
|
|
3215
|
+
* })
|
|
3216
|
+
* ```
|
|
3217
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3218
|
+
*/
|
|
3219
|
+
SpotterConversationRenamed = 'spotterConversationRenamed',
|
|
3220
|
+
/**
|
|
3221
|
+
* Emitted when a Spotter conversation is deleted.
|
|
3222
|
+
* @example
|
|
3223
|
+
* ```js
|
|
3224
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationDeleted, (payload) => {
|
|
3225
|
+
* console.log('Conversation deleted', payload);
|
|
3226
|
+
* // payload: { convId: string, title: string }
|
|
3227
|
+
* })
|
|
3228
|
+
* ```
|
|
3229
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3230
|
+
*/
|
|
3231
|
+
SpotterConversationDeleted = 'spotterConversationDeleted',
|
|
3232
|
+
/**
|
|
3233
|
+
* Emitted when a Spotter conversation is selected/clicked.
|
|
3234
|
+
* @example
|
|
3235
|
+
* ```js
|
|
3236
|
+
* spotterEmbed.on(EmbedEvent.SpotterConversationSelected, (payload) => {
|
|
3237
|
+
* console.log('Conversation selected', payload);
|
|
3238
|
+
* // payload: { convId: string, title: string, worksheetId: string }
|
|
3239
|
+
* })
|
|
3240
|
+
* ```
|
|
3241
|
+
* @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
|
|
3242
|
+
*/
|
|
3243
|
+
SpotterConversationSelected = 'spotterConversationSelected',
|
|
3206
3244
|
|
|
3207
3245
|
/**
|
|
3208
3246
|
* @hidden
|
|
@@ -4641,6 +4679,7 @@ export enum DataSourceVisualMode {
|
|
|
4641
4679
|
*/
|
|
4642
4680
|
|
|
4643
4681
|
export enum Param {
|
|
4682
|
+
Tsmcp = 'tsmcp',
|
|
4644
4683
|
EmbedApp = 'embedApp',
|
|
4645
4684
|
DataSources = 'dataSources',
|
|
4646
4685
|
DataSourceMode = 'dataSourceMode',
|
|
@@ -4771,7 +4810,19 @@ export enum Param {
|
|
|
4771
4810
|
isLinkParametersEnabled = 'isLinkParametersEnabled',
|
|
4772
4811
|
EnablePastConversationsSidebar = 'enablePastConversationsSidebar',
|
|
4773
4812
|
UpdatedSpotterChatPrompt = 'updatedSpotterChatPrompt',
|
|
4813
|
+
SpotterSidebarTitle = 'spotterSidebarTitle',
|
|
4814
|
+
SpotterSidebarDefaultExpanded = 'spotterSidebarDefaultExpanded',
|
|
4815
|
+
SpotterChatRenameLabel = 'spotterChatRenameLabel',
|
|
4816
|
+
SpotterChatDeleteLabel = 'spotterChatDeleteLabel',
|
|
4817
|
+
SpotterDeleteConversationModalTitle = 'spotterDeleteConversationModalTitle',
|
|
4818
|
+
SpotterPastConversationAlertMessage = 'spotterPastConversationAlertMessage',
|
|
4819
|
+
SpotterDocumentationUrl = 'spotterDocumentationUrl',
|
|
4820
|
+
SpotterBestPracticesLabel = 'spotterBestPracticesLabel',
|
|
4821
|
+
SpotterConversationsBatchSize = 'spotterConversationsBatchSize',
|
|
4822
|
+
SpotterNewChatButtonTitle = 'spotterNewChatButtonTitle',
|
|
4774
4823
|
IsThisPeriodInDateFiltersEnabled = 'isThisPeriodInDateFiltersEnabled',
|
|
4824
|
+
HideToolResponseCardBranding = 'hideToolResponseCardBranding',
|
|
4825
|
+
ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel',
|
|
4775
4826
|
}
|
|
4776
4827
|
|
|
4777
4828
|
/**
|
|
@@ -6216,6 +6267,96 @@ export enum Action {
|
|
|
6216
6267
|
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
6217
6268
|
*/
|
|
6218
6269
|
UngroupLiveboardGroup = 'ungroupLiveboardGroup',
|
|
6270
|
+
/**
|
|
6271
|
+
* Controls visibility of the sidebar header (title and toggle button)
|
|
6272
|
+
* in the Spotter past conversations sidebar.
|
|
6273
|
+
* @example
|
|
6274
|
+
* ```js
|
|
6275
|
+
* hiddenActions: [Action.SpotterSidebarHeader]
|
|
6276
|
+
* ```
|
|
6277
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6278
|
+
*/
|
|
6279
|
+
SpotterSidebarHeader = 'spotterSidebarHeader',
|
|
6280
|
+
/**
|
|
6281
|
+
* Controls visibility of the sidebar footer (documentation link)
|
|
6282
|
+
* in the Spotter past conversations sidebar.
|
|
6283
|
+
* @example
|
|
6284
|
+
* ```js
|
|
6285
|
+
* hiddenActions: [Action.SpotterSidebarFooter]
|
|
6286
|
+
* ```
|
|
6287
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6288
|
+
*/
|
|
6289
|
+
SpotterSidebarFooter = 'spotterSidebarFooter',
|
|
6290
|
+
/**
|
|
6291
|
+
* Controls visibility and disable state of the sidebar toggle/expand button
|
|
6292
|
+
* in the Spotter past conversations sidebar.
|
|
6293
|
+
* @example
|
|
6294
|
+
* ```js
|
|
6295
|
+
* disabledActions: [Action.SpotterSidebarToggle]
|
|
6296
|
+
* ```
|
|
6297
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6298
|
+
*/
|
|
6299
|
+
SpotterSidebarToggle = 'spotterSidebarToggle',
|
|
6300
|
+
/**
|
|
6301
|
+
* Controls visibility and disable state of the "New Chat" button
|
|
6302
|
+
* in the Spotter past conversations sidebar.
|
|
6303
|
+
* @example
|
|
6304
|
+
* ```js
|
|
6305
|
+
* disabledActions: [Action.SpotterNewChat]
|
|
6306
|
+
* ```
|
|
6307
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6308
|
+
*/
|
|
6309
|
+
SpotterNewChat = 'spotterNewChat',
|
|
6310
|
+
/**
|
|
6311
|
+
* Controls visibility of the past conversation banner alert
|
|
6312
|
+
* in the Spotter interface.
|
|
6313
|
+
* @example
|
|
6314
|
+
* ```js
|
|
6315
|
+
* hiddenActions: [Action.SpotterPastChatBanner]
|
|
6316
|
+
* ```
|
|
6317
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6318
|
+
*/
|
|
6319
|
+
SpotterPastChatBanner = 'spotterPastChatBanner',
|
|
6320
|
+
/**
|
|
6321
|
+
* Controls visibility and disable state of the conversation edit menu
|
|
6322
|
+
* (three-dot menu) in the Spotter past conversations sidebar.
|
|
6323
|
+
* @example
|
|
6324
|
+
* ```js
|
|
6325
|
+
* disabledActions: [Action.SpotterChatMenu]
|
|
6326
|
+
* ```
|
|
6327
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6328
|
+
*/
|
|
6329
|
+
SpotterChatMenu = 'spotterChatMenu',
|
|
6330
|
+
/**
|
|
6331
|
+
* Controls visibility and disable state of the rename action
|
|
6332
|
+
* in the Spotter conversation edit menu.
|
|
6333
|
+
* @example
|
|
6334
|
+
* ```js
|
|
6335
|
+
* disabledActions: [Action.SpotterChatRename]
|
|
6336
|
+
* ```
|
|
6337
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6338
|
+
*/
|
|
6339
|
+
SpotterChatRename = 'spotterChatRename',
|
|
6340
|
+
/**
|
|
6341
|
+
* Controls visibility and disable state of the delete action
|
|
6342
|
+
* in the Spotter conversation edit menu.
|
|
6343
|
+
* @example
|
|
6344
|
+
* ```js
|
|
6345
|
+
* disabledActions: [Action.SpotterChatDelete]
|
|
6346
|
+
* ```
|
|
6347
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6348
|
+
*/
|
|
6349
|
+
SpotterChatDelete = 'spotterChatDelete',
|
|
6350
|
+
/**
|
|
6351
|
+
* Controls visibility and disable state of the documentation/best practices
|
|
6352
|
+
* link in the Spotter sidebar footer.
|
|
6353
|
+
* @example
|
|
6354
|
+
* ```js
|
|
6355
|
+
* disabledActions: [Action.SpotterDocs]
|
|
6356
|
+
* ```
|
|
6357
|
+
* @version SDK: 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
|
|
6358
|
+
*/
|
|
6359
|
+
SpotterDocs = 'spotterDocs',
|
|
6219
6360
|
/**
|
|
6220
6361
|
* The **Include current period** checkbox for date filters.
|
|
6221
6362
|
* Controls the visibility and availability of the option to include
|
|
@@ -6426,13 +6567,30 @@ export enum LogLevel {
|
|
|
6426
6567
|
* Error types emitted by embedded components.
|
|
6427
6568
|
*
|
|
6428
6569
|
* These enum values categorize different types of errors that can occur during
|
|
6429
|
-
* the lifecycle of an embedded ThoughtSpot component.
|
|
6430
|
-
*
|
|
6431
|
-
*
|
|
6432
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
6433
|
-
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
6570
|
+
* the lifecycle of an embedded ThoughtSpot component.
|
|
6571
|
+
* Use {@link EmbedErrorDetailsEvent} and {@link EmbedErrorCodes} to handle specific errors.
|
|
6434
6572
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
6435
6573
|
* @group Error Handling
|
|
6574
|
+
*
|
|
6575
|
+
* @example
|
|
6576
|
+
* Handle specific error types
|
|
6577
|
+
* ```js
|
|
6578
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
6579
|
+
* switch (error.errorType) {
|
|
6580
|
+
* case ErrorDetailsTypes.API:
|
|
6581
|
+
* console.error('API error:', error.message);
|
|
6582
|
+
* break;
|
|
6583
|
+
* case ErrorDetailsTypes.VALIDATION_ERROR:
|
|
6584
|
+
* console.error('Validation error:', error.message);
|
|
6585
|
+
* break;
|
|
6586
|
+
* case ErrorDetailsTypes.NETWORK:
|
|
6587
|
+
* console.error('Network error:', error.message);
|
|
6588
|
+
* break;
|
|
6589
|
+
* default:
|
|
6590
|
+
* console.error('Unknown error:', error);
|
|
6591
|
+
* }
|
|
6592
|
+
* });
|
|
6593
|
+
* ```
|
|
6436
6594
|
*/
|
|
6437
6595
|
export enum ErrorDetailsTypes {
|
|
6438
6596
|
/** API call failure */
|
|
@@ -6444,26 +6602,34 @@ export enum ErrorDetailsTypes {
|
|
|
6444
6602
|
}
|
|
6445
6603
|
|
|
6446
6604
|
/**
|
|
6447
|
-
* Error codes for identifying specific issues in embedded ThoughtSpot components.
|
|
6448
|
-
*
|
|
6449
|
-
* Use these codes for precise error handling and debugging. Each code maps to a
|
|
6450
|
-
* distinct failure scenario, enabling targeted recovery strategies.
|
|
6605
|
+
* Error codes for identifying specific issues in embedded ThoughtSpot components. Use {@link EmbedErrorDetailsEvent} and {@link ErrorDetailsTypes} codes for precise error handling and debugging.
|
|
6451
6606
|
*
|
|
6452
6607
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
6453
6608
|
* @group Error Handling
|
|
6454
|
-
|
|
6455
|
-
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
6456
|
-
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
6457
|
-
*
|
|
6609
|
+
|
|
6458
6610
|
* @example
|
|
6459
6611
|
* Handle specific error codes in the error event handler
|
|
6460
|
-
*
|
|
6612
|
+
* ```js
|
|
6461
6613
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
6462
|
-
*
|
|
6463
|
-
*
|
|
6614
|
+
* switch (error.code) {
|
|
6615
|
+
* case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
|
|
6616
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
6617
|
+
* break;
|
|
6618
|
+
* case EmbedErrorCodes.LIVEBOARD_ID_MISSING:
|
|
6619
|
+
* console.error('Liveboard ID is missing:', error.message);
|
|
6620
|
+
* break;
|
|
6621
|
+
* case EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG:
|
|
6622
|
+
* console.error('Conflicting actions configuration:', error.message);
|
|
6623
|
+
* break;
|
|
6624
|
+
* case EmbedErrorCodes.CONFLICTING_TABS_CONFIG:
|
|
6625
|
+
* console.error('Conflicting tabs configuration:', error.message);
|
|
6626
|
+
* break;
|
|
6627
|
+
* default:
|
|
6628
|
+
* console.error('Unknown error:', error);
|
|
6464
6629
|
* }
|
|
6465
6630
|
* });
|
|
6466
|
-
*
|
|
6631
|
+
* ```
|
|
6632
|
+
* */
|
|
6467
6633
|
export enum EmbedErrorCodes {
|
|
6468
6634
|
/** Worksheet ID not found or does not exist */
|
|
6469
6635
|
WORKSHEET_ID_NOT_FOUND = 'WORKSHEET_ID_NOT_FOUND',
|
|
@@ -6471,10 +6637,10 @@ export enum EmbedErrorCodes {
|
|
|
6471
6637
|
/** Required Liveboard ID is missing from configuration */
|
|
6472
6638
|
LIVEBOARD_ID_MISSING = 'LIVEBOARD_ID_MISSING',
|
|
6473
6639
|
|
|
6474
|
-
/** Conflicting action configuration detected
|
|
6640
|
+
/** Conflicting action configuration detected */
|
|
6475
6641
|
CONFLICTING_ACTIONS_CONFIG = 'CONFLICTING_ACTIONS_CONFIG',
|
|
6476
6642
|
|
|
6477
|
-
/** Conflicting tab configuration detected
|
|
6643
|
+
/** Conflicting tab configuration detected */
|
|
6478
6644
|
CONFLICTING_TABS_CONFIG = 'CONFLICTING_TABS_CONFIG',
|
|
6479
6645
|
|
|
6480
6646
|
/** Error during component initialization */
|
|
@@ -6500,6 +6666,9 @@ export enum EmbedErrorCodes {
|
|
|
6500
6666
|
|
|
6501
6667
|
/** Failed to update embed parameters during pre-render */
|
|
6502
6668
|
UPDATE_PARAMS_FAILED = 'UPDATE_PARAMS_FAILED',
|
|
6669
|
+
|
|
6670
|
+
/** Invalid URL provided in configuration */
|
|
6671
|
+
INVALID_URL = 'INVALID_URL',
|
|
6503
6672
|
}
|
|
6504
6673
|
|
|
6505
6674
|
/**
|
|
@@ -6513,7 +6682,7 @@ export enum EmbedErrorCodes {
|
|
|
6513
6682
|
*
|
|
6514
6683
|
* - **errorType**: One of the predefined {@link ErrorDetailsTypes} values
|
|
6515
6684
|
* - **message**: Human-readable error description (string or array of strings for multiple errors)
|
|
6516
|
-
* - **code**: Machine-readable error identifier
|
|
6685
|
+
* - **code**: Machine-readable error identifier {@link EmbedErrorCodes} values
|
|
6517
6686
|
* - **[key: string]**: Additional context-specific for backward compatibility
|
|
6518
6687
|
*
|
|
6519
6688
|
* ## Usage
|
|
@@ -6523,12 +6692,11 @@ export enum EmbedErrorCodes {
|
|
|
6523
6692
|
*
|
|
6524
6693
|
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
6525
6694
|
* @group Error Handling
|
|
6526
|
-
* @see {@link ErrorDetailsTypes} - Available error type values
|
|
6527
|
-
* @see {@link EmbedEvent.Error} - The event that emits this object
|
|
6528
6695
|
*
|
|
6529
6696
|
* @example
|
|
6530
6697
|
* Handle specific error types
|
|
6531
|
-
*
|
|
6698
|
+
*
|
|
6699
|
+
* ```js
|
|
6532
6700
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
6533
6701
|
* switch (error.code) {
|
|
6534
6702
|
* case EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND:
|
|
@@ -6538,30 +6706,18 @@ export enum EmbedErrorCodes {
|
|
|
6538
6706
|
* console.error('Unknown error:', error);
|
|
6539
6707
|
* }
|
|
6540
6708
|
* });
|
|
6541
|
-
*
|
|
6709
|
+
* ```
|
|
6542
6710
|
* @example
|
|
6543
6711
|
* Handle multiple error messages
|
|
6544
|
-
*
|
|
6712
|
+
*
|
|
6713
|
+
* ```js
|
|
6545
6714
|
* embed.on(EmbedEvent.Error, (error) => {
|
|
6546
6715
|
* const messages = Array.isArray(error.message)
|
|
6547
6716
|
* ? error.message
|
|
6548
6717
|
* : [error.message];
|
|
6549
|
-
*
|
|
6550
6718
|
* messages.forEach(msg => console.error(msg));
|
|
6551
6719
|
* });
|
|
6552
|
-
*
|
|
6553
|
-
* @example
|
|
6554
|
-
* Access additional error context
|
|
6555
|
-
*
|
|
6556
|
-
* embed.on(EmbedEvent.Error, (error) => {
|
|
6557
|
-
* console.error('Error Details:', {
|
|
6558
|
-
* type: error.errorType,
|
|
6559
|
-
* message: error.message,
|
|
6560
|
-
* code: error.code,
|
|
6561
|
-
* // Additional context fields vary by error type
|
|
6562
|
-
* ...error
|
|
6563
|
-
* });
|
|
6564
|
-
* });
|
|
6720
|
+
* ```
|
|
6565
6721
|
* */
|
|
6566
6722
|
export interface EmbedErrorDetailsEvent {
|
|
6567
6723
|
/** The type of error that occurred */
|
|
@@ -6754,4 +6910,4 @@ export interface ContextObject {
|
|
|
6754
6910
|
type: ContextType;
|
|
6755
6911
|
objectIds: ObjectIds;
|
|
6756
6912
|
}
|
|
6757
|
-
}
|
|
6913
|
+
}
|
|
@@ -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(
|