@fedify/fedify 2.4.0-dev.2212 → 2.4.0-dev.2219

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 (92) hide show
  1. package/dist/{builder-CKAVFvcH.mjs → builder-C5rYBZ16.mjs} +10 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-BP5SOdXv.mjs → compound-proof-D0xY7MBs.mjs} +2 -2
  6. package/dist/{context-Bl_Y7T_3.d.cts → context-B6X-t8gI.d.cts} +1 -1
  7. package/dist/{context-DMd11IAu.d.ts → context-CtI307_A.d.ts} +1 -1
  8. package/dist/{deno-BKp9fYB3.mjs → deno-Dj1TFhf4.mjs} +1 -1
  9. package/dist/{docloader-BjJreYQU.mjs → docloader-CzyJe90o.mjs} +2 -2
  10. package/dist/federation/builder.test.mjs +37 -1
  11. package/dist/federation/compound-fanout.test.mjs +3 -3
  12. package/dist/federation/handler-compound-proof.test.mjs +3 -3
  13. package/dist/federation/handler.test.mjs +5 -5
  14. package/dist/federation/hashlink-media.test.mjs +2 -2
  15. package/dist/federation/idempotency.test.mjs +2 -2
  16. package/dist/federation/metrics.test.mjs +1 -1
  17. package/dist/federation/middleware.test.mjs +123 -7
  18. package/dist/federation/mod.cjs +1 -1
  19. package/dist/federation/mod.d.cts +3 -3
  20. package/dist/federation/mod.d.ts +3 -3
  21. package/dist/federation/mod.js +1 -1
  22. package/dist/federation/outgoing-proof.test.mjs +5 -5
  23. package/dist/federation/portable-actor.test.mjs +3 -3
  24. package/dist/federation/portable-chain.test.mjs +3 -3
  25. package/dist/federation/portable-collection.test.mjs +4 -4
  26. package/dist/federation/portable-delivery.test.mjs +2 -2
  27. package/dist/federation/portable-gateway-keys.test.mjs +4 -4
  28. package/dist/federation/portable-inbox.test.mjs +4 -4
  29. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  30. package/dist/federation/portable-route-activity.test.mjs +2 -2
  31. package/dist/federation/portable.test.mjs +3 -3
  32. package/dist/federation/send.test.mjs +3 -3
  33. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  34. package/dist/federation/tasks/tasks.test.mjs +2 -2
  35. package/dist/federation/temporal.test.mjs +1 -1
  36. package/dist/federation/webfinger.test.mjs +1 -1
  37. package/dist/{federation-B-0EXZPH.cjs → federation-DC1yfb-8.cjs} +20 -9
  38. package/dist/{http-ByBlnY3D.cjs → http-Cuk0w0rp.cjs} +1 -1
  39. package/dist/{http--IGUT1mg.mjs → http-D-DpP4sd.mjs} +4 -4
  40. package/dist/{http-Di8yiDMY.js → http-Dx7yMmfw.js} +1 -1
  41. package/dist/{key-ChfV9C3v.mjs → key-Djyt1BFx.mjs} +2 -2
  42. package/dist/{kv-BhNbN8Ed.d.cts → kv-B2mzK5tl.d.cts} +3 -2
  43. package/dist/{kv-BhNbN8Ed.d.ts → kv-B2mzK5tl.d.ts} +3 -2
  44. package/dist/{kv-cache-BDwUzxBJ.cjs → kv-cache-BmLTVLXc.cjs} +1 -1
  45. package/dist/{kv-cache-DpwDPt9V.js → kv-cache-CUZOCSKZ.js} +1 -1
  46. package/dist/{kv-cache-DFIUR-E5.mjs → kv-cache-ecUXfCqW.mjs} +1 -1
  47. package/dist/{ld-DBBVabBC.mjs → ld-CNVWdooi.mjs} +3 -3
  48. package/dist/{metrics-DPQKFkiJ.mjs → metrics-BnYleVpg.mjs} +1 -1
  49. package/dist/{middleware-VXGLiHtY.js → middleware-BdzcazaN.js} +20 -9
  50. package/dist/{middleware-G9zpxUsD.mjs → middleware-Bh592bk8.mjs} +1 -1
  51. package/dist/{middleware-BW7-tHAG.mjs → middleware-C2_LcbL3.mjs} +23 -20
  52. package/dist/{mod-C5Mwx5ty.d.ts → mod-B8MI1mpi.d.ts} +1 -1
  53. package/dist/{mod-BVNGHgVr.d.ts → mod-BhTaDR5H.d.ts} +1 -1
  54. package/dist/{mod-Cyy1Wahy.d.cts → mod-C7_2j7VT.d.cts} +1 -1
  55. package/dist/{mod-Dp3Ij7sw.d.cts → mod-DFL6IxYQ.d.cts} +1 -1
  56. package/dist/mod.cjs +4 -4
  57. package/dist/mod.d.cts +4 -4
  58. package/dist/mod.d.ts +4 -4
  59. package/dist/mod.js +4 -4
  60. package/dist/nodeinfo/handler.test.mjs +1 -1
  61. package/dist/otel/mod.d.cts +1 -1
  62. package/dist/otel/mod.d.ts +1 -1
  63. package/dist/{owner-BW5VsXG3.mjs → owner-D_BDPwm2.mjs} +3 -3
  64. package/dist/{portable-collection-FTPa5D91.js → portable-collection-C0c0rUN9.js} +1 -1
  65. package/dist/{portable-collection-CXcAlwei.cjs → portable-collection-DwJ8YJP2.cjs} +1 -1
  66. package/dist/{portable-collection-Ct99JsBe.mjs → portable-collection-hcONGyUs.mjs} +2 -2
  67. package/dist/{portable-key-U3lW06QJ.mjs → portable-key-B880yVlC.mjs} +1 -1
  68. package/dist/{proof-MFz2960e.mjs → proof-z6Prgi5I.mjs} +4 -4
  69. package/dist/{send-Duj8xys1.mjs → send-Cw545L_2.mjs} +3 -3
  70. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  71. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  72. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  73. package/dist/sig/compound-proof.test.mjs +2 -2
  74. package/dist/sig/http.test.mjs +2 -2
  75. package/dist/sig/key.test.mjs +1 -1
  76. package/dist/sig/ld.test.mjs +2 -2
  77. package/dist/sig/mod.cjs +2 -2
  78. package/dist/sig/mod.js +2 -2
  79. package/dist/sig/owner.test.mjs +1 -1
  80. package/dist/sig/portable-collection.test.mjs +1 -1
  81. package/dist/sig/portable-key.test.mjs +6 -6
  82. package/dist/sig/proof.test.mjs +3 -3
  83. package/dist/{temporal-CVcPKB1N.mjs → temporal-Cy-8WCod.mjs} +1 -1
  84. package/dist/testing/kv.test.mjs +1 -1
  85. package/dist/testing/mod.d.mts +3 -2
  86. package/dist/utils/docloader.test.mjs +2 -2
  87. package/dist/utils/kv-cache.test.mjs +1 -1
  88. package/dist/utils/mod.cjs +1 -1
  89. package/dist/utils/mod.d.cts +1 -1
  90. package/dist/utils/mod.d.ts +1 -1
  91. package/dist/utils/mod.js +1 -1
  92. package/package.json +7 -7
