@fedify/fedify 2.0.0-pr.445.1694 → 2.0.0-pr.451.1730
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-T6RyhRgk.d.ts → actor-Cd2CREO0.d.ts} +2 -2
- package/dist/{actor-D8gCwLzv.js → actor-Cg8ZhoVF.js} +1 -1
- package/dist/{actor-CwZ2m5rG.cjs → actor-D020hlx3.cjs} +922 -1451
- package/dist/{actor-D6K058Tb.d.cts → actor-DDhZuMGl.d.cts} +2 -2
- package/dist/{actor-DoMcqXsW.js → actor-DPD6Gbdn.js} +190 -677
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
- package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
- package/dist/{builder-1_skw-d2.js → builder-Dn87hy75.js} +7 -8
- package/dist/{client-bgSdkFa2.d.ts → client-Bkaw0_PR.d.ts} +1 -1
- package/dist/{client-CegPX0Rn.d.cts → client-Cle5j1T1.d.cts} +1 -1
- package/dist/{client-D5CBsPrc.js → client-D6-5okV1.js} +1 -1
- package/dist/compat/mod.d.cts +11 -11
- package/dist/compat/mod.d.ts +12 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-DiqjMRef.d.cts → context-BOYzcFSe.d.cts} +130 -97
- package/dist/{context-DBKpNBnc.d.ts → context-DqFifMwj.d.ts} +131 -98
- package/dist/{authdocloader-DYTNpaMA.js → docloader-B2BFBGqv.js} +18 -8
- package/dist/{esm-Dl5T1RNE.js → esm-CU0Dnk7T.js} +11 -11
- package/dist/federation/builder.test.js +8 -10
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +25 -26
- package/dist/federation/idempotency.test.js +25 -26
- package/dist/federation/inbox.test.js +4 -6
- package/dist/federation/keycache.test.js +3 -4
- package/dist/federation/kv.test.js +6 -8
- package/dist/federation/middleware.test.js +26 -27
- package/dist/federation/mod.cjs +10 -11
- package/dist/federation/mod.d.cts +11 -11
- package/dist/federation/mod.d.ts +13 -13
- package/dist/federation/mod.js +10 -11
- package/dist/federation/mq.test.js +8 -10
- package/dist/federation/negotiation.test.js +7 -9
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +13 -15
- package/dist/{http-D-e6AFwR.d.cts → http-B6SKO6NJ.d.cts} +2 -2
- package/dist/{http-D6Uj2x2y.d.ts → http-BE7aFuqn.d.ts} +2 -2
- package/dist/{http-CAusBl_3.cjs → http-DMsjudj8.cjs} +289 -9
- package/dist/{http-CuS-d4U0.js → http-DN0v2zoF.js} +2 -2
- package/dist/{http-C_Qc2neP.js → http-DcDb8r1W.js} +256 -6
- package/dist/{inbox-IETv_Qez.js → inbox-CgGy7Hzc.js} +1 -1
- package/dist/{key-DnqhSgAv.js → key-jSvnymAk.js} +3 -2
- package/dist/{keycache-CSBkusP8.js → keycache-IVLjlAK9.js} +1 -1
- package/dist/{keys-D3_MDK7n.js → keys-BKM2Mqu2.js} +2 -1
- package/dist/{docloader-CYnQRIXv.cjs → kv-cache-BHIupktM.cjs} +69 -651
- package/dist/kv-cache-DNvS-egZ.js +4236 -0
- package/dist/{docloader-Czl3xV10.js → kv-cache-ydIs4Ul6.js} +68 -596
- package/dist/{ld-Isot0tiW.js → ld-CcsryBo0.js} +3 -2
- package/dist/{lookup-Dhm78GlK.js → lookup-BV3A9Zbc.js} +63 -2
- package/dist/{type-DaUr3Il7.js → lookup-BbEekiru.js} +588 -5303
- package/dist/{lookup-D6dro5Au.cjs → lookup-CMAGfQ1Q.cjs} +78 -5
- package/dist/{middleware-BuHr2fzh.js → middleware-D-vPitR-.js} +37 -38
- package/dist/{middleware-DQYscW90.js → middleware-Dm8sXYUr.js} +40 -40
- package/dist/middleware-DzA970CF.js +16 -0
- package/dist/middleware-VpoC5jyA.js +26 -0
- package/dist/middleware-W_-inBoE.cjs +16 -0
- package/dist/{middleware-Dgmdgrvb.cjs → middleware-ekn2KaOw.cjs} +57 -58
- package/dist/{mod-CxkWO3Mg.d.cts → mod--K7l84wp.d.cts} +3 -2
- package/dist/{mod-DBzN0aCM.d.ts → mod-CB80AlIA.d.ts} +1 -1
- package/dist/mod-CLKu6Uo_.d.cts +107 -0
- package/dist/{mod-Djzcw2ry.d.cts → mod-COlOrmr9.d.cts} +3 -3
- package/dist/{mod-DlU8ISoa.d.ts → mod-CRENK2dd.d.ts} +3 -2
- package/dist/{mod-D_y2y32N.d.ts → mod-CaWbCg0N.d.ts} +2 -2
- package/dist/mod-Cm97bAiT.d.ts +109 -0
- package/dist/{mod-Bpb5QLaZ.d.cts → mod-D9XZsft2.d.cts} +2 -2
- package/dist/{mod-BhUKmBJD.d.ts → mod-DLIidI_j.d.ts} +3 -3
- package/dist/{mod-jQ4OODsl.d.cts → mod-DuclhZjh.d.cts} +1 -1
- package/dist/mod.cjs +21 -32
- package/dist/mod.d.cts +14 -14
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +15 -16
- package/dist/nodeinfo/client.test.js +8 -10
- package/dist/nodeinfo/handler.test.js +24 -25
- package/dist/nodeinfo/mod.cjs +3 -3
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +3 -4
- package/dist/nodeinfo/mod.js +3 -3
- package/dist/nodeinfo/types.test.js +7 -9
- package/dist/{owner-hd9lvQcP.d.ts → owner-CktUdA0h.d.ts} +3 -3
- package/dist/{owner-BN_tO3cY.d.cts → owner-dkg5OpSC.d.cts} +3 -3
- package/dist/{owner-ChSL4aJ7.js → owner-n5c_oZ_M.js} +3 -2
- package/dist/{proof-BiSCuwyA.js → proof-CLwByIT1.js} +5 -4
- package/dist/{proof-ONNmhInb.cjs → proof-CZfrp13P.cjs} +17 -16
- package/dist/{proof-x3IBewan.js → proof-CsFR7fiS.js} +2 -2
- package/dist/request-BbHkedIU.d.cts +35 -0
- package/dist/request-DKGQaofB.js +184 -0
- package/dist/request-U1t6zZtk.d.ts +39 -0
- package/dist/request-XHWUW2bi.cjs +208 -0
- package/dist/{send-D5fjmUEj.js → send-eW9JIzQV.js} +2 -2
- package/dist/sig/http.test.js +12 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +10 -11
- package/dist/sig/mod.d.cts +6 -7
- package/dist/sig/mod.d.ts +6 -7
- package/dist/sig/mod.js +6 -7
- package/dist/sig/owner.test.js +10 -12
- package/dist/sig/proof.test.js +13 -14
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +122 -148
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-tWr1VQxx.js → testing-ClYSmXdi.js} +1 -2
- package/dist/{types-D2Nyz0tR.cjs → types-BT0xc4-R.cjs} +3 -3
- package/dist/{types-DQuSDtDg.js → types-DaPoJTSc.js} +1 -1
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +13 -15
- package/dist/utils/kv-cache.test.js +208 -0
- package/dist/utils/mod.cjs +14 -0
- package/dist/utils/mod.d.cts +6 -0
- package/dist/utils/mod.d.ts +8 -0
- package/dist/utils/mod.js +12 -0
- package/dist/utils/request.test.js +48 -0
- package/dist/utils/url.test.js +41 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +7 -9
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.d.cts +4 -5
- package/dist/vocab/mod.d.ts +4 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +9 -10
- package/dist/{vocab-Dd4VMrr0.cjs → vocab-CxTuoEVd.cjs} +6 -5
- package/dist/{vocab-Dw1-yVGg.d.cts → vocab-DCBw44JZ.d.cts} +2 -21
- package/dist/{vocab-BI0Ak5lL.d.ts → vocab-ivDKb439.d.ts} +2 -21
- package/dist/{vocab-w--qk7HF.js → vocab-yFT-fQBj.js} +4 -3
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +3 -3
- package/dist/webfinger/mod.d.cts +2 -3
- package/dist/webfinger/mod.d.ts +2 -3
- package/dist/webfinger/mod.js +3 -3
- package/dist/x/cfworkers.d.cts +1 -1
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +6 -8
- package/dist/x/hono.d.cts +10 -10
- package/dist/x/hono.d.ts +11 -11
- package/dist/x/sveltekit.d.cts +10 -10
- package/dist/x/sveltekit.d.ts +11 -11
- package/package.json +16 -14
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-Cv_qEn1G.js +0 -52
- package/dist/authdocloader-bsmVF6eO.cjs +0 -58
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/key-BNJQQm3h.js +0 -260
- package/dist/key-C_ruQbbl.js +0 -10
- package/dist/key-DIMJMxf4.cjs +0 -10
- package/dist/key-DpFjiItf.js +0 -10
- package/dist/key-DuXv64tg.cjs +0 -290
- package/dist/lookup-CbtuFbtg.js +0 -331
- package/dist/middleware-BpR6186a.js +0 -26
- package/dist/middleware-DDMxdtWM.cjs +0 -17
- package/dist/middleware-T-knSMwl.js +0 -17
- package/dist/mod-CerN_Sza.d.ts +0 -104
- package/dist/mod-Cj1tHXBR.d.cts +0 -102
- package/dist/runtime/docloader.test.js +0 -522
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/langstr.test.js +0 -39
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/link.test.js +0 -61
- package/dist/runtime/mod.cjs +0 -25
- package/dist/runtime/mod.d.cts +0 -6
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime/mod.js +0 -13
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.js +0 -358
- package/dist/runtime/url.test.js +0 -45
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CcnIw1qY.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.js} +0 -0
- /package/dist/{federation-H2_En3j5.cjs → federation-DOuZpcAw.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-pZJsapBn.js} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-BMKIFXNW.d.cts} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-Dt06smFt.d.ts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-B-ZQqbGe.d.ts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-CjsiSl7_.d.ts} +0 -0
- /package/dist/{mq-CRGm1e_F.d.ts → mq-CPRJk4mZ.d.ts} +0 -0
- /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-B0UefMXO.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-ByTd7HpT.cjs} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-DE_NC_VQ.cjs} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-Dx59zAgn.js} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{types-BSuWJsOm.js → types-C2XVl6gj.js} +0 -0
- /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
- /package/dist/{runtime/key.test.d.ts → utils/request.test.d.ts} +0 -0
- /package/dist/{runtime → utils}/url.test.d.ts +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-B6yXfxAQ.cjs} +0 -0
- /package/dist/{sig-Cj3tk-ig.js → utils-BXMGcmqK.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-C949bxcD.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-qG8R5jc3.js} +0 -0
@@ -4,21 +4,21 @@
|
|
4
4
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
6
|
const require_transformers = require('./transformers-CoBS-oFG.cjs');
|
7
|
-
const
|
8
|
-
const require_actor = require('./actor-
|
9
|
-
const require_lookup = require('./lookup-
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const require_vocab = require('./vocab-Dd4VMrr0.cjs');
|
7
|
+
const require_request = require('./request-XHWUW2bi.cjs');
|
8
|
+
const require_actor = require('./actor-D020hlx3.cjs');
|
9
|
+
const require_lookup = require('./lookup-CMAGfQ1Q.cjs');
|
10
|
+
const require_http = require('./http-DMsjudj8.cjs');
|
11
|
+
const require_proof = require('./proof-CZfrp13P.cjs');
|
12
|
+
const require_types = require('./types-BT0xc4-R.cjs');
|
13
|
+
const require_kv_cache = require('./kv-cache-BHIupktM.cjs');
|
14
|
+
const require_vocab = require('./vocab-CxTuoEVd.cjs');
|
16
15
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
17
16
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
18
|
-
const
|
17
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
19
18
|
const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
|
20
19
|
const uri_template_router = require_chunk.__toESM(require("uri-template-router"));
|
21
20
|
const url_template = require_chunk.__toESM(require("url-template"));
|
21
|
+
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
22
22
|
const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
|
23
23
|
const node_url = require_chunk.__toESM(require("node:url"));
|
24
24
|
|
@@ -143,7 +143,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
143
143
|
return "enqueued";
|
144
144
|
}
|
145
145
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
146
|
-
const tracer = tracerProvider.getTracer(
|
146
|
+
const tracer = tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
147
147
|
return await tracer.startActiveSpan("activitypub.dispatch_inbox_listener", { kind: __opentelemetry_api.SpanKind.INTERNAL }, async (span$1) => {
|
148
148
|
const dispatched = inboxListeners?.dispatchWithClass(activity);
|
149
149
|
if (dispatched == null) {
|
@@ -340,7 +340,7 @@ var FederationBuilderImpl = class {
|
|
340
340
|
this.collectionTypeIds = {};
|
341
341
|
}
|
342
342
|
async build(options) {
|
343
|
-
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-
|
343
|
+
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-W_-inBoE.cjs"));
|
344
344
|
const f = new FederationImpl$1(options);
|
345
345
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
346
346
|
f.router = this.router.clone();
|
@@ -366,7 +366,7 @@ var FederationBuilderImpl = class {
|
|
366
366
|
return f;
|
367
367
|
}
|
368
368
|
_getTracer() {
|
369
|
-
return __opentelemetry_api.trace.getTracer(
|
369
|
+
return __opentelemetry_api.trace.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
370
370
|
}
|
371
371
|
setActorDispatcher(path, dispatcher) {
|
372
372
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
@@ -793,11 +793,11 @@ var FederationBuilderImpl = class {
|
|
793
793
|
};
|
794
794
|
return setters;
|
795
795
|
}
|
796
|
-
setCollectionDispatcher(name,
|
797
|
-
return this.#setCustomCollectionDispatcher(name, "collection",
|
796
|
+
setCollectionDispatcher(name, itemType, path, dispatcher) {
|
797
|
+
return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
|
798
798
|
}
|
799
|
-
setOrderedCollectionDispatcher(name,
|
800
|
-
return this.#setCustomCollectionDispatcher(name, "orderedCollection",
|
799
|
+
setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
|
800
|
+
return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
|
801
801
|
}
|
802
802
|
#setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
|
803
803
|
const strName = String(name);
|
@@ -1113,7 +1113,7 @@ async function handleObject(request, { values, context: context$2, objectDispatc
|
|
1113
1113
|
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
|
1114
1114
|
const spanName = name.trim().replace(/\s+/g, "_");
|
1115
1115
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1116
|
-
const tracer = tracerProvider.getTracer(
|
1116
|
+
const tracer = tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
1117
1117
|
const url = new URL(request.url);
|
1118
1118
|
const cursor = url.searchParams.get("cursor");
|
1119
1119
|
if (collectionCallbacks == null) return await onNotFound(request);
|
@@ -1290,7 +1290,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
1290
1290
|
*/
|
1291
1291
|
async function handleInbox(request, options) {
|
1292
1292
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1293
|
-
const tracer = tracerProvider.getTracer(
|
1293
|
+
const tracer = tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
1294
1294
|
return await tracer.startActiveSpan("activitypub.inbox", {
|
1295
1295
|
kind: options.queue == null ? __opentelemetry_api.SpanKind.SERVER : __opentelemetry_api.SpanKind.PRODUCER,
|
1296
1296
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
@@ -1551,7 +1551,7 @@ async function handleInboxInternal(request, parameters, span) {
|
|
1551
1551
|
/**
|
1552
1552
|
* Handles a custom collection request.
|
1553
1553
|
* @template TItem The type of items in the collection.
|
1554
|
-
* @template
|
1554
|
+
* @template TParam The parameter names of the requested URL.
|
1555
1555
|
* @template TContext The type of the context, extending {@link RequestContext}.
|
1556
1556
|
* @template TContextData The context data to pass to the `TContext`.
|
1557
1557
|
* @param request The HTTP request.
|
@@ -1569,7 +1569,7 @@ async function _handleCustomCollection(request, { name, values, context: context
|
|
1569
1569
|
/**
|
1570
1570
|
* Handles an ordered collection request.
|
1571
1571
|
* @template TItem The type of items in the collection.
|
1572
|
-
* @template
|
1572
|
+
* @template TParam The parameter names of the requested URL.
|
1573
1573
|
* @template TContext The type of the context, extending {@link RequestContext}.
|
1574
1574
|
* @template TContextData The context data to pass to the `TContext`.
|
1575
1575
|
* @param request The HTTP request.
|
@@ -1589,7 +1589,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
|
|
1589
1589
|
* The main flow is on `getCollection`, `dispatch`.
|
1590
1590
|
*
|
1591
1591
|
* @template TItem The type of items in the collection.
|
1592
|
-
* @template
|
1592
|
+
* @template TParam The parameter names of the requested URL.
|
1593
1593
|
* @template TContext The type of the context. {@link Context} or {@link RequestContext}.
|
1594
1594
|
* @template TContextData The context data to pass to the `TContext`.
|
1595
1595
|
* @template TCollection The type of the collection, extending {@link Collection}.
|
@@ -1623,14 +1623,14 @@ var CustomCollectionHandler = class {
|
|
1623
1623
|
#collection = null;
|
1624
1624
|
/**
|
1625
1625
|
* Creates a new CustomCollection instance.
|
1626
|
-
* @param
|
1627
|
-
* @param
|
1628
|
-
* @param
|
1629
|
-
* @param
|
1630
|
-
* @param
|
1631
|
-
* @param
|
1632
|
-
* @param
|
1633
|
-
* @param
|
1626
|
+
* @param name The name of the collection.
|
1627
|
+
* @param values The parameter values for the collection.
|
1628
|
+
* @param context The request context.
|
1629
|
+
* @param callbacks The collection callbacks.
|
1630
|
+
* @param tracerProvider The tracer provider for telemetry.
|
1631
|
+
* @param Collection The Collection constructor.
|
1632
|
+
* @param CollectionPage The CollectionPage constructor.
|
1633
|
+
* @param filterPredicate Optional filter predicate for items.
|
1634
1634
|
*/
|
1635
1635
|
constructor(name, values, context$2, callbacks, tracerProvider = __opentelemetry_api.trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
|
1636
1636
|
this.name = name;
|
@@ -1642,7 +1642,7 @@ var CustomCollectionHandler = class {
|
|
1642
1642
|
this.CollectionPage = CollectionPage$1;
|
1643
1643
|
this.filterPredicate = filterPredicate;
|
1644
1644
|
this.name = this.name.trim().replace(/\s+/g, "_");
|
1645
|
-
this.#tracer = this.tracerProvider.getTracer(
|
1645
|
+
this.#tracer = this.tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
1646
1646
|
this.#id = new URL(this.context.url);
|
1647
1647
|
this.#dispatcher = callbacks.dispatcher.bind(callbacks);
|
1648
1648
|
}
|
@@ -1755,7 +1755,7 @@ var CustomCollectionHandler = class {
|
|
1755
1755
|
/**
|
1756
1756
|
* Creates a function to wrap the dispatcher so tracing can be applied.
|
1757
1757
|
* @param params Parameters including cursor and total items.
|
1758
|
-
* @returns
|
1758
|
+
* @returns A function that handles the span operation.
|
1759
1759
|
*/
|
1760
1760
|
spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
|
1761
1761
|
try {
|
@@ -1776,23 +1776,23 @@ var CustomCollectionHandler = class {
|
|
1776
1776
|
};
|
1777
1777
|
/**
|
1778
1778
|
* Dispatches the collection request to get items.
|
1779
|
-
* @param
|
1780
|
-
* @returns
|
1779
|
+
* @param cursor The cursor for pagination, or null for the first page.
|
1780
|
+
* @returns A promise that resolves to the page items.
|
1781
1781
|
*/
|
1782
1782
|
async dispatch(cursor = null) {
|
1783
1783
|
return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
|
1784
1784
|
}
|
1785
1785
|
/**
|
1786
1786
|
* Filters the items in the collection.
|
1787
|
-
* @param
|
1788
|
-
* @returns
|
1787
|
+
* @param items The items to filter.
|
1788
|
+
* @returns The filtered items.
|
1789
1789
|
*/
|
1790
1790
|
filterItems(items) {
|
1791
1791
|
return filterCollectionItems(items, this.name, this.filterPredicate);
|
1792
1792
|
}
|
1793
1793
|
/**
|
1794
1794
|
* Appends a cursor to the URL if it exists.
|
1795
|
-
* @param
|
1795
|
+
* @param cursor The cursor to append, or null/undefined.
|
1796
1796
|
* @returns The URL with cursor appended, or null if cursor is null/undefined.
|
1797
1797
|
*/
|
1798
1798
|
appendToUrl(cursor) {
|
@@ -1800,8 +1800,7 @@ var CustomCollectionHandler = class {
|
|
1800
1800
|
}
|
1801
1801
|
/**
|
1802
1802
|
* Gets the stored collection or collection page.
|
1803
|
-
* @returns
|
1804
|
-
the collection or collection page.
|
1803
|
+
* @returns A promise that resolves to the collection or collection page.
|
1805
1804
|
*/
|
1806
1805
|
get collection() {
|
1807
1806
|
if (this.#collection === null) this.#collection = this.getCollection();
|
@@ -1809,8 +1808,8 @@ var CustomCollectionHandler = class {
|
|
1809
1808
|
}
|
1810
1809
|
/**
|
1811
1810
|
* Gets the total number of items in the collection.
|
1812
|
-
* @returns
|
1813
|
-
|
1811
|
+
* @returns A promise that resolves to the total items count,
|
1812
|
+
* or null if not available.
|
1814
1813
|
*/
|
1815
1814
|
get totalItems() {
|
1816
1815
|
if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
|
@@ -1826,8 +1825,8 @@ var CustomCollectionHandler = class {
|
|
1826
1825
|
}
|
1827
1826
|
/**
|
1828
1827
|
* Gets the first cursor for pagination.
|
1829
|
-
* @returns
|
1830
|
-
or null if not available.
|
1828
|
+
* @returns A promise that resolves to the first cursor,
|
1829
|
+
* or null if not available.
|
1831
1830
|
*/
|
1832
1831
|
get firstCursor() {
|
1833
1832
|
const cursor = this.callbacks.firstCursor?.(this.context, this.values);
|
@@ -2234,7 +2233,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
2234
2233
|
*/
|
2235
2234
|
function sendActivity(options) {
|
2236
2235
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
2237
|
-
const tracer = tracerProvider.getTracer(
|
2236
|
+
const tracer = tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
2238
2237
|
return tracer.startActiveSpan("activitypub.send_activity", {
|
2239
2238
|
kind: __opentelemetry_api.SpanKind.CLIENT,
|
2240
2239
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
@@ -2405,8 +2404,8 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2405
2404
|
const { allowPrivateAddress, userAgent } = options;
|
2406
2405
|
this.allowPrivateAddress = allowPrivateAddress ?? false;
|
2407
2406
|
this.documentLoaderFactory = options.documentLoaderFactory ?? ((opts) => {
|
2408
|
-
return
|
2409
|
-
loader:
|
2407
|
+
return require_kv_cache.kvCache({
|
2408
|
+
loader: (0, __fedify_vocab_runtime.getDocumentLoader)({
|
2410
2409
|
allowPrivateAddress: opts?.allowPrivateAddress ?? allowPrivateAddress,
|
2411
2410
|
userAgent: opts?.userAgent ?? userAgent
|
2412
2411
|
}),
|
@@ -2415,7 +2414,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2415
2414
|
});
|
2416
2415
|
});
|
2417
2416
|
this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
2418
|
-
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) =>
|
2417
|
+
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => require_kv_cache.getAuthenticatedDocumentLoader(identity, {
|
2419
2418
|
allowPrivateAddress,
|
2420
2419
|
userAgent,
|
2421
2420
|
specDeterminer: new KvSpecDeterminer(this.kv, this.kvPrefixes.httpMessageSignaturesSpec, options.firstKnock),
|
@@ -2436,7 +2435,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2436
2435
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
2437
2436
|
}
|
2438
2437
|
_getTracer() {
|
2439
|
-
return this.tracerProvider.getTracer(
|
2438
|
+
return this.tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
2440
2439
|
}
|
2441
2440
|
async _startQueueInternal(ctxData, signal, queue) {
|
2442
2441
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
@@ -2534,7 +2533,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2534
2533
|
});
|
2535
2534
|
const keys = await Promise.all(message.keys.map(async ({ keyId, privateKey }) => ({
|
2536
2535
|
keyId: new URL(keyId),
|
2537
|
-
privateKey: await
|
2536
|
+
privateKey: await require_http.importJwk(privateKey, "private")
|
2538
2537
|
})));
|
2539
2538
|
const activity = await require_actor.Activity.fromJsonLd(message.activity, {
|
2540
2539
|
contextLoader: this.contextLoaderFactory({
|
@@ -2575,7 +2574,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2575
2574
|
for (const { keyId, privateKey } of message.keys) {
|
2576
2575
|
const pair = {
|
2577
2576
|
keyId: new URL(keyId),
|
2578
|
-
privateKey: await
|
2577
|
+
privateKey: await require_http.importJwk(privateKey, "private")
|
2579
2578
|
};
|
2580
2579
|
if (rsaKeyPair == null && pair.privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") rsaKeyPair = pair;
|
2581
2580
|
keys.push(pair);
|
@@ -2810,7 +2809,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2810
2809
|
let proofCreated = false;
|
2811
2810
|
let rsaKey = null;
|
2812
2811
|
for (const { keyId, privateKey } of keys) {
|
2813
|
-
|
2812
|
+
require_http.validateCryptoKey(privateKey, "private");
|
2814
2813
|
if (rsaKey == null && privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") {
|
2815
2814
|
rsaKey = {
|
2816
2815
|
keyId,
|
@@ -2878,7 +2877,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2878
2877
|
});
|
2879
2878
|
const keyJwkPairs = [];
|
2880
2879
|
for (const { keyId, privateKey } of keys) {
|
2881
|
-
const privateKeyJwk = await
|
2880
|
+
const privateKeyJwk = await require_http.exportJwk(privateKey);
|
2882
2881
|
keyJwkPairs.push({
|
2883
2882
|
keyId: keyId.href,
|
2884
2883
|
privateKey: privateKeyJwk
|
@@ -3578,7 +3577,7 @@ var ContextImpl = class ContextImpl {
|
|
3578
3577
|
});
|
3579
3578
|
}
|
3580
3579
|
sendActivity(sender, recipients, activity, options = {}) {
|
3581
|
-
const tracer = this.tracerProvider.getTracer(
|
3580
|
+
const tracer = this.tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
3582
3581
|
return tracer.startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
3583
3582
|
kind: this.federation.outboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
3584
3583
|
attributes: {
|
@@ -3635,7 +3634,7 @@ var ContextImpl = class ContextImpl {
|
|
3635
3634
|
keys = sender;
|
3636
3635
|
} else keys = [sender];
|
3637
3636
|
if (keys.length < 1) throw new TypeError("The sender's keys must not be empty.");
|
3638
|
-
for (const { privateKey } of keys)
|
3637
|
+
for (const { privateKey } of keys) require_http.validateCryptoKey(privateKey, "private");
|
3639
3638
|
const opts = { context: this };
|
3640
3639
|
let expandedRecipients;
|
3641
3640
|
if (Array.isArray(recipients)) expandedRecipients = recipients;
|
@@ -3676,7 +3675,7 @@ var ContextImpl = class ContextImpl {
|
|
3676
3675
|
}
|
3677
3676
|
const keyJwkPairs = await Promise.all(keys.map(async ({ keyId, privateKey }) => ({
|
3678
3677
|
keyId: keyId.href,
|
3679
|
-
privateKey: await
|
3678
|
+
privateKey: await require_http.exportJwk(privateKey)
|
3680
3679
|
})));
|
3681
3680
|
const carrier = {};
|
3682
3681
|
__opentelemetry_api.propagation.inject(__opentelemetry_api.context.active(), carrier);
|
@@ -3724,7 +3723,7 @@ var ContextImpl = class ContextImpl {
|
|
3724
3723
|
}
|
3725
3724
|
routeActivity(recipient, activity, options = {}) {
|
3726
3725
|
const tracerProvider = this.tracerProvider ?? this.tracerProvider;
|
3727
|
-
const tracer = tracerProvider.getTracer(
|
3726
|
+
const tracer = tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
3728
3727
|
return tracer.startActiveSpan("activitypub.inbox", {
|
3729
3728
|
kind: this.federation.inboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.INTERNAL : __opentelemetry_api.SpanKind.PRODUCER,
|
3730
3729
|
attributes: { "activitypub.activity.type": require_actor.getTypeId(activity).href }
|
@@ -3942,7 +3941,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
3942
3941
|
});
|
3943
3942
|
}
|
3944
3943
|
forwardActivity(forwarder, recipients, options) {
|
3945
|
-
const tracer = this.tracerProvider.getTracer(
|
3944
|
+
const tracer = this.tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
|
3946
3945
|
return tracer.startActiveSpan("activitypub.outbox", {
|
3947
3946
|
kind: this.federation.outboxQueue == null || options?.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
3948
3947
|
attributes: { "activitypub.activity.type": this.activityType }
|
@@ -4043,7 +4042,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
4043
4042
|
});
|
4044
4043
|
const keyJwkPairs = [];
|
4045
4044
|
for (const { keyId, privateKey } of keys) {
|
4046
|
-
const privateKeyJwk = await
|
4045
|
+
const privateKeyJwk = await require_http.exportJwk(privateKey);
|
4047
4046
|
keyJwkPairs.push({
|
4048
4047
|
keyId: keyId.href,
|
4049
4048
|
privateKey: privateKeyJwk
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import { Collection, Link, Object as Object$1 } from "./vocab-
|
1
|
+
import { GetUserAgentOptions } from "./request-BbHkedIU.cjs";
|
2
|
+
import { Collection, Link, Object as Object$1 } from "./vocab-DCBw44JZ.cjs";
|
3
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
3
4
|
import { TracerProvider } from "@opentelemetry/api";
|
4
5
|
|
5
6
|
//#region src/vocab/lookup.d.ts
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { GetUserAgentOptions } from "./
|
3
|
+
import { GetUserAgentOptions } from "./request-U1t6zZtk.js";
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
5
5
|
|
6
6
|
//#region src/webfinger/jrd.d.ts
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { HttpMessageSignaturesSpecDeterminer } from "./http-B6SKO6NJ.cjs";
|
2
|
+
import { KvKey, KvStore } from "./kv-BMKIFXNW.cjs";
|
3
|
+
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
4
|
+
import { TracerProvider } from "@opentelemetry/api";
|
5
|
+
|
6
|
+
//#region src/utils/docloader.d.ts
|
7
|
+
/**
|
8
|
+
* Options for {@link getAuthenticatedDocumentLoader}.
|
9
|
+
* @see {@link getAuthenticatedDocumentLoader}
|
10
|
+
* @since 1.3.0
|
11
|
+
*/
|
12
|
+
interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
13
|
+
/**
|
14
|
+
* An optional spec determiner for HTTP Message Signatures.
|
15
|
+
* It determines the spec to use for signing requests.
|
16
|
+
* It is used for double-knocking
|
17
|
+
* (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
|
18
|
+
* @since 1.6.0
|
19
|
+
*/
|
20
|
+
specDeterminer?: HttpMessageSignaturesSpecDeterminer;
|
21
|
+
/**
|
22
|
+
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
23
|
+
* is used.
|
24
|
+
* @since 1.6.0
|
25
|
+
*/
|
26
|
+
tracerProvider?: TracerProvider;
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
30
|
+
* Note that an authenticated document loader intentionally does not cache
|
31
|
+
* the fetched documents.
|
32
|
+
* @param identity The identity to get the document loader for.
|
33
|
+
* The actor's key pair.
|
34
|
+
* @param options The options for the document loader.
|
35
|
+
* @returns The authenticated document loader.
|
36
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
37
|
+
* @since 0.4.0
|
38
|
+
*/
|
39
|
+
declare function getAuthenticatedDocumentLoader(identity: {
|
40
|
+
keyId: URL;
|
41
|
+
privateKey: CryptoKey;
|
42
|
+
}, {
|
43
|
+
allowPrivateAddress,
|
44
|
+
userAgent,
|
45
|
+
specDeterminer,
|
46
|
+
tracerProvider
|
47
|
+
}?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
|
48
|
+
/**
|
49
|
+
* A JSON-LD document loader that utilizes the browser's `fetch` API.
|
50
|
+
*
|
51
|
+
* This loader preloads the below frequently used contexts:
|
52
|
+
*
|
53
|
+
* - <https://www.w3.org/ns/activitystreams>
|
54
|
+
* - <https://w3id.org/security/v1>
|
55
|
+
* - <https://w3id.org/security/data-integrity/v1>
|
56
|
+
* - <https://www.w3.org/ns/did/v1>
|
57
|
+
* - <https://w3id.org/security/multikey/v1>
|
58
|
+
* - <https://purl.archive.org/socialweb/webfinger>
|
59
|
+
* - <http://schema.org/>
|
60
|
+
* @param url The URL of the document to load.
|
61
|
+
* @param allowPrivateAddress Whether to allow fetching private network
|
62
|
+
* addresses. Turned off by default.
|
63
|
+
* @returns The remote document.
|
64
|
+
* @deprecated Use {@link getDocumentLoader} instead.
|
65
|
+
*/
|
66
|
+
//#endregion
|
67
|
+
//#region src/utils/kv-cache.d.ts
|
68
|
+
/**
|
69
|
+
* The parameters for {@link kvCache} function.
|
70
|
+
*/
|
71
|
+
interface KvCacheParameters {
|
72
|
+
/**
|
73
|
+
* The document loader to decorate with a cache.
|
74
|
+
*/
|
75
|
+
loader: DocumentLoader;
|
76
|
+
/**
|
77
|
+
* The key–value store to use for backing the cache.
|
78
|
+
*/
|
79
|
+
kv: KvStore;
|
80
|
+
/**
|
81
|
+
* The key prefix to use for namespacing the cache.
|
82
|
+
* `["_fedify", "remoteDocument"]` by default.
|
83
|
+
*/
|
84
|
+
prefix?: KvKey;
|
85
|
+
/**
|
86
|
+
* The per-URL cache rules in the array of `[urlPattern, duration]` pairs
|
87
|
+
* where `urlPattern` is either a string, a {@link URL}, or
|
88
|
+
* a {@link URLPattern} and `duration` is a {@link Temporal.Duration}.
|
89
|
+
* The `duration` is allowed to be at most 30 days.
|
90
|
+
*
|
91
|
+
* By default, 5 minutes for all URLs.
|
92
|
+
*/
|
93
|
+
rules?: [string | URL | URLPattern, Temporal.Duration][];
|
94
|
+
}
|
95
|
+
/**
|
96
|
+
* Decorates a {@link DocumentLoader} with a cache backed by a {@link Deno.Kv}.
|
97
|
+
* @param parameters The parameters for the cache.
|
98
|
+
* @returns The decorated document loader which is cache-enabled.
|
99
|
+
*/
|
100
|
+
declare function kvCache({
|
101
|
+
loader,
|
102
|
+
kv,
|
103
|
+
prefix,
|
104
|
+
rules
|
105
|
+
}: KvCacheParameters): DocumentLoader;
|
106
|
+
//#endregion
|
107
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-DCBw44JZ.cjs";
|
2
|
+
import { KeyCache } from "./http-B6SKO6NJ.cjs";
|
3
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
4
4
|
import { TracerProvider } from "@opentelemetry/api";
|
5
5
|
|
6
6
|
//#region src/sig/ld.d.ts
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import {
|
4
|
-
import { Collection, Link, Object as Object$1 } from "./vocab-
|
3
|
+
import { GetUserAgentOptions } from "./request-U1t6zZtk.js";
|
4
|
+
import { Collection, Link, Object as Object$1 } from "./vocab-ivDKb439.js";
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
6
7
|
|
7
8
|
//#region src/vocab/lookup.d.ts
|
8
9
|
/**
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { Activity } from "./vocab-
|
4
|
-
import { ActivityTransformer, Context } from "./context-
|
3
|
+
import { Activity } from "./vocab-ivDKb439.js";
|
4
|
+
import { ActivityTransformer, Context } from "./context-DqFifMwj.js";
|
5
5
|
|
6
6
|
//#region src/compat/transformers.d.ts
|
7
7
|
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
3
|
+
import { HttpMessageSignaturesSpecDeterminer } from "./http-BE7aFuqn.js";
|
4
|
+
import { KvKey, KvStore } from "./kv-Dt06smFt.js";
|
5
|
+
import { TracerProvider } from "@opentelemetry/api";
|
6
|
+
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
7
|
+
|
8
|
+
//#region src/utils/docloader.d.ts
|
9
|
+
/**
|
10
|
+
* Options for {@link getAuthenticatedDocumentLoader}.
|
11
|
+
* @see {@link getAuthenticatedDocumentLoader}
|
12
|
+
* @since 1.3.0
|
13
|
+
*/
|
14
|
+
interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
15
|
+
/**
|
16
|
+
* An optional spec determiner for HTTP Message Signatures.
|
17
|
+
* It determines the spec to use for signing requests.
|
18
|
+
* It is used for double-knocking
|
19
|
+
* (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
|
20
|
+
* @since 1.6.0
|
21
|
+
*/
|
22
|
+
specDeterminer?: HttpMessageSignaturesSpecDeterminer;
|
23
|
+
/**
|
24
|
+
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
25
|
+
* is used.
|
26
|
+
* @since 1.6.0
|
27
|
+
*/
|
28
|
+
tracerProvider?: TracerProvider;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Gets an authenticated {@link DocumentLoader} for the given identity.
|
32
|
+
* Note that an authenticated document loader intentionally does not cache
|
33
|
+
* the fetched documents.
|
34
|
+
* @param identity The identity to get the document loader for.
|
35
|
+
* The actor's key pair.
|
36
|
+
* @param options The options for the document loader.
|
37
|
+
* @returns The authenticated document loader.
|
38
|
+
* @throws {TypeError} If the key is invalid or unsupported.
|
39
|
+
* @since 0.4.0
|
40
|
+
*/
|
41
|
+
declare function getAuthenticatedDocumentLoader(identity: {
|
42
|
+
keyId: URL;
|
43
|
+
privateKey: CryptoKey;
|
44
|
+
}, {
|
45
|
+
allowPrivateAddress,
|
46
|
+
userAgent,
|
47
|
+
specDeterminer,
|
48
|
+
tracerProvider
|
49
|
+
}?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
|
50
|
+
/**
|
51
|
+
* A JSON-LD document loader that utilizes the browser's `fetch` API.
|
52
|
+
*
|
53
|
+
* This loader preloads the below frequently used contexts:
|
54
|
+
*
|
55
|
+
* - <https://www.w3.org/ns/activitystreams>
|
56
|
+
* - <https://w3id.org/security/v1>
|
57
|
+
* - <https://w3id.org/security/data-integrity/v1>
|
58
|
+
* - <https://www.w3.org/ns/did/v1>
|
59
|
+
* - <https://w3id.org/security/multikey/v1>
|
60
|
+
* - <https://purl.archive.org/socialweb/webfinger>
|
61
|
+
* - <http://schema.org/>
|
62
|
+
* @param url The URL of the document to load.
|
63
|
+
* @param allowPrivateAddress Whether to allow fetching private network
|
64
|
+
* addresses. Turned off by default.
|
65
|
+
* @returns The remote document.
|
66
|
+
* @deprecated Use {@link getDocumentLoader} instead.
|
67
|
+
*/
|
68
|
+
//#endregion
|
69
|
+
//#region src/utils/kv-cache.d.ts
|
70
|
+
/**
|
71
|
+
* The parameters for {@link kvCache} function.
|
72
|
+
*/
|
73
|
+
interface KvCacheParameters {
|
74
|
+
/**
|
75
|
+
* The document loader to decorate with a cache.
|
76
|
+
*/
|
77
|
+
loader: DocumentLoader;
|
78
|
+
/**
|
79
|
+
* The key–value store to use for backing the cache.
|
80
|
+
*/
|
81
|
+
kv: KvStore;
|
82
|
+
/**
|
83
|
+
* The key prefix to use for namespacing the cache.
|
84
|
+
* `["_fedify", "remoteDocument"]` by default.
|
85
|
+
*/
|
86
|
+
prefix?: KvKey;
|
87
|
+
/**
|
88
|
+
* The per-URL cache rules in the array of `[urlPattern, duration]` pairs
|
89
|
+
* where `urlPattern` is either a string, a {@link URL}, or
|
90
|
+
* a {@link URLPattern} and `duration` is a {@link Temporal.Duration}.
|
91
|
+
* The `duration` is allowed to be at most 30 days.
|
92
|
+
*
|
93
|
+
* By default, 5 minutes for all URLs.
|
94
|
+
*/
|
95
|
+
rules?: [string | URL | URLPattern, Temporal.Duration][];
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
* Decorates a {@link DocumentLoader} with a cache backed by a {@link Deno.Kv}.
|
99
|
+
* @param parameters The parameters for the cache.
|
100
|
+
* @returns The decorated document loader which is cache-enabled.
|
101
|
+
*/
|
102
|
+
declare function kvCache({
|
103
|
+
loader,
|
104
|
+
kv,
|
105
|
+
prefix,
|
106
|
+
rules
|
107
|
+
}: KvCacheParameters): DocumentLoader;
|
108
|
+
//#endregion
|
109
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Activity } from "./vocab-
|
2
|
-
import { ActivityTransformer, Context } from "./context-
|
1
|
+
import { Activity } from "./vocab-DCBw44JZ.cjs";
|
2
|
+
import { ActivityTransformer, Context } from "./context-BOYzcFSe.cjs";
|
3
3
|
|
4
4
|
//#region src/compat/transformers.d.ts
|
5
5
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { KeyCache } from "./http-D6Uj2x2y.js";
|
3
|
+
import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-ivDKb439.js";
|
4
|
+
import { KeyCache } from "./http-BE7aFuqn.js";
|
6
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
|
+
import { DocumentLoader } from "@fedify/vocab-runtime";
|
7
7
|
|
8
8
|
//#region src/sig/ld.d.ts
|
9
9
|
/**
|