@fedify/fedify 2.4.0-dev.1488 → 2.4.0-dev.1504
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.
- package/README.md +3 -4
- package/dist/{assert-OguE97r2.mjs → assert-DvVHoIZ0.mjs} +1 -1
- package/dist/{assert_instance_of-DBC5X09g.mjs → assert_instance_of-CxoC8bVq.mjs} +1 -1
- package/dist/{assert_not_equals-DkVK8oqV.mjs → assert_not_equals-C8vcTTA3.mjs} +1 -1
- package/dist/{assert_rejects-DN60FHPX.mjs → assert_rejects-DAdaaIWM.mjs} +2 -2
- package/dist/{assert_strict_equals-XEgZAlrj.mjs → assert_strict_equals-BzqyKuYL.mjs} +1 -1
- package/dist/{assert_throws-BOkhLGYc.mjs → assert_throws-zN79lgIC.mjs} +1 -1
- package/dist/{builder-Dcr6y6XD.mjs → builder-Ck0Fl_a5.mjs} +23 -3
- package/dist/codec-CmlPqjNX.mjs +103 -0
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +3 -3
- package/dist/compat/public-audience.test.mjs +3 -3
- package/dist/compat/transformers.test.mjs +5 -5
- package/dist/{context-DVoTs_wM.mjs → context-BBRTgkrs.mjs} +8 -2
- package/dist/{context-BU6jSQdo.d.ts → context-BF5B4ZDk.d.ts} +529 -259
- package/dist/{context-BBVLF7lx.d.cts → context-CYF8X0ft.d.cts} +530 -259
- package/dist/{deno-BCFGf8NR.mjs → deno-D3gb4X9v.mjs} +1 -1
- package/dist/{docloader-DWEwaGqF.mjs → docloader-DUKu0GzG.mjs} +3 -3
- package/dist/federation/builder.test.mjs +5 -5
- package/dist/federation/circuit-breaker.test.mjs +5 -5
- package/dist/federation/collection.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +13 -13
- package/dist/federation/idempotency.test.mjs +6 -6
- package/dist/federation/inbox.test.mjs +3 -3
- package/dist/federation/keycache.test.mjs +5 -5
- package/dist/federation/kv.test.mjs +3 -3
- package/dist/federation/metrics.test.mjs +4 -4
- package/dist/federation/middleware.test.mjs +200 -19
- package/dist/federation/mod.cjs +3 -259
- package/dist/federation/mod.d.cts +4 -4
- package/dist/federation/mod.d.ts +4 -4
- package/dist/federation/mod.js +1 -257
- package/dist/federation/mq.test.mjs +103 -261
- package/dist/federation/negotiation.test.mjs +4 -4
- package/dist/federation/retry.test.mjs +3 -3
- package/dist/federation/router.test.mjs +5 -5
- package/dist/federation/send.test.mjs +10 -10
- package/dist/federation/tasks/codec.test.d.mts +2 -0
- package/dist/federation/tasks/codec.test.mjs +292 -0
- package/dist/federation/tasks/enqueue.test.d.mts +2 -0
- package/dist/federation/tasks/enqueue.test.mjs +992 -0
- package/dist/federation/tasks/tasks.test.d.mts +2 -0
- package/dist/federation/tasks/tasks.test.mjs +555 -0
- package/dist/federation/temporal.test.mjs +4 -4
- package/dist/federation/webfinger.test.mjs +6 -6
- package/dist/{http-RriziGDE.mjs → http-BNFQkiEZ.mjs} +4 -4
- package/dist/{http-DaVoLyyA.js → http-CrZzUAtV.js} +7 -17
- package/dist/{http-DLqxhQg1.cjs → http-D9p2_d2X.cjs} +7 -17
- package/dist/{key-Bkg8Zg36.mjs → key-BM_SRwBV.mjs} +8 -18
- package/dist/{kv-cache-BR--9V4L.mjs → kv-cache-BE1QIPdL.mjs} +1 -1
- package/dist/{kv-cache-DxlFLMiU.js → kv-cache-Ch_Zv5Yq.js} +1 -1
- package/dist/{kv-cache-Fw-iwKjy.cjs → kv-cache-Cna211RR.cjs} +1 -1
- package/dist/{ld-BjsmbqO7.mjs → ld-ubkf03eb.mjs} +3 -3
- package/dist/{metrics-BLoa2pab.mjs → metrics-BXR36qzu.mjs} +1 -1
- package/dist/{middleware-V-r1QH5Z.cjs → middleware-DUNeIkXN.cjs} +694 -51
- package/dist/{middleware-D3kuDjvb.mjs → middleware-iP9VRMus.mjs} +310 -67
- package/dist/{middleware-_9t5HVBi.js → middleware-lB4vtShP.js} +683 -52
- package/dist/{middleware-DNR3YBCi.mjs → middleware-pzCP79He.mjs} +1 -1
- package/dist/{mod-vPYVoa5n.d.ts → mod-4WGAuR6X.d.ts} +1 -1
- package/dist/{mod-C0F6kvgS.d.cts → mod-BHEB3xhE.d.cts} +1 -1
- package/dist/mod.cjs +6 -6
- package/dist/mod.d.cts +5 -5
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +5 -5
- package/dist/mq-03vS-C9P.mjs +276 -0
- package/dist/{mq-D8uSFzxe.d.cts → mq-B5_hohs7.d.ts} +34 -0
- package/dist/{mq-D-nlpY04.d.ts → mq-DXMt_qCY.d.cts} +34 -0
- package/dist/nodeinfo/client.test.mjs +3 -3
- package/dist/nodeinfo/handler.test.mjs +5 -5
- package/dist/nodeinfo/types.test.mjs +4 -4
- package/dist/otel/exporter.test.mjs +3 -3
- package/dist/{outgoing-jsonld-L_DbOaFe.mjs → outgoing-jsonld-BNL8AC14.mjs} +1 -1
- package/dist/{owner-NK2p1ihR.mjs → owner-Bf1KkncT.mjs} +2 -2
- package/dist/{proof-D7WVwQzs.js → proof-BMcsi8q_.js} +1 -1
- package/dist/{proof-CRXqo703.mjs → proof-Q781Ks5q.mjs} +5 -5
- package/dist/{proof-2WI6mMbC.cjs → proof-yeAU1MyT.cjs} +1 -1
- package/dist/{send-CTaPzl8L.mjs → send-DFV0S_n9.mjs} +3 -3
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +8 -8
- package/dist/sig/key.test.mjs +6 -56
- package/dist/sig/ld.test.mjs +7 -7
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +8 -8
- package/dist/{std__assert-BBjXFNOb.mjs → std__assert-Dh6uLf_q.mjs} +4 -4
- package/dist/{temporal-C8M0Y7v9.mjs → temporal-CyOjsqPj.mjs} +1 -1
- package/dist/testing/mod.d.mts +1037 -8
- package/dist/testing/mod.mjs +3 -2
- package/dist/testing-Dy-WhqpN.mjs +77 -0
- package/dist/utils/docloader.test.mjs +6 -6
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +13 -8
- /package/dist/{accept-CPkZzmGN.mjs → accept-CgDcxvjV.mjs} +0 -0
- /package/dist/{activity-listener-tztVvlNb.mjs → activity-listener-BeTGV3wc.mjs} +0 -0
- /package/dist/{assert_equals-C-ZRDbaf.mjs → assert_equals-PBVKNMJd.mjs} +0 -0
- /package/dist/{circuit-breaker-CSWsyoef.mjs → circuit-breaker-hJBB6jwA.mjs} +0 -0
- /package/dist/{client-ByXmQhYD.mjs → client-B_A6mfn3.mjs} +0 -0
- /package/dist/{collection-Cc3DVAhE.mjs → collection-Dp5ky45w.mjs} +0 -0
- /package/dist/{keycache-BeU0LCII.mjs → keycache-CaOR6NYg.mjs} +0 -0
- /package/dist/{keys-DGu1NFwu.mjs → keys-CSYsOMFG.mjs} +0 -0
- /package/dist/{kv-rV3vodCc.mjs → kv-CIvR3Non.mjs} +0 -0
- /package/dist/{negotiation-DDstyBvc.mjs → negotiation-m_L2nyS3.mjs} +0 -0
- /package/dist/{public-audience-Cvbr2Gzt.mjs → public-audience-c9zmYKgA.mjs} +0 -0
- /package/dist/{retry-CXg_MBI-.mjs → retry-DI4O-zYl.mjs} +0 -0
- /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import {
|
|
2
|
+
import { At as WebFingerLinksDispatcher, ct as ActorDispatcher, l as RequestContext, lt as ActorHandleMapper, st as ActorAliasMapper } from "./context-BF5B4ZDk.js";
|
|
3
3
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
4
4
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import {
|
|
2
|
+
import { At as WebFingerLinksDispatcher, ct as ActorDispatcher, l as RequestContext, lt as ActorHandleMapper, st as ActorAliasMapper } from "./context-CYF8X0ft.cjs";
|
|
3
3
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
5
5
|
|
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-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const require_proof = require("./proof-
|
|
7
|
+
const require_http = require("./http-D9p2_d2X.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-DUNeIkXN.cjs");
|
|
9
|
+
const require_proof = require("./proof-yeAU1MyT.cjs");
|
|
10
10
|
const require_types = require("./types-KC4QAoxe.cjs");
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
11
|
+
const require_kv_cache = require("./kv-cache-Cna211RR.cjs");
|
|
12
12
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
13
13
|
require("./nodeinfo/mod.cjs");
|
|
14
14
|
require("./runtime/mod.cjs");
|
|
@@ -16,9 +16,9 @@ require("./sig/mod.cjs");
|
|
|
16
16
|
require("./utils/mod.cjs");
|
|
17
17
|
//#endregion
|
|
18
18
|
exports.CircuitBreaker = require_middleware.CircuitBreaker;
|
|
19
|
-
exports.InProcessMessageQueue =
|
|
19
|
+
exports.InProcessMessageQueue = require_middleware.InProcessMessageQueue;
|
|
20
20
|
exports.MemoryKvStore = require_federation_mod.MemoryKvStore;
|
|
21
|
-
exports.ParallelMessageQueue =
|
|
21
|
+
exports.ParallelMessageQueue = require_middleware.ParallelMessageQueue;
|
|
22
22
|
exports.Router = require_federation_mod.Router;
|
|
23
23
|
exports.RouterError = require_federation_mod.RouterError;
|
|
24
24
|
exports.SendActivityError = require_middleware.SendActivityError;
|
package/dist/mod.d.cts
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
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-CAM_bQXx.cjs";
|
|
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-VyDTd4G3.cjs";
|
|
4
4
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
|
|
5
|
-
import { $ as
|
|
5
|
+
import { $ as CircuitBreakerFailurePolicy, A as Rfc6570Expression, At as WebFingerLinksDispatcher, B as TaskHandler, C as FederationStartQueueOptions, Ct as OutboxErrorHandler, D as InboxListenerSetters, Dt as SharedInboxKeyDispatcher, E as InboxChallengePolicy, Et as OutboxPermanentFailureHandler, F as Message, Ft as digest, G as createExponentialBackoffPolicy, H as CreateExponentialBackoffPolicyOptions, I as createFederationBuilder, It as ActivityTransformer, J as respondWithObjectIfAcceptable, K as RespondWithObjectOptions, L as TaskDefinition, M as FederationOrigin, Mt as SenderKeyPair, N as FederationQueueOptions, Nt as PageItems, O as ObjectCallbackSetters, Ot as UnverifiedActivityHandler, P as createFederation, Pt as buildCollectionSynchronizationHeader, Q as CircuitBreakerCreateOptions, R as TaskDefinitionOptions, S as FederationOptions, St as ObjectDispatcher, T as IdempotencyStrategy, Tt as OutboxListenerErrorHandler, U as RetryContext, V as TaskRegistry, W as RetryPolicy, X as CircuitBreakerActivityDrop, Y as CircuitBreaker, Z as CircuitBreakerBeforeSendDecision, _ as Federatable, _t as CustomCollectionDispatcher, a as GetSignedKeyOptions, at as normalizeCircuitBreakerOptions, b as FederationBuilder, bt as NodeInfoDispatcher, c as ParseUriResult, ct as ActorDispatcher, d as SendActivityOptions, dt as AuthorizePredicate, et as CircuitBreakerKvState, f as SendActivityOptionsForCollection, ft as CollectionCounter, g as CustomCollectionCallbackSetters, gt as CustomCollectionCursor, h as ConstructorWithTypeId, ht as CustomCollectionCounter, i as GetActorOptions, it as NormalizedCircuitBreakerOptions, j as FederationKvPrefixes, jt as SendActivityError, k as OutboxListenerSetters, kt as UnverifiedActivityReason, l as RequestContext, lt as ActorHandleMapper, m as CollectionCallbackSetters, mt as CollectionDispatcher, n as Context, nt as CircuitBreakerState, o as InboxContext, ot as parseCircuitBreakerKvState, p as ActorCallbackSetters, pt as CollectionCursor, q as respondWithObject, r as ForwardActivityOptions, rt as CircuitBreakerStateChange, s as OutboxContext, st as ActorAliasMapper, t as ActorKeyPair, tt as CircuitBreakerOptions, u as RouteActivityOptions, ut as ActorKeyPairsDispatcher, v as Federation, vt as InboxErrorHandler, w as IdempotencyKeyCallback, wt as OutboxListener, x as FederationFetchOptions, xt as ObjectAuthorizePredicate, y as FederationBenchmarkOptions, yt as InboxListener, z as TaskEnqueueOptions } from "./context-CYF8X0ft.cjs";
|
|
6
6
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
7
|
-
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-
|
|
7
|
+
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-DXMt_qCY.cjs";
|
|
8
8
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
9
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-BHEB3xhE.cjs";
|
|
10
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-B0hW12_O.cjs";
|
|
11
11
|
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-yvIXFAEi.cjs";
|
|
12
12
|
export * from "@fedify/vocab-runtime";
|
|
13
13
|
|
|
14
14
|
//#region src/mod.d.ts
|
|
15
15
|
declare namespace mod_d_exports {
|
|
16
|
-
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
16
|
+
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, 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, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
19
|
+
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, 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, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/mod.d.ts
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
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-CSddvgWN.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-lf8Hsd91.js";
|
|
4
4
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
|
|
5
|
-
import { $ as
|
|
5
|
+
import { $ as CircuitBreakerFailurePolicy, A as Rfc6570Expression, At as WebFingerLinksDispatcher, B as TaskHandler, C as FederationStartQueueOptions, Ct as OutboxErrorHandler, D as InboxListenerSetters, Dt as SharedInboxKeyDispatcher, E as InboxChallengePolicy, Et as OutboxPermanentFailureHandler, F as Message, Ft as digest, G as createExponentialBackoffPolicy, H as CreateExponentialBackoffPolicyOptions, I as createFederationBuilder, It as ActivityTransformer, J as respondWithObjectIfAcceptable, K as RespondWithObjectOptions, L as TaskDefinition, M as FederationOrigin, Mt as SenderKeyPair, N as FederationQueueOptions, Nt as PageItems, O as ObjectCallbackSetters, Ot as UnverifiedActivityHandler, P as createFederation, Pt as buildCollectionSynchronizationHeader, Q as CircuitBreakerCreateOptions, R as TaskDefinitionOptions, S as FederationOptions, St as ObjectDispatcher, T as IdempotencyStrategy, Tt as OutboxListenerErrorHandler, U as RetryContext, V as TaskRegistry, W as RetryPolicy, X as CircuitBreakerActivityDrop, Y as CircuitBreaker, Z as CircuitBreakerBeforeSendDecision, _ as Federatable, _t as CustomCollectionDispatcher, a as GetSignedKeyOptions, at as normalizeCircuitBreakerOptions, b as FederationBuilder, bt as NodeInfoDispatcher, c as ParseUriResult, ct as ActorDispatcher, d as SendActivityOptions, dt as AuthorizePredicate, et as CircuitBreakerKvState, f as SendActivityOptionsForCollection, ft as CollectionCounter, g as CustomCollectionCallbackSetters, gt as CustomCollectionCursor, h as ConstructorWithTypeId, ht as CustomCollectionCounter, i as GetActorOptions, it as NormalizedCircuitBreakerOptions, j as FederationKvPrefixes, jt as SendActivityError, k as OutboxListenerSetters, kt as UnverifiedActivityReason, l as RequestContext, lt as ActorHandleMapper, m as CollectionCallbackSetters, mt as CollectionDispatcher, n as Context, nt as CircuitBreakerState, o as InboxContext, ot as parseCircuitBreakerKvState, p as ActorCallbackSetters, pt as CollectionCursor, q as respondWithObject, r as ForwardActivityOptions, rt as CircuitBreakerStateChange, s as OutboxContext, st as ActorAliasMapper, t as ActorKeyPair, tt as CircuitBreakerOptions, u as RouteActivityOptions, ut as ActorKeyPairsDispatcher, v as Federation, vt as InboxErrorHandler, w as IdempotencyKeyCallback, wt as OutboxListener, x as FederationFetchOptions, xt as ObjectAuthorizePredicate, y as FederationBenchmarkOptions, yt as InboxListener, z as TaskEnqueueOptions } from "./context-BF5B4ZDk.js";
|
|
6
6
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
|
|
7
|
-
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-
|
|
7
|
+
import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-B5_hohs7.js";
|
|
8
8
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
9
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-
|
|
9
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-4WGAuR6X.js";
|
|
10
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-COIAjwRS.js";
|
|
11
11
|
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DFvNJcNb.js";
|
|
12
12
|
export * from "@fedify/vocab-runtime";
|
|
13
13
|
|
|
14
14
|
//#region src/mod.d.ts
|
|
15
15
|
declare namespace mod_d_exports {
|
|
16
|
-
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
16
|
+
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, 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, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, Protocol, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, Rfc9421SignRequestOptions, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, Services, SharedInboxKeyDispatcher, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, Software, UnverifiedActivityHandler, UnverifiedActivityReason, Usage, VerifyJsonLdOptions, VerifyObjectOptions, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
|
19
|
+
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, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfo, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboundService, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseNodeInfoOptions, ParseUriResult, 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, 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, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
|
package/dist/mod.js
CHANGED
|
@@ -3,12 +3,12 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
|
3
3
|
import "./chunk-CRNNMoPX.js";
|
|
4
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 formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "./http-
|
|
7
|
-
import { a as
|
|
8
|
-
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-
|
|
6
|
+
import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "./http-CrZzUAtV.js";
|
|
7
|
+
import { a as ParallelMessageQueue, c as respondWithObject, d as digest, f as CircuitBreaker, h as createFederationBuilder, i as InProcessMessageQueue, l as respondWithObjectIfAcceptable, m as parseCircuitBreakerKvState, o as createExponentialBackoffPolicy, p as normalizeCircuitBreakerOptions, r as handleWebFinger, s as SendActivityError, t as createFederation, u as buildCollectionSynchronizationHeader } from "./middleware-lB4vtShP.js";
|
|
8
|
+
import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-BMcsi8q_.js";
|
|
9
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-
|
|
11
|
-
import {
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Ch_Zv5Yq.js";
|
|
11
|
+
import { MemoryKvStore, Router, RouterError } from "./federation/mod.js";
|
|
12
12
|
import "./nodeinfo/mod.js";
|
|
13
13
|
import "./runtime/mod.js";
|
|
14
14
|
import "./sig/mod.js";
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
//#region src/federation/mq.ts
|
|
5
|
+
/**
|
|
6
|
+
* A message queue that processes messages in the same process.
|
|
7
|
+
* Do not use this in production as it does neither persist messages nor
|
|
8
|
+
* distribute them across multiple processes.
|
|
9
|
+
*
|
|
10
|
+
* @since 0.5.0
|
|
11
|
+
*/
|
|
12
|
+
var InProcessMessageQueue = class {
|
|
13
|
+
#messages;
|
|
14
|
+
#monitors;
|
|
15
|
+
#pollIntervalMs;
|
|
16
|
+
#delayedMessages;
|
|
17
|
+
/**
|
|
18
|
+
* Tracks which ordering keys are currently being processed to ensure
|
|
19
|
+
* sequential processing for messages with the same key.
|
|
20
|
+
*/
|
|
21
|
+
#processingKeys;
|
|
22
|
+
/**
|
|
23
|
+
* In-process message queue does not provide native retry mechanisms.
|
|
24
|
+
* @since 1.7.0
|
|
25
|
+
*/
|
|
26
|
+
nativeRetrial = false;
|
|
27
|
+
/**
|
|
28
|
+
* In-process message queue does not deduplicate messages natively.
|
|
29
|
+
* @since 2.4.0
|
|
30
|
+
*/
|
|
31
|
+
nativeDeduplication = false;
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
34
|
+
* @param options Additional options for the in-process message queue.
|
|
35
|
+
*/
|
|
36
|
+
constructor(options = {}) {
|
|
37
|
+
this.#messages = [];
|
|
38
|
+
this.#monitors = {};
|
|
39
|
+
this.#pollIntervalMs = Temporal.Duration.from(options.pollInterval ?? { seconds: 5 }).total("millisecond");
|
|
40
|
+
this.#delayedMessages = 0;
|
|
41
|
+
this.#processingKeys = /* @__PURE__ */ new Set();
|
|
42
|
+
}
|
|
43
|
+
enqueue(message, options) {
|
|
44
|
+
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
|
45
|
+
if (delay > 0) {
|
|
46
|
+
this.#delayedMessages++;
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
this.#delayedMessages--;
|
|
49
|
+
this.#enqueueReady(message, options);
|
|
50
|
+
}, delay);
|
|
51
|
+
return Promise.resolve();
|
|
52
|
+
}
|
|
53
|
+
this.#enqueueReady(message, options);
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
}
|
|
56
|
+
#enqueueReady(message, options) {
|
|
57
|
+
const orderingKey = options?.orderingKey ?? null;
|
|
58
|
+
this.#messages.push({
|
|
59
|
+
message,
|
|
60
|
+
orderingKey
|
|
61
|
+
});
|
|
62
|
+
this.#notifyMonitors();
|
|
63
|
+
}
|
|
64
|
+
#notifyMonitors() {
|
|
65
|
+
for (const monitorId in this.#monitors) this.#monitors[monitorId]();
|
|
66
|
+
}
|
|
67
|
+
enqueueMany(messages, options) {
|
|
68
|
+
if (messages.length === 0) return Promise.resolve();
|
|
69
|
+
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
|
70
|
+
if (delay > 0) {
|
|
71
|
+
const delayedCount = messages.length;
|
|
72
|
+
const deferredMessages = [...messages];
|
|
73
|
+
this.#delayedMessages += delayedCount;
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
this.#delayedMessages -= delayedCount;
|
|
76
|
+
this.#enqueueManyReady(deferredMessages, options);
|
|
77
|
+
}, delay);
|
|
78
|
+
return Promise.resolve();
|
|
79
|
+
}
|
|
80
|
+
this.#enqueueManyReady(messages, options);
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
#enqueueManyReady(messages, options) {
|
|
84
|
+
const orderingKey = options?.orderingKey ?? null;
|
|
85
|
+
for (const message of messages) this.#messages.push({
|
|
86
|
+
message,
|
|
87
|
+
orderingKey
|
|
88
|
+
});
|
|
89
|
+
this.#notifyMonitors();
|
|
90
|
+
}
|
|
91
|
+
async listen(handler, options = {}) {
|
|
92
|
+
const signal = options.signal;
|
|
93
|
+
while (signal == null || !signal.aborted) {
|
|
94
|
+
const idx = this.#messages.findIndex((m) => m.orderingKey == null || !this.#processingKeys.has(m.orderingKey));
|
|
95
|
+
if (idx >= 0) {
|
|
96
|
+
const { message, orderingKey } = this.#messages.splice(idx, 1)[0];
|
|
97
|
+
if (orderingKey != null) this.#processingKeys.add(orderingKey);
|
|
98
|
+
try {
|
|
99
|
+
await handler(message);
|
|
100
|
+
} finally {
|
|
101
|
+
if (orderingKey != null) this.#processingKeys.delete(orderingKey);
|
|
102
|
+
}
|
|
103
|
+
} else if (this.#messages.length === 0) await this.#wait(this.#pollIntervalMs, signal);
|
|
104
|
+
else await this.#wait(10, signal);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
getDepth() {
|
|
108
|
+
const ready = this.#messages.length;
|
|
109
|
+
const delayed = this.#delayedMessages;
|
|
110
|
+
return Promise.resolve({
|
|
111
|
+
queued: ready + delayed,
|
|
112
|
+
ready,
|
|
113
|
+
delayed
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
#wait(ms, signal) {
|
|
117
|
+
let timer = null;
|
|
118
|
+
return Promise.any([new Promise((resolve) => {
|
|
119
|
+
signal?.addEventListener("abort", () => {
|
|
120
|
+
if (timer != null) clearTimeout(timer);
|
|
121
|
+
resolve();
|
|
122
|
+
}, { once: true });
|
|
123
|
+
const monitorId = crypto.randomUUID();
|
|
124
|
+
this.#monitors[monitorId] = () => {
|
|
125
|
+
delete this.#monitors[monitorId];
|
|
126
|
+
if (timer != null) clearTimeout(timer);
|
|
127
|
+
resolve();
|
|
128
|
+
};
|
|
129
|
+
}), new Promise((resolve) => timer = setTimeout(resolve, ms))]);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* A message queue that processes messages in parallel. It takes another
|
|
134
|
+
* {@link MessageQueue}, and processes messages in parallel up to a certain
|
|
135
|
+
* number of workers.
|
|
136
|
+
*
|
|
137
|
+
* Actually, it's rather a decorator than a queue itself.
|
|
138
|
+
*
|
|
139
|
+
* Note that the workers do not run in truly parallel, in the sense that they
|
|
140
|
+
* are not running in separate threads or processes. They are running in the
|
|
141
|
+
* same process, but are scheduled to run in parallel. Hence, this is useful
|
|
142
|
+
* for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
|
|
143
|
+
* workloads.
|
|
144
|
+
*
|
|
145
|
+
* When using `ParallelMessageQueue`, the ordering guarantee is preserved
|
|
146
|
+
* *only if* the underlying queue implementation delivers messages in a wrapper
|
|
147
|
+
* format that includes the `__fedify_ordering_key__` property. Currently,
|
|
148
|
+
* only `DenoKvMessageQueue` and `WorkersMessageQueue` use this format.
|
|
149
|
+
* For other queue implementations (e.g., `InProcessMessageQueue`,
|
|
150
|
+
* `RedisMessageQueue`, `PostgresMessageQueue`, `SqliteMessageQueue`,
|
|
151
|
+
* `AmqpMessageQueue`), the ordering key cannot be detected by
|
|
152
|
+
* `ParallelMessageQueue`, so ordering guarantees are handled by those
|
|
153
|
+
* implementations directly rather than at the `ParallelMessageQueue` level.
|
|
154
|
+
*
|
|
155
|
+
* Messages with the same ordering key will never be processed concurrently
|
|
156
|
+
* by different workers, ensuring sequential processing within each key.
|
|
157
|
+
* Messages with different ordering keys (or no ordering key) can still be
|
|
158
|
+
* processed in parallel.
|
|
159
|
+
*
|
|
160
|
+
* @since 1.0.0
|
|
161
|
+
*/
|
|
162
|
+
var ParallelMessageQueue = class ParallelMessageQueue {
|
|
163
|
+
queue;
|
|
164
|
+
workers;
|
|
165
|
+
/**
|
|
166
|
+
* Inherits the native retry capability from the wrapped queue.
|
|
167
|
+
* @since 1.7.0
|
|
168
|
+
*/
|
|
169
|
+
nativeRetrial;
|
|
170
|
+
/**
|
|
171
|
+
* Inherits the native deduplication capability from the wrapped queue.
|
|
172
|
+
* @since 2.4.0
|
|
173
|
+
*/
|
|
174
|
+
nativeDeduplication;
|
|
175
|
+
getDepth;
|
|
176
|
+
/**
|
|
177
|
+
* Tracks which ordering keys are currently being processed to ensure
|
|
178
|
+
* sequential processing for messages with the same key.
|
|
179
|
+
*/
|
|
180
|
+
#processingKeys = /* @__PURE__ */ new Set();
|
|
181
|
+
/**
|
|
182
|
+
* Pending messages waiting for their ordering key to become available.
|
|
183
|
+
*/
|
|
184
|
+
#pendingMessages = [];
|
|
185
|
+
/**
|
|
186
|
+
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
187
|
+
* number of workers.
|
|
188
|
+
* @param queue The message queue to use under the hood. Note that
|
|
189
|
+
* {@link ParallelMessageQueue} cannot be nested.
|
|
190
|
+
* @param workers The number of workers to process messages in parallel.
|
|
191
|
+
* @throws {TypeError} If the given queue is an instance of
|
|
192
|
+
* {@link ParallelMessageQueue}.
|
|
193
|
+
*/
|
|
194
|
+
constructor(queue, workers) {
|
|
195
|
+
if (queue instanceof ParallelMessageQueue) throw new TypeError("Cannot nest ParallelMessageQueue.");
|
|
196
|
+
this.queue = queue;
|
|
197
|
+
this.workers = workers;
|
|
198
|
+
this.nativeRetrial = queue.nativeRetrial;
|
|
199
|
+
this.nativeDeduplication = queue.nativeDeduplication;
|
|
200
|
+
if (queue.getDepth != null) this.getDepth = () => queue.getDepth();
|
|
201
|
+
}
|
|
202
|
+
enqueue(message, options) {
|
|
203
|
+
return this.queue.enqueue(message, options);
|
|
204
|
+
}
|
|
205
|
+
async enqueueMany(messages, options) {
|
|
206
|
+
if (this.queue.enqueueMany == null) {
|
|
207
|
+
if (messages.length === 1) {
|
|
208
|
+
await this.queue.enqueue(messages[0], options);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (options?.deduplicationKey != null) throw new TypeError("Cannot enqueue a batch with a deduplicationKey: the wrapped queue does not implement enqueueMany, so ParallelMessageQueue would have to fan out to individual enqueue() calls that cannot share one deduplicationKey atomically. Wrap a queue that implements enqueueMany instead.");
|
|
212
|
+
const errors = (await Promise.allSettled(messages.map((message) => this.queue.enqueue(message, options)))).filter((r) => r.status === "rejected").map((r) => r.reason);
|
|
213
|
+
if (errors.length > 1) throw new AggregateError(errors, "Failed to enqueue messages.");
|
|
214
|
+
else if (errors.length === 1) throw errors[0];
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
await this.queue.enqueueMany(messages, options);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Extracts ordering key from a message if present.
|
|
221
|
+
*
|
|
222
|
+
* This method only works for queue implementations that deliver messages
|
|
223
|
+
* in the wrapper format with `__fedify_ordering_key__` property. Currently,
|
|
224
|
+
* only `DenoKvMessageQueue` and `WorkersMessageQueue` use this format.
|
|
225
|
+
*
|
|
226
|
+
* For other queue implementations (`InProcessMessageQueue`,
|
|
227
|
+
* `RedisMessageQueue`, `PostgresMessageQueue`, `SqliteMessageQueue`,
|
|
228
|
+
* `AmqpMessageQueue`), messages are delivered as raw payloads without the
|
|
229
|
+
* wrapper, so the ordering key cannot be detected here. Those
|
|
230
|
+
* implementations handle ordering guarantees internally.
|
|
231
|
+
*/
|
|
232
|
+
#extractOrderingKey(message) {
|
|
233
|
+
if (message != null && typeof message === "object") {
|
|
234
|
+
if ("__fedify_ordering_key__" in message) return message.__fedify_ordering_key__;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
listen(handler, options = {}) {
|
|
238
|
+
const workers = /* @__PURE__ */ new Map();
|
|
239
|
+
return this.queue.listen(async (message) => {
|
|
240
|
+
while (workers.size >= this.workers) {
|
|
241
|
+
const consumedId = await Promise.any(workers.values());
|
|
242
|
+
workers.delete(consumedId);
|
|
243
|
+
}
|
|
244
|
+
const workerId = crypto.randomUUID();
|
|
245
|
+
const orderingKey = this.#extractOrderingKey(message);
|
|
246
|
+
if (orderingKey != null && this.#processingKeys.has(orderingKey)) await new Promise((resolve) => {
|
|
247
|
+
this.#pendingMessages.push({
|
|
248
|
+
message,
|
|
249
|
+
orderingKey,
|
|
250
|
+
resolve
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
if (orderingKey != null) this.#processingKeys.add(orderingKey);
|
|
254
|
+
const promise = this.#work(workerId, handler, message, orderingKey);
|
|
255
|
+
workers.set(workerId, promise);
|
|
256
|
+
}, options);
|
|
257
|
+
}
|
|
258
|
+
async #work(workerId, handler, message, orderingKey) {
|
|
259
|
+
await this.#sleep(0);
|
|
260
|
+
try {
|
|
261
|
+
await handler(message);
|
|
262
|
+
} finally {
|
|
263
|
+
if (orderingKey != null) {
|
|
264
|
+
this.#processingKeys.delete(orderingKey);
|
|
265
|
+
const pendingIdx = this.#pendingMessages.findIndex((p) => p.orderingKey === orderingKey);
|
|
266
|
+
if (pendingIdx >= 0) this.#pendingMessages.splice(pendingIdx, 1)[0].resolve();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return workerId;
|
|
270
|
+
}
|
|
271
|
+
#sleep(ms) {
|
|
272
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
//#endregion
|
|
276
|
+
export { ParallelMessageQueue as n, InProcessMessageQueue as t };
|
|
@@ -24,6 +24,19 @@ interface MessageQueueEnqueueOptions {
|
|
|
24
24
|
* @since 2.0.0
|
|
25
25
|
*/
|
|
26
26
|
readonly orderingKey?: string;
|
|
27
|
+
/**
|
|
28
|
+
* An optional key requesting at-most-once enqueue semantics for messages
|
|
29
|
+
* that share it. A backend that declares
|
|
30
|
+
* {@link MessageQueue.nativeDeduplication} `true` owns the check: a message
|
|
31
|
+
* whose `deduplicationKey` was already seen within the backend's
|
|
32
|
+
* deduplication window is dropped instead of enqueued. Backends without
|
|
33
|
+
* native deduplication ignore this field; Fedify performs its own
|
|
34
|
+
* best-effort deduplication before reaching them on the paths that support
|
|
35
|
+
* it.
|
|
36
|
+
*
|
|
37
|
+
* @since 2.4.0
|
|
38
|
+
*/
|
|
39
|
+
readonly deduplicationKey?: string;
|
|
27
40
|
}
|
|
28
41
|
/**
|
|
29
42
|
* Additional options for listening to a message queue.
|
|
@@ -81,6 +94,17 @@ interface MessageQueue {
|
|
|
81
94
|
*/
|
|
82
95
|
readonly nativeRetrial?: boolean;
|
|
83
96
|
/**
|
|
97
|
+
* Whether the message queue backend deduplicates messages that share a
|
|
98
|
+
* {@link MessageQueueEnqueueOptions.deduplicationKey} natively. When `true`,
|
|
99
|
+
* Fedify forwards the `deduplicationKey` and relies on the backend to drop
|
|
100
|
+
* duplicates; when `false` or omitted, Fedify applies its own best-effort
|
|
101
|
+
* key–value deduplication on the paths that request it.
|
|
102
|
+
*
|
|
103
|
+
* @default `false`
|
|
104
|
+
* @since 2.4.0
|
|
105
|
+
*/
|
|
106
|
+
readonly nativeDeduplication?: boolean;
|
|
107
|
+
/**
|
|
84
108
|
* Enqueues a message in the queue.
|
|
85
109
|
* @param message The message to enqueue.
|
|
86
110
|
* @param options Additional options for enqueuing the message.
|
|
@@ -141,6 +165,11 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
141
165
|
*/
|
|
142
166
|
readonly nativeRetrial = false;
|
|
143
167
|
/**
|
|
168
|
+
* In-process message queue does not deduplicate messages natively.
|
|
169
|
+
* @since 2.4.0
|
|
170
|
+
*/
|
|
171
|
+
readonly nativeDeduplication = false;
|
|
172
|
+
/**
|
|
144
173
|
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
145
174
|
* @param options Additional options for the in-process message queue.
|
|
146
175
|
*/
|
|
@@ -189,6 +218,11 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
189
218
|
* @since 1.7.0
|
|
190
219
|
*/
|
|
191
220
|
readonly nativeRetrial?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Inherits the native deduplication capability from the wrapped queue.
|
|
223
|
+
* @since 2.4.0
|
|
224
|
+
*/
|
|
225
|
+
readonly nativeDeduplication?: boolean;
|
|
192
226
|
readonly getDepth?: () => Promise<MessageQueueDepth>;
|
|
193
227
|
/**
|
|
194
228
|
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
@@ -24,6 +24,19 @@ interface MessageQueueEnqueueOptions {
|
|
|
24
24
|
* @since 2.0.0
|
|
25
25
|
*/
|
|
26
26
|
readonly orderingKey?: string;
|
|
27
|
+
/**
|
|
28
|
+
* An optional key requesting at-most-once enqueue semantics for messages
|
|
29
|
+
* that share it. A backend that declares
|
|
30
|
+
* {@link MessageQueue.nativeDeduplication} `true` owns the check: a message
|
|
31
|
+
* whose `deduplicationKey` was already seen within the backend's
|
|
32
|
+
* deduplication window is dropped instead of enqueued. Backends without
|
|
33
|
+
* native deduplication ignore this field; Fedify performs its own
|
|
34
|
+
* best-effort deduplication before reaching them on the paths that support
|
|
35
|
+
* it.
|
|
36
|
+
*
|
|
37
|
+
* @since 2.4.0
|
|
38
|
+
*/
|
|
39
|
+
readonly deduplicationKey?: string;
|
|
27
40
|
}
|
|
28
41
|
/**
|
|
29
42
|
* Additional options for listening to a message queue.
|
|
@@ -81,6 +94,17 @@ interface MessageQueue {
|
|
|
81
94
|
*/
|
|
82
95
|
readonly nativeRetrial?: boolean;
|
|
83
96
|
/**
|
|
97
|
+
* Whether the message queue backend deduplicates messages that share a
|
|
98
|
+
* {@link MessageQueueEnqueueOptions.deduplicationKey} natively. When `true`,
|
|
99
|
+
* Fedify forwards the `deduplicationKey` and relies on the backend to drop
|
|
100
|
+
* duplicates; when `false` or omitted, Fedify applies its own best-effort
|
|
101
|
+
* key–value deduplication on the paths that request it.
|
|
102
|
+
*
|
|
103
|
+
* @default `false`
|
|
104
|
+
* @since 2.4.0
|
|
105
|
+
*/
|
|
106
|
+
readonly nativeDeduplication?: boolean;
|
|
107
|
+
/**
|
|
84
108
|
* Enqueues a message in the queue.
|
|
85
109
|
* @param message The message to enqueue.
|
|
86
110
|
* @param options Additional options for enqueuing the message.
|
|
@@ -141,6 +165,11 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
141
165
|
*/
|
|
142
166
|
readonly nativeRetrial = false;
|
|
143
167
|
/**
|
|
168
|
+
* In-process message queue does not deduplicate messages natively.
|
|
169
|
+
* @since 2.4.0
|
|
170
|
+
*/
|
|
171
|
+
readonly nativeDeduplication = false;
|
|
172
|
+
/**
|
|
144
173
|
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
145
174
|
* @param options Additional options for the in-process message queue.
|
|
146
175
|
*/
|
|
@@ -189,6 +218,11 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
189
218
|
* @since 1.7.0
|
|
190
219
|
*/
|
|
191
220
|
readonly nativeRetrial?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Inherits the native deduplication capability from the wrapped queue.
|
|
223
|
+
* @since 2.4.0
|
|
224
|
+
*/
|
|
225
|
+
readonly nativeDeduplication?: boolean;
|
|
192
226
|
readonly getDepth?: () => Promise<MessageQueueDepth>;
|
|
193
227
|
/**
|
|
194
228
|
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
@@ -2,9 +2,9 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-vrlUxr60.mjs";
|
|
5
|
-
import { t as assertEquals } from "../assert_equals-
|
|
6
|
-
import "../std__assert-
|
|
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-
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-PBVKNMJd.mjs";
|
|
6
|
+
import "../std__assert-Dh6uLf_q.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-
|
|
5
|
-
import { t as
|
|
6
|
-
import "../
|
|
7
|
-
import
|
|
8
|
-
import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-
|
|
4
|
+
import { r as createRequestContext } from "../context-BBRTgkrs.mjs";
|
|
5
|
+
import { t as MemoryKvStore } from "../kv-CIvR3Non.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-PBVKNMJd.mjs";
|
|
7
|
+
import "../std__assert-Dh6uLf_q.mjs";
|
|
8
|
+
import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-iP9VRMus.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|