@fedify/fedify 1.10.0-dev.5 → 2.0.0-dev.12
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/README.md +3 -0
- package/dist/{actor-BXsV2bEo.js → actor-C-FuEZU4.js} +220 -705
- package/dist/{actor-C1Euqngb.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-Cn_Wo2Sr.cjs → actor-_9UN5RVT.cjs} +952 -1479
- package/dist/{actor-Ydzhc8dj.d.cts → actor-f2NtjyCg.d.cts} +2 -2
- package/dist/{actor-B1L4qxfi.js → actor-rOm0sXHU.js} +1 -1
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
- package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
- package/dist/{builder-C-PtyBzf.js → builder-hArjoWjW.js} +3 -4
- package/dist/{client-DjT_tegg.d.cts → client-94iWEfQa.d.cts} +3 -75
- package/dist/{client-DF8anIB5.d.ts → client-BsGzbnV-.d.ts} +3 -75
- package/dist/{client-DQu9XLnH.js → client-pY7-3icS.js} +3 -22
- package/dist/compat/mod.d.cts +10 -12
- package/dist/compat/mod.d.ts +10 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-CwUAkopp.d.cts → context-PxGADCsD.d.cts} +152 -27
- package/dist/{context-CXUibY4L.d.ts → context-V-XS2_6O.d.ts} +152 -27
- package/dist/{authdocloader-Cx_DgATa.js → docloader-CE1lRhEV.js} +17 -8
- package/dist/{esm-BHq8vvU6.js → esm-BEFbR5eN.js} +32 -17
- package/dist/federation/builder.test.js +9 -12
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +28 -149
- package/dist/federation/idempotency.test.js +26 -27
- package/dist/federation/inbox.test.js +4 -6
- package/dist/federation/keycache.test.js +3 -4
- package/dist/federation/kv.test.js +6 -8
- package/dist/federation/middleware.test.js +270 -93
- package/dist/federation/mod.cjs +9 -11
- package/dist/federation/mod.d.cts +10 -12
- package/dist/federation/mod.d.ts +10 -12
- package/dist/federation/mod.js +9 -11
- package/dist/federation/mq.test.js +10 -10
- package/dist/federation/negotiation.test.js +26 -0
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +14 -16
- package/dist/{http-wsGR6KkT.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-ZepHDnAP.js → http-Bmx7ea3F.js} +2 -2
- package/dist/{http-B1_DzfAU.d.cts → http-M8k5mKc0.d.cts} +2 -2
- package/dist/{http-C4Oi5eIq.js → http-Q_l4fCEE.js} +256 -6
- package/dist/{http-BtKvhGUI.cjs → http-So5V_Tgv.cjs} +289 -9
- package/dist/{inbox-D6-aBaqR.js → inbox-B9PjFn2S.js} +2 -7
- package/dist/{key-Dwqt62bf.js → key-khQpfFdw.js} +3 -2
- package/dist/{keycache-DZ51X_tY.js → keycache-BU3fsZFa.js} +1 -1
- package/dist/{keys-D9SlcZrs.js → keys-BaMFfIdL.js} +2 -1
- package/dist/kv-cache-DN9pfMBe.js +94 -0
- package/dist/kv-cache-R1oW382l.js +122 -0
- package/dist/kv-cache-X2ggcnHI.cjs +134 -0
- package/dist/{ld-CTGnKRt0.js → ld-BLMebnep.js} +3 -2
- package/dist/{type-BBugK2n5.js → lookup-C7SSHgK7.js} +542 -5394
- package/dist/{lookup-aQOlOGdF.cjs → lookup-CLaDFNx1.cjs} +134 -5
- package/dist/{lookup-BnxmqZLB.js → lookup-CtC3x1M6.js} +125 -2
- package/dist/middleware-BYBwqvTv.cjs +15 -0
- package/dist/{middleware-BtJedzGJ.js → middleware-Bda2JO66.js} +38 -84
- package/dist/{middleware-DHDM-Bzb.js → middleware-C3ml59Hp.js} +43 -146
- package/dist/middleware-DC7h2qq-.js +26 -0
- package/dist/{middleware-DTIx6DRv.cjs → middleware-DFLterpx.cjs} +58 -104
- package/dist/middleware-mQR2SM7T.js +15 -0
- package/dist/{mod-CDObsV1d.d.ts → mod-BlVovdcy.d.ts} +2 -2
- package/dist/{mod-mXx9V0q5.d.cts → mod-BoRKfJPE.d.cts} +2 -2
- package/dist/{mod-BUbqxBev.d.cts → mod-BxRCHTz-.d.cts} +2 -2
- package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/{mod-BcObK1Lz.d.ts → mod-Cdo6SYlJ.d.ts} +2 -2
- package/dist/{mod-DgcYoyZK.d.ts → mod-D5Z2tISD.d.ts} +3 -3
- package/dist/mod-DMpuiKXi.d.cts +107 -0
- package/dist/{mod-fjqfsrty.d.cts → mod-DgxG-byT.d.cts} +3 -3
- package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod-aAE2wOWV.d.ts +109 -0
- package/dist/mod.cjs +19 -34
- package/dist/mod.d.cts +15 -17
- package/dist/mod.d.ts +15 -17
- package/dist/mod.js +14 -16
- package/dist/negotiation-C4nFufNk.js +71 -0
- package/dist/nodeinfo/client.test.js +30 -111
- package/dist/nodeinfo/handler.test.js +25 -26
- package/dist/nodeinfo/mod.cjs +3 -6
- package/dist/nodeinfo/mod.d.cts +3 -5
- package/dist/nodeinfo/mod.d.ts +3 -5
- package/dist/nodeinfo/mod.js +3 -4
- package/dist/nodeinfo/types.test.js +8 -15
- package/dist/{owner-6KSEp9eV.d.cts → owner-B4HbyP8s.d.cts} +3 -3
- package/dist/{owner-DxpcLcST.js → owner-XzzTSr4S.js} +3 -2
- package/dist/{owner-BbeUDvOu.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/{proof-OAc97dy3.js → proof-B-qOSAuQ.js} +5 -4
- package/dist/{proof-ADZwDCs9.cjs → proof-BzJkFBBF.cjs} +18 -17
- package/dist/{proof-DBJnG2Jh.js → proof-C9sfVit1.js} +2 -2
- package/dist/{send-Df2mI5_D.js → send-yEkZlxzW.js} +2 -2
- package/dist/sig/http.test.js +12 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +9 -11
- package/dist/sig/mod.d.cts +5 -7
- package/dist/sig/mod.d.ts +5 -7
- package/dist/sig/mod.js +5 -7
- package/dist/sig/owner.test.js +11 -13
- package/dist/sig/proof.test.js +13 -14
- package/dist/src/vocab/accept.yaml +1 -1
- package/dist/src/vocab/activity.yaml +1 -1
- package/dist/src/vocab/add.yaml +1 -1
- package/dist/src/vocab/announce.yaml +1 -1
- package/dist/src/vocab/application.yaml +1 -1
- package/dist/src/vocab/arrive.yaml +1 -1
- package/dist/src/vocab/article.yaml +1 -1
- package/dist/src/vocab/audio.yaml +1 -1
- package/dist/src/vocab/block.yaml +1 -1
- package/dist/src/vocab/chatmessage.yaml +1 -1
- package/dist/src/vocab/collection.yaml +1 -1
- package/dist/src/vocab/collectionpage.yaml +1 -1
- package/dist/src/vocab/create.yaml +1 -1
- package/dist/src/vocab/dataintegrityproof.yaml +1 -1
- package/dist/src/vocab/delete.yaml +1 -1
- package/dist/src/vocab/didservice.yaml +1 -1
- package/dist/src/vocab/dislike.yaml +1 -1
- package/dist/src/vocab/document.yaml +1 -1
- package/dist/src/vocab/emoji.yaml +1 -1
- package/dist/src/vocab/emojireact.yaml +1 -1
- package/dist/src/vocab/endpoints.yaml +1 -1
- package/dist/src/vocab/event.yaml +1 -1
- package/dist/src/vocab/export.yaml +1 -1
- package/dist/src/vocab/flag.yaml +1 -1
- package/dist/src/vocab/follow.yaml +1 -1
- package/dist/src/vocab/group.yaml +1 -1
- package/dist/src/vocab/hashtag.yaml +1 -1
- package/dist/src/vocab/ignore.yaml +1 -1
- package/dist/src/vocab/image.yaml +1 -1
- package/dist/src/vocab/intransitiveactivity.yaml +1 -1
- package/dist/src/vocab/invite.yaml +1 -1
- package/dist/src/vocab/join.yaml +1 -1
- package/dist/src/vocab/key.yaml +1 -1
- package/dist/src/vocab/leave.yaml +1 -1
- package/dist/src/vocab/like.yaml +1 -1
- package/dist/src/vocab/link.yaml +1 -1
- package/dist/src/vocab/listen.yaml +1 -1
- package/dist/src/vocab/mention.yaml +1 -1
- package/dist/src/vocab/move.yaml +1 -1
- package/dist/src/vocab/multikey.yaml +1 -1
- package/dist/src/vocab/note.yaml +1 -1
- package/dist/src/vocab/object.yaml +1 -1
- package/dist/src/vocab/offer.yaml +1 -1
- package/dist/src/vocab/orderedcollection.yaml +1 -1
- package/dist/src/vocab/orderedcollectionpage.yaml +1 -1
- package/dist/src/vocab/organization.yaml +1 -1
- package/dist/src/vocab/page.yaml +1 -1
- package/dist/src/vocab/person.yaml +1 -1
- package/dist/src/vocab/place.yaml +1 -1
- package/dist/src/vocab/profile.yaml +1 -1
- package/dist/src/vocab/propertyvalue.yaml +1 -1
- package/dist/src/vocab/question.yaml +1 -1
- package/dist/src/vocab/read.yaml +1 -1
- package/dist/src/vocab/reject.yaml +1 -1
- package/dist/src/vocab/relationship.yaml +1 -1
- package/dist/src/vocab/remove.yaml +1 -1
- package/dist/src/vocab/service.yaml +1 -1
- package/dist/src/vocab/source.yaml +1 -1
- package/dist/src/vocab/tentativeaccept.yaml +1 -1
- package/dist/src/vocab/tentativereject.yaml +1 -1
- package/dist/src/vocab/tombstone.yaml +1 -1
- package/dist/src/vocab/travel.yaml +1 -1
- package/dist/src/vocab/undo.yaml +1 -1
- package/dist/src/vocab/update.yaml +1 -1
- package/dist/src/vocab/video.yaml +1 -1
- package/dist/src/vocab/view.yaml +1 -1
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +10 -119
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-J7AQVhyi.js → testing-D-nLIHkh.js} +1 -2
- package/dist/{types-C-qRy7Sr.js → types-BtUjyi5y.js} +5 -166
- package/dist/{types-BIgY6c-l.js → types-C2XVl6gj.js} +1 -3
- package/dist/{types-Bzu6UrRZ.cjs → types-CWgzGaqk.cjs} +6 -179
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +209 -0
- package/dist/utils/mod.cjs +12 -0
- package/dist/utils/mod.d.cts +5 -0
- package/dist/utils/mod.d.ts +7 -0
- package/dist/utils/mod.js +11 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +8 -10
- package/dist/vocab/mod.cjs +3 -4
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +3 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +7618 -1973
- package/dist/{vocab-CDHNj5zp.d.ts → vocab-BCWe1Ih5.d.ts} +9 -25
- package/dist/{vocab-BmNpY-Qt.cjs → vocab-C96aggZM.cjs} +5 -5
- package/dist/{vocab-Cfs0937i.d.cts → vocab-CeDBzu-f.d.cts} +9 -25
- package/dist/{vocab-LbNRAL-4.js → vocab-axlR_8k0.js} +3 -3
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +2 -3
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +2 -3
- package/package.json +20 -51
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-D9EszOkX.js +0 -52
- package/dist/authdocloader-Drjjh5Im.cjs +0 -58
- package/dist/denokv-D0nfNQ1x.js +0 -57
- package/dist/docloader-Bmu3XCd9.js +0 -4825
- package/dist/docloader-Ca3eoIku.cjs +0 -4891
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/key-B0fFsgYk.js +0 -10
- package/dist/key-BvTvHoN1.js +0 -10
- package/dist/key-CPuhWBwH.cjs +0 -290
- package/dist/key-DUfn16_4.js +0 -260
- package/dist/key-DZieB9_P.cjs +0 -10
- package/dist/lookup-DSMnJERg.js +0 -336
- package/dist/middleware-BnRluVn4.js +0 -17
- package/dist/middleware-CkMXhJ9g.cjs +0 -17
- package/dist/middleware-DhE-His4.js +0 -26
- package/dist/mod-CIbqfZW0.d.ts +0 -104
- package/dist/mod-Dt-G9ZOS.d.cts +0 -102
- package/dist/mq-B7R1Q-M5.d.cts +0 -140
- package/dist/mq-CRGm1e_F.d.ts +0 -143
- package/dist/nodeinfo/semver.test.js +0 -143
- package/dist/runtime/docloader.test.js +0 -588
- package/dist/runtime/key.test.d.ts +0 -3
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/langstr.test.js +0 -40
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/link.test.js +0 -61
- package/dist/runtime/mod.cjs +0 -25
- package/dist/runtime/mod.d.cts +0 -6
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime/mod.js +0 -13
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.js +0 -358
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime/url.test.js +0 -45
- package/dist/semver-dArNLkR9.js +0 -149
- package/dist/vocab/schema.yaml +0 -247
- package/dist/x/cfworkers.cjs +0 -100
- package/dist/x/cfworkers.d.cts +0 -59
- package/dist/x/cfworkers.d.ts +0 -61
- package/dist/x/cfworkers.js +0 -98
- package/dist/x/cfworkers.test.d.ts +0 -3
- package/dist/x/cfworkers.test.js +0 -179
- package/dist/x/hono.cjs +0 -61
- package/dist/x/hono.d.cts +0 -54
- package/dist/x/hono.d.ts +0 -56
- package/dist/x/hono.js +0 -60
- package/dist/x/sveltekit.cjs +0 -69
- package/dist/x/sveltekit.d.cts +0 -46
- package/dist/x/sveltekit.d.ts +0 -48
- package/dist/x/sveltekit.js +0 -68
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CSzG2j1P.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{nodeinfo/semver.test.d.ts → federation/negotiation.test.d.ts} +0 -0
- /package/dist/{federation-H2_En3j5.cjs → federation-CRpdnOMS.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
- /package/dist/{mod-C2tOeRkN.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-CcDPcLJW.d.cts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-bjzj5QIb.d.ts} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
- /package/dist/{otel-Chy5T2Xh.js → otel-1BmGPuZc.js} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
- /package/dist/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Application, Group, Organization, Person, Service } from "./vocab-CeDBzu-f.cjs";
|
|
2
|
+
import { GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
3
3
|
import { TracerProvider } from "@opentelemetry/api";
|
|
4
4
|
|
|
5
5
|
//#region src/vocab/actor.d.ts
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Application, Group, Organization, Person, Service, deno_default, getTypeId, lookupWebFinger } from "./
|
|
6
|
+
import { Application, Group, Organization, Person, Service, deno_default, getTypeId, lookupWebFinger } from "./lookup-C7SSHgK7.js";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { domainToASCII, domainToUnicode } from "node:url";
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
6
|
import { AssertionError } from "./assert_equals-DSbWqCm3.js";
|
|
7
|
-
import { assertIsError } from "./
|
|
7
|
+
import { assertIsError } from "./assert_throws-BNXdRGWP.js";
|
|
8
8
|
|
|
9
9
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
|
|
10
10
|
/**
|
|
@@ -45,4 +45,34 @@ import { AssertionError, stripAnsiCode } from "./assert_equals-DSbWqCm3.js";
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
|
|
48
|
+
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js
|
|
49
|
+
function assertThrows(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
|
|
50
|
+
let ErrorClass = void 0;
|
|
51
|
+
let msgIncludes = void 0;
|
|
52
|
+
let err;
|
|
53
|
+
if (typeof errorClassOrMsg !== "string") if (errorClassOrMsg === void 0 || errorClassOrMsg?.prototype instanceof Error || errorClassOrMsg?.prototype === Error.prototype) {
|
|
54
|
+
ErrorClass = errorClassOrMsg;
|
|
55
|
+
msgIncludes = msgIncludesOrMsg;
|
|
56
|
+
} else msg = msgIncludesOrMsg;
|
|
57
|
+
else msg = errorClassOrMsg;
|
|
58
|
+
let doesThrow = false;
|
|
59
|
+
const msgSuffix = msg ? `: ${msg}` : ".";
|
|
60
|
+
try {
|
|
61
|
+
fn();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (ErrorClass) {
|
|
64
|
+
if (error instanceof Error === false) throw new AssertionError(`A non-Error object was thrown${msgSuffix}`);
|
|
65
|
+
assertIsError(error, ErrorClass, msgIncludes, msg);
|
|
66
|
+
}
|
|
67
|
+
err = error;
|
|
68
|
+
doesThrow = true;
|
|
69
|
+
}
|
|
70
|
+
if (!doesThrow) {
|
|
71
|
+
msg = `Expected function to throw${msgSuffix}`;
|
|
72
|
+
throw new AssertionError(msg);
|
|
73
|
+
}
|
|
74
|
+
return err;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { assertIsError, assertThrows };
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default, getTypeId } from "./
|
|
7
|
-
import {
|
|
8
|
-
import { InboxListenerSet } from "./inbox-D6-aBaqR.js";
|
|
6
|
+
import { Router, RouterError, deno_default, getTypeId } from "./lookup-C7SSHgK7.js";
|
|
7
|
+
import { InboxListenerSet } from "./inbox-B9PjFn2S.js";
|
|
9
8
|
import { getLogger } from "@logtape/logtape";
|
|
10
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
11
10
|
|
|
@@ -43,7 +42,7 @@ var FederationBuilderImpl = class {
|
|
|
43
42
|
this.collectionTypeIds = {};
|
|
44
43
|
}
|
|
45
44
|
async build(options) {
|
|
46
|
-
const { FederationImpl } = await import("./middleware-
|
|
45
|
+
const { FederationImpl } = await import("./middleware-DC7h2qq-.js");
|
|
47
46
|
const f = new FederationImpl(options);
|
|
48
47
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
49
48
|
f.router = this.router.clone();
|
|
@@ -1,76 +1,5 @@
|
|
|
1
|
-
import { GetUserAgentOptions } from "
|
|
1
|
+
import { GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
2
2
|
|
|
3
|
-
//#region src/nodeinfo/semver.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* A SemVer object parsed into its constituent parts.
|
|
6
|
-
* @since 1.2.0
|
|
7
|
-
*/
|
|
8
|
-
interface SemVer {
|
|
9
|
-
/** The major version */
|
|
10
|
-
major: number;
|
|
11
|
-
/** The minor version */
|
|
12
|
-
minor: number;
|
|
13
|
-
/** The patch version */
|
|
14
|
-
patch: number;
|
|
15
|
-
/**
|
|
16
|
-
* The prerelease version
|
|
17
|
-
*
|
|
18
|
-
* @default {[]}
|
|
19
|
-
*/
|
|
20
|
-
prerelease?: (string | number)[];
|
|
21
|
-
/**
|
|
22
|
-
* The build metadata
|
|
23
|
-
*
|
|
24
|
-
* @default {[]}
|
|
25
|
-
*/
|
|
26
|
-
build?: string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
30
|
-
*
|
|
31
|
-
* @example Usage
|
|
32
|
-
* ```ts
|
|
33
|
-
* import { parseSemVer } from "@fedify/fedify/nodeinfo";
|
|
34
|
-
* import { assertEquals } from "@std/assert";
|
|
35
|
-
*
|
|
36
|
-
* const version = parseSemVer("1.2.3");
|
|
37
|
-
* assertEquals(version, {
|
|
38
|
-
* major: 1,
|
|
39
|
-
* minor: 2,
|
|
40
|
-
* patch: 3,
|
|
41
|
-
* prerelease: [],
|
|
42
|
-
* build: [],
|
|
43
|
-
* });
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @throws {TypeError} If the input string is invalid.
|
|
47
|
-
* @param value The version string to parse
|
|
48
|
-
* @returns A valid SemVer
|
|
49
|
-
* @since 1.2.0
|
|
50
|
-
*/
|
|
51
|
-
declare function parseSemVer(value: string): SemVer;
|
|
52
|
-
/**
|
|
53
|
-
* Format a SemVer object into a string.
|
|
54
|
-
*
|
|
55
|
-
* @example Usage
|
|
56
|
-
* ```ts
|
|
57
|
-
* import { formatSemVer } from "@fedify/fedify/nodeinfo";
|
|
58
|
-
* import { assertEquals } from "@std/assert";
|
|
59
|
-
*
|
|
60
|
-
* const semver = {
|
|
61
|
-
* major: 1,
|
|
62
|
-
* minor: 2,
|
|
63
|
-
* patch: 3,
|
|
64
|
-
* };
|
|
65
|
-
* assertEquals(formatSemVer(semver), "1.2.3");
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* @param version The SemVer to format
|
|
69
|
-
* @returns The string representation of a semantic version.
|
|
70
|
-
* @since 1.2.0
|
|
71
|
-
*/
|
|
72
|
-
declare function formatSemVer(version: SemVer): string;
|
|
73
|
-
//#endregion
|
|
74
3
|
//#region src/nodeinfo/types.d.ts
|
|
75
4
|
/**
|
|
76
5
|
* The type of the result of parsing JSON.
|
|
@@ -120,9 +49,8 @@ interface Software {
|
|
|
120
49
|
name: string;
|
|
121
50
|
/**
|
|
122
51
|
* The version of this server software.
|
|
123
|
-
* @see {@link parseSemVer}
|
|
124
52
|
*/
|
|
125
|
-
version:
|
|
53
|
+
version: string;
|
|
126
54
|
/**
|
|
127
55
|
* The URL of the source code repository of this server software.
|
|
128
56
|
*/
|
|
@@ -291,4 +219,4 @@ interface ParseNodeInfoOptions {
|
|
|
291
219
|
*/
|
|
292
220
|
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
293
221
|
//#endregion
|
|
294
|
-
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol,
|
|
222
|
+
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
|
@@ -1,78 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "
|
|
3
|
+
import { GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
4
4
|
|
|
5
|
-
//#region src/nodeinfo/semver.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* A SemVer object parsed into its constituent parts.
|
|
8
|
-
* @since 1.2.0
|
|
9
|
-
*/
|
|
10
|
-
interface SemVer {
|
|
11
|
-
/** The major version */
|
|
12
|
-
major: number;
|
|
13
|
-
/** The minor version */
|
|
14
|
-
minor: number;
|
|
15
|
-
/** The patch version */
|
|
16
|
-
patch: number;
|
|
17
|
-
/**
|
|
18
|
-
* The prerelease version
|
|
19
|
-
*
|
|
20
|
-
* @default {[]}
|
|
21
|
-
*/
|
|
22
|
-
prerelease?: (string | number)[];
|
|
23
|
-
/**
|
|
24
|
-
* The build metadata
|
|
25
|
-
*
|
|
26
|
-
* @default {[]}
|
|
27
|
-
*/
|
|
28
|
-
build?: string[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Attempt to parse a string as a semantic version, returning a SemVer object.
|
|
32
|
-
*
|
|
33
|
-
* @example Usage
|
|
34
|
-
* ```ts
|
|
35
|
-
* import { parseSemVer } from "@fedify/fedify/nodeinfo";
|
|
36
|
-
* import { assertEquals } from "@std/assert";
|
|
37
|
-
*
|
|
38
|
-
* const version = parseSemVer("1.2.3");
|
|
39
|
-
* assertEquals(version, {
|
|
40
|
-
* major: 1,
|
|
41
|
-
* minor: 2,
|
|
42
|
-
* patch: 3,
|
|
43
|
-
* prerelease: [],
|
|
44
|
-
* build: [],
|
|
45
|
-
* });
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @throws {TypeError} If the input string is invalid.
|
|
49
|
-
* @param value The version string to parse
|
|
50
|
-
* @returns A valid SemVer
|
|
51
|
-
* @since 1.2.0
|
|
52
|
-
*/
|
|
53
|
-
declare function parseSemVer(value: string): SemVer;
|
|
54
|
-
/**
|
|
55
|
-
* Format a SemVer object into a string.
|
|
56
|
-
*
|
|
57
|
-
* @example Usage
|
|
58
|
-
* ```ts
|
|
59
|
-
* import { formatSemVer } from "@fedify/fedify/nodeinfo";
|
|
60
|
-
* import { assertEquals } from "@std/assert";
|
|
61
|
-
*
|
|
62
|
-
* const semver = {
|
|
63
|
-
* major: 1,
|
|
64
|
-
* minor: 2,
|
|
65
|
-
* patch: 3,
|
|
66
|
-
* };
|
|
67
|
-
* assertEquals(formatSemVer(semver), "1.2.3");
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @param version The SemVer to format
|
|
71
|
-
* @returns The string representation of a semantic version.
|
|
72
|
-
* @since 1.2.0
|
|
73
|
-
*/
|
|
74
|
-
declare function formatSemVer(version: SemVer): string;
|
|
75
|
-
//#endregion
|
|
76
5
|
//#region src/nodeinfo/types.d.ts
|
|
77
6
|
/**
|
|
78
7
|
* The type of the result of parsing JSON.
|
|
@@ -122,9 +51,8 @@ interface Software {
|
|
|
122
51
|
name: string;
|
|
123
52
|
/**
|
|
124
53
|
* The version of this server software.
|
|
125
|
-
* @see {@link parseSemVer}
|
|
126
54
|
*/
|
|
127
|
-
version:
|
|
55
|
+
version: string;
|
|
128
56
|
/**
|
|
129
57
|
* The URL of the source code repository of this server software.
|
|
130
58
|
*/
|
|
@@ -293,4 +221,4 @@ interface ParseNodeInfoOptions {
|
|
|
293
221
|
*/
|
|
294
222
|
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
295
223
|
//#endregion
|
|
296
|
-
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol,
|
|
224
|
+
export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { getUserAgent } from "
|
|
7
|
-
import { parseSemVer } from "./semver-dArNLkR9.js";
|
|
6
|
+
import { getUserAgent } from "@fedify/vocab-runtime";
|
|
8
7
|
import { getLogger } from "@logtape/logtape";
|
|
9
8
|
|
|
10
9
|
//#region src/nodeinfo/client.ts
|
|
@@ -133,28 +132,10 @@ function parseSoftware(data, options = {}) {
|
|
|
133
132
|
name = data.name.trim().toLowerCase();
|
|
134
133
|
} else return null;
|
|
135
134
|
let version;
|
|
136
|
-
if ("version" in data
|
|
137
|
-
version = parseSemVer(data.version);
|
|
138
|
-
} catch {
|
|
139
|
-
if (!options.tryBestEffort) return null;
|
|
140
|
-
const parts = data.version.split(".").map((p) => parseInt(p, 10));
|
|
141
|
-
version = {
|
|
142
|
-
major: !isNaN(parts[0]) ? parts[0] : 0,
|
|
143
|
-
minor: !isNaN(parts[1]) ? parts[1] : 0,
|
|
144
|
-
patch: !isNaN(parts[2]) ? parts[2] : 0,
|
|
145
|
-
build: [],
|
|
146
|
-
prerelease: []
|
|
147
|
-
};
|
|
148
|
-
}
|
|
135
|
+
if ("version" in data) version = String(data.version);
|
|
149
136
|
else {
|
|
150
137
|
if (!options.tryBestEffort) return null;
|
|
151
|
-
version =
|
|
152
|
-
major: 0,
|
|
153
|
-
minor: 0,
|
|
154
|
-
patch: 0,
|
|
155
|
-
build: [],
|
|
156
|
-
prerelease: []
|
|
157
|
-
};
|
|
138
|
+
version = "0.0.0";
|
|
158
139
|
}
|
|
159
140
|
let repository;
|
|
160
141
|
if ("repository" in data) {
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import {
|
|
11
|
-
import "../mq-B7R1Q-M5.cjs";
|
|
12
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-mXx9V0q5.cjs";
|
|
1
|
+
import "../client-94iWEfQa.cjs";
|
|
2
|
+
import "../vocab-CeDBzu-f.cjs";
|
|
3
|
+
import "../actor-f2NtjyCg.cjs";
|
|
4
|
+
import "../http-M8k5mKc0.cjs";
|
|
5
|
+
import "../owner-B4HbyP8s.cjs";
|
|
6
|
+
import "../mod-BxRCHTz-.cjs";
|
|
7
|
+
import "../mod-C58MZ7Wx.cjs";
|
|
8
|
+
import { ActivityTransformer } from "../context-PxGADCsD.cjs";
|
|
9
|
+
import "../kv-Bxr0Q87_.cjs";
|
|
10
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-BoRKfJPE.cjs";
|
|
13
11
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import {
|
|
13
|
-
import "../mq-CRGm1e_F.js";
|
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-BcObK1Lz.js";
|
|
3
|
+
import "../client-BsGzbnV-.js";
|
|
4
|
+
import "../vocab-BCWe1Ih5.js";
|
|
5
|
+
import "../actor-DqFajh9s.js";
|
|
6
|
+
import "../http-BbO0ejuk.js";
|
|
7
|
+
import "../owner-kQRGVXG1.js";
|
|
8
|
+
import "../mod-BlVovdcy.js";
|
|
9
|
+
import "../mod-Ds0mpFZU.js";
|
|
10
|
+
import { ActivityTransformer } from "../context-V-XS2_6O.js";
|
|
11
|
+
import "../kv-BKNZ-Tb-.js";
|
|
12
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-Cdo6SYlJ.js";
|
|
15
13
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { Follow, Person } from "../
|
|
6
|
+
import { Follow, Person } from "../lookup-C7SSHgK7.js";
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
|
11
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
import "../
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import "../retry-
|
|
28
|
-
import "../send-
|
|
29
|
-
import { test } from "../testing-
|
|
11
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-C3ml59Hp.js";
|
|
12
|
+
import "../client-pY7-3icS.js";
|
|
13
|
+
import "../types-C2XVl6gj.js";
|
|
14
|
+
import "../actor-rOm0sXHU.js";
|
|
15
|
+
import "../key-khQpfFdw.js";
|
|
16
|
+
import "../http-Bmx7ea3F.js";
|
|
17
|
+
import "../ld-BLMebnep.js";
|
|
18
|
+
import "../owner-XzzTSr4S.js";
|
|
19
|
+
import "../proof-C9sfVit1.js";
|
|
20
|
+
import "../docloader-CE1lRhEV.js";
|
|
21
|
+
import "../kv-cache-DN9pfMBe.js";
|
|
22
|
+
import "../inbox-B9PjFn2S.js";
|
|
23
|
+
import "../builder-hArjoWjW.js";
|
|
24
|
+
import "../collection-BzWsN9pB.js";
|
|
25
|
+
import "../keycache-BU3fsZFa.js";
|
|
26
|
+
import "../negotiation-C4nFufNk.js";
|
|
27
|
+
import "../retry-CfF8Gn4d.js";
|
|
28
|
+
import "../send-yEkZlxzW.js";
|
|
29
|
+
import { test } from "../testing-D-nLIHkh.js";
|
|
30
30
|
|
|
31
31
|
//#region src/compat/transformers.test.ts
|
|
32
32
|
const federation = new FederationImpl({ kv: new MemoryKvStore() });
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { MessageQueue } from "./mq-B7R1Q-M5.cjs";
|
|
1
|
+
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-94iWEfQa.cjs";
|
|
2
|
+
import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-CeDBzu-f.cjs";
|
|
3
|
+
import { Actor, Recipient } from "./actor-f2NtjyCg.cjs";
|
|
4
|
+
import { HttpMessageSignaturesSpec } from "./http-M8k5mKc0.cjs";
|
|
5
|
+
import { GetKeyOwnerOptions } from "./owner-B4HbyP8s.cjs";
|
|
6
|
+
import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-BxRCHTz-.cjs";
|
|
7
|
+
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "./mod-C58MZ7Wx.cjs";
|
|
8
|
+
import { KvKey, KvStore } from "./kv-Bxr0Q87_.cjs";
|
|
9
|
+
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
11
10
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
|
12
11
|
|
|
13
12
|
//#region src/compat/types.d.ts
|
|
@@ -306,8 +305,146 @@ type CustomCollectionCounter<TParam extends string, TContextData> = (context: Re
|
|
|
306
305
|
*/
|
|
307
306
|
type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
|
|
308
307
|
//#endregion
|
|
308
|
+
//#region src/federation/mq.d.ts
|
|
309
|
+
/**
|
|
310
|
+
* Additional options for enqueuing a message in a queue.
|
|
311
|
+
*
|
|
312
|
+
* @since 0.5.0
|
|
313
|
+
*/
|
|
314
|
+
interface MessageQueueEnqueueOptions {
|
|
315
|
+
/**
|
|
316
|
+
* The delay before the message is enqueued. No delay by default.
|
|
317
|
+
*
|
|
318
|
+
* It must not be negative.
|
|
319
|
+
*/
|
|
320
|
+
delay?: Temporal.Duration;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Additional options for listening to a message queue.
|
|
324
|
+
*
|
|
325
|
+
* @since 1.0.0
|
|
326
|
+
*/
|
|
327
|
+
interface MessageQueueListenOptions {
|
|
328
|
+
/**
|
|
329
|
+
* The signal to abort listening to the message queue.
|
|
330
|
+
*/
|
|
331
|
+
signal?: AbortSignal;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* An abstract interface for a message queue.
|
|
335
|
+
*
|
|
336
|
+
* @since 0.5.0
|
|
337
|
+
*/
|
|
338
|
+
interface MessageQueue {
|
|
339
|
+
/**
|
|
340
|
+
* Whether the message queue backend provides native retry mechanisms.
|
|
341
|
+
* When `true`, Fedify will skip its own retry logic and rely on the backend
|
|
342
|
+
* to handle retries. When `false` or omitted, Fedify will handle retries
|
|
343
|
+
* using its own retry policies.
|
|
344
|
+
*
|
|
345
|
+
* @default `false`
|
|
346
|
+
* @since 1.7.0
|
|
347
|
+
*/
|
|
348
|
+
readonly nativeRetrial?: boolean;
|
|
349
|
+
/**
|
|
350
|
+
* Enqueues a message in the queue.
|
|
351
|
+
* @param message The message to enqueue.
|
|
352
|
+
* @param options Additional options for enqueuing the message.
|
|
353
|
+
*/
|
|
354
|
+
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
355
|
+
/**
|
|
356
|
+
* Enqueues multiple messages in the queue. This operation is optional,
|
|
357
|
+
* and may not be supported by all implementations. If not supported,
|
|
358
|
+
* Fedify will invoke {@link enqueue} for each message.
|
|
359
|
+
*
|
|
360
|
+
* @param messages The messages to enqueue.
|
|
361
|
+
* @param options Additional options for enqueuing the messages.
|
|
362
|
+
*/
|
|
363
|
+
enqueueMany?: (messages: any[], options?: MessageQueueEnqueueOptions) => Promise<void>;
|
|
364
|
+
/**
|
|
365
|
+
* Listens for messages in the queue.
|
|
366
|
+
* @param handler The handler for messages in the queue.
|
|
367
|
+
* @param options Additional options for listening to the message queue.
|
|
368
|
+
* @returns A promise that resolves when the listening is done. It never
|
|
369
|
+
* rejects, and is resolved when the signal is aborted. If no
|
|
370
|
+
* signal is provided, it never resolves.
|
|
371
|
+
*/
|
|
372
|
+
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Additional options for {@link InProcessMessageQueue}.
|
|
376
|
+
* @since 1.0.0
|
|
377
|
+
*/
|
|
378
|
+
interface InProcessMessageQueueOptions {
|
|
379
|
+
/**
|
|
380
|
+
* The interval to poll for messages in the queue. 5 seconds by default.
|
|
381
|
+
* @default `{ seconds: 5 }`
|
|
382
|
+
*/
|
|
383
|
+
pollInterval?: Temporal.Duration | Temporal.DurationLike;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* A message queue that processes messages in the same process.
|
|
387
|
+
* Do not use this in production as it does neither persist messages nor
|
|
388
|
+
* distribute them across multiple processes.
|
|
389
|
+
*
|
|
390
|
+
* @since 0.5.0
|
|
391
|
+
*/
|
|
392
|
+
declare class InProcessMessageQueue implements MessageQueue {
|
|
393
|
+
#private;
|
|
394
|
+
/**
|
|
395
|
+
* In-process message queue does not provide native retry mechanisms.
|
|
396
|
+
* @since 1.7.0
|
|
397
|
+
*/
|
|
398
|
+
readonly nativeRetrial = false;
|
|
399
|
+
/**
|
|
400
|
+
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
401
|
+
* @param options Additional options for the in-process message queue.
|
|
402
|
+
*/
|
|
403
|
+
constructor(options?: InProcessMessageQueueOptions);
|
|
404
|
+
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
405
|
+
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
406
|
+
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* A message queue that processes messages in parallel. It takes another
|
|
410
|
+
* {@link MessageQueue}, and processes messages in parallel up to a certain
|
|
411
|
+
* number of workers.
|
|
412
|
+
*
|
|
413
|
+
* Actually, it's rather a decorator than a queue itself.
|
|
414
|
+
*
|
|
415
|
+
* Note that the workers do not run in truly parallel, in the sense that they
|
|
416
|
+
* are not running in separate threads or processes. They are running in the
|
|
417
|
+
* same process, but are scheduled to run in parallel. Hence, this is useful
|
|
418
|
+
* for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
|
|
419
|
+
* workloads.
|
|
420
|
+
*
|
|
421
|
+
* @since 1.0.0
|
|
422
|
+
*/
|
|
423
|
+
declare class ParallelMessageQueue implements MessageQueue {
|
|
424
|
+
#private;
|
|
425
|
+
readonly queue: MessageQueue;
|
|
426
|
+
readonly workers: number;
|
|
427
|
+
/**
|
|
428
|
+
* Inherits the native retry capability from the wrapped queue.
|
|
429
|
+
* @since 1.7.0
|
|
430
|
+
*/
|
|
431
|
+
readonly nativeRetrial?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
434
|
+
* number of workers.
|
|
435
|
+
* @param queue The message queue to use under the hood. Note that
|
|
436
|
+
* {@link ParallelMessageQueue} cannot be nested.
|
|
437
|
+
* @param workers The number of workers to process messages in parallel.
|
|
438
|
+
* @throws {TypeError} If the given queue is an instance of
|
|
439
|
+
* {@link ParallelMessageQueue}.
|
|
440
|
+
*/
|
|
441
|
+
constructor(queue: MessageQueue, workers: number);
|
|
442
|
+
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
443
|
+
enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
444
|
+
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
445
|
+
}
|
|
446
|
+
//#endregion
|
|
309
447
|
//#region src/federation/handler.d.ts
|
|
310
|
-
|
|
311
448
|
/**
|
|
312
449
|
* Options for the {@link respondWithObject} and
|
|
313
450
|
* {@link respondWithObjectIfAcceptable} functions.
|
|
@@ -1138,18 +1275,6 @@ interface FederationOptions<TContextData> {
|
|
|
1138
1275
|
* @since 1.4.0
|
|
1139
1276
|
*/
|
|
1140
1277
|
contextLoaderFactory?: DocumentLoaderFactory;
|
|
1141
|
-
/**
|
|
1142
|
-
* A custom JSON-LD document loader. By default, this uses the built-in
|
|
1143
|
-
* cache-backed loader that fetches remote documents over HTTP(S).
|
|
1144
|
-
* @deprecated Use {@link documentLoaderFactory} instead.
|
|
1145
|
-
*/
|
|
1146
|
-
documentLoader?: DocumentLoader;
|
|
1147
|
-
/**
|
|
1148
|
-
* A custom JSON-LD context loader. By default, this uses the same loader
|
|
1149
|
-
* as the document loader.
|
|
1150
|
-
* @deprecated Use {@link contextLoaderFactory} instead.
|
|
1151
|
-
*/
|
|
1152
|
-
contextLoader?: DocumentLoader;
|
|
1153
1278
|
/**
|
|
1154
1279
|
* A factory function that creates an authenticated document loader for a
|
|
1155
1280
|
* given identity. This is used for fetching documents that require
|
|
@@ -1367,13 +1492,13 @@ interface CollectionCallbackSetters<TContext extends Context<TContextData>, TCon
|
|
|
1367
1492
|
*
|
|
1368
1493
|
* - `"per-origin"`: Activities are deduplicated per receiving server's origin.
|
|
1369
1494
|
* The same activity ID will be processed only once on each receiving server,
|
|
1370
|
-
* but can be processed separately on different receiving servers. This
|
|
1371
|
-
* the default behavior in Fedify 1.x versions.
|
|
1495
|
+
* but can be processed separately on different receiving servers. This had
|
|
1496
|
+
* been the default behavior in Fedify 1.x versions.
|
|
1372
1497
|
*
|
|
1373
1498
|
* - `"per-inbox"`: Activities are deduplicated per inbox. The same activity
|
|
1374
1499
|
* ID can be processed once per inbox, allowing the same activity to be
|
|
1375
1500
|
* delivered to multiple inboxes independently. This follows standard
|
|
1376
|
-
* ActivityPub behavior and
|
|
1501
|
+
* ActivityPub behavior and is the default strategy since Fedify 2.0.0.
|
|
1377
1502
|
*
|
|
1378
1503
|
* @since 1.9.0
|
|
1379
1504
|
*/
|
|
@@ -2321,4 +2446,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2321
2446
|
multikey: Multikey;
|
|
2322
2447
|
}
|
|
2323
2448
|
//#endregion
|
|
2324
|
-
export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
|
2449
|
+
export { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|