@fedify/fedify 2.0.0-pr.559.6 → 2.0.1-dev.400

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.
Files changed (65) hide show
  1. package/README.md +8 -0
  2. package/dist/{builder-DFgILDcG.js → builder-SsFRRyh0.js} +12 -57
  3. package/dist/compat/mod.d.cts +2 -2
  4. package/dist/compat/mod.d.ts +2 -2
  5. package/dist/compat/transformers.test.js +11 -11
  6. package/dist/{context-Cf0-LmZC.d.cts → context-BdNW_8a3.d.cts} +19 -46
  7. package/dist/{context-liIe6DFH.d.ts → context-C-GVKcJR.d.ts} +19 -46
  8. package/dist/{deno-Dssbv2qD.js → deno-HatCVczO.js} +1 -4
  9. package/dist/{docloader-DLiT1bFg.js → docloader-T9-m3Rn_.js} +4 -12
  10. package/dist/federation/builder.test.js +3 -3
  11. package/dist/federation/handler.test.js +45 -45
  12. package/dist/federation/idempotency.test.js +11 -11
  13. package/dist/federation/inbox.test.js +2 -2
  14. package/dist/federation/middleware.test.js +43 -68
  15. package/dist/federation/mod.cjs +4 -4
  16. package/dist/federation/mod.d.cts +3 -3
  17. package/dist/federation/mod.d.ts +3 -3
  18. package/dist/federation/mod.js +4 -4
  19. package/dist/federation/send.test.js +90 -5
  20. package/dist/federation/webfinger.test.js +12 -15
  21. package/dist/{http-BaPyHVQ7.js → http-B1lUBODU.js} +1 -4
  22. package/dist/{http-CfrdWdLH.js → http-CuLO9bY_.js} +2 -2
  23. package/dist/{http-BP6_JjsL.cjs → http-DaydvKvf.cjs} +1 -4
  24. package/dist/{inbox-CW8E414g.js → inbox-1fHDOuko.js} +1 -1
  25. package/dist/{key-DJI5G1Ub.js → key-DNCf-vbs.js} +1 -1
  26. package/dist/{kv-cache-CuA9rQF1.js → kv-cache-BfacchWv.js} +2 -4
  27. package/dist/{kv-cache-yGgfNuY5.cjs → kv-cache-DlBRpUdw.cjs} +1 -3
  28. package/dist/{ld-Cu0jmueI.js → ld-CU-cW8qv.js} +2 -2
  29. package/dist/{middleware-Ddt9Yu31.cjs → middleware-B2gMDc87.cjs} +193 -260
  30. package/dist/{middleware-CBWnYv0h.js → middleware-BZ7r73_8.js} +11 -11
  31. package/dist/{middleware-CjoXj45O.js → middleware-CGjIDLqK.js} +4 -4
  32. package/dist/{middleware-RxA4Ghbe.js → middleware-CdZ3PZT5.js} +193 -260
  33. package/dist/{middleware-D227KuaF.js → middleware-DaaZMqlD.js} +157 -210
  34. package/dist/middleware-ncL2gTRx.cjs +12 -0
  35. package/dist/{mod-H3ScYaOb.d.cts → mod-5PNty1K9.d.cts} +1 -1
  36. package/dist/{mod-Do_sZWAA.d.cts → mod-BcpEGTWV.d.cts} +1 -1
  37. package/dist/{mod-CvhyLrjX.d.ts → mod-CevNbUol.d.ts} +0 -18
  38. package/dist/{mod-Dquroqiv.d.ts → mod-CtO31FCx.d.ts} +1 -1
  39. package/dist/{mod-B9_l3te3.d.ts → mod-Da9fNDyC.d.ts} +1 -1
  40. package/dist/{mod-DWaA45ef.d.cts → mod-ErTjUJs9.d.cts} +0 -18
  41. package/dist/mod.cjs +4 -4
  42. package/dist/mod.d.cts +6 -6
  43. package/dist/mod.d.ts +6 -6
  44. package/dist/mod.js +4 -4
  45. package/dist/nodeinfo/handler.test.js +11 -11
  46. package/dist/{owner-8nrupc6V.js → owner-Bl_eRxf6.js} +1 -1
  47. package/dist/{proof-RhBPHpn0.js → proof-BOVBs0DW.js} +2 -2
  48. package/dist/{proof-BrTneuEN.cjs → proof-CRneYTMl.cjs} +1 -1
  49. package/dist/{proof-CUhWCefd.js → proof-D0IdWZZE.js} +1 -1
  50. package/dist/{send-CnI-Brh9.js → send-BkfPydwO.js} +35 -4
  51. package/dist/sig/http.test.js +3 -3
  52. package/dist/sig/key.test.js +2 -2
  53. package/dist/sig/ld.test.js +3 -3
  54. package/dist/sig/mod.cjs +2 -2
  55. package/dist/sig/mod.js +2 -2
  56. package/dist/sig/owner.test.js +3 -3
  57. package/dist/sig/proof.test.js +3 -3
  58. package/dist/testing/mod.d.ts +13 -33
  59. package/dist/utils/docloader.test.js +4 -4
  60. package/dist/utils/mod.cjs +2 -2
  61. package/dist/utils/mod.d.cts +1 -1
  62. package/dist/utils/mod.d.ts +1 -1
  63. package/dist/utils/mod.js +2 -2
  64. package/package.json +8 -8
  65. package/dist/middleware-ACS5M4fZ.cjs +0 -12
