import { EmbedUiSettings } from './constants.js'; import type { BreadcrumbDisplayMode, CustomThemeProperty, EmbedEntityFolderContentRoles, EmbedSessionMode } from './constants.js'; /** * UI settings object controlling appearance settings of the embed session. * Each key is optional; values are booleans except `documentBreadcrumb`, which * takes a `BreadcrumbDisplayMode`. */ export type EmbedUiSettingsObject = { [EmbedUiSettings.SHOW_NAVIGATION]?: boolean; [EmbedUiSettings.DASHBOARD_CHART_CONTEXT_MENU]?: boolean; [EmbedUiSettings.DOCUMENT_BREADCRUMB]?: BreadcrumbDisplayMode; }; type UserAttributeValue = string | string[] | number | number[]; type HostProps = ({ host?: never; /** * @deprecated Introduced for internal testing only. For vanity domains, use the `host` prop instead. * * @throws Error if `host` is provided. */ domain?: string; /** * Name of the organization the content belongs to. If provided, generates a default embed host * URL in the form of `https://.embed-omniapp.co`. * * @throws Error if `host` is provided. */ organizationName: string; } | { domain?: never; organizationName?: never; /** * Used to set the host of signed embed URL, required when using vanity domains. * Protocol is not required, as https is assumed. * Port is not accepted. If required, use the `port` prop. * * @throws Error if `domain` or `organizationName` are provided. * @example "omni.example.com" * @example "omni.another-example.app" */ host: string; }) & { port?: number; }; type EmbedSsoBaseProps = { externalId: string; name: string; secret: string; entity?: string; userAttributes?: Record; prefersDark?: string; theme?: string; timezone?: string; customTheme?: CustomThemeProperties; customThemeId?: string; /** * Optional connection roles setting. Object keys should be connection IDs from the embedded Omni instance. * Object values should be connection roles (base roles or custom role names). */ connectionRoles?: Record; /** * Optional model roles setting. Object keys should be model IDs from the embedded Omni instance. * Object values should be model roles (base roles or custom role names). */ modelRoles?: Record; /** * Optional mode setting that determines whether the entire application should be embedded or a single piece of content. * * APPLICATION: the entire application will be embedded, meaning in-app navigation and document header options will be available. * SINGLE_CONTENT: only the content specified in the contentId will be embedded and application mode features will be hidden. */ mode?: EmbedSessionMode; /** * Optional content role setting for the embed user on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS". * * MANAGER: the user will have the ability to manage content and content permissions of the entity folder. * * EDITOR: the user will have the ability to manage content in the entity folder. * * VIEWER: the user will only be able to view content in the entity folder. * * NO_ACCESS: the user will not have access to the entity folder. Note that the group content role must * also be set to NO_ACCESS for the user to not have access to the entity folder. */ entityFolderContentRole?: EmbedEntityFolderContentRoles; /** * Optional content role setting for the entity group on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS". * * MANAGER: all entity group embed users will have the ability to manage content and content permissions of the entity folder. * * EDITOR: all entity group embed users will have the ability to manage content in the entity folder. * * VIEWER: all entity group embed users will only be able to view content in the entity folder. * * NO_ACCESS: all entity group embed users will not have access to the entity folder. */ entityFolderGroupContentRole?: EmbedEntityFolderContentRoles; /** * When true, an existing content role for the embed user on the entity folder will not be overwritten * by the `entityFolderContentRole` value. If a content role does not exist on the entity folder for the embed user, * the `entityFolderContentRole` value will be applied. */ preserveEntityFolderContentRole?: boolean; /** * Optional setting that customizes the generated entity folder label. This only affects the entity folder * corresponding to the `entity` parameter value in the relevant generated SSO embed URL. */ entityFolderLabel?: string; /** * Optional setting that customizes the generated entity group label. This only affects the entity group * corresponding to the `entity` parameter value in the relevant generated SSO embed URL. */ entityGroupLabel?: string; /** * Optional groups setting. An array of group names that the user will be added to. */ groups?: string[]; /** * Optional email setting for the generated embed user. */ email?: string; filterSearchParam?: string; linkAccess?: string; uiSettings?: EmbedUiSettingsObject; /** * Optional branch setting that sets the model branch of the embed session. */ branch?: string; nonce?: string; } & HostProps; type EmbedSsoDashboardOnlyProps = { accessBoost?: boolean; }; type EmbedContentIdProp = { contentId: string; }; type EmbedContentPathProp = { contentPath: string; }; export type CustomThemeProperties = { [CustomThemeProperty.DASHBOARD_BACKGROUND]?: string; [CustomThemeProperty.DASHBOARD_PAGE_PADDING]?: string; [CustomThemeProperty.DASHBOARD_TILE_MARGIN]?: string; [CustomThemeProperty.DASHBOARD_TILE_BACKGROUND]?: string; [CustomThemeProperty.DASHBOARD_TILE_SHADOW]?: string; [CustomThemeProperty.DASHBOARD_TILE_TEXT_BODY_COLOR]?: string; [CustomThemeProperty.DASHBOARD_TILE_TEXT_SECONDARY_COLOR]?: string; [CustomThemeProperty.DASHBOARD_TILE_BORDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_TILE_BORDER_RADIUS]?: string; [CustomThemeProperty.DASHBOARD_TILE_BORDER_STYLE]?: string; [CustomThemeProperty.DASHBOARD_TILE_BORDER_WIDTH]?: string; [CustomThemeProperty.DASHBOARD_TILE_TITLE_FONT_SIZE]?: string; [CustomThemeProperty.DASHBOARD_TILE_TITLE_FONT_WEIGHT]?: string; [CustomThemeProperty.DASHBOARD_TILE_TITLE_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_TILE_TITLE_FONT_FAMILY]?: string; [CustomThemeProperty.DASHBOARD_TILE_TEXT_BODY_FONT_FAMILY]?: string; [CustomThemeProperty.DASHBOARD_TILE_TEXT_CODE_FONT_FAMILY]?: string; [CustomThemeProperty.DASHBOARD_KEY_COLOR]?: string; [CustomThemeProperty.DASHBOARD_KEY_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_BUTTON_TRANSPARENT_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_BUTTON_TRANSPARENT_INTERACTIVE_COLOR]?: string; [CustomThemeProperty.DASHBOARD_MENU_ITEM_INTERACTIVE_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_BACKGROUND]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_BORDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_PLACEHOLDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_LABEL_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_BACKGROUND]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_SECONDARY_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_LINK_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_DIVIDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_BORDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_OUTLINE_COLOR]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_RADIUS]?: string; [CustomThemeProperty.DASHBOARD_CONTROL_RADIUS]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_BORDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_PLACEHOLDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_BACKGROUND]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_RADIUS]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_PLACEHOLDER_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_ICON_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_OUTLINE_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_ACCENT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_ACCENT_INVERT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_TOKEN_COLOR]?: string; [CustomThemeProperty.DASHBOARD_FILTER_INPUT_TOKEN_TEXT_COLOR]?: string; [CustomThemeProperty.DASHBOARD_BUTTON_RADIUS]?: string; }; export type EmbedSsoContentProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentPathProp; /** * Consumers of this SDK will rely on these three types to embed workbooks and dashboards. */ export type EmbedSsoDashboardProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentIdProp; export type EmbedSsoWorkbookProps = EmbedSsoBaseProps & EmbedContentIdProp; export type EmbedSsoContentDiscoveryProps = EmbedSsoBaseProps & { /** * Path name of the content discovery page to embed. */ path: string; }; export type RedeemSessionExclusiveProps = 'branch' | 'nonce' | 'prefersDark' | 'secret' | 'theme'; export type CreateSessionTokenProps = Omit & { apiKey: string; } & HostProps; export type RedeemSessionTokenProps = Pick & { sessionToken: string; } & HostProps; export {};