@fedify/fedify 2.0.0-pr.435.1667 → 2.0.0-pr.435.1673
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-Cpal85xW.js → actor-BxAu0qet.js} +1 -1
- package/dist/{actor-C3gJhZJj.cjs → actor-CNUje03O.cjs} +187 -187
- package/dist/{actor-CnVfp1Hp.js → actor-m_ko-86v.js} +187 -187
- package/dist/{assert_rejects-7UF4R_Qs.js → assert_rejects-DiIiJbZn.js} +1 -1
- package/dist/{assert_throws-53_pKeP3.js → assert_throws-BOO88avQ.js} +1 -1
- package/dist/{authdocloader-Df2BFefL.js → authdocloader-Chl2nuOI.js} +3 -3
- package/dist/{authdocloader-DPCGwidE.cjs → authdocloader-D_3mtAjX.cjs} +3 -3
- package/dist/{authdocloader-DWnwkjvZ.js → authdocloader-nRFL9luh.js} +3 -3
- package/dist/{builder-CMxichO9.js → builder-C8Of4dPy.js} +4 -4
- package/dist/{client-BqyuOGiQ.js → client-yGBH5stP.js} +1 -1
- package/dist/compat/mod.d.cts +2 -2
- package/dist/compat/mod.d.ts +2 -2
- package/dist/compat/transformers.test.js +18 -17
- package/dist/{context-CDSZdQHD.d.ts → context-CQsAT7xk.d.ts} +0 -1
- package/dist/{context-Dq8aCtMH.d.cts → context-tVOQ76fi.d.cts} +0 -1
- package/dist/{docloader-B1O1Z5OK.cjs → docloader-SZjTrl6Z.cjs} +2 -2
- package/dist/{docloader-xJVzq9O0.js → docloader-_WdHTWQR.js} +2 -2
- package/dist/{esm-BBznxjVc.js → esm-e_G_xo95.js} +1 -1
- package/dist/federation/builder.test.js +10 -10
- package/dist/federation/collection.test.js +8 -8
- package/dist/federation/handler.test.js +26 -145
- package/dist/federation/inbox.test.js +6 -6
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +8 -8
- package/dist/federation/middleware.test.js +255 -38
- package/dist/federation/mod.cjs +10 -10
- package/dist/federation/mod.d.cts +1 -1
- package/dist/federation/mod.d.ts +1 -1
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +10 -10
- package/dist/federation/negotiation.test.d.ts +3 -0
- package/dist/federation/negotiation.test.js +28 -0
- package/dist/federation/retry.test.js +5 -5
- package/dist/federation/router.test.js +8 -8
- package/dist/federation/send.test.js +15 -15
- package/dist/{http-y7khnX5Q.js → http-BEo67UOx.js} +2 -2
- package/dist/{http-CovAm6we.js → http-BpoEurUR.js} +3 -3
- package/dist/{http-Hw9HJp9i.cjs → http-DREvFalF.cjs} +3 -3
- package/dist/{inbox-DpcYOzs8.js → inbox-D-B5xFtJ.js} +1 -1
- package/dist/key-BvvbahfP.cjs +10 -0
- package/dist/{key-BRmlopJL.js → key-Cf8KTg-A.js} +2 -2
- package/dist/{key-DORX19Bl.js → key-Cps8Sv3N.js} +2 -2
- package/dist/{key-lapZwBwG.js → key-DJpcumqB.js} +4 -4
- package/dist/{key-jf6dIIF-.js → key-DqrTz8Xq.js} +3 -3
- package/dist/{key-CzF9SAEI.cjs → key-JqiQvcq1.cjs} +2 -2
- package/dist/{keycache-AH1uj1j-.js → keycache-D_Q1fPV0.js} +1 -1
- package/dist/{keys-B3fzLXBG.js → keys-F0jh2GNR.js} +1 -1
- package/dist/{ld-D3cq9xO1.js → ld-CXygHn_m.js} +2 -2
- package/dist/{lookup-7u217Q3H.cjs → lookup-C-Y0Ep1a.cjs} +1 -1
- package/dist/{lookup-CfU0DgLr.js → lookup-C6WSLjPE.js} +1 -1
- package/dist/{lookup-BrhURkmj.js → lookup-DuqY2_In.js} +1 -1
- package/dist/{middleware-DXWUGrBQ.js → middleware-2qNNXYEE.js} +32 -63
- package/dist/middleware-BD1IE5O5.js +26 -0
- package/dist/{middleware-Gsxukxs5.cjs → middleware-BsFAFlnZ.cjs} +32 -63
- package/dist/middleware-BuZrvrDv.js +17 -0
- package/dist/{middleware-BDN7YoYJ.js → middleware-CMiUxZ6O.js} +35 -130
- package/dist/middleware-h_3nRr8m.cjs +17 -0
- package/dist/{mod-RI3-KvUI.d.ts → mod-B26zRlH1.d.ts} +1 -1
- package/dist/{mod-BhMnAkFX.d.cts → mod-DBQAI4v9.d.cts} +1 -1
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +2 -2
- package/dist/mod.d.ts +2 -2
- package/dist/mod.js +10 -10
- package/dist/negotiation-5NPJL6zp.js +71 -0
- package/dist/nodeinfo/client.test.js +10 -10
- package/dist/nodeinfo/handler.test.js +23 -22
- package/dist/nodeinfo/mod.cjs +2 -2
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/types.test.js +8 -8
- package/dist/{owner-NFlQJyvM.js → owner-D2fTlp_x.js} +2 -2
- package/dist/{proof-Gip91fK7.cjs → proof-C4Y4gJcm.cjs} +3 -3
- package/dist/{proof-Be1oOYEh.js → proof-CHM9su4L.js} +3 -3
- package/dist/{proof-ar9xgPWi.js → proof-kEUjWRNJ.js} +2 -2
- package/dist/runtime/authdocloader.test.js +14 -14
- package/dist/runtime/docloader.test.js +9 -9
- package/dist/runtime/key.test.js +10 -10
- package/dist/runtime/langstr.test.js +8 -8
- package/dist/runtime/link.test.js +3 -3
- package/dist/runtime/mod.cjs +6 -6
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +8 -8
- package/dist/runtime/url.test.js +5 -5
- package/dist/{send-DkwkMFjJ.js → send-Utq2Jm0I.js} +2 -2
- package/dist/sig/http.test.js +13 -13
- package/dist/sig/key.test.js +11 -11
- package/dist/sig/ld.test.js +10 -10
- package/dist/sig/mod.cjs +6 -6
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +12 -12
- package/dist/sig/proof.test.js +12 -12
- package/dist/testing/docloader.test.js +8 -8
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-BMBhkcz9.js → testing-DUpTIvNE.js} +2 -2
- package/dist/{type-FCer_9yh.js → type-BYN6Ax2M.js} +187 -187
- package/dist/{types-CZ_qo9KW.cjs → types-BBpQe860.cjs} +1 -1
- package/dist/{types-CNWeAz8v.js → types-BXkh8ctL.js} +1 -1
- package/dist/vocab/actor.test.js +10 -10
- package/dist/vocab/lookup.test.js +9 -9
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +9 -9
- package/dist/{vocab-9MjZjuZb.cjs → vocab-DWZQ7gVQ.cjs} +3 -3
- package/dist/{vocab-gpwUU9fc.js → vocab-PKJB4DyY.js} +3 -3
- package/dist/webfinger/handler.test.js +23 -22
- package/dist/webfinger/lookup.test.js +9 -9
- package/dist/webfinger/mod.cjs +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +8 -8
- package/dist/x/hono.d.cts +1 -1
- package/dist/x/hono.d.ts +1 -1
- package/dist/x/sveltekit.d.cts +1 -1
- package/dist/x/sveltekit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/key-CV3FT32G.cjs +0 -10
- package/dist/middleware-CV-OPMlZ.js +0 -17
- package/dist/middleware-DGqnaAbp.cjs +0 -17
- package/dist/middleware-cCdfTTMv.js +0 -25
- /package/dist/{assert_is_error-B035L3om.js → assert_is_error-BPGph1Jx.js} +0 -0
- /package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-f3m3epl3.js} +0 -0
- /package/dist/{denokv-jZ0Z2h0M.js → denokv-Bv33Xxea.js} +0 -0
- /package/dist/{retry-CfF8Gn4d.js → retry-D4GJ670a.js} +0 -0
- /package/dist/{std__assert-DWivtrGR.js → std__assert-X-_kMxKM.js} +0 -0
@@ -4,15 +4,15 @@
|
|
4
4
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
6
|
const require_transformers = require('./transformers-CoBS-oFG.cjs');
|
7
|
-
const require_docloader = require('./docloader-
|
8
|
-
const require_actor = require('./actor-
|
9
|
-
const require_lookup = require('./lookup-
|
10
|
-
const require_key = require('./key-
|
11
|
-
const require_http = require('./http-
|
12
|
-
const require_proof = require('./proof-
|
13
|
-
const require_types = require('./types-
|
14
|
-
const require_authdocloader = require('./authdocloader-
|
15
|
-
const require_vocab = require('./vocab-
|
7
|
+
const require_docloader = require('./docloader-SZjTrl6Z.cjs');
|
8
|
+
const require_actor = require('./actor-CNUje03O.cjs');
|
9
|
+
const require_lookup = require('./lookup-C-Y0Ep1a.cjs');
|
10
|
+
const require_key = require('./key-JqiQvcq1.cjs');
|
11
|
+
const require_http = require('./http-DREvFalF.cjs');
|
12
|
+
const require_proof = require('./proof-C4Y4gJcm.cjs');
|
13
|
+
const require_types = require('./types-BBpQe860.cjs');
|
14
|
+
const require_authdocloader = require('./authdocloader-D_3mtAjX.cjs');
|
15
|
+
const require_vocab = require('./vocab-DWZQ7gVQ.cjs');
|
16
16
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
17
17
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
18
18
|
const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
|
@@ -322,7 +322,7 @@ var FederationBuilderImpl = class {
|
|
322
322
|
this.collectionTypeIds = {};
|
323
323
|
}
|
324
324
|
async build(options) {
|
325
|
-
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-
|
325
|
+
const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-h_3nRr8m.cjs"));
|
326
326
|
const f = new FederationImpl$1(options);
|
327
327
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
328
328
|
f.router = this.router.clone();
|
@@ -980,9 +980,6 @@ function preferredMediaTypes(accept) {
|
|
980
980
|
const accepts = parseAccept(accept === void 0 ? "*/*" : accept ?? "");
|
981
981
|
return accepts.filter(isQuality).sort(compareSpecs).map(getFullType);
|
982
982
|
}
|
983
|
-
|
984
|
-
//#endregion
|
985
|
-
//#region src/federation/handler.ts
|
986
983
|
function acceptsJsonLd(request) {
|
987
984
|
const accept = request.headers.get("Accept");
|
988
985
|
const types = accept ? preferredMediaTypes(accept) : ["*/*"];
|
@@ -990,6 +987,9 @@ function acceptsJsonLd(request) {
|
|
990
987
|
if (types[0] === "text/html" || types[0] === "application/xhtml+xml") return false;
|
991
988
|
return types.includes("application/activity+json") || types.includes("application/ld+json") || types.includes("application/json");
|
992
989
|
}
|
990
|
+
|
991
|
+
//#endregion
|
992
|
+
//#region src/federation/handler.ts
|
993
993
|
/**
|
994
994
|
* Handles an actor request.
|
995
995
|
* @template TContextData The context data to pass to the context.
|
@@ -997,7 +997,7 @@ function acceptsJsonLd(request) {
|
|
997
997
|
* @param parameters The parameters for handling the actor.
|
998
998
|
* @returns A promise that resolves to an HTTP response.
|
999
999
|
*/
|
1000
|
-
async function handleActor(request, { identifier, context: context$2, actorDispatcher, authorizePredicate, onNotFound,
|
1000
|
+
async function handleActor(request, { identifier, context: context$2, actorDispatcher, authorizePredicate, onNotFound, onUnauthorized }) {
|
1001
1001
|
const logger$1 = (0, __logtape_logtape.getLogger)([
|
1002
1002
|
"fedify",
|
1003
1003
|
"federation",
|
@@ -1012,7 +1012,6 @@ async function handleActor(request, { identifier, context: context$2, actorDispa
|
|
1012
1012
|
logger$1.debug("Actor {identifier} not found.", { identifier });
|
1013
1013
|
return await onNotFound(request);
|
1014
1014
|
}
|
1015
|
-
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
1016
1015
|
if (authorizePredicate != null) {
|
1017
1016
|
let key = await context$2.getSignedKey();
|
1018
1017
|
key = key?.clone({}, { $warning: {
|
@@ -1047,11 +1046,10 @@ async function handleActor(request, { identifier, context: context$2, actorDispa
|
|
1047
1046
|
* @param parameters The parameters for handling the object.
|
1048
1047
|
* @returns A promise that resolves to an HTTP response.
|
1049
1048
|
*/
|
1050
|
-
async function handleObject(request, { values, context: context$2, objectDispatcher, authorizePredicate, onNotFound,
|
1049
|
+
async function handleObject(request, { values, context: context$2, objectDispatcher, authorizePredicate, onNotFound, onUnauthorized }) {
|
1051
1050
|
if (objectDispatcher == null) return await onNotFound(request);
|
1052
1051
|
const object = await objectDispatcher(context$2, values);
|
1053
1052
|
if (object == null) return await onNotFound(request);
|
1054
|
-
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
1055
1053
|
if (authorizePredicate != null) {
|
1056
1054
|
let key = await context$2.getSignedKey();
|
1057
1055
|
key = key?.clone({}, { $warning: {
|
@@ -1089,7 +1087,7 @@ async function handleObject(request, { values, context: context$2, objectDispatc
|
|
1089
1087
|
* @param parameters The parameters for handling the collection.
|
1090
1088
|
* @returns A promise that resolves to an HTTP response.
|
1091
1089
|
*/
|
1092
|
-
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound
|
1090
|
+
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
|
1093
1091
|
const spanName = name.trim().replace(/\s+/g, "_");
|
1094
1092
|
tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
1095
1093
|
const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
|
@@ -1202,7 +1200,6 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
1202
1200
|
partOf
|
1203
1201
|
});
|
1204
1202
|
}
|
1205
|
-
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
1206
1203
|
if (collectionCallbacks.authorizePredicate != null) {
|
1207
1204
|
let key = await context$2.getSignedKey();
|
1208
1205
|
key = key?.clone({}, { $warning: {
|
@@ -1540,7 +1537,6 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
|
|
1540
1537
|
const handleCustomCollection = exceptWrapper(_handleCustomCollection);
|
1541
1538
|
async function _handleCustomCollection(request, { name, values, context: context$2, tracerProvider, collectionCallbacks: callbacks, filterPredicate }) {
|
1542
1539
|
verifyDefined(callbacks);
|
1543
|
-
verifyJsonLdRequest(request);
|
1544
1540
|
await authIfNeeded(context$2, values, callbacks);
|
1545
1541
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
1546
1542
|
return await new CustomCollectionHandler(name, values, context$2, callbacks, tracerProvider, require_actor.Collection, require_actor.CollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
|
@@ -1559,7 +1555,6 @@ async function _handleCustomCollection(request, { name, values, context: context
|
|
1559
1555
|
const handleOrderedCollection = exceptWrapper(_handleOrderedCollection);
|
1560
1556
|
async function _handleOrderedCollection(request, { name, values, context: context$2, tracerProvider, collectionCallbacks: callbacks, filterPredicate }) {
|
1561
1557
|
verifyDefined(callbacks);
|
1562
|
-
verifyJsonLdRequest(request);
|
1563
1558
|
await authIfNeeded(context$2, values, callbacks);
|
1564
1559
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
1565
1560
|
return await new CustomCollectionHandler(name, values, context$2, callbacks, tracerProvider, require_actor.OrderedCollection, require_actor.OrderedCollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
|
@@ -1837,10 +1832,9 @@ function exceptWrapper(handler) {
|
|
1837
1832
|
try {
|
1838
1833
|
return await handler(request, handlerParams);
|
1839
1834
|
} catch (error) {
|
1840
|
-
const { onNotFound,
|
1835
|
+
const { onNotFound, onUnauthorized } = handlerParams;
|
1841
1836
|
switch (error?.constructor) {
|
1842
1837
|
case ItemsNotFoundError: return await onNotFound(request);
|
1843
|
-
case NotAcceptableError: return await onNotAcceptable(request);
|
1844
1838
|
case UnauthorizedError: return await onUnauthorized(request);
|
1845
1839
|
default: throw error;
|
1846
1840
|
}
|
@@ -1858,15 +1852,6 @@ const verifyDefined = (callbacks) => {
|
|
1858
1852
|
if (callbacks === void 0) throw new ItemsNotFoundError();
|
1859
1853
|
};
|
1860
1854
|
/**
|
1861
|
-
* Verifies that a request accepts JSON-LD content type.
|
1862
|
-
* @param request The HTTP request to verify.
|
1863
|
-
* @throws {NotAcceptableError} If the request doesn't accept JSON-LD.
|
1864
|
-
* @since 1.8.0
|
1865
|
-
*/
|
1866
|
-
const verifyJsonLdRequest = (request) => {
|
1867
|
-
if (!acceptsJsonLd(request)) throw new NotAcceptableError();
|
1868
|
-
};
|
1869
|
-
/**
|
1870
1855
|
* Performs authorization if needed based on the authorization predicate.
|
1871
1856
|
* @template TContextData The context data type.
|
1872
1857
|
* @param {RequestContext<TContextData>} context The request context.
|
@@ -1950,15 +1935,6 @@ var ItemsNotFoundError = class extends HandlerError {
|
|
1950
1935
|
}
|
1951
1936
|
};
|
1952
1937
|
/**
|
1953
|
-
* Error thrown when the request is not acceptable (e.g., wrong content type).
|
1954
|
-
* @since 1.8.0
|
1955
|
-
*/
|
1956
|
-
var NotAcceptableError = class extends HandlerError {
|
1957
|
-
constructor() {
|
1958
|
-
super("The request is not acceptable.");
|
1959
|
-
}
|
1960
|
-
};
|
1961
|
-
/**
|
1962
1938
|
* Error thrown when access to a collection is unauthorized.
|
1963
1939
|
* @since 1.8.0
|
1964
1940
|
*/
|
@@ -2956,6 +2932,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2956
2932
|
span,
|
2957
2933
|
tracer
|
2958
2934
|
});
|
2935
|
+
if (acceptsJsonLd(request)) response.headers.set("Vary", "Accept");
|
2959
2936
|
} catch (error) {
|
2960
2937
|
span.setStatus({
|
2961
2938
|
code: __opentelemetry_api.SpanStatusCode.ERROR,
|
@@ -3019,6 +2996,9 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3019
2996
|
context: context$2,
|
3020
2997
|
nodeInfoDispatcher: this.nodeInfoDispatcher
|
3021
2998
|
});
|
2999
|
+
}
|
3000
|
+
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
3001
|
+
switch (routeName) {
|
3022
3002
|
case "actor":
|
3023
3003
|
context$2 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier ?? route.values.handle } });
|
3024
3004
|
return await handleActor(request, {
|
@@ -3027,8 +3007,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3027
3007
|
actorDispatcher: this.actorCallbacks?.dispatcher,
|
3028
3008
|
authorizePredicate: this.actorCallbacks?.authorizePredicate,
|
3029
3009
|
onUnauthorized,
|
3030
|
-
onNotFound
|
3031
|
-
onNotAcceptable
|
3010
|
+
onNotFound
|
3032
3011
|
});
|
3033
3012
|
case "object": {
|
3034
3013
|
const typeId = route.name.replace(/^object:/, "");
|
@@ -3044,8 +3023,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3044
3023
|
objectDispatcher: callbacks?.dispatcher,
|
3045
3024
|
authorizePredicate: callbacks?.authorizePredicate,
|
3046
3025
|
onUnauthorized,
|
3047
|
-
onNotFound
|
3048
|
-
onNotAcceptable
|
3026
|
+
onNotFound
|
3049
3027
|
});
|
3050
3028
|
}
|
3051
3029
|
case "outbox": return await handleCollection(request, {
|
@@ -3056,8 +3034,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3056
3034
|
collectionCallbacks: this.outboxCallbacks,
|
3057
3035
|
tracerProvider: this.tracerProvider,
|
3058
3036
|
onUnauthorized,
|
3059
|
-
onNotFound
|
3060
|
-
onNotAcceptable
|
3037
|
+
onNotFound
|
3061
3038
|
});
|
3062
3039
|
case "inbox":
|
3063
3040
|
if (request.method !== "POST") return await handleCollection(request, {
|
@@ -3068,8 +3045,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3068
3045
|
collectionCallbacks: this.inboxCallbacks,
|
3069
3046
|
tracerProvider: this.tracerProvider,
|
3070
3047
|
onUnauthorized,
|
3071
|
-
onNotFound
|
3072
|
-
onNotAcceptable
|
3048
|
+
onNotFound
|
3073
3049
|
});
|
3074
3050
|
context$2 = this.#createContext(request, contextData, { documentLoader: await context$2.getDocumentLoader({ identifier: route.values.identifier ?? route.values.handle }) });
|
3075
3051
|
case "sharedInbox":
|
@@ -3101,8 +3077,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3101
3077
|
collectionCallbacks: this.followingCallbacks,
|
3102
3078
|
tracerProvider: this.tracerProvider,
|
3103
3079
|
onUnauthorized,
|
3104
|
-
onNotFound
|
3105
|
-
onNotAcceptable
|
3080
|
+
onNotFound
|
3106
3081
|
});
|
3107
3082
|
case "followers": {
|
3108
3083
|
let baseUrl = url.searchParams.get("base-url");
|
@@ -3125,8 +3100,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3125
3100
|
collectionCallbacks: this.followersCallbacks,
|
3126
3101
|
tracerProvider: this.tracerProvider,
|
3127
3102
|
onUnauthorized,
|
3128
|
-
onNotFound
|
3129
|
-
onNotAcceptable
|
3103
|
+
onNotFound
|
3130
3104
|
});
|
3131
3105
|
}
|
3132
3106
|
case "liked": return await handleCollection(request, {
|
@@ -3137,8 +3111,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3137
3111
|
collectionCallbacks: this.likedCallbacks,
|
3138
3112
|
tracerProvider: this.tracerProvider,
|
3139
3113
|
onUnauthorized,
|
3140
|
-
onNotFound
|
3141
|
-
onNotAcceptable
|
3114
|
+
onNotFound
|
3142
3115
|
});
|
3143
3116
|
case "featured": return await handleCollection(request, {
|
3144
3117
|
name: "featured",
|
@@ -3148,8 +3121,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3148
3121
|
collectionCallbacks: this.featuredCallbacks,
|
3149
3122
|
tracerProvider: this.tracerProvider,
|
3150
3123
|
onUnauthorized,
|
3151
|
-
onNotFound
|
3152
|
-
onNotAcceptable
|
3124
|
+
onNotFound
|
3153
3125
|
});
|
3154
3126
|
case "featuredTags": return await handleCollection(request, {
|
3155
3127
|
name: "featured tags",
|
@@ -3159,8 +3131,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3159
3131
|
collectionCallbacks: this.featuredTagsCallbacks,
|
3160
3132
|
tracerProvider: this.tracerProvider,
|
3161
3133
|
onUnauthorized,
|
3162
|
-
onNotFound
|
3163
|
-
onNotAcceptable
|
3134
|
+
onNotFound
|
3164
3135
|
});
|
3165
3136
|
case "collection": {
|
3166
3137
|
const name = route.name.replace(/^collection:/, "");
|
@@ -3172,8 +3143,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3172
3143
|
collectionCallbacks: callbacks,
|
3173
3144
|
tracerProvider: this.tracerProvider,
|
3174
3145
|
onUnauthorized,
|
3175
|
-
onNotFound
|
3176
|
-
onNotAcceptable
|
3146
|
+
onNotFound
|
3177
3147
|
});
|
3178
3148
|
}
|
3179
3149
|
case "orderedCollection": {
|
@@ -3186,8 +3156,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
3186
3156
|
collectionCallbacks: callbacks,
|
3187
3157
|
tracerProvider: this.tracerProvider,
|
3188
3158
|
onUnauthorized,
|
3189
|
-
onNotFound
|
3190
|
-
onNotAcceptable
|
3159
|
+
onNotFound
|
3191
3160
|
});
|
3192
3161
|
}
|
3193
3162
|
default: {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "./transformers-BFT6d7J5.js";
|
6
|
+
import "./docloader-_WdHTWQR.js";
|
7
|
+
import "./actor-m_ko-86v.js";
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-2qNNXYEE.js";
|
9
|
+
import "./lookup-C6WSLjPE.js";
|
10
|
+
import "./key-Cf8KTg-A.js";
|
11
|
+
import "./http-BpoEurUR.js";
|
12
|
+
import "./proof-CHM9su4L.js";
|
13
|
+
import "./types-BXkh8ctL.js";
|
14
|
+
import "./authdocloader-nRFL9luh.js";
|
15
|
+
import "./vocab-PKJB4DyY.js";
|
16
|
+
|
17
|
+
export { FederationImpl };
|
@@ -3,22 +3,23 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, deno_default, getDocumentLoader, getTypeId, kvCache, lookupWebFinger } from "./type-
|
7
|
-
import { getNodeInfo } from "./client-
|
8
|
-
import { RouterError, lookupObject, traverseCollection } from "./lookup-
|
6
|
+
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, deno_default, getDocumentLoader, getTypeId, kvCache, lookupWebFinger } from "./type-BYN6Ax2M.js";
|
7
|
+
import { getNodeInfo } from "./client-yGBH5stP.js";
|
8
|
+
import { RouterError, lookupObject, traverseCollection } from "./lookup-DuqY2_In.js";
|
9
9
|
import { nodeInfoToJson } from "./types-BSuWJsOm.js";
|
10
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
11
|
-
import { verifyRequest } from "./http-
|
12
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
13
|
-
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-
|
14
|
-
import { doesActorOwnKey, getKeyOwner } from "./owner-
|
15
|
-
import { signObject, verifyObject } from "./proof-
|
16
|
-
import { routeActivity } from "./inbox-
|
17
|
-
import { FederationBuilderImpl } from "./builder-
|
10
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-Cps8Sv3N.js";
|
11
|
+
import { verifyRequest } from "./http-BEo67UOx.js";
|
12
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-Chl2nuOI.js";
|
13
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-CXygHn_m.js";
|
14
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-D2fTlp_x.js";
|
15
|
+
import { signObject, verifyObject } from "./proof-kEUjWRNJ.js";
|
16
|
+
import { routeActivity } from "./inbox-D-B5xFtJ.js";
|
17
|
+
import { FederationBuilderImpl } from "./builder-C8Of4dPy.js";
|
18
18
|
import { buildCollectionSynchronizationHeader } from "./collection-CcnIw1qY.js";
|
19
|
-
import { KvKeyCache } from "./keycache-
|
20
|
-
import {
|
21
|
-
import {
|
19
|
+
import { KvKeyCache } from "./keycache-D_Q1fPV0.js";
|
20
|
+
import { acceptsJsonLd } from "./negotiation-5NPJL6zp.js";
|
21
|
+
import { createExponentialBackoffPolicy } from "./retry-D4GJ670a.js";
|
22
|
+
import { extractInboxes, sendActivity } from "./send-Utq2Jm0I.js";
|
22
23
|
import { getLogger, withContext } from "@logtape/logtape";
|
23
24
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
24
25
|
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";
|
@@ -297,73 +298,8 @@ async function handleWebFingerInternal(request, { context: context$1, host, acto
|
|
297
298
|
} });
|
298
299
|
}
|
299
300
|
|
300
|
-
//#endregion
|
301
|
-
//#region src/federation/negotiation.ts
|
302
|
-
function compareSpecs(a, b) {
|
303
|
-
return b.q - a.q || (b.s ?? 0) - (a.s ?? 0) || (a.o ?? 0) - (b.o ?? 0) || a.i - b.i || 0;
|
304
|
-
}
|
305
|
-
function isQuality(spec) {
|
306
|
-
return spec.q > 0;
|
307
|
-
}
|
308
|
-
const simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
|
309
|
-
function splitKeyValuePair(str) {
|
310
|
-
const [key, value] = str.split("=");
|
311
|
-
return [key.toLowerCase(), value];
|
312
|
-
}
|
313
|
-
function parseMediaType(str, i) {
|
314
|
-
const match = simpleMediaTypeRegExp.exec(str);
|
315
|
-
if (!match) return;
|
316
|
-
const [, type, subtype, parameters] = match;
|
317
|
-
if (!type || !subtype) return;
|
318
|
-
const params = Object.create(null);
|
319
|
-
let q = 1;
|
320
|
-
if (parameters) {
|
321
|
-
const kvps = parameters.split(";").map((p) => p.trim()).map(splitKeyValuePair);
|
322
|
-
for (const [key, val] of kvps) {
|
323
|
-
const value = val && val[0] === `"` && val[val.length - 1] === `"` ? val.slice(1, val.length - 1) : val;
|
324
|
-
if (key === "q" && value) {
|
325
|
-
q = parseFloat(value);
|
326
|
-
break;
|
327
|
-
}
|
328
|
-
params[key] = value;
|
329
|
-
}
|
330
|
-
}
|
331
|
-
return {
|
332
|
-
type,
|
333
|
-
subtype,
|
334
|
-
params,
|
335
|
-
i,
|
336
|
-
o: void 0,
|
337
|
-
q,
|
338
|
-
s: void 0
|
339
|
-
};
|
340
|
-
}
|
341
|
-
function parseAccept(accept) {
|
342
|
-
const accepts = accept.split(",").map((p) => p.trim());
|
343
|
-
const mediaTypes = [];
|
344
|
-
for (const [index, accept$1] of accepts.entries()) {
|
345
|
-
const mediaType = parseMediaType(accept$1.trim(), index);
|
346
|
-
if (mediaType) mediaTypes.push(mediaType);
|
347
|
-
}
|
348
|
-
return mediaTypes;
|
349
|
-
}
|
350
|
-
function getFullType(spec) {
|
351
|
-
return `${spec.type}/${spec.subtype}`;
|
352
|
-
}
|
353
|
-
function preferredMediaTypes(accept) {
|
354
|
-
const accepts = parseAccept(accept === void 0 ? "*/*" : accept ?? "");
|
355
|
-
return accepts.filter(isQuality).sort(compareSpecs).map(getFullType);
|
356
|
-
}
|
357
|
-
|
358
301
|
//#endregion
|
359
302
|
//#region src/federation/handler.ts
|
360
|
-
function acceptsJsonLd(request) {
|
361
|
-
const accept = request.headers.get("Accept");
|
362
|
-
const types = accept ? preferredMediaTypes(accept) : ["*/*"];
|
363
|
-
if (types == null) return true;
|
364
|
-
if (types[0] === "text/html" || types[0] === "application/xhtml+xml") return false;
|
365
|
-
return types.includes("application/activity+json") || types.includes("application/ld+json") || types.includes("application/json");
|
366
|
-
}
|
367
303
|
/**
|
368
304
|
* Handles an actor request.
|
369
305
|
* @template TContextData The context data to pass to the context.
|
@@ -371,7 +307,7 @@ function acceptsJsonLd(request) {
|
|
371
307
|
* @param parameters The parameters for handling the actor.
|
372
308
|
* @returns A promise that resolves to an HTTP response.
|
373
309
|
*/
|
374
|
-
async function handleActor(request, { identifier, context: context$1, actorDispatcher, authorizePredicate, onNotFound,
|
310
|
+
async function handleActor(request, { identifier, context: context$1, actorDispatcher, authorizePredicate, onNotFound, onUnauthorized }) {
|
375
311
|
const logger$2 = getLogger([
|
376
312
|
"fedify",
|
377
313
|
"federation",
|
@@ -386,7 +322,6 @@ async function handleActor(request, { identifier, context: context$1, actorDispa
|
|
386
322
|
logger$2.debug("Actor {identifier} not found.", { identifier });
|
387
323
|
return await onNotFound(request);
|
388
324
|
}
|
389
|
-
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
390
325
|
if (authorizePredicate != null) {
|
391
326
|
let key = await context$1.getSignedKey();
|
392
327
|
key = key?.clone({}, { $warning: {
|
@@ -421,11 +356,10 @@ async function handleActor(request, { identifier, context: context$1, actorDispa
|
|
421
356
|
* @param parameters The parameters for handling the object.
|
422
357
|
* @returns A promise that resolves to an HTTP response.
|
423
358
|
*/
|
424
|
-
async function handleObject(request, { values, context: context$1, objectDispatcher, authorizePredicate, onNotFound,
|
359
|
+
async function handleObject(request, { values, context: context$1, objectDispatcher, authorizePredicate, onNotFound, onUnauthorized }) {
|
425
360
|
if (objectDispatcher == null) return await onNotFound(request);
|
426
361
|
const object = await objectDispatcher(context$1, values);
|
427
362
|
if (object == null) return await onNotFound(request);
|
428
|
-
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
429
363
|
if (authorizePredicate != null) {
|
430
364
|
let key = await context$1.getSignedKey();
|
431
365
|
key = key?.clone({}, { $warning: {
|
@@ -463,7 +397,7 @@ async function handleObject(request, { values, context: context$1, objectDispatc
|
|
463
397
|
* @param parameters The parameters for handling the collection.
|
464
398
|
* @returns A promise that resolves to an HTTP response.
|
465
399
|
*/
|
466
|
-
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound
|
400
|
+
async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$1, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
|
467
401
|
const spanName = name.trim().replace(/\s+/g, "_");
|
468
402
|
tracerProvider = tracerProvider ?? trace.getTracerProvider();
|
469
403
|
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
@@ -576,7 +510,6 @@ async function handleCollection(request, { name, identifier, uriGetter, filter,
|
|
576
510
|
partOf
|
577
511
|
});
|
578
512
|
}
|
579
|
-
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
580
513
|
if (collectionCallbacks.authorizePredicate != null) {
|
581
514
|
let key = await context$1.getSignedKey();
|
582
515
|
key = key?.clone({}, { $warning: {
|
@@ -914,7 +847,6 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
|
|
914
847
|
const handleCustomCollection = exceptWrapper(_handleCustomCollection);
|
915
848
|
async function _handleCustomCollection(request, { name, values, context: context$1, tracerProvider, collectionCallbacks: callbacks, filterPredicate }) {
|
916
849
|
verifyDefined(callbacks);
|
917
|
-
verifyJsonLdRequest(request);
|
918
850
|
await authIfNeeded(context$1, values, callbacks);
|
919
851
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
920
852
|
return await new CustomCollectionHandler(name, values, context$1, callbacks, tracerProvider, Collection, CollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
|
@@ -933,7 +865,6 @@ async function _handleCustomCollection(request, { name, values, context: context
|
|
933
865
|
const handleOrderedCollection = exceptWrapper(_handleOrderedCollection);
|
934
866
|
async function _handleOrderedCollection(request, { name, values, context: context$1, tracerProvider, collectionCallbacks: callbacks, filterPredicate }) {
|
935
867
|
verifyDefined(callbacks);
|
936
|
-
verifyJsonLdRequest(request);
|
937
868
|
await authIfNeeded(context$1, values, callbacks);
|
938
869
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
939
870
|
return await new CustomCollectionHandler(name, values, context$1, callbacks, tracerProvider, OrderedCollection, OrderedCollectionPage, filterPredicate).fetchCollection(cursor).toJsonLd().then(respondAsActivity);
|
@@ -1211,10 +1142,9 @@ function exceptWrapper(handler) {
|
|
1211
1142
|
try {
|
1212
1143
|
return await handler(request, handlerParams);
|
1213
1144
|
} catch (error) {
|
1214
|
-
const { onNotFound,
|
1145
|
+
const { onNotFound, onUnauthorized } = handlerParams;
|
1215
1146
|
switch (error?.constructor) {
|
1216
1147
|
case ItemsNotFoundError: return await onNotFound(request);
|
1217
|
-
case NotAcceptableError: return await onNotAcceptable(request);
|
1218
1148
|
case UnauthorizedError: return await onUnauthorized(request);
|
1219
1149
|
default: throw error;
|
1220
1150
|
}
|
@@ -1232,15 +1162,6 @@ const verifyDefined = (callbacks) => {
|
|
1232
1162
|
if (callbacks === void 0) throw new ItemsNotFoundError();
|
1233
1163
|
};
|
1234
1164
|
/**
|
1235
|
-
* Verifies that a request accepts JSON-LD content type.
|
1236
|
-
* @param request The HTTP request to verify.
|
1237
|
-
* @throws {NotAcceptableError} If the request doesn't accept JSON-LD.
|
1238
|
-
* @since 1.8.0
|
1239
|
-
*/
|
1240
|
-
const verifyJsonLdRequest = (request) => {
|
1241
|
-
if (!acceptsJsonLd(request)) throw new NotAcceptableError();
|
1242
|
-
};
|
1243
|
-
/**
|
1244
1165
|
* Performs authorization if needed based on the authorization predicate.
|
1245
1166
|
* @template TContextData The context data type.
|
1246
1167
|
* @param {RequestContext<TContextData>} context The request context.
|
@@ -1324,15 +1245,6 @@ var ItemsNotFoundError = class extends HandlerError {
|
|
1324
1245
|
}
|
1325
1246
|
};
|
1326
1247
|
/**
|
1327
|
-
* Error thrown when the request is not acceptable (e.g., wrong content type).
|
1328
|
-
* @since 1.8.0
|
1329
|
-
*/
|
1330
|
-
var NotAcceptableError = class extends HandlerError {
|
1331
|
-
constructor() {
|
1332
|
-
super("The request is not acceptable.");
|
1333
|
-
}
|
1334
|
-
};
|
1335
|
-
/**
|
1336
1248
|
* Error thrown when access to a collection is unauthorized.
|
1337
1249
|
* @since 1.8.0
|
1338
1250
|
*/
|
@@ -2011,6 +1923,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2011
1923
|
span,
|
2012
1924
|
tracer
|
2013
1925
|
});
|
1926
|
+
if (acceptsJsonLd(request)) response.headers.set("Vary", "Accept");
|
2014
1927
|
} catch (error) {
|
2015
1928
|
span.setStatus({
|
2016
1929
|
code: SpanStatusCode.ERROR,
|
@@ -2074,6 +1987,9 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2074
1987
|
context: context$1,
|
2075
1988
|
nodeInfoDispatcher: this.nodeInfoDispatcher
|
2076
1989
|
});
|
1990
|
+
}
|
1991
|
+
if (!acceptsJsonLd(request)) return await onNotAcceptable(request);
|
1992
|
+
switch (routeName) {
|
2077
1993
|
case "actor":
|
2078
1994
|
context$1 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier ?? route.values.handle } });
|
2079
1995
|
return await handleActor(request, {
|
@@ -2082,8 +1998,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2082
1998
|
actorDispatcher: this.actorCallbacks?.dispatcher,
|
2083
1999
|
authorizePredicate: this.actorCallbacks?.authorizePredicate,
|
2084
2000
|
onUnauthorized,
|
2085
|
-
onNotFound
|
2086
|
-
onNotAcceptable
|
2001
|
+
onNotFound
|
2087
2002
|
});
|
2088
2003
|
case "object": {
|
2089
2004
|
const typeId = route.name.replace(/^object:/, "");
|
@@ -2099,8 +2014,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2099
2014
|
objectDispatcher: callbacks?.dispatcher,
|
2100
2015
|
authorizePredicate: callbacks?.authorizePredicate,
|
2101
2016
|
onUnauthorized,
|
2102
|
-
onNotFound
|
2103
|
-
onNotAcceptable
|
2017
|
+
onNotFound
|
2104
2018
|
});
|
2105
2019
|
}
|
2106
2020
|
case "outbox": return await handleCollection(request, {
|
@@ -2111,8 +2025,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2111
2025
|
collectionCallbacks: this.outboxCallbacks,
|
2112
2026
|
tracerProvider: this.tracerProvider,
|
2113
2027
|
onUnauthorized,
|
2114
|
-
onNotFound
|
2115
|
-
onNotAcceptable
|
2028
|
+
onNotFound
|
2116
2029
|
});
|
2117
2030
|
case "inbox":
|
2118
2031
|
if (request.method !== "POST") return await handleCollection(request, {
|
@@ -2123,8 +2036,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2123
2036
|
collectionCallbacks: this.inboxCallbacks,
|
2124
2037
|
tracerProvider: this.tracerProvider,
|
2125
2038
|
onUnauthorized,
|
2126
|
-
onNotFound
|
2127
|
-
onNotAcceptable
|
2039
|
+
onNotFound
|
2128
2040
|
});
|
2129
2041
|
context$1 = this.#createContext(request, contextData, { documentLoader: await context$1.getDocumentLoader({ identifier: route.values.identifier ?? route.values.handle }) });
|
2130
2042
|
case "sharedInbox":
|
@@ -2156,8 +2068,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2156
2068
|
collectionCallbacks: this.followingCallbacks,
|
2157
2069
|
tracerProvider: this.tracerProvider,
|
2158
2070
|
onUnauthorized,
|
2159
|
-
onNotFound
|
2160
|
-
onNotAcceptable
|
2071
|
+
onNotFound
|
2161
2072
|
});
|
2162
2073
|
case "followers": {
|
2163
2074
|
let baseUrl = url.searchParams.get("base-url");
|
@@ -2180,8 +2091,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2180
2091
|
collectionCallbacks: this.followersCallbacks,
|
2181
2092
|
tracerProvider: this.tracerProvider,
|
2182
2093
|
onUnauthorized,
|
2183
|
-
onNotFound
|
2184
|
-
onNotAcceptable
|
2094
|
+
onNotFound
|
2185
2095
|
});
|
2186
2096
|
}
|
2187
2097
|
case "liked": return await handleCollection(request, {
|
@@ -2192,8 +2102,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2192
2102
|
collectionCallbacks: this.likedCallbacks,
|
2193
2103
|
tracerProvider: this.tracerProvider,
|
2194
2104
|
onUnauthorized,
|
2195
|
-
onNotFound
|
2196
|
-
onNotAcceptable
|
2105
|
+
onNotFound
|
2197
2106
|
});
|
2198
2107
|
case "featured": return await handleCollection(request, {
|
2199
2108
|
name: "featured",
|
@@ -2203,8 +2112,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2203
2112
|
collectionCallbacks: this.featuredCallbacks,
|
2204
2113
|
tracerProvider: this.tracerProvider,
|
2205
2114
|
onUnauthorized,
|
2206
|
-
onNotFound
|
2207
|
-
onNotAcceptable
|
2115
|
+
onNotFound
|
2208
2116
|
});
|
2209
2117
|
case "featuredTags": return await handleCollection(request, {
|
2210
2118
|
name: "featured tags",
|
@@ -2214,8 +2122,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2214
2122
|
collectionCallbacks: this.featuredTagsCallbacks,
|
2215
2123
|
tracerProvider: this.tracerProvider,
|
2216
2124
|
onUnauthorized,
|
2217
|
-
onNotFound
|
2218
|
-
onNotAcceptable
|
2125
|
+
onNotFound
|
2219
2126
|
});
|
2220
2127
|
case "collection": {
|
2221
2128
|
const name = route.name.replace(/^collection:/, "");
|
@@ -2227,8 +2134,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2227
2134
|
collectionCallbacks: callbacks,
|
2228
2135
|
tracerProvider: this.tracerProvider,
|
2229
2136
|
onUnauthorized,
|
2230
|
-
onNotFound
|
2231
|
-
onNotAcceptable
|
2137
|
+
onNotFound
|
2232
2138
|
});
|
2233
2139
|
}
|
2234
2140
|
case "orderedCollection": {
|
@@ -2241,8 +2147,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
2241
2147
|
collectionCallbacks: callbacks,
|
2242
2148
|
tracerProvider: this.tracerProvider,
|
2243
2149
|
onUnauthorized,
|
2244
|
-
onNotFound
|
2245
|
-
onNotAcceptable
|
2150
|
+
onNotFound
|
2246
2151
|
});
|
2247
2152
|
}
|
2248
2153
|
default: {
|
@@ -3210,4 +3115,4 @@ function getRequestId(request) {
|
|
3210
3115
|
}
|
3211
3116
|
|
3212
3117
|
//#endregion
|
3213
|
-
export { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer,
|
3118
|
+
export { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, actorDehydrator, autoIdAssigner, createFederation, handleActor, handleCollection, handleCustomCollection, handleInbox, handleNodeInfo, handleNodeInfoJrd, handleObject, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
require('./transformers-CoBS-oFG.cjs');
|
6
|
+
require('./docloader-SZjTrl6Z.cjs');
|
7
|
+
require('./actor-CNUje03O.cjs');
|
8
|
+
const require_middleware = require('./middleware-BsFAFlnZ.cjs');
|
9
|
+
require('./lookup-C-Y0Ep1a.cjs');
|
10
|
+
require('./key-JqiQvcq1.cjs');
|
11
|
+
require('./http-DREvFalF.cjs');
|
12
|
+
require('./proof-C4Y4gJcm.cjs');
|
13
|
+
require('./types-BBpQe860.cjs');
|
14
|
+
require('./authdocloader-D_3mtAjX.cjs');
|
15
|
+
require('./vocab-DWZQ7gVQ.cjs');
|
16
|
+
|
17
|
+
exports.FederationImpl = require_middleware.FederationImpl;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
3
|
import { Activity } from "./vocab-SOE1ifCr.js";
|
4
|
-
import { ActivityTransformer, Context } from "./context-
|
4
|
+
import { ActivityTransformer, Context } from "./context-CQsAT7xk.js";
|
5
5
|
|
6
6
|
//#region src/compat/transformers.d.ts
|
7
7
|
|