From 1e30707e6b7d5ea6394318ce0e9a9584bf32315f Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 30 Jul 2024 15:00:55 +0700 Subject: [PATCH] Revert "Updated @fedify/fedify to 0.12.1 (#7)" This reverts commit e7a48739bcafd084927008e458e9b59c7375b909. --- package.json | 2 +- src/dispatchers.ts | 11 +++++----- src/user.ts | 7 +++---- yarn.lock | 52 +++++++--------------------------------------- 4 files changed, 16 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index d0087876..c85016d4 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "typescript": "5.4.5" }, "dependencies": { - "@fedify/fedify": "0.12.1", + "@fedify/fedify": "0.11.0-dev.223", "@hono/node-server": "1.11.1", "@sentry/node": "8.13.0", "hono": "4.4.6", diff --git a/src/dispatchers.ts b/src/dispatchers.ts index 4b1ee1ae..229299f8 100644 --- a/src/dispatchers.ts +++ b/src/dispatchers.ts @@ -9,7 +9,6 @@ import { Note, Activity, Update, - Context, } from '@fedify/fedify'; import { v4 as uuidv4 } from 'uuid'; import { addToList } from './kv-helpers'; @@ -29,7 +28,7 @@ export async function actorDispatcher( return person; } -export async function keypairDispatcher(ctx: Context, handle: string) { +export async function keypairDispatcher(ctx: ContextData, handle: string) { if (handle !== 'index') return []; const data = await getUserKeypair(ctx, handle); @@ -40,7 +39,7 @@ export async function keypairDispatcher(ctx: Context, handle: strin } export async function handleFollow( - ctx: Context, + ctx: RequestContext, follow: Follow, ) { console.log('Handling Follow'); @@ -77,7 +76,7 @@ export async function handleFollow( } export async function handleAccept( - ctx: Context, + ctx: RequestContext, accept: Accept, ) { console.log('Handling Accept'); @@ -109,7 +108,7 @@ export async function handleAccept( } export async function handleCreate( - ctx: Context, + ctx: RequestContext, create: Create, ) { console.log('Handling Create'); @@ -137,7 +136,7 @@ export async function handleCreate( } export async function inboxErrorHandler( - ctx: Context, + ctx: RequestContext, error: unknown, ) { console.error('Error handling incoming activity'); diff --git a/src/user.ts b/src/user.ts index 01aeba4e..ce074854 100644 --- a/src/user.ts +++ b/src/user.ts @@ -4,7 +4,6 @@ import { generateCryptoKeyPair, exportJwk, importJwk, - Context, } from '@fedify/fedify'; import { ContextData } from './app'; @@ -79,8 +78,8 @@ export async function getUserData(ctx: RequestContext, handle: stri return data; } -export async function getUserKeypair(ctx: Context, handle: string) { - const existing = await ctx.data.db.get<{ publicKey: any; privateKey: any }>([ +export async function getUserKeypair(ctx: ContextData, handle: string) { + const existing = await ctx.db.get<{ publicKey: any; privateKey: any }>([ 'keypair', handle, ]); @@ -99,7 +98,7 @@ export async function getUserKeypair(ctx: Context, handle: string) privateKey: keys.privateKey, }; - await ctx.data.db.set(['keypair', handle], { + await ctx.db.set(['keypair', handle], { publicKey: await exportJwk(data.publicKey), privateKey: await exportJwk(data.privateKey), }); diff --git a/yarn.lock b/yarn.lock index cf5559e8..823bc287 100644 --- a/yarn.lock +++ b/yarn.lock @@ -154,14 +154,13 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== -"@fedify/fedify@0.12.1": - version "0.12.1" - resolved "https://registry.yarnpkg.com/@fedify/fedify/-/fedify-0.12.1.tgz#6aa0decaa8d435a0e597bf689468c4a32502ce9c" - integrity sha512-d0NLlraraq2A3rSnhWAvZd4tk0UDYgK7Q8/SFkLBWYmVNLsTTGby4R6ejo3GpOw10fjRux2KTJcoHlvX6lgToQ== +"@fedify/fedify@0.11.0-dev.223": + version "0.11.0-dev.223" + resolved "https://registry.yarnpkg.com/@fedify/fedify/-/fedify-0.11.0-dev.223.tgz#a9796a2ecd1e1517af67c32d87252672eb0b31de" + integrity sha512-p9WqdgPvKmzX1rsmQhNUZv+Z9BNs5T9DZbCJ55XfS0N0T6xOUTHeMty6B8hWOYNdtatFIaWAaTIcwOIFBlqm1Q== dependencies: "@deno/shim-crypto" "~0.3.1" "@deno/shim-deno" "~0.18.0" - "@hugoalh/http-header-link" "^1.0.2" "@js-temporal/polyfill" "^0.4.4" "@logtape/logtape" "^0.4.0" "@phensley/language-tag" "^1.8.1" @@ -180,18 +179,6 @@ resolved "https://registry.yarnpkg.com/@hono/node-server/-/node-server-1.11.1.tgz#f4c7bea7f3d52760b1950d6b8aeb900cc59142d3" integrity sha512-GW1Iomhmm1o4Z+X57xGby8A35Cu9UZLL7pSMdqDBkD99U5cywff8F+8hLk5aBTzNubnsFAvWQ/fZjNwPsEn9lA== -"@hugoalh/http-header-link@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@hugoalh/http-header-link/-/http-header-link-1.0.2.tgz#d3d35e960b2c2c024f903b2c8718c6b4d119b85c" - integrity sha512-q28PYAwW2OtuNqJnYKqFPod9QWpqSkvPQXsY7Qo+IC+6mk4vZyb0m9UqH1zL/PD7knP/YJ9qr4amJAxe1lmfkg== - dependencies: - "@hugoalh/is-string-singleline" "1.0.2" - -"@hugoalh/is-string-singleline@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@hugoalh/is-string-singleline/-/is-string-singleline-1.0.2.tgz#b123d9c06940cb08ce372ad3512ea3c893c6b78d" - integrity sha512-58tr/0q1D+2sB37ghYKPGR82XpNp/Lo2lbxumCX9KXQ6u0aZm1p4KIl3XW5R23m11znflKbsuZZyWv7cOqkm9Q== - "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -1925,16 +1912,7 @@ sqlstring@^2.3.2: resolved "https://registry.yarnpkg.com/sqlstring/-/sqlstring-2.3.3.tgz#2ddc21f03bce2c387ed60680e739922c65751d0c" integrity sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -1952,14 +1930,7 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -2120,16 +2091,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==