@rmdes/indiekit-endpoint-activitypub 2.0.4 → 2.0.6

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.
@@ -208,7 +208,7 @@ export function submitComposeController(mountPath, plugin) {
208
208
  id: new URL(noteId),
209
209
  attribution: actorUri,
210
210
  content: content.trim(),
211
- inReplyTo: inReplyTo ? new URL(inReplyTo) : undefined,
211
+ replyTarget: inReplyTo ? new URL(inReplyTo) : undefined,
212
212
  published: Temporal.Now.instant(),
213
213
  to: publicAddress,
214
214
  cc: followersUri,
@@ -41,13 +41,22 @@ export function boostController(mountPath, plugin) {
41
41
  { handle, publicationUrl: plugin._publicationUrl },
42
42
  );
43
43
 
44
- const activityId = `urn:uuid:${crypto.randomUUID()}`;
44
+ const uuid = crypto.randomUUID();
45
+ const baseUrl = plugin._publicationUrl.replace(/\/$/, "");
46
+ const activityId = `${baseUrl}/activitypub/boosts/${uuid}`;
47
+
48
+ const publicAddress = new URL(
49
+ "https://www.w3.org/ns/activitystreams#Public",
50
+ );
51
+ const followersUri = ctx.getFollowersUri(handle);
45
52
 
46
53
  // Construct Announce activity
47
54
  const announce = new Announce({
48
55
  id: new URL(activityId),
49
56
  actor: ctx.getActorUri(handle),
50
57
  object: new URL(url),
58
+ to: publicAddress,
59
+ cc: followersUri,
51
60
  });
52
61
 
53
62
  // Send to followers via shared inbox
@@ -97,7 +97,9 @@ export function likeController(mountPath, plugin) {
97
97
  }
98
98
 
99
99
  // Generate a unique activity ID
100
- const activityId = `urn:uuid:${crypto.randomUUID()}`;
100
+ const uuid = crypto.randomUUID();
101
+ const baseUrl = plugin._publicationUrl.replace(/\/$/, "");
102
+ const activityId = `${baseUrl}/activitypub/likes/${uuid}`;
101
103
 
102
104
  // Construct and send Like activity
103
105
  const like = new Like({
package/lib/jf2-to-as2.js CHANGED
@@ -215,7 +215,7 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl, options =
215
215
  }
216
216
 
217
217
  if (properties["in-reply-to"]) {
218
- noteOptions.inReplyTo = new URL(properties["in-reply-to"]);
218
+ noteOptions.replyTarget = new URL(properties["in-reply-to"]);
219
219
  }
220
220
 
221
221
  // Attachments
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",