import type { SaveOnboardingAnswersRequest } from '../../types/index.js'; import type { DatabaseStore } from '../../store/database-store.js'; import type { ProjectMembersService } from '../core/project-members-service.js'; export declare class OnboardingService { private readonly store; private readonly projectMembersService; private readonly logger; constructor(store: DatabaseStore, projectMembersService: ProjectMembersService); /** * Returns true if the onboarding questionnaire should be shown to the user. * Checks if onboardingStatus is PENDING for the specific project. */ shouldShowQuestionnaire(userId: string, projectId: string): Promise; /** * Evaluates whether the user qualifies for onboarding and sets the status accordingly. * Called from the callback handler on each login. * * Only processes users with NULL/undefined status for this specific project. * If status is already set (PENDING, NOT_REQUIRE, or DONE) — no-op. * Checks eligibility: created within 1 day + sole admin in project. * If eligible → sets PENDING; otherwise sets NOT_REQUIRE. */ evaluateAndSetOnboardingStatus(userId: string, projectId: string): Promise; /** * Saves validated and sanitized onboarding answers. */ saveAnswers(userId: string, projectId: string, biUserId: string, userRole: string, request: SaveOnboardingAnswersRequest): Promise; /** * Fetches onboarding answers for a user/project and deserializes JSON arrays. * Uses hasOnboardingAnswers as a cheap check first to avoid unnecessary SELECT. * Returns an empty array if no answers exist or on any error. */ getAnswersForPayload(userId: string, projectId: string): Promise<{ questionId: string; answerValue: string | string[]; }[]>; /** * Extracts registrable-style hostname from pasted URLs (e.g. https://owox.com/demo → owox.com). * Strips a leading `www.` segment. */ private normalizeOrgDomainAnswer; private validateQuestionId; private validateAndSerializeAnswer; /** * Sanitizes free-text input: * - Trims and limits length * - Iteratively strips HTML tags (handles nested patterns) * HTML entity escaping is NOT done at storage time — it should be done at render time. */ private sanitizeText; } //# sourceMappingURL=onboarding-service.d.ts.map