@fedify/fedify 2.0.0-dev.379 → 2.0.0-dev.380
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-CTaPayj3.js → builder-yo-Bb1YI.js} +12 -57
- package/dist/compat/mod.d.cts +2 -2
- package/dist/compat/mod.d.ts +2 -2
- package/dist/compat/transformers.test.js +11 -11
- package/dist/{context-Cf0-LmZC.d.cts → context-Bo8rHkgD.d.cts} +15 -45
- package/dist/{context-liIe6DFH.d.ts → context-CvI-m4eX.d.ts} +15 -45
- package/dist/{deno-DqzG_RZH.js → deno-CtGMjqVA.js} +1 -1
- package/dist/{docloader-DzdrkeHk.js → docloader-DFtiZSjQ.js} +4 -12
- package/dist/federation/builder.test.js +3 -3
- package/dist/federation/handler.test.js +45 -45
- package/dist/federation/idempotency.test.js +11 -11
- package/dist/federation/inbox.test.js +2 -2
- package/dist/federation/middleware.test.js +43 -68
- package/dist/federation/mod.cjs +4 -4
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +4 -4
- package/dist/federation/send.test.js +5 -5
- package/dist/federation/webfinger.test.js +12 -15
- package/dist/{http-BgVFYDxB.cjs → http-DL7I-lJ1.cjs} +1 -1
- package/dist/{http-wC3zLKG0.js → http-MKkRvGCD.js} +2 -2
- package/dist/{http-wpL3tTw3.js → http-d87H9gTL.js} +1 -1
- package/dist/{inbox-DD3ldbso.js → inbox-t2HfUOpK.js} +1 -1
- package/dist/{key-DT5WUsoA.js → key-BaU3dCbr.js} +1 -1
- package/dist/{kv-cache-dm5snJVx.js → kv-cache-BlAk9XRp.js} +2 -4
- package/dist/{kv-cache-fDtLLSX6.cjs → kv-cache-P81gWIMl.cjs} +1 -3
- package/dist/{ld-DkkOCVAX.js → ld-Cl1Q2ID2.js} +2 -2
- package/dist/{middleware-1jFftSD2.js → middleware-C8EKZVUa.js} +48 -128
- package/dist/{middleware-DTsAIZ_v.js → middleware-CahwrUem.js} +4 -4
- package/dist/{middleware-CyiaCQia.cjs → middleware-CeNadM06.cjs} +51 -176
- package/dist/middleware-DzqLMJf8.cjs +12 -0
- package/dist/{middleware-BPQUgG_4.js → middleware-QKMHl3jD.js} +11 -11
- package/dist/{middleware-BgA11Zdl.js → middleware-qCIC-vDz.js} +51 -176
- package/dist/{mod-CvhyLrjX.d.ts → mod-CevNbUol.d.ts} +0 -18
- package/dist/{mod-Do_sZWAA.d.cts → mod-DyzMRG8B.d.cts} +1 -1
- package/dist/{mod-DWaA45ef.d.cts → mod-ErTjUJs9.d.cts} +0 -18
- package/dist/{mod-B9_l3te3.d.ts → mod-PmuFg9QD.d.ts} +1 -1
- package/dist/{mod-Dquroqiv.d.ts → mod-hcb60sG1.d.ts} +1 -1
- package/dist/{mod-H3ScYaOb.d.cts → mod-jzy1r56s.d.cts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.js +11 -11
- package/dist/{owner-DkyFfykp.js → owner-CLtVml91.js} +1 -1
- package/dist/{proof-YGxK2bz_.js → proof-0NbL8saz.js} +2 -2
- package/dist/{proof-DiizpGmV.js → proof-B7X2V-RL.js} +1 -1
- package/dist/{proof-BAMTO1-Z.cjs → proof-BYSTK-fO.cjs} +1 -1
- package/dist/{send-Bh3NMyL9.js → send-yCNNrsU2.js} +2 -2
- package/dist/sig/http.test.js +3 -3
- package/dist/sig/key.test.js +2 -2
- package/dist/sig/ld.test.js +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.js +3 -3
- package/dist/sig/proof.test.js +3 -3
- package/dist/testing/mod.d.ts +9 -32
- package/dist/utils/docloader.test.js +4 -4
- package/dist/utils/mod.cjs +2 -2
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +2 -2
- package/package.json +5 -5
- package/dist/middleware-DPeL5rKU.cjs +0 -12
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import { deno_default } from "./deno-
|
|
6
|
+
import { deno_default } from "./deno-CtGMjqVA.js";
|
|
7
7
|
import { getNodeInfo } from "./client-Dg7OfUDA.js";
|
|
8
8
|
import { RouterError } from "./router-D9eI0s4b.js";
|
|
9
9
|
import { nodeInfoToJson } from "./types-CPz01LGH.js";
|
|
10
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
|
11
|
-
import { verifyRequest } from "./http-
|
|
12
|
-
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-
|
|
13
|
-
import { doesActorOwnKey, getKeyOwner } from "./owner-
|
|
14
|
-
import { signObject, verifyObject } from "./proof-
|
|
15
|
-
import { getAuthenticatedDocumentLoader } from "./docloader-
|
|
10
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-BaU3dCbr.js";
|
|
11
|
+
import { verifyRequest } from "./http-MKkRvGCD.js";
|
|
12
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-Cl1Q2ID2.js";
|
|
13
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-CLtVml91.js";
|
|
14
|
+
import { signObject, verifyObject } from "./proof-0NbL8saz.js";
|
|
15
|
+
import { getAuthenticatedDocumentLoader } from "./docloader-DFtiZSjQ.js";
|
|
16
16
|
import { kvCache } from "./kv-cache-B__dHl7g.js";
|
|
17
|
-
import { routeActivity } from "./inbox-
|
|
18
|
-
import { FederationBuilderImpl } from "./builder-
|
|
17
|
+
import { routeActivity } from "./inbox-t2HfUOpK.js";
|
|
18
|
+
import { FederationBuilderImpl } from "./builder-yo-Bb1YI.js";
|
|
19
19
|
import { buildCollectionSynchronizationHeader } from "./collection-CcnIw1qY.js";
|
|
20
20
|
import { KvKeyCache } from "./keycache-DRxpZ5r9.js";
|
|
21
21
|
import { acceptsJsonLd } from "./negotiation-5NPJL6zp.js";
|
|
22
22
|
import { createExponentialBackoffPolicy } from "./retry-D4GJ670a.js";
|
|
23
|
-
import { SendActivityError, extractInboxes, sendActivity } from "./send-
|
|
23
|
+
import { SendActivityError, extractInboxes, sendActivity } from "./send-yCNNrsU2.js";
|
|
24
24
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
25
25
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
26
26
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -1670,7 +1670,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1670
1670
|
if (message.identifier != null) context$1 = this.#createContext(baseUrl, ctxData, { documentLoader: await context$1.getDocumentLoader({ identifier: message.identifier }) });
|
|
1671
1671
|
else if (this.sharedInboxKeyDispatcher != null) {
|
|
1672
1672
|
const identity = await this.sharedInboxKeyDispatcher(context$1);
|
|
1673
|
-
if (identity != null) context$1 = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity
|
|
1673
|
+
if (identity != null) context$1 = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity ? await context$1.getDocumentLoader(identity) : context$1.getDocumentLoader(identity) });
|
|
1674
1674
|
}
|
|
1675
1675
|
const activity = await Activity.fromJsonLd(message.activity, context$1);
|
|
1676
1676
|
span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
|
|
@@ -2066,9 +2066,9 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2066
2066
|
if (request.method !== "POST" && !acceptsJsonLd(request)) return await onNotAcceptable(request);
|
|
2067
2067
|
switch (routeName) {
|
|
2068
2068
|
case "actor":
|
|
2069
|
-
context$1 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier
|
|
2069
|
+
context$1 = this.#createContext(request, contextData, { invokedFromActorDispatcher: { identifier: route.values.identifier } });
|
|
2070
2070
|
return await handleActor(request, {
|
|
2071
|
-
identifier: route.values.identifier
|
|
2071
|
+
identifier: route.values.identifier,
|
|
2072
2072
|
context: context$1,
|
|
2073
2073
|
actorDispatcher: this.actorCallbacks?.dispatcher,
|
|
2074
2074
|
authorizePredicate: this.actorCallbacks?.authorizePredicate,
|
|
@@ -2094,7 +2094,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2094
2094
|
}
|
|
2095
2095
|
case "outbox": return await handleCollection(request, {
|
|
2096
2096
|
name: "outbox",
|
|
2097
|
-
identifier: route.values.identifier
|
|
2097
|
+
identifier: route.values.identifier,
|
|
2098
2098
|
uriGetter: context$1.getOutboxUri.bind(context$1),
|
|
2099
2099
|
context: context$1,
|
|
2100
2100
|
collectionCallbacks: this.outboxCallbacks,
|
|
@@ -2105,7 +2105,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2105
2105
|
case "inbox":
|
|
2106
2106
|
if (request.method !== "POST") return await handleCollection(request, {
|
|
2107
2107
|
name: "inbox",
|
|
2108
|
-
identifier: route.values.identifier
|
|
2108
|
+
identifier: route.values.identifier,
|
|
2109
2109
|
uriGetter: context$1.getInboxUri.bind(context$1),
|
|
2110
2110
|
context: context$1,
|
|
2111
2111
|
collectionCallbacks: this.inboxCallbacks,
|
|
@@ -2113,15 +2113,15 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2113
2113
|
onUnauthorized,
|
|
2114
2114
|
onNotFound
|
|
2115
2115
|
});
|
|
2116
|
-
context$1 = this.#createContext(request, contextData, { documentLoader: await context$1.getDocumentLoader({ identifier: route.values.identifier
|
|
2116
|
+
context$1 = this.#createContext(request, contextData, { documentLoader: await context$1.getDocumentLoader({ identifier: route.values.identifier }) });
|
|
2117
2117
|
case "sharedInbox":
|
|
2118
2118
|
if (routeName !== "inbox" && this.sharedInboxKeyDispatcher != null) {
|
|
2119
2119
|
const identity = await this.sharedInboxKeyDispatcher(context$1);
|
|
2120
|
-
if (identity != null) context$1 = this.#createContext(request, contextData, { documentLoader: "identifier" in identity || "username" in identity
|
|
2120
|
+
if (identity != null) context$1 = this.#createContext(request, contextData, { documentLoader: "identifier" in identity || "username" in identity ? await context$1.getDocumentLoader(identity) : context$1.getDocumentLoader(identity) });
|
|
2121
2121
|
}
|
|
2122
2122
|
if (!this.manuallyStartQueue) this._startQueueInternal(contextData);
|
|
2123
2123
|
return await handleInbox(request, {
|
|
2124
|
-
recipient: route.values.identifier ??
|
|
2124
|
+
recipient: route.values.identifier ?? null,
|
|
2125
2125
|
context: context$1,
|
|
2126
2126
|
inboxContextFactory: context$1.toInboxContext.bind(context$1),
|
|
2127
2127
|
kv: this.kv,
|
|
@@ -2138,7 +2138,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2138
2138
|
});
|
|
2139
2139
|
case "following": return await handleCollection(request, {
|
|
2140
2140
|
name: "following",
|
|
2141
|
-
identifier: route.values.identifier
|
|
2141
|
+
identifier: route.values.identifier,
|
|
2142
2142
|
uriGetter: context$1.getFollowingUri.bind(context$1),
|
|
2143
2143
|
context: context$1,
|
|
2144
2144
|
collectionCallbacks: this.followingCallbacks,
|
|
@@ -2155,7 +2155,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
return await handleCollection(request, {
|
|
2157
2157
|
name: "followers",
|
|
2158
|
-
identifier: route.values.identifier
|
|
2158
|
+
identifier: route.values.identifier,
|
|
2159
2159
|
uriGetter: baseUrl == null ? context$1.getFollowersUri.bind(context$1) : (identifier) => {
|
|
2160
2160
|
const uri = context$1.getFollowersUri(identifier);
|
|
2161
2161
|
uri.searchParams.set("base-url", baseUrl);
|
|
@@ -2172,7 +2172,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2172
2172
|
}
|
|
2173
2173
|
case "liked": return await handleCollection(request, {
|
|
2174
2174
|
name: "liked",
|
|
2175
|
-
identifier: route.values.identifier
|
|
2175
|
+
identifier: route.values.identifier,
|
|
2176
2176
|
uriGetter: context$1.getLikedUri.bind(context$1),
|
|
2177
2177
|
context: context$1,
|
|
2178
2178
|
collectionCallbacks: this.likedCallbacks,
|
|
@@ -2182,7 +2182,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2182
2182
|
});
|
|
2183
2183
|
case "featured": return await handleCollection(request, {
|
|
2184
2184
|
name: "featured",
|
|
2185
|
-
identifier: route.values.identifier
|
|
2185
|
+
identifier: route.values.identifier,
|
|
2186
2186
|
uriGetter: context$1.getFeaturedUri.bind(context$1),
|
|
2187
2187
|
context: context$1,
|
|
2188
2188
|
collectionCallbacks: this.featuredCallbacks,
|
|
@@ -2192,7 +2192,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2192
2192
|
});
|
|
2193
2193
|
case "featuredTags": return await handleCollection(request, {
|
|
2194
2194
|
name: "featured tags",
|
|
2195
|
-
identifier: route.values.identifier
|
|
2195
|
+
identifier: route.values.identifier,
|
|
2196
2196
|
uriGetter: context$1.getFeaturedTagsUri.bind(context$1),
|
|
2197
2197
|
context: context$1,
|
|
2198
2198
|
collectionCallbacks: this.featuredTagsCallbacks,
|
|
@@ -2290,10 +2290,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2290
2290
|
return new URL(path, this.canonicalOrigin);
|
|
2291
2291
|
}
|
|
2292
2292
|
getActorUri(identifier) {
|
|
2293
|
-
const path = this.federation.router.build("actor", {
|
|
2294
|
-
identifier,
|
|
2295
|
-
handle: identifier
|
|
2296
|
-
});
|
|
2293
|
+
const path = this.federation.router.build("actor", { identifier });
|
|
2297
2294
|
if (path == null) throw new RouterError("No actor dispatcher registered.");
|
|
2298
2295
|
return new URL(path, this.canonicalOrigin);
|
|
2299
2296
|
}
|
|
@@ -2306,10 +2303,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2306
2303
|
return new URL(path, this.canonicalOrigin);
|
|
2307
2304
|
}
|
|
2308
2305
|
getOutboxUri(identifier) {
|
|
2309
|
-
const path = this.federation.router.build("outbox", {
|
|
2310
|
-
identifier,
|
|
2311
|
-
handle: identifier
|
|
2312
|
-
});
|
|
2306
|
+
const path = this.federation.router.build("outbox", { identifier });
|
|
2313
2307
|
if (path == null) throw new RouterError("No outbox dispatcher registered.");
|
|
2314
2308
|
return new URL(path, this.canonicalOrigin);
|
|
2315
2309
|
}
|
|
@@ -2319,50 +2313,32 @@ var ContextImpl = class ContextImpl {
|
|
|
2319
2313
|
if (path$1 == null) throw new RouterError("No shared inbox path registered.");
|
|
2320
2314
|
return new URL(path$1, this.canonicalOrigin);
|
|
2321
2315
|
}
|
|
2322
|
-
const path = this.federation.router.build("inbox", {
|
|
2323
|
-
identifier,
|
|
2324
|
-
handle: identifier
|
|
2325
|
-
});
|
|
2316
|
+
const path = this.federation.router.build("inbox", { identifier });
|
|
2326
2317
|
if (path == null) throw new RouterError("No inbox path registered.");
|
|
2327
2318
|
return new URL(path, this.canonicalOrigin);
|
|
2328
2319
|
}
|
|
2329
2320
|
getFollowingUri(identifier) {
|
|
2330
|
-
const path = this.federation.router.build("following", {
|
|
2331
|
-
identifier,
|
|
2332
|
-
handle: identifier
|
|
2333
|
-
});
|
|
2321
|
+
const path = this.federation.router.build("following", { identifier });
|
|
2334
2322
|
if (path == null) throw new RouterError("No following collection path registered.");
|
|
2335
2323
|
return new URL(path, this.canonicalOrigin);
|
|
2336
2324
|
}
|
|
2337
2325
|
getFollowersUri(identifier) {
|
|
2338
|
-
const path = this.federation.router.build("followers", {
|
|
2339
|
-
identifier,
|
|
2340
|
-
handle: identifier
|
|
2341
|
-
});
|
|
2326
|
+
const path = this.federation.router.build("followers", { identifier });
|
|
2342
2327
|
if (path == null) throw new RouterError("No followers collection path registered.");
|
|
2343
2328
|
return new URL(path, this.canonicalOrigin);
|
|
2344
2329
|
}
|
|
2345
2330
|
getLikedUri(identifier) {
|
|
2346
|
-
const path = this.federation.router.build("liked", {
|
|
2347
|
-
identifier,
|
|
2348
|
-
handle: identifier
|
|
2349
|
-
});
|
|
2331
|
+
const path = this.federation.router.build("liked", { identifier });
|
|
2350
2332
|
if (path == null) throw new RouterError("No liked collection path registered.");
|
|
2351
2333
|
return new URL(path, this.canonicalOrigin);
|
|
2352
2334
|
}
|
|
2353
2335
|
getFeaturedUri(identifier) {
|
|
2354
|
-
const path = this.federation.router.build("featured", {
|
|
2355
|
-
identifier,
|
|
2356
|
-
handle: identifier
|
|
2357
|
-
});
|
|
2336
|
+
const path = this.federation.router.build("featured", { identifier });
|
|
2358
2337
|
if (path == null) throw new RouterError("No featured collection path registered.");
|
|
2359
2338
|
return new URL(path, this.canonicalOrigin);
|
|
2360
2339
|
}
|
|
2361
2340
|
getFeaturedTagsUri(identifier) {
|
|
2362
|
-
const path = this.federation.router.build("featuredTags", {
|
|
2363
|
-
identifier,
|
|
2364
|
-
handle: identifier
|
|
2365
|
-
});
|
|
2341
|
+
const path = this.federation.router.build("featuredTags", { identifier });
|
|
2366
2342
|
if (path == null) throw new RouterError("No featured tags collection path registered.");
|
|
2367
2343
|
return new URL(path, this.canonicalOrigin);
|
|
2368
2344
|
}
|
|
@@ -2375,24 +2351,15 @@ var ContextImpl = class ContextImpl {
|
|
|
2375
2351
|
if (uri == null) return null;
|
|
2376
2352
|
if (uri.origin !== this.origin && uri.origin !== this.canonicalOrigin) return null;
|
|
2377
2353
|
const route = this.federation.router.route(uri.pathname);
|
|
2378
|
-
const logger$2 = getLogger(["fedify", "federation"]);
|
|
2379
2354
|
if (route == null) return null;
|
|
2380
2355
|
else if (route.name === "sharedInbox") return {
|
|
2381
2356
|
type: "inbox",
|
|
2382
|
-
identifier: void 0
|
|
2383
|
-
get handle() {
|
|
2384
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2385
|
-
return void 0;
|
|
2386
|
-
}
|
|
2357
|
+
identifier: void 0
|
|
2387
2358
|
};
|
|
2388
|
-
const identifier =
|
|
2359
|
+
const identifier = route.values.identifier;
|
|
2389
2360
|
if (route.name === "actor") return {
|
|
2390
2361
|
type: "actor",
|
|
2391
|
-
identifier
|
|
2392
|
-
get handle() {
|
|
2393
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2394
|
-
return identifier;
|
|
2395
|
-
}
|
|
2362
|
+
identifier
|
|
2396
2363
|
};
|
|
2397
2364
|
else if (route.name.startsWith("object:")) {
|
|
2398
2365
|
const typeId = route.name.replace(/^object:/, "");
|
|
@@ -2404,59 +2371,31 @@ var ContextImpl = class ContextImpl {
|
|
|
2404
2371
|
};
|
|
2405
2372
|
} else if (route.name === "inbox") return {
|
|
2406
2373
|
type: "inbox",
|
|
2407
|
-
identifier
|
|
2408
|
-
get handle() {
|
|
2409
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2410
|
-
return identifier;
|
|
2411
|
-
}
|
|
2374
|
+
identifier
|
|
2412
2375
|
};
|
|
2413
2376
|
else if (route.name === "outbox") return {
|
|
2414
2377
|
type: "outbox",
|
|
2415
|
-
identifier
|
|
2416
|
-
get handle() {
|
|
2417
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2418
|
-
return identifier;
|
|
2419
|
-
}
|
|
2378
|
+
identifier
|
|
2420
2379
|
};
|
|
2421
2380
|
else if (route.name === "following") return {
|
|
2422
2381
|
type: "following",
|
|
2423
|
-
identifier
|
|
2424
|
-
get handle() {
|
|
2425
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2426
|
-
return identifier;
|
|
2427
|
-
}
|
|
2382
|
+
identifier
|
|
2428
2383
|
};
|
|
2429
2384
|
else if (route.name === "followers") return {
|
|
2430
2385
|
type: "followers",
|
|
2431
|
-
identifier
|
|
2432
|
-
get handle() {
|
|
2433
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2434
|
-
return identifier;
|
|
2435
|
-
}
|
|
2386
|
+
identifier
|
|
2436
2387
|
};
|
|
2437
2388
|
else if (route.name === "liked") return {
|
|
2438
2389
|
type: "liked",
|
|
2439
|
-
identifier
|
|
2440
|
-
get handle() {
|
|
2441
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2442
|
-
return identifier;
|
|
2443
|
-
}
|
|
2390
|
+
identifier
|
|
2444
2391
|
};
|
|
2445
2392
|
else if (route.name === "featured") return {
|
|
2446
2393
|
type: "featured",
|
|
2447
|
-
identifier
|
|
2448
|
-
get handle() {
|
|
2449
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2450
|
-
return identifier;
|
|
2451
|
-
}
|
|
2394
|
+
identifier
|
|
2452
2395
|
};
|
|
2453
2396
|
else if (route.name === "featuredTags") return {
|
|
2454
2397
|
type: "featuredTags",
|
|
2455
|
-
identifier
|
|
2456
|
-
get handle() {
|
|
2457
|
-
logger$2.warn("The ParseUriResult.handle property is deprecated; use ParseUriResult.identifier instead.");
|
|
2458
|
-
return identifier;
|
|
2459
|
-
}
|
|
2398
|
+
identifier
|
|
2460
2399
|
};
|
|
2461
2400
|
const collectionTypes = ["collection", "orderedCollection"];
|
|
2462
2401
|
const collectionRegex = /* @__PURE__ */ new RegExp(`^(${collectionTypes.join("|")}):(.*)$`);
|
|
@@ -2558,19 +2497,10 @@ var ContextImpl = class ContextImpl {
|
|
|
2558
2497
|
return null;
|
|
2559
2498
|
}
|
|
2560
2499
|
getDocumentLoader(identity) {
|
|
2561
|
-
if ("identifier" in identity || "username" in identity
|
|
2500
|
+
if ("identifier" in identity || "username" in identity) {
|
|
2562
2501
|
let identifierPromise;
|
|
2563
|
-
if ("username" in identity
|
|
2564
|
-
|
|
2565
|
-
if ("username" in identity) username = identity.username;
|
|
2566
|
-
else {
|
|
2567
|
-
username = identity.handle;
|
|
2568
|
-
getLogger([
|
|
2569
|
-
"fedify",
|
|
2570
|
-
"runtime",
|
|
2571
|
-
"docloader"
|
|
2572
|
-
]).warn("The \"handle\" property is deprecated; use \"identifier\" or \"username\" instead.", { identity });
|
|
2573
|
-
}
|
|
2502
|
+
if ("username" in identity) {
|
|
2503
|
+
const username = identity.username;
|
|
2574
2504
|
const mapper = this.federation.actorCallbacks?.handleMapper;
|
|
2575
2505
|
if (mapper == null) identifierPromise = Promise.resolve(username);
|
|
2576
2506
|
else {
|
|
@@ -2656,15 +2586,10 @@ var ContextImpl = class ContextImpl {
|
|
|
2656
2586
|
]);
|
|
2657
2587
|
let keys;
|
|
2658
2588
|
let identifier = null;
|
|
2659
|
-
if ("identifier" in sender || "username" in sender
|
|
2589
|
+
if ("identifier" in sender || "username" in sender) {
|
|
2660
2590
|
if ("identifier" in sender) identifier = sender.identifier;
|
|
2661
2591
|
else {
|
|
2662
|
-
|
|
2663
|
-
if ("username" in sender) username = sender.username;
|
|
2664
|
-
else {
|
|
2665
|
-
username = sender.handle;
|
|
2666
|
-
logger$2.warn("The \"handle\" property for the sender parameter is deprecated; use \"identifier\" or \"username\" instead.", { sender });
|
|
2667
|
-
}
|
|
2592
|
+
const username = sender.username;
|
|
2668
2593
|
if (this.federation.actorCallbacks?.handleMapper == null) identifier = username;
|
|
2669
2594
|
else {
|
|
2670
2595
|
const mapped = await this.federation.actorCallbacks.handleMapper(this, username);
|
|
@@ -3020,15 +2945,10 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
|
3020
2945
|
]);
|
|
3021
2946
|
let keys;
|
|
3022
2947
|
let identifier = null;
|
|
3023
|
-
if ("identifier" in forwarder || "username" in forwarder
|
|
2948
|
+
if ("identifier" in forwarder || "username" in forwarder) {
|
|
3024
2949
|
if ("identifier" in forwarder) identifier = forwarder.identifier;
|
|
3025
2950
|
else {
|
|
3026
|
-
|
|
3027
|
-
if ("username" in forwarder) username = forwarder.username;
|
|
3028
|
-
else {
|
|
3029
|
-
username = forwarder.handle;
|
|
3030
|
-
logger$2.warn("The \"handle\" property for the forwarder parameter is deprecated; use \"identifier\" or \"username\" instead.", { forwarder });
|
|
3031
|
-
}
|
|
2951
|
+
const username = forwarder.username;
|
|
3032
2952
|
if (this.federation.actorCallbacks?.handleMapper == null) identifier = username;
|
|
3033
2953
|
else {
|
|
3034
2954
|
const mapped = await this.federation.actorCallbacks.handleMapper(this, username);
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import "./transformers-C3FLHUd6.js";
|
|
6
|
-
import "./http-
|
|
7
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-
|
|
8
|
-
import "./proof-
|
|
6
|
+
import "./http-d87H9gTL.js";
|
|
7
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-qCIC-vDz.js";
|
|
8
|
+
import "./proof-B7X2V-RL.js";
|
|
9
9
|
import "./types-C93Ob9cU.js";
|
|
10
|
-
import "./kv-cache-
|
|
10
|
+
import "./kv-cache-BlAk9XRp.js";
|
|
11
11
|
|
|
12
12
|
export { FederationImpl };
|