export declare const splitUserName: (name?: string) => { first_name: string; last_name: string; }; /** * Build a display name for a user, falling back to email when first/last name * are missing or blank. Returns `''` when no usable identifier exists. * * SSO-provisioned users frequently lack populated first/last name fields * (PIT-5973). Use this everywhere a user-facing label is rendered from raw * `first_name`/`last_name` values, so the label never appears empty. * * Works against the `MiniUser` shape (`{ name, email }`) and the full `User` * shape (`{ first_name, last_name, email }`) — pass whichever fields you have. */ export declare function formatUserName(user: { name?: string | null; first_name?: string | null; last_name?: string | null; email?: string | null; } | null | undefined): string; interface CustomUserPropertiesSchema { fields?: Array<{ name?: string; }>; } /** * User keys hidden from template-placeholder pickers (canvas dynamic-data picker, email * mention dropdown). These are technical fields that aren't meaningful as template variables. * Kept here as the canonical source of truth — email app maintains its own copy currently. */ export declare const USER_TEMPLATE_DISALLOWED_KEYS: readonly string[]; /** * Pick from the user object only the keys suitable for template placeholders. * Drops technical fields (`id`, `connection`, `metadata`, etc.) from the picker tree * but leaves the original user object untouched. */ export declare function pickTemplateUserFields>(user: T | null | undefined): Record; /** * Flatten `user_properties` onto the user object so they're accessible as `{{user.fieldName}}` * in templates (Handlebars in canvases, mustache placeholders in emails, etc.). * * - Custom property values are spread first; built-in user fields keep precedence on collisions. * - Schema-defined fields not present on the user are added with `null` so admins authoring * templates see all available fields in autocomplete dropdowns regardless of their own values. * - The nested `user_properties` bucket is removed so each property has a single canonical * path (`user.fieldName`) — no duplicate entries in autocomplete pickers. * * Apply this once at the platform layer (where env/user is set) so every consumer app * (canvas-ui, ng-emails-app, hub, scheduler, ...) receives a uniformly-shaped user object * without per-app code changes. */ export declare function flattenUserProperties>(user: T | null | undefined, schema?: CustomUserPropertiesSchema | null): T | null; export {};