@fedify/fedify 2.4.0-dev.1666 → 2.4.0-dev.1727

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 (150) hide show
  1. package/README.md +1 -1
  2. package/dist/{assert-CJ1KXcvv.mjs → assert-CebeUf0C.mjs} +1 -1
  3. package/dist/assert_exists-DtzkXC47.mjs +28 -0
  4. package/dist/assert_false-3pLLLsO4.mjs +23 -0
  5. package/dist/assert_greater_or_equal-BApOTh1h.mjs +30 -0
  6. package/dist/{assert_instance_of-Q9KTBnrf.mjs → assert_instance_of-g3WcyYNR.mjs} +1 -1
  7. package/dist/{assert_not_equals-EPJPoxuf.mjs → assert_not_equals-BN7yDMWe.mjs} +1 -1
  8. package/dist/assert_rejects-wFbSPn1O.mjs +39 -0
  9. package/dist/{assert_strict_equals-Ec20AUwa.mjs → assert_strict_equals-Bpjl4Psw.mjs} +1 -1
  10. package/dist/{assert_throws-NiFfqbnH.mjs → assert_throws-BJ5wuvR2.mjs} +1 -1
  11. package/dist/{builder-BGpBs-US.mjs → builder-f5-YwHfj.mjs} +5 -3
  12. package/dist/{circuit-breaker-CBGyz5F7.mjs → circuit-breaker-BT7CiPbz.mjs} +191 -9
  13. package/dist/circuit-breaker-test-utils-BYIHoliq.mjs +14 -0
  14. package/dist/{client-CjF5IYQS.mjs → client-CtxvmazV.mjs} +63 -5
  15. package/dist/{collection-BIhlldqK.mjs → collection-CnnP1UAv.mjs} +1 -1
  16. package/dist/compat/mod.cjs +1 -1
  17. package/dist/compat/mod.d.cts +1 -1
  18. package/dist/compat/mod.d.ts +1 -1
  19. package/dist/compat/mod.js +1 -1
  20. package/dist/compat/outgoing-jsonld.test.mjs +3 -3
  21. package/dist/compat/public-audience.test.mjs +3 -3
  22. package/dist/compat/transformers.test.mjs +5 -5
  23. package/dist/{context-C05Rgxmu.d.cts → context-B-dsBjZ9.d.cts} +281 -7
  24. package/dist/{context-Cjnr0ig1.d.ts → context-DrLXudbA.d.ts} +281 -7
  25. package/dist/{deno-CaQlEENR.mjs → deno-Deyoxesx.mjs} +1 -1
  26. package/dist/{docloader-CTm2Lcpn.mjs → docloader-B3kuDBg9.mjs} +2 -2
  27. package/dist/{esm-yYQfPhIY.mjs → esm-BHXXx4Wx.mjs} +13 -6
  28. package/dist/federation/builder.test.mjs +18 -5
  29. package/dist/federation/circuit-breaker.test.mjs +626 -7
  30. package/dist/federation/collection.test.mjs +3 -3
  31. package/dist/federation/handler.test.mjs +14 -13
  32. package/dist/federation/idempotency.test.mjs +6 -6
  33. package/dist/federation/inbox.test.mjs +3 -3
  34. package/dist/federation/keycache.test.mjs +5 -5
  35. package/dist/federation/kv.test.mjs +3 -3
  36. package/dist/federation/metrics.test.mjs +4 -4
  37. package/dist/federation/middleware.test.mjs +37 -28
  38. package/dist/federation/mod.cjs +18 -540
  39. package/dist/federation/mod.d.cts +3 -4
  40. package/dist/federation/mod.d.ts +3 -4
  41. package/dist/federation/mod.js +1 -1
  42. package/dist/federation/mq.test.mjs +32 -5
  43. package/dist/federation/negotiation.test.mjs +4 -4
  44. package/dist/federation/retry.test.mjs +3 -3
  45. package/dist/federation/router.test.mjs +7 -7
  46. package/dist/federation/send.test.mjs +28 -26
  47. package/dist/federation/tasks/codec.test.mjs +4 -4
  48. package/dist/federation/tasks/enqueue.test.mjs +4 -4
  49. package/dist/federation/tasks/tasks.test.mjs +6 -6
  50. package/dist/federation/temporal.test.mjs +4 -4
  51. package/dist/federation/webfinger.test.mjs +74 -12
  52. package/dist/{middleware-Dnzqy4sk.cjs → federation-BzRjeOky.cjs} +855 -114
  53. package/dist/{temporal-polyfill-BCdTHexd.cjs → http-AyKngJ_h.cjs} +2801 -104
  54. package/dist/{http-BX5xiNUh.js → http-Bw6s_dOB.js} +3 -3
  55. package/dist/{http-BaSuRiWJ.mjs → http-TjhZfiSN.mjs} +5 -5
  56. package/dist/{key-BvJYxJoY.mjs → key-b4kf4yZT.mjs} +2 -2
  57. package/dist/{kv-cache-BPapnm-V.cjs → kv-cache-BTVaZrf-.cjs} +2 -4
  58. package/dist/{kv-cache-C04NtL2n.js → kv-cache-CQsh-KUw.js} +1 -1
  59. package/dist/{kv-cache-B9fTkVpc.mjs → kv-cache-CpILvhUV.mjs} +1 -1
  60. package/dist/{ld-DU12IAt8.mjs → ld-CKujkAfG.mjs} +5 -5
  61. package/dist/{metrics-BYUxSscw.mjs → metrics-AlCGTDrr.mjs} +2 -2
  62. package/dist/metrics-DVKYY6K1.d.cts +36 -0
  63. package/dist/metrics-DoRtI0qU.d.ts +36 -0
  64. package/dist/{middleware-BEd40QBF.mjs → middleware-C9Y5lLZN.mjs} +60 -43
  65. package/dist/{middleware-_VQWtF1B.js → middleware-CZcuedl-.js} +241 -40
  66. package/dist/{middleware-C4oS_tdq.mjs → middleware-LPbZz6-1.mjs} +1 -1
  67. package/dist/{mod-BrpVsSfY.d.cts → mod-CLHkCwLm.d.cts} +3 -3
  68. package/dist/{mod-B0hW12_O.d.cts → mod-CuDDaIIt.d.cts} +1 -1
  69. package/dist/{mod-COIAjwRS.d.ts → mod-D-IhOEOP.d.ts} +1 -1
  70. package/dist/{mod-DdONo-ep.d.cts → mod-D-abvu2C.d.cts} +1 -1
  71. package/dist/{mod-BsCE5Ihq.d.ts → mod-D6O8C7eN.d.ts} +1 -1
  72. package/dist/{mod-CNef4in0.d.ts → mod-DypxPS9H.d.ts} +3 -3
  73. package/dist/mod.cjs +24 -25
  74. package/dist/mod.d.cts +8 -9
  75. package/dist/mod.d.ts +8 -9
  76. package/dist/mod.js +7 -7
  77. package/dist/nodeinfo/client.test.mjs +64 -4
  78. package/dist/nodeinfo/handler.test.mjs +5 -5
  79. package/dist/nodeinfo/mod.cjs +1 -1
  80. package/dist/nodeinfo/mod.d.cts +1 -1
  81. package/dist/nodeinfo/mod.d.ts +1 -1
  82. package/dist/nodeinfo/mod.js +1 -1
  83. package/dist/nodeinfo/types.test.mjs +4 -4
  84. package/dist/otel/exporter.test.mjs +3 -3
  85. package/dist/otel/mod.cjs +0 -1
  86. package/dist/otel/mod.d.cts +1 -1
  87. package/dist/otel/mod.d.ts +1 -1
  88. package/dist/{outgoing-jsonld-URuqsICz.mjs → outgoing-jsonld-BQSHRLhg.mjs} +2 -2
  89. package/dist/{owner-DFF9ltAs.mjs → owner-D1O8v8FB.mjs} +2 -2
  90. package/dist/{proof-rOoEb_P4.js → proof-BTBolSnd.js} +6 -6
  91. package/dist/{proof-DcbeTQMG.cjs → proof-DcSm-2eG.cjs} +10 -11
  92. package/dist/{proof-DEV-fO9I.mjs → proof-DeMR7Akd.mjs} +6 -6
  93. package/dist/{public-audience-Cr5MsnMq.mjs → public-audience--9hx7IGx.mjs} +1 -1
  94. package/dist/runtime/mod.cjs +1 -1
  95. package/dist/runtime/mod.js +1 -1
  96. package/dist/{send-BVkabUz0.mjs → send-DG7JG280.mjs} +3 -3
  97. package/dist/sig/accept.test.mjs +1 -1
  98. package/dist/sig/http.test.mjs +37 -11
  99. package/dist/sig/key.test.mjs +6 -6
  100. package/dist/sig/ld.test.mjs +9 -7
  101. package/dist/sig/mod.cjs +2 -2
  102. package/dist/sig/mod.d.cts +3 -3
  103. package/dist/sig/mod.d.ts +3 -3
  104. package/dist/sig/mod.js +2 -2
  105. package/dist/sig/owner.test.mjs +6 -6
  106. package/dist/sig/proof.test.mjs +10 -8
  107. package/dist/std__assert-CxFT0MNt.mjs +8 -0
  108. package/dist/{temporal-X0BllGgC.mjs → temporal-DA3jx8x1.mjs} +3 -3
  109. package/dist/testing/mod.d.mts +10 -0
  110. package/dist/testing/mod.mjs +2 -2
  111. package/dist/{testing-CO7ftO8A.mjs → testing-BX0Nicyq.mjs} +2 -2
  112. package/dist/{transformers-DGwl-hD1.cjs → transformers-BalCrSsr.cjs} +0 -1
  113. package/dist/{types-DC1pNgJA.js → types-Dtyf8lVj.js} +63 -5
  114. package/dist/{types-CPym83zc.cjs → types-RXm5YxpC.cjs} +62 -5
  115. package/dist/utils/docloader.test.mjs +7 -7
  116. package/dist/utils/kv-cache.test.mjs +1 -1
  117. package/dist/utils/mod.cjs +1 -1
  118. package/dist/utils/mod.d.cts +1 -1
  119. package/dist/utils/mod.d.ts +1 -1
  120. package/dist/utils/mod.js +1 -1
  121. package/package.json +7 -7
  122. package/skills/fedify/SKILL.md +462 -0
  123. package/dist/assert_rejects-EgstcQy5.mjs +0 -82
  124. package/dist/http-BIJdA1mF.cjs +0 -2694
  125. package/dist/metrics-DN13mCAw.d.cts +0 -294
  126. package/dist/metrics-v_e0n5GQ.d.ts +0 -294
  127. package/dist/std__assert-B2NnY9bq.mjs +0 -79
  128. /package/dist/{accept-8PiolDP7.mjs → accept-CPVqki78.mjs} +0 -0
  129. /package/dist/{activity-listener-BtTSxZWA.mjs → activity-listener-C-BSbKI7.mjs} +0 -0
  130. /package/dist/{assert_equals-BV7oLMxm.mjs → assert_equals-CBlRfA-_.mjs} +0 -0
  131. /package/dist/{client-CAM_bQXx.d.cts → client-D-XP_Ccb.d.cts} +0 -0
  132. /package/dist/{client-CSddvgWN.d.ts → client-D-XP_Ccb.d.ts} +0 -0
  133. /package/dist/{codec-BBga-FWI.mjs → codec-peqOdBaE.mjs} +0 -0
  134. /package/dist/{context-BJXxPElm.mjs → context-Dt36KFEJ.mjs} +0 -0
  135. /package/dist/{http-VyDTd4G3.d.cts → http-6TI0tI03.d.cts} +0 -0
  136. /package/dist/{http-lf8Hsd91.d.ts → http-CdrSn2ip.d.ts} +0 -0
  137. /package/dist/{keycache-_DHqz5z_.mjs → keycache-0Jk78XmB.mjs} +0 -0
  138. /package/dist/{keys-Dbyd7bhl.mjs → keys-DIJNHW-Y.mjs} +0 -0
  139. /package/dist/{kv-D6hNiMTK.d.ts → kv-BhNbN8Ed.d.cts} +0 -0
  140. /package/dist/{kv-gJ8LYbxX.d.cts → kv-BhNbN8Ed.d.ts} +0 -0
  141. /package/dist/{kv-CXBAok3k.mjs → kv-DCHkaJ9-.mjs} +0 -0
  142. /package/dist/{mq-Bo7Etgh6.mjs → mq-Dm1Wmtm-.mjs} +0 -0
  143. /package/dist/{negotiation-RuwrPFqi.mjs → negotiation-CCocWT_N.mjs} +0 -0
  144. /package/dist/{owner-CnngXDNJ.d.ts → owner-DGSfntI-.d.ts} +0 -0
  145. /package/dist/{owner-DEvZuyOE.d.cts → owner-r_waTiQj.d.cts} +0 -0
  146. /package/dist/{retry-DgFqeS5k.mjs → retry-zX5xw5e0.mjs} +0 -0
  147. /package/dist/{chunk-D5IdezsZ.js → rolldown-runtime-BC-Eo5Mj.js} +0 -0
  148. /package/dist/{chunk-Czpeue4M.cjs → rolldown-runtime-Dmm3t92W.cjs} +0 -0
  149. /package/dist/{transformers-DXze6FUB.js → transformers-DAtXl_Kc.js} +0 -0
  150. /package/dist/{types-CrtdVuDP.mjs → types-DE_LV1JB.mjs} +0 -0
