@fedify/fedify 2.3.0-dev.1005 → 2.3.0-dev.1021
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/dist/{builder-gAB0htof.mjs → builder-Nn2r1dKd.mjs} +13 -3
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-DJGagtNd.d.cts → context-Bxs4cdIZ.d.cts} +53 -1
- package/dist/{context-BzH2-ajs.d.ts → context-CVNXcFHR.d.ts} +53 -1
- package/dist/{deno-4f2FzBe9.mjs → deno-BnQyJ03o.mjs} +1 -1
- package/dist/{docloader-B3ZVRe6e.mjs → docloader-mEJ3hsMB.mjs} +2 -2
- package/dist/federation/builder.test.mjs +7 -2
- package/dist/federation/handler.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +41 -9
- package/dist/federation/mod.cjs +38 -12
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +38 -12
- package/dist/federation/mq.test.mjs +172 -11
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-CcfcE8N4.js → http-BJ-t29n_.js} +1 -1
- package/dist/{http-Cy2mQS66.mjs → http-CfToB_iu.mjs} +2 -2
- package/dist/{http-JLLWZX_d.cjs → http-D4xMqSqO.cjs} +1 -1
- package/dist/{key-eKxvr-C4.mjs → key-CeANlo1H.mjs} +1 -1
- package/dist/{kv-cache-YWK2pfn_.js → kv-cache-B142kDZL.js} +1 -1
- package/dist/{kv-cache-BbFjDt5I.cjs → kv-cache-DRwOjOkl.cjs} +1 -1
- package/dist/{ld-D2sVtqAV.mjs → ld-CUlVC-TS.mjs} +2 -2
- package/dist/{middleware-cbXddGIi.cjs → middleware-ASvK22Do.cjs} +1 -1
- package/dist/{middleware-BjvwtKjp.mjs → middleware-BPZEcrMG.mjs} +17 -14
- package/dist/{middleware-DZHQpJaI.mjs → middleware-Cgy7UwfR.mjs} +1 -1
- package/dist/{middleware-BiLI6cmz.js → middleware-CysDkaXo.js} +21 -8
- package/dist/{middleware-y5r1KhBz.cjs → middleware-I5XEZ_pZ.cjs} +22 -9
- package/dist/{mod-2d12ffz3.d.ts → mod-Bc6p4npy.d.ts} +1 -1
- package/dist/{mod-D35TRn09.d.cts → mod-zA6NZHUG.d.cts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/{owner-B6CaBwbr.mjs → owner-CuW0S2XY.mjs} +2 -2
- package/dist/{proof-DV85kS2-.mjs → proof-CFPGr1xC.mjs} +2 -2
- package/dist/{proof-DhE_ibsB.js → proof-CtMmqa09.js} +1 -1
- package/dist/{proof-DCrzgogM.cjs → proof-oGiWJkX0.cjs} +1 -1
- package/dist/{send-BjwIELCy.mjs → send-dhl-s8G0.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +1 -1
- package/dist/testing/mod.d.mts +12 -0
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
|
@@ -2,12 +2,13 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
+
import { n as version, t as name } from "./deno-BnQyJ03o.mjs";
|
|
6
6
|
import { t as ActivityListenerSet } from "./activity-listener-ell7W1s9.mjs";
|
|
7
7
|
import { Tombstone, getTypeId } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
//#region src/federation/builder.ts
|
|
11
|
+
const ACTOR_ALIAS_PREFIX = "actorAlias:";
|
|
11
12
|
function validateSingleIdentifierVariablePath(path, errorMessage) {
|
|
12
13
|
const operatorMatches = globalThis.Array.from(path.matchAll(/{([+#./;?&]?)([A-Za-z_][A-Za-z0-9_]*)}/g));
|
|
13
14
|
if (operatorMatches.length !== 1 || operatorMatches[0]?.[2] !== "identifier") throw new RouterError(errorMessage);
|
|
@@ -58,7 +59,7 @@ var FederationBuilderImpl = class {
|
|
|
58
59
|
this.collectionTypeIds = {};
|
|
59
60
|
}
|
|
60
61
|
async build(options) {
|
|
61
|
-
const { FederationImpl } = await import("./middleware-
|
|
62
|
+
const { FederationImpl } = await import("./middleware-Cgy7UwfR.mjs");
|
|
62
63
|
const f = new FederationImpl(options);
|
|
63
64
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
64
65
|
f.router = this.router.clone();
|
|
@@ -194,6 +195,15 @@ var FederationBuilderImpl = class {
|
|
|
194
195
|
callbacks.aliasMapper = mapper;
|
|
195
196
|
return setters;
|
|
196
197
|
},
|
|
198
|
+
mapActorAlias: (path, identifier) => {
|
|
199
|
+
if (identifier === "") throw new RouterError("Identifier cannot be empty.");
|
|
200
|
+
if (this.router.has(`actorAlias:${identifier}`)) throw new RouterError(`Actor alias for "${identifier}" already set.`);
|
|
201
|
+
if (new Router().add(path, "temp").size > 0) throw new RouterError("Path for actor alias must have no variables.");
|
|
202
|
+
const existingRoute = this.router.route(path);
|
|
203
|
+
if (existingRoute != null) throw new RouterError(`Actor alias path "${path}" conflicts with existing route "${existingRoute.name}".`);
|
|
204
|
+
this.router.add(path, `${ACTOR_ALIAS_PREFIX}${identifier}`);
|
|
205
|
+
return setters;
|
|
206
|
+
},
|
|
197
207
|
authorize(predicate) {
|
|
198
208
|
callbacks.authorizePredicate = predicate;
|
|
199
209
|
return setters;
|
|
@@ -578,4 +588,4 @@ function createFederationBuilder() {
|
|
|
578
588
|
return new FederationBuilderImpl();
|
|
579
589
|
}
|
|
580
590
|
//#endregion
|
|
581
|
-
export {
|
|
591
|
+
export { FederationBuilderImpl as n, createFederationBuilder as r, ACTOR_ALIAS_PREFIX as t };
|
package/dist/compat/mod.d.cts
CHANGED
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
3
|
+
import { kt as ActivityTransformer, n as Context } from "../context-CVNXcFHR.js";
|
|
4
4
|
import { Activity } from "@fedify/vocab";
|
|
5
5
|
|
|
6
6
|
//#region src/compat/transformers.d.ts
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
6
6
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
-
import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-
|
|
8
|
+
import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-BPZEcrMG.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Follow, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -418,6 +418,34 @@ interface MessageQueueListenOptions {
|
|
|
418
418
|
signal?: AbortSignal;
|
|
419
419
|
}
|
|
420
420
|
/**
|
|
421
|
+
* The number of messages waiting in a message queue.
|
|
422
|
+
*
|
|
423
|
+
* @since 2.3.0
|
|
424
|
+
*/
|
|
425
|
+
interface MessageQueueDepth {
|
|
426
|
+
/**
|
|
427
|
+
* The total number of messages still waiting in the backend queue.
|
|
428
|
+
*
|
|
429
|
+
* This does not include messages that have already been handed to a worker
|
|
430
|
+
* for processing.
|
|
431
|
+
*/
|
|
432
|
+
readonly queued: number;
|
|
433
|
+
/**
|
|
434
|
+
* The number of queued messages eligible for immediate processing.
|
|
435
|
+
*
|
|
436
|
+
* Queue backends that cannot cheaply distinguish ready and delayed messages
|
|
437
|
+
* may omit this field.
|
|
438
|
+
*/
|
|
439
|
+
readonly ready?: number;
|
|
440
|
+
/**
|
|
441
|
+
* The number of queued messages scheduled for later delivery.
|
|
442
|
+
*
|
|
443
|
+
* Queue backends that cannot cheaply distinguish ready and delayed messages
|
|
444
|
+
* may omit this field.
|
|
445
|
+
*/
|
|
446
|
+
readonly delayed?: number;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
421
449
|
* An abstract interface for a message queue.
|
|
422
450
|
*
|
|
423
451
|
* @since 0.5.0
|
|
@@ -457,6 +485,16 @@ interface MessageQueue {
|
|
|
457
485
|
* signal is provided, it never resolves.
|
|
458
486
|
*/
|
|
459
487
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
488
|
+
/**
|
|
489
|
+
* Gets the number of messages waiting in the queue.
|
|
490
|
+
*
|
|
491
|
+
* This operation is optional, and may not be supported by all
|
|
492
|
+
* implementations. The returned counts exclude messages currently being
|
|
493
|
+
* handled by a worker.
|
|
494
|
+
*
|
|
495
|
+
* @since 2.3.0
|
|
496
|
+
*/
|
|
497
|
+
getDepth?(): Promise<MessageQueueDepth>;
|
|
460
498
|
}
|
|
461
499
|
/**
|
|
462
500
|
* Additional options for {@link InProcessMessageQueue}.
|
|
@@ -491,6 +529,7 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
491
529
|
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
492
530
|
enqueueMany(messages: readonly any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
493
531
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
532
|
+
getDepth(): Promise<MessageQueueDepth>;
|
|
494
533
|
}
|
|
495
534
|
/**
|
|
496
535
|
* A message queue that processes messages in parallel. It takes another
|
|
@@ -531,6 +570,7 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
531
570
|
* @since 1.7.0
|
|
532
571
|
*/
|
|
533
572
|
readonly nativeRetrial?: boolean;
|
|
573
|
+
readonly getDepth?: () => Promise<MessageQueueDepth>;
|
|
534
574
|
/**
|
|
535
575
|
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
536
576
|
* number of workers.
|
|
@@ -1641,6 +1681,18 @@ interface ActorCallbackSetters<TContextData> {
|
|
|
1641
1681
|
*/
|
|
1642
1682
|
mapAlias(mapper: ActorAliasMapper<TContextData>): ActorCallbackSetters<TContextData>;
|
|
1643
1683
|
/**
|
|
1684
|
+
* Maps a fixed path to a sentinel identifier. It is useful for exposing
|
|
1685
|
+
* a single, instance-level actor at a fixed path, such as `/actor` for
|
|
1686
|
+
* a relay or `/bot` for a bot.
|
|
1687
|
+
* @param path The fixed path to map to the identifier.
|
|
1688
|
+
* @param identifier The sentinel identifier to map the path to.
|
|
1689
|
+
* @returns The setters object so that settings can be chained.
|
|
1690
|
+
* @throws {RouterError} If the provided path or identifier is invalid or fails
|
|
1691
|
+
* runtime validation.
|
|
1692
|
+
* @since 2.3.0
|
|
1693
|
+
*/
|
|
1694
|
+
mapActorAlias(path: `/${string}`, identifier: string): ActorCallbackSetters<TContextData>;
|
|
1695
|
+
/**
|
|
1644
1696
|
* Specifies the conditions under which requests are authorized.
|
|
1645
1697
|
* @param predicate A callback that returns whether a request is authorized.
|
|
1646
1698
|
* @returns The setters object so that settings can be chained.
|
|
@@ -2806,4 +2858,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2806
2858
|
readonly multikey: Multikey;
|
|
2807
2859
|
}
|
|
2808
2860
|
//#endregion
|
|
2809
|
-
export {
|
|
2861
|
+
export { ParallelMessageQueue as $, FederationKvPrefixes as A, Router as B, IdempotencyKeyCallback as C, WebFingerLinksDispatcher as Ct, ObjectCallbackSetters as D, buildCollectionSynchronizationHeader as Dt, InboxListenerSetters as E, PageItems as Et, RetryContext as F, respondWithObject as G, RouterOptions as H, RetryPolicy as I, InProcessMessageQueueOptions as J, respondWithObjectIfAcceptable as K, createExponentialBackoffPolicy as L, FederationQueueOptions as M, createFederation as N, OutboxListenerSetters as O, digest as Ot, CreateExponentialBackoffPolicyOptions as P, MessageQueueListenOptions as Q, Message as R, FederationStartQueueOptions as S, UnverifiedActivityReason as St, InboxChallengePolicy as T, SenderKeyPair as Tt, RouterRouteResult as U, RouterError as V, RespondWithObjectOptions as W, MessageQueueDepth as X, MessageQueue as Y, MessageQueueEnqueueOptions as Z, Federatable as _, OutboxListener as _t, GetSignedKeyOptions as a, CollectionCounter as at, FederationFetchOptions as b, SharedInboxKeyDispatcher as bt, ParseUriResult as c, CustomCollectionCounter as ct, SendActivityOptions as d, InboxErrorHandler as dt, ActorAliasMapper as et, SendActivityOptionsForCollection as f, InboxListener as ft, CustomCollectionCallbackSetters as g, OutboxErrorHandler as gt, ConstructorWithTypeId as h, ObjectDispatcher as ht, GetActorOptions as i, AuthorizePredicate as it, FederationOrigin as j, Rfc6570Expression as k, ActivityTransformer as kt, RequestContext as l, CustomCollectionCursor as lt, CollectionCallbackSetters as m, ObjectAuthorizePredicate as mt, Context as n, ActorHandleMapper as nt, InboxContext as o, CollectionCursor as ot, ActorCallbackSetters as p, NodeInfoDispatcher as pt, InProcessMessageQueue as q, ForwardActivityOptions as r, ActorKeyPairsDispatcher as rt, OutboxContext as s, CollectionDispatcher as st, ActorKeyPair as t, ActorDispatcher as tt, RouteActivityOptions as u, CustomCollectionDispatcher as ut, Federation as v, OutboxListenerErrorHandler as vt, IdempotencyStrategy as w, SendActivityError as wt, FederationOptions as x, UnverifiedActivityHandler as xt, FederationBuilder as y, OutboxPermanentFailureHandler as yt, createFederationBuilder as z };
|
|
@@ -420,6 +420,34 @@ interface MessageQueueListenOptions {
|
|
|
420
420
|
signal?: AbortSignal;
|
|
421
421
|
}
|
|
422
422
|
/**
|
|
423
|
+
* The number of messages waiting in a message queue.
|
|
424
|
+
*
|
|
425
|
+
* @since 2.3.0
|
|
426
|
+
*/
|
|
427
|
+
interface MessageQueueDepth {
|
|
428
|
+
/**
|
|
429
|
+
* The total number of messages still waiting in the backend queue.
|
|
430
|
+
*
|
|
431
|
+
* This does not include messages that have already been handed to a worker
|
|
432
|
+
* for processing.
|
|
433
|
+
*/
|
|
434
|
+
readonly queued: number;
|
|
435
|
+
/**
|
|
436
|
+
* The number of queued messages eligible for immediate processing.
|
|
437
|
+
*
|
|
438
|
+
* Queue backends that cannot cheaply distinguish ready and delayed messages
|
|
439
|
+
* may omit this field.
|
|
440
|
+
*/
|
|
441
|
+
readonly ready?: number;
|
|
442
|
+
/**
|
|
443
|
+
* The number of queued messages scheduled for later delivery.
|
|
444
|
+
*
|
|
445
|
+
* Queue backends that cannot cheaply distinguish ready and delayed messages
|
|
446
|
+
* may omit this field.
|
|
447
|
+
*/
|
|
448
|
+
readonly delayed?: number;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
423
451
|
* An abstract interface for a message queue.
|
|
424
452
|
*
|
|
425
453
|
* @since 0.5.0
|
|
@@ -459,6 +487,16 @@ interface MessageQueue {
|
|
|
459
487
|
* signal is provided, it never resolves.
|
|
460
488
|
*/
|
|
461
489
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
490
|
+
/**
|
|
491
|
+
* Gets the number of messages waiting in the queue.
|
|
492
|
+
*
|
|
493
|
+
* This operation is optional, and may not be supported by all
|
|
494
|
+
* implementations. The returned counts exclude messages currently being
|
|
495
|
+
* handled by a worker.
|
|
496
|
+
*
|
|
497
|
+
* @since 2.3.0
|
|
498
|
+
*/
|
|
499
|
+
getDepth?(): Promise<MessageQueueDepth>;
|
|
462
500
|
}
|
|
463
501
|
/**
|
|
464
502
|
* Additional options for {@link InProcessMessageQueue}.
|
|
@@ -493,6 +531,7 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
493
531
|
enqueue(message: any, options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
494
532
|
enqueueMany(messages: readonly any[], options?: MessageQueueEnqueueOptions): Promise<void>;
|
|
495
533
|
listen(handler: (message: any) => Promise<void> | void, options?: MessageQueueListenOptions): Promise<void>;
|
|
534
|
+
getDepth(): Promise<MessageQueueDepth>;
|
|
496
535
|
}
|
|
497
536
|
/**
|
|
498
537
|
* A message queue that processes messages in parallel. It takes another
|
|
@@ -533,6 +572,7 @@ declare class ParallelMessageQueue implements MessageQueue {
|
|
|
533
572
|
* @since 1.7.0
|
|
534
573
|
*/
|
|
535
574
|
readonly nativeRetrial?: boolean;
|
|
575
|
+
readonly getDepth?: () => Promise<MessageQueueDepth>;
|
|
536
576
|
/**
|
|
537
577
|
* Constructs a new {@link ParallelMessageQueue} with the given queue and
|
|
538
578
|
* number of workers.
|
|
@@ -1643,6 +1683,18 @@ interface ActorCallbackSetters<TContextData> {
|
|
|
1643
1683
|
*/
|
|
1644
1684
|
mapAlias(mapper: ActorAliasMapper<TContextData>): ActorCallbackSetters<TContextData>;
|
|
1645
1685
|
/**
|
|
1686
|
+
* Maps a fixed path to a sentinel identifier. It is useful for exposing
|
|
1687
|
+
* a single, instance-level actor at a fixed path, such as `/actor` for
|
|
1688
|
+
* a relay or `/bot` for a bot.
|
|
1689
|
+
* @param path The fixed path to map to the identifier.
|
|
1690
|
+
* @param identifier The sentinel identifier to map the path to.
|
|
1691
|
+
* @returns The setters object so that settings can be chained.
|
|
1692
|
+
* @throws {RouterError} If the provided path or identifier is invalid or fails
|
|
1693
|
+
* runtime validation.
|
|
1694
|
+
* @since 2.3.0
|
|
1695
|
+
*/
|
|
1696
|
+
mapActorAlias(path: `/${string}`, identifier: string): ActorCallbackSetters<TContextData>;
|
|
1697
|
+
/**
|
|
1646
1698
|
* Specifies the conditions under which requests are authorized.
|
|
1647
1699
|
* @param predicate A callback that returns whether a request is authorized.
|
|
1648
1700
|
* @returns The setters object so that settings can be chained.
|
|
@@ -2808,4 +2860,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2808
2860
|
readonly multikey: Multikey;
|
|
2809
2861
|
}
|
|
2810
2862
|
//#endregion
|
|
2811
|
-
export {
|
|
2863
|
+
export { ParallelMessageQueue as $, FederationKvPrefixes as A, Router as B, IdempotencyKeyCallback as C, WebFingerLinksDispatcher as Ct, ObjectCallbackSetters as D, buildCollectionSynchronizationHeader as Dt, InboxListenerSetters as E, PageItems as Et, RetryContext as F, respondWithObject as G, RouterOptions as H, RetryPolicy as I, InProcessMessageQueueOptions as J, respondWithObjectIfAcceptable as K, createExponentialBackoffPolicy as L, FederationQueueOptions as M, createFederation as N, OutboxListenerSetters as O, digest as Ot, CreateExponentialBackoffPolicyOptions as P, MessageQueueListenOptions as Q, Message as R, FederationStartQueueOptions as S, UnverifiedActivityReason as St, InboxChallengePolicy as T, SenderKeyPair as Tt, RouterRouteResult as U, RouterError as V, RespondWithObjectOptions as W, MessageQueueDepth as X, MessageQueue as Y, MessageQueueEnqueueOptions as Z, Federatable as _, OutboxListener as _t, GetSignedKeyOptions as a, CollectionCounter as at, FederationFetchOptions as b, SharedInboxKeyDispatcher as bt, ParseUriResult as c, CustomCollectionCounter as ct, SendActivityOptions as d, InboxErrorHandler as dt, ActorAliasMapper as et, SendActivityOptionsForCollection as f, InboxListener as ft, CustomCollectionCallbackSetters as g, OutboxErrorHandler as gt, ConstructorWithTypeId as h, ObjectDispatcher as ht, GetActorOptions as i, AuthorizePredicate as it, FederationOrigin as j, Rfc6570Expression as k, ActivityTransformer as kt, RequestContext as l, CustomCollectionCursor as lt, CollectionCallbackSetters as m, ObjectAuthorizePredicate as mt, Context as n, ActorHandleMapper as nt, InboxContext as o, CollectionCursor as ot, ActorCallbackSetters as p, NodeInfoDispatcher as pt, InProcessMessageQueue as q, ForwardActivityOptions as r, ActorKeyPairsDispatcher as rt, OutboxContext as s, CollectionDispatcher as st, ActorKeyPair as t, ActorDispatcher as tt, RouteActivityOptions as u, CustomCollectionDispatcher as ut, Federation as v, OutboxListenerErrorHandler as vt, IdempotencyStrategy as w, SendActivityError as wt, FederationOptions as x, UnverifiedActivityHandler as xt, FederationBuilder as y, OutboxPermanentFailureHandler as yt, createFederationBuilder as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { o as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-CeANlo1H.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-CfToB_iu.mjs";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
7
7
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
6
6
|
import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { r as createFederationBuilder } from "../builder-Nn2r1dKd.mjs";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
//#region src/federation/builder.test.ts
|
|
@@ -17,7 +17,11 @@ test("FederationBuilder", async (t) => {
|
|
|
17
17
|
const actorDispatcher = (_ctx, _identifier) => {
|
|
18
18
|
return null;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
assertThrows(() => createFederationBuilder().setActorDispatcher("/users/{identifier}", actorDispatcher).mapActorAlias("/actor/{id}", "instance"), RouterError, "Path for actor alias must have no variables.");
|
|
21
|
+
assertThrows(() => createFederationBuilder().setActorDispatcher("/users/{identifier}", actorDispatcher).mapActorAlias("/actor", "instance").mapActorAlias("/bot", "instance"), RouterError, "Actor alias for \"instance\" already set.");
|
|
22
|
+
assertThrows(() => createFederationBuilder().setActorDispatcher("/users/{identifier}", actorDispatcher).mapActorAlias("/actor", "instance").mapActorAlias("/actor", "bot"), RouterError, "Actor alias path \"/actor\" conflicts with existing route \"actorAlias:instance\".");
|
|
23
|
+
assertThrows(() => createFederationBuilder().setActorDispatcher("/users/{identifier}", actorDispatcher).mapActorAlias("/actor", ""), RouterError, "Identifier cannot be empty.");
|
|
24
|
+
builder.setActorDispatcher("/users/{identifier}", actorDispatcher).mapActorAlias("/actor", "instance");
|
|
21
25
|
const inboxListener = (_ctx, _activity) => {};
|
|
22
26
|
builder.setInboxListeners("/users/{identifier}/inbox").on(Activity, inboxListener);
|
|
23
27
|
const outboxListener = (_ctx, _activity) => {};
|
|
@@ -52,6 +56,7 @@ test("FederationBuilder", async (t) => {
|
|
|
52
56
|
const impl = federation;
|
|
53
57
|
assertEquals(impl.router.route("/.well-known/webfinger")?.name, "webfinger");
|
|
54
58
|
assertEquals(impl.router.route("/users/test123")?.name, "actor");
|
|
59
|
+
assertEquals(impl.router.route("/actor")?.name, "actorAlias:instance");
|
|
55
60
|
assertEquals(impl.router.route("/users/test123/inbox")?.name, "inbox");
|
|
56
61
|
assertEquals(impl.router.route("/users/test123/outbox")?.name, "outbox");
|
|
57
62
|
assertEquals(impl.router.route("/notes/456")?.name, `object:${Note.typeId.href}`);
|
|
@@ -7,10 +7,10 @@ import "../std__assert-CRDpx_HF.mjs";
|
|
|
7
7
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
8
8
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
9
9
|
import { r as parseAcceptSignature } from "../accept-CPkZzmGN.mjs";
|
|
10
|
-
import { s as signRequest } from "../http-
|
|
10
|
+
import { s as signRequest } from "../http-CfToB_iu.mjs";
|
|
11
11
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
|
|
12
12
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
13
|
-
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-
|
|
13
|
+
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-BPZEcrMG.mjs";
|
|
14
14
|
import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-CRDpx_HF.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
7
|
-
import { r as signObject } from "../proof-
|
|
7
|
+
import { r as signObject } from "../proof-CFPGr1xC.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
+
import { o as createFederation } from "../middleware-BPZEcrMG.mjs";
|
|
10
10
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -4,21 +4,21 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
5
|
import { n as RouterError } from "../router-CrMLXoOr.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
-
import "../std__assert-CRDpx_HF.mjs";
|
|
7
|
+
import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
|
|
8
8
|
import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
9
9
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
10
10
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
11
11
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
12
12
|
import { t as assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
|
|
13
13
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
14
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
14
|
+
import { l as verifyRequest, s as signRequest } from "../http-CfToB_iu.mjs";
|
|
15
15
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
16
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
17
|
-
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-
|
|
18
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
19
|
-
import { i as verifyObject, r as signObject } from "../proof-
|
|
16
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-mEJ3hsMB.mjs";
|
|
17
|
+
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-CUlVC-TS.mjs";
|
|
18
|
+
import { t as doesActorOwnKey } from "../owner-CuW0S2XY.mjs";
|
|
19
|
+
import { i as verifyObject, r as signObject } from "../proof-CFPGr1xC.mjs";
|
|
20
20
|
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
21
|
-
import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
21
|
+
import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-BPZEcrMG.mjs";
|
|
22
22
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
23
23
|
import * as vocab from "@fedify/vocab";
|
|
24
24
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
|
@@ -270,7 +270,8 @@ test({
|
|
|
270
270
|
}));
|
|
271
271
|
ctx = federation.createContext(new URL("https://example.com/"), 123);
|
|
272
272
|
assertEquals(ctx.getNodeInfoUri(), new URL("https://example.com/nodeinfo/2.1"));
|
|
273
|
-
|
|
273
|
+
assertThrows(() => createFederation({ kv: new MemoryKvStore() }).setActorDispatcher("/users/{identifier}", () => null).mapActorAlias("/actor/{id}", "instance"), RouterError, "Path for actor alias must have no variables.");
|
|
274
|
+
federation.setActorDispatcher("/users/{identifier}", () => new vocab.Person({})).mapActorAlias("/bot", "bot").setKeyPairsDispatcher(() => [{
|
|
274
275
|
privateKey: rsaPrivateKey2,
|
|
275
276
|
publicKey: rsaPublicKey2.publicKey
|
|
276
277
|
}, {
|
|
@@ -279,11 +280,16 @@ test({
|
|
|
279
280
|
}]).mapHandle((_, username) => username === "HANDLE" ? "handle" : null);
|
|
280
281
|
ctx = federation.createContext(new URL("https://example.com/"), 123);
|
|
281
282
|
assertEquals(ctx.getActorUri("handle"), new URL("https://example.com/users/handle"));
|
|
283
|
+
assertEquals(ctx.getActorUri("bot"), new URL("https://example.com/bot"));
|
|
282
284
|
assertEquals(ctx.parseUri(new URL("https://example.com/")), null);
|
|
283
285
|
assertEquals(ctx.parseUri(new URL("https://example.com/users/handle")), {
|
|
284
286
|
type: "actor",
|
|
285
287
|
identifier: "handle"
|
|
286
288
|
});
|
|
289
|
+
assertEquals(ctx.parseUri(new URL("https://example.com/bot")), {
|
|
290
|
+
type: "actor",
|
|
291
|
+
identifier: "bot"
|
|
292
|
+
});
|
|
287
293
|
assertEquals(ctx.parseUri(null), null);
|
|
288
294
|
assertEquals(await ctx.getActorKeyPairs("handle"), [{
|
|
289
295
|
keyId: new URL("https://example.com/users/handle#main-key"),
|
|
@@ -775,7 +781,7 @@ test("Federation.fetch()", async (t) => {
|
|
|
775
781
|
inbox: ctx.getInboxUri(identifier),
|
|
776
782
|
preferredUsername: identifier
|
|
777
783
|
});
|
|
778
|
-
}).setKeyPairsDispatcher(() => {
|
|
784
|
+
}).mapActorAlias("/bot", "bot").setKeyPairsDispatcher(() => {
|
|
779
785
|
return [{
|
|
780
786
|
privateKey: rsaPrivateKey2,
|
|
781
787
|
publicKey: rsaPublicKey2.publicKey
|
|
@@ -799,6 +805,32 @@ test("Federation.fetch()", async (t) => {
|
|
|
799
805
|
assertEquals(dispatches, []);
|
|
800
806
|
assertEquals(response.status, 406);
|
|
801
807
|
});
|
|
808
|
+
await t.step("GET actor alias", async () => {
|
|
809
|
+
const { federation, dispatches } = createTestContext();
|
|
810
|
+
const response = await federation.fetch(new Request("https://example.com/bot", {
|
|
811
|
+
method: "GET",
|
|
812
|
+
headers: { "Accept": "application/activity+json" }
|
|
813
|
+
}), { contextData: void 0 });
|
|
814
|
+
assertEquals(dispatches, ["bot"]);
|
|
815
|
+
assertEquals(response.status, 200);
|
|
816
|
+
const body = await response.json();
|
|
817
|
+
assertEquals(body.id, "https://example.com/bot");
|
|
818
|
+
assertEquals(body.preferredUsername, "bot");
|
|
819
|
+
});
|
|
820
|
+
await t.step("WebFinger for actor alias", async () => {
|
|
821
|
+
const { federation } = createTestContext();
|
|
822
|
+
const response = await federation.fetch(new Request("https://example.com/.well-known/webfinger?resource=acct:bot@example.com"), { contextData: void 0 });
|
|
823
|
+
assertEquals(response.status, 200);
|
|
824
|
+
const body = await response.json();
|
|
825
|
+
assertEquals(body.subject, "acct:bot@example.com");
|
|
826
|
+
assertExists(body.links);
|
|
827
|
+
assert(Array.isArray(body.links));
|
|
828
|
+
const selfLink = body.links.find((l) => l.rel === "self");
|
|
829
|
+
assertExists(selfLink);
|
|
830
|
+
assertEquals(selfLink.href, "https://example.com/bot");
|
|
831
|
+
assertExists(body.aliases);
|
|
832
|
+
assert(body.aliases.includes("https://example.com/bot"));
|
|
833
|
+
});
|
|
802
834
|
await t.step("POST with application/json", async () => {
|
|
803
835
|
const { federation, inbox } = createTestContext();
|
|
804
836
|
const request = await signRequest(new Request("https://example.com/users/json/inbox", {
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("../chunk-DDcVe30Y.cjs");
|
|
5
|
-
const require_middleware = require("../middleware-
|
|
5
|
+
const require_middleware = require("../middleware-I5XEZ_pZ.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
|
@@ -103,6 +103,7 @@ var InProcessMessageQueue = class {
|
|
|
103
103
|
#messages;
|
|
104
104
|
#monitors;
|
|
105
105
|
#pollIntervalMs;
|
|
106
|
+
#delayedMessages;
|
|
106
107
|
/**
|
|
107
108
|
* Tracks which ordering keys are currently being processed to ensure
|
|
108
109
|
* sequential processing for messages with the same key.
|
|
@@ -121,42 +122,56 @@ var InProcessMessageQueue = class {
|
|
|
121
122
|
this.#messages = [];
|
|
122
123
|
this.#monitors = {};
|
|
123
124
|
this.#pollIntervalMs = Temporal.Duration.from(options.pollInterval ?? { seconds: 5 }).total("millisecond");
|
|
125
|
+
this.#delayedMessages = 0;
|
|
124
126
|
this.#processingKeys = /* @__PURE__ */ new Set();
|
|
125
127
|
}
|
|
126
128
|
enqueue(message, options) {
|
|
127
129
|
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
|
128
130
|
if (delay > 0) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
this.#delayedMessages++;
|
|
132
|
+
setTimeout(() => {
|
|
133
|
+
this.#delayedMessages--;
|
|
134
|
+
this.#enqueueReady(message, options);
|
|
135
|
+
}, delay);
|
|
133
136
|
return Promise.resolve();
|
|
134
137
|
}
|
|
138
|
+
this.#enqueueReady(message, options);
|
|
139
|
+
return Promise.resolve();
|
|
140
|
+
}
|
|
141
|
+
#enqueueReady(message, options) {
|
|
135
142
|
const orderingKey = options?.orderingKey ?? null;
|
|
136
143
|
this.#messages.push({
|
|
137
144
|
message,
|
|
138
145
|
orderingKey
|
|
139
146
|
});
|
|
147
|
+
this.#notifyMonitors();
|
|
148
|
+
}
|
|
149
|
+
#notifyMonitors() {
|
|
140
150
|
for (const monitorId in this.#monitors) this.#monitors[monitorId]();
|
|
141
|
-
return Promise.resolve();
|
|
142
151
|
}
|
|
143
152
|
enqueueMany(messages, options) {
|
|
144
153
|
if (messages.length === 0) return Promise.resolve();
|
|
145
154
|
const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
|
|
146
155
|
if (delay > 0) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
156
|
+
const delayedCount = messages.length;
|
|
157
|
+
const deferredMessages = [...messages];
|
|
158
|
+
this.#delayedMessages += delayedCount;
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
this.#delayedMessages -= delayedCount;
|
|
161
|
+
this.#enqueueManyReady(deferredMessages, options);
|
|
162
|
+
}, delay);
|
|
151
163
|
return Promise.resolve();
|
|
152
164
|
}
|
|
165
|
+
this.#enqueueManyReady(messages, options);
|
|
166
|
+
return Promise.resolve();
|
|
167
|
+
}
|
|
168
|
+
#enqueueManyReady(messages, options) {
|
|
153
169
|
const orderingKey = options?.orderingKey ?? null;
|
|
154
170
|
for (const message of messages) this.#messages.push({
|
|
155
171
|
message,
|
|
156
172
|
orderingKey
|
|
157
173
|
});
|
|
158
|
-
|
|
159
|
-
return Promise.resolve();
|
|
174
|
+
this.#notifyMonitors();
|
|
160
175
|
}
|
|
161
176
|
async listen(handler, options = {}) {
|
|
162
177
|
const signal = options.signal;
|
|
@@ -174,6 +189,15 @@ var InProcessMessageQueue = class {
|
|
|
174
189
|
else await this.#wait(10, signal);
|
|
175
190
|
}
|
|
176
191
|
}
|
|
192
|
+
getDepth() {
|
|
193
|
+
const ready = this.#messages.length;
|
|
194
|
+
const delayed = this.#delayedMessages;
|
|
195
|
+
return Promise.resolve({
|
|
196
|
+
queued: ready + delayed,
|
|
197
|
+
ready,
|
|
198
|
+
delayed
|
|
199
|
+
});
|
|
200
|
+
}
|
|
177
201
|
#wait(ms, signal) {
|
|
178
202
|
let timer = null;
|
|
179
203
|
return Promise.any([new Promise((resolve) => {
|
|
@@ -228,6 +252,7 @@ var ParallelMessageQueue = class ParallelMessageQueue {
|
|
|
228
252
|
* @since 1.7.0
|
|
229
253
|
*/
|
|
230
254
|
nativeRetrial;
|
|
255
|
+
getDepth;
|
|
231
256
|
/**
|
|
232
257
|
* Tracks which ordering keys are currently being processed to ensure
|
|
233
258
|
* sequential processing for messages with the same key.
|
|
@@ -251,6 +276,7 @@ var ParallelMessageQueue = class ParallelMessageQueue {
|
|
|
251
276
|
this.queue = queue;
|
|
252
277
|
this.workers = workers;
|
|
253
278
|
this.nativeRetrial = queue.nativeRetrial;
|
|
279
|
+
if (queue.getDepth != null) this.getDepth = () => queue.getDepth();
|
|
254
280
|
}
|
|
255
281
|
enqueue(message, options) {
|
|
256
282
|
return this.queue.enqueue(message, options);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "../context-Bxs4cdIZ.cjs";
|
|
2
2
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-CbLNp3zQ.cjs";
|
|
3
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
4
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
3
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-zA6NZHUG.cjs";
|
|
4
|
+
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "../context-CVNXcFHR.js";
|
|
4
4
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-GFYnFoOl.js";
|
|
5
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
6
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
5
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-Bc6p4npy.js";
|
|
6
|
+
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|