import { HttpClient } from '@sisense/sdk-rest-client'; import { AppConfig, ThemeSettings } from '../../../types'; import { LegacyDesignSettings } from '../../themes/legacy-design-settings.js'; import { FeatureMap } from './types/features.js'; /** * AI-related slice derived from globals (`serverFeatures` + deployment props), * aligned with admin UI paths such as `ai.featureFlags.*`, `ai.featureModelType`, * `ai.quotaNotification`, and `ai.aiStudio.*`. */ type AiSettingsSlice = { featureFlags: { completionV2: boolean; naturalResponseEnabled: boolean; nlqV3Enabled: boolean; queryDefinition: boolean; }; /** * Only when `serverFeatures.aiAssistant` exists. * If the block is present but omits this field, defaults to `customer_byok`. * When the AI Assistant feature is absent from globals, this stays unset (`undefined`). */ featureModelType?: string; quotaNotification: boolean; aiStudio: { realtime: boolean; usageDisplay: boolean; }; }; /** * Application settings * * @sisenseInternal */ export type AppSettings = Required & ServerSettings; /** * Application settings that can be overridden by the user */ type ConfigurableAppSettings = AppConfig; /** * User role permissions * * @internal */ type RoleManifest = { dashboards?: { create: boolean; delete: boolean; move: boolean; rename: boolean; duplicate: boolean; change_owner: boolean; toggle_edit_mode: boolean; edit_layout: boolean; edit_script: boolean; export_dash: boolean; export_jpeg: boolean; export_image: boolean; export_pdf: boolean; share: boolean; restore: boolean; copy_to_server: boolean; import: boolean; select_palette: boolean; replace_datasource: boolean; undo_import_dash: boolean; toggleDataExploration: boolean; filters: { create: boolean; delete: boolean; save: boolean; on_off: boolean; toggle_expansion: boolean; modify: boolean; reorder: boolean; modify_type: boolean; toggle_auto_update: boolean; set_defaults: boolean; advanced: boolean; use_starred: boolean; modify_filter_relationship: boolean; }; }; }; /** * Fusion platform settings */ type ServerSettings = { serverThemeSettings: ThemeSettings; serverLanguage: string; serverVersion: string; serverFeatures: FeatureMap; ai: AiSettingsSlice; narrative: { /** From `api/v2/settings/ai` narration.enabled */ isEnabled: boolean; /** Computed from `narrationUnified` and the unlimited or credit-based narrative entitlements. */ canGenerateNarrativeViaAI: boolean; }; user: { tenant: { name: string; }; /** * User role permissions * * @internal */ permissions: RoleManifest; /** From `api/globals` `user.firstName` — for embedded UIs (e.g. assistant greeting). */ firstName?: string; /** From `api/globals` `user.lastName`. */ lastName?: string; /** From `api/globals` `user.email`. */ email?: string; }; /** * Raw Fusion `designSettings` from `api/globals` (before palette / theme conversion). * Use for CSS variable derivation that mirrors the main Fusion app; see also {@link ServerSettings.serverThemeSettings}. */ fusionDesignSettings: LegacyDesignSettings; /** Subset of `globals.brand` needed by embedded chrome (e.g. documentation link). */ fusionBrand: { documentationUrl: string | null; }; }; /** * Gets the application settings * * @param customConfig - Custom application configuration * @param httpClient - Sisense REST API client * @param isWat - Whether the application is running with WAT authentication * @returns - Application settings */ export declare function getSettings(customConfig: ConfigurableAppSettings, httpClient: Pick, useDefaultPalette?: boolean): Promise; export {};