@thoughtspot/visual-embed-sdk 1.45.3 → 1.46.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.
Files changed (50) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/auth.d.ts +35 -2
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +35 -2
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts.map +1 -1
  7. package/cjs/src/embed/app.js +5 -5
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/app.spec.js +87 -119
  10. package/cjs/src/embed/app.spec.js.map +1 -1
  11. package/cjs/src/embed/conversation.d.ts +1 -1
  12. package/cjs/src/types.d.ts +56 -52
  13. package/cjs/src/types.d.ts.map +1 -1
  14. package/cjs/src/types.js +55 -51
  15. package/cjs/src/types.js.map +1 -1
  16. package/dist/{index-BuwECGdm.js → index-BQvLEoxp.js} +1 -1
  17. package/dist/src/auth.d.ts +35 -2
  18. package/dist/src/auth.d.ts.map +1 -1
  19. package/dist/src/embed/app.d.ts.map +1 -1
  20. package/dist/src/embed/conversation.d.ts +1 -1
  21. package/dist/src/types.d.ts +56 -52
  22. package/dist/src/types.d.ts.map +1 -1
  23. package/dist/tsembed-react.es.js +98 -61
  24. package/dist/tsembed-react.js +97 -60
  25. package/dist/tsembed.es.js +98 -61
  26. package/dist/tsembed.js +97 -60
  27. package/dist/visual-embed-sdk-react-full.d.ts +92 -55
  28. package/dist/visual-embed-sdk-react.d.ts +90 -53
  29. package/dist/visual-embed-sdk.d.ts +92 -55
  30. package/lib/package.json +1 -1
  31. package/lib/src/auth.d.ts +35 -2
  32. package/lib/src/auth.d.ts.map +1 -1
  33. package/lib/src/auth.js +35 -2
  34. package/lib/src/auth.js.map +1 -1
  35. package/lib/src/embed/app.d.ts.map +1 -1
  36. package/lib/src/embed/app.js +5 -5
  37. package/lib/src/embed/app.js.map +1 -1
  38. package/lib/src/embed/app.spec.js +87 -119
  39. package/lib/src/embed/app.spec.js.map +1 -1
  40. package/lib/src/embed/conversation.d.ts +1 -1
  41. package/lib/src/types.d.ts +56 -52
  42. package/lib/src/types.d.ts.map +1 -1
  43. package/lib/src/types.js +55 -51
  44. package/lib/src/types.js.map +1 -1
  45. package/package.json +1 -1
  46. package/src/auth.ts +35 -2
  47. package/src/embed/app.spec.ts +171 -211
  48. package/src/embed/app.ts +15 -10
  49. package/src/embed/conversation.ts +1 -1
  50. package/src/types.ts +57 -53
