@fedify/fedify 1.6.1-dev.880 → 1.6.1-dev.883

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 (119) hide show
  1. package/dist/{actor-DvmEmDn9.js → actor-CwAL6Q82.js} +180 -180
  2. package/dist/{actor-DIk6hH_U.js → actor-DezwbbQX.js} +3 -3
  3. package/dist/{actor-f67C7yQD.d.ts → actor-tT_B0pDn.d.ts} +5 -8
  4. package/dist/{assert-Dv75vaGI.js → assert-YJk-1DlZ.js} +1 -1
  5. package/dist/{assert_equals-ClvzlhZu.js → assert_equals-Dnj7ejjL.js} +16 -9
  6. package/dist/{assert_instance_of--9UCVKsi.js → assert_instance_of-DBIoG5k7.js} +1 -1
  7. package/dist/{assert_is_error-D162gXcM.js → assert_is_error-jyzqjHud.js} +1 -1
  8. package/dist/{assert_not_equals-Cyf5m9Ke.js → assert_not_equals-wx-SRs4i.js} +1 -1
  9. package/dist/{assert_rejects-FOHCtlD2.js → assert_rejects-BZjUwo62.js} +2 -2
  10. package/dist/{assert_throws-CRfQJvVx.js → assert_throws-gBPv3v2V.js} +2 -2
  11. package/dist/{authdocloader-B3ME-k-0.js → authdocloader-C-_Lr-KH.js} +3 -3
  12. package/dist/{authdocloader-Bt52x-cz.js → authdocloader-Df1y1MKv.js} +4 -4
  13. package/dist/{builder-DT_CjHJM.js → builder-C8tsk_Xe.js} +3 -3
  14. package/dist/{client-Dw1pCSIt.d.ts → client-Cd552pKL.d.ts} +6 -9
  15. package/dist/{client-CSQzJhcr.js → client-CwjvB-Dh.js} +1 -1
  16. package/dist/{collection-QaGK9TVn.js → collection-Dfb0TPno.js} +1 -1
  17. package/dist/compat/mod.d.ts +12 -12
  18. package/dist/compat/mod.js +1 -1
  19. package/dist/compat/transformers.test.js +21 -21
  20. package/dist/{context-DBM4y1xF.d.ts → context-DRhhOsMk.d.ts} +12 -28
  21. package/dist/{context-DaUJ8XgG.js → context-DfToVZY6.js} +2 -2
  22. package/dist/{docloader-BesQV-nU.js → docloader-BFRgyDAa.js} +1 -2
  23. package/dist/{docloader-DdQSFoDK.js → docloader-BXc5egq6.js} +1 -2
  24. package/dist/{docloader-DTRsVZPo.d.ts → docloader-DlUDOVSe.d.ts} +4 -7
  25. package/dist/{esm-BxIKwi-M.js → esm-Btx3E8og.js} +1 -1
  26. package/dist/federation/builder.test.js +12 -12
  27. package/dist/federation/collection.test.js +9 -9
  28. package/dist/federation/handler.test.js +28 -28
  29. package/dist/federation/inbox.test.js +6 -6
  30. package/dist/federation/keycache.test.js +6 -6
  31. package/dist/federation/kv.test.js +8 -8
  32. package/dist/federation/middleware.test.js +28 -28
  33. package/dist/federation/mod.d.ts +11 -11
  34. package/dist/federation/mod.js +12 -12
  35. package/dist/federation/mq.test.js +10 -10
  36. package/dist/federation/retry.test.js +2 -2
  37. package/dist/federation/router.test.js +9 -9
  38. package/dist/federation/send.test.js +18 -18
  39. package/dist/{federation-Bmj7soSg.js → federation-3B6BDKCK.js} +1 -1
  40. package/dist/{http-nvlEiwC4.js → http-3CJyDlPz.js} +4 -4
  41. package/dist/{http-CZyKN-rt.d.ts → http-BkUCISGt.d.ts} +6 -14
  42. package/dist/{http-DKFoMKYk.js → http-DC3mY9EG.js} +4 -4
  43. package/dist/{inbox-DUxOSixz.js → inbox-CCbuuUqY.js} +4 -4
  44. package/dist/{key-C_i44VCP.js → key-CD8i4ZB_.js} +2 -2
  45. package/dist/{key-B6j6aQIf.js → key-Ce8aGBE5.js} +5 -5
  46. package/dist/{key-DnZNsfoE.js → key-D0WW7EHK.js} +3 -3
  47. package/dist/{key-BiM3rCVA.js → key-Y8a6dgOq.js} +4 -4
  48. package/dist/{keycache-NtvEqcq9.js → keycache-BtADunPo.js} +2 -2
  49. package/dist/{keys-R9p0S8_o.js → keys-BIY57kjo.js} +1 -1
  50. package/dist/{kv-BmsWxOQ2.d.ts → kv-p8sC8PTT.d.ts} +3 -7
  51. package/dist/{ld-BLZnxCWX.js → ld-D4G5WL1G.js} +4 -4
  52. package/dist/{lookup-B38eCiCI.js → lookup-C8V37GPa.js} +1 -1
  53. package/dist/{lookup-DXgwlvAK.js → lookup-CQnVHXIh.js} +3 -3
  54. package/dist/{lookup-CNK83LQK.js → lookup-Ds1_3qy2.js} +1 -1
  55. package/dist/{lookup-nlxO7x0u.d.ts → lookup-vJccIKCS.d.ts} +4 -8
  56. package/dist/middleware-DPuaf71I.js +17 -0
  57. package/dist/{middleware-Bjqgfc8l.js → middleware-DRpRVwO7.js} +18 -18
  58. package/dist/{middleware-FhQhkH0G.js → middleware-Jvf6WsMN.js} +18 -18
  59. package/dist/middleware-XHndzOUD.js +33 -0
  60. package/dist/{mod-iE_61Xjt.d.ts → mod-BTHfUeLo.d.ts} +2 -9
  61. package/dist/{mod-BUAWJ2pK.d.ts → mod-BUTm-sog.d.ts} +5 -9
  62. package/dist/{mod-CsYfI7YL.d.ts → mod-CgmTOt4z.d.ts} +3 -21
  63. package/dist/{mod-Bx6Du4Ct.d.ts → mod-DSPyncxx.d.ts} +5 -11
  64. package/dist/mod.d.ts +14 -14
  65. package/dist/mod.js +12 -12
  66. package/dist/{mq-Bue016Tz.d.ts → mq-nceTGCuc.d.ts} +3 -7
  67. package/dist/nodeinfo/client.test.js +23 -36
  68. package/dist/nodeinfo/handler.test.js +27 -27
  69. package/dist/nodeinfo/mod.d.ts +3 -3
  70. package/dist/nodeinfo/mod.js +2 -2
  71. package/dist/nodeinfo/semver.test.js +8 -8
  72. package/dist/nodeinfo/types.test.js +8 -8
  73. package/dist/{owner-C_Gw25Id.d.ts → owner-CbRc94FP.d.ts} +6 -9
  74. package/dist/{owner-DKsEWurW.js → owner-Dyk0zd-q.js} +3 -3
  75. package/dist/{proof-DtIUHGA0.js → proof-B8Hm2M5c.js} +3 -3
  76. package/dist/{proof-DKetjewp.js → proof-D-CWdNQx.js} +5 -5
  77. package/dist/runtime/authdocloader.test.js +17 -17
  78. package/dist/runtime/docloader.test.js +69 -66
  79. package/dist/runtime/key.test.js +13 -13
  80. package/dist/runtime/langstr.test.js +8 -8
  81. package/dist/runtime/mod.d.ts +5 -5
  82. package/dist/runtime/mod.js +6 -6
  83. package/dist/runtime/multibase/multibase.test.js +8 -8
  84. package/dist/runtime/url.test.js +4 -4
  85. package/dist/{send-Z9IEW2ZG.js → send-CJXTH3ST.js} +3 -3
  86. package/dist/sig/http.test.js +52 -47
  87. package/dist/sig/key.test.js +14 -14
  88. package/dist/sig/ld.test.js +12 -12
  89. package/dist/sig/mod.d.ts +7 -7
  90. package/dist/sig/mod.js +6 -6
  91. package/dist/sig/owner.test.js +16 -16
  92. package/dist/sig/proof.test.js +15 -15
  93. package/dist/{std__assert-CaBUULmX.js → std__assert-CHXwj7zk.js} +1 -1
  94. package/dist/testing/docloader.test.js +8 -8
  95. package/dist/testing/mod.d.ts +0 -1
  96. package/dist/{transformers-jxj-4o2K.js → transformers-ghwJuzGY.js} +1 -1
  97. package/dist/{types-C9A_t_ZN.js → types-D3XNqpGz.js} +1 -1
  98. package/dist/vocab/actor.test.js +60 -49
  99. package/dist/vocab/lookup.test.js +13 -13
  100. package/dist/vocab/mod.d.ts +5 -5
  101. package/dist/vocab/mod.js +4 -4
  102. package/dist/vocab/type.test.js +3 -3
  103. package/dist/vocab/vocab.test.js +129 -132
  104. package/dist/{vocab-CHuz96Ha.js → vocab-CPrCb9BR.js} +3 -3
  105. package/dist/{vocab-7mZSoHR0.js → vocab-CaZSjoCB.js} +178 -178
  106. package/dist/{vocab-C4bpdeio.d.ts → vocab-DSFLLLe6.d.ts} +2 -7
  107. package/dist/webfinger/handler.test.js +27 -27
  108. package/dist/webfinger/lookup.test.js +41 -46
  109. package/dist/webfinger/mod.d.ts +3 -3
  110. package/dist/webfinger/mod.js +2 -2
  111. package/dist/x/cfworkers.d.ts +2 -9
  112. package/dist/x/cfworkers.test.js +8 -8
  113. package/dist/x/hono.d.ts +11 -12
  114. package/dist/x/sveltekit.d.ts +11 -12
  115. package/package.json +2 -3
  116. package/dist/hongminhee__deno-mock-fetch-DJKLj_H-.js +0 -188
  117. package/dist/middleware-B8XTnZdu.js +0 -33
  118. package/dist/middleware-D-_NS4x8.js +0 -17
  119. /package/dist/{denokv-iB_ggPGm.js → denokv-B_GFWjrl.js} +0 -0
