@fedify/fedify 2.4.0-dev.2054 → 2.4.0-dev.2056

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 (75) hide show
  1. package/dist/{builder-C86Z3BKs.mjs → builder-D_XU_Fw2.mjs} +8 -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-BcZqTCwy.mjs → compound-proof-CwTySDnn.mjs} +1 -1
  6. package/dist/{context-BJPHhBmD.d.ts → context-D_gg4M0n.d.ts} +102 -1
  7. package/dist/{context-Bh_mJfbD.d.cts → context-b36TpPoG.d.cts} +102 -1
  8. package/dist/{deno-Bz6KTcon.mjs → deno-BtpLWN2L.mjs} +1 -1
  9. package/dist/{docloader-DS54zLD1.mjs → docloader-CJADEtqb.mjs} +2 -2
  10. package/dist/federation/builder.test.mjs +1 -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.d.mts +2 -0
  15. package/dist/federation/hashlink-media.test.mjs +422 -0
  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 +7 -7
  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.test.mjs +3 -3
  25. package/dist/federation/router.test.mjs +2 -152
  26. package/dist/federation/send.test.mjs +3 -3
  27. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  28. package/dist/federation/tasks/tasks.test.mjs +2 -2
  29. package/dist/federation/temporal.test.mjs +1 -1
  30. package/dist/federation/webfinger.test.mjs +1 -1
  31. package/dist/{federation-su1OEWsM.cjs → federation-DDwszIrk.cjs} +139 -21
  32. package/dist/{http-Ty805y3A.mjs → http-CotELN-4.mjs} +3 -3
  33. package/dist/{http-LmUsMjK_.cjs → http-DW5mt8FG.cjs} +1 -1
  34. package/dist/{http-C3WGK1dL.js → http-iLCx9vk-.js} +1 -1
  35. package/dist/{key-BMc-2eW0.mjs → key-DrCNkH3Y.mjs} +2 -2
  36. package/dist/{kv-cache-CuaZnk6r.cjs → kv-cache-LOyq_Ty6.cjs} +1 -1
  37. package/dist/{kv-cache-BhPPtHg7.mjs → kv-cache-a1ghEA4h.mjs} +1 -1
  38. package/dist/{kv-cache-BcHCmrC8.js → kv-cache-bXLDSaRu.js} +1 -1
  39. package/dist/{ld-OpXWt-80.mjs → ld-BPG92sC0.mjs} +3 -3
  40. package/dist/{metrics-CTAe8lYz.mjs → metrics-DxVi0UJD.mjs} +1 -1
  41. package/dist/{middleware-_CMav1o7.js → middleware-1nes8_U-.js} +140 -22
  42. package/dist/{middleware-C-JLcqy7.mjs → middleware-BIPftTly.mjs} +1 -1
  43. package/dist/{middleware-BtwW3G41.mjs → middleware-DohUu-Tz.mjs} +145 -33
  44. package/dist/{mod-DU8aVzQJ.d.cts → mod-Bfenkg_c.d.cts} +1 -1
  45. package/dist/{mod-BofpDIcU.d.ts → mod-BhMvsgdF.d.ts} +1 -1
  46. package/dist/mod.cjs +4 -4
  47. package/dist/mod.d.cts +4 -4
  48. package/dist/mod.d.ts +4 -4
  49. package/dist/mod.js +4 -4
  50. package/dist/nodeinfo/handler.test.mjs +1 -1
  51. package/dist/{owner-RxB_eQpU.mjs → owner-BN7Mqjso.mjs} +2 -2
  52. package/dist/{owner-Bcm4pLXw.cjs → owner-C2ER4VD7.cjs} +1 -1
  53. package/dist/{owner-B-TLr-1I.js → owner-SBgt2USF.js} +1 -1
  54. package/dist/{proof-CVf2XbEa.mjs → proof-BigVZwkl.mjs} +4 -4
  55. package/dist/router-u5O5KCQr.mjs +156 -0
  56. package/dist/{send-DF9KzhJH.mjs → send-CvatEhyY.mjs} +3 -3
  57. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  58. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  59. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  60. package/dist/sig/compound-proof.test.mjs +2 -2
  61. package/dist/sig/http.test.mjs +2 -2
  62. package/dist/sig/key.test.mjs +1 -1
  63. package/dist/sig/ld.test.mjs +2 -2
  64. package/dist/sig/mod.cjs +2 -2
  65. package/dist/sig/mod.js +2 -2
  66. package/dist/sig/owner.test.mjs +1 -1
  67. package/dist/sig/proof.test.mjs +3 -3
  68. package/dist/{temporal-B6U3fEUW.mjs → temporal-DV5jeBbR.mjs} +1 -1
  69. package/dist/testing/kv.test.mjs +1 -1
  70. package/dist/testing/mod.d.mts +101 -0
  71. package/dist/utils/docloader.test.mjs +2 -2
  72. package/dist/utils/kv-cache.test.mjs +1 -1
  73. package/dist/utils/mod.cjs +1 -1
  74. package/dist/utils/mod.js +1 -1
  75. package/package.json +6 -6
