@fedify/fedify 2.1.1 → 2.1.3

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 (207) hide show
  1. package/dist/{accept-D7sAxyNa.js → accept-Dd__NiUL.mjs} +10 -8
  2. package/dist/{assert-MZs1qjMx.js → assert-ddO5KLpe.mjs} +5 -9
  3. package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
  4. package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
  5. package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
  6. package/dist/{assert_rejects-0h7I2Esa.js → assert_rejects-B-qJtC9Z.mjs} +6 -11
  7. package/dist/{assert_throws-rjdMBf31.js → assert_throws-4NwKEy2q.mjs} +5 -10
  8. package/dist/{builder-DbKYZdSy.js → builder-BKo51w-F.mjs} +32 -41
  9. package/dist/{chunk-CGaQZ11T.cjs → chunk-DDcVe30Y.cjs} +23 -24
  10. package/dist/{chunk-DJNbSFdH.js → chunk-nlSIicah.js} +8 -8
  11. package/dist/{client-BxMZiQaD.d.ts → client-AtlibPOU.d.ts} +1 -1
  12. package/dist/{client-CoCIaTNO.js → client-DEpOVgY1.mjs} +9 -13
  13. package/dist/{client-C97KOq3x.d.cts → client-z-8dc-e1.d.cts} +1 -1
  14. package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
  15. package/dist/compat/mod.cjs +5 -8
  16. package/dist/compat/mod.d.cts +78 -6
  17. package/dist/compat/mod.d.ts +78 -6
  18. package/dist/compat/mod.js +4 -8
  19. package/dist/compat/transformers.test.mjs +62 -0
  20. package/dist/{context-DyJjQQ_H.d.ts → context-BOiMZBu5.d.ts} +9 -18
  21. package/dist/{context-BcqA-0BL.d.cts → context-BhZVy7RB.d.cts} +9 -18
  22. package/dist/{context-Aqenou7c.js → context-Juj6bdHC.mjs} +7 -11
  23. package/dist/deno-D5r_9RvZ.mjs +8 -0
  24. package/dist/{docloader-Ck0SCLXX.js → docloader-B9CXCw8i.mjs} +8 -14
  25. package/dist/{esm-nLm00z9V.js → esm-DVILvP5e.mjs} +50 -89
  26. package/dist/federation/builder.test.d.mts +2 -0
  27. package/dist/federation/{builder.test.js → builder.test.mjs} +21 -44
  28. package/dist/federation/collection.test.d.mts +2 -0
  29. package/dist/federation/collection.test.mjs +21 -0
  30. package/dist/federation/handler.test.d.mts +2 -0
  31. package/dist/federation/{handler.test.js → handler.test.mjs} +69 -131
  32. package/dist/federation/idempotency.test.d.mts +2 -0
  33. package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +31 -63
  34. package/dist/federation/inbox.test.d.mts +2 -0
  35. package/dist/federation/{inbox.test.js → inbox.test.mjs} +8 -12
  36. package/dist/federation/keycache.test.d.mts +2 -0
  37. package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -19
  38. package/dist/federation/kv.test.d.mts +2 -0
  39. package/dist/federation/{kv.test.js → kv.test.mjs} +11 -22
  40. package/dist/federation/middleware.test.d.mts +2 -0
  41. package/dist/federation/{middleware.test.js → middleware.test.mjs} +173 -262
  42. package/dist/federation/mod.cjs +327 -16
  43. package/dist/federation/mod.d.cts +3 -6
  44. package/dist/federation/mod.d.ts +3 -6
  45. package/dist/federation/mod.js +322 -13
  46. package/dist/federation/mq.test.d.mts +2 -0
  47. package/dist/federation/{mq.test.js → mq.test.mjs} +21 -35
  48. package/dist/federation/negotiation.test.d.mts +2 -0
  49. package/dist/federation/{negotiation.test.js → negotiation.test.mjs} +9 -16
  50. package/dist/federation/retry.test.d.mts +2 -0
  51. package/dist/federation/{retry.test.js → retry.test.mjs} +8 -11
  52. package/dist/federation/router.test.d.mts +2 -0
  53. package/dist/federation/{router.test.js → router.test.mjs} +11 -16
  54. package/dist/federation/send.test.d.mts +2 -0
  55. package/dist/federation/{send.test.js → send.test.mjs} +22 -30
  56. package/dist/federation/webfinger.test.d.mts +2 -0
  57. package/dist/federation/{webfinger.test.js → webfinger.test.mjs} +22 -56
  58. package/dist/{http-DFzT4YFG.js → http-B53alCGi.mjs} +23 -43
  59. package/dist/{http-ca2xny58.cjs → http-BngkmEhl.cjs} +177 -302
  60. package/dist/{http-BudnHZE2.d.cts → http-CrGuipxe.d.cts} +1 -6
  61. package/dist/{http-EUQ6crVa.js → http-PS3wuU8D.js} +53 -184
  62. package/dist/{http-Dax_FIBo.d.ts → http-aQzN9Ayi.d.ts} +1 -6
  63. package/dist/{inbox-BMLz_-pL.js → inbox-CHsLu5ai.mjs} +18 -26
  64. package/dist/{key-CypuWa94.js → key-D9Np_ZXl.mjs} +29 -37
  65. package/dist/{keycache-CpGWAUbj.js → keycache-CCSwkQcY.mjs} +5 -10
  66. package/dist/{keys-BFve7QQv.js → keys-BAK-tUlf.mjs} +5 -9
  67. package/dist/{kv-BL4nlICN.d.cts → kv-CbLNp3zQ.d.cts} +1 -1
  68. package/dist/{kv-DXEUEP6z.d.ts → kv-GFYnFoOl.d.ts} +1 -1
  69. package/dist/{kv-cache-Bw2F2ABq.js → kv-cache-B01V7s3h.mjs} +4 -8
  70. package/dist/{kv-cache-SKgbvvu4.js → kv-cache-B2Qi5MGv.js} +6 -13
  71. package/dist/{kv-cache-BBJFLMW5.cjs → kv-cache-YCtINZK4.cjs} +27 -34
  72. package/dist/{kv-QzKcOQgP.js → kv-tL2TOE9X.mjs} +6 -10
  73. package/dist/{ld-CXLtTc0G.js → ld-BaxRFhDd.mjs} +17 -31
  74. package/dist/{middleware-CL6XaAFy.cjs → middleware-Bsv-7iX7.cjs} +532 -587
  75. package/dist/middleware-C37OmOz_.mjs +5 -0
  76. package/dist/middleware-CelV2xrI.cjs +4 -0
  77. package/dist/{middleware-CvS6hWm3.js → middleware-Dn1kk96N.js} +335 -382
  78. package/dist/{middleware-BHJ0xm0L.js → middleware-dFn6ozt5.mjs} +282 -317
  79. package/dist/{mod-Bx9jcLB8.d.cts → mod-B505FZBC.d.cts} +3 -3
  80. package/dist/{mod-em2Il1eD.d.cts → mod-Bp_CzKd4.d.cts} +2 -2
  81. package/dist/{mod-Cs2dYEwI.d.ts → mod-D7PAuO6k.d.ts} +3 -3
  82. package/dist/{mod-D6MdymW7.d.ts → mod-DKOAow7a.d.ts} +2 -2
  83. package/dist/{mod-Coe7KEgX.d.cts → mod-DoJBjjnO.d.cts} +2 -2
  84. package/dist/{mod-D6dOd--H.d.ts → mod-DvxszxXC.d.ts} +2 -2
  85. package/dist/mod.cjs +29 -74
  86. package/dist/mod.d.cts +11 -14
  87. package/dist/mod.d.ts +11 -15
  88. package/dist/mod.js +17 -71
  89. package/dist/{negotiation-BlAuS_nr.js → negotiation-DnsfFF8I.mjs} +7 -11
  90. package/dist/nodeinfo/client.test.d.mts +2 -0
  91. package/dist/nodeinfo/{client.test.js → client.test.mjs} +22 -40
  92. package/dist/nodeinfo/handler.test.d.mts +2 -0
  93. package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +13 -43
  94. package/dist/nodeinfo/mod.cjs +5 -8
  95. package/dist/nodeinfo/mod.d.cts +2 -3
  96. package/dist/nodeinfo/mod.d.ts +2 -3
  97. package/dist/nodeinfo/mod.js +4 -8
  98. package/dist/nodeinfo/types.test.d.mts +2 -0
  99. package/dist/nodeinfo/{types.test.js → types.test.mjs} +9 -16
  100. package/dist/otel/exporter.test.d.mts +2 -0
  101. package/dist/otel/{exporter.test.js → exporter.test.mjs} +124 -178
  102. package/dist/otel/mod.cjs +15 -20
  103. package/dist/otel/mod.d.cts +2 -2
  104. package/dist/otel/mod.d.ts +2 -2
  105. package/dist/otel/mod.js +8 -14
  106. package/dist/{owner-gd0Q9FuU.d.ts → owner-74ARJ5TL.d.ts} +1 -1
  107. package/dist/{owner-1AbPBOOZ.d.cts → owner-CptqhsOy.d.cts} +1 -1
  108. package/dist/{owner-CwMai3jn.js → owner-dxM51u36.mjs} +11 -16
  109. package/dist/{proof-ZuJBOUoi.js → proof-CH5U0k7G.mjs} +21 -33
  110. package/dist/{proof-sCID81Ua.cjs → proof-D39qiki3.cjs} +133 -157
  111. package/dist/{proof-6Zw1FW7t.js → proof-Dpgqx9RS.js} +32 -58
  112. package/dist/{retry-mqLf4b-R.js → retry-B_E3V_Dx.mjs} +4 -7
  113. package/dist/{router-D9eI0s4b.js → router-CrMLXoOr.mjs} +4 -8
  114. package/dist/runtime/mod.cjs +11 -13
  115. package/dist/runtime/mod.d.cts +6 -2
  116. package/dist/runtime/mod.d.ts +0 -1
  117. package/dist/runtime/mod.js +4 -7
  118. package/dist/{send-BW73dy6Q.js → send-D1-4ZnQq.mjs} +8 -13
  119. package/dist/sig/accept.test.d.mts +2 -0
  120. package/dist/sig/{accept.test.js → accept.test.mjs} +35 -70
  121. package/dist/sig/http.test.d.mts +2 -0
  122. package/dist/sig/{http.test.js → http.test.mjs} +166 -280
  123. package/dist/sig/key.test.d.mts +2 -0
  124. package/dist/sig/{key.test.js → key.test.mjs} +11 -18
  125. package/dist/sig/ld.test.d.mts +2 -0
  126. package/dist/sig/{ld.test.js → ld.test.mjs} +22 -35
  127. package/dist/sig/mod.cjs +6 -9
  128. package/dist/sig/mod.d.cts +3 -3
  129. package/dist/sig/mod.d.ts +3 -3
  130. package/dist/sig/mod.js +5 -9
  131. package/dist/sig/owner.test.d.mts +2 -0
  132. package/dist/sig/{owner.test.js → owner.test.mjs} +19 -34
  133. package/dist/sig/proof.test.d.mts +2 -0
  134. package/dist/sig/{proof.test.js → proof.test.mjs} +16 -27
  135. package/dist/{std__assert-X-_kMxKM.js → std__assert-Duiq_YC9.mjs} +12 -24
  136. package/dist/testing/{mod.d.ts → mod.d.mts} +26 -90
  137. package/dist/testing/mod.mjs +6 -0
  138. package/dist/{transformers-3g8GZwkZ.cjs → transformers-NeAONrAq.cjs} +20 -25
  139. package/dist/{transformers-C3FLHUd6.js → transformers-ve6e2xcg.js} +3 -7
  140. package/dist/{types-CPz01LGH.js → types-DCP0WLdt.mjs} +4 -7
  141. package/dist/{types-Cd_hszr_.cjs → types-KC4QAoxe.cjs} +29 -34
  142. package/dist/{types-C93Ob9cU.js → types-hvL8ElAs.js} +8 -13
  143. package/dist/utils/docloader.test.d.mts +2 -0
  144. package/dist/utils/{docloader.test.js → docloader.test.mjs} +14 -25
  145. package/dist/utils/kv-cache.test.d.mts +2 -0
  146. package/dist/utils/{kv-cache.test.js → kv-cache.test.mjs} +25 -40
  147. package/dist/utils/mod.cjs +5 -9
  148. package/dist/utils/mod.d.cts +1 -3
  149. package/dist/utils/mod.d.ts +1 -3
  150. package/dist/utils/mod.js +4 -9
  151. package/dist/vocab/cjs.test.d.mts +2 -0
  152. package/dist/vocab/cjs.test.mjs +14 -0
  153. package/dist/vocab/mod.cjs +10 -12
  154. package/dist/vocab/mod.js +3 -5
  155. package/package.json +8 -8
  156. package/dist/compat/transformers.test.d.ts +0 -3
  157. package/dist/compat/transformers.test.js +0 -88
  158. package/dist/compat-Bb4NuTUO.js +0 -4
  159. package/dist/compat-DmDDELst.cjs +0 -4
  160. package/dist/deno-DH972JvX.js +0 -121
  161. package/dist/federation/builder.test.d.ts +0 -3
  162. package/dist/federation/collection.test.d.ts +0 -3
  163. package/dist/federation/collection.test.js +0 -32
  164. package/dist/federation/handler.test.d.ts +0 -3
  165. package/dist/federation/idempotency.test.d.ts +0 -3
  166. package/dist/federation/inbox.test.d.ts +0 -3
  167. package/dist/federation/keycache.test.d.ts +0 -3
  168. package/dist/federation/kv.test.d.ts +0 -3
  169. package/dist/federation/middleware.test.d.ts +0 -3
  170. package/dist/federation/mq.test.d.ts +0 -3
  171. package/dist/federation/negotiation.test.d.ts +0 -3
  172. package/dist/federation/retry.test.d.ts +0 -3
  173. package/dist/federation/router.test.d.ts +0 -3
  174. package/dist/federation/send.test.d.ts +0 -3
  175. package/dist/federation/webfinger.test.d.ts +0 -3
  176. package/dist/federation-Bp3HI26G.cjs +0 -350
  177. package/dist/federation-DaMfqRm4.js +0 -332
  178. package/dist/middleware-B8FJuMM0.js +0 -27
  179. package/dist/middleware-BVp930fR.js +0 -12
  180. package/dist/middleware-BvGP-uXy.cjs +0 -12
  181. package/dist/mod-B7QkWzrL.d.cts +0 -80
  182. package/dist/mod-Bh8mqlYw.d.cts +0 -9
  183. package/dist/mod-D6HodEq7.d.ts +0 -7
  184. package/dist/mod-SMHOMNpZ.d.ts +0 -82
  185. package/dist/mod-gq_Xfdz8.d.cts +0 -1
  186. package/dist/nodeinfo/client.test.d.ts +0 -3
  187. package/dist/nodeinfo/handler.test.d.ts +0 -3
  188. package/dist/nodeinfo/types.test.d.ts +0 -3
  189. package/dist/nodeinfo-DoESQxq5.js +0 -4
  190. package/dist/nodeinfo-DuMYTpbZ.cjs +0 -4
  191. package/dist/otel/exporter.test.d.ts +0 -3
  192. package/dist/runtime-c2Njxsry.cjs +0 -17
  193. package/dist/runtime-poamPCMb.js +0 -13
  194. package/dist/sig/accept.test.d.ts +0 -3
  195. package/dist/sig/http.test.d.ts +0 -3
  196. package/dist/sig/key.test.d.ts +0 -3
  197. package/dist/sig/ld.test.d.ts +0 -3
  198. package/dist/sig/owner.test.d.ts +0 -3
  199. package/dist/sig/proof.test.d.ts +0 -3
  200. package/dist/sig-BNhspNOf.js +0 -4
  201. package/dist/sig-vX39WyWI.cjs +0 -4
  202. package/dist/testing/mod.js +0 -10
  203. package/dist/utils/docloader.test.d.ts +0 -3
  204. package/dist/utils/kv-cache.test.d.ts +0 -3
  205. package/dist/utils-BQ9KqEK9.cjs +0 -4
  206. package/dist/utils-Dn5OPdSW.js +0 -4
  207. /package/dist/{mod-AGjRfPjT.d.ts → compat/transformers.test.d.mts} +0 -0