@@ -1,13 +1,10 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { DocumentLoader } from "./docloader-DTRsVZPo.js";
3
+ import { DocumentLoader } from "./docloader-DlUDOVSe.js";
4
4
  import { Span, TracerProvider } from "@opentelemetry/api";
5
5
  import { LanguageTag } from "@phensley/language-tag";
6
6
 
7
7
  //#region runtime/langstr.d.ts
8
- /**
9
- * A language-tagged string which corresponds to the `rdf:langString` type.
10
- */
11
8
  /**
12
9
  * A language-tagged string which corresponds to the `rdf:langString` type.
13
10
  */
@@ -21,7 +18,6 @@ declare class LanguageString extends String {
21
18
  */
22
19
  constructor(value: string, language: LanguageTag | string);
23
20
  }
24
-
25
21
  //#endregion
26
22
  //#region vocab/vocab.d.ts
27
23
  /** Describes an object of any kind. The Object type serves as the base type for
@@ -14455,6 +14451,5 @@ declare class View extends Activity {
14455
14451
  }): Promise<View>;
14456
14452
  protected _getCustomInspectProxy(): Record<string, unknown>;
14457
14453
  }
14458
-
14459
14454
  //#endregion
14460
- export { Accept as Accept$1, Activity as Activity$1, Add as Add$1, Announce as Announce$1, Application as Application$1, Arrive as Arrive$1, Article as Article$1, Audio as Audio$1, Block as Block$1, ChatMessage as ChatMessage$1, Collection as Collection$1, CollectionPage as CollectionPage$1, Create as Create$1, CryptographicKey as CryptographicKey$1, DataIntegrityProof as DataIntegrityProof$1, Delete as Delete$1, DidService as DidService$1, Dislike as Dislike$1, Document as Document$1, Emoji as Emoji$1, EmojiReact as EmojiReact$1, Endpoints as Endpoints$1, Event as Event$1, Export as Export$1, Flag as Flag$1, Follow as Follow$1, Group as Group$1, Hashtag as Hashtag$1, Ignore as Ignore$1, Image as Image$1, IntransitiveActivity as IntransitiveActivity$1, Invite as Invite$1, Join as Join$1, LanguageString as LanguageString$1, Leave as Leave$1, Like as Like$1, Link as Link$2, Listen as Listen$1, Mention as Mention$1, Move as Move$1, Multikey as Multikey$1, Note as Note$1, Object$1, Offer as Offer$1, OrderedCollection as OrderedCollection$1, OrderedCollectionPage as OrderedCollectionPage$1, Organization as Organization$1, Page as Page$1, Person as Person$1, Place as Place$1, Profile as Profile$1, PropertyValue as PropertyValue$1, Question as Question$1, Read as Read$1, Reject as Reject$1, Relationship as Relationship$1, Remove as Remove$1, Service as Service$1, Source as Source$1, TentativeAccept as TentativeAccept$1, TentativeReject as TentativeReject$1, Tombstone as Tombstone$1, Travel as Travel$1, Undo as Undo$1, Update as Update$1, Video as Video$1, View as View$1 };
14455
+ export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, LanguageString, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View };
@@ -3,44 +3,44 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { assertEquals } from "../assert_equals-ClvzlhZu.js";
7
- import "../assert-Dv75vaGI.js";
8
- import "../assert_instance_of--9UCVKsi.js";
6
+ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
+ import "../assert-YJk-1DlZ.js";
8
+ import "../assert_instance_of-DBIoG5k7.js";
9
9
  import { MemoryKvStore } from "../kv-DohFOP2C.js";
10
- import { createFederation, handleWebFinger } from "../middleware-Bjqgfc8l.js";
11
- import "../docloader-DdQSFoDK.js";
10
+ import { createFederation, handleWebFinger } from "../middleware-DRpRVwO7.js";
11
+ import "../docloader-BXc5egq6.js";
12
12
  import "../url-kTAI6_KP.js";
13
13
  import "../semver-CbbIgUsa.js";
14
- import "../client-CSQzJhcr.js";
14
+ import "../client-CwjvB-Dh.js";
15
15
  import "../router-D_aVZZUc.js";
16
16
  import "../types-CqoqWDkp.js";
17
17
  import "../multibase-DeCHcK8L.js";
18
- import { Image, Link, Person } from "../vocab-7mZSoHR0.js";
18
+ import { Image, Link, Person } from "../vocab-CaZSjoCB.js";
19
19
  import "../langstr-DbWheeIS.js";
20
- import "../lookup-CNK83LQK.js";
20
+ import "../lookup-Ds1_3qy2.js";
21
21
  import "../type-D2s5lmbZ.js";
22
- import "../actor-DIk6hH_U.js";
23
- import "../key-DnZNsfoE.js";
24
- import "../http-nvlEiwC4.js";
25
- import "../authdocloader-B3ME-k-0.js";
26
- import "../ld-BLZnxCWX.js";
27
- import "../owner-DKsEWurW.js";
28
- import "../proof-DtIUHGA0.js";
29
- import "../lookup-DXgwlvAK.js";
30
- import "../inbox-DUxOSixz.js";
31
- import "../builder-DT_CjHJM.js";
32
- import "../collection-QaGK9TVn.js";
33
- import "../keycache-NtvEqcq9.js";
22
+ import "../actor-DezwbbQX.js";
23
+ import "../key-D0WW7EHK.js";
24
+ import "../http-3CJyDlPz.js";
25
+ import "../authdocloader-C-_Lr-KH.js";
26
+ import "../ld-D4G5WL1G.js";
27
+ import "../owner-Dyk0zd-q.js";
28
+ import "../proof-B8Hm2M5c.js";
29
+ import "../lookup-CQnVHXIh.js";
30
+ import "../inbox-CCbuuUqY.js";
31
+ import "../builder-C8tsk_Xe.js";
32
+ import "../collection-Dfb0TPno.js";
33
+ import "../keycache-BtADunPo.js";
34
34
  import "../retry-BiIhZWgD.js";
35
- import "../send-Z9IEW2ZG.js";
35
+ import "../send-CJXTH3ST.js";
36
36
  import { test } from "../testing-jcGLO9Lp.js";
37
- import "../std__assert-CaBUULmX.js";
38
- import "../assert_rejects-FOHCtlD2.js";
39
- import "../assert_is_error-D162gXcM.js";
40
- import "../assert_not_equals-Cyf5m9Ke.js";
41
- import "../assert_throws-CRfQJvVx.js";
37
+ import "../std__assert-CHXwj7zk.js";
38
+ import "../assert_rejects-BZjUwo62.js";
39
+ import "../assert_is_error-jyzqjHud.js";
40
+ import "../assert_not_equals-wx-SRs4i.js";
41
+ import "../assert_throws-gBPv3v2V.js";
42
42
  import "../docloader-09nVWLAZ.js";
43
- import { createRequestContext } from "../context-DaUJ8XgG.js";
43
+ import { createRequestContext } from "../context-DfToVZY6.js";
44
44
 
45
45
  //#region webfinger/handler.test.ts
46
46
  test("handleWebFinger()", async (t) => {
@@ -3,19 +3,19 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { assertEquals } from "../assert_equals-ClvzlhZu.js";
7
- import "../assert-Dv75vaGI.js";
8
- import "../assert_instance_of--9UCVKsi.js";
9
- import "../docloader-DdQSFoDK.js";
6
+ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
+ import "../assert-YJk-1DlZ.js";
8
+ import "../assert_instance_of-DBIoG5k7.js";
9
+ import "../docloader-BXc5egq6.js";
10
10
  import "../url-kTAI6_KP.js";
11
- import { lookupWebFinger } from "../lookup-CNK83LQK.js";
11
+ import { lookupWebFinger } from "../lookup-Ds1_3qy2.js";
12
12
  import { test } from "../testing-jcGLO9Lp.js";
13
- import "../std__assert-CaBUULmX.js";
14
- import "../assert_rejects-FOHCtlD2.js";
15
- import "../assert_is_error-D162gXcM.js";
16
- import "../assert_not_equals-Cyf5m9Ke.js";
17
- import "../assert_throws-CRfQJvVx.js";
18
- import { install, mock, uninstall } from "../hongminhee__deno-mock-fetch-DJKLj_H-.js";
13
+ import "../std__assert-CHXwj7zk.js";
14
+ import "../assert_rejects-BZjUwo62.js";
15
+ import "../assert_is_error-jyzqjHud.js";
16
+ import "../assert_not_equals-wx-SRs4i.js";
17
+ import "../assert_throws-gBPv3v2V.js";
18
+ import { esm_default } from "../esm-Btx3E8og.js";
19
19
  import { withTimeout } from "@es-toolkit/es-toolkit";
20
20
 
21
21
  //#region webfinger/lookup.test.ts
@@ -34,11 +34,8 @@ test({
34
34
  assertEquals(await lookupWebFinger("acct:johndoe@fedify-test.internal"), null);
35
35
  assertEquals(await lookupWebFinger("https://fedify-test.internal/foo"), null);
36
36
  });
37
- install();
38
- mock("GET@/.well-known/webfinger", (req) => {
39
- assertEquals(new URL(req.url).host, "example.com");
40
- return new Response("", { status: 404 });
41
- });
37
+ esm_default.spyGlobal();
38
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", { status: 404 });
42
39
  await t.step("not found", async () => {
43
40
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), null);
44
41
  assertEquals(await lookupWebFinger("https://example.com/foo"), null);
@@ -47,10 +44,8 @@ test({
47
44
  subject: "acct:johndoe@example.com",
48
45
  links: []
49
46
  };
50
- mock("GET@/.well-known/webfinger", (req) => {
51
- assertEquals(req.url, "https://example.com/.well-known/webfinger?resource=acct%3Ajohndoe%40example.com");
52
- return new Response(JSON.stringify(expected));
53
- });
47
+ esm_default.removeRoutes();
48
+ esm_default.get("https://example.com/.well-known/webfinger?resource=acct%3Ajohndoe%40example.com", { body: expected });
54
49
  await t.step("acct", async () => {
55
50
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), expected);
56
51
  });
@@ -58,28 +53,24 @@ test({
58
53
  subject: "https://example.com/foo",
59
54
  links: []
60
55
  };
61
- mock("GET@/.well-known/webfinger", (req) => {
62
- assertEquals(req.url, "https://example.com/.well-known/webfinger?resource=https%3A%2F%2Fexample.com%2Ffoo");
63
- return new Response(JSON.stringify(expected2));
64
- });
56
+ esm_default.removeRoutes();
57
+ esm_default.get("https://example.com/.well-known/webfinger?resource=https%3A%2F%2Fexample.com%2Ffoo", { body: expected2 });
65
58
  await t.step("https", async () => {
66
59
  assertEquals(await lookupWebFinger("https://example.com/foo"), expected2);
67
60
  });
68
- mock("GET@/.well-known/webfinger", (_req) => {
69
- return new Response("not json");
70
- });
61
+ esm_default.removeRoutes();
62
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", { body: "not json" });
71
63
  await t.step("invalid response", async () => {
72
64
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), null);
73
65
  });
74
- mock("GET@/.well-known/webfinger", (_req) => {
75
- return new Response(JSON.stringify({
76
- subject: "acct:test@localhost",
77
- links: [{
78
- rel: "self",
79
- type: "application/activity+json",
80
- href: "https://localhost/actor"
81
- }]
82
- }));
66
+ esm_default.removeRoutes();
67
+ esm_default.get("begin:https://localhost/.well-known/webfinger?", {
68
+ subject: "acct:test@localhost",
69
+ links: [{
70
+ rel: "self",
71
+ type: "application/activity+json",
72
+ href: "https://localhost/actor"
73
+ }]
83
74
  });
84
75
  await t.step("private address", async () => {
85
76
  assertEquals(await lookupWebFinger("acct:test@localhost"), null);
@@ -92,37 +83,41 @@ test({
92
83
  }]
93
84
  });
94
85
  });
95
- mock("GET@/.well-known/webfinger", (_) => new Response("", {
86
+ esm_default.removeRoutes();
87
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", {
96
88
  status: 302,
97
89
  headers: { Location: "/.well-known/webfinger2" }
98
- }));
99
- mock("GET@/.well-known/webfinger2", (_) => new Response(JSON.stringify(expected)));
90
+ });
91
+ esm_default.get("begin:https://example.com/.well-known/webfinger2", { body: expected });
100
92
  await t.step("redirection", async () => {
101
93
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), expected);
102
94
  });
103
- mock("GET@/.well-known/webfinger", (_) => new Response("", {
95
+ esm_default.removeRoutes();
96
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", {
104
97
  status: 302,
105
98
  headers: { Location: "/.well-known/webfinger" }
106
- }));
99
+ });
107
100
  await t.step("infinite redirection", async () => {
108
101
  const result = await withTimeout(() => lookupWebFinger("acct:johndoe@example.com"), 2e3);
109
102
  assertEquals(result, null);
110
103
  });
111
- mock("GET@/.well-known/webfinger", (_) => new Response("", {
104
+ esm_default.removeRoutes();
105
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", {
112
106
  status: 302,
113
107
  headers: { Location: "ftp://example.com/" }
114
- }));
108
+ });
115
109
  await t.step("redirection to different protocol", async () => {
116
110
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), null);
117
111
  });
118
- mock("GET@/.well-known/webfinger", (_) => new Response("", {
112
+ esm_default.removeRoutes();
113
+ esm_default.get("begin:https://example.com/.well-known/webfinger?", {
119
114
  status: 302,
120
115
  headers: { Location: "https://localhost/" }
121
- }));
116
+ });
122
117
  await t.step("redirection to private address", async () => {
123
118
  assertEquals(await lookupWebFinger("acct:johndoe@example.com"), null);
124
119
  });
125
- uninstall();
120
+ esm_default.hardReset();
126
121
  }
127
122
  });
128
123
 
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import "../kv-BmsWxOQ2.js";
4
- import "../docloader-DTRsVZPo.js";
5
- import { Link$1 as Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger$1 as lookupWebFinger } from "../lookup-nlxO7x0u.js";
3
+ import "../kv-p8sC8PTT.js";
4
+ import "../docloader-DlUDOVSe.js";
5
+ import { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger } from "../lookup-vJccIKCS.js";
6
6
  import "../mod-GIh5OYxW.js";
7
7
  export { Link, LookupWebFingerOptions, ResourceDescriptor, lookupWebFinger };
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import "../docloader-BesQV-nU.js";
6
- import { lookupWebFinger } from "../lookup-B38eCiCI.js";
5
+ import "../docloader-BFRgyDAa.js";
6
+ import { lookupWebFinger } from "../lookup-C8V37GPa.js";
7
7
  import "../webfinger-C3GIyXIg.js";
8
8
 
9
9
  export { lookupWebFinger };
@@ -1,16 +1,10 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { KvKey, KvStore, KvStoreSetOptions } from "../kv-BmsWxOQ2.js";
4
- import { MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions } from "../mq-Bue016Tz.js";
3
+ import { KvKey, KvStore, KvStoreSetOptions } from "../kv-p8sC8PTT.js";
4
+ import { MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions } from "../mq-nceTGCuc.js";
5
5
  import { KVNamespace, Queue } from "@cloudflare/workers-types/experimental";
6
6
 
7
7
  //#region x/cfworkers.d.ts
8
- /**
9
- * Implementation of the {@link KvStore} interface for Cloudflare Workers KV
10
- * binding. This class provides a wrapper around Cloudflare's KV namespace to
11
- * store and retrieve JSON-serializable values using structured keys.
12
- * @since 1.6.0
13
- */
14
8
 
