@fedify/fedify 2.3.0-dev.1069 → 2.3.0-dev.1099

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 (113) hide show
  1. package/dist/{builder-DQ2zYTeA.mjs → builder-BkRRjxzb.mjs} +4 -4
  2. package/dist/{chunk-nlSIicah.js → chunk-CRNNMoPX.js} +2 -2
  3. package/dist/{chunk-QSgtlS85.mjs → chunk-DNRtMIoB.mjs} +1 -1
  4. package/dist/{client-z-8dc-e1.d.cts → client-CAM_bQXx.d.cts} +1 -0
  5. package/dist/{client-AtlibPOU.d.ts → client-CSddvgWN.d.ts} +1 -2
  6. package/dist/compat/mod.d.cts +2 -1
  7. package/dist/compat/mod.d.ts +2 -3
  8. package/dist/compat/mod.js +3 -3
  9. package/dist/compat/outgoing-jsonld.test.mjs +2 -2
  10. package/dist/compat/public-audience.test.mjs +2 -2
  11. package/dist/compat/transformers.test.mjs +2 -2
  12. package/dist/{context-7Azky82W.mjs → context-BAE7AKLA.mjs} +61 -3
  13. package/dist/{context-DrNqYkPw.d.ts → context-C0C_sRha.d.cts} +6 -7
  14. package/dist/{context-BKLGj9QO.d.cts → context-Dqgt8saU.d.ts} +6 -5
  15. package/dist/{deno-CFXqOz6w.mjs → deno-DBabeupC.mjs} +1 -1
  16. package/dist/{docloader-QNtAtTZF.mjs → docloader-DA5FzJOR.mjs} +3 -3
  17. package/dist/{esm-DhnRLoG9.mjs → esm-sdtqOUPu.mjs} +5 -7
  18. package/dist/{execAsync-eck5rbtb.mjs → execAsync-DCBrgFiV.mjs} +2 -2
  19. package/dist/federation/builder.test.mjs +3 -3
  20. package/dist/federation/handler.test.mjs +86 -4
  21. package/dist/federation/idempotency.test.mjs +3 -3
  22. package/dist/federation/inbox.test.mjs +1 -1
  23. package/dist/federation/keycache.test.mjs +1 -1
  24. package/dist/federation/middleware.test.mjs +387 -20
  25. package/dist/federation/mod.cjs +1 -1
  26. package/dist/federation/mod.d.cts +4 -3
  27. package/dist/federation/mod.d.ts +4 -5
  28. package/dist/federation/mod.js +2 -2
  29. package/dist/federation/mq.test.mjs +1 -1
  30. package/dist/federation/negotiation.test.mjs +1 -1
  31. package/dist/federation/router.test.mjs +1 -1
  32. package/dist/federation/send.test.mjs +133 -139
  33. package/dist/federation/webfinger.test.mjs +3 -3
  34. package/dist/{getMachineId-bsd-DqZ4QRFp.mjs → getMachineId-bsd-etIyxDet.mjs} +3 -3
  35. package/dist/{getMachineId-darwin-DMbbW3m7.mjs → getMachineId-darwin-D23zTf4g.mjs} +3 -3
  36. package/dist/{getMachineId-linux-lyeD2ug3.mjs → getMachineId-linux-ObI47Hql.mjs} +2 -2
  37. package/dist/{getMachineId-unsupported-JuKr57jY.mjs → getMachineId-unsupported-Ddu-PFeh.mjs} +2 -2
  38. package/dist/{getMachineId-win-Dxyf5pJq.mjs → getMachineId-win-Dpap6v5i.mjs} +3 -3
  39. package/dist/{http-QHJGzUe8.mjs → http-5G18W3NP.mjs} +59 -11
  40. package/dist/{http-CrGuipxe.d.cts → http-BDZeS5om.d.ts} +2 -1
  41. package/dist/{http-aQzN9Ayi.d.ts → http-C87EWkO0.d.cts} +2 -3
  42. package/dist/{http-D2EDlTr2.js → http-Dzy5c472.js} +58 -10
  43. package/dist/{http-e1wtIlFo.cjs → http-W2u_KBoQ.cjs} +57 -9
  44. package/dist/{key-CpAxygvh.mjs → key-D9dUsyow.mjs} +2 -2
  45. package/dist/{kv-CbLNp3zQ.d.cts → kv-D6hNiMTK.d.ts} +1 -0
  46. package/dist/{kv-cache-B3GfB70S.cjs → kv-cache-BygrlQ1c.cjs} +2 -2
  47. package/dist/{kv-cache-KLjvIlKt.js → kv-cache-CBSgxEsZ.js} +2 -2
  48. package/dist/{kv-cache-Bmv7tUzz.mjs → kv-cache-CiiNwT6W.mjs} +2 -2
  49. package/dist/{kv-GFYnFoOl.d.ts → kv-gJ8LYbxX.d.cts} +1 -3
  50. package/dist/{ld-Ce_vkKjG.mjs → ld-hbxDLO1k.mjs} +3 -3
  51. package/dist/{middleware-DsGmXfXz.mjs → middleware-BXnhAGF9.mjs} +201 -119
  52. package/dist/{middleware-DOLrvK_b.cjs → middleware-Caj827xW.cjs} +358 -139
  53. package/dist/{middleware-BJMPv7_l.mjs → middleware-DZQsPMZb.mjs} +1 -1
  54. package/dist/{middleware-De241etq.js → middleware-vCF_cKAq.js} +346 -111
  55. package/dist/{mod-CLgIXe9w.d.ts → mod-B0rWmfW5.d.cts} +4 -5
  56. package/dist/{mod-CMEbIaNh.d.cts → mod-BhU_H1I_.d.ts} +4 -3
  57. package/dist/{mod-B8Z8mBLk.d.ts → mod-CLPnQPsv.d.cts} +2 -3
  58. package/dist/{mod-Cr3f-ACa.d.cts → mod-DHO9lk3D.d.ts} +3 -2
  59. package/dist/{mod-CR8soWa9.d.ts → mod-DXY9JF28.d.cts} +3 -4
  60. package/dist/{mod-DClCOv0M.d.cts → mod-Dx3-hqyo.d.ts} +2 -1
  61. package/dist/mod.cjs +4 -4
  62. package/dist/mod.d.cts +9 -8
  63. package/dist/mod.d.ts +9 -10
  64. package/dist/mod.js +9 -9
  65. package/dist/{negotiation-VnHNB0Q5.mjs → negotiation-DDstyBvc.mjs} +29 -0
  66. package/dist/nodeinfo/client.test.mjs +2 -2
  67. package/dist/nodeinfo/handler.test.mjs +2 -2
  68. package/dist/nodeinfo/mod.d.cts +2 -1
  69. package/dist/nodeinfo/mod.d.ts +2 -3
  70. package/dist/nodeinfo/mod.js +3 -3
  71. package/dist/otel/exporter.test.mjs +2 -2
  72. package/dist/otel/mod.d.cts +2 -1
  73. package/dist/otel/mod.d.ts +2 -3
  74. package/dist/otel/mod.js +2 -2
  75. package/dist/{outgoing-jsonld-Bi7n-dEy.mjs → outgoing-jsonld-BgFLCJQ_.mjs} +2 -2
  76. package/dist/{owner-CptqhsOy.d.cts → owner-CnngXDNJ.d.ts} +2 -1
  77. package/dist/{owner-74ARJ5TL.d.ts → owner-DEvZuyOE.d.cts} +2 -3
  78. package/dist/{owner-DmgzyItA.mjs → owner-DwJe0BH9.mjs} +2 -2
  79. package/dist/{proof-BU1TpFYI.cjs → proof-CZCaAURh.cjs} +3 -3
  80. package/dist/{proof-DLDsFYfD.js → proof-DMJJZnKd.js} +2 -2
  81. package/dist/{proof-C3q2IhUr.mjs → proof-erpV_J_n.mjs} +5 -5
  82. package/dist/runtime/mod.d.cts +1 -0
  83. package/dist/runtime/mod.d.ts +1 -2
  84. package/dist/runtime/mod.js +3 -3
  85. package/dist/{send-CTi2iPXp.mjs → send-BOwz4Hw5.mjs} +128 -4
  86. package/dist/sig/http.test.mjs +140 -27
  87. package/dist/sig/key.test.mjs +2 -2
  88. package/dist/sig/ld.test.mjs +3 -3
  89. package/dist/sig/mod.cjs +2 -2
  90. package/dist/sig/mod.d.cts +4 -3
  91. package/dist/sig/mod.d.ts +4 -5
  92. package/dist/sig/mod.js +4 -4
  93. package/dist/sig/owner.test.mjs +2 -2
  94. package/dist/sig/proof.test.mjs +3 -3
  95. package/dist/testing/mod.d.mts +6 -1
  96. package/dist/testing/mod.mjs +1 -2
  97. package/dist/{transformers-ve6e2xcg.js → transformers-BGMIq1cs.js} +2 -2
  98. package/dist/{types-hvL8ElAs.js → types-CAY3OdLq.js} +2 -2
  99. package/dist/utils/docloader.test.mjs +3 -3
  100. package/dist/utils/kv-cache.test.mjs +2 -2
  101. package/dist/utils/mod.cjs +1 -1
  102. package/dist/utils/mod.d.cts +2 -1
  103. package/dist/utils/mod.d.ts +2 -3
  104. package/dist/utils/mod.js +3 -3
  105. package/dist/vocab/cjs.test.mjs +1 -1
  106. package/dist/vocab/mod.d.cts +1 -0
  107. package/dist/vocab/mod.d.ts +1 -2
  108. package/dist/vocab/mod.js +2 -2
  109. package/package.json +15 -15
  110. package/dist/middleware-CibncbiT.cjs +0 -4
  111. package/dist/{client-CIiz1WX7.mjs → client-B_A6mfn3.mjs} +1 -1
  112. package/dist/{public-audience-PVTwU_Ex.mjs → public-audience-N3pyOx2p.mjs} +1 -1
  113. /package/dist/{router-CrMLXoOr.mjs → router-BT_F5748.mjs} +0 -0
