@fedify/fedify 1.8.1-pr.328.1165 → 1.8.1-pr.329.1209
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 +1 -4
- package/dist/{actor-6WfgEEM7.js → actor-CiCVXwx3.js} +4 -1
- package/dist/{actor-BvUN9QgD.js → actor-DOUbHIhg.js} +179 -179
- package/dist/{assert_rejects-AjlKk-Vo.js → assert_rejects-DceVjUlD.js} +1 -1
- package/dist/{assert_throws-CqMKbTh_.js → assert_throws-DTDC_gwN.js} +1 -1
- package/dist/{authdocloader-BxpW2l0x.js → authdocloader-CMmTK9S5.js} +3 -3
- package/dist/{authdocloader-DlQKiAuj.js → authdocloader-CrpSsLr1.js} +4 -3
- package/dist/{builder-Bql0U6IX.js → builder-DFk9FOJ6.js} +5 -4
- package/dist/chunk-HsBuZ-b2.js +41 -0
- package/dist/{client-CI4TcEtW.js → client-CYFhpq6p.js} +2 -2
- package/dist/compat/transformers.test.js +27 -20
- package/dist/context-B4-Ypxls.js +108 -0
- package/dist/docloader-09nVWLAZ.js +68 -0
- package/dist/{docloader-B6dtEu0e.js → docloader-B8jv3Z2V.js} +1 -2
- package/dist/docloader-xLomwjk3.js +4526 -0
- package/dist/{esm-80CEOYyg.js → esm-d-9EVGaP.js} +1 -1
- package/dist/federation/builder.test.js +16 -11
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +35 -26
- package/dist/federation/inbox.test.js +10 -6
- package/dist/federation/keycache.test.js +7 -4
- package/dist/federation/kv.test.js +6 -8
- package/dist/federation/middleware.test.js +35 -27
- package/dist/federation/mod.js +10 -10
- package/dist/federation/mq.test.js +8 -10
- package/dist/federation/retry.test.js +3 -5
- package/dist/federation/router.test.js +7 -8
- package/dist/federation/send.test.js +21 -15
- package/dist/{http-Cdm4poZb.js → http-6MXyLsoh.js} +3 -2
- package/dist/{http-epXQkoos.js → http-DLoFeou5.js} +3 -3
- package/dist/{inbox-ClBcgVPg.js → inbox-K6Jqy_1j.js} +3 -1
- package/dist/{key-B2Vg4tVB.js → key-B56jBz9U.js} +4 -4
- package/dist/{key-Cl_Xlkrv.js → key-BAIJJ5gY.js} +2 -2
- package/dist/key-Be2GEH6h.js +16 -0
- package/dist/{key-D2T-GDYd.js → key-DbuLgndY.js} +3 -2
- package/dist/{keycache-M-zWLLCU.js → keycache-D2ce3zUW.js} +1 -1
- package/dist/{keys-qx88le-G.js → keys-Cl8uuXBD.js} +1 -1
- package/dist/langstr-DbWheeIS.js +33 -0
- package/dist/{ld-ZkyR7ab4.js → ld-WpKwgDtk.js} +4 -2
- package/dist/lookup-BhK5FmDe.js +132 -0
- package/dist/{lookup-BlMMBOS2.js → lookup-ByMEYudm.js} +1 -1
- package/dist/{lookup-BH2SgpoS.js → lookup-DMKWAbKW.js} +6 -113
- package/dist/middleware-B-tW_fwo.js +17 -0
- package/dist/middleware-Ba5IuZoK.js +33 -0
- package/dist/{middleware-0TQ_tx1T.js → middleware-Dbj6Ns6x.js} +21 -17
- package/dist/{middleware-Cye6GERQ.js → middleware-vpRI19Dq.js} +11 -11
- package/dist/mod.js +10 -10
- package/dist/multibase-DeCHcK8L.js +316 -0
- package/dist/nodeinfo/client.test.js +11 -11
- package/dist/nodeinfo/handler.test.js +34 -25
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +7 -9
- package/dist/nodeinfo/types.test.js +8 -10
- package/dist/{owner-C_vL0hRG.js → owner-jodbuyfr.js} +3 -2
- package/dist/{proof-CiYpiavN.js → proof-BSG6S-sj.js} +3 -3
- package/dist/{proof-Dz3Yq7kI.js → proof-DZrqpsSm.js} +4 -2
- package/dist/router-D3UybECj.js +118 -0
- package/dist/runtime/authdocloader.test.js +20 -14
- package/dist/runtime/docloader.test.js +10 -9
- package/dist/runtime/key.test.js +15 -10
- package/dist/runtime/langstr.test.js +7 -8
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +7 -8
- package/dist/runtime/url.test.js +4 -5
- package/dist/{send-CDQXxlmm.js → send-CNN4e6xr.js} +2 -2
- package/dist/sig/http.test.js +19 -13
- package/dist/sig/key.test.js +17 -11
- package/dist/sig/ld.test.js +16 -10
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +19 -12
- package/dist/sig/proof.test.js +18 -12
- package/dist/testing/docloader.test.js +7 -8
- package/dist/testing/mod.d.ts +1 -8387
- package/dist/testing/mod.js +2 -4
- package/dist/testing-BZ0dJ4qn.js +143 -0
- package/dist/type-D2s5lmbZ.js +14 -0
- package/dist/{types-E0EOd3en.js → types-9rwT068o.js} +1 -1
- package/dist/{types-n7HI7VFr.js → types-C7C_l-jz.js} +1 -1
- package/dist/url-kTAI6_KP.js +68 -0
- package/dist/vocab/actor.test.js +16 -10
- package/dist/vocab/lookup.test.js +16 -9
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +7 -3
- package/dist/vocab/vocab.test.js +13 -9
- package/dist/{type-BvQGw6hv.js → vocab-Db0G5VQ2.js} +183 -5255
- package/dist/{vocab-fVvi4e5m.js → vocab-iY_A93sn.js} +3 -3
- package/dist/webfinger/handler.test.js +34 -25
- package/dist/webfinger/lookup.test.js +10 -9
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.test.js +6 -8
- package/package.json +1 -1
- package/dist/key-CE5RdobB.js +0 -10
- package/dist/middleware-DPQqiqLu.js +0 -26
- package/dist/middleware-Dh8xaPyd.js +0 -17
- package/dist/testing-COl4JbdC.js +0 -301
- /package/dist/{assert_is_error-CeVBLPsZ.js → assert_is_error-DQdKoRgb.js} +0 -0
- /package/dist/{assert_not_equals-D2R2nl5h.js → assert_not_equals-7pyUM3Ib.js} +0 -0
- /package/dist/{collection-D5V3UzU3.js → collection-Dfb0TPno.js} +0 -0
- /package/dist/{denokv-DK9P5Jq7.js → denokv-QWKsIqML.js} +0 -0
- /package/dist/{retry-BnpVRGFC.js → retry-BiIhZWgD.js} +0 -0
- /package/dist/{semver-DCqorrj5.js → semver-DWClQt_5.js} +0 -0
- /package/dist/{std__assert-BQdmxyzF.js → std__assert-B3iAixc-.js} +0 -0
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { deno_default, getDocumentLoader } from "./docloader-xLomwjk3.js";
|
|
7
|
+
import { Activity, CryptographicKey, Object as Object$1 } from "./vocab-Db0G5VQ2.js";
|
|
8
|
+
import { getTypeId } from "./type-D2s5lmbZ.js";
|
|
9
|
+
import { fetchKey, validateCryptoKey } from "./key-DbuLgndY.js";
|
|
8
10
|
import { getLogger } from "@logtape/logtape";
|
|
9
11
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
12
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
5
|
+
|
|
6
|
+
import { deno_default, getUserAgent } from "./docloader-xLomwjk3.js";
|
|
7
|
+
import { UrlError, validatePublicUrl } from "./url-kTAI6_KP.js";
|
|
8
|
+
import { getLogger } from "@logtape/logtape";
|
|
9
|
+
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
|
+
|
|
11
|
+
//#region webfinger/lookup.ts
|
|
12
|
+
const logger = getLogger([
|
|
13
|
+
"fedify",
|
|
14
|
+
"webfinger",
|
|
15
|
+
"lookup"
|
|
16
|
+
]);
|
|
17
|
+
const DEFAULT_MAX_REDIRECTION = 5;
|
|
18
|
+
/**
|
|
19
|
+
* Looks up a WebFinger resource.
|
|
20
|
+
* @param resource The resource URL to look up.
|
|
21
|
+
* @param options Extra options for looking up the resource.
|
|
22
|
+
* @returns The resource descriptor, or `null` if not found.
|
|
23
|
+
* @since 0.2.0
|
|
24
|
+
*/
|
|
25
|
+
async function lookupWebFinger(resource, options = {}) {
|
|
26
|
+
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
27
|
+
const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
|
|
28
|
+
return await tracer.startActiveSpan("webfinger.lookup", {
|
|
29
|
+
kind: SpanKind.CLIENT,
|
|
30
|
+
attributes: {
|
|
31
|
+
"webfinger.resource": resource.toString(),
|
|
32
|
+
"webfinger.resource.scheme": typeof resource === "string" ? resource.replace(/:.*$/, "") : resource.protocol.replace(/:$/, "")
|
|
33
|
+
}
|
|
34
|
+
}, async (span) => {
|
|
35
|
+
try {
|
|
36
|
+
const result = await lookupWebFingerInternal(resource, options);
|
|
37
|
+
span.setStatus({ code: result === null ? SpanStatusCode.ERROR : SpanStatusCode.OK });
|
|
38
|
+
return result;
|
|
39
|
+
} catch (error) {
|
|
40
|
+
span.setStatus({
|
|
41
|
+
code: SpanStatusCode.ERROR,
|
|
42
|
+
message: String(error)
|
|
43
|
+
});
|
|
44
|
+
throw error;
|
|
45
|
+
} finally {
|
|
46
|
+
span.end();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async function lookupWebFingerInternal(resource, options = {}) {
|
|
51
|
+
if (typeof resource === "string") resource = new URL(resource);
|
|
52
|
+
let protocol = "https:";
|
|
53
|
+
let server;
|
|
54
|
+
if (resource.protocol === "acct:") {
|
|
55
|
+
const atPos = resource.pathname.lastIndexOf("@");
|
|
56
|
+
if (atPos < 0) return null;
|
|
57
|
+
server = resource.pathname.substring(atPos + 1);
|
|
58
|
+
if (server === "") return null;
|
|
59
|
+
} else {
|
|
60
|
+
protocol = resource.protocol;
|
|
61
|
+
server = resource.host;
|
|
62
|
+
}
|
|
63
|
+
let url = new URL(`${protocol}//${server}/.well-known/webfinger`);
|
|
64
|
+
url.searchParams.set("resource", resource.href);
|
|
65
|
+
let redirected = 0;
|
|
66
|
+
while (true) {
|
|
67
|
+
logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
|
|
68
|
+
let response;
|
|
69
|
+
if (options.allowPrivateAddress !== true) try {
|
|
70
|
+
await validatePublicUrl(url.href);
|
|
71
|
+
} catch (e) {
|
|
72
|
+
if (e instanceof UrlError) {
|
|
73
|
+
logger.error("Invalid URL for WebFinger resource descriptor: {error}", { error: e });
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
throw e;
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
response = await fetch(url, {
|
|
80
|
+
headers: {
|
|
81
|
+
Accept: "application/jrd+json",
|
|
82
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent)
|
|
83
|
+
},
|
|
84
|
+
redirect: "manual"
|
|
85
|
+
});
|
|
86
|
+
} catch (error) {
|
|
87
|
+
logger.debug("Failed to fetch WebFinger resource descriptor: {error}", {
|
|
88
|
+
url: url.href,
|
|
89
|
+
error
|
|
90
|
+
});
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
94
|
+
redirected++;
|
|
95
|
+
const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
|
|
96
|
+
if (redirected >= maxRedirection) {
|
|
97
|
+
logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const redirectedUrl = new URL(response.headers.get("Location"), response.url == null || response.url === "" ? url : response.url);
|
|
101
|
+
if (redirectedUrl.protocol !== url.protocol) {
|
|
102
|
+
logger.error("Redirected to a different protocol ({protocol} to {redirectedProtocol}) while fetching WebFinger resource descriptor.", {
|
|
103
|
+
protocol: url.protocol,
|
|
104
|
+
redirectedProtocol: redirectedUrl.protocol
|
|
105
|
+
});
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
url = redirectedUrl;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (!response.ok) {
|
|
112
|
+
logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
|
|
113
|
+
url: url.href,
|
|
114
|
+
status: response.status,
|
|
115
|
+
statusText: response.statusText
|
|
116
|
+
});
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
return await response.json();
|
|
121
|
+
} catch (e) {
|
|
122
|
+
if (e instanceof SyntaxError) {
|
|
123
|
+
logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
throw e;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
export { lookupWebFinger };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
|
-
import { UrlError, deno_default, getUserAgent, validatePublicUrl } from "./docloader-
|
|
5
|
+
import { UrlError, deno_default, getUserAgent, validatePublicUrl } from "./docloader-B8jv3Z2V.js";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
|
|
@@ -3,121 +3,14 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { deno_default, getDocumentLoader } from "./docloader-xLomwjk3.js";
|
|
7
|
+
import { Object as Object$1 } from "./vocab-Db0G5VQ2.js";
|
|
8
|
+
import { lookupWebFinger } from "./lookup-BhK5FmDe.js";
|
|
9
|
+
import { getTypeId } from "./type-D2s5lmbZ.js";
|
|
10
|
+
import { delay } from "es-toolkit";
|
|
8
11
|
import { getLogger } from "@logtape/logtape";
|
|
9
12
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
|
-
import { Router } from "uri-template-router";
|
|
11
|
-
import { parseTemplate } from "url-template";
|
|
12
13
|
|
|
13
|
-
//#region federation/router.ts
|
|
14
|
-
function cloneInnerRouter(router) {
|
|
15
|
-
const clone = new Router();
|
|
16
|
-
clone.nid = router.nid;
|
|
17
|
-
clone.fsm = cloneDeep(router.fsm);
|
|
18
|
-
clone.routeSet = new Set(router.routeSet);
|
|
19
|
-
clone.templateRouteMap = new Map(router.templateRouteMap);
|
|
20
|
-
clone.valueRouteMap = new Map(router.valueRouteMap);
|
|
21
|
-
clone.hierarchy = cloneDeep(router.hierarchy);
|
|
22
|
-
return clone;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* URL router and constructor based on URI Template
|
|
26
|
-
* ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
|
|
27
|
-
*/
|
|
28
|
-
var Router$1 = class Router$1 {
|
|
29
|
-
#router;
|
|
30
|
-
#templates;
|
|
31
|
-
#templateStrings;
|
|
32
|
-
/**
|
|
33
|
-
* Whether to ignore trailing slashes when matching paths.
|
|
34
|
-
* @since 1.6.0
|
|
35
|
-
*/
|
|
36
|
-
trailingSlashInsensitive;
|
|
37
|
-
/**
|
|
38
|
-
* Create a new {@link Router}.
|
|
39
|
-
* @param options Options for the router.
|
|
40
|
-
*/
|
|
41
|
-
constructor(options = {}) {
|
|
42
|
-
this.#router = new Router();
|
|
43
|
-
this.#templates = {};
|
|
44
|
-
this.#templateStrings = {};
|
|
45
|
-
this.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
|
|
46
|
-
}
|
|
47
|
-
clone() {
|
|
48
|
-
const clone = new Router$1({ trailingSlashInsensitive: this.trailingSlashInsensitive });
|
|
49
|
-
clone.#router = cloneInnerRouter(this.#router);
|
|
50
|
-
clone.#templates = { ...this.#templates };
|
|
51
|
-
clone.#templateStrings = { ...this.#templateStrings };
|
|
52
|
-
return clone;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Checks if a path name exists in the router.
|
|
56
|
-
* @param name The name of the path.
|
|
57
|
-
* @returns `true` if the path name exists, otherwise `false`.
|
|
58
|
-
*/
|
|
59
|
-
has(name) {
|
|
60
|
-
return name in this.#templates;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Adds a new path rule to the router.
|
|
64
|
-
* @param template The path pattern.
|
|
65
|
-
* @param name The name of the path.
|
|
66
|
-
* @returns The names of the variables in the path pattern.
|
|
67
|
-
*/
|
|
68
|
-
add(template, name) {
|
|
69
|
-
if (!template.startsWith("/")) throw new RouterError("Path must start with a slash.");
|
|
70
|
-
const rule = this.#router.addTemplate(template, {}, name);
|
|
71
|
-
this.#templates[name] = parseTemplate(template);
|
|
72
|
-
this.#templateStrings[name] = template;
|
|
73
|
-
return new Set(rule.variables.map((v) => v.varname));
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Resolves a path name and values from a URL, if any match.
|
|
77
|
-
* @param url The URL to resolve.
|
|
78
|
-
* @returns The name of the path and its values, if any match. Otherwise,
|
|
79
|
-
* `null`.
|
|
80
|
-
*/
|
|
81
|
-
route(url) {
|
|
82
|
-
let match = this.#router.resolveURI(url);
|
|
83
|
-
if (match == null) {
|
|
84
|
-
if (!this.trailingSlashInsensitive) return null;
|
|
85
|
-
url = url.endsWith("/") ? url.replace(/\/+$/, "") : `${url}/`;
|
|
86
|
-
match = this.#router.resolveURI(url);
|
|
87
|
-
if (match == null) return null;
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
name: match.matchValue,
|
|
91
|
-
template: this.#templateStrings[match.matchValue],
|
|
92
|
-
values: match.params
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Constructs a URL/path from a path name and values.
|
|
97
|
-
* @param name The name of the path.
|
|
98
|
-
* @param values The values to expand the path with.
|
|
99
|
-
* @returns The URL/path, if the name exists. Otherwise, `null`.
|
|
100
|
-
*/
|
|
101
|
-
build(name, values) {
|
|
102
|
-
if (name in this.#templates) return this.#templates[name].expand(values);
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* An error thrown by the {@link Router}.
|
|
108
|
-
*/
|
|
109
|
-
var RouterError = class extends Error {
|
|
110
|
-
/**
|
|
111
|
-
* Create a new {@link RouterError}.
|
|
112
|
-
* @param message The error message.
|
|
113
|
-
*/
|
|
114
|
-
constructor(message) {
|
|
115
|
-
super(message);
|
|
116
|
-
this.name = "RouterError";
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
//#endregion
|
|
121
14
|
//#region vocab/handle.ts
|
|
122
15
|
/**
|
|
123
16
|
* Regular expression to match a fediverse handle in the format `@user@server`
|
|
@@ -318,4 +211,4 @@ async function* traverseCollection(collection, options = {}) {
|
|
|
318
211
|
}
|
|
319
212
|
|
|
320
213
|
//#endregion
|
|
321
|
-
export {
|
|
214
|
+
export { lookupObject, traverseCollection };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
|
|
5
|
+
import "./transformers-ghwJuzGY.js";
|
|
6
|
+
import "./docloader-B8jv3Z2V.js";
|
|
7
|
+
import "./actor-DOUbHIhg.js";
|
|
8
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-vpRI19Dq.js";
|
|
9
|
+
import "./lookup-ByMEYudm.js";
|
|
10
|
+
import "./key-BAIJJ5gY.js";
|
|
11
|
+
import "./http-DLoFeou5.js";
|
|
12
|
+
import "./proof-BSG6S-sj.js";
|
|
13
|
+
import "./types-9rwT068o.js";
|
|
14
|
+
import "./authdocloader-CMmTK9S5.js";
|
|
15
|
+
import "./vocab-iY_A93sn.js";
|
|
16
|
+
|
|
17
|
+
export { FederationImpl };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
+
globalThis.addEventListener = () => {};
|
|
5
|
+
|
|
6
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Dbj6Ns6x.js";
|
|
7
|
+
import "./docloader-xLomwjk3.js";
|
|
8
|
+
import "./url-kTAI6_KP.js";
|
|
9
|
+
import "./semver-DWClQt_5.js";
|
|
10
|
+
import "./client-CYFhpq6p.js";
|
|
11
|
+
import "./router-D3UybECj.js";
|
|
12
|
+
import "./types-C7C_l-jz.js";
|
|
13
|
+
import "./multibase-DeCHcK8L.js";
|
|
14
|
+
import "./vocab-Db0G5VQ2.js";
|
|
15
|
+
import "./langstr-DbWheeIS.js";
|
|
16
|
+
import "./lookup-BhK5FmDe.js";
|
|
17
|
+
import "./type-D2s5lmbZ.js";
|
|
18
|
+
import "./actor-CiCVXwx3.js";
|
|
19
|
+
import "./key-DbuLgndY.js";
|
|
20
|
+
import "./http-6MXyLsoh.js";
|
|
21
|
+
import "./authdocloader-CrpSsLr1.js";
|
|
22
|
+
import "./ld-WpKwgDtk.js";
|
|
23
|
+
import "./owner-jodbuyfr.js";
|
|
24
|
+
import "./proof-DZrqpsSm.js";
|
|
25
|
+
import "./lookup-DMKWAbKW.js";
|
|
26
|
+
import "./inbox-K6Jqy_1j.js";
|
|
27
|
+
import "./builder-DFk9FOJ6.js";
|
|
28
|
+
import "./collection-Dfb0TPno.js";
|
|
29
|
+
import "./keycache-D2ce3zUW.js";
|
|
30
|
+
import "./retry-BiIhZWgD.js";
|
|
31
|
+
import "./send-CNN4e6xr.js";
|
|
32
|
+
|
|
33
|
+
export { FederationImpl };
|
|
@@ -3,22 +3,26 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { getNodeInfo } from "./client-
|
|
8
|
-
import { RouterError
|
|
9
|
-
import { nodeInfoToJson } from "./types-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
6
|
+
import { deno_default, getDocumentLoader, kvCache } from "./docloader-xLomwjk3.js";
|
|
7
|
+
import { getNodeInfo } from "./client-CYFhpq6p.js";
|
|
8
|
+
import { RouterError } from "./router-D3UybECj.js";
|
|
9
|
+
import { nodeInfoToJson } from "./types-C7C_l-jz.js";
|
|
10
|
+
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage } from "./vocab-Db0G5VQ2.js";
|
|
11
|
+
import { lookupWebFinger } from "./lookup-BhK5FmDe.js";
|
|
12
|
+
import { getTypeId } from "./type-D2s5lmbZ.js";
|
|
13
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-DbuLgndY.js";
|
|
14
|
+
import { verifyRequest } from "./http-6MXyLsoh.js";
|
|
15
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-CrpSsLr1.js";
|
|
16
|
+
import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-WpKwgDtk.js";
|
|
17
|
+
import { doesActorOwnKey, getKeyOwner } from "./owner-jodbuyfr.js";
|
|
18
|
+
import { signObject, verifyObject } from "./proof-DZrqpsSm.js";
|
|
19
|
+
import { lookupObject, traverseCollection } from "./lookup-DMKWAbKW.js";
|
|
20
|
+
import { routeActivity } from "./inbox-K6Jqy_1j.js";
|
|
21
|
+
import { FederationBuilderImpl } from "./builder-DFk9FOJ6.js";
|
|
22
|
+
import { buildCollectionSynchronizationHeader } from "./collection-Dfb0TPno.js";
|
|
23
|
+
import { KvKeyCache } from "./keycache-D2ce3zUW.js";
|
|
24
|
+
import { createExponentialBackoffPolicy } from "./retry-BiIhZWgD.js";
|
|
25
|
+
import { extractInboxes, sendActivity } from "./send-CNN4e6xr.js";
|
|
22
26
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
23
27
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
24
28
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
@@ -2371,7 +2375,7 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
2371
2375
|
#invokedFromActorDispatcher;
|
|
2372
2376
|
#invokedFromObjectDispatcher;
|
|
2373
2377
|
request;
|
|
2374
|
-
url
|
|
2378
|
+
url;
|
|
2375
2379
|
constructor(options) {
|
|
2376
2380
|
super(options);
|
|
2377
2381
|
this.#invokedFromActorDispatcher = options.invokedFromActorDispatcher;
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import { getDefaultActivityTransformers } from "./transformers-ghwJuzGY.js";
|
|
6
|
-
import { deno_default, getDocumentLoader, kvCache } from "./docloader-
|
|
7
|
-
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-
|
|
8
|
-
import { lookupWebFinger } from "./lookup-
|
|
9
|
-
import { exportJwk, importJwk, validateCryptoKey } from "./key-
|
|
10
|
-
import { doubleKnock, verifyRequest } from "./http-
|
|
11
|
-
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-
|
|
12
|
-
import { getNodeInfo, nodeInfoToJson } from "./types-
|
|
13
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
14
|
-
import { lookupObject, traverseCollection } from "./vocab-
|
|
6
|
+
import { deno_default, getDocumentLoader, kvCache } from "./docloader-B8jv3Z2V.js";
|
|
7
|
+
import { Activity, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-DOUbHIhg.js";
|
|
8
|
+
import { lookupWebFinger } from "./lookup-ByMEYudm.js";
|
|
9
|
+
import { exportJwk, importJwk, validateCryptoKey } from "./key-BAIJJ5gY.js";
|
|
10
|
+
import { doubleKnock, verifyRequest } from "./http-DLoFeou5.js";
|
|
11
|
+
import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-BSG6S-sj.js";
|
|
12
|
+
import { getNodeInfo, nodeInfoToJson } from "./types-9rwT068o.js";
|
|
13
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-CMmTK9S5.js";
|
|
14
|
+
import { lookupObject, traverseCollection } from "./vocab-iY_A93sn.js";
|
|
15
15
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
16
16
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
17
17
|
import { encodeHex } from "byte-encodings/hex";
|
|
@@ -312,7 +312,7 @@ var FederationBuilderImpl = class {
|
|
|
312
312
|
this.objectTypeIds = {};
|
|
313
313
|
}
|
|
314
314
|
async build(options) {
|
|
315
|
-
const { FederationImpl: FederationImpl$1 } = await import("./middleware-
|
|
315
|
+
const { FederationImpl: FederationImpl$1 } = await import("./middleware-B-tW_fwo.js");
|
|
316
316
|
const f = new FederationImpl$1(options);
|
|
317
317
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
318
318
|
f.router = this.router.clone();
|
|
@@ -3240,7 +3240,7 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
3240
3240
|
#invokedFromActorDispatcher;
|
|
3241
3241
|
#invokedFromObjectDispatcher;
|
|
3242
3242
|
request;
|
|
3243
|
-
url
|
|
3243
|
+
url;
|
|
3244
3244
|
constructor(options) {
|
|
3245
3245
|
super(options);
|
|
3246
3246
|
this.#invokedFromActorDispatcher = options.invokedFromActorDispatcher;
|
package/dist/mod.js
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-ghwJuzGY.js";
|
|
6
6
|
import "./compat-Bb5myD13.js";
|
|
7
|
-
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-
|
|
8
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-
|
|
9
|
-
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-
|
|
10
|
-
import { lookupWebFinger } from "./lookup-
|
|
11
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-
|
|
12
|
-
import { signRequest, verifyRequest } from "./http-
|
|
13
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-
|
|
7
|
+
import { FetchError, fetchDocumentLoader, getDocumentLoader, getUserAgent, kvCache } from "./docloader-B8jv3Z2V.js";
|
|
8
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, exportMultibaseKey, exportSpki, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, importMultibaseKey, importPem, importPkcs1, importSpki, isActor, normalizeActorHandle } from "./actor-DOUbHIhg.js";
|
|
9
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-vpRI19Dq.js";
|
|
10
|
+
import { lookupWebFinger } from "./lookup-ByMEYudm.js";
|
|
11
|
+
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "./key-BAIJJ5gY.js";
|
|
12
|
+
import { signRequest, verifyRequest } from "./http-DLoFeou5.js";
|
|
13
|
+
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-BSG6S-sj.js";
|
|
14
14
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-C44ekWNP.js";
|
|
15
|
-
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-
|
|
16
|
-
import { getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
17
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-
|
|
15
|
+
import { formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer } from "./types-9rwT068o.js";
|
|
16
|
+
import { getAuthenticatedDocumentLoader } from "./authdocloader-CMmTK9S5.js";
|
|
17
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "./vocab-iY_A93sn.js";
|
|
18
18
|
import "./nodeinfo-CyEbLjHs.js";
|
|
19
19
|
import "./runtime-BSkOVUWM.js";
|
|
20
20
|
import "./sig-BXJO--F9.js";
|