mirror of
https://github.com/outline/outline.git
synced 2026-12-06 11:12:32 +03:00
* chore: Prune redundant comments and normalize lint directives Removes comments that restate the following line and stale TODOs, drops the passive event listener feature check now that all supported browsers support it, and renames eslint directives to oxlint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH * fix: Evaluate restricted team domains at validation time The restricted email provider list was captured when the model loaded, so it could not follow the hosting environment and the tests that covered it never reached the model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH * chore: Replace type suppressions with accurate types Adds a Concrete helper type for registries of abstract classes, declares missing Sequelize and refractor typings, uses public ProseMirror APIs, a typed mock context helper in middleware tests, and a StaticLink component for sidebar rows being edited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH --------- Co-authored-by: Claude <noreply@anthropic.com>
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { Hook, PluginManager } from "@server/utils/PluginManager";
|
|
import { requireDirectory } from "@server/utils/fs";
|
|
import { createLazyRegistry } from "@server/utils/lazyRegistry";
|
|
import type { Concrete } from "@shared/types";
|
|
import type BaseEmail from "./BaseEmail";
|
|
|
|
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- registry of heterogeneous template Props subtypes; BaseEmail<EmailProps> isn't assignable from BaseEmail<Subtype>.
|
|
const emails = createLazyRegistry<Concrete<typeof BaseEmail<any>>>(() => {
|
|
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const registry: Record<string, Concrete<typeof BaseEmail<any>>> = {};
|
|
requireDirectory<{ default: (typeof registry)[string] }>(__dirname).forEach(
|
|
([module, id]) => {
|
|
if (id === "index") {
|
|
return;
|
|
}
|
|
registry[id] = module.default;
|
|
}
|
|
);
|
|
PluginManager.getHooks(Hook.EmailTemplate).forEach((hook) => {
|
|
registry[hook.value.name] = hook.value;
|
|
});
|
|
return registry;
|
|
});
|
|
|
|
export default emails;
|