@@ -8,11 +8,11 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
9
9
  import "../std__assert-DvMDRPes.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { p as signJsonLd } from "../ld-DBBVabBC.mjs";
12
- import { a as signObject } from "../proof-MFz2960e.mjs";
13
- import { l as signRequest, p as verifyRequestDetailed } from "../http--IGUT1mg.mjs";
11
+ import { p as signJsonLd } from "../ld-CNVWdooi.mjs";
12
+ import { a as signObject } from "../proof-z6Prgi5I.mjs";
13
+ import { l as signRequest, p as verifyRequestDetailed } from "../http-D-DpP4sd.mjs";
14
14
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
15
- import { _ as coversDelivery, o as createFederation, v as forwardPortableInboxActivity, y as resolvePortableInboxForwardingOptions } from "../middleware-BW7-tHAG.mjs";
15
+ import { _ as coversDelivery, o as createFederation, v as forwardPortableInboxActivity, y as resolvePortableInboxForwardingOptions } from "../middleware-C2_LcbL3.mjs";
16
16
  import { Create, CryptographicKey, Follow, Note, Person, Tombstone } from "@fedify/vocab";
17
17
  import { exportDidKey, formatIri, parseIri } from "@fedify/vocab-runtime";
18
18
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -7,7 +7,7 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
7
7
  import "../std__assert-DvMDRPes.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
9
  import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
10
- import { o as createFederation } from "../middleware-BW7-tHAG.mjs";
10
+ import { o as createFederation } from "../middleware-C2_LcbL3.mjs";
11
11
  import { Note, Object as Object$1, Person } from "@fedify/vocab";
12
12
  import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
13
13
  import { test } from "@fedify/fixture";
@@ -6,9 +6,9 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
7
7
  import "../std__assert-DvMDRPes.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { a as signObject } from "../proof-MFz2960e.mjs";
9
+ import { a as signObject } from "../proof-z6Prgi5I.mjs";
10
10
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
11
- import { o as createFederation } from "../middleware-BW7-tHAG.mjs";
11
+ import { o as createFederation } from "../middleware-C2_LcbL3.mjs";
12
12
  import { Create, Note } from "@fedify/vocab";
13
13
  import { exportDidKey, formatIri, parseIri, toCompatibleEf61Id } from "@fedify/vocab-runtime";
14
14
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -8,10 +8,10 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
8
8
  import "../std__assert-DvMDRPes.mjs";
9
9
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { a as signObject, c as verifyPortableObjectProof } from "../proof-MFz2960e.mjs";
12
- import { l as signRequest } from "../http--IGUT1mg.mjs";
11
+ import { a as signObject, c as verifyPortableObjectProof } from "../proof-z6Prgi5I.mjs";
12
+ import { l as signRequest } from "../http-D-DpP4sd.mjs";
13
13
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
14
- import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-BW7-tHAG.mjs";
14
+ import { b as PORTABLE_OBJECT_CONTENT_TYPE, o as createFederation } from "../middleware-C2_LcbL3.mjs";
15
15
  import { configure, reset } from "@logtape/logtape";
