import { type ModuleInput, type Address, type Contact, type mongodb } from '@unchainedshop/mongodb'; import { type User, type UserQuery, type Email, type UserLastLogin, type UserProfile } from '../db/UsersCollection.ts'; import { type SortOption } from '@unchainedshop/utils'; import { type UserRegistrationData, type UserSettingsOptions } from '../users-settings.ts'; export declare const removeConfidentialServiceHashes: (rawUser: User) => User; export declare const buildFindSelector: ({ includeGuests, includeDeleted, queryString, emailVerified, lastLogin, tags, userIds, username, usernames, emails, web3Verified, }: UserQuery) => mongodb.Filter; export declare const configureUsersModule: (moduleInput: ModuleInput) => Promise<{ webAuthn: { findMDSMetadataForAAGUID: (aaguid: string) => Promise<{ [key: string]: unknown; description?: string; icon?: string; authenticatorGetInfo?: { versions?: string[]; extensions?: string[]; options?: Record; }; } | null>; createCredentialCreationOptions: (origin: string, username: string, extensionOptions?: { timeout?: number; authenticatorSelection?: import("./configureUsersWebAuthnModule.ts").WebAuthnCredentialCreationOptions["authenticatorSelection"]; }) => Promise; createCredentialRequestOptions: (origin: string, username: string, extensionOptions?: { timeout?: number; userVerification?: "required" | "preferred" | "discouraged"; allowCredentials?: import("./configureUsersWebAuthnModule.ts").WebAuthnCredentialRequestOptions["allowCredentials"]; }) => Promise; verifyCredentialCreation: (username: string, credentials: import("@passwordless-id/webauthn/dist/esm/types.js").RegistrationJSON) => Promise; verifyCredentialRequest: (userPublicKeys: { id: string; publicKey: string; algorithm?: import("@passwordless-id/webauthn/dist/esm/types.js").NamedAlgo; counter?: number; transports?: import("@passwordless-id/webauthn/dist/esm/types.js").ExtendedAuthenticatorTransport[]; }[], username: string, credentials: import("@passwordless-id/webauthn/dist/esm/types.js").AuthenticationJSON & { requestId: string; }) => Promise<{ userHandle: string; counter: number; } | null>; deleteUserWebAuthnCredentials: (username: string) => Promise; }; count(query: UserQuery): Promise; findUserById(userId: string): Promise | null>; findUserByUsername(username: string): Promise | null>; findUserByEmail(email: string): Promise | null>; findUnverifiedEmailToken(plainToken: string): Promise<{ userId: string; address: string; when: Date; } | null>; verifyEmail(userId: string, address: string): Promise; findResetToken(plainToken: string): Promise<{ userId: string; address: string; when: Date; } | null>; findUserByToken(plainToken: string): Promise | null>; findUser(query: UserQuery & { sort?: SortOption[]; }, findOptions?: mongodb.FindOptions): Promise; findUsers({ limit, offset, ...query }: UserQuery & { sort?: SortOption[]; limit?: number; offset?: number; }): Promise; findGuestUserIds({ before }: { before: Date; }): Promise; findExistingUserIds({ userIds }: { userIds: string[]; }): Promise; userExists({ userId }: { userId: string; }): Promise; primaryEmail(user: User): Email; userLocale(user: User | null): Intl.Locale; createUser(rawUserData: UserRegistrationData, { skipMessaging, skipPasswordEnrollment, }?: { skipMessaging?: boolean; skipPasswordEnrollment?: boolean; }): Promise; hashPassword(password: string): Promise<{ pbkdf2: string; }>; verifyPassword({ bcrypt: bcryptHash, pbkdf2: pbkdf2SaltAndHash }: { bcrypt?: string; pbkdf2?: string; }, plainPassword: string): Promise; addEmail(userId: string, address: string): Promise; removeEmail(userId: string, address: string): Promise; addWeb3Address(userId: string, address: string): Promise; removeWeb3Address(userId: string, address: string): Promise; findWeb3Address(user: User, address: string): { address: string; nonce?: string; verified?: boolean; } | null; addWebAuthnCredential(userId: string, webAuthnService: { id: string; publicKey: string; created: Date; }): Promise; removeWebAuthnCredential(userId: string, credentialsId: string): Promise; createAccessToken(username: string): Promise<{ user: User; token: string; } | null>; setAccessToken(username: string, plainSecret: string): Promise; verifyWeb3SignatureAndUpdate(user: User, credentials: { address: string; nonce: string; }, signature: `0x${string}`): Promise; sendResetPasswordEmail(userId: string, email: string, isEnrollment?: boolean): Promise; sendVerificationEmail(userId: string, email: string): Promise; addRoles: (userId: string, roles: string[]) => Promise | null>; setUsername(userId: string, username: string): Promise | null>; setPassword(userId: string, plainPassword: string): Promise | null>; resetPassword(token: string, newPassword: string): Promise; updateAvatar: (_id: string, fileId: string) => Promise | null>; updateGuest: (user: User, guest: boolean) => Promise | null>; updateHeartbeat: (userId: string, lastLogin: UserLastLogin) => Promise | null>; markDeleted: (userId: string) => Promise | null>; deletePermanently: ({ userId }: { userId: string; }) => Promise | null>; updateProfile: (userId: string, updatedData: { profile?: UserProfile; meta?: any; }) => Promise | null>; updateLastBillingAddress: (_id: string, lastBillingAddress: Address) => Promise | null>; updateLastContact: (_id: string, lastContact: Contact) => Promise | null>; updateRoles: (_id: string, roles: string[]) => Promise | null>; updateTags: (_id: string, tags: string[]) => Promise | null>; updateUser: (selector: mongodb.Filter, modifier: mongodb.UpdateFilter, updateOptions?: mongodb.FindOneAndUpdateOptions) => Promise | null>; addPushSubscription: (userId: string, subscription: any, subscriptionOptions?: { userAgent: string; unsubscribeFromOtherUsers: boolean; }) => Promise; removePushSubscription: (userId: string, p256dh: string) => Promise; existingTags: () => Promise; }>; export type UsersModule = Awaited>;