@fedify/fedify 2.1.0 → 2.1.2
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/{accept-D7sAxyNa.js → accept-Dd__NiUL.mjs} +10 -8
- package/dist/{assert-MZs1qjMx.js → assert-ddO5KLpe.mjs} +5 -9
- package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
- package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
- package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
- package/dist/{assert_rejects-0h7I2Esa.js → assert_rejects-B-qJtC9Z.mjs} +6 -11
- package/dist/{assert_throws-rjdMBf31.js → assert_throws-4NwKEy2q.mjs} +5 -10
- package/dist/{builder-WiHhZvjW.js → builder-DkJDAzes.mjs} +32 -41
- package/dist/{chunk-CGaQZ11T.cjs → chunk-DDcVe30Y.cjs} +23 -24
- package/dist/{chunk-DJNbSFdH.js → chunk-nlSIicah.js} +8 -8
- package/dist/{client-BxMZiQaD.d.ts → client-AtlibPOU.d.ts} +1 -1
- package/dist/{client-CoCIaTNO.js → client-DEpOVgY1.mjs} +9 -13
- package/dist/{client-C97KOq3x.d.cts → client-z-8dc-e1.d.cts} +1 -1
- package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
- package/dist/compat/mod.cjs +5 -8
- package/dist/compat/mod.d.cts +78 -6
- package/dist/compat/mod.d.ts +78 -6
- package/dist/compat/mod.js +4 -8
- package/dist/compat/transformers.test.mjs +62 -0
- package/dist/{context-DyJjQQ_H.d.ts → context-BOiMZBu5.d.ts} +9 -18
- package/dist/{context-BcqA-0BL.d.cts → context-BhZVy7RB.d.cts} +9 -18
- package/dist/{context-Aqenou7c.js → context-Juj6bdHC.mjs} +7 -11
- package/dist/deno-C5VMwnFV.mjs +8 -0
- package/dist/{docloader-bVO2EvL9.js → docloader-X9mcJ9Tz.mjs} +8 -14
- package/dist/{esm-nLm00z9V.js → esm-DVILvP5e.mjs} +50 -89
- package/dist/federation/builder.test.d.mts +2 -0
- package/dist/federation/{builder.test.js → builder.test.mjs} +21 -44
- package/dist/federation/collection.test.d.mts +2 -0
- package/dist/federation/collection.test.mjs +21 -0
- package/dist/federation/handler.test.d.mts +2 -0
- package/dist/federation/{handler.test.js → handler.test.mjs} +69 -131
- package/dist/federation/idempotency.test.d.mts +2 -0
- package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +31 -63
- package/dist/federation/inbox.test.d.mts +2 -0
- package/dist/federation/{inbox.test.js → inbox.test.mjs} +8 -12
- package/dist/federation/keycache.test.d.mts +2 -0
- package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -19
- package/dist/federation/kv.test.d.mts +2 -0
- package/dist/federation/{kv.test.js → kv.test.mjs} +11 -22
- package/dist/federation/middleware.test.d.mts +2 -0
- package/dist/federation/{middleware.test.js → middleware.test.mjs} +173 -262
- package/dist/federation/mod.cjs +327 -16
- package/dist/federation/mod.d.cts +3 -6
- package/dist/federation/mod.d.ts +3 -6
- package/dist/federation/mod.js +322 -13
- package/dist/federation/mq.test.d.mts +2 -0
- package/dist/federation/{mq.test.js → mq.test.mjs} +21 -35
- package/dist/federation/negotiation.test.d.mts +2 -0
- package/dist/federation/{negotiation.test.js → negotiation.test.mjs} +9 -16
- package/dist/federation/retry.test.d.mts +2 -0
- package/dist/federation/{retry.test.js → retry.test.mjs} +8 -11
- package/dist/federation/router.test.d.mts +2 -0
- package/dist/federation/{router.test.js → router.test.mjs} +11 -16
- package/dist/federation/send.test.d.mts +2 -0
- package/dist/federation/{send.test.js → send.test.mjs} +22 -30
- package/dist/federation/webfinger.test.d.mts +2 -0
- package/dist/federation/{webfinger.test.js → webfinger.test.mjs} +22 -56
- package/dist/{http-DhH623ma.js → http-BLZWcpzg.js} +67 -187
- package/dist/{http-CKDim8Tw.js → http-BTLPIzFa.mjs} +37 -45
- package/dist/{http-BudnHZE2.d.cts → http-CrGuipxe.d.cts} +1 -6
- package/dist/{http-gvnJbMS1.cjs → http-CxodXLwi.cjs} +186 -300
- package/dist/{http-Dax_FIBo.d.ts → http-aQzN9Ayi.d.ts} +1 -6
- package/dist/{inbox-CA9AUEGa.js → inbox-mcbmhjTW.mjs} +18 -26
- package/dist/{key-BsSCz8Z_.js → key-1MaItIGc.mjs} +29 -37
- package/dist/{keycache-CpGWAUbj.js → keycache-CCSwkQcY.mjs} +5 -10
- package/dist/{keys-BFve7QQv.js → keys-BAK-tUlf.mjs} +5 -9
- package/dist/{kv-BL4nlICN.d.cts → kv-CbLNp3zQ.d.cts} +1 -1
- package/dist/{kv-DXEUEP6z.d.ts → kv-GFYnFoOl.d.ts} +1 -1
- package/dist/{kv-cache-Bw2F2ABq.js → kv-cache-B01V7s3h.mjs} +4 -8
- package/dist/{kv-cache-DK4GFVWx.cjs → kv-cache-DjC82_4n.cjs} +27 -34
- package/dist/{kv-cache-CxoHCR44.js → kv-cache-GIDK1oLs.js} +6 -13
- package/dist/{kv-QzKcOQgP.js → kv-tL2TOE9X.mjs} +6 -10
- package/dist/{ld-Bo_Rx0Fc.js → ld-94uHZ1eO.mjs} +17 -31
- package/dist/{middleware-BkrUA3da.js → middleware-B5Er10wE.js} +336 -383
- package/dist/middleware-CDuHbSVE.mjs +5 -0
- package/dist/middleware-CTyq5KB0.cjs +4 -0
- package/dist/{middleware-CpAnWzjC.cjs → middleware-CqDJSLoG.cjs} +532 -587
- package/dist/{middleware-CZ8jOOa3.js → middleware-DMZGXHm3.mjs} +282 -317
- package/dist/{mod-Bx9jcLB8.d.cts → mod-B505FZBC.d.cts} +3 -3
- package/dist/{mod-em2Il1eD.d.cts → mod-Bp_CzKd4.d.cts} +2 -2
- package/dist/{mod-Cs2dYEwI.d.ts → mod-D7PAuO6k.d.ts} +3 -3
- package/dist/{mod-D6MdymW7.d.ts → mod-DKOAow7a.d.ts} +2 -2
- package/dist/{mod-Coe7KEgX.d.cts → mod-DoJBjjnO.d.cts} +2 -2
- package/dist/{mod-D6dOd--H.d.ts → mod-DvxszxXC.d.ts} +2 -2
- package/dist/mod.cjs +29 -74
- package/dist/mod.d.cts +11 -14
- package/dist/mod.d.ts +11 -15
- package/dist/mod.js +17 -71
- package/dist/{negotiation-BlAuS_nr.js → negotiation-DnsfFF8I.mjs} +7 -11
- package/dist/nodeinfo/client.test.d.mts +2 -0
- package/dist/nodeinfo/{client.test.js → client.test.mjs} +22 -40
- package/dist/nodeinfo/handler.test.d.mts +2 -0
- package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +13 -43
- package/dist/nodeinfo/mod.cjs +5 -8
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +4 -8
- package/dist/nodeinfo/types.test.d.mts +2 -0
- package/dist/nodeinfo/{types.test.js → types.test.mjs} +9 -16
- package/dist/otel/exporter.test.d.mts +2 -0
- package/dist/otel/{exporter.test.js → exporter.test.mjs} +124 -178
- package/dist/otel/mod.cjs +15 -20
- package/dist/otel/mod.d.cts +2 -2
- package/dist/otel/mod.d.ts +2 -2
- package/dist/otel/mod.js +8 -14
- package/dist/{owner-gd0Q9FuU.d.ts → owner-74ARJ5TL.d.ts} +1 -1
- package/dist/{owner-Bj_IbwIT.js → owner-B4aIDhg_.mjs} +11 -16
- package/dist/{owner-1AbPBOOZ.d.cts → owner-CptqhsOy.d.cts} +1 -1
- package/dist/{proof-u6Y358J-.js → proof-DYZWMWOC.mjs} +21 -33
- package/dist/{proof-BhFF_JVj.cjs → proof-DqCjiFwb.cjs} +133 -157
- package/dist/{proof-D5BQTIcU.js → proof-j-of9m5W.js} +33 -59
- package/dist/{retry-mqLf4b-R.js → retry-B_E3V_Dx.mjs} +4 -7
- package/dist/{router-D9eI0s4b.js → router-CrMLXoOr.mjs} +4 -8
- package/dist/runtime/mod.cjs +11 -13
- package/dist/runtime/mod.d.cts +6 -2
- package/dist/runtime/mod.d.ts +0 -1
- package/dist/runtime/mod.js +4 -7
- package/dist/{send-CE8h59oe.js → send-uLjD0uAe.mjs} +8 -13
- package/dist/sig/accept.test.d.mts +2 -0
- package/dist/sig/{accept.test.js → accept.test.mjs} +35 -70
- package/dist/sig/http.test.d.mts +2 -0
- package/dist/sig/{http.test.js → http.test.mjs} +209 -280
- package/dist/sig/key.test.d.mts +2 -0
- package/dist/sig/{key.test.js → key.test.mjs} +11 -18
- package/dist/sig/ld.test.d.mts +2 -0
- package/dist/sig/{ld.test.js → ld.test.mjs} +22 -35
- package/dist/sig/mod.cjs +6 -9
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +5 -9
- package/dist/sig/owner.test.d.mts +2 -0
- package/dist/sig/{owner.test.js → owner.test.mjs} +19 -34
- package/dist/sig/proof.test.d.mts +2 -0
- package/dist/sig/{proof.test.js → proof.test.mjs} +16 -27
- package/dist/{std__assert-X-_kMxKM.js → std__assert-Duiq_YC9.mjs} +12 -24
- package/dist/testing/{mod.d.ts → mod.d.mts} +26 -90
- package/dist/testing/mod.mjs +6 -0
- package/dist/{transformers-3g8GZwkZ.cjs → transformers-NeAONrAq.cjs} +20 -25
- package/dist/{transformers-C3FLHUd6.js → transformers-ve6e2xcg.js} +3 -7
- package/dist/{types-CPz01LGH.js → types-DCP0WLdt.mjs} +4 -7
- package/dist/{types-Cd_hszr_.cjs → types-KC4QAoxe.cjs} +29 -34
- package/dist/{types-C93Ob9cU.js → types-hvL8ElAs.js} +8 -13
- package/dist/utils/docloader.test.d.mts +2 -0
- package/dist/utils/{docloader.test.js → docloader.test.mjs} +14 -25
- package/dist/utils/kv-cache.test.d.mts +2 -0
- package/dist/utils/{kv-cache.test.js → kv-cache.test.mjs} +25 -40
- package/dist/utils/mod.cjs +5 -9
- package/dist/utils/mod.d.cts +1 -3
- package/dist/utils/mod.d.ts +1 -3
- package/dist/utils/mod.js +4 -9
- package/dist/vocab/cjs.test.d.mts +2 -0
- package/dist/vocab/cjs.test.mjs +14 -0
- package/dist/vocab/mod.cjs +10 -12
- package/dist/vocab/mod.js +3 -5
- package/package.json +7 -7
- package/dist/compat/transformers.test.d.ts +0 -3
- package/dist/compat/transformers.test.js +0 -88
- package/dist/compat-Bb4NuTUO.js +0 -4
- package/dist/compat-DmDDELst.cjs +0 -4
- package/dist/deno-BRMCYThi.js +0 -121
- package/dist/federation/builder.test.d.ts +0 -3
- package/dist/federation/collection.test.d.ts +0 -3
- package/dist/federation/collection.test.js +0 -32
- package/dist/federation/handler.test.d.ts +0 -3
- package/dist/federation/idempotency.test.d.ts +0 -3
- package/dist/federation/inbox.test.d.ts +0 -3
- package/dist/federation/keycache.test.d.ts +0 -3
- package/dist/federation/kv.test.d.ts +0 -3
- package/dist/federation/middleware.test.d.ts +0 -3
- package/dist/federation/mq.test.d.ts +0 -3
- package/dist/federation/negotiation.test.d.ts +0 -3
- package/dist/federation/retry.test.d.ts +0 -3
- package/dist/federation/router.test.d.ts +0 -3
- package/dist/federation/send.test.d.ts +0 -3
- package/dist/federation/webfinger.test.d.ts +0 -3
- package/dist/federation-Bp3HI26G.cjs +0 -350
- package/dist/federation-DaMfqRm4.js +0 -332
- package/dist/middleware-BtT_mKsB.cjs +0 -12
- package/dist/middleware-CUMoHNCA.js +0 -12
- package/dist/middleware-CzeVJTA1.js +0 -27
- package/dist/mod-B7QkWzrL.d.cts +0 -80
- package/dist/mod-Bh8mqlYw.d.cts +0 -9
- package/dist/mod-D6HodEq7.d.ts +0 -7
- package/dist/mod-SMHOMNpZ.d.ts +0 -82
- package/dist/mod-gq_Xfdz8.d.cts +0 -1
- package/dist/nodeinfo/client.test.d.ts +0 -3
- package/dist/nodeinfo/handler.test.d.ts +0 -3
- package/dist/nodeinfo/types.test.d.ts +0 -3
- package/dist/nodeinfo-DoESQxq5.js +0 -4
- package/dist/nodeinfo-DuMYTpbZ.cjs +0 -4
- package/dist/otel/exporter.test.d.ts +0 -3
- package/dist/runtime-c2Njxsry.cjs +0 -17
- package/dist/runtime-poamPCMb.js +0 -13
- package/dist/sig/accept.test.d.ts +0 -3
- package/dist/sig/http.test.d.ts +0 -3
- package/dist/sig/key.test.d.ts +0 -3
- package/dist/sig/ld.test.d.ts +0 -3
- package/dist/sig/owner.test.d.ts +0 -3
- package/dist/sig/proof.test.d.ts +0 -3
- package/dist/sig-BNhspNOf.js +0 -4
- package/dist/sig-vX39WyWI.cjs +0 -4
- package/dist/testing/mod.js +0 -10
- package/dist/utils/docloader.test.d.ts +0 -3
- package/dist/utils/kv-cache.test.d.ts +0 -3
- package/dist/utils-BQ9KqEK9.cjs +0 -4
- package/dist/utils-Dn5OPdSW.js +0 -4
- /package/dist/{mod-AGjRfPjT.d.ts → compat/transformers.test.d.mts} +0 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region rolldown:runtime
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
6
4
|
var __defProp = Object.defineProperty;
|
|
7
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
11
10
|
for (var name in all) __defProp(target, name, {
|
|
12
11
|
get: all[name],
|
|
13
12
|
enumerable: true
|
|
14
13
|
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
15
16
|
};
|
|
16
17
|
var __copyProps = (to, from, except, desc) => {
|
|
17
18
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -24,6 +25,5 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
25
|
return to;
|
|
25
26
|
};
|
|
26
27
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
|
|
28
28
|
//#endregion
|
|
29
|
-
export {
|
|
29
|
+
export { __reExport as n, __exportAll as t };
|
|
@@ -221,4 +221,4 @@ interface ParseNodeInfoOptions {
|
|
|
221
221
|
*/
|
|
222
222
|
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
223
223
|
//#endregion
|
|
224
|
-
export {
|
|
224
|
+
export { InboundService as a, OutboundService as c, Software as d, Usage as f, parseNodeInfo as i, Protocol as l, ParseNodeInfoOptions as n, JsonValue as o, nodeInfoToJson as p, getNodeInfo as r, NodeInfo as s, GetNodeInfoOptions as t, Services as u };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
import { getUserAgent } from "@fedify/vocab-runtime";
|
|
7
5
|
import { getLogger } from "@logtape/logtape";
|
|
8
|
-
|
|
9
6
|
//#region src/nodeinfo/client.ts
|
|
10
7
|
const logger = getLogger([
|
|
11
8
|
"fedify",
|
|
@@ -27,16 +24,16 @@ async function getNodeInfo(url, options = {}) {
|
|
|
27
24
|
status: wellKnownResponse.status,
|
|
28
25
|
statusText: wellKnownResponse.statusText
|
|
29
26
|
});
|
|
30
|
-
return
|
|
27
|
+
return;
|
|
31
28
|
}
|
|
32
29
|
const wellKnownRd = await wellKnownResponse.json();
|
|
33
|
-
const link = wellKnownRd?.links?.find((link
|
|
30
|
+
const link = wellKnownRd?.links?.find((link) => link != null && "rel" in link && (link.rel === "http://nodeinfo.diaspora.software/ns/schema/2.0" || link.rel === "http://nodeinfo.diaspora.software/ns/schema/2.1") && "href" in link && link.href != null);
|
|
34
31
|
if (link == null || link.href == null) {
|
|
35
32
|
logger.error("Failed to find a NodeInfo document link from {url}: {resourceDescriptor}", {
|
|
36
33
|
url: wellKnownUrl.href,
|
|
37
34
|
resourceDescriptor: wellKnownRd
|
|
38
35
|
});
|
|
39
|
-
return
|
|
36
|
+
return;
|
|
40
37
|
}
|
|
41
38
|
nodeInfoUrl = link.href;
|
|
42
39
|
}
|
|
@@ -50,7 +47,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
50
47
|
status: response.status,
|
|
51
48
|
statusText: response.statusText
|
|
52
49
|
});
|
|
53
|
-
return
|
|
50
|
+
return;
|
|
54
51
|
}
|
|
55
52
|
const data = await response.json();
|
|
56
53
|
if (options.parse === "none") return data;
|
|
@@ -60,7 +57,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
60
57
|
url: url.toString(),
|
|
61
58
|
error
|
|
62
59
|
});
|
|
63
|
-
return
|
|
60
|
+
return;
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
/**
|
|
@@ -255,6 +252,5 @@ function parseUsage(data, options = {}) {
|
|
|
255
252
|
localComments
|
|
256
253
|
};
|
|
257
254
|
}
|
|
258
|
-
|
|
259
255
|
//#endregion
|
|
260
|
-
export {
|
|
256
|
+
export { parseProtocol as a, parseUsage as c, parseOutboundService as i, parseInboundService as n, parseServices as o, parseNodeInfo as r, parseSoftware as s, getNodeInfo as t };
|
|
@@ -219,4 +219,4 @@ interface ParseNodeInfoOptions {
|
|
|
219
219
|
*/
|
|
220
220
|
declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
|
|
221
221
|
//#endregion
|
|
222
|
-
export {
|
|
222
|
+
export { InboundService as a, OutboundService as c, Software as d, Usage as f, parseNodeInfo as i, Protocol as l, ParseNodeInfoOptions as n, JsonValue as o, nodeInfoToJson as p, getNodeInfo as r, NodeInfo as s, GetNodeInfoOptions as t, Services as u };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
import { encodeHex } from "byte-encodings/hex";
|
|
7
|
-
|
|
8
5
|
//#region src/federation/collection.ts
|
|
9
6
|
/**
|
|
10
7
|
* Calculates the [partial follower collection digest][1].
|
|
@@ -22,8 +19,8 @@ async function digest(uris) {
|
|
|
22
19
|
if (processed.has(u)) continue;
|
|
23
20
|
processed.add(u);
|
|
24
21
|
const encoded = encoder.encode(u);
|
|
25
|
-
const digest
|
|
26
|
-
for (let i = 0; i < 32; i++) result[i] ^= digest
|
|
22
|
+
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", encoded));
|
|
23
|
+
for (let i = 0; i < 32; i++) result[i] ^= digest[i];
|
|
27
24
|
}
|
|
28
25
|
return result;
|
|
29
26
|
}
|
|
@@ -41,9 +38,7 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
41
38
|
const baseUrl = new URL(anyActorId);
|
|
42
39
|
const url = new URL(collectionId);
|
|
43
40
|
url.searchParams.set("base-url", `${baseUrl.origin}/`);
|
|
44
|
-
|
|
45
|
-
return `collectionId="${collectionId}", url="${url}", digest="${hash}"`;
|
|
41
|
+
return `collectionId="${collectionId}", url="${url}", digest="${encodeHex(await digest(actorIds))}"`;
|
|
46
42
|
}
|
|
47
|
-
|
|
48
43
|
//#endregion
|
|
49
|
-
export {
|
|
44
|
+
export { digest as n, buildCollectionSynchronizationHeader as t };
|
package/dist/compat/mod.cjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const require_transformers = require('../transformers-3g8GZwkZ.cjs');
|
|
6
|
-
require('../compat-DmDDELst.cjs');
|
|
7
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_transformers = require("../transformers-NeAONrAq.cjs");
|
|
8
5
|
exports.actorDehydrator = require_transformers.actorDehydrator;
|
|
9
6
|
exports.autoIdAssigner = require_transformers.autoIdAssigner;
|
|
10
|
-
exports.getDefaultActivityTransformers = require_transformers.getDefaultActivityTransformers;
|
|
7
|
+
exports.getDefaultActivityTransformers = require_transformers.getDefaultActivityTransformers;
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,7 +1,79 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Ct as ActivityTransformer, n as Context } from "../context-BhZVy7RB.cjs";
|
|
2
|
+
import { Activity } from "@fedify/vocab";
|
|
3
|
+
|
|
4
|
+
//#region src/compat/transformers.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* An activity transformer that assigns a new random ID to an activity if it
|
|
7
|
+
* does not already have one. This is useful for ensuring that activities
|
|
8
|
+
* have an ID before they are sent to other servers.
|
|
9
|
+
*
|
|
10
|
+
* The generated ID is an origin URI with a fragment which contains an activity
|
|
11
|
+
* type name with a random UUID:
|
|
12
|
+
*
|
|
13
|
+
* ```
|
|
14
|
+
* https://example.com/#Follow/12345678-1234-5678-1234-567812345678
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @template TContextData The type of the context data.
|
|
18
|
+
* @param activity The activity to assign an ID to.
|
|
19
|
+
* @param context The context of the activity.
|
|
20
|
+
* @return The activity with an ID assigned.
|
|
21
|
+
* @since 1.4.0
|
|
22
|
+
*/
|
|
23
|
+
declare function autoIdAssigner<TContextData>(activity: Activity, context: Context<TContextData>): Activity;
|
|
24
|
+
/**
|
|
25
|
+
* An activity transformer that dehydrates the actor property of an activity
|
|
26
|
+
* so that it only contains the actor's URI. For example, suppose we have an
|
|
27
|
+
* activity like this:
|
|
28
|
+
*
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { Follow, Person } from "@fedify/vocab";
|
|
31
|
+
* const input = new Follow({
|
|
32
|
+
* id: new URL("http://example.com/activities/1"),
|
|
33
|
+
* actor: new Person({
|
|
34
|
+
* id: new URL("http://example.com/actors/1"),
|
|
35
|
+
* name: "Alice",
|
|
36
|
+
* preferredUsername: "alice",
|
|
37
|
+
* }),
|
|
38
|
+
* object: new Person({
|
|
39
|
+
* id: new URL("http://example.com/actors/2"),
|
|
40
|
+
* name: "Bob",
|
|
41
|
+
* preferredUsername: "bob",
|
|
42
|
+
* }),
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* The result of applying this transformer would be:
|
|
47
|
+
*
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { Follow, Person } from "@fedify/vocab";
|
|
50
|
+
* const output = new Follow({
|
|
51
|
+
* id: new URL("http://example.com/activities/1"),
|
|
52
|
+
* actor: new URL("http://example.com/actors/1"),
|
|
53
|
+
* object: new Person({
|
|
54
|
+
* id: new URL("http://example.com/actors/2"),
|
|
55
|
+
* name: "Bob",
|
|
56
|
+
* preferredUsername: "bob",
|
|
57
|
+
* }),
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* As some ActivityPub implementations like Threads fail to deal with inlined
|
|
62
|
+
* actor objects, this transformer can be used to work around this issue.
|
|
63
|
+
* @template TContextData The type of the context data.
|
|
64
|
+
* @param activity The activity to dehydrate the actor property of.
|
|
65
|
+
* @param context The context of the activity.
|
|
66
|
+
* @returns The dehydrated activity.
|
|
67
|
+
* @since 1.4.0
|
|
68
|
+
*/
|
|
69
|
+
declare function actorDehydrator<TContextData>(activity: Activity, _context: Context<TContextData>): Activity;
|
|
70
|
+
/**
|
|
71
|
+
* Gets the default activity transformers that are applied to all outgoing
|
|
72
|
+
* activities.
|
|
73
|
+
* @template TContextData The type of the context data.
|
|
74
|
+
* @returns The default activity transformers.
|
|
75
|
+
* @since 1.4.0
|
|
76
|
+
*/
|
|
77
|
+
declare function getDefaultActivityTransformers<TContextData>(): readonly ActivityTransformer<TContextData>[];
|
|
78
|
+
//#endregion
|
|
7
79
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,9 +1,81 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { Ct as ActivityTransformer, n as Context } from "../context-BOiMZBu5.js";
|
|
4
|
+
import { Activity } from "@fedify/vocab";
|
|
5
|
+
|
|
6
|
+
//#region src/compat/transformers.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* An activity transformer that assigns a new random ID to an activity if it
|
|
9
|
+
* does not already have one. This is useful for ensuring that activities
|
|
10
|
+
* have an ID before they are sent to other servers.
|
|
11
|
+
*
|
|
12
|
+
* The generated ID is an origin URI with a fragment which contains an activity
|
|
13
|
+
* type name with a random UUID:
|
|
14
|
+
*
|
|
15
|
+
* ```
|
|
16
|
+
* https://example.com/#Follow/12345678-1234-5678-1234-567812345678
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @template TContextData The type of the context data.
|
|
20
|
+
* @param activity The activity to assign an ID to.
|
|
21
|
+
* @param context The context of the activity.
|
|
22
|
+
* @return The activity with an ID assigned.
|
|
23
|
+
* @since 1.4.0
|
|
24
|
+
*/
|
|
25
|
+
declare function autoIdAssigner<TContextData>(activity: Activity, context: Context<TContextData>): Activity;
|
|
26
|
+
/**
|
|
27
|
+
* An activity transformer that dehydrates the actor property of an activity
|
|
28
|
+
* so that it only contains the actor's URI. For example, suppose we have an
|
|
29
|
+
* activity like this:
|
|
30
|
+
*
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { Follow, Person } from "@fedify/vocab";
|
|
33
|
+
* const input = new Follow({
|
|
34
|
+
* id: new URL("http://example.com/activities/1"),
|
|
35
|
+
* actor: new Person({
|
|
36
|
+
* id: new URL("http://example.com/actors/1"),
|
|
37
|
+
* name: "Alice",
|
|
38
|
+
* preferredUsername: "alice",
|
|
39
|
+
* }),
|
|
40
|
+
* object: new Person({
|
|
41
|
+
* id: new URL("http://example.com/actors/2"),
|
|
42
|
+
* name: "Bob",
|
|
43
|
+
* preferredUsername: "bob",
|
|
44
|
+
* }),
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* The result of applying this transformer would be:
|
|
49
|
+
*
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { Follow, Person } from "@fedify/vocab";
|
|
52
|
+
* const output = new Follow({
|
|
53
|
+
* id: new URL("http://example.com/activities/1"),
|
|
54
|
+
* actor: new URL("http://example.com/actors/1"),
|
|
55
|
+
* object: new Person({
|
|
56
|
+
* id: new URL("http://example.com/actors/2"),
|
|
57
|
+
* name: "Bob",
|
|
58
|
+
* preferredUsername: "bob",
|
|
59
|
+
* }),
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* As some ActivityPub implementations like Threads fail to deal with inlined
|
|
64
|
+
* actor objects, this transformer can be used to work around this issue.
|
|
65
|
+
* @template TContextData The type of the context data.
|
|
66
|
+
* @param activity The activity to dehydrate the actor property of.
|
|
67
|
+
* @param context The context of the activity.
|
|
68
|
+
* @returns The dehydrated activity.
|
|
69
|
+
* @since 1.4.0
|
|
70
|
+
*/
|
|
71
|
+
declare function actorDehydrator<TContextData>(activity: Activity, _context: Context<TContextData>): Activity;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the default activity transformers that are applied to all outgoing
|
|
74
|
+
* activities.
|
|
75
|
+
* @template TContextData The type of the context data.
|
|
76
|
+
* @returns The default activity transformers.
|
|
77
|
+
* @since 1.4.0
|
|
78
|
+
*/
|
|
79
|
+
declare function getDefaultActivityTransformers<TContextData>(): readonly ActivityTransformer<TContextData>[];
|
|
80
|
+
//#endregion
|
|
9
81
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
package/dist/compat/mod.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-C3FLHUd6.js";
|
|
6
|
-
import "../compat-Bb4NuTUO.js";
|
|
7
|
-
|
|
8
|
-
export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "../transformers-ve6e2xcg.js";
|
|
4
|
+
export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
+
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
6
|
+
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
7
|
+
import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
|
|
8
|
+
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-DMZGXHm3.mjs";
|
|
9
|
+
import { test } from "@fedify/fixture";
|
|
10
|
+
import { Follow, Person } from "@fedify/vocab";
|
|
11
|
+
//#region src/compat/transformers.test.ts
|
|
12
|
+
const context = new FederationImpl({ kv: new MemoryKvStore() }).createContext(new URL("http://example.com/"));
|
|
13
|
+
test("autoIdAssigner", async () => {
|
|
14
|
+
const result = autoIdAssigner(new Follow({
|
|
15
|
+
actor: new URL("http://example.com/actors/1"),
|
|
16
|
+
object: new Person({
|
|
17
|
+
id: new URL("http://example.com/actors/2"),
|
|
18
|
+
name: "Bob",
|
|
19
|
+
preferredUsername: "bob"
|
|
20
|
+
})
|
|
21
|
+
}), context);
|
|
22
|
+
const { id } = result;
|
|
23
|
+
assertInstanceOf(id, URL);
|
|
24
|
+
assertEquals(id.origin, "http://example.com");
|
|
25
|
+
assertEquals(id.pathname, "/");
|
|
26
|
+
assertEquals(id.search, "");
|
|
27
|
+
assert(id.hash.match(/^#Follow\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/));
|
|
28
|
+
assertEquals(await result.toJsonLd(), await new Follow({
|
|
29
|
+
id,
|
|
30
|
+
actor: new URL("http://example.com/actors/1"),
|
|
31
|
+
object: new Person({
|
|
32
|
+
id: new URL("http://example.com/actors/2"),
|
|
33
|
+
name: "Bob",
|
|
34
|
+
preferredUsername: "bob"
|
|
35
|
+
})
|
|
36
|
+
}).toJsonLd());
|
|
37
|
+
});
|
|
38
|
+
test("actorDehydrator()", async () => {
|
|
39
|
+
assertEquals(await actorDehydrator(new Follow({
|
|
40
|
+
id: new URL("http://example.com/activities/1"),
|
|
41
|
+
actor: new Person({
|
|
42
|
+
id: new URL("http://example.com/actors/1"),
|
|
43
|
+
name: "Alice",
|
|
44
|
+
preferredUsername: "alice"
|
|
45
|
+
}),
|
|
46
|
+
object: new Person({
|
|
47
|
+
id: new URL("http://example.com/actors/2"),
|
|
48
|
+
name: "Bob",
|
|
49
|
+
preferredUsername: "bob"
|
|
50
|
+
})
|
|
51
|
+
}), context).toJsonLd(), await new Follow({
|
|
52
|
+
id: new URL("http://example.com/activities/1"),
|
|
53
|
+
actor: new URL("http://example.com/actors/1"),
|
|
54
|
+
object: new Person({
|
|
55
|
+
id: new URL("http://example.com/actors/2"),
|
|
56
|
+
name: "Bob",
|
|
57
|
+
preferredUsername: "bob"
|
|
58
|
+
})
|
|
59
|
+
}).toJsonLd());
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { GetKeyOwnerOptions } from "./owner-
|
|
6
|
-
import {
|
|
3
|
+
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-AtlibPOU.js";
|
|
4
|
+
import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-aQzN9Ayi.js";
|
|
5
|
+
import { n as GetKeyOwnerOptions } from "./owner-74ARJ5TL.js";
|
|
6
|
+
import { n as KvStore, t as KvKey } from "./kv-GFYnFoOl.js";
|
|
7
7
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
8
8
|
import { Span, Tracer, TracerProvider } from "@opentelemetry/api";
|
|
9
9
|
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
@@ -59,10 +59,6 @@ interface SenderKeyPair {
|
|
|
59
59
|
*/
|
|
60
60
|
readonly keyId: URL;
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Parameters for {@link sendActivity}.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
62
|
/**
|
|
67
63
|
* An error that is thrown when an activity fails to send to a remote inbox.
|
|
68
64
|
* It contains structured information about the failure, including the HTTP
|
|
@@ -296,13 +292,9 @@ type OutboxErrorHandler = (error: Error, activity: Activity | null) => void | Pr
|
|
|
296
292
|
* @since 2.0.0
|
|
297
293
|
*/
|
|
298
294
|
type OutboxPermanentFailureHandler<TContextData> = (context: Context<TContextData>, values: {
|
|
299
|
-
/** The inbox URL that failed. */
|
|
300
|
-
readonly
|
|
301
|
-
/** The
|
|
302
|
-
readonly activity: Activity;
|
|
303
|
-
/** The error that occurred. */
|
|
304
|
-
readonly error: SendActivityError;
|
|
305
|
-
/** The HTTP status code returned by the inbox. */
|
|
295
|
+
/** The inbox URL that failed. */readonly inbox: URL; /** The activity that failed to deliver. */
|
|
296
|
+
readonly activity: Activity; /** The error that occurred. */
|
|
297
|
+
readonly error: SendActivityError; /** The HTTP status code returned by the inbox. */
|
|
306
298
|
readonly statusCode: number;
|
|
307
299
|
/**
|
|
308
300
|
* The actor IDs that were supposed to receive the activity at this inbox.
|
|
@@ -372,7 +364,6 @@ type CustomCollectionCounter<TParam extends string, TContextData> = (context: Re
|
|
|
372
364
|
type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
|
|
373
365
|
//#endregion
|
|
374
366
|
//#region src/federation/mq.d.ts
|
|
375
|
-
// deno-lint-ignore-file no-explicit-any
|
|
376
367
|
/**
|
|
377
368
|
* Additional options for enqueuing a message in a queue.
|
|
378
369
|
*
|
|
@@ -474,7 +465,7 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
474
465
|
* In-process message queue does not provide native retry mechanisms.
|
|
475
466
|
* @since 1.7.0
|
|
476
467
|
*/
|
|
477
|
-
readonly nativeRetrial
|
|
468
|
+
readonly nativeRetrial = false;
|
|
478
469
|
/**
|
|
479
470
|
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
480
471
|
* @param options Additional options for the in-process message queue.
|
|
@@ -2595,4 +2586,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2595
2586
|
readonly multikey: Multikey;
|
|
2596
2587
|
}
|
|
2597
2588
|
//#endregion
|
|
2598
|
-
export {
|
|
2589
|
+
export { ActorKeyPairsDispatcher as $, createFederation as A, RouterRouteResult as B, InboxChallengePolicy as C, ActivityTransformer as Ct, FederationKvPrefixes as D, Rfc6570Expression as E, Message as F, InProcessMessageQueueOptions as G, respondWithObject as H, createFederationBuilder as I, MessageQueueListenOptions as J, MessageQueue as K, Router as L, RetryContext as M, RetryPolicy as N, FederationOrigin as O, createExponentialBackoffPolicy as P, ActorHandleMapper as Q, RouterError as R, IdempotencyStrategy as S, digest as St, ObjectCallbackSetters as T, respondWithObjectIfAcceptable as U, RespondWithObjectOptions as V, InProcessMessageQueue as W, ActorAliasMapper as X, ParallelMessageQueue as Y, ActorDispatcher as Z, FederationBuilder as _, WebFingerLinksDispatcher as _t, InboxContext as a, CustomCollectionCursor as at, FederationStartQueueOptions as b, PageItems as bt, RouteActivityOptions as c, InboxListener as ct, ActorCallbackSetters as d, ObjectDispatcher as dt, AuthorizePredicate as et, CollectionCallbackSetters as f, OutboxErrorHandler as ft, Federation as g, UnverifiedActivityReason as gt, Federatable as h, UnverifiedActivityHandler as ht, GetSignedKeyOptions as i, CustomCollectionCounter as it, CreateExponentialBackoffPolicyOptions as j, FederationQueueOptions as k, SendActivityOptions as l, NodeInfoDispatcher as lt, CustomCollectionCallbackSetters as m, SharedInboxKeyDispatcher as mt, Context as n, CollectionCursor as nt, ParseUriResult as o, CustomCollectionDispatcher as ot, ConstructorWithTypeId as p, OutboxPermanentFailureHandler as pt, MessageQueueEnqueueOptions as q, ForwardActivityOptions as r, CollectionDispatcher as rt, RequestContext as s, InboxErrorHandler as st, ActorKeyPair as t, CollectionCounter as tt, SendActivityOptionsForCollection as u, ObjectAuthorizePredicate as ut, FederationFetchOptions as v, SendActivityError as vt, InboxListenerSetters as w, IdempotencyKeyCallback as x, buildCollectionSynchronizationHeader as xt, FederationOptions as y, SenderKeyPair as yt, RouterOptions as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { GetKeyOwnerOptions } from "./owner-
|
|
4
|
-
import {
|
|
1
|
+
import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-z-8dc-e1.cjs";
|
|
2
|
+
import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-CrGuipxe.cjs";
|
|
3
|
+
import { n as GetKeyOwnerOptions } from "./owner-CptqhsOy.cjs";
|
|
4
|
+
import { n as KvStore, t as KvKey } from "./kv-CbLNp3zQ.cjs";
|
|
5
5
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, 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";
|
|
@@ -57,10 +57,6 @@ interface SenderKeyPair {
|
|
|
57
57
|
*/
|
|
58
58
|
readonly keyId: URL;
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Parameters for {@link sendActivity}.
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
60
|
/**
|
|
65
61
|
* An error that is thrown when an activity fails to send to a remote inbox.
|
|
66
62
|
* It contains structured information about the failure, including the HTTP
|
|
@@ -294,13 +290,9 @@ type OutboxErrorHandler = (error: Error, activity: Activity | null) => void | Pr
|
|
|
294
290
|
* @since 2.0.0
|
|
295
291
|
*/
|
|
296
292
|
type OutboxPermanentFailureHandler<TContextData> = (context: Context<TContextData>, values: {
|
|
297
|
-
/** The inbox URL that failed. */
|
|
298
|
-
readonly
|
|
299
|
-
/** The
|
|
300
|
-
readonly activity: Activity;
|
|
301
|
-
/** The error that occurred. */
|
|
302
|
-
readonly error: SendActivityError;
|
|
303
|
-
/** The HTTP status code returned by the inbox. */
|
|
293
|
+
/** The inbox URL that failed. */readonly inbox: URL; /** The activity that failed to deliver. */
|
|
294
|
+
readonly activity: Activity; /** The error that occurred. */
|
|
295
|
+
readonly error: SendActivityError; /** The HTTP status code returned by the inbox. */
|
|
304
296
|
readonly statusCode: number;
|
|
305
297
|
/**
|
|
306
298
|
* The actor IDs that were supposed to receive the activity at this inbox.
|
|
@@ -370,7 +362,6 @@ type CustomCollectionCounter<TParam extends string, TContextData> = (context: Re
|
|
|
370
362
|
type CustomCollectionCursor<TParam extends string, TContext extends Context<TContextData>, TContextData> = (context: TContext, values: Record<TParam, string>) => string | null | Promise<string | null>;
|
|
371
363
|
//#endregion
|
|
372
364
|
//#region src/federation/mq.d.ts
|
|
373
|
-
// deno-lint-ignore-file no-explicit-any
|
|
374
365
|
/**
|
|
375
366
|
* Additional options for enqueuing a message in a queue.
|
|
376
367
|
*
|
|
@@ -472,7 +463,7 @@ declare class InProcessMessageQueue implements MessageQueue {
|
|
|
472
463
|
* In-process message queue does not provide native retry mechanisms.
|
|
473
464
|
* @since 1.7.0
|
|
474
465
|
*/
|
|
475
|
-
readonly nativeRetrial
|
|
466
|
+
readonly nativeRetrial = false;
|
|
476
467
|
/**
|
|
477
468
|
* Constructs a new {@link InProcessMessageQueue} with the given options.
|
|
478
469
|
* @param options Additional options for the in-process message queue.
|
|
@@ -2593,4 +2584,4 @@ interface ActorKeyPair extends CryptoKeyPair {
|
|
|
2593
2584
|
readonly multikey: Multikey;
|
|
2594
2585
|
}
|
|
2595
2586
|
//#endregion
|
|
2596
|
-
export {
|
|
2587
|
+
export { ActorKeyPairsDispatcher as $, createFederation as A, RouterRouteResult as B, InboxChallengePolicy as C, ActivityTransformer as Ct, FederationKvPrefixes as D, Rfc6570Expression as E, Message as F, InProcessMessageQueueOptions as G, respondWithObject as H, createFederationBuilder as I, MessageQueueListenOptions as J, MessageQueue as K, Router as L, RetryContext as M, RetryPolicy as N, FederationOrigin as O, createExponentialBackoffPolicy as P, ActorHandleMapper as Q, RouterError as R, IdempotencyStrategy as S, digest as St, ObjectCallbackSetters as T, respondWithObjectIfAcceptable as U, RespondWithObjectOptions as V, InProcessMessageQueue as W, ActorAliasMapper as X, ParallelMessageQueue as Y, ActorDispatcher as Z, FederationBuilder as _, WebFingerLinksDispatcher as _t, InboxContext as a, CustomCollectionCursor as at, FederationStartQueueOptions as b, PageItems as bt, RouteActivityOptions as c, InboxListener as ct, ActorCallbackSetters as d, ObjectDispatcher as dt, AuthorizePredicate as et, CollectionCallbackSetters as f, OutboxErrorHandler as ft, Federation as g, UnverifiedActivityReason as gt, Federatable as h, UnverifiedActivityHandler as ht, GetSignedKeyOptions as i, CustomCollectionCounter as it, CreateExponentialBackoffPolicyOptions as j, FederationQueueOptions as k, SendActivityOptions as l, NodeInfoDispatcher as lt, CustomCollectionCallbackSetters as m, SharedInboxKeyDispatcher as mt, Context as n, CollectionCursor as nt, ParseUriResult as o, CustomCollectionDispatcher as ot, ConstructorWithTypeId as p, OutboxPermanentFailureHandler as pt, MessageQueueEnqueueOptions as q, ForwardActivityOptions as r, CollectionDispatcher as rt, RequestContext as s, InboxErrorHandler as st, ActorKeyPair as t, CollectionCounter as tt, SendActivityOptionsForCollection as u, ObjectAuthorizePredicate as ut, FederationFetchOptions as v, SendActivityError as vt, InboxListenerSetters as w, IdempotencyKeyCallback as x, buildCollectionSynchronizationHeader as xt, FederationOptions as y, SenderKeyPair as yt, RouterOptions as z };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { RouterError } from "./router-D9eI0s4b.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { n as RouterError } from "./router-CrMLXoOr.mjs";
|
|
7
5
|
import { mockDocumentLoader } from "@fedify/fixture";
|
|
8
6
|
import { lookupObject, traverseCollection } from "@fedify/vocab";
|
|
9
7
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
10
8
|
import { trace } from "@opentelemetry/api";
|
|
11
|
-
|
|
12
9
|
//#region src/testing/context.ts
|
|
13
10
|
function createContext(values) {
|
|
14
11
|
const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getCollectionUri, getOutboxUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity } = values;
|
|
@@ -25,9 +22,9 @@ function createContext(values) {
|
|
|
25
22
|
documentLoader: documentLoader ?? mockDocumentLoader,
|
|
26
23
|
contextLoader: contextLoader ?? mockDocumentLoader,
|
|
27
24
|
tracerProvider: tracerProvider ?? trace.getTracerProvider(),
|
|
28
|
-
clone: clone ?? ((data
|
|
25
|
+
clone: clone ?? ((data) => createContext({
|
|
29
26
|
...values,
|
|
30
|
-
data
|
|
27
|
+
data
|
|
31
28
|
})),
|
|
32
29
|
getNodeInfoUri: getNodeInfoUri ?? throwRouterError,
|
|
33
30
|
getActorUri: getActorUri ?? throwRouterError,
|
|
@@ -104,6 +101,5 @@ function createInboxContext(args) {
|
|
|
104
101
|
})
|
|
105
102
|
};
|
|
106
103
|
}
|
|
107
|
-
|
|
108
104
|
//#endregion
|
|
109
|
-
export {
|
|
105
|
+
export { createRequestContext as n, createInboxContext as t };
|