15
9
  /**
16
10
  * Implementation of the {@link KvStore} interface for Cloudflare Workers KV
@@ -44,6 +38,5 @@ declare class WorkersMessageQueue implements MessageQueue {
44
38
  enqueueMany(messages: any[], options?: MessageQueueEnqueueOptions): Promise<void>;
45
39
  listen(_handler: (message: any) => Promise<void> | void, _options?: MessageQueueListenOptions): Promise<void>;
46
40
  }
47
-
48
41
  //#endregion
49
42
  export { WorkersKvStore, WorkersMessageQueue };
@@ -3,15 +3,15 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { assertEquals } from "../assert_equals-ClvzlhZu.js";
7
- import "../assert-Dv75vaGI.js";
8
- import "../assert_instance_of--9UCVKsi.js";
6
+ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
7
+ import "../assert-YJk-1DlZ.js";
8
+ import "../assert_instance_of-DBIoG5k7.js";
9
9
  import { test } from "../testing-jcGLO9Lp.js";
10
- import "../std__assert-CaBUULmX.js";
11
- import "../assert_rejects-FOHCtlD2.js";
12
- import "../assert_is_error-D162gXcM.js";
13
- import "../assert_not_equals-Cyf5m9Ke.js";
14
- import "../assert_throws-CRfQJvVx.js";
10
+ import "../std__assert-CHXwj7zk.js";
11
+ import "../assert_rejects-BZjUwo62.js";
12
+ import "../assert_is_error-jyzqjHud.js";
13
+ import "../assert_not_equals-wx-SRs4i.js";
14
+ import "../assert_throws-gBPv3v2V.js";
15
15
  import { delay } from "@es-toolkit/es-toolkit";
16
16
 
17
17
  //#region x/cfworkers.ts
package/dist/x/hono.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import "../kv-BmsWxOQ2.js";
4
- import "../docloader-DTRsVZPo.js";
5
- import "../client-Dw1pCSIt.js";
6
- import "../vocab-C4bpdeio.js";
7
- import "../actor-f67C7yQD.js";
8
- import "../http-CZyKN-rt.js";
9
- import "../owner-C_Gw25Id.js";
10
- import "../mod-Bx6Du4Ct.js";
11
- import "../lookup-nlxO7x0u.js";
12
- import { Federation } from "../context-DBM4y1xF.js";
13
- import "../mq-Bue016Tz.js";
3
+ import "../kv-p8sC8PTT.js";
4
+ import "../docloader-DlUDOVSe.js";
5
+ import "../client-Cd552pKL.js";
6
+ import "../vocab-DSFLLLe6.js";
7
+ import "../actor-tT_B0pDn.js";
8
+ import "../http-BkUCISGt.js";
9
+ import "../owner-CbRc94FP.js";
10
+ import "../mod-DSPyncxx.js";
11
+ import "../lookup-vJccIKCS.js";
12
+ import { Federation } from "../context-DRhhOsMk.js";
13
+ import "../mq-nceTGCuc.js";
14
14
 
15
15
  //#region x/hono.d.ts
16
16
  interface HonoRequest {
@@ -44,6 +44,5 @@ type ContextDataFactory<TContextData, THonoContext> = (context: THonoContext) =>
44
44
  * @returns A Hono middleware.
45
45
  */