@@ -3,24 +3,24 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-Dssbv2qD.js";
6
+ import { deno_default } from "./deno-HatCVczO.js";
7
7
  import { getNodeInfo } from "./client-Dg7OfUDA.js";
8
8
  import { RouterError } from "./router-D9eI0s4b.js";
9
9
  import { nodeInfoToJson } from "./types-CPz01LGH.js";
10
- import { exportJwk, importJwk, validateCryptoKey } from "./key-DJI5G1Ub.js";
11
- import { verifyRequest } from "./http-CfrdWdLH.js";
12
- import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-Cu0jmueI.js";
13
- import { doesActorOwnKey, getKeyOwner } from "./owner-8nrupc6V.js";
14
- import { signObject, verifyObject } from "./proof-RhBPHpn0.js";
15
- import { getAuthenticatedDocumentLoader } from "./docloader-DLiT1bFg.js";
10
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-DNCf-vbs.js";
11
+ import { verifyRequest } from "./http-CuLO9bY_.js";
12
+ import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-CU-cW8qv.js";
13
+ import { doesActorOwnKey, getKeyOwner } from "./owner-Bl_eRxf6.js";
14
+ import { signObject, verifyObject } from "./proof-BOVBs0DW.js";
15
+ import { getAuthenticatedDocumentLoader } from "./docloader-T9-m3Rn_.js";
16
16
  import { kvCache } from "./kv-cache-B__dHl7g.js";
17
- import { routeActivity } from "./inbox-CW8E414g.js";
18
- import { FederationBuilderImpl } from "./builder-DFgILDcG.js";
17
+ import { routeActivity } from "./inbox-1fHDOuko.js";
18
+ import { FederationBuilderImpl } from "./builder-SsFRRyh0.js";
19
19
  import { buildCollectionSynchronizationHeader } from "./collection-CcnIw1qY.js";
20
20
  import { KvKeyCache } from "./keycache-DRxpZ5r9.js";
21
21
  import { acceptsJsonLd } from "./negotiation-5NPJL6zp.js";
22
22
  import { createExponentialBackoffPolicy } from "./retry-D4GJ670a.js";
23
- import { SendActivityError, extractInboxes, sendActivity } from "./send-CnI-Brh9.js";
23
+ import { SendActivityError, extractInboxes, sendActivity } from "./send-BkfPydwO.js";
24
24
  import { getLogger, withContext } from "@logtape/logtape";
