Skip to main content
Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score100%
License
MIT
Downloads12/wk
Published3 weeks ago (2.3.4)

ActivityPub backfill support for Fedify

Classes

c

Thrown when backfill traversal exceeds the configured request budget.

Functions

f
backfill<TObject extends APObject = APObject>(
context: BackfillContext,
note: TObject,
options?: BackfillOptions<TObject>
): AsyncGenerator<BackfillItem<TObject>, void, void>

Backfills post-like objects related to a seed object.

Interfaces

I

Dependencies used by backfill traversal.

  • documentLoader: BackfillDocumentLoader

    Dereferences context collections, collection item IRIs, reply targets, and replies collections.

  • signal: AbortSignal

    Cancellation signal for the current dereference operation.

I

A single object discovered by backfill traversal.

  • depth: number

    Traversal depth.

  • id: URL

    The object's ActivityPub ID, when present.

  • object: TObject

    The discovered ActivityPub object.

  • origin: BackfillOrigin

    The source relation that produced this item.

  • strategy: BackfillStrategy

    The traversal strategy that produced this item.

I

Controls backfill traversal.

  • interval:
    Temporal.DurationLike
    | string
    | ((iteration: number) => Temporal.DurationLike | string)

    Delay between documentLoader requests.

  • maxDepth: number

    Maximum reply-tree traversal depth.

  • maxItems: number

    Maximum number of items to yield. Skipped duplicates do not count.

  • maxRequests: number

    Maximum number of calls to BackfillContext.documentLoader.

  • signal: AbortSignal

    Cancels traversal before requests and before yields.

  • strategies: readonly BackfillStrategy[]

    Backfill strategies to run.

Type Aliases

T
BackfillDocumentLoader = (
iri: URL,
options?: BackfillDocumentLoaderOptions
) => Promise<APObject | null>

Dereferences an ActivityPub object or collection IRI.

T
BackfillOrigin = "collection" | "in-reply-to" | "replies"

Source relation that produced a backfilled object.

T
BackfillStrategy =
"context-objects"
| "context-activities"
| "context-auto"
| "reply-tree"

Backfill traversal strategy used to discover the returned object.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/backfill

Import symbol

import * as mod from "@fedify/backfill";
or

Import directly with a jsr specifier

import * as mod from "jsr:@fedify/backfill";