mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
refactor(domain): make FeedId circulate through the domain and repository
FeedId is now the type of Feed.id and of every single-feed method on FeedRepository; callers wrap raw strings via FeedId.fromTrusted at the repository boundary. String-medium operations (URLs, logs, JSON, list registry, email keys) stay string. Drop the redundant generateFeedId wrapper in favour of FeedId.generate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -8,6 +8,7 @@ import { waitUntilSafe } from "../utils/worker";
|
||||
import { DEFAULT_LEASE_SECONDS, MAX_LEASE_SECONDS } from "../config/constants";
|
||||
import { feedTopicPattern } from "../utils/urls";
|
||||
import { FeedRepository } from "../domain/feed-repository";
|
||||
import { FeedId } from "../domain/value-objects/feed-id";
|
||||
|
||||
type AppEnv = { Bindings: Env };
|
||||
|
||||
@@ -74,7 +75,9 @@ hubRouter.post("/", async (c) => {
|
||||
const feedId = match[2];
|
||||
|
||||
// Verify the feed exists before accepting any subscription
|
||||
const feedConfig = await FeedRepository.from(env).getConfig(feedId);
|
||||
const feedConfig = await FeedRepository.from(env).getConfig(
|
||||
FeedId.fromTrusted(feedId),
|
||||
);
|
||||
if (!feedConfig) {
|
||||
return c.text("Not Found: feed does not exist", 404);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user