@fedify/fedify 2.3.0-dev.1131 → 2.3.0-dev.1145

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 (104) hide show
  1. package/README.md +3 -0
  2. package/dist/{assert-DikXweDx.mjs → assert-OguE97r2.mjs} +1 -1
  3. package/dist/{assert_instance_of-C4Ri6VuN.mjs → assert_instance_of-DBC5X09g.mjs} +1 -1
  4. package/dist/{assert_not_equals--wG9hV7u.mjs → assert_not_equals-DkVK8oqV.mjs} +1 -1
  5. package/dist/{assert_rejects-DQP-q39h.mjs → assert_rejects-DN60FHPX.mjs} +2 -2
  6. package/dist/{assert_strict_equals-Dmjbg-bA.mjs → assert_strict_equals-XEgZAlrj.mjs} +1 -1
  7. package/dist/{assert_throws-4NwKEy2q.mjs → assert_throws-BOkhLGYc.mjs} +1 -1
  8. package/dist/{builder-DckAhD27.mjs → builder-ShiR1K6b.mjs} +60 -41
  9. package/dist/compat/mod.d.cts +1 -1
  10. package/dist/compat/mod.d.ts +1 -1
  11. package/dist/compat/outgoing-jsonld.test.mjs +3 -3
  12. package/dist/compat/public-audience.test.mjs +3 -3
  13. package/dist/compat/transformers.test.mjs +5 -5
  14. package/dist/{context-Cq18Gplu.d.ts → context-DCtsSHDv.d.ts} +2 -86
  15. package/dist/{context-tc6VOOOL.d.cts → context-DI2gRbyN.d.cts} +1 -87
  16. package/dist/{context-BAE7AKLA.mjs → context-DVoTs_wM.mjs} +1 -1
  17. package/dist/{deno--CS-SBS9.mjs → deno-h0TWFuEz.mjs} +1 -1
  18. package/dist/{docloader-k6huZLQL.mjs → docloader-BdDN0Aqx.mjs} +3 -3
  19. package/dist/federation/builder.test.mjs +138 -10
  20. package/dist/federation/collection.test.mjs +3 -3
  21. package/dist/federation/handler.test.mjs +12 -12
  22. package/dist/federation/idempotency.test.mjs +6 -6
  23. package/dist/federation/inbox.test.mjs +3 -3
  24. package/dist/federation/keycache.test.mjs +5 -5
  25. package/dist/federation/kv.test.mjs +3 -3
  26. package/dist/federation/metrics.test.mjs +63 -4
  27. package/dist/federation/middleware.test.mjs +30 -18
  28. package/dist/federation/mod.cjs +155 -3
  29. package/dist/federation/mod.d.cts +2 -2
  30. package/dist/federation/mod.d.ts +2 -2
  31. package/dist/federation/mod.js +153 -1
  32. package/dist/federation/mq.test.mjs +5 -5
  33. package/dist/federation/negotiation.test.mjs +4 -4
  34. package/dist/federation/retry.test.mjs +3 -3
  35. package/dist/federation/router.test.mjs +190 -9
  36. package/dist/federation/send.test.mjs +16 -16
  37. package/dist/federation/webfinger.test.mjs +151 -6
  38. package/dist/{getMachineId-bsd-BY01PL1n.mjs → getMachineId-bsd-etIyxDet.mjs} +1 -1
  39. package/dist/{getMachineId-darwin-Dr1gkBkp.mjs → getMachineId-darwin-D23zTf4g.mjs} +1 -1
  40. package/dist/{getMachineId-win-QEYwcJiy.mjs → getMachineId-win-Dpap6v5i.mjs} +1 -1
  41. package/dist/{http-CJfvRL7D.cjs → http-7kAB7PVx.cjs} +53 -1
  42. package/dist/{http-cqujdCRz.js → http-B2hxA7dO.js} +48 -2
  43. package/dist/{http-IywnQdiX.mjs → http-QzW9IWfs.mjs} +4 -4
  44. package/dist/{key-Df3tMleh.mjs → key-Dh2OK1XQ.mjs} +2 -2
  45. package/dist/{kv-cache-L0SMQkcd.cjs → kv-cache-DCPp-MT0.cjs} +1 -1
  46. package/dist/{kv-cache-q9Ec2ryS.mjs → kv-cache-EZRIPZXD.mjs} +1 -1
  47. package/dist/{kv-cache-pEejzYq4.js → kv-cache-b22dNkjt.js} +1 -1
  48. package/dist/{ld-BGwiJpl3.mjs → ld-eZbar1rr.mjs} +3 -3
  49. package/dist/{metrics-BTOMkW8C.mjs → metrics-E0hAHtLZ.mjs} +48 -2
  50. package/dist/{middleware-B2rtdpFV.cjs → middleware-BUl1BH4x.cjs} +163 -212
  51. package/dist/{middleware-DtOddSVg.js → middleware-BrGIM_Ra.js} +127 -164
  52. package/dist/{middleware-BB0IbDow.mjs → middleware-CyJDCmNg.mjs} +89 -37
  53. package/dist/{middleware-Dnql59Y8.mjs → middleware-mToCR2tG.mjs} +1 -1
  54. package/dist/mod-CI9fduEi.d.cts +182 -0
  55. package/dist/mod-CkRiJHGA.d.ts +182 -0
  56. package/dist/mod.cjs +6 -6
  57. package/dist/mod.d.cts +2 -2
  58. package/dist/mod.d.ts +2 -2
  59. package/dist/mod.js +5 -5
  60. package/dist/nodeinfo/client.test.mjs +4 -4
  61. package/dist/nodeinfo/handler.test.mjs +5 -5
  62. package/dist/nodeinfo/types.test.mjs +4 -4
  63. package/dist/otel/exporter.test.mjs +3 -3
  64. package/dist/{outgoing-jsonld-BNL8AC14.mjs → outgoing-jsonld-BgFLCJQ_.mjs} +1 -1
  65. package/dist/{owner-CIt4hvmM.mjs → owner-ByO_Fw6U.mjs} +2 -2
  66. package/dist/{proof-DMGIjHYH.js → proof-BkRyFchv.js} +1 -1
  67. package/dist/{proof-BYlrRSmZ.mjs → proof-CSo0S8OK.mjs} +5 -5
  68. package/dist/{proof-B1_u25UV.cjs → proof-jVqClF49.cjs} +1 -1
  69. package/dist/{send-DJFpze7B.mjs → send-jzrTV1FU.mjs} +3 -3
  70. package/dist/sig/accept.test.mjs +1 -1
  71. package/dist/sig/http.test.mjs +9 -9
  72. package/dist/sig/key.test.mjs +6 -6
  73. package/dist/sig/ld.test.mjs +7 -7
  74. package/dist/sig/mod.cjs +2 -2
  75. package/dist/sig/mod.js +2 -2
  76. package/dist/sig/owner.test.mjs +6 -6
  77. package/dist/sig/proof.test.mjs +8 -8
  78. package/dist/{std__assert-BTEgfoJo.mjs → std__assert-BBjXFNOb.mjs} +4 -4
  79. package/dist/testing/mod.d.mts +1 -0
  80. package/dist/testing/mod.mjs +1 -1
  81. package/dist/utils/docloader.test.mjs +7 -7
  82. package/dist/utils/kv-cache.test.mjs +1 -1
  83. package/dist/utils/mod.cjs +1 -1
  84. package/dist/utils/mod.js +1 -1
  85. package/package.json +6 -7
  86. package/dist/mod-CajNYYkt.d.ts +0 -63
  87. package/dist/mod-DnzgcPcy.d.cts +0 -63
  88. package/dist/router-BT_F5748.mjs +0 -114
  89. /package/dist/{accept-CgDcxvjV.mjs → accept-CceiKpCy.mjs} +0 -0
  90. /package/dist/{activity-listener-BeTGV3wc.mjs → activity-listener-tztVvlNb.mjs} +0 -0
  91. /package/dist/{assert_equals-Ew3jOFa3.mjs → assert_equals-C-ZRDbaf.mjs} +0 -0
  92. /package/dist/{client-Bneh_DYR.mjs → client-B_A6mfn3.mjs} +0 -0
  93. /package/dist/{collection-Cc3DVAhE.mjs → collection-CA3V5zyK.mjs} +0 -0
  94. /package/dist/{esm-sdtqOUPu.mjs → esm-BQRw925N.mjs} +0 -0
  95. /package/dist/{execAsync-Dxb7rNf3.mjs → execAsync-DCBrgFiV.mjs} +0 -0
  96. /package/dist/{getMachineId-linux-Bbhofx-s.mjs → getMachineId-linux-ObI47Hql.mjs} +0 -0
  97. /package/dist/{getMachineId-unsupported-dIOte2Ct.mjs → getMachineId-unsupported-Ddu-PFeh.mjs} +0 -0
  98. /package/dist/{keycache-BeU0LCII.mjs → keycache-BYMd8q7F.mjs} +0 -0
  99. /package/dist/{keys-CSYsOMFG.mjs → keys-C3kae-6B.mjs} +0 -0
  100. /package/dist/{kv-QHE0oeM3.mjs → kv-x2IvBUyq.mjs} +0 -0
  101. /package/dist/{negotiation-DDstyBvc.mjs → negotiation-CDW-_gUU.mjs} +0 -0
  102. /package/dist/{public-audience-c9zmYKgA.mjs → public-audience-N3pyOx2p.mjs} +0 -0
  103. /package/dist/{retry-_VvV0h9f.mjs → retry-v_sGLH1d.mjs} +0 -0
  104. /package/dist/{types-D09GN0uZ.mjs → types-BFowWFTT.mjs} +0 -0
