feat(mail-ingest): REST routes and MCP tools for the settings card, the inbox and trip addresses

/api/mail-ingest serves the settings card, the inbox, the mail preview, the
.eml upload and every action on an entry; trip addresses and the admin status
and connection test have routes of their own. The MCP tools act through the
same services and never hand out an address, and the trip assistant is not offered them.
This commit is contained in:
Maurice
2026-11-13 16:42:51 +01:00
parent 1bfaf4ea98
commit 844d03a9cd
12 changed files with 1080 additions and 10 deletions
@@ -92,6 +92,13 @@ export const ASSISTANT_DENIED_TOOLS: Readonly<Record<string, string>> = {
update_manual_school_holiday_region: 'changes the holidays of every user',
delete_manual_school_holiday_region: 'changes the holidays of every user',
delete_manual_school_holiday_country: 'changes the holidays of every user',
list_mail_inbox: 'reads the forwarded mails of the user, which would reach the AI provider',
add_mail_booking: 'the mail inbox is decided in the app, not from a trip chat',
move_mail_booking: 'the mail inbox is decided in the app, not from a trip chat',
file_mail_booking: 'the mail inbox is decided in the app, not from a trip chat',
discard_mail_booking: 'the mail inbox is decided in the app, not from a trip chat',
undo_mail_booking: 'the mail inbox is decided in the app, not from a trip chat',
update_mail_import_settings: 'changes how the mail import of the user works',
...STUDIO_ONLY_TOOLS,
restore_book_page: 'an undo target only: it puts a book page back as an earlier change left it',
restore_book_layout: 'an undo target only: it puts back a layout an earlier change took away',
@@ -21,6 +21,7 @@ import { MailReadService } from '../llm-parse/mail-read.service';
import type { WalkedMail } from '../llm-parse/mail-read.types';
import { MailIngestApplyService, type WrittenBooking } from './mail-ingest-apply.service';
import { MailIngestNotifyService } from './mail-ingest-notify.service';
import { MailIngestSettingsService } from './mail-ingest-settings.service';
import { fitsTrip, implausible, type TripOption } from './mail-ingest-checks';
import { MailIngestTripsService } from './mail-ingest-trips.service';
import { ADDED_RESOLUTIONS } from './mail-ingest-views';
@@ -62,6 +63,7 @@ export class MailIngestActionsService {
private readonly reader: MailReadService,
private readonly airports: AirportsService,
private readonly demo: DemoService,
private readonly settings: MailIngestSettingsService,
private readonly uow: UnitOfWork,
) {}
@@ -80,6 +82,7 @@ export class MailIngestActionsService {
confirm: boolean,
now: Date = new Date(),
): Promise<MailIngestCandidateRow> {
await this.requireAvailable();
const { entry, tripId, created } = await this.addedEntry(candidateId, userId, now);
await this.requireConfirmed(tripId, created, confirm, 'Undoing this booking changes more than the booking');
const removed = await this.uow.transactional(async () => {
@@ -119,6 +122,7 @@ export class MailIngestActionsService {
confirm: boolean,
now: Date = new Date(),
): Promise<MailIngestCandidateRow> {
await this.requireAvailable();
const { entry, tripId: fromTripId, created } = await this.addedEntry(candidateId, userId, now);
if (tripId === fromTripId) throw new DomainError(409, 'This booking is in that trip already');
const item = decodeJson(MAIL_INGEST_ITEM, entry.item_json);
@@ -331,14 +335,20 @@ export class MailIngestActionsService {
await this.candidates.setAttachments(entry.id, encodeJson(MAIL_INGEST_CREATED, created), error);
}
/** The person's own waiting entry; anyone else's answers as missing. */
/** The person's own waiting entry, while the import runs; anyone else's answers as missing. */
private async pendingEntry(candidateId: number, userId: number): Promise<MailIngestCandidateRow> {
await this.requireAvailable();
const entry = await this.candidates.findById(candidateId);
if (!entry || entry.user_id !== userId) throw new DomainError(404, 'Entry not found');
if (entry.resolution !== 'pending') throw new DomainError(409, 'This entry was decided already');
return entry;
}
/** Every action stops with the import: on a plan without it, or once an admin switched it off. */
private async requireAvailable(): Promise<void> {
if (!(await this.settings.isAvailable())) throw new DomainError(404, 'Mail import is not available');
}
private async tripFor(userId: number, tripId: number | null): Promise<TripOption> {
const person = await this.trips.person(userId);
const trip = person && tripId !== null ? await this.trips.editableTrip(person, tripId) : null;
@@ -0,0 +1,37 @@
import { AdminGuard } from '../auth-core/admin.guard';
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
import { ResponseContract } from '../common/response-contract';
import { MailIngestStatusService } from './mail-ingest-status.service';
import { Controller, Get, HttpCode, Post, UseGuards } from '@nestjs/common';
import {
mailIngestAdminStatusResponseSchema,
mailIngestAdminTestResponseSchema,
type MailIngestAdminStatusResponse,
type MailIngestAdminTestResponse,
} from '@trek/shared';
/**
* `/api/admin/mail-ingest`: how the booking mail import runs, for the admin
* dialog. The status card is counts only, no mail content; the test reaches
* the configured transport and says what failed. Both read, so a managed
* install's admin sees them too; the settings themselves are the operator's
* there and go through the admin settings form, which withholds them.
*/
@Controller('api/admin/mail-ingest')
@UseGuards(JwtAuthGuard, AdminGuard)
export class MailIngestAdminController {
constructor(private readonly status: MailIngestStatusService) {}
@Get('status')
@ResponseContract(mailIngestAdminStatusResponseSchema)
read(): Promise<MailIngestAdminStatusResponse> {
return this.status.status();
}
@Post('test')
@HttpCode(200)
@ResponseContract(mailIngestAdminTestResponseSchema)
test(): Promise<MailIngestAdminTestResponse> {
return this.status.test();
}
}
@@ -35,13 +35,13 @@ import type {
} from '@trek/shared';
/** How an upload the intake refused answers, by why. */
const UPLOAD_REFUSALS: Record<MailIntakeRefusal, { status: number; error: string }> = {
unavailable: { status: 404, error: 'Mail import is not available' },
too_large: { status: 413, error: 'This mail is larger than the import takes' },
not_a_mail: { status: 422, error: 'This file is not a mail' },
unknown_address: { status: 422, error: 'This file is not a mail' },
address_daily_limit: { status: 429, error: 'Your address took all the mails it takes today' },
inbox_full: { status: 409, error: 'Your inbox is full; decide some of its entries first' },
const UPLOAD_REFUSALS: Record<MailIntakeRefusal, [status: number, error: string]> = {
unavailable: [404, 'Mail import is not available'],
too_large: [413, 'This mail is larger than the import takes'],
not_a_mail: [422, 'This file is not a mail'],
unknown_address: [422, 'This file is not a mail'],
address_daily_limit: [429, 'Your address took all the mails it takes today'],
inbox_full: [409, 'Your inbox is full; decide some of its entries first'],
};
/**
@@ -161,7 +161,7 @@ export class MailIngestInboxService {
async upload(userId: number, raw: Buffer): Promise<MailIngestUploadResponse> {
const result = await this.intake.upload(raw, userId);
if (result.status === 'refused') {
const { status, error } = UPLOAD_REFUSALS[result.reason];
const [status, error] = UPLOAD_REFUSALS[result.reason];
throw new DomainError(status, error);
}
const [head] = await this.messages.listHeads([result.messageId]);
@@ -0,0 +1,49 @@
import type { User } from '../../types';
import { CurrentUser } from '../auth-core/current-user.decorator';
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
import { ResponseContract } from '../common/response-contract';
import { RequirePermission, TripAccessGuard } from '../permissions/trip-access.guard';
import { MailIngestInboxService } from './mail-ingest-inbox.service';
import { Controller, Delete, Get, HttpCode, Param, Post, UseGuards } from '@nestjs/common';
import {
mailIngestAddressResponseSchema,
successResponseSchema,
type MailIngestAddressResponse,
type SuccessResponse,
} from '@trek/shared';
/**
* `/api/trips/:tripId/mail-ingest/address`: the address a member keeps for
* one trip, so a mail sent there needs no trip to be picked. Only a member
* who may add bookings to the trip has one, and it is theirs alone: another
* member reading it sees their own or none. It stops taking mail when its
* owner can no longer add bookings, which the import checks on every mail.
*/
@Controller('api/trips/:tripId/mail-ingest/address')
@UseGuards(JwtAuthGuard, TripAccessGuard)
@RequirePermission('reservation_edit')
export class MailIngestTripController {
constructor(private readonly inbox: MailIngestInboxService) {}
@Get()
@ResponseContract(mailIngestAddressResponseSchema)
get(@CurrentUser() user: User, @Param('tripId') tripId: string): Promise<MailIngestAddressResponse> {
return this.inbox.tripAddress(user.id, Number(tripId));
}
/** Makes the person's address for the trip, or a new one in place of the old, which stops at once. */
@Post()
@HttpCode(200)
@ResponseContract(mailIngestAddressResponseSchema)
renew(@CurrentUser() user: User, @Param('tripId') tripId: string): Promise<MailIngestAddressResponse> {
return this.inbox.renewTripAddress(user.id, Number(tripId));
}
@Delete()
@HttpCode(200)
@ResponseContract(successResponseSchema)
async revoke(@CurrentUser() user: User, @Param('tripId') tripId: string): Promise<SuccessResponse> {
await this.inbox.revokeTripAddress(user.id, Number(tripId));
return { success: true };
}
}
@@ -0,0 +1,209 @@
import type { MailIngestCandidateRow } from '../../db/repositories/MailIngestCandidates.repository';
import type { User } from '../../types';
import { CurrentUser } from '../auth-core/current-user.decorator';
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
import { DomainError } from '../common/domain-error';
import { ResponseContract } from '../common/response-contract';
import { MailIngestActionsService } from './mail-ingest-actions.service';
import { MailIngestInboxService } from './mail-ingest-inbox.service';
import { MAIL_INGEST_LIMITS } from './mail-ingest.constants';
import {
MailIngestApplyDto,
MailIngestFileDto,
MailIngestInboxQueryDto,
MailIngestMoveDto,
MailIngestPrefsUpdateDto,
MailIngestUndoDto,
} from './mail-ingest.dto';
import {
Body,
Controller,
Get,
HttpCode,
Param,
Patch,
Post,
Query,
UploadedFile,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import {
idParamSchema,
mailIngestAddressResponseSchema,
mailIngestCandidateResponseSchema,
mailIngestInboxCountResponseSchema,
mailIngestInboxResponseSchema,
mailIngestMessagePreviewResponseSchema,
mailIngestPrefillResponseSchema,
mailIngestSettingsResponseSchema,
mailIngestUploadResponseSchema,
type MailIngestAddressResponse,
type MailIngestCandidateResponse,
type MailIngestInboxCountResponse,
type MailIngestInboxResponse,
type MailIngestMessagePreviewResponse,
type MailIngestPrefillResponse,
type MailIngestSettingsResponse,
type MailIngestUploadResponse,
} from '@trek/shared';
import { memoryStorage } from 'multer';
import { extname } from 'node:path';
const UPLOAD = {
storage: memoryStorage(),
// The largest mail any install takes; the import's own limit, smaller on a self-hosted one, is checked after.
limits: { fileSize: MAIL_INGEST_LIMITS.cloudMailBytes, files: 1 },
defParamCharset: 'utf8' as const,
};
/**
* `/api/mail-ingest`: a person's own mail import. The settings card (their
* address and switches), the inbox of bookings that wait, and what they do
* with an entry: add it to a trip, move or undo an added one, file the mail
* as documents, take the form's starting values, or discard it. An .eml
* upload reads a mail without any transport. Every write takes the client's
* X-Idempotency-Key through the global interceptor, so a replay from the
* offline queue answers what the first call answered.
*/
@Controller('api/mail-ingest')
@UseGuards(JwtAuthGuard)
export class MailIngestController {
constructor(
private readonly inbox: MailIngestInboxService,
private readonly actions: MailIngestActionsService,
) {}
@Get('settings')
@ResponseContract(mailIngestSettingsResponseSchema)
settings(@CurrentUser() user: User): Promise<MailIngestSettingsResponse> {
return this.inbox.settingsOf(user.id);
}
@Patch('settings')
@ResponseContract(mailIngestSettingsResponseSchema)
updateSettings(
@CurrentUser() user: User,
@Body() body: MailIngestPrefsUpdateDto,
): Promise<MailIngestSettingsResponse> {
return this.inbox.updatePrefs(user.id, body);
}
@Post('address/renew')
@HttpCode(200)
@ResponseContract(mailIngestAddressResponseSchema)
renewAddress(@CurrentUser() user: User): Promise<MailIngestAddressResponse> {
return this.inbox.renewOwnAddress(user.id);
}
@Get('inbox/count')
@ResponseContract(mailIngestInboxCountResponseSchema)
count(@CurrentUser() user: User): Promise<MailIngestInboxCountResponse> {
return this.inbox.count(user.id);
}
@Get('inbox')
@ResponseContract(mailIngestInboxResponseSchema)
list(@CurrentUser() user: User, @Query() query: MailIngestInboxQueryDto): Promise<MailIngestInboxResponse> {
return this.inbox.inbox(user.id, query);
}
@Get('messages/:id/preview')
@ResponseContract(mailIngestMessagePreviewResponseSchema)
preview(@CurrentUser() user: User, @Param('id') id: string): Promise<MailIngestMessagePreviewResponse> {
return this.inbox.preview(user.id, idOf(id, 'Mail not found'));
}
@Get('candidates/:id/prefill')
@ResponseContract(mailIngestPrefillResponseSchema)
prefill(@CurrentUser() user: User, @Param('id') id: string): Promise<MailIngestPrefillResponse> {
return this.actions.prefill(entryId(id), user.id);
}
@Post('candidates/:id/apply')
@HttpCode(200)
@ResponseContract(mailIngestCandidateResponseSchema)
async apply(
@CurrentUser() user: User,
@Param('id') id: string,
@Body() body: MailIngestApplyDto,
): Promise<MailIngestCandidateResponse> {
return this.answer(await this.actions.applyToTrip(entryId(id), user.id, body.trip_id ?? null));
}
@Post('candidates/:id/move')
@HttpCode(200)
@ResponseContract(mailIngestCandidateResponseSchema)
async move(
@CurrentUser() user: User,
@Param('id') id: string,
@Body() body: MailIngestMoveDto,
): Promise<MailIngestCandidateResponse> {
return this.answer(await this.actions.move(entryId(id), user.id, body.trip_id, body.confirm === true));
}
@Post('candidates/:id/file')
@HttpCode(200)
@ResponseContract(mailIngestCandidateResponseSchema)
async file(
@CurrentUser() user: User,
@Param('id') id: string,
@Body() body: MailIngestFileDto,
): Promise<MailIngestCandidateResponse> {
return this.answer(await this.actions.fileToTrip(entryId(id), user.id, body.trip_id));
}
@Post('candidates/:id/undo')
@HttpCode(200)
@ResponseContract(mailIngestCandidateResponseSchema)
async undo(
@CurrentUser() user: User,
@Param('id') id: string,
@Body() body: MailIngestUndoDto,
): Promise<MailIngestCandidateResponse> {
return this.answer(await this.actions.undo(entryId(id), user.id, body.confirm === true));
}
@Post('candidates/:id/discard')
@HttpCode(200)
@ResponseContract(mailIngestCandidateResponseSchema)
async discard(@CurrentUser() user: User, @Param('id') id: string): Promise<MailIngestCandidateResponse> {
return this.answer(await this.actions.discard(entryId(id), user.id));
}
/**
* An .eml file, read as if it had been forwarded to the person's own
* address. Checked in the handler, never by a guard: an answer sent while
* the client still uploads reaches it as a reset connection.
*/
@Post('upload')
@UseInterceptors(FileInterceptor('file', UPLOAD))
@ResponseContract(mailIngestUploadResponseSchema)
async upload(
@CurrentUser() user: User,
@UploadedFile() file: Express.Multer.File | undefined,
): Promise<MailIngestUploadResponse> {
if (!file) throw new DomainError(400, 'No file uploaded');
if (extname(file.originalname).toLowerCase() !== '.eml' && file.mimetype !== 'message/rfc822') {
throw new DomainError(400, 'Upload a mail saved as an .eml file');
}
return this.inbox.upload(user.id, file.buffer);
}
private async answer(row: MailIngestCandidateRow): Promise<MailIngestCandidateResponse> {
return { candidate: await this.inbox.entry(row) };
}
}
/** An id from the path; one that is no id names nothing, like an id nobody holds. */
function idOf(raw: string, missing: string): number {
const parsed = idParamSchema.safeParse(raw);
if (!parsed.success) throw new DomainError(404, missing);
return parsed.data;
}
function entryId(raw: string): number {
return idOf(raw, 'Entry not found');
}
@@ -0,0 +1,17 @@
import {
mailIngestApplyRequestSchema,
mailIngestFileRequestSchema,
mailIngestInboxQuerySchema,
mailIngestMoveRequestSchema,
mailIngestPrefsUpdateRequestSchema,
mailIngestUndoRequestSchema,
} from '@trek/shared';
import { createZodDto } from 'nestjs-zod';
export class MailIngestPrefsUpdateDto extends createZodDto(mailIngestPrefsUpdateRequestSchema) {}
export class MailIngestInboxQueryDto extends createZodDto(mailIngestInboxQuerySchema) {}
export class MailIngestApplyDto extends createZodDto(mailIngestApplyRequestSchema) {}
export class MailIngestMoveDto extends createZodDto(mailIngestMoveRequestSchema) {}
export class MailIngestFileDto extends createZodDto(mailIngestFileRequestSchema) {}
export class MailIngestUndoDto extends createZodDto(mailIngestUndoRequestSchema) {}
@@ -0,0 +1,131 @@
import type { MailIngestCandidateRow } from '../../db/repositories/MailIngestCandidates.repository';
import {
McpController,
Tool,
TOOL_ANNOTATIONS_DELETE,
TOOL_ANNOTATIONS_NON_IDEMPOTENT,
TOOL_ANNOTATIONS_READONLY,
TOOL_ANNOTATIONS_WRITE,
ok,
type McpContext,
} from '../../nest-mcp';
import { MailIngestActionsService } from './mail-ingest-actions.service';
import { MailIngestInboxService } from './mail-ingest-inbox.service';
import {
idSchema,
mailIngestApplyRequestSchema,
mailIngestFileRequestSchema,
mailIngestInboxQuerySchema,
mailIngestMoveRequestSchema,
mailIngestPrefsUpdateRequestSchema,
mailIngestUndoRequestSchema,
type MailIngestInboxQuery,
type MailIngestPrefsUpdateRequest,
} from '@trek/shared';
const candidateId = idSchema.describe('The inbox entry, as list_mail_inbox names it (entries[].id).');
/**
* The booking mail import as MCP tools: the inbox of bookings read from
* forwarded mails, and what a person does with an entry, over the same
* services and checks as /api/mail-ingest. A forwarding address carries its
* secret token, so no tool reads or makes one; addresses stay in the app.
*/
@McpController()
export class MailIngestMcp {
constructor(
private readonly inbox: MailIngestInboxService,
private readonly actions: MailIngestActionsService,
) {}
@Tool({
name: 'list_mail_inbox',
description:
'List the bookings read from mails the user forwarded to TREK: by default those that wait for a decision (status "open"), with why each one waits (reason), the booking as read (item), the trip it suggests and the mail it came from (subject, received_at, attachments), newest first. status "resolved" lists the decided ones; an added booking names reservation_ids and, while it can still be undone or moved, undo_until. Page with before = next_before.',
inputSchema: mailIngestInboxQuerySchema.shape,
annotations: TOOL_ANNOTATIONS_READONLY,
access: { group: 'reservations', mode: 'read' },
})
async listMailInbox(query: MailIngestInboxQuery, ctx: McpContext) {
return ok(await this.inbox.inbox(ctx.userId, query));
}
@Tool({
name: 'add_mail_booking',
description:
'Add a waiting booking from the mail inbox to a trip: to the trip it suggests, or with trip_id to another trip the user may add bookings to. The booking is written with what the mail said (times, places, reference, cost) and the mail is attached as its document; it can be undone for seven days.',
inputSchema: { candidateId, ...mailIngestApplyRequestSchema.shape },
annotations: TOOL_ANNOTATIONS_NON_IDEMPOTENT,
access: { group: 'reservations', mode: 'write' },
})
async addMailBooking({ candidateId: id, trip_id }: { candidateId: number; trip_id?: number }, ctx: McpContext) {
return this.answer(await this.actions.applyToTrip(id, ctx.userId, trip_id ?? null));
}
@Tool({
name: 'move_mail_booking',
description:
'Move a booking that was added from a mail into another trip (trip_id), while it can still be undone. The booking is written there anew and removed from the first trip. One whose cost was settled with, or that was edited since, is refused with needs_confirmation until confirm is true; the edit is lost.',
inputSchema: { candidateId, ...mailIngestMoveRequestSchema.shape },
annotations: TOOL_ANNOTATIONS_NON_IDEMPOTENT,
access: { group: 'reservations', mode: 'write' },
})
async moveMailBooking(
{ candidateId: id, trip_id, confirm }: { candidateId: number; trip_id: number; confirm?: boolean },
ctx: McpContext,
) {
return this.answer(await this.actions.move(id, ctx.userId, trip_id, confirm === true));
}
@Tool({
name: 'file_mail_booking',
description:
'Put the mail of a waiting entry into a trip (trip_id) as documents, its attachments or else its text, without a booking. Needs the Documents addon.',
inputSchema: { candidateId, ...mailIngestFileRequestSchema.shape },
annotations: TOOL_ANNOTATIONS_NON_IDEMPOTENT,
access: { group: 'reservations', mode: 'write' },
})
async fileMailBooking({ candidateId: id, trip_id }: { candidateId: number; trip_id: number }, ctx: McpContext) {
return this.answer(await this.actions.fileToTrip(id, ctx.userId, trip_id));
}
@Tool({
name: 'discard_mail_booking',
description: 'Set a waiting entry of the mail inbox aside without adding anything.',
inputSchema: { candidateId },
annotations: TOOL_ANNOTATIONS_WRITE,
access: { group: 'reservations', mode: 'write' },
})
async discardMailBooking({ candidateId: id }: { candidateId: number }, ctx: McpContext) {
return this.answer(await this.actions.discard(id, ctx.userId));
}
@Tool({
name: 'undo_mail_booking',
description:
'Undo a booking that was added from a mail, within seven days: the booking, its stay, its cost and the documents it brought go. One whose cost was settled with, or that was edited since, is refused with needs_confirmation until confirm is true.',
inputSchema: { candidateId, ...mailIngestUndoRequestSchema.shape },
annotations: TOOL_ANNOTATIONS_DELETE,
access: { group: 'reservations', mode: 'write' },
})
async undoMailBooking({ candidateId: id, confirm }: { candidateId: number; confirm?: boolean }, ctx: McpContext) {
return this.answer(await this.actions.undo(id, ctx.userId, confirm === true));
}
@Tool({
name: 'update_mail_import_settings',
description:
"Change the user's own switches of the mail import: enabled (whether their address takes mail), ai_enabled (whether an AI reads their mails) and auto_add (add a booking that passes every check on its own, or ask first). Name at least one.",
inputSchema: mailIngestPrefsUpdateRequestSchema,
annotations: TOOL_ANNOTATIONS_WRITE,
access: { group: 'reservations', mode: 'write' },
})
async updateMailImportSettings(update: MailIngestPrefsUpdateRequest, ctx: McpContext) {
const { available, prefs, ai_available, pending } = await this.inbox.updatePrefs(ctx.userId, update);
return ok({ available, prefs, ai_available, pending });
}
private async answer(row: MailIngestCandidateRow) {
return ok({ candidate: await this.inbox.entry(row) });
}
}
@@ -20,6 +20,7 @@ import { SchedulingModule } from '../scheduling/scheduling.module';
import { SettingsModule } from '../settings/settings.module';
import { MailIngestActionsService } from './mail-ingest-actions.service';
import { MailIngestAddressService } from './mail-ingest-address.service';
import { MailIngestAdminController } from './mail-ingest-admin.controller';
import { MailIngestApplyService } from './mail-ingest-apply.service';
import { MailIngestImapClient } from './mail-ingest-imap.client';
import { MailIngestImapJob } from './mail-ingest-imap.job';
@@ -36,8 +37,11 @@ import { MailIngestRelayHost } from './mail-ingest-relay.service';
import { MailIngestRetentionJob } from './mail-ingest-retention.job';
import { MailIngestSettingsService } from './mail-ingest-settings.service';
import { MailIngestStatusService } from './mail-ingest-status.service';
import { MailIngestTripController } from './mail-ingest-trip.controller';
import { MailIngestTripsService } from './mail-ingest-trips.service';
import { MailIngestWebhookService } from './mail-ingest-webhook.service';
import { MailIngestController } from './mail-ingest.controller';
import { MailIngestMcp } from './mail-ingest.mcp';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { Module } from '@nestjs/common';
@@ -76,7 +80,12 @@ import { Module } from '@nestjs/common';
MailIngestCandidates,
]),
],
controllers: [MailIngestInboundController],
controllers: [
MailIngestController,
MailIngestTripController,
MailIngestAdminController,
MailIngestInboundController,
],
providers: [
MailIngestSettingsService,
MailIngestTripsService,
@@ -92,6 +101,7 @@ import { Module } from '@nestjs/common';
MailIngestWebhookService,
MailIngestImapClient,
MailIngestRelayHost,
MailIngestMcp,
MailIngestNotificationActions,
MailIngestProcessJob,
MailIngestRetentionJob,