import * as _sinclair_typebox from '@sinclair/typebox';

/**
 * @spfn/auth - Auth API Contracts
 *
 * Type-safe API contracts for authentication operations
 */
/**
 * POST /codes - Send verification code
 *
 * Sends a 6-digit verification code to email or phone
 * Final path: /_auth/codes
 */
declare const sendVerificationCodeContract: {
    readonly method: "POST";
    readonly path: "/_auth/codes";
    readonly body: _sinclair_typebox.TObject<{
        target: _sinclair_typebox.TString;
        targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
        purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">]>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
            expiresAt: _sinclair_typebox.TString;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /codes/verify - Verify code (without creating account)
 *
 * Validates verification code, returns a temporary token
 * Final path: /_auth/codes/verify
 */
declare const verifyCodeContract: {
    readonly method: "POST";
    readonly path: "/_auth/codes/verify";
    readonly body: _sinclair_typebox.TObject<{
        target: _sinclair_typebox.TString;
        targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
        code: _sinclair_typebox.TString;
        purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">]>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            valid: _sinclair_typebox.TBoolean;
            verificationToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /exists - Check if account exists
 *
 * Checks if an email or phone number is already registered
 * Final path: /_auth/exists (prefix added from package.json)
 */
declare const checkAccountExistsContract: {
    readonly method: "POST";
    readonly path: "/_auth/exists";
    readonly body: _sinclair_typebox.TObject<{
        email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            exists: _sinclair_typebox.TBoolean;
            identifier: _sinclair_typebox.TString;
            identifierType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /register - Register new user
 *
 * Register with email/phone and password, includes public key
 * Final path: /_auth/register (prefix added from package.json)
 */
declare const registerContract: {
    readonly method: "POST";
    readonly path: "/_auth/register";
    readonly body: _sinclair_typebox.TObject<{
        email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        verificationToken: _sinclair_typebox.TString;
        password: _sinclair_typebox.TString;
        publicKey: _sinclair_typebox.TString;
        keyId: _sinclair_typebox.TString;
        fingerprint: _sinclair_typebox.TString;
        algorithm: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"ES256">, _sinclair_typebox.TLiteral<"RS256">]>;
        keySize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            userId: _sinclair_typebox.TString;
            email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /login - User login
 *
 * Authenticate user with email/phone and password
 * Replaces existing key with new one
 * Final path: /_auth/login (prefix added from package.json)
 */
declare const loginContract: {
    readonly method: "POST";
    readonly path: "/_auth/login";
    readonly body: _sinclair_typebox.TObject<{
        email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        password: _sinclair_typebox.TString;
        publicKey: _sinclair_typebox.TString;
        keyId: _sinclair_typebox.TString;
        fingerprint: _sinclair_typebox.TString;
        oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
        algorithm: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"ES256">, _sinclair_typebox.TLiteral<"RS256">]>;
        keySize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            userId: _sinclair_typebox.TString;
            email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            passwordChangeRequired: _sinclair_typebox.TBoolean;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /logout - Logout user
 *
 * Revokes current key (requires authentication)
 * Final path: /_auth/logout (prefix added from package.json)
 */
declare const logoutContract: {
    readonly method: "POST";
    readonly path: "/_auth/logout";
    readonly body: _sinclair_typebox.TObject<{}>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /keys/rotate - Rotate key
 *
 * Replace current key with new one (requires authentication)
 * Final path: /_auth/keys/rotate (prefix added from package.json)
 */
declare const rotateKeyContract: {
    readonly method: "POST";
    readonly path: "/_auth/keys/rotate";
    readonly body: _sinclair_typebox.TObject<{
        publicKey: _sinclair_typebox.TString;
        keyId: _sinclair_typebox.TString;
        fingerprint: _sinclair_typebox.TString;
        algorithm: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"ES256">, _sinclair_typebox.TLiteral<"RS256">]>;
        keySize: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
            keyId: _sinclair_typebox.TString;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * PUT /password - Change user password
 *
 * Allows authenticated users to change their password
 * Requires current password for verification
 * Final path: /_auth/password (prefix added from package.json)
 */
declare const changePasswordContract: {
    readonly method: "PUT";
    readonly path: "/_auth/password";
    readonly body: _sinclair_typebox.TObject<{
        currentPassword: _sinclair_typebox.TString;
        newPassword: _sinclair_typebox.TString;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * GET /me - Get current user info
 *
 * Returns authenticated user's information including role and permissions
 * Requires authentication
 * Final path: /_auth/me (prefix added from package.json)
 */
declare const getMeContract: {
    readonly method: "GET";
    readonly path: "/_auth/me";
    readonly body: _sinclair_typebox.TObject<{}>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            userId: _sinclair_typebox.TString;
            email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            role: _sinclair_typebox.TObject<{
                id: _sinclair_typebox.TNumber;
                name: _sinclair_typebox.TString;
                displayName: _sinclair_typebox.TString;
                priority: _sinclair_typebox.TNumber;
            }>;
            permissions: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
                id: _sinclair_typebox.TNumber;
                name: _sinclair_typebox.TString;
                displayName: _sinclair_typebox.TString;
                category: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            }>>;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};

export { changePasswordContract, checkAccountExistsContract, getMeContract, loginContract, logoutContract, registerContract, rotateKeyContract, sendVerificationCodeContract, verifyCodeContract };
