@fedify/fedify 1.7.12 → 1.7.14
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-CPpvuBKU.d.ts → actor-Dx5YX74F.d.ts} +3 -3
- package/dist/{actor-GZRoTRqg.js → actor-OYVgkiZG.js} +329 -465
- package/dist/{actor-TYqJGdVq.js → actor-y7shp0CR.js} +6 -6
- 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-hiFSyM7V.js → authdocloader-C0JcfxUs.js} +7 -9
- package/dist/{authdocloader-BopfyipD.js → authdocloader-C2krvRo1.js} +6 -8
- package/dist/{builder-mi6RdzNE.js → builder-DaECqbbT.js} +7 -7
- package/dist/{chunk-Cx8LTkjm.js → chunk-DvTpRkcT.js} +22 -15
- package/dist/{client-DuUKk4pk.js → client-dfu57WLy.js} +3 -3
- package/dist/{client-DvtwXO7t.d.ts → client-wKLuY12i.d.ts} +2 -2
- package/dist/{collection-Dfb0TPno.js → collection-XNLQhehO.js} +2 -3
- package/dist/{mod-DFncUgcE.d.ts → compat/mod-Bwqav33K.d.ts} +3 -3
- package/dist/compat/mod.js +1 -2
- package/dist/compat/transformers.test.js +34 -38
- package/dist/{context-OBWjptjU.d.ts → context-CW_8R4BH.d.ts} +11 -11
- package/dist/{context-RMU32mk4.js → context-nxDPfAiA.js} +5 -5
- package/dist/{docloader-09nVWLAZ.js → docloader-BDSHZfTJ.js} +1 -1
- package/dist/{docloader-DJxET2fN.js → docloader-BU25UQLB.js} +31 -151
- package/dist/{docloader-Q42SMRIB.d.ts → docloader-D_MGP37Q.d.ts} +2 -2
- package/dist/{docloader-bgBm1Hd1.js → docloader-sGz4vcrK.js} +32 -152
- 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 +105 -134
- package/dist/federation/mod-DvlLc8Ru.d.ts +6 -0
- package/dist/federation/mod.js +206 -12
- package/dist/federation/mq.test.js +12 -17
- 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-D2DkwsjA.js → http-BhES0Sg9.js} +23 -30
- package/dist/{http-DMTrO3Ye.d.ts → http-DFZRNfDP.d.ts} +3 -3
- package/dist/{http-vqMAvOVs.js → http-DRePVWfE.js} +23 -30
- package/dist/{inbox-DAAZZl2k.js → inbox-Z_QlSGYN.js} +5 -5
- package/dist/key-CJuc1GE1.js +10 -0
- package/dist/{key-DmqJj57e.js → key-D2HZrCxh.js} +4 -4
- package/dist/{key-KVhaUM92.js → key-bMrDyA2T.js} +5 -5
- package/dist/key-eP5Yk7hl.js +16 -0
- package/dist/{keycache-C1pEuRyQ.js → keycache-B5Rr8Lbc.js} +2 -2
- package/dist/{keys-C4XQHW5_.js → keys-DK4k1R8e.js} +2 -2
- package/dist/{kv-DRaeSXco.d.ts → kv-CKqSUxHd.d.ts} +1 -1
- package/dist/{kv-BMY6Qf_A.js → kv-QeuZ51go.js} +1 -1
- package/dist/{langstr-DbWheeIS.js → langstr-pFHBDU4y.js} +1 -1
- package/dist/{ld-DzlJ_IpT.js → ld--auFISy7.js} +9 -12
- package/dist/{lookup-CSngxuWm.js → lookup-4uc2jh52.js} +3 -3
- package/dist/{lookup-DL62q3Xh.js → lookup-Bq8vhIG4.js} +4 -4
- package/dist/{lookup-Bf-K85bV.d.ts → lookup-CqI9jhXo.d.ts} +2 -2
- package/dist/{lookup-D0je8AqR.js → lookup-cHV4n1IB.js} +6 -6
- package/dist/middleware-72Tuh6Iw.js +17 -0
- package/dist/{middleware-3wVT6S9E.js → middleware-B7p-onxQ.js} +35 -39
- package/dist/middleware-DB3BUysJ.js +32 -0
- package/dist/{middleware-DlDXugwZ.js → middleware-QJjRfjjc.js} +38 -43
- package/dist/{mod-CCL2cvnI.d.ts → mod-BEZy4WHZ.d.ts} +4 -4
- package/dist/mod-DMn4Bxyg.d.ts +20 -0
- package/dist/{mod-CDzlVCUF.d.ts → mod-DjGYGrBd.d.ts} +3 -3
- package/dist/mod.js +17 -17
- package/dist/{mq-DYKDDJmp.d.ts → mq-Cgfbl44M.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--upgPcaX.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-D0cOz8R5.d.ts → owner-CewLNqWO.d.ts} +4 -4
- package/dist/{owner-81ey_76X.js → owner-DkTRLQAV.js} +4 -4
- package/dist/{proof-DlI7QNdn.js → proof-D4HXHDPz.js} +14 -19
- package/dist/{proof-BlULDH4H.js → proof-DT_xxRPF.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 +56 -56
- package/dist/runtime/key.test.js +31 -53
- package/dist/runtime/langstr.test.js +8 -10
- package/dist/{mod-qFMzZ3iF.d.ts → runtime/mod-BaH1vtHp.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-DdxfTHo6.js → send-axIyQX2p.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-BmJQTnPT.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-CmVV9LT1.js → types-Bk4b1bGc.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-BkXGAYkx.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-DFlq4Wa6.js → vocab-DCHRuBGF.js} +328 -464
- package/dist/{vocab-CzEfWQk2.d.ts → vocab-DoBcp8ow.d.ts} +2 -2
- package/dist/{vocab-BebR0kAy.js → vocab-sMuiKIWm.js} +5 -5
- package/dist/webfinger/handler.test.js +40 -48
- package/dist/webfinger/lookup.test.js +12 -15
- package/dist/webfinger/mod-B1UhCvlL.d.ts +4 -0
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/{cfworkers.d.ts → cfworkers-BIcR64Sf.d.ts} +2 -2
- package/dist/x/cfworkers.test.js +7 -9
- package/dist/x/{hono.d.ts → hono-DmQmp8wi.d.ts} +2 -11
- package/dist/x/{sveltekit.d.ts → sveltekit-Cvh0XnN4.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-B0aljx0V.js +0 -203
- package/dist/key-5ssHQ67E.js +0 -16
- package/dist/key-DSJGnD10.js +0 -10
- package/dist/middleware-CxFoFBD8.js +0 -33
- package/dist/middleware-w7_U3fFi.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-CvROlGYX.js → denokv-NcJeZ6rP.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,8 +3,8 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { d as version, o as getUserAgent, u as name } from "./docloader-sGz4vcrK.js";
|
|
7
|
+
import { a as validatePublicUrl, t as UrlError } from "./url-BdNvnK9P.js";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ const MAX_REDIRECTION = 5;
|
|
|
23
23
|
* @since 0.2.0
|
|
24
24
|
*/
|
|
25
25
|
async function lookupWebFinger(resource, options = {}) {
|
|
26
|
-
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(
|
|
26
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("webfinger.lookup", {
|
|
27
27
|
kind: SpanKind.CLIENT,
|
|
28
28
|
attributes: {
|
|
29
29
|
"webfinger.resource": resource.toString(),
|
|
@@ -126,4 +126,4 @@ async function lookupWebFingerInternal(resource, options = {}) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
//#endregion
|
|
129
|
-
export { lookupWebFinger };
|
|
129
|
+
export { lookupWebFinger as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { GetUserAgentOptions } from "./docloader-
|
|
3
|
+
import { s as GetUserAgentOptions } from "./docloader-D_MGP37Q.js";
|
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
|
5
5
|
|
|
6
6
|
//#region webfinger/jrd.d.ts
|
|
@@ -93,4 +93,4 @@ interface LookupWebFingerOptions {
|
|
|
93
93
|
*/
|
|
94
94
|
declare function lookupWebFinger(resource: URL | string, options?: LookupWebFingerOptions): Promise<ResourceDescriptor | null>;
|
|
95
95
|
//#endregion
|
|
96
|
-
export {
|
|
96
|
+
export { ResourceDescriptor as i, lookupWebFinger as n, Link as r, LookupWebFingerOptions as t };
|
|
@@ -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-sGz4vcrK.js";
|
|
7
|
+
import { _ as Object$1 } from "./vocab-DCHRuBGF.js";
|
|
8
|
+
import { t as lookupWebFinger } from "./lookup-Bq8vhIG4.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,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
|
|
5
|
+
import "./transformers-CFSWUhNi.js";
|
|
6
|
+
import "./docloader-BU25UQLB.js";
|
|
7
|
+
import "./actor-OYVgkiZG.js";
|
|
8
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "./middleware-QJjRfjjc.js";
|
|
9
|
+
import "./lookup-4uc2jh52.js";
|
|
10
|
+
import "./key-D2HZrCxh.js";
|
|
11
|
+
import "./http-DRePVWfE.js";
|
|
12
|
+
import "./proof-D4HXHDPz.js";
|
|
13
|
+
import "./types-Bk4b1bGc.js";
|
|
14
|
+
import "./authdocloader-C2krvRo1.js";
|
|
15
|
+
import "./vocab-sMuiKIWm.js";
|
|
16
|
+
|
|
17
|
+
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-sGz4vcrK.js";
|
|
7
|
+
import { t as getNodeInfo } from "./client-dfu57WLy.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-DCHRuBGF.js";
|
|
11
|
+
import { t as lookupWebFinger } from "./lookup-Bq8vhIG4.js";
|
|
12
|
+
import { t as getTypeId } from "./type-DFsmi-p1.js";
|
|
13
|
+
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-bMrDyA2T.js";
|
|
14
|
+
import { l as verifyRequest } from "./http-BhES0Sg9.js";
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-C0JcfxUs.js";
|
|
16
|
+
import { a as signJsonLd, i as hasSignature, o as verifyJsonLd, r as detachSignature } from "./ld--auFISy7.js";
|
|
17
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DkTRLQAV.js";
|
|
18
|
+
import { n as signObject, r as verifyObject } from "./proof-DT_xxRPF.js";
|
|
19
|
+
import { n as traverseCollection, t as lookupObject } from "./lookup-cHV4n1IB.js";
|
|
20
|
+
import { n as routeActivity } from "./inbox-Z_QlSGYN.js";
|
|
21
|
+
import { t as FederationBuilderImpl } from "./builder-DaECqbbT.js";
|
|
22
|
+
import { t as buildCollectionSynchronizationHeader } from "./collection-XNLQhehO.js";
|
|
23
|
+
import { t as KvKeyCache } from "./keycache-B5Rr8Lbc.js";
|
|
24
|
+
import { t as createExponentialBackoffPolicy } from "./retry-BQet39_l.js";
|
|
25
|
+
import { n as sendActivity, t as extractInboxes } from "./send-axIyQX2p.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) => {
|
|
@@ -1006,7 +1005,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1006
1005
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
1007
1006
|
}
|
|
1008
1007
|
_getTracer() {
|
|
1009
|
-
return this.tracerProvider.getTracer(
|
|
1008
|
+
return this.tracerProvider.getTracer(name, version);
|
|
1010
1009
|
}
|
|
1011
1010
|
async _startQueueInternal(ctxData, signal, queue) {
|
|
1012
1011
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
|
@@ -1497,8 +1496,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1497
1496
|
}
|
|
1498
1497
|
}
|
|
1499
1498
|
fetch(request, options) {
|
|
1500
|
-
|
|
1501
|
-
return withContext({ requestId }, async () => {
|
|
1499
|
+
return withContext({ requestId: getRequestId(request) }, async () => {
|
|
1502
1500
|
const tracer = this._getTracer();
|
|
1503
1501
|
return await tracer.startActiveSpan(request.method, {
|
|
1504
1502
|
kind: SpanKind.SERVER,
|
|
@@ -2100,7 +2098,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2100
2098
|
});
|
|
2101
2099
|
}
|
|
2102
2100
|
sendActivity(sender, recipients, activity, options = {}) {
|
|
2103
|
-
return this.tracerProvider.getTracer(
|
|
2101
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
|
2104
2102
|
kind: this.federation.outboxQueue == null || options.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2105
2103
|
attributes: {
|
|
2106
2104
|
"activitypub.activity.type": getTypeId(activity).href,
|
|
@@ -2245,7 +2243,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2245
2243
|
}
|
|
2246
2244
|
}
|
|
2247
2245
|
routeActivity(recipient, activity, options = {}) {
|
|
2248
|
-
return (this.tracerProvider ?? this.tracerProvider).getTracer(
|
|
2246
|
+
return (this.tracerProvider ?? this.tracerProvider).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
2249
2247
|
kind: this.federation.inboxQueue == null || options.immediate ? SpanKind.INTERNAL : SpanKind.PRODUCER,
|
|
2250
2248
|
attributes: { "activitypub.activity.type": getTypeId(activity).href }
|
|
2251
2249
|
}, async (span) => {
|
|
@@ -2460,7 +2458,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
2460
2458
|
});
|
|
2461
2459
|
}
|
|
2462
2460
|
forwardActivity(forwarder, recipients, options) {
|
|
2463
|
-
return this.tracerProvider.getTracer(
|
|
2461
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan("activitypub.outbox", {
|
|
2464
2462
|
kind: this.federation.outboxQueue == null || options?.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2465
2463
|
attributes: { "activitypub.activity.type": this.activityType }
|
|
2466
2464
|
}, async (span) => {
|
|
@@ -2656,10 +2654,8 @@ function unauthorized(_request) {
|
|
|
2656
2654
|
function getRequestId(request) {
|
|
2657
2655
|
const traceId = request.headers.get("X-Request-Id") || request.headers.get("X-Correlation-Id") || request.headers.get("Traceparent")?.split("-")[1];
|
|
2658
2656
|
if (traceId != null) return traceId;
|
|
2659
|
-
|
|
2660
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
2661
|
-
return `req_${timestamp}${random}`;
|
|
2657
|
+
return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
2662
2658
|
}
|
|
2663
2659
|
|
|
2664
2660
|
//#endregion
|
|
2665
|
-
export {
|
|
2661
|
+
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,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-B7p-onxQ.js";
|
|
8
|
+
import "./docloader-sGz4vcrK.js";
|
|
9
|
+
import "./url-BdNvnK9P.js";
|
|
10
|
+
import "./semver-D9d-VO-_.js";
|
|
11
|
+
import "./client-dfu57WLy.js";
|
|
12
|
+
import "./router-BuDkN4RQ.js";
|
|
13
|
+
import "./types-CB_2uuCA.js";
|
|
14
|
+
import "./multibase-DBcKTV2a.js";
|
|
15
|
+
import "./vocab-DCHRuBGF.js";
|
|
16
|
+
import "./langstr-pFHBDU4y.js";
|
|
17
|
+
import "./lookup-Bq8vhIG4.js";
|
|
18
|
+
import "./actor-y7shp0CR.js";
|
|
19
|
+
import "./key-bMrDyA2T.js";
|
|
20
|
+
import "./http-BhES0Sg9.js";
|
|
21
|
+
import "./authdocloader-C0JcfxUs.js";
|
|
22
|
+
import "./ld--auFISy7.js";
|
|
23
|
+
import "./owner-DkTRLQAV.js";
|
|
24
|
+
import "./proof-DT_xxRPF.js";
|
|
25
|
+
import "./lookup-cHV4n1IB.js";
|
|
26
|
+
import "./inbox-Z_QlSGYN.js";
|
|
27
|
+
import "./builder-DaECqbbT.js";
|
|
28
|
+
import "./collection-XNLQhehO.js";
|
|
29
|
+
import "./keycache-B5Rr8Lbc.js";
|
|
30
|
+
import "./send-axIyQX2p.js";
|
|
31
|
+
|
|
32
|
+
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-BU25UQLB.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-OYVgkiZG.js";
|
|
8
|
+
import { t as lookupWebFinger } from "./lookup-4uc2jh52.js";
|
|
9
|
+
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-D2HZrCxh.js";
|
|
10
|
+
import { r as verifyRequest, t as doubleKnock } from "./http-DRePVWfE.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-D4HXHDPz.js";
|
|
12
|
+
import { n as getNodeInfo, t as nodeInfoToJson } from "./types-Bk4b1bGc.js";
|
|
13
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-C2krvRo1.js";
|
|
14
|
+
import { n as lookupObject, r as traverseCollection } from "./vocab-sMuiKIWm.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-72Tuh6Iw.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) => {
|
|
@@ -1865,7 +1863,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1865
1863
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
|
1866
1864
|
}
|
|
1867
1865
|
_getTracer() {
|
|
1868
|
-
return this.tracerProvider.getTracer(
|
|
1866
|
+
return this.tracerProvider.getTracer(name, version);
|
|
1869
1867
|
}
|
|
1870
1868
|
async _startQueueInternal(ctxData, signal, queue) {
|
|
1871
1869
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
|
@@ -2356,8 +2354,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2356
2354
|
}
|
|
2357
2355
|
}
|
|
2358
2356
|
fetch(request, options) {
|
|
2359
|
-
|
|
2360
|
-
return withContext({ requestId }, async () => {
|
|
2357
|
+
return withContext({ requestId: getRequestId(request) }, async () => {
|
|
2361
2358
|
const tracer = this._getTracer();
|
|
2362
2359
|
return await tracer.startActiveSpan(request.method, {
|
|
2363
2360
|
kind: SpanKind.SERVER,
|
|
@@ -2959,7 +2956,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2959
2956
|
});
|
|
2960
2957
|
}
|
|
2961
2958
|
sendActivity(sender, recipients, activity, options = {}) {
|
|
2962
|
-
return this.tracerProvider.getTracer(
|
|
2959
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
|
2963
2960
|
kind: this.federation.outboxQueue == null || options.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
2964
2961
|
attributes: {
|
|
2965
2962
|
"activitypub.activity.type": getTypeId(activity).href,
|
|
@@ -3104,7 +3101,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3104
3101
|
}
|
|
3105
3102
|
}
|
|
3106
3103
|
routeActivity(recipient, activity, options = {}) {
|
|
3107
|
-
return (this.tracerProvider ?? this.tracerProvider).getTracer(
|
|
3104
|
+
return (this.tracerProvider ?? this.tracerProvider).getTracer(name, version).startActiveSpan("activitypub.inbox", {
|
|
3108
3105
|
kind: this.federation.inboxQueue == null || options.immediate ? SpanKind.INTERNAL : SpanKind.PRODUCER,
|
|
3109
3106
|
attributes: { "activitypub.activity.type": getTypeId(activity).href }
|
|
3110
3107
|
}, async (span) => {
|
|
@@ -3319,7 +3316,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
3319
3316
|
});
|
|
3320
3317
|
}
|
|
3321
3318
|
forwardActivity(forwarder, recipients, options) {
|
|
3322
|
-
return this.tracerProvider.getTracer(
|
|
3319
|
+
return this.tracerProvider.getTracer(name, version).startActiveSpan("activitypub.outbox", {
|
|
3323
3320
|
kind: this.federation.outboxQueue == null || options?.immediate ? SpanKind.CLIENT : SpanKind.PRODUCER,
|
|
3324
3321
|
attributes: { "activitypub.activity.type": this.activityType }
|
|
3325
3322
|
}, async (span) => {
|
|
@@ -3515,10 +3512,8 @@ function unauthorized(_request) {
|
|
|
3515
3512
|
function getRequestId(request) {
|
|
3516
3513
|
const traceId = request.headers.get("X-Request-Id") || request.headers.get("X-Correlation-Id") || request.headers.get("Traceparent")?.split("-")[1];
|
|
3517
3514
|
if (traceId != null) return traceId;
|
|
3518
|
-
|
|
3519
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
3520
|
-
return `req_${timestamp}${random}`;
|
|
3515
|
+
return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
|
|
3521
3516
|
}
|
|
3522
3517
|
|
|
3523
3518
|
//#endregion
|
|
3524
|
-
export {
|
|
3519
|
+
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-D_MGP37Q.js";
|
|
4
|
+
import { B as Multikey, H as Object$1, h as DataIntegrityProof, m as CryptographicKey } from "./vocab-DoBcp8ow.js";
|
|
5
|
+
import { l as KeyCache } from "./http-DFZRNfDP.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 };
|
|
@@ -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-CKqSUxHd.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-D_MGP37Q.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-wKLuY12i.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-DoBcp8ow.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-Dx5YX74F.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-DFZRNfDP.js";
|
|
9
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CewLNqWO.js";
|
|
10
|
+
import { a as lookupObject, i as TraverseCollectionOptions, n as PUBLIC_COLLECTION, o as traverseCollection, r as LookupObjectOptions, t as getTypeId } from "./mod-DjGYGrBd.js";
|
|
11
|
+
import { i as ResourceDescriptor, n as lookupWebFinger } from "./lookup-CqI9jhXo.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-CW_8R4BH.js";
|
|
13
|
+
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq-Cgfbl44M.js";
|
|
14
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod-Bwqav33K.js";
|
|
15
|
+
import "./federation/mod-DvlLc8Ru.js";
|
|
16
|
+
import "./nodeinfo/mod--upgPcaX.js";
|
|
17
|
+
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod-BaH1vtHp.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-BEZy4WHZ.js";
|
|
19
|
+
import "./webfinger/mod-B1UhCvlL.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 };
|
|
@@ -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-D_MGP37Q.js";
|
|
4
|
+
import { H as Object$1, I as Link, d as Collection } from "./vocab-DoBcp8ow.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 };
|