25
25
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
26
26
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1313,7 +1313,7 @@ var FederationImpl = class extends FederationBuilderImpl {
1313
1313
  outboxRetryPolicy;
1314
1314
  inboxRetryPolicy;
1315
1315
  activityTransformers;
1316
- tracerProvider;
1316
+ _tracerProvider;
1317
1317
  firstKnock;
1318
1318
  constructor(options) {
1319
1319
  super();
@@ -1395,9 +1395,12 @@ var FederationImpl = class extends FederationBuilderImpl {
1395
1395
  this.outboxRetryPolicy = options.outboxRetryPolicy ?? createExponentialBackoffPolicy();
1396
1396
  this.inboxRetryPolicy = options.inboxRetryPolicy ?? createExponentialBackoffPolicy();
1397
1397
  this.activityTransformers = options.activityTransformers ?? getDefaultActivityTransformers();
1398
- this.tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
1398
+ this._tracerProvider = options.tracerProvider;
1399
1399
  this.firstKnock = options.firstKnock;
1400
1400
  }
1401
+ get tracerProvider() {
1402
+ return this._tracerProvider ?? trace.getTracerProvider();
1403
+ }
1401
1404
  _initializeRouter() {
1402
1405
  this.router.add("/.well-known/webfinger", "webfinger");
1403
1406
  this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
@@ -1438,18 +1441,24 @@ var FederationImpl = class extends FederationBuilderImpl {
1438
1441
  kind: SpanKind.CONSUMER,
1439
1442
  attributes: { "activitypub.activity.type": message.activityType }
1440
1443
  }, extractedContext, async (span) => {
1441
- if (message.activityId != null) span.setAttribute("activitypub.activity.id", message.activityId);
1442
- try {
1443
- await this.#listenFanoutMessage(contextData, message);
1444
- } catch (e) {
1445
- span.setStatus({
1446
- code: SpanStatusCode.ERROR,
1447
- message: String(e)
1448
- });
1449
- throw e;
1450
- } finally {
1451
- span.end();
1452
- }
1444
+ const spanCtx = span.spanContext();
1445
+ return await withContext({
1446
+ traceId: spanCtx.traceId,
1447
+ spanId: spanCtx.spanId
1448
+ }, async () => {
1449
+ if (message.activityId != null) span.setAttribute("activitypub.activity.id", message.activityId);
1450
+ try {
1451
+ await this.#listenFanoutMessage(contextData, message);
1452
+ } catch (e) {
1453
+ span.setStatus({
1454
+ code: SpanStatusCode.ERROR,
1455
+ message: String(e)
1456
+ });
1457
+ throw e;
1458
+ } finally {
1459
+ span.end();
1460
+ }
1461
+ });
1453
1462
  });
1454
1463
  else if (message.type === "outbox") await tracer.startActiveSpan("activitypub.outbox", {
1455
1464
  kind: SpanKind.CONSUMER,
@@ -1458,34 +1467,46 @@ var FederationImpl = class extends FederationBuilderImpl {
1458
1467
  "activitypub.activity.retries": message.attempt
1459
1468
  }
1460
1469
  }, extractedContext, async (span) => {
1461
- if (message.activityId != null) span.setAttribute("activitypub.activity.id", message.activityId);
1462
- try {
1463
- await this.#listenOutboxMessage(contextData, message, span);
1464
- } catch (e) {
1465
- span.setStatus({
1466
- code: SpanStatusCode.ERROR,
1467
- message: String(e)
1468
- });
1469
- throw e;
1470
- } finally {
1471
- span.end();
1472
- }
1470
+ const spanCtx = span.spanContext();
1471
+ return await withContext({
1472
+ traceId: spanCtx.traceId,
1473
+ spanId: spanCtx.spanId
1474
+ }, async () => {
1475
+ if (message.activityId != null) span.setAttribute("activitypub.activity.id", message.activityId);
1476
+ try {
1477
+ await this.#listenOutboxMessage(contextData, message, span);
1478
+ } catch (e) {
1479
+ span.setStatus({
1480
+ code: SpanStatusCode.ERROR,
1481
+ message: String(e)
1482
+ });
1483
+ throw e;
1484
+ } finally {
1485
+ span.end();
1486
+ }
1487
+ });
1473
1488
  });
1474
1489
  else if (message.type === "inbox") await tracer.startActiveSpan("activitypub.inbox", {
1475
1490
  kind: SpanKind.CONSUMER,
1476
1491
  attributes: { "activitypub.shared_inbox": message.identifier == null }
1477
1492
  }, extractedContext, async (span) => {
1478
- try {
1479
- await this.#listenInboxMessage(contextData, message, span);
1480
- } catch (e) {
1481
- span.setStatus({
1482
- code: SpanStatusCode.ERROR,
1483
- message: String(e)
1484
- });
1485
- throw e;
1486
- } finally {
1487
- span.end();
1488
- }
1493
+ const spanCtx = span.spanContext();
1494
+ return await withContext({
1495
+ traceId: spanCtx.traceId,
1496
+ spanId: spanCtx.spanId
1497
+ }, async () => {
1498
+ try {
1499
+ await this.#listenInboxMessage(contextData, message, span);
1500
+ } catch (e) {
1501
+ span.setStatus({
1502
+ code: SpanStatusCode.ERROR,
1503
+ message: String(e)
1504
+ });
1505
+ throw e;
1506
+ } finally {
1507
+ span.end();
1508
+ }
1509
+ });
1489
1510
  });
1490
1511
  });
1491
1512
  }
