@fedify/fedify 2.0.0-pr.451.1731 → 2.0.0-pr.451.1735

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.
Files changed (162) hide show
  1. package/dist/{actor-GwnlqPRv.js → actor-BlCt_BFA.js} +1 -1
  2. package/dist/{actor-Cd2CREO0.d.ts → actor-DqFajh9s.d.ts} +2 -2
  3. package/dist/{actor-Ci-5y3ml.cjs → actor-SSKGPs2C.cjs} +186 -187
  4. package/dist/{actor-DDhZuMGl.d.cts → actor-f2NtjyCg.d.cts} +2 -2
  5. package/dist/{actor-CRQwUlsr.js → actor-qRieKMCS.js} +185 -186
  6. package/dist/{builder-BflZmL4k.js → builder-Daev8Oe3.js} +3 -3
  7. package/dist/{client-Cle5j1T1.d.cts → client-94iWEfQa.d.cts} +1 -1
  8. package/dist/{client-Bkaw0_PR.d.ts → client-BsGzbnV-.d.ts} +1 -1
  9. package/dist/{client-DylapB-t.js → client-pY7-3icS.js} +1 -1
  10. package/dist/compat/mod.d.cts +11 -12
  11. package/dist/compat/mod.d.ts +11 -12
  12. package/dist/compat/transformers.test.js +16 -16
  13. package/dist/{context-BOYzcFSe.d.cts → context-BvYz3eOb.d.cts} +11 -11
  14. package/dist/{context-DqFifMwj.d.ts → context-myrGWbL_.d.ts} +11 -11
  15. package/dist/{docloader-BpcE9hBI.js → docloader-CuY-IQHN.js} +4 -5
  16. package/dist/{esm-DjbC-dsH.js → esm-CO0P-prF.js} +1 -1
  17. package/dist/federation/builder.test.js +4 -4
  18. package/dist/federation/collection.test.js +2 -2
  19. package/dist/federation/handler.test.js +17 -17
  20. package/dist/federation/idempotency.test.js +17 -17
  21. package/dist/federation/inbox.test.js +3 -3
  22. package/dist/federation/keycache.test.js +3 -3
  23. package/dist/federation/kv.test.js +2 -2
  24. package/dist/federation/middleware.test.js +18 -18
  25. package/dist/federation/mod.cjs +9 -10
  26. package/dist/federation/mod.d.cts +11 -12
  27. package/dist/federation/mod.d.ts +11 -12
  28. package/dist/federation/mod.js +9 -10
  29. package/dist/federation/mq.test.js +2 -2
  30. package/dist/federation/negotiation.test.js +2 -2
  31. package/dist/federation/retry.test.js +2 -2
  32. package/dist/federation/router.test.js +2 -2
  33. package/dist/federation/send.test.js +9 -9
  34. package/dist/{http-CCUJdi0H.js → http--W_KqmV8.js} +2 -2
  35. package/dist/{http-BE7aFuqn.d.ts → http-BbO0ejuk.d.ts} +1 -1
  36. package/dist/{http-DtUGyvkU.cjs → http-CZRSpr-0.cjs} +5 -5
  37. package/dist/{http-B6SKO6NJ.d.cts → http-M8k5mKc0.d.cts} +1 -1
  38. package/dist/{http-BzsavjR2.js → http-cj5p1nm9.js} +2 -2
  39. package/dist/{inbox-DizLjfhC.js → inbox-DCOu4Fxg.js} +1 -1
  40. package/dist/{key-De1MJH3k.js → key-CLBIsQ2b.js} +2 -2
  41. package/dist/{keycache-D2HiBv4F.js → keycache-C_E92fAZ.js} +1 -1
  42. package/dist/{keys-B4ZjS1Ot.js → keys-CESa8pOV.js} +1 -1
  43. package/dist/kv-cache-6gn8hq87.cjs +133 -0
  44. package/dist/kv-cache-D6OS46Qp.js +121 -0
  45. package/dist/kv-cache-z0lgwFi_.js +93 -0
  46. package/dist/{ld-Dux3_Cw2.js → ld-uohK5TcN.js} +2 -2
  47. package/dist/{lookup-Bql--V-C.js → lookup-B4NiLSoR.js} +129 -60
  48. package/dist/{lookup-Bep-EOgr.js → lookup-Bp3gBRGD.js} +188 -297
  49. package/dist/lookup-CfVdYD74.cjs +273 -0
  50. package/dist/{middleware-DrpnHeGO.cjs → middleware-B5t3REnT.cjs} +18 -19
  51. package/dist/middleware-B86mRO81.cjs +15 -0
  52. package/dist/{middleware-BBTmHKGh.js → middleware-BEWbWO0t.js} +8 -9
  53. package/dist/middleware-BzGmhttT.js +26 -0
  54. package/dist/middleware-DxFOBA0V.js +15 -0
  55. package/dist/{middleware-D7tP9Tq6.js → middleware-yd4xq6Dt.js} +13 -13
  56. package/dist/{mod-DLIidI_j.d.ts → mod-B2iOw50L.d.ts} +2 -2
  57. package/dist/{mod-Cm97bAiT.d.ts → mod-BYynOiJG.d.ts} +2 -2
  58. package/dist/{mod-CRENK2dd.d.ts → mod-BlVovdcy.d.ts} +2 -3
  59. package/dist/{mod--K7l84wp.d.cts → mod-BxRCHTz-.d.cts} +2 -3
  60. package/dist/{mod-DuclhZjh.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
  61. package/dist/{mod-D9XZsft2.d.cts → mod-DbFNTF7m.d.cts} +2 -2
  62. package/dist/{mod-COlOrmr9.d.cts → mod-DgdBYYa0.d.cts} +2 -2
  63. package/dist/{mod-CB80AlIA.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
  64. package/dist/{mod-CLKu6Uo_.d.cts → mod-VastcQsk.d.cts} +2 -2
  65. package/dist/{mod-CaWbCg0N.d.ts → mod-k0Dk3fGk.d.ts} +2 -2
  66. package/dist/mod.cjs +13 -15
  67. package/dist/mod.d.cts +15 -16
  68. package/dist/mod.d.ts +16 -17
  69. package/dist/mod.js +14 -15
  70. package/dist/nodeinfo/client.test.js +4 -4
  71. package/dist/nodeinfo/handler.test.js +16 -16
  72. package/dist/nodeinfo/mod.cjs +2 -3
  73. package/dist/nodeinfo/mod.d.cts +2 -3
  74. package/dist/nodeinfo/mod.d.ts +2 -3
  75. package/dist/nodeinfo/mod.js +2 -3
  76. package/dist/nodeinfo/types.test.js +2 -2
  77. package/dist/{owner-dkg5OpSC.d.cts → owner-B4HbyP8s.d.cts} +2 -2
  78. package/dist/{owner-Zq8du9WO.js → owner-DMwt6EnB.js} +2 -2
  79. package/dist/{owner-CktUdA0h.d.ts → owner-kQRGVXG1.d.ts} +2 -2
  80. package/dist/{proof-aIlK5BTc.js → proof-BRMzWGtg.js} +3 -3
  81. package/dist/{proof-0PY1LDZY.cjs → proof-DVvnQ6WP.cjs} +7 -7
  82. package/dist/{proof-C5S_3hdJ.js → proof-X6v_1MA6.js} +2 -2
  83. package/dist/{send-BbVnlsQO.js → send-Cy3TUzxE.js} +2 -2
  84. package/dist/sig/http.test.js +7 -7
  85. package/dist/sig/key.test.js +5 -5
  86. package/dist/sig/ld.test.js +6 -6
  87. package/dist/sig/mod.cjs +5 -6
  88. package/dist/sig/mod.d.cts +5 -6
  89. package/dist/sig/mod.d.ts +5 -6
  90. package/dist/sig/mod.js +5 -6
  91. package/dist/sig/owner.test.js +6 -6
  92. package/dist/sig/proof.test.js +6 -6
  93. package/dist/testing/docloader.test.js +2 -2
  94. package/dist/testing/mod.d.ts +1 -27
  95. package/dist/testing/mod.js +2 -2
  96. package/dist/{testing-BkidWE0N.js → testing-BJJvJvZe.js} +1 -1
  97. package/dist/{types-CXnyjUdK.js → types-BtUjyi5y.js} +1 -1
  98. package/dist/{types-BDNYgodm.cjs → types-CWgzGaqk.cjs} +3 -3
  99. package/dist/utils/docloader.test.js +9 -8
  100. package/dist/utils/kv-cache.test.js +4 -3
  101. package/dist/utils/mod.cjs +5 -7
  102. package/dist/utils/mod.d.cts +5 -6
  103. package/dist/utils/mod.d.ts +5 -6
  104. package/dist/utils/mod.js +6 -7
  105. package/dist/vocab/actor.test.js +4 -4
  106. package/dist/vocab/lookup.test.js +3 -3
  107. package/dist/vocab/mod.cjs +3 -4
  108. package/dist/vocab/mod.d.cts +3 -4
  109. package/dist/vocab/mod.d.ts +3 -4
  110. package/dist/vocab/mod.js +3 -4
  111. package/dist/vocab/type.test.js +2 -2
  112. package/dist/vocab/vocab.test.js +3 -3
  113. package/dist/{vocab-Dapemq3v.cjs → vocab-BPtsEU8k.cjs} +3 -4
  114. package/dist/{vocab-BiKK7m2H.js → vocab-DFaqbY9O.js} +2 -3
  115. package/dist/webfinger/handler.test.js +16 -16
  116. package/dist/webfinger/lookup.test.js +3 -3
  117. package/dist/webfinger/mod.cjs +2 -3
  118. package/dist/webfinger/mod.d.cts +1 -2
  119. package/dist/webfinger/mod.d.ts +1 -2
  120. package/dist/webfinger/mod.js +2 -3
  121. package/dist/x/cfworkers.d.cts +2 -2
  122. package/dist/x/cfworkers.d.ts +2 -2
  123. package/dist/x/cfworkers.test.js +2 -2
  124. package/dist/x/hono.d.cts +10 -11
  125. package/dist/x/hono.d.ts +10 -11
  126. package/dist/x/sveltekit.d.cts +10 -11
  127. package/dist/x/sveltekit.d.ts +10 -11
  128. package/package.json +2 -3
  129. package/dist/kv-cache-3VK2-wq_.cjs +0 -4279
  130. package/dist/kv-cache-DNvS-egZ.js +0 -4236
  131. package/dist/kv-cache-rR-Cnl95.js +0 -4267
  132. package/dist/lookup-BmGuy-Ps.cjs +0 -210
  133. package/dist/middleware-BUZSGsQH.js +0 -16
  134. package/dist/middleware-BusTq7Js.cjs +0 -16
  135. package/dist/middleware-tZdLtCWz.js +0 -26
  136. package/dist/request-BbHkedIU.d.cts +0 -35
  137. package/dist/request-Bc5CHBqO.cjs +0 -208
  138. package/dist/request-C0Ags1gQ.js +0 -184
  139. package/dist/request-U1t6zZtk.d.ts +0 -39
  140. package/dist/utils/request.test.d.ts +0 -3
  141. package/dist/utils/request.test.js +0 -48
  142. package/dist/utils/url.test.d.ts +0 -3
  143. package/dist/utils/url.test.js +0 -41
  144. /package/dist/{federation-DOuZpcAw.cjs → federation-CRpdnOMS.cjs} +0 -0
  145. /package/dist/{federation-pZJsapBn.js → federation-jcR8-ZxP.js} +0 -0
  146. /package/dist/{kv-Dt06smFt.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
  147. /package/dist/{kv-BMKIFXNW.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
  148. /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
  149. /package/dist/{mod-B-ZQqbGe.d.ts → mod-CVgZgliM.d.ts} +0 -0
  150. /package/dist/{mod-CjsiSl7_.d.ts → mod-xIj-IT58.d.ts} +0 -0
  151. /package/dist/{mq-CPRJk4mZ.d.ts → mq-CUKlBw08.d.ts} +0 -0
  152. /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
  153. /package/dist/{nodeinfo-B0UefMXO.js → nodeinfo-BnthBobC.js} +0 -0
  154. /package/dist/{nodeinfo-ByTd7HpT.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
  155. /package/dist/{sig-Dx59zAgn.js → sig-C34-oHBl.js} +0 -0
  156. /package/dist/{sig-DE_NC_VQ.cjs → sig-YYj5tCnr.cjs} +0 -0
  157. /package/dist/{utils-BXMGcmqK.js → utils-D-Va7aXC.js} +0 -0
  158. /package/dist/{utils-B6yXfxAQ.cjs → utils-DyRU1gdZ.cjs} +0 -0
  159. /package/dist/{vocab-ivDKb439.d.ts → vocab-BCWe1Ih5.d.ts} +0 -0
  160. /package/dist/{vocab-DCBw44JZ.d.cts → vocab-CeDBzu-f.d.cts} +0 -0
  161. /package/dist/{webfinger-qG8R5jc3.js → webfinger-C72Y8lrh.js} +0 -0
  162. /package/dist/{webfinger-C949bxcD.cjs → webfinger-vAtLmxOF.cjs} +0 -0
@@ -1,210 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
- const require_request = require('./request-Bc5CHBqO.cjs');
7
- const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
8
- const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
9
- const node_dns_promises = require_chunk.__toESM(require("node:dns/promises"));
10
- const node_net = require_chunk.__toESM(require("node:net"));
11
-
12
- //#region src/utils/url.ts
13
- var UrlError = class extends Error {
14
- constructor(message) {
15
- super(message);
16
- this.name = "UrlError";
17
- }
18
- };
19
- /**
20
- * Validates a URL to prevent SSRF attacks.
21
- */
22
- async function validatePublicUrl(url) {
23
- const parsed = new URL(url);
24
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new UrlError(`Unsupported protocol: ${parsed.protocol}`);
25
- let hostname = parsed.hostname;
26
- if (hostname.startsWith("[") && hostname.endsWith("]")) hostname = hostname.substring(1, hostname.length - 2);
27
- if (hostname === "localhost") throw new UrlError("Localhost is not allowed");
28
- if ("Deno" in globalThis && !(0, node_net.isIP)(hostname)) {
29
- const netPermission = await Deno.permissions.query({ name: "net" });
30
- if (netPermission.state !== "granted") return;
31
- }
32
- if ("Bun" in globalThis) {
33
- if (hostname === "example.com" || hostname.endsWith(".example.com")) return;
34
- else if (hostname === "fedify-test.internal") throw new UrlError("Invalid or private address: fedify-test.internal");
35
- }
36
- let addresses;
37
- try {
38
- addresses = await (0, node_dns_promises.lookup)(hostname, { all: true });
39
- } catch {
40
- addresses = [];
41
- }
42
- for (const { address, family } of addresses) if (family === 4 && !isValidPublicIPv4Address(address) || family === 6 && !isValidPublicIPv6Address(address) || family < 4 || family === 5 || family > 6) throw new UrlError(`Invalid or private address: ${address}`);
43
- }
44
- function isValidPublicIPv4Address(address) {
45
- const parts = address.split(".");
46
- const first = parseInt(parts[0]);
47
- if (first === 0 || first === 10 || first === 127) return false;
48
- const second = parseInt(parts[1]);
49
- if (first === 169 && second === 254) return false;
50
- if (first === 172 && second >= 16 && second <= 31) return false;
51
- if (first === 192 && second === 168) return false;
52
- return true;
53
- }
54
- function isValidPublicIPv6Address(address) {
55
- address = expandIPv6Address(address);
56
- if (address.at(4) !== ":") return false;
57
- const firstWord = parseInt(address.substring(0, 4), 16);
58
- return !(firstWord >= 64512 && firstWord <= 65023 || firstWord >= 65152 && firstWord <= 65215 || firstWord === 0 || firstWord >= 65280);
59
- }
60
- function expandIPv6Address(address) {
61
- address = address.toLowerCase();
62
- if (address === "::") return "0000:0000:0000:0000:0000:0000:0000:0000";
63
- if (address.startsWith("::")) address = "0000" + address;
64
- if (address.endsWith("::")) address = address + "0000";
65
- address = address.replace("::", ":0000".repeat(8 - (address.match(/:/g) || []).length) + ":");
66
- const parts = address.split(":");
67
- return parts.map((part) => part.padStart(4, "0")).join(":");
68
- }
69
-
70
- //#endregion
71
- //#region src/webfinger/lookup.ts
72
- const logger = (0, __logtape_logtape.getLogger)([
73
- "fedify",
74
- "webfinger",
75
- "lookup"
76
- ]);
77
- const DEFAULT_MAX_REDIRECTION = 5;
78
- /**
79
- * Looks up a WebFinger resource.
80
- * @param resource The resource URL to look up.
81
- * @param options Extra options for looking up the resource.
82
- * @returns The resource descriptor, or `null` if not found.
83
- * @since 0.2.0
84
- */
85
- async function lookupWebFinger(resource, options = {}) {
86
- const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
87
- const tracer = tracerProvider.getTracer(require_request.deno_default.name, require_request.deno_default.version);
88
- return await tracer.startActiveSpan("webfinger.lookup", {
89
- kind: __opentelemetry_api.SpanKind.CLIENT,
90
- attributes: {
91
- "webfinger.resource": resource.toString(),
92
- "webfinger.resource.scheme": typeof resource === "string" ? resource.replace(/:.*$/, "") : resource.protocol.replace(/:$/, "")
93
- }
94
- }, async (span) => {
95
- try {
96
- const result = await lookupWebFingerInternal(resource, options);
97
- span.setStatus({ code: result === null ? __opentelemetry_api.SpanStatusCode.ERROR : __opentelemetry_api.SpanStatusCode.OK });
98
- return result;
99
- } catch (error) {
100
- span.setStatus({
101
- code: __opentelemetry_api.SpanStatusCode.ERROR,
102
- message: String(error)
103
- });
104
- throw error;
105
- } finally {
106
- span.end();
107
- }
108
- });
109
- }
110
- async function lookupWebFingerInternal(resource, options = {}) {
111
- if (typeof resource === "string") resource = new URL(resource);
112
- let protocol = "https:";
113
- let server;
114
- if (resource.protocol === "acct:") {
115
- const atPos = resource.pathname.lastIndexOf("@");
116
- if (atPos < 0) return null;
117
- server = resource.pathname.substring(atPos + 1);
118
- if (server === "") return null;
119
- } else {
120
- protocol = resource.protocol;
121
- server = resource.host;
122
- }
123
- let url = new URL(`${protocol}//${server}/.well-known/webfinger`);
124
- url.searchParams.set("resource", resource.href);
125
- let redirected = 0;
126
- while (true) {
127
- logger.debug("Fetching WebFinger resource descriptor from {url}...", { url: url.href });
128
- let response;
129
- if (options.allowPrivateAddress !== true) try {
130
- await validatePublicUrl(url.href);
131
- } catch (e) {
132
- if (e instanceof UrlError) {
133
- logger.error("Invalid URL for WebFinger resource descriptor: {error}", { error: e });
134
- return null;
135
- }
136
- throw e;
137
- }
138
- try {
139
- response = await fetch(url, {
140
- headers: {
141
- Accept: "application/jrd+json",
142
- "User-Agent": typeof options.userAgent === "string" ? options.userAgent : require_request.getUserAgent(options.userAgent)
143
- },
144
- redirect: "manual",
145
- signal: options.signal
146
- });
147
- } catch (error) {
148
- logger.debug("Failed to fetch WebFinger resource descriptor: {error}", {
149
- url: url.href,
150
- error
151
- });
152
- return null;
153
- }
154
- if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
155
- redirected++;
156
- const maxRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
157
- if (redirected >= maxRedirection) {
158
- logger.error("Too many redirections ({redirections}) while fetching WebFinger resource descriptor.", { redirections: redirected });
159
- return null;
160
- }
161
- const redirectedUrl = new URL(response.headers.get("Location"), response.url == null || response.url === "" ? url : response.url);
162
- if (redirectedUrl.protocol !== url.protocol) {
163
- logger.error("Redirected to a different protocol ({protocol} to {redirectedProtocol}) while fetching WebFinger resource descriptor.", {
164
- protocol: url.protocol,
165
- redirectedProtocol: redirectedUrl.protocol
166
- });
167
- return null;
168
- }
169
- url = redirectedUrl;
170
- continue;
171
- }
172
- if (!response.ok) {
173
- logger.debug("Failed to fetch WebFinger resource descriptor: {status} {statusText}.", {
174
- url: url.href,
175
- status: response.status,
176
- statusText: response.statusText
177
- });
178
- return null;
179
- }
180
- try {
181
- return await response.json();
182
- } catch (e) {
183
- if (e instanceof SyntaxError) {
184
- logger.debug("Failed to parse WebFinger resource descriptor as JSON: {error}", { error: e });
185
- return null;
186
- }
187
- throw e;
188
- }
189
- }
190
- }
191
-
192
- //#endregion
193
- Object.defineProperty(exports, 'UrlError', {
194
- enumerable: true,
195
- get: function () {
196
- return UrlError;
197
- }
198
- });
199
- Object.defineProperty(exports, 'lookupWebFinger', {
200
- enumerable: true,
201
- get: function () {
202
- return lookupWebFinger;
203
- }
204
- });
205
- Object.defineProperty(exports, 'validatePublicUrl', {
206
- enumerable: true,
207
- get: function () {
208
- return validatePublicUrl;
209
- }
210
- });
@@ -1,16 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import "./transformers-BFT6d7J5.js";
6
- import "./request-C0Ags1gQ.js";
7
- import "./actor-CRQwUlsr.js";
8
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-BBTmHKGh.js";
9
- import "./lookup-Bql--V-C.js";
10
- import "./http-BzsavjR2.js";
11
- import "./proof-aIlK5BTc.js";
12
- import "./types-CXnyjUdK.js";
13
- import "./kv-cache-rR-Cnl95.js";
14
- import "./vocab-BiKK7m2H.js";
15
-
16
- export { FederationImpl };
@@ -1,16 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- require('./transformers-CoBS-oFG.cjs');
6
- require('./request-Bc5CHBqO.cjs');
7
- require('./actor-Ci-5y3ml.cjs');
8
- const require_middleware = require('./middleware-DrpnHeGO.cjs');
9
- require('./lookup-BmGuy-Ps.cjs');
10
- require('./http-DtUGyvkU.cjs');
11
- require('./proof-0PY1LDZY.cjs');
12
- require('./types-BDNYgodm.cjs');
13
- require('./kv-cache-3VK2-wq_.cjs');
14
- require('./vocab-Dapemq3v.cjs');
15
-
16
- exports.FederationImpl = require_middleware.FederationImpl;
@@ -1,26 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import "./lookup-Bep-EOgr.js";
7
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-D7tP9Tq6.js";
8
- import "./client-DylapB-t.js";
9
- import "./types-C2XVl6gj.js";
10
- import "./actor-GwnlqPRv.js";
11
- import "./key-De1MJH3k.js";
12
- import "./http-CCUJdi0H.js";
13
- import "./ld-Dux3_Cw2.js";
14
- import "./owner-Zq8du9WO.js";
15
- import "./proof-C5S_3hdJ.js";
16
- import "./docloader-BpcE9hBI.js";
17
- import "./kv-cache-DNvS-egZ.js";
18
- import "./inbox-DizLjfhC.js";
19
- import "./builder-BflZmL4k.js";
20
- import "./collection-BzWsN9pB.js";
21
- import "./keycache-D2HiBv4F.js";
22
- import "./negotiation-C4nFufNk.js";
23
- import "./retry-CfF8Gn4d.js";
24
- import "./send-BbVnlsQO.js";
25
-
26
- export { FederationImpl };
@@ -1,35 +0,0 @@
1
- //#region src/utils/request.d.ts
2
-
3
- /**
4
- * Options for making `User-Agent` string.
5
- * @see {@link getUserAgent}
6
- * @since 1.3.0
7
- */
8
- interface GetUserAgentOptions {
9
- /**
10
- * An optional software name and version, e.g., `"Hollo/1.0.0"`.
11
- */
12
- software?: string | null;
13
- /**
14
- * An optional URL to append to the user agent string.
15
- * Usually the URL of the ActivityPub instance.
16
- */
17
- url?: string | URL | null;
18
- }
19
- /**
20
- * Gets the user agent string for the given application and URL.
21
- * @param options The options for making the user agent string.
22
- * @returns The user agent string.
23
- * @since 1.3.0
24
- */
25
- declare function getUserAgent({
26
- software,
27
- url
28
- }?: GetUserAgentOptions): string;
29
- /**
30
- * Logs the request.
31
- * @param request The request to log.
32
- * @internal
33
- */
34
- //#endregion
35
- export { GetUserAgentOptions, getUserAgent };
@@ -1,208 +0,0 @@
1
-
2
- const { Temporal } = require("@js-temporal/polyfill");
3
- const { URLPattern } = require("urlpattern-polyfill");
4
-
5
- const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
- const node_process = require_chunk.__toESM(require("node:process"));
7
-
8
- //#region deno.json
9
- var name = "@fedify/fedify";
10
- var version = "2.0.0-pr.451.1731+0cd4ea65";
11
- var license = "MIT";
12
- var exports$1 = {
13
- ".": "./src/mod.ts",
14
- "./compat": "./src/compat/mod.ts",
15
- "./federation": "./src/federation/mod.ts",
16
- "./nodeinfo": "./src/nodeinfo/mod.ts",
17
- "./sig": "./src/sig/mod.ts",
18
- "./testing": "./src/testing/mod.ts",
19
- "./vocab": "./src/vocab/mod.ts",
20
- "./utils": "./src/utils/mod.ts",
21
- "./webfinger": "./src/webfinger/mod.ts",
22
- "./x/cfworkers": "./src/x/cfworkers.ts",
23
- "./x/denokv": "./src/x/denokv.ts",
24
- "./x/fresh": "./src/x/fresh.ts",
25
- "./x/hono": "./src/x/hono.ts",
26
- "./x/sveltekit": "./src/x/sveltekit.ts"
27
- };
28
- var imports = {
29
- "@cfworker/json-schema": "npm:@cfworker/json-schema@^4.1.1",
30
- "@fxts/core": "npm:@fxts/core@^1.15.0",
31
- "@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
32
- "@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
33
- "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
34
- "@std/assert": "jsr:@std/assert@^0.226.0",
35
- "@std/testing": "jsr:@std/testing@^0.224.0",
36
- "@std/url": "jsr:@std/url@^0.225.1",
37
- "asn1js": "npm:asn1js@^3.0.5",
38
- "byte-encodings": "npm:byte-encodings@^1.0.11",
39
- "es-toolkit": "jsr:@es-toolkit/es-toolkit@^1.39.5",
40
- "fast-check": "npm:fast-check@^3.22.0",
41
- "fetch-mock": "npm:fetch-mock@^12.5.2",
42
- "json-canon": "npm:json-canon@^1.0.1",
43
- "jsonld": "npm:jsonld@^8.3.2",
44
- "multicodec": "npm:multicodec@^3.2.1",
45
- "pkijs": "npm:pkijs@^3.2.4",
46
- "structured-field-values": "npm:structured-field-values@^2.0.4",
47
- "uri-template-router": "npm:uri-template-router@^0.0.17",
48
- "url-template": "npm:url-template@^3.1.1"
49
- };
50
- var include = ["src/vocab/vocab.ts"];
51
- var exclude = [
52
- ".test-report.xml",
53
- "apidoc/",
54
- "dist/",
55
- "node_modules/",
56
- "npm/",
57
- "pnpm-lock.yaml",
58
- "src/cfworkers/dist/",
59
- "src/cfworkers/fixtures/",
60
- "src/cfworkers/imports.ts",
61
- "src/cfworkers/README.md",
62
- "src/cfworkers/server.ts",
63
- "src/cfworkers/server.js",
64
- "src/cfworkers/server.js.map",
65
- "src/codegen/schema.yaml",
66
- "src/vocab/*.yaml",
67
- "!src/vocab/vocab.ts"
68
- ];
69
- var tasks = {
70
- "codegen": "GENPATH=vocab-$(deno eval \"console.log(crypto.randomUUID());\").ts && deno run --allow-read --allow-write --check src/codegen/main.ts src/vocab/ src/vocab/$GENPATH && deno fmt src/vocab/$GENPATH && mv src/vocab/$GENPATH src/vocab/vocab.ts && deno cache src/vocab/vocab.ts && deno check src/vocab/vocab.ts",
71
- "cache": {
72
- "command": "deno cache src/mod.ts",
73
- "dependencies": ["codegen"]
74
- },
75
- "check": {
76
- "command": "deno fmt --check && deno lint && deno check src/**/*.ts",
77
- "dependencies": ["codegen"]
78
- },
79
- "test": {
80
- "command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
81
- "dependencies": ["codegen"]
82
- },
83
- "coverage": "deno task test --clean --coverage && deno coverage --html coverage",
84
- "bench": {
85
- "command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
86
- "dependencies": ["codegen"]
87
- },
88
- "apidoc": {
89
- "command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
90
- "dependencies": ["codegen"]
91
- },
92
- "publish": {
93
- "command": "deno publish",
94
- "dependencies": ["codegen"]
95
- },
96
- "pnpm:install": "pnpm install --silent",
97
- "pnpm:build": {
98
- "command": "pnpm exec tsdown",
99
- "dependencies": [
100
- "codegen",
101
- "pnpm:install",
102
- "pnpm:build-vocab"
103
- ]
104
- },
105
- "pnpm:build-vocab-runtime": { "command": "cd ../vocab/runtime && pnpm build" },
106
- "pnpm:build-vocab": { "dependencies": ["pnpm:build-vocab-runtime"] },
107
- "test:node": {
108
- "command": "cd dist/ && node --test",
109
- "dependencies": ["pnpm:build"]
110
- },
111
- "test:bun": {
112
- "command": "cd dist/ && bun test --timeout 60000",
113
- "dependencies": ["pnpm:build-vocab", "pnpm:build"]
114
- },
115
- "test:cfworkers": {
116
- "command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
117
- "dependencies": ["pnpm:build-vocab", "pnpm:build"]
118
- },
119
- "test-all": { "dependencies": [
120
- "check",
121
- "test",
122
- "test:node",
123
- "test:bun",
124
- "test:cfworkers"
125
- ] }
126
- };
127
- var deno_default = {
128
- name,
129
- version,
130
- license,
131
- exports: exports$1,
132
- imports,
133
- include,
134
- exclude,
135
- tasks
136
- };
137
-
138
- //#endregion
139
- //#region src/utils/request.ts
140
- /**
141
- * Creates a request for the given URL.
142
- * @param url The URL to create the request for.
143
- * @param options The options for the request.
144
- * @returns The created request.
145
- * @internal
146
- */
147
- function createActivityPubRequest(url, options = {}) {
148
- return new Request(url, {
149
- headers: {
150
- Accept: "application/activity+json, application/ld+json",
151
- "User-Agent": typeof options.userAgent === "string" ? options.userAgent : getUserAgent(options.userAgent)
152
- },
153
- redirect: "manual"
154
- });
155
- }
156
- /**
157
- * Gets the user agent string for the given application and URL.
158
- * @param options The options for making the user agent string.
159
- * @returns The user agent string.
160
- * @since 1.3.0
161
- */
162
- function getUserAgent({ software, url } = {}) {
163
- const fedify = `Fedify/${deno_default.version}`;
164
- const runtime = globalThis.Deno?.version?.deno != null ? `Deno/${Deno.version.deno}` : globalThis.process?.versions?.bun != null ? `Bun/${node_process.default.versions.bun}` : "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" ? navigator.userAgent : globalThis.process?.versions?.node != null ? `Node.js/${node_process.default.versions.node}` : null;
165
- const userAgent = software == null ? [fedify] : [software, fedify];
166
- if (runtime != null) userAgent.push(runtime);
167
- if (url != null) userAgent.push(`+${url.toString()}`);
168
- const first = userAgent.shift();
169
- return `${first} (${userAgent.join("; ")})`;
170
- }
171
- /**
172
- * Logs the request.
173
- * @param request The request to log.
174
- * @internal
175
- */
176
- function logRequest(logger, request) {
177
- logger.debug("Fetching document: {method} {url} {headers}", {
178
- method: request.method,
179
- url: request.url,
180
- headers: Object.fromEntries(request.headers.entries())
181
- });
182
- }
183
-
184
- //#endregion
185
- Object.defineProperty(exports, 'createActivityPubRequest', {
186
- enumerable: true,
187
- get: function () {
188
- return createActivityPubRequest;
189
- }
190
- });
191
- Object.defineProperty(exports, 'deno_default', {
192
- enumerable: true,
193
- get: function () {
194
- return deno_default;
195
- }
196
- });
197
- Object.defineProperty(exports, 'getUserAgent', {
198
- enumerable: true,
199
- get: function () {
200
- return getUserAgent;
201
- }
202
- });
203
- Object.defineProperty(exports, 'logRequest', {
204
- enumerable: true,
205
- get: function () {
206
- return logRequest;
207
- }
208
- });