@@ -2210,7 +2210,7 @@ export interface SearchLiveboardCommonViewConfig {
2210
2210
  *
2211
2211
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
2212
2212
  * @default true
2213
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
2213
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
2214
2214
  * @example
2215
2215
  * ```js
2216
2216
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -3653,65 +3653,69 @@ export declare enum EmbedEvent {
3653
3653
  Rename = "rename",
3654
3654
  /**
3655
3655
  *
3656
- * This event can be emitted to intercept search execution initiated by
3657
- * users and implement logic to allow or restrict search execution.
3658
- * You can also show custom error text if the search query must be
3659
- * restricted due to your application or business requirements.
3660
-
3661
- * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
3662
- * for this embed event to get emitted.
3663
- * @param - Includes the following event listener parameters:
3656
+ * This event allows developers to intercept search execution
3657
+ * and implement logic that decides whether Search Data should return
3658
+ * data or block the search operation.
3659
+ *
3660
+ * **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
3661
+ * to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
3662
+ * when the embedding application user tries to run a search query.
3663
+ *
3664
+ * This framework applies only to `AppEmbed` and `SearchEmbed`.
3665
+ * @param - Includes the following parameters:
3664
3666
  * - `payload`: The payload received from the embed related to the Data API call.
3665
3667
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
3666
- * should run the search, and if not, what error message
3667
- * should be shown to the user.
3668
+ * will run or block the search operation, and if blocked, which error message to provide.
3668
3669
  *
3669
- * `execute` - When `execute` returns `true`, the search will be run.
3670
- * When `execute` returns `false`, the search will not be executed.
3670
+ * `execute` - When `execute` returns `true`, the search is run.
3671
+ * When `execute` returns `false`, the search is not executed.
3671
3672
  *
3672
- * `error` - Developers can customize the error message text when `execute`
3673
- * is `false` using the `errorText` and `errorDescription` parameters in responder.
3674
- *
3675
- * `errorText` - The error message text to be shown to the user.
3676
- * `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
3673
+ * `error` - Developers can customize the user-facing error message when `execute`
3674
+ * is `false` by using the `error` parameters in `responder`.
3675
+ * `errorText` - The error message text shown to the user.
3677
3676
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
3678
3677
  * @example
3679
- *```js
3680
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
3681
- * (payload, responder) => {
3682
- * responder({
3683
- * data: {
3684
- * execute:false,
3685
- * error: {
3686
- * //Provide a custom error message to explain to your end user
3687
- * //why their search did not run
3688
- * errorText: "This search query cannot be run.
3689
- * Please contact your administrator for more details."
3690
- * }
3691
- * }})
3692
- * })
3678
+ *
3679
+ * This example blocks search operation and returns a custom error message:
3680
+ * ```js
3681
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3682
+ * responder({
3683
+ * data: {
3684
+ * execute: false,
3685
+ * error: {
3686
+ * // Provide a custom error message to explain why the search did not run.
3687
+ * errorText: 'This search query cannot be run. Please contact your administrator for more details.',
3688
+ * },
3689
+ * },
3690
+ * });
3691
+ * });
3693
3692
  * ```
3693
+ * @example
3694
3694
  *
3695
- *```js
3696
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
3697
- * (payload, responder) => {
3698
- * const query = payload.data.data.answer.search_query
3699
- * responder({
3700
- * data: {
3701
- * // returns true as long as the query does not include
3702
- * // both the 'sales' AND the 'county' column
3703
- * execute: !(query.includes("sales")&&query.includes("county")),
3704
- * error: {
3705
- * //Provide a custom error message to explain to your end user
3706
- * // why their search did not run, and which searches are accepted by your custom logic.
3707
- * errorText: "Error Occurred",
3708
- * errorDescription: "You can't use this query :" + query + ".
3709
- * The 'sales' measures can never be used at the 'county' level.
3710
- * Please try another measure, or remove 'county' from your search."
3711
- * }
3712
- * }})
3713
- * })
3714
- *```
3695
+ * This example allows the search operation to run
3696
+ * unless the query contains both `sales` and `county`,
3697
+ * and returns a custom error message if the query is rejected:
3698
+ * ```js
3699
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3700
+ * // Record the search query submitted by the end user.
3701
+ * const query = payload.data.data.answer.search_query;
3702
+ *
3703
+ * responder({
3704
+ * data: {
3705
+ * // Returns true as long as the query does not include both `sales` and `county`.
3706
+ * execute: !(query.includes('sales') && query.includes('county')),
3707
+ * error: {
3708
+ * // Provide a custom error message when the query is blocked by your logic.
3709
+ * errorText:
3710
+ * "You can't use this query: "
3711
+ * + query
3712
+ * + ". The 'sales' measure can never be used at the 'county' level. "
3713
+ * + "Please try another measure or remove 'county' from your search.",
3714
+ * },
3715
+ * },
3716
+ * });
3717
+ * });
3718
+ * ```
3715
3719
  */
3716
3720
  OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
3717
3721
  /**
@@ -7395,16 +7399,49 @@ export interface ContextObject {
7395
7399
  };
7396
7400
  }
7397
7401
  /**
7398
- * Enum for auth failure types. This is the parameter passed to the listner
7399
- * of {@link AuthStatus.FAILURE}.
7402
+ * Enum for auth failure types.
7403
+ * This value is passed to the listener for {@link AuthStatus.FAILURE}.
7400
7404
  * @group Authentication / Init
7401
7405
  */
7402
7406
  export declare enum AuthFailureType {
7407
+ /**
7408
+ * Authentication failed in the SDK authentication flow.
7409
+ *
7410
+ * Emitted when `init()` or auto-authentication cannot establish a logged-in session.
7411
+ * For example, this can happen because of an invalid token, an auth request failure,
7412
+ * or an auth promise rejection.
7413
+ */
7403
7414
  SDK = "SDK",
7415
+ /**
7416
+ * Browser cookie access is blocked for the embedded app.
7417
+ *
7418
+ * Emitted when the iframe reports that required cookies
7419
+ * cannot be read or sent, commonly due to third-party cookie restrictions.
7420
+ */
7404
7421
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
7422
+ /**
7423
+ * The current authentication token or session has expired.
7424
+ *
7425
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
7426
+ */
7405
7427
  EXPIRY = "EXPIRY",
7428
+ /**
7429
+ * A generic authentication failure that does not match a more specific type.
7430
+ *
7431
+ * Emitted as a fallback for app-reported auth failures in standard auth flows.
7432
+ */
7406
7433
  OTHER = "OTHER",
7434
+ /**
7435
+ * The user session timed out due to inactivity.
7436
+ *
7437
+ * Emitted when the app reports an idle-session timeout.
7438
+ */
7407
7439
  IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
7440
+ /**
7441
+ * The app reports that the user is unauthenticated.
7442
+ *
7443
+ * Used primarily to classify unauthenticated failures in Embedded SSO flows.
7444
+ */
7408
7445
  UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
7409
7446
  }
7410
7447
  /**
@@ -8805,7 +8842,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
8805
8842
  *
8806
8843
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
8807
8844
  * @default true
8808
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
8845
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
8809
8846
  * @example
8810
8847
  * ```js
