/*!
 * name: nuget-server
 * version: 0.19.0
 * description: NuGet server on Node.js
 * author: Kouji Matsui (@kekyo@mi.kekyo.net)
 * license: MIT
 * repository.url: https://github.com/kekyo/nuget-server.git
 * git.commit.hash: 5b9501882b352a0490b3091210ed1740cfb81389
 */

import { Logger, ServerConfig } from '../types';
/**
 * API password data structure
 */
export interface ApiPassword {
    label: string;
    passwordHash: string;
    salt: string;
    createdAt: string;
}
/**
 * User data structure
 */
export interface User {
    id: string;
    username: string;
    passwordHash: string;
    salt: string;
    apiPasswordHash?: string;
    apiPasswordSalt?: string;
    apiPasswords?: ApiPassword[];
    role: "read" | "publish" | "admin";
    createdAt: string;
    updatedAt: string;
}
/**
 * User creation request
 */
export interface CreateUserRequest {
    username: string;
    password: string;
    role: "read" | "publish" | "admin";
}
/**
 * API password regeneration response
 */
export interface RegenerateApiPasswordResponse {
    apiPassword: string;
}
/**
 * API password list response
 */
export interface ApiPasswordListResponse {
    apiPasswords: Array<{
        label: string;
        createdAt: string;
    }>;
}
/**
 * API password add response
 */
export interface ApiPasswordAddResponse {
    label: string;
    apiPassword: string;
    createdAt: string;
}
/**
 * API password delete response
 */
export interface ApiPasswordDeleteResponse {
    success: boolean;
    message: string;
}
/**
 * User service configuration
 */
export interface UserServiceConfig {
    configDir: string;
    usersFile?: string;
    logger: Logger;
    serverConfig?: ServerConfig;
}
/**
 * User service interface for managing JSON-based user data
 */
export interface UserService {
    readonly initialize: () => Promise<void>;
    readonly destroy: () => void;
    readonly createUser: (request: CreateUserRequest) => Promise<User>;
    readonly getUser: (username: string) => Promise<User | undefined>;
    readonly getAllUsers: () => Promise<User[]>;
    readonly updateUser: (username: string, updates: Partial<Pick<User, "role">> | {
        password: string;
    }) => Promise<User | undefined>;
    readonly deleteUser: (username: string) => Promise<boolean>;
    readonly regenerateApiPassword: (username: string) => Promise<RegenerateApiPasswordResponse | undefined>;
    readonly validateCredentials: (username: string, password: string) => Promise<User | undefined>;
    readonly validateApiPassword: (username: string, apiPassword: string) => Promise<User | undefined>;
    readonly getUserCount: () => Promise<number>;
    readonly isReady: () => boolean;
    readonly listApiPasswords: (username: string) => Promise<ApiPasswordListResponse | undefined>;
    readonly addApiPassword: (username: string, label: string) => Promise<ApiPasswordAddResponse | undefined>;
    readonly deleteApiPassword: (username: string, label: string) => Promise<ApiPasswordDeleteResponse>;
    readonly validateAnyApiPassword: (username: string, apiPassword: string) => Promise<User | undefined>;
}
/**
 * Creates a user service instance for managing JSON-based user data
 * @param config - User service configuration
 * @returns User service instance
 */
export declare const createUserService: (config: UserServiceConfig) => UserService;
//# sourceMappingURL=userService.d.ts.map