@fedify/fedify 0.12.0 → 0.13.0-dev.311

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.md CHANGED
@@ -3,6 +3,42 @@
3
3
  Fedify changelog
4
4
  ================
5
5
 
6
+ Version 0.13.0
7
+ --------------
8
+
9
+ To be released.
10
+
11
+ - Removed the singular actor key pair dispatcher APIs which were deprecated
12
+ in version 0.10.0.
13
+
14
+ - Removed the last parameter of the `ActorDispatcher` callback type.
15
+ Use `Context.getActorKeyPairs()` method instead.
16
+ - Removed `ActorKeyPairDispatcher` type. Use `ActorKeyPairsDispatcher`
17
+ type instead.
18
+ - Removed `ActorCallbackSetters.setKeyPairDispatcher()` method.
19
+ Use `ActorCallbackSetters.setKeyPairsDispatcher()` method instead.
20
+ - Removed `Context.getActorKey()` method.
21
+ Use `Context.getActorKeyPairs()` method instead.
22
+
23
+ - The `Federation` is no more a class, but an interface, which has been
24
+ planned since version 0.10.0. [[#69]]
25
+
26
+ - `new Federation()` constructor is removed. Use `createFederation()`
27
+ function instead.
28
+ - Removed `Federation.sendActivity()` method.
29
+ Use `Context.sendActivity()` method instead.
30
+ - Removed `Federation` class.
31
+ - Added `Federation` interface.
32
+ - Removed `FederationParameters` interface.
33
+
34
+ - Added more log messages using the [LogTape] library. Currently the below
35
+ logger categories are used:
36
+
37
+ - `["fedify", "webfinger", "server"]`
38
+
39
+ [#69]: https://github.com/dahlia/fedify/issues/69
40
+
41
+
6
42
  Version 0.12.0
7
43
  --------------
8
44
 
@@ -17,14 +17,16 @@ export function acceptsJsonLd(request) {
17
17
  types.includes("application/json");
18
18
  }
19
19
  export async function handleActor(request, { handle, context, actorDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized, }) {
20
- if (actorDispatcher == null)
20
+ const logger = getLogger(["fedify", "federation", "actor"]);
21
+ if (actorDispatcher == null) {
22
+ logger.debug("Actor dispatcher is not set.", { handle });
21
23
  return await onNotFound(request);
22
- // FIXME: When the deprecated last parameter (key) of ActorDispatcher
23
- // is removed, replace the below line with a direct all to
24
- // actorDispatcher:
25
- const actor = await context.getActor(handle);
26
- if (actor == null)
24
+ }
25
+ const actor = await actorDispatcher(context, handle);
26
+ if (actor == null) {
27
+ logger.debug("Actor {handle} not found.", { handle });
27
28
  return await onNotFound(request);
29
+ }
28
30
  if (!acceptsJsonLd(request))
29
31
  return await onNotAcceptable(request);
30
32
  if (authorizePredicate != null) {
@@ -173,7 +175,7 @@ export async function handleInbox(request, { handle, context, kv, kvPrefixes, qu
173
175
  return await onNotFound(request);
174
176
  }
175
177
  else if (handle != null) {
176
- const actor = await context.getActor(handle);
178
+ const actor = await actorDispatcher(context, handle);
177
179
  if (actor == null) {
178
180
  logger.error("Actor {handle} not found.", { handle });
179
181
  return await onNotFound(request);