@fedify/fedify 2.4.0-dev.2099 → 2.4.0-dev.2108

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 (84) hide show
  1. package/dist/{builder-Bno54o_-.mjs → builder-BRlYEsrV.mjs} +28 -4
  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-X3SxXVbc.mjs → compound-proof-CHGINiJg.mjs} +2 -2
  6. package/dist/{context-MORIQJIh.d.ts → context-B4F4kGJq.d.ts} +165 -21
  7. package/dist/{context-DlZhxdFT.mjs → context-CoNRxGYp.mjs} +2 -1
  8. package/dist/{context-C43spTGI.d.cts → context-Cqx9M_zO.d.cts} +165 -21
  9. package/dist/{deno-dxdvl2XZ.mjs → deno-CC4RKEEp.mjs} +1 -1
  10. package/dist/{docloader-eBxQDsk9.mjs → docloader-D3_m98fe.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +1 -1
  12. package/dist/federation/compound-fanout.test.mjs +3 -3
  13. package/dist/federation/handler-compound-proof.test.mjs +4 -4
  14. package/dist/federation/handler.test.mjs +119 -6
  15. package/dist/federation/hashlink-media.test.mjs +2 -2
  16. package/dist/federation/idempotency.test.mjs +2 -2
  17. package/dist/federation/metrics.test.mjs +1 -1
  18. package/dist/federation/middleware.test.mjs +185 -8
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +3 -3
  21. package/dist/federation/mod.d.ts +3 -3
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/outgoing-proof.test.mjs +5 -5
  24. package/dist/federation/portable-actor.test.d.mts +2 -0
  25. package/dist/federation/portable-actor.test.mjs +446 -0
  26. package/dist/federation/portable-gateway-keys.test.mjs +4 -4
  27. package/dist/federation/portable-inbox.test.mjs +25 -4
  28. package/dist/federation/portable.test.mjs +31 -4
  29. package/dist/federation/send.test.mjs +3 -3
  30. package/dist/federation/tasks/enqueue.test.mjs +2 -2
  31. package/dist/federation/tasks/tasks.test.mjs +3 -3
  32. package/dist/federation/temporal.test.mjs +1 -1
  33. package/dist/federation/webfinger.test.mjs +2 -2
  34. package/dist/{federation-C4Ef3JKa.cjs → federation-dqo6ZzgT.cjs} +115 -23
  35. package/dist/{http-C8cZTE3Y.cjs → http-B7wEqv49.cjs} +1 -1
  36. package/dist/{http-DsgawTd8.mjs → http-CHEYA5fH.mjs} +4 -4
  37. package/dist/{http-D-rbr_Sy.js → http-CaUBCHYJ.js} +1 -1
  38. package/dist/{key-DYfmjnmp.mjs → key-B8u1vdvF.mjs} +2 -2
  39. package/dist/{kv-cache-Dvd-Q-E2.cjs → kv-cache-0pYMPrkL.cjs} +1 -1
  40. package/dist/{kv-cache-EvOgrFsS.mjs → kv-cache-CTdvf_Iq.mjs} +1 -1
  41. package/dist/{kv-cache-DIxwMeNi.js → kv-cache-ibncHN1D.js} +1 -1
  42. package/dist/{ld-B00wWHzc.mjs → ld-BTMJHEGV.mjs} +3 -3
  43. package/dist/{metrics-BP3vdBpb.mjs → metrics-CF1TEvdS.mjs} +1 -1
  44. package/dist/{middleware-Br1_d-Ga.mjs → middleware-B-rZ7oE-.mjs} +91 -23
  45. package/dist/{middleware-CeBVBa61.mjs → middleware-DCMTJT3_.mjs} +1 -1
  46. package/dist/{middleware-CcXMe400.js → middleware-Dl-Y_ZlC.js} +107 -15
  47. package/dist/{mod-BL5BQHCq.d.ts → mod-4s_XgF17.d.ts} +1 -1
  48. package/dist/{mod-DMI4DbOo.d.cts → mod-BuFmStNT.d.cts} +1 -1
  49. package/dist/mod.cjs +5 -5
  50. package/dist/mod.d.cts +4 -4
  51. package/dist/mod.d.ts +4 -4
  52. package/dist/mod.js +5 -5
  53. package/dist/nodeinfo/handler.test.mjs +2 -2
  54. package/dist/{owner-DSzH7wro.cjs → owner-CGnHPl4k.cjs} +1 -1
  55. package/dist/{owner-BJPDRDRq.mjs → owner-CY--JSqO.mjs} +3 -3
  56. package/dist/{owner-U12fDpQW.js → owner-M8dOKEl6.js} +1 -1
  57. package/dist/{portable-key-D0mWbV9G.mjs → portable-key-C0-ghkgM.mjs} +1 -1
  58. package/dist/{proof-ChjBwnep.mjs → proof-DDw0i9b1.mjs} +4 -4
  59. package/dist/{send-yFX0E-ye.mjs → send-CU3sHGPt.mjs} +3 -3
  60. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  61. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  62. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  63. package/dist/sig/compound-proof.test.mjs +2 -2
  64. package/dist/sig/http.test.mjs +2 -2
  65. package/dist/sig/key.test.mjs +1 -1
  66. package/dist/sig/ld.test.mjs +2 -2
  67. package/dist/sig/mod.cjs +3 -3
  68. package/dist/sig/mod.js +3 -3
  69. package/dist/sig/owner.test.mjs +1 -1
  70. package/dist/sig/portable-collection.test.mjs +2 -2
  71. package/dist/sig/portable-key.test.mjs +3 -3
  72. package/dist/sig/proof.test.mjs +3 -3
  73. package/dist/{sig-B689Nj7y.cjs → sig-C2CORtvg.cjs} +2 -2
  74. package/dist/{sig-C85KqAcx.js → sig-fycq7sOr.js} +2 -2
  75. package/dist/{temporal-Dl9x-Qw4.mjs → temporal-NHiSpGcW.mjs} +1 -1
  76. package/dist/testing/kv.test.mjs +1 -1
  77. package/dist/testing/mod.d.mts +164 -20
  78. package/dist/testing/mod.mjs +2 -2
  79. package/dist/{testing-CO_cEvQc.mjs → testing-BWq1dCzx.mjs} +1 -1
  80. package/dist/utils/docloader.test.mjs +2 -2
  81. package/dist/utils/kv-cache.test.mjs +1 -1
  82. package/dist/utils/mod.cjs +1 -1
  83. package/dist/utils/mod.js +1 -1
  84. package/package.json +6 -6
@@ -11,8 +11,8 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
11
11
  import "../std__assert-DvMDRPes.mjs";
12
12
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
13
13
  import { t as assert } from "../assert-D1Eafmd_.mjs";
14
- import { t as exportJwk } from "../key-DYfmjnmp.mjs";
15
- import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-DsgawTd8.mjs";
14
+ import { t as exportJwk } from "../key-B8u1vdvF.mjs";
15
+ import { a as listRequestSignatures, c as selectRequestSignature, d as verifyRequest, f as verifyRequestDetailed, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-CHEYA5fH.mjs";
16
16
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
17
17
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
18
18
  import { FetchError, exportSpki } from "@fedify/vocab-runtime";
@@ -6,7 +6,7 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-DYfmjnmp.mjs";
9
+ import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-B8u1vdvF.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
11
11
  import { CryptographicKey, Multikey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -8,8 +8,8 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
9
9
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { a as generateCryptoKeyPair } from "../key-DYfmjnmp.mjs";
12
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-B00wWHzc.mjs";
11
+ import { a as generateCryptoKeyPair } from "../key-B8u1vdvF.mjs";
12
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-BTMJHEGV.mjs";
13
13
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
14
14
  import { CryptographicKey } from "@fedify/vocab";
15
15
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
package/dist/sig/mod.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_http = require("../http-C8cZTE3Y.cjs");
4
- const require_owner = require("../owner-DSzH7wro.cjs");
5
- const require_sig = require("../sig-B689Nj7y.cjs");
3
+ const require_http = require("../http-B7wEqv49.cjs");
4
+ const require_owner = require("../owner-CGnHPl4k.cjs");
5
+ const require_sig = require("../sig-C2CORtvg.cjs");
6
6
  exports.attachSignature = require_http.attachSignature;
7
7
  exports.createProof = require_http.createProof;
8
8
  exports.createSignature = require_http.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { B as generateCryptoKeyPair, I as exportJwk, N as verifyJsonLd, O as hasSignatureLike, P as verifySignature, R as fetchKey, S as attachSignature, T as detachSignature, V as importJwk, a as signRequest, ct as formatAcceptSignature, d as hasProofLike, dt as validateAcceptSignature, f as signObject, h as verifyPortableObjectProof, j as signJsonLd, lt as fulfillAcceptSignature, m as verifyObject, o as verifyRequest, s as verifyRequestDetailed, u as createProof, ut as parseAcceptSignature, v as verifyProof, w as createSignature, z as fetchKeyDetailed } from "../http-D-rbr_Sy.js";
4
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-U12fDpQW.js";
5
- import { t as verifyPortableObject } from "../sig-C85KqAcx.js";
3
+ import { B as generateCryptoKeyPair, I as exportJwk, N as verifyJsonLd, O as hasSignatureLike, P as verifySignature, R as fetchKey, S as attachSignature, T as detachSignature, V as importJwk, a as signRequest, ct as formatAcceptSignature, d as hasProofLike, dt as validateAcceptSignature, f as signObject, h as verifyPortableObjectProof, j as signJsonLd, lt as fulfillAcceptSignature, m as verifyObject, o as verifyRequest, s as verifyRequestDetailed, u as createProof, ut as parseAcceptSignature, v as verifyProof, w as createSignature, z as fetchKeyDetailed } from "../http-CaUBCHYJ.js";
4
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-M8dOKEl6.js";
5
+ import { t as verifyPortableObject } from "../sig-fycq7sOr.js";
6
6
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BJPDRDRq.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CY--JSqO.mjs";
10
10
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
11
11
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region src/sig/owner.test.ts
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "../deno-dxdvl2XZ.mjs";
5
- import { l as verifyPortableObjectProofWithRoot, s as verifyPortableObjectProof } from "../proof-ChjBwnep.mjs";
4
+ import { n as version, t as name } from "../deno-CC4RKEEp.mjs";
5
+ import { l as verifyPortableObjectProofWithRoot, s as verifyPortableObjectProof } from "../proof-DDw0i9b1.mjs";
6
6
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { Collection, CollectionPage, Note, Object as Object$1, OrderedCollection, Person, isActor, traverseCollection } from "@fedify/vocab";
@@ -1,10 +1,10 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { r as fetchKey } from "../key-DYfmjnmp.mjs";
5
- import { d as verifyRequest, l as signRequest } from "../http-DsgawTd8.mjs";
4
+ import { r as fetchKey } from "../key-B8u1vdvF.mjs";
5
+ import { d as verifyRequest, l as signRequest } from "../http-CHEYA5fH.mjs";
6
6
  import { c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
7
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BJPDRDRq.mjs";
7
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CY--JSqO.mjs";
8
8
  import { Create, CryptographicKey, Multikey, Person } from "@fedify/vocab";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { FetchError, encodeMultibase, exportDidKey, exportSpki, parseIri, preloadedContexts } from "@fedify/vocab-runtime";
@@ -10,10 +10,10 @@ import "../std__assert-DvMDRPes.mjs";
10
10
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
13
- import { i as signObject, n as createProof, o as verifyObject, r as hasProofLike, s as verifyPortableObjectProof, u as verifyProof } from "../proof-ChjBwnep.mjs";
14
- import { d as verifyRequest } from "../http-DsgawTd8.mjs";
13
+ import { i as signObject, n as createProof, o as verifyObject, r as hasProofLike, s as verifyPortableObjectProof, u as verifyProof } from "../proof-DDw0i9b1.mjs";
14
+ import { d as verifyRequest } from "../http-CHEYA5fH.mjs";
15
15
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
16
- import { t as getAuthenticatedDocumentLoader } from "../docloader-eBxQDsk9.mjs";
16
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-D3_m98fe.mjs";
17
17
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
18
18
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
19
19
  import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
@@ -1,6 +1,6 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
- const require_http = require("./http-C8cZTE3Y.cjs");
3
- require("./owner-DSzH7wro.cjs");
2
+ const require_http = require("./http-B7wEqv49.cjs");
3
+ require("./owner-CGnHPl4k.cjs");
4
4
  let _logtape_logtape = require("@logtape/logtape");
5
5
  let _fedify_vocab = require("@fedify/vocab");
6
6
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { _ as verifyPortableObjectProofWithRoot, bt as name, h as verifyPortableObjectProof, xt as version } from "./http-D-rbr_Sy.js";
4
- import "./owner-U12fDpQW.js";
3
+ import { _ as verifyPortableObjectProofWithRoot, bt as name, h as verifyPortableObjectProof, xt as version } from "./http-CaUBCHYJ.js";
4
+ import "./owner-M8dOKEl6.js";
5
5
  import { getLogger } from "@logtape/logtape";
6
6
  import { CollectionPage, Object as Object$1, isActor } from "@fedify/vocab";
7
7
  import { trace } from "@opentelemetry/api";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-B00wWHzc.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-BTMJHEGV.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
7
7
  import { n as baseOptions, o as stringSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
8
8
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
9
- import { o as createFederation } from "../middleware-Br1_d-Ga.mjs";
9
+ import { o as createFederation } from "../middleware-B-rZ7oE-.mjs";
10
10
  //#region src/testing/kv.test.ts
11
11
  test("ManualClockKvStore keeps an entry at its exact expiration instant", async () => {
12
12
  const kv = new ManualClockKvStore();
@@ -387,14 +387,18 @@ type ActorAliasMapper<TContextData> = (context: RequestContext<TContextData>, re
387
387
  username: string;
388
388
  } | null>;
389
389
  /**
390
- * A callback that dispatches an object.
390
+ * A callback that dispatches an object or a {@link Tombstone}.
391
+ *
392
+ * Return a {@link Tombstone} if the object has been deleted; Fedify then
393
+ * responds with `410 Gone` and the serialized tombstone. Return `null` if
394
+ * the object is not found.
391
395
  *
392
396
  * @template TContextData The context data to pass to the {@link Context}.
393
397
  * @template TObject The type of object to dispatch.
394
398
  * @template TParam The parameter names of the requested URL.
395
399
  * @since 0.7.0
396
400
  */
397
- type ObjectDispatcher<TContextData, TObject extends Object$1, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => TObject | null | Promise<TObject | null>;
401
+ type ObjectDispatcher<TContextData, TObject extends Object$1, TParam extends string> = (context: RequestContext<TContextData>, values: Record<TParam, string>) => TObject | Tombstone | null | Promise<TObject | Tombstone | null>;
398
402
  /**
399
403
  * A callback that dispatches a collection.
400
404
  *
@@ -1525,7 +1529,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1525
1529
  * based on URI Template
1526
1530
  * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1527
1531
  * must have one or more variables.
1528
- * @param dispatcher An object dispatcher callback to register.
1532
+ * @param dispatcher An object dispatcher callback to register. It may
1533
+ * return an object, a `Tombstone` if the object has been
1534
+ * deleted, or `null` if the object is not found.
1529
1535
  */
1530
1536
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
1531
1537
  /**
@@ -1539,7 +1545,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1539
1545
  * based on URI Template
1540
1546
  * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1541
1547
  * must have one or more variables.
1542
- * @param dispatcher An object dispatcher callback to register.
1548
+ * @param dispatcher An object dispatcher callback to register. It may
1549
+ * return an object, a `Tombstone` if the object has been
1550
+ * deleted, or `null` if the object is not found.
1543
1551
  */
1544
1552
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
1545
1553
  /**
@@ -1553,7 +1561,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1553
1561
  * based on URI Template
1554
1562
  * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1555
1563
  * must have one or more variables.
1556
- * @param dispatcher An object dispatcher callback to register.
1564
+ * @param dispatcher An object dispatcher callback to register. It may
1565
+ * return an object, a `Tombstone` if the object has been
1566
+ * deleted, or `null` if the object is not found.
1557
1567
  */
1558
1568
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
1559
1569
  /**
@@ -1567,7 +1577,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1567
1577
  * based on URI Template
1568
1578
  * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1569
1579
  * must have one or more variables.
1570
- * @param dispatcher An object dispatcher callback to register.
1580
+ * @param dispatcher An object dispatcher callback to register. It may
1581
+ * return an object, a `Tombstone` if the object has been
1582
+ * deleted, or `null` if the object is not found.
1571
1583
  */
1572
1584
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
1573
1585
  /**
@@ -1581,7 +1593,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1581
1593
  * based on URI Template
1582
1594
  * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1583
1595
  * must have one or more variables.
1584
- * @param dispatcher An object dispatcher callback to register.
1596
+ * @param dispatcher An object dispatcher callback to register. It may
1597
+ * return an object, a `Tombstone` if the object has been
1598
+ * deleted, or `null` if the object is not found.
1585
1599
  */
1586
1600
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
1587
1601
  /**
@@ -1595,7 +1609,9 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1595
1609
  * based on URI Template
1596
1610
  * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1597
1611
  * must have one or more variables.
1598
- * @param dispatcher An object dispatcher callback to register.
1612
+ * @param dispatcher An object dispatcher callback to register. It may
1613
+ * return an object, a `Tombstone` if the object has been
1614
+ * deleted, or `null` if the object is not found.
1599
1615
  */
1600
1616
  setObjectDispatcher<TObject extends Object$1, TParam extends string>(cls: ConstructorWithTypeId<TObject>, path: `${string}${Rfc6570Expression<TParam>}${string}`, dispatcher: ObjectDispatcher<TContextData, TObject, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>;
1601
1617
  /**
@@ -2893,6 +2909,37 @@ interface Context<TContextData> {
2893
2909
  * @throws {RouterError} If no actor dispatcher is available.
2894
2910
  */
2895
2911
  getActorUri(identifier: string): URL;
2912
+ /**
2913
+ * Builds the [FEP-ef61] portable ID of an actor with the given identifier
2914
+ * under the given DID authority.
2915
+ *
2916
+ * The path is the same as the one {@link Context.getActorUri} builds, but
2917
+ * the result is an `ap+ef61:` URI whose authority is the DID, e.g.,
2918
+ * `ap+ef61://did:key:z6Mk.../users/alice`. Such an actor can be served
2919
+ * through the FEP-ef61 gateway endpoint,
2920
+ * `/.well-known/apgateway/did:key:z6Mk.../users/alice`, by the same actor
2921
+ * dispatcher.
2922
+ *
2923
+ * The returned `URL` keeps the DID authority percent-encoded, because
2924
+ * the `URL` class cannot represent the canonical form. Use `formatIri()`
2925
+ * from `@fedify/vocab-runtime` to get the canonical string, e.g.,
2926
+ * `ap+ef61://did:key:z6Mk.../users/alice`.
2927
+ *
2928
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2929
+ *
2930
+ * @param identifier The actor's identifier.
2931
+ * @param authority The DID that controls the actor, e.g.,
2932
+ * `did:key:z6Mk...`. It must be a bare DID, without
2933
+ * a path, query, or fragment. A `did:key` DID must be
2934
+ * encoded in base58-btc, as FEP-ef61 requires; see
2935
+ * `exportDidKey()` from `@fedify/vocab-runtime`.
2936
+ * @returns The actor's portable ID.
2937
+ * @throws {RouterError} If no actor dispatcher is available.
2938
+ * @throws {TypeError} If the authority is not a DID, or it is a `did:key`
2939
+ * DID that is not encoded in base58-btc.
2940
+ * @since 2.4.0
2941
+ */
2942
+ getPortableActorUri(identifier: string, authority: string): URL;
2896
2943
  /**
2897
2944
  * Builds the URI of an object with the given class and values.
2898
2945
  * @param cls The class of the object.
@@ -2928,7 +2975,9 @@ interface Context<TContextData> {
2928
2975
  * a path, query, or fragment.
2929
2976
  * @returns The object's portable ID.
2930
2977
  * @throws {RouterError} If no object dispatcher is available for the class.
2931
- * @throws {TypeError} If values are invalid or the authority is not a DID.
2978
+ * @throws {TypeError} If values are invalid, or the authority is not a DID
2979
+ * or is a `did:key` DID that is not encoded in
2980
+ * base58-btc.
2932
2981
  * @since 2.4.0
2933
2982
  */
2934
2983
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
@@ -2957,7 +3006,8 @@ interface Context<TContextData> {
2957
3006
  * a path, query, or fragment.
2958
3007
  * @returns The inbox's portable ID.
2959
3008
  * @throws {RouterError} If no inbox path is registered.
2960
- * @throws {TypeError} If the authority is not a DID.
3009
+ * @throws {TypeError} If the authority is not a DID, or it is a `did:key`
3010
+ * DID that is not encoded in base58-btc.
2961
3011
  * @since 2.4.0
2962
3012
  */
2963
3013
  getPortableInboxUri(identifier: string, authority: string): URL;
@@ -3323,6 +3373,23 @@ interface GetActorOptions {
3323
3373
  */
3324
3374
  readonly tombstone?: "suppress" | "passthrough";
3325
3375
  }
3376
+ /**
3377
+ * Options for {@link RequestContext.getObject}.
3378
+ * @since 2.4.0
3379
+ */
3380
+ interface GetObjectOptions {
3381
+ /**
3382
+ * Controls how tombstoned objects are returned.
3383
+ *
3384
+ * By default, or if set to `"suppress"`, a {@link Tombstone} is returned as
3385
+ * `null`, unless it is an instance of the requested class, e.g., when
3386
+ * the requested class is `Object` or `Tombstone` itself. In that case,
3387
+ * the tombstone is returned as is, as it is an object of the requested
3388
+ * class. Set this to `"passthrough"` to always receive a {@link Tombstone}
3389
+ * result instead of `null`.
3390
+ */
3391
+ readonly tombstone?: "suppress" | "passthrough";
3392
+ }
3326
3393
  /**
3327
3394
  * A context for a request.
3328
3395
  */
@@ -3338,12 +3405,13 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3338
3405
  /**
3339
3406
  * Information about the [FEP-ef61] portable object requested through
3340
3407
  * the gateway endpoint, e.g.,
3341
- * `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`. It is
3342
- * `undefined` for ordinary requests.
3408
+ * `GET /.well-known/apgateway/did:key:z6Mk.../notes/123`, which is served
3409
+ * by an object dispatcher or the actor dispatcher. It is `undefined` for
3410
+ * ordinary requests.
3343
3411
  *
3344
3412
  * The authority comes from the request path, so it is not evidence that
3345
- * this server hosts objects for the DID. An object dispatcher has to check
3346
- * that by itself.
3413
+ * this server hosts objects for the DID. An object dispatcher or the actor
3414
+ * dispatcher has to check that by itself.
3347
3415
  *
3348
3416
  * It describes the incoming request, so it stays the same in contexts
3349
3417
  * derived from this one, e.g., by {@link RequestContext.getObject}.
@@ -3352,6 +3420,31 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3352
3420
  * @since 2.4.0
3353
3421
  */
3354
3422
  readonly portableRequest?: PortableRequest;
3423
+ /**
3424
+ * Builds the [FEP-ef61] portable ID of an actor with the given identifier.
3425
+ * It works the same as {@link Context.getPortableActorUri}, except that
3426
+ * the authority can be omitted while handling a portable gateway request.
3427
+ * In that case, the DID in {@link RequestContext.portableRequest} is used.
3428
+ *
3429
+ * The DID in the request comes from the request path, so the default is
3430
+ * only a convenience for building IDs; it is not evidence that this server
3431
+ * hosts the actor for the DID.
3432
+ *
3433
+ * [FEP-ef61]: https://w3id.org/fep/ef61
3434
+ *
3435
+ * @param identifier The actor's identifier.
3436
+ * @param authority The DID that controls the actor, e.g.,
3437
+ * `did:key:z6Mk...`. It must be a bare DID, without
3438
+ * a path, query, or fragment. Defaults to the DID of
3439
+ * the requested portable object.
3440
+ * @returns The actor's portable ID.
3441
+ * @throws {RouterError} If no actor dispatcher is available.
3442
+ * @throws {TypeError} If the authority is not a DID, it is a `did:key` DID
3443
+ * that is not encoded in base58-btc, or the authority
3444
+ * is omitted outside a portable gateway request.
3445
+ * @since 2.4.0
3446
+ */
3447
+ getPortableActorUri(identifier: string, authority?: string): URL;
3355
3448
  /**
3356
3449
  * Builds the [FEP-ef61] portable ID of an object with the given class and
3357
3450
  * values. It works the same as {@link Context.getPortableObjectUri}, except
@@ -3369,9 +3462,10 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3369
3462
  * the requested portable object.
3370
3463
  * @returns The object's portable ID.
3371
3464
  * @throws {RouterError} If no object dispatcher is available for the class.
3372
- * @throws {TypeError} If values are invalid, the authority is not a DID, or
3373
- * the authority is omitted outside a portable gateway
3374
- * request.
3465
+ * @throws {TypeError} If values are invalid, the authority is not a DID,
3466
+ * it is a `did:key` DID that is not encoded in
3467
+ * base58-btc, or the authority is omitted outside
3468
+ * a portable gateway request.
3375
3469
  * @since 2.4.0
3376
3470
  */
3377
3471
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
@@ -3393,8 +3487,9 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3393
3487
  * the requested portable object, if any.
3394
3488
  * @returns The inbox's portable ID.
3395
3489
  * @throws {RouterError} If no inbox path is registered.
3396
- * @throws {TypeError} If the authority is not a DID, or the authority is
3397
- * omitted outside a portable gateway request.
3490
+ * @throws {TypeError} If the authority is not a DID, it is a `did:key` DID
3491
+ * that is not encoded in base58-btc, or the authority
3492
+ * is omitted outside a portable gateway request.
3398
3493
  * @since 2.4.0
3399
3494
  */
3400
3495
  getPortableInboxUri(identifier: string, authority?: string): URL;
@@ -3460,12 +3555,61 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3460
3555
  * @param cls The class to instantiate.
3461
3556
  * @param values The values to pass to the object dispatcher.
3462
3557
  * @returns The object of the given class with the given values, or `null`
3463
- * if the object is not found.
3558
+ * if the object is not found. Tombstoned objects are suppressed
3559
+ * unless the tombstone is an instance of `cls`.
3464
3560
  * @throws {Error} If no object dispatcher is available for the class.
3465
3561
  * @throws {TypeError} If values are invalid.
3466
3562
  * @since 0.7.0
3467
3563
  */
3468
3564
  getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>): Promise<TObject | null>;
3565
+ /**
3566
+ * Gets an object of the given class, or a {@link Tombstone}, with the given
3567
+ * values.
3568
+ * @param cls The class to instantiate.
3569
+ * @param values The values to pass to the object dispatcher.
3570
+ * @param options Options for getting the object. Set `options.tombstone`
3571
+ * to `"passthrough"` to receive tombstoned objects instead
3572
+ * of `null`.
3573
+ * @returns The object of the given class with the given values,
3574
+ * a tombstone, or `null` if the object is not found.
3575
+ * @throws {Error} If no object dispatcher is available for the class.
3576
+ * @throws {TypeError} If values are invalid.
3577
+ * @since 2.4.0
3578
+ */
3579
+ getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, options: GetObjectOptions & {
3580
+ readonly tombstone: "passthrough";
3581
+ }): Promise<TObject | Tombstone | null>;
3582
+ /**
3583
+ * Gets an object of the given class with the given values.
3584
+ * @param cls The class to instantiate.
3585
+ * @param values The values to pass to the object dispatcher.
3586
+ * @param options Options for getting the object.
3587
+ * @returns The object of the given class with the given values, or `null`
3588
+ * if the object is not found. Tombstoned objects are suppressed
3589
+ * unless `options.tombstone` is `"passthrough"` or the tombstone
3590
+ * is an instance of `cls`.
3591
+ * @throws {Error} If no object dispatcher is available for the class.
3592
+ * @throws {TypeError} If values are invalid.
3593
+ * @since 2.4.0
3594
+ */
3595
+ getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, options: GetObjectOptions & {
3596
+ readonly tombstone?: "suppress" | undefined;
3597
+ }): Promise<TObject | null>;
3598
+ /**
3599
+ * Gets an object of the given class, or a {@link Tombstone}, with the given
3600
+ * values.
3601
+ * @param cls The class to instantiate.
3602
+ * @param values The values to pass to the object dispatcher.
3603
+ * @param options Options for getting the object.
3604
+ * @returns The object of the given class with the given values,
3605
+ * a tombstone, or `null` if the object is not found. This broad
3606
+ * overload is used when the caller passes an options value whose
3607
+ * `tombstone` mode is not known statically.
3608
+ * @throws {Error} If no object dispatcher is available for the class.
3609
+ * @throws {TypeError} If values are invalid.
3610
+ * @since 2.4.0
3611
+ */
3612
+ getObject<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, options: GetObjectOptions): Promise<TObject | Tombstone | null>;
3469
3613
  /**
3470
3614
  * Gets the public key of the sender, if any exists and it is verified.
3471
3615
  * Otherwise, `null` is returned.
@@ -2,8 +2,8 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { r as testDefinitions } from "../dist-BQvArojP.mjs";
5
- import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DlZhxdFT.mjs";
5
+ import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-CoNRxGYp.mjs";
6
6
  import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
7
7
  import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
8
- import "../testing-CO_cEvQc.mjs";
8
+ import "../testing-BWq1dCzx.mjs";
9
9
  export { ManualClockKvStore, MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
@@ -2,7 +2,7 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import "./dist-BQvArojP.mjs";
5
- import "./context-DlZhxdFT.mjs";
5
+ import "./context-CoNRxGYp.mjs";
6
6
  import "./kv-DBRWVx3Q.mjs";
7
7
  import "./tasks-dbCShlCb.mjs";
8
8
  export {};
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
- import { d as verifyRequest } from "../http-DsgawTd8.mjs";
8
+ import { d as verifyRequest } from "../http-CHEYA5fH.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-eBxQDsk9.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-D3_m98fe.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-EvOgrFsS.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-CTdvf_Iq.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_kv_cache = require("../kv-cache-Dvd-Q-E2.cjs");
3
+ const require_kv_cache = require("../kv-cache-0pYMPrkL.cjs");
4
4
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
5
5
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DIxwMeNi.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-ibncHN1D.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.4.0-dev.2099+cd074fe2",
3
+ "version": "2.4.0-dev.2108+159ea471",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -151,10 +151,10 @@
151
151
  "structured-field-values": "^2.0.4",
152
152
  "temporal-polyfill": "^1.0.1",
153
153
  "urlpattern-polyfill": "^10.1.0",
154
- "@fedify/uri-template": "2.4.0-dev.2099+cd074fe2",
155
- "@fedify/vocab": "2.4.0-dev.2099+cd074fe2",
156
- "@fedify/vocab-runtime": "2.4.0-dev.2099+cd074fe2",
157
- "@fedify/webfinger": "2.4.0-dev.2099+cd074fe2"
154
+ "@fedify/uri-template": "2.4.0-dev.2108+159ea471",
155
+ "@fedify/vocab-runtime": "2.4.0-dev.2108+159ea471",
156
+ "@fedify/vocab": "2.4.0-dev.2108+159ea471",
157
+ "@fedify/webfinger": "2.4.0-dev.2108+159ea471"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -167,7 +167,7 @@
167
167
  "typescript": "^6.0.0",
168
168
  "wrangler": "^4.17.0",
169
169
  "@fedify/fixture": "2.0.0",
170
- "@fedify/vocab-tools": "^2.4.0-dev.2099+cd074fe2"
170
+ "@fedify/vocab-tools": "^2.4.0-dev.2108+159ea471"
171
171
  },
172
172
  "scripts": {
173
173
  "build:self": "tsdown",