@fedify/fedify 1.6.11 → 1.6.13
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/{actor-tT_B0pDn.d.ts → actor-5yLVgYbM.d.ts} +3 -3
- package/dist/{actor-KrOvzFz1.js → actor-CcchiJa2.js} +6 -6
- package/dist/{actor-CxnKxfwH.js → actor-_hg-8_KF.js} +329 -465
- package/dist/{assert-LOEeCUK5.js → assert-C-mZuSQl.js} +2 -2
- package/dist/{assert_equals-B44MxcIj.js → assert_equals-Dy0MG_Zw.js} +16 -16
- package/dist/{assert_instance_of-XtuFevV_.js → assert_instance_of-lS0Jr2iu.js} +2 -2
- package/dist/{assert_is_error-BTlryvT0.js → assert_is_error-CIYFACrT.js} +2 -2
- package/dist/{assert_not_equals-C685gKx6.js → assert_not_equals-C1azCAB0.js} +3 -6
- package/dist/{assert_rejects-DWQ4jaf9.js → assert_rejects-Bkh5lA1a.js} +3 -3
- package/dist/{assert_throws-YetpVSc-.js → assert_throws-CmpfkWEM.js} +3 -3
- package/dist/{authdocloader-CsnXlm3V.js → authdocloader-1Ja0Him4.js} +7 -9
- package/dist/{authdocloader-DsULyH5D.js → authdocloader-D0Ds92Vk.js} +6 -8
- package/dist/{builder-BjJSVOvs.js → builder-MOXlzktX.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk-DvTpRkcT.js} +22 -15
- package/dist/{client-Cd552pKL.d.ts → client-BvbhJik1.d.ts} +2 -2
- package/dist/{client-BlntqhE9.js → client-C0yKnQtt.js} +3 -3
- package/dist/{collection-Dfb0TPno.js → collection-XNLQhehO.js} +2 -3
- package/dist/{mod-CgmTOt4z.d.ts → compat/mod-MHHm8HmK.d.ts} +3 -3
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-DRhhOsMk.d.ts → context-C0X9n1tC.d.ts} +10 -10
- package/dist/{context-CiyuTkCx.js → context-D7ltDKkC.js} +5 -5
- package/dist/{docloader-09nVWLAZ.js → docloader-BDSHZfTJ.js} +1 -1
- package/dist/{docloader-BYgIBZvh.js → docloader-C8QMM0lt.js} +32 -152
- package/dist/{docloader-DlUDOVSe.d.ts → docloader-DecYq5GI.d.ts} +2 -2
- package/dist/{docloader-DOrb0fRp.js → docloader-M1Np6SYc.js} +31 -151
- package/dist/{esm-DO9PrujO.js → esm-BRXvTSrx.js} +36 -22
- package/dist/federation/builder.test.js +20 -26
- package/dist/federation/collection.test.js +11 -16
- package/dist/federation/handler.test.js +41 -48
- package/dist/federation/inbox.test.js +11 -11
- package/dist/federation/keycache.test.js +12 -11
- package/dist/federation/kv.test.js +8 -10
- package/dist/federation/middleware.test.js +99 -120
- package/dist/federation/mod-CLkToKJa.d.ts +6 -0
- package/dist/federation/mod.js +195 -12
- package/dist/federation/mq.test.js +9 -14
- package/dist/federation/retry.test.js +5 -4
- package/dist/federation/router.test.js +9 -10
- package/dist/federation/send.test.js +23 -24
- package/dist/{http-LsE7i_Zq.js → http-BDLuDcCk.js} +17 -26
- package/dist/{http-Dc8RIaDE.js → http-BHjHzW-Y.js} +17 -26
- package/dist/{http-BkUCISGt.d.ts → http-ByqMVN52.d.ts} +3 -3
- package/dist/{inbox-BVwejjm8.js → inbox-FoFUUhTd.js} +5 -5
- package/dist/{key-BTcmhZp7.js → key-BABKdX0W.js} +5 -5
- package/dist/{key-Bg_PKGpe.js → key-Bj3ZyKd0.js} +4 -4
- package/dist/key-CragWqc4.js +16 -0
- package/dist/key-OMbKIYLU.js +10 -0
- package/dist/{keycache-BnCTs9sG.js → keycache-DONR-3XM.js} +2 -2
- package/dist/{keys-pbGG00jU.js → keys-KKGS1cpG.js} +2 -2
- package/dist/{kv-p8sC8PTT.d.ts → kv-CyvhW67T.d.ts} +1 -1
- package/dist/{kv-DohFOP2C.js → kv-DosGYGwV.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr-pFHBDU4y.js} +1 -1
- package/dist/{ld-n_kUCeXG.js → ld-DWSCvUJ-.js} +9 -12
- package/dist/{lookup-vJccIKCS.d.ts → lookup-BULfTwGb.d.ts} +2 -2
- package/dist/{lookup-Cutk-FXA.js → lookup-C2TcPqxv.js} +4 -4
- package/dist/{lookup-DrAS097Q.js → lookup-DIQCWtDD.js} +3 -3
- package/dist/{lookup-1pupHJbK.js → lookup-DZBZTzld.js} +6 -6
- package/dist/middleware-BdpSheEs.js +32 -0
- package/dist/{middleware-CMTirIyg.js → middleware-C9cbWvtY.js} +35 -39
- package/dist/middleware-CZQPvn1Y.js +17 -0
- package/dist/{middleware-kjrPMCqA.js → middleware-DRRaBIs3.js} +38 -43
- package/dist/{mod-j45KmAfR.d.ts → mod-C3OG1oK4.d.ts} +4 -4
- package/dist/{mod-DSPyncxx.d.ts → mod-CMpqcqIz.d.ts} +3 -3
- package/dist/mod-zMq7BLOW.d.ts +20 -0
- package/dist/mod.js +17 -17
- package/dist/{mq-nceTGCuc.d.ts → mq-CITHOe0n.d.ts} +1 -1
- package/dist/{multibase-CnLHszip.js → multibase-DBcKTV2a.js} +1 -1
- package/dist/nodeinfo/client.test.js +19 -28
- package/dist/nodeinfo/handler.test.js +37 -44
- package/dist/nodeinfo/mod-DY5OWSvB.d.ts +4 -0
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/semver.test.js +13 -21
- package/dist/nodeinfo/types.test.js +9 -11
- package/dist/{owner-CbRc94FP.d.ts → owner-BPGFI8Z3.d.ts} +4 -4
- package/dist/{owner-c-Zzpacz.js → owner-BSBuyxV4.js} +4 -4
- package/dist/{proof-BTx3Maj-.js → proof-B8LPOkvZ.js} +14 -19
- package/dist/{proof-CTOU2zFF.js → proof-CBHYxfh3.js} +11 -13
- package/dist/{retry-BiIhZWgD.js → retry-BQet39_l.js} +1 -1
- package/dist/{router-D_aVZZUc.js → router-BuDkN4RQ.js} +1 -1
- package/dist/runtime/authdocloader.test.js +22 -26
- package/dist/runtime/docloader.test.js +50 -46
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/{mod-BTHfUeLo.d.ts → runtime/mod-C4NyJ6RS.d.ts} +4 -3
- package/dist/runtime/mod.js +6 -7
- package/dist/runtime/multibase/multibase.test.js +12 -18
- package/dist/runtime/url.test.js +7 -6
- package/dist/{semver-BNrOOAs9.js → semver-D9d-VO-_.js} +7 -17
- package/dist/{send-SniNSIKd.js → send-Cah-Z3UO.js} +4 -4
- package/dist/sig/http.test.js +104 -168
- package/dist/sig/key.test.js +17 -20
- package/dist/sig/ld.test.js +28 -35
- package/dist/sig/mod-DM0ceGER.d.ts +6 -0
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +24 -30
- package/dist/sig/proof.test.js +24 -29
- package/dist/{std__assert-o_r9vqm1.js → std__assert-BdP_WkD-.js} +7 -13
- package/dist/testing/docloader.test.js +9 -12
- package/dist/testing/mod.js +2 -1
- package/dist/{testing-DLyvtiiW.js → testing-qaAD4B0t.js} +2 -2
- package/dist/{transformers-ghwJuzGY.js → transformers-CFSWUhNi.js} +1 -1
- package/dist/{type-CFuiGLz9.js → type-DFsmi-p1.js} +1 -1
- package/dist/{types-DG1qZLU9.js → types-BXvx0wJm.js} +8 -18
- package/dist/{types-CJHS5pXl.js → types-CB_2uuCA.js} +2 -2
- package/dist/{url-C2xuoQD1.js → url-BdNvnK9P.js} +1 -1
- package/dist/vocab/actor.test.js +76 -128
- package/dist/vocab/lookup.test.js +19 -23
- package/dist/vocab/mod-CgB887se.d.ts +6 -0
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +10 -10
- package/dist/vocab/vocab.test.js +109 -105
- package/dist/{vocab-lzEJg2bH.js → vocab-B0flx0SI.js} +328 -464
- package/dist/{vocab-DSFLLLe6.d.ts → vocab-BQaYsnhp.d.ts} +2 -2
- package/dist/{vocab-oKloyO0F.js → vocab-BXeM76FR.js} +5 -5
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod-CE5bmzpH.d.ts +4 -0
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/{cfworkers.d.ts → cfworkers-D_9uuXWs.d.ts} +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/{hono.d.ts → hono-TxxAGdy4.d.ts} +2 -11
- package/dist/x/{sveltekit.d.ts → sveltekit-KCF9gOdN.d.ts} +2 -11
- package/package.json +1 -1
- package/dist/compat/mod.d.ts +0 -15
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/federation/mod.d.ts +0 -15
- package/dist/federation-DyRlaC4X.js +0 -192
- package/dist/key-BP-Oky5H.js +0 -16
- package/dist/key-DxKqQgGm.js +0 -10
- package/dist/middleware-CDYmpOKW.js +0 -33
- package/dist/middleware-CXZvlTVn.js +0 -17
- package/dist/mod-1pDWKvUL.d.ts +0 -2
- package/dist/mod-GIh5OYxW.d.ts +0 -2
- package/dist/mod-g0xFzAP9.d.ts +0 -2
- package/dist/mod.d.ts +0 -20
- package/dist/nodeinfo/mod.d.ts +0 -7
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/sig/mod.d.ts +0 -10
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/vocab/mod.d.ts +0 -8
- package/dist/webfinger/mod.d.ts +0 -7
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/compat/{transformers.test.d.ts → transformers.test-DnJbd34u.d.ts} +0 -0
- /package/dist/{denokv-B_GFWjrl.js → denokv-XeyH3cFs.js} +0 -0
- /package/dist/federation/{builder.test.d.ts → builder.test-Bpt6NOZ6.d.ts} +0 -0
- /package/dist/federation/{collection.test.d.ts → collection.test-DKJ6JOZz.d.ts} +0 -0
- /package/dist/federation/{handler.test.d.ts → handler.test-BMT7uLC0.d.ts} +0 -0
- /package/dist/federation/{inbox.test.d.ts → inbox.test-Do6i02Qp.d.ts} +0 -0
- /package/dist/federation/{keycache.test.d.ts → keycache.test-BT83IPZY.d.ts} +0 -0
- /package/dist/federation/{kv.test.d.ts → kv.test-kFzzF2VN.d.ts} +0 -0
- /package/dist/federation/{middleware.test.d.ts → middleware.test-B1R4_e3-.d.ts} +0 -0
- /package/dist/federation/{mq.test.d.ts → mq.test-l79EQQOe.d.ts} +0 -0
- /package/dist/federation/{retry.test.d.ts → retry.test-BqS50VCX.d.ts} +0 -0
- /package/dist/federation/{router.test.d.ts → router.test-CYQl4po-.d.ts} +0 -0
- /package/dist/federation/{send.test.d.ts → send.test-COUnNUzv.d.ts} +0 -0
- /package/dist/nodeinfo/{client.test.d.ts → client.test-CZLe79hL.d.ts} +0 -0
- /package/dist/nodeinfo/{handler.test.d.ts → handler.test-B-EDZ_hK.d.ts} +0 -0
- /package/dist/nodeinfo/{semver.test.d.ts → semver.test-BEuuQSEM.d.ts} +0 -0
- /package/dist/nodeinfo/{types.test.d.ts → types.test-B5AT89WV.d.ts} +0 -0
- /package/dist/runtime/{authdocloader.test.d.ts → authdocloader.test-hCRKzn9v.d.ts} +0 -0
- /package/dist/runtime/{docloader.test.d.ts → docloader.test-CVd7i_5h.d.ts} +0 -0
- /package/dist/runtime/{key.test.d.ts → key.test-DBsILYSD.d.ts} +0 -0
- /package/dist/runtime/{langstr.test.d.ts → langstr.test-CiKxuuRY.d.ts} +0 -0
- /package/dist/runtime/multibase/{multibase.test.d.ts → multibase.test-Brh6gPBP.d.ts} +0 -0
- /package/dist/runtime/{url.test.d.ts → url.test-DlRqkU2j.d.ts} +0 -0
- /package/dist/sig/{http.test.d.ts → http.test-BpXNAWNI.d.ts} +0 -0
- /package/dist/sig/{key.test.d.ts → key.test-B2iLIugy.d.ts} +0 -0
- /package/dist/sig/{ld.test.d.ts → ld.test-D-cI70Gw.d.ts} +0 -0
- /package/dist/sig/{owner.test.d.ts → owner.test-B_YRjMPj.d.ts} +0 -0
- /package/dist/sig/{proof.test.d.ts → proof.test-BagEM_-4.d.ts} +0 -0
- /package/dist/testing/{docloader.test.d.ts → docloader.test-lrzf6sDZ.d.ts} +0 -0
- /package/dist/testing/{mod.d.ts → mod-3uM8ZvS7.d.ts} +0 -0
- /package/dist/vocab/{actor.test.d.ts → actor.test-ClC-iVWk.d.ts} +0 -0
- /package/dist/vocab/{lookup.test.d.ts → lookup.test-Cq1I-27w.d.ts} +0 -0
- /package/dist/vocab/{type.test.d.ts → type.test-bfFiYGcs.d.ts} +0 -0
- /package/dist/vocab/{vocab.test.d.ts → vocab.test-h-ZTisfu.d.ts} +0 -0
- /package/dist/webfinger/{handler.test.d.ts → handler.test-DiUeEDDD.d.ts} +0 -0
- /package/dist/webfinger/{lookup.test.d.ts → lookup.test-D9onm3U3.d.ts} +0 -0
- /package/dist/x/{cfworkers.test.d.ts → cfworkers.test-KXHlJ29z.d.ts} +0 -0
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { lookupWebFinger } from "./lookup-
|
|
9
|
-
import { getTypeId } from "./type-
|
|
6
|
+
import { d as version, i as getDocumentLoader, u as name } from "./docloader-C8QMM0lt.js";
|
|
7
|
+
import { _ as Object$1 } from "./vocab-B0flx0SI.js";
|
|
8
|
+
import { t as lookupWebFinger } from "./lookup-C2TcPqxv.js";
|
|
9
|
+
import { t as getTypeId } from "./type-DFsmi-p1.js";
|
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
|
11
11
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
12
12
|
import { delay } from "@es-toolkit/es-toolkit";
|
|
@@ -51,7 +51,7 @@ const handleRegexp = /^@?((?:[-A-Za-z0-9._~!$&'()*+,;=]|%[A-Fa-f0-9]{2})+)@([^@]
|
|
|
51
51
|
* @since 0.2.0
|
|
52
52
|
*/
|
|
53
53
|
async function lookupObject(identifier, options = {}) {
|
|
54
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
54
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.lookup_object", async (span) => {
|
|
55
55
|
try {
|
|
56
56
|
const result = await lookupObjectInternal(identifier, options);
|
|
57
57
|
if (result == null) span.setStatus({ code: SpanStatusCode.ERROR });
|
|
@@ -155,4 +155,4 @@ async function* traverseCollection(collection, options = {}) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
//#endregion
|
|
158
|
-
export {
|
|
158
|
+
export { traverseCollection as n, lookupObject as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
5
|
+
|
|
6
|
+
import "./chunk-DvTpRkcT.js";
|
|
7
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "./middleware-C9cbWvtY.js";
|
|
8
|
+
import "./docloader-C8QMM0lt.js";
|
|
9
|
+
import "./url-BdNvnK9P.js";
|
|
10
|
+
import "./semver-D9d-VO-_.js";
|
|
11
|
+
import "./client-C0yKnQtt.js";
|
|
12
|
+
import "./router-BuDkN4RQ.js";
|
|
13
|
+
import "./types-CB_2uuCA.js";
|
|
14
|
+
import "./multibase-DBcKTV2a.js";
|
|
15
|
+
import "./vocab-B0flx0SI.js";
|
|
16
|
+
import "./langstr-pFHBDU4y.js";
|
|
17
|
+
import "./lookup-C2TcPqxv.js";
|
|
18
|
+
import "./actor-CcchiJa2.js";
|
|
19
|
+
import "./key-BABKdX0W.js";
|
|
20
|
+
import "./http-BHjHzW-Y.js";
|
|
21
|
+
import "./authdocloader-1Ja0Him4.js";
|
|
22
|
+
import "./ld-DWSCvUJ-.js";
|
|
23
|
+
import "./owner-BSBuyxV4.js";
|
|
24
|
+
import "./proof-CBHYxfh3.js";
|
|
25
|
+
import "./lookup-DZBZTzld.js";
|
|
26
|
+
import "./inbox-FoFUUhTd.js";
|
|
27
|
+
import "./builder-MOXlzktX.js";
|
|
28
|
+
import "./collection-XNLQhehO.js";
|
|
29
|
+
import "./keycache-DONR-3XM.js";
|
|
30
|
+
import "./send-Cah-Z3UO.js";
|
|
31
|
+
|
|
32
|
+
export { FederationImpl };
|
|
@@ -3,26 +3,26 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { getNodeInfo } from "./client-
|
|
8
|
-
import { RouterError } from "./router-
|
|
9
|
-
import { nodeInfoToJson } from "./types-
|
|
10
|
-
import {
|
|
11
|
-
import { lookupWebFinger } from "./lookup-
|
|
12
|
-
import { getTypeId } from "./type-
|
|
13
|
-
import {
|
|
14
|
-
import { verifyRequest } from "./http-
|
|
15
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { signObject, verifyObject } from "./proof-
|
|
19
|
-
import {
|
|
20
|
-
import { routeActivity } from "./inbox-
|
|
21
|
-
import { FederationBuilderImpl } from "./builder-
|
|
22
|
-
import { buildCollectionSynchronizationHeader } from "./collection-
|
|
23
|
-
import { KvKeyCache } from "./keycache-
|
|
24
|
-
import { createExponentialBackoffPolicy } from "./retry-
|
|
25
|
-
import {
|
|
6
|
+
import { d as version, i as getDocumentLoader, s as kvCache, u as name } from "./docloader-C8QMM0lt.js";
|
|
7
|
+
import { t as getNodeInfo } from "./client-C0yKnQtt.js";
|
|
8
|
+
import { n as RouterError } from "./router-BuDkN4RQ.js";
|
|
9
|
+
import { t as nodeInfoToJson } from "./types-CB_2uuCA.js";
|
|
10
|
+
import { _ as Object$1, b as OrderedCollectionPage, h as Multikey, m as Link, o as CryptographicKey, t as Activity, y as OrderedCollection } from "./vocab-B0flx0SI.js";
|
|
11
|
+
import { t as lookupWebFinger } from "./lookup-C2TcPqxv.js";
|
|
12
|
+
import { t as getTypeId } from "./type-DFsmi-p1.js";
|
|
13
|
+
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-BABKdX0W.js";
|
|
14
|
+
import { l as verifyRequest } from "./http-BHjHzW-Y.js";
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-1Ja0Him4.js";
|
|
16
|
+
import { a as signJsonLd, i as hasSignature, o as verifyJsonLd, r as detachSignature } from "./ld-DWSCvUJ-.js";
|
|
17
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-BSBuyxV4.js";
|
|
18
|
+
import { n as signObject, r as verifyObject } from "./proof-CBHYxfh3.js";
|
|
19
|
+
import { n as traverseCollection, t as lookupObject } from "./lookup-DZBZTzld.js";
|
|
20
|
+
import { n as routeActivity } from "./inbox-FoFUUhTd.js";
|
|
21
|
+
import { t as FederationBuilderImpl } from "./builder-MOXlzktX.js";
|
|
22
|
+
import { t as buildCollectionSynchronizationHeader } from "./collection-XNLQhehO.js";
|
|
23
|
+
import { t as KvKeyCache } from "./keycache-DONR-3XM.js";
|
|
24
|
+
import { t as createExponentialBackoffPolicy } from "./retry-BQet39_l.js";
|
|
25
|
+
import { n as sendActivity, t as extractInboxes } from "./send-Cah-Z3UO.js";
|
|
26
26
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
27
27
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
28
28
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
@@ -129,8 +129,7 @@ function getDefaultActivityTransformers() {
|
|
|
129
129
|
*/
|
|
130
130
|
async function handleNodeInfo(_request, { context: context$1, nodeInfoDispatcher }) {
|
|
131
131
|
const promise = nodeInfoDispatcher(context$1);
|
|
132
|
-
const
|
|
133
|
-
const json = nodeInfoToJson(nodeInfo);
|
|
132
|
+
const json = nodeInfoToJson(promise instanceof Promise ? await promise : promise);
|
|
134
133
|
return new Response(JSON.stringify(json), { headers: { "Content-Type": "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.1#\"" } });
|
|
135
134
|
}
|
|
136
135
|
/**
|
|
@@ -439,10 +438,10 @@ async function handleObject(request, { values, context: context$1, objectDispatc
|
|
|
439
438
|
Vary: "Accept"
|
|
440
439
|
} });
|
|
441
440
|
}
|
|
442
|
-
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
|
443
|
-
const spanName = name.trim().replace(/\s+/g, "_");
|
|
441
|
+
async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
|
442
|
+
const spanName = name$1.trim().replace(/\s+/g, "_");
|
|
444
443
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
445
|
-
const tracer = tracerProvider.getTracer(
|
|
444
|
+
const tracer = tracerProvider.getTracer(name, version);
|
|
446
445
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
447
446
|
if (collectionCallbacks == null) return await onNotFound(request);
|
|
448
447
|
let collection;
|
|
@@ -482,7 +481,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
482
481
|
collection = new OrderedCollection({
|
|
483
482
|
id: baseUri,
|
|
484
483
|
totalItems: totalItems == null ? null : Number(totalItems),
|
|
485
|
-
items: filterCollectionItems(itemsOrResponse, name, filterPredicate)
|
|
484
|
+
items: filterCollectionItems(itemsOrResponse, name$1, filterPredicate)
|
|
486
485
|
});
|
|
487
486
|
} else {
|
|
488
487
|
const lastCursor = await collectionCallbacks.lastCursor?.(context$1, identifier);
|
|
@@ -503,7 +502,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
503
502
|
} else {
|
|
504
503
|
const uri = new URL(baseUri);
|
|
505
504
|
uri.searchParams.set("cursor", cursor);
|
|
506
|
-
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name}`, {
|
|
505
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
|
|
507
506
|
kind: SpanKind.SERVER,
|
|
508
507
|
attributes: {
|
|
509
508
|
"activitypub.collection.id": uri.href,
|
|
@@ -547,7 +546,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
547
546
|
id: uri,
|
|
548
547
|
prev,
|
|
549
548
|
next,
|
|
550
|
-
items: filterCollectionItems(items, name, filterPredicate),
|
|
549
|
+
items: filterCollectionItems(items, name$1, filterPredicate),
|
|
551
550
|
partOf
|
|
552
551
|
});
|
|
553
552
|
}
|
|
@@ -603,7 +602,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
|
603
602
|
return result;
|
|
604
603
|
}
|
|
605
604
|
async function handleInbox(request, options) {
|
|
606
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
605
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
607
606
|
kind: options.queue == null ? SpanKind.SERVER : SpanKind.PRODUCER,
|
|
608
607
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
|
609
608
|
}, async (span) => {
|
|
@@ -1004,7 +1003,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1004
1003
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
1005
1004
|
}
|
|
1006
1005
|
_getTracer() {
|
|
1007
|
-
return this.tracerProvider.getTracer(
|
|
1006
|
+
return this.tracerProvider.getTracer(name, version);
|
|
1008
1007
|
}
|
|
1009
1008
|
async _startQueueInternal(ctxData, signal, queue) {
|
|
1010
1009
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
|
@@ -1474,8 +1473,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1474
1473
|
}
|
|
1475
1474
|
}
|
|
1476
1475
|
fetch(request, options) {
|
|
1477
|
-
|
|
1478
|
-
return withContext({ requestId }, async () => {
|
|
1476
|
+
return withContext({ requestId: getRequestId(request) }, async () => {
|
|
1479
1477
|
const tracer = this._getTracer();
|
|
1480
1478
|
return await tracer.startActiveSpan(request.method, {
|
|
1481
1479
|
kind: SpanKind.SERVER,
|
|
@@ -2077,7 +2075,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2077
2075
|
});
|
|
2078
2076
|
}
|
|
2079
2077
|
sendActivity(sender, recipients, activity, options = {}) {
|
|
2080
|
-
return this.tracerProvider.getTracer(
|
|
2078
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
|
2081
2079
|
kind: this.federation.outboxQueue == null || options.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2082
2080
|
attributes: {
|
|
2083
2081
|
"activitypub.activity.type": getTypeId(activity).href,
|
|
@@ -2222,7 +2220,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2222
2220
|
}
|
|
2223
2221
|
}
|
|
2224
2222
|
routeActivity(recipient, activity, options = {}) {
|
|
2225
|
-
return (this.tracerProvider ?? this.tracerProvider).getTracer(
|
|
2223
|
+
return (this.tracerProvider ?? this.tracerProvider).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
2226
2224
|
kind: this.federation.inboxQueue == null || options.immediate ? SpanKind.INTERNAL : SpanKind.PRODUCER,
|
|
2227
2225
|
attributes: { "activitypub.activity.type": getTypeId(activity).href }
|
|
2228
2226
|
}, async (span) => {
|
|
@@ -2437,7 +2435,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
2437
2435
|
});
|
|
2438
2436
|
}
|
|
2439
2437
|
forwardActivity(forwarder, recipients, options) {
|
|
2440
|
-
return this.tracerProvider.getTracer(
|
|
2438
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan("activitypub.outbox", {
|
|
2441
2439
|
kind: this.federation.outboxQueue == null || options?.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2442
2440
|
attributes: { "activitypub.activity.type": this.activityType }
|
|
2443
2441
|
}, async (span) => {
|
|
@@ -2633,10 +2631,8 @@ function unauthorized(_request) {
|
|
|
2633
2631
|
function getRequestId(request) {
|
|
2634
2632
|
const traceId = request.headers.get("X-Request-Id") || request.headers.get("X-Correlation-Id") || request.headers.get("Traceparent")?.split("-")[1];
|
|
2635
2633
|
if (traceId != null) return traceId;
|
|
2636
|
-
|
|
2637
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
2638
|
-
return `req_${timestamp}${random}`;
|
|
2634
|
+
return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
2639
2635
|
}
|
|
2640
2636
|
|
|
2641
2637
|
//#endregion
|
|
2642
|
-
export {
|
|
2638
|
+
export { autoIdAssigner as _, createFederation as a, handleCollection as c, respondWithObject as d, respondWithObjectIfAcceptable as f, actorDehydrator as g, handleNodeInfoJrd as h, KvSpecDeterminer as i, handleInbox as l, handleNodeInfo as m, FederationImpl as n, acceptsJsonLd as o, handleWebFinger as p, InboxContextImpl as r, handleActor as s, ContextImpl as t, handleObject as u };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
|
|
5
|
+
import "./transformers-CFSWUhNi.js";
|
|
6
|
+
import "./docloader-M1Np6SYc.js";
|
|
7
|
+
import "./actor-_hg-8_KF.js";
|
|
8
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "./middleware-DRRaBIs3.js";
|
|
9
|
+
import "./lookup-DIQCWtDD.js";
|
|
10
|
+
import "./key-Bj3ZyKd0.js";
|
|
11
|
+
import "./http-BDLuDcCk.js";
|
|
12
|
+
import "./proof-B8LPOkvZ.js";
|
|
13
|
+
import "./types-BXvx0wJm.js";
|
|
14
|
+
import "./authdocloader-D0Ds92Vk.js";
|
|
15
|
+
import "./vocab-BXeM76FR.js";
|
|
16
|
+
|
|
17
|
+
export { FederationImpl };
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { getDefaultActivityTransformers } from "./transformers-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { lookupWebFinger } from "./lookup-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { getNodeInfo, nodeInfoToJson } from "./types-
|
|
13
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
14
|
-
import { lookupObject, traverseCollection } from "./vocab-
|
|
5
|
+
import { r as getDefaultActivityTransformers } from "./transformers-CFSWUhNi.js";
|
|
6
|
+
import { d as name, f as version, i as getDocumentLoader, s as kvCache } from "./docloader-M1Np6SYc.js";
|
|
7
|
+
import { G as Multikey, Tt as getTypeId, V as Link, X as OrderedCollectionPage, Y as OrderedCollection, q as Object$1, s as Activity, y as CryptographicKey } from "./actor-_hg-8_KF.js";
|
|
8
|
+
import { t as lookupWebFinger } from "./lookup-DIQCWtDD.js";
|
|
9
|
+
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-Bj3ZyKd0.js";
|
|
10
|
+
import { r as verifyRequest, t as doubleKnock } from "./http-BDLuDcCk.js";
|
|
11
|
+
import { a as doesActorOwnKey, d as signJsonLd, f as verifyJsonLd, l as detachSignature, n as signObject, o as getKeyOwner, r as verifyObject, u as hasSignature } from "./proof-B8LPOkvZ.js";
|
|
12
|
+
import { n as getNodeInfo, t as nodeInfoToJson } from "./types-BXvx0wJm.js";
|
|
13
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-D0Ds92Vk.js";
|
|
14
|
+
import { n as lookupObject, r as traverseCollection } from "./vocab-BXeM76FR.js";
|
|
15
15
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
16
16
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
17
17
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -124,7 +124,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
|
124
124
|
return "enqueued";
|
|
125
125
|
}
|
|
126
126
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
127
|
-
return await tracerProvider.getTracer(
|
|
127
|
+
return await tracerProvider.getTracer(name, version).startActiveSpan("activitypub.dispatch_inbox_listener", { kind: SpanKind.INTERNAL }, async (span$1) => {
|
|
128
128
|
const dispatched = inboxListeners?.dispatchWithClass(activity);
|
|
129
129
|
if (dispatched == null) {
|
|
130
130
|
logger$1.error("Unsupported activity type:\n{activity}", {
|
|
@@ -224,8 +224,8 @@ var Router$1 = class Router$1 {
|
|
|
224
224
|
* @param name The name of the path.
|
|
225
225
|
* @returns `true` if the path name exists, otherwise `false`.
|
|
226
226
|
*/
|
|
227
|
-
has(name) {
|
|
228
|
-
return name in this.#templates;
|
|
227
|
+
has(name$1) {
|
|
228
|
+
return name$1 in this.#templates;
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Adds a new path rule to the router.
|
|
@@ -233,11 +233,11 @@ var Router$1 = class Router$1 {
|
|
|
233
233
|
* @param name The name of the path.
|
|
234
234
|
* @returns The names of the variables in the path pattern.
|
|
235
235
|
*/
|
|
236
|
-
add(template, name) {
|
|
236
|
+
add(template, name$1) {
|
|
237
237
|
if (!template.startsWith("/")) throw new RouterError("Path must start with a slash.");
|
|
238
|
-
const rule = this.#router.addTemplate(template, {}, name);
|
|
239
|
-
this.#templates[name] = parseTemplate(template);
|
|
240
|
-
this.#templateStrings[name] = template;
|
|
238
|
+
const rule = this.#router.addTemplate(template, {}, name$1);
|
|
239
|
+
this.#templates[name$1] = parseTemplate(template);
|
|
240
|
+
this.#templateStrings[name$1] = template;
|
|
241
241
|
return new Set(rule.variables.map((v) => v.varname));
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
@@ -266,8 +266,8 @@ var Router$1 = class Router$1 {
|
|
|
266
266
|
* @param values The values to expand the path with.
|
|
267
267
|
* @returns The URL/path, if the name exists. Otherwise, `null`.
|
|
268
268
|
*/
|
|
269
|
-
build(name, values) {
|
|
270
|
-
if (name in this.#templates) return this.#templates[name].expand(values);
|
|
269
|
+
build(name$1, values) {
|
|
270
|
+
if (name$1 in this.#templates) return this.#templates[name$1].expand(values);
|
|
271
271
|
return null;
|
|
272
272
|
}
|
|
273
273
|
};
|
|
@@ -310,7 +310,7 @@ var FederationBuilderImpl = class {
|
|
|
310
310
|
this.objectTypeIds = {};
|
|
311
311
|
}
|
|
312
312
|
async build(options) {
|
|
313
|
-
const { FederationImpl: FederationImpl$1 } = await import("./middleware-
|
|
313
|
+
const { FederationImpl: FederationImpl$1 } = await import("./middleware-CZQPvn1Y.js");
|
|
314
314
|
const f = new FederationImpl$1(options);
|
|
315
315
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
316
316
|
f.router = this.router.clone();
|
|
@@ -334,7 +334,7 @@ var FederationBuilderImpl = class {
|
|
|
334
334
|
return f;
|
|
335
335
|
}
|
|
336
336
|
_getTracer() {
|
|
337
|
-
return trace.getTracer(
|
|
337
|
+
return trace.getTracer(name, version);
|
|
338
338
|
}
|
|
339
339
|
setActorDispatcher(path, dispatcher) {
|
|
340
340
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
|
@@ -798,8 +798,7 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
798
798
|
const baseUrl = new URL(anyActorId);
|
|
799
799
|
const url = new URL(collectionId);
|
|
800
800
|
url.searchParams.set("base-url", `${baseUrl.origin}/`);
|
|
801
|
-
|
|
802
|
-
return `collectionId="${collectionId}", url="${url}", digest="${hash}"`;
|
|
801
|
+
return `collectionId="${collectionId}", url="${url}", digest="${encodeHex(await digest(actorIds))}"`;
|
|
803
802
|
}
|
|
804
803
|
|
|
805
804
|
//#endregion
|
|
@@ -983,10 +982,10 @@ async function handleObject(request, { values, context: context$1, objectDispatc
|
|
|
983
982
|
Vary: "Accept"
|
|
984
983
|
} });
|
|
985
984
|
}
|
|
986
|
-
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
|
987
|
-
const spanName = name.trim().replace(/\s+/g, "_");
|
|
985
|
+
async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound, onNotAcceptable }) {
|
|
986
|
+
const spanName = name$1.trim().replace(/\s+/g, "_");
|
|
988
987
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
|
989
|
-
const tracer = tracerProvider.getTracer(
|
|
988
|
+
const tracer = tracerProvider.getTracer(name, version);
|
|
990
989
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
991
990
|
if (collectionCallbacks == null) return await onNotFound(request);
|
|
992
991
|
let collection;
|
|
@@ -1026,7 +1025,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1026
1025
|
collection = new OrderedCollection({
|
|
1027
1026
|
id: baseUri,
|
|
1028
1027
|
totalItems: totalItems == null ? null : Number(totalItems),
|
|
1029
|
-
items: filterCollectionItems(itemsOrResponse, name, filterPredicate)
|
|
1028
|
+
items: filterCollectionItems(itemsOrResponse, name$1, filterPredicate)
|
|
1030
1029
|
});
|
|
1031
1030
|
} else {
|
|
1032
1031
|
const lastCursor = await collectionCallbacks.lastCursor?.(context$1, identifier);
|
|
@@ -1047,7 +1046,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1047
1046
|
} else {
|
|
1048
1047
|
const uri = new URL(baseUri);
|
|
1049
1048
|
uri.searchParams.set("cursor", cursor);
|
|
1050
|
-
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name}`, {
|
|
1049
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
|
|
1051
1050
|
kind: SpanKind.SERVER,
|
|
1052
1051
|
attributes: {
|
|
1053
1052
|
"activitypub.collection.id": uri.href,
|
|
@@ -1091,7 +1090,7 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
|
1091
1090
|
id: uri,
|
|
1092
1091
|
prev,
|
|
1093
1092
|
next,
|
|
1094
|
-
items: filterCollectionItems(items, name, filterPredicate),
|
|
1093
|
+
items: filterCollectionItems(items, name$1, filterPredicate),
|
|
1095
1094
|
partOf
|
|
1096
1095
|
});
|
|
1097
1096
|
}
|
|
@@ -1147,7 +1146,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
|
1147
1146
|
return result;
|
|
1148
1147
|
}
|
|
1149
1148
|
async function handleInbox(request, options) {
|
|
1150
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
1149
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
1151
1150
|
kind: options.queue == null ? SpanKind.SERVER : SpanKind.PRODUCER,
|
|
1152
1151
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
|
1153
1152
|
}, async (span) => {
|
|
@@ -1430,8 +1429,7 @@ async function respondWithObjectIfAcceptable(object, request, options) {
|
|
|
1430
1429
|
*/
|
|
1431
1430
|
async function handleNodeInfo(_request, { context: context$1, nodeInfoDispatcher }) {
|
|
1432
1431
|
const promise = nodeInfoDispatcher(context$1);
|
|
1433
|
-
const
|
|
1434
|
-
const json = nodeInfoToJson(nodeInfo);
|
|
1432
|
+
const json = nodeInfoToJson(promise instanceof Promise ? await promise : promise);
|
|
1435
1433
|
return new Response(JSON.stringify(json), { headers: { "Content-Type": "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.1#\"" } });
|
|
1436
1434
|
}
|
|
1437
1435
|
/**
|
|
@@ -1655,7 +1653,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
|
1655
1653
|
*/
|
|
1656
1654
|
function sendActivity(options) {
|
|
1657
1655
|
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
1658
|
-
return tracerProvider.getTracer(
|
|
1656
|
+
return tracerProvider.getTracer(name, version).startActiveSpan("activitypub.send_activity", {
|
|
1659
1657
|
kind: SpanKind.CLIENT,
|
|
1660
1658
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
|
1661
1659
|
}, async (span) => {
|
|
@@ -1863,7 +1861,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1863
1861
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
1864
1862
|
}
|
|
1865
1863
|
_getTracer() {
|
|
1866
|
-
return this.tracerProvider.getTracer(
|
|
1864
|
+
return this.tracerProvider.getTracer(name, version);
|
|
1867
1865
|
}
|
|
1868
1866
|
async _startQueueInternal(ctxData, signal, queue) {
|
|
1869
1867
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
|
@@ -2333,8 +2331,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2333
2331
|
}
|
|
2334
2332
|
}
|
|
2335
2333
|
fetch(request, options) {
|
|
2336
|
-
|
|
2337
|
-
return withContext({ requestId }, async () => {
|
|
2334
|
+
return withContext({ requestId: getRequestId(request) }, async () => {
|
|
2338
2335
|
const tracer = this._getTracer();
|
|
2339
2336
|
return await tracer.startActiveSpan(request.method, {
|
|
2340
2337
|
kind: SpanKind.SERVER,
|
|
@@ -2936,7 +2933,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2936
2933
|
});
|
|
2937
2934
|
}
|
|
2938
2935
|
sendActivity(sender, recipients, activity, options = {}) {
|
|
2939
|
-
return this.tracerProvider.getTracer(
|
|
2936
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
|
2940
2937
|
kind: this.federation.outboxQueue == null || options.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2941
2938
|
attributes: {
|
|
2942
2939
|
"activitypub.activity.type": getTypeId(activity).href,
|
|
@@ -3081,7 +3078,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3081
3078
|
}
|
|
3082
3079
|
}
|
|
3083
3080
|
routeActivity(recipient, activity, options = {}) {
|
|
3084
|
-
return (this.tracerProvider ?? this.tracerProvider).getTracer(
|
|
3081
|
+
return (this.tracerProvider ?? this.tracerProvider).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
3085
3082
|
kind: this.federation.inboxQueue == null || options.immediate ? SpanKind.INTERNAL : SpanKind.PRODUCER,
|
|
3086
3083
|
attributes: { "activitypub.activity.type": getTypeId(activity).href }
|
|
3087
3084
|
}, async (span) => {
|
|
@@ -3296,7 +3293,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
3296
3293
|
});
|
|
3297
3294
|
}
|
|
3298
3295
|
forwardActivity(forwarder, recipients, options) {
|
|
3299
|
-
return this.tracerProvider.getTracer(
|
|
3296
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan("activitypub.outbox", {
|
|
3300
3297
|
kind: this.federation.outboxQueue == null || options?.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
3301
3298
|
attributes: { "activitypub.activity.type": this.activityType }
|
|
3302
3299
|
}, async (span) => {
|
|
@@ -3492,10 +3489,8 @@ function unauthorized(_request) {
|
|
|
3492
3489
|
function getRequestId(request) {
|
|
3493
3490
|
const traceId = request.headers.get("X-Request-Id") || request.headers.get("X-Correlation-Id") || request.headers.get("Traceparent")?.split("-")[1];
|
|
3494
3491
|
if (traceId != null) return traceId;
|
|
3495
|
-
|
|
3496
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
3497
|
-
return `req_${timestamp}${random}`;
|
|
3492
|
+
return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
3498
3493
|
}
|
|
3499
3494
|
|
|
3500
3495
|
//#endregion
|
|
3501
|
-
export {
|
|
3496
|
+
export { createFederation as a, respondWithObjectIfAcceptable as c, createFederationBuilder as d, Router$1 as f, KvSpecDeterminer as i, buildCollectionSynchronizationHeader as l, FederationImpl as n, createExponentialBackoffPolicy as o, RouterError as p, InboxContextImpl as r, respondWithObject as s, ContextImpl as t, digest as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { DocumentLoader } from "./docloader-
|
|
4
|
-
import {
|
|
5
|
-
import { KeyCache } from "./http-
|
|
3
|
+
import { n as DocumentLoader } from "./docloader-DecYq5GI.js";
|
|
4
|
+
import { B as Multikey, H as Object$1, h as DataIntegrityProof, m as CryptographicKey } from "./vocab-BQaYsnhp.js";
|
|
5
|
+
import { l as KeyCache } from "./http-ByqMVN52.js";
|
|
6
6
|
import { TracerProvider } from "@opentelemetry/api";
|
|
7
7
|
|
|
8
8
|
//#region sig/ld.d.ts
|
|
@@ -265,4 +265,4 @@ declare function verifyObject<T extends Object$1>(cls: (new (...args: any[]) =>
|
|
|
265
265
|
fromJsonLd(jsonLd: unknown, options: VerifyObjectOptions): Promise<T>;
|
|
266
266
|
}, jsonLd: unknown, options?: VerifyObjectOptions): Promise<T | null>;
|
|
267
267
|
//#endregion
|
|
268
|
-
export {
|
|
268
|
+
export { verifyJsonLd as _, createProof as a, verifyProof as c, VerifyJsonLdOptions as d, VerifySignatureOptions as f, signJsonLd as g, detachSignature as h, VerifyProofOptions as i, CreateSignatureOptions as l, createSignature as m, SignObjectOptions as n, signObject as o, attachSignature as p, VerifyObjectOptions as r, verifyObject as s, CreateProofOptions as t, SignJsonLdOptions as u, verifySignature as v };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { DocumentLoader, GetUserAgentOptions } from "./docloader-
|
|
4
|
-
import {
|
|
3
|
+
import { n as DocumentLoader, s as GetUserAgentOptions } from "./docloader-DecYq5GI.js";
|
|
4
|
+
import { H as Object$1, I as Link, d as Collection } from "./vocab-BQaYsnhp.js";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
6
6
|
|
|
7
7
|
//#region vocab/lookup.d.ts
|
|
@@ -209,4 +209,4 @@ declare function getTypeId(object: Object$1 | Link | null): URL | null;
|
|
|
209
209
|
*/
|
|
210
210
|
declare function getTypeId(object: Object$1 | Link | null | undefined): URL | null | undefined;
|
|
211
211
|
//#endregion
|
|
212
|
-
export {
|
|
212
|
+
export { lookupObject as a, TraverseCollectionOptions as i, PUBLIC_COLLECTION as n, traverseCollection as o, LookupObjectOptions as r, getTypeId as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
import { i as MemoryKvStore, n as KvStore, r as KvStoreSetOptions, t as KvKey } from "./kv-CyvhW67T.js";
|
|
4
|
+
import { a as FetchError, c as KvCacheParameters, d as getDocumentLoader, f as getUserAgent, i as DocumentLoaderFactoryOptions, l as RemoteDocument, n as DocumentLoader, o as GetDocumentLoaderOptions, p as kvCache, r as DocumentLoaderFactory, s as GetUserAgentOptions, t as AuthenticatedDocumentLoaderFactory, u as fetchDocumentLoader } from "./docloader-DecYq5GI.js";
|
|
5
|
+
import { a as InboundService, c as OutboundService, d as Software, f as Usage, g as parseSemVer, h as formatSemVer, i as parseNodeInfo, l as Protocol, m as SemVer, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-BvbhJik1.js";
|
|
6
|
+
import { $ as Read, A as Image, B as Multikey, C as Event, D as Group, E as Follow, F as Like, G as OrderedCollectionPage, H as Object$1, I as Link, J as Person, K as Organization, L as Listen, M as Invite, N as Join, O as Hashtag, P as Leave, Q as Question, R as Mention, S as Endpoints, T as Flag, U as Offer, V as Note, W as OrderedCollection, X as Profile, Y as Place, Z as PropertyValue, _ as DidService, a as Application, at as TentativeAccept, b as Emoji, c as Audio, ct as Travel, d as Collection, dt as Video, et as Reject, f as CollectionPage, ft as View, g as Delete, h as DataIntegrityProof, i as Announce, it as Source, j as IntransitiveActivity, k as Ignore, l as Block, lt as Undo, m as CryptographicKey, n as Activity, nt as Remove, o as Arrive, ot as TentativeReject, p as Create, pt as LanguageString, q as Page, r as Add, rt as Service, s as Article, st as Tombstone, t as Accept, tt as Relationship, u as ChatMessage, ut as Update, v as Dislike, w as Export, x as EmojiReact, y as Document, z as Move } from "./vocab-BQaYsnhp.js";
|
|
7
|
+
import { a as Recipient, c as getActorTypeName, i as NormalizeActorHandleOptions, l as isActor, n as ActorTypeName, o as getActorClassByTypeName, r as GetActorHandleOptions, s as getActorHandle, t as Actor, u as normalizeActorHandle } from "./actor-5yLVgYbM.js";
|
|
8
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "./http-ByqMVN52.js";
|
|
9
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-BPGFI8Z3.js";
|
|
10
|
+
import { a as lookupObject, i as TraverseCollectionOptions, n as PUBLIC_COLLECTION, o as traverseCollection, r as LookupObjectOptions, t as getTypeId } from "./mod-CMpqcqIz.js";
|
|
11
|
+
import { i as ResourceDescriptor, n as lookupWebFinger } from "./lookup-BULfTwGb.js";
|
|
12
|
+
import { $ as SharedInboxKeyDispatcher, A as Message, B as ActorDispatcher, C as FederationOrigin, D as RetryContext, E as CreateExponentialBackoffPolicyOptions, F as RouterRouteResult, G as CollectionCursor, H as ActorKeyPairsDispatcher, I as RespondWithObjectOptions, J as InboxListener, K as CollectionDispatcher, L as respondWithObject, M as Router, N as RouterError, O as RetryPolicy, P as RouterOptions, Q as OutboxErrorHandler, R as respondWithObjectIfAcceptable, S as FederationKvPrefixes, T as createFederation, U as AuthorizePredicate, V as ActorHandleMapper, W as CollectionCounter, X as ObjectAuthorizePredicate, Y as NodeInfoDispatcher, Z as ObjectDispatcher, _ as FederationOptions, a as InboxContext, b as ObjectCallbackSetters, c as RouteActivityOptions, d as ActorCallbackSetters, et as SenderKeyPair, f as CollectionCallbackSetters, g as FederationFetchOptions, h as FederationBuilder, i as GetSignedKeyOptions, it as ActivityTransformer, j as createFederationBuilder, k as createExponentialBackoffPolicy, l as SendActivityOptions, m as Federation, n as Context, nt as buildCollectionSynchronizationHeader, o as ParseUriResult, p as Federatable, q as InboxErrorHandler, r as ForwardActivityOptions, rt as digest, s as RequestContext, t as ActorKeyPair, tt as PageItems, u as SendActivityOptionsForCollection, v as FederationStartQueueOptions, w as FederationQueueOptions, x as CreateFederationOptions, y as InboxListenerSetters, z as ActorAliasMapper } from "./context-C0X9n1tC.js";
|
|
13
|
+
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq-CITHOe0n.js";
|
|
14
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod-MHHm8HmK.js";
|
|
15
|
+
import "./federation/mod-CLkToKJa.js";
|
|
16
|
+
import "./nodeinfo/mod-DY5OWSvB.js";
|
|
17
|
+
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod-C4NyJ6RS.js";
|
|
18
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod-C3OG1oK4.js";
|
|
19
|
+
import "./webfinger/mod-CE5bmzpH.js";
|
|
20
|
+
export { Accept, Activity, ActivityTransformer, Actor, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, AuthenticatedDocumentLoaderFactory, AuthorizePredicate, Block, ChatMessage, Collection, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, CollectionPage, Context, Create, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, CreateProofOptions, CreateSignatureOptions, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, DocumentLoader, DocumentLoaderFactory, DocumentLoaderFactoryOptions, DoesActorOwnKeyOptions, Emoji, EmojiReact, Endpoints, Event, Export, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchError, FetchKeyOptions, FetchKeyResult, Flag, Follow, ForwardActivityOptions, GetActorHandleOptions, GetAuthenticatedDocumentLoaderOptions, GetDocumentLoaderOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, GetUserAgentOptions, Group, Hashtag, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, Ignore, Image, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, IntransitiveActivity, Invite, Join, JsonValue, KeyCache, KvCacheParameters, KvKey, KvStore, KvStoreSetOptions, LanguageString, Leave, Like, Link, Listen, LookupObjectOptions, MemoryKvStore, Mention, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, Move, Multikey, NodeInfo, NodeInfoDispatcher, NormalizeActorHandleOptions, Note, Object$1 as Object, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, Offer, OrderedCollection, OrderedCollectionPage, Organization, OutboundService, OutboxErrorHandler, PUBLIC_COLLECTION, Page, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Person, Place, Profile, PropertyValue, Protocol, Question, Read, Recipient, Reject, Relationship, RemoteDocument, Remove, RequestContext, type ResourceDescriptor, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SemVer, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Service, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, Video, View, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey, formatSemVer, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getDocumentLoader, getKeyOwner, getNodeInfo, getTypeId, getUserAgent, importJwk, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseNodeInfo, parseSemVer, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/mod.js
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import "./compat
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { lookupWebFinger } from "./lookup-
|
|
11
|
-
import {
|
|
12
|
-
import { signRequest, verifyRequest } from "./http-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import "./nodeinfo
|
|
19
|
-
import "./runtime
|
|
20
|
-
import "./sig
|
|
21
|
-
import "./webfinger
|
|
5
|
+
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-CFSWUhNi.js";
|
|
6
|
+
import "./compat/mod.js";
|
|
7
|
+
import { i as getDocumentLoader, o as getUserAgent, r as fetchDocumentLoader, s as kvCache, t as FetchError } from "./docloader-M1Np6SYc.js";
|
|
8
|
+
import { $ as Person, A as Flag, B as Like, C as Dislike, Ct as importPkcs1, D as Endpoints, E as EmojiReact, F as Image, G as Multikey, H as Listen, I as IntransitiveActivity, J as Offer, K as Note, L as Invite, M as Group, N as Hashtag, O as Event, P as Ignore, Q as Page, R as Join, S as DidService, St as importPem, T as Emoji, Tt as getTypeId, U as Mention, V as Link, W as Move, X as OrderedCollectionPage, Y as OrderedCollection, Z as Organization, _ as CollectionPage, _t as View, a as normalizeActorHandle, at as Reject, b as DataIntegrityProof, bt as exportSpki, c as Add, ct as Service, d as Arrive, dt as TentativeReject, et as Place, f as Article, ft as Tombstone, g as Collection, gt as Video, h as ChatMessage, ht as Update, i as isActor, it as Read, j as Follow, k as Export, l as Announce, lt as Source, m as Block, mt as Undo, n as getActorHandle, nt as PropertyValue, o as Accept, ot as Relationship, p as Audio, pt as Travel, q as Object$1, r as getActorTypeName, rt as Question, s as Activity, st as Remove, t as getActorClassByTypeName, tt as Profile, u as Application, ut as TentativeAccept, v as Create, vt as LanguageString, w as Document, wt as importSpki, x as Delete, xt as importMultibaseKey, y as CryptographicKey, yt as exportMultibaseKey, z as Leave } from "./actor-_hg-8_KF.js";
|
|
9
|
+
import { a as createFederation, c as respondWithObjectIfAcceptable, d as createFederationBuilder, f as Router, l as buildCollectionSynchronizationHeader, o as createExponentialBackoffPolicy, p as RouterError, s as respondWithObject, u as digest } from "./middleware-DRRaBIs3.js";
|
|
10
|
+
import { t as lookupWebFinger } from "./lookup-DIQCWtDD.js";
|
|
11
|
+
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "./key-Bj3ZyKd0.js";
|
|
12
|
+
import { n as signRequest, r as verifyRequest } from "./http-BDLuDcCk.js";
|
|
13
|
+
import { a as doesActorOwnKey, c as createSignature, d as signJsonLd, f as verifyJsonLd, i as verifyProof, l as detachSignature, n as signObject, o as getKeyOwner, p as verifySignature, r as verifyObject, s as attachSignature, t as createProof } from "./proof-B8LPOkvZ.js";
|
|
14
|
+
import { a as parseSemVer, i as formatSemVer, n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-BXvx0wJm.js";
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-D0Ds92Vk.js";
|
|
16
|
+
import { n as lookupObject, r as traverseCollection, t as PUBLIC_COLLECTION } from "./vocab-BXeM76FR.js";
|
|
17
|
+
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
|
|
18
|
+
import "./nodeinfo/mod.js";
|
|
19
|
+
import "./runtime/mod.js";
|
|
20
|
+
import "./sig/mod.js";
|
|
21
|
+
import "./webfinger/mod.js";
|
|
22
22
|
|
|
23
23
|
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FetchError, Flag, Follow, Group, Hashtag, Ignore, Image, InProcessMessageQueue, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, MemoryKvStore, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, ParallelMessageQueue, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Router, RouterError, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, exportMultibaseKey, exportSpki, fetchDocumentLoader, fetchKey, formatSemVer, generateCryptoKeyPair, getActorClassByTypeName, getActorHandle, getActorTypeName, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getDocumentLoader, getKeyOwner, getNodeInfo, getTypeId, getUserAgent, importJwk, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, kvCache, lookupObject, lookupWebFinger, nodeInfoToJson, normalizeActorHandle, parseNodeInfo, parseSemVer, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, traverseCollection, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
|
@@ -120,4 +120,4 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
120
120
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
121
121
|
}
|
|
122
122
|
//#endregion
|
|
123
|
-
export {
|
|
123
|
+
export { MessageQueueListenOptions as a, MessageQueueEnqueueOptions as i, InProcessMessageQueueOptions as n, ParallelMessageQueue as o, MessageQueue as r, InProcessMessageQueue as t };
|