@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
@@ -0,0 +1,2034 @@
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
3
|
+
import { KvKey, KvStore } from "./kv-BmsWxOQ2.js";
|
4
|
+
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "./docloader-DTRsVZPo.js";
|
5
|
+
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-Dw1pCSIt.js";
|
6
|
+
import { Activity$1 as Activity, Collection$1 as Collection, CryptographicKey$1 as CryptographicKey, Hashtag$1 as Hashtag, Link$1 as Link, Multikey$1 as Multikey, Object$1 } from "./vocab-CLWdoo7y.js";
|
7
|
+
import { Actor, Recipient } from "./actor-lFlm8FYo.js";
|
8
|
+
import { GetKeyOwnerOptions } from "./owner-BjpObx-L.js";
|
9
|
+
import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-DysVoXOu.js";
|
10
|
+
import { LookupWebFingerOptions, ResourceDescriptor } from "./lookup-DAfStZtI.js";
|
11
|
+
import { MessageQueue } from "./mq-Bue016Tz.js";
|
12
|
+
import { Span, TracerProvider } from "@opentelemetry/api";
|
13
|
+
|
14
|
+
//#region compat/types.d.ts
|
15
|
+
/**
|
16
|
+
* A function that transforms an activity object.
|
17
|
+
* @since 1.4.0
|
18
|
+
*/
|
19
|
+
/**
|
20
|
+
* A function that transforms an activity object.
|
21
|
+
* @since 1.4.0
|
22
|
+
*/
|
23
|
+
type ActivityTransformer<TContextData> = (activity: Activity, context: Context<TContextData>) => Activity;
|
24
|
+
|
25
|
+
//#endregion
|
26
|
+
//#region federation/collection.d.ts
|
27
|
+
/**
|
28
|
+
* A page of items.
|
29
|
+
*/
|
30
|
+
interface PageItems<TItem> {
|
31
|
+
prevCursor?: string | null;
|
32
|
+
nextCursor?: string | null;
|
33
|
+
items: TItem[];
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Calculates the [partial follower collection digest][1].
|
37
|
+
*
|
38
|
+
* [1]: https://w3id.org/fep/8fcf#partial-follower-collection-digest
|
39
|
+
* @param uris The URIs to calculate the digest. Duplicate URIs are ignored.
|
40
|
+
* @returns The digest.
|
41
|
+
*/
|
42
|
+
declare function digest(uris: Iterable<string | URL>): Promise<Uint8Array>;
|
43
|
+
/**
|
44
|
+
* Builds [`Collection-Synchronization`][1] header content.
|
45
|
+
*
|
46
|
+
* [1]: https://w3id.org/fep/8fcf#the-collection-synchronization-http-header
|
47
|
+
*
|
48
|
+
* @param collectionId The sender's followers collection URI.
|
49
|
+
* @param actorIds The actor URIs to digest.
|
50
|
+
* @returns The header content.
|
51
|
+
*/
|
52
|
+
declare function buildCollectionSynchronizationHeader(collectionId: string | URL, actorIds: Iterable<string | URL>): Promise<string>;
|
53
|
+
|
54
|
+
//#endregion
|
55
|
+
//#region federation/send.d.ts
|
56
|
+
/**
|
57
|
+
* A key pair for an actor who sends an activity.
|
58
|
+
* @since 0.10.0
|
59
|
+
*/
|
60
|
+
interface SenderKeyPair {
|
61
|
+
/**
|
62
|
+
* The actor's private key to sign the request.
|
63
|
+
*/
|
64
|
+
privateKey: CryptoKey;
|
65
|
+
/**
|
66
|
+
* The public key ID that corresponds to the private key.
|
67
|
+
*/
|
68
|
+
keyId: URL;
|
69
|
+
}
|
70
|
+
|
71
|
+
//#endregion
|
72
|
+
//#region federation/callback.d.ts
|
73
|
+
/**
|
74
|
+
* Parameters for {@link sendActivity}.
|
75
|
+
*/
|
76
|
+
/**
|
77
|
+
* A callback that dispatches a {@link NodeInfo} object.
|
78
|
+
*
|
79
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
80
|
+
*/
|
81
|
+
type NodeInfoDispatcher<TContextData> = (context: RequestContext<TContextData>) => NodeInfo | Promise<NodeInfo>;
|
82
|
+
/**
|
83
|
+
* A callback that dispatches an {@link Actor} object.
|
84
|
+
*
|
85
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
86
|
+
* @param context The request context.
|
87
|
+
* @param identifier The actor's internal identifier or username.
|
88
|
+
*/
|
89
|
+
type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, identifier: string) => Actor | null | Promise<Actor | null>;
|
90
|
+
/**
|
91
|
+
* A callback that dispatches key pairs for an actor.
|
92
|
+
*
|
93
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
94
|
+
* @param context The context.
|
95
|
+
* @param identifier The actor's internal identifier or username.
|
96
|
+
* @returns The key pairs.
|
97
|
+
* @since 0.10.0
|
98
|
+
*/
|
99
|
+
type ActorKeyPairsDispatcher<TContextData> = (context: Context<TContextData>, identifier: string) => CryptoKeyPair[] | Promise<CryptoKeyPair[]>;
|
100
|
+
/**
|
101
|
+
* A callback that maps a WebFinger username to the corresponding actor's
|
102
|
+
* internal identifier, or `null` if the username is not found.
|
103
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
104
|
+
* @param context The context.
|
105
|
+
* @param username The WebFinger username.
|
106
|
+
* @returns The actor's internal identifier, or `null` if the username is not
|
107
|
+
* found.
|
108
|
+
* @since 0.15.0
|
109
|
+
*/
|
110
|
+
type ActorHandleMapper<TContextData> = (context: Context<TContextData>, username: string) => string | null | Promise<string | null>;
|
111
|
+
/**
|
112
|
+
* A callback that maps a WebFinger query to the corresponding actor's
|
113
|
+
* internal identifier or username, or `null` if the query is not found.
|
114
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
115
|
+
* @param context The request context.
|
116
|
+
* @param resource The URL that was queried through WebFinger.
|
117
|
+
* @returns The actor's internal identifier or username, or `null` if the query
|
118
|
+
* is not found.
|
119
|
+
* @since 1.4.0
|
120
|
+
*/
|
121
|
+
type ActorAliasMapper<TContextData> = (context: RequestContext<TContextData>, resource: URL) => {
|
122
|
+
identifier: string;
|
123
|
+
} | {
|
124
|
+
username: string;
|
125
|
+
} | null | Promise<{
|
126
|
+
identifier: string;
|
127
|
+
} | {
|
128
|
+
username: string;
|
129
|
+
} | null>;
|
130
|
+
/**
|
131
|
+
* A callback that dispatches an object.
|
132
|
+
*
|
133
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
134
|
+
* @typeParam TObject The type of object to dispatch.
|
135
|
+
* @typeParam TParam The parameter names of the requested URL.
|
136
|
+
* @since 0.7.0
|
137
|
+
*/
|
138
|
+
type ObjectDispatcher<TContextData, TObject extends Object$1, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => TObject | null | Promise<TObject | null>;
|
139
|
+
/**
|
140
|
+
* A callback that dispatches a collection.
|
141
|
+
*
|
142
|
+
* @typeParam TItem The type of items in the collection.
|
143
|
+
* @typeParam TContext The type of the context. {@link Context} or
|
144
|
+
* {@link RequestContext}.
|
145
|
+
* @typeParam TContextData The context data to pass to the `TContext`.
|
146
|
+
* @typeParam TFilter The type of the filter, if any.
|
147
|
+
* @param context The context.
|
148
|
+
* @param identifier The internal identifier or the username of the collection
|
149
|
+
* owner.
|
150
|
+
* @param cursor The cursor to start the collection from, or `null` to dispatch
|
151
|
+
* the entire collection without pagination.
|
152
|
+
* @param filter The filter to apply to the collection, if any.
|
153
|
+
*/
|
154
|
+
type CollectionDispatcher<TItem, TContext extends Context<TContextData>, TContextData, TFilter> = (context: TContext, identifier: string, cursor: string | null, filter?: TFilter) => PageItems<TItem> | null | Promise<PageItems<TItem> | null>;
|
155
|
+
/**
|
156
|
+
* A callback that counts the number of items in a collection.
|
157
|
+
*
|
158
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
159
|
+
* @param context The context.
|
160
|
+
* @param identifier The internal identifier or the username of the collection
|
161
|
+
* owner.
|
162
|
+
* @param filter The filter to apply to the collection, if any.
|
163
|
+
*/
|
164
|
+
type CollectionCounter<TContextData, TFilter> = (context: RequestContext<TContextData>, identifier: string, filter?: TFilter) => number | bigint | null | Promise<number | bigint | null>;
|
165
|
+
/**
|
166
|
+
* A callback that returns a cursor for a collection.
|
167
|
+
*
|
168
|
+
* @typeParam TContext The type of the context. {@link Context} or
|
169
|
+
* {@link RequestContext}.
|
170
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
171
|
+
* @typeParam TFilter The type of the filter, if any.
|
172
|
+
* @param context The context.
|
173
|
+
* @param identifier The internal identifier or the username of the collection
|
174
|
+
* owner.
|
175
|
+
* @param filter The filter to apply to the collection, if any.
|
176
|
+
*/
|
177
|
+
type CollectionCursor<TContext extends Context<TContextData>, TContextData, TFilter> = (context: TContext, identifier: string, filter?: TFilter) => string | null | Promise<string | null>;
|
178
|
+
/**
|
179
|
+
* A callback that listens for activities in an inbox.
|
180
|
+
*
|
181
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
182
|
+
* @typeParam TActivity The type of activity to listen for.
|
183
|
+
* @param context The inbox context.
|
184
|
+
* @param activity The activity that was received.
|
185
|
+
*/
|
186
|
+
type InboxListener<TContextData, TActivity extends Activity> = (context: InboxContext<TContextData>, activity: TActivity) => void | Promise<void>;
|
187
|
+
/**
|
188
|
+
* A callback that handles errors in an inbox.
|
189
|
+
*
|
190
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
191
|
+
* @param context The inbox context.
|
192
|
+
*/
|
193
|
+
type InboxErrorHandler<TContextData> = (context: Context<TContextData>, error: Error) => void | Promise<void>;
|
194
|
+
/**
|
195
|
+
* A callback that dispatches the key pair for the authenticated document loader
|
196
|
+
* of the {@link Context} passed to the shared inbox listener.
|
197
|
+
*
|
198
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
199
|
+
* @param context The context.
|
200
|
+
* @returns The username or the internal identifier of the actor or the key pair
|
201
|
+
* for the authenticated document loader of the {@link Context} passed
|
202
|
+
* to the shared inbox listener. If `null` is returned, the request is
|
203
|
+
* not authorized.
|
204
|
+
* @since 0.11.0
|
205
|
+
*/
|
206
|
+
type SharedInboxKeyDispatcher<TContextData> = (context: Context<TContextData>) => SenderKeyPair | {
|
207
|
+
identifier: string;
|
208
|
+
} | {
|
209
|
+
username: string;
|
210
|
+
} | {
|
211
|
+
handle: string;
|
212
|
+
} | null | Promise<SenderKeyPair | {
|
213
|
+
identifier: string;
|
214
|
+
} | {
|
215
|
+
username: string;
|
216
|
+
} | {
|
217
|
+
handle: string;
|
218
|
+
} | null>;
|
219
|
+
/**
|
220
|
+
* A callback that handles errors during outbox processing.
|
221
|
+
*
|
222
|
+
* @param error The error that occurred.
|
223
|
+
* @param activity The activity that caused the error. If it is `null`, the
|
224
|
+
* error occurred during deserializing the activity.
|
225
|
+
* @since 0.6.0
|
226
|
+
*/
|
227
|
+
type OutboxErrorHandler = (error: Error, activity: Activity | null) => void | Promise<void>;
|
228
|
+
/**
|
229
|
+
* A callback that determines if a request is authorized or not.
|
230
|
+
*
|
231
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
232
|
+
* @param context The request context.
|
233
|
+
* @param identifier The internal identifier of the actor that is being requested.
|
234
|
+
* @param signedKey *Deprecated in Fedify 1.5.0 in favor of
|
235
|
+
* {@link RequestContext.getSignedKey} method.*
|
236
|
+
* The key that was used to sign the request, or `null` if
|
237
|
+
* the request was not signed or the signature was invalid.
|
238
|
+
* @param signedKeyOwner *Deprecated in Fedify 1.5.0 in favor of
|
239
|
+
* {@link RequestContext.getSignedKeyOwner} method.*
|
240
|
+
* The actor that owns the key that was used to sign the
|
241
|
+
* request, or `null` if the request was not signed or the
|
242
|
+
* signature was invalid, or if the key is not associated
|
243
|
+
* with an actor.
|
244
|
+
* @returns `true` if the request is authorized, `false` otherwise.
|
245
|
+
* @since 0.7.0
|
246
|
+
*/
|
247
|
+
type AuthorizePredicate<TContextData> = (context: RequestContext<TContextData>, identifier: string, signedKey: CryptographicKey | null, signedKeyOwner: Actor | null) => boolean | Promise<boolean>;
|
248
|
+
/**
|
249
|
+
* A callback that determines if a request is authorized or not.
|
250
|
+
*
|
251
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
252
|
+
* @typeParam TParam The parameter names of the requested URL.
|
253
|
+
* @param context The request context.
|
254
|
+
* @param values The parameters of the requested URL.
|
255
|
+
* @param signedKey *Deprecated in Fedify 1.5.0 in favor of
|
256
|
+
* {@link RequestContext.getSignedKey} method.*
|
257
|
+
* The key that was used to sign the request, or `null` if
|
258
|
+
* the request was not signed or the signature was invalid.
|
259
|
+
* @param signedKeyOwner *Deprecated in Fedify 1.5.0 in favor of
|
260
|
+
* {@link RequestContext.getSignedKeyOwner} method.*
|
261
|
+
* The actor that owns the key that was used to sign the
|
262
|
+
* request, or `null` if the request was not signed or the
|
263
|
+
* signature was invalid, or if the key is not associated
|
264
|
+
* with an actor.
|
265
|
+
* @returns `true` if the request is authorized, `false` otherwise.
|
266
|
+
* @since 0.7.0
|
267
|
+
*/
|
268
|
+
type ObjectAuthorizePredicate<TContextData, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>, signedKey: CryptographicKey | null, signedKeyOwner: Actor | null) => boolean | Promise<boolean>;
|
269
|
+
|
270
|
+
//#endregion
|
271
|
+
//#region federation/handler.d.ts
|
272
|
+
/**
|
273
|
+
* Options for the {@link respondWithObject} and
|
274
|
+
* {@link respondWithObjectIfAcceptable} functions.
|
275
|
+
* @since 0.3.0
|
276
|
+
*/
|
277
|
+
interface RespondWithObjectOptions {
|
278
|
+
/**
|
279
|
+
* The document loader to use for compacting JSON-LD.
|
280
|
+
* @since 0.8.0
|
281
|
+
*/
|
282
|
+
contextLoader: DocumentLoader;
|
283
|
+
}
|
284
|
+
/**
|
285
|
+
* Responds with the given object in JSON-LD format.
|
286
|
+
*
|
287
|
+
* @param object The object to respond with.
|
288
|
+
* @param options Options.
|
289
|
+
* @since 0.3.0
|
290
|
+
*/
|
291
|
+
declare function respondWithObject(object: Object$1, options?: RespondWithObjectOptions): Promise<Response>;
|
292
|
+
/**
|
293
|
+
* Responds with the given object in JSON-LD format if the request accepts
|
294
|
+
* JSON-LD.
|
295
|
+
*
|
296
|
+
* @param object The object to respond with.
|
297
|
+
* @param request The request to check for JSON-LD acceptability.
|
298
|
+
* @param options Options.
|
299
|
+
* @since 0.3.0
|
300
|
+
*/
|
301
|
+
declare function respondWithObjectIfAcceptable(object: Object$1, request: Request, options?: RespondWithObjectOptions): Promise<Response | null>;
|
302
|
+
|
303
|
+
//#endregion
|
304
|
+
//#region federation/router.d.ts
|
305
|
+
/**
|
306
|
+
* Options for the {@link Router}.
|
307
|
+
* @since 0.12.0
|
308
|
+
*/
|
309
|
+
interface RouterOptions {
|
310
|
+
/**
|
311
|
+
* Whether to ignore trailing slashes when matching paths.
|
312
|
+
*/
|
313
|
+
trailingSlashInsensitive?: boolean;
|
314
|
+
}
|
315
|
+
/**
|
316
|
+
* The result of {@link Router.route} method.
|
317
|
+
* @since 1.3.0
|
318
|
+
*/
|
319
|
+
interface RouterRouteResult {
|
320
|
+
/**
|
321
|
+
* The matched route name.
|
322
|
+
*/
|
323
|
+
name: string;
|
324
|
+
/**
|
325
|
+
* The URL template of the matched route.
|
326
|
+
*/
|
327
|
+
template: string;
|
328
|
+
/**
|
329
|
+
* The values extracted from the URL.
|
330
|
+
*/
|
331
|
+
values: Record<string, string>;
|
332
|
+
}
|
333
|
+
/**
|
334
|
+
* URL router and constructor based on URI Template
|
335
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
336
|
+
*/
|
337
|
+
declare class Router {
|
338
|
+
#private;
|
339
|
+
/**
|
340
|
+
* Whether to ignore trailing slashes when matching paths.
|
341
|
+
* @since 1.6.0
|
342
|
+
*/
|
343
|
+
trailingSlashInsensitive: boolean;
|
344
|
+
/**
|
345
|
+
* Create a new {@link Router}.
|
346
|
+
* @param options Options for the router.
|
347
|
+
*/
|
348
|
+
constructor(options?: RouterOptions);
|
349
|
+
clone(): Router;
|
350
|
+
/**
|
351
|
+
* Checks if a path name exists in the router.
|
352
|
+
* @param name The name of the path.
|
353
|
+
* @returns `true` if the path name exists, otherwise `false`.
|
354
|
+
*/
|
355
|
+
has(name: string): boolean;
|
356
|
+
/**
|
357
|
+
* Adds a new path rule to the router.
|
358
|
+
* @param template The path pattern.
|
359
|
+
* @param name The name of the path.
|
360
|
+
* @returns The names of the variables in the path pattern.
|
361
|
+
*/
|
362
|
+
add(template: string, name: string): Set<string>;
|
363
|
+
/**
|
364
|
+
* Resolves a path name and values from a URL, if any match.
|
365
|
+
* @param url The URL to resolve.
|
366
|
+
* @returns The name of the path and its values, if any match. Otherwise,
|
367
|
+
* `null`.
|
368
|
+
*/
|
369
|
+
route(url: string): RouterRouteResult | null;
|
370
|
+
/**
|
371
|
+
* Constructs a URL/path from a path name and values.
|
372
|
+
* @param name The name of the path.
|
373
|
+
* @param values The values to expand the path with.
|
374
|
+
* @returns The URL/path, if the name exists. Otherwise, `null`.
|
375
|
+
*/
|
376
|
+
build(name: string, values: Record<string, string>): string | null;
|
377
|
+
}
|
378
|
+
/**
|
379
|
+
* An error thrown by the {@link Router}.
|
380
|
+
*/
|
381
|
+
declare class RouterError extends Error {
|
382
|
+
/**
|
383
|
+
* Create a new {@link RouterError}.
|
384
|
+
* @param message The error message.
|
385
|
+
*/
|
386
|
+
constructor(message: string);
|
387
|
+
}
|
388
|
+
|
389
|
+
//#endregion
|
390
|
+
//#region federation/builder.d.ts
|
391
|
+
/**
|
392
|
+
* Creates a new {@link FederationBuilder} instance.
|
393
|
+
* @returns A new {@link FederationBuilder} instance.
|
394
|
+
* @since 1.6.0
|
395
|
+
*/
|
396
|
+
declare function createFederationBuilder<TContextData>(): FederationBuilder<TContextData>;
|
397
|
+
|
398
|
+
//#endregion
|
399
|
+
//#region federation/queue.d.ts
|
400
|
+
interface SenderKeyJwkPair {
|
401
|
+
keyId: string;
|
402
|
+
privateKey: JsonWebKey;
|
403
|
+
}
|
404
|
+
/**
|
405
|
+
* A message that represents a task to be processed by the background worker.
|
406
|
+
* The concrete type of the message depends on the `type` property.
|
407
|
+
*
|
408
|
+
* Please do not depend on the concrete types of the messages, as they may
|
409
|
+
* change in the future. You should treat the `Message` type as an opaque
|
410
|
+
* type.
|
411
|
+
* @since 1.6.0
|
412
|
+
*/
|
413
|
+
type Message = FanoutMessage | OutboxMessage | InboxMessage;
|
414
|
+
interface FanoutMessage {
|
415
|
+
type: "fanout";
|
416
|
+
id: ReturnType<typeof crypto.randomUUID>;
|
417
|
+
baseUrl: string;
|
418
|
+
keys: SenderKeyJwkPair[];
|
419
|
+
inboxes: Record<string, {
|
420
|
+
actorIds: string[];
|
421
|
+
sharedInbox: boolean;
|
422
|
+
}>;
|
423
|
+
activity: unknown;
|
424
|
+
activityId?: string;
|
425
|
+
activityType: string;
|
426
|
+
collectionSync?: string;
|
427
|
+
traceContext: Record<string, string>;
|
428
|
+
}
|
429
|
+
interface OutboxMessage {
|
430
|
+
type: "outbox";
|
431
|
+
id: ReturnType<typeof crypto.randomUUID>;
|
432
|
+
baseUrl: string;
|
433
|
+
keys: SenderKeyJwkPair[];
|
434
|
+
activity: unknown;
|
435
|
+
activityId?: string;
|
436
|
+
activityType: string;
|
437
|
+
inbox: string;
|
438
|
+
sharedInbox: boolean;
|
439
|
+
started: string;
|
440
|
+
attempt: number;
|
441
|
+
headers: Record<string, string>;
|
442
|
+
traceContext: Record<string, string>;
|
443
|
+
}
|
444
|
+
interface InboxMessage {
|
445
|
+
type: "inbox";
|
446
|
+
id: ReturnType<typeof crypto.randomUUID>;
|
447
|
+
baseUrl: string;
|
448
|
+
activity: unknown;
|
449
|
+
started: string;
|
450
|
+
attempt: number;
|
451
|
+
identifier: string | null;
|
452
|
+
traceContext: Record<string, string>;
|
453
|
+
}
|
454
|
+
|
455
|
+
//#endregion
|
456
|
+
//#region federation/retry.d.ts
|
457
|
+
/**
|
458
|
+
* The context passed to a {@link RetryPolicy} callback.
|
459
|
+
* @since 0.12.0
|
460
|
+
*/
|
461
|
+
interface RetryContext {
|
462
|
+
/**
|
463
|
+
* The elapsed time since the first attempt.
|
464
|
+
*/
|
465
|
+
readonly elapsedTime: Temporal.Duration;
|
466
|
+
/**
|
467
|
+
* The number of attempts so far.
|
468
|
+
*/
|
469
|
+
readonly attempts: number;
|
470
|
+
}
|
471
|
+
/**
|
472
|
+
* A policy that determines the delay before the next retry.
|
473
|
+
* @param context The retry context.
|
474
|
+
* @returns The delay before the next retry, or `null` to stop retrying.
|
475
|
+
* It must not negative.
|
476
|
+
* @since 0.12.0
|
477
|
+
*/
|
478
|
+
type RetryPolicy = (context: RetryContext) => Temporal.Duration | null;
|
479
|
+
/**
|
480
|
+
* Options for {@link createExponentialBackoffPolicy} function.
|
481
|
+
* @since 0.12.0
|
482
|
+
*/
|
483
|
+
interface CreateExponentialBackoffPolicyOptions {
|
484
|
+
/**
|
485
|
+
* The initial delay before the first retry. Defaults to 1 second.
|
486
|
+
*/
|
487
|
+
readonly initialDelay?: Temporal.DurationLike;
|
488
|
+
/**
|
489
|
+
* The maximum delay between retries. Defaults to 12 hours.
|
490
|
+
*/
|
491
|
+
readonly maxDelay?: Temporal.DurationLike;
|
492
|
+
/**
|
493
|
+
* The maximum number of attempts before giving up.
|
494
|
+
* Defaults to 10.
|
495
|
+
*/
|
496
|
+
readonly maxAttempts?: number;
|
497
|
+
/**
|
498
|
+
* The factor to multiply the previous delay by for each retry.
|
499
|
+
* Defaults to 2.
|
500
|
+
*/
|
501
|
+
readonly factor?: number;
|
502
|
+
/**
|
503
|
+
* Whether to add jitter to the delay to avoid synchronization.
|
504
|
+
* Turned on by default.
|
505
|
+
*/
|
506
|
+
readonly jitter?: boolean;
|
507
|
+
}
|
508
|
+
/**
|
509
|
+
* Creates an exponential backoff retry policy. The delay between retries
|
510
|
+
* starts at the `initialDelay` and is multiplied by the `factor` for each
|
511
|
+
* subsequent retry, up to the `maxDelay`. The policy will give up after
|
512
|
+
* `maxAttempts` attempts. The actual delay is randomized to avoid
|
513
|
+
* synchronization (jitter).
|
514
|
+
* @param options The options for the policy.
|
515
|
+
* @returns The retry policy.
|
516
|
+
* @since 0.12.0
|
517
|
+
*/
|
518
|
+
declare function createExponentialBackoffPolicy(options?: CreateExponentialBackoffPolicyOptions): RetryPolicy;
|
519
|
+
|
520
|
+
//#endregion
|
521
|
+
//#region federation/middleware.d.ts
|
522
|
+
/**
|
523
|
+
* Options for {@link createFederation} function.
|
524
|
+
* @typeParam TContextData The type of the context data.
|
525
|
+
* @since 0.10.0
|
526
|
+
* @deprecated Use {@link FederationOptions} instead.
|
527
|
+
*/
|
528
|
+
interface CreateFederationOptions<TContextData> extends FederationOptions<TContextData> {}
|
529
|
+
/**
|
530
|
+
* Configures the task queues for sending and receiving activities.
|
531
|
+
* @since 1.3.0
|
532
|
+
*/
|
533
|
+
interface FederationQueueOptions {
|
534
|
+
/**
|
535
|
+
* The message queue for incoming activities. If not provided, incoming
|
536
|
+
* activities will not be queued and will be processed immediately.
|
537
|
+
*/
|
538
|
+
inbox?: MessageQueue;
|
539
|
+
/**
|
540
|
+
* The message queue for outgoing activities. If not provided, outgoing
|
541
|
+
* activities will not be queued and will be sent immediately.
|
542
|
+
*/
|
543
|
+
outbox?: MessageQueue;
|
544
|
+
/**
|
545
|
+
* The message queue for fanning out outgoing activities. If not provided,
|
546
|
+
* outgoing activities will not be fanned out in the background, but will be
|
547
|
+
* fanned out immediately, which causes slow response times on
|
548
|
+
* {@link Context.sendActivity} calls.
|
549
|
+
*/
|
550
|
+
fanout?: MessageQueue;
|
551
|
+
}
|
552
|
+
/**
|
553
|
+
* Prefixes for namespacing keys in the Deno KV store.
|
554
|
+
*/
|
555
|
+
interface FederationKvPrefixes {
|
556
|
+
/**
|
557
|
+
* The key prefix used for storing whether activities have already been
|
558
|
+
* processed or not.
|
559
|
+
* @default `["_fedify", "activityIdempotence"]`
|
560
|
+
*/
|
561
|
+
activityIdempotence: KvKey;
|
562
|
+
/**
|
563
|
+
* The key prefix used for storing remote JSON-LD documents.
|
564
|
+
* @default `["_fedify", "remoteDocument"]`
|
565
|
+
*/
|
566
|
+
remoteDocument: KvKey;
|
567
|
+
/**
|
568
|
+
* The key prefix used for caching public keys.
|
569
|
+
* @default `["_fedify", "publicKey"]`
|
570
|
+
* @since 0.12.0
|
571
|
+
*/
|
572
|
+
publicKey: KvKey;
|
573
|
+
/**
|
574
|
+
* The key prefix used for caching HTTP Message Signatures specs.
|
575
|
+
* The cached spec is used to reduce the number of requests to make signed
|
576
|
+
* requests ("double-knocking" technique).
|
577
|
+
* @default `["_fedify", "httpMessageSignaturesSpec"]`
|
578
|
+
* @since 1.6.0
|
579
|
+
*/
|
580
|
+
httpMessageSignaturesSpec: KvKey;
|
581
|
+
}
|
582
|
+
/**
|
583
|
+
* Options for {@link CreateFederationOptions.origin} when it is not a string.
|
584
|
+
* @since 1.5.0
|
585
|
+
*/
|
586
|
+
interface FederationOrigin {
|
587
|
+
/**
|
588
|
+
* The canonical hostname for fediverse handles (which are looked up through
|
589
|
+
* WebFinger). This is used for WebFinger lookups. It has to be a valid
|
590
|
+
* hostname, e.g., `"example.com"`.
|
591
|
+
*/
|
592
|
+
handleHost: string;
|
593
|
+
/**
|
594
|
+
* The canonical origin for web URLs. This is used for constructing absolute
|
595
|
+
* URLs. It has to start with either `"http://"` or `"https://"`, and must
|
596
|
+
* not contain a path or query string, e.g., `"https://example.com"`.
|
597
|
+
*/
|
598
|
+
webOrigin: string;
|
599
|
+
}
|
600
|
+
/**
|
601
|
+
* Create a new {@link Federation} instance.
|
602
|
+
* @param parameters Parameters for initializing the instance.
|
603
|
+
* @returns A new {@link Federation} instance.
|
604
|
+
* @since 0.10.0
|
605
|
+
*/
|
606
|
+
declare function createFederation<TContextData>(options: CreateFederationOptions<TContextData>): Federation<TContextData>;
|
607
|
+
|
608
|
+
//#endregion
|
609
|
+
//#region federation/federation.d.ts
|
610
|
+
/**
|
611
|
+
* Options for {@link Federation.startQueue} method.
|
612
|
+
* @since 1.0.0
|
613
|
+
*/
|
614
|
+
interface FederationStartQueueOptions {
|
615
|
+
/**
|
616
|
+
* The signal to abort the task queue.
|
617
|
+
*/
|
618
|
+
signal?: AbortSignal;
|
619
|
+
/**
|
620
|
+
* Starts the task worker only for the specified queue. If unspecified,
|
621
|
+
* which is the default, the task worker starts for all three queues:
|
622
|
+
* inbox, outbox, and fanout.
|
623
|
+
* @since 1.3.0
|
624
|
+
*/
|
625
|
+
queue?: "inbox" | "outbox" | "fanout";
|
626
|
+
}
|
627
|
+
/**
|
628
|
+
* A common interface between {@link Federation} and {@link FederationBuilder}.
|
629
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
630
|
+
* @since 1.6.0
|
631
|
+
*/
|
632
|
+
interface Federatable<TContextData> {
|
633
|
+
/**
|
634
|
+
* Registers a NodeInfo dispatcher.
|
635
|
+
* @param path The URI path pattern for the NodeInfo dispatcher. The syntax
|
636
|
+
* is based on URI Template
|
637
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
638
|
+
* must have no variables.
|
639
|
+
* @param dispatcher A NodeInfo dispatcher callback to register.
|
640
|
+
* @throws {RouterError} Thrown if the path pattern is invalid.
|
641
|
+
*/
|
642
|
+
setNodeInfoDispatcher(path: string, dispatcher: NodeInfoDispatcher<TContextData>): void;
|
643
|
+
/**
|
644
|
+
* Registers an actor dispatcher.
|
645
|
+
*
|
646
|
+
* @example
|
647
|
+
* ``` typescript
|
648
|
+
* federation.setActorDispatcher(
|
649
|
+
* "/users/{identifier}",
|
650
|
+
* async (ctx, identifier) => {
|
651
|
+
* return new Person({
|
652
|
+
* id: ctx.getActorUri(identifier),
|
653
|
+
* // ...
|
654
|
+
* });
|
655
|
+
* }
|
656
|
+
* );
|
657
|
+
* ```
|
658
|
+
*
|
659
|
+
* @param path The URI path pattern for the actor dispatcher. The syntax is
|
660
|
+
* based on URI Template
|
661
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
662
|
+
* must have one variable: `{identifier}`.
|
663
|
+
* @param dispatcher An actor dispatcher callback to register.
|
664
|
+
* @returns An object with methods to set other actor dispatcher callbacks.
|
665
|
+
* @throws {RouterError} Thrown if the path pattern is invalid.
|
666
|
+
*/
|
667
|
+
setActorDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: ActorDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
668
|
+
/**
|
669
|
+
* Registers an object dispatcher.
|
670
|
+
*
|
671
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
672
|
+
* @typeParam TObject The type of object to dispatch.
|
673
|
+
* @typeParam TParam The parameter names of the requested URL.
|
674
|
+
* @param cls The Activity Vocabulary class of the object to dispatch.
|
675
|
+
* @param path The URI path pattern for the object dispatcher. The syntax is
|
676
|
+
* based on URI Template
|
677
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
678
|
+
* must have one or more variables.
|
679
|
+
* @param dispatcher An object dispatcher callback to register.
|
680
|
+
*/
|
681
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
682
|
+
typeId: URL;
|
683
|
+
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
684
|
+
/**
|
685
|
+
* Registers an object dispatcher.
|
686
|
+
*
|
687
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
688
|
+
* @typeParam TObject The type of object to dispatch.
|
689
|
+
* @typeParam TParam The parameter names of the requested URL.
|
690
|
+
* @param cls The Activity Vocabulary class of the object to dispatch.
|
691
|
+
* @param path The URI path pattern for the object dispatcher. The syntax is
|
692
|
+
* based on URI Template
|
693
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
694
|
+
* must have one or more variables.
|
695
|
+
* @param dispatcher An object dispatcher callback to register.
|
696
|
+
*/
|
697
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
698
|
+
typeId: URL;
|
699
|
+
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
700
|
+
/**
|
701
|
+
* Registers an object dispatcher.
|
702
|
+
*
|
703
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
704
|
+
* @typeParam TObject The type of object to dispatch.
|
705
|
+
* @typeParam TParam The parameter names of the requested URL.
|
706
|
+
* @param cls The Activity Vocabulary class of the object to dispatch.
|
707
|
+
* @param path The URI path pattern for the object dispatcher. The syntax is
|
708
|
+
* based on URI Template
|
709
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
710
|
+
* must have one or more variables.
|
711
|
+
* @param dispatcher An object dispatcher callback to register.
|
712
|
+
*/
|
713
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
714
|
+
typeId: URL;
|
715
|
+
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
716
|
+
/**
|
717
|
+
* Registers an object dispatcher.
|
718
|
+
*
|
719
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
720
|
+
* @typeParam TObject The type of object to dispatch.
|
721
|
+
* @typeParam TParam The parameter names of the requested URL.
|
722
|
+
* @param cls The Activity Vocabulary class of the object to dispatch.
|
723
|
+
* @param path The URI path pattern for the object dispatcher. The syntax is
|
724
|
+
* based on URI Template
|
725
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
726
|
+
* must have one or more variables.
|
727
|
+
* @param dispatcher An object dispatcher callback to register.
|
728
|
+
*/
|
729
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
730
|
+
typeId: URL;
|
731
|
+
}, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
732
|
+
/**
|
733
|
+
* Registers an object dispatcher.
|
734
|
+
*
|
735
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
736
|
+
* @typeParam TObject The type of object to dispatch.
|
737
|
+
* @typeParam TParam The parameter names of the requested URL.
|
738
|
+
* @param cls The Activity Vocabulary class of the object to dispatch.
|
739
|
+
* @param path The URI path pattern for the object dispatcher. The syntax is
|
740
|
+
* based on URI Template
|
741
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
742
|
+
* must have one or more variables.
|
743
|
+
* @param dispatcher An object dispatcher callback to register.
|
744
|
+
*/
|
745
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
746
|
+
typeId: URL;
|
747
|
+
}, path: `${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
748
|
+
/**
|
749
|
+
* Registers an object dispatcher.
|
750
|
+
*
|
751
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
752
|
+
* @typeParam TObject The type of object to dispatch.
|
753
|
+
* @typeParam TParam The parameter names of the requested URL.
|
754
|
+
* @param cls The Activity Vocabulary class of the object to dispatch.
|
755
|
+
* @param path The URI path pattern for the object dispatcher. The syntax is
|
756
|
+
* based on URI Template
|
757
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
758
|
+
* must have one or more variables.
|
759
|
+
* @param dispatcher An object dispatcher callback to register.
|
760
|
+
*/
|
761
|
+
setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: (new (...args: any[]) => TObject) & {
|
762
|
+
typeId: URL;
|
763
|
+
}, path: `${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
764
|
+
/**
|
765
|
+
* Registers an inbox dispatcher.
|
766
|
+
*
|
767
|
+
* @param path The URI path pattern for the inbox dispatcher. The syntax is
|
768
|
+
* based on URI Template
|
769
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
770
|
+
* must have one variable: `{identifier}`, and must match
|
771
|
+
* the inbox listener path.
|
772
|
+
* @param dispatcher An inbox dispatcher callback to register.
|
773
|
+
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
774
|
+
*/
|
775
|
+
setInboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
776
|
+
/**
|
777
|
+
* Registers an outbox dispatcher.
|
778
|
+
*
|
779
|
+
* @example
|
780
|
+
* ``` typescript
|
781
|
+
* federation.setOutboxDispatcher(
|
782
|
+
* "/users/{identifier}/outbox",
|
783
|
+
* async (ctx, identifier, options) => {
|
784
|
+
* let items: Activity[];
|
785
|
+
* let nextCursor: string;
|
786
|
+
* // ...
|
787
|
+
* return { items, nextCursor };
|
788
|
+
* }
|
789
|
+
* );
|
790
|
+
* ```
|
791
|
+
*
|
792
|
+
* @param path The URI path pattern for the outbox dispatcher. The syntax is
|
793
|
+
* based on URI Template
|
794
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
795
|
+
* must have one variable: `{identifier}`.
|
796
|
+
* @param dispatcher An outbox dispatcher callback to register.
|
797
|
+
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
798
|
+
*/
|
799
|
+
setOutboxDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
800
|
+
/**
|
801
|
+
* Registers a following collection dispatcher.
|
802
|
+
* @param path The URI path pattern for the following collection. The syntax
|
803
|
+
* is based on URI Template
|
804
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
805
|
+
* must have one variable: `{identifier}`.
|
806
|
+
* @param dispatcher A following collection callback to register.
|
807
|
+
* @returns An object with methods to set other following collection
|
808
|
+
* callbacks.
|
809
|
+
* @throws {RouterError} Thrown if the path pattern is invalid.
|
810
|
+
*/
|
811
|
+
setFollowingDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Actor | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
812
|
+
/**
|
813
|
+
* Registers a followers collection dispatcher.
|
814
|
+
* @param path The URI path pattern for the followers collection. The syntax
|
815
|
+
* is based on URI Template
|
816
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
817
|
+
* must have one variable: `{identifier}`.
|
818
|
+
* @param dispatcher A followers collection callback to register.
|
819
|
+
* @returns An object with methods to set other followers collection
|
820
|
+
* callbacks.
|
821
|
+
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
822
|
+
*/
|
823
|
+
setFollowersDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>;
|
824
|
+
/**
|
825
|
+
* Registers a liked collection dispatcher.
|
826
|
+
* @param path The URI path pattern for the liked collection. The syntax
|
827
|
+
* is based on URI Template
|
828
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
829
|
+
* must have one variable: `{identifier}`.
|
830
|
+
* @param dispatcher A liked collection callback to register.
|
831
|
+
* @returns An object with methods to set other liked collection
|
832
|
+
* callbacks.
|
833
|
+
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
834
|
+
*/
|
835
|
+
setLikedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1 | URL, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
836
|
+
/**
|
837
|
+
* Registers a featured collection dispatcher.
|
838
|
+
* @param path The URI path pattern for the featured collection. The syntax
|
839
|
+
* is based on URI Template
|
840
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
841
|
+
* must have one variable: `{identifier}`.
|
842
|
+
* @param dispatcher A featured collection callback to register.
|
843
|
+
* @returns An object with methods to set other featured collection
|
844
|
+
* callbacks.
|
845
|
+
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
846
|
+
*/
|
847
|
+
setFeaturedDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Object$1, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
848
|
+
/**
|
849
|
+
* Registers a featured tags collection dispatcher.
|
850
|
+
* @param path The URI path pattern for the featured tags collection.
|
851
|
+
* The syntax is based on URI Template
|
852
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
853
|
+
* must have one variable: `{identifier}`.
|
854
|
+
* @param dispatcher A featured tags collection callback to register.
|
855
|
+
* @returns An object with methods to set other featured tags collection
|
856
|
+
* callbacks.
|
857
|
+
* @throws {@link RouterError} Thrown if the path pattern is invalid.
|
858
|
+
*/
|
859
|
+
setFeaturedTagsDispatcher(path: `${string}{identifier}${string}` | `${string}{handle}${string}`, dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>;
|
860
|
+
/**
|
861
|
+
* Assigns the URL path for the inbox and starts setting inbox listeners.
|
862
|
+
*
|
863
|
+
* @example
|
864
|
+
* ``` typescript
|
865
|
+
* federation
|
866
|
+
* .setInboxListeners("/users/{identifier}/inbox", "/inbox")
|
867
|
+
* .on(Follow, async (ctx, follow) => {
|
868
|
+
* const from = await follow.getActor(ctx);
|
869
|
+
* if (!isActor(from)) return;
|
870
|
+
* // ...
|
871
|
+
* })
|
872
|
+
* .on(Undo, async (ctx, undo) => {
|
873
|
+
* // ...
|
874
|
+
* });
|
875
|
+
* ```
|
876
|
+
*
|
877
|
+
* @param inboxPath The URI path pattern for the inbox. The syntax is based
|
878
|
+
* on URI Template
|
879
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
880
|
+
* The path must have one variable: `{identifier}`, and must
|
881
|
+
* match the inbox dispatcher path.
|
882
|
+
* @param sharedInboxPath An optional URI path pattern for the shared inbox.
|
883
|
+
* The syntax is based on URI Template
|
884
|
+
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
885
|
+
* The path must have no variables.
|
886
|
+
* @returns An object to register inbox listeners.
|
887
|
+
* @throws {RouteError} Thrown if the path pattern is invalid.
|
888
|
+
*/
|
889
|
+
setInboxListeners(inboxPath: `${string}{identifier}${string}` | `${string}{handle}${string}`, sharedInboxPath?: string): InboxListenerSetters<TContextData>;
|
890
|
+
}
|
891
|
+
/**
|
892
|
+
* An object that registers federation-related business logic and dispatches
|
893
|
+
* requests to the appropriate handlers.
|
894
|
+
*
|
895
|
+
* It also provides a middleware interface for handling requests before your
|
896
|
+
* web framework's router; see {@link Federation.fetch}.
|
897
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
898
|
+
* @since 0.13.0
|
899
|
+
*/
|
900
|
+
interface Federation<TContextData> extends Federatable<TContextData> {
|
901
|
+
/**
|
902
|
+
* Manually start the task queue.
|
903
|
+
*
|
904
|
+
* This method is useful when you set the `manuallyStartQueue` option to
|
905
|
+
* `true` in the {@link createFederation} function.
|
906
|
+
* @param contextData The context data to pass to the context.
|
907
|
+
* @param options Additional options for starting the queue.
|
908
|
+
*/
|
909
|
+
startQueue(contextData: TContextData, options?: FederationStartQueueOptions): Promise<void>;
|
910
|
+
/**
|
911
|
+
* Processes a queued message task. This method handles different types of
|
912
|
+
* tasks such as fanout, outbox, and inbox messages.
|
913
|
+
*
|
914
|
+
* Note that you usually do not need to call this method directly unless you
|
915
|
+
* are deploying your federated application on a platform that does not
|
916
|
+
* support long-running processing, such as Cloudflare Workers.
|
917
|
+
* @param contextData The context data to pass to the context.
|
918
|
+
* @param message The message that represents the task to be processed.
|
919
|
+
* @returns A promise that resolves when the message has been processed.
|
920
|
+
* @since 1.6.0
|
921
|
+
*/
|
922
|
+
processQueuedTask(contextData: TContextData, message: Message): Promise<void>;
|
923
|
+
/**
|
924
|
+
* Create a new context.
|
925
|
+
* @param baseUrl The base URL of the server. The `pathname` remains root,
|
926
|
+
* and the `search` and `hash` are stripped.
|
927
|
+
* @param contextData The context data to pass to the context.
|
928
|
+
* @returns The new context.
|
929
|
+
*/
|
930
|
+
createContext(baseUrl: URL, contextData: TContextData): Context<TContextData>;
|
931
|
+
/**
|
932
|
+
* Create a new context for a request.
|
933
|
+
* @param request The request object.
|
934
|
+
* @param contextData The context data to pass to the context.
|
935
|
+
* @returns The new request context.
|
936
|
+
*/
|
937
|
+
createContext(request: Request, contextData: TContextData): RequestContext<TContextData>;
|
938
|
+
/**
|
939
|
+
* Handles a request related to federation. If a request is not related to
|
940
|
+
* federation, the `onNotFound` or `onNotAcceptable` callback is called.
|
941
|
+
*
|
942
|
+
* Usually, this method is called from a server's request handler or
|
943
|
+
* a web framework's middleware.
|
944
|
+
*
|
945
|
+
* @param request The request object.
|
946
|
+
* @param parameters The parameters for handling the request.
|
947
|
+
* @returns The response to the request.
|
948
|
+
*/
|
949
|
+
fetch(request: Request, options: FederationFetchOptions<TContextData>): Promise<Response>;
|
950
|
+
}
|
951
|
+
/**
|
952
|
+
* A builder for creating a {@link Federation} object. It defers the actual
|
953
|
+
* instantiation of the {@link Federation} object until the {@link build}
|
954
|
+
* method is called so that dispatchers and listeners can be registered
|
955
|
+
* before the {@link Federation} object is instantiated.
|
956
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
957
|
+
* @since 1.6.0
|
958
|
+
*/
|
959
|
+
interface FederationBuilder<TContextData> extends Federatable<TContextData> {
|
960
|
+
/**
|
961
|
+
* Builds the federation object.
|
962
|
+
* @returns The federation object.
|
963
|
+
*/
|
964
|
+
build(options: FederationOptions<TContextData>): Promise<Federation<TContextData>>;
|
965
|
+
}
|
966
|
+
/**
|
967
|
+
* Options for creating a {@link Federation} object.
|
968
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
969
|
+
* @since 1.6.0
|
970
|
+
*/
|
971
|
+
interface FederationOptions<TContextData> {
|
972
|
+
/**
|
973
|
+
* The key-value store used for caching, outbox queues, and inbox idempotence.
|
974
|
+
*/
|
975
|
+
kv: KvStore;
|
976
|
+
/**
|
977
|
+
* Prefixes for namespacing keys in the Deno KV store. By default, all keys
|
978
|
+
* are prefixed with `["_fedify"]`.
|
979
|
+
*/
|
980
|
+
kvPrefixes?: Partial<FederationKvPrefixes>;
|
981
|
+
/**
|
982
|
+
* The message queue for sending and receiving activities. If not provided,
|
983
|
+
* activities will not be queued and will be processed immediately.
|
984
|
+
*
|
985
|
+
* If a `MessageQueue` is provided, both the `inbox` and `outbox` queues
|
986
|
+
* will be set to the same queue.
|
987
|
+
*
|
988
|
+
* If a `FederationQueueOptions` object is provided, you can set the queues
|
989
|
+
* separately (since Fedify 1.3.0).
|
990
|
+
*/
|
991
|
+
queue?: FederationQueueOptions | MessageQueue;
|
992
|
+
/**
|
993
|
+
* Whether to start the task queue manually or automatically.
|
994
|
+
*
|
995
|
+
* If `true`, the task queue will not start automatically and you need to
|
996
|
+
* manually start it by calling the {@link Federation.startQueue} method.
|
997
|
+
*
|
998
|
+
* If `false`, the task queue will start automatically as soon as
|
999
|
+
* the first task is enqueued.
|
1000
|
+
*
|
1001
|
+
* By default, the queue starts automatically.
|
1002
|
+
*
|
1003
|
+
* @since 0.12.0
|
1004
|
+
*/
|
1005
|
+
manuallyStartQueue?: boolean;
|
1006
|
+
/**
|
1007
|
+
* The canonical base URL of the server. This is used for constructing
|
1008
|
+
* absolute URLs and fediverse handles.
|
1009
|
+
* @since 1.5.0
|
1010
|
+
*/
|
1011
|
+
origin?: string | FederationOrigin;
|
1012
|
+
/**
|
1013
|
+
* A custom JSON-LD document loader factory. By default, this uses
|
1014
|
+
* the built-in cache-backed loader that fetches remote documents over
|
1015
|
+
* HTTP(S).
|
1016
|
+
* @since 1.4.0
|
1017
|
+
*/
|
1018
|
+
documentLoaderFactory?: DocumentLoaderFactory;
|
1019
|
+
/**
|
1020
|
+
* A custom JSON-LD context loader factory. By default, this uses the same
|
1021
|
+
* loader as the document loader.
|
1022
|
+
* @since 1.4.0
|
1023
|
+
*/
|
1024
|
+
contextLoaderFactory?: DocumentLoaderFactory;
|
1025
|
+
/**
|
1026
|
+
* A custom JSON-LD document loader. By default, this uses the built-in
|
1027
|
+
* cache-backed loader that fetches remote documents over HTTP(S).
|
1028
|
+
* @deprecated Use {@link documentLoaderFactory} instead.
|
1029
|
+
*/
|
1030
|
+
documentLoader?: DocumentLoader;
|
1031
|
+
/**
|
1032
|
+
* A custom JSON-LD context loader. By default, this uses the same loader
|
1033
|
+
* as the document loader.
|
1034
|
+
* @deprecated Use {@link contextLoaderFactory} instead.
|
1035
|
+
*/
|
1036
|
+
contextLoader?: DocumentLoader;
|
1037
|
+
/**
|
1038
|
+
* A factory function that creates an authenticated document loader for a
|
1039
|
+
* given identity. This is used for fetching documents that require
|
1040
|
+
* authentication.
|
1041
|
+
*/
|
1042
|
+
authenticatedDocumentLoaderFactory?: AuthenticatedDocumentLoaderFactory;
|
1043
|
+
/**
|
1044
|
+
* Whether to allow fetching private network addresses in the document loader.
|
1045
|
+
*
|
1046
|
+
* If turned on, {@link CreateFederationOptions.documentLoader},
|
1047
|
+
* {@link CreateFederationOptions.contextLoader}, and
|
1048
|
+
* {@link CreateFederationOptions.authenticatedDocumentLoaderFactory}
|
1049
|
+
* cannot be configured.
|
1050
|
+
*
|
1051
|
+
* Mostly useful for testing purposes. *Do not use in production.*
|
1052
|
+
*
|
1053
|
+
* Turned off by default.
|
1054
|
+
* @since 0.15.0
|
1055
|
+
*/
|
1056
|
+
allowPrivateAddress?: boolean;
|
1057
|
+
/**
|
1058
|
+
* Options for making `User-Agent` strings for HTTP requests.
|
1059
|
+
* If a string is provided, it is used as the `User-Agent` header.
|
1060
|
+
* If an object is provided, it is passed to the {@link getUserAgent}
|
1061
|
+
* function.
|
1062
|
+
* @since 1.3.0
|
1063
|
+
*/
|
1064
|
+
userAgent?: GetUserAgentOptions | string;
|
1065
|
+
/**
|
1066
|
+
* A callback that handles errors during outbox processing. Note that this
|
1067
|
+
* callback can be called multiple times for the same activity, because
|
1068
|
+
* the delivery is retried according to the backoff schedule until it
|
1069
|
+
* succeeds or reaches the maximum retry count.
|
1070
|
+
*
|
1071
|
+
* If any errors are thrown in this callback, they are ignored.
|
1072
|
+
*/
|
1073
|
+
onOutboxError?: OutboxErrorHandler;
|
1074
|
+
/**
|
1075
|
+
* The time window for verifying HTTP Signatures of incoming requests. If the
|
1076
|
+
* request is older or newer than this window, it is rejected. Or if it is
|
1077
|
+
* `false`, the request's timestamp is not checked at all.
|
1078
|
+
*
|
1079
|
+
* By default, the window is an hour.
|
1080
|
+
*/
|
1081
|
+
signatureTimeWindow?: Temporal.Duration | Temporal.DurationLike | false;
|
1082
|
+
/**
|
1083
|
+
* Whether to skip HTTP Signatures verification for incoming activities.
|
1084
|
+
* This is useful for testing purposes, but should not be used in production.
|
1085
|
+
*
|
1086
|
+
* By default, this is `false` (i.e., signatures are verified).
|
1087
|
+
* @since 0.13.0
|
1088
|
+
*/
|
1089
|
+
skipSignatureVerification?: boolean;
|
1090
|
+
/**
|
1091
|
+
* The retry policy for sending activities to recipients' inboxes.
|
1092
|
+
* By default, this uses an exponential backoff strategy with a maximum of
|
1093
|
+
* 10 attempts and a maximum delay of 12 hours.
|
1094
|
+
* @since 0.12.0
|
1095
|
+
*/
|
1096
|
+
outboxRetryPolicy?: RetryPolicy;
|
1097
|
+
/**
|
1098
|
+
* The retry policy for processing incoming activities. By default, this
|
1099
|
+
* uses an exponential backoff strategy with a maximum of 10 attempts and a
|
1100
|
+
* maximum delay of 12 hours.
|
1101
|
+
* @since 0.12.0
|
1102
|
+
*/
|
1103
|
+
inboxRetryPolicy?: RetryPolicy;
|
1104
|
+
/**
|
1105
|
+
* Activity transformers that are applied to outgoing activities. It is
|
1106
|
+
* useful for adjusting outgoing activities to satisfy some ActivityPub
|
1107
|
+
* implementations.
|
1108
|
+
*
|
1109
|
+
* By default, {@link defaultActivityTransformers} are applied.
|
1110
|
+
* @since 1.4.0
|
1111
|
+
*/
|
1112
|
+
activityTransformers?: readonly ActivityTransformer<TContextData>[];
|
1113
|
+
/**
|
1114
|
+
* Whether the router should be insensitive to trailing slashes in the URL
|
1115
|
+
* paths. For example, if this option is `true`, `/foo` and `/foo/` are
|
1116
|
+
* treated as the same path. Turned off by default.
|
1117
|
+
* @since 0.12.0
|
1118
|
+
*/
|
1119
|
+
trailingSlashInsensitive?: boolean;
|
1120
|
+
/**
|
1121
|
+
* The OpenTelemetry tracer provider for tracing operations. If not provided,
|
1122
|
+
* the default global tracer provider is used.
|
1123
|
+
* @since 1.3.0
|
1124
|
+
*/
|
1125
|
+
tracerProvider?: TracerProvider;
|
1126
|
+
}
|
1127
|
+
/**
|
1128
|
+
* Additional settings for the actor dispatcher.
|
1129
|
+
*
|
1130
|
+
* ``` typescript
|
1131
|
+
* const federation = createFederation<void>({ ... });
|
1132
|
+
* federation
|
1133
|
+
* .setActorDispatcher("/users/{identifier}", async (ctx, identifier) => {
|
1134
|
+
* // ...
|
1135
|
+
* })
|
1136
|
+
* .setKeyPairsDispatcher(async (ctxData, identifier) => {
|
1137
|
+
* // ...
|
1138
|
+
* });
|
1139
|
+
* ```
|
1140
|
+
*/
|
1141
|
+
interface ActorCallbackSetters<TContextData> {
|
1142
|
+
/**
|
1143
|
+
* Sets the key pairs dispatcher for actors.
|
1144
|
+
* @param dispatcher A callback that returns the key pairs for an actor.
|
1145
|
+
* @returns The setters object so that settings can be chained.
|
1146
|
+
* @since 0.10.0
|
1147
|
+
*/
|
1148
|
+
setKeyPairsDispatcher(dispatcher: ActorKeyPairsDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
1149
|
+
/**
|
1150
|
+
* Sets the callback function that maps a WebFinger username to
|
1151
|
+
* the corresponding actor's identifier. If it's omitted, the identifier
|
1152
|
+
* is assumed to be the same as the WebFinger username, which makes your
|
1153
|
+
* actors have the immutable handles. If you want to let your actors change
|
1154
|
+
* their fediverse handles, you should set this dispatcher.
|
1155
|
+
* @param mapper A callback that maps a WebFinger username to
|
1156
|
+
* the corresponding actor's identifier.
|
1157
|
+
* @returns The setters object so that settings can be chained.
|
1158
|
+
* @since 0.15.0
|
1159
|
+
*/
|
1160
|
+
mapHandle(mapper: ActorHandleMapper<TContextData>): ActorCallbackSetters<TContextData>;
|
1161
|
+
/**
|
1162
|
+
* Sets the callback function that maps a WebFinger query to the corresponding
|
1163
|
+
* actor's identifier or username. If it's omitted, the WebFinger handler
|
1164
|
+
* only supports the actor URIs and `acct:` URIs. If you want to support
|
1165
|
+
* other queries, you should set this dispatcher.
|
1166
|
+
* @param mapper A callback that maps a WebFinger query to the corresponding
|
1167
|
+
* actor's identifier or username.
|
1168
|
+
* @returns The setters object so that settings can be chained.
|
1169
|
+
* @since 1.4.0
|
1170
|
+
*/
|
1171
|
+
mapAlias(mapper: ActorAliasMapper<TContextData>): ActorCallbackSetters<TContextData>;
|
1172
|
+
/**
|
1173
|
+
* Specifies the conditions under which requests are authorized.
|
1174
|
+
* @param predicate A callback that returns whether a request is authorized.
|
1175
|
+
* @returns The setters object so that settings can be chained.
|
1176
|
+
* @since 0.7.0
|
1177
|
+
*/
|
1178
|
+
authorize(predicate: AuthorizePredicate<TContextData>): ActorCallbackSetters<TContextData>;
|
1179
|
+
}
|
1180
|
+
/**
|
1181
|
+
* Additional settings for an object dispatcher.
|
1182
|
+
*/
|
1183
|
+
interface ObjectCallbackSetters<TContextData, TObject extends Object$1, TParam extends string> {
|
1184
|
+
/**
|
1185
|
+
* Specifies the conditions under which requests are authorized.
|
1186
|
+
* @param predicate A callback that returns whether a request is authorized.
|
1187
|
+
* @returns The setters object so that settings can be chained.
|
1188
|
+
* @since 0.7.0
|
1189
|
+
*/
|
1190
|
+
authorize(predicate: ObjectAuthorizePredicate<TContextData, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
|
1191
|
+
}
|
1192
|
+
/**
|
1193
|
+
* Additional settings for a collection dispatcher.
|
1194
|
+
*
|
1195
|
+
* @typeParam TContext The type of the context. {@link Context} or
|
1196
|
+
* {@link RequestContext}.
|
1197
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
1198
|
+
* @typeParam TFilter The type of filter for the collection.
|
1199
|
+
*/
|
1200
|
+
interface CollectionCallbackSetters<TContext extends Context<TContextData>, TContextData, TFilter> {
|
1201
|
+
/**
|
1202
|
+
* Sets the counter for the collection.
|
1203
|
+
* @param counter A callback that returns the number of items in the collection.
|
1204
|
+
* @returns The setters object so that settings can be chained.
|
1205
|
+
*/
|
1206
|
+
setCounter(counter: CollectionCounter<TContextData, TFilter>): CollectionCallbackSetters<TContext, TContextData, TFilter>;
|
1207
|
+
/**
|
1208
|
+
* Sets the first cursor for the collection.
|
1209
|
+
* @param cursor The cursor for the first item in the collection.
|
1210
|
+
* @returns The setters object so that settings can be chained.
|
1211
|
+
*/
|
1212
|
+
setFirstCursor(cursor: CollectionCursor<TContext, TContextData, TFilter>): CollectionCallbackSetters<TContext, TContextData, TFilter>;
|
1213
|
+
/**
|
1214
|
+
* Sets the last cursor for the collection.
|
1215
|
+
* @param cursor The cursor for the last item in the collection.
|
1216
|
+
* @returns The setters object so that settings can be chained.
|
1217
|
+
*/
|
1218
|
+
setLastCursor(cursor: CollectionCursor<TContext, TContextData, TFilter>): CollectionCallbackSetters<TContext, TContextData, TFilter>;
|
1219
|
+
/**
|
1220
|
+
* Specifies the conditions under which requests are authorized.
|
1221
|
+
* @param predicate A callback that returns whether a request is authorized.
|
1222
|
+
* @returns The setters object so that settings can be chained.
|
1223
|
+
* @since 0.7.0
|
1224
|
+
*/
|
1225
|
+
authorize(predicate: AuthorizePredicate<TContextData>): CollectionCallbackSetters<TContext, TContextData, TFilter>;
|
1226
|
+
}
|
1227
|
+
/**
|
1228
|
+
* Registry for inbox listeners for different activity types.
|
1229
|
+
*/
|
1230
|
+
interface InboxListenerSetters<TContextData> {
|
1231
|
+
/**
|
1232
|
+
* Registers a listener for a specific incoming activity type.
|
1233
|
+
*
|
1234
|
+
* @param type A subclass of {@link Activity} to listen to.
|
1235
|
+
* @param listener A callback to handle an incoming activity.
|
1236
|
+
* @returns The setters object so that settings can be chained.
|
1237
|
+
*/
|
1238
|
+
on<TActivity extends Activity>(type: new (...args: any[]) => TActivity, listener: InboxListener<TContextData, TActivity>): InboxListenerSetters<TContextData>;
|
1239
|
+
/**
|
1240
|
+
* Registers an error handler for inbox listeners. Any exceptions thrown
|
1241
|
+
* from the listeners are caught and passed to this handler.
|
1242
|
+
*
|
1243
|
+
* @param handler A callback to handle an error.
|
1244
|
+
* @returns The setters object so that settings can be chained.
|
1245
|
+
*/
|
1246
|
+
onError(handler: InboxErrorHandler<TContextData>): InboxListenerSetters<TContextData>;
|
1247
|
+
/**
|
1248
|
+
* Configures a callback to dispatch the key pair for the authenticated
|
1249
|
+
* document loader of the {@link Context} passed to the shared inbox listener.
|
1250
|
+
*
|
1251
|
+
* @param dispatcher A callback to dispatch the key pair for the authenticated
|
1252
|
+
* document loader.
|
1253
|
+
* @returns The setters object so that settings can be chained.
|
1254
|
+
* @since 0.11.0
|
1255
|
+
*/
|
1256
|
+
setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData>): InboxListenerSetters<TContextData>;
|
1257
|
+
}
|
1258
|
+
/**
|
1259
|
+
* Parameters of {@link Federation.fetch} method.
|
1260
|
+
*
|
1261
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
1262
|
+
* @since 0.6.0
|
1263
|
+
*/
|
1264
|
+
interface FederationFetchOptions<TContextData> {
|
1265
|
+
/**
|
1266
|
+
* The context data to pass to the {@link Context}.
|
1267
|
+
*/
|
1268
|
+
contextData: TContextData;
|
1269
|
+
/**
|
1270
|
+
* A callback to handle a request when the route is not found.
|
1271
|
+
* If not provided, a 404 response is returned.
|
1272
|
+
* @param request The request object.
|
1273
|
+
* @returns The response to the request.
|
1274
|
+
*/
|
1275
|
+
onNotFound?: (request: Request) => Response | Promise<Response>;
|
1276
|
+
/**
|
1277
|
+
* A callback to handle a request when the request's `Accept` header is not
|
1278
|
+
* acceptable. If not provided, a 406 response is returned.
|
1279
|
+
* @param request The request object.
|
1280
|
+
* @returns The response to the request.
|
1281
|
+
*/
|
1282
|
+
onNotAcceptable?: (request: Request) => Response | Promise<Response>;
|
1283
|
+
/**
|
1284
|
+
* A callback to handle a request when the request is unauthorized.
|
1285
|
+
* If not provided, a 401 response is returned.
|
1286
|
+
* @param request The request object.
|
1287
|
+
* @returns The response to the request.
|
1288
|
+
* @since 0.7.0
|
1289
|
+
*/
|
1290
|
+
onUnauthorized?: (request: Request) => Response | Promise<Response>;
|
1291
|
+
}
|
1292
|
+
|
1293
|
+
//#endregion
|
1294
|
+
//#region federation/context.d.ts
|
1295
|
+
/**
|
1296
|
+
* A context.
|
1297
|
+
*/
|
1298
|
+
interface Context<TContextData> {
|
1299
|
+
/**
|
1300
|
+
* The origin of the federated server, including the scheme (`http://` or
|
1301
|
+
* `https://`) and the host (e.g., `example.com:8080`).
|
1302
|
+
* @since 0.12.0
|
1303
|
+
*/
|
1304
|
+
readonly origin: string;
|
1305
|
+
/**
|
1306
|
+
* The canonical origin of the federated server, including the scheme
|
1307
|
+
* (`http://` or `https://`) and the host (e.g., `example.com:8080`).
|
1308
|
+
*
|
1309
|
+
* When the associated {@link Federation} object does not have any explicit
|
1310
|
+
* canonical origin, it is the same as the {@link Context.origin}.
|
1311
|
+
* @since 1.5.0
|
1312
|
+
*/
|
1313
|
+
readonly canonicalOrigin: string;
|
1314
|
+
/**
|
1315
|
+
* The host of the federated server, including the hostname
|
1316
|
+
* (e.g., `example.com`) and the port following a colon (e.g., `:8080`)
|
1317
|
+
* if it is not the default port for the scheme.
|
1318
|
+
* @since 0.12.0
|
1319
|
+
*/
|
1320
|
+
readonly host: string;
|
1321
|
+
/**
|
1322
|
+
* The hostname of the federated server (e.g., `example.com`). This is
|
1323
|
+
* the same as the host without the port.
|
1324
|
+
* @since 0.12.0
|
1325
|
+
*/
|
1326
|
+
readonly hostname: string;
|
1327
|
+
/**
|
1328
|
+
* The user-defined data associated with the context.
|
1329
|
+
*/
|
1330
|
+
readonly data: TContextData;
|
1331
|
+
/**
|
1332
|
+
* The OpenTelemetry tracer provider.
|
1333
|
+
* @since 1.3.0
|
1334
|
+
*/
|
1335
|
+
readonly tracerProvider: TracerProvider;
|
1336
|
+
/**
|
1337
|
+
* The document loader for loading remote JSON-LD documents.
|
1338
|
+
*/
|
1339
|
+
readonly documentLoader: DocumentLoader;
|
1340
|
+
/**
|
1341
|
+
* The context loader for loading remote JSON-LD contexts.
|
1342
|
+
*/
|
1343
|
+
readonly contextLoader: DocumentLoader;
|
1344
|
+
/**
|
1345
|
+
* The federation object that this context belongs to.
|
1346
|
+
* @since 1.6.0
|
1347
|
+
*/
|
1348
|
+
readonly federation: Federation<TContextData>;
|
1349
|
+
/**
|
1350
|
+
* Creates a new context with the same properties as this one,
|
1351
|
+
* but with the given data.
|
1352
|
+
* @param data The new data to associate with the context.
|
1353
|
+
* @returns A new context with the same properties as this one,
|
1354
|
+
* but with the given data.
|
1355
|
+
* @since 1.6.0
|
1356
|
+
*/
|
1357
|
+
clone(data: TContextData): Context<TContextData>;
|
1358
|
+
/**
|
1359
|
+
* Builds the URI of the NodeInfo document.
|
1360
|
+
* @returns The NodeInfo URI.
|
1361
|
+
* @throws {RouterError} If no NodeInfo dispatcher is available.
|
1362
|
+
* @since 0.2.0
|
1363
|
+
*/
|
1364
|
+
getNodeInfoUri(): URL;
|
1365
|
+
/**
|
1366
|
+
* Builds the URI of an actor with the given identifier.
|
1367
|
+
* @param identifier The actor's identifier.
|
1368
|
+
* @returns The actor's URI.
|
1369
|
+
* @throws {RouterError} If no actor dispatcher is available.
|
1370
|
+
*/
|
1371
|
+
getActorUri(identifier: string): URL;
|
1372
|
+
/**
|
1373
|
+
* Builds the URI of an object with the given class and values.
|
1374
|
+
* @param cls The class of the object.
|
1375
|
+
* @param values The values to pass to the object dispatcher.
|
1376
|
+
* @returns The object's URI.
|
1377
|
+
* @throws {RouteError} If no object dispatcher is available for the class.
|
1378
|
+
* @throws {TypeError} If values are invalid.
|
1379
|
+
* @since 0.7.0
|
1380
|
+
*/
|
1381
|
+
getObjectUri<TObject extends Object$1>(cls: (new (...args: any[]) => TObject) & {
|
1382
|
+
typeId: URL;
|
1383
|
+
}, values: Record<string, string>): URL;
|
1384
|
+
/**
|
1385
|
+
* Builds the URI of an actor's outbox with the given identifier.
|
1386
|
+
* @param identifier The actor's identifier.
|
1387
|
+
* @returns The actor's outbox URI.
|
1388
|
+
* @throws {RouterError} If no outbox dispatcher is available.
|
1389
|
+
*/
|
1390
|
+
getOutboxUri(identifier: string): URL;
|
1391
|
+
/**
|
1392
|
+
* Builds the URI of the shared inbox.
|
1393
|
+
* @returns The shared inbox URI.
|
1394
|
+
* @throws {RouterError} If no inbox listener is available.
|
1395
|
+
*/
|
1396
|
+
getInboxUri(): URL;
|
1397
|
+
/**
|
1398
|
+
* Builds the URI of an actor's inbox with the given identifier.
|
1399
|
+
* @param identifier The actor's identifier.
|
1400
|
+
* @returns The actor's inbox URI.
|
1401
|
+
* @throws {RouterError} If no inbox listener is available.
|
1402
|
+
*/
|
1403
|
+
getInboxUri(identifier: string): URL;
|
1404
|
+
/**
|
1405
|
+
* Builds the URI of an actor's following collection with the given
|
1406
|
+
* identifier.
|
1407
|
+
* @param identifier The actor's identifier.
|
1408
|
+
* @returns The actor's following collection URI.
|
1409
|
+
* @throws {RouterError} If no following collection is available.
|
1410
|
+
*/
|
1411
|
+
getFollowingUri(identifier: string): URL;
|
1412
|
+
/**
|
1413
|
+
* Builds the URI of an actor's followers collection with the given
|
1414
|
+
* identifier.
|
1415
|
+
* @param identifier The actor's identifier.
|
1416
|
+
* @returns The actor's followers collection URI.
|
1417
|
+
* @throws {RouterError} If no followers collection is available.
|
1418
|
+
*/
|
1419
|
+
getFollowersUri(identifier: string): URL;
|
1420
|
+
/**
|
1421
|
+
* Builds the URI of an actor's liked collection with the given identifier.
|
1422
|
+
* @param identifier The actor's identifier.
|
1423
|
+
* @returns The actor's liked collection URI.
|
1424
|
+
* @throws {RouterError} If no liked collection is available.
|
1425
|
+
* @since 0.11.0
|
1426
|
+
*/
|
1427
|
+
getLikedUri(identifier: string): URL;
|
1428
|
+
/**
|
1429
|
+
* Builds the URI of an actor's featured collection with the given identifier.
|
1430
|
+
* @param identifier The actor's identifier.
|
1431
|
+
* @returns The actor's featured collection URI.
|
1432
|
+
* @throws {RouterError} If no featured collection is available.
|
1433
|
+
* @since 0.11.0
|
1434
|
+
*/
|
1435
|
+
getFeaturedUri(identifier: string): URL;
|
1436
|
+
/**
|
1437
|
+
* Builds the URI of an actor's featured tags collection with the given
|
1438
|
+
* identifier.
|
1439
|
+
* @param identifier The actor's identifier.
|
1440
|
+
* @returns The actor's featured tags collection URI.
|
1441
|
+
* @throws {RouterError} If no featured tags collection is available.
|
1442
|
+
* @since 0.11.0
|
1443
|
+
*/
|
1444
|
+
getFeaturedTagsUri(identifier: string): URL;
|
1445
|
+
/**
|
1446
|
+
* Determines the type of the URI and extracts the associated data.
|
1447
|
+
* @param uri The URI to parse.
|
1448
|
+
* @returns The result of parsing the URI. If `null` is given or
|
1449
|
+
* the URI is not recognized, `null` is returned.
|
1450
|
+
* @since 0.9.0
|
1451
|
+
*/
|
1452
|
+
parseUri(uri: URL | null): ParseUriResult | null;
|
1453
|
+
/**
|
1454
|
+
* Gets the key pairs for an actor.
|
1455
|
+
* @param identifier The actor's identifier.
|
1456
|
+
* @returns An async iterable of the actor's key pairs. It can be empty.
|
1457
|
+
* @since 0.10.0
|
1458
|
+
*/
|
1459
|
+
getActorKeyPairs(identifier: string): Promise<ActorKeyPair[]>;
|
1460
|
+
/**
|
1461
|
+
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
1462
|
+
* Note that an authenticated document loader intentionally does not cache
|
1463
|
+
* the fetched documents.
|
1464
|
+
* @param identity The identity to get the document loader for.
|
1465
|
+
* The actor's identifier or username.
|
1466
|
+
* @returns The authenticated document loader.
|
1467
|
+
* @throws {Error} If the identity is not valid.
|
1468
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
1469
|
+
* @since 0.4.0
|
1470
|
+
*/
|
1471
|
+
getDocumentLoader(identity: {
|
1472
|
+
identifier: string;
|
1473
|
+
} | {
|
1474
|
+
username: string;
|
1475
|
+
} | {
|
1476
|
+
handle: string;
|
1477
|
+
}): Promise<DocumentLoader>;
|
1478
|
+
/**
|
1479
|
+
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
1480
|
+
* Note that an authenticated document loader intentionally does not cache
|
1481
|
+
* the fetched documents.
|
1482
|
+
* @param identity The identity to get the document loader for.
|
1483
|
+
* The actor's key pair.
|
1484
|
+
* @returns The authenticated document loader.
|
1485
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
1486
|
+
* @since 0.4.0
|
1487
|
+
*/
|
1488
|
+
getDocumentLoader(identity: {
|
1489
|
+
keyId: URL;
|
1490
|
+
privateKey: CryptoKey;
|
1491
|
+
}): DocumentLoader;
|
1492
|
+
/**
|
1493
|
+
* Looks up an ActivityStreams object by its URI (including `acct:` URIs)
|
1494
|
+
* or a fediverse handle (e.g., `@user@server` or `user@server`).
|
1495
|
+
*
|
1496
|
+
* @example
|
1497
|
+
* ``` typescript
|
1498
|
+
* // Look up an actor by its fediverse handle:
|
1499
|
+
* await ctx.lookupObject("@hongminhee@fosstodon.org");
|
1500
|
+
* // returning a `Person` object.
|
1501
|
+
*
|
1502
|
+
* // A fediverse handle can omit the leading '@':
|
1503
|
+
* await ctx.lookupObject("hongminhee@fosstodon.org");
|
1504
|
+
* // returning a `Person` object.
|
1505
|
+
*
|
1506
|
+
* // A `acct:` URI can be used as well:
|
1507
|
+
* await ctx.lookupObject("acct:hongminhee@fosstodon.org");
|
1508
|
+
* // returning a `Person` object.
|
1509
|
+
*
|
1510
|
+
* // Look up an object by its URI:
|
1511
|
+
* await ctx.lookupObject("https://todon.eu/@hongminhee/112060633798771581");
|
1512
|
+
* // returning a `Note` object.
|
1513
|
+
*
|
1514
|
+
* // It can be a `URL` object as well:
|
1515
|
+
* await ctx.lookupObject(
|
1516
|
+
* new URL("https://todon.eu/@hongminhee/112060633798771581")
|
1517
|
+
* );
|
1518
|
+
* // returning a `Note` object.
|
1519
|
+
* ```
|
1520
|
+
*
|
1521
|
+
* It's almost the same as the {@link lookupObject} function, but it uses
|
1522
|
+
* the context's document loader and context loader by default.
|
1523
|
+
*
|
1524
|
+
* @param identifier The URI or fediverse handle to look up.
|
1525
|
+
* @param options Lookup options.
|
1526
|
+
* @returns The object, or `null` if not found.
|
1527
|
+
* @since 0.15.0
|
1528
|
+
*/
|
1529
|
+
lookupObject(identifier: string | URL, options?: LookupObjectOptions): Promise<Object$1 | null>;
|
1530
|
+
/**
|
1531
|
+
* Traverses a collection, yielding each item in the collection.
|
1532
|
+
* If the collection is paginated, it will fetch the next page
|
1533
|
+
* automatically.
|
1534
|
+
*
|
1535
|
+
* @example
|
1536
|
+
* ``` typescript
|
1537
|
+
* const collection = await ctx.lookupObject(collectionUrl);
|
1538
|
+
* if (collection instanceof Collection) {
|
1539
|
+
* for await (const item of ctx.traverseCollection(collection)) {
|
1540
|
+
* console.log(item.id?.href);
|
1541
|
+
* }
|
1542
|
+
* }
|
1543
|
+
* ```
|
1544
|
+
*
|
1545
|
+
* It's almost the same as the {@link traverseCollection} function, but it
|
1546
|
+
* uses the context's document loader and context loader by default.
|
1547
|
+
* @param collection The collection to traverse.
|
1548
|
+
* @param options Options for traversing the collection.
|
1549
|
+
* @returns An async iterable of each item in the collection.
|
1550
|
+
* @since 1.1.0
|
1551
|
+
*/
|
1552
|
+
traverseCollection(collection: Collection, options?: TraverseCollectionOptions): AsyncIterable<Object$1 | Link>;
|
1553
|
+
/**
|
1554
|
+
* Fetches the NodeInfo document from the given URL.
|
1555
|
+
* @param url The base URL of the server. If `options.direct` is turned off
|
1556
|
+
* (default), the NodeInfo document will be fetched from
|
1557
|
+
* the `.well-known` location of this URL (hence the only origin
|
1558
|
+
* of the URL is used). If `options.direct` is turned on,
|
1559
|
+
* the NodeInfo document will be fetched from the given URL.
|
1560
|
+
* @param options Options for fetching the NodeInfo document.
|
1561
|
+
* @returns The NodeInfo document if it could be fetched successfully.
|
1562
|
+
* Otherwise, `undefined` is returned.
|
1563
|
+
* @since 1.4.0
|
1564
|
+
*/
|
1565
|
+
lookupNodeInfo(url: URL | string, options?: GetNodeInfoOptions & {
|
1566
|
+
parse?: "strict" | "best-effort";
|
1567
|
+
}): Promise<NodeInfo | undefined>;
|
1568
|
+
/**
|
1569
|
+
* Fetches the NodeInfo document from the given URL.
|
1570
|
+
* @param url The base URL of the server. If `options.direct` is turned off
|
1571
|
+
* (default), the NodeInfo document will be fetched from
|
1572
|
+
* the `.well-known` location of this URL (hence the only origin
|
1573
|
+
* of the URL is used). If `options.direct` is turned on,
|
1574
|
+
* the NodeInfo document will be fetched from the given URL.
|
1575
|
+
* @param options Options for fetching the NodeInfo document.
|
1576
|
+
* @returns The NodeInfo document if it could be fetched successfully.
|
1577
|
+
* Otherwise, `undefined` is returned.
|
1578
|
+
* @since 1.4.0
|
1579
|
+
*/
|
1580
|
+
lookupNodeInfo(url: URL | string, options?: GetNodeInfoOptions & {
|
1581
|
+
parse: "none";
|
1582
|
+
}): Promise<JsonValue | undefined>;
|
1583
|
+
/**
|
1584
|
+
* Looks up a WebFinger resource.
|
1585
|
+
*
|
1586
|
+
* It's almost the same as the {@link lookupWebFinger} function, but it uses
|
1587
|
+
* the context's configuration by default.
|
1588
|
+
*
|
1589
|
+
* @param resource The resource URL to look up.
|
1590
|
+
* @param options Extra options for looking up the resource.
|
1591
|
+
* @returns The resource descriptor, or `null` if not found.
|
1592
|
+
* @since 1.6.0
|
1593
|
+
*/
|
1594
|
+
lookupWebFinger(resource: URL | string, options?: LookupWebFingerOptions): Promise<ResourceDescriptor | null>;
|
1595
|
+
/**
|
1596
|
+
* Sends an activity to recipients' inboxes.
|
1597
|
+
* @param sender The sender's identifier or the sender's username or
|
1598
|
+
* the sender's key pair(s).
|
1599
|
+
* @param recipients The recipients of the activity.
|
1600
|
+
* @param activity The activity to send.
|
1601
|
+
* @param options Options for sending the activity.
|
1602
|
+
*/
|
1603
|
+
sendActivity(sender: SenderKeyPair | SenderKeyPair[] | {
|
1604
|
+
identifier: string;
|
1605
|
+
} | {
|
1606
|
+
username: string;
|
1607
|
+
} | {
|
1608
|
+
handle: string;
|
1609
|
+
}, recipients: Recipient | Recipient[], activity: Activity, options?: SendActivityOptions): Promise<void>;
|
1610
|
+
/**
|
1611
|
+
* Sends an activity to the outboxes of the sender's followers.
|
1612
|
+
* @param sender The sender's identifier or the sender's username.
|
1613
|
+
* @param recipients In this case, it must be `"followers"`.
|
1614
|
+
* @param activity The activity to send.
|
1615
|
+
* @param options Options for sending the activity.
|
1616
|
+
* @throws {Error} If no followers collection is registered.
|
1617
|
+
* @since 0.14.0
|
1618
|
+
*/
|
1619
|
+
sendActivity(sender: {
|
1620
|
+
identifier: string;
|
1621
|
+
} | {
|
1622
|
+
username: string;
|
1623
|
+
} | {
|
1624
|
+
handle: string;
|
1625
|
+
}, recipients: "followers", activity: Activity, options?: SendActivityOptionsForCollection): Promise<void>;
|
1626
|
+
/**
|
1627
|
+
* Manually routes an activity to the appropriate inbox listener.
|
1628
|
+
*
|
1629
|
+
* It is useful for routing an activity that is not received from the network,
|
1630
|
+
* or for routing an activity that is enclosed in another activity.
|
1631
|
+
*
|
1632
|
+
* Note that the activity will be verified if it has Object Integrity Proofs
|
1633
|
+
* or is equivalent to the actual remote object. If the activity is not
|
1634
|
+
* verified, it will be rejected.
|
1635
|
+
* @param recipient The recipient of the activity. If it is `null`,
|
1636
|
+
* the activity will be routed to the shared inbox.
|
1637
|
+
* Otherwise, the activity will be routed to the personal
|
1638
|
+
* inbox of the recipient with the given identifier.
|
1639
|
+
* @param activity The activity to route. It must have a proof or
|
1640
|
+
* a dereferenceable `id` to verify the activity.
|
1641
|
+
* @param options Options for routing the activity.
|
1642
|
+
* @returns `true` if the activity is successfully verified and routed.
|
1643
|
+
* Otherwise, `false`.
|
1644
|
+
* @since 1.3.0
|
1645
|
+
*/
|
1646
|
+
routeActivity(recipient: string | null, activity: Activity, options?: RouteActivityOptions): Promise<boolean>;
|
1647
|
+
}
|
1648
|
+
/**
|
1649
|
+
* A context for a request.
|
1650
|
+
*/
|
1651
|
+
interface RequestContext<TContextData> extends Context<TContextData> {
|
1652
|
+
/**
|
1653
|
+
* The request object.
|
1654
|
+
*/
|
1655
|
+
readonly request: Request;
|
1656
|
+
/**
|
1657
|
+
* The URL of the request.
|
1658
|
+
*/
|
1659
|
+
readonly url: URL;
|
1660
|
+
/**
|
1661
|
+
* Creates a new context with the same properties as this one,
|
1662
|
+
* but with the given data.
|
1663
|
+
* @param data The new data to associate with the context.
|
1664
|
+
* @returns A new context with the same properties as this one,
|
1665
|
+
* but with the given data.
|
1666
|
+
* @since 1.6.0
|
1667
|
+
*/
|
1668
|
+
clone(data: TContextData): RequestContext<TContextData>;
|
1669
|
+
/**
|
1670
|
+
* Gets an {@link Actor} object for the given identifier.
|
1671
|
+
* @param identifier The actor's identifier.
|
1672
|
+
* @returns The actor object, or `null` if the actor is not found.
|
1673
|
+
* @throws {Error} If no actor dispatcher is available.
|
1674
|
+
* @since 0.7.0
|
1675
|
+
*/
|
1676
|
+
getActor(identifier: string): Promise<Actor | null>;
|
1677
|
+
/**
|
1678
|
+
* Gets an object of the given class with the given values.
|
1679
|
+
* @param cls The class to instantiate.
|
1680
|
+
* @param values The values to pass to the object dispatcher.
|
1681
|
+
* @returns The object of the given class with the given values, or `null`
|
1682
|
+
* if the object is not found.
|
1683
|
+
* @throws {Error} If no object dispatcher is available for the class.
|
1684
|
+
* @throws {TypeError} If values are invalid.
|
1685
|
+
* @since 0.7.0
|
1686
|
+
*/
|
1687
|
+
getObject<TObject extends Object$1>(cls: (new (...args: any[]) => TObject) & {
|
1688
|
+
typeId: URL;
|
1689
|
+
}, values: Record<string, string>): Promise<TObject | null>;
|
1690
|
+
/**
|
1691
|
+
* Gets the public key of the sender, if any exists and it is verified.
|
1692
|
+
* Otherwise, `null` is returned.
|
1693
|
+
*
|
1694
|
+
* This can be used for implementing [authorized fetch] (also known as
|
1695
|
+
* secure mode) in ActivityPub.
|
1696
|
+
*
|
1697
|
+
* [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch
|
1698
|
+
*
|
1699
|
+
* @returns The public key of the sender, or `null` if the sender is not verified.
|
1700
|
+
* @since 0.7.0
|
1701
|
+
*/
|
1702
|
+
getSignedKey(): Promise<CryptographicKey | null>;
|
1703
|
+
/**
|
1704
|
+
* Gets the public key of the sender, if any exists and it is verified.
|
1705
|
+
* Otherwise, `null` is returned.
|
1706
|
+
*
|
1707
|
+
* This can be used for implementing [authorized fetch] (also known as
|
1708
|
+
* secure mode) in ActivityPub.
|
1709
|
+
*
|
1710
|
+
* [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch
|
1711
|
+
*
|
1712
|
+
* @param options Options for getting the signed key. You usually may want to
|
1713
|
+
* specify the custom `documentLoader` so that making
|
1714
|
+
* an HTTP request to the sender's server is signed with
|
1715
|
+
* your [instance actor].
|
1716
|
+
* @returns The public key of the sender, or `null` if the sender is not verified.
|
1717
|
+
* @since 1.5.0
|
1718
|
+
*
|
1719
|
+
* [instance actor]: https://swicg.github.io/activitypub-http-signature/#instance-actor
|
1720
|
+
*/
|
1721
|
+
getSignedKey(options: GetSignedKeyOptions): Promise<CryptographicKey | null>;
|
1722
|
+
/**
|
1723
|
+
* Gets the owner of the signed key, if any exists and it is verified.
|
1724
|
+
* Otherwise, `null` is returned.
|
1725
|
+
*
|
1726
|
+
* This can be used for implementing [authorized fetch] (also known as
|
1727
|
+
* secure mode) in ActivityPub.
|
1728
|
+
*
|
1729
|
+
* [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch
|
1730
|
+
*
|
1731
|
+
* @returns The owner of the signed key, or `null` if the key is not verified
|
1732
|
+
* or the owner is not found.
|
1733
|
+
* @since 0.7.0
|
1734
|
+
*/
|
1735
|
+
getSignedKeyOwner(): Promise<Actor | null>;
|
1736
|
+
/**
|
1737
|
+
* Gets the owner of the signed key, if any exists and it is verified.
|
1738
|
+
* Otherwise, `null` is returned.
|
1739
|
+
*
|
1740
|
+
* This can be used for implementing [authorized fetch] (also known as
|
1741
|
+
* secure mode) in ActivityPub.
|
1742
|
+
*
|
1743
|
+
* [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch
|
1744
|
+
*
|
1745
|
+
* @param options Options for getting the key owner. You usually may want to
|
1746
|
+
* specify the custom `documentLoader` so that making
|
1747
|
+
* an HTTP request to the key owner's server is signed with
|
1748
|
+
* your [instance actor].
|
1749
|
+
* @returns The owner of the signed key, or `null` if the key is not verified
|
1750
|
+
* or the owner is not found.
|
1751
|
+
* @since 1.5.0
|
1752
|
+
*
|
1753
|
+
* [instance actor]: https://swicg.github.io/activitypub-http-signature/#instance-actor
|
1754
|
+
*/
|
1755
|
+
getSignedKeyOwner(options: GetKeyOwnerOptions): Promise<Actor | null>;
|
1756
|
+
}
|
1757
|
+
/**
|
1758
|
+
* A context for inbox listeners.
|
1759
|
+
* @since 1.0.0
|
1760
|
+
*/
|
1761
|
+
interface InboxContext<TContextData> extends Context<TContextData> {
|
1762
|
+
/**
|
1763
|
+
* The identifier of the recipient of the inbox. If the inbox is a shared
|
1764
|
+
* inbox, it is `null`.
|
1765
|
+
* @since 1.2.0
|
1766
|
+
*/
|
1767
|
+
recipient: string | null;
|
1768
|
+
/**
|
1769
|
+
* Creates a new context with the same properties as this one,
|
1770
|
+
* but with the given data.
|
1771
|
+
* @param data The new data to associate with the context.
|
1772
|
+
* @returns A new context with the same properties as this one,
|
1773
|
+
* but with the given data.
|
1774
|
+
* @since 1.6.0
|
1775
|
+
*/
|
1776
|
+
clone(data: TContextData): InboxContext<TContextData>;
|
1777
|
+
/**
|
1778
|
+
* Forwards a received activity to the recipients' inboxes. The forwarded
|
1779
|
+
* activity will be signed in HTTP Signatures by the forwarder, but its
|
1780
|
+
* payload will not be modified, i.e., Linked Data Signatures and Object
|
1781
|
+
* Integrity Proofs will not be added. Therefore, if the activity is not
|
1782
|
+
* signed (i.e., it has neither Linked Data Signatures nor Object Integrity
|
1783
|
+
* Proofs), the recipient probably will not trust the activity.
|
1784
|
+
* @param forwarder The forwarder's identifier or the forwarder's username
|
1785
|
+
* or the forwarder's key pair(s).
|
1786
|
+
* @param recipients The recipients of the activity.
|
1787
|
+
* @param options Options for forwarding the activity.
|
1788
|
+
* @since 1.0.0
|
1789
|
+
*/
|
1790
|
+
forwardActivity(forwarder: SenderKeyPair | SenderKeyPair[] | {
|
1791
|
+
identifier: string;
|
1792
|
+
} | {
|
1793
|
+
username: string;
|
1794
|
+
} | {
|
1795
|
+
handle: string;
|
1796
|
+
}, recipients: Recipient | Recipient[], options?: ForwardActivityOptions): Promise<void>;
|
1797
|
+
/**
|
1798
|
+
* Forwards a received activity to the recipients' inboxes. The forwarded
|
1799
|
+
* activity will be signed in HTTP Signatures by the forwarder, but its
|
1800
|
+
* payload will not be modified, i.e., Linked Data Signatures and Object
|
1801
|
+
* Integrity Proofs will not be added. Therefore, if the activity is not
|
1802
|
+
* signed (i.e., it has neither Linked Data Signatures nor Object Integrity
|
1803
|
+
* Proofs), the recipient probably will not trust the activity.
|
1804
|
+
* @param forwarder The forwarder's identifier or the forwarder's username.
|
1805
|
+
* @param recipients In this case, it must be `"followers"`.
|
1806
|
+
* @param options Options for forwarding the activity.
|
1807
|
+
* @since 1.0.0
|
1808
|
+
*/
|
1809
|
+
forwardActivity(forwarder: {
|
1810
|
+
identifier: string;
|
1811
|
+
} | {
|
1812
|
+
username: string;
|
1813
|
+
} | {
|
1814
|
+
handle: string;
|
1815
|
+
}, recipients: "followers", options?: ForwardActivityOptions): Promise<void>;
|
1816
|
+
}
|
1817
|
+
/**
|
1818
|
+
* A result of parsing an URI.
|
1819
|
+
*/
|
1820
|
+
type ParseUriResult =
|
1821
|
+
/**
|
1822
|
+
* The case of an actor URI.
|
1823
|
+
*/
|
1824
|
+
{
|
1825
|
+
readonly type: "actor";
|
1826
|
+
readonly identifier: string;
|
1827
|
+
readonly handle: string;
|
1828
|
+
}
|
1829
|
+
/**
|
1830
|
+
* The case of an object URI.
|
1831
|
+
*/ | {
|
1832
|
+
readonly type: "object";
|
1833
|
+
readonly class: (new (...args: any[]) => Object$1) & {
|
1834
|
+
typeId: URL;
|
1835
|
+
};
|
1836
|
+
readonly typeId: URL;
|
1837
|
+
readonly values: Record<string, string>;
|
1838
|
+
}
|
1839
|
+
/**
|
1840
|
+
* The case of an shared inbox URI.
|
1841
|
+
*/ | {
|
1842
|
+
readonly type: "inbox";
|
1843
|
+
readonly identifier: undefined;
|
1844
|
+
readonly handle: undefined;
|
1845
|
+
}
|
1846
|
+
/**
|
1847
|
+
* The case of an personal inbox URI.
|
1848
|
+
*/ | {
|
1849
|
+
readonly type: "inbox";
|
1850
|
+
readonly identifier: string;
|
1851
|
+
readonly handle: string;
|
1852
|
+
}
|
1853
|
+
/**
|
1854
|
+
* The case of an outbox collection URI.
|
1855
|
+
*/ | {
|
1856
|
+
readonly type: "outbox";
|
1857
|
+
readonly identifier: string;
|
1858
|
+
readonly handle: string;
|
1859
|
+
}
|
1860
|
+
/**
|
1861
|
+
* The case of a following collection URI.
|
1862
|
+
*/ | {
|
1863
|
+
readonly type: "following";
|
1864
|
+
readonly identifier: string;
|
1865
|
+
readonly handle: string;
|
1866
|
+
}
|
1867
|
+
/**
|
1868
|
+
* The case of a followers collection URI.
|
1869
|
+
*/ | {
|
1870
|
+
readonly type: "followers";
|
1871
|
+
readonly identifier: string;
|
1872
|
+
readonly handle: string;
|
1873
|
+
}
|
1874
|
+
/**
|
1875
|
+
* The case of a liked collection URI.
|
1876
|
+
* @since 0.11.0
|
1877
|
+
*/ | {
|
1878
|
+
readonly type: "liked";
|
1879
|
+
readonly identifier: string;
|
1880
|
+
readonly handle: string;
|
1881
|
+
}
|
1882
|
+
/**
|
1883
|
+
* The case of a featured collection URI.
|
1884
|
+
* @since 0.11.0
|
1885
|
+
*/ | {
|
1886
|
+
readonly type: "featured";
|
1887
|
+
readonly identifier: string;
|
1888
|
+
readonly handle: string;
|
1889
|
+
}
|
1890
|
+
/**
|
1891
|
+
* The case of a featured tags collection URI.
|
1892
|
+
* @since 0.11.0
|
1893
|
+
*/ | {
|
1894
|
+
readonly type: "featuredTags";
|
1895
|
+
readonly identifier: string;
|
1896
|
+
readonly handle: string;
|
1897
|
+
};
|
1898
|
+
/**
|
1899
|
+
* Options for {@link Context.sendActivity} method.
|
1900
|
+
*/
|
1901
|
+
interface SendActivityOptions {
|
1902
|
+
/**
|
1903
|
+
* Whether to prefer the shared inbox for the recipients.
|
1904
|
+
*/
|
1905
|
+
preferSharedInbox?: boolean;
|
1906
|
+
/**
|
1907
|
+
* Whether to send the activity immediately, without enqueuing it.
|
1908
|
+
* If `true`, the activity will be sent immediately and the retrial
|
1909
|
+
* policy will not be applied.
|
1910
|
+
*
|
1911
|
+
* @since 0.3.0
|
1912
|
+
*/
|
1913
|
+
immediate?: boolean;
|
1914
|
+
/**
|
1915
|
+
* Determines how activities are queued when sent to multiple recipients.
|
1916
|
+
*
|
1917
|
+
* - "auto" (default): Automatically chooses optimal strategy based on
|
1918
|
+
* recipient count.
|
1919
|
+
* - "skip": Always enqueues individual messages per recipient,
|
1920
|
+
* bypassing the fanout queue. Use when payload needs to vary per recipient.
|
1921
|
+
* - "force": Always uses fanout queue regardless of recipient count.
|
1922
|
+
* Useful for testing or special cases.
|
1923
|
+
*
|
1924
|
+
* This option is ignored when `immediate: true` is specified, as immediate
|
1925
|
+
* delivery bypasses all queuing mechanisms.
|
1926
|
+
*
|
1927
|
+
* @default `"auto"`
|
1928
|
+
* @since 1.5.0
|
1929
|
+
*/
|
1930
|
+
fanout?: "auto" | "skip" | "force";
|
1931
|
+
/**
|
1932
|
+
* The base URIs to exclude from the recipients' inboxes. It is useful
|
1933
|
+
* for excluding the recipients having the same shared inbox with the sender.
|
1934
|
+
*
|
1935
|
+
* Note that the only `origin` parts of the `URL`s are compared.
|
1936
|
+
*
|
1937
|
+
* @since 0.9.0
|
1938
|
+
*/
|
1939
|
+
excludeBaseUris?: URL[];
|
1940
|
+
}
|
1941
|
+
/**
|
1942
|
+
* Options for {@link Context.sendActivity} method when sending to a collection.
|
1943
|
+
* @since 1.5.0
|
1944
|
+
*/
|
1945
|
+
interface SendActivityOptionsForCollection extends SendActivityOptions {
|
1946
|
+
/**
|
1947
|
+
* Whether to synchronize the collection using `Collection-Synchronization`
|
1948
|
+
* header ([FEP-8fcf]).
|
1949
|
+
*
|
1950
|
+
* [FEP-8fcf]: https://w3id.org/fep/8fcf
|
1951
|
+
*/
|
1952
|
+
syncCollection?: boolean;
|
1953
|
+
}
|
1954
|
+
/**
|
1955
|
+
* Options for {@link InboxContext.forwardActivity} method.
|
1956
|
+
* @since 1.0.0
|
1957
|
+
*/
|
1958
|
+
type ForwardActivityOptions = Omit<SendActivityOptions, "fanout"> & {
|
1959
|
+
/**
|
1960
|
+
* Whether to skip forwarding the activity if it is not signed, i.e., it has
|
1961
|
+
* neither Linked Data Signatures nor Object Integrity Proofs.
|
1962
|
+
*
|
1963
|
+
* If the activity is not signed, the recipient probably will not trust the
|
1964
|
+
* activity. Therefore, it is recommended to skip forwarding the activity
|
1965
|
+
* if it is not signed.
|
1966
|
+
*/
|
1967
|
+
skipIfUnsigned: boolean;
|
1968
|
+
};
|
1969
|
+
/**
|
1970
|
+
* Options for {@link Context.routeActivity} method.
|
1971
|
+
* @since 1.3.0
|
1972
|
+
*/
|
1973
|
+
interface RouteActivityOptions {
|
1974
|
+
/**
|
1975
|
+
* Whether to skip enqueuing the activity and invoke the listener immediately.
|
1976
|
+
* If no inbox queue is available, this option is ignored and the activity
|
1977
|
+
* will be always invoked immediately.
|
1978
|
+
* @default false
|
1979
|
+
*/
|
1980
|
+
immediate?: boolean;
|
1981
|
+
/**
|
1982
|
+
* The document loader for loading remote JSON-LD documents.
|
1983
|
+
*/
|
1984
|
+
documentLoader?: DocumentLoader;
|
1985
|
+
/**
|
1986
|
+
* The context loader for loading remote JSON-LD contexts.
|
1987
|
+
*/
|
1988
|
+
contextLoader?: DocumentLoader;
|
1989
|
+
/**
|
1990
|
+
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
1991
|
+
* is used.
|
1992
|
+
*/
|
1993
|
+
tracerProvider?: TracerProvider;
|
1994
|
+
}
|
1995
|
+
/**
|
1996
|
+
* Options for {@link Context.getSignedKey} method.
|
1997
|
+
* @since 1.5.0
|
1998
|
+
*/
|
1999
|
+
interface GetSignedKeyOptions {
|
2000
|
+
/**
|
2001
|
+
* The document loader for loading remote JSON-LD documents.
|
2002
|
+
*/
|
2003
|
+
documentLoader?: DocumentLoader;
|
2004
|
+
/**
|
2005
|
+
* The context loader for loading remote JSON-LD contexts.
|
2006
|
+
*/
|
2007
|
+
contextLoader?: DocumentLoader;
|
2008
|
+
/**
|
2009
|
+
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
2010
|
+
* is used.
|
2011
|
+
*/
|
2012
|
+
tracerProvider?: TracerProvider;
|
2013
|
+
}
|
2014
|
+
/**
|
2015
|
+
* A pair of a public key and a private key in various formats.
|
2016
|
+
* @since 0.10.0
|
2017
|
+
*/
|
2018
|
+
interface ActorKeyPair extends CryptoKeyPair {
|
2019
|
+
/**
|
2020
|
+
* The URI of the public key, which is used for verifying HTTP Signatures.
|
2021
|
+
*/
|
2022
|
+
keyId: URL;
|
2023
|
+
/**
|
2024
|
+
* A {@link CryptographicKey} instance of the public key.
|
2025
|
+
*/
|
2026
|
+
cryptographicKey: CryptographicKey;
|
2027
|
+
/**
|
2028
|
+
* A {@link Multikey} instance of the public key.
|
2029
|
+
*/
|
2030
|
+
multikey: Multikey;
|
2031
|
+
}
|
2032
|
+
|
2033
|
+
//#endregion
|
2034
|
+
export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router as Router$1, RouterError as RouterError$1, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader as buildCollectionSynchronizationHeader$1, createExponentialBackoffPolicy as createExponentialBackoffPolicy$1, createFederation as createFederation$1, createFederationBuilder as createFederationBuilder$1, digest as digest$1, respondWithObject as respondWithObject$1, respondWithObjectIfAcceptable as respondWithObjectIfAcceptable$1 };
|