@fedify/fedify 2.4.0-dev.2071 → 2.4.0-dev.2077
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-DVQ0yhKJ.mjs → builder-i3jxVe9m.mjs} +2 -2
- 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/{compound-proof-KmXDfWFp.mjs → compound-proof-Cayy-ECj.mjs} +1 -1
- package/dist/{context-DsB9kF6q.d.ts → context-BSywYspi.d.ts} +109 -1
- package/dist/{context-DijrgHDe.d.cts → context-CZjZYXFC.d.cts} +109 -1
- package/dist/{context-DG5QeQ8W.mjs → context-DlZhxdFT.mjs} +2 -1
- package/dist/{deno-B-NtYZVW.mjs → deno-Djkzd-G_.mjs} +1 -1
- package/dist/{docloader-C6yOVoaF.mjs → docloader-dA0RswUV.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +138 -11
- package/dist/federation/handler.test.mjs +6 -6
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +8 -8
- 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/outgoing-proof.test.mjs +5 -5
- package/dist/federation/portable-gateway-keys.test.mjs +4 -4
- package/dist/federation/portable-inbox.test.d.mts +2 -0
- package/dist/federation/portable-inbox.test.mjs +546 -0
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +2 -2
- package/dist/federation/tasks/tasks.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-CUiHc7dP.cjs → federation-CFd0Jhhv.cjs} +463 -82
- package/dist/{http-DKWi8RjI.mjs → http-CCJ97Jql.mjs} +4 -4
- package/dist/{http-CuLWIJdf.cjs → http-Dvy_IwRa.cjs} +1 -1
- package/dist/{http-BoWBwC0g.js → http-aqh3yFdM.js} +1 -1
- package/dist/{key-lfcx_NaE.mjs → key-IxTTC8Yf.mjs} +2 -2
- package/dist/{kv-cache-DE8kSNQU.cjs → kv-cache-BP69NV0P.cjs} +1 -1
- package/dist/{kv-cache-d8EjO29d.mjs → kv-cache-Bwwbh-xR.mjs} +1 -1
- package/dist/{kv-cache-BdnmnAVc.js → kv-cache-Y6SDRSX6.js} +1 -1
- package/dist/{ld-jyjdrWjG.mjs → ld-l0B9nREb.mjs} +3 -3
- package/dist/{metrics-B5Rei-HC.mjs → metrics-D1p6hv4z.mjs} +1 -1
- package/dist/{middleware-CdVnCDXD.mjs → middleware-BDjCUHMS.mjs} +1 -1
- package/dist/{middleware-CPx4ZWwt.mjs → middleware-BMgzqBtr.mjs} +418 -42
- package/dist/{middleware-CAObohey.js → middleware-SSfryVzY.js} +412 -32
- package/dist/{mod-DMkflQdF.d.ts → mod-B2h2KY0q.d.ts} +1 -1
- package/dist/{mod-DTAaBwiY.d.cts → mod-JzkaEXsi.d.cts} +1 -1
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +4 -4
- package/dist/mod.d.ts +4 -4
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-BXufwAzm.cjs → owner-BpOxL5PG.cjs} +1 -1
- package/dist/{owner-ByqNQVaa.mjs → owner-DGbYmXqU.mjs} +3 -3
- package/dist/{owner-1TFakcTF.js → owner-jH1z_YfD.js} +1 -1
- package/dist/{portable-key-Cw_ow5vn.mjs → portable-key-CCwJGSsU.mjs} +2 -2
- package/dist/{proof-B6gwdhN5.mjs → proof-CVL7JnZd.mjs} +4 -4
- package/dist/{send-DsK7xevO.mjs → send-Ejy1jOz9.mjs} +8 -4
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.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 +3 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +2 -2
- package/dist/sig/portable-key.test.mjs +3 -3
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/{sig-BR_Z6mpY.js → sig-Dpy1B1Ad.js} +2 -2
- package/dist/{sig-TTn9wYrE.cjs → sig-xoqy3ATq.cjs} +2 -2
- package/dist/{temporal-Bw5jtrBY.mjs → temporal-DNJ1cNpr.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +108 -0
- package/dist/testing/mod.mjs +2 -2
- package/dist/{testing-By1YYsIK.mjs → testing-CO_cEvQc.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
package/dist/testing/mod.d.mts
CHANGED
|
@@ -1418,6 +1418,16 @@ interface FederationKvPrefixes {
|
|
|
1418
1418
|
* @since 2.4.0
|
|
1419
1419
|
*/
|
|
1420
1420
|
readonly taskDeduplication: KvKey;
|
|
1421
|
+
/**
|
|
1422
|
+
* The key prefix used for remembering which activities received in
|
|
1423
|
+
* [FEP-ef61] portable inboxes have been forwarded to which gateways, so that
|
|
1424
|
+
* each activity is forwarded at most once.
|
|
1425
|
+
*
|
|
1426
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
1427
|
+
* @default `["_fedify", "portableInboxForwarding"]`
|
|
1428
|
+
* @since 2.4.0
|
|
1429
|
+
*/
|
|
1430
|
+
readonly portableInboxForwarding: KvKey;
|
|
1421
1431
|
}
|
|
1422
1432
|
/**
|
|
1423
1433
|
* Options for {@link FederationOptions.origin} when it is not a string.
|
|
@@ -1996,6 +2006,44 @@ interface Federation<TContextData> extends Federatable<TContextData> {
|
|
|
1996
2006
|
*/
|
|
1997
2007
|
fetch(request: Request, options: FederationFetchOptions<TContextData>): Promise<Response>;
|
|
1998
2008
|
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Options for forwarding activities received in [FEP-ef61] portable inboxes to
|
|
2011
|
+
* the other gateways of their actors. See
|
|
2012
|
+
* {@link FederationOptions.portableInboxForwarding}.
|
|
2013
|
+
*
|
|
2014
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2015
|
+
* @since 2.4.0
|
|
2016
|
+
*/
|
|
2017
|
+
interface PortableInboxForwardingOptions {
|
|
2018
|
+
/**
|
|
2019
|
+
* The maximum number of other gateways that a single delivery is forwarded
|
|
2020
|
+
* to. Gateways beyond it are skipped with a warning. `0` turns off
|
|
2021
|
+
* forwarding.
|
|
2022
|
+
* @default `10`
|
|
2023
|
+
*/
|
|
2024
|
+
maxTargets?: number;
|
|
2025
|
+
/**
|
|
2026
|
+
* How long Fedify remembers that it has forwarded an activity from
|
|
2027
|
+
* a portable inbox to a gateway, under
|
|
2028
|
+
* {@link FederationKvPrefixes.portableInboxForwarding}. Within it, the same
|
|
2029
|
+
* activity is never forwarded to the same gateway again; once it expires,
|
|
2030
|
+
* a redelivery of the activity may be forwarded again. It cannot have
|
|
2031
|
+
* calendar units, i.e., weeks, months, or years.
|
|
2032
|
+
* @default `{ days: 30 }`
|
|
2033
|
+
*/
|
|
2034
|
+
ttl?: Temporal.DurationLike;
|
|
2035
|
+
/**
|
|
2036
|
+
* How long a delivery waits for forwarding requests made immediately, i.e.,
|
|
2037
|
+
* when no outbox queue is configured, before Fedify responds to it.
|
|
2038
|
+
* Requests still running afterwards continue in the background. It does
|
|
2039
|
+
* not apply when forwarding is queued. It cannot have calendar units,
|
|
2040
|
+
* i.e., weeks, months, or years, and cannot be longer than
|
|
2041
|
+
* 2,147,483,647 milliseconds (about 24.8 days), the longest delay timers
|
|
2042
|
+
* support.
|
|
2043
|
+
* @default `{ seconds: 10 }`
|
|
2044
|
+
*/
|
|
2045
|
+
deadline?: Temporal.DurationLike;
|
|
2046
|
+
}
|
|
1999
2047
|
/**
|
|
2000
2048
|
* Policy for emitting `Accept-Signature` challenges on inbox `401`
|
|
2001
2049
|
* responses, as defined in
|
|
@@ -2090,6 +2138,14 @@ interface FederationOptions<TContextData> {
|
|
|
2090
2138
|
* @since 2.4.0
|
|
2091
2139
|
*/
|
|
2092
2140
|
httpMessageSignaturesSpecTtl?: Temporal.DurationLike;
|
|
2141
|
+
/**
|
|
2142
|
+
* Options for forwarding activities received in [FEP-ef61] portable inboxes
|
|
2143
|
+
* to the other gateways of their actors.
|
|
2144
|
+
*
|
|
2145
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2146
|
+
* @since 2.4.0
|
|
2147
|
+
*/
|
|
2148
|
+
portableInboxForwarding?: PortableInboxForwardingOptions;
|
|
2093
2149
|
/**
|
|
2094
2150
|
* The message queue for sending and receiving activities. If not provided,
|
|
2095
2151
|
* activities will not be queued and will be processed immediately.
|
|
@@ -2873,6 +2929,35 @@ interface Context<TContextData> {
|
|
|
2873
2929
|
* @since 2.4.0
|
|
2874
2930
|
*/
|
|
2875
2931
|
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
|
|
2932
|
+
/**
|
|
2933
|
+
* Builds the [FEP-ef61] portable ID of an actor's inbox with the given
|
|
2934
|
+
* identifier under the given DID authority.
|
|
2935
|
+
*
|
|
2936
|
+
* The path is the same as the one {@link Context.getInboxUri} builds from
|
|
2937
|
+
* the inbox path, but the result is an `ap+ef61:` URI whose authority is
|
|
2938
|
+
* the DID, e.g., `ap+ef61://did:key:z6Mk.../users/alice/inbox`. If
|
|
2939
|
+
* a portable actor has it as its `inbox` and lists this server in its
|
|
2940
|
+
* `gateways`, this server accepts deliveries to the inbox through
|
|
2941
|
+
* the FEP-ef61 gateway endpoint, e.g.,
|
|
2942
|
+
* `POST /.well-known/apgateway/did:key:z6Mk.../users/alice/inbox`, and
|
|
2943
|
+
* dispatches them to the inbox listeners.
|
|
2944
|
+
*
|
|
2945
|
+
* The returned `URL` keeps the DID authority percent-encoded, because
|
|
2946
|
+
* the `URL` class cannot represent the canonical form. Use `formatIri()`
|
|
2947
|
+
* from `@fedify/vocab-runtime` to get the canonical string.
|
|
2948
|
+
*
|
|
2949
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
2950
|
+
*
|
|
2951
|
+
* @param identifier The actor's identifier.
|
|
2952
|
+
* @param authority The DID that controls the actor, e.g.,
|
|
2953
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
2954
|
+
* a path, query, or fragment.
|
|
2955
|
+
* @returns The inbox's portable ID.
|
|
2956
|
+
* @throws {RouterError} If no inbox path is registered.
|
|
2957
|
+
* @throws {TypeError} If the authority is not a DID.
|
|
2958
|
+
* @since 2.4.0
|
|
2959
|
+
*/
|
|
2960
|
+
getPortableInboxUri(identifier: string, authority: string): URL;
|
|
2876
2961
|
/**
|
|
2877
2962
|
* Builds the URI of an actor's outbox with the given identifier.
|
|
2878
2963
|
* @param identifier The actor's identifier.
|
|
@@ -3287,6 +3372,29 @@ interface RequestContext<TContextData> extends Context<TContextData> {
|
|
|
3287
3372
|
* @since 2.4.0
|
|
3288
3373
|
*/
|
|
3289
3374
|
getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
|
|
3375
|
+
/**
|
|
3376
|
+
* Builds the [FEP-ef61] portable ID of an actor's inbox with the given
|
|
3377
|
+
* identifier. It works the same as {@link Context.getPortableInboxUri},
|
|
3378
|
+
* except that the authority can be omitted while handling a portable object
|
|
3379
|
+
* request, i.e., when {@link RequestContext.portableRequest} is set. In
|
|
3380
|
+
* that case, its DID is used. Deliveries to portable inboxes do not set
|
|
3381
|
+
* {@link RequestContext.portableRequest}, so pass the authority explicitly
|
|
3382
|
+
* while handling them.
|
|
3383
|
+
*
|
|
3384
|
+
* [FEP-ef61]: https://w3id.org/fep/ef61
|
|
3385
|
+
*
|
|
3386
|
+
* @param identifier The actor's identifier.
|
|
3387
|
+
* @param authority The DID that controls the actor, e.g.,
|
|
3388
|
+
* `did:key:z6Mk...`. It must be a bare DID, without
|
|
3389
|
+
* a path, query, or fragment. Defaults to the DID of
|
|
3390
|
+
* the requested portable object, if any.
|
|
3391
|
+
* @returns The inbox's portable ID.
|
|
3392
|
+
* @throws {RouterError} If no inbox path is registered.
|
|
3393
|
+
* @throws {TypeError} If the authority is not a DID, or the authority is
|
|
3394
|
+
* omitted outside a portable gateway request.
|
|
3395
|
+
* @since 2.4.0
|
|
3396
|
+
*/
|
|
3397
|
+
getPortableInboxUri(identifier: string, authority?: string): URL;
|
|
3290
3398
|
/**
|
|
3291
3399
|
* Creates a new context with the same properties as this one,
|
|
3292
3400
|
* but with the given data.
|
package/dist/testing/mod.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { r as testDefinitions } from "../dist-BQvArojP.mjs";
|
|
5
|
-
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-
|
|
5
|
+
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DlZhxdFT.mjs";
|
|
6
6
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
7
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
|
|
8
|
-
import "../testing-
|
|
8
|
+
import "../testing-CO_cEvQc.mjs";
|
|
9
9
|
export { ManualClockKvStore, MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
|
|
@@ -2,7 +2,7 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import "./dist-BQvArojP.mjs";
|
|
5
|
-
import "./context-
|
|
5
|
+
import "./context-DlZhxdFT.mjs";
|
|
6
6
|
import "./kv-DBRWVx3Q.mjs";
|
|
7
7
|
import "./tasks-dbCShlCb.mjs";
|
|
8
8
|
export {};
|
|
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
6
|
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
8
|
+
import { l as verifyRequest } from "../http-CCJ97Jql.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-dA0RswUV.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
//#region src/utils/docloader.test.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as kvCache, t as MockKvStore } from "../kv-cache-
|
|
4
|
+
import { n as kvCache, t as MockKvStore } from "../kv-cache-Bwwbh-xR.mjs";
|
|
5
5
|
import { deepStrictEqual, throws } from "node:assert";
|
|
6
6
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_kv_cache = require("../kv-cache-
|
|
3
|
+
const require_kv_cache = require("../kv-cache-BP69NV0P.cjs");
|
|
4
4
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
5
5
|
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Y6SDRSX6.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.2077+c29a03d4",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
"structured-field-values": "^2.0.4",
|
|
152
152
|
"temporal-polyfill": "^1.0.1",
|
|
153
153
|
"urlpattern-polyfill": "^10.1.0",
|
|
154
|
-
"@fedify/uri-template": "2.4.0-dev.
|
|
155
|
-
"@fedify/vocab": "2.4.0-dev.
|
|
156
|
-
"@fedify/vocab-runtime": "2.4.0-dev.
|
|
157
|
-
"@fedify/webfinger": "2.4.0-dev.
|
|
154
|
+
"@fedify/uri-template": "2.4.0-dev.2077+c29a03d4",
|
|
155
|
+
"@fedify/vocab": "2.4.0-dev.2077+c29a03d4",
|
|
156
|
+
"@fedify/vocab-runtime": "2.4.0-dev.2077+c29a03d4",
|
|
157
|
+
"@fedify/webfinger": "2.4.0-dev.2077+c29a03d4"
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
160
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"tsx": "^4.21.0",
|
|
167
167
|
"typescript": "^6.0.0",
|
|
168
168
|
"wrangler": "^4.17.0",
|
|
169
|
-
"@fedify/
|
|
170
|
-
"@fedify/
|
|
169
|
+
"@fedify/vocab-tools": "^2.4.0-dev.2077+c29a03d4",
|
|
170
|
+
"@fedify/fixture": "2.0.0"
|
|
171
171
|
},
|
|
172
172
|
"scripts": {
|
|
173
173
|
"build:self": "tsdown",
|