@@ -1,4 +1,5 @@
1
- import { Ct as WebFingerLinksDispatcher, et as ActorAliasMapper, l as RequestContext, nt as ActorHandleMapper, tt as ActorDispatcher } from "./context-BKLGj9QO.cjs";
1
+ /// <reference lib="esnext.temporal" />
2
+ import { Ct as WebFingerLinksDispatcher, et as ActorAliasMapper, l as RequestContext, nt as ActorHandleMapper, tt as ActorDispatcher } from "./context-Dqgt8saU.js";
2
3
  import { Span, Tracer } from "@opentelemetry/api";
3
4
 
4
5
  //#region src/federation/webfinger.d.ts
package/dist/mod.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("./chunk-DDcVe30Y.cjs");
5
5
  const require_transformers = require("./transformers-NeAONrAq.cjs");
6
6
  require("./compat/mod.cjs");
7
- const require_http = require("./http-e1wtIlFo.cjs");
8
- const require_middleware = require("./middleware-DOLrvK_b.cjs");
9
- const require_proof = require("./proof-BU1TpFYI.cjs");
7
+ const require_http = require("./http-W2u_KBoQ.cjs");
8
+ const require_middleware = require("./middleware-Caj827xW.cjs");
9
+ const require_proof = require("./proof-CZCaAURh.cjs");
10
10
  const require_types = require("./types-KC4QAoxe.cjs");