8811
8848
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -2210,7 +2210,7 @@ export interface SearchLiveboardCommonViewConfig {
2210
2210
  *
2211
2211
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
2212
2212
  * @default true
2213
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
2213
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
2214
2214
  * @example
2215
2215
  * ```js
2216
2216
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -3666,65 +3666,69 @@ export declare enum EmbedEvent {
3666
3666
  Rename = "rename",
3667
3667
  /**
3668
3668
  *
3669
- * This event can be emitted to intercept search execution initiated by
3670
- * users and implement logic to allow or restrict search execution.
3671
- * You can also show custom error text if the search query must be
3672
- * restricted due to your application or business requirements.
3673
-
3674
- * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
3675
- * for this embed event to get emitted.
3676
- * @param - Includes the following event listener parameters:
3669
+ * This event allows developers to intercept search execution
3670
+ * and implement logic that decides whether Search Data should return
3671
+ * data or block the search operation.
3672
+ *
3673
+ * **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
3674
+ * to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
3675
+ * when the embedding application user tries to run a search query.
3676
+ *
3677
+ * This framework applies only to `AppEmbed` and `SearchEmbed`.
3678
+ * @param - Includes the following parameters:
3677
3679
  * - `payload`: The payload received from the embed related to the Data API call.
3678
3680
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
3679
- * should run the search, and if not, what error message
3680
- * should be shown to the user.
3681
+ * will run or block the search operation, and if blocked, which error message to provide.
3681
3682
  *
3682
- * `execute` - When `execute` returns `true`, the search will be run.
3683
- * When `execute` returns `false`, the search will not be executed.
3683
+ * `execute` - When `execute` returns `true`, the search is run.
3684
+ * When `execute` returns `false`, the search is not executed.
3684
3685
  *
3685
- * `error` - Developers can customize the error message text when `execute`
3686
- * is `false` using the `errorText` and `errorDescription` parameters in responder.
3687
- *
3688
- * `errorText` - The error message text to be shown to the user.
3689
- * `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
3686
+ * `error` - Developers can customize the user-facing error message when `execute`
3687
+ * is `false` by using the `error` parameters in `responder`.
3688
+ * `errorText` - The error message text shown to the user.
3690
3689
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
3691
3690
  * @example
3692
- *```js
3693
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
3694
- * (payload, responder) => {
3695
- * responder({
3696
- * data: {
3697
- * execute:false,
3698
- * error: {
3699
- * //Provide a custom error message to explain to your end user
3700
- * //why their search did not run
3701
- * errorText: "This search query cannot be run.
3702
- * Please contact your administrator for more details."
3703
- * }
3704
- * }})
3705
- * })
3691
+ *
3692
+ * This example blocks search operation and returns a custom error message:
3693
+ * ```js
3694
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3695
+ * responder({
3696
+ * data: {
3697
+ * execute: false,
3698
+ * error: {
3699
+ * // Provide a custom error message to explain why the search did not run.
3700
+ * errorText: 'This search query cannot be run. Please contact your administrator for more details.',
3701
+ * },
3702
+ * },
3703
+ * });
3704
+ * });
3706
3705
  * ```
3706
+ * @example
3707
3707
  *
3708
- *```js
3709
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
3710
- * (payload, responder) => {
3711
- * const query = payload.data.data.answer.search_query
3712
- * responder({
3713
- * data: {
3714
- * // returns true as long as the query does not include
3715
- * // both the 'sales' AND the 'county' column
3716
- * execute: !(query.includes("sales")&&query.includes("county")),
3717
- * error: {
3718
- * //Provide a custom error message to explain to your end user
3719
- * // why their search did not run, and which searches are accepted by your custom logic.
3720
- * errorText: "Error Occurred",
3721
- * errorDescription: "You can't use this query :" + query + ".
3722
- * The 'sales' measures can never be used at the 'county' level.
3723
- * Please try another measure, or remove 'county' from your search."
3724
- * }
3725
- * }})
3726
- * })
3727
- *```
3708
+ * This example allows the search operation to run
3709
+ * unless the query contains both `sales` and `county`,
3710
+ * and returns a custom error message if the query is rejected:
3711
+ * ```js
3712
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3713
+ * // Record the search query submitted by the end user.
3714
+ * const query = payload.data.data.answer.search_query;
3715
+ *
3716
+ * responder({
3717
+ * data: {
3718
+ * // Returns true as long as the query does not include both `sales` and `county`.
3719
+ * execute: !(query.includes('sales') && query.includes('county')),
3720
+ * error: {
3721
+ * // Provide a custom error message when the query is blocked by your logic.
3722
+ * errorText:
3723
+ * "You can't use this query: "
3724
+ * + query
3725
+ * + ". The 'sales' measure can never be used at the 'county' level. "
3726
+ * + "Please try another measure or remove 'county' from your search.",
3727
+ * },
3728
+ * },
3729
+ * });
3730
+ * });
3731
+ * ```
3728
3732
  */
3729
3733
  OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
3730
3734
  /**
@@ -7384,11 +7388,44 @@ export interface ContextObject {
7384
7388
  };
7385
7389
  }
7386
7390
  declare enum AuthFailureType {
7391
+ /**
7392
+ * Authentication failed in the SDK authentication flow.
7393
+ *
7394
+ * Emitted when `init()` or auto-authentication cannot establish a logged-in session.
7395
+ * For example, this can happen because of an invalid token, an auth request failure,
7396
+ * or an auth promise rejection.
7397
+ */
7387
7398
  SDK = "SDK",
7399
+ /**
7400
+ * Browser cookie access is blocked for the embedded app.
7401
+ *
7402
+ * Emitted when the iframe reports that required cookies
7403
+ * cannot be read or sent, commonly due to third-party cookie restrictions.
7404
+ */
7388
7405
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
7406
+ /**
7407
+ * The current authentication token or session has expired.
7408
+ *
7409
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
7410
+ */
7389
7411
  EXPIRY = "EXPIRY",
7412
+ /**
7413
+ * A generic authentication failure that does not match a more specific type.
7414
+ *
7415
+ * Emitted as a fallback for app-reported auth failures in standard auth flows.
7416
+ */
7390
7417
  OTHER = "OTHER",
7418
+ /**
7419
+ * The user session timed out due to inactivity.
7420
+ *
7421
+ * Emitted when the app reports an idle-session timeout.
7422
+ */
7391
7423
  IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
7424
+ /**
7425
+ * The app reports that the user is unauthenticated.
7426
+ *
7427
+ * Used primarily to classify unauthenticated failures in Embedded SSO flows.
7428
+ */
7392
7429
  UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
7393
7430
  }
7394
7431
  declare enum AuthStatus {
@@ -8781,7 +8818,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
8781
8818
  *
8782
8819
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
8783
8820
  * @default true
8784
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
8821
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
8785
8822
  * @example
8786
8823
  * ```js
