@fedify/relay 2.0.0-pr.471.1920 → 2.0.0-pr.471.1923
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/dist/mod.cjs +14 -4
- package/dist/mod.js +14 -4
- package/package.json +4 -4
package/dist/mod.cjs
CHANGED
|
@@ -274,9 +274,19 @@ var LitePubRelay = class {
|
|
|
274
274
|
};
|
|
275
275
|
return [rsaPair, ed25519Pair];
|
|
276
276
|
});
|
|
277
|
-
this.#federation.setFollowingDispatcher("/users/{identifier}/following", (_ctx,
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
this.#federation.setFollowingDispatcher("/users/{identifier}/following", async (_ctx, identifier) => {
|
|
278
|
+
if (identifier !== RELAY_SERVER_ACTOR) return null;
|
|
279
|
+
const followers = await options.kv.get(["followers"]) ?? [];
|
|
280
|
+
const actors = [];
|
|
281
|
+
for (const followerId of followers) {
|
|
282
|
+
const follower = await options.kv.get(["follower", followerId]);
|
|
283
|
+
if (!follower) continue;
|
|
284
|
+
const actor = await __fedify_fedify_vocab.Object.fromJsonLd(follower.actor);
|
|
285
|
+
if (!(0, __fedify_fedify_vocab.isActor)(actor)) continue;
|
|
286
|
+
actors.push(actor);
|
|
287
|
+
}
|
|
288
|
+
return { items: actors };
|
|
289
|
+
});
|
|
280
290
|
this.#federation.setFollowersDispatcher("/users/{identifier}/followers", async (_ctx, identifier) => {
|
|
281
291
|
if (identifier !== RELAY_SERVER_ACTOR) return null;
|
|
282
292
|
const followers = await options.kv.get(["followers"]) ?? [];
|
|
@@ -338,7 +348,7 @@ var LitePubRelay = class {
|
|
|
338
348
|
if (followerData == null) return;
|
|
339
349
|
const updatedFollowerData = {
|
|
340
350
|
...followerData,
|
|
341
|
-
|
|
351
|
+
state: "accepted"
|
|
342
352
|
};
|
|
343
353
|
await options.kv.set(["follower", following.id.href], updatedFollowerData);
|
|
344
354
|
const followers = await options.kv.get(["followers"]) ?? [];
|
package/dist/mod.js
CHANGED
|
@@ -251,9 +251,19 @@ var LitePubRelay = class {
|
|
|
251
251
|
};
|
|
252
252
|
return [rsaPair, ed25519Pair];
|
|
253
253
|
});
|
|
254
|
-
this.#federation.setFollowingDispatcher("/users/{identifier}/following", (_ctx,
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
this.#federation.setFollowingDispatcher("/users/{identifier}/following", async (_ctx, identifier) => {
|
|
255
|
+
if (identifier !== RELAY_SERVER_ACTOR) return null;
|
|
256
|
+
const followers = await options.kv.get(["followers"]) ?? [];
|
|
257
|
+
const actors = [];
|
|
258
|
+
for (const followerId of followers) {
|
|
259
|
+
const follower = await options.kv.get(["follower", followerId]);
|
|
260
|
+
if (!follower) continue;
|
|
261
|
+
const actor = await Object$1.fromJsonLd(follower.actor);
|
|
262
|
+
if (!isActor(actor)) continue;
|
|
263
|
+
actors.push(actor);
|
|
264
|
+
}
|
|
265
|
+
return { items: actors };
|
|
266
|
+
});
|
|
257
267
|
this.#federation.setFollowersDispatcher("/users/{identifier}/followers", async (_ctx, identifier) => {
|
|
258
268
|
if (identifier !== RELAY_SERVER_ACTOR) return null;
|
|
259
269
|
const followers = await options.kv.get(["followers"]) ?? [];
|
|
@@ -315,7 +325,7 @@ var LitePubRelay = class {
|
|
|
315
325
|
if (followerData == null) return;
|
|
316
326
|
const updatedFollowerData = {
|
|
317
327
|
...followerData,
|
|
318
|
-
|
|
328
|
+
state: "accepted"
|
|
319
329
|
};
|
|
320
330
|
await options.kv.set(["follower", following.id.href], updatedFollowerData);
|
|
321
331
|
const followers = await options.kv.get(["followers"]) ?? [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/relay",
|
|
3
|
-
"version": "2.0.0-pr.471.
|
|
3
|
+
"version": "2.0.0-pr.471.1923+a3999270",
|
|
4
4
|
"description": "ActivityPub relay support for Fedify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fedify",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"package.json"
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@fedify/fedify": "^2.0.0-pr.471.
|
|
51
|
+
"@fedify/fedify": "^2.0.0-pr.471.1923+a3999270"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"tsdown": "^0.12.9",
|
|
55
55
|
"typescript": "^5.9.3",
|
|
56
|
-
"@fedify/testing": "^2.0.0-pr.471.
|
|
57
|
-
"@fedify/vocab-runtime": "^2.0.0-pr.471.
|
|
56
|
+
"@fedify/testing": "^2.0.0-pr.471.1923+a3999270",
|
|
57
|
+
"@fedify/vocab-runtime": "^2.0.0-pr.471.1923+a3999270"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "deno task codegen && tsdown",
|