@fedify/fedify 2.0.0-dev.1690 → 2.0.0-dev.1736
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-DuCeRiNh.js → actor-BLq4KEGR.js} +1 -1
- package/dist/{actor-Be0ThtXy.cjs → actor-C3oFUgfc.cjs} +921 -1451
- package/dist/{actor-T6RyhRgk.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-ChbPLm6n.js → actor-btAA7QSA.js} +189 -677
- package/dist/{actor-D6K058Tb.d.cts → actor-f2NtjyCg.d.cts} +2 -2
- 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-CYOcDUkj.js → builder-C4gbKvM5.js} +7 -8
- package/dist/{client-CegPX0Rn.d.cts → client-94iWEfQa.d.cts} +1 -1
- package/dist/{client-bgSdkFa2.d.ts → client-BsGzbnV-.d.ts} +1 -1
- package/dist/{client-CnOdwLLN.js → client-pY7-3icS.js} +1 -1
- package/dist/compat/mod.d.cts +11 -12
- package/dist/compat/mod.d.ts +11 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-C5BsZkDr.d.cts → context-BvYz3eOb.d.cts} +130 -103
- package/dist/{context-ByZprN0S.d.ts → context-myrGWbL_.d.ts} +130 -103
- package/dist/{authdocloader-Brax1A32.js → docloader-DtYIz2Pb.js} +17 -8
- package/dist/{esm-DnIzfEj0.js → esm-CQ9nlHuI.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 +32 -33
- package/dist/federation/mod.cjs +9 -11
- package/dist/federation/mod.d.cts +12 -13
- package/dist/federation/mod.d.ts +12 -13
- package/dist/federation/mod.js +9 -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-BNOYnVsU.js → http-B9npZ3Md.js} +2 -2
- package/dist/{http-D6Uj2x2y.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-BxbM8sEy.js → http-D7qwMpca.js} +256 -6
- package/dist/{http-D-e6AFwR.d.cts → http-M8k5mKc0.d.cts} +2 -2
- package/dist/{http-C7vbQwbz.cjs → http-ngJvMHez.cjs} +289 -9
- package/dist/{inbox-BRru9pX3.js → inbox-CY8fblhz.js} +1 -1
- package/dist/{key-1KXru8Ug.js → key-CgKiloJr.js} +3 -2
- package/dist/{keycache-CN61iGVj.js → keycache-B6O-bhMs.js} +1 -1
- package/dist/{keys-BPdFKgiy.js → keys-B3O7b5eB.js} +2 -1
- package/dist/kv-cache-BrjWZnGU.cjs +133 -0
- package/dist/kv-cache-DkW_lqUw.js +121 -0
- package/dist/kv-cache-z0lgwFi_.js +93 -0
- package/dist/{ld-Dv8DNNAT.js → ld-B7TO6JH2.js} +3 -2
- package/dist/lookup-Cc3ZAAis.cjs +273 -0
- package/dist/{type-C69ZBu7f.js → lookup-NXjB7xUj.js} +503 -5327
- package/dist/lookup-fEH6e7ZX.js +261 -0
- package/dist/{middleware-DY9B2lL8.js → middleware-BMPvaTpX.js} +44 -48
- package/dist/{middleware-BmoOlgc1.cjs → middleware-C8w5YYxK.cjs} +60 -66
- package/dist/middleware-D8ENcqxG.js +26 -0
- package/dist/{middleware-Bz_A2jeJ.js → middleware-D_VyRsDx.js} +40 -46
- package/dist/middleware-Yk-MuxWc.js +15 -0
- package/dist/middleware-glwCut0b.cjs +15 -0
- package/dist/{mod-BhUKmBJD.d.ts → mod-B2iOw50L.d.ts} +3 -3
- package/dist/mod-BYynOiJG.d.ts +109 -0
- package/dist/{mod-DlU8ISoa.d.ts → mod-BlVovdcy.d.ts} +2 -2
- package/dist/{mod-CxkWO3Mg.d.cts → mod-BxRCHTz-.d.cts} +2 -2
- package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/{mod-8DMWKtQE.d.cts → mod-DbFNTF7m.d.cts} +2 -2
- package/dist/{mod-Djzcw2ry.d.cts → mod-DgdBYYa0.d.cts} +3 -3
- package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod-VastcQsk.d.cts +107 -0
- package/dist/{mod-D6hQoxC5.d.ts → mod-k0Dk3fGk.d.ts} +2 -2
- package/dist/mod.cjs +19 -32
- package/dist/mod.d.cts +15 -16
- package/dist/mod.d.ts +16 -17
- package/dist/mod.js +14 -16
- package/dist/nodeinfo/client.test.js +8 -10
- package/dist/nodeinfo/handler.test.js +24 -25
- package/dist/nodeinfo/mod.cjs +2 -3
- package/dist/nodeinfo/mod.d.cts +2 -4
- package/dist/nodeinfo/mod.d.ts +2 -4
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/types.test.js +7 -9
- package/dist/{owner-BN_tO3cY.d.cts → owner-B4HbyP8s.d.cts} +3 -3
- package/dist/{owner-e3FYDhsk.js → owner-CSktF-2s.js} +3 -2
- package/dist/{owner-hd9lvQcP.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/{proof-DfgvA3al.js → proof-BT65yR1Q.js} +5 -4
- package/dist/{proof-6gFMwMNJ.js → proof-Cs5Mcy_U.js} +2 -2
- package/dist/{proof-B-eqv0Ug.cjs → proof-feEDocLH.cjs} +17 -16
- package/dist/{send-Tl9NOnmO.js → send-vPZ03xUr.js} +2 -2
- package/dist/sig/http.test.js +12 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +9 -11
- package/dist/sig/mod.d.cts +5 -7
- package/dist/sig/mod.d.ts +5 -7
- package/dist/sig/mod.js +5 -7
- package/dist/sig/owner.test.js +10 -12
- package/dist/sig/proof.test.js +13 -14
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +120 -172
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-BWNCAbL-.js → testing-u2cUPQLp.js} +1 -2
- package/dist/{types-DqxyTxOf.js → types-BtUjyi5y.js} +1 -1
- package/dist/{types-zqdWZh4O.cjs → types-CWgzGaqk.cjs} +3 -3
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +209 -0
- package/dist/utils/mod.cjs +12 -0
- package/dist/utils/mod.d.cts +5 -0
- package/dist/utils/mod.d.ts +7 -0
- package/dist/utils/mod.js +11 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +7 -9
- package/dist/vocab/mod.cjs +3 -4
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +3 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +9 -10
- package/dist/{vocab-BI0Ak5lL.d.ts → vocab-BCWe1Ih5.d.ts} +2 -21
- package/dist/{vocab-Dw1-yVGg.d.cts → vocab-CeDBzu-f.d.cts} +2 -21
- package/dist/{vocab-B39-pFl9.cjs → vocab-NvDV-exu.cjs} +5 -5
- package/dist/{vocab-BWoeZsME.js → vocab-wADjlIH4.js} +3 -3
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +2 -3
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.cts +2 -2
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +6 -8
- package/dist/x/hono.d.cts +10 -11
- package/dist/x/hono.d.ts +10 -11
- package/dist/x/sveltekit.d.cts +10 -11
- package/dist/x/sveltekit.d.ts +10 -11
- package/package.json +15 -14
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-CrxhFL8e.js +0 -52
- package/dist/authdocloader-OSn_teLV.cjs +0 -58
- package/dist/docloader-CCqXeagZ.cjs +0 -4861
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/docloader-XK3y2jn5.js +0 -4795
- package/dist/key-B3uag-rz.js +0 -10
- package/dist/key-BiBmb1Yy.cjs +0 -10
- package/dist/key-DK_nfU4I.js +0 -10
- package/dist/key-Z6ceKnZC.cjs +0 -290
- package/dist/key-jyNTxCvK.js +0 -260
- package/dist/lookup-BPviO8ij.js +0 -131
- package/dist/lookup-hnMAAU5r.cjs +0 -137
- package/dist/lookup-pV0JOsuV.js +0 -331
- package/dist/middleware-CI0-zw4U.js +0 -26
- package/dist/middleware-QNK-W-jE.cjs +0 -17
- package/dist/middleware-_vjt6FWU.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.d.ts +0 -3
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/langstr.test.js +0 -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.d.ts +0 -3
- 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-CRpdnOMS.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
- /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
- /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
- /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{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/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
@@ -4,21 +4,20 @@
|
|
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
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const require_authdocloader = require('./authdocloader-OSn_teLV.cjs');
|
15
|
-
const require_vocab = require('./vocab-B39-pFl9.cjs');
|
7
|
+
const require_lookup = require('./lookup-Cc3ZAAis.cjs');
|
8
|
+
const require_actor = require('./actor-C3oFUgfc.cjs');
|
9
|
+
const require_http = require('./http-ngJvMHez.cjs');
|
10
|
+
const require_proof = require('./proof-feEDocLH.cjs');
|
11
|
+
const require_types = require('./types-CWgzGaqk.cjs');
|
12
|
+
const require_kv_cache = require('./kv-cache-BrjWZnGU.cjs');
|
13
|
+
const require_vocab = require('./vocab-NvDV-exu.cjs');
|
16
14
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
17
15
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
18
|
-
const
|
16
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
19
17
|
const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
|
20
18
|
const uri_template_router = require_chunk.__toESM(require("uri-template-router"));
|
21
19
|
const url_template = require_chunk.__toESM(require("url-template"));
|
20
|
+
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
22
21
|
const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
|
23
22
|
const node_url = require_chunk.__toESM(require("node:url"));
|
24
23
|
|
@@ -143,7 +142,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
|
|
143
142
|
return "enqueued";
|
144
143
|
}
|
145
144
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
146
|
-
const tracer = tracerProvider.getTracer(
|
145
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
147
146
|
return await tracer.startActiveSpan("activitypub.dispatch_inbox_listener", { kind: __opentelemetry_api.SpanKind.INTERNAL }, async (span$1) => {
|
148
147
|
const dispatched = inboxListeners?.dispatchWithClass(activity);
|
149
148
|
if (dispatched == null) {
|
@@ -340,7 +339,7 @@ var FederationBuilderImpl = class {
|
|
340
339
|
this.collectionTypeIds = {};
|
341
340
|
}
|
342
341
|
async build(options) {
|
343
|
-
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-
|
342
|
+
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-glwCut0b.cjs"));
|
344
343
|
const f = new FederationImpl$1(options);
|
345
344
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
346
345
|
f.router = this.router.clone();
|
@@ -366,7 +365,7 @@ var FederationBuilderImpl = class {
|
|
366
365
|
return f;
|
367
366
|
}
|
368
367
|
_getTracer() {
|
369
|
-
return __opentelemetry_api.trace.getTracer(
|
368
|
+
return __opentelemetry_api.trace.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
370
369
|
}
|
371
370
|
setActorDispatcher(path, dispatcher) {
|
372
371
|
if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
|
@@ -793,11 +792,11 @@ var FederationBuilderImpl = class {
|
|
793
792
|
};
|
794
793
|
return setters;
|
795
794
|
}
|
796
|
-
setCollectionDispatcher(name,
|
797
|
-
return this.#setCustomCollectionDispatcher(name, "collection",
|
795
|
+
setCollectionDispatcher(name, itemType, path, dispatcher) {
|
796
|
+
return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
|
798
797
|
}
|
799
|
-
setOrderedCollectionDispatcher(name,
|
800
|
-
return this.#setCustomCollectionDispatcher(name, "orderedCollection",
|
798
|
+
setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
|
799
|
+
return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
|
801
800
|
}
|
802
801
|
#setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
|
803
802
|
const strName = String(name);
|
@@ -1113,7 +1112,7 @@ async function handleObject(request, { values, context: context$2, objectDispatc
|
|
1113
1112
|
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
|
1114
1113
|
const spanName = name.trim().replace(/\s+/g, "_");
|
1115
1114
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1116
|
-
const tracer = tracerProvider.getTracer(
|
1115
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
1117
1116
|
const url = new URL(request.url);
|
1118
1117
|
const cursor = url.searchParams.get("cursor");
|
1119
1118
|
if (collectionCallbacks == null) return await onNotFound(request);
|
@@ -1290,7 +1289,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
|
|
1290
1289
|
*/
|
1291
1290
|
async function handleInbox(request, options) {
|
1292
1291
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1293
|
-
const tracer = tracerProvider.getTracer(
|
1292
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
1294
1293
|
return await tracer.startActiveSpan("activitypub.inbox", {
|
1295
1294
|
kind: options.queue == null ? __opentelemetry_api.SpanKind.SERVER : __opentelemetry_api.SpanKind.PRODUCER,
|
1296
1295
|
attributes: { "activitypub.shared_inbox": options.recipient == null }
|
@@ -1551,7 +1550,7 @@ async function handleInboxInternal(request, parameters, span) {
|
|
1551
1550
|
/**
|
1552
1551
|
* Handles a custom collection request.
|
1553
1552
|
* @template TItem The type of items in the collection.
|
1554
|
-
* @template
|
1553
|
+
* @template TParam The parameter names of the requested URL.
|
1555
1554
|
* @template TContext The type of the context, extending {@link RequestContext}.
|
1556
1555
|
* @template TContextData The context data to pass to the `TContext`.
|
1557
1556
|
* @param request The HTTP request.
|
@@ -1569,7 +1568,7 @@ async function _handleCustomCollection(request, { name, values, context: context
|
|
1569
1568
|
/**
|
1570
1569
|
* Handles an ordered collection request.
|
1571
1570
|
* @template TItem The type of items in the collection.
|
1572
|
-
* @template
|
1571
|
+
* @template TParam The parameter names of the requested URL.
|
1573
1572
|
* @template TContext The type of the context, extending {@link RequestContext}.
|
1574
1573
|
* @template TContextData The context data to pass to the `TContext`.
|
1575
1574
|
* @param request The HTTP request.
|
@@ -1589,7 +1588,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
|
|
1589
1588
|
* The main flow is on `getCollection`, `dispatch`.
|
1590
1589
|
*
|
1591
1590
|
* @template TItem The type of items in the collection.
|
1592
|
-
* @template
|
1591
|
+
* @template TParam The parameter names of the requested URL.
|
1593
1592
|
* @template TContext The type of the context. {@link Context} or {@link RequestContext}.
|
1594
1593
|
* @template TContextData The context data to pass to the `TContext`.
|
1595
1594
|
* @template TCollection The type of the collection, extending {@link Collection}.
|
@@ -1623,14 +1622,14 @@ var CustomCollectionHandler = class {
|
|
1623
1622
|
#collection = null;
|
1624
1623
|
/**
|
1625
1624
|
* Creates a new CustomCollection instance.
|
1626
|
-
* @param
|
1627
|
-
* @param
|
1628
|
-
* @param
|
1629
|
-
* @param
|
1630
|
-
* @param
|
1631
|
-
* @param
|
1632
|
-
* @param
|
1633
|
-
* @param
|
1625
|
+
* @param name The name of the collection.
|
1626
|
+
* @param values The parameter values for the collection.
|
1627
|
+
* @param context The request context.
|
1628
|
+
* @param callbacks The collection callbacks.
|
1629
|
+
* @param tracerProvider The tracer provider for telemetry.
|
1630
|
+
* @param Collection The Collection constructor.
|
1631
|
+
* @param CollectionPage The CollectionPage constructor.
|
1632
|
+
* @param filterPredicate Optional filter predicate for items.
|
1634
1633
|
*/
|
1635
1634
|
constructor(name, values, context$2, callbacks, tracerProvider = __opentelemetry_api.trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
|
1636
1635
|
this.name = name;
|
@@ -1642,7 +1641,7 @@ var CustomCollectionHandler = class {
|
|
1642
1641
|
this.CollectionPage = CollectionPage$1;
|
1643
1642
|
this.filterPredicate = filterPredicate;
|
1644
1643
|
this.name = this.name.trim().replace(/\s+/g, "_");
|
1645
|
-
this.#tracer = this.tracerProvider.getTracer(
|
1644
|
+
this.#tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
1646
1645
|
this.#id = new URL(this.context.url);
|
1647
1646
|
this.#dispatcher = callbacks.dispatcher.bind(callbacks);
|
1648
1647
|
}
|
@@ -1755,7 +1754,7 @@ var CustomCollectionHandler = class {
|
|
1755
1754
|
/**
|
1756
1755
|
* Creates a function to wrap the dispatcher so tracing can be applied.
|
1757
1756
|
* @param params Parameters including cursor and total items.
|
1758
|
-
* @returns
|
1757
|
+
* @returns A function that handles the span operation.
|
1759
1758
|
*/
|
1760
1759
|
spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
|
1761
1760
|
try {
|
@@ -1776,23 +1775,23 @@ var CustomCollectionHandler = class {
|
|
1776
1775
|
};
|
1777
1776
|
/**
|
1778
1777
|
* Dispatches the collection request to get items.
|
1779
|
-
* @param
|
1780
|
-
* @returns
|
1778
|
+
* @param cursor The cursor for pagination, or null for the first page.
|
1779
|
+
* @returns A promise that resolves to the page items.
|
1781
1780
|
*/
|
1782
1781
|
async dispatch(cursor = null) {
|
1783
1782
|
return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
|
1784
1783
|
}
|
1785
1784
|
/**
|
1786
1785
|
* Filters the items in the collection.
|
1787
|
-
* @param
|
1788
|
-
* @returns
|
1786
|
+
* @param items The items to filter.
|
1787
|
+
* @returns The filtered items.
|
1789
1788
|
*/
|
1790
1789
|
filterItems(items) {
|
1791
1790
|
return filterCollectionItems(items, this.name, this.filterPredicate);
|
1792
1791
|
}
|
1793
1792
|
/**
|
1794
1793
|
* Appends a cursor to the URL if it exists.
|
1795
|
-
* @param
|
1794
|
+
* @param cursor The cursor to append, or null/undefined.
|
1796
1795
|
* @returns The URL with cursor appended, or null if cursor is null/undefined.
|
1797
1796
|
*/
|
1798
1797
|
appendToUrl(cursor) {
|
@@ -1800,8 +1799,7 @@ var CustomCollectionHandler = class {
|
|
1800
1799
|
}
|
1801
1800
|
/**
|
1802
1801
|
* Gets the stored collection or collection page.
|
1803
|
-
* @returns
|
1804
|
-
the collection or collection page.
|
1802
|
+
* @returns A promise that resolves to the collection or collection page.
|
1805
1803
|
*/
|
1806
1804
|
get collection() {
|
1807
1805
|
if (this.#collection === null) this.#collection = this.getCollection();
|
@@ -1809,8 +1807,8 @@ var CustomCollectionHandler = class {
|
|
1809
1807
|
}
|
1810
1808
|
/**
|
1811
1809
|
* Gets the total number of items in the collection.
|
1812
|
-
* @returns
|
1813
|
-
|
1810
|
+
* @returns A promise that resolves to the total items count,
|
1811
|
+
* or null if not available.
|
1814
1812
|
*/
|
1815
1813
|
get totalItems() {
|
1816
1814
|
if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
|
@@ -1826,8 +1824,8 @@ var CustomCollectionHandler = class {
|
|
1826
1824
|
}
|
1827
1825
|
/**
|
1828
1826
|
* Gets the first cursor for pagination.
|
1829
|
-
* @returns
|
1830
|
-
or null if not available.
|
1827
|
+
* @returns A promise that resolves to the first cursor,
|
1828
|
+
* or null if not available.
|
1831
1829
|
*/
|
1832
1830
|
get firstCursor() {
|
1833
1831
|
const cursor = this.callbacks.firstCursor?.(this.context, this.values);
|
@@ -2234,7 +2232,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
|
2234
2232
|
*/
|
2235
2233
|
function sendActivity(options) {
|
2236
2234
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
2237
|
-
const tracer = tracerProvider.getTracer(
|
2235
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
2238
2236
|
return tracer.startActiveSpan("activitypub.send_activity", {
|
2239
2237
|
kind: __opentelemetry_api.SpanKind.CLIENT,
|
2240
2238
|
attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
|
@@ -2351,7 +2349,6 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2351
2349
|
firstKnock;
|
2352
2350
|
constructor(options) {
|
2353
2351
|
super();
|
2354
|
-
const logger$1 = (0, __logtape_logtape.getLogger)(["fedify", "federation"]);
|
2355
2352
|
this.kv = options.kv;
|
2356
2353
|
this.kvPrefixes = {
|
2357
2354
|
activityIdempotence: ["_fedify", "activityIdempotence"],
|
@@ -2399,14 +2396,15 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2399
2396
|
this.router.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
|
2400
2397
|
this._initializeRouter();
|
2401
2398
|
if (options.allowPrivateAddress || options.userAgent != null) {
|
2402
|
-
if (options.
|
2403
|
-
|
2399
|
+
if (options.documentLoaderFactory != null) throw new TypeError("Cannot set documentLoaderFactory with allowPrivateAddress or userAgent options.");
|
2400
|
+
if (options.contextLoaderFactory != null) throw new TypeError("Cannot set contextLoaderFactory with allowPrivateAddress or userAgent options.");
|
2401
|
+
if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
|
2404
2402
|
}
|
2405
2403
|
const { allowPrivateAddress, userAgent } = options;
|
2406
2404
|
this.allowPrivateAddress = allowPrivateAddress ?? false;
|
2407
2405
|
this.documentLoaderFactory = options.documentLoaderFactory ?? ((opts) => {
|
2408
|
-
return
|
2409
|
-
loader:
|
2406
|
+
return require_kv_cache.kvCache({
|
2407
|
+
loader: (0, __fedify_vocab_runtime.getDocumentLoader)({
|
2410
2408
|
allowPrivateAddress: opts?.allowPrivateAddress ?? allowPrivateAddress,
|
2411
2409
|
userAgent: opts?.userAgent ?? userAgent
|
2412
2410
|
}),
|
@@ -2414,12 +2412,8 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2414
2412
|
prefix: this.kvPrefixes.remoteDocument
|
2415
2413
|
});
|
2416
2414
|
});
|
2417
|
-
|
2418
|
-
|
2419
|
-
this.contextLoaderFactory = () => options.contextLoader;
|
2420
|
-
logger$1.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
|
2421
|
-
} else this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
2422
|
-
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => require_authdocloader.getAuthenticatedDocumentLoader(identity, {
|
2415
|
+
this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
2416
|
+
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => require_kv_cache.getAuthenticatedDocumentLoader(identity, {
|
2423
2417
|
allowPrivateAddress,
|
2424
2418
|
userAgent,
|
2425
2419
|
specDeterminer: new KvSpecDeterminer(this.kv, this.kvPrefixes.httpMessageSignaturesSpec, options.firstKnock),
|
@@ -2440,7 +2434,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2440
2434
|
this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
|
2441
2435
|
}
|
2442
2436
|
_getTracer() {
|
2443
|
-
return this.tracerProvider.getTracer(
|
2437
|
+
return this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
2444
2438
|
}
|
2445
2439
|
async _startQueueInternal(ctxData, signal, queue) {
|
2446
2440
|
if (this.inboxQueue == null && this.outboxQueue == null) return;
|
@@ -2538,7 +2532,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2538
2532
|
});
|
2539
2533
|
const keys = await Promise.all(message.keys.map(async ({ keyId, privateKey }) => ({
|
2540
2534
|
keyId: new URL(keyId),
|
2541
|
-
privateKey: await
|
2535
|
+
privateKey: await require_http.importJwk(privateKey, "private")
|
2542
2536
|
})));
|
2543
2537
|
const activity = await require_actor.Activity.fromJsonLd(message.activity, {
|
2544
2538
|
contextLoader: this.contextLoaderFactory({
|
@@ -2579,7 +2573,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2579
2573
|
for (const { keyId, privateKey } of message.keys) {
|
2580
2574
|
const pair = {
|
2581
2575
|
keyId: new URL(keyId),
|
2582
|
-
privateKey: await
|
2576
|
+
privateKey: await require_http.importJwk(privateKey, "private")
|
2583
2577
|
};
|
2584
2578
|
if (rsaKeyPair == null && pair.privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") rsaKeyPair = pair;
|
2585
2579
|
keys.push(pair);
|
@@ -2814,7 +2808,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2814
2808
|
let proofCreated = false;
|
2815
2809
|
let rsaKey = null;
|
2816
2810
|
for (const { keyId, privateKey } of keys) {
|
2817
|
-
|
2811
|
+
require_http.validateCryptoKey(privateKey, "private");
|
2818
2812
|
if (rsaKey == null && privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") {
|
2819
2813
|
rsaKey = {
|
2820
2814
|
keyId,
|
@@ -2882,7 +2876,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2882
2876
|
});
|
2883
2877
|
const keyJwkPairs = [];
|
2884
2878
|
for (const { keyId, privateKey } of keys) {
|
2885
|
-
const privateKeyJwk = await
|
2879
|
+
const privateKeyJwk = await require_http.exportJwk(privateKey);
|
2886
2880
|
keyJwkPairs.push({
|
2887
2881
|
keyId: keyId.href,
|
2888
2882
|
privateKey: privateKeyJwk
|
@@ -3582,7 +3576,7 @@ var ContextImpl = class ContextImpl {
|
|
3582
3576
|
});
|
3583
3577
|
}
|
3584
3578
|
sendActivity(sender, recipients, activity, options = {}) {
|
3585
|
-
const tracer = this.tracerProvider.getTracer(
|
3579
|
+
const tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
3586
3580
|
return tracer.startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
|
3587
3581
|
kind: this.federation.outboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
3588
3582
|
attributes: {
|
@@ -3639,7 +3633,7 @@ var ContextImpl = class ContextImpl {
|
|
3639
3633
|
keys = sender;
|
3640
3634
|
} else keys = [sender];
|
3641
3635
|
if (keys.length < 1) throw new TypeError("The sender's keys must not be empty.");
|
3642
|
-
for (const { privateKey } of keys)
|
3636
|
+
for (const { privateKey } of keys) require_http.validateCryptoKey(privateKey, "private");
|
3643
3637
|
const opts = { context: this };
|
3644
3638
|
let expandedRecipients;
|
3645
3639
|
if (Array.isArray(recipients)) expandedRecipients = recipients;
|
@@ -3680,7 +3674,7 @@ var ContextImpl = class ContextImpl {
|
|
3680
3674
|
}
|
3681
3675
|
const keyJwkPairs = await Promise.all(keys.map(async ({ keyId, privateKey }) => ({
|
3682
3676
|
keyId: keyId.href,
|
3683
|
-
privateKey: await
|
3677
|
+
privateKey: await require_http.exportJwk(privateKey)
|
3684
3678
|
})));
|
3685
3679
|
const carrier = {};
|
3686
3680
|
__opentelemetry_api.propagation.inject(__opentelemetry_api.context.active(), carrier);
|
@@ -3728,7 +3722,7 @@ var ContextImpl = class ContextImpl {
|
|
3728
3722
|
}
|
3729
3723
|
routeActivity(recipient, activity, options = {}) {
|
3730
3724
|
const tracerProvider = this.tracerProvider ?? this.tracerProvider;
|
3731
|
-
const tracer = tracerProvider.getTracer(
|
3725
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
3732
3726
|
return tracer.startActiveSpan("activitypub.inbox", {
|
3733
3727
|
kind: this.federation.inboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.INTERNAL : __opentelemetry_api.SpanKind.PRODUCER,
|
3734
3728
|
attributes: { "activitypub.activity.type": require_actor.getTypeId(activity).href }
|
@@ -3946,7 +3940,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
3946
3940
|
});
|
3947
3941
|
}
|
3948
3942
|
forwardActivity(forwarder, recipients, options) {
|
3949
|
-
const tracer = this.tracerProvider.getTracer(
|
3943
|
+
const tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
3950
3944
|
return tracer.startActiveSpan("activitypub.outbox", {
|
3951
3945
|
kind: this.federation.outboxQueue == null || options?.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
|
3952
3946
|
attributes: { "activitypub.activity.type": this.activityType }
|
@@ -4047,7 +4041,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
4047
4041
|
});
|
4048
4042
|
const keyJwkPairs = [];
|
4049
4043
|
for (const { keyId, privateKey } of keys) {
|
4050
|
-
const privateKeyJwk = await
|
4044
|
+
const privateKeyJwk = await require_http.exportJwk(privateKey);
|
4051
4045
|
keyJwkPairs.push({
|
4052
4046
|
keyId: keyId.href,
|
4053
4047
|
privateKey: privateKeyJwk
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import "./lookup-NXjB7xUj.js";
|
7
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-BMPvaTpX.js";
|
8
|
+
import "./client-pY7-3icS.js";
|
9
|
+
import "./types-C2XVl6gj.js";
|
10
|
+
import "./actor-BLq4KEGR.js";
|
11
|
+
import "./key-CgKiloJr.js";
|
12
|
+
import "./http-B9npZ3Md.js";
|
13
|
+
import "./ld-B7TO6JH2.js";
|
14
|
+
import "./owner-CSktF-2s.js";
|
15
|
+
import "./proof-Cs5Mcy_U.js";
|
16
|
+
import "./docloader-DtYIz2Pb.js";
|
17
|
+
import "./kv-cache-z0lgwFi_.js";
|
18
|
+
import "./inbox-CY8fblhz.js";
|
19
|
+
import "./builder-C4gbKvM5.js";
|
20
|
+
import "./collection-BzWsN9pB.js";
|
21
|
+
import "./keycache-B6O-bhMs.js";
|
22
|
+
import "./negotiation-C4nFufNk.js";
|
23
|
+
import "./retry-CfF8Gn4d.js";
|
24
|
+
import "./send-vPZ03xUr.js";
|
25
|
+
|
26
|
+
export { FederationImpl };
|
@@ -3,21 +3,20 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import { getDefaultActivityTransformers } from "./transformers-BFT6d7J5.js";
|
6
|
-
import { deno_default,
|
7
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-CrxhFL8e.js";
|
14
|
-
import { lookupObject, traverseCollection } from "./vocab-BWoeZsME.js";
|
6
|
+
import { deno_default, lookupWebFinger } from "./lookup-fEH6e7ZX.js";
|
7
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-btAA7QSA.js";
|
8
|
+
import { doubleKnock, exportJwk, importJwk, validateCryptoKey, verifyRequest } from "./http-D7qwMpca.js";
|
9
|
+
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-BT65yR1Q.js";
|
10
|
+
import { getNodeInfo, nodeInfoToJson } from "./types-BtUjyi5y.js";
|
11
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-DkW_lqUw.js";
|
12
|
+
import { lookupObject, traverseCollection } from "./vocab-wADjlIH4.js";
|
15
13
|
import { getLogger, withContext } from "@logtape/logtape";
|
16
14
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
17
|
-
import {
|
15
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
18
16
|
import { cloneDeep } from "es-toolkit";
|
19
17
|
import { Router } from "uri-template-router";
|
20
18
|
import { parseTemplate } from "url-template";
|
19
|
+
import { encodeHex } from "byte-encodings/hex";
|
21
20
|
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";
|
22
21
|
import { domainToASCII } from "node:url";
|
23
22
|
|
@@ -339,7 +338,7 @@ var FederationBuilderImpl = class {
|
|
339
338
|
this.collectionTypeIds = {};
|
340
339
|
}
|
341
340
|
async build(options) {
|
342
|
-
const { FederationImpl: FederationImpl$1 } = await import("./middleware-
|
341
|
+
const { FederationImpl: FederationImpl$1 } = await import("./middleware-Yk-MuxWc.js");
|
343
342
|
const f = new FederationImpl$1(options);
|
344
343
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
345
344
|
f.router = this.router.clone();
|
@@ -792,11 +791,11 @@ var FederationBuilderImpl = class {
|
|
792
791
|
};
|
793
792
|
return setters;
|
794
793
|
}
|
795
|
-
setCollectionDispatcher(name,
|
796
|
-
return this.#setCustomCollectionDispatcher(name, "collection",
|
794
|
+
setCollectionDispatcher(name, itemType, path, dispatcher) {
|
795
|
+
return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
|
797
796
|
}
|
798
|
-
setOrderedCollectionDispatcher(name,
|
799
|
-
return this.#setCustomCollectionDispatcher(name, "orderedCollection",
|
797
|
+
setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
|
798
|
+
return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
|
800
799
|
}
|
801
800
|
#setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
|
802
801
|
const strName = String(name);
|
@@ -1550,7 +1549,7 @@ async function handleInboxInternal(request, parameters, span) {
|
|
1550
1549
|
/**
|
1551
1550
|
* Handles a custom collection request.
|
1552
1551
|
* @template TItem The type of items in the collection.
|
1553
|
-
* @template
|
1552
|
+
* @template TParam The parameter names of the requested URL.
|
1554
1553
|
* @template TContext The type of the context, extending {@link RequestContext}.
|
1555
1554
|
* @template TContextData The context data to pass to the `TContext`.
|
1556
1555
|
* @param request The HTTP request.
|
@@ -1568,7 +1567,7 @@ async function _handleCustomCollection(request, { name, values, context: context
|
|
1568
1567
|
/**
|
1569
1568
|
* Handles an ordered collection request.
|
1570
1569
|
* @template TItem The type of items in the collection.
|
1571
|
-
* @template
|
1570
|
+
* @template TParam The parameter names of the requested URL.
|
1572
1571
|
* @template TContext The type of the context, extending {@link RequestContext}.
|
1573
1572
|
* @template TContextData The context data to pass to the `TContext`.
|
1574
1573
|
* @param request The HTTP request.
|
@@ -1588,7 +1587,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
|
|
1588
1587
|
* The main flow is on `getCollection`, `dispatch`.
|
1589
1588
|
*
|
1590
1589
|
* @template TItem The type of items in the collection.
|
1591
|
-
* @template
|
1590
|
+
* @template TParam The parameter names of the requested URL.
|
1592
1591
|
* @template TContext The type of the context. {@link Context} or {@link RequestContext}.
|
1593
1592
|
* @template TContextData The context data to pass to the `TContext`.
|
1594
1593
|
* @template TCollection The type of the collection, extending {@link Collection}.
|
@@ -1622,14 +1621,14 @@ var CustomCollectionHandler = class {
|
|
1622
1621
|
#collection = null;
|
1623
1622
|
/**
|
1624
1623
|
* Creates a new CustomCollection instance.
|
1625
|
-
* @param
|
1626
|
-
* @param
|
1627
|
-
* @param
|
1628
|
-
* @param
|
1629
|
-
* @param
|
1630
|
-
* @param
|
1631
|
-
* @param
|
1632
|
-
* @param
|
1624
|
+
* @param name The name of the collection.
|
1625
|
+
* @param values The parameter values for the collection.
|
1626
|
+
* @param context The request context.
|
1627
|
+
* @param callbacks The collection callbacks.
|
1628
|
+
* @param tracerProvider The tracer provider for telemetry.
|
1629
|
+
* @param Collection The Collection constructor.
|
1630
|
+
* @param CollectionPage The CollectionPage constructor.
|
1631
|
+
* @param filterPredicate Optional filter predicate for items.
|
1633
1632
|
*/
|
1634
1633
|
constructor(name, values, context$1, callbacks, tracerProvider = trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
|
1635
1634
|
this.name = name;
|
@@ -1754,7 +1753,7 @@ var CustomCollectionHandler = class {
|
|
1754
1753
|
/**
|
1755
1754
|
* Creates a function to wrap the dispatcher so tracing can be applied.
|
1756
1755
|
* @param params Parameters including cursor and total items.
|
1757
|
-
* @returns
|
1756
|
+
* @returns A function that handles the span operation.
|
1758
1757
|
*/
|
1759
1758
|
spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
|
1760
1759
|
try {
|
@@ -1775,23 +1774,23 @@ var CustomCollectionHandler = class {
|
|
1775
1774
|
};
|
1776
1775
|
/**
|
1777
1776
|
* Dispatches the collection request to get items.
|
1778
|
-
* @param
|
1779
|
-
* @returns
|
1777
|
+
* @param cursor The cursor for pagination, or null for the first page.
|
1778
|
+
* @returns A promise that resolves to the page items.
|
1780
1779
|
*/
|
1781
1780
|
async dispatch(cursor = null) {
|
1782
1781
|
return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
|
1783
1782
|
}
|
1784
1783
|
/**
|
1785
1784
|
* Filters the items in the collection.
|
1786
|
-
* @param
|
1787
|
-
* @returns
|
1785
|
+
* @param items The items to filter.
|
1786
|
+
* @returns The filtered items.
|
1788
1787
|
*/
|
1789
1788
|
filterItems(items) {
|
1790
1789
|
return filterCollectionItems(items, this.name, this.filterPredicate);
|
1791
1790
|
}
|
1792
1791
|
/**
|
1793
1792
|
* Appends a cursor to the URL if it exists.
|
1794
|
-
* @param
|
1793
|
+
* @param cursor The cursor to append, or null/undefined.
|
1795
1794
|
* @returns The URL with cursor appended, or null if cursor is null/undefined.
|
1796
1795
|
*/
|
1797
1796
|
appendToUrl(cursor) {
|
@@ -1799,8 +1798,7 @@ var CustomCollectionHandler = class {
|
|
1799
1798
|
}
|
1800
1799
|
/**
|
1801
1800
|
* Gets the stored collection or collection page.
|
1802
|
-
* @returns
|
1803
|
-
the collection or collection page.
|
1801
|
+
* @returns A promise that resolves to the collection or collection page.
|
1804
1802
|
*/
|
1805
1803
|
get collection() {
|
1806
1804
|
if (this.#collection === null) this.#collection = this.getCollection();
|
@@ -1808,8 +1806,8 @@ var CustomCollectionHandler = class {
|
|
1808
1806
|
}
|
1809
1807
|
/**
|
1810
1808
|
* Gets the total number of items in the collection.
|
1811
|
-
* @returns
|
1812
|
-
|
1809
|
+
* @returns A promise that resolves to the total items count,
|
1810
|
+
* or null if not available.
|
1813
1811
|
*/
|
1814
1812
|
get totalItems() {
|
1815
1813
|
if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
|
@@ -1825,8 +1823,8 @@ var CustomCollectionHandler = class {
|
|
1825
1823
|
}
|
1826
1824
|
/**
|
1827
1825
|
* Gets the first cursor for pagination.
|
1828
|
-
* @returns
|
1829
|
-
or null if not available.
|
1826
|
+
* @returns A promise that resolves to the first cursor,
|
1827
|
+
* or null if not available.
|
1830
1828
|
*/
|
1831
1829
|
get firstCursor() {
|
1832
1830
|
const cursor = this.callbacks.firstCursor?.(this.context, this.values);
|
@@ -2350,7 +2348,6 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2350
2348
|
firstKnock;
|
2351
2349
|
constructor(options) {
|
2352
2350
|
super();
|
2353
|
-
const logger$1 = getLogger(["fedify", "federation"]);
|
2354
2351
|
this.kv = options.kv;
|
2355
2352
|
this.kvPrefixes = {
|
2356
2353
|
activityIdempotence: ["_fedify", "activityIdempotence"],
|
@@ -2398,8 +2395,9 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2398
2395
|
this.router.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
|
2399
2396
|
this._initializeRouter();
|
2400
2397
|
if (options.allowPrivateAddress || options.userAgent != null) {
|
2401
|
-
if (options.
|
2402
|
-
|
2398
|
+
if (options.documentLoaderFactory != null) throw new TypeError("Cannot set documentLoaderFactory with allowPrivateAddress or userAgent options.");
|
2399
|
+
if (options.contextLoaderFactory != null) throw new TypeError("Cannot set contextLoaderFactory with allowPrivateAddress or userAgent options.");
|
2400
|
+
if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
|
2403
2401
|
}
|
2404
2402
|
const { allowPrivateAddress, userAgent } = options;
|
2405
2403
|
this.allowPrivateAddress = allowPrivateAddress ?? false;
|
@@ -2413,11 +2411,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2413
2411
|
prefix: this.kvPrefixes.remoteDocument
|
2414
2412
|
});
|
2415
2413
|
});
|
2416
|
-
|
2417
|
-
if (options.contextLoaderFactory != null) throw new TypeError("Cannot set both contextLoader and contextLoaderFactory options at a time; use contextLoaderFactory only.");
|
2418
|
-
this.contextLoaderFactory = () => options.contextLoader;
|
2419
|
-
logger$1.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
|
2420
|
-
} else this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
2414
|
+
this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
|
2421
2415
|
this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => getAuthenticatedDocumentLoader(identity, {
|
2422
2416
|
allowPrivateAddress,
|
2423
2417
|
userAgent,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "./transformers-BFT6d7J5.js";
|
6
|
+
import "./lookup-fEH6e7ZX.js";
|
7
|
+
import "./actor-btAA7QSA.js";
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-D_VyRsDx.js";
|
9
|
+
import "./http-D7qwMpca.js";
|
10
|
+
import "./proof-BT65yR1Q.js";
|
11
|
+
import "./types-BtUjyi5y.js";
|
12
|
+
import "./kv-cache-DkW_lqUw.js";
|
13
|
+
import "./vocab-wADjlIH4.js";
|
14
|
+
|
15
|
+
export { FederationImpl };
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
require('./transformers-CoBS-oFG.cjs');
|
6
|
+
require('./lookup-Cc3ZAAis.cjs');
|
7
|
+
require('./actor-C3oFUgfc.cjs');
|
8
|
+
const require_middleware = require('./middleware-C8w5YYxK.cjs');
|
9
|
+
require('./http-ngJvMHez.cjs');
|
10
|
+
require('./proof-feEDocLH.cjs');
|
11
|
+
require('./types-CWgzGaqk.cjs');
|
12
|
+
require('./kv-cache-BrjWZnGU.cjs');
|
13
|
+
require('./vocab-NvDV-exu.cjs');
|
14
|
+
|
15
|
+
exports.FederationImpl = require_middleware.FederationImpl;
|
@@ -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-BCWe1Ih5.js";
|
4
|
+
import { KeyCache } from "./http-BbO0ejuk.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
|
/**
|