@fedify/fedify 2.2.0-dev.742 → 2.2.0-dev.748
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-9W11mlGH.mjs → builder-BGzN0XIV.mjs} +5 -4
- 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-C0fssarc.d.ts → context-78ecvxf5.d.ts} +60 -5
- package/dist/{context-LmrZPwti.d.cts → context-DYDPdoCb.d.cts} +60 -5
- package/dist/{deno-CRYDSFfq.mjs → deno-BGpYBBba.mjs} +1 -1
- package/dist/{docloader-D0PEShHu.mjs → docloader-B_eTYGFt.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +50 -5
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +58 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +37 -4
- package/dist/{http-iMMaZfPv.cjs → http-BA8U-rJX.cjs} +1 -1
- package/dist/{http-B3rSCsad.js → http-BX8Se31Z.js} +1 -1
- package/dist/{http-Cd3-jMPf.mjs → http-DukFwiXf.mjs} +2 -2
- package/dist/{inbox-ptxeHuYp.mjs → inbox-wiVtdLY9.mjs} +1 -1
- package/dist/{key-DLgFao_l.mjs → key-CC3yOGF0.mjs} +1 -1
- package/dist/{kv-cache-Bof7t7c6.js → kv-cache-BSseaVt8.js} +1 -1
- package/dist/{kv-cache-BOvl7_E9.cjs → kv-cache-Baf0LigI.cjs} +1 -1
- package/dist/{ld-fic_3hjX.mjs → ld-D67kDIA0.mjs} +2 -2
- package/dist/{middleware-CDFzHMsc.mjs → middleware-BfOPomng.mjs} +35 -17
- package/dist/{middleware-DiDEs-DR.cjs → middleware-CP-fzmy_.cjs} +29 -10
- package/dist/{middleware-BcCspPQY.js → middleware-CXkoAB0x.js} +29 -10
- package/dist/{middleware-DbRl3ywC.mjs → middleware-DBWbTLAi.mjs} +1 -1
- package/dist/{middleware-v5_t5_Y6.cjs → middleware-DLm4eyx-.cjs} +1 -1
- package/dist/{mod-Cgpc49fA.d.cts → mod-CEohtXhV.d.cts} +1 -1
- package/dist/{mod-CnwZoDzx.d.ts → mod-CokIUYDr.d.ts} +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-DtWgS757.mjs → owner-CxO6322k.mjs} +2 -2
- package/dist/{proof-B3PlHLkI.cjs → proof-9C09_l2r.cjs} +1 -1
- package/dist/{proof-DoVSQdi8.js → proof-DaPEktCl.js} +1 -1
- package/dist/{proof-BFwvKMo7.mjs → proof-Dfy2T5tG.mjs} +2 -2
- package/dist/{send-gEqawj0v.mjs → send-urWboKs6.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 +59 -4
- 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,9 +2,9 @@ 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-
|
|
6
|
-
import { t as InboxListenerSet } from "./inbox-
|
|
7
|
-
import { getTypeId } from "@fedify/vocab";
|
|
5
|
+
import { n as version, t as name } from "./deno-BGpYBBba.mjs";
|
|
6
|
+
import { t as InboxListenerSet } from "./inbox-wiVtdLY9.mjs";
|
|
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
|
|
@@ -43,7 +43,7 @@ var FederationBuilderImpl = class {
|
|
|
43
43
|
this.collectionTypeIds = {};
|
|
44
44
|
}
|
|
45
45
|
async build(options) {
|
|
46
|
-
const { FederationImpl } = await import("./middleware-
|
|
46
|
+
const { FederationImpl } = await import("./middleware-DBWbTLAi.mjs");
|
|
47
47
|
const f = new FederationImpl(options);
|
|
48
48
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
49
49
|
f.router = this.router.clone();
|
|
@@ -106,6 +106,7 @@ var FederationBuilderImpl = class {
|
|
|
106
106
|
]);
|
|
107
107
|
if (actor.id == null) logger.warn("Actor dispatcher returned an actor without an id property. Set the property with Context.getActorUri(identifier).");
|
|
108
108
|
else if (actor.id.href != context.getActorUri(identifier).href) logger.warn("Actor dispatcher returned an actor with an id property that does not match the actor URI. Set the property with Context.getActorUri(identifier).");
|
|
109
|
+
if (actor instanceof Tombstone) return actor;
|
|
109
110
|
if (this.followingCallbacks != null && this.followingCallbacks.dispatcher != null) {
|
|
110
111
|
if (actor.followingId == null) logger.warn("You configured a following collection dispatcher, but the actor does not have a following property. Set the property with Context.getFollowingUri(identifier).");
|
|
111
112
|
else if (actor.followingId.href != context.getFollowingUri(identifier).href) logger.warn("You configured a following collection dispatcher, but the actor's following property does not match the following collection URI. Set the property with Context.getFollowingUri(identifier).");
|
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 { n as Context, wt as ActivityTransformer } from "../context-78ecvxf5.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-ddO5KLpe.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
8
|
-
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-
|
|
8
|
+
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-BfOPomng.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Follow, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -4,7 +4,7 @@ import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client
|
|
|
4
4
|
import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-aQzN9Ayi.js";
|
|
5
5
|
import { n as GetKeyOwnerOptions } from "./owner-74ARJ5TL.js";
|
|
6
6
|
import { n as KvStore, t as KvKey } from "./kv-GFYnFoOl.js";
|
|
7
|
-
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
7
|
+
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
|
|
8
8
|
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
9
9
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
10
10
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
@@ -107,13 +107,13 @@ type NodeInfoDispatcher<TContextData> = (context: RequestContext<TContextData>)
|
|
|
107
107
|
*/
|
|
108
108
|
type WebFingerLinksDispatcher<TContextData> = (context: RequestContext<TContextData>, resource: URL) => readonly Link$1[] | Promise<readonly Link$1[]>;
|
|
109
109
|
/**
|
|
110
|
-
* A callback that dispatches an {@link Actor} object.
|
|
110
|
+
* A callback that dispatches an {@link Actor} object or a {@link Tombstone}.
|
|
111
111
|
*
|
|
112
112
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
113
113
|
* @param context The request context.
|
|
114
114
|
* @param identifier The actor's internal identifier or username.
|
|
115
115
|
*/
|
|
116
|
-
type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, identifier: string) => Actor | null | Promise<Actor | null>;
|
|
116
|
+
type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, identifier: string) => Actor | Tombstone | null | Promise<Actor | Tombstone | null>;
|
|
117
117
|
/**
|
|
118
118
|
* A callback that dispatches key pairs for an actor.
|
|
119
119
|
*
|
|
@@ -923,7 +923,9 @@ interface Federatable<TContextData> {
|
|
|
923
923
|
* based on URI Template
|
|
924
924
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
925
925
|
* must have one variable: `{identifier}`.
|
|
926
|
-
* @param dispatcher An actor dispatcher callback to register.
|
|
926
|
+
* @param dispatcher An actor dispatcher callback to register. It may return
|
|
927
|
+
* an actor, a `Tombstone`, or `null` if the actor is not
|
|
928
|
+
* found.
|
|
927
929
|
* @returns An object with methods to set other actor dispatcher callbacks.
|
|
928
930
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
|
929
931
|
*/
|
|
@@ -2227,6 +2229,19 @@ interface Context<TContextData> {
|
|
|
2227
2229
|
getCollectionUri<TParam extends Record<string, string>>(name: string | symbol, values: TParam): URL;
|
|
2228
2230
|
}
|
|
2229
2231
|
/**
|
|
2232
|
+
* Options for {@link RequestContext.getActor}.
|
|
2233
|
+
* @since 2.2.0
|
|
2234
|
+
*/
|
|
2235
|
+
interface GetActorOptions {
|
|
2236
|
+
/**
|
|
2237
|
+
* Controls how tombstoned actors are returned.
|
|
2238
|
+
*
|
|
2239
|
+
* By default, tombstones are suppressed and returned as `null`. Set this to
|
|
2240
|
+
* `"passthrough"` to receive a {@link Tombstone} result instead.
|
|
2241
|
+
*/
|
|
2242
|
+
readonly tombstone?: "suppress" | "passthrough";
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2230
2245
|
* A context for a request.
|
|
2231
2246
|
*/
|
|
2232
2247
|
interface RequestContext<TContextData> extends Context<TContextData> {
|
|
@@ -2256,6 +2271,46 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
2256
2271
|
*/
|
|
2257
2272
|
getActor(identifier: string): Promise<Actor | null>;
|
|
2258
2273
|
/**
|
|
2274
|
+
* Gets an {@link Actor} object or {@link Tombstone} for the given
|
|
2275
|
+
* identifier.
|
|
2276
|
+
* @param identifier The actor's identifier.
|
|
2277
|
+
* @param options Options for getting the actor. Set
|
|
2278
|
+
* `options.tombstone` to `"passthrough"` to receive
|
|
2279
|
+
* tombstoned actors instead of `null`.
|
|
2280
|
+
* @returns The actor object, a tombstone, or `null` if the actor is not
|
|
2281
|
+
* found.
|
|
2282
|
+
* @throws {Error} If no actor dispatcher is available.
|
|
2283
|
+
* @since 2.2.0
|
|
2284
|
+
*/
|
|
2285
|
+
getActor(identifier: string, options: GetActorOptions & {
|
|
2286
|
+
readonly tombstone: "passthrough";
|
|
2287
|
+
}): Promise<Actor | Tombstone | null>;
|
|
2288
|
+
/**
|
|
2289
|
+
* Gets an {@link Actor} object for the given identifier.
|
|
2290
|
+
* @param identifier The actor's identifier.
|
|
2291
|
+
* @param options Options for getting the actor.
|
|
2292
|
+
* @returns The actor object, or `null` if the actor is not found.
|
|
2293
|
+
* Tombstoned actors are suppressed unless `options.tombstone` is
|
|
2294
|
+
* `"passthrough"`.
|
|
2295
|
+
* @throws {Error} If no actor dispatcher is available.
|
|
2296
|
+
* @since 2.2.0
|
|
2297
|
+
*/
|
|
2298
|
+
getActor(identifier: string, options: GetActorOptions & {
|
|
2299
|
+
readonly tombstone?: "suppress" | undefined;
|
|
2300
|
+
}): Promise<Actor | null>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Gets an {@link Actor} object or {@link Tombstone} for the given
|
|
2303
|
+
* identifier.
|
|
2304
|
+
* @param identifier The actor's identifier.
|
|
2305
|
+
* @param options Options for getting the actor.
|
|
2306
|
+
* @returns The actor object, a tombstone, or `null` if the actor is not
|
|
2307
|
+
* found. This broad overload is used when the caller passes an
|
|
2308
|
+
* options value whose `tombstone` mode is not known statically.
|
|
2309
|
+
* @throws {Error} If no actor dispatcher is available.
|
|
2310
|
+
* @since 2.2.0
|
|
2311
|
+
*/
|
|
2312
|
+
getActor(identifier: string, options: GetActorOptions): Promise<Actor | Tombstone | null>;
|
|
2313
|
+
/**
|
|
2259
2314
|
* Gets an object of the given class with the given values.
|
|
2260
2315
|
* @param cls The class to instantiate.
|
|
2261
2316
|
* @param values The values to pass to the object dispatcher.
|
|
@@ -2589,4 +2644,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2589
2644
|
readonly multikey: Multikey;
|
|
2590
2645
|
}
|
|
2591
2646
|
//#endregion
|
|
2592
|
-
export {
|
|
2647
|
+
export { ActorHandleMapper as $, FederationQueueOptions as A, RouterOptions as B, IdempotencyStrategy as C, digest as Ct, Rfc6570Expression as D, ObjectCallbackSetters as E, createExponentialBackoffPolicy as F, InProcessMessageQueue as G, RespondWithObjectOptions as H, Message as I, MessageQueueEnqueueOptions as J, InProcessMessageQueueOptions as K, createFederationBuilder as L, CreateExponentialBackoffPolicyOptions as M, RetryContext as N, FederationKvPrefixes as O, RetryPolicy as P, ActorDispatcher as Q, Router as R, IdempotencyKeyCallback as S, buildCollectionSynchronizationHeader as St, InboxListenerSetters as T, respondWithObject as U, RouterRouteResult as V, respondWithObjectIfAcceptable as W, ParallelMessageQueue as X, MessageQueueListenOptions as Y, ActorAliasMapper as Z, Federation as _, UnverifiedActivityReason as _t, GetSignedKeyOptions as a, CustomCollectionCounter as at, FederationOptions as b, SenderKeyPair as bt, RequestContext as c, InboxErrorHandler as ct, SendActivityOptionsForCollection as d, ObjectAuthorizePredicate as dt, ActorKeyPairsDispatcher as et, ActorCallbackSetters as f, ObjectDispatcher as ft, Federatable as g, UnverifiedActivityHandler as gt, CustomCollectionCallbackSetters as h, SharedInboxKeyDispatcher as ht, GetActorOptions as i, CollectionDispatcher as it, createFederation as j, FederationOrigin as k, RouteActivityOptions as l, InboxListener as lt, ConstructorWithTypeId as m, OutboxPermanentFailureHandler as mt, Context as n, CollectionCounter as nt, InboxContext as o, CustomCollectionCursor as ot, CollectionCallbackSetters as p, OutboxErrorHandler as pt, MessageQueue as q, ForwardActivityOptions as r, CollectionCursor as rt, ParseUriResult as s, CustomCollectionDispatcher as st, ActorKeyPair as t, AuthorizePredicate as tt, SendActivityOptions as u, NodeInfoDispatcher as ut, FederationBuilder as v, WebFingerLinksDispatcher as vt, InboxChallengePolicy as w, ActivityTransformer as wt, FederationStartQueueOptions as x, PageItems as xt, FederationFetchOptions as y, SendActivityError as yt, RouterError as z };
|
|
@@ -2,7 +2,7 @@ import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client
|
|
|
2
2
|
import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-CrGuipxe.cjs";
|
|
3
3
|
import { n as GetKeyOwnerOptions } from "./owner-CptqhsOy.cjs";
|
|
4
4
|
import { n as KvStore, t as KvKey } from "./kv-CbLNp3zQ.cjs";
|
|
5
|
-
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
5
|
+
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
|
|
6
6
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
7
7
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
8
8
|
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
@@ -105,13 +105,13 @@ type NodeInfoDispatcher<TContextData> = (context: RequestContext<TContextData>)
|
|
|
105
105
|
*/
|
|
106
106
|
type WebFingerLinksDispatcher<TContextData> = (context: RequestContext<TContextData>, resource: URL) => readonly Link$1[] | Promise<readonly Link$1[]>;
|
|
107
107
|
/**
|
|
108
|
-
* A callback that dispatches an {@link Actor} object.
|
|
108
|
+
* A callback that dispatches an {@link Actor} object or a {@link Tombstone}.
|
|
109
109
|
*
|
|
110
110
|
* @template TContextData The context data to pass to the {@link Context}.
|
|
111
111
|
* @param context The request context.
|
|
112
112
|
* @param identifier The actor's internal identifier or username.
|
|
113
113
|
*/
|
|
114
|
-
type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, identifier: string) => Actor | null | Promise<Actor | null>;
|
|
114
|
+
type ActorDispatcher<TContextData> = (context: RequestContext<TContextData>, identifier: string) => Actor | Tombstone | null | Promise<Actor | Tombstone | null>;
|
|
115
115
|
/**
|
|
116
116
|
* A callback that dispatches key pairs for an actor.
|
|
117
117
|
*
|
|
@@ -921,7 +921,9 @@ interface Federatable<TContextData> {
|
|
|
921
921
|
* based on URI Template
|
|
922
922
|
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
|
|
923
923
|
* must have one variable: `{identifier}`.
|
|
924
|
-
* @param dispatcher An actor dispatcher callback to register.
|
|
924
|
+
* @param dispatcher An actor dispatcher callback to register. It may return
|
|
925
|
+
* an actor, a `Tombstone`, or `null` if the actor is not
|
|
926
|
+
* found.
|
|
925
927
|
* @returns An object with methods to set other actor dispatcher callbacks.
|
|
926
928
|
* @throws {RouterError} Thrown if the path pattern is invalid.
|
|
927
929
|
*/
|
|
@@ -2225,6 +2227,19 @@ interface Context<TContextData> {
|
|
|
2225
2227
|
getCollectionUri<TParam extends Record<string, string>>(name: string | symbol, values: TParam): URL;
|
|
2226
2228
|
}
|
|
2227
2229
|
/**
|
|
2230
|
+
* Options for {@link RequestContext.getActor}.
|
|
2231
|
+
* @since 2.2.0
|
|
2232
|
+
*/
|
|
2233
|
+
interface GetActorOptions {
|
|
2234
|
+
/**
|
|
2235
|
+
* Controls how tombstoned actors are returned.
|
|
2236
|
+
*
|
|
2237
|
+
* By default, tombstones are suppressed and returned as `null`. Set this to
|
|
2238
|
+
* `"passthrough"` to receive a {@link Tombstone} result instead.
|
|
2239
|
+
*/
|
|
2240
|
+
readonly tombstone?: "suppress" | "passthrough";
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2228
2243
|
* A context for a request.
|
|
2229
2244
|
*/
|
|
2230
2245
|
interface RequestContext<TContextData> extends Context<TContextData> {
|
|
@@ -2254,6 +2269,46 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
2254
2269
|
*/
|
|
2255
2270
|
getActor(identifier: string): Promise<Actor | null>;
|
|
2256
2271
|
/**
|
|
2272
|
+
* Gets an {@link Actor} object or {@link Tombstone} for the given
|
|
2273
|
+
* identifier.
|
|
2274
|
+
* @param identifier The actor's identifier.
|
|
2275
|
+
* @param options Options for getting the actor. Set
|
|
2276
|
+
* `options.tombstone` to `"passthrough"` to receive
|
|
2277
|
+
* tombstoned actors instead of `null`.
|
|
2278
|
+
* @returns The actor object, a tombstone, or `null` if the actor is not
|
|
2279
|
+
* found.
|
|
2280
|
+
* @throws {Error} If no actor dispatcher is available.
|
|
2281
|
+
* @since 2.2.0
|
|
2282
|
+
*/
|
|
2283
|
+
getActor(identifier: string, options: GetActorOptions & {
|
|
2284
|
+
readonly tombstone: "passthrough";
|
|
2285
|
+
}): Promise<Actor | Tombstone | null>;
|
|
2286
|
+
/**
|
|
2287
|
+
* Gets an {@link Actor} object for the given identifier.
|
|
2288
|
+
* @param identifier The actor's identifier.
|
|
2289
|
+
* @param options Options for getting the actor.
|
|
2290
|
+
* @returns The actor object, or `null` if the actor is not found.
|
|
2291
|
+
* Tombstoned actors are suppressed unless `options.tombstone` is
|
|
2292
|
+
* `"passthrough"`.
|
|
2293
|
+
* @throws {Error} If no actor dispatcher is available.
|
|
2294
|
+
* @since 2.2.0
|
|
2295
|
+
*/
|
|
2296
|
+
getActor(identifier: string, options: GetActorOptions & {
|
|
2297
|
+
readonly tombstone?: "suppress" | undefined;
|
|
2298
|
+
}): Promise<Actor | null>;
|
|
2299
|
+
/**
|
|
2300
|
+
* Gets an {@link Actor} object or {@link Tombstone} for the given
|
|
2301
|
+
* identifier.
|
|
2302
|
+
* @param identifier The actor's identifier.
|
|
2303
|
+
* @param options Options for getting the actor.
|
|
2304
|
+
* @returns The actor object, a tombstone, or `null` if the actor is not
|
|
2305
|
+
* found. This broad overload is used when the caller passes an
|
|
2306
|
+
* options value whose `tombstone` mode is not known statically.
|
|
2307
|
+
* @throws {Error} If no actor dispatcher is available.
|
|
2308
|
+
* @since 2.2.0
|
|
2309
|
+
*/
|
|
2310
|
+
getActor(identifier: string, options: GetActorOptions): Promise<Actor | Tombstone | null>;
|
|
2311
|
+
/**
|
|
2257
2312
|
* Gets an object of the given class with the given values.
|
|
2258
2313
|
* @param cls The class to instantiate.
|
|
2259
2314
|
* @param values The values to pass to the object dispatcher.
|
|
@@ -2587,4 +2642,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2587
2642
|
readonly multikey: Multikey;
|
|
2588
2643
|
}
|
|
2589
2644
|
//#endregion
|
|
2590
|
-
export {
|
|
2645
|
+
export { ActorHandleMapper as $, FederationQueueOptions as A, RouterOptions as B, IdempotencyStrategy as C, digest as Ct, Rfc6570Expression as D, ObjectCallbackSetters as E, createExponentialBackoffPolicy as F, InProcessMessageQueue as G, RespondWithObjectOptions as H, Message as I, MessageQueueEnqueueOptions as J, InProcessMessageQueueOptions as K, createFederationBuilder as L, CreateExponentialBackoffPolicyOptions as M, RetryContext as N, FederationKvPrefixes as O, RetryPolicy as P, ActorDispatcher as Q, Router as R, IdempotencyKeyCallback as S, buildCollectionSynchronizationHeader as St, InboxListenerSetters as T, respondWithObject as U, RouterRouteResult as V, respondWithObjectIfAcceptable as W, ParallelMessageQueue as X, MessageQueueListenOptions as Y, ActorAliasMapper as Z, Federation as _, UnverifiedActivityReason as _t, GetSignedKeyOptions as a, CustomCollectionCounter as at, FederationOptions as b, SenderKeyPair as bt, RequestContext as c, InboxErrorHandler as ct, SendActivityOptionsForCollection as d, ObjectAuthorizePredicate as dt, ActorKeyPairsDispatcher as et, ActorCallbackSetters as f, ObjectDispatcher as ft, Federatable as g, UnverifiedActivityHandler as gt, CustomCollectionCallbackSetters as h, SharedInboxKeyDispatcher as ht, GetActorOptions as i, CollectionDispatcher as it, createFederation as j, FederationOrigin as k, RouteActivityOptions as l, InboxListener as lt, ConstructorWithTypeId as m, OutboxPermanentFailureHandler as mt, Context as n, CollectionCounter as nt, InboxContext as o, CustomCollectionCursor as ot, CollectionCallbackSetters as p, OutboxErrorHandler as pt, MessageQueue as q, ForwardActivityOptions as r, CollectionCursor as rt, ParseUriResult as s, CustomCollectionDispatcher as st, ActorKeyPair as t, AuthorizePredicate as tt, SendActivityOptions as u, NodeInfoDispatcher as ut, FederationBuilder as v, WebFingerLinksDispatcher as vt, InboxChallengePolicy as w, ActivityTransformer as wt, FederationStartQueueOptions as x, PageItems as xt, FederationFetchOptions as y, SendActivityError as yt, RouterError 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-CC3yOGF0.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-DukFwiXf.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";
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { a as assertExists } from "../std__assert-Duiq_YC9.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
8
|
-
import { n as createFederationBuilder } from "../builder-
|
|
8
|
+
import { n as createFederationBuilder } from "../builder-BGzN0XIV.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/builder.test.ts
|
|
@@ -6,13 +6,13 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
6
6
|
import "../std__assert-Duiq_YC9.mjs";
|
|
7
7
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
8
8
|
import { r as parseAcceptSignature } from "../accept-Dd__NiUL.mjs";
|
|
9
|
-
import { s as signRequest } from "../http-
|
|
9
|
+
import { s as signRequest } from "../http-DukFwiXf.mjs";
|
|
10
10
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
|
|
11
11
|
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
12
|
-
import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-
|
|
13
|
-
import { t as InboxListenerSet } from "../inbox-
|
|
12
|
+
import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-BfOPomng.mjs";
|
|
13
|
+
import { t as InboxListenerSet } from "../inbox-wiVtdLY9.mjs";
|
|
14
14
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
15
|
-
import { Create, Note, Person } from "@fedify/vocab";
|
|
15
|
+
import { Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
16
16
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
17
17
|
//#region src/federation/handler.test.ts
|
|
18
18
|
const QUOTE_CONTEXT_TERMS = {
|
|
@@ -31,8 +31,10 @@ const WRAPPER_QUOTE_CONTEXT_TERMS = {
|
|
|
31
31
|
QuoteRequest: "https://w3id.org/fep/044f#QuoteRequest"
|
|
32
32
|
};
|
|
33
33
|
test("handleActor()", async () => {
|
|
34
|
+
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
35
|
+
const deletedAt = Temporal.Instant.from("2024-01-15T00:00:00Z");
|
|
34
36
|
let context = createRequestContext({
|
|
35
|
-
federation
|
|
37
|
+
federation,
|
|
36
38
|
data: void 0,
|
|
37
39
|
url: new URL("https://example.com/"),
|
|
38
40
|
getActorUri(identifier) {
|
|
@@ -46,6 +48,13 @@ test("handleActor()", async () => {
|
|
|
46
48
|
name: "Someone"
|
|
47
49
|
});
|
|
48
50
|
};
|
|
51
|
+
const tombstoneDispatcher = (ctx, identifier) => {
|
|
52
|
+
if (identifier !== "gone") return null;
|
|
53
|
+
return new Tombstone({
|
|
54
|
+
id: ctx.getActorUri(identifier),
|
|
55
|
+
deleted: deletedAt
|
|
56
|
+
});
|
|
57
|
+
};
|
|
49
58
|
let onNotFoundCalled = null;
|
|
50
59
|
const onNotFound = (request) => {
|
|
51
60
|
onNotFoundCalled = request;
|
|
@@ -220,6 +229,42 @@ test("handleActor()", async () => {
|
|
|
220
229
|
});
|
|
221
230
|
assertEquals(onNotFoundCalled, null);
|
|
222
231
|
assertEquals(onUnauthorizedCalled, null);
|
|
232
|
+
onNotFoundCalled = null;
|
|
233
|
+
response = await handleActor(context.request, {
|
|
234
|
+
context,
|
|
235
|
+
identifier: "gone",
|
|
236
|
+
actorDispatcher: tombstoneDispatcher,
|
|
237
|
+
authorizePredicate: () => false,
|
|
238
|
+
onNotFound,
|
|
239
|
+
onUnauthorized
|
|
240
|
+
});
|
|
241
|
+
assertEquals(response.status, 401);
|
|
242
|
+
assertEquals(onNotFoundCalled, null);
|
|
243
|
+
assertEquals(onUnauthorizedCalled, context.request);
|
|
244
|
+
onUnauthorizedCalled = null;
|
|
245
|
+
response = await handleActor(context.request, {
|
|
246
|
+
context,
|
|
247
|
+
identifier: "gone",
|
|
248
|
+
actorDispatcher: tombstoneDispatcher,
|
|
249
|
+
authorizePredicate: () => true,
|
|
250
|
+
onNotFound,
|
|
251
|
+
onUnauthorized
|
|
252
|
+
});
|
|
253
|
+
assertEquals(response.status, 410);
|
|
254
|
+
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
255
|
+
assertEquals(response.headers.get("Vary"), "Accept");
|
|
256
|
+
assertEquals(await response.json(), {
|
|
257
|
+
"@context": [
|
|
258
|
+
"https://www.w3.org/ns/activitystreams",
|
|
259
|
+
"https://w3id.org/security/data-integrity/v1",
|
|
260
|
+
"https://gotosocial.org/ns"
|
|
261
|
+
],
|
|
262
|
+
id: "https://example.com/users/gone",
|
|
263
|
+
type: "Tombstone",
|
|
264
|
+
deleted: "2024-01-15T00:00:00Z"
|
|
265
|
+
});
|
|
266
|
+
assertEquals(onNotFoundCalled, null);
|
|
267
|
+
assertEquals(onUnauthorizedCalled, null);
|
|
223
268
|
});
|
|
224
269
|
test("handleObject()", async () => {
|
|
225
270
|
let context = createRequestContext({
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-Duiq_YC9.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
7
|
-
import { n as signObject } from "../proof-
|
|
7
|
+
import { n as signObject } from "../proof-Dfy2T5tG.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
9
|
-
import { a as createFederation } from "../middleware-
|
|
9
|
+
import { a as createFederation } from "../middleware-BfOPomng.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
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
6
|
-
import { t as InboxListenerSet } from "../inbox-
|
|
6
|
+
import { t as InboxListenerSet } from "../inbox-wiVtdLY9.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
9
9
|
//#region src/federation/inbox.test.ts
|
|
@@ -10,14 +10,14 @@ 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 assert } from "../assert-ddO5KLpe.mjs";
|
|
13
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
13
|
+
import { l as verifyRequest, s as signRequest } from "../http-DukFwiXf.mjs";
|
|
14
14
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
15
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
16
|
-
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-
|
|
17
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
18
|
-
import { n as signObject, r as verifyObject } from "../proof-
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-B_eTYGFt.mjs";
|
|
16
|
+
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-D67kDIA0.mjs";
|
|
17
|
+
import { t as doesActorOwnKey } from "../owner-CxO6322k.mjs";
|
|
18
|
+
import { n as signObject, r as verifyObject } from "../proof-Dfy2T5tG.mjs";
|
|
19
19
|
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
20
|
-
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
20
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-BfOPomng.mjs";
|
|
21
21
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
22
22
|
import * as vocab from "@fedify/vocab";
|
|
23
23
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
|
@@ -669,12 +669,24 @@ test({
|
|
|
669
669
|
assertEquals(await signedCtx2.getSignedKeyOwner(), expectedOwner);
|
|
670
670
|
assertEquals(await signedCtx2.getSignedKey(), rsaPublicKey3);
|
|
671
671
|
assertEquals(await signedCtx2.getSignedKeyOwner(), expectedOwner);
|
|
672
|
-
federation.setActorDispatcher("/users/{identifier}", (
|
|
672
|
+
federation.setActorDispatcher("/users/{identifier}", (ctx, identifier) => identifier === "gone" ? new vocab.Tombstone({
|
|
673
|
+
id: ctx.getActorUri(identifier),
|
|
674
|
+
deleted: Temporal.Instant.from("2024-01-15T00:00:00Z")
|
|
675
|
+
}) : new vocab.Person({ preferredUsername: identifier }));
|
|
673
676
|
const ctx2 = federation.createContext(req, 789);
|
|
674
677
|
assertEquals(ctx2.request, req);
|
|
675
678
|
assertEquals(ctx2.url, new URL("https://example.com/"));
|
|
676
679
|
assertEquals(ctx2.data, 789);
|
|
677
680
|
assertEquals(await ctx2.getActor("john"), new vocab.Person({ preferredUsername: "john" }));
|
|
681
|
+
assertEquals(await ctx2.getActor("gone"), null);
|
|
682
|
+
assertEquals(await ctx2.getActor("gone", { tombstone: "passthrough" }), new vocab.Tombstone({
|
|
683
|
+
id: new URL("https://example.com/users/gone"),
|
|
684
|
+
deleted: Temporal.Instant.from("2024-01-15T00:00:00Z")
|
|
685
|
+
}));
|
|
686
|
+
assertEquals(await ctx2.getActor("gone", { tombstone: "passthrough" }), new vocab.Tombstone({
|
|
687
|
+
id: new URL("https://example.com/users/gone"),
|
|
688
|
+
deleted: Temporal.Instant.from("2024-01-15T00:00:00Z")
|
|
689
|
+
}));
|
|
678
690
|
federation.setObjectDispatcher(vocab.Note, "/users/{identifier}/notes/{id}", (_ctx, values) => {
|
|
679
691
|
return new vocab.Note({ summary: `Note ${values.id} by ${values.identifier}` });
|
|
680
692
|
});
|
|
@@ -745,6 +757,10 @@ test("Federation.fetch()", async (t) => {
|
|
|
745
757
|
});
|
|
746
758
|
federation.setActorDispatcher("/users/{identifier}", (ctx, identifier) => {
|
|
747
759
|
dispatches.push(identifier);
|
|
760
|
+
if (identifier === "gone") return new vocab.Tombstone({
|
|
761
|
+
id: ctx.getActorUri(identifier),
|
|
762
|
+
deleted: Temporal.Instant.from("2024-01-15T00:00:00Z")
|
|
763
|
+
});
|
|
748
764
|
return new vocab.Person({
|
|
749
765
|
id: ctx.getActorUri(identifier),
|
|
750
766
|
inbox: ctx.getInboxUri(identifier),
|
|
@@ -845,6 +861,41 @@ test("Federation.fetch()", async (t) => {
|
|
|
845
861
|
assertEquals(dispatches, ["activity"]);
|
|
846
862
|
assertEquals(response.status, 200);
|
|
847
863
|
});
|
|
864
|
+
await t.step("GET tombstoned actor returns 410 Gone", async () => {
|
|
865
|
+
const { federation, dispatches } = createTestContext();
|
|
866
|
+
const response = await federation.fetch(new Request("https://example.com/users/gone", {
|
|
867
|
+
method: "GET",
|
|
868
|
+
headers: { "Accept": "application/activity+json" }
|
|
869
|
+
}), { contextData: void 0 });
|
|
870
|
+
assertEquals(dispatches, ["gone"]);
|
|
871
|
+
assertEquals(response.status, 410);
|
|
872
|
+
assertEquals(await response.json(), {
|
|
873
|
+
"@context": [
|
|
874
|
+
"https://www.w3.org/ns/activitystreams",
|
|
875
|
+
"https://w3id.org/security/data-integrity/v1",
|
|
876
|
+
"https://gotosocial.org/ns"
|
|
877
|
+
],
|
|
878
|
+
id: "https://example.com/users/gone",
|
|
879
|
+
type: "Tombstone",
|
|
880
|
+
deleted: "2024-01-15T00:00:00Z"
|
|
881
|
+
});
|
|
882
|
+
});
|
|
883
|
+
await t.step("WebFinger for tombstoned actor returns 410 Gone", async () => {
|
|
884
|
+
const { federation, dispatches } = createTestContext();
|
|
885
|
+
const response = await federation.fetch(new Request("https://example.com/.well-known/webfinger?resource=acct:gone@example.com"), { contextData: void 0 });
|
|
886
|
+
assertEquals(dispatches, ["gone"]);
|
|
887
|
+
assertEquals(response.status, 410);
|
|
888
|
+
assertEquals(response.headers.get("Access-Control-Allow-Origin"), "*");
|
|
889
|
+
});
|
|
890
|
+
await t.step("POST to tombstoned inbox returns not found", async () => {
|
|
891
|
+
const { federation, inbox } = createTestContext();
|
|
892
|
+
const response = await federation.fetch(new Request("https://example.com/users/gone/inbox", {
|
|
893
|
+
method: "POST",
|
|
894
|
+
headers: { "accept": "application/ld+json" }
|
|
895
|
+
}), { contextData: void 0 });
|
|
896
|
+
assertEquals(inbox, []);
|
|
897
|
+
assertEquals(response.status, 404);
|
|
898
|
+
});
|
|
848
899
|
await t.step("onNotAcceptable with GET", async () => {
|
|
849
900
|
const { federation } = createTestContext();
|
|
850
901
|
let notAcceptableCalled = false;
|
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-CP-fzmy_.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ActorHandleMapper, A as FederationQueueOptions, B as RouterOptions, C as IdempotencyStrategy, Ct as digest, D as Rfc6570Expression, E as ObjectCallbackSetters, F as createExponentialBackoffPolicy, G as InProcessMessageQueue, H as RespondWithObjectOptions, I as Message, J as MessageQueueEnqueueOptions, K as InProcessMessageQueueOptions, L as createFederationBuilder, M as CreateExponentialBackoffPolicyOptions, N as RetryContext, O as FederationKvPrefixes, P as RetryPolicy, Q as ActorDispatcher, R as Router, S as IdempotencyKeyCallback, St as buildCollectionSynchronizationHeader, T as InboxListenerSetters, U as respondWithObject, V as RouterRouteResult, W as respondWithObjectIfAcceptable, X as ParallelMessageQueue, Y as MessageQueueListenOptions, Z as ActorAliasMapper, _ as Federation, _t as UnverifiedActivityReason, a as GetSignedKeyOptions, at as CustomCollectionCounter, b as FederationOptions, bt as SenderKeyPair, c as RequestContext, ct as InboxErrorHandler, d as SendActivityOptionsForCollection, dt as ObjectAuthorizePredicate, et as ActorKeyPairsDispatcher, f as ActorCallbackSetters, ft as ObjectDispatcher, g as Federatable, gt as UnverifiedActivityHandler, h as CustomCollectionCallbackSetters, ht as SharedInboxKeyDispatcher, i as GetActorOptions, it as CollectionDispatcher, j as createFederation, k as FederationOrigin, l as RouteActivityOptions, lt as InboxListener, m as ConstructorWithTypeId, mt as OutboxPermanentFailureHandler, n as Context, nt as CollectionCounter, o as InboxContext, ot as CustomCollectionCursor, p as CollectionCallbackSetters, pt as OutboxErrorHandler, q as MessageQueue, r as ForwardActivityOptions, rt as CollectionCursor, s as ParseUriResult, st as CustomCollectionDispatcher, t as ActorKeyPair, tt as AuthorizePredicate, u as SendActivityOptions, ut as NodeInfoDispatcher, v as FederationBuilder, vt as WebFingerLinksDispatcher, w as InboxChallengePolicy, x as FederationStartQueueOptions, xt as PageItems, y as FederationFetchOptions, yt as SendActivityError, z as RouterError } from "../context-DYDPdoCb.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, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, 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-CEohtXhV.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, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, 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 ActorHandleMapper, A as FederationQueueOptions, B as RouterOptions, C as IdempotencyStrategy, Ct as digest, D as Rfc6570Expression, E as ObjectCallbackSetters, F as createExponentialBackoffPolicy, G as InProcessMessageQueue, H as RespondWithObjectOptions, I as Message, J as MessageQueueEnqueueOptions, K as InProcessMessageQueueOptions, L as createFederationBuilder, M as CreateExponentialBackoffPolicyOptions, N as RetryContext, O as FederationKvPrefixes, P as RetryPolicy, Q as ActorDispatcher, R as Router, S as IdempotencyKeyCallback, St as buildCollectionSynchronizationHeader, T as InboxListenerSetters, U as respondWithObject, V as RouterRouteResult, W as respondWithObjectIfAcceptable, X as ParallelMessageQueue, Y as MessageQueueListenOptions, Z as ActorAliasMapper, _ as Federation, _t as UnverifiedActivityReason, a as GetSignedKeyOptions, at as CustomCollectionCounter, b as FederationOptions, bt as SenderKeyPair, c as RequestContext, ct as InboxErrorHandler, d as SendActivityOptionsForCollection, dt as ObjectAuthorizePredicate, et as ActorKeyPairsDispatcher, f as ActorCallbackSetters, ft as ObjectDispatcher, g as Federatable, gt as UnverifiedActivityHandler, h as CustomCollectionCallbackSetters, ht as SharedInboxKeyDispatcher, i as GetActorOptions, it as CollectionDispatcher, j as createFederation, k as FederationOrigin, l as RouteActivityOptions, lt as InboxListener, m as ConstructorWithTypeId, mt as OutboxPermanentFailureHandler, n as Context, nt as CollectionCounter, o as InboxContext, ot as CustomCollectionCursor, p as CollectionCallbackSetters, pt as OutboxErrorHandler, q as MessageQueue, r as ForwardActivityOptions, rt as CollectionCursor, s as ParseUriResult, st as CustomCollectionDispatcher, t as ActorKeyPair, tt as AuthorizePredicate, u as SendActivityOptions, ut as NodeInfoDispatcher, v as FederationBuilder, vt as WebFingerLinksDispatcher, w as InboxChallengePolicy, x as FederationStartQueueOptions, xt as PageItems, y as FederationFetchOptions, yt as SendActivityError, z as RouterError } from "../context-78ecvxf5.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, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, 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-CokIUYDr.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, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, 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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
|
-
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-
|
|
3
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-CXkoAB0x.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -8,10 +8,10 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
|
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
10
10
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
11
|
+
import { l as verifyRequest } from "../http-DukFwiXf.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-CxO6322k.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-urWboKs6.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
17
17
|
//#region src/federation/send.test.ts
|