@fedify/fedify 1.6.1-dev.869 → 1.6.1-dev.873
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/{vocab/actor.js → actor-DhyIYEBl.js} +5 -4
- package/dist/{vocab/actor.d.ts → actor-lFlm8FYo.d.ts} +2 -2
- package/dist/actor-trV1ExpS.js +36173 -0
- package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js → assert-Dv75vaGI.js} +2 -1
- package/dist/assert_equals-ClvzlhZu.js +1020 -0
- package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js → assert_instance_of--9UCVKsi.js} +2 -1
- package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js → assert_is_error-D162gXcM.js} +2 -2
- package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js → assert_not_equals-Cyf5m9Ke.js} +2 -2
- package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_rejects.js → assert_rejects-FOHCtlD2.js} +23 -3
- package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js → assert_throws-CRfQJvVx.js} +3 -2
- package/dist/authdocloader-4i4HAp9R.js +51 -0
- package/dist/{runtime/authdocloader.js → authdocloader-BXgFJugo.js} +5 -4
- package/dist/{federation/builder.js → builder-Bh56oIkr.js} +6 -5
- package/dist/{_virtual/rolldown_runtime.js → chunk-HsBuZ-b2.js} +1 -0
- package/dist/{nodeinfo/client.js → client-BoT1mhNh.js} +3 -2
- package/dist/client-Dw1pCSIt.d.ts +299 -0
- package/dist/{federation/collection.js → collection-QaGK9TVn.js} +1 -0
- package/dist/compat/mod.d.ts +12 -2
- package/dist/compat/mod.js +2 -1
- package/dist/compat/transformers.test.d.ts +2 -1
- package/dist/compat/transformers.test.js +32 -8
- package/dist/{testing/context.js → context-B2499YhO.js} +5 -4
- package/dist/context-CzJXjNR8.d.ts +2034 -0
- package/dist/{x/denokv.js → denokv-iB_ggPGm.js} +3 -1
- package/dist/{testing/docloader.js → docloader-09nVWLAZ.js} +1 -0
- package/dist/{runtime/contexts.js → docloader-CMlE_DQr.js} +420 -1
- package/dist/{runtime/docloader.d.ts → docloader-DTRsVZPo.d.ts} +1 -1
- package/dist/docloader-lJiW6zUk.js +4594 -0
- package/dist/esm-BxIKwi-M.js +1221 -0
- package/dist/federation/builder.test.d.ts +2 -1
- package/dist/federation/builder.test.js +21 -7
- package/dist/federation/collection.test.d.ts +2 -1
- package/dist/federation/collection.test.js +11 -3
- package/dist/federation/handler.test.d.ts +2 -1
- package/dist/federation/handler.test.js +40 -12
- package/dist/federation/inbox.test.d.ts +2 -1
- package/dist/federation/inbox.test.js +12 -5
- package/dist/federation/keycache.test.d.ts +2 -1
- package/dist/federation/keycache.test.js +12 -7
- package/dist/federation/kv.test.d.ts +2 -1
- package/dist/federation/kv.test.js +11 -3
- package/dist/federation/middleware.test.d.ts +2 -1
- package/dist/federation/middleware.test.js +107 -26
- package/dist/federation/mod.d.ts +13 -13
- package/dist/federation/mod.js +12 -8
- package/dist/federation/mq.test.d.ts +2 -1
- package/dist/federation/mq.test.js +153 -6
- package/dist/federation/retry.test.d.ts +2 -1
- package/dist/federation/retry.test.js +5 -5
- package/dist/federation/router.test.d.ts +2 -1
- package/dist/federation/router.test.js +11 -6
- package/dist/federation/send.test.d.ts +2 -1
- package/dist/federation/send.test.js +25 -13
- package/dist/{federation/mq.js → federation-Bmj7soSg.js} +47 -1
- package/dist/{node_modules/.pnpm/@jsr_hongminhee__deno-mock-fetch@0.3.2/node_modules/@jsr/hongminhee__deno-mock-fetch/router.js → hongminhee__deno-mock-fetch-DJKLj_H-.js} +96 -1
- package/dist/http-BImJcLfv.d.ts +258 -0
- package/dist/{sig/http.js → http-CFQSpmJT.js} +5 -4
- package/dist/http-DtHTiemN.js +720 -0
- package/dist/{federation/inbox.js → inbox-DkHjiHqX.js} +4 -3
- package/dist/key-B5Eb05gk.js +16 -0
- package/dist/key-BYBj-UD-.js +10 -0
- package/dist/key-CkoTQfVN.js +262 -0
- package/dist/{sig/key.js → key-a7_2L5_Z.js} +2 -4
- package/dist/{federation/keycache.js → keycache-D8j8RFWf.js} +2 -1
- package/dist/{testing/keys.js → keys-DxEMe-K1.js} +2 -2
- package/dist/{federation/kv.js → kv-DohFOP2C.js} +1 -0
- package/dist/{runtime/langstr.js → langstr-DbWheeIS.js} +1 -0
- package/dist/{sig/ld.js → ld-I1s-XiQ5.js} +6 -6
- package/dist/{vocab/lookup.js → lookup--9t_F8FE.js} +5 -5
- package/dist/lookup-BDLFt_tc.js +131 -0
- package/dist/{webfinger/lookup.js → lookup-BUFWWv5q.js} +1 -3
- package/dist/{webfinger/jrd.d.ts → lookup-DAfStZtI.d.ts} +41 -1
- package/dist/middleware-BPXHlM9G.js +17 -0
- package/dist/middleware-ByU_X6O9.js +33 -0
- package/dist/middleware-CNVKIPYL.js +3525 -0
- package/dist/{federation/middleware.js → middleware-ewowwb4s.js} +957 -105
- package/dist/mod-1pDWKvUL.d.ts +2 -0
- package/dist/{runtime/key.d.ts → mod-BxwG4X3V.d.ts} +52 -7
- package/dist/{compat/transformers.d.ts → mod-CeLnlsqE.d.ts} +3 -4
- package/dist/{vocab/lookup.d.ts → mod-DysVoXOu.d.ts} +98 -3
- package/dist/mod-GIh5OYxW.d.ts +2 -0
- package/dist/{sig/ld.d.ts → mod-XT0mRthe.d.ts} +126 -4
- package/dist/mod-g0xFzAP9.d.ts +2 -0
- package/dist/mod.d.ts +18 -34
- package/dist/mod.js +17 -27
- package/dist/multibase-DeCHcK8L.js +316 -0
- package/dist/nodeinfo/client.test.d.ts +2 -1
- package/dist/nodeinfo/client.test.js +15 -4
- package/dist/nodeinfo/handler.test.d.ts +2 -1
- package/dist/nodeinfo/handler.test.js +39 -7
- package/dist/nodeinfo/mod.d.ts +4 -3
- package/dist/nodeinfo/mod.js +3 -3
- package/dist/nodeinfo/semver.test.d.ts +2 -1
- package/dist/nodeinfo/semver.test.js +11 -4
- package/dist/nodeinfo/types.test.d.ts +2 -1
- package/dist/nodeinfo/types.test.js +12 -4
- package/dist/{sig/owner.js → owner-2Gouxs6Y.js} +4 -4
- package/dist/{sig/owner.d.ts → owner-BjpObx-L.d.ts} +4 -6
- package/dist/proof-BcNfBguh.js +595 -0
- package/dist/{sig/proof.js → proof-CJ291J94.js} +5 -4
- package/dist/{federation/retry.js → retry-BiIhZWgD.js} +1 -0
- package/dist/{federation/router.js → router-D_aVZZUc.js} +1 -0
- package/dist/runtime/authdocloader.test.d.ts +2 -1
- package/dist/runtime/authdocloader.test.js +24 -9
- package/dist/runtime/docloader.test.d.ts +2 -1
- package/dist/runtime/docloader.test.js +15 -11
- package/dist/runtime/key.test.d.ts +2 -1
- package/dist/runtime/key.test.js +19 -4
- package/dist/runtime/langstr.test.d.ts +2 -1
- package/dist/runtime/langstr.test.js +11 -3
- package/dist/runtime/mod.d.ts +5 -4
- package/dist/runtime/mod.js +7 -4
- package/dist/runtime/multibase/multibase.test.d.ts +2 -1
- package/dist/runtime/multibase/multibase.test.js +11 -5
- package/dist/runtime/url.test.d.ts +2 -1
- package/dist/runtime/url.test.js +7 -6
- package/dist/{nodeinfo/semver.js → semver-CbbIgUsa.js} +1 -0
- package/dist/{federation/send.js → send-BFMnzlj7.js} +3 -2
- package/dist/sig/http.test.d.ts +2 -1
- package/dist/sig/http.test.js +23 -12
- package/dist/sig/key.test.d.ts +2 -1
- package/dist/sig/key.test.js +21 -8
- package/dist/sig/ld.test.d.ts +2 -1
- package/dist/sig/ld.test.js +19 -11
- package/dist/sig/mod.d.ts +7 -5
- package/dist/sig/mod.js +7 -5
- package/dist/sig/owner.test.d.ts +2 -1
- package/dist/sig/owner.test.js +23 -9
- package/dist/sig/proof.test.d.ts +2 -1
- package/dist/sig/proof.test.js +22 -10
- package/dist/std__assert-CaBUULmX.js +151 -0
- package/dist/testing/docloader.test.d.ts +2 -1
- package/dist/testing/docloader.test.js +11 -3
- package/dist/testing/mod.d.ts +1 -0
- package/dist/testing/mod.js +2 -136
- package/dist/testing-jcGLO9Lp.js +143 -0
- package/dist/{compat/transformers.js → transformers-jxj-4o2K.js} +1 -1
- package/dist/{vocab/type.js → type-D2s5lmbZ.js} +1 -0
- package/dist/{nodeinfo/types.js → types-CqoqWDkp.js} +2 -1
- package/dist/types-Cx0IUMu0.js +457 -0
- package/dist/{runtime/url.js → url-kTAI6_KP.js} +1 -0
- package/dist/vocab/actor.test.d.ts +2 -1
- package/dist/vocab/actor.test.js +5853 -14
- package/dist/vocab/lookup.test.d.ts +2 -1
- package/dist/vocab/lookup.test.js +20 -7
- package/dist/vocab/mod.d.ts +5 -5
- package/dist/vocab/mod.js +4 -5
- package/dist/vocab/type.test.d.ts +2 -1
- package/dist/vocab/type.test.js +9 -4
- package/dist/vocab/vocab.test.d.ts +2 -1
- package/dist/vocab/vocab.test.js +2440 -15
- package/dist/{vocab/vocab.d.ts → vocab-CLWdoo7y.d.ts} +21 -9
- package/dist/{vocab/vocab.js → vocab-Dwop3xOF.js} +331 -182
- package/dist/vocab-uQObf7P6.js +172 -0
- package/dist/webfinger/handler.test.d.ts +2 -1
- package/dist/webfinger/handler.test.js +39 -7
- package/dist/webfinger/lookup.test.d.ts +2 -1
- package/dist/webfinger/lookup.test.js +14 -4
- package/dist/webfinger/mod.d.ts +4 -2
- package/dist/webfinger/mod.js +3 -1
- package/dist/x/cfworkers.d.ts +49 -0
- package/dist/x/cfworkers.js +73 -0
- package/dist/x/cfworkers.test.d.ts +3 -0
- package/dist/x/cfworkers.test.js +153 -0
- package/dist/x/hono.d.ts +11 -2
- package/dist/x/sveltekit.d.ts +11 -2
- package/package.json +6 -1
- package/dist/codegen/fs.js +0 -23
- package/dist/codegen/schema.js +0 -88
- package/dist/codegen/type.js +0 -392
- package/dist/compat/types.d.ts +0 -18
- package/dist/deno.js +0 -137
- package/dist/federation/builder.d.ts +0 -19
- package/dist/federation/callback.d.ts +0 -211
- package/dist/federation/collection.d.ts +0 -36
- package/dist/federation/context.d.ts +0 -757
- package/dist/federation/federation.d.ts +0 -689
- package/dist/federation/handler.d.ts +0 -44
- package/dist/federation/handler.js +0 -543
- package/dist/federation/middleware.d.ts +0 -101
- package/dist/federation/negotiation.js +0 -63
- package/dist/federation/retry.d.ts +0 -71
- package/dist/federation/router.d.ts +0 -92
- package/dist/federation/send.d.ts +0 -29
- package/dist/node_modules/.pnpm/@jsr_hongminhee__deno-mock-fetch@0.3.2/node_modules/@jsr/hongminhee__deno-mock-fetch/mod.js +0 -101
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_equals.js +0 -49
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js +0 -32
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js +0 -26
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater.js +0 -34
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js +0 -34
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_strict_equals.js +0 -53
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js +0 -32
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assertion_error.js +0 -33
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/equal.js +0 -79
- package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/mod.js +0 -19
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/assertion_state.js +0 -177
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/build_message.js +0 -101
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/diff.js +0 -274
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/diff_str.js +0 -148
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/format.js +0 -37
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/mod.js +0 -10
- package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/styles.js +0 -172
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/assert_path.js +0 -11
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/constants.js +0 -10
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/dirname.js +0 -14
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/from_file_url.js +0 -13
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize.js +0 -14
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize_string.js +0 -60
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/strip_trailing_separators.js +0 -15
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_os.js +0 -9
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/extname.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/format.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/from_file_url.js +0 -34
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/glob_to_regexp.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/is_absolute.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/join.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/join_globs.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/mod.js +0 -5
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/normalize.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/normalize_glob.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/parse.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/_util.js +0 -13
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js +0 -54
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js +0 -27
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/join.js +0 -47
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js +0 -59
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/relative.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/resolve.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/to_file_url.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/to_namespaced_path.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js +0 -31
- package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/_strip.js +0 -17
- package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/dirname.js +0 -38
- package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/join.js +0 -36
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_chars.js +0 -47
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_dumper_state.js +0 -4
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_loader_state.js +0 -884
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_schema.js +0 -120
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/binary.js +0 -92
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/bool.js +0 -41
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/float.js +0 -58
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/int.js +0 -118
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/map.js +0 -18
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/merge.js +0 -14
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/nil.js +0 -23
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/omap.js +0 -31
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/pairs.js +0 -22
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/regexp.js +0 -29
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/seq.js +0 -14
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/set.js +0 -17
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/str.js +0 -14
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/timestamp.js +0 -57
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/undefined.js +0 -24
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_utils.js +0 -17
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/mod.js +0 -5
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/parse.js +0 -54
- package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/stringify.js +0 -4
- package/dist/node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js +0 -68
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/AlwaysShrinkableArbitrary.js +0 -30
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayArbitrary.js +0 -203
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayInt64Arbitrary.js +0 -122
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/BigIntArbitrary.js +0 -63
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ConstantArbitrary.js +0 -58
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/FrequencyArbitrary.js +0 -136
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/IntegerArbitrary.js +0 -64
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/LazyArbitrary.js +0 -29
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/StringUnitArbitrary.js +0 -45
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/TupleArbitrary.js +0 -74
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/WithShrinkFromOtherArbitrary.js +0 -40
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/AnyArbitraryBuilder.js +0 -97
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/BoxedArbitraryBuilder.js +0 -13
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/CharacterArbitraryBuilder.js +0 -17
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.js +0 -23
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.js +0 -32
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/data/GraphemeRanges.js +0 -990
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ArrayInt64.js +0 -98
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BiasNumericRange.js +0 -53
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BuildSlicedGenerator.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/CustomEqualSet.js +0 -27
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DepthContext.js +0 -24
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleHelpers.js +0 -96
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleOnlyHelpers.js +0 -25
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatHelpers.js +0 -57
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatOnlyHelpers.js +0 -26
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatingOnlyHelpers.js +0 -26
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/GraphemeRangesHelpers.js +0 -58
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/MaxLengthFromMinLength.js +0 -72
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/NoUndefinedAsContext.js +0 -16
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/QualifiedObjectConstraints.js +0 -58
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueSet.js +0 -41
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueZeroSet.js +0 -33
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkBigInt.js +0 -37
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkInteger.js +0 -41
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SlicesForStringBuilder.js +0 -74
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/StrictlyEqualSet.js +0 -38
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/TokenizeString.js +0 -47
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/NoopSlicedGenerator.js +0 -21
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/SlicedBasedGenerator.js +0 -53
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToMap.js +0 -16
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToSet.js +0 -16
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/CodePointsToString.js +0 -17
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToCharString.js +0 -20
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToMappedConstant.js +0 -69
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToPrintableIndex.js +0 -18
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/KeyValuePairsToObject.js +0 -42
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/PatternsToString.js +0 -32
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/TimeToDate.js +0 -30
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/UnboxedToBoxed.js +0 -22
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/anything.js +0 -14
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/array.js +0 -22
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/bigInt.js +0 -38
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/boolean.js +0 -24
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/constant.js +0 -13
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/constantFrom.js +0 -14
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/date.js +0 -30
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/dictionary.js +0 -27
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/double.js +0 -54
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float.js +0 -60
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float32Array.js +0 -22
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float64Array.js +0 -22
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/fullUnicode.js +0 -24
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/fullUnicodeString.js +0 -20
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int16Array.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int32Array.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int8Array.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/integer.js +0 -26
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/letrec.js +0 -28
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/mapToConstant.js +0 -26
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/maxSafeInteger.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/nat.js +0 -17
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/noBias.js +0 -11
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/oneof.js +0 -31
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/sparseArray.js +0 -68
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/string.js +0 -32
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/tuple.js +0 -13
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint16Array.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint32Array.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint8Array.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint8ClampedArray.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uniqueArray.js +0 -47
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/arbitrary/definition/Arbitrary.js +0 -184
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/arbitrary/definition/Value.js +0 -31
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js +0 -19
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/IRawProperty.js +0 -12
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/IgnoreEqualValuesProperty.js +0 -52
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/Property.generic.js +0 -77
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/Property.js +0 -22
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/SkipAfterProperty.js +0 -61
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/TimeoutProperty.js +0 -52
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/UnbiasedProperty.js +0 -29
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/DecorateProperty.js +0 -26
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/Runner.js +0 -61
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/RunnerIterator.js +0 -47
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/SourceValuesIterator.js +0 -35
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/Tosser.js +0 -33
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/GlobalParameters.js +0 -12
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/QualifiedParameters.js +0 -121
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/VerbosityLevel.js +0 -14
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/reporter/ExecutionStatus.js +0 -14
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/reporter/RunExecution.js +0 -116
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/utils/PathWalker.js +0 -24
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/utils/RunDetailsFormatter.js +0 -135
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/symbols.js +0 -15
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/random/generator/Random.js +0 -48
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/LazyIterableIterator.js +0 -24
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/Stream.js +0 -84
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/StreamHelpers.js +0 -50
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/apply.js +0 -28
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/globals.js +0 -309
- package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/stringify.js +0 -217
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/CallHistory.js +0 -94
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/FetchMock.js +0 -143
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/IsSubsetOf.js +0 -103
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Matchers.js +0 -195
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/RequestUtils.js +0 -83
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Route.js +0 -137
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Router.js +0 -181
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/StatusTextMap.js +0 -73
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/TypeDescriptor.js +0 -97
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/index.js +0 -11
- package/dist/node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js +0 -87
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js +0 -20
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js +0 -20
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js +0 -20
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js +0 -20
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js +0 -32
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js +0 -43
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js +0 -139
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js +0 -26
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js +0 -14
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/LinearCongruential.js +0 -53
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/MersenneTwister.js +0 -114
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/RandomGenerator.js +0 -26
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/XorShift.js +0 -83
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/XoroShiro.js +0 -83
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/pure-rand-default.js +0 -44
- package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/pure-rand.js +0 -22
- package/dist/node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.js +0 -37
- package/dist/nodeinfo/client.d.ts +0 -96
- package/dist/nodeinfo/handler.js +0 -46
- package/dist/nodeinfo/semver.d.ts +0 -78
- package/dist/nodeinfo/types.d.ts +0 -140
- package/dist/runtime/authdocloader.d.ts +0 -56
- package/dist/runtime/docloader.js +0 -291
- package/dist/runtime/key.js +0 -156
- package/dist/runtime/langstr.d.ts +0 -24
- package/dist/runtime/multibase/base.js +0 -32
- package/dist/runtime/multibase/constants.js +0 -172
- package/dist/runtime/multibase/index.js +0 -57
- package/dist/runtime/multibase/rfc4648.js +0 -61
- package/dist/runtime/multibase/util.js +0 -21
- package/dist/sig/http.d.ts +0 -143
- package/dist/sig/key.d.ts +0 -125
- package/dist/sig/proof.d.ts +0 -134
- package/dist/testing/fixtures/example.com/person.js +0 -29
- package/dist/testing/fixtures/example.com/person2.js +0 -48
- package/dist/vocab/constants.d.ts +0 -24
- package/dist/vocab/constants.js +0 -17
- package/dist/vocab/type.d.ts +0 -107
- package/dist/webfinger/handler.js +0 -140
- package/dist/webfinger/lookup.d.ts +0 -47
- /package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_object_match.js → compat-Bb5myD13.js} +0 -0
- /package/dist/{testing/fixtures → fixtures}/activitypub.academy/users/brauca_darradiul.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/announce.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/collection.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/create.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/cross-origin-actor.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/hong-gildong.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/invite.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/key.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/key2.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/object.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/orderedcollectionpage.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/paged/a.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/paged/b.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/paged-collection.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/person.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/person2.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/test.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/users/handle.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/example.com/wrong-type.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/remote.domain/users/bob.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/server.example/users/alice.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/w3id.org/identity/v1.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/w3id.org/security/data-integrity/v1.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/w3id.org/security/multikey/v1.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/w3id.org/security/v1.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/wizard.casa/users/hongminhee.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/www.w3.org/ns/activitystreams.json +0 -0
- /package/dist/{testing/fixtures → fixtures}/www.w3.org/ns/did/v1.json +0 -0
- /package/dist/{federation/kv.d.ts → kv-BmsWxOQ2.d.ts} +0 -0
- /package/dist/{federation/mq.d.ts → mq-Bue016Tz.d.ts} +0 -0
- /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/basename.js → nodeinfo-CyEbLjHs.js} +0 -0
- /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/common.js → runtime-BSkOVUWM.js} +0 -0
- /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/constants.js → sig-BXJO--F9.js} +0 -0
- /package/dist/{codegen → vocab}/schema.yaml +0 -0
- /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/dirname.js → webfinger-C3GIyXIg.js} +0 -0
@@ -1,35 +1,887 @@
|
|
1
1
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
4
5
|
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import { Activity, CryptographicKey, Multikey } from "
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import {
|
21
|
-
import {
|
22
|
-
import {
|
23
|
-
import {
|
24
|
-
import {
|
25
|
-
import { lookupObject, traverseCollection } from "../vocab/lookup.js";
|
26
|
-
import { handleWebFinger } from "../webfinger/handler.js";
|
27
|
-
import { createExponentialBackoffPolicy } from "./retry.js";
|
28
|
-
import { extractInboxes, sendActivity } from "./send.js";
|
6
|
+
import { deno_default, getDocumentLoader, kvCache } from "./docloader-CMlE_DQr.js";
|
7
|
+
import { getNodeInfo } from "./client-BoT1mhNh.js";
|
8
|
+
import { RouterError } from "./router-D_aVZZUc.js";
|
9
|
+
import { nodeInfoToJson } from "./types-CqoqWDkp.js";
|
10
|
+
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage } from "./vocab-Dwop3xOF.js";
|
11
|
+
import { lookupWebFinger } from "./lookup-BDLFt_tc.js";
|
12
|
+
import { getTypeId } from "./type-D2s5lmbZ.js";
|
13
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-CkoTQfVN.js";
|
14
|
+
import { verifyRequest } from "./http-CFQSpmJT.js";
|
15
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-BXgFJugo.js";
|
16
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-I1s-XiQ5.js";
|
17
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-2Gouxs6Y.js";
|
18
|
+
import { signObject, verifyObject } from "./proof-CJ291J94.js";
|
19
|
+
import { lookupObject, traverseCollection } from "./lookup--9t_F8FE.js";
|
20
|
+
import { routeActivity } from "./inbox-DkHjiHqX.js";
|
21
|
+
import { FederationBuilderImpl } from "./builder-Bh56oIkr.js";
|
22
|
+
import { buildCollectionSynchronizationHeader } from "./collection-QaGK9TVn.js";
|
23
|
+
import { KvKeyCache } from "./keycache-D8j8RFWf.js";
|
24
|
+
import { createExponentialBackoffPolicy } from "./retry-BiIhZWgD.js";
|
25
|
+
import { extractInboxes, sendActivity } from "./send-BFMnzlj7.js";
|
29
26
|
import { getLogger, withContext } from "@logtape/logtape";
|
30
27
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
31
28
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
29
|
+
import { domainToASCII } from "node:url";
|
32
30
|
|
31
|
+
//#region compat/transformers.ts
|
32
|
+
const logger$1 = getLogger([
|
33
|
+
"fedify",
|
34
|
+
"compat",
|
35
|
+
"transformers"
|
36
|
+
]);
|
37
|
+
/**
|
38
|
+
* An activity transformer that assigns a new random ID to an activity if it
|
39
|
+
* does not already have one. This is useful for ensuring that activities
|
40
|
+
* have an ID before they are sent to other servers.
|
41
|
+
*
|
42
|
+
* The generated ID is an origin URI with a fragment which contains an activity
|
43
|
+
* type name with a random UUID:
|
44
|
+
*
|
45
|
+
* ```
|
46
|
+
* https://example.com/#Follow/12345678-1234-5678-1234-567812345678
|
47
|
+
* ```
|
48
|
+
*
|
49
|
+
* @typeParam TContextData The type of the context data.
|
50
|
+
* @param activity The activity to assign an ID to.
|
51
|
+
* @param context The context of the activity.
|
52
|
+
* @return The activity with an ID assigned.
|
53
|
+
* @since 1.4.0
|
54
|
+
*/
|
55
|
+
function autoIdAssigner(activity, context$1) {
|
56
|
+
if (activity.id != null) return activity;
|
57
|
+
const id = new URL(`/#${activity.constructor.name}/${crypto.randomUUID()}`, context$1.origin);
|
58
|
+
logger$1.warn("As the activity to send does not have an id, a new id {id} has been generated for it. However, it is recommended to explicitly set the id for the activity.", { id: id.href });
|
59
|
+
return activity.clone({ id });
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* An activity transformer that dehydrates the actor property of an activity
|
63
|
+
* so that it only contains the actor's URI. For example, suppose we have an
|
64
|
+
* activity like this:
|
65
|
+
*
|
66
|
+
* ```typescript
|
67
|
+
* import { Follow, Person } from "@fedify/fedify/vocab";
|
68
|
+
* const input = new Follow({
|
69
|
+
* id: new URL("http://example.com/activities/1"),
|
70
|
+
* actor: new Person({
|
71
|
+
* id: new URL("http://example.com/actors/1"),
|
72
|
+
* name: "Alice",
|
73
|
+
* preferredUsername: "alice",
|
74
|
+
* }),
|
75
|
+
* object: new Person({
|
76
|
+
* id: new URL("http://example.com/actors/2"),
|
77
|
+
* name: "Bob",
|
78
|
+
* preferredUsername: "bob",
|
79
|
+
* }),
|
80
|
+
* });
|
81
|
+
* ```
|
82
|
+
*
|
83
|
+
* The result of applying this transformer would be:
|
84
|
+
*
|
85
|
+
* ```typescript
|
86
|
+
* import { Follow, Person } from "@fedify/fedify/vocab";
|
87
|
+
* const output = new Follow({
|
88
|
+
* id: new URL("http://example.com/activities/1"),
|
89
|
+
* actor: new URL("http://example.com/actors/1"),
|
90
|
+
* object: new Person({
|
91
|
+
* id: new URL("http://example.com/actors/2"),
|
92
|
+
* name: "Bob",
|
93
|
+
* preferredUsername: "bob",
|
94
|
+
* }),
|
95
|
+
* });
|
96
|
+
* ```
|
97
|
+
*
|
98
|
+
* As some ActivityPub implementations like Threads fail to deal with inlined
|
99
|
+
* actor objects, this transformer can be used to work around this issue.
|
100
|
+
* @typeParam TContextData The type of the context data.
|
101
|
+
* @param activity The activity to dehydrate the actor property of.
|
102
|
+
* @param context The context of the activity.
|
103
|
+
* @returns The dehydrated activity.
|
104
|
+
* @since 1.4.0
|
105
|
+
*/
|
106
|
+
function actorDehydrator(activity, _context) {
|
107
|
+
if (activity.actorIds.length < 1) return activity;
|
108
|
+
return activity.clone({ actors: activity.actorIds });
|
109
|
+
}
|
110
|
+
/**
|
111
|
+
* Gets the default activity transformers that are applied to all outgoing
|
112
|
+
* activities.
|
113
|
+
* @typeParam TContextData The type of the context data.
|
114
|
+
* @returns The default activity transformers.
|
115
|
+
* @since 1.4.0
|
116
|
+
*/
|
117
|
+
function getDefaultActivityTransformers() {
|
118
|
+
return [autoIdAssigner, actorDehydrator];
|
119
|
+
}
|
120
|
+
|
121
|
+
//#endregion
|
122
|
+
//#region nodeinfo/handler.ts
|
123
|
+
/**
|
124
|
+
* Handles a NodeInfo request. You would not typically call this function
|
125
|
+
* directly, but instead use {@link Federation.handle} method.
|
126
|
+
* @param request The NodeInfo request to handle.
|
127
|
+
* @param parameters The parameters for handling the request.
|
128
|
+
* @returns The response to the request.
|
129
|
+
*/
|
130
|
+
async function handleNodeInfo(_request, { context: context$1, nodeInfoDispatcher }) {
|
131
|
+
const promise = nodeInfoDispatcher(context$1);
|
132
|
+
const nodeInfo = promise instanceof Promise ? await promise : promise;
|
133
|
+
const json = nodeInfoToJson(nodeInfo);
|
134
|
+
return new Response(JSON.stringify(json), { headers: { "Content-Type": "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.1#\"" } });
|
135
|
+
}
|
136
|
+
/**
|
137
|
+
* Handles a request to `/.well-known/nodeinfo`. You would not typically call
|
138
|
+
* this function directly, but instead use {@link Federation.handle} method.
|
139
|
+
* @param request The request to handle.
|
140
|
+
* @param context The request context.
|
141
|
+
* @returns The response to the request.
|
142
|
+
*/
|
143
|
+
function handleNodeInfoJrd(_request, context$1) {
|
144
|
+
const links = [];
|
145
|
+
try {
|
146
|
+
links.push({
|
147
|
+
rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
|
148
|
+
href: context$1.getNodeInfoUri().href,
|
149
|
+
type: "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.1#\""
|
150
|
+
});
|
151
|
+
} catch (e) {
|
152
|
+
if (!(e instanceof RouterError)) throw e;
|
153
|
+
}
|
154
|
+
const jrd = { links };
|
155
|
+
const response = new Response(JSON.stringify(jrd), { headers: { "Content-Type": "application/jrd+json" } });
|
156
|
+
return Promise.resolve(response);
|
157
|
+
}
|
158
|
+
|
159
|
+
//#endregion
|
160
|
+
//#region vocab/constants.ts
|
161
|
+
/**
|
162
|
+
* The special public collection for [public addressing]. *Do not mutate this
|
163
|
+
* object.*
|
164
|
+
*
|
165
|
+
* [public addressing]: https://www.w3.org/TR/activitypub/#public-addressing
|
166
|
+
*
|
167
|
+
* @since 0.7.0
|
168
|
+
*/
|
169
|
+
const PUBLIC_COLLECTION = new URL("https://www.w3.org/ns/activitystreams#Public");
|
170
|
+
|
171
|
+
//#endregion
|
172
|
+
//#region webfinger/handler.ts
|
173
|
+
const logger = getLogger([
|
174
|
+
"fedify",
|
175
|
+
"webfinger",
|
176
|
+
"server"
|
177
|
+
]);
|
178
|
+
/**
|
179
|
+
* Handles a WebFinger request. You would not typically call this function
|
180
|
+
* directly, but instead use {@link Federation.fetch} method.
|
181
|
+
* @param request The WebFinger request to handle.
|
182
|
+
* @param parameters The parameters for handling the request.
|
183
|
+
* @returns The response to the request.
|
184
|
+
*/
|
185
|
+
async function handleWebFinger(request, options) {
|
186
|
+
if (options.tracer == null) return await handleWebFingerInternal(request, options);
|
187
|
+
return await options.tracer.startActiveSpan("webfinger.handle", { kind: SpanKind.SERVER }, async (span) => {
|
188
|
+
try {
|
189
|
+
const response = await handleWebFingerInternal(request, options);
|
190
|
+
span.setStatus({ code: response.ok ? SpanStatusCode.UNSET : SpanStatusCode.ERROR });
|
191
|
+
return response;
|
192
|
+
} catch (error) {
|
193
|
+
span.setStatus({
|
194
|
+
code: SpanStatusCode.ERROR,
|
195
|
+
message: String(error)
|
196
|
+
});
|
197
|
+
throw error;
|
198
|
+
} finally {
|
199
|
+
span.end();
|
200
|
+
}
|
201
|
+
});
|
202
|
+
}
|
203
|
+
async function handleWebFingerInternal(request, { context: context$1, host, actorDispatcher, actorHandleMapper, actorAliasMapper, onNotFound, span }) {
|
204
|
+
if (actorDispatcher == null) return await onNotFound(request);
|
205
|
+
const resource = context$1.url.searchParams.get("resource");
|
206
|
+
if (resource == null) return new Response("Missing resource parameter.", { status: 400 });
|
207
|
+
span?.setAttribute("webfinger.resource", resource);
|
208
|
+
let resourceUrl;
|
209
|
+
try {
|
210
|
+
resourceUrl = new URL(resource);
|
211
|
+
} catch (e) {
|
212
|
+
if (e instanceof TypeError) return new Response("Invalid resource URL.", { status: 400 });
|
213
|
+
throw e;
|
214
|
+
}
|
215
|
+
span?.setAttribute("webfinger.resource.scheme", resourceUrl.protocol.replace(/:$/, ""));
|
216
|
+
if (actorDispatcher == null) {
|
217
|
+
logger.error("Actor dispatcher is not set.");
|
218
|
+
return await onNotFound(request);
|
219
|
+
}
|
220
|
+
async function mapUsernameToIdentifier(username) {
|
221
|
+
if (actorHandleMapper == null) {
|
222
|
+
logger.error("No actor handle mapper is set; use the WebFinger username {username} as the actor's internal identifier.", { username });
|
223
|
+
return username;
|
224
|
+
}
|
225
|
+
const identifier$1 = await actorHandleMapper(context$1, username);
|
226
|
+
if (identifier$1 == null) {
|
227
|
+
logger.error("Actor {username} not found.", { username });
|
228
|
+
return null;
|
229
|
+
}
|
230
|
+
return identifier$1;
|
231
|
+
}
|
232
|
+
let identifier = null;
|
233
|
+
const uriParsed = context$1.parseUri(resourceUrl);
|
234
|
+
if (uriParsed?.type != "actor") {
|
235
|
+
const match = /^acct:([^@]+)@([^@]+)$/.exec(resource);
|
236
|
+
if (match == null) {
|
237
|
+
const result = await actorAliasMapper?.(context$1, resourceUrl);
|
238
|
+
if (result == null) return await onNotFound(request);
|
239
|
+
if ("identifier" in result) identifier = result.identifier;
|
240
|
+
else identifier = await mapUsernameToIdentifier(result.username);
|
241
|
+
} else {
|
242
|
+
const portMatch = /:\d+$/.exec(match[2]);
|
243
|
+
const normalizedHost = portMatch == null ? domainToASCII(match[2].toLowerCase()) : domainToASCII(match[2].substring(0, portMatch.index).toLowerCase()) + portMatch[0];
|
244
|
+
if (normalizedHost != context$1.url.host && normalizedHost != host) return await onNotFound(request);
|
245
|
+
else {
|
246
|
+
identifier = await mapUsernameToIdentifier(match[1]);
|
247
|
+
resourceUrl = new URL(`acct:${match[1]}@${normalizedHost}`);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
} else identifier = uriParsed.identifier;
|
251
|
+
if (identifier == null) return await onNotFound(request);
|
252
|
+
const actor = await actorDispatcher(context$1, identifier);
|
253
|
+
if (actor == null) {
|
254
|
+
logger.error("Actor {identifier} not found.", { identifier });
|
255
|
+
return await onNotFound(request);
|
256
|
+
}
|
257
|
+
const links = [{
|
258
|
+
rel: "self",
|
259
|
+
href: context$1.getActorUri(identifier).href,
|
260
|
+
type: "application/activity+json"
|
261
|
+
}];
|
262
|
+
for (const url of actor.urls) if (url instanceof Link && url.href != null) links.push({
|
263
|
+
rel: url.rel ?? "http://webfinger.net/rel/profile-page",
|
264
|
+
href: url.href.href,
|
265
|
+
type: url.mediaType == null ? void 0 : url.mediaType
|
266
|
+
});
|
267
|
+
else if (url instanceof URL) links.push({
|
268
|
+
rel: "http://webfinger.net/rel/profile-page",
|
269
|
+
href: url.href
|
270
|
+
});
|
271
|
+
for await (const image of actor.getIcons()) {
|
272
|
+
if (image.url?.href == null) continue;
|
273
|
+
const link = {
|
274
|
+
rel: "http://webfinger.net/rel/avatar",
|
275
|
+
href: image.url.href.toString()
|
276
|
+
};
|
277
|
+
if (image.mediaType != null) link.type = image.mediaType;
|
278
|
+
links.push(link);
|
279
|
+
}
|
280
|
+
const aliases = [];
|
281
|
+
if (resourceUrl.protocol != "acct:" && actor.preferredUsername != null) {
|
282
|
+
aliases.push(`acct:${actor.preferredUsername}@${host ?? context$1.url.host}`);
|
283
|
+
if (host != null && host !== context$1.url.host) aliases.push(`acct:${actor.preferredUsername}@${context$1.url.host}`);
|
284
|
+
}
|
285
|
+
if (resourceUrl.href !== context$1.getActorUri(identifier).href) aliases.push(context$1.getActorUri(identifier).href);
|
286
|
+
if (resourceUrl.protocol === "acct:" && host != null && host !== context$1.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
|
287
|
+
const username = resourceUrl.href.replace(/^acct:/, "").replace(/@.*$/, "");
|
288
|
+
aliases.push(`acct:${username}@${host}`);
|
289
|
+
}
|
290
|
+
const jrd = {
|
291
|
+
subject: resourceUrl.href,
|
292
|
+
aliases,
|
293
|
+
links
|
294
|
+
};
|
295
|
+
return new Response(JSON.stringify(jrd), { headers: {
|
296
|
+
"Content-Type": "application/jrd+json",
|
297
|
+
"Access-Control-Allow-Origin": "*"
|
298
|
+
} });
|
299
|
+
}
|
300
|
+
|
301
|
+
//#endregion
|
302
|
+
//#region federation/negotiation.ts
|
303
|
+
function compareSpecs(a, b) {
|
304
|
+
return b.q - a.q || (b.s ?? 0) - (a.s ?? 0) || (a.o ?? 0) - (b.o ?? 0) || a.i - b.i || 0;
|
305
|
+
}
|
306
|
+
function isQuality(spec) {
|
307
|
+
return spec.q > 0;
|
308
|
+
}
|
309
|
+
const simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
|
310
|
+
function splitKeyValuePair(str) {
|
311
|
+
const [key, value] = str.split("=");
|
312
|
+
return [key.toLowerCase(), value];
|
313
|
+
}
|
314
|
+
function parseMediaType(str, i) {
|
315
|
+
const match = simpleMediaTypeRegExp.exec(str);
|
316
|
+
if (!match) return;
|
317
|
+
const [, type, subtype, parameters] = match;
|
318
|
+
if (!type || !subtype) return;
|
319
|
+
const params = Object.create(null);
|
320
|
+
let q = 1;
|
321
|
+
if (parameters) {
|
322
|
+
const kvps = parameters.split(";").map((p) => p.trim()).map(splitKeyValuePair);
|
323
|
+
for (const [key, val] of kvps) {
|
324
|
+
const value = val && val[0] === `"` && val[val.length - 1] === `"` ? val.slice(1, val.length - 1) : val;
|
325
|
+
if (key === "q" && value) {
|
326
|
+
q = parseFloat(value);
|
327
|
+
break;
|
328
|
+
}
|
329
|
+
params[key] = value;
|
330
|
+
}
|
331
|
+
}
|
332
|
+
return {
|
333
|
+
type,
|
334
|
+
subtype,
|
335
|
+
params,
|
336
|
+
i,
|
337
|
+
o: void 0,
|
338
|
+
q,
|
339
|
+
s: void 0
|
340
|
+
};
|
341
|
+
}
|
342
|
+
function parseAccept(accept) {
|
343
|
+
const accepts = accept.split(",").map((p) => p.trim());
|
344
|
+
const mediaTypes = [];
|
345
|
+
for (const [index, accept$1] of accepts.entries()) {
|
346
|
+
const mediaType = parseMediaType(accept$1.trim(), index);
|
347
|
+
if (mediaType) mediaTypes.push(mediaType);
|
348
|
+
}
|
349
|
+
return mediaTypes;
|
350
|
+
}
|
351
|
+
function getFullType(spec) {
|
352
|
+
return `${spec.type}/${spec.subtype}`;
|
353
|
+
}
|
354
|
+
function preferredMediaTypes(accept) {
|
355
|
+
const accepts = parseAccept(accept === void 0 ? "*/*" : accept ?? "");
|
356
|
+
return accepts.filter(isQuality).sort(compareSpecs).map(getFullType);
|
357
|
+
}
|
358
|
+
|
359
|
+
//#endregion
|
360
|
+
//#region federation/handler.ts
|
361
|
+
function acceptsJsonLd(request) {
|
362
|
+
const accept = request.headers.get("Accept");
|
363
|
+
const types = accept ? preferredMediaTypes(accept) : ["*/*"];
|
364
|
+
if (types == null) return true;
|
365
|
+
if (types[0] === "text/html" || types[0] === "application/xhtml+xml") return false;
|
366
|
+
return types.includes("application/activity+json") || types.includes("application/ld+json") || types.includes("application/json");
|
367
|
+
}
|
368
|
+
async function handleActor(request, { identifier, context: context$1, actorDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized }) {
|
369
|
+
const logger$2 = getLogger([
|
370
|
+
"fedify",
|
371
|
+
"federation",
|
372
|
+
"actor"
|
373
|
+
]);
|
374
|
+
if (actorDispatcher == null) {
|
375
|
+
logger$2.debug("Actor dispatcher is not set.", { identifier });
|
376
|
+
return await onNotFound(request);
|
377
|
+
}
|
378
|
+
const actor = await actorDispatcher(context$1, identifier);
|
379
|
+
if (actor == null) {
|
380
|
+
logger$2.debug("Actor {identifier} not found.", { identifier });
|
381
|
+
return await onNotFound(request);
|
382
|
+
}
|
383
|
+
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
384
|
+
if (authorizePredicate != null) {
|
385
|
+
let key = await context$1.getSignedKey();
|
386
|
+
key = key?.clone({}, { $warning: {
|
387
|
+
category: [
|
388
|
+
"fedify",
|
389
|
+
"federation",
|
390
|
+
"actor"
|
391
|
+
],
|
392
|
+
message: "The third parameter of AuthorizePredicate is deprecated in favor of RequestContext.getSignedKey() method. The third parameter will be removed in a future release."
|
393
|
+
} }) ?? null;
|
394
|
+
let keyOwner = await context$1.getSignedKeyOwner();
|
395
|
+
keyOwner = keyOwner?.clone({}, { $warning: {
|
396
|
+
category: [
|
397
|
+
"fedify",
|
398
|
+
"federation",
|
399
|
+
"actor"
|
400
|
+
],
|
401
|
+
message: "The fourth parameter of AuthorizePredicate is deprecated in favor of RequestContext.getSignedKeyOwner() method. The fourth parameter will be removed in a future release."
|
402
|
+
} }) ?? null;
|
403
|
+
if (!await authorizePredicate(context$1, identifier, key, keyOwner)) return await onUnauthorized(request);
|
404
|
+
}
|
405
|
+
const jsonLd = await actor.toJsonLd(context$1);
|
406
|
+
return new Response(JSON.stringify(jsonLd), { headers: {
|
407
|
+
"Content-Type": "application/activity+json",
|
408
|
+
Vary: "Accept"
|
409
|
+
} });
|
410
|
+
}
|
411
|
+
async function handleObject(request, { values, context: context$1, objectDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized }) {
|
412
|
+
if (objectDispatcher == null) return await onNotFound(request);
|
413
|
+
const object = await objectDispatcher(context$1, values);
|
414
|
+
if (object == null) return await onNotFound(request);
|
415
|
+
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
416
|
+
if (authorizePredicate != null) {
|
417
|
+
let key = await context$1.getSignedKey();
|
418
|
+
key = key?.clone({}, { $warning: {
|
419
|
+
category: [
|
420
|
+
"fedify",
|
421
|
+
"federation",
|
422
|
+
"object"
|
423
|
+
],
|
424
|
+
message: "The third parameter of ObjectAuthorizePredicate is deprecated in favor of RequestContext.getSignedKey() method. The third parameter will be removed in a future release."
|
425
|
+
} }) ?? null;
|
426
|
+
let keyOwner = await context$1.getSignedKeyOwner();
|
427
|
+
keyOwner = keyOwner?.clone({}, { $warning: {
|
428
|
+
category: [
|
429
|
+
"fedify",
|
430
|
+
"federation",
|
431
|
+
"object"
|
432
|
+
],
|
433
|
+
message: "The fourth parameter of ObjectAuthorizePredicate is deprecated in favor of RequestContext.getSignedKeyOwner() method. The fourth parameter will be removed in a future release."
|
434
|
+
} }) ?? null;
|
435
|
+
if (!await authorizePredicate(context$1, values, key, keyOwner)) return await onUnauthorized(request);
|
436
|
+
}
|
437
|
+
const jsonLd = await object.toJsonLd(context$1);
|
438
|
+
return new Response(JSON.stringify(jsonLd), { headers: {
|
439
|
+
"Content-Type": "application/activity+json",
|
440
|
+
Vary: "Accept"
|
441
|
+
} });
|
442
|
+
}
|
443
|
+
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
444
|
+
const spanName = name.trim().replace(/\s+/g, "_");
|
445
|
+
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
446
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
447
|
+
const url = new URL(request.url);
|
448
|
+
const cursor = url.searchParams.get("cursor");
|
449
|
+
if (collectionCallbacks == null) return await onNotFound(request);
|
450
|
+
let collection;
|
451
|
+
const baseUri = uriGetter(identifier);
|
452
|
+
if (cursor == null) {
|
453
|
+
const firstCursor = await collectionCallbacks.firstCursor?.(context$1, identifier);
|
454
|
+
const totalItems = filter == null ? await collectionCallbacks.counter?.(context$1, identifier) : void 0;
|
455
|
+
if (firstCursor == null) {
|
456
|
+
const itemsOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection ${spanName}`, {
|
457
|
+
kind: SpanKind.SERVER,
|
458
|
+
attributes: {
|
459
|
+
"activitypub.collection.id": baseUri.href,
|
460
|
+
"activitypub.collection.type": OrderedCollection.typeId.href
|
461
|
+
}
|
462
|
+
}, async (span) => {
|
463
|
+
if (totalItems != null) span.setAttribute("activitypub.collection.total_items", Number(totalItems));
|
464
|
+
try {
|
465
|
+
const page = await collectionCallbacks.dispatcher(context$1, identifier, null, filter);
|
466
|
+
if (page == null) {
|
467
|
+
span.setStatus({ code: SpanStatusCode.ERROR });
|
468
|
+
return await onNotFound(request);
|
469
|
+
}
|
470
|
+
const { items } = page;
|
471
|
+
span.setAttribute("fedify.collection.items", items.length);
|
472
|
+
return items;
|
473
|
+
} catch (e) {
|
474
|
+
span.setStatus({
|
475
|
+
code: SpanStatusCode.ERROR,
|
476
|
+
message: String(e)
|
477
|
+
});
|
478
|
+
throw e;
|
479
|
+
} finally {
|
480
|
+
span.end();
|
481
|
+
}
|
482
|
+
});
|
483
|
+
if (itemsOrResponse instanceof Response) return itemsOrResponse;
|
484
|
+
collection = new OrderedCollection({
|
485
|
+
id: baseUri,
|
486
|
+
totalItems: totalItems == null ? null : Number(totalItems),
|
487
|
+
items: filterCollectionItems(itemsOrResponse, name, filterPredicate)
|
488
|
+
});
|
489
|
+
} else {
|
490
|
+
const lastCursor = await collectionCallbacks.lastCursor?.(context$1, identifier);
|
491
|
+
const first = new URL(context$1.url);
|
492
|
+
first.searchParams.set("cursor", firstCursor);
|
493
|
+
let last = null;
|
494
|
+
if (lastCursor != null) {
|
495
|
+
last = new URL(context$1.url);
|
496
|
+
last.searchParams.set("cursor", lastCursor);
|
497
|
+
}
|
498
|
+
collection = new OrderedCollection({
|
499
|
+
id: baseUri,
|
500
|
+
totalItems: totalItems == null ? null : Number(totalItems),
|
501
|
+
first,
|
502
|
+
last
|
503
|
+
});
|
504
|
+
}
|
505
|
+
} else {
|
506
|
+
const uri = new URL(baseUri);
|
507
|
+
uri.searchParams.set("cursor", cursor);
|
508
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name}`, {
|
509
|
+
kind: SpanKind.SERVER,
|
510
|
+
attributes: {
|
511
|
+
"activitypub.collection.id": uri.href,
|
512
|
+
"activitypub.collection.type": OrderedCollectionPage.typeId.href,
|
513
|
+
"fedify.collection.cursor": cursor
|
514
|
+
}
|
515
|
+
}, async (span) => {
|
516
|
+
try {
|
517
|
+
const page = await collectionCallbacks.dispatcher(context$1, identifier, cursor, filter);
|
518
|
+
if (page == null) {
|
519
|
+
span.setStatus({ code: SpanStatusCode.ERROR });
|
520
|
+
return await onNotFound(request);
|
521
|
+
}
|
522
|
+
span.setAttribute("fedify.collection.items", page.items.length);
|
523
|
+
return page;
|
524
|
+
} catch (e) {
|
525
|
+
span.setStatus({
|
526
|
+
code: SpanStatusCode.ERROR,
|
527
|
+
message: String(e)
|
528
|
+
});
|
529
|
+
throw e;
|
530
|
+
} finally {
|
531
|
+
span.end();
|
532
|
+
}
|
533
|
+
});
|
534
|
+
if (pageOrResponse instanceof Response) return pageOrResponse;
|
535
|
+
const { items, prevCursor, nextCursor } = pageOrResponse;
|
536
|
+
let prev = null;
|
537
|
+
if (prevCursor != null) {
|
538
|
+
prev = new URL(context$1.url);
|
539
|
+
prev.searchParams.set("cursor", prevCursor);
|
540
|
+
}
|
541
|
+
let next = null;
|
542
|
+
if (nextCursor != null) {
|
543
|
+
next = new URL(context$1.url);
|
544
|
+
next.searchParams.set("cursor", nextCursor);
|
545
|
+
}
|
546
|
+
const partOf = new URL(context$1.url);
|
547
|
+
partOf.searchParams.delete("cursor");
|
548
|
+
collection = new OrderedCollectionPage({
|
549
|
+
id: uri,
|
550
|
+
prev,
|
551
|
+
next,
|
552
|
+
items: filterCollectionItems(items, name, filterPredicate),
|
553
|
+
partOf
|
554
|
+
});
|
555
|
+
}
|
556
|
+
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
557
|
+
if (collectionCallbacks.authorizePredicate != null) {
|
558
|
+
let key = await context$1.getSignedKey();
|
559
|
+
key = key?.clone({}, { $warning: {
|
560
|
+
category: [
|
561
|
+
"fedify",
|
562
|
+
"federation",
|
563
|
+
"collection"
|
564
|
+
],
|
565
|
+
message: "The third parameter of AuthorizePredicate is deprecated in favor of RequestContext.getSignedKey() method. The third parameter will be removed in a future release."
|
566
|
+
} }) ?? null;
|
567
|
+
let keyOwner = await context$1.getSignedKeyOwner();
|
568
|
+
keyOwner = keyOwner?.clone({}, { $warning: {
|
569
|
+
category: [
|
570
|
+
"fedify",
|
571
|
+
"federation",
|
572
|
+
"collection"
|
573
|
+
],
|
574
|
+
message: "The fourth parameter of AuthorizePredicate is deprecated in favor of RequestContext.getSignedKeyOwner() method. The fourth parameter will be removed in a future release."
|
575
|
+
} }) ?? null;
|
576
|
+
if (!await collectionCallbacks.authorizePredicate(context$1, identifier, key, keyOwner)) return await onUnauthorized(request);
|
577
|
+
}
|
578
|
+
const jsonLd = await collection.toJsonLd(context$1);
|
579
|
+
return new Response(JSON.stringify(jsonLd), { headers: {
|
580
|
+
"Content-Type": "application/activity+json",
|
581
|
+
Vary: "Accept"
|
582
|
+
} });
|
583
|
+
}
|
584
|
+
function filterCollectionItems(items, collectionName, filterPredicate) {
|
585
|
+
const result = [];
|
586
|
+
let logged = false;
|
587
|
+
for (const item of items) {
|
588
|
+
let mappedItem;
|
589
|
+
if (item instanceof Object$1 || item instanceof Link || item instanceof URL) mappedItem = item;
|
590
|
+
else if (item.id == null) continue;
|
591
|
+
else mappedItem = item.id;
|
592
|
+
if (filterPredicate != null && !filterPredicate(item)) {
|
593
|
+
if (!logged) {
|
594
|
+
getLogger([
|
595
|
+
"fedify",
|
596
|
+
"federation",
|
597
|
+
"collection"
|
598
|
+
]).warn(`The ${collectionName} collection apparently does not implement filtering. This may result in a large response payload. Please consider implementing filtering for the collection. See also: https://fedify.dev/manual/collections#filtering-by-server`);
|
599
|
+
logged = true;
|
600
|
+
}
|
601
|
+
continue;
|
602
|
+
}
|
603
|
+
result.push(mappedItem);
|
604
|
+
}
|
605
|
+
return result;
|
606
|
+
}
|
607
|
+
async function handleInbox(request, options) {
|
608
|
+
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
609
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
610
|
+
return await tracer.startActiveSpan("activitypub.inbox", {
|
611
|
+
kind: options.queue == null ? SpanKind.SERVER : SpanKind.PRODUCER,
|
612
|
+
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
613
|
+
}, async (span) => {
|
614
|
+
if (options.recipient != null) span.setAttribute("fedify.inbox.recipient", options.recipient);
|
615
|
+
try {
|
616
|
+
return await handleInboxInternal(request, options, span);
|
617
|
+
} catch (e) {
|
618
|
+
span.setStatus({
|
619
|
+
code: SpanStatusCode.ERROR,
|
620
|
+
message: String(e)
|
621
|
+
});
|
622
|
+
throw e;
|
623
|
+
} finally {
|
624
|
+
span.end();
|
625
|
+
}
|
626
|
+
});
|
627
|
+
}
|
628
|
+
async function handleInboxInternal(request, { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider }, span) {
|
629
|
+
const logger$2 = getLogger([
|
630
|
+
"fedify",
|
631
|
+
"federation",
|
632
|
+
"inbox"
|
633
|
+
]);
|
634
|
+
if (actorDispatcher == null) {
|
635
|
+
logger$2.error("Actor dispatcher is not set.", { recipient });
|
636
|
+
span.setStatus({
|
637
|
+
code: SpanStatusCode.ERROR,
|
638
|
+
message: "Actor dispatcher is not set."
|
639
|
+
});
|
640
|
+
return await onNotFound(request);
|
641
|
+
} else if (recipient != null) {
|
642
|
+
const actor = await actorDispatcher(ctx, recipient);
|
643
|
+
if (actor == null) {
|
644
|
+
logger$2.error("Actor {recipient} not found.", { recipient });
|
645
|
+
span.setStatus({
|
646
|
+
code: SpanStatusCode.ERROR,
|
647
|
+
message: `Actor ${recipient} not found.`
|
648
|
+
});
|
649
|
+
return await onNotFound(request);
|
650
|
+
}
|
651
|
+
}
|
652
|
+
if (request.bodyUsed) {
|
653
|
+
logger$2.error("Request body has already been read.", { recipient });
|
654
|
+
span.setStatus({
|
655
|
+
code: SpanStatusCode.ERROR,
|
656
|
+
message: "Request body has already been read."
|
657
|
+
});
|
658
|
+
return new Response("Internal server error.", {
|
659
|
+
status: 500,
|
660
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
661
|
+
});
|
662
|
+
} else if (request.body?.locked) {
|
663
|
+
logger$2.error("Request body is locked.", { recipient });
|
664
|
+
span.setStatus({
|
665
|
+
code: SpanStatusCode.ERROR,
|
666
|
+
message: "Request body is locked."
|
667
|
+
});
|
668
|
+
return new Response("Internal server error.", {
|
669
|
+
status: 500,
|
670
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
671
|
+
});
|
672
|
+
}
|
673
|
+
let json;
|
674
|
+
try {
|
675
|
+
json = await request.clone().json();
|
676
|
+
} catch (error) {
|
677
|
+
logger$2.error("Failed to parse JSON:\n{error}", {
|
678
|
+
recipient,
|
679
|
+
error
|
680
|
+
});
|
681
|
+
try {
|
682
|
+
await inboxErrorHandler?.(ctx, error);
|
683
|
+
} catch (error$1) {
|
684
|
+
logger$2.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
685
|
+
error: error$1,
|
686
|
+
activity: json,
|
687
|
+
recipient
|
688
|
+
});
|
689
|
+
}
|
690
|
+
span.setStatus({
|
691
|
+
code: SpanStatusCode.ERROR,
|
692
|
+
message: `Failed to parse JSON:\n${error}`
|
693
|
+
});
|
694
|
+
return new Response("Invalid JSON.", {
|
695
|
+
status: 400,
|
696
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
697
|
+
});
|
698
|
+
}
|
699
|
+
const keyCache = new KvKeyCache(kv, kvPrefixes.publicKey, ctx);
|
700
|
+
let ldSigVerified;
|
701
|
+
try {
|
702
|
+
ldSigVerified = await verifyJsonLd(json, {
|
703
|
+
contextLoader: ctx.contextLoader,
|
704
|
+
documentLoader: ctx.documentLoader,
|
705
|
+
keyCache,
|
706
|
+
tracerProvider
|
707
|
+
});
|
708
|
+
} catch (error) {
|
709
|
+
if (error instanceof Error && error.name === "jsonld.SyntaxError") {
|
710
|
+
logger$2.error("Failed to parse JSON-LD:\n{error}", {
|
711
|
+
recipient,
|
712
|
+
error
|
713
|
+
});
|
714
|
+
return new Response("Invalid JSON-LD.", {
|
715
|
+
status: 400,
|
716
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
717
|
+
});
|
718
|
+
}
|
719
|
+
ldSigVerified = false;
|
720
|
+
}
|
721
|
+
const jsonWithoutSig = detachSignature(json);
|
722
|
+
let activity = null;
|
723
|
+
if (ldSigVerified) {
|
724
|
+
logger$2.debug("Linked Data Signatures are verified.", {
|
725
|
+
recipient,
|
726
|
+
json
|
727
|
+
});
|
728
|
+
activity = await Activity.fromJsonLd(jsonWithoutSig, ctx);
|
729
|
+
} else {
|
730
|
+
logger$2.debug("Linked Data Signatures are not verified.", {
|
731
|
+
recipient,
|
732
|
+
json
|
733
|
+
});
|
734
|
+
try {
|
735
|
+
activity = await verifyObject(Activity, jsonWithoutSig, {
|
736
|
+
contextLoader: ctx.contextLoader,
|
737
|
+
documentLoader: ctx.documentLoader,
|
738
|
+
keyCache,
|
739
|
+
tracerProvider
|
740
|
+
});
|
741
|
+
} catch (error) {
|
742
|
+
logger$2.error("Failed to parse activity:\n{error}", {
|
743
|
+
recipient,
|
744
|
+
activity: json,
|
745
|
+
error
|
746
|
+
});
|
747
|
+
try {
|
748
|
+
await inboxErrorHandler?.(ctx, error);
|
749
|
+
} catch (error$1) {
|
750
|
+
logger$2.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
751
|
+
error: error$1,
|
752
|
+
activity: json,
|
753
|
+
recipient
|
754
|
+
});
|
755
|
+
}
|
756
|
+
span.setStatus({
|
757
|
+
code: SpanStatusCode.ERROR,
|
758
|
+
message: `Failed to parse activity:\n${error}`
|
759
|
+
});
|
760
|
+
return new Response("Invalid activity.", {
|
761
|
+
status: 400,
|
762
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
763
|
+
});
|
764
|
+
}
|
765
|
+
if (activity == null) logger$2.debug("Object Integrity Proofs are not verified.", {
|
766
|
+
recipient,
|
767
|
+
activity: json
|
768
|
+
});
|
769
|
+
else logger$2.debug("Object Integrity Proofs are verified.", {
|
770
|
+
recipient,
|
771
|
+
activity: json
|
772
|
+
});
|
773
|
+
}
|
774
|
+
let httpSigKey = null;
|
775
|
+
if (activity == null) {
|
776
|
+
if (!skipSignatureVerification) {
|
777
|
+
const key = await verifyRequest(request, {
|
778
|
+
contextLoader: ctx.contextLoader,
|
779
|
+
documentLoader: ctx.documentLoader,
|
780
|
+
timeWindow: signatureTimeWindow,
|
781
|
+
keyCache,
|
782
|
+
tracerProvider
|
783
|
+
});
|
784
|
+
if (key == null) {
|
785
|
+
logger$2.error("Failed to verify the request's HTTP Signatures.", { recipient });
|
786
|
+
span.setStatus({
|
787
|
+
code: SpanStatusCode.ERROR,
|
788
|
+
message: `Failed to verify the request's HTTP Signatures.`
|
789
|
+
});
|
790
|
+
const response = new Response("Failed to verify the request signature.", {
|
791
|
+
status: 401,
|
792
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
793
|
+
});
|
794
|
+
return response;
|
795
|
+
} else logger$2.debug("HTTP Signatures are verified.", { recipient });
|
796
|
+
httpSigKey = key;
|
797
|
+
}
|
798
|
+
activity = await Activity.fromJsonLd(jsonWithoutSig, ctx);
|
799
|
+
}
|
800
|
+
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
801
|
+
span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
|
802
|
+
const routeResult = await routeActivity({
|
803
|
+
context: ctx,
|
804
|
+
json,
|
805
|
+
activity,
|
806
|
+
recipient,
|
807
|
+
inboxListeners,
|
808
|
+
inboxContextFactory,
|
809
|
+
inboxErrorHandler,
|
810
|
+
kv,
|
811
|
+
kvPrefixes,
|
812
|
+
queue,
|
813
|
+
span,
|
814
|
+
tracerProvider
|
815
|
+
});
|
816
|
+
if (httpSigKey != null && !await doesActorOwnKey(activity, httpSigKey, ctx)) {
|
817
|
+
logger$2.error("The signer ({keyId}) and the actor ({actorId}) do not match.", {
|
818
|
+
activity: json,
|
819
|
+
recipient,
|
820
|
+
keyId: httpSigKey.id?.href,
|
821
|
+
actorId: activity.actorId?.href
|
822
|
+
});
|
823
|
+
span.setStatus({
|
824
|
+
code: SpanStatusCode.ERROR,
|
825
|
+
message: `The signer (${httpSigKey.id?.href}) and the actor (${activity.actorId?.href}) do not match.`
|
826
|
+
});
|
827
|
+
return new Response("The signer and the actor do not match.", {
|
828
|
+
status: 401,
|
829
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
830
|
+
});
|
831
|
+
}
|
832
|
+
if (routeResult === "alreadyProcessed") return new Response(`Activity <${activity.id}> has already been processed.`, {
|
833
|
+
status: 202,
|
834
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
835
|
+
});
|
836
|
+
else if (routeResult === "missingActor") return new Response("Missing actor.", {
|
837
|
+
status: 400,
|
838
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
839
|
+
});
|
840
|
+
else if (routeResult === "enqueued") return new Response("Activity is enqueued.", {
|
841
|
+
status: 202,
|
842
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
843
|
+
});
|
844
|
+
else if (routeResult === "unsupportedActivity") return new Response("", {
|
845
|
+
status: 202,
|
846
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
847
|
+
});
|
848
|
+
else if (routeResult === "error") return new Response("Internal server error.", {
|
849
|
+
status: 500,
|
850
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
851
|
+
});
|
852
|
+
else return new Response("", {
|
853
|
+
status: 202,
|
854
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
855
|
+
});
|
856
|
+
}
|
857
|
+
/**
|
858
|
+
* Responds with the given object in JSON-LD format.
|
859
|
+
*
|
860
|
+
* @param object The object to respond with.
|
861
|
+
* @param options Options.
|
862
|
+
* @since 0.3.0
|
863
|
+
*/
|
864
|
+
async function respondWithObject(object, options) {
|
865
|
+
const jsonLd = await object.toJsonLd(options);
|
866
|
+
return new Response(JSON.stringify(jsonLd), { headers: { "Content-Type": "application/activity+json" } });
|
867
|
+
}
|
868
|
+
/**
|
869
|
+
* Responds with the given object in JSON-LD format if the request accepts
|
870
|
+
* JSON-LD.
|
871
|
+
*
|
872
|
+
* @param object The object to respond with.
|
873
|
+
* @param request The request to check for JSON-LD acceptability.
|
874
|
+
* @param options Options.
|
875
|
+
* @since 0.3.0
|
876
|
+
*/
|
877
|
+
async function respondWithObjectIfAcceptable(object, request, options) {
|
878
|
+
if (!acceptsJsonLd(request)) return null;
|
879
|
+
const response = await respondWithObject(object, options);
|
880
|
+
response.headers.set("Vary", "Accept");
|
881
|
+
return response;
|
882
|
+
}
|
883
|
+
|
884
|
+
//#endregion
|
33
885
|
//#region federation/middleware.ts
|
34
886
|
/**
|
35
887
|
* Create a new {@link Federation} instance.
|
@@ -65,7 +917,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
65
917
|
tracerProvider;
|
66
918
|
constructor(options) {
|
67
919
|
super();
|
68
|
-
const logger = getLogger(["fedify", "federation"]);
|
920
|
+
const logger$2 = getLogger(["fedify", "federation"]);
|
69
921
|
this.kv = options.kv;
|
70
922
|
this.kvPrefixes = {
|
71
923
|
activityIdempotence: ["_fedify", "activityIdempotence"],
|
@@ -122,7 +974,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
122
974
|
if (options.documentLoader != null) {
|
123
975
|
if (options.documentLoaderFactory != null) throw new TypeError("Cannot set both documentLoader and documentLoaderFactory options at a time; use documentLoaderFactory only.");
|
124
976
|
this.documentLoaderFactory = () => options.documentLoader;
|
125
|
-
logger.warn("The documentLoader option is deprecated; use documentLoaderFactory option instead.");
|
977
|
+
logger$2.warn("The documentLoader option is deprecated; use documentLoaderFactory option instead.");
|
126
978
|
} else this.documentLoaderFactory = options.documentLoaderFactory ?? ((opts) => {
|
127
979
|
return kvCache({
|
128
980
|
loader: getDocumentLoader({
|
@@ -136,7 +988,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
136
988
|
if (options.contextLoader != null) {
|
137
989
|
if (options.contextLoaderFactory != null) throw new TypeError("Cannot set both contextLoader and contextLoaderFactory options at a time; use contextLoaderFactory only.");
|
138
990
|
this.contextLoaderFactory = () => options.contextLoader;
|
139
|
-
logger.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
|
991
|
+
logger$2.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
|
140
992
|
} else this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
141
993
|
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => getAuthenticatedDocumentLoader(identity, {
|
142
994
|
allowPrivateAddress,
|
@@ -162,30 +1014,30 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
162
1014
|
}
|
163
1015
|
async _startQueueInternal(ctxData, signal, queue) {
|
164
1016
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
165
|
-
const logger = getLogger([
|
1017
|
+
const logger$2 = getLogger([
|
166
1018
|
"fedify",
|
167
1019
|
"federation",
|
168
1020
|
"queue"
|
169
1021
|
]);
|
170
1022
|
const promises = [];
|
171
1023
|
if (this.inboxQueue != null && (queue == null || queue === "inbox") && !this.inboxQueueStarted) {
|
172
|
-
logger.debug("Starting an inbox task worker.");
|
1024
|
+
logger$2.debug("Starting an inbox task worker.");
|
173
1025
|
this.inboxQueueStarted = true;
|
174
|
-
promises.push(this.inboxQueue.listen((msg) => this
|
1026
|
+
promises.push(this.inboxQueue.listen((msg) => this.processQueuedTask(ctxData, msg), { signal }));
|
175
1027
|
}
|
176
1028
|
if (this.outboxQueue != null && this.outboxQueue !== this.inboxQueue && (queue == null || queue === "outbox") && !this.outboxQueueStarted) {
|
177
|
-
logger.debug("Starting an outbox task worker.");
|
1029
|
+
logger$2.debug("Starting an outbox task worker.");
|
178
1030
|
this.outboxQueueStarted = true;
|
179
|
-
promises.push(this.outboxQueue.listen((msg) => this
|
1031
|
+
promises.push(this.outboxQueue.listen((msg) => this.processQueuedTask(ctxData, msg), { signal }));
|
180
1032
|
}
|
181
1033
|
if (this.fanoutQueue != null && this.fanoutQueue !== this.inboxQueue && this.fanoutQueue !== this.outboxQueue && (queue == null || queue === "fanout") && !this.fanoutQueueStarted) {
|
182
|
-
logger.debug("Starting a fanout task worker.");
|
1034
|
+
logger$2.debug("Starting a fanout task worker.");
|
183
1035
|
this.fanoutQueueStarted = true;
|
184
|
-
promises.push(this.fanoutQueue.listen((msg) => this
|
1036
|
+
promises.push(this.fanoutQueue.listen((msg) => this.processQueuedTask(ctxData, msg), { signal }));
|
185
1037
|
}
|
186
1038
|
await Promise.all(promises);
|
187
1039
|
}
|
188
|
-
|
1040
|
+
processQueuedTask(contextData, message) {
|
189
1041
|
const tracer = this._getTracer();
|
190
1042
|
const extractedContext = propagation.extract(context.active(), message.traceContext);
|
191
1043
|
return withContext({ messageId: message.id }, async () => {
|
@@ -195,7 +1047,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
195
1047
|
}, extractedContext, async (span) => {
|
196
1048
|
if (message.activityId != null) span.setAttribute("activitypub.activity.id", message.activityId);
|
197
1049
|
try {
|
198
|
-
await this.#listenFanoutMessage(
|
1050
|
+
await this.#listenFanoutMessage(contextData, message);
|
199
1051
|
} catch (e) {
|
200
1052
|
span.setStatus({
|
201
1053
|
code: SpanStatusCode.ERROR,
|
@@ -215,7 +1067,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
215
1067
|
}, extractedContext, async (span) => {
|
216
1068
|
if (message.activityId != null) span.setAttribute("activitypub.activity.id", message.activityId);
|
217
1069
|
try {
|
218
|
-
await this.#listenOutboxMessage(
|
1070
|
+
await this.#listenOutboxMessage(contextData, message, span);
|
219
1071
|
} catch (e) {
|
220
1072
|
span.setStatus({
|
221
1073
|
code: SpanStatusCode.ERROR,
|
@@ -231,7 +1083,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
231
1083
|
attributes: { "activitypub.shared_inbox": message.identifier == null }
|
232
1084
|
}, extractedContext, async (span) => {
|
233
1085
|
try {
|
234
|
-
await this.#listenInboxMessage(
|
1086
|
+
await this.#listenInboxMessage(contextData, message, span);
|
235
1087
|
} catch (e) {
|
236
1088
|
span.setStatus({
|
237
1089
|
code: SpanStatusCode.ERROR,
|
@@ -245,12 +1097,12 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
245
1097
|
});
|
246
1098
|
}
|
247
1099
|
async #listenFanoutMessage(data, message) {
|
248
|
-
const logger = getLogger([
|
1100
|
+
const logger$2 = getLogger([
|
249
1101
|
"fedify",
|
250
1102
|
"federation",
|
251
1103
|
"fanout"
|
252
1104
|
]);
|
253
|
-
logger.debug("Fanning out activity {activityId} to {inboxes} inbox(es)...", {
|
1105
|
+
logger$2.debug("Fanning out activity {activityId} to {inboxes} inbox(es)...", {
|
254
1106
|
activityId: message.activityId,
|
255
1107
|
inboxes: globalThis.Object.keys(message.inboxes).length
|
256
1108
|
});
|
@@ -279,7 +1131,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
279
1131
|
});
|
280
1132
|
}
|
281
1133
|
async #listenOutboxMessage(_, message, span) {
|
282
|
-
const logger = getLogger([
|
1134
|
+
const logger$2 = getLogger([
|
283
1135
|
"fedify",
|
284
1136
|
"federation",
|
285
1137
|
"outbox"
|
@@ -328,7 +1180,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
328
1180
|
try {
|
329
1181
|
this.onOutboxError?.(error, activity);
|
330
1182
|
} catch (error$1) {
|
331
|
-
logger.error("An unexpected error occurred in onError handler:\n{error}", {
|
1183
|
+
logger$2.error("An unexpected error occurred in onError handler:\n{error}", {
|
332
1184
|
...logData,
|
333
1185
|
error: error$1
|
334
1186
|
});
|
@@ -338,7 +1190,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
338
1190
|
attempts: message.attempt
|
339
1191
|
});
|
340
1192
|
if (delay != null) {
|
341
|
-
logger.error("Failed to send activity {activityId} to {inbox} (attempt #{attempt}); retry...:\n{error}", {
|
1193
|
+
logger$2.error("Failed to send activity {activityId} to {inbox} (attempt #{attempt}); retry...:\n{error}", {
|
342
1194
|
...logData,
|
343
1195
|
error
|
344
1196
|
});
|
@@ -346,16 +1198,16 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
346
1198
|
...message,
|
347
1199
|
attempt: message.attempt + 1
|
348
1200
|
}, { delay: Temporal.Duration.compare(delay, { seconds: 0 }) < 0 ? Temporal.Duration.from({ seconds: 0 }) : delay });
|
349
|
-
} else logger.error("Failed to send activity {activityId} to {inbox} after {attempt} attempts; giving up:\n{error}", {
|
1201
|
+
} else logger$2.error("Failed to send activity {activityId} to {inbox} after {attempt} attempts; giving up:\n{error}", {
|
350
1202
|
...logData,
|
351
1203
|
error
|
352
1204
|
});
|
353
1205
|
return;
|
354
1206
|
}
|
355
|
-
logger.info("Successfully sent activity {activityId} to {inbox}.", { ...logData });
|
1207
|
+
logger$2.info("Successfully sent activity {activityId} to {inbox}.", { ...logData });
|
356
1208
|
}
|
357
1209
|
async #listenInboxMessage(ctxData, message, span) {
|
358
|
-
const logger = getLogger([
|
1210
|
+
const logger$2 = getLogger([
|
359
1211
|
"fedify",
|
360
1212
|
"federation",
|
361
1213
|
"inbox"
|
@@ -378,7 +1230,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
378
1230
|
if (cacheKey != null) {
|
379
1231
|
const cached = await this.kv.get(cacheKey);
|
380
1232
|
if (cached === true) {
|
381
|
-
logger.debug("Activity {activityId} has already been processed.", {
|
1233
|
+
logger$2.debug("Activity {activityId} has already been processed.", {
|
382
1234
|
activityId: activity.id?.href,
|
383
1235
|
activity: message.activity,
|
384
1236
|
recipient: message.identifier
|
@@ -389,7 +1241,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
389
1241
|
await this._getTracer().startActiveSpan("activitypub.dispatch_inbox_listener", { kind: SpanKind.INTERNAL }, async (span$1) => {
|
390
1242
|
const dispatched = this.inboxListeners?.dispatchWithClass(activity);
|
391
1243
|
if (dispatched == null) {
|
392
|
-
logger.error("Unsupported activity type:\n{activity}", {
|
1244
|
+
logger$2.error("Unsupported activity type:\n{activity}", {
|
393
1245
|
activityId: activity.id?.href,
|
394
1246
|
activity: message.activity,
|
395
1247
|
recipient: message.identifier,
|
@@ -410,7 +1262,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
410
1262
|
try {
|
411
1263
|
await this.inboxErrorHandler?.(context$1, error);
|
412
1264
|
} catch (error$1) {
|
413
|
-
logger.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
1265
|
+
logger$2.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
414
1266
|
error: error$1,
|
415
1267
|
trial: message.attempt,
|
416
1268
|
activityId: activity.id?.href,
|
@@ -423,7 +1275,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
423
1275
|
attempts: message.attempt
|
424
1276
|
});
|
425
1277
|
if (delay != null) {
|
426
|
-
logger.error("Failed to process the incoming activity {activityId} (attempt #{attempt}); retry...:\n{error}", {
|
1278
|
+
logger$2.error("Failed to process the incoming activity {activityId} (attempt #{attempt}); retry...:\n{error}", {
|
427
1279
|
error,
|
428
1280
|
attempt: message.attempt,
|
429
1281
|
activityId: activity.id?.href,
|
@@ -434,7 +1286,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
434
1286
|
...message,
|
435
1287
|
attempt: message.attempt + 1
|
436
1288
|
}, { delay: Temporal.Duration.compare(delay, { seconds: 0 }) < 0 ? Temporal.Duration.from({ seconds: 0 }) : delay });
|
437
|
-
} else logger.error("Failed to process the incoming activity {activityId} after {trial} attempts; giving up:\n{error}", {
|
1289
|
+
} else logger$2.error("Failed to process the incoming activity {activityId} after {trial} attempts; giving up:\n{error}", {
|
438
1290
|
error,
|
439
1291
|
activityId: activity.id?.href,
|
440
1292
|
activity: message.activity,
|
@@ -448,7 +1300,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
448
1300
|
return;
|
449
1301
|
}
|
450
1302
|
if (cacheKey != null) await this.kv.set(cacheKey, true, { ttl: Temporal.Duration.from({ days: 1 }) });
|
451
|
-
logger.info("Activity {activityId} has been processed.", {
|
1303
|
+
logger$2.info("Activity {activityId} has been processed.", {
|
452
1304
|
activityId: activity.id?.href,
|
453
1305
|
activity: message.activity,
|
454
1306
|
recipient: message.identifier
|
@@ -497,7 +1349,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
497
1349
|
};
|
498
1350
|
}
|
499
1351
|
async sendActivity(keys, inboxes, activity, options) {
|
500
|
-
const logger = getLogger([
|
1352
|
+
const logger$2 = getLogger([
|
501
1353
|
"fedify",
|
502
1354
|
"federation",
|
503
1355
|
"outbox"
|
@@ -531,7 +1383,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
531
1383
|
format: "compact",
|
532
1384
|
contextLoader
|
533
1385
|
});
|
534
|
-
if (rsaKey == null) logger.warn("No supported key found to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature. In order to create a Linked Data signature, at least one RSASSA-PKCS1-v1_5 key must be provided.", {
|
1386
|
+
if (rsaKey == null) logger$2.warn("No supported key found to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature. In order to create a Linked Data signature, at least one RSASSA-PKCS1-v1_5 key must be provided.", {
|
535
1387
|
activityId,
|
536
1388
|
keys: keys.map((pair) => ({
|
537
1389
|
keyId: pair.keyId.href,
|
@@ -542,7 +1394,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
542
1394
|
contextLoader,
|
543
1395
|
tracerProvider: this.tracerProvider
|
544
1396
|
});
|
545
|
-
if (!proofCreated) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
|
1397
|
+
if (!proofCreated) logger$2.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
|
546
1398
|
activityId,
|
547
1399
|
keys: keys.map((pair) => ({
|
548
1400
|
keyId: pair.keyId.href,
|
@@ -550,11 +1402,11 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
550
1402
|
}))
|
551
1403
|
});
|
552
1404
|
if (immediate || this.outboxQueue == null) {
|
553
|
-
if (immediate) logger.debug("Sending activity immediately without queue since immediate option is set.", {
|
1405
|
+
if (immediate) logger$2.debug("Sending activity immediately without queue since immediate option is set.", {
|
554
1406
|
activityId: activity.id.href,
|
555
1407
|
activity: jsonLd
|
556
1408
|
});
|
557
|
-
else logger.debug("Sending activity immediately without queue since queue is not set.", {
|
1409
|
+
else logger$2.debug("Sending activity immediately without queue since queue is not set.", {
|
558
1410
|
activityId: activity.id.href,
|
559
1411
|
activity: jsonLd
|
560
1412
|
});
|
@@ -573,7 +1425,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
573
1425
|
await Promise.all(promises);
|
574
1426
|
return;
|
575
1427
|
}
|
576
|
-
logger.debug("Enqueuing activity {activityId} to send later.", {
|
1428
|
+
logger$2.debug("Enqueuing activity {activityId} to send later.", {
|
577
1429
|
activityId: activity.id.href,
|
578
1430
|
activity: jsonLd
|
579
1431
|
});
|
@@ -613,7 +1465,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
613
1465
|
const results = await Promise.allSettled(promises);
|
614
1466
|
const errors = results.filter((r) => r.status === "rejected").map((r) => r.reason);
|
615
1467
|
if (errors.length > 0) {
|
616
|
-
logger.error("Failed to enqueue activity {activityId} to send later: {errors}", {
|
1468
|
+
logger$2.error("Failed to enqueue activity {activityId} to send later: {errors}", {
|
617
1469
|
activityId: activity.id.href,
|
618
1470
|
errors
|
619
1471
|
});
|
@@ -623,7 +1475,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
623
1475
|
} else try {
|
624
1476
|
await outboxQueue.enqueueMany(messages);
|
625
1477
|
} catch (error) {
|
626
|
-
logger.error("Failed to enqueue activity {activityId} to send later: {error}", {
|
1478
|
+
logger$2.error("Failed to enqueue activity {activityId} to send later: {error}", {
|
627
1479
|
activityId: activity.id.href,
|
628
1480
|
error
|
629
1481
|
});
|
@@ -641,7 +1493,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
641
1493
|
[ATTR_URL_FULL]: request.url
|
642
1494
|
}
|
643
1495
|
}, async (span) => {
|
644
|
-
const logger = getLogger([
|
1496
|
+
const logger$2 = getLogger([
|
645
1497
|
"fedify",
|
646
1498
|
"federation",
|
647
1499
|
"http"
|
@@ -660,7 +1512,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
660
1512
|
message: `${error}`
|
661
1513
|
});
|
662
1514
|
span.end();
|
663
|
-
logger.error("An error occurred while serving request {method} {url}: {error}", {
|
1515
|
+
logger$2.error("An error occurred while serving request {method} {url}: {error}", {
|
664
1516
|
method: request.method,
|
665
1517
|
url: request.url,
|
666
1518
|
error
|
@@ -684,9 +1536,9 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
684
1536
|
url: request.url,
|
685
1537
|
status: response.status
|
686
1538
|
};
|
687
|
-
if (response.status >= 500) logger.error(logTpl, values);
|
688
|
-
else if (response.status >= 400) logger.warn(logTpl, values);
|
689
|
-
else logger.info(logTpl, values);
|
1539
|
+
if (response.status >= 500) logger$2.error(logTpl, values);
|
1540
|
+
else if (response.status >= 400) logger$2.warn(logTpl, values);
|
1541
|
+
else logger$2.info(logTpl, values);
|
690
1542
|
return response;
|
691
1543
|
});
|
692
1544
|
});
|
@@ -1003,13 +1855,13 @@ var ContextImpl = class ContextImpl {
|
|
1003
1855
|
if (uri == null) return null;
|
1004
1856
|
if (uri.origin !== this.origin && uri.origin !== this.canonicalOrigin) return null;
|
1005
1857
|
const route = this.federation.router.route(uri.pathname);
|
1006
|
-
const logger = getLogger(["fedify", "federation"]);
|
1858
|
+
const logger$2 = getLogger(["fedify", "federation"]);
|
1007
1859
|
if (route == null) return null;
|
1008
1860
|
else if (route.name === "sharedInbox") return {
|
1009
1861
|
type: "inbox",
|
1010
1862
|
identifier: void 0,
|
1011
1863
|
get handle() {
|
1012
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1864
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1013
1865
|
return void 0;
|
1014
1866
|
}
|
1015
1867
|
};
|
@@ -1018,7 +1870,7 @@ var ContextImpl = class ContextImpl {
|
|
1018
1870
|
type: "actor",
|
1019
1871
|
identifier,
|
1020
1872
|
get handle() {
|
1021
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1873
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1022
1874
|
return identifier;
|
1023
1875
|
}
|
1024
1876
|
};
|
@@ -1034,7 +1886,7 @@ var ContextImpl = class ContextImpl {
|
|
1034
1886
|
type: "inbox",
|
1035
1887
|
identifier,
|
1036
1888
|
get handle() {
|
1037
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1889
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1038
1890
|
return identifier;
|
1039
1891
|
}
|
1040
1892
|
};
|
@@ -1042,7 +1894,7 @@ var ContextImpl = class ContextImpl {
|
|
1042
1894
|
type: "outbox",
|
1043
1895
|
identifier,
|
1044
1896
|
get handle() {
|
1045
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1897
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1046
1898
|
return identifier;
|
1047
1899
|
}
|
1048
1900
|
};
|
@@ -1050,7 +1902,7 @@ var ContextImpl = class ContextImpl {
|
|
1050
1902
|
type: "following",
|
1051
1903
|
identifier,
|
1052
1904
|
get handle() {
|
1053
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1905
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1054
1906
|
return identifier;
|
1055
1907
|
}
|
1056
1908
|
};
|
@@ -1058,7 +1910,7 @@ var ContextImpl = class ContextImpl {
|
|
1058
1910
|
type: "followers",
|
1059
1911
|
identifier,
|
1060
1912
|
get handle() {
|
1061
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1913
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1062
1914
|
return identifier;
|
1063
1915
|
}
|
1064
1916
|
};
|
@@ -1066,7 +1918,7 @@ var ContextImpl = class ContextImpl {
|
|
1066
1918
|
type: "liked",
|
1067
1919
|
identifier,
|
1068
1920
|
get handle() {
|
1069
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1921
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1070
1922
|
return identifier;
|
1071
1923
|
}
|
1072
1924
|
};
|
@@ -1074,7 +1926,7 @@ var ContextImpl = class ContextImpl {
|
|
1074
1926
|
type: "featured",
|
1075
1927
|
identifier,
|
1076
1928
|
get handle() {
|
1077
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1929
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1078
1930
|
return identifier;
|
1079
1931
|
}
|
1080
1932
|
};
|
@@ -1082,19 +1934,19 @@ var ContextImpl = class ContextImpl {
|
|
1082
1934
|
type: "featuredTags",
|
1083
1935
|
identifier,
|
1084
1936
|
get handle() {
|
1085
|
-
logger.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1937
|
+
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
1086
1938
|
return identifier;
|
1087
1939
|
}
|
1088
1940
|
};
|
1089
1941
|
return null;
|
1090
1942
|
}
|
1091
1943
|
async getActorKeyPairs(identifier) {
|
1092
|
-
const logger = getLogger([
|
1944
|
+
const logger$2 = getLogger([
|
1093
1945
|
"fedify",
|
1094
1946
|
"federation",
|
1095
1947
|
"actor"
|
1096
1948
|
]);
|
1097
|
-
if (this.invokedFromActorKeyPairsDispatcher != null) logger.warn("Context.getActorKeyPairs({getActorKeyPairsIdentifier}) method is invoked from the actor key pairs dispatcher ({actorKeyPairsDispatcherIdentifier}); this may cause an infinite loop.", {
|
1949
|
+
if (this.invokedFromActorKeyPairsDispatcher != null) logger$2.warn("Context.getActorKeyPairs({getActorKeyPairsIdentifier}) method is invoked from the actor key pairs dispatcher ({actorKeyPairsDispatcherIdentifier}); this may cause an infinite loop.", {
|
1098
1950
|
getActorKeyPairsIdentifier: identifier,
|
1099
1951
|
actorKeyPairsDispatcherIdentifier: this.invokedFromActorKeyPairsDispatcher.identifier
|
1100
1952
|
});
|
@@ -1102,7 +1954,7 @@ var ContextImpl = class ContextImpl {
|
|
1102
1954
|
try {
|
1103
1955
|
keyPairs = await this.getKeyPairsFromIdentifier(identifier);
|
1104
1956
|
} catch (_) {
|
1105
|
-
logger.warn("No actor key pairs dispatcher registered.");
|
1957
|
+
logger$2.warn("No actor key pairs dispatcher registered.");
|
1106
1958
|
return [];
|
1107
1959
|
}
|
1108
1960
|
const owner = this.getActorUri(identifier);
|
@@ -1126,7 +1978,7 @@ var ContextImpl = class ContextImpl {
|
|
1126
1978
|
return result;
|
1127
1979
|
}
|
1128
1980
|
async getKeyPairsFromIdentifier(identifier) {
|
1129
|
-
const logger = getLogger([
|
1981
|
+
const logger$2 = getLogger([
|
1130
1982
|
"fedify",
|
1131
1983
|
"federation",
|
1132
1984
|
"actor"
|
@@ -1137,7 +1989,7 @@ var ContextImpl = class ContextImpl {
|
|
1137
1989
|
handle: identifier
|
1138
1990
|
});
|
1139
1991
|
if (path == null) {
|
1140
|
-
logger.warn("No actor dispatcher registered.");
|
1992
|
+
logger$2.warn("No actor dispatcher registered.");
|
1141
1993
|
return [];
|
1142
1994
|
}
|
1143
1995
|
const actorUri = new URL(path, this.canonicalOrigin);
|
@@ -1145,7 +1997,7 @@ var ContextImpl = class ContextImpl {
|
|
1145
1997
|
...this,
|
1146
1998
|
invokedFromActorKeyPairsDispatcher: { identifier }
|
1147
1999
|
}), identifier);
|
1148
|
-
if (keyPairs.length < 1) logger.warn("No key pairs found for actor {identifier}.", { identifier });
|
2000
|
+
if (keyPairs.length < 1) logger$2.warn("No key pairs found for actor {identifier}.", { identifier });
|
1149
2001
|
let i = 0;
|
1150
2002
|
const result = [];
|
1151
2003
|
for (const keyPair of keyPairs) {
|
@@ -1262,7 +2114,7 @@ var ContextImpl = class ContextImpl {
|
|
1262
2114
|
});
|
1263
2115
|
}
|
1264
2116
|
async sendActivityInternal(sender, recipients, activity, options, span) {
|
1265
|
-
const logger = getLogger([
|
2117
|
+
const logger$2 = getLogger([
|
1266
2118
|
"fedify",
|
1267
2119
|
"federation",
|
1268
2120
|
"outbox"
|
@@ -1276,7 +2128,7 @@ var ContextImpl = class ContextImpl {
|
|
1276
2128
|
if ("username" in sender) username = sender.username;
|
1277
2129
|
else {
|
1278
2130
|
username = sender.handle;
|
1279
|
-
logger.warn("The \"handle\" property for the sender parameter is deprecated; use \"identifier\" or \"username\" instead.", { sender });
|
2131
|
+
logger$2.warn("The \"handle\" property for the sender parameter is deprecated; use \"identifier\" or \"username\" instead.", { sender });
|
1280
2132
|
}
|
1281
2133
|
if (this.federation.actorCallbacks?.handleMapper == null) identifier = username;
|
1282
2134
|
else {
|
@@ -1313,7 +2165,7 @@ var ContextImpl = class ContextImpl {
|
|
1313
2165
|
for (const activityTransformer of this.federation.activityTransformers) activity = activityTransformer(activity, this);
|
1314
2166
|
span?.setAttribute("activitypub.activity.id", activity?.id?.href ?? "");
|
1315
2167
|
if (activity.actorId == null) {
|
1316
|
-
logger.error("Activity {activityId} to send does not have an actor.", {
|
2168
|
+
logger$2.error("Activity {activityId} to send does not have an actor.", {
|
1317
2169
|
activity,
|
1318
2170
|
activityId: activity?.id?.href
|
1319
2171
|
});
|
@@ -1324,7 +2176,7 @@ var ContextImpl = class ContextImpl {
|
|
1324
2176
|
preferSharedInbox: options.preferSharedInbox,
|
1325
2177
|
excludeBaseUris: options.excludeBaseUris
|
1326
2178
|
});
|
1327
|
-
logger.debug("Sending activity {activityId} to inboxes:\n{inboxes}", {
|
2179
|
+
logger$2.debug("Sending activity {activityId} to inboxes:\n{inboxes}", {
|
1328
2180
|
inboxes: globalThis.Object.keys(inboxes),
|
1329
2181
|
activityId: activity.id?.href,
|
1330
2182
|
activity
|
@@ -1412,7 +2264,7 @@ var ContextImpl = class ContextImpl {
|
|
1412
2264
|
});
|
1413
2265
|
}
|
1414
2266
|
async routeActivityInternal(recipient, activity, options = {}, span) {
|
1415
|
-
const logger = getLogger([
|
2267
|
+
const logger$2 = getLogger([
|
1416
2268
|
"fedify",
|
1417
2269
|
"federation",
|
1418
2270
|
"inbox"
|
@@ -1427,12 +2279,12 @@ var ContextImpl = class ContextImpl {
|
|
1427
2279
|
keyCache
|
1428
2280
|
});
|
1429
2281
|
if (verified == null) {
|
1430
|
-
logger.debug("Object Integrity Proofs are not verified.", {
|
2282
|
+
logger$2.debug("Object Integrity Proofs are not verified.", {
|
1431
2283
|
recipient,
|
1432
2284
|
activity: json
|
1433
2285
|
});
|
1434
2286
|
if (activity.id == null) {
|
1435
|
-
logger.debug("Activity is missing an ID; unable to fetch.", {
|
2287
|
+
logger$2.debug("Activity is missing an ID; unable to fetch.", {
|
1436
2288
|
recipient,
|
1437
2289
|
activity: json
|
1438
2290
|
});
|
@@ -1440,26 +2292,26 @@ var ContextImpl = class ContextImpl {
|
|
1440
2292
|
}
|
1441
2293
|
const fetched = await this.lookupObject(activity.id, options);
|
1442
2294
|
if (fetched == null) {
|
1443
|
-
logger.debug("Failed to fetch the remote activity object {activityId}.", {
|
2295
|
+
logger$2.debug("Failed to fetch the remote activity object {activityId}.", {
|
1444
2296
|
recipient,
|
1445
2297
|
activity: json,
|
1446
2298
|
activityId: activity.id.href
|
1447
2299
|
});
|
1448
2300
|
return false;
|
1449
2301
|
} else if (!(fetched instanceof Activity)) {
|
1450
|
-
logger.debug("Fetched object is not an Activity.", {
|
2302
|
+
logger$2.debug("Fetched object is not an Activity.", {
|
1451
2303
|
recipient,
|
1452
2304
|
activity: await fetched.toJsonLd({ contextLoader })
|
1453
2305
|
});
|
1454
2306
|
return false;
|
1455
2307
|
} else if (fetched.id?.href !== activity.id.href) {
|
1456
|
-
logger.debug("Fetched activity object has a different ID; failed to verify.", {
|
2308
|
+
logger$2.debug("Fetched activity object has a different ID; failed to verify.", {
|
1457
2309
|
recipient,
|
1458
2310
|
activity: await fetched.toJsonLd({ contextLoader })
|
1459
2311
|
});
|
1460
2312
|
return false;
|
1461
2313
|
} else if (fetched.actorIds.length < 1) {
|
1462
|
-
logger.debug("Fetched activity object is missing an actor; unable to verify.", {
|
2314
|
+
logger$2.debug("Fetched activity object is missing an actor; unable to verify.", {
|
1463
2315
|
recipient,
|
1464
2316
|
activity: await fetched.toJsonLd({ contextLoader })
|
1465
2317
|
});
|
@@ -1467,15 +2319,15 @@ var ContextImpl = class ContextImpl {
|
|
1467
2319
|
}
|
1468
2320
|
const activityId = fetched.id;
|
1469
2321
|
if (!fetched.actorIds.every((actor) => actor.origin === activityId.origin)) {
|
1470
|
-
logger.debug("Fetched activity object has actors from different origins; unable to verify.", {
|
2322
|
+
logger$2.debug("Fetched activity object has actors from different origins; unable to verify.", {
|
1471
2323
|
recipient,
|
1472
2324
|
activity: await fetched.toJsonLd({ contextLoader })
|
1473
2325
|
});
|
1474
2326
|
return false;
|
1475
2327
|
}
|
1476
|
-
logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
|
2328
|
+
logger$2.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
|
1477
2329
|
activity = fetched;
|
1478
|
-
} else logger.debug("Object Integrity Proofs are verified.", {
|
2330
|
+
} else logger$2.debug("Object Integrity Proofs are verified.", {
|
1479
2331
|
recipient,
|
1480
2332
|
activity: json
|
1481
2333
|
});
|
@@ -1620,7 +2472,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1620
2472
|
});
|
1621
2473
|
}
|
1622
2474
|
async forwardActivityInternal(forwarder, recipients, options) {
|
1623
|
-
const logger = getLogger([
|
2475
|
+
const logger$2 = getLogger([
|
1624
2476
|
"fedify",
|
1625
2477
|
"federation",
|
1626
2478
|
"inbox"
|
@@ -1634,7 +2486,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1634
2486
|
if ("username" in forwarder) username = forwarder.username;
|
1635
2487
|
else {
|
1636
2488
|
username = forwarder.handle;
|
1637
|
-
logger.warn("The \"handle\" property for the forwarder parameter is deprecated; use \"identifier\" or \"username\" instead.", { forwarder });
|
2489
|
+
logger$2.warn("The \"handle\" property for the forwarder parameter is deprecated; use \"identifier\" or \"username\" instead.", { forwarder });
|
1638
2490
|
}
|
1639
2491
|
if (this.federation.actorCallbacks?.handleMapper == null) identifier = username;
|
1640
2492
|
else {
|
@@ -1659,7 +2511,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1659
2511
|
}
|
1660
2512
|
if (!hasProof) {
|
1661
2513
|
if (options?.skipIfUnsigned) return;
|
1662
|
-
logger.warn("The received activity {activityId} is not signed; even if it is forwarded to other servers as is, it may not be accepted by them due to the lack of a signature/proof.");
|
2514
|
+
logger$2.warn("The received activity {activityId} is not signed; even if it is forwarded to other servers as is, it may not be accepted by them due to the lack of a signature/proof.");
|
1663
2515
|
}
|
1664
2516
|
}
|
1665
2517
|
if (recipients === "followers") {
|
@@ -1673,14 +2525,14 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1673
2525
|
preferSharedInbox: options?.preferSharedInbox,
|
1674
2526
|
excludeBaseUris: options?.excludeBaseUris
|
1675
2527
|
});
|
1676
|
-
logger.debug("Forwarding activity {activityId} to inboxes:\n{inboxes}", {
|
2528
|
+
logger$2.debug("Forwarding activity {activityId} to inboxes:\n{inboxes}", {
|
1677
2529
|
inboxes: globalThis.Object.keys(inboxes),
|
1678
2530
|
activityId: this.activityId,
|
1679
2531
|
activity: this.activity
|
1680
2532
|
});
|
1681
2533
|
if (options?.immediate || this.federation.outboxQueue == null) {
|
1682
|
-
if (options?.immediate) logger.debug("Forwarding activity immediately without queue since immediate option is set.");
|
1683
|
-
else logger.debug("Forwarding activity immediately without queue since queue is not set.");
|
2534
|
+
if (options?.immediate) logger$2.debug("Forwarding activity immediately without queue since immediate option is set.");
|
2535
|
+
else logger$2.debug("Forwarding activity immediately without queue since queue is not set.");
|
1684
2536
|
const promises = [];
|
1685
2537
|
for (const inbox in inboxes) promises.push(sendActivity({
|
1686
2538
|
keys,
|
@@ -1695,7 +2547,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1695
2547
|
await Promise.all(promises);
|
1696
2548
|
return;
|
1697
2549
|
}
|
1698
|
-
logger.debug("Enqueuing activity {activityId} to forward later.", {
|
2550
|
+
logger$2.debug("Enqueuing activity {activityId} to forward later.", {
|
1699
2551
|
activityId: this.activityId,
|
1700
2552
|
activity: this.activity
|
1701
2553
|
});
|
@@ -1734,7 +2586,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1734
2586
|
const results = await Promise.allSettled(promises);
|
1735
2587
|
const errors = results.filter((r) => r.status === "rejected").map((r) => r.reason);
|
1736
2588
|
if (errors.length > 0) {
|
1737
|
-
logger.error("Failed to enqueue activity {activityId} to forward later:\n{errors}", {
|
2589
|
+
logger$2.error("Failed to enqueue activity {activityId} to forward later:\n{errors}", {
|
1738
2590
|
activityId: this.activityId,
|
1739
2591
|
errors
|
1740
2592
|
});
|
@@ -1744,7 +2596,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
1744
2596
|
} else try {
|
1745
2597
|
await outboxQueue.enqueueMany(messages);
|
1746
2598
|
} catch (error) {
|
1747
|
-
logger.error("Failed to enqueue activity {activityId} to forward later:\n{error}", {
|
2599
|
+
logger$2.error("Failed to enqueue activity {activityId} to forward later:\n{error}", {
|
1748
2600
|
activityId: this.activityId,
|
1749
2601
|
error
|
1750
2602
|
});
|
@@ -1805,4 +2657,4 @@ function getRequestId(request) {
|
|
1805
2657
|
}
|
1806
2658
|
|
1807
2659
|
//#endregion
|
1808
|
-
export { ContextImpl, FederationImpl, InboxContextImpl, createFederation };
|
2660
|
+
export { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, acceptsJsonLd, actorDehydrator, autoIdAssigner, createFederation, handleActor, handleCollection, handleInbox, handleNodeInfo, handleNodeInfoJrd, handleObject, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|