@fedify/fedify 2.4.0-dev.1567 → 2.4.0-dev.1570
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 +4 -0
- 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-DGWCUaNQ.mjs → builder-CJnWbgbj.mjs} +23 -3
- package/dist/codec-nfBU4Up4.mjs +124 -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-BBVLF7lx.d.cts → context-BLe0NPtZ.d.cts} +530 -259
- package/dist/{context-BU6jSQdo.d.ts → context-GfQA-CqB.d.ts} +529 -259
- package/dist/{deno-Dho0TW0X.mjs → deno-klNxGW7W.mjs} +1 -1
- package/dist/{docloader-DCQSgDOg.mjs → docloader-CuFH35j1.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 -23
- 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 +204 -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 +302 -0
- package/dist/federation/tasks/enqueue.test.d.mts +2 -0
- package/dist/federation/tasks/enqueue.test.mjs +1057 -0
- package/dist/federation/tasks/tasks.test.d.mts +2 -0
- package/dist/federation/tasks/tasks.test.mjs +1228 -0
- package/dist/federation/temporal.test.mjs +4 -4
- package/dist/federation/webfinger.test.mjs +6 -6
- package/dist/{http-sngIMb9S.js → http-D0jH0kco.js} +16 -80
- package/dist/{http-C7Lot0it.cjs → http-DeuPW1Oh.cjs} +14 -78
- package/dist/{http-Bf8YhWOi.mjs → http-JdRPUYku.mjs} +4 -4
- package/dist/{key-3rYgSl9f.mjs → key-o0_ipvUR.mjs} +10 -76
- package/dist/{kv-cache-CO2IaDJu.cjs → kv-cache-C3rqzQvu.cjs} +1 -1
- package/dist/{kv-cache-P3scUO6t.mjs → kv-cache-CM7w20U5.mjs} +1 -1
- package/dist/{kv-cache-B0siRaoZ.js → kv-cache-DSWq2JHU.js} +1 -1
- package/dist/{ld-CCOPy-Co.mjs → ld-C__CEgQH.mjs} +3 -3
- package/dist/{metrics-CR4UD_gF.mjs → metrics-CLSPm4dZ.mjs} +8 -6
- package/dist/{mq-D-nlpY04.d.ts → metrics-CoUJLQhZ.d.cts} +69 -1
- package/dist/{mq-D8uSFzxe.d.cts → metrics-Dc4jR-IC.d.ts} +69 -1
- package/dist/{middleware-DUelXs9h.cjs → middleware-B502nwxx.cjs} +874 -134
- package/dist/{middleware-CIteB8IS.mjs → middleware-CdMiavoh.mjs} +1 -1
- package/dist/{middleware-DfBPuuvp.mjs → middleware-CjHqy-1i.mjs} +469 -150
- package/dist/{middleware-BoNiH9CQ.js → middleware-zuLSkPIk.js} +863 -135
- package/dist/{mod-C0F6kvgS.d.cts → mod-B8Efb9qp.d.cts} +1 -1
- package/dist/{mod-yvIXFAEi.d.cts → mod-BtEaIEcD.d.cts} +1 -31
- package/dist/{mod-vPYVoa5n.d.ts → mod-Cmr39iWq.d.ts} +1 -1
- package/dist/{mod-DFvNJcNb.d.ts → mod-UMmveiO0.d.ts} +1 -31
- package/dist/mod.cjs +6 -6
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +5 -5
- package/dist/mq-03vS-C9P.mjs +276 -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-TUz_H-M9.mjs → owner-gz4TUfKG.mjs} +2 -2
- package/dist/{proof-DzKUmE7R.cjs → proof-CiDzRtr0.cjs} +1 -1
- package/dist/{proof-CrI3UpuA.mjs → proof-CuQpZ_AT.mjs} +5 -5
- package/dist/{proof-C5i7MhbD.js → proof-DQWTf6oB.js} +1 -1
- package/dist/{send-BBs_erdP.mjs → send-B60teucv.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 +7 -191
- 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 +9 -69
- package/dist/{std__assert-BBjXFNOb.mjs → std__assert-Dh6uLf_q.mjs} +4 -4
- package/dist/{temporal-bBIy2G-F.mjs → temporal-CvVMrvJJ.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.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +8 -6
- /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-BLe0NPtZ.cjs";
|
|
3
3
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
4
4
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
5
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-VyDTd4G3.cjs";
|
|
3
3
|
import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
|
|
4
|
+
import { t as DocumentFetchKind } from "./metrics-CoUJLQhZ.cjs";
|
|
4
5
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
|
5
6
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
6
7
|
|
|
@@ -48,37 +49,6 @@ declare function getAuthenticatedDocumentLoader(identity: {
|
|
|
48
49
|
tracerProvider
|
|
49
50
|
}?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
|
|
50
51
|
//#endregion
|
|
51
|
-
//#region src/federation/metrics.d.ts
|
|
52
|
-
/**
|
|
53
|
-
* The kind of remote ActivityPub lookup, recorded as
|
|
54
|
-
* `activitypub.lookup.kind` on the public-key lookup and remote document
|
|
55
|
-
* fetch metric families.
|
|
56
|
-
*
|
|
57
|
-
* - `public_key`: a public key lookup performed by `fetchKey` /
|
|
58
|
-
* `fetchKeyDetailed` (always recorded on `activitypub.key.lookup*`).
|
|
59
|
-
* - `actor`: a document fetch whose resolved value is an Actor. The
|
|
60
|
-
* bucket exists in the taxonomy for future actor-aware call sites;
|
|
61
|
-
* today, actor documents fetched through Fedify's generic document
|
|
62
|
-
* loader are still classified as `object` because the kind is decided
|
|
63
|
-
* at the loader boundary, before the response is parsed.
|
|
64
|
-
* - `object`: a generic ActivityPub object fetch through Fedify's
|
|
65
|
-
* document loader. This is the default classification for
|
|
66
|
-
* `documentLoader` invocations that do not match a more specific
|
|
67
|
-
* bucket.
|
|
68
|
-
* - `context`: a JSON-LD `@context` document fetch through Fedify's
|
|
69
|
-
* context loader.
|
|
70
|
-
* - `other`: a fetch that does not fit any of the above classifications.
|
|
71
|
-
* @since 2.3.0
|
|
72
|
-
*/
|
|
73
|
-
type LookupKind = "public_key" | "actor" | "object" | "context" | "other";
|
|
74
|
-
/**
|
|
75
|
-
* The {@link LookupKind} values that can appear on remote document fetch
|
|
76
|
-
* metrics. `public_key` lookups are reported on the
|
|
77
|
-
* `activitypub.key.lookup` metric family instead, so it is excluded here.
|
|
78
|
-
* @since 2.3.0
|
|
79
|
-
*/
|
|
80
|
-
type DocumentFetchKind = Exclude<LookupKind, "public_key">;
|
|
81
|
-
//#endregion
|
|
82
52
|
//#region src/utils/kv-cache.d.ts
|
|
83
53
|
/**
|
|
84
54
|
* The parameters for {@link kvCache} function.
|
|
@@ -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-GfQA-CqB.js";
|
|
3
3
|
import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
|
|
4
4
|
import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
|
|
5
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { n as HttpMessageSignaturesSpecDeterminer } from "./http-lf8Hsd91.js";
|
|
3
3
|
import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
|
|
4
|
+
import { t as DocumentFetchKind } from "./metrics-Dc4jR-IC.js";
|
|
4
5
|
import { MeterProvider, TracerProvider } from "@opentelemetry/api";
|
|
5
6
|
import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
|
|
6
7
|
|
|
@@ -48,37 +49,6 @@ declare function getAuthenticatedDocumentLoader(identity: {
|
|
|
48
49
|
tracerProvider
|
|
49
50
|
}?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
|
|
50
51
|
//#endregion
|
|
51
|
-
//#region src/federation/metrics.d.ts
|
|
52
|
-
/**
|
|
53
|
-
* The kind of remote ActivityPub lookup, recorded as
|
|
54
|
-
* `activitypub.lookup.kind` on the public-key lookup and remote document
|
|
55
|
-
* fetch metric families.
|
|
56
|
-
*
|
|
57
|
-
* - `public_key`: a public key lookup performed by `fetchKey` /
|
|
58
|
-
* `fetchKeyDetailed` (always recorded on `activitypub.key.lookup*`).
|
|
59
|
-
* - `actor`: a document fetch whose resolved value is an Actor. The
|
|
60
|
-
* bucket exists in the taxonomy for future actor-aware call sites;
|
|
61
|
-
* today, actor documents fetched through Fedify's generic document
|
|
62
|
-
* loader are still classified as `object` because the kind is decided
|
|
63
|
-
* at the loader boundary, before the response is parsed.
|
|
64
|
-
* - `object`: a generic ActivityPub object fetch through Fedify's
|
|
65
|
-
* document loader. This is the default classification for
|
|
66
|
-
* `documentLoader` invocations that do not match a more specific
|
|
67
|
-
* bucket.
|
|
68
|
-
* - `context`: a JSON-LD `@context` document fetch through Fedify's
|
|
69
|
-
* context loader.
|
|
70
|
-
* - `other`: a fetch that does not fit any of the above classifications.
|
|
71
|
-
* @since 2.3.0
|
|
72
|
-
*/
|
|
73
|
-
type LookupKind = "public_key" | "actor" | "object" | "context" | "other";
|
|
74
|
-
/**
|
|
75
|
-
* The {@link LookupKind} values that can appear on remote document fetch
|
|
76
|
-
* metrics. `public_key` lookups are reported on the
|
|
77
|
-
* `activitypub.key.lookup` metric family instead, so it is excluded here.
|
|
78
|
-
* @since 2.3.0
|
|
79
|
-
*/
|
|
80
|
-
type DocumentFetchKind = Exclude<LookupKind, "public_key">;
|
|
81
|
-
//#endregion
|
|
82
52
|
//#region src/utils/kv-cache.d.ts
|
|
83
53
|
/**
|
|
84
54
|
* The parameters for {@link kvCache} function.
|
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-DeuPW1Oh.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-B502nwxx.cjs");
|
|
9
|
+
const require_proof = require("./proof-CiDzRtr0.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-C3rqzQvu.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-BLe0NPtZ.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
|
|
7
|
+
import { a as MessageQueueDepth, c as ParallelMessageQueue, i as MessageQueue, n as InProcessMessageQueue, o as MessageQueueEnqueueOptions, r as InProcessMessageQueueOptions, s as MessageQueueListenOptions } from "./metrics-CoUJLQhZ.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-B8Efb9qp.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
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
11
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BtEaIEcD.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-GfQA-CqB.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
|
|
7
|
+
import { a as MessageQueueDepth, c as ParallelMessageQueue, i as MessageQueue, n as InProcessMessageQueue, o as MessageQueueEnqueueOptions, r as InProcessMessageQueueOptions, s as MessageQueueListenOptions } from "./metrics-Dc4jR-IC.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-Cmr39iWq.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
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-
|
|
11
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-UMmveiO0.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-D0jH0kco.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-zuLSkPIk.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-DQWTf6oB.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-DSWq2JHU.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 };
|
|
@@ -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-CjHqy-1i.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertThrows } from "../assert_throws-
|
|
7
|
-
import { t as nodeInfoToJson } from "../types-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-PBVKNMJd.mjs";
|
|
5
|
+
import "../std__assert-Dh6uLf_q.mjs";
|
|
6
|
+
import { t as assertThrows } from "../assert_throws-zN79lgIC.mjs";
|
|
7
|
+
import { t as nodeInfoToJson } from "../types-BFowWFTT.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/nodeinfo/types.test.ts
|
|
10
10
|
test("nodeInfoToJson()", () => {
|