import { ClsService } from "nestjs-cls"; import { JsonApiCursorInterface } from "../../../core/jsonapi/interfaces/jsonapi.cursor.interface"; import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository"; import { Neo4jService } from "../../../core/neo4j/services/neo4j.service"; import { SecurityService } from "../../../core/security/services/security.service"; import { User, UserDescriptor } from "../../user/entities/user"; import { UserCypherService } from "../../user/services/user.cypher.service"; /** * User repository. * * Extends `AbstractRepository` so an application can subclass it (see * `ExtendedUserRepository` in a consuming app) and have BOTH the inherited * generic methods AND every method declared here resolve the *extended* * descriptor. Model resolution is by subclass polymorphism — `this.descriptor` * — never by a registry lookup: Nest constructs providers long before * `onModuleInit`, where models are registered, so a registry lookup at * construction time would yield `undefined`. * * The three domain methods whose names collide with the abstract's generic * CRUD (`create` / `put` / `delete`) are named `createUser` / `putUser` / * `deleteUser` so the inherited descriptor-driven CRUD stays reachable. */ export declare class UserRepository extends AbstractRepository { protected readonly userCypherService: UserCypherService; protected readonly descriptor: import("../../..").EntityDescriptor; direction: "out"; relationship: string; cardinality: "one"; }; module: { model: import("../../..").DataMeta; direction: "out"; relationship: string; cardinality: "many"; dtoKey: string; }; }>; constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService, userCypherService: UserCypherService); /** * `AbstractRepository.onModuleInit` creates the constraints and indexes * declared by the descriptor. `defineEntity` only ever emits the `id` UNIQUE * constraint, so the User-specific `email` UNIQUE constraint is added here. * The fulltext index is created by the parent from `descriptor.indexes` * (`stringFields`), which excludes `password` and `code` — both carry * `excludeFromSearch: true`. */ onModuleInit(): Promise; makeCompanyAdmin(params: { userId: string; companyId: string; }): Promise; findOneForAdmin(params: { userId: string; }): Promise; /** * Find user for 2FA login completion. * Does NOT require companyId in CLS - finds company through user relationship. * Returns user with roles, company, and features needed for token creation. */ findForTwoFactorLogin(params: { userId: string; }): Promise; findFullUser(params: { userId: string; }): Promise; findByUserId(params: { userId: string; companyId?: string; }): Promise; findByEmail(params: { email: string; includeDeleted?: boolean; }): Promise; findByCode(params: { code: string; }): Promise; findMany(params: { term?: string; includeDeleted?: boolean; cursor?: JsonApiCursorInterface; }): Promise; findManyByContentIds(params: { contentIds: string[]; term?: string; includeDeleted?: boolean; }): Promise; findManyByCompany(params: { companyId: string; term?: string; includeDeleted?: boolean; isDeleted?: boolean; cursor?: JsonApiCursorInterface; }): Promise; findInRole(params: { roleId: string; term?: string; cursor: JsonApiCursorInterface; }): Promise; findNotInRole(params: { roleId: string; term?: string; cursor: JsonApiCursorInterface; }): Promise; createUser(params: { userId: string; email: string; name: string; title?: string; bio?: string; password: string; avatar?: string; companyId: string; roleIds: string[]; isActive?: boolean; phone?: string; termsAcceptedAt?: string; marketingConsent?: boolean; marketingConsentAt?: string; }): Promise; resetCode(params: { userId: string; }): Promise; putUser(params: { isAdmin: boolean; userId: string; email: string; name?: string; title?: string; bio?: string; password?: string; avatar?: string; roles?: string[]; isActive?: boolean; phone?: string; preserveAvatar?: boolean; /** The caller is editing their own user — see the company scoping note below. */ isSelf?: boolean; }): Promise; updateAvatar(params: { userId: string; avatar?: string; }): Promise; reactivate(params: { userId: string; }): Promise; patchRate(params: { userId: string; rate: number; }): Promise; patchAvatar(params: { userId: string; avatar: string; }): Promise; deleteUser(params: { userId: string; }): Promise; addUserToRole(params: { userId: string; roleId: string; }): Promise; removeUserFromRole(params: { roleId: string; userId: string; }): Promise; /** * Find all platform administrators (Only35 owners) * These users have the Administrator role and receive internal payment notifications. */ findPlatformAdministrators(): Promise; /** * Find company admins for a Stripe customer * Query path: StripeCustomer -> Company <- User with CompanyAdministrator role */ findCompanyAdminsByStripeCustomerId(params: { stripeCustomerId: string; }): Promise; /** * Find company admins by company ID * Used for deletion warning notifications */ findAdminsByCompanyId(params: { companyId: string; }): Promise; } //# sourceMappingURL=user.repository.d.ts.map