16
16
  import { Collection, Create, Note, Object as Object$1, PUBLIC_COLLECTION, Person, Tombstone, lookupObject } from "@fedify/vocab";
17
17
  import { exportDidKey, formatIri, parseIri, toCompatibleEf61Id } from "@fedify/vocab-runtime";
@@ -10,10 +10,10 @@ import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
10
10
  import "../std__assert-DvMDRPes.mjs";
11
11
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
12
12
  import { t as assert } from "../assert-D1Eafmd_.mjs";
13
- import { f as verifyRequest } from "../http--IGUT1mg.mjs";
13
+ import { f as verifyRequest } from "../http-D-DpP4sd.mjs";
14
14
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
15
- import { t as doesActorOwnKey } from "../owner-BW5VsXG3.mjs";
16
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-Duj8xys1.mjs";
15
+ import { t as doesActorOwnKey } from "../owner-D_BDPwm2.mjs";
16
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-Cw545L_2.mjs";
17
17
  import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
18
18
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
19
19
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
5
5
  import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-IG3pHfvZ.mjs";
6
6
  import "../../testing-t8xDeJZ5.mjs";
7
- import { o as createFederation } from "../../middleware-BW7-tHAG.mjs";
7
+ import { o as createFederation } from "../../middleware-C2_LcbL3.mjs";
8
8
  import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
9
9
  import { configure, reset } from "@logtape/logtape";
10
10
  import { delay } from "es-toolkit";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
5
5
  import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-IG3pHfvZ.mjs";
6
6
  import "../../testing-t8xDeJZ5.mjs";
7
- import { o as createFederation } from "../../middleware-BW7-tHAG.mjs";
8
- import { r as createFederationBuilder } from "../../builder-CKAVFvcH.mjs";
7
+ import { o as createFederation } from "../../middleware-C2_LcbL3.mjs";
8
+ import { r as createFederationBuilder } from "../../builder-C5rYBZ16.mjs";
9
9
  import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
10
10
  import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
11
11
  import { W3CTraceContextPropagator } from "@opentelemetry/core";
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { t as hasMalformedKnownTemporalLiteral } from "../temporal-CVcPKB1N.mjs";
7
+ import { t as hasMalformedKnownTemporalLiteral } from "../temporal-Cy-8WCod.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/temporal.test.ts
10
10
  test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
7
7
  import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
8
8
  import "../std__assert-DvMDRPes.mjs";
9
- import { o as createFederation, s as handleWebFinger } from "../middleware-BW7-tHAG.mjs";
9
+ import { o as createFederation, s as handleWebFinger } from "../middleware-C2_LcbL3.mjs";
10
10
  import { Image, Link, Person, Tombstone } from "@fedify/vocab";
11
11
  import { parseIri } from "@fedify/vocab-runtime";
12
12
  import { createTestMeterProvider, test } from "@fedify/fixture";
@@ -1,10 +1,10 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-Dmm3t92W.cjs");
3
3
  const require_transformers = require("./transformers-BalCrSsr.cjs");
4
- const require_http = require("./http-ByBlnY3D.cjs");
4
+ const require_http = require("./http-Cuk0w0rp.cjs");
5
5
  const require_types = require("./types-poIao40f.cjs");
6
- const require_portable_collection = require("./portable-collection-CXcAlwei.cjs");
7
- const require_kv_cache = require("./kv-cache-BDwUzxBJ.cjs");
6
+ const require_portable_collection = require("./portable-collection-DwJ8YJP2.cjs");
7
+ const require_kv_cache = require("./kv-cache-BmLTVLXc.cjs");
8
8
  let _logtape_logtape = require("@logtape/logtape");
9
9
  let _fedify_uri_template = require("@fedify/uri-template");
10
10
  let _fedify_vocab = require("@fedify/vocab");