@@ -1,10 +1,10 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import "../std__assert-B2NnY9bq.mjs";
5
- import { r as assertFalse } from "../assert_rejects-EgstcQy5.mjs";
6
- import { t as assert } from "../assert-CJ1KXcvv.mjs";
7
- import { t as acceptsJsonLd } from "../negotiation-RuwrPFqi.mjs";
4
+ import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
5
+ import "../std__assert-CxFT0MNt.mjs";
6
+ import { t as assert } from "../assert-CebeUf0C.mjs";
7
+ import { t as acceptsJsonLd } from "../negotiation-CCocWT_N.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/negotiation.test.ts
10
10
  test("acceptsJsonLd()", () => {
@@ -1,9 +1,9 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError, t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
5
- import { t as assertNotEquals } from "../assert_not_equals-EPJPoxuf.mjs";
6
- import { t as createExponentialBackoffPolicy } from "../retry-DgFqeS5k.mjs";
4
+ import { l as AssertionError, t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
5
+ import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
6
+ import { t as createExponentialBackoffPolicy } from "../retry-zX5xw5e0.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/federation/retry.test.ts
9
9
  test("createExponentialBackoffPolicy()", () => {
@@ -1,11 +1,11 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
5
- import "../std__assert-B2NnY9bq.mjs";
6
- import { r as assertFalse } from "../assert_rejects-EgstcQy5.mjs";
7
- import { t as assertThrows } from "../assert_throws-NiFfqbnH.mjs";
8
- import { t as assert } from "../assert-CJ1KXcvv.mjs";
4
+ import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
5
+ import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
6
+ import { t as assertThrows } from "../assert_throws-BJ5wuvR2.mjs";
7
+ import "../std__assert-CxFT0MNt.mjs";
8
+ import { t as assert } from "../assert-CebeUf0C.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { Router, RouterError, assertPath, isPath } from "@fedify/uri-template";
11
11
  import { test } from "@fedify/fixture";
@@ -182,8 +182,8 @@ test("Router.clone()", () => {
182
182
  test("Router.add()", () => {
183
183
  const router = new Router$1();
184
184
  assertEquals(router.add("/users", "users"), /* @__PURE__ */ new Set());
185
- assertEquals(router.add("/users/{name}", "user"), new Set(["name"]));
186
- assertEquals(router.add("/users/{name}/posts/{postId}", "post"), new Set(["name", "postId"]));
185
+ assertEquals(router.add("/users/{name}", "user"), /* @__PURE__ */ new Set(["name"]));
186
+ assertEquals(router.add("/users/{name}/posts/{postId}", "post"), /* @__PURE__ */ new Set(["name", "postId"]));
187
187
  assertThrows(() => router.add("foo", "name"), RouterError$1);
188
188
  });
189
189
  test("Router.route()", () => {
@@ -1,17 +1,19 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as esm_default } from "../esm-yYQfPhIY.mjs";
5
- import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
6
- import "../std__assert-B2NnY9bq.mjs";
7
- import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-EgstcQy5.mjs";
8
- import { t as assertInstanceOf } from "../assert_instance_of-Q9KTBnrf.mjs";
9
- import { t as assertNotEquals } from "../assert_not_equals-EPJPoxuf.mjs";
10
- import { t as assert } from "../assert-CJ1KXcvv.mjs";
11
- import { l as verifyRequest } from "../http-BaSuRiWJ.mjs";
12
- import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Dbyd7bhl.mjs";
13
- import { t as doesActorOwnKey } from "../owner-DFF9ltAs.mjs";
14
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-BVkabUz0.mjs";
4
+ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
5
+ import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
6
+ import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
7
+ import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BApOTh1h.mjs";
8
+ import { t as assertInstanceOf } from "../assert_instance_of-g3WcyYNR.mjs";
9
+ import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
10
+ import "../std__assert-CxFT0MNt.mjs";
11
+ import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
12
+ import { t as assert } from "../assert-CebeUf0C.mjs";
13
+ import { l as verifyRequest } from "../http-TjhZfiSN.mjs";
14
+ import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
15
+ import { t as doesActorOwnKey } from "../owner-D1O8v8FB.mjs";
16
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-DG7JG280.mjs";
15
17
  import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
16
18
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
17
19
  import { FetchError } from "@fedify/vocab-runtime";
@@ -42,19 +44,19 @@ test("extractInboxes()", () => {
42
44
  let inboxes = extractInboxes({ recipients });
43
45
  assertEquals(inboxes, {
44
46
  "https://example.com/alice/inbox": {
45
- actorIds: new Set(["https://example.com/alice"]),
47
+ actorIds: /* @__PURE__ */ new Set(["https://example.com/alice"]),
46
48
  sharedInbox: false
47
49
  },
48
50
  "https://example.com/app/inbox": {
49
- actorIds: new Set(["https://example.com/app"]),
51
+ actorIds: /* @__PURE__ */ new Set(["https://example.com/app"]),
50
52
  sharedInbox: false
51
53
  },
52
54
  "https://example.org/group/inbox": {
53
- actorIds: new Set(["https://example.org/group"]),
55
+ actorIds: /* @__PURE__ */ new Set(["https://example.org/group"]),
54
56
  sharedInbox: false
55
57
  },
56
58
  "https://example.net/service/inbox": {
57
- actorIds: new Set(["https://example.net/service"]),
59
+ actorIds: /* @__PURE__ */ new Set(["https://example.net/service"]),
58
60
  sharedInbox: false
59
61
  }
60
62
  });
@@ -64,15 +66,15 @@ test("extractInboxes()", () => {
64
66
  });
65
67
  assertEquals(inboxes, {
66
68
  "https://example.com/inbox": {
67
- actorIds: new Set(["https://example.com/alice", "https://example.com/app"]),
69
+ actorIds: /* @__PURE__ */ new Set(["https://example.com/alice", "https://example.com/app"]),
68
70
  sharedInbox: true
69
71
  },
70
72
  "https://example.org/group/inbox": {
71
- actorIds: new Set(["https://example.org/group"]),
73
+ actorIds: /* @__PURE__ */ new Set(["https://example.org/group"]),
72
74
  sharedInbox: false
73
75
  },
74
76
  "https://example.net/inbox": {
75
- actorIds: new Set(["https://example.net/service"]),
77
+ actorIds: /* @__PURE__ */ new Set(["https://example.net/service"]),
76
78
  sharedInbox: true
77
79
  }
78
80
  });
@@ -82,19 +84,19 @@ test("extractInboxes()", () => {
82
84
  });
83
85
  assertEquals(inboxes, {
84
86
  "https://example.com/alice/inbox": {
85
- actorIds: new Set(["https://example.com/alice"]),
87
+ actorIds: /* @__PURE__ */ new Set(["https://example.com/alice"]),
86
88
  sharedInbox: false
87
89
  },
88
90
  "https://example.com/app/inbox": {
89
- actorIds: new Set(["https://example.com/app"]),
91
+ actorIds: /* @__PURE__ */ new Set(["https://example.com/app"]),
90
92
  sharedInbox: false
91
93
  },
92
94
  "https://example.org/group/inbox": {
93
- actorIds: new Set(["https://example.org/group"]),
95
+ actorIds: /* @__PURE__ */ new Set(["https://example.org/group"]),
94
96
  sharedInbox: false
95
97
  },
96
98
  "https://example.net/service/inbox": {
97
- actorIds: new Set(["https://example.net/service"]),
99
+ actorIds: /* @__PURE__ */ new Set(["https://example.net/service"]),
98
100
  sharedInbox: false
99
101
  }
100
102
  });
@@ -104,11 +106,11 @@ test("extractInboxes()", () => {
104
106
  });
105
107
  assertEquals(inboxes, {
106
108
  "https://example.org/group/inbox": {
107
- actorIds: new Set(["https://example.org/group"]),
109
+ actorIds: /* @__PURE__ */ new Set(["https://example.org/group"]),
108
110
  sharedInbox: false
109
111
  },
110
112
  "https://example.net/service/inbox": {
111
- actorIds: new Set(["https://example.net/service"]),
113
+ actorIds: /* @__PURE__ */ new Set(["https://example.net/service"]),
112
114
  sharedInbox: false
113
115
  }
114
116
  });
@@ -119,11 +121,11 @@ test("extractInboxes()", () => {
119
121
  });
120
122
  assertEquals(inboxes, {
121
123
  "https://example.org/group/inbox": {
122
- actorIds: new Set(["https://example.org/group"]),
124
+ actorIds: /* @__PURE__ */ new Set(["https://example.org/group"]),
123
125
  sharedInbox: false
124
126
  },
125
127
  "https://example.net/inbox": {
126
- actorIds: new Set(["https://example.net/service"]),
128
+ actorIds: /* @__PURE__ */ new Set(["https://example.net/service"]),
127
129
  sharedInbox: true
128
130
  }
129
131
  });
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as TaskCodec } from "../../codec-BBga-FWI.mjs";
4
+ import { t as TaskCodec } from "../../codec-peqOdBaE.mjs";
5
5
  import { Create, Link, Note, Person } from "@fedify/vocab";
6
6
  import { mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { deepStrictEqual, ok, rejects, strictEqual } from "node:assert/strict";
@@ -45,8 +45,8 @@ test("TaskCodec.serialize() / deserialize()", async (t) => {
45
45
  big: 1234567890123456789n,
46
46
  url: new URL("https://example.com/some/path"),
47
47
  list: [person, link],
48
- map: new Map([["create", create], ["n", 42]]),
49
- set: new Set([
48
+ map: /* @__PURE__ */ new Map([["create", create], ["n", 42]]),
49
+ set: /* @__PURE__ */ new Set([
50
50
  1,
51
51
  2,
52
52
  3
@@ -72,7 +72,7 @@ test("TaskCodec.serialize() / deserialize()", async (t) => {
72
72
  const map = decoded.map;
73
73
  ok(map.get("create") instanceof Create);
74
74
  strictEqual(map.get("n"), 42);
75
- deepStrictEqual(decoded.set, new Set([
75
+ deepStrictEqual(decoded.set, /* @__PURE__ */ new Set([
76
76
  1,
77
77
  2,
78
78
  3
@@ -1,10 +1,10 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as MemoryKvStore } from "../../kv-CXBAok3k.mjs";
5
- import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-CO7ftO8A.mjs";
6
- import { o as createFederation } from "../../middleware-BEd40QBF.mjs";
7
- import { n as ParallelMessageQueue } from "../../mq-Bo7Etgh6.mjs";
4
+ import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
5
+ import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-BX0Nicyq.mjs";
6
+ import { o as createFederation } from "../../middleware-C9Y5lLZN.mjs";
7
+ import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
8
8
  import { configure, reset } from "@logtape/logtape";
9
9
  import { delay } from "es-toolkit";
10
10
  import { createTestMeterProvider, test } from "@fedify/fixture";
@@ -1,12 +1,12 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as MemoryKvStore } from "../../kv-CXBAok3k.mjs";
5
- import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-CO7ftO8A.mjs";
6
- import { o as createFederation } from "../../middleware-BEd40QBF.mjs";
7
- import { r as createFederationBuilder } from "../../builder-BGpBs-US.mjs";
8
- import { t as TaskCodec } from "../../codec-BBga-FWI.mjs";
9
- import { t as InProcessMessageQueue } from "../../mq-Bo7Etgh6.mjs";
4
+ import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
5
+ import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-BX0Nicyq.mjs";
6
+ import { o as createFederation } from "../../middleware-C9Y5lLZN.mjs";
7
+ import { r as createFederationBuilder } from "../../builder-f5-YwHfj.mjs";
8
+ import { t as TaskCodec } from "../../codec-peqOdBaE.mjs";
9
+ import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
10
10
  import { W3CTraceContextPropagator } from "@opentelemetry/core";
11
11
  import { Note } from "@fedify/vocab";
12
12
  import { SpanStatusCode, propagation } from "@opentelemetry/api";
@@ -1,10 +1,10 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import "../std__assert-B2NnY9bq.mjs";
5
- import { r as assertFalse } from "../assert_rejects-EgstcQy5.mjs";
6
- import { t as assert } from "../assert-CJ1KXcvv.mjs";
7
- import { t as hasMalformedKnownTemporalLiteral } from "../temporal-X0BllGgC.mjs";
4
+ import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
5
+ import "../std__assert-CxFT0MNt.mjs";
6
+ import { t as assert } from "../assert-CebeUf0C.mjs";
7
+ import { t as hasMalformedKnownTemporalLiteral } from "../temporal-DA3jx8x1.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/temporal.test.ts
10
10
  test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
@@ -1,12 +1,12 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { r as createRequestContext } from "../context-BJXxPElm.mjs";
5
- import { t as MemoryKvStore } from "../kv-CXBAok3k.mjs";
6
- import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
7
- import "../std__assert-B2NnY9bq.mjs";
8
- import { t as assertNotEquals } from "../assert_not_equals-EPJPoxuf.mjs";
9
- import { o as createFederation, s as handleWebFinger } from "../middleware-BEd40QBF.mjs";
4
+ import { r as createRequestContext } from "../context-Dt36KFEJ.mjs";
5
+ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
+ import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
7
+ import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
8
+ import "../std__assert-CxFT0MNt.mjs";
9
+ import { o as createFederation, s as handleWebFinger } from "../middleware-C9Y5lLZN.mjs";
10
10
  import { Image, Link, Person, Tombstone } from "@fedify/vocab";
11
11
  import { createTestMeterProvider, test } from "@fedify/fixture";
12
12
  //#region src/federation/webfinger.test.ts
@@ -258,7 +258,7 @@ test("handleWebFinger()", async (t) => {
258
258
  });
259
259
  onNotFoundCalled = null;
260
260
  const actorHandleMapper = (_ctx, username) => {
261
- return username === "foo" ? "someone" : username === "bar" ? "someone2" : null;
261
+ return username === "foo" ? "someone" : username === "bar" ? "someone2" : username === "qux" ? "someone2" : null;
262
262
  };
263
263
  await t.step("handle mapper", async () => {
264
264
  const u = new URL(url);
@@ -381,21 +381,83 @@ test("handleWebFinger()", async (t) => {
381
381
  assertEquals(response.status, 404);
382
382
  });
383
383
  await t.step("handleHost", async () => {
384
- const u = new URL(url);
385
- u.searchParams.set("resource", "acct:someone@example.com");
384
+ let u = new URL("https://ap.example.com/.well-known/webfinger");
385
+ u.searchParams.set("resource", "acct:someone@ap.example.com");
386
386
  let context = createContext(u);
387
387
  let request = context.request;
388
388
  let response = await handleWebFinger(request, {
389
389
  context,
390
- host: "handle.example.com",
390
+ host: "example.com",
391
391
  actorDispatcher,
392
392
  onNotFound
393
393
  });
394
394
  assertEquals(response.status, 200);
395
395
  assertEquals(await response.json(), {
396
- ...expected,
397
- aliases: [...expected.aliases, "acct:someone@handle.example.com"]
396
+ subject: "acct:someone@example.com",
397
+ aliases: ["https://ap.example.com/users/someone", "acct:someone@ap.example.com"],
398
+ links: [
399
+ {
400
+ href: "https://ap.example.com/users/someone",
401
+ rel: "self",
402
+ type: "application/activity+json"
403
+ },
404
+ {
405
+ href: "https://ap.example.com/@someone",
406
+ rel: "http://webfinger.net/rel/profile-page"
407
+ },
408
+ {
409
+ href: "https://ap.example.com/@someone",
410
+ rel: "alternate",
411
+ type: "text/html"
412
+ },
413
+ {
414
+ href: "https://ap.example.com/icon.jpg",
415
+ rel: "http://webfinger.net/rel/avatar",
416
+ type: "image/jpeg"
417
+ }
418
+ ]
419
+ });
420
+ u.searchParams.set("resource", "acct:qux@ap.example.com");
421
+ context = createContext(u);
422
+ request = context.request;
423
+ response = await handleWebFinger(request, {
424
+ context,
425
+ host: "example.com",
426
+ actorDispatcher,
427
+ actorHandleMapper,
428
+ onNotFound
398
429
  });
430
+ assertEquals(response.status, 200);
431
+ assertEquals(await response.json(), {
432
+ subject: "acct:bar@example.com",
433
+ aliases: [
434
+ "https://ap.example.com/users/someone2",
435
+ "acct:qux@ap.example.com",
436
+ "acct:bar@ap.example.com"
437
+ ],
438
+ links: [
439
+ {
440
+ href: "https://ap.example.com/users/someone2",
441
+ rel: "self",
442
+ type: "application/activity+json"
443
+ },
444
+ {
445
+ href: "https://ap.example.com/@someone2",
446
+ rel: "http://webfinger.net/rel/profile-page"
447
+ },
448
+ {
449
+ href: "https://ap.example.com/@someone2",
450
+ rel: "alternate",
451
+ type: "text/html"
452
+ },
453
+ {
454
+ href: "https://ap.example.com/icon.jpg",
455
+ rel: "http://webfinger.net/rel/avatar",
456
+ type: "image/jpeg"
457
+ }
458
+ ]
459
+ });
460
+ u = new URL(url);
399
461
  u.searchParams.set("resource", "acct:someone@handle.example.com");
400
462
  context = createContext(u);
401
463
  request = context.request;