@@ -1,40 +1,14 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
- import "../assert-MZs1qjMx.js";
8
- import "../assert_instance_of-DHz7EHNU.js";
9
- import { MemoryKvStore } from "../kv-QzKcOQgP.js";
10
- import "../deno-DH972JvX.js";
11
- import { createFederation } from "../middleware-BHJ0xm0L.js";
12
- import "../client-CoCIaTNO.js";
13
- import "../router-D9eI0s4b.js";
14
- import "../types-CPz01LGH.js";
15
- import "../accept-D7sAxyNa.js";
16
- import "../key-CypuWa94.js";
17
- import "../http-DFzT4YFG.js";
18
- import "../ld-CXLtTc0G.js";
19
- import "../owner-CwMai3jn.js";
20
- import { signObject } from "../proof-ZuJBOUoi.js";
21
- import "../docloader-Ck0SCLXX.js";
22
- import "../kv-cache-Bw2F2ABq.js";
23
- import "../inbox-BMLz_-pL.js";
24
- import "../builder-DbKYZdSy.js";
25
- import "../collection-CSzG2j1P.js";
26
- import "../keycache-CpGWAUbj.js";
27
- import "../negotiation-BlAuS_nr.js";
28
- import "../retry-mqLf4b-R.js";
29
- import "../send-BW73dy6Q.js";
30
- import "../std__assert-X-_kMxKM.js";
31
- import "../assert_rejects-0h7I2Esa.js";
32
- import "../assert_throws-rjdMBf31.js";
33
- import "../assert_not_equals-f3m3epl3.js";
34
- import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-BFve7QQv.js";
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
+ import "../std__assert-Duiq_YC9.mjs";
6
+ import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
7
+ import { n as signObject } from "../proof-CH5U0k7G.mjs";
8
+ import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
9
+ import { a as createFederation } from "../middleware-dFn6ozt5.mjs";
35
10
  import { mockDocumentLoader, test } from "@fedify/fixture";