8787
8824
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -2261,7 +2261,7 @@ export interface SearchLiveboardCommonViewConfig {
2261
2261
  *
2262
2262
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
2263
2263
  * @default true
2264
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
2264
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
2265
2265
  * @example
2266
2266
  * ```js
2267
2267
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -3717,65 +3717,69 @@ export declare enum EmbedEvent {
3717
3717
  Rename = "rename",
3718
3718
  /**
3719
3719
  *
3720
- * This event can be emitted to intercept search execution initiated by
3721
- * users and implement logic to allow or restrict search execution.
3722
- * You can also show custom error text if the search query must be
3723
- * restricted due to your application or business requirements.
3724
-
3725
- * Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
3726
- * for this embed event to get emitted.
3727
- * @param - Includes the following event listener parameters:
3720
+ * This event allows developers to intercept search execution
3721
+ * and implement logic that decides whether Search Data should return
3722
+ * data or block the search operation.
3723
+ *
3724
+ * **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
3725
+ * to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
3726
+ * when the embedding application user tries to run a search query.
3727
+ *
3728
+ * This framework applies only to `AppEmbed` and `SearchEmbed`.
3729
+ * @param - Includes the following parameters:
3728
3730
  * - `payload`: The payload received from the embed related to the Data API call.
3729
3731
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
3730
- * should run the search, and if not, what error message
3731
- * should be shown to the user.
3732
+ * will run or block the search operation, and if blocked, which error message to provide.
3732
3733
  *
3733
- * `execute` - When `execute` returns `true`, the search will be run.
3734
- * When `execute` returns `false`, the search will not be executed.
3734
+ * `execute` - When `execute` returns `true`, the search is run.
3735
+ * When `execute` returns `false`, the search is not executed.
3735
3736
  *
3736
- * `error` - Developers can customize the error message text when `execute`
3737
- * is `false` using the `errorText` and `errorDescription` parameters in responder.
3738
- *
3739
- * `errorText` - The error message text to be shown to the user.
3740
- * `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
3737
+ * `error` - Developers can customize the user-facing error message when `execute`
3738
+ * is `false` by using the `error` parameters in `responder`.
3739
+ * `errorText` - The error message text shown to the user.
3741
3740
  * @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
3742
3741
  * @example
3743
- *```js
3744
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
3745
- * (payload, responder) => {
3746
- * responder({
3747
- * data: {
3748
- * execute:false,
3749
- * error: {
3750
- * //Provide a custom error message to explain to your end user
3751
- * //why their search did not run
3752
- * errorText: "This search query cannot be run.
3753
- * Please contact your administrator for more details."
3754
- * }
3755
- * }})
3756
- * })
3742
+ *
3743
+ * This example blocks search operation and returns a custom error message:
3744
+ * ```js
3745
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3746
+ * responder({
3747
+ * data: {
3748
+ * execute: false,
3749
+ * error: {
3750
+ * // Provide a custom error message to explain why the search did not run.
3751
+ * errorText: 'This search query cannot be run. Please contact your administrator for more details.',
3752
+ * },
3753
+ * },
3754
+ * });
3755
+ * });
3757
3756
  * ```
3757
+ * @example
3758
3758
  *
3759
- *```js
3760
- * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
3761
- * (payload, responder) => {
3762
- * const query = payload.data.data.answer.search_query
3763
- * responder({
3764
- * data: {
3765
- * // returns true as long as the query does not include
3766
- * // both the 'sales' AND the 'county' column
3767
- * execute: !(query.includes("sales")&&query.includes("county")),
3768
- * error: {
3769
- * //Provide a custom error message to explain to your end user
3770
- * // why their search did not run, and which searches are accepted by your custom logic.
3771
- * errorText: "Error Occurred",
3772
- * errorDescription: "You can't use this query :" + query + ".
3773
- * The 'sales' measures can never be used at the 'county' level.
3774
- * Please try another measure, or remove 'county' from your search."
3775
- * }
3776
- * }})
3777
- * })
3778
- *```
3759
+ * This example allows the search operation to run
3760
+ * unless the query contains both `sales` and `county`,
3761
+ * and returns a custom error message if the query is rejected:
3762
+ * ```js
3763
+ * embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
3764
+ * // Record the search query submitted by the end user.
3765
+ * const query = payload.data.data.answer.search_query;
3766
+ *
3767
+ * responder({
3768
+ * data: {
3769
+ * // Returns true as long as the query does not include both `sales` and `county`.
3770
+ * execute: !(query.includes('sales') && query.includes('county')),
3771
+ * error: {
3772
+ * // Provide a custom error message when the query is blocked by your logic.
3773
+ * errorText:
3774
+ * "You can't use this query: "
3775
+ * + query
3776
+ * + ". The 'sales' measure can never be used at the 'county' level. "
3777
+ * + "Please try another measure or remove 'county' from your search.",
3778
+ * },
3779
+ * },
3780
+ * });
3781
+ * });
3782
+ * ```
3779
3783
  */
3780
3784
  OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
3781
3785
  /**
@@ -8284,7 +8288,7 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, "primaryAct
8284
8288
  *
8285
8289
  * Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
8286
8290
  * @default true
8287
- * @version SDK: 1.41.1 | ThoughtSpot Cloud: 10.14.0.cl
8291
+ * @deprecated from SDK 1.46.0 | ThoughtSpot Cloud: 26.3.0.cl
8288
8292
  * @example
8289
8293
  * ```js
