@fedify/fedify 2.3.9-dev.2048 → 2.3.10

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 (85) hide show
  1. package/dist/{builder-BfY2wZ4V.mjs → builder-Bal9bfuM.mjs} +10 -2
  2. package/dist/{client-DYDoDpMa.mjs → client-Ccbsek6u.mjs} +7 -3
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/transformers.test.mjs +1 -1
  6. package/dist/{context-CAKnQy1x.d.ts → context-BWbdE_MZ.d.ts} +1 -1
  7. package/dist/{context-BepjCFHN.mjs → context-CxbCIptr.mjs} +2 -1
  8. package/dist/{context-CSIggG9_.d.cts → context-MOrCC7yl.d.cts} +1 -1
  9. package/dist/{deno-ayal9buz.mjs → deno-DUgFsCmM.mjs} +1 -1
  10. package/dist/docloader-w72ipM49.mjs +79 -0
  11. package/dist/federation/builder.test.mjs +38 -2
  12. package/dist/federation/circuit-breaker.test.mjs +1 -1
  13. package/dist/federation/collection.test.mjs +1 -1
  14. package/dist/federation/handler.test.mjs +7 -7
  15. package/dist/federation/idempotency.test.mjs +3 -3
  16. package/dist/federation/kv.test.mjs +1 -1
  17. package/dist/federation/metrics.test.mjs +2 -2
  18. package/dist/federation/middleware.test.mjs +302 -8
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +3 -3
  21. package/dist/federation/mod.d.ts +3 -3
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/mq.test.mjs +98 -43
  24. package/dist/federation/negotiation.test.mjs +1 -1
  25. package/dist/federation/router.test.mjs +1 -1
  26. package/dist/federation/send.test.mjs +85 -4
  27. package/dist/federation/temporal.test.mjs +2 -2
  28. package/dist/federation/webfinger.test.mjs +3 -3
  29. package/dist/{http-B2u6PvNX.mjs → http-BNDHRNJP.mjs} +8 -4
  30. package/dist/{http-BPPCh0xN.js → http-BY8PpQzP.js} +6 -2
  31. package/dist/{http-BGP2QCbe.cjs → http-CTYio50W.cjs} +6 -2
  32. package/dist/{key-C9DkrWwb.mjs → key-BbuFo4CW.mjs} +2 -2
  33. package/dist/{kv-D6hNiMTK.d.ts → kv-CZKl1IUS.d.cts} +3 -2
  34. package/dist/{kv-gJ8LYbxX.d.cts → kv-CxaI4eGo.d.ts} +3 -2
  35. package/dist/{kv-cache-qJSjfLGm.mjs → kv-cache-CNZOaZYq.mjs} +1 -1
  36. package/dist/{kv-cache-C1TC_e9y.cjs → kv-cache-CrcqGkT-.cjs} +34 -8
  37. package/dist/{kv-cache-Cl1q1aA9.js → kv-cache-DNnjnc9t.js} +35 -9
  38. package/dist/{ld-DNl7KwLY.mjs → ld-BYV2Luge.mjs} +4 -4
  39. package/dist/{metrics-Ce55disp.mjs → metrics-QrVsKSG9.mjs} +1 -1
  40. package/dist/{middleware-C96wm_7x.mjs → middleware-54KSGAQA.mjs} +1 -1
  41. package/dist/{middleware-C_utyVa_.js → middleware-B4FNnN3W.js} +36 -11
  42. package/dist/{middleware-BCG2BX1n.mjs → middleware-Bj9s3J_0.mjs} +22 -19
  43. package/dist/{middleware-BZojifnF.cjs → middleware-Dv-L7Plm.cjs} +36 -11
  44. package/dist/{mod-PVR75MeU.d.cts → mod-B6PwkUMU.d.cts} +1 -1
  45. package/dist/{mod-DHgc4ygG.d.ts → mod-Br8yJNcE.d.ts} +3 -1
  46. package/dist/{mod-1TuoXkGs.d.cts → mod-Co1M3Ux0.d.cts} +3 -1
  47. package/dist/{mod-CFuyfw3c.d.ts → mod-LmD03uRA.d.ts} +1 -1
  48. package/dist/mod.cjs +5 -5
  49. package/dist/mod.d.cts +4 -4
  50. package/dist/mod.d.ts +4 -4
  51. package/dist/mod.js +5 -5
  52. package/dist/nodeinfo/client.test.mjs +50 -2
  53. package/dist/nodeinfo/handler.test.mjs +3 -3
  54. package/dist/nodeinfo/mod.cjs +1 -1
  55. package/dist/nodeinfo/mod.js +1 -1
  56. package/dist/nodeinfo/types.test.mjs +1 -1
  57. package/dist/otel/exporter.test.mjs +1 -1
  58. package/dist/otel/mod.d.cts +1 -1
  59. package/dist/otel/mod.d.ts +1 -1
  60. package/dist/{owner-DqqDBw-l.mjs → owner-BsBzJADO.mjs} +2 -2
  61. package/dist/{proof-Dz9ObvUq.js → proof-BxS2Xa8B.js} +2 -2
  62. package/dist/{proof-I6YcKRRq.cjs → proof-CGKQFT2M.cjs} +2 -2
  63. package/dist/{proof-D5vP7VIN.mjs → proof-cXVkPBIU.mjs} +3 -3
  64. package/dist/{send-CBtR8DQK.mjs → send-omt23uTA.mjs} +18 -4
  65. package/dist/sig/http.test.mjs +43 -3
  66. package/dist/sig/key.test.mjs +2 -2
  67. package/dist/sig/ld.test.mjs +5 -2
  68. package/dist/sig/mod.cjs +2 -2
  69. package/dist/sig/mod.js +2 -2
  70. package/dist/sig/owner.test.mjs +2 -2
  71. package/dist/sig/proof.test.mjs +2 -2
  72. package/dist/{std__assert-BBjXFNOb.mjs → std__assert-BvGuO4xO.mjs} +2 -27
  73. package/dist/{temporal-B9t2tY9A.mjs → temporal-ZUAQe754.mjs} +1 -1
  74. package/dist/testing/mod.mjs +1 -1
  75. package/dist/{types-DWs-qZaY.cjs → types-DRPjmHVV.cjs} +7 -3
  76. package/dist/{types-sXITXcWa.js → types-miAYfiGO.js} +7 -3
  77. package/dist/utils/docloader.test.mjs +299 -3
  78. package/dist/utils/kv-cache.test.mjs +1 -1
  79. package/dist/utils/mod.cjs +1 -1
  80. package/dist/utils/mod.d.cts +1 -1
  81. package/dist/utils/mod.d.ts +1 -1
  82. package/dist/utils/mod.js +1 -1
  83. package/dist/vocab/cjs.test.mjs +1 -1
  84. package/package.json +7 -7
  85. package/dist/docloader-C-JrNL14.mjs +0 -53