46
46
  declare function federation<TContextData, THonoContext extends HonoContext>(federation: Federation<TContextData>, contextDataFactory: ContextDataFactory<TContextData, THonoContext>): HonoMiddleware<THonoContext>;
47
-
48
47
  //#endregion
49
48
  export { ContextDataFactory, federation };
@@ -1,16 +1,16 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import "../kv-BmsWxOQ2.js";
4
- import "../docloader-DTRsVZPo.js";
5
- import "../client-Dw1pCSIt.js";
6
- import "../vocab-C4bpdeio.js";
7
- import "../actor-f67C7yQD.js";
8
- import "../http-CZyKN-rt.js";
9
- import "../owner-C_Gw25Id.js";
10
- import "../mod-Bx6Du4Ct.js";
11
- import "../lookup-nlxO7x0u.js";
12
- import { Federation } from "../context-DBM4y1xF.js";
13
- import "../mq-Bue016Tz.js";
3
+ import "../kv-p8sC8PTT.js";
4
+ import "../docloader-DlUDOVSe.js";
5
+ import "../client-Cd552pKL.js";
6
+ import "../vocab-DSFLLLe6.js";
7
+ import "../actor-tT_B0pDn.js";
8
+ import "../http-BkUCISGt.js";
9
+ import "../owner-CbRc94FP.js";
10
+ import "../mod-DSPyncxx.js";
11
+ import "../lookup-vJccIKCS.js";
12
+ import { Federation } from "../context-DRhhOsMk.js";
13
+ import "../mq-nceTGCuc.js";
14
14
 
