mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-14 00:01:03 +00:00
724c88c201
A mechanical prettier --write over server/src, server/tests, server/scripts and shared/src with the workspaces' .prettierrc; nothing but layout and import order changes, and every file keeps the same set of imports. shared is formatted throughout and its format baseline is empty. The server baseline keeps the 35 files that Prettier would grow past their lint:size limit (they need a split first, which is not a formatting change), and the generated entity files stay as their generator writes them.
43 lines
2.1 KiB
TypeScript
43 lines
2.1 KiB
TypeScript
import { Addons } from '../../db/entities/Addons.entity';
|
|
import { AppSettings } from '../../db/entities/AppSettings.entity';
|
|
import { PhotoProviderFields } from '../../db/entities/PhotoProviderFields.entity';
|
|
import { PhotoProviders } from '../../db/entities/PhotoProviders.entity';
|
|
import { Users } from '../../db/entities/Users.entity';
|
|
import { AddonGuard } from './addon.guard';
|
|
import { AddonsController } from './addons.controller';
|
|
import { AddonsMcp } from './addons.mcp';
|
|
import { AddonsService } from './addons.service';
|
|
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
|
import { Module } from '@nestjs/common';
|
|
|
|
/**
|
|
* GET /api/addons — enabled add-ons + photo providers (was an inline handler in
|
|
* server/src/app.ts). The addon sub-features (atlas, vacay) keep their own
|
|
* modules; this only serves the EXACT /api/addons listing.
|
|
*
|
|
* Exports AddonsService — the owner of addon/feature-flag enablement reads
|
|
* (isAddonEnabled + bag-tracking/collab-features flags, extracted from
|
|
* adminService per finding `admin-1`) — for the in-container consumers.
|
|
* Deliberately NOT @Global (permissions precedent): e2e TestingModules resolve
|
|
* it transitively through each consumer's explicit import.
|
|
*
|
|
* AddonsMcp puts the same listing on the MCP surface, so a model can read which
|
|
* add-ons this instance has switched on instead of guessing from the tools it
|
|
* was handed.
|
|
*
|
|
* MikroOrmModule.forFeature registers AddonsRepository/PhotoProvidersRepository/
|
|
* PhotoProviderFieldsRepository/AppSettingsRepository for AddonsService's
|
|
* @InjectRepository constructor (Plan 3a Task 4) — the forFeature +
|
|
* @InjectRepository wiring pattern Task 0 set up on SettingsModule. `Users` was
|
|
* added by Task 5: `googleKeySource` passes `UsersRepository` explicitly to
|
|
* `instance-api-keys.ts`'s resolveApiKey now, instead of that file resolving
|
|
* one off the ambient request context.
|
|
*/
|
|
@Module({
|
|
imports: [MikroOrmModule.forFeature([Addons, PhotoProviders, PhotoProviderFields, AppSettings, Users])],
|
|
controllers: [AddonsController],
|
|
providers: [AddonsService, AddonGuard, AddonsMcp],
|
|
exports: [AddonsService, AddonGuard],
|
|
})
|
|
export class AddonsModule {}
|