8290
8294
  * // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
@@ -9258,16 +9262,49 @@ export declare class AppEmbed extends V1Embed {
9258
9262
  render(): Promise<AppEmbed>;
9259
9263
  }
9260
9264
  /**
9261
- * Enum for auth failure types. This is the parameter passed to the listner
9262
- * of {@link AuthStatus.FAILURE}.
9265
+ * Enum for auth failure types.
9266
+ * This value is passed to the listener for {@link AuthStatus.FAILURE}.
9263
9267
  * @group Authentication / Init
9264
9268
  */
9265
9269
  export declare enum AuthFailureType {
9270
+ /**
9271
+ * Authentication failed in the SDK authentication flow.
9272
+ *
9273
+ * Emitted when `init()` or auto-authentication cannot establish a logged-in session.
9274
+ * For example, this can happen because of an invalid token, an auth request failure,
9275
+ * or an auth promise rejection.
9276
+ */
9266
9277
  SDK = "SDK",
9278
+ /**
9279
+ * Browser cookie access is blocked for the embedded app.
9280
+ *
9281
+ * Emitted when the iframe reports that required cookies
9282
+ * cannot be read or sent, commonly due to third-party cookie restrictions.
9283
+ */
9267
9284
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
9285
+ /**
9286
+ * The current authentication token or session has expired.
9287
+ *
9288
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
9289
+ */
9268
9290
  EXPIRY = "EXPIRY",
9291
+ /**
9292
+ * A generic authentication failure that does not match a more specific type.
9293
+ *
9294
+ * Emitted as a fallback for app-reported auth failures in standard auth flows.
9295
+ */
9269
9296
  OTHER = "OTHER",
9297
+ /**
9298
+ * The user session timed out due to inactivity.
9299
+ *
9300
+ * Emitted when the app reports an idle-session timeout.
9301
+ */
9270
9302
  IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
9303
+ /**
9304
+ * The app reports that the user is unauthenticated.
9305
+ *
9306
+ * Used primarily to classify unauthenticated failures in Embedded SSO flows.
9307
+ */
9271
9308
  UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
9272
9309
  }
