Unverified Commit d066facc authored by Hong Minhee's avatar Hong Minhee
Browse files

Remove deprecated APIs

parent 6c2db224
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -115,6 +115,12 @@ To be released.
    Instead, use the [x-forwarded-fetch] library to recognize the
    `X-Forwarded-Host` and `X-Forwarded-Proto` headers.

 -  Removed the `Federation.handle()` method which was deprecated in version
    0.6.0.

 -  Removed the `integrateHandlerOptions()` function from
    `@fedify/fedify/x/fresh` which was deprecated in version 0.6.0.

 -  Ephemeral actors and inboxes that the `fedify inbox` command spawns are
    now more interoperable with other ActivityPub implementations.

+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ an actor dispatcher for the `/users/{handle}` path. This pattern syntax
follows the [URI Template] specification.

> [!TIP]
> By registering the actor dispatcher, `Federation.handle()` automatically
> By registering the actor dispatcher, `Federation.fetch()` automatically
> deals with [WebFinger] requests for the actor.

[actors]: https://www.w3.org/TR/activitystreams-core/#actors
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ see the [next section](#nodeinfo-schema).

> [!NOTE]
> Whether or not you expose a NodeInfo endpoint, */.well-known/nodeinfo* is
> automatically handled by `Federation.handle()` method.  In case you don't
> automatically handled by `Federation.fetch()` method.  In case you don't
> register a NodeInfo dispatcher, Fedify will respond with an empty `links`
> array, e.g.:
>
+0 −22
Original line number Diff line number Diff line
@@ -1155,28 +1155,6 @@ export class Federation<TContextData> {
    }
  }

  /**
   * Handles a request related to federation.  If a request is not related to
   * federation, the `onNotFound` or `onNotAcceptable` callback is called.
   *
   * Usually, this method is called from a server's request handler or
   * a web framework's middleware.
   *
   * @param request The request object.
   * @param parameters The parameters for handling the request.
   * @returns The response to the request.
   * @deprecated Use {@link Federation.fetch} instead.
   */
  handle(
    request: Request,
    options: FederationFetchOptions<TContextData>,
  ): Promise<Response> {
    getLogger(["fedify", "federation"]).warn(
      "Federation.handle() is deprecated.  Use Federation.fetch() instead.",
    );
    return this.fetch(request, options);
  }

  /**
   * Handles a request related to federation.  If a request is not related to
   * federation, the `onNotFound` or `onNotAcceptable` callback is called.
+0 −18
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
 * @module
 * @since 0.4.0
 */
import { getLogger } from "@logtape/logtape";
import type {
  Federation,
  FederationFetchOptions,
@@ -71,23 +70,6 @@ export function integrateFetchOptions(
  };
}

/**
 * Create options for the `federation` object to integrate with Fresh.
 *
 * @param context A Fresh context.
 * @returns Options for the {@link Federation.handle} method.
 * @deprecated Use {@link integrateFetchOptions} instead.
 */
export function integrateHandlerOptions(
  context: FreshContext,
): Omit<FederationFetchOptions<void>, "contextData"> {
  getLogger(["fedify", "x", "fresh"]).warn(
    "The integrateHandlerOptions() is deprecated.  " +
      "Use the integrateFetchOptions() instead.",
  );
  return integrateFetchOptions(context);
}

/**
 * Create a Fresh middleware handler to integrate with the {@link Federation}
 * object.