package/dist/mod.d.ts CHANGED
@@ -2,17 +2,17 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-D-XP_Ccb.js";
3
3
  import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-65PYi9jY.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-BSzr5-I8.js";
5
- import { $ as MessageQueue, A as ObjectCallbackSetters, At as NodeInfoDispatcher, B as TaskDefinitionOptions, Bt as WebFingerLinksDispatcher, C as FederationOptions, Ct as CollectionDispatcher, D as InboxChallengePolicy, Dt as InboxErrorHandler, E as IdempotencyStrategy, Et as CustomCollectionDispatcher, F as FederationQueueOptions, Ft as OutboxListenerErrorHandler, G as RetryContext, Gt as digest, H as TaskHandler, Ht as SenderKeyPair, I as createFederation, It as OutboxPermanentFailureHandler, J as RespondWithObjectOptions, K as RetryPolicy, Kt as ActivityTransformer, L as Message, Lt as SharedInboxKeyDispatcher, M as Rfc6570Expression, Mt as ObjectDispatcher, N as FederationKvPrefixes, Nt as OutboxErrorHandler, O as InboxListenerSetters, Ot as InboxListener, P as FederationOrigin, Pt as OutboxListener, Q as InProcessMessageQueueOptions, R as createFederationBuilder, Rt as UnverifiedActivityHandler, S as FederationFetchOptions, St as CollectionCursor, T as IdempotencyKeyCallback, Tt as CustomCollectionCursor, U as TaskRegistry, Ut as PageItems, V as TaskEnqueueOptions, Vt as SendActivityError, W as CreateExponentialBackoffPolicyOptions, Wt as buildCollectionSynchronizationHeader, X as respondWithObjectIfAcceptable, Y as respondWithObject, Z as InProcessMessageQueue, _ as CustomCollectionCallbackSetters, _t as ActorDispatcher, a as GetSignedKeyOptions, at as CircuitBreakerActivityDrop, b as FederationBenchmarkOptions, bt as AuthorizePredicate, c as ParseUriResult, ct as CircuitBreakerFailurePolicy, d as RouteActivityOptions, dt as CircuitBreakerState, et as MessageQueueDepth, f as SendActivityOptions, ft as CircuitBreakerStateChange, g as ConstructorWithTypeId, gt as ActorAliasMapper, h as CollectionCallbackSetters, ht as parseCircuitBreakerKvState, i as GetActorOptions, it as CircuitBreaker, j as OutboxListenerSetters, jt as ObjectAuthorizePredicate, k as MediaUploaderSetters, kt as MediaUploaderCallback, l as PortableRequest, lt as CircuitBreakerKvState, m as ActorCallbackSetters, mt as normalizeCircuitBreakerOptions, n as Context, nt as MessageQueueListenOptions, o as InboxContext, ot as CircuitBreakerBeforeSendDecision, p as SendActivityOptionsForCollection, pt as NormalizedCircuitBreakerOptions, q as createExponentialBackoffPolicy, r as ForwardActivityOptions, rt as ParallelMessageQueue, s as OutboxContext, st as CircuitBreakerCreateOptions, t as ActorKeyPair, tt as MessageQueueEnqueueOptions, u as RequestContext, ut as CircuitBreakerOptions, v as Federatable, vt as ActorHandleMapper, w as FederationStartQueueOptions, wt as CustomCollectionCounter, x as FederationBuilder, xt as CollectionCounter, y as Federation, yt as ActorKeyPairsDispatcher, z as TaskDefinition, zt as UnverifiedActivityReason } from "./context-BJPHhBmD.js";
5
+ import { $ as MessageQueue, A as ObjectCallbackSetters, At as InboxListener, B as TaskDefinitionOptions, Bt as UnverifiedActivityHandler, C as FederationOptions, Ct as CollectionDispatcher, D as InboxChallengePolicy, Dt as HashlinkMediaDispatcher, E as IdempotencyStrategy, Et as CustomCollectionDispatcher, F as FederationQueueOptions, Ft as OutboxErrorHandler, G as RetryContext, Gt as PageItems, H as TaskHandler, Ht as WebFingerLinksDispatcher, I as createFederation, It as OutboxListener, J as RespondWithObjectOptions, Jt as ActivityTransformer, K as RetryPolicy, Kt as buildCollectionSynchronizationHeader, L as Message, Lt as OutboxListenerErrorHandler, M as Rfc6570Expression, Mt as NodeInfoDispatcher, N as FederationKvPrefixes, Nt as ObjectAuthorizePredicate, O as InboxListenerSetters, Ot as HashlinkMediaRequest, P as FederationOrigin, Pt as ObjectDispatcher, Q as InProcessMessageQueueOptions, R as createFederationBuilder, Rt as OutboxPermanentFailureHandler, S as FederationFetchOptions, St as CollectionCursor, T as IdempotencyKeyCallback, Tt as CustomCollectionCursor, U as TaskRegistry, Ut as SendActivityError, V as TaskEnqueueOptions, Vt as UnverifiedActivityReason, W as CreateExponentialBackoffPolicyOptions, Wt as SenderKeyPair, X as respondWithObjectIfAcceptable, Y as respondWithObject, Z as InProcessMessageQueue, _ as CustomCollectionCallbackSetters, _t as ActorDispatcher, a as GetSignedKeyOptions, at as CircuitBreakerActivityDrop, b as FederationBenchmarkOptions, bt as AuthorizePredicate, c as ParseUriResult, ct as CircuitBreakerFailurePolicy, d as RouteActivityOptions, dt as CircuitBreakerState, et as MessageQueueDepth, f as SendActivityOptions, ft as CircuitBreakerStateChange, g as ConstructorWithTypeId, gt as ActorAliasMapper, h as CollectionCallbackSetters, ht as parseCircuitBreakerKvState, i as GetActorOptions, it as CircuitBreaker, j as OutboxListenerSetters, jt as MediaUploaderCallback, k as MediaUploaderSetters, kt as InboxErrorHandler, l as PortableRequest, lt as CircuitBreakerKvState, m as ActorCallbackSetters, mt as normalizeCircuitBreakerOptions, n as Context, nt as MessageQueueListenOptions, o as InboxContext, ot as CircuitBreakerBeforeSendDecision, p as SendActivityOptionsForCollection, pt as NormalizedCircuitBreakerOptions, q as createExponentialBackoffPolicy, qt as digest, r as ForwardActivityOptions, rt as ParallelMessageQueue, s as OutboxContext, st as CircuitBreakerCreateOptions, t as ActorKeyPair, tt as MessageQueueEnqueueOptions, u as RequestContext, ut as CircuitBreakerOptions, v as Federatable, vt as ActorHandleMapper, w as FederationStartQueueOptions, wt as CustomCollectionCounter, x as FederationBuilder, xt as CollectionCounter, y as Federation, yt as ActorKeyPairsDispatcher, z as TaskDefinition, zt as SharedInboxKeyDispatcher } from "./context-D_gg4M0n.js";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-BhNbN8Ed.js";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
8
- import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-BofpDIcU.js";
8
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-BhMvsgdF.js";
9
9
  import { C as verifyJsonLd, S as signJsonLd, _ as VerifySignatureOptions, a as VerifyPortableObjectProofOptions, b as detachSignature, c as createProof, d as verifyObject, f as verifyPortableObjectProof, g as VerifyJsonLdOptions, h as SignJsonLdOptions, i as VerifyPortableObjectProofFailureReason, l as hasProofLike, m as CreateSignatureOptions, n as SignObjectOptions, o as VerifyPortableObjectProofResult, p as verifyProof, r as VerifyObjectOptions, s as VerifyProofOptions, t as CreateProofOptions, u as signObject, v as attachSignature, w as verifySignature, x as hasSignatureLike, y as createSignature } from "./mod-CNRAxXEb.js";