9273
9310
  /**
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.45.3",
3
+ "version": "1.46.0",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/lib/src/auth.d.ts CHANGED
@@ -5,16 +5,49 @@ export declare let samlAuthWindow: Window;
5
5
  export declare let samlCompletionPromise: Promise<void>;
6
6
  export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
7
7
  /**
8
- * Enum for auth failure types. This is the parameter passed to the listner
9
- * of {@link AuthStatus.FAILURE}.
8
+ * Enum for auth failure types.
9
+ * This value is passed to the listener for {@link AuthStatus.FAILURE}.
10
10
  * @group Authentication / Init
11
11
  */
12
12
  export declare enum AuthFailureType {
13
+ /**
14
+ * Authentication failed in the SDK authentication flow.
15
+ *
16
+ * Emitted when `init()` or auto-authentication cannot establish a logged-in session.
17
+ * For example, this can happen because of an invalid token, an auth request failure,
18
+ * or an auth promise rejection.
19
+ */
13
20
  SDK = "SDK",
21
+ /**
22
+ * Browser cookie access is blocked for the embedded app.
23
+ *
24
+ * Emitted when the iframe reports that required cookies
25
+ * cannot be read or sent, commonly due to third-party cookie restrictions.
26
+ */
14
27
  NO_COOKIE_ACCESS = "NO_COOKIE_ACCESS",
28
+ /**
29
+ * The current authentication token or session has expired.
30
+ *
31
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
32
+ */
15
33
  EXPIRY = "EXPIRY",
34
+ /**
35
+ * A generic authentication failure that does not match a more specific type.
36
+ *
37
+ * Emitted as a fallback for app-reported auth failures in standard auth flows.
38
+ */
16
39
  OTHER = "OTHER",
40
+ /**
41
+ * The user session timed out due to inactivity.
42
+ *
43
+ * Emitted when the app reports an idle-session timeout.
44
+ */
17
45
  IDLE_SESSION_TIMEOUT = "IDLE_SESSION_TIMEOUT",
46
+ /**
47
+ * The app reports that the user is unauthenticated.
48
+ *
49
+ * Used primarily to classify unauthenticated failures in Embedded SSO flows.
50
+ */
18
51
  UNAUTHENTICATED_FAILURE = "UNAUTHENTICATED_FAILURE"
19
52
  }
20
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AAIzC,OAAO,EACoB,WAAW,EACrC,MAAM,SAAS,CAAC;AAgBjB,eAAO,IAAI,cAAc,SAAQ,CAAC;AAElC,eAAO,IAAI,cAAc,EAAE,MAAa,CAAC;AAEzC,eAAO,IAAI,qBAAqB,EAAE,OAAO,CAAC,IAAI,CAAQ,CAAC;AAIvD,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAElF;;;;GAIG;AACH,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,gBAAgB,qBAAqB;IACrC,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,oBAAoB,yBAAyB;IAC7C,uBAAuB,4BAA4B;CACtD;AAED;;;GAGG;AACH,oBAAY,UAAU;IAClB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,oBAAoB,yBAAyB;IAC7C;;OAEG;IACH,OAAO,YAAY;IACnB;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