@@ -1,12 +1,12 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-BTEgfoJo.mjs";
6
- import { t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
7
- import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
- import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-Df3tMleh.mjs";
9
- import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
4
+ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
+ import "../std__assert-BBjXFNOb.mjs";
6
+ import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
+ import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
8
+ import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-Dh2OK1XQ.mjs";
9
+ import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
10
10
  import { CryptographicKey, Multikey } from "@fedify/vocab";
11
11
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { FetchError } from "@fedify/vocab-runtime";
@@ -1,13 +1,13 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
6
- import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
7
- import { t as assert } from "../assert-DikXweDx.mjs";
8
- import { i as generateCryptoKeyPair } from "../key-Df3tMleh.mjs";
9
- import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
10
- import { a as signJsonLd, i as hasSignatureLike, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-BGwiJpl3.mjs";
4
+ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
+ import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
6
+ import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
7
+ import { t as assert } from "../assert-OguE97r2.mjs";
8
+ import { i as generateCryptoKeyPair } from "../key-Dh2OK1XQ.mjs";
9
+ import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
10
+ import { a as signJsonLd, i as hasSignatureLike, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-eZbar1rr.mjs";
11
11
  import { CryptographicKey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
13
13
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_http = require("../http-CJfvRL7D.cjs");
5
- const require_proof = require("../proof-B1_u25UV.cjs");
4
+ const require_http = require("../http-7kAB7PVx.cjs");
5
+ const require_proof = require("../proof-jVqClF49.cjs");
6
6
  exports.attachSignature = require_proof.attachSignature;
7
7
  exports.createProof = require_proof.createProof;
8
8
  exports.createSignature = require_proof.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { C as formatAcceptSignature, E as validateAcceptSignature, T as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk, w as fulfillAcceptSignature } from "../http-cqujdCRz.js";
4
- import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "../proof-DMGIjHYH.js";
3
+ import { D as validateAcceptSignature, E as parseAcceptSignature, T as fulfillAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk, w as formatAcceptSignature } from "../http-B2hxA7dO.js";
4
+ import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "../proof-BkRyFchv.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -1,12 +1,12 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-BTEgfoJo.mjs";
6
- import { r as assertFalse } from "../assert_rejects-DQP-q39h.mjs";
7
- import { t as assert } from "../assert-DikXweDx.mjs";
8
- import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CSYsOMFG.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CIt4hvmM.mjs";
4
+ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
+ import "../std__assert-BBjXFNOb.mjs";
6
+ import { r as assertFalse } from "../assert_rejects-DN60FHPX.mjs";
7
+ import { t as assert } from "../assert-OguE97r2.mjs";
8
+ import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-C3kae-6B.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-ByO_Fw6U.mjs";
10
10
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
11
11
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region src/sig/owner.test.ts
@@ -1,14 +1,14 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-BTEgfoJo.mjs";
6
- import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
7
- import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
8
- import { t as assert } from "../assert-DikXweDx.mjs";
9
- import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CSYsOMFG.mjs";
10
- import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-BNL8AC14.mjs";
11
- import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-BYlrRSmZ.mjs";
4
+ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
+ import "../std__assert-BBjXFNOb.mjs";
6
+ import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
+ import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
8
+ import { t as assert } from "../assert-OguE97r2.mjs";
9
+ import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
10
+ import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-BgFLCJQ_.mjs";
11
+ import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-CSo0S8OK.mjs";
12
12
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
13
13
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
@@ -1,10 +1,10 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError, s as format } from "./assert_equals-Ew3jOFa3.mjs";
5
- import "./assert_rejects-DQP-q39h.mjs";
6
- import "./assert_throws-4NwKEy2q.mjs";
7
- import "./assert_strict_equals-Dmjbg-bA.mjs";
4
+ import { l as AssertionError, s as format } from "./assert_equals-C-ZRDbaf.mjs";
5
+ import "./assert_rejects-DN60FHPX.mjs";
6
+ import "./assert_throws-BOkhLGYc.mjs";
7
+ import "./assert_strict_equals-XEgZAlrj.mjs";
8
8
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
9
9
  /**
10
10
  * Make an assertion that actual is not null or undefined.
@@ -1,6 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { ExportResultCode } from "@opentelemetry/core";
4
+ import { Router } from "@fedify/uri-template";
4
5
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
5
6
  import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
6
7
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
@@ -1,5 +1,5 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { i as testDefinitions, n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-BAE7AKLA.mjs";
4
+ import { i as testDefinitions, n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DVoTs_wM.mjs";
5
5
  export { createInboxContext, createOutboxContext, createRequestContext, testDefinitions };
@@ -1,13 +1,13 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-BTEgfoJo.mjs";
6
- import { t as assertRejects } from "../assert_rejects-DQP-q39h.mjs";
7
- import { t as esm_default } from "../esm-sdtqOUPu.mjs";
8
- import { l as verifyRequest } from "../http-IywnQdiX.mjs";
9
- import { i as rsaPrivateKey2 } from "../keys-CSYsOMFG.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-k6huZLQL.mjs";
4
+ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
+ import "../std__assert-BBjXFNOb.mjs";
6
+ import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
+ import { t as esm_default } from "../esm-BQRw925N.mjs";
8
+ import { l as verifyRequest } from "../http-QzW9IWfs.mjs";
9
+ import { i as rsaPrivateKey2 } from "../keys-C3kae-6B.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-BdDN0Aqx.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-q9Ec2ryS.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-EZRIPZXD.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -1,6 +1,6 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_kv_cache = require("../kv-cache-L0SMQkcd.cjs");
4
+ const require_kv_cache = require("../kv-cache-DCPp-MT0.cjs");
5
5
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
6
  exports.kvCache = require_kv_cache.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-pEejzYq4.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-b22dNkjt.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.3.0-dev.1131+553b59b8",
3
+ "version": "2.3.0-dev.1145+3fe78022",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -150,12 +150,11 @@
150
150
  "json-canon": "^1.0.1",
151
151
  "jsonld": "^9.0.0",
152
152
  "structured-field-values": "^2.0.4",
153
- "uri-template-router": "^1.0.0",
154
- "url-template": "^3.1.1",
155
153
  "urlpattern-polyfill": "^10.1.0",
156
- "@fedify/vocab": "2.3.0-dev.1131+553b59b8",
157
- "@fedify/webfinger": "2.3.0-dev.1131+553b59b8",
158
- "@fedify/vocab-runtime": "2.3.0-dev.1131+553b59b8"
154
+ "@fedify/uri-template": "2.3.0-dev.1145+3fe78022",
155
+ "@fedify/webfinger": "2.3.0-dev.1145+3fe78022",
156
+ "@fedify/vocab-runtime": "2.3.0-dev.1145+3fe78022",
157
+ "@fedify/vocab": "2.3.0-dev.1145+3fe78022"
159
158
  },
160
159
  "devDependencies": {
161
160
  "@opentelemetry/sdk-metrics": "2.7.1",
@@ -168,7 +167,7 @@
168
167
  "tsx": "^4.21.0",
169
168
  "typescript": "^6.0.0",
170
169
  "wrangler": "^4.17.0",
171
- "@fedify/vocab-tools": "^2.3.0-dev.1131+553b59b8",
170
+ "@fedify/vocab-tools": "^2.3.0-dev.1145+3fe78022",
172
171
  "@fedify/fixture": "2.0.0"
173
172
  },
174
173
  "scripts": {
@@ -1,63 +0,0 @@
1
- /// <reference lib="esnext.temporal" />
2
- import { J as ActorDispatcher, Y as ActorHandleMapper, gt as WebFingerLinksDispatcher, l as RequestContext, q as ActorAliasMapper } from "./context-Cq18Gplu.js";
3
- import { Span, Tracer } from "@opentelemetry/api";
4
-
5
- //#region src/federation/webfinger.d.ts
6
- /**
7
- * Parameters for {@link handleWebFinger}.
8
- */
9
- interface WebFingerHandlerParameters<TContextData> {
10
- /**
11
- * The request context.
12
- */
13
- context: RequestContext<TContextData>;
14
- /**
15
- * The canonical hostname of the server, if it's explicitly configured.
16
- * @since 1.5.0
17
- */
18
- host?: string;
19
- /**
20
- * The callback for dispatching the actor.
21
- */
22
- actorDispatcher?: ActorDispatcher<TContextData>;
23
- /**
24
- * The callback for mapping a WebFinger username to the corresponding actor's
25
- * internal identifier, or `null` if the username is not found.
26
- * @since 0.15.0
27
- */
28
- actorHandleMapper?: ActorHandleMapper<TContextData>;
29
- /**
30
- * The callback for mapping a WebFinger query to the corresponding actor's
31
- * internal identifier or username, or `null` if the query is not found.
32
- * @since 1.4.0
33
- */
34
- actorAliasMapper?: ActorAliasMapper<TContextData>;
35
- /**
36
- * The callback for dispatching the Links of webFinger.
37
- */
38
- webFingerLinksDispatcher?: WebFingerLinksDispatcher<TContextData>;
39
- /**
40
- * The function to call when the actor is not found.
41
- */
42
- onNotFound(request: Request): Response | Promise<Response>;
43
- /**
44
- * The OpenTelemetry tracer.
45
- * @since 1.3.0
46
- */
47
- tracer?: Tracer;
48
- /**
49
- * The span for the request.
50
- * @since 1.3.0
51
- */
52
- span?: Span;
53
- }
54
- /**
55
- * Handles a WebFinger request. You would not typically call this function
56
- * directly, but instead use {@link Federation.fetch} method.
57
- * @param request The WebFinger request to handle.
58
- * @param parameters The parameters for handling the request.
59
- * @returns The response to the request.
60
- */
61
- declare function handleWebFinger<TContextData>(request: Request, options: WebFingerHandlerParameters<TContextData>): Promise<Response>;
62
- //#endregion
63
- export { handleWebFinger as n, WebFingerHandlerParameters as t };
@@ -1,63 +0,0 @@
1
- /// <reference lib="esnext.temporal" />
2
- import { J as ActorDispatcher, Y as ActorHandleMapper, gt as WebFingerLinksDispatcher, l as RequestContext, q as ActorAliasMapper } from "./context-tc6VOOOL.cjs";
3
- import { Span, Tracer } from "@opentelemetry/api";
4
-
5
- //#region src/federation/webfinger.d.ts
6
- /**
7
- * Parameters for {@link handleWebFinger}.
8
- */
9
- interface WebFingerHandlerParameters<TContextData> {
10
- /**
11
- * The request context.
12
- */
13
- context: RequestContext<TContextData>;
14
- /**
15
- * The canonical hostname of the server, if it's explicitly configured.
16
- * @since 1.5.0
17
- */
18
- host?: string;
19
- /**
20
- * The callback for dispatching the actor.
21
- */
22
- actorDispatcher?: ActorDispatcher<TContextData>;
23
- /**
24
- * The callback for mapping a WebFinger username to the corresponding actor's
25
- * internal identifier, or `null` if the username is not found.
26
- * @since 0.15.0
27
- */
28
- actorHandleMapper?: ActorHandleMapper<TContextData>;
29
- /**
30
- * The callback for mapping a WebFinger query to the corresponding actor's
31
- * internal identifier or username, or `null` if the query is not found.
32
- * @since 1.4.0
33
- */
34
- actorAliasMapper?: ActorAliasMapper<TContextData>;
35
- /**
36
- * The callback for dispatching the Links of webFinger.
37
- */
38
- webFingerLinksDispatcher?: WebFingerLinksDispatcher<TContextData>;
39
- /**
40
- * The function to call when the actor is not found.
41
- */
42
- onNotFound(request: Request): Response | Promise<Response>;
43
- /**
44
- * The OpenTelemetry tracer.
45
- * @since 1.3.0
46
- */
47
- tracer?: Tracer;
48
- /**
49
- * The span for the request.
50
- * @since 1.3.0
51
- */
52
- span?: Span;
53
- }
54
- /**
55
- * Handles a WebFinger request. You would not typically call this function
56
- * directly, but instead use {@link Federation.fetch} method.
57
- * @param request The WebFinger request to handle.
58
- * @param parameters The parameters for handling the request.
59
- * @returns The response to the request.
60
- */
61
- declare function handleWebFinger<TContextData>(request: Request, options: WebFingerHandlerParameters<TContextData>): Promise<Response>;
62
- //#endregion
63
- export { handleWebFinger as n, WebFingerHandlerParameters as t };
@@ -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