11
- const require_kv_cache = require("./kv-cache-B3GfB70S.cjs");
11
+ const require_kv_cache = require("./kv-cache-BygrlQ1c.cjs");
12
12
  const require_federation_mod = require("./federation/mod.cjs");
13
13
  require("./nodeinfo/mod.cjs");
14
14
  require("./runtime/mod.cjs");
package/dist/mod.d.cts CHANGED
@@ -1,12 +1,13 @@
1
- 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-z-8dc-e1.cjs";
2
- 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-CrGuipxe.cjs";
3
- import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CptqhsOy.cjs";
4
- import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-BKLGj9QO.cjs";
5
- import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CbLNp3zQ.cjs";
1
+ /// <reference lib="esnext.temporal" />
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-CAM_bQXx.cjs";
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-C87EWkO0.cjs";
4
+ import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
5
+ import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-C0C_sRha.cjs";
6
+ import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
6
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
7
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-DClCOv0M.cjs";
8
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-Cr3f-ACa.cjs";
9
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-CMEbIaNh.cjs";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-CLPnQPsv.cjs";
9
+ import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-DXY9JF28.cjs";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-B0rWmfW5.cjs";
10
11
  export * from "@fedify/vocab-runtime";
11
12
 
12
13
  //#region src/mod.d.ts
