From 3d12852835280949656ed5b8414fc1aadd7d9f9b Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Tue, 10 Sep 2024 16:39:44 +0700 Subject: [PATCH] bumbed fedify to 0.15.0-dev.375 - includes a fix to serialisation of APObjects so that we can return Actors from the followers dispatcher again - includes a new option to allow connecting to private ip addresses which can be used during testing --- package.json | 2 +- src/dispatchers.ts | 2 +- src/lookup-helpers.ts | 7 +++---- yarn.lock | 8 ++++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index fdef6af9..15a2f83d 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "wiremock-captain": "3.3.1" }, "dependencies": { - "@fedify/fedify": "0.13.0-dev.318", + "@fedify/fedify": "0.15.0-dev.375", "@hono/node-server": "1.11.1", "@js-temporal/polyfill": "0.4.4", "@sentry/node": "8.13.0", diff --git a/src/dispatchers.ts b/src/dispatchers.ts index bbbcf04b..fb89128b 100644 --- a/src/dispatchers.ts +++ b/src/dispatchers.ts @@ -315,7 +315,7 @@ function convertJsonLdToRecipient(result: any): Recipient { } export async function followersDispatcher( - ctx: RequestContext, + ctx: Context, handle: string, ) { console.log('Followers Dispatcher'); diff --git a/src/lookup-helpers.ts b/src/lookup-helpers.ts index 05a1b382..29363dab 100644 --- a/src/lookup-helpers.ts +++ b/src/lookup-helpers.ts @@ -1,13 +1,12 @@ import { isActor, - lookupObject, Actor, - RequestContext, + Context, Object as APObject, } from '@fedify/fedify'; import { ContextData } from './app'; -export async function lookupActor(ctx: RequestContext, url: string): Promise { +export async function lookupActor(ctx: Context, url: string): Promise { try { console.log('Looking up actor locally', url); const local = await ctx.data.globaldb.get([url]); @@ -22,7 +21,7 @@ export async function lookupActor(ctx: RequestContext, url: string) console.log('Looking up actor remotely', url); const documentLoader = await ctx.getDocumentLoader({handle: 'index'}); try { - const remote = await lookupObject(url, {documentLoader}); + const remote = await ctx.lookupObject(url, {documentLoader}); if (isActor(remote)) { await ctx.data.globaldb.set([url], await remote.toJsonLd()); return remote; diff --git a/yarn.lock b/yarn.lock index 9f60aff9..ffe093ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -292,10 +292,10 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== -"@fedify/fedify@0.13.0-dev.318": - version "0.13.0-dev.318" - resolved "https://registry.yarnpkg.com/@fedify/fedify/-/fedify-0.13.0-dev.318.tgz#96146859d01888cb163908049bdb4d928ade0938" - integrity sha512-xzT3iz5IA9/9Wj30X+o0t0INDeLzn/7dq75nw5u966myzT0Ejq5L//fKNmVB04rFE6vx0+DWmZtpdxOL26YoNw== +"@fedify/fedify@0.15.0-dev.375": + version "0.15.0-dev.375" + resolved "https://registry.yarnpkg.com/@fedify/fedify/-/fedify-0.15.0-dev.375.tgz#6867611f571143f67f609170e18f63f008c0e26b" + integrity sha512-VoY7PzKBjpPxM24/bD/vA2YXqv+dIiD18nTpY4IiYV3R7c27C0Js5Bc7hYNKBoe2QDygHH2q0sTH0/zL2U7uXg== dependencies: "@deno/shim-crypto" "~0.3.1" "@deno/shim-deno" "~0.18.0"