@fedify/fedify 2.3.0-dev.1119 → 2.3.0-dev.1137
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/README.md +3 -0
- package/dist/{assert-DikXweDx.mjs → assert-OguE97r2.mjs} +1 -1
- package/dist/{assert_instance_of-C4Ri6VuN.mjs → assert_instance_of-DBC5X09g.mjs} +1 -1
- package/dist/{assert_not_equals--wG9hV7u.mjs → assert_not_equals-DkVK8oqV.mjs} +1 -1
- package/dist/{assert_rejects-DQP-q39h.mjs → assert_rejects-DN60FHPX.mjs} +2 -2
- package/dist/{assert_strict_equals-Dmjbg-bA.mjs → assert_strict_equals-XEgZAlrj.mjs} +1 -1
- package/dist/{assert_throws-4NwKEy2q.mjs → assert_throws-BOkhLGYc.mjs} +1 -1
- package/dist/{builder-Ond_h57y.mjs → builder-BCkBXxky.mjs} +60 -41
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +3 -3
- package/dist/compat/public-audience.test.mjs +3 -3
- package/dist/compat/transformers.test.mjs +5 -5
- package/dist/{context-cSUMk2da.d.ts → context-DCtsSHDv.d.ts} +4 -293
- package/dist/{context-Ch-ZLyTQ.d.cts → context-DI2gRbyN.d.cts} +3 -294
- package/dist/{context-BAE7AKLA.mjs → context-DVoTs_wM.mjs} +1 -1
- package/dist/{deno-DVsHS7rA.mjs → deno-B_9yJW3w.mjs} +1 -1
- package/dist/{docloader-WsWfKaE5.mjs → docloader-BT89tyFr.mjs} +3 -3
- package/dist/federation/builder.test.mjs +138 -10
- package/dist/federation/collection.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +12 -12
- package/dist/federation/idempotency.test.mjs +6 -6
- package/dist/federation/inbox.test.mjs +3 -3
- package/dist/federation/keycache.test.mjs +5 -5
- package/dist/federation/kv.test.mjs +3 -3
- package/dist/federation/metrics.test.mjs +231 -3
- package/dist/federation/middleware.test.mjs +88 -18
- package/dist/federation/mod.cjs +155 -3
- package/dist/federation/mod.d.cts +3 -2
- package/dist/federation/mod.d.ts +3 -2
- package/dist/federation/mod.js +153 -1
- package/dist/federation/mq.test.mjs +5 -5
- package/dist/federation/negotiation.test.mjs +4 -4
- package/dist/federation/retry.test.mjs +3 -3
- package/dist/federation/router.test.mjs +190 -9
- package/dist/federation/send.test.mjs +16 -16
- package/dist/federation/webfinger.test.mjs +5 -5
- package/dist/{getMachineId-bsd-BY01PL1n.mjs → getMachineId-bsd-etIyxDet.mjs} +1 -1
- package/dist/{getMachineId-darwin-Dr1gkBkp.mjs → getMachineId-darwin-D23zTf4g.mjs} +1 -1
- package/dist/{getMachineId-win-QEYwcJiy.mjs → getMachineId-win-Dpap6v5i.mjs} +1 -1
- package/dist/{http-CouJSFVK.js → http-CToqG5ap.js} +252 -20
- package/dist/{http-CubOB9wq.cjs → http-CWoeyogl.cjs} +263 -19
- package/dist/{http-DUV8ysti.mjs → http-Cyx5SNuu.mjs} +8 -6
- package/dist/{http-D6LP89UO.d.ts → http-VyDTd4G3.d.cts} +8 -1
- package/dist/{http-D6aw3j2U.d.cts → http-lf8Hsd91.d.ts} +8 -1
- package/dist/{key-BoWaYRHm.mjs → key-CkkMJBjF.mjs} +42 -17
- package/dist/{kv-cache-DBNpsneh.js → kv-cache-CuCn2xvM.js} +19 -2
- package/dist/{kv-cache-Dz31ATUT.cjs → kv-cache-DuEwFYcN.cjs} +19 -2
- package/dist/{kv-cache-DihufyAQ.mjs → kv-cache-VHFP42vY.mjs} +19 -1
- package/dist/{ld-B5K1mSuG.mjs → ld-k8yqD2a-.mjs} +3 -3
- package/dist/{metrics-C4attqv0.mjs → metrics-iRBg8jTk.mjs} +209 -2
- package/dist/{middleware-CmsDtIHI.cjs → middleware-BWLUrbS9.cjs} +137 -210
- package/dist/{middleware-BDKFRjue.mjs → middleware-CztxpARM.mjs} +1 -1
- package/dist/{middleware-Dtjz-hSk.js → middleware-D7FrhN9q.js} +101 -162
- package/dist/{middleware-t0jC8I99.mjs → middleware-DQEgdr83.mjs} +64 -36
- package/dist/{mod-BDhgfjP7.d.cts → mod-B0hW12_O.d.cts} +1 -1
- package/dist/mod-C504qevA.d.cts +173 -0
- package/dist/{mod-B-Lin9Sy.d.ts → mod-COIAjwRS.d.ts} +1 -1
- package/dist/{mod-DLrRb0dx.d.ts → mod-DFvNJcNb.d.ts} +54 -3
- package/dist/mod-wYfuXeDE.d.ts +173 -0
- package/dist/{mod-BR_BB0bh.d.cts → mod-yvIXFAEi.d.cts} +54 -3
- package/dist/mod.cjs +6 -6
- package/dist/mod.d.cts +6 -5
- package/dist/mod.d.ts +6 -5
- package/dist/mod.js +5 -5
- package/dist/mq-D-nlpY04.d.ts +208 -0
- package/dist/mq-D8uSFzxe.d.cts +208 -0
- package/dist/nodeinfo/client.test.mjs +4 -4
- package/dist/nodeinfo/handler.test.mjs +5 -5
- package/dist/nodeinfo/types.test.mjs +4 -4
- package/dist/otel/exporter.test.mjs +3 -3
- package/dist/{outgoing-jsonld-BNL8AC14.mjs → outgoing-jsonld-BgFLCJQ_.mjs} +1 -1
- package/dist/{owner-hDxI0ufu.mjs → owner-nmXdvXpc.mjs} +2 -2
- package/dist/{proof-BUWfVr6Q.cjs → proof-CcsIJLTn.cjs} +1 -1
- package/dist/{proof-DhVuz4bc.mjs → proof-DpwO1T4S.mjs} +5 -5
- package/dist/{proof-n60t8o9P.js → proof-NRmtrTDu.js} +1 -1
- package/dist/{send-BPhyR5Oo.mjs → send-DvX2tYyZ.mjs} +3 -3
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +13 -9
- package/dist/sig/key.test.mjs +104 -7
- package/dist/sig/ld.test.mjs +7 -7
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +2 -2
- package/dist/sig/mod.d.ts +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +6 -6
- package/dist/sig/proof.test.mjs +8 -8
- package/dist/{std__assert-BTEgfoJo.mjs → std__assert-BBjXFNOb.mjs} +4 -4
- package/dist/testing/mod.d.mts +1 -0
- package/dist/testing/mod.mjs +1 -1
- package/dist/utils/docloader.test.mjs +7 -7
- package/dist/utils/kv-cache.test.mjs +67 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -7
- package/dist/mod-C6E8rkcz.d.ts +0 -63
- package/dist/mod-P9tE2WmM.d.cts +0 -63
- package/dist/router-BT_F5748.mjs +0 -114
- /package/dist/{accept-CgDcxvjV.mjs → accept-CceiKpCy.mjs} +0 -0
- /package/dist/{activity-listener-BeTGV3wc.mjs → activity-listener-tztVvlNb.mjs} +0 -0
- /package/dist/{assert_equals-Ew3jOFa3.mjs → assert_equals-C-ZRDbaf.mjs} +0 -0
- /package/dist/{client-Bneh_DYR.mjs → client-B_A6mfn3.mjs} +0 -0
- /package/dist/{collection-Cc3DVAhE.mjs → collection-CA3V5zyK.mjs} +0 -0
- /package/dist/{esm-sdtqOUPu.mjs → esm-BQRw925N.mjs} +0 -0
- /package/dist/{execAsync-Dxb7rNf3.mjs → execAsync-DCBrgFiV.mjs} +0 -0
- /package/dist/{getMachineId-linux-Bbhofx-s.mjs → getMachineId-linux-ObI47Hql.mjs} +0 -0
- /package/dist/{getMachineId-unsupported-dIOte2Ct.mjs → getMachineId-unsupported-Ddu-PFeh.mjs} +0 -0
- /package/dist/{keycache-BeU0LCII.mjs → keycache-BYMd8q7F.mjs} +0 -0
- /package/dist/{keys-CSYsOMFG.mjs → keys-C3kae-6B.mjs} +0 -0
- /package/dist/{kv-QHE0oeM3.mjs → kv-x2IvBUyq.mjs} +0 -0
- /package/dist/{negotiation-DDstyBvc.mjs → negotiation-CDW-_gUU.mjs} +0 -0
- /package/dist/{public-audience-c9zmYKgA.mjs → public-audience-N3pyOx2p.mjs} +0 -0
- /package/dist/{retry-_VvV0h9f.mjs → retry-v_sGLH1d.mjs} +0 -0
- /package/dist/{types-D09GN0uZ.mjs → types-BFowWFTT.mjs} +0 -0
package/dist/router-BT_F5748.mjs
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import "@js-temporal/polyfill";
|
|
2
|
-
import "urlpattern-polyfill";
|
|
3
|
-
globalThis.addEventListener = () => {};
|
|
4
|
-
import { cloneDeep } from "es-toolkit";
|
|
5
|
-
import { Router } from "uri-template-router";
|
|
6
|
-
import { parseTemplate } from "url-template";
|
|
7
|
-
//#region src/federation/router.ts
|
|
8
|
-
function cloneInnerRouter(router) {
|
|
9
|
-
const clone = new Router();
|
|
10
|
-
clone.nid = router.nid;
|
|
11
|
-
clone.fsm = cloneDeep(router.fsm);
|
|
12
|
-
clone.routeSet = new Set(router.routeSet);
|
|
13
|
-
clone.templateRouteMap = new Map(router.templateRouteMap);
|
|
14
|
-
clone.valueRouteMap = new Map(router.valueRouteMap);
|
|
15
|
-
clone.hierarchy = cloneDeep(router.hierarchy);
|
|
16
|
-
return clone;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* URL router and constructor based on URI Template
|
|
20
|
-
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
|
21
|
-
*/
|
|
22
|
-
var Router$1 = class Router$1 {
|
|
23
|
-
#router;
|
|
24
|
-
#templates;
|
|
25
|
-
#templateStrings;
|
|
26
|
-
/**
|
|
27
|
-
* Whether to ignore trailing slashes when matching paths.
|
|
28
|
-
* @since 1.6.0
|
|
29
|
-
*/
|
|
30
|
-
trailingSlashInsensitive;
|
|
31
|
-
/**
|
|
32
|
-
* Create a new {@link Router}.
|
|
33
|
-
* @param options Options for the router.
|
|
34
|
-
*/
|
|
35
|
-
constructor(options = {}) {
|
|
36
|
-
this.#router = new Router();
|
|
37
|
-
this.#templates = {};
|
|
38
|
-
this.#templateStrings = {};
|
|
39
|
-
this.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
|
|
40
|
-
}
|
|
41
|
-
clone() {
|
|
42
|
-
const clone = new Router$1({ trailingSlashInsensitive: this.trailingSlashInsensitive });
|
|
43
|
-
clone.#router = cloneInnerRouter(this.#router);
|
|
44
|
-
clone.#templates = { ...this.#templates };
|
|
45
|
-
clone.#templateStrings = { ...this.#templateStrings };
|
|
46
|
-
return clone;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Checks if a path name exists in the router.
|
|
50
|
-
* @param name The name of the path.
|
|
51
|
-
* @returns `true` if the path name exists, otherwise `false`.
|
|
52
|
-
*/
|
|
53
|
-
has(name) {
|
|
54
|
-
return name in this.#templates;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Adds a new path rule to the router.
|
|
58
|
-
* @param template The path pattern.
|
|
59
|
-
* @param name The name of the path.
|
|
60
|
-
* @returns The names of the variables in the path pattern.
|
|
61
|
-
*/
|
|
62
|
-
add(template, name) {
|
|
63
|
-
if (!template.startsWith("/")) throw new RouterError("Path must start with a slash.");
|
|
64
|
-
const rule = this.#router.addTemplate(template, {}, name);
|
|
65
|
-
this.#templates[name] = parseTemplate(template);
|
|
66
|
-
this.#templateStrings[name] = template;
|
|
67
|
-
return new Set(rule.variables.map((v) => v.varname));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Resolves a path name and values from a URL, if any match.
|
|
71
|
-
* @param url The URL to resolve.
|
|
72
|
-
* @returns The name of the path and its values, if any match. Otherwise,
|
|
73
|
-
* `null`.
|
|
74
|
-
*/
|
|
75
|
-
route(url) {
|
|
76
|
-
let match = this.#router.resolveURI(url);
|
|
77
|
-
if (match == null) {
|
|
78
|
-
if (!this.trailingSlashInsensitive) return null;
|
|
79
|
-
url = url.endsWith("/") ? url.replace(/\/+$/, "") : `${url}/`;
|
|
80
|
-
match = this.#router.resolveURI(url);
|
|
81
|
-
if (match == null) return null;
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
name: match.matchValue,
|
|
85
|
-
template: this.#templateStrings[match.matchValue],
|
|
86
|
-
values: match.params
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Constructs a URL/path from a path name and values.
|
|
91
|
-
* @param name The name of the path.
|
|
92
|
-
* @param values The values to expand the path with.
|
|
93
|
-
* @returns The URL/path, if the name exists. Otherwise, `null`.
|
|
94
|
-
*/
|
|
95
|
-
build(name, values) {
|
|
96
|
-
if (name in this.#templates) return this.#templates[name].expand(values);
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* An error thrown by the {@link Router}.
|
|
102
|
-
*/
|
|
103
|
-
var RouterError = class extends Error {
|
|
104
|
-
/**
|
|
105
|
-
* Create a new {@link RouterError}.
|
|
106
|
-
* @param message The error message.
|
|
107
|
-
*/
|
|
108
|
-
constructor(message) {
|
|
109
|
-
super(message);
|
|
110
|
-
this.name = "RouterError";
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
//#endregion
|
|
114
|
-
export { RouterError as n, Router$1 as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{getMachineId-unsupported-dIOte2Ct.mjs → getMachineId-unsupported-Ddu-PFeh.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|