import { SimpleTheme, WidgetType } from './editors.interface' import { ElementSchemaVersion, User } from './element.interface' import { PerspectiveGraphConfig } from './graph.interface' import { SecurityGroupId } from './privileges.interface' import { ProductTier } from './products.interface' import { TemplateButton } from './templateButton.interface' export type Organization = { name: string id: string useVersion: ElementSchemaVersion | null } export interface OrganizationWithProductsData { organization: OrganizationRequestData products: Record } export interface GetOrganizationMembersResponse { users: User[] } export interface GetOrganizationAdminsResponse { admins: User[] } export interface UserAdminOrganizationsResponse { organizations: { id: string; name: string }[] } export type NavigationItem = { to?: string // webapp URL navigation (path only) href?: string // URL navigation id?: string // used for translations label: string icon?: string newTab?: boolean } export type TreePerspectiveConfig = { elementTypes: string[] defaultPerspectiveId: string } export type ElementTreeSettings = { enabled: boolean hideType?: boolean elementTypeBlacklist?: string[] perspectiveConfigs?: TreePerspectiveConfig[] } export type ElementFeatureSettings = { /* This option is used to hide the element header in the element view. This includes element name, type, controls etc. Setting this to true makes hideElementControls redundant. */ hideElementHeader?: boolean // This option is used to hide the element type in the element view. hideElementType?: boolean // Custom element controls buttons. elementControlsButtons?: TemplateButton[] // Hide specific element controls. hideElementControls?: { info?: boolean qrCode?: boolean edit?: boolean actions?: boolean } } export interface ElementTypePriorityEntry { /** Element type id. */ type: string /** * Attribute keys to project onto this type's result cards in fulltext search. * Each element is rendered with its own type's list, so the same attribute * name on a different type is not projected unless configured there too. */ attributes?: string[] } /** * Normalizes the (backwards-compatible) `elementTypePriority` setting into the * ordered list of type ids and a per-type projection map. Plain-string entries * contribute to the order with no projected attributes. */ export function normalizeElementTypePriority( priority?: Array, ): { order: string[]; projectionByType: Record } { const order: string[] = [] const projectionByType: Record = {} for (const entry of priority ?? []) { if (typeof entry === 'string') { order.push(entry) continue } if (!entry?.type) { continue } order.push(entry.type) if (entry.attributes?.length) { projectionByType[entry.type] = entry.attributes } } return { order, projectionByType } } export interface OrganizationSettings { organization: string isAdmin?: boolean theme?: Partial features: { navigation?: { logoUrl?: string logoLink?: string hideSearch?: boolean items?: NavigationItem[] hideLiveUpdateIndicator?: boolean hideNotifications?: boolean hideOrganizationSwitcher?: boolean } appNavigation?: { items?: NavigationItem[] } listing?: { hideTypes: string[] } search?: { /** * Ordered list of element types to prioritize in fulltext search. * Present types lead the categorized result tabs in this order and the * first present one becomes the initially selected tab; absent types * are ignored (falls back to the most-popular type). * * Each entry is either a plain type id (backwards compatible) or an * object that additionally lists the attributes to project onto that * type's result cards. Use {@link normalizeElementTypePriority} to read. */ elementTypePriority?: Array } element?: ElementFeatureSettings & { elementTypeOverrides?: Record } elementTree?: ElementTreeSettings graphPerspectives?: PerspectiveGraphConfig[] sidebar?: { style?: Record } } backgroundStyle?: Record groupOverrides?: Record< SecurityGroupId, Partial> > widgetConfig?: Record> } export type MembersType = 'admins' | 'users' export interface OrganizationRequestData { isMarketOrganization?: boolean companyName: string email: string landingPage?: string ceo?: string bank?: { name: string; accountIBAN: string } address?: { city: string; zip: string; street: string } icDPH?: string // this is probably a typo in the API dic?: string ico?: string } export interface OrganizationData { bank?: { name: string; accountIBAN: string } address?: { city: string; zip: string; street: string } isMarketOrganization?: boolean email: string landingPage?: string ceo?: string icDPH?: string dic?: string ico?: string id: string idDPH: string name: string } export interface OrganizationCreateResponse { organization: OrganizationData checkoutUrl: string }