@@ -118,6 +118,7 @@ var FederationBuilderImpl = class {
118
118
  * Symbol registry for unique identification of unnamed symbols.
119
119
  */
120
120
  #symbolRegistry = /* @__PURE__ */ new Map();
121
+ #collectionNames = /* @__PURE__ */ new Map();
121
122
  constructor() {
122
123
  this.router = new _fedify_uri_template.Router();
123
124
  this.objectCallbacks = {};
@@ -147,6 +148,8 @@ var FederationBuilderImpl = class {
147
148
  f.objectTypeIds = { ...this.objectTypeIds };
148
149
  f.collectionCallbacks = { ...this.collectionCallbacks };
149
150
  f.collectionTypeIds = { ...this.collectionTypeIds };
151
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
152
+ f.#collectionNames = new Map(this.#collectionNames);
150
153
  f.inboxPath = this.inboxPath;
151
154
  f.outboxPath = this.outboxPath;
152
155
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
@@ -678,6 +681,7 @@ var FederationBuilderImpl = class {
678
681
  if (this.collectionCallbacks[name] != null) throw new _fedify_uri_template.RouterError(`Collection dispatcher for ${strName} already set.`);
679
682
  (0, _fedify_uri_template.assertPath)(path);
680
683
  if (_fedify_uri_template.Router.variables(path).size < 1) throw new _fedify_uri_template.RouterError("Path for collection dispatcher must have at least one variable.");
684
+ this.#collectionNames.set(routeName, name);
681
685
  this.router.add(path, routeName);
682
686
  const callbacks = { dispatcher };
683
687
  this.collectionCallbacks[name] = callbacks;
@@ -719,6 +723,10 @@ var FederationBuilderImpl = class {
719
723
  const routeName = this.#uniqueCollectionId(name);
720
724
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
721
725
  }
726
+ /** Resolves a custom collection route to its original name. */
727
+ getCollectionName(routeName) {
728
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
729
+ }
722
730
  setOutboxPermanentFailureHandler(handler) {
723
731
  this.outboxPermanentFailureHandler = handler;
724
732
  }
@@ -9508,10 +9516,10 @@ var FederationImpl = class extends FederationBuilderImpl {
9508
9516
  onNotFound
9509
9517
  });
9510
9518
  case "collection": {
9511
- const name = route.name.replace(/^collection:/, "");
9519
+ const name = this.getCollectionName(route.name);
9512
9520
  const callbacks = this.collectionCallbacks[name];
9513
9521
  return await handleCustomCollection(request, {
9514
- name,
9522
+ name: String(name),
9515
9523
  context,
9516
9524
  values: route.values,
9517
9525
  collectionCallbacks: callbacks,
@@ -9522,10 +9530,10 @@ var FederationImpl = class extends FederationBuilderImpl {
9522
9530
  });
9523
9531
  }
9524
9532
  case "orderedCollection": {
9525
- const name = route.name.replace(/^orderedCollection:/, "");
9533
+ const name = this.getCollectionName(route.name);
9526
9534
  const callbacks = this.collectionCallbacks[name];
9527
9535
  return await handleOrderedCollection(request, {
9528
- name,
9536
+ name: String(name),
9529
9537
  context,
9530
9538
  values: route.values,
9531
9539
  collectionCallbacks: callbacks,
@@ -10291,8 +10299,10 @@ var ContextImpl = class ContextImpl {
10291
10299
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
10292
10300
  const match = route.name.match(collectionRegex);
10293
10301
  if (match !== null) {
10294
- const [, type, name] = match;
10302
+ const [, type] = match;
10303
+ const name = this.federation.getCollectionName(route.name);
10295
10304
  const cls = this.federation.collectionTypeIds[name];
10305
+ if (cls == null) return null;
10296
10306
  return {
10297
10307
  type,
10298
10308
  name,
@@ -10695,7 +10705,7 @@ var ContextImpl = class ContextImpl {
10695
10705
  "inbox"
10696
10706
  ]);
10697
10707
  const contextLoader = options.contextLoader ?? this.contextLoader;
10698
- const json = await activity.toJsonLd({ contextLoader });
10708
+ let json = await activity.toJsonLd({ contextLoader });
10699
10709
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, {
10700
10710
  documentLoader: this.documentLoader,
10701
10711
  contextLoader: this.contextLoader,
@@ -10757,6 +10767,7 @@ var ContextImpl = class ContextImpl {
10757
10767
  }
10758
10768
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
10759
10769
  activity = fetched;
10770
+ json = await fetched.toJsonLd({ contextLoader });
10760
10771
  } else logger.debug("Object Integrity Proofs are verified.", {
10761
10772
  recipient,
10762
10773
  activity: json
@@ -16,7 +16,7 @@ json_canon = require_rolldown_runtime.__toESM(json_canon, 1);
16
16
  let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
17
17
  //#region deno.json
18
18
  var name = "@fedify/fedify";
19
- var version = "2.4.0-dev.2212+26ce9858";
19
+ var version = "2.4.0-dev.2219+eb70f060";
20
20
  //#endregion
21
21
  //#region src/sig/portable-key-id.ts
22
22
  const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
@@ -2,12 +2,12 @@ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { m as parseKeyIdString } from "./portable-key-id-Ca30-hOa.mjs";
5
- import { n as version, t as name } from "./deno-BKp9fYB3.mjs";
6
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DPQKFkiJ.mjs";
5
+ import { n as version, t as name } from "./deno-Dj1TFhf4.mjs";
6
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-BnYleVpg.mjs";
7
7
  import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPVqki78.mjs";
8
8
  import { a as promoteKeyOwnerEvidence } from "./key-owner-evidence-APB6NpSk.mjs";
9
- import { a as fetchKeyDetailed, c as validateCryptoKey, t as bypassKeyCacheReads } from "./key-ChfV9C3v.mjs";
10
- import { n as resolvePortableActorKey, r as verifyPortableGatewayKeyDocument } from "./portable-key-U3lW06QJ.mjs";
9
+ import { a as fetchKeyDetailed, c as validateCryptoKey, t as bypassKeyCacheReads } from "./key-Djyt1BFx.mjs";
10
+ import { n as resolvePortableActorKey, r as verifyPortableGatewayKeyDocument } from "./portable-key-B880yVlC.mjs";
11
11
  import { getLogger } from "@logtape/logtape";
12
12
  import { CryptographicKey } from "@fedify/vocab";
13
13
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -14,7 +14,7 @@ import serialize from "json-canon";
14
14
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
15
15
  //#region deno.json
16
16
  var name = "@fedify/fedify";
17
- var version = "2.4.0-dev.2212+26ce9858";
17
+ var version = "2.4.0-dev.2219+eb70f060";
18
18
  //#endregion
19
19
  //#region src/sig/portable-key-id.ts
20
20
  const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
@@ -2,8 +2,8 @@ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { c as isPortableActorDocument, d as isPortableUri, l as isPortableId, m as parseKeyIdString, s as isCompatibleKeyId } from "./portable-key-id-Ca30-hOa.mjs";
5
- import { n as version, t as name } from "./deno-BKp9fYB3.mjs";
6
- import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-DPQKFkiJ.mjs";
5
+ import { n as version, t as name } from "./deno-Dj1TFhf4.mjs";
6
+ import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-BnYleVpg.mjs";
7
7
  import { n as attachKeyOwnerEvidence, t as MAX_PORTABLE_KEY_TTL } from "./key-owner-evidence-APB6NpSk.mjs";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { CryptographicKey, Multikey, Object as Object$1, isActor } from "@fedify/vocab";
@@ -41,14 +41,15 @@ interface KvStore {
41
41
  /**
42
42
  * Gets the value for the given key.
43
43
  * @param key The key to get the value for.
44
- * @returns The value for the key, or `undefined` if the key does not exist.
44
+ * @returns The value for the key, including `null` if stored, or `undefined`
45
+ * if the key does not exist.
45
46
  * @template T The type of the value to get.
46
47
  */
47
48
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
48
49
  /**
49
50
  * Sets the value for the given key.
50
51
  * @param key The key to set the value for.
51
- * @param value The value to set.
52
+ * @param value The value to set. `null` is a storable value.
52
53
  * @param options Additional options for setting the value.
53
54
  */
54
55
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
@@ -41,14 +41,15 @@ interface KvStore {
41
41
  /**
42
42
  * Gets the value for the given key.
43
43
  * @param key The key to get the value for.
44
- * @returns The value for the key, or `undefined` if the key does not exist.
44
+ * @returns The value for the key, including `null` if stored, or `undefined`
45
+ * if the key does not exist.
45
46
  * @template T The type of the value to get.
46
47
  */
47
48
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
48
49
  /**
49
50
  * Sets the value for the given key.
50
51
  * @param key The key to set the value for.
51
- * @param value The value to set.
52
+ * @param value The value to set. `null` is a storable value.
52
53
  * @param options Additional options for setting the value.
53
54
  */
54
55
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
- const require_http = require("./http-ByBlnY3D.cjs");
2
+ const require_http = require("./http-Cuk0w0rp.cjs");
3
3
  let _logtape_logtape = require("@logtape/logtape");
4
4
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
5
5
  let es_toolkit = require("es-toolkit");
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { G as validateCryptoKey, ot as recordDocumentCache, t as doubleKnock } from "./http-Di8yiDMY.js";
3
+ import { G as validateCryptoKey, ot as recordDocumentCache, t as doubleKnock } from "./http-Dx7yMmfw.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, resolveDocumentLoaderTimeout, validatePublicUrl, withDocumentLoaderTimeout } from "@fedify/vocab-runtime";
6
6
  import { curry } from "es-toolkit";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { p as recordDocumentCache } from "./metrics-DPQKFkiJ.mjs";
4
+ import { p as recordDocumentCache } from "./metrics-BnYleVpg.mjs";
5
5
  import { getLogger } from "@logtape/logtape";
6
6
  import { preloadedContexts } from "@fedify/vocab-runtime";
7
7
  //#region src/utils/kv-cache.ts
@@ -1,9 +1,9 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-BKp9fYB3.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DPQKFkiJ.mjs";
6
- import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-ChfV9C3v.mjs";
4
+ import { n as version, t as name } from "./deno-Dj1TFhf4.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-BnYleVpg.mjs";
6
+ import { c as validateCryptoKey, i as fetchKey, t as bypassKeyCacheReads } from "./key-Djyt1BFx.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-BKp9fYB3.mjs";
4
+ import { n as version, t as name } from "./deno-Dj1TFhf4.mjs";
5
5
  import { metrics } from "@opentelemetry/api";
6
6
  import { FetchError } from "@fedify/vocab-runtime";
7
7
  //#region src/federation/metrics.ts
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./rolldown-runtime-BC-Eo5Mj.js";
4
4
  import { r as getDefaultActivityTransformers } from "./transformers-DAtXl_Kc.js";
5
- import { $ as instrumentDocumentLoader, A as hasSignature, At as name, C as InvalidContextReferenceError, Ct as hasPortableActor, Dt as isPortableUri, E as compactJsonLd, Et as isPortableKeyId, F as verifyCompactJsonLd, G as validateCryptoKey, M as isClearlyMalformedContextReference, N as isInvalidUrlTypeError, O as detachSignature, Ot as isSameObjectId, P as signJsonLd, Q as getRemoteHost, R as wrapContextLoaderForJsonLd, S as normalizeOutgoingActivityJsonLd, St as getRawCanonicalPortableId, Tt as isPortableId, W as importJwk, X as getDurationMs, Z as getFederationMetrics, _ as verifyObject, at as recordCollectionTotalItems, b as verifyPortableObjectProofWithRoot, bt as getGatewayKeyBase, c as verifyRequestDetailed, ct as recordInboxActivity, d as InvalidPortableObjectIdError, dt as recordWebFingerHandle, et as isAbortError, f as classifyFep2277CoreType, ft as registerQueueDepthGauge, g as verifyMapLocalProof, h as signObject, i as selectRequestSignature, it as recordCollectionRequest, j as hasSignatureLike, jt as version, k as getNormalizationContextLoader, lt as recordOutboxActivity, m as hasProofLike, mt as formatAcceptSignature, n as listRequestSignatures, nt as recordCollectionDispatchDuration, o as validateMaxSignatures, pt as preloadedOnlyDocumentLoader, q as MAX_PORTABLE_KEY_TTL, r as parseRfc9421SignatureInput, rt as recordCollectionPageItems, s as verifyRequest, st as recordFanoutRecipients, t as doubleKnock, tt as recordCircuitBreakerStateChange, ut as recordOutboxEnqueue, v as verifyPortableObjectProof, vt as getAuthenticationOrigin, w as assertSafeJsonLd, wt as isCompatibleKeyId, xt as getPortableDid, y as verifyPortableObjectProofPolicy, yt as getCanonicalPortableId, z as exportJwk } from "./http-Di8yiDMY.js";
5
+ import { $ as instrumentDocumentLoader, A as hasSignature, At as name, C as InvalidContextReferenceError, Ct as hasPortableActor, Dt as isPortableUri, E as compactJsonLd, Et as isPortableKeyId, F as verifyCompactJsonLd, G as validateCryptoKey, M as isClearlyMalformedContextReference, N as isInvalidUrlTypeError, O as detachSignature, Ot as isSameObjectId, P as signJsonLd, Q as getRemoteHost, R as wrapContextLoaderForJsonLd, S as normalizeOutgoingActivityJsonLd, St as getRawCanonicalPortableId, Tt as isPortableId, W as importJwk, X as getDurationMs, Z as getFederationMetrics, _ as verifyObject, at as recordCollectionTotalItems, b as verifyPortableObjectProofWithRoot, bt as getGatewayKeyBase, c as verifyRequestDetailed, ct as recordInboxActivity, d as InvalidPortableObjectIdError, dt as recordWebFingerHandle, et as isAbortError, f as classifyFep2277CoreType, ft as registerQueueDepthGauge, g as verifyMapLocalProof, h as signObject, i as selectRequestSignature, it as recordCollectionRequest, j as hasSignatureLike, jt as version, k as getNormalizationContextLoader, lt as recordOutboxActivity, m as hasProofLike, mt as formatAcceptSignature, n as listRequestSignatures, nt as recordCollectionDispatchDuration, o as validateMaxSignatures, pt as preloadedOnlyDocumentLoader, q as MAX_PORTABLE_KEY_TTL, r as parseRfc9421SignatureInput, rt as recordCollectionPageItems, s as verifyRequest, st as recordFanoutRecipients, t as doubleKnock, tt as recordCircuitBreakerStateChange, ut as recordOutboxEnqueue, v as verifyPortableObjectProof, vt as getAuthenticationOrigin, w as assertSafeJsonLd, wt as isCompatibleKeyId, xt as getPortableDid, y as verifyPortableObjectProofPolicy, yt as getCanonicalPortableId, z as exportJwk } from "./http-Dx7yMmfw.js";
6
6
  import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-_S2_MeLF.js";
7
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-FTPa5D91.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DpwDPt9V.js";
7
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-C0c0rUN9.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CUZOCSKZ.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
11
11
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, PUBLIC_COLLECTION, Tombstone, getTypeId, isActor, lookupObject, traverseCollection } from "@fedify/vocab";
@@ -118,6 +118,7 @@ var FederationBuilderImpl = class {
118
118
  * Symbol registry for unique identification of unnamed symbols.
119
119
  */
120
120
  #symbolRegistry = /* @__PURE__ */ new Map();
121
+ #collectionNames = /* @__PURE__ */ new Map();
121
122
  constructor() {
122
123
  this.router = new Router();
123
124
  this.objectCallbacks = {};
@@ -147,6 +148,8 @@ var FederationBuilderImpl = class {
147
148
  f.objectTypeIds = { ...this.objectTypeIds };
148
149
  f.collectionCallbacks = { ...this.collectionCallbacks };
149
150
  f.collectionTypeIds = { ...this.collectionTypeIds };
151
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
152
+ f.#collectionNames = new Map(this.#collectionNames);
150
153
  f.inboxPath = this.inboxPath;
151
154
  f.outboxPath = this.outboxPath;
152
155
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
@@ -678,6 +681,7 @@ var FederationBuilderImpl = class {
678
681
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
679
682
  assertPath(path);
680
683
  if (Router.variables(path).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
684
+ this.#collectionNames.set(routeName, name);
681
685
  this.router.add(path, routeName);
682
686
  const callbacks = { dispatcher };
683
687
  this.collectionCallbacks[name] = callbacks;
@@ -719,6 +723,10 @@ var FederationBuilderImpl = class {
719
723
  const routeName = this.#uniqueCollectionId(name);
720
724
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
721
725
  }
726
+ /** Resolves a custom collection route to its original name. */
727
+ getCollectionName(routeName) {
728
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
729
+ }
722
730
  setOutboxPermanentFailureHandler(handler) {
723
731
  this.outboxPermanentFailureHandler = handler;
724
732
  }
@@ -9411,10 +9419,10 @@ var FederationImpl = class extends FederationBuilderImpl {
9411
9419
  onNotFound
9412
9420
  });
9413
9421
  case "collection": {
9414
- const name = route.name.replace(/^collection:/, "");
9422
+ const name = this.getCollectionName(route.name);
9415
9423
  const callbacks = this.collectionCallbacks[name];
9416
9424
  return await handleCustomCollection(request, {
9417
- name,
9425
+ name: String(name),
9418
9426
  context,
9419
9427
  values: route.values,
9420
9428
  collectionCallbacks: callbacks,
@@ -9425,10 +9433,10 @@ var FederationImpl = class extends FederationBuilderImpl {
9425
9433
  });
9426
9434
  }
9427
9435
  case "orderedCollection": {
9428
- const name = route.name.replace(/^orderedCollection:/, "");
9436
+ const name = this.getCollectionName(route.name);
9429
9437
  const callbacks = this.collectionCallbacks[name];
9430
9438
  return await handleOrderedCollection(request, {
9431
- name,
9439
+ name: String(name),
9432
9440
  context,
9433
9441
  values: route.values,
9434
9442
  collectionCallbacks: callbacks,
@@ -10194,8 +10202,10 @@ var ContextImpl = class ContextImpl {
10194
10202
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
10195
10203
  const match = route.name.match(collectionRegex);
10196
10204
  if (match !== null) {
10197
- const [, type, name] = match;
10205
+ const [, type] = match;
10206
+ const name = this.federation.getCollectionName(route.name);
10198
10207
  const cls = this.federation.collectionTypeIds[name];
10208
+ if (cls == null) return null;
10199
10209
  return {
10200
10210
  type,
10201
10211
  name,
@@ -10598,7 +10608,7 @@ var ContextImpl = class ContextImpl {
10598
10608
  "inbox"
10599
10609
  ]);
10600
10610
  const contextLoader = options.contextLoader ?? this.contextLoader;
10601
- const json = await activity.toJsonLd({ contextLoader });
10611
+ let json = await activity.toJsonLd({ contextLoader });
10602
10612
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, {
10603
10613
  documentLoader: this.documentLoader,
10604
10614
  contextLoader: this.contextLoader,
@@ -10660,6 +10670,7 @@ var ContextImpl = class ContextImpl {
10660
10670
  }
10661
10671
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
10662
10672
  activity = fetched;
10673
+ json = await fetched.toJsonLd({ contextLoader });
10663
10674
  } else logger.debug("Object Integrity Proofs are verified.", {
10664
10675
  recipient,
10665
10676
  activity: json
@@ -1,5 +1,5 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-BW7-tHAG.mjs";
4
+ import { n as FederationImpl } from "./middleware-C2_LcbL3.mjs";
5
5
  export { FederationImpl };
@@ -3,28 +3,28 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { d as isPortableUri, f as isSameObjectId, i as getPortableDid, l as isPortableId, n as getCanonicalPortableId, o as hasPortableActor, r as getGatewayKeyBase, s as isCompatibleKeyId, t as getAuthenticationOrigin, u as isPortableKeyId } from "./portable-key-id-Ca30-hOa.mjs";
5
5
  import { n as isPubliclyAddressedNode, t as isInAudience } from "./audience-CHQ-FlLD.mjs";
6
- import { n as version, t as name } from "./deno-BKp9fYB3.mjs";
7
- import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-DPQKFkiJ.mjs";
6
+ import { n as version, t as name } from "./deno-Dj1TFhf4.mjs";
7
+ import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-BnYleVpg.mjs";
8
8
  import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
9
- import { c as validateCryptoKey, n as exportJwk, s as importJwk } from "./key-ChfV9C3v.mjs";
9
+ import { c as validateCryptoKey, n as exportJwk, s as importJwk } from "./key-Djyt1BFx.mjs";
10
10
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
11
- import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-DBBVabBC.mjs";
12
- import { a as signObject, c as verifyPortableObjectProof, i as hasProofLike, s as verifyObject, t as InvalidPortableObjectIdError, u as verifyPortableObjectProofWithRoot } from "./proof-MFz2960e.mjs";
13
- import { a as listRequestSignatures, c as selectRequestSignature, d as validateMaxSignatures, f as verifyRequest, p as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http--IGUT1mg.mjs";
14
- import { t as getAuthenticatedDocumentLoader } from "./docloader-BjJreYQU.mjs";
15
- import { n as kvCache } from "./kv-cache-DFIUR-E5.mjs";
11
+ import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-CNVWdooi.mjs";
12
+ import { a as signObject, c as verifyPortableObjectProof, i as hasProofLike, s as verifyObject, t as InvalidPortableObjectIdError, u as verifyPortableObjectProofWithRoot } from "./proof-z6Prgi5I.mjs";
13
+ import { a as listRequestSignatures, c as selectRequestSignature, d as validateMaxSignatures, f as verifyRequest, p as verifyRequestDetailed, s as parseRfc9421SignatureInput } from "./http-D-DpP4sd.mjs";
14
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-CzyJe90o.mjs";
15
+ import { n as kvCache } from "./kv-cache-ecUXfCqW.mjs";
16
16
  import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-CEnNz8O7.mjs";
17
17
  import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
18
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-BW5VsXG3.mjs";
19
- import { t as verifyPortableObject } from "./portable-collection-Ct99JsBe.mjs";
20
- import { a as getOrderingDestination, i as sendActivityThroughGateways, n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-Duj8xys1.mjs";
21
- import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-CKAVFvcH.mjs";
18
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-D_BDPwm2.mjs";
19
+ import { t as verifyPortableObject } from "./portable-collection-hcONGyUs.mjs";
20
+ import { a as getOrderingDestination, i as sendActivityThroughGateways, n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-Cw545L_2.mjs";
21
+ import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-C5rYBZ16.mjs";
22
22
  import { t as CircuitBreaker } from "./circuit-breaker-XJ53md4S.mjs";
23
23
  import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
24
- import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, s as verifyServedPortableObjects, t as containsCompoundPortableObject } from "./compound-proof-BP5SOdXv.mjs";
24
+ import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, s as verifyServedPortableObjects, t as containsCompoundPortableObject } from "./compound-proof-D0xY7MBs.mjs";
25
25
  import { t as KvKeyCache } from "./keycache-Da8A8mZa.mjs";
26
26
  import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
27
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-CVcPKB1N.mjs";
27
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-Cy-8WCod.mjs";
28
28
  import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
29
29
  import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
30
30
  import { getLogger, withContext } from "@logtape/logtape";
@@ -6057,10 +6057,10 @@ var FederationImpl = class extends FederationBuilderImpl {
6057
6057
  onNotFound
6058
6058
  });
6059
6059
  case "collection": {
6060
- const name = route.name.replace(/^collection:/, "");
6060
+ const name = this.getCollectionName(route.name);
6061
6061
  const callbacks = this.collectionCallbacks[name];
6062
6062
  return await handleCustomCollection(request, {
6063
- name,
6063
+ name: String(name),
6064
6064
  context,
6065
6065
  values: route.values,
6066
6066
  collectionCallbacks: callbacks,
@@ -6071,10 +6071,10 @@ var FederationImpl = class extends FederationBuilderImpl {
6071
6071
  });
6072
6072
  }
6073
6073
  case "orderedCollection": {
6074
- const name = route.name.replace(/^orderedCollection:/, "");
6074
+ const name = this.getCollectionName(route.name);
6075
6075
  const callbacks = this.collectionCallbacks[name];
6076
6076
  return await handleOrderedCollection(request, {
6077
- name,
6077
+ name: String(name),
6078
6078
  context,
6079
6079
  values: route.values,
6080
6080
  collectionCallbacks: callbacks,
@@ -6840,8 +6840,10 @@ var ContextImpl = class ContextImpl {
6840
6840
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
6841
6841
  const match = route.name.match(collectionRegex);
6842
6842
  if (match !== null) {
6843
- const [, type, name] = match;
6843
+ const [, type] = match;
6844
+ const name = this.federation.getCollectionName(route.name);
6844
6845
  const cls = this.federation.collectionTypeIds[name];
6846
+ if (cls == null) return null;
6845
6847
  return {
6846
6848
  type,
6847
6849
  name,
@@ -7244,7 +7246,7 @@ var ContextImpl = class ContextImpl {
7244
7246
  "inbox"
7245
7247
  ]);
7246
7248
  const contextLoader = options.contextLoader ?? this.contextLoader;
7247
- const json = await activity.toJsonLd({ contextLoader });
7249
+ let json = await activity.toJsonLd({ contextLoader });
7248
7250
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, {
7249
7251
  documentLoader: this.documentLoader,
7250
7252
  contextLoader: this.contextLoader,
@@ -7306,6 +7308,7 @@ var ContextImpl = class ContextImpl {
7306
7308
  }
7307
7309
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
7308
7310
  activity = fetched;
7311
+ json = await fetched.toJsonLd({ contextLoader });
7309
7312
  } else logger.debug("Object Integrity Proofs are verified.", {
7310
7313
  recipient,
7311
7314
  activity: json
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-DGx0KOws.js";
3
- import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.js";
3
+ import { n as KvStore, t as KvKey } from "./kv-B2mzK5tl.js";
4
4
  import { t as DocumentFetchKind } from "./metrics-DoRtI0qU.js";
5
5
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
6
6
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-DMd11IAu.js";
2
+ import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-CtI307_A.js";
3
3
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
4
4
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
5
5
 
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-Bl_Y7T_3.cjs";
2
+ import { Jt as WebFingerLinksDispatcher, St as ActorHandleMapper, bt as ActorAliasMapper, p as RequestContext, xt as ActorDispatcher } from "./context-B6X-t8gI.cjs";
3
3
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
4
4
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
5
5
 
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-BrwKINQn.cjs";
3
- import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.cjs";
3
+ import { n as KvStore, t as KvKey } from "./kv-B2mzK5tl.cjs";
4
4
  import { t as DocumentFetchKind } from "./metrics-DVKYY6K1.cjs";
5
5
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
6
6
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";