@@ -1649,7 +1670,7 @@ var FederationImpl = class extends FederationBuilderImpl {
1649
1670
  if (message.identifier != null) context$1 = this.#createContext(baseUrl, ctxData, { documentLoader: await context$1.getDocumentLoader({ identifier: message.identifier }) });
1650
1671
  else if (this.sharedInboxKeyDispatcher != null) {
1651
1672
  const identity = await this.sharedInboxKeyDispatcher(context$1);
1652
- if (identity != null) context$1 = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity || "handle" in identity ? await context$1.getDocumentLoader(identity) : context$1.getDocumentLoader(identity) });
1673
+ if (identity != null) context$1 = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity ? await context$1.getDocumentLoader(identity) : context$1.getDocumentLoader(identity) });
1653
1674
  }
1654
1675
  const activity = await Activity.fromJsonLd(message.activity, context$1);
1655
1676
  span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
@@ -1958,54 +1979,60 @@ var FederationImpl = class extends FederationBuilderImpl {
1958
1979
  [ATTR_URL_FULL]: request.url
1959
1980
  }
1960
1981
  }, async (span) => {
1961
- const logger$2 = getLogger([
1962
- "fedify",
1963
- "federation",
1964
- "http"
1965
- ]);
1966
- if (span.isRecording()) for (const [k, v] of request.headers) span.setAttribute(ATTR_HTTP_REQUEST_HEADER(k), [v]);
1967
- let response;
1968
- try {
1969
- response = await this.#fetch(request, {
1970
- ...options,
1971
- span,
1972
- tracer
1973
- });
1974
- if (acceptsJsonLd(request)) response.headers.set("Vary", "Accept");
1975
- } catch (error) {
1976
- span.setStatus({
1977
- code: SpanStatusCode.ERROR,
1978
- message: `${error}`
1979
- });
1982
+ const spanCtx = span.spanContext();
1983
+ return await withContext({
1984
+ traceId: spanCtx.traceId,
1985
+ spanId: spanCtx.spanId
1986
+ }, async () => {
1987
+ const logger$2 = getLogger([
1988
+ "fedify",
1989
+ "federation",
1990
+ "http"
1991
+ ]);
1992
+ if (span.isRecording()) for (const [k, v] of request.headers) span.setAttribute(ATTR_HTTP_REQUEST_HEADER(k), [v]);
1993
+ let response;
1994
+ try {
1995
+ response = await this.#fetch(request, {
1996
+ ...options,
1997
+ span,
1998
+ tracer
1999
+ });
2000
+ if (acceptsJsonLd(request)) response.headers.set("Vary", "Accept");
2001
+ } catch (error) {
2002
+ span.setStatus({
2003
+ code: SpanStatusCode.ERROR,
2004
+ message: `${error}`
2005
+ });
2006
+ span.end();
2007
+ logger$2.error("An error occurred while serving request {method} {url}: {error}", {
2008
+ method: request.method,
2009
+ url: request.url,
2010
+ error
2011
+ });
2012
+ throw error;
2013
+ }
2014
+ if (span.isRecording()) {
2015
+ span.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE, response.status);
2016
+ for (const [k, v] of response.headers) span.setAttribute(ATTR_HTTP_RESPONSE_HEADER(k), [v]);
2017
+ span.setStatus({
2018
+ code: response.status >= 500 ? SpanStatusCode.ERROR : SpanStatusCode.UNSET,
2019
+ message: response.statusText
2020
+ });
2021
+ }
1980
2022
  span.end();
1981
- logger$2.error("An error occurred while serving request {method} {url}: {error}", {
2023
+ const url = new URL(request.url);
2024
+ const logTpl = "{method} {path}: {status}";
2025
+ const values = {
1982
2026
  method: request.method,
2027
+ path: `${url.pathname}${url.search}`,
1983
2028
  url: request.url,
1984
- error
1985
- });
1986
- throw error;
1987
- }
1988
- if (span.isRecording()) {
1989
- span.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE, response.status);
1990
- for (const [k, v] of response.headers) span.setAttribute(ATTR_HTTP_RESPONSE_HEADER(k), [v]);
1991
- span.setStatus({
1992
- code: response.status >= 500 ? SpanStatusCode.ERROR : SpanStatusCode.UNSET,
1993
- message: response.statusText
1994
- });
1995
- }
1996
- span.end();
1997
- const url = new URL(request.url);
1998
- const logTpl = "{method} {path}: {status}";
1999
- const values = {
2000
- method: request.method,
2001
- path: `${url.pathname}${url.search}`,
2002
- url: request.url,
2003
- status: response.status
2004
- };
2005
- if (response.status >= 500) logger$2.error(logTpl, values);
2006
- else if (response.status >= 400) logger$2.warn(logTpl, values);
2007
- else logger$2.info(logTpl, values);
2008
- return response;
2029
+ status: response.status
2030
+ };
2031
+ if (response.status >= 500) logger$2.error(logTpl, values);
2032
+ else if (response.status >= 400) logger$2.warn(logTpl, values);
2033
+ else logger$2.info(logTpl, values);
2034
+ return response;
2035
+ });
2009
2036
  });
