<?php
header('Content-Type: application/json');
header('X-FreshCloud-Mail: v0.1.0-test');

freshcloud_mail_json(200, [
    'service' => 'freshcloud-mail',
    'version' => '0.1.0-test',
    'phase' => '1',
    'engine' => 'clean-room (MIT)',
    'endpoints' => [
        ['method' => 'GET', 'path' => '/api/email/health', 'description' => 'Health check'],
        ['method' => 'GET', 'path' => '/api/email/accounts', 'description' => 'List accounts for the current user'],
        ['method' => 'POST', 'path' => '/api/email/test-imap', 'description' => 'Test an IMAP connection'],
        ['method' => 'GET', 'path' => '/api/email/compose', 'description' => 'Compose module discovery'],
        ['method' => 'POST', 'path' => '/api/email/compose/start', 'description' => 'Start a new compose draft'],
        ['method' => 'PUT', 'path' => '/api/email/compose/{id}', 'description' => 'Save a draft'],
        ['method' => 'GET', 'path' => '/api/email/compose/{id}', 'description' => 'Resume a draft'],
        ['method' => 'DELETE', 'path' => '/api/email/compose/{id}', 'description' => 'Delete a draft'],
        ['method' => 'POST', 'path' => '/api/email/compose/{id}/send', 'description' => 'Send a draft'],
    ],
    'recipes' => 'https://github.com/avidtech6/freshcloud-mail-recipes',
    'timestamp' => gmdate('c'),
]);
