@drupflare/spool - v0.1.0
    Preparing search index...

    Type Alias Spool

    what createSpool returns

    type Spool = {
        config: SwConfig;
        decorate(
            request: Request,
            response: Response,
            options?: DecorateOptions,
        ): Promise<Response>;
        handle(
            request: Request,
            next: (request: Request) => Response | Promise<Response>,
        ): Promise<Response>;
        invalidate(
            tags: readonly string[],
            options?: { drop?: readonly string[] },
        ): Promise<number>;
        partition(principal: string): Promise<string>;
        respond(request: Request): Promise<Response | undefined>;
        stub(): Response;
    }
    Index
    config: SwConfig

    the config embedded in the worker script

    • adds the envelope headers and the client tag to a response the app produced

      Parameters

      Returns Promise<Response>

    • answers /.spool/* and the worker script, otherwise calls next and decorates

      Parameters

      • request: Request
      • next: (request: Request) => Response | Promise<Response>

      Returns Promise<Response>

    • bumps the vector after a write; drop also removes artifacts by id

      Parameters

      • tags: readonly string[]
      • Optionaloptions: { drop?: readonly string[] }

      Returns Promise<number>

    • The Spool-Partition value for a principal. A login or account-switch handler sets it on its own response, since the request it answers still carries the old identity: the worker then swaps its store before any local view can read the old one.

      Parameters

      • principal: string

      Returns Promise<string>

    • a Response for /.spool/*, undefined for anything else

      Parameters

      • request: Request

      Returns Promise<Response | undefined>