@@ -1,3 +1,3 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-DHgc4ygG.js";
2
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-Br8yJNcE.js";
3
3
  export { getAuthenticatedDocumentLoader, kvCache };
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Cl1q1aA9.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DNnjnc9t.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
@@ -5,7 +5,7 @@ import { createRequire } from "node:module";
5
5
  import { strictEqual } from "node:assert";
6
6
  import { test } from "@fedify/fixture";
7
7
  //#region src/vocab/cjs.test.ts
8
- test("CommonJS vocab entry exports Object", { ignore: "Deno" in globalThis }, () => {
8
+ test("CommonJS vocab entry exports Object", { ignore: "Deno" in globalThis || "navigator" in globalThis && navigator.userAgent === "Cloudflare-Workers" }, () => {
9
9
  const vocab = createRequire(import.meta.url)("./mod.cjs");
10
10
  strictEqual(typeof vocab.Object, "function");
11
11
  strictEqual(typeof vocab.Update, "function");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.3.9-dev.2048+c88fcc8c",
3
+ "version": "2.3.10",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -152,10 +152,10 @@
152
152
  "jsonld": "^9.0.0",
153
153
  "structured-field-values": "^2.0.4",
154
154
  "urlpattern-polyfill": "^10.1.0",
155
- "@fedify/uri-template": "2.3.9-dev.2048+c88fcc8c",
156
- "@fedify/webfinger": "2.3.9-dev.2048+c88fcc8c",
157
- "@fedify/vocab-runtime": "2.3.9-dev.2048+c88fcc8c",
158
- "@fedify/vocab": "2.3.9-dev.2048+c88fcc8c"
155
+ "@fedify/vocab": "2.3.10",
156
+ "@fedify/webfinger": "2.3.10",
157
+ "@fedify/vocab-runtime": "2.3.10",
158
+ "@fedify/uri-template": "2.3.10"
159
159
  },
160
160
  "devDependencies": {
161
161
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -168,7 +168,7 @@
168
168
  "typescript": "^6.0.0",
169
169
  "wrangler": "^4.17.0",
170
170
  "@fedify/fixture": "2.0.0",
171
- "@fedify/vocab-tools": "^2.3.9-dev.2048+c88fcc8c"
171
+ "@fedify/vocab-tools": "^2.3.10"
172
172
  },
173
173
  "scripts": {
174
174
  "build:self": "tsdown",
@@ -178,6 +178,6 @@
178
178
  "test": "cd dist/ && node --test",
179
179
  "pretest:bun": "pnpm build",
180
180
  "test:bun": "cd dist/ && bun test --timeout 60000",
181
- "test:cfworkers": "deno task codegen && wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts"
181
+ "test:cfworkers": "deno task codegen && wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx scripts/check_cfworkers.ts && node --import=tsx src/cfworkers/client.ts"
182
182
  }
183
183
  }
@@ -1,53 +0,0 @@
1
- import "@js-temporal/polyfill";
2
- import "urlpattern-polyfill";
3
- globalThis.addEventListener = () => {};
4
- import { s as validateCryptoKey } from "./key-C9DkrWwb.mjs";
5
- import { n as doubleKnock } from "./http-B2u6PvNX.mjs";
6
- import { getLogger } from "@logtape/logtape";
7
- import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
- import { curry } from "es-toolkit";
9
- //#region src/utils/docloader.ts
10
- const logger = getLogger([
11
- "fedify",
12
- "utils",
13
- "docloader"
14
- ]);
15
- /**
16
- * Gets an authenticated {@link DocumentLoader} for the given identity.
17
- * Note that an authenticated document loader intentionally does not cache
18
- * the fetched documents.
19
- * @param identity The identity to get the document loader for.
20
- * The actor's key pair.
21
- * @param options The options for the document loader.
22
- * @returns The authenticated document loader.
23
- * @throws {TypeError} If the key is invalid or unsupported.
24
- * @since 0.4.0
25
- */
26
- function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, maxRedirection, userAgent, specDeterminer, tracerProvider } = {}) {
27
- validateCryptoKey(identity.privateKey);
28
- async function load(url, options) {
29
- await validateUrl(url);
30
- return getRemoteDocument(url, await doubleKnock(createActivityPubRequest(url, { userAgent }), identity, {
31
- maxRedirection,
32
- specDeterminer,
33
- log: curry(logRequest)(logger),
34
- tracerProvider,
35
- signal: options?.signal,
36
- validateRedirect: validateUrl
37
- }), load);
38
- }
39
- async function validateUrl(url) {
40
- if (!allowPrivateAddress) try {
41
- await validatePublicUrl(url);
42
- } catch (error) {
43
- if (error instanceof UrlError) logger.error("Disallowed private URL: {url}", {
44
- url,
45
- error
46
- });
47
- throw error;
48
- }
49
- }
50
- return load;
51
- }
52
- //#endregion
53
- export { getAuthenticatedDocumentLoader as t };