15
15
  //#region x/sveltekit.d.ts
16
16
  type RequestEvent = {
@@ -40,6 +40,5 @@ type HookParams = {
40
40
  * @since 1.3.0
41
41
  */
42
42
  declare function fedifyHook<TContextData>(federation: Federation<TContextData>, createContextData: (event: RequestEvent) => TContextData | Promise<TContextData>): (params: HookParams) => Promise<Response>;
43
-
44
43
  //#endregion
45
44
  export { fedifyHook };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.6.1-dev.880+8ba8fc31",
3
+ "version": "1.6.1-dev.883+dd017372",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -86,7 +86,7 @@
86
86
  "@es-toolkit/es-toolkit": "npm:es-toolkit@^1.38.0",
87
87
  "@hugoalh/http-header-link": "^1.0.2",
88
88
  "@js-temporal/polyfill": "^0.5.1",
89
- "@logtape/logtape": "^0.10.0",
89
+ "@logtape/logtape": "^0.11.0",
90
90
  "@multiformats/base-x": "^4.0.1",
91
91
  "@opentelemetry/api": "^1.9.0",
92
92
  "@opentelemetry/semantic-conventions": "^1.27.0",
@@ -104,7 +104,6 @@
104
104
  },
105
105
  "devDependencies": {
106
106
  "@cloudflare/workers-types": "^4.20250529.0",
107
- "@hongminhee/deno-mock-fetch": "npm:@jsr/hongminhee__deno-mock-fetch@^0.3.2",
108
107
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
109
108
  "@std/path": "npm:@jsr/std__path@^1.0.9",
110
109
  "@std/url": "npm:@jsr/std__url@1.0.0-rc.3",
@@ -1,188 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- //#region node_modules/.pnpm/@jsr+hongminhee__deno-mock-fetch@0.3.2/node_modules/@jsr/hongminhee__deno-mock-fetch/router.js
7
- /**
8
- * A deno deploy compatible request handler which can be either sync or async
9
- * and gets passed the `Request`, it then eventually returns a `Response`
10
- */
11
- /**
12
- * The default other handler for the router
13
- */ function defaultOtherHandler(_req) {
14
- return new Response(null, { status: 404 });
15
- }
16
- /**
17
- * The default error handler for the router
18
- */ function defaultErrorHandler(_req, err) {
19
- console.error(err);
20
- return new Response(null, { status: 500 });
21
- }
22
- /**
23
- * The default unknown method handler for the router
24
- */ function defaultUnknownMethodHandler(_req, knownMethods) {
25
- return new Response(null, {
26
- status: 405,
27
- headers: { Accept: knownMethods.join(", ") }
28
- });
29
- }
30
- const METHODS = [
31
- "GET",
32
- "HEAD",
33
- "POST",
34
- "PUT",
35
- "DELETE",
36
- "OPTIONS",
37
- "PATCH"
38
- ];
39
- const methodRegex = new RegExp(`(?<=^(?:${METHODS.join("|")}))@`);
40
- /**
41
- * A simple and tiny router for deno deploy
42
- *
43
- * ```
44
- * import { listenAndServe } from "https://deno.land/std/http/server.ts";
45
- * import { router } from "https://crux.land/router@0.0.5";
46
- *
47
- * await listenAndServe(
48
- * ":8080",
49
- * router({
50
- * "/": (_req) => new Response("Hello world!", { status: 200 }),
51
- * }),
52
- * );
53
- * ```
54
- *
55
- * @param routes A record of all routes and their corresponding handler functions
56
- * @param other An optional parameter which contains a handler for anything that
57
- * doesn't match the `routes` parameter
58
- * @param error An optional parameter which contains a handler for any time it
59
- * fails to run the default request handling code
60
- * @param unknownMethod An optional parameter which contains a handler for any time a method
61
- * that is not defined is used
62
- * @returns A deno deploy compatible request handler
63
- */ function router(routes, other = defaultOtherHandler, error = defaultErrorHandler, unknownMethod = defaultUnknownMethodHandler) {
64
- return async (req) => {
65
- try {
66
- const internalRoutes = {};
67
- for (const [route, handler] of Object.entries(routes)) {
68
- const [methodOrPath, path] = route.split(methodRegex);
69
- if (path) {
70
- internalRoutes[path] ??= {};
71
- internalRoutes[path][methodOrPath] = handler;
72
- } else {
73
- internalRoutes[methodOrPath] ??= {};
74
- internalRoutes[methodOrPath]["any"] = handler;
75
- }
76
- }
77
- for (const [path, methods] of Object.entries(internalRoutes)) {
78
- const pattern = new URLPattern({ pathname: path });
79
- const res = pattern.exec(req.url);
80
- if (res !== null) {
81
- for (const [method, handler] of Object.entries(methods)) if (req.method === method) return await handler(req, res.pathname.groups);
82
- if (methods["any"]) return await methods["any"](req, res.pathname.groups);
83
- else return await unknownMethod(req, Object.keys(methods));
84
- }
85
- }
86
- return await other(req);
87
- } catch (err) {
88
- return error(req, err);
89
- }
90
- };
91
- }
92
-
93
- //#endregion
94
- //#region node_modules/.pnpm/@jsr+hongminhee__deno-mock-fetch@0.3.2/node_modules/@jsr/hongminhee__deno-mock-fetch/mod.js
95
- var UnhandledRouteError = class extends Error {
96
- routes;
97
- request;
98
- constructor(init) {
99
- const { request, routes } = init;
100
- const method = request.method;
101
- const reqPath = new URL(request.url).pathname;
102
- const routesNumber = Object.entries(routes).length;
103
- const routePlural = routesNumber === 1 ? "route has a handler" : "routes have handlers";
104
- super(`${method} ${reqPath} (${routesNumber} ${routePlural})`);
105
- this.name = this.constructor.name;
106
- if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
107
- this.routes = routes;
108
- this.request = request;
109
- }
110
- };
111
- /**
112
- * Get a set of functions that do not share any state with the globals.
113
- *
114
- * The returned object can be destructured.
115
- *
116
- * ```
117
- * const { fetch, mock, remove, reset } = sandbox()
118
- * ```
119
- */ function sandbox() {
120
- const routeStore = new Map();
121
- async function fetch(input, init) {
122
- if (input instanceof URL) input = input.toString();
123
- const req = new Request(input, init);
124
- const routes = Object.fromEntries(routeStore.entries());
125
- return await router(routes, (request) => {
126
- throw new UnhandledRouteError({
127
- request,
128
- routes
129
- });
130
- }, (_, error) => {
131
- throw error;
132
- })(req);
133
- }
134
- function mock$1(route, handler) {
135
- routeStore.set(route, handler);
136
- }
137
- function remove$1(route) {
138
- routeStore.delete(route);
139
- }
140
- function reset$1() {
141
- routeStore.clear();
142
- }
143
- return {
144
- reset: reset$1,
145
- mock: mock$1,
146
- remove: remove$1,
147
- fetch
148
- };
149
- }
150
- const globalMockFetch = sandbox();
151
- /** This is the function that replaces `fetch` when you call `install()`. */ const mockedFetch = globalMockFetch.fetch;
152
- /**
153
- * Mock a new route, or override an existing handler.
154
- *
155
- * The route uses URLPattern syntax, with the additional extension of
156
- * (optional) method routing by prefixing with the method,
157
- * eg. `"POST@/user/:id"`.
158
- *
159
- * The handler function may be asynchronous.
160
- *
161
- * ```
162
- * mock("GET@/users/:id", async (_req, params) => {
163
- * const id = parseInt(params["id"]);
164
- * const data = await magicallyGetMyUserData(id);
165
- * return new Response(JSON.stringify(data));
166
- * })
167
- * ```
168
- */ const mock = globalMockFetch.mock;
169
- /** Remove an existing route handler. */ const remove = globalMockFetch.remove;
170
- /** Remove all existing route handlers. */ const reset = globalMockFetch.reset;
171
- const originalFetch = globalThis.fetch;
172
- /**
173
- * Replace `globalThis.fetch` with `mockedFetch` (or another function that
174
- * matches the `fetch` signature)
175
- *
176
- * To restore the original `globalThis.fetch`, call `uninstall()`.
177
- */ const install = (replacement) => {
178
- globalThis.fetch = replacement ?? mockedFetch;
179
- };
180
- /**
181
- * Restore `globalThis.fetch` to what it was before this library was imported.
182
- */ const uninstall = () => {
183
- globalThis.fetch = originalFetch;
184
- reset();
185
- };
186
-
187
- //#endregion
188
- export { install, mock, uninstall };
@@ -1,33 +0,0 @@
1
-
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
- globalThis.addEventListener = () => {};
5
-
6
- import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-Bjqgfc8l.js";
7
- import "./docloader-DdQSFoDK.js";
8
- import "./url-kTAI6_KP.js";
9
- import "./semver-CbbIgUsa.js";
10
- import "./client-CSQzJhcr.js";
11
- import "./router-D_aVZZUc.js";
12
- import "./types-CqoqWDkp.js";
13
- import "./multibase-DeCHcK8L.js";
14
- import "./vocab-7mZSoHR0.js";
15
- import "./langstr-DbWheeIS.js";
16
- import "./lookup-CNK83LQK.js";
17
- import "./type-D2s5lmbZ.js";
18
- import "./actor-DIk6hH_U.js";
19
- import "./key-DnZNsfoE.js";
20
- import "./http-nvlEiwC4.js";
21
- import "./authdocloader-B3ME-k-0.js";
22
- import "./ld-BLZnxCWX.js";
23
- import "./owner-DKsEWurW.js";
24
- import "./proof-DtIUHGA0.js";
25
- import "./lookup-DXgwlvAK.js";
26
- import "./inbox-DUxOSixz.js";
27
- import "./builder-DT_CjHJM.js";
28
- import "./collection-QaGK9TVn.js";
29
- import "./keycache-NtvEqcq9.js";
30
- import "./retry-BiIhZWgD.js";
31
- import "./send-Z9IEW2ZG.js";
32
-
33
- export { FederationImpl };