package/dist/mod.d.ts CHANGED
@@ -1,14 +1,13 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- 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-AtlibPOU.js";
4
- 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-aQzN9Ayi.js";
5
- import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-74ARJ5TL.js";
6
- import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-DrNqYkPw.js";
7
- import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-GFYnFoOl.js";
1
+ /// <reference lib="esnext.temporal" />
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-CSddvgWN.js";
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-BDZeS5om.js";
4
+ import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
5
+ import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-Dqgt8saU.js";
6
+ import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
8
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
9
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-B8Z8mBLk.js";
10
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-CR8soWa9.js";
11
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-CLgIXe9w.js";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-Dx3-hqyo.js";
9
+ import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-DHO9lk3D.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BhU_H1I_.js";
12
11
  export * from "@fedify/vocab-runtime";
13
12
 
14
13
  //#region src/mod.d.ts
package/dist/mod.js CHANGED
@@ -1,13 +1,13 @@
1
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
3
- import "./chunk-nlSIicah.js";
4
- import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-ve6e2xcg.js";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import "./chunk-CRNNMoPX.js";
4
+ import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
5
5
  import "./compat/mod.js";
6
- import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "./http-D2EDlTr2.js";
7
- import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-De241etq.js";
8
- import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "./proof-DLDsFYfD.js";
9
- import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-hvL8ElAs.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-KLjvIlKt.js";
6
+ import { a as verifyRequestDetailed, c as fetchKeyDetailed, f as formatAcceptSignature, h as validateAcceptSignature, i as verifyRequest, l as generateCryptoKeyPair, m as parseAcceptSignature, o as exportJwk, p as fulfillAcceptSignature, r as signRequest, s as fetchKey, u as importJwk } from "./http-Dzy5c472.js";
7
+ import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-vCF_cKAq.js";
8
+ import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "./proof-DMJJZnKd.js";
9
+ import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CBSgxEsZ.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -2,6 +2,35 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region src/federation/negotiation.ts
5
+ /*!
6
+ * Adapted directly from negotiator at https://github.com/jshttp/negotiator/
7
+ * which is licensed as follows:
8
+ *
9
+ * (The MIT License)
10
+ *
11
+ * Copyright (c) 2012-2014 Federico Romero
12
+ * Copyright (c) 2012-2014 Isaac Z. Schlueter
13
+ * Copyright (c) 2014-2015 Douglas Christopher Wilson
14
+ *
15
+ * Permission is hereby granted, free of charge, to any person obtaining
16
+ * a copy of this software and associated documentation files (the
17
+ * 'Software'), to deal in the Software without restriction, including
18
+ * without limitation the rights to use, copy, modify, merge, publish,
19
+ * distribute, sublicense, and/or sell copies of the Software, and to
20
+ * permit persons to whom the Software is furnished to do so, subject to
21
+ * the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be
24
+ * included in all copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
27
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
30
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
+ */
5
34
  function compareSpecs(a, b) {
6
35
  return b.q - a.q || (b.s ?? 0) - (a.s ?? 0) || (a.o ?? 0) - (b.o ?? 0) || a.i - b.i || 0;
7
36
  }
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
- import { t as esm_default } from "../esm-DhnRLoG9.mjs";
7
- import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-CIiz1WX7.mjs";
6
+ import { t as esm_default } from "../esm-sdtqOUPu.mjs";
7
+ import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-B_A6mfn3.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/nodeinfo/client.test.ts
10
10
  test("getNodeInfo()", async (t) => {
@@ -1,11 +1,11 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { r as createRequestContext } from "../context-7Azky82W.mjs";
4
+ import { r as createRequestContext } from "../context-BAE7AKLA.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-CRDpx_HF.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
- import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-DsGmXfXz.mjs";
8
+ import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-BXnhAGF9.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -1,2 +1,3 @@
1
- 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-z-8dc-e1.cjs";
1
+ /// <reference lib="esnext.temporal" />
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-CAM_bQXx.cjs";
2
3
  export { type GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, type ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
@@ -1,4 +1,3 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- 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-AtlibPOU.js";
1
+ /// <reference lib="esnext.temporal" />
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-CSddvgWN.js";
4
3
  export { type GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, type ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
@@ -1,4 +1,4 @@
1
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
3
- import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-hvL8ElAs.js";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "../types-CAY3OdLq.js";
4
4
  export { getNodeInfo, nodeInfoToJson, parseNodeInfo };
@@ -4,10 +4,10 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-CRDpx_HF.mjs";
6
6
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
7
- import { test } from "@fedify/fixture";
8
- import { SpanKind, SpanStatusCode, TraceFlags } from "@opentelemetry/api";
9
7
  import { getLogger } from "@logtape/logtape";
10
8
  import { ExportResultCode } from "@opentelemetry/core";
9
+ import { SpanKind, SpanStatusCode, TraceFlags } from "@opentelemetry/api";
10
+ import { test } from "@fedify/fixture";
11
11
  //#region src/otel/exporter.ts
12
12
  /**
13
13
  * A SpanExporter that persists ActivityPub activity traces to a
@@ -1,4 +1,5 @@
1
- import { n as KvStore, t as KvKey } from "../kv-CbLNp3zQ.cjs";
1
+ /// <reference lib="esnext.temporal" />
2
+ import { n as KvStore, t as KvKey } from "../kv-gJ8LYbxX.cjs";
2
3
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
3
4
  import { ExportResultCode } from "@opentelemetry/core";
4
5
 
@@ -1,6 +1,5 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- import { n as KvStore, t as KvKey } from "../kv-GFYnFoOl.js";
1
+ /// <reference lib="esnext.temporal" />
2
+ import { n as KvStore, t as KvKey } from "../kv-D6hNiMTK.js";
4
3
  import { ExportResultCode } from "@opentelemetry/core";
5
4
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
6
5
 
package/dist/otel/mod.js CHANGED
@@ -1,5 +1,5 @@
1
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
3
  import { getLogger } from "@logtape/logtape";
4
4
  import { ExportResultCode } from "@opentelemetry/core";
5
5
  //#region src/otel/exporter.ts
@@ -1,9 +1,9 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as preloadedOnlyDocumentLoader, t as normalizePublicAudience } from "./public-audience-PVTwU_Ex.mjs";
5
- import { preloadedContexts } from "@fedify/vocab-runtime";
4
+ import { n as preloadedOnlyDocumentLoader, t as normalizePublicAudience } from "./public-audience-N3pyOx2p.mjs";
6
5
  import { getLogger } from "@logtape/logtape";
6
+ import { preloadedContexts } from "@fedify/vocab-runtime";
7
7
  import jsonld from "@fedify/vocab-runtime/jsonld";
8
8
  //#region src/compat/outgoing-jsonld.ts
9
9
  const logger = getLogger([
@@ -1,6 +1,7 @@
1
+ /// <reference lib="esnext.temporal" />
1
2
  import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
2
- import { DocumentLoader } from "@fedify/vocab-runtime";
3
3
  import { TracerProvider } from "@opentelemetry/api";
4
+ import { DocumentLoader } from "@fedify/vocab-runtime";
4
5
 
5
6
  //#region src/sig/owner.d.ts
6
7
  /**
@@ -1,8 +1,7 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
1
+ /// <reference lib="esnext.temporal" />
3
2
  import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
4
- import { TracerProvider } from "@opentelemetry/api";
5
3
  import { DocumentLoader } from "@fedify/vocab-runtime";
4
+ import { TracerProvider } from "@opentelemetry/api";
6
5
 
7
6
  //#region src/sig/owner.d.ts
8
7
  /**
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-CFXqOz6w.mjs";
5
- import "./key-CpAxygvh.mjs";
4
+ import { n as version, t as name } from "./deno-DBabeupC.mjs";
5
+ import "./key-D9dUsyow.mjs";
6
6
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
7
7
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-e1wtIlFo.cjs");
4
+ const require_http = require("./http-W2u_KBoQ.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let _fedify_vocab = require("@fedify/vocab");
7
7
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -9,9 +9,9 @@ let byte_encodings_hex = require("byte-encodings/hex");
9
9
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
10
10
  let byte_encodings_base64 = require("byte-encodings/base64");
11
11
  let _fedify_vocab_runtime_jsonld = require("@fedify/vocab-runtime/jsonld");
12
- _fedify_vocab_runtime_jsonld = require_chunk.__toESM(_fedify_vocab_runtime_jsonld);
12
+ _fedify_vocab_runtime_jsonld = require_chunk.__toESM(_fedify_vocab_runtime_jsonld, 1);
13
13
  let json_canon = require("json-canon");
14
- json_canon = require_chunk.__toESM(json_canon);
14
+ json_canon = require_chunk.__toESM(json_canon, 1);
15
15
  //#region src/sig/ld.ts
16
16
  const logger$3 = (0, _logtape_logtape.getLogger)([
17
17
  "fedify",
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
3
- import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-D2EDlTr2.js";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import { _ as version, d as validateCryptoKey, g as name, s as fetchKey } from "./http-Dzy5c472.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,13 +1,13 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-CFXqOz6w.mjs";
5
- import { n as fetchKey, o as validateCryptoKey } from "./key-CpAxygvh.mjs";
6
- import { n as preloadedOnlyDocumentLoader } from "./public-audience-PVTwU_Ex.mjs";
7
- import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-Bi7n-dEy.mjs";
4
+ import { n as version, t as name } from "./deno-DBabeupC.mjs";
5
+ import { n as fetchKey, o as validateCryptoKey } from "./key-D9dUsyow.mjs";
6
+ import { n as preloadedOnlyDocumentLoader } from "./public-audience-N3pyOx2p.mjs";
7
+ import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-BgFLCJQ_.mjs";
8
+ import { getLogger } from "@logtape/logtape";
8
9
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
9
10
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
- import { getLogger } from "@logtape/logtape";
11
11
  import { encodeHex } from "byte-encodings/hex";
12
12
  import serialize from "json-canon";
13
13
  //#region src/sig/proof.ts
@@ -1,3 +1,4 @@
1
+ /// <reference lib="esnext.temporal" />
1
2
  export * from "@fedify/vocab-runtime";
2
3
 
3
4
  //#region \0rolldown/runtime.js
@@ -1,3 +1,2 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
1
+ /// <reference lib="esnext.temporal" />
3
2
  export * from "@fedify/vocab-runtime";
@@ -1,4 +1,4 @@
1
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
3
- import "../chunk-nlSIicah.js";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import "../chunk-CRNNMoPX.js";
4
4
  export * from "@fedify/vocab-runtime";
@@ -1,10 +1,10 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-CFXqOz6w.mjs";
5
- import { n as doubleKnock } from "./http-QHJGzUe8.mjs";
6
- import { SpanKind, SpanStatusCode, metrics, trace } from "@opentelemetry/api";
4
+ import { n as version, t as name } from "./deno-DBabeupC.mjs";
5
+ import { n as doubleKnock } from "./http-5G18W3NP.mjs";
7
6
  import { getLogger } from "@logtape/logtape";
7
+ import { SpanKind, SpanStatusCode, metrics, trace } from "@opentelemetry/api";
8
8
  //#region src/federation/metrics.ts
9
9
  var FederationMetrics = class {
10
10
  deliverySent;
@@ -14,6 +14,12 @@ var FederationMetrics = class {
14
14
  inboxProcessingDuration;
15
15
  httpServerRequestCount;
16
16
  httpServerRequestDuration;
17
+ queueTaskEnqueued;
18
+ queueTaskStarted;
19
+ queueTaskCompleted;
20
+ queueTaskFailed;
21
+ queueTaskDuration;
22
+ queueTaskInFlight;
17
23
  constructor(meterProvider) {
18
24
  const meter = meterProvider.getMeter(name, version);
19
25
  this.deliverySent = meter.createCounter("activitypub.delivery.sent", {
@@ -60,6 +66,46 @@ var FederationMetrics = class {
60
66
  1e4
61
67
  ] }
62
68
  });
69
+ this.queueTaskEnqueued = meter.createCounter("fedify.queue.task.enqueued", {
70
+ description: "Tasks Fedify enqueued for inbox, outbox, or fanout work.",
71
+ unit: "{task}"
72
+ });
73
+ this.queueTaskStarted = meter.createCounter("fedify.queue.task.started", {
74
+ description: "Tasks Fedify began processing as a queue worker.",
75
+ unit: "{task}"
76
+ });
77
+ this.queueTaskCompleted = meter.createCounter("fedify.queue.task.completed", {
78
+ description: "Queue tasks Fedify finished processing without throwing.",
79
+ unit: "{task}"
80
+ });
81
+ this.queueTaskFailed = meter.createCounter("fedify.queue.task.failed", {
82
+ description: "Queue tasks Fedify abandoned because processing threw.",
83
+ unit: "{task}"
84
+ });
85
+ this.queueTaskDuration = meter.createHistogram("fedify.queue.task.duration", {
86
+ description: "Duration of queue task processing in Fedify workers.",
87
+ unit: "ms",
88
+ advice: { explicitBucketBoundaries: [
89
+ 5,
90
+ 10,
91
+ 25,
92
+ 50,
93
+ 75,
94
+ 100,
95
+ 250,
96
+ 500,
97
+ 750,
98
+ 1e3,
99
+ 2500,
100
+ 5e3,
101
+ 7500,
102
+ 1e4
103
+ ] }
104
+ });
105
+ this.queueTaskInFlight = meter.createUpDownCounter("fedify.queue.task.in_flight", {
106
+ description: "Queue tasks currently being processed in this Fedify process.",
107
+ unit: "{task}"
108
+ });
63
109
  }
64
110
  recordDelivery(inbox, durationMs, success, activityType) {
65
111
  const deliveryAttributes = {
@@ -94,7 +140,85 @@ var FederationMetrics = class {
94
140
  this.httpServerRequestCount.add(1, attributes);
95
141
  this.httpServerRequestDuration.record(durationMs, attributes);
96
142
  }
143
+ recordQueueTaskEnqueued(common, attempt) {
144
+ const attributes = buildQueueTaskAttributes(common);
145
+ attributes["fedify.queue.task.attempt"] = attempt;
146
+ this.queueTaskEnqueued.add(1, attributes);
147
+ }
148
+ recordQueueTaskStarted(common) {
149
+ this.queueTaskStarted.add(1, buildQueueTaskAttributes(common));
150
+ }
151
+ incrementQueueTaskInFlight(common) {
152
+ this.queueTaskInFlight.add(1, buildQueueTaskInFlightAttributes(common));
153
+ }
154
+ decrementQueueTaskInFlight(common) {
155
+ this.queueTaskInFlight.add(-1, buildQueueTaskInFlightAttributes(common));
156
+ }
157
+ recordQueueTaskOutcome(common, result, durationMs) {
158
+ const attributes = buildQueueTaskAttributes(common);
159
+ attributes["fedify.queue.task.result"] = result;
160
+ if (result === "completed") this.queueTaskCompleted.add(1, attributes);
161
+ else if (result === "failed") this.queueTaskFailed.add(1, attributes);
162
+ this.queueTaskDuration.record(durationMs, attributes);
163
+ }
97
164
  };
165
+ function buildQueueTaskAttributes(common) {
166
+ const attributes = { "fedify.queue.role": common.role };
167
+ const backend = getQueueBackend(common.queue);
168
+ if (backend != null) attributes["fedify.queue.backend"] = backend;
169
+ const nativeRetrial = common.queue?.nativeRetrial;
170
+ if (typeof nativeRetrial === "boolean") attributes["fedify.queue.native_retrial"] = nativeRetrial;
171
+ if (common.activityType != null) attributes["activitypub.activity.type"] = common.activityType;
172
+ return attributes;
173
+ }
174
+ function buildQueueTaskInFlightAttributes(common) {
175
+ return buildQueueTaskAttributes({
176
+ role: common.role,
177
+ queue: common.queue
178
+ });
179
+ }
180
+ /**
181
+ * Returns the constructor name of the given message queue, when it is a
182
+ * meaningful identifier. Used as a best-effort `fedify.queue.backend`
183
+ * attribute on queue task metrics; returns `undefined` for plain object
184
+ * literals (whose constructor is `Object`) so the attribute does not appear
185
+ * with a non-informative value.
186
+ * @since 2.3.0
187
+ */
188
+ function getQueueBackend(queue) {
189
+ const name = queue?.constructor?.name;
190
+ if (name == null || name === "" || name === "Object") return void 0;
191
+ return name;
192
+ }
193
+ /**
194
+ * Records `fedify.queue.task.enqueued` for an outgoing outbox enqueue.
195
+ *
196
+ * Both `Context.sendActivity()` and `OutboxContext.forwardActivity()` enqueue
197
+ * outbox messages with the same metric attributes (role, queue, activity
198
+ * type, attempt), so they share this helper rather than each defining a local
199
+ * closure.
200
+ * @since 2.3.0
201
+ */
202
+ function recordOutboxEnqueue(meterProvider, outboxQueue, message) {
203
+ getFederationMetrics(meterProvider).recordQueueTaskEnqueued({
204
+ role: "outbox",
205
+ queue: outboxQueue,
206
+ activityType: message.activityType
207
+ }, message.attempt);
208
+ }
209
+ /**
210
+ * Whether the given thrown value is an `AbortError`.
211
+ *
212
+ * `processQueuedTask` distinguishes aborted tasks (recorded as
213
+ * `fedify.queue.task.result=aborted`) from other failures so that backend
214
+ * shutdown signals do not inflate the `fedify.queue.task.failed` counter.
215
+ * @since 2.3.0
216
+ */
217
+ function isAbortError(error) {
218
+ if (error == null || typeof error !== "object") return false;
219
+ const name = error.name;
220
+ return typeof name === "string" && name === "AbortError";
221
+ }
98
222
  const KNOWN_HTTP_METHODS = new Set([
99
223
  "CONNECT",
100
224
  "DELETE",
@@ -355,4 +479,4 @@ var SendActivityError = class extends Error {
355
479
  }
356
480
  };
357
481
  //#endregion
358
- export { getFederationMetrics as a, getDurationMs as i, extractInboxes as n, getRemoteHost as o, sendActivity as r, SendActivityError as t };
482
+ export { getFederationMetrics as a, recordOutboxEnqueue as c, getDurationMs as i, extractInboxes as n, getRemoteHost as o, sendActivity as r, isAbortError as s, SendActivityError as t };