2010
2037
  });
2011
2038
  }
@@ -2039,9 +2066,9 @@ var FederationImpl = class extends FederationBuilderImpl {
2039
2066
  if (request.method !== "POST" && !acceptsJsonLd(request)) return await onNotAcceptable(request);
2040
2067
  switch (routeName) {
2041
2068
  case "actor":
2042
- context$1 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier ?? route.values.handle } });
2069
+ context$1 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier } });
2043
2070
  return await handleActor(request, {
2044
- identifier: route.values.identifier ?? route.values.handle,
2071
+ identifier: route.values.identifier,
2045
2072
  context: context$1,
2046
2073
  actorDispatcher: this.actorCallbacks?.dispatcher,
2047
2074
  authorizePredicate: this.actorCallbacks?.authorizePredicate,
@@ -2067,7 +2094,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2067
2094
  }
2068
2095
  case "outbox": return await handleCollection(request, {
2069
2096
  name: "outbox",
2070
- identifier: route.values.identifier ?? route.values.handle,
2097
+ identifier: route.values.identifier,
2071
2098
  uriGetter: context$1.getOutboxUri.bind(context$1),
2072
2099
  context: context$1,
2073
2100
  collectionCallbacks: this.outboxCallbacks,
@@ -2078,7 +2105,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2078
2105
  case "inbox":
2079
2106
  if (request.method !== "POST") return await handleCollection(request, {
2080
2107
  name: "inbox",
2081
- identifier: route.values.identifier ?? route.values.handle,
2108
+ identifier: route.values.identifier,
2082
2109
  uriGetter: context$1.getInboxUri.bind(context$1),
2083
2110
  context: context$1,
2084
2111
  collectionCallbacks: this.inboxCallbacks,
@@ -2086,15 +2113,15 @@ var FederationImpl = class extends FederationBuilderImpl {
2086
2113
  onUnauthorized,
2087
2114
  onNotFound
2088
2115
  });
2089
- context$1 = this.#createContext(request, contextData, { documentLoader: await context$1.getDocumentLoader({ identifier: route.values.identifier ?? route.values.handle }) });
2116
+ context$1 = this.#createContext(request, contextData, { documentLoader: await context$1.getDocumentLoader({ identifier: route.values.identifier }) });
2090
2117
  case "sharedInbox":
2091
2118
  if (routeName !== "inbox" && this.sharedInboxKeyDispatcher != null) {
2092
2119
  const identity = await this.sharedInboxKeyDispatcher(context$1);
2093
- if (identity != null) context$1 = this.#createContext(request, contextData, { documentLoader: "identifier" in identity || "username" in identity || "handle" in identity ? await context$1.getDocumentLoader(identity) : context$1.getDocumentLoader(identity) });
2120
+ if (identity != null) context$1 = this.#createContext(request, contextData, { documentLoader: "identifier" in identity || "username" in identity ? await context$1.getDocumentLoader(identity) : context$1.getDocumentLoader(identity) });
2094
2121
  }
2095
2122
  if (!this.manuallyStartQueue) this._startQueueInternal(contextData);
2096
2123
  return await handleInbox(request, {
2097
- recipient: route.values.identifier ?? route.values.handle ?? null,
2124
+ recipient: route.values.identifier ?? null,
2098
2125
  context: context$1,
2099
2126
  inboxContextFactory: context$1.toInboxContext.bind(context$1),
2100
2127
  kv: this.kv,
@@ -2111,7 +2138,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2111
2138
  });
2112
2139
  case "following": return await handleCollection(request, {
2113
2140
  name: "following",
2114
- identifier: route.values.identifier ?? route.values.handle,
2141
+ identifier: route.values.identifier,
2115
2142
  uriGetter: context$1.getFollowingUri.bind(context$1),
2116
2143
  context: context$1,
2117
2144
  collectionCallbacks: this.followingCallbacks,
@@ -2128,7 +2155,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2128
2155
  }
2129
2156
  return await handleCollection(request, {
2130
2157
  name: "followers",
2131
- identifier: route.values.identifier ?? route.values.handle,
2158
+ identifier: route.values.identifier,
2132
2159
  uriGetter: baseUrl == null ? context$1.getFollowersUri.bind(context$1) : (identifier) => {
2133
2160
  const uri = context$1.getFollowersUri(identifier);
2134
2161
  uri.searchParams.set("base-url", baseUrl);
@@ -2145,7 +2172,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2145
2172
  }
2146
2173
  case "liked": return await handleCollection(request, {
2147
2174
  name: "liked",
2148
- identifier: route.values.identifier ?? route.values.handle,
2175
+ identifier: route.values.identifier,
2149
2176
  uriGetter: context$1.getLikedUri.bind(context$1),
2150
2177
  context: context$1,
2151
2178
  collectionCallbacks: this.likedCallbacks,
@@ -2155,7 +2182,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2155
2182
  });
2156
2183
  case "featured": return await handleCollection(request, {
2157
2184
  name: "featured",
2158
- identifier: route.values.identifier ?? route.values.handle,
2185
+ identifier: route.values.identifier,
2159
2186
  uriGetter: context$1.getFeaturedUri.bind(context$1),
2160
2187
  context: context$1,
2161
2188
  collectionCallbacks: this.featuredCallbacks,
@@ -2165,7 +2192,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2165
2192
  });
2166
2193
  case "featuredTags": return await handleCollection(request, {
2167
2194
  name: "featured tags",
2168
- identifier: route.values.identifier ?? route.values.handle,
2195
+ identifier: route.values.identifier,
2169
2196
  uriGetter: context$1.getFeaturedTagsUri.bind(context$1),
2170
2197
  context: context$1,
2171
2198
  collectionCallbacks: this.featuredTagsCallbacks,
@@ -2263,10 +2290,7 @@ var ContextImpl = class ContextImpl {
2263
2290
  return new URL(path, this.canonicalOrigin);
2264
2291
  }
2265
2292
  getActorUri(identifier) {
2266
- const path = this.federation.router.build("actor", {
2267
- identifier,
2268
- handle: identifier
2269
- });
2293
+ const path = this.federation.router.build("actor", { identifier });
2270
2294
  if (path == null) throw new RouterError("No actor dispatcher registered.");
2271
2295
  return new URL(path, this.canonicalOrigin);
2272
2296
  }
@@ -2279,10 +2303,7 @@ var ContextImpl = class ContextImpl {
2279
2303
  return new URL(path, this.canonicalOrigin);
2280
2304
  }
2281
2305
  getOutboxUri(identifier) {
2282
- const path = this.federation.router.build("outbox", {
2283
- identifier,
2284
- handle: identifier
2285
- });
2306
+ const path = this.federation.router.build("outbox", { identifier });
2286
2307
  if (path == null) throw new RouterError("No outbox dispatcher registered.");
2287
2308
  return new URL(path, this.canonicalOrigin);
2288
2309
  }
@@ -2292,50 +2313,32 @@ var ContextImpl = class ContextImpl {
2292
2313
  if (path$1 == null) throw new RouterError("No shared inbox path registered.");
2293
2314
  return new URL(path$1, this.canonicalOrigin);
2294
2315
  }
2295
- const path = this.federation.router.build("inbox", {
2296
- identifier,
2297
- handle: identifier
2298
- });
2316
+ const path = this.federation.router.build("inbox", { identifier });
2299
2317
  if (path == null) throw new RouterError("No inbox path registered.");
2300
2318
  return new URL(path, this.canonicalOrigin);
2301
2319
  }
2302
2320
  getFollowingUri(identifier) {
2303
- const path = this.federation.router.build("following", {
2304
- identifier,
2305
- handle: identifier
2306
- });
2321
+ const path = this.federation.router.build("following", { identifier });
2307
2322
  if (path == null) throw new RouterError("No following collection path registered.");
2308
2323
  return new URL(path, this.canonicalOrigin);
2309
2324
  }
2310
2325
  getFollowersUri(identifier) {
2311
- const path = this.federation.router.build("followers", {
2312
- identifier,
2313
- handle: identifier
2314
- });
2326
+ const path = this.federation.router.build("followers", { identifier });
2315
2327
  if (path == null) throw new RouterError("No followers collection path registered.");
2316
2328
  return new URL(path, this.canonicalOrigin);
2317
2329
  }
2318
2330
  getLikedUri(identifier) {
2319
- const path = this.federation.router.build("liked", {
2320
- identifier,
2321
- handle: identifier
2322
- });
2331
+ const path = this.federation.router.build("liked", { identifier });
2323
2332
  if (path == null) throw new RouterError("No liked collection path registered.");
2324
2333
  return new URL(path, this.canonicalOrigin);
2325
2334
  }
2326
2335
  getFeaturedUri(identifier) {
2327
- const path = this.federation.router.build("featured", {
2328
- identifier,
2329
- handle: identifier
2330
- });
2336
+ const path = this.federation.router.build("featured", { identifier });
2331
2337
  if (path == null) throw new RouterError("No featured collection path registered.");
2332
2338
  return new URL(path, this.canonicalOrigin);
2333
2339
  }
2334
2340
  getFeaturedTagsUri(identifier) {
2335
- const path = this.federation.router.build("featuredTags", {
2336
- identifier,
2337
- handle: identifier
2338
- });
2341
+ const path = this.federation.router.build("featuredTags", { identifier });
2339
2342
  if (path == null) throw new RouterError("No featured tags collection path registered.");
2340
2343
  return new URL(path, this.canonicalOrigin);
2341
2344
  }
@@ -2348,24 +2351,15 @@ var ContextImpl = class ContextImpl {
2348
2351
  if (uri == null) return null;
2349
2352
  if (uri.origin !== this.origin && uri.origin !== this.canonicalOrigin) return null;
2350
2353
  const route = this.federation.router.route(uri.pathname);
2351
- const logger$2 = getLogger(["fedify", "federation"]);
2352
2354
  if (route == null) return null;
2353
2355
  else if (route.name === "sharedInbox") return {
2354
2356
  type: "inbox",
2355
- identifier: void 0,
2356
- get handle() {
2357
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2358
- return void 0;
2359
- }
2357
+ identifier: void 0
2360
2358
  };
2361
- const identifier = "identifier" in route.values ? route.values.identifier : route.values.handle;
2359
+ const identifier = route.values.identifier;
2362
2360
  if (route.name === "actor") return {
2363
2361
  type: "actor",
2364
- identifier,
2365
- get handle() {
2366
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2367
- return identifier;
2368
- }
2362
+ identifier
2369
2363
  };
2370
2364
  else if (route.name.startsWith("object:")) {
2371
2365
  const typeId = route.name.replace(/^object:/, "");
@@ -2377,59 +2371,31 @@ var ContextImpl = class ContextImpl {
2377
2371
  };
2378
2372
  } else if (route.name === "inbox") return {
2379
2373
  type: "inbox",
2380
- identifier,
2381
- get handle() {
2382
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2383
- return identifier;
2384
- }
2374
+ identifier
2385
2375
  };
2386
2376
  else if (route.name === "outbox") return {
2387
2377
  type: "outbox",
2388
- identifier,
2389
- get handle() {
2390
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2391
- return identifier;
2392
- }
2378
+ identifier
2393
2379
  };
2394
2380
  else if (route.name === "following") return {
2395
2381
  type: "following",
2396
- identifier,
2397
- get handle() {
2398
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2399
- return identifier;
2400
- }
2382
+ identifier
2401
2383
  };
2402
2384
  else if (route.name === "followers") return {
2403
2385
  type: "followers",
2404
- identifier,
2405
- get handle() {
2406
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2407
- return identifier;
2408
- }
2386
+ identifier
2409
2387
  };
2410
2388
  else if (route.name === "liked") return {
2411
2389
  type: "liked",
2412
- identifier,
2413
- get handle() {
2414
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2415
- return identifier;
2416
- }
2390
+ identifier
2417
2391
  };
2418
2392
  else if (route.name === "featured") return {
2419
2393
  type: "featured",
2420
- identifier,
2421
- get handle() {
2422
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2423
- return identifier;
2424
- }
2394
+ identifier
2425
2395
  };
2426
2396
  else if (route.name === "featuredTags") return {
2427
2397
  type: "featuredTags",
2428
- identifier,
2429
- get handle() {
2430
- logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
2431
- return identifier;
2432
- }
2398
+ identifier
2433
2399
  };
2434
2400
  const collectionTypes = ["collection", "orderedCollection"];
2435
2401
  const collectionRegex = /* @__PURE__ */ new RegExp(`^(${collectionTypes.join("|")}):(.*)$`);
@@ -2531,19 +2497,10 @@ var ContextImpl = class ContextImpl {
2531
2497
  return null;
2532
2498
  }
2533
2499
  getDocumentLoader(identity) {
2534
- if ("identifier" in identity || "username" in identity || "handle" in identity) {
2500
+ if ("identifier" in identity || "username" in identity) {
2535
2501
  let identifierPromise;
2536
- if ("username" in identity || "handle" in identity) {
2537
- let username;
2538
- if ("username" in identity) username = identity.username;
2539
- else {
2540
- username = identity.handle;
2541
- getLogger([
2542
- "fedify",
2543
- "runtime",
2544
- "docloader"
2545
- ]).warn("The \"handle\" property is deprecated; use \"identifier\" or \"username\" instead.", { identity });
2546
- }
2502
+ if ("username" in identity) {
2503
+ const username = identity.username;
2547
2504
  const mapper = this.federation.actorCallbacks?.handleMapper;
2548
2505
  if (mapper == null) identifierPromise = Promise.resolve(username);
2549
2506
  else {
@@ -2629,15 +2586,10 @@ var ContextImpl = class ContextImpl {
2629
2586
  ]);
2630
2587
  let keys;
2631
2588
  let identifier = null;
2632
- if ("identifier" in sender || "username" in sender || "handle" in sender) {
2589
+ if ("identifier" in sender || "username" in sender) {
2633
2590
  if ("identifier" in sender) identifier = sender.identifier;
2634
2591
  else {
2635
- let username;
2636
- if ("username" in sender) username = sender.username;
2637
- else {
2638
- username = sender.handle;
2639
- logger$2.warn("The \"handle\" property for the sender parameter is deprecated; use \"identifier\" or \"username\" instead.", { sender });
2640
- }
2592
+ const username = sender.username;
2641
2593
  if (this.federation.actorCallbacks?.handleMapper == null) identifier = username;
2642
2594
  else {
2643
2595
  const mapped = await this.federation.actorCallbacks.handleMapper(this, username);
@@ -2993,15 +2945,10 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
2993
2945
  ]);
2994
2946
  let keys;
2995
2947
  let identifier = null;
2996
- if ("identifier" in forwarder || "username" in forwarder || "handle" in forwarder) {
2948
+ if ("identifier" in forwarder || "username" in forwarder) {
2997
2949
  if ("identifier" in forwarder) identifier = forwarder.identifier;
2998
2950
  else {
2999
- let username;
3000
- if ("username" in forwarder) username = forwarder.username;
3001
- else {
3002
- username = forwarder.handle;
3003
- logger$2.warn("The \"handle\" property for the forwarder parameter is deprecated; use \"identifier\" or \"username\" instead.", { forwarder });
3004
- }
2951
+ const username = forwarder.username;
3005
2952
  if (this.federation.actorCallbacks?.handleMapper == null) identifier = username;
3006
2953
  else {
3007
2954
  const mapped = await this.federation.actorCallbacks.handleMapper(this, username);
@@ -0,0 +1,12 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ require('./transformers-3g8GZwkZ.cjs');
6
+ require('./http-DaydvKvf.cjs');
7
+ const require_middleware = require('./middleware-B2gMDc87.cjs');
8
+ require('./proof-CRneYTMl.cjs');
9
+ require('./types-Cd_hszr_.cjs');
10
+ require('./kv-cache-DlBRpUdw.cjs');
11
+
12
+ exports.FederationImpl = require_middleware.FederationImpl;
@@ -1,4 +1,4 @@
1
- import { ActivityTransformer, Context } from "./context-Cf0-LmZC.cjs";
1
+ import { ActivityTransformer, Context } from "./context-BdNW_8a3.cjs";
2
2
  import { Activity } from "@fedify/vocab";
3
3
 
4
4
  //#region src/compat/transformers.d.ts
@@ -1,4 +1,4 @@
1
- import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, RequestContext, WebFingerLinksDispatcher } from "./context-Cf0-LmZC.cjs";
1
+ import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, RequestContext, WebFingerLinksDispatcher } from "./context-BdNW_8a3.cjs";
2
2
  import { Span, Tracer } from "@opentelemetry/api";
3
3
 
4
4
  //#region src/federation/webfinger.d.ts
@@ -47,24 +47,6 @@ declare function getAuthenticatedDocumentLoader(identity: {
47
47
  specDeterminer,
48
48
  tracerProvider
49
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
50
  //#endregion
69
51
  //#region src/utils/kv-cache.d.ts
70
52
  /**
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, RequestContext, WebFingerLinksDispatcher } from "./context-liIe6DFH.js";
3
+ import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, RequestContext, WebFingerLinksDispatcher } from "./context-C-GVKcJR.js";
4
4
  import { Span, Tracer } from "@opentelemetry/api";
5
5
 
6
6
  //#region src/federation/webfinger.d.ts