36
11
  import { Create, Follow, Person } from "@fedify/vocab";
37
-
38
12
  //#region src/federation/idempotency.test.ts
39
13
  const kv = new MemoryKvStore();
40
14
  const federationOptions = {
@@ -53,14 +27,13 @@ function createTestFederation() {
53
27
  test("Federation.setInboxListeners().withIdempotency() - per-origin strategy", async () => {
54
28
  const federation = createTestFederation();
55
29
  const processedActivities = [];
56
- federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("per-origin").on(Create, (ctx, activity$1) => {
57
- processedActivities.push([ctx.recipient, activity$1]);
30
+ federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("per-origin").on(Create, (ctx, activity) => {
31
+ processedActivities.push([ctx.recipient, activity]);
58
32
  });
59
- const activity = new Create({
33
+ const signedActivity = await signObject(new Create({
60
34
  id: new URL("https://example.com/activities/1"),
61
35
  actor: new URL("https://example.com/person2")
62
- });
63
- const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
36
+ }), ed25519PrivateKey, ed25519Multikey.id);
64
37
  const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
65
38
  let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
66
39
  method: "POST",
@@ -86,14 +59,13 @@ test("Federation.setInboxListeners().withIdempotency() - per-origin strategy", a
86
59
  test("Federation.setInboxListeners().withIdempotency() - per-inbox strategy", async () => {
87
60
  const federation = createTestFederation();
88
61
  const processedActivities = [];
89
- federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("per-inbox").on(Create, (ctx, activity$1) => {
90
- processedActivities.push([ctx.recipient, activity$1]);
62
+ federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("per-inbox").on(Create, (ctx, activity) => {
63
+ processedActivities.push([ctx.recipient, activity]);
91
64
  });
92
- const activity = new Create({
65
+ const signedActivity = await signObject(new Create({
93
66
  id: new URL("https://example.com/activities/2"),
94
67
  actor: new URL("https://example.com/person2")
95
- });
96
- const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
68
+ }), ed25519PrivateKey, ed25519Multikey.id);
97
69
  const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
98
70
  let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
99
71
  method: "POST",
@@ -122,14 +94,13 @@ test("Federation.setInboxListeners().withIdempotency() - per-inbox strategy", as
122
94
  test("Federation.setInboxListeners().withIdempotency() - global strategy", async () => {
123
95
  const federation = createTestFederation();
124
96
  const processedActivities = [];
125
- federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("global").on(Create, (ctx, activity$1) => {
126
- processedActivities.push([ctx.recipient, activity$1]);
97
+ federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("global").on(Create, (ctx, activity) => {
98
+ processedActivities.push([ctx.recipient, activity]);
127
99
  });
128
- const activity = new Create({
100
+ const signedActivity = await signObject(new Create({
129
101
  id: new URL("https://example.com/activities/3"),
130
102
  actor: new URL("https://example.com/person2")
131
- });
132
- const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
103
+ }), ed25519PrivateKey, ed25519Multikey.id);
133
104
  const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
134
105
  let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
135
106
  method: "POST",
@@ -158,11 +129,10 @@ test("Federation.setInboxListeners().withIdempotency() - custom callback", async
158
129
  }).on(Follow, (ctx, activity) => {
159
130
  processedActivities.push([ctx.recipient, activity]);
160
131
  });
161
- const createActivity = new Create({
132
+ const signedCreate = await signObject(new Create({
162
133
  id: new URL("https://example.com/activities/4"),
163
134
  actor: new URL("https://example.com/person2")
164
- });
165
- const signedCreate = await signObject(createActivity, ed25519PrivateKey, ed25519Multikey.id);
135
+ }), ed25519PrivateKey, ed25519Multikey.id);
166
136
  const createBody = JSON.stringify(await signedCreate.toJsonLd({ contextLoader: mockDocumentLoader }));
167
137
  let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
168
138
  method: "POST",
@@ -178,11 +148,10 @@ test("Federation.setInboxListeners().withIdempotency() - custom callback", async
178
148
  }), { contextData: void 0 });
179
149
  assertEquals(response.status, 202);
180
150
  assertEquals(processedActivities.length, 1);
181
- const followActivity = new Follow({
151
+ const signedFollow = await signObject(new Follow({
182
152
  id: new URL("https://example.com/activities/5"),
183
153
  actor: new URL("https://example.com/person2")
184
- });
185
- const signedFollow = await signObject(followActivity, ed25519PrivateKey, ed25519Multikey.id);
154
+ }), ed25519PrivateKey, ed25519Multikey.id);
186
155
  const followBody = JSON.stringify(await signedFollow.toJsonLd({ contextLoader: mockDocumentLoader }));
187
156
  response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
188
157
  method: "POST",
@@ -202,14 +171,13 @@ test("Federation.setInboxListeners().withIdempotency() - custom callback", async
202
171
  test("Federation.setInboxListeners() - default strategy is per-inbox", async () => {
203
172
  const federation = createTestFederation();
204
173
  const processedActivities = [];
205
- federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").on(Create, (ctx, activity$1) => {
206
- processedActivities.push([ctx.recipient, activity$1]);
174
+ federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").on(Create, (ctx, activity) => {
175
+ processedActivities.push([ctx.recipient, activity]);
207
176
  });
208
- const activity = new Create({
177
+ const signedActivity = await signObject(new Create({
209
178
  id: new URL("https://example.com/activities/6"),
210
179
  actor: new URL("https://example.com/person2")
211
- });
212
- const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
180
+ }), ed25519PrivateKey, ed25519Multikey.id);
213
181
  const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
214
182
  let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
215
183
  method: "POST",
@@ -235,5 +203,5 @@ test("Federation.setInboxListeners() - default strategy is per-inbox", async ()
235
203
  assertEquals(response.status, 202);
236
204
  assertEquals(processedActivities.length, 2);
237
205
  });
238
-
239
- //#endregion
206
+ //#endregion
207
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -1,15 +1,11 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
- import "../deno-DH972JvX.js";
8
- import { InboxListenerSet } from "../inbox-BMLz_-pL.js";
9
- import { assertThrows } from "../assert_throws-rjdMBf31.js";
1
+ import "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
+ import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
6
+ import { t as InboxListenerSet } from "../inbox-CHsLu5ai.mjs";
10
7
  import { test } from "@fedify/fixture";
11
8
  import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
12
-
13
9
  //#region src/federation/inbox.test.ts
14
10
  test("InboxListenerSet", () => {
15
11
  const listeners = new InboxListenerSet();
@@ -86,5 +82,5 @@ test("InboxListenerSet", () => {
86
82
  });
87
83
  assertThrows(() => listeners.add(Activity, listenActivity), TypeError, "Listener already set for this type.");
88
84
  });
89
-
90
- //#endregion
85
+ //#endregion
86
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -1,16 +1,13 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
- import { assert } from "../assert-MZs1qjMx.js";
8
- import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
9
- import { MemoryKvStore } from "../kv-QzKcOQgP.js";
10
- import { KvKeyCache } from "../keycache-CpGWAUbj.js";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
+ import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
+ import { t as assert } from "../assert-ddO5KLpe.mjs";
7
+ import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
+ import { t as KvKeyCache } from "../keycache-CCSwkQcY.mjs";
11
9
  import { test } from "@fedify/fixture";
12
10
  import { CryptographicKey, Multikey } from "@fedify/vocab";
13
-
14
11
  //#region src/federation/keycache.test.ts
15
12
  test("KvKeyCache.set()", async () => {
16
13
  const kv = new MemoryKvStore();
@@ -53,12 +50,10 @@ test("KvKeyCache.get()", async () => {
53
50
  cache.nullKeys.set("https://example.com/null", Temporal.Now.instant().add(Temporal.Duration.from({ minutes: 10 })));
54
51
  assertEquals(await cache.get(new URL("https://example.com/null")), null);
55
52
  await kv.set(["pk", "https://example.com/null2"], null);
56
- const cache2 = new KvKeyCache(kv, ["pk"]);
57
- assertEquals(await cache2.get(new URL("https://example.com/null2")), null);
53
+ assertEquals(await new KvKeyCache(kv, ["pk"]).get(new URL("https://example.com/null2")), null);
58
54
  });
59
55
  test("KvKeyCache fetch error metadata", async () => {
60
- const kv = new MemoryKvStore();
61
- const cache = new KvKeyCache(kv, ["pk"]);
56
+ const cache = new KvKeyCache(new MemoryKvStore(), ["pk"]);
62
57
  const keyId = new URL("https://example.com/key");
63
58
  await cache.setFetchError(keyId, {
64
59
  status: 410,
@@ -84,8 +79,7 @@ test("KvKeyCache fetch error metadata", async () => {
84
79
  assertEquals(await cache.getFetchError(keyId), void 0);
85
80
  });
86
81
  test("KvKeyCache unavailable entries expire", async () => {
87
- const kv = new MemoryKvStore();
88
- const cache = new KvKeyCache(kv, ["pk"], { unavailableKeyTtl: Temporal.Duration.from({ milliseconds: 1 }) });
82
+ const cache = new KvKeyCache(new MemoryKvStore(), ["pk"], { unavailableKeyTtl: Temporal.Duration.from({ milliseconds: 1 }) });
89
83
  const keyId = new URL("https://example.com/expired");
90
84
  await cache.set(keyId, null);
91
85
  await cache.setFetchError(keyId, {
@@ -96,5 +90,5 @@ test("KvKeyCache unavailable entries expire", async () => {
96
90
  assertEquals(await cache.get(keyId), void 0);
97
91
  assertEquals(await cache.getFetchError(keyId), void 0);
98
92
  });
99
-
100
- //#endregion
93
+ //#endregion
94
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -1,18 +1,10 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { assertEquals } from "../assert_equals-DSbWqCm3.js";
7
- import "../assert-MZs1qjMx.js";
8
- import "../assert_instance_of-DHz7EHNU.js";
9
- import { MemoryKvStore } from "../kv-QzKcOQgP.js";
10
- import "../std__assert-X-_kMxKM.js";
11
- import "../assert_rejects-0h7I2Esa.js";
12
- import "../assert_throws-rjdMBf31.js";
13
- import "../assert_not_equals-f3m3epl3.js";
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
+ import "../std__assert-Duiq_YC9.mjs";
6
+ import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
14
7
  import { test } from "@fedify/fixture";
15
-
16
8
  //#region src/federation/kv.test.ts
17
9
  test("MemoryKvStore", async (t) => {
18
10
  const store = new MemoryKvStore();
@@ -52,10 +44,8 @@ test("MemoryKvStore", async (t) => {
52
44
  await store.set(["prefix"], "exact-match");
53
45
  const entries = await Array.fromAsync(store.list(["prefix"]));
54
46
  assertEquals(entries.length, 4);
55
- const entryA = entries.find((e) => e.key.length === 2 && e.key[1] === "a");
56
- assertEquals(entryA?.value, "value-a");
57
- const noMatch = await Array.fromAsync(store.list(["nonexistent"]));
58
- assertEquals(noMatch.length, 0);
47
+ assertEquals(entries.find((e) => e.key.length === 2 && e.key[1] === "a")?.value, "value-a");
48
+ assertEquals((await Array.fromAsync(store.list(["nonexistent"]))).length, 0);
59
49
  await store.delete(["prefix", "a"]);
60
50
  await store.delete(["prefix", "b"]);
61
51
  await store.delete([
@@ -84,8 +74,7 @@ test("MemoryKvStore", async (t) => {
84
74
  "e",
85
75
  "f"
86
76
  ], "value-def");
87
- const entries = await Array.fromAsync(store.list());
88
- assertEquals(entries.length, 3);
77
+ assertEquals((await Array.fromAsync(store.list())).length, 3);
89
78
  await store.delete(["a"]);
90
79
  await store.delete(["b", "c"]);
91
80
  await store.delete([
@@ -95,5 +84,5 @@ test("MemoryKvStore", async (t) => {
95
84
  ]);
96
85
  });
97
86
  });
98
-
99
- //#endregion
87
+ //#endregion
88
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";