Records which dumps a dump's note and comments link to, and finds the dumps
related to one through those links. The dump and comment services keep the
links up to date, and the dump page lists the related dumps, which it
fetches again when dump_related_changed says they changed.
Tells clients that dump dumpId, which just turned public, is now related
to the dumps linked to or from it, for the dump service. Its poster saw
those links already; to everyone else they are new.
Replaces the backlinks from one text, a dump's note (dump_comment) or one
of its comments (comment), with the links its current text holds. A link
counts when it is a dump's page on this site (/@owner/dumps/<slug>), or
when it is the URL a dump was posted with, compared by canonicalizeUrl as
reposts are. The dump and
comment services call it on every save, and with an empty text when a
comment is deleted. Clients are told of the dumps it links or no longer
links, as dump_related_changed.
Usage
import * as mod from "api/services/backlink-service.ts";