10
10
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-C0BYc0OU.js";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
13
13
  //#region src/mod.d.ts
14
14
  declare namespace mod_d_exports {
15
- export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, PortableRequest, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
15
+ export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HashlinkMediaDispatcher, HashlinkMediaRequest, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, PortableRequest, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
16
16
  }
17
17
  //#endregion
18
- export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, PortableRequest, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
18
+ export { AcceptSignatureMember, AcceptSignatureParameters, ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CreateProofOptions, CreateSignatureOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, DoesActorOwnKeyOptions, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, ForwardActivityOptions, FulfillAcceptSignatureResult, GetActorOptions, GetKeyOwnerOptions, GetNodeInfoOptions, GetSignedKeyOptions, HashlinkMediaDispatcher, HashlinkMediaRequest, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboundService, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, JsonValue, KeyCache, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, PortableRequest, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, WebFingerHandlerParameters, WebFingerLinksDispatcher, actorDehydrator, attachSignature, autoIdAssigner, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, createProof, createSignature, detachSignature, digest, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getAuthenticatedDocumentLoader, getDefaultActivityTransformers, getKeyOwner, getNodeInfo, handleWebFinger, hasProofLike, hasSignatureLike, importJwk, kvCache, nodeInfoToJson, normalizeCircuitBreakerOptions, parseAcceptSignature, parseCircuitBreakerKvState, parseNodeInfo, respondWithObject, respondWithObjectIfAcceptable, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./rolldown-runtime-BC-Eo5Mj.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-DAtXl_Kc.js";
5
5
  import "./compat/mod.js";
6
- import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-C3WGK1dL.js";
7
- import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "./middleware-_CMav1o7.js";
6
+ import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-iLCx9vk-.js";
7
+ import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "./middleware-1nes8_U-.js";
8
8
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-C_cNlNVK.js";
9
- import { S as signJsonLd, T as verifySignature, a as signObject, c as verifyPortableObjectProof, g as detachSignature, h as createSignature, i as hasProofLike, n as getKeyOwner, p as attachSignature, r as createProof, s as verifyObject, t as doesActorOwnKey, u as verifyProof, w as verifyJsonLd, y as hasSignatureLike } from "./owner-B-TLr-1I.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BcHCmrC8.js";
9
+ import { S as signJsonLd, T as verifySignature, a as signObject, c as verifyPortableObjectProof, g as detachSignature, h as createSignature, i as hasProofLike, n as getKeyOwner, p as attachSignature, r as createProof, s as verifyObject, t as doesActorOwnKey, u as verifyProof, w as verifyJsonLd, y as hasSignatureLike } from "./owner-SBgt2USF.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-bXLDSaRu.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-DG5QeQ8W.mjs";
5
5
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
7
7
  import "../std__assert-DvMDRPes.mjs";
8
- import { o as createFederation, v as handleNodeInfo, y as handleNodeInfoJrd } from "../middleware-BtwW3G41.mjs";
8
+ import { b as handleNodeInfoJrd, o as createFederation, y as handleNodeInfo } from "../middleware-DohUu-Tz.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -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-Bz6KTcon.mjs";
5
- import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-BMc-2eW0.mjs";
4
+ import { n as version, t as name } from "./deno-BtpLWN2L.mjs";
5
+ import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-DrCNkH3Y.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,6 +1,6 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-Dmm3t92W.cjs");
3
- const require_http = require("./http-LmUsMjK_.cjs");
3
+ const require_http = require("./http-DW5mt8FG.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,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { I as name, L as version, c as fetchKey, f as validateCryptoKey, h as getFederationMetrics, m as getDurationMs, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, y as measureSignatureKeyFetch } from "./http-C3WGK1dL.js";
3
+ import { I as name, L as version, c as fetchKey, f as validateCryptoKey, h as getFederationMetrics, m as getDurationMs, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, y as measureSignatureKeyFetch } from "./http-iLCx9vk-.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,12 +1,12 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-Bz6KTcon.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-CTAe8lYz.mjs";
6
- import { r as fetchKey, s as validateCryptoKey } from "./key-BMc-2eW0.mjs";
4
+ import { n as version, t as name } from "./deno-BtpLWN2L.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DxVi0UJD.mjs";
6
+ import { r as fetchKey, s as validateCryptoKey } from "./key-DrCNkH3Y.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
9
- import { c as getNormalizationContextLoader } from "./ld-OpXWt-80.mjs";
9
+ import { c as getNormalizationContextLoader } from "./ld-BPG92sC0.mjs";
10
10
  import { getLogger } from "@logtape/logtape";
11
11
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
12
12
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -0,0 +1,156 @@
1
+ import "temporal-polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { getLogger } from "@logtape/logtape";
5
+ import { Router, RouterError, assertPath, isPath } from "@fedify/uri-template";
6
+ //#region src/federation/router.ts
7
+ const logger = getLogger([
8
+ "fedify",
9
+ "federation",
10
+ "router",
11
+ "deprecated"
12
+ ]);
13
+ let deprecationWarned = false;
14
+ function warnDeprecated() {
15
+ if (deprecationWarned) return;
16
+ deprecationWarned = true;
17
+ logger.warn("The `Router` and `RouterError` classes from `@fedify/fedify` are deprecated. Please use `Router` from `@fedify/uri-template` instead.");
18
+ }
19
+ /**
20
+ * URL router and constructor based on URI Template
21
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
22
+ *
23
+ * @deprecated Import `Router` from `@fedify/uri-template` instead. This class
24
+ * remains only for compatibility with older Fedify code. The
25
+ * `@fedify/uri-template` router is the replacement implementation
26
+ * and should be used directly in new code.
27
+ */
28
+ var Router$1 = class Router$1 {
29
+ #router;
30
+ /**
31
+ * Create a new {@link Router}.
32
+ * @param options Options for the router.
33
+ * @deprecated Use `new Router(options)` from `@fedify/uri-template`
34
+ * instead.
35
+ */
36
+ constructor(options) {
37
+ this.#router = convertRouterError(() => new Router(options));
38
+ }
39
+ /**
40
+ * Whether to ignore trailing slashes when matching paths.
41
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. This
42
+ * accessor forwards to the underlying `@fedify/uri-template`
43
+ * router so that post-construction mutation keeps working as
44
+ * in older Fedify code.
45
+ */
46
+ get trailingSlashInsensitive() {
47
+ return this.#router.trailingSlashInsensitive;
48
+ }
49
+ set trailingSlashInsensitive(value) {
50
+ this.#router.trailingSlashInsensitive = value;
51
+ }
52
+ /**
53
+ * Clones this router.
54
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
55
+ */
56
+ clone() {
57
+ return convertRouterError(() => {
58
+ const clone = new Router$1();
59
+ clone.#router = this.#router.clone();
60
+ return clone;
61
+ });
62
+ }
63
+ /**
64
+ * Checks if a path name exists in the router.
65
+ * @param name The name of the path.
66
+ * @returns `true` if the path name exists, otherwise `false`.
67
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
68
+ */
69
+ has(name) {
70
+ return convertRouterError(() => this.#router.has(name));
71
+ }
72
+ /**
73
+ * Adds a new path rule to the router.
74
+ * @param template The path pattern.
75
+ * @param name The name of the path.
76
+ * @returns The names of the variables in the path pattern.
77
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. In this
78
+ * compatibility class, `add()` both registers the route and
79
+ * returns the variables in the path pattern. In
80
+ * `@fedify/uri-template`, these two responsibilities are split:
81
+ * `router.add(template, name)` registers the route and returns
82
+ * `void`, while the pure static method
83
+ * `Router.variables(template)` returns the variable names. To
84
+ * migrate, call `Router.variables(template)` when variables are
85
+ * needed, then call `router.add(template, name)` to register the
86
+ * route.
87
+ */
88
+ add(template, name) {
89
+ return convertRouterError(() => {
90
+ assertPath(template);
91
+ this.#router.add(template, name);
92
+ return Router.variables(template);
93
+ });
94
+ }
95
+ /**
96
+ * Resolves a path name and values from a URL, if any match.
97
+ * @param url The URL to resolve.
98
+ * @returns The name of the path and its values, if any match. Otherwise,
99
+ * `null`.
100
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. Unlike the
101
+ * stricter `@fedify/uri-template` router, this compatibility
102
+ * method keeps the old Fedify 2.x contract of returning `null`
103
+ * (rather than throwing) for inputs that are not router paths.
104
+ */
105
+ route(url) {
106
+ return convertRouterError(() => {
107
+ if (!isPath(url)) return null;
108
+ return this.#router.route(url);
109
+ });
110
+ }
111
+ /**
112
+ * Constructs a URL/path from a path name and values.
113
+ * @param name The name of the path.
114
+ * @param values The values to expand the path with.
115
+ * @returns The URL/path, if the name exists. Otherwise, `null`.
116
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
117
+ */
118
+ build(name, values) {
119
+ return convertRouterError(() => this.#router.build(name, values));
120
+ }
121
+ };
122
+ /**
123
+ * An error thrown by the {@link Router}.
124
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
125
+ */
126
+ var RouterError$1 = class extends RouterError {
127
+ /**
128
+ * Treats every `RouterError` from `@fedify/uri-template` as an instance of
129
+ * this deprecated class.
130
+ *
131
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
132
+ */
133
+ static [Symbol.hasInstance](instance) {
134
+ return instance instanceof RouterError;
135
+ }
136
+ /**
137
+ * Create a new {@link RouterError}.
138
+ * @param message The error message.
139
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
140
+ */
141
+ constructor(message) {
142
+ super(message);
143
+ warnDeprecated();
144
+ }
145
+ };
146
+ function convertRouterError(func) {
147
+ try {
148
+ warnDeprecated();
149
+ return func();
150
+ } catch (error) {
151
+ if (error instanceof RouterError) throw new RouterError$1(error.message);
152
+ throw error;
153
+ }
154
+ }
155
+ //#endregion
156
+ export { RouterError$1 as n, Router$1 as t };
@@ -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-Bz6KTcon.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-CTAe8lYz.mjs";
6
- import { n as doubleKnock } from "./http-Ty805y3A.mjs";
4
+ import { n as version, t as name } from "./deno-BtpLWN2L.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DxVi0UJD.mjs";
6
+ import { n as doubleKnock } from "./http-CotELN-4.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError, UrlError, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-BcZqTCwy.mjs";
6
+ import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-CwTySDnn.mjs";
7
7
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/sig/compound-proof-discovery.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-BcZqTCwy.mjs";
6
+ import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-CwTySDnn.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/sig/compound-proof-producer.test.ts
9
9
  const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "../proof-CVf2XbEa.mjs";
8
- import { a as verifyCompoundPortableObjectProofs, o as verifyCompoundProofDocuments } from "../compound-proof-BcZqTCwy.mjs";
7
+ import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "../proof-BigVZwkl.mjs";
8
+ import { a as verifyCompoundPortableObjectProofs, o as verifyCompoundProofDocuments } from "../compound-proof-CwTySDnn.mjs";
9
9
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
10
10
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -7,8 +7,8 @@ import { t as assert } from "../assert-D1Eafmd_.mjs";
7
7
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
8
8
  import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
9
9
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
10
- import { c as verifyProof, r as signObject } from "../proof-CVf2XbEa.mjs";
11
- import { o as verifyCompoundProofDocuments } from "../compound-proof-BcZqTCwy.mjs";
10
+ import { c as verifyProof, r as signObject } from "../proof-BigVZwkl.mjs";
11
+ import { o as verifyCompoundProofDocuments } from "../compound-proof-CwTySDnn.mjs";
12
12
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
13
13
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
14
14
  import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
@@ -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-BMc-2eW0.mjs";
15
- import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-Ty805y3A.mjs";
14
+ import { t as exportJwk } from "../key-DrCNkH3Y.mjs";
15
+ import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-CotELN-4.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-BMc-2eW0.mjs";
9
+ import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-DrCNkH3Y.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,9 +8,9 @@ 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-BMc-2eW0.mjs";
11
+ import { a as generateCryptoKeyPair } from "../key-DrCNkH3Y.mjs";
12
12
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
- 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-OpXWt-80.mjs";
13
+ 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-BPG92sC0.mjs";
14
14
  import { CryptographicKey } from "@fedify/vocab";
15
15
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
16
16
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_http = require("../http-LmUsMjK_.cjs");
4
- const require_owner = require("../owner-Bcm4pLXw.cjs");
3
+ const require_http = require("../http-DW5mt8FG.cjs");
4
+ const require_owner = require("../owner-C2ER4VD7.cjs");
5
5
  exports.attachSignature = require_owner.attachSignature;
6
6
  exports.createProof = require_owner.createProof;
7
7
  exports.createSignature = require_owner.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-C3WGK1dL.js";
4
- import { S as signJsonLd, T as verifySignature, a as signObject, c as verifyPortableObjectProof, g as detachSignature, h as createSignature, i as hasProofLike, n as getKeyOwner, p as attachSignature, r as createProof, s as verifyObject, t as doesActorOwnKey, u as verifyProof, w as verifyJsonLd, y as hasSignatureLike } from "../owner-B-TLr-1I.js";
3
+ import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-iLCx9vk-.js";
4
+ import { S as signJsonLd, T as verifySignature, a as signObject, c as verifyPortableObjectProof, g as detachSignature, h as createSignature, i as hasProofLike, n as getKeyOwner, p as attachSignature, r as createProof, s as verifyObject, t as doesActorOwnKey, u as verifyProof, w as verifyJsonLd, y as hasSignatureLike } from "../owner-SBgt2USF.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, 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-RxB_eQpU.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-BN7Mqjso.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
@@ -9,11 +9,11 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
9
9
  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
- import { l as verifyRequest } from "../http-Ty805y3A.mjs";
12
+ import { l as verifyRequest } from "../http-CotELN-4.mjs";
13
13
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
14
- import { t as getAuthenticatedDocumentLoader } from "../docloader-DS54zLD1.mjs";
14
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CJADEtqb.mjs";
15
15
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
16
- import { a as verifyObject, c as verifyProof, n as hasProofLike, o as verifyPortableObjectProof, r as signObject, t as createProof } from "../proof-CVf2XbEa.mjs";
16
+ import { a as verifyObject, c as verifyProof, n as hasProofLike, o as verifyPortableObjectProof, r as signObject, t as createProof } from "../proof-BigVZwkl.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,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-OpXWt-80.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-BPG92sC0.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-BtwW3G41.mjs";
9
+ import { o as createFederation } from "../middleware-DohUu-Tz.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();
@@ -463,6 +463,60 @@ type OutboxListener<TContextData, TActivity extends Activity> = (context: Outbox
463
463
  * @since 2.4.0
464
464
  */
465
465
  type MediaUploaderCallback<TContextData> = (context: RequestContext<TContextData>, identifier: string, file: File, object: Object$1) => Object$1 | URL | Promise<Object$1 | URL>;
466
+ /**
467
+ * A request for a resource addressed by a hashlink, which an
468
+ * [FEP-ef61](https://w3id.org/fep/ef61) gateway serves at
469
+ * `/.well-known/apgateway/hl:<digestMultibase>`.
470
+ *
471
+ * Fedify validates the hashlink before creating this object, so the digest is
472
+ * always a well-formed SHA-256 multihash.
473
+ *
474
+ * @since 2.4.0
475
+ */
476
+ interface HashlinkMediaRequest {
477
+ /**
478
+ * The requested hashlink, i.e., `hl:` followed by
479
+ * {@link HashlinkMediaRequest.digestMultibase}, after percent-decoding and
480
+ * with its scheme lowercased.
481
+ */
482
+ readonly hashlink: `hl:${string}`;
483
+ /**
484
+ * The multibase-encoded multihash as requested, which is the value that
485
+ * publishers put in the `digestMultibase` property. The same digest can be
486
+ * encoded in several multibase encodings; use
487
+ * {@link HashlinkMediaRequest.digest} as a storage key to find a resource
488
+ * regardless of the encoding.
489
+ */
490
+ readonly digestMultibase: string;
491
+ /** The hash algorithm of the digest. */
492
+ readonly algorithm: "sha2-256";
493
+ /** The raw 32-byte SHA-256 digest of the resource. */
494
+ readonly digest: Uint8Array;
495
+ /**
496
+ * The multihash decoded from
497
+ * {@link HashlinkMediaRequest.digestMultibase}, i.e., the hash algorithm
498
+ * code and the digest length followed by the digest.
499
+ */
500
+ readonly multihash: Uint8Array;
501
+ }
502
+ /**
503
+ * A callback that serves a resource addressed by a hashlink through the
504
+ * [FEP-ef61](https://w3id.org/fep/ef61) gateway endpoint.
505
+ *
506
+ * The returned response is sent as is, so the callback can stream its body
507
+ * and set headers such as `Content-Type` and `Cache-Control`. Fedify does not
508
+ * verify the response body against the digest, so the complete
509
+ * representation must be the exact bytes that hash to the requested digest.
510
+ *
511
+ * @template TContextData The context data to pass to the {@link Context}.
512
+ * @param context The request context.
513
+ * @param media The requested hashlink and its digest.
514
+ * @returns The response to send, or `null` if the resource is not stored on
515
+ * this server, which results in `404 Not Found`. It may be returned
516
+ * synchronously or wrapped in a `Promise`.
517
+ * @since 2.4.0
518
+ */
519
+ type HashlinkMediaDispatcher<TContextData> = (context: RequestContext<TContextData>, media: HashlinkMediaRequest) => Response | null | Promise<Response | null>;
466
520
  /**
467
521
  * The reason why an incoming activity could not be verified.
468
522
  *
@@ -1619,6 +1673,53 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1619
1673
  * @since 2.4.0
1620
1674
  */
1621
1675
  setMediaUploader(path: `${string}${Rfc6570Expression<"identifier">}${string}`, callback: MediaUploaderCallback<TContextData>): MediaUploaderSetters<TContextData>;
1676
+ /**
1677
+ * Registers a dispatcher that serves resources addressed by hashlinks, such
1678
+ * as media attached to portable objects, through the
1679
+ * [FEP-ef61](https://w3id.org/fep/ef61) gateway endpoint, e.g.,
1680
+ * `GET /.well-known/apgateway/hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n`.
1681
+ *
1682
+ * Fedify responds with `400 Bad Request` without calling the dispatcher if
1683
+ * the hashlink is malformed or its digest is not a SHA-256 multihash, and
1684
+ * with `404 Not Found` if the dispatcher returns `null`. Otherwise, the
1685
+ * response returned by the dispatcher is sent as is. Requests with methods
1686
+ * other than `GET` and `HEAD` get `405 Method Not Allowed`.
1687
+ *
1688
+ * Fedify does not verify the served bytes against the digest, as that would
1689
+ * require buffering the whole response body. The dispatcher must serve only
1690
+ * the resource whose complete representation hashes to the requested
1691
+ * digest, e.g., by using the digest as the storage key.
1692
+ *
1693
+ * This is not the upload API of the ActivityPub Media Upload extension,
1694
+ * which is registered through {@link Federatable.setMediaUploader}.
1695
+ *
1696
+ * @example
1697
+ * ``` typescript
1698
+ * federation.setHashlinkMediaDispatcher(async (ctx, media) => {
1699
+ * const file = await findPublicMedia(media.digest);
1700
+ * if (file == null) return null;
1701
+ * return new Response(
1702
+ * ctx.request.method === "HEAD" ? null : file.stream(),
1703
+ * {
1704
+ * headers: {
1705
+ * "Content-Type": file.mediaType,
1706
+ * "Content-Length": file.size.toString(),
1707
+ * "Cache-Control": "public, max-age=31536000, immutable",
1708
+ * "X-Content-Type-Options": "nosniff",
1709
+ * },
1710
+ * },
1711
+ * );
1712
+ * });
1713
+ * ```
1714
+ *
1715
+ * @param dispatcher A callback that returns the response serving the
1716
+ * requested resource, or `null` if it is not stored on
1717
+ * this server.
1718
+ * @throws {RouterError} Thrown if a hashlink media dispatcher is already
1719
+ * registered.
1720
+ * @since 2.4.0
1721
+ */
1722
+ setHashlinkMediaDispatcher(dispatcher: HashlinkMediaDispatcher<TContextData>): void;
1622
1723
  /**
1623
1724
  * Registers a following collection dispatcher.
1624
1725
  * @param path The URI path pattern for the following collection. The syntax
@@ -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 { l as verifyRequest } from "../http-Ty805y3A.mjs";
8
+ import { l as verifyRequest } from "../http-CotELN-4.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-DS54zLD1.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CJADEtqb.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-BhPPtHg7.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-a1ghEA4h.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-CuaZnk6r.cjs");
3
+ const require_kv_cache = require("../kv-cache-LOyq_Ty6.cjs");
4
4
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
5
5
  exports.kvCache = require_kv_cache.kvCache;