@thoughtspot/visual-embed-sdk 1.47.2 → 1.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +11 -1
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.js +38 -0
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.d.ts +2 -0
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +7 -5
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/embed/app.d.ts +7 -2
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +121 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +2 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +32 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +24 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +15 -2
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +99 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/spotter-utils.d.ts +3 -0
- package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
- package/cjs/src/embed/spotter-utils.js +11 -3
- package/cjs/src/embed/spotter-utils.js.map +1 -1
- package/cjs/src/embed/spotter-utils.spec.js +51 -0
- package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +1 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +17 -5
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +168 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +8 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +2 -0
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +2 -0
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/test/test-utils.d.ts +1 -0
- package/cjs/src/test/test-utils.d.ts.map +1 -1
- package/cjs/src/test/test-utils.js +26 -1
- package/cjs/src/test/test-utils.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts.map +1 -1
- package/cjs/src/tokenizedFetch.js +12 -9
- package/cjs/src/tokenizedFetch.js.map +1 -1
- package/cjs/src/tokenizedFetch.spec.d.ts +2 -0
- package/cjs/src/tokenizedFetch.spec.d.ts.map +1 -0
- package/cjs/src/tokenizedFetch.spec.js +68 -0
- package/cjs/src/tokenizedFetch.spec.js.map +1 -0
- package/cjs/src/types.d.ts +466 -13
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +149 -5
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-CFZ7RDZ9.js → index-Ck-r09gt.js} +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/authToken.d.ts +2 -0
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +7 -2
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +2 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +24 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/spotter-utils.d.ts +3 -0
- package/dist/src/embed/spotter-utils.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +1 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/test/test-utils.d.ts +1 -0
- package/dist/src/test/test-utils.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.spec.d.ts +2 -0
- package/dist/src/tokenizedFetch.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +466 -13
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +226 -29
- package/dist/tsembed-react.js +225 -28
- package/dist/tsembed.es.js +227 -30
- package/dist/tsembed.js +225 -28
- package/dist/visual-embed-sdk-react-full.d.ts +469 -15
- package/dist/visual-embed-sdk-react.d.ts +469 -15
- package/dist/visual-embed-sdk.d.ts +497 -15
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +12 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.js +38 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.d.ts +2 -0
- 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/embed/app.d.ts +7 -2
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +122 -1
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +2 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +32 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +24 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +15 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +100 -1
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/spotter-utils.d.ts +3 -0
- package/lib/src/embed/spotter-utils.d.ts.map +1 -1
- package/lib/src/embed/spotter-utils.js +11 -3
- package/lib/src/embed/spotter-utils.js.map +1 -1
- package/lib/src/embed/spotter-utils.spec.js +51 -0
- package/lib/src/embed/spotter-utils.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +16 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +168 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- 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/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +2 -0
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +2 -0
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/test/test-utils.d.ts +1 -0
- package/lib/src/test/test-utils.d.ts.map +1 -1
- package/lib/src/test/test-utils.js +25 -1
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/tokenizedFetch.d.ts.map +1 -1
- package/lib/src/tokenizedFetch.js +13 -10
- package/lib/src/tokenizedFetch.js.map +1 -1
- package/lib/src/tokenizedFetch.spec.d.ts +2 -0
- package/lib/src/tokenizedFetch.spec.d.ts.map +1 -0
- package/lib/src/tokenizedFetch.spec.js +65 -0
- package/lib/src/tokenizedFetch.spec.js.map +1 -0
- package/lib/src/types.d.ts +466 -13
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +148 -4
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +497 -15
- package/package.json +1 -1
- package/src/auth.spec.ts +55 -1
- package/src/auth.ts +11 -2
- package/src/authToken.ts +2 -2
- package/src/embed/app.spec.ts +154 -0
- package/src/embed/app.ts +13 -2
- package/src/embed/conversation.ts +2 -1
- package/src/embed/liveboard.spec.ts +46 -0
- package/src/embed/liveboard.ts +9 -4
- package/src/embed/search.spec.ts +118 -0
- package/src/embed/search.ts +43 -1
- package/src/embed/spotter-utils.spec.ts +52 -0
- package/src/embed/spotter-utils.ts +19 -3
- package/src/embed/ts-embed.spec.ts +220 -0
- package/src/embed/ts-embed.ts +15 -4
- package/src/index.ts +16 -0
- package/src/mixpanel-service.spec.ts +2 -0
- package/src/mixpanel-service.ts +2 -0
- package/src/test/test-utils.ts +33 -1
- package/src/tokenizedFetch.spec.ts +81 -0
- package/src/tokenizedFetch.ts +14 -11
- package/src/types.ts +496 -13
|
@@ -1902,9 +1902,10 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1902
1902
|
styleSheet__unstable?: string;
|
|
1903
1903
|
/**
|
|
1904
1904
|
* The list of actions to disable from the primary menu, more menu
|
|
1905
|
-
* (...), and the contextual menu.
|
|
1906
|
-
*
|
|
1907
|
-
* Use this to disable
|
|
1905
|
+
* (...), and the contextual menu. Disabled actions are grayed out
|
|
1906
|
+
* and still visible to the user, but cannot be clicked.
|
|
1907
|
+
* Use this when you want to disable an action (keep it visible but non-interactive).
|
|
1908
|
+
* To completely remove an action from the UI, use {@link hiddenActions} instead.
|
|
1908
1909
|
*
|
|
1909
1910
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
1910
1911
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -1935,9 +1936,10 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1935
1936
|
*/
|
|
1936
1937
|
disabledActionReason?: string;
|
|
1937
1938
|
/**
|
|
1938
|
-
* The list of actions to
|
|
1939
|
-
*
|
|
1940
|
-
* Use this to
|
|
1939
|
+
* The list of actions to completely remove from the embedded view.
|
|
1940
|
+
* Hidden actions are not visible to the user at all (fully removed from the UI).
|
|
1941
|
+
* Use this when you want to remove an action entirely.
|
|
1942
|
+
* To keep an action visible but non-interactive (grayed out), use {@link disabledActions} instead.
|
|
1941
1943
|
*
|
|
1942
1944
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
1943
1945
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -1956,9 +1958,8 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
1956
1958
|
* The list of actions to display from the primary menu, more menu
|
|
1957
1959
|
* (...), and the contextual menu. These will be only actions that
|
|
1958
1960
|
* are visible to the user.
|
|
1959
|
-
* Use this
|
|
1960
|
-
*
|
|
1961
|
-
* Use either this or hiddenActions.
|
|
1961
|
+
* Use this as an allowlist — only the actions listed here will be shown.
|
|
1962
|
+
* All other actions will be hidden. Use either this or {@link hiddenActions}, not both.
|
|
1962
1963
|
*
|
|
1963
1964
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
|
|
1964
1965
|
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
|
|
@@ -2412,6 +2413,7 @@ export interface BaseViewConfig extends ApiInterceptFlags {
|
|
|
2412
2413
|
/**
|
|
2413
2414
|
* Refresh the auth token when the token is near expiry.
|
|
2414
2415
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
2416
|
+
* @default true
|
|
2415
2417
|
* @example
|
|
2416
2418
|
* ```js
|
|
2417
2419
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -2963,6 +2965,22 @@ export interface LiveboardAppEmbedViewConfig {
|
|
|
2963
2965
|
* ```
|
|
2964
2966
|
*/
|
|
2965
2967
|
isLiveboardMasterpiecesEnabled?: boolean;
|
|
2968
|
+
/**
|
|
2969
|
+
* Enable or disable Muze chart phase 1 GA
|
|
2970
|
+
*
|
|
2971
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
2972
|
+
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
|
|
2973
|
+
* @default false
|
|
2974
|
+
* @example
|
|
2975
|
+
* ```js
|
|
2976
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
2977
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
2978
|
+
* ... // other embed view config
|
|
2979
|
+
* newChartsLibrary: true,
|
|
2980
|
+
* })
|
|
2981
|
+
* ```
|
|
2982
|
+
*/
|
|
2983
|
+
newChartsLibrary?: boolean;
|
|
2966
2984
|
}
|
|
2967
2985
|
export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig {
|
|
2968
2986
|
}
|
|
@@ -6703,10 +6721,14 @@ export enum DataSourceVisualMode {
|
|
|
6703
6721
|
/**
|
|
6704
6722
|
* ThoughtSpot application pages include actions and menu commands
|
|
6705
6723
|
* for various user-initiated operations. These actions are represented
|
|
6706
|
-
* as enumeration members in the SDK. To
|
|
6707
|
-
*
|
|
6708
|
-
*
|
|
6709
|
-
*
|
|
6724
|
+
* as enumeration members in the SDK. To control actions in the embedded view:
|
|
6725
|
+
* - disabledActions — the action is grayed out and still visible, but non-interactive (user can see but not click).
|
|
6726
|
+
* - hiddenActions — the action is completely removed from the UI (user cannot see it at all).
|
|
6727
|
+
* - visibleActions — allowlist, only these actions are shown; all others are hidden.
|
|
6728
|
+
*
|
|
6729
|
+
* Use disabledActions to disable (gray out) an action.
|
|
6730
|
+
* Use hiddenActions to hide (fully remove) an action.
|
|
6731
|
+
* Use visibleActions to show only specific actions.
|
|
6710
6732
|
* @example
|
|
6711
6733
|
* ```js
|
|
6712
6734
|
* const embed = new LiveboardEmbed('#tsEmbed', {
|
|
@@ -7553,6 +7575,26 @@ export enum Action {
|
|
|
7553
7575
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.1.sw
|
|
7554
7576
|
*/
|
|
7555
7577
|
AxisMenuRemove = "axisMenuRemove",
|
|
7578
|
+
/**
|
|
7579
|
+
* The **Compare with** action in the chart axis customization menu.
|
|
7580
|
+
* Allows comparing data across dimensions or measures.
|
|
7581
|
+
* @example
|
|
7582
|
+
* ```js
|
|
7583
|
+
* disabledActions: [Action.AxisMenuCompare]
|
|
7584
|
+
* ```
|
|
7585
|
+
* @version SDK: 1.50.0 | ThoughtSpot: 26.7.0.cl
|
|
7586
|
+
*/
|
|
7587
|
+
AxisMenuCompare = "axisMenuCompare",
|
|
7588
|
+
/**
|
|
7589
|
+
* The **Merge with** action in the chart axis customization menu.
|
|
7590
|
+
* Allows merging data across dimensions or measures.
|
|
7591
|
+
* @example
|
|
7592
|
+
* ```js
|
|
7593
|
+
* disabledActions: [Action.AxisMenuMerge]
|
|
7594
|
+
* ```
|
|
7595
|
+
* @version SDK: 1.50.0 | ThoughtSpot: 26.7.0.cl
|
|
7596
|
+
*/
|
|
7597
|
+
AxisMenuMerge = "axisMenuMerge",
|
|
7556
7598
|
/**
|
|
7557
7599
|
* @hidden
|
|
7558
7600
|
*/
|
|
@@ -8775,6 +8817,9 @@ export interface DefaultAppInitData {
|
|
|
8775
8817
|
customActions: CustomAction[];
|
|
8776
8818
|
interceptTimeout: number | undefined;
|
|
8777
8819
|
interceptUrls: (string | InterceptedApiType)[];
|
|
8820
|
+
embedExpiryInAuthToken: boolean;
|
|
8821
|
+
shouldBypassPayloadValidation?: boolean;
|
|
8822
|
+
useHostEventsV2?: boolean;
|
|
8778
8823
|
}
|
|
8779
8824
|
/**
|
|
8780
8825
|
* Enum for the type of API intercepted
|
|
@@ -8892,6 +8937,413 @@ export interface ContextObject {
|
|
|
8892
8937
|
objectIds: ObjectIds;
|
|
8893
8938
|
};
|
|
8894
8939
|
}
|
|
8940
|
+
export interface FontProperties {
|
|
8941
|
+
color?: string;
|
|
8942
|
+
bold?: boolean;
|
|
8943
|
+
italic?: boolean;
|
|
8944
|
+
strikeThrough?: boolean;
|
|
8945
|
+
underline?: boolean;
|
|
8946
|
+
}
|
|
8947
|
+
export interface SolidBackgroundAttrs {
|
|
8948
|
+
color?: string;
|
|
8949
|
+
}
|
|
8950
|
+
export interface GradientBackgroundAttrs {
|
|
8951
|
+
backgroundFormatMidpoint?: number;
|
|
8952
|
+
colors?: string[];
|
|
8953
|
+
backgroundFormatRange?: number[];
|
|
8954
|
+
isAutoScaled?: boolean;
|
|
8955
|
+
}
|
|
8956
|
+
/**
|
|
8957
|
+
* Data label filter operators
|
|
8958
|
+
* @group Visual Overrides
|
|
8959
|
+
*/
|
|
8960
|
+
export enum DataLabelFilterOperator {
|
|
8961
|
+
/** Greater than */
|
|
8962
|
+
GreaterThan = "GREATER_THAN",
|
|
8963
|
+
/** Less than */
|
|
8964
|
+
LessThan = "LESS_THAN",
|
|
8965
|
+
/** Greater than or equal to */
|
|
8966
|
+
GreaterThanOrEqualTo = "GREATER_THAN_OR_EQUAL_TO",
|
|
8967
|
+
/** Less than or equal to */
|
|
8968
|
+
LessThanOrEqualTo = "LESS_THAN_OR_EQUAL_TO",
|
|
8969
|
+
/** Equal to */
|
|
8970
|
+
EqualTo = "EQUAL_TO",
|
|
8971
|
+
/** Not equal to */
|
|
8972
|
+
NotEqualTo = "NOT_EQUAL_TO"
|
|
8973
|
+
}
|
|
8974
|
+
/**
|
|
8975
|
+
* Conditional formatting operators
|
|
8976
|
+
* @group Visual Overrides
|
|
8977
|
+
*/
|
|
8978
|
+
export enum ConditionalFormattingOperator {
|
|
8979
|
+
/** Is equal to */
|
|
8980
|
+
Is = "IS",
|
|
8981
|
+
/** Is not equal to */
|
|
8982
|
+
IsNot = "IS_NOT",
|
|
8983
|
+
/** Contains */
|
|
8984
|
+
Contains = "CONTAINS",
|
|
8985
|
+
/** Does not contain */
|
|
8986
|
+
DoesNotContain = "DOES_NOT_CONTAIN",
|
|
8987
|
+
/** Starts with */
|
|
8988
|
+
StartsWith = "STARTS_WITH",
|
|
8989
|
+
/** Ends with */
|
|
8990
|
+
EndsWith = "ENDS_WITH",
|
|
8991
|
+
/** Greater than */
|
|
8992
|
+
GreaterThan = "GREATER_THAN",
|
|
8993
|
+
/** Less than */
|
|
8994
|
+
LessThan = "LESS_THAN",
|
|
8995
|
+
/** Greater than or equal to */
|
|
8996
|
+
GreaterThanEqualTo = "GREATER_THAN_EQUAL_TO",
|
|
8997
|
+
/** Less than or equal to */
|
|
8998
|
+
LessThanEqualTo = "LESS_THAN_EQUAL_TO",
|
|
8999
|
+
/** Equal to */
|
|
9000
|
+
EqualTo = "EQUAL_TO",
|
|
9001
|
+
/** Not equal to */
|
|
9002
|
+
NotEqualTo = "NOT_EQUAL_TO",
|
|
9003
|
+
/** Is between */
|
|
9004
|
+
IsBetween = "IS_BETWEEN",
|
|
9005
|
+
/** Is null */
|
|
9006
|
+
IsNull = "IS_NULL",
|
|
9007
|
+
/** Is not null */
|
|
9008
|
+
IsNotNull = "IS_NOT_NULL"
|
|
9009
|
+
}
|
|
9010
|
+
/**
|
|
9011
|
+
* Background format types for conditional formatting
|
|
9012
|
+
* @group Visual Overrides
|
|
9013
|
+
*/
|
|
9014
|
+
export enum BackgroundFormatType {
|
|
9015
|
+
/** Solid color background */
|
|
9016
|
+
Solid = "SOLID",
|
|
9017
|
+
/** Gradient background */
|
|
9018
|
+
Gradient = "GRADIENT"
|
|
9019
|
+
}
|
|
9020
|
+
/**
|
|
9021
|
+
* Comparison types for conditional formatting
|
|
9022
|
+
* @group Visual Overrides
|
|
9023
|
+
*/
|
|
9024
|
+
export enum ConditionalFormattingComparisonType {
|
|
9025
|
+
/** Value-based comparison */
|
|
9026
|
+
ValueBased = "VALUE_BASED",
|
|
9027
|
+
/** Column-based comparison */
|
|
9028
|
+
ColumnBased = "COLUMN_BASED",
|
|
9029
|
+
/** Parameter-based comparison */
|
|
9030
|
+
ParameterBased = "PARAMETER_BASED"
|
|
9031
|
+
}
|
|
9032
|
+
/**
|
|
9033
|
+
* A single conditional formatting rule row
|
|
9034
|
+
* @group Visual Overrides
|
|
9035
|
+
*/
|
|
9036
|
+
export interface ConditionalFormattingRow {
|
|
9037
|
+
/** Comparison operator */
|
|
9038
|
+
operator: ConditionalFormattingOperator | string;
|
|
9039
|
+
/** Value to compare against */
|
|
9040
|
+
value?: string;
|
|
9041
|
+
/** Range values for range-based comparisons */
|
|
9042
|
+
rangeValues?: {
|
|
9043
|
+
min: number;
|
|
9044
|
+
max: number;
|
|
9045
|
+
};
|
|
9046
|
+
/** Plot the formatting as a band/area */
|
|
9047
|
+
plotAsBand?: boolean;
|
|
9048
|
+
/** Highlight this row if the condition is met */
|
|
9049
|
+
isHighlightRow?: boolean;
|
|
9050
|
+
/** Type of comparison: value-based, column-based, or parameter-based */
|
|
9051
|
+
comparisonType?: ConditionalFormattingComparisonType | string;
|
|
9052
|
+
/** Column ID to apply the formatting to (left-hand side) */
|
|
9053
|
+
lhsColumnId?: string;
|
|
9054
|
+
/** Column name to compare against (right-hand side) */
|
|
9055
|
+
columnToCompare?: string;
|
|
9056
|
+
/** Parameter ID to compare against */
|
|
9057
|
+
comparisonParameterId?: string;
|
|
9058
|
+
/** Font properties to apply (color, bold, italic, etc.) */
|
|
9059
|
+
fontProperties?: FontProperties;
|
|
9060
|
+
/** Background format type: solid color or gradient */
|
|
9061
|
+
backgroundFormatType?: BackgroundFormatType | string;
|
|
9062
|
+
/** Solid background color attributes */
|
|
9063
|
+
solidBackgroundAttrs?: SolidBackgroundAttrs;
|
|
9064
|
+
/** Gradient background attributes */
|
|
9065
|
+
gradientBackgroundAttrs?: GradientBackgroundAttrs;
|
|
9066
|
+
}
|
|
9067
|
+
/**
|
|
9068
|
+
* Conditional formatting configuration
|
|
9069
|
+
* @group Visual Overrides
|
|
9070
|
+
*/
|
|
9071
|
+
export interface ConditionalFormatting {
|
|
9072
|
+
/** Array of conditional formatting rules */
|
|
9073
|
+
rows?: ConditionalFormattingRow[];
|
|
9074
|
+
}
|
|
9075
|
+
/**
|
|
9076
|
+
* Color palette for charts
|
|
9077
|
+
* @group Visual Overrides
|
|
9078
|
+
*/
|
|
9079
|
+
export interface ColorPalette {
|
|
9080
|
+
/** Array of color values (hex codes or color names) */
|
|
9081
|
+
colors?: string[];
|
|
9082
|
+
}
|
|
9083
|
+
/**
|
|
9084
|
+
* Legend position options
|
|
9085
|
+
* @group Visual Overrides
|
|
9086
|
+
*/
|
|
9087
|
+
export enum LegendPosition {
|
|
9088
|
+
/** Position legend at the top */
|
|
9089
|
+
Top = "top",
|
|
9090
|
+
/** Position legend at the bottom */
|
|
9091
|
+
Bottom = "bottom",
|
|
9092
|
+
/** Position legend on the left */
|
|
9093
|
+
Left = "left",
|
|
9094
|
+
/** Position legend on the right */
|
|
9095
|
+
Right = "right"
|
|
9096
|
+
}
|
|
9097
|
+
/**
|
|
9098
|
+
* Table theme options
|
|
9099
|
+
* @group Visual Overrides
|
|
9100
|
+
*/
|
|
9101
|
+
export enum TableTheme {
|
|
9102
|
+
/** Outline theme */
|
|
9103
|
+
Outline = "OUTLINE",
|
|
9104
|
+
/** Row theme */
|
|
9105
|
+
Row = "ROW",
|
|
9106
|
+
/** Zebra theme */
|
|
9107
|
+
Zebra = "ZEBRA"
|
|
9108
|
+
}
|
|
9109
|
+
/**
|
|
9110
|
+
* Table content density options
|
|
9111
|
+
* @group Visual Overrides
|
|
9112
|
+
*/
|
|
9113
|
+
export enum TableContentDensity {
|
|
9114
|
+
/** Regular density */
|
|
9115
|
+
Regular = "REGULAR",
|
|
9116
|
+
/** Compact density */
|
|
9117
|
+
Compact = "COMPACT"
|
|
9118
|
+
}
|
|
9119
|
+
/**
|
|
9120
|
+
* Chart legend configuration
|
|
9121
|
+
* @group Visual Overrides
|
|
9122
|
+
*/
|
|
9123
|
+
export interface ChartLegend {
|
|
9124
|
+
/** Show or hide the legend */
|
|
9125
|
+
show?: boolean;
|
|
9126
|
+
/** Position of the legend */
|
|
9127
|
+
position?: LegendPosition | string;
|
|
9128
|
+
/** Color palette to use for legend colors */
|
|
9129
|
+
colorPalette?: ColorPalette;
|
|
9130
|
+
}
|
|
9131
|
+
/**
|
|
9132
|
+
* Filter for data labels
|
|
9133
|
+
* @group Visual Overrides
|
|
9134
|
+
*/
|
|
9135
|
+
export interface DataLabelFilter {
|
|
9136
|
+
/** Filter threshold value */
|
|
9137
|
+
value?: number;
|
|
9138
|
+
/** Filter operator */
|
|
9139
|
+
operator?: DataLabelFilterOperator | string;
|
|
9140
|
+
}
|
|
9141
|
+
/**
|
|
9142
|
+
* Data label configuration for a specific column
|
|
9143
|
+
* @group Visual Overrides
|
|
9144
|
+
*/
|
|
9145
|
+
export interface ColumnDataLabel {
|
|
9146
|
+
/** Column name to apply data label overrides to */
|
|
9147
|
+
name: string;
|
|
9148
|
+
/** Show or hide data labels for this column */
|
|
9149
|
+
visible?: boolean;
|
|
9150
|
+
/** Filter to apply to data labels */
|
|
9151
|
+
filter?: DataLabelFilter | null;
|
|
9152
|
+
}
|
|
9153
|
+
/**
|
|
9154
|
+
* Chart data label configuration
|
|
9155
|
+
* @group Visual Overrides
|
|
9156
|
+
*/
|
|
9157
|
+
export interface ChartDataLabel {
|
|
9158
|
+
/** Show labels for all data points */
|
|
9159
|
+
allLabels?: boolean;
|
|
9160
|
+
/** Show labels for stacked values */
|
|
9161
|
+
stackLabels?: boolean;
|
|
9162
|
+
/** Per-column data label configurations */
|
|
9163
|
+
columnDataLabel?: ColumnDataLabel[];
|
|
9164
|
+
}
|
|
9165
|
+
/**
|
|
9166
|
+
* Chart summaries and totals configuration
|
|
9167
|
+
* @group Visual Overrides
|
|
9168
|
+
*/
|
|
9169
|
+
export interface ChartSummaries {
|
|
9170
|
+
/** Show row totals */
|
|
9171
|
+
showRowTotals?: boolean;
|
|
9172
|
+
/** Show column totals */
|
|
9173
|
+
showColumnTotals?: boolean;
|
|
9174
|
+
/** Show row grand totals */
|
|
9175
|
+
showRowGrandTotals?: boolean;
|
|
9176
|
+
/** Show column grand totals */
|
|
9177
|
+
showColumnGrandTotals?: boolean;
|
|
9178
|
+
}
|
|
9179
|
+
/**
|
|
9180
|
+
* Gridline configuration
|
|
9181
|
+
* @group Visual Overrides
|
|
9182
|
+
*/
|
|
9183
|
+
export interface GridLine {
|
|
9184
|
+
/** Show vertical gridlines */
|
|
9185
|
+
x?: boolean;
|
|
9186
|
+
/** Show horizontal gridlines */
|
|
9187
|
+
y?: boolean;
|
|
9188
|
+
}
|
|
9189
|
+
/**
|
|
9190
|
+
* Chart display configuration
|
|
9191
|
+
* @group Visual Overrides
|
|
9192
|
+
*/
|
|
9193
|
+
export interface ChartDisplay {
|
|
9194
|
+
/** Summary and totals configuration */
|
|
9195
|
+
summaries?: ChartSummaries;
|
|
9196
|
+
/** Show regression line on chart */
|
|
9197
|
+
regressionLine?: boolean;
|
|
9198
|
+
/** Gridline visibility configuration */
|
|
9199
|
+
gridLine?: GridLine;
|
|
9200
|
+
}
|
|
9201
|
+
/**
|
|
9202
|
+
* Y-axis range configuration
|
|
9203
|
+
* @group Visual Overrides
|
|
9204
|
+
*/
|
|
9205
|
+
export interface YAxisRange {
|
|
9206
|
+
/** Minimum value for Y-axis */
|
|
9207
|
+
min?: number;
|
|
9208
|
+
/** Maximum value for Y-axis */
|
|
9209
|
+
max?: number;
|
|
9210
|
+
}
|
|
9211
|
+
/**
|
|
9212
|
+
* Chart axis configuration
|
|
9213
|
+
* @group Visual Overrides
|
|
9214
|
+
*/
|
|
9215
|
+
export interface ChartAxis {
|
|
9216
|
+
/** Column names to link to this axis */
|
|
9217
|
+
linkedColumns?: string[];
|
|
9218
|
+
/** Show the axis name */
|
|
9219
|
+
showName?: boolean;
|
|
9220
|
+
/** Show the axis label values */
|
|
9221
|
+
showLabelValue?: boolean;
|
|
9222
|
+
/** Y-axis range configuration */
|
|
9223
|
+
yAxisRange?: YAxisRange;
|
|
9224
|
+
}
|
|
9225
|
+
/**
|
|
9226
|
+
* Chart column override configuration
|
|
9227
|
+
* @group Visual Overrides
|
|
9228
|
+
*/
|
|
9229
|
+
export interface ChartColumn {
|
|
9230
|
+
/** Column name to apply overrides to */
|
|
9231
|
+
name: string;
|
|
9232
|
+
/** Color for the column (hex code) */
|
|
9233
|
+
color?: string;
|
|
9234
|
+
/** Conditional formatting rules to apply to the column */
|
|
9235
|
+
conditionalFormatting?: ConditionalFormatting;
|
|
9236
|
+
}
|
|
9237
|
+
/**
|
|
9238
|
+
* Chart visualization overrides
|
|
9239
|
+
* @group Visual Overrides
|
|
9240
|
+
*/
|
|
9241
|
+
export interface ChartOverrides {
|
|
9242
|
+
/** Legend configuration */
|
|
9243
|
+
legend?: ChartLegend;
|
|
9244
|
+
/** Data label configuration */
|
|
9245
|
+
dataLabel?: ChartDataLabel;
|
|
9246
|
+
/** Display properties (summaries, regression line, gridlines) */
|
|
9247
|
+
display?: ChartDisplay;
|
|
9248
|
+
/** Per-axis configurations */
|
|
9249
|
+
axis?: ChartAxis[];
|
|
9250
|
+
/** Per-column configurations */
|
|
9251
|
+
columns?: ChartColumn[];
|
|
9252
|
+
/** Update mask paths for partial updates */
|
|
9253
|
+
updateMaskPaths?: string[];
|
|
9254
|
+
}
|
|
9255
|
+
/**
|
|
9256
|
+
* Table column override configuration
|
|
9257
|
+
* @group Visual Overrides
|
|
9258
|
+
*/
|
|
9259
|
+
export interface TableColumn {
|
|
9260
|
+
/**
|
|
9261
|
+
* Name of the column to apply overrides to
|
|
9262
|
+
*/
|
|
9263
|
+
name: string;
|
|
9264
|
+
/**
|
|
9265
|
+
* Enable or disable text wrapping for the column
|
|
9266
|
+
*/
|
|
9267
|
+
wrapText?: boolean;
|
|
9268
|
+
/**
|
|
9269
|
+
* Show or hide the column
|
|
9270
|
+
*/
|
|
9271
|
+
show?: boolean;
|
|
9272
|
+
/**
|
|
9273
|
+
* Conditional formatting rules to apply to the column
|
|
9274
|
+
*/
|
|
9275
|
+
conditionalFormatting?: ConditionalFormatting;
|
|
9276
|
+
}
|
|
9277
|
+
/**
|
|
9278
|
+
* Table display configuration
|
|
9279
|
+
* @group Visual Overrides
|
|
9280
|
+
*/
|
|
9281
|
+
export interface TableDisplay {
|
|
9282
|
+
/** Table theme */
|
|
9283
|
+
tableTheme?: TableTheme | string;
|
|
9284
|
+
/** Table content density */
|
|
9285
|
+
tableContentDensity?: TableContentDensity | string;
|
|
9286
|
+
}
|
|
9287
|
+
/**
|
|
9288
|
+
* Column summary visibility configuration
|
|
9289
|
+
* @group Visual Overrides
|
|
9290
|
+
*/
|
|
9291
|
+
export interface ColumnSummaryVisibility {
|
|
9292
|
+
/** Column ID to control summary visibility for */
|
|
9293
|
+
columnId: string;
|
|
9294
|
+
/** Show or hide summary for this column */
|
|
9295
|
+
visible: boolean;
|
|
9296
|
+
}
|
|
9297
|
+
/**
|
|
9298
|
+
* Display summary configuration
|
|
9299
|
+
* @group Visual Overrides
|
|
9300
|
+
*/
|
|
9301
|
+
export interface DisplaySummaryConfig {
|
|
9302
|
+
/** Show all column summaries by default */
|
|
9303
|
+
showAllSummaries?: boolean;
|
|
9304
|
+
/** Per-column summary visibility overrides */
|
|
9305
|
+
columnVisibility?: ColumnSummaryVisibility[];
|
|
9306
|
+
}
|
|
9307
|
+
/**
|
|
9308
|
+
* Table visualization overrides
|
|
9309
|
+
* @group Visual Overrides
|
|
9310
|
+
*/
|
|
9311
|
+
export interface TableOverrides {
|
|
9312
|
+
/** Per-column configurations (properties, conditional formatting) */
|
|
9313
|
+
columns?: TableColumn[];
|
|
9314
|
+
/** Table display properties (theme, density) */
|
|
9315
|
+
display?: TableDisplay;
|
|
9316
|
+
/** Summary/headline column visibility configuration */
|
|
9317
|
+
displaySummaryConfig?: DisplaySummaryConfig;
|
|
9318
|
+
/** Update mask paths for partial updates */
|
|
9319
|
+
updateMaskPaths?: string[];
|
|
9320
|
+
}
|
|
9321
|
+
/**
|
|
9322
|
+
* Visualization overrides to customize chart and table rendering
|
|
9323
|
+
* within embedded ThoughtSpot components.
|
|
9324
|
+
*
|
|
9325
|
+
* @group Visual Overrides
|
|
9326
|
+
* @example
|
|
9327
|
+
* ```js
|
|
9328
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
9329
|
+
* visualOverrides: {
|
|
9330
|
+
* chart: {
|
|
9331
|
+
* legend: { show: true, position: 'bottom' },
|
|
9332
|
+
* columns: [{ name: 'Revenue', color: '#1f77b4' }],
|
|
9333
|
+
* },
|
|
9334
|
+
* table: {
|
|
9335
|
+
* display: { tableTheme: 'ZEBRA', tableContentDensity: 'COMPACT' },
|
|
9336
|
+
* },
|
|
9337
|
+
* },
|
|
9338
|
+
* });
|
|
9339
|
+
* ```
|
|
9340
|
+
*/
|
|
9341
|
+
export interface VisualizationOverrides {
|
|
9342
|
+
/** Chart visualization overrides */
|
|
9343
|
+
chart?: ChartOverrides;
|
|
9344
|
+
/** Table visualization overrides */
|
|
9345
|
+
table?: TableOverrides;
|
|
9346
|
+
}
|
|
8895
9347
|
export interface LiveboardTab {
|
|
8896
9348
|
id: string;
|
|
8897
9349
|
name: string;
|
|
@@ -9362,6 +9814,7 @@ class TsEmbed {
|
|
|
9362
9814
|
* @returns
|
|
9363
9815
|
*/
|
|
9364
9816
|
protected createEmbedEventResponder: (eventPort: MessagePort | void, eventType: EmbedEvent) => (payload: any) => void;
|
|
9817
|
+
private shouldSkipEvent;
|
|
9365
9818
|
/**
|
|
9366
9819
|
* Executes all registered event handlers for a particular event type
|
|
9367
9820
|
* @param eventType The event type
|
|
@@ -10005,6 +10458,7 @@ export interface ConversationViewConfig extends SpotterEmbedViewConfig {
|
|
|
10005
10458
|
export interface SpotterAppInitData extends DefaultAppInitData {
|
|
10006
10459
|
embedParams?: {
|
|
10007
10460
|
spotterSidebarConfig?: SpotterSidebarViewConfig;
|
|
10461
|
+
visualOverridesParams?: VisualizationOverrides | null;
|
|
10008
10462
|
};
|
|
10009
10463
|
}
|
|
10010
10464
|
/**
|
|
@@ -10618,7 +11072,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
10618
11072
|
/**
|
|
10619
11073
|
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page
|
|
10620
11074
|
* following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
|
|
10621
|
-
* This feature is GA from version 26.5.0.cl
|
|
11075
|
+
* This feature is GA from version 26.5.0.cl. It is disabled by default in embed deployments.
|
|
10622
11076
|
*
|
|
10623
11077
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
10624
11078
|
* @type {boolean}
|
|
@@ -10822,6 +11276,11 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
10822
11276
|
* ```
|
|
10823
11277
|
*/
|
|
10824
11278
|
enableLiveboardDataCache?: boolean;
|
|
11279
|
+
/**
|
|
11280
|
+
* Visual overrides to customize the chart or table properties.
|
|
11281
|
+
* @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
|
|
11282
|
+
*/
|
|
11283
|
+
visualOverrides?: VisualizationOverrides;
|
|
10825
11284
|
}
|
|
10826
11285
|
/**
|
|
10827
11286
|
* APP_INIT data shape for AppEmbed.
|
|
@@ -11556,7 +12015,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, SearchLiveboardComm
|
|
|
11556
12015
|
/**
|
|
11557
12016
|
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page
|
|
11558
12017
|
* following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
|
|
11559
|
-
* This feature is GA from version 26.5.0.cl
|
|
12018
|
+
* This feature is GA from version 26.5.0.cl. It is disabled by default in embed deployments.
|
|
11560
12019
|
*
|
|
11561
12020
|
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
11562
12021
|
* @type {boolean}
|
|
@@ -12087,9 +12546,32 @@ export interface SearchViewConfig extends SearchLiveboardCommonViewConfig, Omit<
|
|
|
12087
12546
|
* ```
|
|
12088
12547
|
*/
|
|
12089
12548
|
focusSearchBarOnRender?: boolean;
|
|
12549
|
+
/**
|
|
12550
|
+
* Enable or disable Muze chart phase 1 GA
|
|
12551
|
+
*
|
|
12552
|
+
* Supported embed types: `SearchEmbed`
|
|
12553
|
+
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
|
|
12554
|
+
* @default false
|
|
12555
|
+
* @example
|
|
12556
|
+
* ```js
|
|
12557
|
+
* const embed = new SearchEmbed('#tsEmbed', {
|
|
12558
|
+
* ... // other embed view config
|
|
12559
|
+
* newChartsLibrary: true,
|
|
12560
|
+
* })
|
|
12561
|
+
* ```
|
|
12562
|
+
*/
|
|
12563
|
+
newChartsLibrary?: boolean;
|
|
12564
|
+
/**
|
|
12565
|
+
* Visual overrides to customize the chart or table properties.
|
|
12566
|
+
* @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
|
|
12567
|
+
*/
|
|
12568
|
+
visualOverrides?: VisualizationOverrides;
|
|
12090
12569
|
}
|
|
12091
12570
|
export interface SearchAppInitData extends DefaultAppInitData {
|
|
12092
12571
|
searchOptions?: SearchOptions$1;
|
|
12572
|
+
embedParams?: {
|
|
12573
|
+
visualOverridesParams?: VisualizationOverrides | null;
|
|
12574
|
+
};
|
|
12093
12575
|
}
|
|
12094
12576
|
/**
|
|
12095
12577
|
* Embed ThoughtSpot search
|
package/package.json
CHANGED
package/src/auth.spec.ts
CHANGED
|
@@ -450,7 +450,7 @@ describe('Unit test for auth', () => {
|
|
|
450
450
|
|
|
451
451
|
it('should support emitting SAML_POPUP_CLOSED_NO_AUTH event', () => {
|
|
452
452
|
const emitSpy = jest.fn();
|
|
453
|
-
const mockEventEmitter = {
|
|
453
|
+
const mockEventEmitter = {
|
|
454
454
|
emit: emitSpy,
|
|
455
455
|
once: jest.fn()
|
|
456
456
|
};
|
|
@@ -460,6 +460,60 @@ describe('Unit test for auth', () => {
|
|
|
460
460
|
authInstance.setAuthEE(null);
|
|
461
461
|
});
|
|
462
462
|
|
|
463
|
+
it('should set loggedInStatus from cachedAuthToken without calling isLoggedIn again after popup flow', async () => {
|
|
464
|
+
Object.defineProperty(window, 'location', { value: { href: '', hash: '' } });
|
|
465
|
+
checkReleaseVersionInBetaInstance.storeValueInWindow('cachedAuthToken', 'test-cached-token');
|
|
466
|
+
(authInstance as any).samlCompletionPromise = Promise.resolve();
|
|
467
|
+
global.window.open = jest.fn();
|
|
468
|
+
|
|
469
|
+
jest.spyOn(tokenAuthService, 'isActiveService')
|
|
470
|
+
.mockReturnValueOnce(Promise.resolve(false));
|
|
471
|
+
|
|
472
|
+
await authInstance.doSamlAuth({ ...embedConfig.doSamlAuthNoRedirect });
|
|
473
|
+
|
|
474
|
+
expect(authInstance.loggedInStatus).toBe(true);
|
|
475
|
+
expect(tokenAuthService.isActiveService).toHaveBeenCalledTimes(1);
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
it('should store decoded accessToken in window when SAMLComplete event includes accessToken', async () => {
|
|
479
|
+
Object.defineProperty(window, 'location', { value: { href: '', hash: '' } });
|
|
480
|
+
global.window.open = jest.fn().mockReturnValue({ closed: false, focus: jest.fn(), close: jest.fn() });
|
|
481
|
+
|
|
482
|
+
(authInstance as any).samlCompletionPromise = null;
|
|
483
|
+
|
|
484
|
+
let capturedMessageHandler: ((e: any) => void) | null = null;
|
|
485
|
+
jest.spyOn(window, 'addEventListener').mockImplementation((type: any, handler: any) => {
|
|
486
|
+
if (type === 'message') {
|
|
487
|
+
capturedMessageHandler = handler;
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
jest.spyOn(tokenAuthService, 'isActiveService')
|
|
492
|
+
.mockReturnValueOnce(Promise.resolve(false));
|
|
493
|
+
|
|
494
|
+
const authPromise = authInstance.doSamlAuth({ ...embedConfig.doSamlAuthNoRedirect });
|
|
495
|
+
|
|
496
|
+
await new Promise<void>((resolve) => setTimeout(resolve, 0));
|
|
497
|
+
|
|
498
|
+
expect(capturedMessageHandler).not.toBeNull();
|
|
499
|
+
|
|
500
|
+
const accessToken = 'my-access-token';
|
|
501
|
+
capturedMessageHandler!({
|
|
502
|
+
data: {
|
|
503
|
+
type: EmbedEvent.SAMLComplete,
|
|
504
|
+
accessToken: encodeURIComponent(accessToken),
|
|
505
|
+
},
|
|
506
|
+
source: { close: jest.fn() },
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
await authPromise;
|
|
510
|
+
|
|
511
|
+
expect(
|
|
512
|
+
checkReleaseVersionInBetaInstance.getValueFromWindow('cachedAuthToken'),
|
|
513
|
+
).toBe(accessToken);
|
|
514
|
+
expect(authInstance.loggedInStatus).toBe(true);
|
|
515
|
+
});
|
|
516
|
+
|
|
463
517
|
});
|
|
464
518
|
|
|
465
519
|
describe('doOIDCAuth', () => {
|