@@ -1099,71 +1099,99 @@ export interface BaseViewConfig extends ApiInterceptFlags {
10991099 customActions ?: CustomAction [ ] ;
11001100
11011101 /**
1102- * Array of routes that are allowed to be accessed in the embedded app.
1103- * When specified, navigation will be restricted to only these routes.
1104- * Use Path.All to allow all routes without restrictions.
1105- *
1106- * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
1107- * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1108- * @example
1102+ * Route blocking configuration for the embedded app.
11091103 *
1110- * // Replace <EmbedComponent> with embed component name. For example, AppEmbed, SearchEmbed, or LiveboardEmbed
1111- * ```js
1112- * const embed = new AppEmbed('#tsEmbed', {
1113- * ... // other embed view config
1114- * allowedRoutes: [Path.Home, Path.Search, Path.Liveboards],
1115- * accessDeniedMessage: 'You do not have access to this page'
1116- * })```
1117- *
1118- * // Allow all routes
1119- * ```js
1120- * const embed = new AppEmbed('#tsEmbed', {
1121- * allowedRoutes: [Path.All]
1122- * })
1123- * ```
1124- */
1125- allowedRoutes ?: ( NavigationPath | string ) [ ] ;
1126-
1127- /**
1128- * Array of routes that are blocked from being accessed in the embedded app.
1129- * When specified, navigation will be restricted to only these routes.
1130- * Use Path.All to block all routes without restrictions.
1104+ * Control which routes users can navigate to within the embedded application
1105+ * using either an allowlist (`allowedRoutes`) or a blocklist (`blockedRoutes`).
11311106 *
1132- * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
1133- * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1134- * @example
1135- * ```js
1136- * const embed = new AppEmbed('#tsEmbed', {
1137- * blockedRoutes: [Path.Home, Path.Search, Path.Liveboards],
1138- * })
1139- * ```
1140- * // Block all routes
1141- * ```js
1142- * const embed = new AppEmbed('#tsEmbed', {
1143- * blockedRoutes: [Path.All]
1144- * })
1145- * ```
1146- */
1147- blockedRoutes ?: ( NavigationPath | string ) [ ] ;
1148- /**
1149- * Custom message to display when a user tries to access a route
1150- * that is not in the allowedRoutes list.
1107+ * **Important:**
1108+ * - `allowedRoutes` and `blockedRoutes` are mutually exclusive. Use only one at a time.
1109+ * - The path that the user initially embeds is always accessible, regardless of this configuration.
11511110 *
11521111 * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
1153- * @default 'Access Denied'
11541112 * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
11551113 * @example
1156- *
11571114 * ```js
11581115 * const embed = new AppEmbed('#tsEmbed', {
1159- * allowedRoutes: [Path.Home, Path.Liveboards],
1160- * accessDeniedMessage: 'You do not have permission to access this page.
1161- * Please contact your administrator.'
1116+ * ... // other embed view config
1117+ * routeBlocking: {
1118+ * allowedRoutes: [Path.Home, Path.Search, Path.Liveboards] || blockedRoutes: [Path.Admin, Path.Settings],
1119+ * accessDeniedMessage: 'You do not have access to this page'
1120+ * }
11621121 * })
11631122 * ```
11641123 */
1165- accessDeniedMessage ?: string ;
1166-
1124+ routeBlocking ?: {
1125+ /**
1126+ * Array of routes that are allowed to be accessed in the embedded app.
1127+ * When specified, navigation will be restricted to only these routes.
1128+ * All other routes will be blocked.
1129+ * Use Path.All to allow all routes without restrictions.
1130+ *
1131+ * **Important:** The path that the user initially embeds is always unblocked
1132+ * and accessible, regardless of the
1133+ * `allowedRoutes` or `blockedRoutes` configuration.
1134+ *
1135+ * Note: `allowedRoutes` and `blockedRoutes` are mutually exclusive.
1136+ * Use only one at a time.
1137+ *
1138+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
1139+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1140+ * @example
1141+ *
1142+ * // Allow only specific routes
1143+ *```js
1144+ * const embed = new AppEmbed('#tsEmbed', {
1145+ * ... // other embed view config
1146+ * allowedRoutes: [Path.Home, Path.Search, Path.Liveboards],
1147+ * accessDeniedMessage: 'You do not have access to this page'
1148+ * })
1149+ *```
1150+ **/
1151+ allowedRoutes ?: ( NavigationPath | string ) [ ] ;
1152+
1153+ /**
1154+ * Array of routes that are blocked from being accessed in the embedded app.
1155+ * When specified, all routes except these will be accessible.
1156+ * Use Path.All to block all routes.
1157+ *
1158+ * **Important:** The path that the user initially embeds is always unblocked
1159+ * and accessible, regardless of the
1160+ * `allowedRoutes` or `blockedRoutes` configuration.
1161+ *
1162+ * Note: `allowedRoutes` and `blockedRoutes` are mutually exclusive.
1163+ * Use only one at a time.
1164+ *
1165+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
1166+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1167+ * @example
1168+ *
1169+ * // Block specific routes
1170+ *```js
1171+ * const embed = new AppEmbed('#tsEmbed', {
1172+ * blockedRoutes: [Path.Home, Path.Search, Path.Liveboards],
1173+ * })
1174+ *```
1175+ **/
1176+ blockedRoutes ?: ( NavigationPath | string ) [ ] ;
1177+
1178+ /**
1179+ * Custom message to display when a user tries to access a blocked route
1180+ * or a route that is not in the allowedRoutes list.
1181+ *
1182+ * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SageEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
1183+ * @default 'Access Denied'
1184+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1185+ * @example
1186+ *
1187+ *
1188+ * const embed = new AppEmbed('#tsEmbed', {
1189+ * allowedRoutes: [Path.Home, Path.Liveboards],
1190+ * accessDeniedMessage: 'You do not have permission to access this page.'
1191+ * })
1192+ **/
1193+ accessDeniedMessage ?: string ;
1194+ } ;
11671195}
11681196
11691197/**
@@ -6340,6 +6368,11 @@ export enum NavigationPath {
63406368 AutoAnswer = '/answer/create/auto/:dataSourceId' ,
63416369 RequestAccessForObject = '/requestaccess/:objectType/:objectId' ,
63426370}
6371+ export interface RouteBlocking {
6372+ blockedRoutes ?: ( NavigationPath | string ) [ ] ;
6373+ allowedRoutes ?: ( NavigationPath | string ) [ ] ;
6374+ accessDeniedMessage ?: string ;
6375+ }
63436376
63446377export type ApiInterceptFlags = {
63456378 /**
0 commit comments